summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Sandro Ronco <sandro.ronco@gmx.com>2019-10-24 20:13:30 +0200
committer Sandro Ronco <sandro.ronco@gmx.com>2019-10-24 20:13:30 +0200
commit5d5e0345e0a8b0cadcc715be17b32200ee095496 (patch)
tree6741ca00c277d4cca0c240c081f346a186341b33
parent3f63e4f466521b24811902ca635c438c7418750d (diff)
dmv: added HD interface. [Sandro Ronco]
-rw-r--r--hash/dmv.xml10
-rw-r--r--scripts/src/bus.lua2
-rw-r--r--src/devices/bus/dmv/k012.cpp122
-rw-r--r--src/devices/bus/dmv/k012.h65
-rw-r--r--src/mame/drivers/dmv.cpp16
5 files changed, 203 insertions, 12 deletions
diff --git a/hash/dmv.xml b/hash/dmv.xml
index 9985786df28..eee44f94b90 100644
--- a/hash/dmv.xml
+++ b/hash/dmv.xml
@@ -390,7 +390,7 @@
</part>
</software>
- <software name="zcom20hd" supported="no"> <!-- MS-DOS --> <!-- missing HDD emulation -->
+ <software name="zcom20hd">
<description>Z-Com v2.0 HD</description>
<year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
@@ -1282,7 +1282,7 @@
</part>
</software>
- <software name="dos211hd" supported="no"> <!-- MS-DOS --> <!-- missing HDD emulation -->
+ <software name="dos211hd"> <!-- MS-DOS -->
<description>MS-DOS v2.11 HD</description>
<year>198?</year>
<publisher>Microsoft</publisher>
@@ -1294,7 +1294,7 @@
</part>
</software>
- <software name="dos211hda" cloneof="dos211hd" supported="no"> <!-- MS-DOS --> <!-- missing HDD emulation -->
+ <software name="dos211hda" cloneof="dos211hd"> <!-- MS-DOS -->
<description>MS-DOS v2.11 HD (Alt)</description>
<year>198?</year>
<publisher>Microsoft</publisher>
@@ -1306,7 +1306,7 @@
</part>
</software>
- <software name="dos211hdb" cloneof="dos211hd" supported="no"> <!-- MS-DOS --> <!-- missing HDD emulation -->
+ <software name="dos211hdb" cloneof="dos211hd"> <!-- MS-DOS -->
<description>MS-DOS v2.11 HD (Alt 2)</description>
<year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
@@ -1318,7 +1318,7 @@
</part>
</software>
- <software name="dos211hdc" cloneof="dos211hd" supported="no"> <!-- MS-DOS --> <!-- missing HDD emulation -->
+ <software name="dos211hdc" cloneof="dos211hd"> <!-- MS-DOS -->
<description>MS-DOS v2.11 HD (Alt 3)</description>
<year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua
index 22f5f77e3fe..37514196b6b 100644
--- a/scripts/src/bus.lua
+++ b/scripts/src/bus.lua
@@ -832,6 +832,8 @@ if (BUSES["DMV"]~=null) then
files {
MAME_DIR .. "src/devices/bus/dmv/dmvbus.cpp",
MAME_DIR .. "src/devices/bus/dmv/dmvbus.h",
+ MAME_DIR .. "src/devices/bus/dmv/k012.cpp",
+ MAME_DIR .. "src/devices/bus/dmv/k012.h",
MAME_DIR .. "src/devices/bus/dmv/k210.cpp",
MAME_DIR .. "src/devices/bus/dmv/k210.h",
MAME_DIR .. "src/devices/bus/dmv/k220.cpp",
diff --git a/src/devices/bus/dmv/k012.cpp b/src/devices/bus/dmv/k012.cpp
new file mode 100644
index 00000000000..9b2e9e220f9
--- /dev/null
+++ b/src/devices/bus/dmv/k012.cpp
@@ -0,0 +1,122 @@
+// license:BSD-3-Clause
+// copyright-holders:Sandro Ronco
+// thanks-to:rfka01
+/***************************************************************************
+
+ K012 Internal HD Interface
+ C3282 External HD Interface
+
+***************************************************************************/
+
+#include "emu.h"
+#include "k012.h"
+
+/***************************************************************************
+ IMPLEMENTATION
+***************************************************************************/
+
+static INPUT_PORTS_START( dmv_k012 )
+ PORT_START("JUMPERS")
+ PORT_DIPNAME( 0x1f, 0x10, "IFSEL" ) PORT_DIPLOCATION("J:!1,J:!2,J:!3,J:!4,J:!5")
+ PORT_DIPSETTING( 0x01, "0A" )
+ PORT_DIPSETTING( 0x02, "1A" )
+ PORT_DIPSETTING( 0x04, "2A" )
+ PORT_DIPSETTING( 0x08, "3A" )
+ PORT_DIPSETTING( 0x10, "4A" ) // default
+INPUT_PORTS_END
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(DMV_K012, dmv_k012_device, "dmv_k012", "K012 Internal HD Interface")
+DEFINE_DEVICE_TYPE(DMV_C3282, dmv_c3282_device, "dmv_c3282", "C3282 External HD Interface")
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// dmv_k012_device - constructor
+//-------------------------------------------------
+
+dmv_k012_device::dmv_k012_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : dmv_k012_device(mconfig, DMV_K012, tag, owner, clock)
+{
+}
+
+dmv_k012_device::dmv_k012_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock)
+ , device_dmvslot_interface( mconfig, *this )
+ , m_hdc(*this, "hdc")
+ , m_bus(*this, DEVICE_SELF_OWNER)
+ , m_jumpers(*this, "JUMPERS")
+{
+}
+
+//-------------------------------------------------
+// dmv_c3282_device - constructor
+//-------------------------------------------------
+
+dmv_c3282_device::dmv_c3282_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : dmv_k012_device(mconfig, DMV_C3282, tag, owner, clock)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void dmv_k012_device::device_start()
+{
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void dmv_k012_device::device_reset()
+{
+}
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor dmv_k012_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( dmv_k012 );
+}
+
+//-------------------------------------------------
+// device_add_mconfig - add device configuration
+//-------------------------------------------------
+
+void dmv_k012_device::device_add_mconfig(machine_config &config)
+{
+ WD1000(config, m_hdc, 20_MHz_XTAL / 4); // WD1010
+ m_hdc->intrq_wr_callback().set(FUNC(dmv_k012_device::hdc_intrq_w));
+
+ // default drive is 10MB (306,4,17)
+ HARDDISK(config, "hdc:0", 0);
+ HARDDISK(config, "hdc:1", 0);
+ HARDDISK(config, "hdc:2", 0);
+ HARDDISK(config, "hdc:3", 0);
+}
+
+void dmv_k012_device::io_read(int ifsel, offs_t offset, uint8_t &data)
+{
+ if ((1 << ifsel) == m_jumpers->read() && !(offset & 0x08))
+ data = m_hdc->read(machine().dummy_space(), offset);
+}
+
+void dmv_k012_device::io_write(int ifsel, offs_t offset, uint8_t data)
+{
+ if ((1 << ifsel) == m_jumpers->read() && !(offset & 0x08))
+ m_hdc->write(machine().dummy_space(), offset, data);
+}
+
+WRITE_LINE_MEMBER(dmv_k012_device::hdc_intrq_w)
+{
+ m_bus->m_out_irq_cb(state);
+}
diff --git a/src/devices/bus/dmv/k012.h b/src/devices/bus/dmv/k012.h
new file mode 100644
index 00000000000..9eac3e5a79f
--- /dev/null
+++ b/src/devices/bus/dmv/k012.h
@@ -0,0 +1,65 @@
+// license:BSD-3-Clause
+// copyright-holders:Sandro Ronco
+// thanks-to:rfka01
+#ifndef MAME_BUS_DMV_K012_H
+#define MAME_BUS_DMV_K012_H
+
+#pragma once
+
+#include "dmvbus.h"
+#include "machine/wd1000.h"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> dmv_k012_device
+
+class dmv_k012_device :
+ public device_t,
+ public device_dmvslot_interface
+{
+public:
+ // construction/destruction
+ dmv_k012_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ dmv_k012_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+ // optional information overrides
+ virtual void device_add_mconfig(machine_config &config) override;
+ virtual ioport_constructor device_input_ports() const override;
+
+ // dmvcart_interface overrides
+ virtual void io_read(int ifsel, offs_t offset, uint8_t &data) override;
+ virtual void io_write(int ifsel, offs_t offset, uint8_t data) override;
+
+ DECLARE_WRITE_LINE_MEMBER(hdc_intrq_w);
+
+private:
+ required_device<wd1000_device> m_hdc;
+ required_device<dmvcart_slot_device> m_bus;
+ required_ioport m_jumpers;
+};
+
+
+// ======================> dmv_c3282_device
+
+class dmv_c3282_device :
+ public dmv_k012_device
+{
+public:
+ // construction/destruction
+ dmv_c3282_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(DMV_K012, dmv_k012_device)
+DECLARE_DEVICE_TYPE(DMV_C3282, dmv_c3282_device)
+
+#endif // MAME_BUS_DMV_K012_H
diff --git a/src/mame/drivers/dmv.cpp b/src/mame/drivers/dmv.cpp
index fabbe4a5635..66c07e6e748 100644
--- a/src/mame/drivers/dmv.cpp
+++ b/src/mame/drivers/dmv.cpp
@@ -24,6 +24,7 @@
// expansion slots
#include "bus/dmv/dmvbus.h"
+#include "bus/dmv/k012.h"
#include "bus/dmv/k210.h"
#include "bus/dmv/k220.h"
#include "bus/dmv/k230.h"
@@ -258,8 +259,8 @@ WRITE8_MEMBER(dmv_state::fdd_motor_w)
m_pit->write_gate0(0);
m_floppy_motor = 0;
- m_floppy0->get_device()->mon_w(m_floppy_motor);
- m_floppy1->get_device()->mon_w(m_floppy_motor);
+ if (m_floppy0->get_device()) m_floppy0->get_device()->mon_w(m_floppy_motor);
+ if (m_floppy1->get_device()) m_floppy1->get_device()->mon_w(m_floppy_motor);
}
READ8_MEMBER(dmv_state::sys_status_r)
@@ -284,7 +285,7 @@ READ8_MEMBER(dmv_state::sys_status_r)
if (!(m_slot7->av16bit() || m_slot7a->av16bit()))
data |= 0x02;
- if (!m_floppy0->get_device()->ready_r())
+ if (m_floppy0->get_device() && !m_floppy0->get_device()->ready_r())
data |= 0x04;
if (m_fdc->get_irq())
@@ -617,7 +618,7 @@ void dmv_state::upd7220_map(address_map &map)
/* Input ports */
INPUT_PORTS_START( dmv )
PORT_START("CONFIG")
- PORT_CONFNAME( 0x01, 0x00, "Video Board" )
+ PORT_CONFNAME( 0x01, 0x01, "Video Board" )
PORT_CONFSETTING( 0x00, "Monochrome" )
PORT_CONFSETTING( 0x01, "Color" )
INPUT_PORTS_END
@@ -709,8 +710,8 @@ WRITE_LINE_MEMBER( dmv_state::pit_out0 )
if (!state)
{
m_floppy_motor = 1;
- m_floppy0->get_device()->mon_w(m_floppy_motor);
- m_floppy1->get_device()->mon_w(m_floppy_motor);
+ if (m_floppy0->get_device()) m_floppy0->get_device()->mon_w(m_floppy_motor);
+ if (m_floppy1->get_device()) m_floppy1->get_device()->mon_w(m_floppy_motor);
}
}
@@ -752,6 +753,7 @@ static void dmv_slot2_6(device_slot_interface &device)
device.option_add("k801", DMV_K801); // K801 RS-232 Switchable Interface
device.option_add("k803", DMV_K803); // K803 RTC module
device.option_add("k806", DMV_K806); // K806 Mouse module
+ device.option_add("c3282", DMV_C3282); // C3282 External HD Interface
}
static void dmv_slot7(device_slot_interface &device)
@@ -764,7 +766,7 @@ static void dmv_slot7(device_slot_interface &device)
static void dmv_slot2a(device_slot_interface &device)
{
-
+ device.option_add("k012", DMV_K012); // K012 Internal HD Interface
}
static void dmv_slot7a(device_slot_interface &device)