diff --git a/menu/menu_entries.c b/menu/menu_entries.c index 4d28437d98..6cfd04c5b5 100644 --- a/menu/menu_entries.c +++ b/menu/menu_entries.c @@ -396,15 +396,14 @@ int menu_entries_get_title(char *s, size_t len) int menu_entries_get_core_name(char *s, size_t len) { - rarch_system_info_t *info = runloop_get_system_info(); - struct retro_system_info *system = &info->info; + struct retro_system_info *system = runloop_get_libretro_system_info(); const char *core_name = NULL; if (system) core_name = system->library_name; - if (string_is_empty(core_name) && info) - core_name = info->info.library_name; + if (string_is_empty(core_name) && system) + core_name = system->library_name; if (string_is_empty(core_name)) core_name = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE); @@ -417,10 +416,9 @@ int menu_entries_get_core_name(char *s, size_t len) * (shown at the top of the UI). */ int menu_entries_get_core_title(char *s, size_t len) { - const char *core_name = NULL; - const char *core_version = NULL; - rarch_system_info_t *info = runloop_get_system_info(); - struct retro_system_info *system = &info->info; + const char *core_name = NULL; + const char *core_version = NULL; + struct retro_system_info *system = runloop_get_libretro_system_info(); #if _MSC_VER == 1200 const char *extra_version = " msvc6"; #elif _MSC_VER == 1300 @@ -451,13 +449,13 @@ int menu_entries_get_core_title(char *s, size_t len) core_version = system->library_version; } - if (string_is_empty(core_name) && info) - core_name = info->info.library_name; + if (string_is_empty(core_name) && system) + core_name = system->library_name; if (string_is_empty(core_name)) core_name = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE); - if (!core_version && info) - core_version = info->info.library_version; + if (!core_version && system) + core_version = system->library_version; if (!core_version) core_version = ""; diff --git a/paths.c b/paths.c index 7ad604b80b..978ee0e5cf 100644 --- a/paths.c +++ b/paths.c @@ -67,6 +67,7 @@ void path_set_redirect(void) const char *old_savefile_dir = dir_get(RARCH_DIR_SAVEFILE); const char *old_savestate_dir = dir_get(RARCH_DIR_SAVESTATE); rarch_system_info_t *info = runloop_get_system_info(); + struct retro_system_info *system = runloop_get_libretro_system_info(); settings_t *settings = config_get_ptr(); new_savefile_dir[0] = new_savestate_dir[0] = '\0'; @@ -76,10 +77,10 @@ void path_set_redirect(void) strlcpy(new_savefile_dir, old_savefile_dir, path_size); strlcpy(new_savestate_dir, old_savestate_dir, path_size); - if (info && !string_is_empty(info->info.library_name)) + if (system && !string_is_empty(system->library_name)) { #ifdef HAVE_MENU - if (!string_is_equal(info->info.library_name, + if (!string_is_equal(system->library_name, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE))) #endif check_library_name = true; @@ -94,7 +95,7 @@ void path_set_redirect(void) fill_pathname_join( new_savefile_dir, old_savefile_dir, - info->info.library_name, + system->library_name, path_size); /* If path doesn't exist, try to create it, @@ -121,7 +122,7 @@ void path_set_redirect(void) fill_pathname_join( new_savestate_dir, old_savestate_dir, - info->info.library_name, + system->library_name, path_size); /* If path doesn't exist, try to create it. @@ -173,7 +174,7 @@ void path_set_redirect(void) { fill_pathname_dir(global->name.savefile, !string_is_empty(path_main_basename) ? path_main_basename : - info ? info->info.library_name : NULL, + system ? system->library_name : NULL, file_path_str(FILE_PATH_SRM_EXTENSION), sizeof(global->name.savefile)); RARCH_LOG("%s \"%s\".\n", @@ -185,7 +186,7 @@ void path_set_redirect(void) { fill_pathname_dir(global->name.savestate, !string_is_empty(path_main_basename) ? path_main_basename : - info ? info->info.library_name : NULL, + system ? system->library_name : NULL, file_path_str(FILE_PATH_STATE_EXTENSION), sizeof(global->name.savestate)); RARCH_LOG("%s \"%s\".\n", diff --git a/retroarch.c b/retroarch.c index a9aa568754..6b7dc50420 100644 --- a/retroarch.c +++ b/retroarch.c @@ -3593,3 +3593,9 @@ rarch_system_info_t *runloop_get_system_info(void) { return &runloop_system; } + +struct retro_system_info *runloop_get_libretro_system_info(void) +{ + struct retro_system_info *system = &runloop_system.info; + return system; +} diff --git a/retroarch.h b/retroarch.h index 596dce7d54..a3667fde88 100644 --- a/retroarch.h +++ b/retroarch.h @@ -387,6 +387,8 @@ bool retroarch_is_on_main_thread(void); rarch_system_info_t *runloop_get_system_info(void); +struct retro_system_info *runloop_get_libretro_system_info(void); + #ifdef HAVE_THREADS void runloop_msg_queue_lock(void); diff --git a/tasks/task_content.c b/tasks/task_content.c index b628075b36..ed56c69771 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -896,9 +896,8 @@ static bool task_load_content(content_ctx_info_t *content_info, { size_t tmp_size = PATH_MAX_LENGTH * sizeof(char); char *tmp = (char*)malloc(tmp_size); - rarch_system_info_t *sys_info = runloop_get_system_info(); const char *path_content = path_get(RARCH_PATH_CONTENT); - struct retro_system_info *info = sys_info ? &sys_info->info : NULL; + struct retro_system_info *info = runloop_get_libretro_system_info(); tmp[0] = '\0'; diff --git a/tasks/task_netplay_find_content.c b/tasks/task_netplay_find_content.c index 142893f45d..1f53758d41 100644 --- a/tasks/task_netplay_find_content.c +++ b/tasks/task_netplay_find_content.c @@ -56,8 +56,6 @@ static void netplay_crc_scan_callback(void *task_data, { netplay_crc_handle_t *state = (netplay_crc_handle_t*)task_data; content_ctx_info_t content_info = {0}; - rarch_system_info_t *info = runloop_get_system_info(); - struct retro_system_info *system = &info->info; if (!state) return; @@ -69,6 +67,8 @@ static void netplay_crc_scan_callback(void *task_data, if (!string_is_empty(state->core_path) && !string_is_empty(state->content_path) && !state->contentless && !state->current) { + struct retro_system_info *system = runloop_get_libretro_system_info(); + RARCH_LOG("[lobby] loading core %s with content file %s\n", state->core_path, state->content_path); @@ -89,13 +89,14 @@ static void netplay_crc_scan_callback(void *task_data, if (!string_is_empty(state->core_path) && !string_is_empty(state->content_path) && state->contentless) { - content_ctx_info_t content_info = {0}; + content_ctx_info_t content_info = {0}; + struct retro_system_info *system = runloop_get_libretro_system_info(); RARCH_LOG("[lobby] loading contentless core %s\n", state->core_path); command_event(CMD_EVENT_NETPLAY_INIT_DIRECT_DEFERRED, state->hostname); - if (!string_is_equal(info->info.library_name, state->core_name)) + if (!string_is_equal(system->library_name, state->core_name)) task_push_load_new_core(state->core_path, NULL, &content_info, CORE_TYPE_PLAIN, NULL, NULL);