converter_b_huc6280_1a.sdlbas 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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 FFFFFF0F 6101000000000000000000004F0A000030130800A700"
  23. print"0000000000003C0000000000000000000000000000008C00000000000000"
  24. print"000000000000000000000000000000000000000000000000000000000000"
  25. print"000000000000000000000000000000000000000000000000000000000000"
  26. print"000000000000000000000000000000000000000000000000000000000000"
  27. print"0000000000000000000000000000999E3600000000000000000000000000"
  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. lct=0
  106. open finp$ for input as #1
  107. while eof(1)=0
  108. file input #1,txrd$
  109. setcaption("b:"+str$(lct)):lct+=1
  110. if mid$(txrd$,1,1)="[" then:
  111. if mid$(txrd$,2,1)="f" then:
  112. chid=val(mid$(txrd$,3,2))
  113. chid=chid mod 6 'huc6280 has 6 channels
  114. chfqv=vldc(lstinf$(txrd$,":","]"))
  115. chfqv2=int(26.6984611843*2^(8-chfqv))
  116. if chfqv2>2047 then:chfqv2=2047:end if
  117. if chfqv2<0 then:chfqv2=0:end if
  118. chchrfq$=right$("000"+hex$(chfqv2),3)
  119. txrgo$="B900"+right$("00"+hex$(chid),2)
  120. txrgo$+=" B902"+mid$(chchrfq$,2,2)
  121. txrgo$+=" B9030"+mid$(chchrfq$,1,1)
  122. print ucase$(txrgo$)
  123. end if
  124. if mid$(txrd$,2,1)="v" then:
  125. chid=val(mid$(txrd$,3,2))
  126. chid=chid mod 6 'huc6280 has 6 channels
  127. chvlv=vldc(lstinf$(txrd$,":","]"))*0x10
  128. chchrvl$=right$("00"+hex$(chvlv),1)
  129. txrgo$="B900"+right$("00"+hex$(chid),2)
  130. txrgo$+="B9048"+chchrvl$
  131. print ucase$(txrgo$)
  132. end if
  133. if mid$(txrd$,2,3)="wvb" then:
  134. wvblv=vldc(lstinf$(txrd$,":","]"))
  135. wvblv2=wvblv*44100
  136. wvblv3a=wvblv2 mod 65536
  137. wvblv3b=int(wvblv2/65536)
  138. wvblv3as$=ucase$(right$("0000"+hex$(wvblv3a),4))
  139. for ii=1 to wvblv3b:print"61FFFF":next
  140. print "61"+mid$(wvblv3as$,3,2)+mid$(wvblv3as$,1,2)
  141. end if
  142. end if
  143. wend
  144. print:print "66":print
  145. close #1