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
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);
49 #define __MAX_PATH 255
50 #define __MAX_DRIVE 50
52 #define __MAX_FNAME 50
55 // define this to 1 if your DOOM2D.WAD was priority-sorted by splitwad.exe
56 // for nice sequential CD reads
62 # define offsetof(st, m) ((unsigned long)&(((st *)0)->m))
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
92 # define REGION MODE_PAL
95 #if REGION == MODE_PAL
96 # define SECHBLANKS 15733
97 # define VBLANKTIME 315
98 # define FRAMETIME 787
101 # define SECHBLANKS 15625
102 # define VBLANKTIME 260
103 # define FRAMETIME 781
107 #define FRAME_MSEC 50
109 #endif // ifndef MYGLOB