From 2c9ac3e1eda7ad1e902cdc358724609996f59d46 Mon Sep 17 00:00:00 2001 From: Curt Coder Date: Fri, 15 Feb 2013 19:49:49 +0000 Subject: [PATCH] (MESS) prof80: Added RS-232 ports. (nw) --- src/mess/drivers/prof80.c | 25 ++++++++++++++++++++++++- src/mess/includes/prof80.h | 7 +++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/mess/drivers/prof80.c b/src/mess/drivers/prof80.c index 042965f1889..10fdb7cdaf8 100644 --- a/src/mess/drivers/prof80.c +++ b/src/mess/drivers/prof80.c @@ -178,9 +178,11 @@ void prof80_state::ls259_w(int fa, int sa, int fb, int sb) break; case 2: // _RTS + m_rs232a->rts_w(fb); break; case 3: // TX + m_rs232a->tx(fb); break; case 4: // _MSTOP @@ -192,6 +194,7 @@ void prof80_state::ls259_w(int fa, int sa, int fb, int sb) break; case 5: // TXP + m_rs232b->tx(fb); break; case 6: // TSTB @@ -262,9 +265,11 @@ READ8_MEMBER( prof80_state::status_r ) UINT8 data = 0; // serial receive + data |= !m_rs232a->rx(); // clear to send - data |= 0x10; + data |= m_rs232a->cts_r() << 4; + data |= m_rs232b->cts_r() << 7; // floppy index data |= (m_floppy0->get_device() ? m_floppy0->get_device()->idx_r() : m_floppy1->get_device() ? m_floppy1->get_device()->idx_r() : 1) << 5; @@ -523,6 +528,20 @@ static SLOT_INTERFACE_START( prof80_ecb_cards ) SLOT_INTERFACE_END +//------------------------------------------------- +// rs232_port_interface rs232_intf +//------------------------------------------------- + +static const rs232_port_interface rs232_intf = +{ + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL +}; + + //************************************************************************** // MACHINE INITIALIZATION @@ -610,6 +629,10 @@ static MACHINE_CONFIG_START( prof80, prof80_state ) MCFG_ECBBUS_SLOT_ADD(4, "ecb_4", prof80_ecb_cards, NULL, NULL) MCFG_ECBBUS_SLOT_ADD(5, "ecb_5", prof80_ecb_cards, NULL, NULL) + // V24 + MCFG_RS232_PORT_ADD(RS232_A_TAG, rs232_intf, default_rs232_devices, NULL, NULL) + MCFG_RS232_PORT_ADD(RS232_B_TAG, rs232_intf, default_rs232_devices, NULL, NULL) + // internal ram MCFG_RAM_ADD(RAM_TAG) MCFG_RAM_DEFAULT_SIZE("128K") diff --git a/src/mess/includes/prof80.h b/src/mess/includes/prof80.h index 3f71fe19830..13be84c0888 100644 --- a/src/mess/includes/prof80.h +++ b/src/mess/includes/prof80.h @@ -11,12 +11,15 @@ #include "machine/ecb_grip.h" #include "machine/ram.h" #include "machine/rescap.h" +#include "machine/serial.h" #include "machine/upd1990a.h" #include "machine/upd765.h" #define Z80_TAG "z1" #define UPD765_TAG "z38" #define UPD1990A_TAG "z43" +#define RS232_A_TAG "rs232a" +#define RS232_B_TAG "rs232b" // ------------------------------------------------------------------------ @@ -38,6 +41,8 @@ public: m_floppy0(*this, UPD765_TAG":0"), m_floppy1(*this, UPD765_TAG":1"), m_ecb(*this, ECBBUS_TAG), + m_rs232a(*this, RS232_A_TAG), + m_rs232b(*this, RS232_B_TAG), m_rom(*this, Z80_TAG), m_j4(*this, "J4"), m_j5(*this, "J5") @@ -50,6 +55,8 @@ public: required_device m_floppy0; required_device m_floppy1; required_device m_ecb; + required_device m_rs232a; + required_device m_rs232b; required_memory_region m_rom; required_ioport m_j4; required_ioport m_j5;