summaryrefslogtreecommitdiff
path: root/apps/plugins/doom/rockmacros.h
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-03-28 15:44:01 +0000
committerDave Chapman <dave@dchapman.com>2006-03-28 15:44:01 +0000
commit47f4a458d636a889e955e68f896708f1276febc0 (patch)
tree99f770c02ef606f0abbdcd332ac39e69830d8007 /apps/plugins/doom/rockmacros.h
parentfff7d6157d56f233cad5c2003475e47a5ff809a7 (diff)
downloadrockbox-47f4a458d636a889e955e68f896708f1276febc0.tar.gz
rockbox-47f4a458d636a889e955e68f896708f1276febc0.zip
Patch #2969 - Doom! Currently only working on the H300.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9312 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/doom/rockmacros.h')
-rw-r--r--apps/plugins/doom/rockmacros.h93
1 files changed, 93 insertions, 0 deletions
diff --git a/apps/plugins/doom/rockmacros.h b/apps/plugins/doom/rockmacros.h
new file mode 100644
index 0000000000..6caeb2aa8a
--- /dev/null
+++ b/apps/plugins/doom/rockmacros.h
@@ -0,0 +1,93 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2005 Michiel van der Kolk, Jens Arnold
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19#ifndef __ROCKMACROS_H__
20#define __ROCKMACROS_H__
21
22#include "plugin.h"
23#include "ctype.h"
24#include "autoconf.h"
25#include "z_zone.h"
26
27extern struct plugin_api* rb;
28
29/* libc functions */
30int printf(const char *fmt, ...);
31int fileexists(const char * fname);
32int my_open(const char *file, int flags);
33int my_close(int id);
34char *my_strtok( char * s, const char * delim );
35#define alloca __builtin_alloca
36#define fprintf(...) rb->fdprintf(__VA_ARGS__)
37#define vsnprintf(...) rb->vsnprintf(__VA_ARGS__)
38
39#ifdef SIMULATOR
40#undef opendir
41#undef closedir
42#undef mkdir
43#undef open
44#undef lseek
45#undef filesize
46#define opendir(a) rb->sim_opendir((a))
47#define closedir(a) rb->sim_closedir((a))
48#define mkdir(a,b) rb->sim_mkdir((a),(b))
49#define open(a,b) rb->sim_open((a),(b))
50#define lseek(a,b,c) rb->sim_lseek((a),(b),(c))
51#define filesize(a) rb->sim_filesize((a))
52#else /* !SIMULATOR */
53#define opendir(a) rb->opendir((a))
54#define closedir(a) rb->closedir((a))
55#define filesize(a) rb->filesize((a))
56#define mkdir(a) rb->mkdir((a),0777)
57#define open(a,b) my_open((a),(b))
58#define close(a) my_close((a))
59#define lseek(a,b,c) rb->lseek((a),(b),(c))
60#endif /* !SIMULATOR */
61
62#define strcat(a,b) rb->strcat((a),(b))
63#define read(a,b,c) rb->read((a),(b),(c))
64#define write(a,b,c) rb->write((a),(b),(c))
65#define memset(a,b,c) rb->memset((a),(b),(c))
66#define memmove(a,b,c) rb->memmove((a),(b),(c))
67#define memcmp(a,b,c) rb->memcmp((a),(b),(c))
68#define memchr(a,b,c) rb->memchr((a),(b),(c))
69#define strcpy(a,b) rb->strcpy((a),(b))
70#define strncpy(a,b,c) rb->strncpy((a),(b),(c))
71#define strlen(a) rb->strlen((a))
72#define strcmp(a,b) rb->strcmp((a),(b))
73#define strncmp(a,b,c) rb->strncmp((a),(b),(c))
74#define strchr(a,b) rb->strchr((a),(b))
75#define strrchr(a,b) rb->strrchr((a),(b))
76#define strcasecmp(a,b) rb->strcasecmp((a),(b))
77#define strncasecmp(a,b,c) rb->strncasecmp((a),(b),(c))
78#define srand(a) rb->srand((a))
79#define rand() rb->rand()
80#define atoi(a) rb->atoi((a))
81#define strcat(a,b) rb->strcat((a),(b))
82#define snprintf rb->snprintf
83
84/* Using #define isn't enough with GCC 4.0.1 */
85inline void* memcpy(void* dst, const void* src, size_t size);
86
87#define PACKEDATTR __attribute__((packed)) // Needed for a few things
88#define GAMEBASE "/games/doom/"
89//#define SIMPLECHECKS
90#define NO_PREDEFINED_LUMPS
91#define TABLES_AS_LUMPS // This frees up alot of space in the plugin buffer
92#define FANCY_MENU // This is a call to allow load_main_backdrop to run in doom
93#endif