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.
This commit is contained in:
get 2023-04-17 03:07:07 -05:00
parent 8fbfee03ab
commit 0948f0ef69
2 changed files with 3 additions and 7 deletions

View File

@ -391,11 +391,11 @@ void Cache::DoState(PointerWrap& p)
if ((valid[set] & (1 << way)) != 0) if ((valid[set] & (1 << way)) != 0)
{ {
if (addrs[set][way] & CACHE_VMEM_BIT) 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) 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 else
lookup_table[(addrs[set][way] & memory.GetRamMask()) >> 5] = 0xff; lookup_table[(addrs[set][way] & memory.GetRamMask()) >> 5] = way;
} }
} }
} }

View File

@ -134,10 +134,6 @@ void PowerPCManager::DoState(PointerWrap& p)
INFO_LOG_FMT(POWERPC, "Flushing data cache"); INFO_LOG_FMT(POWERPC, "Flushing data cache");
m_ppc_state.dCache.FlushAll(); m_ppc_state.dCache.FlushAll();
} }
else
{
m_ppc_state.dCache.Reset();
}
RoundingModeUpdated(m_ppc_state); RoundingModeUpdated(m_ppc_state);