diff --git a/Core/HLE/sceKernel.cpp b/Core/HLE/sceKernel.cpp index ae8b9e4763..b7372f15bf 100644 --- a/Core/HLE/sceKernel.cpp +++ b/Core/HLE/sceKernel.cpp @@ -15,10 +15,11 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. -#include "HLE.h" -#include "../MIPS/MIPS.h" -#include "../MIPS/MIPSCodeUtils.h" -#include "../MIPS/MIPSInt.h" +#include "Core/Config.h" +#include "Core/HLE/HLE.h" +#include "Core/MIPS/MIPS.h" +#include "Core/MIPS/MIPSCodeUtils.h" +#include "Core/MIPS/MIPSInt.h" #include "Common/LogManager.h" #include "../FileSystems/FileSystem.h" @@ -161,6 +162,11 @@ void __KernelShutdown() void __KernelDoState(PointerWrap &p) { + std::string git_version = PPSSPP_GIT_VERSION; + p.Do(git_version); + if (git_version != PPSSPP_GIT_VERSION) + WARN_LOG(HLE, "Warning: this savestate was generated by a different version of PPSSPP. It may not load properly."); + p.Do(kernelRunning); kernelObjects.DoState(p); p.DoMarker("KernelObjects"); diff --git a/Core/SaveState.cpp b/Core/SaveState.cpp index a320c4e70b..fcc9d19f1a 100644 --- a/Core/SaveState.cpp +++ b/Core/SaveState.cpp @@ -111,6 +111,11 @@ namespace SaveState Enqueue(Operation(SAVESTATE_SAVE, filename, callback, cbUserData)); } + void Verify(Callback callback, void *cbUserData) + { + Enqueue(Operation(SAVESTATE_VERIFY, std::string(""), callback, cbUserData)); + } + // Slot utilities @@ -148,9 +153,10 @@ namespace SaveState (*callback)(false, cbUserData); } - void HasSaveInSlot(int slot) + bool HasSaveInSlot(int slot) { std::string fn = GenerateSaveSlotFilename(slot); + return File::Exists(fn); } bool operator < (const tm &t1, const tm &t2) { @@ -186,11 +192,6 @@ namespace SaveState } - void Verify(Callback callback, void *cbUserData) - { - Enqueue(Operation(SAVESTATE_VERIFY, std::string(""), callback, cbUserData)); - } - std::vector Flush() { std::lock_guard guard(mutex); diff --git a/Core/SaveState.h b/Core/SaveState.h index 7ca6d143b0..8023756ecc 100644 --- a/Core/SaveState.h +++ b/Core/SaveState.h @@ -24,14 +24,14 @@ namespace SaveState typedef void (*Callback)(bool status, void *cbUserData); // TODO: Better place for this? - const int REVISION = 1; + const int REVISION = 2; const int SAVESTATESLOTS = 4; void Init(); void SaveSlot(int slot, Callback callback, void *cbUserData = 0); void LoadSlot(int slot, Callback callback, void *cbUserData = 0); - void HasSaveInSlot(int slot); + bool HasSaveInSlot(int slot); int GetNewestSlot(); // Load the specified file into the current state (async.)