From 8da0a2173b49e3e9adc33cb2a187f31fc6de51b6 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 4 Jan 2020 15:21:42 +1000 Subject: [PATCH] Decompile menuhandler00108014 --- src/game/game_107fb0.c | 40 +++++++++------------------------- src/include/game/game_107fb0.h | 2 +- src/include/types.h | 3 ++- 3 files changed, 13 insertions(+), 32 deletions(-) diff --git a/src/game/game_107fb0.c b/src/game/game_107fb0.c index dafe84304..ababfcef0 100644 --- a/src/game/game_107fb0.c +++ b/src/game/game_107fb0.c @@ -341,36 +341,16 @@ glabel func0f107fb0 /* f108010: 00000000 */ sll $zero,$zero,0x0 ); -GLOBAL_ASM( -glabel menuhandler00108014 -/* f108014: 24010018 */ addiu $at,$zero,0x18 -/* f108018: afa50004 */ sw $a1,0x4($sp) -/* f10801c: 14810013 */ bne $a0,$at,.L0f10806c -/* f108020: afa60008 */ sw $a2,0x8($sp) -/* f108024: 3c0e8007 */ lui $t6,0x8007 -/* f108028: 8dce1448 */ lw $t6,0x1448($t6) -/* f10802c: 3c18800a */ lui $t8,0x800a -/* f108030: 000e78c0 */ sll $t7,$t6,0x3 -/* f108034: 01ee7823 */ subu $t7,$t7,$t6 -/* f108038: 000f7880 */ sll $t7,$t7,0x2 -/* f10803c: 01ee7821 */ addu $t7,$t7,$t6 -/* f108040: 000f78c0 */ sll $t7,$t7,0x3 -/* f108044: 01ee7823 */ subu $t7,$t7,$t6 -/* f108048: 000f7900 */ sll $t7,$t7,0x4 -/* f10804c: 030fc021 */ addu $t8,$t8,$t7 -/* f108050: 9318ee3c */ lbu $t8,-0x11c4($t8) -/* f108054: 3319007f */ andi $t9,$t8,0x7f -/* f108058: 2b210005 */ slti $at,$t9,0x5 -/* f10805c: 54200004 */ bnezl $at,.L0f108070 -/* f108060: 00001025 */ or $v0,$zero,$zero -/* f108064: 03e00008 */ jr $ra -/* f108068: 24020001 */ addiu $v0,$zero,0x1 -.L0f10806c: -/* f10806c: 00001025 */ or $v0,$zero,$zero -.L0f108070: -/* f108070: 03e00008 */ jr $ra -/* f108074: 00000000 */ sll $zero,$zero,0x0 -); +s32 menuhandler00108014(u32 operation, struct menu_item *item, s32 *value) +{ + if (operation == MENUOP_CHECKHIDDEN) { + if (g_MenuStack[g_MpPlayerNum].unk944_01 > 4) { + return true; + } + } + + return 0; +} GLOBAL_ASM( glabel func0f108078 diff --git a/src/include/game/game_107fb0.h b/src/include/game/game_107fb0.h index 420b34b4f..9272912a4 100644 --- a/src/include/game/game_107fb0.h +++ b/src/include/game/game_107fb0.h @@ -58,7 +58,7 @@ s32 menudialog0010b674(u32, u32, u32 *); s32 menudialog0010ba10(u32, u32, u32 *); s32 menudialog0010c804(u32, u32, u32 *); s32 menudialog0010cc08(u32, u32, u32 *); -s32 menuhandler00108014(u32, u32, u32 *); +s32 menuhandler00108014(u32 operation, struct menu_item *item, s32 *value); s32 menuhandler00108254(u32 operation, struct menu_item *item, s32 *value); s32 menuhandler001084b8(u32, u32, u32 *); s32 menuhandlerPakErrorTryAgain(u32 operation, struct menu_item *item, s32 *value); diff --git a/src/include/types.h b/src/include/types.h index 5ed361674..e5756c579 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -3580,7 +3580,8 @@ struct menustackitem { /*0x938*/ u32 unk938; /*0x93c*/ u32 unk93c; /*0x940*/ u32 unk940; - /*0x944*/ u32 unk944; + /*0x944*/ u8 unk944_00 : 1; + /*0x944*/ u8 unk944_01 : 7; /*0x948*/ u32 unk948; /*0x94c*/ u32 unk94c; /*0x950*/ u32 unk950;