From c991904e043fd86ca44cf4b57388d0d9440b1588 Mon Sep 17 00:00:00 2001 From: CrystalGamma Date: Tue, 13 Jul 2021 10:36:17 +0200 Subject: [PATCH] PowerPC: Add reservation monitor to save state --- Source/Core/Core/PowerPC/PowerPC.cpp | 3 +++ Source/Core/Core/PowerPC/PowerPC.h | 3 +-- Source/Core/Core/State.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/PowerPC/PowerPC.cpp b/Source/Core/Core/PowerPC/PowerPC.cpp index 2bc74c031f..f838911927 100644 --- a/Source/Core/Core/PowerPC/PowerPC.cpp +++ b/Source/Core/Core/PowerPC/PowerPC.cpp @@ -125,6 +125,9 @@ void DoState(PointerWrap& p) p.Do(ppcState.pagetable_base); p.Do(ppcState.pagetable_hashmask); + p.Do(ppcState.reserve); + p.Do(ppcState.reserve_address); + ppcState.iCache.DoState(p); if (p.GetMode() == PointerWrap::MODE_READ) diff --git a/Source/Core/Core/PowerPC/PowerPC.h b/Source/Core/Core/PowerPC/PowerPC.h index 9586bbe3ab..b0d5d18b46 100644 --- a/Source/Core/Core/PowerPC/PowerPC.h +++ b/Source/Core/Core/PowerPC/PowerPC.h @@ -167,8 +167,7 @@ struct PowerPCState InstructionCache iCache; - // TODO: These should really be in the save state, although it's unlikely to matter much. - // They are for lwarx and its friend stwcxd. + // Reservation monitor for lwarx and its friend stwcxd. bool reserve; u32 reserve_address; diff --git a/Source/Core/Core/State.cpp b/Source/Core/Core/State.cpp index 77e31e1ac0..49b4fecde6 100644 --- a/Source/Core/Core/State.cpp +++ b/Source/Core/Core/State.cpp @@ -73,7 +73,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 -constexpr u32 STATE_VERSION = 133; // Last changed in PR 9600 +constexpr u32 STATE_VERSION = 134; // Last changed in PR 7896 // Maps savestate versions to Dolphin versions. // Versions after 42 don't need to be added to this list,