void Menu() { // Restore system palette SDL_SetPalette(gamescreen, SDL_LOGPAL, syspal, 0, 256); RunMenu(&MainMenu); }
void ConfigureControllers () { int quit = 0; int ret = 0; int oldmenu = menu; menu = 0; // disable unavailable controller options if in GC mode #ifndef HW_RVL ctlrmenu[0][0] = 0; ctlrmenu[1][0] = 0; ctlrmenu[2][0] = 0; #endif while (quit == 0) { /*** Controller Config Menu ***/ ret = RunMenu (ctlrmenu, ctlrmenucount, (char*)"Configure Controllers"); switch (ret) { case 0: /*** Configure Nunchuk ***/ ConfigureButtons (CTRLR_NUNCHUK); break; case 1: /*** Configure Classic ***/ ConfigureButtons (CTRLR_CLASSIC); break; case 2: /*** Configure Wiimote ***/ ConfigureButtons (CTRLR_WIIMOTE); break; case 3: /*** Configure GC Pad ***/ ConfigureButtons (CTRLR_GCPAD); break; case 4: /*** Save Preferences Now ***/ SavePrefs(GCSettings.SaveMethod, NOTSILENT); break; case -1: /*** Button B ***/ case 5: /*** Return ***/ quit = 1; break; } } menu = oldmenu; }
static void RunDemo(Word demoname) { #if 0 Word *demo; Word exit; demo = (Word *)LoadAResource(demoname); /* Load the demo */ exit = G_PlayDemoPtr(demo); /* Play the demo */ ReleaseAResource(demoname); /* Release the demo data */ if (exit == ga_exitdemo) { /* Quit? */ RunMenu(); /* Show the main menu */ } #endif }
bool ControllerMenu::RunMenu() { ViewMenu::defaultView(); while (!menu->GetHaveMakeAChoice()) { menu->viewToShow(); } if (ViewMenu::GetActualView() == 2) { system("cls"); ViewMenu::HelpView(); while(ViewMenu::KeyPressed() != 3); system("cls"); menu->SetHaveMakeAChoise(false); RunMenu(); } return false; }
void ac_RunQuitMenu() { static char *quit_text[6] = { "LET ME QUIT NOW!", "LOOSERS CAN QUIT...", "THAT'S ENOUGH FOR NOW", "I'LL TRY THE NEXT TIME...", "FLEE AWAY", "ARRGGGHHHH!!!", }; QuitMenu.menu->text = quit_text[rand() % 6]; QuitMenu.sel = 0; RunMenu(&QuitMenu); done = 0; }
void PreferencesMenu () { int ret = 0; int quit = 0; int oldmenu = menu; menu = 0; while (quit == 0) { ret = RunMenu (prefmenu, prefmenuCount, (char*)"Preferences"); switch (ret) { case 0: ConfigureControllers (); break; case 1: VideoOptions (); break; case 2: FileOptions (); break; case 3: DefaultSettings (); WaitPrompt((char *)"Preferences Reset"); break; case -1: /*** Button B ***/ case 4: SavePrefs(GCSettings.SaveMethod, SILENT); quit = 1; break; } } menu = oldmenu; }
int main() { int i; tLinkTable * pLinkTable = CreateLinkTable(); /* init menu whih the common item, help, version, and exit */ InitMenuItem(pLinkTable); /* Add new item to the exist menu dynamicly */ AddMenuItem(pLinkTable, "add1", "add menu1", add1); AddMenuItem(pLinkTable, "add2", "add menu2", add1); /* cmd line begins */ while(1) { char cmd[CMD_MAX_LEN]; printf("Input a cmd > "); scanf("%s", cmd); /* call the func to run the menu */ RunMenu(pLinkTable, cmd); } DeleteLinkTable(pLinkTable); }
int LoadManager () { int ret; int quit = 0; int oldmenu = menu; int retval = 1; menu = 0; while (quit == 0) { if ( isWii ) /* Wii menu */ { ret = RunMenu (loadmanwii, loadmancountwii, (char*)"Load Manager"); if (ret >= loadmancountwii-1) ret = loadmancount-1; } else /* Gamecube menu */ ret = RunMenu (loadman, loadmancount, (char*)"Load Manager"); switch (ret) { case 0: /*** Load from SD ***/ quit = OpenSD (0); break; case 1: /*** Load from DVD ***/ quit = OpenDVD (); break; case 2: /*** Load from SMB ***/ //(gamecube option) quit = OpenSMB (); break; case -1: /*** Button B ***/ case 3: retval = 0; quit = 1; break; } } /*** * check for autoloadsram / freeze ***/ if ( retval == 1 ) // if ROM was loaded, load the SRAM & settings { if ( GCSettings.AutoLoad == 1 ) quickLoadSRAM ( SILENT ); else if ( GCSettings.AutoLoad == 2 ) { /*** load SRAM first in order to get joypad config ***/ quickLoadSRAM ( SILENT ); quickLoadFreeze ( SILENT ); } S9xSoftReset(); // reset after loading sram } menu = oldmenu; return retval; }
void ConfigureJoyPads () { int quit = 0; int ret = 0; int oldmenu = menu; menu = 0; while (quit == 0) { /*** Update the menu information ***/ for (ret = 0; ret < 4; ret++) padmenu[ret][16] = padnames[currconfig[ret]]; sprintf (padmenu[4], "ANALOG CLIP - %d", padcal); ret = RunMenu (padmenu, padcount, (char*)"Configure Joypads"); switch (ret) { case 0: /*** Configure Button A ***/ currconfig[0]++; currconfig[0] &= 3; gcpadmap[0] = padmap[currconfig[0]]; break; case 1: /*** Configure Button B ***/ currconfig[1]++; currconfig[1] &= 3; gcpadmap[1] = padmap[currconfig[1]]; break; case 2: /*** Configure Button X ***/ currconfig[2]++; currconfig[2] &= 3; gcpadmap[2] = padmap[currconfig[2]]; break; case 3: /*** Configure Button Y ***/ currconfig[3]++; currconfig[3] &= 3; gcpadmap[3] = padmap[currconfig[3]]; break; case 4: /*** Pad Calibration ***/ padcal += 5; if (padcal > 80) padcal = 40; break; case 5: /*** Quick Save SRAM ***/ if ( ARAM_ROMSIZE > 0 ) quickSaveSRAM(NOTSILENT); else WaitPrompt((char*) "No ROM loaded - can't save SRAM"); break; case -1: /*** Button B ***/ case 6: /*** Return ***/ quit = 1; break; } } menu = oldmenu; }
void PreferencesMenu () { int ret = 0; int quit = 0; int oldmenu = menu; menu = 0; while (quit == 0) { // some load/save methods are not implemented - here's where we skip them // they need to be skipped in the order they were enumerated in vba.h // no USB ports on GameCube #ifdef HW_DOL if(GCSettings.LoadMethod == METHOD_USB) GCSettings.LoadMethod++; if(GCSettings.SaveMethod == METHOD_USB) GCSettings.SaveMethod++; #endif // saving to DVD is impossible if(GCSettings.SaveMethod == METHOD_DVD) GCSettings.SaveMethod++; // disable DVD in GC mode (not implemented) #ifdef HW_DOL if(GCSettings.LoadMethod == METHOD_DVD) GCSettings.LoadMethod++; #endif // disable SMB in GC mode (stalls out) #ifdef HW_DOL if(GCSettings.LoadMethod == METHOD_SMB) GCSettings.LoadMethod++; if(GCSettings.SaveMethod == METHOD_SMB) GCSettings.SaveMethod++; #endif // disable MC saving in Wii mode - does not work for some reason! #ifdef HW_RVL if(GCSettings.SaveMethod == METHOD_MC_SLOTA) GCSettings.SaveMethod++; if(GCSettings.SaveMethod == METHOD_MC_SLOTB) GCSettings.SaveMethod++; prefmenu[6][0] = 0; #else sprintf (prefmenu[6], "Verify MC Saves %s", GCSettings.VerifySaves == true ? " ON" : "OFF"); #endif // correct load/save methods out of bounds if(GCSettings.LoadMethod > 4) GCSettings.LoadMethod = 0; if(GCSettings.SaveMethod > 6) GCSettings.SaveMethod = 0; if (GCSettings.LoadMethod == METHOD_AUTO) sprintf (prefmenu[0],"Load Method AUTO"); else if (GCSettings.LoadMethod == METHOD_SD) sprintf (prefmenu[0],"Load Method SD"); else if (GCSettings.LoadMethod == METHOD_USB) sprintf (prefmenu[0],"Load Method USB"); else if (GCSettings.LoadMethod == METHOD_DVD) sprintf (prefmenu[0],"Load Method DVD"); else if (GCSettings.LoadMethod == METHOD_SMB) sprintf (prefmenu[0],"Load Method Network"); sprintf (prefmenu[1], "Load Folder %s", GCSettings.LoadFolder); if (GCSettings.SaveMethod == METHOD_AUTO) sprintf (prefmenu[2],"Save Method AUTO"); else if (GCSettings.SaveMethod == METHOD_SD) sprintf (prefmenu[2],"Save Method SD"); else if (GCSettings.SaveMethod == METHOD_USB) sprintf (prefmenu[2],"Save Method USB"); else if (GCSettings.SaveMethod == METHOD_SMB) sprintf (prefmenu[2],"Save Method Network"); else if (GCSettings.SaveMethod == METHOD_MC_SLOTA) sprintf (prefmenu[2],"Save Method MC Slot A"); else if (GCSettings.SaveMethod == METHOD_MC_SLOTB) sprintf (prefmenu[2],"Save Method MC Slot B"); sprintf (prefmenu[3], "Save Folder %s", GCSettings.SaveFolder); // disable changing load/save directories for now prefmenu[1][0] = '\0'; prefmenu[3][0] = '\0'; if (GCSettings.AutoLoad == 0) sprintf (prefmenu[4],"Auto Load OFF"); else if (GCSettings.AutoLoad == 1) sprintf (prefmenu[4],"Auto Load SRAM"); else if (GCSettings.AutoLoad == 2) sprintf (prefmenu[4],"Auto Load SNAPSHOT"); if (GCSettings.AutoSave == 0) sprintf (prefmenu[5],"Auto Save OFF"); else if (GCSettings.AutoSave == 1) sprintf (prefmenu[5],"Auto Save SRAM"); else if (GCSettings.AutoSave == 2) sprintf (prefmenu[5],"Auto Save SNAPSHOT"); else if (GCSettings.AutoSave == 3) sprintf (prefmenu[5],"Auto Save BOTH"); sprintf (prefmenu[7], "Enable Zooming %s", GCSettings.Zoom == true ? " ON" : "OFF"); // original mode not implemented if(GCSettings.render == 0) GCSettings.render++; if (GCSettings.render == 0) sprintf (prefmenu[8], "Video Rendering Original"); if (GCSettings.render == 1) sprintf (prefmenu[8], "Video Rendering Filtered"); if (GCSettings.render == 2) sprintf (prefmenu[8], "Video Rendering Unfiltered"); sprintf (prefmenu[9], "Video Scaling %s", GCSettings.widescreen == true ? "16:9 Correction" : "Default"); ret = RunMenu (prefmenu, prefmenuCount, (char*)"Preferences", 16); switch (ret) { case 0: GCSettings.LoadMethod ++; break; case 1: break; case 2: GCSettings.SaveMethod ++; break; case 3: break; case 4: GCSettings.AutoLoad ++; if (GCSettings.AutoLoad > 2) GCSettings.AutoLoad = 0; break; case 5: GCSettings.AutoSave ++; if (GCSettings.AutoSave > 3) GCSettings.AutoSave = 0; break; case 6: GCSettings.VerifySaves ^= 1; break; case 7: GCSettings.Zoom ^= 1; break; case 8: GCSettings.render++; if (GCSettings.render > 2) GCSettings.render = 0; // reset zoom zoom_reset (); break; case 9: GCSettings.widescreen ^= 1; break; case 10: DefaultSettings (); WaitPrompt((char *)"Preferences Reset"); break; case 11: case -1: /*** Button B ***/ SavePrefs(GCSettings.SaveMethod, SILENT); quit = 1; break; } } menu = oldmenu; }
void ConfigureControllers () { int quit = 0; int ret = 0; int oldmenu = menu; menu = 0; // disable unavailable controller options if in GC mode #ifndef HW_RVL ctlrmenu[4][0] = '\0'; ctlrmenu[5][0] = '\0'; ctlrmenu[6][0] = '\0'; #endif while (quit == 0) { sprintf (ctlrmenu[0], "MultiTap %s", Settings.MultiPlayer5Master == true ? " ON" : "OFF"); if (GCSettings.Superscope > 0) sprintf (ctlrmenu[1], "Superscope: Pad %d", GCSettings.Superscope); else sprintf (ctlrmenu[1], "Superscope OFF"); if (GCSettings.Mouse > 0) sprintf (ctlrmenu[2], "Mice: %d", GCSettings.Mouse); else sprintf (ctlrmenu[2], "Mice: OFF"); if (GCSettings.Justifier > 0) sprintf (ctlrmenu[3], "Justifiers: %d", GCSettings.Justifier); else sprintf (ctlrmenu[3], "Justifiers: OFF"); /*** Controller Config Menu ***/ ret = RunMenu (ctlrmenu, ctlrmenucount, (char*)"Configure Controllers"); switch (ret) { case 0: Settings.MultiPlayer5Master ^= 1; break; case 1: GCSettings.Superscope ++; if (GCSettings.Superscope > 4) GCSettings.Superscope = 0; break; case 2: GCSettings.Mouse ++; if (GCSettings.Mouse > 2) GCSettings.Mouse = 0; break; case 3: GCSettings.Justifier ++; if (GCSettings.Justifier > 2) GCSettings.Justifier = 0; break; case 4: /*** Configure Nunchuk ***/ ConfigureButtons (CTRLR_NUNCHUK); break; case 5: /*** Configure Classic ***/ ConfigureButtons (CTRLR_CLASSIC); break; case 6: /*** Configure Wiimote ***/ ConfigureButtons (CTRLR_WIIMOTE); break; case 7: /*** Configure GC Pad ***/ ConfigureButtons (CTRLR_GCPAD); break; case 8: /*** Save Preferences Now ***/ SavePrefs(GCSettings.SaveMethod, NOTSILENT); break; case -1: /*** Button B ***/ case 9: /*** Return ***/ quit = 1; break; } } menu = oldmenu; }
static void RunCredits (void) { if (MiniLoop(START_Credits,STOP_Credits,TIC_Credits,DRAW_Credits)== ga_exitdemo) { /* Did you quit? */ RunMenu(); /* Process the main menu */ } }
void ConfigureControllers () { int quit = 0; int ret = 0; int oldmenu = menu; menu = 0; while (quit == 0) { #ifdef HW_RVL /*** Wii Controller Config Menu ***/ ret = RunMenu (cfg_ctrlr_menu_wii, cfg_ctrlr_count_wii, (char*)"Configure Controllers"); switch (ret) { case 0: /*** Configure Nunchuk ***/ ConfigureButtons (CTRLR_NUNCHUK); break; case 1: /*** Configure Classic ***/ ConfigureButtons (CTRLR_CLASSIC); break; case 2: /*** Configure GC Pad ***/ ConfigureButtons (CTRLR_GCPAD); break; case 3: /*** Configure Wiimote ***/ ConfigureButtons (CTRLR_WIIMOTE); break; case 4: /*** Save Preferences Now ***/ quickSavePrefs(NOTSILENT); break; case -1: /*** Button B ***/ case 5: /*** Return ***/ quit = 1; break; } #else /*** Gamecube Controller Config Menu ***/ ret = RunMenu (cfg_ctrlr_menu_gc, cfg_ctrlr_count_gc, (char*)"Configure Controllers"); switch (ret) { case 0: /*** Configure Nunchuk ***/ ConfigureButtons (CTRLR_GCPAD); break; case 1: /*** Save Preferences Now ***/ quickSavePrefs(NOTSILENT); break; case -1: /*** Button B ***/ case 2: /*** Return ***/ quit = 1; break; } #endif } menu = oldmenu; }
void ac_RunOptionsMenu() { RunMenu(&OptionsMenu); done = 0; }
void VideoOptions () { int ret = 0; int quit = 0; int oldmenu = menu; menu = 0; while (quit == 0) { sprintf (videomenu[0], "Enable Zooming %s", GCSettings.Zoom == true ? " ON" : "OFF"); // don't allow original render mode if progressive video mode detected if (GCSettings.render==0 && progressive) GCSettings.render++; if ( GCSettings.render == 0 ) sprintf (videomenu[1], "Video Rendering Original"); if ( GCSettings.render == 1 ) sprintf (videomenu[1], "Video Rendering Filtered"); if ( GCSettings.render == 2 ) sprintf (videomenu[1], "Video Rendering Unfiltered"); sprintf (videomenu[2], "Video Scaling %s", GCSettings.widescreen == true ? "16:9 Correction" : "Default"); sprintf (videomenu[7], "Video Shift: %d, %d", GCSettings.xshift, GCSettings.yshift); ret = RunMenu (videomenu, videomenuCount, (char*)"Video Options"); switch (ret) { case 0: GCSettings.Zoom ^= 1; break; case 1: GCSettings.render++; if (GCSettings.render > 2 ) GCSettings.render = 0; // reset zoom zoom_reset (); break; case 2: GCSettings.widescreen ^= 1; break; case 3: // Move up GCSettings.yshift--; break; case 4: // Move down GCSettings.yshift++; break; case 5: // Move left GCSettings.xshift--; break; case 6: // Move right GCSettings.xshift++; break; case 7: break; case 8: // reset video shifts GCSettings.xshift = GCSettings.yshift = 0; WaitPrompt((char *)"Video Shift Reset"); break; case -1: // Button B case 9: quit = 1; break; } } menu = oldmenu; }
void FileOptions () { int ret = 0; int quit = 0; int oldmenu = menu; menu = 0; while (quit == 0) { // some load/save methods are not implemented - here's where we skip them // they need to be skipped in the order they were enumerated in snes9xGX.h // no USB ports on GameCube #ifndef HW_RVL if(GCSettings.LoadMethod == METHOD_USB) GCSettings.LoadMethod++; if(GCSettings.SaveMethod == METHOD_USB) GCSettings.SaveMethod++; #endif // saving to DVD is impossible if(GCSettings.SaveMethod == METHOD_DVD) GCSettings.SaveMethod++; // disable SMB in GC mode (stalls out) #ifndef HW_RVL if(GCSettings.LoadMethod == METHOD_SMB) GCSettings.LoadMethod++; if(GCSettings.SaveMethod == METHOD_SMB) GCSettings.SaveMethod++; #endif // disable MC saving in Wii mode - does not work for some reason! #ifdef HW_RVL if(GCSettings.SaveMethod == METHOD_MC_SLOTA) GCSettings.SaveMethod++; if(GCSettings.SaveMethod == METHOD_MC_SLOTB) GCSettings.SaveMethod++; #endif // correct load/save methods out of bounds if(GCSettings.LoadMethod > 4) GCSettings.LoadMethod = 0; if(GCSettings.SaveMethod > 6) GCSettings.SaveMethod = 0; if (GCSettings.LoadMethod == METHOD_AUTO) sprintf (filemenu[0],"Load Method AUTO"); else if (GCSettings.LoadMethod == METHOD_SD) sprintf (filemenu[0],"Load Method SD"); else if (GCSettings.LoadMethod == METHOD_USB) sprintf (filemenu[0],"Load Method USB"); else if (GCSettings.LoadMethod == METHOD_DVD) sprintf (filemenu[0],"Load Method DVD"); else if (GCSettings.LoadMethod == METHOD_SMB) sprintf (filemenu[0],"Load Method Network"); sprintf (filemenu[1], "Load Folder %s", GCSettings.LoadFolder); if (GCSettings.SaveMethod == METHOD_AUTO) sprintf (filemenu[2],"Save Method AUTO"); else if (GCSettings.SaveMethod == METHOD_SD) sprintf (filemenu[2],"Save Method SD"); else if (GCSettings.SaveMethod == METHOD_USB) sprintf (filemenu[2],"Save Method USB"); else if (GCSettings.SaveMethod == METHOD_SMB) sprintf (filemenu[2],"Save Method Network"); else if (GCSettings.SaveMethod == METHOD_MC_SLOTA) sprintf (filemenu[2],"Save Method MC Slot A"); else if (GCSettings.SaveMethod == METHOD_MC_SLOTB) sprintf (filemenu[2],"Save Method MC Slot B"); sprintf (filemenu[3], "Save Folder %s", GCSettings.SaveFolder); // disable changing load/save directories for now filemenu[1][0] = '\0'; filemenu[3][0] = '\0'; if (GCSettings.AutoLoad == 0) sprintf (filemenu[4],"Auto Load OFF"); else if (GCSettings.AutoLoad == 1) sprintf (filemenu[4],"Auto Load SRAM"); else if (GCSettings.AutoLoad == 2) sprintf (filemenu[4],"Auto Load SNAPSHOT"); if (GCSettings.AutoSave == 0) sprintf (filemenu[5],"Auto Save OFF"); else if (GCSettings.AutoSave == 1) sprintf (filemenu[5],"Auto Save SRAM"); else if (GCSettings.AutoSave == 2) sprintf (filemenu[5],"Auto Save SNAPSHOT"); else if (GCSettings.AutoSave == 3) sprintf (filemenu[5],"Auto Save BOTH"); sprintf (filemenu[6], "Verify MC Saves %s", GCSettings.VerifySaves == true ? " ON" : "OFF"); ret = RunMenu (filemenu, filemenuCount, (char*)"Save/Load Options"); switch (ret) { case 0: GCSettings.LoadMethod ++; break; case 1: break; case 2: GCSettings.SaveMethod ++; break; case 3: break; case 4: GCSettings.AutoLoad ++; if (GCSettings.AutoLoad > 2) GCSettings.AutoLoad = 0; break; case 5: GCSettings.AutoSave ++; if (GCSettings.AutoSave > 3) GCSettings.AutoSave = 0; break; case 6: GCSettings.VerifySaves ^= 1; break; case -1: /*** Button B ***/ case 7: quit = 1; break; } } menu = oldmenu; }
void SaveManager () { int ret; int quit = 0; int oldmenu = menu; menu = 0; while (quit == 0) { if ( isWii ) /* Wii menu */ { ret = RunMenu (savemenuwii, savecountwii, (char*)"Save Manager"); if (ret >= savecountwii-1) ret = savecount-1; } else /* Gamecube menu */ ret = RunMenu (savemenu, savecount, (char*)"Save Manager"); switch (ret) { case 0: /*** Save to SD***/ SaveSRAMToSD (0, NOTSILENT); break; case 1: /*** Load from SD***/ LoadSRAMFromSD (0, NOTSILENT); break; case 2: /*** Save to MC slot A ***/ SaveSRAMToMC (CARD_SLOTA, NOTSILENT); break; case 3: /*** Load from MC slot A ***/ LoadSRAMFromMC (CARD_SLOTA, NOTSILENT); break; case 4: /*** Save to MC slot B ***/ SaveSRAMToMC (CARD_SLOTB, NOTSILENT); break; case 5: /*** Load from MC slot B ***/ LoadSRAMFromMC (CARD_SLOTB, NOTSILENT); break; case 6: /*** Save to SMB **/ SaveSRAMToSMB (NOTSILENT); break; case 7: /*** Load from SMB ***/ LoadSRAMFromSMB (NOTSILENT); break; case -1: /*** Button B ***/ case 8: /*** Return ***/ quit = 1; break; } } menu = oldmenu; }
int FreezeManager () { int ret; int loaded = 0; int quit = 0; int oldmenu = menu; menu = 0; while (quit == 0) { if ( isWii ) /* Wii menu */ { ret = RunMenu (freezemenuwii, freezecountwii, (char*)"Freeze Manager"); if (ret >= freezecountwii-1) ret = freezecount-1; } else /* Gamecube menu */ ret = RunMenu (freezemenu, freezecount, (char*)"Freeze Manager"); switch (ret) { case 0:/*** Freeze to SDCard ***/ NGCFreezeGame (2, NOTSILENT); break; case 1:/*** Thaw from SDCard***/ quit = loaded = NGCUnfreezeGame (2, NOTSILENT); break; case 2:/*** Freeze to MC in slot A ***/ NGCFreezeGame (0, NOTSILENT); break; case 3:/*** Thaw from MC in slot A ***/ quit = loaded = NGCUnfreezeGame (0, NOTSILENT); break; case 4:/*** Freeze to MC in slot B ***/ NGCFreezeGame (1, NOTSILENT); break; case 5:/*** Thaw from MC in slot B ***/ quit = loaded = NGCUnfreezeGame (1, NOTSILENT); break; case 6:/*** Freeze to SMB ***/ if ( !isWii ) NGCFreezeGame (4, NOTSILENT); break; case 7:/*** Thaw from SMB ***/ if ( !isWii ) quit = loaded = NGCUnfreezeGame (4, NOTSILENT); break; case -1: /*** Button B ***/ case 8: quit = 1; break; } } menu = oldmenu; return loaded; }
void EmulatorOptions () { int ret = 0; int quit = 0; int oldmenu = menu; menu = 0; while (quit == 0) { sprintf (emulatorOptions[0], "Reverse Stereo %s", Settings.ReverseStereo == true ? " ON" : "OFF"); sprintf (emulatorOptions[1], "Interp. Sound %s", Settings.InterpolatedSound == true ? " ON" : "OFF"); sprintf (emulatorOptions[2], "Transparency %s", Settings.Transparency == true ? " ON" : "OFF"); sprintf (emulatorOptions[3], "FPS Display %s", Settings.DisplayFrameRate == true ? " ON" : "OFF"); sprintf (emulatorOptions[4], "MultiTap 5 %s", Settings.MultiPlayer5Master == true ? " ON" : "OFF"); sprintf (emulatorOptions[5], "C-Stick Zoom %s", GCSettings.NGCZoom == true ? " ON" : "OFF"); if (GCSettings.AutoLoad == 0) sprintf (emulatorOptions[6],"Auto Load OFF"); else if (GCSettings.AutoLoad == 1) sprintf (emulatorOptions[6],"Auto Load SRAM"); else if (GCSettings.AutoLoad == 2) sprintf (emulatorOptions[6],"Auto Load FREEZE"); if (GCSettings.AutoSave == 0) sprintf (emulatorOptions[7],"Auto Save OFF"); else if (GCSettings.AutoSave == 1) sprintf (emulatorOptions[7],"Auto Save SRAM"); else if (GCSettings.AutoSave == 2) sprintf (emulatorOptions[7],"Auto Save FREEZE"); else if (GCSettings.AutoSave == 3) sprintf (emulatorOptions[7],"Auto Save BOTH"); sprintf (emulatorOptions[8], "Verify MC Saves %s", GCSettings.VerifySaves == true ? " ON" : "OFF"); ret = RunMenu (emulatorOptions, emuCount, (char*)"Emulator Options"); switch (ret) { case 0: Settings.ReverseStereo = (Settings.ReverseStereo == false ? true : false); break; case 1: Settings.InterpolatedSound = (Settings.InterpolatedSound == false ? true : false); break; case 2: Settings.Transparency = (Settings.Transparency == false ? true : false); break; case 3: Settings.DisplayFrameRate = (Settings.DisplayFrameRate == false ? true : false); break; case 4: Settings.MultiPlayer5Master = (Settings.MultiPlayer5Master == false ? true : false); if (Settings.MultiPlayer5Master) { S9xSetController (1, CTL_MP5, 1, 2, 3, -1); } else { S9xSetController (1, CTL_JOYPAD, 1, 0, 0, 0); } break; case 5: GCSettings.NGCZoom = (GCSettings.NGCZoom == false ? true : false); break; case 6: GCSettings.AutoLoad ++; if (GCSettings.AutoLoad > 2) GCSettings.AutoLoad = 0; break; case 7: GCSettings.AutoSave ++; if (GCSettings.AutoSave > 3) GCSettings.AutoSave = 0; break; case 8: GCSettings.VerifySaves = (GCSettings.VerifySaves == false ? true : false); break; case 9: quickSavePrefs(NOTSILENT); break; case -1: /*** Button B ***/ case 10: quit = 1; break; } } menu = oldmenu; }
int GameMenu () { int gamemenuCount = 10; char gamemenu[][50] = { "Return to Game", "Reset Game", "ROM Information", "Cheats", "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[4][0] = '\0'; else if (GCSettings.AutoLoad == 2) // Auto Load SNAPSHOT gamemenu[6][0] = '\0'; if (GCSettings.AutoSave == 1) // Auto Save SRAM gamemenu[5][0] = '\0'; else if (GCSettings.AutoSave == 2) // Auto Save SNAPSHOT gamemenu[7][0] = '\0'; else if (GCSettings.AutoSave == 3) // Auto Save BOTH { gamemenu[5][0] = '\0'; gamemenu[7][0] = '\0'; } // hide cheats menu if cheats file not present if(Cheat.num_cheats == 0) gamemenu[3][0] = '\0'; ret = RunMenu (gamemenu, gamemenuCount, (char*)"Game Menu"); switch (ret) { case 0: // Return to Game quit = retval = 1; break; case 1: // Reset Game zoom_reset (); S9xSoftReset (); quit = retval = 1; break; case 2: // ROM Information RomInfo(); WaitButtonA (); break; case 3: // load cheats CheatMenu(); break; case 4: // Load SRAM zoom_reset (); quit = retval = LoadSRAM(GCSettings.SaveMethod, NOTSILENT); break; case 5: // Save SRAM SaveSRAM(GCSettings.SaveMethod, NOTSILENT); break; case 6: // Load Freeze zoom_reset (); quit = retval = NGCUnfreezeGame (GCSettings.SaveMethod, NOTSILENT); break; case 7: // Save Freeze NGCFreezeGame (GCSettings.SaveMethod, NOTSILENT); break; case 8: // Reset Zoom zoom_reset (); quit = retval = 1; break; case -1: // Button B case 9: // Return to previous menu retval = 0; quit = 1; break; } } menu = oldmenu; return retval; }
void mainmenu () { int quit = 0; int ret; int *psoid = (int *) 0x80001800; void (*PSOReload) () = (void (*)()) 0x80001800; if ( isWii ) sprintf (menuitems[8],"Reset Wii"); else sprintf (menuitems[8],"Reset Gamecube"); VIDEO_WaitVSync (); while (quit == 0) { ret = RunMenu (menuitems, menucount, (char*)"Main Menu"); switch (ret) { case 0: /*** Load ROM Menu ***/ quit = LoadManager (); break; case 1: /*** SRAM Manager Menu ***/ if ( ARAM_ROMSIZE > 0 ) SaveManager (); else WaitPrompt((char*) "No ROM is loaded!"); break; case 2: /*** Do Freeze / Thaw Menu ***/ if ( ARAM_ROMSIZE > 0 ) quit = FreezeManager (); else WaitPrompt((char*) "No ROM is loaded!"); break; case 3: /*** Configure Controllers ***/ ConfigureControllers (); break; case 4: /*** Emulator Options ***/ EmulatorOptions (); break; case 5: /*** Soft reset ***/ S9xSoftReset (); quit = 1; break; case 6: /*** Turn off DVD motor ***/ dvd_motor_off(); break; case 7: /*** Exit to Loader ***/ #ifdef __wii__ exit(0); #else // gamecube if (psoid[0] == PSOSDLOADID) PSOReload (); #endif break; case 8: /*** Reset the Gamecube/Wii ***/ Reboot(); break; case -1: /*** Button B ***/ case 9: /*** Return to Game ***/ quit = 1; break; } } /*** Remove any still held buttons ***/ #ifdef HW_RVL while( PAD_ButtonsHeld(0) || WPAD_ButtonsHeld(0) ) VIDEO_WaitVSync(); #else while( PAD_ButtonsHeld(0) ) VIDEO_WaitVSync(); #endif }
static void RunTitle(void) { if (MiniLoop(START_Title,STOP_Title,TIC_Abortable,DRAW_Title)==ga_exitdemo) { RunMenu(); /* Process the main menu */ } }
void PreferencesMenu () { int ret = 0; int quit = 0; int oldmenu = menu; menu = 0; while (quit == 0) { // some load/save methods are not implemented - here's where we skip them // they need to be skipped in the order they were enumerated in snes9xGX.h // no USB ports on GameCube #ifndef HW_RVL if(GCSettings.LoadMethod == METHOD_USB) GCSettings.LoadMethod++; if(GCSettings.SaveMethod == METHOD_USB) GCSettings.SaveMethod++; #endif // check if DVD access in Wii mode is disabled #ifndef WII_DVD if(GCSettings.LoadMethod == METHOD_DVD) GCSettings.LoadMethod++; #endif // saving to DVD is impossible if(GCSettings.SaveMethod == METHOD_DVD) GCSettings.SaveMethod++; // disable SMB in GC mode (stalls out) #ifndef HW_RVL if(GCSettings.LoadMethod == METHOD_SMB) GCSettings.LoadMethod++; if(GCSettings.SaveMethod == METHOD_SMB) GCSettings.SaveMethod++; #endif // disable MC saving in Wii mode - does not work for some reason! #ifdef HW_RVL if(GCSettings.SaveMethod == METHOD_MC_SLOTA) GCSettings.SaveMethod++; if(GCSettings.SaveMethod == METHOD_MC_SLOTB) GCSettings.SaveMethod++; #endif // correct load/save methods out of bounds if(GCSettings.LoadMethod > 4) GCSettings.LoadMethod = 0; if(GCSettings.SaveMethod > 6) GCSettings.SaveMethod = 0; if (GCSettings.LoadMethod == METHOD_AUTO) sprintf (prefmenu[0],"Load Method AUTO"); else if (GCSettings.LoadMethod == METHOD_SD) sprintf (prefmenu[0],"Load Method SD"); else if (GCSettings.LoadMethod == METHOD_USB) sprintf (prefmenu[0],"Load Method USB"); else if (GCSettings.LoadMethod == METHOD_DVD) sprintf (prefmenu[0],"Load Method DVD"); else if (GCSettings.LoadMethod == METHOD_SMB) sprintf (prefmenu[0],"Load Method Network"); sprintf (prefmenu[1], "Load Folder %s", GCSettings.LoadFolder); if (GCSettings.SaveMethod == METHOD_AUTO) sprintf (prefmenu[2],"Save Method AUTO"); else if (GCSettings.SaveMethod == METHOD_SD) sprintf (prefmenu[2],"Save Method SD"); else if (GCSettings.SaveMethod == METHOD_USB) sprintf (prefmenu[2],"Save Method USB"); else if (GCSettings.SaveMethod == METHOD_SMB) sprintf (prefmenu[2],"Save Method Network"); else if (GCSettings.SaveMethod == METHOD_MC_SLOTA) sprintf (prefmenu[2],"Save Method MC Slot A"); else if (GCSettings.SaveMethod == METHOD_MC_SLOTB) sprintf (prefmenu[2],"Save Method MC Slot B"); sprintf (prefmenu[3], "Save Folder %s", GCSettings.SaveFolder); // disable changing load/save directories for now prefmenu[1][0] = '\0'; prefmenu[3][0] = '\0'; // don't allow original render mode if progressive video mode detected if (GCSettings.render==0 && progressive) GCSettings.render++; if (GCSettings.AutoLoad == 0) sprintf (prefmenu[4],"Auto Load OFF"); else if (GCSettings.AutoLoad == 1) sprintf (prefmenu[4],"Auto Load SRAM"); else if (GCSettings.AutoLoad == 2) sprintf (prefmenu[4],"Auto Load SNAPSHOT"); if (GCSettings.AutoSave == 0) sprintf (prefmenu[5],"Auto Save OFF"); else if (GCSettings.AutoSave == 1) sprintf (prefmenu[5],"Auto Save SRAM"); else if (GCSettings.AutoSave == 2) sprintf (prefmenu[5],"Auto Save SNAPSHOT"); else if (GCSettings.AutoSave == 3) sprintf (prefmenu[5],"Auto Save BOTH"); sprintf (prefmenu[6], "Verify MC Saves %s", GCSettings.VerifySaves == true ? " ON" : "OFF"); sprintf (prefmenu[7], "Reverse Stereo %s", Settings.ReverseStereo == true ? " ON" : "OFF"); sprintf (prefmenu[8], "Interpolated Sound %s", Settings.InterpolatedSound == true ? " ON" : "OFF"); sprintf (prefmenu[9], "Transparency %s", Settings.Transparency == true ? " ON" : "OFF"); sprintf (prefmenu[10], "Display Frame Rate %s", Settings.DisplayFrameRate == true ? " ON" : "OFF"); sprintf (prefmenu[11], "Enable Zooming %s", GCSettings.NGCZoom == true ? " ON" : "OFF"); if ( GCSettings.render == 0 ) sprintf (prefmenu[12], "Video Rendering Original"); if ( GCSettings.render == 1 ) sprintf (prefmenu[12], "Video Rendering Filtered"); if ( GCSettings.render == 2 ) sprintf (prefmenu[12], "Video Rendering Unfiltered"); sprintf (prefmenu[13], "Video Scaling %s", GCSettings.widescreen == true ? "16:9 Correction" : "Default"); ret = RunMenu (prefmenu, prefmenuCount, (char*)"Preferences", 16); switch (ret) { case 0: GCSettings.LoadMethod ++; break; case 1: break; case 2: GCSettings.SaveMethod ++; break; case 3: break; case 4: GCSettings.AutoLoad ++; if (GCSettings.AutoLoad > 2) GCSettings.AutoLoad = 0; break; case 5: GCSettings.AutoSave ++; if (GCSettings.AutoSave > 3) GCSettings.AutoSave = 0; break; case 6: GCSettings.VerifySaves ^= 1; break; case 7: Settings.ReverseStereo ^= 1; break; case 8: Settings.InterpolatedSound ^= 1; break; case 9: Settings.Transparency ^= 1; break; case 10: Settings.DisplayFrameRate ^= 1; break; case 11: GCSettings.NGCZoom ^= 1; break; case 12: GCSettings.render++; if (GCSettings.render > 2 ) GCSettings.render = 0; break; case 13: GCSettings.widescreen ^= 1; break; case 14: SavePrefs(GCSettings.SaveMethod, NOTSILENT); break; case -1: /*** Button B ***/ case 15: quit = 1; break; } } menu = oldmenu; }
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; }
void ConfigureButtons (u16 ctrlr_type) { int quit = 0; int ret = 0; int oldmenu = menu; menu = 0; char* menu_title = NULL; u32 pressed; unsigned int* currentpadmap = 0; char temp[50] = ""; int i, j; uint k; /*** Update Menu Title (based on controller we're configuring) ***/ switch (ctrlr_type) { case CTRLR_NUNCHUK: menu_title = (char*)"SNES - NUNCHUK"; currentpadmap = ncpadmap; break; case CTRLR_CLASSIC: menu_title = (char*)"SNES - CLASSIC"; currentpadmap = ccpadmap; break; case CTRLR_GCPAD: menu_title = (char*)"SNES - GC PAD"; currentpadmap = gcpadmap; break; case CTRLR_WIIMOTE: menu_title = (char*)"SNES - WIIMOTE"; currentpadmap = wmpadmap; break; }; while (quit == 0) { /*** Update Menu with Current ButtonMap ***/ for (i=0; i<12; i++) // snes pad has 12 buttons to config (go thru them) { // get current padmap button name to display for ( j=0; j < ctrlr_def[ctrlr_type].num_btns && currentpadmap[i] != ctrlr_def[ctrlr_type].map[j].btn // match padmap button press with button names ; j++ ); memset (temp, 0, sizeof(temp)); strncpy (temp, cfg_btns_menu[i], 12); // copy snes button information if (currentpadmap[i] == ctrlr_def[ctrlr_type].map[j].btn) // check if a match was made { for (k=0; k<7-strlen(ctrlr_def[ctrlr_type].map[j].name) ;k++) strcat(temp, " "); // add whitespace padding to align text strncat (temp, ctrlr_def[ctrlr_type].map[j].name, 6); // update button map display } else strcat (temp, (char*)"---"); // otherwise, button is 'unmapped' strncpy (cfg_btns_menu[i], temp, 19); // move back updated information } ret = RunMenu (cfg_btns_menu, cfg_btns_count, menu_title, 16); switch (ret) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: /*** Change button map ***/ // wait for input memset (temp, 0, sizeof(temp)); strncpy(temp, cfg_btns_menu[ret], 6); // get the name of the snes button we're changing pressed = GetButtonMap(ctrlr_type, temp); // get a button selection from user // FIX: check if input is valid for this controller if (pressed != 0) // check if a the button was configured, or if the user exited. currentpadmap[ret] = pressed; // update mapping break; case -1: /*** Button B ***/ case 12: /*** Return ***/ quit = 1; break; } } menu = oldmenu; } // end configurebuttons()
void MainMenu (int selectedMenu) { tb_t start,end; mftb(&start); int quit = 0; int ret; #ifdef HW_RVL // don't show dvd motor off on the wii menuitems[5][0] = 0; // rename reset/exit items sprintf (menuitems[6], "Return to Wii Menu"); sprintf (menuitems[7], "Return to Homebrew Channel"); #endif // disable game-specific menu items if a ROM isn't loaded if (!ROMLoaded) menuitems[3][0] = '\0'; else sprintf (menuitems[3], "Game Menu"); VIDEO_WaitVSync (); while (quit == 0) { if(selectedMenu >= 0) { ret = selectedMenu; selectedMenu = -1; // default back to main menu } else { ret = RunMenu (menuitems, menucount, (char*)"Main Menu"); } switch (ret) { case 0: // Load ROM Menu quit = LoadManager (); break; case 1: // Configure Controllers ConfigureControllers (); break; case 2: // Preferences PreferencesMenu (); break; case 3: // Game Options quit = GameMenu (); break; case 4: // Credits Credits (); WaitButtonA (); break; case 5: // turn the dvd motor off (GC only) #ifdef HW_DOL dvd_motor_off (); #endif case 6: // Reset the Gamecube/Wii Reboot(); break; case 7: ExitToLoader(); break; case -1: // Button B // Return to Game if(ROMLoaded) quit = 1; break; } } // Wait for buttons to be released int count = 0; // how long we've been waiting for the user to release the button while(count < 50 && ( PAD_ButtonsHeld(0) #ifdef HW_RVL || WPAD_ButtonsHeld(0) #endif )) { VIDEO_WaitVSync(); count++; } mftb(&end); loadtimeradjust += tb_diff_msec(&end, &start); }
void mainmenu (int selectedMenu) { int quit = 0; int ret; // disable game-specific menu items if a ROM isn't loaded if ( ARAM_ROMSIZE == 0 ) menuitems[3][0] = '\0'; else sprintf (menuitems[3], "Game Menu"); VIDEO_WaitVSync (); while (quit == 0) { if(selectedMenu >= 0) { ret = selectedMenu; selectedMenu = -1; // default back to main menu } else { ret = RunMenu (menuitems, menucount, (char*)"Main Menu"); } switch (ret) { case 0: // Load ROM Menu quit = LoadManager (); break; case 1: // Configure Controllers ConfigureControllers (); break; case 2: // Preferences PreferencesMenu (); break; case 3: // Game Options quit = GameMenu (); break; case 4: // Credits Credits (); WaitButtonA (); break; case 5: // Reset the Gamecube/Wii Reboot(); break; case 6: // Exit to Loader #ifdef HW_RVL #ifdef WII_DVD DI_Close(); #endif exit(0); #else // gamecube if (psoid[0] == PSOSDLOADID) PSOReload (); #endif break; case -1: // Button B // Return to Game quit = 1; break; } } /*** Remove any still held buttons ***/ #ifdef HW_RVL while( PAD_ButtonsHeld(0) || WPAD_ButtonsHeld(0) ) VIDEO_WaitVSync(); #else while( PAD_ButtonsHeld(0) ) VIDEO_WaitVSync(); #endif }
void LCD_Task(void) { RunMenu(0) ; }