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.

173 lines
2.0KB

  1. .PAGE 'LCC.FMT4'
  2. ;
  3. ;
  4. ;
  5. SYNCLR LDA PCR2 ; WRITE ENTIRE TRACK WITH SYNC
  6. AND #$FF-$E0
  7. ORA #$C0
  8. STA PCR2
  9. ;
  10. LDA #$FF ; OUTPUT MODE DDR
  11. STA DDRA2
  12. ;
  13. STA DATA2 ; SYNC CHAR
  14. ;
  15. LDX #$28 ; $28*256 BYTES
  16. LDY #0
  17. ;
  18. SYC10 BVC *
  19. CLV
  20. ;
  21. DEY
  22. BNE SYC10
  23. ;
  24. DEX
  25. BNE SYC10
  26. ;
  27. RTS ; LEAVE WRITE ON
  28. ;
  29. ;
  30. ;
  31. WRTNUM LDX NUM ; WRITE OUT NUM BYTES
  32. LDY NUM+1
  33. ;
  34. WRTN10 BVC *
  35. CLV
  36. ;
  37. DEX
  38. BNE WRTN10
  39. ;
  40. DEY
  41. BPL WRTN10
  42. ;
  43. RTS
  44. ;
  45. ;
  46. ;
  47. FMTERR DEC CNT ; TEST FOR RETRY
  48. BEQ FMTE10
  49. ;
  50. JMP END
  51. ;
  52. FMTE10
  53. ;
  54. LDY #$FF
  55. STY FTNUM ; CLEAR FORMAT
  56. ;
  57. INY
  58. STY GCRFLG
  59. ;
  60. JMP ERRR
  61. ;
  62. ;
  63. ;
  64. MOVUP LDA BUFF0,Y ; MOVE UP 69 BYTES
  65. STA BUFF0+69,Y ; MOVE FROM TOP DOWN
  66. DEY
  67. BNE MOVUP
  68. ;
  69. LDA BUFF0 ; DO LAST BYTE
  70. STA BUFF0+69
  71. RTS
  72. ;
  73. ;
  74. ;
  75. ;
  76. MOVOVR LDY #68 ; MOVE OVRBUF INTO (BUFFER)
  77. ;
  78. MOVO10 LDA OVRBUF+256-TOPWRT,Y
  79. STA (BUFPNT),Y
  80. ;
  81. DEY
  82. BPL MOVO10
  83. ;
  84. RTS
  85. ;
  86. ;
  87. ;
  88. KILL LDA PCR2 ; DISABLE WRITE
  89. ORA #$E0
  90. STA PCR2
  91. LDA #$00 ; MAKE PORT INPUT NOW
  92. STA DDRA2
  93. ;
  94. RTS
  95. ;
  96. ;
  97. ;
  98. CLEAR LDA PCR2 ; ENABLE WRITE
  99. AND #$FF-$E0
  100. ORA #$C0
  101. STA PCR2
  102. ;
  103. LDA #$FF ; MAKE PORT AN OUTPUT
  104. STA DDRA2
  105. ;
  106. LDA #$55 ; WRITE A 1F PATTERN
  107. STA DATA2
  108. ;
  109. LDX #$28 ; $28*256 CHARS
  110. LDY #00
  111. CLER10 BVC *
  112. CLV
  113. DEY
  114. BNE CLER10
  115. ;
  116. DEX
  117. BNE CLER10
  118. ;
  119. RTS
  120. ;
  121. ;*****************************
  122. ;*
  123. ;*
  124. ;* FBTOG
  125. ;* FORMAT BINARY TO GCR CONVERSION
  126. ;*
  127. ;* CONVERTS BUFFER TO GCR WITH OUT HBID
  128. ;*
  129. ;***************************
  130. ;
  131. FBTOG LDA #0 ; POINT AT BUFFER
  132. STA BUFPNT
  133. STA SAVPNT
  134. STA BYTCNT
  135. ;
  136. LDA #256-TOPWRT ; PUT GCR IN OVRFLOW BUFFER
  137. STA GCRPNT
  138. ;
  139. LDA BUFPNT+1 ; SAVE BUFFER POINTER
  140. STA SAVPNT+1
  141. ;
  142. LDA #>OVRBUF
  143. STA BUFPNT+1 ; STORE IN OVERBUF
  144. ;
  145. FBG10 LDY BYTCNT ; GET POINTER
  146. ;
  147. LDA (SAVPNT),Y
  148. STA BTAB
  149. INY
  150. ;
  151. LDA (SAVPNT),Y
  152. STA BTAB+1
  153. INY
  154. ;
  155. LDA (SAVPNT),Y
  156. STA BTAB+2
  157. INY
  158. ;
  159. LDA (SAVPNT),Y
  160. STA BTAB+3
  161. INY
  162. BEQ FBG15 ; TEST IF DONE
  163. ;
  164. STY BYTCNT ; SAVE POINTER
  165. ;
  166. JSR PUT4BG ; CONVERT AND STORE
  167. ;
  168. JMP FBG10
  169. ;
  170. FBG15 JMP PUT4BG ; DONE, RETURN
  171. ;
  172. .END