From 864c790ed837f5e8283e4b63f043c3a47135bc2f Mon Sep 17 00:00:00 2001 From: "R. Belmont" Date: Wed, 13 Feb 2013 04:47:34 +0000 Subject: [PATCH] (MESS) Apple II: Allow Super Serial Card to connect to MESS's serial terminal and null modem devices. [R. Belmont] --- src/mess/machine/a2ssc.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/mess/machine/a2ssc.c b/src/mess/machine/a2ssc.c index 71aec382106..5a0a648b494 100644 --- a/src/mess/machine/a2ssc.c +++ b/src/mess/machine/a2ssc.c @@ -9,6 +9,9 @@ #include "emu.h" #include "includes/apple2.h" #include "machine/a2ssc.h" +#include "machine/terminal.h" +#include "machine/null_modem.h" +#include "machine/serial.h" /*************************************************************************** @@ -23,10 +26,27 @@ const device_type A2BUS_SSC = &device_creator; #define SSC_ROM_REGION "ssc_rom" #define SSC_ACIA_TAG "ssc_acia" +#define SSC_RS232_TAG "ssc_rs232" +static SLOT_INTERFACE_START( rs232_devices ) + SLOT_INTERFACE("serial_terminal", SERIAL_TERMINAL) + SLOT_INTERFACE("null_modem", NULL_MODEM) +SLOT_INTERFACE_END + +static const rs232_port_interface rs232_intf = +{ + DEVCB_DEVICE_LINE_MEMBER(SSC_ACIA_TAG, mos6551_device, rxd_w), + DEVCB_DEVICE_LINE_MEMBER(SSC_ACIA_TAG, mos6551_device, dcd_w), + DEVCB_DEVICE_LINE_MEMBER(SSC_ACIA_TAG, mos6551_device, dsr_w), + DEVCB_NULL, + DEVCB_DEVICE_LINE_MEMBER(SSC_ACIA_TAG, mos6551_device, cts_w) +}; MACHINE_CONFIG_FRAGMENT( ssc ) MCFG_MOS6551_ADD(SSC_ACIA_TAG, XTAL_1_8432MHz, DEVWRITELINE(DEVICE_SELF, a2bus_ssc_device, acia_irq_w)) + MCFG_MOS6551_RXD_TXD_CALLBACKS(NULL, DEVWRITELINE(SSC_RS232_TAG, rs232_port_device, tx)) + + MCFG_RS232_PORT_ADD(SSC_RS232_TAG, rs232_intf, rs232_devices, NULL, NULL) MACHINE_CONFIG_END ROM_START( ssc ) @@ -160,7 +180,7 @@ void a2bus_ssc_device::device_reset() UINT8 a2bus_ssc_device::read_cnxx(address_space &space, UINT8 offset) { - return m_rom[offset+0x700]; + return m_rom[(offset&0xff)+0x700]; } /*------------------------------------------------- @@ -212,7 +232,6 @@ void a2bus_ssc_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data case 0xb: m_acia->write(space, offset-8, data); break; - } }