Delink and match sections of overlay 063 actors (#137)

* feat: Add .data to RMSX actors

* fix: Fix bad regressions

* feat: Add struct and improve RMSD matching

* feat: Move RMSX base class to the right file

* feat: Delink vtable and update symbols

* feat: Match .data and improve ActorUnkRMSBase

* feat: Update ActorUnkRSMBase ctor and match ActorUnkRMSW

* fix: Fix outdated initialization

* feat: Match RMSV ctor

* feat: Match more vfunc

* feat: Match more vfunc and some cleanup

* chore: Clean headers

* feat: Reorder funcs, add unk structs

* feat: Move RMSBase to a separate file and flag as complete

* feat: Complete some actors

* feat: Add data to RBLS, almost match the actor

* feat: Add eur data for CANS

* feat: Reorder CANS functions, sync data for jp

* feat: Reorder CASE functions

* feat: Update global func call to member func call
This commit is contained in:
Mityno
2026-08-21 14:20:59 +00:00
committed by GitHub
parent 347ac5860d
commit 2d4deebb84
33 changed files with 671 additions and 670 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ ActorUnkEFSB::ActorUnkEFSB() :
bool ActorUnkEFSB::vfunc_18(unk32 param1) {
this->mUnk_0F8.vfunc_1C(data_ov031_02114ed0[0], 0x1000, 0x11F, 0x0);
this->mUnk_154.func_ov000_02099f8(data_ov031_02114ed0[0], 0x1000);
this->mUnk_154.func_ov000_02099ff8(data_ov031_02114ed0[0], 0x1000);
this->mUnk_1B0 = this->mUnk_5C.mParams[0] << 0xC;
if (this->mUnk_1B0 == 0) {
+124 -121
View File
@@ -6,7 +6,6 @@
#include "Actor/ActorRef.hpp"
#include "Actor/ActorShotArrow.hpp"
#include "Actor/ActorUnkCASE.hpp"
#include "Actor/ActorUnkZLSL_ZSRS.hpp"
#include "Map/MapObjectId.hpp"
#include "MapObject/MapObject.hpp"
#include "MapObject/MapObjectManager.hpp"
@@ -33,20 +32,6 @@ extern const char data_ov063_02162528[0x10]; // = "mCANS1";
extern const char data_ov063_02162538[0x10]; // = "Rarm1";
extern const char data_ov063_02162548[0x10]; // = "locator1";
static PTMF<ActorUnkCANS> data_ov063_02162fb0[0xA] = {
ActorUnkCANS::func_ov063_02158db0, ActorUnkCANS::func_ov063_02159100, ActorUnkCANS::func_ov063_02159258,
ActorUnkCANS::func_ov063_02159494, ActorUnkCANS::func_ov063_02159618, ActorUnkCANS::func_ov063_02159784,
ActorUnkCANS::func_ov063_021599e4, ActorUnkCANS::func_ov063_02159d68, ActorUnkCANS::func_ov063_02159e1c,
ActorUnkCANS::func_ov063_02159ec0,
};
static PTMF<ActorUnkCANS> data_ov063_02162f58[0xA] = {
ActorUnkCANS::func_ov063_02158d40, ActorUnkCANS::func_ov063_021590c8, ActorUnkCANS::func_ov063_021591f4,
ActorUnkCANS::func_ov063_02159408, ActorUnkCANS::func_ov063_021595a4, ActorUnkCANS::func_ov063_02159714,
ActorUnkCANS::func_ov063_021598fc, ActorUnkCANS::func_ov063_02159ca8, ActorUnkCANS::func_ov063_02159dfc,
ActorUnkCANS::func_ov063_02159e20,
};
/* Contains a string somewhere with info such as "attack" or "guard" */
extern ActorUnkZLSL_AnimationTag data_ov063_02163068; // = {0, 0x6B6C6177, 0x41, 0, 0, 0};
extern ActorUnkZLSL_AnimationTag data_ov063_02163080;
@@ -56,12 +41,6 @@ extern ActorUnkZLSL_AnimationTag data_ov063_021630b0;
extern VecFx32 data_027e07d4;
extern Mat4x3p data_027e0964;
extern UnkStruct_027e09c0 *data_027e09c0;
extern u16 data_ov000_020aed00;
extern u16 data_ov000_020aecf0[0x4];
extern u16 data_ov000_020aecf4[0x4]; //! INFO: Unsure about the size
extern unk32 data_ov000_020aecf8[0x2]; //! INFO: Unsure about the size
extern unk32 data_ov000_020aecfc[0x2]; //! INFO: Unsure about the size
extern Cylinder data_ov063_02162e90;
extern "C" void func_01ff916c(unk32 *param1, unk32 param2, unk32 param3);
extern "C" unk32 func_01ff9258(unk32, unk32);
@@ -74,7 +53,14 @@ extern "C" void func_01ffb714(VecFx32 *, VecFx32 *, VecFx32 *);
extern "C" unk32 func_01ffbbe0(unk32 param1, unk32 param2);
extern "C" void func_01ffc6d4(ModelRender *param1, UnkAngleStruct param2, VecFx32 *param3);
extern "C" void func_0200eab0(G3d_Model *, unk32, u8);
extern "C" void func_ov000_020578a4(UnkSystem5 *param1, unk32 param2, unk32 param3);
// Overlay 0
extern u16 data_ov000_020aed00;
extern u16 data_ov000_020aecf0[0x4];
extern u16 data_ov000_020aecf4[0x4]; //! INFO: Unsure about the size
extern unk32 data_ov000_020aecf8[0x2]; //! INFO: Unsure about the size
extern unk32 data_ov000_020aecfc[0x2]; //! INFO: Unsure about the size
extern "C" void func_ov000_02057c98(ModelRender *param1, UnkSystem5 *param2);
#if IS_JP
extern "C" unk32 func_ov000_0205c384(VecFx32 *param1, VecFx32 *param2);
@@ -86,20 +72,40 @@ extern "C" unk32 func_ov000_02098d7c(ActorUnkCANS *param1, UnkStruct_ov063_02162
extern "C" unk32 func_ov000_02099450(ActorUnkCANS *param1, void *param2, VecFx32 *param3, unk32 param4, u16 param5);
extern "C" void func_ov000_020994a0(ActorUnkCANS *);
extern "C" unk32 func_ov000_02099a0c(void *param1);
// Overlay 17
extern "C" void func_ov017_020bf050(ActorUnkCANS *param1, UnkStruct_ov063_02162e88 *param2, unk32 param3);
extern "C" void func_ov017_020bf178(ActorUnkCANS *param1, UnkStruct_ov063_02162e88 *param2, unk32 param3);
extern "C" void func_ov017_020bf634(ActorUnkCANS *param1, unk16 *param2, unk32 param3, unk32 param4);
extern "C" void func_ov017_020bf688(ActorUnkCANS *param1);
extern "C" void func_ov017_020bf894(ActorUnkCANS *param1, void *param2);
extern "C" unk32 func_ov017_020bef4c(ActorUnkCANS *param1, unk32 param2);
// Overlay 26
#if IS_JP
extern "C" void func_ov026_020f46a8(Actor *param1, VecFx32 *param2, bool param3);
#endif
extern "C" void G3d_GetCurrentMtx(Mat4x3p *mtx1, Mat3p *mtx2);
const Cylinder data_ov063_02162e90(0, 0x99A, 0, 0x99A);
DECL_PROFILE(ActorProfileUnkCANS);
static PTMF<ActorUnkCANS> data_ov063_02162f58[0xB] = {
ActorUnkCANS::func_ov063_02158b34, ActorUnkCANS::func_ov063_02158d40, ActorUnkCANS::func_ov063_021590c8,
ActorUnkCANS::func_ov063_021591f4, ActorUnkCANS::func_ov063_02159408, ActorUnkCANS::func_ov063_021595a4,
ActorUnkCANS::func_ov063_02159714, ActorUnkCANS::func_ov063_021598fc, ActorUnkCANS::func_ov063_02159ca8,
ActorUnkCANS::func_ov063_02159dfc, ActorUnkCANS::func_ov063_02159e20,
};
static PTMF<ActorUnkCANS> data_ov063_02162fb0[0xB] = {
ActorUnkCANS::func_ov063_02158b98, ActorUnkCANS::func_ov063_02158db0, ActorUnkCANS::func_ov063_02159100,
ActorUnkCANS::func_ov063_02159258, ActorUnkCANS::func_ov063_02159494, ActorUnkCANS::func_ov063_02159618,
ActorUnkCANS::func_ov063_02159784, ActorUnkCANS::func_ov063_021599e4, ActorUnkCANS::func_ov063_02159d68,
ActorUnkCANS::func_ov063_02159e1c, ActorUnkCANS::func_ov063_02159ec0,
};
Actor *ActorProfileUnkCANS::Create() {
return new(HeapIndex_2) ActorUnkCANS();
}
@@ -111,64 +117,12 @@ ActorProfileUnkCANS::ActorProfileUnkCANS() :
mUnk_04.size = 0xCCD;
}
UnkStruct_ov063_02162ea8::UnkStruct_ov063_02162ea8() {
VecFx32_Init(0, 0, 0, &mUnk_08);
}
UnkStruct_ov063_02162ea8::~UnkStruct_ov063_02162ea8() {}
bool UnkStruct_ov063_02162ea8::vfunc_08(UnkStruct_ov031_020f3310 *param1) {
bool retVal = UnkStruct_ov031_Items_00::vfunc_08(param1);
if (retVal && func_01ff9258(param1->mUnk_08.x, param1->mUnk_08.z) > 0) {
// VecFx16_Copy2VecFx32(&param1->mUnk_08, &mUnk_08);
// Better match
unk16 tmp1 = param1->mUnk_08.x;
unk16 tmp3 = param1->mUnk_08.z;
unk16 tmp2 = param1->mUnk_08.y;
mUnk_08.x = tmp1;
mUnk_08.y = tmp2;
mUnk_08.z = tmp3;
}
return retVal;
}
bool UnkStruct_ov063_02162ea8::vfunc_0C(const UnkStruct_ov031_020e54d4 *param1, unk32 *param2, unk32 param3) {
UnkStruct_02162ea8_vfunc_0C *param2Struct = (UnkStruct_02162ea8_vfunc_0C *) param2;
if ((*(u16 *) &param2Struct->mUnk_04 & 0x1000) != 0) {
UnkStruct_02162ea8_vfunc_0C tmp;
tmp.mUnk_04 = *(volatile unk32 *) &param2Struct->mUnk_04;
Vec2bCpp vec;
*(unk32 *) &vec = tmp.mUnk_04;
MapObject *mapObject = gpMapObjManager->func_01fff498(vec);
if (mapObject != NULL) {
MapObjectId id = mapObject->GetMapObjectId();
if (id == MapObjectId_Grass || id == MapObjectId_LEVS || id == MapObjectId_STSH) {
return false;
}
}
}
return UnkStruct_027e0ce0_38_Base::vfunc_0C((const UnkStruct_ov031_020e54d4 *) param2Struct->mUnk_04, param2,
param2Struct->mUnk_04);
}
UnkStruct_ov063_02162ee8::UnkStruct_ov063_02162ee8(G3d_Model *pModel) :
UnkStruct_ov000_020b3268(pModel),
mUnk_6C(ModelRenderBase::func_ov000_02057f40(data_ov063_02162528)),
mUnk_70(ModelRenderBase::func_ov000_02057f18(data_ov063_02162538)),
mUnk_74(ModelRenderBase::func_ov000_02057f18(data_ov063_02162548)) {}
void UnkStruct_ov063_02162f14::vfunc_38(unk32 param1, unk32 param2) {
func_ov000_020578a4(mUnk_04, param1, param2);
func_ov000_020578a4(mUnk_1C, param1, param2);
}
void UnkStruct_ov063_02162f14::vfunc_3C() {
mUnk_08->func_ov000_02057c98(mUnk_04);
mUnk_08->func_ov000_02057c98(mUnk_1C);
}
UnkStruct_ov063_02162e88::UnkStruct_ov063_02162e88(void *param1) :
mUnk_20(param1) {}
@@ -234,22 +188,7 @@ ActorUnkCANS::ActorUnkCANS() :
mUnk_270 *= mUnk_276;
}
void ActorUnkCANS::vfunc_10(Cylinder *param1) {
Cylinder *cylinder = this->mUnk_34;
*param1 = *cylinder;
VecFx32_Add(&param1->pos, &this->mPos, &param1->pos);
if (this->mUnk_268 != NULL) {
fx16 angle = this->mAngle;
VecFx32 pos;
VecFx32_Init(FLOAT_TO_FX32(0.25f), 0, 0, &pos);
func_01ff9638(&pos, angle);
VecFx32_Add(&param1->pos, &pos, &param1->pos);
}
}
// return bool ?
unk32 ActorUnkCANS::vfunc_18(void) {
bool ActorUnkCANS::vfunc_18(unk32 param1) {
this->mUnk_0B0.func_ov000_02057c38(6, 2);
this->mUnk_0B0.func_ov000_0209a7b8(this, (UnkSystem4_UnkCallback) ActorUnkCANS::func_ov063_0215a678);
@@ -259,7 +198,7 @@ unk32 ActorUnkCANS::vfunc_18(void) {
ActorUnkCASE::func_ov063_0215acec(&var, this->mRef);
this->mUnk_268 = (ActorUnkCASE *) actorManager->func_01fff3b4(var);
return 1;
return true;
}
void ActorUnkCANS::vfunc_1C(void) {
@@ -287,6 +226,32 @@ void ActorUnkCANS::vfunc_1C(void) {
this->func_ov063_02158448(0);
}
void ActorUnkCANS::func_ov063_02158424(void) {
mUnk_274 = 0;
if (mState == 6) {
mUnk_23A = 0x14;
mUnk_238 = 0;
}
}
void ActorUnkCANS::func_ov063_02158448(unk32 param1) {
this->func_ov063_02158424();
mState = param1;
CALL_PTMF(PTMF<ActorUnkCANS>, data_ov063_02162f58[mState]);
}
void ActorUnkCANS::func_ov063_02158490(void) {
mUnk_48 -= mUnk_200.mUnk_1E;
func_ov017_020bf050(this, &mUnk_200, 1);
this->func_ov063_02158448(2);
}
void ActorUnkCANS::vfunc_24(void) {
if (data_027e09b8->HasAdventureFlag(AdventureFlag_VisitedIslandSanctuaryFirstTime)) {
this->vfunc_20();
}
}
void ActorUnkCANS::vfunc_20(void) {
if (mUnk_238 < mUnk_23A) {
mUnk_238++;
@@ -490,12 +455,6 @@ void ActorUnkCANS::vfunc_20(void) {
}
}
void ActorUnkCANS::vfunc_24(void) {
if (data_027e09b8->HasAdventureFlag(AdventureFlag_VisitedIslandSanctuaryFirstTime)) {
this->vfunc_20();
}
}
void ActorUnkCANS::vfunc_2C(unk32 param1) {
if (!this->func_01fff5d0(param1, 0)) {
return;
@@ -516,31 +475,11 @@ void ActorUnkCANS::vfunc_2C(unk32 param1) {
}
}
void ActorUnkCANS::func_ov063_02158424(void) {
mUnk_274 = 0;
if (mState == 6) {
mUnk_23A = 0x14;
mUnk_238 = 0;
}
}
void ActorUnkCANS::func_ov063_02158448(unk32 param1) {
this->func_ov063_02158424();
mState = param1;
CALL_PTMF(PTMF<ActorUnkCANS>, data_ov063_02162f58[mState]);
}
void ActorUnkCANS::func_ov063_02158490(void) {
mUnk_48 -= mUnk_200.mUnk_1E;
func_ov017_020bf050(this, &mUnk_200, 1);
this->func_ov063_02158448(2);
}
void ActorUnkCANS::func_ov063_02158b0c(void) {
mUnk_268 = NULL;
((u16 *) mUnk_38)[4] = 1;
mUnk_34 = &data_ov063_02162e90;
mUnk_30 = &data_ov063_02162e90;
mUnk_34 = (Cylinder *) &data_ov063_02162e90;
mUnk_30 = (Cylinder *) &data_ov063_02162e90;
}
void ActorUnkCANS::func_ov063_02158b34(void) {
@@ -1189,6 +1128,20 @@ unk32 ActorUnkCANS::func_ov063_0215a5d8(void) {
return data_ov000_020aecfc[0];
}
void ActorUnkCANS::vfunc_10(Cylinder *param1) {
Cylinder *cylinder = this->mUnk_34;
*param1 = *cylinder;
VecFx32_Add(&param1->pos, &this->mPos, &param1->pos);
if (this->mUnk_268 != NULL) {
fx16 angle = this->mAngle;
VecFx32 pos;
VecFx32_Init(FLOAT_TO_FX32(0.25f), 0, 0, &pos);
func_01ff9638(&pos, angle);
VecFx32_Add(&param1->pos, &pos, &param1->pos);
}
}
void ActorUnkCANS::func_ov063_0215a678(ActorUnkCANS *actor, UnkStruct_func_ov063_0215a678 *param2) {
ModelRender *modelRender = param2->mUnk_04;
u8 var1;
@@ -1260,5 +1213,55 @@ void ActorUnkCANS::func_ov063_0215a678(ActorUnkCANS *actor, UnkStruct_func_ov063
}
}
ActorUnkCANS::~ActorUnkCANS() {}
ActorProfileUnkCANS::~ActorProfileUnkCANS() {}
UnkStruct_ov063_02162ea8::UnkStruct_ov063_02162ea8() {
VecFx32_Init(0, 0, 0, &mUnk_08);
}
UnkStruct_ov063_02162ea8::~UnkStruct_ov063_02162ea8() {}
bool UnkStruct_ov063_02162ea8::vfunc_08(const UnkStruct_ov031_020f3310 *param1) {
bool retVal = UnkStruct_ov031_Items_00::vfunc_08(param1);
if (retVal && func_01ff9258(param1->mUnk_08.x, param1->mUnk_08.z) > 0) {
// VecFx16_Copy2VecFx32(&param1->mUnk_08, &mUnk_08);
// Better match
unk16 tmp1 = param1->mUnk_08.x;
unk16 tmp3 = param1->mUnk_08.z;
unk16 tmp2 = param1->mUnk_08.y;
mUnk_08.x = tmp1;
mUnk_08.y = tmp2;
mUnk_08.z = tmp3;
}
return retVal;
}
bool UnkStruct_ov063_02162ea8::vfunc_0C(const UnkStruct_ov031_020e54d4 *param1, unk32 *param2, unk32 param3) {
UnkStruct_02162ea8_vfunc_0C *param2Struct = (UnkStruct_02162ea8_vfunc_0C *) param2;
if ((*(u16 *) &param2Struct->mUnk_04 & 0x1000) != 0) {
UnkStruct_02162ea8_vfunc_0C tmp;
tmp.mUnk_04 = *(volatile unk32 *) &param2Struct->mUnk_04;
Vec2bCpp vec;
*(unk32 *) &vec = tmp.mUnk_04;
MapObject *mapObject = gpMapObjManager->func_01fff498(vec);
if (mapObject != NULL) {
MapObjectId id = mapObject->GetMapObjectId();
if (id == MapObjectId_Grass || id == MapObjectId_LEVS || id == MapObjectId_STSH) {
return false;
}
}
}
return UnkStruct_027e0ce0_38_Base::vfunc_0C((const UnkStruct_ov031_020e54d4 *) param2Struct->mUnk_04, param2,
param2Struct->mUnk_04);
}
void UnkStruct_ov063_02162f14::vfunc_3C() {
mUnk_08->func_ov000_02057c98(mUnk_04);
mUnk_08->func_ov000_02057c98(mUnk_1C);
}
void UnkStruct_ov063_02162f14::vfunc_38(unk32 param1, unk32 param2) {
mUnk_04->func_ov000_020578a4(param1, param2);
mUnk_1C->func_ov000_020578a4(param1, param2);
}
+159 -163
View File
@@ -17,7 +17,6 @@
#include "Unknown/UnkStruct_027e0cec.hpp"
#include "Unknown/UnkStruct_027e0d38.hpp"
#include "flags.h"
#include "global.h"
#include "nitro/fx.h"
#include "nitro/math.h"
#include "nns/g3d/g3d.h"
@@ -133,6 +132,16 @@ void ActorUnkCASE_174::vfunc_10(Actor *actor) {
func_ov000_0207b70c(this, actor);
}
// Static
void ActorUnkCASE::func_ov063_0215acec(ActorRef *ref1, ActorRef ref2) {
ActorParams params;
params.mUnk_28 = 0;
params.func_ov000_020975f8();
params.mUnk_28 = ref2;
Actor::func_ov000_020973f4(ref1, &data_ov000_020b539c_eur, ActorId_CASE, &params, 0);
}
ActorUnkCASE::ActorUnkCASE() :
mUnk_0B0(G3d_GetModelPtr(((MapObjectProfile_Derived2_20 *) GET_PROFILE(ActorProfileUnkCASE)->vfunc_04())->mUnk_50)),
mUnk_120(0),
@@ -157,15 +166,6 @@ ActorUnkCASE::ActorUnkCASE() :
mUnk_A8 = &data_ov063_02162558;
}
void ActorUnkCASE::vfunc_10(Cylinder *param1) {
if (mUnk_14C != NULL) {
((ActorUnkCASE *) mUnk_14C)->vfunc_10(param1);
return;
}
VecFx32_Copy(&mPos, &param1->pos); // doesn't match
param1->size = 0x800;
}
bool ActorUnkCASE::vfunc_18(unk32 param1) {
mUnk_14C = gpActorManager->func_01fff3b4(mUnk_5C.mUnk_28);
@@ -179,156 +179,6 @@ bool ActorUnkCASE::vfunc_18(unk32 param1) {
return true;
}
void ActorUnkCASE::vfunc_20() {
mUnk_150.mUnk_1C = 1;
if (!func_ov017_020bef4c(this, 0x4000) && mUnk_48 != 0) {
bool cond = true;
if (mState != 1 && mState != 2) {
cond = false;
}
if (!cond) {
return;
}
if (mState == 3) {
this->func_ov063_0215b724();
return;
}
}
mUnk_3C = &mUnk_124;
CALL_PTMF(PTMF<ActorUnkCASE>, data_ov063_021630e0[mState]);
VecFx32 *vec_base, *vec2;
u16 ret1;
fx16 x, y, z;
fx32 x_pos, x_neg, z_pos, z_neg;
if (mUnk_14C != NULL) {
VecFx32 vec1;
VecFx32 *mUnk_14C_vec = (VecFx32 *) (((u8 *) mUnk_14C) + 0x25C);
vec1 = *mUnk_14C_vec;
func_01ffb714(&vec1, &mPos, &vec1);
z = vec1.z;
y = vec1.y;
x = vec1.x;
((VecFx16 *) &mUnk_150.mUnk_0E)->x = x;
((VecFx16 *) &mUnk_150.mUnk_0E)->y = y;
((VecFx16 *) &mUnk_150.mUnk_0E)->z = z;
vec2 = data_027e0ce0->func_01fff148(0);
vec_base = (VecFx32 *) (((u8 *) mUnk_14C) + 0x25C);
z_neg = vec2->z;
z_pos = vec_base->z;
x_pos = vec_base->x;
x_neg = vec2->x;
} else if (mState == 5) {
VecFx32 vec1;
vec1 = mUnk_1CC;
func_01ffb714(&vec1, &mPos, &vec1);
z = vec1.z;
y = vec1.y;
x = vec1.x;
((VecFx16 *) &mUnk_150.mUnk_0E)->x = x;
((VecFx16 *) &mUnk_150.mUnk_0E)->y = y;
((VecFx16 *) &mUnk_150.mUnk_0E)->z = z;
vec2 = data_027e0ce0->func_01fff148(0);
vec_base = &mUnk_1CC;
z_pos = vec_base->z;
z_neg = vec2->z;
x_pos = vec_base->x;
x_neg = vec2->x;
} else {
goto post;
}
// Unsuccessful tries to remove the goto: duplicating raw code, duplicating an inline of the code, wrapping the code in an
// "if (cond1 || cond2) { code }"
ret1 = func_01ffbbe0(x_pos - x_neg, z_pos - z_neg);
s16 sin_val = SIN((u16) (s16) ret1);
s16 cos_val = COS((u16) (s16) ret1);
((VecFx16 *) &mUnk_150.mUnk_08)->y = y;
// ((VecFx16 *) &mUnk_150.mUnk_08)->x = x + (((1 - sin_val) * 0x8000) >> 0x10);
// ((VecFx16 *) &mUnk_150.mUnk_08)->z = z + (((1 - cos_val) * 0x8000) >> 0x10);
((VecFx16 *) &mUnk_150.mUnk_08)->x = x + (s16) ((1 - sin_val) >> 1);
((VecFx16 *) &mUnk_150.mUnk_08)->z = z + (s16) ((1 - cos_val) >> 1);
post:
this->func_ov000_020989e0();
if (((u32) mState == 5 || mState == 4) && (mUnk_124.mUnk_08 & 0x3FFFF) != 0) {
switch (mUnk_124.mUnk_1C) {
case 4:
data_027e0d38->func_ov031_020d9c44(data_ov000_020aed00);
break;
case 11:
if (gpActorManager->func_01fff3b4(mUnk_124.mUnk_0C)->GetActorId() == ActorId_RollingStone) {
this->func_ov063_0215b724();
}
break;
case 13:
break;
default:
func_ov000_020990c0(this, &mUnk_124, 1, 0);
break;
}
}
if (GET_FLAG(mFlags, ActorFlag_Alive)) {
if (mState == 5) {
UnkStruct_ov000_0207de98 param2;
VecFx32_Copy(&mPos, &param2.vec);
param2.param1 = 0x548;
param2.param2 = 0x1000;
data_027e09c0->func_ov000_0207de98(mRef, &param2, mUnk_38);
}
}
}
void ActorUnkCASE::vfunc_24() {
if (mState != 1 && mState != 2) {
return;
}
this->vfunc_20();
}
void ActorUnkCASE::vfunc_2C(unk32 param1) {
if (!this->func_01fff5d0(param1, 0)) {
return;
}
if (mUnk_14C == NULL || ((u32 *) mUnk_14C)[0x268 >> 2] == NULL) {
fx32 sin_val = SIN((u16) mUnk_1C8);
fx32 cos_val = COS((u16) mUnk_1C8);
Mat3p mat2;
Mat3p mat1;
Mat3p_InitZRotation(&mat1, sin_val, cos_val);
func_01ffa60c(&mat1, &mUnk_1A4, &mat2);
mUnk_0B0.vfunc_14(&mat2, &mPos);
}
}
// Static
void ActorUnkCASE::func_ov063_0215acec(ActorRef *ref1, ActorRef ref2) {
ActorParams params;
params.mUnk_28 = 0;
params.func_ov000_020975f8();
params.mUnk_28 = ref2;
Actor::func_ov000_020973f4(ref1, &data_ov000_020b539c_eur, ActorId_CASE, &params, 0);
}
void ActorUnkCASE::func_ov063_0215aefc(ActorState param1) {
mState = param1;
mUnk_2C = data_ov000_020aecf8[0];
@@ -459,6 +309,146 @@ void ActorUnkCASE::func_ov063_0215b2b0(void) {
// Matched
void ActorUnkCASE::func_ov063_0215b2c4(void) {}
void ActorUnkCASE::vfunc_24() {
if (mState != 1 && mState != 2) {
return;
}
this->vfunc_20();
}
void ActorUnkCASE::vfunc_20() {
mUnk_150.mUnk_1C = 1;
if (!func_ov017_020bef4c(this, 0x4000) && mUnk_48 != 0) {
bool cond = true;
if (mState != 1 && mState != 2) {
cond = false;
}
if (!cond) {
return;
}
if (mState == 3) {
this->func_ov063_0215b724();
return;
}
}
mUnk_3C = &mUnk_124;
CALL_PTMF(PTMF<ActorUnkCASE>, data_ov063_021630e0[mState]);
VecFx32 *vec_base, *vec2;
u16 ret1;
fx16 x, y, z;
fx32 x_pos, x_neg, z_pos, z_neg;
if (mUnk_14C != NULL) {
VecFx32 vec1;
VecFx32 *mUnk_14C_vec = (VecFx32 *) (((u8 *) mUnk_14C) + 0x25C);
vec1 = *mUnk_14C_vec;
func_01ffb714(&vec1, &mPos, &vec1);
z = vec1.z;
y = vec1.y;
x = vec1.x;
((VecFx16 *) &mUnk_150.mUnk_0E)->x = x;
((VecFx16 *) &mUnk_150.mUnk_0E)->y = y;
((VecFx16 *) &mUnk_150.mUnk_0E)->z = z;
vec2 = data_027e0ce0->func_01fff148(0);
vec_base = (VecFx32 *) (((u8 *) mUnk_14C) + 0x25C);
z_neg = vec2->z;
z_pos = vec_base->z;
x_pos = vec_base->x;
x_neg = vec2->x;
} else if (mState == 5) {
VecFx32 vec1;
vec1 = mUnk_1CC;
func_01ffb714(&vec1, &mPos, &vec1);
z = vec1.z;
y = vec1.y;
x = vec1.x;
((VecFx16 *) &mUnk_150.mUnk_0E)->x = x;
((VecFx16 *) &mUnk_150.mUnk_0E)->y = y;
((VecFx16 *) &mUnk_150.mUnk_0E)->z = z;
vec2 = data_027e0ce0->func_01fff148(0);
vec_base = &mUnk_1CC;
z_pos = vec_base->z;
z_neg = vec2->z;
x_pos = vec_base->x;
x_neg = vec2->x;
} else {
goto post;
}
// Unsuccessful tries to remove the goto: duplicating raw code, duplicating an inline of the code, wrapping the code in an
// "if (cond1 || cond2) { code }"
ret1 = func_01ffbbe0(x_pos - x_neg, z_pos - z_neg);
s16 sin_val = SIN((u16) (s16) ret1);
s16 cos_val = COS((u16) (s16) ret1);
((VecFx16 *) &mUnk_150.mUnk_08)->y = y;
// ((VecFx16 *) &mUnk_150.mUnk_08)->x = x + (((1 - sin_val) * 0x8000) >> 0x10);
// ((VecFx16 *) &mUnk_150.mUnk_08)->z = z + (((1 - cos_val) * 0x8000) >> 0x10);
((VecFx16 *) &mUnk_150.mUnk_08)->x = x + (s16) ((1 - sin_val) >> 1);
((VecFx16 *) &mUnk_150.mUnk_08)->z = z + (s16) ((1 - cos_val) >> 1);
post:
this->func_ov000_020989e0();
if (((u32) mState == 5 || mState == 4) && (mUnk_124.mUnk_08 & 0x3FFFF) != 0) {
switch (mUnk_124.mUnk_1C) {
case 4:
data_027e0d38->func_ov031_020d9c44(data_ov000_020aed00);
break;
case 11:
if (gpActorManager->func_01fff3b4(mUnk_124.mUnk_0C)->GetActorId() == ActorId_RollingStone) {
this->func_ov063_0215b724();
}
break;
case 13:
break;
default:
func_ov000_020990c0(this, &mUnk_124, 1, 0);
break;
}
}
if (GET_FLAG(mFlags, ActorFlag_Alive)) {
if (mState == 5) {
UnkStruct_ov000_0207de98 param2;
VecFx32_Copy(&mPos, &param2.vec);
param2.param1 = 0x548;
param2.param2 = 0x1000;
data_027e09c0->func_ov000_0207de98(mRef, &param2, mUnk_38);
}
}
}
void ActorUnkCASE::vfunc_2C(unk32 param1) {
if (!this->func_01fff5d0(param1, 0)) {
return;
}
if (mUnk_14C == NULL || ((u32 *) mUnk_14C)[0x268 >> 2] == NULL) {
fx32 sin_val = SIN((u16) mUnk_1C8);
fx32 cos_val = COS((u16) mUnk_1C8);
Mat3p mat2;
Mat3p mat1;
Mat3p_InitZRotation(&mat1, sin_val, cos_val);
func_01ffa60c(&mat1, &mUnk_1A4, &mat2);
mUnk_0B0.vfunc_14(&mat2, &mPos);
}
}
void ActorUnkCASE::func_ov063_0215b6c8(VecFx32 *param1, UnkAngleStruct angle) {
VecFx32 vec = *param1;
VecFx32_Copy(&vec, &mPos);
@@ -474,6 +464,15 @@ void ActorUnkCASE::func_ov063_0215b724(void) {
data_027e09a8->func_ov000_02071b30(0x9865, &mPos, 0);
}
void ActorUnkCASE::vfunc_10(Cylinder *param1) {
if (mUnk_14C != NULL) {
((ActorUnkCASE *) mUnk_14C)->vfunc_10(param1);
return;
}
VecFx32_Copy(&mPos, &param1->pos); // doesn't match
param1->size = 0x800;
}
void ActorUnkCASE::func_ov063_0215b814(ActorRef ref) {
mUnk_1E4 = ref;
@@ -578,6 +577,3 @@ void ActorUnkCASE::func_ov063_0215b99c(ActorUnkCASE *param1, UnkStruct_func_ov06
param2->mUnk_92 = 2;
var2[0x25] = 2;
}
ActorUnkCASE::~ActorUnkCASE() {}
ActorProfileUnkCASE::~ActorProfileUnkCASE() {}
+13 -21
View File
@@ -1,15 +1,13 @@
//! TODO: This file was generated automatically and might contain errors
#include "Actor/ActorUnkRBLS.hpp"
#include "MapObject/MapObjectTreasureSpawned.hpp"
#include "Actor/Actor_Derived1.hpp"
#include "Render/ModelRender.hpp"
#include "Unknown/UnkStruct_027e0cd8.hpp"
#include "nitro/fx.h"
#include "nitro/math.h"
extern UnkStruct_data_ov063_02163740 data_ov063_02163740; // = {0, 0x534C4252, 0, 0, 0, 0};
ActorUnkZLSL_AnimationTag data_ov063_02163740 = {0, "RBLS"};
extern "C" void func_ov000_02099f64(unk32 *param1, UnkStruct_data_ov063_02163740 param2, unk32 param3);
extern "C" void func_ov000_02099f64(UnkStruct_ov063_02163784 *param1, ActorUnkZLSL_AnimationTag param2, unk32 param3);
DECL_PROFILE(ActorProfileUnkRBLS);
@@ -21,36 +19,30 @@ ActorProfileUnkRBLS::ActorProfileUnkRBLS() :
ActorProfile_Derived1(ActorId_RBLS) {}
ActorUnkRBLS::ActorUnkRBLS() :
mUnk_94(NULL),
mUnk_110(&mUnk_130, NULL) {}
mUnk_94(G3d_GetModelPtr(GET_PROFILE(ActorProfileUnkRBLS)->mUnk_3C.mUnk_50)),
mUnk_F4(&mUnk_94, GET_PROFILE(ActorProfileUnkRBLS)->vfunc_04()) {}
unk32 ActorUnkRBLS::vfunc_18(void) {
bool ActorUnkRBLS::vfunc_18(unk32 param1) {
this->mPos.x -= FLOAT_TO_FX32(0.5f);
this->mPos.z -= FLOAT_TO_FX32(0.5f);
this->mPos.y = 0;
func_ov000_02099f64(&this->mUnk_F4, data_ov063_02163740, 0x1000);
(*(MapObjectTreasureSpawned *) &this->mUnk_F4).vfunc_3C();
this->mUnk_F4.vfunc_3C();
data_027e0cd8->mUnk_0C->mUnk_12A = 0;
return 1; //! INFO: bool?
return true;
}
void ActorUnkRBLS::vfunc_20(void) {
(*(Actor *) &this->mUnk_F4).vfunc_34(); //! WARN: NOT an Actor
this->mUnk_F4.vfunc_34();
}
void ActorUnkRBLS::vfunc_24(void) {
this->vfunc_20();
}
void ActorUnkRBLS::vfunc_2C(void) {
ModelRender *param1 = &this->mUnk_94;
VecFx32 *param2 = &this->mPos;
param1->vfunc_18(param2);
void ActorUnkRBLS::vfunc_2C(unk32 param1) {
ModelRender *var1 = &this->mUnk_94;
VecFx32 *var2 = &this->mPos;
var1->vfunc_18(var2);
}
void ActorUnkRBLS::func_ov063_0215f3d4(void) {}
void ActorUnkRBLS::func_ov063_0215f500(void) {}
ActorUnkRBLS::~ActorUnkRBLS() {}
ActorProfileUnkRBLS::~ActorProfileUnkRBLS() {}
+33
View File
@@ -0,0 +1,33 @@
#include "Actor/ActorUnkRMSBase.hpp"
#include "Unknown/UnkStruct_027e0cd8.hpp"
#include "Unknown/UnkStruct_ov031_02114870.hpp"
ActorUnkRMSBase::ActorUnkRMSBase() :
mUnk_F4(NULL),
mUnk_154(0),
mUnk_155(0) {}
bool ActorUnkRMSBase::vfunc_18(unk32 param1) {
bool res = UnkStruct_ov031_02114870::vfunc_18(param1);
mUnk_F4.vfunc_08(this->vfunc_58());
data_027e0cd8->mUnk_0C->mUnk_12A = 1;
return res;
}
// Matched
void ActorUnkRMSBase::vfunc_1C() {}
// Matched
void ActorUnkRMSBase::vfunc_20() {}
void ActorUnkRMSBase::vfunc_24() {
this->vfunc_20();
}
void ActorUnkRMSBase::vfunc_2C(unk32 param1) {
UnkStruct_ov031_02114870::vfunc_2C(param1);
if (mUnk_154) {
mUnk_F4.vfunc_18(&mPos);
}
}
+11 -24
View File
@@ -1,20 +1,16 @@
//! TODO: This file was generated automatically and might contain errors
#include "Actor/ActorUnkRMSD.hpp"
#include "Actor/ActorUnkRMSW.hpp"
#include "Render/ModelRender.hpp"
#include "Actor/ActorUnkRMSV.hpp"
#include "Actor/Actor_Derived1.hpp"
#include "nns/g3d/g3d.h"
#include "profile.hpp"
#include "types.h"
char data_ov063_021625d8[0x10]; // = "RMSD_wall";
char data_ov063_021625e8[0x10]; // = "RMSD";
extern char data_ov063_021625d8[0x10]; // = "RMSD_wall";
extern char data_ov063_021625e8[0x10]; // = "RMSD";
extern struct UnkStruct_data_ov063_02163388 data_ov063_021634b0; // = {0, 0x44534D52, 0, 0, 0, 0};
ActorUnkZLSL_AnimationTag data_ov063_021634b0 = {0, "RMSD"};
extern "C" void func_ov000_02099ff8(unk32 *param1, struct UnkStruct_data_ov063_02163388 param2, unk32 param8);
extern "C" unk32 func_ov063_0215bb34(ActorUnkRMSD *);
extern "C" void func_ov000_02099ff8(unk32 *param1, ActorUnkZLSL_AnimationTag param2, unk32 param8);
DECL_PROFILE(ActorProfileUnkRMSD);
@@ -25,18 +21,12 @@ Actor *ActorProfileUnkRMSD::Create() {
ActorProfileUnkRMSD::ActorProfileUnkRMSD() :
ActorProfile_Derived1(ActorId_RMSD) {}
ActorUnkRMSBase::ActorUnkRMSBase() :
mUnk_94(NULL),
mUnk_F4(NULL) {}
ActorUnkRMSD::ActorUnkRMSD() :
mUnk_158(&mUnk_94, GET_PROFILE(ActorProfileUnkRMSD)->vfunc_04()) {}
ActorUnkRMSD::ActorUnkRMSD() {
ActorProfileUnkRMSD *r0 = GET_PROFILE(ActorProfileUnkRMSD);
r0->vfunc_04();
}
unk32 ActorUnkRMSD::vfunc_18(void) {
unk32 res = func_ov063_0215bb34(this);
func_ov000_02099ff8(&this->mUnk_158, data_ov063_021634b0, 0x1000);
bool ActorUnkRMSD::vfunc_18(unk32 param1) {
bool res = ActorUnkRMSBase::vfunc_18(param1);
this->mUnk_158.func_ov000_02099ff8(data_ov063_021634b0, 0x1000);
return res;
}
@@ -54,6 +44,3 @@ G3d_Model *ActorUnkRMSD::vfunc_54(void) {
G3d_Model *ActorUnkRMSD::vfunc_58(void) {
return GetModelFromProfile3(&GET_PROFILE(ActorProfileUnkRMSD)->mUnk_3C, data_ov063_021625d8);
}
ActorUnkRMSD::~ActorUnkRMSD() {}
ActorProfileUnkRMSD::~ActorProfileUnkRMSD() {}
-2
View File
@@ -1,5 +1,3 @@
//! TODO: This file was generated automatically and might contain errors
#include "Actor/ActorUnkRMSS.hpp"
#include "nns/g3d/g3d.h"
#include "profile.hpp"
+34 -26
View File
@@ -1,20 +1,24 @@
//! TODO: This file was generated automatically and might contain errors
#include "Actor/ActorUnkRMSV.hpp"
#include "Actor/Actor.hpp"
#include "Actor/ActorUnkRMSW.hpp"
#include "MapObject/MapObjectTreasureSpawned.hpp"
#include "Actor/ActorId.hpp"
#include "Actor/ActorUnkRMSBase.hpp"
#include "Actor/Actor_Derived1.hpp"
#include "nns/g3d/g3d.h"
#include "profile.hpp"
char data_ov063_02162578[0x10]; // = "RMSV";
char data_ov063_02162588[0x10]; // = "RMSV_wall";
extern char data_ov063_02162578[0x10]; // = "RMSV";
extern char data_ov063_02162588[0x10]; // = "RMSV_wall";
extern struct UnkStruct_data_ov063_02163388 data_ov063_021632ac; // = {0, 0x56534D52, 0, 0, 0, 0};
extern struct UnkStruct_data_ov063_02163388 data_ov063_021632c4; // = {0x1, 0x56534D52, 0, 0, 0, 0};
// Overlay 0
extern "C" void func_ov000_02099ff8(unk32 *param1, ActorUnkZLSL_AnimationTag param2, unk32 param8);
extern "C" void func_ov000_02099e58(UnkStruct_ov063_021632e4 *param1, ActorUnkZLSL_AnimationTag param2, unk32 param8);
extern "C" void func_ov000_02099ff8(unk32 *param1, struct UnkStruct_data_ov063_02163388 param2, unk32 param8);
extern "C" void func_ov000_02099e58(unk32 *param1, struct UnkStruct_data_ov063_02163388 param2, unk32 param8);
extern "C" unk32 func_ov063_0215bb34(ActorUnkRMSV *);
// Overlay 31
extern "C" bool func_ov031_020f7538(Actor *param1, unk32 param2);
extern "C" void func_ov031_020f7574(Actor *param1, unk32 param2);
ActorUnkZLSL_AnimationTag data_ov063_021632ac = {0, "RMSV"};
ActorUnkZLSL_AnimationTag data_ov063_021632c4 = {1, "RMSV"};
DECL_PROFILE(ActorProfileUnkRMSV);
@@ -25,27 +29,31 @@ Actor *ActorProfileUnkRMSV::Create() {
ActorProfileUnkRMSV::ActorProfileUnkRMSV() :
ActorProfile_Derived1(ActorId_RMSV) {}
ActorUnkRMSV::ActorUnkRMSV() {}
ActorUnkRMSV::ActorUnkRMSV() :
mUnk_158(&mUnk_94, GET_PROFILE(ActorProfileUnkRMSV)->vfunc_04()),
mUnk_1D4(&mUnk_94, GET_PROFILE(ActorProfileUnkRMSV)->vfunc_04()) {}
unk32 ActorUnkRMSV::vfunc_18(void) {
unk32 res = func_ov063_0215bb34(this);
func_ov000_02099ff8(&this->mUnk_158, data_ov063_021632ac, 0x1000);
bool ActorUnkRMSV::vfunc_18(unk32 param1) {
bool res = ActorUnkRMSBase::vfunc_18(param1);
this->mUnk_158.func_ov000_02099ff8(data_ov063_021632ac, 0x1000);
func_ov000_02099e58(&this->mUnk_1D4, data_ov063_021632c4, 0x1000);
((MapObjectTreasureSpawned *) &this->mUnk_1D4)->vfunc_3C(); //! WARN: NOT a MapObjectTreasureSpawned
this->mUnk_1D4.vfunc_3C();
return res;
}
void UnkStruct_ov063_021632e4::vfunc_3C() {
mUnk_08->func_ov000_02057c98(this->vfunc_10());
}
void ActorUnkRMSV::vfunc_20(void) {
(*(Actor *) &this->mUnk_158).vfunc_34(); // Not an Actor
(*(Actor *) &this->mUnk_1D4).vfunc_34(); // Not an Actor
this->mUnk_158.vfunc_34();
this->mUnk_1D4.vfunc_34();
}
void ActorUnkRMSV::vfunc_24(void) {
this->vfunc_20();
}
void ActorUnkRMSV::vfunc_50(void) {}
G3d_Model *ActorUnkRMSV::vfunc_54(void) {
return GetModelFromProfile3(&GET_PROFILE(ActorProfileUnkRMSV)->mUnk_3C, data_ov063_02162578);
}
@@ -54,10 +62,10 @@ G3d_Model *ActorUnkRMSV::vfunc_58(void) {
return GetModelFromProfile3(&GET_PROFILE(ActorProfileUnkRMSV)->mUnk_3C, data_ov063_02162588);
}
void ActorUnkRMSV::func_ov063_0215bd44(void) {}
void ActorUnkRMSV::func_ov063_0215bdec(void) {}
void ActorUnkRMSV::func_ov063_0215bed0(void) {}
void ActorUnkRMSV::func_ov063_0215bee0(void) {}
void UnkStruct_ov063_021632e4::vfunc_38(unk32 param1, unk32 param2) {
mUnk_04->func_ov000_020578a4(param1, param2);
}
ActorUnkRMSV::~ActorUnkRMSV() {}
ActorProfileUnkRMSV::~ActorProfileUnkRMSV() {}
s8 UnkStruct_ov063_021632e4::vfunc_30() {
return mUnk_18;
}
+12 -13
View File
@@ -1,16 +1,17 @@
//! TODO: This file was generated automatically and might contain errors
#include "Actor/ActorUnkRMSW.hpp"
#include "Actor/ActorId.hpp"
#include "Actor/ActorUnkZLSL_ZSRS.hpp"
#include "Actor/Actor_Derived1.hpp"
#include "nns/g3d/g3d.h"
#include "profile.hpp"
#include "types.h"
char data_ov063_02162598[0x10]; // = "RMSW_wall";
char data_ov063_021625a8[0x10]; // = "RMSW";
extern char data_ov063_02162598[0x10]; // = "RMSW_wall";
extern char data_ov063_021625a8[0x10]; // = "RMSW";
extern struct UnkStruct_data_ov063_02163388 data_ov063_02163388; // = {0, 0x57534D52, 0, 0, 0, 0};
struct ActorUnkZLSL_AnimationTag data_ov063_02163388 = {0, "RMSW"};
extern "C" void func_ov000_02099ff8(unk32 *param1, struct UnkStruct_data_ov063_02163388 param2, unk32 param8);
extern "C" unk32 func_ov063_0215bb34(ActorUnkRMSW *);
DECL_PROFILE(ActorProfileUnkRMSW);
@@ -21,11 +22,12 @@ Actor *ActorProfileUnkRMSW::Create() {
ActorProfileUnkRMSW::ActorProfileUnkRMSW() :
ActorProfile_Derived1(ActorId_RMSW) {}
ActorUnkRMSW::ActorUnkRMSW() {}
ActorUnkRMSW::ActorUnkRMSW() :
mUnk_158(&mUnk_94, GET_PROFILE(ActorProfileUnkRMSW)->vfunc_04()) {}
unk32 ActorUnkRMSW::vfunc_18(void) {
unk32 res = func_ov063_0215bb34(this);
func_ov000_02099ff8(&this->mUnk_158, data_ov063_02163388, 0x1000);
bool ActorUnkRMSW::vfunc_18(unk32 param1) {
bool res = ActorUnkRMSBase::vfunc_18(param1);
((UnkStruct_ov000_020b31a8 *) &this->mUnk_158)->func_ov000_02099ff8(data_ov063_02163388, 0x1000);
return res;
}
@@ -44,6 +46,3 @@ G3d_Model *ActorUnkRMSW::vfunc_54(void) {
G3d_Model *ActorUnkRMSW::vfunc_58(void) {
return GetModelFromProfile3(&GET_PROFILE(ActorProfileUnkRMSW)->mUnk_3C, data_ov063_02162598);
}
ActorUnkRMSW::~ActorUnkRMSW() {}
ActorProfileUnkRMSW::~ActorProfileUnkRMSW() {}