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