GBA Memory: Fix executing code from OBJ region of VRAM

This commit is contained in:
Jeffrey Pfau 2016-04-21 23:44:57 -07:00
parent c5516484e1
commit 5af00a8778
2 changed files with 8 additions and 2 deletions

View File

@ -15,6 +15,7 @@ Bugfixes:
- 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

View File

@ -268,8 +268,13 @@ static void GBASetActiveRegion(struct ARMCore* cpu, uint32_t address) {
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;