Decomp Actor

This commit is contained in:
Aetias
2024-05-19 13:09:58 +02:00
parent 135436ed81
commit ae6b47f0fd
21 changed files with 123 additions and 38 deletions
+4 -4
View File
@@ -956,9 +956,9 @@ _ZN5Actor18func_ov00_020c1ef8EP8CylinderP5Vec3pii: ; 0x020c1ef8
_020c1f58: .word gPlayer
arm_func_end _ZN5Actor18func_ov00_020c1ef8EP8CylinderP5Vec3pii
.global _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
arm_func_start _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
_ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii: ; 0x020c1f5c
.global _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
arm_func_start _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
_ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi: ; 0x020c1f5c
stmdb sp!, {r4, r5, r6, lr}
mov r6, r1
mov r5, r2
@@ -987,7 +987,7 @@ _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii: ; 0x020c1f5c
ldmia sp!, {r4, r5, r6, pc}
.align 2, 0
_020c1fc4: .word gPlayer
arm_func_end _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
arm_func_end _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
.global _ZN5Actor18func_ov00_020c1fc8Ej
arm_func_start _ZN5Actor18func_ov00_020c1fc8Ej
+1 -1
View File
@@ -54,7 +54,7 @@
.extern _ZN5Actor16CollidesWithLinkEv
.extern _ZN5Actor18CollidesWithPlayerEj
.extern _ZN5Actor18func_Ov00_020c1bfcEi
.extern _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
.extern _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
.extern _ZN5Actor18func_ov00_020c2988EP5Vec3piS1_
.extern _ZN5Actor18func_ov00_020c313cEj
.extern _ZN5Actor4KillEv
+1 -1
View File
@@ -2623,7 +2623,7 @@ _02114dc8:
mov r0, r6
mov r3, #0x800
str r5, [sp, #8]
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
mov r2, r5
movs r5, r0
strb r2, [r6, #0x77c]
+1 -1
View File
@@ -81,7 +81,7 @@
.extern _ZN5Actor18func_ov00_020c1c20Eii
.extern _ZN5Actor18func_ov00_020c1cf8Ev
.extern _ZN5Actor18func_ov00_020c1e2cEiP5Vec3p
.extern _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
.extern _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
.extern _ZN5Actor18func_ov00_020c1fc8Ej
.extern _ZN5Actor18func_ov00_020c23c4EP8ActorRefPS_
.extern _ZN5Actor18func_ov00_020c243cEiPi
+1 -1
View File
@@ -973,7 +973,7 @@ func_ov14_02120180: ; 0x02120180
add r1, sp, #0x3c
add r2, sp, #0x30
mov r0, r4
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
cmp r0, #0
beq _02120248
mov r0, r4
+1 -1
View File
@@ -53,7 +53,7 @@
.extern _ZN5Actor18func_ov00_020c1c20Eii
.extern _ZN5Actor18func_ov00_020c1da0EiP5Vec3p
.extern _ZN5Actor18func_ov00_020c1e2cEiP5Vec3p
.extern _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
.extern _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
.extern _ZN5Actor18func_ov00_020c2e7cEv
.extern _ZN5Actor18func_ov00_020c2ed4Ev
.extern _ZN5Actor18func_ov00_020c313cEj
+1 -1
View File
@@ -12415,7 +12415,7 @@ func_ov22_02177814: ; 0x02177814
add r2, sp, #0x18
mov r0, r4
mov r3, r3, asr #0x1
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
cmp r0, #0
beq _02177908
mov r0, #1
+1 -1
View File
@@ -44,7 +44,7 @@
.extern _ZN5Actor18func_ov00_020c1c20Eii
.extern _ZN5Actor18func_ov00_020c1d58Ev
.extern _ZN5Actor18func_ov00_020c1e2cEiP5Vec3p
.extern _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
.extern _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
.extern _ZN5Actor18func_ov00_020c1fc8Ej
.extern _ZN5Actor18func_ov00_020c23c4EP8ActorRefPS_
.extern _ZN5Actor18func_ov00_020c29ecEi
+1 -1
View File
@@ -2471,7 +2471,7 @@ _0216f780:
add r1, r4, #0x48
add r2, r2, #0x400
str ip, [sp, #8]
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
mov r0, #0
str r0, [sp]
add r1, r4, #0x23c
+1 -1
View File
@@ -35,7 +35,7 @@
.extern _ZN5Actor18func_ov00_020c198cEv
.extern _ZN5Actor18func_ov00_020c1e2cEiP5Vec3p
.extern _ZN5Actor18func_ov00_020c1ef8EP8CylinderP5Vec3pii
.extern _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
.extern _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
.extern _ZN5Actor18func_ov00_020c1fc8Ej
.extern _ZN5Actor18func_ov00_020c243cEiPi
.extern _ZN5Actor18func_ov00_020c313cEj
+2 -2
View File
@@ -5251,7 +5251,7 @@ func_ov27_02171f3c: ; 0x02171f3c
add r2, r6, #0x368
mov r3, #0x400
str r5, [sp, #8]
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
mov r0, r6
bl func_ov27_0217296c
b _0217245c
@@ -5297,7 +5297,7 @@ _02172018:
add r2, r6, #0x368
mov r3, #0x400
str r5, [sp, #8]
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
b _0217245c
_021720c4:
bl func_ov27_0216f358
+1 -1
View File
@@ -28,7 +28,7 @@
.extern _ZN5Actor15TrySetTransformEP9Transform
.extern _ZN5Actor16CollidesWithLinkEv
.extern _ZN5Actor18func_ov00_020c1e2cEiP5Vec3p
.extern _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
.extern _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
.extern _ZN5Actor18func_ov00_020c1fc8Ej
.extern _ZN5Actor18func_ov00_020c243cEiPi
.extern _ZN5Actor18func_ov00_020c2ebcEv
+1 -1
View File
@@ -5486,7 +5486,7 @@ _02171f74:
mov r0, r5
mov r3, #0x800
str ip, [sp, #8]
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
cmp r0, #0
movne r4, #0
_02172028:
+1 -1
View File
@@ -18,7 +18,7 @@
.extern _ZN5Actor18func_ov00_020c1c20Eii
.extern _ZN5Actor18func_ov00_020c1da0EiP5Vec3p
.extern _ZN5Actor18func_ov00_020c1e2cEiP5Vec3p
.extern _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
.extern _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
.extern _ZN5Actor18func_ov00_020c1fc8Ej
.extern _ZN5Actor18func_ov00_020c23c4EP8ActorRefPS_
.extern _ZN5Actor18func_ov00_020c243cEiPi
+1 -1
View File
@@ -5690,7 +5690,7 @@ _02180d84:
add r1, r1, #0x1c00
add r2, r4, #0x1d40
str r5, [sp, #8]
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
mov r0, r4
add r1, r4, #0x1000
mov r2, #0
+1 -1
View File
@@ -26,7 +26,7 @@
.extern _ZN5Actor18func_Ov00_020c1bfcEi
.extern _ZN5Actor18func_ov00_020c1c20Eii
.extern _ZN5Actor18func_ov00_020c1ef8EP8CylinderP5Vec3pii
.extern _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
.extern _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
.extern _ZN5Actor18func_ov00_020c1fc8Ej
.extern _ZN5Actor18func_ov00_020c243cEiPi
.extern _ZN5Actor18func_ov00_020c313cEj
+1 -1
View File
@@ -9886,7 +9886,7 @@ func_ov37_02184758: ; 0x02184758
add r1, sp, #0x18
add r2, sp, #0xc
mov r0, r4
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
cmp r0, #0
addeq sp, sp, #0x24
moveq r0, #0
+2 -2
View File
@@ -20,7 +20,7 @@
.extern _ZN5Actor18CollidesWithShieldEP8Cylinder
.extern _ZN5Actor18func_ov00_020c1cf8Ev
.extern _ZN5Actor18func_ov00_020c1d58Ev
.extern _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
.extern _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
.extern _ZN5Actor18func_ov00_020c1fc8Ej
.extern _ZN5Actor18func_ov00_020c243cEiPi
.extern _ZN5Actor18func_ov00_020c313cEj
@@ -80,7 +80,7 @@
.extern _ZN5Actor18CollidesWithShieldEP8Cylinder
.extern _ZN5Actor18func_ov00_020c1cf8Ev
.extern _ZN5Actor18func_ov00_020c1d58Ev
.extern _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
.extern _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
.extern _ZN5Actor18func_ov00_020c1fc8Ej
.extern _ZN5Actor18func_ov00_020c243cEiPi
.extern _ZN5Actor18func_ov00_020c313cEj
+3 -3
View File
@@ -2133,7 +2133,7 @@ _02191984:
mov r0, r4
rsb r3, r5, #0x334
str r5, [sp, #8]
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
_021919dc:
mov r0, #1
strb r0, [r4, #0x514]
@@ -4724,7 +4724,7 @@ _02193924:
str r5, [sp, #4]
str r2, [sp, #8]
add r2, r10, #0x1cc
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
ldr r0, [r10, #0x158]
cmp r0, #1
bne _02193b5c
@@ -4809,7 +4809,7 @@ _02193924:
ldr r3, _02193f30 ; =0x000004cd
add r1, r10, #0x48
add r2, r10, #0x1d8
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_ii
bl _ZN5Actor18func_ov00_020c1f5cEP5Vec3pS1_iS1_hi
_02193b5c:
ldr r0, _02193f34 ; =data_ov48_02194688
add r3, sp, #0x94
+3 -3
View File
@@ -118,11 +118,11 @@ public:
/* 11a */ bool mVisible;
/* 11b */ bool mUnk_11b;
/* 11c */ unk8 mUnk_11c;
/* 11d */ unk8 mUnk_11d;
/* 11d */ bool mUnk_11d;
/* 11e */ q4 mYOffset;
/* 120 */ s16 mUnk_120;
/* 122 */ unk16 mUnk_122;
/* 124 */ unk8 mUnk_124;
/* 124 */ u8 mUnk_124;
/* 125 */ unk8 mUnk_125;
/* 126 */ u16 mUnk_126;
/* 128 */ bool mUnk_128;
@@ -201,7 +201,7 @@ public:
bool func_ov00_020c1da0(s32 param1, Vec3p *param2);
bool func_ov00_020c1e2c(s32 param1, Vec3p *param2);
bool func_ov00_020c1ef8(Cylinder *param1, Vec3p *param2, s32 param3, s32 param4);
bool func_ov00_020c1f5c(Vec3p *param1, Vec3p *param2, s32 param3, Vec3p *param4, s32 param5, s32 param6);
bool func_ov00_020c1f5c(Vec3p *param1, Vec3p *param2, s32 param3, Vec3p *param4, u8 param5, s32 param6);
bool func_ov00_020c1fc8(PlayerCollide flags);
bool CollidesWithShield(Cylinder *param1);
bool CollidesWithPlayer(PlayerCollide flags);
+94 -9
View File
@@ -1,7 +1,12 @@
extern "C" {
#include <stdlib.h>
}
#include "Actor/Actor.hpp"
#include "Actor/ActorManager.hpp"
#include "Map/MapManager.hpp"
#include "Player/PlayerLinkBase.hpp"
#include "Save/AdventureFlags.hpp"
KILL(_ZN5ActorC1Ev)
Actor::Actor() {}
@@ -224,15 +229,95 @@ void Actor::func_ov00_020c1c20(s32 param1, unk32 param2) {
gMapManager->func_ov00_02084b38(mUnk_020.mUnk_0a[param1], mUnk_020.mUnk_08[param1], param2);
}
bool Actor::vfunc_48(unk32 param1) {}
bool Actor::vfunc_4c(unk32 *param1) {}
bool Actor::IsNearLink() {}
void Actor::func_ov00_020c1cf8() {}
bool Actor::func_ov00_020c1d58() {}
bool Actor::func_ov00_020c1da0(s32 param1, Vec3p *param2) {}
bool Actor::func_ov00_020c1e2c(s32 param1, Vec3p *param2) {}
bool Actor::func_ov00_020c1ef8(Cylinder *param1, Vec3p *param2, s32 param3, s32 param4) {}
bool Actor::func_ov00_020c1f5c(Vec3p *param1, Vec3p *param2, s32 param3, Vec3p *param4, s32 param5, s32 param6) {}
bool Actor::vfunc_48(unk32 param1) {
return true;
}
extern "C" void func_ov00_020c8398(ActorTypeId type, Vec3p *pos, unk32 param2);
bool Actor::vfunc_4c(unk32 *param1) {
if ((*param1 & 0x1f) == 0x8) {
func_ov00_020c8398(mType, &mPos, 1);
this->Kill();
return true;
}
this->Kill();
return true;
}
bool Actor::IsNearLink() {
Vec3p playerPos = gPlayerPos;
q20 z = playerPos.z;
q20 dx = abs(playerPos.x - mPos.x);
if (dx > FLOAT_TO_Q20(10.0)) return false;
q20 dz = abs(playerPos.z - mPos.z);
return dz <= FLOAT_TO_Q20(10.0);
}
void Actor::func_ov00_020c1cf8() {
if ((!mUnk_0a4.mUnk_00 && !mUnk_0a4.mUnk_01) || !(mUnk_129 != true && mUnk_11d != true && mUnk_11b != true)) {
mInactive = 0;
} else {
if (this->IsNearLink()) {
mInactive = 1;
} else {
mInactive = 2;
}
}
}
bool Actor::func_ov00_020c1d58() {
if (gAdventureFlags->func_ov00_02097738()) return false;
return gPlayer->vfunc_04() != false;
}
bool Actor::func_ov00_020c1da0(s32 param1, Vec3p *param2) {
if (!this->func_ov00_020c1d58()) return false;
Vec3p vec;
if (param2) {
vec = *param2;
} else {
Vec3p_Sub(&gPlayerPos, &mPrevPos, &vec);
}
return gPlayer->vfunc_30(mUnk_124, &vec, param1);
}
bool Actor::func_ov00_020c1e2c(s32 param1, Vec3p *param2) {
if (!this->func_ov00_020c1d58()) return false;
if (mHitbox.size < 0) return false;
Vec3p vec;
if (param2) {
vec = *param2;
} else {
Vec3p_Sub(&gPlayerPos, &mPrevPos, &vec);
}
Cylinder hitbox;
this->GetHitbox(&hitbox);
if (gPlayer->CollidesWith(&hitbox)) {
return gPlayer->vfunc_30(mUnk_124, &vec, param1);
}
return false;
}
bool Actor::func_ov00_020c1ef8(Cylinder *param1, Vec3p *param2, s32 param3, s32 param4) {
if (!this->func_ov00_020c1d58()) return false;
if (gPlayer->CollidesWith(param1)) {
return gPlayer->vfunc_30(param3, param2, param4);
}
return false;
}
bool Actor::func_ov00_020c1f5c(Vec3p *param1, Vec3p *param2, s32 param3, Vec3p *param4, u8 param5, s32 param6) {
if (!this->func_ov00_020c1d58()) return false;
if (gPlayer->func_ov00_020a7c60(param1, param2, param3)) {
return gPlayer->vfunc_30(param5, param4, param6);
}
return false;
}
bool Actor::func_ov00_020c1fc8(PlayerCollide flags) {}
bool Actor::CollidesWithShield(Cylinder *param1) {}
bool Actor::CollidesWithPlayer(PlayerCollide flags) {}