Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #9739 from phire/GetFakeVMemMask
Use Correct mask for Fake VMem
  • Loading branch information
lioncash committed May 22, 2021
2 parents 77e5d79 + 610613e commit 213ddc5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/Core/Core/PowerPC/MMU.cpp
Expand Up @@ -239,7 +239,7 @@ static T ReadFromHardware(u32 em_address)
if (Memory::m_pFakeVMEM && ((em_address & 0xFE000000) == 0x7E000000))
{
T value;
std::memcpy(&value, &Memory::m_pFakeVMEM[em_address & Memory::GetRamMask()], sizeof(T));
std::memcpy(&value, &Memory::m_pFakeVMEM[em_address & Memory::GetFakeVMemMask()], sizeof(T));
return bswap(value);
}

Expand Down Expand Up @@ -330,7 +330,8 @@ static void WriteToHardware(u32 em_address, const T data)
if (Memory::m_pFakeVMEM && ((em_address & 0xFE000000) == 0x7E000000))
{
const T swapped_data = bswap(data);
std::memcpy(&Memory::m_pFakeVMEM[em_address & Memory::GetRamMask()], &swapped_data, sizeof(T));
std::memcpy(&Memory::m_pFakeVMEM[em_address & Memory::GetFakeVMemMask()], &swapped_data,
sizeof(T));
return;
}

Expand Down

0 comments on commit 213ddc5

Please sign in to comment.