static int action_ok_file_load_with_detect_core(const char *path, const char *label, unsigned type, size_t idx) { int ret; const char *menu_path = NULL; menu_handle_t *menu = menu_driver_get_ptr(); settings_t *settings = config_get_ptr(); global_t *global = global_get_ptr(); if (!menu) return -1; menu_list_get_last_stack(menu->menu_list, &menu_path, NULL, NULL); ret = rarch_defer_core(global->core_info, menu_path, path, label, menu->deferred_path, sizeof(menu->deferred_path)); if (ret == -1) { event_command(EVENT_CMD_LOAD_CORE); menu_entries_common_load_content(false); return -1; } if (ret == 0) menu_list_push_stack_refresh( menu->menu_list, settings->libretro_directory, "deferred_core_list", 0, idx); return ret; }
static int archive_load(void) { int ret; const char *menu_path = NULL; const char *menu_label = NULL; const char* path = NULL; unsigned int type = 0; menu_handle_t *menu = menu_driver_get_ptr(); settings_t *settings = config_get_ptr(); global_t *global = global_get_ptr(); if (!menu) return -1; menu_list_pop_stack(menu->menu_list); menu_list_get_last_stack(menu->menu_list, &menu_path, &menu_label, NULL); if (menu_list_get_size(menu->menu_list) == 0) return 0; menu_list_get_at_offset(menu->menu_list->selection_buf, menu->navigation.selection_ptr, &path, NULL, &type); ret = rarch_defer_core(global->core_info, menu_path, path, menu_label, menu->deferred_path, sizeof(menu->deferred_path)); switch (ret) { case -1: event_command(EVENT_CMD_LOAD_CORE); menu_entries_common_load_content(false); break; case 0: menu_list_push_stack_refresh( menu->menu_list, settings->libretro_directory, "deferred_core_list", 0, menu->navigation.selection_ptr); break; } return 0; }
static int action_ok_core_load_deferred(const char *path, const char *label, unsigned type, size_t idx) { menu_handle_t *menu = menu_driver_get_ptr(); settings_t *settings = config_get_ptr(); global_t *global = global_get_ptr(); if (!menu) return -1; if (path) strlcpy(settings->libretro, path, sizeof(settings->libretro)); strlcpy(global->fullpath, menu->deferred_path, sizeof(global->fullpath)); menu_entries_common_load_content(false); return -1; }
static int action_ok_core_load(const char *path, const char *label, unsigned type, size_t idx) { const char *menu_path = NULL; menu_handle_t *menu = menu_driver_get_ptr(); settings_t *settings = config_get_ptr(); global_t *global = global_get_ptr(); if (!menu) return -1; (void)global; menu_list_get_last_stack(menu->menu_list, &menu_path, NULL, NULL); fill_pathname_join(settings->libretro, menu_path, path, sizeof(settings->libretro)); event_command(EVENT_CMD_LOAD_CORE); menu_list_flush_stack(menu->menu_list, NULL, MENU_SETTINGS); #if defined(HAVE_DYNAMIC) /* No content needed for this core, load core immediately. */ if (menu->load_no_content && settings->core.set_supports_no_game_enable) { *global->fullpath = '\0'; menu_entries_common_load_content(false); return -1; } return 0; /* Core selection on non-console just updates directory listing. * Will take effect on new content load. */ #elif defined(RARCH_CONSOLE) event_command(EVENT_CMD_RESTART_RETROARCH); return -1; #endif }
static int action_ok_file_load(const char *path, const char *label, unsigned type, size_t idx) { const char *menu_label = NULL; const char *menu_path = NULL; rarch_setting_t *setting = NULL; menu_handle_t *menu = menu_driver_get_ptr(); global_t *global = global_get_ptr(); if (!menu) return -1; menu_list_get_last(menu->menu_list->menu_stack, &menu_path, &menu_label, NULL); setting = menu_setting_find(menu_label); if (setting && setting->type == ST_PATH) { menu_action_setting_set_current_string_path(setting, menu_path, path); menu_list_pop_stack_by_needle(menu->menu_list, setting->name); } else { if (type == MENU_FILE_IN_CARCHIVE) fill_pathname_join_delim(global->fullpath, menu_path, path, '#',sizeof(global->fullpath)); else fill_pathname_join(global->fullpath, menu_path, path, sizeof(global->fullpath)); menu_entries_common_load_content(true); return -1; } return 0; }
static int action_ok_file_load_with_detect_core(const char *path, const char *label, unsigned type, size_t idx) { int ret; menu_displaylist_info_t info = {0}; const char *menu_path = NULL; menu_handle_t *menu = menu_driver_get_ptr(); settings_t *settings = config_get_ptr(); global_t *global = global_get_ptr(); if (!menu) return -1; menu_list_get_last_stack(menu->menu_list, &menu_path, NULL, NULL); ret = rarch_defer_core(global->core_info, menu_path, path, label, menu->deferred_path, sizeof(menu->deferred_path)); if (ret == -1) { if (!strcmp(label, "collection")) { info.list = menu->menu_list->menu_stack; info.type = 0; info.directory_ptr = idx; rdb_entry_start_game_selection_ptr = idx; strlcpy(info.path, settings->libretro_directory, sizeof(info.path)); strlcpy(info.label, "deferred_core_list_set", sizeof(info.label)); return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC); } else { event_command(EVENT_CMD_LOAD_CORE); menu_entries_common_load_content(false); return -1; } } if (ret == 0) { info.list = menu->menu_list->menu_stack; info.type = 0; info.directory_ptr = idx; strlcpy(info.path, settings->libretro_directory, sizeof(info.path)); if (!strcmp(label, "collection")) { rdb_entry_start_game_selection_ptr = idx; strlcpy(info.label, "deferred_core_list_set", sizeof(info.label)); } else strlcpy(info.label, "deferred_core_list", sizeof(info.label)); ret = menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC); } return ret; }