home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 58 / 058side1.d64 / mist.s (.txt) < prev    next >
Commodore BASIC  |  2022-08-29  |  6KB  |  338 lines

  1. 90 remopen15,8,15,"s0:mist.o":close15
  2. 100 open2,8,1,"0:mist.o,p,w"
  3. 110 sys700
  4. 120 .opt o2
  5. 130 ;
  6. 140 maxlen = 16
  7. 150 random = $f7
  8. 160 step = random+2
  9. 170 count = step+1
  10. 180 dest = $fb
  11. 190 src = dest+2
  12. 200 chrget = $73
  13. 210 ;
  14. 220 prnerror = $a437
  15. 230 getcomma = $aefd
  16. 240 setfls = $ffba
  17. 250 setnam = $ffbd
  18. 260 load = $ffd5
  19. 270 colormem  = $0400
  20. 280 yscroll = $d011
  21. 290 vicmem = $d018
  22. 300 loadaddr = $4000
  23. 310 ;
  24. 320 jmp past ;
  25. 330 jmp pastload ;
  26. 340 ;
  27. 350 ufc .byte 6
  28. 360 ubc .byte 1
  29. 370 ;
  30. 380 ;
  31. 390 past jsr getcomma ;
  32. 400 sta sname ; save 1st char of
  33. 410 ;  string name
  34. 420 ;
  35. 430 jsr chrget ; fetch next char
  36. 440 bne bd1 ;
  37. 450 ldx #11 ; print 'syntax error'
  38. 460 jmp prnerror ;
  39. 470 ;
  40. 480 bd1 cmp #"$" ;
  41. 490 bne bd2 ;
  42. 500 lda #$80 ;
  43. 510 .byte $2c
  44. 520 bd2 ora #$80 ;
  45. 530 sta sname+1 ;
  46. 540 ;
  47. 550 pacify jsr chrget ;
  48. 560 beq bd3 ;
  49. 570 cmp #":" ;
  50. 580 bne pacify ;
  51. 590 ;
  52. 600 bd3 lda $2d ;
  53. 610 sta src ;
  54. 620 lda $2e ;
  55. 630 sta src+1 ;
  56. 640 ;
  57. 650 mainfind ldy #0 ;
  58. 660 lda src ;
  59. 670 cmp $2f ;
  60. 680 bne bd4 ;
  61. 690 lda src+1 ;
  62. 700 cmp $30 ;
  63. 710 bne bd4 ;
  64. 720 ldx #27 ; print 'undefined'
  65. 730 jmp prnerror ;
  66. 740 ;
  67. 750 bd4 lda (src),y ; search for
  68. 760 cmp sname ;  string name
  69. 770 bne bd6 ;
  70. 780 iny ;
  71. 790 lda (src),y ;
  72. 800 cmp sname+1 ;
  73. 810 bne bd6 ;
  74. 820 iny ; f o u n d !
  75. 830 lda (src),y ; fetch string length
  76. 840 cmp #maxlen+1 ; "greater than 16?
  77. 850 bcc bd5 ;
  78. 860 ldx #23 ; yes, [153] [171]
  79. 870 jmp prnerr[176] ; 'string [164]o l[145]g'
  80. 880 ;
  81. 890 bd5 sta [195]gth ;
  82. 900 iny ;
  83. 910 lda (src),y ;
  84. 920 sta po[181]er ;
  85. 930 iny ;
  86. 940 lda (src),y ;
  87. 950 sta po[181]er[170]1 ;
  88. 960 bne clearsrc ;
  89. 970 ;
  90. 980 bd6 clc ; add 7 [164] string pntr.
  91. 990 lda src ;
  92. 1000 adc #7 ;
  93. 1010 sta src ;
  94. 1020 bcc mainfind ;
  95. 1030 inc src[170]1 ;
  96. 1040 bne mainfind ;
  97. 1050 ;
  98. 1060 ; [128] of string h[175]ling
  99. 1070 ;
  100. 1080 clearsrc lda #[177][147]addr ; clear
  101. 1090 sta dest[170]1 ; 8k at [147] address
  102. 1100 ldx #32 ;
  103. 1110 lda #0 ;
  104. 1120 sta dest ;
  105. 1130 tay ;
  106. 1140 ;
  107. 1150 cloop1 sta (dest),y ;
  108. 1160 iny ;
  109. 1170 bne cloop1 ;
  110. 1180 inc dest[170]1 ;
  111. 1190 dex  ;
  112. 1200 bne cloop1 ;
  113. 1210 ;
  114. 1220 lda po[181]er ;
  115. 1230 sta src ;
  116. 1240 lda po[181]er[170]1 ;
  117. 1250 sta src[170]1 ;
  118. 1260 ;
  119. 1270 ldy #0 ; check [129] doodle! [129]mat
  120. 1280 lda (src),y ;
  121. 1290 cmp #"d" ;
  122. 1300 bne [168]ddl ;
  123. 1310 iny ;
  124. 1320 lda (src),y ;
  125. 1330 cmp #"d" ;
  126. 1340 bne [168]ddl ;
  127. 1350 lda #$ff ;
  128. 1360 .byte $2c
  129. 1370 [168]ddl lda #0 ;
  130. 1380 sta ddlflag ;
  131. 1390 ;
  132. 1400 lda #8 ; [147] hi[171]res screen image
  133. 1410 tax ;
  134. 1420 ldy #0 ;
  135. 1430 jsr setfls ;
  136. 1440 lda [195]gth ; fi[195]ame  [195]gth
  137. 1450 ldx po[181]er ;
  138. 1460 ldy po[181]er[170]1 ;
  139. 1470 jsr setnam ;
  140. 1480 lda #0 ;
  141. 1490 tax ;
  142. 1500 bit ddlflag ;
  143. 1510 bpl n[176]m[147] ;
  144. 1520 ldy #[177]([147]addr[171]$400)
  145. 1530 .byte $2c
  146. 1540 n[176]m[147] ldy #[177][147]addr
  147. 1550 ;
  148. 1560 jsr [147] ;
  149. 1570 ;
  150. 1580 bit ddlflag ;
  151. 1590 bmi ddlcol[176] ;
  152. 1600 ;
  153. 1610 lda ubc ; fetch col[176] byte
  154. 1620 [175] #15 ;
  155. 1630 sta ubc ;
  156. 1640 lda ufc ;
  157. 1650 asl a ;
  158. 1660 asl a ;
  159. 1670 asl a ;
  160. 1680 asl a ;
  161. 1690 [176]a ubc ;
  162. 1700 ;
  163. 1710 ldx #250
  164. 1720 initcolr sta col[176]mem[171]1,x ;
  165. 1730 sta col[176]mem[170]249,x ;
  166. 1740 sta col[176]mem[170]499,x ;
  167. 1750 sta col[176]mem[170]749,x ;
  168. 1760 dex ;
  169. 1770 bne initcolr ;
  170. 1780 beq past[147] ;
  171. 1790 ;
  172. 1800 ddlcol[176] ldx #4 ;
  173. 1810 ldy #0 ;
  174. 1820 sty src ;
  175. 1830 sty dest ;
  176. 1840 lda #[177]col[176]mem ;
  177. 1850 sta dest[170]1 ;
  178. 1860 lda #[177]([147]addr[171]$400) ;
  179. 1870 sta src[170]1 ;
  180. 1880 ;
  181. 1890 ddlloop lda (src),y ;
  182. 1900 sta (dest),y ;
  183. 1910 iny ;
  184. 1920 bne ddlloop ;
  185. 1930 inc src[170]1 ;
  186. 1940 inc dest[170]1 ;
  187. 1950 dex ;
  188. 1960 bne ddlloop
  189. 1970 ;
  190. 1980 past[147] bit yscroll ;
  191. 1990 bpl past[147] ;
  192. 2000 ;
  193. 2010 lda #$20 ; clear screen
  194. 2020 sta dest[170]1 ;
  195. 2030 tax ;
  196. 2040 lda #0 ;
  197. 2050 sta dest ;
  198. 2060 tay ;
  199. 2070 cloop2 sta (dest),y ;
  200. 2080 iny ;
  201. 2090 bne cloop2 ;
  202. 2100 inc dest[170]1 ;
  203. 2110 dex  ;
  204. 2120 bne cloop2 ;
  205. 2130 ;
  206. 2140 lda yscroll ; activate hi[171]res
  207. 2150 [176]a #%00100000 ;
  208. 2160 sta yscroll ;
  209. 2170 lda #$18 ;
  210. 2180 sta vicmem ;
  211. 2190 ;
  212. 2200 ; init r[175]om [197]ue
  213. 2210 ;
  214. 2220 lda #$ab ;
  215. 2230 sta r[175]om ;
  216. 2240 lda #$cd ;
  217. 2250 sta r[175]om[170]1 ;
  218. 2260 ;
  219. 2270 lda #6 ;
  220. 2280 sta [169] ;
  221. 2290 ;
  222. 2300 ;
  223. 2310 mainmist ldx [169] ;
  224. 2320 lda bounds,x ;
  225. 2330 ldy offsets,x ;
  226. 2340 tax ;
  227. 2350 dex ;
  228. 2360 lloop1 lda mask[131],y ;
  229. 2370 sta temp,x ;
  230. 2380 dey ;
  231. 2390 dex ;
  232. 2400 bpl lloop1 ;
  233. 2410 ;
  234. 2420 ldy #0 ; init screen po[181]ers
  235. 2430 sty dest ;
  236. 2440 sty src ;
  237. 2450 lda #$20 ;
  238. 2460 sta dest[170]1 ;
  239. 2470 sta count ;
  240. 2480 asl a  ;
  241. 2490 sta src[170]1 ;
  242. 2500 ;
  243. 2510 mist1 lda r[175]om ; calc r[175]om #
  244. 2520 rol r[175]om ;
  245. 2530 e[176] r[175]om ;
  246. 2540 r[176] r[175]om ;
  247. 2550 inc r[175]om[170]1 ;
  248. 2560 adc r[175]om[170]1  ;
  249. 2570 bvc ign[176]e ;
  250. 2580 inc r[175]om[170]1 ;
  251. 2590 ign[176]e sta r[175]om ;
  252. 2600 ;
  253. 2610 ldx [169] ;
  254. 2620 [175] masks,x ;
  255. 2630 cmp bounds,x ;
  256. 2640 bcs mist1 ;
  257. 2650 tax ;
  258. 2660 lda temp,x ;
  259. 2670 [175] (src),y ;
  260. 2680 [176]a (dest),y ;
  261. 2690 sta (dest),y ;
  262. 2700 iny ;
  263. 2710 bne mist1 ;
  264. 2720 ;
  265. 2730 inc dest[170]1 ;
  266. 2740 inc src[170]1 ;
  267. 2750 dec count ;
  268. 2760 bne mist1 ;
  269. 2770 ;
  270. 2780 dec [169] ;
  271. 2790 bmi exit ;
  272. 2800 jmp mainmist ;
  273. 2810 ;
  274. 2820 exit lda #$20 ;
  275. 2830 sta dest[170]1 ;
  276. 2840 tax ;
  277. 2850 asl a ;
  278. 2860 sta src[170]1
  279. 2870 ldy #0
  280. 2880 sty dest
  281. 2890 sty src
  282. 2900 [128]loop lda (src),y
  283. 2910 sta (dest),y
  284. 2920 iny
  285. 2930 bne [128]loop
  286. 2940 inc dest[170]1
  287. 2950 inc src[170]1
  288. 2960 dex
  289. 2970 bne [128]loop
  290. 2980 rts
  291. 2990 ;
  292. 3000 mask[131] = *
  293. 3010 ;
  294. 3020 .byte254,253,251,247,239,223,191,127
  295. 3030 .byte252,250,249,246,245,243,238,237
  296. 3040 .byte235,231,222,221,219,215,207,190
  297. 3050 .byte189,187,183,175,159,126,125,123
  298. 3060 .byte119,111,95,63,248,244,242,241
  299. 3070 .byte236,234,233,230,229,227,220,218
  300. 3080 .byte217,214,213,211,206,205,203,199
  301. 3090 .byte188,186,185,182,181,179,174,173
  302. 3100 .byte171,167,158,157,155,151,143,124
  303. 3110 .byte122,121,118,117,115,110,109,107
  304. 3120 .byte103,94,93,91,87,79,62,61
  305. 3130 .byte59,55,47,31,240,232,228,226
  306. 3140 .byte225,216,212,210,209,204,202,201
  307. 3150 .byte198,197,195,184,180,178,177,172
  308. 3160 .byte170,169,166,165,163,156,154,153
  309. 3170 .byte150,149,147,142,141,139,135,120
  310. 3180 .byte116,114,113,108,106,105,102,101
  311. 3190 .byte99,92,90,89,86,85,83,78
  312. 3200 .byte77,75,71,60,58,57,54,53
  313. 3210 .byte51,46,45,43,39,30,29,27
  314. 3220 .byte23,15,224,208,200,196,194,193
  315. 3230 .byte176,168,164,162,161,152,148,146
  316. 3240 .byte145,140,138,137,134,133,131,112
  317. 3250 .byte104,100,98,97,88,84,82,81
  318. 3260 .byte76,74,73,70,69,67,56,52
  319. 3270 .byte50,49,44,42,41,38,37,35
  320. 3280 .byte28,26,25,22,21,19,14,13
  321. 3290 .byte11,7,192,160,144,136,132,130
  322. 3300 .byte129,96,80,72,68,66,65,48
  323. 3310 .byte40,36,34,33,24,20,18,17
  324. 3320 .byte12,10,9,6,5,3,128,64
  325. 3330 .byte32,16,8,4,2,1
  326. 3340 ;
  327. 3350 bounds .byte 8,28,56,70,56,28,8
  328. 3360 offsets .byte 7,35,91,161,217
  329. 3370 .byte 245,253
  330. 3380 masks .byte 7,31,63,127,63,31,7
  331. 3390 ;
  332. 3400 [195]gth [172][178][172][170]1
  333. 3410 sname [172][178][172][170]2
  334. 3420 po[181]er [172][178][172][170]2
  335. 3430 ddlflag [172][178][172][170]1
  336. 3440 ;
  337. 3450 temp [178] [172]
  338.