diff --git a/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp b/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp index b22be91104..dac977922b 100644 --- a/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp +++ b/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp @@ -27,6 +27,7 @@ #include "UCodes/UCodes.h" #include "../AudioInterface.h" #include "ConfigManager.h" +#include "Core.h" DSPHLE::DSPHLE() { m_InitMixer = false; @@ -130,6 +131,14 @@ void DSPHLE::SwapUCode(u32 _crc) void DSPHLE::DoState(PointerWrap &p) { + bool isHLE = true; + p.Do(isHLE); + if (isHLE != true && p.GetMode() == PointerWrap::MODE_READ) + { + Core::DisplayMessage("Save states made with the LLE audio engine are incompatible with the HLE DSP engine. Aborting load state.", 3000); + p.SetMode(PointerWrap::MODE_VERIFY); + return; + } bool prevInitMixer = m_InitMixer; p.Do(m_InitMixer); if (prevInitMixer != m_InitMixer && p.GetMode() == PointerWrap::MODE_READ) diff --git a/Source/Core/Core/Src/HW/DSPLLE/DSPLLE.cpp b/Source/Core/Core/Src/HW/DSPLLE/DSPLLE.cpp index 92053053de..2dbb7a8292 100644 --- a/Source/Core/Core/Src/HW/DSPLLE/DSPLLE.cpp +++ b/Source/Core/Core/Src/HW/DSPLLE/DSPLLE.cpp @@ -26,6 +26,7 @@ #include "IniFile.h" #include "ConfigManager.h" #include "CPUDetect.h" +#include "Core.h" #include "DSPLLEGlobals.h" // Local #include "DSP/DSPInterpreter.h" @@ -56,6 +57,14 @@ Common::Event ppcEvent; void DSPLLE::DoState(PointerWrap &p) { + bool isHLE = false; + p.Do(isHLE); + if (isHLE != false && p.GetMode() == PointerWrap::MODE_READ) + { + Core::DisplayMessage("Save states made with the HLE audio engine are incompatible with the LLE DSP engine. Aborting load state.", 3000); + p.SetMode(PointerWrap::MODE_VERIFY); + return; + } p.Do(g_dsp.r); p.Do(g_dsp.pc); #if PROFILE diff --git a/Source/Core/Core/Src/State.cpp b/Source/Core/Core/Src/State.cpp index 084a94e5f6..0facf2f387 100644 --- a/Source/Core/Core/Src/State.cpp +++ b/Source/Core/Core/Src/State.cpp @@ -71,7 +71,7 @@ static Common::Event g_compressAndDumpStateSyncEvent; static std::thread g_save_thread; // Don't forget to increase this after doing changes on the savestate system -static const u32 STATE_VERSION = 13; +static const u32 STATE_VERSION = 14; struct StateHeader {