0
|
1 ********************************************************************
|
|
2 * RamPak - Disto RAM Pak device driver
|
|
3 *
|
|
4 * $Id$
|
|
5 *
|
|
6 * Ed. Comments Who YY/MM/DD
|
|
7 * ------------------------------------------------------------------
|
|
8 * 2 Original Disto version by Brian Lantz BL
|
|
9 * 3 Removed copyright info, removed useless BGP 98/10/20
|
|
10 * register saves, optimized, changed port
|
|
11 * address in descriptor to hold port address
|
|
12 * of RAM pak instead of MPI.
|
|
13
|
|
14 nam RamPak
|
|
15 ttl Disto RAM Pak device driver
|
|
16
|
|
17 * Disassembled 98/04/20 09:57:05 by Disasm v1.5 (C) 1988 by RML
|
|
18
|
|
19 ifp1
|
|
20 use defsfile
|
|
21 use rbfdefs
|
|
22 endc
|
|
23
|
|
24 tylg set Drivr+Objct
|
|
25 atrv set ReEnt+rev
|
|
26 rev set $01
|
|
27 edition set 3
|
|
28
|
|
29 mod eom,name,tylg,atrv,start,size
|
|
30
|
|
31 * RBF Data Area
|
|
32 rmb 129
|
|
33
|
|
34 * Free for driver use
|
|
35 ORGSlot rmb 1
|
|
36
|
|
37 size equ .
|
|
38 fcb $FF
|
|
39
|
|
40 name fcs /RamPak/
|
|
41 fcb edition
|
|
42 * fcc /(C) 1985 BRIAN A. LANTZ/
|
|
43 * fcb $0D
|
|
44 * fcc /LICENSED TO DISTO/
|
|
45
|
|
46 start lbra Init
|
|
47 lbra Read
|
|
48 lbra Write
|
|
49 lbra GetStat
|
|
50 lbra SetStat
|
|
51 lbra Term
|
|
52
|
|
53 * Init
|
|
54 *
|
|
55 * Entry:
|
|
56 * Y = address of device descriptor
|
|
57 * U = address of device memory area
|
|
58 *
|
|
59 * Exit:
|
|
60 * CC = carry set on error
|
|
61 * B = error code
|
|
62 *
|
|
63 Init ldd #($FF*256)+3
|
|
64 stb V.NDRV,u
|
|
65 leax DRVBEG,u
|
|
66 * For each B, compute total sectors...
|
|
67 Init010 sta V.TRAK,x
|
|
68 pshs b,a
|
|
69 lda IT.CYL+1,y
|
|
70 ldb IT.SCT+1,y
|
|
71 mul
|
|
72 std DD.TOT+1,x
|
|
73 puls b,a
|
|
74 leax DRVMEM,x
|
|
75 decb
|
|
76 bne Init010
|
|
77 rts
|
|
78
|
|
79 * Write
|
|
80 *
|
|
81 * Entry:
|
|
82 * B = MSB of the disk's LSN
|
|
83 * X = LSB of the disk's LSN
|
|
84 * Y = address of path descriptor
|
|
85 * U = address of device memory area
|
|
86 *
|
|
87 * Exit:
|
|
88 * CC = carry set on error
|
|
89 * B = error code
|
|
90 *
|
|
91 Write pshs cc
|
|
92 bsr SlctSlot
|
|
93 ldy V.PORT,u
|
|
94 WritLoop lda ,x+
|
|
95 stb ,y
|
|
96 sta 3,y
|
|
97 incb
|
|
98 bne WritLoop
|
|
99 bra RestSlot
|
|
100
|
|
101 * Read
|
|
102 *
|
|
103 * Entry:
|
|
104 * B = MSB of the disk's LSN
|
|
105 * X = LSB of the disk's LSN
|
|
106 * Y = address of path descriptor
|
|
107 * U = address of device memory area
|
|
108 *
|
|
109 * Exit:
|
|
110 * CC = carry set on error
|
|
111 * B = error code
|
|
112 *
|
|
113 Read cmpx #$0000
|
|
114 beq ReadLSN0
|
|
115
|
|
116 ReadSect pshs cc
|
|
117 bsr SlctSlot
|
|
118 ldy V.PORT,u
|
|
119 ReadLoop stb ,y
|
|
120 lda 3,y
|
|
121 sta ,x+
|
|
122 incb
|
|
123 bne ReadLoop
|
|
124
|
|
125 * Restore the original MPI slot value we saved off
|
|
126 RestSlot lda >ORGSlot,u
|
|
127 sta >MPI.Slct
|
|
128 puls cc
|
|
129 clrb
|
|
130 rts
|
|
131
|
|
132 * Read LSN0 into our path descriptor
|
|
133 ReadLSN0 pshs y
|
|
134 bsr ReadSect
|
|
135 puls y
|
|
136 ldx PD.BUF,y
|
|
137 lda <PD.DRV,y
|
|
138 leay DRVBEG,u
|
|
139 ldb #DRVMEM
|
|
140 mul
|
|
141 leay d,y
|
|
142 ldb #DD.SIZ-1
|
|
143 LSN0Loop lda b,x
|
|
144 sta b,y
|
|
145 decb
|
|
146 bne LSN0Loop
|
|
147 rts
|
|
148
|
|
149
|
|
150 * This routine selects the MPI slot
|
|
151 * Exit: X = address of path descriptor buffer
|
|
152 SlctSlot orcc #IntMasks mask interrupts
|
|
153 lda >MPI.Slct get current selected slot
|
|
154 sta >ORGSlot,u save off
|
|
155 lda PD.DRV,y get drive no.
|
|
156 ldb #$11
|
|
157 mul multiply drive no. times $11
|
|
158 stb >MPI.Slct set new MPI slot no.
|
|
159 tfr x,d
|
|
160 sta >$FF42 write LSN hi byte to PAK
|
|
161 stb >$FF41 write LSN lo byte to PAK
|
|
162 ldx PD.BUF,y load X with address of path buffer
|
|
163 clrb
|
|
164 rts
|
|
165
|
|
166 * GetStat
|
|
167 *
|
|
168 * Entry:
|
|
169 * A = function code
|
|
170 * Y = address of path descriptor
|
|
171 * U = address of device memory area
|
|
172 *
|
|
173 * Exit:
|
|
174 * CC = carry set on error
|
|
175 * B = error code
|
|
176 *
|
|
177 GetStat comb
|
|
178 ldb #E$UnkSvc
|
|
179 rts
|
|
180
|
|
181 SetStat
|
|
182 * Term
|
|
183 *
|
|
184 * Entry:
|
|
185 * U = address of device memory area
|
|
186 *
|
|
187 * Exit:
|
|
188 * CC = carry set on error
|
|
189 * B = error code
|
|
190 *
|
|
191 Term clrb
|
|
192 rts
|
|
193
|
|
194 emod
|
|
195 eom equ *
|
|
196 end
|