From 90adc13c2a1b7fbdc2344d9f2ed1c9b45e902a33 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Wed, 23 Dec 2020 23:21:31 +1000 Subject: [PATCH] Decompile gfxAllocate4Words --- src/game/game_166e40.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/game/game_166e40.c b/src/game/game_166e40.c index 058771c08..18a69ee06 100644 --- a/src/game/game_166e40.c +++ b/src/game/game_166e40.c @@ -511,16 +511,13 @@ void *gfxAllocateMatrix(void) return ptr; } -GLOBAL_ASM( -glabel gfxAllocate4Words -/* f1679b0: 3c06800b */ lui $a2,%hi(g_GfxMemPos) -/* f1679b4: 24c6a59c */ addiu $a2,$a2,%lo(g_GfxMemPos) -/* f1679b8: 8cc20000 */ lw $v0,0x0($a2) -/* f1679bc: 00047100 */ sll $t6,$a0,0x4 -/* f1679c0: 004e7821 */ addu $t7,$v0,$t6 -/* f1679c4: 03e00008 */ jr $ra -/* f1679c8: accf0000 */ sw $t7,0x0($a2) -); +void *gfxAllocate4Words(s32 count) +{ + void *ptr = g_GfxMemPos; + g_GfxMemPos += count * 0x10; + + return ptr; +} u32 *gfxAllocateColours(s32 count) {