GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash

This commit is contained in:
Vicki Pfau 2018-10-12 11:13:55 -07:00
parent 50d735b99b
commit 830cad3e7b
2 changed files with 4 additions and 0 deletions

View File

@ -3,6 +3,7 @@ Bugfixes:
- GBA: All IRQs have 7 cycle delay (fixes mgba.io/i/539, mgba.io/i/1208)
Misc:
- GBA Savedata: EEPROM performance fixes
- GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash
0.7.0: (Future)
Features:

View File

@ -259,6 +259,9 @@ void GBASavedataInitFlash(struct GBASavedata* savedata) {
end = savedata->vf->size(savedata->vf);
if (end < flashSize) {
savedata->vf->truncate(savedata->vf, flashSize);
} else if (end >= SIZE_CART_FLASH1M) {
flashSize = SIZE_CART_FLASH1M;
savedata->type = SAVEDATA_FLASH1M;
}
savedata->data = savedata->vf->map(savedata->vf, flashSize, savedata->mapMode);
}