diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2023-11-26 09:47:21 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-26 09:47:21 -0300 |
| commit | 34492a4386446fc82220fe0684ff521d760e84bd (patch) | |
| tree | 83057f1f50259946874ff3af70109395de158be1 /src/boot | |
| parent | b25e64d1bd2ece30301f9fa5af78f963afd0cf76 (diff) | |
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>
Diffstat (limited to 'src/boot')
| -rw-r--r-- | src/boot/idle.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/boot/idle.c b/src/boot/idle.c index 08f6d6ec7..cb35fafe8 100644 --- a/src/boot/idle.c +++ b/src/boot/idle.c @@ -1,4 +1,5 @@ #include "prevent_bss_reordering.h" +#include "buffers.h" #include "irqmgr.h" #include "main.h" #include "stack.h" @@ -41,10 +42,10 @@ void Main_InitFramebuffer(u32* framebuffer, size_t numBytes, u32 value) { } void Main_InitScreen(void) { - Main_InitFramebuffer((u32*)gFramebuffer1, sizeof(gFramebuffer1), + Main_InitFramebuffer((u32*)gLoBuffer.framebuffer, sizeof(gLoBuffer.framebuffer), (GPACK_RGBA5551(0, 0, 0, 1) << 16) | GPACK_RGBA5551(0, 0, 0, 1)); ViConfig_UpdateVi(false); - osViSwapBuffer(gFramebuffer1); + osViSwapBuffer(gLoBuffer.framebuffer); osViBlack(false); } @@ -52,9 +53,13 @@ void Main_InitMemory(void) { void* memStart = (void*)0x80000400; void* memEnd = OS_PHYSICAL_TO_K0(osMemSize); - Main_ClearMemory(memStart, gFramebuffer1); - Main_ClearMemory(D_80025D00, bootproc); - Main_ClearMemory(gGfxSPTaskYieldBuffer, memEnd); + Main_ClearMemory(memStart, SEGMENT_START(framebuffer_lo)); + + // Clear the rest of the buffer that was not initialized by Main_InitScreen + Main_ClearMemory(&gLoBuffer.skyboxBuffer, SEGMENT_END(framebuffer_lo)); + + // Clear all the buffers after the `code` segment, up to the end of the available RAM space + Main_ClearMemory(SEGMENT_END(code), memEnd); } void Main_Init(void) { |
