Merge pull request #12538 from LillyJadeKatrin/retroachievements-bugfix

Reverse endianness of achievement memory peeks
This commit is contained in:
Admiral H. Curtiss 2024-01-30 00:52:18 +01:00 committed by GitHub
commit 1e2fb41d0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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_or(PowerPC::ReadResult<u8>(false, 0u))
.value; .value;
case 2: case 2:
return m_system->GetMMU() return Common::swap16(
m_system->GetMMU()
.HostTryReadU16(threadguard, address, PowerPC::RequestedAddressSpace::Physical) .HostTryReadU16(threadguard, address, PowerPC::RequestedAddressSpace::Physical)
.value_or(PowerPC::ReadResult<u16>(false, 0u)) .value_or(PowerPC::ReadResult<u16>(false, 0u))
.value; .value);
case 4: case 4:
return m_system->GetMMU() return Common::swap32(
m_system->GetMMU()
.HostTryReadU32(threadguard, address, PowerPC::RequestedAddressSpace::Physical) .HostTryReadU32(threadguard, address, PowerPC::RequestedAddressSpace::Physical)
.value_or(PowerPC::ReadResult<u32>(false, 0u)) .value_or(PowerPC::ReadResult<u32>(false, 0u))
.value; .value);
default: default:
ASSERT(false); ASSERT(false);
return 0u; return 0u;