Reverse endianness of achievement memory peeks

rcheevos expects these multi-byte peeks to have the opposite endianness so they need to be swapped before rcheevos gets them.
This commit is contained in:
LillyJadeKatrin 2024-01-29 11:37:08 -05:00
parent 8482a50154
commit fd99a5db9a
1 changed files with 10 additions and 8 deletions

View File

@ -711,15 +711,17 @@ u32 AchievementManager::MemoryPeeker(u32 address, u32 num_bytes, void* ud)
.value_or(PowerPC::ReadResult<u8>(false, 0u))
.value;
case 2:
return m_system->GetMMU()
return Common::swap16(
m_system->GetMMU()
.HostTryReadU16(threadguard, address, PowerPC::RequestedAddressSpace::Physical)
.value_or(PowerPC::ReadResult<u16>(false, 0u))
.value;
.value);
case 4:
return m_system->GetMMU()
return Common::swap32(
m_system->GetMMU()
.HostTryReadU32(threadguard, address, PowerPC::RequestedAddressSpace::Physical)
.value_or(PowerPC::ReadResult<u32>(false, 0u))
.value;
.value);
default:
ASSERT(false);
return 0u;