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

Long scrolly on an unexpanded machine

Post by Shaun_B »

I tried to do a long scrolly on an unexpanded ZX81, results attached.

I couldn't get much more than 160 characters, I might try another way that doesn't use string manipulation using the ZX81's sub string stuff.

Regards,

Shaun
Attachments
S.P
(385 Bytes) Downloaded 209 times
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: Long scrolly on an unexpanded machine

Post by Andy Rea »

I'm guessing that at some.point there.must be in memory 2.copies of the text, the original, the new one, and then the new one is funky committed over the top of the original 1

Was the aim.to do it completely in basic or could you use machine code ?
what's that Smell.... smells like fresh flux and solder fumes...
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 »

In machinecode this wouldn't need double memory to do the scrolling.
I think I can get up to 800 bytes or more.
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 »

dr beep wrote: Sun Aug 06, 2017 9:35 pm In machinecode this wouldn't need double memory to do the scrolling.
I think I can get up to 800 bytes or more.
That is without compression of the text. With compression I might get over 1K of text.
Shaun_B
Posts: 474
Joined: Wed Apr 22, 2009 10:22 am

Re: Long scrolly on an unexpanded machine

Post by Shaun_B »

I was aiming at only BASIC. I could get longer scrolly with only string shuffle. Another method would be scrolly stored in a REM statement and only show 32 chars at a time plus incremental offset each pass or something. I guess that's how you'd do it in assembly.

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 »

Here's another version to mull over - uses a different technique which is a bit of a cheat but it works. Version S3.P uses a string variable. Also use

Code: Select all

GOTO 2
to start or the var stack is cleared.

Regards,

Shaun.
Attachments
S3.P
(453 Bytes) Downloaded 236 times
S2.P
(463 Bytes) Downloaded 220 times
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: Sun Aug 06, 2017 10:31 pm I was aiming at only BASIC. I could get longer scrolly with only string shuffle. Another method would be scrolly stored in a REM statement and only show 32 chars at a time plus incremental offset each pass or something. I guess that's how you'd do it in assembly.

Regards,

Shaun.
Instead of moving the stringdata you should move a pointer across the text and display from starting at the pointer.
When end reached you print from start again. Data remains the same and will give more room for text.
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 »

Still, to get the most out of 1K you need to code in machinecode.

BTW, I think I will make a demo (perhaps even 4 following demo's) to get the most out of 1K, like more than 1K text in the message.
Shaun_B
Posts: 474
Joined: Wed Apr 22, 2009 10:22 am

Re: Long scrolly on an unexpanded machine

Post by Shaun_B »

dr beep wrote: Mon Aug 07, 2017 9:51 am Still, to get the most out of 1K you need to code in machinecode.

BTW, I think I will make a demo (perhaps even 4 following demo's) to get the most out of 1K, like more than 1K text in the message.
Yes, I'm aware that using Machine Code gets the most out of the machine, in fact any machine.

I write in BASIC and am interested in BASIC because my main job means that I use high level languages such as JavaScript and PHP; going low-level isn't necessarily more difficult, it just takes more time to get the same results.

I'm looking forward to your demo, and I'm still interested in what I can achieve in 1K with BASIC.

Regards,

Shaun
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: Long scrolly on an unexpanded machine

Post by Andy Rea »

dr beep wrote: Mon Aug 07, 2017 9:51 am Still, to get the most out of 1K you need to code in machinecode.

BTW, I think I will make a demo (perhaps even 4 following demo's) to get the most out of 1K, like more than 1K text in the message.
I would like that, it would be very cool. well for 32 unique characters uncompressed we would need 5 bits per character , that gives us 1.6 chars per byte already :D

regards.

@shaun, what about storing the message in rem statement, and using peek and poke to copy message to the single screen line, i realise it would maybe be a little slow, but may yield more available bytes for message
what's that Smell.... smells like fresh flux and solder fumes...
Post Reply