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

Method decodeSectorRecord

arch/tids990/decoder.cc:55–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 }
54
55 void decodeSectorRecord() override
56 {
57 auto bits = readRawBits(TIDS990_SECTOR_RECORD_SIZE * 16);
58 auto bytes = decodeFmMfm(bits).slice(0, TIDS990_SECTOR_RECORD_SIZE);
59
60 ByteReader br(bytes);
61 if (br.read_be16() != SECTOR_ID)
62 return;
63
64 uint16_t gotChecksum =
65 crc16(CCITT_POLY, bytes.slice(1, TIDS990_SECTOR_RECORD_SIZE - 3));
66
67 _sector->logicalHead = br.read_8() >> 3;
68 _sector->logicalCylinder = br.read_8();
69 br.read_8(); /* number of sectors per track */
70 _sector->logicalSector = br.read_8();
71 br.read_be16(); /* sector size */
72 uint16_t wantChecksum = br.read_be16();
73
74 if (wantChecksum == gotChecksum)
75 _sector->status =
76 Sector::DATA_MISSING; /* correct but unintuitive */
77 }
78
79 void decodeDataRecord() override
80 {

Callers

nothing calls this directly

Calls 5

sliceMethod · 0.80
read_be16Method · 0.80
read_8Method · 0.80
decodeFmMfmFunction · 0.50
crc16Function · 0.50

Tested by

no test coverage detected