summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus
diff options
context:
space:
mode:
author Dirk Best <mail@dirk-best.de>2016-03-17 23:50:27 +0100
committer Dirk Best <mail@dirk-best.de>2016-03-17 23:57:04 +0100
commitde0d79e5e9549b9648fd9bed5272aa498d2ffbbb (patch)
tree4dc62f79b26f5576ef6ab358ebaf0ad50f378817 /src/devices/bus
parent9737f41ad0ce8089800f8cccd152f0e8244842fb (diff)
svi318: add support for the rs232 interface (sv805)
Diffstat (limited to 'src/devices/bus')
-rw-r--r--src/devices/bus/svi3x8/slot/cards.cpp1
-rw-r--r--src/devices/bus/svi3x8/slot/cards.h1
-rw-r--r--src/devices/bus/svi3x8/slot/slot.h1
-rw-r--r--src/devices/bus/svi3x8/slot/sv805.cpp109
-rw-r--r--src/devices/bus/svi3x8/slot/sv805.h49
5 files changed, 161 insertions, 0 deletions
diff --git a/src/devices/bus/svi3x8/slot/cards.cpp b/src/devices/bus/svi3x8/slot/cards.cpp
index 8e60b1ae1d8..aedcb736d03 100644
--- a/src/devices/bus/svi3x8/slot/cards.cpp
+++ b/src/devices/bus/svi3x8/slot/cards.cpp
@@ -11,6 +11,7 @@
SLOT_INTERFACE_START( svi_slot_cards )
SLOT_INTERFACE("sv801", SV801)
SLOT_INTERFACE("sv803", SV803)
+ SLOT_INTERFACE("sv805", SV805)
SLOT_INTERFACE("sv806", SV806)
SLOT_INTERFACE("sv807", SV807)
SLOT_INTERFACE_END
diff --git a/src/devices/bus/svi3x8/slot/cards.h b/src/devices/bus/svi3x8/slot/cards.h
index 03492742e53..8bc3e31f1bc 100644
--- a/src/devices/bus/svi3x8/slot/cards.h
+++ b/src/devices/bus/svi3x8/slot/cards.h
@@ -14,6 +14,7 @@
#include "emu.h"
#include "sv801.h"
#include "sv803.h"
+#include "sv805.h"
#include "sv806.h"
#include "sv807.h"
diff --git a/src/devices/bus/svi3x8/slot/slot.h b/src/devices/bus/svi3x8/slot/slot.h
index 6cea923f6f6..e41e6c107f1 100644
--- a/src/devices/bus/svi3x8/slot/slot.h
+++ b/src/devices/bus/svi3x8/slot/slot.h
@@ -96,6 +96,7 @@ public:
void add_card(device_svi_slot_interface *card);
// from slot
+ DECLARE_WRITE_LINE_MEMBER( int_w ) { m_int_handler(state); };
DECLARE_WRITE_LINE_MEMBER( romdis_w ) { m_romdis_handler(state); };
DECLARE_WRITE_LINE_MEMBER( ramdis_w ) { m_ramdis_handler(state); };
diff --git a/src/devices/bus/svi3x8/slot/sv805.cpp b/src/devices/bus/svi3x8/slot/sv805.cpp
new file mode 100644
index 00000000000..d240e95f2e1
--- /dev/null
+++ b/src/devices/bus/svi3x8/slot/sv805.cpp
@@ -0,0 +1,109 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ SV-805 RS-232 Interface for SVI 318/328
+
+***************************************************************************/
+
+#include "sv805.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+const device_type SV805 = &device_creator<sv805_device>;
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+static MACHINE_CONFIG_FRAGMENT( sv805 )
+ MCFG_DEVICE_ADD("uart", INS8250, XTAL_3_072MHz)
+ MCFG_INS8250_OUT_INT_CB(WRITELINE(sv805_device, uart_intr_w))
+ MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("rs232", rs232_port_device, write_txd))
+ MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE("rs232", rs232_port_device, write_dtr))
+ MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE("rs232", rs232_port_device, write_rts))
+
+ MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, nullptr)
+ MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart", ins8250_uart_device, rx_w))
+ MCFG_RS232_DCD_HANDLER(DEVWRITELINE("uart", ins8250_uart_device, dcd_w))
+ MCFG_RS232_DSR_HANDLER(DEVWRITELINE("uart", ins8250_uart_device, dsr_w))
+ MCFG_RS232_CTS_HANDLER(DEVWRITELINE("uart", ins8250_uart_device, cts_w))
+MACHINE_CONFIG_END
+
+machine_config_constructor sv805_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( sv805 );
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// sv806_device - constructor
+//-------------------------------------------------
+
+sv805_device::sv805_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, SV805, "SV-805 RS-232 Interface", tag, owner, clock, "sv805", __FILE__),
+ device_svi_slot_interface(mconfig, *this),
+ m_uart(*this, "uart"),
+ m_rs232(*this, "rs232")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void sv805_device::device_start()
+{
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+READ8_MEMBER( sv805_device::iorq_r )
+{
+ switch (offset)
+ {
+ case 0x28:
+ case 0x29:
+ case 0x2a:
+ case 0x2b:
+ case 0x2c:
+ case 0x2d:
+ case 0x2e:
+ case 0x2f:
+ return m_uart->ins8250_r(space, offset & 0x07);
+ }
+
+ return 0xff;
+}
+
+WRITE8_MEMBER( sv805_device::iorq_w )
+{
+ switch (offset)
+ {
+ case 0x28:
+ case 0x29:
+ case 0x2a:
+ case 0x2b:
+ case 0x2c:
+ case 0x2d:
+ case 0x2e:
+ case 0x2f:
+ m_uart->ins8250_w(space, offset & 0x07, data);
+ }
+}
+
+WRITE_LINE_MEMBER( sv805_device::uart_intr_w )
+{
+ m_bus->int_w(state);
+}
diff --git a/src/devices/bus/svi3x8/slot/sv805.h b/src/devices/bus/svi3x8/slot/sv805.h
new file mode 100644
index 00000000000..6d64ef54256
--- /dev/null
+++ b/src/devices/bus/svi3x8/slot/sv805.h
@@ -0,0 +1,49 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ SV-805 RS-232 Interface for SVI 318/328
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __SVI3X8_SLOT_SV805_H__
+#define __SVI3X8_SLOT_SV805_H__
+
+#include "emu.h"
+#include "slot.h"
+#include "machine/ins8250.h"
+#include "bus/rs232/rs232.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> sv805_device
+
+class sv805_device : public device_t, public device_svi_slot_interface
+{
+public:
+ // construction/destruction
+ sv805_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ virtual DECLARE_READ8_MEMBER( iorq_r ) override;
+ virtual DECLARE_WRITE8_MEMBER( iorq_w ) override;
+
+ DECLARE_WRITE_LINE_MEMBER( uart_intr_w );
+
+protected:
+ virtual machine_config_constructor device_mconfig_additions() const override;
+ virtual void device_start() override;
+
+private:
+ required_device<ins8250_device> m_uart;
+ required_device<rs232_port_device> m_rs232;
+};
+
+// device type definition
+extern const device_type SV805;
+
+#endif // __SVI3X8_SLOT_SV805_H__