diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index 81eaf8b53a..67260df724 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -490,13 +490,9 @@ void SetState(EState _State) break; case CORE_PAUSE: CCPU::EnableStepping(true); // Break - CPluginManager::GetInstance().GetDSP()->DSP_ClearAudioBuffer(); - CPluginManager::GetInstance().EmuStateChange(PLUGIN_EMUSTATE_PAUSE); break; case CORE_RUN: CCPU::EnableStepping(false); - CPluginManager::GetInstance().GetDSP()->DSP_ClearAudioBuffer(); - CPluginManager::GetInstance().EmuStateChange(PLUGIN_EMUSTATE_PLAY); break; default: PanicAlert("Invalid state"); diff --git a/Source/Core/Core/Src/HW/CPU.cpp b/Source/Core/Core/Src/HW/CPU.cpp index bdf52370a6..1e1a2bcfc7 100644 --- a/Source/Core/Core/Src/HW/CPU.cpp +++ b/Source/Core/Core/Src/HW/CPU.cpp @@ -18,6 +18,7 @@ #include "Common.h" #include "Thread.h" +#include "../PluginManager.h" #include "../PowerPC/PowerPC.h" #include "../Host.h" #include "../Core.h" @@ -117,12 +118,14 @@ void CCPU::EnableStepping(const bool _bStepping) PowerPC::Pause(); // TODO(ector): why a sleep? Host_SetDebugMode(true); + CPluginManager::GetInstance().EmuStateChange(PLUGIN_EMUSTATE_PAUSE); } else { Host_SetDebugMode(false); PowerPC::Start(); m_StepEvent.Set(); + CPluginManager::GetInstance().EmuStateChange(PLUGIN_EMUSTATE_PLAY); } } diff --git a/Source/PluginSpecs/pluginspecs_dsp.h b/Source/PluginSpecs/pluginspecs_dsp.h index 5a58cc59d6..ae9ffef048 100644 --- a/Source/PluginSpecs/pluginspecs_dsp.h +++ b/Source/PluginSpecs/pluginspecs_dsp.h @@ -109,7 +109,7 @@ EXPORT void CALL DSP_StopSoundStream(); // __________________________________________________________________________________________________ // Function: DSP_ClearAudioBuffer // Purpose: Stops audio. Called while pausing to stop the annoying noises. -EXPORT void CALL DSP_ClearAudioBuffer(); +EXPORT void CALL DSP_ClearAudioBuffer(bool mute); #include "ExportEpilog.h" #endif diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp index f6e2679fb7..3b53a101d1 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp @@ -245,6 +245,7 @@ void DoState(unsigned char **ptr, int mode) void EmuStateChange(PLUGIN_EMUSTATE newState) { + DSP_ClearAudioBuffer((newState == PLUGIN_EMUSTATE_PLAY) ? false : true); } // Mailbox fuctions @@ -356,8 +357,8 @@ void DSP_SendAIBuffer(unsigned int address, unsigned int num_samples) soundStream->Update(); } -void DSP_ClearAudioBuffer() +void DSP_ClearAudioBuffer(bool mute) { if (soundStream) - soundStream->Clear(!!*g_dspInitialize.pEmulatorState); + soundStream->Clear(mute); } diff --git a/Source/Plugins/Plugin_DSP_LLE/Src/main.cpp b/Source/Plugins/Plugin_DSP_LLE/Src/main.cpp index e29221df7c..cb06e55f54 100644 --- a/Source/Plugins/Plugin_DSP_LLE/Src/main.cpp +++ b/Source/Plugins/Plugin_DSP_LLE/Src/main.cpp @@ -192,6 +192,7 @@ void DoState(unsigned char **ptr, int mode) void EmuStateChange(PLUGIN_EMUSTATE newState) { + DSP_ClearAudioBuffer((newState == PLUGIN_EMUSTATE_PLAY) ? false : true); } void DllDebugger(HWND _hParent, bool Show) @@ -400,9 +401,9 @@ void DSP_SendAIBuffer(unsigned int address, unsigned int num_samples) soundStream->Update(); } -void DSP_ClearAudioBuffer() +void DSP_ClearAudioBuffer(bool mute) { if (soundStream) - soundStream->Clear((*g_dspInitialize.pEmulatorState) ? true : false); + soundStream->Clear(mute); }