From b3e74085fe793b886020f0f6c61902d20feea967 Mon Sep 17 00:00:00 2001 From: arbee Date: Sun, 31 Jan 2016 17:59:41 -0500 Subject: [PATCH] apple2: fix parallel card ACK handling, Print Shop almost works with the lx810l now. [R. Belmont] --- src/devices/bus/a2bus/a2pic.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/devices/bus/a2bus/a2pic.cpp b/src/devices/bus/a2bus/a2pic.cpp index f47f964f192..c16ee6f2140 100644 --- a/src/devices/bus/a2bus/a2pic.cpp +++ b/src/devices/bus/a2bus/a2pic.cpp @@ -49,11 +49,11 @@ static INPUT_PORTS_START( pic ) PORT_DIPSETTING( 0x06, "13 microseconds" ) PORT_DIPSETTING( 0x07, "15 microseconds" ) - PORT_DIPNAME( 0x08, 0x00, "Strobe polarity (SW4)" ) + PORT_DIPNAME( 0x08, 0x08, "Strobe polarity (SW4)" ) PORT_DIPSETTING( 0x00, "Positive" ) PORT_DIPSETTING( 0x08, "Negative" ) - PORT_DIPNAME( 0x10, 0x00, "Acknowledge polarity (SW5)" ) + PORT_DIPNAME( 0x10, 0x10, "Acknowledge polarity (SW5)" ) PORT_DIPSETTING( 0x00, "Positive" ) PORT_DIPSETTING( 0x10, "Negative" ) @@ -181,13 +181,27 @@ UINT8 a2bus_pic_device::read_cnxx(address_space &space, UINT8 offset) UINT8 a2bus_pic_device::read_c0nx(address_space &space, UINT8 offset) { + UINT8 rv = 0; + switch (offset) { case 3: return m_ctx_data_in->read(); case 4: - return m_ack; + rv = m_ack; + + // clear flip-flop + if (m_dsw1->read() & 0x10) // negative polarity + { + m_ack |= 0x80; + } + else + { + m_ack &= ~0x80; + } + + return rv; case 6: // does reading this really work? m_irqenable = true;