Improve some messaging. A data record is always pushed, even if it's empty (to

help debugging).
This commit is contained in:
David Given
2020-01-26 17:49:12 +01:00
parent 0c48897814
commit 6af80d1e5e
3 changed files with 7 additions and 8 deletions

View File

@@ -100,7 +100,8 @@ AbstractDecoder::RecordType IbmDecoder::advanceToNextRecord()
if (_currentHeaderLength > 0)
readRawBits(_currentHeaderLength*16);
auto idbits = readRawBits(16);
uint8_t id = decodeFmMfm(idbits).slice(0, 1)[0];
const Bytes idbytes = decodeFmMfm(idbits);
uint8_t id = idbytes.slice(0, 1)[0];
seek(here);
switch (id)

View File

@@ -52,13 +52,11 @@ void AbstractDecoder::decodeToSectors(Track& track)
sector.headerStartTime = recordStart.ns();
sector.headerEndTime = recordEnd.ns();
r = advanceToNextRecord();
recordStart = fmr.tell();
if (r == DATA_RECORD)
{
recordStart = fmr.tell();
decodeDataRecord();
recordEnd = fmr.tell();
pushRecord(recordStart, recordEnd);
}
recordEnd = fmr.tell();
pushRecord(recordStart, recordEnd);
}
sector.dataStartTime = recordStart.ns();
sector.dataEndTime = recordEnd.ns();

View File

@@ -227,8 +227,8 @@ void readDiskCommand(AbstractDecoder& decoder)
std::cout << "\nRaw (undecoded) records follow:\n\n";
for (auto& record : track->rawrecords)
{
std::cout << fmt::format("I+{:.2f}us", record.position.ns() / 1000.0)
<< std::endl;
std::cout << fmt::format("I+{:.2f}us with {:.2f}us clock\n",
record.position.ns() / 1000.0, record.clock / 1000.0);
hexdump(std::cout, record.data);
std::cout << std::endl;
}