diff --git a/menu/disp/shared.h b/menu/disp/shared.h index 5e91b03953..c67bade2c9 100644 --- a/menu/disp/shared.h +++ b/menu/disp/shared.h @@ -62,6 +62,8 @@ static void get_title(const char *label, const char *dir, strlcpy(title, "CORE OPTIONS", sizeof_title); else if (!strcmp(label, "core_cheat_options")) strlcpy(title, "CORE CHEAT OPTIONS", sizeof_title); + else if (!strcmp(label, "core_input_remapping_options")) + strlcpy(title, "CORE INPUT REMAPPING OPTIONS", sizeof_title); else if (!strcmp(label, "core_information")) strlcpy(title, "CORE INFO", sizeof_title); else if (!strcmp(label, "Privacy Options")) diff --git a/menu/menu_common.h b/menu/menu_common.h index e6e7424638..a660fa1fe9 100644 --- a/menu/menu_common.h +++ b/menu/menu_common.h @@ -149,6 +149,8 @@ typedef enum MENU_SETTINGS_PERF_COUNTERS_END = MENU_SETTINGS_PERF_COUNTERS_BEGIN + (MAX_COUNTERS - 1), MENU_SETTINGS_CHEAT_BEGIN, MENU_SETTINGS_CHEAT_END = MENU_SETTINGS_CHEAT_BEGIN + (MAX_CHEAT_COUNTERS - 1), + MENU_SETTINGS_INPUT_DESC_BEGIN, + MENU_SETTINGS_INPUT_DESC_END = MENU_SETTINGS_INPUT_DESC_BEGIN + (RARCH_MENU_TOGGLE), } menu_settings_t; void *menu_init(const void *data); diff --git a/menu/menu_entries_cbs.c b/menu/menu_entries_cbs.c index 265ca6c310..87c3256a09 100644 --- a/menu/menu_entries_cbs.c +++ b/menu/menu_entries_cbs.c @@ -831,6 +831,7 @@ static int action_start_performance_counters_core(unsigned type, const char *lab unsigned offset = type - MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN; (void)label; + (void)action; if (counters[offset]) { @@ -841,6 +842,19 @@ static int action_start_performance_counters_core(unsigned type, const char *lab return 0; } +static int action_start_input_desc(unsigned type, const char *label, + unsigned action) +{ + unsigned offset = type - MENU_SETTINGS_INPUT_DESC_BEGIN; + + (void)label; + (void)action; + + RARCH_LOG("label is: %s, offset is: %u\n", label, offset); + + return 0; +} + static int action_start_shader_action_parameter(unsigned type, const char *label, unsigned action) { @@ -1989,6 +2003,49 @@ static int deferred_push_core_cheat_options(void *data, void *userdata, return 0; } +static int deferred_push_core_input_remapping_options(void *data, void *userdata, + const char *path, const char *label, unsigned type) +{ + unsigned p, retro_id; + file_list_t *list = (file_list_t*)data; + + (void)userdata; + (void)type; + + if (!list) + return -1; + + menu_list_clear(list); +#if 0 + menu_list_push(list, "Cheat File Load", "cheat_file_load", + MENU_SETTING_ACTION, 0); + menu_list_push(list, "Cheat Passes", "cheat_num_passes", + 0, 0); + menu_list_push(list, "Apply Cheat Changes", "cheat_apply_changes", + MENU_SETTING_ACTION, 0); +#endif + + for (p = 0; p < g_settings.input.max_users; p++) + { + for (retro_id = 0; retro_id < RARCH_FIRST_CUSTOM_BIND; retro_id++) + { + char desc_label[64]; + const char *description = g_extern.system.input_desc_btn[p][retro_id]; + + if (!description) + continue; + + snprintf(desc_label, sizeof(desc_label), "User %u %s : ", p + 1, description); + menu_list_push(list, desc_label, "", MENU_SETTINGS_INPUT_DESC_BEGIN + retro_id, p); + } + } + + 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, const char *path, const char *label, unsigned type) { @@ -2488,6 +2545,9 @@ static void menu_entries_cbs_init_bind_start(menu_file_list_cbs_t *cbs, else if (type >= MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN && type <= MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_END) cbs->action_start = action_start_performance_counters_core; + else if (type >= MENU_SETTINGS_INPUT_DESC_BEGIN + && type <= MENU_SETTINGS_INPUT_DESC_END) + cbs->action_start = action_start_input_desc; else if (type >= MENU_SETTINGS_PERF_COUNTERS_BEGIN && type <= MENU_SETTINGS_PERF_COUNTERS_END) cbs->action_start = action_start_performance_counters_frontend; @@ -2535,6 +2595,7 @@ static void menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs, !strcmp(label, "Input Options") || !strcmp(label, "core_options") || !strcmp(label, "core_cheat_options") || + !strcmp(label, "core_input_remapping_options") || !strcmp(label, "core_information") || !strcmp(label, "disk_options") || !strcmp(label, "settings") || @@ -2687,6 +2748,8 @@ static void menu_entries_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs, cbs->action_deferred_push = deferred_push_core_options; else if (!strcmp(label, "core_cheat_options")) cbs->action_deferred_push = deferred_push_core_cheat_options; + else if (!strcmp(label, "core_input_remapping_options")) + cbs->action_deferred_push = deferred_push_core_input_remapping_options; else if (!strcmp(label, "disk_options")) cbs->action_deferred_push = deferred_push_disk_options; else if (!strcmp(label, "core_list")) diff --git a/settings_data.c b/settings_data.c index 394bae5283..17aaebd941 100644 --- a/settings_data.c +++ b/settings_data.c @@ -2886,6 +2886,13 @@ static bool setting_data_append_list_main_menu_options( if (g_extern.main_is_init) { + if (g_extern.has_set_input_descriptors) + CONFIG_ACTION( + "core_input_remapping_options", + "Core Input Remapping Options", + group_info.name, + subgroup_info.name); + CONFIG_ACTION( "core_cheat_options", "Core Cheat Options",