1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-23 05:29:23 +00:00

Defaults can now be private.

This commit is contained in:
Thomas Harte 2023-12-11 19:12:49 -05:00
parent e79727d30d
commit bfd6543067
2 changed files with 44 additions and 44 deletions

View File

@ -28,6 +28,50 @@ std::vector<const Sector *> sector_pointers(const std::vector<Sector> &sectors)
return pointers; return pointers;
} }
template <Density density> struct Defaults;
template <> struct Defaults<Density::Single> {
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<Density::Double> {
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<Density::High> {
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 { enum class SurfaceItem {

View File

@ -21,50 +21,6 @@
namespace Storage::Encodings::MFM { namespace Storage::Encodings::MFM {
template <Density density> struct Defaults;
template <> struct Defaults<Density::Single> {
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<Density::Double> {
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<Density::High> {
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. Converts a vector of sectors into a properly-encoded FM or MFM track.