(RARCH_CONSOLE) Add #ifdef HAVE_DYNAMIC for libretro dynamic
library argv
This commit is contained in:
parent
494148f579
commit
aaebc0be3d
|
@ -21,26 +21,24 @@
|
||||||
|
|
||||||
#include "rarch_console_config.h"
|
#include "rarch_console_config.h"
|
||||||
|
|
||||||
void rarch_config_load(const char *path, bool upgrade_core_succeeded)
|
void rarch_config_load(bool upgrade_core_succeeded)
|
||||||
{
|
{
|
||||||
|
config_file_t *conf = NULL;
|
||||||
char libretro_path_tmp[PATH_MAX];
|
char libretro_path_tmp[PATH_MAX];
|
||||||
|
|
||||||
//if a core has been upgraded, settings need to saved at the end
|
//if a core has been upgraded, settings need to saved at the end
|
||||||
if(upgrade_core_succeeded)
|
if(upgrade_core_succeeded)
|
||||||
snprintf(libretro_path_tmp, sizeof(libretro_path_tmp), g_settings.libretro);
|
snprintf(libretro_path_tmp, sizeof(libretro_path_tmp), g_settings.libretro);
|
||||||
|
|
||||||
|
if (*g_extern.config_path)
|
||||||
|
conf = config_file_new(g_extern.config_path);
|
||||||
|
else
|
||||||
|
conf = config_file_new(NULL);
|
||||||
|
|
||||||
config_file_t * conf = config_file_new(path);
|
if (!conf)
|
||||||
|
|
||||||
if(!conf)
|
|
||||||
{
|
{
|
||||||
#ifdef RARCH_CONSOLE
|
RARCH_ERR("Couldn't find config at path: \"%s\"\n", g_extern.config_path);
|
||||||
FILE * f;
|
rarch_fail(1, "rarch_config_load()");
|
||||||
RARCH_ERR("Config file \"%s\" doesn't exist. Creating...\n", path);
|
|
||||||
f = fopen(path, "w");
|
|
||||||
fclose(f);
|
|
||||||
#endif
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// g_settings
|
// g_settings
|
||||||
|
@ -111,6 +109,6 @@ void rarch_config_load(const char *path, bool upgrade_core_succeeded)
|
||||||
{
|
{
|
||||||
//save config file with new libretro path
|
//save config file with new libretro path
|
||||||
snprintf(g_settings.libretro, sizeof(g_settings.libretro), libretro_path_tmp);
|
snprintf(g_settings.libretro, sizeof(g_settings.libretro), libretro_path_tmp);
|
||||||
config_save_file(path);
|
config_save_file(g_extern.config_path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,6 @@ enum
|
||||||
INPUT_PRESET_FILE
|
INPUT_PRESET_FILE
|
||||||
};
|
};
|
||||||
|
|
||||||
void rarch_config_load(const char *path, bool upgrade_core_succeeded);
|
void rarch_config_load(bool upgrade_core_succeeded);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -532,7 +532,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
rarch_settings_set_default();
|
rarch_settings_set_default();
|
||||||
rarch_input_set_controls_default(input);
|
rarch_input_set_controls_default(input);
|
||||||
rarch_config_load(g_extern.config_path, find_libretro_file);
|
rarch_config_load(find_libretro_file);
|
||||||
|
|
||||||
char core_name[64];
|
char core_name[64];
|
||||||
rarch_console_name_from_id(core_name, sizeof(core_name));
|
rarch_console_name_from_id(core_name, sizeof(core_name));
|
||||||
|
|
|
@ -289,7 +289,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
rarch_settings_set_default();
|
rarch_settings_set_default();
|
||||||
rarch_input_set_controls_default(input);
|
rarch_input_set_controls_default(input);
|
||||||
rarch_config_load(g_extern.config_path, find_libretro_file);
|
rarch_config_load(find_libretro_file);
|
||||||
init_libretro_sym();
|
init_libretro_sym();
|
||||||
|
|
||||||
input_ps3.post_init();
|
input_ps3.post_init();
|
||||||
|
|
|
@ -147,7 +147,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
rarch_settings_set_default();
|
rarch_settings_set_default();
|
||||||
rarch_input_set_controls_default(input);
|
rarch_input_set_controls_default(input);
|
||||||
rarch_config_load(g_extern.config_path, find_libretro_file);
|
rarch_config_load(find_libretro_file);
|
||||||
init_libretro_sym();
|
init_libretro_sym();
|
||||||
|
|
||||||
input_psp.post_init();
|
input_psp.post_init();
|
||||||
|
|
|
@ -2923,11 +2923,13 @@ int rarch_main_init_wrap(const struct rarch_main_wrap *args)
|
||||||
argv[argc++] = strdup(args->config_path);
|
argv[argc++] = strdup(args->config_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_DYNAMIC
|
||||||
if (args->libretro_path)
|
if (args->libretro_path)
|
||||||
{
|
{
|
||||||
argv[argc++] = strdup("-L");
|
argv[argc++] = strdup("-L");
|
||||||
argv[argc++] = strdup(args->libretro_path);
|
argv[argc++] = strdup(args->libretro_path);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (args->verbose)
|
if (args->verbose)
|
||||||
argv[argc++] = strdup("-v");
|
argv[argc++] = strdup("-v");
|
||||||
|
|
|
@ -163,7 +163,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
rarch_settings_set_default();
|
rarch_settings_set_default();
|
||||||
rarch_input_set_controls_default(input);
|
rarch_input_set_controls_default(input);
|
||||||
rarch_config_load(g_extern.config_path, find_libretro_file);
|
rarch_config_load(find_libretro_file);
|
||||||
init_libretro_sym();
|
init_libretro_sym();
|
||||||
|
|
||||||
input_xinput.post_init();
|
input_xinput.post_init();
|
||||||
|
|
Loading…
Reference in New Issue