From 6a680b9b47168bb37784411048cd792590720ed9 Mon Sep 17 00:00:00 2001 From: Gamestabled Date: Tue, 17 Mar 2020 16:05:25 -0400 Subject: [PATCH 01/14] permissions --- tools/ido5.3_compiler/lib/libmalloc.so | Bin tools/ido5.3_compiler/lib/libmalloc_old.so | Bin tools/ido5.3_compiler/lib/rld | Bin tools/ido5.3_compiler/usr/bin/cc | Bin tools/ido5.3_compiler/usr/lib/as0 | Bin tools/ido5.3_compiler/usr/lib/as1 | Bin tools/ido5.3_compiler/usr/lib/cfe | Bin tools/ido5.3_compiler/usr/lib/crt1.o | Bin tools/ido5.3_compiler/usr/lib/err.english.cc | 0 tools/ido5.3_compiler/usr/lib/libc.so.1 | Bin tools/ido5.3_compiler/usr/lib/libexc.so | Bin tools/ido5.3_compiler/usr/lib/libgen.so | Bin tools/ido5.3_compiler/usr/lib/libm.so | Bin tools/ido5.3_compiler/usr/lib/ugen | Bin tools/ido5.3_compiler/usr/lib/ujoin | Bin tools/ido5.3_compiler/usr/lib/uld | Bin tools/ido5.3_compiler/usr/lib/umerge | Bin tools/ido5.3_compiler/usr/lib/uopt | Bin tools/ido5.3_compiler/usr/lib/usplit | Bin 19 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tools/ido5.3_compiler/lib/libmalloc.so mode change 100644 => 100755 tools/ido5.3_compiler/lib/libmalloc_old.so mode change 100644 => 100755 tools/ido5.3_compiler/lib/rld mode change 100644 => 100755 tools/ido5.3_compiler/usr/bin/cc mode change 100644 => 100755 tools/ido5.3_compiler/usr/lib/as0 mode change 100644 => 100755 tools/ido5.3_compiler/usr/lib/as1 mode change 100644 => 100755 tools/ido5.3_compiler/usr/lib/cfe mode change 100644 => 100755 tools/ido5.3_compiler/usr/lib/crt1.o mode change 100644 => 100755 tools/ido5.3_compiler/usr/lib/err.english.cc mode change 100644 => 100755 tools/ido5.3_compiler/usr/lib/libc.so.1 mode change 100644 => 100755 tools/ido5.3_compiler/usr/lib/libexc.so mode change 100644 => 100755 tools/ido5.3_compiler/usr/lib/libgen.so mode change 100644 => 100755 tools/ido5.3_compiler/usr/lib/libm.so mode change 100644 => 100755 tools/ido5.3_compiler/usr/lib/ugen mode change 100644 => 100755 tools/ido5.3_compiler/usr/lib/ujoin mode change 100644 => 100755 tools/ido5.3_compiler/usr/lib/uld mode change 100644 => 100755 tools/ido5.3_compiler/usr/lib/umerge mode change 100644 => 100755 tools/ido5.3_compiler/usr/lib/uopt mode change 100644 => 100755 tools/ido5.3_compiler/usr/lib/usplit diff --git a/tools/ido5.3_compiler/lib/libmalloc.so b/tools/ido5.3_compiler/lib/libmalloc.so old mode 100644 new mode 100755 diff --git a/tools/ido5.3_compiler/lib/libmalloc_old.so b/tools/ido5.3_compiler/lib/libmalloc_old.so old mode 100644 new mode 100755 diff --git a/tools/ido5.3_compiler/lib/rld b/tools/ido5.3_compiler/lib/rld old mode 100644 new mode 100755 diff --git a/tools/ido5.3_compiler/usr/bin/cc b/tools/ido5.3_compiler/usr/bin/cc old mode 100644 new mode 100755 diff --git a/tools/ido5.3_compiler/usr/lib/as0 b/tools/ido5.3_compiler/usr/lib/as0 old mode 100644 new mode 100755 diff --git a/tools/ido5.3_compiler/usr/lib/as1 b/tools/ido5.3_compiler/usr/lib/as1 old mode 100644 new mode 100755 diff --git a/tools/ido5.3_compiler/usr/lib/cfe b/tools/ido5.3_compiler/usr/lib/cfe old mode 100644 new mode 100755 diff --git a/tools/ido5.3_compiler/usr/lib/crt1.o b/tools/ido5.3_compiler/usr/lib/crt1.o old mode 100644 new mode 100755 diff --git a/tools/ido5.3_compiler/usr/lib/err.english.cc b/tools/ido5.3_compiler/usr/lib/err.english.cc old mode 100644 new mode 100755 diff --git a/tools/ido5.3_compiler/usr/lib/libc.so.1 b/tools/ido5.3_compiler/usr/lib/libc.so.1 old mode 100644 new mode 100755 diff --git a/tools/ido5.3_compiler/usr/lib/libexc.so b/tools/ido5.3_compiler/usr/lib/libexc.so old mode 100644 new mode 100755 diff --git a/tools/ido5.3_compiler/usr/lib/libgen.so b/tools/ido5.3_compiler/usr/lib/libgen.so old mode 100644 new mode 100755 diff --git a/tools/ido5.3_compiler/usr/lib/libm.so b/tools/ido5.3_compiler/usr/lib/libm.so old mode 100644 new mode 100755 diff --git a/tools/ido5.3_compiler/usr/lib/ugen b/tools/ido5.3_compiler/usr/lib/ugen old mode 100644 new mode 100755 diff --git a/tools/ido5.3_compiler/usr/lib/ujoin b/tools/ido5.3_compiler/usr/lib/ujoin old mode 100644 new mode 100755 diff --git a/tools/ido5.3_compiler/usr/lib/uld b/tools/ido5.3_compiler/usr/lib/uld old mode 100644 new mode 100755 diff --git a/tools/ido5.3_compiler/usr/lib/umerge b/tools/ido5.3_compiler/usr/lib/umerge old mode 100644 new mode 100755 diff --git a/tools/ido5.3_compiler/usr/lib/uopt b/tools/ido5.3_compiler/usr/lib/uopt old mode 100644 new mode 100755 diff --git a/tools/ido5.3_compiler/usr/lib/usplit b/tools/ido5.3_compiler/usr/lib/usplit old mode 100644 new mode 100755 From 1eb36220e536635e0522cea8f863eac393a67672 Mon Sep 17 00:00:00 2001 From: Gamestabled Date: Wed, 18 Mar 2020 02:12:45 -0400 Subject: [PATCH 02/14] 6 functions matching --- .../z_bg_hidan_firewall.c | 253 +++++++++++++++++- .../z_bg_hidan_firewall.h | 39 ++- 2 files changed, 280 insertions(+), 12 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c index e2c232da8d..5c3e181fcc 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c @@ -3,9 +3,25 @@ #define ROOM 0x00 #define FLAGS 0x00000000 -void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx); -void BgHidanFirewall_Destroy(BgHidanFirewall* this, GlobalContext* globalCtx); -void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx); +// static ColliderCylinderInit cylinderInitData = +// { +// { +// 0x0A, 0x11, 0x00, 0x09, +// 0x20, 0x01, { 0x00, 0x00, }, +// 0x00, { 0x00, 0x00, 0x00, }, +// 0x20000000, +// 0x01, 0x04, { 0x00, 0x00, }, +// 0xFFCFFFFF, +// { 0x00, 0x00, 0x00, 0x00, }, +// 0x19, 0x00, 0x01, 0x00, +// }, +// 0x001E, +// 0x0053, +// 0x0000, +// { +// 0x0000, 0x0000, 0x0000, +// }, +// }; /* const ActorInit Bg_Hidan_Firewall_InitVars = @@ -22,22 +38,241 @@ const ActorInit Bg_Hidan_Firewall_InitVars = NULL, }; */ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Firewall/BgHidanFirewall_Init.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Firewall/BgHidanFirewall_Destroy.s") +void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx){ + + f32 scale; + scale = D_80886D84; + this->actor.scale.x = scale; + this->actor.scale.z = scale; + + scale = D_80886D88; + this->actor.scale.y = D_80886D88; + + this->ukn_150 = 0; + + ActorCollider_AllocCylinder(globalCtx, ((s32*)this+0x55));//TODO: fix this. multiple cylinders? + ActorCollider_InitCylinder(globalCtx, ((s32*)this+0x55), &this->actor, &D_80886CD0); + + this->ukn_19C = this->actor.posRot.pos.y; + + func_80061ED4(&this->actor.sub_98, 0, D_80886CFC); + + this->method = BgHidanFirewall_Idle; + return; +} + +void BgHidanFirewall_Destroy(BgHidanFirewall* this, GlobalContext* globalCtx) +{ + BgHidanFirewall* thing = this; + ActorCollider_FreeCylinder(globalCtx, (char*)this + 0x154);//TODO: fix this. multiple cylinders? +} + +// BgHidanFirewall_Proximity #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Firewall/func_80886728.s") +// s32 func_80886728(BgHidanFirewall* this, GlobalContext* globalCtx) +// { +// Vec3f* sp18; //TODO: where does this come from? +// f32 temp_f0; +// u32 phi_return; -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Firewall/func_80886794.s") +// func_8002DBD0(&this->actor, sp18, &(globalCtx->actorCtx.actorList[2].first->posRot.pos)); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Firewall/func_808867DC.s") +// phi_return = 0; +// if (fabsf(sp18->x) < 100.0f) +// { +// temp_f0 = fabsf(sp18->z); +// phi_return = temp_f0; +// if (temp_f0 < 120.0f) +// { +// phi_return = 1; +// } +// } +// return phi_return; +// } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Firewall/func_80886810.s") +void BgHidanFirewall_Idle(BgHidanFirewall* this, GlobalContext* globalCtx) +{ + if (func_80886728(this, globalCtx) != 0) + { + this->actor.draw = func_80886B34; + this->actor.params = 5; + this->method = BgHidanFirewall_Countdown; + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Firewall/func_80886898.s") +void BgHidanFirewall_Countdown(BgHidanFirewall* this, GlobalContext* globalCtx) +{ + + if (this->actor.params != 0) + { + this->actor.params--; + } + if (this->actor.params == 0) + { + this->method = &func_80886810; + } +} + +void func_80886810(BgHidanFirewall* this, GlobalContext* globalCtx) +{ + if (func_80886728(this, globalCtx) != 0) + { + Math_ApproxF(&this->actor.scale.y, 0.1f, 0.024999999f); + return; + } + if (Math_ApproxF(&this->actor.scale.y, D_80886D8C, D_80886D8C) != 0) + { + this->actor.draw = 0; + this->method = BgHidanFirewall_Idle; + } + else + { + this->actor.params = 0; + } +} + +void func_80886898(BgHidanFirewall* this, GlobalContext* globalCtx) +{ + s16 phi_a3; + + if (func_8002E084(&this->actor, 0x4000) != 0) + { + phi_a3 = this->actor.shape.rot.y; + } + else + { + phi_a3 = (s16)(this->actor.shape.rot.y + 0x8000); + } + func_8002F71C(globalCtx, this, 5.0f, phi_a3, 1.0f); +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Firewall/func_808868FC.s") +// void func_808868FC(BgHidanFirewall* this, GlobalContext* globalCtx, Vec3f* arg2) +// { +// f32 sp38; +// Vec3f* sp30 = &globalCtx->actorCtx.actorList[2].first->posRot.pos; +// f32 sp28; +// f32 temp_ret; +// f32 phi_f0; + +// func_8002DBD0((Actor*)this, &sp30, arg2); +// if (globalCtx->actorCtx.actorList[2].first->posRot.pos.x < -70.0f) +// { +// globalCtx->actorCtx.actorList[2].first->posRot.pos.x = -70.0f; +// } +// else +// { +// if (70.0f < globalCtx->actorCtx.actorList[2].first->posRot.pos.x) +// { +// phi_f0 = 70.0f; +// } +// else +// { +// phi_f0 = globalCtx->actorCtx.actorList[2].first->posRot.pos.x; +// } +// globalCtx->actorCtx.actorList[2].first->posRot.pos.x = (f32) phi_f0; +// } +// if (this->actor.params == 0) +// { +// if (0.0f < sp38) +// { +// sp38 = -25.0f; +// this->actor.params = -1; +// } +// else +// { +// sp38 = 25.0f; +// this->actor.params = 1; +// } +// } +// else +// { +// sp38 = this->actor.params * 25.0f; +// } +// sp28 = Math_Sins(this->actor.sub_B4.rot2.y); +// temp_ret = Math_Coss(this->actor.sub_B4.rot2.y); +// this->ukn_19A = (s16) ((this->actor.posRot.pos.x + (globalCtx->actorCtx.actorList[2].first->posRot.pos.x * temp_ret)) + (sp38 * sp28)); +// this->ukn_19E = (s16) ((this->actor.posRot.pos.z - (globalCtx->actorCtx.actorList[2].first->posRot.pos.x * sp28)) + (sp38 * temp_ret)); +// } #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Firewall/BgHidanFirewall_Update.s") +// void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx) +// { +// // s32 temp_t8; +// s32 phi_t8; + +// // s16 temp_t6 = this->ukn_150; +// s32 temp_t7 = (this->ukn_150 + 1); +// // temp_t8 = temp_t7 & 7; +// // phi_t8 = temp_t8; +// phi_t8 = temp_t7 & 7; + +// if (temp_t7 < 0) +// { +// // phi_t8 = temp_t8; +// // if (temp_t8 != 0) +// if (phi_t8 != 0) +// { +// phi_t8 = phi_t8 - 8; +// } +// } +// this->ukn_150 = phi_t8; +// if ((this->ukn_164 & 2) != 0) +// { +// this->ukn_164 = (this->ukn_164 & 0xfffd); +// func_80886898(this, globalCtx); +// } +// this->ukn_14C(this, globalCtx); +// if (&func_80886810 == this->ukn_14C) +// { +// func_808868FC(this, globalCtx); +// Actor_CollisionCheck_SetAT(globalCtx, &globalCtx->sub_11E60, &this->collision); +// Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collision); +// func_8002F974((Actor*)this, 0x2034); +// } +// } //Still working on this + +// BgHidanFirewall_Draw #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Firewall/func_80886B34.s") +// void func_80886B34(BgHidanFirewall* this, GlobalContext* globalCtx) +// { +// Gfx** sp38; +// s32 sp28; +// Gfx* temp_ret; +// Gfx* temp_v0; +// s32 temp_v0_2; +// s32 temp_v0_3; +// s32 temp_v0_4; +// s32 temp_v0_5; +// char* temp_a0; + +// func_800C6AC4(&sp38, globalCtx->gfxCtx, D_80886D30, 0x1c0); +// temp_ret = func_80093774(globalCtx->gfxCtx->polyXlu.p, 0x14); +// temp_v0 = temp_ret; +// globalCtx->gfxCtx->polyXlu.p = temp_ret; +// globalCtx->gfxCtx->polyXlu.p = (s32) (temp_v0 + 8); +// temp_v0->unk0 = 0xdb060020; +// temp_a0 = D_80886D04 + (this->ukn_150 * 4); +// temp_v0->unk4 = (s32) (((*temp_a0 & 0xffffff) + ((char*)0x80160000 + (((*temp_a0 * 0x10) >> 0x1c) * 4))->unk6FA8) + 0x80000000); +// temp_v0_2 = globalCtx->gfxCtx->polyXlu.p; +// globalCtx->gfxCtx->polyXlu.p = (s32) (temp_v0_2 + 8); +// temp_v0_2->unk0 = 0xfa000001; +// temp_v0_2->unk4 = 0xffff0096; +// temp_v0_3 = globalCtx->gfxCtx->polyXlu.p; +// globalCtx->gfxCtx->polyXlu.p = (s32) (temp_v0_3 + 8); +// temp_v0_3->unk0 = 0xfb000000; +// temp_v0_3->unk4 = 0xff0000ff; +// temp_v0_4 = globalCtx->gfxCtx->polyXlu.p; +// globalCtx->gfxCtx->polyXlu.p = (s32) (temp_v0_4 + 8); +// temp_v0_4->unk0 = 0xda380003; +// sp28 = temp_v0_4; +// sp28->unk4 = func_800D1A88(*arg1, &D_80886D4C, 0x1ca); +// temp_v0_5 = globalCtx->gfxCtx->polyXlu.p; +// globalCtx->gfxCtx->polyXlu.p = (s32) (temp_v0_5 + 8); +// temp_v0_5->unk4 = (s32) (0x6010000 + 0xda80); +// temp_v0_5->unk0 = 0xde000000; +// func_800C6B54(&sp38, *arg1, &D_80886D68, 0x1cf); +// } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h index afde1bf451..37324588d2 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h @@ -4,12 +4,45 @@ #include #include -typedef struct +struct BgHidanFirewall; + +typedef void (*FirewallFunc)(struct BgHidanFirewall* this, GlobalContext* globalCtx); + +typedef struct BgHidanFirewall { - /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x54]; + /* 0x0000 */ Actor actor; + /* 0x014C */ FirewallFunc method; // idle, countdown, etc + /* 0x0150 */ s16 ukn_150; + /* 0x0152 */ s16 ukn_152; + /* 0x0154 */ ColliderCylinderMain* collider; + /* 0x0158 */ char ukn_158[0xC]; + /* 0x0164 */ u8 ukn_164; + /* 0x0165 */ char ukn_166[0x35]; + /* 0x019A */ s16 ukn_19A; + /* 0x019C */ s16 ukn_19C; + /* 0x019E */ s16 ukn_19E; } BgHidanFirewall; // size = 0x01A0 extern const ActorInit Bg_Hidan_Firewall_InitVars; +void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx); +void BgHidanFirewall_Destroy(BgHidanFirewall* this, GlobalContext* globalCtx); +s32 func_80886728(BgHidanFirewall* this, GlobalContext* globalCtx); +void BgHidanFirewall_Idle(BgHidanFirewall* this, GlobalContext* globalCtx); +void BgHidanFirewall_Countdown(BgHidanFirewall* this, GlobalContext* globalCtx); +void func_80886810(BgHidanFirewall* this, GlobalContext* globalCtx); +void func_80886898(BgHidanFirewall* this, GlobalContext* globalCtx); +void func_808868FC(BgHidanFirewall* this, GlobalContext* globalCtx); +void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx); +void func_80886B34(BgHidanFirewall* this, GlobalContext* globalCtx); + +extern char D_80886CFC[8]; +extern char D_80886D04[11 * 4]; +extern void func_80061ED4(); +extern char* D_80886D30; // "../z_bg_hidan_firewall.c +extern f32 D_80886D84; +extern f32 D_80886D88; +extern float D_80886D8C; +extern ColliderCylinderMain D_80886CD0; + #endif From e5a5f0a46d5fbe9db18e5152daac6f19a13f37c5 Mon Sep 17 00:00:00 2001 From: Gamestabled Date: Thu, 19 Mar 2020 00:32:57 -0400 Subject: [PATCH 03/14] changed some names --- .../z_bg_hidan_firewall.c | 97 +++++++++---------- .../z_bg_hidan_firewall.h | 17 ++-- 2 files changed, 51 insertions(+), 63 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c index 5c3e181fcc..ccf7600fda 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c @@ -50,16 +50,16 @@ void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx){ scale = D_80886D88; this->actor.scale.y = D_80886D88; - this->ukn_150 = 0; + this->unk_150 = 0; ActorCollider_AllocCylinder(globalCtx, ((s32*)this+0x55));//TODO: fix this. multiple cylinders? ActorCollider_InitCylinder(globalCtx, ((s32*)this+0x55), &this->actor, &D_80886CD0); - this->ukn_19C = this->actor.posRot.pos.y; + this->pos_19A.y = this->actor.posRot.pos.y; func_80061ED4(&this->actor.sub_98, 0, D_80886CFC); - this->method = BgHidanFirewall_Idle; + this->actionFunc = BgHidanFirewall_Wait; return; } @@ -74,31 +74,29 @@ void BgHidanFirewall_Destroy(BgHidanFirewall* this, GlobalContext* globalCtx) // s32 func_80886728(BgHidanFirewall* this, GlobalContext* globalCtx) // { // Vec3f* sp18; //TODO: where does this come from? -// f32 temp_f0; -// u32 phi_return; +// f32 phi_return; // func_8002DBD0(&this->actor, sp18, &(globalCtx->actorCtx.actorList[2].first->posRot.pos)); -// phi_return = 0; +// phi_return = 0.0f; // if (fabsf(sp18->x) < 100.0f) // { -// temp_f0 = fabsf(sp18->z); -// phi_return = temp_f0; -// if (temp_f0 < 120.0f) +// phi_return = fabsf(sp18->z); +// if (phi_return < 120.0f) // { -// phi_return = 1; +// phi_return = 1.401298464324817e-45f; // } // } // return phi_return; // } -void BgHidanFirewall_Idle(BgHidanFirewall* this, GlobalContext* globalCtx) +void BgHidanFirewall_Wait(BgHidanFirewall* this, GlobalContext* globalCtx) { if (func_80886728(this, globalCtx) != 0) { this->actor.draw = func_80886B34; this->actor.params = 5; - this->method = BgHidanFirewall_Countdown; + this->actionFunc = BgHidanFirewall_Countdown; } } @@ -111,7 +109,7 @@ void BgHidanFirewall_Countdown(BgHidanFirewall* this, GlobalContext* globalCtx) } if (this->actor.params == 0) { - this->method = &func_80886810; + this->actionFunc = &func_80886810; } } @@ -125,7 +123,7 @@ void func_80886810(BgHidanFirewall* this, GlobalContext* globalCtx) if (Math_ApproxF(&this->actor.scale.y, D_80886D8C, D_80886D8C) != 0) { this->actor.draw = 0; - this->method = BgHidanFirewall_Idle; + this->actionFunc = BgHidanFirewall_Wait; } else { @@ -149,91 +147,84 @@ void func_80886898(BgHidanFirewall* this, GlobalContext* globalCtx) } #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Firewall/func_808868FC.s") -// void func_808868FC(BgHidanFirewall* this, GlobalContext* globalCtx, Vec3f* arg2) +// void func_808868FC(BgHidanFirewall* this, GlobalContext* globalCtx) // { -// f32 sp38; -// Vec3f* sp30 = &globalCtx->actorCtx.actorList[2].first->posRot.pos; -// f32 sp28; +// Vec3f* temp = &globalCtx->actorCtx.actorList[2].first->posRot.pos; +// Vec3f sp30; // f32 temp_ret; +// f32 sp28; // f32 phi_f0; -// func_8002DBD0((Actor*)this, &sp30, arg2); -// if (globalCtx->actorCtx.actorList[2].first->posRot.pos.x < -70.0f) +// func_8002DBD0(&this->actor, &sp30, temp); +// if (sp30.x < -70.0f) // { -// globalCtx->actorCtx.actorList[2].first->posRot.pos.x = -70.0f; +// sp30.x = -70.0f; // } // else // { -// if (70.0f < globalCtx->actorCtx.actorList[2].first->posRot.pos.x) +// if (70.0f < sp30.x) // { // phi_f0 = 70.0f; // } // else // { -// phi_f0 = globalCtx->actorCtx.actorList[2].first->posRot.pos.x; +// phi_f0 = sp30.x; // } -// globalCtx->actorCtx.actorList[2].first->posRot.pos.x = (f32) phi_f0; +// sp30.x = phi_f0; // } // if (this->actor.params == 0) // { -// if (0.0f < sp38) +// if (0.0f < sp30.z) // { -// sp38 = -25.0f; +// sp30.z = -25.0f; // this->actor.params = -1; // } // else // { -// sp38 = 25.0f; +// sp30.z = 25.0f; // this->actor.params = 1; // } // } // else // { -// sp38 = this->actor.params * 25.0f; +// sp30.z = this->actor.params * 25.0f; // } -// sp28 = Math_Sins(this->actor.sub_B4.rot2.y); -// temp_ret = Math_Coss(this->actor.sub_B4.rot2.y); -// this->ukn_19A = (s16) ((this->actor.posRot.pos.x + (globalCtx->actorCtx.actorList[2].first->posRot.pos.x * temp_ret)) + (sp38 * sp28)); -// this->ukn_19E = (s16) ((this->actor.posRot.pos.z - (globalCtx->actorCtx.actorList[2].first->posRot.pos.x * sp28)) + (sp38 * temp_ret)); +// sp28 = Math_Sins(this->actor.shape.rot.y); +// temp_ret = Math_Coss(this->actor.shape.rot.y); +// this->pos_19A.x = ((this->actor.posRot.pos.x + (sp30.x * temp_ret)) + (sp30.z * sp28)); +// this->pos_19A.z = ((this->actor.posRot.pos.z - (sp30.x * sp28)) + (sp30.z * temp_ret)); // } + #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Firewall/BgHidanFirewall_Update.s") // void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx) // { -// // s32 temp_t8; // s32 phi_t8; - -// // s16 temp_t6 = this->ukn_150; -// s32 temp_t7 = (this->ukn_150 + 1); +// u8 t; -// // temp_t8 = temp_t7 & 7; -// // phi_t8 = temp_t8; -// phi_t8 = temp_t7 & 7; +// phi_t8 = (((this->ukn_150)) + 1) & 7; +// t = this->ukn_164; -// if (temp_t7 < 0) +// if ((this->ukn_150) + 1 < 0 && phi_t8) // { -// // phi_t8 = temp_t8; -// // if (temp_t8 != 0) -// if (phi_t8 != 0) -// { -// phi_t8 = phi_t8 - 8; -// } +// phi_t8 -= 8; // } // this->ukn_150 = phi_t8; + // if ((this->ukn_164 & 2) != 0) // { -// this->ukn_164 = (this->ukn_164 & 0xfffd); +// this->ukn_164 &= 0xfffd; // func_80886898(this, globalCtx); // } -// this->ukn_14C(this, globalCtx); -// if (&func_80886810 == this->ukn_14C) +// this->actionFunc(this, globalCtx); +// if (&func_80886810 == this->actionFunc) // { // func_808868FC(this, globalCtx); -// Actor_CollisionCheck_SetAT(globalCtx, &globalCtx->sub_11E60, &this->collision); -// Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collision); -// func_8002F974((Actor*)this, 0x2034); +// Actor_CollisionCheck_SetAT(globalCtx, &globalCtx->sub_11E60, &this->collider); +// Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider); +// func_8002F974(&this->actor, 0x2034); // } -// } //Still working on this +// } // BgHidanFirewall_Draw #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Firewall/func_80886B34.s") diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h index 37324588d2..ddf2cc5af4 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h @@ -11,16 +11,13 @@ typedef void (*FirewallFunc)(struct BgHidanFirewall* this, GlobalContext* global typedef struct BgHidanFirewall { /* 0x0000 */ Actor actor; - /* 0x014C */ FirewallFunc method; // idle, countdown, etc - /* 0x0150 */ s16 ukn_150; - /* 0x0152 */ s16 ukn_152; + /* 0x014C */ FirewallFunc actionFunc; // idle, countdown, etc + /* 0x0150 */ s16 unk_150; /* 0x0154 */ ColliderCylinderMain* collider; - /* 0x0158 */ char ukn_158[0xC]; - /* 0x0164 */ u8 ukn_164; - /* 0x0165 */ char ukn_166[0x35]; - /* 0x019A */ s16 ukn_19A; - /* 0x019C */ s16 ukn_19C; - /* 0x019E */ s16 ukn_19E; + /* 0x0158 */ char unk_158[0xC]; + /* 0x0164 */ u8 unk_164; + /* 0x0165 */ char unk_166[0x35]; + /* 0x019A */ Vec3s pos_19A; } BgHidanFirewall; // size = 0x01A0 extern const ActorInit Bg_Hidan_Firewall_InitVars; @@ -28,7 +25,7 @@ extern const ActorInit Bg_Hidan_Firewall_InitVars; void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Destroy(BgHidanFirewall* this, GlobalContext* globalCtx); s32 func_80886728(BgHidanFirewall* this, GlobalContext* globalCtx); -void BgHidanFirewall_Idle(BgHidanFirewall* this, GlobalContext* globalCtx); +void BgHidanFirewall_Wait(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Countdown(BgHidanFirewall* this, GlobalContext* globalCtx); void func_80886810(BgHidanFirewall* this, GlobalContext* globalCtx); void func_80886898(BgHidanFirewall* this, GlobalContext* globalCtx); From dda2641082d34504156760e6444ab9bc69954cef Mon Sep 17 00:00:00 2001 From: Gamestabled Date: Thu, 19 Mar 2020 04:57:37 -0400 Subject: [PATCH 04/14] begain work on EnAni --- .../z_bg_hidan_firewall.h | 4 +- src/overlays/actors/ovl_En_Ani/z_en_ani.c | 163 ++++++++++++++++-- src/overlays/actors/ovl_En_Ani/z_en_ani.h | 26 ++- 3 files changed, 178 insertions(+), 15 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h index ddf2cc5af4..96f693de37 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h @@ -6,12 +6,12 @@ struct BgHidanFirewall; -typedef void (*FirewallFunc)(struct BgHidanFirewall* this, GlobalContext* globalCtx); +typedef void FirewallFunc(struct BgHidanFirewall* this, GlobalContext* globalCtx); typedef struct BgHidanFirewall { /* 0x0000 */ Actor actor; - /* 0x014C */ FirewallFunc actionFunc; // idle, countdown, etc + /* 0x014C */ FirewallFunc* actionFunc; // idle, countdown, etc /* 0x0150 */ s16 unk_150; /* 0x0154 */ ColliderCylinderMain* collider; /* 0x0158 */ char unk_158[0xC]; diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c index bf0cc6b585..eb8ddffcf8 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -3,10 +3,6 @@ #define ROOM 0x00 #define FLAGS 0x00000009 -void EnAni_Init(EnAni* this, GlobalContext* globalCtx); -void EnAni_Destroy(EnAni* this, GlobalContext* globalCtx); -void EnAni_Update(EnAni* this, GlobalContext* globalCtx); -void EnAni_Draw(EnAni* this, GlobalContext* globalCtx); /* const ActorInit En_Ani_InitVars = @@ -23,38 +19,181 @@ const ActorInit En_Ani_InitVars = (ActorFunc)EnAni_Draw, }; */ -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B0370.s") + +//EnAni_SetupAction +void func_809B0370(EnAni* this, ActorFunc actionFunc) +{ + this->actionFunc = actionFunc; +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/EnAni_Init.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/EnAni_Destroy.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B04B4.s") +s32 func_809B04B4(EnAni* this, GlobalContext* globalCtx, u16 arg2) +{ + this->actor.textId = arg2; + this->unk_2A8 = (this->unk_2A8 | 1); + func_8002F2CC(&this->actor, globalCtx, 100.0f); + return 0; +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B04F0.s") +void func_809B04F0(EnAni* this, GlobalContext* globalCtx) +{ + if (func_8002F334(&this->actor, globalCtx) != 0) + { + func_809B0370(this, func_809B064C); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B0524.s") +void func_809B0524(EnAni* this, GlobalContext* globalCtx) +{ + if (func_8002F334(&this->actor, globalCtx) != 0) + { + func_809B0370(this, func_809B07F8); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B0558.s") +void func_809B0558(EnAni* this, GlobalContext* globalCtx) +{ + if (func_8002F410(&this->actor, globalCtx) != 0) + { + this->actor.attachedA = 0; + if (LINK_IS_CHILD) + { + func_809B0370(this, func_809B04F0); + } + else + { + func_809B0370(this, func_809B0524); + } + gSaveContext.item_get_inf[1] = gSaveContext.item_get_inf[1] | 0x20; + return; + } + func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 200.0f); +} -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B05F0.s") +void func_809B05F0(EnAni* this, GlobalContext* globalCtx) +{ + if (func_8002F334(this, globalCtx) != 0) + { + func_809B0370(this, func_809B0558); + } + func_8002F434(this, globalCtx, GI_HEART_PIECE, 10000.0f, 200.0f); +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B064C.s") +// void func_809B064C(EnAni* this, GlobalContext* globalCtx) +// { +// u16 phi_a2; +// s16 temp_v1; +// s32 temp_ret; + +// temp_ret = func_8006C360(globalCtx, 0xA); +// phi_a2 = temp_ret & 0xffff; + +// if (temp_ret == 0) +// { +// phi_a2 = 0x5050U; +// if (gSaveContext.night_flag != 0) +// { +// phi_a2 = 0x5051U; +// } +// } + +// temp_v1 = (this->actor.rotTowardsLinkY - this->actor.shape.rot.y); +// if (func_8002F194(&this->actor, globalCtx) != 0) +// { +// if (this->actor.textId == 0x5056) // "To get a good view..." +// { +// func_809B0370(this, func_809B04F0); +// return; +// } +// if (this->actor.textId == 0x5055) // "...I'll give you this as a memento." +// { + +// func_809B0370(this, func_809B05F0); +// return; +// } +// func_809B0370(this, func_809B04F0); +// return; +// } +// if (temp_v1 >= -0x36AF) +// { +// if (temp_v1 < 0) +// { +// if (this->actor.xzDistanceFromLink < 150.0f) +// { +// if (-80.0f < this->actor.yDistanceFromLink) +// { +// if ((gSaveContext.item_get_inf[1] & 0x20) == 0) +// { +// func_809B04B4(this, globalCtx, 0x5056); // "To get a good view..." +// return; +// } +// func_809B04B4(this, globalCtx, 0x5055); // "...I'll give you this as a memento." +// return; +// } +// } +// } +// } +// if (temp_v1 >= -0x3e7) +// { +// if (temp_v1 < 0x36b0) +// { +// if (this->actor.xzDistanceFromLink < 350.0f) +// { +// func_809B04B4(this, globalCtx, phi_a2); +// } +// } +// } +// } THIS IS SUPER CLOSE #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B07F8.s") -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B0988.s") +void func_809B0988(EnAni* this, GlobalContext* globalCtx) { } #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B0994.s") +// void func_809B0994(EnAni* this, GlobalContext* globalCtx) +// { +// if (globalCtx->csCtx.actorActions[0]->action == 4) +// { +// SkelAnime_ChangeAnimation(&this->skelAnime, 0x60070F0, 1.0f, 0.0f, (f32) SkelAnime_GetFrameCount(0x60070F0), 2, -4.0f); +// this->actor.shape.shadowDrawFunc = 0x8003B5EC; +// this->unk_2AA += 1; +// } +// } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B0A28.s") +void func_809B0A28(EnAni* this, GlobalContext* globalCtx) +{ + if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) + { + this->unk_2AA += 1; + } +} #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B0A6C.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/EnAni_Update.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B0D90.s") +// ? func_809B0D90(s32 arg0, s32 arg1, ? arg2, ? arg3, void *arg4, void *arg5) +// { +// if (arg1 == 0xf) +// { +// arg4->unk0 = (s16) (arg4->unk0 + arg5->unk29E); +// arg4->unk4 = (s16) (arg4->unk4 + arg5->unk29C); +// } +// return 0; +// } #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B0DD4.s") +// void func_809B0DD4(s32 arg0, Actor* arg1, ? arg2, ? arg3) +// { +// if (arg1 == 0xf) +// { +// Matrix_MultVec3f(&D_809B0F74, &arg1->posRot2.pos); +// } +// } #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/EnAni_Draw.s") diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.h b/src/overlays/actors/ovl_En_Ani/z_en_ani.h index 05b739e3d5..1b7bd4226f 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.h +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.h @@ -7,9 +7,33 @@ typedef struct { /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x168]; + /* 0x014C */ char unk_14C[0x4C]; + /* 0x0198 */ SkelAnime skelAnime; + /* 0x01D8 */ char unk_19C[0xD0]; + /* 0x02A8 */ u16 unk_2A8; + /* 0x02AA */ u16 unk_2AA; + /* 0x02AC */ char unk_2AC[0x4]; + /* 0x02B0 */ ActorFunc actionFunc; } EnAni; // size = 0x02B4 extern const ActorInit En_Ani_InitVars; +void func_809B0370(EnAni* this, ActorFunc actionFunc); +void EnAni_Init(EnAni* this, GlobalContext* globalCtx); +void EnAni_Destroy(EnAni* this, GlobalContext* globalCtx); +s32 func_809B04B4(EnAni* this, GlobalContext* globalCtx, u16 arg2); +void func_809B04F0(EnAni* this, GlobalContext* globalCtx); +void func_809B0524(EnAni* this, GlobalContext* globalCtx); +void func_809B0558(EnAni* this, GlobalContext* globalCtx); +void func_809B05F0(EnAni* this, GlobalContext* globalCtx); +void func_809B064C(EnAni* this, GlobalContext* globalCtx); +void func_809B07F8(EnAni* this, GlobalContext* globalCtx); +void func_809B0988(EnAni* this, GlobalContext* globalCtx); + + + +void EnAni_Update(EnAni* this, GlobalContext* globalCtx); +void EnAni_Draw(EnAni* this, GlobalContext* globalCtx); + + #endif From a00a8bbaeb896bf12f115e6a0e636c09733c57ff Mon Sep 17 00:00:00 2001 From: Gamestabled Date: Sun, 5 Apr 2020 05:02:55 -0400 Subject: [PATCH 05/14] all functions match, now learning how to do data/rodata --- .../actors/z_bg_hidan_firewall.data.s | 12 +- .../z_bg_hidan_firewall.c | 318 +++++++++--------- .../z_bg_hidan_firewall.h | 24 +- undefined_syms.txt | 18 +- 4 files changed, 186 insertions(+), 186 deletions(-) diff --git a/data/overlays/actors/z_bg_hidan_firewall.data.s b/data/overlays/actors/z_bg_hidan_firewall.data.s index ff4314b4d1..1449400411 100644 --- a/data/overlays/actors/z_bg_hidan_firewall.data.s +++ b/data/overlays/actors/z_bg_hidan_firewall.data.s @@ -7,12 +7,12 @@ .section .data -glabel Bg_Hidan_Firewall_InitVars - .word 0x000C0100, 0x00000000, 0x002C0000, 0x000001A0 -.word BgHidanFirewall_Init -.word BgHidanFirewall_Destroy -.word BgHidanFirewall_Update -.word 0x00000000 +#glabel Bg_Hidan_Firewall_InitVars +# .word 0x000C0100, 0x00000000, 0x002C0000, 0x000001A0 +#.word BgHidanFirewall_Init +#.word BgHidanFirewall_Destroy +#.word BgHidanFirewall_Update +#.word 0x00000000 glabel D_80886CD0 .word 0x0A110009, 0x20010000, 0x00000000, 0x20000000, 0x01040000, 0xFFCFFFFF, 0x00000000, 0x19000100, 0x001E0053, 0x00000000, 0x00000000 glabel D_80886CFC diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c index ccf7600fda..0b7eb1d580 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c @@ -5,25 +5,38 @@ // static ColliderCylinderInit cylinderInitData = // { -// { -// 0x0A, 0x11, 0x00, 0x09, -// 0x20, 0x01, { 0x00, 0x00, }, -// 0x00, { 0x00, 0x00, 0x00, }, -// 0x20000000, -// 0x01, 0x04, { 0x00, 0x00, }, -// 0xFFCFFFFF, -// { 0x00, 0x00, 0x00, 0x00, }, -// 0x19, 0x00, 0x01, 0x00, -// }, +// 0x0A, 0x11, 0x00, 0x09, +// 0x20, 0x01, 0x00, 0x00, +// 0x00, 0x00, 0x00, 0x00, +// 0x20000000, +// 0x01, 0x04, 0x00, 0x00, +// 0xFFCFFFFF, +// 0x00, 0x00, 0x00, 0x00, +// 0x19, 0x00, 0x01, 0x00, // 0x001E, // 0x0053, -// 0x0000, -// { -// 0x0000, 0x0000, 0x0000, -// }, +// 0x00000000000000000000, +// }; + +// static SubActor98Init actor98InitData = +// { +// 0x01, 0x0050, 0x0064, 0xFF, +// }; + +// u32 D_80886D04[] = { +// 0x06015D20, +// 0x06016120, +// 0x06016520, +// 0x06016920, +// 0x06016D20, +// 0x06017120, +// 0x06017520, +// 0x06017920, +// 0x00000000, +// 0x00000000, +// 0x00000000, // }; -/* const ActorInit Bg_Hidan_Firewall_InitVars = { ACTOR_BG_HIDAN_FIREWALL, @@ -37,12 +50,11 @@ const ActorInit Bg_Hidan_Firewall_InitVars = (ActorFunc)BgHidanFirewall_Update, NULL, }; -*/ void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx){ f32 scale; - + scale = D_80886D84; this->actor.scale.x = scale; this->actor.scale.z = scale; @@ -52,12 +64,12 @@ void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx){ this->unk_150 = 0; - ActorCollider_AllocCylinder(globalCtx, ((s32*)this+0x55));//TODO: fix this. multiple cylinders? - ActorCollider_InitCylinder(globalCtx, ((s32*)this+0x55), &this->actor, &D_80886CD0); + ActorCollider_AllocCylinder(globalCtx, &this->collider); + ActorCollider_InitCylinder(globalCtx, &this->collider, &this->actor, &D_80886CD0); - this->pos_19A.y = this->actor.posRot.pos.y; + this->collider.dim.position.y = this->actor.posRot.pos.y; - func_80061ED4(&this->actor.sub_98, 0, D_80886CFC); + func_80061ED4(&this->actor.sub_98, NULL, &D_80886CFC); this->actionFunc = BgHidanFirewall_Wait; return; @@ -66,35 +78,32 @@ void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx){ void BgHidanFirewall_Destroy(BgHidanFirewall* this, GlobalContext* globalCtx) { BgHidanFirewall* thing = this; - ActorCollider_FreeCylinder(globalCtx, (char*)this + 0x154);//TODO: fix this. multiple cylinders? + ActorCollider_FreeCylinder(globalCtx, &this->collider); } -// BgHidanFirewall_Proximity -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Firewall/func_80886728.s") -// s32 func_80886728(BgHidanFirewall* this, GlobalContext* globalCtx) -// { -// Vec3f* sp18; //TODO: where does this come from? -// f32 phi_return; +s32 BgHidanFirewall_Proximity(BgHidanFirewall* this, GlobalContext* globalCtx) +{ + Player* player; + Vec3f distance; + + player = PLAYER; + func_8002DBD0(&this->actor, &distance, &player->actor.posRot.pos); -// func_8002DBD0(&this->actor, sp18, &(globalCtx->actorCtx.actorList[2].first->posRot.pos)); - -// phi_return = 0.0f; -// if (fabsf(sp18->x) < 100.0f) -// { -// phi_return = fabsf(sp18->z); -// if (phi_return < 120.0f) -// { -// phi_return = 1.401298464324817e-45f; -// } -// } -// return phi_return; -// } + if (fabsf(distance.x) < 100.0f) + { + if (fabsf(distance.z) < 120.0f) + { + return 1; + } + } + return 0; +} void BgHidanFirewall_Wait(BgHidanFirewall* this, GlobalContext* globalCtx) { - if (func_80886728(this, globalCtx) != 0) + if (BgHidanFirewall_Proximity(this, globalCtx) != 0) { - this->actor.draw = func_80886B34; + this->actor.draw = BgHidanFirewall_Draw; this->actor.params = 5; this->actionFunc = BgHidanFirewall_Countdown; } @@ -109,20 +118,20 @@ void BgHidanFirewall_Countdown(BgHidanFirewall* this, GlobalContext* globalCtx) } if (this->actor.params == 0) { - this->actionFunc = &func_80886810; + this->actionFunc = BgHidanFirewall_Erupt; } } -void func_80886810(BgHidanFirewall* this, GlobalContext* globalCtx) +void BgHidanFirewall_Erupt(BgHidanFirewall* this, GlobalContext* globalCtx) { - if (func_80886728(this, globalCtx) != 0) + if (BgHidanFirewall_Proximity(this, globalCtx) != 0) { Math_ApproxF(&this->actor.scale.y, 0.1f, 0.024999999f); return; } if (Math_ApproxF(&this->actor.scale.y, D_80886D8C, D_80886D8C) != 0) { - this->actor.draw = 0; + this->actor.draw = NULL; this->actionFunc = BgHidanFirewall_Wait; } else @@ -141,129 +150,106 @@ void func_80886898(BgHidanFirewall* this, GlobalContext* globalCtx) } else { - phi_a3 = (s16)(this->actor.shape.rot.y + 0x8000); + phi_a3 = this->actor.shape.rot.y + 0x8000; } func_8002F71C(globalCtx, this, 5.0f, phi_a3, 1.0f); } -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Firewall/func_808868FC.s") -// void func_808868FC(BgHidanFirewall* this, GlobalContext* globalCtx) -// { -// Vec3f* temp = &globalCtx->actorCtx.actorList[2].first->posRot.pos; -// Vec3f sp30; -// f32 temp_ret; -// f32 sp28; -// f32 phi_f0; +void func_808868FC(BgHidanFirewall* this, GlobalContext* globalCtx) +{ + Player* player; + Vec3f sp30; + f32 temp_ret; + f32 sp28; + f32 phi_f0; -// func_8002DBD0(&this->actor, &sp30, temp); -// if (sp30.x < -70.0f) -// { -// sp30.x = -70.0f; -// } -// else -// { -// if (70.0f < sp30.x) -// { -// phi_f0 = 70.0f; -// } -// else -// { -// phi_f0 = sp30.x; -// } -// sp30.x = phi_f0; -// } -// if (this->actor.params == 0) -// { -// if (0.0f < sp30.z) -// { -// sp30.z = -25.0f; -// this->actor.params = -1; -// } -// else -// { -// sp30.z = 25.0f; -// this->actor.params = 1; -// } -// } -// else -// { -// sp30.z = this->actor.params * 25.0f; -// } -// sp28 = Math_Sins(this->actor.shape.rot.y); -// temp_ret = Math_Coss(this->actor.shape.rot.y); -// this->pos_19A.x = ((this->actor.posRot.pos.x + (sp30.x * temp_ret)) + (sp30.z * sp28)); -// this->pos_19A.z = ((this->actor.posRot.pos.z - (sp30.x * sp28)) + (sp30.z * temp_ret)); -// } + player = PLAYER; + + func_8002DBD0(&this->actor, &sp30, &player->actor.posRot.pos); + if (sp30.x < -70.0f) + { + sp30.x = -70.0f; + } + else + { + if (70.0f < sp30.x) + { + phi_f0 = 70.0f; + } + else + { + phi_f0 = sp30.x; + } + sp30.x = phi_f0; + } + if (this->actor.params == 0) + { + if (0.0f < sp30.z) + { + sp30.z = -25.0f; + this->actor.params = -1; + } + else + { + sp30.z = 25.0f; + this->actor.params = 1; + } + } + else + { + sp30.z = this->actor.params * 25.0f; + } + sp28 = Math_Sins(this->actor.shape.rot.y); + temp_ret = Math_Coss(this->actor.shape.rot.y); + this->collider.dim.position.x = ((this->actor.posRot.pos.x + (sp30.x * temp_ret)) + (sp30.z * sp28)); + this->collider.dim.position.z = ((this->actor.posRot.pos.z - (sp30.x * sp28)) + (sp30.z * temp_ret)); +} + +void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx) +{ + s32 pad1; + s32 pad2; + + this->unk_150 = (this->unk_150 + 1) % 8; + + if (this->collider.base.colliderFlags & 2) + { + this->collider.base.colliderFlags &= ~2; + func_80886898(this, globalCtx); + } + + this->actionFunc(this, globalCtx); + if (this->actionFunc == BgHidanFirewall_Erupt) + { + func_808868FC(this, globalCtx); + Actor_CollisionCheck_SetAT(globalCtx, &globalCtx->sub_11E60, &this->collider); + Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider); + func_8002F974(&this->actor, 0x2034); + } +} + +void BgHidanFirewall_Draw(BgHidanFirewall* this, GlobalContext* globalCtx) +{ + u32* temp; + u32 pad; + GraphicsContext* gfxCtx; + u32 pad1; + u32 pad2; + Gfx* gfx; + + gfxCtx = globalCtx->state.gfxCtx; + + func_800C6AC4(&gfx, globalCtx->state.gfxCtx, &D_80886D30, 0x1C0); + gfxCtx->polyXlu.p = func_80093774(gfxCtx->polyXlu.p, 0x14); + + temp = &D_80886D04; + + gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(temp[this->unk_150])); + gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0x01, 0xFF, 0xFF, 0x00, 0x96); + gDPSetEnvColor(gfxCtx->polyXlu.p++, 0xFF, 0x00, 0x00, 0xFF); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, &D_80886D4C, 0x1CA), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(gfxCtx->polyXlu.p++, &D_0600DA80); -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Firewall/BgHidanFirewall_Update.s") -// void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx) -// { -// s32 phi_t8; -// u8 t; - -// phi_t8 = (((this->ukn_150)) + 1) & 7; -// t = this->ukn_164; - -// if ((this->ukn_150) + 1 < 0 && phi_t8) -// { -// phi_t8 -= 8; -// } -// this->ukn_150 = phi_t8; - -// if ((this->ukn_164 & 2) != 0) -// { -// this->ukn_164 &= 0xfffd; -// func_80886898(this, globalCtx); -// } -// this->actionFunc(this, globalCtx); -// if (&func_80886810 == this->actionFunc) -// { -// func_808868FC(this, globalCtx); -// Actor_CollisionCheck_SetAT(globalCtx, &globalCtx->sub_11E60, &this->collider); -// Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider); -// func_8002F974(&this->actor, 0x2034); -// } -// } - -// BgHidanFirewall_Draw -#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Bg_Hidan_Firewall/func_80886B34.s") -// void func_80886B34(BgHidanFirewall* this, GlobalContext* globalCtx) -// { -// Gfx** sp38; -// s32 sp28; -// Gfx* temp_ret; -// Gfx* temp_v0; -// s32 temp_v0_2; -// s32 temp_v0_3; -// s32 temp_v0_4; -// s32 temp_v0_5; -// char* temp_a0; - -// func_800C6AC4(&sp38, globalCtx->gfxCtx, D_80886D30, 0x1c0); -// temp_ret = func_80093774(globalCtx->gfxCtx->polyXlu.p, 0x14); -// temp_v0 = temp_ret; -// globalCtx->gfxCtx->polyXlu.p = temp_ret; -// globalCtx->gfxCtx->polyXlu.p = (s32) (temp_v0 + 8); -// temp_v0->unk0 = 0xdb060020; -// temp_a0 = D_80886D04 + (this->ukn_150 * 4); -// temp_v0->unk4 = (s32) (((*temp_a0 & 0xffffff) + ((char*)0x80160000 + (((*temp_a0 * 0x10) >> 0x1c) * 4))->unk6FA8) + 0x80000000); -// temp_v0_2 = globalCtx->gfxCtx->polyXlu.p; -// globalCtx->gfxCtx->polyXlu.p = (s32) (temp_v0_2 + 8); -// temp_v0_2->unk0 = 0xfa000001; -// temp_v0_2->unk4 = 0xffff0096; -// temp_v0_3 = globalCtx->gfxCtx->polyXlu.p; -// globalCtx->gfxCtx->polyXlu.p = (s32) (temp_v0_3 + 8); -// temp_v0_3->unk0 = 0xfb000000; -// temp_v0_3->unk4 = 0xff0000ff; -// temp_v0_4 = globalCtx->gfxCtx->polyXlu.p; -// globalCtx->gfxCtx->polyXlu.p = (s32) (temp_v0_4 + 8); -// temp_v0_4->unk0 = 0xda380003; -// sp28 = temp_v0_4; -// sp28->unk4 = func_800D1A88(*arg1, &D_80886D4C, 0x1ca); -// temp_v0_5 = globalCtx->gfxCtx->polyXlu.p; -// globalCtx->gfxCtx->polyXlu.p = (s32) (temp_v0_5 + 8); -// temp_v0_5->unk4 = (s32) (0x6010000 + 0xda80); -// temp_v0_5->unk0 = 0xde000000; -// func_800C6B54(&sp38, *arg1, &D_80886D68, 0x1cf); -// } + func_800C6B54(&gfx, globalCtx->state.gfxCtx, &D_80886D68, 0x1CF); +} diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h index 96f693de37..d67ffbc8a3 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h @@ -13,33 +13,31 @@ typedef struct BgHidanFirewall /* 0x0000 */ Actor actor; /* 0x014C */ FirewallFunc* actionFunc; // idle, countdown, etc /* 0x0150 */ s16 unk_150; - /* 0x0154 */ ColliderCylinderMain* collider; - /* 0x0158 */ char unk_158[0xC]; - /* 0x0164 */ u8 unk_164; - /* 0x0165 */ char unk_166[0x35]; - /* 0x019A */ Vec3s pos_19A; + /* 0x0154 */ ColliderCylinderMain collider; } BgHidanFirewall; // size = 0x01A0 extern const ActorInit Bg_Hidan_Firewall_InitVars; void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Destroy(BgHidanFirewall* this, GlobalContext* globalCtx); -s32 func_80886728(BgHidanFirewall* this, GlobalContext* globalCtx); +s32 BgHidanFirewall_Proximity(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Wait(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Countdown(BgHidanFirewall* this, GlobalContext* globalCtx); -void func_80886810(BgHidanFirewall* this, GlobalContext* globalCtx); +void BgHidanFirewall_Erupt(BgHidanFirewall* this, GlobalContext* globalCtx); void func_80886898(BgHidanFirewall* this, GlobalContext* globalCtx); void func_808868FC(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx); -void func_80886B34(BgHidanFirewall* this, GlobalContext* globalCtx); +void BgHidanFirewall_Draw(BgHidanFirewall* this, GlobalContext* globalCtx); -extern char D_80886CFC[8]; -extern char D_80886D04[11 * 4]; -extern void func_80061ED4(); -extern char* D_80886D30; // "../z_bg_hidan_firewall.c +extern ColliderCylinderMain D_80886CD0; +extern SubActor98Init D_80886CFC; +extern u32 D_80886D04[11]; extern f32 D_80886D84; extern f32 D_80886D88; extern float D_80886D8C; -extern ColliderCylinderMain D_80886CD0; +extern u32 D_0600DA80; +extern char D_80886D30; +extern char* D_80886D4C; +extern char* D_80886D68; #endif diff --git a/undefined_syms.txt b/undefined_syms.txt index c2d7779fd5..4568e85fdd 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -390,4 +390,20 @@ D_06009244 = 0x06009244; D_060041F4 = 0x060041F4; D_0600A054 = 0x0600A054; D_06008688 = 0x06008688; -D_04049210 = 0x04049210; \ No newline at end of file +D_04049210 = 0x04049210; + +// z_en_ani +D_060067B8 = 0x060067B8; +D_060070F0 = 0x060070F0; +D_8002B5EC = 0x8002B5EC; +D_060076EC = 0x060076EC; +D_060000F0 = 0x060000F0; + +// z_bg_hidan_firewall +D_0600DA80 = 0x0600DA80; + +// z_bg_breakwall +D_02014F80 = 0x02014F80; +D_801333E0 = 0x801333E0; +D_801333D4 = 0x801333D4; +D_801333E8 = 0x801333E8; \ No newline at end of file From 9a87ce3c0462c47ea82c08d890a1863b2f87e004 Mon Sep 17 00:00:00 2001 From: Gamestabled Date: Mon, 6 Apr 2020 02:38:53 -0400 Subject: [PATCH 06/14] firewall OK --- .../actors/z_bg_hidan_firewall.data.s | 12 +- spec | 2 - .../z_bg_hidan_firewall.c | 105 +++++++++--------- .../z_bg_hidan_firewall.h | 17 +-- undefined_syms.txt | 13 --- 5 files changed, 64 insertions(+), 85 deletions(-) diff --git a/data/overlays/actors/z_bg_hidan_firewall.data.s b/data/overlays/actors/z_bg_hidan_firewall.data.s index 1449400411..ff4314b4d1 100644 --- a/data/overlays/actors/z_bg_hidan_firewall.data.s +++ b/data/overlays/actors/z_bg_hidan_firewall.data.s @@ -7,12 +7,12 @@ .section .data -#glabel Bg_Hidan_Firewall_InitVars -# .word 0x000C0100, 0x00000000, 0x002C0000, 0x000001A0 -#.word BgHidanFirewall_Init -#.word BgHidanFirewall_Destroy -#.word BgHidanFirewall_Update -#.word 0x00000000 +glabel Bg_Hidan_Firewall_InitVars + .word 0x000C0100, 0x00000000, 0x002C0000, 0x000001A0 +.word BgHidanFirewall_Init +.word BgHidanFirewall_Destroy +.word BgHidanFirewall_Update +.word 0x00000000 glabel D_80886CD0 .word 0x0A110009, 0x20010000, 0x00000000, 0x20000000, 0x01040000, 0xFFCFFFFF, 0x00000000, 0x19000100, 0x001E0053, 0x00000000, 0x00000000 glabel D_80886CFC diff --git a/spec b/spec index 00c5891b03..ac772e35b1 100644 --- a/spec +++ b/spec @@ -963,8 +963,6 @@ endseg beginseg name "ovl_Bg_Hidan_Firewall" include "build/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.o" - include "build/data/overlays/actors/z_bg_hidan_firewall.data.o" - include "build/data/overlays/actors/z_bg_hidan_firewall.rodata.o" include "build/data/overlays/actors/z_bg_hidan_firewall.reloc.o" endseg diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c index 0b7eb1d580..f6eac5535b 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c @@ -1,42 +1,14 @@ +/* + * File: z_bg_hidan_firewall.c + * Overlay: ovl_Bg_Hidan_Firewall + * Description: Proximity Flame Wall +*/ + #include "z_bg_hidan_firewall.h" #define ROOM 0x00 #define FLAGS 0x00000000 -// static ColliderCylinderInit cylinderInitData = -// { -// 0x0A, 0x11, 0x00, 0x09, -// 0x20, 0x01, 0x00, 0x00, -// 0x00, 0x00, 0x00, 0x00, -// 0x20000000, -// 0x01, 0x04, 0x00, 0x00, -// 0xFFCFFFFF, -// 0x00, 0x00, 0x00, 0x00, -// 0x19, 0x00, 0x01, 0x00, -// 0x001E, -// 0x0053, -// 0x00000000000000000000, -// }; - -// static SubActor98Init actor98InitData = -// { -// 0x01, 0x0050, 0x0064, 0xFF, -// }; - -// u32 D_80886D04[] = { -// 0x06015D20, -// 0x06016120, -// 0x06016520, -// 0x06016920, -// 0x06016D20, -// 0x06017120, -// 0x06017520, -// 0x06017920, -// 0x00000000, -// 0x00000000, -// 0x00000000, -// }; - const ActorInit Bg_Hidan_Firewall_InitVars = { ACTOR_BG_HIDAN_FIREWALL, @@ -51,25 +23,59 @@ const ActorInit Bg_Hidan_Firewall_InitVars = NULL, }; +static ColliderCylinderInit cylinderInitData = +{ + 0x0A, 0x11, 0x00, 0x09, + 0x20, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x20000000, + 0x01, 0x04, 0x00, 0x00, + 0xFFCFFFFF, + 0x00, 0x00, 0x00, 0x00, + 0x19, 0x00, 0x01, 0x00, + 0x001E, + 0x0053, + 0x00000000000000000000, +}; + +static SubActor98Init actor98InitData = +{ + 0x01, 0x0050, 0x0064, 0xFF, +}; + +u32 D_80886D04[] = { + 0x06015D20, + 0x06016120, + 0x06016520, + 0x06016920, + 0x06016D20, + 0x06017120, + 0x06017520, + 0x06017920, + 0x00000000, + 0x00000000, + 0x00000000, +}; + void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx){ f32 scale; - scale = D_80886D84; + scale = 0.119999997318f; this->actor.scale.x = scale; this->actor.scale.z = scale; - scale = D_80886D88; - this->actor.scale.y = D_80886D88; + scale = 0.00999999977648f; + this->actor.scale.y = 0.00999999977648f; this->unk_150 = 0; ActorCollider_AllocCylinder(globalCtx, &this->collider); - ActorCollider_InitCylinder(globalCtx, &this->collider, &this->actor, &D_80886CD0); + ActorCollider_InitCylinder(globalCtx, &this->collider, &this->actor, &cylinderInitData); this->collider.dim.position.y = this->actor.posRot.pos.y; - func_80061ED4(&this->actor.sub_98, NULL, &D_80886CFC); + func_80061ED4(&this->actor.sub_98, NULL, &actor98InitData); this->actionFunc = BgHidanFirewall_Wait; return; @@ -129,7 +135,7 @@ void BgHidanFirewall_Erupt(BgHidanFirewall* this, GlobalContext* globalCtx) Math_ApproxF(&this->actor.scale.y, 0.1f, 0.024999999f); return; } - if (Math_ApproxF(&this->actor.scale.y, D_80886D8C, D_80886D8C) != 0) + if (Math_ApproxF(&this->actor.scale.y, 0.00999999977648f, 0.00999999977648f) != 0) { this->actor.draw = NULL; this->actionFunc = BgHidanFirewall_Wait; @@ -140,7 +146,7 @@ void BgHidanFirewall_Erupt(BgHidanFirewall* this, GlobalContext* globalCtx) } } -void func_80886898(BgHidanFirewall* this, GlobalContext* globalCtx) +void BgHidanFirewall_Collide(BgHidanFirewall* this, GlobalContext* globalCtx) { s16 phi_a3; @@ -155,7 +161,7 @@ void func_80886898(BgHidanFirewall* this, GlobalContext* globalCtx) func_8002F71C(globalCtx, this, 5.0f, phi_a3, 1.0f); } -void func_808868FC(BgHidanFirewall* this, GlobalContext* globalCtx) +void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, GlobalContext* globalCtx) { Player* player; Vec3f sp30; @@ -201,8 +207,8 @@ void func_808868FC(BgHidanFirewall* this, GlobalContext* globalCtx) } sp28 = Math_Sins(this->actor.shape.rot.y); temp_ret = Math_Coss(this->actor.shape.rot.y); - this->collider.dim.position.x = ((this->actor.posRot.pos.x + (sp30.x * temp_ret)) + (sp30.z * sp28)); - this->collider.dim.position.z = ((this->actor.posRot.pos.z - (sp30.x * sp28)) + (sp30.z * temp_ret)); + this->collider.dim.position.x = this->actor.posRot.pos.x + sp30.x * temp_ret + sp30.z * sp28; + this->collider.dim.position.z = this->actor.posRot.pos.z - sp30.x * sp28 + sp30.z * temp_ret; } void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx) @@ -215,13 +221,13 @@ void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx) if (this->collider.base.colliderFlags & 2) { this->collider.base.colliderFlags &= ~2; - func_80886898(this, globalCtx); + BgHidanFirewall_Collide(this, globalCtx); } this->actionFunc(this, globalCtx); if (this->actionFunc == BgHidanFirewall_Erupt) { - func_808868FC(this, globalCtx); + BgHidanFirewall_ColliderFollowPlayer(this, globalCtx); Actor_CollisionCheck_SetAT(globalCtx, &globalCtx->sub_11E60, &this->collider); Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider); func_8002F974(&this->actor, 0x2034); @@ -239,7 +245,7 @@ void BgHidanFirewall_Draw(BgHidanFirewall* this, GlobalContext* globalCtx) gfxCtx = globalCtx->state.gfxCtx; - func_800C6AC4(&gfx, globalCtx->state.gfxCtx, &D_80886D30, 0x1C0); + func_800C6AC4(&gfx, globalCtx->state.gfxCtx, "../z_bg_hidan_firewall.c", 0x1C0); gfxCtx->polyXlu.p = func_80093774(gfxCtx->polyXlu.p, 0x14); temp = &D_80886D04; @@ -247,9 +253,8 @@ void BgHidanFirewall_Draw(BgHidanFirewall* this, GlobalContext* globalCtx) gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(temp[this->unk_150])); gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0x01, 0xFF, 0xFF, 0x00, 0x96); gDPSetEnvColor(gfxCtx->polyXlu.p++, 0xFF, 0x00, 0x00, 0xFF); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, &D_80886D4C, 0x1CA), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_hidan_firewall.c", 0x1CA), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gfxCtx->polyXlu.p++, &D_0600DA80); - - func_800C6B54(&gfx, globalCtx->state.gfxCtx, &D_80886D68, 0x1CF); + func_800C6B54(&gfx, globalCtx->state.gfxCtx, "../z_bg_hidan_firewall.c", 0x1CF); } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h index d67ffbc8a3..48f490f260 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h @@ -11,33 +11,22 @@ typedef void FirewallFunc(struct BgHidanFirewall* this, GlobalContext* globalCtx typedef struct BgHidanFirewall { /* 0x0000 */ Actor actor; - /* 0x014C */ FirewallFunc* actionFunc; // idle, countdown, etc + /* 0x014C */ FirewallFunc* actionFunc; /* 0x0150 */ s16 unk_150; /* 0x0154 */ ColliderCylinderMain collider; } BgHidanFirewall; // size = 0x01A0 -extern const ActorInit Bg_Hidan_Firewall_InitVars; - void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Destroy(BgHidanFirewall* this, GlobalContext* globalCtx); s32 BgHidanFirewall_Proximity(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Wait(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Countdown(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Erupt(BgHidanFirewall* this, GlobalContext* globalCtx); -void func_80886898(BgHidanFirewall* this, GlobalContext* globalCtx); -void func_808868FC(BgHidanFirewall* this, GlobalContext* globalCtx); +void BgHidanFirewall_Collide(BgHidanFirewall* this, GlobalContext* globalCtx); +void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Draw(BgHidanFirewall* this, GlobalContext* globalCtx); -extern ColliderCylinderMain D_80886CD0; -extern SubActor98Init D_80886CFC; -extern u32 D_80886D04[11]; -extern f32 D_80886D84; -extern f32 D_80886D88; -extern float D_80886D8C; extern u32 D_0600DA80; -extern char D_80886D30; -extern char* D_80886D4C; -extern char* D_80886D68; #endif diff --git a/undefined_syms.txt b/undefined_syms.txt index 4568e85fdd..85597f291b 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -392,18 +392,5 @@ D_0600A054 = 0x0600A054; D_06008688 = 0x06008688; D_04049210 = 0x04049210; -// z_en_ani -D_060067B8 = 0x060067B8; -D_060070F0 = 0x060070F0; -D_8002B5EC = 0x8002B5EC; -D_060076EC = 0x060076EC; -D_060000F0 = 0x060000F0; - // z_bg_hidan_firewall D_0600DA80 = 0x0600DA80; - -// z_bg_breakwall -D_02014F80 = 0x02014F80; -D_801333E0 = 0x801333E0; -D_801333D4 = 0x801333D4; -D_801333E8 = 0x801333E8; \ No newline at end of file From 553329a9e6808442bfa3d71b84a074c4c08a3c4c Mon Sep 17 00:00:00 2001 From: chandler Date: Mon, 6 Apr 2020 03:15:25 -0400 Subject: [PATCH 07/14] reverting en_ani to PR firewall (im a git noob) --- src/overlays/actors/ovl_En_Ani/z_en_ani.c | 168 ++-------------------- src/overlays/actors/ovl_En_Ani/z_en_ani.h | 29 +--- 2 files changed, 16 insertions(+), 181 deletions(-) diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c index eb8ddffcf8..a71924b895 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -1,12 +1,15 @@ #include "z_en_ani.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 +void EnAni_Init(EnAni* this, GlobalContext* globalCtx); +void EnAni_Destroy(EnAni* this, GlobalContext* globalCtx); +void EnAni_Update(EnAni* this, GlobalContext* globalCtx); +void EnAni_Draw(EnAni* this, GlobalContext* globalCtx); /* -const ActorInit En_Ani_InitVars = -{ +const ActorInit En_Ani_InitVars = { ACTOR_EN_ANI, ACTORTYPE_NPC, ROOM, @@ -19,181 +22,38 @@ const ActorInit En_Ani_InitVars = (ActorFunc)EnAni_Draw, }; */ - -//EnAni_SetupAction -void func_809B0370(EnAni* this, ActorFunc actionFunc) -{ - this->actionFunc = actionFunc; -} +#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B0370.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/EnAni_Init.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/EnAni_Destroy.s") -s32 func_809B04B4(EnAni* this, GlobalContext* globalCtx, u16 arg2) -{ - this->actor.textId = arg2; - this->unk_2A8 = (this->unk_2A8 | 1); - func_8002F2CC(&this->actor, globalCtx, 100.0f); - return 0; -} +#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B04B4.s") -void func_809B04F0(EnAni* this, GlobalContext* globalCtx) -{ - if (func_8002F334(&this->actor, globalCtx) != 0) - { - func_809B0370(this, func_809B064C); - } -} +#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B04F0.s") -void func_809B0524(EnAni* this, GlobalContext* globalCtx) -{ - if (func_8002F334(&this->actor, globalCtx) != 0) - { - func_809B0370(this, func_809B07F8); - } -} +#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B0524.s") -void func_809B0558(EnAni* this, GlobalContext* globalCtx) -{ - if (func_8002F410(&this->actor, globalCtx) != 0) - { - this->actor.attachedA = 0; - if (LINK_IS_CHILD) - { - func_809B0370(this, func_809B04F0); - } - else - { - func_809B0370(this, func_809B0524); - } - gSaveContext.item_get_inf[1] = gSaveContext.item_get_inf[1] | 0x20; - return; - } - func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 200.0f); -} +#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B0558.s") -void func_809B05F0(EnAni* this, GlobalContext* globalCtx) -{ - if (func_8002F334(this, globalCtx) != 0) - { - func_809B0370(this, func_809B0558); - } - func_8002F434(this, globalCtx, GI_HEART_PIECE, 10000.0f, 200.0f); -} +#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B05F0.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B064C.s") -// void func_809B064C(EnAni* this, GlobalContext* globalCtx) -// { -// u16 phi_a2; -// s16 temp_v1; -// s32 temp_ret; - -// temp_ret = func_8006C360(globalCtx, 0xA); -// phi_a2 = temp_ret & 0xffff; - -// if (temp_ret == 0) -// { -// phi_a2 = 0x5050U; -// if (gSaveContext.night_flag != 0) -// { -// phi_a2 = 0x5051U; -// } -// } - -// temp_v1 = (this->actor.rotTowardsLinkY - this->actor.shape.rot.y); -// if (func_8002F194(&this->actor, globalCtx) != 0) -// { -// if (this->actor.textId == 0x5056) // "To get a good view..." -// { -// func_809B0370(this, func_809B04F0); -// return; -// } -// if (this->actor.textId == 0x5055) // "...I'll give you this as a memento." -// { - -// func_809B0370(this, func_809B05F0); -// return; -// } -// func_809B0370(this, func_809B04F0); -// return; -// } -// if (temp_v1 >= -0x36AF) -// { -// if (temp_v1 < 0) -// { -// if (this->actor.xzDistanceFromLink < 150.0f) -// { -// if (-80.0f < this->actor.yDistanceFromLink) -// { -// if ((gSaveContext.item_get_inf[1] & 0x20) == 0) -// { -// func_809B04B4(this, globalCtx, 0x5056); // "To get a good view..." -// return; -// } -// func_809B04B4(this, globalCtx, 0x5055); // "...I'll give you this as a memento." -// return; -// } -// } -// } -// } -// if (temp_v1 >= -0x3e7) -// { -// if (temp_v1 < 0x36b0) -// { -// if (this->actor.xzDistanceFromLink < 350.0f) -// { -// func_809B04B4(this, globalCtx, phi_a2); -// } -// } -// } -// } THIS IS SUPER CLOSE #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B07F8.s") -void func_809B0988(EnAni* this, GlobalContext* globalCtx) { } +#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B0988.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B0994.s") -// void func_809B0994(EnAni* this, GlobalContext* globalCtx) -// { -// if (globalCtx->csCtx.actorActions[0]->action == 4) -// { -// SkelAnime_ChangeAnimation(&this->skelAnime, 0x60070F0, 1.0f, 0.0f, (f32) SkelAnime_GetFrameCount(0x60070F0), 2, -4.0f); -// this->actor.shape.shadowDrawFunc = 0x8003B5EC; -// this->unk_2AA += 1; -// } -// } -void func_809B0A28(EnAni* this, GlobalContext* globalCtx) -{ - if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) - { - this->unk_2AA += 1; - } -} +#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B0A28.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B0A6C.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/EnAni_Update.s") #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B0D90.s") -// ? func_809B0D90(s32 arg0, s32 arg1, ? arg2, ? arg3, void *arg4, void *arg5) -// { -// if (arg1 == 0xf) -// { -// arg4->unk0 = (s16) (arg4->unk0 + arg5->unk29E); -// arg4->unk4 = (s16) (arg4->unk4 + arg5->unk29C); -// } -// return 0; -// } #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/func_809B0DD4.s") -// void func_809B0DD4(s32 arg0, Actor* arg1, ? arg2, ? arg3) -// { -// if (arg1 == 0xf) -// { -// Matrix_MultVec3f(&D_809B0F74, &arg1->posRot2.pos); -// } -// } #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Ani/EnAni_Draw.s") diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.h b/src/overlays/actors/ovl_En_Ani/z_en_ani.h index 1b7bd4226f..45b7e37208 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.h +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.h @@ -4,36 +4,11 @@ #include #include -typedef struct -{ +typedef struct { /* 0x0000 */ Actor actor; - /* 0x014C */ char unk_14C[0x4C]; - /* 0x0198 */ SkelAnime skelAnime; - /* 0x01D8 */ char unk_19C[0xD0]; - /* 0x02A8 */ u16 unk_2A8; - /* 0x02AA */ u16 unk_2AA; - /* 0x02AC */ char unk_2AC[0x4]; - /* 0x02B0 */ ActorFunc actionFunc; + /* 0x014C */ char unk_14C[0x168]; } EnAni; // size = 0x02B4 extern const ActorInit En_Ani_InitVars; -void func_809B0370(EnAni* this, ActorFunc actionFunc); -void EnAni_Init(EnAni* this, GlobalContext* globalCtx); -void EnAni_Destroy(EnAni* this, GlobalContext* globalCtx); -s32 func_809B04B4(EnAni* this, GlobalContext* globalCtx, u16 arg2); -void func_809B04F0(EnAni* this, GlobalContext* globalCtx); -void func_809B0524(EnAni* this, GlobalContext* globalCtx); -void func_809B0558(EnAni* this, GlobalContext* globalCtx); -void func_809B05F0(EnAni* this, GlobalContext* globalCtx); -void func_809B064C(EnAni* this, GlobalContext* globalCtx); -void func_809B07F8(EnAni* this, GlobalContext* globalCtx); -void func_809B0988(EnAni* this, GlobalContext* globalCtx); - - - -void EnAni_Update(EnAni* this, GlobalContext* globalCtx); -void EnAni_Draw(EnAni* this, GlobalContext* globalCtx); - - #endif From 78c65878ed809282cb1923419ee30d78323368d2 Mon Sep 17 00:00:00 2001 From: chandler Date: Mon, 6 Apr 2020 03:19:13 -0400 Subject: [PATCH 08/14] more fixing PR --- src/overlays/actors/ovl_En_Ani/z_en_ani.c | 5 +++-- src/overlays/actors/ovl_En_Ani/z_en_ani.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c index a71924b895..bf0cc6b585 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -1,6 +1,6 @@ #include "z_en_ani.h" -#define ROOM 0x00 +#define ROOM 0x00 #define FLAGS 0x00000009 void EnAni_Init(EnAni* this, GlobalContext* globalCtx); @@ -9,7 +9,8 @@ void EnAni_Update(EnAni* this, GlobalContext* globalCtx); void EnAni_Draw(EnAni* this, GlobalContext* globalCtx); /* -const ActorInit En_Ani_InitVars = { +const ActorInit En_Ani_InitVars = +{ ACTOR_EN_ANI, ACTORTYPE_NPC, ROOM, diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.h b/src/overlays/actors/ovl_En_Ani/z_en_ani.h index 45b7e37208..05b739e3d5 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.h +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.h @@ -4,7 +4,8 @@ #include #include -typedef struct { +typedef struct +{ /* 0x0000 */ Actor actor; /* 0x014C */ char unk_14C[0x168]; } EnAni; // size = 0x02B4 From 9864211cdcbd3af44b639fccfaee1a9dd9c3f772 Mon Sep 17 00:00:00 2001 From: chandler Date: Mon, 6 Apr 2020 16:41:05 -0400 Subject: [PATCH 09/14] made suggesed changes --- spec | 2 +- .../z_bg_hidan_firewall.c | 175 +++++++----------- .../z_bg_hidan_firewall.h | 17 +- 3 files changed, 74 insertions(+), 120 deletions(-) diff --git a/spec b/spec index 0ef4b9723d..b2114edd79 100644 --- a/spec +++ b/spec @@ -930,7 +930,7 @@ endseg beginseg name "ovl_Bg_Hidan_Firewall" include "build/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.o" - include "build/data/overlays/actors/z_bg_hidan_firewall.reloc.o" + include "build/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall_reloc.o" endseg beginseg diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c index b211245cb0..41a614b088 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c @@ -2,15 +2,27 @@ * File: z_bg_hidan_firewall.c * Overlay: ovl_Bg_Hidan_Firewall * Description: Proximity Flame Wall -*/ + */ #include "z_bg_hidan_firewall.h" #define ROOM 0x00 #define FLAGS 0x00000000 -const ActorInit Bg_Hidan_Firewall_InitVars = -{ +void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx); +void BgHidanFirewall_Destroy(BgHidanFirewall* this, GlobalContext* globalCtx); +s32 BgHidanFirewall_Proximity(BgHidanFirewall* this, GlobalContext* globalCtx); +void BgHidanFirewall_Wait(BgHidanFirewall* this, GlobalContext* globalCtx); +void BgHidanFirewall_Countdown(BgHidanFirewall* this, GlobalContext* globalCtx); +void BgHidanFirewall_Erupt(BgHidanFirewall* this, GlobalContext* globalCtx); +void BgHidanFirewall_Collide(BgHidanFirewall* this, GlobalContext* globalCtx); +void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, GlobalContext* globalCtx); +void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx); +void BgHidanFirewall_Draw(BgHidanFirewall* this, GlobalContext* globalCtx); + +extern Gfx D_0600DA80; + +const ActorInit Bg_Hidan_Firewall_InitVars = { ACTOR_BG_HIDAN_FIREWALL, ACTORTYPE_BG, ROOM, @@ -23,27 +35,24 @@ const ActorInit Bg_Hidan_Firewall_InitVars = NULL, }; -static ColliderCylinderInit cylinderInitData = -{ +static ColliderCylinderInit cylinderInitData = { 0x0A, 0x11, 0x00, 0x09, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20000000, 0x01, 0x04, 0x00, 0x00, 0xFFCFFFFF, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x01, 0x00, - 0x001E, - 0x0053, + 0x001E, 0x0053, 0x00000000000000000000, }; -static SubActor98Init actor98InitData = -{ +static Sub98Init4 actor98InitData = { 0x01, 0x0050, 0x0064, 0xFF, }; -u32 D_80886D04[] = { +UNK_PTR D_80886D04[] = { 0x06015D20, 0x06016120, 0x06016520, @@ -51,16 +60,13 @@ u32 D_80886D04[] = { 0x06016D20, 0x06017120, 0x06017520, - 0x06017920, - 0x00000000, - 0x00000000, - 0x00000000, + 0x06017920, }; -void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx){ - +void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx) { + f32 scale; - + scale = 0.119999997318f; this->actor.scale.x = scale; this->actor.scale.z = scale; @@ -76,93 +82,73 @@ void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx){ this->collider.dim.position.y = this->actor.posRot.pos.y; func_80061ED4(&this->actor.sub_98, NULL, &actor98InitData); - - this->actionFunc = BgHidanFirewall_Wait; - return; + + this->actionFunc = (ActorFunc)BgHidanFirewall_Wait; } -void BgHidanFirewall_Destroy(BgHidanFirewall* this, GlobalContext* globalCtx) -{ +void BgHidanFirewall_Destroy(BgHidanFirewall* this, GlobalContext* globalCtx) { BgHidanFirewall* thing = this; ActorCollider_FreeCylinder(globalCtx, &this->collider); } -s32 BgHidanFirewall_Proximity(BgHidanFirewall* this, GlobalContext* globalCtx) -{ +s32 BgHidanFirewall_Proximity(BgHidanFirewall* this, GlobalContext* globalCtx) { Player* player; Vec3f distance; - + player = PLAYER; func_8002DBD0(&this->actor, &distance, &player->actor.posRot.pos); - if (fabsf(distance.x) < 100.0f) - { - if (fabsf(distance.z) < 120.0f) - { + if (fabsf(distance.x) < 100.0f) { + if (fabsf(distance.z) < 120.0f) { return 1; } } return 0; } -void BgHidanFirewall_Wait(BgHidanFirewall* this, GlobalContext* globalCtx) -{ - if (BgHidanFirewall_Proximity(this, globalCtx) != 0) - { +void BgHidanFirewall_Wait(BgHidanFirewall* this, GlobalContext* globalCtx) { + if (BgHidanFirewall_Proximity(this, globalCtx) != 0) { this->actor.draw = BgHidanFirewall_Draw; this->actor.params = 5; - this->actionFunc = BgHidanFirewall_Countdown; + this->actionFunc = (ActorFunc)BgHidanFirewall_Countdown; } } -void BgHidanFirewall_Countdown(BgHidanFirewall* this, GlobalContext* globalCtx) -{ +void BgHidanFirewall_Countdown(BgHidanFirewall* this, GlobalContext* globalCtx) { - if (this->actor.params != 0) - { + if (this->actor.params != 0) { this->actor.params--; } - if (this->actor.params == 0) - { - this->actionFunc = BgHidanFirewall_Erupt; + if (this->actor.params == 0) { + this->actionFunc = (ActorFunc)BgHidanFirewall_Erupt; } } -void BgHidanFirewall_Erupt(BgHidanFirewall* this, GlobalContext* globalCtx) -{ - if (BgHidanFirewall_Proximity(this, globalCtx) != 0) - { +void BgHidanFirewall_Erupt(BgHidanFirewall* this, GlobalContext* globalCtx) { + if (BgHidanFirewall_Proximity(this, globalCtx) != 0) { Math_ApproxF(&this->actor.scale.y, 0.1f, 0.024999999f); - return; - } - if (Math_ApproxF(&this->actor.scale.y, 0.00999999977648f, 0.00999999977648f) != 0) - { - this->actor.draw = NULL; - this->actionFunc = BgHidanFirewall_Wait; - } - else - { - this->actor.params = 0; + } else { + if (Math_ApproxF(&this->actor.scale.y, 0.00999999977648f, 0.00999999977648f) != 0) { + this->actor.draw = NULL; + this->actionFunc = (ActorFunc)BgHidanFirewall_Wait; + } else { + this->actor.params = 0; + } } } -void BgHidanFirewall_Collide(BgHidanFirewall* this, GlobalContext* globalCtx) -{ +void BgHidanFirewall_Collide(BgHidanFirewall* this, GlobalContext* globalCtx) { s16 phi_a3; - if (func_8002E084(&this->actor, 0x4000) != 0) - { + if (func_8002E084(&this->actor, 0x4000) != 0) { phi_a3 = this->actor.shape.rot.y; - } - else - { + } else { phi_a3 = this->actor.shape.rot.y + 0x8000; } func_8002F71C(globalCtx, this, 5.0f, phi_a3, 1.0f); } -void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, GlobalContext* globalCtx) -{ +void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, GlobalContext* globalCtx) { Player* player; Vec3f sp30; f32 temp_ret; @@ -171,62 +157,47 @@ void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, GlobalContext* player = PLAYER; - func_8002DBD0(&this->actor, &sp30, &player->actor.posRot.pos); - if (sp30.x < -70.0f) - { + func_8002DBD0(&this->actor, &sp30, &player->actor.posRot.pos); + if (sp30.x < -70.0f) { sp30.x = -70.0f; - } - else - { - if (70.0f < sp30.x) - { + } else { + if (70.0f < sp30.x) { phi_f0 = 70.0f; - } - else - { + } else { phi_f0 = sp30.x; } sp30.x = phi_f0; } - if (this->actor.params == 0) - { - if (0.0f < sp30.z) - { + if (this->actor.params == 0) { + if (0.0f < sp30.z) { sp30.z = -25.0f; this->actor.params = -1; - } - else - { + } else { sp30.z = 25.0f; this->actor.params = 1; } - } - else - { + } else { sp30.z = this->actor.params * 25.0f; } - sp28 = Math_Sins(this->actor.shape.rot.y); + sp28 = Math_Sins(this->actor.shape.rot.y); temp_ret = Math_Coss(this->actor.shape.rot.y); this->collider.dim.position.x = this->actor.posRot.pos.x + sp30.x * temp_ret + sp30.z * sp28; this->collider.dim.position.z = this->actor.posRot.pos.z - sp30.x * sp28 + sp30.z * temp_ret; } -void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx) -{ +void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx) { s32 pad1; s32 pad2; this->unk_150 = (this->unk_150 + 1) % 8; - if (this->collider.base.colliderFlags & 2) - { + if (this->collider.base.colliderFlags & 2) { this->collider.base.colliderFlags &= ~2; BgHidanFirewall_Collide(this, globalCtx); } this->actionFunc(this, globalCtx); - if (this->actionFunc == BgHidanFirewall_Erupt) - { + if (this->actionFunc == (ActorFunc)BgHidanFirewall_Erupt) { BgHidanFirewall_ColliderFollowPlayer(this, globalCtx); Actor_CollisionCheck_SetAT(globalCtx, &globalCtx->sub_11E60, &this->collider); Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider); @@ -234,27 +205,25 @@ void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx) } } -void BgHidanFirewall_Draw(BgHidanFirewall* this, GlobalContext* globalCtx) -{ - u32* temp; +void BgHidanFirewall_Draw(BgHidanFirewall* this, GlobalContext* globalCtx) { + UNK_PTR* temp; u32 pad; GraphicsContext* gfxCtx; - u32 pad1; - u32 pad2; - Gfx* gfx; + Gfx* dispRefs[3]; gfxCtx = globalCtx->state.gfxCtx; - func_800C6AC4(&gfx, globalCtx->state.gfxCtx, "../z_bg_hidan_firewall.c", 0x1C0); - gfxCtx->polyXlu.p = func_80093774(gfxCtx->polyXlu.p, 0x14); + Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_hidan_firewall.c", 448); + gfxCtx->polyXlu.p = Gfx_CallSetupDL(gfxCtx->polyXlu.p, 0x14); temp = &D_80886D04; gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(temp[this->unk_150])); gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0x01, 0xFF, 0xFF, 0x00, 0x96); gDPSetEnvColor(gfxCtx->polyXlu.p++, 0xFF, 0x00, 0x00, 0xFF); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_hidan_firewall.c", 0x1CA), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_hidan_firewall.c", 458), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gfxCtx->polyXlu.p++, &D_0600DA80); - func_800C6B54(&gfx, globalCtx->state.gfxCtx, "../z_bg_hidan_firewall.c", 0x1CF); + Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_hidan_firewall.c", 463); } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h index 48f490f260..588345099a 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h @@ -6,27 +6,12 @@ struct BgHidanFirewall; -typedef void FirewallFunc(struct BgHidanFirewall* this, GlobalContext* globalCtx); - typedef struct BgHidanFirewall { /* 0x0000 */ Actor actor; - /* 0x014C */ FirewallFunc* actionFunc; + /* 0x014C */ ActorFunc actionFunc; /* 0x0150 */ s16 unk_150; /* 0x0154 */ ColliderCylinderMain collider; } BgHidanFirewall; // size = 0x01A0 -void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx); -void BgHidanFirewall_Destroy(BgHidanFirewall* this, GlobalContext* globalCtx); -s32 BgHidanFirewall_Proximity(BgHidanFirewall* this, GlobalContext* globalCtx); -void BgHidanFirewall_Wait(BgHidanFirewall* this, GlobalContext* globalCtx); -void BgHidanFirewall_Countdown(BgHidanFirewall* this, GlobalContext* globalCtx); -void BgHidanFirewall_Erupt(BgHidanFirewall* this, GlobalContext* globalCtx); -void BgHidanFirewall_Collide(BgHidanFirewall* this, GlobalContext* globalCtx); -void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, GlobalContext* globalCtx); -void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx); -void BgHidanFirewall_Draw(BgHidanFirewall* this, GlobalContext* globalCtx); - -extern u32 D_0600DA80; - #endif From bd23567bfd28c7d648dd9393c03b80c956d6ccc6 Mon Sep 17 00:00:00 2001 From: chandler Date: Mon, 6 Apr 2020 17:08:24 -0400 Subject: [PATCH 10/14] a couple more suggestions --- .../ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c index 41a614b088..c13b575a00 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c @@ -67,12 +67,12 @@ void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx) { f32 scale; - scale = 0.119999997318f; + scale = 0.12f; this->actor.scale.x = scale; this->actor.scale.z = scale; - scale = 0.00999999977648f; - this->actor.scale.y = 0.00999999977648f; + scale = 0.01f; + this->actor.scale.y = 0.01f; this->unk_150 = 0; @@ -98,10 +98,8 @@ s32 BgHidanFirewall_Proximity(BgHidanFirewall* this, GlobalContext* globalCtx) { player = PLAYER; func_8002DBD0(&this->actor, &distance, &player->actor.posRot.pos); - if (fabsf(distance.x) < 100.0f) { - if (fabsf(distance.z) < 120.0f) { - return 1; - } + if (fabsf(distance.x) < 100.0f && fabsf(distance.z) < 120.0f) { + return 1; } return 0; } @@ -128,7 +126,7 @@ void BgHidanFirewall_Erupt(BgHidanFirewall* this, GlobalContext* globalCtx) { if (BgHidanFirewall_Proximity(this, globalCtx) != 0) { Math_ApproxF(&this->actor.scale.y, 0.1f, 0.024999999f); } else { - if (Math_ApproxF(&this->actor.scale.y, 0.00999999977648f, 0.00999999977648f) != 0) { + if (Math_ApproxF(&this->actor.scale.y, 0.01f, 0.01f) != 0) { this->actor.draw = NULL; this->actionFunc = (ActorFunc)BgHidanFirewall_Wait; } else { From 83caab6e680f952965b8fd39fa4ac8ad5799589d Mon Sep 17 00:00:00 2001 From: chandler Date: Mon, 6 Apr 2020 17:31:24 -0400 Subject: [PATCH 11/14] simplified a float --- src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c index c13b575a00..96196356b7 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c @@ -124,7 +124,7 @@ void BgHidanFirewall_Countdown(BgHidanFirewall* this, GlobalContext* globalCtx) void BgHidanFirewall_Erupt(BgHidanFirewall* this, GlobalContext* globalCtx) { if (BgHidanFirewall_Proximity(this, globalCtx) != 0) { - Math_ApproxF(&this->actor.scale.y, 0.1f, 0.024999999f); + Math_ApproxF(&this->actor.scale.y, 0.1f, 0.01f/0.4f); } else { if (Math_ApproxF(&this->actor.scale.y, 0.01f, 0.01f) != 0) { this->actor.draw = NULL; From 5c5fa61d4e83bc2a9815dcb765345d51b0d60f00 Mon Sep 17 00:00:00 2001 From: dark-samus Date: Mon, 6 Apr 2020 12:39:17 -0400 Subject: [PATCH 12/14] fix 3 non-matchings in z_demo.c --- asm/non_matchings/code/z_demo/func_800645A0.s | 111 ---- asm/non_matchings/code/z_demo/func_80064824.s | 577 ------------------ asm/non_matchings/code/z_demo/func_80065134.s | 45 -- src/code/z_demo.c | 32 +- 4 files changed, 10 insertions(+), 755 deletions(-) delete mode 100644 asm/non_matchings/code/z_demo/func_800645A0.s delete mode 100644 asm/non_matchings/code/z_demo/func_80064824.s delete mode 100644 asm/non_matchings/code/z_demo/func_80065134.s diff --git a/asm/non_matchings/code/z_demo/func_800645A0.s b/asm/non_matchings/code/z_demo/func_800645A0.s deleted file mode 100644 index 46d11eacc1..0000000000 --- a/asm/non_matchings/code/z_demo/func_800645A0.s +++ /dev/null @@ -1,111 +0,0 @@ -.rdata -glabel D_8013AE68 - .asciz "\nデモ開始要求 発令!" - .balign 4 - -.text -glabel func_800645A0 -/* ADB740 800645A0 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* ADB744 800645A4 AFBF0014 */ sw $ra, 0x14($sp) -/* ADB748 800645A8 948E0020 */ lhu $t6, 0x20($a0) -/* ADB74C 800645AC 2401FDFF */ li $at, -513 -/* ADB750 800645B0 00803025 */ move $a2, $a0 -/* ADB754 800645B4 01C17827 */ nor $t7, $t6, $at -/* ADB758 800645B8 55E00010 */ bnezl $t7, .L800645FC -/* ADB75C 800645BC 94C90020 */ lhu $t1, 0x20($a2) -/* ADB760 800645C0 90B80008 */ lbu $t8, 8($a1) -/* ADB764 800645C4 3C038016 */ lui $v1, %hi(gSaveContext) # $v1, 0x8016 -/* ADB768 800645C8 2463E660 */ addiu $v1, %lo(gSaveContext) # addiu $v1, $v1, -0x19a0 -/* ADB76C 800645CC 5700000B */ bnezl $t8, .L800645FC -/* ADB770 800645D0 94C90020 */ lhu $t1, 0x20($a2) -/* ADB774 800645D4 8C791360 */ lw $t9, 0x1360($v1) -/* ADB778 800645D8 24070001 */ li $a3, 1 -/* ADB77C 800645DC 3408FFFD */ li $t0, 65533 -/* ADB780 800645E0 2B210004 */ slti $at, $t9, 4 -/* ADB784 800645E4 14200004 */ bnez $at, .L800645F8 -/* ADB788 800645E8 3C018016 */ lui $at, %hi(D_8015FCC8) # $at, 0x8016 -/* ADB78C 800645EC A020FCC8 */ sb $zero, %lo(D_8015FCC8)($at) -/* ADB790 800645F0 AC680008 */ sw $t0, 8($v1) -/* ADB794 800645F4 A0671414 */ sb $a3, 0x1414($v1) -.L800645F8: -/* ADB798 800645F8 94C90020 */ lhu $t1, 0x20($a2) -.L800645FC: -/* ADB79C 800645FC 2401F7FF */ li $at, -2049 -/* ADB7A0 80064600 3C038016 */ lui $v1, %hi(gSaveContext) # $v1, 0x8016 -/* ADB7A4 80064604 01215027 */ nor $t2, $t1, $at -/* ADB7A8 80064608 2463E660 */ addiu $v1, %lo(gSaveContext) # addiu $v1, $v1, -0x19a0 -/* ADB7AC 8006460C 15400011 */ bnez $t2, .L80064654 -/* ADB7B0 80064610 24070001 */ li $a3, 1 -/* ADB7B4 80064614 90AB0008 */ lbu $t3, 8($a1) -/* ADB7B8 80064618 5560000F */ bnezl $t3, .L80064658 -/* ADB7BC 8006461C 90621414 */ lbu $v0, 0x1414($v1) -/* ADB7C0 80064620 8C6C1360 */ lw $t4, 0x1360($v1) -/* ADB7C4 80064624 3C0D8012 */ lui $t5, %hi(D_8011D394) # $t5, 0x8012 -/* ADB7C8 80064628 29810004 */ slti $at, $t4, 4 -/* ADB7CC 8006462C 5420000A */ bnezl $at, .L80064658 -/* ADB7D0 80064630 90621414 */ lbu $v0, 0x1414($v1) -/* ADB7D4 80064634 8DADD394 */ lw $t5, %lo(D_8011D394)($t5) -/* ADB7D8 80064638 3C018016 */ lui $at, %hi(D_8015FCC8) # $at, 0x8016 -/* ADB7DC 8006463C 340EFFFD */ li $t6, 65533 -/* ADB7E0 80064640 55A00005 */ bnezl $t5, .L80064658 -/* ADB7E4 80064644 90621414 */ lbu $v0, 0x1414($v1) -/* ADB7E8 80064648 A027FCC8 */ sb $a3, %lo(D_8015FCC8)($at) -/* ADB7EC 8006464C AC6E0008 */ sw $t6, 8($v1) -/* ADB7F0 80064650 A0671414 */ sb $a3, 0x1414($v1) -.L80064654: -/* ADB7F4 80064654 90621414 */ lbu $v0, 0x1414($v1) -.L80064658: -/* ADB7F8 80064658 3C0F0001 */ lui $t7, 1 -/* ADB7FC 8006465C 01E67821 */ addu $t7, $t7, $a2 -/* ADB800 80064660 10400007 */ beqz $v0, .L80064680 -/* ADB804 80064664 00000000 */ nop -/* ADB808 80064668 81EF1E15 */ lb $t7, 0x1e15($t7) -/* ADB80C 8006466C 24010014 */ li $at, 20 -/* ADB810 80064670 15E10003 */ bne $t7, $at, .L80064680 -/* ADB814 80064674 00000000 */ nop -/* ADB818 80064678 A0601414 */ sb $zero, 0x1414($v1) -/* ADB81C 8006467C 300200FF */ andi $v0, $zero, 0xff -.L80064680: -/* ADB820 80064680 50400012 */ beql $v0, $zero, .L800646CC -/* ADB824 80064684 8C680008 */ lw $t0, 8($v1) -/* ADB828 80064688 90B80008 */ lbu $t8, 8($a1) -/* ADB82C 8006468C 3C048014 */ lui $a0, %hi(D_8013AE68) # $a0, 0x8014 -/* ADB830 80064690 2484AE68 */ addiu $a0, %lo(D_8013AE68) # addiu $a0, $a0, -0x5198 -/* ADB834 80064694 5700000D */ bnezl $t8, .L800646CC -/* ADB838 80064698 8C680008 */ lw $t0, 8($v1) -/* ADB83C 8006469C AFA5001C */ sw $a1, 0x1c($sp) -/* ADB840 800646A0 0C00084C */ jal osSyncPrintf -/* ADB844 800646A4 AFA60018 */ sw $a2, 0x18($sp) -/* ADB848 800646A8 3C038016 */ lui $v1, %hi(gSaveContext) # $v1, 0x8016 -/* ADB84C 800646AC 2463E660 */ addiu $v1, %lo(gSaveContext) # addiu $v1, $v1, -0x19a0 -/* ADB850 800646B0 24070001 */ li $a3, 1 -/* ADB854 800646B4 3419FFFD */ li $t9, 65533 -/* ADB858 800646B8 8FA5001C */ lw $a1, 0x1c($sp) -/* ADB85C 800646BC 8FA60018 */ lw $a2, 0x18($sp) -/* ADB860 800646C0 AC790008 */ sw $t9, 8($v1) -/* ADB864 800646C4 A0671414 */ sb $a3, 0x1414($v1) -/* ADB868 800646C8 8C680008 */ lw $t0, 8($v1) -.L800646CC: -/* ADB86C 800646CC 3401FFF0 */ li $at, 65520 -/* ADB870 800646D0 00C02025 */ move $a0, $a2 -/* ADB874 800646D4 0101082A */ slt $at, $t0, $at -/* ADB878 800646D8 5420000E */ bnezl $at, .L80064714 -/* ADB87C 800646DC 8FBF0014 */ lw $ra, 0x14($sp) -/* ADB880 800646E0 AFA5001C */ sw $a1, 0x1c($sp) -/* ADB884 800646E4 0C01A3B3 */ jal func_80068ECC -/* ADB888 800646E8 AFA60018 */ sw $a2, 0x18($sp) -/* ADB88C 800646EC 8FA5001C */ lw $a1, 0x1c($sp) -/* ADB890 800646F0 3C198012 */ lui $t9, %hi(sCsStateHandlers2) -/* ADB894 800646F4 8FA40018 */ lw $a0, 0x18($sp) -/* ADB898 800646F8 90A90008 */ lbu $t1, 8($a1) -/* ADB89C 800646FC 00095080 */ sll $t2, $t1, 2 -/* ADB8A0 80064700 032AC821 */ addu $t9, $t9, $t2 -/* ADB8A4 80064704 8F39E1DC */ lw $t9, %lo(sCsStateHandlers2)($t9) -/* ADB8A8 80064708 0320F809 */ jalr $t9 -/* ADB8AC 8006470C 00000000 */ nop -/* ADB8B0 80064710 8FBF0014 */ lw $ra, 0x14($sp) -.L80064714: -/* ADB8B4 80064714 27BD0018 */ addiu $sp, $sp, 0x18 -/* ADB8B8 80064718 03E00008 */ jr $ra -/* ADB8BC 8006471C 00000000 */ nop - diff --git a/asm/non_matchings/code/z_demo/func_80064824.s b/asm/non_matchings/code/z_demo/func_80064824.s deleted file mode 100644 index 87f7f684b4..0000000000 --- a/asm/non_matchings/code/z_demo/func_80064824.s +++ /dev/null @@ -1,577 +0,0 @@ -.late_rodata -glabel jtbl_8013AEEC - .word L800648D4 - .word L8006490C - .word L8006493C - .word L80064FA4 - .word L80064FA4 - .word L80064978 - .word L800649A0 - .word L80064A28 - .word L80064A48 - .word L80064A5C - .word L80064A70 - .word L80064AC0 - .word L80064AE4 - .word L80064B20 - .word L80064B38 - .word L80064B78 - .word L80064BDC - .word L80064BF8 - .word L80064C58 - .word L80064C70 - .word L80064C88 - .word L80064CA0 - .word L80064CC0 - .word L80064D78 - .word L80064D88 - .word L80064DB8 - .word L80064E3C - .word L80064EBC - .word L80064ED0 - .word L80064EE0 - .word L80064EF4 - .word L80064F08 - .word L80064F2C - .word L80064F40 - .word L80064F88 - -.text -glabel func_80064824 -/* ADB9C4 80064824 27BDFFB8 */ addiu $sp, $sp, -0x48 -/* ADB9C8 80064828 AFBF002C */ sw $ra, 0x2c($sp) -/* ADB9CC 8006482C AFB00028 */ sw $s0, 0x28($sp) -/* ADB9D0 80064830 AFA5004C */ sw $a1, 0x4c($sp) -/* ADB9D4 80064834 AFA60050 */ sw $a2, 0x50($sp) -/* ADB9D8 80064838 94AF0010 */ lhu $t7, 0x10($a1) -/* ADB9DC 8006483C 8C891C44 */ lw $t1, 0x1c44($a0) -/* ADB9E0 80064840 00808025 */ move $s0, $a0 -/* ADB9E4 80064844 AFAF0038 */ sw $t7, 0x38($sp) -/* ADB9E8 80064848 94D90002 */ lhu $t9, 2($a2) -/* ADB9EC 8006484C 00001025 */ move $v0, $zero -/* ADB9F0 80064850 01F9082A */ slt $at, $t7, $t9 -/* ADB9F4 80064854 142001D3 */ bnez $at, .L80064FA4 -/* ADB9F8 80064858 AFB90030 */ sw $t9, 0x30($sp) -/* ADB9FC 8006485C 94C30004 */ lhu $v1, 4($a2) -/* ADBA00 80064860 97A6003A */ lhu $a2, 0x3a($sp) -/* ADBA04 80064864 97A50032 */ lhu $a1, 0x32($sp) -/* ADBA08 80064868 01E3082A */ slt $at, $t7, $v1 -/* ADBA0C 8006486C 14200002 */ bnez $at, .L80064878 -/* ADBA10 80064870 2464FFFF */ addiu $a0, $v1, -1 -/* ADBA14 80064874 172301CB */ bne $t9, $v1, .L80064FA4 -.L80064878: -/* ADBA18 80064878 3084FFFF */ andi $a0, $a0, 0xffff -/* ADBA1C 8006487C A3A2003F */ sb $v0, 0x3f($sp) -/* ADBA20 80064880 0C01BE4F */ jal func_8006F93C -/* ADBA24 80064884 AFA90044 */ sw $t1, 0x44($sp) -/* ADBA28 80064888 8FA30050 */ lw $v1, 0x50($sp) -/* ADBA2C 8006488C 8FA4004C */ lw $a0, 0x4c($sp) -/* ADBA30 80064890 93A2003F */ lbu $v0, 0x3f($sp) -/* ADBA34 80064894 946A0002 */ lhu $t2, 2($v1) -/* ADBA38 80064898 94870010 */ lhu $a3, 0x10($a0) -/* ADBA3C 8006489C 8FA90044 */ lw $t1, 0x44($sp) -/* ADBA40 800648A0 55470003 */ bnel $t2, $a3, .L800648B0 -/* ADBA44 800648A4 946B0000 */ lhu $t3, ($v1) -/* ADBA48 800648A8 24020001 */ li $v0, 1 -/* ADBA4C 800648AC 946B0000 */ lhu $t3, ($v1) -.L800648B0: -/* ADBA50 800648B0 256CFFFF */ addiu $t4, $t3, -1 -/* ADBA54 800648B4 2D810023 */ sltiu $at, $t4, 0x23 -/* ADBA58 800648B8 102001BA */ beqz $at, .L80064FA4 -/* ADBA5C 800648BC 000C6080 */ sll $t4, $t4, 2 -/* ADBA60 800648C0 3C018014 */ lui $at, %hi(jtbl_8013AEEC) -/* ADBA64 800648C4 002C0821 */ addu $at, $at, $t4 -/* ADBA68 800648C8 8C2CAEEC */ lw $t4, %lo(jtbl_8013AEEC)($at) -/* ADBA6C 800648CC 01800008 */ jr $t4 -/* ADBA70 800648D0 00000000 */ nop -glabel L800648D4 -/* ADBA74 800648D4 104001B3 */ beqz $v0, .L80064FA4 -/* ADBA78 800648D8 2404000E */ li $a0, 14 -/* ADBA7C 800648DC 24050004 */ li $a1, 4 -/* ADBA80 800648E0 0C03DB56 */ jal func_800F6D58 -/* ADBA84 800648E4 2406003F */ li $a2, 63 -/* ADBA88 800648E8 2404000E */ li $a0, 14 -/* ADBA8C 800648EC 24050001 */ li $a1, 1 -/* ADBA90 800648F0 0C03DB56 */ jal func_800F6D58 -/* ADBA94 800648F4 24060001 */ li $a2, 1 -/* ADBA98 800648F8 3C010001 */ lui $at, 1 -/* ADBA9C 800648FC 00300821 */ addu $at, $at, $s0 -/* ADBAA0 80064900 240D0014 */ li $t5, 20 -/* ADBAA4 80064904 100001A7 */ b .L80064FA4 -/* ADBAA8 80064908 A02D0B12 */ sb $t5, 0xb12($at) -glabel L8006490C -/* ADBAAC 8006490C 104001A5 */ beqz $v0, .L80064FA4 -/* ADBAB0 80064910 2404000F */ li $a0, 15 -/* ADBAB4 80064914 00002825 */ move $a1, $zero -/* ADBAB8 80064918 0C03DB56 */ jal func_800F6D58 -/* ADBABC 8006491C 00003025 */ move $a2, $zero -/* ADBAC0 80064920 02002025 */ move $a0, $s0 -/* ADBAC4 80064924 0C01D4F1 */ jal func_800753C4 -/* ADBAC8 80064928 24050003 */ li $a1, 3 -/* ADBACC 8006492C 24020001 */ li $v0, 1 -/* ADBAD0 80064930 3C018016 */ lui $at, %hi(D_8015FD70) # $at, 0x8016 -/* ADBAD4 80064934 1000019B */ b .L80064FA4 -/* ADBAD8 80064938 A022FD70 */ sb $v0, %lo(D_8015FD70)($at) -glabel L8006493C -/* ADBADC 8006493C 10400199 */ beqz $v0, .L80064FA4 -/* ADBAE0 80064940 02002025 */ move $a0, $s0 -/* ADBAE4 80064944 0C01B0F4 */ jal func_8006C3D0 -/* ADBAE8 80064948 00002825 */ move $a1, $zero -/* ADBAEC 8006494C 3C048016 */ lui $a0, %hi(gSaveContext) # $a0, 0x8016 -/* ADBAF0 80064950 2484E660 */ addiu $a0, %lo(gSaveContext) # addiu $a0, $a0, -0x19a0 -/* ADBAF4 80064954 8C8E0000 */ lw $t6, ($a0) -/* ADBAF8 80064958 24010053 */ li $at, 83 -/* ADBAFC 8006495C 02002025 */ move $a0, $s0 -/* ADBB00 80064960 55C10191 */ bnel $t6, $at, .L80064FA8 -/* ADBB04 80064964 8FBF002C */ lw $ra, 0x2c($sp) -/* ADBB08 80064968 0C01B0F4 */ jal func_8006C3D0 -/* ADBB0C 8006496C 24050002 */ li $a1, 2 -/* ADBB10 80064970 1000018D */ b .L80064FA8 -/* ADBB14 80064974 8FBF002C */ lw $ra, 0x2c($sp) -glabel L80064978 -/* ADBB18 80064978 3C020001 */ lui $v0, 1 -/* ADBB1C 8006497C 00501021 */ addu $v0, $v0, $s0 -/* ADBB20 80064980 84420AC4 */ lh $v0, 0xac4($v0) -/* ADBB24 80064984 28413200 */ slti $at, $v0, 0x3200 -/* ADBB28 80064988 10200186 */ beqz $at, .L80064FA4 -/* ADBB2C 8006498C 244F0023 */ addiu $t7, $v0, 0x23 -/* ADBB30 80064990 3C010001 */ lui $at, 1 -/* ADBB34 80064994 00300821 */ addu $at, $at, $s0 -/* ADBB38 80064998 10000182 */ b .L80064FA4 -/* ADBB3C 8006499C A42F0AC4 */ sh $t7, 0xac4($at) -glabel L800649A0 -/* ADBB40 800649A0 10400180 */ beqz $v0, .L80064FA4 -/* ADBB44 800649A4 2403003C */ li $v1, 60 -/* ADBB48 800649A8 3C010001 */ lui $at, 1 -/* ADBB4C 800649AC 24020001 */ li $v0, 1 -/* ADBB50 800649B0 00300821 */ addu $at, $at, $s0 -/* ADBB54 800649B4 A0220A3D */ sb $v0, 0xa3d($at) -/* ADBB58 800649B8 3C010001 */ lui $at, 1 -/* ADBB5C 800649BC 00300821 */ addu $at, $at, $s0 -/* ADBB60 800649C0 A0220A3B */ sb $v0, 0xa3b($at) -/* ADBB64 800649C4 3C010001 */ lui $at, 1 -/* ADBB68 800649C8 00300821 */ addu $at, $at, $s0 -/* ADBB6C 800649CC A0200A3C */ sb $zero, 0xa3c($at) -/* ADBB70 800649D0 3C010001 */ lui $at, 1 -/* ADBB74 800649D4 00300821 */ addu $at, $at, $s0 -/* ADBB78 800649D8 A4230A3E */ sh $v1, 0xa3e($at) -/* ADBB7C 800649DC 3C010001 */ lui $at, 1 -/* ADBB80 800649E0 00300821 */ addu $at, $at, $s0 -/* ADBB84 800649E4 A0220A45 */ sb $v0, 0xa45($at) -/* ADBB88 800649E8 3C010001 */ lui $at, 1 -/* ADBB8C 800649EC 00300821 */ addu $at, $at, $s0 -/* ADBB90 800649F0 A0200A43 */ sb $zero, 0xa43($at) -/* ADBB94 800649F4 3C010001 */ lui $at, 1 -/* ADBB98 800649F8 00300821 */ addu $at, $at, $s0 -/* ADBB9C 800649FC A0220A44 */ sb $v0, 0xa44($at) -/* ADBBA0 80064A00 3C010001 */ lui $at, 1 -/* ADBBA4 80064A04 00300821 */ addu $at, $at, $s0 -/* ADBBA8 80064A08 A4230A48 */ sh $v1, 0xa48($at) -/* ADBBAC 80064A0C 3C190001 */ lui $t9, 1 -/* ADBBB0 80064A10 0330C821 */ addu $t9, $t9, $s0 -/* ADBBB4 80064A14 97390A48 */ lhu $t9, 0xa48($t9) -/* ADBBB8 80064A18 3C010001 */ lui $at, 1 -/* ADBBBC 80064A1C 00300821 */ addu $at, $at, $s0 -/* ADBBC0 80064A20 10000160 */ b .L80064FA4 -/* ADBBC4 80064A24 A4390A46 */ sh $t9, 0xa46($at) -glabel L80064A28 -/* ADBBC8 80064A28 3C010001 */ lui $at, 1 -/* ADBBCC 80064A2C 02011021 */ addu $v0, $s0, $at -/* ADBBD0 80064A30 84431D30 */ lh $v1, 0x1d30($v0) -/* ADBBD4 80064A34 28610080 */ slti $at, $v1, 0x80 -/* ADBBD8 80064A38 1020015A */ beqz $at, .L80064FA4 -/* ADBBDC 80064A3C 24780004 */ addiu $t8, $v1, 4 -/* ADBBE0 80064A40 10000158 */ b .L80064FA4 -/* ADBBE4 80064A44 A4581D30 */ sh $t8, 0x1d30($v0) -glabel L80064A48 -/* ADBBE8 80064A48 3C010001 */ lui $at, 1 -/* ADBBEC 80064A4C 00300821 */ addu $at, $at, $s0 -/* ADBBF0 80064A50 240A0010 */ li $t2, 16 -/* ADBBF4 80064A54 10000153 */ b .L80064FA4 -/* ADBBF8 80064A58 A02A0B15 */ sb $t2, 0xb15($at) -glabel L80064A5C -/* ADBBFC 80064A5C 02002025 */ move $a0, $s0 -/* ADBC00 80064A60 0C01B0F4 */ jal func_8006C3D0 -/* ADBC04 80064A64 24050001 */ li $a1, 1 -/* ADBC08 80064A68 1000014F */ b .L80064FA8 -/* ADBC0C 80064A6C 8FBF002C */ lw $ra, 0x2c($sp) -glabel L80064A70 -/* ADBC10 80064A70 3C010001 */ lui $at, 1 -/* ADBC14 80064A74 02011021 */ addu $v0, $s0, $at -/* ADBC18 80064A78 84431D30 */ lh $v1, 0x1d30($v0) -/* ADBC1C 80064A7C 28610672 */ slti $at, $v1, 0x672 -/* ADBC20 80064A80 10200003 */ beqz $at, .L80064A90 -/* ADBC24 80064A84 246B0014 */ addiu $t3, $v1, 0x14 -/* ADBC28 80064A88 A44B1D30 */ sh $t3, 0x1d30($v0) -/* ADBC2C 80064A8C 94870010 */ lhu $a3, 0x10($a0) -.L80064A90: -/* ADBC30 80064A90 2401030F */ li $at, 783 -/* ADBC34 80064A94 54E10006 */ bnel $a3, $at, .L80064AB0 -/* ADBC38 80064A98 240102CD */ li $at, 717 -/* ADBC3C 80064A9C 0C01E221 */ jal func_80078884 -/* ADBC40 80064AA0 2404288E */ li $a0, 10382 -/* ADBC44 80064AA4 10000140 */ b .L80064FA8 -/* ADBC48 80064AA8 8FBF002C */ lw $ra, 0x2c($sp) -/* ADBC4C 80064AAC 240102CD */ li $at, 717 -.L80064AB0: -/* ADBC50 80064AB0 54E1013D */ bnel $a3, $at, .L80064FA8 -/* ADBC54 80064AB4 8FBF002C */ lw $ra, 0x2c($sp) -/* ADBC58 80064AB8 1000013A */ b .L80064FA4 -/* ADBC5C 80064ABC A4401D30 */ sh $zero, 0x1d30($v0) -glabel L80064AC0 -/* ADBC60 80064AC0 50400139 */ beql $v0, $zero, .L80064FA8 -/* ADBC64 80064AC4 8FBF002C */ lw $ra, 0x2c($sp) -/* ADBC68 80064AC8 908C0008 */ lbu $t4, 8($a0) -/* ADBC6C 80064ACC 24010004 */ li $at, 4 -/* ADBC70 80064AD0 240D0003 */ li $t5, 3 -/* ADBC74 80064AD4 51810134 */ beql $t4, $at, .L80064FA8 -/* ADBC78 80064AD8 8FBF002C */ lw $ra, 0x2c($sp) -/* ADBC7C 80064ADC 10000131 */ b .L80064FA4 -/* ADBC80 80064AE0 A08D0008 */ sb $t5, 8($a0) -glabel L80064AE4 -/* ADBC84 80064AE4 3C010001 */ lui $at, 1 -/* ADBC88 80064AE8 02011021 */ addu $v0, $s0, $at -/* ADBC8C 80064AEC 84431D32 */ lh $v1, 0x1d32($v0) -/* ADBC90 80064AF0 2404286F */ li $a0, 10351 -/* ADBC94 80064AF4 54600006 */ bnezl $v1, .L80064B10 -/* ADBC98 80064AF8 286100FF */ slti $at, $v1, 0xff -/* ADBC9C 80064AFC 0C01E221 */ jal func_80078884 -/* ADBCA0 80064B00 AFA20038 */ sw $v0, 0x38($sp) -/* ADBCA4 80064B04 8FA20038 */ lw $v0, 0x38($sp) -/* ADBCA8 80064B08 84431D32 */ lh $v1, 0x1d32($v0) -/* ADBCAC 80064B0C 286100FF */ slti $at, $v1, 0xff -.L80064B10: -/* ADBCB0 80064B10 10200124 */ beqz $at, .L80064FA4 -/* ADBCB4 80064B14 246E0005 */ addiu $t6, $v1, 5 -/* ADBCB8 80064B18 10000122 */ b .L80064FA4 -/* ADBCBC 80064B1C A44E1D32 */ sh $t6, 0x1d32($v0) -glabel L80064B20 -/* ADBCC0 80064B20 10400120 */ beqz $v0, .L80064FA4 -/* ADBCC4 80064B24 02002025 */ move $a0, $s0 -/* ADBCC8 80064B28 0C02F124 */ jal func_800BC490 -/* ADBCCC 80064B2C 24050001 */ li $a1, 1 -/* ADBCD0 80064B30 1000011D */ b .L80064FA8 -/* ADBCD4 80064B34 8FBF002C */ lw $ra, 0x2c($sp) -glabel L80064B38 -/* ADBCD8 80064B38 1040011A */ beqz $v0, .L80064FA4 -/* ADBCDC 80064B3C 02002025 */ move $a0, $s0 -/* ADBCE0 80064B40 8D2601B0 */ lw $a2, 0x1b0($t1) -/* ADBCE4 80064B44 240F0078 */ li $t7, 120 -/* ADBCE8 80064B48 24190090 */ li $t9, 144 -/* ADBCEC 80064B4C 24180018 */ li $t8, 24 -/* ADBCF0 80064B50 240A0014 */ li $t2, 20 -/* ADBCF4 80064B54 AFAA001C */ sw $t2, 0x1c($sp) -/* ADBCF8 80064B58 AFB80018 */ sw $t8, 0x18($sp) -/* ADBCFC 80064B5C AFB90014 */ sw $t9, 0x14($sp) -/* ADBD00 80064B60 AFAF0010 */ sw $t7, 0x10($sp) -/* ADBD04 80064B64 26051D4C */ addiu $a1, $s0, 0x1d4c -/* ADBD08 80064B68 0C00B390 */ jal TitleCard_InitPlaceName -/* ADBD0C 80064B6C 240700A0 */ li $a3, 160 -/* ADBD10 80064B70 1000010D */ b .L80064FA8 -/* ADBD14 80064B74 8FBF002C */ lw $ra, 0x2c($sp) -glabel L80064B78 -/* ADBD18 80064B78 5040010B */ beql $v0, $zero, .L80064FA8 -/* ADBD1C 80064B7C 8FBF002C */ lw $ra, 0x2c($sp) -/* ADBD20 80064B80 860B07A0 */ lh $t3, 0x7a0($s0) -/* ADBD24 80064B84 24050006 */ li $a1, 6 -/* ADBD28 80064B88 000B6080 */ sll $t4, $t3, 2 -/* ADBD2C 80064B8C 020C6821 */ addu $t5, $s0, $t4 -/* ADBD30 80064B90 0C024BE2 */ jal Quake_Add -/* ADBD34 80064B94 8DA40790 */ lw $a0, 0x790($t5) -/* ADBD38 80064B98 3C108016 */ lui $s0, %hi(D_8015FCCA) # $s0, 0x8016 -/* ADBD3C 80064B9C 2610FCCA */ addiu $s0, %lo(D_8015FCCA) # addiu $s0, $s0, -0x336 -/* ADBD40 80064BA0 A6020000 */ sh $v0, ($s0) -/* ADBD44 80064BA4 86040000 */ lh $a0, ($s0) -/* ADBD48 80064BA8 0C024B6B */ jal Quake_SetSpeed -/* ADBD4C 80064BAC 24057FFF */ li $a1, 32767 -/* ADBD50 80064BB0 86040000 */ lh $a0, ($s0) -/* ADBD54 80064BB4 24050004 */ li $a1, 4 -/* ADBD58 80064BB8 00003025 */ move $a2, $zero -/* ADBD5C 80064BBC 240703E8 */ li $a3, 1000 -/* ADBD60 80064BC0 0C024B9C */ jal Quake_SetQuakeValues -/* ADBD64 80064BC4 AFA00010 */ sw $zero, 0x10($sp) -/* ADBD68 80064BC8 86040000 */ lh $a0, ($s0) -/* ADBD6C 80064BCC 0C024B7C */ jal Quake_SetCountdown -/* ADBD70 80064BD0 24050320 */ li $a1, 800 -/* ADBD74 80064BD4 100000F4 */ b .L80064FA8 -/* ADBD78 80064BD8 8FBF002C */ lw $ra, 0x2c($sp) -glabel L80064BDC -/* ADBD7C 80064BDC 104000F1 */ beqz $v0, .L80064FA4 -/* ADBD80 80064BE0 3C108016 */ lui $s0, %hi(D_8015FCCA) # $s0, 0x8016 -/* ADBD84 80064BE4 2610FCCA */ addiu $s0, %lo(D_8015FCCA) # addiu $s0, $s0, -0x336 -/* ADBD88 80064BE8 0C024BEB */ jal Quake_RemoveFromIdx -/* ADBD8C 80064BEC 86040000 */ lh $a0, ($s0) -/* ADBD90 80064BF0 100000ED */ b .L80064FA8 -/* ADBD94 80064BF4 8FBF002C */ lw $ra, 0x2c($sp) -glabel L80064BF8 -/* ADBD98 80064BF8 3C010001 */ lui $at, 1 -/* ADBD9C 80064BFC 02011021 */ addu $v0, $s0, $at -/* ADBDA0 80064C00 3C048016 */ lui $a0, %hi(gSaveContext) # $a0, 0x8016 -/* ADBDA4 80064C04 A0400B12 */ sb $zero, 0xb12($v0) -/* ADBDA8 80064C08 00300821 */ addu $at, $at, $s0 -/* ADBDAC 80064C0C 240E0002 */ li $t6, 2 -/* ADBDB0 80064C10 2484E660 */ addiu $a0, %lo(gSaveContext) # addiu $a0, $a0, -0x19a0 -/* ADBDB4 80064C14 A02E0B01 */ sb $t6, 0xb01($at) -/* ADBDB8 80064C18 9483000C */ lhu $v1, 0xc($a0) -/* ADBDBC 80064C1C 24050001 */ li $a1, 1 -/* ADBDC0 80064C20 00003025 */ move $a2, $zero -/* ADBDC4 80064C24 28614AAB */ slti $at, $v1, 0x4aab -/* ADBDC8 80064C28 10200002 */ beqz $at, .L80064C34 -/* ADBDCC 80064C2C 246F001E */ addiu $t7, $v1, 0x1e -/* ADBDD0 80064C30 A48F000C */ sh $t7, 0xc($a0) -.L80064C34: -/* ADBDD4 80064C34 90590B13 */ lbu $t9, 0xb13($v0) -/* ADBDD8 80064C38 3C018012 */ lui $at, %hi(D_8011FB30) # $at, 0x8012 -/* ADBDDC 80064C3C 2404000E */ li $a0, 14 -/* ADBDE0 80064C40 572000D9 */ bnezl $t9, .L80064FA8 -/* ADBDE4 80064C44 8FBF002C */ lw $ra, 0x2c($sp) -/* ADBDE8 80064C48 0C03DB56 */ jal func_800F6D58 -/* ADBDEC 80064C4C A020FB30 */ sb $zero, %lo(D_8011FB30)($at) -/* ADBDF0 80064C50 100000D5 */ b .L80064FA8 -/* ADBDF4 80064C54 8FBF002C */ lw $ra, 0x2c($sp) -glabel L80064C58 -/* ADBDF8 80064C58 3C048016 */ lui $a0, %hi(gSaveContext) # $a0, 0x8016 -/* ADBDFC 80064C5C 2484E660 */ addiu $a0, %lo(gSaveContext) # addiu $a0, $a0, -0x19a0 -/* ADBE00 80064C60 94980EE0 */ lhu $t8, 0xee0($a0) -/* ADBE04 80064C64 370A0020 */ ori $t2, $t8, 0x20 -/* ADBE08 80064C68 100000CE */ b .L80064FA4 -/* ADBE0C 80064C6C A48A0EE0 */ sh $t2, 0xee0($a0) -glabel L80064C70 -/* ADBE10 80064C70 3C048016 */ lui $a0, %hi(gSaveContext) # $a0, 0x8016 -/* ADBE14 80064C74 2484E660 */ addiu $a0, %lo(gSaveContext) # addiu $a0, $a0, -0x19a0 -/* ADBE18 80064C78 948B0EE0 */ lhu $t3, 0xee0($a0) -/* ADBE1C 80064C7C 356C0080 */ ori $t4, $t3, 0x80 -/* ADBE20 80064C80 100000C8 */ b .L80064FA4 -/* ADBE24 80064C84 A48C0EE0 */ sh $t4, 0xee0($a0) -glabel L80064C88 -/* ADBE28 80064C88 3C048016 */ lui $a0, %hi(gSaveContext) # $a0, 0x8016 -/* ADBE2C 80064C8C 2484E660 */ addiu $a0, %lo(gSaveContext) # addiu $a0, $a0, -0x19a0 -/* ADBE30 80064C90 948D0EE0 */ lhu $t5, 0xee0($a0) -/* ADBE34 80064C94 35AE0200 */ ori $t6, $t5, 0x200 -/* ADBE38 80064C98 100000C2 */ b .L80064FA4 -/* ADBE3C 80064C9C A48E0EE0 */ sh $t6, 0xee0($a0) -glabel L80064CA0 -/* ADBE40 80064CA0 3C028016 */ lui $v0, %hi(D_801614B0) # $v0, 0x8016 -/* ADBE44 80064CA4 244214B0 */ addiu $v0, %lo(D_801614B0) # addiu $v0, $v0, 0x14b0 -/* ADBE48 80064CA8 240300FF */ li $v1, 255 -/* ADBE4C 80064CAC A0430000 */ sb $v1, ($v0) -/* ADBE50 80064CB0 A0430001 */ sb $v1, 1($v0) -/* ADBE54 80064CB4 A0430002 */ sb $v1, 2($v0) -/* ADBE58 80064CB8 100000BA */ b .L80064FA4 -/* ADBE5C 80064CBC A0430003 */ sb $v1, 3($v0) -glabel L80064CC0 -/* ADBE60 80064CC0 3C01437F */ li $at, 0x437F0000 # 0.000000 -/* ADBE64 80064CC4 44812000 */ mtc1 $at, $f4 -/* ADBE68 80064CC8 240A0001 */ li $t2, 1 -/* ADBE6C 80064CCC 3C028016 */ lui $v0, %hi(D_801614B0) # $v0, 0x8016 -/* ADBE70 80064CD0 46002182 */ mul.s $f6, $f4, $f0 -/* ADBE74 80064CD4 244214B0 */ addiu $v0, %lo(D_801614B0) # addiu $v0, $v0, 0x14b0 -/* ADBE78 80064CD8 240300FF */ li $v1, 255 -/* ADBE7C 80064CDC 240F00B4 */ li $t7, 180 -/* ADBE80 80064CE0 24190064 */ li $t9, 100 -/* ADBE84 80064CE4 A0430000 */ sb $v1, ($v0) -/* ADBE88 80064CE8 A04F0001 */ sb $t7, 1($v0) -/* ADBE8C 80064CEC 4458F800 */ cfc1 $t8, $31 -/* ADBE90 80064CF0 44CAF800 */ ctc1 $t2, $31 -/* ADBE94 80064CF4 A0590002 */ sb $t9, 2($v0) -/* ADBE98 80064CF8 3C014F00 */ li $at, 0x4F000000 # 0.000000 -/* ADBE9C 80064CFC 46003224 */ cvt.w.s $f8, $f6 -/* ADBEA0 80064D00 444AF800 */ cfc1 $t2, $31 -/* ADBEA4 80064D04 00000000 */ nop -/* ADBEA8 80064D08 314A0078 */ andi $t2, $t2, 0x78 -/* ADBEAC 80064D0C 51400013 */ beql $t2, $zero, .L80064D5C -/* ADBEB0 80064D10 440A4000 */ mfc1 $t2, $f8 -/* ADBEB4 80064D14 44814000 */ mtc1 $at, $f8 -/* ADBEB8 80064D18 240A0001 */ li $t2, 1 -/* ADBEBC 80064D1C 46083201 */ sub.s $f8, $f6, $f8 -/* ADBEC0 80064D20 44CAF800 */ ctc1 $t2, $31 -/* ADBEC4 80064D24 00000000 */ nop -/* ADBEC8 80064D28 46004224 */ cvt.w.s $f8, $f8 -/* ADBECC 80064D2C 444AF800 */ cfc1 $t2, $31 -/* ADBED0 80064D30 00000000 */ nop -/* ADBED4 80064D34 314A0078 */ andi $t2, $t2, 0x78 -/* ADBED8 80064D38 15400005 */ bnez $t2, .L80064D50 -/* ADBEDC 80064D3C 00000000 */ nop -/* ADBEE0 80064D40 440A4000 */ mfc1 $t2, $f8 -/* ADBEE4 80064D44 3C018000 */ lui $at, 0x8000 -/* ADBEE8 80064D48 10000007 */ b .L80064D68 -/* ADBEEC 80064D4C 01415025 */ or $t2, $t2, $at -.L80064D50: -/* ADBEF0 80064D50 10000005 */ b .L80064D68 -/* ADBEF4 80064D54 240AFFFF */ li $t2, -1 -/* ADBEF8 80064D58 440A4000 */ mfc1 $t2, $f8 -.L80064D5C: -/* ADBEFC 80064D5C 00000000 */ nop -/* ADBF00 80064D60 0540FFFB */ bltz $t2, .L80064D50 -/* ADBF04 80064D64 00000000 */ nop -.L80064D68: -/* ADBF08 80064D68 44D8F800 */ ctc1 $t8, $31 -/* ADBF0C 80064D6C 3C018016 */ lui $at, %hi(D_801614B3) # $at, 0x8016 -/* ADBF10 80064D70 1000008C */ b .L80064FA4 -/* ADBF14 80064D74 A02A14B3 */ sb $t2, %lo(D_801614B3)($at) -glabel L80064D78 -/* ADBF18 80064D78 3C010001 */ lui $at, 1 -/* ADBF1C 80064D7C 00300821 */ addu $at, $at, $s0 -/* ADBF20 80064D80 10000088 */ b .L80064FA4 -/* ADBF24 80064D84 AC201CC8 */ sw $zero, 0x1cc8($at) -glabel L80064D88 -/* ADBF28 80064D88 3C048016 */ lui $a0, %hi(gSaveContext) # $a0, 0x8016 -/* ADBF2C 80064D8C 2484E660 */ addiu $a0, %lo(gSaveContext) # addiu $a0, $a0, -0x19a0 -/* ADBF30 80064D90 948B000C */ lhu $t3, 0xc($a0) -/* ADBF34 80064D94 3401CAAB */ li $at, 51883 -/* ADBF38 80064D98 340ECAAA */ li $t6, 51882 -/* ADBF3C 80064D9C 256C001E */ addiu $t4, $t3, 0x1e -/* ADBF40 80064DA0 318DFFFF */ andi $t5, $t4, 0xffff -/* ADBF44 80064DA4 01A1082A */ slt $at, $t5, $at -/* ADBF48 80064DA8 1420007E */ bnez $at, .L80064FA4 -/* ADBF4C 80064DAC A48C000C */ sh $t4, 0xc($a0) -/* ADBF50 80064DB0 1000007C */ b .L80064FA4 -/* ADBF54 80064DB4 A48E000C */ sh $t6, 0xc($a0) -glabel L80064DB8 -/* ADBF58 80064DB8 3C048016 */ lui $a0, %hi(gSaveContext) # $a0, 0x8016 -/* ADBF5C 80064DBC 2484E660 */ addiu $a0, %lo(gSaveContext) # addiu $a0, $a0, -0x19a0 -/* ADBF60 80064DC0 9483000C */ lhu $v1, 0xc($a0) -/* ADBF64 80064DC4 28613000 */ slti $at, $v1, 0x3000 -/* ADBF68 80064DC8 14200002 */ bnez $at, .L80064DD4 -/* ADBF6C 80064DCC 28614555 */ slti $at, $v1, 0x4555 -/* ADBF70 80064DD0 14200074 */ bnez $at, .L80064FA4 -.L80064DD4: -/* ADBF74 80064DD4 28614555 */ slti $at, $v1, 0x4555 -/* ADBF78 80064DD8 14200008 */ bnez $at, .L80064DFC -/* ADBF7C 80064DDC 3401AAAB */ li $at, 43691 -/* ADBF80 80064DE0 0061082A */ slt $at, $v1, $at -/* ADBF84 80064DE4 10200005 */ beqz $at, .L80064DFC -/* ADBF88 80064DE8 24020001 */ li $v0, 1 -/* ADBF8C 80064DEC 3C010001 */ lui $at, 1 -/* ADBF90 80064DF0 00300821 */ addu $at, $at, $s0 -/* ADBF94 80064DF4 1000006B */ b .L80064FA4 -/* ADBF98 80064DF8 A0220AE3 */ sb $v0, 0xae3($at) -.L80064DFC: -/* ADBF9C 80064DFC 3401AAAB */ li $at, 43691 -/* ADBFA0 80064E00 0061082A */ slt $at, $v1, $at -/* ADBFA4 80064E04 14200009 */ bnez $at, .L80064E2C -/* ADBFA8 80064E08 24190003 */ li $t9, 3 -/* ADBFAC 80064E0C 3401C556 */ li $at, 50518 -/* ADBFB0 80064E10 0061082A */ slt $at, $v1, $at -/* ADBFB4 80064E14 10200005 */ beqz $at, .L80064E2C -/* ADBFB8 80064E18 240F0002 */ li $t7, 2 -/* ADBFBC 80064E1C 3C010001 */ lui $at, 1 -/* ADBFC0 80064E20 00300821 */ addu $at, $at, $s0 -/* ADBFC4 80064E24 1000005F */ b .L80064FA4 -/* ADBFC8 80064E28 A02F0AE3 */ sb $t7, 0xae3($at) -.L80064E2C: -/* ADBFCC 80064E2C 3C010001 */ lui $at, 1 -/* ADBFD0 80064E30 00300821 */ addu $at, $at, $s0 -/* ADBFD4 80064E34 1000005B */ b .L80064FA4 -/* ADBFD8 80064E38 A0390AE3 */ sb $t9, 0xae3($at) -glabel L80064E3C -/* ADBFDC 80064E3C 8E18009C */ lw $t8, 0x9c($s0) -/* ADBFE0 80064E40 3C010001 */ lui $at, 1 -/* ADBFE4 80064E44 02011021 */ addu $v0, $s0, $at -/* ADBFE8 80064E48 330A0008 */ andi $t2, $t8, 8 -/* ADBFEC 80064E4C 51400010 */ beql $t2, $zero, .L80064E90 -/* ADBFF0 80064E50 84430AB0 */ lh $v1, 0xab0($v0) -/* ADBFF4 80064E54 3C010001 */ lui $at, 1 -/* ADBFF8 80064E58 02011021 */ addu $v0, $s0, $at -/* ADBFFC 80064E5C 84430AB0 */ lh $v1, 0xab0($v0) -/* ADC000 80064E60 28610028 */ slti $at, $v1, 0x28 -/* ADC004 80064E64 1020004F */ beqz $at, .L80064FA4 -/* ADC008 80064E68 246B0002 */ addiu $t3, $v1, 2 -/* ADC00C 80064E6C 844C0AB8 */ lh $t4, 0xab8($v0) -/* ADC010 80064E70 844E0ABA */ lh $t6, 0xaba($v0) -/* ADC014 80064E74 A44B0AB0 */ sh $t3, 0xab0($v0) -/* ADC018 80064E78 258DFFFD */ addiu $t5, $t4, -3 -/* ADC01C 80064E7C 25CFFFFD */ addiu $t7, $t6, -3 -/* ADC020 80064E80 A44D0AB8 */ sh $t5, 0xab8($v0) -/* ADC024 80064E84 10000047 */ b .L80064FA4 -/* ADC028 80064E88 A44F0ABA */ sh $t7, 0xaba($v0) -/* ADC02C 80064E8C 84430AB0 */ lh $v1, 0xab0($v0) -.L80064E90: -/* ADC030 80064E90 28610003 */ slti $at, $v1, 3 -/* ADC034 80064E94 14200043 */ bnez $at, .L80064FA4 -/* ADC038 80064E98 2479FFFE */ addiu $t9, $v1, -2 -/* ADC03C 80064E9C 84580AB8 */ lh $t8, 0xab8($v0) -/* ADC040 80064EA0 844B0ABA */ lh $t3, 0xaba($v0) -/* ADC044 80064EA4 A4590AB0 */ sh $t9, 0xab0($v0) -/* ADC048 80064EA8 270A0003 */ addiu $t2, $t8, 3 -/* ADC04C 80064EAC 256C0003 */ addiu $t4, $t3, 3 -/* ADC050 80064EB0 A44A0AB8 */ sh $t2, 0xab8($v0) -/* ADC054 80064EB4 1000003B */ b .L80064FA4 -/* ADC058 80064EB8 A44C0ABA */ sh $t4, 0xaba($v0) -glabel L80064EBC -/* ADC05C 80064EBC 3C010001 */ lui $at, 1 -/* ADC060 80064EC0 24020001 */ li $v0, 1 -/* ADC064 80064EC4 00300821 */ addu $at, $at, $s0 -/* ADC068 80064EC8 10000036 */ b .L80064FA4 -/* ADC06C 80064ECC A0221DE9 */ sb $v0, 0x1de9($at) -glabel L80064ED0 -/* ADC070 80064ED0 3C010001 */ lui $at, 1 -/* ADC074 80064ED4 00300821 */ addu $at, $at, $s0 -/* ADC078 80064ED8 10000032 */ b .L80064FA4 -/* ADC07C 80064EDC A0201DE9 */ sb $zero, 0x1de9($at) -glabel L80064EE0 -/* ADC080 80064EE0 02002025 */ move $a0, $s0 -/* ADC084 80064EE4 0C01B0F4 */ jal func_8006C3D0 -/* ADC088 80064EE8 24050003 */ li $a1, 3 -/* ADC08C 80064EEC 1000002E */ b .L80064FA8 -/* ADC090 80064EF0 8FBF002C */ lw $ra, 0x2c($sp) -glabel L80064EF4 -/* ADC094 80064EF4 02002025 */ move $a0, $s0 -/* ADC098 80064EF8 0C01B0F4 */ jal func_8006C3D0 -/* ADC09C 80064EFC 24050004 */ li $a1, 4 -/* ADC0A0 80064F00 10000029 */ b .L80064FA8 -/* ADC0A4 80064F04 8FBF002C */ lw $ra, 0x2c($sp) -glabel L80064F08 -/* ADC0A8 80064F08 10400004 */ beqz $v0, .L80064F1C -/* ADC0AC 80064F0C 3C010001 */ lui $at, 1 -/* ADC0B0 80064F10 24020001 */ li $v0, 1 -/* ADC0B4 80064F14 00300821 */ addu $at, $at, $s0 -/* ADC0B8 80064F18 A0220B0A */ sb $v0, 0xb0a($at) -.L80064F1C: -/* ADC0BC 80064F1C 0C01E233 */ jal func_800788CC -/* ADC0C0 80064F20 240420C0 */ li $a0, 8384 -/* ADC0C4 80064F24 10000020 */ b .L80064FA8 -/* ADC0C8 80064F28 8FBF002C */ lw $ra, 0x2c($sp) -glabel L80064F2C -/* ADC0CC 80064F2C 3C048016 */ lui $a0, %hi(gSaveContext) # $a0, 0x8016 -/* ADC0D0 80064F30 2484E660 */ addiu $a0, %lo(gSaveContext) # addiu $a0, $a0, -0x19a0 -/* ADC0D4 80064F34 240D0001 */ li $t5, 1 -/* ADC0D8 80064F38 1000001A */ b .L80064FA4 -/* ADC0DC 80064F3C A48D1422 */ sh $t5, 0x1422($a0) -glabel L80064F40 -/* ADC0E0 80064F40 3C048016 */ lui $a0, %hi(gSaveContext) # $a0, 0x8016 -/* ADC0E4 80064F44 2484E660 */ addiu $a0, %lo(gSaveContext) # addiu $a0, $a0, -0x19a0 -/* ADC0E8 80064F48 8C8E0010 */ lw $t6, 0x10($a0) -/* ADC0EC 80064F4C 3C198012 */ lui $t9, %hi(D_8011FB40) # $t9, 0x8012 -/* ADC0F0 80064F50 3C0B8012 */ lui $t3, %hi(D_8011FB40) # $t3, 0x8012 -/* ADC0F4 80064F54 15C00006 */ bnez $t6, .L80064F70 -/* ADC0F8 80064F58 00000000 */ nop -/* ADC0FC 80064F5C 948F000C */ lhu $t7, 0xc($a0) -/* ADC100 80064F60 9739FB40 */ lhu $t9, %lo(D_8011FB40)($t9) -/* ADC104 80064F64 01F9C023 */ subu $t8, $t7, $t9 -/* ADC108 80064F68 1000000E */ b .L80064FA4 -/* ADC10C 80064F6C A498000C */ sh $t8, 0xc($a0) -.L80064F70: -/* ADC110 80064F70 956BFB40 */ lhu $t3, %lo(D_8011FB40)($t3) -/* ADC114 80064F74 948A000C */ lhu $t2, 0xc($a0) -/* ADC118 80064F78 000B6040 */ sll $t4, $t3, 1 -/* ADC11C 80064F7C 014C6823 */ subu $t5, $t2, $t4 -/* ADC120 80064F80 10000008 */ b .L80064FA4 -/* ADC124 80064F84 A48D000C */ sh $t5, 0xc($a0) -glabel L80064F88 -/* ADC128 80064F88 0C03BA09 */ jal func_800EE824 -/* ADC12C 80064F8C 00000000 */ nop -/* ADC130 80064F90 8FA30050 */ lw $v1, 0x50($sp) -/* ADC134 80064F94 8FA4004C */ lw $a0, 0x4c($sp) -/* ADC138 80064F98 946E0002 */ lhu $t6, 2($v1) -/* ADC13C 80064F9C 25CFFFFF */ addiu $t7, $t6, -1 -/* ADC140 80064FA0 A48F0010 */ sh $t7, 0x10($a0) -glabel L80064FA4 -.L80064FA4: -/* ADC144 80064FA4 8FBF002C */ lw $ra, 0x2c($sp) -.L80064FA8: -/* ADC148 80064FA8 8FB00028 */ lw $s0, 0x28($sp) -/* ADC14C 80064FAC 27BD0048 */ addiu $sp, $sp, 0x48 -/* ADC150 80064FB0 03E00008 */ jr $ra -/* ADC154 80064FB4 00000000 */ nop - diff --git a/asm/non_matchings/code/z_demo/func_80065134.s b/asm/non_matchings/code/z_demo/func_80065134.s deleted file mode 100644 index a1d77cb661..0000000000 --- a/asm/non_matchings/code/z_demo/func_80065134.s +++ /dev/null @@ -1,45 +0,0 @@ -glabel func_80065134 -/* ADC2D4 80065134 AFA40000 */ sw $a0, ($sp) -/* ADC2D8 80065138 94AF0010 */ lhu $t7, 0x10($a1) -/* ADC2DC 8006513C 94CE0002 */ lhu $t6, 2($a2) -/* ADC2E0 80065140 3C058016 */ lui $a1, %hi(gSaveContext) # $a1, 0x8016 -/* ADC2E4 80065144 15CF0022 */ bne $t6, $t7, .L800651D0 -/* ADC2E8 80065148 00000000 */ nop -/* ADC2EC 8006514C 90D80006 */ lbu $t8, 6($a2) -/* ADC2F0 80065150 3C013CB4 */ li $at, 0x3CB40000 # 0.000000 -/* ADC2F4 80065154 44810000 */ mtc1 $at, $f0 -/* ADC2F8 80065158 44982000 */ mtc1 $t8, $f4 -/* ADC2FC 8006515C 24A5E660 */ addiu $a1, %lo(gSaveContext) # addiu $a1, $a1, -0x19a0 -/* ADC300 80065160 07010005 */ bgez $t8, .L80065178 -/* ADC304 80065164 468021A0 */ cvt.s.w $f6, $f4 -/* ADC308 80065168 3C014F80 */ li $at, 0x4F800000 # 0.000000 -/* ADC30C 8006516C 44814000 */ mtc1 $at, $f8 -/* ADC310 80065170 00000000 */ nop -/* ADC314 80065174 46083180 */ add.s $f6, $f6, $f8 -.L80065178: -/* ADC318 80065178 90C80007 */ lbu $t0, 7($a2) -/* ADC31C 8006517C 3C014270 */ li $at, 0x42700000 # 0.000000 -/* ADC320 80065180 44815000 */ mtc1 $at, $f10 -/* ADC324 80065184 25090001 */ addiu $t1, $t0, 1 -/* ADC328 80065188 44894000 */ mtc1 $t1, $f8 -/* ADC32C 8006518C 460A3402 */ mul.s $f16, $f6, $f10 -/* ADC330 80065190 468041A0 */ cvt.s.w $f6, $f8 -/* ADC334 80065194 46008483 */ div.s $f18, $f16, $f0 -/* ADC338 80065198 46003283 */ div.s $f10, $f6, $f0 -/* ADC33C 8006519C 4600910D */ trunc.w.s $f4, $f18 -/* ADC340 800651A0 44022000 */ mfc1 $v0, $f4 -/* ADC344 800651A4 00000000 */ nop -/* ADC348 800651A8 00021400 */ sll $v0, $v0, 0x10 -/* ADC34C 800651AC 00021403 */ sra $v0, $v0, 0x10 -/* ADC350 800651B0 4600540D */ trunc.w.s $f16, $f10 -/* ADC354 800651B4 44038000 */ mfc1 $v1, $f16 -/* ADC358 800651B8 00000000 */ nop -/* ADC35C 800651BC 00031C00 */ sll $v1, $v1, 0x10 -/* ADC360 800651C0 00031C03 */ sra $v1, $v1, 0x10 -/* ADC364 800651C4 00432021 */ addu $a0, $v0, $v1 -/* ADC368 800651C8 A4A4000C */ sh $a0, 0xc($a1) -/* ADC36C 800651CC A4A4141A */ sh $a0, 0x141a($a1) -.L800651D0: -/* ADC370 800651D0 03E00008 */ jr $ra -/* ADC374 800651D4 00000000 */ nop - diff --git a/src/code/z_demo.c b/src/code/z_demo.c index c2cad22064..5735a56890 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -1,5 +1,6 @@ #include #include +#include u16 D_8011E1C0 = 0; u16 D_8011E1C4 = 0; @@ -95,19 +96,17 @@ void func_80064558(GlobalContext* globalCtx, CutsceneContext* csCtx) { } } -#ifdef NON_MATCHING -// minor ordering and regalloc differences void func_800645A0(GlobalContext* globalCtx, CutsceneContext* csCtx) { - CutsceneStateHandler handler; + Input* pad1 = &globalCtx->state.input[0]; - if (!~(globalCtx->state.input[0].padPressed | -0x201) && (csCtx->state == CS_STATE_IDLE) && + if (!~(pad1->padPressed | ~L_JPAD) && (csCtx->state == CS_STATE_IDLE) && (gSaveContext.scene_setup_index >= 4)) { D_8015FCC8 = 0; gSaveContext.cutscene_index = 0xFFFD; gSaveContext.cutscene_trigger = 1; } - if (!~(globalCtx->state.input[0].padPressed | -0x801) && (csCtx->state == CS_STATE_IDLE) && + if (!~(pad1->padPressed | ~U_JPAD) && (csCtx->state == CS_STATE_IDLE) && (gSaveContext.scene_setup_index >= 4) && (D_8011D394 == 0)) { D_8015FCC8 = 1; gSaveContext.cutscene_index = 0xFFFD; @@ -127,13 +126,9 @@ void func_800645A0(GlobalContext* globalCtx, CutsceneContext* csCtx) { if (gSaveContext.cutscene_index >= 0xFFF0) { func_80068ECC(globalCtx, csCtx); - handler = sCsStateHandlers2[csCtx->state]; - handler(globalCtx, csCtx); + sCsStateHandlers2[csCtx->state](globalCtx, csCtx); } } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800645A0.s") -#endif void func_80064720(GlobalContext* globalCtx, CutsceneContext* csCtx) { } @@ -164,8 +159,6 @@ void func_800647C0(GlobalContext* globalCtx, CutsceneContext* csCtx) { } // Command 3: Misc. Actions -#ifdef NON_MATCHING -// regalloc and minor ordering differences void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) { Player* player = PLAYER; f32 temp; @@ -195,6 +188,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* if (sp3F != 0) { func_800F6D58(0xF, 0, 0); func_800753C4(globalCtx, 3); + if (1) {} D_8015FD70 = 1; } break; @@ -320,7 +314,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* break; case 25: gSaveContext.day_time += 30; - if ((gSaveContext.day_time & 0xFFFF) > 0xCAAA) { + if ((gSaveContext.day_time) > 0xCAAA) { gSaveContext.day_time = 0xCAAA; } break; @@ -384,9 +378,6 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* break; } } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_80064824.s") -#endif // Command 4: Set Environment Lighting void Cutscene_Command_SetLighting(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdEnvLighting* cmd) { @@ -433,8 +424,6 @@ void Cutscene_Command_09(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmd } // Command 0x8C: Set Time of Day & Environment Time -#ifdef NON_MATCHING -// regalloc differences void func_80065134(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdDayTime* cmd) { s16 temp1; s16 temp2; @@ -442,12 +431,11 @@ void func_80065134(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdDayTim if (csCtx->frames == cmd->startFrame) { temp1 = (cmd->hour * 60.0f) / 0.021972656f; temp2 = (cmd->minute + 1) / 0.021972656f; - gSaveContext.environment_time = gSaveContext.day_time = temp1 + temp2; + + gSaveContext.day_time = temp1 + temp2; + gSaveContext.environment_time = temp1 + temp2; } } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_80065134.s") -#endif // Command 0x3E8: Code Execution (& Terminates Cutscene?) void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) { From e14b6eefec0b87f8c4ccbd8f055811d73ef73ac4 Mon Sep 17 00:00:00 2001 From: chandler Date: Tue, 7 Apr 2020 11:03:10 -0400 Subject: [PATCH 13/14] made recently suggested changes --- .../z_bg_hidan_firewall.c | 18 +++++++++--------- .../z_bg_hidan_firewall.h | 5 +---- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c index 96196356b7..e7238be66f 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.c @@ -11,7 +11,7 @@ void BgHidanFirewall_Init(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Destroy(BgHidanFirewall* this, GlobalContext* globalCtx); -s32 BgHidanFirewall_Proximity(BgHidanFirewall* this, GlobalContext* globalCtx); +s32 BgHidanFirewall_CheckProximity(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Wait(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Countdown(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Erupt(BgHidanFirewall* this, GlobalContext* globalCtx); @@ -20,7 +20,7 @@ void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, GlobalContext* void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx); void BgHidanFirewall_Draw(BgHidanFirewall* this, GlobalContext* globalCtx); -extern Gfx D_0600DA80; +extern Gfx D_0600DA80[]; const ActorInit Bg_Hidan_Firewall_InitVars = { ACTOR_BG_HIDAN_FIREWALL, @@ -45,7 +45,7 @@ static ColliderCylinderInit cylinderInitData = { 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x01, 0x00, 0x001E, 0x0053, - 0x00000000000000000000, + 0x0000, }; static Sub98Init4 actor98InitData = { @@ -91,7 +91,7 @@ void BgHidanFirewall_Destroy(BgHidanFirewall* this, GlobalContext* globalCtx) { ActorCollider_FreeCylinder(globalCtx, &this->collider); } -s32 BgHidanFirewall_Proximity(BgHidanFirewall* this, GlobalContext* globalCtx) { +s32 BgHidanFirewall_CheckProximity(BgHidanFirewall* this, GlobalContext* globalCtx) { Player* player; Vec3f distance; @@ -105,7 +105,7 @@ s32 BgHidanFirewall_Proximity(BgHidanFirewall* this, GlobalContext* globalCtx) { } void BgHidanFirewall_Wait(BgHidanFirewall* this, GlobalContext* globalCtx) { - if (BgHidanFirewall_Proximity(this, globalCtx) != 0) { + if (BgHidanFirewall_CheckProximity(this, globalCtx) != 0) { this->actor.draw = BgHidanFirewall_Draw; this->actor.params = 5; this->actionFunc = (ActorFunc)BgHidanFirewall_Countdown; @@ -123,7 +123,7 @@ void BgHidanFirewall_Countdown(BgHidanFirewall* this, GlobalContext* globalCtx) } void BgHidanFirewall_Erupt(BgHidanFirewall* this, GlobalContext* globalCtx) { - if (BgHidanFirewall_Proximity(this, globalCtx) != 0) { + if (BgHidanFirewall_CheckProximity(this, globalCtx) != 0) { Math_ApproxF(&this->actor.scale.y, 0.1f, 0.01f/0.4f); } else { if (Math_ApproxF(&this->actor.scale.y, 0.01f, 0.01f) != 0) { @@ -143,7 +143,7 @@ void BgHidanFirewall_Collide(BgHidanFirewall* this, GlobalContext* globalCtx) { } else { phi_a3 = this->actor.shape.rot.y + 0x8000; } - func_8002F71C(globalCtx, this, 5.0f, phi_a3, 1.0f); + func_8002F71C(globalCtx, &this->actor, 5.0f, phi_a3, 1.0f); } void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, GlobalContext* globalCtx) { @@ -214,14 +214,14 @@ void BgHidanFirewall_Draw(BgHidanFirewall* this, GlobalContext* globalCtx) { Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_hidan_firewall.c", 448); gfxCtx->polyXlu.p = Gfx_CallSetupDL(gfxCtx->polyXlu.p, 0x14); - temp = &D_80886D04; + temp = D_80886D04; gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(temp[this->unk_150])); gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0x01, 0xFF, 0xFF, 0x00, 0x96); gDPSetEnvColor(gfxCtx->polyXlu.p++, 0xFF, 0x00, 0x00, 0xFF); gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_hidan_firewall.c", 458), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(gfxCtx->polyXlu.p++, &D_0600DA80); + gSPDisplayList(gfxCtx->polyXlu.p++, D_0600DA80); Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_hidan_firewall.c", 463); } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h index 588345099a..2d994d8416 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h @@ -4,10 +4,7 @@ #include #include -struct BgHidanFirewall; - -typedef struct BgHidanFirewall -{ +typedef struct BgHidanFirewall { /* 0x0000 */ Actor actor; /* 0x014C */ ActorFunc actionFunc; /* 0x0150 */ s16 unk_150; From 2bf2cef35e2ff2dc9b994ecac80037ca3aa38aa3 Mon Sep 17 00:00:00 2001 From: chandler Date: Tue, 7 Apr 2020 11:51:12 -0400 Subject: [PATCH 14/14] small change in firewall.h --- src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h index 2d994d8416..32cc66c10f 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h +++ b/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h @@ -4,7 +4,7 @@ #include #include -typedef struct BgHidanFirewall { +typedef struct { /* 0x0000 */ Actor actor; /* 0x014C */ ActorFunc actionFunc; /* 0x0150 */ s16 unk_150;