Move the system heap and the framebuffers to their own segments (#1488)

* make segments for the systemheap and the framebuffers

* define in the makefile

* undefined syms

* Make segments for the pre boot buffers too

* Update spec

Co-authored-by: Parker <20159000+jpburnett@users.noreply.github.com>

* review

* Update spec

Co-authored-by: Parker <20159000+jpburnett@users.noreply.github.com>

* Update Makefile

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* comments

* comment

* move comment about the hardcoded address to buffers.h

* rewrite SYSTEM_HEAP_END_ADDR in terms of other symbols

* Use `ALIGNED` on all the buffers

* Rename SYSTEM_HEAP_END_ADDR to FRAMEBUFFERS_START_ADDR

* Put ALIGNED at the right like the rest of the codebase

* merge

* gLoBuffer

* gHiBuffer

* Add a static assert to ensure the address of gHiBuffer haven't shifted without the user noticing

* smol include cleanup

---------

Co-authored-by: Parker <20159000+jpburnett@users.noreply.github.com>
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
This commit is contained in:
Anghelo Carvajal
2023-11-26 09:47:21 -03:00
committed by GitHub
parent b25e64d1bd
commit 34492a4386
22 changed files with 152 additions and 49 deletions
+25 -3
View File
@@ -4,15 +4,20 @@
beginseg
name "makerom"
address 0x8007F000
include "build/asm/makerom/rom_header.o"
include "build/asm/makerom/ipl3.o"
include "build/asm/makerom/entry.o"
endseg
beginseg
name "framebuffer_lo"
address 0x80000500
flags NOLOAD
include "build/src/buffers/framebuffer_lo.o"
endseg
beginseg
name "boot"
address 0x80080060
include "build/src/boot/boot_main.o"
include "build/data/boot/rspboot.data.o"
include "build/src/boot/idle.o"
@@ -612,13 +617,30 @@ beginseg
include "build/data/code/njpgdspMain.rodata.o"
endseg
// The game expects all the segments after the `code` segment and before the first overlay to be `NOLOAD` ones
beginseg
name "buffers"
flags NOLOAD
include "build/src/buffers/gfxyield.o"
include "build/src/buffers/gfxstack.o"
include "build/src/buffers/gfxpools.o"
include "build/data/code/buffers.bss.o"
include "build/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/src/buffers/system_heap.o"
endseg
beginseg
name "framebuffer_hi"
flags NOLOAD
// This has to be fixed location in VRAM. See the FRAMEBUFFERS_START_ADDR define on `buffers.h` for a more in-depth explanation
address 0x80780000
include "build/src/buffers/framebuffer_hi.o"
endseg
beginseg