Fix loading from save-state (from MB playback to no card)

This commit is contained in:
tomcw 2023-01-21 21:20:08 +00:00
parent 2f4f8ae780
commit 0606716072
3 changed files with 5 additions and 26 deletions

View File

@ -422,26 +422,6 @@ UINT MockingboardCard::MB_Update(void)
//-----------------------------------------------------------------------------
//
// TODO-TC: check this - but shouldn't happen now, since MockingboardCard's are now properly destructed
//
// NB. Mockingboard voice is *already* muted because showing 'Select Load State file' dialog
// . and voice will be unmuted when dialog is closed
void MockingboardCard::InitializeForLoadingSnapshot(void) // GH#609
{
Reset(true);
// if (g_bDisableDirectSound || g_bDisableDirectSoundMockingboard)
// return;
//
// _ASSERT(MockingboardVoice.lpDSBvoice);
// DSVoiceStop(&MockingboardVoice); // Reason: 'MB voice is playing' then loading a save-state where 'no MB present'
// NB. ssi263.Stop() already done by Reset()
}
//-----------------------------------------------------------------------------
// NB. Called when /g_fCurrentCLK6502/ changes
void MockingboardCard::ReinitializeClock(void)
{

View File

@ -28,7 +28,6 @@ public:
BYTE IOWriteInternal(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG nExecutedCycles);
BYTE PhasorIOInternal(WORD PC, WORD nAddr, BYTE bWrite, BYTE nValue, ULONG nExecutedCycles);
void InitializeForLoadingSnapshot(void);
void ReinitializeClock(void);
void MuteControl(bool mute);
void UpdateCycles(ULONG executedCycles);

View File

@ -53,11 +53,11 @@ void MockingboardCardManager::ReinitializeClock(void)
void MockingboardCardManager::InitializeForLoadingSnapshot(void)
{
for (UINT i = SLOT0; i < NUM_SLOTS; i++)
{
if (IsMockingboard(i))
dynamic_cast<MockingboardCard&>(GetCardMgr().GetRef(i)).InitializeForLoadingSnapshot();
}
if (g_bDisableDirectSound || g_bDisableDirectSoundMockingboard)
return;
if (MockingboardVoice.lpDSBvoice);
DSVoiceStop(&MockingboardVoice); // Reason: 'MB voice is playing' then loading a save-state where 'no MB present' (GH#609)
}
void MockingboardCardManager::MuteControl(bool mute)