d_a_npc_p1 100% Matching (#1098)

* 99% match

* Rewrote _execute to increase accuracy. Only issue in .text is a label not loading correctly. I have no idea how to fix this.

* Equivalent. Weak func ordering.

* 7% text

* 28% text

* 41% text

* 65% text

* Rewrote _execute to increase accuracy. Only issue in .text is a label not loading correctly. I have no idea how to fix this.

* Equivalent. Weak func ordering.

* 82% text

* Equivalent. A lot of work is needed to name variables and clean up functions. Weak function ordering is wrong.

* Cleaned some functions, named several variables, and began documenting dialog tree.

* Naming a couple more variables

* 21% text

* change out getMySubstanceP for getMyIntegerP inline

* 100% text

* Refactor to use JUT_ASSERT macro

* #181: d_a_tag_attention matching; TODO: implement chk_inside and dComIfGp_att_Look2RequestF

* #181: continue working on d_a_tag_attention, matching almost complete

* #181: revert naming class member (not certain enough)

* #181: preliminary changes to resolve #784 comments regarding usage of debug maps

* #181: commit suggestion by @WilliamArnett, fixing regalloc error

Co-authored-by: WilliamArnett <149556961+WilliamArnett@users.noreply.github.com>

* #181: fix missing curly bracket

* #181: resolve #784 comments with the kind help of @WilliamArnett;
 move `daTagAttention::Act_c::chk_inside` to header file; split `plyrToObjVec` definition to match assembly;
 remove temp variable, use values directly and swap operands;
 implement `Look2RequestF` in `include/d/d_attention.h`;
 remove non-matching use of temp variable `iVar1` and replace `current.pos` with uninitialized variable in `daTagAttention::Act_c::_execute`

* Update fork to match upstream

* some changes

* 73% text

* 100% Matching minus kaji_anm

* Delete debug/m2cdecomp

* revert unnecessary file changes

* remove d_a_npc_p2_cut.inc

* Match kaji_anm

* swap declaration order of l_msg and l_msgId

* Naming many fields

* Implement GetKajiID inline

* Enum and variable names

* Remove virtual genMessage function

* Implement @LagoLunatic 's suggested changes

* Revert array changes in d_camera.h (@LagoLunatic suggested change)

* Whitespace

* Rename dSnap enum

---------

Co-authored-by: Skelp <skelp@pm.me>
Co-authored-by: Skelp <59535863+Skelp@users.noreply.github.com>
This commit is contained in:
WilliamArnett
2026-08-03 00:40:12 -05:00
committed by GitHub
parent 380407dd26
commit 11f4940d74
7 changed files with 1415 additions and 100 deletions
+1 -1
View File
@@ -1687,7 +1687,7 @@ config.libs = [
ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_npc_nz"),
ActorRel(NonMatching, "d_a_npc_ob1"),
ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_npc_os"),
ActorRel(NonMatching, "d_a_npc_p1"),
ActorRel(Matching, "d_a_npc_p1"),
ActorRel(NonMatching, "d_a_npc_p2"),
ActorRel(EquivalentFor("GZLJ01", "GZLE01", "GZLP01") or MatchingFor("D44J01"), "d_a_npc_people"), # regalloc
ActorRel(NonMatching, "d_a_npc_pf1"),
+30 -1
View File
@@ -1,10 +1,12 @@
#ifndef D_A_KAJI_H
#define D_A_KAJI_H
#include "d/d_com_inf_game.h"
#include "f_op/f_op_actor.h"
#include "SSystem/SComponent/c_phase.h"
#include "m_Do/m_Do_ext.h"
#include "m_Do/m_Do_mtx.h"
#include "res/Object/Kaji.h"
class mDoExt_McaMorf;
@@ -19,7 +21,34 @@ public:
mpMorf->getModel()->setBaseTRMtx(mDoMtx_stack_c::get());
MTXCopy(mDoMtx_stack_c::get(), mMtx);
}
void setAnm(int, f32) {}
void setAnm(int i_m668, f32 frame) {
J3DAnmTransform* pAnimRes;
void* pSoundAnimRes;
switch(i_m668){
case 0:
pAnimRes = (J3DAnmTransform*)dComIfG_getObjectRes("Kaji",dRes_INDEX_KAJI_BCK_KJ_WAIT_e);
pSoundAnimRes = dComIfG_getObjectRes("Kaji",dRes_INDEX_KAJI_BAS_KJ_WAIT_e);
break;
case 1:
pAnimRes = (J3DAnmTransform*)dComIfG_getObjectRes("Kaji",dRes_INDEX_KAJI_BCK_KJ_OMO_e);
pSoundAnimRes = dComIfG_getObjectRes("Kaji",dRes_INDEX_KAJI_BAS_KJ_OMO_e);
break;
case 2:
pAnimRes = (J3DAnmTransform*)dComIfG_getObjectRes("Kaji",dRes_INDEX_KAJI_BCK_KJ_TORI_e);
pSoundAnimRes = dComIfG_getObjectRes("Kaji",dRes_INDEX_KAJI_BAS_KJ_TORI_e);
break;
case 3:
pAnimRes = (J3DAnmTransform*)dComIfG_getObjectRes("Kaji",dRes_INDEX_KAJI_BCK_KJ_ANG_e);
pSoundAnimRes = dComIfG_getObjectRes("Kaji",dRes_INDEX_KAJI_BAS_KJ_ANG_e);
break;
default:
return;
}
mpMorf->setAnm(pAnimRes,J3DFrameCtrl::EMode_LOOP,0.0,1.0,0.0,-1.0,pSoundAnimRes);
if(frame >= 0.0f){
mpMorf->setFrame(frame);
}
}
inline cPhs_State _create();
inline bool _delete();
+94 -39
View File
@@ -1,59 +1,114 @@
#ifndef D_A_NPC_P1_H
#define D_A_NPC_P1_H
#include "SSystem/SComponent/c_bg_s_poly_info.h"
#include "d/d_bg_s_acch.h"
#include "d/d_cc_d.h"
#include "d/d_npc.h"
#include "f_op/f_op_actor.h"
#include "m_Do/m_Do_hostIO.h"
class daNpc_P1_c : public fopAc_ac_c {
typedef BOOL (daNpc_P1_c::*ActionFunc)(void*);
enum ActionStatus {
ACTION_STARTING_e = 0,
ACTION_ONGOING_e = 1,
ACTION_UNK_2_e = 2,
ACTION_ENDING_e = -1,
};
typedef u8 Type;
enum {
TYPE_P1A_e,
TYPE_P1B_e,
TYPE_P1C_e
};
public:
void checkAction(int (daNpc_P1_c::*)(void*)) {}
void setAction(int (daNpc_P1_c::*)(void*), void*, int) {}
bool checkAction(ActionFunc action) { return mActionFunc == action;}
void setAction(ActionFunc action, void* i_param_2, int i_param_3) {
if(mActionFunc != action){
if(mActionFunc != NULL){
mActionStatus = ACTION_ENDING_e;
(this->*mActionFunc)(i_param_2);
}
mPrevAction = mActionFunc;
mActionFunc = action;
mActionStatus = ACTION_STARTING_e;
(this->*mActionFunc)(NULL);
}
}
void setAnimFromMsg();
void setAnm(int, float);
void normalAction(void*);
void confuseAction(void*);
void talkAction(void*);
void p1c_speakAction(void*);
void speakAction(void*);
void explainAction(void*);
void getNextMsgNo(int);
void playTexPatternAnm();
BOOL setAnm(int, float);
BOOL normalAction(void*);
BOOL confuseAction(void*);
BOOL talkAction(void*);
BOOL p1c_speakAction(void*);
BOOL speakAction(void*);
BOOL explainAction(void*);
u32 getNextMsgNo(int);
BOOL playTexPatternAnm();
void demo_end_init();
void demo_move();
void event_move();
void evn_setAnm_init(int);
void evn_talk_init(int);
void evn_talk();
void minigameExplainCut();
void privateCut();
void setAttentionPos(cXyz*);
BOOL demo_move();
BOOL event_move();
BOOL evn_setAnm_init(int);
BOOL evn_talk_init(int);
BOOL evn_talk();
BOOL minigameExplainCut();
BOOL privateCut();
BOOL setAttentionPos(cXyz*);
cPhs_State _create();
void CreateHeap();
BOOL CreateHeap();
BOOL _delete();
void getKajiID();
void kaji_anm();
fpc_ProcID getKajiID();
BOOL kaji_anm();
BOOL _execute();
BOOL _draw();
void lookBack();
BOOL lookBack();
public:
/* Place member variables here */
};
/* 0x290 */ ActionFunc mActionFunc;
/* 0x29C */ ActionFunc mPrevAction;
/* 0x2A8 */ request_of_phase_process_class mPhs;
/* 0x2B0 */ mDoExt_McaMorf* mpMorf;
/* 0x2B4 */ u8 pad2B4[0x2C0-0x2B4];
/* 0x2C0 */ J3DModel* mpHeadModel;
/* 0x2C4 */ J3DModel* mpDoraModel;
/* 0x2C8 */ J3DAnmTexPattern* mpTexture;
/* 0x2CC */ mDoExt_btpAnm mBtp;
/* 0x2E0 */ u8 mBlinkFrame;
/* 0x2E2 */ s16 mBlinkTimer;
/* 0x2E4 */ u32 mShadowId;
/* 0x2E8 */ dBgS_ObjAcch mObjAcch;
/* 0x4A8 */ dBgS_AcchCir mAcchCir;
/* 0x4EC */ dCcD_Stts mStts;
/* 0x528 */ dCcD_Cyl mCyl;
/* 0x658 */ u8 pad658;
/* 0x659 */ s8 mActionStatus;
/* 0x65A */ s8 m65A;
/* 0x65B */ Type mType;
/* 0x65C */ u8 mParam;
/* 0x65D */ char pad65D[3];
/* 0x660 */ u32 mCurrMesg;
/* 0x664 */ u32 mPrevMesg;
/* 0x668 */ s32 mAnmNum;
/* 0x66C */ s32 m66C;
/* 0x670 */ u8 m670;
/* 0x671 */ u8 m671;
/* 0x674 */ u32 mKajiId;
/* 0x678 */ s16 mKajiTimer;
/* 0x67A */ s16 filler;
/* 0x67C */ dNpc_JntCtrl_c m_jnt;
/* 0x6B0 */ dNpc_EventCut_c mEventCut6B0;
/* 0x71C */ dNpc_HeadAnm_c mHeadAnm;
/* 0x740 */ s8 m_handR_jnt_num;
/* 0x741 */ bool mbAttentionFlag;
/* 0x742 */ s16 mMaxLookVel;
class daNpc_P1_HIO_c {
public:
daNpc_P1_HIO_c();
public:
/* Place member variables here */
};
class daNpc_P1_childHIO_c {
public:
daNpc_P1_childHIO_c();
public:
/* Place member variables here */
};
#endif /* D_A_NPC_P1_H */
+1 -1
View File
@@ -30,7 +30,7 @@ namespace daObjPirateship {
inline bool _delete();
inline bool _draw();
inline bool _execute();
void getKajiID() {}
fpc_ProcID getKajiID() {return m300;}
void set_mtx();
void pirateCreate(int*);
+1
View File
@@ -615,6 +615,7 @@ public:
void CStickUseless() { setFlag(0x800000); }
void StickUse() { clrFlag(0x1000000); }
void StickUseless() { setFlag(0x1000000); }
void SkipSmoother(){m102 = 1; m101 = 1; m100 = 1;}
bool Active() { return mActive; }
bool Pause() { return mPause; }
+3 -3
View File
@@ -120,9 +120,9 @@ enum {
/* 0x70 */ DSNAP_TYPE_NPC_SA5,
/* 0x71 */ DSNAP_TYPE_NPC_SA4,
/* 0x72 */ DSNAP_TYPE_NPC_ZL1,
/* 0x73 */ DSNAP_TYPE_UNK73,
/* 0x74 */ DSNAP_TYPE_UNK74,
/* 0x75 */ DSNAP_TYPE_UNK75,
/* 0x73 */ DSNAP_TYPE_NPC_P1A,
/* 0x74 */ DSNAP_TYPE_NPC_P1B,
/* 0x75 */ DSNAP_TYPE_NPC_P1C,
/* 0x76 */ DSNAP_TYPE_UNK76,
/* 0x77 */ DSNAP_TYPE_UNK77,
/* 0x78 */ DSNAP_TYPE_UNK78,
+1285 -55
View File
File diff suppressed because it is too large Load Diff