mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-14 14:28:47 +00:00
Add seperate directory for libretro core info files (needed for
Android)
This commit is contained in:
parent
19e6a099c1
commit
549ce2bb6c
21
core_info.c
21
core_info.c
@ -48,30 +48,33 @@ core_info_list_t *core_info_list_new(const char *modules_path)
|
||||
|
||||
for (size_t i = 0; i < contents->size; i++)
|
||||
{
|
||||
char info_path[PATH_MAX];
|
||||
char info_path_base[PATH_MAX], info_path[PATH_MAX];
|
||||
core_info[i].path = strdup(contents->elems[i].data);
|
||||
|
||||
if (!core_info[i].path)
|
||||
break;
|
||||
|
||||
fill_pathname_base(info_path_base, contents->elems[i].data, sizeof(info_path_base));
|
||||
path_remove_extension(info_path_base);
|
||||
|
||||
#if defined(RARCH_MOBILE) || defined(RARCH_CONSOLE)
|
||||
// Libs are deployed with a suffix (*_ios.dylib, *_qnx.so, etc).
|
||||
char buffer[PATH_MAX];
|
||||
strlcpy(buffer, contents->elems[i].data, sizeof(buffer));
|
||||
#ifdef ANDROID
|
||||
// Android libs have to be prefixed with 'lib' - so cores begin with 'libretro_' prefix
|
||||
char *substr = strstr(buffer, "libretro_");
|
||||
char *substr = strstr(info_path_base, "libretro_");
|
||||
if (substr)
|
||||
*substr = '\0';
|
||||
fill_pathname(info_path, buffer, "_libretro.info", sizeof(info_path));
|
||||
strlcat(info_path_base, "_libretro", sizeof(info_path_base));
|
||||
#else
|
||||
char *substr = strrchr(buffer, '_');
|
||||
char *substr = strrchr(info_path_base, '_');
|
||||
if (substr)
|
||||
*substr = '\0';
|
||||
fill_pathname(info_path, buffer, ".info", sizeof(info_path));
|
||||
#endif
|
||||
#else
|
||||
fill_pathname(info_path, core_info[i].path, ".info", sizeof(info_path));
|
||||
#endif
|
||||
strlcat(info_path_base, ".info", sizeof(info_path_base));
|
||||
|
||||
fill_pathname(info_path, (*g_settings.libretro_info_path) ? g_settings.libretro_info_path : modules_path,
|
||||
info_path_base, sizeof(info_path));
|
||||
|
||||
core_info[i].data = config_file_new(info_path);
|
||||
|
||||
|
@ -257,6 +257,7 @@ struct settings
|
||||
unsigned game_history_size;
|
||||
|
||||
char libretro[PATH_MAX];
|
||||
char libretro_info_path[PATH_MAX];
|
||||
char cheat_database[PATH_MAX];
|
||||
char cheat_settings_path[PATH_MAX];
|
||||
|
||||
|
@ -283,6 +283,7 @@ void config_set_defaults(void)
|
||||
*g_extern.savefile_dir = '\0';
|
||||
if (!g_extern.has_set_state_path)
|
||||
*g_extern.savestate_dir = '\0';
|
||||
*g_settings.libretro_info_path = '\0';
|
||||
*g_settings.core_options_path = '\0';
|
||||
*g_settings.game_history_path = '\0';
|
||||
*g_settings.cheat_database = '\0';
|
||||
|
Loading…
Reference in New Issue
Block a user