From 8ebb7d29336f182a26640206f51a4e1bf3d9737e Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Wed, 7 May 2014 16:40:09 +0000 Subject: [PATCH] ins8250_device: converted to devcb2 (nw) --- src/emu/bus/isa/com.c | 84 +++++++++++++++++------------------- src/emu/bus/s100/wunderbus.c | 64 +++++++-------------------- src/emu/machine/ins8250.c | 60 +++++++++++--------------- src/emu/machine/ins8250.h | 58 ++++++++++++------------- src/mame/drivers/firebeat.c | 58 +++++++------------------ src/mame/drivers/magtouch.c | 21 ++------- src/mame/drivers/meritm.c | 23 ++-------- src/mame/drivers/pcat_nit.c | 18 +++----- src/mess/drivers/avigo.c | 16 +++---- src/mess/drivers/bebox.c | 8 ++-- src/mess/drivers/h19.c | 14 +----- src/mess/drivers/h89.c | 12 +----- src/mess/drivers/ibmpcjr.c | 15 +++---- src/mess/drivers/pc1512.c | 31 ++++++------- src/mess/drivers/pcw16.c | 32 +++++--------- src/mess/drivers/portfoli.c | 18 +++----- src/mess/drivers/svi318.c | 12 ++++-- src/mess/drivers/zrt80.c | 14 +----- src/mess/includes/bebox.h | 5 --- src/mess/includes/svi318.h | 1 - src/mess/machine/bebox.c | 48 --------------------- src/mess/machine/svi318.c | 20 --------- 22 files changed, 190 insertions(+), 442 deletions(-) diff --git a/src/emu/bus/isa/com.c b/src/emu/bus/isa/com.c index 1b494cc97bf..f2b5a175233 100644 --- a/src/emu/bus/isa/com.c +++ b/src/emu/bus/isa/com.c @@ -11,42 +11,6 @@ #include "bus/rs232/null_modem.h" #include "machine/ins8250.h" -static const ins8250_interface genpc_com_interface[2]= -{ - { - DEVCB_DEVICE_LINE_MEMBER("serport0", rs232_port_device, write_txd), - DEVCB_DEVICE_LINE_MEMBER("serport0", rs232_port_device, write_dtr), - DEVCB_DEVICE_LINE_MEMBER("serport0", rs232_port_device, write_rts), - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa8_com_device, pc_com_interrupt_1), - DEVCB_NULL, - DEVCB_NULL - }, - { - DEVCB_DEVICE_LINE_MEMBER("serport1", rs232_port_device, write_txd), - DEVCB_DEVICE_LINE_MEMBER("serport1", rs232_port_device, write_dtr), - DEVCB_DEVICE_LINE_MEMBER("serport1", rs232_port_device, write_rts), - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa8_com_device, pc_com_interrupt_2), - DEVCB_NULL, - DEVCB_NULL - }/*, - { - DEVCB_DEVICE_LINE_MEMBER("serport2", rs232_port_device, write_txd), - DEVCB_DEVICE_LINE_MEMBER("serport2", rs232_port_device, write_dtr), - DEVCB_DEVICE_LINE_MEMBER("serport2", rs232_port_device, write_rts), - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa8_com_device, pc_com_interrupt_1), - DEVCB_NULL, - DEVCB_NULL - }, - { - DEVCB_DEVICE_LINE_MEMBER("serport3", rs232_port_device, write_txd), - DEVCB_DEVICE_LINE_MEMBER("serport3", rs232_port_device, write_dtr), - DEVCB_DEVICE_LINE_MEMBER("serport3", rs232_port_device, write_rts), - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa8_com_device, pc_com_interrupt_2), - DEVCB_NULL, - DEVCB_NULL - }*/ -}; - static SLOT_INTERFACE_START(isa_com) SLOT_INTERFACE("microsoft_mouse", MSFT_SERIAL_MOUSE) SLOT_INTERFACE("msystems_mouse", MSYSTEM_SERIAL_MOUSE) @@ -55,10 +19,26 @@ static SLOT_INTERFACE_START(isa_com) SLOT_INTERFACE_END static MACHINE_CONFIG_FRAGMENT( com_config ) - MCFG_INS8250_ADD( "uart_0", genpc_com_interface[0], XTAL_1_8432MHz ) - MCFG_INS8250_ADD( "uart_1", genpc_com_interface[1], XTAL_1_8432MHz ) - //MCFG_INS8250_ADD( "uart_2", genpc_com_interface[2], XTAL_1_8432MHz ) - //MCFG_INS8250_ADD( "uart_3", genpc_com_interface[3], XTAL_1_8432MHz ) + MCFG_DEVICE_ADD( "uart_0", INS8250, XTAL_1_8432MHz ) + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("serport0", rs232_port_device, write_txd)) + MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE("serport0", rs232_port_device, write_dtr)) + MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE("serport0", rs232_port_device, write_rts)) + MCFG_INS8250_OUT_INT_CB(WRITELINE(isa8_com_device, pc_com_interrupt_1)) + MCFG_DEVICE_ADD( "uart_1", INS8250, XTAL_1_8432MHz ) + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("serport1", rs232_port_device, write_txd)) + MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE("serport1", rs232_port_device, write_dtr)) + MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE("serport1", rs232_port_device, write_rts)) + MCFG_INS8250_OUT_INT_CB(WRITELINE(isa8_com_device, pc_com_interrupt_2)) + /*MCFG_DEVICE_ADD( "uart_2", INS8250, XTAL_1_8432MHz ) + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("serport2", rs232_port_device, write_txd)) + MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE("serport2", rs232_port_device, write_dtr)) + MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE("serport2", rs232_port_device, write_rts)) + MCFG_INS8250_OUT_INT_CB(WRITELINE(isa8_com_device, pc_com_interrupt_1)) + MCFG_DEVICE_ADD( "uart_3", INS8250, XTAL_1_8432MHz ) + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("serport3", rs232_port_device, write_txd)) + MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE("serport3", rs232_port_device, write_dtr)) + MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE("serport3", rs232_port_device, write_rts)) + MCFG_INS8250_OUT_INT_CB(WRITELINE(isa8_com_device, pc_com_interrupt_2))*/ MCFG_RS232_PORT_ADD( "serport0", isa_com, "microsoft_mouse" ) MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart_0", ins8250_uart_device, rx_w)) @@ -148,10 +128,26 @@ void isa8_com_device::device_reset() } static MACHINE_CONFIG_FRAGMENT( com_at_config ) - MCFG_NS16450_ADD( "uart_0", genpc_com_interface[0], XTAL_1_8432MHz ) /* Verified: IBM P/N 6320947 Serial/Parallel card uses an NS16450N */ - MCFG_NS16450_ADD( "uart_1", genpc_com_interface[1], XTAL_1_8432MHz ) -// MCFG_NS16450_ADD( "uart_2", genpc_com_interface[2], XTAL_1_8432MHz ) -// MCFG_NS16450_ADD( "uart_3", genpc_com_interface[3], XTAL_1_8432MHz ) + MCFG_DEVICE_ADD( "uart_0", NS16450, XTAL_1_8432MHz ) /* Verified: IBM P/N 6320947 Serial/Parallel card uses an NS16450N */ + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("serport0", rs232_port_device, write_txd)) + MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE("serport0", rs232_port_device, write_dtr)) + MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE("serport0", rs232_port_device, write_rts)) + MCFG_INS8250_OUT_INT_CB(WRITELINE(isa8_com_device, pc_com_interrupt_1)) + MCFG_DEVICE_ADD( "uart_1", NS16450, XTAL_1_8432MHz ) + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("serport1", rs232_port_device, write_txd)) + MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE("serport1", rs232_port_device, write_dtr)) + MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE("serport1", rs232_port_device, write_rts)) + MCFG_INS8250_OUT_INT_CB(WRITELINE(isa8_com_device, pc_com_interrupt_2)) + /*MCFG_DEVICE_ADD( "uart_2", NS16450, XTAL_1_8432MHz ) + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("serport2", rs232_port_device, write_txd)) + MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE("serport2", rs232_port_device, write_dtr)) + MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE("serport2", rs232_port_device, write_rts)) + MCFG_INS8250_OUT_INT_CB(WRITELINE(isa8_com_device, pc_com_interrupt_1)) + MCFG_DEVICE_ADD( "uart_3", NS16450, XTAL_1_8432MHz ) + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("serport3", rs232_port_device, write_txd)) + MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE("serport3", rs232_port_device, write_dtr)) + MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE("serport3", rs232_port_device, write_rts)) + MCFG_INS8250_OUT_INT_CB(WRITELINE(isa8_com_device, pc_com_interrupt_2))*/ MCFG_RS232_PORT_ADD( "serport0", isa_com, "microsoft_mouse" ) MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart_0", ins8250_uart_device, rx_w)) MCFG_RS232_DCD_HANDLER(DEVWRITELINE("uart_0", ins8250_uart_device, dcd_w)) diff --git a/src/emu/bus/s100/wunderbus.c b/src/emu/bus/s100/wunderbus.c index fa6c531a74c..19341bc2327 100644 --- a/src/emu/bus/s100/wunderbus.c +++ b/src/emu/bus/s100/wunderbus.c @@ -60,52 +60,6 @@ WRITE_LINE_MEMBER( s100_wunderbus_device::pic_int_w ) m_bus->irq_w(state); } - -//------------------------------------------------- -// ins8250_interface ace1_intf -//------------------------------------------------- - -static ins8250_interface ace1_intf = -{ - DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, rs232_port_device, write_txd), - DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, rs232_port_device, write_dtr), - DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, rs232_port_device, write_rts), - DEVCB_DEVICE_LINE_MEMBER(I8259A_TAG, pic8259_device, ir3_w), - DEVCB_NULL, - DEVCB_NULL -}; - - -//------------------------------------------------- -// ins8250_interface ace2_intf -//------------------------------------------------- - -static ins8250_interface ace2_intf = -{ - DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, rs232_port_device, write_txd), - DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, rs232_port_device, write_dtr), - DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, rs232_port_device, write_rts), - DEVCB_DEVICE_LINE_MEMBER(I8259A_TAG, pic8259_device, ir4_w), - DEVCB_NULL, - DEVCB_NULL -}; - - -//------------------------------------------------- -// ins8250_interface ace3_intf -//------------------------------------------------- - -static ins8250_interface ace3_intf = -{ - DEVCB_DEVICE_LINE_MEMBER(RS232_C_TAG, rs232_port_device, write_txd), - DEVCB_DEVICE_LINE_MEMBER(RS232_C_TAG, rs232_port_device, write_dtr), - DEVCB_DEVICE_LINE_MEMBER(RS232_C_TAG, rs232_port_device, write_rts), - DEVCB_DEVICE_LINE_MEMBER(I8259A_TAG, pic8259_device, ir5_w), - DEVCB_NULL, - DEVCB_NULL -}; - - static DEVICE_INPUT_DEFAULTS_START( terminal ) DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_110 ) DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_110 ) @@ -136,9 +90,21 @@ WRITE_LINE_MEMBER( s100_wunderbus_device::rtc_tp_w ) static MACHINE_CONFIG_FRAGMENT( s100_wunderbus ) MCFG_PIC8259_ADD(I8259A_TAG, DEVWRITELINE(DEVICE_SELF, s100_wunderbus_device, pic_int_w), VCC, NULL) - MCFG_INS8250_ADD(INS8250_1_TAG, ace1_intf, XTAL_18_432MHz/10) - MCFG_INS8250_ADD(INS8250_2_TAG, ace2_intf, XTAL_18_432MHz/10) - MCFG_INS8250_ADD(INS8250_3_TAG, ace3_intf, XTAL_18_432MHz/10) + MCFG_DEVICE_ADD(INS8250_1_TAG, INS8250, XTAL_18_432MHz/10) + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE(RS232_A_TAG, rs232_port_device, write_txd)) + MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE(RS232_A_TAG, rs232_port_device, write_dtr)) + MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE(RS232_A_TAG, rs232_port_device, write_rts)) + MCFG_INS8250_OUT_INT_CB(DEVWRITELINE(I8259A_TAG, pic8259_device, ir3_w)) + MCFG_DEVICE_ADD(INS8250_2_TAG, INS8250, XTAL_18_432MHz/10) + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE(RS232_B_TAG, rs232_port_device, write_txd)) + MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE(RS232_B_TAG, rs232_port_device, write_dtr)) + MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE(RS232_B_TAG, rs232_port_device, write_rts)) + MCFG_INS8250_OUT_INT_CB(DEVWRITELINE(I8259A_TAG, pic8259_device, ir4_w)) + MCFG_DEVICE_ADD(INS8250_3_TAG, INS8250, XTAL_18_432MHz/10) + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE(RS232_C_TAG, rs232_port_device, write_txd)) + MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE(RS232_C_TAG, rs232_port_device, write_dtr)) + MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE(RS232_C_TAG, rs232_port_device, write_rts)) + MCFG_INS8250_OUT_INT_CB(DEVWRITELINE(I8259A_TAG, pic8259_device, ir5_w)) MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE(INS8250_1_TAG, ins8250_uart_device, rx_w)) diff --git a/src/emu/machine/ins8250.c b/src/emu/machine/ins8250.c index 8fd0f848221..630e38764c6 100644 --- a/src/emu/machine/ins8250.c +++ b/src/emu/machine/ins8250.c @@ -91,7 +91,13 @@ const device_type PC16552D = &device_creator; ins8250_uart_device::ins8250_uart_device(const machine_config &mconfig, device_type type, const char* name, const char *tag, device_t *owner, UINT32 clock, const char *shortname) : device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__), - device_serial_interface(mconfig, *this) + device_serial_interface(mconfig, *this), + m_out_tx_cb(*this), + m_out_dtr_cb(*this), + m_out_rts_cb(*this), + m_out_int_cb(*this), + m_out_out1_cb(*this), + m_out_out2_cb(*this) { } @@ -172,7 +178,7 @@ void ins8250_uart_device::update_interrupt() } /* set or clear the int */ - m_out_int_func(state); + m_out_int_cb(state); } /* set pending bit and trigger int */ @@ -298,10 +304,10 @@ WRITE8_MEMBER( ins8250_uart_device::ins8250_w ) } else { - m_out_dtr_func(m_regs.mcr & 1); - m_out_rts_func(m_regs.mcr & 2); - m_out_out1_func(m_regs.mcr & 4); - m_out_out2_func(m_regs.mcr & 8); + m_out_dtr_cb(m_regs.mcr & 1); + m_out_rts_cb(m_regs.mcr & 2); + m_out_out1_cb(m_regs.mcr & 4); + m_out_out2_cb(m_regs.mcr & 8); } } break; @@ -476,7 +482,7 @@ void ins8250_uart_device::tra_complete() void ins8250_uart_device::tra_callback() { - m_out_tx_func(transmit_register_get_data_bit()); + m_out_tx_cb(transmit_register_get_data_bit()); } void ins8250_uart_device::update_msr(int bit, UINT8 state) @@ -511,12 +517,12 @@ WRITE_LINE_MEMBER(ins8250_uart_device::cts_w) void ins8250_uart_device::device_start() { - m_out_tx_func.resolve(m_out_tx_cb, *this); - m_out_dtr_func.resolve(m_out_dtr_cb, *this); - m_out_rts_func.resolve(m_out_rts_cb, *this); - m_out_int_func.resolve(m_out_int_cb, *this); - m_out_out1_func.resolve(m_out_out1_cb, *this); - m_out_out2_func.resolve(m_out_out2_cb, *this); + m_out_tx_cb.resolve_safe(); + m_out_dtr_cb.resolve_safe(); + m_out_rts_cb.resolve_safe(); + m_out_int_cb.resolve_safe(); + m_out_out1_cb.resolve_safe(); + m_out_out2_cb.resolve_safe(); set_tra_rate(0); set_rcv_rate(0); memset(&m_regs, 0x00, sizeof(m_regs)); @@ -533,29 +539,11 @@ void ins8250_uart_device::device_reset() m_int_pending = 0; receive_register_reset(); transmit_register_reset(); - m_out_rts_func(0); - m_out_dtr_func(0); - m_out_out1_func(0); - m_out_out2_func(0); - m_out_tx_func(1); -} - -void ins8250_uart_device::device_config_complete() -{ - const ins8250_interface *intf = reinterpret_cast(static_config()); - if(intf != NULL) - { - *static_cast(this) = *intf; - } - else - { - memset(&m_out_tx_cb, 0, sizeof(m_out_tx_cb)); - memset(&m_out_dtr_cb, 0, sizeof(m_out_dtr_cb)); - memset(&m_out_rts_cb, 0, sizeof(m_out_rts_cb)); - memset(&m_out_int_cb, 0, sizeof(m_out_int_cb)); - memset(&m_out_out1_cb, 0, sizeof(m_out_out1_cb)); - memset(&m_out_out2_cb, 0, sizeof(m_out_out2_cb)); - } + m_out_rts_cb(0); + m_out_dtr_cb(0); + m_out_out1_cb(0); + m_out_out2_cb(0); + m_out_tx_cb(1); } void ins8250_uart_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) diff --git a/src/emu/machine/ins8250.h b/src/emu/machine/ins8250.h index 2afcf489b41..c979d853a4e 100644 --- a/src/emu/machine/ins8250.h +++ b/src/emu/machine/ins8250.h @@ -12,22 +12,20 @@ /*************************************************************************** CLASS DEFINITIONS ***************************************************************************/ -struct ins8250_interface -{ - devcb_write_line m_out_tx_cb; - devcb_write_line m_out_dtr_cb; - devcb_write_line m_out_rts_cb; - devcb_write_line m_out_int_cb; - devcb_write_line m_out_out1_cb; - devcb_write_line m_out_out2_cb; -}; class ins8250_uart_device : public device_t, - public device_serial_interface, - public ins8250_interface + public device_serial_interface { public: ins8250_uart_device(const machine_config &mconfig, device_type type, const char* name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); + + template static devcb2_base &set_out_tx_callback(device_t &device, _Object object) { return downcast(device).m_out_tx_cb.set_callback(object); } + template static devcb2_base &set_out_dtr_callback(device_t &device, _Object object) { return downcast(device).m_out_dtr_cb.set_callback(object); } + template static devcb2_base &set_out_rts_callback(device_t &device, _Object object) { return downcast(device).m_out_rts_cb.set_callback(object); } + template static devcb2_base &set_out_int_callback(device_t &device, _Object object) { return downcast(device).m_out_int_cb.set_callback(object); } + template static devcb2_base &set_out_out1_callback(device_t &device, _Object object) { return downcast(device).m_out_out1_cb.set_callback(object); } + template static devcb2_base &set_out_out2_callback(device_t &device, _Object object) { return downcast(device).m_out_out2_cb.set_callback(object); } + DECLARE_WRITE8_MEMBER( ins8250_w ); DECLARE_READ8_MEMBER( ins8250_r ); DECLARE_WRITE_LINE_MEMBER( dcd_w ); @@ -38,7 +36,6 @@ public: protected: virtual void device_start(); - virtual void device_config_complete(); virtual void device_reset(); virtual void rcv_complete(); virtual void tra_complete(); @@ -76,12 +73,12 @@ protected: private: UINT8 m_int_pending; - devcb_resolved_write_line m_out_tx_func; - devcb_resolved_write_line m_out_dtr_func; - devcb_resolved_write_line m_out_rts_func; - devcb_resolved_write_line m_out_int_func; - devcb_resolved_write_line m_out_out1_func; - devcb_resolved_write_line m_out_out2_func; + devcb2_write_line m_out_tx_cb; + devcb2_write_line m_out_dtr_cb; + devcb2_write_line m_out_rts_cb; + devcb2_write_line m_out_int_cb; + devcb2_write_line m_out_out1_cb; + devcb2_write_line m_out_out2_cb; void update_interrupt(); void update_msr(int bit, UINT8 state); @@ -147,23 +144,22 @@ extern const device_type NS16550; DEVICE CONFIGURATION MACROS ***************************************************************************/ -#define MCFG_INS8250_ADD(_tag, _intrf, _clock) \ - MCFG_DEVICE_ADD(_tag, INS8250, _clock) \ - MCFG_DEVICE_CONFIG(_intrf) +#define MCFG_INS8250_OUT_TX_CB(_devcb) \ + devcb = &ins8250_uart_device::set_out_tx_callback(*device, DEVCB2_##_devcb); +#define MCFG_INS8250_OUT_DTR_CB(_devcb) \ + devcb = &ins8250_uart_device::set_out_dtr_callback(*device, DEVCB2_##_devcb); -#define MCFG_NS16450_ADD(_tag, _intrf, _clock) \ - MCFG_DEVICE_ADD(_tag, NS16450, _clock) \ - MCFG_DEVICE_CONFIG(_intrf) +#define MCFG_INS8250_OUT_RTS_CB(_devcb) \ + devcb = &ins8250_uart_device::set_out_rts_callback(*device, DEVCB2_##_devcb); +#define MCFG_INS8250_OUT_INT_CB(_devcb) \ + devcb = &ins8250_uart_device::set_out_int_callback(*device, DEVCB2_##_devcb); -#define MCFG_NS16550_ADD(_tag, _intrf, _clock) \ - MCFG_DEVICE_ADD(_tag, NS16550, _clock) \ - MCFG_DEVICE_CONFIG(_intrf) +#define MCFG_INS8250_OUT_OUT1_CB(_devcb) \ + devcb = &ins8250_uart_device::set_out_out1_callback(*device, DEVCB2_##_devcb); -#define MCFG_PC16552D_ADD(_tag, _intf0, _intf1, _clock) \ - MCFG_DEVICE_ADD(_tag, PC16552D, 0) \ - MCFG_NS16550_ADD(_tag ":chan0", _intf0, _clock) \ - MCFG_NS16550_ADD(_tag ":chan1", _intf1, _clock) +#define MCFG_INS8250_OUT_OUT2_CB(_devcb) \ + devcb = &ins8250_uart_device::set_out_out2_callback(*device, DEVCB2_##_devcb); #endif diff --git a/src/mame/drivers/firebeat.c b/src/mame/drivers/firebeat.c index c934b11ab4e..f9ff9366cb7 100644 --- a/src/mame/drivers/firebeat.c +++ b/src/mame/drivers/firebeat.c @@ -1095,25 +1095,6 @@ static void comm_uart_irq_callback(running_machine &machine, int channel, int va //m_maincpu->set_input_line(INPUT_LINE_IRQ2, ASSERT_LINE); } */ -static const ins8250_interface firebeat_com0_interface = -{ - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL -}; - -static const ins8250_interface firebeat_com1_interface = -{ - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL -}; /*****************************************************************************/ @@ -1190,25 +1171,6 @@ WRITE_LINE_MEMBER(firebeat_state::midi_uart_ch1_irq_callback) m_maincpu->set_input_line(INPUT_LINE_IRQ1, CLEAR_LINE); } -static const ins8250_interface firebeat_midi0_interface = -{ - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(firebeat_state, midi_uart_ch0_irq_callback), - DEVCB_NULL, - DEVCB_NULL -}; - -static const ins8250_interface firebeat_midi1_interface = -{ - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(firebeat_state, midi_uart_ch1_irq_callback), - DEVCB_NULL, - DEVCB_NULL -}; /* static const int keyboard_notes[24] = { @@ -1778,8 +1740,14 @@ static MACHINE_CONFIG_START( firebeat, firebeat_state ) MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) - MCFG_PC16552D_ADD("duart_com", firebeat_com0_interface, firebeat_com1_interface, XTAL_19_6608MHz) // pgmd to 9600baud - MCFG_PC16552D_ADD("duart_midi", firebeat_midi0_interface, firebeat_midi1_interface, XTAL_24MHz) // in all memory maps, pgmd to 31250baud + MCFG_DEVICE_ADD("duart_com", PC16552D, 0) // pgmd to 9600baud + MCFG_DEVICE_ADD("duart_com:chan0", NS16550, XTAL_19_6608MHz) + MCFG_DEVICE_ADD("duart_com:chan1", NS16550, XTAL_19_6608MHz) + MCFG_DEVICE_ADD("duart_midi", PC16552D, 0) // in all memory maps, pgmd to 31250baud + MCFG_DEVICE_ADD("duart_midi:chan0", NS16550, XTAL_24MHz) + MCFG_INS8250_OUT_INT_CB(WRITELINE(firebeat_state, midi_uart_ch0_irq_callback)) + MCFG_DEVICE_ADD("duart_midi:chan1", NS16550, XTAL_24MHz) + MCFG_INS8250_OUT_INT_CB(WRITELINE(firebeat_state, midi_uart_ch1_irq_callback)) MACHINE_CONFIG_END static MACHINE_CONFIG_START( firebeat2, firebeat_state ) @@ -1834,8 +1802,14 @@ static MACHINE_CONFIG_START( firebeat2, firebeat_state ) MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) - MCFG_PC16552D_ADD("duart_com", firebeat_com0_interface, firebeat_com1_interface, XTAL_19_6608MHz) - MCFG_PC16552D_ADD("duart_midi", firebeat_midi0_interface, firebeat_midi1_interface, XTAL_24MHz) + MCFG_DEVICE_ADD("duart_com", PC16552D, 0) + MCFG_DEVICE_ADD("duart_com:chan0", NS16550, XTAL_19_6608MHz) + MCFG_DEVICE_ADD("duart_com:chan1", NS16550, XTAL_19_6608MHz) + MCFG_DEVICE_ADD("duart_midi", PC16552D, 0) + MCFG_DEVICE_ADD("duart_midi:chan0", NS16550, XTAL_24MHz) + MCFG_INS8250_OUT_INT_CB(WRITELINE(firebeat_state, midi_uart_ch0_irq_callback)) + MCFG_DEVICE_ADD("duart_midi:chan1", NS16550, XTAL_24MHz) + MCFG_INS8250_OUT_INT_CB(WRITELINE(firebeat_state, midi_uart_ch1_irq_callback)) MCFG_MIDI_KBD_ADD("kbd0", DEVWRITELINE("duart_midi:chan0", ins8250_uart_device, rx_w), 31250) MCFG_MIDI_KBD_ADD("kbd1", DEVWRITELINE("duart_midi:chan1", ins8250_uart_device, rx_w), 31250) MACHINE_CONFIG_END diff --git a/src/mame/drivers/magtouch.c b/src/mame/drivers/magtouch.c index 883edd30593..df9fa1135bc 100644 --- a/src/mame/drivers/magtouch.c +++ b/src/mame/drivers/magtouch.c @@ -98,23 +98,6 @@ public: virtual void machine_start(); }; - -/************************************* - * - * Microtouch <-> ins8250 interface - * - *************************************/ - -static const ins8250_interface magtouch_com0_interface = -{ - DEVCB_DEVICE_LINE_MEMBER("microtouch", microtouch_serial_device, rx), - DEVCB_NULL, - DEVCB_NULL, - DEVCB_DEVICE_LINE_MEMBER("pic8259_1", pic8259_device, ir4_w), - DEVCB_NULL, - DEVCB_NULL -}; - /************************************* * * ROM banking @@ -191,7 +174,9 @@ static MACHINE_CONFIG_START( magtouch, magtouch_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ MCFG_FRAGMENT_ADD( pcat_common ) - MCFG_NS16450_ADD( "ns16450_0", magtouch_com0_interface, XTAL_1_8432MHz ) + MCFG_DEVICE_ADD( "ns16450_0", NS16450, XTAL_1_8432MHz ) + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("microtouch", microtouch_serial_device, rx)) + MCFG_INS8250_OUT_INT_CB(DEVWRITELINE("pic8259_1", pic8259_device, ir4_w)) MCFG_MICROTOUCH_SERIAL_ADD( "microtouch", 9600, DEVWRITELINE("ns16450_0", ins8250_uart_device, rx_w) ) // rate? MACHINE_CONFIG_END diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c index 5ff860b1dc2..1883be3a2de 100644 --- a/src/mame/drivers/meritm.c +++ b/src/mame/drivers/meritm.c @@ -253,23 +253,6 @@ public: #define UART_CLK XTAL_1_8432MHz // standard 8250 clock - -/************************************* - * - * Microtouch <-> pc16550 interface - * - *************************************/ - -static const ins8250_interface meritm_ns16550_interface = -{ - DEVCB_DEVICE_LINE_MEMBER("microtouch", microtouch_serial_device, rx), - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL -}; - /************************************* * * Microtouch touch coordinate transformation @@ -1121,7 +1104,8 @@ static MACHINE_CONFIG_DERIVED( meritm_crt250_crt252_crt258, meritm_crt250_questi MCFG_CPU_IO_MAP(meritm_crt250_crt258_io_map) MCFG_MACHINE_START_OVERRIDE(meritm_state,meritm_crt250_crt252_crt258) - MCFG_NS16550_ADD("ns16550", meritm_ns16550_interface, UART_CLK) + MCFG_DEVICE_ADD("ns16550", NS16550, UART_CLK) + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("microtouch", microtouch_serial_device, rx)) MCFG_MICROTOUCH_SERIAL_ADD("microtouch", 9600, DEVWRITELINE("ns16550", ins8250_uart_device, rx_w)) MCFG_MICROTOUCH_TOUCH_CB(meritm_state, meritm_touch_coord_transform) MACHINE_CONFIG_END @@ -1138,7 +1122,8 @@ static MACHINE_CONFIG_DERIVED( meritm_crt260, meritm_crt250 ) MCFG_WATCHDOG_TIME_INIT(attotime::from_msec(1200)) // DS1232, TD connected to VCC MCFG_MACHINE_START_OVERRIDE(meritm_state,meritm_crt260) - MCFG_NS16550_ADD("ns16550", meritm_ns16550_interface, UART_CLK) + MCFG_DEVICE_ADD("ns16550", NS16550, UART_CLK) + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("microtouch", microtouch_serial_device, rx)) MCFG_MICROTOUCH_SERIAL_ADD("microtouch", 9600, DEVWRITELINE("ns16550", ins8250_uart_device, rx_w)) MCFG_MICROTOUCH_TOUCH_CB(meritm_state, meritm_touch_coord_transform) MACHINE_CONFIG_END diff --git a/src/mame/drivers/pcat_nit.c b/src/mame/drivers/pcat_nit.c index be8a428c51a..4999fa6346d 100644 --- a/src/mame/drivers/pcat_nit.c +++ b/src/mame/drivers/pcat_nit.c @@ -109,16 +109,6 @@ public: virtual void machine_start(); }; -static const ins8250_interface pcat_nit_com0_interface = -{ - DEVCB_DEVICE_LINE_MEMBER("microtouch", microtouch_serial_device, rx), - DEVCB_NULL, - DEVCB_NULL, - DEVCB_DEVICE_LINE_MEMBER("pic8259_1", pic8259_device, ir4_w), - DEVCB_NULL, - DEVCB_NULL -}; - /************************************* * * ROM banking @@ -238,7 +228,9 @@ static MACHINE_CONFIG_START( pcat_nit, pcat_nit_state ) MCFG_FRAGMENT_ADD( pcvideo_vga ) MCFG_FRAGMENT_ADD( pcat_common ) - MCFG_NS16450_ADD( "ns16450_0", pcat_nit_com0_interface, XTAL_1_8432MHz ) + MCFG_DEVICE_ADD( "ns16450_0", NS16450, XTAL_1_8432MHz ) + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("microtouch", microtouch_serial_device, rx)) + MCFG_INS8250_OUT_INT_CB(DEVWRITELINE("pic8259_1", pic8259_device, ir4_w)) MCFG_MICROTOUCH_SERIAL_ADD( "microtouch", 9600, DEVWRITELINE("ns16450_0", ins8250_uart_device, rx_w) ) // rate? MCFG_NVRAM_ADD_0FILL("nvram") @@ -255,7 +247,9 @@ static MACHINE_CONFIG_START( bonanza, pcat_nit_state ) MCFG_FRAGMENT_ADD( pcvideo_cirrus_vga ) MCFG_FRAGMENT_ADD( pcat_common ) - MCFG_NS16450_ADD( "ns16450_0", pcat_nit_com0_interface, XTAL_1_8432MHz ) + MCFG_DEVICE_ADD( "ns16450_0", NS16450, XTAL_1_8432MHz ) + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("microtouch", microtouch_serial_device, rx)) + MCFG_INS8250_OUT_INT_CB(DEVWRITELINE("pic8259_1", pic8259_device, ir4_w)) MCFG_MICROTOUCH_SERIAL_ADD( "microtouch", 9600, DEVWRITELINE("ns16450_0", ins8250_uart_device, rx_w) ) // rate? MCFG_NVRAM_ADD_0FILL("nvram") diff --git a/src/mess/drivers/avigo.c b/src/mess/drivers/avigo.c index f178d31aed4..0d207d32651 100644 --- a/src/mess/drivers/avigo.c +++ b/src/mess/drivers/avigo.c @@ -216,16 +216,6 @@ WRITE_LINE_MEMBER( avigo_state::com_interrupt ) refresh_ints(); } -static const ins8250_interface avigo_com_interface = -{ - DEVCB_DEVICE_LINE_MEMBER("serport", rs232_port_device, write_txd), - DEVCB_DEVICE_LINE_MEMBER("serport", rs232_port_device, write_dtr), - DEVCB_DEVICE_LINE_MEMBER("serport", rs232_port_device, write_rts), - DEVCB_DRIVER_LINE_MEMBER(avigo_state, com_interrupt), - DEVCB_NULL, - DEVCB_NULL -}; - void avigo_state::machine_reset() { /* if is a cold start initialize flash contents */ @@ -871,7 +861,11 @@ static MACHINE_CONFIG_START( avigo, avigo_state ) MCFG_CPU_IO_MAP(avigo_io) MCFG_QUANTUM_TIME(attotime::from_hz(60)) - MCFG_NS16550_ADD( "ns16550", avigo_com_interface, XTAL_1_8432MHz ) + MCFG_DEVICE_ADD( "ns16550", NS16550, XTAL_1_8432MHz ) + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("serport", rs232_port_device, write_txd)) + MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE("serport", rs232_port_device, write_dtr)) + MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE("serport", rs232_port_device, write_rts)) + MCFG_INS8250_OUT_INT_CB(WRITELINE(avigo_state, com_interrupt)) MCFG_RS232_PORT_ADD( "serport", default_rs232_devices, NULL ) MCFG_RS232_RXD_HANDLER(DEVWRITELINE("ns16550", ins8250_uart_device, rx_w)) diff --git a/src/mess/drivers/bebox.c b/src/mess/drivers/bebox.c index 1249945ea06..e1894165e47 100644 --- a/src/mess/drivers/bebox.c +++ b/src/mess/drivers/bebox.c @@ -183,10 +183,10 @@ static MACHINE_CONFIG_START( bebox, bebox_state ) MCFG_PIC8259_ADD( "pic8259_2", WRITELINE(bebox_state,bebox_pic8259_slave_set_int_line), GND, NULL ) - MCFG_NS16550_ADD( "ns16550_0", bebox_uart_inteface_0, 0 ) /* TODO: Verify model */ - MCFG_NS16550_ADD( "ns16550_1", bebox_uart_inteface_1, 0 ) /* TODO: Verify model */ - MCFG_NS16550_ADD( "ns16550_2", bebox_uart_inteface_2, 0 ) /* TODO: Verify model */ - MCFG_NS16550_ADD( "ns16550_3", bebox_uart_inteface_3, 0 ) /* TODO: Verify model */ + MCFG_DEVICE_ADD( "ns16550_0", NS16550, 0 ) /* TODO: Verify model */ + MCFG_DEVICE_ADD( "ns16550_1", NS16550, 0 ) /* TODO: Verify model */ + MCFG_DEVICE_ADD( "ns16550_2", NS16550, 0 ) /* TODO: Verify model */ + MCFG_DEVICE_ADD( "ns16550_3", NS16550, 0 ) /* TODO: Verify model */ /* video hardware */ MCFG_FRAGMENT_ADD( pcvideo_cirrus_vga ) diff --git a/src/mess/drivers/h19.c b/src/mess/drivers/h19.c index df5b1815980..dcaeb8239c2 100644 --- a/src/mess/drivers/h19.c +++ b/src/mess/drivers/h19.c @@ -361,17 +361,6 @@ WRITE_LINE_MEMBER(h19_state::h19_ace_irq) m_maincpu->set_input_line(0, (state ? HOLD_LINE : CLEAR_LINE)); } -static const ins8250_interface h19_ace_interface = -{ - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(h19_state, h19_ace_irq), // interrupt - DEVCB_NULL, - DEVCB_NULL -}; - - /* F4 Character Displayer */ static const gfx_layout h19_charlayout = { @@ -419,7 +408,8 @@ static MACHINE_CONFIG_START( h19, h19_state ) MCFG_MC6845_UPDATE_ROW_CB(h19_state, crtc_update_row) MCFG_MC6845_OUT_VSYNC_CB(INPUTLINE("maincpu", INPUT_LINE_NMI)) // frame pulse - MCFG_INS8250_ADD( "ins8250", h19_ace_interface, XTAL_12_288MHz / 4) // 3.072mhz clock which gets divided down for the various baud rates + MCFG_DEVICE_ADD("ins8250", INS8250, XTAL_12_288MHz / 4) // 3.072mhz clock which gets divided down for the various baud rates + MCFG_INS8250_OUT_INT_CB(WRITELINE(h19_state, h19_ace_irq)) // interrupt MCFG_DEVICE_ADD(KEYBOARD_TAG, GENERIC_KEYBOARD, 0) MCFG_GENERIC_KEYBOARD_CB(WRITE8(h19_state, h19_kbd_put)) diff --git a/src/mess/drivers/h89.c b/src/mess/drivers/h89.c index f9768fd18c9..a9eb016f47a 100644 --- a/src/mess/drivers/h89.c +++ b/src/mess/drivers/h89.c @@ -117,15 +117,6 @@ static DEVICE_INPUT_DEFAULTS_START( terminal ) DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) DEVICE_INPUT_DEFAULTS_END -static const ins8250_interface h89_ins8250_interface = -{ - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_txd), - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL -}; static MACHINE_CONFIG_START( h89, h89_state ) /* basic machine hardware */ @@ -133,7 +124,8 @@ static MACHINE_CONFIG_START( h89, h89_state ) MCFG_CPU_PROGRAM_MAP(h89_mem) MCFG_CPU_IO_MAP(h89_io) - MCFG_INS8250_ADD( "ins8250", h89_ins8250_interface, XTAL_1_8432MHz ) + MCFG_DEVICE_ADD( "ins8250", INS8250, XTAL_1_8432MHz ) + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_txd)) MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE("ins8250", ins8250_uart_device, rx_w)) diff --git a/src/mess/drivers/ibmpcjr.c b/src/mess/drivers/ibmpcjr.c index ded9b8b53b0..6e0b7782e35 100644 --- a/src/mess/drivers/ibmpcjr.c +++ b/src/mess/drivers/ibmpcjr.c @@ -547,15 +547,6 @@ static GFXDECODE_START( pcjr ) GFXDECODE_ENTRY( "gfx1", 0x0000, pc_8_charlayout, 3, 1 ) GFXDECODE_END -const ins8250_interface pcjr_com_interface = -{ - DEVCB_DEVICE_LINE_MEMBER("serport", rs232_port_device, write_txd), - DEVCB_DEVICE_LINE_MEMBER("serport", rs232_port_device, write_dtr), - DEVCB_DEVICE_LINE_MEMBER("serport", rs232_port_device, write_rts), - DEVCB_DEVICE_LINE_MEMBER("pic8259", pic8259_device, ir3_w), - DEVCB_NULL, - DEVCB_NULL -}; static ADDRESS_MAP_START(ibmpcjr_map, AS_PROGRAM, 8, pcjr_state) AM_RANGE(0x00000, 0x9ffff) AM_RAMBANK("bank10") @@ -621,7 +612,11 @@ static MACHINE_CONFIG_START( ibmpcjr, pcjr_state) MCFG_I8255_OUT_PORTB_CB(WRITE8(pcjr_state, pcjr_ppi_portb_w)) MCFG_I8255_IN_PORTC_CB(READ8(pcjr_state, pcjr_ppi_portc_r)) - MCFG_INS8250_ADD( "ins8250", pcjr_com_interface, XTAL_1_8432MHz ) + MCFG_DEVICE_ADD( "ins8250", INS8250, XTAL_1_8432MHz ) + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("serport", rs232_port_device, write_txd)) + MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE("serport", rs232_port_device, write_dtr)) + MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE("serport", rs232_port_device, write_rts)) + MCFG_INS8250_OUT_INT_CB(DEVWRITELINE("pic8259", pic8259_device, ir3_w)) MCFG_RS232_PORT_ADD( "serport", pcjr_com, NULL ) MCFG_RS232_RXD_HANDLER(DEVWRITELINE("ins8250", ins8250_uart_device, rx_w)) diff --git a/src/mess/drivers/pc1512.c b/src/mess/drivers/pc1512.c index 3ead5c4c9a9..b2afb83e76b 100644 --- a/src/mess/drivers/pc1512.c +++ b/src/mess/drivers/pc1512.c @@ -1008,22 +1008,6 @@ WRITE_LINE_MEMBER( pc1512_state::fdc_drq_w ) update_fdc_drq(); } - -//------------------------------------------------- -// ins8250_interface uart_intf -//------------------------------------------------- - -static const ins8250_interface uart_intf = -{ - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_txd), - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_dtr), - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_rts), - DEVCB_DEVICE_LINE_MEMBER(I8259A2_TAG, pic8259_device, ir4_w), - DEVCB_NULL, - DEVCB_NULL -}; - - //------------------------------------------------- // centronics_interface centronics_intf //------------------------------------------------- @@ -1268,8 +1252,12 @@ static MACHINE_CONFIG_START( pc1512, pc1512_state ) MCFG_PC_FDC_DRQ_CALLBACK(WRITELINE(pc1512_state, fdc_drq_w)) MCFG_FLOPPY_DRIVE_ADD(PC_FDC_XT_TAG ":0", pc1512_floppies, "525dd", pc1512_state::floppy_formats) MCFG_FLOPPY_DRIVE_ADD(PC_FDC_XT_TAG ":1", pc1512_floppies, NULL, pc1512_state::floppy_formats) - MCFG_INS8250_ADD(INS8250_TAG, uart_intf, XTAL_1_8432MHz) - + MCFG_DEVICE_ADD(INS8250_TAG, INS8250, XTAL_1_8432MHz) + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_txd)) + MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_dtr)) + MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_rts)) + MCFG_INS8250_OUT_INT_CB(DEVWRITELINE(I8259A2_TAG, pic8259_device, ir4_w)) + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(pc1512_state, write_centronics_ack)) MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(pc1512_state, write_centronics_busy)) @@ -1384,7 +1372,12 @@ static MACHINE_CONFIG_START( pc1640, pc1640_state ) MCFG_PC_FDC_DRQ_CALLBACK(WRITELINE(pc1512_state, fdc_drq_w)) MCFG_FLOPPY_DRIVE_ADD(PC_FDC_XT_TAG ":0", pc1512_floppies, "525dd", pc1512_state::floppy_formats) MCFG_FLOPPY_DRIVE_ADD(PC_FDC_XT_TAG ":1", pc1512_floppies, NULL, pc1512_state::floppy_formats) - MCFG_INS8250_ADD(INS8250_TAG, uart_intf, XTAL_1_8432MHz) + MCFG_DEVICE_ADD(INS8250_TAG, INS8250, XTAL_1_8432MHz) + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_txd)) + MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_dtr)) + MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_rts)) + MCFG_INS8250_OUT_INT_CB(DEVWRITELINE(I8259A2_TAG, pic8259_device, ir4_w)) + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(pc1512_state, write_centronics_ack)) diff --git a/src/mess/drivers/pcw16.c b/src/mess/drivers/pcw16.c index f8663206498..ca4dda05c4b 100644 --- a/src/mess/drivers/pcw16.c +++ b/src/mess/drivers/pcw16.c @@ -921,26 +921,6 @@ WRITE_LINE_MEMBER(pcw16_state::pcw16_com_interrupt_2) pcw16_refresh_ints(); } -static const ins8250_interface pcw16_com_interface[2]= -{ - { - DEVCB_DEVICE_LINE_MEMBER("serport1", rs232_port_device, write_txd), - DEVCB_DEVICE_LINE_MEMBER("serport1", rs232_port_device, write_dtr), - DEVCB_DEVICE_LINE_MEMBER("serport1", rs232_port_device, write_rts), - DEVCB_DRIVER_LINE_MEMBER(pcw16_state, pcw16_com_interrupt_1), - DEVCB_NULL, - DEVCB_NULL - }, - { - DEVCB_DEVICE_LINE_MEMBER("serport2", rs232_port_device, write_txd), - DEVCB_DEVICE_LINE_MEMBER("serport2", rs232_port_device, write_dtr), - DEVCB_DEVICE_LINE_MEMBER("serport2", rs232_port_device, write_rts), - DEVCB_DRIVER_LINE_MEMBER(pcw16_state, pcw16_com_interrupt_2), - DEVCB_NULL, - DEVCB_NULL - } -}; - FLOPPY_FORMATS_MEMBER( pcw16_state::floppy_formats ) FLOPPY_PC_FORMAT FLOPPY_FORMATS_END @@ -1032,7 +1012,11 @@ static MACHINE_CONFIG_START( pcw16, pcw16_state ) MCFG_QUANTUM_TIME(attotime::from_hz(60)) - MCFG_NS16550_ADD( "ns16550_1", pcw16_com_interface[0], XTAL_1_8432MHz ) /* TODO: Verify uart model */ + MCFG_DEVICE_ADD( "ns16550_1", NS16550, XTAL_1_8432MHz ) /* TODO: Verify uart model */ + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("serport1", rs232_port_device, write_txd)) + MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE("serport1", rs232_port_device, write_dtr)) + MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE("serport1", rs232_port_device, write_rts)) + MCFG_INS8250_OUT_INT_CB(WRITELINE(pcw16_state, pcw16_com_interrupt_1)) MCFG_RS232_PORT_ADD( "serport1", pcw16_com, "msystems_mouse" ) MCFG_RS232_RXD_HANDLER(DEVWRITELINE("ns16550_1", ins8250_uart_device, rx_w)) MCFG_RS232_DCD_HANDLER(DEVWRITELINE("ns16550_1", ins8250_uart_device, dcd_w)) @@ -1040,7 +1024,11 @@ static MACHINE_CONFIG_START( pcw16, pcw16_state ) MCFG_RS232_RI_HANDLER(DEVWRITELINE("ns16550_1", ins8250_uart_device, ri_w)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE("ns16550_1", ins8250_uart_device, cts_w)) - MCFG_NS16550_ADD( "ns16550_2", pcw16_com_interface[1], XTAL_1_8432MHz ) /* TODO: Verify uart model */ + MCFG_DEVICE_ADD( "ns16550_2", NS16550, XTAL_1_8432MHz ) /* TODO: Verify uart model */ + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE("serport2", rs232_port_device, write_txd)) + MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE("serport2", rs232_port_device, write_dtr)) + MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE("serport2", rs232_port_device, write_rts)) + MCFG_INS8250_OUT_INT_CB(WRITELINE(pcw16_state, pcw16_com_interrupt_2)) MCFG_RS232_PORT_ADD( "serport2", pcw16_com, NULL ) MCFG_RS232_RXD_HANDLER(DEVWRITELINE("ns16550_2", ins8250_uart_device, rx_w)) MCFG_RS232_DCD_HANDLER(DEVWRITELINE("ns16550_2", ins8250_uart_device, dcd_w)) diff --git a/src/mess/drivers/portfoli.c b/src/mess/drivers/portfoli.c index e215dc604a0..2fbd5867e7a 100644 --- a/src/mess/drivers/portfoli.c +++ b/src/mess/drivers/portfoli.c @@ -710,18 +710,6 @@ WRITE_LINE_MEMBER( portfolio_state::i8250_intrpt_w ) trigger_interrupt(INT_EXTERNAL); } -static const ins8250_interface i8250_intf = -{ - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_txd), - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_dtr), - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, write_rts), - DEVCB_DRIVER_LINE_MEMBER(portfolio_state, i8250_intrpt_w), - DEVCB_NULL, - DEVCB_NULL -}; - - - //************************************************************************** // IMAGE LOADING //************************************************************************** @@ -866,7 +854,11 @@ static MACHINE_CONFIG_START( portfolio, portfolio_state ) MCFG_OUTPUT_LATCH_BIT2_HANDLER(DEVWRITELINE(CENTRONICS_TAG, centronics_device, write_init)) MCFG_OUTPUT_LATCH_BIT3_HANDLER(DEVWRITELINE(CENTRONICS_TAG, centronics_device, write_select_in)) - MCFG_INS8250_ADD(M82C50A_TAG, i8250_intf, XTAL_1_8432MHz) // should be MCFG_INS8250A_ADD + MCFG_DEVICE_ADD(M82C50A_TAG, INS8250, XTAL_1_8432MHz) // should be INS8250A + MCFG_INS8250_OUT_TX_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_txd)) + MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_dtr)) + MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_rts)) + MCFG_INS8250_OUT_INT_CB(WRITELINE(portfolio_state, i8250_intrpt_w)) MCFG_TIMER_DRIVER_ADD_PERIODIC("counter", portfolio_state, counter_tick, attotime::from_hz(XTAL_32_768kHz/16384)) MCFG_TIMER_DRIVER_ADD_PERIODIC(TIMER_TICK_TAG, portfolio_state, system_tick, attotime::from_hz(XTAL_32_768kHz/32768)) diff --git a/src/mess/drivers/svi318.c b/src/mess/drivers/svi318.c index 46cd0b3cc7c..799b042cbd6 100644 --- a/src/mess/drivers/svi318.c +++ b/src/mess/drivers/svi318.c @@ -289,8 +289,10 @@ static MACHINE_CONFIG_START( svi318, svi318_state ) MCFG_I8255_IN_PORTB_CB(READ8(svi318_state, svi318_ppi_port_b_r)) MCFG_I8255_OUT_PORTC_CB(WRITE8(svi318_state, svi318_ppi_port_c_w)) - MCFG_INS8250_ADD( "ins8250_0", svi318_ins8250_interface[0], 1000000 ) - MCFG_INS8250_ADD( "ins8250_1", svi318_ins8250_interface[1], 3072000 ) + MCFG_DEVICE_ADD( "ins8250_0", INS8250, 1000000 ) + MCFG_INS8250_OUT_INT_CB(WRITELINE(svi318_state, svi318_ins8250_interrupt)) + MCFG_DEVICE_ADD( "ins8250_1", INS8250, 3072000 ) + MCFG_INS8250_OUT_INT_CB(WRITELINE(svi318_state, svi318_ins8250_interrupt)) /* Video hardware */ MCFG_DEVICE_ADD( "tms9928a", TMS9929A, XTAL_10_738635MHz / 2 ) @@ -401,8 +403,10 @@ static MACHINE_CONFIG_START( svi328_806, svi318_state ) MCFG_I8255_IN_PORTB_CB(READ8(svi318_state, svi318_ppi_port_b_r)) MCFG_I8255_OUT_PORTC_CB(WRITE8(svi318_state, svi318_ppi_port_c_w)) - MCFG_INS8250_ADD( "ins8250_0", svi318_ins8250_interface[0], 1000000 ) - MCFG_INS8250_ADD( "ins8250_1", svi318_ins8250_interface[1], 3072000 ) + MCFG_DEVICE_ADD( "ins8250_0", INS8250, 1000000 ) + MCFG_INS8250_OUT_INT_CB(WRITELINE(svi318_state, svi318_ins8250_interrupt)) + MCFG_DEVICE_ADD( "ins8250_1", INS8250, 3072000 ) + MCFG_INS8250_OUT_INT_CB(WRITELINE(svi318_state, svi318_ins8250_interrupt)) /* Video hardware */ MCFG_DEFAULT_LAYOUT( layout_dualhsxs ) diff --git a/src/mess/drivers/zrt80.c b/src/mess/drivers/zrt80.c index 9692961291d..06bef179caf 100644 --- a/src/mess/drivers/zrt80.c +++ b/src/mess/drivers/zrt80.c @@ -250,17 +250,6 @@ MC6845_UPDATE_ROW( zrt80_state::crtc_update_row ) } } - -static const ins8250_interface zrt80_com_interface = -{ - DEVCB_NULL, - DEVCB_NULL, - DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0), - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL -}; - WRITE8_MEMBER( zrt80_state::kbd_put ) { m_term_data = data; @@ -312,7 +301,8 @@ static MACHINE_CONFIG_START( zrt80, zrt80_state ) MCFG_MC6845_CHAR_WIDTH(8) /*?*/ MCFG_MC6845_UPDATE_ROW_CB(zrt80_state, crtc_update_row) - MCFG_INS8250_ADD( "ins8250", zrt80_com_interface, 2457600 ) + MCFG_DEVICE_ADD( "ins8250", INS8250, 2457600 ) + MCFG_INS8250_OUT_RTS_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) MCFG_DEVICE_ADD(KEYBOARD_TAG, GENERIC_KEYBOARD, 0) MCFG_GENERIC_KEYBOARD_CB(WRITE8(zrt80_state, kbd_put)) MACHINE_CONFIG_END diff --git a/src/mess/includes/bebox.h b/src/mess/includes/bebox.h index d9761573215..d6712e21c52 100644 --- a/src/mess/includes/bebox.h +++ b/src/mess/includes/bebox.h @@ -119,11 +119,6 @@ protected: /*----------- defined in machine/bebox.c -----------*/ -extern const ins8250_interface bebox_uart_inteface_0; -extern const ins8250_interface bebox_uart_inteface_1; -extern const ins8250_interface bebox_uart_inteface_2; -extern const ins8250_interface bebox_uart_inteface_3; - UINT32 scsi53c810_pci_read(device_t *busdevice, device_t *device, int function, int offset, UINT32 mem_mask); void scsi53c810_pci_write(device_t *busdevice, device_t *device, int function, int offset, UINT32 data, UINT32 mem_mask); diff --git a/src/mess/includes/svi318.h b/src/mess/includes/svi318.h index d01643e83c8..636bad3515b 100644 --- a/src/mess/includes/svi318.h +++ b/src/mess/includes/svi318.h @@ -155,7 +155,6 @@ protected: /*----------- defined in machine/svi318.c -----------*/ -extern const ins8250_interface svi318_ins8250_interface[2]; extern const wd17xx_interface svi_wd17xx_interface; #endif /* SVI318_H_ */ diff --git a/src/mess/machine/bebox.c b/src/mess/machine/bebox.c index c273e4e85b5..5bac695715b 100644 --- a/src/mess/machine/bebox.c +++ b/src/mess/machine/bebox.c @@ -333,54 +333,6 @@ void bebox_state::bebox_set_irq_bit(unsigned int interrupt_bit, int val) bebox_update_interrupts(); } - -/************************************* - * - * COM ports - * - *************************************/ - -const ins8250_interface bebox_uart_inteface_0 = -{ - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL -}; - -const ins8250_interface bebox_uart_inteface_1 = -{ - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL -}; - -const ins8250_interface bebox_uart_inteface_2 = -{ - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL -}; - -const ins8250_interface bebox_uart_inteface_3 = -{ - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL -}; - - /************************************* * * Floppy Disk Controller diff --git a/src/mess/machine/svi318.c b/src/mess/machine/svi318.c index 131e9cc7168..c8b6d41cc33 100644 --- a/src/mess/machine/svi318.c +++ b/src/mess/machine/svi318.c @@ -39,26 +39,6 @@ static INS8250_REFRESH_CONNECT( svi318_com_refresh_connected ) ins8250_handshake_in(device, UART8250_HANDSHAKE_IN_CTS|UART8250_HANDSHAKE_IN_DSR|UART8250_INPUTS_RING_INDICATOR|UART8250_INPUTS_DATA_CARRIER_DETECT); } #endif -const ins8250_interface svi318_ins8250_interface[2]= -{ - { - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(svi318_state,svi318_ins8250_interrupt), - DEVCB_NULL, - DEVCB_NULL - }, - { - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(svi318_state,svi318_ins8250_interrupt), - DEVCB_NULL, - DEVCB_NULL - } -}; - /* Cartridge */