| 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 | { |