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