2 ; Copyright (C) 2010 Sprite_tm
4 ; This program is free software: you can redistribute it and/or modify
5 ; it under the terms of the GNU General Public License as published by
6 ; the Free Software Foundation, either version 3 of the License, or
7 ; (at your option) any later version.
9 ; This program is distributed in the hope that it will be useful,
10 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ; GNU General Public License for more details.
14 ; You should have received a copy of the GNU General Public License
15 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
17 ; $Id: bios.asm 71 2010-08-06 19:38:10Z leo $
27 nsects equ ($-ccp)/128 ;warm start sector count
51 ;Drive A B C D E F G H I J K L
52 ;drvtbl: dtbl <dpha,dphb,dphc,dphd, , , , ,dphi,dphj,dphk,dphl>
53 drvtbl: dtbl <dpha, , , , , , , ,dphi,dphj,dphk,dphl>
55 ; Name spt bls dks dir cks off
56 dpb dpb243, 26, 1024, 243, 64, 64, 2
57 dpb dp8192s,32, 4096,2046, 512, 512, 2
58 dpb dp8192, 32, 4096,2046,1024,1024, 2
59 ; dpb dpbrd, 32, 1024, 56, 32, 0, 2
60 dpb rd1016, 32, 2048, 508, 192, 0, 2
61 dpb rd1024, 32, 2048, 512, 192, 0, 0
62 dpb rd0960, 32, 2048, 480, 192, 0, 0
82 db msize - (msize/10)*10 + '0' ;modulo doesn't work?
174 ld a,(de) ;dpb[0] is sectors_per_track
179 jp z,boot1 ;no ram disk
181 call getdpb ;de = dpb of first ram disk
183 ; Check, if we have reserved tracks.
188 ld a,(hl) ;# of reserved tracks
191 jp z,boot1 ;Skip if not.
193 ; Save CPM to ram disk.
195 ld a,(de) ;sectors per track
202 ld d,1 ;sektor (0 based, skip ipl)
221 pop bc ;b = # of secs, c = track
228 cp d ;if sector >= spt then change tracks
251 ld a,1 shl BOOT_FUNC ;init (de)blocking
259 ld d,1 ;sektor (0 based)
286 cp d ;if sector >= spt then change tracks
316 msgSel: db 13,10,"Sel: ",0
330 ld a,e ;reselection bit
332 jp c,getdph ;skip, if disk already active
334 in a,(15) ;querry, if disk exists
342 ld a,(hl) ;get table entry for selected disk
346 or h ;return zero, if no entry (no disk)
354 ld bc,0 ; same as seek to track 0
383 and 3 ;mask write type
391 ;translate sector bc using table at de, res into hl