mirror of
https://github.com/libretro/RetroArch
synced 2025-02-19 12:41:00 +00:00
Merge pull request #1615 from fr500/master
Now the list shows all the retropad buttons
This commit is contained in:
commit
a08a8b8800
@ -45,7 +45,7 @@ bool input_remapping_load_file(const char *path)
|
||||
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"};
|
||||
"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"};
|
||||
|
||||
snprintf(buf, sizeof(buf), "input_player%u", i + 1);
|
||||
|
||||
@ -70,7 +70,7 @@ bool input_remapping_load_file(const char *path)
|
||||
*
|
||||
* Saves remapping values to file.
|
||||
*
|
||||
* Returns: true (1) if successfull, otherwise false (0).
|
||||
* Returns: true (1) if successful, otherwise false (0).
|
||||
**/
|
||||
bool input_remapping_save_file(const char *path)
|
||||
{
|
||||
@ -90,15 +90,16 @@ bool input_remapping_save_file(const char *path)
|
||||
|
||||
if (!conf)
|
||||
{
|
||||
conf = config_file_new(NULL);
|
||||
return false;
|
||||
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"};
|
||||
"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" };
|
||||
|
||||
snprintf(buf, sizeof(buf), "input_player%u", i + 1);
|
||||
|
||||
|
@ -40,7 +40,7 @@ bool input_remapping_load_file(const char *path);
|
||||
*
|
||||
* Saves remapping values to file.
|
||||
*
|
||||
* Returns: true (1) if successfull, otherwise false (0).
|
||||
* Returns: true (1) if successful, otherwise false (0).
|
||||
**/
|
||||
bool input_remapping_save_file(const char *path);
|
||||
|
||||
|
@ -433,11 +433,11 @@ static int16_t input_state(unsigned port, unsigned device,
|
||||
|
||||
if (settings->input.remap_binds_enable)
|
||||
{
|
||||
if (id < RARCH_FIRST_CUSTOM_BIND)
|
||||
if (id < RARCH_FIRST_META_KEY)
|
||||
id = settings->input.remap_ids[port][id];
|
||||
}
|
||||
|
||||
if (!driver->block_libretro_input)
|
||||
|
||||
{
|
||||
if (((id < RARCH_FIRST_META_KEY) || (device == RETRO_DEVICE_KEYBOARD)))
|
||||
res = input_driver_state(libretro_input_binds, port, device, idx, id);
|
||||
|
@ -1428,7 +1428,7 @@ static int deferred_push_core_input_remapping_options(void *data, void *userdata
|
||||
|
||||
for (p = 0; p < settings->input.max_users; p++)
|
||||
{
|
||||
for (retro_id = 0; retro_id < RARCH_FIRST_CUSTOM_BIND; retro_id++)
|
||||
for (retro_id = 0; retro_id < RARCH_FIRST_META_KEY; retro_id++)
|
||||
{
|
||||
char desc_label[64];
|
||||
unsigned user = p + 1;
|
||||
@ -1441,7 +1441,7 @@ static int deferred_push_core_input_remapping_options(void *data, void *userdata
|
||||
"User %u %s : ", user, description);
|
||||
menu_list_push(list, desc_label, "",
|
||||
MENU_SETTINGS_INPUT_DESC_BEGIN +
|
||||
(p * RARCH_FIRST_CUSTOM_BIND) + retro_id, 0);
|
||||
(p * RARCH_FIRST_META_KEY) + retro_id, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -345,9 +345,9 @@ 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_CUSTOM_BIND;
|
||||
RARCH_FIRST_META_KEY;
|
||||
unsigned inp_desc_button_index_offset = inp_desc_index_offset -
|
||||
(inp_desc_user * RARCH_FIRST_CUSTOM_BIND);
|
||||
(inp_desc_user * RARCH_FIRST_META_KEY);
|
||||
unsigned remap_id = settings->input.remap_ids
|
||||
[inp_desc_user][inp_desc_button_index_offset];
|
||||
|
||||
|
@ -68,8 +68,8 @@ 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_CUSTOM_BIND;
|
||||
unsigned inp_desc_button_index_offset = inp_desc_index_offset - (inp_desc_user * RARCH_FIRST_CUSTOM_BIND);
|
||||
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);
|
||||
|
||||
(void)label;
|
||||
(void)action;
|
||||
|
@ -116,8 +116,8 @@ static int action_toggle_input_desc(unsigned type, const char *label,
|
||||
unsigned action, bool wraparound)
|
||||
{
|
||||
unsigned inp_desc_index_offset = type - MENU_SETTINGS_INPUT_DESC_BEGIN;
|
||||
unsigned inp_desc_user = inp_desc_index_offset / RARCH_FIRST_CUSTOM_BIND;
|
||||
unsigned inp_desc_button_index_offset = inp_desc_index_offset - (inp_desc_user * RARCH_FIRST_CUSTOM_BIND);
|
||||
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);
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
switch (action)
|
||||
@ -127,7 +127,7 @@ static int action_toggle_input_desc(unsigned type, const char *label,
|
||||
settings->input.remap_ids[inp_desc_user][inp_desc_button_index_offset]--;
|
||||
break;
|
||||
case MENU_ACTION_RIGHT:
|
||||
if (settings->input.remap_ids[inp_desc_user][inp_desc_button_index_offset] < RARCH_FIRST_CUSTOM_BIND)
|
||||
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]++;
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user