mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
Abort load state if it uses a different dsp engine, instead of crashing.
This commit is contained in:
parent
0e4b07ddf9
commit
a450ba4420
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user