void memfile_autosave() { /* this should be transparent to the user */ SILENT = 1; if (option.autofreeze > -1) ManageState(0,option.autofreeze); SILENT = 0; }
/**************************************************************************** * FILE autoload (SRAM/FreezeState or Config File) * * *****************************************************************************/ void memfile_autoload() { /* this should be transparent to the user */ SILENT = 1; /* STATE */ if (option.autofreeze != -1) ManageState(1,option.autofreeze); SILENT = 0; }
int loadsavemenu (int which) { int prevmenu = menu; int quit = 0; int ret; int count = 5; char items[5][20]; if (which == 1) { strcpy (menutitle, "STATE Manager"); sprintf(items[1], "Save State"); sprintf(items[2], "Load State"); } else { strcpy (menutitle, "SRAM Manager"); sprintf(items[1], "Save SRAM"); sprintf(items[2], "Load SRAM"); } sprintf(items[4], "Return to previous"); menu = 3; while (quit == 0) { if (device == 0) sprintf(items[0], "Device: FAT"); else if (device == 1) sprintf(items[0], "Device: MCARD A"); else if (device == 2) sprintf(items[0], "Device: MCARD B"); if (which == 1) { if (config.freeze_auto == 0) sprintf (items[3], "Auto FREEZE: FAT"); else if (config.freeze_auto == 1) sprintf (items[3], "Auto FREEZE: MCARD A"); else if (config.freeze_auto == 2) sprintf (items[3], "Auto FREEZE: MCARD B"); else sprintf (items[3], "Auto FREEZE: OFF"); } else { if (config.sram_auto == 0) sprintf (items[3], "Auto SRAM: FAT"); else if (config.sram_auto == 1) sprintf (items[3], "Auto SRAM: MCARD A"); else if (config.sram_auto == 2) sprintf (items[3], "Auto SRAM: MCARD B"); else sprintf (items[3], "Auto SRAM: OFF"); } ret = DoMenu(&items[0], count); switch (ret) { case -1: case 4: quit = 1; break; case 0: // Device FAT / MEMORY CARD device = (device + 1)%3; break; case 1: // ManageState or ManageSRAM case 2: if (which == 1) quit = ManageState (ret-1,device); else quit = ManageSRAM (ret-1,device); if (quit) return 1; break; case 3: if (which == 1) // FreezeState autoload & autosave { config.freeze_auto ++; if (config.freeze_auto > 2) config.freeze_auto = -1; config_save(); break; } else // SRAM autoload & autosave { config.sram_auto ++; if (config.sram_auto > 2) config.sram_auto = -1; config_save(); break; } } } menu = prevmenu; return 0; }
int StateManager() { int menu = 0; int quit = 0; short j; int redraw = 1; //int i; line = 0; scrollerx = 320 - MARGIN; while ( quit == 0 ) { if ( redraw ){ sprintf(mcmenu[0], (slot == 0) ? "Use: SLOT A" : "Use: SLOT B"); sprintf(mcmenu[1], (device == 0) ? "Device: MCARD" : "Device: SDCARD"); DrawMenu(&mcmenu[0], mccount, menu); } redraw = 0; j = PAD_ButtonsDown(0); if ( j & PAD_BUTTON_DOWN ) { menu++; redraw = 1; } if ( j & PAD_BUTTON_UP ) { menu--; redraw = 1; } if ( j & PAD_BUTTON_A ) { redraw = 1; switch( menu ) { case 0 : slot ^= 1; break; case 1 : device ^= 1; break; case 2 : ManageState(0, slot, device); //Save break; case 3 : ManageState(1, slot, device); //Load break; case 4 : quit = 1;//return 0 ; break; default: break; } } if ( j & PAD_BUTTON_B ) quit = 1; if ( menu < 0 ) menu = mccount - 1; if ( menu == mccount ) menu = 0; scroller(SCROLLY, &sgmtext[0], 2); VIDEO_WaitVSync(); } return 0; }
void CActiveLegacyMasternodeManager::DoMaintenance(CConnman& connman) { if (ShutdownRequested()) return; ManageState(connman); }