diff --git a/config/GZ2E01/rels/d_a_npc_henna/symbols.txt b/config/GZ2E01/rels/d_a_npc_henna/symbols.txt index af27bd78de..1f1668d6df 100644 --- a/config/GZ2E01/rels/d_a_npc_henna/symbols.txt +++ b/config/GZ2E01/rels/d_a_npc_henna/symbols.txt @@ -309,6 +309,7 @@ lbl_82_bss_45 = .bss:0x00000045; // type:object size:0x1 data:byte l_HIO = .bss:0x00000054; // type:object size:0x38 scope:global data:byte lrl = .bss:0x0000008C; // type:object size:0x4 scope:global data:4byte lbl_82_bss_90 = .bss:0x00000090; // type:object size:0x1 data:byte +lbl_82_bss_91 = .bss:0x00000091; // type:object size:0x1 data:byte @5112 = .bss:0x00000094; // type:object size:0xC scope:local @5113 = .bss:0x000000A0; // type:object size:0xC scope:local @5114 = .bss:0x000000AC; // type:object size:0xC scope:local @@ -331,8 +332,11 @@ lbl_82_bss_90 = .bss:0x00000090; // type:object size:0x1 data:byte @5131 = .bss:0x00000178; // type:object size:0xC scope:local zoom_check_pos = .bss:0x00000184; // type:object size:0xF0 scope:global koro2_reset = .bss:0x00000274; // type:object size:0x4 scope:global +@5134 = .bss:0x00000278; // type:object size:0x4 scope:local old_stick_x$5644 = .bss:0x0000027C; // type:object size:0x4 scope:local +@5136 = .bss:0x00000280; // type:object size:0x4 scope:local old_stick_sx$5647 = .bss:0x00000284; // type:object size:0x4 scope:local +lbl_82_bss_288 = .bss:0x00000288; // type:object size:0x1 scope:local lbl_82_bss_289 = .bss:0x00000289; // type:object size:0x1 data:byte sInstance__40JASGlobalInstance<19JASDefaultBankTable> = .bss:0x0000028C; // type:object size:0x4 scope:global sInstance__35JASGlobalInstance<14JASAudioThread> = .bss:0x00000290; // type:object size:0x4 scope:global diff --git a/config/GZ2E01/symbols.txt b/config/GZ2E01/symbols.txt index d51c2777eb..68f6f957ea 100644 --- a/config/GZ2E01/symbols.txt +++ b/config/GZ2E01/symbols.txt @@ -21726,7 +21726,7 @@ data_80450C9B = .sbss:0x80450C9B; // type:object size:0x1 scope:global align:1 data_80450C9C = .sbss:0x80450C9C; // type:object size:0x1 scope:global align:1 data_80450C9D = .sbss:0x80450C9D; // type:object size:0x1 data_80450C9E = .sbss:0x80450C9E; // type:object size:0x1 -data_80450C9F = .sbss:0x80450C9F; // type:object size:0x1 +cDmr_FishingWeather = .sbss:0x80450C9F; // type:object size:0x1 data_80450CA0 = .sbss:0x80450CA0; // type:object size:0x4 scope:global align:4 JPTracePCB4 = .sbss:0x80450CA4; // type:object size:0x4 scope:global align:4 data:4byte DMC_initialized = .sbss:0x80450CA8; // type:object size:0x1 scope:local align:1 data:byte diff --git a/config/GZ2J01/symbols.txt b/config/GZ2J01/symbols.txt index add1212ae2..027d18a922 100644 --- a/config/GZ2J01/symbols.txt +++ b/config/GZ2J01/symbols.txt @@ -21736,7 +21736,7 @@ data_80450C9B = .sbss:0x8044ADDB; // type:object size:0x1 data_80450C9C = .sbss:0x8044ADDC; // type:object size:0x1 data_80450C9D = .sbss:0x8044ADDD; // type:object size:0x1 data_80450C9E = .sbss:0x8044ADDE; // type:object size:0x1 -data_80450C9F = .sbss:0x8044ADDF; // type:object size:0x1 +cDmr_FishingWeather = .sbss:0x8044ADDF; // type:object size:0x1 data_80450CA0 = .sbss:0x8044ADE0; // type:object size:0x4 JPTracePCB4 = .sbss:0x8044ADE4; // type:object size:0x4 scope:global align:4 data:4byte DMC_initialized = .sbss:0x8044ADE8; // type:object size:0x1 data:byte diff --git a/configure.py b/configure.py index 26f7337fbc..fa1f768ec8 100755 --- a/configure.py +++ b/configure.py @@ -1545,7 +1545,7 @@ config.libs = [ ActorRel(NonMatching, "d_a_npc_besu"), ActorRel(Equivalent, "d_a_npc_fairy_seirei"), ActorRel(MatchingFor("GZ2E01"), "d_a_npc_fish"), - ActorRel(NonMatching, "d_a_npc_henna"), + ActorRel(Equivalent, "d_a_npc_henna"), # weak func order ActorRel(NonMatching, "d_a_npc_kakashi"), ActorRel(NonMatching, "d_a_npc_kkri"), ActorRel(NonMatching, "d_a_npc_kolin"), diff --git a/include/c/c_damagereaction.h b/include/c/c_damagereaction.h index e4bfa31286..2098851d53 100644 --- a/include/c/c_damagereaction.h +++ b/include/c/c_damagereaction.h @@ -13,6 +13,14 @@ public: BOOL cDmrNowMidnaTalk(); extern u8 cDmr_SkipInfo; +extern u8 data_80450C99; +extern u8 data_80450C9A; +extern u8 data_80450C9B; +extern u8 data_80450C9C; +extern u8 data_80450C9D; +extern u8 data_80450C9E; +extern u8 cDmr_FishingWeather; +extern u8 data_80450CA0; extern JPTraceParticleCallBack4 JPTracePCB4; #endif /* C_C_DAMAGEREACTION_H */ diff --git a/include/d/actor/d_a_npc_du.h b/include/d/actor/d_a_npc_du.h index 0b8da73572..35ae0d8621 100644 --- a/include/d/actor/d_a_npc_du.h +++ b/include/d/actor/d_a_npc_du.h @@ -11,9 +11,12 @@ * @details * */ -class npc_du_class : public fopAc_ac_c { -private: - /* 0x568 */ u8 field_0x568[0xa00 - 0x568]; +class npc_du_class { +public: + fopAc_ac_c actor; + /* 0x568 */ u8 field_0x568[0x5b8 - 0x568]; + /* 0x5B8 */ f32 field_0x5b8; + /* 0x5BC */ u8 field_0x5bc[0xa00 - 0x5bc]; }; STATIC_ASSERT(sizeof(npc_du_class) == 0xa00); diff --git a/include/d/actor/d_a_npc_henna.h b/include/d/actor/d_a_npc_henna.h index ac6a3985f3..41af0b9254 100644 --- a/include/d/actor/d_a_npc_henna.h +++ b/include/d/actor/d_a_npc_henna.h @@ -1,6 +1,9 @@ #ifndef D_A_NPC_HENNA_H #define D_A_NPC_HENNA_H +#include "JSystem/JHostIO/JORReflexible.h" +#include "SSystem/SComponent/c_phase.h" +#include "d/d_msg_flow.h" #include "f_op/f_op_actor.h" /** @@ -11,25 +14,144 @@ * @details * */ -class npc_henna_class : public fopAc_ac_c { +class npc_henna_class { public: - /* 0x568 */ u8 field_0x568[0x752 - 0x568]; - /* 0x752 */ u16 field_0x752; - /* 0x754 */ u16 field_0x754; - /* 0x756 */ u8 field_0x756[0x7b5 - 0x756]; + /* 0x0 */ fopEn_enemy_c actor; + /* 0x5AC */ request_of_phase_process_class field_0x5ac; + /* 0x5B4 */ u8 field_0x5b4; + /* 0x5B5 */ s8 field_0x5b5; + /* 0x5B6 */ s8 field_0x5b6; + /* 0x5B8 */ s16 mIsTalking; + /* 0x5BA */ s16 field_0x5ba; + /* 0x5BC */ s16 field_0x5bc; + /* 0x5BE */ s16 field_0x5be; + /* 0x5C0 */ dMsgFlow_c mMsgFlow; + /* 0x60C */ u8 field_0x60c[0x618 - 0x60c]; + /* 0x618 */ s16 field_0x618; + /* 0x61C */ f32 field_0x61c; + /* 0x620 */ s16 field_0x620; + /* 0x624 */ mDoExt_McaMorf* mpMorf; + /* 0x628 */ mDoExt_btkAnm* mpBtkAnms[3]; + /* 0x634 */ mDoExt_btpAnm* mpBtpAnms[3]; + /* 0x640 */ u8 field_0x640[0x654 - 0x640]; + /* 0x654 */ s32 field_0x654; + /* 0x658 */ s32 field_0x658; + /* 0x65C */ s32 mAnmResIndex; + /* 0x660 */ s16 field_0x660; + /* 0x662 */ s16 field_0x662; + /* 0x664 */ s32 field_0x664; + /* 0x668 */ mDoExt_bckAnm* mpBckAnms[8]; + /* 0x688 */ s32 field_0x688; + /* 0x68C */ J3DModel* mpModel; + /* 0x690 */ s16 field_0x690; + /* 0x692 */ s8 field_0x692; + /* 0x693 */ s8 field_0x693; + /* 0x694 */ s8 field_0x694; + /* 0x698 */ f32 field_0x698; + /* 0x69C */ f32 field_0x69c; + /* 0x6A0 */ s16 field_0x6a0; + /* 0x6A2 */ s16 field_0x6a2; + /* 0x6A4 */ s16 field_0x6a4; + /* 0x6A6 */ s16 field_0x6a6; + /* 0x6A8 */ u8 field_0x6a8[0x6ac - 0x6a8]; + /* 0x6AC */ f32 field_0x6ac; + /* 0x6B0 */ s16 field_0x6b0; + /* 0x6B2 */ u8 field_0x6b2[0x6b6 - 0x6b2]; + /* 0x6B6 */ s16 field_0x6b6; + /* 0x6B8 */ u8 field_0x6b8[0x6ba - 0x6b8]; + /* 0x6BA */ s16 field_0x6ba; + /* 0x6BC */ s16 field_0x6bc; + /* 0x6BE */ s16 field_0x6be; + /* 0x6C0 */ s16 field_0x6c0; + /* 0x6C2 */ s16 field_0x6c2; + /* 0x6C4 */ s16 field_0x6c4; + /* 0x6C6 */ u8 field_0x6c6[0x6f2 - 0x6c6]; + /* 0x6F2 */ s16 field_0x6f2; + /* 0x6F4 */ u8 field_0x6f4[0x704 - 0x6f4]; + /* 0x704 */ s16 field_0x704; + /* 0x706 */ s16 field_0x706; + /* 0x708 */ u8 field_0x708; + /* 0x709 */ u8 field_0x709; + /* 0x70A */ u8 field_0x70a; + /* 0x70B */ u8 field_0x70b; + /* 0x70C */ s8 field_0x70c; + /* 0x70D */ s8 field_0x70d; + /* 0x70E */ s16 field_0x70e; + /* 0x710 */ s16 field_0x710; + /* 0x714 */ cXyz field_0x714; + /* 0x720 */ cXyz field_0x720; + /* 0x72C */ f32 field_0x72c; + /* 0x730 */ f32 field_0x730; + /* 0x734 */ u8 field_0x734; + /* 0x738 */ f32 field_0x738; + /* 0x73C */ s16 field_0x73c[10]; + /* 0x750 */ s16 field_0x750; + /* 0x752 */ s16 field_0x752; + /* 0x754 */ s16 field_0x754; + /* 0x756 */ u16 field_0x756; + /* 0x758 */ s16 field_0x758; + /* 0x75A */ u8 field_0x75a[0x75c - 0x75a]; + /* 0x75C */ s16 field_0x75c; + /* 0x760 */ cXyz field_0x760; + /* 0x76C */ cXyz field_0x76c; + /* 0x778 */ cXyz field_0x778; + /* 0x784 */ cXyz field_0x784; + /* 0x790 */ cXyz field_0x790; + /* 0x79C */ cXyz field_0x79c; + /* 0x7A8 */ cXyz field_0x7a8; + /* 0x7B4 */ u8 field_0x7b4; /* 0x7B5 */ u8 field_0x7b5; - /* 0x7B6 */ u8 field_0x7b6[0x7b9 - 0x7b6]; + /* 0x7B6 */ u8 field_0x7b6; + /* 0x7B7 */ u8 field_0x7b7; + /* 0x7B8 */ u8 field_0x7b8; /* 0x7B9 */ u8 field_0x7b9; - /* 0x7BA */ u8 field_0x7ba[0x7fc - 0x7ba]; + /* 0x7BA */ u8 field_0x7ba; + /* 0x7BC */ f32 field_0x7bc; + /* 0x7C0 */ f32 field_0x7c0; + /* 0x7C4 */ f32 field_0x7c4; + /* 0x7C8 */ u8 field_0x7c8[0x7cc - 0x7c8]; + /* 0x7CC */ u32 field_0x7cc; + /* 0x7D0 */ u8 field_0x7d0[0x7d4 - 0x7d0]; + /* 0x7D4 */ u8 field_0x7d4; + /* 0x7D5 */ u8 field_0x7d5; + /* 0x7D6 */ u8 field_0x7d6; + /* 0x7D7 */ u8 field_0x7d7; + /* 0x7D8 */ u8 field_0x7d8[0x7e1 - 0x7d8]; + /* 0x7E1 */ s8 field_0x7e1; + /* 0x7E4 */ fpc_ProcID mBoatId; + /* 0x7E8 */ u8 field_0x7e8[0x7f8 - 0x7e8]; + /* 0x7F8 */ u8 field_0x7f8; }; STATIC_ASSERT(sizeof(npc_henna_class) == 0x7fc); -class daNpc_Henna_HIO_c { +class daNpc_Henna_HIO_c : public JORReflexible { public: /* 80542F0C */ daNpc_Henna_HIO_c(); - /* 80549E40 */ ~daNpc_Henna_HIO_c(); + /* 80549E40 */ virtual ~daNpc_Henna_HIO_c() {} + void genMessage(JORMContext*); + + s8 field_0x4; + f32 field_0x8; + s16 field_0xc; + s16 mSeasonDefColorR; + s16 mSeasonDefColorG; + s16 mSeasonDefColorB; + s16 mSeason2ColorR; + s16 mSeason2ColorG; + s16 mSeason2ColorB; + s16 mSeason3ColorR; + s16 mSeason3ColorG; + s16 mSeason3ColorB; + f32 mSeasonDefLightDist; + s16 mSeasonDefLightAngle; + f32 mSeason2LightDist; + s16 mSeason2LightAngle; + f32 mSeason3LightDist; + s16 mSeason3LightAngle; }; + + #endif /* D_A_NPC_HENNA_H */ diff --git a/include/d/actor/d_a_player.h b/include/d/actor/d_a_player.h index 30b2493bb5..9969d364e2 100644 --- a/include/d/actor/d_a_player.h +++ b/include/d/actor/d_a_player.h @@ -1148,6 +1148,10 @@ public: onEndResetFlg2(ERFLG2_UNK_2); } + s16 getFishingRodAngleY() const { + return shape_angle.y + mBodyAngle.y; + } + void onFishingRelease() { this->mEndResetFlg0 |= 0x4000000; } diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index 409c8f5dc5..2fb0725013 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -1868,7 +1868,7 @@ inline u8 dComIfGs_getTmpReg(const u16 i_reg) { return g_dComIfG_gameInfo.info.getTmp().getEventReg(i_reg); } -inline u8 dComIfGs_getEventReg(const u16 reg) { +inline u8 dComIfGs_getEventReg(u16 reg) { return g_dComIfG_gameInfo.info.getEvent().getEventReg(reg); } @@ -3064,7 +3064,7 @@ inline bool dComIfGp_checkMesgBgm() { return g_dComIfG_gameInfo.play.checkMesgBgm(); } -inline void dComIfGp_setMessageCountNumber(u32 number) { +inline void dComIfGp_setMessageCountNumber(s32 number) { g_dComIfG_gameInfo.play.setMessageCountNumber(number); } diff --git a/include/d/d_save.h b/include/d/d_save.h index 30ac303aa2..db085a3906 100644 --- a/include/d/d_save.h +++ b/include/d/d_save.h @@ -648,10 +648,10 @@ private: class dSv_event_c { public: void init(); - void onEventBit(u16 i_no); - void offEventBit(u16 i_no); - int isEventBit(u16 i_no) const; - void setEventReg(u16 i_reg, u8 i_no); + void onEventBit(const u16 i_no); + void offEventBit(const u16 i_no); + int isEventBit(const u16 i_no) const; + void setEventReg(const u16 i_reg, u8 i_no); u8 getEventReg(u16 i_reg) const; void* getPEventBit() { return (void*)mEvent; } diff --git a/include/m_Do/m_Do_ext.h b/include/m_Do/m_Do_ext.h index 7cf6cd680c..19e93c86e9 100644 --- a/include/m_Do/m_Do_ext.h +++ b/include/m_Do/m_Do_ext.h @@ -146,6 +146,9 @@ public: /* 8000D990 */ void changeBckOnly(J3DAnmTransform* i_bck); /* 8000D9CC */ void entry(J3DModelData* i_modelData, f32 i_frame); /* 8000D9E8 */ void entryJoint(J3DModelData* i_modelData, u16 i_jntNo, f32 i_frame); + inline void entryJoint(J3DModelData* i_modelData, u16 i_jntNo) { + entryJoint(i_modelData, i_jntNo, getFrame()); + } void entry(J3DModelData* i_modelData) { entry(i_modelData, getFrame()); } diff --git a/src/c/c_damagereaction.cpp b/src/c/c_damagereaction.cpp index a8d31aa137..f8e3bf5627 100644 --- a/src/c/c_damagereaction.cpp +++ b/src/c/c_damagereaction.cpp @@ -19,7 +19,7 @@ u8 data_80450C9B; u8 data_80450C9C; u8 data_80450C9D; u8 data_80450C9E; -u8 data_80450C9F; +u8 cDmr_FishingWeather; /* 8001817C-800182A4 012ABC 0128+00 1/0 0/0 0/0 .text * execute__24JPTraceParticleCallBack4FP14JPABaseEmitterP15JPABaseParticle */ @@ -67,8 +67,7 @@ BOOL cDmrNowMidnaTalk() { } /* 80450CA0-80450CA4 0001A0 0004+00 0/0 0/0 2/2 .sbss None */ -extern u8 data_80450CA0[4]; -u8 data_80450CA0[4]; +u8 data_80450CA0; /* 80450CA4-80450CA8 0001A4 0004+00 1/1 1/1 1/1 .sbss JPTracePCB4 */ JPTraceParticleCallBack4 JPTracePCB4; diff --git a/src/d/actor/d_a_b_oh.cpp b/src/d/actor/d_a_b_oh.cpp index 713b6664f1..8ea49bceeb 100644 --- a/src/d/actor/d_a_b_oh.cpp +++ b/src/d/actor/d_a_b_oh.cpp @@ -158,9 +158,9 @@ daB_OH_HIO_c::daB_OH_HIO_c() { } /* 8061B75C-8061B8B0 00011C 0154+00 1/1 0/0 0/0 .text nodeCallBack__FP8J3DJointi */ -static int nodeCallBack(J3DJoint* param_0, int param_1) { +static int nodeCallBack(J3DJoint* i_joint, int param_1) { if (param_1 == 0) { - int jnt_no = param_0->getJntNo(); + int jnt_no = i_joint->getJntNo(); J3DModel* model_p = j3dSys.getModel(); b_oh_class* this_ = (b_oh_class*)model_p->getUserArea(); diff --git a/src/d/actor/d_a_mg_fshop.cpp b/src/d/actor/d_a_mg_fshop.cpp index d3d7ac00bd..081f7aa794 100644 --- a/src/d/actor/d_a_mg_fshop.cpp +++ b/src/d/actor/d_a_mg_fshop.cpp @@ -1466,10 +1466,10 @@ static void rod_set(fshop_class* param_0) { } /* 8086CC6C-8086CD70 000CEC 0104+00 1/1 0/0 0/0 .text s_fish_sub__FPvPv */ -static void* s_fish_sub(void* param_1, void* param_2) { - fopAc_ac_c* actor = (fopAc_ac_c*)param_1; - fs_weed_s* weed = (fs_weed_s*)param_2; - if (fopAcM_IsActor(param_1) && fopAcM_GetName(param_1) == PROC_MG_FISH && actor->speedF > 0.1f) { +static void* s_fish_sub(void* param_0, void* param_1) { + fopAc_ac_c* actor = (fopAc_ac_c*)param_0; + fs_weed_s* weed = (fs_weed_s*)param_1; + if (fopAcM_IsActor(param_0) && fopAcM_GetName(param_0) == PROC_MG_FISH && actor->speedF > 0.1f) { f32 dVar9 = actor->current.pos.x - weed->field_0x00[0].x; f32 dVar8 = actor->current.pos.y - weed->field_0x00[0].y; f32 dVar10 = actor->current.pos.z - weed->field_0x00[0].z; @@ -1480,7 +1480,7 @@ static void* s_fish_sub(void* param_1, void* param_2) { if (fabsf(dVar8) < 60.0f * weed->field_0xb4 && JMAFastSqrt(((dVar9 * dVar9) + (dVar10 * dVar10))) < dVar3 * 35.0f){ cLib_addCalc2(&weed->field_0xb8, dVar3, 0.1f, 0.05f); - return (fopAc_ac_c*)param_1; + return (fopAc_ac_c*)param_0; } } @@ -1853,11 +1853,11 @@ static int daFshop_Execute(fshop_class* param_1) { } } if (!bVar5) { - henna->health = 1; + henna->actor.health = 1; } else if (param_1->field_0x567 == 1) { - henna->health = 0; + henna->actor.health = 0; } else { - henna->health = 2; + henna->actor.health = 2; } henna->field_0x752 = 0x49; @@ -1879,7 +1879,7 @@ static int daFshop_Execute(fshop_class* param_1) { } if (bVar5) { - henna->health = 3; + henna->actor.health = 3; henna->field_0x752 = 0x49; } else { henna->field_0x752 = 0x4c; diff --git a/src/d/actor/d_a_npc_henna.cpp b/src/d/actor/d_a_npc_henna.cpp index d732bdce0c..d670a6945e 100644 --- a/src/d/actor/d_a_npc_henna.cpp +++ b/src/d/actor/d_a_npc_henna.cpp @@ -1,1793 +1,2564 @@ /** * @file d_a_npc_henna.cpp - * -*/ + * + */ #include "d/actor/d_a_npc_henna.h" -#include "dol2asm.h" + +#include "SSystem/SComponent/c_counter.h" +#include "SSystem/SComponent/c_m3d_g_pla.h" +#include "Z2AudioLib/Z2Instances.h" +#include "c/c_damagereaction.h" +#include "cmath.h" +#include "d/actor/d_a_alink.h" +#include "d/actor/d_a_canoe.h" +#include "d/actor/d_a_mg_fshop.h" +#include "d/actor/d_a_mg_rod.h" +#include "d/actor/d_a_npc_du.h" #include "d/d_camera.h" +#include "d/d_com_inf_game.h" +#include "d/d_msg_object.h" +#include "d/d_s_play.h" +#include "d/d_timer.h" +#include "f_op/f_op_kankyo_mng.h" +#include "m_Do/m_Do_graphic.h" -// -// Forward References: -// - -extern "C" void __ct__17daNpc_Henna_HIO_cFv(); -extern "C" static void anm_init__FP15npc_henna_classifUcf(); -extern "C" static void nodeCallBack__FP8J3DJointi(); -extern "C" static void daNpc_Henna_Draw__FP15npc_henna_class(); -extern "C" void __dt__4cXyzFv(); -extern "C" void __dt__8cM3dGPlaFv(); -extern "C" static void s_npc_sub__FPvPv(); -extern "C" static void s_piro_sub__FPvPv(); -extern "C" static void s_du_sub__FPvPv(); -extern "C" static void s_shop_sub__FPvPv(); -extern "C" static void s_koro2ball_sub__FPvPv(); -extern "C" static void message_shop__FP15npc_henna_class(); -extern "C" static void henna_shop__FP15npc_henna_class(); -extern "C" static void s_rod_sub__FPvPv(); -extern "C" static void s_fish_sub__FPvPv(); -extern "C" static void henna_ride__FP15npc_henna_class(); -extern "C" static void action__FP15npc_henna_class(); -extern "C" static void cam_3d_morf__FP15npc_henna_classf(); -extern "C" static void demo_camera__FP15npc_henna_class(); -extern "C" static void zoom_check__FP15npc_henna_classP4cXyzs(); -extern "C" static void demo_camera_shop__FP15npc_henna_class(); -extern "C" static void message_guide__FP15npc_henna_class(); -extern "C" static void s_boat_sub__FPvPv(); -extern "C" static void env_control__FP15npc_henna_class(); -extern "C" static void daNpc_Henna_Execute__FP15npc_henna_class(); -extern "C" static bool daNpc_Henna_IsDelete__FP15npc_henna_class(); -extern "C" static void daNpc_Henna_Delete__FP15npc_henna_class(); -extern "C" static void useHeapInit__FP10fopAc_ac_c(); -extern "C" void __dt__12J3DFrameCtrlFv(); -extern "C" static void daNpc_Henna_Create__FP10fopAc_ac_c(); -extern "C" void __dt__17daNpc_Henna_HIO_cFv(); -extern "C" void __sinit_d_a_npc_henna_cpp(); -extern "C" void cancelOriginalDemo__9daPy_py_cFv(); -extern "C" void __ct__4cXyzFRC4cXyz(); -extern "C" static void mDoAud_seStart__FUlPC3VecUlSc(); -extern "C" void getSubStickX__8mDoCPd_cFUl(); -extern "C" void getStickX3D__8mDoCPd_cFUl(); -extern "C" static void dComIfGp_setDoStatusForce__FUcUc(); -extern "C" static void dComIfGs_setEventReg__FUsUc(); -extern "C" static void Z2GetAudioMgr__Fv(); -extern "C" static void dComIfG_getTimerPtr__Fv(); -extern "C" void fadeIn__13mDoGph_gInf_cFfR8_GXColor(); -extern "C" static void fpcM_Search__FPFPvPv_PvPv(); -extern "C" void getTrigA__8mDoCPd_cFUl(); -extern "C" static void dComIfGp_event_reset__Fv(); -extern "C" void offPlayerNoDraw__9daPy_py_cFv(); -extern "C" static void dComIfGp_setMessageCountNumber__Fl(); -extern "C" static void dComIfGp_event_offHindFlag__FUs(); -extern "C" static void dKy_getEnvlight__Fv(); -extern "C" static void cMtx_XrotM__FPA4_fs(); -extern "C" void abs__4cXyzCFv(); -extern "C" void onPlayerNoDraw__9daPy_py_cFv(); -extern "C" static void dComIfGp_setItemRupeeCount__Fl(); -extern "C" static void dComIfGs_getRupee__Fv(); -extern "C" void fabsf__3stdFf(); -extern "C" void set__4cXyzFfff(); -extern "C" void __apl__4cXyzFRC3Vec(); -extern "C" static void cMtx_YrotS__FPA4_fs(); -extern "C" void changeDemoMode__9daPy_py_cFUliis(); -extern "C" void changeOriginalDemo__9daPy_py_cFv(); -extern "C" static void daPy_getPlayerActorClass__Fv(); -extern "C" void onCondition__11dEvt_info_cFUs(); -extern "C" void checkCommandDemoAccrpt__11dEvt_info_cFv(); -extern "C" void __as__4cXyzFRC4cXyz(); -extern "C" static void dComIfGp_checkPlayerStatus0__FiUl(); -extern "C" static void JMAFastSqrt__Ff(); -extern "C" static void dComIfGs_getEventReg__FUs(); -extern "C" static void dComIfGs_isEventBit__FUs(); -extern "C" static void dComIfGp_event_runCheck__Fv(); -extern "C" void __ct__4cXyzFv(); -extern "C" static void dComIfGp_getCamera__Fi(); -extern "C" static void dComIfGp_getPlayerCameraID__Fi(); -extern "C" static void dComIfGp_getPlayer__Fi(); -extern "C" static void dMsgObject_getSelectCursorPos__Fv(); -extern "C" static void fopAcM_GetRoomNo__FPC10fopAc_ac_c(); -extern "C" static void dComIfGs_onEventBit__FUs(); -extern "C" extern char const* const d_a_npc_henna__stringBase0; - -// -// External References: -// - -extern "C" void fadeOut__13mDoGph_gInf_cFfR8_GXColor(); -extern "C" void mDoMtx_XrotM__FPA4_fs(); -extern "C" void mDoMtx_YrotS__FPA4_fs(); -extern "C" void mDoMtx_YrotM__FPA4_fs(); -extern "C" void mDoMtx_ZrotM__FPA4_fs(); -extern "C" void transM__14mDoMtx_stack_cFfff(); -extern "C" void scaleM__14mDoMtx_stack_cFfff(); -extern "C" void play__14mDoExt_baseAnmFv(); -extern "C" void init__13mDoExt_btpAnmFP16J3DMaterialTableP16J3DAnmTexPatterniifss(); -extern "C" void entry__13mDoExt_btpAnmFP16J3DMaterialTables(); -extern "C" void init__13mDoExt_btkAnmFP16J3DMaterialTableP19J3DAnmTextureSRTKeyiifss(); -extern "C" void entry__13mDoExt_btkAnmFP16J3DMaterialTablef(); -extern "C" void init__13mDoExt_bckAnmFP15J3DAnmTransformiifssb(); -extern "C" void entryJoint__13mDoExt_bckAnmFP12J3DModelDataUsf(); -extern "C" void mDoExt_modelUpdateDL__FP8J3DModel(); -extern "C" void -__ct__14mDoExt_McaMorfFP12J3DModelDataP25mDoExt_McaMorfCallBack1_cP25mDoExt_McaMorfCallBack2_cP15J3DAnmTransformifiiiPvUlUl(); -extern "C" void setAnm__14mDoExt_McaMorfFP15J3DAnmTransformiffffPv(); -extern "C" void play__14mDoExt_McaMorfFP3VecUlSc(); -extern "C" void entryDL__14mDoExt_McaMorfFv(); -extern "C" void modelCalc__14mDoExt_McaMorfFv(); -extern "C" void mDoExt_J3DModel__create__FP12J3DModelDataUlUl(); -extern "C" void __ct__10fopAc_ac_cFv(); -extern "C" void fopAc_IsActor__FPv(); -extern "C" void fopAcIt_Judge__FPFPvPv_PvPv(); -extern "C" void fopAcM_create__FsUlPC4cXyziPC5csXyzPC4cXyzSc(); -extern "C" void fopAcM_entrySolidHeap__FP10fopAc_ac_cPFP10fopAc_ac_c_iUl(); -extern "C" void fopAcM_searchActorAngleY__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_searchActorDistance__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_orderPotentialEvent__FP10fopAc_ac_cUsUsUs(); -extern "C" void fopKyM_createWpillar__FPC4cXyzfi(); -extern "C" void fpcEx_Search__FPFPvPv_PvPv(); -extern "C" void fpcSch_JudgeByID__FPvPv(); -extern "C" void dStage_changeScene__FifUlScsi(); -extern "C" void getTimerPtr__14dComIfG_play_cFv(); -extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfG_resDelete__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfGp_getReverb__Fi(); -extern "C" void dComIfG_TimerStart__Fis(); -extern "C" void dComIfG_TimerDeleteRequest__Fi(); -extern "C" void onEventBit__11dSv_event_cFUs(); -extern "C" void offEventBit__11dSv_event_cFUs(); -extern "C" void isEventBit__11dSv_event_cCFUs(); -extern "C" void setEventReg__11dSv_event_cFUsUc(); -extern "C" void getEventReg__11dSv_event_cCFUs(); -extern "C" void getRes__14dRes_control_cFPCclP11dRes_info_ci(); -extern "C" void reset__14dEvt_control_cFv(); -extern "C" void setLookPos__9daPy_py_cFP4cXyz(); -extern "C" void Start__9dCamera_cFv(); -extern "C" void Stop__9dCamera_cFv(); -extern "C" void SetTrimSize__9dCamera_cFl(); -extern "C" void Set__9dCamera_cF4cXyz4cXyzfs(); -extern "C" void Reset__9dCamera_cF4cXyz4cXyzfs(); -extern "C" void Reset__9dCamera_cF4cXyz4cXyz(); -extern "C" void settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c(); -extern "C" void setLightTevColorType_MAJI__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c(); -extern "C" void dKy_BossLight_set__FP4cXyzP8_GXColorfUc(); -extern "C" void getActor__12dMsgObject_cFv(); -extern "C" void isMouthCheck__12dMsgObject_cFv(); -extern "C" void getSelectCursorPos__12dMsgObject_cFv(); -extern "C" void __ct__10dMsgFlow_cFv(); -extern "C" void init__10dMsgFlow_cFP10fopAc_ac_ciiPP10fopAc_ac_c(); -extern "C" void doFlow__10dMsgFlow_cFP10fopAc_ac_cPP10fopAc_ac_ci(); -extern "C" void remove__10dMsgFlow_cFv(); -extern "C" void getNowMsgNo__10dMsgFlow_cFv(); -extern "C" void dTimer_createTimer__FlUlUcUcffff(); -extern "C" void dTimer_isStart__Fv(); -extern "C" void __mi__4cXyzCFRC3Vec(); -extern "C" void __ct__5csXyzFsss(); -extern "C" void cM_atan2s__Fff(); -extern "C" void cM_rndF__Ff(); -extern "C" void cM_rndFX__Ff(); -extern "C" void cLib_addCalc2__FPffff(); -extern "C" void cLib_addCalcAngleS2__FPssss(); -extern "C" void MtxPosition__FP4cXyzP4cXyz(); -extern "C" void seStart__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc(); -extern "C" void subBgmStart__8Z2SeqMgrFUl(); -extern "C" void subBgmStop__8Z2SeqMgrFv(); -extern "C" void* __nw__FUl(); -extern "C" void __dl__FPv(); -extern "C" void init__12J3DFrameCtrlFs(); -extern "C" void checkPass__12J3DFrameCtrlFf(); -extern "C" void _savegpr_21(); -extern "C" void _savegpr_22(); -extern "C" void _savegpr_24(); -extern "C" void _savegpr_26(); -extern "C" void _savegpr_27(); -extern "C" void _savegpr_28(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_21(); -extern "C" void _restgpr_22(); -extern "C" void _restgpr_24(); -extern "C" void _restgpr_26(); -extern "C" void _restgpr_27(); -extern "C" void _restgpr_28(); -extern "C" void _restgpr_29(); -extern "C" u8 saveBitLabels__16dSv_event_flag_c[1644 + 4 /* padding */]; -extern "C" u8 m_cpadInfo__8mDoCPd_c[256]; -extern "C" u8 now__14mDoMtx_stack_c[48]; -extern "C" extern u8 g_Counter[12 + 4 /* padding */]; -extern "C" u8 mCurrentMtx__6J3DSys[48]; -extern "C" u8 sincosTable___5JMath[65536]; -extern "C" extern u8 struct_80450C98[4]; -extern "C" extern u8 cDmr_SkipInfo[4]; -extern "C" extern u8 data_80450CA0[4]; -extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */]; -extern "C" void __register_global_object(); +class dmg_rod_class; +UNK_REL_BSS // // Declarations: // -/* ############################################################################################## */ -/* 8054A964-8054A968 000000 0004+00 17/17 0/0 0/0 .rodata @3905 */ -SECTION_RODATA static f32 const lit_3905 = 1.0f; -COMPILER_STRIP_GATE(0x8054A964, &lit_3905); - -/* 8054A968-8054A96C 000004 0004+00 0/2 0/0 0/0 .rodata @3906 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3906 = 7.0f / 10.0f; -COMPILER_STRIP_GATE(0x8054A968, &lit_3906); -#pragma pop - -/* 8054A96C-8054A970 000008 0004+00 0/1 0/0 0/0 .rodata @3907 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3907 = 9.0f / 10.0f; -COMPILER_STRIP_GATE(0x8054A96C, &lit_3907); -#pragma pop - -/* 8054AC88-8054AC94 000000 000C+00 1/1 0/0 0/0 .data cNullVec__6Z2Calc */ -SECTION_DATA static u8 cNullVec__6Z2Calc[12] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* 8054AC94-8054ACA8 00000C 0004+10 0/0 0/0 0/0 .data @1787 */ -#pragma push -#pragma force_active on -SECTION_DATA static u32 lit_1787[1 + 4 /* padding */] = { - 0x02000201, - /* padding */ - 0x40080000, - 0x00000000, - 0x3FE00000, - 0x00000000, -}; -#pragma pop +UNK_REL_DATA /* 8054ACA8-8054ACB0 000020 0008+00 1/1 0/0 0/0 .data check_kind */ -SECTION_DATA static u8 check_kind[8] = { - 0xF5, 0x7F, 0xF4, 0x7F, 0xF3, 0x7F, 0xF2, 0x7F, -}; - -/* 8054ACB0-8054ACE4 -00001 0034+00 1/1 0/0 0/0 .data @4437 */ -SECTION_DATA static void* lit_4437[13] = { - (void*)(((char*)henna_shop__FP15npc_henna_class) + 0x48), - (void*)(((char*)henna_shop__FP15npc_henna_class) + 0x74), - (void*)(((char*)henna_shop__FP15npc_henna_class) + 0x7C), - (void*)(((char*)henna_shop__FP15npc_henna_class) + 0x98), - (void*)(((char*)henna_shop__FP15npc_henna_class) + 0xF8), - (void*)(((char*)henna_shop__FP15npc_henna_class) + 0x110), - (void*)(((char*)henna_shop__FP15npc_henna_class) + 0x334), - (void*)(((char*)henna_shop__FP15npc_henna_class) + 0x334), - (void*)(((char*)henna_shop__FP15npc_henna_class) + 0x334), - (void*)(((char*)henna_shop__FP15npc_henna_class) + 0x334), - (void*)(((char*)henna_shop__FP15npc_henna_class) + 0x154), - (void*)(((char*)henna_shop__FP15npc_henna_class) + 0x204), - (void*)(((char*)henna_shop__FP15npc_henna_class) + 0x2B4), -}; - -/* 8054ACE4-8054AD14 -00001 0030+00 1/1 0/0 0/0 .data @4753 */ -SECTION_DATA static void* lit_4753[12] = { - (void*)(((char*)henna_ride__FP15npc_henna_class) + 0xD4), - (void*)(((char*)henna_ride__FP15npc_henna_class) + 0x2F0), - (void*)(((char*)henna_ride__FP15npc_henna_class) + 0x10C), - (void*)(((char*)henna_ride__FP15npc_henna_class) + 0x134), - (void*)(((char*)henna_ride__FP15npc_henna_class) + 0x2F0), - (void*)(((char*)henna_ride__FP15npc_henna_class) + 0x184), - (void*)(((char*)henna_ride__FP15npc_henna_class) + 0x200), - (void*)(((char*)henna_ride__FP15npc_henna_class) + 0x268), - (void*)(((char*)henna_ride__FP15npc_henna_class) + 0x2F0), - (void*)(((char*)henna_ride__FP15npc_henna_class) + 0x2F0), - (void*)(((char*)henna_ride__FP15npc_henna_class) + 0x280), - (void*)(((char*)henna_ride__FP15npc_henna_class) + 0x2B4), -}; - -/* 8054AD14-8054AD1C 00008C 0008+00 1/1 0/0 0/0 .data check_size$5372 */ -SECTION_DATA static u8 check_size[8] = { - 0x00, 0x2B, 0x00, 0x32, 0x00, 0x38, 0x00, 0x3C, -}; - -/* 8054AD1C-8054AD6C -00001 0050+00 1/1 0/0 0/0 .data @5825 */ -SECTION_DATA static void* lit_5825[20] = { - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1294), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1690), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1374), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x13C4), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x13E0), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x13FC), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1428), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1444), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1460), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1690), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1690), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x14EC), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1508), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1524), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1540), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x155C), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1578), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1594), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x15B0), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x15CC), -}; - -/* 8054AD6C-8054AEB4 -00001 0148+00 1/1 0/0 0/0 .data @5824 */ -SECTION_DATA static void* lit_5824[82] = { - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x124), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x340), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x3FC), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x56C), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x63C), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x6F0), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0xA50), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0xA50), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0xBB8), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0xBE8), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0xC54), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0xD58), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0xDE4), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0xE9C), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0xF28), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0xF7C), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1088), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x17B0), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1808), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1838), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x19C0), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1B18), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1BE4), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1BFC), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1CB0), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1DB4), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2C10), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1E20), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x1F68), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2068), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x20F4), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2314), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x23F8), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x246C), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2630), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2768), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x29A0), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2A88), - (void*)(((char*)demo_camera_shop__FP15npc_henna_class) + 0x2B64), -}; - -/* 8054AEB4-8054AEC0 00022C 000C+00 0/1 0/0 0/0 .data btk_d$6463 */ -#pragma push -#pragma force_active on -SECTION_DATA static u8 btk_d[12] = { - 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x2B, -}; -#pragma pop - -/* 8054AEC0-8054AEE0 000238 0020+00 0/1 0/0 0/0 .data btp_d$6474 */ -#pragma push -#pragma force_active on -SECTION_DATA static u8 btp_d[32] = { - 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x33, - 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x31, -}; -#pragma pop - -/* 8054AEE0-8054AF00 000258 0020+00 0/1 0/0 0/0 .data facebck_d$6485 */ -#pragma push -#pragma force_active on -SECTION_DATA static u8 facebck_d[32] = { - 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0D, - 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, -}; -#pragma pop - -/* 8054AF00-8054AF20 -00001 0020+00 1/0 0/0 0/0 .data l_daNpc_Henna_Method */ -static actor_method_class l_daNpc_Henna_Method = { - (process_method_func)daNpc_Henna_Create__FP10fopAc_ac_c, - (process_method_func)daNpc_Henna_Delete__FP15npc_henna_class, - (process_method_func)daNpc_Henna_Execute__FP15npc_henna_class, - (process_method_func)daNpc_Henna_IsDelete__FP15npc_henna_class, - (process_method_func)daNpc_Henna_Draw__FP15npc_henna_class, -}; - -/* 8054AF20-8054AF50 -00001 0030+00 0/0 0/0 1/0 .data g_profile_NPC_HENNA */ -extern actor_process_profile_definition g_profile_NPC_HENNA = { - fpcLy_CURRENT_e, // mLayerID - 7, // mListID - fpcPi_CURRENT_e, // mListPrio - PROC_NPC_HENNA, // mProcName - &g_fpcLf_Method.base, // sub_method - sizeof(npc_henna_class), // mSize - 0, // mSizeOther - 0, // mParameters - &g_fopAc_Method.base, // sub_method - 342, // mPriority - &l_daNpc_Henna_Method, // sub_method - 0x00044000, // mStatus - fopAc_NPC_e, // mActorType - fopAc_CULLBOX_0_e, // cullType -}; - -/* 8054AF50-8054AF5C 0002C8 000C+00 2/2 0/0 0/0 .data __vt__12J3DFrameCtrl */ -SECTION_DATA extern void* __vt__12J3DFrameCtrl[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12J3DFrameCtrlFv, -}; - -/* 8054AF5C-8054AF68 0002D4 000C+00 1/1 0/0 0/0 .data __vt__8cM3dGPla */ -SECTION_DATA extern void* __vt__8cM3dGPla[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGPlaFv, -}; - -/* 8054AF68-8054AF74 0002E0 000C+00 2/2 0/0 0/0 .data __vt__17daNpc_Henna_HIO_c */ -SECTION_DATA extern void* __vt__17daNpc_Henna_HIO_c[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__17daNpc_Henna_HIO_cFv, +static u16 check_kind[4] = { + 0xF57F, + 0xF47F, + 0xF37F, + 0xF27F, }; /* 80542F0C-80542F98 0000EC 008C+00 1/1 0/0 0/0 .text __ct__17daNpc_Henna_HIO_cFv */ daNpc_Henna_HIO_c::daNpc_Henna_HIO_c() { - // NONMATCHING + field_0x4 = -1; + field_0x8 = 1.0f; + field_0xc = 60; + mSeasonDefColorR = 255; + mSeasonDefColorG = 255; + mSeasonDefColorB = 200; + mSeason2ColorR = 255; + mSeason2ColorG = 255; + mSeason2ColorB = 230; + mSeason3ColorR = 255; + mSeason3ColorG = 200; + mSeason3ColorB = 220; + mSeasonDefLightDist = 0.7f; + mSeason2LightDist = 0.9f; + mSeason3LightDist = 0.9f; + mSeasonDefLightAngle = -45; + mSeason2LightAngle = -40; + mSeason3LightAngle = -45; } -/* ############################################################################################## */ -/* 8054A970-8054A974 00000C 0004+00 3/14 0/0 0/0 .rodata @3921 */ -SECTION_RODATA static u8 const lit_3921[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x8054A970, &lit_3921); - -/* 8054A974-8054A978 000010 0004+00 2/3 0/0 0/0 .rodata @3922 */ -SECTION_RODATA static f32 const lit_3922 = -1.0f; -COMPILER_STRIP_GATE(0x8054A974, &lit_3922); - -/* 8054AC70-8054AC70 00030C 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_8054AC70 = "Henna"; -#pragma pop - /* 80542F98-80543048 000178 00B0+00 4/4 0/0 0/0 .text anm_init__FP15npc_henna_classifUcf */ -static void anm_init(npc_henna_class* param_0, int param_1, f32 param_2, u8 param_3, - f32 param_4) { - // NONMATCHING +static void anm_init(npc_henna_class* i_this, int i_resIndex, f32 i_morf, u8 i_mode, f32 i_speed) { + i_this->mpMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("Henna", i_resIndex), i_mode, + i_morf, i_speed, 0.0f, -1.0f, NULL); + i_this->mAnmResIndex = i_resIndex; } -/* ############################################################################################## */ -/* 8054A978-8054A97C 000014 0004+00 0/2 0/0 0/0 .rodata @4026 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4026 = 3.0f / 20.0f; -COMPILER_STRIP_GATE(0x8054A978, &lit_4026); -#pragma pop - -/* 8054A97C-8054A980 000018 0004+00 0/1 0/0 0/0 .rodata @4027 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4027 = 0.25f; -COMPILER_STRIP_GATE(0x8054A97C, &lit_4027); -#pragma pop - -/* 8054A980-8054A984 00001C 0004+00 0/2 0/0 0/0 .rodata @4028 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4028 = 0.5f; -COMPILER_STRIP_GATE(0x8054A980, &lit_4028); -#pragma pop - -/* 8054A984-8054A98C 000020 0008+00 0/4 0/0 0/0 .rodata @4030 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4030[8] = { - 0x43, 0x30, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x8054A984, &lit_4030); -#pragma pop - /* 80543048-80543350 000228 0308+00 1/1 0/0 0/0 .text nodeCallBack__FP8J3DJointi */ -static void nodeCallBack(J3DJoint* param_0, int param_1) { - // NONMATCHING +static int nodeCallBack(J3DJoint* i_joint, int param_1) { + if (param_1 == 0) { + J3DJoint* joint = (J3DJoint*)i_joint; // debug match + s32 jointNo = joint->getJntNo(); + J3DModel* model = j3dSys.getModel(); + npc_henna_class* a_this = (npc_henna_class*)model->getUserArea(); + if (a_this != 0) { + MTXCopy(model->getAnmMtx(jointNo), *calc_mtx); + if (jointNo == 1) { + if (a_this->field_0x7e1 != 0) { + cMtx_YrotM(*calc_mtx, a_this->field_0x6c4); + } else { + cMtx_XrotM(*calc_mtx, + a_this->field_0x6c4 + a_this->field_0x6ac * (0.15f + TREG_F(4))); + } + } else if (jointNo == 3) { + cMtx_XrotM(*calc_mtx, a_this->field_0x6ac * 0.25f); + cMtx_ZrotM(*calc_mtx, a_this->field_0x6b0 / 4); + } else if (jointNo == 4) { + cMtx_XrotM(*calc_mtx, a_this->field_0x6ac * 0.5f); + cMtx_ZrotM(*calc_mtx, a_this->field_0x6b0 / 2); + } else if (jointNo == 11) { + cMtx_ZrotM(*calc_mtx, (s16)a_this->field_0x6b6); + } else if (jointNo == 14) { + cMtx_YrotM(*calc_mtx, -a_this->field_0x6bc); + } else if (jointNo == 15) { + cMtx_ZrotM(*calc_mtx, (s16)a_this->field_0x6c0); + } else if (jointNo == 20) { + cMtx_YrotM(*calc_mtx, (s16)a_this->field_0x6be); + } else if (jointNo == 21) { + cMtx_ZrotM(*calc_mtx, (s16)a_this->field_0x6c2); + } else if (jointNo == 26) { + cMtx_ZrotM(*calc_mtx, (s16)a_this->field_0x704); + } else if (jointNo == 27) { + cMtx_ZrotM(*calc_mtx, -a_this->field_0x704); + } else if (jointNo == 29) { + cMtx_ZrotM(*calc_mtx, (s16)a_this->field_0x706); + } else if (jointNo == 30) { + cMtx_ZrotM(*calc_mtx, -a_this->field_0x706); + } + model->setAnmMtx(jointNo, *calc_mtx); + MTXCopy(*calc_mtx, j3dSys.mCurrentMtx); + } + } + return 1; } -/* ############################################################################################## */ -/* 8054A98C-8054A990 000028 0004+00 0/1 0/0 0/0 .rodata @4071 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4071 = 190.0f; -COMPILER_STRIP_GATE(0x8054A98C, &lit_4071); -#pragma pop - -/* 8054A990-8054A994 00002C 0004+00 0/3 0/0 0/0 .rodata @4072 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4072 = 700.0f; -COMPILER_STRIP_GATE(0x8054A990, &lit_4072); -#pragma pop - /* 80543350-805434C0 000530 0170+00 1/0 0/0 0/0 .text daNpc_Henna_Draw__FP15npc_henna_class */ -static void daNpc_Henna_Draw(npc_henna_class* param_0) { - // NONMATCHING +static int daNpc_Henna_Draw(npc_henna_class* i_this) { + if (i_this->field_0x734 != 0) { + return 1; + } + + fopAc_ac_c* a_this = &i_this->actor; + + g_env_light.settingTevStruct(0, &a_this->current.pos, &a_this->tevStr); + if (i_this->field_0x694 == 0) { + camera_class* camera = dComIfGp_getCamera(0); + f32 lookOffsetX = camera->lookat.eye.x - a_this->current.pos.x; + f32 lookOffsetY = camera->lookat.eye.y - a_this->current.pos.y; + f32 lookOffsetZ = camera->lookat.eye.z - a_this->current.pos.z; + if (lookOffsetY > 190.0f + JREG_F(16) || lookOffsetY < 0.0f || + lookOffsetX * lookOffsetX + lookOffsetZ * lookOffsetZ > 700.0f + JREG_F(17)) + { + J3DModel* model = i_this->mpMorf->getModel(); + g_env_light.setLightTevColorType_MAJI(model, &a_this->tevStr); + i_this->mpBtkAnms[i_this->field_0x654]->entry(model->getModelData()); + i_this->mpBtpAnms[i_this->field_0x658]->entry(model->getModelData()); + i_this->mpMorf->entryDL(); + } + } + if (i_this->field_0x693 != 0) { + g_env_light.setLightTevColorType_MAJI(i_this->mpModel, &a_this->tevStr); + mDoExt_modelUpdateDL(i_this->mpModel); + } + return 1; } -/* 805434C0-805434FC 0006A0 003C+00 2/2 0/0 0/0 .text __dt__4cXyzFv */ -// cXyz::~cXyz() { -extern "C" void __dt__4cXyzFv() { - // NONMATCHING +// needed for matching .rodata, maybe from a stripped method? + +static f32 dummy_100() { + return 100.0f; } -/* 805434FC-80543544 0006DC 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGPlaFv */ -// cM3dGPla::~cM3dGPla() { -extern "C" void __dt__8cM3dGPlaFv() { - // NONMATCHING +static f32 dummy_30() { + return 30.0f; } -/* ############################################################################################## */ -/* 8054A994-8054A998 000030 0004+00 0/1 0/0 0/0 .rodata @4112 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4112 = 100.0f; -COMPILER_STRIP_GATE(0x8054A994, &lit_4112); -#pragma pop +static f32 dummy__30() { + return -30.0f; +} -/* 8054A998-8054A99C 000034 0004+00 0/3 0/0 0/0 .rodata @4113 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4113 = 30.0f; -COMPILER_STRIP_GATE(0x8054A998, &lit_4113); -#pragma pop +static f32 dummy__100() { + return -100.0f; +} -/* 8054A99C-8054A9A0 000038 0004+00 0/0 0/0 0/0 .rodata @4114 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4114 = -30.0f; -COMPILER_STRIP_GATE(0x8054A99C, &lit_4114); -#pragma pop +static f32 dummy_300() { + return 300.0f; +} -/* 8054A9A0-8054A9A4 00003C 0004+00 0/1 0/0 0/0 .rodata @4115 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4115 = -100.0f; -COMPILER_STRIP_GATE(0x8054A9A0, &lit_4115); -#pragma pop +static f32 dummy__450() { + return -450.0f; +} -/* 8054A9A4-8054A9A8 000040 0004+00 2/3 0/0 0/0 .rodata @4190 */ -SECTION_RODATA static f32 const lit_4190 = 300.0f; -COMPILER_STRIP_GATE(0x8054A9A4, &lit_4190); +static f32 dummy_0_8() { + return 0.8f; +} -/* 8054A9A8-8054A9AC 000044 0004+00 0/0 0/0 0/0 .rodata @4191 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4191 = -450.0f; -COMPILER_STRIP_GATE(0x8054A9A8, &lit_4191); -#pragma pop +static f32 dummy__300() { + return -300.0f; +} -/* 8054A9AC-8054A9B0 000048 0004+00 0/0 0/0 0/0 .rodata @4192 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4192 = 4.0f / 5.0f; -COMPILER_STRIP_GATE(0x8054A9AC, &lit_4192); -#pragma pop - -/* 8054A9B0-8054A9B4 00004C 0004+00 0/0 0/0 0/0 .rodata @4193 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4193 = -300.0f; -COMPILER_STRIP_GATE(0x8054A9B0, &lit_4193); -#pragma pop - -/* 8054A9B4-8054A9BC 000050 0008+00 0/3 0/0 0/0 .rodata @4242 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4242[8] = { - 0x3F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x8054A9B4, &lit_4242); -#pragma pop - -/* 8054A9BC-8054A9C4 000058 0008+00 0/3 0/0 0/0 .rodata @4243 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4243[8] = { - 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x8054A9BC, &lit_4243); -#pragma pop - -/* 8054A9C4-8054A9CC 000060 0008+00 0/3 0/0 0/0 .rodata @4244 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4244[8] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x8054A9C4, &lit_4244); -#pragma pop +static cM3dGPla dummy_cM3dGPla() { + return cM3dGPla(); +} /* 80543544-805436CC 000724 0188+00 1/1 0/0 0/0 .text s_npc_sub__FPvPv */ -static void s_npc_sub(void* param_0, void* param_1) { - // NONMATCHING +static void* s_npc_sub(void* param_0, void* param_1) { + if (fopAcM_IsActor(param_0) && + (fopAcM_GetName(param_0) == PROC_NPC_NE || fopAcM_GetName(param_0) == PROC_NPC_DU)) + { + cXyz unkXyz1 = + ((fopAc_ac_c*)param_0)->current.pos - ((npc_henna_class*)param_1)->actor.current.pos; + if (((npc_henna_class*)param_1)->field_0x61c > unkXyz1.abs()) { + return param_0; + } + } + return NULL; } /* 805436CC-80543718 0008AC 004C+00 1/1 0/0 0/0 .text s_piro_sub__FPvPv */ -static void s_piro_sub(void* param_0, void* param_1) { - // NONMATCHING +static void* s_piro_sub(void* param_0, void* param_1) { + (void)param_1; // debug match + if (fopAcM_IsActor(param_0) && fopAcM_GetName(param_0) == PROC_NPC_INKO) { + return param_0; + } + return NULL; } /* 80543718-8054378C 0008F8 0074+00 1/1 0/0 0/0 .text s_du_sub__FPvPv */ -static void s_du_sub(void* param_0, void* param_1) { - // NONMATCHING +static void* s_du_sub(void* param_0, void* param_1) { + if (fopAcM_IsActor(param_0) && fopAcM_GetName(param_0) == PROC_NPC_DU && + ((npc_du_class*)param_0)->field_0x5b8 < 300.0f) + { + ((npc_henna_class*)param_1)->field_0x7d5 = 70; + return param_0; + } + return NULL; } /* 8054378C-805437E8 00096C 005C+00 2/2 0/0 0/0 .text s_shop_sub__FPvPv */ -static void s_shop_sub(void* param_0, void* param_1) { - // NONMATCHING +static void* s_shop_sub(void* param_0, void* param_1) { + (void)param_1; // debug match + if (fopAcM_IsActor(param_0) && fopAcM_GetName(param_0) == PROC_FSHOP && + (s32)(fopAcM_GetParam(param_0) & 0xff) < 35) + { + return param_0; + } + return NULL; } /* 805437E8-80543844 0009C8 005C+00 1/1 0/0 0/0 .text s_koro2ball_sub__FPvPv */ -static void s_koro2ball_sub(void* param_0, void* param_1) { - // NONMATCHING +static void* s_koro2ball_sub(void* param_0, void* param_1) { + (void)param_1; // debug match + if (fopAcM_IsActor(param_0)) { + if (fopAcM_GetName(param_0) == PROC_FSHOP && (fopAcM_GetParam(param_0) & 0xff) == 35) { + return param_0; + } + } + return NULL; } -/* ############################################################################################## */ -/* 8054A9CC-8054A9D0 000068 0004+00 1/1 0/0 0/0 .rodata @4330 */ -SECTION_RODATA static f32 const lit_4330 = 270.0f; -COMPILER_STRIP_GATE(0x8054A9CC, &lit_4330); - /* 80543844-8054395C 000A24 0118+00 1/1 0/0 0/0 .text message_shop__FP15npc_henna_class */ -static void message_shop(npc_henna_class* param_0) { - // NONMATCHING +static void message_shop(npc_henna_class* i_this) { + s16 angle = i_this->field_0x620 - dComIfGp_getPlayer(0)->shape_angle.y + 0x8000; + if (angle > 0x1800 || angle < -0x1800 || (u16)i_this->field_0x620 < 0x2e00 || + (u16)i_this->field_0x620 > 0xa800 || i_this->field_0x61c > 270.0f) + { + i_this->field_0x750 = 1; + } + if (i_this->field_0x750 != 0) { + fopAcM_OffStatus(&i_this->actor, NULL); + cLib_offBit(i_this->actor.attention_info.flags, (u32)0xa); + } else { + fopAcM_OnStatus(&i_this->actor, 0); + cLib_onBit(i_this->actor.attention_info.flags, (u32)0xa); + i_this->actor.attention_info.distances[1] = 4; + i_this->actor.attention_info.distances[3] = 4; + i_this->actor.eventInfo.onCondition(1); + if (dComIfGp_event_runCheck() != 0 && i_this->field_0x752 == 0 && + i_this->actor.eventInfo.checkCommandTalk() != 0) + { + dComIfGp_event_reset(); + i_this->field_0x752 = 10; + } + } } /* 8054395C-80543E68 000B3C 050C+00 2/2 0/0 0/0 .text henna_shop__FP15npc_henna_class */ -static void henna_shop(npc_henna_class* param_0) { - // NONMATCHING +static void henna_shop(npc_henna_class* i_this) { + s16 unkInt1 = 0x800; + + switch (i_this->field_0x6a4) { + case 0: { + anm_init(i_this, 26, 1.0f, 2, 1.0f); + i_this->actor.current.angle.y = 0x8000; + i_this->actor.shape_angle.y = 0x8000; + i_this->field_0x618 = 0x8000; + i_this->field_0x6a4 = 1; + case 1: + unkInt1 = 0; + break; + case 2: + anm_init(i_this, 27, 0.0f, 0, 1.0f); + i_this->field_0x6a4 = 3; + case 3: + if (i_this->mAnmResIndex == 27 && i_this->mpMorf->isStop()) { + anm_init(i_this, 32, 10.0f, 2, 1.0f); + i_this->field_0x6a4 = 5; + } + break; + case 4: + if (i_this->field_0x6a0 > 0x50) { + i_this->field_0x6a4 = 2; + } + break; + case 5: + if (i_this->field_0x752 != 0) { + i_this->field_0x73c[5] = cM_rndF(1000.0f) + 1000.0f; + } + if (i_this->field_0x73c[5] == 1) { + i_this->field_0x6a4 = 10; + } + break; + case 10: + if (cM_rndF(1.0f) < 0.5f || i_this->field_0x708 != 0) { + anm_init(i_this, 24, 3.0f, 0, 1.0f); + i_this->field_0x654 = 2; + i_this->field_0x708 = 0; + } else { + anm_init(i_this, 20, 3.0f, 0, 1.0f); + i_this->field_0x654 = 1; + } + i_this->field_0x6a4 = 11; + i_this->field_0x688 = 3; + i_this->field_0x698 = 0; + i_this->mpBckAnms[i_this->field_0x688]->setFrame(0.0f); + i_this->mpBckAnms[i_this->field_0x688 + 4]->setFrame(0.0f); + break; + case 11: + unkInt1 = 0; + i_this->field_0x70d = 0; + i_this->field_0x709 = 5; + if (i_this->mpMorf->isStop() != 0) { + if (i_this->mAnmResIndex == 20) { + anm_init(i_this, 19, 0.0f, 2, 1.0f); + } else { + anm_init(i_this, 23, 0.0f, 2, 1.0f); + } + i_this->field_0x6a4 = 0xc; + i_this->field_0x73c[0] = cM_rndF(60.0f) + 120.0f; + } + break; + } + case 12: { + unkInt1 = 0; + i_this->field_0x70d = 0; + i_this->field_0x709 = 5; + if (i_this->field_0x73c[0] == 0 || i_this->field_0x752 != 0) { + anm_init(i_this, 0x20, 10.0f, 2, 1.0f); + i_this->field_0x6a4 = 5; + i_this->field_0x688 = 0; + i_this->field_0x654 = 0; + i_this->field_0x698 = 0; + i_this->field_0x73c[5] = cM_rndF(1000.0f) + 1000.0f; + } + } + } + + s16 angle = i_this->field_0x620 - i_this->actor.shape_angle.y; + + if (angle > 0x2000 || angle < -0x2000) { + if (angle > 0) { + i_this->field_0x618 = i_this->field_0x620 + -0x2000; + } else { + i_this->field_0x618 = i_this->field_0x620 + 0x2000; + } + } + if (i_this->field_0x752 >= 80 && i_this->field_0x754 > 10) { + f32 dX = -661.0f - i_this->actor.current.pos.x; + f32 dZ = 376.0f - i_this->actor.current.pos.z; + i_this->field_0x618 = cM_atan2s(dX, dZ); + } + cLib_addCalcAngleS2(&i_this->actor.current.angle.y, i_this->field_0x618, 2, unkInt1); + if ((!dComIfGs_isEventBit((u16)dSv_event_flag_c::saveBitLabels[461]) || data_80450C9C != 0) && + i_this->field_0x7d7 == 0 && i_this->field_0x6a0 == 56 + TREG_S(7)) + { + dComIfGp_event_reset(); + if (data_80450C9C != 0) { + data_80450C9C = 0; + i_this->field_0x752 = 60; + } else { + dComIfGs_onEventBit((u16)dSv_event_flag_c::saveBitLabels[461]); + i_this->field_0x752 = 1; + } + i_this->field_0x7d7 = 1; + } + if (i_this->field_0x73c[3] != 0 && (i_this->field_0x73c[3] & 1) != 0) { + mDoAud_seStart(Z2SE_SY_ITEM_SET_X, 0, 0, 0); + } + if (i_this->field_0x73c[4] != 0) { + mDoAud_seStart(Z2SE_SYS_ERROR, 0, 0, 0); + } } /* 80543E68-80543EB4 001048 004C+00 1/1 0/0 0/0 .text s_rod_sub__FPvPv */ -static void s_rod_sub(void* param_0, void* param_1) { - // NONMATCHING +static void* s_rod_sub(void* param_0, void* param_1) { + (void)param_1; // debug match + if (fopAcM_IsActor(param_0) && fopAcM_GetName(param_0) == PROC_MG_ROD) { + return param_0; + } + return NULL; } -/* ############################################################################################## */ -/* 8054A9D0-8054A9D4 00006C 0004+00 0/2 0/0 0/0 .rodata @4430 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4430 = 10.0f; -COMPILER_STRIP_GATE(0x8054A9D0, &lit_4430); -#pragma pop - -/* 8054A9D4-8054A9D8 000070 0004+00 0/1 0/0 0/0 .rodata @4431 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4431 = 1000.0f; -COMPILER_STRIP_GATE(0x8054A9D4, &lit_4431); -#pragma pop - -/* 8054A9D8-8054A9DC 000074 0004+00 0/0 0/0 0/0 .rodata @4432 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4432 = 3.0f; -COMPILER_STRIP_GATE(0x8054A9D8, &lit_4432); -#pragma pop - -/* 8054A9DC-8054A9E0 000078 0004+00 0/1 0/0 0/0 .rodata @4433 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4433 = 120.0f; -COMPILER_STRIP_GATE(0x8054A9DC, &lit_4433); -#pragma pop - -/* 8054A9E0-8054A9E4 00007C 0004+00 0/0 0/0 0/0 .rodata @4434 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4434 = 60.0f; -COMPILER_STRIP_GATE(0x8054A9E0, &lit_4434); -#pragma pop - -/* 8054A9E4-8054A9E8 000080 0004+00 0/0 0/0 0/0 .rodata @4435 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4435 = -661.0f; -COMPILER_STRIP_GATE(0x8054A9E4, &lit_4435); -#pragma pop - -/* 8054A9E8-8054A9EC 000084 0004+00 0/0 0/0 0/0 .rodata @4436 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4436 = 376.0f; -COMPILER_STRIP_GATE(0x8054A9E8, &lit_4436); -#pragma pop - -/* 8054A9EC-8054A9F0 000088 0004+00 0/2 0/0 0/0 .rodata @4491 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4491 = 500.0f; -COMPILER_STRIP_GATE(0x8054A9EC, &lit_4491); -#pragma pop - /* 80543EB4-8054403C 001094 0188+00 1/1 0/0 0/0 .text s_fish_sub__FPvPv */ -static void s_fish_sub(void* param_0, void* param_1) { - // NONMATCHING +static void* s_fish_sub(void* param_0, void* param_1) { + if (fopAcM_IsActor(param_0) != 0) { + fopAc_ac_c* a_param_1 = (fopAc_ac_c*)param_0; + if (fopAcM_GetName(param_0) == PROC_NPC_DU || fopAcM_GetName(param_0) == PROC_MG_FISH) { + fopAc_ac_c* a_param_2 = (fopAc_ac_c*)param_1; + cXyz offset = a_param_1->current.pos - a_param_2->current.pos; + if (offset.abs() < 500.0f + TREG_F(12)) { + return param_0; + } + } + } + return 0; } -/* ############################################################################################## */ -/* 8054AF80-8054AF84 000008 0001+03 4/4 0/0 0/0 .bss @1109 */ -static u8 lit_1109[1 + 3 /* padding */]; - -/* 8054AF84-8054AF88 00000C 0001+03 0/0 0/0 0/0 .bss @1107 */ -#pragma push -#pragma force_active on -static u8 lit_1107[1 + 3 /* padding */]; -#pragma pop - -/* 8054AF88-8054AF8C 000010 0001+03 0/0 0/0 0/0 .bss @1105 */ -#pragma push -#pragma force_active on -static u8 lit_1105[1 + 3 /* padding */]; -#pragma pop - -/* 8054AF8C-8054AF90 000014 0001+03 0/0 0/0 0/0 .bss @1104 */ -#pragma push -#pragma force_active on -static u8 lit_1104[1 + 3 /* padding */]; -#pragma pop - -/* 8054AF90-8054AF94 000018 0001+03 0/0 0/0 0/0 .bss @1099 */ -#pragma push -#pragma force_active on -static u8 lit_1099[1 + 3 /* padding */]; -#pragma pop - -/* 8054AF94-8054AF98 00001C 0001+03 0/0 0/0 0/0 .bss @1097 */ -#pragma push -#pragma force_active on -static u8 lit_1097[1 + 3 /* padding */]; -#pragma pop - -/* 8054AF98-8054AF9C 000020 0001+03 0/0 0/0 0/0 .bss @1095 */ -#pragma push -#pragma force_active on -static u8 lit_1095[1 + 3 /* padding */]; -#pragma pop - -/* 8054AF9C-8054AFA0 000024 0001+03 0/0 0/0 0/0 .bss @1094 */ -#pragma push -#pragma force_active on -static u8 lit_1094[1 + 3 /* padding */]; -#pragma pop - -/* 8054AFA0-8054AFA4 000028 0001+03 0/0 0/0 0/0 .bss @1057 */ -#pragma push -#pragma force_active on -static u8 lit_1057[1 + 3 /* padding */]; -#pragma pop - -/* 8054AFA4-8054AFA8 00002C 0001+03 0/0 0/0 0/0 .bss @1055 */ -#pragma push -#pragma force_active on -static u8 lit_1055[1 + 3 /* padding */]; -#pragma pop - -/* 8054AFA8-8054AFAC 000030 0001+03 0/0 0/0 0/0 .bss @1053 */ -#pragma push -#pragma force_active on -static u8 lit_1053[1 + 3 /* padding */]; -#pragma pop - -/* 8054AFAC-8054AFB0 000034 0001+03 0/0 0/0 0/0 .bss @1052 */ -#pragma push -#pragma force_active on -static u8 lit_1052[1 + 3 /* padding */]; -#pragma pop - -/* 8054AFB0-8054AFB4 000038 0001+03 0/0 0/0 0/0 .bss @1014 */ -#pragma push -#pragma force_active on -static u8 lit_1014[1 + 3 /* padding */]; -#pragma pop - -/* 8054AFB4-8054AFB8 00003C 0001+03 0/0 0/0 0/0 .bss @1012 */ -#pragma push -#pragma force_active on -static u8 lit_1012[1 + 3 /* padding */]; -#pragma pop - -/* 8054AFB8-8054AFBC 000040 0001+03 0/0 0/0 0/0 .bss @1010 */ -#pragma push -#pragma force_active on -static u8 lit_1010[1 + 3 /* padding */]; -#pragma pop - -/* 8054AFBC-8054AFC0 -00001 0004+00 1/2 0/0 0/0 .bss None */ -/* 8054AFBC 0001+00 data_8054AFBC @1009 */ -/* 8054AFBD 0003+00 data_8054AFBD None */ -static u8 struct_8054AFBC[4]; - -/* 8054AFC0-8054AFCC 000048 000C+00 0/1 0/0 0/0 .bss @3900 */ -#pragma push -#pragma force_active on -static u8 lit_3900[12]; -#pragma pop +static u8 lbl_82_bss_45; /* 8054AFCC-8054B004 000054 0038+00 1/4 0/0 0/0 .bss l_HIO */ -static u8 l_HIO[56]; +static daNpc_Henna_HIO_c l_HIO; /* 8054B004-8054B008 00008C 0004+00 3/4 0/0 0/0 .bss lrl */ -static u8 lrl[4]; +static dmg_rod_class* lrl; + +static u8 lbl_82_bss_90; +static u8 lbl_82_bss_91; /* 8054403C-80544A4C 00121C 0A10+00 2/1 0/0 0/0 .text henna_ride__FP15npc_henna_class */ -static void henna_ride(npc_henna_class* param_0) { - // NONMATCHING +static void henna_ride(npc_henna_class* i_this) { + daPy_py_c* player; + f32 stickX; + f32 stickY; + f32 stickMag; + s16 stickAngle; + fopAc_ac_c* actor; + + actor = &i_this->actor; + player = (daPy_py_c*)dComIfGp_getPlayer(0); + + stickX = mDoCPd_c::getStickX3D(0); + stickY = mDoCPd_c::getStickY(0); + + i_this->field_0x70d = 2; + i_this->field_0x70e = 1300; + i_this->field_0x720 = player->eyePos; + + if (dComIfGp_checkPlayerStatus0(0, 0x2000) != 0 || dComIfGp_event_runCheck() != 0) { + stickX = stickY = 0.0f; + } + stickMag = JMAFastSqrt(stickX * stickX + stickY * stickY); + stickAngle = (s16)cM_atan2s(stickX, stickY); + + cXyz unkXyz_48; + cXyz unkXyz_3c; + + switch (i_this->field_0x6a4) { + case 0: + anm_init(i_this, 8, 10.0f, 2, 1.0f); + i_this->field_0x6a4++; + actor->speedF = 0; + i_this->field_0x7e1 = 1; + break; + case 2: + anm_init(i_this, 21, 3.0f, 0, 1.0f); + i_this->field_0x6a4++; + break; + case 3: + cLib_addCalcAngleS2(&i_this->field_0x690, -0x1f40, 1, 0x800); + if (i_this->mpMorf->isStop()) { + i_this->field_0x6a4 = 0; + } + break; + case 5: + anm_init(i_this, 21, 3.0f, 1, -1.0f); + i_this->mpMorf->setFrame(i_this->mpMorf->getEndFrame() - 1.0f); + i_this->field_0x6a4++; + break; + case 6: + if (i_this->mpMorf->getFrame() <= 12.0f + VREG_F(6)) { + cLib_addCalcAngleS2(&i_this->field_0x690, 0, 1, 0x800); + } + if (i_this->mpMorf->isStop()) { + i_this->field_0x6a4 = 7; + } + break; + case 7: + cLib_addCalcAngleS2(&i_this->field_0x690, 0, 1, 0x800); + break; + case 10: + anm_init(i_this, 9, 5.0f, 2, 1.0f); + i_this->field_0x6a4 = 11; + i_this->field_0x73c[0] = l_HIO.field_0xc; + break; + case 11: + if (i_this->field_0x73c[0] == 0) { + i_this->field_0x6a4 = 0; + i_this->field_0x6f2 = cM_rndF(100.0f) + 60.0f; + i_this->field_0x662 = 0; + } + } + + if (lrl != NULL) { + fopAc_ac_c* fish; + if (lrl->field_0xf7e == 0) { + if (i_this->field_0x710 == 0) { + i_this->field_0x710 = cM_rndF(100.0f) + 90.0f; + cMtx_YrotS(*calc_mtx, actor->shape_angle.y); + unkXyz_48.x = cM_rndFX(200.0f); + unkXyz_48.y = 0.0f; + unkXyz_48.z = 100.0f; + MtxPosition(&unkXyz_48, &i_this->field_0x714); + i_this->field_0x714 += actor->current.pos; + } else { + i_this->field_0x710--; + } + i_this->field_0x720 = i_this->field_0x714; + fish = (fopAc_ac_c*)fpcM_Search(s_fish_sub, i_this); + if (fish != NULL) { + i_this->field_0x720 = fish->current.pos; + i_this->field_0x70e = 0x600; + } + } else if (lrl->field_0x13b4 == 10 || lrl->field_0x13b4 == 11) { + fish = fopAcM_SearchByID(lrl->mFishId); + if (fish != NULL) { + i_this->field_0x720 = fish->current.pos; + i_this->field_0x70e = 1000; + } + } else if (lrl->field_0xf7e == 1) { + cMtx_YrotS(*calc_mtx, player->getFishingRodAngleY()); + unkXyz_48.x = 0.0f; + unkXyz_48.y = 0.0f; + unkXyz_48.z = 2000.0f; + MtxPosition(&unkXyz_48, &i_this->field_0x720); + i_this->field_0x720 += player->eyePos; + } else if (lrl->field_0xf7e == 3 || lrl->field_0xf7e == 4 || lrl->field_0xf7e == 5) { + i_this->field_0x720 = lrl->current.pos; + i_this->field_0x70e = 0x600; + } + + if (player->checkCanoeRide() != 0 && (lrl->field_0x13b4 == 0 || lrl->field_0x13b4 >= 0x50)) + { + if (i_this->field_0x6a4 < 5) { + i_this->field_0x6a4 = 5; + } + if (i_this->field_0x6a4 == 7) { + i_this->field_0x692 = 1; + if (stickMag > 0.1f) { + if (stickAngle <= 0x3200 && stickAngle >= -0x3200) { + if (i_this->field_0x660 > 0x14 && i_this->mAnmResIndex != 7) { + anm_init(i_this, 7, 10.0f, 2, 1.0f); + } + i_this->field_0x660++; + } else if (stickAngle > (s16)(0x6000 + AREG_S(6)) || + (s16)stickAngle < (s16) - (0x6000 + AREG_S(6))) + { + if (i_this->field_0x660 > 0x14 && i_this->mAnmResIndex != 6) { + anm_init(i_this, 6, 10.0f, 2, 1.0f); + } + i_this->field_0x660++; + if (i_this->field_0x660 > 0x14) { + cMtx_YrotS(*calc_mtx, actor->shape_angle.y); + if ((i_this->field_0x6a0 & 0x80) != 0) { + unkXyz_48.x = 100.0f; + } else { + unkXyz_48.x = -100.0f; + } + unkXyz_48.y = 0.0f; + unkXyz_48.z = -200.0f; + MtxPosition(&unkXyz_48, &i_this->field_0x720); + i_this->field_0x720 += actor->current.pos; + i_this->field_0x70d = 3; + i_this->field_0x70e = 5000; + } + } else { + if (i_this->mAnmResIndex != 30) { + anm_init(i_this, 30, 10.0f, 2, 1.0f); + } + i_this->field_0x660 = 0; + } + } else { + if (i_this->mAnmResIndex != 30) { + anm_init(i_this, 30, 10.0f, 2, 1.0f); + } + i_this->field_0x660 = 0; + } + if (i_this->mAnmResIndex == 7 || i_this->mAnmResIndex == 6) { + f32 stickMagAdj = stickMag * (1.5f + VREG_F(7)); + if (stickMagAdj < 1.0f + VREG_F(8)) { + stickMagAdj = 1.0f + VREG_F(8); + } + i_this->mpMorf->setPlaySpeed(stickMagAdj); + MTXCopy(i_this->mpModel->getBaseTRMtx(), *calc_mtx); + unkXyz_48.x = 0.0f; + unkXyz_48.y = 0.0f; + unkXyz_48.z = -100.0f + VREG_F(8); + MtxPosition(&unkXyz_48, &unkXyz_3c); + unkXyz_3c.y = lrl->field_0x590; + f32 unkFloat1; + if (i_this->mAnmResIndex == 7) { + unkFloat1 = 22.0f; + } else { + unkFloat1 = 2.0f; + } + if (i_this->mpMorf->checkFrame(unkFloat1) != FALSE) { + fopKyM_createWpillar(&unkXyz_3c, 0.6f + VREG_F(10), 0); + } + } + } + } else { + if (i_this->field_0x6a4 >= 5 && i_this->field_0x6a4 < 10) { + i_this->field_0x6a4 = 2; + i_this->field_0x692 = 1; + } + i_this->field_0x660 = 0; + } + } + + if (i_this->mAnmResIndex == 21 && i_this->mpMorf->getFrame() <= 12.0f + VREG_F(6)) { + i_this->field_0x692 = 1; + } + + if (player->checkCanoeRide() == 0) { + i_this->field_0x70d = 10; + } + + if ((lrl != NULL && lrl->field_0x146d != 0) || i_this->field_0x7b8 != 0 || + dComIfGp_checkPlayerStatus0(0, 0x2000) != 0) + { + i_this->field_0x70d = 2; + i_this->field_0x70e = 1000; + + i_this->field_0x720 = player->eyePos; + i_this->field_0x720.y += hREG_F(0) + 40.0f; + + if (i_this->mAnmResIndex == 30) { + cMtx_YrotS(*calc_mtx, actor->shape_angle.y); + unkXyz_48.x = JREG_F(7) - 80.0f; + unkXyz_48.y = 0.0f; + unkXyz_48.z = 0.0f; + MtxPosition(&unkXyz_48, &unkXyz_3c); + i_this->field_0x720 += unkXyz_3c; + } + + if (dComIfGp_checkPlayerStatus0(0, 0x2000) != 0) { + camera_class* camera_0c = dComIfGp_getCamera(0); + + cXyz vecToPlayer; + vecToPlayer = actor->eyePos - camera_0c->lookat.eye; + unkXyz_48 = camera_0c->lookat.center - camera_0c->lookat.eye; + + s16 yaw = (s16)cM_atan2s(unkXyz_48.x, unkXyz_48.z); + yaw -= (s16)cM_atan2s(vecToPlayer.x, vecToPlayer.z); + if (yaw < 0x400 && yaw > -0x400) { + s16 pitch = (s16)-cM_atan2s(unkXyz_48.y, JMAFastSqrt(unkXyz_48.x * unkXyz_48.x + + unkXyz_48.z * unkXyz_48.z)); + pitch -= (s16)-cM_atan2s(vecToPlayer.y, JMAFastSqrt(vecToPlayer.x * vecToPlayer.x + + vecToPlayer.z * vecToPlayer.z)); + if (pitch < 0x400 && pitch > -0x400 && i_this->field_0x73c[3] == 0) { + i_this->field_0x73c[3] = 0xa0; + i_this->field_0x6ba = 60; + } + } + } + } } -/* ############################################################################################## */ -/* 8054A9F0-8054A9F4 00008C 0004+00 0/1 0/0 0/0 .rodata @4740 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4740 = 12.0f; -COMPILER_STRIP_GATE(0x8054A9F0, &lit_4740); -#pragma pop - -/* 8054A9F4-8054A9F8 000090 0004+00 0/3 0/0 0/0 .rodata @4741 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4741 = 5.0f; -COMPILER_STRIP_GATE(0x8054A9F4, &lit_4741); -#pragma pop - -/* 8054A9F8-8054A9FC 000094 0004+00 0/1 0/0 0/0 .rodata @4742 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4742 = 90.0f; -COMPILER_STRIP_GATE(0x8054A9F8, &lit_4742); -#pragma pop - -/* 8054A9FC-8054AA00 000098 0004+00 0/2 0/0 0/0 .rodata @4743 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4743 = 200.0f; -COMPILER_STRIP_GATE(0x8054A9FC, &lit_4743); -#pragma pop - -/* 8054AA00-8054AA04 00009C 0004+00 0/0 0/0 0/0 .rodata @4744 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4744 = 2000.0f; -COMPILER_STRIP_GATE(0x8054AA00, &lit_4744); -#pragma pop - -/* 8054AA04-8054AA08 0000A0 0004+00 0/0 0/0 0/0 .rodata @4745 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4745 = 1.0f / 10.0f; -COMPILER_STRIP_GATE(0x8054AA04, &lit_4745); -#pragma pop - -/* 8054AA08-8054AA0C 0000A4 0004+00 0/0 0/0 0/0 .rodata @4746 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4746 = -200.0f; -COMPILER_STRIP_GATE(0x8054AA08, &lit_4746); -#pragma pop - -/* 8054AA0C-8054AA10 0000A8 0004+00 0/1 0/0 0/0 .rodata @4747 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4747 = 1.5f; -COMPILER_STRIP_GATE(0x8054AA0C, &lit_4747); -#pragma pop - -/* 8054AA10-8054AA14 0000AC 0004+00 0/0 0/0 0/0 .rodata @4748 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4748 = 22.0f; -COMPILER_STRIP_GATE(0x8054AA10, &lit_4748); -#pragma pop - -/* 8054AA14-8054AA18 0000B0 0004+00 0/2 0/0 0/0 .rodata @4749 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4749 = 2.0f; -COMPILER_STRIP_GATE(0x8054AA14, &lit_4749); -#pragma pop - -/* 8054AA18-8054AA1C 0000B4 0004+00 0/1 0/0 0/0 .rodata @4750 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4750 = 3.0f / 5.0f; -COMPILER_STRIP_GATE(0x8054AA18, &lit_4750); -#pragma pop - -/* 8054AA1C-8054AA20 0000B8 0004+00 0/1 0/0 0/0 .rodata @4751 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4751 = 40.0f; -COMPILER_STRIP_GATE(0x8054AA1C, &lit_4751); -#pragma pop - -/* 8054AA20-8054AA24 0000BC 0004+00 0/0 0/0 0/0 .rodata @4752 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4752 = -80.0f; -COMPILER_STRIP_GATE(0x8054AA20, &lit_4752); -#pragma pop - -/* 8054AA24-8054AA28 0000C0 0004+00 0/1 0/0 0/0 .rodata @4908 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4908 = -0.75f; -COMPILER_STRIP_GATE(0x8054AA24, &lit_4908); -#pragma pop - -/* 8054AA28-8054AA2C 0000C4 0004+00 0/2 0/0 0/0 .rodata @4909 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4909 = 150.0f; -COMPILER_STRIP_GATE(0x8054AA28, &lit_4909); -#pragma pop - -/* 8054AA2C-8054AA30 0000C8 0004+00 0/1 0/0 0/0 .rodata @4910 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4910 = 20.0f; -COMPILER_STRIP_GATE(0x8054AA2C, &lit_4910); -#pragma pop - -/* 8054AA30-8054AA34 0000CC 0004+00 0/1 0/0 0/0 .rodata @4911 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4911 = -150.0f; -COMPILER_STRIP_GATE(0x8054AA30, &lit_4911); -#pragma pop - -/* 8054AA34-8054AA38 0000D0 0004+00 0/1 0/0 0/0 .rodata @4912 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4912 = -0.5f; -COMPILER_STRIP_GATE(0x8054AA34, &lit_4912); -#pragma pop - -/* 8054AA38-8054AA3C 0000D4 0004+00 0/1 0/0 0/0 .rodata @4913 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4913 = -13.0f / 20.0f; -COMPILER_STRIP_GATE(0x8054AA38, &lit_4913); -#pragma pop - /* 80544A4C-805450A8 001C2C 065C+00 1/1 0/0 0/0 .text action__FP15npc_henna_class */ -static void action(npc_henna_class* param_0) { - // NONMATCHING +static void action(npc_henna_class* i_this) { + fopAc_ac_c* actor = (fopAc_ac_c*)&i_this->actor; + fopAc_ac_c* player = (fopAc_ac_c*)dComIfGp_getPlayer(0); + cXyz unkXyz1; + cXyz unkXyz2; + + i_this->field_0x61c = fopAcM_searchPlayerDistance(actor); + i_this->field_0x620 = fopAcM_searchPlayerAngleY(actor); + + if (i_this->field_0x7b8 != 0) { + i_this->field_0x7b8 -= 1; + } + if (i_this->field_0x7d5 != 0) { + i_this->field_0x7d5 -= 1; + } + if (i_this->field_0x7b5 != 0) { + i_this->field_0x7b5 -= 1; + } + if (i_this->field_0x750 != 0) { + i_this->field_0x750 -= 1; + } + if (i_this->field_0x709 != 0) { + i_this->field_0x709 -= 1; + } + fpcM_Search(s_du_sub, i_this); + + fopAc_ac_c* unkActor1; + if (i_this->field_0x752 >= 80 && i_this->field_0x754 > 5) { + unkActor1 = (fopAc_ac_c*)fpcM_Search(s_piro_sub, i_this); + } else { + unkActor1 = (fopAc_ac_c*)fpcM_Search(s_npc_sub, i_this); + if (unkActor1 == NULL) { + unkActor1 = player; + } + } + i_this->field_0x70d = 1; + + msg_class* msg = ((dMsgObject_c*)unkActor1)->getActor(); + if (msg != 0 && msg->mode == 6 && ((dMsgObject_c*)unkActor1)->isMouthCheck() != 0 && + (lrl == 0 || lrl->field_0x13b4 != 30)) + { + i_this->field_0x6a6 = 15; + } + i_this->field_0x5b5 = 0; + + switch (i_this->field_0x6a2) { + case 20: + henna_ride(i_this); + break; + case 50: + henna_shop(i_this); + i_this->field_0x5b5 = 2; + break; + case 0: + case 10: + case 60: + default: + break; + } + + if (i_this->field_0x5b5 == 1 && i_this->field_0x61c < 200.0f) { + i_this->field_0x6a2 = 10; + i_this->field_0x6a4 = 0; + } + + if (i_this->field_0x7e1 == 0) { + i_this->field_0x6c4 = 0; + } else { + player = fopAcM_SearchByID(i_this->mBoatId); + if (player != NULL) { + cLib_addCalcAngleS2(&i_this->field_0x6c4, player->shape_angle.z * (-0.75f + ZREG_F(0)), + 4, 500.0f + ZREG_F(0)); + } + } + + cLib_addCalcAngleS2(&actor->shape_angle.y, actor->current.angle.y, 2, 0x4000); + if (i_this->field_0x658 == 0) { + if (i_this->field_0x6f2 == 0) { + i_this->field_0x6f2 = cM_rndF(150.0f) + 30.0f; + i_this->field_0x662 = 8; + } + if (i_this->field_0x662 != 0) { + i_this->field_0x662 -= 1; + i_this->field_0x69c = i_this->field_0x662; + if (i_this->field_0x69c > 5.0f) { + i_this->field_0x69c = 0.0f; + } + } else { + i_this->field_0x69c = 0; + } + } + + s16 unkTarget1 = 0; + s16 unkTarget2 = 0; + s16 unkTarget2Limit = 9000 + BREG_F(0); + s16 unkTarget1Limit = 10000 + BREG_F(1); + if (i_this->field_0x70d == 10 || (i_this->field_0x70d == 1 && i_this->field_0x61c < 700.0f)) { + if (i_this->field_0x70c != 0) { + unkXyz1 = unkActor1->eyePos - actor->eyePos; + unkXyz1.y += i_this->field_0x72c * (20.0f + TREG_F(5)) + TREG_F(2); + } else { + unkXyz1 = unkActor1->eyePos - actor->current.pos; + if (i_this->field_0x7e1 == 0) { + unkXyz1.y += -150.0f + TREG_F(1); + } else { + unkXyz1.y += 0.0f + TREG_F(2); + } + } + s16 angle = actor->shape_angle.y - i_this->field_0x620; + if (i_this->field_0x7e1 != 0 || (angle < 0x4000 && angle > -0x4000)) { + unkTarget1 = cM_atan2s(unkXyz1.x, unkXyz1.z) - actor->shape_angle.y; + unkTarget2 = + -cM_atan2s(unkXyz1.y, JMAFastSqrt(unkXyz1.x * unkXyz1.x + unkXyz1.z * unkXyz1.z)); + } + } else if (i_this->field_0x70d == 2 || i_this->field_0x70d == 3) { + unkXyz1 = i_this->field_0x720 - actor->current.pos; + unkTarget1 = cM_atan2s(unkXyz1.x, unkXyz1.z) - actor->shape_angle.y; + unkTarget2 = + -cM_atan2s(unkXyz1.y, JMAFastSqrt(unkXyz1.x * unkXyz1.x + unkXyz1.z * unkXyz1.z)); + if (i_this->field_0x70d == 2) { + unkTarget1Limit = 15000; + } else { + unkTarget1Limit = 0x6000; + } + } + + if (unkTarget1 > unkTarget1Limit) { + unkTarget1 = unkTarget1Limit; + } else if (unkTarget1 < (s16)-unkTarget1Limit) { + unkTarget1 = -unkTarget1Limit; + } + + if (unkTarget2 > unkTarget2Limit) { + unkTarget2 = unkTarget2Limit; + } else if (unkTarget2 < -unkTarget2Limit) { + unkTarget2 = -unkTarget2Limit; + } + + cLib_addCalc2(&i_this->field_0x6ac, unkTarget1, 0.5f, i_this->field_0x70e); + cLib_addCalcAngleS2(&i_this->field_0x6b0, unkTarget2, 2, i_this->field_0x70e); + i_this->field_0x70e = 0x600; + + if (i_this->field_0x6b0 > 0) { + i_this->field_0x6b6 = i_this->field_0x6b0 * (TREG_F(2) + -0.5f); + } else { + i_this->field_0x6b6 = i_this->field_0x6b0 * (TREG_F(3) + -0.65f); + } + i_this->field_0x6b6 += (s16)((0.15f + TREG_F(13)) * fabsf(i_this->field_0x6ac)); } /* 805450A8-8054518C 002288 00E4+00 1/1 0/0 0/0 .text cam_3d_morf__FP15npc_henna_classf */ -static void cam_3d_morf(npc_henna_class* param_0, f32 param_1) { - // NONMATCHING +static void cam_3d_morf(npc_henna_class* i_this, f32 param_1) { + cLib_addCalc2(&i_this->field_0x76c.x, i_this->field_0x784.x, param_1, + i_this->field_0x79c.x * i_this->field_0x7c0); + cLib_addCalc2(&i_this->field_0x76c.y, i_this->field_0x784.y, param_1, + i_this->field_0x79c.y * i_this->field_0x7c0); + cLib_addCalc2(&i_this->field_0x76c.z, i_this->field_0x784.z, param_1, + i_this->field_0x79c.z * i_this->field_0x7c0); + cLib_addCalc2(&i_this->field_0x760.x, i_this->field_0x778.x, param_1, + i_this->field_0x790.x * i_this->field_0x7c0); + cLib_addCalc2(&i_this->field_0x760.y, i_this->field_0x778.y, param_1, + i_this->field_0x790.y * i_this->field_0x7c0); + cLib_addCalc2(&i_this->field_0x760.z, i_this->field_0x778.z, param_1, + i_this->field_0x790.z * i_this->field_0x7c0); } -/* ############################################################################################## */ -/* 8054AA3C-8054AA40 0000D8 0004+00 0/1 0/0 0/0 .rodata @5035 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5035 = -2815.0f; -COMPILER_STRIP_GATE(0x8054AA3C, &lit_5035); -#pragma pop - -/* 8054AA40-8054AA44 0000DC 0004+00 0/1 0/0 0/0 .rodata @5036 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5036 = 66.0f; -COMPILER_STRIP_GATE(0x8054AA40, &lit_5036); -#pragma pop - -/* 8054AA44-8054AA48 0000E0 0004+00 0/1 0/0 0/0 .rodata @5037 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5037 = 4604.0f; -COMPILER_STRIP_GATE(0x8054AA44, &lit_5037); -#pragma pop - -/* 8054AA48-8054AA4C 0000E4 0004+00 0/1 0/0 0/0 .rodata @5038 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5038 = -2914.0f; -COMPILER_STRIP_GATE(0x8054AA48, &lit_5038); -#pragma pop - -/* 8054AA4C-8054AA50 0000E8 0004+00 0/1 0/0 0/0 .rodata @5039 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5039 = 144.0f; -COMPILER_STRIP_GATE(0x8054AA4C, &lit_5039); -#pragma pop - -/* 8054AA50-8054AA54 0000EC 0004+00 0/1 0/0 0/0 .rodata @5040 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5040 = 5036.0f; -COMPILER_STRIP_GATE(0x8054AA50, &lit_5040); -#pragma pop - -/* 8054AA54-8054AA58 0000F0 0004+00 0/1 0/0 0/0 .rodata @5041 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5041 = 55.0f; -COMPILER_STRIP_GATE(0x8054AA54, &lit_5041); -#pragma pop - -/* 8054AA58-8054AA5C 0000F4 0004+00 0/1 0/0 0/0 .rodata @5042 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5042 = 4603.0f; -COMPILER_STRIP_GATE(0x8054AA58, &lit_5042); -#pragma pop - -/* 8054B008-8054B00C 000090 0004+00 1/3 0/0 0/0 .bss None */ -static u8 data_8054B008[4]; - /* 8054518C-8054549C 00236C 0310+00 1/1 0/0 0/0 .text demo_camera__FP15npc_henna_class */ -static void demo_camera(npc_henna_class* param_0) { - // NONMATCHING +static void demo_camera(npc_henna_class* i_this) { + camera_class* camera; + daCanoe_c* boat; + + fopAc_ac_c* unused1 = dComIfGp_getPlayer(0); + camera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); + camera_class* unused2 = dComIfGp_getCamera(0); + + cXyz unkXyz1; + cXyz unkXyz2; + cXyz unkXyz3; + cXyz unkXyz4; + + switch (i_this->field_0x752) { + case 0: + lbl_82_bss_90 = 0; + break; + case 100: + if (!i_this->actor.eventInfo.checkCommandDemoAccrpt()) { + fopAcM_orderPotentialEvent(&i_this->actor, dEvtCnd_CANDEMO_e, -1, 0); + i_this->actor.eventInfo.onCondition(dEvtCnd_CANDEMO_e); + return; + } + i_this->field_0x752 = 101; + i_this->field_0x754 = 0; + camera->mCamera.Stop(); + i_this->field_0x76c.set(-2815.0f, 66.0f, 4604.0f); + i_this->field_0x760.set(-2914.0f, 144.0f, 5036.0f); + i_this->field_0x7bc = 55.0f; + case 101: + if (i_this->field_0x754 == 2) { + daPy_getPlayerActorClass()->changeOriginalDemo(); + daPy_getPlayerActorClass()->changeDemoMode(4, 3, 0, 0); + i_this->field_0x6a2 = 20; + i_this->field_0x6a4 = 0; + boat = (daCanoe_c*)fopAcM_SearchByID(i_this->mBoatId); + if (boat != NULL) { + unkXyz4.set(-2815.0f, boat->current.pos.y, 4603.0f); + boat->setPosAndAngle(&unkXyz4, 0x76d9); + } + } + + if (i_this->field_0x754 == 10) { + camera->mCamera.Reset(i_this->field_0x76c, i_this->field_0x760); + camera->mCamera.Start(); + dComIfGp_event_reset(); + daPy_py_c* player = daPy_getPlayerActorClass(); + player->cancelOriginalDemo(); + if (!dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[0x1d0])) { + i_this->field_0x70a = 10; + i_this->field_0x70b = 0; + i_this->field_0x734 = 1; + } else { + i_this->field_0x752 = 0; + } + dComIfGs_offEventBit((u16)dSv_event_flag_c::saveBitLabels[0x1cf]); + dComIfGs_offEventBit((u16)dSv_event_flag_c::saveBitLabels[0x1d0]); + } + } + + if (i_this->field_0x752 != 0) { + i_this->field_0x754 = i_this->field_0x754 + 1; + if (i_this->field_0x754 > 10000) { + i_this->field_0x754 = 10000; + } + if (i_this->field_0x752 < 110) { + camera->mCamera.Set(i_this->field_0x76c, i_this->field_0x760, i_this->field_0x7bc, 0); + } + } } /* 8054549C-80545638 00267C 019C+00 1/1 0/0 0/0 .text zoom_check__FP15npc_henna_classP4cXyzs */ -static void zoom_check(npc_henna_class* param_0, cXyz* param_1, s16 param_2) { - // NONMATCHING +static int zoom_check(npc_henna_class* i_this, cXyz* target, s16 tolerance) { + // unused assignments are needed for debug match + fopAc_ac_c* unusedActor = &i_this->actor; + fopAc_ac_c* unusedPlayer = (fopAc_ac_c*)dComIfGp_getPlayer(0); + camera_class* unusedCamera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); + + camera_class* camera = (camera_class*)dComIfGp_getCamera(0); + + cXyz targetDir; + cXyz lookDir; + + targetDir = *target - camera->lookat.eye; + if (JMAFastSqrt(targetDir.x * targetDir.x + targetDir.z * targetDir.z) < 300.0f + XREG_F(10)) { + lookDir = camera->lookat.center - camera->lookat.eye; + s16 angle = (s16)cM_atan2s(lookDir.x, lookDir.z); + s16 angle2 = (s16)cM_atan2s(targetDir.x, targetDir.z); + angle -= angle2; + if (angle < tolerance && angle > (s16)-tolerance) { + angle = (s16)-cM_atan2s(lookDir.y, + JMAFastSqrt(lookDir.x * lookDir.x + lookDir.z * lookDir.z)); + angle2 = (s16)-cM_atan2s( + targetDir.y, JMAFastSqrt(targetDir.x * targetDir.x + targetDir.z * targetDir.z)); + angle -= angle2; + if (angle < tolerance && angle > (s16)-tolerance) { + return 1; + } + } + } + return 0; } -/* ############################################################################################## */ -/* 8054AA5C-8054AA7C 0000F8 0020+00 0/0 0/0 0/0 .rodata @5533 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_5533[32] = { - 0x00, 0x01, 0xD4, 0xC0, 0x00, 0x01, 0x5F, 0x90, 0x00, 0x01, 0x38, 0x80, 0x00, 0x01, 0x11, 0x70, - 0x00, 0x00, 0xEA, 0x60, 0x00, 0x00, 0xC3, 0x50, 0x00, 0x00, 0x9C, 0x40, 0x00, 0x00, 0x75, 0x30, +static u32 const unkLimitsMs1[8] = { + 120000, 90000, 80000, 70000, 60000, 50000, 40000, 30000, }; -COMPILER_STRIP_GATE(0x8054AA5C, &lit_5533); -#pragma pop -/* 8054AA7C-8054AA80 000118 0004+00 0/0 0/0 0/0 .rodata @5678 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5678 = 0x0002BF20; -COMPILER_STRIP_GATE(0x8054AA7C, &lit_5678); -#pragma pop +static u32 const unkLimitsMs2[1] = {180000}; -/* 8054AA80-8054AA84 00011C 0004+00 0/2 0/0 0/0 .rodata @5770 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5770 = 140.0f; -COMPILER_STRIP_GATE(0x8054AA80, &lit_5770); -#pragma pop +static cXyz zoom_check_pos[20] = { + cXyz(-720.0f, 140.0f, 70.0f), cXyz(100000.0f, 0.0f, 0.0f), cXyz(-500.0f, 176.0f, 595.0f), + cXyz(-376.0f, 135.0f, 595.0f), cXyz(-464.0f, 45.0f, -250.0f), cXyz(-648.0f, 140.0f, 380.0f), + cXyz(90.0f, 312.0f, 545.0f), cXyz(-262.0f, 2.0f, 57.0f), cXyz(-387.0f, 215.0f, -274.0f), + cXyz(10335.0f, 160.0f, 254.0f), cXyz(10025.0f, 240.0f, -208.0f), cXyz(-110.0f, 248.0f, 600.0f), + cXyz(234.0f, 153.0f, 600.0f), cXyz(141.0f, 150.0f, 600.0f), cXyz(34.0f, 149.0f, 600.0f), + cXyz(-64.0f, 149.0f, 600.0f), cXyz(-166.0f, 153.0f, 600.0f), cXyz(-131.0f, 50.0f, 566.0f), + cXyz(323.0f, 130.0f, 233.0f), cXyz(284.0f, 90.0f, 432.0f), +}; -/* 8054AA84-8054AA88 000120 0004+00 0/1 0/0 0/0 .rodata @5771 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5771 = 1500.0f; -COMPILER_STRIP_GATE(0x8054AA84, &lit_5771); -#pragma pop - -/* 8054B00C-8054B018 000094 000C+00 0/1 0/0 0/0 .bss @5112 */ -#pragma push -#pragma force_active on -static u8 lit_5112[12]; -#pragma pop - -/* 8054B018-8054B024 0000A0 000C+00 0/1 0/0 0/0 .bss @5113 */ -#pragma push -#pragma force_active on -static u8 lit_5113[12]; -#pragma pop - -/* 8054B024-8054B030 0000AC 000C+00 0/1 0/0 0/0 .bss @5114 */ -#pragma push -#pragma force_active on -static u8 lit_5114[12]; -#pragma pop - -/* 8054B030-8054B03C 0000B8 000C+00 0/1 0/0 0/0 .bss @5115 */ -#pragma push -#pragma force_active on -static u8 lit_5115[12]; -#pragma pop - -/* 8054B03C-8054B048 0000C4 000C+00 0/1 0/0 0/0 .bss @5116 */ -#pragma push -#pragma force_active on -static u8 lit_5116[12]; -#pragma pop - -/* 8054B048-8054B054 0000D0 000C+00 0/1 0/0 0/0 .bss @5117 */ -#pragma push -#pragma force_active on -static u8 lit_5117[12]; -#pragma pop - -/* 8054B054-8054B060 0000DC 000C+00 0/1 0/0 0/0 .bss @5118 */ -#pragma push -#pragma force_active on -static u8 lit_5118[12]; -#pragma pop - -/* 8054B060-8054B06C 0000E8 000C+00 0/1 0/0 0/0 .bss @5119 */ -#pragma push -#pragma force_active on -static u8 lit_5119[12]; -#pragma pop - -/* 8054B06C-8054B078 0000F4 000C+00 0/1 0/0 0/0 .bss @5120 */ -#pragma push -#pragma force_active on -static u8 lit_5120[12]; -#pragma pop - -/* 8054B078-8054B084 000100 000C+00 0/1 0/0 0/0 .bss @5121 */ -#pragma push -#pragma force_active on -static u8 lit_5121[12]; -#pragma pop - -/* 8054B084-8054B090 00010C 000C+00 0/1 0/0 0/0 .bss @5122 */ -#pragma push -#pragma force_active on -static u8 lit_5122[12]; -#pragma pop - -/* 8054B090-8054B09C 000118 000C+00 0/1 0/0 0/0 .bss @5123 */ -#pragma push -#pragma force_active on -static u8 lit_5123[12]; -#pragma pop - -/* 8054B09C-8054B0A8 000124 000C+00 0/1 0/0 0/0 .bss @5124 */ -#pragma push -#pragma force_active on -static u8 lit_5124[12]; -#pragma pop - -/* 8054B0A8-8054B0B4 000130 000C+00 0/1 0/0 0/0 .bss @5125 */ -#pragma push -#pragma force_active on -static u8 lit_5125[12]; -#pragma pop - -/* 8054B0B4-8054B0C0 00013C 000C+00 0/1 0/0 0/0 .bss @5126 */ -#pragma push -#pragma force_active on -static u8 lit_5126[12]; -#pragma pop - -/* 8054B0C0-8054B0CC 000148 000C+00 0/1 0/0 0/0 .bss @5127 */ -#pragma push -#pragma force_active on -static u8 lit_5127[12]; -#pragma pop - -/* 8054B0CC-8054B0D8 000154 000C+00 0/1 0/0 0/0 .bss @5128 */ -#pragma push -#pragma force_active on -static u8 lit_5128[12]; -#pragma pop - -/* 8054B0D8-8054B0E4 000160 000C+00 0/1 0/0 0/0 .bss @5129 */ -#pragma push -#pragma force_active on -static u8 lit_5129[12]; -#pragma pop - -/* 8054B0E4-8054B0F0 00016C 000C+00 0/1 0/0 0/0 .bss @5130 */ -#pragma push -#pragma force_active on -static u8 lit_5130[12]; -#pragma pop - -/* 8054B0F0-8054B0FC 000178 000C+00 0/1 0/0 0/0 .bss @5131 */ -#pragma push -#pragma force_active on -static u8 lit_5131[12]; -#pragma pop - -/* 8054B0FC-8054B1EC 000184 00F0+00 0/2 0/0 0/0 .bss zoom_check_pos */ -#pragma push -#pragma force_active on -static u8 zoom_check_pos[240]; -#pragma pop +static s32 koro2_reset; /* 80545638-805483F4 002818 2DBC+00 3/1 0/0 0/0 .text demo_camera_shop__FP15npc_henna_class */ -static void demo_camera_shop(npc_henna_class* param_0) { - // NONMATCHING +static void demo_camera_shop(npc_henna_class* i_this) { + static u16 check_size[4] = { + 0x002B, + 0x0032, + 0x0038, + 0x003C, + }; + + static u8 unk_bss_5134; + static f32 old_stick_x; + static s8 unk_bss_5136; + static f32 old_stick_sx; + static s8 unk_bss_5138; + + fopAc_ac_c* player = dComIfGp_getPlayer(0); + camera_class* playerCamera = dComIfGp_getCamera(dComIfGp_getPlayerCameraID(0)); + camera_class* camera = dComIfGp_getCamera(0); + fopAc_ac_c* actor = &i_this->actor; + + fshop_class* fshop; + fshop_class* koro_shop; + fs_koro2_s* koro; + + cXyz unkXyz_78; + cXyz unkXyz_6c; + cXyz unkXyz_60; + cXyz unkXyz_54; + + f32 unkFloat1; + s16 unkShort1; + s32 unkInt1; + s32 unkInt2; + u32 unkIntArr1[8]; + u32 unkIntArr2[1]; + s8 unkBool1 = FALSE; + + if (dComIfGp_event_runCheck() == FALSE && + dComIfGs_isEventBit((u16)dSv_event_flag_c::saveBitLabels[0x1d1]) == FALSE) + { + i_this->field_0x756++; + if (i_this->field_0x756 < 200) { + unkXyz_78.x = 140.0f - player->current.pos.x; + unkXyz_78.y = 0.0f; + unkXyz_78.z = -100.0f - player->current.pos.z; + if (unkXyz_78.x * unkXyz_78.x + unkXyz_78.z * unkXyz_78.z < 1500.0f) { + i_this->field_0x756 = 200; + i_this->field_0x752 = 0x23; + } + } + } + + switch (i_this->field_0x752) { + case 0: { + if (dComIfGp_event_runCheck() == FALSE) { + if (i_this->field_0x7b5 != 0) { + if (i_this->field_0x7b5 == 1 || i_this->field_0x7b5 == 21 || + i_this->field_0x7b5 == 41) + { + i_this->field_0x7b7++; + if (i_this->field_0x7b7 >= 3) { + i_this->field_0x752 = 10; + } else { + i_this->field_0x752 = 30; + } + i_this->field_0x754 = 0; + i_this->field_0x5be = 1; + } + } else { + if (i_this->field_0x7ba != 0) { + i_this->field_0x7ba--; + if (i_this->field_0x7ba == 0) { + i_this->field_0x752 = 80; + i_this->field_0x754 = 0; + } + } else { + for (s32 i = 0; i < 20; i++) { + if (i != 11 || dComIfGs_getEventReg(check_kind[1]) != 0) { + unkXyz_78.x = zoom_check_pos[i].x - player->current.pos.x; + unkXyz_78.z = zoom_check_pos[i].z - player->current.pos.z; + if (JMAFastSqrt(unkXyz_78.x * unkXyz_78.x + unkXyz_78.z * unkXyz_78.z) < + 120.0f) + { + daPy_py_c::setLookPos(&zoom_check_pos[i]); + } + } + } + if (i_this->field_0x7b6 != 0) { + i_this->field_0x7b6--; + } + if (dComIfGp_checkPlayerStatus0(0, 0x2000) != 0) { + for (s32 i = 0; i < 20; i++) { + if (i != 11 || dComIfGs_getEventReg(check_kind[1]) != 0) { + if (i >= 12 && i <= 17 || i == 11) { + unkShort1 = 0x600; + } else { + if (i == 0 || i == 5 || i == 7) { + unkShort1 = 0xc00; + } else { + unkShort1 = 0x800; + } + } + if (zoom_check(i_this, &zoom_check_pos[i], unkShort1) != FALSE) { + i_this->field_0x7b6 += 2; + if (i_this->field_0x7b6 >= 10) { + i_this->field_0x752 = 0x28; + i_this->field_0x7a8 = zoom_check_pos[i]; + i_this->field_0x7b4 = i; + i_this->field_0x5be = 0; + } + } + } + } + } + } + } + } + break; + } + case 1: { + if (i_this->actor.eventInfo.checkCommandDemoAccrpt() == 0) { + fopAcM_orderPotentialEvent(actor, dEvtCnd_CANDEMO_e, -1, 0); + i_this->actor.eventInfo.onCondition(dEvtCnd_CANDEMO_e); + return; + } + playerCamera->mCamera.Stop(); + i_this->field_0x752 = 2; + i_this->field_0x754 = 0; + i_this->field_0x7bc = 65.0f; + playerCamera->mCamera.SetTrimSize(1); + daPy_getPlayerActorClass()->changeOriginalDemo(); + daPy_getPlayerActorClass()->changeDemoMode(0x48, 1, 0, 0); + i_this->field_0x6a4 = 0; + } + case 2: { + cMtx_YrotS(*calc_mtx, player->shape_angle.y); + + unkXyz_78.x = XREG_F(4) + 30.0f; + unkXyz_78.y = XREG_F(5) + 140.0f; + unkXyz_78.z = XREG_F(6) + 70.0f; + MtxPosition(&unkXyz_78, &i_this->field_0x760); + + i_this->field_0x760 += player->current.pos; + + i_this->field_0x76c.x = player->current.pos.x; + i_this->field_0x76c.y = player->current.pos.y + 150.0f + XREG_F(2); + i_this->field_0x76c.z = player->current.pos.z; + + cLib_addCalc2(&i_this->field_0x7bc, TREG_F(0xc) + 55.0f, 0.05f, 0.2f); + if (i_this->field_0x754 == 0x41) { + i_this->field_0x7bc = 50.0f; + + i_this->field_0x76c.set(-36.0f, 155.0f, 407.0f); + i_this->field_0x760.set(-45.0f, 153.0f, 169.0f); + i_this->field_0x784.set(-270.0f, 155.0f, 103.0f); + i_this->field_0x778.set(-45.0f, 153.0f, 169.0f); + + i_this->field_0x790.x = std::fabsf(i_this->field_0x778.x - i_this->field_0x760.x); + i_this->field_0x790.y = std::fabsf(i_this->field_0x778.y - i_this->field_0x760.y); + i_this->field_0x790.z = std::fabsf(i_this->field_0x778.z - i_this->field_0x760.z); + i_this->field_0x79c.x = std::fabsf(i_this->field_0x784.x - i_this->field_0x76c.x); + i_this->field_0x79c.y = std::fabsf(i_this->field_0x784.y - i_this->field_0x76c.y); + i_this->field_0x79c.z = std::fabsf(i_this->field_0x784.z - i_this->field_0x76c.z); + + i_this->field_0x752 = 3; + i_this->field_0x7c0 = 0.0f; + i_this->field_0x754 = 0; + } + break; + } + case 3: { + if (i_this->field_0x754 > 30) { + cam_3d_morf(i_this, 0.05f); + cLib_addCalc2(&i_this->field_0x7c0, BREG_F(7) + 0.01f, 1.0f, BREG_F(8) + 0.001f); + } + if (i_this->field_0x754 >= 160) { + if (i_this->field_0x754 == 160) { + i_this->mMsgFlow.init(actor, 0x321, 0, NULL); + unkXyz_6c.set(-67.0f, 0.0f, 105.0f); + daPy_getPlayerActorClass()->setPlayerPosAndAngle(&unkXyz_6c, 0xffffe1c5, 0); + } + i_this->mMsgFlow.doFlow(actor, NULL, 0); + if (i_this->mMsgFlow.getNowMsgNo() == 0x1f42) { + i_this->field_0x752 = 11; + i_this->field_0x754 = -20; + i_this->field_0x6a4 = 2; + i_this->field_0x618 = i_this->field_0x620; + } + } + break; + } + case 10: { + if (i_this->actor.eventInfo.checkCommandDemoAccrpt() == 0) { + fopAcM_orderPotentialEvent(actor, dEvtCnd_CANDEMO_e, 0xff7f, 0); + i_this->actor.eventInfo.onCondition(dEvtCnd_CANDEMO_e); + return; + } + playerCamera->mCamera.Stop(); + i_this->field_0x752 = 11; + i_this->field_0x754 = 0; + i_this->field_0x7bc = 65.0f; + playerCamera->mCamera.SetTrimSize(1); + daPy_getPlayerActorClass()->changeOriginalDemo(); + daPy_getPlayerActorClass()->changeDemoMode(1, 0, 0, 0); + } + case 11: { + cMtx_YrotS(*calc_mtx, i_this->field_0x620); + unkXyz_78.x = 0.0f; + unkXyz_78.y = 160.0f + XREG_F(0); + unkXyz_78.z = 120.0f + XREG_F(1); + MtxPosition(&unkXyz_78, &i_this->field_0x760); + i_this->field_0x760 += i_this->actor.current.pos; + i_this->field_0x76c.x = i_this->actor.current.pos.x; + i_this->field_0x76c.y = i_this->actor.current.pos.y + 150.0f + XREG_F(2); + i_this->field_0x76c.z = i_this->actor.current.pos.z; + cLib_addCalc2(&i_this->field_0x7bc, 55.0f, 0.5f, 5.0f); + if (i_this->field_0x754 == 0) { + if (i_this->field_0x5be == 1) { + i_this->field_0x5be = 2; + if (i_this->field_0x7b7 >= 4) { + i_this->mMsgFlow.init(actor, 0x354, 0, NULL); + } else { + i_this->mMsgFlow.init(actor, 0x353, 0, NULL); + } + anm_init(i_this, 18, -10.0f, 2, 1.0f); + i_this->field_0x5bc++; + } else { + if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[0x1ce]) == 0) { + dComIfGs_onEventBit(dSv_event_flag_c::saveBitLabels[0x1ce]); + i_this->field_0x752 = 19; + break; + } + if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[0x1d1]) != 0) { + if (i_this->field_0x709 != 0) { + i_this->mMsgFlow.init(actor, 0x327, 0, NULL); + i_this->field_0x6ba = 90; + } else { + i_this->mMsgFlow.init(actor, 0x325, 0, NULL); + } + i_this->field_0x752 = 20; + i_this->field_0x754 = 0; + } else { + if (i_this->field_0x709 != 0) { + i_this->mMsgFlow.init(actor, 0x326, 0, NULL); + i_this->field_0x6ba = 90; + } else if (i_this->field_0x5bc == 0) { + i_this->mMsgFlow.init(actor, 0x323, 0, NULL); + } else { + i_this->mMsgFlow.init(actor, 0x324, 0, NULL); + } + } + } + i_this->field_0x5bc++; + } else if (i_this->field_0x5be == 2 && i_this->field_0x754 == 5) { + i_this->field_0x688 = 2; + } + if (i_this->field_0x754 >= 0 && i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0) { + if (i_this->field_0x688 == 2 && i_this->field_0x7b7 >= 4) { + dStage_changeScene(1, 0.0f, 0, fopAcM_GetRoomNo(actor), 0, -1); + data_80450C9C = 1; + data_80450C9A = 0; + data_80450C9B = 0; + return; + } + i_this->field_0x688 = 0; + if (i_this->field_0x5be == 2) { + i_this->field_0x752 = 100; + anm_init(i_this, 32, -10.0f, 2, 1.0f); + i_this->field_0x5be = 0; + } else { + if (dMsgObject_getSelectCursorPos() == 0) { + i_this->field_0x752 = 12; + } else { + i_this->field_0x752 = 13; + } + i_this->field_0x754 = 0; + } + } + break; + } + case 12: + case 13: { + if (i_this->field_0x754 >= 1) { + if (i_this->field_0x754 == 1) { + if (i_this->field_0x752 == 12) { + if (dComIfGs_getRupee() >= 20) { + if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[0x1d1]) == 0) { + i_this->mMsgFlow.init(actor, 0x32e, 0, NULL); + dComIfGs_onEventBit(dSv_event_flag_c::saveBitLabels[0x1d1]); + dComIfGs_onEventBit(dSv_event_flag_c::saveBitLabels[0x1d0]); + data_80450CA0 = 1; + } else { + i_this->mMsgFlow.init(actor, 0x32f, 0, NULL); + } + dComIfGp_setItemRupeeCount(0xffffffec); + dComIfGs_onEventBit(dSv_event_flag_c::saveBitLabels[0x1cf]); + i_this->field_0x5b6 = 1; + } else { + i_this->mMsgFlow.init(actor, 0x332, 0, NULL); + } + } else { + i_this->mMsgFlow.init(actor, 0x331, 0, NULL); + } + } + if (i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0) { + if (i_this->field_0x5b6 != 0) { + i_this->field_0x6ba = 100; + dStage_changeScene(1, 0.0f, 0, fopAcM_GetRoomNo(actor), 0, -1); + data_80450C9A = 0; + data_80450C9B = 0; + } else { + i_this->field_0x752 = 100; + } + } + } + break; + } + case 19: { + if (i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0) { + i_this->field_0x752 = 100; + i_this->field_0x688 = 0; + } + break; + } + case 20: { + if (i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0) { + i_this->field_0x688 = 0; + if (dMsgObject_getSelectCursorPos() == 0) { + i_this->field_0x752 = 12; + } else { + if (dMsgObject_getSelectCursorPos() == 1) { + i_this->field_0x752 = 21; + } else { + i_this->field_0x752 = 13; + } + } + i_this->field_0x754 = 0; + } + break; + case 21: + if (i_this->field_0x754 >= 1) { + if (i_this->field_0x754 == 1) { + if (dComIfGs_getRupee() >= 100) { + i_this->mMsgFlow.init(actor, 0x330, 0, NULL); + dComIfGp_setItemRupeeCount(-100); + dComIfGs_onEventBit(dSv_event_flag_c::saveBitLabels[0x1cf]); + dComIfGs_onEventBit(dSv_event_flag_c::saveBitLabels[0x1d0]); + data_80450CA0 = 1; + i_this->field_0x5b6 = 1; + } else { + i_this->mMsgFlow.init(actor, 0x332, 0, NULL); + } + } + if (i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0) { + if (i_this->field_0x5b6 != 0) { + i_this->field_0x6ba = 100; + dStage_changeScene(1, 0.0f, 0, fopAcM_GetRoomNo(actor), 0, -1); + data_80450C9A = 0; + data_80450C9B = 0; + } else { + i_this->field_0x752 = 100; + } + } + } + break; + } + case 30: { + if (actor->eventInfo.checkCommandDemoAccrpt() == 0) { + fopAcM_orderPotentialEvent(&i_this->actor, dEvtCnd_CANDEMO_e, 0xffff, 0); + actor->eventInfo.onCondition(dEvtCnd_CANDEMO_e); + return; + } + playerCamera->mCamera.Stop(); + i_this->field_0x752 = 0x1f; + i_this->field_0x754 = 0; + playerCamera->mCamera.SetTrimSize(1); + } + case 31: { + unkBool1 = TRUE; + if (i_this->field_0x754 >= 5) { + if (i_this->field_0x754 == 5) { + if (i_this->field_0x7b5 > 25) { + i_this->mMsgFlow.init(actor, 0x352, 0, NULL); + } else { + if (i_this->field_0x7b5 > 5) { + i_this->mMsgFlow.init(actor, 0x351, 0, NULL); + } else { + i_this->mMsgFlow.init(actor, 0x350, 0, NULL); + } + } + i_this->field_0x7b5 = 0; + i_this->field_0x688 = 2; + } + if (i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0) { + i_this->field_0x752 = 101; + i_this->field_0x688 = 0; + } + } + break; + } + case 35: { + if (i_this->actor.eventInfo.checkCommandDemoAccrpt() == 0) { + fopAcM_orderPotentialEvent(actor, dEvtCnd_CANDEMO_e, 0xffff, 0); + i_this->actor.eventInfo.onCondition(dEvtCnd_CANDEMO_e); + return; + } + playerCamera->mCamera.Stop(); + i_this->field_0x752 = 36; + i_this->field_0x754 = 0; + playerCamera->mCamera.SetTrimSize(1); + } + case 36: { + unkBool1 = TRUE; + if (i_this->field_0x754 >= 5) { + if (i_this->field_0x754 == 5) { + i_this->mMsgFlow.init(actor, 0x322, 0, NULL); + } + if (i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0) { + i_this->field_0x752 = 0x65; + } + } + break; + } + case 40: { + if (actor->eventInfo.checkCommandDemoAccrpt() == 0) { + fopAcM_orderPotentialEvent(actor, dEvtCnd_CANDEMO_e, -1, 0); + actor->eventInfo.onCondition(dEvtCnd_CANDEMO_e); + return; + } + playerCamera->mCamera.Stop(); + i_this->field_0x752 = 41; + i_this->field_0x754 = 0; + i_this->field_0x7bc = 50.0f; + playerCamera->mCamera.SetTrimSize(1); + daPy_getPlayerActorClass()->onPlayerNoDraw(); + unkXyz_78 = camera->lookat.center - camera->lookat.eye; + i_this->field_0x758 = cM_atan2s(unkXyz_78.x, unkXyz_78.z); + i_this->field_0x75c = -cM_atan2s( + unkXyz_78.y, JMAFastSqrt(unkXyz_78.x * unkXyz_78.x + unkXyz_78.z * unkXyz_78.z)); + i_this->field_0x7c4 = unkXyz_78.abs(); + } + case 41: { + i_this->field_0x760 = camera->lookat.eye; + cMtx_YrotS(*calc_mtx, i_this->field_0x758); + cMtx_XrotM(*calc_mtx, i_this->field_0x75c); + unkXyz_78.x = 0.0f; + unkXyz_78.y = 0.0f; + unkXyz_78.z = i_this->field_0x7c4; + MtxPosition(&unkXyz_78, &i_this->field_0x76c); + i_this->field_0x76c += i_this->field_0x760; + unkXyz_78 = i_this->field_0x7a8 - camera->lookat.eye; + if (i_this->field_0x7b4 != 8 && i_this->field_0x7b4 != 7) { + cLib_addCalcAngleS2(&i_this->field_0x758, cM_atan2s(unkXyz_78.x, unkXyz_78.z), 8, + 0x800); + cLib_addCalcAngleS2(&i_this->field_0x75c, + -cM_atan2s(unkXyz_78.y, JMAFastSqrt(unkXyz_78.x * unkXyz_78.x + + unkXyz_78.z * unkXyz_78.z)), + 8, 0x800); + } + if (i_this->field_0x7b4 != 8 && i_this->field_0x7b4 != 7 && i_this->field_0x7b4 != 6 && + i_this->field_0x7b4 != 2 && i_this->field_0x7b4 != 4 && i_this->field_0x7b4 != 0) + { + unkFloat1 = (130.0f + BREG_F(8)) - unkXyz_78.abs(); + unkFloat1 = unkFloat1 * (0.4f + BREG_F(9)) + 50.0f; + if (unkFloat1 > 70.0f) { + unkFloat1 = 70.0f; + } else if (unkFloat1 < 30.0f) { + unkFloat1 = 30.0f; + } + cLib_addCalc2(&i_this->field_0x7bc, unkFloat1, 0.2f, 2.0f); + } else { + unkFloat1 = 200.0f + BREG_F(8) - unkXyz_78.abs(); + unkFloat1 = unkFloat1 * 0.4f + (50.0f + BREG_F(9)); + if (unkFloat1 > 80.0f) { + unkFloat1 = 80.0f; + } else if (unkFloat1 < 50.0f) { + unkFloat1 = 50.0f; + } + cLib_addCalc2(&i_this->field_0x7bc, unkFloat1, 0.2f, 2.0f); + } + if (i_this->field_0x754 >= 15) { + if (i_this->field_0x754 == 15) { + unkInt1 = 0; + switch (i_this->field_0x7b4) { + case 0: + for (s32 i = 0; i <= 3; i++) { + if (dComIfGs_getEventReg(check_kind[i]) >= check_size[i]) { + unkInt1++; + } + } + + if (unkInt1 == 0) { + i_this->mMsgFlow.init(actor, 0x333, 0, NULL); + } else if (unkInt1 >= 4) { + i_this->mMsgFlow.init(actor, 0x336, 0, NULL); + } else { + if (dComIfGs_getEventReg(check_kind[1]) >= 10) { + i_this->mMsgFlow.init(actor, 0x335, 0, NULL); + } else { + i_this->mMsgFlow.init(actor, 0x334, 0, NULL); + } + } + break; + case 2: + if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[0x1d5]) != 0) { + i_this->mMsgFlow.init(actor, 0x338, 0, NULL); + } else { + i_this->mMsgFlow.init(actor, 0x337, 0, NULL); + } + break; + case 3: + i_this->mMsgFlow.init(actor, 0x339, 0, NULL); + break; + case 4: + i_this->mMsgFlow.init(actor, 0x33a, 0, NULL); + break; + case 5: + i_this->mMsgFlow.init(actor, 0x33b, 0, NULL); + data_80450C9D |= 0x80; + break; + case 6: + i_this->mMsgFlow.init(actor, 0x33d, 0, NULL); + break; + case 7: + i_this->mMsgFlow.init(actor, 0x33e, 0, NULL); + break; + case 8: + dScnKy_env_light_c* light = dKy_getEnvlight(); + if (light->raincnt == 0) { + unkInt2 = light->daytime / 15.0f; + if (unkInt2 < 8 || unkInt2 > 16) { + i_this->mMsgFlow.init(actor, 0x371, 0, NULL); + } else { + i_this->mMsgFlow.init(actor, 0x346, 0, NULL); + } + } else { + i_this->mMsgFlow.init(actor, 0x347, 0, NULL); + } + break; + case 0xb: + i_this->mMsgFlow.init(actor, 0x35f, 0, NULL); + break; + case 0xc: + i_this->mMsgFlow.init(actor, 0x344, 0, NULL); + break; + case 0xd: + i_this->mMsgFlow.init(actor, 0x342, 0, NULL); + break; + case 0xe: + i_this->mMsgFlow.init(actor, 0x343, 0, NULL); + break; + case 0xf: + i_this->mMsgFlow.init(actor, 0x341, 0, NULL); + break; + case 0x10: + i_this->mMsgFlow.init(actor, 0x340, 0, NULL); + break; + case 0x11: + i_this->mMsgFlow.init(actor, 0x33f, 0, NULL); + break; + case 0x12: + i_this->mMsgFlow.init(actor, 0x33c, 0, NULL); + break; + case 0x13: + if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[0x335]) != 0) { + i_this->mMsgFlow.init(actor, 0x366, 0, NULL); + } else { + dComIfGp_event_offHindFlag(0x80); + dComIfGp_setMessageCountNumber( + (s16)((s16)((lbl_82_bss_91 & 7) + (lbl_82_bss_91 >> 3) * 10) + 11)); + if (lbl_82_bss_91 == 0) { + i_this->mMsgFlow.init(actor, 0x348, 0, NULL); + } else if (lbl_82_bss_91 == 0x3f) { + i_this->mMsgFlow.init(actor, 0x370, 0, NULL); + } else { + i_this->mMsgFlow.init(actor, 0x34b, 0, NULL); + } + } + } + } + if (i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0) { + if (i_this->field_0x7b4 == 19) { + if (dMsgObject_getSelectCursorPos() == 0) { + if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[0x335]) != 0) { + i_this->field_0x752 = 0x4d; + i_this->field_0x754 = 0; + mDoGph_gInf_c::fadeOut(0.1f, g_blackColor); + koro2_reset = 0; + } else { + if (dComIfGs_getRupee() >= 5) { + i_this->field_0x752 = 0x46; + i_this->field_0x754 = 0; + dComIfGp_setItemRupeeCount(-5); + mDoGph_gInf_c::fadeOut(0.1f, g_blackColor); + koro2_reset = 0; + } else { + i_this->field_0x754 = 0; + i_this->field_0x752 = 0x2a; + } + } + } else { + i_this->field_0x754 = 0; + i_this->field_0x752 = 0x2b; + } + } else { + i_this->field_0x752 = 0x65; + daPy_getPlayerActorClass()->offPlayerNoDraw(); + i_this->field_0x5bc++; + if (i_this->field_0x7b4 == 16) { + i_this->field_0x6a4 = 10; + i_this->field_0x708 = 1; + } + } + } + } + break; + } + case 42: { + if (i_this->field_0x754 == 1) { + i_this->mMsgFlow.init(actor, 0x349, 0, NULL); + } + if (i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0) { + i_this->field_0x752 = 0x4b; + i_this->field_0x5bc++; + } + break; + } + case 43: { + if (i_this->field_0x754 == 1) { + i_this->mMsgFlow.init(actor, 0x34a, 0, NULL); + i_this->field_0x752 = 42; + } + break; + } + case 50: { + if (i_this->actor.eventInfo.checkCommandDemoAccrpt() == 0) { + fopAcM_orderPotentialEvent(actor, dEvtCnd_CANDEMO_e, 0xffff, 0); + i_this->actor.eventInfo.onCondition(dEvtCnd_CANDEMO_e); + dComIfGp_event_reset(); + return; + } + + playerCamera->mCamera.Stop(); + + i_this->field_0x752 = 0x33; + i_this->field_0x754 = 0; + i_this->field_0x7bc = 65.0f; + + playerCamera->mCamera.SetTrimSize(1); + + daPy_getPlayerActorClass()->changeOriginalDemo(); + daPy_getPlayerActorClass()->changeDemoMode(1, 0, 0, 0); + + i_this->field_0x7bc = 55.0f; + + i_this->field_0x76c.set(-440.0f, 130.0f, 380.0f); + i_this->field_0x760.set(-263.0f, 142.0f, 162.0f); + i_this->field_0x784.set(-538.0f, 130.0f, 116.0f); + i_this->field_0x778.set(-263.0f, 142.0f, 162.0f); + + i_this->field_0x790.x = std::fabsf(i_this->field_0x778.x - i_this->field_0x760.x); + i_this->field_0x790.y = std::fabsf(i_this->field_0x778.y - i_this->field_0x760.y); + i_this->field_0x790.z = std::fabsf(i_this->field_0x778.z - i_this->field_0x760.z); + i_this->field_0x79c.x = std::fabsf(i_this->field_0x784.x - i_this->field_0x76c.x); + i_this->field_0x79c.y = std::fabsf(i_this->field_0x784.y - i_this->field_0x76c.y); + i_this->field_0x79c.z = std::fabsf(i_this->field_0x784.z - i_this->field_0x76c.z); + } + case 51: { + if (i_this->field_0x754 >= 15) { + if (i_this->field_0x754 == 15) { + if (data_80450C9A == 0) { + i_this->mMsgFlow.init(actor, 0x328, 0, NULL); + } else if (data_80450C9B == 2) { + i_this->mMsgFlow.init(actor, 0x329, 0, NULL); + } else if (data_80450C9B == 3) { + i_this->mMsgFlow.init(actor, 0x32a, 0, NULL); + } else if (data_80450C9B == 4) { + i_this->mMsgFlow.init(actor, 0x32b, 0, NULL); + } else if (data_80450C9B == 1) { + i_this->mMsgFlow.init(actor, 0x32d, 0, NULL); + } else { + i_this->mMsgFlow.init(actor, 0x32c, 0, NULL); + } + } + if (data_80450C9B >= 2) { + i_this->mMsgFlow.doFlow(actor, NULL, 0); + if (i_this->field_0x754 > 0x32) { + i_this->field_0x752 = 0x34; + i_this->field_0x754 = 0; + } + } else { + if (i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0) { + i_this->field_0x752 = 100; + } + } + } + break; + } + case 52: { + if (mDoCPd_c::getTrigA(0) != 0 && i_this->field_0x754 < 30) { + i_this->field_0x754 = 30; + } + if (i_this->field_0x754 >= 30) { + cam_3d_morf(i_this, 0.3f); + cLib_addCalc2(&i_this->field_0x7c0, BREG_F(7) + 0.06f, 1.0f, BREG_F(8) + 0.02f); + if (i_this->field_0x754 > 0x32) { + cLib_addCalc2(&i_this->field_0x7bc, TREG_F(0xc) + 40.0f, 0.1f, 1.0f); + } + } + if (i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0 && i_this->field_0x754 > 0x3c) { + daPy_getPlayerActorClass()->setPlayerPosAndAngle(&player->current.pos, 0xffffb01c, 0); + i_this->field_0x752 = 53; + i_this->field_0x754 = 0; + } + break; + } + case 53: { + if (i_this->field_0x754 > 0x1e) { + i_this->field_0x752 = 100; + } + break; + } + case 60: { + if (i_this->actor.eventInfo.checkCommandDemoAccrpt() == 0) { + fopAcM_orderPotentialEvent(actor, dEvtCnd_CANDEMO_e, 0xffff, 0); + i_this->actor.eventInfo.onCondition(dEvtCnd_CANDEMO_e); + return; + } + playerCamera->mCamera.Stop(); + i_this->field_0x752 = 61; + i_this->field_0x754 = 0; + i_this->field_0x7bc = 65.0f; + playerCamera->mCamera.SetTrimSize(1); + daPy_getPlayerActorClass()->changeOriginalDemo(); + daPy_getPlayerActorClass()->changeDemoMode(1, 0, 0, 0); + } + case 61: { + cMtx_YrotS(*calc_mtx, i_this->field_0x620); + + unkXyz_78.x = 0.0f; + unkXyz_78.y = 160.0f + XREG_F(0); + unkXyz_78.z = 120.0f + XREG_F(1); + MtxPosition(&unkXyz_78, &i_this->field_0x760); + + i_this->field_0x760 += i_this->actor.current.pos; + + i_this->field_0x76c.x = actor->current.pos.x; + i_this->field_0x76c.y = actor->current.pos.y + 150.0f + XREG_F(2); + i_this->field_0x76c.z = actor->current.pos.z; + + cLib_addCalc2(&i_this->field_0x7bc, 55.0f, 0.5f, 5.0f); + + if (i_this->field_0x754 == 0) { + i_this->mMsgFlow.init(actor, 0x355, 0, NULL); + anm_init(i_this, 18, -10.0f, 2, 1.0f); + i_this->field_0x688 = 2; + } + if (i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0) { + i_this->field_0x754 = 0; + i_this->field_0x752 = 62; + anm_init(i_this, 32, -10.0f, 2, 1.0f); + } + break; + } + case 62: { + if (i_this->field_0x754 >= 1) { + if (i_this->field_0x754 == 1) { + i_this->mMsgFlow.init(actor, 0x356, 0, NULL); + } + + if (i_this->field_0x754 == 5) { + i_this->field_0x688 = 2; + } + + if (i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0) { + i_this->field_0x688 = 0; + i_this->field_0x752 = 100; + } + } + break; + } + case 70: { + if (i_this->field_0x754 == 10) { + fshop = (fshop_class*)fpcM_Search(s_shop_sub, i_this); + if (fshop != NULL) { + fshop->field_0x4010 = 1; + } + + unkXyz_6c.set(171.0f, 0.0f, 432.0f); + daPy_getPlayerActorClass()->setPlayerPosAndAngle(&unkXyz_6c, 0x4000, 0); + + i_this->field_0x7bc = 20.0f; + + playerCamera->mCamera.SetTrimSize(1); + } + if (i_this->field_0x754 == 0xb) { + fshop = (fshop_class*)fpcM_Search(s_shop_sub, i_this); + + i_this->field_0x76c = fshop->field_0x4014; + i_this->field_0x76c.x += WREG_F(0); + i_this->field_0x76c.y += WREG_F(1); + i_this->field_0x76c.z += WREG_F(2); + + i_this->field_0x760 = fshop->field_0x4014; + i_this->field_0x760.x += -900.0f + WREG_F(3); + i_this->field_0x760.y += 1300.0f + WREG_F(4); + i_this->field_0x760.z += WREG_F(5); + } + if (i_this->field_0x754 == 0x12) { + koro_shop = (fshop_class*)fpcM_Search(s_koro2ball_sub, i_this); + if (koro_shop != NULL) { + koro_shop->field_0x0572 = 1; + } + } + if (i_this->field_0x754 == 0x14) { + mDoGph_gInf_c::fadeIn(0.1f, g_blackColor); + + i_this->mMsgFlow.init(actor, 0x34c, 0, NULL); + + i_this->field_0x752 = 71; + i_this->field_0x754 = 0; + i_this->field_0x756 = 200; + } + break; + } + case 71: { + i_this->field_0x7b9 = 0; + if (i_this->field_0x754 >= 2) { + if (i_this->field_0x754 == 2) { + __memcpy(unkIntArr1, unkLimitsMs1, sizeof(unkLimitsMs1)); + dTimer_createTimer(6, unkIntArr1[lbl_82_bss_91 >> 3], 1, 0, 210.0f, 410.0f, 32.0f, + 419.0f); + } + + dTimer_c* timer = dComIfG_getTimerPtr(); + if (timer != 0 && i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0) { + i_this->field_0x752 = 0x48; + + dComIfG_TimerStart(6, 0); + + Z2GetAudioMgr()->subBgmStart(Z2BGM_KOROKORO_GAME); + + fshop = (fshop_class*)fpcM_Search(s_shop_sub, i_this); + fshop->field_0x4062 = 0; + fshop->field_0x4060 = 0; + + koro_shop = (fshop_class*)fpcM_Search(s_koro2ball_sub, i_this); + if (koro_shop != NULL) { + koro_shop->field_0x0572 = 1; + } + } + } + break; + } + case 72: { + if (i_this->field_0x7b9 == 0) { + fshop = (fshop_class*)fpcM_Search(s_shop_sub, i_this); + if (fshop != NULL && dTimer_isStart() != 0) { + fshop->field_0x4010 = 2; + i_this->field_0x7b9 = 1; + for (s32 i = 0; i < 100; i++) { + koro = &fshop->field_0x4008->mKoro2[i]; + if ((koro->field_0x34 >= 2 && koro->field_0x34 <= 5) || + (koro->field_0x34 >= 8 && koro->field_0x34 <= 11)) + { + fshop->field_0x4008->mKoro2[i].field_0x60 = 1; + } + } + } + } + } + case 73: { + koro_shop = (fshop_class*)fpcM_Search(s_koro2ball_sub, i_this); + unkXyz_54 = koro_shop->current.pos; + fshop = (fshop_class*)fpcM_Search(s_shop_sub, i_this); + cMtx_YrotS(*calc_mtx, fshop->field_0x4060); + unkXyz_78.x = -500.0f; + unkXyz_78.y = 600.0f; + unkXyz_78.z = 0.0f; + MtxPosition(&unkXyz_78, &unkXyz_60); + unkXyz_60 += koro_shop->current.pos; + if (koro2_reset != 0) { + koro2_reset = 0; + i_this->field_0x76c = unkXyz_54; + i_this->field_0x760 = unkXyz_60; + } else { + cLib_addCalc2(&i_this->field_0x76c.x, unkXyz_54.x, 0.1f, 20.0f); + cLib_addCalc2(&i_this->field_0x76c.y, unkXyz_54.y, 0.1f, 20.0f); + cLib_addCalc2(&i_this->field_0x76c.z, unkXyz_54.z, 0.1f, 20.0f); + cLib_addCalc2(&i_this->field_0x760.x, unkXyz_60.x, 0.3f, 70.0f); + cLib_addCalc2(&i_this->field_0x760.y, unkXyz_60.y, 0.3f, 70.0f); + cLib_addCalc2(&i_this->field_0x760.z, unkXyz_60.z, 0.3f, 70.0f); + } + if (i_this->field_0x752 == 0x49) { + if (i_this->field_0x754 == 2) { + fshop = (fshop_class*)fpcM_Search(s_shop_sub, i_this); + if (fshop != NULL) { + fshop->field_0x4010 = 1; + } + dComIfG_TimerDeleteRequest(6); + Z2GetAudioMgr()->subBgmStop(); + } + if (i_this->field_0x754 == 10) { + if (actor->health == 0) { + i_this->mMsgFlow.init(actor, 0x34d, 0, NULL); + } else if (actor->health == 1) { + i_this->mMsgFlow.init(actor, 0x364, 0, NULL); + } else if (actor->health == 2) { + i_this->mMsgFlow.init(actor, 0x360, 0, NULL); + } else { + i_this->mMsgFlow.init(actor, 0x363, 0, NULL); + } + i_this->field_0x752 = 74; + Z2GetAudioMgr()->subBgmStart(Z2BGM_FISHING_BARE); + } + } + break; + } + case 74: { + if (i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0) { + if (dMsgObject_getSelectCursorPos() == 0) { + if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[0x335]) != 0) { + i_this->field_0x754 = 0; + i_this->field_0x752 = 0x4d; + mDoGph_gInf_c::fadeOut(0.1f, g_blackColor); + } else { + if (dComIfGs_getRupee() >= 5) { + dComIfGp_setItemRupeeCount(0xfffffffb); + i_this->field_0x752 = 71; + i_this->field_0x754 = 0; + fshop = (fshop_class*)fpcM_Search(s_shop_sub, i_this); + if (fshop != NULL) { + fshop->field_0x4020.z = 0; + fshop->field_0x4020.x = 0; + } + koro2_reset = 1; + } else { + i_this->field_0x754 = 0; + i_this->field_0x752 = 42; + } + } + } else { + i_this->field_0x754 = 0; + i_this->field_0x752 = 43; + } + } + break; + } + case 75: { + i_this->field_0x752 = 100; + daPy_getPlayerActorClass()->offPlayerNoDraw(); + fshop = (fshop_class*)fpcM_Search(s_shop_sub, i_this); + if (fshop != NULL) { + fshop->field_0x4010 = 0; + fshop->field_0x4020.y = cM_rndFX(2000.0f) + -16384.0f; + } + koro_shop = (fshop_class*)fpcM_Search(s_koro2ball_sub, i_this); + if (koro_shop != NULL) { + koro_shop->field_0x0572 = 0; + } + break; + } + case 76: { + if (i_this->field_0x754 == 2) { + dComIfG_TimerDeleteRequest(6); + fshop = (fshop_class*)fpcM_Search(s_shop_sub, i_this); + if (fshop != NULL) { + fshop->field_0x4010 = 1; + } + Z2GetAudioMgr()->subBgmStop(); + } + if (i_this->field_0x754 == 10) { + if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[0x335]) != 0) { + i_this->mMsgFlow.init(actor, 0x36f, 0, NULL); + } else { + if ((lbl_82_bss_91 & 7) == 0x7) { + if (lbl_82_bss_91 == 0x3f) { + i_this->mMsgFlow.init(actor, 0x365, 0, NULL); + dComIfGs_onEventBit(dSv_event_flag_c::saveBitLabels[0x335]); + dComIfGp_setItemRupeeCount(1000); + } else if ((lbl_82_bss_91 & 0x38) == 0) { + i_this->mMsgFlow.init(actor, 0x34f, 0, NULL); + dComIfGs_onEventBit(dSv_event_flag_c::saveBitLabels[0x1d5]); + } else { + i_this->mMsgFlow.init(actor, 0x34f, 0, NULL); + dComIfGp_setItemRupeeCount(10); + } + } else { + i_this->mMsgFlow.init(actor, 0x34e, 0, NULL); + dComIfGp_setItemRupeeCount(10); + } + if (lbl_82_bss_91 == dComIfGs_getEventReg(0xf63f) && lbl_82_bss_91 < 0x3f) { + dComIfGs_setEventReg(0xf63f, lbl_82_bss_91 + 1); + } + } + Z2GetAudioMgr()->subBgmStart(Z2BGM_FISHING_GET1); + } + if (i_this->field_0x754 >= 10 && i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0) { + i_this->field_0x752 = 75; + dComIfG_TimerDeleteRequest(6); + } + break; + } + case 77: { + if (i_this->field_0x754 == 10) { + fshop = (fshop_class*)fpcM_Search(s_shop_sub, i_this); + if (fshop != NULL) { + fshop->field_0x4010 = 1; + } + unkXyz_6c.set(171.0f, 0.0f, 432.0f); + daPy_getPlayerActorClass()->setPlayerPosAndAngle(&unkXyz_6c, 0x4000, 0); + i_this->field_0x7bc = 20.0f; + playerCamera->mCamera.SetTrimSize(1); + } + if (i_this->field_0x754 == 11) { + fshop = (fshop_class*)fpcM_Search(s_shop_sub, i_this); + + i_this->field_0x76c = fshop->field_0x4014; + i_this->field_0x76c.x += WREG_F(0); + i_this->field_0x76c.y += WREG_F(1); + i_this->field_0x76c.z += WREG_F(2); + + i_this->field_0x760 = fshop->field_0x4014; + i_this->field_0x760.x += -900.0f + WREG_F(3); + i_this->field_0x760.y += 1300.0f + WREG_F(4); + i_this->field_0x760.z += WREG_F(5); + } + + if (i_this->field_0x754 == 0x12) { + koro_shop = (fshop_class*)fpcM_Search(s_koro2ball_sub, i_this); + if (koro_shop != NULL) { + koro_shop->field_0x0572 = 1; + } + } + + if (i_this->field_0x754 == 0x14) { + i_this->field_0x752 = 78; + i_this->field_0x754 = 0; + i_this->field_0x756 = 200; + fshop = (fshop_class*)fpcM_Search(s_shop_sub, i_this); + fshop->field_0x400c = unk_bss_5134; + } + break; + } + case 78: { + if (i_this->field_0x754 == 1) { + mDoGph_gInf_c::fadeIn(0.1f, g_blackColor); + } + + dComIfGp_setDoStatusForce(0x22, 0); + + if (unk_bss_5136 == 0) { + old_stick_x = 0.0f; + unk_bss_5136 = 1; + } + if (unk_bss_5138 == 0) { + old_stick_sx = 0.0f; + unk_bss_5138 = 1; + } + + if ((mDoCPd_c::getStickX3D(0) >= 0.8f && old_stick_x < 0.8f || + mDoCPd_c::getStickX3D(0) <= -0.8f && old_stick_x > -0.8f || + mDoCPd_c::getSubStickX(0) >= 0.8f && old_stick_sx < 0.8f || + mDoCPd_c::getSubStickX(0) <= -0.8f && old_stick_sx > -0.8f) && + i_this->field_0x754 >= 15) + { + if (mDoCPd_c::getStickX3D(0) >= 0.5f || mDoCPd_c::getSubStickX(0) >= 0.5f) { + unk_bss_5134++; + } else { + unk_bss_5134--; + } + unk_bss_5134 &= 7; + mDoAud_seStart(Z2SE_SY_CURSOR_FLOOR, 0, 0, 0); + i_this->mMsgFlow.remove(); + i_this->field_0x754 = 1; + } + + old_stick_x = mDoCPd_c::getStickX3D(0); + old_stick_sx = mDoCPd_c::getSubStickX(0); + + fshop = (fshop_class*)fpcM_Search(s_shop_sub, i_this); + fshop->field_0x400c = unk_bss_5134; + + if (i_this->field_0x754 >= 2) { + if (i_this->field_0x754 == 2) { + i_this->mMsgFlow.init(actor, unk_bss_5134 + 0x367, 0, NULL); + } + if (i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0) { + mDoAud_seStart(Z2SE_SY_ITEM_SET_X, 0, 0, 0); + i_this->field_0x752 = 79; + i_this->field_0x754 = 0; + } + } + + koro_shop = (fshop_class*)fpcM_Search(s_koro2ball_sub, i_this); + if (koro_shop != NULL) { + koro_shop->field_0x0572 = 1; + } + break; + } + case 79: { + i_this->field_0x7b9 = 0; + if (i_this->field_0x754 >= 2) { + if (i_this->field_0x754 == 2) { + i_this->mMsgFlow.init(actor, 0x34c, 0, NULL); + __memcpy(unkIntArr2, unkLimitsMs2, sizeof(unkLimitsMs2)); + dTimer_createTimer(6, unkIntArr2[0], 1, 0, 210.0f, 410.0f, 32.0f, 419.0f); + } + dTimer_c* timer = dComIfG_getTimerPtr(); + if (timer != 0 && i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0) { + i_this->field_0x752 = 0x48; + + dComIfG_TimerStart(6, 0); + + Z2GetAudioMgr()->subBgmStart(Z2BGM_KOROKORO_GAME); + + fshop = (fshop_class*)fpcM_Search(s_shop_sub, i_this); + fshop->field_0x4062 = 0; + fshop->field_0x4060 = 0; + + koro_shop = (fshop_class*)fpcM_Search(s_koro2ball_sub, i_this); + if (koro_shop != NULL) { + koro_shop->field_0x0572 = 1; + } + } + } + break; + } + case 80: { + if (i_this->actor.eventInfo.checkCommandDemoAccrpt() == 0) { + fopAcM_orderPotentialEvent(actor, dEvtCnd_CANDEMO_e, 0xffff, 0); + i_this->actor.eventInfo.onCondition(dEvtCnd_CANDEMO_e); + return; + } + playerCamera->mCamera.Stop(); + i_this->field_0x752 = 81; + i_this->field_0x754 = 0; + playerCamera->mCamera.SetTrimSize(1); + daPy_getPlayerActorClass()->changeOriginalDemo(); + daPy_getPlayerActorClass()->changeDemoMode(1, 0, 0, 0); + i_this->field_0x76c.set(-610.0f, 143.0f, 407.0f); + i_this->field_0x760.set(-880.0f, 146.0f, 502.0f); + i_this->field_0x7bc = 30.0f; + } + case 81: { + cLib_addCalc2(&i_this->field_0x7bc, 25.0f + TREG_F(12), 0.1f, 0.2f); + if (i_this->field_0x754 >= 1) { + if (i_this->field_0x754 == 1) { + i_this->mMsgFlow.init(actor, 0x362, 0, NULL); + } + if (i_this->field_0x754 == 15) { + i_this->field_0x688 = 2; + anm_init(i_this, 0x12, -10.0f, 2, 1.0f); + } + if (i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0) { + i_this->field_0x688 = 0; + i_this->field_0x752 = 100; + anm_init(i_this, 0x20, -10.0f, 2, 1.0f); + } + } + } + } + + if (i_this->field_0x752 >= 100) { + if (i_this->field_0x752 == 100) { + cMtx_YrotS(*calc_mtx, player->shape_angle.y); + unkXyz_78.x = 0.0f; + unkXyz_78.y = 200.0f + JREG_F(1); + unkXyz_78.z = -250.0f + JREG_F(2); + MtxPosition(&unkXyz_78, &i_this->field_0x760); + i_this->field_0x760 += player->current.pos; + i_this->field_0x76c = player->current.pos; + i_this->field_0x76c.y += 120.0f; + playerCamera->mCamera.Reset(i_this->field_0x76c, i_this->field_0x760, + i_this->field_0x7bc, 0); + } + playerCamera->mCamera.Start(); + playerCamera->mCamera.SetTrimSize(0); + dComIfGp_event_reset(); + daPy_getPlayerActorClass()->cancelOriginalDemo(); + i_this->field_0x752 = 0; + i_this->field_0x750 = 0x14; + } + if (i_this->field_0x752 != 0) { + i_this->field_0x754 = i_this->field_0x754 + 1; + if (i_this->field_0x754 > 10000) { + i_this->field_0x754 = 10000; + } + if (!unkBool1) { + playerCamera->mCamera.Set(i_this->field_0x76c, i_this->field_0x760, i_this->field_0x7bc, + 0); + } + } } +static u8 lbl_82_bss_289; + +#ifdef DEBUG +#define ATTN_FLAGS ((u32)0x42) +#define ATTN_DIST_INDEX 6 +#else +#define ATTN_FLAGS ((u32)0xa) +#define ATTN_DIST_INDEX 3 +#endif + /* 805483F4-80548640 0055D4 024C+00 1/1 0/0 0/0 .text message_guide__FP15npc_henna_class */ -static void message_guide(npc_henna_class* param_0) { - // NONMATCHING +static void message_guide(npc_henna_class* i_this) { + fopAc_ac_c* actor = &i_this->actor; + daPy_py_c* unusedPlayer = (daPy_py_c*)dComIfGp_getPlayer(0); + + if (actor->eventInfo.checkCommandTalk()) { + i_this->field_0x5b5 = 2; + } + + if (i_this->field_0x5b5 == 2 && i_this->field_0x5ba != -1) { + fopAcM_OnStatus(actor, 0); + + cLib_onBit(actor->attention_info.flags, ATTN_FLAGS); + actor->attention_info.distances[1] = 2; + actor->attention_info.distances[ATTN_DIST_INDEX] = 2; + + actor->eventInfo.onCondition(dEvtCnd_CANTALK_e); + + if (lrl != NULL && lrl->field_0x13b4 != 0) { + return; + } + + // TODO: fake match to force reuse of pointer + dComIfG_play_c* play = &g_dComIfG_gameInfo.play; + if (play->getEvent().runCheck()) { + if (actor->eventInfo.checkCommandTalk() == 0) { + return; + } + + if (i_this->mIsTalking == 0) { + i_this->mIsTalking = 1; + if (i_this->field_0x7d5 != 0 && + (i_this->field_0x7d6 == 0 || (i_this->field_0x5bc & 0x3) == 0)) + { + i_this->mMsgFlow.init(actor, 0x3c3, 0, NULL); + i_this->field_0x7d5 = 0x0; + i_this->field_0x7d6 = 0x1; + } else if (i_this->field_0x7d4 != 0) { + i_this->field_0x7d4 = 0x0; + i_this->mMsgFlow.init(actor, 0x3cc, 0, NULL); + } else if (i_this->field_0x7cc == 0) { + if (i_this->field_0x5bc < 4) { + i_this->mMsgFlow.init(actor, 0x3cd, 0, NULL); + } else if ((i_this->field_0x5bc & 1) != 0) { + i_this->mMsgFlow.init(actor, 0x3cd, 0, NULL); + } else { + i_this->mMsgFlow.init(actor, 0x3ce, 0, NULL); + } + } else { + i_this->mMsgFlow.init(actor, 0x3ce, 0, NULL); + } + } + + if (i_this->mMsgFlow.doFlow(actor, NULL, 0) != 0) { + play->getEvent().reset(); + i_this->mIsTalking = 0; + } + } else { + i_this->mIsTalking = 0; + } + } else { + fopAcM_OffStatus(actor, 0); + cLib_offBit(actor->attention_info.flags, ATTN_FLAGS); + + if (i_this->field_0x7e1 == 0) { + i_this->mIsTalking = 0; + } + } } /* 80548640-8054868C 005820 004C+00 1/1 0/0 0/0 .text s_boat_sub__FPvPv */ -static void s_boat_sub(void* param_0, void* param_1) { - // NONMATCHING +static void* s_boat_sub(void* param_0, void* param_1) { + if (fopAc_IsActor(param_0)) { + if (fopAcM_GetName(param_0) == PROC_CANOE) { + return param_0; + } + } + return NULL; } -/* ############################################################################################## */ -/* 8054AA88-8054AA8C 000124 0004+00 0/0 0/0 0/0 .rodata @5772 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5772 = 65.0f; -COMPILER_STRIP_GATE(0x8054AA88, &lit_5772); -#pragma pop - -/* 8054AA8C-8054AA90 000128 0004+00 0/1 0/0 0/0 .rodata @5773 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5773 = 70.0f; -COMPILER_STRIP_GATE(0x8054AA8C, &lit_5773); -#pragma pop - -/* 8054AA90-8054AA94 00012C 0004+00 0/0 0/0 0/0 .rodata @5774 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5774 = 1.0f / 20.0f; -COMPILER_STRIP_GATE(0x8054AA90, &lit_5774); -#pragma pop - -/* 8054AA94-8054AA98 000130 0004+00 0/0 0/0 0/0 .rodata @5775 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5775 = 1.0f / 5.0f; -COMPILER_STRIP_GATE(0x8054AA94, &lit_5775); -#pragma pop - -/* 8054AA98-8054AA9C 000134 0004+00 0/3 0/0 0/0 .rodata @5776 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5776 = 50.0f; -COMPILER_STRIP_GATE(0x8054AA98, &lit_5776); -#pragma pop - -/* 8054AA9C-8054AAA0 000138 0004+00 0/0 0/0 0/0 .rodata @5777 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5777 = -36.0f; -COMPILER_STRIP_GATE(0x8054AA9C, &lit_5777); -#pragma pop - -/* 8054AAA0-8054AAA4 00013C 0004+00 0/0 0/0 0/0 .rodata @5778 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5778 = 155.0f; -COMPILER_STRIP_GATE(0x8054AAA0, &lit_5778); -#pragma pop - -/* 8054AAA4-8054AAA8 000140 0004+00 0/0 0/0 0/0 .rodata @5779 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5779 = 407.0f; -COMPILER_STRIP_GATE(0x8054AAA4, &lit_5779); -#pragma pop - -/* 8054AAA8-8054AAAC 000144 0004+00 0/0 0/0 0/0 .rodata @5780 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5780 = -45.0f; -COMPILER_STRIP_GATE(0x8054AAA8, &lit_5780); -#pragma pop - -/* 8054AAAC-8054AAB0 000148 0004+00 0/2 0/0 0/0 .rodata @5781 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5781 = 153.0f; -COMPILER_STRIP_GATE(0x8054AAAC, &lit_5781); -#pragma pop - -/* 8054AAB0-8054AAB4 00014C 0004+00 0/0 0/0 0/0 .rodata @5782 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5782 = 169.0f; -COMPILER_STRIP_GATE(0x8054AAB0, &lit_5782); -#pragma pop - -/* 8054AAB4-8054AAB8 000150 0004+00 0/0 0/0 0/0 .rodata @5783 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5783 = -270.0f; -COMPILER_STRIP_GATE(0x8054AAB4, &lit_5783); -#pragma pop - -/* 8054AAB8-8054AABC 000154 0004+00 0/0 0/0 0/0 .rodata @5784 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5784 = 103.0f; -COMPILER_STRIP_GATE(0x8054AAB8, &lit_5784); -#pragma pop - -/* 8054AABC-8054AAC0 000158 0004+00 0/1 0/0 0/0 .rodata @5785 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5785 = 1.0f / 100.0f; -COMPILER_STRIP_GATE(0x8054AABC, &lit_5785); -#pragma pop - -/* 8054AAC0-8054AAC4 00015C 0004+00 0/0 0/0 0/0 .rodata @5786 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_5786 = 0x3A83126F; -COMPILER_STRIP_GATE(0x8054AAC0, &lit_5786); -#pragma pop - -/* 8054AAC4-8054AAC8 000160 0004+00 0/0 0/0 0/0 .rodata @5787 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5787 = -67.0f; -COMPILER_STRIP_GATE(0x8054AAC4, &lit_5787); -#pragma pop - -/* 8054AAC8-8054AACC 000164 0004+00 0/0 0/0 0/0 .rodata @5788 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5788 = 105.0f; -COMPILER_STRIP_GATE(0x8054AAC8, &lit_5788); -#pragma pop - -/* 8054AACC-8054AAD0 000168 0004+00 0/1 0/0 0/0 .rodata @5789 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5789 = 160.0f; -COMPILER_STRIP_GATE(0x8054AACC, &lit_5789); -#pragma pop - -/* 8054AAD0-8054AAD4 00016C 0004+00 0/0 0/0 0/0 .rodata @5790 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5790 = -10.0f; -COMPILER_STRIP_GATE(0x8054AAD0, &lit_5790); -#pragma pop - -/* 8054AAD4-8054AAD8 000170 0004+00 0/1 0/0 0/0 .rodata @5791 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5791 = 130.0f; -COMPILER_STRIP_GATE(0x8054AAD4, &lit_5791); -#pragma pop - -/* 8054AAD8-8054AADC 000174 0004+00 0/0 0/0 0/0 .rodata @5792 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5792 = 2.0f / 5.0f; -COMPILER_STRIP_GATE(0x8054AAD8, &lit_5792); -#pragma pop - -/* 8054AADC-8054AAE0 000178 0004+00 0/0 0/0 0/0 .rodata @5793 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5793 = 80.0f; -COMPILER_STRIP_GATE(0x8054AADC, &lit_5793); -#pragma pop - -/* 8054AAE0-8054AAE4 00017C 0004+00 0/0 0/0 0/0 .rodata @5794 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5794 = 15.0f; -COMPILER_STRIP_GATE(0x8054AAE0, &lit_5794); -#pragma pop - -/* 8054AAE4-8054AAE8 000180 0004+00 0/0 0/0 0/0 .rodata @5795 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5795 = -440.0f; -COMPILER_STRIP_GATE(0x8054AAE4, &lit_5795); -#pragma pop - -/* 8054AAE8-8054AAEC 000184 0004+00 0/1 0/0 0/0 .rodata @5796 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5796 = 380.0f; -COMPILER_STRIP_GATE(0x8054AAE8, &lit_5796); -#pragma pop - -/* 8054AAEC-8054AAF0 000188 0004+00 0/0 0/0 0/0 .rodata @5797 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5797 = -263.0f; -COMPILER_STRIP_GATE(0x8054AAEC, &lit_5797); -#pragma pop - -/* 8054AAF0-8054AAF4 00018C 0004+00 0/0 0/0 0/0 .rodata @5798 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5798 = 142.0f; -COMPILER_STRIP_GATE(0x8054AAF0, &lit_5798); -#pragma pop - -/* 8054AAF4-8054AAF8 000190 0004+00 0/0 0/0 0/0 .rodata @5799 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5799 = 162.0f; -COMPILER_STRIP_GATE(0x8054AAF4, &lit_5799); -#pragma pop - -/* 8054AAF8-8054AAFC 000194 0004+00 0/0 0/0 0/0 .rodata @5800 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5800 = -538.0f; -COMPILER_STRIP_GATE(0x8054AAF8, &lit_5800); -#pragma pop - -/* 8054AAFC-8054AB00 000198 0004+00 0/0 0/0 0/0 .rodata @5801 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5801 = 116.0f; -COMPILER_STRIP_GATE(0x8054AAFC, &lit_5801); -#pragma pop - -/* 8054AB00-8054AB04 00019C 0004+00 0/1 0/0 0/0 .rodata @5802 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5802 = 3.0f / 10.0f; -COMPILER_STRIP_GATE(0x8054AB00, &lit_5802); -#pragma pop - -/* 8054AB04-8054AB08 0001A0 0004+00 0/0 0/0 0/0 .rodata @5803 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5803 = 3.0f / 50.0f; -COMPILER_STRIP_GATE(0x8054AB04, &lit_5803); -#pragma pop - -/* 8054AB08-8054AB0C 0001A4 0004+00 0/0 0/0 0/0 .rodata @5804 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5804 = 1.0f / 50.0f; -COMPILER_STRIP_GATE(0x8054AB08, &lit_5804); -#pragma pop - -/* 8054AB0C-8054AB10 0001A8 0004+00 0/0 0/0 0/0 .rodata @5805 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5805 = 171.0f; -COMPILER_STRIP_GATE(0x8054AB0C, &lit_5805); -#pragma pop - -/* 8054AB10-8054AB14 0001AC 0004+00 0/1 0/0 0/0 .rodata @5806 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5806 = 432.0f; -COMPILER_STRIP_GATE(0x8054AB10, &lit_5806); -#pragma pop - -/* 8054AB14-8054AB18 0001B0 0004+00 0/0 0/0 0/0 .rodata @5807 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5807 = -900.0f; -COMPILER_STRIP_GATE(0x8054AB14, &lit_5807); -#pragma pop - -/* 8054AB18-8054AB1C 0001B4 0004+00 0/0 0/0 0/0 .rodata @5808 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5808 = 1300.0f; -COMPILER_STRIP_GATE(0x8054AB18, &lit_5808); -#pragma pop - -/* 8054AB1C-8054AB20 0001B8 0004+00 0/1 0/0 0/0 .rodata @5809 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5809 = 210.0f; -COMPILER_STRIP_GATE(0x8054AB1C, &lit_5809); -#pragma pop - -/* 8054AB20-8054AB24 0001BC 0004+00 0/0 0/0 0/0 .rodata @5810 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5810 = 410.0f; -COMPILER_STRIP_GATE(0x8054AB20, &lit_5810); -#pragma pop - -/* 8054AB24-8054AB28 0001C0 0004+00 0/0 0/0 0/0 .rodata @5811 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5811 = 32.0f; -COMPILER_STRIP_GATE(0x8054AB24, &lit_5811); -#pragma pop - -/* 8054AB28-8054AB2C 0001C4 0004+00 0/0 0/0 0/0 .rodata @5812 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5812 = 419.0f; -COMPILER_STRIP_GATE(0x8054AB28, &lit_5812); -#pragma pop - -/* 8054AB2C-8054AB30 0001C8 0004+00 0/1 0/0 0/0 .rodata @5813 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5813 = -500.0f; -COMPILER_STRIP_GATE(0x8054AB2C, &lit_5813); -#pragma pop - -/* 8054AB30-8054AB34 0001CC 0004+00 0/1 0/0 0/0 .rodata @5814 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5814 = 600.0f; -COMPILER_STRIP_GATE(0x8054AB30, &lit_5814); -#pragma pop - -/* 8054AB34-8054AB38 0001D0 0004+00 0/0 0/0 0/0 .rodata @5815 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5815 = -16384.0f; -COMPILER_STRIP_GATE(0x8054AB34, &lit_5815); -#pragma pop - -/* 8054AB38-8054AB3C 0001D4 0004+00 0/0 0/0 0/0 .rodata @5816 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5816 = -4.0f / 5.0f; -COMPILER_STRIP_GATE(0x8054AB38, &lit_5816); -#pragma pop - -/* 8054AB3C-8054AB40 0001D8 0004+00 0/0 0/0 0/0 .rodata @5817 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5817 = -610.0f; -COMPILER_STRIP_GATE(0x8054AB3C, &lit_5817); -#pragma pop - -/* 8054AB40-8054AB44 0001DC 0004+00 0/0 0/0 0/0 .rodata @5818 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5818 = 143.0f; -COMPILER_STRIP_GATE(0x8054AB40, &lit_5818); -#pragma pop - -/* 8054AB44-8054AB48 0001E0 0004+00 0/0 0/0 0/0 .rodata @5819 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5819 = -880.0f; -COMPILER_STRIP_GATE(0x8054AB44, &lit_5819); -#pragma pop - -/* 8054AB48-8054AB4C 0001E4 0004+00 0/0 0/0 0/0 .rodata @5820 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5820 = 146.0f; -COMPILER_STRIP_GATE(0x8054AB48, &lit_5820); -#pragma pop - -/* 8054AB4C-8054AB50 0001E8 0004+00 0/0 0/0 0/0 .rodata @5821 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5821 = 502.0f; -COMPILER_STRIP_GATE(0x8054AB4C, &lit_5821); -#pragma pop - -/* 8054AB50-8054AB54 0001EC 0004+00 0/0 0/0 0/0 .rodata @5822 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5822 = 25.0f; -COMPILER_STRIP_GATE(0x8054AB50, &lit_5822); -#pragma pop - -/* 8054AB54-8054AB58 0001F0 0004+00 0/1 0/0 0/0 .rodata @5823 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_5823 = -250.0f; -COMPILER_STRIP_GATE(0x8054AB54, &lit_5823); -#pragma pop - -/* 8054AB58-8054AB5C 0001F4 0004+00 0/1 0/0 0/0 .rodata @6059 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6059 = -2591.0f; -COMPILER_STRIP_GATE(0x8054AB58, &lit_6059); -#pragma pop - -/* 8054AB5C-8054AB60 0001F8 0004+00 0/1 0/0 0/0 .rodata @6060 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6060 = -6742.0f; -COMPILER_STRIP_GATE(0x8054AB5C, &lit_6060); -#pragma pop - -/* 8054AB60-8054AB64 0001FC 0004+00 0/1 0/0 0/0 .rodata @6061 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6061 = 3500.0f; -COMPILER_STRIP_GATE(0x8054AB60, &lit_6061); -#pragma pop - -/* 8054AB64-8054AB68 000200 0004+00 0/1 0/0 0/0 .rodata @6062 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6062 = 180.0f; -COMPILER_STRIP_GATE(0x8054AB64, &lit_6062); -#pragma pop - -/* 8054AB68-8054AB6C 000204 0004+00 0/1 0/0 0/0 .rodata @6063 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_6063 = 0x3D3851EC; -COMPILER_STRIP_GATE(0x8054AB68, &lit_6063); -#pragma pop - -/* 8054AB6C-8054AB70 000208 0004+00 0/1 0/0 0/0 .rodata @6064 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6064 = 250.0f; -COMPILER_STRIP_GATE(0x8054AB6C, &lit_6064); -#pragma pop - -/* 8054B1EC-8054B1F4 000274 0004+04 0/0 0/0 0/0 .bss koro2_reset */ -#pragma push -#pragma force_active on -static u8 koro2_reset[4 + 4 /* padding */]; -#pragma pop - -/* 8054B1F4-8054B1FC 00027C 0004+04 0/0 0/0 0/0 .bss old_stick_x$5644 */ -#pragma push -#pragma force_active on -static u8 old_stick_x[4 + 4 /* padding */]; -#pragma pop - -/* 8054B1FC-8054B204 -00001 0008+00 1/2 0/0 0/0 .bss None */ -/* 8054B1FC 0004+01 data_8054B1FC old_stick_sx$5647 */ -/* 8054B201 0003+00 data_8054B201 None */ -static u8 struct_8054B1FC[8]; - /* 8054868C-805488B8 00586C 022C+00 1/1 0/0 0/0 .text env_control__FP15npc_henna_class */ -static void env_control(npc_henna_class* param_0) { - // NONMATCHING +static void env_control(npc_henna_class* i_this) { + fopAc_ac_c* player = dComIfGp_getPlayer(0); + fopAc_ac_c* unusedActor = &i_this->actor; + cXyz unkXyz1; + cXyz unkXyz2; + dScnKy_env_light_c* light = dKy_getEnvlight(); + camera_class* unusedCamera = dComIfGp_getCamera(0); + + unkXyz1.x = -2591.0f - player->current.pos.x; + unkXyz1.z = -6742.0f - player->current.pos.z; + unkXyz1.y = JMAFastSqrt(unkXyz1.x * unkXyz1.x + unkXyz1.z * unkXyz1.z); + f32 unkTargetVal; + if (unkXyz1.y < 3500.0f) { + unkTargetVal = (3500.0f - unkXyz1.y) * 0.045f + 180.0f; + if (unkTargetVal > 210.0f) { + unkTargetVal = 210.0f; + } + } else { + unkTargetVal = 180.0f; + } + if (light->raincnt != 0) { + unkTargetVal += light->raincnt * 0.7f; + } + if (unkTargetVal > 250.0f) { + unkTargetVal = 250.0f; + } + + if (lbl_82_bss_289 != 0) { + i_this->field_0x738 = unkTargetVal; + } else { + cLib_addCalc2(&i_this->field_0x738, unkTargetVal, 1.0f, 0.01f); + } + + light->field_0x1300 = i_this->field_0x738; + + u32 counter = (u16)g_Counter.mCounter0; + u16 mask = 0x1fff; + + f32 unkFloat1 = 0.3f; + if (light->fishing_hole_season == 2) { + mask = 0x1fff; + unkFloat1 = 0.6f; + } + + if ((counter & mask) == 0 && cM_rndF(1.0f) < unkFloat1) { + OS_REPORT(" FISHING WETHER: %d\n", g_fishingWeather); + if (cDmr_FishingWeather == 0) { + light->field_0x12cc = 1; + } else if (cDmr_FishingWeather == 1) { + if (light->fishing_hole_season == 2) { + light->field_0x12cc = 3; + } else if (light->fishing_hole_season == 4) { + light->field_0x12cc = 6; + } else { + light->field_0x12cc = 2; + } + } else if (cDmr_FishingWeather == 2 || cDmr_FishingWeather == 3 || cDmr_FishingWeather == 6) { + light->field_0x12cc = 0; + } + cDmr_FishingWeather = light->field_0x12cc; + } } -/* ############################################################################################## */ -/* 8054AB70-8054AB74 00020C 0004+00 0/1 0/0 0/0 .rodata @6419 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_6419 = 0xB8D1B717; -COMPILER_STRIP_GATE(0x8054AB70, &lit_6419); -#pragma pop - -/* 8054AB74-8054AB78 000210 0004+00 0/1 0/0 0/0 .rodata @6420 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_6420 = 0xBD872B02; -COMPILER_STRIP_GATE(0x8054AB74, &lit_6420); -#pragma pop - -/* 8054AB78-8054AB7C 000214 0004+00 0/1 0/0 0/0 .rodata @6421 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_6421 = 0x38D1B717; -COMPILER_STRIP_GATE(0x8054AB78, &lit_6421); -#pragma pop - -/* 8054AB7C-8054AB80 000218 0004+00 0/1 0/0 0/0 .rodata @6422 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_6422 = 0x3D872B02; -COMPILER_STRIP_GATE(0x8054AB7C, &lit_6422); -#pragma pop - -/* 8054AB80-8054AB84 00021C 0004+00 0/1 0/0 0/0 .rodata @6423 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6423 = 9.5f; -COMPILER_STRIP_GATE(0x8054AB80, &lit_6423); -#pragma pop - -/* 8054AB84-8054AB88 000220 0004+00 0/1 0/0 0/0 .rodata @6424 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6424 = 17.5f; -COMPILER_STRIP_GATE(0x8054AB84, &lit_6424); -#pragma pop - -/* 8054AB88-8054AB8C 000224 0004+00 0/1 0/0 0/0 .rodata @6425 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6425 = 4.0f; -COMPILER_STRIP_GATE(0x8054AB88, &lit_6425); -#pragma pop - -/* 8054AB8C-8054AB90 000228 0004+00 0/1 0/0 0/0 .rodata @6426 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6426 = -60.0f; -COMPILER_STRIP_GATE(0x8054AB8C, &lit_6426); -#pragma pop - -/* 8054AB90-8054AB94 00022C 0004+00 0/1 0/0 0/0 .rodata @6427 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6427 = -50.0f; -COMPILER_STRIP_GATE(0x8054AB90, &lit_6427); -#pragma pop - -/* 8054AB94-8054AB98 000230 0004+00 0/1 0/0 0/0 .rodata @6428 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6428 = -460.0f; -COMPILER_STRIP_GATE(0x8054AB94, &lit_6428); -#pragma pop - -/* 8054AB98-8054AB9C 000234 0004+00 0/1 0/0 0/0 .rodata @6429 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6429 = 51.0f; -COMPILER_STRIP_GATE(0x8054AB98, &lit_6429); -#pragma pop - -/* 8054AB9C-8054ABA0 000238 0004+00 0/1 0/0 0/0 .rodata @6430 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6430 = -240.0f; -COMPILER_STRIP_GATE(0x8054AB9C, &lit_6430); -#pragma pop - -/* 8054ABA0-8054ABA4 00023C 0004+00 0/1 0/0 0/0 .rodata @6431 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6431 = -790.0f; -COMPILER_STRIP_GATE(0x8054ABA0, &lit_6431); -#pragma pop - -/* 8054ABA4-8054ABA8 000240 0004+00 0/1 0/0 0/0 .rodata @6432 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6432 = 590.0f; -COMPILER_STRIP_GATE(0x8054ABA4, &lit_6432); -#pragma pop - /* 805488B8-805492A4 005A98 09EC+00 2/1 0/0 0/0 .text daNpc_Henna_Execute__FP15npc_henna_class */ -static void daNpc_Henna_Execute(npc_henna_class* param_0) { - // NONMATCHING +static int daNpc_Henna_Execute(npc_henna_class* i_this) { + fopAc_ac_c* unusedPlayer = dComIfGp_getPlayer(0); + + cXyz unkXyz1; + cXyz unkXyz2; + + env_control(i_this); + if (i_this->field_0x70a != 0) { + i_this->field_0x70a -= 1; + if (i_this->field_0x70b == 0) { + i_this->field_0x694 = 1; + i_this->field_0x693 = 0; + mDoGph_gInf_c::fadeIn(0.0001f, g_blackColor); + if (i_this->field_0x70a == 0) { + mDoGph_gInf_c::fadeIn(0.066f, g_blackColor); + } + return 1; + } + + f32 fadeSpeed; + if (i_this->field_0x70a != 0) { + fadeSpeed = 0.0001f; + } else { + fadeSpeed = 0.066f; + } + mDoGph_gInf_c::fadeIn(fadeSpeed, g_blackColor); + } + + if (i_this->field_0x734 != 0) { + return 1; + } + + if (dComIfGp_checkPlayerStatus0(0, 0x100000) != 0) { + i_this->field_0x7d4 = 100; + } + + if (i_this->field_0x7d4 != 0) { + i_this->field_0x7d4--; + } + + i_this->field_0x692 = 0; + + if (i_this->mBoatId == -1) { + base_process_class* boat = fpcM_Search(s_boat_sub, i_this); + i_this->mBoatId = fopAcM_GetID(boat); + } + + lrl = (dmg_rod_class*)fpcM_Search(s_rod_sub, i_this); + + i_this->field_0x6a0++; + + for (s32 i = 0; i < 10; i++) { + if (i_this->field_0x73c[i] != 0) { + i_this->field_0x73c[i]--; + } + } + + action(i_this); + + J3DModel* model = i_this->mpMorf->getModel(); + if (i_this->field_0x7e1 != 0) { + daCanoe_c* boat = (daCanoe_c*)fopAcM_SearchByID(i_this->mBoatId); + if (boat != NULL) { + MTXCopy(model->getAnmMtx(2), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&i_this->actor.current.pos); + i_this->actor.current.angle.y = boat->shape_angle.y; + MTXCopy(boat->getModelMtx(), mDoMtx_stack_c::get()); + } else { + mDoMtx_stack_c::transS(i_this->actor.current.pos.x, i_this->actor.current.pos.y, + i_this->actor.current.pos.z); + } + } else { + mDoMtx_stack_c::transS(i_this->actor.current.pos.x, + i_this->actor.current.pos.y + i_this->field_0x72c, + i_this->actor.current.pos.z); + mDoMtx_stack_c::YrotM((s16)i_this->actor.shape_angle.y); + mDoMtx_stack_c::transM(0.0f, i_this->field_0x72c, i_this->field_0x730); + } + mDoMtx_stack_c::scaleM(l_HIO.field_0x8, l_HIO.field_0x8, l_HIO.field_0x8); + + model->setBaseTRMtx(mDoMtx_stack_c::get()); + + i_this->mpMorf->play(&i_this->actor.eyePos, 0, 0); + if ((i_this->mAnmResIndex == 9 || i_this->mAnmResIndex == 10) && + (i_this->mpMorf->checkFrame(1.5f) != 0 || i_this->mpMorf->checkFrame(9.5f) != 0 || + i_this->mpMorf->checkFrame(17.5f) != 0)) + { + fopAcM_seStart(&i_this->actor, Z2SE_HENA_CLAP, 0); + } + + if (i_this->field_0x6ba != 0) { + i_this->field_0x6ba--; + i_this->field_0x688 = 1; + if (i_this->field_0x6ba == 0) { + i_this->field_0x688 = 0; + } + } + + if (i_this->field_0x654 != 0) { + i_this->field_0x698 += 1.0f; + if (i_this->field_0x698 > i_this->mpBtkAnms[i_this->field_0x654]->getEndFrame() - 2.0f) { + i_this->field_0x698 = i_this->mpBtkAnms[i_this->field_0x654]->getEndFrame() - 2.0f; + } + } else { + i_this->field_0x698 = 0; + } + + i_this->mpBtkAnms[i_this->field_0x654]->setFrame(i_this->field_0x698); + + if (i_this->field_0x688 != 0) { + i_this->field_0x658 = i_this->field_0x688; + } else { + i_this->field_0x658 = 0; + } + + if (i_this->field_0x658 == 0) { + i_this->mpBtpAnms[0]->setFrame(i_this->field_0x69c); + } else { + i_this->mpBtpAnms[i_this->field_0x658]->setFrame(1.0f); + } + + J3DModelData* modelData = model->getModelData(); + + s32 anmIndexOffset = 0; + if (i_this->field_0x6a6 != 0) { + i_this->field_0x6a6--; + anmIndexOffset = 4; + } + + i_this->mpBckAnms[i_this->field_0x688 + anmIndexOffset]->entryJoint(modelData, 4); + i_this->mpBckAnms[i_this->field_0x688 + anmIndexOffset]->play(); + + if (i_this->field_0x688 == 3) { + if (i_this->mpBckAnms[i_this->field_0x688 + anmIndexOffset]->getFrame() > + i_this->mpBckAnms[i_this->field_0x688 + anmIndexOffset]->getEndFrame() - 2.0f) + { + i_this->mpBckAnms[i_this->field_0x688 + anmIndexOffset]->setFrame( + i_this->mpBckAnms[i_this->field_0x688 + anmIndexOffset]->getEndFrame() - 2.0f); + } + } + + i_this->mpMorf->modelCalc(); + + i_this->field_0x693 = 1; + + if (i_this->field_0x692 != 0) { + MTXCopy(model->getAnmMtx(0x11), mDoMtx_stack_c::get()); + mDoMtx_stack_c::transM(5.0f + VREG_F(0), 12.0f + VREG_F(1), 4.0f + VREG_F(2)); + mDoMtx_stack_c::YrotM(VREG_S(0) - 12500); + mDoMtx_stack_c::XrotM(VREG_S(1) - 20000); + mDoMtx_stack_c::ZrotM(i_this->field_0x690); + } else { + daCanoe_c* boat = (daCanoe_c*)fopAcM_SearchByID(i_this->mBoatId); + if (boat != NULL) { + MTXCopy(boat->getModelMtx(), mDoMtx_stack_c::get()); + mDoMtx_stack_c::YrotM(VREG_S(3) - 17314); + mDoMtx_stack_c::XrotM(VREG_S(4)); + mDoMtx_stack_c::ZrotM(VREG_S(5)); + mDoMtx_stack_c::transM(-60.0f + VREG_F(3), 30.0f + VREG_F(4), 50.0f + VREG_F(5)); + } else { + if (i_this->field_0x5b4 == 1) { + fshop_class* shop = (fshop_class*)fpcM_Search(s_shop_sub, i_this); + if (shop != NULL) { + s32 unkInt1 = shop->field_0x6b34 * cM_ssin(shop->field_0x6b34 * 6500) * + (-50.0f + JREG_F(7)); + mDoMtx_stack_c::transS(-460.0f + AREG_F(0), 51.0f + AREG_F(1), + -240.0f + AREG_F(2)); + mDoMtx_stack_c::YrotM(-17729 + AREG_S(0)); + mDoMtx_stack_c::XrotM(32505 + AREG_S(1)); + mDoMtx_stack_c::ZrotM(unkInt1 + 2000 + AREG_S(2)); + } else { + mDoMtx_stack_c::transS(-790.0f + AREG_F(0), 153.0f + AREG_F(1), + 590.0f + AREG_F(2)); + mDoMtx_stack_c::YrotM(AREG_S(0) - 9000); + mDoMtx_stack_c::XrotM(AREG_S(1) - 14000); + } + } else { + i_this->field_0x693 = 0; + MTXCopy(model->getAnmMtx(0x11), mDoMtx_stack_c::get()); + } + } + } + + i_this->mpModel->setBaseTRMtx(mDoMtx_stack_c::get()); + MTXCopy(model->getAnmMtx(4), mDoMtx_stack_c::get()); + + mDoMtx_stack_c::multVecZero(&i_this->actor.eyePos); + i_this->actor.eyePos.x = i_this->actor.eyePos.x + NREG_F(8); + i_this->actor.attention_info.position = i_this->actor.eyePos; + i_this->actor.attention_info.position.y += 40.0f; + + if (i_this->field_0x5b4 == 1) { + message_shop(i_this); + demo_camera_shop(i_this); + } else { + message_guide(i_this); + demo_camera(i_this); + } + + i_this->field_0x694 = 0; + + if (i_this->field_0x7e1 == 0) { + camera_class* camera = dComIfGp_getCamera(0); + + unkXyz1.x = camera->lookat.center.x - camera->lookat.eye.x; + unkXyz1.z = camera->lookat.center.z - camera->lookat.eye.z; + s16 cameraYaw = cM_atan2s(unkXyz1.x, unkXyz1.z); + + unkXyz1.x = i_this->actor.current.pos.x - camera->lookat.eye.x; + unkXyz1.z = i_this->actor.current.pos.z - camera->lookat.eye.z; + s16 selfYawToLookAt = cM_atan2s(unkXyz1.x, unkXyz1.z); + + s16 unkDiff = selfYawToLookAt - cameraYaw; + if (i_this->field_0x752 == 0 && (unkDiff > 0x4000 || unkDiff < -0x4000) && + JMAFastSqrt(unkXyz1.x * unkXyz1.x + unkXyz1.z * unkXyz1.z) > AREG_F(11) + 500.0f) + { + i_this->field_0x694 = 1; + } + } + + if (lbl_82_bss_90 != 0) { + dScnKy_env_light_c* envLight = dKy_getEnvlight(); + f32 lightDist; + s16 lightAngle; + + GXColor lightColor; + if (envLight->fishing_hole_season == 2) { + lightColor.r = l_HIO.mSeason2ColorR; + lightColor.g = l_HIO.mSeason2ColorG; + lightColor.b = l_HIO.mSeason2ColorB; + lightDist = l_HIO.mSeason2LightDist; + lightAngle = l_HIO.mSeason2LightAngle; + } else if (envLight->fishing_hole_season == 3) { + lightColor.r = l_HIO.mSeason3ColorR; + lightColor.g = l_HIO.mSeason3ColorG; + lightColor.b = l_HIO.mSeason3ColorB; + lightDist = l_HIO.mSeason3LightDist; + lightAngle = l_HIO.mSeason3LightAngle; + } else { + lightColor.r = l_HIO.mSeasonDefColorR; + lightColor.g = l_HIO.mSeasonDefColorG; + lightColor.b = l_HIO.mSeasonDefColorB; + lightDist = l_HIO.mSeasonDefLightDist; + lightAngle = l_HIO.mSeasonDefLightAngle; + } + lightColor.a = -1; + + cMtx_YrotS(*calc_mtx, i_this->actor.shape_angle.y + lightAngle * 0xb6); + + unkXyz1.x = 0.0f; + unkXyz1.y = 200.0f + BREG_F(10); + unkXyz1.z = 500.0f + BREG_F(11); + MtxPosition(&unkXyz1, &unkXyz2); + unkXyz2 += i_this->actor.current.pos; + dKy_BossLight_set(&unkXyz2, &lightColor, lightDist, 0); + } + return 1; } /* 805492A4-805492AC 006484 0008+00 1/0 0/0 0/0 .text daNpc_Henna_IsDelete__FP15npc_henna_class */ @@ -1796,846 +2567,267 @@ static bool daNpc_Henna_IsDelete(npc_henna_class* param_0) { } /* 805492AC-80549300 00648C 0054+00 1/0 0/0 0/0 .text daNpc_Henna_Delete__FP15npc_henna_class */ -static void daNpc_Henna_Delete(npc_henna_class* param_0) { - // NONMATCHING +static int daNpc_Henna_Delete(npc_henna_class* i_this) { + dComIfG_resDelete(&i_this->field_0x5ac, "Henna"); + if (i_this->field_0x7f8 != 0) { + lbl_82_bss_45 = 0; + } + return 1; } -/* ############################################################################################## */ -/* 8054AC70-8054AC70 00030C 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_8054AC76 = "F_SP127"; -#pragma pop - /* 80549300-805496DC 0064E0 03DC+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */ -static void useHeapInit(fopAc_ac_c* param_0) { - // NONMATCHING +static int useHeapInit(fopAc_ac_c* i_this) { + static u32 btk_d[3] = { + 0x29, + 0x2A, + 0x2B, + }; + static u32 btp_d[8] = { + 0x2E, 0x35, 0x32, 0x33, 0x2E, 0x34, 0x31, 0x31, + }; + static u32 facebck_d[8] = { + 0x11, 0x0F, 0x0C, 0x0D, 0x10, 0x0E, 0x0B, 0x0B, + }; + + npc_henna_class* a_this = (npc_henna_class*)i_this; + + s32 resId; + if (strcmp(dComIfGp_getStartStageName(), "F_SP127") == 0) { + resId = 37; + } else { + resId = 38; + } + + a_this->mpMorf = new mDoExt_McaMorf((J3DModelData*)dComIfG_getObjectRes("Henna", resId), NULL, + NULL, NULL, 0, 1.0f, 0, -1, 1, NULL, 0x80000, 0x11020284); + if (a_this->mpMorf == NULL || a_this->mpMorf->getModel() == NULL) { + return 0; + } + + J3DModel* morfModel = a_this->mpMorf->getModel(); + morfModel->setUserArea((s32)i_this); + + for (u16 i = 0; i < morfModel->getModelData()->getJointNum(); i++) { + morfModel->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBack); + } + + for (s32 i = 0; i < 3; i++) { + a_this->mpBtkAnms[i] = new mDoExt_btkAnm(); + if (a_this->mpBtkAnms[i] == NULL) { + return 0; + } + J3DAnmTextureSRTKey* srtKey = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes("Henna", btk_d[i]); + morfModel = a_this->mpMorf->getModel(); + if (a_this->mpBtkAnms[i]->init(morfModel->getModelData(), srtKey, 1, 0, 1.0f, 0, -1) == 0) { + return 0; + } + } + + for (s32 i = 0; i < 8; i++) { + a_this->mpBtpAnms[i] = new mDoExt_btpAnm(); + if (a_this->mpBtpAnms[i] == NULL) { + return 0; + } + J3DAnmTexPattern* texPattern = (J3DAnmTexPattern*)dComIfG_getObjectRes("Henna", btp_d[i]); + morfModel = a_this->mpMorf->getModel(); + if (a_this->mpBtpAnms[i]->init(morfModel->getModelData(), texPattern, 1, 2, 1.0f, 0, -1) == + 0) + { + return 0; + } + } + + for (s32 i = 0; i < 8; i++) { + a_this->mpBckAnms[i] = new mDoExt_bckAnm(); + if (a_this->mpBckAnms[i] == 0) { + return 0; + } + J3DAnmTransform* anmTransform = + (J3DAnmTransform*)dComIfG_getObjectRes("Henna", facebck_d[i]); + if (a_this->mpBckAnms[i]->init(anmTransform, 1, 2, 1.0f, 0, -1, false) == 0) { + return 0; + } + } + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("Henna", 0x24); + JUT_ASSERT(6547, modelData != 0); + a_this->mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); + if (a_this->mpModel == 0) { + return 0; + } else { + return 1; + } } -/* 805496DC-80549724 0068BC 0048+00 1/0 0/0 0/0 .text __dt__12J3DFrameCtrlFv */ -// J3DFrameCtrl::~J3DFrameCtrl() { -extern "C" void __dt__12J3DFrameCtrlFv() { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 8054ABA8-8054ABAC 000244 0004+00 0/1 0/0 0/0 .rodata @6814 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6814 = -380.0f; -COMPILER_STRIP_GATE(0x8054ABA8, &lit_6814); -#pragma pop - -/* 8054ABAC-8054ABB0 000248 0004+00 0/1 0/0 0/0 .rodata @6815 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6815 = 450.0f; -COMPILER_STRIP_GATE(0x8054ABAC, &lit_6815); -#pragma pop - -/* 8054ABB0-8054ABB4 00024C 0004+00 0/1 0/0 0/0 .rodata @6816 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6816 = 33.0f / 100.0f; -COMPILER_STRIP_GATE(0x8054ABB0, &lit_6816); -#pragma pop - -/* 8054ABB4-8054ABB8 000250 0004+00 0/1 0/0 0/0 .rodata @6817 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6817 = 4400.0f; -COMPILER_STRIP_GATE(0x8054ABB4, &lit_6817); -#pragma pop - -/* 8054ABB8-8054ABBC 000254 0004+00 0/1 0/0 0/0 .rodata @6818 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6818 = 2122.0f; -COMPILER_STRIP_GATE(0x8054ABB8, &lit_6818); -#pragma pop - -/* 8054ABBC-8054ABC0 000258 0004+00 0/1 0/0 0/0 .rodata @6819 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6819 = 33.0f / 50.0f; -COMPILER_STRIP_GATE(0x8054ABBC, &lit_6819); -#pragma pop - -/* 8054ABC0-8054ABC4 00025C 0004+00 0/1 0/0 0/0 .rodata @6820 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6820 = -606.0f; -COMPILER_STRIP_GATE(0x8054ABC0, &lit_6820); -#pragma pop - -/* 8054ABC4-8054ABC8 000260 0004+00 0/1 0/0 0/0 .rodata @6821 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6821 = 5210.0f; -COMPILER_STRIP_GATE(0x8054ABC4, &lit_6821); -#pragma pop - -/* 8054ABC8-8054ABCC 000264 0004+00 0/1 0/0 0/0 .rodata @6822 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6822 = 2249.0f; -COMPILER_STRIP_GATE(0x8054ABC8, &lit_6822); -#pragma pop - -/* 8054ABCC-8054ABD0 000268 0004+00 0/1 0/0 0/0 .rodata @6823 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6823 = -2218.0f; -COMPILER_STRIP_GATE(0x8054ABCC, &lit_6823); -#pragma pop - -/* 8054ABD0-8054ABD4 00026C 0004+00 0/2 0/0 0/0 .rodata @6824 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6824 = 45.0f; -COMPILER_STRIP_GATE(0x8054ABD0, &lit_6824); -#pragma pop - -/* 8054ABD4-8054ABD8 000270 0004+00 0/1 0/0 0/0 .rodata @6825 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6825 = 8000.0f; -COMPILER_STRIP_GATE(0x8054ABD4, &lit_6825); -#pragma pop - -/* 8054ABD8-8054ABDC 000274 0004+00 0/1 0/0 0/0 .rodata @6826 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6826 = -1500.0f; -COMPILER_STRIP_GATE(0x8054ABD8, &lit_6826); -#pragma pop - -/* 8054ABDC-8054ABE0 000278 0004+00 0/1 0/0 0/0 .rodata @6827 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6827 = 3000.0f; -COMPILER_STRIP_GATE(0x8054ABDC, &lit_6827); -#pragma pop - -/* 8054ABE0-8054ABE4 00027C 0004+00 0/1 0/0 0/0 .rodata @6828 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6828 = 65536.0f; -COMPILER_STRIP_GATE(0x8054ABE0, &lit_6828); -#pragma pop - -/* 8054ABE4-8054ABE8 000280 0004+00 0/1 0/0 0/0 .rodata @6829 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6829 = -160.0f; -COMPILER_STRIP_GATE(0x8054ABE4, &lit_6829); -#pragma pop - -/* 8054ABE8-8054ABEC 000284 0004+00 0/1 0/0 0/0 .rodata @6830 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_6830 = 2300.0f; -COMPILER_STRIP_GATE(0x8054ABE8, &lit_6830); -#pragma pop - -/* 8054AC70-8054AC70 00030C 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_8054AC7E = "T_MUKAO"; -#pragma pop - /* 80549724-80549E40 006904 071C+00 1/0 0/0 0/0 .text daNpc_Henna_Create__FP10fopAc_ac_c */ -static void daNpc_Henna_Create(fopAc_ac_c* param_0) { - // NONMATCHING +static int daNpc_Henna_Create(fopAc_ac_c* i_this) { + fopAcM_SetupActor(i_this, npc_henna_class); + npc_henna_class* a_this = (npc_henna_class*)i_this; + + cPhs__Step loadResult = (cPhs__Step)dComIfG_resLoad(&a_this->field_0x5ac, "Henna"); + if (loadResult == cPhs_COMPLEATE_e) { + OS_REPORT("NPC_HENNA PARAM %x\n", fopAcM_GetParam(i_this)); + a_this->field_0x5b4 = fopAcM_GetParam(i_this); + OS_REPORT("NPC_HENNA//////////////NPC_HENNA SET 1 !!\n"); + if (!fopAcM_entrySolidHeap(i_this, useHeapInit, 0x4500)) { + OS_REPORT("//////////////NPC_HENNA SET NON !!\n"); + return 5; + } + OS_REPORT("//////////////NPC_HENNA SET 2 !!\n"); + + if (lbl_82_bss_45 == 0) { + a_this->field_0x7f8 = 1; + lbl_82_bss_45 = 1; + // "Henna" + l_HIO.field_0x4 = mDoHIO_CREATE_CHILD("ヘナさま", &l_HIO); + } + i_this->attention_info.flags = ATTN_FLAGS; + a_this->field_0x6a2 = 0; + fopAcM_SetMtx(i_this, a_this->mpMorf->getModel()->getBaseTRMtx()); + lbl_82_bss_90 = 0; + if (a_this->field_0x5b4 == 1) { + a_this->field_0x70c = 1; + a_this->field_0x6a2 = 0x32; + a_this->field_0x73c[5] = cM_rndF(1000.0f) + 1000.0f; + i_this->current.pos.set(-380.0f + TREG_F(10), 0.0f, 450.0f + TREG_F(10)); + i_this->old = i_this->current; + s16 newAngle = 0x6000; + if (data_80450C9C != 0) { + anm_init(a_this, 0x20, 0.0f, 2, 1.0f); + a_this->field_0x6a4 = 5; + } else { + anm_init(a_this, 0x1a, 1.0f, 2, 1.0f); + a_this->field_0x6a4 = 4; + if (data_80450C99 != 0) { + data_80450C99 = 0; + a_this->field_0x752 = 0x32; + newAngle = -0x8000; + a_this->field_0x70a = 10; + a_this->field_0x70b = 2; + if (data_80450CA0 != 0) { + anm_init(a_this, 0x20, 10.0f, 2, 1.0f); + a_this->field_0x6a4 = 5; + data_80450CA0 = 0; + } else { + a_this->field_0x6a0 = 0x46; + } + } + } + dComIfGs_offEventBit((u16)dSv_event_flag_c::saveBitLabels[0x1cf]); + dComIfGs_offEventBit((u16)dSv_event_flag_c::saveBitLabels[0x1d0]); + a_this->field_0x618 = i_this->shape_angle.y = i_this->current.angle.y = newAngle; + lbl_82_bss_91 = dComIfGs_getEventReg(0xf63f); + daNpc_Henna_Execute(a_this); + fopAcM_create(PROC_FSHOP, -1, &i_this->current.pos, fopAcM_GetRoomNo(i_this), NULL, + NULL, -1); + return loadResult; + } else { + dScnKy_env_light_c* light = dKy_getEnvlight(); + if (strcmp(dComIfGp_getStartStageName(), "F_SP127") == 0) { + a_this->field_0x6a2 = 0x3c; + a_this->field_0x752 = 100; + lbl_82_bss_90 = 1; + cXyz npcDfPos; + if (light->fishing_hole_season == 3) { + fopAc_ac_c* player = dComIfGp_getPlayer(0); + npcDfPos.set(player->current.pos.x, player->current.pos.y + 700.0f, + player->current.pos.z); + fopAcM_create(PROC_NPC_DF, WREG_S(3) - 0xf4, &npcDfPos, + fopAcM_GetRoomNo(i_this), NULL, NULL, -1); + } + f32 unkFloat1 = cM_rndF(1.0f); + if (unkFloat1 < 0.33f) { + npcDfPos.set(4400.0f, 0.0f, 2122.0f); + } else if (unkFloat1 < 0.66f) { + npcDfPos.set(-606.0f, 0.0f, 5210.0f); + } else { + npcDfPos.set(2249.0f, 50.0f, -2218.0f); + } + fopAcM_create(PROC_NPC_DU, 0xffffff00, &npcDfPos, fopAcM_GetRoomNo(i_this), NULL, + NULL, -1); + npcDfPos.x -= 300.0f; + npcDfPos.z += 100.0f; + fopAcM_create(PROC_NPC_DU, 0xffffff01, &npcDfPos, fopAcM_GetRoomNo(i_this), NULL, + NULL, -1); + for (s32 i = 0; i < 5; i++) { + npcDfPos.set(0.0f, 45.0f, 8000.0f); + fopAcM_create(PROC_BD, 0xffffffff, &npcDfPos, fopAcM_GetRoomNo(i_this), NULL, + NULL, -1); + } + npcDfPos.set(-1500.0f, 3000.0f + nREG_F(7), 3000.0f); + fopAcM_create(PROC_NPC_TK, 0xffffffff, &npcDfPos, fopAcM_GetRoomNo(i_this), NULL, + NULL, -1); + data_80450C99 = 0; + if (!dComIfGs_isEventBit((u16)dSv_event_flag_c::saveBitLabels[0x1cf])) { + a_this->field_0x70a = 4; + a_this->field_0x734 = 1; + } else { + a_this->field_0x70a = 20; + a_this->field_0x70b = 1; + } + } + if (fopAcM_GetRoomNo(i_this) == 4 && + strcmp(dComIfGp_getStartStageName(), "T_MUKAO") == 0) + { + cXyz unkXyz1; + cXyz unkXyz2; + csXyz unkSxyz1(0.0f, 0.0f, 0.0f); + s32 createParams; + for (s32 i = 0; i < 50; i++) { + createParams = (s32)(cM_rndFX(5.0f) + 30.0f) << 8 | 0x5; + mDoMtx_YrotS(*calc_mtx, cM_rndF(65536.0f)); + unkXyz2.x = 0.0f; + unkXyz2.y = cM_rndFX(50.0f) + -160.0f; + unkXyz2.z = cM_rndF(2300.0f); + MtxPosition(&unkXyz2, &unkXyz1); + unkSxyz1.y = cM_rndF(65536.0f); + fopAcM_create(PROC_MG_FISH, createParams, &unkXyz1, fopAcM_GetRoomNo(i_this), + &unkSxyz1, NULL, -1); + } + fopAcM_create(PROC_NPC_NE, 0xffffff01, &i_this->home.pos, fopAcM_GetRoomNo(i_this), + NULL, NULL, -1); + } + a_this->mBoatId = -1; + csXyz unkXyz1; + if (light->fishing_hole_season != 4 && cDmr_FishingWeather == 6) { + cDmr_FishingWeather = 0; + } else if (light->fishing_hole_season == 4 && + (cDmr_FishingWeather == 2 || cDmr_FishingWeather == 3)) + { + cDmr_FishingWeather = 0; + } + light->field_0x12cc = cDmr_FishingWeather; + lbl_82_bss_289 = 1; + daNpc_Henna_Execute(a_this); + lbl_82_bss_289 = 0; + } + } + return loadResult; } -/* 80549E40-80549E88 007020 0048+00 2/1 0/0 0/0 .text __dt__17daNpc_Henna_HIO_cFv */ -daNpc_Henna_HIO_c::~daNpc_Henna_HIO_c() { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 8054ABEC-8054ABF0 000288 0004+00 0/1 0/0 0/0 .rodata @7004 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7004 = -720.0f; -COMPILER_STRIP_GATE(0x8054ABEC, &lit_7004); -#pragma pop - -/* 8054ABF0-8054ABF4 00028C 0004+00 0/1 0/0 0/0 .rodata @7005 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7005 = 100000.0f; -COMPILER_STRIP_GATE(0x8054ABF0, &lit_7005); -#pragma pop - -/* 8054ABF4-8054ABF8 000290 0004+00 0/1 0/0 0/0 .rodata @7006 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7006 = 176.0f; -COMPILER_STRIP_GATE(0x8054ABF4, &lit_7006); -#pragma pop - -/* 8054ABF8-8054ABFC 000294 0004+00 0/1 0/0 0/0 .rodata @7007 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7007 = 595.0f; -COMPILER_STRIP_GATE(0x8054ABF8, &lit_7007); -#pragma pop - -/* 8054ABFC-8054AC00 000298 0004+00 0/1 0/0 0/0 .rodata @7008 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7008 = -376.0f; -COMPILER_STRIP_GATE(0x8054ABFC, &lit_7008); -#pragma pop - -/* 8054AC00-8054AC04 00029C 0004+00 0/1 0/0 0/0 .rodata @7009 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7009 = 135.0f; -COMPILER_STRIP_GATE(0x8054AC00, &lit_7009); -#pragma pop - -/* 8054AC04-8054AC08 0002A0 0004+00 0/1 0/0 0/0 .rodata @7010 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7010 = -464.0f; -COMPILER_STRIP_GATE(0x8054AC04, &lit_7010); -#pragma pop - -/* 8054AC08-8054AC0C 0002A4 0004+00 0/1 0/0 0/0 .rodata @7011 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7011 = -648.0f; -COMPILER_STRIP_GATE(0x8054AC08, &lit_7011); -#pragma pop - -/* 8054AC0C-8054AC10 0002A8 0004+00 0/1 0/0 0/0 .rodata @7012 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7012 = 312.0f; -COMPILER_STRIP_GATE(0x8054AC0C, &lit_7012); -#pragma pop - -/* 8054AC10-8054AC14 0002AC 0004+00 0/1 0/0 0/0 .rodata @7013 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7013 = 545.0f; -COMPILER_STRIP_GATE(0x8054AC10, &lit_7013); -#pragma pop - -/* 8054AC14-8054AC18 0002B0 0004+00 0/1 0/0 0/0 .rodata @7014 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7014 = -262.0f; -COMPILER_STRIP_GATE(0x8054AC14, &lit_7014); -#pragma pop - -/* 8054AC18-8054AC1C 0002B4 0004+00 0/1 0/0 0/0 .rodata @7015 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7015 = 57.0f; -COMPILER_STRIP_GATE(0x8054AC18, &lit_7015); -#pragma pop - -/* 8054AC1C-8054AC20 0002B8 0004+00 0/1 0/0 0/0 .rodata @7016 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7016 = -387.0f; -COMPILER_STRIP_GATE(0x8054AC1C, &lit_7016); -#pragma pop - -/* 8054AC20-8054AC24 0002BC 0004+00 0/1 0/0 0/0 .rodata @7017 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7017 = 215.0f; -COMPILER_STRIP_GATE(0x8054AC20, &lit_7017); -#pragma pop - -/* 8054AC24-8054AC28 0002C0 0004+00 0/1 0/0 0/0 .rodata @7018 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7018 = -274.0f; -COMPILER_STRIP_GATE(0x8054AC24, &lit_7018); -#pragma pop - -/* 8054AC28-8054AC2C 0002C4 0004+00 0/1 0/0 0/0 .rodata @7019 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7019 = 10335.0f; -COMPILER_STRIP_GATE(0x8054AC28, &lit_7019); -#pragma pop - -/* 8054AC2C-8054AC30 0002C8 0004+00 0/1 0/0 0/0 .rodata @7020 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7020 = 254.0f; -COMPILER_STRIP_GATE(0x8054AC2C, &lit_7020); -#pragma pop - -/* 8054AC30-8054AC34 0002CC 0004+00 0/1 0/0 0/0 .rodata @7021 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7021 = 10025.0f; -COMPILER_STRIP_GATE(0x8054AC30, &lit_7021); -#pragma pop - -/* 8054AC34-8054AC38 0002D0 0004+00 0/1 0/0 0/0 .rodata @7022 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7022 = 240.0f; -COMPILER_STRIP_GATE(0x8054AC34, &lit_7022); -#pragma pop - -/* 8054AC38-8054AC3C 0002D4 0004+00 0/1 0/0 0/0 .rodata @7023 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7023 = -208.0f; -COMPILER_STRIP_GATE(0x8054AC38, &lit_7023); -#pragma pop - -/* 8054AC3C-8054AC40 0002D8 0004+00 0/1 0/0 0/0 .rodata @7024 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7024 = -110.0f; -COMPILER_STRIP_GATE(0x8054AC3C, &lit_7024); -#pragma pop - -/* 8054AC40-8054AC44 0002DC 0004+00 0/1 0/0 0/0 .rodata @7025 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7025 = 248.0f; -COMPILER_STRIP_GATE(0x8054AC40, &lit_7025); -#pragma pop - -/* 8054AC44-8054AC48 0002E0 0004+00 0/1 0/0 0/0 .rodata @7026 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7026 = 234.0f; -COMPILER_STRIP_GATE(0x8054AC44, &lit_7026); -#pragma pop - -/* 8054AC48-8054AC4C 0002E4 0004+00 0/1 0/0 0/0 .rodata @7027 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7027 = 141.0f; -COMPILER_STRIP_GATE(0x8054AC48, &lit_7027); -#pragma pop - -/* 8054AC4C-8054AC50 0002E8 0004+00 0/1 0/0 0/0 .rodata @7028 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7028 = 34.0f; -COMPILER_STRIP_GATE(0x8054AC4C, &lit_7028); -#pragma pop - -/* 8054AC50-8054AC54 0002EC 0004+00 0/1 0/0 0/0 .rodata @7029 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7029 = 149.0f; -COMPILER_STRIP_GATE(0x8054AC50, &lit_7029); -#pragma pop - -/* 8054AC54-8054AC58 0002F0 0004+00 0/1 0/0 0/0 .rodata @7030 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7030 = -64.0f; -COMPILER_STRIP_GATE(0x8054AC54, &lit_7030); -#pragma pop - -/* 8054AC58-8054AC5C 0002F4 0004+00 0/1 0/0 0/0 .rodata @7031 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7031 = -166.0f; -COMPILER_STRIP_GATE(0x8054AC58, &lit_7031); -#pragma pop - -/* 8054AC5C-8054AC60 0002F8 0004+00 0/1 0/0 0/0 .rodata @7032 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7032 = -131.0f; -COMPILER_STRIP_GATE(0x8054AC5C, &lit_7032); -#pragma pop - -/* 8054AC60-8054AC64 0002FC 0004+00 0/1 0/0 0/0 .rodata @7033 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7033 = 566.0f; -COMPILER_STRIP_GATE(0x8054AC60, &lit_7033); -#pragma pop - -/* 8054AC64-8054AC68 000300 0004+00 0/1 0/0 0/0 .rodata @7034 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7034 = 323.0f; -COMPILER_STRIP_GATE(0x8054AC64, &lit_7034); -#pragma pop - -/* 8054AC68-8054AC6C 000304 0004+00 0/1 0/0 0/0 .rodata @7035 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7035 = 233.0f; -COMPILER_STRIP_GATE(0x8054AC68, &lit_7035); -#pragma pop - -/* 8054AC6C-8054AC70 000308 0004+00 0/1 0/0 0/0 .rodata @7036 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_7036 = 284.0f; -COMPILER_STRIP_GATE(0x8054AC6C, &lit_7036); -#pragma pop - -/* 80549E88-8054A384 007068 04FC+00 0/1 1/0 0/0 .text __sinit_d_a_npc_henna_cpp */ -void __sinit_d_a_npc_henna_cpp() { - // NONMATCHING -} - -#pragma push -#pragma force_active on -REGISTER_CTORS(0x80549E88, __sinit_d_a_npc_henna_cpp); -#pragma pop - -/* 8054A384-8054A398 007564 0014+00 1/1 0/0 0/0 .text cancelOriginalDemo__9daPy_py_cFv */ -// void daPy_py_c::cancelOriginalDemo() { -extern "C" void cancelOriginalDemo__9daPy_py_cFv() { - // NONMATCHING -} - -/* 8054A398-8054A3B4 007578 001C+00 1/1 0/0 0/0 .text __ct__4cXyzFRC4cXyz */ -// cXyz::cXyz(cXyz const& param_0) { -extern "C" void __ct__4cXyzFRC4cXyz() { - // NONMATCHING -} - -/* 8054A3B4-8054A418 007594 0064+00 1/1 0/0 0/0 .text mDoAud_seStart__FUlPC3VecUlSc */ -// static void mDoAud_seStart(u32 param_0, Vec const* param_1, u32 param_2, s8 param_3) { -extern "C" static asm void mDoAud_seStart__FUlPC3VecUlSc() { - // NONMATCHING -} - -/* 8054A418-8054A430 0075F8 0018+00 1/1 0/0 0/0 .text getSubStickX__8mDoCPd_cFUl */ -// void mDoCPd_c::getSubStickX(u32 param_0) { -extern "C" void getSubStickX__8mDoCPd_cFUl() { - // NONMATCHING -} - -/* 8054A430-8054A444 007610 0014+00 1/1 0/0 0/0 .text getStickX3D__8mDoCPd_cFUl */ -// void mDoCPd_c::getStickX3D(u32 param_0) { -extern "C" void getStickX3D__8mDoCPd_cFUl() { - // NONMATCHING -} - -/* 8054A444-8054A458 007624 0014+00 1/1 0/0 0/0 .text dComIfGp_setDoStatusForce__FUcUc */ -// static void dComIfGp_setDoStatusForce(u8 param_0, u8 param_1) { -extern "C" static asm void dComIfGp_setDoStatusForce__FUcUc() { - // NONMATCHING -} - -/* 8054A458-8054A490 007638 0038+00 1/1 0/0 0/0 .text dComIfGs_setEventReg__FUsUc */ -// static void dComIfGs_setEventReg(u16 param_0, u8 param_1) { -extern "C" static asm void dComIfGs_setEventReg__FUsUc() { - // NONMATCHING -} - -/* 8054A490-8054A4A0 007670 0010+00 1/1 0/0 0/0 .text Z2GetAudioMgr__Fv */ -// static void Z2GetAudioMgr() { -extern "C" static asm void Z2GetAudioMgr__Fv() { - // NONMATCHING -} - -/* 8054A4A0-8054A4CC 007680 002C+00 1/1 0/0 0/0 .text dComIfG_getTimerPtr__Fv */ -// static void dComIfG_getTimerPtr() { -extern "C" static asm void dComIfG_getTimerPtr__Fv() { - // NONMATCHING -} - -/* 8054A4CC-8054A4F0 0076AC 0024+00 1/1 0/0 0/0 .text fadeIn__13mDoGph_gInf_cFfR8_GXColor - */ -// void mDoGph_gInf_c::fadeIn(f32 param_0, _GXColor& param_1) { -extern "C" void fadeIn__13mDoGph_gInf_cFfR8_GXColor() { - // NONMATCHING -} - -/* 8054A4F0-8054A510 0076D0 0020+00 1/1 0/0 0/0 .text fpcM_Search__FPFPvPv_PvPv */ -// static void fpcM_Search(void* (*param_0)(void*, void*), void* param_1) { -extern "C" static asm void fpcM_Search__FPFPvPv_PvPv() { - // NONMATCHING -} - -/* 8054A510-8054A52C 0076F0 001C+00 1/1 0/0 0/0 .text getTrigA__8mDoCPd_cFUl */ -// void mDoCPd_c::getTrigA(u32 param_0) { -extern "C" void getTrigA__8mDoCPd_cFUl() { - // NONMATCHING -} - -/* 8054A52C-8054A558 00770C 002C+00 1/1 0/0 0/0 .text dComIfGp_event_reset__Fv */ -// static void dComIfGp_event_reset() { -extern "C" static asm void dComIfGp_event_reset__Fv() { - // NONMATCHING -} - -/* 8054A558-8054A568 007738 0010+00 1/1 0/0 0/0 .text offPlayerNoDraw__9daPy_py_cFv */ -// void daPy_py_c::offPlayerNoDraw() { -extern "C" void offPlayerNoDraw__9daPy_py_cFv() { - // NONMATCHING -} - -/* 8054A568-8054A578 007748 0010+00 1/1 0/0 0/0 .text dComIfGp_setMessageCountNumber__Fl - */ -// static void dComIfGp_setMessageCountNumber(s32 param_0) { -extern "C" static asm void dComIfGp_setMessageCountNumber__Fl() { - // NONMATCHING -} - -/* 8054A578-8054A590 007758 0018+00 1/1 0/0 0/0 .text dComIfGp_event_offHindFlag__FUs */ -// static void dComIfGp_event_offHindFlag(u16 param_0) { -extern "C" static asm void dComIfGp_event_offHindFlag__FUs() { - // NONMATCHING -} - -/* 8054A590-8054A59C 007770 000C+00 1/1 0/0 0/0 .text dKy_getEnvlight__Fv */ -// static void dKy_getEnvlight() { -extern "C" static asm void dKy_getEnvlight__Fv() { - // NONMATCHING -} - -/* 8054A59C-8054A5BC 00777C 0020+00 1/1 0/0 0/0 .text cMtx_XrotM__FPA4_fs */ -// static void cMtx_XrotM(f32 (*param_0)[4], s16 param_1) { -extern "C" static asm void cMtx_XrotM__FPA4_fs() { - // NONMATCHING -} - -/* 8054A5BC-8054A6D0 00779C 0114+00 1/1 0/0 0/0 .text abs__4cXyzCFv */ -// void cXyz::abs() const { -extern "C" void abs__4cXyzCFv() { - // NONMATCHING -} - -/* 8054A6D0-8054A6E0 0078B0 0010+00 1/1 0/0 0/0 .text onPlayerNoDraw__9daPy_py_cFv */ -// void daPy_py_c::onPlayerNoDraw() { -extern "C" void onPlayerNoDraw__9daPy_py_cFv() { - // NONMATCHING -} - -/* 8054A6E0-8054A6F8 0078C0 0018+00 1/1 0/0 0/0 .text dComIfGp_setItemRupeeCount__Fl */ -// static void dComIfGp_setItemRupeeCount(s32 param_0) { -extern "C" static asm void dComIfGp_setItemRupeeCount__Fl() { - // NONMATCHING -} - -/* 8054A6F8-8054A708 0078D8 0010+00 1/1 0/0 0/0 .text dComIfGs_getRupee__Fv */ -// static void dComIfGs_getRupee() { -extern "C" static asm void dComIfGs_getRupee__Fv() { - // NONMATCHING -} - -/* 8054A708-8054A714 0078E8 000C+00 1/1 0/0 0/0 .text fabsf__3stdFf */ -// void std::fabsf(f32 param_0) { -extern "C" void fabsf__3stdFf() { - // NONMATCHING -} - -/* 8054A714-8054A724 0078F4 0010+00 1/1 0/0 0/0 .text set__4cXyzFfff */ -// void cXyz::set(f32 param_0, f32 param_1, f32 param_2) { -extern "C" void set__4cXyzFfff() { - // NONMATCHING -} - -/* 8054A724-8054A758 007904 0034+00 1/1 0/0 0/0 .text __apl__4cXyzFRC3Vec */ -// void cXyz::operator+=(Vec const& param_0) { -extern "C" void __apl__4cXyzFRC3Vec() { - // NONMATCHING -} - -/* 8054A758-8054A778 007938 0020+00 1/1 0/0 0/0 .text cMtx_YrotS__FPA4_fs */ -// static void cMtx_YrotS(f32 (*param_0)[4], s16 param_1) { -extern "C" static asm void cMtx_YrotS__FPA4_fs() { - // NONMATCHING -} - -/* 8054A778-8054A78C 007958 0014+00 1/1 0/0 0/0 .text changeDemoMode__9daPy_py_cFUliis */ -// void daPy_py_c::changeDemoMode(u32 param_0, int param_1, int param_2, s16 param_3) { -extern "C" void changeDemoMode__9daPy_py_cFUliis() { - // NONMATCHING -} - -/* 8054A78C-8054A7A0 00796C 0014+00 1/1 0/0 0/0 .text changeOriginalDemo__9daPy_py_cFv */ -// void daPy_py_c::changeOriginalDemo() { -extern "C" void changeOriginalDemo__9daPy_py_cFv() { - // NONMATCHING -} - -/* 8054A7A0-8054A7B0 007980 0010+00 1/1 0/0 0/0 .text daPy_getPlayerActorClass__Fv */ -// static void daPy_getPlayerActorClass() { -extern "C" static asm void daPy_getPlayerActorClass__Fv() { - // NONMATCHING -} - -/* 8054A7B0-8054A7C0 007990 0010+00 1/1 0/0 0/0 .text onCondition__11dEvt_info_cFUs */ -// void dEvt_info_c::onCondition(u16 param_0) { -extern "C" void onCondition__11dEvt_info_cFUs() { - // NONMATCHING -} - -/* 8054A7C0-8054A7D4 0079A0 0014+00 1/1 0/0 0/0 .text checkCommandDemoAccrpt__11dEvt_info_cFv */ -// void dEvt_info_c::checkCommandDemoAccrpt() { -extern "C" void checkCommandDemoAccrpt__11dEvt_info_cFv() { - // NONMATCHING -} - -/* 8054A7D4-8054A7F0 0079B4 001C+00 1/1 0/0 0/0 .text __as__4cXyzFRC4cXyz */ -// void cXyz::operator=(cXyz const& param_0) { -extern "C" void __as__4cXyzFRC4cXyz() { - // NONMATCHING -} - -/* 8054A7F0-8054A80C 0079D0 001C+00 1/1 0/0 0/0 .text dComIfGp_checkPlayerStatus0__FiUl - */ -// static void dComIfGp_checkPlayerStatus0(int param_0, u32 param_1) { -extern "C" static asm void dComIfGp_checkPlayerStatus0__FiUl() { - // NONMATCHING -} - -/* 8054A80C-8054A828 0079EC 001C+00 1/1 0/0 0/0 .text JMAFastSqrt__Ff */ -// static void JMAFastSqrt(f32 param_0) { -extern "C" static asm void JMAFastSqrt__Ff() { - // NONMATCHING -} - -/* 8054A828-8054A858 007A08 0030+00 1/1 0/0 0/0 .text dComIfGs_getEventReg__FUs */ -// static void dComIfGs_getEventReg(u16 param_0) { -extern "C" static asm void dComIfGs_getEventReg__FUs() { - // NONMATCHING -} - -/* 8054A858-8054A888 007A38 0030+00 1/1 0/0 0/0 .text dComIfGs_isEventBit__FUs */ -// static void dComIfGs_isEventBit(u16 param_0) { -extern "C" static asm void dComIfGs_isEventBit__FUs() { - // NONMATCHING -} - -/* 8054A888-8054A8A4 007A68 001C+00 1/1 0/0 0/0 .text dComIfGp_event_runCheck__Fv */ -// static void dComIfGp_event_runCheck() { -extern "C" static asm void dComIfGp_event_runCheck__Fv() { - // NONMATCHING -} - -/* 8054A8A4-8054A8A8 007A84 0004+00 1/1 0/0 0/0 .text __ct__4cXyzFv */ -// cXyz::cXyz() { -extern "C" void __ct__4cXyzFv() { - /* empty function */ -} - -/* 8054A8A8-8054A8C0 007A88 0018+00 1/1 0/0 0/0 .text dComIfGp_getCamera__Fi */ -// static void dComIfGp_getCamera(int param_0) { -extern "C" static asm void dComIfGp_getCamera__Fi() { - // NONMATCHING -} - -/* 8054A8C0-8054A8DC 007AA0 001C+00 1/1 0/0 0/0 .text dComIfGp_getPlayerCameraID__Fi */ -// static void dComIfGp_getPlayerCameraID(int param_0) { -extern "C" void dComIfGp_getPlayerCameraID__Fi() { - // NONMATCHING -} - -/* 8054A8DC-8054A8F4 007ABC 0018+00 1/1 0/0 0/0 .text dComIfGp_getPlayer__Fi */ -// static void dComIfGp_getPlayer(int param_0) { -extern "C" void dComIfGp_getPlayer__Fi() { - // NONMATCHING -} - -/* 8054A8F4-8054A914 007AD4 0020+00 1/1 0/0 0/0 .text dMsgObject_getSelectCursorPos__Fv - */ -// static void dMsgObject_getSelectCursorPos() { -extern "C" static asm void dMsgObject_getSelectCursorPos__Fv() { - // NONMATCHING -} - -/* 8054A914-8054A920 007AF4 000C+00 1/1 0/0 0/0 .text fopAcM_GetRoomNo__FPC10fopAc_ac_c - */ -// static void fopAcM_GetRoomNo(fopAc_ac_c const* param_0) { -extern "C" static asm void fopAcM_GetRoomNo__FPC10fopAc_ac_c() { - // NONMATCHING -} - -/* 8054A920-8054A950 007B00 0030+00 1/1 0/0 0/0 .text dComIfGs_onEventBit__FUs */ -// static void dComIfGs_onEventBit(u16 param_0) { -extern "C" static asm void dComIfGs_onEventBit__FUs() { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 8054B204-8054B208 00028C 0004+00 0/0 0/0 0/0 .bss - * sInstance__40JASGlobalInstance<19JASDefaultBankTable> */ -#pragma push -#pragma force_active on -static u8 data_8054B204[4]; -#pragma pop - -/* 8054B208-8054B20C 000290 0004+00 0/0 0/0 0/0 .bss - * sInstance__35JASGlobalInstance<14JASAudioThread> */ -#pragma push -#pragma force_active on -static u8 data_8054B208[4]; -#pragma pop - -/* 8054B20C-8054B210 000294 0004+00 0/0 0/0 0/0 .bss sInstance__27JASGlobalInstance<7Z2SeMgr> */ -#pragma push -#pragma force_active on -static u8 data_8054B20C[4]; -#pragma pop - -/* 8054B210-8054B214 000298 0004+00 0/0 0/0 0/0 .bss sInstance__28JASGlobalInstance<8Z2SeqMgr> */ -#pragma push -#pragma force_active on -static u8 data_8054B210[4]; -#pragma pop - -/* 8054B214-8054B218 00029C 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2SceneMgr> - */ -#pragma push -#pragma force_active on -static u8 data_8054B214[4]; -#pragma pop - -/* 8054B218-8054B21C 0002A0 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2StatusMgr> - */ -#pragma push -#pragma force_active on -static u8 data_8054B218[4]; -#pragma pop - -/* 8054B21C-8054B220 0002A4 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2DebugSys> - */ -#pragma push -#pragma force_active on -static u8 data_8054B21C[4]; -#pragma pop - -/* 8054B220-8054B224 0002A8 0004+00 0/0 0/0 0/0 .bss - * sInstance__36JASGlobalInstance<15JAISoundStarter> */ -#pragma push -#pragma force_active on -static u8 data_8054B220[4]; -#pragma pop - -/* 8054B224-8054B228 0002AC 0004+00 0/0 0/0 0/0 .bss - * sInstance__35JASGlobalInstance<14Z2SoundStarter> */ -#pragma push -#pragma force_active on -static u8 data_8054B224[4]; -#pragma pop - -/* 8054B228-8054B22C 0002B0 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12Z2SpeechMgr2> */ -#pragma push -#pragma force_active on -static u8 data_8054B228[4]; -#pragma pop - -/* 8054B22C-8054B230 0002B4 0004+00 0/0 0/0 0/0 .bss sInstance__28JASGlobalInstance<8JAISeMgr> */ -#pragma push -#pragma force_active on -static u8 data_8054B22C[4]; -#pragma pop - -/* 8054B230-8054B234 0002B8 0004+00 0/0 0/0 0/0 .bss sInstance__29JASGlobalInstance<9JAISeqMgr> */ -#pragma push -#pragma force_active on -static u8 data_8054B230[4]; -#pragma pop - -/* 8054B234-8054B238 0002BC 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12JAIStreamMgr> */ -#pragma push -#pragma force_active on -static u8 data_8054B234[4]; -#pragma pop - -/* 8054B238-8054B23C 0002C0 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2SoundMgr> - */ -#pragma push -#pragma force_active on -static u8 data_8054B238[4]; -#pragma pop - -/* 8054B23C-8054B240 0002C4 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12JAISoundInfo> */ -#pragma push -#pragma force_active on -static u8 data_8054B23C[4]; -#pragma pop - -/* 8054B240-8054B244 0002C8 0004+00 0/0 0/0 0/0 .bss - * sInstance__34JASGlobalInstance<13JAUSoundTable> */ -#pragma push -#pragma force_active on -static u8 data_8054B240[4]; -#pragma pop - -/* 8054B244-8054B248 0002CC 0004+00 0/0 0/0 0/0 .bss - * sInstance__38JASGlobalInstance<17JAUSoundNameTable> */ -#pragma push -#pragma force_active on -static u8 data_8054B244[4]; -#pragma pop - -/* 8054B248-8054B24C 0002D0 0004+00 0/0 0/0 0/0 .bss - * sInstance__33JASGlobalInstance<12JAUSoundInfo> */ -#pragma push -#pragma force_active on -static u8 data_8054B248[4]; -#pragma pop - -/* 8054B24C-8054B250 0002D4 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2SoundInfo> - */ -#pragma push -#pragma force_active on -static u8 data_8054B24C[4]; -#pragma pop - -/* 8054B250-8054B254 0002D8 0004+00 0/0 0/0 0/0 .bss - * sInstance__34JASGlobalInstance<13Z2SoundObjMgr> */ -#pragma push -#pragma force_active on -static u8 data_8054B250[4]; -#pragma pop - -/* 8054B254-8054B258 0002DC 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2Audience> - */ -#pragma push -#pragma force_active on -static u8 data_8054B254[4]; -#pragma pop - -/* 8054B258-8054B25C 0002E0 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2FxLineMgr> - */ -#pragma push -#pragma force_active on -static u8 data_8054B258[4]; -#pragma pop - -/* 8054B25C-8054B260 0002E4 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2EnvSeMgr> - */ -#pragma push -#pragma force_active on -static u8 data_8054B25C[4]; -#pragma pop - -/* 8054B260-8054B264 0002E8 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2SpeechMgr> - */ -#pragma push -#pragma force_active on -static u8 data_8054B260[4]; -#pragma pop - -/* 8054B264-8054B268 0002EC 0004+00 0/0 0/0 0/0 .bss - * sInstance__34JASGlobalInstance<13Z2WolfHowlMgr> */ -#pragma push -#pragma force_active on -static u8 data_8054B264[4]; -#pragma pop - -/* 8054AC70-8054AC70 00030C 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ +/* 8054AF00-8054AF20 -00001 0020+00 1/0 0/0 0/0 .data l_daNpc_Henna_Method */ +static actor_method_class l_daNpc_Henna_Method = { + (process_method_func)daNpc_Henna_Create, (process_method_func)daNpc_Henna_Delete, + (process_method_func)daNpc_Henna_Execute, (process_method_func)daNpc_Henna_IsDelete, + (process_method_func)daNpc_Henna_Draw, +}; + +/* 8054AF20-8054AF50 -00001 0030+00 0/0 0/0 1/0 .data g_profile_NPC_HENNA */ +extern actor_process_profile_definition g_profile_NPC_HENNA = { + fpcLy_CURRENT_e, // mLayerID + 7, // mListID + fpcPi_CURRENT_e, // mListPrio + PROC_NPC_HENNA, // mProcName + &g_fpcLf_Method.base, // sub_method + sizeof(npc_henna_class), // mSize + 0, // mSizeOther + 0, // mParameters + &g_fopAc_Method.base, // sub_method + 342, // mPriority + &l_daNpc_Henna_Method, // sub_method + 0x00044000, // mStatus + fopAc_NPC_e, // mActorType + fopAc_CULLBOX_0_e, // cullType +}; + +AUDIO_INSTANCES diff --git a/src/d/actor/d_a_obj_dmelevator.cpp b/src/d/actor/d_a_obj_dmelevator.cpp index 9c113e0c7e..c9e725052d 100644 --- a/src/d/actor/d_a_obj_dmelevator.cpp +++ b/src/d/actor/d_a_obj_dmelevator.cpp @@ -85,9 +85,9 @@ static int nodeCallBackForSw(J3DJoint* param_0, int param_1) { } /* 80BDDCA0-80BDDD38 000420 0098+00 1/1 0/0 0/0 .text nodeCallBack__FP8J3DJointi */ -static int nodeCallBack(J3DJoint* param_0, int param_1) { +static int nodeCallBack(J3DJoint* i_joint, int param_1) { if (param_1 == 0) { - int jnt_no = param_0->getJntNo(); + int jnt_no = i_joint->getJntNo(); J3DModel* pmodel = j3dSys.getModel(); daObjDmElevator_c* puser_area = (daObjDmElevator_c*)pmodel->getUserArea(); diff --git a/src/d/d_save.cpp b/src/d/d_save.cpp index 8d7b20405c..a76a698202 100644 --- a/src/d/d_save.cpp +++ b/src/d/d_save.cpp @@ -1310,13 +1310,13 @@ void dSv_event_c::offEventBit(u16 i_no) { /* 800349BC-800349E0 02F2FC 0024+00 3/3 77/77 153/153 .text isEventBit__11dSv_event_cCFUs */ -BOOL dSv_event_c::isEventBit(u16 i_no) const { +BOOL dSv_event_c::isEventBit(const u16 i_no) const { return mEvent[i_no >> 8] & (i_no & 0xFF) ? TRUE : FALSE; } /* 800349E0-80034A04 02F320 0024+00 0/0 12/12 17/17 .text setEventReg__11dSv_event_cFUsUc */ -void dSv_event_c::setEventReg(u16 i_reg, u8 i_no) { +void dSv_event_c::setEventReg(const u16 i_reg, u8 i_no) { mEvent[i_reg >> 8] &= ~(u8)i_reg; mEvent[i_reg >> 8] |= i_no; }