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
|
|
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 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
|
|
102 Init fcb $cc,$00,$07
|
|
103 L008F fcb $a7
|
|
104 bitb #$5A
|
|
105 bpl L008F
|
|
106 ldd >M$Mem,pcr
|
|
107 leax >L0089,pcr
|
|
108 leay >L0150,pcr
|
|
109 os9 F$IRQ
|
|
110 bcs L00F5
|
|
111 tfr d,x
|
|
112 ldd #$46C0
|
|
113 pshs cc
|
|
114 orcc #IntMasks
|
|
115 sta $01,x
|
|
116 stb $01,x
|
|
117 clr $02,x
|
|
118 lda >PIA1Base+3
|
|
119 anda #$FC
|
|
120 sta >PIA1Base+3
|
|
121 lda >PIA1Base+2
|
|
122 ldd #$0187
|
|
123 ora <u0092
|
|
124 sta <u0092
|
|
125 sta >IrqEnR
|
|
126 stb ,x
|
|
127 ldb $03,x
|
|
128 ldb ,x
|
|
129 ldb $03,x
|
|
130 ldb ,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 #$7F
|
|
145 sta ,x
|
|
146 puls cc
|
|
147 tfr x,d
|
|
148 ldx #$0000
|
|
149 leay >L0150,pcr
|
|
150 os9 F$IRQ
|
|
151 L00F5 rts
|
|
152
|
|
153 SSJoyBtn ldb #$FF
|
|
154 ldx #PIA0Base
|
|
155 stb $02,x
|
|
156 ldb ,x
|
|
157 comb
|
|
158 andb #$0F
|
|
159 rts
|
|
160
|
|
161 SSMsBtn lda ,u
|
|
162 clrb
|
|
163 bita #$20
|
|
164 beq L010C
|
|
165 orb #$03
|
|
166 L010C bita #$10
|
|
167 beq L0112
|
|
168 orb #$0C
|
|
169 L0112 tfr b,a
|
|
170 anda #$FA
|
|
171 pshs a
|
|
172 andb #$05
|
|
173 orb u0007,u
|
|
174 leax <L0132,pcr
|
|
175 lda b,x
|
|
176 anda #$0A
|
|
177 sta u0007,u
|
|
178 ldb b,x
|
|
179 andb #$85
|
|
180 bpl L012F
|
|
181 ldb u0002,u
|
|
182 andb #$C0
|
|
183 L012F orb ,s+
|
|
184 rts
|
|
185 L0132 fdb $0003,$0003,$0806,$0206,$8002,$0002,$0806,$0a06
|
|
186
|
|
187 SSMsXY pshs cc
|
|
188 orcc #IntMasks
|
|
189 ldx u0003,u
|
|
190 ldd u0005,u
|
|
191 lsra
|
|
192 rorb
|
|
193 tfr d,y
|
|
194 puls pc,cc
|
|
195 L0150 ldx >M$Mem,pcr
|
|
196 bita #$06
|
|
197 beq L0162
|
|
198 ldb $03,x
|
|
199 L015A lda u0002,u
|
|
200 anda #$FC
|
|
201 L015E sta u0002,u
|
|
202 L0160 clrb
|
|
203 rts
|
|
204 L0162 bita #$01
|
|
205 beq L0160
|
|
206 ldb $03,x
|
|
207 lda u0002,u
|
|
208 anda #$03
|
|
209 bne L0178
|
|
210 bitb #$40
|
|
211 beq L0160
|
|
212 L0172 stb a,u
|
|
213 inc u0002,u
|
|
214 clrb
|
|
215 rts
|
|
216 L0178 bitb #$40
|
|
217 bne L015A
|
|
218 cmpa #$02
|
|
219 bcs L0172
|
|
220 ldx #$017E
|
|
221 pshs x
|
|
222 lda ,u
|
|
223 lsra
|
|
224 lsra
|
|
225 leax u0005,u
|
|
226 bsr L01A7
|
|
227 ldd ,u
|
|
228 ldx #$027F
|
|
229 stx ,s
|
|
230 leax u0003,u
|
|
231 bsr L01A7
|
|
232 leas $02,s
|
|
233 lda #$80
|
|
234 ldx u0003,u
|
|
235 cmpx #$0140
|
|
236 bcc L015E
|
|
237 ora #$C0
|
|
238 bra L015E
|
|
239 L01A7 lslb
|
|
240 lslb
|
|
241 lsra
|
|
242 rorb
|
|
243 lsra
|
|
244 rorb
|
|
245 sex
|
|
246 pshs b,a
|
|
247 bpl L01B9
|
|
248 orb #$07
|
|
249 addd #$0001
|
|
250 bra L01BB
|
|
251 L01B9 andb #$F8
|
|
252 L01BB asra
|
|
253 rorb
|
|
254 addd ,s++
|
|
255 addd ,x
|
|
256 bpl L01C5
|
|
257 clra
|
|
258 clrb
|
|
259 L01C5 cmpd $02,s
|
|
260 bls L01CC
|
|
261 ldd $02,s
|
|
262 L01CC std ,x
|
|
263 rts
|
|
264
|
|
265 emod
|
|
266 eom equ *
|
|
267 end
|