home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1989 July
/
1989-07.d64
/
sfx
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
5KB
|
148 lines
10 rem copyright 1989 compute! publications, inc. - all rights reserved
20 print"[147]":b=53280:pokeb,15:pokeb+1,12:pokeb-15,91:b1=b+2:b2=b+4:c=646:d=49152
30 forj=0to10:readn:poked+j,n:next:data169,0,160,23,153,0,212,136,208,250,96
40 x=211:y=214:pokec,1:pokeb2,2:pokey,9:print
50 printtab(8)"[160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160]"
60 printtab(8)"[160][195]opyright 1989 [195][207][205][208][213][212][197]![160]"
70 printtab(8)"[160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160][160]"
80 z=1:e=828:k=256:r$=chr$(13):p$=chr$(32):m=1.005:a=40:nk=64:kb=197:v=54272
90 v1=v+1:v2=v:v3=v+8:v4=v+7:r=rnd(-ti)
100 m1$="[160][206][197][215][160][211][198][216][160]":m2$="[160][203][197][217][160][211][198][216][160]":m3$="[160][211][193][214][197][196][160][211][198][216][160][203][197][217][211][160]"
110 dimf1(a),f2(a),f3(a),f4(a),g1(a),g2(a),g3(a),g4(a),h1(a),h2(a),h3(a),h4(a)
120 fort=1toa:readn:n1=n*m:n2=n*2:n3=n*2*m:n4=int(n/2):n5=int(n/2*m)
130 f1(t)=int(n/k):f2(t)=n-(f1(t)*k):f3(t)=int(n1/k):f4(t)=int(n1-(f3(t)*k))
140 g1(t)=int(n2/k):g2(t)=n2-(g1(t)*k):g3(t)=int(n3/k):g4(t)=int(n3-(g3(t)*k))
150 h1(t)=int(n4/k):h2(t)=n4-(h1(t)*k):h3(t)=int(n5/k):h4(t)=int(n5-(h3(t)*k))
160 next:gosub570:gosub680
170 data2145,2273,2408,2551,2703,2864,3034,3215,3406,3608,3823,4050,4291,4547
180 data4817,5103,5407,5728,6069,6430,6812,7217,7647,8101,8583,9094,9634,10207
190 data10814,11467,12139,12860,13625,14435,15294,16203,17167,18188,19269,20415
200 sys49152:pokev+23,po(i):pokev+24,vo(i)
210 geta$:ifa$=""then210
220 ifval(a$)>0thengosub550:goto200
230 ifa$="l"thengosub1200:goto200
240 pokev+5,ad(i):pokev+6,sr(i):pokev+12,ad(i):pokev+13,sr(i):pokev+3,db(i)
250 pokev+10,dc(i):pokev+17,dd(i):pokev+14,vi(i):pokev+18,vs(i)
260 ifa$="+"thent=t+1:ift>athent=a
270 ifa$="-"thent=t-1:ift<1thent=1
280 ifa$="+"ora$="-"then320
290 ifa$=r$theni=0:gosub680:pokey,8:print:z=z+1
300 ifa$=r$thenpokec,7:pokeb1,1:print" "m1$;z"[157] ":goto200
310 ifa$="s"thengosub1070:goto200
320 onoc(i)goto330,340,350
330 pokev1,f1(t):pokev2,f2(t):pokev3,f3(t):pokee,f3(t):pokev4,f4(t):goto360
340 pokev1,g1(t):pokev2,g2(t):pokev3,g3(t):pokee,g3(t):pokev4,g4(t):goto360
350 pokev1,h1(t):pokev2,h2(t):pokev3,h3(t):pokee,h3(t):pokev4,h4(t)
360 onz(i)goto400,370,380,390,370
370 pokev+15,f1(t)/.7:goto400
380 pokev+15,f1(t)/2:goto400
390 pokev+11,w2(i):forj=1to50:next
400 ifa$<>r$thenpokev+4,w1(i):pokev+11,w2(i)
410 onfl(i)goto420,430,440,450
420 gosub530:goto460
430 foru=1tosl(i)step10:pokev+22,u:next:goto460
440 j=1:l=255:foru=1to10:pokev+1,j:pokev+8,l:j=j+i1(i):l=l-i2(i):next:goto460
450 pokev3,peek(e)/2
460 ifz(i)=2thenforu=1tosl(i)stepxt(i):pokev+1,u:next
470 ifz(i)=5thenforu=sl(i)to1step-xt(i):pokev+23,1:pokev+1,u:pokev+23,po(i):next
480 ifpeek(kb)<>nkthen480
490 ifz(i)=6thenpokev+4,21:pokev+11,21
500 pokev+4,w1(i)-1:pokev+11,w2(i)-1
510 ifa$="r"thengetb$:ifb$=""then320
520 goto210
530 pokev,peek(v+27):pokev+7,peek(v+27):ifpeek(kb)<>nkthen530
540 return
550 i=val(a$):ifoc(i)=0theni=0:return
560 t=t(i):pokey,8:print:pokec,3:pokeb2,0:print" "m2$;i"[157] ":pokec,1:return
570 pokec,1:print"[147] space[146] to hear sfx +[146] to raise pitch
580 [153]" swait to save sfx -wait to lower pitch
590 print" l[146] to load sfx return[146] for new sfx
600 [153]" rwait to repeat sfx (any key to stop)
610 print"----------------------------------------"
620 ifs$=""thenpokey,8:print:pokec,7:pokeb1,1:print" "m1$;z"[157] "
630 pokey,8:print:pokec,7:pokeb1,1:print" "s$
640 pokey,8:print:pokex,20:pokeb2,0:pokec,3:printm3$:print
650 ifp=0thenpokey,11:print:pokex,24:print"(none)
660 [139]zg[177]0[167][129]u[178]1[164]zg:[151]x,26:[153]u:[130]
670 [142]
680 z(i)[178][181](5[172][187](1))[170]1:fl(i)[178][181](5[172][187](1))[170]0:oc(i)[178][181](3[172][187](1))[170]1
690 t[178][181](a[172][187](1))[170]1:i1(i)[178][181](25[172][187](1))[170]1:i2(i)[178][181](25[172][187](1))[170]1
700 sl(i)[178][181](255[172][187](1))[170]1
710 j[178][181](7[172][187](1))[170]1:[145]j[137]720,730,740,750,760,770,780
720 w1(i)[178]17:[137]790
730 w1(i)[178]33:[137]790
740 w1(i)[178]65:[137]790
750 w1(i)[178]129:[137]790
760 w1(i)[178]21:[137]790
770 w1(i)[178]23:[137]790
780 w1(i)[178]85
790 j[178][181](7[172][187](1))[170]1:[145]j[137]800,810,820,830,840,850,860
800 w2(i)[178]17:[137]870
810 w2(i)[178]33:[137]870
820 w2(i)[178]65:[137]870
830 w2(i)[178]129:[137]870
840 w2(i)[178]21:[137]870
850 w2(i)[178]23:[137]870
860 w2(i)[178]85
870 at[178][181](8[172][187](1))[170]1:de[178][181](15[172][187](1))[170]1
880 su[178][181](15[172][187](1))[170]1:re[178][181](15[172][187](1))[170]1
890 ad(i)[178]at[172]16[170]de:sr(i)[178]su[172]16[170]re
900 j[178][181](4[172][187](1))[170]1:[145]j[137]910,920,930,940
910 po(i)[178]241:[137]950
920 po(i)[178]242:[137]950
930 po(i)[178]243:[137]950
940 po(i)[178]240
950 xt(i)[178][181](40[172][187](1))[170]10
960 j[178][181](4[172][187](1))[170]1:[145]j[137]970,980,990,1000
970 vs(i)[178]17:[137]1010
980 vs(i)[178]33:[137]1010
990 vs(i)[178]65:[137]1010
1000 vs(i)[178]129
1010 vi(i)[178][181](200[172][187](1))[170]55
1020 db(i)[178][181](8[172][187](1))[170]1:dc(i)[178][181](8[172][187](1))[170]1:dd(i)[178][181](8[172][187](1))[170]1
1030 j[178][181](3[172][187](1))[170]1:[145]j[137]1040,1050,1060
1040 vo(i)[178]31:[142]
1050 vo(i)[178]45:[142]
1060 vo(i)[178]79:[142]
1070 [141]1310:[139]p[178][177]9[167]1120
1080 [151]c,1:[153]"to kwaiteyboard or dwaitisk?
1090 geta$:ifa$<>"k"thenifa$<>"d"thenifa$<>r$then1090
1100 ifa$=r$then1190
1110 ifa$="k"then1320
1120 printchr$(147)
1130 input"[144]save filename ($ - dir) ";s$:ifs$="$"then gosub 1300:goto1130
1140 ifs$=""then1190
1150 open1,8,1,s$:print#1,t:print#1,oc(0):print#1,i1(0):print#1,i2(0):t(i)=t
1160 print#1,z(0):print#1,fl(0):print#1,w1(0):print#1,w2(0):print#1,ad(0)
1170 print#1,sr(0):print#1,po(0):print#1,xt(0):print#1,vi(0):print#1,vs(0)
1180 print#1,db(0):print#1,dc(0):print#1,dd(0):print#1,vo(0):print#1,sl(0)
1190 gosub570:close1:return
1200 printchr$(147)
1210 input"[144]load filename ($ - dir) ";s$:if s$="$" then gosub 1300:goto1210
1220 ifs$=""thengosub570:goto1290
1230 open1,8,0,s$:input#1,t:input#1,oc(0):input#1,i1(0):input#1,i2(0)
1240 input#1,z(0):input#1,fl(0):input#1,w1(0):input#1,w2(0):input#1,ad(0)
1250 input#1,sr(0):input#1,po(0):input#1,xt(0):input#1,vi(0):input#1,vs(0)
1260 input#1,db(0):input#1,dc(0):input#1,dd(0):input#1,vo(0):input#1,sl(0)
1270 gosub570
1280 pokey,8:print:pokec,7
1290 close1:i=0:return
1300 print"[147]":gosub1370
1310 s$="":poke198,0:print:return
1320 p=p+1:i=p:t(i)=t
1330 oc(i)=oc(0):i1(i)=i1(0):i2(i)=i2(0):z(i)=z(0):fl(i)=fl(0):w1(i)=w1(0)
1340 w2(i)=w2(0):ad(i)=ad(0):sr(i)=sr(0):po(i)=po(0):xt(i)=xt(0):vi(i)=vi(0)
1350 vs(i)=vs(0):db(i)=db(0):dc(i)=dc(0):dd(i)=dd(0):vo(i)=vo(0):sl(i)=sl(0)
1360 zg=zg+1:gosub570:goto560
1370 open15,8,15:open1,8,0,"$0"
1380 get#1,a$,a$
1390 get#1,a$,a$
1400 s=st:ifs<>0thenclose1:goto1460
1410 get#1,lo$,hi$
1420 lo=asc(lo$+chr$(0)):hi=asc(hi$+chr$(0)):ln=lo+hi*256:ln$=mid$(str$(ln),2)
1430 println$+" ";
1440 get#1,b$:ifb$=""thenprintchr$(13);:goto1390
1450 printb$;:goto1440
1460 input#15,en,em$,et,es:ifen<>0thenprinten;em$;et;es
1470 close15:return