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