From a0b8a7c718f32df1c30f5548fee494b8be6dffe4 Mon Sep 17 00:00:00 2001 From: kyleburnette Date: Sat, 27 Mar 2021 10:13:56 -0700 Subject: TwoHeadArena and TwoHeadGfxArena OK (#83) * TwoHeadArena and TwoHeadGfxArena OK * Changed negatives to ~ in TwoHeadArena.c * Renamed functions to match OoT * Formatted code files * Removed dispbuf --- src/code/TwoHeadGfxArena.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 src/code/TwoHeadGfxArena.c (limited to 'src/code/TwoHeadGfxArena.c') diff --git a/src/code/TwoHeadGfxArena.c b/src/code/TwoHeadGfxArena.c new file mode 100644 index 000000000..2cf73aa88 --- /dev/null +++ b/src/code/TwoHeadGfxArena.c @@ -0,0 +1,66 @@ +#include +#include + +void THGA_Ct(TwoHeadGfxArena* thga, Gfx* start, u32 size) { + THA_Ct((TwoHeadArena*)thga, start, size); +} + +void THGA_Dt(TwoHeadGfxArena* thga) { + THA_Dt((TwoHeadArena*)thga); +} + +u32 THGA_IsCrash(TwoHeadGfxArena* thga) { + return THA_IsCrash((TwoHeadArena*)thga); +} + +void THGA_Init(TwoHeadGfxArena* thga) { + THA_Init((TwoHeadArena*)thga); +} + +s32 THGA_GetSize(TwoHeadGfxArena* thga) { + return THA_GetSize((TwoHeadArena*)thga); +} + +Gfx* THGA_GetHead(TwoHeadGfxArena* thga) { + return THA_GetHead((TwoHeadArena*)thga); +} + +void THGA_SetHead(TwoHeadGfxArena* thga, Gfx* start) { + THA_SetHead((TwoHeadArena*)thga, start); +} + +Gfx* THGA_GetTail(TwoHeadGfxArena* thga) { + return THA_GetTail((TwoHeadArena*)thga); +} + +Gfx* THGA_AllocStartArray8(TwoHeadGfxArena* thga, u32 count) { + return THA_AllocStart((TwoHeadArena*)thga, count * 8); +} + +Gfx* THGA_AllocStart8(TwoHeadGfxArena* thga) { + return THGA_AllocStartArray8(thga, 1); +} + +Gfx* THGA_AllocStart8Wrapper(TwoHeadGfxArena* thga) { + return THGA_AllocStart8(thga); +} + +Gfx* THGA_AllocEnd(TwoHeadGfxArena* thga, u32 size) { + return THA_AllocEnd((TwoHeadArena*)thga, size); +} + +Gfx* THGA_AllocEndArray64(TwoHeadGfxArena* thga, u32 count) { + return THGA_AllocEnd(thga, count * 0x40); +} + +Gfx* THGA_AllocEnd64(TwoHeadGfxArena* thga) { + return THGA_AllocEnd(thga, 0x40); +} + +Gfx* THGA_AllocEndArray16(TwoHeadGfxArena* thga, u32 count) { + return THGA_AllocEnd(thga, count * 0x10); +} + +Gfx* THGA_AllocEnd16(TwoHeadGfxArena* thga) { + return THGA_AllocEnd(thga, 0x10); +} -- cgit v1.2.3