diff --git a/configuration.c b/configuration.c index 1490e1d598..31a75f2e36 100644 --- a/configuration.c +++ b/configuration.c @@ -3146,6 +3146,12 @@ const char *config_get_active_core_path(void) return settings->path.libretro; } +bool config_active_core_path_is_empty(void) +{ + settings_t *settings = config_get_ptr(); + return !settings->path.libretro[0]; +} + void config_set_active_core_path(const char *path) { settings_t *settings = config_get_ptr(); diff --git a/configuration.h b/configuration.h index a00df65372..68087a66fd 100644 --- a/configuration.h +++ b/configuration.h @@ -604,6 +604,8 @@ void config_set_active_core_path(const char *path); void config_clear_active_core_path(void); +bool config_active_core_path_is_empty(void); + void config_free_state(void); settings_t *config_get_ptr(void); diff --git a/frontend/drivers/platform_gx.c b/frontend/drivers/platform_gx.c index 3fe92fccf8..2f68b6f30e 100644 --- a/frontend/drivers/platform_gx.c +++ b/frontend/drivers/platform_gx.c @@ -405,12 +405,11 @@ static void frontend_gx_process_args(int *argc, char *argv[]) { #ifndef IS_SALAMANDER char path[PATH_MAX_LENGTH] = {0}; - settings_t *settings = config_get_ptr(); /* A big hack: sometimes Salamander doesn't save the new core * it loads on first boot, so we make sure - * settings->path.libretro is set here. */ - if (!settings->path.libretro[0] && *argc >= 1 && strrchr(argv[0], '/')) + * active core path is set here. */ + if (config_active_core_path_is_empty() && *argc >= 1 && strrchr(argv[0], '/')) { strlcpy(path, strrchr(argv[0], '/') + 1, sizeof(path)); if (path_file_exists(path))