0
|
1 ********************************************************************
|
|
2 * CO80 - WordPak 80-RS co-driver for CCIO
|
|
3 *
|
|
4 * $Id$
|
|
5 *
|
1499
|
6 * Edt/Rev YYYY/MM/DD Modified by
|
|
7 * Comment
|
0
|
8 * ------------------------------------------------------------------
|
1499
|
9 * 2 ????/??/??
|
|
10 * From Tandy OS-9 Level One VR 02.00.00
|
1512
|
11 *
|
|
12 * 2003/09/22 Rodney Hamilton
|
|
13 * recoded dispatch table fcbs
|
0
|
14
|
|
15 nam CO80
|
|
16 ttl WordPak 80-RS co-driver for CCIO
|
|
17
|
|
18 * Disassembled 98/08/23 17:58:20 by Disasm v1.6 (C) 1988 by RML
|
|
19
|
|
20 ifp1
|
|
21 use defsfile
|
1585
|
22 use cciodefs
|
0
|
23 endc
|
|
24
|
|
25 tylg set Systm+Objct
|
|
26 atrv set ReEnt+rev
|
1287
|
27 rev set $00
|
201
|
28 edition set 2
|
0
|
29
|
|
30 mod eom,name,tylg,atrv,start,size
|
|
31
|
|
32 u0000 rmb 0
|
|
33 size equ .
|
|
34 fcb $06
|
|
35
|
|
36 name fcs /CO80/
|
|
37 fcb edition
|
|
38
|
1512
|
39 start equ *
|
1582
|
40 lbra Init
|
|
41 lbra Write
|
|
42 lbra GetStat
|
|
43 lbra SetStat
|
|
44 lbra Term
|
1512
|
45
|
|
46 * Init
|
1582
|
47 Init ldx #$FF78
|
0
|
48 lda #$06
|
|
49 sta $01,x
|
|
50 sta ,x
|
|
51 lda #$08
|
|
52 sta $01,x
|
|
53 clr ,x
|
|
54 lda #$0E
|
|
55 sta $01,x
|
|
56 clr ,x
|
|
57 lbsr L0152
|
|
58 lbsr L0229
|
|
59 ldd #$07D0
|
|
60 lbsr L0189
|
1585
|
61 ldb <V.COLoad,u
|
0
|
62 orb #$04
|
|
63 bra L004F
|
1512
|
64 * Term
|
1585
|
65 Term ldb <V.COLoad,u
|
0
|
66 andb #$FB
|
1585
|
67 L004F stb <V.COLoad,u
|
0
|
68 clrb
|
|
69 rts
|
1512
|
70 * GetStat
|
1585
|
71 GetStat cmpa #SS.Cursr
|
1582
|
72 bne SetStat
|
1585
|
73 ldy R$Y,y
|
0
|
74 clra
|
1585
|
75 ldb <V.C80X,u
|
0
|
76 addb #$20
|
|
77 std $06,y
|
1585
|
78 ldb <V.C80Y,u
|
0
|
79 addb #$20
|
1585
|
80 std R$X,y
|
0
|
81 ldx #$FF78
|
|
82 lda #$0D
|
|
83 sta $01,x
|
|
84 lbsr L0174
|
|
85 lda ,x
|
|
86 lbsr L0174
|
|
87 lda ,x
|
|
88 sta $01,y
|
1512
|
89 * no operation entry point
|
0
|
90 L007D clrb
|
|
91 rts
|
1512
|
92 * SetStat
|
1582
|
93 SetStat ldb #E$UnkSvc
|
0
|
94 coma
|
|
95 rts
|
1512
|
96 * Write
|
1582
|
97 Write ldx #$FF78
|
0
|
98 cmpa #$0E
|
|
99 bcs L00B6
|
|
100 cmpa #$1E
|
|
101 bcs L007D
|
|
102 cmpa #$20
|
|
103 lbcs L01F2
|
|
104 cmpa #$7F
|
|
105 bcs L0106
|
|
106 cmpa #$C0
|
|
107 bls L00A6
|
|
108 anda #$1F
|
|
109 suba #$01
|
|
110 cmpa #$19
|
|
111 bhi L00B2
|
|
112 bra L0106
|
|
113 L00A6 cmpa #$AA
|
|
114 bcs L00B2
|
|
115 ora #$10
|
|
116 anda #$1F
|
|
117 cmpa #$1A
|
|
118 bcc L0106
|
|
119 L00B2 lda #$7F
|
|
120 bra L0106
|
|
121 L00B6 leax >L00C5,pcr
|
|
122 lsla
|
|
123 ldd a,x
|
|
124 leax d,x
|
|
125 pshs x
|
|
126 ldx #$FF78
|
|
127 rts
|
1512
|
128
|
|
129 * display functions dispatch table
|
|
130 L00C5 fdb L007D-L00C5 $ffb8 $00:no-op (null)
|
|
131 fdb L0152-L00C5 $008d $01:HOME cursor
|
|
132 fdb L01A2-L00C5 $00dd $02:CURSOR XY
|
|
133 fdb L0179-L00C5 $00b4 $03:ERASE LINE
|
|
134 fdb L017B-L00C5 $00b6 $04:ERASE TO EOL
|
|
135 fdb L0211-L00C5 $014c $05:CURSOR ON/OFF
|
|
136 fdb L0115-L00C5 $0050 $06:CURSOR RIGHT
|
|
137 fdb L007D-L00C5 $ffb8 $07:no-op (bel:handled in CCIO)
|
|
138 fdb L00E1-L00C5 $001c $08:CURSOR LEFT
|
|
139 fdb L00F3-L00C5 $002e $09:CURSOR UP
|
|
140 fdb L0121-L00C5 $005c $0A:CURSOR DOWN
|
|
141 fdb L0186-L00C5 $00c1 $0B:ERASE TO EOS
|
|
142 fdb L0184-L00C5 $00bf $0C:CLEAR SCREEN
|
1585
|
143 fdb Do0D-L00C5 $003c $0D:RETURN
|
1512
|
144
|
|
145 * $08 - cursor left
|
1585
|
146 L00E1 ldd <V.C80X,u get CO80 X/Y
|
|
147 bne L00E8 branch if not at start
|
1512
|
148 clrb
|
|
149 rts
|
0
|
150 L00E8 decb
|
|
151 bge L00EE
|
|
152 ldb #$4F
|
|
153 deca
|
1585
|
154 L00EE std <V.C80X,u
|
0
|
155 bra L014F
|
1512
|
156
|
|
157 * $09 - cursor up
|
1585
|
158 L00F3 lda <V.C80X,u
|
0
|
159 beq L00FF
|
|
160 deca
|
1585
|
161 sta <V.C80X,u
|
0
|
162 lbra L01CC
|
|
163 L00FF clrb
|
|
164 rts
|
1512
|
165
|
|
166 * $0D - move cursor to start of line (carriage return)
|
1585
|
167 Do0D clr <V.C80Y,u
|
0
|
168 bra L014C
|
1585
|
169
|
|
170 L0106 ora <V.5A,u
|
0
|
171 pshs a
|
|
172 bsr L0174
|
|
173 puls a
|
|
174 ldb #$0D
|
|
175 stb $01,x
|
|
176 sta ,x
|
1512
|
177
|
|
178 * $06 - cursor right
|
1585
|
179 L0115 inc <V.C80Y,u
|
|
180 lda <V.C80Y,u
|
0
|
181 cmpa #$4F
|
|
182 ble L014C
|
1585
|
183 bsr Do0D
|
1512
|
184
|
|
185 * $0A - cursor down (line feed)
|
1585
|
186 L0121 lda <V.C80X,u
|
0
|
187 cmpa #$17
|
|
188 bge L012E
|
|
189 inca
|
1585
|
190 sta <V.C80X,u
|
0
|
191 bra L014F
|
1585
|
192 L012E ldd <V.54,u
|
0
|
193 lbsr L01DC
|
1585
|
194 ldd <V.54,u
|
|
195 addd #80
|
0
|
196 bsr L0161
|
1585
|
197 std <V.54,u
|
0
|
198 bsr L018E
|
1585
|
199 ldd <V.54,u
|
0
|
200 bsr L016B
|
|
201 lda #$08
|
|
202 sta $01,x
|
|
203 stb ,x
|
1585
|
204 L014C lda <V.C80X,u
|
0
|
205 L014F lbra L01CC
|
1512
|
206
|
|
207 * $01 - home cursor
|
1585
|
208 L0152 clr <V.C80X,u
|
|
209 clr <V.C80Y,u
|
|
210 ldd <V.54,u
|
|
211 std <V.56,u
|
0
|
212 lbra L01DC
|
|
213 L0161 cmpd #$07D0
|
|
214 blt L016A
|
|
215 subd #$07D0
|
|
216 L016A rts
|
|
217 L016B lsra
|
|
218 rorb
|
|
219 lsra
|
|
220 rorb
|
|
221 lsra
|
|
222 rorb
|
|
223 lsra
|
|
224 rorb
|
|
225 rts
|
|
226 L0174 lda $01,x
|
|
227 bpl L0174
|
|
228 rts
|
1512
|
229
|
|
230 * $03 - erase line
|
1585
|
231 L0179 bsr Do0D do a CR
|
|
232 L017B lda <V.C80X,u
|
0
|
233 inca
|
1512
|
234 ldb #80 line length
|
0
|
235 mul
|
|
236 bra L0189
|
1512
|
237
|
|
238 * $0C - clear screen
|
|
239 L0184 bsr L0152 do home cursor, then erase to EOS
|
|
240
|
|
241 * $0B - erase to end of screen
|
|
242 L0186 ldd #$0780
|
1585
|
243 L0189 addd <V.54,u
|
0
|
244 bsr L0161
|
|
245 L018E bsr L016B
|
|
246 bsr L0174
|
|
247 lda #$0B
|
|
248 sta $01,x
|
|
249 stb ,x
|
|
250 lda #$0D
|
|
251 sta $01,x
|
|
252 lda #$20
|
|
253 sta ,x
|
|
254 L01A0 clrb
|
|
255 rts
|
1512
|
256
|
|
257 * $02 XX YY - move cursor to col XX-32, row YY-32
|
|
258 L01A2 leax >L01B0,pcr
|
0
|
259 ldb #$02
|
1585
|
260 L01A8 stx <V.RTAdd,u
|
|
261 stb <V.NGChr,u
|
0
|
262 clrb
|
|
263 rts
|
|
264 L01B0 ldx #$FF78
|
1585
|
265 lda <V.NChr2,u
|
|
266 ldb <V.NChar,u
|
0
|
267 subb #$20
|
|
268 blt L01A0
|
|
269 cmpb #$4F
|
|
270 bgt L01A0
|
|
271 suba #$20
|
|
272 blt L01A0
|
|
273 cmpa #$17
|
|
274 bgt L01A0
|
1585
|
275 std <V.C80X,u
|
0
|
276 L01CC ldb #$50
|
|
277 mul
|
1585
|
278 addb <V.C80Y,u
|
0
|
279 adca #$00
|
1585
|
280 addd <V.54,u
|
0
|
281 bsr L0161
|
1585
|
282 std <V.56,u
|
0
|
283 L01DC pshs b,a
|
|
284 bsr L0174
|
|
285 lda #$0A
|
|
286 sta $01,x
|
|
287 lda ,s+
|
|
288 sta ,x
|
|
289 lda #$09
|
|
290 sta $01,x
|
|
291 lda ,s+
|
|
292 sta ,x
|
|
293 clrb
|
|
294 rts
|
|
295 L01F2 cmpa #$1F
|
|
296 bne L0201
|
1585
|
297 lda <V.NChr2,u
|
0
|
298 cmpa #$21
|
|
299 beq L0205
|
|
300 cmpa #$20
|
|
301 beq L020C
|
|
302 L0201 comb
|
|
303 ldb #E$Write
|
|
304 rts
|
|
305 L0205 lda #$80
|
1585
|
306 sta <V.5A,u
|
0
|
307 clrb
|
|
308 rts
|
1585
|
309 L020C clr <V.5A,u
|
0
|
310 L020F clrb
|
|
311 rts
|
1512
|
312
|
|
313 * $05 XX - set cursor off/on/color per XX-32
|
|
314 L0211 leax >L0219,pcr
|
0
|
315 ldb #$01
|
|
316 bra L01A8
|
|
317 L0219 ldx #$FF78
|
1585
|
318 lda <V.NChr2,u get next character
|
1512
|
319 cmpa #$20 cursor code valid?
|
|
320 blt L0201 no, error
|
0
|
321 beq L022D
|
1512
|
322 cmpa #$2A color code in range?
|
|
323 bgt L020F no, ignore
|
|
324 L0229 lda #$05 cursor on (all colors=on)
|
0
|
325 bra L022F
|
1512
|
326 L022D lda #$45 cursor off
|
0
|
327 L022F ldb #$0C
|
|
328 stb $01,x
|
|
329 sta ,x
|
|
330 clrb
|
|
331 rts
|
|
332
|
|
333 emod
|
|
334 eom equ *
|
|
335 end
|
|
336
|