Page 2 of 4

Re: "Inline" BASIC Extensions

Posted: Tue Mar 21, 2023 11:50 am
by Paul
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?

Re: "Inline" BASIC Extensions

Posted: Tue Mar 21, 2023 11:59 am
by dr beep
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.

Re: "Inline" BASIC Extensions

Posted: Tue Mar 21, 2023 9:47 pm
by GCHarder
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
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...

LPRINT C$(1 TO 2)+CHR$ X;

Greg

Re: "Inline" BASIC Extensions

Posted: Tue Mar 21, 2023 11:02 pm
by XavSnap
Paul wrote: Tue Mar 21, 2023 11:50 am But what happens with repeated LPRINT?
If the printer buffer reach 32 characters, it prints the buffer!
10 LPRINT "ZX81";
30 GOTO 10
This example reset the printer buffer:
10 LPRINT "ZX81";
20 POKE 16444,118
30 GOTO 10
In ASM:
LD (IY+60),118

Or Set the PR_CC to 60 ( Offset from IY =PR_BUFF): "20 POKE 16440,60"
LD (IY+56),60

Re: "Inline" BASIC Extensions

Posted: Wed Mar 22, 2023 7:06 am
by Paul
XavSnap wrote: Tue Mar 21, 2023 11:02 pm
Paul wrote: Tue Mar 21, 2023 11:50 am But what happens with repeated LPRINT?
If the printer buffer reach 32 characters, it prints the buffer!
10 LPRINT "ZX81";
30 GOTO 10
This example reset the printer buffer:
10 LPRINT "ZX81";
20 POKE 16444,118
30 GOTO 10
In ASM:
LD (IY+60),118

Or Set the PR_CC to 60 ( Offset from IY =PR_BUFF): "20 POKE 16440,60"
LD (IY+56),60
Thanks Xav, exactly what I was looking for!
:idea:

Re: "Inline" BASIC Extensions

Posted: Fri Mar 24, 2023 11:14 am
by siggi
GCHarder wrote: Tue Mar 21, 2023 9:47 pm
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
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...

LPRINT C$(1 TO 2)+CHR$ X;

Greg
Same as for PRINT on screen: non-printable chars are LPRINTed as "?", so 0-63 and 128 to 191 are OK

Re: "Inline" BASIC Extensions

Posted: Fri Mar 24, 2023 9:50 pm
by GCHarder
I'm tending to forgo using LPRINT for parameter passing as it would make the programs incompatible with ZXPand.

Regards;

Greg

New version "Inline" routines.

Posted: Mon Apr 10, 2023 9:23 pm
by GCHarder
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

New "Inline" routine-Diagonal Wipe

Posted: Sat Apr 15, 2023 9:18 pm
by GCHarder
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

Re: "Inline" BASIC Extensions

Posted: Sat Apr 15, 2023 11:03 pm
by Moggy
Thanks Greg.