summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/europc.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2020-04-07 14:46:02 -0400
committer AJR <ajrhacker@users.noreply.github.com>2020-04-07 14:49:08 -0400
commit2dbbbfca73e40a9108c6a295adb8ddf3be105a15 (patch)
tree7b58bca066ab2719ecea5e6fb51b615e295bee9b /src/mame/drivers/europc.cpp
parent20f8b011c5d01299a16baebf9303316427c0d3d2 (diff)
Collapse pc_fdc device hierarchy (nw)
- pc_fdc_interface has been eliminated. The XT and AT hookups have been moved into the ISA devices. - pc_fdc_xt_device remains for now only because two drivers depend on it. - europc still prints "disk error" on boot. It should still be possible to fix this.
Diffstat (limited to 'src/mame/drivers/europc.cpp')
-rw-r--r--src/mame/drivers/europc.cpp33
1 files changed, 28 insertions, 5 deletions
diff --git a/src/mame/drivers/europc.cpp b/src/mame/drivers/europc.cpp
index 7116d472661..6f514a7d542 100644
--- a/src/mame/drivers/europc.cpp
+++ b/src/mame/drivers/europc.cpp
@@ -515,19 +515,23 @@ void europc_pc_state::europc_io(address_map &map)
map(0x02e0, 0x02e0).r(FUNC(europc_pc_state::europc_jim2_r));
}
-class europc_fdc_device : public isa8_fdc_device
+class europc_fdc_device : public isa8_fdc_xt_device
{
public:
europc_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
virtual void device_add_mconfig(machine_config &config) override;
+ virtual void device_start() override;
+
+private:
+ void map(address_map &map);
};
DEFINE_DEVICE_TYPE(EUROPC_FDC, europc_fdc_device, "europc_fdc", "EURO PC FDC hookup")
europc_fdc_device::europc_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : isa8_fdc_device(mconfig, EUROPC_FDC, tag, owner, clock)
+ : isa8_fdc_xt_device(mconfig, EUROPC_FDC, tag, owner, clock)
{
}
@@ -539,14 +543,33 @@ static void pc_dd_floppies(device_slot_interface &device)
void europc_fdc_device::device_add_mconfig(machine_config &config)
{
- wd37c65c_device &fdc(WD37C65C(config, m_fdc, 16_MHz_XTAL));
- fdc.intrq_wr_callback().set(FUNC(isa8_fdc_device::irq_w));
- fdc.drq_wr_callback().set(FUNC(isa8_fdc_device::drq_w));
+ WD37C65C(config, m_fdc, 16_MHz_XTAL);
+ m_fdc->intrq_wr_callback().set(FUNC(europc_fdc_device::fdc_irq_w));
+ m_fdc->drq_wr_callback().set(FUNC(europc_fdc_device::fdc_drq_w));
// single built-in 3.5" 720K drive, connector for optional external 3.5" or 5.25" drive
FLOPPY_CONNECTOR(config, "fdc:0", pc_dd_floppies, "35dd", isa8_fdc_device::floppy_formats).set_fixed(true);
FLOPPY_CONNECTOR(config, "fdc:1", pc_dd_floppies, nullptr, isa8_fdc_device::floppy_formats);
}
+void europc_fdc_device::device_start()
+{
+ set_isa_device();
+ m_isa->install_device(0x03f0, 0x03f7, *this, &europc_fdc_device::map);
+ m_isa->set_dma_channel(2, this, true);
+
+ isa8_upd765_fdc_device::device_start();
+}
+
+void europc_fdc_device::map(address_map &map)
+{
+ // FIXME: the FDC has its own DOR
+ map(0x0, 0x0).r(m_fdc, FUNC(wd37c65c_device::msr_r)).w(FUNC(europc_fdc_device::dor_w));
+ map(0x1, 0x1).r(m_fdc, FUNC(wd37c65c_device::fifo_r)).w(FUNC(europc_fdc_device::dor_fifo_w));
+ map(0x2, 0x2).w(FUNC(europc_fdc_device::dor_w));
+ map(0x3, 0x3).w(FUNC(europc_fdc_device::dor_w));
+ map(0x4, 0x5).m(m_fdc, FUNC(wd37c65c_device::map));
+}
+
static void europc_fdc(device_slot_interface &device)
{
device.option_add("fdc", EUROPC_FDC);