23-line character scroll.
Posted: Sat May 31, 2014 10:01 pm
I was curious about whether you could do a full-screen character scroll in BASIC with the SuperCPU (without pixel scroll for now), so I came up with this (cleaned) listing:
It takes a while to set up the test data in lines from 63995 through to 63999; the scroll logic is in line 20. The obvious limitation with BASIC strings is that a string can only be up to 255 characters in length. The scroller actually works faster than I expected, so could probably add in pixel scrolling in there, and sort out the screen tearing. By using some sort of compression in the strings I could probably do some sort of tiling system or something. Don't try this at 1mhz
Regards,
Shaun.
Code: Select all
0 print"{clear}";
1 r=22
2 dim a$(r)
3 b=160
4 w=39
5 sc=1024
6 i=0
7 l=960
8 for i=sc to sc+w
9 poke i,b
10 poke i+l,b
11 next
12 y$="{home}{down}"
13 z=0
14 y=2
15 w=w+1
16 gosub 63995
17 x=1
18 o=x
19 c=255
20 print y$;:for i=z to r:print mid$(a$(i),x+o,w);:next:if x+w<c then x=x+o:goto 20
21 poke 198,0
22 wait 198,1
23 get a$
24 end
63995 for b=0 to r
63996 for i=0 to 254
63997 a$(b)=a$(b)+chr$(65+rnd(.)*26)
63998 next i,b
63999 return
Regards,
Shaun.