mirror of https://github.com/mgba-emu/mgba.git
GBA: Handle out-of-bounds I/O access
This commit is contained in:
parent
ebcb344d64
commit
78db3e1a74
1
CHANGES
1
CHANGES
|
@ -46,6 +46,7 @@ Bugfixes:
|
|||
- Util: Fix a null-pointer issue when attempting to delete a key
|
||||
- SDL: Allocate properly sized input maps
|
||||
- ARM7: Handle writeback for PC in addressing modes 2 and 3
|
||||
- GBA: Handle out-of-bounds I/O access
|
||||
Misc:
|
||||
- Qt: Show multiplayer numbers in window title
|
||||
- Qt: Handle saving input settings better
|
||||
|
|
|
@ -489,6 +489,10 @@ void GBAIOWrite(struct GBA* gba, uint32_t address, uint16_t value) {
|
|||
break;
|
||||
default:
|
||||
GBALog(gba, GBA_LOG_STUB, "Stub I/O register write: %03x", address);
|
||||
if (address >= REG_MAX) {
|
||||
GBALog(gba, GBA_LOG_GAME_ERROR, "Write to unused I/O register: %03X", address);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -643,6 +647,10 @@ uint16_t GBAIORead(struct GBA* gba, uint32_t address) {
|
|||
break;
|
||||
default:
|
||||
GBALog(gba, GBA_LOG_STUB, "Stub I/O register read: %03x", address);
|
||||
if (address >= REG_MAX) {
|
||||
GBALog(gba, GBA_LOG_GAME_ERROR, "Read from unused I/O register: %03X", address);
|
||||
return 0; // TODO: Reuse LOAD_BAD
|
||||
}
|
||||
break;
|
||||
}
|
||||
return gba->memory.io[address >> 1];
|
||||
|
|
Loading…
Reference in New Issue