#include "config.h"
+// XXX: don't care but maybe fix it someday
+#if defined(__GNUC__) && __GNUC__ >= 8
+#pragma GCC diagnostic ignored "-Wformat-truncation"
+#pragma GCC diagnostic ignored "-Wformat-overflow"
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
+#endif
+
// System includes
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <assert.h>
-#include <zlib.h>
// Define types
typedef int8_t s8;
// Local includes
#include "system.h"
-#if defined (__LINUX__) || defined (__MACOSX__)
+#ifndef _WIN32
#define strnicmp strncasecmp
#endif
#define __inline inline
boolean RCntFix;
boolean UseNet;
boolean VSyncWA;
- boolean CdrReschedule;
+ boolean icache_emulation;
+ boolean DisableStalls;
u8 Cpu; // CPU_DYNAREC or CPU_INTERPRETER
u8 PsxType; // PSX_TYPE_NTSC or PSX_TYPE_PAL
#ifdef _WIN32
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