diff options
| author | Prakxo <87568477+Prakxo@users.noreply.github.com> | 2024-04-02 18:21:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-02 09:21:33 -0700 |
| commit | d8789801b89077422faa376de4bb7f2d564c1103 (patch) | |
| tree | 4ad26ac63df29b18b0b7947c509574a2b39eebe1 | |
| parent | 6bfbdcbc4eeeb4bfc17a9dfef9c7c6ebc9515aa4 (diff) | |
gfxalloc OK (#160)
* gfxalloc ok
* format/names
| -rw-r--r-- | src/code/gfxalloc.c | 29 | ||||
| -rw-r--r-- | yamls/jp/code.yaml | 2 |
2 files changed, 30 insertions, 1 deletions
diff --git a/src/code/gfxalloc.c b/src/code/gfxalloc.c new file mode 100644 index 0000000..62b63c5 --- /dev/null +++ b/src/code/gfxalloc.c @@ -0,0 +1,29 @@ +#include "gfxalloc.h" +#include "alignment.h" + +Gfx* gfxopen(Gfx* gfxHead) { + return gfxHead + 1; +} + +Gfx* gfxclose(Gfx* gfxHead, Gfx* gfx) { + if (gfxHead + 1 != gfx) { + gSPBranchList(gfxHead, gfx); + return gfx; + } else { + gSPNoOp(gfxHead); + return gfxHead; + } +} + +void* gfxalloc(Gfx** gfxP, size_t size) { + u8* ptr; + Gfx* dst; + + size = ALIGN8(size); + ptr = (u8*)(*gfxP + 1); + dst = (Gfx*)(ptr + size); + gSPBranchList(*gfxP, dst); + + *gfxP = dst; + return ptr; +} diff --git a/yamls/jp/code.yaml b/yamls/jp/code.yaml index eb1f85a..90ca4f4 100644 --- a/yamls/jp/code.yaml +++ b/yamls/jp/code.yaml @@ -94,7 +94,7 @@ - [0x6F68B0, asm, code/cfbinfo] - [0x6F6AA0, c, code/game] - [0x6F73C0, c, code/gamealloc] - - [0x6F7500, asm, code/gfxalloc] + - [0x6F7500, c, code/gfxalloc] - [0x6F7580, asm, code/graph] - [0x6F83B0, c, code/irqmgr] - [0x6F8A60, c, code/lb_rtc] |
