home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1987 November / 1987-11.d64 / geopuzzle.src (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  8KB  |  365 lines

  1. 10 open2,8,1,"0:geopuzzle"
  2. 20 sys 700
  3. 30 .opt o2,p
  4. 40 ;
  5. 50 ;
  6. 60 ;geopuzzle
  7. 70 ;
  8. 80 ;by rhett anderson & david hensley jr
  9. 90 ;
  10. 100 ;copyright 1987 compute! publications, inc.
  11. 110 ;all rights reserved
  12. 120 ;
  13. 130 ;pal format
  14. 140 ;
  15. 150 ;
  16. 160 *= $304
  17. 170 ;
  18. 180 ; we start at $304 to insure the
  19. 190 ; actual geos code starts at $400
  20. 200 ;
  21. 210 .byte (63+$80) ; add 80 for
  22. 220 ; uncompressed sprite data
  23. 230 .byte 0,0,0
  24. 240 .byte 255,255,254
  25. 250 .byte 128,0,2
  26. 260 .byte 159,125,242
  27. 270 .byte 159,69,242
  28. 280 .byte 159,69,242
  29. 290 .byte 159,125,242
  30. 300 .byte 128,0,2
  31. 310 .byte 159,125,242
  32. 320 .byte 145,85,18
  33. 330 .byte 145,85,18
  34. 340 .byte 159,125,242
  35. 350 .byte 128,0,2
  36. 360 .byte 159,125,242
  37. 370 .byte 159,69,242
  38. 380 .byte 159,69,242
  39. 390 .byte 159,125,242
  40. 400 .byte 128,0,2
  41. 410 .byte 255,255,254
  42. 420 .byte 0,0,0
  43. 430 .byte 0,0,0
  44. 440 .byte $80+3
  45. 450 .byte 6
  46. 460 .byte 0
  47. 470 .word $400
  48. 480 .word endcode
  49. 490 .word $400
  50. 500 .asc "geopuzzle   v1.0"
  51. 510 .byte 0,0,0,0
  52. 520 .asc "anderson & hensley"
  53. 530 .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  54. 540 ;
  55. 550 ; geos equates
  56. 560 ;
  57. 570 setpattern = $c139
  58. 580 newdisk = $c1e1
  59. 590 irectangle = $c19f
  60. 600 iputstring = $c1ae
  61. 610 r0 = 2
  62. 620 mouseup = $c18a
  63. 630 enterdesk = $c22c
  64. 640 doicons = $c15a
  65. 650 ;
  66. 660 ztemp = $70
  67. 670 ;
  68. 680 *= $400
  69. 690 jsr newdisk ;stop drive motor
  70. 700 jsr mouseup ;activate mouse
  71. 710 lda #20     ;draw screen
  72. 720 jsr setpattern
  73. 730 jsr irectangle
  74. 740 .byte 0,199
  75. 750 .word 0,319
  76. 760 lda #1
  77. 770 jsr setpattern
  78. 780 jsr irectangle
  79. 790 .byte 32,167
  80. 800 .word 32,231
  81. 810 jsr dobackcolor
  82. 820 jsr drawblocks
  83. 830 jsr iputstring
  84. 840 .word 104
  85. 850 .byte 18
  86. 860 .asc "geopuzzle"
  87. 870 .byte 0
  88. 880 jsr iputstring
  89. 890 .word 10
  90. 900 .byte 188
  91. 910 .asc "copyright 1987 compute! publications,"
  92. 920 .asc " inc. - all rights reserved"
  93. 930 .byte 0
  94. 940 lda #<gameicons
  95. 950 sta r0
  96. 960 lda #>gameicons
  97. 970 sta r0+1
  98. 980 jsr doicons
  99. 990 rts
  100. 1000 ;
  101. 1010 doit jsr dobackcolor : jmp enterdesk
  102. 1020 ;
  103. 1030 ;the icon table
  104. 1040 ;
  105. 1050 gameicons .byte 14
  106. 1060 .word 160
  107. 1070 .byte 100
  108. 1080 ;
  109. 1090 button1 .word downarrow
  110. 1100 .byte 10,42
  111. 1110 .byte 1,8
  112. 1120 .word dorot0
  113. 1130 ;
  114. 1140 button2 .word downarrow
  115. 1150 .byte 15,42
  116. 1160 .byte 1,8
  117. 1170 .word dorot1
  118. 1180 ;
  119. 1190 button3 .word downarrow
  120. 1200 .byte 20,42
  121. 1210 .byte 1,8
  122. 1220 .word dorot2
  123. 1230 ;
  124. 1240 button4 .word uparrow
  125. 1250 .byte 10,151
  126. 1260 .byte 1,8
  127. 1270 .word dorot3
  128. 1280 ;
  129. 1290 button5 .word uparrow
  130. 1300 .byte 15,151
  131. 1310 .byte 1,8
  132. 1320 .word dorot4
  133. 1330 ;
  134. 1340 button6 .word uparrow
  135. 1350 .byte 20,151
  136. 1360 .byte 1,8
  137. 1370 .word dorot5
  138. 1380 ;
  139. 1390 button7 .word rightarrow
  140. 1400 .byte 6,65
  141. 1410 .byte 1,8
  142. 1420 .word dorot6
  143. 1430 ;
  144. 1440 button8 .word rightarrow
  145. 1450 .byte 6,97
  146. 1460 .byte 1,8
  147. 1470 .word dorot7
  148. 1480 ;
  149. 1490 button9 .word rightarrow
  150. 1500 .byte 6,129
  151. 1510 .byte 1,8
  152. 1520 .word dorot8
  153. 1530 ;
  154. 1540 button10 .word leftarrow
  155. 1550 .byte 25,65
  156. 1560 .byte 1,8
  157. 1570 .word dorot9
  158. 1580 ;
  159. 1590 button11 .word leftarrow
  160. 1600 .byte 25,97
  161. 1610 .byte 1,8
  162. 1620 .word dorot10
  163. 1630 ;
  164. 1640 button12 .word leftarrow
  165. 1650 .byte 25,129
  166. 1660 .byte 1,8
  167. 1670 .word dorot11
  168. 1680 ;
  169. 1690 button13 .word wrench
  170. 1700 .byte 33,70
  171. 1710 .byte 3,21
  172. 1720 .word dowrench
  173. 1730 ;
  174. 1740 button14 .word geos
  175. 1750 .byte 33,110
  176. 1760 .byte 3,21
  177. 1770 .word doit
  178. 1780 ;
  179. 1790 ;icon images
  180. 1800 ;
  181. 1810 downarrow .byte 128+8
  182. 1820 .byte 24,24,24,24,255,126,60,24
  183. 1830 ;
  184. 1840 uparrow .byte 128+8
  185. 1850 .byte 24,60,126,255,24,24,24,24
  186. 1860 ;
  187. 1870 leftarrow .byte 128+8
  188. 1880 .byte 16,48,112,255,255,112,48,16
  189. 1890 ;
  190. 1900 rightarrow .byte 128+8
  191. 1910 .byte 8,12,14,255,255,14,12,8
  192. 1920 ;
  193. 1930 drawblocks ldx ppoint : lda pat0,x
  194. 1940 jsr setpattern
  195. 1950 jsr irectangle
  196. 1960 .byte 56,79
  197. 1970 .word 72,103
  198. 1980 ldx ppoint+1 : lda pat0,x
  199. 1990 jsr setpattern
  200. 2000 jsr irectangle
  201. 2010 .byte 56,79
  202. 2020 .word 112,143
  203. 2030 ldx ppoint+2 : lda pat0,x
  204. 2040 jsr setpattern
  205. 2050 jsr irectangle
  206. 2060 .byte 56,79
  207. 2070 .word 152,183
  208. 2080 ldx ppoint+3 : lda pat0,x
  209. 2090 jsr setpattern
  210. 2100 jsr irectangle
  211. 2110 .byte 88,111
  212. 2120 .word 72,103
  213. 2130 ldx ppoint+4 : lda pat0,x : jsr setpattern
  214. 2140 jsr irectangle
  215. 2150 .byte 88,111
  216. 2160 .word 112,143
  217. 2170 ldx ppoint+5 : lda pat0,x : jsr setpattern
  218. 2180 jsr irectangle
  219. 2190 .byte 88,111
  220. 2200 .word 152,183
  221. 2210 ldx ppoint+6 : lda pat0,x : jsr setpattern
  222. 2220 jsr irectangle
  223. 2230 .byte 120,143
  224. 2240 .word 72,103
  225. 2250 ldx ppoint+7 : lda pat0,x : jsr setpattern
  226. 2260 jsr irectangle
  227. 2270 .byte 120,143
  228. 2280 .word 112,143
  229. 2290 ldx ppoint+8 : lda pat0,x : jsr setpattern
  230. 2300 jsr irectangle
  231. 2310 .byte 120,143
  232. 2320 .word 152,183
  233. 2330 jsr docolors
  234. 2340 rts
  235. 2350 ;
  236. 2360 ppoint .byte 0,1,2,3,4,5,6,7,8
  237. 2370 pat0 .byte 29
  238. 2380 pat1 .byte 30
  239. 2390 pat2 .byte 29
  240. 2400 pat3 .byte 30
  241. 2410 pat4 .byte 24
  242. 2420 pat5 .byte 30
  243. 2430 pat6 .byte 29
  244. 2440 pat7 .byte 30
  245. 2450 pat8 .byte 29
  246. 2460 ;
  247. 2470 ;definitions for the large icons
  248. 2480 ;
  249. 2490 wrench .byte 128+63,0,0,0,255,255,254,128,0
  250. 2500 .byte 2,159,125,242,159,69,242,159
  251. 2510 .byte 69,242,159,125,242,128,0,2
  252. 2520 .byte 159,125,242,145,85,18,145,85
  253. 2530 .byte 18,159,125,242,128,0,2,159
  254. 2540 .byte 125,242,159,69,242,159,69,242
  255. 2550 .byte 159,125,242,128,0,2,255,255
  256. 2560 .byte 254,0,0,0,0,0,0,0
  257. 2570 geos .byte 128+63,0,0,0,255,255,254,131,199
  258. 2580 .byte 130,135,79,194,142,125,226,156
  259. 2590 .byte 3,242,156,3,242,188,7,250
  260. 2600 .byte 190,7,250,190,115,250,191,123
  261. 2610 .byte 250,190,63,250,188,15,250,156
  262. 2620 .byte 7,242,158,7,242,143,15,226
  263. 2630 .byte 135,159,194,131,223,130,255,255
  264. 2640 .byte 254,0,0,0,0,0,0,4
  265. 2650 ;
  266. 2660 dorot0 lda ppoint : ldx ppoint+3 : ldy ppoint+6
  267. 2670 sta ppoint+3 : stx ppoint+6 : sty ppoint
  268. 2680 jmp drawblocks
  269. 2690 dorot1 lda ppoint+1 : ldx ppoint+4 : ldy ppoint+7
  270. 2700 sta ppoint+4 : stx ppoint+7 : sty ppoint+1
  271. 2710 jmp drawblocks
  272. 2720 dorot2 lda ppoint+2 : ldx ppoint+5 : ldy ppoint+8
  273. 2730 sta ppoint+5 : stx ppoint+8 : sty ppoint+2
  274. 2740 jmp drawblocks
  275. 2750 dorot3 lda ppoint+0 : ldx ppoint+3 : ldy ppoint+6
  276. 2760 sta ppoint+6 : stx ppoint+0 : sty ppoint+3
  277. 2770 jmp drawblocks
  278. 2780 dorot4 lda ppoint+1 : ldx ppoint+4 : ldy ppoint+7
  279. 2790 sta ppoint+7 : stx ppoint+1 : sty ppoint+4
  280. 2800 jmp drawblocks
  281. 2810 dorot5 lda ppoint+2 : ldx ppoint+5 : ldy ppoint +8
  282. 2820 sta ppoint+8 : stx ppoint+2 : sty ppoint+5
  283. 2830 jmp drawblocks
  284. 2840 dorot6 lda ppoint+0 : ldx ppoint+1 : ldy ppoint+2
  285. 2850 sta ppoint+1 : stx ppoint+2 : sty ppoint+0
  286. 2860 jmp drawblocks
  287. 2870 dorot7 lda ppoint+3 : ldx ppoint+4 : ldy ppoint+5
  288. 2880 sta ppoint+4 : stx ppoint+5 : sty ppoint+3
  289. 2890 jmp drawblocks
  290. 2900 dorot8 lda ppoint+6 : ldx ppoint+7 : ldy ppoint+8
  291. 2910 sta ppoint+7 : stx ppoint+8 : sty ppoint+6
  292. 2920 jmp drawblocks
  293. 2930 dorot9 lda ppoint+0 : ldx ppoint+1 : ldy ppoint+2
  294. 2940 sta ppoint+2 : stx ppoint+0 : sty ppoint+1
  295. 2950 jmp drawblocks
  296. 2960 dorot10 lda ppoint+3 : ldx ppoint+4 : ldy ppoint+5
  297. 2970 sta ppoint+5 : stx ppoint+3 : sty ppoint+4
  298. 2980 jmp drawblocks
  299. 2990 dorot11 lda ppoint+6 : ldx ppoint+7 : ldy ppoint+8
  300. 3000 sta ppoint+8 : stx ppoint+6 : sty ppoint+7
  301. 3010 jmp drawblocks
  302. 3020 dowrench ldx #8
  303. 3030 loopw txa : sta ppoint,x : dex : bpl loopw
  304. 3040 jmp drawblocks
  305. 3050 ;
  306. 3060 dobackcolor ldx #250
  307. 3070 lda #14
  308. 3080 coloop sta $8c00-1,x
  309. 3090 sta $8c00+249,x
  310. 3100 sta $8c00+499,x
  311. 3110 sta $8c00+749,x
  312. 3120 dex
  313. 3130 bne coloop
  314. 3140 rts
  315. 3150 docolors ldy #8
  316. 3160 bigloop lda ppoint,y
  317. 3170 tax
  318. 3180 lda ltheadd,y
  319. 3190 sta ztemp
  320. 3200 lda htheadd,y
  321. 3210 sta ztemp+1
  322. 3220 tya
  323. 3230 pha
  324. 3240 ldy #0
  325. 3250 lda col0,x
  326. 3260 sta (ztemp),y
  327. 3270 iny : sta (ztemp),y : iny
  328. 3280 lda col1,x
  329. 3290 sta (ztemp),y : iny : sta (ztemp),y
  330. 3300 ldy #80
  331. 3310 lda col2,x
  332. 3320 sta (ztemp),y
  333. 3330 iny : sta (ztemp),y : iny
  334. 3340 lda col3,x
  335. 3350 sta (ztemp),y : iny : sta (ztemp),y
  336. 3360 pla
  337. 3370 tay
  338. 3380 dey
  339. 3390 bpl bigloop
  340. 3400 rts
  341. 3410 ;
  342. 3420 ltheadd .byte <(7*40+$8c00+9)
  343. 3430 .byte <(7*40+$8c00+14)
  344. 3440 .byte <(7*40+$8c00+19)
  345. 3450 .byte <(11*40+$8c00+9)
  346. 3460 .byte <(11*40+$8c00+14)
  347. 3470 .byte <(11*40+$8c00+19)
  348. 3480 .byte <(15*40+$8c00+9)
  349. 3490 .byte <(15*40+$8c00+14)
  350. 3500 .byte <(15*40+$8c00+19)
  351. 3510 htheadd .byte >(7*40+$8c00+9)
  352. 3520 .byte >(7*40+$8c00+14)
  353. 3530 .byte >(7*40+$8c00+19)
  354. 3540 .byte >(11*40+$8c00+9)
  355. 3550 .byte >(11*40+$8c00+14)
  356. 3560 .byte >(11*40+$8c00+19)
  357. 3570 .byte >(15*40+$8c00+9)
  358. 3580 .byte >(15*40+$8c00+14)
  359. 3590 .byte >(15*40+$8c00+19)
  360. 3600 col0 .byte 14,14,14,14,7,5,14,2,4
  361. 36