mirror of https://github.com/zeldaret/tp.git
Merge 7cba5ad766
into c32789eb60
This commit is contained in:
commit
1d7706de9e
|
@ -1863,7 +1863,7 @@ config.libs = [
|
|||
ActorRel(NonMatching, "d_a_npc_ykm"),
|
||||
ActorRel(NonMatching, "d_a_npc_ykw"),
|
||||
ActorRel(NonMatching, "d_a_npc_zanb"),
|
||||
ActorRel(NonMatching, "d_a_npc_zant"),
|
||||
ActorRel(Equivalent, "d_a_npc_zant"), # weak func order
|
||||
ActorRel(NonMatching, "d_a_npc_zelR"),
|
||||
ActorRel(NonMatching, "d_a_npc_zelRo"),
|
||||
ActorRel(Equivalent, "d_a_npc_zelda"), # weak function order
|
||||
|
@ -2029,7 +2029,7 @@ config.libs = [
|
|||
ActorRel(NonMatching, "d_a_obj_lv6Tenbin"),
|
||||
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_lv6TogeRoll"),
|
||||
ActorRel(NonMatching, "d_a_obj_lv6TogeTrap"),
|
||||
ActorRel(NonMatching, "d_a_obj_lv6bemos"),
|
||||
ActorRel(MatchingFor("GZ2E01"), "d_a_obj_lv6bemos"),
|
||||
ActorRel(NonMatching, "d_a_obj_lv6bemos2"),
|
||||
ActorRel(NonMatching, "d_a_obj_lv6egate"),
|
||||
ActorRel(NonMatching, "d_a_obj_lv6elevta"),
|
||||
|
|
|
@ -17,17 +17,35 @@ class daMant_packet_c : public J3DPacket {
|
|||
|
||||
/* 0x0010 */ Mtx mMtx;
|
||||
/* 0x0040 */ Mtx mMtx2;
|
||||
/* 0x0070 */ dKy_tevstr_c* field_0x70;
|
||||
/* 0x0070 */ dKy_tevstr_c* mTevStr;
|
||||
/* 0x0074 */ u8 field_0x74;
|
||||
/* 0x0075 */ u8 field_0x75[0x78 - 0x75];
|
||||
/* 0x0078 */ cXyz mPos[338];
|
||||
/* 0x1050 */ cXyz mNrm[338];
|
||||
/* 0x0078 */ cXyz mPos[2][169];
|
||||
/* 0x1050 */ cXyz mNrm[2][169];
|
||||
/* 0x2028 */ u8 field_0x2028;
|
||||
/* 0x2029 */ u8 mArg0;
|
||||
/* 0x202a */ u8 field_0x202a[0x202b - 0x202a];
|
||||
|
||||
daMant_packet_c() {
|
||||
field_0x74 = 0;
|
||||
}
|
||||
|
||||
cXyz* getPos() {
|
||||
return this->mPos + this->field_0x74 * 0xa9;
|
||||
return &mPos[field_0x74][0];
|
||||
}
|
||||
|
||||
cXyz* getNrm() {
|
||||
return &mNrm[field_0x74][0];
|
||||
}
|
||||
|
||||
void setTevStr(dKy_tevstr_c* tevStr) {
|
||||
mTevStr = tevStr;
|
||||
}
|
||||
|
||||
MtxP getMtx2() {
|
||||
return mMtx2;
|
||||
}
|
||||
|
||||
MtxP getMtx() {
|
||||
return mMtx;
|
||||
}
|
||||
};
|
||||
struct mant_j_s {
|
||||
|
|
|
@ -73,7 +73,7 @@ STATIC_ASSERT(sizeof(daNpc_Zant_c) == 0xfa0);
|
|||
|
||||
class daNpc_Zant_Param_c {
|
||||
public:
|
||||
/* 80B6E93C */ ~daNpc_Zant_Param_c() {};
|
||||
/* 80B6E93C */ virtual ~daNpc_Zant_Param_c() {}
|
||||
struct Data {
|
||||
/* 0x00 */ f32 field_0x0;
|
||||
/* 0x04 */ f32 field_0x4;
|
||||
|
@ -118,5 +118,13 @@ public:
|
|||
static const Data m;
|
||||
};
|
||||
|
||||
class daNpc_Zant_HIO_c {
|
||||
public:
|
||||
virtual ~daNpc_Zant_HIO_c() {}
|
||||
|
||||
#if DEBUG
|
||||
daNpc_Zant_Param_c::Data param;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* D_A_NPC_ZANT_H */
|
||||
|
|
|
@ -70,7 +70,7 @@ public:
|
|||
}
|
||||
|
||||
u32 getTalkAngle() {
|
||||
u32 talkAngle = (fopAcM_GetParam(this) & 0xe0) >> 5;
|
||||
u32 talkAngle = (fopAcM_GetParam(this) >> 5) & 0x7;
|
||||
if (talkAngle == 7) {
|
||||
return 0;
|
||||
} else {
|
||||
|
|
|
@ -100,6 +100,10 @@ inline void cMtx_multVecArray(Mtx mtx, const Vec* src, Vec* dst, u32 count) {
|
|||
mDoMtx_multVecArray(mtx, src, dst, count);
|
||||
}
|
||||
|
||||
inline void cMtx_inverseTranspose(const Mtx a, Mtx b) {
|
||||
mDoMtx_inverseTranspose(a, b);
|
||||
}
|
||||
|
||||
inline void mDoMtx_multVecZero(CMtxP param_0, Vec* param_1) {
|
||||
param_1->x = param_0[0][3];
|
||||
param_1->y = param_0[1][3];
|
||||
|
|
|
@ -9,20 +9,7 @@
|
|||
#include "d/d_com_inf_game.h"
|
||||
#include "dol2asm.h"
|
||||
|
||||
/* 80862D20-80862D2C 000000 000C+00 1/1 0/0 0/0 .data cNullVec__6Z2Calc */
|
||||
static u8 cNullVec__6Z2Calc[12] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
/* 80862D2C-80862D40 00000C 0004+10 0/0 0/0 0/0 .data @1787 */
|
||||
static u32 lit_1787[1 + 4 /* padding */] = {
|
||||
0x02000201,
|
||||
/* padding */
|
||||
0x40080000,
|
||||
0x00000000,
|
||||
0x3FE00000,
|
||||
0x00000000,
|
||||
};
|
||||
UNK_REL_DATA
|
||||
|
||||
/* 80862D40-80866D40 000020 4000+00 2/1 0/0 0/0 .data l_Egnd_mantTEX */
|
||||
#include "assets/l_Egnd_mantTEX.h"
|
||||
|
@ -276,15 +263,15 @@ static void* tex_d[2] = {
|
|||
static char lbl_277_bss_0;
|
||||
|
||||
/* 80861298-808616B8 000078 0420+00 1/0 0/0 0/0 .text draw__15daMant_packet_cFv */
|
||||
// NONMATCHING - missing some weird stack duplication
|
||||
void daMant_packet_c::draw() {
|
||||
// NONMATCHING
|
||||
void* image = tex_d[0];
|
||||
void* lut = pal_d;
|
||||
|
||||
j3dSys.reinitGX();
|
||||
GXSetNumIndStages(0);
|
||||
dKy_setLight_again();
|
||||
dKy_GxFog_tevstr_set(this->field_0x70);
|
||||
dKy_GxFog_tevstr_set(this->mTevStr);
|
||||
GXClearVtxDesc();
|
||||
|
||||
GXSetVtxDesc(GX_VA_POS, GX_INDEX8);
|
||||
|
@ -296,7 +283,7 @@ void daMant_packet_c::draw() {
|
|||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_F32, 0);
|
||||
|
||||
GXSetArray(GX_VA_POS, this->getPos(), 12);
|
||||
GXSetArray(GX_VA_NRM, &this->mNrm[this->field_0x74 * 0xa9], 12);
|
||||
GXSetArray(GX_VA_NRM, this->getNrm(), 12);
|
||||
GXSetArray(GX_VA_TEX0, &l_texCoord, 8);
|
||||
|
||||
GXSetZCompLoc(0);
|
||||
|
@ -304,11 +291,11 @@ void daMant_packet_c::draw() {
|
|||
GXSetNumChans(1);
|
||||
GXSetChanCtrl(GX_COLOR0, GX_ENABLE, GX_SRC_REG, GX_SRC_REG, 0xff, GX_DF_CLAMP, GX_AF_SPOT);
|
||||
GXSetNumTexGens(1);
|
||||
GXSetTexCoordGen2(GX_TEXCOORD0,GX_TG_MTX2x4,GX_TG_TEX0,0x3c,0,0x7d);
|
||||
GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 0x3c);
|
||||
GXSetNumTevStages(1);
|
||||
GXSetTevSwapMode(GX_TEVSTAGE0, GX_TEV_SWAP0, GX_TEV_SWAP0);
|
||||
|
||||
dKy_Global_amb_set(this->field_0x70);
|
||||
dKy_Global_amb_set(this->mTevStr);
|
||||
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
|
||||
|
||||
GXColor local_84 = {1, 0, 0, 0};
|
||||
|
@ -325,10 +312,10 @@ void daMant_packet_c::draw() {
|
|||
GXSetAlphaCompare(GX_GREATER, 0, GX_AOP_OR, GX_GREATER, 0);
|
||||
|
||||
GXTlutObj GStack_80;
|
||||
GXInitTlutObj(&GStack_80,pal_d,GX_TL_RGB5A3,0x100);
|
||||
GXInitTlutObj(&GStack_80, lut, GX_TL_RGB5A3, 0x100);
|
||||
|
||||
GXTexObj GStack_74;
|
||||
GXInitTexObjCI(&GStack_74,lut,0x80,0x80,GX_TF_C8,GX_CLAMP,GX_CLAMP,0,0);
|
||||
GXInitTexObjCI(&GStack_74, image, 0x80, 0x80, GX_TF_C8, GX_CLAMP, GX_CLAMP, 0, 0);
|
||||
GXInitTexObjLOD(&GStack_74, GX_LINEAR, GX_LINEAR, 0.0, 0.0, 0.0, 0, 0, GX_ANISO_1);
|
||||
|
||||
GXLoadTlut(&GStack_80, 0);
|
||||
|
@ -338,12 +325,12 @@ void daMant_packet_c::draw() {
|
|||
|
||||
GXLoadPosMtxImm(this->mMtx, GX_PNMTX0);
|
||||
Mtx MStack_54;
|
||||
mDoMtx_inverseTranspose(this->mMtx, MStack_54);
|
||||
cMtx_inverseTranspose(this->mMtx, MStack_54);
|
||||
|
||||
GXLoadNrmMtxImm(MStack_54, GX_PNMTX0);
|
||||
GXCallDisplayList(l_Egnd_mantDL, 0x3e0);
|
||||
|
||||
GXInitTexObjCI(&GStack_74,image,0x80,0x80,GX_TF_C8,GX_CLAMP,GX_CLAMP,0,0);
|
||||
GXInitTexObjCI(&GStack_74, l_Egnd_mantTEX_U, 0x80, 0x80, GX_TF_C8, GX_CLAMP, GX_CLAMP, 0, 0);
|
||||
GXInitTexObjLOD(&GStack_74, GX_LINEAR, GX_LINEAR, 0.0, 0.0, 0.0, 0, 0, GX_ANISO_1);
|
||||
GXLoadTexObj(&GStack_74, GX_TEXMAP0);
|
||||
|
||||
|
@ -354,7 +341,7 @@ void daMant_packet_c::draw() {
|
|||
|
||||
GXSetCullMode(GX_CULL_FRONT);
|
||||
GXLoadPosMtxImm(this->mMtx2, GX_PNMTX0);
|
||||
mDoMtx_inverseTranspose(this->mMtx2, MStack_54);
|
||||
cMtx_inverseTranspose(this->mMtx2, MStack_54);
|
||||
|
||||
GXLoadNrmMtxImm(MStack_54, GX_PNMTX0);
|
||||
GXCallDisplayList(l_Egnd_mantDL, 0x3e0);
|
||||
|
@ -365,19 +352,15 @@ void daMant_packet_c::draw() {
|
|||
|
||||
/* 808616B8-8086176C 000498 00B4+00 1/0 0/0 0/0 .text daMant_Draw__FP10mant_class */
|
||||
static int daMant_Draw(mant_class* i_this) {
|
||||
// NONMATCHING
|
||||
g_env_light.settingTevStruct(0, &i_this->current.pos, &i_this->tevStr);
|
||||
|
||||
MtxTrans(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
Mtx* viewMtx = &j3dSys.mViewMtx;
|
||||
Mtx* mtx1 = &i_this->field_0x0570.mMtx;
|
||||
cMtx_concat(*viewMtx, *calc_mtx, *mtx1);
|
||||
cMtx_concat(j3dSys.getViewMtx(), *calc_mtx, i_this->field_0x0570.getMtx());
|
||||
|
||||
Mtx* mtx2 = &i_this->field_0x0570.mMtx2;
|
||||
cMtx_concat(*viewMtx, *calc_mtx, *mtx2);
|
||||
cMtx_concat(j3dSys.getViewMtx(), *calc_mtx, i_this->field_0x0570.getMtx2());
|
||||
|
||||
i_this->field_0x0570.field_0x70 = &i_this->tevStr;
|
||||
i_this->field_0x0570.setTevStr(&i_this->tevStr);
|
||||
|
||||
j3dSys.getDrawBuffer(0)->entryImm(&i_this->field_0x0570, 0);
|
||||
|
||||
|
@ -385,8 +368,8 @@ static int daMant_Draw(mant_class* i_this) {
|
|||
}
|
||||
|
||||
/* 8086176C-80861F60 00054C 07F4+00 1/1 0/0 0/0 .text joint_control__FP10mant_classP8mant_j_siff */
|
||||
// NONMATCHING - regalloc
|
||||
static void joint_control(mant_class* i_this, mant_j_s* param_2, int param_3, f32 param_4, f32 param_5) {
|
||||
// NONMATCHING
|
||||
static f32 d_p[12] = {
|
||||
1.4000001f, 0.6f, 0.35f, 0.3f, 0.3f, 0.3f, 0.25f, 0.2f, 0.2f, 0.2f, 0.15f, 0.1f
|
||||
};
|
||||
|
@ -457,7 +440,7 @@ static void joint_control(mant_class* i_this, mant_j_s* param_2, int param_3, f3
|
|||
// (1.0f / 100.0f)
|
||||
if (param_4 > 0.01f) {
|
||||
dVar16 = 0.0f;
|
||||
f32 dVar14 = param_4 * (i * 0.05f + 1.0f);
|
||||
f32 dVar14 = param_4 * (i * 0.2f + 1.0f);
|
||||
cMtx_YrotS(*calc_mtx, param_2->field_0x013a);
|
||||
cMtx_XrotM(*calc_mtx, param_2->field_0x0138);
|
||||
|
||||
|
@ -539,16 +522,15 @@ static void joint_control(mant_class* i_this, mant_j_s* param_2, int param_3, f3
|
|||
|
||||
/* 80861F9C-80862424 000D7C 0488+00 1/1 0/0 0/0 .text mant_v_calc__FP10mant_class */
|
||||
static void mant_v_calc(mant_class* i_this) {
|
||||
// NONMATCHING
|
||||
cXyz local_e4, cStack_f0, local_fc, local_108;
|
||||
f32 dVar16, dVar15, dVar14, uVar15;
|
||||
csXyz local_134(0, 0, 0);
|
||||
// mant_j_s* mantJS;
|
||||
mant_j_s* mantJS;
|
||||
|
||||
local_fc = i_this->field_0x3928[0] - i_this->field_0x3928[1];
|
||||
local_134.y = cM_atan2s(local_fc.x, local_fc.z) + 0x4000;
|
||||
|
||||
// mantJS = i_this->field_0x25a8;
|
||||
mantJS = i_this->field_0x25a8;
|
||||
|
||||
local_e4.x = 0.0f;
|
||||
|
||||
|
@ -558,7 +540,7 @@ static void mant_v_calc(mant_class* i_this) {
|
|||
|
||||
local_108 = (i_this->current.pos - i_this->field_0x3940) * 0.9f;
|
||||
|
||||
if (10.0f < local_108.abs()) {
|
||||
if (local_108.abs() < 10.0f) {
|
||||
uVar15 = 0.0f;
|
||||
} else {
|
||||
local_134.y = cM_atan2s(local_108.x, local_108.z);
|
||||
|
@ -575,7 +557,7 @@ static void mant_v_calc(mant_class* i_this) {
|
|||
f32 uVar14 = 0.0f;
|
||||
if (i_this->field_0x3965 == 0) {
|
||||
if (i_this->field_0x3969 == 1) {
|
||||
uVar14 = (1.0f / 20.0f);
|
||||
uVar14 = (1.0f / 5.0f);
|
||||
} else if (i_this->field_0x3969 == 2) {
|
||||
uVar14 = 0.6f;
|
||||
} else if (i_this->field_0x3969 == 3) {
|
||||
|
@ -583,30 +565,30 @@ static void mant_v_calc(mant_class* i_this) {
|
|||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 13; i++) {
|
||||
for (int i = 0; i < 13; i++, mantJS++) {
|
||||
i_this->field_0x25a8[i].field_0x0[0].x = i_this->field_0x3928[1].x + (dVar16 * i);
|
||||
i_this->field_0x25a8[i].field_0x0[0].y = i_this->field_0x3928[1].y + (dVar15 * i);
|
||||
i_this->field_0x25a8[i].field_0x0[0].z = i_this->field_0x3928[1].z + (dVar14 * i);
|
||||
|
||||
cMtx_YrotS(*calc_mtx, local_134.y);
|
||||
|
||||
local_e4.z = cM_fsin(i * 0.2617994f);
|
||||
local_e4.y = local_e4.z * -10.0f;
|
||||
local_e4.z = local_e4.z * -20.0f;
|
||||
f32 temp = cM_fsin(i * 0.2617994f);
|
||||
local_e4.y = temp * -10.0f;
|
||||
local_e4.z = temp * -20.0f;
|
||||
|
||||
MtxPosition(&local_e4, &cStack_f0);
|
||||
|
||||
i_this->field_0x25a8[i].field_0x0[i] += cStack_f0;
|
||||
i_this->field_0x25a8[i].field_0x0[0] += cStack_f0;
|
||||
|
||||
i_this->field_0x25a8[i].field_0x0138 = local_134.x;
|
||||
i_this->field_0x25a8[i].field_0x013a = local_134.y + (i + -6) * 0x5dc;
|
||||
|
||||
for (int j = 0; j < 12; j++) {
|
||||
for (int j = 1; j < 13; j++) {
|
||||
i_this->field_0x25a8[i].field_0x0[j].x += local_108.x;
|
||||
i_this->field_0x25a8[i].field_0x0[j].z += local_108.z;
|
||||
}
|
||||
|
||||
joint_control(i_this, i_this->field_0x25a8, i, uVar15, uVar14);
|
||||
joint_control(i_this, mantJS, i, uVar15, uVar14);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -629,9 +611,8 @@ static int mant_cut_type;
|
|||
|
||||
/* 808624E8-80862908 0012C8 0420+00 2/1 0/0 0/0 .text daMant_Execute__FP10mant_class */
|
||||
static int daMant_Execute(mant_class* i_this) {
|
||||
// NONMATCHING
|
||||
f32 in_f30, in_f31;
|
||||
int unaff_r29, iVar2, uVar1, uVar4;
|
||||
f32 var_f31, var_f30;
|
||||
int iVar8, unaff_r29, iVar2, uVar1, uVar4;
|
||||
|
||||
i_this->field_0x25a0++;
|
||||
lbl_277_bss_0++;
|
||||
|
@ -668,7 +649,7 @@ static int daMant_Execute(mant_class* i_this) {
|
|||
|
||||
i_this->field_0x3940 = i_this->current.pos;
|
||||
|
||||
int iVar8 = 0;
|
||||
iVar8 = 0;
|
||||
|
||||
if (i_this->field_0x3967 != 0) {
|
||||
mant_cut_type = i_this->field_0x3967;
|
||||
|
@ -684,18 +665,18 @@ static int daMant_Execute(mant_class* i_this) {
|
|||
}
|
||||
|
||||
unaff_r29 = cM_rndF(65536.0f);
|
||||
in_f31 = cM_rndFX(32.0f);
|
||||
in_f30 = cM_rndFX(32.0f);
|
||||
var_f31 = cM_rndFX(32.0f);
|
||||
var_f30 = cM_rndFX(32.0f);
|
||||
}
|
||||
|
||||
i_this->field_0x3967 = 0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < iVar8; i++) {
|
||||
in_f31 += cM_ssin(unaff_r29);
|
||||
in_f30 -= cM_scos(unaff_r29);
|
||||
var_f31 += cM_ssin(unaff_r29);
|
||||
var_f30 -= cM_scos(unaff_r29);
|
||||
|
||||
uVar4 = (int)(in_f31 + 64.0f) | (int)(in_f30 + 64.0f) << 7;
|
||||
uVar4 = (int)(var_f31 + 64.0f) | (int)(var_f30 + 64.0f) << 7;
|
||||
|
||||
if (mant_cut_type == 0) {
|
||||
if (i <= 3 || 36 <= i) {
|
||||
|
@ -720,34 +701,30 @@ static int daMant_Execute(mant_class* i_this) {
|
|||
}
|
||||
|
||||
for (int j = 0; j < iVar2; j++) {
|
||||
if (j != 0) {
|
||||
if (j == 1) {
|
||||
uVar4 = uVar1++;
|
||||
if (j == 0) {
|
||||
uVar1 = uVar4;
|
||||
} else if (j == 1) {
|
||||
uVar1 = uVar4 + 1;
|
||||
} else if (j == 2) {
|
||||
uVar4 = uVar1 + 0x80;
|
||||
uVar1 = uVar4 + 0x80;
|
||||
} else if (j == 3) {
|
||||
uVar4 = uVar1 + 0x81;
|
||||
} else {
|
||||
if (j == 3) {
|
||||
uVar4 = uVar1 + 0x81;
|
||||
} else {
|
||||
if (j == 4) {
|
||||
uVar4 = uVar1 + 2;
|
||||
uVar1 = uVar4 + 0x81;
|
||||
} else if (j == 3) {
|
||||
uVar1 = uVar4 + 0x81;
|
||||
} else if (j == 4) {
|
||||
uVar1 = uVar4 + 2;
|
||||
} else if (j == 5) {
|
||||
uVar4 = uVar1 + 0x82;
|
||||
uVar1 = uVar4 + 0x82;
|
||||
} else if (j == 6) {
|
||||
uVar4 = uVar1 + 0x102;
|
||||
uVar1 = uVar4 + 0x102;
|
||||
} else if (j == 7) {
|
||||
uVar4 = uVar1 + 0x101;
|
||||
uVar1 = uVar4 + 0x101;
|
||||
} else if (j == 8) {
|
||||
uVar4 = uVar1 + 0x100;
|
||||
}
|
||||
}
|
||||
}
|
||||
uVar1 = uVar4 + 0x100;
|
||||
}
|
||||
|
||||
if (0 <= uVar4 && uVar4 < 0x4000) {
|
||||
int iVar5 = (uVar4 & 7) + (uVar4 & 0x78) * 4 + (uVar4 >> 4 & 0x18) + (uVar4 & 0x3e00);
|
||||
if (0 <= uVar1 && uVar1 < 0x4000) {
|
||||
int iVar5 = (uVar1 & 7) + (uVar1 & 0x78) * 4 + (uVar1 >> 4 & 0x18) + (uVar1 & 0x3e00);
|
||||
l_Egnd_mantTEX_U[iVar5] = 0;
|
||||
l_Egnd_mantTEX[iVar5] = 0;
|
||||
}
|
||||
|
@ -769,11 +746,10 @@ static int daMant_Delete(mant_class* i_this) {
|
|||
|
||||
/* 80862918-80862AC0 0016F8 01A8+00 1/0 0/0 0/0 .text daMant_Create__FP10fopAc_ac_c */
|
||||
static int daMant_Create(fopAc_ac_c* i_this) {
|
||||
// NONMATCHING
|
||||
mant_class* m_this = (mant_class*)i_this;
|
||||
|
||||
// m_this->field_0x0570.field_0x74 = 0;
|
||||
fopAcM_SetupActor(m_this, mant_class);
|
||||
//m_this->field_0x0570.field_0x74 = 0;
|
||||
m_this->field_0x259c = fopAcM_GetParam(i_this);
|
||||
|
||||
fopAcM_SetMin(i_this, -2000.0f, -2000.0f, -2000.0f);
|
||||
|
|
|
@ -8,12 +8,6 @@
|
|||
#include "f_op/f_op_actor_mng.h"
|
||||
#include "SSystem/SComponent/c_counter.h"
|
||||
|
||||
/* 80B6ED28-80B6ED34 000008 000C+00 1/1 0/0 0/0 .bss @3811 */
|
||||
static u8 lit_3811[12];
|
||||
|
||||
/* 80B6ED34-80B6ED38 000014 0004+00 1/1 0/0 0/0 .bss l_HIO */
|
||||
static u8 l_HIO[4];
|
||||
|
||||
UNK_REL_DATA
|
||||
|
||||
/* 80B6EAB4-80B6EABC 000020 0008+00 1/1 0/0 0/0 .data l_bmdData */
|
||||
|
@ -73,6 +67,9 @@ daNpc_Zant_c::cutFunc daNpc_Zant_c::mCutList[1] = {
|
|||
NULL
|
||||
};
|
||||
|
||||
/* 80B6ED34-80B6ED38 000014 0004+00 1/1 0/0 0/0 .bss l_HIO */
|
||||
static daNpc_Zant_Param_c l_HIO;
|
||||
|
||||
/* 80B6C1AC-80B6C2D0 0000EC 0124+00 1/0 0/0 0/0 .text __dt__12daNpc_Zant_cFv */
|
||||
daNpc_Zant_c::~daNpc_Zant_c() {
|
||||
OS_REPORT("|%06d:%x|daNpc_Zant_c -> デストラクト\n", g_Counter.mCounter0, this);
|
||||
|
@ -444,7 +441,7 @@ void daNpc_Zant_c::drawGhost() {
|
|||
/* 80B6D21C-80B6D264 00115C 0048+00 1/1 0/0 0/0 .text selectAction__12daNpc_Zant_cFv */
|
||||
int daNpc_Zant_c::selectAction() {
|
||||
field_0xf84 = NULL;
|
||||
field_0xf84 = &daNpc_Zant_c::talk;
|
||||
field_0xf84 = &daNpc_Zant_c::wait;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,6 @@ const static dCcD_SrcSph l_sph_src = {
|
|||
|
||||
/* 80C7CB18-80C7CE24 000078 030C+00 1/1 0/0 0/0 .text nodeCallBack__FP8J3DJointi */
|
||||
static int nodeCallBack(J3DJoint* i_joint, int param_2) {
|
||||
// NONMATCHING
|
||||
if (param_2 == 0) {
|
||||
int jntNo = i_joint->getJntNo();
|
||||
J3DModel* model = j3dSys.getModel();
|
||||
|
@ -66,11 +65,12 @@ static int nodeCallBack(J3DJoint* i_joint, int param_2) {
|
|||
}
|
||||
|
||||
f32 fVar1 = player->current.pos.absXZ(i_this->field_0x894);
|
||||
f32 yDiff = i_this->field_0x894.y - player->current.pos.y;
|
||||
if (fVar1 > i_this->field_0x914) {
|
||||
fVar1 -= i_this->field_0x914;
|
||||
}
|
||||
|
||||
s16 sVar1 = cM_atan2s(i_this->field_0x894.y - player->current.pos.y, fVar1);
|
||||
s16 sVar1 = cM_atan2s(yDiff, fVar1);
|
||||
if (sVar1 > 8000) {
|
||||
sVar1 = 8000;
|
||||
}
|
||||
|
@ -282,7 +282,8 @@ void daObjL6Bm_c::action() {
|
|||
|
||||
/* 80C7D598-80C7D6CC 000AF8 0134+00 1/0 0/0 0/0 .text actionWait__11daObjL6Bm_cFv */
|
||||
void daObjL6Bm_c::actionWait() {
|
||||
// NONMATCHING
|
||||
bool var_r28 = false;
|
||||
bool var_r27 = false;
|
||||
f32 fVar1;
|
||||
f32 playerDistance = fopAcM_searchPlayerDistanceXZ(this);
|
||||
|
||||
|
@ -292,15 +293,26 @@ void daObjL6Bm_c::actionWait() {
|
|||
fVar1 = 1000.0f;
|
||||
}
|
||||
|
||||
if (playerDistance < fVar1 && (s16)abs((s16)(cLib_targetAngleY(fopAcM_GetPosition_p(this), fopAcM_GetPosition_p(dComIfGp_getPlayer(0))) - current.angle.y)) < 0x1000) {
|
||||
if (playerDistance < fVar1) {
|
||||
var_r28 = true;
|
||||
}
|
||||
|
||||
s16 targetAngle = cLib_targetAngleY(fopAcM_GetPosition_p(this), fopAcM_GetPosition_p(dComIfGp_getPlayer(0)));
|
||||
s16 angleDiff = (s16)abs((s16)(targetAngle - current.angle.y));
|
||||
s16 unkBound = 0x2000;
|
||||
if (angleDiff < unkBound / 2) {
|
||||
var_r27 = true;
|
||||
}
|
||||
|
||||
if (var_r28 && var_r27) {
|
||||
setAction(1);
|
||||
field_0x911 = 20;
|
||||
} else {
|
||||
s16 sVar1;
|
||||
if (getArg1() == 0xFF) {
|
||||
sVar1 = 0x4B0;
|
||||
} else {
|
||||
if (getArg1() != 0xFF) {
|
||||
sVar1 = (u16)getArg1() * 100;
|
||||
} else {
|
||||
sVar1 = 0x4B0;
|
||||
}
|
||||
current.angle.y += sVar1;
|
||||
}
|
||||
|
@ -313,8 +325,8 @@ void daObjL6Bm_c::actionWait() {
|
|||
|
||||
/* 80C7D6CC-80C7D894 000C2C 01C8+00 1/0 0/0 0/0 .text actionFindPlayer__11daObjL6Bm_cFv */
|
||||
void daObjL6Bm_c::actionFindPlayer() {
|
||||
// NONMATCHING
|
||||
f32 fVar1;
|
||||
bool var_r28 = false;
|
||||
f32 playerDistance = fopAcM_searchPlayerDistanceXZ(this);
|
||||
|
||||
if (getArg0() != 0xFF) {
|
||||
|
@ -324,6 +336,10 @@ void daObjL6Bm_c::actionFindPlayer() {
|
|||
}
|
||||
|
||||
if (playerDistance < fVar1) {
|
||||
var_r28 = true;
|
||||
}
|
||||
|
||||
if (!var_r28) {
|
||||
OS_REPORT("プレイヤー離れました!\n"); // Player has left!\n
|
||||
setAction(0);
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ int daTag_KMsg_c::Delete() {
|
|||
/* 8048E010-8048E8B8 000210 08A8+00 1/1 0/0 0/0 .text Execute__12daTag_KMsg_cFv */
|
||||
// NONMATCHING Various issues: stack, getTalkAngle
|
||||
int daTag_KMsg_c::Execute() {
|
||||
bool r28 = false;
|
||||
bool var_r28 = false;
|
||||
if (home.roomNo == dComIfGp_roomControl_getStayNo()) {
|
||||
if (isDelete()) {
|
||||
fopAcM_delete(this);
|
||||
|
@ -73,15 +73,17 @@ int daTag_KMsg_c::Execute() {
|
|||
if (getType() == KMSG_TYPE_3) {
|
||||
if (field_0x5c3 == 0) {
|
||||
attention_info.flags = 0x80;
|
||||
attention_info.distances[7] = 0x4a;
|
||||
attention_info.distances[fopAc_attn_ETC_e] = 0x4a;
|
||||
} else {
|
||||
attention_info.flags = 0;
|
||||
}
|
||||
} else {
|
||||
int angle = getTalkAngle();
|
||||
int talkDistance = getTalkDis();
|
||||
attention_info.distances[1] = daNpcT_getDistTableIdx(talkDistance, angle);
|
||||
attention_info.distances[3] = attention_info.distances[1];
|
||||
#if VERSION == VERSION_SHIELD_DEBUG
|
||||
attention_info.distances[fopAc_attn_TALK_e] = daNpcT_getDistTableIdx(getTalkDis(), getTalkAngle());
|
||||
#else
|
||||
attention_info.distances[fopAc_attn_TALK_e] = daNpcT_getDistTableIdx(getTalkAngle(), getTalkDis());
|
||||
#endif
|
||||
attention_info.distances[fopAc_attn_SPEAK_e] = attention_info.distances[fopAc_attn_TALK_e];
|
||||
if (getAttnPosOffset() != 1000000000.0f) {
|
||||
attention_info.flags = 0xa;
|
||||
} else {
|
||||
|
@ -93,6 +95,7 @@ int daTag_KMsg_c::Execute() {
|
|||
{
|
||||
attention_info.flags = 0;
|
||||
}
|
||||
|
||||
if (dComIfGp_event_runCheck()) {
|
||||
if (eventInfo.checkCommandTalk()) {
|
||||
u16 iVar10 = 0;
|
||||
|
@ -114,7 +117,7 @@ int daTag_KMsg_c::Execute() {
|
|||
}
|
||||
|
||||
} else {
|
||||
r28 = true;
|
||||
var_r28 = true;
|
||||
if (!field_0x5c4) {
|
||||
mMsgFlow.init(this, mFlowNodeNo, 0, NULL);
|
||||
field_0x5c4 = true;
|
||||
|
@ -174,8 +177,10 @@ int daTag_KMsg_c::Execute() {
|
|||
attention_info.position.y += getAttnPosOffset();
|
||||
}
|
||||
eyePos.y += getEyePosOffset();
|
||||
}
|
||||
|
||||
if (r28) {
|
||||
#if VERSION != VERSION_SHIELD_DEBUG
|
||||
if (var_r28) {
|
||||
f32 f31;
|
||||
if (getAttnPosOffset() != 1000000000.0f) {
|
||||
f31 = -0.5f * getAttnPosOffset();
|
||||
|
@ -203,7 +208,8 @@ int daTag_KMsg_c::Execute() {
|
|||
attention_info.position.z = vec48.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue