summaryrefslogtreecommitdiff
path: root/src/buffers
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2023-11-26 09:47:21 -0300
committerGitHub <noreply@github.com>2023-11-26 09:47:21 -0300
commit34492a4386446fc82220fe0684ff521d760e84bd (patch)
tree83057f1f50259946874ff3af70109395de158be1 /src/buffers
parentb25e64d1bd2ece30301f9fa5af78f963afd0cf76 (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/buffers')
-rw-r--r--src/buffers/audio_heap.c3
-rw-r--r--src/buffers/framebuffer_hi.c5
-rw-r--r--src/buffers/framebuffer_lo.c5
-rw-r--r--src/buffers/gfxpools.c2
-rw-r--r--src/buffers/gfxstack.c2
-rw-r--r--src/buffers/gfxyield.c2
-rw-r--r--src/buffers/heaps.c5
-rw-r--r--src/buffers/system_heap.c6
8 files changed, 22 insertions, 8 deletions
diff --git a/src/buffers/audio_heap.c b/src/buffers/audio_heap.c
new file mode 100644
index 000000000..1fab091bc
--- /dev/null
+++ b/src/buffers/audio_heap.c
@@ -0,0 +1,3 @@
+#include "buffers.h"
+
+u8 gAudioHeap[0x138000] ALIGNED(16);
diff --git a/src/buffers/framebuffer_hi.c b/src/buffers/framebuffer_hi.c
new file mode 100644
index 000000000..2ae30d39c
--- /dev/null
+++ b/src/buffers/framebuffer_hi.c
@@ -0,0 +1,5 @@
+#include "buffers.h"
+
+// Don't add symbols here unless you know what you are doing.
+
+BufferHigh gHiBuffer ALIGNED(64);
diff --git a/src/buffers/framebuffer_lo.c b/src/buffers/framebuffer_lo.c
new file mode 100644
index 000000000..121372505
--- /dev/null
+++ b/src/buffers/framebuffer_lo.c
@@ -0,0 +1,5 @@
+#include "buffers.h"
+
+// Don't add symbols here unless you know what you are doing.
+
+BufferLow gLoBuffer ALIGNED(64);
diff --git a/src/buffers/gfxpools.c b/src/buffers/gfxpools.c
index ff4934f11..f7b4ab5b7 100644
--- a/src/buffers/gfxpools.c
+++ b/src/buffers/gfxpools.c
@@ -1,3 +1,3 @@
#include "buffers.h"
-GfxPool gGfxPools[2];
+GfxPool gGfxPools[2] ALIGNED(16);
diff --git a/src/buffers/gfxstack.c b/src/buffers/gfxstack.c
index 8864d58ef..b88e27eaa 100644
--- a/src/buffers/gfxstack.c
+++ b/src/buffers/gfxstack.c
@@ -1,3 +1,3 @@
#include "buffers.h"
-STACK(gGfxSPTaskStack, 0x400);
+STACK(gGfxSPTaskStack, 0x400) ALIGNED(16);
diff --git a/src/buffers/gfxyield.c b/src/buffers/gfxyield.c
index 576cfc0bb..866257eac 100644
--- a/src/buffers/gfxyield.c
+++ b/src/buffers/gfxyield.c
@@ -1,3 +1,3 @@
#include "buffers.h"
-u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE];
+u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE] ALIGNED(16);
diff --git a/src/buffers/heaps.c b/src/buffers/heaps.c
deleted file mode 100644
index 477eca03e..000000000
--- a/src/buffers/heaps.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "buffers.h"
-
-u8 gAudioHeap[0x138000];
-
-u8 gSystemHeap[UNK_SIZE];
diff --git a/src/buffers/system_heap.c b/src/buffers/system_heap.c
new file mode 100644
index 000000000..df3d79003
--- /dev/null
+++ b/src/buffers/system_heap.c
@@ -0,0 +1,6 @@
+#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);