floppy.cpp: Use standard drives for hard-sectored systems (#12727)

* floppy.cpp: Use standard drives for hard-sectored systems

* fix typo
This commit is contained in:
Mark Garlanger 2024-09-08 04:29:42 -05:00 committed by GitHub
parent b72023282b
commit 362d732136
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 229 additions and 130 deletions

View File

@ -334,7 +334,7 @@ void s100_vector_dualmode_device::device_reset()
static void vector4_floppies(device_slot_interface &device)
{
device.option_add("525", FLOPPY_525_QD16);
device.option_add("525", FLOPPY_525_QD);
}
static void vector4_formats(format_registration &fr)
@ -346,9 +346,13 @@ static void vector4_formats(format_registration &fr)
void s100_vector_dualmode_device::device_add_mconfig(machine_config &config)
{
FLOPPY_CONNECTOR(config, m_floppy[0], vector4_floppies, "525", vector4_formats).enable_sound(true);
m_floppy[0]->set_sectoring_type(floppy_image::H16);
FLOPPY_CONNECTOR(config, m_floppy[1], vector4_floppies, "525", vector4_formats).enable_sound(true);
m_floppy[1]->set_sectoring_type(floppy_image::H16);
FLOPPY_CONNECTOR(config, m_floppy[2], vector4_floppies, "525", vector4_formats).enable_sound(true);
m_floppy[2]->set_sectoring_type(floppy_image::H16);
FLOPPY_CONNECTOR(config, m_floppy[3], vector4_floppies, "525", vector4_formats).enable_sound(true);
m_floppy[3]->set_sectoring_type(floppy_image::H16);
}
DEFINE_DEVICE_TYPE(S100_VECTOR_DUALMODE, s100_vector_dualmode_device, "vectordualmode", "Vector Dual-Mode Disk Controller")

View File

@ -70,7 +70,6 @@ DEFINE_DEVICE_TYPE(FLOPPY_525_SSDD, floppy_525_ssdd, "floppy_525_ssdd",
DEFINE_DEVICE_TYPE(FLOPPY_525_DD, floppy_525_dd, "floppy_525_dd", "5.25\" double density floppy drive")
DEFINE_DEVICE_TYPE(FLOPPY_525_SSQD, floppy_525_ssqd, "floppy_525_ssqd", "5.25\" single-sided quad density floppy drive")
DEFINE_DEVICE_TYPE(FLOPPY_525_QD, floppy_525_qd, "floppy_525_qd", "5.25\" quad density floppy drive")
DEFINE_DEVICE_TYPE(FLOPPY_525_QD16, floppy_525_qd16, "floppy_525_qd16", "5.25\" quad density 16 hard sector floppy drive")
DEFINE_DEVICE_TYPE(FLOPPY_525_HD, floppy_525_hd, "floppy_525_hd", "5.25\" high density floppy drive")
// generic 8" drives
@ -210,7 +209,8 @@ floppy_connector::floppy_connector(const machine_config &mconfig, const char *ta
device_t(mconfig, FLOPPY_CONNECTOR, tag, owner, clock),
device_slot_interface(mconfig, *this),
formats(nullptr),
m_enable_sound(false)
m_enable_sound(false),
m_sectoring_type(floppy_image::SOFT)
{
}
@ -229,6 +229,7 @@ void floppy_connector::device_config_complete()
{
dev->set_formats(formats);
dev->enable_sound(m_enable_sound);
dev->set_sectoring_type(m_sectoring_type);
}
}
@ -251,6 +252,7 @@ floppy_image_device::floppy_image_device(const machine_config &mconfig, device_t
m_tracks(0),
m_sides(0),
m_form_factor(0),
m_sectoring_type(floppy_image::SOFT),
m_motor_always_on(false),
m_dskchg_writable(false),
m_has_trk00_sensor(true),
@ -359,6 +361,72 @@ void floppy_image_device::register_formats()
}
}
void floppy_image_device::add_variant(uint32_t variant)
{
uint32_t actual_variant = variant;
if (m_sectoring_type == floppy_image::H10) {
switch (variant) {
case floppy_image::SSSD:
actual_variant = floppy_image::SSSD10;
break;
case floppy_image::SSDD:
actual_variant = floppy_image::SSDD10;
break;
case floppy_image::SSQD:
actual_variant = floppy_image::SSQD10;
break;
case floppy_image::DSSD:
actual_variant = floppy_image::DSSD10;
break;
case floppy_image::DSDD:
actual_variant = floppy_image::DSDD10;
break;
case floppy_image::DSQD:
actual_variant = floppy_image::DSQD10;
break;
}
} else if (m_sectoring_type == floppy_image::H16) {
switch (variant) {
case floppy_image::SSSD:
actual_variant = floppy_image::SSDD16;
break;
case floppy_image::SSDD:
actual_variant = floppy_image::SSSD16;
break;
case floppy_image::SSQD:
actual_variant = floppy_image::SSQD16;
break;
case floppy_image::DSSD:
actual_variant = floppy_image::DSSD16;
break;
case floppy_image::DSDD:
actual_variant = floppy_image::DSDD16;
break;
case floppy_image::DSQD:
actual_variant = floppy_image::DSQD16;
break;
}
} else if (m_sectoring_type == floppy_image::H32) {
switch (variant) {
case floppy_image::SSSD:
actual_variant = floppy_image::SSSD32;
break;
case floppy_image::SSDD:
actual_variant = floppy_image::SSDD32;
break;
case floppy_image::DSSD:
actual_variant = floppy_image::DSSD32;
break;
case floppy_image::DSDD:
actual_variant = floppy_image::DSDD32;
break;
}
}
m_variants.push_back(actual_variant);
}
void floppy_image_device::set_formats(std::function<void (format_registration &fr)> formats)
{
m_format_registration_cb = formats;
@ -384,6 +452,16 @@ void floppy_image_device::set_rpm(float _rpm)
m_angular_speed = m_rpm/60.0*2e8;
}
void floppy_image_device::set_sectoring_type(uint32_t sectoring_type)
{
m_sectoring_type = sectoring_type;
}
uint32_t floppy_image_device::get_sectoring_type()
{
return m_sectoring_type;
}
void floppy_image_device::setup_write(const floppy_image_format_t *_output_format)
{
m_output_format = _output_format;
@ -1654,7 +1732,7 @@ void floppy_3_ssdd::setup_characteristics()
m_sides = 1;
set_rpm(300);
m_variants.push_back(floppy_image::SSDD);
add_variant(floppy_image::SSDD);
}
//-------------------------------------------------
@ -1677,8 +1755,8 @@ void floppy_3_dsdd::setup_characteristics()
m_sides = 2;
set_rpm(300);
m_variants.push_back(floppy_image::SSDD);
m_variants.push_back(floppy_image::DSDD);
add_variant(floppy_image::SSDD);
add_variant(floppy_image::DSDD);
}
//-------------------------------------------------
@ -1701,8 +1779,8 @@ void floppy_35_ssdd::setup_characteristics()
m_sides = 1;
set_rpm(300);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
}
//-------------------------------------------------
@ -1725,9 +1803,9 @@ void floppy_35_dd::setup_characteristics()
m_sides = 2;
set_rpm(300);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
m_variants.push_back(floppy_image::DSDD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
add_variant(floppy_image::DSDD);
}
//-------------------------------------------------
@ -1750,10 +1828,10 @@ void floppy_35_hd::setup_characteristics()
m_sides = 2;
set_rpm(300);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
m_variants.push_back(floppy_image::DSDD);
m_variants.push_back(floppy_image::DSHD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
add_variant(floppy_image::DSDD);
add_variant(floppy_image::DSHD);
}
//-------------------------------------------------
@ -1776,11 +1854,11 @@ void floppy_35_ed::setup_characteristics()
m_sides = 2;
set_rpm(300);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
m_variants.push_back(floppy_image::DSDD);
m_variants.push_back(floppy_image::DSHD);
m_variants.push_back(floppy_image::DSED);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
add_variant(floppy_image::DSDD);
add_variant(floppy_image::DSHD);
add_variant(floppy_image::DSED);
}
//-------------------------------------------------
@ -1803,7 +1881,7 @@ void floppy_525_sssd_35t::setup_characteristics()
m_sides = 1;
set_rpm(300);
m_variants.push_back(floppy_image::SSSD);
add_variant(floppy_image::SSSD);
}
//-------------------------------------------------
@ -1826,8 +1904,8 @@ void floppy_525_sd_35t::setup_characteristics()
m_sides = 2;
set_rpm(300);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::DSSD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::DSSD);
}
//-------------------------------------------------
@ -1851,7 +1929,7 @@ void floppy_525_vtech::setup_characteristics()
m_sides = 1;
set_rpm(85);
m_variants.push_back(floppy_image::SSSD);
add_variant(floppy_image::SSSD);
}
//-------------------------------------------------
@ -1874,7 +1952,7 @@ void floppy_525_sssd::setup_characteristics()
m_sides = 1;
set_rpm(300);
m_variants.push_back(floppy_image::SSSD);
add_variant(floppy_image::SSSD);
}
//-------------------------------------------------
@ -1897,7 +1975,7 @@ void floppy_525_sd::setup_characteristics()
m_sides = 2;
set_rpm(300);
m_variants.push_back(floppy_image::SSSD);
add_variant(floppy_image::SSSD);
}
//-------------------------------------------------
@ -1920,8 +1998,8 @@ void floppy_525_ssdd::setup_characteristics()
m_sides = 1;
set_rpm(300);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
}
//-------------------------------------------------
@ -1944,9 +2022,9 @@ void floppy_525_dd::setup_characteristics()
m_sides = 2;
set_rpm(300);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
m_variants.push_back(floppy_image::DSDD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
add_variant(floppy_image::DSDD);
}
//-------------------------------------------------
@ -1969,9 +2047,9 @@ void floppy_525_ssqd::setup_characteristics()
m_sides = 1;
set_rpm(300);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
m_variants.push_back(floppy_image::SSQD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
add_variant(floppy_image::SSQD);
}
//-------------------------------------------------
@ -1994,38 +2072,12 @@ void floppy_525_qd::setup_characteristics()
m_sides = 2;
set_rpm(300);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
m_variants.push_back(floppy_image::SSQD);
m_variants.push_back(floppy_image::DSSD);
m_variants.push_back(floppy_image::DSDD);
m_variants.push_back(floppy_image::DSQD);
}
//-------------------------------------------------
// 5.25" double-sided quad density 16 hard sector
//-------------------------------------------------
floppy_525_qd16::floppy_525_qd16(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
floppy_image_device(mconfig, FLOPPY_525_QD16, tag, owner, clock)
{
}
floppy_525_qd16::~floppy_525_qd16()
{
}
void floppy_525_qd16::setup_characteristics()
{
m_form_factor = floppy_image::FF_525;
m_tracks = 84;
m_sides = 2;
set_rpm(300);
m_variants.push_back(floppy_image::SSDD16);
m_variants.push_back(floppy_image::SSQD16);
m_variants.push_back(floppy_image::DSDD16);
m_variants.push_back(floppy_image::DSQD16);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
add_variant(floppy_image::SSQD);
add_variant(floppy_image::DSSD);
add_variant(floppy_image::DSDD);
add_variant(floppy_image::DSQD);
}
//-------------------------------------------------
@ -2048,12 +2100,12 @@ void floppy_525_hd::setup_characteristics()
m_sides = 2;
set_rpm(360);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
m_variants.push_back(floppy_image::SSQD);
m_variants.push_back(floppy_image::DSDD);
m_variants.push_back(floppy_image::DSQD);
m_variants.push_back(floppy_image::DSHD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
add_variant(floppy_image::SSQD);
add_variant(floppy_image::DSDD);
add_variant(floppy_image::DSQD);
add_variant(floppy_image::DSHD);
}
//-------------------------------------------------
@ -2077,7 +2129,7 @@ void floppy_8_sssd::setup_characteristics()
m_motor_always_on = true;
set_rpm(360);
m_variants.push_back(floppy_image::SSSD);
add_variant(floppy_image::SSSD);
}
//-------------------------------------------------
@ -2101,8 +2153,8 @@ void floppy_8_dssd::setup_characteristics()
m_motor_always_on = true;
set_rpm(360);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::DSSD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::DSSD);
}
//-------------------------------------------------
@ -2126,8 +2178,8 @@ void floppy_8_ssdd::setup_characteristics()
m_motor_always_on = true;
set_rpm(360);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
}
//-------------------------------------------------
@ -2151,9 +2203,9 @@ void floppy_8_dsdd::setup_characteristics()
m_motor_always_on = true;
set_rpm(360);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
m_variants.push_back(floppy_image::DSDD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
add_variant(floppy_image::DSDD);
}
@ -2187,8 +2239,8 @@ void epson_smd_165::setup_characteristics()
m_sides = 2;
set_rpm(300);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::DSSD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::DSSD);
}
//-------------------------------------------------
@ -2234,9 +2286,9 @@ void epson_sd_320::setup_characteristics()
m_sides = 2;
set_rpm(300);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
m_variants.push_back(floppy_image::DSDD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
add_variant(floppy_image::DSDD);
}
//-------------------------------------------------
@ -2262,9 +2314,9 @@ void epson_sd_321::setup_characteristics()
m_sides = 2;
set_rpm(300);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
m_variants.push_back(floppy_image::DSDD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
add_variant(floppy_image::DSDD);
}
@ -2295,9 +2347,9 @@ void pana_ju_363::setup_characteristics()
m_dskchg_writable = true;
set_rpm(300);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
m_variants.push_back(floppy_image::DSDD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
add_variant(floppy_image::DSDD);
}
//-------------------------------------------------
@ -2327,8 +2379,8 @@ void sony_oa_d31v::setup_characteristics()
m_dskchg_writable = true;
set_rpm(600);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
}
//-------------------------------------------------
@ -2359,9 +2411,9 @@ void sony_oa_d32w::setup_characteristics()
m_dskchg_writable = true;
set_rpm(600);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
m_variants.push_back(floppy_image::DSDD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
add_variant(floppy_image::DSDD);
}
//-------------------------------------------------
@ -2392,8 +2444,8 @@ void sony_oa_d32v::setup_characteristics()
m_dskchg_writable = true;
set_rpm(600);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
}
//-------------------------------------------------
@ -2422,7 +2474,7 @@ void teac_fd_30a::setup_characteristics()
m_sides = 1;
set_rpm(300);
m_variants.push_back(floppy_image::SSDD);
add_variant(floppy_image::SSDD);
}
//-------------------------------------------------
@ -2451,8 +2503,8 @@ void teac_fd_55a::setup_characteristics()
m_sides = 1;
set_rpm(300);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
}
//-------------------------------------------------
@ -2481,10 +2533,10 @@ void teac_fd_55b::setup_characteristics()
m_sides = 2;
set_rpm(300);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
m_variants.push_back(floppy_image::DSSD);
m_variants.push_back(floppy_image::DSDD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
add_variant(floppy_image::DSSD);
add_variant(floppy_image::DSDD);
}
//-------------------------------------------------
@ -2513,9 +2565,9 @@ void teac_fd_55e::setup_characteristics()
m_sides = 1;
set_rpm(300);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
m_variants.push_back(floppy_image::SSQD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
add_variant(floppy_image::SSQD);
}
//-------------------------------------------------
@ -2544,12 +2596,12 @@ void teac_fd_55f::setup_characteristics()
m_sides = 2;
set_rpm(300);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
m_variants.push_back(floppy_image::SSQD);
m_variants.push_back(floppy_image::DSSD);
m_variants.push_back(floppy_image::DSDD);
m_variants.push_back(floppy_image::DSQD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
add_variant(floppy_image::SSQD);
add_variant(floppy_image::DSSD);
add_variant(floppy_image::DSDD);
add_variant(floppy_image::DSQD);
}
//-------------------------------------------------
@ -2578,12 +2630,12 @@ void teac_fd_55g::setup_characteristics()
m_sides = 2;
set_rpm(360);
m_variants.push_back(floppy_image::SSSD);
m_variants.push_back(floppy_image::SSDD);
m_variants.push_back(floppy_image::SSQD);
m_variants.push_back(floppy_image::DSDD);
m_variants.push_back(floppy_image::DSQD);
m_variants.push_back(floppy_image::DSHD);
add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
add_variant(floppy_image::SSQD);
add_variant(floppy_image::DSDD);
add_variant(floppy_image::DSQD);
add_variant(floppy_image::DSHD);
}
//-------------------------------------------------
@ -2609,7 +2661,7 @@ void alps_3255190x::setup_characteristics()
set_rpm(300);
m_cyl = 34;
m_variants.push_back(floppy_image::SSSD);
add_variant(floppy_image::SSSD);
}
//-------------------------------------------------
@ -2634,7 +2686,7 @@ void ibm_6360::setup_characteristics()
m_has_trk00_sensor = false;
set_rpm(360);
m_variants.push_back(floppy_image::SSSD);
add_variant(floppy_image::SSSD);
}
@ -2876,7 +2928,7 @@ void oa_d34v_device::setup_characteristics()
m_sides = 1;
set_rpm(394);
m_variants.push_back(floppy_image::SSDD);
add_variant(floppy_image::SSDD);
}
bool oa_d34v_device::is_2m() const
@ -2902,8 +2954,8 @@ void mfd51w_device::setup_characteristics()
m_sides = 2;
set_rpm(394);
m_variants.push_back(floppy_image::SSDD);
m_variants.push_back(floppy_image::DSDD);
add_variant(floppy_image::SSDD);
add_variant(floppy_image::DSDD);
}
bool mfd51w_device::is_2m() const
@ -2923,9 +2975,9 @@ void mfd75w_device::setup_characteristics()
m_sides = 2;
set_rpm(300);
m_variants.push_back(floppy_image::SSDD);
m_variants.push_back(floppy_image::DSDD);
m_variants.push_back(floppy_image::DSHD);
add_variant(floppy_image::SSDD);
add_variant(floppy_image::DSDD);
add_variant(floppy_image::DSHD);
}
bool mfd75w_device::is_2m() const

View File

@ -90,6 +90,8 @@ public:
const floppy_image_format_t *get_load_format() const;
std::pair<std::error_condition, const floppy_image_format_t *> identify(std::string_view filename);
void set_rpm(float rpm);
void set_sectoring_type(uint32_t sectoring_type);
uint32_t get_sectoring_type();
void init_fs(const fs_info *fs, const fs::meta_data &meta);
@ -194,6 +196,7 @@ protected:
int m_tracks; /* addressable tracks */
int m_sides; /* number of heads */
uint32_t m_form_factor; /* 3"5, 5"25, etc */
uint32_t m_sectoring_type; /* SOFT, Hard 10/16/32 */
bool m_motor_always_on;
bool m_dskchg_writable;
bool m_has_trk00_sensor;
@ -255,6 +258,8 @@ protected:
void register_formats();
void add_variant(uint32_t variant);
void check_led();
uint32_t find_position(attotime &base, const attotime &when);
attotime position_to_time(const attotime &base, int position) const;
@ -299,7 +304,6 @@ DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_SSDD, floppy_525_ssdd, "floppy_5_
DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_DD, floppy_525_dd, "floppy_5_25")
DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_SSQD, floppy_525_ssqd, "floppy_5_25")
DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_QD, floppy_525_qd, "floppy_5_25")
DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_QD16, floppy_525_qd16, "floppy_5_25")
DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_525_HD, floppy_525_hd, "floppy_5_25")
DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_8_SSSD, floppy_8_sssd, "floppy_8")
DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_8_DSSD, floppy_8_dssd, "floppy_8")
@ -460,6 +464,7 @@ public:
template <typename T> void set_formats(T &&_formats) { formats = std::forward<T>(_formats); }
void enable_sound(bool doit) { m_enable_sound = doit; }
void set_sectoring_type(uint32_t sectoring_type) { m_sectoring_type = sectoring_type; }
floppy_image_device *get_device();
@ -470,6 +475,7 @@ protected:
private:
std::function<void (format_registration &fr)> formats;
bool m_enable_sound;
uint32_t m_sectoring_type;
};

View File

@ -138,13 +138,26 @@ const char *floppy_image::get_variant_name(uint32_t form_factor, uint32_t varian
{
switch(variant) {
case SSSD: return "Single side, single density";
case SSSD10: return "Single side, single density, 10-sector";
case SSSD16: return "Single side, single density, 16-sector";
case SSSD32: return "Single side, single density, 32-sector";
case SSDD: return "Single side, double density";
case SSDD10: return "Single side, double density, 10-sector";
case SSDD16: return "Single side, double density, 16 hard sector";
case SSDD32: return "Single side, double density, 32-sector";
case SSQD: return "Single side, quad density";
case SSQD10: return "Single side, quad density, 10-sector";
case SSQD16: return "Single side, quad density, 16 hard sector";
case DSSD: return "Double side, single density";
case DSSD10: return "Double side, single density, 10-sector";
case DSSD16: return "Double side, single density, 16-sector";
case DSSD32: return "Double side, single density, 32-sector";
case DSDD: return "Double side, double density";
case DSDD10: return "Double side, double density, 10-sector";
case DSDD16: return "Double side, double density, 16 hard sector";
case DSDD32: return "Double side, double density, 32-sector";
case DSQD: return "Double side, quad density";
case DSQD10: return "Double side, quad density, 10-sector";
case DSQD16: return "Double side, quad density, 16 hard sector";
case DSHD: return "Double side, high density";
case DSED: return "Double side, extended density";

View File

@ -526,14 +526,26 @@ public:
//! Variants
enum {
SSSD = 0x44535353, //!< "SSSD", Single-sided single-density
SSSD10 = 0x30315353, //!< "SS10", Single-sided single-density 10 hard sector
SSSD16 = 0x36315353, //!< "SS16", Single-sided single-density 16 hard sector
SSSD32 = 0x32335353, //!< "SS32", Single-sided single-density 32 hard sector
SSDD = 0x44445353, //!< "SSDD", Single-sided double-density
SSDD10 = 0x30314453, //!< "SD10", Single-sided double-density 10 hard sector
SSDD16 = 0x36314453, //!< "SD16", Single-sided double-density 16 hard sector
SSDD32 = 0x32334453, //!< "SD32", Single-sided double-density 32 hard sector
SSQD = 0x44515353, //!< "SSQD", Single-sided quad-density
SSQD10 = 0x30315153, //!< "SQ10", Single-sided quad-density 10 hard sector
SSQD16 = 0x36315153, //!< "SQ16", Single-sided quad-density 16 hard sector
DSSD = 0x44535344, //!< "DSSD", Double-sided single-density
DSSD10 = 0x30315344, //!< "DS10", Double-sided single-density 10 hard sector
DSSD16 = 0x36315344, //!< "DS16", Double-sided single-density 16 hard sector
DSSD32 = 0x32335344, //!< "DS32", Double-sided single-density 32 hard sector
DSDD = 0x44445344, //!< "DSDD", Double-sided double-density (720K in 3.5, 360K in 5.25)
DSDD10 = 0x30314444, //!< "DD10", Double-sided double-density 10 hard sector
DSDD16 = 0x36314444, //!< "DD16", Double-sided double-density 16 hard sector (360K in 5.25)
DSDD32 = 0x32334444, //!< "DD32", Double-sided double-density 32 hard sector
DSQD = 0x44515344, //!< "DSQD", Double-sided quad-density (720K in 5.25, means DD+80 tracks)
DSQD10 = 0x30315144, //!< "DQ10", Double-sided quad-density 10 hard sector
DSQD16 = 0x36315144, //!< "DQ16", Double-sided quad-density 16 hard sector (720K in 5.25, means DD+80 tracks)
DSHD = 0x44485344, //!< "DSHD", Double-sided high-density (1440K)
DSED = 0x44455344 //!< "DSED", Double-sided extra-density (2880K)
@ -546,6 +558,14 @@ public:
M2FM = 0x4D32464D //!< "M2FM", modified modified frequency modulation
};
//! Sectoring
enum {
SOFT = 0x54464F53, //!< "SOFT", Soft-sectored
H10 = 0x20303148, //!< "H10 ", Hard 10-sectored
H16 = 0x20363148, //!< "H16 ", Hard 16-sectored
H32 = 0x20323348 //!< "H32 ", Hard 32-sectored (8 inch disk)
};
// construction/destruction
@ -562,10 +582,14 @@ public:
uint32_t get_form_factor() const noexcept { return form_factor; }
//! @return the variant.
uint32_t get_variant() const noexcept { return variant; }
//! @return the disk sectoring.
uint32_t get_sectoring() const noexcept { return sectoring; }
//! @param v the variant.
void set_variant(uint32_t v);
//! @param v the variant.
void set_form_variant(uint32_t f, uint32_t v) { if(form_factor == FF_UNKNOWN) form_factor = f; set_variant(v); }
//! @param s the sectoring.
void set_sectoring(uint32_t s) { sectoring = s; }
//! Find most recent and next index hole for provided angular position.
//! The most recent hole may be equal to provided position. The next
@ -623,7 +647,7 @@ public:
private:
int tracks, heads;
uint32_t form_factor, variant;
uint32_t form_factor, variant, sectoring;
struct track_info
{