converter_b_huc6280x2_1a.sdlbas 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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 6101000000000000000000004F0A000030130800A700"
  23. print"0000000000003C0000000000000000000000000000008C00000000000000"
  24. print"000000000000000000000000000000000000000000000000000000000000"
  25. print"000000000000000000000000000000000000000000000000000000000000"
  26. print"000000000000000000000000000000000000000000000000000000000000"
  27. print"0000000000000000000000000000 999E3640 00000000 00000000 00000000"
  28. print"000000000000000000000000"
  29. print"B901FF "
  30. print"B90000"
  31. print"B90400 B905FF"
  32. print"B90600 B90601 B90602 B90603"
  33. print"B90604 B90605 B90606 B90607"
  34. print"B90608 B90609 B9060A B9060B"
  35. print"B9060C B9060D B9060E B9060F"
  36. print"B90610 B90611 B90612 B90613"
  37. print"B90614 B90615 B90616 B90617"
  38. print"B90618 B90619 B9061A B9061B"
  39. print"B9061C B9061D B9061E B9061F"
  40. print"B90800 B90900 "
  41. print"B90001"
  42. print"B90400 B905FF"
  43. print"B90600 B90601 B90602 B90603"
  44. print"B90604 B90605 B90606 B90607"
  45. print"B90608 B90609 B9060A B9060B"
  46. print"B9060C B9060D B9060E B9060F"
  47. print"B90610 B90611 B90612 B90613"
  48. print"B90614 B90615 B90616 B90617"
  49. print"B90618 B90619 B9061A B9061B"
  50. print"B9061C B9061D B9061E B9061F"
  51. print"B90002"
  52. print"B90400 B905FF"
  53. print"B90600 B90601 B90602 B90603"
  54. print"B90604 B90605 B90606 B90607"
  55. print"B90608 B90609 B9060A B9060B"
  56. print"B9060C B9060D B9060E B9060F"
  57. print"B90610 B90611 B90612 B90613"
  58. print"B90614 B90615 B90616 B90617"
  59. print"B90618 B90619 B9061A B9061B"
  60. print"B9061C B9061D B9061E B9061F"
  61. print"B90003"
  62. print"B90400 B905FF"
  63. print"B90600 B90601 B90602 B90603"
  64. print"B90604 B90605 B90606 B90607"
  65. print"B90608 B90609 B9060A B9060B"
  66. print"B9060C B9060D B9060E B9060F"
  67. print"B90610 B90611 B90612 B90613"
  68. print"B90614 B90615 B90616 B90617"
  69. print"B90618 B90619 B9061A B9061B"
  70. print"B9061C B9061D B9061E B9061F"
  71. print"B90004"
  72. print"B90400 B905FF"
  73. print"B90600 B90601 B90602 B90603"
  74. print"B90604 B90605 B90606 B90607"
  75. print"B90608 B90609 B9060A B9060B"
  76. print"B9060C B9060D B9060E B9060F"
  77. print"B90610 B90611 B90612 B90613"
  78. print"B90614 B90615 B90616 B90617"
  79. print"B90618 B90619 B9061A B9061B"
  80. print"B9061C B9061D B9061E B9061F"
  81. print"B90700"
  82. print"B90005"
  83. print"B90400 B905FF"
  84. print"B90600 B90601 B90602 B90603"
  85. print"B90604 B90605 B90606 B90607"
  86. print"B90608 B90609 B9060A B9060B"
  87. print"B9060C B9060D B9060E B9060F"
  88. print"B90610 B90611 B90612 B90613"
  89. print"B90614 B90615 B90616 B90617"
  90. print"B90618 B90619 B9061A B9061B"
  91. print"B9061C B9061D B9061E B9061F"
  92. print"B90700"
  93. print"B90000 B902FF B9030F B9049F"
  94. print"B90001 B902FF B9030F B9049F"
  95. print"B90002 B902FF B9030F B9049F"
  96. print"B90003 B902FF B9030F B9049F"
  97. print"B90004 B902FF B9030F B9049F"
  98. print"B90005 B902FF B9030F B9049F"
  99. print"B90000 B90480"
  100. print"B90001 B90480"
  101. print"B90002 B90480"
  102. print"B90003 B90480"
  103. print"B90004 B90480"
  104. print"B90005 B90480"
  105. print"B981FF "
  106. print"B98000"
  107. print"B98400 B985FF"
  108. print"B98600 B98601 B98602 B98603"
  109. print"B98604 B98605 B98606 B98607"
  110. print"B98608 B98609 B9860A B9860B"
  111. print"B9860C B9860D B9860E B9860F"
  112. print"B98610 B98611 B98612 B98613"
  113. print"B98614 B98615 B98616 B98617"
  114. print"B98618 B98619 B9861A B9861B"
  115. print"B9861C B9861D B9861E B9861F"
  116. print"B98800 B98900 "
  117. print"B98001"
  118. print"B98400 B985FF"
  119. print"B98600 B98601 B98602 B98603"
  120. print"B98604 B98605 B98606 B98607"
  121. print"B98608 B98609 B9860A B9860B"
  122. print"B9860C B9860D B9860E B9860F"
  123. print"B98610 B98611 B98612 B98613"
  124. print"B98614 B98615 B98616 B98617"
  125. print"B98618 B98619 B9861A B9861B"
  126. print"B9861C B9861D B9861E B9861F"
  127. print"B98002"
  128. print"B98400 B985FF"
  129. print"B98600 B98601 B98602 B98603"
  130. print"B98604 B98605 B98606 B98607"
  131. print"B98608 B98609 B9860A B9860B"
  132. print"B9860C B9860D B9860E B9860F"
  133. print"B98610 B98611 B98612 B98613"
  134. print"B98614 B98615 B98616 B98617"
  135. print"B98618 B98619 B9861A B9861B"
  136. print"B9861C B9861D B9861E B9861F"
  137. print"B98003"
  138. print"B98400 B985FF"
  139. print"B98600 B98601 B98602 B98603"
  140. print"B98604 B98605 B98606 B98607"
  141. print"B98608 B98609 B9860A B9860B"
  142. print"B9860C B9860D B9860E B9860F"
  143. print"B98610 B98611 B98612 B98613"
  144. print"B98614 B98615 B98616 B98617"
  145. print"B98618 B98619 B9861A B9861B"
  146. print"B9861C B9861D B9861E B9861F"
  147. print"B98004"
  148. print"B98400 B985FF"
  149. print"B98600 B98601 B98602 B98603"
  150. print"B98604 B98605 B98606 B98607"
  151. print"B98608 B98609 B9860A B9860B"
  152. print"B9860C B9860D B9860E B9860F"
  153. print"B98610 B98611 B98612 B98613"
  154. print"B98614 B98615 B98616 B98617"
  155. print"B98618 B98619 B9861A B9861B"
  156. print"B9861C B9861D B9861E B9861F"
  157. print"B98700"
  158. print"B98005"
  159. print"B98400 B985FF"
  160. print"B98600 B98601 B98602 B98603"
  161. print"B98604 B98605 B98606 B98607"
  162. print"B98608 B98609 B9860A B9860B"
  163. print"B9860C B9860D B9860E B9860F"
  164. print"B98610 B98611 B98612 B98613"
  165. print"B98614 B98615 B98616 B98617"
  166. print"B98618 B98619 B9861A B9861B"
  167. print"B9861C B9861D B9861E B9861F"
  168. print"B98700"
  169. print"B98000 B982FF B9830F B9849F"
  170. print"B98001 B982FF B9830F B9849F"
  171. print"B98002 B982FF B9830F B9849F"
  172. print"B98003 B982FF B9830F B9849F"
  173. print"B98004 B982FF B9830F B9849F"
  174. print"B98005 B982FF B9830F B9849F"
  175. print"B98000 B98480"
  176. print"B98001 B98480"
  177. print"B98002 B98480"
  178. print"B98003 B98480"
  179. print"B98004 B98480"
  180. print"B98005 B98480"
  181. lct=0
  182. open finp$ for input as #1
  183. while eof(1)=0
  184. file input #1,txrd$
  185. setcaption("b:"+str$(lct)):lct+=1
  186. if mid$(txrd$,1,1)="[" then:
  187. if mid$(txrd$,2,1)="f" then:
  188. chid=val(mid$(txrd$,3,2))
  189. chid=chid mod 12 'huc6280 has 12 channels
  190. chfqv=vldc(lstinf$(txrd$,":","]"))
  191. chfqv2=int(26.6984611843*2^(8-chfqv))
  192. if chfqv2>2047 then:chfqv2=2047:end if
  193. if chfqv2<0 then:chfqv2=0:end if
  194. chchrfq$=right$("000"+hex$(chfqv2),3)
  195. if int(chid/6)=0 then
  196. txrgo$="B900"+right$("00"+hex$( (chid mod 6) ),2)
  197. txrgo$+=" B902"+mid$(chchrfq$,2,2)
  198. txrgo$+=" B9030"+mid$(chchrfq$,1,1)
  199. else
  200. txrgo$="B980"+right$("00"+hex$( (chid mod 6) ),2)
  201. txrgo$+=" B982"+mid$(chchrfq$,2,2)
  202. txrgo$+=" B9830"+mid$(chchrfq$,1,1)
  203. end if
  204. print ucase$(txrgo$)
  205. end if
  206. if mid$(txrd$,2,1)="v" then:
  207. chid=val(mid$(txrd$,3,2))
  208. chid=chid mod 12 'huc6280 has 12 channels
  209. chvlv=vldc(lstinf$(txrd$,":","]"))*0x10
  210. chchrvl$=right$("00"+hex$(chvlv),1)
  211. if int(chid/6)=0 then
  212. txrgo$="B900"+right$("00"+hex$( (chid mod 6) ),2)
  213. txrgo$+="B9048"+chchrvl$
  214. else
  215. txrgo$="B980"+right$("00"+hex$( (chid mod 6) ),2)
  216. txrgo$+="B9848"+chchrvl$
  217. end if
  218. print ucase$(txrgo$)
  219. end if
  220. if mid$(txrd$,2,3)="wvb" then:
  221. wvblv=vldc(lstinf$(txrd$,":","]"))
  222. wvblv2=wvblv*44100
  223. wvblv3a=wvblv2 mod 65536
  224. wvblv3b=int(wvblv2/65536)
  225. wvblv3as$=ucase$(right$("0000"+hex$(wvblv3a),4))
  226. for ii=1 to wvblv3b:print"61FFFF":next
  227. print "61"+mid$(wvblv3as$,3,2)+mid$(wvblv3as$,1,2)
  228. end if
  229. end if
  230. wend
  231. print:print "66":print
  232. close #1