Skip to content

Commit

Permalink
imagedev/floppy.cpp: Add single-density 3" drive types
Browse files Browse the repository at this point in the history
* bml3mp1805: Use correct SSSD drive type
  • Loading branch information
ajrhacker committed Sep 8, 2024
1 parent d179cf9 commit 7a48dda
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/devices/bus/bml3/bml3mp1805.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
bml3mp1805.c
Hitachi MP-1805 floppy disk controller card for the MB-6890
Floppy drive is attached
TODO: make sure disk can be read
Floppy drive is attached (single-sided, single density)
*********************************************************************/

Expand All @@ -32,11 +31,9 @@ ROM_START( mp1805 )
ROM_LOAD( "mp1805.rom", 0x000, 0x800, BAD_DUMP CRC(b532d8d9) SHA1(6f1160356d5bf64b5926b1fdb60db414edf65f22))
ROM_END

// Although the drive is single-sided, D88 images are double-sided,
// so we need to allocate enough space or MAME will crash.
void bml3bus_mp1805_device::floppy_drives(device_slot_interface &device)
{
device.option_add("mb_6890", FLOPPY_3_DSDD);
device.option_add("mb_6890", FLOPPY_3_SSSD);
}


Expand Down
56 changes: 54 additions & 2 deletions src/devices/imagedev/floppy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@
DEFINE_DEVICE_TYPE(FLOPPY_CONNECTOR, floppy_connector, "floppy_connector", "Floppy drive connector abstraction")

// generic 3" drives
DEFINE_DEVICE_TYPE(FLOPPY_3_SSDD, floppy_3_ssdd, "floppy_3_ssdd", "3\" single-sided floppy drive")
DEFINE_DEVICE_TYPE(FLOPPY_3_DSDD, floppy_3_dsdd, "floppy_3_dsdd", "3\" double-sided floppy drive")
DEFINE_DEVICE_TYPE(FLOPPY_3_SSSD, floppy_3_sssd, "floppy_3_sssd", "3\" single-sided single density floppy drive")
DEFINE_DEVICE_TYPE(FLOPPY_3_DSSD, floppy_3_dssd, "floppy_3_dssd", "3\" double-sided single density floppy drive")
DEFINE_DEVICE_TYPE(FLOPPY_3_SSDD, floppy_3_ssdd, "floppy_3_ssdd", "3\" single-sided double density floppy drive")
DEFINE_DEVICE_TYPE(FLOPPY_3_DSDD, floppy_3_dsdd, "floppy_3_dsdd", "3\" double-sided double density floppy drive")

// generic 3.5" drives
DEFINE_DEVICE_TYPE(FLOPPY_35_SSDD, floppy_35_ssdd, "floppy_35_ssdd", "3.5\" single-sided double density floppy drive")
Expand Down Expand Up @@ -1712,6 +1714,53 @@ DEFINE_DEVICE_TYPE(FLOPPYSOUND, floppy_sound_device, "flopsnd", "Floppy sound")
// GENERIC FLOPPY DRIVE DEFINITIONS
//**************************************************************************

//-------------------------------------------------
// 3" single-sided single density
//-------------------------------------------------

floppy_3_sssd::floppy_3_sssd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
floppy_image_device(mconfig, FLOPPY_3_SSSD, tag, owner, clock)
{
}

floppy_3_sssd::~floppy_3_sssd()
{
}

void floppy_3_sssd::setup_characteristics()
{
m_form_factor = floppy_image::FF_3;
m_tracks = 42;
m_sides = 1;
set_rpm(300);

add_variant(floppy_image::SSSD);
}

//-------------------------------------------------
// 3" double-sided single density
//-------------------------------------------------

floppy_3_dssd::floppy_3_dssd(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
floppy_image_device(mconfig, FLOPPY_3_DSSD, tag, owner, clock)
{
}

floppy_3_dssd::~floppy_3_dssd()
{
}

void floppy_3_dssd::setup_characteristics()
{
m_form_factor = floppy_image::FF_3;
m_tracks = 42;
m_sides = 2;
set_rpm(300);

add_variant(floppy_image::SSSD);
add_variant(floppy_image::DSSD);
}

//-------------------------------------------------
// 3" single-sided double density
//-------------------------------------------------
Expand All @@ -1732,6 +1781,7 @@ void floppy_3_ssdd::setup_characteristics()
m_sides = 1;
set_rpm(300);

add_variant(floppy_image::SSSD);
add_variant(floppy_image::SSDD);
}

Expand All @@ -1755,6 +1805,8 @@ void floppy_3_dsdd::setup_characteristics()
m_sides = 2;
set_rpm(300);

add_variant(floppy_image::SSSD);
add_variant(floppy_image::DSSD);
add_variant(floppy_image::SSDD);
add_variant(floppy_image::DSDD);
}
Expand Down
2 changes: 2 additions & 0 deletions src/devices/imagedev/floppy.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ class floppy_image_device : public device_t,
}; \
DECLARE_DEVICE_TYPE(Type, Name)

DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_3_SSSD, floppy_3_sssd, "floppy_3")
DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_3_DSSD, floppy_3_dssd, "floppy_3")
DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_3_SSDD, floppy_3_ssdd, "floppy_3")
DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_3_DSDD, floppy_3_dsdd, "floppy_3")
DECLARE_FLOPPY_IMAGE_DEVICE(FLOPPY_35_SSDD, floppy_35_ssdd, "floppy_3_5")
Expand Down

0 comments on commit 7a48dda

Please sign in to comment.