summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/duet16.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-02-19 23:35:14 -0500
committer AJR <ajrhacker@users.noreply.github.com>2018-02-19 23:35:14 -0500
commit33894e6e72b9fbb2f2ea59bc1a95de9e9c10d593 (patch)
tree01280ed1b81df762e237265cea6648309a3cdd6d /src/mame/drivers/duet16.cpp
parent2b53fe616fe30c4c5c3e8ebcebc1931bdf540ab1 (diff)
duet16: External floppy drive select (nw)
Diffstat (limited to 'src/mame/drivers/duet16.cpp')
-rw-r--r--src/mame/drivers/duet16.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mame/drivers/duet16.cpp b/src/mame/drivers/duet16.cpp
index 9d6c777622a..cb8c05ab136 100644
--- a/src/mame/drivers/duet16.cpp
+++ b/src/mame/drivers/duet16.cpp
@@ -26,8 +26,7 @@ public:
m_pic(*this, "pic"),
m_fdc(*this, "fdc"),
m_dmac(*this, "dmac"),
- m_fd0(*this, "fdc:0"),
- m_fd1(*this, "fdc:1"),
+ m_fd(*this, "fdc:%u", 0),
m_chrrom(*this, "char"),
m_vram(*this, "vram")
{ }
@@ -48,8 +47,7 @@ private:
required_device<pic8259_device> m_pic;
required_device<upd765a_device> m_fdc;
required_device<am9517a_device> m_dmac;
- required_device<floppy_connector> m_fd0;
- required_device<floppy_connector> m_fd1;
+ required_device_array<floppy_connector, 2> m_fd;
required_memory_region m_chrrom;
required_shared_ptr<u16> m_vram;
};
@@ -66,10 +64,15 @@ WRITE8_MEMBER(duet16_state::pic_w)
WRITE8_MEMBER(duet16_state::fdcctrl_w)
{
- m_fd0->get_device()->mon_w(!BIT(data, 0));
- m_fd1->get_device()->mon_w(!BIT(data, 0));
+ floppy_image_device *f = m_fd[BIT(data, 2) ? 0 : 1]->get_device();
+ m_fdc->set_floppy(f);
+
+ m_fd[0]->get_device()->mon_w(!BIT(data, 0));
+ m_fd[1]->get_device()->mon_w(!BIT(data, 0));
if(!BIT(data, 1))
m_fdc->soft_reset();
+
+ // TODO: bit 3 = LSPD
}
READ8_MEMBER(duet16_state::dma_mem_r)
@@ -185,7 +188,7 @@ MACHINE_CONFIG_START(duet16_state::duet16)
MCFG_INPUT_MERGER_ANY_HIGH("kbint")
MCFG_INPUT_MERGER_OUTPUT_HANDLER(DEVWRITELINE("pic", pic8259_device, ir5_w)) // INT2
- MCFG_DEVICE_ADD("fdc", UPD765A, 0)
+ MCFG_UPD765A_ADD("fdc", true, false)
MCFG_UPD765_DRQ_CALLBACK(DEVWRITELINE("dmac", am9517a_device, dreq0_w))
MCFG_UPD765_INTRQ_CALLBACK(DEVWRITELINE("pic", pic8259_device, ir3_w)) // INT4
MCFG_FLOPPY_DRIVE_ADD("fdc:0", duet16_floppies, "525qd", floppy_image_device::default_floppy_formats)