void __Menu_Controls(void) { u32 buttons = Wpad_WaitButtons(); /* UP/DOWN buttons */ if (buttons & WPAD_BUTTON_UP) __Menu_MoveList(-1); if (buttons & WPAD_BUTTON_DOWN) __Menu_MoveList(1); /* LEFT/RIGHT buttons */ if (buttons & WPAD_BUTTON_LEFT) __Menu_MoveList(-ENTRIES_PER_PAGE); if (buttons & WPAD_BUTTON_RIGHT) __Menu_MoveList(ENTRIES_PER_PAGE); /* HOME button */ if (buttons & WPAD_BUTTON_HOME) Restart(); /* PLUS (+) button */ if (buttons & WPAD_BUTTON_PLUS) Menu_Manage(selected, 'i'); /* MINUS (-) button */ if (buttons & WPAD_BUTTON_MINUS) Menu_Manage(selected, 'u'); /* ONE (1) button */ if (buttons & WPAD_BUTTON_1) Menu_Device(); }
void __Menu_Controls(void) { u32 buttons = Wpad_WaitButtons(); /* UP/DOWN buttons */ if (buttons & WPAD_BUTTON_UP) __Menu_MoveList(-1); if (buttons & WPAD_BUTTON_DOWN) __Menu_MoveList(1); /* LEFT/RIGHT buttons */ if (buttons & WPAD_BUTTON_LEFT) __Menu_MoveList(-ENTRIES_PER_PAGE); if (buttons & WPAD_BUTTON_RIGHT) __Menu_MoveList(ENTRIES_PER_PAGE); /* HOME button */ if (buttons & WPAD_BUTTON_HOME) Restart(); /* A button */ if (buttons & WPAD_BUTTON_A) Firmware_Install(&fwList[selected]); }
void __Menu_Controls(void) { if (CFG.gui == CFG_GUI_START) { go_gui = true; goto gui_mode; } //u32 buttons = Wpad_WaitButtons(); u32 buttons = Wpad_WaitButtonsRpt(); /* UP/DOWN buttons */ if (buttons & WPAD_BUTTON_UP) __Menu_MoveList(-1); if (buttons & WPAD_BUTTON_DOWN) __Menu_MoveList(1); /* LEFT/RIGHT buttons */ if (buttons & WPAD_BUTTON_LEFT) { //__Menu_MoveList(-ENTRIES_PER_PAGE); if (CFG.cursor_jump) { __Menu_MoveList(-CFG.cursor_jump); } else { __Menu_MoveList((gameSelected-gameStart == 0) ? -ENTRIES_PER_PAGE : -(gameSelected-gameStart)); } } if (buttons & WPAD_BUTTON_RIGHT) { //__Menu_MoveList(ENTRIES_PER_PAGE); if (CFG.cursor_jump) { __Menu_MoveList(CFG.cursor_jump); } else { __Menu_MoveList((gameSelected-gameStart == (ENTRIES_PER_PAGE - 1)) ? ENTRIES_PER_PAGE : ENTRIES_PER_PAGE - (gameSelected-gameStart) - 1); } } check_buttons: if (CFG.admin_lock) { if (buttons & CFG.button_other.mask) { static long long t_start; long long t_now; unsigned ms_diff = 0; bool display_unlock = false; Con_Clear(); t_start = gettime(); while (!display_unlock && (Wpad_Held(0) & CFG.button_other.mask)) { buttons = Wpad_GetButtons(); VIDEO_WaitVSync(); t_now = gettime(); ms_diff = diff_msec(t_start, t_now); if (ms_diff > 5000) display_unlock = true; } if (display_unlock) Menu_Unlock(); else buttons = buttonmap[MASTER][CFG.button_other.num]; } } /* A button */ //if (buttons & CFG.button_confirm.mask) // Menu_Boot(0); int i; for (i = 4; i < MAX_BUTTONS; i++) { if (buttons & buttonmap[MASTER][i]) DoAction(*(&CFG.button_M + (i - 4))); } //if (buttons & CFG.button_cancel.mask) // DoAction(CFG.button_B); ///* HOME button */ //if (buttons & CFG.button_exit.mask) { // DoAction(CFG.button_H); // //Handle_Home(1); //} ///* PLUS (+) button */ //if (buttons & WPAD_BUTTON_PLUS) // DoAction(CFG.button_P); //// Menu_Install(); ///* MINUS (-) button */ //if (buttons & WPAD_BUTTON_MINUS) // DoAction(CFG.button_M); //// Menu_Views(); //// Menu_Remove(); //if (buttons & WPAD_BUTTON_2) // DoAction(CFG.button_2); //if (buttons & CFG.button_other.mask) // DoAction(CFG.button_1); //if (buttons & WPAD_BUTTON_X) // DoAction(CFG.button_X); //if (buttons & WPAD_BUTTON_Y) // DoAction(CFG.button_Y); //if (buttons & WPAD_BUTTON_Z) // DoAction(CFG.button_Z); //if (buttons & WPAD_BUTTON_C) // DoAction(CFG.button_C); //if (buttons & WPAD_BUTTON_L) // DoAction(CFG.button_L); //if (buttons & WPAD_BUTTON_R) // DoAction(CFG.button_R); //// button 2 - switch favorites //if (buttons & CFG.button_save.mask) { // extern void reset_sort_default(); // reset_sort_default(); // Switch_Favorites(!enable_favorite); //} //if (CFG.gui) { // if (CFG.buttons == CFG_BTN_OPTIONS_1) { // if (buttons & CFG.button_cancel.mask) go_gui = true; // } else if (CFG.buttons == CFG_BTN_OPTIONS_B) { // if (buttons & CFG.button_other.mask) go_gui = true; // } //} //if (!CFG.disable_options) { // if (CFG.buttons == CFG_BTN_OPTIONS_1) { // if (buttons & CFG.button_other.mask) Menu_Options(); // } else if (CFG.buttons == CFG_BTN_OPTIONS_B) { // if (buttons & CFG.button_cancel.mask) Menu_Options(); // } else { // /* ONE (1) button */ // if (buttons & CFG.button_other.mask) { // //Menu_Device(); // Menu_Options(); // } // } //} if (go_gui) { gui_mode:; int prev_sel = gameSelected; CFG.gui = 1; // disable auto start buttons = Gui_Mode(); if (prev_sel != gameSelected) { // List scrolling __Menu_ScrollStartList(); } // if only returning to con mode, clear button status /*if (CFG.buttons == CFG_BTN_OPTIONS_1) { if (buttons & CFG.button_cancel.mask) buttons = 0; } else if (CFG.buttons == CFG_BTN_OPTIONS_B) { if (buttons & CFG.button_other.mask) buttons = 0; } */ // if action started from gui, process it then return to gui //if (buttons) { // go_gui = true; goto check_buttons; //} } }