mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Improve logging on bad memory access from RA
This commit is contained in:
parent
54a378f145
commit
eaa1975ac9
1 changed files with 8 additions and 3 deletions
|
@ -2039,10 +2039,15 @@ unsigned Achievements::PeekMemory(unsigned address, unsigned num_bytes, void *ud
|
|||
// Unclear why achievements are defined with this offset, but they are and it can't be changed now, so we roll with it.
|
||||
address += 0x08000000;
|
||||
|
||||
if (!Memory::IsValidAddress(address)) {
|
||||
WARN_LOG(G3D, "RetroAchievements PeekMemory: Bad address %08x (%d bytes)", address, num_bytes);
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (num_bytes) {
|
||||
case 1: return Memory::Read_U8(address);
|
||||
case 2: return Memory::Read_U16(address);
|
||||
case 4: return Memory::Read_U32(address);
|
||||
case 1: return Memory::ReadUnchecked_U8(address);
|
||||
case 2: return Memory::ReadUnchecked_U16(address);
|
||||
case 4: return Memory::ReadUnchecked_U32(address);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue