Fix bank switch detection

This commit is contained in:
Jeffrey Pfau 2013-09-25 04:48:27 -07:00
parent 13a2289e25
commit fcdbbf2a43
1 changed files with 2 additions and 0 deletions

View File

@ -137,6 +137,7 @@ void GBASavedataWriteFlash(struct GBASavedata* savedata, uint16_t address, uint8
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);
}
}