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 >
Commodore BASIC  |  2022-10-26  |  5KB  |  138 lines

  1. 0 dev=peek(186)
  2. 1 a=a+1:ifa=1thenload"scrollcode",dev,1
  3. 2 a=0
  4. 5 q$=chr$(34)
  5. 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]"
  6. 10 cr=49152:ok=0
  7. 20 syscr+3:gosub2000
  8. 30 syscr+12:syscr+6,2:syscr+9,24
  9. 40 syscr,"[158][212]his is an example of a scrolling message...       "
  10. 50 print" [212]his program lets you put scrolling
  11. 60 [153]" messages like the one below into your
  12. 70 print" own programs. [193]ll of the available
  13. 80 [153]" options are accessed through sys(NULL)(NULL)(NULL)"
  14. 90 [153]" commands. (NULL)hese are described on the
  15. 100 print" following screens. [201]t is assumed that
  16. 110 [153]" at the beginning of your program, you
  17. 120 print" set [158][195][210] = 49152."
  18. 130 gosub1500
  19. 140 :
  20. 150 syscr,"[158][197]xample message...   "
  21. 200 print" [212]here are 5 [158][211][217][211] commands available:"
  22. 210 print" [158][211][217][211] [195][210],"q$"[205]essage"q$" will cause [158][205]essage"
  23. 220 print" to scroll continuously across the"
  24. 230 print" screen. [193]ny valid string expression
  25. 240 [153]" to 255 characters long."
  26. 250 [153]"   right$n addition, several control codes
  27. 260 print" can be included in the string. [212]hese
  28. 270 [153]" are explained on the next screen."
  29. 280 [141] 1500
  30. 290 [158]cr,"(NULL)hite   printchr$reen   contpeeklue   sys(NULL)(NULL)(NULL) (NULL)(NULL)wait   (NULL)(NULL)(NULL) (NULL)ascasc   "
  31. 300 [153]" (NULL)ou can use the colour control keys to
  32. 310 print" change the text colour in the same way
  33. 320 [153]" as with sys(NULL)(NULL)right$(NULL)(NULL). (NULL)ou can also use sys(NULL)(NULL)(NULL) (NULL)(NULL)
  34. 330 print" and [158][210][214][211] [207][198][198]. [201]f you end the string
  35. 340 [153]" with the sys(NULL)right$ symbol, then the message"
  36. 350 [153]" will only be displayed once, otherwise
  37. 360 print" it will repeat continuously.
  38. 370 [141]1500
  39. 380 [158]cr,"sys(NULL)his type of message can be quite effective..."
  40. 400 [153]" sys(NULL)(NULL)(NULL) len(NULL),address can be used when a
  41. 410 print" message is more than 255 characters
  42. 420 [153]" long. sysatnddress is the starting address
  43. 430 print" in memory of the message. [212]he last
  44. 440 [153]" byte in the message should be either
  45. 450 print" [158]0 or [158]255 (for continuous or once off)."
  46. 460 print" [158][211][217][211] [195][210] by itself will turn back on
  47. 470 [153]" a message which had been turned off."
  48. 480 [141] 1500
  49. 490 :
  50. 500 [158]cr,"print(NULL)emember to always set syslen(NULL) = 49152               ":[158]cr[170]6,4
  51. 510 [153]" sys(NULL)(NULL)(NULL) len(NULL)+3 will turn off any message
  52. 520 print" which is currently on."
  53. 530 print" [158][211][217][211] [195][210]+6,speed will set the speed of
  54. 540 [153]" scrolling from sys1=slow to sys10=fast. (NULL)ou
  55. 550 print" can use values above 10 if you like,
  56. 560 [153]" but they will be too fast to read."
  57. 570 [153]" (NULL)he message below is now scrolling
  58. 580 print" at speed 4."
  59. 590 ok=1:gosub1500
  60. 600 syscr+3:syscr+12:syscr+12,24
  61. 610 print"[145]"l$""l$:syscr+9,6:syscr+6,2
  62. 620 syscr,"[158][195]ommodore 64 [211]mooth [211]croll [159]by [197]dward [195]arroll, 1986         "
  63. 630 print" [158][211][217][211] [195][210]+9,[204]ine selects the line to be
  64. 640 [153]" used for the scrolling. sys(NULL)ine can be
  65. 650 print" any number from [158]0 to [158]24. [217]ou can
  66. 660 [153]" only have one scrolling message at a
  67. 670 print" time, however."
  68. 680 ok=0:gosub1500
  69. 690 syscr+3:syscr+12:syscr+12,6:syscr+9,24:syscr+6,10
  70. 700 syscr,"[158][212]his message is scrolling at speed 10      "
  71. 710 print" [215]hen a message is scrolling, the whole
  72. 720 [153]" line being scrolled is stored in a
  73. 730 print" buffer, so that the scrolling message
  74. 740 [153]" will not be affected by things like
  75. 750 print" scrolling, or a clear screen. [200]owever,
  76. 760 [153]" sys(NULL)(NULL)(NULL) len(NULL)+12 will empty the buffer, so
  77. 770 print" that the message will scroll onto an
  78. 780 [153]" empty line.
  79. 790 gosub1500
  80. 795 syscr+6,3
  81. 796 syscr,"[158][206]early at the end now...(and at a slightly slower speed too)      "
  82. 800 print" [217]ou can also [158][211][217][211] [195][210]+12,[204]ine where
  83. 810 [153]" sys(NULL)ine is the number of a screen line
  84. 820 print" ([158]0 to [158]24). [212]his will fill the line
  85. 830 [153]" specified with spaces. (NULL)ou usually
  86. 840 print" need to do this if you are turning
  87. 850 [153]" off a message, and want to use the
  88. 860 print" screen space for something else."
  89. 890 gosub1500
  90. 900 syscr,"[158][207]nly one more screen to go now....       "
  91. 910 print"     [159][211]ummary of available commands"
  92. 920 print" [158][211][217][211] [195][210]         [210]esume scrolling
  93. 930 [153]" sys(NULL)(NULL)(NULL) len(NULL),string  (NULL)croll sysstring"
  94. 940 [153]" sys(NULL)(NULL)(NULL) len(NULL),address (NULL)croll from sysaddress"
  95. 950 [153]" (NULL)(NULL)(NULL) len(NULL)+3       (NULL)urn off scrolling"
  96. 960 [153]" sys(NULL)(NULL)(NULL) len(NULL)+6,speed (NULL)et speed of scrolling
  97. 970 print" [158][211][217][211] [195][210]+9,line  [211]et [158]line for scrolling
  98. 980 [153]" sys(NULL)(NULL)(NULL) len(NULL)+12      valmpty scroll buffer"
  99. 990 [153]" sys(NULL)(NULL)(NULL) len(NULL)+12,line lenlear the selected sysline"
  100. 1000 [153]" atns with most computer programs, the
  101. 1010 print" best way to find out more about this
  102. 1020 [153]" is to experiment with it yourself."
  103. 1030 [141]1500
  104. 1040 [153] "open      (NULL)his program was written by"
  105. 1050 [153]"           printvaldward lenarroll
  106. 1060 print"           17 [199]reenville [210]oad
  107. 1070 [153]"           peeklackrock
  108. 1080 print"           [195]o. [196]ublin
  109. 1090 [153]"           right$reland
  110. 1100 print"           [212]el: 801249
  111. 1120 [153]" (NULL)ow, see if you can type fast enough
  112. 1130 print" to keep up with the scrolling. [212]ype
  113. 1140 [153]" sys1-sys9 for speed, sys(NULL)val(NULL)(NULL)(NULL)(NULL) to exit, and
  114. 1150 print" any other keys to type.[158]"
  115. 1160 geta$:ifa$=""then1160
  116. 1170 ifval(a$)thensyscr+6,val(a$):syscr,"   [211]peed "+a$+" selected...[255]":goto1160
  117. 1180 ifa$<>chr$(13)thensyscr,a$+"[255]":goto1160
  118. 1190 gosub2000
  119. 1200 print"[158]sys cr,"q$:print"[145][145][145][145]":poke198,8:fort=631to638:poket,29:next
  120. 1210 end
  121. 1220 :
  122. 1230 :
  123. 1500 poke214,21:print
  124. 1510 ifpeek(197)=60then1510
  125. 1520 print"[153]        [208]ress [158][211][208][193][195][197][153] to continue"
  126. 1530 poke198,0
  127. 1540 geta$:ifa$<>" "then1540
  128. 1570 :
  129. 1580 :
  130. 1900 ifok=0thensyscr," ":syscr+12
  131. 2000 poke53280,6:poke53281,0
  132. 2010 print "[147][153]       [195]ommodore 64 [211]mooth [211]croll"
  133. 2020 print"         by [197]dward [195]arroll 1986"
  134. 2025 if ok then return
  135. 2030 poke214,22:print
  136. 2040 printl$""
  137. 2050 return
  138.