"Inline" BASIC Extensions
Re: "Inline" BASIC Extensions
But what happens with repeated LPRINT?
Is the second LPRINT again at the first position? I would expect it to fill the printer buffer until it's a full line and then print the line.
Is there an easy way to get the current printer position and is it enough to reset this?
Is the second LPRINT again at the first position? I would expect it to fill the printer buffer until it's a full line and then print the line.
Is there an easy way to get the current printer position and is it enough to reset this?
In theory, there is no difference between theory and practice. But, in practice, there is.
Re: "Inline" BASIC Extensions
I would make code like this:
PRINT (c$(1)+c$(2)) AND USR n
where at N the data on the calculator stack is fetched and a result with BC =0 would prevent any display.
Used it on the ZX Spectrum many times.
PRINT (c$(1)+c$(2)) AND USR n
where at N the data on the calculator stack is fetched and a result with BC =0 would prevent any display.
Used it on the ZX Spectrum many times.
Re: "Inline" BASIC Extensions
I'll have to play around with this idea, it may be possible to pass all parameters if they're less than 256 via LPRINT...siggi wrote: ↑Tue Mar 21, 2023 9:45 am
using
21 LPRINT C$(1 to 2);
is easier.
Then the machine code can fetch PRINTABLE(!) characters from printer buffer (address 16444....) and the length of the basic code does not need to be calculated to call the machine code (line 20).
A single number X can be passed to m/c using RAND X and fetch the number X from address 16434
LPRINT C$(1 TO 2)+CHR$ X;
Greg
Re: "Inline" BASIC Extensions
If the printer buffer reach 32 characters, it prints the buffer!
This example reset the printer buffer:10 LPRINT "ZX81";
30 GOTO 10
In ASM:10 LPRINT "ZX81";
20 POKE 16444,118
30 GOTO 10
LD (IY+60),118
Or Set the PR_CC to 60 ( Offset from IY =PR_BUFF): "20 POKE 16440,60"
LD (IY+56),60
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Re: "Inline" BASIC Extensions
Thanks Xav, exactly what I was looking for!XavSnap wrote: ↑Tue Mar 21, 2023 11:02 pmIf the printer buffer reach 32 characters, it prints the buffer!This example reset the printer buffer:10 LPRINT "ZX81";
30 GOTO 10In ASM:10 LPRINT "ZX81";
20 POKE 16444,118
30 GOTO 10
LD (IY+60),118
Or Set the PR_CC to 60 ( Offset from IY =PR_BUFF): "20 POKE 16440,60"
LD (IY+56),60
![Idea :idea:](./images/smilies/icon_idea.gif)
In theory, there is no difference between theory and practice. But, in practice, there is.
Re: "Inline" BASIC Extensions
Same as for PRINT on screen: non-printable chars are LPRINTed as "?", so 0-63 and 128 to 191 are OKGCHarder wrote: ↑Tue Mar 21, 2023 9:47 pmI'll have to play around with this idea, it may be possible to pass all parameters if they're less than 256 via LPRINT...siggi wrote: ↑Tue Mar 21, 2023 9:45 am
using
21 LPRINT C$(1 to 2);
is easier.
Then the machine code can fetch PRINTABLE(!) characters from printer buffer (address 16444....) and the length of the basic code does not need to be calculated to call the machine code (line 20).
A single number X can be passed to m/c using RAND X and fetch the number X from address 16434
LPRINT C$(1 TO 2)+CHR$ X;
Greg
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware
http://zx81.ddns.net/ZxTeaM
http://zx81.ddns.net/ZxTeaM
Re: "Inline" BASIC Extensions
I'm tending to forgo using LPRINT for parameter passing as it would make the programs incompatible with ZXPand.
Regards;
Greg
Regards;
Greg
New version "Inline" routines.
I've uploaded a new version of the "Inline" program. I've done away with all the POKEs for parameter passing. Without the POKEs the GOSUBs are no longer needed so things are bit faster as well.
Parameter passing is now in the form...
10 PRINT USR FILL;[Lines],[CODE CHR "X"]
I've added two new routines "Quick Print" and "Spiral Wipe".
See Readme for details;
Enjoy;
Greg
Parameter passing is now in the form...
10 PRINT USR FILL;[Lines],[CODE CHR "X"]
I've added two new routines "Quick Print" and "Spiral Wipe".
See Readme for details;
Enjoy;
Greg
New "Inline" routine-Diagonal Wipe
Makes a nifty display.
I'll add this to the main program later on I'm still working on other routines as well.
Enjoy;
Greg
I'll add this to the main program later on I'm still working on other routines as well.
Enjoy;
Greg
- Attachments
-
- Diagonal Wipe.zip
- Demo program
- (2.48 KiB) Downloaded 149 times