[WIP] GCC Building + libhackerultra (#17)

Co-authored-by: a <a>
This commit is contained in:
bicyclesoda
2025-06-19 21:25:47 -04:00
committed by GitHub
parent 3ac9688312
commit 13313f3e31
1046 changed files with 71764 additions and 40860 deletions

View File

@@ -1,7 +1,9 @@
#ifndef SEGMENTS_H
#define SEGMENTS_H
#include "config.h"
#ifndef _LD
#include "segment_symbols.h"
#endif
/*
* Memory addresses for segments. Ideally, this header file would not be
@@ -13,50 +15,17 @@
* linker script syntax.
*/
#define SEG_START 0x8005C000
#define USE_EXT_RAM // Undefine this to set a strict 4MB limit.
#define SEG_FRAMEBUFFERS_SIZE (2 * SCREEN_WIDTH * SCREEN_HEIGHT * 3)
#define SEG_GODDARD_POOL_OFFSET 0x52000 // Offset from right side of pool
#define SEG_GODDARD (SEG_POOL_END - SEG_GODDARD_POOL_OFFSET)
#ifndef USE_EXT_RAM /* Default: Runs out of memory quickly when importing custom assets. */
#define SEG_RAM_END 0x80400000
#define SEG_POOL_START SEG_START
#define SEG_POOL_SIZE 0x165000
#define SEG_POOL_END (SEG_POOL_START + SEG_POOL_SIZE)
#define SEG_BUFFERS SEG_POOL_END
#ifdef VERSION_EU
#define SEG_ENGINE 0x8036FF00
#ifndef USE_EXT_RAM
#define RAM_END 0x80400000
#else
#define SEG_ENGINE 0x80378800
#define RAM_END 0x80800000
#endif
#define SEG_FRAMEBUFFERS (SEG_RAM_END - SEG_FRAMEBUFFERS_SIZE)
#else /* Use Expansion Pak space for pool. */
/*
* Workaround for running out of pool space due to
* importing large custom content.
*/
#ifdef VERSION_CN
#define SEG_RAM_END 0x807C0000 // iQue has stuff like EEPROM mapped at 807C0000 onwards. TODO: Code this using osMemSize
#else
#define SEG_RAM_END 0x80800000
#endif
#define SEG_BUFFERS SEG_START
#define SEG_ENGINE ((u32) &_engineSegmentStart)
#define SEG_FRAMEBUFFERS ((u32) &_framebuffersSegmentNoloadStart)
#define SEG_POOL_START ((u32) &_framebuffersSegmentNoloadEnd)
#define SEG_POOL_END SEG_RAM_END
#define SEG_POOL_END_4MB 0x80400000 // For the error message screen enhancement.
#endif
#define SEG_POOL_START _framebuffersSegmentNoloadEnd // 0x0165000 in size
#define SEG_GODDARD SEG_POOL_START + 0x113000
#define POOL_SIZE RAM_END - SEG_POOL_START
#endif // SEGMENTS_H