annotate level2/modules/joydrv_6552L.asm @ 1938:14e43c3ec661

Reset editions
author boisy
date Sat, 26 Nov 2005 22:07:06 +0000
parents 205b4fbc08cd
children 5daef7cf8a1b
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 * JoyDrv - Joystick Driver for 6552/Logitech Mouse
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 *
1263
205b4fbc08cd Fixed comments, revs to zero
boisy
parents: 0
diff changeset
6 * Edt/Rev YYYY/MM/DD Modified by
205b4fbc08cd Fixed comments, revs to zero
boisy
parents: 0
diff changeset
7 * Comment
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
8 * ------------------------------------------------------------------
1263
205b4fbc08cd Fixed comments, revs to zero
boisy
parents: 0
diff changeset
9 * 6 1988/??/??
205b4fbc08cd Fixed comments, revs to zero
boisy
parents: 0
diff changeset
10 * L2 Upgrade distribution version.
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
11
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
12 nam JoyDrv
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
13 ttl Joystick Driver for 6552/Logitech Mouse
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
14
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
15 * Disassembled 98/09/09 09:22:44 by Disasm v1.6 (C) 1988 by RML
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
16
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17 ifp1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18 use defsfile
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19 use l52.defs
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
20 endc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
21
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
22 tylg set Systm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
23 atrv set ReEnt+rev
1263
205b4fbc08cd Fixed comments, revs to zero
boisy
parents: 0
diff changeset
24 rev set $00
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
25 edition set 6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
26
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
27 MPISlot set $00
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
28
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
29 mod eom,name,tylg,atrv,start,$FF64
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
30
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
31 name fcs /JoyDrv/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
32 fcb edition
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
33
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
34 start lbra Init
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
35 lbra Term
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
36 lbra SSMsBtn
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
37 lbra SSMsXY
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
38 lbra SSJoyBtn
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
39
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
40 SlotSlct equ MPISlot
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
41
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
42 SSJoyXY pshs x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
43 ldx #PIA0Base
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
44 lda <$23,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
45 ldb <$20,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
46 pshs b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
47 anda #$F7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
48 sta <$23,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
49 lda $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
50 ldb $03,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
51 pshs b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
52 andb #$F7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
53 lsr $04,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
54 bcs L0043
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
55 orb #$08
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
56 L0043 stb $03,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
57 lda ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
58 ora #$08
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
59 bsr L0065
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
60 std $06,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
61 lda ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
62 anda #$F7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
63 bsr L0065
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
64 std $04,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
65 puls b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
66 sta $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
67 stb $03,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
68 puls b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
69 stb <$20,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
70 sta <$23,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
71 puls pc,y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
72 L0065 sta $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
73 lda #$7F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
74 ldb #$40
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
75 bra L0078
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
76 L006D lsrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
77 cmpb #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
78 bhi L0078
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
79 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
80 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
81 tfr a,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
82 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
83 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
84 L0078 pshs b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
85 sta <$20,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
86 tst ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
87 bpl L0085
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
88 adda ,s+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
89 bra L006D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
90 L0085 suba ,s+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
91 bra L006D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
92
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
93 IRQPckt equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
94 Pkt.Flip fcb $00 D.Poll flip byte
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
95 Pkt.Mask fcb $07 D.Poll mask byte
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
96 fcb $01 priority
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
97
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
98 Init clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
99 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
100 sta Btn.Cntr,u set up Rx data sync, no button(s) pressed
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
101 std CrntXPos,u set up X position at left screen edge
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
102 ldd #HResMaxY*2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
103 std CrntYPos,u set up Y position at top screen edge
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
104 ldd M$Mem,pcr get base hardware address
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
105 leax IRQPckt,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
106 leay IRQSvc,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
107 os9 F$IRQ
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
108 bcs InitExit go report error...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
109 tfr d,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
110 ldd #$46E0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
111 pshs cc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
112 orcc #IntMasks disable IRQs while setting up hardware
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
113 sta 1,x reset 6552
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
114 stb 1,x reset 6552
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
115 clr 2,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
116 lda >PIA1Base+3 get PIA CART* input control register
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
117 anda #$FC clear PIA CART* control bits
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
118 sta >PIA1Base+3 disable PIA CART* FIRQs
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
119 lda >PIA1Base+2 clear possible pending PIA CART* FIRQ
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
120 ldd #$0187 GIME CART* IRQ enable
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
121 ora <D.IRQER mask in current GIME IRQ enables
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
122 sta <D.IRQER save GIME CART* IRQ enable shadow register
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
123 sta >IrqEnR enable GIME CART* IRQs
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
124 stb ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
125 ldb 3,x *ensure old error,
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
126 ldb ,x *Rx data, and
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
127 ldb 3,x *IRQ flags
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
128 ldb ,x *are clear
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
129 andb Pkt.Mask,pcr IRQ bits still set?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
130 bne InitErr yes, go disable ACIA and return...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
131 lda SlotSlct,pcr get MPI slot select value
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
132 bmi InitExit no MPI slot select, go exit...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
133 sta >MPI.Slct set MPI slot select register
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
134 puls pc,cc recover original regs, return...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
135
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
136 Term pshs cc save regs we alter
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
137 orcc #IntMasks mask IRQs while disabling ACIA
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
138 InitErr ldx M$Mem,pcr get base address
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
139 lda #$7F *disable all
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
140 sta ,x *ACIA IRQs
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
141 puls cc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
142 tfr x,d copy status register address
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
143 ldx #$0000 remove IRQ table entry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
144 leay IRQSvc,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
145 os9 F$IRQ
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
146 InitExit rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
147
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
148 SSJoyBtn ldb #$FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
149 ldx #PIA0Base
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
150 stb $02,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
151 ldb ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
152 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
153 andb #$0F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
154 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
155
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
156 SSMsBtn pshs cc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
157 orcc #IntMasks
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
158 lda ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
159 tfr a,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
160 andb #$C0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
161 bne L0120
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
162 bita #$20
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
163 beq L011A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
164 orb #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
165 L011A bita #$10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
166 beq L0120
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
167 orb #$0C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
168 L0120 anda #$3F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
169 sta ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
170 puls pc,cc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
171
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
172 SSMsXY ldd #$017E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
173 pshs cc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
174 orcc #IntMasks
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
175 ldx CrntXPos,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
176 subd CrntYPos,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
177 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
178 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
179 tfr d,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
180 puls pc,cc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
181
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
182 ***
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
183 * Mouse IRQ service routine.
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
184 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
185 * INPUT: A = flipped and masked device status byte
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
186 * U = mouse data area address
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
187 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
188 * OUTPUT: updated serial mouse data
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
189 * CC Carry clear
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
190 * D, X, Y, and U registers may be altered
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
191 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
192 * ERROR OUTPUT: none
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
193 IRQSvc ldx M$Mem,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
194 bita #$06 any error(s)?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
195 beq ChkRDRF no, go check Rx data
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
196 ldb 3,x read Rx data register to clear error flags
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
197 ClrRxCnt lda Btn.Cntr,u get current button status and Rx data counter
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
198 anda #^BC.RxCnt clear Rx data counter
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
199 ButnExit sta Btn.Cntr,u reset Rx mouse data counter to wait for sync...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
200 IRQExit clrb clear Carry to mark IRQ serviced
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
201 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
202
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
203 ChkRDRF bita #$01 Rx data?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
204 beq IRQExit no, but this branch should never be taken...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
205 ldb 3,x get Rx data
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
206 lda Btn.Cntr,u get button status and Rx counter
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
207 anda #BC.RxCnt waiting for sync with mouse data?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
208 bne ChkOfst no, go check Rx offset...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
209 tfr b,a copy Rx data
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
210 anda #SyncMask clear button status bits
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
211 cmpa #SyncData is it *PROBABLY* the initial (sync) byte?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
212 bne IRQExit no, just ignore it...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
213 comb invert button bits to match SS.Mouse format
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
214 lslb *move button
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
215 lslb *status into
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
216 lslb *bits 5-3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
217 andb #BC.Butns clear everything but the button bits
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
218 incb set Rx counter to first XY position byte
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
219 pshs b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
220 lda ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
221 bita #$08
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
222 beq L017A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
223 bitb #$08
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
224 bne L017A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
225 lda #$C0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
226 ldx CrntXPos,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
227 cmpx #$0140
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
228 bcs L017A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
229 lsla
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
230 L017A anda #$C0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
231 ora ,s+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
232 bra ButnExit go save new button status and Rx counter, exit...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
233 ChkOfst cmpa #PcktSize-1 last byte in mouse packet?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
234 bcs SaveData no, go save mouse data to Rx buffer...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
235 ldx #HResMaxY*2 get maximum Y position
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
236 pshs x save it for CalcPos subroutine
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
237 leax CrntYPos,u point to current Y position
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
238 leay Buffer+1,u point to primary Y offset
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
239 bsr CalcPos go calculate & save mouse's new Y position
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
240 ldb Buffer+2,u get mouse packet's secondary X offset
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
241 ldx #HResMaxX get maximum X position
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
242 stx ,s save it for CalcPos subroutine
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
243 leax CrntXPos,u point to current X position
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
244 leay Buffer+0,u point to primary X offset
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
245 bsr CalcPos go calculate & save mouse's new X position
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
246 leas 2,s clean up stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
247 bra ClrRxCnt go save button status and clear Rx counter, exit...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
248 SaveData stb a,u save XY position byte to mouse data Rx buffer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
249 inc Btn.Cntr,u point to next byte in Rx buffer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
250 clrb clear Carry to mark IRQ serviced
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
251 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
252
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
253 CalcPos sex sign extend mouse packet's 2nd XY offset ([D] = -128 to +127)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
254 pshs d save it temporarily...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
255 ldb ,y get mouse packet's 1st XY offset
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
256 sex sign extend it ([D] = -128 to +127)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
257 addd ,s add mouse's 2nd XY offset
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
258 std ,s save XY offset total temporarily...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
259 bpl PosAdjst go de-sensitize positive "ballistic" XY offset...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
260 orb #%00000111 if -8<XYoffset<0, no "ballistic" response
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
261 addd #1 "fix" negative offset "ballistic" response
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
262 bra RShiftD go calculate "ballistic" offset...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
263 PosAdjst andb #%11111000 if 0<XYoffset<8, no "ballistic" response
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
264 RShiftD asra *calculate 50% of XY offset
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
265 rorb *for "ballistic" response
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
266 addd ,s++ add original XY offset total, clean up stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
267 addd ,x add mouse's current XY position
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
268 bpl CheckPos zero or positive XY position, go check it...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
269 clra *set minimum
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
270 clrb *XY position
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
271 CheckPos cmpd 2,s past maximum XY position?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
272 bls SavePos no, go save it...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
273 ldd 2,s get maximum XY position
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
274 SavePos std ,x save new XY position
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
275 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
276
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
277 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
278 eom equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
279 end