mc2661: devcb2. (nw)

This commit is contained in:
Curt Coder 2014-04-01 13:05:06 +00:00
parent 6b11efe669
commit f6758568e7
5 changed files with 160 additions and 269 deletions

View File

@ -71,25 +71,6 @@ static ADDRESS_MAP_START( adam_spi_io, AS_IO, 8, adam_spi_device )
ADDRESS_MAP_END
//-------------------------------------------------
// MC2661_INTERFACE( uart_intf )
//-------------------------------------------------
static MC2661_INTERFACE( uart_intf )
{
0,
0,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL
};
//-------------------------------------------------
// MACHINE_DRIVER( adam_spi )
//-------------------------------------------------
@ -100,7 +81,8 @@ static MACHINE_CONFIG_FRAGMENT( adam_spi )
MCFG_CPU_IO_MAP(adam_spi_io)
MCFG_DEVICE_DISABLE()
MCFG_MC2661_ADD(MC2661_TAG, XTAL_4_9152MHz, uart_intf)
MCFG_DEVICE_ADD(MC2661_TAG, MC2661, XTAL_4_9152MHz)
MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL)
MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image")

View File

@ -97,41 +97,23 @@ enum
// mc2661_device - constructor
//-------------------------------------------------
mc2661_device::mc2661_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, MC2661, "MC2661", tag, owner, clock, "mc2661", __FILE__),
device_serial_interface(mconfig, *this)
mc2661_device::mc2661_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, MC2661, "MC2661", tag, owner, clock, "mc2661", __FILE__),
device_serial_interface(mconfig, *this),
m_write_txd(*this),
m_write_rxrdy(*this),
m_write_txrdy(*this),
m_write_rts(*this),
m_write_dtr(*this),
m_write_txemt_dschg(*this),
m_write_bkdet(*this),
m_write_xsync(*this),
m_rxc(0),
m_txc(0)
{
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void mc2661_device::device_config_complete()
{
// inherit a copy of the static data
const mc2661_interface *intf = reinterpret_cast<const mc2661_interface *>(static_config());
if (intf != NULL)
*static_cast<mc2661_interface *>(this) = *intf;
// or initialize to defaults if none provided
else
{
memset(&m_out_txd_cb, 0, sizeof(m_out_txd_cb));
memset(&m_out_rxrdy_cb, 0, sizeof(m_out_rxrdy_cb));
memset(&m_out_txrdy_cb, 0, sizeof(m_out_txrdy_cb));
memset(&m_out_rts_cb, 0, sizeof(m_out_rts_cb));
memset(&m_out_dtr_cb, 0, sizeof(m_out_dtr_cb));
memset(&m_out_txemt_dschg_cb, 0, sizeof(m_out_txemt_dschg_cb));
memset(&m_out_bkdet_cb, 0, sizeof(m_out_bkdet_cb));
memset(&m_out_xsync_cb, 0, sizeof(m_out_xsync_cb));
}
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@ -139,14 +121,14 @@ void mc2661_device::device_config_complete()
void mc2661_device::device_start()
{
// resolve callbacks
m_out_txd_func.resolve(m_out_txd_cb, *this);
m_out_rxrdy_func.resolve(m_out_rxrdy_cb, *this);
m_out_txrdy_func.resolve(m_out_txrdy_cb, *this);
m_out_rts_func.resolve(m_out_rts_cb, *this);
m_out_dtr_func.resolve(m_out_dtr_cb, *this);
m_out_txemt_dschg_func.resolve(m_out_txemt_dschg_cb, *this);
m_out_bkdet_func.resolve(m_out_bkdet_cb, *this);
m_out_xsync_func.resolve(m_out_xsync_cb, *this);
m_write_txd.resolve_safe();
m_write_rxrdy.resolve_safe();
m_write_txrdy.resolve_safe();
m_write_rts.resolve_safe();
m_write_dtr.resolve_safe();
m_write_txemt_dschg.resolve_safe();
m_write_bkdet.resolve_safe();
m_write_xsync.resolve_safe();
// create the timers
if (m_rxc > 0)
@ -188,14 +170,14 @@ void mc2661_device::device_reset()
m_mode_index = 0;
m_sync_index = 0;
m_out_txd_func(1);
m_out_rxrdy_func(CLEAR_LINE);
m_out_txrdy_func(CLEAR_LINE);
m_out_rts_func(1);
m_out_dtr_func(1);
m_out_txemt_dschg_func(CLEAR_LINE);
m_out_bkdet_func(0);
m_out_xsync_func(0);
m_write_txd(1);
m_write_rxrdy(CLEAR_LINE);
m_write_txrdy(CLEAR_LINE);
m_write_rts(1);
m_write_dtr(1);
m_write_txemt_dschg(CLEAR_LINE);
m_write_bkdet(0);
m_write_xsync(0);
}
@ -205,7 +187,7 @@ void mc2661_device::device_reset()
void mc2661_device::tra_callback()
{
m_out_txd_func(transmit_register_get_data_bit());
m_write_txd(transmit_register_get_data_bit());
}
@ -217,7 +199,7 @@ void mc2661_device::tra_complete()
{
// TODO
m_sr |= STATUS_TXRDY;
m_out_txrdy_func(ASSERT_LINE);
m_write_txrdy(ASSERT_LINE);
}
@ -231,7 +213,7 @@ void mc2661_device::rcv_complete()
receive_register_extract();
m_rhr = get_received_char();
m_sr |= STATUS_RXRDY;
m_out_rxrdy_func(ASSERT_LINE);
m_write_rxrdy(ASSERT_LINE);
}
@ -248,7 +230,7 @@ READ8_MEMBER( mc2661_device::read )
case REGISTER_HOLDING:
data = m_rhr;
m_sr &= ~STATUS_RXRDY;
m_out_rxrdy_func(CLEAR_LINE);
m_write_rxrdy(CLEAR_LINE);
break;
case REGISTER_STATUS:
@ -292,7 +274,7 @@ WRITE8_MEMBER( mc2661_device::write )
if(COMMAND_MODE != 0x02)
transmit_register_setup(m_thr);
m_sr &= ~STATUS_TXRDY;
m_out_txrdy_func(CLEAR_LINE);
m_write_txrdy(CLEAR_LINE);
}
if(COMMAND_MODE == 0x02) // loopback - the Wicat will set this after enabling the transmitter
m_rhr = data;
@ -403,8 +385,8 @@ WRITE8_MEMBER( mc2661_device::write )
m_cr = data & 0xef;
m_out_dtr_func(!COMMAND_DTR);
m_out_rts_func(!COMMAND_RTS);
m_write_dtr(!COMMAND_DTR);
m_write_rts(!COMMAND_RTS);
if (COMMAND_MODE == 0x02) // local loopback
{
@ -413,7 +395,7 @@ WRITE8_MEMBER( mc2661_device::write )
// probably much more to it that this, but this is enough for the Wicat to be happy
m_rhr = m_thr;
m_sr |= STATUS_RXRDY;
m_out_rxrdy_func(ASSERT_LINE);
m_write_rxrdy(ASSERT_LINE);
return;
}
}
@ -421,17 +403,17 @@ WRITE8_MEMBER( mc2661_device::write )
if (COMMAND_TXEN)
{
m_sr |= STATUS_TXRDY;
m_out_txrdy_func(ASSERT_LINE);
m_write_txrdy(ASSERT_LINE);
}
else
{
m_sr &= ~STATUS_TXRDY;
m_out_txrdy_func(CLEAR_LINE);
m_write_txrdy(CLEAR_LINE);
}
if (!COMMAND_RXEN)
{
m_sr &= ~STATUS_RXRDY;
m_out_rxrdy_func(CLEAR_LINE);
m_write_rxrdy(CLEAR_LINE);
}
if (COMMAND_RESET)
{

View File

@ -39,13 +39,35 @@
DEVICE CONFIGURATION MACROS
***************************************************************************/
#define MCFG_MC2661_ADD(_tag, _clock, _config) \
MCFG_DEVICE_ADD(_tag, MC2661, _clock) \
MCFG_DEVICE_CONFIG(_config)
#define MCFG_MC2661_RXC(_clock) \
mc2661_device::static_set_rxc(*device, _clock);
#define MCFG_MC2661_TXC(_clock) \
mc2661_device::static_set_txc(*device, _clock);
#define MC2661_INTERFACE(_name) \
const mc2661_interface (_name) =
#define MCFG_MC2661_TXD_HANDLER(_write) \
devcb = &mc2661_device::set_txd_callback(*device, DEVCB2_##_write);
#define MCFG_MC2661_RXRDY_HANDLER(_write) \
devcb = &mc2661_device::set_rxrdy_callback(*device, DEVCB2_##_write);
#define MCFG_MC2661_TXRDY_HANDLER(_write) \
devcb = &mc2661_device::set_txrdy_callback(*device, DEVCB2_##_write);
#define MCFG_MC2661_RTS_HANDLER(_write) \
devcb = &mc2661_device::set_rts_callback(*device, DEVCB2_##_write);
#define MCFG_MC2661_DTR_HANDLER(_write) \
devcb = &mc2661_device::set_dtr_callback(*device, DEVCB2_##_write);
#define MCFG_MC2661_TXEMT_DSCHG_HANDLER(_write) \
devcb = &mc2661_device::set_txemt_dschg_callback(*device, DEVCB2_##_write);
#define MCFG_MC2661_BKDET_HANDLER(_write) \
devcb = &mc2661_device::set_bkdet_callback(*device, DEVCB2_##_write);
#define MCFG_MC2661_XSYNC_HANDLER(_write) \
devcb = &mc2661_device::set_xsync_callback(*device, DEVCB2_##_write);
@ -53,35 +75,27 @@
TYPE DEFINITIONS
***************************************************************************/
// ======================> mc2661_interface
struct mc2661_interface
{
int m_rxc;
int m_txc;
devcb_write_line m_out_txd_cb;
devcb_write_line m_out_rxrdy_cb;
devcb_write_line m_out_txrdy_cb;
devcb_write_line m_out_rts_cb;
devcb_write_line m_out_dtr_cb;
devcb_write_line m_out_txemt_dschg_cb;
devcb_write_line m_out_bkdet_cb;
devcb_write_line m_out_xsync_cb;
};
// ======================> mc2661_device
class mc2661_device : public device_t,
public device_serial_interface,
public mc2661_interface
public device_serial_interface
{
public:
// construction/destruction
mc2661_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
static void static_set_rxc(device_t &device, int clock) { downcast<mc2661_device &>(device).m_rxc = clock; }
static void static_set_txc(device_t &device, int clock) { downcast<mc2661_device &>(device).m_txc = clock; }
template<class _Object> static devcb2_base &set_txd_callback(device_t &device, _Object object) { return downcast<mc2661_device &>(device).m_write_txd.set_callback(object); }
template<class _Object> static devcb2_base &set_rxrdy_callback(device_t &device, _Object object) { return downcast<mc2661_device &>(device).m_write_rxrdy.set_callback(object); }
template<class _Object> static devcb2_base &set_txrdy_callback(device_t &device, _Object object) { return downcast<mc2661_device &>(device).m_write_txrdy.set_callback(object); }
template<class _Object> static devcb2_base &set_rts_callback(device_t &device, _Object object) { return downcast<mc2661_device &>(device).m_write_rts.set_callback(object); }
template<class _Object> static devcb2_base &set_dtr_callback(device_t &device, _Object object) { return downcast<mc2661_device &>(device).m_write_dtr.set_callback(object); }
template<class _Object> static devcb2_base &set_txemt_dschg_callback(device_t &device, _Object object) { return downcast<mc2661_device &>(device).m_write_txemt_dschg.set_callback(object); }
template<class _Object> static devcb2_base &set_bkdet_callback(device_t &device, _Object object) { return downcast<mc2661_device &>(device).m_write_bkdet.set_callback(object); }
template<class _Object> static devcb2_base &set_xsync_callback(device_t &device, _Object object) { return downcast<mc2661_device &>(device).m_write_xsync.set_callback(object); }
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@ -96,7 +110,6 @@ public:
protected:
// device-level overrides
virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@ -107,16 +120,17 @@ protected:
virtual void rcv_complete();
private:
devcb_resolved_read_line m_in_rxd_func;
devcb_resolved_write_line m_out_txd_func;
devcb2_write_line m_write_txd;
devcb2_write_line m_write_rxrdy;
devcb2_write_line m_write_txrdy;
devcb2_write_line m_write_rts;
devcb2_write_line m_write_dtr;
devcb2_write_line m_write_txemt_dschg;
devcb2_write_line m_write_bkdet;
devcb2_write_line m_write_xsync;
devcb_resolved_write_line m_out_rxrdy_func;
devcb_resolved_write_line m_out_txrdy_func;
devcb_resolved_write_line m_out_rts_func;
devcb_resolved_write_line m_out_dtr_func;
devcb_resolved_write_line m_out_txemt_dschg_func;
devcb_resolved_write_line m_out_bkdet_func;
devcb_resolved_write_line m_out_xsync_func;
int m_rxc;
int m_txc;
UINT8 m_rhr;
UINT8 m_thr;

View File

@ -926,20 +926,6 @@ WRITE_LINE_MEMBER( wangpc_state::epci_irq_w )
check_level1_interrupts();
}
static MC2661_INTERFACE( epci_intf )
{
0,
0,
DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_txd),
DEVCB_DRIVER_LINE_MEMBER(wangpc_state, epci_irq_w),
DEVCB_NULL,
DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_rts),
DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_dtr),
DEVCB_DRIVER_LINE_MEMBER(wangpc_state, epci_irq_w),
DEVCB_NULL,
DEVCB_NULL
};
//-------------------------------------------------
// upd765_interface fdc_intf
@ -1147,7 +1133,14 @@ static MACHINE_CONFIG_START( wangpc, wangpc_state )
MCFG_IM6402_TRO_CALLBACK(DEVWRITELINE(WANGPC_KEYBOARD_TAG, wangpc_keyboard_device, write_rxd))
MCFG_IM6402_DR_CALLBACK(WRITELINE(wangpc_state, uart_dr_w))
MCFG_IM6402_TBRE_CALLBACK(WRITELINE(wangpc_state, uart_tbre_w))
MCFG_MC2661_ADD(SCN2661_TAG, 0, epci_intf)
MCFG_DEVICE_ADD(SCN2661_TAG, MC2661, 0)
MCFG_MC2661_TXD_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_txd))
MCFG_MC2661_RXRDY_HANDLER(WRITELINE(wangpc_state, epci_irq_w))
MCFG_MC2661_RTS_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_rts))
MCFG_MC2661_DTR_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_dtr))
MCFG_MC2661_TXEMT_DSCHG_HANDLER(WRITELINE(wangpc_state, epci_irq_w))
MCFG_UPD765A_ADD(UPD765_TAG, false, false)
MCFG_UPD765_INTRQ_CALLBACK(WRITELINE(wangpc_state, fdc_irq))
MCFG_UPD765_DRQ_CALLBACK(WRITELINE(wangpc_state, fdc_drq))
@ -1218,4 +1211,4 @@ ROM_END
// GAME DRIVERS
//**************************************************************************
COMP( 1985, wangpc, 0, 0, wangpc, wangpc, driver_device, 0, "Wang Laboratories", "Wang Professional Computer", GAME_SUPPORTS_SAVE )
COMP( 1985, wangpc, 0, 0, wangpc, wangpc, driver_device, 0, "Wang Laboratories", "Wang Professional Computer", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )

View File

@ -748,136 +748,6 @@ I8275_DISPLAY_PIXELS(wicat_display_pixels)
}
}
// internal terminal
static mc2661_interface wicat_uart0_intf =
{
0, // RXC
0, // TXC
DEVCB_DEVICE_LINE_MEMBER("videouart0",mc2661_device, rx_w), // TXD out
DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2), // RXRDY out
DEVCB_NULL, // TXRDY out
DEVCB_DEVICE_LINE_MEMBER("videouart0", mc2661_device, cts_w), // RTS out
DEVCB_DEVICE_LINE_MEMBER("videouart0", mc2661_device, dsr_w), // DTR out
DEVCB_NULL, // TXEMT out
DEVCB_NULL, // BKDET out
DEVCB_NULL // XSYNC out
};
// RS232C ports (x5)
static mc2661_interface wicat_uart1_intf =
{
0,
0,
DEVCB_DEVICE_LINE_MEMBER("serial1", rs232_port_device, write_txd),
DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2), // RXRDY out
DEVCB_NULL,
DEVCB_DEVICE_LINE_MEMBER("serial1", rs232_port_device, write_rts),
DEVCB_DEVICE_LINE_MEMBER("serial1", rs232_port_device, write_dtr),
DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2), // TXEMT out
DEVCB_NULL,
DEVCB_NULL
};
static mc2661_interface wicat_uart2_intf =
{
0,
0,
DEVCB_DEVICE_LINE_MEMBER("serial2", rs232_port_device, write_txd),
DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2), // RXRDY out
DEVCB_NULL,
DEVCB_DEVICE_LINE_MEMBER("serial2", rs232_port_device, write_rts),
DEVCB_DEVICE_LINE_MEMBER("serial2", rs232_port_device, write_dtr),
DEVCB_NULL, // TXEMT out
DEVCB_NULL,
DEVCB_NULL
};
static mc2661_interface wicat_uart3_intf =
{
0,
0,
DEVCB_DEVICE_LINE_MEMBER("serial3", rs232_port_device, write_txd),
DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2), // RXRDY out
DEVCB_NULL,
DEVCB_DEVICE_LINE_MEMBER("serial3", rs232_port_device, write_rts),
DEVCB_DEVICE_LINE_MEMBER("serial3", rs232_port_device, write_dtr),
DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2), // TXEMT out
DEVCB_NULL,
DEVCB_NULL
};
static mc2661_interface wicat_uart4_intf =
{
0,
0,
DEVCB_DEVICE_LINE_MEMBER("serial4", rs232_port_device, write_txd),
DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2), // RXRDY out
DEVCB_NULL,
DEVCB_DEVICE_LINE_MEMBER("serial4", rs232_port_device, write_rts),
DEVCB_DEVICE_LINE_MEMBER("serial4", rs232_port_device, write_dtr),
DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2), // TXEMT out
DEVCB_NULL,
DEVCB_NULL
};
static mc2661_interface wicat_uart5_intf =
{
0,
0,
DEVCB_DEVICE_LINE_MEMBER("serial5", rs232_port_device, write_txd),
DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2), // RXRDY out
DEVCB_NULL,
DEVCB_DEVICE_LINE_MEMBER("serial5", rs232_port_device, write_rts),
DEVCB_DEVICE_LINE_MEMBER("serial5", rs232_port_device, write_dtr),
DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2), // TXEMT out
DEVCB_NULL,
DEVCB_NULL
};
// modem
static mc2661_interface wicat_uart6_intf =
{
0, // RXC
0, // TXC
DEVCB_NULL, //DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_txd), // RXD out
DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2), // RXRDY out
DEVCB_NULL, // TXRDY out
DEVCB_NULL, //DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_rts), // RTS out
DEVCB_NULL, //DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_dtr), // DTR out
DEVCB_CPU_INPUT_LINE("maincpu",M68K_IRQ_2), // TXEMT out
DEVCB_NULL, // BKDET out
DEVCB_NULL // XSYNC out
};
// terminal (2x INS2651, 1x IM6042 - one of these is for the keyboard, another communicates with the main board, the third is unknown)
static mc2661_interface wicat_video_uart0_intf =
{
0, // RXC
0, // TXC
DEVCB_DEVICE_LINE_MEMBER("uart0",mc2661_device, rx_w), // RXD out
DEVCB_CPU_INPUT_LINE("videocpu",INPUT_LINE_IRQ0), // RXRDY out
DEVCB_NULL, // TXRDY out
DEVCB_DEVICE_LINE_MEMBER("uart0",mc2661_device, cts_w), // RTS out
DEVCB_DEVICE_LINE_MEMBER("uart0",mc2661_device, dsr_w), // DTR out
DEVCB_NULL, // TXEMT out
DEVCB_NULL, // BKDET out
DEVCB_NULL // XSYNC out
};
static mc2661_interface wicat_video_uart1_intf =
{
19200, // RXC
19200, // TXC
DEVCB_NULL, // RXD out
DEVCB_CPU_INPUT_LINE("videocpu",INPUT_LINE_IRQ0), // RXRDY out
DEVCB_NULL, // TXRDY out
DEVCB_NULL, //DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_rts), // RTS out
DEVCB_NULL, //DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_dtr), // DTR out
DEVCB_NULL, // TXEMT out
DEVCB_NULL, // BKDET out
DEVCB_NULL // XSYNC out
};
static mm58274c_interface wicat_rtc_intf =
{
0, // 12 hour
@ -909,13 +779,52 @@ static MACHINE_CONFIG_START( wicat, wicat_state )
MCFG_MM58274C_ADD("rtc",wicat_rtc_intf) // actually an MM58174AN, but should be compatible
MCFG_MC2661_ADD("uart0", XTAL_5_0688MHz, wicat_uart0_intf) // connected to terminal board
MCFG_MC2661_ADD("uart1", XTAL_5_0688MHz, wicat_uart1_intf)
MCFG_MC2661_ADD("uart2", XTAL_5_0688MHz, wicat_uart2_intf)
MCFG_MC2661_ADD("uart3", XTAL_5_0688MHz, wicat_uart3_intf)
MCFG_MC2661_ADD("uart4", XTAL_5_0688MHz, wicat_uart4_intf)
MCFG_MC2661_ADD("uart5", XTAL_5_0688MHz, wicat_uart5_intf)
MCFG_MC2661_ADD("uart6", XTAL_5_0688MHz, wicat_uart6_intf) // connected to modem port
// internal terminal
MCFG_DEVICE_ADD("uart0", MC2661, XTAL_5_0688MHz) // connected to terminal board
MCFG_MC2661_TXD_HANDLER(DEVWRITELINE("videouart0", mc2661_device, rx_w))
MCFG_MC2661_RXRDY_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
MCFG_MC2661_RTS_HANDLER(DEVWRITELINE("videouart0", mc2661_device, cts_w))
MCFG_MC2661_DTR_HANDLER(DEVWRITELINE("videouart0", mc2661_device, dsr_w))
// RS232C ports (x5)
MCFG_DEVICE_ADD("uart1", MC2661, XTAL_5_0688MHz)
MCFG_MC2661_TXD_HANDLER(DEVWRITELINE("serial1", rs232_port_device, write_txd))
MCFG_MC2661_RXRDY_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
MCFG_MC2661_RTS_HANDLER(DEVWRITELINE("serial1", rs232_port_device, write_rts))
MCFG_MC2661_DTR_HANDLER(DEVWRITELINE("serial1", rs232_port_device, write_dtr))
MCFG_MC2661_TXEMT_DSCHG_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
MCFG_DEVICE_ADD("uart2", MC2661, XTAL_5_0688MHz)
MCFG_MC2661_TXD_HANDLER(DEVWRITELINE("serial2", rs232_port_device, write_txd))
MCFG_MC2661_RXRDY_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
MCFG_MC2661_RTS_HANDLER(DEVWRITELINE("serial2", rs232_port_device, write_rts))
MCFG_MC2661_DTR_HANDLER(DEVWRITELINE("serial2", rs232_port_device, write_dtr))
MCFG_DEVICE_ADD("uart3", MC2661, XTAL_5_0688MHz)
MCFG_MC2661_TXD_HANDLER(DEVWRITELINE("serial3", rs232_port_device, write_txd))
MCFG_MC2661_RXRDY_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
MCFG_MC2661_RTS_HANDLER(DEVWRITELINE("serial3", rs232_port_device, write_rts))
MCFG_MC2661_DTR_HANDLER(DEVWRITELINE("serial3", rs232_port_device, write_dtr))
MCFG_MC2661_TXEMT_DSCHG_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
MCFG_DEVICE_ADD("uart4", MC2661, XTAL_5_0688MHz)
MCFG_MC2661_TXD_HANDLER(DEVWRITELINE("serial4", rs232_port_device, write_txd))
MCFG_MC2661_RXRDY_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
MCFG_MC2661_RTS_HANDLER(DEVWRITELINE("serial4", rs232_port_device, write_rts))
MCFG_MC2661_DTR_HANDLER(DEVWRITELINE("serial4", rs232_port_device, write_dtr))
MCFG_MC2661_TXEMT_DSCHG_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
MCFG_DEVICE_ADD("uart5", MC2661, XTAL_5_0688MHz)
MCFG_MC2661_TXD_HANDLER(DEVWRITELINE("serial5", rs232_port_device, write_txd))
MCFG_MC2661_RXRDY_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
MCFG_MC2661_RTS_HANDLER(DEVWRITELINE("serial5", rs232_port_device, write_rts))
MCFG_MC2661_DTR_HANDLER(DEVWRITELINE("serial5", rs232_port_device, write_dtr))
MCFG_MC2661_TXEMT_DSCHG_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
// modem
MCFG_DEVICE_ADD("uart6", MC2661, XTAL_5_0688MHz) // connected to modem port
MCFG_MC2661_RXRDY_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
MCFG_MC2661_TXEMT_DSCHG_HANDLER(INPUTLINE("maincpu", M68K_IRQ_2))
MCFG_RS232_PORT_ADD("serial1",default_rs232_devices,NULL)
MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart1",mc2661_device,rx_w))
@ -955,8 +864,19 @@ static MACHINE_CONFIG_START( wicat, wicat_state )
MCFG_AM9517A_ADD("videodma", XTAL_8MHz, wicat_videodma_intf) // clock is a bit of guess
MCFG_IM6402_ADD("videouart", 0, 0)
MCFG_IM6402_DR_CALLBACK(WRITELINE(wicat_state, kb_data_ready))
MCFG_MC2661_ADD("videouart0", XTAL_5_0688MHz, wicat_video_uart0_intf) // the INS2651 looks similar enough to the MC2661...
MCFG_MC2661_ADD("videouart1", XTAL_5_0688MHz, wicat_video_uart1_intf)
// terminal (2x INS2651, 1x IM6042 - one of these is for the keyboard, another communicates with the main board, the third is unknown)
MCFG_DEVICE_ADD("videouart0", MC2661, XTAL_5_0688MHz) // the INS2651 looks similar enough to the MC2661...
MCFG_MC2661_TXD_HANDLER(DEVWRITELINE("uart0", mc2661_device, rx_w))
MCFG_MC2661_RXRDY_HANDLER(INPUTLINE("videocpu", INPUT_LINE_IRQ0))
MCFG_MC2661_RTS_HANDLER(DEVWRITELINE("uart0", mc2661_device, cts_w))
MCFG_MC2661_DTR_HANDLER(DEVWRITELINE("uart0", mc2661_device, dsr_w))
MCFG_DEVICE_ADD("videouart1", MC2661, XTAL_5_0688MHz)
MCFG_MC2661_RXC(19200)
MCFG_MC2661_TXC(19200)
MCFG_MC2661_RXRDY_HANDLER(INPUTLINE("videocpu", INPUT_LINE_IRQ0))
MCFG_X2210_ADD("vsram") // XD2210
MCFG_SCREEN_ADD("screen",RASTER)