ActorType documentation, delink ActorManager_001 (#6)

* ActorUnk_ov000_0209767c -> ActorType

* ActorRupee instance

* ActorManager

* Delink ActorManager_001

* Fix build

* Document actor types

* Actor flags

* Fix build

* ActorSCCN
This commit is contained in:
Aetias
2025-08-24 16:59:13 +02:00
committed by GitHub
parent 9a9311a100
commit 758f36f10c
29 changed files with 874 additions and 676 deletions
+11 -11
View File
@@ -15,7 +15,7 @@ ARM Actor::Actor() {
this->mUnk_50 = 0;
this->mUnk_52 = 0;
this->mUnk_54 = 0;
this->mUnk_58 = 0;
this->mFlags = 0;
this->mUnk_84 = 0;
this->mUnk_5c.func_ov000_020975f8();
this->mUnk_8c = 0;
@@ -23,9 +23,9 @@ ARM Actor::Actor() {
data_ov000_020b539c.func_02028cdc(&this->mUnk_5c, 0x30);
this->mPrevPos = this->mPos = this->mUnk_5c.mUnk_00;
this->mAngle = this->mUnk_5c.mUnk_0c;
this->mUnk_58 = 0x400B;
this->mUnk_44 = 0xFF;
this->mUnk_46 = 0;
this->mFlags = (1 << ActorFlag_Alive) | (1 << ActorFlag_Visible) | (1 << ActorFlag_Active) | (1 << ActorFlag_14);
this->mUnk_44 = 0xFF;
this->mUnk_46 = 0;
this->func_ov000_0209862c(0);
this->func_ov000_0209848c(data_ov000_020b539c.mUnk_30);
}
@@ -66,9 +66,9 @@ ARM unk32 Actor::vfunc_34() {
}
ARM void Actor::func_ov000_020984d0() {
this->mUnk_58 &= ~1;
UNSET_FLAG(&this->mFlags, ActorFlag_Alive);
if (this->mUnk_58 & 0x10000) {
if (GET_FLAG(&this->mFlags, ActorFlag_16)) {
this->func_ov000_020984f0();
}
}
@@ -115,12 +115,12 @@ ARM unk32 Actor::vfunc_38(unk32 param1) {
var_r3 = param1 >> 16;
if (this->mUnk_58 & 0x100) {
if (GET_FLAG(&this->mFlags, ActorFlag_8)) {
return 0;
}
this->mUnk_58 |= 0x100;
stack_c = this->mUnk_58;
SET_FLAG(&this->mFlags, ActorFlag_8);
stack_c = this->mFlags;
switch (stack_c) {
case 0x100:
@@ -141,12 +141,12 @@ ARM unk32 Actor::vfunc_38(unk32 param1) {
// non-matching
ARM bool Actor::vfunc_3c(unk32 param2, Vec3p *param3) {
if (!(this->mUnk_58 & 0x100)) {
if (!GET_FLAG(&this->mFlags, ActorFlag_8)) {
return false;
}
this->mVel = *param3;
this->mUnk_58 &= ~0x100;
UNSET_FLAG(&this->mFlags, ActorFlag_8);
return true;
}
+19
View File
@@ -0,0 +1,19 @@
#include "Actor/ActorManager.hpp"
#include "Actor/ActorId.hpp"
#include "global.h"
static ActorId gActorTypeLookupTable[] = {
#define DEFINE_ACTOR_TYPE(id, name) ActorId_##name,
#include "Actor/ActorTypeTable.inl"
#undef DEFINE_ACTOR_TYPE
};
// static ActorTypeGetInstance gActorTypes[] = {
// #define DEFINE_ACTOR_TYPE(id, name) &ActorType##name::GetInstance,
// #include "Actor/ActorTypeTable.inl"
// #undef DEFINE_ACTOR_TYPE
// };
DTCM_BEGIN;
ActorManager *gActorManager;
DTCM_END;
@@ -1,6 +1,7 @@
#include "Actor/ActorUnk_ov000_020a8bb0.hpp"
#include "Unknown/UnkStruct_027e09b8.hpp"
#include "Unknown/UnkStruct_027e0cd8.hpp"
#include "flags.h"
#include "global.h"
ARM void ActorUnk_ov000_020a8bb0::func_ov000_020a8ae0(q20 param1) {
@@ -60,7 +61,7 @@ ARM ActorUnk_ov000_020a8bb0::~ActorUnk_ov000_020a8bb0() {}
ARM unk32 ActorUnk_ov000_020a8bb0::vfunc_18(unk32 param1) {
if (this->mUnk_70 == 0 && this->func_ov000_020a8dd0() != 0) {
this->mUnk_58 &= ~1;
UNSET_FLAG(&this->mFlags, ActorFlag_Alive);
}
if (this->mUnk_0b0 & 8) {
@@ -164,7 +165,7 @@ ARM void ActorUnk_ov000_020a8bb0::vfunc_60() {
}
ARM bool ActorUnk_ov000_020a8bb0::vfunc_64() {
return this->mUnk_58 & 0x400;
return GET_FLAG(&this->mFlags, ActorFlag_Interacting);
}
ARM void ActorUnk_ov000_020a8bb0::func_ov000_020a8ff4() {}
@@ -172,7 +173,7 @@ ARM void ActorUnk_ov000_020a8bb0::func_ov000_020a8ff4() {}
ARM void ActorUnk_ov000_020a8bb0::vfunc_6c() {}
ARM void ActorUnk_ov000_020a8bb0::vfunc_68() {
this->mUnk_58 &= ~0x400;
UNSET_FLAG(&this->mFlags, ActorFlag_Interacting);
this->func_ov000_020a9200();
this->vfunc_ac();
this->mUnk_0b0 &= ~0x01;
@@ -0,0 +1,20 @@
#include "Actor/ActorManager.hpp"
#include "global.h"
THUMB void ActorManager::Create() {}
THUMB ActorManager::ActorManager() {}
THUMB ActorManager::~ActorManager() {}
THUMB void ActorManager::func_ov001_020bafdc() {}
THUMB void ActorManager::func_ov001_020bb018(s32 param1) {}
THUMB void ActorManager::func_ov001_020bb414() {}
THUMB void ActorManager::func_ov001_020bb488() {}
THUMB void ActorManager::func_ov001_020bb548() {}
THUMB void ActorManager::func_ov001_020bb630() {}
THUMB void ActorManager::func_ov001_020bb6b0(s32 *param1) {}
THUMB bool ActorManager::func_ov001_020bb728(s32 param1) {}
THUMB void ActorManager::func_ov001_020bb7b0(s32 param1) {}
THUMB void ActorManager::func_ov001_020bb7f0() {}
THUMB void ActorManager::func_ov001_020bb824() {}
THUMB void ActorManager::func_ov001_020bb844() {}
THUMB void ActorManager::SetInstance(ActorManager *instance) {}
THUMB void ActorManager::ClearInstance() {}
+21 -21
View File
@@ -16,23 +16,23 @@ extern "C" unk32 func_ov031_0210af50(u16, unk32 *);
extern void func_ov031_0210b0e4(u16, unk32);
extern "C" unk32 func_ov031_020d9834(unk32 *);
extern UnkStruct_ov000_020b539c_30 data_ov031_021166e8;
extern ActorTypeRupee ActorTypeRupee::gInstance;
extern unk32 *data_027e0d34;
ARM UnkStruct_ov000_020b539c_30 *ActorRupee::func_ov031_020e8cb8() {
return &data_ov031_021166e8;
ARM ActorTypeRupee *ActorTypeRupee::GetInstance() {
return &ActorTypeRupee::gInstance;
}
ARM Actor *ActorRupeeBase::Create() {
ARM Actor *ActorTypeRupee::Create() {
return new(2, 4) ActorRupee();
}
ARM ActorRupeeBase::ActorRupeeBase() :
ActorUnk_ov000_0209767c(ActorId_Rupee) {
this->mUnk_04 = 0;
this->mUnk_08 = 0x556;
this->mUnk_0c = 0;
this->mUnk_10 = 0x556;
ARM ActorTypeRupee::ActorTypeRupee() :
ActorType(ActorId_Rupee) {
this->mData.mUnk_00 = 0;
this->mData.mUnk_04 = 0x556;
this->mData.mUnk_08 = 0;
this->mData.mUnk_0c = 0x556;
}
// non-matching
@@ -111,7 +111,7 @@ ARM void ActorRupee::func_ov031_020e9108() {
this->mVel.x = gRandom.Next(-0xCD, 0x19B);
this->mVel.y = gRandom.Next(0, 0x19A);
this->mVel.z = gRandom.Next(-0xCD, 0x19B);
this->mUnk_58 |= 0x02;
SET_FLAG(&this->mFlags, ActorFlag_Visible);
}
ARM void ActorRupee::func_ov031_020e91a8() {
@@ -141,7 +141,7 @@ ARM void ActorRupee::func_ov031_020e9234() {
this->mVel.x = 0;
this->mVel.y = 0;
this->mVel.z = 0;
this->mUnk_58 |= 0x02;
SET_FLAG(&this->mFlags, ActorFlag_Visible);
}
ARM void ActorRupee::func_ov031_020e9254() {
@@ -236,11 +236,11 @@ ARM void ActorRupee::func_ov031_020e9438() {
}
ARM void ActorRupee::func_ov031_020e9450() {
this->func_ov017_020bf9c8(data_027e0ce4->func_01fff3b4(this->mUnk_bc));
this->func_ov017_020bf9c8(gActorManager->func_01fff3b4(this->mUnk_bc));
this->mPrevPos = this->mPos;
Vec3p_Add(&this->mPos, &this->mVel, &this->mPos);
if (!(this->mUnk_58 & 0x20)) {
if (!GET_FLAG(&this->mFlags, ActorFlag_5)) {
return;
}
@@ -260,7 +260,7 @@ ARM void ActorRupee::func_ov031_020e94d4() {
this->mUnk_4a = 0;
this->mUnk_44 = 0;
this->mUnk_9c.func_ov000_02097bec();
this->mUnk_58 &= ~0x02;
UNSET_FLAG(&this->mFlags, ActorFlag_Visible);
}
ARM void ActorRupee::func_ov031_020e951c() {
@@ -310,7 +310,7 @@ ARM void ActorRupee::func_ov031_020e95b0() {
ARM void ActorRupee::func_ov031_020e95c0() {
ActorUnk_ov000_020a8bb0 *temp_r0;
temp_r0 = data_027e0ce4->func_01fff3b4(this->mUnk_c0);
temp_r0 = gActorManager->func_01fff3b4(this->mUnk_c0);
if (temp_r0 == NULL) {
this->func_ov031_020e9904(0);
return;
@@ -334,7 +334,7 @@ ARM void ActorRupee::func_ov031_020e9638() {
this->mVel.x = 0;
this->mVel.y = 0;
this->mVel.z = 0;
this->mUnk_58 &= ~0x02;
UNSET_FLAG(&this->mFlags, ActorFlag_Visible);
this->mUnk_c4.mUnk_04 = 0;
if (this->mUnk_6e == 2) {
@@ -364,7 +364,7 @@ ARM void ActorRupee::func_ov031_020e970c() {
this->mVel.x = 0;
this->mVel.y = 0;
this->mVel.z = 0;
this->mUnk_58 |= 0x02;
SET_FLAG(&this->mFlags, ActorFlag_Visible);
this->mUnk_4a = 1;
this->mUnk_52 = -1;
this->mUnk_50 = 0;
@@ -664,7 +664,7 @@ ARM void ActorRupee::func_ov031_020e9d94() {
u32 temp_r1;
if (this->func_ov031_020e9e5c()) {
this->mUnk_58 |= 2;
SET_FLAG(&this->mFlags, ActorFlag_Visible);
return;
}
@@ -689,9 +689,9 @@ ARM void ActorRupee::func_ov031_020e9d94() {
temp_r1 = temp_r0 >> 0x1F;
if ((this->mUnk_94 & 7) < 4) {
this->mUnk_58 &= ~2;
UNSET_FLAG(&this->mFlags, ActorFlag_Visible);
} else {
this->mUnk_58 |= 2;
SET_FLAG(&this->mFlags, ActorFlag_Visible);
}
if (this->mUnk_94 < this->mUnk_96) {
+4 -4
View File
@@ -1,6 +1,7 @@
#include <string.h>
#include "Actor/ActorId.hpp"
#include "Actor/ActorManager.hpp"
#include "Player/PlayerGet.hpp"
#include "System/OverlayManager.hpp"
#include "Unknown/UnkStruct_020d8698.hpp"
@@ -8,7 +9,6 @@
#include "Unknown/UnkStruct_027e09b8.hpp"
#include "Unknown/UnkStruct_027e09bc.hpp"
#include "Unknown/UnkStruct_027e0cd8.hpp"
#include "Unknown/UnkStruct_027e0ce4.hpp"
#include "Unknown/UnkStruct_027e0ce8.hpp"
#include "Unknown/UnkStruct_027e0cec.hpp"
#include "Unknown/UnkStruct_ov000_02067bc4.hpp"
@@ -349,14 +349,14 @@ ARM void PlayerGet::vfunc_0c(UnkStruct_PlayerGet_vfunc_0c_param1 *param1) {
return;
}
iVar10 = data_027e0ce4->func_01fff3b4(*(u32 *) this->mUnk_54.mUnk_00);
iVar10 = gActorManager->func_01fff3b4(*(u32 *) this->mUnk_54.mUnk_00);
if (iVar10 == 0) {
return;
}
if (iVar10->func_01fff458() == ActorId_NormalShield) {
iVar10->mUnk_58 &= ~2;
UNSET_FLAG(&(iVar10->mFlags), ActorFlag_Visible);
iVar10->mUnk_4a = 0;
}
break;
@@ -635,7 +635,7 @@ ARM void PlayerGet::vfunc_10(unk32 param1) {
this->mUnk_30->func_ov000_020936ec();
if (((*(u16 *) this->mUnk_54.mUnk_00 << 0x10) >> 0x1E) == 1) {
temp_r0_3 = data_027e0ce4->func_01fff3b4(*(u32 *) this->mUnk_54.mUnk_00);
temp_r0_3 = gActorManager->func_01fff3b4(*(u32 *) this->mUnk_54.mUnk_00);
if ((temp_r0_3 != NULL) && (temp_r0_3->func_01fff458() == ActorId_NormalShield)) {
if (this->func_ov110_02186b8c()) {
this->mUnk_28->pItemManager->mUnk_12 ^= 2;