summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author ajrhacker <ajrhacker@users.noreply.github.com>2019-06-10 17:10:13 -0400
committer GitHub <noreply@github.com>2019-06-10 17:10:13 -0400
commitd0319edecadef1c9450e02403c0b5fea5b456edc (patch)
treeb6162762000c3d0ebe8055cc9aa8977a70b6eca4
parent2bb1aaf131a9e427e2ab83a0fc4213ded727794c (diff)
parent0074e4df451e74aad57248da5ce6b0033b0ca333 (diff)
Merge pull request #5204 from hackbar/pia-fix
pia6821: roll back port A read change.
-rw-r--r--src/devices/machine/6821pia.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/devices/machine/6821pia.cpp b/src/devices/machine/6821pia.cpp
index b5b6b123b0b..4171b9c6f82 100644
--- a/src/devices/machine/6821pia.cpp
+++ b/src/devices/machine/6821pia.cpp
@@ -237,11 +237,12 @@ uint8_t pia6821_device::get_in_a_value()
}
}
- // For port A, when the port is in output mode, other devices can drive the pins too.
- // If they load the lines so the voltage changes from what the PIA is outputting, that
- // value will be read back.
- // TODO: Figure out if any boards do this, and compensate.
- ret = (m_out_a & m_ddr_a) | (port_a_data & ~m_ddr_a);
+ // - connected pins are always read
+ // - disconnected pins read the output buffer in output mode
+ // - disconnected pins are HI in input mode
+ ret = (~m_port_a_z_mask & port_a_data) |
+ ( m_port_a_z_mask & m_ddr_a & m_out_a) |
+ ( m_port_a_z_mask & ~m_ddr_a);
return ret;
}