0
|
1 ********************************************************************
|
|
2 * JoyDrv - Joystick Driver for 6551/Microsoft Mouse
|
|
3 *
|
|
4 * $Id$
|
|
5 *
|
|
6 * Ed. Comments Who YY/MM/DD
|
|
7 * ------------------------------------------------------------------
|
|
8 * 6 L2 Upgrade distribution version
|
|
9
|
|
10 nam JoyDrv
|
|
11 ttl Joystick Driver for 6552/Microsoft Mouse
|
|
12
|
|
13 * Disassembled 98/09/09 09:58:38 by Disasm v1.6 (C) 1988 by RML
|
|
14
|
|
15 MPI set 1
|
|
16
|
|
17 ifp1
|
|
18 use defsfile
|
|
19 endc
|
|
20
|
|
21 tylg set Systm+Objct
|
|
22 atrv set ReEnt+rev
|
|
23 rev set $01
|
|
24 edition set 6
|
|
25
|
|
26 mod eom,name,tylg,atrv,start,size
|
|
27
|
|
28 u0000 rmb 2
|
|
29 u0002 rmb 1
|
|
30 u0003 rmb 2
|
|
31 u0005 rmb 1
|
|
32 u0006 rmb 1
|
|
33 u0007 rmb 121
|
|
34 u0080 rmb 18
|
|
35 u0092 rmb 21
|
|
36 u00A7 rmb 65213
|
|
37 size equ .
|
|
38
|
|
39 name fcs /JoyDrv/
|
|
40 fcb edition
|
|
41
|
|
42 start lbra Init
|
|
43 lbra Term
|
|
44 lbra SSMsBtn
|
|
45 lbra SSMsXY
|
|
46 lbra SSJoyBtn
|
|
47
|
|
48 SSJoyXY pshs x,b,a
|
|
49 ldx #PIA0Base
|
|
50 lda <$23,x
|
|
51 ldb <$20,x
|
|
52 pshs b,a
|
|
53 anda #$F7
|
|
54 sta <$23,x
|
|
55 lda $01,x
|
|
56 ldb $03,x
|
|
57 pshs b,a
|
|
58 andb #$F7
|
|
59 lsr $04,s
|
|
60 bcs L0043
|
|
61 orb #$08
|
|
62 L0043 stb $03,x
|
|
63 lda ,s
|
|
64 ora #$08
|
|
65 bsr L0065
|
|
66 std $06,s
|
|
67 lda ,s
|
|
68 anda #$F7
|
|
69 bsr L0065
|
|
70 std $04,s
|
|
71 puls b,a
|
|
72 sta $01,x
|
|
73 stb $03,x
|
|
74 puls b,a
|
|
75 stb <$20,x
|
|
76 sta <$23,x
|
|
77 puls pc,y,x
|
|
78 L0065 sta $01,x
|
|
79 lda #$7F
|
|
80 ldb #$40
|
|
81 bra L0078
|
|
82 L006D lsrb
|
|
83 cmpb #$01
|
|
84 bhi L0078
|
|
85 lsra
|
|
86 lsra
|
|
87 tfr a,b
|
|
88 clra
|
|
89 rts
|
|
90 L0078 pshs b
|
|
91 sta <$20,x
|
|
92 tst ,x
|
|
93 bpl L0085
|
|
94 adda ,s+
|
|
95 bra L006D
|
|
96 L0085 suba ,s+
|
|
97 bra L006D
|
|
98 L0089 fcb $00
|
|
99 L008A fcb $07,$01
|
|
100 Init fcb $cc,$00,$07
|
|
101 L008F fcb $a7
|
|
102 bitb #$5A
|
|
103 bpl L008F
|
|
104 ldd >M$Mem,pcr
|
|
105 leax >L0089,pcr
|
|
106 leay >L0150,pcr
|
|
107 os9 F$IRQ
|
|
108 bcs L00F5
|
|
109 tfr d,x
|
|
110 ldd #$46C0
|
|
111 pshs cc
|
|
112 orcc #IntMasks
|
|
113 sta $01,x
|
|
114 stb $01,x
|
|
115 clr $02,x
|
|
116 lda >PIA1Base+3
|
|
117 anda #$FC
|
|
118 sta >PIA1Base+3
|
|
119 lda >PIA1Base+2
|
|
120 ldd #$0187
|
|
121 ora <u0092
|
|
122 sta <u0092
|
|
123 sta >IrqEnR
|
|
124 stb ,x
|
|
125 ldb $03,x
|
|
126 ldb ,x
|
|
127 ldb $03,x
|
|
128 ldb ,x
|
|
129 andb >L008A,pcr
|
|
130 bne L00DF
|
|
131
|
|
132 ifeq MPI-1
|
|
133 lda #$03
|
|
134 sta MPI.Slct
|
|
135 endc
|
|
136
|
|
137 puls pc,cc
|
|
138
|
|
139 Term pshs cc
|
|
140 orcc #IntMasks
|
|
141 L00DF ldx >M$Mem,pcr
|
|
142 lda #$7F
|
|
143 sta ,x
|
|
144 puls cc
|
|
145 tfr x,d
|
|
146 ldx #$0000
|
|
147 leay >L0150,pcr
|
|
148 os9 F$IRQ
|
|
149 L00F5 rts
|
|
150
|
|
151 SSJoyBtn ldb #$FF
|
|
152 ldx #PIA0Base
|
|
153 stb $02,x
|
|
154 ldb ,x
|
|
155 comb
|
|
156 andb #$0F
|
|
157 rts
|
|
158
|
|
159 SSMsBtn lda ,u
|
|
160 clrb
|
|
161 bita #$20
|
|
162 beq L010C
|
|
163 orb #$03
|
|
164 L010C bita #$10
|
|
165 beq L0112
|
|
166 orb #$0C
|
|
167 L0112 tfr b,a
|
|
168 anda #$FA
|
|
169 pshs a
|
|
170 andb #$05
|
|
171 orb u0007,u
|
|
172 leax <L0132,pcr
|
|
173 lda b,x
|
|
174 anda #$0A
|
|
175 sta u0007,u
|
|
176 ldb b,x
|
|
177 andb #$85
|
|
178 bpl L012F
|
|
179 ldb u0002,u
|
|
180 andb #$C0
|
|
181 L012F orb ,s+
|
|
182 rts
|
|
183 L0132 fdb $0003,$0003,$0806,$0206,$8002,$0002,$0806,$0a06
|
|
184
|
|
185 SSMsXY pshs cc
|
|
186 orcc #IntMasks
|
|
187 ldx u0003,u
|
|
188 ldd u0005,u
|
|
189 lsra
|
|
190 rorb
|
|
191 tfr d,y
|
|
192 puls pc,cc
|
|
193 L0150 ldx >M$Mem,pcr
|
|
194 bita #$06
|
|
195 beq L0162
|
|
196 ldb $03,x
|
|
197 L015A lda u0002,u
|
|
198 anda #$FC
|
|
199 L015E sta u0002,u
|
|
200 L0160 clrb
|
|
201 rts
|
|
202 L0162 bita #$01
|
|
203 beq L0160
|
|
204 ldb $03,x
|
|
205 lda u0002,u
|
|
206 anda #$03
|
|
207 bne L0178
|
|
208 bitb #$40
|
|
209 beq L0160
|
|
210 L0172 stb a,u
|
|
211 inc u0002,u
|
|
212 clrb
|
|
213 rts
|
|
214 L0178 bitb #$40
|
|
215 bne L015A
|
|
216 cmpa #$02
|
|
217 bcs L0172
|
|
218 ldx #$017E
|
|
219 pshs x
|
|
220 lda ,u
|
|
221 lsra
|
|
222 lsra
|
|
223 leax u0005,u
|
|
224 bsr L01A7
|
|
225 ldd ,u
|
|
226 ldx #$027F
|
|
227 stx ,s
|
|
228 leax u0003,u
|
|
229 bsr L01A7
|
|
230 leas $02,s
|
|
231 lda #$80
|
|
232 ldx u0003,u
|
|
233 cmpx #$0140
|
|
234 bcc L015E
|
|
235 ora #$C0
|
|
236 bra L015E
|
|
237 L01A7 lslb
|
|
238 lslb
|
|
239 lsra
|
|
240 rorb
|
|
241 lsra
|
|
242 rorb
|
|
243 sex
|
|
244 pshs b,a
|
|
245 bpl L01B9
|
|
246 orb #$07
|
|
247 addd #$0001
|
|
248 bra L01BB
|
|
249 L01B9 andb #$F8
|
|
250 L01BB asra
|
|
251 rorb
|
|
252 addd ,s++
|
|
253 addd ,x
|
|
254 bpl L01C5
|
|
255 clra
|
|
256 clrb
|
|
257 L01C5 cmpd $02,s
|
|
258 bls L01CC
|
|
259 ldd $02,s
|
|
260 L01CC std ,x
|
|
261 rts
|
|
262
|
|
263 emod
|
|
264 eom equ *
|
|
265 end
|