home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1989 July / 1989-07.d64 / sfx (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  5KB  |  148 lines

  1. 10 rem copyright 1989 compute! publications, inc. - all rights reserved
  2. 20 print"[147]":b=53280:pokeb,15:pokeb+1,12:pokeb-15,91:b1=b+2:b2=b+4:c=646:d=49152
  3. 30 forj=0to10:readn:poked+j,n:next:data169,0,160,23,153,0,212,136,208,250,96
  4. 40 x=211:y=214:pokec,1:pokeb2,2:pokey,9:print
  5. 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]"
  6. 60 printtab(8)"[160][195]opyright 1989 [195][207][205][208][213][212][197]![160]"
  7. 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]"
  8. 80 z=1:e=828:k=256:r$=chr$(13):p$=chr$(32):m=1.005:a=40:nk=64:kb=197:v=54272
  9. 90 v1=v+1:v2=v:v3=v+8:v4=v+7:r=rnd(-ti)
  10. 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]"
  11. 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)
  12. 120 fort=1toa:readn:n1=n*m:n2=n*2:n3=n*2*m:n4=int(n/2):n5=int(n/2*m)
  13. 130 f1(t)=int(n/k):f2(t)=n-(f1(t)*k):f3(t)=int(n1/k):f4(t)=int(n1-(f3(t)*k))
  14. 140 g1(t)=int(n2/k):g2(t)=n2-(g1(t)*k):g3(t)=int(n3/k):g4(t)=int(n3-(g3(t)*k))
  15. 150 h1(t)=int(n4/k):h2(t)=n4-(h1(t)*k):h3(t)=int(n5/k):h4(t)=int(n5-(h3(t)*k))
  16. 160 next:gosub570:gosub680
  17. 170 data2145,2273,2408,2551,2703,2864,3034,3215,3406,3608,3823,4050,4291,4547
  18. 180 data4817,5103,5407,5728,6069,6430,6812,7217,7647,8101,8583,9094,9634,10207
  19. 190 data10814,11467,12139,12860,13625,14435,15294,16203,17167,18188,19269,20415
  20. 200 sys49152:pokev+23,po(i):pokev+24,vo(i)
  21. 210 geta$:ifa$=""then210
  22. 220 ifval(a$)>0thengosub550:goto200
  23. 230 ifa$="l"thengosub1200:goto200
  24. 240 pokev+5,ad(i):pokev+6,sr(i):pokev+12,ad(i):pokev+13,sr(i):pokev+3,db(i)
  25. 250 pokev+10,dc(i):pokev+17,dd(i):pokev+14,vi(i):pokev+18,vs(i)
  26. 260 ifa$="+"thent=t+1:ift>athent=a
  27. 270 ifa$="-"thent=t-1:ift<1thent=1
  28. 280 ifa$="+"ora$="-"then320
  29. 290 ifa$=r$theni=0:gosub680:pokey,8:print:z=z+1
  30. 300 ifa$=r$thenpokec,7:pokeb1,1:print"    "m1$;z"[157] ":goto200
  31. 310 ifa$="s"thengosub1070:goto200
  32. 320 onoc(i)goto330,340,350
  33. 330 pokev1,f1(t):pokev2,f2(t):pokev3,f3(t):pokee,f3(t):pokev4,f4(t):goto360
  34. 340 pokev1,g1(t):pokev2,g2(t):pokev3,g3(t):pokee,g3(t):pokev4,g4(t):goto360
  35. 350 pokev1,h1(t):pokev2,h2(t):pokev3,h3(t):pokee,h3(t):pokev4,h4(t)
  36. 360 onz(i)goto400,370,380,390,370
  37. 370 pokev+15,f1(t)/.7:goto400
  38. 380 pokev+15,f1(t)/2:goto400
  39. 390 pokev+11,w2(i):forj=1to50:next
  40. 400 ifa$<>r$thenpokev+4,w1(i):pokev+11,w2(i)
  41. 410 onfl(i)goto420,430,440,450
  42. 420 gosub530:goto460
  43. 430 foru=1tosl(i)step10:pokev+22,u:next:goto460
  44. 440 j=1:l=255:foru=1to10:pokev+1,j:pokev+8,l:j=j+i1(i):l=l-i2(i):next:goto460
  45. 450 pokev3,peek(e)/2
  46. 460 ifz(i)=2thenforu=1tosl(i)stepxt(i):pokev+1,u:next
  47. 470 ifz(i)=5thenforu=sl(i)to1step-xt(i):pokev+23,1:pokev+1,u:pokev+23,po(i):next
  48. 480 ifpeek(kb)<>nkthen480
  49. 490 ifz(i)=6thenpokev+4,21:pokev+11,21
  50. 500 pokev+4,w1(i)-1:pokev+11,w2(i)-1
  51. 510 ifa$="r"thengetb$:ifb$=""then320
  52. 520 goto210
  53. 530 pokev,peek(v+27):pokev+7,peek(v+27):ifpeek(kb)<>nkthen530
  54. 540 return
  55. 550 i=val(a$):ifoc(i)=0theni=0:return
  56. 560 t=t(i):pokey,8:print:pokec,3:pokeb2,0:print"    "m2$;i"[157]  ":pokec,1:return
  57. 570 pokec,1:print"[147] space[146] to hear sfx     +[146] to raise pitch
  58. 580 [153]" swait to save sfx         -wait to lower pitch
  59. 590 print" l[146] to load sfx       return[146] for new sfx
  60. 600 [153]" rwait to repeat sfx (any key to stop)
  61. 610 print"----------------------------------------"
  62. 620 ifs$=""thenpokey,8:print:pokec,7:pokeb1,1:print"    "m1$;z"[157] "
  63. 630 pokey,8:print:pokec,7:pokeb1,1:print"  "s$
  64. 640 pokey,8:print:pokex,20:pokeb2,0:pokec,3:printm3$:print
  65. 650 ifp=0thenpokey,11:print:pokex,24:print"(none)
  66. 660 [139]zg[177]0[167][129]u[178]1[164]zg:[151]x,26:[153]u:[130]
  67. 670 [142]
  68. 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
  69. 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
  70. 700 sl(i)[178][181](255[172][187](1))[170]1
  71. 710 j[178][181](7[172][187](1))[170]1:[145]j[137]720,730,740,750,760,770,780
  72. 720 w1(i)[178]17:[137]790
  73. 730 w1(i)[178]33:[137]790
  74. 740 w1(i)[178]65:[137]790
  75. 750 w1(i)[178]129:[137]790
  76. 760 w1(i)[178]21:[137]790
  77. 770 w1(i)[178]23:[137]790
  78. 780 w1(i)[178]85
  79. 790 j[178][181](7[172][187](1))[170]1:[145]j[137]800,810,820,830,840,850,860
  80. 800 w2(i)[178]17:[137]870
  81. 810 w2(i)[178]33:[137]870
  82. 820 w2(i)[178]65:[137]870
  83. 830 w2(i)[178]129:[137]870
  84. 840 w2(i)[178]21:[137]870
  85. 850 w2(i)[178]23:[137]870
  86. 860 w2(i)[178]85
  87. 870 at[178][181](8[172][187](1))[170]1:de[178][181](15[172][187](1))[170]1
  88. 880 su[178][181](15[172][187](1))[170]1:re[178][181](15[172][187](1))[170]1
  89. 890 ad(i)[178]at[172]16[170]de:sr(i)[178]su[172]16[170]re
  90. 900 j[178][181](4[172][187](1))[170]1:[145]j[137]910,920,930,940
  91. 910 po(i)[178]241:[137]950
  92. 920 po(i)[178]242:[137]950
  93. 930 po(i)[178]243:[137]950
  94. 940 po(i)[178]240
  95. 950 xt(i)[178][181](40[172][187](1))[170]10
  96. 960 j[178][181](4[172][187](1))[170]1:[145]j[137]970,980,990,1000
  97. 970 vs(i)[178]17:[137]1010
  98. 980 vs(i)[178]33:[137]1010
  99. 990 vs(i)[178]65:[137]1010
  100. 1000 vs(i)[178]129
  101. 1010 vi(i)[178][181](200[172][187](1))[170]55
  102. 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
  103. 1030 j[178][181](3[172][187](1))[170]1:[145]j[137]1040,1050,1060
  104. 1040 vo(i)[178]31:[142]
  105. 1050 vo(i)[178]45:[142]
  106. 1060 vo(i)[178]79:[142]
  107. 1070 [141]1310:[139]p[178][177]9[167]1120
  108. 1080 [151]c,1:[153]"to kwaiteyboard or dwaitisk?
  109. 1090 geta$:ifa$<>"k"thenifa$<>"d"thenifa$<>r$then1090
  110. 1100 ifa$=r$then1190
  111. 1110 ifa$="k"then1320
  112. 1120 printchr$(147)
  113. 1130 input"[144]save filename ($ - dir) ";s$:ifs$="$"then gosub 1300:goto1130
  114. 1140 ifs$=""then1190
  115. 1150 open1,8,1,s$:print#1,t:print#1,oc(0):print#1,i1(0):print#1,i2(0):t(i)=t
  116. 1160 print#1,z(0):print#1,fl(0):print#1,w1(0):print#1,w2(0):print#1,ad(0)
  117. 1170 print#1,sr(0):print#1,po(0):print#1,xt(0):print#1,vi(0):print#1,vs(0)
  118. 1180 print#1,db(0):print#1,dc(0):print#1,dd(0):print#1,vo(0):print#1,sl(0)
  119. 1190 gosub570:close1:return
  120. 1200 printchr$(147)
  121. 1210 input"[144]load filename ($ - dir) ";s$:if s$="$" then gosub 1300:goto1210
  122. 1220 ifs$=""thengosub570:goto1290
  123. 1230 open1,8,0,s$:input#1,t:input#1,oc(0):input#1,i1(0):input#1,i2(0)
  124. 1240 input#1,z(0):input#1,fl(0):input#1,w1(0):input#1,w2(0):input#1,ad(0)
  125. 1250 input#1,sr(0):input#1,po(0):input#1,xt(0):input#1,vi(0):input#1,vs(0)
  126. 1260 input#1,db(0):input#1,dc(0):input#1,dd(0):input#1,vo(0):input#1,sl(0)
  127. 1270 gosub570
  128. 1280 pokey,8:print:pokec,7
  129. 1290 close1:i=0:return
  130. 1300 print"[147]":gosub1370
  131. 1310 s$="":poke198,0:print:return
  132. 1320 p=p+1:i=p:t(i)=t
  133. 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)
  134. 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)
  135. 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)
  136. 1360 zg=zg+1:gosub570:goto560
  137. 1370 open15,8,15:open1,8,0,"$0"
  138. 1380 get#1,a$,a$
  139. 1390 get#1,a$,a$
  140. 1400 s=st:ifs<>0thenclose1:goto1460
  141. 1410 get#1,lo$,hi$
  142. 1420 lo=asc(lo$+chr$(0)):hi=asc(hi$+chr$(0)):ln=lo+hi*256:ln$=mid$(str$(ln),2)
  143. 1430 println$+" ";
  144. 1440 get#1,b$:ifb$=""thenprintchr$(13);:goto1390
  145. 1450 printb$;:goto1440
  146. 1460 input#15,en,em$,et,es:ifen<>0thenprinten;em$;et;es
  147. 1470 close15:return
  148.