diff --git a/configuration.c b/configuration.c index 952bce9437..be3b1bb7ae 100644 --- a/configuration.c +++ b/configuration.c @@ -3458,7 +3458,8 @@ bool config_unload_override(void) * * Returns: false if there was an error or no action was performed. */ -bool config_load_remap(const char *directory_input_remapping) +bool config_load_remap(const char *directory_input_remapping, + void *data) { size_t path_size = PATH_MAX_LENGTH * sizeof(char); config_file_t *new_conf = NULL; @@ -3466,7 +3467,7 @@ bool config_load_remap(const char *directory_input_remapping) char *core_path = NULL; char *game_path = NULL; char *content_path = NULL; - rarch_system_info_t *system = runloop_get_system_info(); + rarch_system_info_t *system = (rarch_system_info_t*)data; const char *core_name = system ? system->info.library_name : NULL; const char *rarch_path_basename = path_get(RARCH_PATH_BASENAME); const char *game_name = path_basename(rarch_path_basename); @@ -3964,7 +3965,7 @@ bool config_save_file(const char *path) * * Returns: true (1) on success, otherwise returns false (0). **/ -bool config_save_overrides(enum override_type type) +bool config_save_overrides(enum override_type type, void *data) { size_t path_size = PATH_MAX_LENGTH * sizeof(char); int tmp_i = 0; @@ -3999,7 +4000,7 @@ bool config_save_overrides(enum override_type type) int size_settings_size = sizeof(settings->sizes) / sizeof(settings->sizes.placeholder); int array_settings_size = sizeof(settings->arrays) / sizeof(settings->arrays.placeholder); int path_settings_size = sizeof(settings->paths) / sizeof(settings->paths.placeholder); - rarch_system_info_t *system = runloop_get_system_info(); + rarch_system_info_t *system = (rarch_system_info_t*)data; const char *core_name = system ? system->info.library_name : NULL; const char *rarch_path_basename = path_get(RARCH_PATH_BASENAME); const char *game_name = path_basename(rarch_path_basename); diff --git a/configuration.h b/configuration.h index 1bf4d37275..6d631f718d 100644 --- a/configuration.h +++ b/configuration.h @@ -848,7 +848,8 @@ bool config_unload_override(void); * Returns: false if there was an error or no action was performed. * */ -bool config_load_remap(const char *directory_input_remapping); +bool config_load_remap(const char *directory_input_remapping, + void *data); /** * config_save_autoconf_profile: @@ -876,7 +877,7 @@ bool config_save_file(const char *path); * * Returns: true (1) on success, otherwise returns false (0). **/ -bool config_save_overrides(enum override_type type); +bool config_save_overrides(enum override_type type, void *data); /* Replaces currently loaded configuration file with * another one. Will load a dummy core to flush state diff --git a/retroarch.c b/retroarch.c index b993e6fe4e..76522a1af6 100644 --- a/retroarch.c +++ b/retroarch.c @@ -5912,9 +5912,9 @@ static bool command_event_init_core(enum rarch_core_type type) current_core.retro_set_environment(rarch_environment_cb); #ifdef HAVE_CONFIGFILE - /* Auto-remap: apply remap files */ if (settings->bools.auto_remaps_enable) - config_load_remap(settings->paths.directory_input_remapping); + config_load_remap(settings->paths.directory_input_remapping, + &runloop_system); #endif /* Per-core saves: reset redirection paths */ @@ -6158,7 +6158,7 @@ static void command_event_save_current_config(enum override_type type) case OVERRIDE_GAME: case OVERRIDE_CORE: case OVERRIDE_CONTENT_DIR: - if (config_save_overrides(type)) + if (config_save_overrides(type, &runloop_system)) { strlcpy(msg, msg_hash_to_str(MSG_OVERRIDES_SAVED_SUCCESSFULLY), sizeof(msg)); RARCH_LOG("[config] [overrides] %s\n", msg);