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