horizontal scrolling in basic
horizontal scrolling in basic
hi,
i want to know how to do horizontal scrolling in basic. i know it has something to do with the 'to' statement using the print statement, which i read somehwere. also i would like to know how to scroll whole screens, not just single lines. thank you.
i want to know how to do horizontal scrolling in basic. i know it has something to do with the 'to' statement using the print statement, which i read somehwere. also i would like to know how to scroll whole screens, not just single lines. thank you.
- 1024MAK
- Posts: 5527
- Joined: Mon Sep 26, 2011 10:56 am
- Location: Looking forward to summer in Somerset, UK...
- Contact:
Re: horizontal scrolling in basic
Hello and Welcome to our forum
Is this a question intended for a ZX80, a ZX81 or a ZX Spectrum?
Mark

Is this a question intended for a ZX80, a ZX81 or a ZX Spectrum?
Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp
Standby alert 
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Spring approaching...
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp


There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb

Spring approaching...
Re: horizontal scrolling in basic
I have moved this to the Spectrum section
Rich Mellor
RWAP Software
RWAP Adventures
SellMyRetro
Retro-Printer Module
Also Involved in:
Icephorm
RWAP Software
RWAP Adventures
SellMyRetro
Retro-Printer Module
Also Involved in:
Icephorm
Re: horizontal scrolling in basic
Whole screen scrolling in BASIC? Err... it's possible but not quickly.
At a guess, you would need a variable to represent each line of the screen that you want to scroll, here's a simple example using three string variables for speed
Now the more variables you represent by each line you want to scroll, the slower your BASIC listing will go.
Regards,
Shaun.
At a guess, you would need a variable to represent each line of the screen that you want to scroll, here's a simple example using three string variables for speed
Code: Select all
1 LET a$="01234567890123456789012345678901": LET b$=a$(2 TO )+a$(1): LET c$=b$(2 TO )+b$(1)
2 LET a$=a$(2 TO )+a$(1): LET b$=b$(2 TO )+b$(1): LET c$=c$(2 TO )+c$(1)
3 PRINT AT 0,0;a$;b$;c$;b$;a$;b$;c$;b$;a$;b$;c$;b$;a$;b$;c$;b$;a$;b$;c$;b$;a$;
4 GO TO 2
Regards,
Shaun.
Re: horizontal scrolling in basic
As an aside to the above listing, I believe that it's only possible to get a limited number of redefined characters using pure Sinclair ZX Spectrum BASIC; the limit is around 26 I think. Everything else you scroll must therefore be within the pre-defined character set.
Regards,
Shaun.
Regards,
Shaun.
- 1024MAK
- Posts: 5527
- Joined: Mon Sep 26, 2011 10:56 am
- Location: Looking forward to summer in Somerset, UK...
- Contact:
Re: horizontal scrolling in basic
Yes, but it is also possible to redirect (POKE) a system variable so it points to your own custom character set. Best to do this as the final stage of development, as it makes the listing rather hard to read if you redefine A-Z, a-z and 0 to 9 etc to graphic characters
Mark

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp
Standby alert 
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Spring approaching...
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp


There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb

Spring approaching...
Re: horizontal scrolling in basic
Good point. So we're getting towards "achieve good results with assembly" type answer.1024MAK wrote: ↑Sun Aug 13, 2017 11:25 pm Yes, but it is also possible to redirect (POKE) a system variable so it points to your own custom character set. Best to do this as the final stage of development, as it makes the listing rather hard to read if you redefine A-Z, a-z and 0 to 9 etc to graphic characters![]()
Mark
Unless the person asking the question is thinking of Speccy Next BASIC running at 28Mhz?
Is there a limit on the string var length on the Speccy, or is it a case of "keep going until there is no RAM left"?
Regards,
Shaun.
- 1024MAK
- Posts: 5527
- Joined: Mon Sep 26, 2011 10:56 am
- Location: Looking forward to summer in Somerset, UK...
- Contact:
Re: horizontal scrolling in basic
The string size for the ZX Spectrum BASIC is held as a two byte value. So string size is not a problem
Certainly if you want, you can hold all the text for a screen in a single string variable if you want.
Try this: How many times did you have to press Y to scroll?...
Mark

Certainly if you want, you can hold all the text for a screen in a single string variable if you want.
Try this: How many times did you have to press Y to scroll?...
Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp
Standby alert 
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Spring approaching...
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp


There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb

Spring approaching...
- 1024MAK
- Posts: 5527
- Joined: Mon Sep 26, 2011 10:56 am
- Location: Looking forward to summer in Somerset, UK...
- Contact:
Re: horizontal scrolling in basic
Not that this has much practical value, as you have to keep writing to the display, but it's a bit of fun...
MarkZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp
Standby alert 
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Spring approaching...
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp


There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb

Spring approaching...