mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
devices/bus: More floppy MCFG_ removal (nw)
This commit is contained in:
parent
165e617ca2
commit
95491792aa
@ -54,17 +54,19 @@ FLOPPY_FORMATS_END
|
||||
// device_add_mconfig - add device configuration
|
||||
//-------------------------------------------------
|
||||
|
||||
MACHINE_CONFIG_START(diskiing_device::device_add_mconfig)
|
||||
MCFG_DEVICE_ADD(WOZFDC_TAG, DISKII_FDC, 1021800*2)
|
||||
MCFG_FLOPPY_DRIVE_ADD("0", a2_floppies, "525", diskiing_device::floppy_formats)
|
||||
MCFG_FLOPPY_DRIVE_ADD("1", a2_floppies, "525", diskiing_device::floppy_formats)
|
||||
MACHINE_CONFIG_END
|
||||
void diskiing_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
DISKII_FDC(config, m_wozfdc, 1021800*2);
|
||||
for (auto &floppy : m_floppy)
|
||||
FLOPPY_CONNECTOR(config, floppy, a2_floppies, "525", diskiing_device::floppy_formats);
|
||||
}
|
||||
|
||||
MACHINE_CONFIG_START(a2bus_diskiing13_device::device_add_mconfig)
|
||||
MCFG_DEVICE_ADD(WOZFDC_TAG, DISKII_FDC, 1021800*2)
|
||||
MCFG_FLOPPY_DRIVE_ADD("0", a2_floppies, "525", a2bus_diskiing13_device::floppy_formats)
|
||||
MCFG_FLOPPY_DRIVE_ADD("1", a2_floppies, "525", a2bus_diskiing13_device::floppy_formats)
|
||||
MACHINE_CONFIG_END
|
||||
void a2bus_diskiing13_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
DISKII_FDC(config, m_wozfdc, 1021800*2);
|
||||
for (auto &floppy : m_floppy)
|
||||
FLOPPY_CONNECTOR(config, floppy, a2_floppies, "525", a2bus_diskiing13_device::floppy_formats);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// rom_region - device-specific ROM region
|
||||
@ -88,8 +90,7 @@ diskiing_device::diskiing_device(const machine_config &mconfig, device_type type
|
||||
device_t(mconfig, type, tag, owner, clock),
|
||||
device_a2bus_card_interface(mconfig, *this),
|
||||
m_wozfdc(*this, WOZFDC_TAG),
|
||||
floppy0(*this, "0"),
|
||||
floppy1(*this, "1"),
|
||||
m_floppy(*this, "%u", 0U),
|
||||
m_rom(nullptr)
|
||||
{
|
||||
}
|
||||
@ -115,7 +116,7 @@ void diskiing_device::device_start()
|
||||
|
||||
void diskiing_device::device_reset()
|
||||
{
|
||||
m_wozfdc->set_floppies(floppy0, floppy1);
|
||||
m_wozfdc->set_floppies(m_floppy[0], m_floppy[1]);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
|
@ -42,11 +42,10 @@ protected:
|
||||
virtual void write_c0nx(uint8_t offset, uint8_t data) override;
|
||||
virtual uint8_t read_cnxx(uint8_t offset) override;
|
||||
|
||||
private:
|
||||
required_device<diskii_fdc_device> m_wozfdc;
|
||||
required_device<floppy_connector> floppy0;
|
||||
required_device<floppy_connector> floppy1;
|
||||
required_device_array<floppy_connector, 2> m_floppy;
|
||||
|
||||
private:
|
||||
const uint8_t *m_rom;
|
||||
|
||||
DECLARE_FLOPPY_FORMATS( floppy_formats );
|
||||
|
@ -52,9 +52,10 @@ static void compucolor_floppies(device_slot_interface &device)
|
||||
// device_add_mconfig - add device configuration
|
||||
//-------------------------------------------------
|
||||
|
||||
MACHINE_CONFIG_START(compucolor_floppy_device::device_add_mconfig)
|
||||
MCFG_FLOPPY_DRIVE_ADD_FIXED("floppy", compucolor_floppies, "525sssd", compucolor_floppy_device::floppy_formats)
|
||||
MACHINE_CONFIG_END
|
||||
void compucolor_floppy_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
FLOPPY_CONNECTOR(config, m_floppy, compucolor_floppies, "525sssd", compucolor_floppy_device::floppy_formats);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -89,7 +90,7 @@ compucolor_floppy_port_device::compucolor_floppy_port_device(const machine_confi
|
||||
compucolor_floppy_device::compucolor_floppy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, COMPUCOLOR_FLOPPY, tag, owner, clock)
|
||||
, device_compucolor_floppy_port_interface(mconfig, *this)
|
||||
, m_floppy(*this, "floppy:525sssd")
|
||||
, m_floppy(*this, "floppy")
|
||||
, m_rw(1)
|
||||
, m_stp(0)
|
||||
, m_sel(1)
|
||||
@ -183,19 +184,23 @@ void compucolor_floppy_device::stepper_w(uint8_t data)
|
||||
{
|
||||
if (!m_sel)
|
||||
{
|
||||
floppy_image_device *floppy = m_floppy->get_device();
|
||||
if (floppy == nullptr)
|
||||
return;
|
||||
|
||||
if ((m_stp == 1 && data == 4) || (m_stp == 2 && data == 1) || (m_stp == 4 && data == 2))
|
||||
{
|
||||
// step in
|
||||
m_floppy->dir_w(1);
|
||||
m_floppy->stp_w(0);
|
||||
m_floppy->stp_w(1);
|
||||
floppy->dir_w(1);
|
||||
floppy->stp_w(0);
|
||||
floppy->stp_w(1);
|
||||
}
|
||||
else if ((m_stp == 1 && data == 2) || (m_stp == 2 && data == 4) || (m_stp == 4 && data == 1))
|
||||
{
|
||||
// step out
|
||||
m_floppy->dir_w(0);
|
||||
m_floppy->stp_w(0);
|
||||
m_floppy->stp_w(1);
|
||||
floppy->dir_w(0);
|
||||
floppy->stp_w(0);
|
||||
floppy->stp_w(1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -209,7 +214,9 @@ void compucolor_floppy_device::stepper_w(uint8_t data)
|
||||
|
||||
void compucolor_floppy_device::select_w(int state)
|
||||
{
|
||||
m_floppy->mon_w(state);
|
||||
floppy_image_device *floppy = m_floppy->get_device();
|
||||
if (floppy != nullptr)
|
||||
floppy->mon_w(state);
|
||||
|
||||
if (!m_sel && state)
|
||||
{
|
||||
@ -226,8 +233,10 @@ void compucolor_floppy_device::select_w(int state)
|
||||
|
||||
bool compucolor_floppy_device::read_bit()
|
||||
{
|
||||
floppy_image_device *floppy = m_floppy->get_device();
|
||||
|
||||
attotime when = machine().time();
|
||||
attotime edge = m_floppy->get_next_transition(when);
|
||||
attotime edge = (floppy == nullptr) ? attotime::never : floppy->get_next_transition(when);
|
||||
attotime next = when + m_period;
|
||||
|
||||
return (edge.is_never() || edge >= next) ? 0 : 1;
|
||||
|
@ -91,7 +91,7 @@ protected:
|
||||
private:
|
||||
DECLARE_FLOPPY_FORMATS( floppy_formats );
|
||||
|
||||
required_device<floppy_image_device> m_floppy;
|
||||
required_device<floppy_connector> m_floppy;
|
||||
|
||||
bool read_bit();
|
||||
void write_bit(bool bit);
|
||||
|
Loading…
Reference in New Issue
Block a user