From eae28fa550a8681e9a3181f116cbff047a7e1866 Mon Sep 17 00:00:00 2001 From: coco875 <59367621+coco875@users.noreply.github.com> Date: Fri, 16 Aug 2024 23:35:57 +0200 Subject: [PATCH] fix typo buffers (#655) * fix typo buffers * tweak ld file * rename to sMemoryPool * add a warning --------- Co-authored-by: MegaMech --- src/buffers.h | 6 +++--- src/buffers/buffers.c | 2 ++ src/buffers/memory_pool.c | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/buffers.h b/src/buffers.h index 13584036d..d2e1ad8cd 100644 --- a/src/buffers.h +++ b/src/buffers.h @@ -3,7 +3,7 @@ #include #include -#include "common_structs.h" +#include /* * This type could reasonably be called decodedTexture or similar @@ -52,7 +52,7 @@ typedef struct { * Appears to be a combination of 2 different palettes: * kart_palette contains the palette for all non-wheel elements of the kart (including the driver). * wheel_palette contains the palette for the wheels. - * + * * kart palette sets a defined palette based on the character while * wheels palette sets a dynamic palette as you drive around with the kart. * @@ -74,7 +74,7 @@ extern struct_D_802DFB80 D_802DFB80[][2][8]; /** * It would be nice to define D_802F1F80 as "struct_D_802F1F80 D_802F1F80[2][4][8]". - * But due to register allocation issues in load_kart_palette / func_80026B4C + * But due to register allocation issues in load_kart_palette / func_80026B4C * we have to define it in a different manner to match those functions. * If AVOID_UB is defined, the struct is properly defined with their correct pointers. **/ diff --git a/src/buffers/buffers.c b/src/buffers/buffers.c index cc08aa60a..769b6d86b 100644 --- a/src/buffers/buffers.c +++ b/src/buffers/buffers.c @@ -4,8 +4,10 @@ #include "buffers.h" ALIGNED8 union_D_802BFB80 D_802BFB80; +// [nothing][screen][player] ALIGNED8 struct_D_802DFB80 D_802DFB80[2][2][8]; #ifdef AVOID_UB +// [buffer][screen][player] Buffer might be two separate buffers or something? ALIGNED8 struct_D_802F1F80 D_802F1F80[2][4][8]; #else ALIGNED8 u16 D_802F1F80[2][4][0x100 * 8]; diff --git a/src/buffers/memory_pool.c b/src/buffers/memory_pool.c index d7dee6cc9..60b2760eb 100644 --- a/src/buffers/memory_pool.c +++ b/src/buffers/memory_pool.c @@ -7,5 +7,6 @@ /** * Memory pool variable prevents code segments flowing into the memory pool * for easier portability. + * @warning should not really be used. */ -u8 memoryPool[MEMORY_POOL_SIZE]; +u8 sMemoryPool[MEMORY_POOL_SIZE];