-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into 7D140
- Loading branch information
Showing
9 changed files
with
761 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#ifndef SEGMENT_SYMBOLS_H | ||
#define SEGMENT_SYMBOLS_H | ||
|
||
#include "ultra64.h" | ||
#include "libc/stdint.h" | ||
|
||
#define DECLARE_VRAM_SEGMENT(name) \ | ||
extern u8 name ## _VRAM[]; \ | ||
extern u8 name ## _VRAM_END[] | ||
|
||
#define DECLARE_ROM_SEGMENT(name) \ | ||
extern u8 name ## _ROM_START[]; \ | ||
extern u8 name ## _ROM_END[] | ||
|
||
#define DECLARE_DATA_SEGMENT(name) \ | ||
extern u8 name ## _DATA_START[]; \ | ||
extern u8 name ## _DATA_END[]; \ | ||
extern u8 name ## _DATA_SIZE[] | ||
|
||
#define DECLARE_BSS_SEGMENT(name) \ | ||
extern u8 name ## _BSS_START[]; \ | ||
extern u8 name ## _BSS_END[] | ||
|
||
#define DECLARE_SEGMENT(name) \ | ||
DECLARE_VRAM_SEGMENT(name); \ | ||
DECLARE_ROM_SEGMENT(name); \ | ||
DECLARE_DATA_SEGMENT(name); \ | ||
DECLARE_BSS_SEGMENT(name) | ||
|
||
#define SEGMENT_VRAM_START(segment) (segment ## _VRAM) | ||
#define SEGMENT_VRAM_END(segment) (segment ## _VRAM_END) | ||
#define SEGMENT_VRAM_SIZE(segment) ((uintptr_t)SEGMENT_VRAM_END(segment) - (uintptr_t)SEGMENT_VRAM_START(segment)) | ||
#define SEGMENT_VRAM_RESOLVE_ADDR(segment, base, symbol) ((uintptr_t)(base) + (uintptr_t)&(symbol) - (uintptr_t)SEGMENT_VRAM_START(segment)) | ||
|
||
#define SEGMENT_ROM_START(segment) ((RomOffset)segment ## _ROM_START) | ||
#define SEGMENT_ROM_END(segment) ((RomOffset)segment ## _ROM_END) | ||
#define SEGMENT_ROM_SIZE(segment) (SEGMENT_ROM_END(segment) - SEGMENT_ROM_START(segment)) | ||
#define SEGMENT_ROM_SIZE_ALT(segment) ((size_t)(segment ## _ROM_END - segment ## _ROM_START)) | ||
|
||
#define SEGMENT_DATA_SIZE_CONST(segment) ((RomOffset)segment ## _DATA_SIZE) | ||
|
||
#define SEGMENT_BSS_START(segment) (segment ## _BSS_START) | ||
#define SEGMENT_BSS_END(segment) (segment ## _BSS_END) | ||
#define SEGMENT_BSS_SIZE(segment) ((uintptr_t)SEGMENT_BSS_END(segment) - (uintptr_t)SEGMENT_BSS_START(segment)) | ||
|
||
DECLARE_SEGMENT(header); | ||
|
||
DECLARE_SEGMENT(ipl3); | ||
|
||
DECLARE_SEGMENT(entry); | ||
|
||
DECLARE_SEGMENT(main); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.