diff --git a/include/functions.h b/include/functions.h index 310ca6a14d..b49a91e7c3 100644 --- a/include/functions.h +++ b/include/functions.h @@ -2176,8 +2176,8 @@ void func_80121FC4(GlobalContext* globalCtx); Path* Path_GetByIndex(GlobalContext* globalCtx, s16 index, s16 max); f32 Path_OrientAndGetDistSq(Actor* actor, Path* path, s16 waypoint, s16* yaw); void Path_CopyLastPoint(Path* path, Vec3f* dest); -// void func_80122660(void); -// UNK_TYPE4 func_80122670(s32* param_1, Input* input); +void func_80122660(FrameAdvanceContext* frameAdvCtx); +s32 func_80122670(FrameAdvanceContext* frameAdvCtx, Input* input); // void func_801226E0(void); void func_80122744(GlobalContext* globalCtx, UNK_PTR arg1, u32 arg2, Vec3s* arg3); s32 func_80122760(GlobalContext* globalCtx, UNK_PTR arg1, f32 arg2); diff --git a/src/code/z_pause.c b/src/code/z_pause.c index 44be6238af..739945c10a 100644 --- a/src/code/z_pause.c +++ b/src/code/z_pause.c @@ -1,5 +1,16 @@ #include "global.h" -#pragma GLOBAL_ASM("asm/non_matchings/code/z_pause/func_80122660.s") +void func_80122660(FrameAdvanceContext* frameAdvCtx) { + frameAdvCtx->timer = 0; + frameAdvCtx->enabled = false; +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_pause/func_80122670.s") +s32 func_80122670(FrameAdvanceContext* frameAdvCtx, Input* input) { + if (!frameAdvCtx->enabled || (CHECK_BTN_ALL(input->cur.button, BTN_Z) && + (CHECK_BTN_ALL(input->press.button, BTN_R) || + (CHECK_BTN_ALL(input->cur.button, BTN_R) && (++frameAdvCtx->timer >= 9))))) { + frameAdvCtx->timer = 0; + return true; + } + return false; +}