allow remapping of analog axis, only works axis to axis

This commit is contained in:
Toad King 2015-05-20 21:11:20 -05:00
parent 16a80243aa
commit 0cd7562fb8
7 changed files with 166 additions and 107 deletions

View File

@ -43,20 +43,29 @@ bool input_remapping_load_file(const char *path)
for (i = 0; i < MAX_USERS; i++)
{
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", "l_x_plus", "l_x_minus", "l_y_plus", "l_y_minus", "r_x_plus", "r_x_minus", "r_y_plus", "r_y_minus"};
char key_ident[RARCH_FIRST_CUSTOM_BIND + 4][128];
char key_strings[RARCH_FIRST_CUSTOM_BIND + 4][128] = { "b", "y", "select", "start",
"up", "down", "left", "right", "a", "x", "l", "r", "l2", "r2", "l3", "r3", "l_x", "l_y", "r_x", "r_y" };
snprintf(buf, sizeof(buf), "input_player%u", i + 1);
for (j = 0; j < RARCH_FIRST_META_KEY; j++)
for (j = 0; j < RARCH_FIRST_CUSTOM_BIND + 4; 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))
if (config_get_int(conf, key_ident[j], &key_remap) && key_remap < RARCH_FIRST_CUSTOM_BIND)
settings->input.remap_ids[i][j] = key_remap;
}
for (j = 0; j < 4; j++)
{
int key_remap = -1;
snprintf(key_ident[RARCH_FIRST_CUSTOM_BIND + j], sizeof(key_ident[RARCH_FIRST_CUSTOM_BIND + j]), "%s_%s", buf, key_strings[RARCH_FIRST_CUSTOM_BIND + j]);
if (config_get_int(conf, key_ident[RARCH_FIRST_CUSTOM_BIND + j], &key_remap) && key_remap < 4)
settings->input.remap_ids[i][RARCH_FIRST_CUSTOM_BIND + j] = key_remap;
}
}
config_file_free(conf);
@ -90,20 +99,20 @@ bool input_remapping_save_file(const char *path)
if (!conf)
{
conf = config_file_new(NULL);
conf = config_file_new(NULL);
if (!conf)
return false;
}
for (i = 0; i < settings->input.max_users; i++)
{
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", "l_x_plus" , "l_x_minus", "l_y_plus", "l_y_minus", "r_x_plus", "r_x_minus", "r_y_plus", "r_y_minus" };
char key_ident[RARCH_FIRST_CUSTOM_BIND + 4][128];
char key_strings[RARCH_FIRST_CUSTOM_BIND + 4][128] = { "b", "y", "select", "start",
"up", "down", "left", "right", "a", "x", "l", "r", "l2", "r2", "l3", "r3", "l_x", "l_y", "r_x", "r_y" };
snprintf(buf, sizeof(buf), "input_player%u", i + 1);
for (j = 0; j < RARCH_FIRST_META_KEY; j++)
for (j = 0; j < RARCH_FIRST_CUSTOM_BIND + 4; j++)
{
snprintf(key_ident[j], sizeof(key_ident[j]), "%s_%s", buf, key_strings[j]);
config_set_int(conf, key_ident[j], settings->input.remap_ids[i][j]);
@ -123,16 +132,32 @@ void input_remapping_set_defaults(void)
for (i = 0; i < MAX_USERS; i++)
{
for (j = 0; j < RARCH_BIND_LIST_END; j++)
for (j = 0; j < RARCH_FIRST_CUSTOM_BIND; j++)
settings->input.remap_ids[i][j] = settings->input.binds[i][j].id;
for (j = 0; j < 4; j++)
settings->input.remap_ids[i][RARCH_FIRST_CUSTOM_BIND + j] = j;
}
}
void input_remapping_state(unsigned port,
unsigned *device, unsigned *idx, unsigned *id)
{
settings_t *settings = config_get_ptr();
settings_t *settings = config_get_ptr();
if (*id < RARCH_FIRST_META_KEY)
*id = settings->input.remap_ids[port][*id];
switch (*device)
{
case RETRO_DEVICE_JOYPAD:
if (*id < RARCH_FIRST_CUSTOM_BIND)
*id = settings->input.remap_ids[port][*id];
break;
case RETRO_DEVICE_ANALOG:
if (*idx < 2 && *id < 2)
{
unsigned new_id = RARCH_FIRST_CUSTOM_BIND + (*idx * 2 + *id);
new_id = settings->input.remap_ids[port][new_id];
*idx = (new_id & 2) >> 1;
*id = new_id & 1;
}
break;
}
}

View File

@ -1,7 +1,7 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2015 - Daniel De Matteis
*
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
@ -36,6 +36,10 @@
#define RETRO_LBL_JOYPAD_L3 "RetroPad L3 Button"
#define RETRO_LBL_JOYPAD_R3 "RetroPad R3 Button"
#define RETRO_LBL_TURBO_ENABLE "Turbo Enable"
#define RETRO_LBL_ANALOG_LEFT_X "Left Analog X"
#define RETRO_LBL_ANALOG_LEFT_Y "Left Analog Y"
#define RETRO_LBL_ANALOG_RIGHT_X "Right Analog X"
#define RETRO_LBL_ANALOG_RIGHT_Y "Right Analog Y"
#define RETRO_LBL_ANALOG_LEFT_X_PLUS "Left Analog X +"
#define RETRO_LBL_ANALOG_LEFT_X_MINUS "Left Analog X -"
#define RETRO_LBL_ANALOG_LEFT_Y_PLUS "Left Analog Y +"
@ -112,7 +116,7 @@
#define RETRO_LOG_REWIND_REACHED_END RETRO_MSG_REWIND_REACHED_END TERM_STR
#define RETRO_LOG_MOVIE_RECORD_STOPPING RETRO_MSG_MOVIE_RECORD_STOPPING TERM_STR
#define RETRO_LOG_MOVIE_PLAYBACK_ENDED RETRO_MSG_MOVIE_PLAYBACK_ENDED TERM_STR
#define RETRO_LOG_LIBRETRO_ABI_BREAK RETRO_MSG_LIBRETRO_ABI_BREAK RETRO_FRONTEND TERM_STR
#define RETRO_LOG_LIBRETRO_ABI_BREAK RETRO_MSG_LIBRETRO_ABI_BREAK RETRO_FRONTEND TERM_STR
#define RETRO_LOG_RESETTING_CONTENT RETRO_MSG_RESETTING_CONTENT TERM_STR
#define RETRO_LOG_REWIND_INIT RETRO_MSG_REWIND_INIT TERM_STR
#define RETRO_LOG_REWIND_INIT_FAILED RETRO_MSG_REWIND_INIT_FAILED TERM_STR

View File

@ -296,7 +296,7 @@ static int menu_displaylist_parse_core_info(menu_displaylist_info_t *info)
if (core_info->firmware[i].desc)
{
snprintf(tmp, sizeof(tmp), " name: %s",
core_info->firmware[i].desc ?
core_info->firmware[i].desc ?
core_info->firmware[i].desc : "");
menu_list_push(info->list, tmp, "",
MENU_SETTINGS_CORE_INFO_NONE, 0);
@ -394,7 +394,7 @@ static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
MENU_SETTINGS_CORE_INFO_NONE, 0);
}
snprintf(tmp, sizeof(tmp), "RetroRating level: %d",
snprintf(tmp, sizeof(tmp), "RetroRating level: %d",
frontend->get_rating ? frontend->get_rating() : -1);
menu_list_push(info->list, tmp, "",
MENU_SETTINGS_CORE_INFO_NONE, 0);
@ -447,7 +447,7 @@ static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
float val = 0.0f;
if (gfx_ctx_get_metrics(DISPLAY_METRIC_MM_WIDTH, &val))
{
snprintf(tmp, sizeof(tmp), "Display metric width (mm): %.2f",
snprintf(tmp, sizeof(tmp), "Display metric width (mm): %.2f",
val);
menu_list_push(info->list, tmp, "",
MENU_SETTINGS_CORE_INFO_NONE, 0);
@ -455,7 +455,7 @@ static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
if (gfx_ctx_get_metrics(DISPLAY_METRIC_MM_HEIGHT, &val))
{
snprintf(tmp, sizeof(tmp), "Display metric height (mm): %.2f",
snprintf(tmp, sizeof(tmp), "Display metric height (mm): %.2f",
val);
menu_list_push(info->list, tmp, "",
MENU_SETTINGS_CORE_INFO_NONE, 0);
@ -463,7 +463,7 @@ static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
if (gfx_ctx_get_metrics(DISPLAY_METRIC_DPI, &val))
{
snprintf(tmp, sizeof(tmp), "Display metric DPI: %.2f",
snprintf(tmp, sizeof(tmp), "Display metric DPI: %.2f",
val);
menu_list_push(info->list, tmp, "",
MENU_SETTINGS_CORE_INFO_NONE, 0);
@ -719,7 +719,7 @@ static int menu_displaylist_parse_historylist(menu_displaylist_info_t *info)
char path_copy[PATH_MAX_LENGTH];
const char *core_name = NULL;
const char *path = NULL;
strlcpy(path_copy, info->path, sizeof(path_copy));
path = path_copy;
@ -1048,13 +1048,13 @@ static int menu_displaylist_parse_database_entry(menu_displaylist_info_t *info)
}
snprintf(tmp, sizeof(tmp),
"Analog supported: %s",
(db_info_entry->analog_supported == 1) ? "true" :
(db_info_entry->analog_supported == 1) ? "true" :
(db_info_entry->analog_supported == -1) ? "N/A" : "false");
menu_list_push(info->list, tmp, "rdb_entry_analog",
0, 0);
snprintf(tmp, sizeof(tmp),
"Rumble supported: %s",
(db_info_entry->rumble_supported == 1) ? "true" :
(db_info_entry->rumble_supported == 1) ? "true" :
(db_info_entry->rumble_supported == -1) ? "N/A" : "false");
menu_list_push(info->list, tmp, "rdb_entry_rumble",
0, 0);
@ -1088,7 +1088,7 @@ static int menu_displaylist_parse_database_entry(menu_displaylist_info_t *info)
char elem0[PATH_MAX_LENGTH], elem1[PATH_MAX_LENGTH];
bool match_found = false;
struct string_list *tmp_str_list = string_split(
playlist->entries[j].core_name, "|");
playlist->entries[j].core_name, "|");
if (!tmp_str_list)
continue;
@ -1141,12 +1141,12 @@ static int menu_database_push_query(libretrodb_t *db,
{
unsigned i;
struct rmsgpack_dom_value item;
while (libretrodb_cursor_read_item(cur, &item) == 0)
{
if (item.type != RDT_MAP)
continue;
for (i = 0; i < item.map.len; i++)
{
struct rmsgpack_dom_value *key = &item.map.items[i].key;
@ -1154,7 +1154,7 @@ static int menu_database_push_query(libretrodb_t *db,
if (!key || !val)
continue;
if (!strcmp(key->string.buff, "name"))
{
menu_list_push(list, val->string.buff, db->path,
@ -1163,7 +1163,7 @@ static int menu_database_push_query(libretrodb_t *db,
}
}
}
return 0;
}
#endif
@ -1219,7 +1219,7 @@ static int menu_displaylist_parse_settings(menu_handle_t *menu,
{
rarch_setting_t *setting = NULL;
settings_t *settings = config_get_ptr();
if (menu && menu->list_settings)
settings_list_free(menu->list_settings);
@ -1233,10 +1233,10 @@ static int menu_displaylist_parse_settings(menu_handle_t *menu,
for (; setting->type != ST_END_GROUP; setting++)
{
if (
setting->type == ST_GROUP
setting->type == ST_GROUP
|| setting->type == ST_SUB_GROUP
|| setting->type == ST_END_SUB_GROUP
|| (setting->flags & SD_FLAG_ADVANCED &&
|| (setting->flags & SD_FLAG_ADVANCED &&
!settings->menu.show_advanced_settings)
)
continue;
@ -1327,7 +1327,7 @@ static void menu_displaylist_push_horizontal_menu_list_content(
for (j = 0; j < str_list->size; j++)
{
const char *name = str_list->elems[j].data;
if (!name)
continue;
@ -1384,7 +1384,7 @@ static int menu_displaylist_push_horizontal_menu_list_cores(
}
static int menu_displaylist_parse_horizontal_list(menu_displaylist_info_t *info)
static int menu_displaylist_parse_horizontal_list(menu_displaylist_info_t *info)
{
core_info_t *core_info = NULL;
global_t *global = global_get_ptr();
@ -1519,15 +1519,20 @@ static int menu_displaylist_parse_options_remappings(menu_displaylist_info_t *in
menu_list_push(info->list, "Save Core Remap File",
"remap_file_save_core", MENU_SETTING_ACTION, 0);
menu_list_push(info->list, "Save Game Remap File",
"remap_file_save_game", MENU_SETTING_ACTION, 0);
"remap_file_save_game", MENU_SETTING_ACTION, 0);
for (p = 0; p < settings->input.max_users; p++)
{
for (retro_id = 0; retro_id < RARCH_FIRST_META_KEY; retro_id++)
for (retro_id = 0; retro_id < RARCH_FIRST_CUSTOM_BIND + 4; retro_id++)
{
char desc_label[64];
unsigned user = p + 1;
const char *description = global->system.input_desc_btn[p][retro_id];
unsigned desc_offset = retro_id;
if (desc_offset >= RARCH_FIRST_CUSTOM_BIND)
desc_offset = RARCH_FIRST_CUSTOM_BIND + (desc_offset - RARCH_FIRST_CUSTOM_BIND) * 2;
const char *description = global->system.input_desc_btn[p][desc_offset];
if (!description)
continue;
@ -1535,7 +1540,7 @@ static int menu_displaylist_parse_options_remappings(menu_displaylist_info_t *in
snprintf(desc_label, sizeof(desc_label),
"User %u %s : ", user, description);
menu_list_push(info->list, desc_label, "",
MENU_SETTINGS_INPUT_DESC_BEGIN +
MENU_SETTINGS_INPUT_DESC_BEGIN +
(p * RARCH_FIRST_META_KEY) + retro_id, 0);
}
}
@ -1612,7 +1617,7 @@ static int menu_displaylist_parse(menu_displaylist_info_t *info,
return 0;
ret = deferred_push_video_shader_parameters_common(info, shader,
(type == DISPLAYLIST_SHADER_PARAMETERS)
(type == DISPLAYLIST_SHADER_PARAMETERS)
? MENU_SETTINGS_SHADER_PARAMETER_0 : MENU_SETTINGS_SHADER_PRESET_PARAMETER_0
);
@ -1637,11 +1642,11 @@ static int menu_displaylist_parse(menu_displaylist_info_t *info,
case DISPLAYLIST_PERFCOUNTERS_CORE:
case DISPLAYLIST_PERFCOUNTERS_FRONTEND:
ret = menu_displaylist_push_perfcounter_generic(info,
(type == DISPLAYLIST_PERFCOUNTERS_CORE) ?
(type == DISPLAYLIST_PERFCOUNTERS_CORE) ?
perf_counters_libretro : perf_counters_rarch,
(type == DISPLAYLIST_PERFCOUNTERS_CORE) ?
perf_ptr_libretro : perf_ptr_rarch ,
(type == DISPLAYLIST_PERFCOUNTERS_CORE) ?
perf_ptr_libretro : perf_ptr_rarch ,
(type == DISPLAYLIST_PERFCOUNTERS_CORE) ?
MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN : MENU_SETTINGS_PERF_COUNTERS_BEGIN);
*need_refresh = false;
@ -1827,14 +1832,14 @@ static int menu_displaylist_parse(menu_displaylist_info_t *info,
#endif
path_is_compressed = path_is_compressed_file(info->path);
push_dir = (info->setting
push_dir = (info->setting
&& info->setting->browser_selection_type == ST_DIR);
if (path_is_compressed)
str_list = compressed_file_list_new(info->path, info->exts);
else
str_list = dir_list_new(info->path,
settings->menu.navigation.browser.filter.supported_extensions_enable
settings->menu.navigation.browser.filter.supported_extensions_enable
? info->exts : NULL, true);
if (push_dir)
@ -2073,7 +2078,7 @@ int menu_displaylist_push(file_list_t *list, file_list_t *menu_list)
info.type = type;
strlcpy(info.path, path, sizeof(info.path));
strlcpy(info.label, label, sizeof(info.label));
return menu_displaylist_deferred_push(&info);
}

View File

@ -41,7 +41,7 @@ static int shader_action_parameter_left(unsigned type, const char *label,
{
#ifdef HAVE_SHADER_MANAGER
struct video_shader *shader = video_shader_driver_get_current_shader();
struct video_shader_parameter *param =
struct video_shader_parameter *param =
&shader->parameters[type - MENU_SETTINGS_SHADER_PARAMETER_0];
shader_action_parameter_left_common(param, shader);
@ -86,8 +86,8 @@ static int action_left_input_desc(unsigned type, const char *label,
bool wraparound)
{
unsigned inp_desc_index_offset = type - MENU_SETTINGS_INPUT_DESC_BEGIN;
unsigned inp_desc_user = inp_desc_index_offset / RARCH_FIRST_META_KEY;
unsigned inp_desc_button_index_offset = inp_desc_index_offset - (inp_desc_user * RARCH_FIRST_META_KEY);
unsigned inp_desc_user = inp_desc_index_offset / (RARCH_FIRST_CUSTOM_BIND + 4);
unsigned inp_desc_button_index_offset = inp_desc_index_offset - (inp_desc_user * (RARCH_FIRST_CUSTOM_BIND + 4));
settings_t *settings = config_get_ptr();
if (settings->input.remap_ids[inp_desc_user][inp_desc_button_index_offset] > 0)
@ -152,7 +152,7 @@ static int action_left_mainmenu(unsigned type, const char *label,
}
}
}
else
else
push_list = 2;
cbs = menu_list_get_actiondata_at_offset(menu_list->selection_buf,
@ -189,7 +189,7 @@ static int action_left_shader_scale_pass(unsigned type, const char *label,
menu_handle_t *menu = menu_driver_get_ptr();
if (!menu)
return -1;
shader = menu->shader;
if (!shader)
return -1;
@ -220,7 +220,7 @@ static int action_left_shader_filter_pass(unsigned type, const char *label,
menu_handle_t *menu = menu_driver_get_ptr();
if (!menu)
return -1;
shader = menu->shader;
if (!shader)
return -1;
@ -280,7 +280,7 @@ static int action_left_shader_num_passes(unsigned type, const char *label,
menu_handle_t *menu = menu_driver_get_ptr();
if (!menu)
return -1;
shader = menu->shader;
if (!shader)
return -1;
@ -298,9 +298,9 @@ static int action_left_shader_num_passes(unsigned type, const char *label,
static int action_left_video_resolution(unsigned type, const char *label,
bool wraparound)
{
{
global_t *global = global_get_ptr();
(void)global;
#if defined(__CELLOS_LV2__)

View File

@ -21,6 +21,14 @@
#include "../performance.h"
#include "../settings.h"
#include "../intl/intl.h"
const char axis_labels[4][128] = {
RETRO_LBL_ANALOG_LEFT_X,
RETRO_LBL_ANALOG_LEFT_Y,
RETRO_LBL_ANALOG_RIGHT_X,
RETRO_LBL_ANALOG_RIGHT_Y
};
static void menu_action_setting_disp_set_label_cheat_num_passes(
file_list_t* list,
@ -345,15 +353,20 @@ static void menu_action_setting_disp_set_label_input_desc(
{
settings_t *settings = config_get_ptr();
unsigned inp_desc_index_offset = type - MENU_SETTINGS_INPUT_DESC_BEGIN;
unsigned inp_desc_user = inp_desc_index_offset /
RARCH_FIRST_META_KEY;
unsigned inp_desc_button_index_offset = inp_desc_index_offset -
(inp_desc_user * RARCH_FIRST_META_KEY);
unsigned inp_desc_user = inp_desc_index_offset /
(RARCH_FIRST_CUSTOM_BIND + 4);
unsigned inp_desc_button_index_offset = inp_desc_index_offset -
(inp_desc_user * (RARCH_FIRST_CUSTOM_BIND + 4));
unsigned remap_id = settings->input.remap_ids
[inp_desc_user][inp_desc_button_index_offset];
snprintf(type_str, type_str_size, "%s",
settings->input.binds[inp_desc_user][remap_id].desc);
if (inp_desc_button_index_offset < RARCH_FIRST_CUSTOM_BIND)
snprintf(type_str, type_str_size, "%s",
settings->input.binds[inp_desc_user][remap_id].desc);
else
snprintf(type_str, type_str_size, "%s",
axis_labels[remap_id]);
*w = 19;
strlcpy(path_buf, path, path_buf_size);
}
@ -411,7 +424,7 @@ static void menu_action_setting_disp_set_label_perf_counters(
char *path_buf, size_t path_buf_size)
{
menu_handle_t *menu = menu_driver_get_ptr();
const struct retro_perf_counter **counters =
const struct retro_perf_counter **counters =
(const struct retro_perf_counter **)perf_counters_rarch;
unsigned offset = type - MENU_SETTINGS_PERF_COUNTERS_BEGIN;
@ -435,7 +448,7 @@ static void menu_action_setting_disp_set_label_libretro_perf_counters(
char *path_buf, size_t path_buf_size)
{
menu_handle_t *menu = menu_driver_get_ptr();
const struct retro_perf_counter **counters =
const struct retro_perf_counter **counters =
(const struct retro_perf_counter **)perf_counters_libretro;
unsigned offset = type - MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN;
@ -782,33 +795,33 @@ void menu_entries_cbs_init_bind_get_string_representation(menu_file_list_cbs_t *
if (type >= MENU_SETTINGS_INPUT_DESC_BEGIN
&& type <= MENU_SETTINGS_INPUT_DESC_END)
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_input_desc;
else if (type >= MENU_SETTINGS_CHEAT_BEGIN
&& type <= MENU_SETTINGS_CHEAT_END)
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_cheat;
else if (type >= MENU_SETTINGS_PERF_COUNTERS_BEGIN
&& type <= MENU_SETTINGS_PERF_COUNTERS_END)
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_perf_counters;
else if (type >= MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN
&& type <= MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_END)
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_libretro_perf_counters;
else if (type >= MENU_SETTINGS_SHADER_PRESET_PARAMETER_0
&& type <= MENU_SETTINGS_SHADER_PRESET_PARAMETER_LAST)
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_shader_preset_parameter;
else if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
&& type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_shader_parameter;
else if (!strcmp(label, "cheat_num_passes"))
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_cheat_num_passes;
else if (!strcmp(label, "remap_file_load"))
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_remap_file_load;
else if (!strcmp(label, "video_shader_filter_pass"))
cbs->action_get_representation =
@ -836,87 +849,87 @@ void menu_entries_cbs_init_bind_get_string_representation(menu_file_list_cbs_t *
switch (type)
{
case MENU_FILE_CORE:
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_menu_file_core;
break;
case MENU_FILE_PLAIN:
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_menu_file_plain;
break;
case MENU_FILE_IMAGE:
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_menu_file_image;
break;
case MENU_FILE_USE_DIRECTORY:
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_menu_file_use_directory;
break;
case MENU_FILE_DIRECTORY:
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_menu_file_directory;
break;
case MENU_FILE_CARCHIVE:
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_menu_file_carchive;
break;
case MENU_FILE_OVERLAY:
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_menu_file_overlay;
break;
case MENU_FILE_FONT:
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_menu_file_font;
break;
case MENU_FILE_SHADER:
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_menu_file_shader;
break;
case MENU_FILE_SHADER_PRESET:
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_menu_file_shader_preset;
break;
case MENU_FILE_CONFIG:
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_menu_file_config;
break;
case MENU_FILE_IN_CARCHIVE:
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_menu_file_in_carchive;
break;
case MENU_FILE_VIDEOFILTER:
case MENU_FILE_AUDIOFILTER:
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_menu_file_filter;
break;
case MENU_FILE_DOWNLOAD_CORE:
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_menu_file_url;
break;
case MENU_FILE_RDB:
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_menu_file_rdb;
break;
case MENU_FILE_CURSOR:
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_menu_file_cursor;
break;
case MENU_FILE_CHEAT:
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_menu_file_cheat;
break;
case MENU_SETTING_SUBGROUP:
case MENU_SETTINGS_CUSTOM_VIEWPORT:
case MENU_SETTINGS_CUSTOM_BIND_ALL:
case MENU_SETTINGS_CUSTOM_BIND_DEFAULT_ALL:
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_menu_more;
break;
case MENU_SETTINGS_CORE_DISK_OPTIONS_DISK_INDEX:
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_menu_disk_index;
break;
case MENU_SETTINGS_VIDEO_RESOLUTION:
cbs->action_get_representation =
cbs->action_get_representation =
menu_action_setting_disp_set_label_menu_video_resolution;
break;
default:

View File

@ -40,7 +40,7 @@ static int shader_action_parameter_right(unsigned type, const char *label, bool
{
#ifdef HAVE_SHADER_MANAGER
struct video_shader *shader = video_shader_driver_get_current_shader();
struct video_shader_parameter *param =
struct video_shader_parameter *param =
&shader->parameters[type - MENU_SETTINGS_SHADER_PARAMETER_0];
shader_action_parameter_right_common(param, shader);
@ -85,12 +85,20 @@ static int action_right_input_desc(unsigned type, const char *label,
bool wraparound)
{
unsigned inp_desc_index_offset = type - MENU_SETTINGS_INPUT_DESC_BEGIN;
unsigned inp_desc_user = inp_desc_index_offset / RARCH_FIRST_META_KEY;
unsigned inp_desc_button_index_offset = inp_desc_index_offset - (inp_desc_user * RARCH_FIRST_META_KEY);
unsigned inp_desc_user = inp_desc_index_offset / (RARCH_FIRST_CUSTOM_BIND + 4);
unsigned inp_desc_button_index_offset = inp_desc_index_offset - (inp_desc_user * (RARCH_FIRST_CUSTOM_BIND + 4));
settings_t *settings = config_get_ptr();
if (settings->input.remap_ids[inp_desc_user][inp_desc_button_index_offset] < RARCH_FIRST_META_KEY)
settings->input.remap_ids[inp_desc_user][inp_desc_button_index_offset]++;
if (inp_desc_button_index_offset < RARCH_FIRST_CUSTOM_BIND)
{
if (settings->input.remap_ids[inp_desc_user][inp_desc_button_index_offset] < RARCH_FIRST_CUSTOM_BIND - 1)
settings->input.remap_ids[inp_desc_user][inp_desc_button_index_offset]++;
}
else
{
if (settings->input.remap_ids[inp_desc_user][inp_desc_button_index_offset] < 4 - 1)
settings->input.remap_ids[inp_desc_user][inp_desc_button_index_offset]++;
}
return 0;
}
@ -150,7 +158,7 @@ static int action_right_mainmenu(unsigned type, const char *label,
push_list = 1;
}
}
else
else
push_list = 2;
cbs = menu_list_get_actiondata_at_offset(menu_list->selection_buf,
@ -187,7 +195,7 @@ static int action_right_shader_scale_pass(unsigned type, const char *label,
menu_handle_t *menu = menu_driver_get_ptr();
if (!menu)
return -1;
shader = menu->shader;
if (!shader)
return -1;
@ -218,7 +226,7 @@ static int action_right_shader_filter_pass(unsigned type, const char *label,
menu_handle_t *menu = menu_driver_get_ptr();
if (!menu)
return -1;
shader = menu->shader;
if (!shader)
return -1;
@ -274,7 +282,7 @@ static int action_right_shader_num_passes(unsigned type, const char *label,
menu_handle_t *menu = menu_driver_get_ptr();
if (!menu)
return -1;
shader = menu->shader;
if (!shader)
return -1;
@ -292,9 +300,9 @@ static int action_right_shader_num_passes(unsigned type, const char *label,
static int action_right_video_resolution(unsigned type, const char *label,
bool wraparound)
{
{
global_t *global = global_get_ptr();
(void)global;
#if defined(__CELLOS_LV2__)

View File

@ -62,13 +62,17 @@ static int action_start_input_desc(unsigned type, const char *label)
{
settings_t *settings = config_get_ptr();
unsigned inp_desc_index_offset = type - MENU_SETTINGS_INPUT_DESC_BEGIN;
unsigned inp_desc_user = inp_desc_index_offset / RARCH_FIRST_META_KEY;
unsigned inp_desc_button_index_offset = inp_desc_index_offset - (inp_desc_user * RARCH_FIRST_META_KEY);
unsigned inp_desc_user = inp_desc_index_offset / (RARCH_FIRST_CUSTOM_BIND + 4);
unsigned inp_desc_button_index_offset = inp_desc_index_offset - (inp_desc_user * (RARCH_FIRST_CUSTOM_BIND + 4));
(void)label;
settings->input.remap_ids[inp_desc_user][inp_desc_button_index_offset] =
settings->input.binds[inp_desc_user][inp_desc_button_index_offset].id;
if (inp_desc_button_index_offset < RARCH_FIRST_CUSTOM_BIND)
settings->input.remap_ids[inp_desc_user][inp_desc_button_index_offset] =
settings->input.binds[inp_desc_user][inp_desc_button_index_offset].id;
else
settings->input.remap_ids[inp_desc_user][inp_desc_button_index_offset] =
inp_desc_button_index_offset - RARCH_FIRST_CUSTOM_BIND;
return 0;
}
@ -168,7 +172,7 @@ static int action_start_shader_filter_pass(unsigned type, const char *label)
menu_handle_t *menu = menu_driver_get_ptr();
if (!menu)
return -1;
shader = menu->shader;
if (!shader)
return -1;
@ -189,7 +193,7 @@ static int action_start_shader_num_passes(unsigned type, const char *label)
menu_handle_t *menu = menu_driver_get_ptr();
if (!menu)
return -1;
shader = menu->shader;
if (!shader)
return -1;