From a58566702d542685f165ef76ebf5a51597dfb372 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 11 Jan 2020 16:00:13 +1000 Subject: [PATCH] Decompile scenarioKohCallback40 and scenarioKohCallback44 --- src/game/game_176d70.c | 33 ++++++++------------------------- src/include/game/game_0d4690.h | 2 +- src/include/gvars/gvars.h | 2 +- 3 files changed, 10 insertions(+), 27 deletions(-) diff --git a/src/game/game_176d70.c b/src/game/game_176d70.c index a522255a3..40830886a 100644 --- a/src/game/game_176d70.c +++ b/src/game/game_176d70.c @@ -11430,32 +11430,15 @@ s32 menuhandlerMpHillTime(u32 operation, struct menu_item *item, struct numandte return 0; } -GLOBAL_ASM( -glabel scenarioKohCallback40 -/* f181b24: 27bdffe8 */ addiu $sp,$sp,-24 -/* f181b28: afbf0014 */ sw $ra,0x14($sp) -/* f181b2c: 0fc354fe */ jal scenarioDefaultCallback40 -/* f181b30: 24050008 */ addiu $a1,$zero,0x8 -/* f181b34: 8fbf0014 */ lw $ra,0x14($sp) -/* f181b38: 3c01800a */ lui $at,0x800a -/* f181b3c: ac22a444 */ sw $v0,-0x5bbc($at) -/* f181b40: 03e00008 */ jr $ra -/* f181b44: 27bd0018 */ addiu $sp,$sp,0x18 -); +void scenarioKohCallback40(s32 *arg0) +{ + g_Vars.mphilltime = scenarioDefaultCallback40(arg0, 8); +} -GLOBAL_ASM( -glabel scenarioKohCallback44 -/* f181b48: 27bdffe8 */ addiu $sp,$sp,-24 -/* f181b4c: afbf0014 */ sw $ra,0x14($sp) -/* f181b50: 3c05800a */ lui $a1,0x800a -/* f181b54: 8ca5a444 */ lw $a1,-0x5bbc($a1) -/* f181b58: 0fc354be */ jal scenarioDefaultCallback44 -/* f181b5c: 24060008 */ addiu $a2,$zero,0x8 -/* f181b60: 8fbf0014 */ lw $ra,0x14($sp) -/* f181b64: 27bd0018 */ addiu $sp,$sp,0x18 -/* f181b68: 03e00008 */ jr $ra -/* f181b6c: 00000000 */ sll $zero,$zero,0x0 -); +void scenarioKohCallback44(s32 *arg0) +{ + scenarioDefaultCallback44(arg0, g_Vars.mphilltime, 8); +} void scenarioKohInit(void) { diff --git a/src/include/game/game_0d4690.h b/src/include/game/game_0d4690.h index 956ba623a..5f9ee905b 100644 --- a/src/include/game/game_0d4690.h +++ b/src/include/game/game_0d4690.h @@ -12,7 +12,7 @@ u32 func0f0d4c80(void); u32 func0f0d4d0c(void); void scenarioDefaultCallback44(s32 *arg0, s32 arg1, s32 arg2); u32 func0f0d5360(void); -void scenarioDefaultCallback40(s32 *arg0, s32 arg1); +s32 scenarioDefaultCallback40(s32 *arg0, s32 arg1); u32 func0f0d545c(void); u32 func0f0d5484(void); u32 func0f0d54c4(void); diff --git a/src/include/gvars/gvars.h b/src/include/gvars/gvars.h index e66dfe114..b677abf2f 100644 --- a/src/include/gvars/gvars.h +++ b/src/include/gvars/gvars.h @@ -157,7 +157,7 @@ struct g_vars { /*000478*/ u32 unk000478; /*00047c*/ u32 unk00047c; /*000480*/ u32 unk000480; - /*000484*/ u32 mphilltime; + /*000484*/ s32 mphilltime; /*000488*/ u32 unk000488; /*00048c*/ u32 unk00048c; /*000490*/ u32 unk000490; // set to 2 when entering combat simulator