/* Clicks the back button */ int menu_entries_select_back(void) { menu_list_t *menu_list = menu_list_get_ptr(); if (!menu_list) return -1; menu_setting_apply_deferred(); menu_list_pop_stack(menu_list); if (menu_needs_refresh()) menu_do_refresh(MENU_ACTION_CANCEL); rarch_main_data_iterate(); return 0; }
void rarch_main_data_iterate(void) { data_runloop_t *runloop = rarch_main_data_get_ptr(); settings_t *settings = config_get_ptr(); (void)settings; #ifdef HAVE_THREADS if (settings->menu.threaded_data_runloop_enable) { switch (runloop->thread_code) { case THREAD_CODE_INIT: rarch_main_data_thread_init(); break; case THREAD_CODE_DEINIT: case THREAD_CODE_ALIVE: break; } } #endif #ifdef HAVE_OVERLAY rarch_main_data_overlay_image_upload_iterate(false, runloop); #endif #ifdef HAVE_RPNG rarch_main_data_nbio_image_upload_iterate(false, runloop); #endif if (data_runloop_msg[0] != '\0') { rarch_main_msg_queue_push(data_runloop_msg, 1, 10, true); data_runloop_msg[0] = '\0'; } #ifdef HAVE_MENU menu_do_refresh(MENU_ACTION_REFRESH); #endif #ifdef HAVE_THREADS if (settings->menu.threaded_data_runloop_enable && runloop->alive) return; #endif data_runloop_iterate(false, runloop); }
/** * menu_iterate: * @input : input sample for this frame * @old_input : input sample of the previous frame * @trigger_input : difference' input sample - difference * between 'input' and 'old_input' * * Runs RetroArch menu for one frame. * * Returns: 0 on success, -1 if we need to quit out of the loop. **/ int menu_iterate(retro_input_t input, retro_input_t old_input, retro_input_t trigger_input) { static retro_time_t last_clock_update = 0; int32_t ret = 0; unsigned action = 0; runloop_t *runloop = rarch_main_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr(); settings_t *settings = config_get_ptr(); menu->input.joypad = menu_input_frame(input, trigger_input); menu->cur_time = rarch_get_time_usec(); menu->dt = menu->cur_time - menu->old_time; if (menu->dt >= IDEAL_DT * 4) menu->dt = IDEAL_DT * 4; if (menu->dt <= IDEAL_DT / 4) menu->dt = IDEAL_DT / 4; menu->old_time = menu->cur_time; if (menu->cur_time - last_clock_update > 1000000 && settings->menu.timedate_enable) { menu->label.is_updated = true; last_clock_update = menu->cur_time; } action = menu->input.joypad; if (menu_do_refresh(action) == 0) return 0; ret = menu_entry_iterate(action); if (runloop->is_menu && !runloop->is_idle) menu_display_fb(); menu_driver_set_texture(); if (ret) return -1; return 0; }