mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Micropolis: Fix encoder and decoder to support encodedecodetest
These changes should not impact reading/writing from real disks. This includes a bug fix to Fluxmap where it might miss a trailing interval when adding bits, as mentioned in #333. With the Fluxmap bug fixed, the encoder now includes index pulses in its output. The decoder was relaxed to allow reading precisely one track. We don't actually add an encodedecodetest for micropolis, though, because the SCP encoder is unhappy with so many revolutions.
This commit is contained in:
@@ -85,9 +85,10 @@ public:
|
||||
/* Discard a possible partial sector at the end of the track.
|
||||
* This partial sector could be mistaken for a conflicted sector, if
|
||||
* whatever data read happens to match the checksum of 0, which is
|
||||
* rare, but has been observed on some disks.
|
||||
* rare, but has been observed on some disks. There's 570uS of slack in
|
||||
* each sector, after accounting for preamble, data, and postamble.
|
||||
*/
|
||||
if (now > (getFluxmapDuration() - 12.5e6))
|
||||
if (now > (getFluxmapDuration() - 12.0e6))
|
||||
{
|
||||
seekToIndexMark();
|
||||
return 0;
|
||||
@@ -114,9 +115,10 @@ public:
|
||||
_sector->headerStartTime = tell().ns();
|
||||
|
||||
/* seekToPattern() can skip past the index hole, if this happens
|
||||
* too close to the end of the Fluxmap, discard the sector.
|
||||
* too close to the end of the Fluxmap, discard the sector. The
|
||||
* preamble was expected to be 640uS long.
|
||||
*/
|
||||
if (_sector->headerStartTime > (getFluxmapDuration() - 12.5e6))
|
||||
if (_sector->headerStartTime > (getFluxmapDuration() - 11.3e6))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user