diff --git a/CHANGES b/CHANGES index 683212e45..775826662 100644 --- a/CHANGES +++ b/CHANGES @@ -14,6 +14,7 @@ Other fixes: Misc: - Core: Truncate preloading ROMs that slightly exceed max size (fixes mgba.io/i/2093) - GBA: Default-enable VBA bug compat for Ruby and Emerald ROM hacks + - GBA Memory: Log GPIO writes on non-GPIO carts as Pak Hardware instead of Memory - Qt: Add ROM filename and size to bug reporter 0.9.0: (2021-03-28) diff --git a/src/gba/memory.c b/src/gba/memory.c index e93b57743..25d8a6a68 100644 --- a/src/gba/memory.c +++ b/src/gba/memory.c @@ -912,7 +912,11 @@ void GBAStore16(struct ARMCore* cpu, uint32_t address, int16_t value, int* cycle } break; case REGION_CART0: - if (memory->hw.devices != HW_NONE && IS_GPIO_REGISTER(address & 0xFFFFFE)) { + if (IS_GPIO_REGISTER(address & 0xFFFFFE)) { + if (memory->hw.devices == HW_NONE) { + mLOG(GBA_HW, WARN, "Write to GPIO address %08X on cartridge without GPIO", address); + break; + } uint32_t reg = address & 0xFFFFFE; GBAHardwareGPIOWrite(&memory->hw, reg, value); break;