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 b1c7c6d14a
commit a2493a7bf3
2 changed files with 7 additions and 5 deletions

View File

@ -4,6 +4,7 @@ Emulation fixes:
- GBA GPIO: Fix gyro read-out start (fixes mgba.io/i/3141)
- GBA SIO: Fix MULTI mode SIOCNT bit 7 writes on secondary GBAs (fixes mgba.io/i/3110)
Other fixes:
- GBA Memory: Let raw access read high MMIO addresses
- Qt: Fix crash when applying changes to GB I/O registers in I/O view
- 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 REGION_IO:
if ((address & OFFSET_MASK) < 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 REGION_CART_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 REGION_IO:
if ((address & OFFSET_MASK) < REG_MAX) {
if ((address & OFFSET_MASK) < REG_MAX || (address & OFFSET_MASK) == REG_POSTFLG) {
value = gba->memory.io[(address & OFFSET_MASK) >> 1];
} else if ((address & OFFSET_MASK) == REG_EXWAITCNT_LO || (address & OFFSET_MASK) == REG_EXWAITCNT_HI) {
address += REG_INTERNAL_EXWAITCNT_LO - REG_EXWAITCNT_LO;
value = gba->memory.io[(address & OFFSET_MASK) >> 1];
}
break;