all repos — mgba @ 063605a2167e700278659ae83e1b006517700487

mGBA Game Boy Advance Emulator

GBA Memory: Fix executing code from OBJ region of VRAM
Jeffrey Pfau jeffrey@endrift.com
Thu, 21 Apr 2016 23:44:57 -0700
commit

063605a2167e700278659ae83e1b006517700487

parent

3a51c59768a0e4bbba9dc516b0554eb520474c05

2 files changed, 8 insertions(+), 2 deletions(-)

jump to
M CHANGESCHANGES

@@ -19,6 +19,7 @@ - GBA Serialize: Fix memory corruption bug in GBAExtdataSerialize

- GBA Serialize: Fix loading savegames from savestates - All: Fix several file handle leaks - Util: Use closesocket on Windows + - GBA Memory: Fix executing code from OBJ region of VRAM Misc: - GBA: Slightly optimize GBAProcessEvents - Qt: Add preset for DualShock 4
M src/gba/memory.csrc/gba/memory.c

@@ -276,8 +276,13 @@ cpu->memory.activeRegion = (uint32_t*) gba->video.palette;

cpu->memory.activeMask = SIZE_PALETTE_RAM - 1; break; case REGION_VRAM: - cpu->memory.activeRegion = (uint32_t*) gba->video.renderer->vram; - cpu->memory.activeMask = 0x0000FFFF; + if (address < 0x06010000) { + cpu->memory.activeRegion = (uint32_t*) gba->video.renderer->vram; + cpu->memory.activeMask = 0x0000FFFF; + } else { + cpu->memory.activeRegion = (uint32_t*) &gba->video.renderer->vram[0x8000]; + cpu->memory.activeMask = 0x00007FFF; + } break; case REGION_OAM: cpu->memory.activeRegion = (uint32_t*) gba->video.oam.raw;