home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 67
/
067.d81
/
oscilloscope.ba
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
11KB
|
271 lines
30 ft$="oscilloscope.o":gosub50:ft$="oscilloscope.fnt":gosub50:goto100
50 open15,8,15,"r0:"+ft$+"="+ft$:input#15,e,e$:close15:ife=63goto90
70 print"[198]ix your disk, then press space bar."
80 poke198,0:wait198,1:poke198,0:goto50
90 poke147,0:sys57812ft$,8,1:sys62631:return
100 poke55,255:poke56,55:clr:t=0:a=0:ss=0:i=0:n3=0
111 ke$="frsphw[133][134][135][136][137][138][139][140]dtzc\qx":deffnsr(sf)=776.47/sf-3.456
140 at$="[151]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ":deffnsg(sf)=int(sf/174.1+1)
150 er$=" "
180 in=49152:cl=in+3:co=in+6:sa=in+9:di=in+12:re=in+15:dc=in+40:sr=dc+1:ds=dc+2
260 nd=peek(in+18)+256*peek(in+19)+512:xh=peek(in+20)+256*peek(in+21)
290 es=dc+3:ss=dc+4:ht=in+24:pokeht,85:cm=in+26:bm=cm+3:sm=cm+6:ba=cm+9
320 print"[147]":poke53280,06:poke53281,00:printchr$(14)chr$(8):gosub323:goto330
323 c1$="[144]":c2$=c1$:c3$=c1$:c4$=c1$:c5$=c1$:c6$=c1$:pokedc,80:return
330 pokedc,5*16+0:sysco:syscl:sysin:gosub1390:sp=11:pokeds,255/sp:pokees,72
380 fori=0to8:readr$(i):next
390 data"triangle[155] [184][185] mcmlxxxix [170][171][172][173][174][175][176][177][178][179][180][181][182][183]",sawtooth
400 datapulse------,noise (random pulses at set frequency)
410 datasynchronized-triangle,synchronized-sawtooth,synchronized-pulse
420 dataring-modulation (triangle * square)
430 dataring-modulation-synchronized triangle:fori=0to8:readwf(i):next
450 data16,32,64,128,18,34,66,20,22:s=54272:fori=0to24:pokes+i,0:next
470 pokes+24,09+16:pokes+19,16*0+0:pokes+20,16*15+12:pokes+22,64
510 f=440:wf=16:pw=50:sf=110:f2=445
530 gosub800:gosub960:gosub890:gosub1040
570 rem"[211][212][193][210][212] [205][193][201][206][160][204][207][207][208]
580 [139]qx[178]1[137]620
581 [151]198,0:fx[178][184](0):[139]n3[178]0[167][141]1940:n3[178]1
600 [139]wf[179][177]1[167][141]1410:[137]620
610 [141]1860:[137]640
620 [151]s[170]18,wf[170]1:[158]sa:[151]s[170]18,wf:[137]670
640 [151]s[170]18,17:[158]di
670 [161]a$:[139][197](a$)[177]0[175]wf[179][177]1[167]qx[178]0:[137]2950
675 [129]i[178]1[164]21:[139]a$[178][202](ke$,i,1)[167]ke[178]i:i[178]21:[130]:[137]688
680 [130]:[137]580
681 "(NULL)atnright$(NULL) (NULL)(NULL)(NULL)(NULL) ^^^ if no key hit
688 ifwf=1thenke=-7:goto1110
689 ifa$<>"t"thenqx=0
690 ifke<7thenonkegoto760,860,940,1030,1070,1080
700 ke=ke-14:ifke<1goto1110:_fnctnkey
710 onkegoto730,1150,1170,1180,1210,1220,580
720 goto580
730 en$="waveform display speed":nu=2:gosub2740:sp=en
740 ifsp=0thensp=1
750 pokeds,255/sp:goto580
760 en$="voice 3 frequency":nu=4:gosub2740:f=en:ifzz=1thengosub960
780 gosub800:goto580
790 :
800 iff=<0thenf=1
810 iff>3995thenf=3995
820 k=f/.06097:fh=int(k/256):fl=int(k-256*fh)
840 pokes+14,fl:pokes+15,fh:return
841 :
860 en$="voice 2 ring frequency":nu=4:gosub2740:f2=en:gosub890:goto580
880 :
890 iff2=<0thenf2=1
900 iff2>3995thenf2=3995
910 g2=f2/.06097:gh=int(g2/256):gl=g2-256*gh
930 pokes+7,gl:pokes+8,gh:return:___
940 en$="sweep frequency":nu=4:gosub2740:sf=en:zz=0:gosub960:goto580
960 ifzz=1thensf=f/4
970 ifsf<3thensf=3
980 ifsf>1044thensf=1044
990 sg=fnsg(sf):pokesr,fnsr(sf/sg):pokess,sg:pokees,42*sg:return:___
1030 en$="pulse width (%)":nu=2:gosub2740:pw=en:gosub1040:goto580
1040 hi=int(.1599*pw):lo=40.95*pw-256*hi
1060 pokes+16,lo:pokes+17,hi:return:___
1070 gosub2060:goto580:___
1080 wf=1:sf=123:gosub990:pokes+24,14+16:pokes+23,4:pokexh,195:goto580
1110 ke=ke+7:ifg<0org>7goto580
1120 ifwf=1thenpokexh,196:pokes+23,0:pokes+24,9
1130 wf=wf(ke):rs=0:ifke>3thenrs=1
1140 n3=0:goto580:___
1150 ifpeek(xh)<>195thenpoke198,0:fo=f:gosub2640:f=fo:gosub800
1160 goto670:___
1170 zz=1-zz:gosub960:goto580:___
1180 cc=1-cc:ifcc=0thengosub323:goto1200
1190 c1$="[154]":c2$="[158]":c3$="[153]":c4$="":c5$="[159]":c6$="[156]":pokedc,16:gosub2890
1200 sysco:gosub1940:goto580:___
1210 ifa$="\"thenwf=22:rs=1:pokexh,196:pokes+23,0:goto580
1220 print"[147][158][200]ave you tried ring-modulated tune with voice 3 at 5 hz?"
1230 print" [196]o you [210][197][193][204][204][217] want to quit? ([217] or [206])":poke198,0
1240 getyn$:ifyn$=""then1240
1250 ifyn$<>"y"thenn3=0:goto580
1260 sysre:poke53280,0:poke53281,0:pokes+18,16
1280 poke55,0:poke56,160:print"[147] [154][199]ood-bye !"
1300 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
1310 ifer=63goto1340
1320 print"[159][204]oad[211]tar disk not in drive.":print"[150][198]ix, then press space bar."
1330 poke198,0:wait198,1:poke198,0:goto1300
1340 print"[147][144]load"chr$(34)"hello connect"chr$(34)",8":print"run"
1360 poke631,13:poke632,13:poke633,13:poke198,3:end:"[204][207][193][196][211][212][193][210]___
1380 [158]cl:[141]1390:fr[178][184](fr):[142]
1390 [151]214,3:[153]:[153]at$:[151]214,17:[153]:[153]at$:[142]
1410 r$[178]"stop wait":[151]198,0
1430 pr[178][181](f):l3[178]4:r3[178]1:c3[178]12:[141]1770:[153]"stophz"
1440 pr[178][181](sf):l3[178]4:r3[178]1:c3[178]31:[141]1770:[153]"stophz":r$[178]"stop wait"
1460 [151]214,1:[153]:[139]rs[178]0[137]1500
1480 [153]c2$"(NULL)2 ring-sync freq ";
1490 pr[178][181](f2):l3[178]4:r3[178]2:c3[178]18:[141]1770:[153]"stophz"
1500 [153]" ":[151]214,2:[153]:[151]211,0:[153]c3$;
1530 [129]i[178]0[164]8:[139]wf[178]wf(i)[167]ix[178]i:i[178]8
1540 [130]:[153]"print"r$(ix);:[139]wf[179][177]64[175]wf[179][177]66[137]1590
1560 [151]214,2:[153]:[151]211,19:[153]c5$"pulse width="
1580 pr[178]pw:l3[178]2:r3[178]3:c3[178]30:[141]1770:[153]"stop%"
1590 [151]214,1:[153]:[151]211,34:[153]"stop ";:[139]zz[178]0[167][153]"wait(NULL)ascasc";
1620 [139]zz[178]1[167][153]" waitdef(NULL)(NULL)";
1630 [153]"stop wait":[151]214,22:[153]:[139]wf[179][177]66[137]1700
1660 [153]c2$"(NULL)ing-sync frequency, (NULL)oice 2: (NULL)ress (NULL)stop"u$;
1670 [139]wf[179][177]66[167][153]"on":[137]1760
1680 [153]:[153]c5$"(NULL)et (NULL)ulse-width: (NULL)ress list(NULL)defon":[137]1760
1700 [153]c6$"str$isplay speed: liststr$def":pr[178]sp:l3[178]2:r3[178]23:c3[178]17:[141]1770
1720 [153]"print valxamples: stophit 1-7stop";:[139]wf[178]64[137]1680
1740 [139]wf[178]18[176]wf[178]20[176]wf[178]22[176]wf[178]34[167][153]:[137]1660
1750 [153]:[153]"list (NULL)ress (NULL)(NULL)atnlenvalclosepeekatn(NULL) to hold waveformon"
1760 [142]:___([139])
1770 m3[178]c3[170]l3[170]2:r4[178]r3[171]1:[139]l3[178]2[167]r$[178]"stop wait":[137]1810
1790 [139]l3[178]3[167]r$[178]"stop wait":[137]1810
1800 r$[178]"stop wait"
1810 [151]214,r4:[153]:[151]211,c3:[153]r$:[151]214,r4:[153]:[151]211,m3[171][195]([196](pr))
1840 [153]"def"[202]([196](pr),2,4)"";:[142]:___
1860 [153]"load";:[141]1390
1870 [153]"sys(NULL)his is a simulated sine-wave demonstra-tion. (NULL)he sound you left$valatn(NULL)";
1880 [153]" is a filtered triangle waveform--an approximation to a";
1890 [153]"sine wave (filtering cannot be shown)."
1900 [151]214,18:[153]:[153]"onatn sine wave is a 'pure' wave."
1910 [153]"right$t is free of harmonics."
1920 [153]"open (NULL)ress asc1 for unfiltered triangle.":[142]:___
1930 " ascright$(NULL)valstr$close(NULL)atn(NULL)val(NULL)close(NULL)(NULL)peek"
1940 [153]"loadlist ** (NULL)atn(NULL)(NULL)(NULL)right$(NULL)chr$ * (NULL)(NULL)(NULL)(NULL)atnchr$val (NULL)(NULL)lenright$(NULL)(NULL)(NULL)(NULL)len(NULL)(NULL)val ** "
1950 [153]c1$"(NULL)3 ascrequency ";:[153][163]20)c4$" (NULL)weep freq"
1970 [153][163]28)"atnuto:";:[141]1390
1990 [151]214,17:[153]:[153]c3$"(NULL)aveform:listasc1-8,\ ";
2000 [153]c4$"stop(NULL)une:list(NULL)stop (NULL)inewave: list(NULL)stop"
2010 [153]c1$"(NULL)o set frequency of (NULL)oice 3: (NULL)ress listasc"
2020 [153]c4$"(NULL)et sweep rate: (NULL)ress list(NULL) stoplenolors: listlen"
2030 [153]c4$"atnuto-sweep on/off: list(NULL)sys left$elp: listleft$ stop(NULL)uit: list(NULL)":[142]
2050 :
2060 [141]2070:[137]2120
2070 [151]cm,15:[151]bm,27:[151]sm,23:[151]ba,199:[141]2200:[142]
2120 [141]2360:[141]2190:[141]2500:[141]2190:[141]2220
2140 [161]a$:[139]a$[178]""[137]2140
2150 [153]"load":[151]cm,0:[151]bm,59:[151]sm,121:[151]ba,198
2170 [141]1940:[141]1390:[142]:"val(NULL)str$left$val(NULL)(NULL)
2190 getw$:ifw$=""goto2190
2200 print"":print" [146][144]";:return:__
2210