Mercurial > hg > Members > kono > nitros9-code
annotate level2/modules/cc3io.asm @ 1332:80f15c027ebb
Improved ngu somewhat
author | boisy |
---|---|
date | Sun, 07 Sep 2003 19:29:52 +0000 |
parents | 5dd56f2f45b4 |
children | 146dfa918a9c |
rev | line source |
---|---|
0 | 1 ******************************************************************** |
2 * CC3IO - CoCo 3 I/O driver | |
3 * | |
4 * $Id$ | |
5 * | |
1262 | 6 * Edt/Rev YYYY/MM/DD Modified by |
7 * Comment | |
0 | 8 * ------------------------------------------------------------------ |
1262 | 9 * 16 1986/??/?? |
10 * Original OS-9 L2 Tandy distribution. | |
11 * | |
12 * 26r3 1998/10/12 | |
13 * Added support for obtaining monitor type from the init module. | |
14 * | |
15 * 26r4 1998/10/23 | |
16 * Added support for obtaining key repeat info from the init module. | |
17 * | |
18 * 26r5 2002/07/24 | |
19 * Added support for obtaining mouse info from the init module. | |
20 * | |
21 * 27 2003/08/18 | |
22 * Forward ported to NitrOS-9. | |
0 | 23 |
24 nam CC3IO | |
25 ttl CoCo 3 I/O driver | |
26 | |
27 * Disassembled 98/09/09 08:29:24 by Disasm v1.6 (C) 1988 by RML | |
28 | |
29 ifp1 | |
30 use defsfile | |
31 endc | |
32 | |
33 tylg set Drivr+Objct | |
34 atrv set ReEnt+rev | |
1262 | 35 rev set 0 |
36 edition set 27 | |
0 | 37 |
1261 | 38 mod eom,name,tylg,atrv,start,CC3DSiz |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
39 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
40 fcb EXEC.+UPDAT. |
0 | 41 |
42 name fcs /CC3IO/ | |
43 fcb edition | |
44 | |
45 start lbra Init | |
46 lbra Read | |
47 lbra Write | |
48 lbra GetStat | |
49 lbra SetStat | |
50 | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
51 * Term |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
52 * |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
53 * Entry: |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
54 * U = address of device memory area |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
55 * |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
56 * Exit: |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
57 * CC = carry set on error |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
58 * B = error code |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
59 * |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
60 Term equ * |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
61 ldx <D.CCMem get ptr to CC memory |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
62 cmpu G.CurDev,x device to be terminated is current? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
63 * cmpu >WGlobal+G.CurDev device to be terminated is current? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
64 bne noterm no, execute terminate routine in co-module |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
65 lbsr shftclr get last window memory pointer |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
66 cmpu G.CurDev,x device to be terminated is current? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
67 * cmpu >WGlobal+G.CurDev we the only window left? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
68 bne noterm no, execute terminate routine in co-module |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
69 * We are last device that CC3IO has active; terminate ourself |
0 | 70 pshs u,x |
1261 | 71 ldx #(WGlobal+G.JoyEnt) $10EA |
0 | 72 bsr TermSub |
1261 | 73 ldx #(WGlobal+G.SndEnt) $10F4 |
0 | 74 bsr TermSub |
1261 | 75 ldx #(WGlobal+G.KeyEnt) $10E0 |
0 | 76 bsr TermSub |
77 puls u,x | |
78 pshs cc | |
79 orcc #IRQMask | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
80 IFNE H6309 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
81 clrd |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
82 ELSE |
0 | 83 clra |
84 clrb | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
85 ENDC |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
86 std G.CurDev,x |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
87 * std >WGlobal+G.CurDev |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
88 ldx <D.Clock change altirq routine to go to clock |
0 | 89 stx <D.AltIRQ |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
90 puls cc restore IRQs |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
91 noterm ldb #$0C branch table offset for terminate |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
92 lbra L0590 go to terminate in co-module |
0 | 93 |
94 * Call terminate routine in subroutine module (KeyDrv/JoyDrv/SndDrv) | |
95 * X = addr in statics of entry | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
96 TermSub leau 2,x point U to static area for sub module |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
97 ldx ,x get entry pointer at ,X |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
98 jmp $03,x call term routine in sub module |
0 | 99 |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
100 * Device initialization routine |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
101 * Entry: U=Static mem ptr for device to initialize |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
102 * Y=Path dsc. ptr |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
103 * DP=0 (or we're in trouble) |
1262 | 104 Init ldx <D.CCMem get ptr to CC mem |
105 ldd <G.CurDev,x has CC3IO itself been initialized? | |
106 lbne L00EF yes, don't bother doing it again | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
107 leax >CC3Irq,pcr set up AltIRQ vector in DP |
0 | 108 stx <D.AltIRQ |
1262 | 109 leax >shftclr,pcr point to SHIFT-CLEAR subroutine |
110 pshs x save it on stack | |
111 leax >setmouse,pcr get address of setmouse routine | |
0 | 112 tfr x,d |
1262 | 113 ldx <D.CCMem get ptr to CC mem |
0 | 114 std >G.MsInit,x |
1262 | 115 puls b,a get address of SHIFT-CLEAR subroutine |
116 std >G.WindBk,x save its vector | |
0 | 117 stu <G.CurDev,x |
1262 | 118 lbsr setmouse initialize mouse |
0 | 119 |
120 lda #$02 | |
1262 | 121 sta G.CurTik,x save # ticks between cursor(s)updates |
122 inc <G.Mouse+Pt.Valid,x set mouse packet to invalid | |
123 ldd #$0178 default to right mouse/time out value | |
0 | 124 std <G.Mouse+Pt.Actv,x |
125 | |
1262 | 126 ldd #$FFFF initialize keyboard values |
127 std <G.LKeyCd,x last keyboard code & key repeat counter inactive | |
0 | 128 std <G.2Key2,x |
1262 | 129 ldd <D.Proc get cur proc desc ptr in D |
130 pshs u,y,x,b,a save regs | |
0 | 131 |
132 * Added to allow patching for RGB/CMP/Mono and Key info - BGP | |
133 * Uses new init module format to get monitor type and key info | |
134 | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
135 ldy <D.Init get init module ptr |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
136 lda MonType,y get monitor type byte |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
137 sta <G.MonTyp,x save off |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
138 ldd MouseInf,y get mouse information |
350 | 139 sta <G.Mouse+Pt.Res,x save off hi-res/lo-res flag |
140 stb <G.Mouse+Pt.Actv,x save off left/right | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
141 ldd KeyRptS,y get key repeat start/delay constant |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
142 sta <G.KyRept,x set first delay |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
143 std <G.KyDly,x set initial and 2ndary constants |
0 | 144 |
1261 | 145 ldd <D.SysPrc get system process desc ptr |
146 std <D.Proc and make current proc | |
147 leax >KeyDrv,pcr point to keyboard driver sub module name | |
148 bsr LinkSys link to it | |
149 * U = ptr to CC mem | |
150 sty >G.KeyEnt,u and save the entry point | |
151 leau >G.KeyMem,u point U to keydrv statics | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
152 jsr ,y call init routine of sub module |
1261 | 153 leax >JoyDrv,pcr point to joystick driver sub module name |
154 bsr LinkSys link to it | |
155 * U = ptr to CC mem | |
156 sty >G.JoyEnt,u and save the entry point | |
157 leau >G.JoyMem,u point U to joydrv statics | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
158 jsr ,y call init routine of sub module |
1261 | 159 leax >SndDrv,pcr point to sound driver sub module name |
160 bsr LinkSys link to it | |
161 * U = ptr to CC mem | |
162 sty >G.SndEnt,u and save the entry point | |
163 leau >G.SndMem,u point U to sound statics | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
164 jsr ,y call init routine of sub module |
1261 | 165 puls u,y,x,b,a restore saved regs |
166 std <D.Proc and restore current process | |
167 L00EF ldd #$0078 set default SS.Mouse parameters | |
168 std <MS.Smpl,u (Mouse sample rate & fire button timeout value) | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
169 ldd <IT.PAR,y get parity/baud bytes from dev desc |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
170 std <DevPar,u save it off in our static |
1261 | 171 lbra L08AA go find and init co-module |
0 | 172 |
173 KeyDrv fcs /KeyDrv/ | |
174 JoyDrv fcs /JoyDrv/ | |
175 SndDrv fcs /SndDrv/ | |
176 | |
1261 | 177 LinkSys lda #Systm+Objct system module |
178 os9 F$Link link to it | |
179 ldu <D.CCMem get ptr to CC mem | |
0 | 180 rts |
181 | |
1261 | 182 * NOTE: This just reads keys from the buffer. The physical reading of keys |
183 * is done by the IRQ routine | |
184 Read lda V.PAUS,u device paused? | |
185 bpl read1 no, do normal read (should this be bne?) | |
186 * Device is paused; check for mouse button press | |
187 lda >(WGlobal+G.Mouse+Pt.CBSA) if paused, check mouse button 1 | |
188 beq read1 button isn't pressed, do normal read | |
189 clra clear carry (no error) | |
190 rts return | |
191 | |
192 read1 lda <SS.SigID,u data ready signal trap set up? | |
193 lbne NotReady no, exit with not ready error | |
194 * Data ready signal trap set up | |
195 leax >ReadBuf,u point to keyboard buffer | |
196 ldb <InpPtr,u get current position in keyboard buffer | |
197 orcc #IRQMask disable IRQs | |
198 cmpb <EndPtr,u same as end of buffer ptr (no keys in buffer)? | |
199 beq ReadSlp yes, no new chars waiting, sleep/scan for them | |
200 * Character(s) waiting in buffer | |
201 abx move ptr to character | |
202 lda ,x get character from buffer | |
1262 | 203 incb inc keyboard buffer ptr |
204 bpl bumpdon if it hasn't wrapped 128 bytes, go save it | |
205 * bsr ChkWrap check for wrap | |
206 clrb | |
207 bumpdon stb <InpPtr,u save updated keyboard buffer ptr | |
1261 | 208 andcc #^(IRQMask!Carry) restore IRQ and clear carry |
209 rts return with A containing char read | |
210 | |
211 * Nothing is in input buffer so wait for it | |
212 ReadSlp lda V.BUSY,u get active process id # | |
213 sta V.WAKE,u save as process id # to wake up when data read | |
214 andcc #^IRQMask restore IRQ | |
215 ldx #$0000 sleep till data ready | |
0 | 216 os9 F$Sleep |
1261 | 217 clr V.WAKE,u signal gotten, disable process # to wake up |
218 ldx <D.Proc get current proc desc ptr | |
219 ldb <P$Signal,x signal pending? | |
220 beq Read no, go read char | |
221 * Signal was pending already, check it out | |
222 IFNE H6309 | |
1262 | 223 tim #Condem,P$State,x are we condemend? |
1261 | 224 ELSE |
225 lda P$State,x | |
0 | 226 bita #Condem |
1261 | 227 ENDC |
228 bne ReadErr yes, exit with error flag set back to SCF | |
229 cmpb #S$Window window change or higher signal? | |
230 bcc Read yes, read the char since it won't change | |
231 ReadErr coma major signal, return with error flag | |
232 rts (Keyboard abort/interrupt) | |
0 | 233 |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
234 * Check wraparound of keyboard buffer (could be inlined) |
1262 | 235 *ChkWrap incb inc keyboard buffer pointer |
236 * cmpb #$7F wrapped around? | |
237 * bls L015F branch if not | |
238 * clrb else reset pointer to 0 | |
239 *L015F rts return | |
0 | 240 |
1261 | 241 * Keyboard mouse coordinate deltas |
242 L0160 fcb 8,1 right arrow (normal, shifted) | |
243 fdb MaxRows-1 right arrow (control) | |
244 fcb -8,-1 left arrow (normal, shifted) | |
245 fdb 0 left arrow (control) | |
246 fcb 8,1 down arrow (normal, shifted) | |
247 fdb MaxLine down arrow (control) | |
248 fcb -8,-1 up arrow (normal, shifted) | |
249 fdb 0 up arrow (control) | |
250 | |
251 * Check mouse coordinate | |
252 * Entry: D=Maximum allowed coordinate for current axis being checked | |
253 * Y=Ptr to current coordinate in mouse packet being checked | |
254 L0170 cmpd ,y past maximum allowed coordinate? | |
255 blt L017B | |
256 ldd ,y below zero? | |
257 bpl L017D no, return | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
258 IFNE H6309 |
1261 | 259 clrd set it to minimum coordinate (zero) |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
260 ELSE |
0 | 261 clra |
262 clrb | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
263 ENDC |
1261 | 264 L017B std ,y set it to maximum coordinate |
265 L017D rts return | |
266 | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
267 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
268 * Main keyboard scan (after PIA has been read) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
269 * Check keyboard mouse arrows |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
270 * Entry: U=Global mem ptr |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
271 * X=??? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
272 * A=Key that was pressed |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
273 * Exit: E=0 if key was pressed, 1 if none pressed |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
274 * Updated for localized keyboard mouse similiar to TC9IO |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
275 * |
1262 | 276 L017E ldb #$01 flag |
277 pshs u,y,x,b,a save registers used & flag | |
278 ldb <G.KyMse,u get keyboard mouse flag | |
279 beq L01E6 branch if off | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
280 * Keyboard mouse is on |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
281 lda <G.KySns,u |
1262 | 282 bita #%01111000 any arrow key pressed? |
0 | 283 beq L01DF |
1262 | 284 clr $01,s clear flag to indicate update |
0 | 285 lda #$01 |
1262 | 286 sta <G.MseMv,u flag a mouse coord change |
287 ldd #$0803 start at up arrow and up arrow table | |
288 pshs b,a entries & save them | |
289 leax >L0160,pcr point to keyboard mouse deltas | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
290 leay <G.Mouse+Pt.Acy,u point to mouse coords |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
291 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
292 * Update keyboard mouse co-ordinates according to arrow key pressed |
1262 | 293 L01A2 bita <G.KySns,u desired arrow key down? |
294 beq L01C5 no, move to next key | |
295 lslb multiply * 4 (size of each set) | |
296 lslb to point to start of proper arrow entry | |
297 tst <G.ShftDn,u shift key down? | |
298 beq L01B1 no, go on | |
299 incb move ptr to <shifted> offset | |
300 bra L01BC get delta | |
301 L01B1 tst <G.CntlDn,u control key down? | |
302 beq L01BC no, go on | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
303 * <CTRL>-arrow |
1262 | 304 addb #$02 move ptr to <CTRL> offset |
305 ldd b,x get control coordinate | |
306 bra L01C1 go store it in mouse packet | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
307 * <arrow> or <SHIFT>-<arrow> |
1262 | 308 L01BC ldb b,x get offset to present mouse coordinate |
309 sex make into 16 bit offset (keep sign) | |
310 addd ,y add it to current coordinate | |
311 L01C1 std ,y save updated coordinate | |
312 ldd ,s get key count | |
313 L01C5 lsla move to next key bit | |
314 decb decrement key count | |
315 cmpb #$01 down to X coordinates? | |
316 bne L01CD no, continue | |
317 leay -$02,y move to mouse X coordinate | |
318 L01CD std ,s save key count & key | |
319 bpl L01A2 keep trying until all keys checked | |
320 puls b,a purge stack of key and delta offset | |
321 ldd #MaxRows-1 get maximum X coordinate | |
322 bsr L0170 check X coordinate | |
323 leay $02,y move to Y coordinate | |
324 ldd #MaxLine get maximum Y coordinate | |
325 bsr L0170 check it | |
326 L01DF lda <G.KyButt,u key button down? | |
327 bne L0223 yes, return | |
328 lda ,s get back character read | |
329 L01E6 tst <G.Clear,u clear key down? | |
330 beq L0225 yes, return | |
331 clr <G.Clear,u clear out clear key flag | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
332 * Check CTRL-0 (CAPS-Lock) |
1262 | 333 cmpa #$81 control-0? |
334 bne L01FF no, keep checking | |
335 ldb <G.KySame,u same key pressed? | |
0 | 336 bne L0223 |
1262 | 337 ldx <G.CurDev,u get dev mem pointer |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
338 IFNE H6309 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
339 eim #CapsLck,<ULCase,x |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
340 ELSE |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
341 ldb <ULCase,x |
1262 | 342 eorb #CapsLck reverse current CapsLock status |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
343 stb <ULCase,x |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
344 ENDC |
1262 | 345 bra L0223 return |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
346 * Check CLEAR key |
1262 | 347 L01FF cmpa #$82 was it clear key? |
348 bne L0208 no, keep going | |
349 lbsr L0485 find next window | |
350 bra L0223 return | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
351 * Check SHIFT-CLEAR |
1262 | 352 L0208 cmpa #$83 was it shift clear? |
353 bne L0211 no, keep checking | |
354 lbsr shftclr yes, find back window | |
355 bra L0223 return | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
356 * Check CTRL-CLEAR |
1262 | 357 L0211 cmpa #$84 keyboard mouse toggle key? |
358 bne L0225 no, return | |
359 ldb <G.KySame,u same key pressed? | |
360 bne L0223 yes, return | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
361 com <G.KyMse,u |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
362 ldx <G.CurDev,u |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
363 IFNE H6309 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
364 eim #KeyMse,<ULCase,x |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
365 ELSE |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
366 ldb <ULCase,x |
1262 | 367 eorb #KeyMse reverse current Keyboard Mouse status |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
368 stb <ULCase,x |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
369 ENDC |
0 | 370 L0223 clr $01,s |
371 L0225 ldb $01,s | |
1262 | 372 puls pc,u,y,x,b,a restore regs |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
373 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
374 L0229 pshs x,b save external mouse button status & PIA addr |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
375 leax <G.Mouse,u mouse point to mouse packet |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
376 tst Pt.ToTm,x timed value zero? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
377 lbeq L02C8 branch if so |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
378 leas -$05,s make a buffer for locals |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
379 tfr a,b move keyboard button flags to B |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
380 tst <G.KyMse,u keyboard mouse activated? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
381 bne L024E yes, go on |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
382 ldb #%00000101 mask for button 1 & 2 on right mouse/joystick |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
383 lda Pt.Actv,x get active mouse side |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
384 anda #%00000010 clear all but left side select |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
385 sta ,s save result |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
386 beq L0248 if 0 (off or right side), skip ahead |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
387 lslb otherwise, change button 1 & 2 mask for left moue |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
388 L0248 andb $05,s check with external mouse button status type |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
389 tsta right side? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
390 beq L024E yes, skip ahead |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
391 lsrb left side, shift over so we can use same routine |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
392 * Bits 0 & 2 of B contain external mouse buttons that are pressed (doesn't |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
393 * matter which side) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
394 L024E clra clear out A |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
395 lsrb shift out LSBit of B |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
396 rola put into LSBit of A |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
397 lsrb shift out another bit of B |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
398 std $01,s store fire button info |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
399 bne L0276 fire button(s) pressed, go on |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
400 lda Pt.TTTo,x timeout occur? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
401 beq L02C6 yes, exit |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
402 bsr L02CA fire buttons change? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
403 beq L0262 no, decrement timeout count |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
404 bsr L02D3 go update fire button click & timeout info |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
405 beq L02AB if neither button state changed, skip ahead |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
406 L0262 dec Pt.TTTo,x decrement timeout count |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
407 bne L02AB not timed out, go update last state counts |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
408 IFNE H6309 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
409 clrd |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
410 clrw |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
411 ELSE |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
412 clra |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
413 clrb |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
414 ENDC |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
415 sta >G.MsSig,u clear read flag |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
416 std Pt.TSSt,x clear time since counter start |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
417 IFNE H6309 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
418 stq Pt.CCtA,x clear button click count & time this state |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
419 ELSE |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
420 std Pt.CCtA,x clear button click count & time this state |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
421 std Pt.TTSA,x |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
422 ENDC |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
423 std Pt.TLSA,x clear button time last state |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
424 bra L02C6 exit |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
425 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
426 L0276 lda Pt.ToTm,x get timeout initial value |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
427 sta Pt.TTTo,x reset count |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
428 bsr L02CA fire buttons change? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
429 beq L02AB no, update last state counts |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
430 bsr L02D3 update fire button info |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
431 inc >WGlobal+G.MsSig flag mouse signal |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
432 IFNE H6309 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
433 ldq <Pt.AcX,x get actual X & Y coordinates |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
434 stq <Pt.BDX,x copy it to button down X & Y coordinates |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
435 ELSE |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
436 ldd <Pt.AcX,x get actual X coordinate |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
437 std <Pt.BDX,x copy it to button down X coordinate |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
438 ldd <Pt.AcY,x get actual Y coordinate |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
439 std <Pt.BDY,x copy it to button down Y coordinate |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
440 ENDC |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
441 pshs u save ptr to CC mem |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
442 ldu <G.CurDev,u get dev mem ptr |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
443 lda <MS.SigID,u get process ID requesting mouse signal |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
444 beq L02A9 branch if none |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
445 ldb <MS.SigSg,u else get signal code to send |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
446 os9 F$Send and send it |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
447 bcs L02A5 branch if error |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
448 clr <MS.SigID,u clear signal ID (one shot) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
449 L02A5 clr >WGlobal+G.MsSig clear read flag |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
450 L02A9 puls u recover pointer to CC mem |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
451 L02AB ldd Pt.TTSA,x get button A&B time last state |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
452 cmpa #$FF limit? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
453 beq L02B2 yes, go on |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
454 inca increment state |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
455 L02B2 cmpb #$FF limit? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
456 beq L02B7 yes, store them |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
457 incb increment B state |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
458 L02B7 std Pt.TTSA,x save updated states |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
459 ldd Pt.TSST,x get time since start |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
460 IFNE H6309 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
461 incd increment |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
462 beq L02C6 branch if zero |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
463 ELSE |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
464 cmpd #$FFFF check upper bound |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
465 beq L02C4 branch if so |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
466 addd #$0001 else increment |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
467 ENDC |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
468 L02C4 std Pt.TSST,x save updated state count |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
469 L02C6 leas $05,s purge locals |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
470 L02C8 puls pc,x,b restore & return |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
471 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
472 L02CA ldd Pt.CBSA,x get button states |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
473 IFNE H6309 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
474 eord $03,s flip fire 1 & 2 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
475 ELSE |
0 | 476 eora $03,s |
477 eorb $04,s | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
478 ENDC |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
479 std $05,s save 'em |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
480 rts return |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
481 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
482 * Update mouse button clock counts & timeouts |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
483 L02D3 ldd Pt.TTSA,x get button time this state |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
484 tst $05,s button A change? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
485 beq L02E9 no, go check B |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
486 sta Pt.TLSA,x save button A time last state |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
487 lda $03,s button A pressed? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
488 bne L02E8 yes, skip increment |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
489 lda Pt.CCtA,x get click count for A |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
490 inca bump up click count |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
491 beq L02E9 branch if wrapped |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
492 sta Pt.CCtA,x save button A click count |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
493 L02E8 clra clear button A time this state |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
494 L02E9 tst 6,s button B change? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
495 beq L02FD no, go save time this state |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
496 stb Pt.TLSB,x save button B time last state count |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
497 ldb $04,s button B pressed? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
498 bne L02FC yes, skip increment |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
499 ldb Pt.CCtB,x get b click count |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
500 incb bump up click count |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
501 beq L02FD brach if wrapped to zero |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
502 stb Pt.CCtB,x save B click count |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
503 L02FC clrb clear button B time this state |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
504 L02FD std Pt.TTSA,x save button time this state counts |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
505 ldd $03,s get new fire buttons |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
506 std Pt.CBSA,x save 'em |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
507 ldd $05,s get button A & B change flags |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
508 NullIRQ rts return |
0 | 509 |
510 | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
511 * CC3IO IRQ routine - Entered from Clock every 1/60th of a second |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
512 CC3Irq ldu <D.CCMem get ptr to CC mem |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
513 ldy <G.CurDev,u get current device's static |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
514 lbeq L044E branch if none |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
515 lda <G.TnCnt,u get tone counter |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
516 beq L0319 branch if zero |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
517 deca else decrement |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
518 sta <G.TnCnt,u and save back |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
519 * Check for any change on screen |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
520 * U=Unused now (sitting as NullIRQ ptr) - MAY WANT TO CHANGE TO CUR DEV PTR |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
521 * Y=Current Device mem ptr |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
522 L0319 leax <NullIRQ,pcr set AltIRQ to do nothing routine so other IRQs |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
523 stx <D.AltIRQ can fall through to IOMan polling routine |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
524 andcc #^(IntMasks) re-enable interrupts |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
525 ldb <ScrChg,y check screen update request flag (cur screen) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
526 beq L0337 no update needed, skip ahead |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
527 lda V.TYPE,y device a window? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
528 bpl L032F no, must be VDGInt, so go on |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
529 lda G.GfBusy,u 0 = GrfDrv free, 1 = GrfDrv busy |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
530 ora G.WIBusy,u 0 = WindInt free, 1 = WindInt busy |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
531 bne L034F one of the two is busy, can't update, skip |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
532 *L032F lda #$00 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
533 L032F clra special function: select new active window |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
534 lbsr L05DA go execute co-module |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
535 clr <ScrChg,y clear screen change flag in device mem |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
536 * |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
537 * CHECK IF GFX/TEXT CURSORS NEED TO BE UPDATED |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
538 * G.GfBusy = 1 Grfdrv is busy processing something else |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
539 * G.WIBusy = 1 Windint is busy processing something else |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
540 * g0000 = # of clock ticks/cursor update constant (2) for 3 ticks: 2,1,0 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
541 * G.CntTik = current clock tick for cursor update |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
542 * |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
543 L0337 ldb G.CntTik,u get current clock tick count for cursor updates |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
544 beq L034F if 0, no update required |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
545 decb decrement the tick count |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
546 stb G.CntTik,u if still not 0, don't do update |
0 | 547 bne L034F |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
548 lda G.GfBusy,u get GrfDrv busy flag |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
549 ora G.WIBusy,u merge with WindInt busy flag |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
550 beq L034A if both not busy, go update cursors |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
551 inc G.CntTik,u otherwise bump tick count up again |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
552 bra L034F and don't update |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
553 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
554 L034A lda #$02 update cursors sub-function code |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
555 lbsr L05DA go update cursors through co-module |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
556 * Check for mouse update |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
557 L034F equ * |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
558 IFNE H6309 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
559 tim #KeyMse,<ULCase,u keyboard mouse? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
560 ELSE |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
561 lda <ULCase,u keyboard mouse? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
562 bita #KeyMse |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
563 ENDC |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
564 bne L0369 branch if so |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
565 lda <G.MSmpRt,u get # ticks until next mouse read |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
566 beq L0369 0 means shut off, don't bother |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
567 deca decrement # ticks |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
568 bne L0366 still not yet, save tick counter & skip mouse |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
569 pshs u,y,x save dev mem ptr and others |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
570 lbsr L0739 go update mouse packet |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
571 puls u,y,x restore regs |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
572 lda <G.MSmpRV,u get # ticks/mouse read reset value |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
573 L0366 sta <G.MSmpRt,u save updated tick count |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
574 * Check keyboard |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
575 L0369 equ * |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
576 IFNE H6309 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
577 clrd initialize keysense & same key flag |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
578 ELSE |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
579 clra |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
580 clrb |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
581 ENDC |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
582 std <G.KySns,u initialize keysense & same key flag |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
583 IFNE H6309 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
584 tim #KeyMse,>ULCase,u |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
585 ELSE |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
586 pshs a |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
587 lda >ULCase,u is the keyboard mouse enabled? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
588 bita #KeyMse |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
589 puls a |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
590 ENDC |
1327 | 591 beq L0381 no, try joystick |
592 ldx >WGlobal+G.KeyEnt else get ptr to keydrv | |
593 leau >G.KeyMem,u and ptr to its statics | |
594 jsr $06,x call into it | |
595 ldu <D.CCMem get ptr to CC mem | |
596 sta <G.KyButt,u save key button | |
597 L0381 ldx >WGlobal+G.JoyEnt get ptr to joydrv | |
598 leau >G.JoyMem,u and ptr to its statics | |
599 jsr $06,x get X/Y info | |
600 ldu <D.CCMem get ptr to CC mem | |
0 | 601 lda #$82 |
602 cmpb #$80 | |
603 beq L0397 | |
604 inca | |
605 cmpb #$C0 | |
606 bne L039C | |
607 L0397 inc <G.Clear,u | |
608 bra L03C8 | |
609 L039C tst $08,y | |
610 bpl L03A8 | |
611 bitb #$03 | |
612 beq L03A8 | |
613 lda #$0D | |
614 bra L03C8 | |
615 L03A8 lda <G.KyButt,u | |
616 lbsr L0229 | |
617 tstb | |
618 lbne L044E | |
619 pshs u,y,x | |
1327 | 620 ldx >WGlobal+G.KeyEnt |
1262 | 621 leau >G.KeyMem,u |
1327 | 622 jsr $09,x call Read Key routine |
0 | 623 puls u,y,x |
624 bpl L03C8 | |
625 clr <G.LastCh,u | |
626 lbra L044E | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
627 L03C8 cmpa <G.LastCh,u is current ASCII code same as last one pressed? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
628 bne L03DF no, no keyboard repeat, skip ahead |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
629 ldb <G.KyRept,u get repeat delay constant |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
630 beq L044E if keyboard repeat shut off, skip repeat code |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
631 decb repeat delay up? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
632 beq L03DA branch if so and reset |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
633 L03D5 stb <G.KyRept,u update delay |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
634 bra L044E return |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
635 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
636 L03DA ldb <G.KySpd,u get reset value for repeat delay |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
637 bra L03ED go update it |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
638 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
639 L03DF sta <G.LastCh,u store last keyboard character |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
640 ldb <G.KyDly,u get keyboard delay speed |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
641 tst <G.KySame,u same key as last time? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
642 bne L03D5 no, go reset repeat delay |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
643 ldb <G.KyDly,u get time remaining |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
644 L03ED stb <G.KyRept,u save updated repeat delay |
0 | 645 lbsr L017E |
646 beq L044E | |
647 ldb #$01 | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
648 stb >g00BF,u |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
649 ldu <G.CurDev,u get ptr to statics in U |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
650 ldb <EndPtr,u |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
651 leax >ReadBuf,u point to keyboard buffer |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
652 abx move to proper offset |
1262 | 653 incb inc keyboard buffer ptr |
654 bpl bumpdon2 hasn't wrapped, skip ahead | |
655 clrb reset pointer | |
656 * lbsr ChkWrap check for wrap-around | |
657 bumpdon2 cmpb <InpPtr,u same as start? | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
658 beq L0411 yep, go on |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
659 stb <EndPtr,u save updated pointer |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
660 L0411 sta ,x save key in buffer |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
661 beq L0431 go on if it was 0 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
662 * Check for special characters |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
663 cmpa V.PCHR,u pause character? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
664 bne L0421 no, keep checking |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
665 ldx V.DEV2,u is there an output path? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
666 beq L0443 no, wake up the process |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
667 sta V.PAUS,x set immediate pause request on device |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
668 bra L0443 wake up the process |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
669 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
670 L0421 ldb #S$Intrpt get signal code for key interrupt |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
671 cmpa V.INTR,u is key an interrupt? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
672 beq L042D branch if so (go send signal) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
673 ldb #S$Abort get signal code for key abort |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
674 cmpa V.QUIT,u is it a key abort? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
675 bne L0431 no, check data ready signal |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
676 L042D lda V.LPRC,u get last process ID |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
677 bra L0447 go send the signal |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
678 L0431 lda <SS.SigID,u send signal on data ready? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
679 beq L0443 no, just go wake up process |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
680 ldb <SS.SigSg,u else get signal code |
0 | 681 os9 F$Send |
682 bcs L044E | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
683 clr <SS.SigID,u clear signal ID |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
684 bra L044E return |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
685 L0443 ldb #S$Wake get signal code for wakeup |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
686 lda V.WAKE,u get process ID to wake up |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
687 L0447 beq L044E no process to wake, return |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
688 clr V.WAKE,u clear it |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
689 os9 F$Send send the signal |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
690 L044E ldu <D.CCMem get ptr to CC mem |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
691 lda <G.AutoMs,u auto mouse flag set? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
692 beq L046B branch if not |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
693 lda <G.MseMv,u get mouse moved flag |
0 | 694 ora <G.Mouse+Pt.CBSA,u |
695 beq L046B | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
696 lda G.GfBusy,u check for GrfDrv busy |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
697 ora G.WIBusy,u OR with WindInt busy |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
698 bne L046B branch if they are busy |
0 | 699 lda #$03 |
700 lbsr L05DA | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
701 clr <G.MseMv,u clear mouse move flag |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
702 L046B orcc #IntMasks mask interrupts |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
703 leax >CC3Irq,pcr get CC3Irq vector |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
704 stx <D.AltIRQ and store in AltIRQ |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
705 rts return |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
706 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
707 * Point to end of device table |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
708 L0474 stb $06,s save # bytes to next (neg or pos) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
709 ldx <D.Init get pointer to init module |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
710 lda DevCnt,x get max # of devices allowed |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
711 ldb #DEVSIZ get size of each device table entry |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
712 mul calculate total size of device table |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
713 ldy <D.DevTbl get device table ptr |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
714 leax d,y point X to end of devtable + 1 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
715 stx $07,s save the ptr & return |
0 | 716 rts |
717 | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
718 * CLEAR processor |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
719 L0485 pshs u,y,x,b,a preserve registers |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
720 leas <-$11,s make a buffer on stack |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
721 ldb #DEVSIZ get # of bytes to move to next entry (forward) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
722 bsr L0474 get pointer to devtable |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
723 stx $09,s save end of devtable |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
724 sty $07,s save beginning of devtable |
0 | 725 bra L04A7 |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
726 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
727 * Shift-CLEAR processor |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
728 shftclr pshs u,y,x,b,a preserve registers |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
729 leas <-$11,s make a buffer on the stack |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
730 ldb #-DEVSIZ # of bytes to move next entry (backwards) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
731 bsr L0474 make ptrs to devtable |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
732 leay -DEVSIZ,y bump Y back by 1 entry (for start of loop) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
733 sty $09,s save it |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
734 leax -DEVSIZ,x bump X back for start of loop |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
735 stx $07,s save it |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
736 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
737 * NOTE: SS.OPEN for current window has changed V.PORT to be the ptr to the |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
738 * current window's entry in the device table |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
739 * Stack: (all offsets in decimal) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
740 * 4,s : # bytes to next entry in table (signed #) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
741 * 5-6,s : Ptr to end of device table + 1 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
742 * 7-8,s : Start of search ptr (if backwards, -1 entry) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
743 * 9-10,s : End of search ptr (if backwards, -1 entry) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
744 * 11-12,s : Ptr to the current device's device table entry |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
745 * 13-14,s : Ptr to current device's driver |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
746 * 15-16,s : Ptr to the device table entry we are currently checking |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
747 * |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
748 L04A7 ldx <D.CCMem get ptr to CC mem |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
749 ldu <$20,x get active device's static mem ptr |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
750 lbeq L0546 if none (no screens), exit without error |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
751 ldx V.PORT,u get device table ptr for current device |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
752 stx $0B,s save it on stack |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
753 stx $0F,s save as default we are checking |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
754 ldd V$DRIV,x get ptr to current device driver's module |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
755 std $0D,s save it on stack |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
756 * Main search loop |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
757 L04BA ldx $0F,s get ptr to device tbl entry we are checking |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
758 L04BC ldb $04,s get # of bytes to next entry (signed) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
759 leax b,x point to next entry (signed add) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
760 cmpx $09,s did we hit end of search table? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
761 bne L04C6 no, go check if it is a screen device |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
762 ldx $07,s otherwise wrap around to start of search ptr |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
763 * Check device table entry (any entry we can switch to has to have CC3IO as |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
764 * the driver) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
765 L04C6 stx $0F,s save new device table ptr we are checking |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
766 ldd V$DRIV,x get ptr to driver |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
767 cmpd $0D,s same driver as us? (CC3IO) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
768 bne L04BC no, try next one |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
769 ldu $02,x get ptr to static storage for tbl entry |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
770 beq L04BC there is none, try next one |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
771 cmpx $0B,s is this our own (have we come full circle)? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
772 beq L0541 yes, obviously nowhere else to switch to |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
773 * Found an initialized device controlled by CC3Io that is not current device |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
774 lda <InfVld,u is the extra window data in static mem valid? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
775 beq L04BA no, not good enough, try next one |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
776 ldx <V.PDLHd,u get ptr to list of open paths on device |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
777 beq L0536 no open paths, so switch to that device |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
778 lda V.LPRC,u get last active process ID # that used device |
0 | 779 beq L0536 |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
780 * Path's open to device & there is a last process # for that path |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
781 ldy <D.PrcDBT get process descriptor table ptr |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
782 lda a,y get MSB of ptr to process descriptor last on it |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
783 beq L0536 process now gone, so switch to device |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
784 clrb move process desc ptr to Y |
0 | 785 tfr d,y |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
786 lda >P$SelP,y get the path # that outputs to the window |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
787 leay <P$Path,y move to the path table local to the process |
0 | 788 sta ,s |
789 pshs x | |
790 L04FA ldb #$10 | |
791 lda ,x | |
792 L04FE decb | |
793 cmpa b,y | |
794 beq L050F | |
795 tstb | |
796 bne L04FE | |
797 ldx <$3D,x | |
798 bne L04FA | |
799 puls x | |
800 bra L0536 | |
801 L050F puls x | |
802 lda ,s | |
803 L0513 sta ,s | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
804 cmpa #$02 is selected path one of the 3 std paths? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
805 bhi L051F not one of the std 3 paths, skip ahead |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
806 ldb #$02 standard error path |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
807 lda b,y get system path # for local error path |
0 | 808 bra L0522 |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
809 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
810 L051F lda a,y get system path # for local path |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
811 clrb standard in |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
812 * X=Ptr to linked list of open paths on device |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
813 * A=System path # |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
814 * B=Local (to process) path # |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
815 * Check if any paths to device are open, if they are we can switch to it |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
816 L0522 cmpa ,x path we are checking same as path already open |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
817 beq L0536 on device? yes, go switch to it |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
818 decb bump local path # down |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
819 bmi L052D if no more paths to check, skip ahead |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
820 lda b,y get system path # for new local path to check |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
821 bra L0522 check if it is already open on device |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
822 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
823 L052D lda ,s get local path # we started on |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
824 ldx <PD.PLP,x get ptr to path dsc. list (linked list) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
825 bne L0513 there is no path desc list, try next path |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
826 bra L04BA can't switch to it, go to next device tbl entry |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
827 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
828 L0536 ldx <D.CCMem get ptr to CC mem |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
829 stu <G.CurDev,x save new active device |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
830 clr g000A,x flag that we are not on active device anymore |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
831 clr >g00BF,x clear WindInt's key was pressed flag (new window) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
832 * If there is only one window, it comes here to allow the text/mouse cursors |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
833 * to blink so you know you hit CLEAR or SHIFT-CLEAR |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
834 L0541 inc <ScrChg,u flag device for a screen change |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
835 bsr setmouse check mouse |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
836 L0546 leas <$11,s purge stack buffer |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
837 clrb clear carry |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
838 puls pc,u,y,x,b,a restore regs and return |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
839 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
840 * Initialize mouse |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
841 setmouse pshs x save register used |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
842 ldd <MS.Smpl,u get sample and timeout |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
843 ldx <D.CCMem get ptr to CC mem |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
844 sta <G.MSmpRt,x set sample tick count |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
845 sta <G.MSmpRV,x set sample rate |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
846 stb <G.Mouse+Pt.ToTm,x set timeout constant in mouse packet |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
847 ldd <MS.Side,u get mouse side to use |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
848 sta <G.KyMse,x set it |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
849 stb <G.AutoMs,x |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
850 lda V.TYPE,u get device type |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
851 sta g000B,x set it |
0 | 852 clra |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
853 puls pc,x restore and return |
0 | 854 |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
855 Write ldb <ParmCnt,u are we in the process of getting parameters? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
856 lbne L0600 yes, go process |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
857 sta <DevPar,u save off character |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
858 cmpa #C$SPAC space or higher? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
859 bcc L058E yes, normal write |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
860 cmpa #$1E 1E escape code? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
861 bcc L05EF yes, go process |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
862 cmpa #$1B $1B escape code? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
863 beq L05F3 yes, go handle it |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
864 cmpa #$05 $05 escape code? (cursor on/off) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
865 beq L05F3 yep, go handle it |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
866 cmpa #C$BELL Bell? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
867 bne L058E no, control char |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
868 jmp [>WGlobal+G.BelVec] for whom the bell tolls... |
0 | 869 |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
870 L058E ldb #$03 write entry point in co-module |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
871 L0590 lda <DevPar,u get character stored earlier |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
872 L0593 ldx <D.CCMem get ptr to CC mem |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
873 stu G.CurDvM,x save dev mem ptr for current device |
0 | 874 L0597 pshs a |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
875 leax <G.CoTble,x point to co-module entry vectors |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
876 lda <WinType,u get window type from device mem |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
877 ldx a,x get vector to proper co-module |
0 | 878 puls a |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
879 beq L05EB vector empty, exit with module not found |
0 | 880 leax b,x |
881 bsr L05C0 | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
882 ldb <WinType,u |
0 | 883 beq L05B4 |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
884 jsr ,x go execute co-module |
0 | 885 L05B0 pshs cc |
886 bra L05BB | |
887 L05B4 jsr ,x | |
888 L05B6 pshs cc | |
889 clr >WGlobal+G.WIBusy | |
890 L05BB clr >WGlobal+G.CrDvFl | |
891 puls pc,cc | |
892 | |
893 L05C0 pshs x,b | |
1262 | 894 ldx <D.CCMem get ptr to CC mem |
895 clr G.WIBusy,x clear WindInt busy flag | |
896 ldb <WinType,u get window type (0 = WindInt) | |
897 bne L05CE branch if VDGInt | |
898 incb else make B = 1 | |
899 stb G.WIBusy,x and make WindInt busy | |
900 L05CE clr G.CrDvFl,x clear 'we are current device' | |
0 | 901 cmpu <G.CurDev,x |
902 bne L05D8 | |
903 inc g000A,x | |
904 L05D8 puls pc,x,b | |
905 | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
906 * U = ptr to CC memory |
0 | 907 L05DA pshs u,y,x |
1262 | 908 ldu <G.CurDev,u get ptr to curr dev mem |
0 | 909 L05DF ldb #$0F |
1262 | 910 ldx <D.CCMem get ptr to CC memory in X |
0 | 911 bsr L0597 |
1262 | 912 puls pc,u,y,x restore regs and return |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
913 |
1262 | 914 L05E7 pshs u,y,x save regs |
0 | 915 bra L05DF |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
916 |
0 | 917 L05EB comb |
918 ldb #E$MNF | |
919 rts | |
920 | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
921 * $1E & $1F codes go here |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
922 L05EF cmpa #$1E $1E code? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
923 beq Do1E branch if so |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
924 * $1F codes fall through to here |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
925 * Escape code handler : Initial code handled by CC3IO, any parameters past |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
926 * $1B xx are handled by co-module later |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
927 * NOTE: Notice that is does NOT update <DevPar,u to contain the param byte, |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
928 * but leaves the initial <ESC> ($1b) code there. The co-module checks it |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
929 * to see it as an ESC, and then checks for the first parameter byte for the |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
930 * required action. |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
931 L05F3 leax <L058E,pcr point to parameter vector entry point |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
932 ldb #$01 get parameter count (need 1 to determine code) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
933 stx <ParmVct,u save vector |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
934 stb <ParmCnt,u save # param bytes needed before exec'ing vect. |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
935 Do1E clrb no error |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
936 rts return |
0 | 937 |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
938 * Processing parameters |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
939 * A=parameter byte from SCF |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
940 * B=# parameter bytes left (not including one in A) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
941 * U=device mem ptr |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
942 L0600 ldx <NxtPrm,u get ptr of where to put next param byte |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
943 sta ,x+ put it there |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
944 stx <NxtPrm,u update pointer |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
945 decb decrement parameter count |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
946 stb <ParmCnt,u update it |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
947 bne Do1E if still more to get, exit without error |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
948 * B=0, flag to say we are not current device |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
949 * We have all parameter bytes we need at this point. |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
950 ldx <D.CCMem get ptr to CC mem |
0 | 951 bsr L05C0 |
952 stu G.CurDvM,x | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
953 ldx <PrmStrt,u reset next param ptr to start |
1261 | 954 stx <NxtPrm,u |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
955 ldb <WinType,u is this device using WindInt? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
956 beq L0624 yes, special processing for WindInt |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
957 jsr [<ParmVct,u] go execute parameter handler |
0 | 958 bra L05B0 |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
959 L0624 jsr [<ParmVct,u] |
0 | 960 bra L05B6 |
961 | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
962 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
963 * GetStat |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
964 * |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
965 * Entry: |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
966 * A = function code |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
967 * Y = address of path descriptor |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
968 * U = address of device memory area |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
969 * |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
970 * Exit: |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
971 * CC = carry set on error |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
972 * B = error code |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
973 * |
0 | 974 GetStat cmpa #SS.EOF |
975 beq SSEOF | |
976 ldx PD.RGS,y | |
977 cmpa #SS.ComSt | |
978 beq GSComSt | |
979 cmpa #SS.Joy | |
980 beq GSJoy | |
981 cmpa #SS.Mouse | |
982 lbeq GSMouse | |
983 cmpa #SS.Ready | |
984 beq GSReady | |
985 cmpa #SS.KySns | |
986 beq GSKySns | |
987 cmpa #SS.Montr | |
988 beq GSMontr | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
989 ldb #$06 carry over to co-module |
0 | 990 lbra L0593 |
991 | |
992 * SS.ComSt - get baud/parity info | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
993 GSComSt lda V.TYPE,u get device type |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
994 clrb clear parity, etc. |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
995 std R$Y,x save it in register stack |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
996 rts return |
0 | 997 |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
998 GSReady ldb <EndPtr,u get input buffer end pointer |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
999 cmpb <InpPtr,u anything there? |
1261 | 1000 beq NotReady nope, exit with error |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1001 bhi L0660 higher? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1002 addb #$80 nope, add 128 to count |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1003 L0660 subb <InpPtr,u calculate number of characters there |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1004 stb R$B,x save it in register stack |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1005 SSEOF clrb clear errors |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1006 rts return |
1261 | 1007 NotReady comb set carry |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1008 ldb #E$NotRdy get error code |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1009 rts return |
0 | 1010 |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1011 * Return special key status |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1012 * X = pointer to caller's register stack |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1013 GSKySns ldy <D.CCMem get ptr to CC mem |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1014 clrb clear key code |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1015 cmpu <G.CurDev,y are we the active device? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1016 bne L0678 branch if not |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1017 ldb <G.KySns,y get key codes |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1018 L0678 stb R$A,x save to caller reg |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1019 clrb clear errors |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1020 rts return |
0 | 1021 |
1022 * GetStat: SS.Montr (get Monitor type) | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1023 * X = pointer to caller's register stack |
0 | 1024 GSMontr ldb >WGlobal+G.MonTyp get monitor type |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1025 * tfr b,a put in A |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1026 clra |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1027 std R$X,x save in caller's X |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1028 rts return |
0 | 1029 |
1030 * GetStat: SS.JOY (get joystick X/Y/button values) | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1031 * X = pointer to caller's register stack |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1032 GSJoy clrb default to no errors |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1033 tfr x,y transfer caller's registers to Y |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1034 ldx <D.CCMem get ptr to CC mem |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1035 cmpu <G.CurDev,x are we the current active device? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1036 beq GetJoy if so, go read joysticks |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1037 clra else D = 0 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1038 std R$X,y X pos = 0 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1039 std R$Y,y Y pos = 0 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1040 sta R$A,y no buttons held down |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1041 rts return |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1042 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1043 * Get button status first |
1261 | 1044 GetJoy ldx >WGlobal+G.JoyEnt $10EA |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1045 pshs u save driver static |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1046 ldu <D.CCMem get ptr to CC mem |
1262 | 1047 leau >G.JoyMem,u point to subroutine module's static mem |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1048 jsr $0C,x call entry point to get button |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1049 * Joysticks button states returned in B |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1050 puls u restore driver static |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1051 lda R$X+1,y left or right? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1052 beq L06AB branch if right joystick |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1053 lsrb shift over so same range as if right joystick |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1054 L06AB andb #$05 preserve button bits |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1055 lsrb button 1 down? (shifts button 2 to bit 2 too) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1056 bcc L06B2 no, go on |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1057 orb #$01 turn on button 1 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1058 L06B2 stb R$A,y save button status to caller |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1059 * |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1060 * Now get actual joystick values (note: IRQs still off) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1061 * |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1062 pshs y save ptr to caller's regs |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1063 lda R$X+1,y get switch to indicate left or right joystick |
0 | 1064 inca |
1065 ldy #$0000 | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1066 pshs u save driver static mem |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1067 ldu <D.CCMem get ptr to CC mem |
1261 | 1068 ldx >WGlobal+G.JoyEnt $10EA get address of joystick sub module |
1262 | 1069 leau >G.JoyMem,u get ptr to sub module's static mem |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1070 jsr $0F,x call routine in sub module to get joy X/Y |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1071 * X = joystick X pos, Y = joystick Y pos |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1072 puls u restore driver static mem |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1073 pshs y save joystick Y |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1074 ldy $02,s get ptr to caller's regs |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1075 stx R$X,y save joystick X in caller's X |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1076 ldd #63 |
0 | 1077 subd ,s++ |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1078 std R$Y,y save joystick Y in caller's Y |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1079 clrb cleary carry |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1080 puls pc,y return |
0 | 1081 |
1082 * GetStat: SS.Mouse (get mouse info) | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1083 * X = pointer to caller's register stack |
0 | 1084 GSMouse pshs u,y,x |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1085 ldx <D.CCMem get ptr to CC mem |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1086 cmpu <G.CurDev,x is caller in current window? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1087 beq L06FA branch if so |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1088 ldy ,s get ptr to caller's regs |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1089 ldb #Pt.Siz size of packet |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1090 L06EC clr ,-s make room on stack |
0 | 1091 decb |
1092 bne L06EC | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1093 leax ,s point X to temp mouse buffer on stack |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1094 bsr MovMsPkt |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1095 leas <Pt.Siz,s clean up stack |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1096 puls pc,u,y,x and return |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1097 |
0 | 1098 * here the caller is in the current window |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1099 L06FA tst <G.KyMse,x mouse keyboard active? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1100 bne L071A branch if so |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1101 lda <G.MSmpRV,x ready to sample? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1102 bne L071A no, return packet |
0 | 1103 pshs u,y,x |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1104 bsr L073B read external mouse |
0 | 1105 puls u,y,x |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1106 lda <G.AutoMs,x get automouse flag |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1107 anda <G.MseMv,x has mouse moved? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1108 beq L071A no, return packet |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1109 lda #$03 update auto-follow mouse sub-function call |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1110 lbsr L05E7 call co-module to update mouse |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1111 clr <G.MseMv,x flag that the mouse hasn't moved |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1112 L071A lda #$01 'special' co-mod function code: move mouse packet? |
0 | 1113 lbsr L05E7 |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1114 leax <G.Mouse,x move X to point to mouse packet |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1115 ldy ,s get register stack pointer |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1116 bsr MovMsPkt move packet to caller |
0 | 1117 puls pc,u,y,x |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1118 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1119 * Move mouse packet to process |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1120 * Y = ptr to caller's register stack |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1121 MovMsPkt ldu R$X,y get destination pointer |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1122 ldy <D.Proc get process descriptor pointer |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1123 ldb P$Task,y get destination task number |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1124 clra get source task number |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1125 ldy #Pt.Siz get length of packet |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1126 os9 F$Move move it to the process |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1127 rts return |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1128 |
0 | 1129 L0739 ldx <D.CCMem |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1130 L073B leax <G.Mouse,x move X to mouse packet |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1131 clra clear MSB of mouse resolution |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1132 ldb <Pt.Res,x get resolution (0 = lores, 1 = hires) |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1133 tfr d,y move mouse res to Y |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1134 lda Pt.Actv,x get mouse side |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1135 pshs u,y,x,b,a preserve regs |
1261 | 1136 ldx >WGlobal+G.JoyEnt $10EA get ptr to mouse sub module |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1137 ldu <D.CCMem get mem pointer |
1262 | 1138 leau >G.JoyMem,u and point to mouse sub module statics |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1139 jsr $09,x get data |
0 | 1140 pshs y,x |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1141 ldx $06,s get ptr to mouse packet in CC mem |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1142 puls b,a get X value into D |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1143 leay <Pt.AcX,x point X to mouse X/Y in mouse packet |
0 | 1144 bsr L0764 |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1145 puls b,a get Y value into D |
0 | 1146 bsr L0764 |
1147 puls pc,u,y,x,b,a | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1148 * X = Address of G.Mouse in D.CCMem |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1149 L0764 cmpd ,y++ compare mouse's current X to Pt.AcX |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1150 beq L0770 branch if same |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1151 std -$02,y else store new X into Pt.AcX |
0 | 1152 lda #$01 |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1153 sta <(G.MseMv-G.Mouse),x update mouse moved flag |
0 | 1154 L0770 rts |
1155 | |
1261 | 1156 SSTone ldx >WGlobal+G.SndEnt $10F4 get address of sound sub module |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1157 jmp $06,x go execute routine in sub module |
0 | 1158 |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1159 * Animate Palette? This obviously isn't implemented yet |
1261 | 1160 SSAnPal ldx >WGlobal+G.SndEnt $10F4 |
0 | 1161 jmp $09,x |
1162 | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1163 * SetStat |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1164 * |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1165 * Entry: |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1166 * A = function code |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1167 * Y = address of path descriptor |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1168 * U = address of device memory area |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1169 * |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1170 * Exit: |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1171 * CC = carry set on error |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1172 * B = error code |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1173 * |
0 | 1174 SetStat ldx PD.RGS,y |
1175 cmpa #SS.ComSt | |
1176 lbeq SSComSt | |
1177 cmpa #SS.Montr | |
1178 lbeq SSMontr | |
1179 cmpa #SS.KySns | |
1180 lbeq SSKySns | |
1181 cmpa #SS.Tone | |
1182 beq SSTone | |
1183 cmpa #SS.AnPal | |
1184 beq SSAnPal | |
1185 cmpa #SS.SSig | |
1186 beq SSSig | |
1187 cmpa #SS.MsSig | |
1188 beq SSMsSig | |
1189 cmpa #SS.Relea | |
1190 beq SSRelea | |
1191 cmpa #SS.Mouse | |
1192 beq SSMouse | |
1193 cmpa #SS.GIP | |
1194 lbeq SSGIP | |
1195 cmpa #SS.Open | |
1196 bne L07B5 | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1197 SSOpen ldx PD.DEV,y get device table entry |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1198 stx V.PORT,u save it as port address |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1199 L07B5 ldb #$09 call setstt entry point in co-module |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1200 lbra L0593 go do it |
0 | 1201 |
1202 * SS.SSig - send signal on data ready | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1203 SSSig pshs cc save interrupt status |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1204 * The next line doesn't exist in the NitrOS version |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1205 * clr <SS.SigID,u |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1206 lda <InpPtr,u get input buffer pointer |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1207 suba <EndPtr,u get how many chars are there |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1208 pshs a save it temporarily |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1209 bsr L07EC get current process ID |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1210 tst ,s+ anything in buffer? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1211 bne L07F7 yes, go send the signal |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1212 std <SS.SigID,u save process ID & signal |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1213 puls pc,cc restore interrupts & return |
0 | 1214 |
1215 * SS.MsSig - send signal on mouse button | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1216 SSMsSig pshs cc save interrupt status |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1217 * The next line doesn't exist in the NitrOS version |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1218 * clr <MS.SigID,u |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1219 bsr L07EC get process ID |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1220 ldx <D.CCMem get ptr to CC mem |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1221 cmpu <G.CurDev,x are we active device? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1222 bne L07E7 no, save ID & signal |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1223 tst >G.MsSig,x has button been down? |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1224 bne L07F3 yes, go send the signal |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1225 L07E7 std <MS.SigID,u save ID & signal code |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1226 puls pc,cc restore interrupts & return |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1227 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1228 L07EC orcc #IntMasks disable interrupts |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1229 lda PD.CPR,y get curr proc # |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1230 ldb R$X+1,x get user signal code |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1231 rts return |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1232 |
1262 | 1233 L07F3 clr >G.MsSig,x clear mouse button down flag |
1234 L07F7 puls cc restore interrupts | |
1235 os9 F$Send send the signal | |
1236 rts return | |
0 | 1237 |
1238 * SS.Relea - release a path from SS.SSig | |
1262 | 1239 SSRelea lda PD.CPR,y get curr proc # |
1240 cmpa <SS.SigID,u same as keyboard? | |
1241 bne L0807 branch if not | |
1242 clr <SS.SigID,u clear process ID | |
1243 L0807 cmpa <MS.SigID,u same as mouse? | |
1244 bne L0871 no, return | |
1245 clr <MS.SigID,u else clear process ID | |
1246 rts return | |
0 | 1247 |
1248 * SS.Mouse - set mouse sample rate and button timeout | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1249 * NOTE: Default mouse params @ $28,u are $0078 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1250 * It modifies the static mem variables (for caller's window) first, and |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1251 * then modifies global memory only if we are the current active device. |
1262 | 1252 SSMouse ldd R$X,x get sample rate & timeout from caller |
1253 cmpa #$FF sample rate 256? | |
1254 beq L0819 yes, can't have it so go on | |
1255 sta <MS.Smpl,u save new timeout | |
1256 L0819 cmpb #$FF timeout 256? | |
1257 beq L0820 yes, can't have it so go on | |
1258 stb <MS.Time,u save new timeout | |
1259 L0820 ldb R$Y+1,x get auto-follow flag | |
1260 stb <MS.Side,u save it | |
1261 ldy <D.CCMem get ptr to CC mem | |
1262 cmpu <G.CurDev,y are we current device? | |
1263 bne L083D no, exit without error | |
1264 stb <G.AutoMs,y save auto-follow flag for this dev | |
1265 ldd <MS.Smpl,u get sample rate/timeout | |
1266 sta <G.MSmpRV,y save it (reset value) | |
1267 sta <G.MSmpRt,y save it (current value) | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1268 stb <G.Mouse+Pt.ToTm,y save timeout too |
1262 | 1269 L083D clrb exit without error |
0 | 1270 rts |
1271 | |
1272 * SS.GIP | |
1262 | 1273 SSGIP ldy <D.CCMem get ptr to CC mem |
1274 cmpu <G.CurDev,y current window? | |
1275 bne L0866 branch if not | |
1276 ldd R$Y,x get caller's Y (key repeat info) | |
1277 cmpd #$FFFF unchanged? | |
1278 beq L0853 yes, don't change current key info | |
1279 std <G.KyDly,y else save key delay and speed info | |
1280 L0853 ldd R$X,x get mouse info | |
1281 cmpa #$01 set for hi res adapter? | |
1282 bgt L088F branch to error if greater | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1283 sta <G.Mouse+Pt.Res,y save new resolution value |
0 | 1284 * B = mouse port (1 = right, 2 = left) |
1262 | 1285 tstb side above legal value? |
1286 beq L088F no, exit with error | |
1287 cmpb #$02 side below legal value? | |
1288 bgt L088F no, exit with error | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1289 stb <G.Mouse+Pt.Actv,y save new side |
1262 | 1290 L0866 clrb clear errors |
1291 rts and return | |
0 | 1292 |
1293 * SS.KySns - setstat??? | |
1262 | 1294 SSKySns ldd R$X,x get monitor type requested |
1295 beq L086E below legal value? | |
1296 ldb #$FF no, exit with error | |
1297 L086E stb <KySnsFlg,u save new sense mode | |
1298 L0871 clrb clear errors | |
1299 rts return | |
0 | 1300 |
1301 * SS.Montr - change monitor type | |
1262 | 1302 SSMontr ldd R$X,x get monitor type requested |
1303 cmpd #$0002 below legal value? | |
1304 bhi L088F no, exit with error | |
1305 lda <D.VIDMD get current GIME video mode register | |
1306 anda #$EF get rid of monochrome bit | |
1307 bitb #$02 mono requested? | |
1308 beq L0885 no, keep checking | |
1309 ora #$10 switch to monochrome | |
1310 L0885 sta <D.VIDMD update video mode register | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1311 stb >WGlobal+G.MonTyp save new monitor type |
1262 | 1312 inc <ScrChg,u flag a screen change |
1313 clrb clear errors | |
1314 rts return | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1315 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1316 * Illegal argument error handler |
1262 | 1317 L088F comb set carry for error |
1318 ldb #E$IllArg get illegal argument error code | |
1319 rts return with it | |
0 | 1320 |
1321 * SS.ComSt - set baud/parity params | |
1262 | 1322 SSComSt ldd R$Y,x get requested window type |
1323 eora V.TYPE,u same type as now? | |
1324 anda #$80 trying to flip from window to VDG? | |
1325 bne L088F yes, error | |
1326 lda R$Y,x no, get requested window type again | |
1327 bsr L08AA go make sure co-module for new type exists | |
1328 lbcc L07B5 carry it over to co-module | |
1329 rts return | |
0 | 1330 |
1331 VDGInt fcs /VDGInt/ | |
1332 | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1333 * |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1334 * Link to proper co-module |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1335 * Try VDGInt first |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1336 * |
1262 | 1337 L08AA sta V.TYPE,u save new type |
1338 bmi L08C3 if hi-bit if A is set, we're a window | |
1339 pshs u,y,a ..else VDG | |
1340 lda #$02 get code for VDG type window | |
1341 sta <WinType,u save it | |
1342 leax <VDGInt,pcr point to VDGInt name | |
1343 bsr L08D4 link to it if it exists | |
1344 puls pc,u,y,a restore regs & return | |
0 | 1345 |
1346 WindInt fcs /WindInt/ | |
1347 | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1348 * |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1349 * Try WindInt |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1350 * |
1262 | 1351 L08C3 pshs u,y preserve regs |
1352 clra set window type | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1353 sta <WinType,u |
1262 | 1354 leax <WindInt,pcr point to WindInt name |
1355 lda #$80 get driver type code | |
1356 bsr L08D4 try and link it | |
1357 puls pc,u,y restore regs and return | |
0 | 1358 L08D2 clrb |
1359 rts | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1360 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1361 * |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1362 * Check if co-module is in memory |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1363 * |
1262 | 1364 L08D4 ldb <PrmStrt,u any parameter vector? |
1365 bne L08D2 no, return | |
1366 pshs u save statics | |
1367 ldu <D.CCMem get ptr to CC mem | |
1368 bita <G.BCFFlg,u BCFFlg already linked? | |
1369 puls u restore statics | |
1370 bne L0900 yes, initialize co-module | |
1371 tsta Window type device? | |
1372 bpl L08E8 no, go on | |
1373 clra set co-module vector offset for window | |
1374 L08E8 pshs y,a preserve registers | |
1375 bsr L0905 try and link module | |
1376 bcc L08F0 we linked it, go on | |
1377 puls pc,y,a restore registers & return error | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1378 |
1262 | 1379 L08F0 puls a restore vector offset |
1380 ldx <D.CCMem get ptr to CC mem | |
1381 leax <G.CoTble,x point to vector offsets | |
1382 sty a,x store co-module entry vector | |
1383 puls y restore path descriptor pointer | |
1384 cmpa #$02 was it WindInt? | |
1385 bgt L08D2 no, return | |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1386 *L0900 ldb #$00 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1387 L0900 clrb |
1262 | 1388 lbra L0590 send it to co-module |
1259
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1389 |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1390 * |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1391 * Link or load a co-module |
d0e7200c1279
Working over for NitrOS-9 optimizations -- still buggy
boisy
parents:
705
diff
changeset
|
1392 * |
1262 | 1393 L0905 ldd <D.Proc get current process descriptor pointer |
1394 pshs u,x,b,a preserve it along with registers | |
1395 ldd <D.SysPrc get system process descriptor pointer | |
1396 std <D.Proc save it as current process | |
1397 lda #Systm+Objct get codes for link | |
1398 os9 F$Link link to it | |
1399 ldx $02,s get name pointer | |
1400 bcc L091B does module exist? | |
1401 ldu <D.SysPrc no, get system process descriptor pointer | |
1402 os9 F$Load load it | |
1403 L091B puls u,x,b,a restore regs | |
1404 std <D.Proc restore current process descriptor | |
1405 lbcs L05EB exit if error from load or link | |
1406 rts return | |
0 | 1407 |
1408 emod | |
1409 eom equ * | |
1410 end | |
1411 |