Files
HackerSM64/include/segments.h

47 lines
1.2 KiB
C
Raw Permalink Normal View History

#ifndef SEGMENTS_H
#define SEGMENTS_H
2019-08-25 00:46:40 -04:00
2021-10-23 19:40:28 -07:00
#include "segment_names.h"
2020-11-05 14:21:07 -05:00
#ifndef LINKER
#include "segment_symbols.h"
#endif
2021-10-23 19:40:28 -07:00
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.
*/
2021-10-23 19:40:28 -07:00
// Starting address of RAM
#define RAM_START 0x80000000
// 1MB of RAM
#define RAM_1MB 0x00100000
2021-03-03 07:02:34 -06:00
#define USE_EXT_RAM
2021-10-23 19:40:28 -07:00
// Calculate total amount of RAM
2020-11-05 14:21:07 -05:00
#ifndef USE_EXT_RAM
2021-10-23 19:40:28 -07:00
#define TOTAL_RAM_SIZE (RAM_1MB * 4)
2019-08-25 00:46:40 -04:00
#else
2021-10-23 19:40:28 -07:00
#define TOTAL_RAM_SIZE (RAM_1MB * 8)
2019-08-25 00:46:40 -04:00
#endif
2020-02-03 00:51:26 -05:00
2021-10-23 19:40:28 -07:00
// Ending address of RAM
#define RAM_END (RAM_START + TOTAL_RAM_SIZE)
2019-08-25 00:46:40 -04:00
/*
* Workaround for running out of pool space due to
* importing large custom content.
*/
#define SEG_POOL_START _framebuffersSegmentBssEnd // 0x0165000 in size
2020-11-05 14:21:07 -05:00
#define POOL_SIZE RAM_END - SEG_POOL_START
2021-10-23 19:40:28 -07:00
#define MAP_PARSER_ADDRESS 0x80345678
#endif // SEGMENTS_H