| 169 | } |
| 170 | |
| 171 | void decodeDataRecord() override |
| 172 | { |
| 173 | if (readRaw24() != MAC_DATA_RECORD) |
| 174 | return; |
| 175 | |
| 176 | /* Read data. */ |
| 177 | |
| 178 | readRawBits(8); /* skip spare byte */ |
| 179 | auto inputbuffer = toBytes(readRawBits(MAC_ENCODED_SECTOR_LENGTH * 8)) |
| 180 | .slice(0, MAC_ENCODED_SECTOR_LENGTH); |
| 181 | |
| 182 | for (unsigned i = 0; i < inputbuffer.size(); i++) |
| 183 | inputbuffer[i] = decode_data_gcr(inputbuffer[i]); |
| 184 | |
| 185 | _sector->status = Sector::BAD_CHECKSUM; |
| 186 | Bytes userData = decode_crazy_data(inputbuffer, _sector->status); |
| 187 | _sector->data.clear(); |
| 188 | _sector->data.writer() |
| 189 | .append(userData.slice(12, 512)) |
| 190 | .append(userData.slice(0, 12)); |
| 191 | } |
| 192 | }; |
| 193 | |
| 194 | std::unique_ptr<Decoder> createMacintoshDecoder(const DecoderProto& config) |
nothing calls this directly
no test coverage detected