diff options
Diffstat (limited to 'src/devices/bus/ep64/exdos.cpp')
-rw-r--r-- | src/devices/bus/ep64/exdos.cpp | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/src/devices/bus/ep64/exdos.cpp b/src/devices/bus/ep64/exdos.cpp index a4487db6ba4..1f7b5d8af97 100644 --- a/src/devices/bus/ep64/exdos.cpp +++ b/src/devices/bus/ep64/exdos.cpp @@ -48,6 +48,8 @@ This PCB plugs into the external expansion connector on the right side of the ma #include "emu.h" #include "exdos.h" +#include "formats/ep64_dsk.h" + //************************************************************************** @@ -89,9 +91,11 @@ const tiny_rom_entry *ep64_exdos_device::device_rom_region() const // SLOT_INTERFACE( ep64_exdos_floppies ) //------------------------------------------------- -FLOPPY_FORMATS_MEMBER( ep64_exdos_device::floppy_formats ) - FLOPPY_EP64_FORMAT -FLOPPY_FORMATS_END +void ep64_exdos_device::floppy_formats(format_registration &fr) +{ + fr.add_mfm_containers(); + fr.add(FLOPPY_EP64_FORMAT); +} static void ep64_exdos_floppies(device_slot_interface &device) { @@ -107,10 +111,9 @@ void ep64_exdos_device::device_add_mconfig(machine_config &config) { WD1770(config, m_fdc, 8_MHz_XTAL); - FLOPPY_CONNECTOR(config, m_floppy0, ep64_exdos_floppies, "35dd", ep64_exdos_device::floppy_formats); - FLOPPY_CONNECTOR(config, m_floppy1, ep64_exdos_floppies, nullptr, ep64_exdos_device::floppy_formats); - FLOPPY_CONNECTOR(config, m_floppy2, ep64_exdos_floppies, nullptr, ep64_exdos_device::floppy_formats); - FLOPPY_CONNECTOR(config, m_floppy3, ep64_exdos_floppies, nullptr, ep64_exdos_device::floppy_formats); + for (auto &floppy : m_floppy) + FLOPPY_CONNECTOR(config, floppy, ep64_exdos_floppies, nullptr, ep64_exdos_device::floppy_formats); + m_floppy[0]->set_default_option("35dd"); } @@ -126,11 +129,8 @@ ep64_exdos_device::ep64_exdos_device(const machine_config &mconfig, const char * device_t(mconfig, EP64_EXDOS, tag, owner, clock), device_ep64_expansion_bus_card_interface(mconfig, *this), m_fdc(*this, WD1770_TAG), - m_floppy0(*this, WD1770_TAG":0"), - m_floppy1(*this, WD1770_TAG":1"), - m_floppy2(*this, WD1770_TAG":2"), - m_floppy3(*this, WD1770_TAG":3"), - m_floppy(nullptr), + m_floppy(*this, WD1770_TAG":%u", 0U), + m_selected_floppy(nullptr), m_rom(*this, "rom") { } @@ -144,8 +144,8 @@ void ep64_exdos_device::device_start() { m_slot->program().install_rom(0x080000, 0x087fff, m_rom->base()); - m_slot->io().install_readwrite_handler(0x10, 0x13, 0, 0x04, 0, read8sm_delegate(FUNC(wd_fdc_device_base::read), m_fdc.target()), write8sm_delegate(FUNC(wd_fdc_device_base::write), m_fdc.target())); - m_slot->io().install_readwrite_handler(0x18, 0x18, 0, 0x04, 0, READ8_DELEGATE(ep64_exdos_device, read), WRITE8_DELEGATE(ep64_exdos_device, write)); + m_slot->io().install_readwrite_handler(0x10, 0x13, 0, 0x04, 0, read8sm_delegate(*m_fdc, FUNC(wd_fdc_device_base::read)), write8sm_delegate(*m_fdc, FUNC(wd_fdc_device_base::write))); + m_slot->io().install_readwrite_handler(0x18, 0x18, 0, 0x04, 0, read8smo_delegate(*this, FUNC(ep64_exdos_device::read)), write8smo_delegate(*this, FUNC(ep64_exdos_device::write))); } @@ -157,8 +157,8 @@ void ep64_exdos_device::device_reset() { m_fdc->reset(); - m_floppy = nullptr; - m_fdc->set_floppy(m_floppy); + m_selected_floppy = nullptr; + m_fdc->set_floppy(m_selected_floppy); m_fdc->dden_w(0); } @@ -167,7 +167,7 @@ void ep64_exdos_device::device_reset() // read - //------------------------------------------------- -READ8_MEMBER( ep64_exdos_device::read ) +uint8_t ep64_exdos_device::read() { /* @@ -189,7 +189,7 @@ READ8_MEMBER( ep64_exdos_device::read ) data |= m_fdc->intrq_r() << 1; data |= m_fdc->drq_r() << 7; - data |= (m_floppy ? m_floppy->dskchg_r() : 1) << 6; + data |= (m_selected_floppy ? m_selected_floppy->dskchg_r() : 1) << 6; return data; } @@ -199,7 +199,7 @@ READ8_MEMBER( ep64_exdos_device::read ) // write - //------------------------------------------------- -WRITE8_MEMBER( ep64_exdos_device::write ) +void ep64_exdos_device::write(uint8_t data) { /* @@ -216,19 +216,18 @@ WRITE8_MEMBER( ep64_exdos_device::write ) */ - m_floppy = nullptr; - - if (BIT(data, 0)) m_floppy = m_floppy0->get_device(); - if (BIT(data, 1)) m_floppy = m_floppy1->get_device(); - if (BIT(data, 2)) m_floppy = m_floppy2->get_device(); - if (BIT(data, 3)) m_floppy = m_floppy3->get_device(); + m_selected_floppy = nullptr; - m_fdc->set_floppy(m_floppy); - - if (m_floppy) + for (int n = 0; n < 4; n++) { - m_floppy->ss_w(BIT(data, 4)); + if (BIT(data, n)) + m_selected_floppy = m_floppy[n]->get_device(); } + m_fdc->set_floppy(m_selected_floppy); + + if (m_selected_floppy) + m_selected_floppy->ss_w(BIT(data, 4)); + m_fdc->dden_w(BIT(data, 5)); } |