annotate level1/modules/cchdisk.asm @ 0:6641a883d6b0

Initial revision
author boisy
date Thu, 04 Apr 2002 16:34:12 +0000
parents
children 845e890728df
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 nam CCHDisk
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
2 ttl Tandy hard disk driver
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
4 * Disassembled 98/08/23 17:28:39 by Disasm v1.6 (C) 1988 by RML
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
6 ifp1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
7 use defsfile
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
8 use rbfdefs
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
9 endc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
11 tylg set Drivr+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
12 atrv set ReEnt+rev
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
13 rev set $01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
14 edition set $04
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
15
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
16 mod eom,name,tylg,atrv,start,size
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18 u0000 rmb 8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19 u0008 rmb 7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
20 u000F rmb 91
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
21 u006A rmb 61
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
22 u00A7 rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
23 u00A9 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24 u00AA rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
25 u00AB rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
26 u00AD rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
27 u00AF rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
28 u00B0 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
29 u00B1 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
30 u00B2 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
31 u00B3 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
32 u00B4 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
33 u00B5 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
34 u00B6 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
35 u00B7 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
36 u00B8 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
37 u00B9 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
38 u00BA rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
39 u00BB rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
40 u00BC rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
41 u00BE rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
42 u00BF rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
43 u00C1 rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
44 size equ .
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
45 fcb $FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
46
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
47 name fcs /CCHDisk/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
48 fcb edition
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
49
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
50 start lbra Init
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
51 lbra Read
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
52 lbra Write
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
53 lbra GetStat
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
54 lbra SetStat
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
55 lbra Term
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
56
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
57 * Init
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
58 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
59 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
60 * Y = address of device descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
61 * U = address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
62 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
63 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
64 * CC = carry set on error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
65 * B = error code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
66 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
67 Init lbsr L04D4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
68 lda >$FF51
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
69 cmpa #$08
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
70 beq L0037
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
71 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
72 ldb #E$NotRdy
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
73 bra L0083
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
74 L0037 lbsr L04C0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
75 bcs L0083
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
76 ldd #$FFFF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
77 std >u00A9,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
78 std >u00A7,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
79 leax <$25,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
80 ldd ,x++
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
81 sta >u00B3,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
82 stb >u00BE,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
83 ldd ,x++
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
84 std >u00BF,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
85 ldd ,x++
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
86 std >u00C1,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
87 lda ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
88 sta >u00B2,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
89 lda #$04
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
90 leay u000F,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
91 ldb #$FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
92 L006C stb ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
93 stb <$15,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
94 leay <$26,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
95 deca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
96 bne L006C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
97 ldd #256
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
98 pshs u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
99 os9 F$SRqMem
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
100 tfr u,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
101 puls u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
102 L0083 bcs L00C7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
103 stx >u00AB,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
104 leax >$0100,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
105 stx >u00AD,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
106 bra L00C6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
107
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
108 * Term
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
109 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
110 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
111 * U = address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
112 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
113 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
114 * CC = carry set on error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
115 * B = error code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
116 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
117 Term pshs u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
118 ldu >u00AB,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
119 ldd #256
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
120 os9 F$SRtMem
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
121 puls u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
122
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
123 * GetStat
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
124 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
125 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
126 * A = function code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
127 * Y = address of path descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
128 * U = address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
129 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
130 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
131 * CC = carry set on error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
132 * B = error code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
133 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
134 GetStat clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
135 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
136
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
137 * Read
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
138 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
139 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
140 * B = MSB of the disk's LSN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
141 * X = LSB of the disk's LSN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
142 * Y = address of path descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
143 * U = address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
144 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
145 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
146 * CC = carry set on error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
147 * B = error code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
148 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
149 Read lbsr L04D4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
150 cmpx #$0000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
151 bne L00CB
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
152 tstb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
153 bne L00CB
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
154 bsr L00D1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
155 bcs L00C7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
156 ldx $08,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
157 pshs y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
158 ldy >u00A7,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
159 ldb #$14
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
160 L00BD lda b,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
161 sta b,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
162 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
163 bpl L00BD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
164 puls y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
165 L00C6 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
166 L00C7 lbsr L04E1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
167 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
168 L00CB bsr L00D1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
169 bcs L00C7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
170 bra L00C6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
171 L00D1 lbsr L033F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
172 bcs L00E3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
173 ldx $08,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
174 lda #$02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
175 sta >u00B9,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
176 lda #$20
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
177 lbsr L028C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
178 L00E3 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
179
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
180 * Write
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
181 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
182 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
183 * B = MSB of the disk's LSN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
184 * X = LSB of the disk's LSN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
185 * Y = address of path descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
186 * U = address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
187 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
188 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
189 * CC = carry set on error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
190 * B = error code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
191 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
192 Write lbsr L04D4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
193 bsr L014A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
194 bcs L00C7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
195 pshs x,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
196 bsr L0100
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
197 puls x,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
198 bcs L00C7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
199 tst <$28,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
200 bne L00C6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
201 bsr L0113
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
202 bcc L00C6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
203 ldb <$00F5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
204 bra L00C7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
205 L0100 lbsr L033F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
206 bcs L0112
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
207 lda #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
208 sta >u00B9,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
209 lda #$30
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
210 ldx $08,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
211 lbsr L028C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
212 L0112 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
213 L0113 pshs x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
214 ldx $08,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
215 pshs x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
216 ldx >u00AB,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
217 stx $08,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
218 ldx $04,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
219 bsr L00D1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
220 puls x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
221 stx $08,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
222 bcs L0148
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
223 lda #$20
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
224 pshs u,y,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
225 ldy >u00AB,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
226 tfr x,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
227 L0134 ldx ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
228 cmpx ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
229 bne L0144
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
230 leau u0008,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
231 leay $08,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
232 dec ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
233 bne L0134
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
234 bra L0146
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
235 L0144 orcc #Carry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
236 L0146 puls u,y,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
237 L0148 puls pc,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
238 L014A pshs b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
239 ldb >$FF50
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
240 beq L0179
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
241 lda <$21,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
242 bne L015C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
243 andb #$80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
244 bne L0174
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
245 bra L0179
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
246 L015C cmpa #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
247 bne L0166
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
248 andb #$40
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
249 bne L0174
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
250 bra L0179
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
251 L0166 cmpa #$02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
252 bne L0170
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
253 andb #$20
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
254 bne L0174
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
255 bra L0179
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
256 L0170 andb #$10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
257 beq L0179
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
258 L0174 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
259 ldb #E$WP
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
260 stb ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
261 L0179 puls pc,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
262
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
263 * SetStat
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
264 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
265 * Entry:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
266 * A = function code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
267 * Y = address of path descriptor
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
268 * U = address of device memory area
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
269 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
270 * Exit:
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
271 * CC = carry set on error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
272 * B = error code
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
273 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
274 SetStat lbsr L04D4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
275 lbsr L0460
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
276 ldx PD.RGS,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
277 ldb R$B,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
278 cmpb #SS.Reset
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
279 bne L018E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
280 lbsr L04A5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
281 bra L01A1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
282 L018E cmpb #SS.WTrk
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
283 bne L0196
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
284 bsr L01B5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
285 bra L01A1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
286 L0196 cmpb #SS.SQD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
287 bne L019E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
288 bsr L01A8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
289 bra L01A1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
290 L019E comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
291 ldb #E$UnkSvc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
292 L01A1 lbcs L00C7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
293 lbra L00C6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
294
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
295 L01A8 ldd <$25,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
296 exg a,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
297 std >u00B6,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
298 lbsr L0496
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
299 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
300
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
301 L01B5 ldd $8,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
302 cmpd #$0000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
303 bne L01C3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
304 ldd $6,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
305 cmpa #$00
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
306 beq L01C5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
307 L01C3 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
308 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
309 L01C5 pshs u,y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
310 clr >u00AF,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
311 clr >u00B0,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
312 clr >u00B1,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
313 lda <$2A,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
314 bsr L023D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
315 L01D8 lda <$2A,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
316 sta >u00B4,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
317 lda >u00B2,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
318 sta >u00B5,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
319 lda >u00B8,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
320 anda #$F8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
321 sta >u00B8,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
322 lda >u00B1,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
323 ora >u00B8,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
324 sta >u00B8,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
325 ldd >u00AF,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
326 exg a,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
327 std >u00B6,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
328 lda #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
329 sta >u00B9,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
330 lda #$50
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
331 ldx >u00AB,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
332 bsr L028C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
333 bcs L023B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
334 lda >u00B1,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
335 inca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
336 sta >u00B1,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
337 cmpa <$27,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
338 bcs L01D8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
339 clr >u00B1,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
340 ldd >u00AF,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
341 addd #$0001
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
342 std >u00AF,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
343 cmpd <$25,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
344 bcs L01D8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
345 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
346 L023B puls pc,u,y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
347 L023D pshs y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
348 ldb <$2D,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
349 stb >u00BB,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
350 sta >u00BA,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
351 lsla
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
352 ldx >u00AB,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
353 leay a,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
354 nega
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
355 pshs y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
356 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
357 L0255 clr ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
358 sta $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
359 inca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
360 cmpa >u00BA,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
361 beq L0278
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
362 ldb >u00BB,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
363 lslb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
364 abx
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
365 cmpx $04,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
366 bcs L026E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
367 ldb ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
368 leax b,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
369 L026E cmpx $02,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
370 bne L0255
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
371 leax $02,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
372 stx $02,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
373 bra L0255
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
374 L0278 ldy $04,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
375 lda #$00
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
376 L027D cmpy >u00AD,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
377 beq L0288
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
378 sta ,y+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
379 bra L027D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
380 L0288 leas $06,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
381 puls pc,y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
382 L028C pshs y,x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
383 leax >u00B3,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
384 ldy #$FF59
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
385 ldb #$06
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
386 L0298 lda ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
387 sta ,y+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
388 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
389 bne L0298
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
390 lda ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
391 sta ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
392 ldy $03,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
393 ldx $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
394 lda >u00B9,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
395 cmpa #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
396 beq L02C6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
397 bsr L02E1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
398 cmpa #$02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
399 beq L02BA
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
400 L02B6 bsr L02F2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
401 puls pc,y,x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
402 L02BA bsr L02EB
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
403 L02BC lda >$FF58
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
404 sta ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
405 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
406 bne L02BC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
407 bra L02B6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
408 L02C6 lda ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
409 sta >$FF58
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
410 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
411 bne L02C6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
412 bsr L02E1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
413 bra L02B6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
414 L02D2 lda >$FF5F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
415 pshs a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
416 lda >$FF5F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
417 cmpa ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
418 leas $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
419 bne L02D2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
420 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
421 L02E1 pshs a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
422 L02E3 bsr L02D2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
423 anda #$80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
424 bne L02E3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
425 puls pc,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
426 L02EB bsr L02D2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
427 bita #$08
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
428 beq L02EB
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
429 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
430 L02F2 bsr L02D2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
431 bita #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
432 bne L02FA
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
433 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
434 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
435 L02FA comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
436 bita #$02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
437 beq L0302
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
438 lbsr L04F1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
439 L0302 lda >$FF59
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
440 bita #$80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
441 bne L0332
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
442 bita #$40
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
443 bne L031F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
444 bita #$10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
445 bne L0322
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
446 bita #$04
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
447 bne L0336
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
448 bita #$02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
449 bne L0322
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
450 bita #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
451 bne L0326
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
452 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
453 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
454 L031F ldb #E$CRC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
455 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
456 L0322 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
457 ldb #E$Seek
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
458 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
459 L0326 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
460 ldb #E$Read
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
461 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
462 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
463 ldb #E$Write
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
464 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
465 L032E comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
466 ldb #E$NotRdy
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
467 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
468 L0332 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
469 ldb #E$Unit
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
470 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
471 L0336 lda >$FF5F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
472 bita #$10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
473 beq L0322
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
474 bra L032E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
475 L033F lbsr L0460
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
476 bcs L0346
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
477 bsr L0347
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
478 L0346 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
479 L0347 pshs y,x,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
480 lbsr L04C0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
481 lbcs L0428
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
482 stx >u00BC,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
483 tstb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
484 bne L0380
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
485 cmpx #$0000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
486 bne L0380
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
487 leax >u00B4,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
488 ldd #$0001
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
489 sta $01,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
490 sta $02,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
491 sta $03,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
492 stb ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
493 lda >u00B8,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
494 anda #$F8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
495 sta >u00B8,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
496 tst >u00AA,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
497 lbne L040B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
498 lbra L0427
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
499 L0380 ldy >u00A7,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
500 cmpb ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
501 lbhi L042E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
502 bcs L0393
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
503 cmpx $01,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
504 lbcc L042E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
505 L0393 clr >u00B6,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
506 clr >u00B7,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
507 ldb ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
508 ldx $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
509 ldy $03,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
510 tstb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
511 bne L03B4
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
512 pshs x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
513 lda <$2A,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
514 ldb <$27,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
515 mul
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
516 subd $02,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
517 puls x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
518 bhi L03D5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
519 L03B4 pshs u,y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
520 lda >u00BE,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
521 ldy >u00BF,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
522 ldu >u00C1,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
523 bsr L0435
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
524 ldu $06,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
525 std >u00BC,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
526 tfr x,d
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
527 exg a,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
528 std >u00B6,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
529 puls u,y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
530 L03D5 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
531 ldb <$2A,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
532 beq L042E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
533 pshs b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
534 pshs a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
535 ldd >u00BC,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
536 L03E3 subd $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
537 bcs L03EB
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
538 inc ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
539 bra L03E3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
540 L03EB addd $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
541 stb >u00B5,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
542 lda >u00B8,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
543 anda #$F8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
544 ora ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
545 sta >u00B8,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
546 leas $03,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
547 lda #$01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
548 sta >u00B4,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
549 tst >u00AA,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
550 beq L0427
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
551 L040B clr >u00AA,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
552 ldy >u00A7,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
553 lda <$15,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
554 ldy $03,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
555 cmpa #$FF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
556 bne L0423
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
557 lbsr L04A5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
558 bra L0428
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
559 L0423 bsr L0496
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
560 bra L0428
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
561 L0427 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
562 L0428 bcc L042C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
563 stb ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
564 L042C puls pc,y,x,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
565 L042E puls b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
566 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
567 ldb #E$Sect
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
568 puls pc,y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
569 L0435 pshs u,y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
570 ldd $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
571 L0439 subd $04,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
572 bcc L0443
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
573 addd $04,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
574 andcc #^Carry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
575 bra L0445
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
576 L0443 orcc #Carry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
577 L0445 rol $03,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
578 rolb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
579 rola
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
580 dec ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
581 bne L0439
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
582 std ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
583 andb $06,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
584 stb $02,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
585 ldb $07,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
586 beq L045E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
587 L0457 lsr ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
588 ror $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
589 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
590 bne L0457
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
591 L045E puls pc,u,y,x,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
592 L0460 lda <$21,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
593 cmpa #$04
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
594 lbcc L0332
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
595 cmpa >u00A9,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
596 beq L0495
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
597 sta >u00A9,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
598 dec >u00AA,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
599 lsla
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
600 lsla
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
601 lsla
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
602 pshs a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
603 lda >u00B8,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
604 anda #$E7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
605 ora ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
606 leas $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
607 sta >u00B8,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
608 pshs x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
609 ldx <$1E,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
610 stx >u00A7,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
611 puls x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
612 L0495 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
613 L0496 clr >u00B9,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
614 lda <$22,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
615 anda #$0F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
616 ora #$70
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
617 lbsr L028C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
618 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
619 L04A5 clr >u00B9,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
620 lda <$22,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
621 anda #$0F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
622 ora #$10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
623 lbsr L028C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
624 bcs L04BF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
625 ldx >u00A7,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
626 clr <$15,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
627 clr <$16,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
628 L04BF rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
629
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
630 L04C0 pshs b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
631 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
632 L04C3 lda >$FF5F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
633 bita #$40
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
634 bne L04D2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
635 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
636 bne L04C3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
637 ldb #E$NotRdy
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
638 stb $01,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
639 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
640 L04D2 puls pc,b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
641
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
642 L04D4 dec <u006A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
643 lda #$02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
644 sta >MPI.Slct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
645 lda #$08
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
646 L04DD sta >$FF51
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
647 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
648
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
649 L04E1 pshs cc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
650 lda #$00
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
651 sta >$FF51
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
652 lda #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
653 sta >MPI.Slct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
654 clr <u006A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
655 puls pc,cc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
656
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
657 L04F1 lda #$10
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
658 bra L04DD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
659
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
660 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
661 eom equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
662 end
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
663