diff options
| author | LillyJadeKatrin <lilly.kitty.1988@gmail.com> | 2024-01-29 11:37:08 -0500 |
|---|---|---|
| committer | LillyJadeKatrin <lilly.kitty.1988@gmail.com> | 2024-01-29 11:55:49 -0500 |
| commit | fd99a5db9a0e740394fd736f9e109e660a74b8b6 (patch) | |
| tree | dc443e827273e9637f8a14e15b1dc543a59976a7 /Source/Core | |
| parent | 8482a50154648f653104d7da0b8d371efb720565 (diff) | |
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.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/AchievementManager.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Source/Core/Core/AchievementManager.cpp b/Source/Core/Core/AchievementManager.cpp index eb5bc2a891..01e60edb82 100644 --- a/Source/Core/Core/AchievementManager.cpp +++ b/Source/Core/Core/AchievementManager.cpp @@ -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() - .HostTryReadU16(threadguard, address, PowerPC::RequestedAddressSpace::Physical) - .value_or(PowerPC::ReadResult<u16>(false, 0u)) - .value; + return Common::swap16( + m_system->GetMMU() + .HostTryReadU16(threadguard, address, PowerPC::RequestedAddressSpace::Physical) + .value_or(PowerPC::ReadResult<u16>(false, 0u)) + .value); case 4: - return m_system->GetMMU() - .HostTryReadU32(threadguard, address, PowerPC::RequestedAddressSpace::Physical) - .value_or(PowerPC::ReadResult<u32>(false, 0u)) - .value; + return Common::swap32( + m_system->GetMMU() + .HostTryReadU32(threadguard, address, PowerPC::RequestedAddressSpace::Physical) + .value_or(PowerPC::ReadResult<u32>(false, 0u)) + .value); default: ASSERT(false); return 0u; |
