From 69b8c9ba6d6c0c6ccbc4de5db1615d570a7dcb91 Mon Sep 17 00:00:00 2001 From: Yanis <35189056+Yanis002@users.noreply.github.com> Date: Thu, 18 Jun 2026 02:33:18 +0200 Subject: [PATCH] Add struct members for `Actor_9C` (#86) --- include/Actor/Actor.hpp | 10 +++++++++- include/Actor/ActorHeart.hpp | 6 ------ include/Actor/ActorItemDrop.hpp | 6 ------ include/Actor/ActorRupee.hpp | 7 ------- src/031_Land/Actor/ActorHeart.cpp | 14 +++++++------- src/031_Land/Actor/ActorItemDrop.cpp | 22 ++++++++++------------ src/031_Land/Actor/ActorRupee.cpp | 18 +++++++++--------- 7 files changed, 35 insertions(+), 48 deletions(-) diff --git a/include/Actor/Actor.hpp b/include/Actor/Actor.hpp index 805179ff..c666377d 100644 --- a/include/Actor/Actor.hpp +++ b/include/Actor/Actor.hpp @@ -110,7 +110,15 @@ struct ActorGrabParams { class Actor_9C { public: /* 00 (vtable) */ - /* 04 */ + /* 04 */ unk32 mUnk_04; + /* 08 */ unk32 mUnk_08; + /* 0C */ ActorRef mUnk_0C; + /* 10 */ unk32 mUnk_10; + /* 14 */ unk32 mUnk_14; + /* 18 */ unk32 mUnk_18; + /* 1C */ u16 mUnk_1C; + /* 1E */ u16 mUnk_1E; + /* 20 */ /* 00 */ virtual void vfunc_00(); // corresponds to func_ov000_02097c14 /* 04 */ virtual void vfunc_04(); // corresponds to func_ov000_02097c20 diff --git a/include/Actor/ActorHeart.hpp b/include/Actor/ActorHeart.hpp index 5515b52a..944f748a 100644 --- a/include/Actor/ActorHeart.hpp +++ b/include/Actor/ActorHeart.hpp @@ -31,12 +31,6 @@ public: /* 94 */ u16 mUnk_94; /* 96 */ u16 mUnk_96; /* 98 */ Actor_9C mUnk_98; - /* 9C */ unk32 mUnk_9C; - /* A0 */ unk32 mUnk_A0; - /* A4 */ unk32 mUnk_A4; - /* A8 */ STRUCT_PAD(0xA8, 0xB4); - /* B4 */ unk16 mUnk_B4; - /* B6 */ STRUCT_PAD(0xB6, 0xB8); /* B8 */ s16 mUnk_B8; /* BA */ unk16 mUnk_BA; /* BC */ unk16 mUnk_BC; diff --git a/include/Actor/ActorItemDrop.hpp b/include/Actor/ActorItemDrop.hpp index 242a2328..bc2bd755 100644 --- a/include/Actor/ActorItemDrop.hpp +++ b/include/Actor/ActorItemDrop.hpp @@ -49,11 +49,6 @@ public: /* 0B0 */ u16 mUnk_B0; /* 0B2 */ STRUCT_PAD(0xB2, 0xB4); /* 0B4 */ Actor_9C mUnk_B4; - /* 0B8 */ unk32 mUnk_B8; - /* 0BC */ unk32 mUnk_BC; - /* 0C0 */ ActorRef mUnk_C0; - /* 0C4 */ STRUCT_PAD(0x0C4, 0x0D0); - /* 0D0 */ u16 mUnk_D0; /* 0D4 */ ItemDropType mItemTypeId; /* 0D8 */ fx32 mUnk_D8; /* 0DC */ ActorRef mUnk_DC; @@ -80,7 +75,6 @@ public: /* 2C */ virtual void vfunc_2C(unk32 param1) override; /* 20 */ virtual void vfunc_20() override; /* 24 */ virtual void vfunc_24() override; - /* 4C */ virtual ~ActorItemDrop() override; void func_ov031_020fa260(); void SetState(ActorState state); diff --git a/include/Actor/ActorRupee.hpp b/include/Actor/ActorRupee.hpp index 7d9345b2..1ede94ef 100644 --- a/include/Actor/ActorRupee.hpp +++ b/include/Actor/ActorRupee.hpp @@ -54,13 +54,6 @@ public: /* 98 */ u16 mUnk_98; /* 9A */ u16 mUnk_9A; /* 9C */ Actor_9C mUnk_9C; - /* A0 */ unk32 mUnk_A0; - /* A4 */ unk32 mUnk_A4; - /* A8 */ unk32 mUnk_A8; - /* AC */ unk32 mUnk_AC; - /* B0 */ unk32 mUnk_B0; - /* B4 */ unk32 mUnk_B4; - /* B8 */ unk32 mUnk_B8; /* BC */ ActorRef mUnk_BC; /* C0 */ ActorRef mUnk_C0; /* C4 */ ActorRupee_C4 mUnk_C4; diff --git a/src/031_Land/Actor/ActorHeart.cpp b/src/031_Land/Actor/ActorHeart.cpp index 93781ac4..ac93871f 100644 --- a/src/031_Land/Actor/ActorHeart.cpp +++ b/src/031_Land/Actor/ActorHeart.cpp @@ -80,8 +80,8 @@ ARM ActorHeart::ActorHeart() : this->mUnk_EC.y = FLOAT_TO_FX32(0.0); this->mUnk_EC.z = FLOAT_TO_FX32(0.0); - this->mUnk_9C = 0x13100; - this->mUnk_40 = &this->mUnk_C8; + this->mUnk_98.mUnk_04 = 0x13100; + this->mUnk_40 = &this->mUnk_C8; u16 sp0; func_01ffedac(&sp0, &this->mPos); @@ -169,11 +169,11 @@ void ActorHeart::vfunc_20() { } } - if (!(this->mUnk_A0 & 0x3FFFF)) { - unk16 var = this->mUnk_B4; + if (!(this->mUnk_98.mUnk_08 & 0x3FFFF)) { + unk16 var = this->mUnk_98.mUnk_1C; if (var != 0x8 && var == 0xC) { - this->mUnk_C0 = this->mUnk_A4; - this->mUnk_9C &= ~0x1000; + this->mUnk_C0 = this->mUnk_98.mUnk_0C; + this->mUnk_98.mUnk_04 &= ~0x1000; } } } @@ -313,7 +313,7 @@ ARM void ActorHeart::func_ov031_020ef3d0() { this->mVel.y = FLOAT_TO_FX32(0.0); this->mVel.z = FLOAT_TO_FX32(0.0); - this->mUnk_9C |= 0x1000; + this->mUnk_98.mUnk_04 |= 0x1000; this->SetState(ActorHeartState_1); } diff --git a/src/031_Land/Actor/ActorItemDrop.cpp b/src/031_Land/Actor/ActorItemDrop.cpp index fdbbc330..fcadaac1 100644 --- a/src/031_Land/Actor/ActorItemDrop.cpp +++ b/src/031_Land/Actor/ActorItemDrop.cpp @@ -162,8 +162,8 @@ ARM ActorItemDrop::ActorItemDrop() : break; } - this->mUnk_B8 = 0x13100; - this->mUnk_40 = &this->mUnk_E4; + this->mUnk_B4.mUnk_04 = 0x13100; + this->mUnk_40 = &this->mUnk_E4; u16 sp0; func_01ffedac(&sp0, &this->mPos); @@ -212,28 +212,28 @@ ARM void ActorItemDrop::func_ov031_020fa260() { if (this->IsTimerOut()) { this->func_ov000_020989e0(); - if (this->mUnk_BC & 0x3FFFF) { - switch (this->mUnk_D0) { + if (this->mUnk_B4.mUnk_08 & 0x3FFFF) { + switch (this->mUnk_B4.mUnk_1C) { case 8: case 16: if (this->mUnk_119) { bool var_r1_3 = false; - if (this->mUnk_C0.type_index == 0x100 && this->mUnk_C0.unk_id == 0) { + if (this->mUnk_B4.mUnk_0C.type_index == 0x100 && this->mUnk_B4.mUnk_0C.unk_id == 0) { var_r1_3 = true; } - if (var_r1_3 || (this->mUnk_C0.type_index == 0x100 && this->mUnk_C0.unk_id == 1 && + if (var_r1_3 || (this->mUnk_B4.mUnk_0C.type_index == 0x100 && this->mUnk_B4.mUnk_0C.unk_id == 1 && data_027e0ce0->func_01fff1e0())) { this->SetState(ActorItemDropState_6); } - } else if (this->mUnk_C0.type_index & 0x100) { + } else if (this->mUnk_B4.mUnk_0C.type_index & 0x100) { this->SetState(ActorItemDropState_6); } break; case 12: - this->mUnk_DC = this->mUnk_C0; - this->mUnk_B8 &= ~0x1000; + this->mUnk_DC = this->mUnk_B4.mUnk_0C; + this->mUnk_B4.mUnk_04 &= ~0x1000; this->SetState(ActorItemDropState_3); break; default: @@ -373,7 +373,7 @@ ARM void ActorItemDrop::func_ov031_020fa5f0() { this->mVel.x = FLOAT_TO_FX32(0.0f); this->mVel.y = FLOAT_TO_FX32(0.0f); this->mVel.z = FLOAT_TO_FX32(0.0f); - this->mUnk_B8 |= 0x1000; + this->mUnk_B4.mUnk_04 |= 0x1000; this->SetState(ActorItemDropState_1); } } @@ -556,5 +556,3 @@ ARM void ActorItemDrop_C4::vfunc_08() { this->GetActorPtr()->SetState(ActorItemDropState_6); Actor_C4::vfunc_08(); } - -ARM ActorItemDrop::~ActorItemDrop() {} diff --git a/src/031_Land/Actor/ActorRupee.cpp b/src/031_Land/Actor/ActorRupee.cpp index cf3e860c..56af174b 100644 --- a/src/031_Land/Actor/ActorRupee.cpp +++ b/src/031_Land/Actor/ActorRupee.cpp @@ -60,8 +60,8 @@ ARM ActorRupee::ActorRupee() : mUnk_E8(0), mUnk_F0(0), mUnk_F4(false) { - this->mUnk_A0 = 0x13100; - this->mUnk_40 = &this->mUnk_C4; + this->mUnk_9C.mUnk_04 = 0x13100; + this->mUnk_40 = &this->mUnk_C4; } // https://decomp.me/scratch/wunA4 @@ -342,7 +342,7 @@ ARM void ActorRupee::func_ov031_020e9450() { this->mVel.x = 0; this->mVel.y = 0; this->mVel.z = 0; - this->mUnk_A0 |= 0x1000; + this->mUnk_9C.mUnk_04 |= 0x1000; this->SetState(ActorRupeeState_0); } @@ -595,20 +595,20 @@ ARM void ActorRupee::vfunc_20() { this->func_ov000_020989e0(); uVar3 = uStack_18; - if ((this->mUnk_A4 & 0x3FFFF) != 0) { - sVar1 = *(short *) &this->mUnk_B8; + if ((this->mUnk_9C.mUnk_08 & 0x3FFFF) != 0) { + sVar1 = *(short *) &this->mUnk_9C.mUnk_1C; - switch (mUnk_B8) { + switch (this->mUnk_9C.mUnk_1C) { case 0x08: case 0x10: - if ((this->mUnk_A8 & 0x100) != 0) { + if ((this->mUnk_9C.mUnk_0C.type_index & 0x100) != 0) { this->func_ov031_020e9068(); uVar3 = uStack_18; } break; case 0x0C: - this->mUnk_BC = this->mUnk_A8; - this->mUnk_A0 &= 0xFFFFEFFF; + this->mUnk_BC = this->mUnk_9C.mUnk_0C; + this->mUnk_9C.mUnk_04 &= 0xFFFFEFFF; this->SetState(ActorRupeeState_6); uVar3 = uStack_18; break;