mirror of
https://github.com/libretro/RetroArch
synced 2025-02-03 17:54:04 +00:00
(RARCH_CONSOLE) Save default libretro core to config file
in a more robust fashion
This commit is contained in:
parent
f8160fb2bd
commit
c7679d9386
@ -21,14 +21,9 @@
|
||||
|
||||
#include "rarch_console_config.h"
|
||||
|
||||
void rarch_config_load(bool upgrade_core_succeeded)
|
||||
void rarch_config_load (void)
|
||||
{
|
||||
config_file_t *conf = NULL;
|
||||
char libretro_path_tmp[PATH_MAX];
|
||||
|
||||
//if a core has been upgraded, settings need to saved at the end
|
||||
if(upgrade_core_succeeded)
|
||||
snprintf(libretro_path_tmp, sizeof(libretro_path_tmp), g_settings.libretro);
|
||||
|
||||
if (*g_extern.config_path)
|
||||
conf = config_file_new(g_extern.config_path);
|
||||
@ -65,7 +60,7 @@ void rarch_config_load(bool upgrade_core_succeeded)
|
||||
CONFIG_GET_BOOL(audio.rate_control, "audio_rate_control");
|
||||
CONFIG_GET_FLOAT(audio.rate_control_delta, "audio_rate_control_delta");
|
||||
|
||||
for (unsigned i = 0; i < 7; i++)
|
||||
for (unsigned i = 0; i < MAX_PADS; i++)
|
||||
{
|
||||
char cfg[64];
|
||||
snprintf(cfg, sizeof(cfg), "input_dpad_emulation_p%u", i + 1);
|
||||
@ -104,11 +99,4 @@ void rarch_config_load(bool upgrade_core_succeeded)
|
||||
CONFIG_GET_INT_EXTERN(console.screen.viewports.custom_vp.width, "custom_viewport_width");
|
||||
CONFIG_GET_INT_EXTERN(console.screen.viewports.custom_vp.height, "custom_viewport_height");
|
||||
CONFIG_GET_FLOAT_EXTERN(console.rmenu.font_size, "menu_font_size");
|
||||
|
||||
if(upgrade_core_succeeded)
|
||||
{
|
||||
//save config file with new libretro path
|
||||
snprintf(g_settings.libretro, sizeof(g_settings.libretro), libretro_path_tmp);
|
||||
config_save_file(g_extern.config_path);
|
||||
}
|
||||
}
|
||||
|
@ -24,6 +24,6 @@ enum
|
||||
INPUT_PRESET_FILE
|
||||
};
|
||||
|
||||
void rarch_config_load(bool upgrade_core_succeeded);
|
||||
void rarch_config_load(void);
|
||||
|
||||
#endif
|
||||
|
@ -532,7 +532,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
rarch_settings_set_default();
|
||||
rarch_input_set_controls_default(input);
|
||||
rarch_config_load(find_libretro_file);
|
||||
rarch_config_load();
|
||||
|
||||
if (find_libretro_file)
|
||||
{
|
||||
RARCH_LOG("New default libretro core saved to config file: %s.\n", g_settings.libretro);
|
||||
config_save_file(g_extern.config_path);
|
||||
}
|
||||
|
||||
char core_name[64];
|
||||
rarch_console_name_from_id(core_name, sizeof(core_name));
|
||||
|
@ -286,7 +286,14 @@ int main(int argc, char *argv[])
|
||||
|
||||
rarch_settings_set_default();
|
||||
rarch_input_set_controls_default(input);
|
||||
rarch_config_load(find_libretro_file);
|
||||
rarch_config_load();
|
||||
|
||||
if (find_libretro_file)
|
||||
{
|
||||
RARCH_LOG("New default libretro core saved to config file: %s.\n", g_settings.libretro);
|
||||
config_save_file(g_extern.config_path);
|
||||
}
|
||||
|
||||
init_libretro_sym();
|
||||
|
||||
input_ps3.post_init();
|
||||
|
@ -147,7 +147,14 @@ int main(int argc, char *argv[])
|
||||
|
||||
rarch_settings_set_default();
|
||||
rarch_input_set_controls_default(input);
|
||||
rarch_config_load(find_libretro_file);
|
||||
rarch_config_load();
|
||||
|
||||
if (find_libretro_file)
|
||||
{
|
||||
RARCH_LOG("New default libretro core saved to config file: %s.\n", g_settings.libretro);
|
||||
config_save_file(g_extern.config_path);
|
||||
}
|
||||
|
||||
init_libretro_sym();
|
||||
|
||||
input_psp.post_init();
|
||||
|
@ -163,7 +163,14 @@ int main(int argc, char *argv[])
|
||||
|
||||
rarch_settings_set_default();
|
||||
rarch_input_set_controls_default(input);
|
||||
rarch_config_load(find_libretro_file);
|
||||
rarch_config_load();
|
||||
|
||||
if (find_libretro_file)
|
||||
{
|
||||
RARCH_LOG("New default libretro core saved to config file: %s.\n", g_settings.libretro);
|
||||
config_save_file(g_extern.config_path);
|
||||
}
|
||||
|
||||
init_libretro_sym();
|
||||
|
||||
input_xinput.post_init();
|
||||
|
Loading…
x
Reference in New Issue
Block a user