annotate level2/modules/cc3io.asm @ 1746:5469aad825d7

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