From cd1559dc98070422bb4b5e5f8d5c510d30f390d8 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 26 Jan 2020 11:21:20 +1000 Subject: [PATCH] Decompile padHasBboxData --- src/game/game_00c490.c | 4 ++-- src/game/game_115ab0.c | 23 +++++++---------------- src/include/game/game_115ab0.h | 2 +- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/src/game/game_00c490.c b/src/game/game_00c490.c index cbfe75d79..9938ab857 100644 --- a/src/game/game_00c490.c +++ b/src/game/game_00c490.c @@ -1135,7 +1135,7 @@ glabel func0f00cee4 /* f00d188: e7a40094 */ swc1 $f4,0x94($sp) /* f00d18c: e7a80098 */ swc1 $f8,0x98($sp) /* f00d190: a7b80080 */ sh $t8,0x80($sp) -/* f00d194: 0fc457c0 */ jal func0f115f00 +/* f00d194: 0fc457c0 */ jal padHasBboxData /* f00d198: 86040006 */ lh $a0,0x6($s0) /* f00d19c: 14400013 */ bnez $v0,.L0f00d1ec /* f00d1a0: 8fa80140 */ lw $t0,0x140($sp) @@ -1202,7 +1202,7 @@ glabel func0f00cee4 /* f00d284: 02002025 */ or $a0,$s0,$zero /* f00d288: afa2007c */ sw $v0,0x7c($sp) .L0f00d28c: -/* f00d28c: 0fc457c0 */ jal func0f115f00 +/* f00d28c: 0fc457c0 */ jal padHasBboxData /* f00d290: 86040006 */ lh $a0,0x6($s0) /* f00d294: 504000c1 */ beqzl $v0,.L0f00d59c /* f00d298: 8e040018 */ lw $a0,0x18($s0) diff --git a/src/game/game_115ab0.c b/src/game/game_115ab0.c index 9ca9d513b..321310bca 100644 --- a/src/game/game_115ab0.c +++ b/src/game/game_115ab0.c @@ -832,22 +832,13 @@ glabel padUnpack // } //} -GLOBAL_ASM( -glabel func0f115f00 -/* f115f00: 3c0e800a */ lui $t6,0x800a -/* f115f04: 8dce2354 */ lw $t6,0x2354($t6) -/* f115f08: 00047840 */ sll $t7,$a0,0x1 -/* f115f0c: 3c19800a */ lui $t9,0x800a -/* f115f10: 01cfc021 */ addu $t8,$t6,$t7 -/* f115f14: 97030000 */ lhu $v1,0x0($t8) -/* f115f18: 8f39d04c */ lw $t9,-0x2fb4($t9) -/* f115f1c: 03232821 */ addu $a1,$t9,$v1 -/* f115f20: 8ca20000 */ lw $v0,0x0($a1) -/* f115f24: 00024382 */ srl $t0,$v0,0xe -/* f115f28: 31090200 */ andi $t1,$t0,0x200 -/* f115f2c: 03e00008 */ jr $ra -/* f115f30: 0009102b */ sltu $v0,$zero,$t1 -); +bool padHasBboxData(s32 padnum) +{ + u32 offset = g_PadOffsets[padnum]; + u32 *header = (u32 *)&g_StageSetup.padfiledata[offset]; + + return ((*header >> 14) & PADFLAG_HASBBOXDATA) != 0; +} GLOBAL_ASM( glabel func0f115f34 diff --git a/src/include/game/game_115ab0.h b/src/include/game/game_115ab0.h index c4417a4f3..5a7649018 100644 --- a/src/include/game/game_115ab0.h +++ b/src/include/game/game_115ab0.h @@ -3,7 +3,7 @@ #include #include "types.h" -u32 func0f115f00(void); +bool padHasBboxData(s32 padnum); u32 func0f115f34(void); u32 func0f116068(void); u32 func0f116190(void);