mirror of
https://github.com/libretro/RetroArch.git
synced 2024-12-01 04:00:32 +00:00
689 lines
29 KiB
Diff
689 lines
29 KiB
Diff
diff --git a/command.c b/command.c
|
|
index da063a474..1aced47be 100644
|
|
--- a/command.c
|
|
+++ b/command.c
|
|
@@ -1645,7 +1645,7 @@ bool command_event(enum event_command cmd, void *data)
|
|
#ifdef HAVE_MENU
|
|
core_info_ctx_find_t info_find;
|
|
rarch_system_info_t *system_info = runloop_get_system_info();
|
|
- struct retro_system_info *system = &system_info->info;
|
|
+ struct retro_system_info_internal *system = &system_info->info_int;
|
|
|
|
#if defined(HAVE_DYNAMIC)
|
|
if (string_is_empty(path_get(RARCH_PATH_CORE)))
|
|
diff --git a/configuration.c b/configuration.c
|
|
index dd0a9d18b..b0d9f681d 100644
|
|
--- a/configuration.c
|
|
+++ b/configuration.c
|
|
@@ -2715,7 +2715,7 @@ bool config_load_override(void)
|
|
rarch_system_info_t *system = runloop_get_system_info();
|
|
|
|
if (system)
|
|
- core_name = system->info.library_name;
|
|
+ core_name = system->info_int.library_name;
|
|
|
|
game_name = path_basename(path_get(RARCH_PATH_BASENAME));
|
|
|
|
@@ -2870,7 +2870,7 @@ bool config_load_remap(void)
|
|
rarch_system_info_t *system = runloop_get_system_info();
|
|
|
|
if (system)
|
|
- core_name = system->info.library_name;
|
|
+ core_name = system->info_int.library_name;
|
|
|
|
game_name = path_basename(path_get(RARCH_PATH_BASENAME));
|
|
|
|
@@ -2970,7 +2970,7 @@ bool config_load_shader_preset(void)
|
|
rarch_system_info_t *system = runloop_get_system_info();
|
|
|
|
if (system)
|
|
- core_name = system->info.library_name;
|
|
+ core_name = system->info_int.library_name;
|
|
|
|
game_name = path_basename(path_get(RARCH_PATH_BASENAME));
|
|
|
|
@@ -3605,7 +3605,7 @@ bool config_save_overrides(int override_type)
|
|
rarch_system_info_t *system = runloop_get_system_info();
|
|
|
|
if (system)
|
|
- core_name = system->info.library_name;
|
|
+ core_name = system->info_int.library_name;
|
|
|
|
game_name = path_basename(path_get(RARCH_PATH_BASENAME));
|
|
|
|
diff --git a/core.h b/core.h
|
|
index 08ec2e1f0..040a6cab0 100644
|
|
--- a/core.h
|
|
+++ b/core.h
|
|
@@ -54,9 +54,48 @@ typedef struct rarch_memory_map
|
|
unsigned num_descriptors;
|
|
} rarch_memory_map_t;
|
|
|
|
+struct retro_system_info_internal
|
|
+{
|
|
+ /* All pointers are owned by libretro implementation, and pointers must
|
|
+ * remain valid until retro_deinit() is called. */
|
|
+
|
|
+ char *library_name; /* Descriptive name of library. Should not
|
|
+ * contain any version numbers, etc. */
|
|
+ char *library_version; /* Descriptive version of core. */
|
|
+
|
|
+ char *valid_extensions; /* A string listing probably content
|
|
+ * extensions the core will be able to
|
|
+ * load, separated with pipe.
|
|
+ * I.e. "bin|rom|iso".
|
|
+ * Typically used for a GUI to filter
|
|
+ * out extensions. */
|
|
+
|
|
+ /* If true, retro_load_game() is guaranteed to provide a valid pathname
|
|
+ * in retro_game_info::path.
|
|
+ * ::data and ::size are both invalid.
|
|
+ *
|
|
+ * If false, ::data and ::size are guaranteed to be valid, but ::path
|
|
+ * might not be valid.
|
|
+ *
|
|
+ * This is typically set to true for libretro implementations that must
|
|
+ * load from file.
|
|
+ * Implementations should strive for setting this to false, as it allows
|
|
+ * the frontend to perform patching, etc. */
|
|
+ bool need_fullpath;
|
|
+
|
|
+ /* If true, the frontend is not allowed to extract any archives before
|
|
+ * loading the real content.
|
|
+ * Necessary for certain libretro implementations that load games
|
|
+ * from zipped archives. */
|
|
+ bool block_extract;
|
|
+};
|
|
+
|
|
typedef struct rarch_system_info
|
|
{
|
|
+ struct retro_system_info_internal info_int;
|
|
+#if 0
|
|
struct retro_system_info info;
|
|
+#endif
|
|
|
|
unsigned rotation;
|
|
unsigned performance_level;
|
|
diff --git a/dynamic.c b/dynamic.c
|
|
index 6e0757923..8feecacc6 100644
|
|
--- a/dynamic.c
|
|
+++ b/dynamic.c
|
|
@@ -145,14 +145,21 @@ libretro_find_controller_description(
|
|
*
|
|
* Frees system information.
|
|
**/
|
|
-void libretro_free_system_info(struct retro_system_info *info)
|
|
+void libretro_free_system_info(struct retro_system_info_internal *info)
|
|
{
|
|
if (!info)
|
|
return;
|
|
|
|
- free((void*)info->library_name);
|
|
- free((void*)info->library_version);
|
|
- free((void*)info->valid_extensions);
|
|
+ if (info->library_name != NULL)
|
|
+ free(info->library_name);
|
|
+ if (info->library_version != NULL)
|
|
+ free(info->library_version);
|
|
+ if (info->valid_extensions != NULL)
|
|
+ free(info->valid_extensions);
|
|
+
|
|
+ info->library_name = NULL;
|
|
+ info->library_version = NULL;
|
|
+ info->valid_extensions = NULL;
|
|
memset(info, 0, sizeof(*info));
|
|
}
|
|
|
|
@@ -311,7 +318,7 @@ static dylib_t libretro_get_system_info_lib(const char *path,
|
|
* Returns: true (1) if successful, otherwise false (0).
|
|
**/
|
|
bool libretro_get_system_info(const char *path,
|
|
- struct retro_system_info *info, bool *load_no_content)
|
|
+ struct retro_system_info_internal *info, bool *load_no_content)
|
|
{
|
|
struct retro_system_info dummy_info;
|
|
#ifdef HAVE_DYNAMIC
|
|
@@ -352,13 +359,23 @@ bool libretro_get_system_info(const char *path,
|
|
retro_get_system_info(&dummy_info);
|
|
#endif
|
|
|
|
- memcpy(info, &dummy_info, sizeof(*info));
|
|
+ if (info->library_name != NULL)
|
|
+ free(info->library_name);
|
|
+ if (info->library_version != NULL)
|
|
+ free(info->library_version);
|
|
+ if (info->valid_extensions != NULL)
|
|
+ free(info->valid_extensions);
|
|
+
|
|
+ info->need_fullpath = dummy_info.need_fullpath;
|
|
+ info->block_extract = dummy_info.block_extract;
|
|
+ info->library_version = NULL;
|
|
+ info->library_name = NULL;
|
|
+ info->valid_extensions = NULL;
|
|
|
|
if (!string_is_empty(dummy_info.library_name))
|
|
info->library_name = strdup(dummy_info.library_name);
|
|
if (!string_is_empty(dummy_info.library_version))
|
|
info->library_version = strdup(dummy_info.library_version);
|
|
-
|
|
if (dummy_info.valid_extensions)
|
|
info->valid_extensions = strdup(dummy_info.valid_extensions);
|
|
|
|
diff --git a/dynamic.h b/dynamic.h
|
|
index 6999486be..5dafa2c87 100644
|
|
--- a/dynamic.h
|
|
+++ b/dynamic.h
|
|
@@ -21,6 +21,7 @@
|
|
#include <retro_common_api.h>
|
|
#include <libretro.h>
|
|
|
|
+#include "core.h"
|
|
#include "core_type.h"
|
|
|
|
RETRO_BEGIN_DECLS
|
|
@@ -38,7 +39,7 @@ RETRO_BEGIN_DECLS
|
|
* Returns: true (1) if successful, otherwise false (0).
|
|
**/
|
|
bool libretro_get_system_info(const char *path,
|
|
- struct retro_system_info *info, bool *load_no_content);
|
|
+ struct retro_system_info_internal *info, bool *load_no_content);
|
|
|
|
/**
|
|
* libretro_free_system_info:
|
|
@@ -46,7 +47,7 @@ bool libretro_get_system_info(const char *path,
|
|
*
|
|
* Frees system information.
|
|
**/
|
|
-void libretro_free_system_info(struct retro_system_info *info);
|
|
+void libretro_free_system_info(struct retro_system_info_internal *info);
|
|
|
|
const struct retro_subsystem_info *libretro_find_subsystem_info(
|
|
const struct retro_subsystem_info *info,
|
|
diff --git a/menu/cbs/menu_cbs_deferred_push.c b/menu/cbs/menu_cbs_deferred_push.c
|
|
index d97900114..1bfa1158b 100644
|
|
--- a/menu/cbs/menu_cbs_deferred_push.c
|
|
+++ b/menu/cbs/menu_cbs_deferred_push.c
|
|
@@ -618,7 +618,7 @@ static int general_push(menu_displaylist_info_t *info,
|
|
core_info_list_t *list = NULL;
|
|
menu_handle_t *menu = NULL;
|
|
rarch_system_info_t *system = runloop_get_system_info();
|
|
- struct retro_system_info *system_menu = &system->info;
|
|
+ struct retro_system_info_internal *system_menu = &system->info_int;
|
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
|
return menu_cbs_exit();
|
|
diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c
|
|
index ec6fbf5c3..15270bd4e 100644
|
|
--- a/menu/cbs/menu_cbs_ok.c
|
|
+++ b/menu/cbs/menu_cbs_ok.c
|
|
@@ -1379,7 +1379,7 @@ static int action_ok_playlist_entry_collection(const char *path,
|
|
playlist_t *tmp_playlist = NULL;
|
|
menu_handle_t *menu = NULL;
|
|
rarch_system_info_t *info = runloop_get_system_info();
|
|
- struct retro_system_info *system = &info->info;
|
|
+ struct retro_system_info_internal *system = &info->info_int;
|
|
|
|
content_info.argc = 0;
|
|
content_info.argv = NULL;
|
|
@@ -1958,14 +1958,12 @@ static int generic_action_ok_shader_preset_save(const char *path,
|
|
char file[PATH_MAX_LENGTH];
|
|
char tmp[PATH_MAX_LENGTH];
|
|
settings_t *settings = config_get_ptr();
|
|
- const char *core_name = NULL;
|
|
rarch_system_info_t *info = runloop_get_system_info();
|
|
+ struct retro_system_info_internal *system = &info->info_int;
|
|
+ const char *core_name = system ? system->library_name : NULL;
|
|
|
|
directory[0] = file[0] = tmp[0] = '\0';
|
|
|
|
- if (info)
|
|
- core_name = info->info.library_name;
|
|
-
|
|
if (!string_is_empty(core_name))
|
|
{
|
|
fill_pathname_join(
|
|
@@ -2075,14 +2073,12 @@ static int generic_action_ok_remap_file_save(const char *path,
|
|
char directory[PATH_MAX_LENGTH];
|
|
char file[PATH_MAX_LENGTH];
|
|
settings_t *settings = config_get_ptr();
|
|
- const char *core_name = NULL;
|
|
rarch_system_info_t *info = runloop_get_system_info();
|
|
+ struct retro_system_info_internal *system = &info->info_int;
|
|
+ const char *core_name = system ? system->library_name : NULL;
|
|
|
|
directory[0] = file[0] = '\0';
|
|
|
|
- if (info)
|
|
- core_name = info->info.library_name;
|
|
-
|
|
if (!string_is_empty(core_name))
|
|
fill_pathname_join(
|
|
directory,
|
|
diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c
|
|
index 57434df31..c49f557a6 100644
|
|
--- a/menu/drivers/materialui.c
|
|
+++ b/menu/drivers/materialui.c
|
|
@@ -857,7 +857,7 @@ static int mui_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;
|
|
+ struct retro_system_info_internal *system = &info->info_int;
|
|
|
|
core_name = system->library_name;
|
|
core_version = system->library_version;
|
|
@@ -868,9 +868,9 @@ static int mui_get_core_title(char *s, size_t len)
|
|
if (info)
|
|
{
|
|
if (string_is_empty(core_name))
|
|
- core_name = info->info.library_name;
|
|
+ core_name = info->info_int.library_name;
|
|
if (!core_version)
|
|
- core_version = info->info.library_version;
|
|
+ core_version = info->info_int.library_version;
|
|
}
|
|
|
|
if (string_is_empty(core_name))
|
|
@@ -1807,8 +1807,8 @@ static int mui_list_push(void *data, void *userdata,
|
|
entry.parse_type = PARSE_ACTION;
|
|
entry.add_empty_entry = false;
|
|
|
|
- if (!string_is_empty(system->info.library_name) &&
|
|
- !string_is_equal(system->info.library_name,
|
|
+ if (!string_is_empty(system->info_int.library_name) &&
|
|
+ !string_is_equal(system->info_int.library_name,
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE)))
|
|
{
|
|
entry.enum_idx = MENU_ENUM_LABEL_CONTENT_SETTINGS;
|
|
diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c
|
|
index 0e1a2cbdc..728023578 100644
|
|
--- a/menu/drivers/xmb.c
|
|
+++ b/menu/drivers/xmb.c
|
|
@@ -4041,8 +4041,8 @@ static int xmb_list_push(void *data, void *userdata,
|
|
entry.parse_type = PARSE_ACTION;
|
|
entry.add_empty_entry = false;
|
|
|
|
- if (!string_is_empty(system->info.library_name) &&
|
|
- !string_is_equal(system->info.library_name,
|
|
+ if (!string_is_empty(system->info_int.library_name) &&
|
|
+ !string_is_equal(system->info_int.library_name,
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE)))
|
|
{
|
|
entry.enum_idx = MENU_ENUM_LABEL_CONTENT_SETTINGS;
|
|
diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c
|
|
index 02024807d..11cbd6460 100644
|
|
--- a/menu/menu_displaylist.c
|
|
+++ b/menu/menu_displaylist.c
|
|
@@ -2990,8 +2990,8 @@ static int menu_displaylist_parse_information_list(
|
|
core_info_get_current_core(&core_info);
|
|
|
|
if ( system &&
|
|
- (!string_is_empty(system->info.library_name) &&
|
|
- !string_is_equal(system->info.library_name,
|
|
+ (!string_is_empty(system->info_int.library_name) &&
|
|
+ !string_is_equal(system->info_int.library_name,
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE))
|
|
)
|
|
&& core_info && core_info->config_data
|
|
@@ -4477,7 +4477,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
|
if (cores_names_size == 0)
|
|
{
|
|
rarch_system_info_t *system_info = runloop_get_system_info();
|
|
- struct retro_system_info *system = &system_info->info;
|
|
+ struct retro_system_info_internal *system = &system_info->info_int;
|
|
const char *core_name = system ? system->library_name : NULL;
|
|
|
|
if (!path_is_empty(RARCH_PATH_CORE))
|
|
@@ -4591,7 +4591,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
|
{
|
|
const char *core_name = NULL;
|
|
rarch_system_info_t *system_info = runloop_get_system_info();
|
|
- struct retro_system_info *system = &system_info->info;
|
|
+ struct retro_system_info_internal *system = &system_info->info_int;
|
|
|
|
if (system)
|
|
core_name = system->library_name;
|
|
@@ -6000,8 +6000,8 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
|
|
|
if (system)
|
|
{
|
|
- if ( !string_is_empty(system->info.library_name) &&
|
|
- !string_is_equal(system->info.library_name,
|
|
+ if ( !string_is_empty(system->info_int.library_name) &&
|
|
+ !string_is_equal(system->info_int.library_name,
|
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE)))
|
|
menu_displaylist_parse_settings_enum(menu, info,
|
|
MENU_ENUM_LABEL_CONTENT_SETTINGS,
|
|
diff --git a/menu/menu_driver.c b/menu/menu_driver.c
|
|
index 2df94a880..f249a0188 100644
|
|
--- a/menu/menu_driver.c
|
|
+++ b/menu/menu_driver.c
|
|
@@ -1826,8 +1826,8 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
|
|
#endif
|
|
{
|
|
rarch_system_info_t *system = runloop_get_system_info();
|
|
- libretro_free_system_info(&system->info);
|
|
- memset(&system->info, 0, sizeof(struct retro_system_info));
|
|
+ libretro_free_system_info(&system->info_int);
|
|
+ memset(&system->info_int, 0, sizeof(struct retro_system_info_internal));
|
|
}
|
|
|
|
video_coord_array_free(&menu_disp_ca);
|
|
diff --git a/menu/menu_entries.c b/menu/menu_entries.c
|
|
index 84755f68a..2e28cbf14 100644
|
|
--- a/menu/menu_entries.c
|
|
+++ b/menu/menu_entries.c
|
|
@@ -266,15 +266,12 @@ 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;
|
|
- const char *core_name = NULL;
|
|
+ struct retro_system_info_internal
|
|
+ *system = &info->info_int;
|
|
+ const char *core_name = system ? system->library_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))
|
|
+ if (string_is_empty(core_name) || string_is_equal(core_name,
|
|
+ msg_hash_to_str(MSG_UNKNOWN)))
|
|
core_name = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE);
|
|
|
|
snprintf(s, len, "%s", core_name);
|
|
@@ -300,24 +297,13 @@ bool menu_entries_current_core_is_no_core(void)
|
|
* (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;
|
|
-
|
|
- if (system)
|
|
- {
|
|
- core_name = system->library_name;
|
|
- core_version = system->library_version;
|
|
- }
|
|
+ struct retro_system_info_internal *system = &info->info_int;
|
|
+ const char *core_name = system ? system->library_name : NULL;
|
|
+ const char *core_version = system ? system->library_version : NULL;
|
|
|
|
- if (string_is_empty(core_name) && info)
|
|
- core_name = info->info.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)
|
|
core_version = "";
|
|
|
|
diff --git a/network/netplay/netplay_discovery.c b/network/netplay/netplay_discovery.c
|
|
index 8d45a86a3..ac7fdc01e 100644
|
|
--- a/network/netplay/netplay_discovery.c
|
|
+++ b/network/netplay/netplay_discovery.c
|
|
@@ -269,9 +269,9 @@ bool netplay_lan_ad_server(netplay_t *netplay)
|
|
|
|
if (info)
|
|
{
|
|
- strlcpy(ad_packet_buffer.core, info->info.library_name,
|
|
+ strlcpy(ad_packet_buffer.core, info->info_int.library_name,
|
|
NETPLAY_HOST_STR_LEN);
|
|
- strlcpy(ad_packet_buffer.core_version, info->info.library_version,
|
|
+ strlcpy(ad_packet_buffer.core_version, info->info_int.library_version,
|
|
NETPLAY_HOST_STR_LEN);
|
|
}
|
|
|
|
diff --git a/network/netplay/netplay_frontend.c b/network/netplay/netplay_frontend.c
|
|
index 2e0006e70..849ac3370 100644
|
|
--- a/network/netplay/netplay_frontend.c
|
|
+++ b/network/netplay/netplay_frontend.c
|
|
@@ -610,9 +610,9 @@ static void netplay_announce(void)
|
|
uint32_t content_crc = content_get_crc();
|
|
|
|
net_http_urlencode_full(&username, settings->paths.username);
|
|
- net_http_urlencode_full(&corename, system->info.library_name);
|
|
+ net_http_urlencode_full(&corename, system->info_int.library_name);
|
|
net_http_urlencode_full(&gamename, !string_is_empty(path_basename(path_get(RARCH_PATH_BASENAME))) ? path_basename(path_get(RARCH_PATH_BASENAME)) : "N/A");
|
|
- net_http_urlencode_full(&coreversion, system->info.library_version);
|
|
+ net_http_urlencode_full(&coreversion, system->info_int.library_version);
|
|
|
|
buf[0] = '\0';
|
|
|
|
diff --git a/network/netplay/netplay_handshake.c b/network/netplay/netplay_handshake.c
|
|
index 3ed907b61..0bbee7a67 100644
|
|
--- a/network/netplay/netplay_handshake.c
|
|
+++ b/network/netplay/netplay_handshake.c
|
|
@@ -488,9 +488,9 @@ bool netplay_handshake_info(netplay_t *netplay,
|
|
if (core_info)
|
|
{
|
|
strlcpy(info_buf.core_name,
|
|
- core_info->info.library_name, sizeof(info_buf.core_name));
|
|
+ core_info->info_int.library_name, sizeof(info_buf.core_name));
|
|
strlcpy(info_buf.core_version,
|
|
- core_info->info.library_version, sizeof(info_buf.core_version));
|
|
+ core_info->info_int.library_version, sizeof(info_buf.core_version));
|
|
}
|
|
else
|
|
{
|
|
@@ -834,9 +834,9 @@ bool netplay_handshake_pre_info(netplay_t *netplay,
|
|
if (core_info)
|
|
{
|
|
if (strncmp(info_buf.core_name,
|
|
- core_info->info.library_name, sizeof(info_buf.core_name)) ||
|
|
+ core_info->info_int.library_name, sizeof(info_buf.core_name)) ||
|
|
strncmp(info_buf.core_version,
|
|
- core_info->info.library_version, sizeof(info_buf.core_version)))
|
|
+ core_info->info_int.library_version, sizeof(info_buf.core_version)))
|
|
{
|
|
dmsg = msg_hash_to_str(MSG_NETPLAY_IMPLEMENTATIONS_DIFFER);
|
|
goto error;
|
|
diff --git a/paths.c b/paths.c
|
|
index fd36464cc..313f9beb7 100644
|
|
--- a/paths.c
|
|
+++ b/paths.c
|
|
@@ -71,10 +71,9 @@ void path_set_redirect(void)
|
|
|
|
new_savefile_dir[0] = new_savestate_dir[0] = '\0';
|
|
|
|
- if (info && info->info.library_name &&
|
|
- !string_is_empty(info->info.library_name))
|
|
+ if (info && !string_is_empty(info->info_int.library_name))
|
|
library_name_hash =
|
|
- msg_hash_calculate(info->info.library_name);
|
|
+ msg_hash_calculate(info->info_int.library_name);
|
|
|
|
/* Initialize current save directories
|
|
* with the values from the config. */
|
|
@@ -103,7 +102,7 @@ void path_set_redirect(void)
|
|
fill_pathname_join(
|
|
new_savefile_dir,
|
|
old_savefile_dir,
|
|
- info->info.library_name,
|
|
+ info->info_int.library_name,
|
|
sizeof(new_savefile_dir));
|
|
|
|
/* If path doesn't exist, try to create it,
|
|
@@ -132,7 +131,7 @@ void path_set_redirect(void)
|
|
fill_pathname_join(
|
|
new_savestate_dir,
|
|
old_savestate_dir,
|
|
- info->info.library_name,
|
|
+ info->info_int.library_name,
|
|
sizeof(new_savestate_dir));
|
|
|
|
/* If path doesn't exist, try to create it.
|
|
@@ -176,7 +175,7 @@ void path_set_redirect(void)
|
|
{
|
|
fill_pathname_dir(global->name.savefile,
|
|
!string_is_empty(path_main_basename) ? path_main_basename :
|
|
- info->info.library_name,
|
|
+ info->info_int.library_name,
|
|
file_path_str(FILE_PATH_SRM_EXTENSION),
|
|
sizeof(global->name.savefile));
|
|
RARCH_LOG("%s \"%s\".\n",
|
|
@@ -188,7 +187,7 @@ void path_set_redirect(void)
|
|
{
|
|
fill_pathname_dir(global->name.savestate,
|
|
!string_is_empty(path_main_basename) ? path_main_basename :
|
|
- info->info.library_name,
|
|
+ info->info_int.library_name,
|
|
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 b3e12671c..265f4b0c4 100644
|
|
--- a/retroarch.c
|
|
+++ b/retroarch.c
|
|
@@ -1098,7 +1098,7 @@ bool retroarch_validate_game_options(char *s, size_t len, bool mkdir)
|
|
char core_path[PATH_MAX_LENGTH];
|
|
char config_directory[PATH_MAX_LENGTH];
|
|
rarch_system_info_t *system = &runloop_system;
|
|
- const char *core_name = system ? system->info.library_name : NULL;
|
|
+ const char *core_name = system ? system->info_int.library_name : NULL;
|
|
const char *game_name = path_basename(path_get(RARCH_PATH_BASENAME));
|
|
|
|
if (string_is_empty(core_name) || string_is_empty(game_name))
|
|
@@ -1424,7 +1424,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
|
config_free();
|
|
break;
|
|
case RARCH_CTL_PREINIT:
|
|
- libretro_free_system_info(&runloop_system.info);
|
|
+ libretro_free_system_info(&runloop_system.info_int);
|
|
command_event(CMD_EVENT_HISTORY_DEINIT, NULL);
|
|
|
|
config_init();
|
|
@@ -1510,19 +1510,29 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
|
case RARCH_CTL_IS_BLOCK_CONFIG_READ:
|
|
return rarch_block_config_read;
|
|
case RARCH_CTL_SYSTEM_INFO_INIT:
|
|
- core_get_system_info(&runloop_system.info);
|
|
+ {
|
|
+ struct retro_system_info system_info;
|
|
+
|
|
+ core_get_system_info(&system_info);
|
|
|
|
- if (!runloop_system.info.library_name)
|
|
- runloop_system.info.library_name = msg_hash_to_str(MSG_UNKNOWN);
|
|
- if (!runloop_system.info.library_version)
|
|
- runloop_system.info.library_version = "v0";
|
|
+ if (!string_is_empty(system_info.library_name))
|
|
+ runloop_system.info_int.library_name = strdup(system_info.library_name);
|
|
+ else
|
|
+ runloop_system.info_int.library_name = strdup(msg_hash_to_str(MSG_UNKNOWN));
|
|
+ if (!string_is_empty(system_info.library_version))
|
|
+ runloop_system.info_int.library_version = strdup(system_info.library_version);
|
|
+ else
|
|
+ runloop_system.info_int.library_version = strdup("v0");
|
|
+ if (!string_is_empty(system_info.valid_extensions))
|
|
+ runloop_system.info_int.valid_extensions = strdup(system_info.valid_extensions);
|
|
+ else
|
|
+ runloop_system.info_int.valid_extensions = strdup(DEFAULT_EXT);
|
|
|
|
- video_driver_set_title_buf();
|
|
+ runloop_system.info_int.need_fullpath = system_info.need_fullpath;
|
|
+ runloop_system.info_int.block_extract = system_info.block_extract;
|
|
|
|
- strlcpy(runloop_system.valid_extensions,
|
|
- runloop_system.info.valid_extensions ?
|
|
- runloop_system.info.valid_extensions : DEFAULT_EXT,
|
|
- sizeof(runloop_system.valid_extensions));
|
|
+ video_driver_set_title_buf();
|
|
+ }
|
|
break;
|
|
case RARCH_CTL_GET_CORE_OPTION_SIZE:
|
|
{
|
|
@@ -1565,18 +1575,18 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
|
|
|
audio_driver_unset_callback();
|
|
|
|
- if (!string_is_empty(runloop_system.info.library_name))
|
|
- free((void*)runloop_system.info.library_name);
|
|
- if (!string_is_empty(runloop_system.info.library_version))
|
|
- free((void*)runloop_system.info.library_version);
|
|
- if (!string_is_empty(runloop_system.info.valid_extensions))
|
|
- free((void*)runloop_system.info.valid_extensions);
|
|
-
|
|
- runloop_system.info.library_name = NULL;
|
|
- runloop_system.info.library_version = NULL;
|
|
- runloop_system.info.valid_extensions = NULL;
|
|
- runloop_system.info.need_fullpath = false;
|
|
- runloop_system.info.block_extract = false;
|
|
+ if (runloop_system.info_int.library_name != NULL)
|
|
+ free(runloop_system.info_int.library_name);
|
|
+ if (runloop_system.info_int.library_version != NULL)
|
|
+ free(runloop_system.info_int.library_version);
|
|
+ if (runloop_system.info_int.valid_extensions != NULL)
|
|
+ free(runloop_system.info_int.valid_extensions);
|
|
+
|
|
+ runloop_system.info_int.library_name = NULL;
|
|
+ runloop_system.info_int.library_version = NULL;
|
|
+ runloop_system.info_int.valid_extensions = NULL;
|
|
+ runloop_system.info_int.need_fullpath = false;
|
|
+ runloop_system.info_int.block_extract = false;
|
|
|
|
memset(&runloop_system, 0, sizeof(rarch_system_info_t));
|
|
break;
|
|
diff --git a/tasks/task_content.c b/tasks/task_content.c
|
|
index 093aca829..0bf1b007b 100644
|
|
--- a/tasks/task_content.c
|
|
+++ b/tasks/task_content.c
|
|
@@ -842,13 +842,13 @@ static bool task_load_content(content_ctx_info_t *content_info,
|
|
if (is_inited || contentless)
|
|
{
|
|
char tmp[PATH_MAX_LENGTH];
|
|
- struct retro_system_info *info = NULL;
|
|
+ struct retro_system_info_internal *info = NULL;
|
|
rarch_system_info_t *sys_info = runloop_get_system_info();
|
|
|
|
tmp[0] = '\0';
|
|
|
|
if (sys_info)
|
|
- info = &sys_info->info;
|
|
+ info = &sys_info->info_int;
|
|
|
|
strlcpy(tmp, path_get(RARCH_PATH_CONTENT), sizeof(tmp));
|
|
|
|
@@ -1725,11 +1725,11 @@ bool content_init(void)
|
|
content_ctx.directory_system = strdup(settings->paths.directory_system);
|
|
if (!string_is_empty(settings->paths.directory_cache))
|
|
content_ctx.directory_cache = strdup(settings->paths.directory_cache);
|
|
- if (!string_is_empty(sys_info->info.valid_extensions))
|
|
- content_ctx.valid_extensions = strdup(sys_info->info.valid_extensions);
|
|
+ if (!string_is_empty(sys_info->info_int.valid_extensions))
|
|
+ content_ctx.valid_extensions = strdup(sys_info->info_int.valid_extensions);
|
|
|
|
- content_ctx.block_extract = sys_info->info.block_extract;
|
|
- content_ctx.need_fullpath = sys_info->info.need_fullpath;
|
|
+ content_ctx.block_extract = sys_info->info_int.block_extract;
|
|
+ content_ctx.need_fullpath = sys_info->info_int.need_fullpath;
|
|
|
|
content_ctx.subsystem.data = sys_info->subsystem.data;
|
|
content_ctx.subsystem.size = sys_info->subsystem.size;
|
|
diff --git a/tasks/task_netplay_find_content.c b/tasks/task_netplay_find_content.c
|
|
index 6af562de9..885611679 100644
|
|
--- a/tasks/task_netplay_find_content.c
|
|
+++ b/tasks/task_netplay_find_content.c
|
|
@@ -57,7 +57,7 @@ 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;
|
|
+ struct retro_system_info_internal *system = &info->info_int;
|
|
|
|
if (!state)
|
|
return;
|
|
@@ -95,7 +95,7 @@ static void netplay_crc_scan_callback(void *task_data,
|
|
|
|
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(info->info_int.library_name, state->core_name))
|
|
task_push_load_new_core(state->core_path, NULL,
|
|
&content_info, CORE_TYPE_PLAIN, NULL, NULL);
|
|
|