mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-18 12:52:51 -04:00
Fix more nonmatchings (#2850)
* Fix GetPolyIndex and GetBgIndex, fixing a couple regallocs * Match daNpcCd2_c::checkFearSituation and daNpcCd2_c::getAnmP * Match daAlink_c::jointControll * Clean up float class checks * Move float constants to global.h
This commit is contained in:
@@ -1923,19 +1923,17 @@ void daAlink_c::setMatrixWorldAxisRot(MtxP param_0, s16 param_1, s16 param_2, s1
|
||||
}
|
||||
|
||||
/* 8009DD90-8009E7B8 0986D0 0A28+00 2/2 0/0 0/0 .text jointControll__9daAlink_cFi */
|
||||
// NONMATCHING - 0x20 bytes missing from stack at 0x58 (release)/0x60 (debug)
|
||||
int daAlink_c::jointControll(int param_0) {
|
||||
csXyz sp18(0, 0, 0);
|
||||
int var_r27 = 0;
|
||||
|
||||
mDoExt_MtxCalcOldFrame* temp = field_0x2060;
|
||||
J3DTransformInfo* temp_r3 = temp->getOldFrameTransInfo(param_0);
|
||||
J3DTransformInfo sp80 = *temp_r3;
|
||||
J3DTransformInfo sp80;
|
||||
J3DTransformInfo sp60 = *field_0x2060->getOldFrameTransInfo(param_0);
|
||||
|
||||
Quaternion sp50;
|
||||
Quaternion sp40;
|
||||
Quaternion sp30;
|
||||
Quaternion sp20 = *temp->getOldFrameQuaternion(param_0);
|
||||
Quaternion sp20 = *field_0x2060->getOldFrameQuaternion(param_0);
|
||||
|
||||
csXyz sp10(0, 1, 2);
|
||||
|
||||
@@ -2114,7 +2112,7 @@ int daAlink_c::jointControll(int param_0) {
|
||||
spC = field_0x2060->getOldFrameQuaternion(param_0);
|
||||
}
|
||||
|
||||
mDoMtx_stack_c::transS(sp80.mTranslate.x, sp80.mTranslate.y, sp80.mTranslate.z);
|
||||
mDoMtx_stack_c::transS(sp60.mTranslate.x, sp60.mTranslate.y, sp60.mTranslate.z);
|
||||
mDoMtx_stack_c::quatM(&sp20);
|
||||
mDoMtx_stack_c::inverse();
|
||||
cMtx_concat(temp_r26, mDoMtx_stack_c::get(), J3DSys::mCurrentMtx);
|
||||
|
||||
@@ -1027,7 +1027,7 @@ void daAlink_c::setBaseBoarAnime() {
|
||||
void daAlink_c::setBaseRideAnime() {
|
||||
if (checkHorseRide()) {
|
||||
daHorse_c* horse_p = dComIfGp_getHorseActor();
|
||||
daAlink_ANM sp8[2];
|
||||
daAlink_ANM sp8[3];
|
||||
getBaseHorseAnime(sp8);
|
||||
setDoubleAnime(horse_p->getBlendRate(), 1.0f, 1.0f, sp8[0], sp8[1], 10,
|
||||
horse_p->getMorfFrame());
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "f_op/f_op_camera_mng.h"
|
||||
#include "f_op/f_op_overlap_mng.h"
|
||||
|
||||
namespace {
|
||||
/* 80854D4C-80854D8C 000000 0040+00 1/1 0/0 0/0 .data cc_sph_src__22@unnamed@d_a_kago_cpp@ */
|
||||
static dCcD_SrcSph cc_sph_src = {
|
||||
{
|
||||
@@ -34,6 +35,38 @@ static dCcD_SrcSph cc_sph_src = {
|
||||
{{0.0f, 0.0f, 0.0f}, 80.0f} // mSph
|
||||
} // mSphAttr
|
||||
};
|
||||
}; // namespace
|
||||
|
||||
class daKago_HIO_c : public JORReflexible {
|
||||
public:
|
||||
/* 808495AC */ daKago_HIO_c();
|
||||
/* 80854A4C */ virtual ~daKago_HIO_c() {}
|
||||
|
||||
void genMessage(JORMContext* ctx);
|
||||
|
||||
/* 0x04 */ s8 mChild;
|
||||
/* 0x08 */ f32 mRevoconUpDown;
|
||||
/* 0x0C */ f32 mRevoconUpDownMax;
|
||||
/* 0x10 */ f32 mRevoconLeftRight;
|
||||
/* 0x14 */ f32 mRevoconLeftRightMax;
|
||||
/* 0x18 */ f32 mBasicSize;
|
||||
/* 0x1C */ f32 mFlightSpeed;
|
||||
/* 0x20 */ f32 mFlightGroundAltitude;
|
||||
/* 0x24 */ f32 mFlightCeilingAltitude;
|
||||
/* 0x28 */ f32 mShadowDensity;
|
||||
/* 0x2C */ f32 mDescentRateIncrement;
|
||||
/* 0x30 */ f32 mAscentRateDecel;
|
||||
/* 0x34 */ f32 mDashTime;
|
||||
/* 0x38 */ f32 mDashTimeMultiplier;
|
||||
/* 0x3C */ f32 mWallHitInvulnTime;
|
||||
/* 0x40 */ f32 mDashCooldownTime;
|
||||
/* 0x44 */ f32 mZOffset;
|
||||
/* 0x48 */ f32 mZOffsetHori;
|
||||
/* 0x4C */ u8 mAngleTrackingMode;
|
||||
/* 0x50 */ f32 mYOffsetFromWaterSurface;
|
||||
/* 0x54 */ f32 mWaterSplashTime;
|
||||
/* 0x58 */ f32 mSplashGenTimeDuringDash;
|
||||
};
|
||||
|
||||
/* 808495AC-80849660 0000EC 00B4+00 1/1 0/0 0/0 .text __ct__12daKago_HIO_cFv */
|
||||
daKago_HIO_c::daKago_HIO_c() {
|
||||
@@ -249,7 +282,6 @@ static u8 l_HIOInit;
|
||||
static daKago_HIO_c l_HIO;
|
||||
|
||||
/* 80849BA8-8084A070 0006E8 04C8+00 4/4 0/0 0/0 .text checkGroundHeight__8daKago_cF4cXyzPf */
|
||||
// NONMATCHING - fpr regalloc
|
||||
f32 daKago_c::checkGroundHeight(cXyz i_pos, f32* o_step) {
|
||||
f32 retVal;
|
||||
|
||||
@@ -366,7 +398,6 @@ f32 daKago_c::checkGroundHeight(cXyz i_pos, f32* o_step) {
|
||||
}
|
||||
|
||||
/* 8084A070-8084A210 000BB0 01A0+00 4/4 0/0 0/0 .text checkRoofHeight__8daKago_cF4cXyz */
|
||||
// NONMATCHING - regalloc
|
||||
f32 daKago_c::checkRoofHeight(cXyz param_0) {
|
||||
f32 roofChkYVal = mRoofHeight;
|
||||
BOOL unkFlag1 = FALSE;
|
||||
|
||||
+28
-23
@@ -388,6 +388,8 @@ static anmTblPrm const l_btpTWTbl[30] = {
|
||||
l_resMATa2[1], -1, l_resWCNa2[1], 7, l_resWONa2[1], 7, l_resWGNa2[1], 7, l_resWANb2[1], 7,
|
||||
};
|
||||
|
||||
// TODO: these four tables should be converted into proper structs instead of byte arrays
|
||||
|
||||
/* 803B6604-803B7DC4 013724 17C0+00 0/1 0/0 0/0 .data a_jntTbl_M$3910 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
@@ -1391,8 +1393,10 @@ J3DAnmTransform* daNpcCd2_c::getAnmP(int param_1, int param_2) {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 0x17:
|
||||
case 0x1b:
|
||||
case 0x1f:
|
||||
switch (param_2) {
|
||||
case 1:
|
||||
case 8:
|
||||
@@ -1416,11 +1420,11 @@ J3DAnmTransform* daNpcCd2_c::getAnmP(int param_1, int param_2) {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
case 0x17:
|
||||
case 0x1b:
|
||||
case 0x1f:
|
||||
switch (param_2) {
|
||||
case 7:
|
||||
case 0x18:
|
||||
case 0x1c:
|
||||
case 0x20:
|
||||
switch (param_2) {
|
||||
case 1:
|
||||
case 8:
|
||||
a_anmNum = 0x20;
|
||||
@@ -1443,10 +1447,8 @@ J3DAnmTransform* daNpcCd2_c::getAnmP(int param_1, int param_2) {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
case 0x18:
|
||||
case 0x1c:
|
||||
case 0x20:
|
||||
case 4:
|
||||
case 5:
|
||||
switch(param_2) {
|
||||
case 0:
|
||||
break;
|
||||
@@ -1489,6 +1491,17 @@ J3DAnmTransform* daNpcCd2_c::getAnmP(int param_1, int param_2) {
|
||||
case 0x14:
|
||||
case 0x15:
|
||||
switch(param_2) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
a_anmNum = 0x22;
|
||||
@@ -1883,21 +1896,13 @@ daTagEscape_c* daNpcCd2_c::getEscapeTag() {
|
||||
|
||||
/* 80159818-801598E8 154158 00D0+00 0/0 0/0 5/5 .text checkFearSituation__10daNpcCd2_cFv
|
||||
*/
|
||||
// NONMATCHING - r30 needs to be assigned to r4 and r5
|
||||
bool daNpcCd2_c::checkFearSituation() {
|
||||
f32 dVar10 =
|
||||
fopAcM_GetPosition_p(this)->y - fopAcM_GetPosition_p(daPy_getPlayerActorClass())->y;
|
||||
bool rv;
|
||||
bool bVar5;
|
||||
rv = false;
|
||||
bVar5 = ((!mIsDarkWorld && daPy_py_c::checkNowWolf()) && dVar10 < 200.0f);
|
||||
if (bVar5) {
|
||||
f32 maxDist = pow(500.0f, 2.0f);
|
||||
if (fopAcM_searchPlayerDistanceXZ2(this) < maxDist) {
|
||||
rv = true;
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
return !mIsDarkWorld &&
|
||||
daPy_py_c::checkNowWolf() &&
|
||||
dVar10 < 200.0f &&
|
||||
fopAcM_searchPlayerDistanceXZ2(this) < std::pow(500.0f, 2.0f);
|
||||
}
|
||||
|
||||
/* 801598E8-8015994C 154228 0064+00 1/1 0/0 0/0 .text getNpcMdlDataP__10daNpcCd2_cFi */
|
||||
|
||||
@@ -3693,7 +3693,6 @@ bool daObjCarry_c::cc_damage_proc_kibako() {
|
||||
}
|
||||
|
||||
/* 80476CE4-80476E04 007D64 0120+00 1/0 0/0 0/0 .text cc_damage_proc_ironball__12daObjCarry_cFv */
|
||||
// NONMATCHING - regalloc, equivalent
|
||||
bool daObjCarry_c::cc_damage_proc_ironball() {
|
||||
bool var_r26 = false;
|
||||
bool var_r27 = true;
|
||||
|
||||
@@ -341,10 +341,6 @@ int daObjRIVERROCK_c::Delete() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// /* 80CBD9C4-80CBDA0C 0013E4 0048+00 2/1 0/0 0/0 .text __dt__20daObjRIVERROCK_HIO_cFv */
|
||||
// daObjRIVERROCK_HIO_c::~daObjRIVERROCK_HIO_c() {
|
||||
// }
|
||||
|
||||
/* 80CBDB44-80CBDB64 -00001 0020+00 1/0 0/0 0/0 .data l_daObjRIVERROCK_Method */
|
||||
static actor_method_class l_daObjRIVERROCK_Method = {
|
||||
(process_method_func)daObjRIVERROCK_Create,
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "d/d_s_play.h"
|
||||
|
||||
// NONMATCHING - dEvLib_callback_c issues
|
||||
|
||||
/* 80CFD1DC-80CFD1F0 000000 0014+00 4/4 0/0 0/0 .rodata l_bmdIdx */
|
||||
static u32 const l_bmdIdx[5] = {
|
||||
4, 4, 4, 4, 4,
|
||||
|
||||
Reference in New Issue
Block a user