(Please excuse English in Hungarian forum)
11 sector format: to fit 11 sectors on a track, it is necessary to make the gap between sectors very small. In fact smaller than the WD177x datasheet says in the minimum
. But it seems to work! But I can see in the ep128emu source code (wd177x.cpp, WD177x::writeDataRegister() ) that it checks for a minimum gap size. These are my notes on track formats (will need fixed-spaced font and 80 columns to display properly):
;------------------------------------------------------------------------------
;
; NOTES ON TRACKS, SECTORS AND GAPS
; *********************************
;
; Disk spins at 300rpm = 5rps.
; Data rate is 250kb/s = 31,250 bytes/s.
; 31,250/5 = 6250 bytes/track
; (padding added to 6500 to allow for tolerances in disk speed).
;
; 9 sector format has an Index Address Mark (IAM) for PC compatibility but the
; WD177x doesn't need that for operation. So the PC-incompatible 10 and 11
; sector formats do not have this feature on the track to save track space for
; the extra sector(s).
;
;
; TRACK FORMATS
; ==============
;
; datasheet 9 10 11
; miniumum sectors sectors sectors GAP Description
; -------- ------- ------- ------ ------ ---------------
; TRACK HEAD:
; 32x4Eh 60x4Eh 60x4Eh !10x4Eh Gap 1a Index postamble \
; |
; 12x00h |
; 3xC2h IAM preamble |
; FCh IAM > HEAD
; 60x4Eh Gap 1b IAM postamble |
; --- -- -- |
; 136 60 10 BYTES IN TRACK HEAD /
;
; EACH SECTOR:
; 8x00h+ 12x00h+ 12x00h+ ! 3x00h+ \ \
; 3xA1h 3xA1h 3xA1h 3xA1h Gap 2 ID preamble | |
; FEh FEh FEh ID Mark | |
; 1xTRA 1xTRA 1xTRA Track # | |
; 1xSID 1xSID 1xSID Side # > ADDR |
; 1xSEC 1xSEC 1xSEC Sector # | |
; 1xLEN 1xLEN 1xLEN Length # | |
; 2xCRC 2xCRC 2xCRC | |
; 22x4Eh 22x4Eh 22x4Eh 22x4Eh Gap 3a ID postamble / > SECTOR
; 12x00h+ 12x00h+ 12x00h+ 12x00h+ \ | x n
; 3xA1h 3xA1h 3xA1h 3xA1h Gap 3b Data preamble | |
; FBh FBh FBh Data Mark | |
; 512xDAT 512xDAT 512xDAT User data > DATA |
; 2xCRC 2xCRC 2xCRC | |
; 24x4Eh 84x4Eh 40x4Eh ! 1x4Eh Gap 4 Data postamble / |
; --- --- --- |
; 658 614 566 BYTES PER SECTOR /
;
; TRACK TAIL:
; 16x4Eh 192x4Eh 50x4Eh !14x4Eh Gap 5 Index preamble \
; --- --- -- > TAIL
; 192 50 14 BYTES IN TRACK TAIL /
; ^
; ! = EXCEEDS DATASHEET MINIMUM !
;
;
; 136+ 60+ 10+
; 9*658+ 10*614+ 11*566+
; 192 50 14
; ===== ==== ====
; 6250 6250 6250 BYTES ON DISK
;
; 136+ 60+ 10+
; 9*656+ 10*612+ 11*564+
; 192 50 14
; ===== ==== ====
; 6232 6230 6228 BYTES IN BUFFER
; different because CRC is 2 bytes
; on disk but 1 byte (F7) in buffer
;
; Padding 250x4Eh 250x4Eh 250x4Eh
; 18x4Eh 20x4Eh 22x4Eh
; ===== ==== ====
; 6500 6500 6500 BYTES IN BUFFER TOTAL
;
; The extra padding to bring the size up to 6500 is to allow for variation in
; disk speed - bytes from the padding will be written as long as the WD177x is
; requesting more bytes.
;
; So the differences between the images are:
;
; 11 sector format has a smaller Gap1a Index Preamble
; 9 sector format has the IAM and pre- and post-amble
; 11 sector format has a smaller Gap 2 ID Preamble
; all formats have a different Gap 4 Data Postamble
; All formats have a different Gap 5 Index Preamble
Sector interleaving: I have not tried it yet (work in progress!) so it might work anyway! Explanation: the gap between sectors with the 11 sector format is very small. If you are reading more than one sector, by the time you read the second sector it has already passed the head, so the WD177x has to wait for another disk revolution. This makes it slow. So to avoid this, on the 11 sector format, interleaving is used - instead of the obvious sector order of 1,2,3,4,5,6,7,8,9,10,11, the 11-sector format uses something like 1,7,2,8,3,9,4,10,5,11,6. Maybe it will work anyway in ep128emu, maybe not, I just thought I'd mention it...
Disk change: ep128emu provides the disk change signal initially, and the z80 can reset it. This all works, but if the "disk" is changed through the menus, it needs to set the disk change signal again.
/RDY problem: EXDOS 3 does not use /RDY so now avoids the problem! But it is a difference from real hardware. I was able to make EXDOS <= 1.4 show the problem: copy lots of files to A: (I used the IS-DOS help files \HELP\*.HLP) and then delete them all - it takes a long time. This is because the "motor" turns off, so the EXDOS notices this, and waits for /RDY to change state (ie back up to speed) with a 1s timeout, but in ep128emu /RDY is constant (last line of Ep128VM::exdosPortReadCallback() in ep128vm.cpp). You could say this is a bug in EXDOS waiting for /RDY to *change* rather than waiting for /RDY to be *low*, but it is a difference between ep128emu and real hardware.
But nobody else seems to have noticed the /RDY problem and EXDOS 3 does not use /RDY so maybe not the most urgent fix!
B.