From f5e71876ef6d43bd688bf72c17135fac7195d9ad Mon Sep 17 00:00:00 2001 From: Derek Hensley Date: Wed, 17 Aug 2022 21:19:40 -0700 Subject: [PATCH] Match func_80167DE4 (from debug) --- include/functions.h | 2 +- src/code/z_play.c | 29 ++++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/include/functions.h b/include/functions.h index e11a962633..f079c50fce 100644 --- a/include/functions.h +++ b/include/functions.h @@ -2603,7 +2603,7 @@ void Play_Init(GameState* gameState); // void func_8016EA90(void); // void func_8016F1A8(void); // void func_8016F4EC(void); -void func_8016F5A8(PlayState* play, s8* pcParm2, Input* iParm3); +void func_8016F5A8(PlayState* play, HiresoStruct* arg1, Input* input); void func_8016FC78(HiresoStruct* this); void func_8016FC98(HiresoStruct* this); void PreRender_SetValuesSave(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg); diff --git a/src/code/z_play.c b/src/code/z_play.c index 9129eaa279..aafca8e58b 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -372,7 +372,34 @@ Input* D_801D0D60 = NULL; #pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_Update.s") -#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80167DE4.s") +void func_80167DE4(PlayState* play) { + if (D_801F6DFC == 0) { + if (play->pauseCtx.unk_1F0 != 0) { + D_801F6DFC = 1; + D_801F6D50.unk_00 = 0; + } + } else { + if (CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_L) || + CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_B) || + CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_START) || + (gIrqMgrResetStatus != 0)) { + D_801F6DFC = 0; + play->pauseCtx.unk_1F0 = 0; + D_801F6D50.unk_00 = 0; + play->msgCtx.msgLength = 0; + play->msgCtx.msgMode = 0; + play->msgCtx.currentTextId = 0; + play->msgCtx.stateTimer = 0; + play_sound(NA_SE_SY_CANCEL); + } + } + if (D_801F6DFC != 0) { + func_8016F5A8(play, &D_801F6D50, play->state.input); + func_8015680C(play); + } else { + Play_Update(play); + } +} #pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80167F0C.s")