Mercurial > hg > Members > kono > nitros9-code
annotate level1/modules/vtio.asm @ 3109:118cd9951d24
Small fixups in level 3 boot script
And add it and the boot list to the coco3 build.
author | Tormod Volden <debian.tormod@gmail.com> |
---|---|
date | Sun, 28 Feb 2016 22:48:32 +0100 |
parents | e84a638d1c16 |
children | adcbab1e0f36 8f5a6fe2d09e |
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 | |
2828 | 96 IFEQ coco2b+deluxe-1 |
2695
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 | |
2966
e84a638d1c16
cohr: Support both COVDG control codes and COHR Esc codes
Ken H. <dragon.atv@gmail.com>
parents:
2828
diff
changeset
|
606 ldb V.51EscSeq,u * in Escape sequence? |
e84a638d1c16
cohr: Support both COVDG control codes and COHR Esc codes
Ken H. <dragon.atv@gmail.com>
parents:
2828
diff
changeset
|
607 bne GoCo * yes, send to COHR |
1933 | 608 cmpa #C$SPAC space or higher? |
609 bcc GoCo yes, normal write | |
2966
e84a638d1c16
cohr: Support both COVDG control codes and COHR Esc codes
Ken H. <dragon.atv@gmail.com>
parents:
2828
diff
changeset
|
610 cmpa #$1B * COHR Escape Code? |
e84a638d1c16
cohr: Support both COVDG control codes and COHR Esc codes
Ken H. <dragon.atv@gmail.com>
parents:
2828
diff
changeset
|
611 beq GoCo |
1933 | 612 cmpa #$1E escape sequence $1E or $1F? |
613 bcc Escape yes, go process | |
614 cmpa #$0F GFX codes? | |
615 lbcc GfxDispatch branch if so | |
616 cmpa #C$BELL bell? | |
617 lbeq Ding if so, ring bell | |
618 * Here we call the CO-module to write the character | |
619 GoCo lda <V.CurCo,u get CoVDG/CoWP flag | |
620 CoWrite ldb #$03 we want to write | |
621 | |
622 CallCO leax <V.GrfDrvE,u get base pointer to CO-entries | |
623 pshs a | |
624 lbsr GetModOffset ; Get offset | |
625 ldx a,x get pointer to CoVDG/CoWP | |
626 puls a | |
627 beq NoIOMod branch if no module | |
628 lda <V.WrChr,u get character to write | |
629 L039D jmp b,x call i/o subroutine | |
630 NoIOMod comb | |
631 ldb #E$MNF | |
632 rts | |
633 | |
634 * Parameter handler | |
635 PrmHandl cmpb #$02 two parameters left? | |
636 beq L03B0 branch if so | |
637 sta <V.NChr2,u else store in V.NChr2 | |
638 clr <V.NGChr,u clear parameter counter | |
639 jmp [<V.RTAdd,u] jump to return address | |
640 L03B0 sta <V.NChar,u store in V.NChar | |
641 dec <V.NGChr,u decrement parameter counter | |
642 clrb | |
643 rts | |
644 | |
645 Escape beq L03C5 if $1E, we conveniently ignore it | |
646 leax <COEscape,pcr else it's $1F... set up to get next char | |
647 L03BD ldb #$01 | |
648 L03BF stx <V.RTAdd,u | |
649 stb <V.NGChr,u | |
650 L03C5 clrb | |
651 rts | |
652 | |
653 COEscape ldb #$03 write offset into CO-module | |
654 lbra JmpCO | |
655 | |
656 * Show VDG or Graphics screen | |
657 * Entry: B = 0 for VDG, 1 for Graphics | |
658 SetDsply pshs x,a | |
659 stb <V.Alpha,u save passed flag in B | |
660 lda >PIA1Base+2 | |
661 anda #$07 mask out all but lower 3 bits | |
662 ora ,s+ OR in passed A | |
663 tstb display graphics? | |
664 bne L03DE branch if so | |
665 ora <V.CFlag,u | |
666 L03DE sta >PIA1Base+2 | |
667 sta <V.PIA1,u | |
668 tstb display graphics? | |
669 bne DoGfx branch if so | |
670 * Set up VDG screen for text | |
671 DoVDG | |
672 stb >$FFC0 | |
673 stb >$FFC2 | |
674 stb >$FFC4 | |
675 lda <V.ScrnA,u get pointer to alpha screen | |
676 bra L0401 | |
677 | |
678 * Set up VDG screen for graphics | |
679 DoGfx stb >$FFC0 | |
680 stb >$FFC3 | |
681 stb >$FFC5 | |
682 lda <V.SBAdd,u get pointer to graphics screen | |
683 | |
684 L0401 ldb #$07 | |
685 ldx #$FFC6 | |
686 lsra | |
687 L0407 lsra | |
688 bcs L0410 | |
689 sta ,x+ | |
690 leax $01,x | |
691 bra L0414 | |
692 L0410 leax $01,x | |
693 sta ,x+ | |
694 L0414 decb | |
695 bne L0407 | |
696 clrb | |
697 puls pc,x | |
698 | |
699 GrfDrv fcs /GrfDrv/ | |
700 CoVDG fcs /CoVDG/ | |
701 CoWP fcs /CoWP/ | |
702 CoHR fcs /CoHR/ | |
703 | |
704 * GetStat | |
705 * | |
706 * Entry: | |
707 * A = function code | |
708 * Y = address of path descriptor | |
709 * U = address of device memory area | |
710 * | |
711 * Exit: | |
712 * CC = carry set on error | |
713 * B = error code | |
714 * | |
715 GetStat sta <V.WrChr,u save off stat code | |
716 cmpa #SS.Ready ready call? | |
717 bne L0439 branch if not | |
718 lda V.IBufT,u get buff tail ptr | |
719 suba V.IBufH,u num of chars ready in A | |
720 lbeq NotReady branch if empty | |
721 SSEOF clrb | |
722 rts | |
723 L0439 cmpa #SS.EOF EOF? | |
724 beq SSEOF branch if so | |
725 ldx PD.RGS,y get caller's regs | |
726 cmpa #SS.Joy joystick? | |
727 beq SSJOY branch if so | |
728 cmpa #SS.ScSiz screen size? | |
729 beq SSSCSIZ branch if so | |
730 cmpa #SS.KySns keyboard sense? | |
731 beq SSKYSNS branch if so | |
732 cmpa #SS.DStat display status? | |
733 lbeq SSDSTAT branch if so | |
734 ldb #$06 getstat entry into CO-module | |
735 lbra JmpCO | |
736 | |
737 * Return key sense information | |
738 SSKYSNS ldb <V.KySns,u get key sense info | |
739 stb R$A,x put in caller's A | |
740 clrb | |
741 rts | |
742 | |
743 * Return screen size | |
744 SSSCSIZ clra clear upper 8 bits of D | |
745 ldb <V.Col,u get column count | |
746 std R$X,x save in X | |
747 ldb <V.Row,u get row count | |
748 std R$Y,x save in Y | |
749 clrb no error | |
750 rts | |
751 | |
752 * Get joytsick values | |
753 SSJOY pshs y,cc | |
754 orcc #IRQMask mask interrupts | |
755 lda #$FF | |
756 sta >PIA0Base+2 | |
757 ldb >PIA0Base | |
758 ldy R$X,x get joystick number to poll | |
759 bne L0481 | |
760 andb #$01 | |
761 bne L0485 | |
762 bra L0486 | |
763 L0481 andb #$02 | |
764 beq L0486 | |
765 L0485 clra | |
766 L0486 sta R$A,x | |
767 lda >PIA0Base+3 | |
768 ora #$08 | |
769 ldy R$X,x | |
770 bne L0494 | |
771 anda #$F7 | |
772 L0494 sta >PIA0Base+3 | |
773 lda >PIA0Base+1 | |
774 anda #$F7 | |
775 bsr L04B3 | |
776 std R$X,x | |
777 lda >PIA0Base+1 | |
778 ora #$08 | |
779 bsr L04B3 | |
780 pshs b,a | |
781 ldd #63 | |
782 subd ,s++ | |
783 std R$Y,x | |
784 clrb | |
785 puls pc,y,cc | |
786 | |
787 L04B3 sta >PIA0Base+1 | |
788 lda #$7F | |
789 ldb #$40 | |
790 bra L04C7 | |
791 L04BC lsrb | |
792 cmpb #$01 | |
793 bhi L04C7 | |
794 lsra | |
795 lsra | |
796 tfr a,b | |
797 clra | |
798 rts | |
799 L04C7 pshs b | |
800 sta >PIA1Base | |
801 tst >PIA0Base | |
802 bpl L04D5 | |
803 adda ,s+ | |
804 bra L04BC | |
805 L04D5 suba ,s+ | |
806 bra L04BC | |
807 | |
808 * Return display status | |
809 * Entry: A = path | |
810 * Exit: A = color code of pixel at cursor address | |
811 * X = address of graphics display memory | |
812 * Y = graphics cursor address; X = MSB, Y = LSB | |
813 SSDSTAT lbsr GfxActv gfx screen allocated? | |
814 bcs L050E branch if not | |
815 ldd <V.GCrsX,u else get X/Y gfx cursor position | |
816 bsr XY2Addr | |
817 tfr a,b | |
818 andb ,x | |
819 L04E7 bita #$01 | |
820 bne L04F6 | |
821 lsra divide D by 2 | |
822 lsrb | |
823 tst <V.Mode,u which mode? | |
824 bmi L04E7 branch if 256x192 | |
825 lsra else divide D by 2 again | |
826 lsrb | |
827 bra L04E7 | |
828 L04F6 pshs b | |
829 ldb <V.PMask,u get pixel color mask in B | |
830 andb #$FC | |
831 orb ,s+ | |
832 ldx PD.RGS,y get caller's regs | |
833 stb R$A,x place pixel color in A | |
834 ldd <V.GCrsX,u | |
835 std R$Y,x cursor X/Y pos in Y, | |
836 ldd <V.SBAdd,u | |
837 std R$X,x and screen addr in X | |
838 clrb | |
839 L050E rts | |
840 | |
841 * Entry: A = X coor, B = Y coor | |
842 XY2Addr pshs y,b,a save off regs | |
843 ldb <V.Mode,u get video mode | |
844 bpl L0517 branch if 128x192 (divide A by 4) | |
845 lsra else divide by 8 | |
846 L0517 lsra | |
847 lsra | |
848 pshs a save on stack | |
849 ldb #191 get max Y | |
850 subb $02,s sutract from Y on stack | |
851 lda #32 byte sper line | |
852 mul | |
853 addb ,s+ add offset on stack | |
854 adca #$00 | |
855 ldy <V.SBAdd,u get base address | |
856 leay d,y move D bytes into address | |
857 lda ,s pick up original X coor | |
858 sty ,s put offset addr on stack | |
859 anda <V.PixBt,u | |
860 ldx <V.MTabl,u | |
861 lda a,x | |
862 puls pc,y,x X = offset address, Y = base | |
863 | |
864 * SetStat | |
865 * | |
866 * Entry: | |
867 * A = function code | |
868 * Y = address of path descriptor | |
869 * U = address of device memory area | |
870 * | |
871 * Exit: | |
872 * CC = carry set on error | |
873 * B = error code | |
874 * | |
875 SetStat sta <V.WrChr,u save function code | |
876 ldx PD.RGS,y get caller's regs | |
877 cmpa #SS.ComSt | |
878 lbeq SSCOMST | |
879 cmpa #SS.AAGBf | |
880 beq SSAAGBF | |
881 cmpa #SS.SLGBf | |
882 beq SSSLGBF | |
883 cmpa #SS.KySns | |
884 bne CoGetStt | |
885 ldd R$X,x get caller's key sense set data | |
886 beq L0558 branch if zero | |
887 ldb #$FF else set all bits | |
888 L0558 stb <V.KySnsF,u store value in KySnsFlag | |
889 L055B clrb | |
890 L055C rts | |
891 | |
892 CoGetStt ldb #$09 CO-module setstat | |
893 JmpCO pshs b | |
894 lda <V.CurCo,u get CO-module in use | |
895 lbsr CallCO | |
896 puls a | |
897 bcc L055B | |
898 tst <V.GrfDrvE,u GrfDrv linked? | |
899 beq L055C | |
900 tfr a,b | |
901 clra GrfDrv address offset in statics | |
902 lbra CallCO call it | |
903 | |
904 * Reserve an additional graphics buffer (up to 2) | |
905 SSAAGBF ldb <V.Rdy,u was initial buffer allocated with $0F? | |
906 lbeq NotReady branch if not | |
907 pshs b save buffer number | |
908 leay <V.AGBuf,u point to additional graphics buffers | |
909 ldd ,y first entry empty? | |
910 beq L058E branch if so | |
911 leay $02,y else move to next entry | |
912 inc ,s increment B on stack | |
913 ldd ,y second entry empty? | |
914 bne L059E if not, no room for more... error out | |
915 L058E lbsr GetMem allocate graphics buffer memory | |
916 bcs L05A1 branch if error | |
917 std ,y save new buffer pointer at ,Y | |
918 std R$X,x and in caller's X | |
919 puls b get buffer number off stack | |
920 clra clear hi byte of D | |
921 std R$Y,x and put in caller's Y (buffer number) | |
922 clrb call is ok | |
923 rts and return | |
924 L059E ldb #E$BMode | |
925 coma | |
926 L05A1 puls pc,a | |
927 | |
928 * Select a graphics buffer | |
929 SSSLGBF ldb <V.Rdy,u was initial buffer allocated with $0F? | |
930 lbeq NotReady branch if not | |
931 ldd R$Y,x else get buffer number from caller | |
932 cmpd #$0002 compare against high | |
933 bhi BadMode branch if error | |
934 leay <V.GBuff,u point to base graphics buffer address | |
935 lslb multiply by 2 | |
936 ldd b,y get pointer | |
937 beq BadMode branch if error | |
938 std <V.SBAdd,u else save in current | |
939 ldd R$X,x get select flag | |
940 beq L05C3 if zero, do nothing | |
941 ldb #$01 else set display flag | |
942 L05C3 stb <V.CFlg1,u save display flag | |
943 clrb | |
944 rts | |
945 BadMode comb | |
946 ldb #E$BMode | |
947 rts | |
948 | |
949 SSCOMST ldd R$Y,x Get caller's Y | |
950 SetupTerm | |
951 bita #ModCoVDG CoWP? | |
952 beq GoCoWP branch if so | |
953 ldb #$10 assume true lower case TRUE | |
954 bita #$01 true lowercase bit set? | |
955 bne GoCoVDG branch if so | |
956 clrb true lower case FALSE | |
957 | |
958 GoCoVDG stb <V.CFlag,u save flag for later | |
959 lda #ModCoVDG CoVDG is loaded bit | |
960 ldx #$2010 32x16 | |
961 pshs u,y,x,a | |
962 leax >CoVDG,pcr | |
963 bra SetupCoModule | |
964 | |
965 GoCoWP bita #ModCoWP ; CoWP needed ? | |
966 beq GoCoHR | |
967 lda #ModCoWP 'CoWP is loaded' bit | |
968 ldx #$5018 80x24 | |
969 pshs u,y,x,a | |
970 leax >CoWP,pcr | |
971 | |
972 SetupCoModule | |
973 bsr LoadCoModule load CO-module if not already loaded | |
974 puls u,y,x,a | |
975 bcs L0600 | |
976 stx <V.Col,u save screen size | |
977 sta <V.CurCo,u current module in use? ($02=CoVDG, $04=C080) | |
978 L0600 rts | |
979 | |
980 GOCoHR ldx #$3318 51x24 | |
981 pshs u,y,x,a | |
982 leax >CoHR,pcr | |
983 bra SetupCoModule | |
984 | |
985 LoadCoModule | |
986 bita <V.COLoad,u module loaded? | |
987 beq L0608 branch if not | |
988 L0606 clrb else clear carry | |
989 rts and return | |
990 | |
991 L0608 pshs y,x,a | |
992 lbsr LinkSub | |
993 bcc L061F branch if link was successful | |
994 ldx $01,s get pointer to name on stack | |
995 pshs u | |
996 os9 F$Load try to load subroutine I/O module | |
997 puls u | |
998 bcc L061F | |
999 puls y,x,a | |
1000 lbra NoIOMod | |
1001 L061F leax <V.GrfDrvE,u get base pointer to CO-entries | |
1002 lda ,s | |
1003 bsr GetModOffset ; Get offset in table | |
1004 sty a,x ; Save address | |
1005 | |
1006 puls y,x,a | |
1007 ldb #$00 CO-module init offset | |
1008 lbra CallCO call it | |
1009 | |
1010 ; | |
1011 ; Get module offset from V.GrfDrvE into A reg. | |
1012 ; I had to do this because the previous system would only work | |
1013 ; properly for 2 entries ! | |
1014 ; | |
1015 | |
1016 GetModOffset | |
1017 pshs b | |
1018 clrb ; Calculate address offset | |
1019 AddrFind | |
1020 bita #$01 ; Done all shifts ? | |
1021 bne AddrDone | |
1022 addb #$2 ; increment addr offset ptr | |
1023 lsra | |
1024 bra AddrFind ; Test again | |
1025 AddrDone | |
1026 tfr b,a ; output in a | |
1027 puls b,pc | |
1028 | |
1029 * Link to subroutine | |
1030 LinkSub pshs u | |
1031 lda #Systm+Objct | |
1032 os9 F$Link | |
1033 puls pc,u | |
1034 | |
1035 * 128x192 4 color pixel table | |
1036 Mode1Clr fdb $0055,$aaff | |
1037 | |
1038 GfxDispatch | |
1039 cmpa #$15 GrfDrv-handled code? | |
1040 bcc GoGrfo branch if so | |
1041 cmpa #$0F display graphics code? | |
1042 beq Do0F branch if so | |
1043 suba #$10 | |
1044 bsr GfxActv check if first gfx screen was alloc'ed | |
1045 bcs L0663 if not, return with error | |
1046 leax <gfxtbl,pcr else point to jump table | |
1047 lsla multiply by two | |
1048 ldd a,x get address of routine | |
1049 jmp d,x jump to it | |
1050 | |
1051 * Jump table for graphics codes $10-$14 | |
1052 gfxtbl fdb Do10-gfxtbl $10 - Preset Screen | |
1053 fdb Do11-gfxtbl $11 - Set Color | |
1054 fdb Do12-gfxtbl $12 - End Graphics | |
1055 fdb Do13-gfxtbl $13 - Erase Graphics | |
1056 fdb Do14-gfxtbl $14 - Home Graphics Cursor | |
1057 | |
1058 GfxActv ldb <V.Rdy,u gfx screen allocated? | |
1059 bne L0606 branch if so | |
1060 NotReady comb | |
1061 ldb #E$NotRdy | |
1062 L0663 rts | |
1063 | |
1064 GoGrfo bsr GfxActv | |
1065 bcs L0663 | |
1066 ldx <V.GrfDrvE,u get GrfDrv entry point | |
1067 bne L0681 branch if not zero | |
1068 pshs y,a else preserve regs | |
1069 bne L067F | |
1070 leax >GrfDrv,pcr get pointer to name string | |
1071 bsr LinkSub link to GrfDrv | |
1072 bcc L067B branch if ok | |
1073 puls pc,y,a else exit with error | |
1074 L067B sty <V.GrfDrvE,u save module entry pointer | |
1075 L067F puls y,a restore regs | |
1076 L0681 clra A = GrfDrv address offset in statics | |
1077 lbra CoWrite | |
1078 | |
1079 * Allocate GFX mem -- we must allocate on a 512 byte page boundary | |
1080 GetMem pshs u save static pointer | |
1081 ldd #6144+256 allocate graphics memory + 1 page | |
1082 os9 F$SRqMem do it | |
1083 bcc L0691 branch if ok | |
1084 puls pc,u else return with error | |
1085 L0691 tfr u,d move mem ptr to D | |
1086 puls u restore statics | |
1087 tfr a,b move high 8 bits to lower | |
1088 bita #$01 odd page? | |
1089 beq L069F branch if not | |
1090 adda #$01 | |
1091 bra L06A1 | |
1092 L069F addb #$18 | |
1093 L06A1 pshs u,a | |
1094 tfr b,a | |
1095 clrb | |
1096 tfr d,u | |
1097 ldd #256 | |
1098 os9 F$SRtMem return page | |
1099 puls u,a | |
1100 bcs L06B3 branch if error | |
1101 clrb | |
1102 L06B3 rts | |
1103 | |
1104 * $0F - display graphics | |
1105 Do0F leax <DispGfx,pcr | |
1106 ldb #$02 | |
1107 lbra L03BF | |
1108 | |
1109 DispGfx ldb <V.Rdy,u already allocated initial buffer? | |
1110 bne L06D1 branch if so | |
1111 bsr GetMem else get graphics memory | |
1112 bcs L06EF branch if error | |
1113 std <V.SBAdd,u save memory | |
1114 std <V.GBuff,u and GBuff | |
1115 inc <V.Rdy,u ok, we're ready | |
1116 lbsr EraseGfx clear gfx mem | |
1117 L06D1 lda <V.NChr2,u get character after next | |
1118 sta <V.PMask,u save color set (0-3) | |
1119 anda #$03 mask out all but lower 2 bits | |
1120 leax >Mode1Clr,pcr point to mask byte table | |
1121 lda a,x get byte | |
1122 sta <V.Msk1,u save mask byte here | |
1123 sta <V.Msk2,u and here | |
1124 lda <V.NChar,u get next char, mode byte (0-1) | |
1125 cmpa #$01 compare against max | |
1126 bls L06F0 branch if valid | |
1127 comb | |
1128 ldb #E$BMode else invalid mode specified, send error | |
1129 L06EF rts | |
1130 | |
1131 L06F0 tsta test user supplied mode byte | |
1132 beq L0710 branch if 256x192 | |
1133 ldd #$C003 | |
1134 std <V.MCol,u | |
1135 lda #$01 | |
1136 sta <V.Mode,u 128x192 mode | |
1137 lda #$E0 | |
1138 ldb <V.NChr2,u | |
1139 andb #$08 | |
1140 beq L0709 | |
1141 lda #$F0 | |
1142 L0709 ldb #$03 | |
1143 leax <L0742,pcr | |
1144 bra L072D | |
1145 L0710 ldd #$8001 | |
1146 std <V.MCol,u | |
1147 lda #$FF | |
1148 tst <V.Msk1,u | |
1149 beq L0723 | |
1150 sta <V.Msk1,u | |
1151 sta <V.Msk2,u | |
1152 L0723 sta <V.Mode,u 256x192 mode | |
1153 lda #$F0 | |
1154 ldb #$07 | |
1155 leax <L0746,pcr | |
1156 L072D stb <V.PixBt,u | |
1157 stx <V.MTabl,u | |
1158 ldb <V.NChr2,u | |
1159 andb #$04 | |
1160 lslb | |
1161 pshs b | |
1162 ora ,s+ | |
1163 ldb #$01 | |
1164 * Indicate screen is current | |
1165 lbra SetDsply | |
1166 | |
1167 L0742 fcb $c0,$30,$0c,$03 | |
1168 L0746 fcb $80,$40,$20,$10,$08,$04,$02,$01 | |
1169 | |
1170 * $11 - set color | |
1171 Do11 leax <SetColor,pcr set up return address | |
1172 lbra L03BD | |
1173 | |
1174 SetColor clr <V.NChar,u get next char | |
1175 lda <V.Mode,u which mode? | |
1176 bmi L075F branch if 256x192 | |
1177 inc <V.NChar,u | |
1178 L075F lbra L06D1 | |
1179 | |
1180 * $12 - end graphics | |
1181 Do12 leax <V.GBuff,u point to first buffer | |
1182 ldy #$0000 Y = 0 | |
1183 ldb #$03 free 3 gfx screens max | |
1184 pshs u,b | |
1185 L076D ldd #6144 size of graphics screen | |
1186 ldu ,x++ get address of graphics screen | |
1187 beq L077A branch if zero | |
1188 sty -$02,x else clear entry | |
1189 os9 F$SRtMem and return memory | |
1190 L077A dec ,s decrement counter | |
1191 bgt L076D keep going if not end | |
1192 ldu ,x flood fill buffer? | |
1193 beq L0788 branch if not allocated | |
1194 ldd #512 else get size | |
1195 os9 F$SRtMem and free memory | |
1196 L0788 puls u,b restore regs | |
1197 clra | |
1198 sta <V.Rdy,u gfx mem no longer alloced | |
1199 lbra SetDsply | |
1200 | |
1201 Do10 leax <Preset,pcr set up return address | |
1202 lbra L03BD | |
1203 | |
1204 * NOTE! Shouldn't this be lda <V.NChar,u ?? | |
1205 Preset lda <V.NChr2,u get next char | |
1206 tst <V.Mode,u which mode? | |
1207 bpl L07A7 branch if 128x192 4 color | |
1208 ldb #$FF assume we will clear with $FF | |
1209 anda #$01 mask out all but 1 bit (2 colors) | |
1210 beq EraseGfx erase graphic screen with color $00 | |
1211 bra L07B2 else erase screen with color $FF | |
1212 L07A7 anda #$03 mask out all but 2 bits (4 colors) | |
1213 leax >Mode1Clr,pcr point to color table | |
1214 ldb a,x get appropriate byte | |
1215 bra L07B2 and start the clearing | |
1216 | |
1217 * Erase graphics screen | |
1218 Do13 | |
1219 EraseGfx clrb value to clear screen with | |
1220 L07B2 ldx <V.SBAdd,u | |
1221 leax >6144+1,x point to end of gfx mem + 1 | |
1222 L07B9 stb ,-x clear | |
1223 cmpx <V.SBAdd,u X = to start? | |
1224 bhi L07B9 if not, continue | |
1225 * Home Graphics cursor | |
1226 Do14 clra | |
1227 clrb | |
1228 std <V.GCrsX,u | |
1229 rts | |
1230 | |
1231 * | |
1232 * Ding - tickle CoCo's PIA to emit a sound | |
1233 * | |
1234 Ding pshs b,a | |
1235 lda >PIA0Base+1 | |
1236 ldb >PIA0Base+3 | |
1237 pshs b,a | |
1238 anda #$F7 | |
1239 andb #$F7 | |
1240 sta >PIA0Base+1 | |
1241 stb >PIA0Base+3 | |
1242 lda >PIA1Base+3 | |
1243 pshs a | |
1244 ora #$08 | |
1245 sta >PIA1Base+3 | |
1246 ldb #$0A | |
1247 L07E6 lda #$FE | |
1248 bsr DingDuration | |
1249 lda #$02 | |
1250 bsr DingDuration | |
1251 decb | |
1252 bne L07E6 | |
1253 puls a | |
1254 sta >PIA1Base+3 | |
1255 puls b,a | |
1256 sta >PIA0Base+1 | |
1257 stb >PIA0Base+3 | |
1258 puls pc,b,a | |
1259 | |
1260 DingDuration | |
1261 sta >PIA1Base | |
1262 lda #128 | |
1263 L0805 inca | |
1264 bne L0805 | |
1265 rts | |
1266 | |
1267 * Dummy flash cursor routine, can be replaced by COxx module. | |
1268 | |
1269 FlashCursor | |
1270 rts | |
1271 | |
1272 emod | |
1273 eom equ * | |
1274 end |