From 73bda1add93add955c4420da03a1c26ba3d96acc Mon Sep 17 00:00:00 2001 From: kub Date: Thu, 27 Jan 2022 22:31:09 +0000 Subject: [PATCH] core, libretro vfs support --- Makefile.libretro | 4 ++-- pico/cart.c | 4 ---- pico/cd/cd_image.c | 4 ---- pico/cd/cd_parse.c | 4 ---- pico/patch.c | 4 ---- pico/pico_port.h | 4 ++++ pico/sek.c | 4 ---- pico/state.c | 4 ---- platform/common/config_file.c | 4 ---- platform/common/emu.c | 4 ---- platform/common/main.c | 4 ---- platform/libretro/libretro.c | 4 ---- unzip/unzip.h | 4 ++++ zlib/gzio.c | 4 ++++ 14 files changed, 14 insertions(+), 42 deletions(-) diff --git a/Makefile.libretro b/Makefile.libretro index aa20d456..3c7c67a2 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -34,7 +34,8 @@ CFLAGS += -I platform/libretro/libretro-common/include/streams CFLAGS += -I platform/libretro/libretro-common/include/string CFLAGS += -I platform/libretro/libretro-common/include/vfs -STATIC_LINKING:= 0 +USE_LIBRETRO_VFS := 1 +STATIC_LINKING := 0 TARGET_NAME := picodrive LIBM := -lm GIT_VERSION ?= $(shell git rev-parse --short HEAD || echo unknown) @@ -457,7 +458,6 @@ else ifneq (,$(findstring windows_msvc2017,$(platform))) ARCH = x86_64 SHARED := LIBM := - USE_LIBRETRO_VFS = 1 NO_ALIGN_FUNCTIONS = 1 CFLAGS += -DHAVE_VSNPRINTF diff --git a/pico/cart.c b/pico/cart.c index 1b15a454..39d697c8 100644 --- a/pico/cart.c +++ b/pico/cart.c @@ -10,10 +10,6 @@ #include "pico_int.h" #include -#ifdef USE_LIBRETRO_VFS -#include "file_stream_transforms.h" -#endif - #if defined(USE_LIBCHDR) #include "libchdr/chd.h" #include "libchdr/cdrom.h" diff --git a/pico/cd/cd_image.c b/pico/cd/cd_image.c index 530071a6..3f220f88 100644 --- a/pico/cd/cd_image.c +++ b/pico/cd/cd_image.c @@ -11,10 +11,6 @@ #include "cdd.h" #include "cd_parse.h" -#ifdef USE_LIBRETRO_VFS -#include "file_stream_transforms.h" -#endif - #if defined(__GNUC__) && __GNUC__ >= 7 #pragma GCC diagnostic ignored "-Wformat-truncation" #endif diff --git a/pico/cd/cd_parse.c b/pico/cd/cd_parse.c index 974e9930..574070dd 100644 --- a/pico/cd/cd_parse.c +++ b/pico/cd/cd_parse.c @@ -13,10 +13,6 @@ #include "cd_parse.h" // #define elprintf(w,f,...) printf(f "\n",##__VA_ARGS__); -#ifdef USE_LIBRETRO_VFS -#include "file_stream_transforms.h" -#endif - #if defined(USE_LIBCHDR) #include "libchdr/chd.h" #include "libchdr/cdrom.h" diff --git a/pico/patch.c b/pico/patch.c index b4c2d898..cd4620d7 100644 --- a/pico/patch.c +++ b/pico/patch.c @@ -25,10 +25,6 @@ #include "memory.h" #include "patch.h" -#ifdef USE_LIBRETRO_VFS -#include "file_stream_transforms.h" -#endif - struct patch { unsigned int addr; diff --git a/pico/pico_port.h b/pico/pico_port.h index dc9cdffa..41a4ce2f 100644 --- a/pico/pico_port.h +++ b/pico/pico_port.h @@ -8,6 +8,10 @@ #endif #include "pico_types.h" +#ifdef USE_LIBRETRO_VFS +#include "file_stream_transforms.h" +#endif + #if defined(__GNUC__) && defined(__i386__) #define REGPARM(x) __attribute__((regparm(x))) #else diff --git a/pico/sek.c b/pico/sek.c index b5649dcf..99808373 100644 --- a/pico/sek.c +++ b/pico/sek.c @@ -10,10 +10,6 @@ #include "pico_int.h" #include "memory.h" -#ifdef USE_LIBRETRO_VFS -#include "file_stream_transforms.h" -#endif - /* context */ // Cyclone 68000 #ifdef EMU_C68K diff --git a/pico/state.c b/pico/state.c index af2d4cc0..123b1acd 100644 --- a/pico/state.c +++ b/pico/state.c @@ -14,10 +14,6 @@ #include "sound/emu2413/emu2413.h" #include "state.h" -#ifdef USE_LIBRETRO_VFS -#include "file_stream_transforms.h" -#endif - // sn76496 & ym2413 extern int *sn76496_regs; extern OPLL old_opll; diff --git a/platform/common/config_file.c b/platform/common/config_file.c index c4f611d0..6f72f75c 100644 --- a/platform/common/config_file.c +++ b/platform/common/config_file.c @@ -18,10 +18,6 @@ #include "../libpicofe/lprintf.h" #include "config_file.h" -#ifdef USE_LIBRETRO_VFS -#include "file_stream_transforms.h" -#endif - static char *mystrip(char *str); #ifndef _MSC_VER diff --git a/platform/common/emu.c b/platform/common/emu.c index 5d4f8ffb..2352bf53 100644 --- a/platform/common/emu.c +++ b/platform/common/emu.c @@ -28,10 +28,6 @@ #include #include -#ifdef USE_LIBRETRO_VFS -#include "file_stream_transforms.h" -#endif - #if defined(__GNUC__) && __GNUC__ >= 7 #pragma GCC diagnostic ignored "-Wformat-truncation" #endif diff --git a/platform/common/main.c b/platform/common/main.c index a7a8312c..3c1998cd 100644 --- a/platform/common/main.c +++ b/platform/common/main.c @@ -21,10 +21,6 @@ #include "version.h" #include -#ifdef USE_LIBRETRO_VFS -#include "file_stream_transforms.h" -#endif - static int load_state_slot = -1; char **g_argv; diff --git a/platform/libretro/libretro.c b/platform/libretro/libretro.c index 8646865a..9a4e9c03 100644 --- a/platform/libretro/libretro.c +++ b/platform/libretro/libretro.c @@ -32,10 +32,6 @@ #include #endif -#ifdef USE_LIBRETRO_VFS -#include "file_stream_transforms.h" -#endif - #if defined(RENDER_GSKIT_PS2) #include #include "libretro-common/include/libretro_gskit_ps2.h" diff --git a/unzip/unzip.h b/unzip/unzip.h index 8d15d05e..f92b8a31 100644 --- a/unzip/unzip.h +++ b/unzip/unzip.h @@ -3,6 +3,10 @@ #include +#ifdef USE_LIBRETRO_VFS +#include "file_stream_transforms.h" +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/zlib/gzio.c b/zlib/gzio.c index 02a0a014..9f1e0434 100644 --- a/zlib/gzio.c +++ b/zlib/gzio.c @@ -9,6 +9,10 @@ #include +#ifdef USE_LIBRETRO_VFS +#include "file_stream_transforms.h" +#endif + #include "zutil.h" #ifdef NO_DEFLATE /* for compatibility with old definition */ -- 2.39.5