diff --git a/src/core/bus.cpp b/src/core/bus.cpp index 842ae6994..0d443d7e3 100644 --- a/src/core/bus.cpp +++ b/src/core/bus.cpp @@ -1914,7 +1914,10 @@ static ALWAYS_INLINE bool DoSafeMemoryAccess(VirtualMemoryAddress address, u32& { address &= PHYSICAL_MEMORY_ADDRESS_MASK; if ((address & DCACHE_LOCATION_MASK) == DCACHE_LOCATION) - return DoScratchpadAccess(address, value); + { + DoScratchpadAccess(address, value); + return true; + } } break; @@ -1937,16 +1940,18 @@ static ALWAYS_INLINE bool DoSafeMemoryAccess(VirtualMemoryAddress address, u32& if (address < RAM_MIRROR_END) { - return DoRAMAccess(address, value); + DoRAMAccess(address, value); + return true; } - else if (address >= BIOS_BASE && address < (BIOS_BASE + BIOS_SIZE)) + if constexpr (type == MemoryAccessType::Read) { - return DoBIOSAccess(static_cast(address - BIOS_BASE), value); - } - else - { - return false; + if (address >= BIOS_BASE && address < (BIOS_BASE + BIOS_SIZE)) + { + DoBIOSAccess(static_cast(address - BIOS_BASE), value); + return true; + } } + return false; } bool SafeReadMemoryByte(VirtualMemoryAddress addr, u8* value)