summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Robbbert <Robbbert@users.noreply.github.com>2017-09-17 16:25:49 +1000
committer Robbbert <Robbbert@users.noreply.github.com>2017-09-17 16:25:49 +1000
commitd579842db328b1d0d5e1e65f1c06baa879153de6 (patch)
treed0f8dea936e72d1e25ea8e4caf3defd131e7d587
parentd54e33ec23916bc5b867d13721373473ad881061 (diff)
(nw) uarts for vector4, ccs300, ipc & cleanups
-rw-r--r--src/mame/drivers/ccs300.cpp101
-rw-r--r--src/mame/drivers/dual68.cpp24
-rw-r--r--src/mame/drivers/ipc.cpp97
-rw-r--r--src/mame/drivers/msbc1.cpp22
-rw-r--r--src/mame/drivers/pimps.cpp2
-rw-r--r--src/mame/drivers/vector4.cpp107
-rw-r--r--src/mame/includes/msbc1.h28
7 files changed, 207 insertions, 174 deletions
diff --git a/src/mame/drivers/ccs300.cpp b/src/mame/drivers/ccs300.cpp
index 78f52e4f770..9e78f79ee9f 100644
--- a/src/mame/drivers/ccs300.cpp
+++ b/src/mame/drivers/ccs300.cpp
@@ -15,38 +15,36 @@ Early on, it does a read from port F2. If bit 3 is low, the system becomes
a Model 400.
Since IM2 is used, it is assumed there are Z80 peripherals on board.
-There's unknown usage of ports 11 thru 1B, 34, and F0 thru F2.
****************************************************************************/
#include "emu.h"
#include "cpu/z80/z80.h"
-#include "machine/terminal.h"
+#include "cpu/z80/z80daisy.h"
+#include "machine/z80ctc.h"
+#include "machine/z80pio.h"
+#include "machine/z80sio.h"
+#include "machine/clock.h"
+#include "bus/rs232/rs232.h"
-#define TERMINAL_TAG "terminal"
class ccs300_state : public driver_device
{
public:
ccs300_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu"),
- m_terminal(*this, TERMINAL_TAG)
- {
- }
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
+ , m_sio(*this, "sio")
+ { }
+ DECLARE_WRITE_LINE_MEMBER(clock_tick);
DECLARE_DRIVER_INIT(ccs300);
DECLARE_MACHINE_RESET(ccs300);
- DECLARE_READ8_MEMBER(port10_r);
- DECLARE_READ8_MEMBER(port11_r);
- DECLARE_WRITE8_MEMBER(port10_w);
DECLARE_WRITE8_MEMBER(port40_w);
- void kbd_put(u8 data);
private:
- uint8_t m_term_data;
required_device<cpu_device> m_maincpu;
- required_device<generic_terminal_device> m_terminal;
+ required_device<z80sio_device> m_sio;
};
static ADDRESS_MAP_START(ccs300_mem, AS_PROGRAM, 8, ccs300_state)
@@ -58,41 +56,34 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( ccs300_io, AS_IO, 8, ccs300_state)
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x10, 0x10) AM_READWRITE(port10_r,port10_w)
- AM_RANGE(0x11, 0x11) AM_READ(port11_r)
+ AM_RANGE(0x10, 0x13) AM_DEVREADWRITE("sio", z80sio_device, ba_cd_r, ba_cd_w)
+ AM_RANGE(0x14, 0x17) AM_DEVREADWRITE("pio", z80pio_device, read_alt, write_alt) // init bytes seem to be for a PIO
+ AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE("ctc", z80ctc_device, read, write) // init bytes seem to be for a CTC
+ AM_RANGE(0x30, 0x33) // fdc?
+ AM_RANGE(0x34, 0x34) // motor control?
AM_RANGE(0x40, 0x40) AM_WRITE(port40_w)
+ AM_RANGE(0xf0, 0xf0) // unknown, long sequence of init bytes
+ AM_RANGE(0xf2, 0xf2) // dip or jumper?
ADDRESS_MAP_END
/* Input ports */
static INPUT_PORTS_START( ccs300 )
INPUT_PORTS_END
-//*************************************
-//
-// Keyboard
-//
-//*************************************
-READ8_MEMBER( ccs300_state::port10_r )
-{
- uint8_t ret = m_term_data;
- m_term_data = 0;
- return ret;
-}
-
-READ8_MEMBER( ccs300_state::port11_r )
+// source of baud frequency is unknown, so we invent a clock
+WRITE_LINE_MEMBER( ccs300_state::clock_tick )
{
- return (m_term_data) ? 5 : 4;
+ m_sio->txca_w(state);
+ m_sio->rxca_w(state);
}
-WRITE8_MEMBER( ccs300_state::port10_w )
+static const z80_daisy_config daisy_chain[] =
{
- m_terminal->write(space, 0, data & 0x7f);
-}
-
-void ccs300_state::kbd_put(u8 data)
-{
- m_term_data = data;
-}
+ { "ctc" },
+ { "sio" },
+ { "pio" },
+ { nullptr }
+};
//*************************************
//
@@ -119,16 +110,46 @@ DRIVER_INIT_MEMBER( ccs300_state, ccs300 )
membank("bankw0")->configure_entry(0, &main[0x0000]);
}
+// bit 7 needs to be stripped off, we do this by choosing 7 bits and even parity
+static DEVICE_INPUT_DEFAULTS_START( terminal )
+ DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_9600 )
+ DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_9600 )
+ DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 )
+ DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_7 )
+ DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_EVEN )
+ DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_2 )
+DEVICE_INPUT_DEFAULTS_END
+
static MACHINE_CONFIG_START( ccs300 )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu",Z80, XTAL_4MHz)
MCFG_CPU_PROGRAM_MAP(ccs300_mem)
MCFG_CPU_IO_MAP(ccs300_io)
+ MCFG_Z80_DAISY_CHAIN(daisy_chain)
+
MCFG_MACHINE_RESET_OVERRIDE(ccs300_state, ccs300)
/* video hardware */
- MCFG_DEVICE_ADD(TERMINAL_TAG, GENERIC_TERMINAL, 0)
- MCFG_GENERIC_TERMINAL_KEYBOARD_CB(PUT(ccs300_state, kbd_put))
+ MCFG_DEVICE_ADD("uart_clock", CLOCK, 153600)
+ MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(ccs300_state, clock_tick))
+
+ /* Devices */
+ MCFG_Z80SIO_ADD("sio", XTAL_4MHz, 0, 0, 0, 0)
+ MCFG_Z80SIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
+ MCFG_Z80SIO_OUT_TXDA_CB(DEVWRITELINE("rs232", rs232_port_device, write_txd))
+ MCFG_Z80SIO_OUT_DTRA_CB(DEVWRITELINE("rs232", rs232_port_device, write_dtr))
+ MCFG_Z80SIO_OUT_RTSA_CB(DEVWRITELINE("rs232", rs232_port_device, write_rts))
+
+ MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal")
+ MCFG_RS232_RXD_HANDLER(DEVWRITELINE("sio", z80sio_device, rxa_w))
+ MCFG_RS232_CTS_HANDLER(DEVWRITELINE("sio", z80sio_device, ctsa_w))
+ MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", terminal) // must be exactly here
+
+ MCFG_DEVICE_ADD("ctc", Z80CTC, XTAL_4MHz)
+ MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
+
+ MCFG_DEVICE_ADD("pio", Z80PIO, XTAL_4MHz)
+ MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mame/drivers/dual68.cpp b/src/mame/drivers/dual68.cpp
index fb175c129c1..214d58dd4e9 100644
--- a/src/mame/drivers/dual68.cpp
+++ b/src/mame/drivers/dual68.cpp
@@ -13,29 +13,26 @@
#include "cpu/i8085/i8085.h"
#include "machine/terminal.h"
-#define TERMINAL_TAG "terminal"
class dual68_state : public driver_device
{
public:
dual68_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu"),
- m_terminal(*this, TERMINAL_TAG),
- m_p_ram(*this, "p_ram")
- {
- }
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
+ , m_terminal(*this, "terminal")
+ , m_p_ram(*this, "ram")
+ { }
void kbd_put(u8 data);
- DECLARE_WRITE16_MEMBER( dual68_terminal_w );
+ DECLARE_WRITE16_MEMBER(dual68_terminal_w);
-protected:
+private:
virtual void machine_reset() override;
-
required_device<cpu_device> m_maincpu;
required_device<generic_terminal_device> m_terminal;
- //uint8_t m_term_data;
required_shared_ptr<uint16_t> m_p_ram;
+ //uint8_t m_term_data;
};
@@ -47,7 +44,7 @@ WRITE16_MEMBER( dual68_state::dual68_terminal_w )
static ADDRESS_MAP_START(dual68_mem, AS_PROGRAM, 16, dual68_state)
ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x00000000, 0x0000ffff) AM_RAM AM_SHARE("p_ram")
+ AM_RANGE(0x00000000, 0x0000ffff) AM_RAM AM_SHARE("ram")
AM_RANGE(0x00080000, 0x00081fff) AM_ROM AM_REGION("user1",0)
AM_RANGE(0x007f0000, 0x007f0001) AM_WRITE(dual68_terminal_w)
AM_RANGE(0x00800000, 0x00801fff) AM_ROM AM_REGION("user1",0)
@@ -91,9 +88,8 @@ static MACHINE_CONFIG_START( dual68 )
MCFG_CPU_PROGRAM_MAP(sio4_mem)
MCFG_CPU_IO_MAP(sio4_io)
-
/* video hardware */
- MCFG_DEVICE_ADD(TERMINAL_TAG, GENERIC_TERMINAL, 0)
+ MCFG_DEVICE_ADD("terminal", GENERIC_TERMINAL, 0)
MCFG_GENERIC_TERMINAL_KEYBOARD_CB(PUT(dual68_state, kbd_put))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/ipc.cpp b/src/mame/drivers/ipc.cpp
index 0df64b30376..bcc57a8f479 100644
--- a/src/mame/drivers/ipc.cpp
+++ b/src/mame/drivers/ipc.cpp
@@ -41,55 +41,44 @@
#include "emu.h"
#include "cpu/i8085/i8085.h"
-#include "machine/terminal.h"
+#include "machine/clock.h"
+#include "machine/i8251.h"
+#include "bus/rs232/rs232.h"
-#define TERMINAL_TAG "terminal"
class ipc_state : public driver_device
{
public:
ipc_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu"),
- m_terminal(*this, TERMINAL_TAG)
- {
- }
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
+ , m_uart1(*this, "uart1")
+ , m_uart2(*this, "uart2")
+ { }
- required_device<cpu_device> m_maincpu;
- required_device<generic_terminal_device> m_terminal;
- DECLARE_READ8_MEMBER( ipc_f4_r );
- DECLARE_READ8_MEMBER( ipc_f5_r );
- void kbd_put(u8 data);
- uint8_t *m_ram;
- uint8_t m_term_data;
+ DECLARE_WRITE_LINE_MEMBER(clock_tick);
+
+private:
virtual void machine_reset() override;
+ required_device<cpu_device> m_maincpu;
+ required_device<i8251_device> m_uart1;
+ required_device<i8251_device> m_uart2;
};
-READ8_MEMBER( ipc_state::ipc_f4_r )
-{
- uint8_t ret = m_term_data;
- m_term_data = 0;
- return ret;
-}
-
-// bit 0 high = ok to send to terminal; bit 1 high = key is pressed
-READ8_MEMBER( ipc_state::ipc_f5_r )
-{
- return (m_term_data) ? 3 : 1;
-}
-
static ADDRESS_MAP_START(ipc_mem, AS_PROGRAM, 8, ipc_state)
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000, 0xdfff) AM_RAM
- AM_RANGE(0xe800, 0xffff) AM_ROM
+ AM_RANGE(0xe800, 0xffff) AM_ROM AM_REGION("roms", 0)
ADDRESS_MAP_END
static ADDRESS_MAP_START( ipc_io, AS_IO, 8, ipc_state)
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0xf4, 0xf4) AM_READ(ipc_f4_r) AM_DEVWRITE(TERMINAL_TAG, generic_terminal_device, write)
- AM_RANGE(0xf5, 0xf5) AM_READ(ipc_f5_r)
+ AM_RANGE(0xf4, 0xf4) AM_DEVREADWRITE("uart1", i8251_device, data_r, data_w)
+ AM_RANGE(0xf5, 0xf5) AM_DEVREADWRITE("uart1", i8251_device, status_r, control_w)
+ AM_RANGE(0xf6, 0xf6) AM_DEVREADWRITE("uart2", i8251_device, data_r, data_w)
+ AM_RANGE(0xf7, 0xf7) AM_DEVREADWRITE("uart2", i8251_device, status_r, control_w)
ADDRESS_MAP_END
/* Input ports */
@@ -102,9 +91,13 @@ void ipc_state::machine_reset()
m_maincpu->set_state_int(i8085a_cpu_device::I8085_PC, 0xE800);
}
-void ipc_state::kbd_put(u8 data)
+// source of baud frequency is not documented, so we invent a clock
+WRITE_LINE_MEMBER( ipc_state::clock_tick )
{
- m_term_data = data;
+ m_uart1->write_txc(state);
+ m_uart1->write_rxc(state);
+ m_uart2->write_txc(state);
+ m_uart2->write_rxc(state);
}
static MACHINE_CONFIG_START( ipc )
@@ -114,27 +107,47 @@ static MACHINE_CONFIG_START( ipc )
MCFG_CPU_IO_MAP(ipc_io)
/* video hardware */
- MCFG_DEVICE_ADD(TERMINAL_TAG, GENERIC_TERMINAL, 0)
- MCFG_GENERIC_TERMINAL_KEYBOARD_CB(PUT(ipc_state, kbd_put))
+ MCFG_DEVICE_ADD("uart_clock", CLOCK, 153600)
+ MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(ipc_state, clock_tick))
+
+ MCFG_DEVICE_ADD("uart1", I8251, 0) // 8 data bits, no parity, 1 stop bit
+ MCFG_I8251_TXD_HANDLER(DEVWRITELINE("rs232a", rs232_port_device, write_txd))
+ MCFG_I8251_DTR_HANDLER(DEVWRITELINE("rs232a", rs232_port_device, write_dtr))
+ MCFG_I8251_RTS_HANDLER(DEVWRITELINE("rs232a", rs232_port_device, write_rts))
+
+ MCFG_RS232_PORT_ADD("rs232a", default_rs232_devices, "terminal")
+ MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart1", i8251_device, write_rxd))
+ MCFG_RS232_DSR_HANDLER(DEVWRITELINE("uart1", i8251_device, write_dsr))
+ MCFG_RS232_CTS_HANDLER(DEVWRITELINE("uart1", i8251_device, write_cts))
+
+ MCFG_DEVICE_ADD("uart2", I8251, 0) // 8 data bits, no parity, 2 stop bits
+ MCFG_I8251_TXD_HANDLER(DEVWRITELINE("rs232b", rs232_port_device, write_txd))
+ MCFG_I8251_DTR_HANDLER(DEVWRITELINE("rs232b", rs232_port_device, write_dtr))
+ MCFG_I8251_RTS_HANDLER(DEVWRITELINE("rs232b", rs232_port_device, write_rts))
+
+ MCFG_RS232_PORT_ADD("rs232b", default_rs232_devices, nullptr)
+ MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart2", i8251_device, write_rxd))
+ MCFG_RS232_DSR_HANDLER(DEVWRITELINE("uart2", i8251_device, write_dsr))
+ MCFG_RS232_CTS_HANDLER(DEVWRITELINE("uart2", i8251_device, write_cts))
MACHINE_CONFIG_END
/* ROM definition */
ROM_START( ipb )
- ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
- ROM_LOAD( "ipb_e8_v1.3.bin", 0xe800, 0x0800, CRC(fc9d4703) SHA1(2ce078e1bcd8b24217830c54bcf04c5d146d1b76) )
- ROM_LOAD( "ipb_f8_v1.3.bin", 0xf800, 0x0800, CRC(966ba421) SHA1(d6a904c7d992a05ed0f451d7d34c1fc8de9547ee) )
+ ROM_REGION( 0x1800, "roms", ROMREGION_ERASEFF )
+ ROM_LOAD( "ipb_e8_v1.3.bin", 0x0000, 0x0800, CRC(fc9d4703) SHA1(2ce078e1bcd8b24217830c54bcf04c5d146d1b76) )
+ ROM_LOAD( "ipb_f8_v1.3.bin", 0x1000, 0x0800, CRC(966ba421) SHA1(d6a904c7d992a05ed0f451d7d34c1fc8de9547ee) )
ROM_END
ROM_START( ipc )
- ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
- ROM_LOAD( "ipc_u82_v1.3_104584-001.bin", 0xe800, 0x1000, CRC(0889394f) SHA1(b7525baf1884a7d67402dea4b5566016a9861ef2) )
+ ROM_REGION( 0x1800, "roms", ROMREGION_ERASEFF )
+ ROM_LOAD( "ipc_u82_v1.3_104584-001.bin", 0x0000, 0x1000, CRC(0889394f) SHA1(b7525baf1884a7d67402dea4b5566016a9861ef2) )
// required rom is missing. Using this one from 'ipb' for now.
- ROM_LOAD( "ipb_f8_v1.3.bin", 0xf800, 0x0800, BAD_DUMP CRC(966ba421) SHA1(d6a904c7d992a05ed0f451d7d34c1fc8de9547ee) )
+ ROM_LOAD( "ipb_f8_v1.3.bin", 0x1000, 0x0800, BAD_DUMP CRC(966ba421) SHA1(d6a904c7d992a05ed0f451d7d34c1fc8de9547ee) )
ROM_END
/* Driver */
/* YEAR NAME PARENT COMPAT MACHINE INPUT STATE INIT COMPANY FULLNAME FLAGS */
-COMP( 19??, ipb, 0, 0, ipc, ipc, ipc_state, 0, "Intel", "iPB", MACHINE_NO_SOUND)
-COMP( 19??, ipc, ipb, 0, ipc, ipc, ipc_state, 0, "Intel", "iPC", MACHINE_NOT_WORKING | MACHINE_NO_SOUND)
+COMP( 19??, ipb, 0, 0, ipc, ipc, ipc_state, 0, "Intel", "iPB", MACHINE_NO_SOUND_HW )
+COMP( 19??, ipc, ipb, 0, ipc, ipc, ipc_state, 0, "Intel", "iPC", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW )
diff --git a/src/mame/drivers/msbc1.cpp b/src/mame/drivers/msbc1.cpp
index 2b2cc5d52f4..de6785b02cb 100644
--- a/src/mame/drivers/msbc1.cpp
+++ b/src/mame/drivers/msbc1.cpp
@@ -52,10 +52,23 @@ Notes:
#include "emu.h"
#include "cpu/m68000/m68000.h"
-#include "machine/terminal.h"
-#include "includes/msbc1.h"
+#define MC68000R12_TAG "u50"
+#define MK68564_0_TAG "u14"
+#define MK68564_1_TAG "u15"
+#define MC68230L10_TAG "u16"
-#define TERMINAL_TAG "terminal"
+class msbc1_state : public driver_device
+{
+public:
+ msbc1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, MC68000R12_TAG)
+ { }
+
+private:
+ virtual void machine_reset() override;
+ required_device<cpu_device> m_maincpu;
+};
static ADDRESS_MAP_START( msbc1_mem, AS_PROGRAM, 16, msbc1_state )
ADDRESS_MAP_UNMAP_HIGH
@@ -81,9 +94,6 @@ static MACHINE_CONFIG_START( msbc1 )
/* basic machine hardware */
MCFG_CPU_ADD(MC68000R12_TAG, M68000, XTAL_12_5MHz)
MCFG_CPU_PROGRAM_MAP(msbc1_mem)
-
- // devices
- MCFG_DEVICE_ADD(TERMINAL_TAG, GENERIC_TERMINAL, 0)
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mame/drivers/pimps.cpp b/src/mame/drivers/pimps.cpp
index 7f1a296a5a7..a54a19982cd 100644
--- a/src/mame/drivers/pimps.cpp
+++ b/src/mame/drivers/pimps.cpp
@@ -123,6 +123,8 @@ WRITE_LINE_MEMBER( pimps_state::clock_tick )
{
m_uart1->write_txc(state);
m_uart1->write_rxc(state);
+ m_uart2->write_txc(state);
+ m_uart2->write_rxc(state);
}
// baud is not documented, we will use 9600
diff --git a/src/mame/drivers/vector4.cpp b/src/mame/drivers/vector4.cpp
index 3facf73a53c..025b04e0683 100644
--- a/src/mame/drivers/vector4.cpp
+++ b/src/mame/drivers/vector4.cpp
@@ -10,53 +10,33 @@
#include "emu.h"
#include "cpu/z80/z80.h"
-#include "machine/terminal.h"
+#include "machine/clock.h"
+#include "machine/i8251.h"
+#include "bus/rs232/rs232.h"
-#define TERMINAL_TAG "terminal"
class vector4_state : public driver_device
{
public:
vector4_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu"),
- m_terminal(*this, TERMINAL_TAG)
- {
- }
-
- DECLARE_READ8_MEMBER(vector4_02_r);
- DECLARE_READ8_MEMBER(vector4_03_r);
- DECLARE_WRITE8_MEMBER(vector4_02_w);
- void kbd_put(u8 data);
-
-protected:
- virtual void machine_reset() override;
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
+ , m_uart1(*this, "uart1")
+ , m_uart2(*this, "uart2")
+ , m_uart3(*this, "uart3")
+ { }
+
+ DECLARE_WRITE_LINE_MEMBER( clock_tick );
+private:
+ virtual void machine_reset() override;
required_device<cpu_device> m_maincpu;
- required_device<generic_terminal_device> m_terminal;
- uint8_t m_term_data;
+ required_device<i8251_device> m_uart1;
+ required_device<i8251_device> m_uart2;
+ required_device<i8251_device> m_uart3;
};
-
-WRITE8_MEMBER( vector4_state::vector4_02_w )
-{
- if (data < 0xff)
- m_terminal->write(space, 0, data);
-}
-
-READ8_MEMBER( vector4_state::vector4_03_r )
-{
- return (m_term_data) ? 3 : 1;
-}
-
-READ8_MEMBER( vector4_state::vector4_02_r )
-{
- uint8_t ret = m_term_data;
- m_term_data = 0;
- return ret;
-}
-
static ADDRESS_MAP_START(vector4_mem, AS_PROGRAM, 8, vector4_state)
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000, 0xdfff) AM_RAM
@@ -69,8 +49,12 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START(vector4_io, AS_IO, 8, vector4_state)
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x02, 0x02) AM_READWRITE(vector4_02_r,vector4_02_w)
- AM_RANGE(0x03, 0x03) AM_READ(vector4_03_r)
+ AM_RANGE(0x02, 0x02) AM_DEVREADWRITE("uart1", i8251_device, data_r, data_w)
+ AM_RANGE(0x03, 0x03) AM_DEVREADWRITE("uart1", i8251_device, status_r, control_w)
+ AM_RANGE(0x04, 0x04) AM_DEVREADWRITE("uart2", i8251_device, data_r, data_w)
+ AM_RANGE(0x05, 0x05) AM_DEVREADWRITE("uart2", i8251_device, status_r, control_w)
+ AM_RANGE(0x06, 0x06) AM_DEVREADWRITE("uart3", i8251_device, data_r, data_w)
+ AM_RANGE(0x07, 0x07) AM_DEVREADWRITE("uart3", i8251_device, status_r, control_w)
ADDRESS_MAP_END
/* Input ports */
@@ -80,13 +64,18 @@ INPUT_PORTS_END
void vector4_state::machine_reset()
{
- m_term_data = 0;
m_maincpu->set_state_int(Z80_PC, 0xe000);
}
-void vector4_state::kbd_put(u8 data)
+// source of baud frequency is not documented, so we invent a clock
+WRITE_LINE_MEMBER( vector4_state::clock_tick )
{
- m_term_data = data;
+ m_uart1->write_txc(state);
+ m_uart1->write_rxc(state);
+ m_uart2->write_txc(state);
+ m_uart2->write_rxc(state);
+ m_uart3->write_txc(state);
+ m_uart3->write_rxc(state);
}
static MACHINE_CONFIG_START( vector4 )
@@ -95,10 +84,40 @@ static MACHINE_CONFIG_START( vector4 )
MCFG_CPU_PROGRAM_MAP(vector4_mem)
MCFG_CPU_IO_MAP(vector4_io)
-
/* video hardware */
- MCFG_DEVICE_ADD(TERMINAL_TAG, GENERIC_TERMINAL, 0)
- MCFG_GENERIC_TERMINAL_KEYBOARD_CB(PUT(vector4_state, kbd_put))
+ MCFG_DEVICE_ADD("uart_clock", CLOCK, 153600)
+ MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(vector4_state, clock_tick))
+
+ MCFG_DEVICE_ADD("uart1", I8251, 0)
+ MCFG_I8251_TXD_HANDLER(DEVWRITELINE("rs232a", rs232_port_device, write_txd))
+ MCFG_I8251_DTR_HANDLER(DEVWRITELINE("rs232a", rs232_port_device, write_dtr))
+ MCFG_I8251_RTS_HANDLER(DEVWRITELINE("rs232a", rs232_port_device, write_rts))
+
+ MCFG_RS232_PORT_ADD("rs232a", default_rs232_devices, "terminal")
+ MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart1", i8251_device, write_rxd))
+ MCFG_RS232_DSR_HANDLER(DEVWRITELINE("uart1", i8251_device, write_dsr))
+ MCFG_RS232_CTS_HANDLER(DEVWRITELINE("uart1", i8251_device, write_cts))
+ //MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", terminal) // must be exactly here
+
+ MCFG_DEVICE_ADD("uart2", I8251, 0)
+ MCFG_I8251_TXD_HANDLER(DEVWRITELINE("rs232b", rs232_port_device, write_txd))
+ MCFG_I8251_DTR_HANDLER(DEVWRITELINE("rs232b", rs232_port_device, write_dtr))
+ MCFG_I8251_RTS_HANDLER(DEVWRITELINE("rs232b", rs232_port_device, write_rts))
+
+ MCFG_RS232_PORT_ADD("rs232b", default_rs232_devices, nullptr)
+ MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart2", i8251_device, write_rxd))
+ MCFG_RS232_DSR_HANDLER(DEVWRITELINE("uart2", i8251_device, write_dsr))
+ MCFG_RS232_CTS_HANDLER(DEVWRITELINE("uart2", i8251_device, write_cts))
+
+ MCFG_DEVICE_ADD("uart3", I8251, 0)
+ MCFG_I8251_TXD_HANDLER(DEVWRITELINE("rs232c", rs232_port_device, write_txd))
+ MCFG_I8251_DTR_HANDLER(DEVWRITELINE("rs232c", rs232_port_device, write_dtr))
+ MCFG_I8251_RTS_HANDLER(DEVWRITELINE("rs232c", rs232_port_device, write_rts))
+
+ MCFG_RS232_PORT_ADD("rs232c", default_rs232_devices, nullptr)
+ MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart3", i8251_device, write_rxd))
+ MCFG_RS232_DSR_HANDLER(DEVWRITELINE("uart3", i8251_device, write_dsr))
+ MCFG_RS232_CTS_HANDLER(DEVWRITELINE("uart3", i8251_device, write_cts))
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mame/includes/msbc1.h b/src/mame/includes/msbc1.h
deleted file mode 100644
index 75cf55060e6..00000000000
--- a/src/mame/includes/msbc1.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Miodrag Milanovic, Curt Coder
-#pragma once
-
-#ifndef __MSBC1__
-#define __MSBC1__
-
-#define MC68000R12_TAG "u50"
-#define MK68564_0_TAG "u14"
-#define MK68564_1_TAG "u15"
-#define MC68230L10_TAG "u16"
-
-class msbc1_state : public driver_device
-{
-public:
- msbc1_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this,MC68000R12_TAG)
- {
- }
-
- virtual void machine_reset() override;
-
-private:
- required_device<cpu_device> m_maincpu;
-};
-
-#endif