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 $
30 nsects equ ($-ccp)/128 ;warm start sector count
53 jp clock ;zsdos compatible clock set/get
59 ;Drive A B C D E F G H I J K L
60 ;drvtbl:dtbl <dpha,dphb,dphc,dphd, , , , ,dphi,dphj,dphk,dphl>
61 ;drvtbl:dtbl <dpha, , , , , , , ,dphi,dphj,dphk,dphl>
62 ;drvtbl: dtbl < , , , , , , , ,dphi,dphj,dphk,dphl>
63 drvtbl:dtbl < , , , , , , , ,dphi>
65 ; Name spt bls dks dir cks off
66 ; dpb dpb243, 26, 1024, 243, 64, 64, 2
67 ; dpb dp8192s,32, 4096,2046, 512, 512, 2
68 ; dpb dp8192, 32, 4096,2046,1024,1024, 2
69 ; dpb dpbrd, 32, 1024, 56, 32, 0, 2
70 dpb rd192, 32, 1024, 192, 32, 0, 0
71 ; dpb rd1016, 32, 2048, 508, 192, 0, 2
72 ; dpb rd1024, 32, 2048, 512, 192, 0, 0
73 ; dpb rd0960, 32, 2048, 480, 192, 0, 0
94 db msize - (msize/10)*10 + '0' ;modulo doesn't work?
189 ld a,(de) ;dpb[0] is sectors_per_track
194 jp z,boot1 ;no ram disk
196 call getdpb ;de = dpb of first ram disk
198 ; Check, if we have reserved tracks.
203 ld a,(hl) ;# of reserved tracks
206 jp z,boot1 ;Skip if not.
208 ; Save CPM to ram disk.
210 ld a,(de) ;sectors per track
217 ld d,1 ;sektor (0 based, skip ipl)
236 pop bc ;b = # of secs, c = track
243 cp d ;if sector >= spt then change tracks
266 ld a,1 shl BOOT_FUNC ;init (de)blocking
270 ld e,0 ;clear reselection flag
275 ld d,1 ;sektor (0 based)
302 cp d ;if sector >= spt then change tracks
332 msgSel: db 13,10,"Sel: ",0
346 ld a,e ;reselection bit
348 jp c,getdph ;skip, if disk already active
350 in a,(15) ;querry, if disk exists
358 ld a,(hl) ;get table entry for selected disk
362 or h ;return zero, if no entry (no disk)
370 ld bc,0 ; same as seek to track 0
399 and 3 ;mask write type
407 ;translate sector bc using table at de, res into hl
419 ;------------------------------------------------------------------------
420 ; ZSDOS clock drivers may use registers BC and D without restoring them,
421 ; but must preserve the Z80's alternate and index registers.
422 ; Other registers must be used exactly as follows:
424 ; Enter: C = 00H to Read the Clock, 01H to Set the Clock
425 ; DE = Address of a 6-byte field to Receive or from which
426 ; to Set time in DateStamper format (BCD digits as:
427 ; YY MM DD HH MM SS). 24-hour operation is assumed.
429 ; Exit : A = 01H for a successful operation,
430 ; 0FFH for a failure of any sort (Can't set, etc.)
432 ; When Reading the Clock:
433 ; E = Original contents of Entry value of DE plus 5
434 ; HL = Entry value of DE plus 5 (Seconds field)
446 ld bc,6*256 + CLOCKPORT-1
464 ld bc,6*256 + CLOCKPORT+6
474 ;------------------------------------------------------------------------