CPU/Recompiler: Prevent using fastmem when cache is isolated

No point even trying since it's just going to fault.
This commit is contained in:
Connor McLaughlin
2021-04-12 02:08:37 +10:00
parent 922d320523
commit e087e6f3a2
12 changed files with 69 additions and 33 deletions

View File

@ -99,6 +99,8 @@ void Initialize()
s_last_breakpoint_check_pc = INVALID_BREAKPOINT_PC;
s_single_step = false;
UpdateFastmemBase();
GTE::Initialize();
if (g_settings.gpu_pgxp_enable)
@ -131,6 +133,7 @@ void Reset()
g_state.cop0_regs.cause.bits = 0;
ClearICache();
UpdateFastmemBase();
GTE::Reset();
@ -195,6 +198,14 @@ bool DoState(StateWrapper& sw)
return !sw.HasError();
}
void UpdateFastmemBase()
{
if (g_state.cop0_regs.sr.Isc)
g_state.fastmem_base = nullptr;
else
g_state.fastmem_base = Bus::GetFastmemBase();
}
ALWAYS_INLINE_RELEASE void SetPC(u32 new_pc)
{
DebugAssert(Common::IsAlignedPow2(new_pc, 4));
@ -1973,14 +1984,6 @@ bool InterpretInstructionPGXP()
return g_state.exception_raised;
}
void UpdateFastmemMapping()
{
if (g_state.cop0_regs.sr.Isc)
g_state.fastmem_base = nullptr;
else
g_state.fastmem_base = Bus::GetFastmemBase();
}
} // namespace Recompiler::Thunks
} // namespace CPU