annotate 3rdparty/booters/boot_vhd.asm @ 1834:87865128c951

Added defines for bit 2 of IT.DNS, which is track 0 density flag for format
author afra
date Tue, 31 May 2005 15:19:07 +0000
parents 34e7710d58a6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
553
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
1 ********************************************************************
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
2 * Boot - CoCo Emulator Virtual Hard Disk Booter
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
3 *
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
4 * $Id$
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
5 *
1354
34e7710d58a6 Added new style headers
boisy
parents: 553
diff changeset
6 * Edt/Rev YYYY/MM/DD Modified by
34e7710d58a6 Added new style headers
boisy
parents: 553
diff changeset
7 * Comment
553
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
8 * ------------------------------------------------------------------
1354
34e7710d58a6 Added new style headers
boisy
parents: 553
diff changeset
9 * 1 2002/10/10 Boisy G. Pitre
34e7710d58a6 Added new style headers
boisy
parents: 553
diff changeset
10 * Acquired from Robert Gault.
553
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
11
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
12 nam Boot
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
13 ttl CoCo Emulator Virtual Hard Disk Booter
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
14
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
15 ifp1
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
16 use defsfile
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
17 endc
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
18
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
19 tylg set Systm+Objct
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
20 atrv set ReEnt+rev
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
21 rev set 2
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
22
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
23 * This boot module is intended for either MESS or Jeff's emulator
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
24 * Written by Robert Gault based on a personal boot for an RGBDOS hard drive
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
25 * Hard Disk Interface registers for the VHD emulator drives
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
26
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
27 dataport equ $FF80
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
28 status equ dataport+3
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
29 commnd equ dataport+3
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
30 buffer equ dataport+4
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
31 lsn equ dataport
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
32
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
33
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
34 mod eom,name,tylg,atrv,start,size
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
35
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
36 blockloc rmb 2 pointer to memory requested
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
37 blockimg rmb 2 duplicate of the above
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
38 bootloc rmb 3 sector pointer; not byte pointer
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
39 bootsize rmb 2 size in bytes
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
40 size equ .
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
41
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
42 name fcs /Boot/
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
43 fcb 1
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
44 start clra
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
45 ldb #size
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
46 clean pshs a
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
47 decb
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
48 bne clean
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
49 tfr s,u get pointer to data area
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
50 pshs u save pointer to data area
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
51
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
52 lda #$d0 forced interrupt; kill floppy activity
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
53 sta $FF48 command register
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
54 clrb
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
55 pause decb
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
56 bne pause
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
57 lda $FF48 clear controller
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
58 clr $FF40 make sure motors are turned off
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
59 sta $FFD9 fast clock
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
60
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
61 * Request memory for LSN0
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
62 ldd #1
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
63 os9 F$SRqMem request one page of RAM
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
64 bcs error
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
65 bsr getpntr
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
66
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
67 * Get LSN0 into memory
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
68
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
69 clrb MSB sector
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
70 ldx #0 LSW sector
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
71 bsr mread
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
72 bcs error
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
73 ldd bootsize,u
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
74 beq error
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
75 pshs d
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
76
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
77 * Return memory
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
78
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
79 ldd #$100
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
80 ldu blockloc,u
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
81 os9 F$SRtMem
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
82 puls d
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
83 os9 F$BtMem
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
84 bcs error
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
85 bsr getpntr
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
86 std blockimg,u
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
87
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
88 * Get os9boot into memory
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
89
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
90 ldd bootsize,u
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
91 leas -2,s same as a PSHS D
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
92 getboot std ,s
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
93 ldb bootloc,u MSB sector location
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
94 ldx bootloc+1,u LSW sector location
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
95 bsr mread
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
96 ldd bootloc+1,u update sector location by one to 24bit word
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
97 addd #1
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
98 std bootloc+1,u
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
99 ldb bootloc,u
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
100 adcb #0
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
101 stb bootloc,u
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
102 inc blockloc,u update memory pointer for upload
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
103 ldd ,s update size of file left to read
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
104 subd #$100 file read one sector at a time
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
105 bhi getboot
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
106
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
107 leas 4+size,s reset the stack same as PULS U,D
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
108 ldd bootsize,u
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
109 ldx blockimg,u pointer to start of os9boot in memory
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
110 andcc #%11111110 clear carry
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
111 rts back to os9p1
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
112
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
113 error leas 2+size,s
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
114 ldb #E$NotRdy drive not ready
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
115 rts
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
116
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
117 getpntr tfr u,d save pointer to requested memory
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
118 ldu 2,s recover pointer to data stack
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
119 std blockloc,u
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
120 rts
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
121
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
122 mread tstb LSN0 high byte
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
123 bne read10
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
124 cmpx #0 LSN0 low word
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
125 bne read10
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
126 bsr read10
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
127 bcc readlsn0
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
128 rts
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
129
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
130 readlsn0 pshs a,x,y find location of boot track
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
131 ldy blockloc,u
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
132 lda DD.Bt,y os9boot pointer
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
133 ldx DD.Bt+1,y LSW of 24 bit address
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
134 sta bootloc,u
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
135 stx bootloc+1,u
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
136 ldx DD.BSZ,y os9boot size in bytes
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
137 stx bootsize,u
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
138 clra
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
139 puls a,x,y,pc
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
140
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
141 * Generic read
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
142
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
143 read10 clra
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
144 bsr setup
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
145 bra command
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
146
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
147 setup pshs x
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
148 stb lsn
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
149 stx lsn+1
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
150 ldx blockloc,u
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
151 stx buffer
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
152 puls x,pc
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
153
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
154 command
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
155 sta commnd
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
156 lda commnd
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
157 rts
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
158
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
159 * Fillers to get to $1D0
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
160
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
161 fill $39,$1D0-*-3
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
162
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
163 emod
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
164 eom equ *
b93501797906 Added boot_vhd.asm from Robert Gault
boisy
parents:
diff changeset
165 end