From 34492a4386446fc82220fe0684ff521d760e84bd Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Sun, 26 Nov 2023 09:47:21 -0300 Subject: 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 * 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 --- src/code/sys_cfb.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/code/sys_cfb.c') diff --git a/src/code/sys_cfb.c b/src/code/sys_cfb.c index 32600643a..b559a44ee 100644 --- a/src/code/sys_cfb.c +++ b/src/code/sys_cfb.c @@ -1,5 +1,5 @@ -#include "prevent_bss_reordering.h" #include "z64.h" +#include "buffers.h" #include "regs.h" #include "functions.h" #include "macros.h" @@ -41,9 +41,6 @@ u8 gSysCfbHiResEnabled; #include "system_malloc.h" #include "z64vimode.h" -extern u16 gFramebufferHiRes0[HIRES_BUFFER_WIDTH][HIRES_BUFFER_HEIGHT]; -extern u16 gFramebufferHiRes1[HIRES_BUFFER_WIDTH][HIRES_BUFFER_HEIGHT]; - void SysCfb_SetLoResMode(void) { gFramebuffers[1] = sCfbLoRes1; gFramebuffers[0] = sCfbLoRes0; @@ -93,8 +90,8 @@ void SysCfb_SetHiResMode(void) { } void SysCfb_Init(void) { - sCfbLoRes1 = gFramebuffer1; - sCfbLoRes0 = gFramebuffer0; + sCfbLoRes1 = gLoBuffer.framebuffer; + sCfbLoRes0 = gHiBuffer.framebuffer; sCfbHiRes1 = gFramebufferHiRes1; sCfbHiRes0 = gFramebufferHiRes0; SysCfb_SetLoResMode(); -- cgit v1.2.3