Added a check for out of bounds memory accesses. Fixes Avatar: The Last Airbender (GC).

This commit is contained in:
skidau 2012-08-17 22:14:35 +10:00
parent 08a9c66037
commit 28bc5eca37
1 changed files with 6 additions and 3 deletions

View File

@ -635,6 +635,7 @@ u8 *GetPointer(const u32 _Address)
{
case 0x0:
case 0x8:
if ((_Address & 0xfffffff) < REALRAM_SIZE)
return m_pPhysicalRAM + (_Address & RAM_MASK);
case 0xc:
switch (_Address >> 24)
@ -647,6 +648,7 @@ u8 *GetPointer(const u32 _Address)
break;
default:
if ((_Address & 0xfffffff) < REALRAM_SIZE)
return m_pPhysicalRAM + (_Address & RAM_MASK);
}
@ -654,6 +656,7 @@ u8 *GetPointer(const u32 _Address)
case 0x9:
case 0xd:
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
if ((_Address & 0xfffffff) < EXRAM_SIZE)
return m_pPhysicalEXRAM + (_Address & EXRAM_MASK);
else
break;