Skip to content
🌋️
Alchemy
Theme: Weyard
Theme: Modern
Mode: Auto
Mode: Light
Mode: Dark
Alchemy
Source
Reference
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1
#ifndef ALCHEMY_TYPES_H
2
#define ALCHEMY_TYPES_H
3
4
/// @file
5
/// The integer types, TRUE, UNUSED and the fixed-address macros.
6
7
#include "
version.h
"
8
#include "
config.h
"
9
10
typedef
signed
char
s8
;
11
typedef
unsigned
char
u8
;
12
typedef
signed
short
s16
;
13
typedef
unsigned
short
u16
;
14
typedef
signed
int
s32
;
15
typedef
unsigned
int
u32
;
16
typedef
signed
long
long
s64
;
17
typedef
unsigned
long
long
u64
;
18
19
#define NULL ((void *)0)
20
#define FALSE 0
21
#define TRUE 1
22
#define UNUSED __attribute__((unused))
23
24
#ifdef MODERN
25
/// Reaches a fixed address through its linked name, in the modern build.
26
// The modern build places code and data where its own compiler puts them: a
27
// fixed address is the linked name, called through a register as at a fixed
28
// address, so that code copied into RAM still reaches it. The linked name is
29
// pasted before it is macro-expanded: a name that is itself a macro would
30
// otherwise expand first and cannot be pasted.
31
#define FIXED_LINKED_(symbol, name) \
32
({ \
33
extern char symbol[] __asm__(name); \
34
void *volatile modern_address = symbol; \
35
modern_address; \
36
})
37
#define FIXED_ADDRESS(type, address, linked) \
38
(type FIXED_LINKED_(modern_##linked, #linked))
39
#define FIXED_OFFSET(value, linked, from) \
40
((u32)FIXED_LINKED_(modern_##linked, #linked) - \
41
(u32)FIXED_LINKED_(modern_##from, #from))
42
#else
43
#define FIXED_ADDRESS(type, address, linked) (type address)
44
#define FIXED_OFFSET(value, linked, from) value
45
#endif
46
#define CAMELOT_ASM(proof)
47
48
#endif
config.h
Build switches, as pret's config.h: BUGFIX opts in to fixes of the original game's bugs,...
s32
signed int s32
Definition
types.h:14
u32
unsigned int u32
Definition
types.h:15
s8
signed char s8
Definition
types.h:10
s64
signed long long s64
Definition
types.h:16
s16
signed short s16
Definition
types.h:12
u16
unsigned short u16
Definition
types.h:13
u64
unsigned long long u64
Definition
types.h:17
u8
unsigned char u8
Definition
types.h:11
version.h
The patch levels: our groups of the measured changes from the Japanese release.
include
types.h