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

Method decodeSectorRecord

arch/tartu/decoder.cc:36–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34 }
35
36 void decodeSectorRecord() override
37 {
38 if (readRaw64() != HEADER_BITS)
39 return;
40
41 auto bits = readRawBits(16 * 4);
42 auto bytes = decodeFmMfm(bits).slice(0, 4);
43
44 ByteReader br(bytes);
45 uint8_t track = br.read_8();
46 _sector->logicalCylinder = track >> 1;
47 _sector->logicalHead = track & 1;
48 br.skip(1); /* seems always to be 1 */
49 _sector->logicalSector = br.read_8();
50 uint8_t wantChecksum = br.read_8();
51 uint8_t gotChecksum = ~sumBytes(bytes.slice(0, 3));
52
53 if (wantChecksum == gotChecksum)
54 _sector->status = Sector::DATA_MISSING;
55
56 _sector->status = Sector::DATA_MISSING;
57 }
58
59 void decodeDataRecord() override
60 {

Callers

nothing calls this directly

Calls 4

sumBytesFunction · 0.85
sliceMethod · 0.80
read_8Method · 0.80
decodeFmMfmFunction · 0.50

Tested by

no test coverage detected