fix typo buffers (#655)

* fix typo buffers

* tweak ld file

* rename to sMemoryPool

* add a warning

---------

Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
This commit is contained in:
coco875 2024-08-16 23:35:57 +02:00 committed by GitHub
parent e2f12c49e9
commit eae28fa550
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 4 deletions

View File

@ -3,7 +3,7 @@
#include <PR/ultratypes.h>
#include <mk64.h>
#include "common_structs.h"
#include <common_structs.h>
/*
* 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.
**/

View File

@ -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];

View File

@ -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];