all repos — mgba @ 9e251c54e7926a106bfe7b5820a46481466de65f

mGBA Game Boy Advance Emulator

GBA: Fix loading subsequent save files (fixes #2067)
Vicki Pfau vi@endrift.com
Sat, 20 Mar 2021 23:43:26 -0700
commit

9e251c54e7926a106bfe7b5820a46481466de65f

parent

8c10d2f85708d70c1a393a58164eca73a8daed76

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

jump to
M CHANGESCHANGES

@@ -84,6 +84,7 @@ - FFmpeg: Fix encoding of time base

- 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)
M src/gba/gba.csrc/gba/gba.c

@@ -439,7 +439,12 @@ return true;

} 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; }