diff options
author | 2013-12-22 16:27:05 +0000 | |
---|---|---|
committer | 2013-12-22 16:27:05 +0000 | |
commit | 6c3f17c5956faefd2f1dc026468db2da03eee2bc (patch) | |
tree | 275f9cacd98df9821ae9e0e2a2ff4d155a4df358 /src | |
parent | b4c7b67ff9a1b12dd414502864cee66628b3bd19 (diff) |
replaced read rx/cts/dcd callbacks in I8251 with write handlers, which allows multiple chips to be connected together without using glue methods. [smf]
Diffstat (limited to 'src')
49 files changed, 133 insertions, 244 deletions
diff --git a/src/emu/bus/ieee488/softbox.c b/src/emu/bus/ieee488/softbox.c index 7aa002913fb..847ad3cafae 100644 --- a/src/emu/bus/ieee488/softbox.c +++ b/src/emu/bus/ieee488/softbox.c @@ -99,9 +99,7 @@ ADDRESS_MAP_END static const i8251_interface usart_intf = { - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, rx), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, tx), - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dsr_r), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dtr_w), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, rts_w), DEVCB_NULL, @@ -277,6 +275,8 @@ static MACHINE_CONFIG_FRAGMENT( softbox ) MCFG_HARDDISK_ADD("harddisk3") MCFG_HARDDISK_ADD("harddisk4") MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_rx)) + MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_dsr)) MACHINE_CONFIG_END diff --git a/src/emu/machine/i8251.c b/src/emu/machine/i8251.c index b86a08bd035..e53f7e8b477 100644 --- a/src/emu/machine/i8251.c +++ b/src/emu/machine/i8251.c @@ -22,7 +22,7 @@ GLOBAL VARIABLES ***************************************************************************/ -const i8251_interface default_i8251_interface = { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }; +const i8251_interface default_i8251_interface = { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }; /*************************************************************************** @@ -80,9 +80,7 @@ void i8251_device::device_config_complete() // or initialize to defaults if none provided else { - memset(&m_in_rxd_cb, 0, sizeof(m_in_rxd_cb)); memset(&m_out_txd_cb, 0, sizeof(m_out_txd_cb)); - memset(&m_in_dsr_cb, 0, sizeof(m_in_dsr_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_rxrdy_cb, 0, sizeof(m_out_rxrdy_cb)); @@ -99,9 +97,7 @@ void i8251_device::device_config_complete() void i8251_device::device_start() { // resolve callbacks - m_in_rxd_func.resolve(m_in_rxd_cb,*this); m_out_txd_func.resolve(m_out_txd_cb,*this); - m_in_dsr_func.resolve(m_in_dsr_cb,*this); m_out_rxrdy_func.resolve(m_out_rxrdy_cb, *this); m_out_txrdy_func.resolve(m_out_txrdy_cb, *this); m_out_txempty_func.resolve(m_out_txempty_cb, *this); @@ -151,10 +147,7 @@ void i8251_device::receive_clock() { //logerror("I8251\n"); /* get bit received from other side and update receive register */ - if(m_in_rxd_func.isnull()) - receive_register_update_bit(get_in_data_bit()); - else - receive_register_update_bit(m_in_rxd_func()); + receive_register_update_bit(get_in_data_bit()); if (is_receive_register_full()) { @@ -674,7 +667,7 @@ WRITE8_MEMBER(i8251_device::control_w) READ8_MEMBER(i8251_device::status_r) { - UINT8 dsr = !(m_in_dsr_func.isnull() ? 0 : m_in_dsr_func() != 0); + UINT8 dsr = !((m_input_state & DSR) != 0); UINT8 status = (dsr << 7) | m_status; LOG(("status: %02x\n", status)); @@ -747,3 +740,28 @@ void i8251_device::device_timer(emu_timer &timer, device_timer_id id, int param, { device_serial_interface::device_timer(timer, id, param, ptr); } + + +WRITE_LINE_MEMBER(i8251_device::write_rx) +{ + if (state) + { + input_callback(m_input_state | RX); + } + else + { + input_callback(m_input_state & ~RX); + } +} + +WRITE_LINE_MEMBER(i8251_device::write_dsr) +{ + if (state) + { + input_callback(m_input_state | DSR); + } + else + { + input_callback(m_input_state & ~DSR); + } +} diff --git a/src/emu/machine/i8251.h b/src/emu/machine/i8251.h index e9c8006529f..a116be096a0 100644 --- a/src/emu/machine/i8251.h +++ b/src/emu/machine/i8251.h @@ -43,9 +43,7 @@ struct i8251_interface { - devcb_read_line m_in_rxd_cb; devcb_write_line m_out_txd_cb; - devcb_read_line m_in_dsr_cb; devcb_write_line m_out_dtr_cb; devcb_write_line m_out_rts_cb; devcb_write_line m_out_rxrdy_cb; @@ -85,6 +83,9 @@ public: DECLARE_WRITE_LINE_MEMBER( txc_w ) { if (state) transmit_clock(); } DECLARE_WRITE_LINE_MEMBER( rxc_w ) { if (state) receive_clock(); } + DECLARE_WRITE_LINE_MEMBER( write_rx ); + DECLARE_WRITE_LINE_MEMBER( write_dsr ); + void receive_character(UINT8 ch); virtual void input_callback(UINT8 state); @@ -99,9 +100,7 @@ protected: void update_tx_ready(); void update_tx_empty(); private: - devcb_resolved_read_line m_in_rxd_func; devcb_resolved_write_line m_out_txd_func; - devcb_resolved_read_line m_in_dsr_func; devcb_resolved_write_line m_out_dtr_func; devcb_resolved_write_line m_out_rts_func; devcb_resolved_write_line m_out_rxrdy_func; diff --git a/src/mame/drivers/ecoinfr.c b/src/mame/drivers/ecoinfr.c index 876d0a7b96e..38d42c2a386 100644 --- a/src/mame/drivers/ecoinfr.c +++ b/src/mame/drivers/ecoinfr.c @@ -97,9 +97,6 @@ public: DECLARE_CUSTOM_INPUT_MEMBER(ecoinfr_reel2_opto_r); DECLARE_CUSTOM_INPUT_MEMBER(ecoinfr_reel3_opto_r); - DECLARE_READ8_MEMBER(i8251_in_rxd_cb); - - DECLARE_DRIVER_INIT(ecoinfrbr); DECLARE_DRIVER_INIT(ecoinfr); DECLARE_DRIVER_INIT(ecoinfrmab); @@ -775,16 +772,9 @@ MACHINE_START_MEMBER(ecoinfr_state,ecoinfr) } } -READ8_MEMBER(ecoinfr_state::i8251_in_rxd_cb) -{ - return 0x06; -} - static const i8251_interface i8251_intf = { - DEVCB_DRIVER_MEMBER(ecoinfr_state,i8251_in_rxd_cb), // in_rxd_cb DEVCB_NULL, // out_txd_cb - DEVCB_NULL, // in_dsr_cb DEVCB_NULL, // out_dtr_cb DEVCB_NULL, // out_rts_cb DEVCB_NULL, // out_rxrdy_cb diff --git a/src/mess/drivers/alphatro.c b/src/mess/drivers/alphatro.c index 296d87a5458..cfbdfe3ae72 100644 --- a/src/mess/drivers/alphatro.c +++ b/src/mess/drivers/alphatro.c @@ -67,7 +67,6 @@ public: DECLARE_READ8_MEMBER(port10_r); DECLARE_WRITE8_MEMBER(port10_w); DECLARE_INPUT_CHANGED_MEMBER(alphatro_break); - DECLARE_READ_LINE_MEMBER(rxdata_callback); DECLARE_WRITE_LINE_MEMBER(txdata_callback); TIMER_DEVICE_CALLBACK_MEMBER(alphatro_c); TIMER_DEVICE_CALLBACK_MEMBER(alphatro_p); @@ -140,11 +139,6 @@ void alphatro_state::device_timer(emu_timer &timer, device_timer_id id, int para } } -READ_LINE_MEMBER( alphatro_state::rxdata_callback ) -{ - return (bool)m_cass_data[2]; -} - WRITE_LINE_MEMBER( alphatro_state::txdata_callback ) { m_cass_state = state; @@ -379,7 +373,7 @@ void alphatro_state::machine_reset() m_cass_state = 1; m_cass_data[0] = 0; m_cass_data[1] = 0; - m_cass_data[2] = 0; + m_usart->write_rx(0); m_cass_data[3] = 0; m_beep->set_state(0); m_beep->set_frequency(950); /* piezo-device needs to be measured */ @@ -417,14 +411,11 @@ static MC6845_INTERFACE( alphatro_crtc6845_interface ) static const i8251_interface alphatro_usart_interface = { - DEVCB_DRIVER_LINE_MEMBER(alphatro_state,rxdata_callback), //rxd_cb DEVCB_DRIVER_LINE_MEMBER(alphatro_state,txdata_callback), //txd_cb DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, DEVCB_NULL }; @@ -447,7 +438,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(alphatro_state::alphatro_p) if (cass_ws != m_cass_data[0]) { m_cass_data[0] = cass_ws; - m_cass_data[2] = ((m_cass_data[1] < 12) ? 1 : 0); + m_usart->write_rx((m_cass_data[1] < 12) ? 1 : 0); m_cass_data[1] = 0; } } diff --git a/src/mess/drivers/bw2.c b/src/mess/drivers/bw2.c index a10f6d68a94..fa7ea7aa74a 100644 --- a/src/mess/drivers/bw2.c +++ b/src/mess/drivers/bw2.c @@ -550,9 +550,7 @@ static const struct pit8253_interface pit_intf = static const i8251_interface usart_intf = { - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, rx), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, tx), - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dsr_r), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dtr_w), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, rts_w), DEVCB_NULL, @@ -660,7 +658,10 @@ static MACHINE_CONFIG_START( bw2, bw2_state ) MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG":0", bw2_floppies, "35dd", bw2_state::floppy_formats) MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG":1", bw2_floppies, NULL, bw2_state::floppy_formats) MCFG_BW2_EXPANSION_SLOT_ADD(BW2_EXPANSION_SLOT_TAG, XTAL_16MHz, bw2_expansion_cards, NULL) + MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_rx)) + MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_dsr)) // software list MCFG_SOFTWARE_LIST_ADD("flop_list","bw2") diff --git a/src/mess/drivers/cgc7900.c b/src/mess/drivers/cgc7900.c index 3ba608918c3..3460b005e0c 100644 --- a/src/mess/drivers/cgc7900.c +++ b/src/mess/drivers/cgc7900.c @@ -353,8 +353,6 @@ static const i8251_interface rs232_intf = DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, DEVCB_NULL }; @@ -370,8 +368,6 @@ static const i8251_interface rs449_intf = DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, DEVCB_NULL }; diff --git a/src/mess/drivers/compis.c b/src/mess/drivers/compis.c index e10e517b143..869848bdb9c 100644 --- a/src/mess/drivers/compis.c +++ b/src/mess/drivers/compis.c @@ -544,11 +544,9 @@ static const struct pit8253_interface pit_intf = static const i8251_interface usart_intf = { - DEVCB_DEVICE_LINE_MEMBER(COMPIS_KEYBOARD_TAG, compis_keyboard_device, so_r), DEVCB_DEVICE_LINE_MEMBER(COMPIS_KEYBOARD_TAG, compis_keyboard_device, si_w), DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, DEVCB_DEVICE_LINE_MEMBER(I80130_TAG, i80130_device, ir2_w), DEVCB_NULL, //DEVCB_DEVICE_LINE_MEMBER(I80186_TAG, i80186_cpu_device, int1_w), DEVCB_NULL, @@ -781,7 +779,9 @@ static MACHINE_CONFIG_START( compis, compis_state ) MCFG_ISBX_SLOT_MINTR0_CALLBACK(DEVWRITELINE(I80130_TAG, i80130_device, ir6_w)) MCFG_ISBX_SLOT_MINTR1_CALLBACK(DEVWRITELINE(I80130_TAG, i80130_device, ir5_w)) MCFG_ISBX_SLOT_MDRQT_CALLBACK(DEVWRITELINE(I80186_TAG, i80186_cpu_device, drq1_w)) - MCFG_COMPIS_KEYBOARD_ADD(NULL) + + MCFG_DEVICE_ADD(COMPIS_KEYBOARD_TAG, COMPIS_KEYBOARD, 0) + MCFG_COMPIS_KEYBOARD_OUT_TX_HANDLER(DEVWRITELINE(I8251A_TAG, i8251_device, write_rx)) // software lists MCFG_SOFTWARE_LIST_ADD("flop_list", "compis") diff --git a/src/mess/drivers/h8.c b/src/mess/drivers/h8.c index a7226e67df7..84f3f3c6797 100644 --- a/src/mess/drivers/h8.c +++ b/src/mess/drivers/h8.c @@ -71,7 +71,6 @@ public: DECLARE_WRITE8_MEMBER(portf1_w); DECLARE_WRITE8_MEMBER(h8_status_callback); DECLARE_WRITE_LINE_MEMBER(h8_inte_callback); - DECLARE_READ_LINE_MEMBER(rxdata_callback); DECLARE_WRITE_LINE_MEMBER(txdata_callback); TIMER_DEVICE_CALLBACK_MEMBER(h8_irq_pulse); TIMER_DEVICE_CALLBACK_MEMBER(h8_c); @@ -219,7 +218,7 @@ void h8_state::machine_reset() m_cass_state = 1; m_cass_data[0] = 0; m_cass_data[1] = 0; - m_cass_data[2] = 0; + m_uart->write_rx(0); m_cass_data[3] = 0; m_ff_b = 1; } @@ -262,11 +261,6 @@ But, all of this can only occur if bit 5 of port F0 is low. */ output_set_value("run_led", state); } -READ_LINE_MEMBER( h8_state::rxdata_callback ) -{//printf("%X",m_cass_data[2]); - return (bool)m_cass_data[2]; -} - WRITE_LINE_MEMBER( h8_state::txdata_callback ) { m_cass_state = state; @@ -274,14 +268,12 @@ WRITE_LINE_MEMBER( h8_state::txdata_callback ) static const i8251_interface uart_intf = { - DEVCB_DRIVER_LINE_MEMBER(h8_state,rxdata_callback), //rxd_cb DEVCB_DRIVER_LINE_MEMBER(h8_state,txdata_callback), //txd_cb DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, DEVCB_NULL }; @@ -306,7 +298,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(h8_state::h8_p) if (cass_ws != m_cass_data[0]) { m_cass_data[0] = cass_ws; - m_cass_data[2] = (m_cass_data[1] < 12) ? 1 : 0; + m_uart->write_rx((m_cass_data[1] < 12) ? 1 : 0); m_cass_data[1] = 0; } } diff --git a/src/mess/drivers/horizon.c b/src/mess/drivers/horizon.c index 68748d5a8c1..166a97fa092 100644 --- a/src/mess/drivers/horizon.c +++ b/src/mess/drivers/horizon.c @@ -103,9 +103,7 @@ INPUT_PORTS_END static const i8251_interface usart_l_intf = { - DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, serial_port_device, rx), DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, serial_port_device, tx), - DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, rs232_port_device, dsr_r), DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, rs232_port_device, dtr_w), DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, rs232_port_device, rts_w), DEVCB_NULL, @@ -121,9 +119,7 @@ static const i8251_interface usart_l_intf = static const i8251_interface usart_r_intf = { - DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, serial_port_device, rx), DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, serial_port_device, tx), - DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, rs232_port_device, dsr_r), DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, rs232_port_device, dtr_w), DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, rs232_port_device, rts_w), DEVCB_NULL, @@ -192,9 +188,15 @@ static MACHINE_CONFIG_START( horizon, horizon_state ) // devices MCFG_I8251_ADD(I8251_L_TAG, usart_l_intf) MCFG_I8251_ADD(I8251_R_TAG, usart_r_intf) + MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, "serial_terminal") + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(I8251_L_TAG, i8251_device, write_rx)) + MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE(I8251_L_TAG, i8251_device, write_rx)) MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) + MCFG_RS232_PORT_ADD(RS232_B_TAG, default_rs232_devices, NULL) + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(I8251_R_TAG, i8251_device, write_rx)) + MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE(I8251_R_TAG, i8251_device, write_rx)) // S-100 MCFG_S100_BUS_ADD(s100_intf) diff --git a/src/mess/drivers/imsai.c b/src/mess/drivers/imsai.c index 5bb5d49dcf8..c85d8036c5b 100644 --- a/src/mess/drivers/imsai.c +++ b/src/mess/drivers/imsai.c @@ -105,8 +105,6 @@ static const i8251_interface uart_intf = DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, DEVCB_NULL }; diff --git a/src/mess/drivers/isbc.c b/src/mess/drivers/isbc.c index fee9cf11c9d..6d32a8d32a2 100644 --- a/src/mess/drivers/isbc.c +++ b/src/mess/drivers/isbc.c @@ -132,7 +132,7 @@ DEVICE_INPUT_DEFAULTS_END static const serial_terminal_interface terminal_intf = { - DEVCB_NULL + DEVCB_DEVICE_LINE_MEMBER("uart8251", i8251_device, write_rx) }; static const struct pit8253_interface isbc86_pit_config = @@ -245,11 +245,9 @@ static I8274_INTERFACE(isbc_uart8274_interface) static const i8251_interface isbc_uart8251_interface = { - DEVCB_DEVICE_LINE_MEMBER("terminal", serial_terminal_device, tx_r), DEVCB_DEVICE_LINE_MEMBER("terminal", serial_terminal_device, rx_w), DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, DEVCB_DEVICE_LINE_MEMBER("pic_0", pic8259_device, ir6_w), DEVCB_NULL, DEVCB_NULL, diff --git a/src/mess/drivers/jade.c b/src/mess/drivers/jade.c index becc0edb1ca..67fd7f8563e 100644 --- a/src/mess/drivers/jade.c +++ b/src/mess/drivers/jade.c @@ -91,8 +91,6 @@ static const i8251_interface uart_intf = DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, DEVCB_NULL }; diff --git a/src/mess/drivers/kyocera.c b/src/mess/drivers/kyocera.c index 23120578e4f..14e4b774814 100644 --- a/src/mess/drivers/kyocera.c +++ b/src/mess/drivers/kyocera.c @@ -1188,9 +1188,7 @@ static IM6402_INTERFACE( uart_intf ) static const i8251_interface tandy200_uart_intf = { - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, rx), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, tx), - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dsr_r), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dtr_w), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, rts_w), DEVCB_NULL, @@ -1532,7 +1530,11 @@ static MACHINE_CONFIG_START( tandy200, tandy200_state ) MCFG_I8155_ADD(I8155_TAG, XTAL_4_9152MHz/2, tandy200_8155_intf) MCFG_RP5C01_ADD(RP5C01A_TAG, XTAL_32_768kHz, tandy200_rtc_intf) MCFG_I8251_ADD(I8251_TAG, /*XTAL_4_9152MHz/2,*/ tandy200_uart_intf) + MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_rx)) + MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_dsr)) + // MCFG_MC14412_ADD(MC14412_TAG, XTAL_1MHz) MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, standard_centronics) MCFG_CASSETTE_ADD("cassette", kc85_cassette_interface) diff --git a/src/mess/drivers/m20.c b/src/mess/drivers/m20.c index b1a2ef6b76e..8682e32a760 100644 --- a/src/mess/drivers/m20.c +++ b/src/mess/drivers/m20.c @@ -87,7 +87,6 @@ public: DECLARE_WRITE_LINE_MEMBER(tty_clock_tick_w); DECLARE_WRITE_LINE_MEMBER(kbd_clock_tick_w); DECLARE_WRITE_LINE_MEMBER(timer_tick_w); - DECLARE_READ_LINE_MEMBER(kbd_rx); DECLARE_WRITE_LINE_MEMBER(kbd_tx); DECLARE_WRITE8_MEMBER(kbd_put); @@ -148,12 +147,7 @@ UINT32 m20_state::screen_update_m20(screen_device &screen, bitmap_rgb32 &bitmap, return 0; } -// these two i8251 callbacks will ask for/send 1 bit at a time. -READ_LINE_MEMBER(m20_state::kbd_rx) -{ - /* TODO: correct hookup for keyboard, keyboard uses 8048 */ - return 0x00; -} +/* TODO: correct hookup for keyboard, keyboard uses 8048 */ WRITE_LINE_MEMBER(m20_state::kbd_tx) { @@ -869,9 +863,7 @@ void m20_state::fdc_intrq_w(bool state) static const i8251_interface kbd_i8251_intf = { - DEVCB_DRIVER_LINE_MEMBER(m20_state, kbd_rx), DEVCB_DRIVER_LINE_MEMBER(m20_state, kbd_tx), - DEVCB_NULL, // dsr DEVCB_NULL, // dtr DEVCB_NULL, // rts DEVCB_DRIVER_LINE_MEMBER(m20_state, kbd_rxrdy_int), // rx ready @@ -882,9 +874,7 @@ static const i8251_interface kbd_i8251_intf = static const i8251_interface tty_i8251_intf = { - DEVCB_NULL, // rxd in DEVCB_NULL, // txd out - DEVCB_NULL, // dsr DEVCB_NULL, // dtr DEVCB_NULL, // rts DEVCB_NULL, // rx ready diff --git a/src/mess/drivers/nc.c b/src/mess/drivers/nc.c index 3c4f19e6962..66989c80b9f 100644 --- a/src/mess/drivers/nc.c +++ b/src/mess/drivers/nc.c @@ -817,8 +817,6 @@ static const i8251_interface nc100_uart_interface = DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, DEVCB_DRIVER_LINE_MEMBER(nc_state,nc100_rxrdy_callback), DEVCB_DRIVER_LINE_MEMBER(nc_state,nc100_txrdy_callback), DEVCB_NULL, @@ -1164,8 +1162,6 @@ static const i8251_interface nc200_uart_interface= DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, DEVCB_DRIVER_LINE_MEMBER(nc_state,nc200_rxrdy_callback), DEVCB_DRIVER_LINE_MEMBER(nc_state,nc200_txrdy_callback), DEVCB_NULL, diff --git a/src/mess/drivers/pc6001.c b/src/mess/drivers/pc6001.c index 1d9d76ba0a5..abf2a8a201a 100644 --- a/src/mess/drivers/pc6001.c +++ b/src/mess/drivers/pc6001.c @@ -1926,8 +1926,6 @@ static const i8251_interface pc6001_usart_interface= DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, DEVCB_NULL }; diff --git a/src/mess/drivers/pc8001.c b/src/mess/drivers/pc8001.c index 02adc493310..40a2e498b9e 100644 --- a/src/mess/drivers/pc8001.c +++ b/src/mess/drivers/pc8001.c @@ -411,8 +411,6 @@ static const i8251_interface uart_intf = DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, DEVCB_NULL }; diff --git a/src/mess/drivers/pc8401a.c b/src/mess/drivers/pc8401a.c index 0c447ae1295..ba57fe231c9 100644 --- a/src/mess/drivers/pc8401a.c +++ b/src/mess/drivers/pc8401a.c @@ -571,9 +571,7 @@ static I8255A_INTERFACE( ppi_intf ) static const i8251_interface uart_intf = { - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, rx), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, tx), - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dsr_r), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dtr_w), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, rts_w), DEVCB_NULL, @@ -597,7 +595,10 @@ static MACHINE_CONFIG_START( pc8401a, pc8401a_state ) MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, NULL, NULL) MCFG_I8255A_ADD(I8255A_TAG, ppi_intf) MCFG_I8251_ADD(I8251_TAG, uart_intf) + MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_rx)) + MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_dsr)) /* video hardware */ MCFG_FRAGMENT_ADD(pc8401a_video) diff --git a/src/mess/drivers/pc8801.c b/src/mess/drivers/pc8801.c index e77a75f5728..6b7be4196d4 100644 --- a/src/mess/drivers/pc8801.c +++ b/src/mess/drivers/pc8801.c @@ -447,9 +447,7 @@ public: DECLARE_READ8_MEMBER(upd765_tc_r); DECLARE_WRITE8_MEMBER(fdc_irq_vector_w); DECLARE_WRITE8_MEMBER(fdc_drive_mode_w); - DECLARE_READ_LINE_MEMBER(rxdata_callback); DECLARE_WRITE_LINE_MEMBER(txdata_callback); - DECLARE_READ_LINE_MEMBER(dsr_r); DECLARE_WRITE_LINE_MEMBER(rxrdy_w); DECLARE_READ8_MEMBER(pc8801_sound_board_r); DECLARE_WRITE8_MEMBER(pc8801_sound_board_w); @@ -2606,16 +2604,6 @@ static const ay8910_interface single_ay8910_config = }; /* Cassette Configuration */ -READ_LINE_MEMBER( pc8801_state::rxdata_callback ) -{ - return 0; - //return (m_cass->input() > -0.1) ? 1 : 0; -} - -READ_LINE_MEMBER( pc8801_state::dsr_r ) -{ - return 0; // bit 7 status -} WRITE_LINE_MEMBER( pc8801_state::txdata_callback ) { @@ -2629,9 +2617,7 @@ WRITE_LINE_MEMBER( pc8801_state::rxrdy_w ) static const i8251_interface uart_intf = { - DEVCB_DRIVER_LINE_MEMBER(pc8801_state,rxdata_callback), //rxd_cb DEVCB_DRIVER_LINE_MEMBER(pc8801_state,txdata_callback), //txd_cb - DEVCB_DRIVER_LINE_MEMBER(pc8801_state,dsr_r), DEVCB_NULL, DEVCB_DRIVER_LINE_MEMBER(pc8801_state,rxrdy_w), DEVCB_NULL, diff --git a/src/mess/drivers/pc9801.c b/src/mess/drivers/pc9801.c index 2d60eadf162..3feecbad542 100644 --- a/src/mess/drivers/pc9801.c +++ b/src/mess/drivers/pc9801.c @@ -3418,8 +3418,6 @@ static const i8251_interface pc9801_uart_interface = DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, DEVCB_NULL }; diff --git a/src/mess/drivers/px8.c b/src/mess/drivers/px8.c index 50881cef109..4a5e4b15a91 100644 --- a/src/mess/drivers/px8.c +++ b/src/mess/drivers/px8.c @@ -734,8 +734,6 @@ static const i8251_interface i8251_intf = DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, DEVCB_NULL }; diff --git a/src/mess/drivers/rainbow.c b/src/mess/drivers/rainbow.c index c0b87294a32..57ef93b8a3b 100644 --- a/src/mess/drivers/rainbow.c +++ b/src/mess/drivers/rainbow.c @@ -272,9 +272,6 @@ public: DECLARE_READ8_MEMBER(system_parameter_r); - DECLARE_READ_LINE_MEMBER(dsr_r); - - DECLARE_READ_LINE_MEMBER(kbd_rx); DECLARE_WRITE_LINE_MEMBER(kbd_tx); DECLARE_WRITE_LINE_MEMBER(kbd_rxready_w); DECLARE_WRITE_LINE_MEMBER(kbd_txready_w); @@ -510,6 +507,7 @@ static INPUT_PORTS_START( rainbow100b_in ) PORT_DIPNAME( 0x02, 0x02, "W13 (FACTORY TEST A, LEAVE OFF)") PORT_TOGGLE PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_START("W14") PORT_DIPNAME( 0x04, 0x04, "W14 (FACTORY TEST B, LEAVE OFF)") PORT_TOGGLE PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) @@ -523,6 +521,7 @@ static INPUT_PORTS_START( rainbow100b_in ) PORT_DIPNAME( 0x01, 0x00, "W18 (FACTORY TEST D, LEAVE OFF) (8251A: DSR)") PORT_TOGGLE PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x01, DEF_STR( On ) ) + PORT_WRITE_LINE_DEVICE_MEMBER("kbdser", i8251_device, write_dsr) // J17 jumper on FDC controller board shifts drive select (experimental) - PORT_START("FLOPPY CONTROLLER") @@ -1119,11 +1118,6 @@ WRITE8_MEMBER( rainbow_state::diagnostic_w ) } -READ_LINE_MEMBER(rainbow_state::dsr_r) -{ - return m_inp4->read(); // W18 (1/0) -} - // KEYBOARD void rainbow_state::update_kbd_irq() { @@ -1138,12 +1132,6 @@ void rainbow_state::update_kbd_irq() } -READ_LINE_MEMBER(rainbow_state::kbd_rx) -{ -// printf("read keyboard\n"); - return 0x00; -} - WRITE_LINE_MEMBER(rainbow_state::kbd_tx) { // printf("%02x to keyboard\n", state); @@ -1246,9 +1234,7 @@ static const floppy_interface floppy_intf = static const i8251_interface i8251_intf = { - DEVCB_DRIVER_LINE_MEMBER(rainbow_state, kbd_rx), // rxd in DEVCB_DRIVER_LINE_MEMBER(rainbow_state, kbd_tx), // txd out - DEVCB_DRIVER_LINE_MEMBER(rainbow_state, dsr_r), // dsr DEVCB_NULL, // dtr DEVCB_NULL, // rts DEVCB_DRIVER_LINE_MEMBER(rainbow_state, kbd_rxready_w), diff --git a/src/mess/drivers/sage2.c b/src/mess/drivers/sage2.c index 6d97e120073..8998446af8e 100644 --- a/src/mess/drivers/sage2.c +++ b/src/mess/drivers/sage2.c @@ -427,9 +427,7 @@ static const struct pit8253_interface pit1_intf = static const i8251_interface usart0_intf = { - DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, serial_port_device, rx), DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, serial_port_device, tx), - DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, rs232_port_device, dsr_r), DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, rs232_port_device, dtr_w), DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, rs232_port_device, rts_w), DEVCB_CPU_INPUT_LINE(M68000_TAG, M68K_IRQ_5), @@ -445,9 +443,7 @@ static const i8251_interface usart0_intf = static const i8251_interface usart1_intf = { - DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, serial_port_device, rx), DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, serial_port_device, tx), - DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, rs232_port_device, dsr_r), DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, rs232_port_device, dtr_w), DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, rs232_port_device, rts_w), DEVCB_DEVICE_LINE_MEMBER(I8259_TAG, pic8259_device, ir1_w), @@ -555,9 +551,15 @@ static MACHINE_CONFIG_START( sage2, sage2_state ) MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", sage2_floppies, "525qd", floppy_image_device::default_floppy_formats) MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":1", sage2_floppies, "525qd", floppy_image_device::default_floppy_formats) MCFG_IEEE488_BUS_ADD() + MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, "serial_terminal") + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(I8251_0_TAG, i8251_device, write_rx)) + MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE(I8251_0_TAG, i8251_device, write_dsr)) MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) + MCFG_RS232_PORT_ADD(RS232_B_TAG, default_rs232_devices, NULL) + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(I8251_1_TAG, i8251_device, write_rx)) + MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE(I8251_1_TAG, i8251_device, write_dsr)) // internal ram MCFG_RAM_ADD(RAM_TAG) diff --git a/src/mess/drivers/sbrain.c b/src/mess/drivers/sbrain.c index 1117e4f2843..52d0e36148e 100644 --- a/src/mess/drivers/sbrain.c +++ b/src/mess/drivers/sbrain.c @@ -277,8 +277,6 @@ static const i8251_interface u0_intf = DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, DEVCB_NULL }; @@ -290,8 +288,6 @@ static const i8251_interface u1_intf = DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, DEVCB_NULL }; diff --git a/src/mess/drivers/sdk86.c b/src/mess/drivers/sdk86.c index 7b0ebc51ed9..4d5983648da 100644 --- a/src/mess/drivers/sdk86.c +++ b/src/mess/drivers/sdk86.c @@ -138,9 +138,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( sdk86_state::serial_tick ) static const i8251_interface usart_intf = { - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, rx), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, tx), - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dsr_r), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dtr_w), DEVCB_NULL, // connected to CTS DEVCB_NULL, @@ -177,7 +175,11 @@ static MACHINE_CONFIG_START( sdk86, sdk86_state ) /* Devices */ MCFG_I8251_ADD(I8251_TAG, usart_intf) MCFG_I8279_ADD("i8279", 2500000, sdk86_intf) // based on divider + MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, "serial_terminal") + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_rx)) + MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_dsr)) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) MCFG_TIMER_DRIVER_ADD_PERIODIC("serial", sdk86_state, serial_tick, attotime::from_hz(307200)) MACHINE_CONFIG_END diff --git a/src/mess/drivers/sg1000.c b/src/mess/drivers/sg1000.c index feb99678ef0..88c79200aa9 100644 --- a/src/mess/drivers/sg1000.c +++ b/src/mess/drivers/sg1000.c @@ -650,9 +650,7 @@ static I8255_INTERFACE( sf7000_ppi_intf ) static const i8251_interface usart_intf = { - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, rx), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, tx), - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dsr_r), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dtr_w), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, rts_w), DEVCB_NULL, @@ -889,7 +887,10 @@ static MACHINE_CONFIG_START( sf7000, sf7000_state ) MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", sf7000_floppies, "3ssdd", sf7000_state::floppy_formats) MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, standard_centronics) MCFG_CASSETTE_ADD("cassette", sc3000_cassette_interface) + MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(UPD8251_TAG, i8251_device, write_rx)) + MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE(UPD8251_TAG, i8251_device, write_dsr)) /* software lists */ MCFG_SOFTWARE_LIST_ADD("flop_list","sf7000") diff --git a/src/mess/drivers/softbox.c b/src/mess/drivers/softbox.c index e95136970fb..3f41f3aa2f1 100644 --- a/src/mess/drivers/softbox.c +++ b/src/mess/drivers/softbox.c @@ -178,9 +178,7 @@ INPUT_PORTS_END static const i8251_interface usart_intf = { - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, rx), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, tx), - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dsr_r), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dtr_w), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, rts_w), DEVCB_NULL, @@ -418,7 +416,11 @@ static MACHINE_CONFIG_START( softbox, softbox_state ) MCFG_HARDDISK_ADD("harddisk2") MCFG_HARDDISK_ADD("harddisk3") MCFG_HARDDISK_ADD("harddisk4") + MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, "serial_terminal") + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_rx)) + MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_dsr)) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) MCFG_IMI5000H_ADD("corvus1") diff --git a/src/mess/drivers/tandy2k.c b/src/mess/drivers/tandy2k.c index e38347386a8..c992f59bf0a 100644 --- a/src/mess/drivers/tandy2k.c +++ b/src/mess/drivers/tandy2k.c @@ -408,9 +408,7 @@ WRITE_LINE_MEMBER( tandy2k_state::txrdy_w ) static const i8251_interface usart_intf = { - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, rx), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, tx), - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dsr_r), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dtr_w), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, rts_w), DEVCB_DRIVER_LINE_MEMBER(tandy2k_state, rxrdy_w), @@ -699,7 +697,11 @@ static MACHINE_CONFIG_START( tandy2k, tandy2k_state ) MCFG_FLOPPY_DRIVE_ADD(I8272A_TAG ":0", tandy2k_floppies, "525qd", floppy_image_device::default_floppy_formats) MCFG_FLOPPY_DRIVE_ADD(I8272A_TAG ":1", tandy2k_floppies, "525qd", floppy_image_device::default_floppy_formats) MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, standard_centronics) + MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(I8251A_TAG, i8251_device, write_rx)) + MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE(I8251A_TAG, i8251_device, write_dsr)) + MCFG_TANDY2K_KEYBOARD_ADD(WRITELINE(tandy2k_state, kbdclk_w), WRITELINE(tandy2k_state, kbddat_w)) // software lists diff --git a/src/mess/drivers/tsispch.c b/src/mess/drivers/tsispch.c index d4a91bbea14..8539249ac4e 100644 --- a/src/mess/drivers/tsispch.c +++ b/src/mess/drivers/tsispch.c @@ -164,11 +164,10 @@ WRITE_LINE_MEMBER(tsispch_state::i8251_txrdy_int) machine().device<pic8259_device>("pic8259")->ir3_w(state); } +// (todo: proper hookup, currently using hack w/i8251_receive_character()) const i8251_interface i8251_config = { - DEVCB_NULL, // in rxd, serial (todo: proper hookup, currently using hack w/i8251_receive_character()) DEVCB_NULL, // out txd, serial - DEVCB_NULL, // in dsr DEVCB_NULL, // out dtr DEVCB_NULL, // out rts DEVCB_DRIVER_LINE_MEMBER(tsispch_state,i8251_rxrdy_int), // out rxrdy diff --git a/src/mess/drivers/v1050.c b/src/mess/drivers/v1050.c index 7f956c3673b..cdf75777ba0 100644 --- a/src/mess/drivers/v1050.c +++ b/src/mess/drivers/v1050.c @@ -932,11 +932,9 @@ WRITE_LINE_MEMBER( v1050_state::kb_rxrdy_w ) static const i8251_interface kb_8251_intf = { - DEVCB_DEVICE_LINE_MEMBER(V1050_KEYBOARD_TAG, v1050_keyboard_device, so_r), DEVCB_DEVICE_LINE_MEMBER(V1050_KEYBOARD_TAG, v1050_keyboard_device, si_w), DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, DEVCB_DRIVER_LINE_MEMBER(v1050_state, kb_rxrdy_w), DEVCB_NULL, DEVCB_NULL, @@ -967,9 +965,7 @@ WRITE_LINE_MEMBER( v1050_state::sio_txrdy_w ) static const i8251_interface sio_8251_intf = { - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, rx), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, tx), - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dsr_r), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dtr_w), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, rts_w), DEVCB_DRIVER_LINE_MEMBER(v1050_state, sio_rxrdy_w), @@ -1137,7 +1133,10 @@ static MACHINE_CONFIG_START( v1050, v1050_state ) MCFG_FLOPPY_DRIVE_ADD(MB8877_TAG":3", v1050_floppies, NULL, floppy_image_device::default_floppy_formats) MCFG_TIMER_DRIVER_ADD_PERIODIC(TIMER_KB_TAG, v1050_state, kb_8251_tick, attotime::from_hz((double)XTAL_16MHz/4/13/8)) MCFG_TIMER_DRIVER_ADD(TIMER_SIO_TAG, v1050_state, sio_8251_tick) + MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(I8251A_SIO_TAG, i8251_device, write_rx)) + MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE(I8251A_SIO_TAG, i8251_device, write_dsr)) // SASI bus MCFG_SCSIBUS_ADD(SASIBUS_TAG) @@ -1149,7 +1148,8 @@ static MACHINE_CONFIG_START( v1050, v1050_state ) MCFG_TIMER_DRIVER_ADD(TIMER_RST_TAG, v1050_state, sasi_rst_tick) // keyboard - MCFG_V1050_KEYBOARD_ADD() + MCFG_DEVICE_ADD(V1050_KEYBOARD_TAG, V1050_KEYBOARD, 0) + MCFG_V1050_KEYBOARD_OUT_TX_HANDLER(DEVWRITELINE(I8251A_KB_TAG, i8251_device, write_rx)) // software lists MCFG_SOFTWARE_LIST_ADD("flop_list", "v1050_flop") diff --git a/src/mess/drivers/vixen.c b/src/mess/drivers/vixen.c index ec69f98f06f..5e0c34dbcac 100644 --- a/src/mess/drivers/vixen.c +++ b/src/mess/drivers/vixen.c @@ -670,9 +670,7 @@ WRITE_LINE_MEMBER( vixen_state::txrdy_w ) static const i8251_interface usart_intf = { - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, rx), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, tx), - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dsr_r), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dtr_w), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, rts_w), DEVCB_DRIVER_LINE_MEMBER(vixen_state, rxrdy_w), @@ -818,7 +816,10 @@ static MACHINE_CONFIG_START( vixen, vixen_state ) MCFG_IEEE488_BUS_ADD() MCFG_IEEE488_SRQ_CALLBACK(WRITELINE(vixen_state, srq_w)) MCFG_IEEE488_ATN_CALLBACK(WRITELINE(vixen_state, atn_w)) + MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(P8251A_TAG, i8251_device, write_rx)) + MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE(P8251A_TAG, i8251_device, write_dsr)) /* software lists */ MCFG_SOFTWARE_LIST_ADD("disk_list", "vixen") diff --git a/src/mess/drivers/vk100.c b/src/mess/drivers/vk100.c index f26ccb6e6be..4042dd5fb6b 100644 --- a/src/mess/drivers/vk100.c +++ b/src/mess/drivers/vk100.c @@ -1009,9 +1009,7 @@ static MC6845_INTERFACE( mc6845_intf ) static const i8251_interface i8251_intf = { - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, rx), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, tx), - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dsr_r), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dtr_w), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, rts_w), //DEVCB_DRIVER_LINE_MEMBER(vk100_state, i8251_rts), // out_rts_cb @@ -1036,7 +1034,11 @@ static MACHINE_CONFIG_START( vk100, vk100_state ) /* i8251 uart */ MCFG_I8251_ADD("i8251", i8251_intf) + MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE("i8251", i8251_device, write_rx)) + MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE("i8251", i8251_device, write_dsr)) + MCFG_COM8116_ADD(COM5016T_TAG, XTAL_5_0688MHz, NULL, DEVWRITELINE("i8251", i8251_device, rxc_w), DEVWRITELINE("i8251", i8251_device, txc_w)) MCFG_DEFAULT_LAYOUT( layout_vk100 ) diff --git a/src/mess/drivers/votrpss.c b/src/mess/drivers/votrpss.c index 27170b7cede..07d946c2cf1 100644 --- a/src/mess/drivers/votrpss.c +++ b/src/mess/drivers/votrpss.c @@ -193,9 +193,7 @@ IRQ_CALLBACK_MEMBER( votrpss_state::irq_ack ) static const i8251_interface uart_intf = { - //DEVCB_DEVICE_LINE_MEMBER("rs232", serial_port_device, rx), //DEVCB_DEVICE_LINE_MEMBER("rs232", serial_port_device, tx), - //DEVCB_DEVICE_LINE_MEMBER("rs232", rs232_port_device, dsr_r), //DEVCB_DEVICE_LINE_MEMBER("rs232", rs232_port_device, dtr_w), //DEVCB_DEVICE_LINE_MEMBER("rs232", rs232_port_device, rts_w), DEVCB_NULL, @@ -204,8 +202,6 @@ static const i8251_interface uart_intf = DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, DEVCB_NULL }; @@ -342,6 +338,8 @@ static MACHINE_CONFIG_START( votrpss, votrpss_state ) /* Serial components - comment out if not needed */ //MCFG_TIMER_DRIVER_ADD_PERIODIC("serial", votrpss_state, serial_tick, attotime::from_hz(153600)) //MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal") + //MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE("uart", i8251_device, write_rx)) + //MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE("uart", i8251_device, write_dsr)) MACHINE_CONFIG_END diff --git a/src/mess/drivers/vt100.c b/src/mess/drivers/vt100.c index dbe02a2a863..a23a8056d2d 100644 --- a/src/mess/drivers/vt100.c +++ b/src/mess/drivers/vt100.c @@ -407,9 +407,7 @@ GFXDECODE_END static const i8251_interface i8251_intf = { - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, rx), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, tx), - DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dsr_r), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dtr_w), DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, rts_w), DEVCB_NULL, // out_rxrdy_cb @@ -442,10 +440,12 @@ static MACHINE_CONFIG_START( vt100, vt100_state ) MCFG_VT100_VIDEO_ADD("vt100_video", vt100_video_interface) - - /* i8251 uart */ MCFG_I8251_ADD("i8251", i8251_intf) + MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE("i8251", i8251_device, write_rx)) + MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE("i8251", i8251_device, write_dsr)) + MCFG_COM8116_ADD(COM5016T_TAG, XTAL_5_0688MHz, NULL, DEVWRITELINE("i8251", i8251_device, rxc_w), DEVWRITELINE("i8251", i8251_device, txc_w)) diff --git a/src/mess/drivers/xor100.c b/src/mess/drivers/xor100.c index a5f62316206..c7d6aa7c9c2 100644 --- a/src/mess/drivers/xor100.c +++ b/src/mess/drivers/xor100.c @@ -374,9 +374,7 @@ WRITE_LINE_MEMBER( xor100_state::com5016_ft_w ) static const i8251_interface printer_8251_intf = { - DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, serial_port_device, rx), DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, serial_port_device, tx), - DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, rs232_port_device, dsr_r), DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, rs232_port_device, dtr_w), DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, rs232_port_device, rts_w), DEVCB_NULL, @@ -389,9 +387,7 @@ static const i8251_interface printer_8251_intf = static const i8251_interface terminal_8251_intf = { - DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, serial_port_device, rx), DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, serial_port_device, tx), - DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, rs232_port_device, dsr_r), DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, rs232_port_device, dtr_w), DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, rs232_port_device, rts_w), DEVCB_NULL, @@ -579,8 +575,15 @@ static MACHINE_CONFIG_START( xor100, xor100_state ) MCFG_FLOPPY_DRIVE_ADD(WD1795_TAG":2", xor100_floppies, NULL, floppy_image_device::default_floppy_formats) MCFG_FLOPPY_DRIVE_ADD(WD1795_TAG":3", xor100_floppies, NULL, floppy_image_device::default_floppy_formats) MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, xor100_centronics_intf) + MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, NULL) + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(I8251_A_TAG, i8251_device, write_rx)) + MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE(I8251_A_TAG, i8251_device, write_dsr)) + MCFG_RS232_PORT_ADD(RS232_B_TAG, default_rs232_devices, "serial_terminal") + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(I8251_B_TAG, i8251_device, write_rx)) + MCFG_RS232_OUT_DSR_HANDLER(DEVWRITELINE(I8251_B_TAG, i8251_device, write_dsr)) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) // S-100 diff --git a/src/mess/drivers/zorba.c b/src/mess/drivers/zorba.c index 8a6e13e8477..8a1a2a98bd4 100644 --- a/src/mess/drivers/zorba.c +++ b/src/mess/drivers/zorba.c @@ -234,8 +234,6 @@ static const i8251_interface u0_intf = DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, DEVCB_NULL }; @@ -248,8 +246,6 @@ static const i8251_interface u1_intf = DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, DEVCB_NULL }; @@ -262,8 +258,6 @@ static const i8251_interface u2_intf = DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, DEVCB_NULL }; diff --git a/src/mess/includes/compis.h b/src/mess/includes/compis.h index 813bdb40e75..c12c666e230 100644 --- a/src/mess/includes/compis.h +++ b/src/mess/includes/compis.h @@ -46,6 +46,7 @@ #define ISBX_0_TAG "isbx0" #define ISBX_1_TAG "isbx1" #define SCREEN_TAG "screen" +#define COMPIS_KEYBOARD_TAG "compiskb" class compis_state : public driver_device { diff --git a/src/mess/includes/v1050.h b/src/mess/includes/v1050.h index 5a4e2e1dfc5..02aaab281ae 100644 --- a/src/mess/includes/v1050.h +++ b/src/mess/includes/v1050.h @@ -46,6 +46,7 @@ #define TIMER_RST_TAG "timer_rst" #define SASIBUS_TAG "sasi" #define RS232_TAG "rs232" +#define V1050_KEYBOARD_TAG "v1050kb" #define V1050_VIDEORAM_SIZE 0x8000 #define V1050_VIDEORAM_MASK 0x7fff diff --git a/src/mess/machine/compiskb.c b/src/mess/machine/compiskb.c index 19672df68d6..4a7ba9bc97c 100644 --- a/src/mess/machine/compiskb.c +++ b/src/mess/machine/compiskb.c @@ -18,6 +18,7 @@ //************************************************************************** #define I8748_TAG "i8748" +#define SPEAKER_TAG "speaker" @@ -239,7 +240,6 @@ ioport_constructor compis_keyboard_device::device_input_ports() const compis_keyboard_device::compis_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, COMPIS_KEYBOARD, "Compis Keyboard", tag, owner, clock, "compiskb", __FILE__), - m_write_irq(*this), m_maincpu(*this, I8748_TAG), m_speaker(*this, SPEAKER_TAG), m_y1(*this, "Y1"), @@ -252,7 +252,7 @@ compis_keyboard_device::compis_keyboard_device(const machine_config &mconfig, co m_y8(*this, "Y8"), m_y9(*this, "Y9"), m_special(*this, "SPECIAL"), - m_so(1), + m_out_tx_handler(*this), m_bus(0xff), m_keylatch(0) { @@ -266,17 +266,8 @@ compis_keyboard_device::compis_keyboard_device(const machine_config &mconfig, co void compis_keyboard_device::device_start() { // resolve callbacks - m_write_irq.resolve_safe(); -} - - -//------------------------------------------------- -// so_r - serial output read -//------------------------------------------------- - -READ_LINE_MEMBER( compis_keyboard_device::so_r ) -{ - return m_so; + m_out_tx_handler.resolve_safe(); + m_out_tx_handler(1); } @@ -334,7 +325,7 @@ WRITE8_MEMBER( compis_keyboard_device::bus_w ) output_set_led_value(LED_CAPS, BIT(data, 6)); // serial data out - m_so = BIT(data, 7); + m_out_tx_handler(BIT(data, 7)); } diff --git a/src/mess/machine/compiskb.h b/src/mess/machine/compiskb.h index 787065081fa..3b23b2b3c65 100644 --- a/src/mess/machine/compiskb.h +++ b/src/mess/machine/compiskb.h @@ -21,21 +21,12 @@ //************************************************************************** -// MACROS / CONSTANTS -//************************************************************************** - -#define COMPIS_KEYBOARD_TAG "compiskb" -#define SPEAKER_TAG "speaker" - - - -//************************************************************************** // INTERFACE CONFIGURATION MACROS //************************************************************************** -#define MCFG_COMPIS_KEYBOARD_ADD(_irq) \ - MCFG_DEVICE_ADD(COMPIS_KEYBOARD_TAG, COMPIS_KEYBOARD, 0) \ - downcast<compis_keyboard_device *>(device)->set_irq_callback(DEVCB2_##_irq); +#define MCFG_COMPIS_KEYBOARD_OUT_TX_HANDLER(_devcb) \ + devcb = &compis_keyboard_device::set_out_tx_handler(*device, DEVCB2_##_devcb); + @@ -51,14 +42,13 @@ public: // construction/destruction compis_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - template<class _irq> void set_irq_callback(_irq irq) { m_write_irq.set_callback(irq); } + template<class _Object> static devcb2_base &set_out_tx_handler(device_t &device, _Object object) { return downcast<compis_keyboard_device &>(device).m_out_tx_handler.set_callback(object); } // optional information overrides virtual const rom_entry *device_rom_region() const; virtual machine_config_constructor device_mconfig_additions() const; virtual ioport_constructor device_input_ports() const; - DECLARE_READ_LINE_MEMBER( so_r ); DECLARE_WRITE_LINE_MEMBER( si_w ); DECLARE_READ8_MEMBER( bus_r ); @@ -76,8 +66,6 @@ private: LED_CAPS }; - devcb2_write_line m_write_irq; - required_device<cpu_device> m_maincpu; required_device<speaker_sound_device> m_speaker; required_ioport m_y1; @@ -90,8 +78,7 @@ private: required_ioport m_y8; required_ioport m_y9; required_ioport m_special; - - int m_so; + devcb2_write_line m_out_tx_handler; UINT8 m_bus; UINT8 m_keylatch; diff --git a/src/mess/machine/isa_ibm_mfc.c b/src/mess/machine/isa_ibm_mfc.c index 7604b699aa7..6d8b41f001a 100644 --- a/src/mess/machine/isa_ibm_mfc.c +++ b/src/mess/machine/isa_ibm_mfc.c @@ -295,11 +295,6 @@ static const struct pit8253_interface d8253_intf = // uPD71051 USART //------------------------------------------------- -READ_LINE_MEMBER( isa8_ibm_mfc_device::d70151_dsr_r ) -{ - return (m_tcr & TCR_EXT8) ? 1 : 0; -} - void isa8_ibm_mfc_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { m_d71051->transmit_clock(); @@ -310,8 +305,6 @@ static const i8251_interface d71051_intf = { DEVCB_NULL, DEVCB_NULL, - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa8_ibm_mfc_device, d70151_dsr_r), - DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, @@ -426,6 +419,8 @@ WRITE8_MEMBER( isa8_ibm_mfc_device::ibm_mfc_w ) if (~m_tcr & TCR_TBC) set_pc_interrupt(PC_IRQ_TIMERB, 0); + m_d71051->write_dsr((m_tcr & TCR_EXT8) ? 1 : 0); + break; } @@ -526,6 +521,7 @@ void isa8_ibm_mfc_device::device_start() void isa8_ibm_mfc_device::device_reset() { m_tcr = 0; + m_d71051->write_dsr(0); m_pc_irq_state = 0; m_z80_irq_state = 0; } diff --git a/src/mess/machine/isa_ibm_mfc.h b/src/mess/machine/isa_ibm_mfc.h index 11df51f781e..8fa3cce5857 100644 --- a/src/mess/machine/isa_ibm_mfc.h +++ b/src/mess/machine/isa_ibm_mfc.h @@ -49,8 +49,6 @@ public: DECLARE_READ8_MEMBER( ibm_mfc_r ); DECLARE_WRITE8_MEMBER( ibm_mfc_w ); - DECLARE_READ_LINE_MEMBER( d70151_dsr_r ); - DECLARE_WRITE_LINE_MEMBER( d8253_clk0_out ); DECLARE_WRITE_LINE_MEMBER( d8253_clk1_out ); DECLARE_WRITE_LINE_MEMBER( d8253_clk2_out ); diff --git a/src/mess/machine/mbc55x.c b/src/mess/machine/mbc55x.c index 0e18f5c4cc3..26bf6989307 100644 --- a/src/mess/machine/mbc55x.c +++ b/src/mess/machine/mbc55x.c @@ -287,8 +287,6 @@ const i8251_interface mbc55x_i8251a_interface = DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, DEVCB_DEVICE_LINE_MEMBER(PIC8259_TAG, pic8259_device, ir3_w), DEVCB_NULL, DEVCB_NULL, diff --git a/src/mess/machine/pc.c b/src/mess/machine/pc.c index 22b79589bb2..e26f60fd427 100644 --- a/src/mess/machine/pc.c +++ b/src/mess/machine/pc.c @@ -425,8 +425,7 @@ const struct pit8253_interface pcjr_pit8253_config = const i8251_interface mc1502_i8251_interface = { - DEVCB_NULL, /* XXX RxD data are accessible via PPI port C, bit 7 */ - DEVCB_NULL, + /* XXX RxD data are accessible via PPI port C, bit 7 */ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, diff --git a/src/mess/machine/poly88.c b/src/mess/machine/poly88.c index 54aa42cf2a6..441e76be6bb 100644 --- a/src/mess/machine/poly88.c +++ b/src/mess/machine/poly88.c @@ -255,8 +255,6 @@ const i8251_interface poly88_usart_interface= DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, DEVCB_DRIVER_LINE_MEMBER(poly88_state,poly88_usart_rxready), DEVCB_NULL, DEVCB_NULL, diff --git a/src/mess/machine/pp01.c b/src/mess/machine/pp01.c index 5015fa5bc52..78a8911394c 100644 --- a/src/mess/machine/pp01.c +++ b/src/mess/machine/pp01.c @@ -232,9 +232,7 @@ I8255A_INTERFACE( pp01_ppi8255_interface ) // when rts and dtr are both high, the uart is being used for cassette operations const i8251_interface pp01_uart_intf = { - DEVCB_NULL, // in rxd DEVCB_NULL, // out txd - DEVCB_NULL, // in dsr DEVCB_NULL, // out dtr DEVCB_NULL, // out rts DEVCB_NULL, // out rxrdy diff --git a/src/mess/machine/v1050kb.c b/src/mess/machine/v1050kb.c index 6ad974fde71..dbb6a932160 100644 --- a/src/mess/machine/v1050kb.c +++ b/src/mess/machine/v1050kb.c @@ -320,8 +320,8 @@ v1050_keyboard_device::v1050_keyboard_device(const machine_config &mconfig, cons m_y9(*this, "Y9"), m_ya(*this, "YA"), m_yb(*this, "YB"), - m_y(0), - m_so(1) + m_out_tx_handler(*this), + m_y(0) { } @@ -334,7 +334,6 @@ void v1050_keyboard_device::device_start() { // state saving save_item(NAME(m_y)); - save_item(NAME(m_so)); } @@ -344,6 +343,8 @@ void v1050_keyboard_device::device_start() void v1050_keyboard_device::device_reset() { + m_out_tx_handler.resolve_safe(); + m_out_tx_handler(1); } @@ -358,16 +359,6 @@ WRITE_LINE_MEMBER( v1050_keyboard_device::si_w ) //------------------------------------------------- -// so_r - -//------------------------------------------------- - -READ_LINE_MEMBER( v1050_keyboard_device::so_r ) -{ - return m_so; -} - - -//------------------------------------------------- // kb_p1_r - //------------------------------------------------- @@ -433,5 +424,5 @@ WRITE8_MEMBER( v1050_keyboard_device::kb_p2_w ) discrete_sound_w(m_discrete, space, NODE_01, BIT(data, 6)); // serial output - m_so = BIT(data, 7); + m_out_tx_handler(BIT(data, 7)); } diff --git a/src/mess/machine/v1050kb.h b/src/mess/machine/v1050kb.h index 4d0d90e1641..6f9ede79a97 100644 --- a/src/mess/machine/v1050kb.h +++ b/src/mess/machine/v1050kb.h @@ -21,19 +21,11 @@ //************************************************************************** -// MACROS / CONSTANTS -//************************************************************************** - -#define V1050_KEYBOARD_TAG "v1050kb" - - - -//************************************************************************** // INTERFACE CONFIGURATION MACROS //************************************************************************** -#define MCFG_V1050_KEYBOARD_ADD() \ - MCFG_DEVICE_ADD(V1050_KEYBOARD_TAG, V1050_KEYBOARD, 0) +#define MCFG_V1050_KEYBOARD_OUT_TX_HANDLER(_devcb) \ + devcb = &v1050_keyboard_device::set_out_tx_handler(*device, DEVCB2_##_devcb); @@ -49,13 +41,14 @@ public: // construction/destruction v1050_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + template<class _Object> static devcb2_base &set_out_tx_handler(device_t &device, _Object object) { return downcast<v1050_keyboard_device &>(device).m_out_tx_handler.set_callback(object); } + // optional information overrides virtual const rom_entry *device_rom_region() const; virtual machine_config_constructor device_mconfig_additions() const; virtual ioport_constructor device_input_ports() const; DECLARE_WRITE_LINE_MEMBER( si_w ); - DECLARE_READ_LINE_MEMBER( so_r ); // not really public DECLARE_READ8_MEMBER( kb_p1_r ); @@ -82,9 +75,9 @@ private: required_ioport m_y9; required_ioport m_ya; required_ioport m_yb; + devcb2_write_line m_out_tx_handler; UINT8 m_y; - int m_so; }; |