You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lcc.bingcr 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. .PAGE 'LCC.BINGCR - FAST'
  2. ; FAST BINARY TO GCR
  3. ;
  4. ;
  5. PUT4BG LDA #0 ; CLEAR TABLE
  6. STA GTAB+1
  7. STA GTAB+4
  8. ;
  9. LDY GCRPNT
  10. ;
  11. LDA BTAB
  12. AND #$F0
  13. LSR A
  14. LSR A
  15. LSR A
  16. LSR A
  17. TAX
  18. LDA BGTAB,X
  19. ;
  20. ASL A
  21. ASL A
  22. ASL A
  23. STA GTAB
  24. ;
  25. LDA BTAB
  26. AND #$0F
  27. TAX
  28. LDA BGTAB,X
  29. ;
  30. ROR A
  31. ROR GTAB+1
  32. ROR A
  33. ROR GTAB+1
  34. ;
  35. AND #$07
  36. ORA GTAB
  37. STA (BUFPNT),Y
  38. ;
  39. INY
  40. ;
  41. LDA BTAB+1
  42. AND #$F0
  43. LSR A
  44. LSR A
  45. LSR A
  46. LSR A
  47. TAX
  48. LDA BGTAB,X
  49. ;
  50. ASL A
  51. ORA GTAB+1
  52. STA GTAB+1
  53. ;
  54. ;
  55. LDA BTAB+1
  56. AND #$0F
  57. TAX
  58. LDA BGTAB,X
  59. ;
  60. ROL A
  61. ROL A
  62. ROL A
  63. ROL A
  64. STA GTAB+2
  65. ;
  66. ROL A
  67. AND #1
  68. ORA GTAB+1
  69. STA (BUFPNT),Y
  70. ;
  71. INY
  72. ;
  73. LDA BTAB+2
  74. AND #$F0
  75. LSR A
  76. LSR A
  77. LSR A
  78. LSR A
  79. TAX
  80. LDA BGTAB,X
  81. ;
  82. CLC
  83. ROR A
  84. ORA GTAB+2
  85. STA (BUFPNT),Y
  86. INY
  87. ;
  88. ROR A
  89. AND #$80
  90. STA GTAB+3
  91. ;
  92. LDA BTAB+2
  93. AND #$0F
  94. TAX
  95. LDA BGTAB,X
  96. ASL A
  97. ASL A
  98. AND #$7C
  99. ORA GTAB+3
  100. STA GTAB+3
  101. ;
  102. LDA BTAB+3
  103. AND #$F0
  104. LSR A
  105. LSR A
  106. LSR A
  107. LSR A
  108. TAX
  109. LDA BGTAB,X
  110. ;
  111. ROR A
  112. ROR GTAB+4
  113. ROR A
  114. ROR GTAB+4
  115. ROR A
  116. ROR GTAB+4
  117. ;
  118. AND #$03
  119. ORA GTAB+3
  120. STA (BUFPNT),Y
  121. INY
  122. BNE BING35
  123. ;
  124. LDA SAVPNT+1
  125. STA BUFPNT+1
  126. ;
  127. ;
  128. BING35 LDA BTAB+3
  129. AND #$0F
  130. TAX
  131. LDA BGTAB,X
  132. ORA GTAB+4
  133. STA (BUFPNT),Y
  134. INY
  135. STY GCRPNT
  136. RTS
  137. ;
  138. ;
  139. ;
  140. BGTAB .BYTE $0A
  141. .BYTE $0B
  142. .BYTE $12
  143. .BYTE $13
  144. .BYTE $0E
  145. .BYTE $0F
  146. .BYTE $16
  147. .BYTE $17
  148. .BYTE $09
  149. .BYTE $19
  150. .BYTE $1A
  151. .BYTE $1B
  152. .BYTE $0D
  153. .BYTE $1D
  154. .BYTE $1E
  155. .BYTE $15
  156. ;
  157. ;
  158. ;
  159. ;******************************
  160. ;*
  161. ;*
  162. ;* BINARY TO GCR CONVERSION
  163. ;*
  164. ;*
  165. ;* DOES INPLACE CONVERSION OF
  166. ;* BUFFER TO GCR USING OVERFLOW
  167. ;* BLOCK
  168. ;*
  169. ;*
  170. ;* CREATES WRITE IMAGE
  171. ;*
  172. ;* 1 BLOCK ID CHAR
  173. ;* 256 DATA BYTES
  174. ;* 1 CHECK SUM
  175. ;* 2 OFF BYTES
  176. ;* ---
  177. ;* 260 BINARY BYTES
  178. ;*
  179. ;* 260 BINARY BYTES >> 325 GCR
  180. ;*
  181. ;* 325 = 256 + 69 OVERFLOW
  182. ;*
  183. ;*
  184. ;********************************
  185. ;*
  186. BINGCR LDA #0 ; INIT POINTERS
  187. STA BUFPNT
  188. STA SAVPNT
  189. STA BYTCNT
  190. ;
  191. LDA #256-TOPWRT
  192. STA GCRPNT ; START SAVING GCR HERE
  193. ;
  194. STA GCRFLG ; BUFFER CONVERTED FLAG
  195. ;
  196. LDA BUFPNT+1 ; SAVE BUFFER POINTER
  197. STA SAVPNT+1
  198. ;
  199. LDA #>OVRBUF ; POINT AT OVERFLOW
  200. STA BUFPNT+1
  201. ;
  202. LDA DBID ; STORE DATA BLOCK ID
  203. STA BTAB ; AND NEXT 3 DATA BYTES
  204. ;
  205. LDY BYTCNT
  206. ;
  207. LDA (SAVPNT),Y
  208. STA BTAB+1
  209. INY
  210. ;
  211. LDA (SAVPNT),Y
  212. STA BTAB+2
  213. INY
  214. ;
  215. LDA (SAVPNT),Y
  216. STA BTAB+3
  217. INY
  218. ;
  219. BING07 STY BYTCNT ; NEXT BYTE TO GET
  220. ;
  221. JSR PUT4BG ; CONVERT AND STORE
  222. ;
  223. LDY BYTCNT
  224. ;
  225. LDA (SAVPNT),Y
  226. STA BTAB
  227. INY
  228. BEQ BING20
  229. ;
  230. LDA (SAVPNT),Y
  231. STA BTAB+1
  232. INY
  233. ;
  234. LDA (SAVPNT),Y
  235. STA BTAB+2
  236. INY
  237. ;
  238. LDA (SAVPNT),Y
  239. STA BTAB+3
  240. INY
  241. ;
  242. BNE BING07 ; JMP
  243. ;
  244. ;
  245. BING20 LDA CHKSUM ; STORE CHKSUM
  246. STA BTAB+1
  247. ;
  248. LDA #0 ; STORE 0 OFF BYTE
  249. STA BTAB+2
  250. STA BTAB+3
  251. ;
  252. JMP PUT4BG ; CONVERT AND STORE AND RETURN
  253. ;
  254. ;
  255. ;
  256. .END