d_a_npc_passer and d_a_npc_passer2 matching (#2796)

* passer matching and passer2 init work

* passer2 matching
This commit is contained in:
Carco_21
2025-11-11 22:58:27 -05:00
committed by GitHub
parent da4ce41092
commit 25e90cd458
9 changed files with 1674 additions and 2451 deletions
+32 -6
View File
@@ -23,7 +23,7 @@ public:
/* 8015736C */ void setHitodamaParticle();
/* 80157524 */ J3DModelData* getNpcMdlDataP(int);
/* 80157588 */ J3DModelData* getObjMdlDataP(int);
/* 80AA8694 */ virtual ~daNpcCd_c();
/* 80AA8694 */ virtual ~daNpcCd_c() {}
static dCcD_SrcCyl const m_cylDat;
@@ -37,14 +37,14 @@ public:
/* 0x80C */ dBgS_AcchCir mAcchCir;
/* 0x84C */ dCcD_Stts mStts;
/* 0x888 */ dCcD_Cyl mCyl;
/* 0x9C4 */ int field_0x9c4;
/* 0x9C4 */ int m_type;
/* 0x9C8 */ int field_0x9c8;
/* 0x9CC */ int mHitodamaEmitters[2];
/* 0x9D4 */ int field_0x9d4;
/* 0x9D8 */ cXyz field_0x9d8;
/* 0x9E4 */ s16 field_0x9e4;
/* 0x9E6 */ s16 field_0x9e6;
/* 0x9E8 */ bool mIsDarkWorld;
/* 0x9E8 */ u8 mIsDarkWorld;
};
STATIC_ASSERT(sizeof(daNpcCd_c) == 0x9EC);
@@ -71,9 +71,17 @@ struct daNpcCd_HIO_Child_c : public JORReflexible {
#endif
/* 0x004 */ daNpcCd_HIO_Jnt_c field_0x4[12];
/* 0x128 */ s16 field_0x128[0x0E];
/* 0x136 */ s16 mAtn;
/* 0x156 */ s16 field_0x146[0x10];
/* 0x124 */ s16 field_0x124[0x0C];
/* 0x13C */ f32 mObjScale;
/* 0x140 */ s16 mAtn;
/* 0x144 */ f32 mAnmPlaySpeed;
/* 0x148 */ f32 mWalkAnmPlaySpeed;
/* 0x14C */ f32 mMaxSpeed;
/* 0x150 */ f32 mWalkMaxSpeed;
/* 0x154 */ f32 mCylH;
/* 0x158 */ f32 mCylR;
/* 0x15C */ f32 mChkWallH;
/* 0x160 */ f32 mChkWallR;
};
STATIC_ASSERT(sizeof(daNpcCd_HIO_Child_c) == 0x164);
@@ -164,4 +172,22 @@ static inline f32 HIO_jntTZ(int param_1, int param_2) {
return 10.0f * rv;
}
static inline f32 HIO_maxSpeed(int param_1) { return (f32)(param_1 < 16 ? l_Cd_HIO.field_0x0004[param_1].mMaxSpeed : l_Cd_HIO.field_0x0004[param_1].mMaxSpeed); }
static inline f32 HIO_anmPlaySpeed(int param_1) { return (f32)(param_1 < 16 ? l_Cd_HIO.field_0x0004[param_1].mAnmPlaySpeed : l_Cd_HIO.field_0x0004[param_1].mAnmPlaySpeed); }
static inline f32 HIO_walkMaxSpeed(int param_1) { return (f32)(param_1 < 16 ? l_Cd_HIO.field_0x0004[param_1].mWalkMaxSpeed : l_Cd_HIO.field_0x0004[param_1].mWalkMaxSpeed); }
static inline f32 HIO_walkAnmPlaySpeed(int param_1) { return (f32)(param_1 < 16 ? l_Cd_HIO.field_0x0004[param_1].mWalkAnmPlaySpeed : l_Cd_HIO.field_0x0004[param_1].mWalkAnmPlaySpeed); }
static inline f32 HIO_chkWallR(int param_1) { return (param_1 < 16 ? l_Cd_HIO.field_0x0004[param_1].mChkWallR : l_Cd_HIO.field_0x0004[param_1].mChkWallR); }
static inline f32 HIO_chkWallH(int param_1) { return (param_1 < 16 ? l_Cd_HIO.field_0x0004[param_1].mChkWallH : l_Cd_HIO.field_0x0004[param_1].mChkWallH); }
static inline f32 HIO_cylR(int param_1) { return (param_1 < 16 ? l_Cd_HIO.field_0x0004[param_1].mCylR : l_Cd_HIO.field_0x0004[param_1].mCylR); }
static inline f32 HIO_cylH(int param_1) { return (param_1 < 16 ? l_Cd_HIO.field_0x0004[param_1].mCylH : l_Cd_HIO.field_0x0004[param_1].mCylH); }
static inline f32 HIO_objScale(int param_1) { return (f32)(param_1 < 16 ? l_Cd_HIO.field_0x0004[param_1].mObjScale : l_Cd_HIO.field_0x0004[param_1].mObjScale); }
#endif /* A_NPC_D_A_NPC_CD_H */
+3 -21
View File
@@ -116,33 +116,15 @@ inline f32 Cd2_HIO_objScale(int param_1) {
}
inline f32 Cd2_HIO_walkMaxSpeed(int param_1) {
f32 rv;
if (param_1 < 16) {
rv = l_Cd2_HIO.field_0x0004[param_1].mWalkMaxSpeed;
} else {
return l_Cd2_HIO.field_0x20c4[param_1 - 16].mWalkMaxSpeed;
}
return rv;
return (f32)(param_1 < 16 ? l_Cd2_HIO.field_0x0004[param_1].mWalkMaxSpeed : l_Cd2_HIO.field_0x20c4[param_1 - 16].mWalkMaxSpeed);
}
inline f32 Cd2_HIO_walkAnmPlaySpeed(int param_1) {
f32 rv;
if (param_1 < 16) {
rv = l_Cd2_HIO.field_0x0004[param_1].mWalkAnmPlaySpeed;
} else {
return l_Cd2_HIO.field_0x20c4[param_1 - 16].mWalkAnmPlaySpeed;
}
return rv;
return (f32)(param_1 < 16 ? l_Cd2_HIO.field_0x0004[param_1].mWalkAnmPlaySpeed : l_Cd2_HIO.field_0x20c4[param_1 - 16].mWalkAnmPlaySpeed);
}
inline f32 Cd2_HIO_maxSpeed(int param_1) {
f32 rv;
if (param_1 < 16) {
rv = l_Cd2_HIO.field_0x0004[param_1].mMaxSpeed;
} else {
return l_Cd2_HIO.field_0x20c4[param_1 - 16].mMaxSpeed;
}
return rv;
return (f32)(param_1 < 16 ? l_Cd2_HIO.field_0x0004[param_1].mMaxSpeed : l_Cd2_HIO.field_0x20c4[param_1 - 16].mMaxSpeed);
}
inline f32 Cd2_HIO_anmPlaySpeed(int param_1) {
+107 -65
View File
@@ -2,24 +2,36 @@
#define D_A_NPC_PASSER_H
#include "d/actor/d_a_npc.h"
#include "d/actor/d_a_npc_cd2.h"
/**
* @ingroup actors-npcs
* @class daNpcPasser_c
* @brief Hylian Passerby (Castle Town NPC?)
* @brief Hylian Passerby
*
* @details
*
*/
class daNpcPasser_c : public fopAc_ac_c {
*/
class daNpcPasser_c : public daNpcCd2_c {
public:
struct Mode_e {};
typedef void (daNpcPasser_c::*actionFunc)();
typedef BOOL (daNpcPasser_c::*seqFunc)(void*);
enum Mode_e {
/* 0x0 */ MODE_0,
/* 0x1 */ MODE_1,
/* 0x2 */ MODE_2,
/* 0x3 */ MODE_3,
/* 0x4 */ MODE_4,
/* 0x5 */ MODE_MAX_e,
};
/* 80AA2C18 */ ~daNpcPasser_c();
/* 80AA2C9C */ void createHeap();
/* 80AA2D40 */ void create();
/* 80AA2FD4 */ void execute();
/* 80AA315C */ void draw();
/* 80AA2C9C */ int createHeap();
/* 80AA2D40 */ cPhs__Step create();
/* 80AA2FD4 */ int execute();
/* 80AA315C */ int draw();
/* 80AA31EC */ void setAction(daNpcPasser_c::Mode_e);
/* 80AA3230 */ void callInit();
/* 80AA3258 */ void callExecute();
@@ -40,66 +52,96 @@ public:
/* 80AA4780 */ void setBaseMtx();
/* 80AA47FC */ void initCollision();
/* 80AA48D8 */ void setCollision();
/* 80AA492C */ void waita(void*);
/* 80AA49D4 */ void talka(void*);
/* 80AA4A7C */ void waitwall(void*);
/* 80AA4B24 */ void talkwall(void*);
/* 80AA4BCC */ void talkbwall(void*);
/* 80AA4C74 */ void talkb(void*);
/* 80AA4D1C */ void talkc(void*);
/* 80AA4DC4 */ void waitb(void*);
/* 80AA4E6C */ void sitwaita(void*);
/* 80AA4F14 */ void sittalka(void*);
/* 80AA4FBC */ void sittalkab(void*);
/* 80AA5064 */ void sitwaitb(void*);
/* 80AA510C */ void sittalkb(void*);
/* 80AA51B4 */ void sittalkbb(void*);
/* 80AA525C */ void looka(void*);
/* 80AA5304 */ void lookb(void*);
/* 80AA53AC */ void playm(void*);
/* 80AA5454 */ void turnr(void*);
/* 80AA5510 */ void turnl(void*);
/* 80AA55CC */ void walka(void*);
/* 80AA5634 */ void runa(void*);
/* 80AA569C */ void runb(void*);
/* 80AA5704 */ void walkb(void*);
/* 80AA576C */ void browsea(void*);
/* 80AA5814 */ void browseb(void*);
/* 80AA58BC */ void waitTime(void*);
/* 80AA492C */ BOOL waita(void*);
/* 80AA49D4 */ BOOL talka(void*);
/* 80AA4A7C */ BOOL waitwall(void*);
/* 80AA4B24 */ BOOL talkwall(void*);
/* 80AA4BCC */ BOOL talkbwall(void*);
/* 80AA4C74 */ BOOL talkb(void*);
/* 80AA4D1C */ BOOL talkc(void*);
/* 80AA4DC4 */ BOOL waitb(void*);
/* 80AA4E6C */ BOOL sitwaita(void*);
/* 80AA4F14 */ BOOL sittalka(void*);
/* 80AA4FBC */ BOOL sittalkab(void*);
/* 80AA5064 */ BOOL sitwaitb(void*);
/* 80AA510C */ BOOL sittalkb(void*);
/* 80AA51B4 */ BOOL sittalkbb(void*);
/* 80AA525C */ BOOL looka(void*);
/* 80AA5304 */ BOOL lookb(void*);
/* 80AA53AC */ BOOL playm(void*);
/* 80AA5454 */ BOOL turnr(void*);
/* 80AA5510 */ BOOL turnl(void*);
/* 80AA55CC */ BOOL walka(void*);
/* 80AA5634 */ BOOL runa(void*);
/* 80AA569C */ BOOL runb(void*);
/* 80AA5704 */ BOOL walkb(void*);
/* 80AA576C */ BOOL browsea(void*);
/* 80AA5814 */ BOOL browseb(void*);
/* 80AA58BC */ BOOL waitTime(void*);
static u8 ActionTable[120];
static void* m_funcTbl[28];
static u8 m_seq00_funcTbl[24];
static u8 m_seq01_funcTbl[24];
static u8 m_seq02_funcTbl[24];
static u8 m_seq03_funcTbl[24];
static u8 m_seq04_funcTbl[24];
static u8 m_seq05_funcTbl[48];
static u8 m_seq06_funcTbl[48];
static u8 m_seq07_funcTbl[24];
static u8 m_seq08_funcTbl[84];
static u8 m_seq09_funcTbl[24];
static u8 m_seq10_funcTbl[24];
static u8 m_seq11_funcTbl[72];
static u8 m_seq12_funcTbl[24];
static u8 m_seq13_funcTbl[72];
static u8 m_seq14_funcTbl[24];
static u8 m_seq15_funcTbl[24];
static u8 m_seq16_funcTbl[84];
static u8 m_seq17_funcTbl[24];
static u8 m_seq18_funcTbl[24];
static u8 m_seq19_funcTbl[84];
static u8 m_seq20_funcTbl[24];
static u8 m_seq21_funcTbl[24];
static u8 m_seq22_funcTbl[48];
static u8 m_seq23_funcTbl[84];
static u8 m_seq24_funcTbl[60];
static u8 m_seq25_funcTbl[84];
static u8 m_seq26_funcTbl[36];
static u8 m_seq27_funcTbl[12];
int getObjNum() { return (fopAcM_GetParam(this) >> 8) & 0xFF; }
int getTimeHour() { return dKy_darkworld_check() ? dKy_getDarktime_hour() : dKy_getdaytime_hour(); }
int getTimeMinute() { return dKy_darkworld_check() ? dKy_getDarktime_minute() : dKy_getdaytime_minute(); }
int getTime() {return (getTimeHour() * 60) + getTimeMinute(); }
int getDayOfWeek() { return dKy_darkworld_check() ? dKy_getDarktime_week() : dKy_get_dayofweek(); }
int getEndTime() { return current.angle.x; }
int getType() { return fopAcM_GetParam(this) & 0xFF; }
u8 getMoveType() { return (fopAcM_GetParam(this) >> 24) & 0xF; }
u8 getWalkMotionType() { return (fopAcM_GetParam(this) >> 28) & 3; }
u8 getRunMotionType() { return fopAcM_GetParam(this) >> 30; }
u8 getPathID() { return (fopAcM_GetParam(this) >> 16) & 0xFF; }
BOOL isStop() { return TRUE; }
static actionFunc ActionTable[5][2];
static seqFunc* m_funcTbl[28];
static seqFunc m_seq00_funcTbl[2];
static seqFunc m_seq01_funcTbl[2];
static seqFunc m_seq02_funcTbl[2];
static seqFunc m_seq03_funcTbl[2];
static seqFunc m_seq04_funcTbl[2];
static seqFunc m_seq05_funcTbl[4];
static seqFunc m_seq06_funcTbl[4];
static seqFunc m_seq07_funcTbl[2];
static seqFunc m_seq08_funcTbl[7];
static seqFunc m_seq09_funcTbl[2];
static seqFunc m_seq10_funcTbl[2];
static seqFunc m_seq11_funcTbl[6];
static seqFunc m_seq12_funcTbl[2];
static seqFunc m_seq13_funcTbl[6];
static seqFunc m_seq14_funcTbl[2];
static seqFunc m_seq15_funcTbl[2];
static seqFunc m_seq16_funcTbl[7];
static seqFunc m_seq17_funcTbl[2];
static seqFunc m_seq18_funcTbl[2];
static seqFunc m_seq19_funcTbl[7];
static seqFunc m_seq20_funcTbl[2];
static seqFunc m_seq21_funcTbl[2];
static seqFunc m_seq22_funcTbl[4];
static seqFunc m_seq23_funcTbl[7];
static seqFunc m_seq24_funcTbl[5];
static seqFunc m_seq25_funcTbl[7];
static seqFunc m_seq26_funcTbl[3];
static seqFunc m_seq27_funcTbl[1];
private:
/* 0x568 */ u8 field_0x568[0xb28 - 0x568];
/* 0xAC8 */ J3DModel* mpModel;
/* 0xACC */ PathTrace_c m_path;
/* 0xAF4 */ daNpcPasser_c::actionFunc* mAction;
/* 0xAF8 */ int mActionIdx;
/* 0xAFC */ int mPrevActionIdx;
/* 0xB00 */ int m_objNum;
/* 0xB04 */ int arg0;
/* 0xB08 */ int m_dayOfWeek;
/* 0xB0C */ int m_endTime;
/* 0xB10 */ f32 field_0xb10;
/* 0xB14 */ f32 field_0xb14;
/* 0xB18 */ f32 mPosY;
/* 0xB1C */ u32 field_0xb1c;
/* 0xB20 */ s16 mTargetAngleY;
/* 0xB22 */ u8 field_0xb22;
/* 0xB23 */ u8 field_0xb23;
/* 0xB24 */ u8 mPathMode;
/* 0xB25 */ u8 field_0xb25;
};
STATIC_ASSERT(sizeof(daNpcPasser_c) == 0xb28);
+49 -9
View File
@@ -1,19 +1,25 @@
#ifndef D_A_NPC_PASSER2_H
#define D_A_NPC_PASSER2_H
#include "d/actor/d_a_npc.h"
#include "d/actor/d_a_npc_cd.h"
#include "d/actor/d_a_npc_cd2.h"
/**
* @ingroup actors-npcs
* @class daNpcPasser2_c
* @brief Hylian Passerby 2 (Castle Town NPC?)
* @brief Low-Poly Hylian Passerby
*
* @details
*
*/
class daNpcPasser2_c : public fopAc_ac_c {
*/
class daNpcPasser2_c : public daNpcCd_c {
public:
struct Mode_e {};
typedef void (daNpcPasser2_c::*actionFunc)();
enum Mode_e {
/* 0x0 */ MODE_MAX_e,
};
/* 80AA755C */ void setAction(daNpcPasser2_c::Mode_e);
/* 80AA75A0 */ void callInit();
@@ -22,14 +28,48 @@ public:
/* 80AA774C */ void executePath();
/* 80AA790C */ void setAngle();
/* 80AA7918 */ void pathMoveF();
/* 80AA7CD8 */ void create();
/* 80AA7CD8 */ cPhs__Step create();
/* 80AA7F78 */ void create_init();
/* 80AA8270 */ ~daNpcPasser2_c();
/* 80AA8270 */ inline ~daNpcPasser2_c();
static u8 ActionTable[24];
inline int createHeap();
inline void setSpeed(f32, f32, f32*, int);
inline void initCollision();
inline void setBaseMtx();
inline int execute();
inline void setCollision();
inline int draw();
int getObjNum() { return (fopAcM_GetParam(this) >> 8) & 0xFF; }
int getTimeHour() { return dKy_darkworld_check() ? dKy_getDarktime_hour() : dKy_getdaytime_hour(); }
int getTimeMinute() { return dKy_darkworld_check() ? dKy_getDarktime_minute() : dKy_getdaytime_minute(); }
int getTime() {return (getTimeHour() * 60) + getTimeMinute(); }
int getDayOfWeek() { return dKy_darkworld_check() ? dKy_getDarktime_week() : dKy_get_dayofweek(); }
int getEndTime() { return current.angle.x; }
int getType() { return fopAcM_GetParam(this) & 0xFF; }
u8 getMoveType() { return (fopAcM_GetParam(this) >> 24) & 0xF; }
u8 getWalkMotionType() { return (fopAcM_GetParam(this) >> 28) & 3; }
u8 getRunMotionType() { return fopAcM_GetParam(this) >> 30; }
u8 getPathID() { return (fopAcM_GetParam(this) >> 16) & 0xFF; }
static actionFunc ActionTable[1][2];
private:
/* 0x568 */ u8 field_0x568[0xa44 - 0x568];
/* 0x9EC */ J3DModel* mpModel;
/* 0x9F0 */ PathTrace_c m_path;
/* 0xA18 */ actionFunc* mAction;
/* 0xA1C */ Mode_e mActionIdx;
/* 0xA20 */ int mPrevActionIdx;
/* 0xA24 */ int m_objNum;
/* 0xA28 */ int m_dayOfWeek;
/* 0xA2C */ int m_endTime;
/* 0xA30 */ f32 field_0xa30;
/* 0xA34 */ f32 field_0xa34;
/* 0xA38 */ f32 mPosY;
/* 0xA3C */ u32 field_0xa3c;
/* 0xA40 */ u8 field_0xa40;
/* 0xA41 */ u8 field_0xa41;
/* 0xA42 */ u8 field_0xa42;
/* 0xA43 */ u8 field_0xa43;
};
STATIC_ASSERT(sizeof(daNpcPasser2_c) == 0xa44);
+1 -1
View File
@@ -8,7 +8,7 @@ public:
daTagEscape_c() {}
~daTagEscape_c() {}
int getPathID() { return fopAcM_GetParam(this) & 0xff; }
u8 getPathID() { return fopAcM_GetParam(this) & 0xff; }
};
#endif /* D_A_TAG_ESCAPE_H */