diff --git a/content.c b/content.c index 91552794d2..05b6250e92 100644 --- a/content.c +++ b/content.c @@ -13,21 +13,10 @@ * You should have received a copy of the GNU General Public License along with RetroArch. * If not, see . */ - -#include "content.h" -#include "file_ops.h" -#include -#include "general.h" #include #include #include #include -#include "dynamic.h" -#include "movie.h" -#include "patch.h" -#include "compat/strl.h" -#include -#include #ifdef _WIN32 #ifdef _XBOX @@ -41,6 +30,19 @@ #endif #endif +#include +#include +#include +#include + +#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")) { diff --git a/netplay.c b/netplay.c index 7227aaac64..347a13ee24 100644 --- a/netplay.c +++ b/netplay.c @@ -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++) diff --git a/retroarch.c b/retroarch.c index 4650468540..e0f8b1515f 100644 --- a/retroarch.c +++ b/retroarch.c @@ -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" diff --git a/runloop.h b/runloop.h index 534f98576b..9cb2c5491b 100644 --- a/runloop.h +++ b/runloop.h @@ -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 diff --git a/system.h b/system.h new file mode 100644 index 0000000000..b05e3ce102 --- /dev/null +++ b/system.h @@ -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 . + */ + +#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