converter_b_ay38910_1a.sdlbas 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. function lstinf$(a$,b$,c$)
  2. adra=1:adrb=1:blngt=len(b$):d$=""
  3. while adrb<=blngt
  4. if mid$ (a$,adra,1)=mid$ (b$,adrb,1) then:adrb+=1:end if
  5. adra=adra+1
  6. end while
  7. while mid$(a$,adra,1)<>left$(c$,1)
  8. d$=d$+mid$(a$,adra,1):adra=adra+1
  9. end while
  10. lstinf$=d$
  11. end function
  12. function vldc(a$)
  13. t0$="!"+a$+".0.0.0."
  14. t1$=lstinf$(t0$,"!",".")
  15. t2$=lstinf$(t0$,".",".")
  16. t3=10^(len(t2$))
  17. vldc=val(t1$)+(val(t2$)/t3)
  18. end function
  19. dim chfq[16],chvl[16]
  20. finp$="_.csv"
  21. if argc>2 then:finp$=argv(2):end if
  22. print"56676D20"
  23. print"FFFFFF00"
  24. print"61010000"
  25. print"0000000000000000"
  26. print"00000000"
  27. print"B00F4000"
  28. print"0000000000000000"
  29. print"3C000000"
  30. print"0000000000000000"
  31. print"00000000"
  32. print"CC000000"
  33. print"00000000000000000000000000000000"
  34. print"00000000000000000000000000000000"
  35. print"00000000000000000000000000000000"
  36. print"000000000000000000000000"
  37. print"4D4F1B00"
  38. print"00000000000000000000000000000000"
  39. print"00000000000000000000000000000000"
  40. print"00000000000000000000000000000000"
  41. print"00000000000000000000000000000000"
  42. print"00000000000000000000000000000000"
  43. print"00000000000000000000000000000000"
  44. print"00000000000000000000000000000000"
  45. print"00000000000000000000000000000000"
  46. print"0000000000000000"
  47. print
  48. print"A00000"
  49. print"A00100"
  50. print"A00200"
  51. print"A00300"
  52. print"A00400"
  53. print"A00500"
  54. print"A00800"
  55. print"A00900"
  56. print"A00A00"
  57. print"A007B8"
  58. lct=0
  59. open finp$ for input as #1
  60. while eof(1)=0
  61. file input #1,txrd$
  62. setcaption("b:"+str$(lct)):lct+=1
  63. if mid$(txrd$,1,1)="[" then:
  64. if mid$(txrd$,2,1)="f" then:
  65. chid=val(mid$(txrd$,3,2))
  66. chid=chid mod 3 'ay38910 has 3 channels
  67. chfqv=vldc(lstinf$(txrd$,":","]"))
  68. chfqv2=int(26.6984611843*2^(8-chfqv))
  69. if chfqv2>2047 then:chfqv2=2047:end if
  70. if chfqv2<0 then:chfqv2=0:end if
  71. chchrfq$=right$("000"+hex$(chfqv2),3)
  72. txrgo$="A0"+right$("00"+hex$(1+2*chid),2)+"0"+mid$(chchrfq$,1,1)
  73. txrgo$+=" A0"+right$("00"+hex$(0+2*chid),2)+mid$(chchrfq$,2,2)
  74. print ucase$(txrgo$)
  75. end if
  76. if mid$(txrd$,2,1)="v" then:
  77. chid=val(mid$(txrd$,3,2))
  78. chid=chid mod 3 'ay38910 has 3 channels
  79. chvlv=vldc(lstinf$(txrd$,":","]"))*0x10
  80. chchrvl$=right$("00"+hex$(chvlv),2)
  81. txrgo$="A0"+right$("00"+hex$(8+chid),2)+chchrvl$
  82. print ucase$(txrgo$)
  83. end if
  84. if mid$(txrd$,2,3)="wvb" then:
  85. wvblv=vldc(lstinf$(txrd$,":","]"))
  86. wvblv2=wvblv*44100
  87. wvblv3a=wvblv2 mod 65536
  88. wvblv3b=int(wvblv2/65536)
  89. wvblv3as$=ucase$(right$("0000"+hex$(wvblv3a),4))
  90. for ii=1 to wvblv3b:print"61FFFF":next
  91. print "61"+mid$(wvblv3as$,3,2)+mid$(wvblv3as$,1,2)
  92. end if
  93. end if
  94. wend
  95. print:print "66":print
  96. close #1