Make the a2r flux sink build. Tracks are now always in the native numbering.

This commit is contained in:
David Given
2022-06-15 23:33:00 +02:00
parent 404f583dc2
commit cb5c0d5ebe
2 changed files with 2 additions and 12 deletions

View File

@@ -4,6 +4,7 @@ LIBFLUXENGINE_SRCS = \
lib/decoders/fmmfm.cc \
lib/decoders/decoders.cc \
lib/encoders/encoders.cc \
lib/fluxsink/a2rfluxsink.cc \
lib/fluxsink/aufluxsink.cc \
lib/fluxsink/fl2fluxsink.cc \
lib/fluxsink/fluxsink.cc \

View File

@@ -105,21 +105,10 @@ private:
void writeFlux(int cylinder, int head, const Fluxmap& fluxmap) override
{
// Note: this assumes that 'cylinder' numbers are in the PC high density 5.25 drive numbering, NOT apple numbering
unsigned location = cylinder * 2 + head;
if(!fluxmap.bytes()) {
return;
}
if (location > 255) {
Error() << fmt::format("A2R: cannot write track {} head {}, "
"{} does not fit within the location field\n",
cylinder, head, location);
return;
}
// Writing from an image (as opposed to from a floppy) will contain exactly one revolution and no index events.
auto is_image = [](auto &fluxmap) {
FluxmapReader fmr(fluxmap);
@@ -187,7 +176,7 @@ private:
uint32_t chunk_size = 10 + trackBytes.size();
_strmWriter.write_8(location);
_strmWriter.write_8(cylinder);
_strmWriter.write_8(A2R_TIMING);
_strmWriter.write_le32(trackBytes.size());
_strmWriter.write_le32(ticks_to_a2r(loopPoint));