From b7e3d43180ff32e05c14bb58a4fbbfe38c8a7996 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 23 Jan 2021 12:19:37 +1000 Subject: [PATCH] Decompile handGetSecToPriAnim --- src/game/game_097ba0.c | 2 +- src/game/game_0b0420.c | 28 ++++++++++------------------ src/include/game/game_0b0420.h | 2 +- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/game/game_097ba0.c b/src/game/game_097ba0.c index 30b74a78b..6b9e59754 100644 --- a/src/game/game_097ba0.c +++ b/src/game/game_097ba0.c @@ -3265,7 +3265,7 @@ glabel func0f09a310 /* f09a368: a0d80003 */ sb $t8,0x3($a2) /* f09a36c: afa30018 */ sw $v1,0x18($sp) .L0f09a370: -/* f09a370: 0fc2c846 */ jal func0f0b2118 +/* f09a370: 0fc2c846 */ jal handGetSecToPriAnim /* f09a374: afa60028 */ sw $a2,0x28($sp) /* f09a378: 8fa60028 */ lw $a2,0x28($sp) /* f09a37c: 8fa30018 */ lw $v1,0x18($sp) diff --git a/src/game/game_0b0420.c b/src/game/game_0b0420.c index 8c65010aa..205069749 100644 --- a/src/game/game_0b0420.c +++ b/src/game/game_0b0420.c @@ -1571,21 +1571,13 @@ u32 *handGetPriToSecAnim(struct hand *hand) return NULL; } -GLOBAL_ASM( -glabel func0f0b2118 -/* f0b2118: 908e0000 */ lbu $t6,0x0($a0) -/* f0b211c: 3c038007 */ lui $v1,%hi(g_Weapons) -/* f0b2120: 00001025 */ or $v0,$zero,$zero -/* f0b2124: 000e7880 */ sll $t7,$t6,0x2 -/* f0b2128: 006f1821 */ addu $v1,$v1,$t7 -/* f0b212c: 8c63ff18 */ lw $v1,%lo(g_Weapons)($v1) -/* f0b2130: 10600003 */ beqz $v1,.L0f0b2140 -/* f0b2134: 00000000 */ nop -/* f0b2138: 03e00008 */ jr $ra -/* f0b213c: 8c620010 */ lw $v0,0x10($v1) -.L0f0b2140: -/* f0b2140: 03e00008 */ jr $ra -/* f0b2144: 00000000 */ nop -/* f0b2148: 00000000 */ nop -/* f0b214c: 00000000 */ nop -); +u32 *handGetSecToPriAnim(struct hand *hand) +{ + struct weapon *weapon = g_Weapons[hand->weaponnum]; + + if (weapon) { + return weapon->sectopri_animation; + } + + return NULL; +} diff --git a/src/include/game/game_0b0420.h b/src/include/game/game_0b0420.h index 301b37a62..e269c38ef 100644 --- a/src/include/game/game_0b0420.h +++ b/src/include/game/game_0b0420.h @@ -49,6 +49,6 @@ s8 weaponGetMaxFireRatePerTick(u32 weaponnum, u32 funcindex); u32 currentPlayerGetSight(void); u32 func0f0b201c(void); u32 *handGetPriToSecAnim(struct hand *hand); -u32 func0f0b2118(void); +u32 *handGetSecToPriAnim(struct hand *hand); #endif