shift pistol HUD sprite
[d2d-psx.git] / src / glob.h
blob00c4a9b74f7f96f919ca1c5c49602e2e89244b9e
1 /*
2 * Copyright (C) Prikol Software 1996-1997
3 * Copyright (C) Aleksey Volynskov 1996-1997
4 * Copyright (C) <ARembo@gmail.com> 2011
5 * Copyright (C) fgsfds 2019
7 * This file is part of the Doom2D PSX project.
9 * Doom2D PSX is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
13 * Doom2D PSX is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, see <http://www.gnu.org/licenses/> or
20 * write to the Free Software Foundation, Inc.,
21 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 // Globals
26 #ifndef MYGLOB
27 #define MYGLOB
29 #ifndef NULL
30 # define NULL 0
31 #endif
33 #define ON 1
34 #define OFF 0
35 #define TRUE 1
36 #define FALSE 0
38 typedef unsigned char byte;
39 typedef unsigned short word;
40 typedef unsigned int dword;
42 #define logo(args...) printf(args)
43 void logo_gas(int, int);
45 extern int gammaa;
46 extern int snd_card;
47 extern int _cpu;
49 #define __MAX_PATH 255
50 #define __MAX_DRIVE 50
51 #define __MAX_DIR 100
52 #define __MAX_FNAME 50
53 #define __MAX_EXT 50
55 // define this to 1 if your DOOM2D.WAD was priority-sorted by splitwad.exe
56 // for nice sequential CD reads
57 #ifndef SORTED_WAD
58 # define SORTED_WAD 1
59 #endif
61 #ifndef offsetof
62 # define offsetof(st, m) ((unsigned long)&(((st *)0)->m))
63 #endif
65 #define bswap16(x) (((x) >> 8) | (((x) & 0xFF) << 8))
66 #define bswap32(x) ((bswap16((x) >> 16) & 0xFFFF) | (bswap16((x) & 0xFFFF) << 16))
68 #define min(a, b) ((a) < (b) ? (a) : (b))
69 #define max(a, b) ((a) > (b) ? (a) : (b))
71 #define myrand(a) (rand() % (a))
73 typedef struct CDFILE CDFILE;
75 CDFILE *cd_fopen(const char *fname);
76 void cd_fclose(CDFILE *f);
77 long cd_fread(void *ptr, long size, long num, CDFILE *f);
78 void cd_freadordie(void *ptr, long size, long num, CDFILE *f);
79 long cd_fseek(CDFILE *f, long ofs, int whence);
80 long cd_ftell(CDFILE *f);
81 long cd_fsize(CDFILE *f);
82 int cd_feof(CDFILE *f);
84 // don't actually need casecmp except in one instance
85 #define strcasecmp strcmp
86 #define strncasecmp strncmp
88 #define SCRW 320
89 #define SCRH 240
91 #ifndef REGION
92 # define REGION MODE_PAL
93 #endif
95 #if REGION == MODE_PAL
96 # define SECHBLANKS 15733
97 # define VBLANKTIME 315
98 # define FRAMETIME 787
99 # define SCRY 28
100 #else
101 # define SECHBLANKS 15625
102 # define VBLANKTIME 260
103 # define FRAMETIME 781
104 # define SCRY 0
105 #endif
107 #define FRAME_MSEC 50
109 #endif // ifndef MYGLOB