2006-03-28 15:44:01 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2005 Michiel van der Kolk, Jens Arnold
|
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2006-03-28 15:44:01 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
#ifndef __ROCKMACROS_H__
|
|
|
|
#define __ROCKMACROS_H__
|
|
|
|
|
|
|
|
#include "plugin.h"
|
|
|
|
#include "ctype.h"
|
|
|
|
#include "autoconf.h"
|
|
|
|
#include "z_zone.h"
|
|
|
|
|
2006-04-03 17:11:42 +00:00
|
|
|
extern bool noprintf;
|
2006-04-15 22:08:36 +00:00
|
|
|
extern bool doomexit;
|
2006-03-28 15:44:01 +00:00
|
|
|
|
|
|
|
/* libc functions */
|
|
|
|
int printf(const char *fmt, ...);
|
|
|
|
int fileexists(const char * fname);
|
|
|
|
char *my_strtok( char * s, const char * delim );
|
2010-05-06 21:04:40 +00:00
|
|
|
#undef alloca
|
2006-03-28 15:44:01 +00:00
|
|
|
#define alloca __builtin_alloca
|
2010-05-06 21:04:40 +00:00
|
|
|
#undef fdprintf
|
|
|
|
#define fdprintf(...) rb->fdprintf(__VA_ARGS__)
|
|
|
|
#undef vsnprintf
|
2006-03-28 15:44:01 +00:00
|
|
|
#define vsnprintf(...) rb->vsnprintf(__VA_ARGS__)
|
2010-05-06 21:04:40 +00:00
|
|
|
#undef read_line
|
2006-12-18 17:49:04 +00:00
|
|
|
#define read_line(a,b,c) rb->read_line((a),(b),(c))
|
2006-03-28 15:44:01 +00:00
|
|
|
|
2010-06-21 16:53:00 +00:00
|
|
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
2010-05-06 17:35:13 +00:00
|
|
|
#define open(a, ...) rb->open((a), __VA_ARGS__)
|
2009-01-08 20:54:36 +00:00
|
|
|
#define close(a) rb->close((a))
|
|
|
|
#else
|
2010-05-06 17:35:13 +00:00
|
|
|
int my_open(const char *file, int flags, ...);
|
2009-01-08 20:54:36 +00:00
|
|
|
int my_close(int id);
|
2010-05-06 17:35:13 +00:00
|
|
|
#define open(a, ...) my_open((a), __VA_ARGS__)
|
2006-03-28 15:44:01 +00:00
|
|
|
#define close(a) my_close((a))
|
2009-01-08 20:54:36 +00:00
|
|
|
#endif
|
|
|
|
|
2006-03-28 15:44:01 +00:00
|
|
|
#define lseek(a,b,c) rb->lseek((a),(b),(c))
|
2007-07-20 17:06:55 +00:00
|
|
|
#define filesize(a) rb->filesize((a))
|
2007-09-08 12:20:53 +00:00
|
|
|
#define read(a,b,c) rb->read((a),(b),(c))
|
|
|
|
#define write(a,b,c) rb->write((a),(b),(c))
|
2010-05-06 21:04:40 +00:00
|
|
|
#undef strtok
|
2006-12-13 04:44:17 +00:00
|
|
|
#define strtok(a,b) my_strtok((a),(b))
|
2010-05-06 21:04:40 +00:00
|
|
|
#undef strcat
|
2006-03-28 15:44:01 +00:00
|
|
|
#define strcat(a,b) rb->strcat((a),(b))
|
2010-05-06 21:04:40 +00:00
|
|
|
#undef memset
|
2006-03-28 15:44:01 +00:00
|
|
|
#define memset(a,b,c) rb->memset((a),(b),(c))
|
2010-05-06 21:04:40 +00:00
|
|
|
#undef memmove
|
2006-03-28 15:44:01 +00:00
|
|
|
#define memmove(a,b,c) rb->memmove((a),(b),(c))
|
2010-05-06 21:04:40 +00:00
|
|
|
#undef memcmp
|
2006-03-28 15:44:01 +00:00
|
|
|
#define memcmp(a,b,c) rb->memcmp((a),(b),(c))
|
2010-05-06 21:04:40 +00:00
|
|
|
#undef memchr
|
2006-03-28 15:44:01 +00:00
|
|
|
#define memchr(a,b,c) rb->memchr((a),(b),(c))
|
2010-05-06 21:04:40 +00:00
|
|
|
#undef strcpy
|
2006-03-28 15:44:01 +00:00
|
|
|
#define strcpy(a,b) rb->strcpy((a),(b))
|
2010-05-06 21:04:40 +00:00
|
|
|
#undef strlen
|
2006-03-28 15:44:01 +00:00
|
|
|
#define strlen(a) rb->strlen((a))
|
2010-05-06 21:04:40 +00:00
|
|
|
#undef strcmp
|
2006-03-28 15:44:01 +00:00
|
|
|
#define strcmp(a,b) rb->strcmp((a),(b))
|
2010-05-06 21:04:40 +00:00
|
|
|
#undef strncmp
|
2006-03-28 15:44:01 +00:00
|
|
|
#define strncmp(a,b,c) rb->strncmp((a),(b),(c))
|
2010-05-06 21:04:40 +00:00
|
|
|
#undef strchr
|
2006-03-28 15:44:01 +00:00
|
|
|
#define strchr(a,b) rb->strchr((a),(b))
|
2010-05-06 21:04:40 +00:00
|
|
|
#undef strrchr
|
2006-03-28 15:44:01 +00:00
|
|
|
#define strrchr(a,b) rb->strrchr((a),(b))
|
2010-05-06 21:04:40 +00:00
|
|
|
#undef strcasecmp
|
2006-03-28 15:44:01 +00:00
|
|
|
#define strcasecmp(a,b) rb->strcasecmp((a),(b))
|
2010-05-06 21:04:40 +00:00
|
|
|
#undef strncasecmp
|
2006-03-28 15:44:01 +00:00
|
|
|
#define strncasecmp(a,b,c) rb->strncasecmp((a),(b),(c))
|
|
|
|
#define srand(a) rb->srand((a))
|
|
|
|
#define rand() rb->rand()
|
|
|
|
#define atoi(a) rb->atoi((a))
|
|
|
|
#define strcat(a,b) rb->strcat((a),(b))
|
|
|
|
#define snprintf rb->snprintf
|
|
|
|
|
|
|
|
#define PACKEDATTR __attribute__((packed)) // Needed for a few things
|
2007-01-13 15:16:10 +00:00
|
|
|
#define GAMEBASE ROCKBOX_DIR "/doom/"
|
2006-03-28 15:44:01 +00:00
|
|
|
//#define SIMPLECHECKS
|
|
|
|
#define NO_PREDEFINED_LUMPS
|
|
|
|
#define TABLES_AS_LUMPS // This frees up alot of space in the plugin buffer
|
2006-04-08 22:53:26 +00:00
|
|
|
|
|
|
|
#define MAKE_FOURCC(a,b,c,d) (uint32_t)((((a)<<24)|((b)<<16)|((c)<<8)|(d)))
|
|
|
|
|
|
|
|
/* Config file magic - increment the version number whenever the settings
|
|
|
|
structure changes.
|
|
|
|
*/
|
|
|
|
#define DOOM_CONFIG_MAGIC MAKE_FOURCC('D','O','O','M')
|
2007-01-17 18:52:24 +00:00
|
|
|
#define DOOM_CONFIG_VERSION 3
|
2006-04-08 22:53:26 +00:00
|
|
|
|
2006-03-28 15:44:01 +00:00
|
|
|
#endif
|