home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disk User Volume 1 #2
/
Commodore_Disk_User_Vol.1_2_1988_-.d64
/
scrollbasic
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
5KB
|
138 lines
0 dev=peek(186)
1 a=a+1:ifa=1thenload"scrollcode",dev,1
2 a=0
5 q$=chr$(34)
6 l$="[162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162]"
10 cr=49152:ok=0
20 syscr+3:gosub2000
30 syscr+12:syscr+6,2:syscr+9,24
40 syscr,"[158][212]his is an example of a scrolling message... "
50 print" [212]his program lets you put scrolling
60 [153]" messages like the one below into your
70 print" own programs. [193]ll of the available
80 [153]" options are accessed through sys(NULL)(NULL)(NULL)"
90 [153]" commands. (NULL)hese are described on the
100 print" following screens. [201]t is assumed that
110 [153]" at the beginning of your program, you
120 print" set [158][195][210] = 49152."
130 gosub1500
140 :
150 syscr,"[158][197]xample message... "
200 print" [212]here are 5 [158][211][217][211] commands available:"
210 print" [158][211][217][211] [195][210],"q$"[205]essage"q$" will cause [158][205]essage"
220 print" to scroll continuously across the"
230 print" screen. [193]ny valid string expression
240 [153]" to 255 characters long."
250 [153]" right$n addition, several control codes
260 print" can be included in the string. [212]hese
270 [153]" are explained on the next screen."
280 [141] 1500
290 [158]cr,"(NULL)hite printchr$reen contpeeklue sys(NULL)(NULL)(NULL) (NULL)(NULL)wait (NULL)(NULL)(NULL) (NULL)ascasc "
300 [153]" (NULL)ou can use the colour control keys to
310 print" change the text colour in the same way
320 [153]" as with sys(NULL)(NULL)right$(NULL)(NULL). (NULL)ou can also use sys(NULL)(NULL)(NULL) (NULL)(NULL)
330 print" and [158][210][214][211] [207][198][198]. [201]f you end the string
340 [153]" with the sys(NULL)right$ symbol, then the message"
350 [153]" will only be displayed once, otherwise
360 print" it will repeat continuously.
370 [141]1500
380 [158]cr,"sys(NULL)his type of message can be quite effective..."
400 [153]" sys(NULL)(NULL)(NULL) len(NULL),address can be used when a
410 print" message is more than 255 characters
420 [153]" long. sysatnddress is the starting address
430 print" in memory of the message. [212]he last
440 [153]" byte in the message should be either
450 print" [158]0 or [158]255 (for continuous or once off)."
460 print" [158][211][217][211] [195][210] by itself will turn back on
470 [153]" a message which had been turned off."
480 [141] 1500
490 :
500 [158]cr,"print(NULL)emember to always set syslen(NULL) = 49152 ":[158]cr[170]6,4
510 [153]" sys(NULL)(NULL)(NULL) len(NULL)+3 will turn off any message
520 print" which is currently on."
530 print" [158][211][217][211] [195][210]+6,speed will set the speed of
540 [153]" scrolling from sys1=slow to sys10=fast. (NULL)ou
550 print" can use values above 10 if you like,
560 [153]" but they will be too fast to read."
570 [153]" (NULL)he message below is now scrolling
580 print" at speed 4."
590 ok=1:gosub1500
600 syscr+3:syscr+12:syscr+12,24
610 print"[145]"l$""l$:syscr+9,6:syscr+6,2
620 syscr,"[158][195]ommodore 64 [211]mooth [211]croll [159]by [197]dward [195]arroll, 1986 "
630 print" [158][211][217][211] [195][210]+9,[204]ine selects the line to be
640 [153]" used for the scrolling. sys(NULL)ine can be
650 print" any number from [158]0 to [158]24. [217]ou can
660 [153]" only have one scrolling message at a
670 print" time, however."
680 ok=0:gosub1500
690 syscr+3:syscr+12:syscr+12,6:syscr+9,24:syscr+6,10
700 syscr,"[158][212]his message is scrolling at speed 10 "
710 print" [215]hen a message is scrolling, the whole
720 [153]" line being scrolled is stored in a
730 print" buffer, so that the scrolling message
740 [153]" will not be affected by things like
750 print" scrolling, or a clear screen. [200]owever,
760 [153]" sys(NULL)(NULL)(NULL) len(NULL)+12 will empty the buffer, so
770 print" that the message will scroll onto an
780 [153]" empty line.
790 gosub1500
795 syscr+6,3
796 syscr,"[158][206]early at the end now...(and at a slightly slower speed too) "
800 print" [217]ou can also [158][211][217][211] [195][210]+12,[204]ine where
810 [153]" sys(NULL)ine is the number of a screen line
820 print" ([158]0 to [158]24). [212]his will fill the line
830 [153]" specified with spaces. (NULL)ou usually
840 print" need to do this if you are turning
850 [153]" off a message, and want to use the
860 print" screen space for something else."
890 gosub1500
900 syscr,"[158][207]nly one more screen to go now.... "
910 print" [159][211]ummary of available commands"
920 print" [158][211][217][211] [195][210] [210]esume scrolling
930 [153]" sys(NULL)(NULL)(NULL) len(NULL),string (NULL)croll sysstring"
940 [153]" sys(NULL)(NULL)(NULL) len(NULL),address (NULL)croll from sysaddress"
950 [153]" (NULL)(NULL)(NULL) len(NULL)+3 (NULL)urn off scrolling"
960 [153]" sys(NULL)(NULL)(NULL) len(NULL)+6,speed (NULL)et speed of scrolling
970 print" [158][211][217][211] [195][210]+9,line [211]et [158]line for scrolling
980 [153]" sys(NULL)(NULL)(NULL) len(NULL)+12 valmpty scroll buffer"
990 [153]" sys(NULL)(NULL)(NULL) len(NULL)+12,line lenlear the selected sysline"
1000 [153]" atns with most computer programs, the
1010 print" best way to find out more about this
1020 [153]" is to experiment with it yourself."
1030 [141]1500
1040 [153] "open (NULL)his program was written by"
1050 [153]" printvaldward lenarroll
1060 print" 17 [199]reenville [210]oad
1070 [153]" peeklackrock
1080 print" [195]o. [196]ublin
1090 [153]" right$reland
1100 print" [212]el: 801249
1120 [153]" (NULL)ow, see if you can type fast enough
1130 print" to keep up with the scrolling. [212]ype
1140 [153]" sys1-sys9 for speed, sys(NULL)val(NULL)(NULL)(NULL)(NULL) to exit, and
1150 print" any other keys to type.[158]"
1160 geta$:ifa$=""then1160
1170 ifval(a$)thensyscr+6,val(a$):syscr," [211]peed "+a$+" selected...[255]":goto1160
1180 ifa$<>chr$(13)thensyscr,a$+"[255]":goto1160
1190 gosub2000
1200 print"[158]sys cr,"q$:print"[145][145][145][145]":poke198,8:fort=631to638:poket,29:next
1210 end
1220 :
1230 :
1500 poke214,21:print
1510 ifpeek(197)=60then1510
1520 print"[153] [208]ress [158][211][208][193][195][197][153] to continue"
1530 poke198,0
1540 geta$:ifa$<>" "then1540
1570 :
1580 :
1900 ifok=0thensyscr," ":syscr+12
2000 poke53280,6:poke53281,0
2010 print "[147][153] [195]ommodore 64 [211]mooth [211]croll"
2020 print" by [197]dward [195]arroll 1986"
2025 if ok then return
2030 poke214,22:print
2040 printl$""
2050 return