Mercurial > hg > Members > kono > nitros9-code
annotate level1/modules/vtio.asm @ 2695:c321d41cd8d3 lwtools-port
Conditionalized VTIO to turn off caps-lock for coco2b port
author | Boisy Pitre <boisy.pitre@nuance.com> |
---|---|
date | Thu, 19 Jul 2012 14:36:52 -0500 |
parents | f91dc5c378f6 |
children | 999159b0e7c0 |
rev | line source |
---|---|
1933 | 1 ******************************************************************** |
2 * VTIO - NitrOS-9 Level 1 Video Terminal I/O driver | |
3 * | |
4 * $Id$ | |
5 * | |
6 * Edt/Rev YYYY/MM/DD Modified by | |
7 * Comment | |
8 * ------------------------------------------------------------------ | |
9 * 12 ????/??/?? ??? | |
10 * From Tandy OS-9 Level One VR 02.00.00. | |
11 * | |
12 * 12r1 2003/09/11 Rodney V. Hamilton | |
13 * Modified key table to include $7F, $1D, $1E and $1F codes. | |
14 * | |
15 * 2004/11/28 P.Harvey-Smith | |
16 * Added code to remap Dragon keyboard inputs to CoCo format. | |
17 * | |
18 * 2004/12/02 P.Harvey-Smith | |
19 * Changed the way that the entry points for the co?? drivers are | |
20 * called, so that we can have up to 7 different drivers. | |
21 * Integrated changes needed for the co51 driver from Dragon Data | |
22 * OS-9. | |
23 * | |
24 * 2005/04/24 P.Harvey-Smith | |
25 * Added cursor flash call to AltIRQ routine, this decrements a | |
26 * counter and when zero calls the routine contained in V.Flash | |
27 * ccio initialises this to point to an rts, the individual COxx | |
28 * routine can over-ride this in it's init, this should point to | |
29 * a routine to flash the cursor which should end in an rts. | |
30 * | |
31 * 1 2005/11/26 Boisy G. Pitre | |
32 * Renamed to VTIO. | |
33 | |
34 nam VTIO | |
35 ttl OS-9 Level One V2 CoCo I/O driver | |
36 | |
37 ifp1 | |
38 use defsfile | |
2682
f91dc5c378f6
Remove references to include scfdefs
William Astle <lost@l-w.ca>
parents:
2624
diff
changeset
|
39 ; use scfdefs |
2624 | 40 use cocovtio.d |
1933 | 41 endc |
42 | |
43 tylg set Drivr+Objct | |
44 atrv set ReEnt+rev | |
45 rev set $00 | |
46 edition set 1 | |
47 | |
48 mod eom,name,tylg,atrv,start,size | |
49 | |
50 size equ V.Last | |
51 | |
52 fcb UPDAT.+EXEC. | |
53 | |
54 name fcs /VTIO/ | |
55 fcb edition | |
56 | |
57 start lbra Init | |
58 lbra Read | |
59 lbra Write | |
60 lbra GetStat | |
61 lbra SetStat | |
62 lbra Term | |
63 | |
64 * Init | |
65 * | |
66 * Entry: | |
67 * Y = address of device descriptor | |
68 * U = address of device memory area | |
69 * | |
70 * Exit: | |
71 * CC = carry set on error | |
72 * B = error code | |
73 * | |
74 Init | |
75 * MESS Debug lines for Phill | |
76 * pshs y | |
77 * ldy #$aa55 | |
78 * ldy #V.5136 | |
79 * ldy #V.51End | |
80 * puls y | |
81 | |
82 stu >D.KbdSta store devmem ptr | |
83 clra clear A | |
84 leax <V.SCF,u point to memory after V.SCF | |
85 ; ldb #$5D get counter | |
86 ldb #V.51End-V.SCF | |
87 L002E sta ,x+ clear mem | |
88 decb decrement counter | |
89 bne L002E continue if more | |
90 | |
91 leax FlashCursor,pcr * Point to dummy cursor flash | |
92 stx V.Flash,u * Setup cursor flash | |
93 | |
94 coma A = $FF | |
95 comb B = $FF | |
2695
c321d41cd8d3
Conditionalized VTIO to turn off caps-lock for coco2b port
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2682
diff
changeset
|
96 IFEQ coco2b-1 |
c321d41cd8d3
Conditionalized VTIO to turn off caps-lock for coco2b port
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2682
diff
changeset
|
97 clr <V.Caps,u |
c321d41cd8d3
Conditionalized VTIO to turn off caps-lock for coco2b port
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2682
diff
changeset
|
98 ELSE |
1933 | 99 stb <V.Caps,u |
2695
c321d41cd8d3
Conditionalized VTIO to turn off caps-lock for coco2b port
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2682
diff
changeset
|
100 ENDC |
1933 | 101 std <V.LKeyCd,u |
102 std <V.2Key2,u | |
103 lda #60 | |
104 sta <V.ClkCnt,u | |
105 leax >AltIRQ,pcr get IRQ routine ptr | |
106 stx >D.AltIRQ store in AltIRQ | |
107 leax >SetDsply,pcr get display vector | |
108 stx <V.DspVct,u store in vector address | |
109 leax >XY2Addr,pcr get address of XY2Addr | |
110 stx <V.CnvVct,u | |
111 ldd <IT.PAR,y get parity and baud | |
112 lbra SetupTerm process them | |
113 | |
114 * Term | |
115 * | |
116 * Entry: | |
117 * U = address of device memory area | |
118 * | |
119 * Exit: | |
120 * CC = carry set on error | |
121 * B = error code | |
122 * | |
123 Term pshs cc | |
124 orcc #IRQMask mask interrupts | |
125 ldx >D.Clock get clock vector | |
126 stx >D.AltIRQ and put back in AltIRQ | |
127 puls pc,cc | |
128 | |
129 * Read | |
130 * | |
131 * Entry: | |
132 * Y = address of path descriptor | |
133 * U = address of device memory area | |
134 * | |
135 * Exit: | |
136 * A = character read | |
137 * CC = carry set on error | |
138 * B = error code | |
139 * | |
140 Read | |
141 * pshs y | |
142 * ldy #$aa57 | |
143 * puls y | |
144 | |
145 leax V.InBuf,u point X to input buffer | |
146 ldb V.IBufT,u get tail pointer | |
147 orcc #IRQMask mask IRQ | |
148 cmpb V.IBufH,u same as head pointer | |
149 beq Put2Bed if so, buffer is empty, branch to sleep | |
150 abx X now points to curr char | |
151 lda ,x get char | |
152 bsr L009D check for tail wrap | |
153 stb V.IBufT,u store updated tail | |
154 andcc #^(IRQMask+Carry) unmask IRQ | |
155 rts | |
156 | |
157 Put2Bed lda V.BUSY,u get calling process ID | |
158 sta V.WAKE,u store in V.WAKE | |
159 andcc #^IRQMask clear interrupts | |
160 ldx #$0000 | |
161 os9 F$Sleep sleep forever | |
162 clr V.WAKE,u clear wake | |
163 ldx <D.Proc get pointer to current proc desc | |
164 ldb <P$Signal,x get signal recvd | |
165 beq Read branch if no signal | |
166 cmpb #S$Window window signal? | |
167 bcc Read branch if so | |
168 coma | |
169 rts | |
170 * Check if we need to wrap around tail pointer to zero | |
171 L009D incb increment pointer | |
172 cmpb #$7F at end? | |
173 bls L00A3 branch if not | |
174 clrb else clear pointer (wrap to head) | |
175 L00A3 rts | |
176 | |
177 * | |
178 * IRQ routine for keyboard | |
179 * | |
180 AltIRQ | |
181 * pshs y | |
182 * ldy #$aa58 | |
183 * puls y | |
184 | |
185 | |
186 ldu >D.KbdSta get keyboard static | |
187 ldb <V.CFlg1,u graphics screen currently being displayed? | |
188 beq L00B7 branch if not | |
189 ldb <V.Alpha,u alpha mode? | |
190 beq L00B7 branch if so | |
191 lda <V.PIA1,u | |
192 lbsr SetDsply set up display | |
193 L00B7 ldx #PIA0Base point to PIA base | |
194 clra | |
195 clrb | |
196 std <V.KySns,u clear keysense byte | |
197 bsr L00E8 get bits | |
198 bne L00CC | |
199 clr $02,x clear PIA0Base+2 | |
200 lda ,x get byte from PIA | |
201 coma complement | |
202 anda #$7F strip off hi bit | |
203 bne L00F1 branch if any bit set | |
204 L00CC clra | |
205 clrb | |
206 std <V.KTblLC,u clear | |
207 coma A = $FF | |
208 tst <V.Spcl,u special key? | |
209 bne l@ branch if so | |
210 sta <V.LKeyCd,u | |
211 l@ stb <V.Spcl,u clear for next time | |
212 comb | |
213 sta <V.2Key1,u | |
214 std <V.2Key2,u | |
215 | |
216 CheckFlash | |
217 dec V.FlashCount,u Get flash counter | |
218 beq FlashTime count zero, flash cursor | |
219 bra AltIRQEnd Otherwise just call clock module | |
220 | |
221 FlashTime | |
222 jsr [V.Flash,u] Call flash routine | |
223 lda #CFlash50hz Re-init count | |
224 sta V.FlashCount,u | |
225 | |
226 AltIRQEnd | |
227 jmp [>D.Clock] jump into clock module | |
228 | |
229 L00E8 comb | |
230 stb $02,x strobe one column | |
231 ldb ,x read PIA #0 row states | |
232 comb invert bits so 1=key pressed | |
233 andb #$03 mask out all but lower 2 bits | |
234 rts | |
235 | |
236 L00F1 | |
237 bsr L015C | |
238 bmi L00CC | |
239 clrb | |
240 bsr L00E8 | |
241 bne L00CC | |
242 cmpa <V.6F,u | |
243 bne L010E | |
244 ldb <V.ClkCnt,u | |
245 beq L010A | |
246 decb | |
247 L0105 stb <V.ClkCnt,u | |
248 * bra AltIRQEnd | |
249 bra CheckFlash | |
250 L010A ldb #$05 | |
251 bra L011A | |
252 L010E sta <V.6F,u | |
253 ldb #$05 | |
254 tst <V.KySame,u | |
255 bne L0105 | |
256 ldb #60 | |
257 L011A stb <V.ClkCnt,u | |
258 ldb V.IBufH,u get head pointer in B | |
259 leax V.InBuf,u point X to input buffer | |
260 abx X now holds address of head | |
261 lbsr L009D check for tail wrap | |
262 cmpb V.IBufT,u B at tail? | |
263 beq L012F branch if so | |
264 stb V.IBufH,u | |
265 L012F sta ,x store our char at ,X | |
266 beq WakeIt if nul, do wake-up | |
267 cmpa V.PCHR,u pause character? | |
268 bne L013F branch if not | |
269 ldx V.DEV2,u else get dev2 statics | |
270 beq WakeIt branch if none | |
271 sta V.PAUS,x else set pause request | |
272 bra WakeIt | |
273 L013F ldb #S$Intrpt get interrupt signal | |
274 cmpa V.INTR,u our char same as intr? | |
275 beq L014B branch if same | |
276 ldb #S$Abort get abort signal | |
277 cmpa V.QUIT,u our char same as QUIT? | |
278 bne WakeIt branch if not | |
279 L014B lda V.LPRC,u get ID of last process to get this device | |
280 bra L0153 go for it | |
281 WakeIt ldb #S$Wake get wake signal | |
282 lda V.WAKE,u get process to wake | |
283 L0153 beq L0158 branch if none | |
284 os9 F$Send else send wakeup signal | |
285 L0158 clr V.WAKE,u clear process to wake flag | |
286 bra AltIRQEnd and move along | |
287 | |
288 L015C clra | |
289 clrb | |
290 std <V.ShftDn,u SHIFT/CTRL flag; 0=NO $FF=YES | |
291 std <V.KeyFlg,u | |
292 * %00000111-Column # (Output, 0-7) | |
293 * %00111000-Row # (Input, 0-6) | |
294 coma | |
295 comb | |
296 std <V.Key1,u key 1&2 flags $FF=none | |
297 sta <V.Key3,u key 3 " | |
298 deca lda #%11111110 | |
299 sta $02,x write column strobe | |
300 L016F lda ,x read row from PIA0Base | |
301 | |
2040 | 302 ifne (tano+d64+dalpha) |
1933 | 303 lbsr DragonToCoCo ; Translate Dragon keyboard layout to CoCo |
304 endc | |
305 | |
306 coma invert so 1=key pressed | |
307 anda #$7F keep only keys, bit 0=off 1=on | |
308 beq L0183 no keys pressed, try next column | |
309 ldb #$FF preset counter to -1 | |
310 L0178 incb | |
311 lsra bit test regA | |
312 bcc L017F no key, brach | |
313 lbsr L0221 convert column/row to matrix value and store | |
314 L017F cmpb #$06 max counter | |
315 bcs L0178 loop if more bits to test | |
316 L0183 inc <V.KeyFlg,u counter; used here for column | |
317 orcc #Carry bit marker; disable strobe | |
318 rol $02,x shift to next column | |
319 bcs L016F not finished with columns so loop | |
320 lbsr L0289 simultaneous check; recover key matrix value | |
321 bmi L020A invalid so go | |
322 cmpa <V.LKeyCd,u last keyboard code | |
323 bne L0199 | |
324 inc <V.KySame,u same key flag ?counter? | |
325 L0199 sta <V.LKeyCd,u setup for last key pressed | |
326 beq L01B9 if @ key, use lookup table | |
327 suba #$1A the key value (matrix) of Z | |
328 bhi L01B9 not a letter, so go | |
329 adda #$1A restore regA | |
330 ldb <V.CtrlDn,u CTRL flag | |
331 bne L01E9 CTRL is down so go | |
332 adda #$40 convert to ASCII value; all caps | |
333 ldb <V.ShftDn,u shift key flag | |
334 eorb <V.Caps,u get current device static memory pointer | |
335 andb #$01 tet caps flag | |
336 bne L01E9 not shifted so go | |
337 adda #$20 convert to ASCII lowercase | |
338 bra L01E9 | |
339 * Not a letter key, use the special keycode lookup table | |
340 * Entry: A = table idnex (matrix scancode-26) | |
341 L01B9 ldb #$03 three entries per key (normal, SHIFT, CTRL) | |
342 mul convert index to table offset | |
343 lda <V.ShftDn,u shift key flag | |
344 beq L01C4 not shifted so go | |
345 incb else adjust offset for SHIFTed entry | |
346 bra L01CB and do it | |
347 L01C4 lda <V.CtrlDn,u CTRL flag? | |
348 beq L01CB adjust offset for CTRL key | |
349 addb #$02 | |
350 L01CB lda <V.KySnsF,u key sense flag? | |
351 beq L01D4 not set, so go | |
352 cmpb #$11 spacebar? | |
353 ble L0208 must be an arrow so go | |
354 L01D4 cmpb #$4C ALT key? (SHOULD BE $4C???) | |
355 blt L01DD not ALT, CTRL, F1, F2 or SHIFT so go | |
356 inc <V.AltDwn,u flag special keys (ALT, CTRL) | |
357 subb #$06 adjust offset to skip them | |
358 L01DD pshs x save X | |
359 | |
360 leax >KeyTbl,pcr point to keyboard table | |
361 lda b,x | |
362 puls x | |
363 bmi L01FD if A = $81 - $84, special key | |
364 * several entries to this routine from any key press; A is already ASCII | |
365 L01E9 ldb <V.AltDwn,u was ALT flagged? | |
366 beq L01FA no, so go | |
367 cmpa #$3F ? | |
368 bls L01F8 # or code | |
369 cmpa #$5B [ | |
370 bcc L01F8 capital letter so go | |
371 ora #$20 convert to lower case | |
372 L01F8 ora #$80 set for ALT characters | |
373 L01FA andcc #^Negative not negative | |
374 rts | |
375 * Flag that special key was hit | |
376 L01FD inc <V.Spcl,u | |
377 ldb <V.KySame,u | |
378 bne L0208 | |
379 com <V.Caps,u | |
380 L0208 orcc #Negative set negative | |
381 L020A rts | |
382 | |
383 * Calculate arrow keys for key sense byte | |
384 L020B pshs b,a convert column into power of 2 | |
385 clrb | |
386 orcc #Carry | |
387 inca | |
388 L0211 rolb | |
389 deca | |
390 bne L0211 | |
391 bra L0219 | |
392 L0217 pshs b,a | |
393 L0219 orb <V.KySns,u previous value of column | |
394 stb <V.KySns,u | |
395 puls pc,b,a | |
396 * Check special keys (SHIFT, CTRL, ALT) | |
397 L0221 pshs b,a | |
398 cmpb #$03 is it row 3? | |
399 bne L0230 | |
400 lda <V.KeyFlg,u get column # | |
401 cmpa #$03 is it column 3?; ie up arrow | |
402 blt L0230 if lt it must be a letter | |
403 bsr L020B its a non letter so bsr | |
404 L0230 lslb B*8 8 keys per row | |
405 lslb | |
406 lslb | |
407 addb <V.KeyFlg,u add in the column # | |
408 beq L025D | |
409 cmpb #$33 ALT | |
410 bne L0243 | |
411 inc <V.AltDwn,u ALT down flag | |
412 ldb #$04 | |
413 bra L0219 | |
414 L0243 cmpb #$31 CLEAR? | |
415 beq L024B | |
416 cmpb #$34 CTRL? | |
417 bne L0252 | |
418 L024B inc <V.CtrlDn,u CTRL down flag | |
419 ldb #$02 | |
420 bra L0219 | |
421 L0252 cmpb #$37 SHIFT key | |
422 bne L0262 | |
423 com <V.ShftDn,u SHIFT down flag | |
424 ldb #$01 | |
425 bra L0219 | |
426 L025D ldb #$04 | |
427 bsr L0217 | |
428 clrb | |
429 * Check how many key (1-3) are currently being pressed | |
430 L0262 pshs x | |
431 leax <V.Key1,u 1st key table | |
432 bsr L026D | |
433 puls x | |
434 puls pc,b,a | |
435 L026D pshs a | |
436 lda ,x | |
437 bpl L0279 | |
438 stb ,x | |
439 ldb #$01 | |
440 puls pc,a | |
441 L0279 lda $01,x | |
442 bpl L0283 | |
443 stb $01,x | |
444 ldb #$02 | |
445 puls pc,a | |
446 L0283 stb $02,x | |
447 ldb #$03 | |
448 puls pc,a | |
449 * simultaneous key test | |
450 L0289 pshs y,x,b | |
451 bsr L02EE | |
452 ldb <V.KTblLC,u key table entry # | |
453 beq L02C5 | |
454 leax <V.2Key1,u point to 2nd key table | |
455 pshs b | |
456 L0297 leay <V.Key1,u 1st key table | |
457 ldb #$03 | |
458 lda ,x get key #1 | |
459 bmi L02B6 go if invalid? (no key) | |
460 L02A0 cmpa ,y is it a match? | |
461 bne L02AA go if not a matched key | |
462 clr ,y | |
463 com ,y set value to $FF | |
464 bra L02B6 | |
465 L02AA leay $01,y | |
466 decb | |
467 bne L02A0 | |
468 lda #$FF | |
469 sta ,x | |
470 dec <V.KTblLC,u key table entry # | |
471 L02B6 leax $01,x | |
472 dec ,s column counter | |
473 bne L0297 | |
474 leas $01,s | |
475 ldb <V.KTblLC,u key table entry (can test for 3 simul keys) | |
476 beq L02C5 | |
477 bsr L0309 | |
478 L02C5 leax <V.Key1,u 1st key table | |
479 lda #$03 | |
480 L02CA ldb ,x+ | |
481 bpl L02DE | |
482 deca | |
483 bne L02CA | |
484 ldb <V.KTblLC,u key table entry (can test for 3 simul keys) | |
485 beq L02EA | |
486 decb | |
487 leax <V.2Key1,u 2nd key table | |
488 lda b,x | |
489 bra L02E8 | |
490 L02DE tfr b,a | |
491 leax <V.2Key1,u 2nd key table | |
492 bsr L026D | |
493 stb <V.KTblLC,u | |
494 L02E8 puls pc,y,x,b | |
495 L02EA orcc #Negative flag negative | |
496 puls pc,y,x,b | |
497 | |
498 L02EE ldd <V.ShftDn,u | |
499 bne L0301 | |
500 lda #$03 | |
501 leax <V.Key1,u | |
502 L02F8 ldb ,x | |
503 beq L0302 | |
504 leax $01,x | |
505 deca | |
506 bne L02F8 | |
507 L0301 rts | |
508 L0302 comb | |
509 stb ,x | |
510 inc <V.AltDwn,u | |
511 rts | |
512 | |
513 * Sort 3 byte packet @ G.2Key1 according to sign of each byte | |
514 * so that positive #'s are at beginning & negative #'s at end | |
515 L0309 leax <V.2Key1,u 2nd key table | |
516 bsr L0314 sort bytes 1 & 2 | |
517 leax $01,x | |
518 bsr L0314 sort bytes 2 & 3 | |
519 leax -$01,x sort 1 & 2 again (fall thru for third pass) | |
520 L0314 lda ,x get current byte | |
521 bpl L0320 positive - no swap | |
522 ldb $01,x get next byte | |
523 bmi L0320 negative - no swap | |
524 sta $01,x swap the bytes | |
525 stb ,x | |
526 L0320 rts | |
527 | |
528 ; | |
529 ; Convert Dragon Keyboard mapping to CoCo. | |
530 ; | |
531 ; Entry a=Dragon formatted keyboard input from PIA | |
532 ; Exit a=CoCo formatted keyboard input from PIA | |
533 ; | |
534 | |
2040 | 535 ifne (tano+d64+dalpha) |
1933 | 536 DragonToCoCo |
537 pshs b | |
538 sta ,-s ; Save on stack | |
539 tfr a,b ; Take a copy of keycode | |
540 anda #%01000000 ; Top row same on both machines | |
541 andb #%00000011 ; shift bottom 2 rows up 4 places | |
542 lslb | |
543 lslb | |
544 lslb | |
545 lslb | |
546 pshs b | |
547 ora ,s+ ; recombine rows | |
548 puls b | |
549 andb #%00111100 ; Shift middle 4 rows down 2 places | |
550 lsrb | |
551 lsrb | |
552 pshs b | |
553 ora ,s+ ; recombine rows | |
554 puls b | |
555 rts | |
556 | |
557 endc | |
558 | |
559 * Key Table | |
560 * 1st column = key (no modifier) | |
561 * 2nd column = SHIFT+key | |
562 * 3rd column = CTRL+key | |
563 KeyTbl fcb $00,$40,$60 ALT @ ` | |
564 fcb $0c,$1c,$13 UP | |
565 fcb $0a,$1a,$12 DOWN | |
566 fcb $08,$18,$10 LEFT | |
567 fcb $09,$19,$11 RIGHT | |
568 fcb $20,$20,$20 SPACEBAR | |
569 fcb $30,$30,$81 0 0 capslock | |
570 fcb $31,$21,$7c 1 ! | | |
571 fcb $32,$22,$00 2 " null | |
572 fcb $33,$23,$7e 3 # ~ | |
573 fcb $34,$24,$1d 4 $ RS (was null) | |
574 fcb $35,$25,$1e 5 % GS (was null) | |
575 fcb $36,$26,$1f 6 & US (was null) | |
576 fcb $37,$27,$5e 7 ' ^ | |
577 fcb $38,$28,$5b 8 ( [ | |
578 fcb $39,$29,$5d 9 ) ] | |
579 fcb $3a,$2a,$00 : * null | |
580 fcb $3b,$2b,$7f ; + del (was null) | |
581 fcb $2c,$3c,$7b , < { | |
582 fcb $2d,$3d,$5f - = _ | |
583 fcb $2e,$3e,$7d . > } | |
584 fcb $2f,$3f,$5c / ? \ | |
585 fcb $0d,$0d,$0d ENTER key | |
586 fcb $00,$00,$00 CLEAR key | |
587 fcb $05,$03,$1b BREAK key | |
588 fcb $31,$33,$35 F1 key | |
589 fcb $32,$34,$36 F2 key | |
590 | |
591 | |
592 * Write | |
593 * | |
594 * Entry: | |
595 * A = character to write | |
596 * Y = address of path descriptor | |
597 * U = address of device memory area | |
598 * | |
599 * Exit: | |
600 * CC = carry set on error | |
601 * B = error code | |
602 * | |
603 Write ldb <V.NGChr,u are we in the process of getting parameters? | |
604 bne PrmHandl yes, go process | |
605 sta <V.WrChr,u save character to write | |
606 cmpa #C$SPAC space or higher? | |
607 bcc GoCo yes, normal write | |
608 cmpa #$1E escape sequence $1E or $1F? | |
609 bcc Escape yes, go process | |
610 cmpa #$0F GFX codes? | |
611 lbcc GfxDispatch branch if so | |
612 cmpa #C$BELL bell? | |
613 lbeq Ding if so, ring bell | |
614 * Here we call the CO-module to write the character | |
615 GoCo lda <V.CurCo,u get CoVDG/CoWP flag | |
616 CoWrite ldb #$03 we want to write | |
617 | |
618 CallCO leax <V.GrfDrvE,u get base pointer to CO-entries | |
619 pshs a | |
620 lbsr GetModOffset ; Get offset | |
621 ldx a,x get pointer to CoVDG/CoWP | |
622 puls a | |
623 beq NoIOMod branch if no module | |
624 lda <V.WrChr,u get character to write | |
625 L039D jmp b,x call i/o subroutine | |
626 NoIOMod comb | |
627 ldb #E$MNF | |
628 rts | |
629 | |
630 * Parameter handler | |
631 PrmHandl cmpb #$02 two parameters left? | |
632 beq L03B0 branch if so | |
633 sta <V.NChr2,u else store in V.NChr2 | |
634 clr <V.NGChr,u clear parameter counter | |
635 jmp [<V.RTAdd,u] jump to return address | |
636 L03B0 sta <V.NChar,u store in V.NChar | |
637 dec <V.NGChr,u decrement parameter counter | |
638 clrb | |
639 rts | |
640 | |
641 Escape beq L03C5 if $1E, we conveniently ignore it | |
642 leax <COEscape,pcr else it's $1F... set up to get next char | |
643 L03BD ldb #$01 | |
644 L03BF stx <V.RTAdd,u | |
645 stb <V.NGChr,u | |
646 L03C5 clrb | |
647 rts | |
648 | |
649 COEscape ldb #$03 write offset into CO-module | |
650 lbra JmpCO | |
651 | |
652 * Show VDG or Graphics screen | |
653 * Entry: B = 0 for VDG, 1 for Graphics | |
654 SetDsply pshs x,a | |
655 stb <V.Alpha,u save passed flag in B | |
656 lda >PIA1Base+2 | |
657 anda #$07 mask out all but lower 3 bits | |
658 ora ,s+ OR in passed A | |
659 tstb display graphics? | |
660 bne L03DE branch if so | |
661 ora <V.CFlag,u | |
662 L03DE sta >PIA1Base+2 | |
663 sta <V.PIA1,u | |
664 tstb display graphics? | |
665 bne DoGfx branch if so | |
666 * Set up VDG screen for text | |
667 DoVDG | |
668 stb >$FFC0 | |
669 stb >$FFC2 | |
670 stb >$FFC4 | |
671 lda <V.ScrnA,u get pointer to alpha screen | |
672 bra L0401 | |
673 | |
674 * Set up VDG screen for graphics | |
675 DoGfx stb >$FFC0 | |
676 stb >$FFC3 | |
677 stb >$FFC5 | |
678 lda <V.SBAdd,u get pointer to graphics screen | |
679 | |
680 L0401 ldb #$07 | |
681 ldx #$FFC6 | |
682 lsra | |
683 L0407 lsra | |
684 bcs L0410 | |
685 sta ,x+ | |
686 leax $01,x | |
687 bra L0414 | |
688 L0410 leax $01,x | |
689 sta ,x+ | |
690 L0414 decb | |
691 bne L0407 | |
692 clrb | |
693 puls pc,x | |
694 | |
695 GrfDrv fcs /GrfDrv/ | |
696 CoVDG fcs /CoVDG/ | |
697 CoWP fcs /CoWP/ | |
698 CoHR fcs /CoHR/ | |
699 | |
700 * GetStat | |
701 * | |
702 * Entry: | |
703 * A = function code | |
704 * Y = address of path descriptor | |
705 * U = address of device memory area | |
706 * | |
707 * Exit: | |
708 * CC = carry set on error | |
709 * B = error code | |
710 * | |
711 GetStat sta <V.WrChr,u save off stat code | |
712 cmpa #SS.Ready ready call? | |
713 bne L0439 branch if not | |
714 lda V.IBufT,u get buff tail ptr | |
715 suba V.IBufH,u num of chars ready in A | |
716 lbeq NotReady branch if empty | |
717 SSEOF clrb | |
718 rts | |
719 L0439 cmpa #SS.EOF EOF? | |
720 beq SSEOF branch if so | |
721 ldx PD.RGS,y get caller's regs | |
722 cmpa #SS.Joy joystick? | |
723 beq SSJOY branch if so | |
724 cmpa #SS.ScSiz screen size? | |
725 beq SSSCSIZ branch if so | |
726 cmpa #SS.KySns keyboard sense? | |
727 beq SSKYSNS branch if so | |
728 cmpa #SS.DStat display status? | |
729 lbeq SSDSTAT branch if so | |
730 ldb #$06 getstat entry into CO-module | |
731 lbra JmpCO | |
732 | |
733 * Return key sense information | |
734 SSKYSNS ldb <V.KySns,u get key sense info | |
735 stb R$A,x put in caller's A | |
736 clrb | |
737 rts | |
738 | |
739 * Return screen size | |
740 SSSCSIZ clra clear upper 8 bits of D | |
741 ldb <V.Col,u get column count | |
742 std R$X,x save in X | |
743 ldb <V.Row,u get row count | |
744 std R$Y,x save in Y | |
745 clrb no error | |
746 rts | |
747 | |
748 * Get joytsick values | |
749 SSJOY pshs y,cc | |
750 orcc #IRQMask mask interrupts | |
751 lda #$FF | |
752 sta >PIA0Base+2 | |
753 ldb >PIA0Base | |
754 ldy R$X,x get joystick number to poll | |
755 bne L0481 | |
756 andb #$01 | |
757 bne L0485 | |
758 bra L0486 | |
759 L0481 andb #$02 | |
760 beq L0486 | |
761 L0485 clra | |
762 L0486 sta R$A,x | |
763 lda >PIA0Base+3 | |
764 ora #$08 | |
765 ldy R$X,x | |
766 bne L0494 | |
767 anda #$F7 | |
768 L0494 sta >PIA0Base+3 | |
769 lda >PIA0Base+1 | |
770 anda #$F7 | |
771 bsr L04B3 | |
772 std R$X,x | |
773 lda >PIA0Base+1 | |
774 ora #$08 | |
775 bsr L04B3 | |
776 pshs b,a | |
777 ldd #63 | |
778 subd ,s++ | |
779 std R$Y,x | |
780 clrb | |
781 puls pc,y,cc | |
782 | |
783 L04B3 sta >PIA0Base+1 | |
784 lda #$7F | |
785 ldb #$40 | |
786 bra L04C7 | |
787 L04BC lsrb | |
788 cmpb #$01 | |
789 bhi L04C7 | |
790 lsra | |
791 lsra | |
792 tfr a,b | |
793 clra | |
794 rts | |
795 L04C7 pshs b | |
796 sta >PIA1Base | |
797 tst >PIA0Base | |
798 bpl L04D5 | |
799 adda ,s+ | |
800 bra L04BC | |
801 L04D5 suba ,s+ | |
802 bra L04BC | |
803 | |
804 * Return display status | |
805 * Entry: A = path | |
806 * Exit: A = color code of pixel at cursor address | |
807 * X = address of graphics display memory | |
808 * Y = graphics cursor address; X = MSB, Y = LSB | |
809 SSDSTAT lbsr GfxActv gfx screen allocated? | |
810 bcs L050E branch if not | |
811 ldd <V.GCrsX,u else get X/Y gfx cursor position | |
812 bsr XY2Addr | |
813 tfr a,b | |
814 andb ,x | |
815 L04E7 bita #$01 | |
816 bne L04F6 | |
817 lsra divide D by 2 | |
818 lsrb | |
819 tst <V.Mode,u which mode? | |
820 bmi L04E7 branch if 256x192 | |
821 lsra else divide D by 2 again | |
822 lsrb | |
823 bra L04E7 | |
824 L04F6 pshs b | |
825 ldb <V.PMask,u get pixel color mask in B | |
826 andb #$FC | |
827 orb ,s+ | |
828 ldx PD.RGS,y get caller's regs | |
829 stb R$A,x place pixel color in A | |
830 ldd <V.GCrsX,u | |
831 std R$Y,x cursor X/Y pos in Y, | |
832 ldd <V.SBAdd,u | |
833 std R$X,x and screen addr in X | |
834 clrb | |
835 L050E rts | |
836 | |
837 * Entry: A = X coor, B = Y coor | |
838 XY2Addr pshs y,b,a save off regs | |
839 ldb <V.Mode,u get video mode | |
840 bpl L0517 branch if 128x192 (divide A by 4) | |
841 lsra else divide by 8 | |
842 L0517 lsra | |
843 lsra | |
844 pshs a save on stack | |
845 ldb #191 get max Y | |
846 subb $02,s sutract from Y on stack | |
847 lda #32 byte sper line | |
848 mul | |
849 addb ,s+ add offset on stack | |
850 adca #$00 | |
851 ldy <V.SBAdd,u get base address | |
852 leay d,y move D bytes into address | |
853 lda ,s pick up original X coor | |
854 sty ,s put offset addr on stack | |
855 anda <V.PixBt,u | |
856 ldx <V.MTabl,u | |
857 lda a,x | |
858 puls pc,y,x X = offset address, Y = base | |
859 | |
860 * SetStat | |
861 * | |
862 * Entry: | |
863 * A = function code | |
864 * Y = address of path descriptor | |
865 * U = address of device memory area | |
866 * | |
867 * Exit: | |
868 * CC = carry set on error | |
869 * B = error code | |
870 * | |
871 SetStat sta <V.WrChr,u save function code | |
872 ldx PD.RGS,y get caller's regs | |
873 cmpa #SS.ComSt | |
874 lbeq SSCOMST | |
875 cmpa #SS.AAGBf | |
876 beq SSAAGBF | |
877 cmpa #SS.SLGBf | |
878 beq SSSLGBF | |
879 cmpa #SS.KySns | |
880 bne CoGetStt | |
881 ldd R$X,x get caller's key sense set data | |
882 beq L0558 branch if zero | |
883 ldb #$FF else set all bits | |
884 L0558 stb <V.KySnsF,u store value in KySnsFlag | |
885 L055B clrb | |
886 L055C rts | |
887 | |
888 CoGetStt ldb #$09 CO-module setstat | |
889 JmpCO pshs b | |
890 lda <V.CurCo,u get CO-module in use | |
891 lbsr CallCO | |
892 puls a | |
893 bcc L055B | |
894 tst <V.GrfDrvE,u GrfDrv linked? | |
895 beq L055C | |
896 tfr a,b | |
897 clra GrfDrv address offset in statics | |
898 lbra CallCO call it | |
899 | |
900 * Reserve an additional graphics buffer (up to 2) | |
901 SSAAGBF ldb <V.Rdy,u was initial buffer allocated with $0F? | |
902 lbeq NotReady branch if not | |
903 pshs b save buffer number | |
904 leay <V.AGBuf,u point to additional graphics buffers | |
905 ldd ,y first entry empty? | |
906 beq L058E branch if so | |
907 leay $02,y else move to next entry | |
908 inc ,s increment B on stack | |
909 ldd ,y second entry empty? | |
910 bne L059E if not, no room for more... error out | |
911 L058E lbsr GetMem allocate graphics buffer memory | |
912 bcs L05A1 branch if error | |
913 std ,y save new buffer pointer at ,Y | |
914 std R$X,x and in caller's X | |
915 puls b get buffer number off stack | |
916 clra clear hi byte of D | |
917 std R$Y,x and put in caller's Y (buffer number) | |
918 clrb call is ok | |
919 rts and return | |
920 L059E ldb #E$BMode | |
921 coma | |
922 L05A1 puls pc,a | |
923 | |
924 * Select a graphics buffer | |
925 SSSLGBF ldb <V.Rdy,u was initial buffer allocated with $0F? | |
926 lbeq NotReady branch if not | |
927 ldd R$Y,x else get buffer number from caller | |
928 cmpd #$0002 compare against high | |
929 bhi BadMode branch if error | |
930 leay <V.GBuff,u point to base graphics buffer address | |
931 lslb multiply by 2 | |
932 ldd b,y get pointer | |
933 beq BadMode branch if error | |
934 std <V.SBAdd,u else save in current | |
935 ldd R$X,x get select flag | |
936 beq L05C3 if zero, do nothing | |
937 ldb #$01 else set display flag | |
938 L05C3 stb <V.CFlg1,u save display flag | |
939 clrb | |
940 rts | |
941 BadMode comb | |
942 ldb #E$BMode | |
943 rts | |
944 | |
945 SSCOMST ldd R$Y,x Get caller's Y | |
946 SetupTerm | |
947 bita #ModCoVDG CoWP? | |
948 beq GoCoWP branch if so | |
949 ldb #$10 assume true lower case TRUE | |
950 bita #$01 true lowercase bit set? | |
951 bne GoCoVDG branch if so | |
952 clrb true lower case FALSE | |
953 | |
954 GoCoVDG stb <V.CFlag,u save flag for later | |
955 lda #ModCoVDG CoVDG is loaded bit | |
956 ldx #$2010 32x16 | |
957 pshs u,y,x,a | |
958 leax >CoVDG,pcr | |
959 bra SetupCoModule | |
960 | |
961 GoCoWP bita #ModCoWP ; CoWP needed ? | |
962 beq GoCoHR | |
963 lda #ModCoWP 'CoWP is loaded' bit | |
964 ldx #$5018 80x24 | |
965 pshs u,y,x,a | |
966 leax >CoWP,pcr | |
967 | |
968 SetupCoModule | |
969 bsr LoadCoModule load CO-module if not already loaded | |
970 puls u,y,x,a | |
971 bcs L0600 | |
972 stx <V.Col,u save screen size | |
973 sta <V.CurCo,u current module in use? ($02=CoVDG, $04=C080) | |
974 L0600 rts | |
975 | |
976 GOCoHR ldx #$3318 51x24 | |
977 pshs u,y,x,a | |
978 leax >CoHR,pcr | |
979 bra SetupCoModule | |
980 | |
981 LoadCoModule | |
982 bita <V.COLoad,u module loaded? | |
983 beq L0608 branch if not | |
984 L0606 clrb else clear carry | |
985 rts and return | |
986 | |
987 L0608 pshs y,x,a | |
988 lbsr LinkSub | |
989 bcc L061F branch if link was successful | |
990 ldx $01,s get pointer to name on stack | |
991 pshs u | |
992 os9 F$Load try to load subroutine I/O module | |
993 puls u | |
994 bcc L061F | |
995 puls y,x,a | |
996 lbra NoIOMod | |
997 L061F leax <V.GrfDrvE,u get base pointer to CO-entries | |
998 lda ,s | |
999 bsr GetModOffset ; Get offset in table | |
1000 sty a,x ; Save address | |
1001 | |
1002 puls y,x,a | |
1003 ldb #$00 CO-module init offset | |
1004 lbra CallCO call it | |
1005 | |
1006 ; | |
1007 ; Get module offset from V.GrfDrvE into A reg. | |
1008 ; I had to do this because the previous system would only work | |
1009 ; properly for 2 entries ! | |
1010 ; | |
1011 | |
1012 GetModOffset | |
1013 pshs b | |
1014 clrb ; Calculate address offset | |
1015 AddrFind | |
1016 bita #$01 ; Done all shifts ? | |
1017 bne AddrDone | |
1018 addb #$2 ; increment addr offset ptr | |
1019 lsra | |
1020 bra AddrFind ; Test again | |
1021 AddrDone | |
1022 tfr b,a ; output in a | |
1023 puls b,pc | |
1024 | |
1025 * Link to subroutine | |
1026 LinkSub pshs u | |
1027 lda #Systm+Objct | |
1028 os9 F$Link | |
1029 puls pc,u | |
1030 | |
1031 * 128x192 4 color pixel table | |
1032 Mode1Clr fdb $0055,$aaff | |
1033 | |
1034 GfxDispatch | |
1035 cmpa #$15 GrfDrv-handled code? | |
1036 bcc GoGrfo branch if so | |
1037 cmpa #$0F display graphics code? | |
1038 beq Do0F branch if so | |
1039 suba #$10 | |
1040 bsr GfxActv check if first gfx screen was alloc'ed | |
1041 bcs L0663 if not, return with error | |
1042 leax <gfxtbl,pcr else point to jump table | |
1043 lsla multiply by two | |
1044 ldd a,x get address of routine | |
1045 jmp d,x jump to it | |
1046 | |
1047 * Jump table for graphics codes $10-$14 | |
1048 gfxtbl fdb Do10-gfxtbl $10 - Preset Screen | |
1049 fdb Do11-gfxtbl $11 - Set Color | |
1050 fdb Do12-gfxtbl $12 - End Graphics | |
1051 fdb Do13-gfxtbl $13 - Erase Graphics | |
1052 fdb Do14-gfxtbl $14 - Home Graphics Cursor | |
1053 | |
1054 GfxActv ldb <V.Rdy,u gfx screen allocated? | |
1055 bne L0606 branch if so | |
1056 NotReady comb | |
1057 ldb #E$NotRdy | |
1058 L0663 rts | |
1059 | |
1060 GoGrfo bsr GfxActv | |
1061 bcs L0663 | |
1062 ldx <V.GrfDrvE,u get GrfDrv entry point | |
1063 bne L0681 branch if not zero | |
1064 pshs y,a else preserve regs | |
1065 bne L067F | |
1066 leax >GrfDrv,pcr get pointer to name string | |
1067 bsr LinkSub link to GrfDrv | |
1068 bcc L067B branch if ok | |
1069 puls pc,y,a else exit with error | |
1070 L067B sty <V.GrfDrvE,u save module entry pointer | |
1071 L067F puls y,a restore regs | |
1072 L0681 clra A = GrfDrv address offset in statics | |
1073 lbra CoWrite | |
1074 | |
1075 * Allocate GFX mem -- we must allocate on a 512 byte page boundary | |
1076 GetMem pshs u save static pointer | |
1077 ldd #6144+256 allocate graphics memory + 1 page | |
1078 os9 F$SRqMem do it | |
1079 bcc L0691 branch if ok | |
1080 puls pc,u else return with error | |
1081 L0691 tfr u,d move mem ptr to D | |
1082 puls u restore statics | |
1083 tfr a,b move high 8 bits to lower | |
1084 bita #$01 odd page? | |
1085 beq L069F branch if not | |
1086 adda #$01 | |
1087 bra L06A1 | |
1088 L069F addb #$18 | |
1089 L06A1 pshs u,a | |
1090 tfr b,a | |
1091 clrb | |
1092 tfr d,u | |
1093 ldd #256 | |
1094 os9 F$SRtMem return page | |
1095 puls u,a | |
1096 bcs L06B3 branch if error | |
1097 clrb | |
1098 L06B3 rts | |
1099 | |
1100 * $0F - display graphics | |
1101 Do0F leax <DispGfx,pcr | |
1102 ldb #$02 | |
1103 lbra L03BF | |
1104 | |
1105 DispGfx ldb <V.Rdy,u already allocated initial buffer? | |
1106 bne L06D1 branch if so | |
1107 bsr GetMem else get graphics memory | |
1108 bcs L06EF branch if error | |
1109 std <V.SBAdd,u save memory | |
1110 std <V.GBuff,u and GBuff | |
1111 inc <V.Rdy,u ok, we're ready | |
1112 lbsr EraseGfx clear gfx mem | |
1113 L06D1 lda <V.NChr2,u get character after next | |
1114 sta <V.PMask,u save color set (0-3) | |
1115 anda #$03 mask out all but lower 2 bits | |
1116 leax >Mode1Clr,pcr point to mask byte table | |
1117 lda a,x get byte | |
1118 sta <V.Msk1,u save mask byte here | |
1119 sta <V.Msk2,u and here | |
1120 lda <V.NChar,u get next char, mode byte (0-1) | |
1121 cmpa #$01 compare against max | |
1122 bls L06F0 branch if valid | |
1123 comb | |
1124 ldb #E$BMode else invalid mode specified, send error | |
1125 L06EF rts | |
1126 | |
1127 L06F0 tsta test user supplied mode byte | |
1128 beq L0710 branch if 256x192 | |
1129 ldd #$C003 | |
1130 std <V.MCol,u | |
1131 lda #$01 | |
1132 sta <V.Mode,u 128x192 mode | |
1133 lda #$E0 | |
1134 ldb <V.NChr2,u | |
1135 andb #$08 | |
1136 beq L0709 | |
1137 lda #$F0 | |
1138 L0709 ldb #$03 | |
1139 leax <L0742,pcr | |
1140 bra L072D | |
1141 L0710 ldd #$8001 | |
1142 std <V.MCol,u | |
1143 lda #$FF | |
1144 tst <V.Msk1,u | |
1145 beq L0723 | |
1146 sta <V.Msk1,u | |
1147 sta <V.Msk2,u | |
1148 L0723 sta <V.Mode,u 256x192 mode | |
1149 lda #$F0 | |
1150 ldb #$07 | |
1151 leax <L0746,pcr | |
1152 L072D stb <V.PixBt,u | |
1153 stx <V.MTabl,u | |
1154 ldb <V.NChr2,u | |
1155 andb #$04 | |
1156 lslb | |
1157 pshs b | |
1158 ora ,s+ | |
1159 ldb #$01 | |
1160 * Indicate screen is current | |
1161 lbra SetDsply | |
1162 | |
1163 L0742 fcb $c0,$30,$0c,$03 | |
1164 L0746 fcb $80,$40,$20,$10,$08,$04,$02,$01 | |
1165 | |
1166 * $11 - set color | |
1167 Do11 leax <SetColor,pcr set up return address | |
1168 lbra L03BD | |
1169 | |
1170 SetColor clr <V.NChar,u get next char | |
1171 lda <V.Mode,u which mode? | |
1172 bmi L075F branch if 256x192 | |
1173 inc <V.NChar,u | |
1174 L075F lbra L06D1 | |
1175 | |
1176 * $12 - end graphics | |
1177 Do12 leax <V.GBuff,u point to first buffer | |
1178 ldy #$0000 Y = 0 | |
1179 ldb #$03 free 3 gfx screens max | |
1180 pshs u,b | |
1181 L076D ldd #6144 size of graphics screen | |
1182 ldu ,x++ get address of graphics screen | |
1183 beq L077A branch if zero | |
1184 sty -$02,x else clear entry | |
1185 os9 F$SRtMem and return memory | |
1186 L077A dec ,s decrement counter | |
1187 bgt L076D keep going if not end | |
1188 ldu ,x flood fill buffer? | |
1189 beq L0788 branch if not allocated | |
1190 ldd #512 else get size | |
1191 os9 F$SRtMem and free memory | |
1192 L0788 puls u,b restore regs | |
1193 clra | |
1194 sta <V.Rdy,u gfx mem no longer alloced | |
1195 lbra SetDsply | |
1196 | |
1197 Do10 leax <Preset,pcr set up return address | |
1198 lbra L03BD | |
1199 | |
1200 * NOTE! Shouldn't this be lda <V.NChar,u ?? | |
1201 Preset lda <V.NChr2,u get next char | |
1202 tst <V.Mode,u which mode? | |
1203 bpl L07A7 branch if 128x192 4 color | |
1204 ldb #$FF assume we will clear with $FF | |
1205 anda #$01 mask out all but 1 bit (2 colors) | |
1206 beq EraseGfx erase graphic screen with color $00 | |
1207 bra L07B2 else erase screen with color $FF | |
1208 L07A7 anda #$03 mask out all but 2 bits (4 colors) | |
1209 leax >Mode1Clr,pcr point to color table | |
1210 ldb a,x get appropriate byte | |
1211 bra L07B2 and start the clearing | |
1212 | |
1213 * Erase graphics screen | |
1214 Do13 | |
1215 EraseGfx clrb value to clear screen with | |
1216 L07B2 ldx <V.SBAdd,u | |
1217 leax >6144+1,x point to end of gfx mem + 1 | |
1218 L07B9 stb ,-x clear | |
1219 cmpx <V.SBAdd,u X = to start? | |
1220 bhi L07B9 if not, continue | |
1221 * Home Graphics cursor | |
1222 Do14 clra | |
1223 clrb | |
1224 std <V.GCrsX,u | |
1225 rts | |
1226 | |
1227 * | |
1228 * Ding - tickle CoCo's PIA to emit a sound | |
1229 * | |
1230 Ding pshs b,a | |
1231 lda >PIA0Base+1 | |
1232 ldb >PIA0Base+3 | |
1233 pshs b,a | |
1234 anda #$F7 | |
1235 andb #$F7 | |
1236 sta >PIA0Base+1 | |
1237 stb >PIA0Base+3 | |
1238 lda >PIA1Base+3 | |
1239 pshs a | |
1240 ora #$08 | |
1241 sta >PIA1Base+3 | |
1242 ldb #$0A | |
1243 L07E6 lda #$FE | |
1244 bsr DingDuration | |
1245 lda #$02 | |
1246 bsr DingDuration | |
1247 decb | |
1248 bne L07E6 | |
1249 puls a | |
1250 sta >PIA1Base+3 | |
1251 puls b,a | |
1252 sta >PIA0Base+1 | |
1253 stb >PIA0Base+3 | |
1254 puls pc,b,a | |
1255 | |
1256 DingDuration | |
1257 sta >PIA1Base | |
1258 lda #128 | |
1259 L0805 inca | |
1260 bne L0805 | |
1261 rts | |
1262 | |
1263 * Dummy flash cursor routine, can be replaced by COxx module. | |
1264 | |
1265 FlashCursor | |
1266 rts | |
1267 | |
1268 emod | |
1269 eom equ * | |
1270 end |