2015-02-26 15:50:30 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2016-01-10 03:06:50 +00:00
|
|
|
* Copyright (C) 2011-2016 - Daniel De Matteis
|
2015-02-26 15:50:30 +00:00
|
|
|
*
|
|
|
|
* 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>
|
2016-02-05 12:51:30 +00:00
|
|
|
#include <retro_assert.h>
|
2015-09-21 23:45:16 +00:00
|
|
|
#include <retro_stat.h>
|
2015-12-26 06:37:44 +00:00
|
|
|
#include <string/stdstring.h>
|
2016-03-20 16:01:15 +00:00
|
|
|
#include <streams/file_stream.h>
|
2016-03-20 13:53:54 +00:00
|
|
|
#include <lists/string_list.h>
|
2015-06-04 20:04:08 +00:00
|
|
|
|
2015-12-06 16:55:27 +00:00
|
|
|
#include "../menu_driver.h"
|
2015-06-26 13:28:01 +00:00
|
|
|
#include "../menu_cbs.h"
|
2015-09-22 20:10:43 +00:00
|
|
|
#include "../menu_display.h"
|
2015-06-08 12:35:58 +00:00
|
|
|
#include "../menu_setting.h"
|
|
|
|
#include "../menu_shader.h"
|
2015-12-09 08:53:43 +00:00
|
|
|
#include "../menu_navigation.h"
|
2016-01-25 04:38:22 +00:00
|
|
|
#include "../menu_content.h"
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-12-11 12:56:00 +00:00
|
|
|
#include "../../core_info.h"
|
2016-02-05 18:00:30 +00:00
|
|
|
#include "../../frontend/frontend_driver.h"
|
2015-12-06 21:48:57 +00:00
|
|
|
#include "../../defaults.h"
|
2016-05-09 16:20:52 +00:00
|
|
|
#include "../../managers/cheat_manager.h"
|
2015-06-13 17:12:10 +00:00
|
|
|
#include "../../general.h"
|
2016-02-09 16:12:39 +00:00
|
|
|
#include "../../tasks/tasks_internal.h"
|
2015-06-08 12:35:58 +00:00
|
|
|
#include "../../input/input_remapping.h"
|
2016-03-21 18:23:45 +00:00
|
|
|
#include "../../retroarch.h"
|
2015-06-25 09:12:07 +00:00
|
|
|
#include "../../system.h"
|
2016-03-23 14:40:41 +00:00
|
|
|
#include "../../lakka.h"
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2016-02-05 13:13:49 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2016-06-19 22:31:13 +00:00
|
|
|
enum msg_hash_enums enum_idx;
|
2016-02-05 13:13:49 +00:00
|
|
|
char path[PATH_MAX_LENGTH];
|
|
|
|
} menu_file_transfer_t;
|
|
|
|
|
2015-10-11 17:59:14 +00:00
|
|
|
#ifndef BIND_ACTION_OK
|
|
|
|
#define BIND_ACTION_OK(cbs, name) \
|
2016-06-27 19:34:05 +00:00
|
|
|
do { \
|
|
|
|
cbs->action_ok = name; \
|
|
|
|
cbs->action_ok_ident = #name; \
|
|
|
|
} while(0)
|
2015-10-11 17:59:14 +00:00
|
|
|
#endif
|
|
|
|
|
2015-02-26 15:50:30 +00:00
|
|
|
/* FIXME - Global variables, refactor */
|
2016-06-27 19:34:05 +00:00
|
|
|
static char detect_content_path[PATH_MAX_LENGTH];
|
2016-06-27 19:35:27 +00:00
|
|
|
unsigned rpl_entry_selection_ptr;
|
2016-06-27 19:34:05 +00:00
|
|
|
unsigned rdb_entry_start_game_selection_ptr;
|
2015-02-26 15:50:30 +00:00
|
|
|
size_t hack_shader_pass = 0;
|
2015-11-23 14:13:26 +00:00
|
|
|
|
2016-02-03 14:47:57 +00:00
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
/* HACK - we have to find some way to pass state inbetween
|
|
|
|
* function pointer callback functions that don't necessarily
|
|
|
|
* call each other. */
|
2016-06-27 19:35:27 +00:00
|
|
|
char *core_buf;
|
|
|
|
size_t core_len;
|
2016-02-03 14:47:57 +00:00
|
|
|
|
2015-11-23 14:13:26 +00:00
|
|
|
/* defined in menu_cbs_deferred_push */
|
2016-02-04 14:44:25 +00:00
|
|
|
static void cb_net_generic(void *task_data, void *user_data, const char *err)
|
2016-02-03 14:47:57 +00:00
|
|
|
{
|
|
|
|
bool refresh = false;
|
|
|
|
http_transfer_data_t *data = (http_transfer_data_t*)task_data;
|
|
|
|
|
|
|
|
if (core_buf)
|
|
|
|
free(core_buf);
|
|
|
|
|
|
|
|
core_buf = NULL;
|
|
|
|
core_len = 0;
|
|
|
|
|
|
|
|
if (!data || err)
|
|
|
|
goto finish;
|
|
|
|
|
|
|
|
core_buf = (char*)malloc((data->len+1) * sizeof(char));
|
|
|
|
|
|
|
|
if (!core_buf)
|
|
|
|
goto finish;
|
|
|
|
|
|
|
|
memcpy(core_buf, data->data, data->len * sizeof(char));
|
|
|
|
core_buf[data->len] = '\0';
|
|
|
|
core_len = data->len;
|
|
|
|
|
|
|
|
finish:
|
|
|
|
refresh = true;
|
|
|
|
menu_entries_ctl(MENU_ENTRIES_CTL_UNSET_REFRESH, &refresh);
|
|
|
|
|
|
|
|
if (err)
|
|
|
|
RARCH_ERR("Download failed: %s\n", err);
|
|
|
|
|
|
|
|
if (data)
|
|
|
|
{
|
|
|
|
if (data->data)
|
|
|
|
free(data->data);
|
|
|
|
free(data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2016-02-12 03:28:09 +00:00
|
|
|
int generic_action_ok_displaylist_push(const char *path,
|
2015-09-04 11:08:15 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx,
|
|
|
|
unsigned action_type)
|
|
|
|
{
|
2016-02-24 22:05:54 +00:00
|
|
|
enum menu_displaylist_ctl_state dl_type = DISPLAYLIST_GENERIC;
|
2016-06-01 01:23:38 +00:00
|
|
|
char tmp[PATH_MAX_LENGTH] = {0};
|
2016-06-01 03:26:45 +00:00
|
|
|
char parent_dir[PATH_MAX_LENGTH] = {0};
|
2016-06-01 01:23:38 +00:00
|
|
|
char action_path[PATH_MAX_LENGTH] = {0};
|
2015-09-04 11:08:15 +00:00
|
|
|
menu_displaylist_info_t info = {0};
|
|
|
|
const char *menu_label = NULL;
|
|
|
|
const char *menu_path = NULL;
|
|
|
|
const char *content_path = NULL;
|
2015-09-06 22:32:01 +00:00
|
|
|
const char *info_label = NULL;
|
2015-09-06 22:38:23 +00:00
|
|
|
const char *info_path = NULL;
|
2016-02-10 20:15:23 +00:00
|
|
|
menu_handle_t *menu = NULL;
|
2016-06-19 22:31:13 +00:00
|
|
|
enum msg_hash_enums enum_idx = MSG_UNKNOWN;
|
2015-09-04 11:08:15 +00:00
|
|
|
global_t *global = global_get_ptr();
|
|
|
|
settings_t *settings = config_get_ptr();
|
2015-10-27 09:10:33 +00:00
|
|
|
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
|
2015-10-27 09:33:19 +00:00
|
|
|
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
2016-02-10 20:15:23 +00:00
|
|
|
|
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
2016-02-10 20:42:18 +00:00
|
|
|
return menu_cbs_exit();
|
2015-09-04 11:08:15 +00:00
|
|
|
|
2016-06-17 14:08:47 +00:00
|
|
|
menu_entries_get_last_stack(&menu_path, &menu_label, NULL, &enum_idx, NULL);
|
2015-09-04 11:08:15 +00:00
|
|
|
|
2015-09-07 00:43:52 +00:00
|
|
|
if (path && menu_path)
|
|
|
|
fill_pathname_join(action_path, menu_path, path, sizeof(action_path));
|
2015-09-04 21:24:14 +00:00
|
|
|
|
2015-10-17 15:56:19 +00:00
|
|
|
info.list = menu_stack;
|
2015-09-06 17:25:24 +00:00
|
|
|
|
2015-09-04 11:08:15 +00:00
|
|
|
switch (action_type)
|
|
|
|
{
|
2015-10-23 04:54:33 +00:00
|
|
|
case ACTION_OK_DL_USER_BINDS_LIST:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = label;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-16 10:56:10 +00:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_USER_BINDS_LIST);
|
2016-06-17 21:47:23 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_USER_BINDS_LIST;
|
2015-10-23 04:54:33 +00:00
|
|
|
break;
|
2015-09-04 11:08:15 +00:00
|
|
|
case ACTION_OK_DL_OPEN_ARCHIVE_DETECT_CORE:
|
|
|
|
if (menu)
|
|
|
|
{
|
2015-12-10 13:00:28 +00:00
|
|
|
menu_path = menu->scratch2_buf;
|
2015-09-04 11:08:15 +00:00
|
|
|
content_path = menu->scratch_buf;
|
|
|
|
}
|
2016-06-01 02:05:14 +00:00
|
|
|
if (content_path)
|
|
|
|
fill_pathname_join(detect_content_path, menu_path, content_path,
|
|
|
|
sizeof(detect_content_path));
|
2015-09-04 11:08:15 +00:00
|
|
|
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-18 16:45:11 +00:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN_DETECT_CORE);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN_DETECT_CORE;
|
|
|
|
info_path = path;
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_OPEN_ARCHIVE:
|
|
|
|
if (menu)
|
2015-09-04 11:08:15 +00:00
|
|
|
{
|
2016-06-18 16:45:11 +00:00
|
|
|
menu_path = menu->scratch2_buf;
|
|
|
|
content_path = menu->scratch_buf;
|
2015-09-04 11:08:15 +00:00
|
|
|
}
|
2016-06-18 16:45:11 +00:00
|
|
|
if (content_path)
|
|
|
|
fill_pathname_join(detect_content_path, menu_path, content_path,
|
|
|
|
sizeof(detect_content_path));
|
|
|
|
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-18 16:45:11 +00:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN;
|
2015-09-06 22:38:23 +00:00
|
|
|
info_path = path;
|
2015-09-04 11:08:15 +00:00
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_HELP:
|
2015-09-06 22:32:01 +00:00
|
|
|
info_label = label;
|
2015-09-04 11:08:15 +00:00
|
|
|
menu->push_help_screen = true;
|
|
|
|
dl_type = DISPLAYLIST_HELP;
|
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_RPL_ENTRY:
|
|
|
|
strlcpy(menu->deferred_path, label, sizeof(menu->deferred_path));
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_RPL_ENTRY_ACTIONS);
|
2016-06-17 21:47:23 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_RPL_ENTRY_ACTIONS;
|
2015-09-04 11:08:15 +00:00
|
|
|
info.directory_ptr = idx;
|
|
|
|
rpl_entry_selection_ptr = idx;
|
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_AUDIO_DSP_PLUGIN:
|
|
|
|
info.directory_ptr = idx;
|
2016-04-28 18:49:13 +00:00
|
|
|
info_path = settings->directory.audio_filter;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_AUDIO_DSP_PLUGIN);
|
2016-06-17 21:47:23 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_AUDIO_DSP_PLUGIN;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_SHADER_PASS:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2016-04-28 18:49:13 +00:00
|
|
|
info_path = settings->directory.video_shader;
|
2015-09-06 22:38:23 +00:00
|
|
|
info_label = label;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_SHADER_PARAMETERS:
|
|
|
|
info.type = MENU_SETTING_ACTION;
|
|
|
|
info.directory_ptr = idx;
|
2016-06-17 21:47:23 +00:00
|
|
|
info_label = label;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_GENERIC:
|
|
|
|
if (path)
|
|
|
|
strlcpy(menu->deferred_path, path,
|
|
|
|
sizeof(menu->deferred_path));
|
|
|
|
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2016-06-17 21:47:23 +00:00
|
|
|
info_label = label;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_PUSH_DEFAULT:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2015-09-06 22:38:23 +00:00
|
|
|
info_path = label;
|
2016-06-17 21:47:23 +00:00
|
|
|
info_label = label;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_SHADER_PRESET:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2016-04-28 18:49:13 +00:00
|
|
|
info_path = settings->directory.video_shader;
|
2016-06-17 21:47:23 +00:00
|
|
|
info_label = label;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_DOWNLOADS_DIR:
|
2016-06-20 13:50:37 +00:00
|
|
|
info.type = FILE_TYPE_DIRECTORY;
|
2015-09-04 11:08:15 +00:00
|
|
|
info.directory_ptr = idx;
|
2016-04-28 17:26:02 +00:00
|
|
|
info_path = settings->directory.core_assets;
|
2015-09-06 22:38:23 +00:00
|
|
|
info_label = label;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_CONTENT_LIST:
|
2016-06-20 13:50:37 +00:00
|
|
|
info.type = FILE_TYPE_DIRECTORY;
|
2015-09-04 11:08:15 +00:00
|
|
|
info.directory_ptr = idx;
|
2016-04-28 17:26:02 +00:00
|
|
|
info_path = settings->directory.menu_content;
|
2015-09-06 22:38:23 +00:00
|
|
|
info_label = label;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_REMAP_FILE:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2016-04-28 17:26:02 +00:00
|
|
|
info_path = settings->directory.input_remapping;
|
2015-09-06 22:38:23 +00:00
|
|
|
info_label = label;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_RECORD_CONFIGFILE:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2015-09-06 22:38:23 +00:00
|
|
|
info_path = global->record.config_dir;
|
|
|
|
info_label = label;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_DISK_IMAGE_APPEND_LIST:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2016-04-28 17:26:02 +00:00
|
|
|
info_path = settings->directory.menu_content;
|
2015-09-06 22:38:23 +00:00
|
|
|
info_label = label;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_PLAYLIST_COLLECTION:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2015-09-06 22:38:23 +00:00
|
|
|
info_path = path;
|
|
|
|
info_label = label;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_CHEAT_FILE:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2016-04-28 18:49:13 +00:00
|
|
|
info_path = settings->path.cheat_database;
|
2015-09-06 22:38:23 +00:00
|
|
|
info_label = label;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_CORE_LIST:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2016-04-28 17:26:02 +00:00
|
|
|
info_path = settings->directory.libretro;
|
2015-09-06 22:38:23 +00:00
|
|
|
info_label = label;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_CONTENT_COLLECTION_LIST:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2016-04-28 17:26:02 +00:00
|
|
|
info_path = settings->directory.playlist;
|
2015-09-06 22:38:23 +00:00
|
|
|
info_label = label;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_RDB_ENTRY:
|
2016-01-25 17:18:00 +00:00
|
|
|
fill_pathname_join_delim(tmp,
|
2016-06-19 22:31:13 +00:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_RDB_ENTRY_DETAIL),
|
2015-09-06 22:32:01 +00:00
|
|
|
path, '|', sizeof(tmp));
|
2015-09-04 11:08:15 +00:00
|
|
|
|
2015-09-06 22:32:01 +00:00
|
|
|
info.directory_ptr = idx;
|
2015-09-06 22:38:23 +00:00
|
|
|
info_path = label;
|
|
|
|
info_label = tmp;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_RDB_ENTRY_SUBMENU:
|
|
|
|
info.directory_ptr = idx;
|
2015-09-06 22:38:23 +00:00
|
|
|
info_label = label;
|
|
|
|
info_path = path;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_CONFIGURATIONS_LIST:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2016-04-28 17:26:02 +00:00
|
|
|
if (string_is_empty(settings->directory.menu_config))
|
2015-09-06 22:38:23 +00:00
|
|
|
info_path = label;
|
2015-12-26 06:37:44 +00:00
|
|
|
else
|
2016-04-28 17:26:02 +00:00
|
|
|
info_path = settings->directory.menu_config;
|
2015-09-06 22:32:01 +00:00
|
|
|
info_label = label;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_COMPRESSED_ARCHIVE_PUSH_DETECT_CORE:
|
2016-06-18 16:45:11 +00:00
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = path;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-18 16:45:11 +00:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_ARCHIVE_ACTION_DETECT_CORE);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_ARCHIVE_ACTION_DETECT_CORE;
|
|
|
|
|
|
|
|
if (!string_is_empty(path))
|
|
|
|
strlcpy(menu->scratch_buf, path, sizeof(menu->scratch_buf));
|
|
|
|
if (!string_is_empty(menu_path))
|
|
|
|
strlcpy(menu->scratch2_buf, menu_path, sizeof(menu->scratch2_buf));
|
|
|
|
break;
|
2015-09-04 11:08:15 +00:00
|
|
|
case ACTION_OK_DL_COMPRESSED_ARCHIVE_PUSH:
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2015-09-06 22:38:23 +00:00
|
|
|
info_path = path;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-18 16:45:11 +00:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_ARCHIVE_ACTION);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_ARCHIVE_ACTION;
|
2015-09-04 11:08:15 +00:00
|
|
|
|
2016-06-05 17:04:59 +00:00
|
|
|
if (!string_is_empty(path))
|
|
|
|
strlcpy(menu->scratch_buf, path, sizeof(menu->scratch_buf));
|
|
|
|
if (!string_is_empty(menu_path))
|
|
|
|
strlcpy(menu->scratch2_buf, menu_path, sizeof(menu->scratch2_buf));
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
2015-10-25 07:31:55 +00:00
|
|
|
case ACTION_OK_DL_PARENT_DIRECTORY_PUSH:
|
2016-06-01 03:26:45 +00:00
|
|
|
fill_pathname_parent_dir(parent_dir,
|
|
|
|
action_path, sizeof(parent_dir));
|
|
|
|
fill_pathname_parent_dir(parent_dir,
|
|
|
|
parent_dir, sizeof(parent_dir));
|
2015-10-25 07:31:55 +00:00
|
|
|
|
2016-06-01 03:26:45 +00:00
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = parent_dir;
|
|
|
|
info_label = menu_label;
|
2015-10-25 07:31:55 +00:00
|
|
|
break;
|
2015-09-04 11:08:15 +00:00
|
|
|
case ACTION_OK_DL_DIRECTORY_PUSH:
|
2015-09-04 21:24:14 +00:00
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2015-09-06 22:38:23 +00:00
|
|
|
info_path = action_path;
|
|
|
|
info_label = menu_label;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_DATABASE_MANAGER_LIST:
|
2016-04-28 18:49:13 +00:00
|
|
|
fill_pathname_join(tmp,
|
|
|
|
settings->path.content_database,
|
2015-09-06 22:38:23 +00:00
|
|
|
path, sizeof(tmp));
|
2015-09-04 11:08:15 +00:00
|
|
|
|
2015-09-06 22:38:23 +00:00
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = tmp;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-16 10:56:10 +00:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_DATABASE_MANAGER_LIST);
|
2016-06-17 21:47:23 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_DATABASE_MANAGER_LIST;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_CURSOR_MANAGER_LIST:
|
2016-04-28 17:26:02 +00:00
|
|
|
fill_pathname_join(tmp, settings->directory.cursor,
|
2015-09-06 22:38:23 +00:00
|
|
|
path, sizeof(tmp));
|
2015-09-04 11:08:15 +00:00
|
|
|
|
2015-09-06 22:38:23 +00:00
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = tmp;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-16 10:56:10 +00:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_CURSOR_MANAGER_LIST);
|
2016-06-17 21:47:23 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_CURSOR_MANAGER_LIST;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_CORE_UPDATER_LIST:
|
2016-04-24 10:30:23 +00:00
|
|
|
dl_type = DISPLAYLIST_PENDING_CLEAR;
|
2015-09-04 11:08:15 +00:00
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2015-09-06 22:38:23 +00:00
|
|
|
info_path = path;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-16 10:56:10 +00:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_CORE_UPDATER_LIST);
|
2016-06-17 21:47:23 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_CORE_UPDATER_LIST;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
2016-04-23 20:31:39 +00:00
|
|
|
case ACTION_OK_DL_THUMBNAILS_UPDATER_LIST:
|
2016-04-24 00:23:07 +00:00
|
|
|
dl_type = DISPLAYLIST_PENDING_CLEAR;
|
2016-04-23 20:31:39 +00:00
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = path;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-16 10:56:10 +00:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_THUMBNAILS_UPDATER_LIST);
|
2016-06-17 21:47:23 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_THUMBNAILS_UPDATER_LIST;
|
2016-04-23 20:31:39 +00:00
|
|
|
break;
|
2016-06-20 22:46:55 +00:00
|
|
|
case ACTION_OK_DL_CORE_CONTENT_DIRS_LIST:
|
|
|
|
dl_type = DISPLAYLIST_PENDING_CLEAR;
|
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = path;
|
|
|
|
info_label = msg_hash_to_str(
|
|
|
|
MENU_ENUM_LABEL_DEFERRED_CORE_CONTENT_DIRS_LIST);
|
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_CORE_CONTENT_DIRS_LIST;
|
|
|
|
break;
|
2015-09-04 11:08:15 +00:00
|
|
|
case ACTION_OK_DL_CORE_CONTENT_LIST:
|
2016-04-24 10:30:23 +00:00
|
|
|
dl_type = DISPLAYLIST_PENDING_CLEAR;
|
2015-09-04 11:08:15 +00:00
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
2015-09-06 22:38:23 +00:00
|
|
|
info_path = path;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-16 10:56:10 +00:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_CORE_CONTENT_LIST);
|
2016-06-17 21:47:23 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_CORE_CONTENT_LIST;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
2015-12-24 19:13:50 +00:00
|
|
|
case ACTION_OK_DL_LAKKA_LIST:
|
2016-04-24 10:30:23 +00:00
|
|
|
dl_type = DISPLAYLIST_PENDING_CLEAR;
|
2015-12-24 19:13:50 +00:00
|
|
|
info.type = type;
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info_path = path;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_LAKKA_LIST);
|
2016-06-17 21:47:23 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_LAKKA_LIST;
|
2015-12-24 19:13:50 +00:00
|
|
|
break;
|
2015-09-04 11:08:15 +00:00
|
|
|
case ACTION_OK_DL_DEFERRED_CORE_LIST:
|
|
|
|
info.directory_ptr = idx;
|
2016-04-28 17:26:02 +00:00
|
|
|
info_path = settings->directory.libretro;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_CORE_LIST);
|
2016-06-17 21:47:23 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_CORE_LIST;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_DEFERRED_CORE_LIST_SET:
|
2015-09-07 00:02:34 +00:00
|
|
|
info.directory_ptr = idx;
|
2015-09-04 11:08:15 +00:00
|
|
|
rdb_entry_start_game_selection_ptr = idx;
|
2016-04-28 17:26:02 +00:00
|
|
|
info_path = settings->directory.libretro;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(
|
2016-06-16 10:56:10 +00:00
|
|
|
MENU_ENUM_LABEL_DEFERRED_CORE_LIST_SET);
|
2016-06-17 21:47:23 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_CORE_LIST_SET;
|
2015-09-04 11:08:15 +00:00
|
|
|
break;
|
2015-10-17 13:28:16 +00:00
|
|
|
case ACTION_OK_DL_ACCOUNTS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_LIST);
|
2016-06-17 21:47:23 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_LIST;
|
2015-10-17 13:28:16 +00:00
|
|
|
break;
|
2015-10-24 08:31:11 +00:00
|
|
|
case ACTION_OK_DL_INPUT_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_INPUT_SETTINGS_LIST);
|
2016-06-17 21:47:23 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_INPUT_SETTINGS_LIST;
|
2015-10-24 08:31:11 +00:00
|
|
|
break;
|
2016-06-16 19:40:13 +00:00
|
|
|
case ACTION_OK_DL_DRIVER_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_DRIVER_SETTINGS_LIST);
|
2016-06-17 21:47:23 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_DRIVER_SETTINGS_LIST;
|
2016-06-16 19:40:13 +00:00
|
|
|
break;
|
2016-06-18 20:17:39 +00:00
|
|
|
case ACTION_OK_DL_CORE_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_CORE_SETTINGS_LIST);
|
2016-06-18 20:17:39 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_CORE_SETTINGS_LIST;
|
|
|
|
break;
|
2016-06-17 02:02:26 +00:00
|
|
|
case ACTION_OK_DL_VIDEO_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_VIDEO_SETTINGS_LIST);
|
2016-06-17 21:47:23 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_VIDEO_SETTINGS_LIST;
|
2016-06-17 02:02:26 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_DL_AUDIO_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_AUDIO_SETTINGS_LIST);
|
2016-06-17 21:47:23 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_AUDIO_SETTINGS_LIST;
|
2016-06-17 02:02:26 +00:00
|
|
|
break;
|
2015-10-25 09:41:53 +00:00
|
|
|
case ACTION_OK_DL_INPUT_HOTKEY_BINDS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_INPUT_HOTKEY_BINDS_LIST);
|
2016-06-17 21:47:23 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_INPUT_HOTKEY_BINDS_LIST;
|
2015-10-25 09:41:53 +00:00
|
|
|
break;
|
2015-10-25 09:25:07 +00:00
|
|
|
case ACTION_OK_DL_PLAYLIST_SETTINGS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_PLAYLIST_SETTINGS_LIST);
|
2016-06-17 21:47:23 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_PLAYLIST_SETTINGS_LIST;
|
2015-10-25 09:25:07 +00:00
|
|
|
break;
|
2015-10-17 13:58:59 +00:00
|
|
|
case ACTION_OK_DL_ACCOUNTS_CHEEVOS_LIST:
|
|
|
|
info.directory_ptr = idx;
|
|
|
|
info.type = type;
|
|
|
|
info_path = path;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_CHEEVOS_LIST);
|
2016-06-17 21:47:23 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_CHEEVOS_LIST;
|
2015-10-17 13:58:59 +00:00
|
|
|
break;
|
2015-09-07 00:43:52 +00:00
|
|
|
case ACTION_OK_DL_CONTENT_SETTINGS:
|
|
|
|
dl_type = DISPLAYLIST_CONTENT_SETTINGS;
|
2015-10-17 15:56:19 +00:00
|
|
|
info.list = selection_buf;
|
2016-06-19 22:31:13 +00:00
|
|
|
info_path = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONTENT_SETTINGS);
|
|
|
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_CONTENT_SETTINGS);
|
2016-06-17 21:47:23 +00:00
|
|
|
info.enum_idx = MENU_ENUM_LABEL_CONTENT_SETTINGS;
|
2016-06-15 12:59:49 +00:00
|
|
|
menu_entries_add_enum(menu_stack, info_path, info_label,
|
|
|
|
MENU_ENUM_LABEL_CONTENT_SETTINGS,
|
|
|
|
0, 0, 0);
|
2015-09-07 00:43:52 +00:00
|
|
|
break;
|
2015-09-04 11:08:15 +00:00
|
|
|
}
|
|
|
|
|
2015-09-06 22:32:01 +00:00
|
|
|
if (info_label)
|
|
|
|
strlcpy(info.label, info_label, sizeof(info.label));
|
2015-09-06 22:38:23 +00:00
|
|
|
if (info_path)
|
|
|
|
strlcpy(info.path, info_path, sizeof(info.path));
|
2015-09-04 11:08:15 +00:00
|
|
|
|
2016-02-24 22:19:53 +00:00
|
|
|
if (menu_displaylist_ctl(dl_type, &info))
|
|
|
|
if (menu_displaylist_ctl(DISPLAYLIST_PROCESS, &info))
|
|
|
|
return 0;
|
2015-10-21 23:38:41 +00:00
|
|
|
|
2016-02-24 22:19:53 +00:00
|
|
|
return menu_cbs_exit();
|
2015-09-04 11:08:15 +00:00
|
|
|
}
|
|
|
|
|
2016-06-20 17:54:04 +00:00
|
|
|
static int generic_action_ok_file_load(const char *corepath, const char *fullpath,
|
|
|
|
enum rarch_core_type action_type, enum content_mode_load content_enum_idx)
|
|
|
|
{
|
|
|
|
content_ctx_info_t content_info = {0};
|
|
|
|
|
2016-06-30 16:34:11 +00:00
|
|
|
if (!task_push_content_load_default(
|
2016-06-20 17:54:04 +00:00
|
|
|
corepath, fullpath,
|
|
|
|
&content_info,
|
|
|
|
action_type,
|
|
|
|
content_enum_idx,
|
2016-06-30 16:34:11 +00:00
|
|
|
NULL, NULL))
|
|
|
|
return -1;
|
2016-06-20 17:54:04 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-02-06 18:43:42 +00:00
|
|
|
static int file_load_with_detect_core_wrapper(size_t idx, size_t entry_idx,
|
2016-01-25 04:58:45 +00:00
|
|
|
const char *path, const char *label,
|
|
|
|
uint32_t hash_label,
|
|
|
|
unsigned type, bool is_carchive)
|
2015-05-26 02:52:16 +00:00
|
|
|
{
|
2016-02-04 14:21:42 +00:00
|
|
|
menu_content_ctx_defer_info_t def_info;
|
2016-06-15 16:52:27 +00:00
|
|
|
char new_core_path[PATH_MAX_LENGTH] = {0};
|
2016-06-03 02:59:12 +00:00
|
|
|
char menu_path_new[PATH_MAX_LENGTH] = {0};
|
|
|
|
int ret = 0;
|
2016-06-19 22:31:13 +00:00
|
|
|
enum msg_hash_enums enum_idx = MSG_UNKNOWN;
|
2016-06-03 02:59:12 +00:00
|
|
|
const char *menu_path = NULL;
|
|
|
|
const char *menu_label = NULL;
|
|
|
|
menu_handle_t *menu = NULL;
|
|
|
|
core_info_list_t *list = NULL;
|
2015-05-26 02:52:16 +00:00
|
|
|
|
2016-02-10 20:15:23 +00:00
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
2016-02-10 20:42:18 +00:00
|
|
|
return menu_cbs_exit();
|
2015-05-26 02:52:16 +00:00
|
|
|
|
2016-06-17 14:08:47 +00:00
|
|
|
menu_entries_get_last_stack(&menu_path, &menu_label, NULL, &enum_idx, NULL);
|
2015-05-26 02:52:16 +00:00
|
|
|
|
2016-01-26 00:20:08 +00:00
|
|
|
if (!string_is_empty(menu_path))
|
|
|
|
strlcpy(menu_path_new, menu_path, sizeof(menu_path_new));
|
2015-07-14 10:49:54 +00:00
|
|
|
|
2016-02-06 18:43:42 +00:00
|
|
|
if (string_is_equal(menu_label,
|
2016-06-19 22:31:13 +00:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN_DETECT_CORE)))
|
2015-07-14 10:49:54 +00:00
|
|
|
fill_pathname_join(menu_path_new, menu->scratch2_buf, menu->scratch_buf,
|
|
|
|
sizeof(menu_path_new));
|
2016-01-20 03:59:39 +00:00
|
|
|
else if (string_is_equal(menu_label,
|
2016-06-19 22:31:13 +00:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN)))
|
2015-07-14 10:49:54 +00:00
|
|
|
fill_pathname_join(menu_path_new, menu->scratch2_buf, menu->scratch_buf,
|
|
|
|
sizeof(menu_path_new));
|
|
|
|
|
2016-05-09 16:11:17 +00:00
|
|
|
core_info_get_list(&list);
|
2015-12-11 12:51:17 +00:00
|
|
|
|
2016-02-04 14:21:42 +00:00
|
|
|
def_info.data = list;
|
|
|
|
def_info.dir = menu_path_new;
|
|
|
|
def_info.path = path;
|
|
|
|
def_info.menu_label = menu_label;
|
|
|
|
def_info.s = menu->deferred_path;
|
|
|
|
def_info.len = sizeof(menu->deferred_path);
|
|
|
|
|
2016-06-15 16:52:27 +00:00
|
|
|
if (menu_content_find_first_core(&def_info, false, new_core_path,
|
|
|
|
sizeof(new_core_path)))
|
2016-02-04 14:21:42 +00:00
|
|
|
ret = -1;
|
2015-05-26 02:52:16 +00:00
|
|
|
|
2016-02-06 18:43:42 +00:00
|
|
|
if ( !is_carchive && !string_is_empty(path)
|
|
|
|
&& !string_is_empty(menu_path_new))
|
2015-07-14 10:49:54 +00:00
|
|
|
fill_pathname_join(detect_content_path, menu_path_new, path,
|
2015-06-08 18:29:45 +00:00
|
|
|
sizeof(detect_content_path));
|
2015-06-07 21:26:29 +00:00
|
|
|
|
2015-09-04 13:43:01 +00:00
|
|
|
if (hash_label == MENU_LABEL_COLLECTION)
|
2015-09-05 15:17:26 +00:00
|
|
|
return generic_action_ok_displaylist_push(path,
|
2015-09-04 13:43:01 +00:00
|
|
|
NULL, 0, idx, entry_idx, ACTION_OK_DL_DEFERRED_CORE_LIST_SET);
|
2015-09-05 15:17:26 +00:00
|
|
|
|
2015-06-08 12:07:03 +00:00
|
|
|
switch (ret)
|
2015-05-26 02:52:16 +00:00
|
|
|
{
|
2015-06-08 12:07:03 +00:00
|
|
|
case -1:
|
2016-06-20 17:54:04 +00:00
|
|
|
return generic_action_ok_file_load(new_core_path, def_info.s,
|
2016-06-30 16:29:27 +00:00
|
|
|
CORE_TYPE_PLAIN, CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_MENU);
|
2015-06-08 12:07:03 +00:00
|
|
|
case 0:
|
2016-01-25 04:58:45 +00:00
|
|
|
return generic_action_ok_displaylist_push(path, label, type,
|
|
|
|
idx, entry_idx, ACTION_OK_DL_DEFERRED_CORE_LIST);
|
2015-09-07 00:46:47 +00:00
|
|
|
default:
|
2015-06-08 12:07:03 +00:00
|
|
|
break;
|
2015-05-26 02:52:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2015-06-08 18:29:45 +00:00
|
|
|
static int action_ok_file_load_with_detect_core_carchive(
|
|
|
|
const char *path,
|
2015-06-10 21:11:40 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-06-08 18:29:45 +00:00
|
|
|
{
|
2016-06-19 22:37:38 +00:00
|
|
|
uint32_t hash_label = msg_hash_calculate(label);
|
2015-06-08 18:29:45 +00:00
|
|
|
|
2015-06-22 17:48:49 +00:00
|
|
|
fill_pathname_join_delim(detect_content_path, detect_content_path, path,
|
|
|
|
'#', sizeof(detect_content_path));
|
2015-06-08 18:29:45 +00:00
|
|
|
|
2016-01-25 04:58:45 +00:00
|
|
|
type = 0;
|
|
|
|
label = NULL;
|
|
|
|
|
2016-02-06 18:43:42 +00:00
|
|
|
return file_load_with_detect_core_wrapper(idx, entry_idx,
|
2016-01-25 17:18:00 +00:00
|
|
|
path, label, hash_label, type, true);
|
2015-06-08 18:29:45 +00:00
|
|
|
}
|
|
|
|
|
2015-06-08 16:35:14 +00:00
|
|
|
static int action_ok_file_load_with_detect_core(const char *path,
|
2015-06-10 21:11:40 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-06-08 16:35:14 +00:00
|
|
|
{
|
2016-06-19 22:37:38 +00:00
|
|
|
uint32_t hash_label = msg_hash_calculate(label);
|
2015-06-08 16:35:14 +00:00
|
|
|
|
2016-01-25 04:58:45 +00:00
|
|
|
type = 0;
|
|
|
|
label = NULL;
|
|
|
|
|
2016-02-06 18:43:42 +00:00
|
|
|
return file_load_with_detect_core_wrapper(idx, entry_idx,
|
2016-01-25 17:18:00 +00:00
|
|
|
path, label, hash_label, type, false);
|
2015-06-08 16:35:14 +00:00
|
|
|
}
|
|
|
|
|
2015-10-06 12:09:52 +00:00
|
|
|
|
2015-06-07 21:26:29 +00:00
|
|
|
|
2016-06-14 20:48:25 +00:00
|
|
|
static int action_ok_playlist_entry_collection(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
size_t selection;
|
|
|
|
menu_content_ctx_playlist_info_t playlist_info;
|
|
|
|
size_t selection_ptr = 0;
|
2016-06-15 15:07:10 +00:00
|
|
|
playlist_t *playlist = NULL;
|
2016-06-19 20:28:55 +00:00
|
|
|
bool playlist_initialized = false;
|
2016-06-14 20:48:25 +00:00
|
|
|
const char *entry_path = NULL;
|
|
|
|
const char *entry_label = NULL;
|
|
|
|
const char *core_path = NULL;
|
|
|
|
const char *core_name = NULL;
|
|
|
|
playlist_t *tmp_playlist = NULL;
|
|
|
|
menu_handle_t *menu = NULL;
|
|
|
|
|
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
|
|
|
return menu_cbs_exit();
|
|
|
|
if (!menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection))
|
|
|
|
return menu_cbs_exit();
|
|
|
|
|
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &tmp_playlist);
|
|
|
|
|
|
|
|
if (!tmp_playlist)
|
|
|
|
{
|
|
|
|
tmp_playlist = playlist_init(
|
|
|
|
menu->db_playlist_file, COLLECTION_SIZE);
|
|
|
|
|
|
|
|
if (!tmp_playlist)
|
|
|
|
return menu_cbs_exit();
|
2016-06-19 20:28:55 +00:00
|
|
|
playlist_initialized = true;
|
2016-06-14 20:48:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
playlist = tmp_playlist;
|
|
|
|
|
|
|
|
selection_ptr = entry_idx;
|
|
|
|
|
|
|
|
playlist_get_index(playlist, selection_ptr,
|
|
|
|
&entry_path, &entry_label, &core_path, &core_name, NULL, NULL);
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
RARCH_LOG("path: %s, label: %s, core path: %s, core name: %s, idx: %d\n",
|
|
|
|
entry_path, entry_label,
|
|
|
|
core_path, core_name, selection_ptr);
|
|
|
|
RARCH_LOG("playlist file: %s\n", menu->db_playlist_file);
|
|
|
|
#endif
|
|
|
|
|
2016-06-14 20:54:43 +00:00
|
|
|
if ( string_is_equal(core_path, "DETECT")
|
|
|
|
&& string_is_equal(core_name, "DETECT"))
|
2016-06-14 20:48:25 +00:00
|
|
|
{
|
|
|
|
core_info_ctx_find_t core_info;
|
|
|
|
char new_core_path[PATH_MAX_LENGTH] = {0};
|
|
|
|
char new_display_name[PATH_MAX_LENGTH] = {0};
|
|
|
|
const char *entry_path = NULL;
|
|
|
|
const char *entry_crc32 = NULL;
|
|
|
|
const char *db_name = NULL;
|
|
|
|
const char *path_base = path_basename(menu->db_playlist_file);
|
|
|
|
bool found_associated_core = menu_playlist_find_associated_core(
|
|
|
|
path_base, new_core_path, sizeof(new_core_path));
|
|
|
|
|
|
|
|
core_info.inf = NULL;
|
|
|
|
core_info.path = new_core_path;
|
|
|
|
|
|
|
|
if (!core_info_find(&core_info))
|
|
|
|
found_associated_core = false;
|
|
|
|
|
|
|
|
if (!found_associated_core)
|
2016-06-19 20:28:55 +00:00
|
|
|
{
|
|
|
|
int ret = action_ok_file_load_with_detect_core(entry_path,
|
2016-06-14 20:48:25 +00:00
|
|
|
label, type, selection_ptr, entry_idx);
|
2016-06-19 20:28:55 +00:00
|
|
|
if (playlist_initialized)
|
|
|
|
playlist_free(tmp_playlist);
|
|
|
|
return ret;
|
|
|
|
}
|
2016-06-14 20:48:25 +00:00
|
|
|
|
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &tmp_playlist);
|
|
|
|
|
|
|
|
playlist_get_index(tmp_playlist, selection_ptr,
|
|
|
|
&entry_path, &entry_label, NULL, NULL, &entry_crc32, &db_name);
|
|
|
|
|
|
|
|
strlcpy(new_display_name, core_info.inf->display_name, sizeof(new_display_name));
|
|
|
|
playlist_update(tmp_playlist,
|
|
|
|
selection_ptr,
|
|
|
|
entry_path,
|
|
|
|
entry_label,
|
|
|
|
new_core_path,
|
|
|
|
new_display_name,
|
|
|
|
entry_crc32,
|
|
|
|
db_name);
|
|
|
|
playlist_write_file(tmp_playlist);
|
|
|
|
}
|
|
|
|
|
|
|
|
playlist_info.data = playlist;
|
|
|
|
playlist_info.idx = selection_ptr;
|
|
|
|
|
2016-06-15 17:16:27 +00:00
|
|
|
if (!menu_content_load_from_playlist(&playlist_info))
|
|
|
|
return menu_cbs_exit();
|
2016-06-14 20:48:25 +00:00
|
|
|
|
2016-06-30 16:25:19 +00:00
|
|
|
playlist_get_index(playlist,
|
|
|
|
playlist_info.idx, &path, NULL, NULL, NULL, NULL, NULL);
|
|
|
|
|
2016-06-30 16:31:45 +00:00
|
|
|
return generic_action_ok_file_load(core_path, path,
|
|
|
|
CORE_TYPE_PLAIN, CONTENT_MODE_LOAD_CONTENT_FROM_PLAYLIST_FROM_MENU);
|
2016-06-14 20:48:25 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_playlist_entry(const char *path,
|
2015-06-10 21:11:40 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2015-09-25 17:26:31 +00:00
|
|
|
size_t selection;
|
2016-02-04 14:00:38 +00:00
|
|
|
menu_content_ctx_playlist_info_t playlist_info;
|
2016-02-10 20:15:23 +00:00
|
|
|
size_t selection_ptr = 0;
|
2016-06-19 20:30:57 +00:00
|
|
|
bool playlist_initialized = false;
|
2016-06-03 02:59:12 +00:00
|
|
|
playlist_t *playlist = g_defaults.history;
|
2015-12-11 11:44:58 +00:00
|
|
|
const char *entry_path = NULL;
|
|
|
|
const char *entry_label = NULL;
|
|
|
|
const char *core_path = NULL;
|
|
|
|
const char *core_name = NULL;
|
2016-06-03 02:59:12 +00:00
|
|
|
playlist_t *tmp_playlist = NULL;
|
2016-02-10 20:15:23 +00:00
|
|
|
menu_handle_t *menu = NULL;
|
2016-06-19 22:37:38 +00:00
|
|
|
uint32_t hash_label = msg_hash_calculate(label);
|
2015-06-06 13:28:16 +00:00
|
|
|
|
2016-02-10 20:15:23 +00:00
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
2016-02-10 20:42:18 +00:00
|
|
|
return menu_cbs_exit();
|
2015-09-25 17:26:31 +00:00
|
|
|
if (!menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection))
|
2016-02-10 20:42:18 +00:00
|
|
|
return menu_cbs_exit();
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-06-06 13:28:16 +00:00
|
|
|
switch (hash_label)
|
2015-05-25 23:58:52 +00:00
|
|
|
{
|
2015-06-06 13:28:16 +00:00
|
|
|
case MENU_LABEL_COLLECTION:
|
|
|
|
case MENU_LABEL_RDB_ENTRY_START_CONTENT:
|
2015-12-11 11:44:58 +00:00
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &tmp_playlist);
|
|
|
|
|
|
|
|
if (!tmp_playlist)
|
2015-06-06 13:28:16 +00:00
|
|
|
{
|
2016-05-16 07:07:44 +00:00
|
|
|
tmp_playlist = playlist_init(
|
2016-01-25 17:18:00 +00:00
|
|
|
menu->db_playlist_file, COLLECTION_SIZE);
|
2015-06-06 13:28:16 +00:00
|
|
|
|
2015-12-11 11:44:58 +00:00
|
|
|
if (!tmp_playlist)
|
2016-02-10 20:42:18 +00:00
|
|
|
return menu_cbs_exit();
|
2016-06-19 20:30:57 +00:00
|
|
|
playlist_initialized = true;
|
2015-06-06 13:28:16 +00:00
|
|
|
}
|
2015-05-26 02:27:21 +00:00
|
|
|
|
2015-12-11 11:44:58 +00:00
|
|
|
playlist = tmp_playlist;
|
2015-06-06 13:28:16 +00:00
|
|
|
break;
|
2015-05-25 23:58:52 +00:00
|
|
|
}
|
|
|
|
|
2015-06-10 21:11:40 +00:00
|
|
|
selection_ptr = entry_idx;
|
2015-05-25 23:58:52 +00:00
|
|
|
|
2015-06-06 13:28:16 +00:00
|
|
|
switch (hash_label)
|
|
|
|
{
|
|
|
|
case MENU_LABEL_RDB_ENTRY_START_CONTENT:
|
|
|
|
selection_ptr = rdb_entry_start_game_selection_ptr;
|
|
|
|
break;
|
|
|
|
}
|
2015-05-25 23:58:52 +00:00
|
|
|
|
2016-05-16 07:07:44 +00:00
|
|
|
playlist_get_index(playlist, selection_ptr,
|
2015-06-08 21:38:03 +00:00
|
|
|
&entry_path, &entry_label, &core_path, &core_name, NULL, NULL);
|
2015-05-26 02:52:16 +00:00
|
|
|
|
2015-05-28 03:38:34 +00:00
|
|
|
#if 0
|
2016-01-25 17:18:00 +00:00
|
|
|
RARCH_LOG("path: %s, label: %s, core path: %s, core name: %s, idx: %d\n",
|
|
|
|
entry_path, entry_label,
|
2015-05-28 03:38:34 +00:00
|
|
|
core_path, core_name, selection_ptr);
|
2015-10-31 15:27:48 +00:00
|
|
|
RARCH_LOG("playlist file: %s\n", menu->db_playlist_file);
|
2015-05-26 02:52:16 +00:00
|
|
|
#endif
|
|
|
|
|
2016-06-30 17:09:22 +00:00
|
|
|
if ( string_is_equal(core_path, file_path_str(FILE_PATH_DETECT))
|
|
|
|
&& string_is_equal(core_name, file_path_str(FILE_PATH_DETECT)))
|
2015-10-31 15:27:48 +00:00
|
|
|
{
|
2016-02-07 01:50:16 +00:00
|
|
|
core_info_ctx_find_t core_info;
|
2016-05-27 02:31:02 +00:00
|
|
|
char new_core_path[PATH_MAX_LENGTH] = {0};
|
|
|
|
char new_display_name[PATH_MAX_LENGTH] = {0};
|
|
|
|
const char *entry_path = NULL;
|
|
|
|
const char *entry_crc32 = NULL;
|
|
|
|
const char *db_name = NULL;
|
|
|
|
const char *path_base = path_basename(menu->db_playlist_file);
|
|
|
|
bool found_associated_core = menu_playlist_find_associated_core(
|
2015-10-31 16:44:42 +00:00
|
|
|
path_base, new_core_path, sizeof(new_core_path));
|
|
|
|
|
2016-02-07 01:50:16 +00:00
|
|
|
core_info.inf = NULL;
|
|
|
|
core_info.path = new_core_path;
|
2015-12-11 12:51:17 +00:00
|
|
|
|
2016-05-09 16:11:17 +00:00
|
|
|
if (!core_info_find(&core_info))
|
2015-10-31 16:44:42 +00:00
|
|
|
found_associated_core = false;
|
|
|
|
|
2016-01-25 17:11:26 +00:00
|
|
|
if (!found_associated_core)
|
2016-06-19 20:30:57 +00:00
|
|
|
{
|
|
|
|
int ret = action_ok_file_load_with_detect_core(entry_path,
|
2016-01-25 17:18:00 +00:00
|
|
|
label, type, selection_ptr, entry_idx);
|
2016-06-19 20:30:57 +00:00
|
|
|
if (playlist_initialized)
|
|
|
|
playlist_free(tmp_playlist);
|
|
|
|
return ret;
|
|
|
|
}
|
2016-01-25 17:11:26 +00:00
|
|
|
|
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &tmp_playlist);
|
|
|
|
|
2016-05-16 07:07:44 +00:00
|
|
|
playlist_get_index(tmp_playlist, selection_ptr,
|
2016-01-25 17:11:26 +00:00
|
|
|
&entry_path, &entry_label, NULL, NULL, &entry_crc32, &db_name);
|
|
|
|
|
2016-02-07 01:50:16 +00:00
|
|
|
strlcpy(new_display_name, core_info.inf->display_name, sizeof(new_display_name));
|
2016-05-16 07:07:44 +00:00
|
|
|
playlist_update(tmp_playlist,
|
2016-01-25 17:11:26 +00:00
|
|
|
selection_ptr,
|
|
|
|
entry_path,
|
|
|
|
entry_label,
|
|
|
|
new_core_path,
|
|
|
|
new_display_name,
|
|
|
|
entry_crc32,
|
|
|
|
db_name);
|
2016-05-16 07:07:44 +00:00
|
|
|
playlist_write_file(tmp_playlist);
|
2015-10-31 15:27:48 +00:00
|
|
|
}
|
2015-05-26 02:52:16 +00:00
|
|
|
|
2016-02-04 14:00:38 +00:00
|
|
|
playlist_info.data = playlist;
|
|
|
|
playlist_info.idx = selection_ptr;
|
|
|
|
|
2016-06-15 17:16:27 +00:00
|
|
|
if (!menu_content_load_from_playlist(&playlist_info))
|
|
|
|
return menu_cbs_exit();
|
2015-05-25 23:58:52 +00:00
|
|
|
|
2016-06-30 16:25:19 +00:00
|
|
|
playlist_get_index(playlist,
|
|
|
|
playlist_info.idx, &path, NULL, NULL, NULL, NULL, NULL);
|
|
|
|
|
2016-06-30 17:05:55 +00:00
|
|
|
return generic_action_ok_file_load(core_path, path,
|
2016-06-30 16:31:45 +00:00
|
|
|
CORE_TYPE_PLAIN, CONTENT_MODE_LOAD_CONTENT_FROM_PLAYLIST_FROM_MENU);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_cheat_apply_changes(const char *path,
|
2015-06-10 21:11:40 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2016-05-09 18:51:53 +00:00
|
|
|
command_event(CMD_EVENT_CHEATS_APPLY, NULL);
|
2015-02-26 15:50:30 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-09-02 23:56:01 +00:00
|
|
|
enum
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-09-02 23:56:01 +00:00
|
|
|
ACTION_OK_LOAD_PRESET = 0,
|
2015-09-03 00:00:18 +00:00
|
|
|
ACTION_OK_LOAD_SHADER_PASS,
|
|
|
|
ACTION_OK_LOAD_RECORD_CONFIGFILE,
|
2015-09-03 00:05:37 +00:00
|
|
|
ACTION_OK_LOAD_REMAPPING_FILE,
|
|
|
|
ACTION_OK_LOAD_CHEAT_FILE,
|
2015-09-04 20:24:04 +00:00
|
|
|
ACTION_OK_APPEND_DISK_IMAGE,
|
2015-09-04 20:33:30 +00:00
|
|
|
ACTION_OK_LOAD_CONFIG_FILE,
|
2015-09-04 20:48:20 +00:00
|
|
|
ACTION_OK_LOAD_CORE,
|
2015-09-04 21:11:04 +00:00
|
|
|
ACTION_OK_LOAD_WALLPAPER,
|
2016-06-17 13:10:49 +00:00
|
|
|
ACTION_OK_SET_PATH,
|
|
|
|
ACTION_OK_SET_DIRECTORY
|
2015-09-02 23:56:01 +00:00
|
|
|
};
|
2015-09-02 16:38:45 +00:00
|
|
|
|
2015-09-02 23:56:01 +00:00
|
|
|
static int generic_action_ok(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx,
|
2016-06-19 22:31:13 +00:00
|
|
|
unsigned id, enum msg_hash_enums flush_id)
|
2015-09-02 23:56:01 +00:00
|
|
|
{
|
2016-06-01 01:23:38 +00:00
|
|
|
char action_path[PATH_MAX_LENGTH] = {0};
|
2015-09-04 20:33:30 +00:00
|
|
|
unsigned flush_type = 0;
|
2015-09-04 20:24:04 +00:00
|
|
|
int ret = 0;
|
2016-06-19 22:31:13 +00:00
|
|
|
enum msg_hash_enums enum_idx = MSG_UNKNOWN;
|
2015-09-02 23:56:01 +00:00
|
|
|
const char *menu_path = NULL;
|
2016-06-17 13:54:31 +00:00
|
|
|
const char *menu_label = NULL;
|
2015-09-04 20:33:30 +00:00
|
|
|
const char *flush_char = NULL;
|
2016-02-10 20:15:23 +00:00
|
|
|
menu_handle_t *menu = NULL;
|
2015-09-26 21:51:35 +00:00
|
|
|
|
2016-02-10 20:15:23 +00:00
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
2015-09-02 16:38:45 +00:00
|
|
|
goto error;
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2016-06-17 14:08:47 +00:00
|
|
|
menu_entries_get_last_stack(&menu_path, &menu_label, NULL, &enum_idx, NULL);
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2016-06-17 13:33:42 +00:00
|
|
|
if (!string_is_empty(path))
|
|
|
|
fill_pathname_join(action_path, menu_path, path, sizeof(action_path));
|
|
|
|
else
|
|
|
|
strlcpy(action_path, menu_path, sizeof(action_path));
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-09-02 23:56:01 +00:00
|
|
|
switch (id)
|
|
|
|
{
|
2015-09-04 20:48:20 +00:00
|
|
|
case ACTION_OK_LOAD_WALLPAPER:
|
2016-06-18 17:02:51 +00:00
|
|
|
flush_type = MENU_SETTINGS;
|
2015-09-04 20:48:20 +00:00
|
|
|
if (path_file_exists(action_path))
|
|
|
|
{
|
2016-05-16 14:25:16 +00:00
|
|
|
settings_t *settings = config_get_ptr();
|
2016-01-25 05:41:58 +00:00
|
|
|
|
2016-04-28 18:49:13 +00:00
|
|
|
strlcpy(settings->path.menu_wallpaper,
|
|
|
|
action_path, sizeof(settings->path.menu_wallpaper));
|
2016-06-18 16:41:18 +00:00
|
|
|
task_push_image_load(action_path,
|
2016-06-20 14:14:59 +00:00
|
|
|
MENU_ENUM_LABEL_CB_MENU_WALLPAPER,
|
2015-11-24 16:50:37 +00:00
|
|
|
menu_display_handle_wallpaper_upload, NULL);
|
2015-09-04 20:48:20 +00:00
|
|
|
}
|
|
|
|
break;
|
2015-09-04 20:33:30 +00:00
|
|
|
case ACTION_OK_LOAD_CORE:
|
|
|
|
flush_type = MENU_SETTINGS;
|
2016-06-15 16:17:01 +00:00
|
|
|
|
2016-06-30 16:34:11 +00:00
|
|
|
if (generic_action_ok_file_load(action_path,
|
|
|
|
NULL, CORE_TYPE_PLAIN,
|
|
|
|
CONTENT_MODE_LOAD_NOTHING_WITH_NEW_CORE_FROM_MENU) == 0)
|
2016-02-04 16:08:09 +00:00
|
|
|
{
|
|
|
|
#ifndef HAVE_DYNAMIC
|
2016-06-15 16:17:01 +00:00
|
|
|
ret = -1;
|
2015-09-04 20:33:30 +00:00
|
|
|
#endif
|
2016-02-04 16:08:09 +00:00
|
|
|
}
|
2015-09-04 20:49:14 +00:00
|
|
|
break;
|
2015-09-04 20:24:04 +00:00
|
|
|
case ACTION_OK_LOAD_CONFIG_FILE:
|
2016-06-16 11:37:33 +00:00
|
|
|
flush_type = MENU_SETTINGS;
|
|
|
|
menu_display_set_msg_force(true);
|
|
|
|
|
|
|
|
if (config_replace(action_path))
|
2015-09-04 20:49:14 +00:00
|
|
|
{
|
2016-06-16 11:37:33 +00:00
|
|
|
bool pending_push = false;
|
|
|
|
menu_navigation_ctl(MENU_NAVIGATION_CTL_CLEAR, &pending_push);
|
|
|
|
ret = -1;
|
2015-09-04 20:49:14 +00:00
|
|
|
}
|
2015-09-18 05:59:23 +00:00
|
|
|
break;
|
2015-09-02 23:56:01 +00:00
|
|
|
#ifdef HAVE_SHADER_MANAGER
|
|
|
|
case ACTION_OK_LOAD_PRESET:
|
2016-06-17 13:36:06 +00:00
|
|
|
{
|
|
|
|
struct video_shader *shader = NULL;
|
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_SHADER_GET, &shader);
|
2016-06-19 22:31:13 +00:00
|
|
|
flush_char = msg_hash_to_str(flush_id);
|
2016-06-17 13:36:06 +00:00
|
|
|
menu_shader_manager_set_preset(shader,
|
|
|
|
video_shader_parse_type(action_path, RARCH_SHADER_NONE),
|
|
|
|
action_path);
|
|
|
|
}
|
2015-09-04 20:49:14 +00:00
|
|
|
break;
|
2015-09-02 23:56:01 +00:00
|
|
|
case ACTION_OK_LOAD_SHADER_PASS:
|
2016-06-17 13:36:06 +00:00
|
|
|
{
|
|
|
|
struct video_shader *shader = NULL;
|
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_SHADER_GET, &shader);
|
2016-06-19 22:31:13 +00:00
|
|
|
flush_char = msg_hash_to_str(flush_id);
|
2016-06-17 13:36:06 +00:00
|
|
|
strlcpy(
|
|
|
|
shader->pass[hack_shader_pass].source.path,
|
|
|
|
action_path,
|
|
|
|
sizeof(shader->pass[hack_shader_pass].source.path));
|
|
|
|
video_shader_resolve_parameters(NULL, shader);
|
|
|
|
}
|
2015-09-04 20:49:14 +00:00
|
|
|
break;
|
2015-02-26 15:50:30 +00:00
|
|
|
#endif
|
2015-09-03 00:00:18 +00:00
|
|
|
case ACTION_OK_LOAD_RECORD_CONFIGFILE:
|
2016-01-25 05:41:58 +00:00
|
|
|
{
|
|
|
|
global_t *global = global_get_ptr();
|
2016-06-19 22:31:13 +00:00
|
|
|
flush_char = msg_hash_to_str(flush_id);
|
2016-01-25 05:41:58 +00:00
|
|
|
strlcpy(global->record.config, action_path,
|
|
|
|
sizeof(global->record.config));
|
|
|
|
}
|
2015-09-04 20:49:14 +00:00
|
|
|
break;
|
2015-09-03 00:00:18 +00:00
|
|
|
case ACTION_OK_LOAD_REMAPPING_FILE:
|
2015-11-15 21:02:24 +00:00
|
|
|
{
|
|
|
|
config_file_t *conf = config_file_new(action_path);
|
2016-06-19 22:31:13 +00:00
|
|
|
flush_char = msg_hash_to_str(flush_id);
|
2015-11-15 21:02:24 +00:00
|
|
|
|
|
|
|
if (conf)
|
|
|
|
input_remapping_load_file(conf, action_path);
|
|
|
|
}
|
2015-09-04 20:49:14 +00:00
|
|
|
break;
|
2015-09-03 00:05:37 +00:00
|
|
|
case ACTION_OK_LOAD_CHEAT_FILE:
|
2016-06-19 22:31:13 +00:00
|
|
|
flush_char = msg_hash_to_str(flush_id);
|
2015-12-01 02:00:31 +00:00
|
|
|
cheat_manager_free();
|
2015-09-03 00:05:37 +00:00
|
|
|
|
2015-12-01 02:00:31 +00:00
|
|
|
if (!cheat_manager_load(action_path))
|
2015-09-04 20:49:14 +00:00
|
|
|
goto error;
|
|
|
|
break;
|
2015-09-03 00:05:37 +00:00
|
|
|
case ACTION_OK_APPEND_DISK_IMAGE:
|
2016-06-18 17:02:51 +00:00
|
|
|
flush_type = MENU_SETTINGS;
|
2016-05-09 18:51:53 +00:00
|
|
|
command_event(CMD_EVENT_DISK_APPEND_IMAGE, action_path);
|
|
|
|
command_event(CMD_EVENT_RESUME, NULL);
|
2015-09-04 20:49:14 +00:00
|
|
|
break;
|
2016-06-17 13:10:49 +00:00
|
|
|
case ACTION_OK_SET_DIRECTORY:
|
2015-09-04 21:11:04 +00:00
|
|
|
case ACTION_OK_SET_PATH:
|
2016-06-18 17:02:51 +00:00
|
|
|
flush_type = MENU_SETTINGS;
|
2015-09-04 21:11:04 +00:00
|
|
|
{
|
2016-06-17 13:54:31 +00:00
|
|
|
rarch_setting_t *setting = menu_setting_find(menu_label);
|
2015-09-04 21:11:04 +00:00
|
|
|
|
2016-06-17 13:54:31 +00:00
|
|
|
if (setting)
|
2015-09-04 21:32:18 +00:00
|
|
|
{
|
2016-01-25 17:18:00 +00:00
|
|
|
menu_setting_set_with_string_representation(
|
2016-06-17 13:54:31 +00:00
|
|
|
setting, action_path);
|
|
|
|
ret = menu_setting_generic(setting, false);
|
2015-09-04 21:32:18 +00:00
|
|
|
}
|
2015-09-04 21:11:04 +00:00
|
|
|
}
|
|
|
|
break;
|
2015-09-02 23:56:01 +00:00
|
|
|
default:
|
2016-06-19 22:31:13 +00:00
|
|
|
flush_char = msg_hash_to_str(flush_id);
|
2015-09-04 20:49:14 +00:00
|
|
|
break;
|
2015-09-02 23:56:01 +00:00
|
|
|
}
|
|
|
|
|
2015-10-17 17:10:37 +00:00
|
|
|
menu_entries_flush_stack(flush_char, flush_type);
|
2015-09-02 23:56:01 +00:00
|
|
|
|
2015-09-04 20:24:04 +00:00
|
|
|
return ret;
|
2015-09-02 16:38:45 +00:00
|
|
|
|
|
|
|
error:
|
2016-02-10 20:42:18 +00:00
|
|
|
return menu_cbs_exit();
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-09-04 21:11:04 +00:00
|
|
|
static int action_ok_set_path(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok(path, label, type, idx, entry_idx,
|
2016-06-19 22:31:13 +00:00
|
|
|
ACTION_OK_SET_PATH, MSG_UNKNOWN);
|
2015-09-04 21:11:04 +00:00
|
|
|
}
|
|
|
|
|
2015-09-04 20:48:20 +00:00
|
|
|
static int action_ok_menu_wallpaper_load(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
|
|
|
|
return generic_action_ok(path, label, type, idx, entry_idx,
|
2016-06-19 22:31:13 +00:00
|
|
|
ACTION_OK_LOAD_WALLPAPER, MSG_UNKNOWN);
|
2015-09-04 20:48:20 +00:00
|
|
|
}
|
|
|
|
|
2016-06-15 16:07:00 +00:00
|
|
|
static int action_ok_load_core(const char *path,
|
2015-09-04 20:33:30 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok(path, label, type, idx, entry_idx,
|
2016-06-19 22:31:13 +00:00
|
|
|
ACTION_OK_LOAD_CORE, MSG_UNKNOWN);
|
2015-09-04 20:33:30 +00:00
|
|
|
}
|
|
|
|
|
2015-09-04 20:24:04 +00:00
|
|
|
static int action_ok_config_load(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok(path, label, type, idx, entry_idx,
|
2016-06-19 22:31:13 +00:00
|
|
|
ACTION_OK_LOAD_CONFIG_FILE, MSG_UNKNOWN);
|
2015-09-04 20:24:04 +00:00
|
|
|
}
|
|
|
|
|
2015-09-03 00:05:37 +00:00
|
|
|
static int action_ok_disk_image_append(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok(path, label, type, idx, entry_idx,
|
2016-06-19 22:31:13 +00:00
|
|
|
ACTION_OK_APPEND_DISK_IMAGE, MSG_UNKNOWN);
|
2015-09-03 00:05:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_cheat_file_load(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok(path, label, type, idx, entry_idx,
|
2016-06-16 11:41:53 +00:00
|
|
|
ACTION_OK_LOAD_CHEAT_FILE, MENU_ENUM_LABEL_CORE_CHEAT_OPTIONS);
|
2015-09-03 00:05:37 +00:00
|
|
|
}
|
|
|
|
|
2015-09-03 00:00:18 +00:00
|
|
|
static int action_ok_record_configfile_load(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok(path, label, type, idx, entry_idx,
|
2016-06-16 11:41:53 +00:00
|
|
|
ACTION_OK_LOAD_RECORD_CONFIGFILE, MENU_ENUM_LABEL_RECORDING_SETTINGS);
|
2015-09-03 00:00:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_remap_file_load(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok(path, label, type, idx, entry_idx,
|
2016-01-25 17:18:00 +00:00
|
|
|
ACTION_OK_LOAD_REMAPPING_FILE,
|
2016-06-16 11:41:53 +00:00
|
|
|
MENU_ENUM_LABEL_CORE_INPUT_REMAPPING_OPTIONS);
|
2015-09-03 00:00:18 +00:00
|
|
|
}
|
|
|
|
|
2015-09-02 23:56:01 +00:00
|
|
|
static int action_ok_shader_preset_load(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok(path, label, type, idx, entry_idx,
|
2016-06-16 11:41:53 +00:00
|
|
|
ACTION_OK_LOAD_PRESET, MENU_ENUM_LABEL_SHADER_OPTIONS);
|
2015-09-02 23:56:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_shader_pass_load(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok(path, label, type, idx, entry_idx,
|
2016-06-16 11:41:53 +00:00
|
|
|
ACTION_OK_LOAD_SHADER_PASS, MENU_ENUM_LABEL_SHADER_OPTIONS);
|
2015-09-02 23:56:01 +00:00
|
|
|
}
|
|
|
|
|
2015-11-08 17:52:04 +00:00
|
|
|
static int generic_action_ok_help(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx,
|
2016-06-19 22:31:13 +00:00
|
|
|
enum msg_hash_enums id, enum menu_help_type id2)
|
2015-11-08 17:52:04 +00:00
|
|
|
{
|
2016-06-19 22:31:13 +00:00
|
|
|
const char *lbl = msg_hash_to_str(id);
|
2016-02-10 20:15:23 +00:00
|
|
|
menu_handle_t *menu = NULL;
|
|
|
|
|
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu);
|
2015-11-08 17:52:04 +00:00
|
|
|
menu->help_screen_type = id2;
|
2016-02-10 20:15:23 +00:00
|
|
|
|
2015-11-08 17:52:04 +00:00
|
|
|
return generic_action_ok_displaylist_push(path, lbl, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_HELP);
|
|
|
|
}
|
|
|
|
|
2015-11-08 17:11:53 +00:00
|
|
|
static int action_ok_cheevos(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-02-10 20:15:23 +00:00
|
|
|
menu_handle_t *menu = NULL;
|
2015-11-08 17:52:04 +00:00
|
|
|
unsigned new_id = type - MENU_SETTINGS_CHEEVOS_START;
|
|
|
|
|
2016-02-10 20:15:23 +00:00
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu);
|
|
|
|
|
2015-11-08 17:52:04 +00:00
|
|
|
menu->help_screen_id = new_id;
|
|
|
|
return generic_action_ok_help(path, label, type, idx, entry_idx,
|
2016-06-16 11:28:04 +00:00
|
|
|
MENU_ENUM_LABEL_CHEEVOS_DESCRIPTION, MENU_HELP_CHEEVOS_DESCRIPTION);
|
2015-11-08 17:11:53 +00:00
|
|
|
}
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_cheat(const char *path,
|
2015-06-10 21:11:40 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2016-02-25 17:36:29 +00:00
|
|
|
menu_input_ctx_line_t line;
|
|
|
|
|
|
|
|
line.label = "Input Cheat";
|
|
|
|
line.label_setting = label;
|
|
|
|
line.type = type;
|
|
|
|
line.idx = idx;
|
|
|
|
line.cb = menu_input_st_cheat_cb;
|
|
|
|
|
|
|
|
if (!menu_input_ctl(MENU_INPUT_CTL_START_LINE, &line))
|
|
|
|
return -1;
|
2015-02-26 15:50:30 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-06-14 20:16:07 +00:00
|
|
|
static void menu_input_st_string_cb_save_preset(void *userdata, const char *str)
|
|
|
|
{
|
|
|
|
if (str && *str)
|
|
|
|
{
|
|
|
|
rarch_setting_t *setting = NULL;
|
|
|
|
const char *label = NULL;
|
|
|
|
|
|
|
|
menu_input_ctl(MENU_INPUT_CTL_KEYBOARD_LABEL_SETTING, &label);
|
|
|
|
|
|
|
|
if (!string_is_empty(label))
|
|
|
|
setting = menu_setting_find(label);
|
|
|
|
|
|
|
|
if (setting)
|
|
|
|
{
|
|
|
|
menu_setting_set_with_string_representation(setting, str);
|
|
|
|
menu_setting_generic(setting, false);
|
|
|
|
}
|
|
|
|
else if (!string_is_empty(label))
|
|
|
|
menu_shader_manager_save_preset(str, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
menu_input_key_end_line();
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_shader_preset_save_as(const char *path,
|
2015-06-10 21:11:40 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2016-02-25 17:36:29 +00:00
|
|
|
menu_input_ctx_line_t line;
|
|
|
|
|
|
|
|
line.label = "Preset Filename";
|
|
|
|
line.label_setting = label;
|
|
|
|
line.type = type;
|
|
|
|
line.idx = idx;
|
2016-06-14 20:16:07 +00:00
|
|
|
line.cb = menu_input_st_string_cb_save_preset;
|
2016-02-25 17:36:29 +00:00
|
|
|
|
|
|
|
if (!menu_input_ctl(MENU_INPUT_CTL_START_LINE, &line))
|
|
|
|
return -1;
|
2015-02-26 15:50:30 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-06-14 20:16:07 +00:00
|
|
|
static void menu_input_st_string_cb_cheat_file_save_as(void *userdata, const char *str)
|
|
|
|
{
|
|
|
|
if (str && *str)
|
|
|
|
{
|
|
|
|
rarch_setting_t *setting = NULL;
|
|
|
|
const char *label = NULL;
|
|
|
|
|
|
|
|
menu_input_ctl(MENU_INPUT_CTL_KEYBOARD_LABEL_SETTING, &label);
|
|
|
|
|
|
|
|
if (!string_is_empty(label))
|
|
|
|
setting = menu_setting_find(label);
|
|
|
|
|
|
|
|
if (setting)
|
|
|
|
{
|
|
|
|
menu_setting_set_with_string_representation(setting, str);
|
|
|
|
menu_setting_generic(setting, false);
|
|
|
|
}
|
|
|
|
else if (!string_is_empty(label))
|
|
|
|
cheat_manager_save(str);
|
|
|
|
}
|
|
|
|
|
|
|
|
menu_input_key_end_line();
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_cheat_file_save_as(const char *path,
|
2015-06-10 21:11:40 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2016-02-25 17:36:29 +00:00
|
|
|
menu_input_ctx_line_t line;
|
|
|
|
|
|
|
|
line.label = "Cheat Filename";
|
|
|
|
line.label_setting = label;
|
|
|
|
line.type = type;
|
|
|
|
line.idx = idx;
|
2016-06-14 20:16:07 +00:00
|
|
|
line.cb = menu_input_st_string_cb_cheat_file_save_as;
|
2016-02-25 17:36:29 +00:00
|
|
|
|
|
|
|
if (!menu_input_ctl(MENU_INPUT_CTL_START_LINE, &line))
|
|
|
|
return -1;
|
2015-02-26 15:50:30 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-09-04 19:59:04 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
ACTION_OK_REMAP_FILE_SAVE_CORE = 0,
|
|
|
|
ACTION_OK_REMAP_FILE_SAVE_GAME
|
|
|
|
};
|
|
|
|
|
|
|
|
static int generic_action_ok_remap_file_save(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx,
|
|
|
|
unsigned action_type)
|
2015-04-06 23:47:58 +00:00
|
|
|
{
|
2016-06-01 01:23:38 +00:00
|
|
|
char directory[PATH_MAX_LENGTH] = {0};
|
|
|
|
char file[PATH_MAX_LENGTH] = {0};
|
2015-09-04 19:59:04 +00:00
|
|
|
global_t *global = global_get_ptr();
|
|
|
|
settings_t *settings = config_get_ptr();
|
2015-12-10 21:30:25 +00:00
|
|
|
rarch_system_info_t *info = NULL;
|
|
|
|
const char *core_name = NULL;
|
|
|
|
|
2016-05-12 07:37:21 +00:00
|
|
|
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &info);
|
2015-12-10 21:30:25 +00:00
|
|
|
|
|
|
|
if (info)
|
|
|
|
core_name = info->info.library_name;
|
2015-04-06 23:47:58 +00:00
|
|
|
|
2016-06-29 10:13:40 +00:00
|
|
|
if (!string_is_empty(core_name))
|
|
|
|
fill_pathname_join(
|
|
|
|
directory,
|
|
|
|
settings->directory.input_remapping,
|
|
|
|
core_name,
|
|
|
|
sizeof(directory));
|
2015-09-04 19:59:04 +00:00
|
|
|
|
|
|
|
switch (action_type)
|
|
|
|
{
|
|
|
|
case ACTION_OK_REMAP_FILE_SAVE_CORE:
|
2016-01-26 00:47:35 +00:00
|
|
|
fill_pathname_join(file, core_name, core_name, sizeof(file));
|
2015-09-04 19:59:04 +00:00
|
|
|
break;
|
|
|
|
case ACTION_OK_REMAP_FILE_SAVE_GAME:
|
|
|
|
if (global)
|
2016-06-29 15:07:18 +00:00
|
|
|
{
|
|
|
|
const char *game_name = path_basename(global->name.base);
|
|
|
|
fill_pathname_join(file, core_name, game_name, sizeof(file));
|
|
|
|
}
|
2015-09-04 19:59:04 +00:00
|
|
|
break;
|
|
|
|
}
|
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))
|
2016-02-09 02:29:37 +00:00
|
|
|
runloop_msg_queue_push("Remap file saved successfully",
|
2016-01-25 17:18:00 +00:00
|
|
|
1, 100, true);
|
2015-04-08 03:40:42 +00:00
|
|
|
else
|
2016-02-09 02:29:37 +00:00
|
|
|
runloop_msg_queue_push("Error saving remap file",
|
2016-01-25 17:18:00 +00:00
|
|
|
1, 100, true);
|
2015-04-08 03:51:31 +00:00
|
|
|
|
2015-04-06 23:47:58 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-09-04 19:59:04 +00:00
|
|
|
static int action_ok_remap_file_save_core(const char *path,
|
2015-06-10 21:11:40 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-04-06 23:47:58 +00:00
|
|
|
{
|
2015-09-04 19:59:04 +00:00
|
|
|
return generic_action_ok_remap_file_save(path, label, type,
|
|
|
|
idx, entry_idx, ACTION_OK_REMAP_FILE_SAVE_CORE);
|
|
|
|
}
|
2015-04-08 03:51:31 +00:00
|
|
|
|
2015-09-04 19:59:04 +00:00
|
|
|
static int action_ok_remap_file_save_game(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_remap_file_save(path, label, type,
|
|
|
|
idx, entry_idx, ACTION_OK_REMAP_FILE_SAVE_GAME);
|
2015-04-06 23:47:58 +00:00
|
|
|
}
|
|
|
|
|
2015-08-05 07:41:02 +00:00
|
|
|
int action_ok_path_use_directory(const char *path,
|
2015-06-10 21:11:40 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2016-06-17 13:33:42 +00:00
|
|
|
return generic_action_ok(NULL, label, type, idx, entry_idx,
|
2016-06-19 22:31:13 +00:00
|
|
|
ACTION_OK_SET_DIRECTORY, MSG_UNKNOWN);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-11-24 00:12:50 +00:00
|
|
|
#ifdef HAVE_LIBRETRODB
|
2015-07-04 00:07:18 +00:00
|
|
|
static int action_ok_scan_file(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return action_scan_file(path, label, type, idx);
|
|
|
|
}
|
|
|
|
|
2015-07-03 23:51:41 +00:00
|
|
|
static int action_ok_path_scan_directory(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return action_scan_directory(NULL, label, type, idx);
|
|
|
|
}
|
2015-11-24 00:12:50 +00:00
|
|
|
#endif
|
2015-07-03 23:51:41 +00:00
|
|
|
|
2015-05-26 04:28:16 +00:00
|
|
|
static int action_ok_core_deferred_set(const char *path,
|
2015-06-10 21:11:40 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-05-26 04:28:16 +00:00
|
|
|
{
|
2015-09-25 17:26:31 +00:00
|
|
|
size_t selection;
|
2016-06-03 02:59:12 +00:00
|
|
|
char core_display_name[PATH_MAX_LENGTH] = {0};
|
|
|
|
const char *entry_path = NULL;
|
|
|
|
const char *entry_label = NULL;
|
|
|
|
const char *entry_crc32 = NULL;
|
|
|
|
const char *db_name = NULL;
|
|
|
|
playlist_t *playlist = NULL;
|
2015-12-11 11:46:08 +00:00
|
|
|
|
2015-09-25 17:26:31 +00:00
|
|
|
if (!menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection))
|
2016-02-10 20:42:18 +00:00
|
|
|
return menu_cbs_exit();
|
2015-05-26 04:28:16 +00:00
|
|
|
|
2015-12-11 11:46:08 +00:00
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &playlist);
|
|
|
|
|
|
|
|
retro_assert(playlist != NULL);
|
2015-05-26 06:38:38 +00:00
|
|
|
|
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;
|
|
|
|
|
2016-05-16 07:07:44 +00:00
|
|
|
playlist_get_index(playlist, idx,
|
2015-11-28 23:46:47 +00:00
|
|
|
&entry_path, &entry_label, NULL, NULL, &entry_crc32, &db_name);
|
|
|
|
|
2016-05-16 07:07:44 +00:00
|
|
|
playlist_update(playlist, idx,
|
2015-11-28 23:46:47 +00:00
|
|
|
entry_path, entry_label,
|
2015-05-26 04:28:16 +00:00
|
|
|
path , core_display_name,
|
2015-11-28 23:46:47 +00:00
|
|
|
entry_crc32,
|
|
|
|
db_name);
|
2015-05-26 04:28:16 +00:00
|
|
|
|
2016-05-16 07:07:44 +00:00
|
|
|
playlist_write_file(playlist);
|
2015-05-26 04:28:16 +00:00
|
|
|
|
2016-04-25 17:09:30 +00:00
|
|
|
menu_entries_pop_stack(&selection, 0, 1);
|
2015-09-25 17:26:31 +00:00
|
|
|
menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &selection);
|
2015-05-26 04:28:16 +00:00
|
|
|
|
2016-02-10 20:42:18 +00:00
|
|
|
return menu_cbs_exit();
|
2015-05-26 04:28:16 +00:00
|
|
|
}
|
|
|
|
|
2016-06-20 17:54:04 +00:00
|
|
|
|
|
|
|
static int action_ok_deferred_list_stub(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-15 16:07:00 +00:00
|
|
|
static int action_ok_load_core_deferred(const char *path,
|
2015-06-10 21:11:40 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2016-05-16 14:25:16 +00:00
|
|
|
menu_handle_t *menu = NULL;
|
2015-03-20 20:22:38 +00:00
|
|
|
|
2016-02-10 20:15:23 +00:00
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
2016-02-10 20:42:18 +00:00
|
|
|
return menu_cbs_exit();
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2016-06-30 16:29:27 +00:00
|
|
|
return generic_action_ok_file_load(path, menu->deferred_path,
|
|
|
|
CORE_TYPE_PLAIN, CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_MENU);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2016-06-20 17:54:04 +00:00
|
|
|
static int action_ok_start_net_retropad_core(const char *path,
|
2015-06-10 21:11:40 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2016-06-30 16:29:27 +00:00
|
|
|
return generic_action_ok_file_load(NULL, NULL,
|
|
|
|
CORE_TYPE_FFMPEG, CONTENT_MODE_LOAD_NOTHING_WITH_NET_RETROPAD_CORE_FROM_MENU);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2016-06-20 17:54:04 +00:00
|
|
|
#ifdef HAVE_FFMPEG
|
|
|
|
static int action_ok_file_load_ffmpeg(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-06-23 04:44:29 +00:00
|
|
|
{
|
2016-06-02 18:49:25 +00:00
|
|
|
char new_path[PATH_MAX_LENGTH] = {0};
|
|
|
|
const char *menu_path = NULL;
|
|
|
|
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
2015-10-19 04:47:45 +00:00
|
|
|
menu_entries_get_last(menu_stack, &menu_path, NULL, NULL, NULL);
|
2015-06-23 04:44:29 +00:00
|
|
|
|
2015-09-07 00:28:26 +00:00
|
|
|
fill_pathname_join(new_path, menu_path, path,
|
|
|
|
sizeof(new_path));
|
2016-06-30 16:29:27 +00:00
|
|
|
return generic_action_ok_file_load(NULL, new_path,
|
|
|
|
CORE_TYPE_FFMPEG, CONTENT_MODE_LOAD_CONTENT_WITH_FFMPEG_CORE_FROM_MENU);
|
2015-09-01 22:42:45 +00:00
|
|
|
}
|
2015-06-23 04:44:29 +00:00
|
|
|
#endif
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-06-28 15:21:32 +00:00
|
|
|
static int action_ok_file_load_imageviewer(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-06-20 17:54:04 +00:00
|
|
|
char fullpath[PATH_MAX_LENGTH] = {0};
|
|
|
|
const char *menu_path = NULL;
|
|
|
|
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
|
|
|
menu_entries_get_last(menu_stack, &menu_path, NULL, NULL, NULL);
|
|
|
|
|
|
|
|
fill_pathname_join(fullpath, menu_path, path,
|
|
|
|
sizeof(fullpath));
|
2016-06-30 16:29:27 +00:00
|
|
|
return generic_action_ok_file_load(NULL, fullpath,
|
|
|
|
CORE_TYPE_IMAGEVIEWER, CONTENT_MODE_LOAD_CONTENT_WITH_IMAGEVIEWER_CORE_FROM_MENU);
|
2015-06-28 15:21:32 +00:00
|
|
|
}
|
|
|
|
|
2016-06-20 17:54:04 +00:00
|
|
|
static int action_ok_file_load_detect_core(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-06-30 16:29:27 +00:00
|
|
|
return generic_action_ok_file_load(path, detect_content_path,
|
|
|
|
CORE_TYPE_FFMPEG, CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_MENU);
|
2016-06-20 17:54:04 +00:00
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_file_load(const char *path,
|
2015-06-10 21:11:40 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2016-06-02 18:49:25 +00:00
|
|
|
char menu_path_new[PATH_MAX_LENGTH] = {0};
|
|
|
|
char full_path_new[PATH_MAX_LENGTH] = {0};
|
|
|
|
const char *menu_label = NULL;
|
|
|
|
const char *menu_path = NULL;
|
|
|
|
rarch_setting_t *setting = NULL;
|
|
|
|
menu_handle_t *menu = NULL;
|
|
|
|
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2016-02-10 20:15:23 +00:00
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
2016-02-10 20:42:18 +00:00
|
|
|
return menu_cbs_exit();
|
2016-02-10 20:15:23 +00:00
|
|
|
|
2015-10-19 04:47:45 +00:00
|
|
|
menu_entries_get_last(menu_stack, &menu_path, &menu_label, NULL, NULL);
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-07-14 10:49:54 +00:00
|
|
|
strlcpy(menu_path_new, menu_path, sizeof(menu_path_new));
|
|
|
|
|
|
|
|
if (
|
2016-01-20 03:59:39 +00:00
|
|
|
string_is_equal(menu_label,
|
2016-06-19 22:31:13 +00:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN_DETECT_CORE)) ||
|
2016-01-20 03:59:39 +00:00
|
|
|
string_is_equal(menu_label,
|
2016-06-19 22:31:13 +00:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN))
|
2015-07-14 10:49:54 +00:00
|
|
|
)
|
|
|
|
{
|
|
|
|
fill_pathname_join(menu_path_new, menu->scratch2_buf, menu->scratch_buf,
|
|
|
|
sizeof(menu_path_new));
|
|
|
|
}
|
|
|
|
|
2015-02-26 15:50:30 +00:00
|
|
|
setting = menu_setting_find(menu_label);
|
|
|
|
|
2015-09-26 00:22:01 +00:00
|
|
|
if (menu_setting_get_type(setting) == ST_PATH)
|
2015-09-04 21:32:18 +00:00
|
|
|
return action_ok_set_path(path, label, type, idx, entry_idx);
|
2015-09-05 15:17:26 +00:00
|
|
|
|
2016-06-20 13:50:37 +00:00
|
|
|
if (type == FILE_TYPE_IN_CARCHIVE)
|
2015-09-07 00:28:26 +00:00
|
|
|
fill_pathname_join_delim(full_path_new, menu_path_new, path,
|
|
|
|
'#',sizeof(full_path_new));
|
2015-02-26 15:50:30 +00:00
|
|
|
else
|
2015-09-07 00:28:26 +00:00
|
|
|
fill_pathname_join(full_path_new, menu_path_new, path,
|
|
|
|
sizeof(full_path_new));
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2016-06-20 17:54:04 +00:00
|
|
|
return generic_action_ok_file_load(NULL, full_path_new,
|
2016-06-30 16:29:27 +00:00
|
|
|
CORE_TYPE_PLAIN, CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_MENU);
|
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
|
|
|
{
|
2016-05-09 18:20:50 +00:00
|
|
|
if (!command_event(cmd, NULL))
|
2016-02-10 20:42:18 +00:00
|
|
|
return menu_cbs_exit();
|
2015-02-26 15:50:30 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-05-17 16:18:17 +00:00
|
|
|
static int action_ok_load_state(const char *path,
|
2015-06-10 21:11:40 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2016-05-09 18:51:53 +00:00
|
|
|
if (generic_action_ok_command(CMD_EVENT_LOAD_STATE) == -1)
|
2016-02-10 20:42:18 +00:00
|
|
|
return menu_cbs_exit();
|
2016-05-09 18:51:53 +00:00
|
|
|
return generic_action_ok_command(CMD_EVENT_RESUME);
|
2016-06-03 04:33:52 +00:00
|
|
|
}
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2016-06-04 19:34:06 +00:00
|
|
|
static int action_ok_save_state(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
if (generic_action_ok_command(CMD_EVENT_SAVE_STATE) == -1)
|
|
|
|
return menu_cbs_exit();
|
|
|
|
return generic_action_ok_command(CMD_EVENT_RESUME);
|
|
|
|
}
|
|
|
|
|
2016-06-03 04:33:52 +00:00
|
|
|
static int action_ok_undo_load_state(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
if (generic_action_ok_command(CMD_EVENT_UNDO_LOAD_STATE) == -1)
|
|
|
|
return menu_cbs_exit();
|
|
|
|
return generic_action_ok_command(CMD_EVENT_RESUME);
|
|
|
|
}
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2016-06-04 19:34:06 +00:00
|
|
|
static int action_ok_undo_save_state(const char *path,
|
2015-06-10 21:11:40 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2016-06-04 19:34:06 +00:00
|
|
|
if (generic_action_ok_command(CMD_EVENT_UNDO_SAVE_STATE) == -1)
|
2016-02-10 20:42:18 +00:00
|
|
|
return menu_cbs_exit();
|
2016-05-09 18:51:53 +00:00
|
|
|
return generic_action_ok_command(CMD_EVENT_RESUME);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2016-02-03 14:50:51 +00:00
|
|
|
#ifdef HAVE_NETWORKING
|
2016-05-11 19:22:45 +00:00
|
|
|
#ifdef HAVE_ZLIB
|
2016-02-03 14:50:51 +00:00
|
|
|
static void cb_decompressed(void *task_data, void *user_data, const char *err)
|
|
|
|
{
|
|
|
|
decompress_task_data_t *dec = (decompress_task_data_t*)task_data;
|
|
|
|
|
|
|
|
if (dec && !err)
|
|
|
|
{
|
2016-06-29 15:07:18 +00:00
|
|
|
unsigned type_hash = (uintptr_t)user_data;
|
|
|
|
|
2016-04-23 20:31:39 +00:00
|
|
|
switch (type_hash)
|
|
|
|
{
|
|
|
|
case CB_CORE_UPDATER_DOWNLOAD:
|
2016-05-09 18:51:53 +00:00
|
|
|
command_event(CMD_EVENT_CORE_INFO_INIT, NULL);
|
2016-04-23 20:31:39 +00:00
|
|
|
break;
|
|
|
|
case CB_UPDATE_ASSETS:
|
2016-05-09 18:51:53 +00:00
|
|
|
command_event(CMD_EVENT_REINIT, NULL);
|
2016-04-23 20:31:39 +00:00
|
|
|
break;
|
|
|
|
}
|
2016-02-03 14:50:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (err)
|
|
|
|
RARCH_ERR("%s", err);
|
|
|
|
|
|
|
|
if (dec)
|
|
|
|
{
|
|
|
|
if (path_file_exists(dec->source_file))
|
|
|
|
remove(dec->source_file);
|
|
|
|
|
|
|
|
free(dec->source_file);
|
|
|
|
free(dec);
|
|
|
|
}
|
|
|
|
}
|
2016-05-11 19:22:45 +00:00
|
|
|
#endif
|
2016-02-03 14:50:51 +00:00
|
|
|
|
2016-06-21 02:09:13 +00:00
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
static int generic_action_ok_network(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx,
|
|
|
|
enum msg_hash_enums enum_idx)
|
|
|
|
{
|
|
|
|
char url_path[PATH_MAX_LENGTH] = {0};
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
unsigned type_id2 = 0;
|
|
|
|
const char *url_label = NULL;
|
|
|
|
retro_task_callback_t callback = NULL;
|
|
|
|
bool refresh = true;
|
|
|
|
|
|
|
|
menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh);
|
|
|
|
|
|
|
|
if (string_is_empty(settings->network.buildbot_url))
|
|
|
|
return menu_cbs_exit();
|
|
|
|
|
|
|
|
command_event(CMD_EVENT_NETWORK_INIT, NULL);
|
|
|
|
|
|
|
|
switch (enum_idx)
|
|
|
|
{
|
|
|
|
case MENU_ENUM_LABEL_CB_CORE_CONTENT_DIRS_LIST:
|
|
|
|
fill_pathname_join(url_path, settings->network.buildbot_assets_url,
|
|
|
|
"cores/.index-dirs", sizeof(url_path));
|
|
|
|
url_label = msg_hash_to_str(enum_idx);
|
|
|
|
type_id2 = ACTION_OK_DL_CORE_CONTENT_DIRS_LIST;
|
|
|
|
callback = cb_net_generic;
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_CORE_CONTENT_LIST:
|
2016-06-21 03:13:43 +00:00
|
|
|
fill_pathname_join(url_path, path,
|
|
|
|
file_path_str(FILE_PATH_INDEX_URL), sizeof(url_path));
|
2016-06-21 02:09:13 +00:00
|
|
|
url_label = msg_hash_to_str(enum_idx);
|
|
|
|
type_id2 = ACTION_OK_DL_CORE_CONTENT_LIST;
|
|
|
|
callback = cb_net_generic;
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_CORE_UPDATER_LIST:
|
|
|
|
fill_pathname_join(url_path, settings->network.buildbot_url,
|
|
|
|
file_path_str(FILE_PATH_INDEX_EXTENDED_URL), sizeof(url_path));
|
|
|
|
url_label = msg_hash_to_str(enum_idx);
|
|
|
|
type_id2 = ACTION_OK_DL_CORE_UPDATER_LIST;
|
|
|
|
callback = cb_net_generic;
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_THUMBNAILS_UPDATER_LIST:
|
|
|
|
fill_pathname_join(url_path,
|
|
|
|
file_path_str(FILE_PATH_CORE_THUMBNAILS_URL),
|
|
|
|
file_path_str(FILE_PATH_INDEX_URL), sizeof(url_path));
|
|
|
|
url_label = msg_hash_to_str(enum_idx);
|
|
|
|
type_id2 = ACTION_OK_DL_THUMBNAILS_UPDATER_LIST;
|
|
|
|
callback = cb_net_generic;
|
|
|
|
break;
|
|
|
|
#ifdef HAVE_LAKKA
|
|
|
|
case MENU_ENUM_LABEL_CB_LAKKA_LIST:
|
|
|
|
/* TODO unhardcode this path */
|
|
|
|
fill_pathname_join(url_path,
|
|
|
|
file_path_str(FILE_PATH_LAKKA_URL),
|
|
|
|
LAKKA_PROJECT, sizeof(url_path));
|
|
|
|
fill_pathname_join(url_path, url_path,
|
|
|
|
file_path_str(FILE_PATH_INDEX_URL),
|
|
|
|
sizeof(url_path));
|
|
|
|
url_label = msg_hash_to_str(enum_idx);
|
|
|
|
type_id2 = ACTION_OK_DL_LAKKA_LIST;
|
|
|
|
callback = cb_net_generic;
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
task_push_http_transfer(url_path, false, url_label, callback, NULL);
|
|
|
|
|
|
|
|
return generic_action_ok_displaylist_push(path,
|
|
|
|
label, type, idx, entry_idx, type_id2);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_core_content_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_network(path, label, type, idx, entry_idx,
|
|
|
|
MENU_ENUM_LABEL_CB_CORE_CONTENT_LIST);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_core_content_dirs_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_network(path, label, type, idx, entry_idx,
|
|
|
|
MENU_ENUM_LABEL_CB_CORE_CONTENT_DIRS_LIST);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_core_updater_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_network(path, label, type, idx, entry_idx,
|
|
|
|
MENU_ENUM_LABEL_CB_CORE_UPDATER_LIST);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_thumbnails_updater_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_network(path, label, type, idx, entry_idx,
|
|
|
|
MENU_ENUM_LABEL_CB_THUMBNAILS_UPDATER_LIST);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_lakka_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_network(path, label, type, idx, entry_idx,
|
|
|
|
MENU_ENUM_LABEL_CB_LAKKA_LIST);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void cb_generic_dir_download(void *task_data,
|
|
|
|
void *user_data, const char *err)
|
|
|
|
{
|
|
|
|
menu_file_transfer_t *transf = (menu_file_transfer_t*)user_data;
|
|
|
|
|
|
|
|
generic_action_ok_network(transf->path, transf->path, 0, 0, 0,
|
|
|
|
MENU_ENUM_LABEL_CB_CORE_CONTENT_LIST);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-02-03 14:50:51 +00:00
|
|
|
/* expects http_transfer_t*, menu_file_transfer_t* */
|
|
|
|
static void cb_generic_download(void *task_data,
|
|
|
|
void *user_data, const char *err)
|
|
|
|
{
|
2016-06-01 01:23:38 +00:00
|
|
|
char output_path[PATH_MAX_LENGTH] = {0};
|
2016-02-03 14:50:51 +00:00
|
|
|
const char *file_ext = NULL;
|
|
|
|
const char *dir_path = NULL;
|
|
|
|
menu_file_transfer_t *transf = (menu_file_transfer_t*)user_data;
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
http_transfer_data_t *data = (http_transfer_data_t*)task_data;
|
|
|
|
|
|
|
|
if (!data || !data->data | !transf)
|
|
|
|
goto finish;
|
|
|
|
|
|
|
|
/* we have to determine dir_path at the time of writting or else
|
|
|
|
* we'd run into races when the user changes the setting during an
|
|
|
|
* http transfer. */
|
2016-06-18 16:29:55 +00:00
|
|
|
switch (transf->enum_idx)
|
2016-02-03 14:50:51 +00:00
|
|
|
{
|
2016-06-18 16:29:55 +00:00
|
|
|
case MENU_ENUM_LABEL_CB_CORE_THUMBNAILS_DOWNLOAD:
|
2016-04-28 17:26:02 +00:00
|
|
|
dir_path = settings->directory.thumbnails;
|
2016-04-23 20:31:39 +00:00
|
|
|
break;
|
2016-06-18 16:29:55 +00:00
|
|
|
case MENU_ENUM_LABEL_CB_CORE_UPDATER_DOWNLOAD:
|
2016-04-28 17:26:02 +00:00
|
|
|
dir_path = settings->directory.libretro;
|
2016-02-03 14:50:51 +00:00
|
|
|
break;
|
2016-06-18 16:29:55 +00:00
|
|
|
case MENU_ENUM_LABEL_CB_CORE_CONTENT_DOWNLOAD:
|
2016-04-28 17:26:02 +00:00
|
|
|
dir_path = settings->directory.core_assets;
|
2016-02-03 14:50:51 +00:00
|
|
|
break;
|
2016-06-18 16:29:55 +00:00
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_CORE_INFO_FILES:
|
2016-04-28 17:52:25 +00:00
|
|
|
dir_path = settings->path.libretro_info;
|
2016-02-03 14:50:51 +00:00
|
|
|
break;
|
2016-06-18 16:29:55 +00:00
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_ASSETS:
|
2016-04-28 17:26:02 +00:00
|
|
|
dir_path = settings->directory.assets;
|
2016-02-03 14:50:51 +00:00
|
|
|
break;
|
2016-06-18 16:29:55 +00:00
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_AUTOCONFIG_PROFILES:
|
2016-04-28 18:49:13 +00:00
|
|
|
dir_path = settings->directory.autoconfig;
|
2016-02-03 14:50:51 +00:00
|
|
|
break;
|
2016-06-18 16:29:55 +00:00
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_DATABASES:
|
2016-04-28 18:49:13 +00:00
|
|
|
dir_path = settings->path.content_database;
|
2016-02-03 14:50:51 +00:00
|
|
|
break;
|
2016-06-18 16:29:55 +00:00
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_OVERLAYS:
|
2016-04-28 17:26:02 +00:00
|
|
|
dir_path = settings->directory.overlay;
|
2016-02-03 14:50:51 +00:00
|
|
|
break;
|
2016-06-18 16:29:55 +00:00
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_CHEATS:
|
2016-04-28 18:49:13 +00:00
|
|
|
dir_path = settings->path.cheat_database;
|
2016-02-03 14:50:51 +00:00
|
|
|
break;
|
2016-06-18 16:29:55 +00:00
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_SHADERS_CG:
|
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_SHADERS_GLSL:
|
2016-02-03 14:50:51 +00:00
|
|
|
{
|
2016-06-30 14:10:50 +00:00
|
|
|
static char shaderdir[PATH_MAX_LENGTH] = {0};
|
2016-06-18 16:29:55 +00:00
|
|
|
const char *dirname = transf->enum_idx == MENU_ENUM_LABEL_CB_UPDATE_SHADERS_CG ?
|
2016-02-03 14:50:51 +00:00
|
|
|
"shaders_cg" : "shaders_glsl";
|
|
|
|
|
2016-04-28 18:49:13 +00:00
|
|
|
fill_pathname_join(shaderdir,
|
|
|
|
settings->directory.video_shader,
|
|
|
|
dirname,
|
2016-02-03 14:50:51 +00:00
|
|
|
sizeof(shaderdir));
|
|
|
|
if (!path_file_exists(shaderdir))
|
|
|
|
if (!path_mkdir(shaderdir))
|
|
|
|
goto finish;
|
|
|
|
|
|
|
|
dir_path = shaderdir;
|
|
|
|
break;
|
|
|
|
}
|
2016-06-18 16:29:55 +00:00
|
|
|
case MENU_ENUM_LABEL_CB_LAKKA_DOWNLOAD:
|
2016-03-23 14:40:41 +00:00
|
|
|
dir_path = LAKKA_UPDATE_DIR;
|
2016-02-03 14:50:51 +00:00
|
|
|
break;
|
|
|
|
default:
|
2016-06-18 16:29:55 +00:00
|
|
|
RARCH_WARN("Unknown transfer type '%s' bailing out.\n",
|
2016-06-19 22:31:13 +00:00
|
|
|
msg_hash_to_str(transf->enum_idx));
|
2016-02-03 14:50:51 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2016-06-29 10:13:40 +00:00
|
|
|
if (!string_is_empty(dir_path))
|
|
|
|
fill_pathname_join(output_path, dir_path,
|
|
|
|
transf->path, sizeof(output_path));
|
2016-02-03 14:50:51 +00:00
|
|
|
|
|
|
|
/* Make sure the directory exists */
|
|
|
|
path_basedir(output_path);
|
2016-06-29 10:13:40 +00:00
|
|
|
|
2016-02-03 14:50:51 +00:00
|
|
|
if (!path_mkdir(output_path))
|
|
|
|
{
|
|
|
|
err = "Failed to create the directory.";
|
|
|
|
goto finish;
|
|
|
|
}
|
|
|
|
|
2016-06-05 17:04:59 +00:00
|
|
|
if (!string_is_empty(dir_path))
|
|
|
|
fill_pathname_join(output_path, dir_path,
|
|
|
|
transf->path, sizeof(output_path));
|
2016-02-03 14:50:51 +00:00
|
|
|
|
2016-05-04 23:45:56 +00:00
|
|
|
#ifdef HAVE_ZLIB
|
|
|
|
file_ext = path_get_extension(output_path);
|
|
|
|
|
|
|
|
if (string_is_equal_noncase(file_ext, "zip"))
|
|
|
|
{
|
2016-05-27 16:14:47 +00:00
|
|
|
if (task_check_decompress(output_path))
|
2016-05-04 23:45:56 +00:00
|
|
|
{
|
|
|
|
err = "Decompression already in progress.";
|
|
|
|
goto finish;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-03-24 03:09:25 +00:00
|
|
|
if (!filestream_write_file(output_path, data->data, data->len))
|
2016-02-03 14:50:51 +00:00
|
|
|
{
|
|
|
|
err = "Write failed.";
|
|
|
|
goto finish;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef HAVE_ZLIB
|
|
|
|
if (!settings->network.buildbot_auto_extract_archive)
|
|
|
|
goto finish;
|
|
|
|
|
|
|
|
if (string_is_equal_noncase(file_ext, "zip"))
|
|
|
|
{
|
2016-05-27 16:14:47 +00:00
|
|
|
if (!task_push_decompress(output_path, dir_path, NULL, NULL, NULL,
|
2016-06-19 22:37:38 +00:00
|
|
|
cb_decompressed, (void*)(uintptr_t)msg_hash_calculate(msg_hash_to_str(transf->enum_idx))))
|
2016-05-04 05:21:48 +00:00
|
|
|
{
|
|
|
|
err = "Decompression failed.";
|
|
|
|
goto finish;
|
|
|
|
}
|
2016-02-03 14:50:51 +00:00
|
|
|
}
|
|
|
|
#else
|
2016-06-18 16:29:55 +00:00
|
|
|
switch (transf->enum_idx)
|
2016-04-23 20:31:39 +00:00
|
|
|
{
|
2016-06-18 16:29:55 +00:00
|
|
|
case MENU_ENUM_LABEL_CB_CORE_UPDATER_DOWNLOAD:
|
2016-05-09 18:51:53 +00:00
|
|
|
command_event(CMD_EVENT_CORE_INFO_INIT, NULL);
|
2016-04-23 20:31:39 +00:00
|
|
|
break;
|
2016-06-18 16:29:55 +00:00
|
|
|
default:
|
|
|
|
break;
|
2016-04-23 20:31:39 +00:00
|
|
|
}
|
2016-02-03 14:50:51 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
finish:
|
|
|
|
if (err)
|
|
|
|
{
|
|
|
|
RARCH_ERR("Download of '%s' failed: %s\n",
|
|
|
|
(transf ? transf->path: "unknown"), err);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (data)
|
|
|
|
{
|
|
|
|
if (data->data)
|
|
|
|
free(data->data);
|
|
|
|
free(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (transf)
|
|
|
|
free(transf);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-06-21 00:24:10 +00:00
|
|
|
|
2015-06-24 13:56:49 +00:00
|
|
|
static int action_ok_download_generic(const char *path,
|
2016-06-21 03:21:19 +00:00
|
|
|
const char *label, const char *menu_label,
|
|
|
|
unsigned type, size_t idx, size_t entry_idx,
|
2016-06-19 22:31:13 +00:00
|
|
|
enum msg_hash_enums enum_idx)
|
2015-06-24 13:56:49 +00:00
|
|
|
{
|
2015-09-03 21:50:18 +00:00
|
|
|
#ifdef HAVE_NETWORKING
|
2016-06-02 18:49:25 +00:00
|
|
|
char s[PATH_MAX_LENGTH] = {0};
|
|
|
|
char s3[PATH_MAX_LENGTH] = {0};
|
2016-01-25 17:19:19 +00:00
|
|
|
menu_file_transfer_t *transf = NULL;
|
|
|
|
settings_t *settings = config_get_ptr();
|
2016-06-21 02:09:13 +00:00
|
|
|
retro_task_callback_t cb = cb_generic_download;
|
2015-03-14 15:12:20 +00:00
|
|
|
|
2015-06-24 15:34:07 +00:00
|
|
|
fill_pathname_join(s, settings->network.buildbot_assets_url,
|
|
|
|
"frontend", sizeof(s));
|
2016-06-18 16:23:09 +00:00
|
|
|
|
|
|
|
switch (enum_idx)
|
|
|
|
{
|
2016-06-20 23:40:55 +00:00
|
|
|
case MENU_ENUM_LABEL_CB_DOWNLOAD_URL:
|
|
|
|
fill_pathname_join(s, label,
|
|
|
|
path, sizeof(s));
|
2016-06-27 19:15:26 +00:00
|
|
|
path = s;
|
2016-06-21 02:09:13 +00:00
|
|
|
cb = cb_generic_dir_download;
|
|
|
|
break;
|
2016-06-18 16:23:09 +00:00
|
|
|
case MENU_ENUM_LABEL_CB_CORE_CONTENT_DOWNLOAD:
|
2016-06-21 03:21:19 +00:00
|
|
|
strlcpy(s, menu_label, sizeof(s));
|
2016-06-18 16:23:09 +00:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_LAKKA_DOWNLOAD:
|
2015-12-24 19:13:50 +00:00
|
|
|
#ifdef HAVE_LAKKA
|
2016-06-18 16:23:09 +00:00
|
|
|
/* TODO unhardcode this path*/
|
2016-06-20 19:03:54 +00:00
|
|
|
fill_pathname_join(s, file_path_str(FILE_PATH_LAKKA_URL),
|
2016-06-18 16:23:09 +00:00
|
|
|
LAKKA_PROJECT, sizeof(s));
|
2015-12-24 19:13:50 +00:00
|
|
|
#endif
|
2016-06-18 16:23:09 +00:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_ASSETS:
|
2016-06-20 19:03:54 +00:00
|
|
|
path = file_path_str(FILE_PATH_ASSETS_ZIP);
|
2016-06-18 16:23:09 +00:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_AUTOCONFIG_PROFILES:
|
2016-06-20 19:03:54 +00:00
|
|
|
path = file_path_str(FILE_PATH_AUTOCONFIG_ZIP);
|
2016-06-18 16:23:09 +00:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_CORE_INFO_FILES:
|
2016-06-20 19:03:54 +00:00
|
|
|
path = file_path_str(FILE_PATH_CORE_INFO_ZIP);
|
2016-06-18 16:23:09 +00:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_CHEATS:
|
2016-06-20 19:03:54 +00:00
|
|
|
path = file_path_str(FILE_PATH_CHEATS_ZIP);
|
2016-06-18 16:23:09 +00:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_OVERLAYS:
|
2016-06-20 19:03:54 +00:00
|
|
|
path = file_path_str(FILE_PATH_OVERLAYS_ZIP);
|
2016-06-18 16:23:09 +00:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_DATABASES:
|
2016-06-20 19:03:54 +00:00
|
|
|
path = file_path_str(FILE_PATH_DATABASE_RDB_ZIP);
|
2016-06-18 16:23:09 +00:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_SHADERS_GLSL:
|
2016-06-20 19:03:54 +00:00
|
|
|
path = file_path_str(FILE_PATH_SHADERS_GLSL_ZIP);
|
2016-06-18 16:23:09 +00:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_UPDATE_SHADERS_CG:
|
2016-06-20 19:03:54 +00:00
|
|
|
path = file_path_str(FILE_PATH_SHADERS_CG_ZIP);
|
2016-06-18 16:23:09 +00:00
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CB_CORE_THUMBNAILS_DOWNLOAD:
|
2016-06-20 19:03:54 +00:00
|
|
|
strlcpy(s, file_path_str(FILE_PATH_CORE_THUMBNAILS_URL), sizeof(s));
|
2016-06-18 16:23:09 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
strlcpy(s, settings->network.buildbot_url, sizeof(s));
|
|
|
|
break;
|
|
|
|
}
|
2015-06-24 15:34:07 +00:00
|
|
|
|
2015-10-28 16:02:38 +00:00
|
|
|
fill_pathname_join(s3, s, path, sizeof(s3));
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2016-06-18 16:29:55 +00:00
|
|
|
transf = (menu_file_transfer_t*)calloc(1, sizeof(*transf));
|
|
|
|
transf->enum_idx = enum_idx;
|
2015-11-23 14:13:26 +00:00
|
|
|
strlcpy(transf->path, path, sizeof(transf->path));
|
2015-06-24 14:17:29 +00:00
|
|
|
|
2016-06-21 02:09:13 +00:00
|
|
|
task_push_http_transfer(s3, false, msg_hash_to_str(enum_idx), cb, transf);
|
2015-09-03 21:50:18 +00:00
|
|
|
#endif
|
2015-06-24 13:56:49 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2015-02-26 15:50:30 +00:00
|
|
|
|
2015-07-04 02:01:35 +00:00
|
|
|
static int action_ok_core_content_download(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-06-21 03:21:19 +00:00
|
|
|
const char *menu_path = NULL;
|
|
|
|
const char *menu_label = NULL;
|
|
|
|
enum msg_hash_enums enum_idx = MSG_UNKNOWN;
|
|
|
|
|
|
|
|
menu_entries_get_last_stack(&menu_path, &menu_label, NULL, &enum_idx, NULL);
|
|
|
|
|
|
|
|
return action_ok_download_generic(path, label, menu_path, type, idx, entry_idx,
|
2016-06-18 16:23:09 +00:00
|
|
|
MENU_ENUM_LABEL_CB_CORE_CONTENT_DOWNLOAD);
|
2015-07-04 02:01:35 +00:00
|
|
|
}
|
|
|
|
|
2016-04-23 20:31:39 +00:00
|
|
|
static int action_ok_core_content_thumbnails(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-06-21 03:21:19 +00:00
|
|
|
return action_ok_download_generic(path, label, NULL, type, idx, entry_idx,
|
2016-06-18 16:23:09 +00:00
|
|
|
MENU_ENUM_LABEL_CB_CORE_THUMBNAILS_DOWNLOAD);
|
2016-04-23 20:31:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_thumbnails_updater_download(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-06-21 03:21:19 +00:00
|
|
|
return action_ok_download_generic(path, label, NULL, type, idx, entry_idx,
|
2016-06-18 16:23:09 +00:00
|
|
|
MENU_ENUM_LABEL_CB_THUMBNAILS_UPDATER_DOWNLOAD);
|
2016-04-23 20:31:39 +00:00
|
|
|
}
|
|
|
|
|
2016-06-20 23:40:55 +00:00
|
|
|
static int action_ok_download_url(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-06-21 03:21:19 +00:00
|
|
|
return action_ok_download_generic(path, label, NULL, type, idx, entry_idx,
|
2016-06-20 23:40:55 +00:00
|
|
|
MENU_ENUM_LABEL_CB_DOWNLOAD_URL);
|
|
|
|
}
|
|
|
|
|
2015-06-24 13:56:49 +00:00
|
|
|
static int action_ok_core_updater_download(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-06-21 03:21:19 +00:00
|
|
|
return action_ok_download_generic(path, label, NULL, type, idx, entry_idx,
|
2016-06-18 16:23:09 +00:00
|
|
|
MENU_ENUM_LABEL_CB_CORE_UPDATER_DOWNLOAD);
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-12-24 19:13:50 +00:00
|
|
|
static int action_ok_lakka_download(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-06-21 03:21:19 +00:00
|
|
|
return action_ok_download_generic(path, label, NULL, type, idx, entry_idx,
|
2016-06-18 16:23:09 +00:00
|
|
|
MENU_ENUM_LABEL_CB_LAKKA_DOWNLOAD);
|
2015-12-24 19:13:50 +00:00
|
|
|
}
|
|
|
|
|
2015-06-24 14:17:29 +00:00
|
|
|
static int action_ok_update_assets(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-06-21 03:21:19 +00:00
|
|
|
return action_ok_download_generic(path, label, NULL, type, idx, entry_idx,
|
2016-06-18 16:23:09 +00:00
|
|
|
MENU_ENUM_LABEL_CB_UPDATE_ASSETS);
|
2015-06-24 14:17:29 +00:00
|
|
|
}
|
|
|
|
|
2015-07-04 04:18:02 +00:00
|
|
|
static int action_ok_update_core_info_files(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-06-21 03:21:19 +00:00
|
|
|
return action_ok_download_generic(path, label, NULL, type, idx, entry_idx,
|
2016-06-18 16:23:09 +00:00
|
|
|
MENU_ENUM_LABEL_CB_UPDATE_CORE_INFO_FILES);
|
2015-07-04 04:18:02 +00:00
|
|
|
}
|
|
|
|
|
2015-06-24 15:37:15 +00:00
|
|
|
static int action_ok_update_overlays(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-06-21 03:21:19 +00:00
|
|
|
return action_ok_download_generic(path, label, NULL, type, idx, entry_idx,
|
2016-06-18 16:23:09 +00:00
|
|
|
MENU_ENUM_LABEL_CB_UPDATE_OVERLAYS);
|
2015-06-24 15:37:15 +00:00
|
|
|
}
|
|
|
|
|
2015-06-24 15:56:44 +00:00
|
|
|
static int action_ok_update_shaders_cg(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-06-21 03:21:19 +00:00
|
|
|
return action_ok_download_generic(path, label, NULL, type, idx, entry_idx,
|
2016-06-18 16:23:09 +00:00
|
|
|
MENU_ENUM_LABEL_CB_UPDATE_SHADERS_CG);
|
2015-06-24 15:56:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_update_shaders_glsl(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-06-21 03:21:19 +00:00
|
|
|
return action_ok_download_generic(path, label, NULL, type, idx, entry_idx,
|
2016-06-18 16:23:09 +00:00
|
|
|
MENU_ENUM_LABEL_CB_UPDATE_SHADERS_GLSL);
|
2015-06-24 15:56:44 +00:00
|
|
|
}
|
|
|
|
|
2015-06-24 15:42:31 +00:00
|
|
|
static int action_ok_update_databases(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-06-21 03:21:19 +00:00
|
|
|
return action_ok_download_generic(path, label, NULL, type, idx, entry_idx,
|
2016-06-18 16:23:09 +00:00
|
|
|
MENU_ENUM_LABEL_CB_UPDATE_DATABASES);
|
2015-06-24 15:42:31 +00:00
|
|
|
}
|
|
|
|
|
2015-06-24 14:55:18 +00:00
|
|
|
static int action_ok_update_cheats(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-06-21 03:21:19 +00:00
|
|
|
return action_ok_download_generic(path, label, NULL, type, idx, entry_idx,
|
2016-06-18 16:23:09 +00:00
|
|
|
MENU_ENUM_LABEL_CB_UPDATE_CHEATS);
|
2015-06-24 14:55:18 +00:00
|
|
|
}
|
|
|
|
|
2015-09-04 11:08:15 +00:00
|
|
|
static int action_ok_update_autoconfig_profiles(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-06-21 03:21:19 +00:00
|
|
|
return action_ok_download_generic(path, label, NULL, type, idx, entry_idx,
|
2016-06-18 16:23:09 +00:00
|
|
|
MENU_ENUM_LABEL_CB_UPDATE_AUTOCONFIG_PROFILES);
|
2015-09-04 11:08:15 +00:00
|
|
|
}
|
2015-09-03 21:38:07 +00:00
|
|
|
|
2015-09-04 11:08:15 +00:00
|
|
|
static int action_ok_disk_cycle_tray_status(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-05-09 18:51:53 +00:00
|
|
|
return generic_action_ok_command(CMD_EVENT_DISK_EJECT_TOGGLE);
|
2015-09-04 11:08:15 +00:00
|
|
|
}
|
2015-09-03 22:03:31 +00:00
|
|
|
|
2016-01-26 01:21:03 +00:00
|
|
|
/* creates folder and core options stub file for subsequent runs */
|
|
|
|
static int action_ok_option_create(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-06-03 02:59:12 +00:00
|
|
|
char game_path[PATH_MAX_LENGTH] = {0};
|
|
|
|
config_file_t *conf = NULL;
|
2016-01-26 01:21:03 +00:00
|
|
|
|
2016-05-09 05:09:26 +00:00
|
|
|
if (!retroarch_validate_game_options(game_path, sizeof(game_path), true))
|
2016-01-26 01:21:03 +00:00
|
|
|
{
|
2016-02-09 02:29:37 +00:00
|
|
|
runloop_msg_queue_push("Error saving core options file",
|
2016-01-25 17:14:14 +00:00
|
|
|
1, 100, true);
|
2016-01-26 01:21:03 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-01-31 06:54:12 +00:00
|
|
|
conf = config_file_new(game_path);
|
|
|
|
|
|
|
|
if (!conf)
|
|
|
|
{
|
|
|
|
conf = config_file_new(NULL);
|
|
|
|
if (!conf)
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(config_file_write(conf, game_path))
|
|
|
|
{
|
2016-03-02 04:29:12 +00:00
|
|
|
global_t *global = global_get_ptr();
|
|
|
|
|
2016-02-09 02:29:37 +00:00
|
|
|
runloop_msg_queue_push("Core options file created successfully",
|
2016-01-26 01:21:03 +00:00
|
|
|
1, 100, true);
|
2016-03-02 04:29:12 +00:00
|
|
|
|
|
|
|
strlcpy(global->path.core_options_path,
|
|
|
|
game_path, sizeof(global->path.core_options_path));
|
2016-01-31 06:54:12 +00:00
|
|
|
}
|
2016-01-31 07:16:55 +00:00
|
|
|
config_file_free(conf);
|
2016-01-26 01:21:03 +00:00
|
|
|
|
2015-11-16 03:09:39 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-09-04 11:08:15 +00:00
|
|
|
static int action_ok_close_content(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-05-09 18:51:53 +00:00
|
|
|
return generic_action_ok_command(CMD_EVENT_UNLOAD_CORE);
|
2015-09-04 11:08:15 +00:00
|
|
|
}
|
2015-09-03 22:21:07 +00:00
|
|
|
|
2015-09-04 11:08:15 +00:00
|
|
|
static int action_ok_quit(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-05-09 18:51:53 +00:00
|
|
|
return generic_action_ok_command(CMD_EVENT_QUIT);
|
2015-09-04 11:08:15 +00:00
|
|
|
}
|
2015-09-03 22:15:56 +00:00
|
|
|
|
2015-09-04 11:08:15 +00:00
|
|
|
static int action_ok_save_new_config(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-05-09 18:51:53 +00:00
|
|
|
return generic_action_ok_command(CMD_EVENT_MENU_SAVE_CONFIG);
|
2015-09-04 11:08:15 +00:00
|
|
|
}
|
2015-09-03 22:15:56 +00:00
|
|
|
|
2015-09-04 11:08:15 +00:00
|
|
|
static int action_ok_resume_content(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-05-09 18:51:53 +00:00
|
|
|
return generic_action_ok_command(CMD_EVENT_RESUME);
|
2015-09-04 11:08:15 +00:00
|
|
|
}
|
2015-09-03 22:27:55 +00:00
|
|
|
|
2015-09-04 11:08:15 +00:00
|
|
|
static int action_ok_restart_content(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-05-09 18:51:53 +00:00
|
|
|
return generic_action_ok_command(CMD_EVENT_RESET);
|
2015-09-04 11:08:15 +00:00
|
|
|
}
|
2015-09-03 22:27:55 +00:00
|
|
|
|
2015-09-04 11:08:15 +00:00
|
|
|
static int action_ok_screenshot(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-05-09 18:51:53 +00:00
|
|
|
return generic_action_ok_command(CMD_EVENT_TAKE_SCREENSHOT);
|
2015-09-04 11:08:15 +00:00
|
|
|
}
|
2015-09-03 22:27:55 +00:00
|
|
|
|
2015-09-04 11:08:15 +00:00
|
|
|
static int action_ok_shader_apply_changes(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-05-09 18:51:53 +00:00
|
|
|
return generic_action_ok_command(CMD_EVENT_SHADERS_APPLY_CHANGES);
|
2015-09-04 11:08:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_lookup_setting(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return menu_setting_set(type, label, MENU_ACTION_OK, false);
|
2015-09-03 20:17:47 +00:00
|
|
|
}
|
|
|
|
|
2015-09-03 22:44:09 +00:00
|
|
|
static int action_ok_rdb_entry_submenu(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
union string_list_elem_attr attr;
|
2016-06-03 02:59:12 +00:00
|
|
|
int ret = -1;
|
|
|
|
char new_label[PATH_MAX_LENGTH] = {0};
|
|
|
|
char new_path[PATH_MAX_LENGTH] = {0};
|
2015-09-03 22:44:09 +00:00
|
|
|
char *rdb = NULL;
|
|
|
|
int len = 0;
|
|
|
|
struct string_list *str_list = NULL;
|
|
|
|
struct string_list *str_list2 = NULL;
|
|
|
|
|
2015-10-17 15:56:19 +00:00
|
|
|
if (!label)
|
2016-02-10 20:42:18 +00:00
|
|
|
return menu_cbs_exit();
|
2015-09-03 22:44:09 +00:00
|
|
|
|
|
|
|
str_list = string_split(label, "|");
|
|
|
|
|
|
|
|
if (!str_list)
|
|
|
|
goto end;
|
|
|
|
|
|
|
|
str_list2 = string_list_new();
|
|
|
|
if (!str_list2)
|
|
|
|
goto end;
|
|
|
|
|
|
|
|
/* element 0 : label
|
|
|
|
* element 1 : value
|
|
|
|
* element 2 : database path
|
|
|
|
*/
|
|
|
|
|
|
|
|
attr.i = 0;
|
|
|
|
|
|
|
|
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)
|
|
|
|
goto end;
|
|
|
|
|
|
|
|
string_list_join_concat(rdb, len, str_list2, "|");
|
|
|
|
strlcpy(new_path, rdb, sizeof(new_path));
|
|
|
|
|
|
|
|
fill_pathname_join_delim(new_label,
|
2016-06-19 22:31:13 +00:00
|
|
|
msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_CURSOR_MANAGER_LIST),
|
2015-09-03 22:44:09 +00:00
|
|
|
str_list->elems[0].data, '_',
|
|
|
|
sizeof(new_label));
|
|
|
|
|
|
|
|
ret = generic_action_ok_displaylist_push(new_path,
|
|
|
|
new_label, type, idx, entry_idx,
|
|
|
|
ACTION_OK_DL_RDB_ENTRY_SUBMENU);
|
|
|
|
|
|
|
|
end:
|
2016-02-10 19:01:38 +00:00
|
|
|
if (rdb)
|
|
|
|
free(rdb);
|
2015-09-03 22:44:09 +00:00
|
|
|
if (str_list)
|
|
|
|
string_list_free(str_list);
|
|
|
|
if (str_list2)
|
|
|
|
string_list_free(str_list2);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2015-09-03 20:56:30 +00:00
|
|
|
#ifdef HAVE_SHADER_MANAGER
|
|
|
|
extern size_t hack_shader_pass;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static int action_ok_shader_pass(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
hack_shader_pass = type - MENU_SETTINGS_SHADER_PASS_0;
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_SHADER_PASS);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_shader_parameters(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_SHADER_PARAMETERS);
|
|
|
|
}
|
|
|
|
|
2015-10-25 07:31:55 +00:00
|
|
|
int action_ok_parent_directory_push(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_PARENT_DIRECTORY_PUSH);
|
|
|
|
}
|
|
|
|
|
2015-09-03 22:15:56 +00:00
|
|
|
int action_ok_directory_push(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_DIRECTORY_PUSH);
|
|
|
|
}
|
|
|
|
|
2015-09-03 22:27:55 +00:00
|
|
|
static int action_ok_database_manager_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_DATABASE_MANAGER_LIST);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_cursor_manager_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_CURSOR_MANAGER_LIST);
|
|
|
|
}
|
|
|
|
|
2015-09-03 22:03:31 +00:00
|
|
|
static int action_ok_compressed_archive_push(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_COMPRESSED_ARCHIVE_PUSH);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_compressed_archive_push_detect_core(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_COMPRESSED_ARCHIVE_PUSH_DETECT_CORE);
|
|
|
|
}
|
|
|
|
|
2015-09-03 21:45:02 +00:00
|
|
|
static int action_ok_configurations_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_CONFIGURATIONS_LIST);
|
|
|
|
}
|
|
|
|
|
2015-09-03 21:38:07 +00:00
|
|
|
static int action_ok_rdb_entry(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_RDB_ENTRY);
|
|
|
|
}
|
|
|
|
|
2015-09-03 21:35:21 +00:00
|
|
|
static int action_ok_content_collection_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_CONTENT_COLLECTION_LIST);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_core_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_CORE_LIST);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_cheat_file(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_CHEAT_FILE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_playlist_collection(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_PLAYLIST_COLLECTION);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_disk_image_append_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_DISK_IMAGE_APPEND_LIST);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_record_configfile(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_RECORD_CONFIGFILE);
|
|
|
|
}
|
|
|
|
|
2015-09-03 21:22:16 +00:00
|
|
|
static int action_ok_remap_file(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_REMAP_FILE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_push_content_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_CONTENT_LIST);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_push_downloads_dir(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_DOWNLOADS_DIR);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_shader_preset(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_SHADER_PRESET);
|
|
|
|
}
|
|
|
|
|
2015-09-03 21:14:50 +00:00
|
|
|
int action_ok_push_generic_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_GENERIC);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_push_default(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
|
|
|
entry_idx, ACTION_OK_DL_PUSH_DEFAULT);
|
|
|
|
}
|
|
|
|
|
2015-09-03 20:52:19 +00:00
|
|
|
static int action_ok_audio_dsp_plugin(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
2015-09-03 20:56:30 +00:00
|
|
|
entry_idx, ACTION_OK_DL_AUDIO_DSP_PLUGIN);
|
2015-09-03 20:52:19 +00:00
|
|
|
}
|
|
|
|
|
2015-09-03 20:20:43 +00:00
|
|
|
static int action_ok_rpl_entry(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, type, idx,
|
2015-09-03 20:56:30 +00:00
|
|
|
entry_idx, ACTION_OK_DL_RPL_ENTRY);
|
2015-09-03 20:20:43 +00:00
|
|
|
}
|
|
|
|
|
2016-01-24 00:51:05 +00:00
|
|
|
static int action_ok_start_core(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-01-25 05:10:37 +00:00
|
|
|
/* No content needed for this core, load core immediately. */
|
|
|
|
if (menu_driver_ctl(RARCH_MENU_CTL_HAS_LOAD_NO_CONTENT, NULL))
|
2016-06-30 16:29:27 +00:00
|
|
|
return generic_action_ok_file_load(NULL, NULL,
|
|
|
|
CORE_TYPE_PLAIN,
|
2016-06-20 17:55:59 +00:00
|
|
|
CONTENT_MODE_LOAD_NOTHING_WITH_CURRENT_CORE_FROM_MENU);
|
2016-01-25 05:10:37 +00:00
|
|
|
|
2016-01-24 00:51:05 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2015-07-14 10:49:54 +00:00
|
|
|
|
2016-05-27 17:18:46 +00:00
|
|
|
|
2015-09-03 19:53:01 +00:00
|
|
|
static int action_ok_open_archive_detect_core(const char *path,
|
2015-07-14 10:49:54 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2015-09-03 19:53:01 +00:00
|
|
|
return generic_action_ok_displaylist_push(path, label, 0, 0, entry_idx,
|
|
|
|
ACTION_OK_DL_OPEN_ARCHIVE_DETECT_CORE);
|
|
|
|
}
|
2015-07-14 10:49:54 +00:00
|
|
|
|
2015-10-17 13:28:16 +00:00
|
|
|
static int action_ok_push_accounts_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, 0, 0, entry_idx,
|
|
|
|
ACTION_OK_DL_ACCOUNTS_LIST);
|
|
|
|
}
|
|
|
|
|
2016-06-16 19:40:13 +00:00
|
|
|
static int action_ok_push_driver_settings_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, 0, 0, entry_idx,
|
|
|
|
ACTION_OK_DL_DRIVER_SETTINGS_LIST);
|
|
|
|
}
|
|
|
|
|
2016-06-17 02:02:26 +00:00
|
|
|
static int action_ok_push_video_settings_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, 0, 0, entry_idx,
|
|
|
|
ACTION_OK_DL_VIDEO_SETTINGS_LIST);
|
|
|
|
}
|
|
|
|
|
2016-06-18 20:17:39 +00:00
|
|
|
static int action_ok_push_core_settings_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, 0, 0, entry_idx,
|
|
|
|
ACTION_OK_DL_CORE_SETTINGS_LIST);
|
|
|
|
}
|
|
|
|
|
2016-06-17 02:02:26 +00:00
|
|
|
static int action_ok_push_audio_settings_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, 0, 0, entry_idx,
|
|
|
|
ACTION_OK_DL_AUDIO_SETTINGS_LIST);
|
|
|
|
}
|
|
|
|
|
2015-10-24 08:31:11 +00:00
|
|
|
static int action_ok_push_input_settings_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, 0, 0, entry_idx,
|
|
|
|
ACTION_OK_DL_INPUT_SETTINGS_LIST);
|
|
|
|
}
|
|
|
|
|
2015-10-25 09:25:07 +00:00
|
|
|
static int action_ok_push_playlist_settings_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, 0, 0, entry_idx,
|
|
|
|
ACTION_OK_DL_PLAYLIST_SETTINGS_LIST);
|
|
|
|
}
|
|
|
|
|
2015-10-25 09:41:53 +00:00
|
|
|
static int action_ok_push_input_hotkey_binds_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, 0, 0, entry_idx,
|
|
|
|
ACTION_OK_DL_INPUT_HOTKEY_BINDS_LIST);
|
|
|
|
}
|
|
|
|
|
2015-10-23 04:54:33 +00:00
|
|
|
static int action_ok_push_user_binds_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, 0, 0, entry_idx,
|
|
|
|
ACTION_OK_DL_USER_BINDS_LIST);
|
|
|
|
}
|
|
|
|
|
2015-10-17 13:58:59 +00:00
|
|
|
static int action_ok_push_accounts_cheevos_list(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, 0, 0, entry_idx,
|
|
|
|
ACTION_OK_DL_ACCOUNTS_CHEEVOS_LIST);
|
|
|
|
}
|
|
|
|
|
2015-09-03 19:53:01 +00:00
|
|
|
static int action_ok_open_archive(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_displaylist_push(path, label, 0, 0, entry_idx,
|
|
|
|
ACTION_OK_DL_OPEN_ARCHIVE);
|
2015-07-14 10:49:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_load_archive(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-05-16 14:25:16 +00:00
|
|
|
menu_handle_t *menu = NULL;
|
|
|
|
const char *menu_path = NULL;
|
|
|
|
const char *content_path = NULL;
|
2016-02-10 20:15:23 +00:00
|
|
|
|
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
2016-02-10 20:42:18 +00:00
|
|
|
return menu_cbs_exit();
|
2016-02-10 20:15:23 +00:00
|
|
|
|
|
|
|
menu_path = menu->scratch2_buf;
|
|
|
|
content_path = menu->scratch_buf;
|
2015-07-14 10:49:54 +00:00
|
|
|
|
|
|
|
fill_pathname_join(detect_content_path, menu_path, content_path,
|
|
|
|
sizeof(detect_content_path));
|
|
|
|
|
2016-05-09 18:51:53 +00:00
|
|
|
command_event(CMD_EVENT_LOAD_CORE, NULL);
|
2015-07-14 10:49:54 +00:00
|
|
|
|
2016-06-30 16:29:27 +00:00
|
|
|
return generic_action_ok_file_load(NULL, detect_content_path,
|
|
|
|
CORE_TYPE_PLAIN, CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_MENU);
|
2015-07-14 10:49:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int action_ok_load_archive_detect_core(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2016-02-04 14:21:42 +00:00
|
|
|
menu_content_ctx_defer_info_t def_info;
|
2016-06-15 16:52:27 +00:00
|
|
|
char new_core_path[PATH_MAX_LENGTH] = {0};
|
|
|
|
int ret = 0;
|
|
|
|
core_info_list_t *list = NULL;
|
|
|
|
menu_handle_t *menu = NULL;
|
|
|
|
const char *menu_path = NULL;
|
|
|
|
const char *content_path = NULL;
|
2015-07-14 10:49:54 +00:00
|
|
|
|
2016-02-10 20:15:23 +00:00
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
2016-02-10 20:42:18 +00:00
|
|
|
return menu_cbs_exit();
|
2015-07-14 10:49:54 +00:00
|
|
|
|
2016-01-25 04:58:45 +00:00
|
|
|
if (!menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &idx))
|
2015-09-25 12:57:37 +00:00
|
|
|
return false;
|
|
|
|
|
2016-02-10 20:15:23 +00:00
|
|
|
menu_path = menu->scratch2_buf;
|
|
|
|
content_path = menu->scratch_buf;
|
|
|
|
|
2016-05-09 16:11:17 +00:00
|
|
|
core_info_get_list(&list);
|
2015-12-11 12:51:17 +00:00
|
|
|
|
2016-02-04 14:21:42 +00:00
|
|
|
def_info.data = list;
|
|
|
|
def_info.dir = menu_path;
|
|
|
|
def_info.path = content_path;
|
|
|
|
def_info.menu_label = label;
|
|
|
|
def_info.s = menu->deferred_path;
|
|
|
|
def_info.len = sizeof(menu->deferred_path);
|
|
|
|
|
2016-06-15 16:52:27 +00:00
|
|
|
if (menu_content_find_first_core(&def_info, false, new_core_path, sizeof(new_core_path)))
|
2016-02-04 14:21:42 +00:00
|
|
|
ret = -1;
|
2015-07-14 10:49:54 +00:00
|
|
|
|
|
|
|
fill_pathname_join(detect_content_path, menu_path, content_path,
|
|
|
|
sizeof(detect_content_path));
|
|
|
|
|
|
|
|
switch (ret)
|
|
|
|
{
|
|
|
|
case -1:
|
2016-06-30 16:29:27 +00:00
|
|
|
return generic_action_ok_file_load(new_core_path, def_info.s,
|
|
|
|
CORE_TYPE_PLAIN, CONTENT_MODE_LOAD_CONTENT_WITH_NEW_CORE_FROM_MENU);
|
2015-07-14 10:49:54 +00:00
|
|
|
case 0:
|
2015-09-07 00:46:47 +00:00
|
|
|
return generic_action_ok_displaylist_push(path, label, type,
|
2016-01-25 04:58:45 +00:00
|
|
|
idx, entry_idx, ACTION_OK_DL_DEFERRED_CORE_LIST);
|
2015-09-07 00:46:47 +00:00
|
|
|
default:
|
2015-07-14 10:49:54 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2015-09-01 22:50:47 +00:00
|
|
|
static int action_ok_help_audio_video_troubleshooting(const char *path,
|
2015-07-17 18:33:09 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2015-09-01 22:50:47 +00:00
|
|
|
return generic_action_ok_help(path, label, type, idx, entry_idx,
|
2016-06-16 11:28:04 +00:00
|
|
|
MENU_ENUM_LABEL_HELP_AUDIO_VIDEO_TROUBLESHOOTING,
|
2016-01-25 17:14:14 +00:00
|
|
|
MENU_HELP_AUDIO_VIDEO_TROUBLESHOOTING);
|
2015-07-17 20:11:24 +00:00
|
|
|
}
|
|
|
|
|
2015-09-01 22:50:47 +00:00
|
|
|
static int action_ok_help(const char *path,
|
2015-07-18 09:29:37 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2015-09-01 22:50:47 +00:00
|
|
|
return generic_action_ok_help(path, label, type, idx, entry_idx,
|
2016-06-16 11:28:04 +00:00
|
|
|
MENU_ENUM_LABEL_HELP, MENU_HELP_WELCOME);
|
2015-07-18 09:29:37 +00:00
|
|
|
}
|
|
|
|
|
2015-09-01 22:50:47 +00:00
|
|
|
static int action_ok_help_controls(const char *path,
|
2015-07-18 12:57:20 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2015-09-01 22:50:47 +00:00
|
|
|
return generic_action_ok_help(path, label, type, idx, entry_idx,
|
2016-06-16 11:28:04 +00:00
|
|
|
MENU_ENUM_LABEL_HELP_CONTROLS, MENU_HELP_CONTROLS);
|
2015-07-18 12:57:20 +00:00
|
|
|
}
|
|
|
|
|
2015-09-01 22:50:47 +00:00
|
|
|
static int action_ok_help_what_is_a_core(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-07-18 12:57:20 +00:00
|
|
|
{
|
2015-09-01 22:50:47 +00:00
|
|
|
return generic_action_ok_help(path, label, type, idx, entry_idx,
|
2016-06-16 11:28:04 +00:00
|
|
|
MENU_ENUM_LABEL_HELP_WHAT_IS_A_CORE, MENU_HELP_WHAT_IS_A_CORE);
|
2015-07-18 12:57:20 +00:00
|
|
|
}
|
|
|
|
|
2015-09-01 22:47:44 +00:00
|
|
|
static int action_ok_help_scanning_content(const char *path,
|
2015-07-18 12:01:37 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2015-09-01 22:47:44 +00:00
|
|
|
return generic_action_ok_help(path, label, type, idx, entry_idx,
|
2016-06-16 11:28:04 +00:00
|
|
|
MENU_ENUM_LABEL_HELP_SCANNING_CONTENT, MENU_HELP_SCANNING_CONTENT);
|
2015-09-01 22:47:44 +00:00
|
|
|
}
|
2015-07-18 12:01:37 +00:00
|
|
|
|
2015-09-01 22:47:44 +00:00
|
|
|
static int action_ok_help_change_virtual_gamepad(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
|
|
|
return generic_action_ok_help(path, label, type, idx, entry_idx,
|
2016-06-16 11:28:04 +00:00
|
|
|
MENU_ENUM_LABEL_HELP_CHANGE_VIRTUAL_GAMEPAD,
|
2016-01-25 17:14:14 +00:00
|
|
|
MENU_HELP_CHANGE_VIRTUAL_GAMEPAD);
|
2015-07-18 12:01:37 +00:00
|
|
|
}
|
|
|
|
|
2015-07-17 20:11:24 +00:00
|
|
|
static int action_ok_help_load_content(const char *path,
|
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
|
|
|
{
|
2015-09-01 22:47:44 +00:00
|
|
|
return generic_action_ok_help(path, label, type, idx, entry_idx,
|
2016-06-16 11:28:04 +00:00
|
|
|
MENU_ENUM_LABEL_HELP_LOADING_CONTENT, MENU_HELP_LOADING_CONTENT);
|
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,
|
2015-06-10 21:11:40 +00:00
|
|
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-09-05 15:17:26 +00:00
|
|
|
unsigned width = 0;
|
|
|
|
unsigned height = 0;
|
|
|
|
|
2015-03-22 17:38:11 +00:00
|
|
|
if (video_driver_get_video_output_size(&width, &height))
|
2015-07-06 05:29:51 +00:00
|
|
|
{
|
2015-07-12 06:08:27 +00:00
|
|
|
char msg[PATH_MAX_LENGTH] = {0};
|
2015-11-21 07:39:46 +00:00
|
|
|
#ifdef __CELLOS_LV2__
|
2016-05-09 18:51:53 +00:00
|
|
|
command_event(CMD_EVENT_REINIT, NULL);
|
2015-11-21 07:39:46 +00:00
|
|
|
#endif
|
2015-11-21 07:56:24 +00:00
|
|
|
video_driver_set_video_mode(width, height, true);
|
2016-02-12 21:58:59 +00:00
|
|
|
#ifdef GEKKO
|
|
|
|
if (width == 0 || height == 0)
|
|
|
|
strlcpy(msg, "Applying: DEFAULT", sizeof(msg));
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
snprintf(msg, sizeof(msg),"Applying: %dx%d\n START to reset",
|
2016-01-25 17:14:14 +00:00
|
|
|
width, height);
|
2016-02-09 02:29:37 +00:00
|
|
|
runloop_msg_queue_push(msg, 1, 100, true);
|
2015-07-06 05:29:51 +00:00
|
|
|
}
|
2015-03-03 20:57:09 +00:00
|
|
|
|
2015-02-26 15:50:30 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-06-05 11:17:44 +00:00
|
|
|
static int is_rdb_entry(uint32_t label_hash)
|
2015-06-05 10:16:14 +00:00
|
|
|
{
|
2015-06-05 11:17:44 +00:00
|
|
|
switch (label_hash)
|
2015-06-05 10:16:14 +00:00
|
|
|
{
|
|
|
|
case MENU_LABEL_RDB_ENTRY_PUBLISHER:
|
|
|
|
case MENU_LABEL_RDB_ENTRY_DEVELOPER:
|
|
|
|
case MENU_LABEL_RDB_ENTRY_ORIGIN:
|
|
|
|
case MENU_LABEL_RDB_ENTRY_FRANCHISE:
|
|
|
|
case MENU_LABEL_RDB_ENTRY_ENHANCEMENT_HW:
|
|
|
|
case MENU_LABEL_RDB_ENTRY_ESRB_RATING:
|
|
|
|
case MENU_LABEL_RDB_ENTRY_BBFC_RATING:
|
|
|
|
case MENU_LABEL_RDB_ENTRY_ELSPA_RATING:
|
|
|
|
case MENU_LABEL_RDB_ENTRY_PEGI_RATING:
|
|
|
|
case MENU_LABEL_RDB_ENTRY_CERO_RATING:
|
|
|
|
case MENU_LABEL_RDB_ENTRY_EDGE_MAGAZINE_RATING:
|
|
|
|
case MENU_LABEL_RDB_ENTRY_EDGE_MAGAZINE_ISSUE:
|
|
|
|
case MENU_LABEL_RDB_ENTRY_FAMITSU_MAGAZINE_RATING:
|
|
|
|
case MENU_LABEL_RDB_ENTRY_RELEASE_MONTH:
|
|
|
|
case MENU_LABEL_RDB_ENTRY_RELEASE_YEAR:
|
|
|
|
case MENU_LABEL_RDB_ENTRY_MAX_USERS:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-06-12 14:01:46 +00:00
|
|
|
static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
|
2015-06-07 16:14:48 +00:00
|
|
|
const char *label, uint32_t hash, const char *elem0)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2016-06-19 22:37:38 +00:00
|
|
|
uint32_t elem0_hash = msg_hash_calculate(elem0);
|
2015-06-07 16:14:48 +00:00
|
|
|
|
2015-12-26 06:37:44 +00:00
|
|
|
if (!string_is_empty(elem0) && (is_rdb_entry(elem0_hash) == 0))
|
2015-06-07 16:14:48 +00:00
|
|
|
{
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_rdb_entry_submenu);
|
2015-06-07 16:14:48 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-10-23 04:54:33 +00:00
|
|
|
if (strstr(elem0, "_input_binds_list"))
|
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_user_binds_list);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-10-11 11:16:38 +00:00
|
|
|
if (menu_setting_get_browser_selection_type(cbs->setting) == ST_DIR)
|
2015-06-07 16:14:48 +00:00
|
|
|
{
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_generic_list);
|
2015-06-07 16:14:48 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-06-19 22:31:13 +00:00
|
|
|
if (cbs->enum_idx != MSG_UNKNOWN)
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2016-06-16 15:50:53 +00:00
|
|
|
switch (cbs->enum_idx)
|
|
|
|
{
|
|
|
|
case MENU_ENUM_LABEL_START_CORE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_start_core);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_START_NET_RETROPAD:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_start_net_retropad_core);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_OPEN_ARCHIVE_DETECT_CORE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_open_archive_detect_core);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_OPEN_ARCHIVE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_open_archive);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_LOAD_ARCHIVE_DETECT_CORE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_load_archive_detect_core);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_LOAD_ARCHIVE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_load_archive);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CUSTOM_BIND_ALL:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_lookup_setting);
|
|
|
|
break;
|
2016-06-17 20:36:13 +00:00
|
|
|
case MENU_ENUM_LABEL_SAVE_STATE:
|
2016-06-16 15:50:53 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_save_state);
|
|
|
|
break;
|
2016-06-17 20:36:13 +00:00
|
|
|
case MENU_ENUM_LABEL_LOAD_STATE:
|
2016-06-16 15:50:53 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_load_state);
|
|
|
|
break;
|
2016-06-17 20:36:13 +00:00
|
|
|
case MENU_ENUM_LABEL_UNDO_LOAD_STATE:
|
2016-06-16 15:50:53 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_undo_load_state);
|
|
|
|
break;
|
2016-06-17 20:36:13 +00:00
|
|
|
case MENU_ENUM_LABEL_UNDO_SAVE_STATE:
|
2016-06-16 15:50:53 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_undo_save_state);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_RESUME_CONTENT:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_resume_content);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_RESTART_CONTENT:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_restart_content);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_TAKE_SCREENSHOT:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_screenshot);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_QUIT_RETROARCH:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_quit);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CLOSE_CONTENT:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_close_content);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_SAVE_NEW_CONFIG:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_save_new_config);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_HELP:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_help);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_HELP_CONTROLS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_help_controls);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_HELP_WHAT_IS_A_CORE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_help_what_is_a_core);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_HELP_CHANGE_VIRTUAL_GAMEPAD:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_help_change_virtual_gamepad);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_HELP_AUDIO_VIDEO_TROUBLESHOOTING:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_help_audio_video_troubleshooting);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_HELP_SCANNING_CONTENT:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_help_scanning_content);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_HELP_LOADING_CONTENT:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_help_load_content);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_PASS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_pass);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_preset);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CHEAT_FILE_LOAD:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_cheat_file);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_AUDIO_DSP_PLUGIN:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_audio_dsp_plugin);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_REMAP_FILE_LOAD:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_remap_file);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_RECORD_CONFIG:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_record_configfile);
|
|
|
|
break;
|
2015-09-04 18:11:46 +00:00
|
|
|
#ifdef HAVE_NETWORKING
|
2016-06-16 15:50:53 +00:00
|
|
|
case MENU_ENUM_LABEL_DOWNLOAD_CORE_CONTENT:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_core_content_list);
|
|
|
|
break;
|
2016-06-20 22:54:14 +00:00
|
|
|
case MENU_ENUM_LABEL_DOWNLOAD_CORE_CONTENT_DIRS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_core_content_dirs_list);
|
|
|
|
break;
|
2016-06-18 01:12:32 +00:00
|
|
|
case MENU_ENUM_LABEL_CORE_UPDATER_LIST:
|
2016-06-16 15:50:53 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_core_updater_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_THUMBNAILS_UPDATER_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_thumbnails_updater_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_LAKKA:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_lakka_list);
|
|
|
|
break;
|
2015-09-04 18:11:46 +00:00
|
|
|
#endif
|
2016-06-16 15:50:53 +00:00
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_PARAMETERS:
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_PARAMETERS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_parameters);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_ACCOUNTS_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_accounts_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_INPUT_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_input_settings_list);
|
|
|
|
break;
|
2016-06-16 19:40:13 +00:00
|
|
|
case MENU_ENUM_LABEL_DRIVER_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_driver_settings_list);
|
|
|
|
break;
|
2016-06-17 02:02:26 +00:00
|
|
|
case MENU_ENUM_LABEL_VIDEO_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_video_settings_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_AUDIO_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_audio_settings_list);
|
|
|
|
break;
|
2016-06-18 20:17:39 +00:00
|
|
|
case MENU_ENUM_LABEL_CORE_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_core_settings_list);
|
|
|
|
break;
|
2016-06-16 15:50:53 +00:00
|
|
|
case MENU_ENUM_LABEL_PLAYLIST_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_playlist_settings_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_INPUT_HOTKEY_BINDS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_input_hotkey_binds_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_ACCOUNTS_RETRO_ACHIEVEMENTS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_accounts_cheevos_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_SHADER_OPTIONS:
|
|
|
|
case MENU_ENUM_LABEL_CORE_OPTIONS:
|
|
|
|
case MENU_ENUM_LABEL_CORE_CHEAT_OPTIONS:
|
|
|
|
case MENU_ENUM_LABEL_CORE_INPUT_REMAPPING_OPTIONS:
|
|
|
|
case MENU_ENUM_LABEL_CORE_INFORMATION:
|
|
|
|
case MENU_ENUM_LABEL_SYSTEM_INFORMATION:
|
|
|
|
case MENU_ENUM_LABEL_NETWORK_INFORMATION:
|
|
|
|
case MENU_ENUM_LABEL_DEBUG_INFORMATION:
|
|
|
|
case MENU_ENUM_LABEL_ACHIEVEMENT_LIST:
|
|
|
|
case MENU_ENUM_LABEL_DISK_OPTIONS:
|
|
|
|
case MENU_ENUM_LABEL_SETTINGS:
|
|
|
|
case MENU_ENUM_LABEL_FRONTEND_COUNTERS:
|
|
|
|
case MENU_ENUM_LABEL_CORE_COUNTERS:
|
|
|
|
case MENU_ENUM_LABEL_MANAGEMENT:
|
|
|
|
case MENU_ENUM_LABEL_ONLINE_UPDATER:
|
|
|
|
case MENU_ENUM_LABEL_LOAD_CONTENT_LIST:
|
|
|
|
case MENU_ENUM_LABEL_ADD_CONTENT_LIST:
|
|
|
|
case MENU_ENUM_LABEL_HELP_LIST:
|
|
|
|
case MENU_ENUM_LABEL_INFORMATION_LIST:
|
|
|
|
case MENU_ENUM_LABEL_CONTENT_SETTINGS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_default);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_SCAN_FILE:
|
|
|
|
case MENU_ENUM_LABEL_SCAN_DIRECTORY:
|
|
|
|
case MENU_ENUM_LABEL_LOAD_CONTENT:
|
|
|
|
case MENU_ENUM_LABEL_DETECT_CORE_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_content_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_DOWNLOADED_FILE_DETECT_CORE_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_downloads_dir);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_DETECT_CORE_LIST_OK:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_file_load_detect_core);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY:
|
|
|
|
case MENU_ENUM_LABEL_CURSOR_MANAGER_LIST:
|
|
|
|
case MENU_ENUM_LABEL_DATABASE_MANAGER_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_generic_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_SHADER_APPLY_CHANGES:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_apply_changes);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CHEAT_APPLY_CHANGES:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_cheat_apply_changes);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_PRESET_SAVE_AS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_preset_save_as);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CHEAT_FILE_SAVE_AS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_cheat_file_save_as);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_REMAP_FILE_SAVE_CORE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_remap_file_save_core);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_REMAP_FILE_SAVE_GAME:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_remap_file_save_game);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CONTENT_COLLECTION_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_content_collection_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CORE_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_core_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_DISK_IMAGE_APPEND:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_disk_image_append_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CONFIGURATIONS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_configurations_list);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_SCREEN_RESOLUTION:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_video_resolution);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_ASSETS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_update_assets);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_CORE_INFO_FILES:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_update_core_info_files);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_OVERLAYS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_update_overlays);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_DATABASES:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_update_databases);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_GLSL_SHADERS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_update_shaders_glsl);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_CG_SHADERS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_update_shaders_cg);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_CHEATS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_update_cheats);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_UPDATE_AUTOCONFIG_PROFILES:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_update_autoconfig_profiles);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
switch (hash)
|
|
|
|
{
|
|
|
|
case MENU_LABEL_OPEN_ARCHIVE_DETECT_CORE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_open_archive_detect_core);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_OPEN_ARCHIVE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_open_archive);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_LOAD_ARCHIVE_DETECT_CORE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_load_archive_detect_core);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_LOAD_ARCHIVE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_load_archive);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_CUSTOM_BIND_ALL:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_lookup_setting);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_VIDEO_SHADER_PASS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_pass);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_VIDEO_SHADER_PRESET:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_preset);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_CHEAT_FILE_LOAD:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_cheat_file);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_AUDIO_DSP_PLUGIN:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_audio_dsp_plugin);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_REMAP_FILE_LOAD:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_remap_file);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_RECORD_CONFIG:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_record_configfile);
|
|
|
|
break;
|
|
|
|
#ifdef HAVE_NETWORKING
|
|
|
|
case MENU_LABEL_UPDATE_LAKKA:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_lakka_list);
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
case MENU_LABEL_VIDEO_SHADER_PARAMETERS:
|
|
|
|
case MENU_LABEL_VIDEO_SHADER_PRESET_PARAMETERS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_parameters);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_ACCOUNTS_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_accounts_list);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_ACCOUNTS_RETRO_ACHIEVEMENTS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_accounts_cheevos_list);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_SCAN_FILE:
|
|
|
|
case MENU_LABEL_SCAN_DIRECTORY:
|
|
|
|
case MENU_LABEL_LOAD_CONTENT:
|
|
|
|
case MENU_LABEL_DETECT_CORE_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_content_list);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DOWNLOADED_FILE_DETECT_CORE_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_downloads_dir);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DETECT_CORE_LIST_OK:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_file_load_detect_core);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_SHADER_APPLY_CHANGES:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_apply_changes);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_CHEAT_APPLY_CHANGES:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_cheat_apply_changes);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_VIDEO_SHADER_PRESET_SAVE_AS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_preset_save_as);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_CHEAT_FILE_SAVE_AS:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_cheat_file_save_as);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_REMAP_FILE_SAVE_CORE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_remap_file_save_core);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_REMAP_FILE_SAVE_GAME:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_remap_file_save_game);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DISK_IMAGE_APPEND:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_disk_image_append_list);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_SCREEN_RESOLUTION:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_video_resolution);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return -1;
|
|
|
|
}
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|
|
|
|
|
2015-06-05 09:48:25 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-06-12 14:01:46 +00:00
|
|
|
static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
|
2015-06-05 11:17:44 +00:00
|
|
|
uint32_t label_hash, uint32_t menu_label_hash, unsigned type)
|
2015-06-05 09:48:25 +00:00
|
|
|
{
|
2015-06-07 15:16:21 +00:00
|
|
|
if (type == MENU_SETTINGS_CUSTOM_BIND_KEYBOARD ||
|
|
|
|
type == MENU_SETTINGS_CUSTOM_BIND)
|
2015-10-11 17:59:14 +00:00
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_lookup_setting);
|
|
|
|
}
|
2015-06-07 15:16:21 +00:00
|
|
|
else if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
|
|
|
|
&& type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
|
2015-10-11 17:59:14 +00:00
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, NULL);
|
|
|
|
}
|
2015-06-07 15:16:21 +00:00
|
|
|
else if (type >= MENU_SETTINGS_SHADER_PRESET_PARAMETER_0
|
|
|
|
&& type <= MENU_SETTINGS_SHADER_PRESET_PARAMETER_LAST)
|
2015-10-11 17:59:14 +00:00
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, NULL);
|
|
|
|
}
|
2015-11-08 17:11:53 +00:00
|
|
|
else if ((type >= MENU_SETTINGS_CHEEVOS_START))
|
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_cheevos);
|
|
|
|
}
|
2015-06-07 15:16:21 +00:00
|
|
|
else if (type >= MENU_SETTINGS_CHEAT_BEGIN
|
|
|
|
&& type <= MENU_SETTINGS_CHEAT_END)
|
2015-10-11 17:59:14 +00:00
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_cheat);
|
|
|
|
}
|
2015-06-07 15:16:21 +00:00
|
|
|
else
|
2015-02-26 15:50:30 +00:00
|
|
|
{
|
2015-06-07 15:16:21 +00:00
|
|
|
switch (type)
|
|
|
|
{
|
2015-06-25 07:15:34 +00:00
|
|
|
case MENU_SETTING_ACTION_CORE_DISK_OPTIONS:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_default);
|
2015-06-25 07:15:34 +00:00
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_PLAYLIST_ENTRY:
|
2016-06-14 20:48:25 +00:00
|
|
|
if (label_hash == MENU_LABEL_COLLECTION)
|
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_playlist_entry_collection);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_playlist_entry);
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_RPL_ENTRY:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_rpl_entry);
|
2015-07-23 17:44:59 +00:00
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_PLAYLIST_COLLECTION:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_playlist_collection);
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_CONTENTLIST_ENTRY:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_generic_list);
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_CHEAT:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_cheat_file_load);
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_RECORD_CONFIG:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_record_configfile_load);
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_REMAP:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_remap_file_load);
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_SHADER_PRESET:
|
2015-07-03 23:51:41 +00:00
|
|
|
switch (menu_label_hash)
|
|
|
|
{
|
|
|
|
case MENU_LABEL_SCAN_FILE:
|
|
|
|
break;
|
|
|
|
default:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_preset_load);
|
|
|
|
break;
|
2015-07-03 23:51:41 +00:00
|
|
|
}
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_SHADER:
|
2015-07-03 23:51:41 +00:00
|
|
|
switch (menu_label_hash)
|
|
|
|
{
|
|
|
|
case MENU_LABEL_SCAN_FILE:
|
|
|
|
break;
|
|
|
|
default:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_shader_pass_load);
|
|
|
|
break;
|
2015-07-03 23:51:41 +00:00
|
|
|
}
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_IMAGE:
|
2015-07-03 23:51:41 +00:00
|
|
|
switch (menu_label_hash)
|
|
|
|
{
|
|
|
|
case MENU_LABEL_SCAN_FILE:
|
|
|
|
break;
|
|
|
|
default:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_menu_wallpaper_load);
|
|
|
|
break;
|
2015-07-03 23:51:41 +00:00
|
|
|
}
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_USE_DIRECTORY:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_path_use_directory);
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
2015-11-24 00:12:50 +00:00
|
|
|
#ifdef HAVE_LIBRETRODB
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_SCAN_DIRECTORY:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_path_scan_directory);
|
2015-07-03 23:51:41 +00:00
|
|
|
break;
|
2015-11-24 00:12:50 +00:00
|
|
|
#endif
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_CONFIG:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_config_load);
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_PARENT_DIRECTORY:
|
2015-10-25 07:31:55 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_parent_directory_push);
|
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_DIRECTORY:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_directory_push);
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_CARCHIVE:
|
2015-07-03 23:51:41 +00:00
|
|
|
switch (menu_label_hash)
|
|
|
|
{
|
2015-07-14 10:49:54 +00:00
|
|
|
case MENU_LABEL_DETECT_CORE_LIST:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_compressed_archive_push_detect_core);
|
2015-07-14 10:49:54 +00:00
|
|
|
break;
|
2015-07-03 23:51:41 +00:00
|
|
|
case MENU_LABEL_SCAN_FILE:
|
|
|
|
break;
|
|
|
|
default:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_compressed_archive_push);
|
2015-07-14 10:49:54 +00:00
|
|
|
break;
|
2015-07-03 23:51:41 +00:00
|
|
|
}
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_CORE:
|
2016-06-27 19:34:05 +00:00
|
|
|
if (cbs->enum_idx != MSG_UNKNOWN)
|
2015-06-07 15:16:21 +00:00
|
|
|
{
|
2016-06-18 17:07:51 +00:00
|
|
|
switch (cbs->enum_idx)
|
|
|
|
{
|
|
|
|
case MENU_ENUM_LABEL_CORE_UPDATER_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_deferred_list_stub);
|
|
|
|
break;
|
2016-06-19 22:31:13 +00:00
|
|
|
case MSG_UNKNOWN:
|
2016-06-18 17:07:51 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
switch (menu_label_hash)
|
|
|
|
{
|
|
|
|
case MENU_LABEL_DEFERRED_CORE_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_load_core_deferred);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_DEFERRED_CORE_LIST_SET:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_core_deferred_set);
|
|
|
|
break;
|
|
|
|
case MENU_LABEL_CORE_LIST:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_load_core);
|
|
|
|
break;
|
|
|
|
}
|
2015-06-07 15:16:21 +00:00
|
|
|
}
|
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_DOWNLOAD_CORE_CONTENT:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_core_content_download);
|
2015-07-04 02:01:35 +00:00
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_DOWNLOAD_THUMBNAIL_CONTENT:
|
2016-04-23 20:31:39 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_core_content_thumbnails);
|
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_DOWNLOAD_CORE:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_core_updater_download);
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
2016-06-20 23:40:55 +00:00
|
|
|
case FILE_TYPE_DOWNLOAD_URL:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_download_url);
|
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_DOWNLOAD_THUMBNAIL:
|
2016-04-23 20:31:39 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_thumbnails_updater_download);
|
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_DOWNLOAD_LAKKA:
|
2015-12-24 19:13:50 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_lakka_download);
|
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_DOWNLOAD_CORE_INFO:
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_RDB:
|
2015-06-05 08:50:16 +00:00
|
|
|
switch (menu_label_hash)
|
|
|
|
{
|
2015-06-07 15:16:21 +00:00
|
|
|
case MENU_LABEL_DEFERRED_DATABASE_MANAGER_LIST:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_deferred_list_stub);
|
2015-06-05 08:50:16 +00:00
|
|
|
break;
|
2015-06-07 15:16:21 +00:00
|
|
|
case MENU_LABEL_DATABASE_MANAGER_LIST:
|
|
|
|
case MENU_VALUE_HORIZONTAL_MENU:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_database_manager_list);
|
2015-06-05 08:50:16 +00:00
|
|
|
break;
|
2015-06-07 15:16:21 +00:00
|
|
|
}
|
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_RDB_ENTRY:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_rdb_entry);
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_CURSOR:
|
2015-06-07 15:16:21 +00:00
|
|
|
switch (menu_label_hash)
|
|
|
|
{
|
|
|
|
case MENU_LABEL_DEFERRED_DATABASE_MANAGER_LIST:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_deferred_list_stub);
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
|
|
|
case MENU_LABEL_CURSOR_MANAGER_LIST:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_cursor_manager_list);
|
2015-06-05 08:50:16 +00:00
|
|
|
break;
|
|
|
|
}
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_FONT:
|
|
|
|
case FILE_TYPE_OVERLAY:
|
|
|
|
case FILE_TYPE_AUDIOFILTER:
|
|
|
|
case FILE_TYPE_VIDEOFILTER:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_set_path);
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
2015-02-26 15:50:30 +00:00
|
|
|
#ifdef HAVE_COMPRESSION
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_IN_CARCHIVE:
|
2015-02-26 15:50:30 +00:00
|
|
|
#endif
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_PLAIN:
|
2015-06-07 15:16:21 +00:00
|
|
|
switch (menu_label_hash)
|
|
|
|
{
|
2015-11-24 00:18:00 +00:00
|
|
|
#ifdef HAVE_LIBRETRODB
|
2015-07-04 00:07:18 +00:00
|
|
|
case MENU_LABEL_SCAN_FILE:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_scan_file);
|
2015-07-04 00:07:18 +00:00
|
|
|
break;
|
2015-11-24 00:12:50 +00:00
|
|
|
#endif
|
2015-07-04 05:09:54 +00:00
|
|
|
case MENU_LABEL_DOWNLOADED_FILE_DETECT_CORE_LIST:
|
2015-06-07 15:16:21 +00:00
|
|
|
case MENU_LABEL_DETECT_CORE_LIST:
|
2015-07-14 10:49:54 +00:00
|
|
|
case MENU_LABEL_DEFERRED_ARCHIVE_OPEN_DETECT_CORE:
|
2015-06-08 18:29:45 +00:00
|
|
|
#ifdef HAVE_COMPRESSION
|
2016-06-20 13:50:37 +00:00
|
|
|
if (type == FILE_TYPE_IN_CARCHIVE)
|
2015-10-11 17:59:14 +00:00
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_file_load_with_detect_core_carchive);
|
|
|
|
}
|
2015-06-08 18:29:45 +00:00
|
|
|
else
|
|
|
|
#endif
|
2015-10-11 17:59:14 +00:00
|
|
|
{
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_file_load_with_detect_core);
|
|
|
|
}
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
|
|
|
case MENU_LABEL_DISK_IMAGE_APPEND:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_disk_image_append);
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
|
|
|
default:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_file_load);
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_MOVIE:
|
|
|
|
case FILE_TYPE_MUSIC:
|
2015-06-23 04:44:29 +00:00
|
|
|
#ifdef HAVE_FFMPEG
|
2015-07-03 23:51:41 +00:00
|
|
|
switch (menu_label_hash)
|
|
|
|
{
|
|
|
|
case MENU_LABEL_SCAN_FILE:
|
|
|
|
break;
|
|
|
|
default:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_file_load_ffmpeg);
|
|
|
|
break;
|
2015-07-03 23:51:41 +00:00
|
|
|
}
|
2015-06-23 04:44:29 +00:00
|
|
|
#endif
|
|
|
|
break;
|
2016-06-20 13:50:37 +00:00
|
|
|
case FILE_TYPE_IMAGEVIEWER:
|
2015-07-03 23:51:41 +00:00
|
|
|
switch (menu_label_hash)
|
|
|
|
{
|
|
|
|
case MENU_LABEL_SCAN_FILE:
|
|
|
|
break;
|
|
|
|
default:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_file_load_imageviewer);
|
|
|
|
break;
|
2015-07-03 23:51:41 +00:00
|
|
|
}
|
2015-06-28 15:21:32 +00:00
|
|
|
break;
|
2015-06-07 15:16:21 +00:00
|
|
|
case MENU_SETTINGS:
|
|
|
|
case MENU_SETTING_GROUP:
|
|
|
|
case MENU_SETTING_SUBGROUP:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_push_default);
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
|
|
|
case MENU_SETTINGS_CORE_DISK_OPTIONS_DISK_CYCLE_TRAY_STATUS:
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_disk_cycle_tray_status);
|
2015-06-07 15:16:21 +00:00
|
|
|
break;
|
2015-11-16 03:09:39 +00:00
|
|
|
case MENU_SETTINGS_CORE_OPTION_CREATE:
|
|
|
|
BIND_ACTION_OK(cbs, action_ok_option_create);
|
|
|
|
break;
|
2015-06-07 15:16:21 +00:00
|
|
|
default:
|
|
|
|
return -1;
|
|
|
|
}
|
2015-06-05 09:48:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-06-12 14:01:46 +00:00
|
|
|
int menu_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
|
2015-06-05 09:48:25 +00:00
|
|
|
const char *path, const char *label, unsigned type, size_t idx,
|
2015-06-05 11:17:44 +00:00
|
|
|
const char *elem0, const char *elem1, const char *menu_label,
|
|
|
|
uint32_t label_hash, uint32_t menu_label_hash)
|
2015-06-05 09:48:25 +00:00
|
|
|
{
|
2015-06-07 16:36:10 +00:00
|
|
|
if (!cbs)
|
|
|
|
return -1;
|
2015-06-05 09:48:25 +00:00
|
|
|
|
2015-10-11 17:59:14 +00:00
|
|
|
BIND_ACTION_OK(cbs, action_ok_lookup_setting);
|
2015-06-05 09:48:25 +00:00
|
|
|
|
2015-06-12 14:01:46 +00:00
|
|
|
if (menu_cbs_init_bind_ok_compare_label(cbs, label, label_hash, elem0) == 0)
|
2015-06-07 16:36:10 +00:00
|
|
|
return 0;
|
2015-06-05 09:48:25 +00:00
|
|
|
|
2015-06-12 14:01:46 +00:00
|
|
|
if (menu_cbs_init_bind_ok_compare_type(cbs, label_hash, menu_label_hash, type) == 0)
|
2015-06-07 16:36:10 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
return -1;
|
2015-02-26 15:50:30 +00:00
|
|
|
}
|