all repos — mgba @ fcdbbf2a437bfdb01d85860ee6f113b8c700e4d9

mGBA Game Boy Advance Emulator

Fix bank switch detection
Jeffrey Pfau jeffrey@endrift.com
Wed, 25 Sep 2013 04:48:27 -0700
commit

fcdbbf2a437bfdb01d85860ee6f113b8c700e4d9

parent

13a2289e25dc38cb7902fcb7c47de0569e66f24c

1 files changed, 2 insertions(+), 0 deletions(-)

jump to
M src/gba/gba-savedata.csrc/gba/gba-savedata.c

@@ -137,6 +137,7 @@ } else {

GBALog(0, GBA_LOG_GAME_ERROR, "Bad flash bank switch"); savedata->command = FLASH_COMMAND_NONE; } + savedata->command = FLASH_COMMAND_NONE; break; default: if (address == FLASH_BASE_HI && value == FLASH_COMMAND_START) {

@@ -275,6 +276,7 @@ void _flashSwitchBank(struct GBASavedata* savedata, int bank) {

savedata->currentBank = &savedata->data[bank << 16]; if (bank > 0) { savedata->type = SAVEDATA_FLASH1M; + ftruncate(savedata->fd, SIZE_CART_FLASH1M); } }