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: 312
Joined: Wed Apr 22, 2009 9:22 am

Long scrolly on an unexpanded machine

Post by Shaun_B » Sun Aug 06, 2017 8:16 pm

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 16 times

User avatar
Andy Rea
Posts: 1267
Joined: Fri May 09, 2008 1:48 pm
Location: notts UK

Re: Long scrolly on an unexpanded machine

Post by Andy Rea » Sun Aug 06, 2017 8:30 pm

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 ?
6 x ZX81, 1 x TS1500 , 1 x +3e, 1 x timex 2040 printer, 1 x timex 2020 cassette deck, siclair printer and some spectrum

dr beep
Posts: 1045
Joined: Thu Jun 16, 2011 7:35 am
Location: Boxmeer

Re: Long scrolly on an unexpanded machine

Post by dr beep » Sun Aug 06, 2017 8: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.

dr beep
Posts: 1045
Joined: Thu Jun 16, 2011 7:35 am
Location: Boxmeer

Re: Long scrolly on an unexpanded machine

Post by dr beep » Sun Aug 06, 2017 9:13 pm

dr beep wrote:
Sun Aug 06, 2017 8: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: 312
Joined: Wed Apr 22, 2009 9:22 am

Re: Long scrolly on an unexpanded machine

Post by Shaun_B » Sun Aug 06, 2017 9: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.

Shaun_B
Posts: 312
Joined: Wed Apr 22, 2009 9:22 am

Re: Long scrolly on an unexpanded machine

Post by Shaun_B » Sun Aug 06, 2017 10:50 pm

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 11 times
S2.P
(463 Bytes) Downloaded 9 times

dr beep
Posts: 1045
Joined: Thu Jun 16, 2011 7:35 am
Location: Boxmeer

Re: Long scrolly on an unexpanded machine

Post by dr beep » Mon Aug 07, 2017 8:47 am

Shaun_B wrote:
Sun Aug 06, 2017 9: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: 1045
Joined: Thu Jun 16, 2011 7:35 am
Location: Boxmeer

Re: Long scrolly on an unexpanded machine

Post by dr beep » Mon Aug 07, 2017 8: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.

Shaun_B
Posts: 312
Joined: Wed Apr 22, 2009 9:22 am

Re: Long scrolly on an unexpanded machine

Post by Shaun_B » Mon Aug 07, 2017 12:37 pm

dr beep wrote:
Mon Aug 07, 2017 8: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: 1267
Joined: Fri May 09, 2008 1:48 pm
Location: notts UK

Re: Long scrolly on an unexpanded machine

Post by Andy Rea » Mon Aug 07, 2017 6:31 pm

dr beep wrote:
Mon Aug 07, 2017 8: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
6 x ZX81, 1 x TS1500 , 1 x +3e, 1 x timex 2040 printer, 1 x timex 2020 cassette deck, siclair printer and some spectrum

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests