Mockingboard: do not play sound unless a card is present. (PR #1222)

This commit is contained in:
Andrea 2023-05-02 21:47:01 +01:00 committed by GitHub
parent 0ecd2e865a
commit a648c3e607
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -220,13 +220,17 @@ void MockingboardCardManager::Update(const ULONG executedCycles)
// NB. CardManager has just called each card's Update() // NB. CardManager has just called each card's Update()
bool active = false; bool active = false;
bool present = false;
for (UINT i = SLOT0; i < NUM_SLOTS; i++) for (UINT i = SLOT0; i < NUM_SLOTS; i++)
{ {
if (IsMockingboard(i)) if (IsMockingboard(i))
{
active |= dynamic_cast<MockingboardCard&>(GetCardMgr().GetRef(i)).IsAnyTimer1Active(); active |= dynamic_cast<MockingboardCard&>(GetCardMgr().GetRef(i)).IsAnyTimer1Active();
present = true;
}
} }
if (active) if (!present || active)
return; return;
// No 6522 TIMER1's are active, so periodically update AY8913's here... // No 6522 TIMER1's are active, so periodically update AY8913's here...