From fb37310acd29bb7ed4f6c8b295c4478706e29801 Mon Sep 17 00:00:00 2001 From: tomcw Date: Mon, 6 Mar 2023 22:25:23 +0000 Subject: [PATCH] Phasor: support AY READ from both AYs (#1192) --- source/Mockingboard.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/Mockingboard.cpp b/source/Mockingboard.cpp index 45903495..796b6a7b 100644 --- a/source/Mockingboard.cpp +++ b/source/Mockingboard.cpp @@ -290,6 +290,15 @@ void MockingboardCard::AY8910_Write(BYTE subunit, BYTE ay, BYTE value) r6522.SetRegORA(AYReadReg(subunit, ay, pMB->nAYCurrentRegister[ay]) & (r6522.GetReg(SY6522::rDDRA) ^ 0xff)); else r6522.UpdatePortAForHiZ(); + + if (m_phasorEnable && m_phasorMode == PH_Phasor) // GH#1192 + { + if (ay == AY8913_DEVICE_A) + { + if (pMB->isChipSelected[AY8913_DEVICE_B] && pMB->isAYLatchedAddressValid[AY8913_DEVICE_B]) + r6522.SetRegORA(r6522.GetReg(SY6522::rORA) | (AYReadReg(subunit, AY8913_DEVICE_B, pMB->nAYCurrentRegister[AY8913_DEVICE_B]) & (r6522.GetReg(SY6522::rDDRA) ^ 0xff))); + } + } break; case AY_WRITE: // 6: WRITE TO PSG