From baa937b68f85e3710971b7450e0ad32c8d09a697 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 22 Sep 2017 21:19:07 -0700 Subject: [PATCH] GBA Savedata: Fix size of SRAM saves (fixes #883) --- CHANGES | 1 + include/mgba/internal/gba/memory.h | 2 +- src/gba/cheats.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 620f08f78..b9592e7ea 100644 --- a/CHANGES +++ b/CHANGES @@ -28,6 +28,7 @@ Bugfixes: - GBA: Fix keypad IRQs not firing when extra buttons are pressed - GBA Video: Fix broken sprite blending hack (fixes mgba.io/i/532) - GBA I/O: Fix reading from a few invalid I/O registers (fixes mgba.io/i/876) + - GBA Savedata: Fix size of SRAM saves (fixes mgba.io/i/883) Misc: - Qt: Don't rebuild library view if style hasn't changed - SDL: Fix 2.0.5 build on macOS under some circumstances diff --git a/include/mgba/internal/gba/memory.h b/include/mgba/internal/gba/memory.h index 165d956d0..4e9839798 100644 --- a/include/mgba/internal/gba/memory.h +++ b/include/mgba/internal/gba/memory.h @@ -64,7 +64,7 @@ enum { SIZE_CART0 = 0x02000000, SIZE_CART1 = 0x02000000, SIZE_CART2 = 0x02000000, - SIZE_CART_SRAM = 0x00010000, + SIZE_CART_SRAM = 0x00008000, SIZE_CART_FLASH512 = 0x00010000, SIZE_CART_FLASH1M = 0x00020000, SIZE_CART_EEPROM = 0x00002000, diff --git a/src/gba/cheats.c b/src/gba/cheats.c index 2e1a30b54..c8a8f2c82 100644 --- a/src/gba/cheats.c +++ b/src/gba/cheats.c @@ -367,7 +367,7 @@ int GBACheatAddressIsReal(uint32_t address) { return -0x8; case REGION_CART_SRAM: case REGION_CART_SRAM_MIRROR: - if ((address & OFFSET_MASK) > SIZE_CART_SRAM) { + if ((address & OFFSET_MASK) > SIZE_CART_FLASH512) { return -0x80; } return -0x8;