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>
56 ; Name spt bls dks dir cks off
57 ; dpb dpb243, 26, 1024, 243, 64, 64, 2
58 ; dpb dp8192s,32, 4096,2046, 512, 512, 2
59 ; dpb dp8192, 32, 4096,2046,1024,1024, 2
60 ; dpb dpbrd, 32, 1024, 56, 32, 0, 2
61 dpb rd1016, 32, 2048, 508, 192, 0, 2
62 dpb rd1024, 32, 2048, 512, 192, 0, 0
63 dpb rd0960, 32, 2048, 480, 192, 0, 0
83 db msize - (msize/10)*10 + '0' ;modulo doesn't work?
175 ld a,(de) ;dpb[0] is sectors_per_track
180 jp z,boot1 ;no ram disk
182 call getdpb ;de = dpb of first ram disk
184 ; Check, if we have reserved tracks.
189 ld a,(hl) ;# of reserved tracks
192 jp z,boot1 ;Skip if not.
194 ; Save CPM to ram disk.
196 ld a,(de) ;sectors per track
203 ld d,1 ;sektor (0 based, skip ipl)
222 pop bc ;b = # of secs, c = track
229 cp d ;if sector >= spt then change tracks
252 ld a,1 shl BOOT_FUNC ;init (de)blocking
260 ld d,1 ;sektor (0 based)
287 cp d ;if sector >= spt then change tracks
317 msgSel: db 13,10,"Sel: ",0
331 ld a,e ;reselection bit
333 jp c,getdph ;skip, if disk already active
335 in a,(15) ;querry, if disk exists
343 ld a,(hl) ;get table entry for selected disk
347 or h ;return zero, if no entry (no disk)
355 ld bc,0 ; same as seek to track 0
384 and 3 ;mask write type
392 ;translate sector bc using table at de, res into hl