diff --git a/arch/amiga/decoder.cc b/arch/amiga/decoder.cc index b9a96ca4..85222b33 100644 --- a/arch/amiga/decoder.cc +++ b/arch/amiga/decoder.cc @@ -68,12 +68,6 @@ public: _sector->status = (gotdatachecksum == wanteddatachecksum) ? Sector::OK : Sector::BAD_CHECKSUM; } - std::set requiredSectors(const Location&) const override - { - static std::set sectors = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; - return sectors; - } - private: const AmigaDecoderProto& _config; nanoseconds_t _clock; diff --git a/arch/apple2/decoder.cc b/arch/apple2/decoder.cc index c3efa7db..a5d1062a 100644 --- a/arch/apple2/decoder.cc +++ b/arch/apple2/decoder.cc @@ -144,14 +144,6 @@ public: _sector->status = Sector::BAD_CHECKSUM; _sector->data = decode_crazy_data(&bytes[0], _sector->status); } - - std::set requiredSectors(const Location& location) const override - { - std::set sectors; - for (int sectorId = 0; sectorId < APPLE2_SECTORS; sectorId++) - sectors.insert(sectorId); - return sectors; - } }; std::unique_ptr createApple2Decoder(const DecoderProto& config) diff --git a/arch/c64/c64.cc b/arch/c64/c64.cc index f4ba821c..9e5f4d7c 100644 --- a/arch/c64/c64.cc +++ b/arch/c64/c64.cc @@ -13,16 +13,6 @@ * * The clock rate is normalised for a 200ms drive. */ -unsigned sectorsForC64Track(unsigned track) -{ - if (track < 17) - return 21; - if (track < 24) - return 19; - if (track < 30) - return 18; - return 17; -} nanoseconds_t clockPeriodForC64Track(unsigned track) { diff --git a/arch/c64/c64.h b/arch/c64/c64.h index ddd5ce18..5d40797a 100644 --- a/arch/c64/c64.h +++ b/arch/c64/c64.h @@ -30,7 +30,6 @@ extern std::unique_ptr createCommodore64Decoder(const DecoderProto& config); extern std::unique_ptr createCommodore64Encoder(const EncoderProto& config); -extern unsigned sectorsForC64Track(unsigned track); extern nanoseconds_t clockPeriodForC64Track(unsigned track); #endif diff --git a/arch/c64/decoder.cc b/arch/c64/decoder.cc index 01f07e3b..d1d915fb 100644 --- a/arch/c64/decoder.cc +++ b/arch/c64/decoder.cc @@ -94,15 +94,6 @@ public: _sector->status = (wantChecksum == gotChecksum) ? Sector::OK : Sector::BAD_CHECKSUM; } - - std::set requiredSectors(const Location& location) const override - { - unsigned count = sectorsForC64Track(location.logicalTrack); - std::set sectors; - for (int sectorId = 0; sectorId < count; sectorId++) - sectors.insert(sectorId); - return sectors; - } }; std::unique_ptr createCommodore64Decoder( diff --git a/arch/ibm/decoder.cc b/arch/ibm/decoder.cc index 8ee65e2d..ed1f4097 100644 --- a/arch/ibm/decoder.cc +++ b/arch/ibm/decoder.cc @@ -207,14 +207,6 @@ public: (wantCrc == gotCrc) ? Sector::OK : Sector::BAD_CHECKSUM; } - std::set requiredSectors(const Location& location) const override - { - auto& trackLayout = - Layout::getLayoutOfTrack(location.logicalTrack, location.head); - return std::set(trackLayout.logicalSectorOrder.begin(), - trackLayout.logicalSectorOrder.end()); - } - private: void getTrackFormat(IbmDecoderProto::TrackdataProto& trackdata, unsigned track, diff --git a/arch/macintosh/decoder.cc b/arch/macintosh/decoder.cc index 4eabf05f..a3f0c5e9 100644 --- a/arch/macintosh/decoder.cc +++ b/arch/macintosh/decoder.cc @@ -182,28 +182,6 @@ public: _sector->data.clear(); _sector->data.writer().append(userData.slice(12, 512)).append(userData.slice(0, 12)); } - - std::set requiredSectors(const Location& location) const override - { - unsigned track = location.logicalTrack; - - int count; - if (track < 16) - count = 12; - else if (track < 32) - count = 11; - else if (track < 48) - count = 10; - else if (track < 64) - count = 9; - else - count = 8; - - std::set sectors; - while (count--) - sectors.insert(count); - return sectors; - } }; std::unique_ptr createMacintoshDecoder(const DecoderProto& config) diff --git a/arch/micropolis/decoder.cc b/arch/micropolis/decoder.cc index 2469c1ac..b581b7e6 100644 --- a/arch/micropolis/decoder.cc +++ b/arch/micropolis/decoder.cc @@ -173,12 +173,6 @@ public: _sector->status = (wantChecksum == gotChecksum) ? Sector::OK : Sector::BAD_CHECKSUM; } - std::set requiredSectors(const Location& location) const override - { - static std::set sectors = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; - return sectors; - } - private: const MicropolisDecoderProto& _config; MicropolisDecoderProto_ChecksumType _checksumType; /* -1 = auto, 1 = Micropolis, 2=MZOS */ diff --git a/arch/northstar/decoder.cc b/arch/northstar/decoder.cc index 37949de0..2f196633 100644 --- a/arch/northstar/decoder.cc +++ b/arch/northstar/decoder.cc @@ -164,12 +164,6 @@ public: _sector->status = (wantChecksum == gotChecksum) ? Sector::OK : Sector::BAD_CHECKSUM; } - std::set requiredSectors(const Location&) const override - { - static std::set sectors = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; - return sectors; - } - private: const NorthstarDecoderProto& _config; uint8_t _hardSectorId; diff --git a/lib/decoders/decoders.cc b/lib/decoders/decoders.cc index 5adead88..290b14c5 100644 --- a/lib/decoders/decoders.cc +++ b/lib/decoders/decoders.cc @@ -225,7 +225,7 @@ uint64_t Decoder::readRaw64() std::set Decoder::requiredSectors(const Location& location) const { - static std::set set; - return set; + const auto& trackLayout = Layout::getLayoutOfTrack(location.logicalTrack, location.head); + return std::set(trackLayout.logicalSectorOrder.begin(), trackLayout.logicalSectorOrder.end()); }