forked from skmp/nullDCe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.h
248 lines (196 loc) · 4.49 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
/*
Config header file to properly generate all the #defines from simple _SYSTEM defines on makefiles :)
*/
#pragma once
//Basic config values
//OSes
#define OS_PSP 1
#define OS_WINDOWS 3
#define OS_LINUX 4
#define OS_WII 5
#define OS_XBOX 6
#define OS_PS2 7
#define OS_PS3 8
//Architectures (generic)
#define ARCH_ARM 1
#define ARCH_X86 2
#define ARCH_X64 3
#define ARCH_MIPS 4
#define ARCH_PPC 5
//Cpu model (specific)
#define CPU_X86_GENERIC 1 //specialised runtime checks for sse support
#define CPU_MIPS_ALLEGREX 2 //psp
#define CPU_ARM_CORTEX_A8 3 //Beagleboard/Pandora/Omap3*
#define CPU_MIPS_5900 4 //ps2
#define CPU_PPC_BROADWAY 5 //wii
#define CPU_PPC_CELL 6 //ps3
#define CPU_ARMV5 7 //For android testing, for now
//host hardware
#define SYS_PC 1 //PC (win/linux)
#define SYS_PSP 2
#define SYS_PANDORA 3
#define SYS_BEAGLE 4
#define SYS_WII 5
#define SYS_PS3 6
//host endian
#define ENDIAN_LITTLE 1
#define ENDIAN_BIG 2
//these MUST NOT be used.
#define BIG_ENDIAN "wrong endian" qwerpsdoija dfa sd fas;df asd;f
#define LITTLE_ENDIAN "wrong endian" qwerpsdoija dfa sd fas;df asd;f
//compiler used
#define COMPILER_GCC 1
#define COMPILER_VC 2
//Renderer used
#define REND_PSP 1
#define REND_GLES2 2
#define REND_SOFT 3 // Or .. something [ null atm ]
#define REND_WII 4
// Add defs to IDE/makefile whatever as _cpuname, _osname
// at the very end if they still aren't defined it will build for x86/windows
#ifdef _PANDORA
#define _ARM
#define _LINUX
#define HOST_CPU CPU_ARM_CORTEX_A8
#define HOST_SYS SYS_PANDORA
#define REND_API REND_GLES2
#define VER_TARGET "pandora"
#endif
#ifdef _BEAGLE
#define _ARM
#define _LINUX
#define HOST_CPU CPU_ARM_CORTEX_A8
#define HOST_SYS SYS_BEAGLE
#define REND_API REND_GLES2
#define VER_TARGET "beagly"
#endif
#ifdef _ANDROID
#define _ARM
#define _LINUX
#define HOST_CPU CPU_ARM_CORTEX_A8
#define HOST_SYS SYS_BEAGLE
#define REND_API REND_GLES2
#define VER_TARGET "android/arm"
//#define USE_INTERP 1
#endif
#ifdef _WIN86
#define _X86
#define _WINDOWS
#define HOST_CPU CPU_X86_GENERIC
#define HOST_SYS SYS_PC
#ifdef _PSPEMU
#define REND_API REND_PSP
#else
#define REND_API REND_GLES2
#endif
#define VER_TARGET "win86"
#endif
#ifdef _LIN86
#define _X86
#define _WINDOWS
#define HOST_CPU CPU_X86_GENERIC
#define HOST_SYS SYS_PC
#define REND_API REND_GLES2
#define VER_TARGET "linux86"
#endif
#ifdef _WII
#define _PPC
#define HOST_CPU CPU_PPC_BROADWAY
#define HOST_SYS SYS_WII
#define REND_API REND_WII
#define VER_TARGET "wii"
#endif
#ifdef _PSP
#define _MIPS
#define HOST_CPU CPU_MIPS_ALLEGREX
#define HOST_SYS SYS_PSP
#define REND_API REND_PSP
#define VER_TARGET "psp"
#endif
#ifdef _PS3
#define _PPC
#define HOST_CPU CPU_PPC_CELL
#define HOST_SYS SYS_PS3
#define HOST_OS OS_PS3
#ifndef CELL_SDK
#define REND_API REND_SOFT
#else
#define REND_API REND_GLES2
#endif
#define VER_TARGET "ps3"
#endif
#ifndef HOST_ARCH
#ifdef _ARM
#define HOST_ARCH ARCH_ARM
#define HOST_ENDIAN ENDIAN_LITTLE
#endif
#ifdef _PPC
#define HOST_ARCH ARCH_PPC
#define HOST_ENDIAN ENDIAN_BIG
#endif
#ifdef _MIPS
#define HOST_ARCH ARCH_MIPS
#define HOST_ENDIAN ENDIAN_LITTLE
#endif
#ifdef _X64
#define HOST_ARCH ARCH_X64
#define HOST_ENDIAN ENDIAN_LITTLE
#endif
#ifdef _X86
#define HOST_ARCH ARCH_X86
#define HOST_ENDIAN ENDIAN_LITTLE
#endif
#endif // HOST_CPU
#ifndef HOST_OS
#ifdef _LINUX
#define HOST_OS OS_LINUX
#endif
#ifdef _WINDOWS
#define HOST_OS OS_WINDOWS
#endif
#ifdef _PSP
#define HOST_OS OS_PSP
#endif
#ifdef _WII
#define HOST_OS OS_WII
#endif
#ifdef _XBOX
#define HOST_OS OS_XBOX
#endif
#ifdef _PS2
#define HOST_OS OS_PS2
#define USE_INTERP
#endif
#endif // HOST_OS
//defaults
#ifndef HOST_ENDIAN
#define HOST_ENDIAN ENDIAN_LITTLE
#endif
#ifndef HOST_OS
#define HOST_OS OS_WINDOWS
#endif
#ifndef HOST_CPU
#define HOST_CPU CPU_X86
#endif
#if HOST_ARCH==ARCH_PPC && HOST_CPU!=CPU_PPC_BROADWAY
#define USE_INTERP
#endif
#ifdef USE_INTERP
#define HOST_NO_REC 1
#endif
#if HOST_CPU==CPU_X64
#define X64
#endif
#ifndef BUILD_COMPILER
#if HOST_OS==OS_WINDOWS
#define BUILD_COMPILER COMPILER_VC
#else
#define BUILD_COMPILER COMPILER_GCC
#endif
#endif
#ifndef VER_TARGET
#define VER_TARGET "?"
#endif
#ifndef REND_API
#define REND_API REND_SOFT
#endif