Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
segments.h
Go to the documentation of this file.
1 #ifndef _SEGMENTS_H
2 #define _SEGMENTS_H
3 
4 /*
5  * Memory addresses for segments. Ideally, this header file would not be
6  * needed, and the addresses would be defined in sm64.ld and linker-inserted
7  * into C code. However, there are some cases where that would not match, where
8  * addresses are loaded using lui/ori rather than lui/addiu.
9  * To avoid duplication, this file is included from sm64.ld. We make sure not
10  * to cast the addresses to pointers in this file, since that would be invalid
11  * linker script syntax.
12 */
13 
14 #ifndef USE_EXT_RAM /* Default: Runs out of memory quickly when importing custom assets. */
15 
16 #define SEG_POOL_START 0x8005C000
17 #define SEG_POOL_END SEG_BUFFERS
18 #define SEG_GODDARD 0x8016F000
19 #define SEG_BUFFERS 0x801C1000
20 #ifdef VERSION_EU
21 #define SEG_MAIN 0x80241800 // TODO: Investigate why it's different?
22 #else
23 #define SEG_MAIN 0x80246000
24 #endif
25 #define SEG_ENGINE 0x80378800
26 #define SEG_FRAMEBUFFERS 0x8038F800
27 
28 #else /* Use Expansion Pak space for pool. */
29 
30 /*
31  * Workaround for running out of pool space due to
32  * importing large custom content.
33  */
34 
35 #define SEG_BUFFERS 0x8005C000 // 0x0085000 in size
36 #define SEG_MAIN 0x800E1000 // 0x1328000 in size
37 #define SEG_ENGINE 0x80213800 // 0x0017000 in size
38 #define SEG_FRAMEBUFFERS 0x8022A800 // 0x0070800 in size
39 #define SEG_POOL_START 0x8029B000 // 0x0165000 in size
40 #define SEG_POOL_END 0x80800000
41 #define SEG_POOL_END_4MB 0x80400000 // For the error message screen enhancement.
42 #define SEG_GODDARD SEG_POOL_START + 0x113000
43 #endif
44 
45 #endif // _SEGMENTS_H