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