MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / decodeSectorRecord

Method decodeSectorRecord

arch/c64/decoder.cc:67–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65 }
66
67 void decodeSectorRecord() override
68 {
69 if (readRaw20() != C64_SECTOR_RECORD)
70 return;
71
72 const auto& bits = readRawBits(5 * 10);
73 const auto& bytes = decode(bits).slice(0, 5);
74
75 uint8_t checksum = bytes[0];
76 _sector->logicalSector = bytes[1];
77 _sector->logicalHead = 0;
78 _sector->logicalCylinder = bytes[2] - 1;
79 if (checksum == xorBytes(bytes.slice(1, 4)))
80 _sector->status =
81 Sector::DATA_MISSING; /* unintuitive but correct */
82 }
83
84 void decodeDataRecord() override
85 {

Callers

nothing calls this directly

Calls 3

xorBytesFunction · 0.85
sliceMethod · 0.80
decodeFunction · 0.70

Tested by

no test coverage detected