annotate 3rdparty/booters/boot_ide.asm @ 72:3020c1c93860

MSF defs file found, now MSF can be made
author boisy
date Fri, 03 May 2002 13:42:18 +0000
parents 2ce754e62499
children 0c12245b7bdc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
1 ********************************************************************
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
2 * Boot - Glenside IDE Boot module
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
3 *
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
4 * $Id$
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
5 *
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
6 * Ed. Comments Who YY/MM/DD
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
7 * ------------------------------------------------------------------
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
8 * 1 Created BGP 99/05/11
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
9
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
10 nam Boot
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
11 ttl Glenside IDE Boot module
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
12
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
13 ifp1
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
14 use defsfile
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
15 endc
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
16
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
17 tylg set Systm+Objct
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
18 atrv set ReEnt+rev
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
19 rev set 0
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
20 edition set 1
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
21
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
22 mod eom,name,tylg,atrv,start,size
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
23
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
24 blockloc rmb 2 pointer to memory requested
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
25 blockimg rmb 2 duplicate of the above
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
26 bootloc rmb 3 sector pointer; not byte pointer
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
27 bootsize rmb 2 size in bytes
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
28 size equ .
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
29
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
30 name fcs /Boot/
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
31 fcb edition
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
32
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
33 hwport fdb $FF70
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
34
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
35 start clra
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
36 ldb #size
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
37 clean pshs a
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
38 decb
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
39 bne clean
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
40 tfr s,u get pointer to data area
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
41 pshs u save pointer to data area
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
42
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
43 lda #$D0 forced interrupt; kill floppy activity
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
44 sta $FF48 command register
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
45 clrb
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
46 pause decb
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
47 bne pause
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
48 lda $FF48 clear controller
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
49 clr $FF40 make sure motors are turned off
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
50 sta $FFD9 fast clock
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
51 lbsr Init
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
52
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
53 * Request memory for LSN0
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
54 ldd #1
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
55 os9 F$SRqMem request one page of RAM
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
56 bcs error
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
57 bsr getpntr
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
58
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
59 * Get LSN0 into memory
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
60 clrb MSB sector
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
61 ldx #0 LSW sector
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
62 bsr mread
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
63 bcs error
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
64 ldd bootsize,u
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
65 beq error
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
66 pshs d
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
67
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
68 * Return memory
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
69 ldd #$100
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
70 ldu blockloc,u
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
71 os9 F$SRtMem
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
72 puls d
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
73 os9 F$BtMem
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
74 bcs error
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
75 bsr getpntr
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
76 std blockimg,u
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
77
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
78 * Get os9boot into memory
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
79 ldd bootsize,u
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
80 leas -2,s same as a PSHS D
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
81 getboot std ,s
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
82 ldb bootloc,u MSB sector location
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
83 ldx bootloc+1,u LSW sector location
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
84 bsr mread
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
85 ldd bootloc+1,u update sector location by one to 24bit word
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
86 addd #1
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
87 std bootloc+1,u
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
88 ldb bootloc,u
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
89 adcb #0
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
90 stb bootloc,u
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
91 inc blockloc,u update memory pointer for upload
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
92 ldd ,s update size of file left to read
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
93 subd #$100 file read one sector at a time
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
94 bhi getboot
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
95
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
96 leas 4+size,s reset the stack same as PULS U,D
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
97 ldd bootsize,u
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
98 ldx blockimg,u pointer to start of os9boot in memory
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
99 andcc #^Carry clear carry
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
100 rts back to os9p1
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
101
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
102 error leas 2+size,s
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
103 ldb #E$NotRdy drive not ready
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
104 rts
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
105
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
106 getpntr tfr u,d save pointer to requested memory
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
107 ldu 2,s recover pointer to data stack
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
108 std blockloc,u
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
109 rts
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
110
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
111 mread tstb
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
112 bne read10
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
113 cmpx #0
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
114 bne read10
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
115 bsr read10
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
116 bcc readlsn0
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
117 rts
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
118
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
119 readlsn0 pshs a,x,y
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
120 ldy blockloc,u
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
121 lda DD.Bt,y os9boot pointer
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
122 ldx DD.Bt+1,y LSW of 24 bit address
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
123 sta bootloc,u
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
124 stx bootloc+1,u
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
125 ldx DD.BSZ,y os9boot size in bytes
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
126 stx bootsize,u
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
127 clrb
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
128 puls a,x,y,pc
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
129
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
130 * Initialize IDE interface
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
131 Init ldx #$1500
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
132 ldy hwport,pc
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
133 RdyIni1 tst 7,y Wait for drive ready
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
134 bpl GoInit
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
135 leax -1,x
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
136 bne RdyIni1
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
137 lbeq ENotRdy Timed out ... give up on drive
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
138
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
139 GoInit ldd #$AF20 Drive is ready -- initialize
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
140 * For IDE command $91, DrvHd reg = 101xhhhh binary
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
141 sta 6,y $10 heads (x=0-master/1-slave; hhhh=#heads)
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
142 stb 2,y $20 sectors/track
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
143 lda #$91
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
144 sta 7,y Give drive the Init Drive Parameters IDE command
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
145 RdyIni2 tst 7,y
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
146 bmi RdyIni2 Wait *forever* until drive is ready
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
147 clrb
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
148 rts
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
149 ENotRdy comb
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
150 ldb #E$NotRdy
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
151 rts
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
152
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
153 *
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
154 * READ
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
155 *
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
156 * B = MSB of OS-9 disk LSN
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
157 * X = LSB of OS-9 disk LSN
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
158 *
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
159 read10 lbsr SetIDE
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
160 bcs Ret
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
161 ldx blockloc,u
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
162 lda #$20
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
163 pshs a
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
164 ldy hwport,pc
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
165 ReadLp lda ,y
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
166 ldb ,y
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
167 std ,x++
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
168 lda ,y
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
169 ldb ,y
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
170 std ,x++
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
171 lda ,y
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
172 ldb ,y
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
173 std ,x++
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
174 lda ,y
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
175 ldb ,y
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
176 std ,x++
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
177 dec ,s
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
178 bne ReadLp
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
179 puls a
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
180
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
181 *
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
182 * After read or write, check drive status
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
183 * Return value = CC, true=error, false=OK
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
184 *
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
185 WaitOK lda #$80 Is DRQ still true? Just one check necessary
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
186 ldy hwport,pc
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
187 bita 7,y If it is, sector isn't fully transferred
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
188 bne WaitOK
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
189 lda #$01 Wait *forever* for drive ready
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
190 bita 7,y
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
191 bne CmdErr
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
192 Ret clrb Nope -- clear CC
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
193 rts
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
194 CmdErr comb Yep -- set CC
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
195 rts
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
196
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
197 *
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
198 * Setup IDE read or write operation
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
199 * trashes D and X
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
200 *
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
201 SetIDE pshs b,x
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
202 ldx #$A000
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
203 CmdLp1 ldy hwport,pc
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
204 tst 7,y
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
205 bpl SetRdy Should go to ChkDRDY ?????
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
206 leax -1,x
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
207 bne CmdLp1
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
208 puls b,x
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
209 bra ENotRdy
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
210
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
211 SetRdy lda 2,s Sector first
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
212 anda #$1F
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
213 adda #$01
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
214 sta 3,y Store calculated sector number
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
215 ldd 1,s
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
216 rolb
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
217 rola
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
218 rolb
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
219 rola
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
220 rolb
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
221 rola
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
222 anda #$0F
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
223 ora #$A0
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
224 sta 6,y Store calculated drive number
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
225 ldd ,s Last, the cylinder number (2-bytes)
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
226 rora
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
227 rorb
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
228 anda #$7F
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
229 sta 5,y Store calculated CylHi
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
230 stb 4,y Store calculated CylLo
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
231 lda #$01
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
232 sta 2,y Sector count = 1
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
233 ldb #$20
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
234 stb 7,y Lastly, push the command to the drive
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
235 ldb #$40
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
236 lda #$08 Wait for Drive ready
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
237 CmdLp2 bita 7,y
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
238 bne CmdDone
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
239 decb
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
240 bne CmdLp2
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
241 ldx #$0001 If we time out, sleep 1 tick, then loop *forever*
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
242 os9 F$Sleep
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
243 CmdLp3 bita 7,y
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
244 beq CmdLp3
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
245 CmdDone puls b,x
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
246 clrb All right, drive ready -- return
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
247 rts
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
248
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
249 * Fillers to get to $1D0
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
250 fcc /9999999999/
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
251 fcc /9999999999/
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
252 fcc /9999999999/
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
253 fcc /9999999999/
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
254 fcc /9999999999/
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
255 fcc /9999999999/
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
256 fcc /9999999999/
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
257 fcc /999999999/
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
258
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
259 emod
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
260
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
261 eom equ *