2015-02-26 15:50:30 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
|
|
|
* Copyright (C) 2011-2015 - Daniel De Matteis
|
|
|
|
*
|
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <file/file_path.h>
|
|
|
|
#include "menu.h"
|
2015-05-18 21:02:04 +00:00
|
|
|
#include "menu_display.h"
|
2015-02-26 15:50:30 +00:00
|
|
|
#include "menu_entries_cbs.h"
|
|
|
|
#include "menu_setting.h"
|
|
|
|
#include "menu_shader.h"
|
|
|
|
#include "menu_navigation.h"
|
|
|
|
|
|
|
|
#include "../retroarch.h"
|
2015-03-24 12:45:53 +00:00
|
|
|
#include "../runloop_data.h"
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
#include "../input/input_remapping.h"
|
|
|
|
|
|
|
|
/* FIXME - Global variables, refactor */
|
|
|
|
unsigned rdb_entry_start_game_selection_ptr;
|
|
|
|
size_t hack_shader_pass = 0;
|
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
char core_updater_path[PATH_MAX_LENGTH];
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static int menu_action_setting_set_current_string_path(
|
|
|
|
rarch_setting_t *setting, const char *dir, const char *path)
|
|
|
|
{
|
|
|
|
fill_pathname_join(setting->value.string, dir, path, setting->size);
|
|
|
|
return menu_setting_generic(setting);
|
|
|
|
}
|
|
|
|
|
2015-05-26 02:52:16 +00:00
|
|
|
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)
|
|
|
|
{
|
|
|
|
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));
|
2015-05-26 04:28:16 +00:00
|
|
|
if (!strcmp(label, "collection"))
|
2015-05-26 06:38:38 +00:00
|
|
|
{
|
|
|
|
rdb_entry_start_game_selection_ptr = idx;
|
2015-05-26 04:28:16 +00:00
|
|
|
strlcpy(info.label, "deferred_core_list_set", sizeof(info.label));
|
2015-05-26 06:38:38 +00:00
|
|
|
}
|
2015-05-26 04:28:16 +00:00
|
|
|
else
|
|
|
|
strlcpy(info.label, "deferred_core_list", sizeof(info.label));
|
2015-05-26 02:52:16 +00:00
|
|
|
|
|
|
|
ret = menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_playlist_entry(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-05-26 02:52:16 +00:00
|
|
|
const char *entry_path = NULL;
|
|
|
|
const char *entry_label = NULL;
|
|
|
|
const char *core_path = NULL;
|
|
|
|
const char *core_name = NULL;
|
2015-05-25 23:58:52 +00:00
|
|
|
size_t selection_ptr = 0;
|
2015-05-22 22:44:58 +00:00
|
|
|
content_playlist_t *playlist = g_defaults.history;
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-02-26 15:50:30 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
2015-05-25 23:58:52 +00:00
|
|
|
if (!strcmp(label, "collection") ||
|
|
|
|
!strcmp(label, "rdb_entry_start_game"))
|
|
|
|
{
|
2015-05-26 02:27:21 +00:00
|
|
|
if (!menu->playlist)
|
2015-05-26 00:06:38 +00:00
|
|
|
return -1;
|
2015-05-26 02:27:21 +00:00
|
|
|
|
|
|
|
playlist = menu->playlist;
|
2015-05-25 23:58:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
selection_ptr = menu->navigation.selection_ptr;
|
|
|
|
|
|
|
|
if (!strcmp(label, "rdb_entry_start_game"))
|
2015-05-26 00:00:50 +00:00
|
|
|
selection_ptr = rdb_entry_start_game_selection_ptr;
|
2015-05-25 23:58:52 +00:00
|
|
|
|
2015-05-26 02:52:16 +00:00
|
|
|
content_playlist_get_index(playlist, idx,
|
|
|
|
&entry_path, &entry_label, &core_path, &core_name, NULL);
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
RARCH_LOG("path: %s, label: %s, core path: %s, core name: %s\n", entry_path, entry_label,
|
|
|
|
core_path, core_name);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (!strcmp(core_path, "DETECT") && !strcmp(core_name, "DETECT"))
|
|
|
|
return action_ok_file_load_with_detect_core(entry_path, label, type, idx);
|
|
|
|
|
|
|
|
|
2015-05-25 23:58:52 +00:00
|
|
|
rarch_playlist_load_content(playlist, selection_ptr);
|
|
|
|
|
2015-05-17 17:49:14 +00:00
|
|
|
menu_list_flush_stack(menu->menu_list, NULL, MENU_SETTINGS);
|
2015-02-26 15:50:30 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
static int action_ok_cheat_apply_changes(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-03-21 04:42:49 +00:00
|
|
|
global_t *global = global_get_ptr();
|
|
|
|
cheat_manager_t *cheat = global->cheat;
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
if (!cheat)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
cheat_manager_apply_cheats(cheat);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_shader_pass_load(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
const char *menu_path = NULL;
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-02-26 15:50:30 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
(void)menu_path;
|
|
|
|
|
|
|
|
#ifdef HAVE_SHADER_MANAGER
|
|
|
|
menu_list_get_last_stack(menu->menu_list, &menu_path, NULL,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
fill_pathname_join(menu->shader->pass[hack_shader_pass].source.path,
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_path, path,
|
2015-02-26 15:50:30 +00:00
|
|
|
sizeof(menu->shader->pass[hack_shader_pass].source.path));
|
|
|
|
|
|
|
|
/* This will reset any changed parameters. */
|
|
|
|
video_shader_resolve_parameters(NULL, menu->shader);
|
2015-05-17 17:49:14 +00:00
|
|
|
menu_list_flush_stack(menu->menu_list, "shader_options", 0);
|
2015-02-26 15:50:30 +00:00
|
|
|
return 0;
|
|
|
|
#else
|
|
|
|
return -1;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef HAVE_SHADER_MANAGER
|
|
|
|
extern size_t hack_shader_pass;
|
|
|
|
#endif
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_shader_pass(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
|
|
|
hack_shader_pass = type - MENU_SETTINGS_SHADER_PASS_0;
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-03-20 20:22:38 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
2015-05-17 16:18:17 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.path, settings->video.shader_dir, sizeof(info.path));
|
|
|
|
strlcpy(info.label, label, sizeof(info.label));
|
|
|
|
|
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_shader_parameters(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = MENU_SETTING_ACTION;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.label, label, sizeof(info.label));
|
|
|
|
|
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_push_generic_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-02-26 15:50:30 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
if (path)
|
|
|
|
strlcpy(menu->deferred_path, path,
|
2015-02-26 15:50:30 +00:00
|
|
|
sizeof(menu->deferred_path));
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.label, label, sizeof(info.label));
|
|
|
|
|
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_push_default(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.path, label, sizeof(info.path));
|
|
|
|
strlcpy(info.label, label, sizeof(info.label));
|
|
|
|
|
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_shader_preset(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-03-20 20:22:38 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.path, settings->video.shader_dir, sizeof(info.path));
|
|
|
|
strlcpy(info.label, label, sizeof(info.label));
|
2015-05-17 13:00:03 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_push_content_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-03-20 20:22:38 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = MENU_FILE_DIRECTORY;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.path, settings->menu_content_directory, sizeof(info.path));
|
|
|
|
strlcpy(info.label, label, sizeof(info.label));
|
2015-05-17 13:00:03 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_disk_image_append_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-03-20 20:22:38 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.path, settings->menu_content_directory, sizeof(info.path));
|
|
|
|
strlcpy(info.label, label, sizeof(info.label));
|
2015-05-17 13:00:03 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_configurations_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
2015-03-20 20:22:38 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
|
|
|
const char *dir = settings->menu_config_directory;
|
|
|
|
if (!menu)
|
|
|
|
return -1;
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2015-05-17 13:00:03 +00:00
|
|
|
if (dir)
|
2015-05-17 16:18:17 +00:00
|
|
|
strlcpy(info.path, dir, sizeof(info.path));
|
2015-05-17 13:00:03 +00:00
|
|
|
else
|
2015-05-17 16:18:17 +00:00
|
|
|
strlcpy(info.path, label, sizeof(info.path));
|
|
|
|
strlcpy(info.label, label, sizeof(info.label));
|
2015-05-17 13:00:03 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_cheat_file(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-03-20 20:22:38 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
2015-05-17 16:18:17 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.path, settings->cheat_database, sizeof(info.path));
|
|
|
|
strlcpy(info.label, label, sizeof(info.label));
|
2015-05-17 13:00:03 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_audio_dsp_plugin(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-04-07 03:55:49 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
2015-05-17 16:18:17 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
2015-04-07 03:55:49 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = 0;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.path, settings->audio.filter_dir, sizeof(info.path));
|
|
|
|
strlcpy(info.label, "audio_dsp_plugin", sizeof(info.label));
|
2015-05-17 13:00:03 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_video_filter(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-03-20 20:22:38 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
2015-02-26 15:50:30 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = 0;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.path, settings->video.filter_dir, sizeof(info.path));
|
|
|
|
strlcpy(info.label, "deferred_video_filter", sizeof(info.label));
|
2015-05-17 13:00:03 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_core_updater_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-27 08:25:09 +00:00
|
|
|
{
|
|
|
|
char url_path[PATH_MAX_LENGTH];
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
2015-05-17 16:19:56 +00:00
|
|
|
driver_t *driver = driver_get_ptr();
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-03-20 20:22:38 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
2015-02-27 08:25:09 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
driver->menu->nonblocking_refresh = true;
|
2015-02-27 08:25:09 +00:00
|
|
|
|
|
|
|
(void)url_path;
|
|
|
|
|
2015-03-20 20:22:38 +00:00
|
|
|
if (settings->network.buildbot_url[0] == '\0')
|
2015-02-27 08:25:09 +00:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
#ifdef HAVE_NETWORKING
|
2015-04-13 09:26:02 +00:00
|
|
|
event_command(EVENT_CMD_NETWORK_INIT);
|
2015-02-27 08:25:09 +00:00
|
|
|
|
2015-03-20 20:22:38 +00:00
|
|
|
fill_pathname_join(url_path, settings->network.buildbot_url,
|
2015-02-27 08:25:09 +00:00
|
|
|
".index", sizeof(url_path));
|
|
|
|
|
2015-03-15 05:41:04 +00:00
|
|
|
rarch_main_data_msg_queue_push(DATA_TYPE_HTTP, url_path, "cb_core_updater_list", 0, 1,
|
|
|
|
true);
|
2015-02-27 08:25:09 +00:00
|
|
|
#endif
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.path, path, sizeof(info.path));
|
|
|
|
strlcpy(info.label, "deferred_core_updater_list", sizeof(info.label));
|
2015-02-27 08:25:09 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-05-17 13:00:03 +00:00
|
|
|
}
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_remap_file(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-03-20 20:22:38 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.path, settings->input_remapping_directory, sizeof(info.path));
|
|
|
|
strlcpy(info.label, label, sizeof(info.label));
|
2015-05-17 13:00:03 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_record_configfile(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-04-15 07:18:30 +00:00
|
|
|
{
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-04-15 07:18:30 +00:00
|
|
|
global_t *global = global_get_ptr();
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.path, global->record.config_dir, sizeof(info.path));
|
|
|
|
strlcpy(info.label, label, sizeof(info.label));
|
2015-05-17 13:00:03 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-04-15 07:18:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-21 22:28:02 +00:00
|
|
|
static int action_ok_playlist_collection(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
|
|
|
{
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
|
|
|
menu_displaylist_info_t info = {0};
|
|
|
|
|
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.path, path, sizeof(info.path));
|
|
|
|
strlcpy(info.label, label, sizeof(info.label));
|
|
|
|
|
2015-05-22 00:51:45 +00:00
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-05-21 22:28:02 +00:00
|
|
|
}
|
|
|
|
|
2015-05-21 20:22:37 +00:00
|
|
|
static int action_ok_content_collection_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
|
|
|
{
|
|
|
|
menu_displaylist_info_t info = {0};
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.path, settings->playlist_directory, sizeof(info.path));
|
|
|
|
strlcpy(info.label, label, sizeof(info.label));
|
|
|
|
|
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_core_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-03-20 20:22:38 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.path, settings->libretro_directory, sizeof(info.path));
|
|
|
|
strlcpy(info.label, label, sizeof(info.label));
|
|
|
|
|
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_record_configfile_load(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-04-15 08:55:23 +00:00
|
|
|
{
|
|
|
|
const char *menu_path = NULL;
|
|
|
|
global_t *global = global_get_ptr();
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
|
|
|
if (!menu || !global)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
menu_list_get_last_stack(menu->menu_list, &menu_path, NULL,
|
|
|
|
NULL);
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
fill_pathname_join(global->record.config, menu_path, path, sizeof(global->record.config));
|
2015-04-15 08:55:23 +00:00
|
|
|
|
2015-05-17 17:49:14 +00:00
|
|
|
menu_list_flush_stack(menu->menu_list, "Recording Settings", 0);
|
2015-04-15 08:55:23 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_remap_file_load(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
const char *menu_path = NULL;
|
|
|
|
char remap_path[PATH_MAX_LENGTH];
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-02-26 15:50:30 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
(void)remap_path;
|
|
|
|
(void)menu_path;
|
|
|
|
|
|
|
|
menu_list_get_last_stack(menu->menu_list, &menu_path, NULL,
|
|
|
|
NULL);
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
fill_pathname_join(remap_path, menu_path, path, sizeof(remap_path));
|
2015-02-26 15:50:30 +00:00
|
|
|
input_remapping_load_file(remap_path);
|
|
|
|
|
2015-05-17 17:49:14 +00:00
|
|
|
menu_list_flush_stack(menu->menu_list, "core_input_remapping_options", 0);
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_video_filter_file_load(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
char filter_path[PATH_MAX_LENGTH];
|
2015-03-20 20:22:38 +00:00
|
|
|
const char *menu_path = NULL;
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-03-20 20:22:38 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
2015-02-26 15:50:30 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
(void)filter_path;
|
|
|
|
(void)menu_path;
|
|
|
|
|
|
|
|
menu_list_get_last_stack(menu->menu_list, &menu_path, NULL,
|
|
|
|
NULL);
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
fill_pathname_join(filter_path, menu_path, path, sizeof(filter_path));
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-03-20 20:22:38 +00:00
|
|
|
strlcpy(settings->video.softfilter_plugin, filter_path,
|
|
|
|
sizeof(settings->video.softfilter_plugin));
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-04-13 09:26:02 +00:00
|
|
|
event_command(EVENT_CMD_REINIT);
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-05-17 17:49:14 +00:00
|
|
|
menu_list_flush_stack(menu->menu_list, "video_options", 0);
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_cheat_file_load(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
const char *menu_path = NULL;
|
|
|
|
char cheat_path[PATH_MAX_LENGTH];
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-03-21 04:42:49 +00:00
|
|
|
global_t *global = global_get_ptr();
|
2015-02-26 15:50:30 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
(void)cheat_path;
|
|
|
|
(void)menu_path;
|
|
|
|
menu_list_get_last_stack(menu->menu_list, &menu_path, NULL,
|
|
|
|
NULL);
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
fill_pathname_join(cheat_path, menu_path, path, sizeof(cheat_path));
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-03-21 04:42:49 +00:00
|
|
|
if (global->cheat)
|
|
|
|
cheat_manager_free(global->cheat);
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-03-21 04:42:49 +00:00
|
|
|
global->cheat = cheat_manager_load(cheat_path);
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-03-21 04:42:49 +00:00
|
|
|
if (!global->cheat)
|
2015-02-26 15:50:30 +00:00
|
|
|
return -1;
|
|
|
|
|
2015-05-17 17:49:14 +00:00
|
|
|
menu_list_flush_stack(menu->menu_list, "core_cheat_options", 0);
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_menu_wallpaper_load(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-03-20 20:22:38 +00:00
|
|
|
char wallpaper_path[PATH_MAX_LENGTH];
|
2015-02-26 15:50:30 +00:00
|
|
|
const char *menu_label = NULL;
|
2015-03-20 20:22:38 +00:00
|
|
|
const char *menu_path = NULL;
|
2015-02-26 15:50:30 +00:00
|
|
|
rarch_setting_t *setting = NULL;
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-03-20 20:22:38 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
2015-02-26 15:50:30 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_list_get_last_stack(menu->menu_list, &menu_path, &menu_label,
|
|
|
|
NULL);
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
setting = menu_setting_find(menu_label);
|
|
|
|
|
|
|
|
if (!setting)
|
|
|
|
return -1;
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
fill_pathname_join(wallpaper_path, menu_path, path, sizeof(wallpaper_path));
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
if (path_file_exists(wallpaper_path))
|
|
|
|
{
|
2015-03-20 20:22:38 +00:00
|
|
|
strlcpy(settings->menu.wallpaper, wallpaper_path, sizeof(settings->menu.wallpaper));
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-03-15 05:41:04 +00:00
|
|
|
rarch_main_data_msg_queue_push(DATA_TYPE_IMAGE, wallpaper_path, "cb_menu_wallpaper", 0, 1,
|
|
|
|
true);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
menu_list_pop_stack_by_needle(menu->menu_list, setting->name);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_shader_preset_load(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
const char *menu_path = NULL;
|
|
|
|
char shader_path[PATH_MAX_LENGTH];
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-02-26 15:50:30 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
(void)shader_path;
|
|
|
|
(void)menu_path;
|
|
|
|
#ifdef HAVE_SHADER_MANAGER
|
|
|
|
menu_list_get_last_stack(menu->menu_list, &menu_path, NULL,
|
|
|
|
NULL);
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
fill_pathname_join(shader_path, menu_path, path, sizeof(shader_path));
|
2015-02-26 15:50:30 +00:00
|
|
|
menu_shader_manager_set_preset(menu->shader,
|
|
|
|
video_shader_parse_type(shader_path, RARCH_SHADER_NONE),
|
|
|
|
shader_path);
|
2015-05-17 17:49:14 +00:00
|
|
|
menu_list_flush_stack(menu->menu_list, "shader_options", 0);
|
2015-02-26 15:50:30 +00:00
|
|
|
return 0;
|
|
|
|
#else
|
|
|
|
return -1;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_cheat(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
menu_input_key_start_line("Input Cheat",
|
2015-05-17 16:18:17 +00:00
|
|
|
label, type, idx, menu_input_st_cheat_callback);
|
2015-02-26 15:50:30 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_shader_preset_save_as(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
menu_input_key_start_line("Preset Filename",
|
2015-05-17 16:18:17 +00:00
|
|
|
label, type, idx, menu_input_st_string_callback);
|
2015-02-26 15:50:30 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_cheat_file_save_as(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
menu_input_key_start_line("Cheat Filename",
|
2015-05-17 16:18:17 +00:00
|
|
|
label, type, idx, menu_input_st_string_callback);
|
2015-02-26 15:50:30 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_remap_file_save_as(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
menu_input_key_start_line("Remapping Filename",
|
2015-05-17 16:18:17 +00:00
|
|
|
label, type, idx, menu_input_st_string_callback);
|
2015-02-26 15:50:30 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_remap_file_save_core(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-04-06 23:47:58 +00:00
|
|
|
{
|
|
|
|
global_t *global = global_get_ptr();
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
const char *core_name;
|
2015-04-06 23:47:58 +00:00
|
|
|
core_name = global->system.info.library_name;
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
char directory[PATH_MAX_LENGTH];
|
|
|
|
char file[PATH_MAX_LENGTH];
|
|
|
|
|
2015-04-06 23:47:58 +00:00
|
|
|
fill_pathname_join(directory,settings->input_remapping_directory,core_name,PATH_MAX_LENGTH);
|
|
|
|
fill_pathname_join(file,core_name,core_name,PATH_MAX_LENGTH);
|
2015-04-08 03:51:31 +00:00
|
|
|
|
2015-04-06 23:47:58 +00:00
|
|
|
if(!path_file_exists(directory))
|
|
|
|
path_mkdir(directory);
|
2015-04-08 03:51:31 +00:00
|
|
|
|
2015-04-08 03:40:42 +00:00
|
|
|
if(input_remapping_save_file(file))
|
|
|
|
rarch_main_msg_queue_push("Remap file saved successfully", 1, 100, true);
|
|
|
|
else
|
2015-04-08 03:51:31 +00:00
|
|
|
rarch_main_msg_queue_push("Error saving remap file", 1, 100, true);
|
|
|
|
|
2015-04-06 23:47:58 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_remap_file_save_game(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-04-06 23:47:58 +00:00
|
|
|
{
|
|
|
|
global_t *global = global_get_ptr();
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
const char *core_name;
|
2015-04-06 23:47:58 +00:00
|
|
|
core_name = global->system.info.library_name;
|
2015-05-17 16:18:17 +00:00
|
|
|
|
|
|
|
const char *game_name;
|
2015-04-06 23:47:58 +00:00
|
|
|
game_name = path_basename(global->basename);
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
char directory[PATH_MAX_LENGTH];
|
|
|
|
char file[PATH_MAX_LENGTH];
|
|
|
|
|
2015-04-06 23:47:58 +00:00
|
|
|
fill_pathname_join(directory,settings->input_remapping_directory,core_name,PATH_MAX_LENGTH);
|
|
|
|
fill_pathname_join(file,core_name,game_name,PATH_MAX_LENGTH);
|
2015-04-08 03:51:31 +00:00
|
|
|
|
2015-04-06 23:47:58 +00:00
|
|
|
if(!path_file_exists(directory))
|
|
|
|
path_mkdir(directory);
|
2015-04-08 03:51:31 +00:00
|
|
|
|
2015-04-08 03:40:42 +00:00
|
|
|
if(input_remapping_save_file(file))
|
|
|
|
rarch_main_msg_queue_push("Remap file saved successfully", 1, 100, true);
|
|
|
|
else
|
2015-04-08 03:51:31 +00:00
|
|
|
rarch_main_msg_queue_push("Error saving remap file", 1, 100, true);
|
|
|
|
|
2015-04-06 23:47:58 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_path_use_directory(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
const char *menu_label = NULL;
|
|
|
|
const char *menu_path = NULL;
|
|
|
|
rarch_setting_t *setting = NULL;
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-02-26 15:50:30 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
menu_list_get_last_stack(menu->menu_list,
|
|
|
|
&menu_path, &menu_label, NULL);
|
|
|
|
|
|
|
|
setting = menu_setting_find(menu_label);
|
|
|
|
|
|
|
|
if (!setting)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (setting->type != ST_DIR)
|
|
|
|
return -1;
|
|
|
|
|
2015-04-15 07:35:48 +00:00
|
|
|
strlcpy(setting->value.string, menu_path, setting->size);
|
|
|
|
menu_setting_generic(setting);
|
2015-02-26 15:50:30 +00:00
|
|
|
menu_list_pop_stack_by_needle(menu->menu_list, setting->name);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-26 04:28:16 +00:00
|
|
|
static int action_ok_core_deferred_set(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
|
|
|
{
|
|
|
|
char core_display_name[PATH_MAX_LENGTH];
|
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
2015-05-26 06:38:38 +00:00
|
|
|
if (menu->playlist)
|
|
|
|
content_playlist_free(menu->playlist);
|
|
|
|
|
|
|
|
menu->playlist = content_playlist_init(menu->db_playlist_file, 1000);
|
|
|
|
|
2015-05-26 04:28:16 +00:00
|
|
|
core_info_get_name(path, core_display_name, sizeof(core_display_name));
|
|
|
|
|
2015-05-26 06:38:38 +00:00
|
|
|
idx = rdb_entry_start_game_selection_ptr;
|
|
|
|
|
|
|
|
content_playlist_update(menu->playlist, idx,
|
|
|
|
menu->playlist->entries[idx].path, menu->playlist->entries[idx].label,
|
2015-05-26 04:28:16 +00:00
|
|
|
path , core_display_name,
|
2015-05-26 06:38:38 +00:00
|
|
|
menu->playlist->entries[idx].crc32);
|
2015-05-26 04:28:16 +00:00
|
|
|
|
2015-05-26 06:38:38 +00:00
|
|
|
content_playlist_free(menu->playlist);
|
2015-05-26 04:28:16 +00:00
|
|
|
menu->playlist = NULL;
|
|
|
|
|
|
|
|
menu_list_flush_stack(menu->menu_list, NULL, MENU_SETTINGS);
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_core_load_deferred(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-03-20 20:22:38 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
2015-03-21 04:42:49 +00:00
|
|
|
global_t *global = global_get_ptr();
|
2015-03-20 20:22:38 +00:00
|
|
|
|
2015-02-26 15:50:30 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
if (path)
|
|
|
|
strlcpy(settings->libretro, path, sizeof(settings->libretro));
|
2015-03-21 04:42:49 +00:00
|
|
|
strlcpy(global->fullpath, menu->deferred_path,
|
|
|
|
sizeof(global->fullpath));
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
menu_entries_common_load_content(false);
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_database_manager_list_deferred(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_rdb_entry(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
char tmp[PATH_MAX_LENGTH];
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-02-26 15:50:30 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
strlcpy(tmp, "deferred_rdb_entry_detail|", sizeof(tmp));
|
2015-05-17 16:18:17 +00:00
|
|
|
strlcat(tmp, path, sizeof(tmp));
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = 0;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.path, label, sizeof(info.path));
|
|
|
|
strlcpy(info.label, tmp, sizeof(info.label));
|
2015-05-17 13:00:03 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_cursor_manager_list_deferred(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_core_load(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
const char *menu_path = NULL;
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-03-20 20:22:38 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
2015-03-21 04:42:49 +00:00
|
|
|
global_t *global = global_get_ptr();
|
2015-03-20 20:22:38 +00:00
|
|
|
|
2015-02-26 15:50:30 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
2015-03-21 05:55:34 +00:00
|
|
|
(void)global;
|
|
|
|
|
2015-02-26 15:50:30 +00:00
|
|
|
menu_list_get_last_stack(menu->menu_list,
|
|
|
|
&menu_path, NULL, NULL);
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
fill_pathname_join(settings->libretro, menu_path, path,
|
2015-03-20 20:22:38 +00:00
|
|
|
sizeof(settings->libretro));
|
2015-04-13 09:26:02 +00:00
|
|
|
event_command(EVENT_CMD_LOAD_CORE);
|
2015-05-17 17:49:14 +00:00
|
|
|
menu_list_flush_stack(menu->menu_list, NULL, MENU_SETTINGS);
|
2015-02-26 15:50:30 +00:00
|
|
|
#if defined(HAVE_DYNAMIC)
|
|
|
|
/* No content needed for this core, load core immediately. */
|
2015-04-28 01:22:04 +00:00
|
|
|
|
|
|
|
if (menu->load_no_content && settings->core.set_supports_no_game_enable)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-03-21 04:42:49 +00:00
|
|
|
*global->fullpath = '\0';
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
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)
|
2015-04-13 09:26:02 +00:00
|
|
|
event_command(EVENT_CMD_RESTART_RETROARCH);
|
2015-02-26 15:50:30 +00:00
|
|
|
return -1;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_core_download(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_compressed_archive_push(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-05-18 18:41:15 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
|
|
|
menu_list_t *menu_list = menu_list_get_ptr();
|
|
|
|
if (!menu_list)
|
2015-02-26 15:50:30 +00:00
|
|
|
return -1;
|
|
|
|
|
2015-05-18 18:41:15 +00:00
|
|
|
info.list = menu_list->menu_stack;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.path, path, sizeof(info.path));
|
|
|
|
strlcpy(info.label, "load_open_zip", sizeof(info.label));
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-05-18 18:41:15 +00:00
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_SELECT);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_directory_push(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
2015-02-26 15:50:30 +00:00
|
|
|
const char *menu_path = NULL;
|
|
|
|
const char *menu_label = NULL;
|
|
|
|
char cat_path[PATH_MAX_LENGTH];
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-02-26 15:50:30 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
if (!path)
|
2015-02-26 15:50:30 +00:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
menu_list_get_last_stack(menu->menu_list,
|
|
|
|
&menu_path, &menu_label, NULL);
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
fill_pathname_join(cat_path, menu_path, path, sizeof(cat_path));
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.path, cat_path, sizeof(info.path));
|
|
|
|
strlcpy(info.label, menu_label, sizeof(info.label));
|
2015-05-17 13:00:03 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_database_manager_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
char rdb_path[PATH_MAX_LENGTH];
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-03-20 20:22:38 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
2015-02-26 15:50:30 +00:00
|
|
|
if (!menu)
|
|
|
|
return -1;
|
2015-05-17 16:18:17 +00:00
|
|
|
if (!path)
|
|
|
|
return -1;
|
|
|
|
if (!label)
|
2015-02-26 15:50:30 +00:00
|
|
|
return -1;
|
|
|
|
|
2015-03-20 20:22:38 +00:00
|
|
|
fill_pathname_join(rdb_path, settings->content_database,
|
2015-05-17 16:18:17 +00:00
|
|
|
path, sizeof(rdb_path));
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = 0;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.path, rdb_path, sizeof(info.path));
|
|
|
|
strlcpy(info.label, "deferred_database_manager_list", sizeof(info.label));
|
2015-05-17 13:00:03 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_cursor_manager_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
char cursor_path[PATH_MAX_LENGTH];
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-03-20 20:22:38 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
2015-03-20 20:22:38 +00:00
|
|
|
fill_pathname_join(cursor_path, settings->cursor_directory,
|
2015-05-17 16:18:17 +00:00
|
|
|
path, sizeof(cursor_path));
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = 0;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.path, cursor_path, sizeof(info.path));
|
|
|
|
strlcpy(info.label, "deferred_cursor_manager_list", sizeof(info.label));
|
2015-05-17 13:00:03 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_config_load(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
const char *menu_path = NULL;
|
|
|
|
char config[PATH_MAX_LENGTH];
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
menu_list_get_last_stack(menu->menu_list,
|
|
|
|
&menu_path, NULL, NULL);
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
fill_pathname_join(config, menu_path, path, sizeof(config));
|
2015-05-17 17:49:14 +00:00
|
|
|
menu_list_flush_stack(menu->menu_list, NULL, MENU_SETTINGS);
|
2015-02-26 15:50:30 +00:00
|
|
|
menu->msg_force = true;
|
|
|
|
if (rarch_replace_config(config))
|
|
|
|
{
|
|
|
|
menu_navigation_clear(&menu->navigation, false);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_disk_image_append(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
char image[PATH_MAX_LENGTH];
|
|
|
|
const char *menu_path = NULL;
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
menu_list_get_last_stack(menu->menu_list,
|
|
|
|
&menu_path, NULL, NULL);
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
fill_pathname_join(image, menu_path, path, sizeof(image));
|
2015-04-13 09:37:38 +00:00
|
|
|
event_disk_control_append_image(image);
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-04-13 09:26:02 +00:00
|
|
|
event_command(EVENT_CMD_RESUME);
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-05-17 17:49:14 +00:00
|
|
|
menu_list_flush_stack(menu->menu_list, NULL, MENU_SETTINGS);
|
2015-02-26 15:50:30 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_file_load(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
const char *menu_label = NULL;
|
|
|
|
const char *menu_path = NULL;
|
|
|
|
rarch_setting_t *setting = NULL;
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-03-21 04:42:49 +00:00
|
|
|
global_t *global = global_get_ptr();
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_action_setting_set_current_string_path(setting, menu_path, path);
|
2015-02-26 15:50:30 +00:00
|
|
|
menu_list_pop_stack_by_needle(menu->menu_list, setting->name);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-05-17 16:18:17 +00:00
|
|
|
if (type == MENU_FILE_IN_CARCHIVE)
|
|
|
|
fill_pathname_join_delim(global->fullpath, menu_path, path,
|
2015-03-21 04:42:49 +00:00
|
|
|
'#',sizeof(global->fullpath));
|
2015-02-26 15:50:30 +00:00
|
|
|
else
|
2015-05-17 16:18:17 +00:00
|
|
|
fill_pathname_join(global->fullpath, menu_path, path,
|
2015-03-21 04:42:49 +00:00
|
|
|
sizeof(global->fullpath));
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
menu_entries_common_load_content(true);
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_set_path(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
const char *menu_path = NULL;
|
|
|
|
const char *menu_label = NULL;
|
|
|
|
rarch_setting_t *setting = NULL;
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
menu_list_get_last_stack(menu->menu_list,
|
|
|
|
&menu_path, &menu_label, NULL);
|
|
|
|
|
|
|
|
setting = menu_setting_find(menu_label);
|
|
|
|
|
|
|
|
if (!setting)
|
|
|
|
return -1;
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_action_setting_set_current_string_path(setting, menu_path, path);
|
2015-02-26 15:50:30 +00:00
|
|
|
menu_list_pop_stack_by_needle(menu->menu_list, setting->name);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_custom_viewport(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-05-18 18:44:15 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
|
|
|
int ret = 0;
|
2015-05-20 17:12:27 +00:00
|
|
|
video_viewport_t *custom = video_viewport_get_custom();
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-03-20 20:22:38 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
2015-05-18 18:44:15 +00:00
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = MENU_SETTINGS_CUSTOM_VIEWPORT;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.label, "custom_viewport_1", sizeof(info.label));
|
2015-05-17 16:18:17 +00:00
|
|
|
|
2015-05-18 18:44:15 +00:00
|
|
|
ret = menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-03-22 20:28:50 +00:00
|
|
|
video_driver_viewport_info(custom);
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
aspectratio_lut[ASPECT_RATIO_CUSTOM].value =
|
|
|
|
(float)custom->width / custom->height;
|
|
|
|
|
2015-03-20 20:22:38 +00:00
|
|
|
settings->video.aspect_ratio_idx = ASPECT_RATIO_CUSTOM;
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-04-13 09:26:02 +00:00
|
|
|
event_command(EVENT_CMD_VIDEO_SET_ASPECT_RATIO);
|
2015-05-18 18:44:15 +00:00
|
|
|
return ret;
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-20 18:00:39 +00:00
|
|
|
static int generic_action_ok_command(enum event_command cmd)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-04-13 09:26:02 +00:00
|
|
|
if (!event_command(cmd))
|
2015-02-26 15:50:30 +00:00
|
|
|
return -1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_load_state(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-04-13 08:29:15 +00:00
|
|
|
if (generic_action_ok_command(EVENT_CMD_LOAD_STATE) == -1)
|
2015-02-26 15:50:30 +00:00
|
|
|
return -1;
|
2015-04-13 08:29:15 +00:00
|
|
|
return generic_action_ok_command(EVENT_CMD_RESUME);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_save_state(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-04-13 08:29:15 +00:00
|
|
|
if (generic_action_ok_command(EVENT_CMD_SAVE_STATE) == -1)
|
2015-02-26 15:50:30 +00:00
|
|
|
return -1;
|
2015-04-13 08:29:15 +00:00
|
|
|
return generic_action_ok_command(EVENT_CMD_RESUME);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_core_updater_download(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
char core_path[PATH_MAX_LENGTH], msg[PATH_MAX_LENGTH];
|
2015-03-20 20:22:38 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
2015-03-14 15:12:20 +00:00
|
|
|
|
2015-03-20 20:22:38 +00:00
|
|
|
fill_pathname_join(core_path, settings->network.buildbot_url,
|
2015-05-17 16:18:17 +00:00
|
|
|
path, sizeof(core_path));
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
strlcpy(core_updater_path, path, sizeof(core_updater_path));
|
|
|
|
snprintf(msg, sizeof(msg), "Starting download: %s.", path);
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-03-15 01:59:38 +00:00
|
|
|
rarch_main_msg_queue_push(msg, 1, 90, true);
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-03-15 05:41:04 +00:00
|
|
|
rarch_main_data_msg_queue_push(DATA_TYPE_HTTP, core_path,
|
|
|
|
"cb_core_updater_download", 0, 1, true);
|
2015-02-26 15:50:30 +00:00
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_disk_cycle_tray_status(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-04-13 08:29:15 +00:00
|
|
|
return generic_action_ok_command(EVENT_CMD_DISK_EJECT_TOGGLE);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_unload_core(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-03-24 13:32:42 +00:00
|
|
|
{
|
2015-04-13 08:29:15 +00:00
|
|
|
return generic_action_ok_command(EVENT_CMD_UNLOAD_CORE);
|
2015-03-24 13:32:42 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_quit(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-04-13 08:29:15 +00:00
|
|
|
return generic_action_ok_command(EVENT_CMD_QUIT);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_save_new_config(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-04-13 08:29:15 +00:00
|
|
|
return generic_action_ok_command(EVENT_CMD_MENU_SAVE_CONFIG);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_resume_content(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-04-13 08:29:15 +00:00
|
|
|
return generic_action_ok_command(EVENT_CMD_RESUME);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_restart_content(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-04-13 08:29:15 +00:00
|
|
|
return generic_action_ok_command(EVENT_CMD_RESET);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_screenshot(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-04-13 08:29:15 +00:00
|
|
|
return generic_action_ok_command(EVENT_CMD_TAKE_SCREENSHOT);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_file_load_or_resume(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-03-21 04:42:49 +00:00
|
|
|
global_t *global = global_get_ptr();
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
2015-03-21 04:42:49 +00:00
|
|
|
if (!strcmp(menu->deferred_path, global->fullpath))
|
2015-04-13 08:29:15 +00:00
|
|
|
return generic_action_ok_command(EVENT_CMD_RESUME);
|
2015-02-26 15:50:30 +00:00
|
|
|
else
|
|
|
|
{
|
2015-03-21 04:42:49 +00:00
|
|
|
strlcpy(global->fullpath,
|
|
|
|
menu->deferred_path, sizeof(global->fullpath));
|
2015-04-13 09:26:02 +00:00
|
|
|
event_command(EVENT_CMD_LOAD_CORE);
|
2015-02-26 15:50:30 +00:00
|
|
|
rarch_main_set_state(RARCH_ACTION_STATE_LOAD_CONTENT);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_shader_apply_changes(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-04-13 08:29:15 +00:00
|
|
|
return generic_action_ok_command(EVENT_CMD_SHADERS_APPLY_CHANGES);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_lookup_setting(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-05-17 16:18:17 +00:00
|
|
|
return menu_setting_set(type, label, MENU_ACTION_OK, false);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_rdb_entry_submenu(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
union string_list_elem_attr attr;
|
|
|
|
char new_label[PATH_MAX_LENGTH];
|
2015-05-17 16:18:17 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
2015-02-26 15:50:30 +00:00
|
|
|
char *rdb = NULL;
|
|
|
|
int len = 0;
|
|
|
|
struct string_list *str_list = NULL;
|
|
|
|
struct string_list *str_list2 = NULL;
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
if (!menu)
|
|
|
|
return -1;
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
if (!label)
|
2015-02-26 15:50:30 +00:00
|
|
|
return -1;
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
str_list = string_split(label, "|");
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
if (!str_list)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
str_list2 = string_list_new();
|
|
|
|
if (!str_list2)
|
|
|
|
{
|
|
|
|
string_list_free(str_list);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* element 0 : label
|
|
|
|
* element 1 : value
|
|
|
|
* element 2 : database path
|
|
|
|
*/
|
|
|
|
|
2015-03-17 05:18:00 +00:00
|
|
|
attr.i = 0;
|
|
|
|
|
2015-02-26 15:50:30 +00:00
|
|
|
len += strlen(str_list->elems[1].data) + 1;
|
|
|
|
string_list_append(str_list2, str_list->elems[1].data, attr);
|
|
|
|
|
|
|
|
len += strlen(str_list->elems[2].data) + 1;
|
|
|
|
string_list_append(str_list2, str_list->elems[2].data, attr);
|
|
|
|
|
|
|
|
rdb = (char*)calloc(len, sizeof(char));
|
|
|
|
|
|
|
|
if (!rdb)
|
|
|
|
{
|
|
|
|
string_list_free(str_list);
|
|
|
|
string_list_free(str_list2);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
string_list_join_concat(rdb, len, str_list2, "|");
|
|
|
|
|
|
|
|
strlcpy(new_label, "deferred_cursor_manager_list_", sizeof(new_label));
|
|
|
|
strlcat(new_label, str_list->elems[0].data, sizeof(new_label));
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
info.list = menu->menu_list->menu_stack;
|
|
|
|
info.type = 0;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
strlcpy(info.path, rdb, sizeof(info.path));
|
|
|
|
strlcpy(info.label, new_label, sizeof(info.label));
|
2015-05-17 13:00:03 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
ret = menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
string_list_free(str_list);
|
|
|
|
string_list_free(str_list2);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_help(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-05-18 01:25:45 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-05-18 01:25:45 +00:00
|
|
|
menu_list_t *menu_list = menu_list_get_ptr();
|
|
|
|
if (!menu || !menu_list)
|
2015-02-26 15:50:30 +00:00
|
|
|
return -1;
|
|
|
|
|
2015-05-18 01:25:45 +00:00
|
|
|
info.list = menu_list->menu_stack;
|
|
|
|
strlcpy(info.label, "help", sizeof(info.label));
|
|
|
|
|
|
|
|
return menu_displaylist_push_list(&info, DISPLAYLIST_HELP);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_video_resolution(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-03-22 17:38:11 +00:00
|
|
|
unsigned width = 0, height = 0;
|
2015-03-21 04:42:49 +00:00
|
|
|
global_t *global = global_get_ptr();
|
2015-04-08 03:51:31 +00:00
|
|
|
|
2015-03-21 05:23:00 +00:00
|
|
|
(void)global;
|
2015-04-03 01:23:02 +00:00
|
|
|
(void)width;
|
|
|
|
(void)height;
|
2015-03-18 18:40:00 +00:00
|
|
|
|
2015-03-03 20:57:09 +00:00
|
|
|
#ifdef __CELLOS_LV2__
|
2015-03-21 04:42:49 +00:00
|
|
|
if (global->console.screen.resolutions.list[
|
|
|
|
global->console.screen.resolutions.current.idx] ==
|
2015-03-03 20:57:09 +00:00
|
|
|
CELL_VIDEO_OUT_RESOLUTION_576)
|
|
|
|
{
|
2015-03-21 04:42:49 +00:00
|
|
|
if (global->console.screen.pal_enable)
|
|
|
|
global->console.screen.pal60_enable = true;
|
2015-03-03 20:57:09 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-03-21 04:42:49 +00:00
|
|
|
global->console.screen.pal_enable = false;
|
|
|
|
global->console.screen.pal60_enable = false;
|
2015-03-03 20:57:09 +00:00
|
|
|
}
|
|
|
|
|
2015-04-13 09:26:02 +00:00
|
|
|
event_command(EVENT_CMD_REINIT);
|
2015-03-03 20:57:09 +00:00
|
|
|
#else
|
2015-03-22 17:38:11 +00:00
|
|
|
if (video_driver_get_video_output_size(&width, &height))
|
|
|
|
video_driver_set_video_mode(width, height, true);
|
2015-03-03 20:57:09 +00:00
|
|
|
#endif
|
|
|
|
|
2015-02-26 15:50:30 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int is_rdb_entry(const char *label)
|
|
|
|
{
|
|
|
|
return (
|
|
|
|
!(strcmp(label, "rdb_entry_publisher")) ||
|
|
|
|
!(strcmp(label, "rdb_entry_developer")) ||
|
|
|
|
!(strcmp(label, "rdb_entry_origin")) ||
|
|
|
|
!(strcmp(label, "rdb_entry_franchise")) ||
|
|
|
|
!(strcmp(label, "rdb_entry_enhancement_hw")) ||
|
|
|
|
!(strcmp(label, "rdb_entry_esrb_rating")) ||
|
|
|
|
!(strcmp(label, "rdb_entry_bbfc_rating")) ||
|
|
|
|
!(strcmp(label, "rdb_entry_elspa_rating")) ||
|
|
|
|
!(strcmp(label, "rdb_entry_pegi_rating")) ||
|
|
|
|
!(strcmp(label, "rdb_entry_cero_rating")) ||
|
|
|
|
!(strcmp(label, "rdb_entry_edge_magazine_rating")) ||
|
|
|
|
!(strcmp(label, "rdb_entry_edge_magazine_issue")) ||
|
|
|
|
!(strcmp(label, "rdb_entry_famitsu_magazine_rating")) ||
|
|
|
|
!(strcmp(label, "rdb_entry_releasemonth")) ||
|
|
|
|
!(strcmp(label, "rdb_entry_releaseyear")) ||
|
|
|
|
!(strcmp(label, "rdb_entry_max_users"))
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
void menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
|
|
|
|
const char *path, const char *label, unsigned type, size_t idx,
|
|
|
|
const char *elem0, const char *elem1, const char *menu_label)
|
|
|
|
{
|
|
|
|
rarch_setting_t *setting = menu_setting_find(label);
|
2015-03-21 22:56:42 +00:00
|
|
|
menu_handle_t *menu = menu_driver_get_ptr();
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
if (!cbs)
|
|
|
|
return;
|
|
|
|
if (!menu)
|
|
|
|
return;
|
|
|
|
|
2015-04-15 05:25:25 +00:00
|
|
|
#if 0
|
2015-04-14 19:58:39 +00:00
|
|
|
RARCH_LOG("path: %s, label: %s, elem0 : %s, elem1: %s\n", path, label, elem0, elem1);
|
2015-04-15 05:25:25 +00:00
|
|
|
#endif
|
2015-04-14 19:58:39 +00:00
|
|
|
|
2015-02-26 15:50:30 +00:00
|
|
|
cbs->action_ok = action_ok_lookup_setting;
|
|
|
|
|
|
|
|
if (elem0[0] != '\0' && is_rdb_entry(elem0))
|
|
|
|
{
|
|
|
|
cbs->action_ok = action_ok_rdb_entry_submenu;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!strcmp(label, "custom_bind_all"))
|
|
|
|
cbs->action_ok = action_ok_lookup_setting;
|
|
|
|
else if (type == MENU_SETTINGS_CUSTOM_BIND_KEYBOARD ||
|
|
|
|
type == MENU_SETTINGS_CUSTOM_BIND)
|
|
|
|
cbs->action_ok = action_ok_lookup_setting;
|
|
|
|
else if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
|
|
|
|
&& type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
|
|
|
|
cbs->action_ok = NULL;
|
|
|
|
else if (type >= MENU_SETTINGS_SHADER_PRESET_PARAMETER_0
|
|
|
|
&& type <= MENU_SETTINGS_SHADER_PRESET_PARAMETER_LAST)
|
|
|
|
cbs->action_ok = NULL;
|
|
|
|
else if (type >= MENU_SETTINGS_CHEAT_BEGIN
|
|
|
|
&& type <= MENU_SETTINGS_CHEAT_END)
|
|
|
|
cbs->action_ok = action_ok_cheat;
|
|
|
|
else if (!strcmp(label, "savestate"))
|
|
|
|
cbs->action_ok = action_ok_save_state;
|
|
|
|
else if (!strcmp(label, "loadstate"))
|
|
|
|
cbs->action_ok = action_ok_load_state;
|
|
|
|
else if (!strcmp(label, "resume_content"))
|
|
|
|
cbs->action_ok = action_ok_resume_content;
|
|
|
|
else if (!strcmp(label, "restart_content"))
|
|
|
|
cbs->action_ok = action_ok_restart_content;
|
|
|
|
else if (!strcmp(label, "take_screenshot"))
|
|
|
|
cbs->action_ok = action_ok_screenshot;
|
|
|
|
else if (!strcmp(label, "file_load_or_resume"))
|
|
|
|
cbs->action_ok = action_ok_file_load_or_resume;
|
|
|
|
else if (!strcmp(label, "quit_retroarch"))
|
|
|
|
cbs->action_ok = action_ok_quit;
|
2015-03-24 13:32:42 +00:00
|
|
|
else if (!strcmp(label, "unload_core"))
|
|
|
|
cbs->action_ok = action_ok_unload_core;
|
2015-02-26 15:50:30 +00:00
|
|
|
else if (!strcmp(label, "save_new_config"))
|
|
|
|
cbs->action_ok = action_ok_save_new_config;
|
|
|
|
else if (!strcmp(label, "help"))
|
|
|
|
cbs->action_ok = action_ok_help;
|
|
|
|
else if (!strcmp(label, "video_shader_pass"))
|
|
|
|
cbs->action_ok = action_ok_shader_pass;
|
|
|
|
else if (!strcmp(label, "video_shader_preset"))
|
|
|
|
cbs->action_ok = action_ok_shader_preset;
|
|
|
|
else if (!strcmp(label, "cheat_file_load"))
|
|
|
|
cbs->action_ok = action_ok_cheat_file;
|
|
|
|
else if (!strcmp(label, "audio_dsp_plugin"))
|
|
|
|
cbs->action_ok = action_ok_audio_dsp_plugin;
|
|
|
|
else if (!strcmp(label, "video_filter"))
|
|
|
|
cbs->action_ok = action_ok_video_filter;
|
|
|
|
else if (!strcmp(label, "remap_file_load"))
|
|
|
|
cbs->action_ok = action_ok_remap_file;
|
2015-04-15 07:18:30 +00:00
|
|
|
else if (!strcmp(label, "record_config"))
|
|
|
|
cbs->action_ok = action_ok_record_configfile;
|
2015-02-27 08:25:09 +00:00
|
|
|
else if (!strcmp(label, "core_updater_list"))
|
|
|
|
cbs->action_ok = action_ok_core_updater_list;
|
2015-02-26 15:50:30 +00:00
|
|
|
else if (!strcmp(label, "video_shader_parameters") ||
|
|
|
|
!strcmp(label, "video_shader_preset_parameters")
|
|
|
|
)
|
|
|
|
cbs->action_ok = action_ok_shader_parameters;
|
|
|
|
else if (
|
|
|
|
!strcmp(label, "shader_options") ||
|
|
|
|
!strcmp(label, "video_options") ||
|
|
|
|
!strcmp(label, "Input Settings") ||
|
|
|
|
!strcmp(label, "core_options") ||
|
|
|
|
!strcmp(label, "core_cheat_options") ||
|
|
|
|
!strcmp(label, "core_input_remapping_options") ||
|
|
|
|
!strcmp(label, "core_information") ||
|
2015-04-16 17:36:34 +00:00
|
|
|
!strcmp(label, "system_information") ||
|
2015-02-26 15:50:30 +00:00
|
|
|
!strcmp(label, "disk_options") ||
|
|
|
|
!strcmp(label, "settings") ||
|
|
|
|
!strcmp(label, "performance_counters") ||
|
|
|
|
!strcmp(label, "frontend_counters") ||
|
|
|
|
!strcmp(label, "core_counters") ||
|
|
|
|
!strcmp(label, "management") ||
|
|
|
|
!strcmp(label, "options")
|
|
|
|
)
|
|
|
|
cbs->action_ok = action_ok_push_default;
|
|
|
|
else if (
|
|
|
|
!strcmp(label, "load_content") ||
|
|
|
|
!strcmp(label, "detect_core_list")
|
|
|
|
)
|
|
|
|
cbs->action_ok = action_ok_push_content_list;
|
|
|
|
else if (!strcmp(label, "history_list") ||
|
|
|
|
!strcmp(label, "cursor_manager_list") ||
|
|
|
|
!strcmp(label, "database_manager_list") ||
|
|
|
|
(setting && setting->browser_selection_type == ST_DIR)
|
|
|
|
)
|
|
|
|
cbs->action_ok = action_ok_push_generic_list;
|
|
|
|
else if (!strcmp(label, "shader_apply_changes"))
|
|
|
|
cbs->action_ok = action_ok_shader_apply_changes;
|
|
|
|
else if (!strcmp(label, "cheat_apply_changes"))
|
|
|
|
cbs->action_ok = action_ok_cheat_apply_changes;
|
|
|
|
else if (!strcmp(label, "video_shader_preset_save_as"))
|
|
|
|
cbs->action_ok = action_ok_shader_preset_save_as;
|
|
|
|
else if (!strcmp(label, "cheat_file_save_as"))
|
|
|
|
cbs->action_ok = action_ok_cheat_file_save_as;
|
|
|
|
else if (!strcmp(label, "remap_file_save_as"))
|
|
|
|
cbs->action_ok = action_ok_remap_file_save_as;
|
2015-04-06 23:47:58 +00:00
|
|
|
else if (!strcmp(label, "remap_file_save_core"))
|
|
|
|
cbs->action_ok = action_ok_remap_file_save_core;
|
|
|
|
else if (!strcmp(label, "remap_file_save_game"))
|
2015-04-08 03:51:31 +00:00
|
|
|
cbs->action_ok = action_ok_remap_file_save_game;
|
2015-05-21 20:22:37 +00:00
|
|
|
else if (!strcmp(label, "content_collection_list"))
|
|
|
|
cbs->action_ok = action_ok_content_collection_list;
|
2015-02-26 15:50:30 +00:00
|
|
|
else if (!strcmp(label, "core_list"))
|
|
|
|
cbs->action_ok = action_ok_core_list;
|
|
|
|
else if (!strcmp(label, "disk_image_append"))
|
|
|
|
cbs->action_ok = action_ok_disk_image_append_list;
|
|
|
|
else if (!strcmp(label, "configurations"))
|
|
|
|
cbs->action_ok = action_ok_configurations_list;
|
|
|
|
else
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case MENU_SETTINGS_VIDEO_RESOLUTION:
|
|
|
|
cbs->action_ok = action_ok_video_resolution;
|
|
|
|
break;
|
|
|
|
case MENU_FILE_PLAYLIST_ENTRY:
|
|
|
|
cbs->action_ok = action_ok_playlist_entry;
|
|
|
|
break;
|
2015-05-21 22:28:02 +00:00
|
|
|
case MENU_FILE_PLAYLIST_COLLECTION:
|
|
|
|
cbs->action_ok = action_ok_playlist_collection;
|
|
|
|
break;
|
2015-02-26 15:50:30 +00:00
|
|
|
case MENU_FILE_CONTENTLIST_ENTRY:
|
|
|
|
cbs->action_ok = action_ok_push_generic_list;
|
|
|
|
break;
|
|
|
|
case MENU_FILE_CHEAT:
|
|
|
|
cbs->action_ok = action_ok_cheat_file_load;
|
|
|
|
break;
|
2015-04-15 08:55:23 +00:00
|
|
|
case MENU_FILE_RECORD_CONFIG:
|
|
|
|
cbs->action_ok = action_ok_record_configfile_load;
|
|
|
|
break;
|
2015-02-26 15:50:30 +00:00
|
|
|
case MENU_FILE_REMAP:
|
|
|
|
cbs->action_ok = action_ok_remap_file_load;
|
|
|
|
break;
|
|
|
|
case MENU_FILE_SHADER_PRESET:
|
|
|
|
cbs->action_ok = action_ok_shader_preset_load;
|
|
|
|
break;
|
|
|
|
case MENU_FILE_SHADER:
|
|
|
|
cbs->action_ok = action_ok_shader_pass_load;
|
|
|
|
break;
|
|
|
|
case MENU_FILE_IMAGE:
|
|
|
|
cbs->action_ok = action_ok_menu_wallpaper_load;
|
|
|
|
break;
|
|
|
|
case MENU_FILE_USE_DIRECTORY:
|
|
|
|
cbs->action_ok = action_ok_path_use_directory;
|
|
|
|
break;
|
|
|
|
case MENU_FILE_CONFIG:
|
|
|
|
cbs->action_ok = action_ok_config_load;
|
|
|
|
break;
|
|
|
|
case MENU_FILE_DIRECTORY:
|
|
|
|
cbs->action_ok = action_ok_directory_push;
|
|
|
|
break;
|
|
|
|
case MENU_FILE_CARCHIVE:
|
|
|
|
cbs->action_ok = action_ok_compressed_archive_push;
|
|
|
|
break;
|
|
|
|
case MENU_FILE_CORE:
|
|
|
|
if (!strcmp(menu_label, "deferred_core_list"))
|
|
|
|
cbs->action_ok = action_ok_core_load_deferred;
|
2015-05-26 04:28:16 +00:00
|
|
|
else if (!strcmp(menu_label, "deferred_core_list_set"))
|
|
|
|
cbs->action_ok = action_ok_core_deferred_set;
|
2015-02-26 15:50:30 +00:00
|
|
|
else if (!strcmp(menu_label, "core_list"))
|
|
|
|
cbs->action_ok = action_ok_core_load;
|
|
|
|
else if (!strcmp(menu_label, "core_updater_list"))
|
|
|
|
cbs->action_ok = action_ok_core_download;
|
|
|
|
else
|
|
|
|
return;
|
|
|
|
break;
|
|
|
|
case MENU_FILE_DOWNLOAD_CORE:
|
2015-02-27 08:25:09 +00:00
|
|
|
cbs->action_ok = action_ok_core_updater_download;
|
2015-02-26 15:50:30 +00:00
|
|
|
break;
|
|
|
|
case MENU_FILE_DOWNLOAD_CORE_INFO:
|
|
|
|
break;
|
|
|
|
case MENU_FILE_RDB:
|
|
|
|
if (!strcmp(menu_label, "deferred_database_manager_list"))
|
|
|
|
cbs->action_ok = action_ok_database_manager_list_deferred;
|
2015-04-08 03:51:31 +00:00
|
|
|
else if (!strcmp(menu_label, "database_manager_list")
|
2015-02-26 15:50:30 +00:00
|
|
|
|| !strcmp(menu_label, "Horizontal Menu"))
|
|
|
|
cbs->action_ok = action_ok_database_manager_list;
|
|
|
|
else
|
|
|
|
return;
|
|
|
|
break;
|
|
|
|
case MENU_FILE_RDB_ENTRY:
|
|
|
|
cbs->action_ok = action_ok_rdb_entry;
|
|
|
|
break;
|
|
|
|
case MENU_FILE_CURSOR:
|
|
|
|
if (!strcmp(menu_label, "deferred_database_manager_list"))
|
|
|
|
cbs->action_ok = action_ok_cursor_manager_list_deferred;
|
|
|
|
else if (!strcmp(menu_label, "cursor_manager_list"))
|
|
|
|
cbs->action_ok = action_ok_cursor_manager_list;
|
|
|
|
break;
|
|
|
|
case MENU_FILE_FONT:
|
|
|
|
case MENU_FILE_OVERLAY:
|
|
|
|
case MENU_FILE_AUDIOFILTER:
|
|
|
|
cbs->action_ok = action_ok_set_path;
|
|
|
|
break;
|
|
|
|
case MENU_FILE_VIDEOFILTER:
|
|
|
|
cbs->action_ok = action_ok_video_filter_file_load;
|
|
|
|
break;
|
|
|
|
#ifdef HAVE_COMPRESSION
|
|
|
|
case MENU_FILE_IN_CARCHIVE:
|
|
|
|
#endif
|
|
|
|
case MENU_FILE_PLAIN:
|
|
|
|
if (!strcmp(menu_label, "detect_core_list"))
|
|
|
|
cbs->action_ok = action_ok_file_load_with_detect_core;
|
|
|
|
else if (!strcmp(menu_label, "disk_image_append"))
|
|
|
|
cbs->action_ok = action_ok_disk_image_append;
|
|
|
|
else
|
|
|
|
cbs->action_ok = action_ok_file_load;
|
|
|
|
break;
|
|
|
|
case MENU_SETTINGS_CUSTOM_VIEWPORT:
|
|
|
|
cbs->action_ok = action_ok_custom_viewport;
|
|
|
|
break;
|
|
|
|
case MENU_SETTINGS:
|
|
|
|
case MENU_SETTING_GROUP:
|
|
|
|
case MENU_SETTING_SUBGROUP:
|
|
|
|
cbs->action_ok = action_ok_push_default;
|
|
|
|
break;
|
|
|
|
case MENU_SETTINGS_CORE_DISK_OPTIONS_DISK_CYCLE_TRAY_STATUS:
|
|
|
|
cbs->action_ok = action_ok_disk_cycle_tray_status;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|