bool SaveBatteryOrStateAuto(int action, bool silent) { char filepath[1024]; if(!MakeFilePath(filepath, action, ROMFilename, 0)) return false; return SaveBatteryOrState(filepath, action, silent); }
int GameMenu () { int gamemenuCount = 8; char gamemenu[][50] = { "Return to Game", "Reset Game", "Load SRAM", "Save SRAM", "Load Game Snapshot", "Save Game Snapshot", "Reset Zoom", "Back to Main Menu" }; int ret, retval = 0; int quit = 0; int oldmenu = menu; menu = 0; while (quit == 0) { // disable SRAM/SNAPSHOT saving/loading if AUTO is on if (GCSettings.AutoLoad == 1) // Auto Load SRAM gamemenu[2][0] = '\0'; else if (GCSettings.AutoLoad == 2) // Auto Load SNAPSHOT gamemenu[4][0] = '\0'; if (GCSettings.AutoSave == 1) // Auto Save SRAM gamemenu[3][0] = '\0'; else if (GCSettings.AutoSave == 2) // Auto Save SNAPSHOT gamemenu[5][0] = '\0'; else if (GCSettings.AutoSave == 3) // Auto Save BOTH { gamemenu[3][0] = '\0'; gamemenu[5][0] = '\0'; } // disable Reset Zoom if Zooming is off if(!GCSettings.Zoom) gamemenu[6][0] = '\0'; ret = RunMenu (gamemenu, gamemenuCount, (char*)"Game Menu"); switch (ret) { case 0: // Return to Game quit = retval = 1; break; case 1: // Reset Game emulator.emuReset(); quit = retval = 1; break; case 2: // Load Battery quit = retval = LoadBatteryOrState(GCSettings.SaveMethod, FILE_SRAM, NOTSILENT); emulator.emuReset(); break; case 3: // Save Battery SaveBatteryOrState(GCSettings.SaveMethod, FILE_SRAM, NOTSILENT); break; case 4: // Load State quit = retval = LoadBatteryOrState(GCSettings.SaveMethod, FILE_SNAPSHOT, NOTSILENT); break; case 5: // Save State SaveBatteryOrState(GCSettings.SaveMethod, FILE_SNAPSHOT, NOTSILENT); break; case 6: // Reset Zoom zoom_reset (); quit = retval = 1; break; case -1: // Button B case 7: // Return to previous menu retval = 0; quit = 1; break; } } menu = oldmenu; return retval; }