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 msize: equ 62 ;size of available RAM in k
19 bias: equ (msize-20) * 1024
20 ccp: equ $3400+bias ;base of cpm ccp
21 bdos: equ ccp+$806 ;base of bdos
22 bios: equ ccp+$1600 ;base of bios
23 cdisk: equ $0004 ;current disk number (0 ... 15)
24 iobyte: equ $0003 ;intel iobyte
25 buff: equ $0080 ;default buffer address
26 retry: equ 3 ;max retries on disk i/o before error
37 nsects: equ ($-ccp)/128 ;warm start sector count
61 db msize - (msize/10)*10 + '0' ;modulo doesn't work?
83 ld d,1 ;sektor (0 based)
109 cp 26 ;if sector >= 26 then change tracks
171 ld hl,0 ;error return code
174 cp 0 ;only one disk supportet
176 ld hl,dph ;return disk parameter header address
184 ld bc,0 ; same as seek to track 0
212 or c ;merge write type in c
218 ;translate sector bc using table at de, res into hl
242 ;Disk Parameter Header
244 dw 0 ;XLT: No sector translation table
245 dw 0 ;000: Scratchpad
246 dw 0 ;000: Scratchpad
247 dw 0 ;000: Scratchpad
248 dw dirbuf ;DIRBUF: Address of a dirbuff scratchpad
249 dw dpb ;DPB: Address of a disk parameter block
250 dw chk ;CSV: Address of scratchpad area for changed disks
251 dw all ;ALV: Address of an allocation info sratchpad
254 dw 26 ;SPT: sectors per track
255 db 3 ;BSH: data allocation block shift factor
256 db 7 ;BLM: Data Allocation Mask
258 dw 242 ;DSM: Disk storage capacity
259 dw 63 ;DRM, no of directory entries
262 dw 16 ;CKS, size of dir check vector
263 dw 2 ;OFF, no of reserved tracks