From 9d80c48d6f67afe21441776d8acddaf9f23221a6 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Fri, 29 Jan 2021 02:45:48 +1000 Subject: [PATCH] CPU: Fix icache missing from save state --- src/core/cpu_core.cpp | 12 +++++++++++- src/core/save_state_version.h | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/core/cpu_core.cpp b/src/core/cpu_core.cpp index f759d6578..f7cd0f48a 100644 --- a/src/core/cpu_core.cpp +++ b/src/core/cpu_core.cpp @@ -175,9 +175,19 @@ bool DoState(StateWrapper& sw) if (!GTE::DoState(sw)) return false; + if (sw.GetVersion() < 48) + { + DebugAssert(sw.IsReading()); + ClearICache(); + } + else + { + sw.Do(&g_state.icache_tags); + sw.Do(&g_state.icache_data); + } + if (sw.IsReading()) { - ClearICache(); if (g_settings.gpu_pgxp_enable) PGXP::Initialize(); } diff --git a/src/core/save_state_version.h b/src/core/save_state_version.h index 59b8ea8bc..0cbf69980 100644 --- a/src/core/save_state_version.h +++ b/src/core/save_state_version.h @@ -2,7 +2,7 @@ #include "types.h" static constexpr u32 SAVE_STATE_MAGIC = 0x43435544; -static constexpr u32 SAVE_STATE_VERSION = 47; +static constexpr u32 SAVE_STATE_VERSION = 48; static constexpr u32 SAVE_STATE_MINIMUM_VERSION = 42; static_assert(SAVE_STATE_VERSION >= SAVE_STATE_MINIMUM_VERSION);