D_a_npc_ba1 100% matching (#1144)

* Ba1 matched 100%

* last fixes

* Proper interaction with actor_fa

* Not matching 100% on JP

* Matching on JPN

* Forgot to update the configure file ...

* 100% matching

* Applied review suggestions

---------

Co-authored-by: Anthony Rossi <anthony.rossi@pm.me>
This commit is contained in:
Anthony Rossi
2026-08-08 21:01:29 +02:00
committed by GitHub
parent 07b55421f9
commit 7bf6761243
6 changed files with 1923 additions and 261 deletions
+1 -1
View File
@@ -1653,7 +1653,7 @@ config.libs = [
ActorRel(Matching, "d_a_npc_ah"),
ActorRel(NonMatching, "d_a_npc_aj1"),
ActorRel(NonMatching, "d_a_npc_auction"),
ActorRel(NonMatching, "d_a_npc_ba1"),
ActorRel(Matching, "d_a_npc_ba1"),
ActorRel(NonMatching, "d_a_npc_bj1"),
ActorRel(Matching, "d_a_npc_bm1"),
ActorRel(NonMatching, "d_a_npc_bmcon1"),
+144 -68
View File
@@ -1,37 +1,46 @@
#ifndef D_A_NPC_BA1_H
#define D_A_NPC_BA1_H
#include "d/d_npc.h"
#include "f_op/f_op_actor.h"
class J3DNode;
class daNpc_Ba1_c : public fopAc_ac_c {
class daNpc_Ba1_c : public fopNpc_npc_c {
public:
typedef BOOL (daNpc_Ba1_c::*ProcFunc)(void*);
struct anm_prm_c {
// Borrowed from d_lib.h, fields seem to match
/* 0x00 */ s8 mAnmNum;
/* 0x01 */ s8 mBtpNum;
/* 0x02 */ s16 field_0x02;
/* 0x04 */ f32 mMorf;
/* 0x08 */ f32 mSpeed;
/* 0x0C */ int mLoopMode;
};
void holdEventOn() { mHoldEvent = 1; }
void holdEventOn() { mbHoldEvent = 1; }
void nodeBa1Control(J3DNode*, J3DModel*);
void XyCheck_cB(int);
void XyEvent_cB(int);
void init_BA1_0();
void init_BA1_1();
void init_BA1_2();
void init_BA1_3();
void init_BA1_4();
void createInit();
bool XyCheck_cB(int);
s16 XyEvent_cB(int);
bool init_BA1_0();
bool init_BA1_1();
bool init_BA1_2();
bool init_BA1_3();
bool init_BA1_4();
bool createInit();
void setMtx(bool);
void anmNum_toResID(int);
void btpNum_toResID(int);
void setBtp(bool, int);
void iniTexPttrnAnm(bool);
int anmNum_toResID(int);
int btpNum_toResID(int);
bool setBtp(bool, int);
bool iniTexPttrnAnm(bool);
void plyTexPttrnAnm();
void setAnm_tex(signed char);
void setAnm_anm(anm_prm_c*);
BOOL setAnm_anm(anm_prm_c*);
void setAnm_NUM(int, int);
void setAnm();
bool setAnm();
void chg_anmTag();
void control_anmTag();
void chg_anmAtr(unsigned char);
@@ -40,24 +49,24 @@ public:
void anmAtr(unsigned short);
void eventOrder();
void checkOrder();
void chk_talk();
void chk_drct(float);
void chk_partsNotMove();
bool chk_talk();
bool chk_drct(float);
bool chk_partsNotMove();
void lookBack();
void next_msgStatus(unsigned long*);
void getMsg_BA1_0();
void getMsg_BA1_1();
void getMsg_BA1_3();
void getMsg_BA1_4();
void getMsg();
void chkAttention();
u16 next_msgStatus(unsigned long*);
u32 getMsg_BA1_0();
u32 getMsg_BA1_1();
u32 getMsg_BA1_3();
u32 getMsg_BA1_4();
u32 getMsg();
bool chkAttention();
void setAttention(bool);
void searchByID(fpc_ProcID);
void partner_srch_sub(void* (*)(void*, void*));
fopAc_ac_c* searchByID(fpc_ProcID);
bool partner_srch_sub(void* (*)(void*, void*));
void partner_srch();
void check_useFairyArea();
void checkCommandTalk();
void charDecide(int);
bool check_useFairyArea();
bool checkCommandTalk();
bool charDecide(int);
void eInit_SET_PLYER_GOL_();
void eInit_PLYER_INI_POS_();
void eInit_USE_FAIRY_END_();
@@ -66,61 +75,128 @@ public:
void eInit_ACTOR_DRW_CONTROL_(int*, int*);
void eInit_setEvTimer(int*);
void eInit_CHK_FAIRY_(int*);
void eInit_prmFloat(float*, float);
f32 eInit_prmFloat(float*, float);
void eInit_SET_EYE_OFF_(float*);
void eInit_EYE_OFF_ZRO_(float*);
void eInit_CHK_FAIRY_MOV_1(int*);
void event_actionInit(int);
void eMove_MOV_POS_();
void eMove_CHK_FAIRY_();
void eMove_EYE_OFF_ZRO_();
void eMove_CHK_FAIRY_MOV_1();
void event_action();
bool eMove_MOV_POS_();
bool eMove_CHK_FAIRY_();
bool eMove_EYE_OFF_ZRO_();
bool eMove_CHK_FAIRY_MOV_1();
bool event_action();
void cut_init_START_TALE1(int);
void cut_move_START_TALE1();
bool cut_move_START_TALE1();
void privateCut(int);
void endEvent();
void isEventEntry();
BOOL isEventEntry();
void event_proc(int);
void set_action(int (daNpc_Ba1_c::*)(void*), void*);
BOOL set_action(int (daNpc_Ba1_c::*)(void*), void*);
void setStt(signed char);
void wait_0();
void wait_1();
void talk_1();
void talk_2();
void wait_2();
void wait_3();
void ZZZwai();
void wait_action1(void*);
void wait_action2(void*);
void demo_action1(void*);
void wait_action3(void*);
void wait_action4(void*);
void demo();
BOOL wait_0();
BOOL wait_1();
BOOL talk_1();
BOOL talk_2();
BOOL wait_2();
BOOL wait_3();
BOOL ZZZwai();
BOOL wait_action1(void*);
BOOL wait_action2(void*);
BOOL demo_action1(void*);
BOOL wait_action3(void*);
BOOL wait_action4(void*);
bool demo();
void shadowDraw();
BOOL _draw();
BOOL _execute();
BOOL _delete();
cPhs_State _create();
void create_Anm();
void create_itm_Mdl();
void CreateHeap();
J3DModelData* create_Anm();
bool create_itm_Mdl();
BOOL CreateHeap();
public:
/* 0x290 */ u8 m290[0x7F8 - 0x290];
/* 0x6C4 */ request_of_phase_process_class mPhs;
/* 0x6CC */ s8 m_hed_jnt_num;
/* 0x6CD */ s8 m_bbone_jnt_num;
/* 0x6CE */ s8 m_footL_jnt_num;
/* 0x6CF */ u8 field_0x6CF[0x6D0 - 0x6CF];
/* 0x6D0 */ J3DModel* mpClothModel;
/* 0x6D4 */ u32 mShadowID;
/* 0x6D8 */ J3DAnmTexPattern* m_hed_tex_pttrn;
/* 0x6DC */ mDoExt_btpAnm mHeadBtpAnm;
/* 0x6F0 */ u8 mBlinkFrame;
/* 0x6F1 */ u8 field_0x6F1[0x6F2 - 0x6F1];
/* 0x6F2 */ s16 mBlinkTimer;
/* 0x6F4 */ ProcFunc mCurrProcFunc;
/* 0x700 */ u8 field_0x700[0x708 - 0x700];
/* 0x708 */ dNpc_EventCut_c mEventCut;
/* 0x774 */ fpc_ProcID mPartnerProcID;
/* 0x778 */ cXyz mInitialPos;
/* 0x784 */ csXyz mInitialAngle;
/* 0x78A */ csXyz m78A;
/* 0x790 */ cXyz mTransformedEyePos;
/* 0x79C */ cXyz m79C;
/* 0x7A8 */ u8 field_0x7A8[0x7C0 - 0x7A8];
/* 0x7C0 */ f32 mPrevMorfFrame;
/* 0x7C4 */ f32 mEyeOffset;
/* 0x7C8 */ f32 mEyeOffsetZero;
/* 0x7CC */ s16 mJointHeadY;
/* 0x7CE */ s16 mJointBackboneY;
/* 0x7D0 */ s16 mActorAngleY;
/* 0x7D2 */ s16 mEventIdTable[6];
/* 0x7DE */ s16 mEventIdx;
/* 0x7E0 */ s16 mEvTimer;
/* 0x7E2 */ s16 mEvTimer2;
/* 0x7E4 */ u8 field_0x7E4[0x7E8 - 0x7E4];
/* 0x7E8 */ s16 mLookAtMaxVel;
/* 0x7EA */ s16 mTargetYRot;
/* 0x7EC */ u8 field_0x7EC[0x7EE - 0x7EC];
/* 0x7EE */ s8 mbMorfAnimStopped;
/* 0x7EF */ u8 m7EF;
/* 0x7F0 */ s8 m7F0;
/* 0x7F1 */ u8 mItemNo;
#if VERSION > VERSION_JPN
/* 0x7F8 */ u8 m7F8;
/* 0x7F2 */ u8 m7F2;
#endif
/* Offsets below are for USA/PAL */
/* 0x7F9 */ u8 mHoldEvent;
};
/* 0x7F3 */ u8 field_0x7F3[0x7F4 - 0x7F3];
/* 0x7F4 */ bool mbInitGrandma0;
/* 0x7F5 */ bool m7F5;
/* 0x7F6 */ bool m7F6;
/* 0x7F7 */ bool m7F7;
/* 0x7F8 */ bool m7F8;
/* 0x7F9 */ bool mbHoldEvent;
/* 0x7FA */ bool m7FA;
/* 0x7FB */ bool m7FB;
/* 0x7FC */ bool mFairyUsed;
/* 0x7FD */ bool m7FD;
/* 0x7FE */ bool m7FE;
/* 0x7FF */ bool m7FF;
/* 0x800 */ bool mbRanExecute;
/* 0x804 */ BOOL mbSetEyePos;
/* 0x808 */ bool mbAttention;
/* 0x809 */ bool m809;
/* 0x80A */ bool mHeadOnlyFollow;
/* 0x80B */ bool mbInDemo;
/* 0x80C */ s8 mActionIndex;
/* 0x80D */ s8 mActNo;
/* 0x80E */ u8 m80E;
/* 0x80F */ u8 mMesgAnimeTagInfo;
/* 0x810 */ s8 mBtpNum;
/* 0x811 */ s8 mAnmNum;
/* 0x812 */ s8 m812;
/* 0x813 */ s8 mStatus;
/* 0x814 */ s8 mPrevStatus;
/* 0x815 */ s8 mLookBackState;
/* 0x816 */ s8 mType;
/* 0x817 */ s8 mSpecificType;
/* 0x818 */ s8 m818;
/* 0x819 */ s8 m819;
/* 0x81A */ u8 field_0x81A[0x81C - 0x81A];
}; // Size: 0x81C
class daNpc_Ba1_HIO_c {
public:
daNpc_Ba1_HIO_c();
public:
/* Place member variables here */
};
#endif /* D_A_NPC_BA1_H */
+5 -5
View File
@@ -45,12 +45,12 @@ public:
/* 0x0502 */ UNK_0502 = 0x0502,
/* 0x0501 */ UNK_0501 = 0x0501,
/* 0x0640 */ UNK_0640 = 0x0640,
/* 0x0608 */ UNK_0608 = 0x0608,
/* 0x0608 */ UNK_0608 = 0x0608, // Set by an unused dialogue
/* 0x0604 */ UNK_0604 = 0x0604,
/* 0x0602 */ UNK_0602 = 0x0602,
/* 0x0601 */ UNK_0601 = 0x0601,
/* 0x0602 */ UNK_0602 = 0x0602, // Grandma dialogue after sword obtained
/* 0x0601 */ UNK_0601 = 0x0601, // Grandma dialogue after Helmaroc cutscene (prologue)
/* 0x0780 */ UNK_0780 = 0x0780,
/* 0x0740 */ UNK_0740 = 0x0740,
/* 0x0740 */ UNK_0740 = 0x0740, // Grandma dialogue after Aryll kidnapped
/* 0x0720 */ UNK_0720 = 0x0720,
/* 0x0710 */ UNK_0710 = 0x0710,
/* 0x0704 */ UNK_0704 = 0x0704,
@@ -317,7 +317,7 @@ public:
/* 0x2901 */ UNK_2901 = 0x2901,
/* 0x2A80 */ UNK_2A80 = 0x2A80,
/* 0x2A40 */ UNK_2A40 = 0x2A40,
/* 0x2A20 */ UNK_2A20 = 0x2A20,
/* 0x2A20 */ GRANDMA_HEALED = 0x2A20,
/* 0x2A10 */ UNK_2A10 = 0x2A10,
/* 0x2A08 */ RODE_KORL = 0x2A08,
/* 0x2A04 */ UNK_2A04 = 0x2A04,
+1 -1
View File
@@ -79,7 +79,7 @@ enum {
/* 0x47 */ DSNAP_TYPE_UNK47,
/* 0x48 */ DSNAP_TYPE_UNK48,
/* 0x49 */ DSNAP_TYPE_NPC_LS1,
/* 0x4A */ DSNAP_TYPE_UNK4A,
/* 0x4A */ DSNAP_TYPE_NPC_BA1,
/* 0x4B */ DSNAP_TYPE_UNK4B,
/* 0x4C */ DSNAP_TYPE_UNK4C,
/* 0x4D */ DSNAP_TYPE_NPC_JI1,
+1771 -185
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -73,7 +73,7 @@ static void dKankyo_DayProc() {
dComIfGs_offEventBit(dSv_event_flag_c::UNK_2680);
#if VERSION > VERSION_JPN
if (dComIfGs_isEventBit(dSv_event_flag_c::UNK_2A20))
if (dComIfGs_isEventBit(dSv_event_flag_c::GRANDMA_HEALED))
#endif
{
clamped = cLib_maxLimit(dComIfGs_getEventReg(dSv_event_flag_c::UNK_A60F) + 1, 3);