From 42b3d4c2a3789014d70dccc48204dac92e84f439 Mon Sep 17 00:00:00 2001 From: tom-overton Date: Mon, 1 Nov 2021 22:37:22 -0700 Subject: [PATCH] func_80AB3010 OK --- .../actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c index e0f0aef49c..b4e171c3c5 100644 --- a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c +++ b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c @@ -248,7 +248,34 @@ void ObjTokeidai_Init(Actor* thisx, GlobalContext* globalCtx) { void ObjTokeidai_Destroy(Actor* thisx, GlobalContext* globalCtx) { } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Tokeidai/func_80AB3010.s") +void func_80AB3010(ObjTokeidai* this, s32 arg1) { + s32 temp; + + temp = (s32)(this->unk_170 * 0.010986328f) % 0x1E; + if (temp != this->unk_168) { + if ((this->unk_150 == 8) && (arg1 != 0)) { + Audio_PlayActorSound2(&this->actor, NA_SE_EV_CLOCK_TOWER_SECOND_HAND); + } + if (this->unk_150 >= 9) { + this->unk_14E += 0x3C; + this->unk_14C += this->unk_14E; + } else { + if ((this->unk_150 & 3) == 0) { + this->unk_14C += 0x5A; + } + if ((this->unk_150 & 3) == 1) { + this->unk_14C += -0x5A; + } + } + this->unk_150++; + if ((temp == 0xF && this->unk_14C < 0) || (temp != 0xF && this->unk_14C > (s16)(temp * 2184.5334f))) { + this->unk_14C = temp * 2184.5334f; + this->unk_168 = temp; + this->unk_14E = 0x5A; + this->unk_150 = 0; + } + } +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Tokeidai/func_80AB319C.s")