mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-23 14:25:37 +00:00
CPU/Recompiler: Don't try fastmem for RAM mirrors
This commit is contained in:
parent
875b0b91f1
commit
7f795d25aa
|
@ -335,7 +335,10 @@ void UpdateFastmemViews(bool enabled, bool isolate_cache)
|
|||
bool CanUseFastmemForAddress(VirtualMemoryAddress address)
|
||||
{
|
||||
const PhysicalMemoryAddress paddr = address & CPU::PHYSICAL_MEMORY_ADDRESS_MASK;
|
||||
return IsRAMAddress(paddr);
|
||||
|
||||
// Currently since we don't map the mirrors, don't use fastmem for them.
|
||||
// This is because the swapping of page code bits for SMC is too expensive.
|
||||
return (paddr < RAM_SIZE);
|
||||
}
|
||||
|
||||
bool IsRAMCodePage(u32 index)
|
||||
|
|
|
@ -42,9 +42,15 @@ Value CodeGenerator::EmitLoadGuestMemory(const CodeBlockInstruction& cbi, const
|
|||
Value result = m_register_cache.AllocateScratch(size);
|
||||
|
||||
if (g_settings.IsUsingFastmem() && Bus::IsRAMAddress(static_cast<u32>(address.constant_value)))
|
||||
EmitLoadGuestRAMFastmem(address, size, result);
|
||||
{
|
||||
// have to mask away the high bits for mirrors, since we don't map them in fastmem
|
||||
EmitLoadGuestRAMFastmem(Value::FromConstantU32(static_cast<u32>(address.constant_value) & Bus::RAM_MASK), size,
|
||||
result);
|
||||
}
|
||||
else
|
||||
{
|
||||
EmitLoadGlobal(result.GetHostRegister(), size, ptr);
|
||||
}
|
||||
|
||||
m_delayed_cycles_add += read_ticks;
|
||||
return result;
|
||||
|
|
Loading…
Reference in a new issue