mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-18 06:25:37 +00:00
Merge pull request #2624 from CookiePLMonster/fix-safe-unaligned-writes
Make DoSafeMemoryAccess return true properly for RAM, BIOS, dcache writes
This commit is contained in:
commit
8864b48c02
|
@ -1914,7 +1914,10 @@ static ALWAYS_INLINE bool DoSafeMemoryAccess(VirtualMemoryAddress address, u32&
|
||||||
{
|
{
|
||||||
address &= PHYSICAL_MEMORY_ADDRESS_MASK;
|
address &= PHYSICAL_MEMORY_ADDRESS_MASK;
|
||||||
if ((address & DCACHE_LOCATION_MASK) == DCACHE_LOCATION)
|
if ((address & DCACHE_LOCATION_MASK) == DCACHE_LOCATION)
|
||||||
return DoScratchpadAccess<type, size>(address, value);
|
{
|
||||||
|
DoScratchpadAccess<type, size>(address, value);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1937,16 +1940,18 @@ static ALWAYS_INLINE bool DoSafeMemoryAccess(VirtualMemoryAddress address, u32&
|
||||||
|
|
||||||
if (address < RAM_MIRROR_END)
|
if (address < RAM_MIRROR_END)
|
||||||
{
|
{
|
||||||
return DoRAMAccess<type, size, true>(address, value);
|
DoRAMAccess<type, size, true>(address, value);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
else if (address >= BIOS_BASE && address < (BIOS_BASE + BIOS_SIZE))
|
if constexpr (type == MemoryAccessType::Read)
|
||||||
{
|
{
|
||||||
return DoBIOSAccess<type, size>(static_cast<u32>(address - BIOS_BASE), value);
|
if (address >= BIOS_BASE && address < (BIOS_BASE + BIOS_SIZE))
|
||||||
}
|
{
|
||||||
else
|
DoBIOSAccess<type, size>(static_cast<u32>(address - BIOS_BASE), value);
|
||||||
{
|
return true;
|
||||||
return false;
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SafeReadMemoryByte(VirtualMemoryAddress addr, u8* value)
|
bool SafeReadMemoryByte(VirtualMemoryAddress addr, u8* value)
|
||||||
|
|
Loading…
Reference in a new issue