d_a_npc_len matching (#2748)

* d_a_npc_len matching

* HIO

* more work on len

* d_a_midna work for PAL

* mg_rod PAL work
This commit is contained in:
hev7 2025-10-21 19:37:13 +01:00 committed by GitHub
parent 9155add1f6
commit 7d2e6ba444
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 1301 additions and 1441 deletions

View File

@ -195,5 +195,5 @@ __vt__11J3DTexNoAnm = .data:0x00000068; // type:object size:0xC scope:global
__vt__12J3DFrameCtrl = .data:0x00000074; // type:object size:0xC scope:global
__vt__20daMidna_McaMorfCB1_c = .data:0x00000080; // type:object size:0x10 scope:global
__vt__16daMidna_matAnm_c = .data:0x00000090; // type:object size:0x10 scope:global
lbl_51_bss_0 = .bss:0x00000000; // type:object size:0x1 data:byte
lbl_51_bss_1 = .bss:0x00000001; // type:object size:0x1 data:byte
sEyeMoveFlg__16daMidna_matAnm_c = .bss:0x00000000; // type:object size:0x1 data:byte
sMorfFrame__16daMidna_matAnm_c = .bss:0x00000001; // type:object size:0x1 data:byte

View File

@ -195,5 +195,5 @@ __vt__11J3DTexNoAnm = .data:0x00000068; // type:object size:0xC scope:global
__vt__12J3DFrameCtrl = .data:0x00000074; // type:object size:0xC scope:global
__vt__20daMidna_McaMorfCB1_c = .data:0x00000080; // type:object size:0x10 scope:global
__vt__16daMidna_matAnm_c = .data:0x00000090; // type:object size:0x10 scope:global
lbl_51_bss_0 = .bss:0x00000000; // type:object size:0x1 data:byte
lbl_51_bss_1 = .bss:0x00000001; // type:object size:0x1 data:byte
sEyeMoveFlg__16daMidna_matAnm_c = .bss:0x00000000; // type:object size:0x1 data:byte
sMorfFrame__16daMidna_matAnm_c = .bss:0x00000001; // type:object size:0x1 data:byte

View File

@ -195,5 +195,5 @@ __vt__11J3DTexNoAnm = .data:0x00000068; // type:object size:0xC scope:global
__vt__12J3DFrameCtrl = .data:0x00000074; // type:object size:0xC scope:global
__vt__20daMidna_McaMorfCB1_c = .data:0x00000080; // type:object size:0x10 scope:global
__vt__16daMidna_matAnm_c = .data:0x00000090; // type:object size:0x10 scope:global
lbl_51_bss_0 = .bss:0x00000000; // type:object size:0x1 data:byte
lbl_51_bss_1 = .bss:0x00000001; // type:object size:0x1 data:byte
sEyeMoveFlg__16daMidna_matAnm_c = .bss:0x00000000; // type:object size:0x1 data:byte
sMorfFrame__16daMidna_matAnm_c = .bss:0x00000001; // type:object size:0x1 data:byte

View File

@ -1887,7 +1887,7 @@ config.libs = [
ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_kolinb"),
ActorRel(Equivalent, "d_a_npc_ks"), # weak func order
ActorRel(NonMatching, "d_a_npc_kyury"),
ActorRel(NonMatching, "d_a_npc_len"),
ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_len"),
ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_lf"),
ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_lud"),
ActorRel(MatchingFor("GZ2E01", "GZ2P01", "GZ2J01"), "d_a_npc_midp"),

View File

@ -299,6 +299,15 @@ public:
setDirect(i_direct);
}
void lookAround(u8 i_direct, int i_baseTimer) {
if (setMode(LOOK_MODE_7, FALSE)) {
mTimer = 0;
}
mBaseTimer = i_baseTimer;
setDirect(i_direct);
}
void lookAround2(u8 i_direct, int i_baseTimer) {
if (setMode(LOOK_MODE_8, FALSE)) {
mTimer = 0;

View File

@ -3,6 +3,36 @@
#include "d/actor/d_a_npc.h"
struct daNpc_Len_HIOParam {
/* 0x00 */ daNpcT_HIOParam common;
/* 0x8C */ s16 field_0x8c;
/* 0x8E */ s16 field_0x8e;
/* 0x90 */ f32 field_0x90;
};
class daNpc_Len_Param_c {
public:
/* 80A68E38 */ virtual ~daNpc_Len_Param_c() {}
static const daNpc_Len_HIOParam m;
};
#if DEBUG
class daNpc_Len_HIO_c : public mDoHIO_entry_c {
public:
daNpc_Len_HIO_c();
void listenPropertyEvent(const JORPropertyEvent*);
void genMessage(JORMContext*);
daNpc_Len_HIOParam m;
};
#define NPC_LEN_HIO_CLASS daNpc_Len_HIO_c
#else
#define NPC_LEN_HIO_CLASS daNpc_Len_Param_c
#endif
/**
* @ingroup actors-npcs
* @class daNpc_Len_c
@ -11,70 +41,94 @@
* @details
*
*/
class daNpc_Len_c : public fopAc_ac_c {
class daNpc_Len_c : public daNpcT_c {
public:
typedef int (daNpc_Len_c::*actionFunc)(void*);
typedef int (daNpc_Len_c::*cutFunc)(int);
/* 80A6432C */ ~daNpc_Len_c();
/* 80A64478 */ void create();
/* 80A64740 */ void CreateHeap();
/* 80A64BE0 */ void Delete();
/* 80A64C14 */ void Execute();
/* 80A64C34 */ void Draw();
/* 80A64CC8 */ void createHeapCallBack(fopAc_ac_c*);
/* 80A64CE8 */ void ctrlJointCallBack(J3DJoint*, int);
/* 80A64D40 */ void getType();
/* 80A64DB8 */ void isDelete();
/* 80A64478 */ int create();
/* 80A64740 */ int CreateHeap();
/* 80A64BE0 */ int Delete();
/* 80A64C14 */ int Execute();
/* 80A64C34 */ int Draw();
/* 80A64CC8 */ static int createHeapCallBack(fopAc_ac_c*);
/* 80A64CE8 */ static int ctrlJointCallBack(J3DJoint*, int);
/* 80A64D40 */ u8 getType();
/* 80A64DB8 */ BOOL isDelete();
/* 80A64FBC */ void reset();
/* 80A6516C */ void afterJntAnm(int);
/* 80A65278 */ void setParam();
/* 80A6546C */ void checkChangeEvt();
/* 80A6546C */ BOOL checkChangeEvt();
/* 80A6556C */ void setAfterTalkMotion();
/* 80A65624 */ void srchActors();
/* 80A65710 */ void evtTalk();
/* 80A657B0 */ void evtCutProc();
/* 80A65710 */ BOOL evtTalk();
/* 80A657B0 */ BOOL evtCutProc();
/* 80A65878 */ void action();
/* 80A65A60 */ void beforeMove();
/* 80A65B24 */ void setAttnPos();
/* 80A65E28 */ void setCollision();
/* 80A65F80 */ bool drawDbgInfo();
/* 80A65F88 */ void selectAction();
/* 80A66004 */ void chkAction(int (daNpc_Len_c::*)(void*));
/* 80A66030 */ void setAction(int (daNpc_Len_c::*)(void*));
/* 80A65F80 */ int drawDbgInfo();
/* 80A65F88 */ int selectAction();
/* 80A66004 */ BOOL chkAction(actionFunc);
/* 80A66030 */ int setAction(actionFunc);
/* 80A660D8 */ BOOL checkStartDemo13StbEvt(fopAc_ac_c*, f32, f32, f32, f32, f32, f32, f32);
/* 80A661B4 */ void cutConversationInHotel(int);
/* 80A66664 */ void cutHurry(int);
/* 80A668B8 */ void cutTakeWoodStatue(int);
/* 80A66C74 */ void wait(void*);
/* 80A6736C */ void patrol(void*);
/* 80A67794 */ void talk(void*);
/* 80A68D00 */ daNpc_Len_c(daNpcT_faceMotionAnmData_c const*, daNpcT_motionAnmData_c const*,
daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int,
daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int,
daNpcT_evtData_c const*, char**);
/* 80A68DE0 */ u16 getEyeballMaterialNo();
/* 80A68DE8 */ s32 getHeadJointNo();
/* 80A68DF0 */ s32 getNeckJointNo();
/* 80A68DF8 */ bool getBackboneJointNo();
/* 80A68E00 */ void checkChangeJoint(int);
/* 80A68E10 */ void checkRemoveJoint(int);
/* 80A68E20 */ s32 getFootLJointNo();
/* 80A68E28 */ s32 getFootRJointNo();
/* 80A68E30 */ bool chkXYItems();
/* 80A661B4 */ int cutConversationInHotel(int);
/* 80A66664 */ int cutHurry(int);
/* 80A668B8 */ int cutTakeWoodStatue(int);
/* 80A66C74 */ int wait(void*);
/* 80A6736C */ int patrol(void*);
/* 80A67794 */ int talk(void*);
/* 80A68D00 */ daNpc_Len_c(
daNpcT_faceMotionAnmData_c const* i_faceMotionAnmData,
daNpcT_motionAnmData_c const* i_motionAnmData,
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
int i_faceMotionStepNum,
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum,
daNpcT_evtData_c const* i_evtData, char** i_arcNames)
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
i_arcNames) {}
/* 80A68DE0 */ u16 getEyeballMaterialNo() { return 1; }
/* 80A68DE8 */ s32 getHeadJointNo() { return 4; }
/* 80A68DF0 */ s32 getNeckJointNo() { return 3; }
/* 80A68DF8 */ s32 getBackboneJointNo() { return 1; }
/* 80A68E00 */ BOOL checkChangeJoint(int i_joint) { return i_joint == 4; }
/* 80A68E10 */ BOOL checkRemoveJoint(int i_joint) { return i_joint == 9; }
/* 80A68E20 */ s32 getFootLJointNo() { return 29; }
/* 80A68E28 */ s32 getFootRJointNo() { return 32; }
/* 80A68E30 */ BOOL chkXYItems() { return TRUE; }
static char* mCutNameList[4];
static u8 mCutList[48];
static cutFunc mCutList[4];
int getFlowNodeNo() {
u16 nodeNo = home.angle.x;
if (nodeNo == 0xffff) {
return -1;
}
return nodeNo;
}
u8 getPathID() { return (fopAcM_GetParam(this) & 0xFF00) >> 8; }
u8 getBitSW() { return (fopAcM_GetParam(this) & 0xff0000) >> 16; }
private:
/* 0x568 */ u8 field_0x568[0xff4 - 0x568];
/* 0xE40 */ NPC_LEN_HIO_CLASS* mpHIO;
/* 0xE44 */ dCcD_Cyl mCyl;
/* 0xF80 */ u8 mType;
/* 0xF84 */ daNpcT_ActorMngr_c mActorMngr[4];
/* 0xFA4 */ daNpcT_Path_c mPath;
/* 0xFCC */ actionFunc field_0xfcc;
/* 0xFD8 */ actionFunc mAction;
/* 0xFE4 */ int field_0xfe4;
/* 0xFE8 */ int field_0xfe8;
/* 0xFEC */ u8 field_0xfec;
/* 0xFED */ u8 field_0xfed;
/* 0xFEE */ u8 field_0xfee;
/* 0xFF0 */ int field_0xff0;
};
STATIC_ASSERT(sizeof(daNpc_Len_c) == 0xff4);
class daNpc_Len_Param_c {
public:
/* 80A68E38 */ ~daNpc_Len_Param_c();
static u8 const m[148];
};
#endif /* D_A_NPC_LEN_H */

View File

@ -150,10 +150,8 @@ const daHorse_hio_c1 daHorse_hio_c0::m = {
};
/* 80837F2C-8083836C 0000EC 0440+00 1/1 0/0 0/0 .text setReinPos__13daHorseRein_cFi */
// NONMATCHING
void daHorseRein_c::setReinPos(int param_0) {
cXyz* var_r27 = &field_0x0[0][param_0];
var_r27++;
cXyz* var_r27 = &field_0x0[0][param_0] + 1;
cXyz spE0 = *field_0x0[0] - *var_r27;
spE0.normalizeZP();

View File

@ -5720,6 +5720,12 @@ static int dmg_rod_Execute(dmg_rod_class* i_this) {
} else {
data_804BBBD4 = 0;
}
#elif VERSION == VERSION_GCN_PAL
if (dComIfGs_getPalLanguage() == 0) {
data_804BBBD4 = 2;
} else {
data_804BBBD4 = 0;
}
#else
data_804BBBD4 = 1;
#endif
@ -6277,6 +6283,12 @@ static int dmg_rod_Create(fopAc_ac_c* i_this) {
} else {
data_804BBBD4 = 0;
}
#elif VERSION == VERSION_GCN_PAL
if (dComIfGs_getPalLanguage() == 0) {
data_804BBBD4 = 2;
} else {
data_804BBBD4 = 0;
}
#else
data_804BBBD4 = 1;
#endif

View File

@ -108,8 +108,10 @@ daMidna_hio_c0::param const daMidna_hio_c0::m = {
25.0f,
};
#if VERSION != VERSION_GCN_PAL
bool daMidna_matAnm_c::sEyeMoveFlg;
u8 daMidna_matAnm_c::sMorfFrame;
#endif
/* 804BC218-804BC248 000078 0030+00 2/2 0/0 0/0 .text init__16daMidna_matAnm_cFv */
void daMidna_matAnm_c::init() {

File diff suppressed because it is too large Load Diff

View File

@ -1497,15 +1497,7 @@ bool dBgWKCol::WallCorrectSort(dBgS_Acch* pwi) {
pwi->SetWallAngleY(cir_index_8c, sp_14);
sp_10 = true;
pwi->SetWallHit();
} else {
if (sp_30 > sp_3c) {
break;
}
if (fabsf(sp_30 - sp_3c) < 0.008f) {
break;
}
} else if (!(sp_30 > sp_3c || fabsf(sp_30 - sp_3c) < 0.008f)) {
f32 sp_1c;
f32 sp_18;
JUT_ASSERT(0x7e2, !(fpclassify(cx1_58) == FP_QNAN));