From 70d453a590760d4455d20dd07af1350d01f47e12 Mon Sep 17 00:00:00 2001 From: tomcw Date: Tue, 30 Jan 2024 07:32:23 +0000 Subject: [PATCH] Fix for: 21 1E 00 FF 00 (AY READ wasn't setting correct 6522's busState) --- source/Mockingboard.cpp | 8 +++++++- source/Mockingboard.h | 5 ----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source/Mockingboard.cpp b/source/Mockingboard.cpp index f789ad27..7398a3af 100644 --- a/source/Mockingboard.cpp +++ b/source/Mockingboard.cpp @@ -282,6 +282,9 @@ void MockingboardCard::AY8913_Reset(BYTE subunit) AY8910_reset(subunit, AY8913_DEVICE_B); // GH#1197: Reset both AYs regardless of Phasor mode & chip-select bits m_MBSubUnit[subunit].Reset(QueryType()); + + if (QueryType() == CT_SDMusic) + m_MBSubUnit[0].SetBusState(false); } void MockingboardCard::AY8913_Write(BYTE subunit, BYTE ay, BYTE value) @@ -330,7 +333,10 @@ void MockingboardCard::AY8913_Write(BYTE subunit, BYTE ay, BYTE value) } } - pMB->SetBusState(busState, r6522); // NB. Need to pass SY6522 as card may only have one (eg. CT_SDMusic) + if (QueryType() != CT_SDMusic) + pMB->SetBusState(busState); + else + m_MBSubUnit[0].SetBusState(busState); } break; diff --git a/source/Mockingboard.h b/source/Mockingboard.h index 088e3ece..32afbe46 100644 --- a/source/Mockingboard.h +++ b/source/Mockingboard.h @@ -111,11 +111,6 @@ private: isBusDriven = state; sy6522.SetBusBeingDriven(state); } - void SetBusState(bool state, SY6522& r6522) - { - isBusDriven = state; - r6522.SetBusBeingDriven(state); - } }; void WriteToORB(BYTE subunit, BYTE subunitForAY=0);