diff --git a/Storage/Disk/Encodings/MFM/Encoder.cpp b/Storage/Disk/Encodings/MFM/Encoder.cpp index c44e453ac..0379fadab 100644 --- a/Storage/Disk/Encodings/MFM/Encoder.cpp +++ b/Storage/Disk/Encodings/MFM/Encoder.cpp @@ -28,6 +28,50 @@ std::vector sector_pointers(const std::vector §ors) return pointers; } +template struct Defaults; +template <> struct Defaults { + static constexpr size_t expected_track_bytes = 6250; + + static constexpr size_t post_index_address_mark_bytes = 26; + static constexpr uint8_t post_index_address_mark_value = 0xff; + + static constexpr size_t pre_address_mark_bytes = 6; + static constexpr size_t post_address_address_mark_bytes = 11; + static constexpr uint8_t post_address_address_mark_value = 0xff; + + static constexpr size_t pre_data_mark_bytes = 6; + static constexpr size_t post_data_bytes = 27; + static constexpr uint8_t post_data_value = 0xff; +}; +template <> struct Defaults { + static constexpr size_t expected_track_bytes = 12500; + + static constexpr size_t post_index_address_mark_bytes = 50; + static constexpr uint8_t post_index_address_mark_value = 0x4e; + + static constexpr size_t pre_address_mark_bytes = 12; + static constexpr size_t post_address_address_mark_bytes = 22; + static constexpr uint8_t post_address_address_mark_value = 0x4e; + + static constexpr size_t pre_data_mark_bytes = 12; + static constexpr size_t post_data_bytes = 54; + static constexpr uint8_t post_data_value = 0xff; +}; +template <> struct Defaults { + static constexpr size_t expected_track_bytes = 25000; + + static constexpr size_t post_index_address_mark_bytes = 50; + static constexpr uint8_t post_index_address_mark_value = 0x4e; + + static constexpr size_t pre_address_mark_bytes = 12; + static constexpr size_t post_address_address_mark_bytes = 22; + static constexpr uint8_t post_address_address_mark_value = 0x4e; + + static constexpr size_t pre_data_mark_bytes = 12; + static constexpr size_t post_data_bytes = 54; + static constexpr uint8_t post_data_value = 0xff; +}; + } enum class SurfaceItem { diff --git a/Storage/Disk/Encodings/MFM/Encoder.hpp b/Storage/Disk/Encodings/MFM/Encoder.hpp index 2af653192..94ae4617f 100644 --- a/Storage/Disk/Encodings/MFM/Encoder.hpp +++ b/Storage/Disk/Encodings/MFM/Encoder.hpp @@ -21,50 +21,6 @@ namespace Storage::Encodings::MFM { -template struct Defaults; -template <> struct Defaults { - static constexpr size_t expected_track_bytes = 6250; - - static constexpr size_t post_index_address_mark_bytes = 26; - static constexpr uint8_t post_index_address_mark_value = 0xff; - - static constexpr size_t pre_address_mark_bytes = 6; - static constexpr size_t post_address_address_mark_bytes = 11; - static constexpr uint8_t post_address_address_mark_value = 0xff; - - static constexpr size_t pre_data_mark_bytes = 6; - static constexpr size_t post_data_bytes = 27; - static constexpr uint8_t post_data_value = 0xff; -}; -template <> struct Defaults { - static constexpr size_t expected_track_bytes = 12500; - - static constexpr size_t post_index_address_mark_bytes = 50; - static constexpr uint8_t post_index_address_mark_value = 0x4e; - - static constexpr size_t pre_address_mark_bytes = 12; - static constexpr size_t post_address_address_mark_bytes = 22; - static constexpr uint8_t post_address_address_mark_value = 0x4e; - - static constexpr size_t pre_data_mark_bytes = 12; - static constexpr size_t post_data_bytes = 54; - static constexpr uint8_t post_data_value = 0xff; -}; -template <> struct Defaults { - static constexpr size_t expected_track_bytes = 25000; - - static constexpr size_t post_index_address_mark_bytes = 50; - static constexpr uint8_t post_index_address_mark_value = 0x4e; - - static constexpr size_t pre_address_mark_bytes = 12; - static constexpr size_t post_address_address_mark_bytes = 22; - static constexpr uint8_t post_address_address_mark_value = 0x4e; - - static constexpr size_t pre_data_mark_bytes = 12; - static constexpr size_t post_data_bytes = 54; - static constexpr uint8_t post_data_value = 0xff; -}; - /*! Converts a vector of sectors into a properly-encoded FM or MFM track.