home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 222 / 222.d81 / testcard (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  11KB  |  342 lines

  1. 5 rem space for sprites                                                    x
  2. 10 rem space for sprites                                                    x
  3. 15 rem space for sprites                                                    x
  4. 20 rem space for sprites                                                    x
  5. 25 rem space for sprites                                                    x
  6. 30 rem space for sprites                                                    x
  7. 35 rem space for sprites                                                    x
  8. 40 rem space for sprites                                                    x
  9. 45 rem space for sprites                                                    x
  10. 50 rem space for sprites                                                    x
  11. 55 rem space for sprites                                                    x
  12. 60 rem space for sprites                                                    x
  13. 65 rem space for sprites                                                    x
  14. 70 rem space for sprites                                                    x
  15. 75 rem space for sprites                                                    x
  16. 90 dim sp(10),n(60),v%(500,3),w%(500,3),c$(16)
  17. 95 goto10210:skipround music player and main loop which are time-critical
  18. 100 remplay a tune(nv voices,kk notes in part 1
  19. 105 forj=1tonv:p(j)=0:d(j)=0:t(j)=ti:nextj
  20. 110 forj=1tonv
  21. 115 if t(j)>ti then 130
  22. 120 t(j)=t(j)+d(j):x=v%(p(j),j)
  23. 125 y=w%(p(j),j):p(j)=p(j)+1:d(j)=y*dv:m(j)=n(x)
  24. 130 nextj
  25. 140 f=0
  26. 145 forj=1tonv
  27. 150 ift(j)<=tithen sp(j+7)=m(j):f=1
  28. 155 nextj
  29. 160 iff=0then 145
  30. 165 ifp(1)<=kkthen110
  31. 170 return
  32. 500 goto5000 :rem pointer to moved code
  33. 2000 rem golden rain(1)
  34. 2005 sp(7)=a+64080
  35. 2010 oncwgoto2020,2040,2045,2050
  36. 2020 ifrnd(0)>0.04then 2100
  37. 2030 cw=2:cn=50:poke2040,34:pokev+21,peek(v+21)+1:pokev+39,1+7*rnd(0)
  38. 2035 sp(10)=no:goto2100
  39. 2040 cw=3:poke2040,35:goto2100
  40. 2045 cw=4:poke2040,36:goto2100
  41. 2050 cw=2:poke 2040,34:cn=cn-1
  42. 2060 ifcn=0then cw=1:pokev+21,peek(v+21)-1
  43. 2100 rem ground explosions
  44. 2110 ongrgoto2120,2140,2145,2150
  45. 2120 ifrnd(0)>0.1 then 2540
  46. 2130 gr=2:poke2041,37:pokev+21,peek(v+21)+2:pokev+40,1+7*rnd(0)
  47. 2135 sp(10)=no:goto2540
  48. 2140 gr=3:poke2041,38:goto2540
  49. 2145 gr=4:poke 2041,39:goto2540
  50. 2150 gr=1:poke v+21,peek(v+21)-2
  51. 2540 rem rocket(2)
  52. 2610 onqagoto2620,2670,2690,2710,2730
  53. 2620 ifrnd(0)>0.05orba=4 then2740
  54. 2630 qy=250:qx=int(350*rnd(0)):qv=-19
  55. 2640 qh=int((350-qx-300*rnd(0))/20):poke2045,33:pokev+44,1+7*rnd(0)
  56. 2650 sp(5)=a+256*qx+qy
  57. 2660 pokev+21,peek(v+21)+32:qa=2:goto2740
  58. 2670 qx=qx+qh:qy=qy+qv:qv=qv+1
  59. 2680 sp(5)=a+256*qx+qy:ifqv=3thenqa=3:sp(10)=no:qn=2:poke2045,37:goto2740
  60. 2690 qn=qn-1:if qn=0then qn=3:qa=4:poke2045,38
  61. 2700 goto2740
  62. 2710 qn=qn-1:ifqn<>0then goto2740
  63. 2715 qn=5:qa=5:poke2045,39:goto2740
  64. 2720 sp(5)=sp(5)-11*257:goto2740
  65. 2730 qn=qn-1:ifqn<>0then 2740
  66. 2732 qa=1:pokev+21,peek(v+21)-32
  67. 2735 pokev+23,peek(v+23)and223:pokev+29,peek(v+29)and223
  68. 2740 rem balloon
  69. 2810 onbagoto2820,2850,2870,2882
  70. 2820 if rnd(0)>0.02then 3000
  71. 2830 sp(6)=a+350*256+80:bp=350 :ba=2:poke2046,42 :pokev+23,peek(v+23)+64
  72. 2835 poke v+29,peek(v+29)+64
  73. 2840 pokev+45,1+7*rnd(0):pokev+21,peek(v+21)+64:goto3000
  74. 2850 bp=bp-1:sp(6)=sp(6)-256
  75. 2860 ifbp=0thenpokev+21,peek(v+21)-64:ba=1
  76. 2865 if bp=0thenpokev+23,peek(v+23)-64:pokev+29,peek(v+29)-64
  77. 2867 goto3000
  78. 2870 bn=bn-1:ifbn<>0then3000
  79. 2880 ba=4:poke2046,41:pokev+45,1:bp=80:pokev+21,peek(v+21)+64:goto3000
  80. 2882 s1=0:s2=0:ift1<tqthens1=n(v%(p1,1)):t1=t1+dv*w%(p1,1):p1=p1+1
  81. 2884 ift2<tqthen s2=n(v%(p2,2)):t2=t2+dv*w%(p2,2):p2=p2+1
  82. 2886 sp(8)=s1:sp(9)=s2
  83. 2890 bp=bp+1:ifbp=213thenpokev+21,peek(v+21)-64:ba=1
  84. 2900 sp(6)=sp(6)+1
  85. 3000 p=peek(v+30)and96:if(p<>96)or(ba<>2)or(qa<>2)then 3500
  86. 3010 rem rocket/balloon collision
  87. 3015 p1=0:p2=0:t1=tq+5:t2=t1
  88. 3020 qa=3:qn=2:poke2045,39:sp(10)=no:bn=8:ba=3:pokev+21,peek(v+21)-64
  89. 3030 sp(6)=sp(6)+1028:poke v+23,peek(v+23)-64:pokev+29,peek(v+29)-64:goto2000
  90. 3500 tq=tq+1:poke v+21,peek(v+21)or128:iftq<500 or  ba<>1then 2000
  91. 3505 forj=1to1000:nextj
  92. 3510 forj=0to10:sp(j)=0:pokevv+24,0
  93. 3515 pokev+21,0
  94. 3520 print"[147]     finally, two pieces  "
  95. 3525 print
  96. 3530 print"     by  wolfgang amadeus
  97. 3540 [153]"           m o z a r t
  98. 3550 print:print"  first,   andante"
  99. 3560 gosub 5040:gosub100
  100. 3570 print:print"  next, an  allegro "
  101. 3580 gosub 5040:gosub100
  102. 3590 restore:
  103. 3600 print:print "the whole program will now be repeated"
  104. 3700 forj=832to1000:reada:nextj
  105. 3710 pokevv+4,0:pokevv+11,0:pokevv+18,0:pokevv+24,0
  106. 3720 goto10290
  107. 4000 c$(1)="   [144]               [146] black"
  108. 4010 c$(2)="                  [146] white"
  109. 4030 c$(3)="                  [146] red"
  110. 4040 c$(4)="   [159]               [146] cyan"
  111. 4050 c$(5)="   [156]               [146] purple"
  112. 4060 c$(6)="                  [146] green"
  113. 4070 c$(7)="                  [146] blue"
  114. 4080 c$(8)="   [158]               [146] yellow"
  115. 4090 c$(9)="   [129]               [146] orange"
  116. 4100 c$(10)="   [149]               [146] brown"
  117. 4110 c$(11)="   [150]               [146] light red"
  118. 4120 c$(12)="   [151]               [146] dark gray"
  119. 4130 c$(13)="   [152]               [146] medium gray"
  120. 4140 c$(14)="   [153]               [146] light green"
  121. 4150 c$(15)="   [154]               [146] light blue"
  122. 4160 c$(16)="   [155]               [146] light gray"
  123. 4170 poke 53280,1:poke53281,6:poke208*256+21,0
  124. 4180 print"[147] hello. welcome to the cbm commodore 64[146]"
  125. 4190 print
  126. 4200 print" here are some bars of colour to help
  127. 4210 [153]"        adjust your set"
  128. 4220 [153]
  129. 4230 [137]10300
  130. 5000 [143] set up notes in n
  131. 5010 a[178]2[174]31[170]33[172]2[174]16:q[178]720:p[178]2[174](1[173]12)
  132. 5020 [129]jj[178]1[164]60: n(jj)[178]a[170]q:q[178]q[172]p:[130]jj
  133. 5030 [143] enter here if n already set up
  134. 5040 vv[178]212[172]256:n(5)[178]a
  135. 5050 [135] nv,ns,at,d,s,dv
  136. 5060 [129]jj[178]1[164]nv:pp(jj)[178]0:[130]jj
  137. 5065 [129]kk[178]1[164]ns
  138. 5070 [135]dn
  139. 5075 [139]dn[177]1 [167][129]jj[178]1[164]nv:pq(jj)[178]pp(jj):[130]jj
  140. 5078 [129]jj[178]1[164]nv
  141. 5080 [135]a$:[135]b$
  142. 5090 [129]tt[178]1[164][195](a$)
  143. 5100 v%(pp(jj),jj)[178][198]([202](a$,tt,1))[171]35
  144. 5110 w%(pp(jj),jj)[178][198]([202](b$,tt,1))[171]48:pp(jj)[178]pp(jj)[170]1
  145. 5120 [130]tt,jj
  146. 5121 [139] dn[178]1[167] 5129 :[143] copy repeated bar
  147. 5122 [129]jj[178]1[164]nv
  148. 5123 pr[178]pp(jj)
  149. 5124 v%(pp(jj),jj)[178]v%(pq(jj),jj):w%(pp(jj),jj)[178]w%(pq(jj),jj)
  150. 5125 pq(jj)[178]pq(jj)[170]1:pp(jj)[178]pp(jj)[170]1
  151. 5126 [139] pq(jj)[179]pr [167] 5124
  152. 5127 [130] jj
  153. 5129 [130]kk
  154. 5130 kk[178]pp(1)[171]1
  155. 5140 [129]jj[178]0[164]nv[171]1
  156. 5150 [151]vv[170]7[172]jj[170]5,16[172]at[170]d
  157. 5160 [151] vv[170]7[172]jj[170]6,16[172]s
  158. 5170 [130]jj
  159. 5180 [151]vv[170]24,15
  160. 5190 [142]
  161. 6100 [143] machine code routine to service sprites  and sound generators
  162. 6110 [143] it updates their position every interrupt
  163. 6120 [131]165,47,133,251,165,48,133,252,160,0,177,251,201,83,208,8,200,177,251
  164. 6130 [131]201,80,240,38,136,200,200,177,251,133,253,200,177,251,133,254,24,165,251
  165. 6140 [131]101,253,133,251,165,252,101,254,133,252,197,50,208,212,165,251
  166. 6150 [131]197,49,208,206,76,49,234
  167. 6160 [131]152,24,105,6,168,162,0,200,200,24,177,251,41,1,240,1,56,102,255,200
  168. 6170 [131]177,251  ,157,0,208,200,177,251,157,1,208,232,232,200,224,16,208,225
  169. 6180 [131]165,255,141,  16,208
  170. 6182 [131]162,0,200,200,177,251,240,29,169,0,157,4,212,177,251,157,4,212,169,0
  171. 6184 [131]145,251,200,177,251,157,1,212,200,177,251,157,0,212,76,208,3
  172. 6186 [131]200,200,200,138,24,105,7,170,224,21,208,209,76,49,234
  173. 6190 [143] insert wedge (code at 988)
  174. 6200 [131]120,169,64,141,20,3,169,3,141,21,3,88,96
  175. 6205 [143] sprite data- bright dot
  176. 6210 [131]0,0,0,0,0,0,0,0,0
  177. 6215 [131]0,0,0,0,0,0,0,0,0
  178. 6220 [131]0,0,0,0,0,0,0,24,0
  179. 6225 [131]0,60,0,0,60,0,0,24,0
  180. 6230 [131]0,0,0,0,0,0,0,0,0
  181. 6235 [131]0,0,0,0,0,0,0,0,0
  182. 6240 [131]0,0,0,0,0,0,0,0,0
  183. 6300 [143] golden rain(1)
  184. 6310 [131]0,32,0,8,132,136,18,0,2
  185. 6315 [131]32,162,164,9,16,146,48,105,40
  186. 6320 [131]64,146,2,0,170,160,148,100,0
  187. 6325 [131]0,90,2,72,36,144,0,124,8
  188. 6330 [131]66,124,32,0,124,0,144,124,4
  189. 6335 [131]66,124,136,0,124,0,32,124,36
  190. 6340 [131]0,124,0,77,125,18,0,124,0
  191. 6350 [143] golden rain(2)
  192. 6360 [131]0,64,0,17,2,68,36,0,1
  193. 6365 [131]65,33,82,16,0,0,33,105,8
  194. 6370 [131]16,146,32,1,18,2,4