mirror of
https://github.com/zeldaret/st
synced 2026-06-22 08:35:42 -04:00
Decompile ActorUnkFLEN (98%) (#81)
* feat: match ActorProfileUnkFlen and ctor of ActorUnkFlen * feat: add function * feat: decompile function * feat: decompile function @ 020f8118 * feat: use break in each case * feat: almost fully decompiled actor * style: move external variable to top file * feat: update symbols * feat: better match * refactor: rename function and use ActorState over ActorUnkFLENState * style: cleanup code * review --------- Co-authored-by: Yanis002 <35189056+Yanis002@users.noreply.github.com>
This commit is contained in:
@@ -144,12 +144,14 @@ src/031_Land/Actor/ActorUnkFLEN.cpp:
|
||||
.text start:0x020f8024 end:0x020f82e0
|
||||
.init start:0x021117b0 end:0x02111800
|
||||
.ctor start:0x021127f4 end:0x021127f8
|
||||
.data start:0x021149b8 end:0x02114a38
|
||||
.bss start:0x02116d38 end:0x02116d84
|
||||
|
||||
src/031_Land/Actor/ActorUnkRLST.cpp:
|
||||
.text start:0x020f82e0 end:0x020f9dcc
|
||||
.init start:0x02111800 end:0x02111850
|
||||
.ctor start:0x021127f8 end:0x021127fc
|
||||
.data start:0x02114a38 end:0x02114ba0
|
||||
.bss start:0x02116d84 end:0x02116e6c
|
||||
|
||||
src/031_Land/Actor/ActorItemDrop.cpp:
|
||||
|
||||
@@ -3502,7 +3502,7 @@ from:0x020f8624 kind:arm_call_thumb to:0x020d6668 module:overlay(24)
|
||||
from:0x020f8654 kind:load to:0x02114b44 add:0x8 module:overlay(31)
|
||||
from:0x020f8658 kind:load to:0x02116d94 module:overlay(31)
|
||||
from:0x020f865c kind:load to:0x020b1960 add:0x8 module:overlay(0)
|
||||
from:0x020f8660 kind:load to:0x02114a40 module:overlay(31)
|
||||
from:0x020f8660 kind:load to:0x02114a38 module:overlay(31) add:0x8
|
||||
from:0x020f8664 kind:load to:0x02114a5c module:overlay(31)
|
||||
from:0x020f8668 kind:load to:0x027e0130 module:dtcm
|
||||
from:0x020f866c kind:load to:0x020a02d4 module:overlay(0)
|
||||
|
||||
@@ -1100,9 +1100,9 @@ _ZN19ActorProfileUnkFLEN10GetProfileEv kind:function(arm,size=0xc) addr:0x020f80
|
||||
_ZN19ActorProfileUnkFLEN6CreateEv kind:function(arm,size=0x24) addr:0x020f8030
|
||||
_ZN19ActorProfileUnkFLENC1Ev kind:function(arm,size=0x3c) addr:0x020f8054
|
||||
_ZN12ActorUnkFLENC1Ev kind:function(arm,size=0x28) addr:0x020f8090
|
||||
_ZN12ActorUnkFLEN19func_ov031_020f80b8Ev kind:function(arm,size=0x60) addr:0x020f80b8
|
||||
_ZN12ActorUnkFLEN19func_ov031_020f8118Ev kind:function(arm,size=0x9c) addr:0x020f8118
|
||||
_ZN12ActorUnkFLEN19func_ov031_020f81b4Ev kind:function(arm,size=0x44) addr:0x020f81b4
|
||||
_ZN12ActorUnkFLEN8vfunc_18Ei kind:function(arm,size=0x60) addr:0x020f80b8
|
||||
_ZN12ActorUnkFLEN8vfunc_20Ev kind:function(arm,size=0x9c) addr:0x020f8118
|
||||
_ZN12ActorUnkFLEN8SetStateEj kind:function(arm,size=0x44) addr:0x020f81b4
|
||||
_ZN12ActorUnkFLEN19func_ov031_020f81f8Ev kind:function(arm,size=0xa4) addr:0x020f81f8
|
||||
_ZN12ActorUnkFLEND1Ev kind:function(arm,size=0x14) addr:0x020f829c
|
||||
_ZN12ActorUnkFLEND0Ev kind:function(arm,size=0x1c) addr:0x020f82b0
|
||||
@@ -2383,9 +2383,9 @@ _ZTV19ActorProfileUnkSWON kind:data(any) addr:0x021148b8
|
||||
_ZTV12ActorUnkSWON kind:data(any) addr:0x021148dc
|
||||
_ZTV19ActorProfileUnkNORE kind:data(any) addr:0x02114938
|
||||
_ZTV12ActorUnkNORE kind:data(any) addr:0x0211495c
|
||||
_ZTV19data_ov031_021149b8 kind:data(any) addr:0x021149b8
|
||||
_ZTV19data_ov031_021149dc kind:data(any) addr:0x021149dc
|
||||
data_ov031_02114a40 kind:data(any) addr:0x02114a40
|
||||
_ZTV19ActorProfileUnkFLEN kind:data(any) addr:0x021149b8
|
||||
_ZTV12ActorUnkFLEN kind:data(any) addr:0x021149dc
|
||||
_ZTV19data_ov031_02114a40 kind:data(any) addr:0x02114a38
|
||||
data_ov031_02114a5c kind:data(any) addr:0x02114a5c
|
||||
_ZTV19data_ov031_02114a70 kind:data(any) addr:0x02114a70
|
||||
data_ov031_02114a94 kind:data(any) addr:0x02114a94
|
||||
|
||||
@@ -144,6 +144,7 @@ src/031_Land/Actor/ActorUnkFLEN.cpp:
|
||||
.text start:0x020f9a68 end:0x020f9d24
|
||||
.init start:0x0211353c end:0x0211358c
|
||||
.ctor start:0x02114580 end:0x02114584
|
||||
.data start:0x0211672c end:0x021167ac
|
||||
.bss start:0x02118ad8 end:0x02118b24
|
||||
|
||||
src/031_Land/Actor/ActorUnkRLST.cpp:
|
||||
|
||||
@@ -3501,7 +3501,7 @@ from:0x020fa068 kind:arm_call_thumb to:0x020d800c module:overlay(24)
|
||||
from:0x020fa098 kind:load to:0x021168b8 add:0x8 module:overlay(31)
|
||||
from:0x020fa09c kind:load to:0x02118b34 module:overlay(31)
|
||||
from:0x020fa0a0 kind:load to:0x020b3160 add:0x8 module:overlay(0)
|
||||
from:0x020fa0a4 kind:load to:0x021167b4 module:overlay(31)
|
||||
from:0x020fa0a4 kind:load to:0x021167ac module:overlay(31) add:0x8
|
||||
from:0x020fa0a8 kind:load to:0x021167d0 module:overlay(31)
|
||||
from:0x020fa0ac kind:load to:0x027e0130 module:dtcm
|
||||
from:0x020fa0b0 kind:load to:0x020a1aac module:overlay(0)
|
||||
|
||||
@@ -1099,9 +1099,9 @@ _ZN19ActorProfileUnkFLEN10GetProfileEv kind:function(arm,size=0xc) addr:0x020f9a
|
||||
_ZN19ActorProfileUnkFLEN6CreateEv kind:function(arm,size=0x24) addr:0x020f9a74
|
||||
_ZN19ActorProfileUnkFLENC1Ev kind:function(arm,size=0x3c) addr:0x020f9a98
|
||||
_ZN12ActorUnkFLENC1Ev kind:function(arm,size=0x28) addr:0x020f9ad4
|
||||
_ZN12ActorUnkFLEN19func_ov031_020f80b8Ev kind:function(arm,size=0x60) addr:0x020f9afc
|
||||
_ZN12ActorUnkFLEN19func_ov031_020f8118Ev kind:function(arm,size=0x9c) addr:0x020f9b5c
|
||||
_ZN12ActorUnkFLEN19func_ov031_020f81b4Ev kind:function(arm,size=0x44) addr:0x020f9bf8
|
||||
_ZN12ActorUnkFLEN8vfunc_18Ei kind:function(arm,size=0x60) addr:0x020f9afc
|
||||
_ZN12ActorUnkFLEN8vfunc_20Ev kind:function(arm,size=0x9c) addr:0x020f9b5c
|
||||
_ZN12ActorUnkFLEN8SetStateEj kind:function(arm,size=0x44) addr:0x020f9bf8
|
||||
_ZN12ActorUnkFLEN19func_ov031_020f81f8Ev kind:function(arm,size=0xa4) addr:0x020f9c3c
|
||||
_ZN12ActorUnkFLEND1Ev kind:function(arm,size=0x14) addr:0x020f9ce0
|
||||
_ZN12ActorUnkFLEND0Ev kind:function(arm,size=0x1c) addr:0x020f9cf4
|
||||
@@ -2019,8 +2019,8 @@ data_ov031_021128bc kind:data(any) addr:0x021128bc
|
||||
data_ov031_021128cc kind:data(any) addr:0x021128cc
|
||||
data_ov031_021128e0 kind:data(any) addr:0x021128e0
|
||||
data_ov031_021128f0 kind:data(any) addr:0x021128f0
|
||||
data_ov031_02112900 kind:data(any) addr:0x02112900
|
||||
data_ov031_02112904 kind:data(any) addr:0x02112904
|
||||
data_ov031_02110b90 kind:data(any) addr:0x02112900
|
||||
data_ov031_02110b94 kind:data(any) addr:0x02112904
|
||||
data_ov031_02112908 kind:data(any) addr:0x02112908
|
||||
data_ov031_02112914 kind:data(any) addr:0x02112914
|
||||
data_ov031_02112920 kind:data(any) addr:0x02112920
|
||||
@@ -2378,9 +2378,9 @@ _ZTV19ActorProfileUnkSWON kind:data(any) addr:0x0211662c
|
||||
_ZTV12ActorUnkSWON kind:data(any) addr:0x02116650
|
||||
_ZTV19ActorProfileUnkNORE kind:data(any) addr:0x021166ac
|
||||
_ZTV12ActorUnkNORE kind:data(any) addr:0x021166d0
|
||||
_ZTV19data_ov031_0211672c kind:data(any) addr:0x0211672c
|
||||
_ZTV19data_ov031_02116750 kind:data(any) addr:0x02116750
|
||||
data_ov031_021167b4 kind:data(any) addr:0x021167b4
|
||||
_ZTV19ActorProfileUnkFLEN kind:data(any) addr:0x0211672c
|
||||
_ZTV12ActorUnkFLEN kind:data(any) addr:0x02116750
|
||||
_ZTV19data_ov031_021167b4 kind:data(any) addr:0x021167ac
|
||||
data_ov031_021167d0 kind:data(any) addr:0x021167d0
|
||||
_ZTV19data_ov031_021167e4 kind:data(any) addr:0x021167e4
|
||||
data_ov031_02116808 kind:data(any) addr:0x02116808
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
//! TODO: This file was generated automatically and might contain errors
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Actor/Actor.hpp"
|
||||
@@ -7,34 +5,35 @@
|
||||
#include "global.h"
|
||||
#include "types.h"
|
||||
|
||||
class ActorUnkFLEN_C4 : public Actor_C4 {
|
||||
public:
|
||||
ActorUnkFLEN_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;
|
||||
typedef u32 ActorUnkFLENState;
|
||||
enum ActorUnkFLENState_ {
|
||||
ActorUnkFLENState_0 = 0,
|
||||
ActorUnkFLENState_1 = 1,
|
||||
ActorUnkFLENState_2 = 2,
|
||||
ActorUnkFLENState_Max,
|
||||
};
|
||||
|
||||
class ActorUnkFLEN : public Actor {
|
||||
public:
|
||||
/* 00 (base) */
|
||||
/* 94 */
|
||||
/* 94 */ unk32 mUnk_94;
|
||||
/* 98 */
|
||||
|
||||
ActorUnkFLEN();
|
||||
|
||||
/* 4C */ virtual ~ActorUnkFLEN() override;
|
||||
|
||||
void func_ov031_020f80b8(void);
|
||||
void func_ov031_020f8118(void);
|
||||
void func_ov031_020f81b4(void);
|
||||
void func_ov031_020f81f8(void);
|
||||
/* 18 */ virtual bool vfunc_18(int param1) override;
|
||||
/* 20 */ virtual void vfunc_20() override;
|
||||
|
||||
void SetState(ActorUnkFLENState state);
|
||||
bool func_ov031_020f81f8();
|
||||
};
|
||||
|
||||
class ActorProfileUnkFLEN : public ActorProfile {
|
||||
public:
|
||||
/* 00 (base) */
|
||||
/* 3C */
|
||||
|
||||
ActorProfileUnkFLEN();
|
||||
~ActorProfileUnkFLEN();
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
//! TODO: This file was generated automatically and might contain errors
|
||||
|
||||
#include "Actor/ActorUnkFLEN.hpp"
|
||||
#include "System/SysNew.hpp"
|
||||
|
||||
extern "C" u16 data_ov031_02110b90[];
|
||||
extern "C" ActorId data_ov031_02110b94[];
|
||||
|
||||
DECL_PROFILE(ActorProfileUnkFLEN);
|
||||
|
||||
Actor *ActorProfileUnkFLEN::Create() {
|
||||
@@ -10,14 +11,90 @@ Actor *ActorProfileUnkFLEN::Create() {
|
||||
}
|
||||
|
||||
ActorProfileUnkFLEN::ActorProfileUnkFLEN() :
|
||||
ActorProfile(ActorId_FLEN) {}
|
||||
ActorProfile(ActorId_FLEN) {
|
||||
this->mUnk_04.Init(FLOAT_TO_FX32(0.0f));
|
||||
}
|
||||
|
||||
ActorUnkFLEN::ActorUnkFLEN() {}
|
||||
ActorUnkFLEN::ActorUnkFLEN() :
|
||||
mUnk_94(0) {}
|
||||
|
||||
void ActorUnkFLEN::func_ov031_020f80b8(void) {}
|
||||
void ActorUnkFLEN::func_ov031_020f8118(void) {}
|
||||
void ActorUnkFLEN::func_ov031_020f81b4(void) {}
|
||||
void ActorUnkFLEN::func_ov031_020f81f8(void) {}
|
||||
bool ActorUnkFLEN::vfunc_18(int param1) {
|
||||
this->mUnk_94 = this->mUnk_5C.mParams[1];
|
||||
|
||||
if (this->mUnk_5C.mParams[1] >= (s16) 0x2) {
|
||||
this->mUnk_94 = 0;
|
||||
}
|
||||
|
||||
if (ActorProfile *profile = data_ov000_020b539c_eur.GetProfileFromId(data_ov031_02110b94[this->mUnk_5C.mParams[0]])) {
|
||||
profile->vfunc_08();
|
||||
}
|
||||
|
||||
this->SetState(ActorUnkFLENState_0);
|
||||
return true;
|
||||
}
|
||||
|
||||
void ActorUnkFLEN::vfunc_20() {
|
||||
this->IsTimerOut();
|
||||
|
||||
switch (this->mState) {
|
||||
case ActorUnkFLENState_0:
|
||||
if (!this->func_ov000_02098a60(ActorUnkFLENState_0)) {
|
||||
break;
|
||||
}
|
||||
|
||||
this->SetState(ActorUnkFLENState_1);
|
||||
break;
|
||||
case ActorUnkFLENState_1:
|
||||
this->SetState(ActorUnkFLENState_2);
|
||||
break;
|
||||
case ActorUnkFLENState_2:
|
||||
if (!this->func_ov000_02098a60(0x0)) {
|
||||
this->SetState(ActorUnkFLENState_0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ActorUnkFLEN::SetState(ActorUnkFLENState state) {
|
||||
this->mState = state;
|
||||
|
||||
switch (state) {
|
||||
case ActorUnkFLENState_0:
|
||||
break;
|
||||
case ActorUnkFLENState_1:
|
||||
this->func_ov031_020f81f8();
|
||||
break;
|
||||
case ActorUnkFLENState_2:
|
||||
if (!this->mUnk_94) {
|
||||
this->Kill();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool ActorUnkFLEN::func_ov031_020f81f8() {
|
||||
ActorParams actorParams;
|
||||
ActorRef actorRef;
|
||||
|
||||
actorParams.mUnk_28 = 0;
|
||||
actorParams.func_ov000_020975f8();
|
||||
actorParams.mUnk_28 = this->mRef;
|
||||
actorParams.mInitialAngle = this->mAngle;
|
||||
|
||||
VecFx32_Copy(&this->mPos, &actorParams.mInitialPos);
|
||||
actorParams.mInitialPos.y += 0x5000;
|
||||
|
||||
u16 index = this->mUnk_5C.mParams[0];
|
||||
actorParams.mParams[0] = data_ov031_02110b90[index];
|
||||
|
||||
Actor::func_ov000_020973f4(&actorRef, &data_ov000_020b539c_eur, data_ov031_02110b94[index], &actorParams, 0x0);
|
||||
|
||||
return actorRef.type_index != 0;
|
||||
}
|
||||
|
||||
ActorUnkFLEN::~ActorUnkFLEN() {}
|
||||
ActorProfileUnkFLEN::~ActorProfileUnkFLEN() {}
|
||||
|
||||
Reference in New Issue
Block a user