Use rarch_system_info_get_ptr

This commit is contained in:
twinaphex 2015-06-25 11:02:01 +02:00
parent faead5c250
commit ac2a13a136
5 changed files with 59 additions and 24 deletions

View File

@ -13,21 +13,10 @@
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "content.h"
#include "file_ops.h"
#include <file/file_path.h>
#include "general.h"
#include <stdlib.h>
#include <boolean.h>
#include <string.h>
#include <time.h>
#include "dynamic.h"
#include "movie.h"
#include "patch.h"
#include "compat/strl.h"
#include <rhash.h>
#include <file/file_extract.h>
#ifdef _WIN32
#ifdef _XBOX
@ -41,6 +30,19 @@
#endif
#endif
#include <compat/strl.h>
#include <file/file_path.h>
#include <file/file_extract.h>
#include <rhash.h>
#include "content.h"
#include "file_ops.h"
#include "general.h"
#include "dynamic.h"
#include "movie.h"
#include "patch.h"
#include "system.h"
/**
* read_content_file:
* @path : buffer of the content file.
@ -364,8 +366,9 @@ static bool load_content_need_fullpath(
bool ret = false;
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
struct retro_system_info *sys_info= rarch_system_info_get_ptr();
if (global->system.info.block_extract)
if (sys_info && sys_info->block_extract)
return true;
if (!need_fullpath)
@ -516,6 +519,7 @@ bool init_content_file(void)
struct string_list *content = NULL;
const struct retro_subsystem_info *special = NULL;
settings_t *settings = config_get_ptr();
struct retro_system_info *info = rarch_system_info_get_ptr();
global_t *global = global_get_ptr();
global->temporary_content = string_list_new();
@ -579,8 +583,8 @@ bool init_content_file(void)
}
else
{
attr.i = global->system.info.block_extract;
attr.i |= global->system.info.need_fullpath << 1;
attr.i = info->block_extract;
attr.i |= info->need_fullpath << 1;
attr.i |= (!global->system.no_content) << 2;
string_list_append(content,
(global->libretro_no_content && settings->core.set_supports_no_game_enable) ? "" : global->fullpath, attr);
@ -599,7 +603,7 @@ bool init_content_file(void)
ext = path_get_extension(content->elems[i].data);
valid_ext = special ? special->roms[i].valid_extensions :
global->system.info.valid_extensions;
info->valid_extensions;
if (ext && !strcasecmp(ext, "zip"))
{

View File

@ -26,6 +26,7 @@
#include "autosave.h"
#include "dynamic.h"
#include "intl/intl.h"
#include "system.h"
struct delta_frame
{
@ -815,12 +816,12 @@ static bool init_socket(netplay_t *netplay, const char *server, uint16_t port)
static uint32_t implementation_magic_value(void)
{
size_t i, len;
uint32_t res = 0;
const char *lib = NULL;
const char *ver = PACKAGE_VERSION;
unsigned api = pretro_api_version();
global_t *global = global_get_ptr();
lib = global->system.info.library_name;
uint32_t res = 0;
const char *ver = PACKAGE_VERSION;
unsigned api = pretro_api_version();
global_t *global = global_get_ptr();
struct retro_system_info *info = rarch_system_info_get_ptr();
const char *lib = info ? info->library_name : NULL;
res |= api;
@ -828,7 +829,7 @@ static uint32_t implementation_magic_value(void)
for (i = 0; i < len; i++)
res ^= lib[i] << (i & 0xf);
lib = global->system.info.library_version;
lib = info->library_version;
len = strlen(lib);
for (i = 0; i < len; i++)

View File

@ -50,6 +50,7 @@
#include "runloop_data.h"
#include "performance.h"
#include "cheats.h"
#include "system.h"
#include "git_version.h"
#include "intl/intl.h"

View File

@ -363,8 +363,6 @@ void rarch_main_state_free(void);
void rarch_main_global_free(void);
struct retro_system_info *rarch_system_info_get_ptr(void);
#ifdef __cplusplus
}
#endif

31
system.h Normal file
View File

@ -0,0 +1,31 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2011-2015 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __RARCH_SYSTEM_H
#define __RARCH_SYSTEM_H
#include "libretro.h"
#ifdef __cplusplus
extern "C" {
#endif
struct retro_system_info *rarch_system_info_get_ptr(void);
#ifdef __cplusplus
}
#endif
#endif