Honour the logical track numbering in MX disks (allows reading 40-track disks).

This commit is contained in:
David Given
2019-07-11 21:03:54 +02:00
parent 6959d18017
commit eee30db981
2 changed files with 3 additions and 2 deletions

View File

@@ -37,7 +37,7 @@ AbstractDecoder::RecordType MxDecoder::advanceToNextRecord()
const FluxMatcher* matcher = nullptr; const FluxMatcher* matcher = nullptr;
_sector->clock = _clock = _fmr->seekToPattern(ID_PATTERN, matcher); _sector->clock = _clock = _fmr->seekToPattern(ID_PATTERN, matcher);
readRawBits(32); /* skip the ID mark */ readRawBits(32); /* skip the ID mark */
readRawBits(32); /* skip the track number */ _logicalTrack = decodeFmMfm(readRawBits(32)).reader().read_be16();
} }
else if (_currentSector == 10) else if (_currentSector == 10)
{ {
@@ -67,7 +67,7 @@ void MxDecoder::decodeSectorRecord()
gotChecksum += br.read_le16(); gotChecksum += br.read_le16();
uint16_t wantChecksum = br.read_le16(); uint16_t wantChecksum = br.read_le16();
_sector->logicalTrack = _track->physicalTrack; _sector->logicalTrack = _logicalTrack;
_sector->logicalSide = _track->physicalSide; _sector->logicalSide = _track->physicalSide;
_sector->logicalSector = _currentSector; _sector->logicalSector = _currentSector;
_sector->data = bytes.slice(0, SECTOR_SIZE); _sector->data = bytes.slice(0, SECTOR_SIZE);

View File

@@ -15,6 +15,7 @@ public:
private: private:
nanoseconds_t _clock; nanoseconds_t _clock;
int _currentSector; int _currentSector;
int _logicalTrack;
}; };
#endif #endif