GBA Memory: Fix unaligned out-of-bounds ROM loads

This commit is contained in:
Jeffrey Pfau 2015-11-10 22:44:23 -08:00
parent 49b16f3d9b
commit 7735c08fd5
2 changed files with 3 additions and 2 deletions

View File

@ -23,6 +23,7 @@ Bugfixes:
- GBA Memory: Fix Store8 to OBJ VRAM - GBA Memory: Fix Store8 to OBJ VRAM
- GBA Memory: Fix alignment of LDM/STM on SRAM - GBA Memory: Fix alignment of LDM/STM on SRAM
- GBA: Initialize uninitialized pristineRom and pristineRomSize members - GBA: Initialize uninitialized pristineRom and pristineRomSize members
- GBA Memory: Fix unaligned out-of-bounds ROM loads
Misc: Misc:
- Qt: Window size command line options are now supported - Qt: Window size command line options are now supported
- Qt: Increase usability of key mapper - Qt: Increase usability of key mapper

View File

@ -364,8 +364,8 @@ static void GBASetActiveRegion(struct ARMCore* cpu, uint32_t address) {
LOAD_32(value, address & (SIZE_CART0 - 4), memory->rom); \ LOAD_32(value, address & (SIZE_CART0 - 4), memory->rom); \
} else { \ } else { \
GBALog(gba, GBA_LOG_GAME_ERROR, "Out of bounds ROM Load32: 0x%08X", address); \ GBALog(gba, GBA_LOG_GAME_ERROR, "Out of bounds ROM Load32: 0x%08X", address); \
value = (address >> 1) & 0xFFFF; \ value = ((address & ~3) >> 1) & 0xFFFF; \
value |= ((address + 2) >> 1) << 16; \ value |= (((address & ~3) + 2) >> 1) << 16; \
} }
#define LOAD_SRAM \ #define LOAD_SRAM \