mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 23:55:40 +00:00
CPU/Recompiler: Don't try fastmem for RAM mirrors
This commit is contained in:
parent
875b0b91f1
commit
7f795d25aa
|
@ -314,28 +314,31 @@ void UpdateFastmemViews(bool enabled, bool isolate_cache)
|
|||
{
|
||||
// KUSEG - cached
|
||||
MapRAM(0x00000000, !isolate_cache);
|
||||
//MapRAM(0x00200000, !isolate_cache);
|
||||
//MapRAM(0x00400000, !isolate_cache);
|
||||
//MapRAM(0x00600000, !isolate_cache);
|
||||
// MapRAM(0x00200000, !isolate_cache);
|
||||
// MapRAM(0x00400000, !isolate_cache);
|
||||
// MapRAM(0x00600000, !isolate_cache);
|
||||
|
||||
// KSEG0 - cached
|
||||
MapRAM(0x80000000, !isolate_cache);
|
||||
//MapRAM(0x80200000, !isolate_cache);
|
||||
//MapRAM(0x80400000, !isolate_cache);
|
||||
//MapRAM(0x80600000, !isolate_cache);
|
||||
// MapRAM(0x80200000, !isolate_cache);
|
||||
// MapRAM(0x80400000, !isolate_cache);
|
||||
// MapRAM(0x80600000, !isolate_cache);
|
||||
}
|
||||
|
||||
// KSEG1 - uncached
|
||||
MapRAM(0xA0000000, true);
|
||||
//MapRAM(0xA0200000, true);
|
||||
//MapRAM(0xA0400000, true);
|
||||
//MapRAM(0xA0600000, true);
|
||||
// MapRAM(0xA0200000, true);
|
||||
// MapRAM(0xA0400000, true);
|
||||
// MapRAM(0xA0600000, true);
|
||||
}
|
||||
|
||||
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