sm64/include/segments.h

57 lines
1.7 KiB
C
Raw Normal View History

2020-06-02 12:44:34 -04:00
#ifndef SEGMENTS_H
#define SEGMENTS_H
2019-08-25 00:46:40 -04:00
/*
* Memory addresses for segments. Ideally, this header file would not be
* needed, and the addresses would be defined in sm64.ld and linker-inserted
* into C code. However, there are some cases where that would not match, where
* addresses are loaded using lui/ori rather than lui/addiu.
* To avoid duplication, this file is included from sm64.ld. We make sure not
* to cast the addresses to pointers in this file, since that would be invalid
* linker script syntax.
*/
#ifndef USE_EXT_RAM /* Default: Runs out of memory quickly when importing custom assets. */
#define SEG_POOL_START 0x8005C000
#define SEG_POOL_END SEG_BUFFERS
2020-02-03 00:51:26 -05:00
2019-08-25 00:46:40 -04:00
#define SEG_GODDARD 0x8016F000
2020-02-03 00:51:26 -05:00
2019-08-25 00:46:40 -04:00
#define SEG_BUFFERS 0x801C1000
2020-02-03 00:51:26 -05:00
2019-08-25 00:46:40 -04:00
#ifdef VERSION_EU
#define SEG_MAIN 0x80241800 // TODO: Investigate why it's different?
2020-03-01 22:42:52 -05:00
#elif defined(VERSION_SH)
#define SEG_MAIN 0x80249000
2019-08-25 00:46:40 -04:00
#else
#define SEG_MAIN 0x80246000
#endif
2020-02-03 00:51:26 -05:00
#ifdef VERSION_EU
#define SEG_ENGINE 0x8036FF00
#else
2019-08-25 00:46:40 -04:00
#define SEG_ENGINE 0x80378800
2020-02-03 00:51:26 -05:00
#endif
2019-08-25 00:46:40 -04:00
#define SEG_FRAMEBUFFERS 0x8038F800
#else /* Use Expansion Pak space for pool. */
/*
* Workaround for running out of pool space due to
* importing large custom content.
*/
#define SEG_BUFFERS 0x8005C000 // 0x0085000 in size
2020-09-20 11:15:47 -04:00
#define SEG_MAIN 0x800E1000 // 0x0132800 in size
2019-08-25 00:46:40 -04:00
#define SEG_ENGINE 0x80213800 // 0x0017000 in size
#define SEG_FRAMEBUFFERS 0x8022A800 // 0x0070800 in size
#define SEG_POOL_START 0x8029B000 // 0x0165000 in size
#define SEG_POOL_END 0x80800000
#define SEG_POOL_END_4MB 0x80400000 // For the error message screen enhancement.
#define SEG_GODDARD SEG_POOL_START + 0x113000
#endif
2020-06-02 12:44:34 -04:00
#endif // SEGMENTS_H