home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 3 #7 / Commodore_Disk_User_Vol.3_7_1990_-.d64 / pointers (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  5KB  |  184 lines

  1. 5 ifz%=0thenz%=1:poke631,32:poke198,1:load"p.code",8,1
  2. 10 rem *** preferences program
  3. 20 rem *** to demonstrate use of
  4. 30 rem *** pointer code.
  5. 40 rem *** by william phillips 1988.
  6. 50 :
  7. 60 gosub5010
  8. 70 gosub5220
  9. 80 gosub5180
  10. 90 gosub5260
  11. 95 ifpeek(49886)>0then90
  12. 100 x%=peek(49872)+256*(peek(49873)and1)
  13. 110 ifx%>25andx%<162then150
  14. 120 ifx%>164andx%<259then550
  15. 130 ifx%>260andx%<341thensys49274:printchr$(147):end
  16. 140 goto90
  17. 150 m%=0:gosub5320
  18. 160 poke684,7:poke679,1
  19. 170 gosub5260:ifpeek(710)=0then170
  20. 180 gosub5470
  21. 190 y%=s%-4
  22. 200 ony%goto210,250,290,330,390,540
  23. 210 m%=7:gosub5320
  24. 220 a%=peek(49413)
  25. 230 x%=7:y%=19:l%=31:n%=19:gosub5560
  26. 240 poke49413,a%:goto90
  27. 250 m%=12:gosub5320
  28. 260 a%=peek(49408)
  29. 270 x%=8:y%=23:l%=7:n%=1:gosub5560
  30. 280 poke49408,a%:goto90
  31. 290 m%=17:gosub5320
  32. 300 a%=peek(49396)
  33. 310 x%=9:y%=23:l%=7:n%=5:gosub5560
  34. 320 poke49396,a%:goto90
  35. 330 m%=22:gosub5320
  36. 340 poke684,3:poke679,1
  37. 350 gosub5260:ifpeek(710)=0then350
  38. 360 gosub5470:gosub5520
  39. 370 dc%=s%-12:ifdc%=3then540
  40. 380 dv%=dc%:ifdv%=2then80
  41. 385 dv%=1-dv%:goto80
  42. 390 m%=27:gosub5320
  43. 400 poke684,14:poke679,1
  44. 410 gosub5260:ifpeek(710)=0then410
  45. 420 gosub5470
  46. 430 g%=s%-13:ifg%=3then540
  47. 440 l%=0:ifg%=2thenl%=1
  48. 450 x%=14+g%:gosub5680
  49. 460 gosub5260
  50. 470 y%=peek(49886)
  51. 480 ify%<(x%+1)ory%>(x%+2)thengoto460
  52. 490 y%=peek(49885)
  53. 495 ify%<3ory%>2*(17-l%)thengoto460
  54. 500 p%=int((y%-3)/2)+l%
  55. 510 ifg%=0thentl%=p%
  56. 520 ifg%=1thenpoke49332,p%
  57. 530 ifg%=2thenpoke53287,p%
  58. 540 gosub5520:goto70
  59. 550 m%=32:gosub5320
  60. 560 poke781,6:poke782,10:sys58634:printchr$(158)"]"left$(y$,13):poke53269,0
  61. 565 t%=peek(49408):t1%=peek(49396):poke49396,0:poke49408,0
  62. 570 f$=""
  63. 580 poke781,6:poke782,11:sys58634:printf$;" ";chr$(157);:poke204,0
  64. 590 geta$:ifa$=chr$(13)then640
  65. 600 ifa$=chr$(20)andlen(f$)>0thenpoke204,1:print" "
  66. 605 ifa$=chr$(20)andlen(f$)>0thenf$=left$(f$,len(f$)-1):goto580
  67. 610 ifa$<" "ora$>"[218]"then590
  68. 620 iflen(f$)<13thenf$=f$+a$
  69. 630 goto580
  70. 640 poke204,1:iff$=""then800
  71. 660 m%=35:gosub5320
  72. 670 r%=0:geta$:ifa$="[212]"ora$="t"thenr%=1:f$=chr$(5)+chr$(14)+chr$(8)+f$
  73. 680 ifa$="[196]"ora$="d"thenr%=8:goto710
  74. 690 ifr%=0then670
  75. 700 m%=38:gosub5320
  76. 705 if(peek(1)and16)=16then705
  77. 706 geta$:ifa$=""then705
  78. 710 sys49274:savef$,r%,1
  79. 720 poke186,r%:poke184,1:poke185,1
  80. 740 f$="p.code":fori=1to6:poke53230+i,asc(mid$(f$,i,1)):next
  81. 750 poke183,6:poke187,239:poke188,207
  82. 760 poke251,0:poke252,192
  83. 770 poke781,93:poke782,195
  84. 780 poke780,251
  85. 790 sys65496:sys65484
  86. 800 sys49152
  87. 810 poke49408,t%:poke49396,t1%:goto540
  88. 3999 end
  89. 5000 rem *** initialise
  90. 5010 poke679,0:poke710,0:printchr$(147)chr$(14)chr$(8)
  91. 5020 poke53280,0:poke53281,0
  92. 5030 fori=685to709:pokei,1:next
  93. 5040 poke49332,1:poke49413,19
  94. 5045 poke49396,5:poke49408,1
  95. 5050 poke49872,128:poke49874,128
  96. 5060 poke49873,0:poke53287,1
  97. 5070 dv%=2:tl%=6
  98. 5080 dimc%(15),m$(40)
  99. 5090 fori=0to15:readc%(i):next
  100. 5100 z$="[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]"
  101. 5110 y$="                                       "
  102. 5115 k%=0:fori=0to8
  103. 5120 readx%,y%,l%,d%,q%,b%,v%,t$:m$(k%)=chr$(x%)+chr$(y%)+chr$(l%)+chr$(d%)
  104. 5130 m$(k%)=m$(k%)+chr$(q%)+chr$(b%)+chr$(v%)+t$:ford=1tod%:readm$(k%+d):next
  105. 5140 k%=k%+1+d%:next
  106. 5150 poke781,24:poke782,1:poke783,48:poke658,1:sys58634
  107. 5155 printchr$(153)"'[208]references' program by [215]. [208]hillips"
  108. 5160 sys49152:return
  109. 5170 rem *** set device
  110. 5180 poke49884,dv%and2
  111. 5190 poke49337,dv%and1
  112. 5200 return
  113. 5210 rem *** print top line
  114. 5220 printchr$(19)chr$(c%(tl%))chr$(18)chr$(165)"   [208]references  [221]  [211]torage  [221]";
  115. 5230 print"  [209]uit   "chr$(167)chr$(146)
  116. 5240 return
  117. 5250 rem *** check fire
  118. 5260 ifdv%=2then5290
  119. 5270 f%=peek(56320+dv%)and16:iff%=16then5270
  120. 5280 return
  121. 5290 geta$:ifa$<>chr$(13)then5290
  122. 5300 return
  123. 5310 rem *** print menu
  124. 5320 x%=asc(left$(m$(m%),1)):y%=asc(mid$(m$(m%),2,1))
  125. 5330 l%=asc(mid$(m$(m%),3,1)):d%=asc(mid$(m$(m%),4,1))
  126. 5340 q%=asc(mid$(m$(m%),5,1)):b%=asc(mid$(m$(m%),6,1))
  127. 5350 v%=asc(mid$(m$(m%),7,1))
  128. 5360 poke781,x%:poke782,0:poke783,48:sys58634
  129. 5370 printtab(y%)chr$(b%)"[176]"left$(z$,l%)"[174]"
  130. 5380 ifq%=1thenprinttab(y%)"[221]"chr$(30)right$(m$(m%),l%)chr$(b%)"[221]"
  131. 5390 ifq%=1thenprinttab(y%)"[171]"left$(z$,l%)"[179]"
  132. 5400 fori=1tod%
  133. 5410 printtab(y%)"[221]"chr$(v%)m$(m%+i)left$(y$,l%-len(m$(m%+i)))chr$(b%)"[221]":next
  134. 5420 printtab(y%)"[173]"left$(z$,l%)"[189]"
  135. 5430 poke680,y%+1:poke681,y%+l%
  136. 5440 poke682,x%+1+2*q%:poke683,peek(682)+d%-1
  137. 5450 return
  138. 5460 rem *** flash bar
  139. 5470 t%=peek(49408):t1%=peek(49396):poke49396,0:poke49408,0:poke49871,0
  140. 5480 fori=0to14:poke679,1-peek(679)
  141. 5490 ford=0to18:next
  142. 5500 next:s%=peek(49886):poke679,0:poke49408,t%:poke49396,t1%:return
  143. 5510 rem *** clear window space
  144. 5520 printchr$(19)chr$(17)
  145. 5530 fori=0to17:printy$:next
  146. 5540 return
  147. 5550 rem *** handle accel & veloc
  148. 5560 poke684,15
  149. 5570 poke679,1:poke781,x%:poke782,y%:sys58634
  150. 5580 a$=str$(a%)+" ":printchr$(150)mid$(a$,2,2)
  151. 5590 gosub5260:ifpeek(710)=0then5590
  152. 5600 gosub5470
  153. 5610 p%=s%-(x%+1)
  154. 5620 onp%goto5630,5640,5650,5660
  155. 5630 a%=a%+1:a%=a%andl%:goto5570
  156. 5640 a%=a%-1:a%=a%andl%:goto5570
  157. 5650 a%=n%:goto5570
  158. 5660 gosub5520:return
  159. 5670 rem *** print colour blocks
  160. 5680 poke781,x%:poke782,0:sys58634
  161. 5690 printtab(2)chr$(158)"[176]"left$(z$,2*(16-l%))"[174]"
  162. 5700 printtab(2)"[221]"chr$(18);:fori=l%to15:printchr$(c%(i))"  ";:next
  163. 5710 printchr$(146)chr$(158)"[221]"
  164. 5720 printtab(2)"[221]"chr$(18);:fori=l%to15:printchr$(c%(i))"  ";:next
  165. 5730 printchr$(146)chr$(158)"[221]"
  166. 5740 printtab(2)"[173]"left$(z$,2*(16-l%))"[189]":return
  167. 8000 data144,5,28,159,156,30,31,158,129,149,150,151,152,153,154,155
  168. 8010 data2,1,16,6,1,154,155,"  [208]references   "
  169. 8020 data"[193]cceleration","[201]nitial velocity","[205]aximum velocity","[195]ontrol device"
  170. 8025 data"[193]ttributes","[197]xit"
  171. 8030 data6,5,15,4,1,158,153,"[193]cceleration   "
  172. 8040 data"[193]cceleration +1","[193]cceleration -1","[206]ormal accel.","[197]xit"
  173. 8050 data7,5,19,4,1,158,153,"[201]nitial [214]elocity   "
  174. 8060 data"[201]nitial velocity +1","[201]nitial velocity -1","[206]ormal velocity","[197]xit"
  175. 8070 data8,5,19,4,1,158,153,"[205]aximum [214]elocity   "
  176. 8080 data"[205]aximum velocity +1","[205]aximum velocity -1","[206]ormal maximum","[197]xit"
  177. 8090 data9,5,14,4,1,158,154,"[195]ontrol [196]evice"
  178. 8100 data"[202]oystick 1","[202]oystick 2","[203]eyboard","[197]xit"
  179. 8110 data10,5,19,4,1,159,155,"    [193]ttributes     "
  180. 8120 data"[212]op line text","[212]op line background","[208]ointer colour","[197]xit"
  181. 8130 data2,9,22,2,1,159,154,"[211]ave [208]rogram and [195]ode ","[208]lease enter filename:",""
  182. 8140 data6,13,19,2,0,155,154,"","[208]lease enter device","([212])ape or ([196])isk"
  183. 8150 data8,15,22,2,0,154,155,"","[211]tart tape,","then press any key"
  184.