annotate level1/modules/vtio.asm @ 2730:6bd6e348665d

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