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