SDL2: Write battery file information before issueing RESET_COMMAND

Before performing the GB reset, we should perform a GB_save_battery.

Otherwise, resetting the emulation will kill ("kill" as in simply don't
write them into the .sav) all changes made to the battery save since
sameboy was started.
This commit is contained in:
Lothar Serra Mari 2018-04-19 16:47:54 +02:00
parent be9df4d658
commit 2407304177

View File

@ -302,6 +302,7 @@ static bool handle_pending_command(void)
} }
case GB_SDL_RESET_COMMAND: case GB_SDL_RESET_COMMAND:
GB_save_battery(&gb, battery_save_path_ptr);
return true; return true;
case GB_SDL_NO_COMMAND: case GB_SDL_NO_COMMAND: