Mercurial > hg > Members > kono > nitros9-code
annotate level1/modules/boot_rampak.asm @ 3109:118cd9951d24
Small fixups in level 3 boot script
And add it and the boot list to the coco3 build.
author | Tormod Volden <debian.tormod@gmail.com> |
---|---|
date | Sun, 28 Feb 2016 22:48:32 +0100 |
parents | 0cf8513d33d7 |
children | e0614e08fa5e |
rev | line source |
---|---|
1187 | 1 ******************************************************************** |
2 * Boot - Disto RAMPak Boot Module | |
3 * | |
4 * $Id$ | |
5 * | |
1287 | 6 * Edt/Rev YYYY/MM/DD Modified by |
7 * Comment | |
1187 | 8 * ------------------------------------------------------------------ |
1287 | 9 * 5 ????/??/?? Alan DeKok |
10 * Created. | |
11 * | |
12 * 6 1998/10/20 Boisy G. Pitre | |
13 * Fixed small bugs, improved speed. | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
14 * |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
15 * 7 2005/10/14 Boisy G. Pitre |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
16 * Now uses boot_common.asm for fragmented bootfile support. |
1187 | 17 |
18 nam Boot | |
19 ttl Disto RAMPak Boot Module | |
20 | |
21 * Disassembled 94/06/25 11:37:47 by Alan DeKok | |
22 | |
1287 | 23 IFP1 |
1187 | 24 use defsfile |
1287 | 25 ENDC |
1187 | 26 |
27 tylg set Systm+Objct | |
28 atrv set ReEnt+rev | |
29 rev set $00 | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
30 edition set 7 |
1187 | 31 |
32 mod eom,name,tylg,atrv,start,size | |
33 | |
1894 | 34 * Common booter-required defines |
35 LSN24BIT equ 0 | |
36 FLOPPY equ 0 | |
37 | |
38 | |
1187 | 39 * on-stack buffer to use |
40 org 0 | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
41 mpisave rmb 1 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
42 * common booter required static variables |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
43 ddtks rmb 1 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
44 ddfmt rmb 1 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
45 seglist rmb 2 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
46 bootsize rmb 2 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
47 blockloc rmb 2 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
48 blockimg rmb 2 |
1965 | 49 LSN0Ptr rmb 2 In memory LSN0 pointer |
1187 | 50 size equ . |
51 | |
52 name equ * | |
53 fcs /Boot/ | |
54 fcb edition | |
55 | |
2049 | 56 use boot_common.asm |
1187 | 57 |
1894 | 58 * HWInit - Initialize the device |
59 * Entry: Y = hardware address | |
60 * Exit: Carry Clear = OK, Set = Error | |
61 * B = error (Carry Set) | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
62 HWInit lda >MPI.Slct get current slot |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
63 sta mpisave,u |
1187 | 64 lda >PakSlot,pcr get multipak slot number |
65 bmi cont if >127, invalid slot number | |
66 anda #$03 force it to be legal | |
67 ldb #$11 | |
68 mul put it into both nibbles | |
69 stb >MPI.Slct go to the desired slot | |
1894 | 70 cont clrb |
71 rts | |
1187 | 72 |
73 | |
1894 | 74 * HWTerm - Terminate the device |
75 * Entry: Y = hardware address | |
76 * Exit: Carry Clear = OK, Set = Error | |
77 * B = error (Carry Set) | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
78 HWTerm lda mpisave,u |
1187 | 79 sta >MPI.Slct |
1894 | 80 clrb |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
81 rts |
1187 | 82 |
83 | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
84 * HWRead - Read a 256 byte sector from the device |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
85 * Entry: Y = hardware address |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
86 * B = bits 23-16 of LSN |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
87 * X = bits 15-0 of LSN |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
88 * blockloc,u = ptr to 256 byte sector |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
89 * Exit: X = ptr to data (i.e. ptr in blockloc,u) |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
90 HWRead tfr x,d move 16 bit LSN into 2 8-bit registers |
1187 | 91 sta 2,y save HB LSN |
92 stb 1,y save LB LSN | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
93 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
94 ldx blockloc,u |
1187 | 95 clrb and start out at byte zero |
96 | |
97 ReadLp stb ,y save byte number | |
98 lda 3,y grab the byte | |
99 sta ,x+ save in the buffer | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
100 incb go to the next byte |
1187 | 101 bne ReadLp |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
102 leax -256,x |
1187 | 103 clrb no errors |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
104 rts |
1187 | 105 |
1287 | 106 IFGT Level-1 |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1533
diff
changeset
|
107 Pad fill $39,$1D0-3-2-1-* |
1287 | 108 ENDC |
1187 | 109 |
110 Address fdb $FF40 address of the device to boot from | |
111 PakSlot fcb $01 multipak slot number | |
112 | |
113 emod | |
114 eom equ * | |
115 end |