Change signature of rarch_system_info_get_ptr
This commit is contained in:
parent
67ffbe7cef
commit
42fcb4490c
|
@ -1761,14 +1761,14 @@ bool config_load_override(void)
|
||||||
bool should_append = false;
|
bool should_append = false;
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
struct retro_system_info *info = rarch_system_info_get_ptr();
|
rarch_system_info_t *info = rarch_system_info_get_ptr();
|
||||||
|
|
||||||
/* Early return in case a library isn't loaded */
|
/* Early return in case a library isn't loaded */
|
||||||
if (!info->library_name || !strcmp(info->library_name,"No Core"))
|
if (!info->info.library_name || !strcmp(info->info.library_name,"No Core"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
RARCH_LOG("Game name: %s\n", global->basename);
|
RARCH_LOG("Game name: %s\n", global->basename);
|
||||||
RARCH_LOG("Core name: %s\n", info->library_name);
|
RARCH_LOG("Core name: %s\n", info->info.library_name);
|
||||||
|
|
||||||
if (!global || !settings )
|
if (!global || !settings )
|
||||||
{
|
{
|
||||||
|
@ -1791,7 +1791,7 @@ bool config_load_override(void)
|
||||||
|
|
||||||
RARCH_LOG("Config directory: %s\n", config_directory);
|
RARCH_LOG("Config directory: %s\n", config_directory);
|
||||||
|
|
||||||
core_name = info->library_name;
|
core_name = info->info.library_name;
|
||||||
game_name = path_basename(global->basename);
|
game_name = path_basename(global->basename);
|
||||||
|
|
||||||
/* Concatenate strings into full paths for core_path, game_path */
|
/* Concatenate strings into full paths for core_path, game_path */
|
||||||
|
@ -1944,14 +1944,14 @@ bool config_load_remap(void)
|
||||||
char game_path[PATH_MAX_LENGTH] = {0}; /* final path for game-specific configuration (prefix+suffix) */
|
char game_path[PATH_MAX_LENGTH] = {0}; /* final path for game-specific configuration (prefix+suffix) */
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
struct retro_system_info *info = rarch_system_info_get_ptr();
|
rarch_system_info_t *info = rarch_system_info_get_ptr();
|
||||||
|
|
||||||
/* Early return in case a library isn't loaded or remapping is disabled */
|
/* Early return in case a library isn't loaded or remapping is disabled */
|
||||||
if (!info->library_name || !strcmp(info->library_name,"No Core"))
|
if (!info->info.library_name || !strcmp(info->info.library_name,"No Core"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
RARCH_LOG("Game name: %s\n", global->basename);
|
RARCH_LOG("Game name: %s\n", global->basename);
|
||||||
RARCH_LOG("Core name: %s\n", info->library_name);
|
RARCH_LOG("Core name: %s\n", info->info.library_name);
|
||||||
|
|
||||||
/* Remap directory: remap_directory.
|
/* Remap directory: remap_directory.
|
||||||
* Try remap directory setting, no fallbacks defined */
|
* Try remap directory setting, no fallbacks defined */
|
||||||
|
@ -1964,7 +1964,7 @@ bool config_load_remap(void)
|
||||||
}
|
}
|
||||||
RARCH_LOG("Remap directory: %s\n", remap_directory);
|
RARCH_LOG("Remap directory: %s\n", remap_directory);
|
||||||
|
|
||||||
core_name = info->library_name;
|
core_name = info->info.library_name;
|
||||||
game_name = path_basename(global->basename);
|
game_name = path_basename(global->basename);
|
||||||
|
|
||||||
/* Concatenate strings into full paths for core_path, game_path */
|
/* Concatenate strings into full paths for core_path, game_path */
|
||||||
|
|
12
content.c
12
content.c
|
@ -366,9 +366,9 @@ static bool load_content_need_fullpath(
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
struct retro_system_info *sys_info= rarch_system_info_get_ptr();
|
rarch_system_info_t *sys_info= rarch_system_info_get_ptr();
|
||||||
|
|
||||||
if (sys_info && sys_info->block_extract)
|
if (sys_info && sys_info->info.block_extract)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!need_fullpath)
|
if (!need_fullpath)
|
||||||
|
@ -519,7 +519,7 @@ bool init_content_file(void)
|
||||||
struct string_list *content = NULL;
|
struct string_list *content = NULL;
|
||||||
const struct retro_subsystem_info *special = NULL;
|
const struct retro_subsystem_info *special = NULL;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
struct retro_system_info *info = rarch_system_info_get_ptr();
|
rarch_system_info_t *info = rarch_system_info_get_ptr();
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
|
|
||||||
global->temporary_content = string_list_new();
|
global->temporary_content = string_list_new();
|
||||||
|
@ -583,8 +583,8 @@ bool init_content_file(void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
attr.i = info->block_extract;
|
attr.i = info->info.block_extract;
|
||||||
attr.i |= info->need_fullpath << 1;
|
attr.i |= info->info.need_fullpath << 1;
|
||||||
attr.i |= (!global->system.no_content) << 2;
|
attr.i |= (!global->system.no_content) << 2;
|
||||||
string_list_append(content,
|
string_list_append(content,
|
||||||
(global->libretro_no_content && settings->core.set_supports_no_game_enable) ? "" : global->fullpath, attr);
|
(global->libretro_no_content && settings->core.set_supports_no_game_enable) ? "" : global->fullpath, attr);
|
||||||
|
@ -603,7 +603,7 @@ bool init_content_file(void)
|
||||||
|
|
||||||
ext = path_get_extension(content->elems[i].data);
|
ext = path_get_extension(content->elems[i].data);
|
||||||
valid_ext = special ? special->roms[i].valid_extensions :
|
valid_ext = special ? special->roms[i].valid_extensions :
|
||||||
info->valid_extensions;
|
info->info.valid_extensions;
|
||||||
|
|
||||||
if (ext && !strcasecmp(ext, "zip"))
|
if (ext && !strcasecmp(ext, "zip"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -315,14 +315,15 @@ int rarch_main(int argc, char *argv[], void *data)
|
||||||
|
|
||||||
if (settings->history_list_enable)
|
if (settings->history_list_enable)
|
||||||
{
|
{
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
|
rarch_system_info_t *sysinfo = rarch_system_info_get_ptr();
|
||||||
|
|
||||||
if (global->content_is_init || global->system.no_content)
|
if (global->content_is_init || global->system.no_content)
|
||||||
history_playlist_push(
|
history_playlist_push(
|
||||||
g_defaults.history,
|
g_defaults.history,
|
||||||
global->fullpath,
|
global->fullpath,
|
||||||
settings->libretro,
|
settings->libretro,
|
||||||
rarch_system_info_get_ptr());
|
sysinfo ? &sysinfo->info : NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (driver)
|
if (driver)
|
||||||
|
|
|
@ -786,8 +786,8 @@ static int action_ok_remap_file_save_core(const char *path,
|
||||||
char file[PATH_MAX_LENGTH] = {0};
|
char file[PATH_MAX_LENGTH] = {0};
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
struct retro_system_info *info = rarch_system_info_get_ptr();
|
rarch_system_info_t *info = rarch_system_info_get_ptr();
|
||||||
const char *core_name = info ? info->library_name : NULL;
|
const char *core_name = info ? info->info.library_name : NULL;
|
||||||
|
|
||||||
fill_pathname_join(directory,settings->input_remapping_directory,core_name,PATH_MAX_LENGTH);
|
fill_pathname_join(directory,settings->input_remapping_directory,core_name,PATH_MAX_LENGTH);
|
||||||
fill_pathname_join(file,core_name,core_name,PATH_MAX_LENGTH);
|
fill_pathname_join(file,core_name,core_name,PATH_MAX_LENGTH);
|
||||||
|
@ -810,8 +810,8 @@ static int action_ok_remap_file_save_game(const char *path,
|
||||||
char file[PATH_MAX_LENGTH] = {0};
|
char file[PATH_MAX_LENGTH] = {0};
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
struct retro_system_info *info = rarch_system_info_get_ptr();
|
rarch_system_info_t *info = rarch_system_info_get_ptr();
|
||||||
const char *core_name = info ? info->library_name : NULL;
|
const char *core_name = info ? info->info.library_name : NULL;
|
||||||
const char *game_name = global ? path_basename(global->basename) : NULL;
|
const char *game_name = global ? path_basename(global->basename) : NULL;
|
||||||
|
|
||||||
fill_pathname_join(directory,settings->input_remapping_directory,core_name,PATH_MAX_LENGTH);
|
fill_pathname_join(directory,settings->input_remapping_directory,core_name,PATH_MAX_LENGTH);
|
||||||
|
|
|
@ -105,15 +105,15 @@ void menu_entries_get_core_title(char *s, size_t len)
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
const char *core_name = global ? global->menu.info.library_name : NULL;
|
const char *core_name = global ? global->menu.info.library_name : NULL;
|
||||||
const char *core_version = global ? global->menu.info.library_version : NULL;
|
const char *core_version = global ? global->menu.info.library_version : NULL;
|
||||||
struct retro_system_info *info = rarch_system_info_get_ptr();
|
rarch_system_info_t *info = rarch_system_info_get_ptr();
|
||||||
|
|
||||||
if (!core_name || core_name[0] == '\0')
|
if (!core_name || core_name[0] == '\0')
|
||||||
core_name = info->library_name;
|
core_name = info->info.library_name;
|
||||||
if (!core_name || core_name[0] == '\0')
|
if (!core_name || core_name[0] == '\0')
|
||||||
core_name = menu_hash_to_str(MENU_VALUE_NO_CORE);
|
core_name = menu_hash_to_str(MENU_VALUE_NO_CORE);
|
||||||
|
|
||||||
if (!core_version)
|
if (!core_version)
|
||||||
core_version = info->library_version;
|
core_version = info->info.library_version;
|
||||||
if (!core_version)
|
if (!core_version)
|
||||||
core_version = "";
|
core_version = "";
|
||||||
|
|
||||||
|
|
|
@ -820,8 +820,8 @@ static uint32_t implementation_magic_value(void)
|
||||||
const char *ver = PACKAGE_VERSION;
|
const char *ver = PACKAGE_VERSION;
|
||||||
unsigned api = pretro_api_version();
|
unsigned api = pretro_api_version();
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
struct retro_system_info *info = rarch_system_info_get_ptr();
|
rarch_system_info_t *info = rarch_system_info_get_ptr();
|
||||||
const char *lib = info ? info->library_name : NULL;
|
const char *lib = info ? info->info.library_name : NULL;
|
||||||
|
|
||||||
res |= api;
|
res |= api;
|
||||||
|
|
||||||
|
@ -829,7 +829,7 @@ static uint32_t implementation_magic_value(void)
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
res ^= lib[i] << (i & 0xf);
|
res ^= lib[i] << (i & 0xf);
|
||||||
|
|
||||||
lib = info->library_version;
|
lib = info->info.library_version;
|
||||||
len = strlen(lib);
|
len = strlen(lib);
|
||||||
|
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
|
|
38
retroarch.c
38
retroarch.c
|
@ -317,23 +317,23 @@ static void set_special_paths(char **argv, unsigned num_content)
|
||||||
sizeof(settings->system_directory));
|
sizeof(settings->system_directory));
|
||||||
}
|
}
|
||||||
|
|
||||||
struct retro_system_info *rarch_system_info_get_ptr(void)
|
rarch_system_info_t *rarch_system_info_get_ptr(void)
|
||||||
{
|
{
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
if (!global)
|
if (!global)
|
||||||
return NULL;
|
return NULL;
|
||||||
return &global->system.info;
|
return &global->system;
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_paths_redirect(const char *path)
|
void set_paths_redirect(const char *path)
|
||||||
{
|
{
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
struct retro_system_info *info = rarch_system_info_get_ptr();
|
rarch_system_info_t *info = rarch_system_info_get_ptr();
|
||||||
|
|
||||||
uint32_t global_library_name_hash = ((global && info->library_name &&
|
uint32_t global_library_name_hash = ((global && info->info.library_name &&
|
||||||
(info->library_name[0] != '\0'))
|
(info->info.library_name[0] != '\0'))
|
||||||
? djb2_calculate(info->library_name) : 0);
|
? djb2_calculate(info->info.library_name) : 0);
|
||||||
|
|
||||||
if(
|
if(
|
||||||
global_library_name_hash != 0 &&
|
global_library_name_hash != 0 &&
|
||||||
|
@ -346,7 +346,7 @@ void set_paths_redirect(const char *path)
|
||||||
fill_pathname_dir(
|
fill_pathname_dir(
|
||||||
global->savefile_dir,
|
global->savefile_dir,
|
||||||
global->savefile_dir,
|
global->savefile_dir,
|
||||||
info->library_name,
|
info->info.library_name,
|
||||||
sizeof(global->savefile_dir));
|
sizeof(global->savefile_dir));
|
||||||
|
|
||||||
// if path doesn't exist try to create it, if everything fails revert to the original path
|
// if path doesn't exist try to create it, if everything fails revert to the original path
|
||||||
|
@ -365,7 +365,7 @@ void set_paths_redirect(const char *path)
|
||||||
sizeof(global->savestate_dir));
|
sizeof(global->savestate_dir));
|
||||||
fill_pathname_dir(global->savestate_dir,
|
fill_pathname_dir(global->savestate_dir,
|
||||||
global->savestate_dir,
|
global->savestate_dir,
|
||||||
info->library_name,
|
info->info.library_name,
|
||||||
sizeof(global->savestate_dir));
|
sizeof(global->savestate_dir));
|
||||||
|
|
||||||
/* If path doesn't exist, try to create it.
|
/* If path doesn't exist, try to create it.
|
||||||
|
@ -1103,26 +1103,26 @@ void rarch_main_free(void)
|
||||||
static void init_system_info(void)
|
static void init_system_info(void)
|
||||||
{
|
{
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
struct retro_system_info *info = rarch_system_info_get_ptr();
|
rarch_system_info_t *info = rarch_system_info_get_ptr();
|
||||||
|
|
||||||
pretro_get_system_info(info);
|
pretro_get_system_info(&info->info);
|
||||||
|
|
||||||
if (!info->library_name)
|
if (!info->info.library_name)
|
||||||
info->library_name = "Unknown";
|
info->info.library_name = "Unknown";
|
||||||
if (!info->library_version)
|
if (!info->info.library_version)
|
||||||
info->library_version = "v0";
|
info->info.library_version = "v0";
|
||||||
|
|
||||||
#ifndef RARCH_CONSOLE
|
#ifndef RARCH_CONSOLE
|
||||||
snprintf(global->title_buf, sizeof(global->title_buf),
|
snprintf(global->title_buf, sizeof(global->title_buf),
|
||||||
RETRO_FRONTEND " : ");
|
RETRO_FRONTEND " : ");
|
||||||
#endif
|
#endif
|
||||||
strlcat(global->title_buf, info->library_name, sizeof(global->title_buf));
|
strlcat(global->title_buf, info->info.library_name, sizeof(global->title_buf));
|
||||||
strlcat(global->title_buf, " ", sizeof(global->title_buf));
|
strlcat(global->title_buf, " ", sizeof(global->title_buf));
|
||||||
strlcat(global->title_buf, info->library_version, sizeof(global->title_buf));
|
strlcat(global->title_buf, info->info.library_version, sizeof(global->title_buf));
|
||||||
strlcpy(global->system.valid_extensions, info->valid_extensions ?
|
strlcpy(global->system.valid_extensions, info->info.valid_extensions ?
|
||||||
info->valid_extensions : DEFAULT_EXT,
|
info->info.valid_extensions : DEFAULT_EXT,
|
||||||
sizeof(global->system.valid_extensions));
|
sizeof(global->system.valid_extensions));
|
||||||
global->system.block_extract = info->block_extract;
|
global->system.block_extract = info->info.block_extract;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
2
system.h
2
system.h
|
@ -57,7 +57,7 @@ typedef struct rarch_system_info
|
||||||
unsigned num_ports;
|
unsigned num_ports;
|
||||||
} rarch_system_info_t;
|
} rarch_system_info_t;
|
||||||
|
|
||||||
struct retro_system_info *rarch_system_info_get_ptr(void);
|
rarch_system_info_t *rarch_system_info_get_ptr(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue