Mario Kart 64
Loading...
Searching...
No Matches
segments.h
Go to the documentation of this file.
1#ifndef SEGMENTS_H
2#define SEGMENTS_H
3
4#include <ultra64.h>
5#include <macros.h>
6
9
10extern u8 _endingSegmentStart[];
14
15extern u8 _racingSegmentStart[];
19
23
26
29
32
35
43#define SEG_START 0x80000000
44
45// Defines duplicated even if the same for both for easier readability
46#ifdef AVOID_UB
47
48#define MEMORY_POOL_START (uintptr_t) & _memoryPoolSegmentNoloadStart[0]
49#define MEMORY_POOL_END (uintptr_t) & _memoryPoolSegmentNoloadEnd[0]
50
51#define SEG_ENDING (uintptr_t) & _endingSegmentStart[0]
52#define SEG_ENDING_ROM_START (uintptr_t) & _endingSegmentRomStart[0]
57#define SEG_ENDING_SIZE (size_t) ALIGN16((ptrdiff_t) (&_endingSegmentNoloadEnd[0] - &_endingSegmentStart[0]))
58#define SEG_ENDING_ROM_SIZE (size_t) ALIGN16((ptrdiff_t) (&_endingSegmentRomEnd[0] - &_endingSegmentRomStart[0]))
59
60#define SEG_RACING (uintptr_t) & _racingSegmentStart[0]
61#define SEG_RACING_ROM_START (uintptr_t) & _racingSegmentRomStart[0]
62#define SEG_RACING_SIZE (size_t) ALIGN16((ptrdiff_t) (&_racingSegmentNoloadEnd[0] - &_racingSegmentStart[0]))
63#define SEG_RACING_ROM_SIZE (size_t) ALIGN16((ptrdiff_t) (&_racingSegmentRomEnd[0] - &_racingSegmentRomStart[0]))
64
65#define TRIG_TABLES (uintptr_t) & _trigTablesSegmentStart[0]
66#define TRIG_TABLES_ROM_START (uintptr_t) & _trigTablesSegmentRomStart[0]
67#define TRIG_TABLES_SIZE (size_t) _trigTablesSegmentSize
68
69#define SEG_DATA_START (uintptr_t) & _data_segment2SegmentRomStart[0]
70#define SEG_DATA_END (uintptr_t) & _data_segment2SegmentRomEnd[0]
71
72#define COMMON_TEXTURES_ROM_START (uintptr_t) & _common_texturesSegmentRomStart[0]
73#define COMMON_TEXTURES_SIZE (ptrdiff_t)(&_common_texturesSegmentRomEnd[0] - &_common_texturesSegmentRomStart[0])
74
75#define CEREMONY_DATA_ROM_START &_ceremonyDataSegmentRomStart[0]
76#define CEREMONY_DATA_ROM_END &_ceremonyDataSegmentRomEnd[0]
77
78#define STARTUP_LOGO_ROM_START &_startupLogoSegmentRomStart[0]
79#define STARTUP_LOGO_ROM_END &_startupLogoSegmentRomEnd[0]
80
81#else // Required for ok
82
83#define MEMORY_POOL_START (uintptr_t) & _memoryPoolSegmentNoloadStart
84#define MEMORY_POOL_END (uintptr_t) 0x80242F00
85
86#define SEG_ENDING (uintptr_t) 0x80280000
87#define SEG_ENDING_ROM_START (u8*) &_endingSegmentRomStart[0]
88
89#define SEG_ENDING_SIZE (size_t) 0xDF00
90#define SEG_ENDING_ROM_SIZE (size_t) ALIGN16((ptrdiff_t) (&_endingSegmentRomEnd[0] - &_endingSegmentRomStart[0]))
91
92#define SEG_RACING (uintptr_t) 0x8028DF00
93#define SEG_RACING_ROM_START (u8*) &_racingSegmentRomStart[0]
94#define SEG_RACING_SIZE (size_t) 0x2C470
95
96#define SEG_RACING_ROM_SIZE (size_t) ALIGN16((ptrdiff_t) (&_racingSegmentRomEnd[0] - &_racingSegmentRomStart[0]))
97
98#define TRIG_TABLES (uintptr_t) 0x802BA370
99#define TRIG_TABLES_ROM_START (uintptr_t) & _trigTablesSegmentRomStart[0]
100#define TRIG_TABLES_SIZE (size_t) 0x5810
101
102#define SEG_DATA_START (uintptr_t) & _data_segment2SegmentRomStart[0]
103#define SEG_DATA_END (uintptr_t) & _data_segment2SegmentRomEnd[0]
104
105#define COMMON_TEXTURES_ROM_START (uintptr_t) & _common_texturesSegmentRomStart[0]
106#define COMMON_TEXTURES_SIZE \
107 (ptrdiff_t)((uintptr_t) & _common_texturesSegmentRomEnd - (uintptr_t) & _common_texturesSegmentRomStart)
108
109#define CEREMONY_DATA_ROM_START &_ceremonyDataSegmentRomStart[0]
110#define CEREMONY_DATA_ROM_END &_ceremonyDataSegmentRomEnd[0]
111
112#define STARTUP_LOGO_ROM_START &_startupLogoSegmentRomStart[0]
113#define STARTUP_LOGO_ROM_END &_startupLogoSegmentRomEnd[0]
114
115#endif /* AVOID_UB */
116
117#endif /* SEGMENTS_H */
u8 _startupLogoSegmentRomStart[]
u8 _endingSegmentRomEnd[]
u8 _memoryPoolSegmentNoloadEnd[]
u8 _startupLogoSegmentRomEnd[]
u8 _data_segment2SegmentRomStart[]
u8 _trigTablesSegmentRomStart[]
u8 _ceremonyDataSegmentRomStart[]
u8 _data_segment2SegmentRomEnd[]
u8 _endingSegmentRomStart[]
u8 _common_texturesSegmentRomEnd[]
u8 _endingSegmentStart[]
u8 _memoryPoolSegmentNoloadStart[]
u8 _trigTablesSegmentStart[]
u8 _ceremonyDataSegmentRomEnd[]
u8 _endingSegmentNoloadEnd[]
u8 _racingSegmentNoloadEnd[]
u8 _racingSegmentRomStart[]
u8 _common_texturesSegmentRomStart[]
u8 _racingSegmentRomEnd[]
u8 _racingSegmentStart[]
u8 _trigTablesSegmentSize[]
unsigned char u8
Definition ultratypes.h:12