diff options
author | 2019-04-05 14:22:08 +0200 | |
---|---|---|
committer | 2019-04-05 14:22:21 +0200 | |
commit | 7769fed424c7bd4994210ef83fd6e4c39bc54ca8 (patch) | |
tree | 45aa3dee20ce4a382624c8a31fb64707a6e4a728 /src/devices/sound/ay8910.cpp | |
parent | f4000a69711ed1853af74598cdbed78da17e2a41 (diff) |
ay8910: reset i/o reg on port direction change (nw)
Diffstat (limited to 'src/devices/sound/ay8910.cpp')
-rw-r--r-- | src/devices/sound/ay8910.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/devices/sound/ay8910.cpp b/src/devices/sound/ay8910.cpp index 9ee02834f67..efe54b2c048 100644 --- a/src/devices/sound/ay8910.cpp +++ b/src/devices/sound/ay8910.cpp @@ -966,6 +966,9 @@ void ay8910_device::ay8910_write_reg(int r, int v) if ((m_last_enable == -1) || ((m_last_enable & 0x40) != (m_regs[AY_ENABLE] & 0x40))) { + if (!m_port_a_read_cb.isnull()) + m_regs[AY_PORTA] = m_port_a_read_cb(0); + /* write out 0xff if port set to input */ if (!m_port_a_write_cb.isnull()) m_port_a_write_cb((offs_t)0, (m_regs[AY_ENABLE] & 0x40) ? m_regs[AY_PORTA] : 0xff); @@ -974,6 +977,9 @@ void ay8910_device::ay8910_write_reg(int r, int v) if ((m_last_enable == -1) || ((m_last_enable & 0x80) != (m_regs[AY_ENABLE] & 0x80))) { + if (!m_port_b_read_cb.isnull()) + m_regs[AY_PORTB] = m_port_b_read_cb(0); + /* write out 0xff if port set to input */ if (!m_port_b_write_cb.isnull()) m_port_b_write_cb((offs_t)0, (m_regs[AY_ENABLE] & 0x80) ? m_regs[AY_PORTB] : 0xff); |