-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.h
59 lines (44 loc) · 1.23 KB
/
types.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
#ifndef GUARD_TYPES_H
#define GUARD_TYPES_H
#define FALSE 0
#define TRUE 1
typedef signed char bool;
typedef signed char s8;
typedef signed short s16;
typedef signed int s32;
typedef signed long long s64;
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef unsigned long long u64;
typedef u32 RomPointer;
typedef u32 StringId;
#ifndef ROM_BASE
#define ROM_BASE 0x08000000
#endif
#define Min(a,b) (((a) < (b)) ? (a) : (b))
#define Max(a,b) (((a) > (b)) ? (a) : (b))
#define ALIGN(num, align) (num = ((num + (align - 1)) & -align))
#define DEBUG 1
#define TILE_WIDTH 8
#ifndef TILE_SIZE_4BPP
#define TILE_SIZE_4BPP 0x20
#endif
#ifndef TILE_SIZE_8BPP
#define TILE_SIZE_8BPP 0x40
#endif
#ifdef _MSC_VER
#define PACKED #pragma pack(push,1)
#else
#define PACKED __attribute__((packed))
#endif
#ifdef DEBUG
#define assert(cond) \
if (!(cond)) { \
fprintf(stderr, "ASSERT failed - %s:%u\n", __FILE__, __LINE__); \
*(int*)0 = 0x0BADC0DE; \
}
#else
#define assert(cond)
#endif
#endif // GUARD_TYPES_H