converter_b_ay38910x8_1a.sdlbas 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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 FFFFFF00 510100000000000000000000B61B00001F6413000000"
  23. print"0000000000003C0000000000000000000000000000004C00000000000000"
  24. print"000000000000000060E3164060E3164060E3164000000000000000000000"
  25. print"000000000000000000000000000000000000000000000000000080841E40"
  26. print"00010100C8000000"
  27. print"A00000"
  28. print"A00100"
  29. print"A00200"
  30. print"A00300"
  31. print"A00400"
  32. print"A00500"
  33. print"A00800"
  34. print"A00900"
  35. print"A00A00"
  36. print"A007B8"
  37. print"A08000"
  38. print"A08100"
  39. print"A08200"
  40. print"A08300"
  41. print"A08400"
  42. print"A08500"
  43. print"A08800"
  44. print"A08900"
  45. print"A08A00"
  46. print"A087B8"
  47. print"A50000"
  48. print"A50100"
  49. print"A50200"
  50. print"A50300"
  51. print"A50400"
  52. print"A50500"
  53. print"A50800"
  54. print"A50900"
  55. print"A50A00"
  56. print"A507B8"
  57. print"550000"
  58. print"550100"
  59. print"550200"
  60. print"550300"
  61. print"550400"
  62. print"550500"
  63. print"550800"
  64. print"550900"
  65. print"550A00"
  66. print"5507B8"
  67. print"A60000"
  68. print"A60100"
  69. print"A60200"
  70. print"A60300"
  71. print"A60400"
  72. print"A60500"
  73. print"A60800"
  74. print"A60900"
  75. print"A60A00"
  76. print"A607B8"
  77. print"560000"
  78. print"560100"
  79. print"560200"
  80. print"560300"
  81. print"560400"
  82. print"560500"
  83. print"560800"
  84. print"560900"
  85. print"560A00"
  86. print"5607B8"
  87. print"A80000"
  88. print"A80100"
  89. print"A80200"
  90. print"A80300"
  91. print"A80400"
  92. print"A80500"
  93. print"A80800"
  94. print"A80900"
  95. print"A80A00"
  96. print"A807B8"
  97. print"580000"
  98. print"580100"
  99. print"580200"
  100. print"580300"
  101. print"580400"
  102. print"580500"
  103. print"580800"
  104. print"580900"
  105. print"580A00"
  106. print"5807B8"
  107. lct=0
  108. open finp$ for input as #1
  109. while eof(1)=0
  110. file input #1,txrd$
  111. setcaption("b:"+str$(lct)):lct+=1
  112. if mid$(txrd$,1,1)="[" then:
  113. if mid$(txrd$,2,1)="f" then:
  114. chid=val(mid$(txrd$,3,2))
  115. chid=chid mod 24 'ay38910x8 has 24 channels
  116. chfqv=vldc(lstinf$(txrd$,":","]"))
  117. chfqv2=int(26.6984611843*2^(8-chfqv))
  118. if chfqv2>2047 then:chfqv2=2047:end if
  119. if chfqv2<0 then:chfqv2=0:end if
  120. chchrfq$=right$("000"+hex$(chfqv2),3)
  121. if int(chid/3)=0 then
  122. txrgo$="A0"+right$("00"+hex$(1+2*(chid mod 3)),2)+"0"+mid$(chchrfq$,1,1)
  123. txrgo$+=" A0"+right$("00"+hex$(0+2*(chid mod 3)),2)+mid$(chchrfq$,2,2)
  124. end if
  125. if int(chid/3)=1 then
  126. txrgo$="A0"+right$("00"+hex$(129+2*(chid mod 3)),2)+"0"+mid$(chchrfq$,1,1)
  127. txrgo$+=" A0"+right$("00"+hex$(128+2*(chid mod 3)),2)+mid$(chchrfq$,2,2)
  128. end if
  129. if int(chid/3)=2 then
  130. txrgo$="A5"+right$("00"+hex$(1+2*(chid mod 3)),2)+"0"+mid$(chchrfq$,1,1)
  131. txrgo$+=" A5"+right$("00"+hex$(0+2*(chid mod 3)),2)+mid$(chchrfq$,2,2)
  132. end if
  133. if int(chid/3)=3 then
  134. txrgo$="55"+right$("00"+hex$(1+2*(chid mod 3)),2)+"0"+mid$(chchrfq$,1,1)
  135. txrgo$+=" 55"+right$("00"+hex$(0+2*(chid mod 3)),2)+mid$(chchrfq$,2,2)
  136. end if
  137. if int(chid/3)=4 then
  138. txrgo$="A6"+right$("00"+hex$(1+2*(chid mod 3)),2)+"0"+mid$(chchrfq$,1,1)
  139. txrgo$+=" A6"+right$("00"+hex$(0+2*(chid mod 3)),2)+mid$(chchrfq$,2,2)
  140. end if
  141. if int(chid/3)=5 then
  142. txrgo$="56"+right$("00"+hex$(1+2*(chid mod 3)),2)+"0"+mid$(chchrfq$,1,1)
  143. txrgo$+=" 56"+right$("00"+hex$(0+2*(chid mod 3)),2)+mid$(chchrfq$,2,2)
  144. end if
  145. if int(chid/3)=6 then
  146. txrgo$="A8"+right$("00"+hex$(1+2*(chid mod 3)),2)+"0"+mid$(chchrfq$,1,1)
  147. txrgo$+=" A8"+right$("00"+hex$(0+2*(chid mod 3)),2)+mid$(chchrfq$,2,2)
  148. end if
  149. if int(chid/3)=7 then
  150. txrgo$="58"+right$("00"+hex$(1+2*(chid mod 3)),2)+"0"+mid$(chchrfq$,1,1)
  151. txrgo$+=" 58"+right$("00"+hex$(0+2*(chid mod 3)),2)+mid$(chchrfq$,2,2)
  152. end if
  153. print ucase$(txrgo$)
  154. end if
  155. if mid$(txrd$,2,1)="v" then:
  156. chid=val(mid$(txrd$,3,2))
  157. chid=chid mod 24 'ay38910x8 has 24 channels
  158. chvlv=vldc(lstinf$(txrd$,":","]"))*0x10
  159. chchrvl$=right$("00"+hex$(chvlv),2)
  160. if int(chid/3)=0 then
  161. txrgo$="A0"+right$("00"+hex$(8+(chid mod 3)),2)+chchrvl$
  162. end if
  163. if int(chid/3)=1 then
  164. txrgo$="A0"+right$("00"+hex$(128+8+(chid mod 3)),2)+chchrvl$
  165. end if
  166. if int(chid/3)=2 then
  167. txrgo$="A5"+right$("00"+hex$(8+(chid mod 3)),2)+chchrvl$
  168. end if
  169. if int(chid/3)=3 then
  170. txrgo$="55"+right$("00"+hex$(8+(chid mod 3)),2)+chchrvl$
  171. end if
  172. if int(chid/3)=4 then
  173. txrgo$="A6"+right$("00"+hex$(8+(chid mod 3)),2)+chchrvl$
  174. end if
  175. if int(chid/3)=5 then
  176. txrgo$="56"+right$("00"+hex$(8+(chid mod 3)),2)+chchrvl$
  177. end if
  178. if int(chid/3)=6 then
  179. txrgo$="A8"+right$("00"+hex$(8+(chid mod 3)),2)+chchrvl$
  180. end if
  181. if int(chid/3)=7 then
  182. txrgo$="58"+right$("00"+hex$(8+(chid mod 3)),2)+chchrvl$
  183. end if
  184. print ucase$(txrgo$)
  185. end if
  186. if mid$(txrd$,2,3)="wvb" then:
  187. wvblv=vldc(lstinf$(txrd$,":","]"))
  188. wvblv2=wvblv*44100
  189. wvblv3a=wvblv2 mod 65536
  190. wvblv3b=int(wvblv2/65536)
  191. wvblv3as$=ucase$(right$("0000"+hex$(wvblv3a),4))
  192. for ii=1 to wvblv3b:print"61FFFF":next
  193. print "61"+mid$(wvblv3as$,3,2)+mid$(wvblv3as$,1,2)
  194. end if
  195. end if
  196. wend
  197. print:print "66":print
  198. close #1