Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MorsGames
GitHub Repository: MorsGames/sm64plus
Path: blob/master/include/segments.h
7854 views
1
#ifndef SEGMENTS_H
2
#define SEGMENTS_H
3
4
#include "config.h"
5
6
/*
7
* Memory addresses for segments. Ideally, this header file would not be
8
* needed, and the addresses would be defined in sm64.ld and linker-inserted
9
* into C code. However, there are some cases where that would not match, where
10
* addresses are loaded using lui/ori rather than lui/addiu.
11
* To avoid duplication, this file is included from sm64.ld. We make sure not
12
* to cast the addresses to pointers in this file, since that would be invalid
13
* linker script syntax.
14
*/
15
16
#ifndef USE_EXT_RAM /* Default: Runs out of memory quickly when importing custom assets. */
17
18
#define SEG_POOL_START 0x8005C000
19
#define SEG_POOL_END SEG_BUFFERS
20
21
#define SEG_GODDARD 0x8016F000
22
23
#define SEG_BUFFERS 0x801C1000
24
25
#if defined(VERSION_SH) || ENABLE_RUMBLE
26
#define SEG_MAIN 0x80249000
27
#elif defined(VERSION_EU)
28
#define SEG_MAIN 0x80241800 // TODO: Investigate why it's different?
29
#else
30
#define SEG_MAIN 0x80246000
31
#endif
32
33
#ifdef VERSION_EU
34
#define SEG_ENGINE 0x8036FF00
35
#else
36
#define SEG_ENGINE 0x80378800
37
#endif
38
39
#define SEG_FRAMEBUFFERS 0x8038F800
40
41
#else /* Use Expansion Pak space for pool. */
42
43
/*
44
* Workaround for running out of pool space due to
45
* importing large custom content.
46
*/
47
48
#define SEG_BUFFERS 0x8005C000 // 0x0085000 in size
49
#define SEG_MAIN 0x800E1000 // 0x0132800 in size
50
#define SEG_ENGINE 0x80213800 // 0x0017000 in size
51
#define SEG_FRAMEBUFFERS 0x8022A800 // 0x0070800 in size
52
#define SEG_POOL_START 0x8029B000 // 0x0165000 in size
53
#define SEG_POOL_END 0x80800000
54
#define SEG_POOL_END_4MB 0x80400000 // For the error message screen enhancement.
55
#define SEG_GODDARD SEG_POOL_START + 0x113000
56
#endif
57
58
#endif // SEGMENTS_H
59
60