mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-17 22:25:37 +00:00
parent
959a555274
commit
49c7767ed4
|
@ -1,4 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "pse/types.h"
|
#include "types.h"
|
||||||
|
|
||||||
constexpr u32 SAVE_STATE_VERSION = 1;
|
static constexpr u32 SAVE_STATE_MAGIC = 0x43435544;
|
||||||
|
static constexpr u32 SAVE_STATE_VERSION = 1;
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "mdec.h"
|
#include "mdec.h"
|
||||||
#include "memory_card.h"
|
#include "memory_card.h"
|
||||||
#include "pad.h"
|
#include "pad.h"
|
||||||
|
#include "save_state_version.h"
|
||||||
#include "sio.h"
|
#include "sio.h"
|
||||||
#include "spu.h"
|
#include "spu.h"
|
||||||
#include "timers.h"
|
#include "timers.h"
|
||||||
|
@ -271,6 +272,20 @@ bool System::CreateGPU(GPURenderer renderer)
|
||||||
|
|
||||||
bool System::DoState(StateWrapper& sw)
|
bool System::DoState(StateWrapper& sw)
|
||||||
{
|
{
|
||||||
|
u32 magic = SAVE_STATE_MAGIC;
|
||||||
|
u32 version = SAVE_STATE_VERSION;
|
||||||
|
sw.Do(&magic);
|
||||||
|
if (magic != SAVE_STATE_MAGIC)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
sw.Do(&version);
|
||||||
|
if (version != SAVE_STATE_VERSION)
|
||||||
|
{
|
||||||
|
m_host_interface->ReportFormattedError("Save state is incompatible: expecting version %u but state is version %u.",
|
||||||
|
SAVE_STATE_VERSION, version);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!sw.DoMarker("System"))
|
if (!sw.DoMarker("System"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue