GBA Memory: Let raw access read high MMIO addresses

This commit is contained in:
Vicki Pfau 2024-04-20 22:55:13 -07:00
parent f298c0185e
commit f84208a3e4
2 changed files with 7 additions and 5 deletions

View File

@ -20,6 +20,7 @@ Other fixes:
- Core: Fix inconsistencies with setting game-specific overrides (fixes mgba.io/i/2963)
- Debugger: Fix writing to specific segment in command-line debugger
- GB: Fix uninitialized save data when loading undersized temporary saves
- GBA Memory: Let raw access read high MMIO addresses
- Qt: Fix savestate preview sizes with different scales (fixes mgba.io/i/2560)
- Updater: Fix updating appimage across filesystems
Misc:

View File

@ -1118,10 +1118,8 @@ uint32_t GBAView32(struct ARMCore* cpu, uint32_t address) {
value = GBALoad32(cpu, address, 0);
break;
case GBA_REGION_IO:
if ((address & OFFSET_MASK) < GBA_REG_MAX) {
value = gba->memory.io[(address & OFFSET_MASK) >> 1];
value |= gba->memory.io[((address & OFFSET_MASK) >> 1) + 1] << 16;
}
value = GBAView16(cpu, address);
value |= GBAView16(cpu, address + 2) << 16;
break;
case GBA_REGION_SRAM:
value = GBALoad8(cpu, address, 0);
@ -1159,7 +1157,10 @@ uint16_t GBAView16(struct ARMCore* cpu, uint32_t address) {
value = GBALoad16(cpu, address, 0);
break;
case GBA_REGION_IO:
if ((address & OFFSET_MASK) < GBA_REG_MAX) {
if ((address & OFFSET_MASK) < GBA_REG_MAX || (address & OFFSET_MASK) == GBA_REG_POSTFLG) {
value = gba->memory.io[(address & OFFSET_MASK) >> 1];
} else if ((address & OFFSET_MASK) == GBA_REG_EXWAITCNT_LO || (address & OFFSET_MASK) == GBA_REG_EXWAITCNT_HI) {
address += GBA_REG_INTERNAL_EXWAITCNT_LO - GBA_REG_EXWAITCNT_LO;
value = gba->memory.io[(address & OFFSET_MASK) >> 1];
}
break;