summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/superslave.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/superslave.cpp')
-rw-r--r--src/mame/drivers/superslave.cpp83
1 files changed, 66 insertions, 17 deletions
diff --git a/src/mame/drivers/superslave.cpp b/src/mame/drivers/superslave.cpp
index 6c2220688cb..0afcdd76c42 100644
--- a/src/mame/drivers/superslave.cpp
+++ b/src/mame/drivers/superslave.cpp
@@ -21,7 +21,66 @@ Oxx,yy = Out port
****************************************************************************/
#include "emu.h"
-#include "includes/superslave.h"
+#include "bus/rs232/rs232.h"
+#include "cpu/z80/z80.h"
+#include "cpu/z80/z80daisy.h"
+#include "machine/com8116.h"
+#include "machine/pic8259.h"
+#include "machine/ram.h"
+#include "machine/z80dart.h"
+#include "machine/z80pio.h"
+
+#define Z80_TAG "u45"
+#define Z80DART_0_TAG "u14"
+#define Z80DART_1_TAG "u30"
+#define Z80PIO_TAG "u43"
+#define AM9519_TAG "u13"
+#define BR1941_TAG "u12"
+#define RS232_A_TAG "rs232a"
+#define RS232_B_TAG "rs232b"
+#define RS232_C_TAG "rs232c"
+#define RS232_D_TAG "rs232d"
+
+class superslave_state : public driver_device
+{
+public:
+ superslave_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, Z80_TAG)
+ , m_dbrg(*this, BR1941_TAG)
+ , m_ram(*this, RAM_TAG)
+ , m_rs232a(*this, RS232_A_TAG)
+ , m_rs232b(*this, RS232_B_TAG)
+ , m_rs232c(*this, RS232_C_TAG)
+ , m_rs232d(*this, RS232_D_TAG)
+ , m_rom(*this, Z80_TAG)
+ , m_memctrl(0x01)
+ , m_cmd(0x01)
+ { }
+
+ DECLARE_READ8_MEMBER( read );
+ DECLARE_WRITE8_MEMBER( write );
+ DECLARE_WRITE8_MEMBER( baud_w );
+ DECLARE_WRITE8_MEMBER( memctrl_w );
+ DECLARE_READ8_MEMBER( status_r );
+ DECLARE_WRITE8_MEMBER( cmd_w );
+
+private:
+ required_device<cpu_device> m_maincpu;
+ required_device<com8116_device> m_dbrg;
+ required_device<ram_device> m_ram;
+ required_device<rs232_port_device> m_rs232a;
+ required_device<rs232_port_device> m_rs232b;
+ required_device<rs232_port_device> m_rs232c;
+ required_device<rs232_port_device> m_rs232d;
+ required_memory_region m_rom;
+
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
+ uint8_t m_memctrl;
+ uint8_t m_cmd;
+};
@@ -254,20 +313,6 @@ INPUT_PORTS_END
// COM8116_INTERFACE( dbrg_intf )
//-------------------------------------------------
-WRITE_LINE_MEMBER( superslave_state::fr_w )
-{
- m_dart0->rxca_w(state);
- m_dart0->txca_w(state);
- m_dart1->rxca_w(state);
- m_dart1->txca_w(state);
-}
-
-WRITE_LINE_MEMBER( superslave_state::ft_w )
-{
- m_dart0->rxtxcb_w(state);
- m_dart1->rxtxcb_w(state);
-}
-
static DEVICE_INPUT_DEFAULTS_START( terminal )
DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_9600 )
@@ -379,8 +424,12 @@ static MACHINE_CONFIG_START( superslave )
MCFG_RS232_CTS_HANDLER(DEVWRITELINE(Z80DART_1_TAG, z80dart_device, ctsb_w))
MCFG_DEVICE_ADD(BR1941_TAG, COM8116, XTAL_5_0688MHz)
- MCFG_COM8116_FR_HANDLER(WRITELINE(superslave_state, fr_w))
- MCFG_COM8116_FT_HANDLER(WRITELINE(superslave_state, ft_w))
+ MCFG_COM8116_FR_HANDLER(DEVWRITELINE(Z80DART_0_TAG, z80dart_device, txca_w))
+ MCFG_DEVCB_CHAIN_OUTPUT(DEVWRITELINE(Z80DART_0_TAG, z80dart_device, rxca_w))
+ MCFG_DEVCB_CHAIN_OUTPUT(DEVWRITELINE(Z80DART_1_TAG, z80dart_device, txca_w))
+ MCFG_DEVCB_CHAIN_OUTPUT(DEVWRITELINE(Z80DART_1_TAG, z80dart_device, rxca_w))
+ MCFG_COM8116_FT_HANDLER(DEVWRITELINE(Z80DART_0_TAG, z80dart_device, rxtxcb_w))
+ MCFG_DEVCB_CHAIN_OUTPUT(DEVWRITELINE(Z80DART_1_TAG, z80dart_device, rxtxcb_w))
// internal ram
MCFG_RAM_ADD(RAM_TAG)