1 /***************************************************************************
2 * Copyright (C) 2007 Ryan Schultz, PCSX-df Team, PCSX team *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307 USA. *
18 ***************************************************************************/
21 * This file contains common definitions and includes for all parts of the
25 #ifndef __PSXCOMMON_H__
26 #define __PSXCOMMON_H__
34 // XXX: don't care but maybe fix it someday
35 #if defined(__GNUC__) && __GNUC__ >= 8
36 #pragma GCC diagnostic ignored "-Wformat-truncation"
37 #pragma GCC diagnostic ignored "-Wformat-overflow"
38 #pragma GCC diagnostic ignored "-Wstringop-truncation"
40 // devkitpro has uint32_t as long, unfortunately
42 #pragma GCC diagnostic ignored "-Wformat"
55 #include <sys/types.h>
64 typedef intptr_t sptr;
70 typedef uintptr_t uptr;
72 typedef uint8_t boolean;
86 #define strnicmp strncasecmp
88 #define __inline inline
90 // Enables NLS/internationalization if active
96 #define _(String) gettext(String)
98 # define N_(String) gettext_noop (String)
100 # define N_(String) (String)
105 #define _(msgid) msgid
106 #define N_(msgid) msgid
113 void __Log(char *fmt, ...);
115 #define CYCLE_MULT_DEFAULT 175
118 char Gpu[MAXPATHLEN];
119 char Spu[MAXPATHLEN];
120 char Cdr[MAXPATHLEN];
121 char Pad1[MAXPATHLEN];
122 char Pad2[MAXPATHLEN];
123 char Net[MAXPATHLEN];
124 char Sio1[MAXPATHLEN];
125 char Mcd1[MAXPATHLEN];
126 char Mcd2[MAXPATHLEN];
127 char Bios[MAXPATHLEN];
128 char BiosDir[MAXPATHLEN];
129 char PluginsDir[MAXPATHLEN];
130 char PatchesDir[MAXPATHLEN];
136 boolean CHD_Precache; /* loads disk image into memory, works with CHD only. */
142 boolean icache_emulation;
143 boolean DisableStalls;
144 boolean PreciseExceptions;
146 int cycle_multiplier; // 100 for 1.0
147 int cycle_multiplier_override;
149 s8 FractionalFramerate; // ~49.75 and ~59.81 instead of 50 and 60
150 u8 Cpu; // CPU_DYNAREC or CPU_INTERPRETER
151 u8 PsxType; // PSX_TYPE_NTSC or PSX_TYPE_PAL
153 boolean cdr_read_timing;
154 boolean gpu_slow_list_walking;
155 boolean gpu_centering;
156 boolean dualshock_init_analog;
157 boolean gpu_timing1024;
158 boolean fractional_Framerate;
162 extern PcsxConfig Config;
163 extern boolean NetOpened;
165 struct PcsxSaveFuncs {
166 void *(*open)(const char *name, const char *mode);
167 int (*read)(void *file, void *buf, u32 len);
168 int (*write)(void *file, const void *buf, u32 len);
169 long (*seek)(void *file, long offs, int whence);
170 void (*close)(void *file);
172 extern struct PcsxSaveFuncs SaveFuncs;
174 #define gzfreeze(ptr, size) { \
175 if (Mode == 1) SaveFuncs.write(f, ptr, size); \
176 if (Mode == 0) SaveFuncs.read(f, ptr, size); \
179 #define PSXCLK 33868800 /* 33.8688 MHz */