GBA Memory: Fix STM/LDM to invalid VRAM

This commit is contained in:
Vicki Pfau 2019-07-03 10:19:05 -07:00
parent 77ec5e6e91
commit a00a02b8c4
2 changed files with 10 additions and 9 deletions

View File

@ -31,6 +31,7 @@ Emulation fixes:
- GB Video: Increment BCPS/OCPS even in mode 3 (fixes mgba.io/i/1462)
- GB Audio: Deschedule channel 3 when disabled (fixes mgba.io/i/1463)
- GB Audio: Deschedule channel 1 when disabled by sweep (fixes mgba.io/i/1467)
- GBA Memory: Fix STM/LDM to invalid VRAM
Other fixes:
- Qt: Fix some Qt display driver race conditions
- Core: Improved lockstep driver reliability (Le Hoang Quyen)

View File

@ -394,9 +394,9 @@ static void GBASetActiveRegion(struct ARMCore* cpu, uint32_t address) {
if ((address & (SIZE_VRAM | 0x00014000)) == SIZE_VRAM && (GBARegisterDISPCNTGetMode(gba->memory.io[REG_DISPCNT >> 1]) >= 3)) { \
mLOG(GBA_MEM, GAME_ERROR, "Bad VRAM Load32: 0x%08X", address); \
value = 0; \
break; \
} \
} else { \
LOAD_32(value, address & 0x00017FFC, gba->video.vram); \
} \
} else { \
LOAD_32(value, address & 0x0001FFFC, gba->video.vram); \
} \
@ -735,14 +735,14 @@ uint32_t GBALoad8(struct ARMCore* cpu, uint32_t address, int* cycleCounter) {
if ((address & 0x0001FFFF) >= SIZE_VRAM) { \
if ((address & (SIZE_VRAM | 0x00014000)) == SIZE_VRAM && (GBARegisterDISPCNTGetMode(gba->memory.io[REG_DISPCNT >> 1]) >= 3)) { \
mLOG(GBA_MEM, GAME_ERROR, "Bad VRAM Store32: 0x%08X", address); \
break; \
} \
} else { \
LOAD_32(oldValue, address & 0x00017FFC, gba->video.vram); \
if (oldValue != value) { \
STORE_32(value, address & 0x00017FFC, gba->video.vram); \
gba->video.renderer->writeVRAM(gba->video.renderer, (address & 0x00017FFC) + 2); \
gba->video.renderer->writeVRAM(gba->video.renderer, (address & 0x00017FFC)); \
} \
} \
} else { \
LOAD_32(oldValue, address & 0x0001FFFC, gba->video.vram); \
if (oldValue != value) { \