Remove gSystemHeap and the system_heap spec segment, use _buffersSegmentEnd to represent the start of the system heap (#1767)

This commit is contained in:
Tharo 2024-12-19 05:38:44 +00:00 committed by GitHub
parent 5d49317876
commit 047c505b96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 4 additions and 18 deletions

View File

@ -25,7 +25,6 @@ extern u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE];
extern STACK(gGfxSPTaskStack, 0x400);
extern GfxPool gGfxPools[2];
extern u8 gAudioHeap[0x138000];
extern u8 gSystemHeap[];
typedef union {

View File

@ -78,7 +78,7 @@ DECLARE_SEGMENT(code)
DECLARE_ROM_SEGMENT(code)
DECLARE_BSS_SEGMENT(code)
DECLARE_SEGMENT(system_heap)
DECLARE_SEGMENT(buffers)
DECLARE_OVERLAY_SEGMENT(kaleido_scope)
DECLARE_OVERLAY_SEGMENT(player_actor)

View File

@ -3,5 +3,5 @@ ENTRY(entrypoint);
ASSERT ((_bootSegmentRomEnd <= 0x101000), "Error: _bootSegmentRomEnd is larger than 1 MB");
// TODO: This should be checking for an address a lot earlier than this one.
ASSERT ((_system_heapSegmentStart < 0x80780000), "Error: The game is overflowing the RAM limit for non-overlay segments.");
ASSERT ((_buffersSegmentEnd < 0x80780000), "Error: The game is overflowing the RAM limit for non-overlay segments.");
ASSERT ((_framebuffer_hiSegmentStart == 0x80780000), "Error: framebuffer_hi shifted?");

7
spec
View File

@ -794,13 +794,6 @@ beginseg
include "$(BUILD_DIR)/src/buffers/audio_heap.o"
endseg
beginseg
name "system_heap"
flags NOLOAD
// This segment is just a dummy that is used to know where the other buffers (non framebuffers) end
include "$(BUILD_DIR)/src/buffers/system_heap.o"
endseg
beginseg
name "framebuffer_hi"
flags NOLOAD

View File

@ -1,6 +0,0 @@
#include "buffers.h"
// Don't add symbols here unless you know what you are doing.
// Dummy, marks the start of system_heap space whose actual size depends on the spec
u8 gSystemHeap[UNK_SIZE] ALIGNED(16);

View File

@ -60,7 +60,7 @@ void Main(void* arg) {
Check_RegionIsSupported();
Check_ExpansionPak();
sysHeap = (uintptr_t)SEGMENT_START(system_heap);
sysHeap = (uintptr_t)SEGMENT_END(buffers);
fb = FRAMEBUFFERS_START_ADDR;
gSystemHeapSize = fb - sysHeap;
SystemHeap_Init((void*)sysHeap, gSystemHeapSize);

View File

@ -4204,7 +4204,7 @@
0x80209AA0:("gGfxSPTaskStack","u8","[0x400]",0x400),
0x80209EA0:("gGfxPools","GfxPool","[2]",0x40620),
0x8024A4C0:("gAudioHeap","u8","[0x138000]",0x138000),
0x803824C0:("gSystemHeap","u8","[UNK_SIZE]",0x3fdb40),
0x803824C0:("_buffersSegmentEnd","u8","[UNK_SIZE]",0x3fdb40),
0x80780000:("gHiBuffer","BufferHigh","",0x80000),
0x80800860:("titleRotation","s16","",0x2),
0x80800868:("D_80800868","UNK_TYPE1","",0x1),