From f522295e74185422b08b6ce9e09e31ceaedc47b0 Mon Sep 17 00:00:00 2001 From: Curt Coder Date: Mon, 20 May 2013 13:51:14 +0000 Subject: [PATCH] (MESS) Added RS-232 ports to several drivers. [Curt Coder] --- src/mess/drivers/pc1512.c | 24 ++++++++++-- src/mess/drivers/portfoli.c | 73 ++++++++++++++++++++++++++++++++++-- src/mess/drivers/sg1000.c | 39 ++++++++++++++++--- src/mess/drivers/tandy2k.c | 24 +++++++++--- src/mess/drivers/v1050.c | 24 +++++++++--- src/mess/drivers/victor9k.c | 53 ++++++++++++++++++++------ src/mess/drivers/vixen.c | 33 ++++++++++++---- src/mess/drivers/wangpc.c | 23 ++++++++++-- src/mess/drivers/xerox820.c | 63 ++++++++++++++++++++++++++----- src/mess/includes/pc1512.h | 3 +- src/mess/includes/portfoli.h | 7 ++-- src/mess/includes/sg1000.h | 2 + src/mess/includes/tandy2k.h | 2 + src/mess/includes/v1050.h | 2 + src/mess/includes/victor9k.h | 4 +- src/mess/includes/vixen.h | 4 ++ src/mess/includes/wangpc.h | 2 + src/mess/includes/xerox820.h | 7 ++++ 18 files changed, 329 insertions(+), 60 deletions(-) diff --git a/src/mess/drivers/pc1512.c b/src/mess/drivers/pc1512.c index 4f64f6241e2..1ef182a0904 100644 --- a/src/mess/drivers/pc1512.c +++ b/src/mess/drivers/pc1512.c @@ -1005,15 +1005,16 @@ WRITE_LINE_MEMBER( pc1512_state::fdc_drq_w ) update_fdc_drq(); } + //------------------------------------------------- // ins8250_interface uart_intf //------------------------------------------------- static const ins8250_interface uart_intf = { - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, + DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, tx), + DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dtr_w), + DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, rts_w), DEVCB_DEVICE_LINE_MEMBER(I8259A2_TAG, pic8259_device, ir4_w), DEVCB_NULL, DEVCB_NULL @@ -1079,6 +1080,21 @@ static SLOT_INTERFACE_START( ibmpc_floppies ) SLOT_INTERFACE_END +//------------------------------------------------- +// rs232_port_interface rs232_intf +//------------------------------------------------- + +static const rs232_port_interface rs232_intf = +{ + DEVCB_DEVICE_LINE_MEMBER(INS8250_TAG, ins8250_uart_device, rx_w), + DEVCB_DEVICE_LINE_MEMBER(INS8250_TAG, ins8250_uart_device, dcd_w), + DEVCB_DEVICE_LINE_MEMBER(INS8250_TAG, ins8250_uart_device, dsr_w), + DEVCB_DEVICE_LINE_MEMBER(INS8250_TAG, ins8250_uart_device, ri_w), + DEVCB_DEVICE_LINE_MEMBER(INS8250_TAG, ins8250_uart_device, cts_w) +}; + + + //************************************************************************** // MACHINE INITIALIZATION //************************************************************************** @@ -1245,6 +1261,7 @@ static MACHINE_CONFIG_START( pc1512, pc1512_state ) MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, centronics_intf) MCFG_FLOPPY_DRIVE_ADD(PC_FDC_XT_TAG ":0", ibmpc_floppies, "525dd", 0, pc1512_state::floppy_formats) MCFG_FLOPPY_DRIVE_ADD(PC_FDC_XT_TAG ":1", ibmpc_floppies, "525dd", 0, pc1512_state::floppy_formats) + MCFG_RS232_PORT_ADD(RS232_TAG, rs232_intf, default_rs232_devices, NULL, NULL) // ISA8 bus MCFG_ISA8_BUS_ADD(ISA_BUS_TAG, ":" I8086_TAG, isabus_intf) @@ -1290,6 +1307,7 @@ static MACHINE_CONFIG_START( pc1640, pc1640_state ) MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, centronics_intf) MCFG_FLOPPY_DRIVE_ADD(PC_FDC_XT_TAG ":0", ibmpc_floppies, "525dd", 0, pc1512_state::floppy_formats) MCFG_FLOPPY_DRIVE_ADD(PC_FDC_XT_TAG ":1", ibmpc_floppies, "525dd", 0, pc1512_state::floppy_formats) + MCFG_RS232_PORT_ADD(RS232_TAG, rs232_intf, default_rs232_devices, NULL, NULL) // ISA8 bus MCFG_ISA8_BUS_ADD(ISA_BUS_TAG, ":" I8086_TAG, isabus_intf) diff --git a/src/mess/drivers/portfoli.c b/src/mess/drivers/portfoli.c index f42e75e263d..07616a5d6c3 100644 --- a/src/mess/drivers/portfoli.c +++ b/src/mess/drivers/portfoli.c @@ -78,6 +78,8 @@ #include "includes/portfoli.h" #include "rendlay.h" + + //************************************************************************** // MACROS / CONSTANTS //************************************************************************** @@ -102,6 +104,8 @@ enum static const UINT8 INTERRUPT_VECTOR[] = { 0x08, 0x09, 0x00 }; + + //************************************************************************** // INTERRUPTS //************************************************************************** @@ -117,6 +121,7 @@ void portfolio_state::check_interrupt() m_maincpu->set_input_line(INPUT_LINE_INT0, level); } + //------------------------------------------------- // trigger_interrupt - trigger interrupt request //------------------------------------------------- @@ -129,6 +134,7 @@ void portfolio_state::trigger_interrupt(int level) check_interrupt(); } + //------------------------------------------------- // irq_status_r - interrupt status read //------------------------------------------------- @@ -138,6 +144,7 @@ READ8_MEMBER( portfolio_state::irq_status_r ) return m_ip; } + //------------------------------------------------- // irq_mask_w - interrupt enable mask //------------------------------------------------- @@ -150,6 +157,7 @@ WRITE8_MEMBER( portfolio_state::irq_mask_w ) check_interrupt(); } + //------------------------------------------------- // sivr_w - serial interrupt vector register //------------------------------------------------- @@ -160,6 +168,7 @@ WRITE8_MEMBER( portfolio_state::sivr_w ) //logerror("SIVR %02x\n", data); } + //------------------------------------------------- // IRQ_CALLBACK_MEMBER( portfolio_int_ack ) //------------------------------------------------- @@ -189,6 +198,8 @@ IRQ_CALLBACK_MEMBER(portfolio_state::portfolio_int_ack) return vector; } + + //************************************************************************** // KEYBOARD //************************************************************************** @@ -242,6 +253,7 @@ void portfolio_state::scan_keyboard() } } + //------------------------------------------------- // TIMER_DEVICE_CALLBACK_MEMBER( keyboard_tick ) //------------------------------------------------- @@ -251,6 +263,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::keyboard_tick) scan_keyboard(); } + //------------------------------------------------- // keyboard_r - keyboard scan code register //------------------------------------------------- @@ -260,6 +273,8 @@ READ8_MEMBER( portfolio_state::keyboard_r ) return m_keylatch; } + + //************************************************************************** // INTERNAL SPEAKER //************************************************************************** @@ -290,6 +305,8 @@ WRITE8_MEMBER( portfolio_state::speaker_w ) //logerror("SPEAKER %02x\n", data); } + + //************************************************************************** // POWER MANAGEMENT //************************************************************************** @@ -318,6 +335,7 @@ WRITE8_MEMBER( portfolio_state::power_w ) //logerror("POWER %02x\n", data); } + //------------------------------------------------- // battery_r - battery status //------------------------------------------------- @@ -350,6 +368,7 @@ READ8_MEMBER( portfolio_state::battery_r ) return data; } + //------------------------------------------------- // unknown_w - ? //------------------------------------------------- @@ -359,6 +378,8 @@ WRITE8_MEMBER( portfolio_state::unknown_w ) //logerror("UNKNOWN %02x\n", data); } + + //************************************************************************** // SYSTEM TIMERS //************************************************************************** @@ -372,6 +393,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::system_tick) trigger_interrupt(INT_TICK); } + //------------------------------------------------- // TIMER_DEVICE_CALLBACK_MEMBER( counter_tick ) //------------------------------------------------- @@ -381,6 +403,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::counter_tick) m_counter++; } + //------------------------------------------------- // counter_r - counter register read //------------------------------------------------- @@ -403,6 +426,7 @@ READ8_MEMBER( portfolio_state::counter_r ) return data; } + //------------------------------------------------- // counter_w - counter register write //------------------------------------------------- @@ -421,6 +445,8 @@ WRITE8_MEMBER( portfolio_state::counter_w ) } } + + //************************************************************************** // EXPANSION //************************************************************************** @@ -448,6 +474,7 @@ WRITE8_MEMBER( portfolio_state::ncc1_w ) //logerror("NCC %02x\n", data); } + //------------------------------------------------- // pid_r - peripheral identification //------------------------------------------------- @@ -473,6 +500,8 @@ READ8_MEMBER( portfolio_state::pid_r ) return m_pid; } + + //************************************************************************** // ADDRESS MAPS //************************************************************************** @@ -489,6 +518,7 @@ static ADDRESS_MAP_START( portfolio_mem, AS_PROGRAM, 8, portfolio_state ) AM_RANGE(0xe0000, 0xfffff) AM_ROM AM_REGION(M80C88A_TAG, 0x20000) ADDRESS_MAP_END + //------------------------------------------------- // ADDRESS_MAP( portfolio_io ) //------------------------------------------------- @@ -509,6 +539,8 @@ static ADDRESS_MAP_START( portfolio_io, AS_IO, 8, portfolio_state ) AM_RANGE(0x807f, 0x807f) AM_READWRITE(pid_r, sivr_w) ADDRESS_MAP_END + + //************************************************************************** // INPUT PORTS //************************************************************************** @@ -630,6 +662,8 @@ static INPUT_PORTS_START( portfolio ) PORT_CONFSETTING( PID_SERIAL, "Serial Interface (HPC-102)" ) INPUT_PORTS_END + + //************************************************************************** // VIDEO //************************************************************************** @@ -644,6 +678,7 @@ void portfolio_state::palette_init() palette_set_color(machine(), 1, MAKE_RGB(92, 83, 88)); } + //------------------------------------------------- // HD61830_INTERFACE( lcdc_intf ) //------------------------------------------------- @@ -662,6 +697,7 @@ static HD61830_INTERFACE( lcdc_intf ) DEVCB_DRIVER_MEMBER(portfolio_state,hd61830_rd_r) }; + //------------------------------------------------- // gfx_layout charlayout //------------------------------------------------- @@ -677,6 +713,7 @@ static const gfx_layout charlayout = 8*8 }; + //------------------------------------------------- // GFXDECODE( portfolio ) //------------------------------------------------- @@ -685,6 +722,8 @@ static GFXDECODE_START( portfolio ) GFXDECODE_ENTRY( HD61830_TAG, 0, charlayout, 0, 2 ) GFXDECODE_END + + //************************************************************************** // DEVICE CONFIGURATION //************************************************************************** @@ -703,6 +742,7 @@ static I8255_INTERFACE( ppi_intf ) DEVCB_NULL // Port C write }; + //------------------------------------------------- // ins8250_interface i8250_intf //------------------------------------------------- @@ -714,14 +754,15 @@ WRITE_LINE_MEMBER( portfolio_state::i8250_intrpt_w ) static const ins8250_interface i8250_intf = { - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, + DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, tx), + 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(portfolio_state, i8250_intrpt_w), DEVCB_NULL, DEVCB_NULL }; + //------------------------------------------------- // centronics_interface centronics_intf //------------------------------------------------- @@ -733,6 +774,22 @@ static const centronics_interface centronics_intf = DEVCB_NULL, }; + +//------------------------------------------------- +// rs232_port_interface rs232_intf +//------------------------------------------------- + +static const rs232_port_interface rs232_intf = +{ + DEVCB_DEVICE_LINE_MEMBER(M82C50A_TAG, ins8250_uart_device, rx_w), + DEVCB_DEVICE_LINE_MEMBER(M82C50A_TAG, ins8250_uart_device, dcd_w), + DEVCB_DEVICE_LINE_MEMBER(M82C50A_TAG, ins8250_uart_device, dsr_w), + DEVCB_DEVICE_LINE_MEMBER(M82C50A_TAG, ins8250_uart_device, ri_w), + DEVCB_DEVICE_LINE_MEMBER(M82C50A_TAG, ins8250_uart_device, cts_w) +}; + + + //************************************************************************** // IMAGE LOADING //************************************************************************** @@ -746,6 +803,8 @@ DEVICE_IMAGE_LOAD_MEMBER( portfolio_state, portfolio_cart ) return IMAGE_INIT_FAIL; } + + //************************************************************************** // MACHINE INITIALIZATION //************************************************************************** @@ -788,6 +847,7 @@ void portfolio_state::machine_start() save_item(NAME(m_pid)); } + //------------------------------------------------- // machine_reset //------------------------------------------------- @@ -814,6 +874,8 @@ void portfolio_state::machine_reset() } } + + //************************************************************************** // MACHINE CONFIGURATION //************************************************************************** @@ -854,6 +916,7 @@ static MACHINE_CONFIG_START( portfolio, portfolio_state ) MCFG_INS8250_ADD(M82C50A_TAG, i8250_intf, XTAL_1_8432MHz) // should be MCFG_INS8250A_ADD 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)) + MCFG_RS232_PORT_ADD(RS232_TAG, rs232_intf, default_rs232_devices, NULL, NULL) /* fake keyboard */ MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", portfolio_state, keyboard_tick, attotime::from_usec(2500)) @@ -887,6 +950,8 @@ static MACHINE_CONFIG_START( portfolio, portfolio_state ) MCFG_NVRAM_ADD_RANDOM_FILL("nvram2") MACHINE_CONFIG_END + + //************************************************************************** // ROMS //************************************************************************** @@ -905,6 +970,8 @@ ROM_START( pofo ) ROM_LOAD( "hd61830 external character generator", 0x000, 0x800, BAD_DUMP CRC(747a1db3) SHA1(a4b29678fdb43791a8ce4c1ec778f3231bb422c5) ) // typed in from manual ROM_END + + //************************************************************************** // SYSTEM DRIVERS //************************************************************************** diff --git a/src/mess/drivers/sg1000.c b/src/mess/drivers/sg1000.c index 5282bb5bb48..2266d179f30 100644 --- a/src/mess/drivers/sg1000.c +++ b/src/mess/drivers/sg1000.c @@ -941,6 +941,23 @@ static I8255_INTERFACE( sf7000_ppi_intf ) DEVCB_DRIVER_MEMBER(sf7000_state, ppi_pc_w) // Port C write }; +//------------------------------------------------- +// i8251_interface usart_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, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL +}; + /*------------------------------------------------- upd765_interface sf7000_upd765_interface -------------------------------------------------*/ @@ -966,6 +983,19 @@ static const sn76496_config psg_intf = DEVCB_NULL }; +//------------------------------------------------- +// rs232_port_interface rs232_intf +//------------------------------------------------- + +static const rs232_port_interface rs232_intf = +{ + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL +}; + /*************************************************************************** MACHINE INITIALIZATION ***************************************************************************/ @@ -1042,13 +1072,12 @@ void sc3000_state::machine_start() void sf7000_state::machine_start() { + sc3000_state::machine_start(); + /* configure memory banking */ membank("bank1")->configure_entry(0, m_rom->base()); membank("bank1")->configure_entry(1, m_ram->pointer()); membank("bank2")->configure_entry(0, m_ram->pointer()); - - /* register for state saving */ - save_item(NAME(m_keylatch)); } /*------------------------------------------------- @@ -1184,12 +1213,12 @@ static MACHINE_CONFIG_START( sf7000, sf7000_state ) /* devices */ MCFG_I8255_ADD(UPD9255_0_TAG, sc3000_ppi_intf) MCFG_I8255_ADD(UPD9255_1_TAG, sf7000_ppi_intf) - MCFG_I8251_ADD(UPD8251_TAG, default_i8251_interface) + MCFG_I8251_ADD(UPD8251_TAG, usart_intf) MCFG_UPD765A_ADD(UPD765_TAG, false, false) MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", sf7000_floppies, "3ssdd", 0, sf7000_state::floppy_formats) -// MCFG_PRINTER_ADD("sp400") /* serial printer */ MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, standard_centronics) MCFG_CASSETTE_ADD("cassette", sc3000_cassette_interface) + MCFG_RS232_PORT_ADD(RS232_TAG, rs232_intf, default_rs232_devices, NULL, NULL) /* software lists */ MCFG_SOFTWARE_LIST_ADD("flop_list","sf7000") diff --git a/src/mess/drivers/tandy2k.c b/src/mess/drivers/tandy2k.c index e6901e83fdf..e80dd661578 100644 --- a/src/mess/drivers/tandy2k.c +++ b/src/mess/drivers/tandy2k.c @@ -411,11 +411,11 @@ WRITE_LINE_MEMBER( tandy2k_state::txrdy_w ) static const i8251_interface usart_intf = { - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, + 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), DEVCB_DRIVER_LINE_MEMBER(tandy2k_state, txrdy_w), DEVCB_NULL, @@ -606,6 +606,19 @@ static const centronics_interface centronics_intf = DEVCB_NULL // NOT BUSY output }; +//------------------------------------------------- +// rs232_port_interface rs232_intf +//------------------------------------------------- + +static const rs232_port_interface rs232_intf = +{ + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL +}; + // Keyboard WRITE_LINE_MEMBER( tandy2k_state::kbdclk_w ) @@ -707,6 +720,7 @@ static MACHINE_CONFIG_START( tandy2k, tandy2k_state ) MCFG_FLOPPY_DRIVE_ADD(I8272A_TAG ":0", tandy2k_floppies, "525qd", 0, floppy_image_device::default_floppy_formats) MCFG_FLOPPY_DRIVE_ADD(I8272A_TAG ":1", tandy2k_floppies, "525qd", 0, floppy_image_device::default_floppy_formats) MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, standard_centronics) + MCFG_RS232_PORT_ADD(RS232_TAG, rs232_intf, default_rs232_devices, NULL, NULL) MCFG_TANDY2K_KEYBOARD_ADD(kb_intf) // software lists diff --git a/src/mess/drivers/v1050.c b/src/mess/drivers/v1050.c index 9237b9ac8be..c66e1d51f09 100644 --- a/src/mess/drivers/v1050.c +++ b/src/mess/drivers/v1050.c @@ -924,11 +924,11 @@ WRITE_LINE_MEMBER( v1050_state::sio_txrdy_w ) static const i8251_interface sio_8251_intf = { - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, + 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), DEVCB_DRIVER_LINE_MEMBER(v1050_state, sio_txrdy_w), DEVCB_NULL, @@ -970,6 +970,19 @@ void v1050_state::fdc_drq_w(bool state) update_fdc(); } +//------------------------------------------------- +// rs232_port_interface rs232_intf +//------------------------------------------------- + +static const rs232_port_interface rs232_intf = +{ + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL +}; + /* static LEGACY_FLOPPY_OPTIONS_START( v1050 ) LEGACY_FLOPPY_OPTION( v1050, "dsk", "Visual 1050 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, @@ -1094,6 +1107,7 @@ static MACHINE_CONFIG_START( v1050, v1050_state ) MCFG_FLOPPY_DRIVE_ADD(MB8877_TAG":3", v1050_floppies, NULL, 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, rs232_intf, default_rs232_devices, NULL, NULL) // SASI bus MCFG_SCSIBUS_ADD(SASIBUS_TAG) diff --git a/src/mess/drivers/victor9k.c b/src/mess/drivers/victor9k.c index d3eaa0eccd8..995b41fc38a 100644 --- a/src/mess/drivers/victor9k.c +++ b/src/mess/drivers/victor9k.c @@ -180,12 +180,12 @@ static UPD7201_INTERFACE( mpsc_intf ) 0, // transmit clock DEVCB_NULL, // receive DRQ DEVCB_NULL, // transmit DRQ - DEVCB_NULL, // receive data - DEVCB_NULL, // transmit data - DEVCB_NULL, // clear to send - DEVCB_NULL, // data carrier detect - DEVCB_NULL, // ready to send - DEVCB_NULL, // data terminal ready + 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, cts_r), + DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, rs232_port_device, dcd_r), + DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, rs232_port_device, rts_w), + DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, rs232_port_device, dtr_w), DEVCB_NULL, // wait DEVCB_NULL // sync output }, { @@ -193,12 +193,12 @@ static UPD7201_INTERFACE( mpsc_intf ) 0, // transmit clock DEVCB_NULL, // receive DRQ DEVCB_NULL, // transmit DRQ - DEVCB_NULL, // receive data - DEVCB_NULL, // transmit data - DEVCB_NULL, // clear to send - DEVCB_NULL, // data carrier detect - DEVCB_NULL, // ready to send - DEVCB_NULL, // data terminal ready + 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, cts_r), + DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, rs232_port_device, dcd_r), + DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, rs232_port_device, rts_w), + DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, rs232_port_device, dtr_w), DEVCB_NULL, // wait DEVCB_NULL // sync output } @@ -881,6 +881,33 @@ static SLOT_INTERFACE_START( victor9k_floppies ) SLOT_INTERFACE( "525qd", FLOPPY_525_QD ) SLOT_INTERFACE_END +//------------------------------------------------- +// rs232_port_interface rs232a_intf +//------------------------------------------------- + +static const rs232_port_interface rs232a_intf = +{ + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL +}; + + +//------------------------------------------------- +// rs232_port_interface rs232b_intf +//------------------------------------------------- + +static const rs232_port_interface rs232b_intf = +{ + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL +}; + // Machine Initialization IRQ_CALLBACK_MEMBER(victor9k_state::victor9k_irq_callback) @@ -942,6 +969,8 @@ static MACHINE_CONFIG_START( victor9k, victor9k_state ) MCFG_VIA6522_ADD(M6522_6_TAG, XTAL_30MHz/30, via6_intf) MCFG_FLOPPY_DRIVE_ADD(I8048_TAG":0", victor9k_floppies, "525qd", 0, floppy_image_device::default_floppy_formats) MCFG_FLOPPY_DRIVE_ADD(I8048_TAG":1", victor9k_floppies, "525qd", 0, floppy_image_device::default_floppy_formats) + MCFG_RS232_PORT_ADD(RS232_A_TAG, rs232a_intf, default_rs232_devices, NULL, NULL) + MCFG_RS232_PORT_ADD(RS232_B_TAG, rs232b_intf, default_rs232_devices, NULL, NULL) MCFG_VICTOR9K_KEYBOARD_ADD(kb_intf) // internal ram diff --git a/src/mess/drivers/vixen.c b/src/mess/drivers/vixen.c index 0a101d9087f..4f957bc62c8 100644 --- a/src/mess/drivers/vixen.c +++ b/src/mess/drivers/vixen.c @@ -233,11 +233,13 @@ READ8_MEMBER( vixen_state::port3_r ) */ - UINT8 data = 0xff; + UINT8 data = 0xfc; - // TODO ring indicator + // ring indicator + data |= m_rs232->ri_r(); - // TODO data carrier detect + // data carrier detect + data |= m_rs232->dcd_r() << 1; return data; } @@ -670,11 +672,11 @@ WRITE_LINE_MEMBER( vixen_state::txrdy_w ) static const i8251_interface usart_intf = { - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, + 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), DEVCB_DRIVER_LINE_MEMBER(vixen_state, txrdy_w), DEVCB_NULL, @@ -709,6 +711,20 @@ void vixen_state::fdc_intrq_w(bool state) } +//------------------------------------------------- +// rs232_port_interface rs232_intf +//------------------------------------------------- + +static const rs232_port_interface rs232_intf = +{ + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL +}; + + //************************************************************************** // MACHINE INITIALIZATION @@ -822,6 +838,7 @@ 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, rs232_intf, default_rs232_devices, NULL, NULL) /* software lists */ MCFG_SOFTWARE_LIST_ADD("disk_list", "vixen") diff --git a/src/mess/drivers/wangpc.c b/src/mess/drivers/wangpc.c index 3027b3618ed..9a63cb55e49 100644 --- a/src/mess/drivers/wangpc.c +++ b/src/mess/drivers/wangpc.c @@ -961,12 +961,12 @@ static MC2661_INTERFACE( epci_intf ) { 0, 0, - DEVCB_NULL, - DEVCB_NULL, + DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, rx), + DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, serial_port_device, tx), DEVCB_DRIVER_LINE_MEMBER(wangpc_state, epci_irq_w), DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, + DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, rts_w), + DEVCB_DEVICE_LINE_MEMBER(RS232_TAG, rs232_port_device, dtr_w), DEVCB_DRIVER_LINE_MEMBER(wangpc_state, epci_irq_w), DEVCB_NULL, DEVCB_NULL @@ -1039,6 +1039,20 @@ static const centronics_interface centronics_intf = }; +//------------------------------------------------- +// rs232_port_interface rs232_intf +//------------------------------------------------- + +static const rs232_port_interface rs232_intf = +{ + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL +}; + + //------------------------------------------------- // WANGPC_BUS_INTERFACE( kb_intf ) //------------------------------------------------- @@ -1205,6 +1219,7 @@ static MACHINE_CONFIG_START( wangpc, wangpc_state ) MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", wangpc_floppies, "525dd", 0, wangpc_state::floppy_formats) MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":1", wangpc_floppies, "525dd", 0, wangpc_state::floppy_formats) MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, centronics_intf) + MCFG_RS232_PORT_ADD(RS232_TAG, rs232_intf, default_rs232_devices, NULL, NULL) MCFG_WANGPC_KEYBOARD_ADD() // bus diff --git a/src/mess/drivers/xerox820.c b/src/mess/drivers/xerox820.c index 0f5a79f7154..531b28d3b4f 100644 --- a/src/mess/drivers/xerox820.c +++ b/src/mess/drivers/xerox820.c @@ -420,17 +420,17 @@ static Z80DART_INTERFACE( sio_intf ) { 0, 0, 0, 0, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, + 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, dtr_w), + DEVCB_DEVICE_LINE_MEMBER(RS232_A_TAG, rs232_port_device, rts_w), DEVCB_NULL, DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, - DEVCB_NULL, + 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, dtr_w), + DEVCB_DEVICE_LINE_MEMBER(RS232_B_TAG, rs232_port_device, rts_w), DEVCB_NULL, DEVCB_NULL, @@ -497,11 +497,22 @@ void xerox820_state::fdc_drq_w(bool state) /* COM8116 Interface */ +WRITE_LINE_MEMBER( xerox820_state::fr_w ) +{ + z80dart_rxca_w(m_sio, state); + z80dart_txca_w(m_sio, state); +} + +WRITE_LINE_MEMBER( xerox820_state::ft_w ) +{ + z80dart_rxtxcb_w(m_sio, state); +} + static COM8116_INTERFACE( com8116_intf ) { DEVCB_NULL, /* fX/4 output */ - DEVCB_NULL, /* fR output */ - DEVCB_NULL, /* fT output */ + DEVCB_DRIVER_LINE_MEMBER(xerox820_state, fr_w), + DEVCB_DRIVER_LINE_MEMBER(xerox820_state, ft_w), COM8116_DIVISORS_16X_5_0688MHz, // receiver COM8116_DIVISORS_16X_5_0688MHz // transmitter }; @@ -520,6 +531,34 @@ static ASCII_KEYBOARD_INTERFACE( keyboard_intf ) DEVCB_DRIVER_MEMBER(xerox820_state, kbd_w) }; + +//------------------------------------------------- +// rs232_port_interface rs232a_intf +//------------------------------------------------- + +static const rs232_port_interface rs232a_intf = +{ + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL +}; + + +//------------------------------------------------- +// rs232_port_interface rs232b_intf +//------------------------------------------------- + +static const rs232_port_interface rs232b_intf = +{ + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL +}; + /* Video */ UINT32 xerox820_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) @@ -701,6 +740,8 @@ static MACHINE_CONFIG_START( xerox820, xerox820_state ) MCFG_FLOPPY_DRIVE_ADD(FD1771_TAG":0", xerox820_floppies, "sa400", NULL, floppy_image_device::default_floppy_formats) MCFG_FLOPPY_DRIVE_ADD(FD1771_TAG":1", xerox820_floppies, "sa400", NULL, floppy_image_device::default_floppy_formats) MCFG_COM8116_ADD(COM8116_TAG, XTAL_5_0688MHz, com8116_intf) + MCFG_RS232_PORT_ADD(RS232_A_TAG, rs232a_intf, default_rs232_devices, NULL, NULL) + MCFG_RS232_PORT_ADD(RS232_B_TAG, rs232b_intf, default_rs232_devices, NULL, NULL) MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf) /* internal ram */ @@ -747,6 +788,8 @@ static MACHINE_CONFIG_START( xerox820ii, xerox820ii_state ) MCFG_FLOPPY_DRIVE_ADD(FD1797_TAG":0", xerox820_floppies, "sa450", NULL, floppy_image_device::default_floppy_formats) MCFG_FLOPPY_DRIVE_ADD(FD1797_TAG":1", xerox820_floppies, "sa450", NULL, floppy_image_device::default_floppy_formats) MCFG_COM8116_ADD(COM8116_TAG, XTAL_5_0688MHz, com8116_intf) + MCFG_RS232_PORT_ADD(RS232_A_TAG, rs232a_intf, default_rs232_devices, NULL, NULL) + MCFG_RS232_PORT_ADD(RS232_B_TAG, rs232b_intf, default_rs232_devices, NULL, NULL) MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf) // SASI bus diff --git a/src/mess/includes/pc1512.h b/src/mess/includes/pc1512.h index c811ad49b72..37cfe35b166 100644 --- a/src/mess/includes/pc1512.h +++ b/src/mess/includes/pc1512.h @@ -3,7 +3,6 @@ #ifndef __PC1512__ #define __PC1512__ - #include "emu.h" #include "cpu/i86/i86.h" #include "cpu/mcs48/mcs48.h" @@ -19,6 +18,7 @@ #include "machine/pc1512kb.h" #include "machine/pc_fdc.h" #include "machine/ram.h" +#include "machine/serial.h" #include "sound/speaker.h" #include "video/mc6845.h" @@ -36,6 +36,7 @@ #define SPEAKER_TAG "speaker" #define ISA_BUS_TAG "isa" #define SCREEN_TAG "screen" +#define RS232_TAG "rs232" class pc1512_state : public driver_device { diff --git a/src/mess/includes/portfoli.h b/src/mess/includes/portfoli.h index fb44e24bee6..bec12943aaa 100644 --- a/src/mess/includes/portfoli.h +++ b/src/mess/includes/portfoli.h @@ -3,26 +3,27 @@ #ifndef __PORTFOLIO__ #define __PORTFOLIO__ - #include "emu.h" #include "cpu/i86/i86.h" #include "imagedev/cartslot.h" -#include "machine/ram.h" #include "imagedev/printer.h" #include "machine/ctronics.h" #include "machine/i8255.h" #include "machine/ins8250.h" #include "machine/nvram.h" +#include "machine/ram.h" +#include "machine/serial.h" #include "sound/speaker.h" #include "video/hd61830.h" -#define SCREEN_TAG "screen" #define M80C88A_TAG "u1" #define M82C55A_TAG "hpc101_u1" #define M82C50A_TAG "hpc102_u1" #define HD61830_TAG "hd61830" #define CENTRONICS_TAG "centronics" #define TIMER_TICK_TAG "tick" +#define SCREEN_TAG "screen" +#define RS232_TAG "rs232" class portfolio_state : public driver_device { diff --git a/src/mess/includes/sg1000.h b/src/mess/includes/sg1000.h index 068ccfcda5a..c761170e752 100644 --- a/src/mess/includes/sg1000.h +++ b/src/mess/includes/sg1000.h @@ -12,6 +12,7 @@ #include "machine/i8255.h" #include "machine/i8251.h" #include "machine/ram.h" +#include "machine/serial.h" #include "machine/upd765.h" #include "sound/sn76496.h" #include "video/tms9928a.h" @@ -27,6 +28,7 @@ #define UPD9255_1_TAG "upd9255_1" #define CENTRONICS_TAG "centronics" #define TMS9918A_TAG "tms9918a" +#define RS232_TAG "rs232" #define IS_CARTRIDGE_TV_DRAW(ptr) \ (!strncmp("annakmn", (const char *)&ptr[0x13b3], 7)) diff --git a/src/mess/includes/tandy2k.h b/src/mess/includes/tandy2k.h index 7b474b27c56..37269840b2c 100644 --- a/src/mess/includes/tandy2k.h +++ b/src/mess/includes/tandy2k.h @@ -12,6 +12,7 @@ #include "machine/pit8253.h" #include "machine/pic8259.h" #include "machine/ram.h" +#include "machine/serial.h" #include "machine/tandy2kb.h" #include "machine/upd765.h" #include "sound/speaker.h" @@ -34,6 +35,7 @@ #define WD1010_TAG "u18" #define WD1100_11_TAG "u12" #define CENTRONICS_TAG "centronics" +#define RS232_TAG "rs232" class tandy2k_state : public driver_device { diff --git a/src/mess/includes/v1050.h b/src/mess/includes/v1050.h index c0fb3025ec6..ad6fe0d69a3 100644 --- a/src/mess/includes/v1050.h +++ b/src/mess/includes/v1050.h @@ -17,6 +17,7 @@ #include "machine/scsibus.h" #include "machine/scsicb.h" #include "machine/scsihd.h" +#include "machine/serial.h" #include "machine/v1050kb.h" #include "machine/wd_fdc.h" #include "video/mc6845.h" @@ -42,6 +43,7 @@ #define TIMER_ACK_TAG "timer_ack" #define TIMER_RST_TAG "timer_rst" #define SASIBUS_TAG "sasi" +#define RS232_TAG "rs232" #define V1050_VIDEORAM_SIZE 0x8000 #define V1050_VIDEORAM_MASK 0x7fff diff --git a/src/mess/includes/victor9k.h b/src/mess/includes/victor9k.h index e8a9e5aa425..a4246a17e05 100644 --- a/src/mess/includes/victor9k.h +++ b/src/mess/includes/victor9k.h @@ -3,7 +3,6 @@ #ifndef __VICTOR9K__ #define __VICTOR9K__ - #include "emu.h" #include "cpu/i86/i86.h" #include "cpu/mcs48/mcs48.h" @@ -15,6 +14,7 @@ #include "machine/mc6852.h" #include "machine/pit8253.h" #include "machine/pic8259.h" +#include "machine/serial.h" #include "machine/upd7201.h" #include "machine/victor9kb.h" #include "sound/hc55516.h" @@ -36,6 +36,8 @@ #define M6522_5_TAG "m6522_5" #define M6522_6_TAG "m6522_6" #define CENTRONICS_TAG "centronics" +#define RS232_A_TAG "rs232a" +#define RS232_B_TAG "rs232b" class victor9k_state : public driver_device { diff --git a/src/mess/includes/vixen.h b/src/mess/includes/vixen.h index 9bb48bc6a40..a63461593ce 100644 --- a/src/mess/includes/vixen.h +++ b/src/mess/includes/vixen.h @@ -9,6 +9,7 @@ #include "machine/i8251.h" #include "machine/ieee488.h" #include "machine/ram.h" +#include "machine/serial.h" #include "machine/wd_fdc.h" #include "sound/discrete.h" @@ -19,6 +20,7 @@ #define P8251A_TAG "c3" #define DISCRETE_TAG "discrete" #define SCREEN_TAG "screen" +#define RS232_TAG "rs232" class vixen_state : public driver_device { @@ -34,6 +36,7 @@ public: m_ram(*this, RAM_TAG), m_floppy0(*this, FDC1797_TAG":0"), m_floppy1(*this, FDC1797_TAG":1"), + m_rs232(*this, RS232_TAG), m_rom(*this, Z8400A_TAG), m_sync_rom(*this, "video"), m_char_rom(*this, "chargen"), @@ -63,6 +66,7 @@ public: required_device m_ram; required_device m_floppy0; required_device m_floppy1; + required_device m_rs232; required_memory_region m_rom; required_memory_region m_sync_rom; required_memory_region m_char_rom; diff --git a/src/mess/includes/wangpc.h b/src/mess/includes/wangpc.h index 0d6270c8afd..c3eab3d15e9 100644 --- a/src/mess/includes/wangpc.h +++ b/src/mess/includes/wangpc.h @@ -14,6 +14,7 @@ #include "machine/pit8253.h" #include "machine/pic8259.h" #include "machine/ram.h" +#include "machine/serial.h" #include "machine/upd765.h" #include "machine/wangpcbus.h" #include "machine/wangpckb.h" @@ -35,6 +36,7 @@ #define SCN2661_TAG "scn2661" #define UPD765_TAG "upd765" #define CENTRONICS_TAG "centronics" +#define RS232_TAG "rs232" class wangpc_state : public driver_device { diff --git a/src/mess/includes/xerox820.h b/src/mess/includes/xerox820.h index 71437971e11..b12c452cf55 100644 --- a/src/mess/includes/xerox820.h +++ b/src/mess/includes/xerox820.h @@ -12,6 +12,7 @@ #include "machine/scsibus.h" #include "machine/scsicb.h" #include "machine/scsihd.h" +#include "machine/serial.h" #include "machine/wd_fdc.h" #include "machine/z80pio.h" #include "machine/z80ctc.h" @@ -32,6 +33,8 @@ #define COM8116_TAG "u76" #define I8086_TAG "i8086" #define SASIBUS_TAG "sasi" +#define RS232_A_TAG "rs232a" +#define RS232_B_TAG "rs232b" #define XEROX820_VIDEORAM_SIZE 0x1000 #define XEROX820_VIDEORAM_MASK 0x0fff @@ -44,6 +47,7 @@ public: m_maincpu(*this, Z80_TAG), m_kbpio(*this, Z80PIO_KB_TAG), m_ctc(*this, Z80CTC_TAG), + m_sio(*this, Z80SIO_TAG), m_fdc(*this, FD1771_TAG), m_ram(*this, RAM_TAG), m_floppy0(*this, FD1771_TAG":0"), @@ -65,6 +69,7 @@ public: required_device m_maincpu; required_device m_kbpio; required_device m_ctc; + required_device m_sio; required_device m_fdc; required_device m_ram; required_device m_floppy0; @@ -83,6 +88,8 @@ public: DECLARE_WRITE_LINE_MEMBER( intrq_w ); DECLARE_WRITE_LINE_MEMBER( drq_w ); DECLARE_WRITE8_MEMBER( kbd_w ); + DECLARE_WRITE_LINE_MEMBER( fr_w ); + DECLARE_WRITE_LINE_MEMBER( ft_w ); void bankswitch(int bank); void update_nmi();