X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fpsxcommon.h;h=9f5444ec4c78fbe91cce8b2d09de96bf43c7bfdb;hb=HEAD;hp=500c44ad663b00a336bf5c3d30fa2c0d1b4d69cf;hpb=ef79bbde537d6b9c745a7d86cb9df1d04c35590d;p=pcsx_rearmed.git diff --git a/libpcsxcore/psxcommon.h b/libpcsxcore/psxcommon.h index 500c44ad..53bda973 100644 --- a/libpcsxcore/psxcommon.h +++ b/libpcsxcore/psxcommon.h @@ -31,6 +31,17 @@ extern "C" { #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 +// devkitpro has uint32_t as long, unfortunately +#ifdef _3DS +#pragma GCC diagnostic ignored "-Wformat" +#endif + // System includes #include #include @@ -40,9 +51,10 @@ extern "C" { #include #include #include +#ifndef __SWITCH__ #include +#endif #include -#include // Define types typedef int8_t s8; @@ -69,9 +81,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 @@ -101,6 +112,8 @@ extern int Log; void __Log(char *fmt, ...); +#define CYCLE_MULT_DEFAULT 175 + typedef struct { char Gpu[MAXPATHLEN]; char Spu[MAXPATHLEN]; @@ -108,7 +121,7 @@ typedef struct { char Pad1[MAXPATHLEN]; char Pad2[MAXPATHLEN]; char Net[MAXPATHLEN]; - char Sio1[MAXPATHLEN]; + char Sio1[MAXPATHLEN]; char Mcd1[MAXPATHLEN]; char Mcd2[MAXPATHLEN]; char Bios[MAXPATHLEN]; @@ -116,36 +129,52 @@ typedef struct { char PluginsDir[MAXPATHLEN]; char PatchesDir[MAXPATHLEN]; boolean Xa; - boolean Sio; boolean Mdec; boolean PsxAuto; boolean Cdda; + boolean AsyncCD; + boolean CHD_Precache; /* loads disk image into memory, works with CHD only. */ boolean HLE; + boolean SlowBoot; boolean Debug; boolean PsxOut; - boolean SpuIrq; - boolean RCntFix; boolean UseNet; - boolean VSyncWA; + boolean icache_emulation; + boolean DisableStalls; + boolean PreciseExceptions; + int cycle_multiplier; // 100 for 1.0 + int cycle_multiplier_override; + s8 GpuListWalking; + s8 FractionalFramerate; // ~49.75 and ~59.81 instead of 50 and 60 u8 Cpu; // CPU_DYNAREC or CPU_INTERPRETER u8 PsxType; // PSX_TYPE_NTSC or PSX_TYPE_PAL -#ifdef _WIN32 - char Lang[256]; -#endif + struct { + boolean cdr_read_timing; + boolean gpu_slow_list_walking; + boolean gpu_centering; + boolean dualshock_init_analog; + boolean gpu_timing1024; + boolean fractional_Framerate; + } hacks; } PcsxConfig; 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 -// takes one cycle, which is not the case on real hardware. -// FIXME: Count the proper cycle and get rid of this -#define BIAS 2 #define PSXCLK 33868800 /* 33.8688 MHz */ enum {