mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-01 15:48:49 +00:00
Revert "Part 2 of menu input remapping"
This reverts commit 19d090d3ae
.
This commit is contained in:
parent
19d090d3ae
commit
85441f34a7
@ -307,7 +307,6 @@ struct settings
|
|||||||
bool input_descriptor_label_show;
|
bool input_descriptor_label_show;
|
||||||
bool input_descriptor_hide_unbound;
|
bool input_descriptor_hide_unbound;
|
||||||
|
|
||||||
char menu_remapping_path[PATH_MAX_LENGTH];
|
|
||||||
char remapping_path[PATH_MAX_LENGTH];
|
char remapping_path[PATH_MAX_LENGTH];
|
||||||
} input;
|
} input;
|
||||||
|
|
||||||
@ -335,7 +334,6 @@ struct settings
|
|||||||
char content_database[PATH_MAX_LENGTH];
|
char content_database[PATH_MAX_LENGTH];
|
||||||
char cheat_database[PATH_MAX_LENGTH];
|
char cheat_database[PATH_MAX_LENGTH];
|
||||||
char cheat_settings_path[PATH_MAX_LENGTH];
|
char cheat_settings_path[PATH_MAX_LENGTH];
|
||||||
char menu_input_remapping_directory[PATH_MAX_LENGTH];
|
|
||||||
char input_remapping_directory[PATH_MAX_LENGTH];
|
char input_remapping_directory[PATH_MAX_LENGTH];
|
||||||
|
|
||||||
char resampler_directory[PATH_MAX_LENGTH];
|
char resampler_directory[PATH_MAX_LENGTH];
|
||||||
|
@ -108,45 +108,6 @@ void input_remapping_save_file(const char *path)
|
|||||||
config_file_free(conf);
|
config_file_free(conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* input_menu_remapping_load_file:
|
|
||||||
* @path : Path to menu remapping file (absolute path).
|
|
||||||
*
|
|
||||||
* Loads a menu remap file from disk to memory.
|
|
||||||
*
|
|
||||||
* Returns: true (1) if successful, otherwise false (0).
|
|
||||||
**/
|
|
||||||
bool input_menu_remapping_load_file(const char *path)
|
|
||||||
{
|
|
||||||
unsigned j;
|
|
||||||
char buf[64];
|
|
||||||
char key_ident[RARCH_FIRST_META_KEY][128];
|
|
||||||
char key_strings[RARCH_FIRST_META_KEY][128] = { "b", "y", "select", "start",
|
|
||||||
"up", "down", "left", "right", "a", "x", "l", "r", "l2", "r2", "l3", "r3"};
|
|
||||||
config_file_t *conf = config_file_new(path);
|
|
||||||
|
|
||||||
if (!conf)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
strlcpy(g_settings.input.menu_remapping_path, path,
|
|
||||||
sizeof(g_settings.input.menu_remapping_path));
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "input_player%u", 1);
|
|
||||||
|
|
||||||
for (j = 0; j < RARCH_FIRST_META_KEY; j++)
|
|
||||||
{
|
|
||||||
int key_remap = -1;
|
|
||||||
|
|
||||||
snprintf(key_ident[j], sizeof(key_ident[j]), "%s_%s", buf, key_strings[j]);
|
|
||||||
if (config_get_int(conf, key_ident[j], &key_remap))
|
|
||||||
g_settings.input.menu_remap_ids[0][j] = key_remap;
|
|
||||||
}
|
|
||||||
|
|
||||||
config_file_free(conf);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void input_remapping_set_defaults(void)
|
void input_remapping_set_defaults(void)
|
||||||
{
|
{
|
||||||
unsigned i, j;
|
unsigned i, j;
|
||||||
|
@ -34,16 +34,6 @@ extern "C" {
|
|||||||
**/
|
**/
|
||||||
bool input_remapping_load_file(const char *path);
|
bool input_remapping_load_file(const char *path);
|
||||||
|
|
||||||
/**
|
|
||||||
* input_menu_remapping_load_file:
|
|
||||||
* @path : Path to menu remapping file (absolute path).
|
|
||||||
*
|
|
||||||
* Loads a menu remap file from disk to memory.
|
|
||||||
*
|
|
||||||
* Returns: true (1) if successful, otherwise false (0).
|
|
||||||
**/
|
|
||||||
bool input_menu_remapping_load_file(const char *path);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* input_remapping_save_file:
|
* input_remapping_save_file:
|
||||||
* @path : Path to remapping file (relative path).
|
* @path : Path to remapping file (relative path).
|
||||||
|
@ -76,7 +76,6 @@ typedef enum
|
|||||||
MENU_FILE_IN_CARCHIVE,
|
MENU_FILE_IN_CARCHIVE,
|
||||||
MENU_FILE_IMAGE,
|
MENU_FILE_IMAGE,
|
||||||
MENU_FILE_REMAP,
|
MENU_FILE_REMAP,
|
||||||
MENU_FILE_MENU_REMAP,
|
|
||||||
MENU_FILE_DOWNLOAD_CORE,
|
MENU_FILE_DOWNLOAD_CORE,
|
||||||
MENU_FILE_DOWNLOAD_CORE_INFO,
|
MENU_FILE_DOWNLOAD_CORE_INFO,
|
||||||
MENU_FILE_RDB,
|
MENU_FILE_RDB,
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include "menu_input.h"
|
#include "menu_input.h"
|
||||||
#include "menu_entries.h"
|
#include "menu_entries.h"
|
||||||
#include "menu_shader.h"
|
#include "menu_shader.h"
|
||||||
#include "menu_database.h"
|
|
||||||
|
|
||||||
#include "../file_ext.h"
|
#include "../file_ext.h"
|
||||||
#include "../file_extract.h"
|
#include "../file_extract.h"
|
||||||
@ -33,6 +32,8 @@
|
|||||||
#include "../net_http.h"
|
#include "../net_http.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "menu_database.h"
|
||||||
|
|
||||||
#include "../input/input_remapping.h"
|
#include "../input/input_remapping.h"
|
||||||
|
|
||||||
#ifdef GEKKO
|
#ifdef GEKKO
|
||||||
@ -301,14 +302,6 @@ static int action_ok_cheat_file(const char *path,
|
|||||||
label, type, idx);
|
label, type, idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_ok_menu_remap_file(const char *path,
|
|
||||||
const char *label, unsigned type, size_t idx)
|
|
||||||
{
|
|
||||||
return action_ok_file_generic(
|
|
||||||
g_settings.menu_input_remapping_directory,
|
|
||||||
label, type, idx);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int action_ok_remap_file(const char *path,
|
static int action_ok_remap_file(const char *path,
|
||||||
const char *label, unsigned type, size_t idx)
|
const char *label, unsigned type, size_t idx)
|
||||||
{
|
{
|
||||||
@ -346,27 +339,6 @@ static int action_ok_remap_file_load(const char *path,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_ok_menu_remap_file_load(const char *path,
|
|
||||||
const char *label, unsigned type, size_t idx)
|
|
||||||
{
|
|
||||||
const char *menu_path = NULL;
|
|
||||||
char remap_path[PATH_MAX_LENGTH];
|
|
||||||
if (!driver.menu)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
(void)remap_path;
|
|
||||||
(void)menu_path;
|
|
||||||
menu_list_get_last_stack(driver.menu->menu_list, &menu_path, NULL,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
fill_pathname_join(remap_path, menu_path, path, sizeof(remap_path));
|
|
||||||
input_menu_remapping_load_file(remap_path);
|
|
||||||
|
|
||||||
menu_list_flush_stack_by_needle(driver.menu->menu_list, "menu_input_remapping_options");
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int action_ok_cheat_file_load(const char *path,
|
static int action_ok_cheat_file_load(const char *path,
|
||||||
const char *label, unsigned type, size_t idx)
|
const char *label, unsigned type, size_t idx)
|
||||||
{
|
{
|
||||||
@ -488,13 +460,6 @@ static int action_ok_remap_file_save_as(const char *path,
|
|||||||
label, type, idx, menu_input_st_string_callback);
|
label, type, idx, menu_input_st_string_callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_ok_menu_remap_file_save_as(const char *path,
|
|
||||||
const char *label, unsigned type, size_t idx)
|
|
||||||
{
|
|
||||||
return action_ok_save_as_generic("Menu Remapping Filename",
|
|
||||||
label, type, idx, menu_input_st_string_callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int action_ok_path_use_directory(const char *path,
|
static int action_ok_path_use_directory(const char *path,
|
||||||
const char *label, unsigned type, size_t idx)
|
const char *label, unsigned type, size_t idx)
|
||||||
{
|
{
|
||||||
@ -2185,43 +2150,6 @@ static int deferred_push_core_input_remapping_options(void *data, void *userdata
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int deferred_push_menu_input_remapping_options(void *data, void *userdata,
|
|
||||||
const char *path, const char *label, unsigned type)
|
|
||||||
{
|
|
||||||
unsigned p = 0, retro_id;
|
|
||||||
file_list_t *list = (file_list_t*)data;
|
|
||||||
|
|
||||||
(void)userdata;
|
|
||||||
(void)type;
|
|
||||||
|
|
||||||
if (!list)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
menu_list_clear(list);
|
|
||||||
menu_list_push(list, "Menu Remap File Load", "remap_menu_file_load",
|
|
||||||
MENU_SETTING_ACTION, 0);
|
|
||||||
menu_list_push(list, "Menu Remap File Save As",
|
|
||||||
"remap_menu_file_save_as", MENU_SETTING_ACTION, 0);
|
|
||||||
|
|
||||||
for (retro_id = 0; retro_id < RARCH_FIRST_CUSTOM_BIND; retro_id++)
|
|
||||||
{
|
|
||||||
char desc_label[64];
|
|
||||||
unsigned user = p + 1;
|
|
||||||
const char *description = g_extern.system.input_desc_btn[p][retro_id];
|
|
||||||
|
|
||||||
if (!description)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
snprintf(desc_label, sizeof(desc_label), "%s : ", description);
|
|
||||||
menu_list_push(list, desc_label, "", MENU_SETTINGS_INPUT_DESC_BEGIN + (p * RARCH_FIRST_CUSTOM_BIND) + retro_id, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (driver.menu_ctx && driver.menu_ctx->populate_entries)
|
|
||||||
driver.menu_ctx->populate_entries(driver.menu, path, label, type);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int deferred_push_core_options(void *data, void *userdata,
|
static int deferred_push_core_options(void *data, void *userdata,
|
||||||
const char *path, const char *label, unsigned type)
|
const char *path, const char *label, unsigned type)
|
||||||
{
|
{
|
||||||
@ -2714,9 +2642,6 @@ static int menu_entries_cbs_init_bind_ok_first(menu_file_list_cbs_t *cbs,
|
|||||||
case MENU_FILE_REMAP:
|
case MENU_FILE_REMAP:
|
||||||
cbs->action_ok = action_ok_remap_file_load;
|
cbs->action_ok = action_ok_remap_file_load;
|
||||||
break;
|
break;
|
||||||
case MENU_FILE_MENU_REMAP:
|
|
||||||
cbs->action_ok = action_ok_menu_remap_file_load;
|
|
||||||
break;
|
|
||||||
case MENU_FILE_SHADER_PRESET:
|
case MENU_FILE_SHADER_PRESET:
|
||||||
cbs->action_ok = action_ok_shader_preset_load;
|
cbs->action_ok = action_ok_shader_preset_load;
|
||||||
break;
|
break;
|
||||||
@ -2888,8 +2813,6 @@ static void menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
|
|||||||
cbs->action_ok = action_ok_cheat_file;
|
cbs->action_ok = action_ok_cheat_file;
|
||||||
else if (!strcmp(label, "remap_file_load"))
|
else if (!strcmp(label, "remap_file_load"))
|
||||||
cbs->action_ok = action_ok_remap_file;
|
cbs->action_ok = action_ok_remap_file;
|
||||||
else if (!strcmp(label, "remap_menu_file_load"))
|
|
||||||
cbs->action_ok = action_ok_menu_remap_file;
|
|
||||||
else if (!strcmp(label, "video_shader_parameters") ||
|
else if (!strcmp(label, "video_shader_parameters") ||
|
||||||
!strcmp(label, "video_shader_preset_parameters")
|
!strcmp(label, "video_shader_preset_parameters")
|
||||||
)
|
)
|
||||||
@ -2900,7 +2823,6 @@ static void menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
|
|||||||
!strcmp(label, "core_options") ||
|
!strcmp(label, "core_options") ||
|
||||||
!strcmp(label, "core_cheat_options") ||
|
!strcmp(label, "core_cheat_options") ||
|
||||||
!strcmp(label, "core_input_remapping_options") ||
|
!strcmp(label, "core_input_remapping_options") ||
|
||||||
!strcmp(label, "menu_input_remapping_options") ||
|
|
||||||
!strcmp(label, "core_information") ||
|
!strcmp(label, "core_information") ||
|
||||||
!strcmp(label, "disk_options") ||
|
!strcmp(label, "disk_options") ||
|
||||||
!strcmp(label, "settings") ||
|
!strcmp(label, "settings") ||
|
||||||
@ -2930,8 +2852,6 @@ static void menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
|
|||||||
cbs->action_ok = action_ok_cheat_file_save_as;
|
cbs->action_ok = action_ok_cheat_file_save_as;
|
||||||
else if (!strcmp(label, "remap_file_save_as"))
|
else if (!strcmp(label, "remap_file_save_as"))
|
||||||
cbs->action_ok = action_ok_remap_file_save_as;
|
cbs->action_ok = action_ok_remap_file_save_as;
|
||||||
else if (!strcmp(label, "remap_menu_file_save_as"))
|
|
||||||
cbs->action_ok = action_ok_menu_remap_file_save_as;
|
|
||||||
else if (!strcmp(label, "core_list"))
|
else if (!strcmp(label, "core_list"))
|
||||||
cbs->action_ok = action_ok_core_list;
|
cbs->action_ok = action_ok_core_list;
|
||||||
else if (!strcmp(label, "disk_image_append"))
|
else if (!strcmp(label, "disk_image_append"))
|
||||||
@ -3082,8 +3002,6 @@ static void menu_entries_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
|
|||||||
cbs->action_deferred_push = deferred_push_core_cheat_options;
|
cbs->action_deferred_push = deferred_push_core_cheat_options;
|
||||||
else if (!strcmp(label, "core_input_remapping_options"))
|
else if (!strcmp(label, "core_input_remapping_options"))
|
||||||
cbs->action_deferred_push = deferred_push_core_input_remapping_options;
|
cbs->action_deferred_push = deferred_push_core_input_remapping_options;
|
||||||
else if (!strcmp(label, "menu_input_remapping_options"))
|
|
||||||
cbs->action_deferred_push = deferred_push_menu_input_remapping_options;
|
|
||||||
else if (!strcmp(label, "disk_options"))
|
else if (!strcmp(label, "disk_options"))
|
||||||
cbs->action_deferred_push = deferred_push_disk_options;
|
cbs->action_deferred_push = deferred_push_disk_options;
|
||||||
else if (!strcmp(label, "core_list"))
|
else if (!strcmp(label, "core_list"))
|
||||||
|
@ -3408,12 +3408,6 @@ static bool setting_data_append_list_main_menu_options(
|
|||||||
group_info.name,
|
group_info.name,
|
||||||
subgroup_info.name);
|
subgroup_info.name);
|
||||||
|
|
||||||
CONFIG_ACTION(
|
|
||||||
"menu_input_remapping_options",
|
|
||||||
"Menu Input Remapping Options",
|
|
||||||
group_info.name,
|
|
||||||
subgroup_info.name);
|
|
||||||
|
|
||||||
if (g_extern.main_is_init)
|
if (g_extern.main_is_init)
|
||||||
{
|
{
|
||||||
if (g_extern.has_set_input_descriptors)
|
if (g_extern.has_set_input_descriptors)
|
||||||
|
Loading…
Reference in New Issue
Block a user