From 0948f0ef690bfc19c89d8f7bf3552806b6b36430 Mon Sep 17 00:00:00 2001 From: get <45425365+Minty-Meeo@users.noreply.github.com> Date: Mon, 17 Apr 2023 03:07:07 -0500 Subject: [PATCH] Fix PPCCache savestate behavior PR #11183 regressed the lookup table reconstruction and, for some reason, added an else clause that clobbered the dCache whenever dCache emulation is turned on. --- Source/Core/Core/PowerPC/PPCCache.cpp | 6 +++--- Source/Core/Core/PowerPC/PowerPC.cpp | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Source/Core/Core/PowerPC/PPCCache.cpp b/Source/Core/Core/PowerPC/PPCCache.cpp index 03e5ef3a1a..0b3f23079a 100644 --- a/Source/Core/Core/PowerPC/PPCCache.cpp +++ b/Source/Core/Core/PowerPC/PPCCache.cpp @@ -391,11 +391,11 @@ void Cache::DoState(PointerWrap& p) if ((valid[set] & (1 << way)) != 0) { if (addrs[set][way] & CACHE_VMEM_BIT) - lookup_table_vmem[(addrs[set][way] & memory.GetFakeVMemMask()) >> 5] = 0xff; + lookup_table_vmem[(addrs[set][way] & memory.GetFakeVMemMask()) >> 5] = way; else if (addrs[set][way] & CACHE_EXRAM_BIT) - lookup_table_ex[(addrs[set][way] & memory.GetExRamMask()) >> 5] = 0xff; + lookup_table_ex[(addrs[set][way] & memory.GetExRamMask()) >> 5] = way; else - lookup_table[(addrs[set][way] & memory.GetRamMask()) >> 5] = 0xff; + lookup_table[(addrs[set][way] & memory.GetRamMask()) >> 5] = way; } } } diff --git a/Source/Core/Core/PowerPC/PowerPC.cpp b/Source/Core/Core/PowerPC/PowerPC.cpp index 0f88f696a8..30c9cb2b14 100644 --- a/Source/Core/Core/PowerPC/PowerPC.cpp +++ b/Source/Core/Core/PowerPC/PowerPC.cpp @@ -134,10 +134,6 @@ void PowerPCManager::DoState(PointerWrap& p) INFO_LOG_FMT(POWERPC, "Flushing data cache"); m_ppc_state.dCache.FlushAll(); } - else - { - m_ppc_state.dCache.Reset(); - } RoundingModeUpdated(m_ppc_state);