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