.db 0x10,0x00 ;chk size
.db 0x02,0x00 ;offset
-
-
dpbdat_myz80: ;
.db 0x02,0x80 ;sector offset, low(spt)
.db 0x00,0x05 ;high (spt), block shift
.db 0x00,0x01 ;chk size
.db 0x00,0x00 ;offset
+dpbdat_simhd: ;
+ .db 0x00,0x20 ;sector offset, low(spt)
+ .db 0x00,0x05 ;high (spt), block shift
+ .db 0x1F,0x01 ;bock mask, extent mask
+ .db 0xF9,0x07 ;disk size - 1,
+ .db 0xFF,0x03 ;dir max
+ .db 0xFF,0x00 ;alloc0, alloc1
+ .db 0x00,0x01 ;chk size
+ .db 0x06,0x00 ;offset
+
#if 0
;rd1016
.db 0x20,0x00 ;spt
;
; --------------------------------------------------------------------
; Description: Test, if first 2 Sectors are filled with 0xE5,
-; and Size = 8192 KB.
+; and Size = 8192KB + 256Bytes.
; ====================================================================
dsk_tst_myz80:
mov zl,temp3
rcall dsk_getpartentry ;get partition entry
ldd temp,z+PTAB_SIZE
- ldd temp2,z+PTAB_SIZE+1 ;check, if (rounded) size is 8192KB
- lsr temp2
- ror temp
- cpi temp,low(8192)
- ldi temp,high(8192)
+ ldd temp2,z+PTAB_SIZE+1 ;check, if size is 16385 phys. sectors
+ cpi temp,low(16385)
+ ldi temp,high(16385)
cpc temp2,temp
brne dsk_tmyz80_not ;wrong size
ori temp,0xff ;Not a MyZ80 hard disk image.
ret
+; ====================================================================
+; Function: Test disk format: simhd, simh altair 8800 hard disk format
+; ====================================================================
+; Parameters
+; --------------------------------------------------------------------
+; Registers : temp drive #
+;
+; --------------------------------------------------------------------
+; Description: Test, if first 6 tracks are filled with 0xE5,
+; and Size = 8192 KB.
+; Actually, only the first phys. sector is tested, since
+; the other 47 sectors are not in memory at this time.
+; ====================================================================
+dsk_tst_simhd:
+
+ mov zl,temp3
+ rcall dsk_getpartentry ;get partition entry
+ ldd temp,z+PTAB_SIZE
+ ldd temp2,z+PTAB_SIZE+1 ;check, if size is 16384 phys. sectors
+ cpi temp,low(16384)
+ ldi temp,high(16384)
+ cpc temp2,temp
+ brne dsk_tsimhd_not ;wrong size
+
+ ldiw z,hostbuf
+ ldi temp2,high(512)
+ clr _tmp0 ;low(512)
+
+dsk_tsimhd_loop:
+ ld temp,z+
+ cpi temp,0xE5
+ brne dsk_tsimhd_not
+ dec _tmp0
+ brne dsk_tsimhd_loop
+ dec temp2
+ brne dsk_tsimhd_loop
+
+ clr temp
+ ret
+
+dsk_tsimhd_not:
+ ori temp,0xff ;Not a simhd hard disk image.
+ ret
+
; ====================================================================
; Function:
; ====================================================================
rcall dsk_tst_yaze
breq dsk_img_prep
+; Test for simhd format.
+
+ rcall dsk_tst_simhd
+ ldiw z,dpbdat_simhd*2
+ breq dsk_img_fix
+
; Test for MyZ80 format.
rcall dsk_tst_myz80