Long scrolly on an unexpanded machine

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Shaun_B
Posts: 474
Joined: Wed Apr 22, 2009 10:22 am

Re: Long scrolly on an unexpanded machine

Post by Shaun_B »

Hi Andy,

I tried some REM techniques in my second attempt. I'll do more experimenting.

Thanks,

Shaun
Shaun_B
Posts: 474
Joined: Wed Apr 22, 2009 10:22 am

Re: Long scrolly on an unexpanded machine

Post by Shaun_B »

Latest version has 262 characters, attached. S5.P has 264 characters and better logic, S6.P is almost complete logic I think... nearly there.

Thanks Dr Beep!

Regards,

Shaun
Attachments
S6.P
Nearly there
(535 Bytes) Downloaded 216 times
S5.P
(532 Bytes) Downloaded 201 times
S4.P
262 chars
(516 Bytes) Downloaded 204 times
Last edited by Shaun_B on Mon Aug 07, 2017 9:44 pm, edited 2 times in total.
dr beep
Posts: 2059
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: Long scrolly on an unexpanded machine

Post by dr beep »

Shaun_B wrote: Mon Aug 07, 2017 8:30 pm Latest version has 262 characters, attached.

Regards,

Shaun
SGN PI=1
NOT PI=0

and shorter than CODE " "
Shaun_B
Posts: 474
Joined: Wed Apr 22, 2009 10:22 am

Re: Long scrolly on an unexpanded machine

Post by Shaun_B »

306 characters, almost perfect scrolly routines. See attached!

Regards,

Shaun
Attachments
S7.p
306 characters
(632 Bytes) Downloaded 194 times
Shaun_B
Posts: 474
Joined: Wed Apr 22, 2009 10:22 am

Re: Long scrolly on an unexpanded machine

Post by Shaun_B »

My work here is done - 322 char scrolly, unexpanded ZX81, BASIC driven.

Here is the scroller routine:

Code: Select all

 1 LET X=SGN PI
 2 LET Y=CODE "3"
 3 LET Z=Y
 4 PRINT AT NOT PI,Z+NOT PI;A$(X TO(X+Y)-Z)
 5 LET Y=Y-(X+Y>=LEN A$)
 6 IF NOT Y THEN GOTO SGN PI
 7 LET X=X+(SGN PI*(Z<=NOT PI))
 8 LET Z=Z-(SGN PI*(Z>NOT PI))
 9 GOTO VAL "4"
 
Remember to enter the A$ string in direct mode to save bytes; type GOTO 1 to test and run. Because of a slight imperfection, leave at least two white spaces at the end of your message. Should easily allow for another half a Twitter of text above the 322 chars achieved if you're careful enough.

Regards,

Shaun.
Attachments
SF.p
322 chars
(644 Bytes) Downloaded 184 times
User avatar
SafePit
Posts: 43
Joined: Mon Feb 20, 2012 7:06 pm
Location: Boise, ID
Contact:

Re: Long scrolly on an unexpanded machine

Post by SafePit »

Pretty cool. Runs well too. You can get a few more bytes (15 by my count) out of it. I dropped unneeded parens and removed +NOT PI on line 4. I found you don't need the SGN PI*() in lines 7 and 8. Flipping lines 5 and 6 lets you drop a space from A$ which gives you another byte. Allows you to add 16 more characters to A$.

Code: Select all

 1 LET X=SGN PI
 2 LET Y=CODE "3"
 3 LET Z=Y
 4 PRINT AT NOT PI,Z;A$(X TO X+Y-Z)
 5 IF NOT Y THEN GOTO SGN PI
 6 LET Y=Y-(X+Y>=LEN A$)
 7 LET X=X+(Z<=NOT PI)
 8 LET Z=Z-(Z>NOT PI)
 9 GOTO VAL "4"
 
Image
Image
Shaun_B
Posts: 474
Joined: Wed Apr 22, 2009 10:22 am

Re: Long scrolly on an unexpanded machine

Post by Shaun_B »

Cool, thanks for the improvements to the listing. Extra 13 characters potential is excellent.

Regards,

Shaun
Shaun_B
Posts: 474
Joined: Wed Apr 22, 2009 10:22 am

Re: Long scrolly on an unexpanded machine

Post by Shaun_B »

With some POKEing of the RAMs, could the GOTO SGN PI become CONT? I'll give it a go.

Regards,

Shaun.
Shaun_B
Posts: 474
Joined: Wed Apr 22, 2009 10:22 am

Re: Long scrolly on an unexpanded machine

Post by Shaun_B »

The CONT command can be used in the SAVE routine, like:

Code: Select all

10 SAVE "S"
11 CONT
As for replacing GOTO with CONT in place of GOTO SGN PI, not sure yet.

Thanks,

Shaun
Post Reply