diff --git a/command.c b/command.c index 40d4dc1075..91e9ff2217 100644 --- a/command.c +++ b/command.c @@ -871,7 +871,7 @@ static bool command_event_disk_control_append_image(const char *path) * started out in a single disk case, and that this way * of doing it makes the most sense. */ rarch_ctl(RARCH_CTL_SET_PATHS, (void*)path); - rarch_ctl(RARCH_CTL_FILL_PATHNAMES, NULL); + retroarch_fill_pathnames(); } command_event(CMD_EVENT_AUTOSAVE_INIT, NULL); @@ -1205,7 +1205,7 @@ static bool event_init_content(void) return true; if (!content_does_not_need_content()) - rarch_ctl(RARCH_CTL_FILL_PATHNAMES, NULL); + retroarch_fill_pathnames(); if (!content_init()) return false; diff --git a/retroarch.c b/retroarch.c index dbf803e32b..b2b6b4ace9 100644 --- a/retroarch.c +++ b/retroarch.c @@ -1548,23 +1548,6 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data) #endif } break; - case RARCH_CTL_FILL_PATHNAMES: - retroarch_init_savefile_paths(); - bsv_movie_set_path(global->name.savefile); - - if (!*global->name.base) - return false; - - if (!*global->name.ups) - fill_pathname_noext(global->name.ups, global->name.base, ".ups", - sizeof(global->name.ups)); - if (!*global->name.bps) - fill_pathname_noext(global->name.bps, global->name.base, ".bps", - sizeof(global->name.bps)); - if (!*global->name.ips) - fill_pathname_noext(global->name.ips, global->name.base, ".ips", - sizeof(global->name.ips)); - break; case RARCH_CTL_NONE: default: return false; @@ -1573,6 +1556,27 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data) return true; } +void retroarch_fill_pathnames(void) +{ + global_t *global = global_get_ptr(); + + retroarch_init_savefile_paths(); + bsv_movie_set_path(global->name.savefile); + + if (!*global->name.base) + return; + + if (!*global->name.ups) + fill_pathname_noext(global->name.ups, global->name.base, ".ups", + sizeof(global->name.ups)); + if (!*global->name.bps) + fill_pathname_noext(global->name.bps, global->name.base, ".bps", + sizeof(global->name.bps)); + if (!*global->name.ips) + fill_pathname_noext(global->name.ips, global->name.base, ".ips", + sizeof(global->name.ips)); +} + int retroarch_get_capabilities(enum rarch_capabilities type, char *s, size_t len) { diff --git a/retroarch.h b/retroarch.h index f7f4196350..36dd53cc03 100644 --- a/retroarch.h +++ b/retroarch.h @@ -97,8 +97,6 @@ enum rarch_ctl_state * but this will do for now. */ RARCH_CTL_VALIDATE_CPU_FEATURES, - RARCH_CTL_FILL_PATHNAMES, - RARCH_CTL_SET_PATHS_REDIRECT, RARCH_CTL_SET_SRAM_ENABLE, @@ -171,6 +169,8 @@ const char *retroarch_get_current_savefile_dir(void); bool retroarch_validate_game_options(char *s, size_t len, bool mkdir); +void retroarch_fill_pathnames(void); + /** * retroarch_fail: * @error_code : Error code.