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

Method decodeSectorRecord

arch/f85/decoder.cc:67–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65 }
66
67 void decodeSectorRecord() override
68 {
69 /* Skip sync bits and ID byte. */
70
71 if (readRaw24() != F85_SECTOR_RECORD)
72 return;
73
74 /* Read header. */
75
76 const auto& bytes = decode(readRawBits(6 * 10));
77
78 _sector->logicalSector = bytes[2];
79 _sector->logicalHead = 0;
80 _sector->logicalCylinder = bytes[0];
81
82 uint16_t wantChecksum = bytes.reader().seek(4).read_be16();
83 uint16_t gotChecksum = crc16(CCITT_POLY, 0xef21, bytes.slice(0, 4));
84 if (wantChecksum == gotChecksum)
85 _sector->status =
86 Sector::DATA_MISSING; /* unintuitive but correct */
87 }
88
89 void decodeDataRecord() override
90 {

Callers

nothing calls this directly

Calls 6

read_be16Method · 0.80
readerMethod · 0.80
sliceMethod · 0.80
decodeFunction · 0.70
crc16Function · 0.50
seekMethod · 0.45

Tested by

no test coverage detected