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