Skip to content

Commit

Permalink
fix typo buffers (#655)
Browse files Browse the repository at this point in the history
* fix typo buffers

* tweak ld file

* rename to sMemoryPool

* add a warning

---------

Co-authored-by: MegaMech <[email protected]>
  • Loading branch information
coco875 and MegaMech authored Aug 16, 2024
1 parent e2f12c4 commit eae28fa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/buffers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
*
Expand All @@ -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.
**/
Expand Down
2 changes: 2 additions & 0 deletions src/buffers/buffers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
3 changes: 2 additions & 1 deletion src/buffers/memory_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];

0 comments on commit eae28fa

Please sign in to comment.