d_a_npc_maro equivalent (#2439)

* Initial d_a_npc_maro work

* d_a_npc_maro 17% matching

* d_a_npc_maro 28% done

* d_a_npc_maro 38% done

* d_a_npc_maro 57% done

* daNpc_Maro_c::cutArrowTutorial done....

* d_a_npc_maro: dcomifgp_getattention returns ptr now....

* d_a_npc_maro 98% matching

* d_a_npc_maro equivalent

* address d_a_npc_maro PR comments
This commit is contained in:
YunataSavior 2025-06-07 01:20:54 -07:00 committed by GitHub
parent 23bee3b523
commit 09fdb3ece2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 3422 additions and 2339 deletions

View File

@ -1549,7 +1549,7 @@ config.libs = [
ActorRel(NonMatching, "d_a_npc_kakashi"),
ActorRel(NonMatching, "d_a_npc_kkri"),
ActorRel(NonMatching, "d_a_npc_kolin"),
ActorRel(NonMatching, "d_a_npc_maro"),
ActorRel(Equivalent, "d_a_npc_maro"), # weak func order
ActorRel(NonMatching, "d_a_npc_taro"),
ActorRel(NonMatching, "d_a_npc_tkj"),
ActorRel(NonMatching, "d_a_obj_bhashi"),

View File

@ -286,6 +286,24 @@ public:
}
setDirect(i_direct);
}
void sorasu1(cXyz *arg0, u8 arg1) {
BOOL diff_ptrs = mAttnPosP != arg0;
if (setMode(5, diff_ptrs) != 0) {
mAttnPosP = arg0;
}
setDirect(arg1);
}
void sorasu2(cXyz *arg0, u8 arg1) {
BOOL diff_ptrs = mAttnPosP != arg0;
if (setMode(6, diff_ptrs) != 0) {
mAttnPosP = arg0;
}
setDirect(arg1);
}
};
class daNpcT_DmgStagger_c {

View File

@ -3,6 +3,7 @@
#include "SSystem/SComponent/c_counter.h"
#include "d/actor/d_a_npc.h"
#include "d/d_shop_system.h"
/**
* @ingroup actors-npcs
@ -12,24 +13,45 @@
* @details
*
*/
class daNpc_Maro_c : public daNpcT_c {
class daNpc_Maro_c : public dShopSystem_c {
public:
typedef void (daNpc_Maro_c::*actionFunc)(void*);
typedef int (daNpc_Maro_c::*actionFunc)(void*);
typedef int (daNpc_Maro_c::*cutFunc)(int);
enum Type {
TYPE_0,
TYPE_1,
TYPE_2,
TYPE_3,
TYPE_4,
TYPE_5,
TYPE_6,
TYPE_7,
TYPE_8,
TYPE_9,
TYPE_10,
TYPE_11,
TYPE_12,
TYPE_13,
TYPE_14,
TYPE_15,
TYPE_16,
};
/* 8055B58C */ ~daNpc_Maro_c();
/* 8055B6E0 */ void create();
/* 8055B9A8 */ void CreateHeap();
/* 8055BDE8 */ void Delete();
/* 8055BE1C */ void Execute();
/* 8055BF0C */ void Draw();
/* 8055BFA0 */ void createHeapCallBack(fopAc_ac_c*);
/* 8055BFC0 */ void ctrlJointCallBack(J3DJoint*, int);
/* 8055C018 */ void srchArrow(void*, void*);
/* 8055C0B4 */ void getArrowP();
/* 8055C1AC */ void srchItaMato(void*, void*);
/* 8055C248 */ void getItaMatoP(int);
/* 8055C330 */ void getType();
/* 8055C3E0 */ void isDelete();
/* 8055B6E0 */ int create();
/* 8055B9A8 */ int CreateHeap();
/* 8055BDE8 */ int Delete();
/* 8055BE1C */ int Execute();
/* 8055BF0C */ int Draw();
/* 8055BFA0 */ static int createHeapCallBack(fopAc_ac_c*);
/* 8055BFC0 */ static int ctrlJointCallBack(J3DJoint*, int);
/* 8055C018 */ static void* srchArrow(void*, void*);
/* 8055C0B4 */ fopAc_ac_c* getArrowP();
/* 8055C1AC */ static void* srchItaMato(void*, void*);
/* 8055C248 */ fopAc_ac_c* getItaMatoP(int);
/* 8055C330 */ u8 getType();
/* 8055C3E0 */ int isDelete();
/* 8055C614 */ void reset();
/* 8055C834 */ void afterJntAnm(int);
/* 8055C8B0 */ void setParam();
@ -47,33 +69,33 @@ public:
/* 8055DA78 */ void drawOtherMdl();
/* 8055DAD8 */ daNpcT_faceMotionAnmData_c getFaceMotionAnm(daNpcT_faceMotionAnmData_c);
/* 8055DB64 */ daNpcT_motionAnmData_c getMotionAnm(daNpcT_motionAnmData_c);
/* 8055DBF0 */ void selectAction();
/* 8055DD08 */ void chkAction(int (daNpc_Maro_c::*)(void*));
/* 8055DD34 */ void setAction(int (daNpc_Maro_c::*)(void*));
/* 8055DDDC */ void cutConversationAboutPachinko(int);
/* 8055DF7C */ void cutConversationAboutWoodSwd(int);
/* 8055E124 */ void cutSwdTutorial(int);
/* 8055E414 */ void cutHail(int);
/* 8055E578 */ void cutFindMonkey(int);
/* 8055E968 */ void cutGiveMeWoodSwd(int);
/* 8055ECF4 */ void cutGetWoodSwd(int);
/* 8055F508 */ void cutConversationWithMaro(int);
/* 8055F634 */ void cutCacaricoConversation(int);
/* 8055F82C */ void cutSurprise(int);
/* 8055FAF0 */ void cutArrowTutorial(int);
/* 805611E0 */ void cutBokinTalk(int);
/* 80561328 */ void cutMarosWhisper(int);
/* 80561614 */ void cutTagPush1(int);
/* 8056178C */ void cutNotGonnaLet(int);
/* 80561E70 */ void cutTalkToKakashi(int);
/* 80562174 */ void wait(void*);
/* 805629A4 */ void swdTutorial(void*);
/* 80562B14 */ void talk_withTaro(void*);
/* 80562CA4 */ void choccai(void*);
/* 80562EC8 */ void tend(void*);
/* 8056319C */ void arrowTutorial(void*);
/* 8056342C */ void talk(void*);
/* 80563660 */ void shop(void*);
/* 8055DBF0 */ int selectAction();
/* 8055DD08 */ int chkAction(int (daNpc_Maro_c::*)(void*));
/* 8055DD34 */ int setAction(int (daNpc_Maro_c::*)(void*));
/* 8055DDDC */ int cutConversationAboutPachinko(int);
/* 8055DF7C */ int cutConversationAboutWoodSwd(int);
/* 8055E124 */ int cutSwdTutorial(int);
/* 8055E414 */ int cutHail(int);
/* 8055E578 */ int cutFindMonkey(int);
/* 8055E968 */ int cutGiveMeWoodSwd(int);
/* 8055ECF4 */ int cutGetWoodSwd(int);
/* 8055F508 */ int cutConversationWithMaro(int);
/* 8055F634 */ int cutCacaricoConversation(int);
/* 8055F82C */ int cutSurprise(int);
/* 8055FAF0 */ int cutArrowTutorial(int);
/* 805611E0 */ int cutBokinTalk(int);
/* 80561328 */ int cutMarosWhisper(int);
/* 80561614 */ int cutTagPush1(int);
/* 8056178C */ int cutNotGonnaLet(int);
/* 80561E70 */ int cutTalkToKakashi(int);
/* 80562174 */ int wait(void*);
/* 805629A4 */ int swdTutorial(void*);
/* 80562B14 */ int talk_withTaro(void*);
/* 80562CA4 */ int choccai(void*);
/* 80562EC8 */ int tend(void*);
/* 8056319C */ int arrowTutorial(void*);
/* 8056342C */ int talk(void*);
/* 80563660 */ int shop(void*);
/* 805648A4 */ daNpc_Maro_c(
daNpcT_faceMotionAnmData_c const* i_faceMotionAnmData,
daNpcT_motionAnmData_c const* i_motionAnmData,
@ -81,7 +103,7 @@ public:
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,
: dShopSystem_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
i_arcNames) {
OS_REPORT("|%06d:%x|daNpc_Maro_c -> コンストラクト\n", g_Counter.mCounter0, this);
@ -90,8 +112,10 @@ public:
/* 80564978 */ s32 getHeadJointNo();
/* 80564980 */ s32 getNeckJointNo();
/* 80564988 */ s32 getBackboneJointNo();
/* 80564990 */ BOOL checkChangeJoint(int);
/* 805649A0 */ BOOL checkRemoveJoint(int);
/* 80564990 */ BOOL checkChangeJoint(int arg0) { return arg0 == 4; };
/* 805649A0 */ BOOL checkRemoveJoint(int arg0) { return arg0 == 6; };
u8 getBitSW() { return (fopAcM_GetParam(this) & 0xFF0000) >> 16; }
void lostPlayer() { mPlayerActorMngr.remove(); }
BOOL checkNowMotionIsChoccai() {
@ -113,22 +137,94 @@ public:
void startChoccai() { field_0x1134 = 1; }
void endChoccai() { field_0x1134 = 0; }
static void* mCutNameList[17];
static u8 mCutList[204];
static char* mCutNameList[17];
static cutFunc mCutList[17];
int getFlowNodeNo() {
u16 nodeNo = home.angle.x;
if (nodeNo == 0xffff) {
return -1;
}
return nodeNo;
}
u8 getMaxNumItem() {
return (fopAcM_GetParam(this) & 0xf000000) >> 0x18;
}
private:
/* 0x0E40 */ u8 field_0xe40[0x1134 - 0xe40];
/* 0x0F7C */ int field_0xf7c;
/* 0x0F80 */ dCcD_Cyl mCyl1;
/* 0x10BC */ int field_0x10bc;
/* 0x10C0 */ u8 mType;
/* 0x10C4 */ daNpcT_ActorMngr_c mActorMngr[9];
/* 0x110C */ actionFunc field_0x110c;
/* 0x110C */ actionFunc field_0x1118;
/* 0x1124 */ u8 field_0x1124[0x1128 - 0x1124];
/* 0x1128 */ int field_0x1128;
/* 0x112C */ int field_0x112c;
/* 0x1130 */ u8 field_0x1130;
/* 0x1131 */ u8 field_0x1131;
/* 0x1132 */ u8 field_0x1132;
/* 0x1134 */ u8 field_0x1133;
/* 0x1134 */ u8 field_0x1134;
/* 0x1135 */ u8 field_0x1135[0x1140 - 0x1135];
/* 0x1135 */ u8 field_0x1135;
/* 0x1136 */ u8 field_0x1136;
/* 0x1137 */ u8 field_0x1137;
/* 0x1138 */ u8 field_0x1138;
/* 0x1139 */ u8 field_0x1139;
/* 0x113A */ u8 field_0x113a[0x113C - 0x113A];
/* 0x113C */ u8 field_0x113C[0x1140 - 0x113C];
};
STATIC_ASSERT(sizeof(daNpc_Maro_c) == 0x1140);
class daNpc_Maro_Param_c {
public:
/* 805649B0 */ ~daNpc_Maro_Param_c();
/* 805649B0 */ virtual ~daNpc_Maro_Param_c() {}
static u8 const m[144];
struct Data {
/* 0x00 */ f32 field_0x00;
/* 0x04 */ f32 field_0x04;
/* 0x08 */ f32 field_0x08;
/* 0x0C */ f32 field_0x0c;
/* 0x10 */ f32 field_0x10;
/* 0x14 */ f32 field_0x14;
/* 0x18 */ f32 field_0x18;
/* 0x1C */ f32 field_0x1c;
/* 0x20 */ f32 field_0x20;
/* 0x24 */ f32 field_0x24;
/* 0x28 */ f32 field_0x28;
/* 0x2C */ f32 field_0x2c;
/* 0x30 */ f32 field_0x30;
/* 0x34 */ f32 field_0x34;
/* 0x38 */ f32 field_0x38;
/* 0x3C */ f32 field_0x3c;
/* 0x40 */ f32 field_0x40;
/* 0x44 */ f32 field_0x44;
/* 0x48 */ s16 field_0x48;
/* 0x4A */ s16 field_0x4a;
/* 0x4C */ s16 field_0x4c;
/* 0x4E */ s16 field_0x4e;
/* 0x50 */ f32 field_0x50;
/* 0x54 */ u32 field_0x54;
/* 0x58 */ u32 field_0x58;
/* 0x5C */ u32 field_0x5c;
/* 0x60 */ u32 field_0x60;
/* 0x64 */ u32 field_0x64;
/* 0x68 */ u32 field_0x68;
/* 0x6C */ f32 field_0x6c;
/* 0x70 */ f32 field_0x70;
/* 0x74 */ f32 field_0x74;
/* 0x78 */ f32 field_0x78;
/* 0x7C */ f32 field_0x7c;
/* 0x80 */ f32 field_0x80;
/* 0x84 */ f32 field_0x84;
/* 0x88 */ f32 field_0x88;
/* 0x8C */ u32 field_0x8c;
};
static const Data m;
};

View File

@ -264,6 +264,11 @@ public:
mPadNo = i_padNo;
}
void offAttnDraw() {
draw[0].field_0x173 = 3;
draw[1].field_0x173 = 3;
}
static type_tbl_entry loc_type_tbl[3];
static type_tbl_entry act_type_tbl[5];
static dist_entry dist_table[234];

View File

@ -36,6 +36,8 @@ struct ShopCam_action_c {
setCameraSpeed(0.25f, 20.0f, 0.25f, 5.0f);
}
void setCamDataIdx(int data_idx) { mCamDataIdx = data_idx; }
/* 0x00 */ ShopCamFunc mCamAction;
/* 0x0c */ u8 field_0xc[0x18 - 0xc];
/* 0x18 */ fopAc_ac_c* field_0x18;
@ -67,7 +69,7 @@ struct ShopCam_action_c {
/* 0xD0 */ s16 field_0xd0;
/* 0xD2 */ s16 field_0xd2;
/* 0xD4 */ s16 field_0xd4;
/* 0xD6 */ s16 field_0xd6;
/* 0xD6 */ s16 mCamDataIdx;
/* 0xD8 */ s16 field_0xd8;
/* 0xDA */ bool field_0xda;
};

View File

@ -41,7 +41,7 @@ public:
mShopCamAction.field_0xd0 = 0;
mShopCamAction.field_0xd2 = 0;
mShopCamAction.field_0xd4 = -1;
mShopCamAction.field_0xd6 = 0;
mShopCamAction.mCamDataIdx = 0;
mShopCamAction.field_0x7c.x = 0.0f;
mShopCamAction.field_0x7c.y = 0.0f;
mShopCamAction.field_0x7c.z = 0.0f;
@ -103,10 +103,10 @@ public:
/* 8019A364 */ void setSoldOut();
/* 8019A4F4 */ void setSoldOutItemHide();
/* 8019A564 */ void deleteObject();
/* 8019A5D0 */ int searchItemActor();
/* 8019A5D0 */ bool searchItemActor();
/* 8019AB00 */ int getFlowNodeNum();
/* 8019AB1C */ void setSellItemMax(u8);
/* 8019AB24 */ bool checkShopOpen();
/* 8019AB24 */ BOOL checkShopOpen();
/* 8019AB60 */ bool checkLeftTrigger(STControl*);
/* 8019AB84 */ bool checkRightTrigger(STControl*);
/* 8019ABA8 */ bool dpdMove();
@ -122,8 +122,9 @@ public:
void offSpMode() { mSpMode = 0; }
u8 getEventParamU8(int param_0) { return (mEventParam >> (3 - param_0) * 8) & 0xFF; }
void setEventParam(u32 param) { mEventParam = param; }
void setMasterType(u8 master_type) { mMasterType = master_type; }
private:
public:
/* 0xE40 */ STControl* mpStick;
/* 0xE44 */ dSelect_cursor_c* mpDrawCursor;
/* 0xE48 */ dShopItemCtrl_c mItemCtrl;
@ -145,7 +146,7 @@ private:
/* 0xF74 */ u8 mSoldOutItemFlags;
/* 0xF75 */ u8 mSpMode;
/* 0xF76 */ u8 field_0xf76;
/* 0xF77 */ u8 field_0xf77;
/* 0xF77 */ u8 mMasterType;
/* 0xF78 */ u8 field_0xf78;
/* 0xF79 */ u8 field_0xf79;
/* 0xF7A */ u8 field_0xf7a;

File diff suppressed because it is too large Load Diff

View File

@ -51,10 +51,10 @@ int ShopCam_action_c::shop_cam_action_init() {
player->onPlayerNoDraw();
setCamAction(&ShopCam_action_c::shop_cam_action);
if (field_0xd6 >= 0) {
field_0x7c = shop_cam_data_tbl[field_0xd6]->field_0x0;
field_0x88 = shop_cam_data_tbl[field_0xd6]->field_0xc;
field_0x94 = shop_cam_data_tbl[field_0xd6]->field_0x18;
if (mCamDataIdx >= 0) {
field_0x7c = shop_cam_data_tbl[mCamDataIdx]->field_0x0;
field_0x88 = shop_cam_data_tbl[mCamDataIdx]->field_0xc;
field_0x94 = shop_cam_data_tbl[mCamDataIdx]->field_0x18;
} else if (field_0xd4 <= 0) {
field_0x7c = field_0x38;
field_0x88 = field_0x44;
@ -79,19 +79,19 @@ int ShopCam_action_c::shop_cam_action() {
cXyz acStack_58;
f32 dVar11;
if (field_0xd4 <= 0) {
if (field_0xd6 >= 0) {
acStack_4c = shop_cam_data_tbl[field_0xd6]->field_0x0;
acStack_58 = shop_cam_data_tbl[field_0xd6]->field_0xc;
dVar11 = shop_cam_data_tbl[field_0xd6]->field_0x18;
if (mCamDataIdx >= 0) {
acStack_4c = shop_cam_data_tbl[mCamDataIdx]->field_0x0;
acStack_58 = shop_cam_data_tbl[mCamDataIdx]->field_0xc;
dVar11 = shop_cam_data_tbl[mCamDataIdx]->field_0x18;
} else {
acStack_4c = field_0x38;
acStack_58 = field_0x44;
dVar11 = field_0x50;
}
} else if (field_0xd6 >= 0) {
acStack_4c = shop_cam_data_tbl[field_0xd6]->field_0x1c;
acStack_58 = shop_cam_data_tbl[field_0xd6]->field_0x28;
dVar11 = shop_cam_data_tbl[field_0xd6]->field_0x34;
} else if (mCamDataIdx >= 0) {
acStack_4c = shop_cam_data_tbl[mCamDataIdx]->field_0x1c;
acStack_58 = shop_cam_data_tbl[mCamDataIdx]->field_0x28;
dVar11 = shop_cam_data_tbl[mCamDataIdx]->field_0x34;
} else {
acStack_4c = field_0x54;
acStack_58 = field_0x60;
@ -184,7 +184,7 @@ void ShopCam_action_c::move() {
*/
void ShopCam_action_c::setCamDataIdx(fopAc_ac_c* param_1, fopAc_ac_c* param_2, fopAc_ac_c* param_3,
fopAc_ac_c* param_4, cXyz* param_5, cXyz* param_6) {
field_0xd6 = -1;
mCamDataIdx = -1;
if (field_0x18 == NULL) {
field_0xb0 = param_1->eyePos;
}
@ -219,7 +219,7 @@ void ShopCam_action_c::setCamDataIdx(fopAc_ac_c* param_1, fopAc_ac_c* param_2, f
void ShopCam_action_c::setCamDataIdx2(fopAc_ac_c* param_1, fopAc_ac_c* param_2, fopAc_ac_c* param_3,
fopAc_ac_c* param_4, fopAc_ac_c* param_5, fopAc_ac_c* param_6,
fopAc_ac_c* param_7, cXyz* param_8, cXyz* param_9) {
field_0xd6 = -1;
mCamDataIdx = -1;
if (field_0x18 == NULL) {
field_0xb0 = param_1->eyePos;
}
@ -304,4 +304,4 @@ void ShopCam_action_c::setMasterCamCtrPos(cXyz* param_0) {
field_0x38.x = field_0xb0.x;
field_0x38.y = field_0xb0.y;
field_0x38.z = field_0xb0.z;
}
}

View File

@ -161,7 +161,7 @@ void dShopSystem_c::initShopSystem() {
offSpMode();
field_0xf6c = 0;
field_0xf76 = 0;
field_0xf77 = 9;
mMasterType = 9;
field_0xf78 = -1;
mFlow.onNonStopJunpFlowFlag();
}
@ -806,7 +806,7 @@ int dShopSystem_c::itemZoom(cXyz* param_0) {
local_34.set(g_cursorHIO.mObjZoom.x, g_cursorHIO.mObjZoom.y + -25.0f,
g_cursorHIO.mObjZoom.z + 150.0f);
} else {
if (field_0xf77 == 5) {
if (mMasterType == 5) {
if (dShopSystem_itemNo[mCursorPos - 1] == fpcNm_ITEM_ARROW_10 ||
dShopSystem_itemNo[mCursorPos - 1] == fpcNm_ITEM_ARROW_20 ||
dShopSystem_itemNo[mCursorPos - 1] == fpcNm_ITEM_ARROW_30)
@ -838,7 +838,7 @@ int dShopSystem_c::itemZoom(cXyz* param_0) {
local_1c.set(*param_0);
}
u8 dvar1 = field_0xf77;
u8 dvar1 = mMasterType;
if (dvar1 == 1) {
if (dShopSystem_itemNo[mCursorPos - 1] == fpcNm_ITEM_OIL_BOTTLE) {
mItemCtrl.setZoomAnime(mCursorPos, &local_1c,
@ -1469,7 +1469,7 @@ void dShopSystem_c::deleteObject() {
/* 8019A5D0-8019AB00 194F10 0530+00 1/1 0/0 8/8 .text searchItemActor__13dShopSystem_cFv
*/
int dShopSystem_c::searchItemActor() {
bool dShopSystem_c::searchItemActor() {
u8 temp_data;
if ((dShopSystem_item_count != -1 &&
((dShopSystem_item_count < (temp_data = dShopSystem_sellItemMax)) ||
@ -1548,7 +1548,7 @@ int dShopSystem_c::searchItemActor() {
}
}
if (field_0xf77 == 8) {
if (mMasterType == 8) {
dShopSystem_cameraActor[0]->current.pos.set(-175.0f, 165.0f, 10.0f);
dShopSystem_cameraActor[1]->current.pos.set(215.0f, 225.0f, 370.0f);
}
@ -1559,7 +1559,7 @@ int dShopSystem_c::searchItemActor() {
dShopSystem_itemActor[3], dShopSystem_itemActor[4], dShopSystem_itemActor[5],
&dShopSystem_cameraActor[0]->current.pos, &dShopSystem_cameraActor[1]->current.pos);
if (field_0xf77 == 8) {
if (mMasterType == 8) {
cXyz camCtrPos;
camCtrPos.set(-180.0f, 245.0f, -380.0f);
mShopCamAction.setMasterCamCtrPos(&camCtrPos);
@ -1633,14 +1633,18 @@ void dShopSystem_c::setSellItemMax(u8 i_max) {
}
/* 8019AB24-8019AB60 195464 003C+00 0/0 0/0 9/9 .text checkShopOpen__13dShopSystem_cFv */
bool dShopSystem_c::checkShopOpen() {
BOOL dShopSystem_c::checkShopOpen() {
for (int i = 0; i < 2; i++) {
if (dShopSystem_cameraActor[i] != NULL) {
return true;
}
}
return dShopSystem_camera_count != 0;
if (dShopSystem_camera_count) {
return true;
} else {
return false;
}
}
/* 8019AB60-8019AB84 1954A0 0024+00 3/3 0/0 0/0 .text