mirror of
https://github.com/zeldaret/st
synced 2026-07-03 04:53:00 -04:00
Decompiling actor for boomerang (#93)
* feat: begin decompiling ActorItemBoomerang * feat: decompile functions * refactor: rename function and use ActorState * feat: match vfunc * feat: magic stuff on addresses to match .data * feat: more black magic * feat: improvements * feat: match .data * feat: unmatch .data 😭 * feat: match stuff * refactor: move shotarrows' class used in boomerang * feat: fix mangled names * feat: weird magic * fix: build issues * fix: build issue for jp version * fix: back to +0.2% :yeah: * feat: improvements before changing laptop * feat: continue decompiling * fix: build issues * feat: improvements * feat: solve build on eur * fix: build issue * fix: better match * fix: match back ActorShotArrow data * feat: increase .text matching * fix: propagate changes to ActorShotArrow * feat: matching func_ov031_020e5034 * fix: logical errors * fix: replace whiles with fors * style: use uppercased hex value Co-authored-by: Yanis <35189056+Yanis002@users.noreply.github.com> * style: do not use fx32 for global timer Co-authored-by: Yanis <35189056+Yanis002@users.noreply.github.com> * style: add parameters name in prototypes Co-authored-by: Yanis <35189056+Yanis002@users.noreply.github.com> * style: use bool instead of unk32 for external function Co-authored-by: Yanis <35189056+Yanis002@users.noreply.github.com> * style: use DEG2ANG * refactor: use ActorRef instead of u16 * style: use boring array access instead of chad pointer manipulation * fix: use bool as return type for ActorItemBoomerang::vfunc_2C * feat: remove old non-matching comments * style: explicit null check * revert: change vfunc_2C back to void signature and change 01fff5d0 function's signature to bool --------- Co-authored-by: Yanis <35189056+Yanis002@users.noreply.github.com>
This commit is contained in:
@@ -172,7 +172,7 @@ public:
|
||||
/* 4C */ virtual ~Actor();
|
||||
/* 54 */
|
||||
|
||||
unk32 func_01fff5d0(unk32 param1, unk32 param2);
|
||||
bool func_01fff5d0(unk32 param1, unk32 param2);
|
||||
|
||||
void ResetFlags() {
|
||||
*(u32 *) this->mFlags = 0;
|
||||
@@ -201,6 +201,7 @@ public:
|
||||
|
||||
// overlay 0
|
||||
bool func_ov000_0205cbc4(u32 param1, VecFx32 *param2);
|
||||
unk32 func_ov000_0207df88(Cylinder *param1, unk32 param2);
|
||||
unk32 func_ov000_0207e294(Cylinder *param1);
|
||||
void func_ov000_0209848c(ActorProfile *param1);
|
||||
void func_ov000_020984b0();
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
#pragma once
|
||||
|
||||
#include "Actor/Actor.hpp"
|
||||
#include "Actor/ActorProfile.hpp"
|
||||
#include "Render/ModelRender.hpp"
|
||||
#include "Unknown/UnkStruct_ov031_Items.hpp"
|
||||
#include "global.h"
|
||||
#include "types.h"
|
||||
|
||||
enum ActorItemBoomerangState_ {
|
||||
ActorItemBoomerangState_0,
|
||||
ActorItemBoomerangState_1,
|
||||
ActorItemBoomerangState_MAX
|
||||
};
|
||||
|
||||
class ActorItemBoomerang;
|
||||
|
||||
class ActorItemBoomerang_Unknown { // inherits from UnkStruct_PlayerGet_ec ?
|
||||
public:
|
||||
/* 00 */ unk32 mUnk_00;
|
||||
/* 04 */ VecFx32 mUnk_04;
|
||||
/* 10 */
|
||||
|
||||
void func_ov031_020e45fc();
|
||||
void func_ov031_020e5704();
|
||||
};
|
||||
|
||||
class ActorItemBoomerang_11C : public UnkStruct_ov031_Items_00 {
|
||||
public:
|
||||
/* 00 (vtable) */
|
||||
/* 04 */ STRUCT_PAD(0x04, 0x08);
|
||||
/* 08 */ ActorItemBoomerang *mUnk_08;
|
||||
/* 0C */
|
||||
|
||||
ActorItemBoomerang_11C(ActorItemBoomerang *param1);
|
||||
|
||||
/* 00 */ virtual ~ActorItemBoomerang_11C() override;
|
||||
/* 08 */ virtual bool vfunc_08(const UnkStruct_ov031_020f3310 *param1) override;
|
||||
/* 0C */ virtual bool vfunc_0C(const UnkStruct_ov031_020e54d4 *param1, unk32 param2) override;
|
||||
};
|
||||
|
||||
class ActorItemBoomerang_A0 : public UnkStruct_ov031_Items_01 {
|
||||
public:
|
||||
/* 00 (vtable) */
|
||||
/* 04 */
|
||||
|
||||
/* 10 */ virtual void vfunc_10(Actor *actor) override;
|
||||
};
|
||||
|
||||
class ActorItemBoomerang_CC : public UnkStruct_ov031_Items_01 {
|
||||
public:
|
||||
/* 00 (vtable) */
|
||||
/* 2C */ unk32 mUnk_2C;
|
||||
/* 30 */ ActorItemBoomerang_Unknown mUnk_30;
|
||||
/* 40 */
|
||||
|
||||
ActorItemBoomerang_CC() :
|
||||
mUnk_2C(0x0) {}
|
||||
|
||||
/* 0C */ virtual bool vfunc_0C(Actor *actor, VecFx32 *param2) override;
|
||||
/* 10 */ virtual void vfunc_10(Actor *actor) override;
|
||||
};
|
||||
|
||||
class ActorItemBoomerang : public Actor {
|
||||
public:
|
||||
/* 000 (base) */
|
||||
/* 094 */ UnkSystem6_Derived2 mUnk_94;
|
||||
/* 09C */ bool mUnk_9C;
|
||||
/* 09D */ STRUCT_PAD(0x9D, 0xA0);
|
||||
/* 0A0 */ ActorItemBoomerang_A0 mUnk_A0;
|
||||
/* 0CC */ ActorItemBoomerang_CC mUnk_CC;
|
||||
/* 10C */ VecFx32 mUnk_10C;
|
||||
/* 118 */ unk32 mUnk_118;
|
||||
/* 11C */ ActorItemBoomerang_11C mUnk_11C;
|
||||
/* 128 */ u32 mUnk_128;
|
||||
/* 12C */ UnkStruct_PlayerGet_ec mUnk_12C[0x3];
|
||||
/* 138 */ u16 mUnk_138; // timer ?
|
||||
/* 13A */ u16 mUnk_13A;
|
||||
/* 13C */ u16 mUnk_13C;
|
||||
/* 13E */ STRUCT_PAD(0x13E, 0x140);
|
||||
/* 140 */ UnkStruct_ov031_Items_02 mUnk_140;
|
||||
/* 14C */ STRUCT_PAD(0x14C, 0x188);
|
||||
/* 188 */
|
||||
|
||||
ActorItemBoomerang();
|
||||
|
||||
/* 18 */ virtual bool vfunc_18(unk32 param1) override;
|
||||
/* 20 */ virtual void vfunc_20() override;
|
||||
/* 2C */ virtual void vfunc_2C(unk32 param1) override;
|
||||
/* 4C */ virtual ~ActorItemBoomerang() override;
|
||||
|
||||
void SetState(ActorState state);
|
||||
void func_ov031_020e49b0(unk32 param1);
|
||||
void func_ov031_020e5034(unk32 param1);
|
||||
void func_ov031_020e5220();
|
||||
void func_ov031_020e52a0();
|
||||
};
|
||||
|
||||
class ActorProfileItemBoomerang : public ActorProfile {
|
||||
public:
|
||||
/* 00 (base) */
|
||||
|
||||
ActorProfileItemBoomerang();
|
||||
~ActorProfileItemBoomerang();
|
||||
|
||||
/* 0C */ virtual Actor *Create();
|
||||
|
||||
static ActorProfileItemBoomerang *GetProfile();
|
||||
};
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "Actor/ActorProfile.hpp"
|
||||
#include "Render/ModelRender.hpp"
|
||||
#include "Unknown/UnkStruct_027e0ce0.hpp"
|
||||
#include "Unknown/UnkStruct_ov031_Items.hpp"
|
||||
#include "global.h"
|
||||
#include "types.h"
|
||||
|
||||
@@ -35,19 +36,7 @@ public:
|
||||
ActorShotArrow_140(Actor *param1);
|
||||
};
|
||||
|
||||
class ActorShotArrow_178_Base : public UnkStruct_027e0ce0_38_Base {
|
||||
public:
|
||||
/* 00 (vtable) */
|
||||
/* 04 */
|
||||
|
||||
ActorShotArrow_178_Base();
|
||||
|
||||
// data_ov000_020b30d0
|
||||
/* 00 */ virtual ~ActorShotArrow_178_Base();
|
||||
/* 08 */ virtual bool vfunc_08(const UnkStruct_ov031_020f3310 *param1) override;
|
||||
};
|
||||
|
||||
class ActorShotArrow_178 : public ActorShotArrow_178_Base {
|
||||
class ActorShotArrow_178 : public UnkStruct_ov031_Items_00 {
|
||||
public:
|
||||
/* 00 (vtable) */
|
||||
/* 04 */ STRUCT_PAD(0x04, 0x08);
|
||||
@@ -61,44 +50,12 @@ public:
|
||||
// data_ov031_02114288
|
||||
/* 00 */ virtual ~ActorShotArrow_178() override;
|
||||
/* 08 */ virtual bool vfunc_08(const UnkStruct_ov031_020f3310 *param1) override;
|
||||
/* 0C */ virtual bool vfunc_0C() override;
|
||||
/* 0C */ virtual bool vfunc_0C(const UnkStruct_ov031_020e54d4 *param1, unk32 param2) override;
|
||||
|
||||
void func_ov031_020f3304();
|
||||
};
|
||||
|
||||
class ActorShotArrow_194_Base {
|
||||
public:
|
||||
/* 00 (vtable) */
|
||||
/* 04 */ ActorRef mUnk_04;
|
||||
/* 08 */ unk16 mUnk_08;
|
||||
/* 08 */ unk16 mUnk_0A;
|
||||
/* 0C */ VecFx32 mUnk_0C;
|
||||
/* 18 */ fx32 mUnk_18;
|
||||
/* 1C */ unk32 mUnk_1C;
|
||||
/* 20 */ unk32 mUnk_20;
|
||||
/* 24 */ unk32 mUnk_24;
|
||||
/* 28 */ unk32 mUnk_28;
|
||||
/* 2C */
|
||||
|
||||
ActorShotArrow_194_Base() {
|
||||
this->mUnk_04 = 0;
|
||||
this->mUnk_08 = 0;
|
||||
VecFx32_Init(0, 0, 0, &this->mUnk_0C);
|
||||
this->mUnk_18 = 0;
|
||||
this->mUnk_1C = 0;
|
||||
this->mUnk_20 = 0;
|
||||
this->mUnk_24 = 0;
|
||||
this->mUnk_28 = 0;
|
||||
}
|
||||
|
||||
// data_ov000_020b27c8
|
||||
/* 00 */ virtual ~ActorShotArrow_194_Base();
|
||||
/* 08 */ virtual void vfunc_08();
|
||||
/* 0C */ virtual bool vfunc_0C(Actor *param1, VecFx32 *vector);
|
||||
/* 10 */ virtual void vfunc_10(Actor *actor);
|
||||
};
|
||||
|
||||
class ActorShotArrow_194 : public ActorShotArrow_194_Base {
|
||||
class ActorShotArrow_194 : public UnkStruct_ov031_Items_01 {
|
||||
public:
|
||||
/* 00 (base) */
|
||||
/* 2C */ ActorShotArrow *mUnk_2C;
|
||||
@@ -138,15 +95,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class ActorShotArrow_1DC {
|
||||
public:
|
||||
/* 00 */ VecFx32 mUnk_00;
|
||||
/* 0C */
|
||||
|
||||
ActorShotArrow_1DC(unk32 param1, unk32 param2);
|
||||
~ActorShotArrow_1DC();
|
||||
};
|
||||
|
||||
class ActorShotArrow : public Actor {
|
||||
public:
|
||||
/* 000 (base) */
|
||||
@@ -167,7 +115,7 @@ public:
|
||||
/* 178 */ ActorShotArrow_178 mUnk_178;
|
||||
/* 194 */ ActorShotArrow_194 mUnk_194;
|
||||
/* 1C8 */ ActorShotArrow_1C8 mUnk_1C8;
|
||||
/* 1DC */ ActorShotArrow_1DC mUnk_1DC;
|
||||
/* 1DC */ UnkStruct_ov031_Items_02 mUnk_1DC;
|
||||
/* 1E0 */ STRUCT_PAD(0x1E8, 0x224);
|
||||
/* 224 */ Mat4x3p *mUnk_224;
|
||||
/* 228 */ Mat4x3p mUnk_228;
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
//! TODO: This file was generated automatically and might contain errors
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Actor/Actor.hpp"
|
||||
#include "Actor/ActorProfile.hpp"
|
||||
#include "global.h"
|
||||
#include "types.h"
|
||||
|
||||
class ActorUnkITBM_C4 : public Actor_C4 {
|
||||
public:
|
||||
ActorUnkITBM_C4(Actor *param1);
|
||||
|
||||
/* 00 */ virtual bool vfunc_00(ActorRef ref, unk32 param2) override;
|
||||
/* 04 */ virtual void vfunc_04() override;
|
||||
/* 08 */ virtual void vfunc_08() override;
|
||||
/* 0C */ virtual void vfunc_0C(unk32 param1) override;
|
||||
};
|
||||
|
||||
class ActorUnkITBM : public Actor {
|
||||
public:
|
||||
/* 00 (base) */
|
||||
/* 94 */
|
||||
|
||||
ActorUnkITBM();
|
||||
|
||||
/* 4C */ virtual ~ActorUnkITBM() override;
|
||||
|
||||
void func_ov031_020e45fc(void);
|
||||
void func_ov031_020e4760(void);
|
||||
void func_ov031_020e4774(void);
|
||||
void func_ov031_020e4788(void);
|
||||
void func_ov031_020e48d0(void);
|
||||
void func_ov031_020e4994(void);
|
||||
void func_ov031_020e49b0(void);
|
||||
void func_ov031_020e4a20(void);
|
||||
void func_ov031_020e5034(void);
|
||||
void func_ov031_020e5220(void);
|
||||
void func_ov031_020e52a0(void);
|
||||
void func_ov031_020e5354(void);
|
||||
void func_ov031_020e53c8(void);
|
||||
void func_ov031_020e53e4(void);
|
||||
void func_ov031_020e5400(void);
|
||||
void func_ov031_020e544c(void);
|
||||
void func_ov031_020e5488(void);
|
||||
void func_ov031_020e54a4(void);
|
||||
void func_ov031_020e54d4(void);
|
||||
void func_ov031_020e5704(void);
|
||||
void func_ov031_020e5710(void);
|
||||
void func_ov031_020e572c(void);
|
||||
};
|
||||
|
||||
class ActorProfileUnkITBM : public ActorProfile {
|
||||
public:
|
||||
/* 00 (base) */
|
||||
|
||||
ActorProfileUnkITBM();
|
||||
~ActorProfileUnkITBM();
|
||||
|
||||
/* 0C */ virtual Actor *Create();
|
||||
|
||||
static ActorProfileUnkITBM *GetProfile();
|
||||
};
|
||||
Reference in New Issue
Block a user