123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- function lstinf$(a$,b$,c$)
- adra=1:adrb=1:blngt=len(b$):d$=""
- while adrb<=blngt
- if mid$ (a$,adra,1)=mid$ (b$,adrb,1) then:adrb+=1:end if
- adra=adra+1
- end while
- while mid$(a$,adra,1)<>left$(c$,1)
- d$=d$+mid$(a$,adra,1):adra=adra+1
- end while
- lstinf$=d$
- end function
- function vldc(a$)
- t0$="!"+a$+".0.0.0."
- t1$=lstinf$(t0$,"!",".")
- t2$=lstinf$(t0$,".",".")
- t3=10^(len(t2$))
- vldc=val(t1$)+(val(t2$)/t3)
- end function
- dim chfq[16],chvl[16]
- dim wlt[16]
- wlt[0]=0 '
- wlt[1]=1
- wlt[2]=3 '
- wlt[3]=4
- wlt[4]=5 '
- wlt[5]=7 '
- wlt[6]=8
- wlt[7]=9 '
- wlt[8]=11
- wlt[9]=12 '
- wlt[10]=13
- wlt[11]=15 '
- wlt[12]=15
- wlt[13]=15
- wlt[14]=15
- wlt[15]=15
- ' 0 2 3 4 6 7 8 10 11 12 14 15
- finp$="_.csv"
- if argc>2 then:finp$=argv(2):end if
- print"56676D20"
- print"FFFFFF0F"
- print"60010000"
- print"0000000000000000"
- print"D50B0000"
- print"50D80400"
- print"67000000"
- print"00000000"
- print"3C000000"
- print"0000000000000000"
- print"999E3600"
- print"4C000000"
- print"00000000000000000000000000000000"
- print"00000000000000000000000000000000"
- print"00000000000000000000000000000000"
- print"00000000000000000000000000000000"
- print"0000000000000000"
- print""
- print";- registers reset?"
- print"540102 541800 541B00 5419FF 54197F "
- print"540800 5420C0 54607F 54687F 54707F 54787F "
- print"540801 5421C0 54617F 54697F 54717F 54797F "
- print"540802 5422C0 54627F 546A7F 54727F 547A7F "
- print"540803 5423C0 54637F 546B7F 54737F 547B7F "
- print"540804 5424C0 54647F 546C7F 54747F 547C7F "
- print"540805 5425C0 54657F 546D7F 54757F 547D7F "
- print"540806 5426C0 54667F 546E7F 54767F 547E7F "
- print"540807 5427C0 54677F 546F7F 54777F 547F7F"
- print""
- print";-?"
- print"C002007F C003007F C00A007F C00B007F"
- print"C012007F C013007F C01A007F C01B007F"
- print"C022007F C023007F"
- print""
- print";- instruments?"
- print"544032 54601D 54800E 54A00E 54C000 54E04A"
- print"544851 546816 54880E 54A80E 54C800 54E83A"
- print"545051 547019 549014 54B000 54D000 54F00A"
- print"545831 54781E 549814 54B802 54D801 54F83A"
- print"5420FB 543800 540878 542800 543000"
- print"544132 54611D 54810E 54A10E 54C100 54E14A"
- print"544951 546916 54890E 54A90E 54C900 54E93A"
- print"545151 547119 549114 54B100 54D100 54F10A"
- print"545931 54791E 549914 54B902 54D901 54F93A"
- print"5421FB 543900 540879 54290E 543100"
- print"544232 54621D 54820E 54A20E 54C200 54E24A"
- print"544A51 546A16 548A0E 54AA0E 54CA00 54EA3A"
- print"545251 547219 549214 54B200 54D200 54F20A"
- print"545A31 547A1E 549A14 54BA02 54DA01 54FA3A"
- print"5422FB 543A00 54087A 542A1E 543200"
- print"544332 54631D 54830E 54A30E 54C300 54E34A"
- print"544B51 546B16 548B0E 54AB0E 54CB00 54EB3A"
- print"545351 547319 549314 54B300 54D300 54F30A"
- print"545B31 547B1E 549B14 54BB02 54DB01 54FB3A"
- print"5423FB 543B00 54087B 542B2E 543300"
- print"544432 54641D 54840E 54A40E 54C400 54E44A"
- print"544C51 546C16 548C0E 54AC0E 54CC00 54EC3A"
- print"545451 547419 549414 54B400 54D400 54F40A"
- print"545C31 547C1E 549C14 54BC02 54DC01 54FC3A"
- print"5424FB 543C00 54087C 542C3E 543400"
- print"544532 54651D 54850E 54A50E 54C500 54E54A"
- print"544D51 546D16 548D0E 54AD0E 54CD00 54ED3A"
- print"545551 547519 549514 54B500 54D500 54F50A"
- print"545D31 547D1E 549D14 54BD02 54DD01 54FD3A"
- print"5425FB 543D00 54087D 542D4E 543500"
- print"544632 54661D 54860E 54A60E 54C600 54E64A"
- print"544E51 546E16 548E0E 54AE0E 54CE00 54EE3A"
- print"545651 547619 549614 54B600 54D600 54F60A"
- print"545E31 547E1E 549E14 54BE02 54DE01 54FE3A"
- print"5426FB 543E00 54087E 542E5E 543600"
- print"544732 54671D 54870E 54A70E 54C700 54E74A "
- print"544F51 546F16 548F0E 54AF0E 54CF00 54EF3A "
- print"545751 547719 549714 54B700 54D700 54F70A "
- print"545F31 547F1E 549F14 54BF02 54DF01 54FF3A "
- print"5427FB 543F00 54087F 542F6E 543700"
- lct=0
- open finp$ for input as #1
- while eof(1)=0
- file input #1,txrd$
- setcaption("b:"+str$(lct)):lct+=1
- if mid$(txrd$,1,1)="[" then:
- if mid$(txrd$,2,1)="f" then:
- chid=val(mid$(txrd$,3,2))
- chid=chid mod 8 'ym2151 has 8 channels
- chfqv=vldc(lstinf$(txrd$,":","]"))
- chfqv-=(2/12) '- <- c
- chfqvo=int(chfqv)
- 'if chfqvo<1 then:chfqvo=1:end if
- 'if chfqvo>8 then:chfqvo=8:end if
- chfqvf=chfqv-chfqvo
- chfqv1a1=chfqvf*12
- chfqv1a2=int(chfqv1a1)
- 'chfqv1a2b=chfqv1a2+int((chfqv1a2+2)/3) '- <-
- chfqv1a2b=wlt[chfqv1a2] '- <-
- chfqv1a3=chfqv1a1-chfqv1a2
- chfqv1a3b=(int(chfqv1a3*64))*4
- 'chfqv3=int(644*2^chfqvf)
- 'chfqv3a=chfqv3 mod 256
- 'chfqv3b=int(chfqv3/256)
- 'chfqv5=(chfqvo*8+chfqv3b)
- 'chfqv2=int(26.6984611843*2^(8-chfqv))
- 'if chfqv2>2047 then:chfqv2=2047:end if
- 'if chfqv2<0 then:chfqv2=0:end if
- 'chchrfq$=right$("000"+hex$(chfqv2),3)
- txrgo$="54080"+right$("0"+hex$(chid),1)
- txrgo$+=" 54087"+right$("0"+hex$(8+chid),1)
- txrgo$+=" 542"+right$("0"+hex$(8+chid),1)+right$("0"+hex$(chfqvo),1)+right$("0"+hex$(chfqv1a2b),1)
- txrgo$+=" 543"+right$("0"+hex$(chid),1)+right$("00"+hex$(chfqv1a3b),2)
- 'txrgo$+=" 54A4"+right$("00"+hex$(chfqv5),2)
- 'txrgo$+=" 54A0"+right$("00"+hex$(chfqv3a),2)
- 'txrgo$+=" 5428F"+right$("0"+hex$(chid),1)
- print ucase$(txrgo$)
- end if
- 'if mid$(txrd$,2,1)="v" then:
- ' chid=val(mid$(txrd$,3,2))
- ' chid=chid mod 8 'ym2151 has 8 channels
- ' chvlv=vldc(lstinf$(txrd$,":","]"))*0x10
- ' chchrvl$=right$("00"+hex$(chvlv),2)
- ' txrgo$="A0"+right$("00"+hex$(8+chid),2)+chchrvl$
- ' print ucase$(txrgo$)
- ' end if
- if mid$(txrd$,2,3)="wvb" then:
- wvblv=vldc(lstinf$(txrd$,":","]"))
- wvblv2=wvblv*44100
- wvblv3a=wvblv2 mod 65536
- wvblv3b=int(wvblv2/65536)
- wvblv3as$=ucase$(right$("0000"+hex$(wvblv3a),4))
- for ii=1 to wvblv3b:print"61FFFF":next
- print "61"+mid$(wvblv3as$,3,2)+mid$(wvblv3as$,1,2)
- end if
- end if
- wend
- print:print "66":print
- close #1
- '
- ' 0 1 2 3 4 5 6 7 8 9 10 11
- ' -2 0 1 2 4 5 6 8 9 10 12 13
- ' 0 2 3 4 6 7 8 10 11 12 14 15
- ' 0 1 1 1 2 2 2 3 3 3 4 4
- ' n+int((n+2)/3)
- '
|