mirror of
https://github.com/zeldaret/st
synced 2026-06-16 06:45:41 -04:00
Decompile Actors SWOB, SWTM, EVIC and EFIK (#46)
* decompile SWOB * match sinit * remove useless stuff * decompile actor swtm * decompile actor evic * mark evic as complete * decompile actor efik * EVIC -> EventIcon
This commit is contained in:
@@ -94,8 +94,8 @@ ARM void Actor::vfunc_00(Vec3p *param1) {
|
||||
// param1->z = this->mPos.z;
|
||||
}
|
||||
|
||||
ARM void Actor::func_ov000_0209853c(void) {
|
||||
data_027e0ce0->func_01fff148();
|
||||
ARM Vec3p *Actor::func_ov000_0209853c(unk32 param1) {
|
||||
return data_027e0ce0->func_01fff148(param1);
|
||||
}
|
||||
|
||||
ARM bool Actor::vfunc_04() {
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#include "Actor/ActorEventIcon.hpp"
|
||||
#include "System/SysNew.hpp"
|
||||
|
||||
ARM DECL_PROFILE(ActorProfileEventIcon);
|
||||
|
||||
ARM Actor *ActorProfileEventIcon::Create() {
|
||||
return new(HeapIndex_2) ActorEventIcon();
|
||||
}
|
||||
|
||||
ARM ActorProfileEventIcon::ActorProfileEventIcon() :
|
||||
ActorProfile(ActorId_EventIcon) {}
|
||||
|
||||
ARM ActorEventIcon::ActorEventIcon() {
|
||||
this->mUnk_10C = 0;
|
||||
}
|
||||
|
||||
ARM bool ActorEventIcon::vfunc_18(unk32 param1) {
|
||||
this->mUnk_094.func_ov000_0206082c(0x5D, this->mUnk_6c);
|
||||
return true;
|
||||
}
|
||||
|
||||
ARM ActorEventIcon::~ActorEventIcon() {}
|
||||
|
||||
ARM ActorProfileEventIcon::~ActorProfileEventIcon() {}
|
||||
@@ -1,7 +1,12 @@
|
||||
//! TODO: This file was generated automatically and might contain errors
|
||||
|
||||
#include "Actor/ActorUnkEFIK.hpp"
|
||||
#include "System/Random.hpp"
|
||||
#include "System/SysNew.hpp"
|
||||
#include "Unknown/UnkStruct_0204a110.hpp"
|
||||
#include "Unknown/UnkStruct_027e0cd8.hpp"
|
||||
#include "Unknown/UnkStruct_027e0cec.hpp"
|
||||
#include "Unknown/UnkStruct_ov000_020aed1c.hpp"
|
||||
|
||||
extern "C" void Unknown_func_ov000_0207fd7c(void *, void *, unk32);
|
||||
|
||||
ARM DECL_PROFILE(ActorProfileUnkEFIK);
|
||||
|
||||
@@ -12,12 +17,76 @@ ARM Actor *ActorProfileUnkEFIK::Create() {
|
||||
ARM ActorProfileUnkEFIK::ActorProfileUnkEFIK() :
|
||||
ActorProfile(ActorId_EFIK) {}
|
||||
|
||||
ARM ActorUnkEFIK::ActorUnkEFIK() {}
|
||||
ARM ActorUnkEFIK::ActorUnkEFIK() {
|
||||
this->mUnk_9C = -1;
|
||||
this->mUnk_A0 = 0;
|
||||
}
|
||||
|
||||
ARM void ActorUnkEFIK::func_ov000_0209c100(void) {}
|
||||
ARM void ActorUnkEFIK::func_ov000_0209c140(void) {}
|
||||
ARM void ActorUnkEFIK::func_ov000_0209c2d0(void) {}
|
||||
ARM void ActorUnkEFIK::func_ov000_0209c2e4(void) {}
|
||||
ARM bool ActorUnkEFIK::vfunc_18(unk32 param1) {
|
||||
this->mUnk_9C = 0x86F;
|
||||
this->mUnk_A0 = 4;
|
||||
this->mUnk_98.func_ov000_020a0334();
|
||||
this->vfunc_54(0);
|
||||
return true;
|
||||
}
|
||||
|
||||
ARM void ActorUnkEFIK::vfunc_20() {
|
||||
if (this->mUnk_94 != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
unk32 auStack_38[2];
|
||||
auStack_38[0] = data_ov000_020aed1c.mUnk_00;
|
||||
auStack_38[1] = data_ov000_020aed1c.mUnk_04;
|
||||
|
||||
int length = 1;
|
||||
if (data_0204a110.mUnk_008 == 1) {
|
||||
length = 2;
|
||||
}
|
||||
|
||||
for (int i = 0; i < length; i++) {
|
||||
u8 j;
|
||||
u8 k;
|
||||
UnkStruct_027e0cd8_0c *pUVar5 = data_027e0cd8->mUnk_0c;
|
||||
|
||||
u8 bStack_3c[2];
|
||||
bStack_3c[0] = 0;
|
||||
bStack_3c[1] = 0;
|
||||
|
||||
u8 bStack_3e[2];
|
||||
bStack_3e[0] = 0;
|
||||
bStack_3e[1] = 0;
|
||||
|
||||
Unknown_func_ov000_0207fd7c(bStack_3c, bStack_3e, auStack_38[i]);
|
||||
|
||||
for (j = bStack_3c[0]; j < bStack_3e[0]; j++) {
|
||||
for (k = bStack_3c[1]; k < bStack_3e[1]; k++) {
|
||||
u8 bStack_40[2];
|
||||
bStack_40[0] = j;
|
||||
bStack_40[1] = k;
|
||||
|
||||
if (pUVar5->func_ov000_02080180(bStack_40) == 0x38) {
|
||||
u16 random = gRandom.Next32(0, 6);
|
||||
|
||||
if (random == 0) {
|
||||
Vec3p vec;
|
||||
pUVar5->func_ov000_020808f4(&vec, bStack_40, 0);
|
||||
data_027e0cec->func_ov000_020a0220(&this->mUnk_98, &vec);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ARM void ActorUnkEFIK::vfunc_24() {
|
||||
this->vfunc_20();
|
||||
}
|
||||
|
||||
ARM void ActorUnkEFIK::vfunc_54(unk32 param1) {
|
||||
this->mUnk_94 = param1;
|
||||
}
|
||||
|
||||
ARM ActorUnkEFIK::~ActorUnkEFIK() {}
|
||||
|
||||
ARM ActorProfileUnkEFIK::~ActorProfileUnkEFIK() {}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
//! TODO: This file was generated automatically and might contain errors
|
||||
|
||||
#include "Actor/ActorUnkEVIC.hpp"
|
||||
#include "System/SysNew.hpp"
|
||||
|
||||
ARM DECL_PROFILE(ActorProfileUnkEVIC);
|
||||
|
||||
ARM Actor *ActorProfileUnkEVIC::Create() {
|
||||
return new(HeapIndex_2) ActorUnkEVIC();
|
||||
}
|
||||
|
||||
ARM ActorProfileUnkEVIC::ActorProfileUnkEVIC() :
|
||||
ActorProfile(ActorId_EVIC) {}
|
||||
|
||||
ARM ActorUnkEVIC::ActorUnkEVIC() {}
|
||||
|
||||
ARM void ActorUnkEVIC::func_ov000_0209c014(void) {}
|
||||
|
||||
ARM ActorUnkEVIC::~ActorUnkEVIC() {}
|
||||
ARM ActorProfileUnkEVIC::~ActorProfileUnkEVIC() {}
|
||||
@@ -1,7 +1,13 @@
|
||||
//! TODO: This file was generated automatically and might contain errors
|
||||
|
||||
#include "Actor/ActorUnkSWOB.hpp"
|
||||
#include "Actor/ActorManager.hpp"
|
||||
#include "System/Random.hpp"
|
||||
#include "System/SysNew.hpp"
|
||||
#include "Unknown/UnkStruct_027e0cd8.hpp"
|
||||
#include "Unknown/UnkStruct_027e0ce0.hpp"
|
||||
#include "Unknown/UnkStruct_ov000_020b5214.hpp"
|
||||
|
||||
extern "C" void func_01ffedac(u16 *, Vec3p *);
|
||||
extern "C" void func_01ffb9cc(void *, Vec3p *);
|
||||
|
||||
ARM DECL_PROFILE(ActorProfileUnkSWOB);
|
||||
|
||||
@@ -14,9 +20,107 @@ ARM ActorProfileUnkSWOB::ActorProfileUnkSWOB() :
|
||||
|
||||
ARM ActorUnkSWOB::ActorUnkSWOB() {}
|
||||
|
||||
ARM void ActorUnkSWOB::func_ov000_0209a948(void) {}
|
||||
ARM void ActorUnkSWOB::func_ov000_0209a9b4(void) {}
|
||||
ARM void ActorUnkSWOB::func_ov000_0209aa30(void) {}
|
||||
ARM bool ActorUnkSWOB::vfunc_18(unk32 param1) {
|
||||
this->mUnk_9E = this->mUnk_78;
|
||||
this->mUnk_94 = this->mUnk_6e;
|
||||
this->mUnk_98 = this->mUnk_70;
|
||||
this->mUnk_A0 = this->mUnk_9E + this->mUnk_6c;
|
||||
this->mUnk_A2 = this->mUnk_75;
|
||||
this->mUnk_9C = this->mUnk_9E;
|
||||
|
||||
if (this->func_ov000_02098a60(0)) {
|
||||
this->func_ov000_0209a9b4(1);
|
||||
} else {
|
||||
this->func_ov000_0209a9b4(0);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
ARM void ActorUnkSWOB::func_ov000_0209a9b4(unk32 param1) {
|
||||
this->mUnk_4c = param1;
|
||||
|
||||
switch (this->mUnk_4c) {
|
||||
case 0:
|
||||
this->func_ov000_02098a88(0, 0);
|
||||
break;
|
||||
case 1:
|
||||
this->func_ov000_02098a88(0, 1);
|
||||
|
||||
if (this->mUnk_94 == 0) {
|
||||
UNSET_FLAG(this->mFlags, ActorFlag_Alive);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
this->func_ov000_0209aa30();
|
||||
this->mUnk_52 = -1;
|
||||
this->mUnk_50 = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// https://decomp.me/scratch/cUf0c
|
||||
ARM void ActorUnkSWOB::func_ov000_0209aa30(void) {
|
||||
if (this->mUnk_4c == 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (this->mUnk_72) {
|
||||
case 1:
|
||||
data_ov000_020b5214.func_ov000_0206db44(0xA3);
|
||||
break;
|
||||
case 3:
|
||||
data_ov000_020b5214.func_ov000_0206db44(0xA3);
|
||||
|
||||
s16 unk_78 = this->mUnk_78;
|
||||
if (unk_78 > 0) {
|
||||
data_027e0cd8->func_ov000_02081d7c((s16) (unk_78 - 1), this->mUnk_75, 1);
|
||||
}
|
||||
break;
|
||||
case 2: {
|
||||
Vec3p temp;
|
||||
Vec3p vec2;
|
||||
Vec3p vec;
|
||||
Actor_5c_temp AStack_7c;
|
||||
u16 auStack_80[4];
|
||||
int j;
|
||||
u32 i;
|
||||
|
||||
data_ov000_020b5214.func_ov000_0206db44(0xA3);
|
||||
temp.coords = data_027e0ce0->func_01fff148(0)->coords;
|
||||
vec2.x = temp.x;
|
||||
vec2.y = temp.y + FLOAT_TO_Q20(3.0f);
|
||||
vec2.z = temp.z;
|
||||
|
||||
AStack_7c.mUnk_28 = 0;
|
||||
AStack_7c.func_ov000_020975f8();
|
||||
|
||||
for (j = 0, i = 0; i < ARRAY_LEN(this->mUnk_A4); i++) {
|
||||
if (gActorManager->func_01fff3b4(this->mUnk_A4[i].mUnk_00) == NULL) {
|
||||
this->mUnk_A4[i].mUnk_00 = 0;
|
||||
|
||||
vec.x = INT_TO_Q20(gRandom.Next32(0, 11) - 5);
|
||||
vec.y = 0;
|
||||
vec.z = INT_TO_Q20(gRandom.Next32(0, 11) - 5);
|
||||
|
||||
Vec3p_Add(&vec, &vec2, &vec);
|
||||
|
||||
if (j < 10) {
|
||||
func_01ffedac(auStack_80, &vec);
|
||||
func_01ffb9cc(&vec2, &vec);
|
||||
i--;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ARM ActorUnkSWOB::~ActorUnkSWOB() {}
|
||||
ARM ActorProfileUnkSWOB::~ActorProfileUnkSWOB() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! TODO: This file was generated automatically and might contain errors
|
||||
|
||||
#include "Actor/ActorUnkSWTM.hpp"
|
||||
#include "System/SysNew.hpp"
|
||||
#include "Unknown/UnkStruct_027e0cd8.hpp"
|
||||
#include "Unknown/UnkStruct_ov000_020b5214.hpp"
|
||||
|
||||
ARM DECL_PROFILE(ActorProfileUnkSWTM);
|
||||
|
||||
@@ -12,17 +12,192 @@ ARM Actor *ActorProfileUnkSWTM::Create() {
|
||||
ARM ActorProfileUnkSWTM::ActorProfileUnkSWTM() :
|
||||
ActorProfile(ActorId_SWTM) {}
|
||||
|
||||
ARM ActorUnkSWTM::ActorUnkSWTM() {}
|
||||
ARM ActorUnkSWTM::ActorUnkSWTM() :
|
||||
mUnk_94(0),
|
||||
mUnk_98(0),
|
||||
mUnk_9C(0),
|
||||
mUnk_9E(0),
|
||||
mUnk_A0(0),
|
||||
mUnk_A2(0),
|
||||
mUnk_A4(0),
|
||||
mUnk_A8(0) {}
|
||||
|
||||
ARM void ActorUnkSWTM::func_ov000_0209adf4(void) {}
|
||||
ARM void ActorUnkSWTM::func_ov000_0209ae68(void) {}
|
||||
ARM void ActorUnkSWTM::func_ov000_0209af50(void) {}
|
||||
ARM void ActorUnkSWTM::func_ov000_0209af54(void) {}
|
||||
ARM void ActorUnkSWTM::func_ov000_0209afe4(void) {}
|
||||
ARM void ActorUnkSWTM::func_ov000_0209b038(void) {}
|
||||
ARM void ActorUnkSWTM::func_ov000_0209b160(void) {}
|
||||
ARM void ActorUnkSWTM::func_ov000_0209b184(void) {}
|
||||
ARM void ActorUnkSWTM::func_ov000_0209b1d0(void) {}
|
||||
ARM ActorUnkSWTM::~ActorUnkSWTM() {
|
||||
if (this->mUnk_4c != 2 && this->func_ov000_02098a60(0) == 0) {
|
||||
this->func_ov000_0209b184();
|
||||
}
|
||||
}
|
||||
|
||||
// https://decomp.me/scratch/qkP8m
|
||||
ARM bool ActorUnkSWTM::vfunc_18(unk32 param1) {
|
||||
this->mUnk_9E = this->mUnk_78;
|
||||
this->mUnk_98 = this->mUnk_70;
|
||||
this->mUnk_A4 = this->mUnk_6e * 30;
|
||||
this->mUnk_A0 = this->mUnk_9E + this->mUnk_6c;
|
||||
this->mUnk_A2 = this->mUnk_75;
|
||||
this->mUnk_9C = this->mUnk_9E;
|
||||
|
||||
if (this->func_ov000_02098a60(0)) {
|
||||
this->func_ov000_0209af54(2);
|
||||
} else {
|
||||
this->func_ov000_0209af54(0);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
ARM void ActorUnkSWTM::vfunc_20(void) {
|
||||
switch (this->mUnk_4c) {
|
||||
case 0:
|
||||
if (!this->func_ov000_0209afe4()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->func_ov000_0209af54(1);
|
||||
break;
|
||||
case 1:
|
||||
this->mUnk_A8++;
|
||||
this->func_ov000_0209b1d0();
|
||||
|
||||
if (this->mUnk_A8 >= this->mUnk_A4) {
|
||||
this->func_ov000_0209af54(3);
|
||||
} else {
|
||||
switch (this->func_ov000_0209b038()) {
|
||||
case 1:
|
||||
this->func_ov000_0209af54(2);
|
||||
break;
|
||||
case 2:
|
||||
this->func_ov000_0209af54(3);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
case 3:
|
||||
if (this->mUnk_50 < this->mUnk_52) {
|
||||
this->mUnk_50++;
|
||||
}
|
||||
|
||||
if ((s32) this->mUnk_50 >= 15) {
|
||||
this->func_ov000_0209b184();
|
||||
this->func_ov000_0209af54(0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ARM void ActorUnkSWTM::vfunc_24(void) {}
|
||||
|
||||
ARM void ActorUnkSWTM::func_ov000_0209af54(unk32 param1) {
|
||||
this->mUnk_4c = param1;
|
||||
this->mUnk_A8 = 0;
|
||||
|
||||
switch (this->mUnk_4c) {
|
||||
case 0:
|
||||
this->func_ov000_02098a88(0, 0);
|
||||
break;
|
||||
case 1:
|
||||
this->mUnk_AC = false;
|
||||
this->mUnk_9C = this->mUnk_9E;
|
||||
break;
|
||||
case 2:
|
||||
this->func_ov000_02098a88(0, 1);
|
||||
|
||||
if (this->mUnk_94 == 0) {
|
||||
UNSET_FLAG(this->mFlags, ActorFlag_Alive);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
this->func_ov000_0209b160();
|
||||
this->mUnk_50 = 0;
|
||||
this->mUnk_52 = -1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ARM bool ActorUnkSWTM::func_ov000_0209afe4(void) {
|
||||
for (int i = this->mUnk_9E; i < this->mUnk_A0; i++) {
|
||||
if (data_027e0cd8->func_ov000_02081e30(i, this->mUnk_A2)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
ARM unk32 ActorUnkSWTM::func_ov000_0209b038(void) {
|
||||
switch (this->mUnk_98) {
|
||||
case 1:
|
||||
case 2: {
|
||||
int i;
|
||||
bool bVar1 = true;
|
||||
|
||||
for (i = this->mUnk_9E; i < this->mUnk_A0; i++) {
|
||||
if (i > this->mUnk_9C && data_027e0cd8->func_ov000_02081e30(i, this->mUnk_A2) != 0) {
|
||||
this->mUnk_AC = true;
|
||||
}
|
||||
|
||||
if (i == this->mUnk_9C && data_027e0cd8->func_ov000_02081e30(i, this->mUnk_A2) != 0) {
|
||||
this->mUnk_9C++;
|
||||
}
|
||||
|
||||
if (data_027e0cd8->func_ov000_02081e30(i, this->mUnk_A2) == 0) {
|
||||
bVar1 = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (bVar1) {
|
||||
if (!this->mUnk_AC) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
for (int i = 0; i < this->mUnk_6c; i++) {
|
||||
if (data_027e0cd8->func_ov000_02081e30(this->mUnk_9E + i, this->mUnk_A2) == 0) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
ARM void ActorUnkSWTM::func_ov000_0209b160(void) {
|
||||
if (this->mUnk_4c != 2) {
|
||||
data_ov000_020b5214.func_ov000_0206db44(0xA3);
|
||||
}
|
||||
}
|
||||
|
||||
ARM void ActorUnkSWTM::func_ov000_0209b184(void) {
|
||||
for (int i = this->mUnk_9E; i < this->mUnk_A0; i++) {
|
||||
data_027e0cd8->func_ov000_02081d7c(i, this->mUnk_A2, 0);
|
||||
}
|
||||
}
|
||||
|
||||
ARM void ActorUnkSWTM::func_ov000_0209b1d0(void) {
|
||||
if (this->mUnk_98 == 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->mUnk_A4 - this->mUnk_A8 < 0x3C) {
|
||||
data_ov000_020b5214.func_ov000_0206e7e8(0x92);
|
||||
} else {
|
||||
data_ov000_020b5214.func_ov000_0206e7e8(0x91);
|
||||
}
|
||||
}
|
||||
|
||||
ARM ActorUnkSWTM::~ActorUnkSWTM() {}
|
||||
ARM ActorProfileUnkSWTM::~ActorProfileUnkSWTM() {}
|
||||
|
||||
@@ -82,7 +82,7 @@ ARM bool ActorRupee::vfunc_18(unk32 param1) {
|
||||
}
|
||||
|
||||
if (this->mUnk_80 >= 0) {
|
||||
if (this->func_ov000_02098a60(0) != 0) {
|
||||
if (this->func_ov000_02098a60(0)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user