Update
[pcsx_rearmed.git] / libpcsxcore / psxcommon.h
index 500c44a..19c8d77 100644 (file)
@@ -40,9 +40,10 @@ extern "C" {
 #include <math.h>
 #include <time.h>
 #include <ctype.h>
+#ifndef __SWITCH__
 #include <sys/types.h>
+#endif
 #include <assert.h>
-#include <zlib.h>
 
 // Define types
 typedef int8_t s8;
@@ -69,9 +70,8 @@ typedef uint8_t boolean;
 
 // Local includes
 #include "system.h"
-#include "debug.h"
 
-#if defined (__LINUX__) || defined (__MACOSX__)
+#ifndef _WIN32
 #define strnicmp strncasecmp
 #endif
 #define __inline inline
@@ -121,6 +121,7 @@ typedef struct {
        boolean PsxAuto;
        boolean Cdda;
        boolean HLE;
+       boolean SlowBoot;
        boolean Debug;
        boolean PsxOut;
        boolean SpuIrq;
@@ -137,9 +138,18 @@ typedef struct {
 extern PcsxConfig Config;
 extern boolean NetOpened;
 
+struct PcsxSaveFuncs {
+       void *(*open)(const char *name, const char *mode);
+       int   (*read)(void *file, void *buf, u32 len);
+       int   (*write)(void *file, const void *buf, u32 len);
+       long  (*seek)(void *file, long offs, int whence);
+       void  (*close)(void *file);
+};
+extern struct PcsxSaveFuncs SaveFuncs;
+
 #define gzfreeze(ptr, size) { \
-       if (Mode == 1) gzwrite(f, ptr, size); \
-       if (Mode == 0) gzread(f, ptr, size); \
+       if (Mode == 1) SaveFuncs.write(f, ptr, size); \
+       if (Mode == 0) SaveFuncs.read(f, ptr, size); \
 }
 
 // Make the timing events trigger faster as we are currently assuming everything