diff --git a/general.h b/general.h index d9fddab20e..e0609e2383 100644 --- a/general.h +++ b/general.h @@ -326,6 +326,7 @@ struct settings char content_database[PATH_MAX_LENGTH]; char cheat_database[PATH_MAX_LENGTH]; char cheat_settings_path[PATH_MAX_LENGTH]; + char input_remapping_directory[PATH_MAX_LENGTH]; char resampler_directory[PATH_MAX_LENGTH]; char screenshot_directory[PATH_MAX_LENGTH]; diff --git a/retroarch.cfg b/retroarch.cfg index a5f5ee566f..78ce742267 100644 --- a/retroarch.cfg +++ b/retroarch.cfg @@ -12,6 +12,9 @@ # will be extracted to this directory. # extraction_directory = +# Save all input remapping files to this directory. +# input_remapping_directory = + # Save all playlist files to this directory. # playlist_directory = diff --git a/settings.c b/settings.c index 2eba29ae2e..8e46c26b27 100644 --- a/settings.c +++ b/settings.c @@ -617,6 +617,7 @@ static void config_set_defaults(void) *g_settings.screenshot_directory = '\0'; *g_settings.system_directory = '\0'; *g_settings.extraction_directory = '\0'; + *g_settings.input_remapping_directory = '\0'; *g_settings.input.autoconfig_dir = '\0'; *g_settings.input.overlay = '\0'; *g_settings.content_directory = '\0'; @@ -1322,6 +1323,7 @@ static bool config_load_file(const char *path, bool set_defaults) CONFIG_GET_PATH(resampler_directory, "resampler_directory"); CONFIG_GET_PATH(extraction_directory, "extraction_directory"); + CONFIG_GET_PATH(input_remapping_directory, "input_remapping_directory"); CONFIG_GET_PATH(content_directory, "content_directory"); CONFIG_GET_PATH(assets_directory, "assets_directory"); CONFIG_GET_PATH(playlist_directory, "playlist_directory"); @@ -1884,6 +1886,8 @@ bool config_save_file(const char *path) g_settings.system_directory : "default"); config_set_path(conf, "extraction_directory", g_settings.extraction_directory); + config_set_path(conf, "input_remapping_directory", + g_settings.input_remapping_directory); config_set_path(conf, "resampler_directory", g_settings.resampler_directory); config_set_string(conf, "audio_resampler", g_settings.audio.resampler); diff --git a/settings_data.c b/settings_data.c index 6c77cd1b76..4d0f2a0f4f 100644 --- a/settings_data.c +++ b/settings_data.c @@ -5976,6 +5976,21 @@ static bool setting_data_append_list_path_options( list_info, SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR | SD_FLAG_BROWSER_ACTION); + CONFIG_DIR( + g_settings.input_remapping_directory, + "input_remapping_directory", + "Input Remapping Directory", + "", + "", + group_info.name, + subgroup_info.name, + general_write_handler, + general_read_handler); + settings_data_list_current_add_flags( + list, + list_info, + SD_FLAG_ALLOW_EMPTY | SD_FLAG_PATH_DIR | SD_FLAG_BROWSER_ACTION); + CONFIG_DIR( g_settings.playlist_directory, "playlist_directory",