diff --git a/.vscode/settings.json b/.vscode/settings.json index e90ca77e4a..88513c30c2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,4 +14,5 @@ "*.in": "c", "*.rh": "c" }, + "C_Cpp.dimInactiveRegions": false, } \ No newline at end of file diff --git a/input/input_mapper.c b/input/input_mapper.c index 68bfe29e0b..42e4762040 100644 --- a/input/input_mapper.c +++ b/input/input_mapper.c @@ -103,13 +103,14 @@ void input_mapper_poll(input_mapper_t *handle) memset(handle->keys, 0, sizeof(handle->keys)); i = 0; - for (i = 0; i < 8; i++) + for (i = 0; i < MAX_USERS; i++) { for (j = 0; j < RARCH_CUSTOM_BIND_LIST_END; j++) { if (j < RETROK_LAST) { - if (input_state(i, RETRO_DEVICE_JOYPAD, 0, j) && settings->uints.input_keymapper_ids[i][j] != RETROK_UNKNOWN) + if (input_state(i, RETRO_DEVICE_JOYPAD, 0, j) && + settings->uints.input_keymapper_ids[i][j] != RETROK_UNKNOWN) { MAPPER_SET_KEY (handle, settings->uints.input_keymapper_ids[i][j]); diff --git a/input/input_remapping.c b/input/input_remapping.c index d79970f088..e820c162cd 100644 --- a/input/input_remapping.c +++ b/input/input_remapping.c @@ -194,11 +194,16 @@ bool input_remapping_save_file(const char *path) else config_unset(conf,key_ident[j]); + if (settings->uints.input_keymapper_ids[i][j] != RETROK_UNKNOWN) + config_set_int(conf, keymapper_ident[j], + settings->uints.input_keymapper_ids[i][j]); + } else { if(settings->uints.input_remap_ids[i][j] != j - RARCH_FIRST_CUSTOM_BIND) - config_set_int(conf, key_ident[j], settings->uints.input_remap_ids[i][j]); + config_set_int(conf, key_ident[j], + settings->uints.input_remap_ids[i][j]); else config_unset(conf,key_ident[j]); } diff --git a/menu/cbs/menu_cbs_get_value.c b/menu/cbs/menu_cbs_get_value.c index 9743ba6c4b..bd764c518b 100644 --- a/menu/cbs/menu_cbs_get_value.c +++ b/menu/cbs/menu_cbs_get_value.c @@ -640,15 +640,16 @@ static void menu_action_setting_disp_set_label_input_desc_kbd( if (!settings) return; - offset = type / ((MENU_SETTINGS_INPUT_DESC_KBD_END - (MENU_SETTINGS_INPUT_DESC_KBD_END - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN))) - 1; + offset = type / ((MENU_SETTINGS_INPUT_DESC_KBD_END - + (MENU_SETTINGS_INPUT_DESC_KBD_END - + MENU_SETTINGS_INPUT_DESC_KBD_BEGIN))) - 1; id = (type / (offset + 1)) - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN; remap_id = settings->uints.input_keymapper_ids[offset][id]; - RARCH_LOG("o: %d, type: %d, remap_id: %d\n", offset, type, remap_id); - - for (key_id = 0; key_id < MENU_SETTINGS_INPUT_DESC_KBD_END - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN; key_id++) + for (key_id = 0; key_id < MENU_SETTINGS_INPUT_DESC_KBD_END - + MENU_SETTINGS_INPUT_DESC_KBD_BEGIN; key_id++) { if(remap_id == key_descriptors[key_id].key) break; diff --git a/menu/cbs/menu_cbs_left.c b/menu/cbs/menu_cbs_left.c index ab5aaad644..83b7a5446b 100644 --- a/menu/cbs/menu_cbs_left.c +++ b/menu/cbs/menu_cbs_left.c @@ -119,13 +119,17 @@ static int action_left_input_desc_kbd(unsigned type, const char *label, if (!settings) return 0; - offset = type / ((MENU_SETTINGS_INPUT_DESC_KBD_END - (MENU_SETTINGS_INPUT_DESC_KBD_END - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN))) - 1; + offset = type / ((MENU_SETTINGS_INPUT_DESC_KBD_END - + (MENU_SETTINGS_INPUT_DESC_KBD_END - + MENU_SETTINGS_INPUT_DESC_KBD_BEGIN))) - 1; + id = (type / (offset + 1)) - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN; remap_id = settings->uints.input_keymapper_ids[offset][id]; - for (key_id = 0; key_id < MENU_SETTINGS_INPUT_DESC_KBD_END - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN; key_id++) + for (key_id = 0; key_id < MENU_SETTINGS_INPUT_DESC_KBD_END - + MENU_SETTINGS_INPUT_DESC_KBD_BEGIN; key_id++) { if(remap_id == key_descriptors[key_id].key) break; diff --git a/menu/cbs/menu_cbs_right.c b/menu/cbs/menu_cbs_right.c index a5d9de6188..132426f9db 100644 --- a/menu/cbs/menu_cbs_right.c +++ b/menu/cbs/menu_cbs_right.c @@ -113,13 +113,17 @@ int action_right_input_desc_kbd(unsigned type, const char *label, if (!settings) return 0; - offset = type / ((MENU_SETTINGS_INPUT_DESC_KBD_END - (MENU_SETTINGS_INPUT_DESC_KBD_END - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN))) - 1; + offset = type / ((MENU_SETTINGS_INPUT_DESC_KBD_END - + (MENU_SETTINGS_INPUT_DESC_KBD_END - + MENU_SETTINGS_INPUT_DESC_KBD_BEGIN))) - 1; + id = (type / (offset + 1)) - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN; remap_id = settings->uints.input_keymapper_ids[offset][id]; - for (key_id = 0; key_id < MENU_SETTINGS_INPUT_DESC_KBD_END - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN; key_id++) + for (key_id = 0; key_id < MENU_SETTINGS_INPUT_DESC_KBD_END - + MENU_SETTINGS_INPUT_DESC_KBD_BEGIN; key_id++) { if(remap_id == key_descriptors[key_id].key) break; diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index f6dfda3a9e..81403b20a6 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -439,7 +439,10 @@ static int action_bind_sublabel_remap_sublabel( if (!settings) return 0; - offset = type / ((MENU_SETTINGS_INPUT_DESC_KBD_END - (MENU_SETTINGS_INPUT_DESC_KBD_END - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN))) - 1; + offset = type / ((MENU_SETTINGS_INPUT_DESC_KBD_END - + (MENU_SETTINGS_INPUT_DESC_KBD_END - + MENU_SETTINGS_INPUT_DESC_KBD_BEGIN))) - 1; + snprintf(s, len, "User #%d: %s", offset + 1, input_config_get_device_display_name(offset) ? input_config_get_device_display_name(offset) : diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 8f026068fd..207ea58981 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -3276,7 +3276,7 @@ static int menu_displaylist_parse_options_remappings( settings_t *settings = config_get_ptr(); unsigned device; - for (int i = 0; i < 8; i++) + for (int i = 0; i < MAX_USERS; i++) { device = settings->uints.input_libretro_device[i]; device &= RETRO_DEVICE_MASK;