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

Method decodeDataRecord

arch/macintosh/decoder.cc:171–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
194std::unique_ptr<Decoder> createMacintoshDecoder(const DecoderProto& config)

Callers

nothing calls this directly

Calls 7

sliceMethod · 0.80
writerMethod · 0.80
decode_data_gcrFunction · 0.70
decode_crazy_dataFunction · 0.70
toBytesFunction · 0.50
sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected