1
0
mirror of https://github.com/libretro/RetroArch synced 2025-03-26 11:37:30 +00:00

Fix in rarch_configure_libretro

This commit is contained in:
Twinaphex 2012-08-23 00:46:44 +02:00
parent 51d17c1040
commit aedfb68603
3 changed files with 7 additions and 7 deletions

@ -21,12 +21,12 @@
#include "rarch_console_config.h" #include "rarch_console_config.h"
void rarch_config_load(const char * conf_name, const char * libretro_dir_path, const char * exe_ext, bool find_libretro_path) void rarch_config_load(const char * conf_name, const char * libretro_dir_path, const char * exe_ext, bool upgrade_core_succeeded)
{ {
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(!find_libretro_path) 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);
@ -116,7 +116,7 @@ void rarch_config_load(const char * conf_name, const char * libretro_dir_path, c
CONFIG_GET_INT_EXTERN(state_slot, "state_slot"); CONFIG_GET_INT_EXTERN(state_slot, "state_slot");
CONFIG_GET_INT_EXTERN(audio_data.mute, "audio_mute"); CONFIG_GET_INT_EXTERN(audio_data.mute, "audio_mute");
if(!find_libretro_path) if(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);

@ -24,7 +24,7 @@ enum
INPUT_PRESET_FILE INPUT_PRESET_FILE
}; };
void rarch_config_load(const char * conf_name, const char * libretro_dir_path, const char * exe_ext, bool find_libretro_path); void rarch_config_load(const char * conf_name, const char * libretro_dir_path, const char * exe_ext, bool upgrade_core_succeeded);
void rarch_config_save(const char * conf_name); void rarch_config_save(const char * conf_name);
#endif #endif

@ -57,7 +57,7 @@ void rarch_console_name_from_id(char *name, size_t size)
bool rarch_configure_libretro_core(const char *core_exe_path, const char *tmp_path, bool rarch_configure_libretro_core(const char *core_exe_path, const char *tmp_path,
const char *libretro_path, const char *config_path, const char *extension) const char *libretro_path, const char *config_path, const char *extension)
{ {
bool find_libretro_file = false; bool upgrade_core_succeeded = false;
g_extern.verbose = true; g_extern.verbose = true;
@ -93,18 +93,18 @@ bool rarch_configure_libretro_core(const char *core_exe_path, const char *tmp_pa
{ {
RARCH_LOG("libretro core [%s] renamed to: [%s].\n", core_exe_path, tmp_pathnewfile); RARCH_LOG("libretro core [%s] renamed to: [%s].\n", core_exe_path, tmp_pathnewfile);
snprintf(g_settings.libretro, sizeof(g_settings.libretro), tmp_pathnewfile); snprintf(g_settings.libretro, sizeof(g_settings.libretro), tmp_pathnewfile);
upgrade_core_succeeded = true;
} }
else else
{ {
RARCH_ERR("Failed to rename CORE executable.\n"); RARCH_ERR("Failed to rename CORE executable.\n");
RARCH_WARN("CORE executable was not found, or some other error occurred. Will attempt to load libretro core path from config file.\n"); RARCH_WARN("CORE executable was not found, or some other error occurred. Will attempt to load libretro core path from config file.\n");
find_libretro_file = true;
} }
} }
g_extern.verbose = false; g_extern.verbose = false;
return find_libretro_file; return upgrade_core_succeeded;
} }
bool rarch_manage_libretro_extension_supported(const char *filename) bool rarch_manage_libretro_extension_supported(const char *filename)