Mercurial > hg > Members > kono > nitros9-code
annotate level1/modules/boot_1773.asm @ 1893:1827bb446188
Modified booters to use new boot strategy with boot_common.asm
author | boisy |
---|---|
date | Sat, 15 Oct 2005 15:32:45 +0000 |
parents | 5f8822fb42e0 |
children | 6d5bd8549d28 |
rev | line source |
---|---|
230 | 1 ******************************************************************** |
1287 | 2 * Boot - WD1773 Boot module |
230 | 3 * |
4 * $Id$ | |
5 * | |
1287 | 6 * Edt/Rev YYYY/MM/DD Modified by |
7 * Comment | |
230 | 8 * ------------------------------------------------------------------ |
1287 | 9 * 4 1985/??/?? |
10 * Original Tandy distribution version. | |
11 * | |
12 * 6 1998/10/12 Boisy G. Pitre | |
13 * Obtained from L2 Upgrade archive, has 6ms step rate and disk timeout | |
14 * changes. | |
15 * | |
16 * 6r2 2003/05/18 Boisy G. Pitre | |
17 * Added '.' output for each sector for OS-9 L2 and NitrOS9 for | |
18 * Mark Marlette (a special request :). | |
1291
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
19 * |
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
20 * 6r3 2003/08/31 Robert Gault |
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
21 * Put BLOB-stop code in place, changed orb #$30 to orb #$28 |
1520 | 22 * |
23 * 6r4 2004/02/17 Rodney Hamilton | |
24 * Minor optimizations, improvements in source comments | |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
25 * |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
26 * 7 2005/10/10 Boisy G. Pitre |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
27 * Added fragmented bootfile support |
1891 | 28 * 7 2005/10/13 Robert Gault |
29 * Changed timing loops for H6309L2 so that code shortened enough to | |
30 * fit within the $1D0 boundary. | |
230 | 31 |
210
6bf55704c623
Boot is adapted from OS-9 Level Two boot module, now boots from
boisy
parents:
201
diff
changeset
|
32 nam Boot |
1287 | 33 ttl WD1773 Boot module |
0 | 34 |
1287 | 35 IFP1 |
0 | 36 use defsfile |
1287 | 37 ENDC |
0 | 38 |
1520 | 39 * FDC Control Register bits at $FF40 |
40 HALTENA equ %10000000 | |
41 SIDESEL equ %01000000 DRVSEL3 if no DS drives | |
42 DDEN equ %00100000 | |
43 READY equ %00010000 READY for Tandy WD1773-based controllers | |
1516 | 44 MOTON equ %00001000 |
1520 | 45 DRVSEL2 equ %00000100 |
1516 | 46 DRVSEL1 equ %00000010 |
47 DRVSEL0 equ %00000001 | |
48 | |
1709 | 49 * Default Boot is from drive 0 |
1520 | 50 BootDr set DRVSEL0 |
1709 | 51 IFEQ DNum-1 |
52 BootDr set DRVSEL1 Alternate boot from drive 1 | |
53 ENDC | |
54 IFEQ DNum-2 | |
55 BootDr set DRVSEL2 Alternate boot from drive 2 | |
56 ENDC | |
57 IFEQ DNum-3 | |
58 BootDr set SIDESEL Alternate boot from drive 3 | |
59 ENDC | |
1520 | 60 |
61 * WD17x3 DPort offsets | |
62 CONTROL equ 0 | |
63 CMDREG equ 8+0 write-only | |
64 STATREG equ CMDREG read-only | |
1516 | 65 TRACKREG equ 8+1 |
66 SECTREG equ 8+2 | |
67 DATAREG equ 8+3 | |
68 | |
1515 | 69 * Sector Size |
70 SECTSIZE equ 256 | |
71 | |
1520 | 72 * Step Rates: |
73 * $00 = 6ms | |
74 * $01 = 12ms | |
75 * $02 = 20ms | |
76 * $03 = 30ms | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
1166
diff
changeset
|
77 STEP set $00 |
210
6bf55704c623
Boot is adapted from OS-9 Level Two boot module, now boots from
boisy
parents:
201
diff
changeset
|
78 |
1287 | 79 tylg set Systm+Objct |
0 | 80 atrv set ReEnt+rev |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
81 rev set $00 |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
82 edition set 7 |
230 | 83 |
0 | 84 mod eom,name,tylg,atrv,start,size |
230 | 85 |
1520 | 86 * NOTE: these are U-stack offsets, not DP |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
87 seglist rmb 2 pointer to segment list |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
88 blockloc rmb 2 pointer to memory requested |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
89 blockimg rmb 2 duplicate of the above |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
90 bootloc rmb 3 sector pointer; not byte pointer |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
91 bootsize rmb 2 size in bytes |
1515 | 92 drvsel rmb 1 |
1514 | 93 currtrak rmb 1 |
94 ddtks rmb 1 no. of sectors per track | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1891
diff
changeset
|
95 ddfmt rmb 1 |
1520 | 96 side rmb 1 side 2 flag |
0 | 97 size equ . |
98 | |
99 name fcs /Boot/ | |
230 | 100 fcb edition |
0 | 101 |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1891
diff
changeset
|
102 FLOPPY equ 1 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1891
diff
changeset
|
103 |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
104 ************ START OF DEVICE-SPECIFIC INIT *********** |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
105 * HWInit - Initialize the device |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
106 HWInit |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
107 ldy Address,pcr get hardware address |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
108 lda #%11010000 ($D0) Force Interrupt (stops any command in progress) |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
109 sta CMDREG,y write command to command register |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
110 lbsr Delay2 delay 54~ |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
111 lda STATREG,y clear status register |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
112 lda #$FF |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
113 sta currtrak,u set current track to 255 |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
114 leax >NMIRtn,pcr point to NMI routine |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
115 IFGT Level-1 |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
116 stx <D.NMI save address |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
117 ELSE |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
118 stx >D.XNMI+1 save address |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
119 lda #$7E |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
120 sta >D.XNMI |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
121 ENDC |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
122 lda #MOTON turn on drive motor |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
123 ora WhichDrv,pcr |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
124 sta CONTROL,y |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
125 * MOTOR ON spin-up delay loop (~307 mSec) |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
126 IFGT Level-1 |
1891 | 127 IFNE H6309 |
128 ldd #$F000 3 cycles | |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
129 ELSE |
1891 | 130 ldd #50000 |
131 ENDC | |
132 ELSE | |
133 ldd #25000 | |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
134 ENDC |
1891 | 135 * IFNE H6309 |
136 * nop | |
137 * ENDC | |
138 L003A nop 1 cycles | |
139 nop 1 cycles | |
140 * IFNE H6309 | |
141 * nop | |
142 * nop | |
143 * nop | |
144 * ENDC | |
145 subd #$0001 4 cycles | |
146 bne L003A 3 cycles | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1891
diff
changeset
|
147 HWTerm rts |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
148 ************ END OF DEVICE-SPECIFIC INIT *********** |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1891
diff
changeset
|
149 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1891
diff
changeset
|
150 use ../../6809l1/modules/boot_common.asm |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
151 |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
152 ************************************************************ |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
153 ************************************************************ |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
154 * Hardware-Specific Booter Area * |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
155 ************************************************************ |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
156 ************************************************************ |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
157 |
210
6bf55704c623
Boot is adapted from OS-9 Level Two boot module, now boots from
boisy
parents:
201
diff
changeset
|
158 |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
159 DoDDns lda #DDEN+MOTON double density enable and motor on |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1891
diff
changeset
|
160 ora WhichDrv,pcr OR in selected drive |
1516 | 161 sta drvsel,u save drive selection byte |
162 clr currtrak,u clear current track | |
0 | 163 lda #$05 |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
164 lbsr SetTrak Set the track to the head we want |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
165 ldb #0+STEP RESTORE cmd |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
166 lbra Talk2FDC send command and wait for it to complete |
0 | 167 |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
168 * |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
169 * HWRead - Read a 256 byte sector from the device |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
170 * Entry: Y = hardware address |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
171 * B = bits 23-16 of LSN |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
172 * X = bits 15-0 of LSN |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
173 * blockloc,u = ptr to 256 byte sector |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
174 * Exit: X = ptr to data (i.e. ptr in blockloc,u) |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
175 * |
1287 | 176 * Read a sector from the 1773 |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
177 * Entry: B,X = LSN to read |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
178 HWRead lda #$91 |
1515 | 179 bsr L00DF else branch subroutine |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
180 bcs HWRRts branch if error |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
181 ldx blockloc,u get buffer pointer in X for caller |
1287 | 182 clrb |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
183 HWRRts rts |
1287 | 184 |
185 L00D7 bcc L00DF | |
0 | 186 pshs x,b,a |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
187 bsr DoDDns |
0 | 188 puls x,b,a |
1515 | 189 L00DF pshs x,b,a save LSN, command |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
190 bsr ReadSect |
1520 | 191 puls x,b,a restore LSN, command |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
192 bcc HWRRts branch if OK |
1287 | 193 lsra |
194 bne L00D7 | |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
195 ReadSect bsr Seek2Sect seek to the sector stored in X |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
196 bcs HWRRts if error, return to caller |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
197 ldx blockloc,u get address of buffer to fill |
1515 | 198 orcc #IntMasks mask interrupts |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
199 pshs x save X |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
200 ldx #$FFFF |
1516 | 201 ldb #%10000000 ($80) READ SECTOR command |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
202 stb CMDREG,y write to command register |
1520 | 203 ldb drvsel,u (DDEN+MOTORON+BootDr) |
204 * NOTE: The 1773 FDC multiplexes the write precomp enable and ready | |
205 * signals on the ENP/RDY pin, so the READY bit must always be ON for | |
206 * read and seek commands. (from the FD502 FDC Service Manual) | |
207 orb #DDEN+READY set DDEN+READY bits ($30) | |
208 tst side,u are we on side 2? | |
1287 | 209 beq L0107 |
1520 | 210 orb #SIDESEL set side 2 bit |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
211 L0107 stb CONTROL,y |
1520 | 212 lbsr Delay2 delay 54~ |
213 orb #HALTENA HALT enable ($80) | |
214 * lda #%00000010 RESTORE cmd ($02) | |
1516 | 215 *L0111 bita >DPort+STATREG |
1291
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
216 * bne L0123 |
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
217 * leay -$01,y |
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
218 * bne L0111 |
1515 | 219 * lda drvsel,u |
1520 | 220 * sta >DPort+CONTROL |
1291
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
221 * puls y |
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
222 * bra L0138 |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
223 stb CONTROL,y |
1291
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
224 nop |
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
225 nop |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
226 * bra L0123 |
1516 | 227 |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
228 ldx ,s get X saved earlier |
1516 | 229 * Sector READ Loop |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
230 L0123 lda DATAREG,y read from WD DATA register |
0 | 231 sta ,x+ |
1520 | 232 * stb >DPort+CONTROL |
1291
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
233 nop |
1287 | 234 bra L0123 |
1520 | 235 * RVH NOTE: This ONLY works for double density boot disks! The Tandy |
236 * controllers internally gate HALT enable with the DDEN bit, which | |
237 * means that reading a single-density boot disk will not generate the | |
238 * NMI signal needed to exit the read loop! Single-density disks must | |
239 * use a polled I/O loop instead. | |
1515 | 240 NMIRtn leas R$Size,s adjust stack |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
241 puls x |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
242 ldb STATREG,y read WD STATUS register |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
243 bitb #$9C any errors? |
1516 | 244 * bitb #$04 LOST DATA bit set? |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
245 beq r@ branch if not |
1516 | 246 * beq ChkErr branch if not |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
247 L0138 comb else we will return error |
210
6bf55704c623
Boot is adapted from OS-9 Level Two boot module, now boots from
boisy
parents:
201
diff
changeset
|
248 ldb #E$Read |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
249 r@ rts |
0 | 250 |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
251 Seek2Sect |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
252 lda #MOTON permit alternate drives |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
253 ora WhichDrv,pcr permit alternate drives |
1516 | 254 sta drvsel,u save byte to static mem |
1520 | 255 clr side,u start on side 1 |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
256 tfr x,d move LSN into D |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
257 cmpd #$0000 zero? |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
258 beq L016C branch if so |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
259 clr ,-s else clear space on stack |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1891
diff
changeset
|
260 tst ddfmt,u double sided disk? |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
261 beq SnglSid branch if not |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
262 bra DblSid |
1515 | 263 * Double-sided code |
1520 | 264 L0152 com side,u flag side 2 |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
265 bne DblSid |
210
6bf55704c623
Boot is adapted from OS-9 Level Two boot module, now boots from
boisy
parents:
201
diff
changeset
|
266 inc ,s |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
267 DblSid subb ddtks,u |
210
6bf55704c623
Boot is adapted from OS-9 Level Two boot module, now boots from
boisy
parents:
201
diff
changeset
|
268 sbca #$00 |
1287 | 269 bcc L0152 |
270 bra L0168 | |
271 L0160 inc ,s | |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
272 SnglSid subb ddtks,u subtract sectors per track from B |
210
6bf55704c623
Boot is adapted from OS-9 Level Two boot module, now boots from
boisy
parents:
201
diff
changeset
|
273 sbca #$00 |
1287 | 274 bcc L0160 |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
275 L0168 addb #18 add sectors per track (should this be ddtks?) |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
276 puls a get current track indicator off of stack |
1287 | 277 L016C incb |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
278 stb SECTREG,y save in sector register |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
279 SetTrak ldb currtrak,u get current track in B |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
280 stb TRACKREG,y save in track register |
1520 | 281 cmpa currtrak,u same as A? |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
282 beq rtsok branch if so |
1514 | 283 sta currtrak,u |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
284 sta DATAREG,y |
1516 | 285 ldb #$10+STEP SEEK command |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
286 bsr Talk2FDC send command to controller |
0 | 287 pshs x |
1520 | 288 * Seek Delay |
289 ldx #$222E delay ~39 mSec (78mS L1) | |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
290 SeekDly leax -$01,x |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
291 bne SeekDly |
0 | 292 puls x |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
293 rtsok clrb |
1287 | 294 rts |
1516 | 295 |
296 *ChkErr bitb #$98 evaluate WD status (READY, RNF, CRC err) | |
297 * bne L0138 | |
298 * clrb | |
299 * rts | |
300 | |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
301 Talk2FDC bsr DoCMD issue FDC cmd, wait 54~ |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
302 FDCLoop ldb STATREG,y get status |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
303 bitb #$01 still BUSY? |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
304 bne FDCLoop loop until command completes |
1287 | 305 rts |
1516 | 306 |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
307 * Issue command and wait 54 clocks |
1520 | 308 * Controller requires a min delay of 14uS (DD) or 28uS (SD) |
309 * following a command write before status register is valid | |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
310 DoCMD bsr SelNSend |
1515 | 311 * Delay branches |
1520 | 312 * 54 clock delay including bsr (=30uS/L2,60us/L1) |
1891 | 313 * H6309 code changed to reduce code size, RG |
314 IFEQ H6309 | |
1515 | 315 Delay2 |
316 lbsr Delay3 | |
317 Delay3 | |
318 lbsr Delay4 | |
319 Delay4 | |
1891 | 320 ELSE |
321 Delay2 lda #5 3 cycles | |
322 Delay3 exg a,a 5 cycles | 10*5 | |
323 deca 2 cycles | | |
324 bne Delay3 3 cycles | | |
1287 | 325 ENDC |
326 rts | |
210
6bf55704c623
Boot is adapted from OS-9 Level Two boot module, now boots from
boisy
parents:
201
diff
changeset
|
327 |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
328 * Select And Send |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
329 * Entry: B = command byte |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
330 SelNSend lda drvsel,u |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
331 sta CONTROL,y |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
332 stb CMDREG,y |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
333 rts |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
334 |
1166 | 335 IFGT Level-1 |
1287 | 336 * Filler to get $1D0 |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
337 Filler fill $39,$1D0-3-2-1-* |
1166 | 338 ENDC |
0 | 339 |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
340 Address fdb DPort |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
341 WhichDrv fcb BootDr |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
342 |
0 | 343 emod |
344 eom equ * | |
48 | 345 end |