GBA: Fix loading subsequent save files (fixes #2067)

This commit is contained in:
Vicki Pfau 2021-03-20 23:43:26 -07:00
parent 8c10d2f857
commit 9e251c54e7
2 changed files with 6 additions and 0 deletions

View File

@ -84,6 +84,7 @@ Other fixes:
- GB: Fix crash when changing ROM while in banked address space
- GB Video: Fix SGB video logs
- GBA: Fix loading multiboot ELF files (fixes mgba.io/i/1949)
- GBA: Fix loading subsequent save files (fixes mgba.io/i/2067)
- mGUI: Don't attempt to preload files larger than can fit in RAM
- Qt: Force OpenGL paint engine creation thread (fixes mgba.io/i/1642)
- Qt: Fix static compilation in MinGW (fixes mgba.io/i/1769)

View File

@ -439,7 +439,12 @@ bool GBALoadROM(struct GBA* gba, struct VFile* vf) {
}
bool GBALoadSave(struct GBA* gba, struct VFile* sav) {
enum SavedataType type = gba->memory.savedata.type;
GBASavedataDeinit(&gba->memory.savedata);
GBASavedataInit(&gba->memory.savedata, sav);
if (type != SAVEDATA_AUTODETECT) {
GBASavedataForceType(&gba->memory.savedata, type);
}
return sav;
}