Mercurial > hg > Members > kono > nitros9-code
annotate level1/modules/boot_d64.asm @ 3295:6b7a7b233925 default tip
makefile: Allow PORTS with level1/2 mix
https://sourceforge.net/p/nitros9/feature-requests/10/
author | Tormod Volden <debian.tormod@gmail.com> |
---|---|
date | Tue, 19 Apr 2022 18:12:17 +0200 |
parents | e0614e08fa5e |
children |
rev | line source |
---|---|
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
1 ******************************************************************** |
1975
434d4bf3895b
Fixed up step rate to be same as default specified for descriptors at build
afra
parents:
1963
diff
changeset
|
2 * Boot_d64, bootfile for Dragon 32/64, Dragon Alpha/Professional. |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
3 * Provides HWInit, HWTerm, HWRead which are called by code in |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
4 * "use"d boot_common.asm |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
5 * |
1975
434d4bf3895b
Fixed up step rate to be same as default specified for descriptors at build
afra
parents:
1963
diff
changeset
|
6 * 2004-11-07, P.Harvey-Smith. |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
7 * First disasembly and porting |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
8 * |
1975
434d4bf3895b
Fixed up step rate to be same as default specified for descriptors at build
afra
parents:
1963
diff
changeset
|
9 * 2004-11-09, P.Harvey-Smith. |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
10 * Dragon Alpha code, I am not sure of how to disable NMI |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
11 * on the Alpha, it is simulated in software using the NMIFlag. |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
12 * |
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
13 * See DDisk.asm for a fuller discription of how Dragon Alpha |
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
14 * interface works. |
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
15 * |
1975
434d4bf3895b
Fixed up step rate to be same as default specified for descriptors at build
afra
parents:
1963
diff
changeset
|
16 * 2004-11-25, P.Harvey-Smith. |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
17 * Double sided Disk code added |
1734 | 18 * |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
19 * 2005-05-08, P.Harvey-Smith, |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
20 * Added code to force 5/8 line low on Alpha so correct clock selected. |
1734 | 21 * |
1838 | 22 * 2005-06-16, P.Harvey-Smith. |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
23 * Added NMI enable/disable code, as I know know how to enable/disable |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
24 * NMI on the Alpha, having disasembled the Alpha's OS9's ddisk. |
1838 | 25 * |
1896
3826bfe7d2e5
Timing fixes for Dragon Alpha, should now boot more reliably
afra
parents:
1838
diff
changeset
|
26 * 2005-10-22, P.Harvey-Smith. |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
27 * Removed unused user stack variable (u0000). |
1896
3826bfe7d2e5
Timing fixes for Dragon Alpha, should now boot more reliably
afra
parents:
1838
diff
changeset
|
28 * |
1963
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
29 * 2005-12-31, P.Harvey-Smith. |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
30 * Converted to using new boot system which can support fragmented |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
31 * boot files. |
1963
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
32 * |
1975
434d4bf3895b
Fixed up step rate to be same as default specified for descriptors at build
afra
parents:
1963
diff
changeset
|
33 * 2006-01-08, P.Harvey-Smith. |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
34 * Fixed up step-rate so that it is the same as that specified as the |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
35 * default when building NitrOS9, currently the distribution sets |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
36 * this to 12ms, as this seems to be the default for both the |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
37 * Dragon Data original 5.25" floppies, and for the Sony 3.5" |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
38 * drives in the Alpha. This allows NitrOS9 to boot correctly |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
39 * on Dragon Data 5.25" drives, and should also make booting on |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
40 * the Alpha much more reliable. |
1975
434d4bf3895b
Fixed up step rate to be same as default specified for descriptors at build
afra
parents:
1963
diff
changeset
|
41 * |
1838 | 42 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
43 nam Boot |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
44 ttl Dragon 32/64 Boot module |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
45 |
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
46 * Disassembled 1900/00/00 00:05:56 by Disasm v1.5 (C) 1988 by RML |
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
47 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
48 IFP1 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
49 use defsfile |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
50 ENDC |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
51 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
52 IFNE dalpha |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
53 * Dragon Alpha has a third PIA at $FF24, this is used for |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
54 * Drive select/motor control, and provides FIRQ from the |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
55 * disk controller. |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
56 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
57 DPPIADA equ DPPIA2DA |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
58 DPPIACRA equ DPPIA2CRA |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
59 DPPIADB equ DPPIA2DB |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
60 DPPIACRB equ DPPIA2CRB |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
61 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
62 PIADA equ DPPIADA+IO Side A Data/DDR |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
63 PIACRA equ DPPIACRA+IO Side A Control. |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
64 PIADB equ DPPIADB+IO Side A Data/DDR |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
65 PIACRB equ DPPIACRB+IO Side A Control. |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
66 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
67 * WD2797 Floppy disk controller, used in Alpha. Note registers in reverse order! |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
68 DPCMDREG equ DPCmdRegA command/status |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
69 DPTRKREG equ DPTrkRegA Track register |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
70 DPSECREG equ DPSecRegA Sector register |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
71 DPDATAREG equ DPDataRegA Data register |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
72 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
73 CMDREG equ DPCMDREG+IO command/status |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
74 TRKREG equ DPTRKREG+IO Track register |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
75 SECREG equ DPSECREG+IO Sector register |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
76 DATAREG equ DPDATAREG+IO Data register |
1734 | 77 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
78 * Disk IO bitmasks |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
79 NMIEn equ NMIEnA |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
80 WPCEn equ WPCEnA |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
81 SDensEn equ SDensEnA |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
82 MotorOn equ MotorOnA |
1963
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
83 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
84 * Drive selects for non default boot drives. |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
85 DRVSEL0 equ Drive0A |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
86 DRVSEL1 equ Drive1A |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
87 DRVSEL2 equ Drive2A |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
88 DRVSEL3 equ Drive3A |
1963
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
89 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
90 ELSE |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
91 DPPIADA equ DPPIA1DA |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
92 DPPIACRA equ DPPIA1CRA |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
93 DPPIADB equ DPPIA1DB |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
94 DPPIACRB equ DPPIA1CRB |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
95 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
96 PIADA equ DPPIADA+IO Side A Data/DDR |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
97 PIACRA equ DPPIACRA+IO Side A Control. |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
98 PIADB equ DPPIADB+IO Side A Data/DDR |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
99 PIACRB equ DPPIACRB+IO Side A Control. |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
100 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
101 * WD2797 Floppy disk controller, used in DragonDos. |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
102 DPCMDREG equ DPCmdRegD command/status |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
103 DPTRKREG equ DPTrkRegD Track register |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
104 DPSECREG equ DPSecRegD Sector register |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
105 DPDATAREG equ DPDataRegD Data register |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
106 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
107 CMDREG equ DPCMDREG+IO command/status |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
108 TRKREG equ DPTRKREG+IO Track register |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
109 SECREG equ DPSECREG+IO Sector register |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
110 DATAREG equ DPDATAREG+IO Data register |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
111 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
112 * Disk IO bitmasks |
1734 | 113 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
114 NMIEn equ NMIEnD |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
115 WPCEn equ WPCEnD |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
116 SDensEn equ SDensEnD |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
117 MotorOn equ MotorOnD |
1734 | 118 |
1963
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
119 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
120 * Drive selects for non default boot drives. |
1963
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
121 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
122 DRVSEL0 equ Drive0D |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
123 DRVSEL1 equ Drive1D |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
124 DRVSEL2 equ Drive2D |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
125 DRVSEL3 equ Drive3D |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
126 ENDC |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
127 |
1963
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
128 * Default Boot is from drive 0 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
129 BootDr set DRVSEL0 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
130 IFEQ DNum-1 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
131 BootDr set DRVSEL1 Alternate boot from drive 1 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
132 ENDC |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
133 IFEQ DNum-2 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
134 BootDr set DRVSEL2 Alternate boot from drive 2 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
135 ENDC |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
136 IFEQ DNum-3 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
137 BootDr set DRVSEL3 Alternate boot from drive 3 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
138 ENDC |
1963
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
139 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
140 StepRate equ 3-STEP Convert OS9 steprate code to WD. |
1734 | 141 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
142 tylg set Systm+Objct |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
143 atrv set ReEnt+rev |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
144 rev set $01 |
1734 | 145 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
146 mod eom,name,tylg,atrv,start,size |
1963
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
147 |
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
148 * NOTE: these are U-stack offsets, not DP |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
149 seglist rmb 2 pointer to segment list |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
150 blockloc rmb 2 pointer to memory requested |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
151 blockimg rmb 2 duplicate of the above |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
152 bootsize rmb 2 size in bytes |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
153 LSN0Ptr rmb 2 In memory LSN0 pointer |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
154 drvsel rmb 1 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
155 CurrentTrack rmb 1 Current track number |
1963
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
156 * Note, for optimization purposes, the following two variables |
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
157 * should be adjacent!! |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
158 ddtks rmb 1 no. of sectors per track |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
159 ddfmt rmb 1 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
160 side rmb 1 side 2 flag |
1963
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
161 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
162 size equ . |
1734 | 163 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
164 name equ * |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
165 fcs /Boot/ |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
166 fcb $00 |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
167 |
1963
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
168 * Common booter-required defines |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
169 LSN24BIT equ 0 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
170 FLOPPY equ 1 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
171 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
172 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
173 HWInit clra |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
174 ldx #CMDREG Force interrupt |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
175 lda #FrcInt |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
176 sta ,x |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
177 lbsr Delay Wait for command to complete |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
178 lda ,x |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
179 lda piadb Clear DRQ from WD. |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
180 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
181 IFNE dalpha |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
182 lda #NMICA2Dis Set PIA2 CA2 as output & disable NMI |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
183 sta PIA2CRA |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
184 ENDC |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
185 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
186 lda #$FF |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
187 sta CurrentTrack,u |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
188 leax >NMIService,pcr Setup NMI Handler. |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
189 stx >D.XNMI+1 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
190 lda #$7E $7E=JMP |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
191 sta >D.XNMI |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
192 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
193 lda #MotorOn Turn on motor |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
194 ora WhichDrv,pcr OR in selected drive |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
195 sta drvsel,u save drive selection byte |
1896
3826bfe7d2e5
Timing fixes for Dragon Alpha, should now boot more reliably
afra
parents:
1838
diff
changeset
|
196 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
197 IFNE dalpha |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
198 lbsr AlphaDskCtl |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
199 ELSE |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
200 sta >DSKCTL |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
201 ENDC |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
202 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
203 ldd #$C350 Delay while motors spin up |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
204 MotorOnDelay |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
205 nop |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
206 nop |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
207 subd #$0001 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
208 bne MotorOnDelay |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
209 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
210 HWTerm clrb |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
211 rts |
1963
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
212 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
213 use boot_common.asm |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
214 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
215 * |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
216 * Reset disk heads to track 0 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
217 * |
1734 | 218 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
219 ResetTrack0 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
220 clr CurrentTrack,u Zero current track |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
221 lda #$05 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
222 L00A9 ldb #StpICmnd+StepRate Step in |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
223 pshs a |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
224 lbsr CommandWaitReady |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
225 puls a |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
226 deca |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
227 bne L00A9 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
228 ldb #RestCmnd+StepRate Restore to track 0 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
229 lbra CommandWaitReady |
1734 | 230 |
1963
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
231 * HWRead - Read a 256 byte sector from the device |
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
232 * Entry: Y = hardware address |
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
233 * B = bits 23-16 of LSN |
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
234 * X = bits 15-0 of LSN |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
235 * blockloc,u = ptr to 256 byte sector |
1963
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
236 * Exit: X = ptr to data (i.e. ptr in blockloc,u) |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
237 * Carry Clear = OK, Set = Error |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
238 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
239 ReadSec |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
240 HWRead |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
241 lda #$91 Retry count |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
242 bsr ReadDataWithRetry Yes read sector |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
243 bcs ReadDataExit And restore Y=LSN0 pointer |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
244 ldx blockloc,u |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
245 clrb |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
246 ReadDataExit |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
247 rts |
1734 | 248 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
249 ReadDataRetry |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
250 bcc ReadDataWithRetry Retry data read if error |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
251 pshs x,b,a |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
252 bsr ResetTrack0 Recalibrate drive |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
253 puls x,b,a |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
254 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
255 ReadDataWithRetry |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
256 pshs x,b,a |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
257 bsr DoReadData Try reading data |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
258 puls x,b,a |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
259 bcc ReadDataExit No error, return to caller |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
260 lsra decrement retry count |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
261 bne ReadDataRetry retry read on error |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
262 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
263 DoReadData |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
264 bsr SeekTrack Seek to correct track |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
265 bcs ReadDataExit Error : exit |
1734 | 266 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
267 ldx blockloc,u Set X=Data load address |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
268 pshs y,dp,cc |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
269 orcc #$50 Enable FIRQ=DRQ from WD |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
270 lda #$FF Make DP=$FF, so access to WD regs faster |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
271 tfr a,dp |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
272 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
273 lda #$34 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
274 sta <dppia0crb Disable out PIA0 IRQ |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
275 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
276 lda #$37 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
277 sta <dppiacrb Enable FIRQ |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
278 lda <dppiadb Clear any pending FIRQ |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
279 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
280 lda drvsel,u |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
281 ora #NMIEn |
1734 | 282 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
283 IFNE dalpha |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
284 lbsr AlphaDskCtl |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
285 ELSE |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
286 sta <dpdskctl |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
287 ENDIF |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
288 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
289 ldb #ReadCmnd Issue a read command |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
290 orb side,u mask in side select |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
291 stb <dpcmdreg |
1896
3826bfe7d2e5
Timing fixes for Dragon Alpha, should now boot more reliably
afra
parents:
1838
diff
changeset
|
292 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
293 IFNE dalpha |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
294 lda #NMICA2En Enable NMI |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
295 sta <DPPIA2CRA |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
296 ENDIF |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
297 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
298 ReadDataWait |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
299 sync Read data from controller, save |
1896
3826bfe7d2e5
Timing fixes for Dragon Alpha, should now boot more reliably
afra
parents:
1838
diff
changeset
|
300 ReadDataNow |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
301 lda <dpdatareg in memory at X |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
302 ldb <dppiadb |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
303 sta ,x+ |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
304 bra ReadDataWait We break out with an NMI |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
305 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
306 * |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
307 * NMI service routine. |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
308 * |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
309 |
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
310 NMIService |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
311 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
312 leas R$Size,s Drop saved Regs from stack |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
313 lda #MotorOn |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
314 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
315 IFNE dalpha |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
316 lbsr AlphaDskCtl |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
317 lda #NMICA2Dis Disable NMI |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
318 sta <DPPIA2CRA |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
319 ELSE |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
320 sta <dpdskctl |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
321 ENDIF |
1734 | 322 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
323 lda #$34 Disable FIRQ inturrupt |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
324 sta <dppiacrb |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
325 ldb <dpcmdreg |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
326 puls y,dp,cc |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
327 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
328 bitb #$04 Check for error |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
329 lbeq L015A |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
330 L011A comb |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
331 ldb #$F4 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
332 rts |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
333 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
334 * |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
335 * Seek to a track, at this point Y still points to |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
336 * in memory copy of LSN0 (if not reading LSN0 !). |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
337 * |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
338 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
339 SeekTrack |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
340 ldy LSN0Ptr,u Get LSN0 pointer |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
341 tfr x,d |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
342 cmpd #$0000 LSN0 ? |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
343 beq SeekCalcSkip |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
344 clr ,-s Zero track counter |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
345 bra L012E |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
346 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
347 L012C inc ,s |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
348 L012E |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
349 subd DD.Spt,Y Take sectors per track from LSN |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
350 bcc L012C still +ve ? keep looping |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
351 addd DD.Spt,Y Compensate for over-loop |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
352 puls a retrieve track count. |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
353 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
354 * At this point the A contains the track number, |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
355 * and B contains the sector number on that track. |
1734 | 356 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
357 SeekCalcSkip |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
358 pshs b Save sector number |
1734 | 359 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
360 ldb DD.Fmt,Y Is the media double sided ? |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
361 lsrb |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
362 bcc DiskSide0 skip if not |
1734 | 363 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
364 lsra Get bit 0 into CC, and divide track by 2 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
365 bcc DiskSide0 Even track no so it's on side 0 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
366 ldb #Sid2Sel Odd track so on side 1, flag it |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
367 bra SetSide |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
368 |
1734 | 369 DiskSide0 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
370 clrb Single sided, make sure sidesel set correctly |
1734 | 371 SetSide |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
372 stb side,U Set side |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
373 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
374 puls b Get sector number |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
375 incb |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
376 stb SECREG |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
377 ldb CurrentTrack,u |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
378 stb TRKREG |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
379 cmpa CurrentTrack,u |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
380 beq L0158 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
381 sta CurrentTrack,u |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
382 sta DATAREG |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
383 ldb #SeekCmnd+3 Seek command+ step rate code $13 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
384 bsr CommandWaitReady |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
385 pshs x |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
386 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
387 ldx #$222E Wait for head to settle. |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
388 SettleWait |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
389 leax -$01,x |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
390 bne SettleWait |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
391 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
392 puls x |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
393 L0158 clrb |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
394 rts |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
395 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
396 L015A bitb #$98 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
397 bne L011A |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
398 clrb |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
399 rts |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
400 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
401 CommandWaitReady |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
402 bsr MotorOnCmdBDelay Turn on motor and give command to WD |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
403 CommandWait |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
404 ldb >CMDREG Get command status |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
405 bitb #$01 finished ? |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
406 bne CommandWait nope : continue waiting. |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
407 rts |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
408 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
409 MotorOnCmdB |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
410 lda drvsel,u Turn on motor |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
411 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
412 IFNE dalpha |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
413 bsr AlphaDskCtl |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
414 ELSE |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
415 sta >DSKCTL |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
416 ENDIF |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
417 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
418 stb >CMDREG Give command from B |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
419 rts |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
420 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
421 MotorOnCmdBDelay |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
422 bsr MotorOnCmdB |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
423 Delay lbsr Delay2 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
424 Delay2 lbsr Delay3 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
425 Delay3 rts |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
426 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
427 IFNE dalpha |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
428 * |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
429 * Turn on drives/motor/nmi for The Dragon Alpha. |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
430 * |
1734 | 431 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
432 AlphaDskCtl |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
433 pshs X,A,B,CC |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
434 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
435 bita #MotorOn test motor on ? |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
436 bne MotorRunning |
1896
3826bfe7d2e5
Timing fixes for Dragon Alpha, should now boot more reliably
afra
parents:
1838
diff
changeset
|
437 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
438 clra No, turn off other bits. |
1896
3826bfe7d2e5
Timing fixes for Dragon Alpha, should now boot more reliably
afra
parents:
1838
diff
changeset
|
439 MotorRunning |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
440 anda #Mask58 Mask out 5/8 bit to force the use of 5.25" clock |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
441 sta -1,s |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
442 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
443 orcc #$50 disable inturrupts |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
444 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
445 ldx #PIA2DA |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
446 lda #AYIOREG AY-8912 IO register |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
447 sta 2,X Output to PIA |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
448 ldb #AYREGLatch Latch register to modify |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
449 stb ,x |
1896
3826bfe7d2e5
Timing fixes for Dragon Alpha, should now boot more reliably
afra
parents:
1838
diff
changeset
|
450 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
451 clr ,x Idle AY |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
452 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
453 lda -1,s Fetch saved Drive Selects etc |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
454 sta 2,x output to PIA |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
455 ldb #AYWriteReg Write value to latched register |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
456 stb ,x |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
457 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
458 clr ,x |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
459 |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
460 puls x,A,B,CC |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
461 rts |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
462 ENDC |
1727
78ce0a5ffc8e
Incorporated changes and additions made by Phill Harvey-Smith for the
boisy
parents:
diff
changeset
|
463 |
1963
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
464 Address fdb DPort |
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
465 WhichDrv fcb BootDr |
4b599621c682
Moved to using new boot_common/hardware dependent boot system
afra
parents:
1896
diff
changeset
|
466 |
3130
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
467 emod |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
468 eom equ * |
e0614e08fa5e
l1 boot modules: Expand documentation and clean up code
Neal Crook <foofoobedoo@gmail.com>
parents:
2933
diff
changeset
|
469 end |