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.

lccfmt4.src 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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