From 406b541b230bd71e4fa6b2e00483ce7c6637cc5f Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 23 Jan 2021 12:18:40 +1000 Subject: [PATCH] Decompile handGetPriToSecAnim --- src/game/game_097ba0.c | 2 +- src/game/game_0b0420.c | 26 ++++++++++---------------- src/include/game/game_0b0420.h | 2 +- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/game/game_097ba0.c b/src/game/game_097ba0.c index d671cebec..30b74a78b 100644 --- a/src/game/game_097ba0.c +++ b/src/game/game_097ba0.c @@ -3255,7 +3255,7 @@ glabel func0f09a310 /* f09a340: afa30018 */ sw $v1,0x18($sp) /* f09a344: 00c02025 */ or $a0,$a2,$zero /* f09a348: afa00018 */ sw $zero,0x18($sp) -/* f09a34c: 0fc2c83a */ jal func0f0b20e8 +/* f09a34c: 0fc2c83a */ jal handGetPriToSecAnim /* f09a350: afa60028 */ sw $a2,0x28($sp) /* f09a354: 8fa60028 */ lw $a2,0x28($sp) /* f09a358: 8fa30018 */ lw $v1,0x18($sp) diff --git a/src/game/game_0b0420.c b/src/game/game_0b0420.c index dfc8b2607..8c65010aa 100644 --- a/src/game/game_0b0420.c +++ b/src/game/game_0b0420.c @@ -1560,22 +1560,16 @@ glabel func0f0b201c /* f0b20e4: 00000000 */ nop ); -GLOBAL_ASM( -glabel func0f0b20e8 -/* f0b20e8: 908e0000 */ lbu $t6,0x0($a0) -/* f0b20ec: 3c038007 */ lui $v1,%hi(g_Weapons) -/* f0b20f0: 00001025 */ or $v0,$zero,$zero -/* f0b20f4: 000e7880 */ sll $t7,$t6,0x2 -/* f0b20f8: 006f1821 */ addu $v1,$v1,$t7 -/* f0b20fc: 8c63ff18 */ lw $v1,%lo(g_Weapons)($v1) -/* f0b2100: 10600003 */ beqz $v1,.L0f0b2110 -/* f0b2104: 00000000 */ nop -/* f0b2108: 03e00008 */ jr $ra -/* f0b210c: 8c62000c */ lw $v0,0xc($v1) -.L0f0b2110: -/* f0b2110: 03e00008 */ jr $ra -/* f0b2114: 00000000 */ nop -); +u32 *handGetPriToSecAnim(struct hand *hand) +{ + struct weapon *weapon = g_Weapons[hand->weaponnum]; + + if (weapon) { + return weapon->pritosec_animation; + } + + return NULL; +} GLOBAL_ASM( glabel func0f0b2118 diff --git a/src/include/game/game_0b0420.h b/src/include/game/game_0b0420.h index 09ad27311..301b37a62 100644 --- a/src/include/game/game_0b0420.h +++ b/src/include/game/game_0b0420.h @@ -48,7 +48,7 @@ bool handHasFunctionFlags(struct hand *hand, u32 flags); s8 weaponGetMaxFireRatePerTick(u32 weaponnum, u32 funcindex); u32 currentPlayerGetSight(void); u32 func0f0b201c(void); -u32 func0f0b20e8(void); +u32 *handGetPriToSecAnim(struct hand *hand); u32 func0f0b2118(void); #endif