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>
54 ;drvtbl: dtbl < , , , , , , , ,dphi,dphj,dphk,dphl>
55 drvtbl:dtbl < , , , , , , , ,dphi>
57 ; Name spt bls dks dir cks off
58 ; dpb dpb243, 26, 1024, 243, 64, 64, 2
59 ; dpb dp8192s,32, 4096,2046, 512, 512, 2
60 ; dpb dp8192, 32, 4096,2046,1024,1024, 2
61 ; dpb dpbrd, 32, 1024, 56, 32, 0, 2
62 dpb rd192, 32, 1024, 192, 32, 0, 0
63 ; dpb rd1016, 32, 2048, 508, 192, 0, 2
64 ; dpb rd1024, 32, 2048, 512, 192, 0, 0
65 ; dpb rd0960, 32, 2048, 480, 192, 0, 0
86 db msize - (msize/10)*10 + '0' ;modulo doesn't work?
178 ld a,(de) ;dpb[0] is sectors_per_track
183 jp z,boot1 ;no ram disk
185 call getdpb ;de = dpb of first ram disk
187 ; Check, if we have reserved tracks.
192 ld a,(hl) ;# of reserved tracks
195 jp z,boot1 ;Skip if not.
197 ; Save CPM to ram disk.
199 ld a,(de) ;sectors per track
206 ld d,1 ;sektor (0 based, skip ipl)
225 pop bc ;b = # of secs, c = track
232 cp d ;if sector >= spt then change tracks
255 ld a,1 shl BOOT_FUNC ;init (de)blocking
259 ld e,0 ;clear reselection flag
264 ld d,1 ;sektor (0 based)
291 cp d ;if sector >= spt then change tracks
321 msgSel: db 13,10,"Sel: ",0
335 ld a,e ;reselection bit
337 jp c,getdph ;skip, if disk already active
339 in a,(15) ;querry, if disk exists
347 ld a,(hl) ;get table entry for selected disk
351 or h ;return zero, if no entry (no disk)
359 ld bc,0 ; same as seek to track 0
388 and 3 ;mask write type
396 ;translate sector bc using table at de, res into hl