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 "UCodes/UCodes.h"
|
||||||
#include "../AudioInterface.h"
|
#include "../AudioInterface.h"
|
||||||
#include "ConfigManager.h"
|
#include "ConfigManager.h"
|
||||||
|
#include "Core.h"
|
||||||
|
|
||||||
DSPHLE::DSPHLE() {
|
DSPHLE::DSPHLE() {
|
||||||
m_InitMixer = false;
|
m_InitMixer = false;
|
||||||
|
@ -130,6 +131,14 @@ void DSPHLE::SwapUCode(u32 _crc)
|
||||||
|
|
||||||
void DSPHLE::DoState(PointerWrap &p)
|
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;
|
bool prevInitMixer = m_InitMixer;
|
||||||
p.Do(m_InitMixer);
|
p.Do(m_InitMixer);
|
||||||
if (prevInitMixer != m_InitMixer && p.GetMode() == PointerWrap::MODE_READ)
|
if (prevInitMixer != m_InitMixer && p.GetMode() == PointerWrap::MODE_READ)
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "IniFile.h"
|
#include "IniFile.h"
|
||||||
#include "ConfigManager.h"
|
#include "ConfigManager.h"
|
||||||
#include "CPUDetect.h"
|
#include "CPUDetect.h"
|
||||||
|
#include "Core.h"
|
||||||
|
|
||||||
#include "DSPLLEGlobals.h" // Local
|
#include "DSPLLEGlobals.h" // Local
|
||||||
#include "DSP/DSPInterpreter.h"
|
#include "DSP/DSPInterpreter.h"
|
||||||
|
@ -56,6 +57,14 @@ Common::Event ppcEvent;
|
||||||
|
|
||||||
void DSPLLE::DoState(PointerWrap &p)
|
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.r);
|
||||||
p.Do(g_dsp.pc);
|
p.Do(g_dsp.pc);
|
||||||
#if PROFILE
|
#if PROFILE
|
||||||
|
|
|
@ -71,7 +71,7 @@ static Common::Event g_compressAndDumpStateSyncEvent;
|
||||||
static std::thread g_save_thread;
|
static std::thread g_save_thread;
|
||||||
|
|
||||||
// Don't forget to increase this after doing changes on the savestate system
|
// 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
|
struct StateHeader
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue