home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 29 / 029.d81 / demo (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  8KB  |  248 lines

  1. 0 rem (NULL) (NULL) (NULL)(NULL)(NULL)(NULL){$60}newcloserndlet(NULL)(NULL)mid$(NULL)(NULL)l.................................................
  2. 5 rem
  3. 6 rem           warning!
  4. 7 rem do not delete line 0! it contains       a machine language routine;
  5. 8 rem which, if deleted, could cause          your computer to lock-up.
  6. 9 rem ie: deleting line 0 could be            hazardous to this prg's health!
  7. 10 rem
  8. 11 rem line 0 is not needed to run             nubasic. it is needed to run
  9. 12 rem this demo program. all nubasic          commands will work without it.
  10. 13 rem
  11. 20 rem  nubasic demo
  12. 25 rem  by  joe garrett
  13. 30 if peek(49152)=165 and peek(49153)=2 then 50
  14. 35 ifpeek(816)=231andpeek(817)=195thensys49155:poke816,165:poke817,244
  15. 40 gosub60100
  16. 45 load"nubasic",8,1
  17. 50 sys 49152
  18. 60 :
  19. 65 gosub 5000
  20. 70 rem the 'at' statement example
  21. 75 :
  22. 77 poke53280,3:poke53281,3
  23. 80 print"[147]"
  24. 85 print" the 'at' command makes text formatting"
  25. 86 (NULL) 14,7 : print "a breeze!":gosub4000
  26. 87 print"[147]":poke53281,14:poke53280,14
  27. 90 for t=0 to 18 step 2
  28. 100 (NULL) 18+t,24 : print "wow";
  29. 110 (NULL) 18-t,24 : print "wow"
  30. 115 (NULL) 10,2 : next
  31. 120 :
  32. 130 for t=18 to 0 step -2
  33. 140 (NULL) 18+t,24 : print "wow";
  34. 150 (NULL) 18-t,24 : print "wow"
  35. 160 (NULL) 0,2 : next t : print
  36. 165 print"         syntax:  at xpos,ypos":gosub10030
  37. 170 (NULL) 5,24 : print"                               ";
  38. 190 :
  39. 200 rem the 'beep' example
  40. 205 :
  41. 206 poke53280,7:poke53281,7
  42. 207 (NULL) 5,12 : print"there's a 'beep' sound command"
  43. 208 rem note frequencys are found on page 152 of your user's man.
  44. 209 print"                                      "
  45. 210 (NULL) 4816,4
  46. 220 (NULL) 6430,4
  47. 230 (NULL) 8100,4
  48. 240 (NULL) 9634,8
  49. 250 (NULL) 8100,4
  50. 260 (NULL) 9634,20
  51. 265 print"[144]      syntax:  beep pitch,duration"
  52. 270 (NULL) 16,14 : print "charge!"; : gosub10030
  53. 290 :
  54. 300 rem the 'alpha' statement example
  55. 310 :
  56. 330 print"[147][144]" : poke53280,13:poke53281,13
  57. 340 (NULL) 0,4 : print"the 'alpha' statement will alphabetize"
  58. 345 print "a string array."
  59. 350 (NULL) 0,14 : print"please wait while i generate some       letters to sort..."
  60. 355 dim a$(100)
  61. 360 for t=1 to 100
  62. 370 a$(t)=chr$(rnd(1)*26+65)
  63. 380 next t : gosub10000
  64. 390 print"[147]here are the letters before using the   'alpha' statement:"
  65. 400 for t=1 to 100
  66. 410 print a$(t);
  67. 420 next t : print : print
  68. 425 print"calling alpha..." : (NULL) a$(0)
  69. 430 print"here are the letters after using the    'alpha' statement:"
  70. 440 for t=1 to 100
  71. 450 print a$(t);
  72. 460 next t :print:print
  73. 465 print"         syntax:  alpha a$(0)    "
  74. 470 gosub10030
  75. 500 :
  76. 510 rem directory command
  77. 520 :
  78. 525 poke53280,5:poke53281,5
  79. 530 print"[147]the 'dir' command will display the disk directory..."
  80. 533 print"to pause the directory, press & hold"
  81. 534 print"the space bar; to stop it, press any"
  82. 535 print"other key."
  83. 537 gosub10000 : print"[147]"
  84. 540 (NULL) : print
  85. 550 print"oh wow, that was really cool."
  86. 560 print"and it didn't do a thing to my program  in memory!"
  87. 570 gosub10030
  88. 580 :
  89. 590 rem window commands
  90. 600 :
  91. 605 poke53280,11:poke53281,11
  92. 610 print "[147][150]next, a demo of the 'window', 'scrlup', and 'scrldn' commands"
  93. 620 print"first, i will draw a box around the"
  94. 622 print"window, then let the scrlup and scrldn"
  95. 624 print"commands do their duty."
  96. 630 (NULL) 5,10 : print"[144]x1,y1[159][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
  97. 640 for t=1 to 5
  98. 650 (NULL) 10,10+t:print"[221]                  [159][221]"
  99. 660 next t
  100. 670 (NULL) 10,15 : print"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189][144]x2,y2"
  101. 680 fort=1 to 20 : read a$(t) : next t
  102. 690 data joe,karen,tom,mary,sue,dave,jerry,betty,luanne,greg,joan,jon,mark,donna
  103. 700 data jim,al,judy,bobby,justin,mike
  104. 710 (NULL) 11,11,28,14
  105. 720 for t=1 to 4
  106. 730 (NULL) 11,10+t : print t;a$(t) : next : n=1
  107. 740 (NULL) 0,7 : print"press cursor up or down"
  108. 745 (NULL) 5 ,24 : print"<<< press space to continue >>>";
  109. 746 (NULL) 0,17 : print"[158]the joystick works too in port 2!"
  110. 747 (NULL) 0,19 : print"now that's a fancy way to display info."
  111. 748 print"[144]     syntax:  window x1,y1,x2,y2"
  112. 749 print"              scrlup  :  scrldn"
  113. 750 get t$ : j=(NULL)(2) : if t$=" "then 800
  114. 760 if t$<>"[145]" and j<>1 then 780
  115. 765 n=n-1 : if n=0 then n=1 : (NULL)20000,3 : goto750
  116. 770 (NULL) : (NULL) 11,11 : print n;a$(n)
  117. 775 goto 750
  118. 780 if t$<>"" and j<>5 then 750
  119. 785 n=n+1 : if n=18 then n=17 : (NULL) 20000,3 : goto750
  120. 790 (NULL) : (NULL) 11,14 : print n+3;a$(n+3)
  121. 795 goto 750
  122. 800 (NULL) 1024,2023,40960 : (NULL) 55296,56295,41960
  123. 805 print"[147][159]the joy(x) function, where 'x' is the"
  124. 810 print"port number, returns a value of 0-8 for"
  125. 820 print"directions as follows:"
  126. 825 print"     centered  - 0"
  127. 830 print"     north     - 1"
  128. 840 print"     northeast - 2"
  129. 845 print"     east      - 3"
  130. 850 print"     southeast - 4"
  131. 855 print"     south     - 5"
  132. 860 print"     southwest - 6"
  133. 865 print"     west      - 7"
  134. 870 print"     northwest - 8"
  135. 880 print"if the fire button was pressed, the     value would be 16 more."
  136. 890 (NULL)0,21: print"that's a major improvement in handling  the joystick!"
  137. 895 poke198,0:  (NULL) 5,24 : print"<<< press space to continue >>>   ";
  138. 900 gosub 3000
  139. 910 :
  140. 915 rem the move command
  141. 920 :
  142. 925 poke53280,7:poke53281,7
  143. 930 print"[147][144]the last command in this installment of"
  144. 935 print"nubasic is the 'move' command."
  145. 940 print"this command will copy a section of"
  146. 945 print"memory from one place to another."
  147. 950 print"i played a sneaky trick on you two"
  148. 955 print"screens ago by 'move'ing the screen and"
  149. 960 print"its color memory underneath the kernal"
  150. 965 print"rom.  now, i can get them back in a "
  151. 970 print"flash...": (NULL) 1024,2023,42960 : (NULL)55296,56295,43960
  152. 975 gosub10030 :poke53280,11:poke53281,11
  153. 980 (NULL) 40960,41959,1024 : (NULL) 41960,42959,55296
  154. 990 gosub10030 : poke53280,7:poke53281,7
  155. 995 (NULL) 42960,43959,1024 : (NULL) 43960,44959,55296
  156. 997 fort=1 to 5
  157. 1000 (NULL) 2+t,13+t: print"holy smokes, that's like magic."
  158. 1010 nextt
  159. 1040 print"syntax:  move startaddr,endaddr,destaddr":gosub10030
  160. 1050 print"[147]to disable nubasic at any time, type    'nuoff' [return]."
  161. 1060 print"try these advanced commands in your own"
  162. 1070 print"programs and send them to us for        possible publication."
  163. 1080 print"this utility is brought to you by the"
  164. 1090 print"loadstar programming staff."
  165. 1092 print"don't dare miss our future enhancements"
  166. 1094 print"to nubasic.  more new and exciting"
  167. 1096 print"commands will greatly increase your programming potential."
  168. 1100 print"press 'a' to run the demo again"
  169. 1110 print"press 'q' to quit"
  170. 1120 gett$:ift$<>"a"andt$<>"q"then1120
  171. 1130 ift$="a"thenrun70
  172. 1140 open15,8,15,"r0:hello connect=hello connect"
  173. 1150 input#15,er:close15
  174. 1160 if er<>63 then end
  175. 1170 print"[147]nuoff":print"loadf$,8":print"run";:f$="hello connect"
  176. 1180 poke631,13:poke632,13:poke633,13:poke198,3:end
  177. 2997 :
  178. 2998 rem *** joystick routine ***
  179. 3000 for t=0 to 8 : read jy$(t) : next
  180. 3010 data centered,north,northeast,east,southeast,south,southwest,west
  181. 3020 data northwest
  182. 3025 (NULL) 18,18 : print"                  "
  183. 3030 (NULL) 0,18 : print"[158]joystick port 2 = ";
  184. 3040 j=(NULL)(2) : get t$
  185. 3050 if j>=16 then j=j-16 : print"fire ";
  186. 3060 print jy$(j) : if t$<>" "then 3025
  187. 3070 return
  188. 3998 :
  189. 3999 rem at blurb
  190. 4000 print"you can plot the cursor anywhere on the"
  191. 4010 print " screen and the next character printed"
  192. 4020 print" will be 'at' your designated location." : goto10000
  193. 4997 :
  194. 4998 rem *** intro
  195. 4999 :
  196. 5000 poke53280,12:poke53281,15
  197. 5002 print"[147][144]             nubasic demo"
  198. 5005 print"this program will demonstrate several"
  199. 5010 print"new commands that nubasic is adding to"
  200. 5020 print"your commodore-64 standard basic."
  201. 5030 goto10000
  202. 10000 :
  203. 10010 rem press a key to continue
  204. 10020 :
  205. 10030 poke198,0:  (NULL) 5,24 : print"<<< press space to continue >>>   ";
  206. 10040 gett$: if t$<>" " then 10040
  207. 10050 return
  208. 60100 pn$="[206][213][194][193][211][201][195] [196][197][205][207]":an$="[194][217]:  [202][207][197] [199][193][210][210][197][212][212]"
  209. 60110 bo=00: