diff --git a/config/GZ2E01/rels/d_a_npc_moi/symbols.txt b/config/GZ2E01/rels/d_a_npc_moi/symbols.txt index 4b196b6adab..8a2852335b0 100644 --- a/config/GZ2E01/rels/d_a_npc_moi/symbols.txt +++ b/config/GZ2E01/rels/d_a_npc_moi/symbols.txt @@ -253,6 +253,7 @@ __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:globa @3839 = .bss:0x00000048; // type:object size:0xC scope:local l_HIO = .bss:0x00000054; // type:object size:0x4 scope:global data:4byte @5529 = .bss:0x00000058; // type:object size:0xC scope:local +init$5530 = .bss:0x00000064; // type:object size:0x1 scope:local lightOffset$5528 = .bss:0x00000068; // type:object size:0xC scope:local sInstance__40JASGlobalInstance<19JASDefaultBankTable> = .bss:0x00000074; // type:object size:0x4 scope:global sInstance__35JASGlobalInstance<14JASAudioThread> = .bss:0x00000078; // type:object size:0x4 scope:global diff --git a/config/GZ2E01/rels/d_a_npc_zrc/symbols.txt b/config/GZ2E01/rels/d_a_npc_zrc/symbols.txt index 645c6becbd4..d0bbf2de0a2 100644 --- a/config/GZ2E01/rels/d_a_npc_zrc/symbols.txt +++ b/config/GZ2E01/rels/d_a_npc_zrc/symbols.txt @@ -268,6 +268,7 @@ __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:globa @4021 = .bss:0x00000048; // type:object size:0xC scope:local l_HIO = .bss:0x00000054; // type:object size:0x4 scope:global data:4byte @4773 = .bss:0x00000058; // type:object size:0xC scope:local +init$4774 = .bss:0x00000064; // type:object size:0x1 scope:local eyeOffset$4772 = .bss:0x00000068; // type:object size:0xC scope:local sInstance__40JASGlobalInstance<19JASDefaultBankTable> = .bss:0x00000074; // type:object size:0x4 scope:global sInstance__35JASGlobalInstance<14JASAudioThread> = .bss:0x00000078; // type:object size:0x4 scope:global diff --git a/config/GZ2E01/rels/d_a_obj_movebox/symbols.txt b/config/GZ2E01/rels/d_a_obj_movebox/symbols.txt index adf81784503..a51b0803aa5 100644 --- a/config/GZ2E01/rels/d_a_obj_movebox/symbols.txt +++ b/config/GZ2E01/rels/d_a_obj_movebox/symbols.txt @@ -139,15 +139,19 @@ M_wrt_work__Q212daObjMovebox5Bgc_c = .bss:0x000007EC; // type:object size:0x54 s @3672 = .bss:0x00000840; // type:object size:0xC scope:local M_wall_work__Q212daObjMovebox5Bgc_c = .bss:0x0000084C; // type:object size:0xA10 scope:global align:4 data:float @3909 = .bss:0x0000125C; // type:object size:0xC scope:local +init$3910 = .bss:0x00001268; // type:object size:0x1 scope:local touch_work$3908 = .bss:0x0000126C; // type:object size:0x70 scope:local @4501 = .bss:0x000012DC; // type:object size:0xC scope:local +init$4502 = .bss:0x000012E8; // type:object size:0x1 scope:local scl$4500 = .bss:0x000012EC; // type:object size:0xC scope:local @4574 = .bss:0x000012F8; // type:object size:0xC scope:local +init$4575 = .bss:0x00001304; // type:object size:0x1 scope:local @4577 = .bss:0x00001308; // type:object size:0xC scope:local @4578 = .bss:0x00001314; // type:object size:0xC scope:local @4579 = .bss:0x00001320; // type:object size:0xC scope:local dir_vec$4573 = .bss:0x0000132C; // type:object size:0x30 scope:local @4762 = .bss:0x0000135C; // type:object size:0xC scope:local +init$4763 = .bss:0x00001368; // type:object size:0x1 scope:local particle_scale$4761 = .bss:0x0000136C; // type:object size:0xC scope:local sInstance__40JASGlobalInstance<19JASDefaultBankTable> = .bss:0x00001378; // type:object size:0x4 scope:global sInstance__35JASGlobalInstance<14JASAudioThread> = .bss:0x0000137C; // type:object size:0x4 scope:global diff --git a/config/GZ2J01/rels/d_a_npc_moi/symbols.txt b/config/GZ2J01/rels/d_a_npc_moi/symbols.txt index 330b8377469..929881f21fb 100644 --- a/config/GZ2J01/rels/d_a_npc_moi/symbols.txt +++ b/config/GZ2J01/rels/d_a_npc_moi/symbols.txt @@ -252,6 +252,7 @@ __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:globa @3839 = .bss:0x00000048; // type:object size:0xC scope:local l_HIO = .bss:0x00000054; // type:object size:0x4 scope:global data:4byte @5529 = .bss:0x00000058; // type:object size:0xC scope:local +init$5530 = .bss:0x00000064; // type:object size:0x1 scope:local lightOffset$5528 = .bss:0x00000068; // type:object size:0xC scope:local sInstance__40JASGlobalInstance<19JASDefaultBankTable> = .bss:0x00000074; // type:object size:0x4 scope:global sInstance__35JASGlobalInstance<14JASAudioThread> = .bss:0x00000078; // type:object size:0x4 scope:global diff --git a/config/GZ2J01/rels/d_a_npc_zrc/symbols.txt b/config/GZ2J01/rels/d_a_npc_zrc/symbols.txt index 0334358049c..48f4f03165f 100644 --- a/config/GZ2J01/rels/d_a_npc_zrc/symbols.txt +++ b/config/GZ2J01/rels/d_a_npc_zrc/symbols.txt @@ -267,6 +267,7 @@ __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:globa @4021 = .bss:0x00000048; // type:object size:0xC scope:local l_HIO = .bss:0x00000054; // type:object size:0x4 scope:global data:4byte @4773 = .bss:0x00000058; // type:object size:0xC scope:local +init$4774 = .bss:0x00000064; // type:object size:0x1 scope:local eyeOffset$4772 = .bss:0x00000068; // type:object size:0xC scope:local sInstance__40JASGlobalInstance<19JASDefaultBankTable> = .bss:0x00000074; // type:object size:0x4 scope:global sInstance__35JASGlobalInstance<14JASAudioThread> = .bss:0x00000078; // type:object size:0x4 scope:global diff --git a/config/GZ2J01/rels/d_a_obj_iceleaf/splits.txt b/config/GZ2J01/rels/d_a_obj_iceleaf/splits.txt index ba9e4888b81..4bf024c28ab 100644 --- a/config/GZ2J01/rels/d_a_obj_iceleaf/splits.txt +++ b/config/GZ2J01/rels/d_a_obj_iceleaf/splits.txt @@ -13,3 +13,4 @@ d/actor/d_a_obj_iceleaf.cpp: .text start:0x00000078 end:0x000016BC .rodata start:0x00000000 end:0x0000004C .data start:0x00000000 end:0x000001E4 + .bss start:0x00000000 end:0x00000004 diff --git a/config/GZ2J01/rels/d_a_obj_movebox/symbols.txt b/config/GZ2J01/rels/d_a_obj_movebox/symbols.txt index 56589c98526..ea9efbb201a 100644 --- a/config/GZ2J01/rels/d_a_obj_movebox/symbols.txt +++ b/config/GZ2J01/rels/d_a_obj_movebox/symbols.txt @@ -138,15 +138,19 @@ M_wrt_work__Q212daObjMovebox5Bgc_c = .bss:0x000007EC; // type:object size:0x54 s @3672 = .bss:0x00000840; // type:object size:0xC scope:local M_wall_work__Q212daObjMovebox5Bgc_c = .bss:0x0000084C; // type:object size:0xA10 scope:global align:4 data:float @3909 = .bss:0x0000125C; // type:object size:0xC scope:local +init$3910 = .bss:0x00001268; // type:object size:0x1 scope:local touch_work$3908 = .bss:0x0000126C; // type:object size:0x70 scope:local @4501 = .bss:0x000012DC; // type:object size:0xC scope:local +init$4502 = .bss:0x000012E8; // type:object size:0x1 scope:local scl$4500 = .bss:0x000012EC; // type:object size:0xC scope:local @4574 = .bss:0x000012F8; // type:object size:0xC scope:local +init$4575 = .bss:0x00001304; // type:object size:0x1 scope:local @4577 = .bss:0x00001308; // type:object size:0xC scope:local @4578 = .bss:0x00001314; // type:object size:0xC scope:local @4579 = .bss:0x00001320; // type:object size:0xC scope:local dir_vec$4573 = .bss:0x0000132C; // type:object size:0x30 scope:local @4762 = .bss:0x0000135C; // type:object size:0xC scope:local +init$4763 = .bss:0x00001368; // type:object size:0x1 scope:local particle_scale$4761 = .bss:0x0000136C; // type:object size:0xC scope:local sInstance__40JASGlobalInstance<19JASDefaultBankTable> = .bss:0x00001378; // type:object size:0x4 scope:global sInstance__35JASGlobalInstance<14JASAudioThread> = .bss:0x0000137C; // type:object size:0x4 scope:global diff --git a/configure.py b/configure.py index 85bbd578c09..d15ee2323a4 100755 --- a/configure.py +++ b/configure.py @@ -1537,7 +1537,7 @@ def MatchingFor(*versions) -> bool: ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_door_shutter"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_door_spiral"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_dshutter"), - ActorRel(NonMatching, "d_a_ep"), + ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_ep"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_hitobj"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_kytag00"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_kytag04"), @@ -1545,8 +1545,8 @@ def MatchingFor(*versions) -> bool: ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_obj_brakeeff"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_obj_burnbox"), ActorRel(NonMatching, "d_a_obj_carry"), - ActorRel(NonMatching, "d_a_obj_ito"), - ActorRel(NonMatching, "d_a_obj_movebox"), + ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_obj_ito"), + ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_obj_movebox"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_obj_swpush"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_obj_timer"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_path_line"), @@ -1592,7 +1592,7 @@ def MatchingFor(*versions) -> bool: ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_demo_item"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_door_bossL1"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_e_dn"), - ActorRel(MatchingFor("GZ2E01"), "d_a_e_fm"), + ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_e_fm"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_e_ga"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_e_hb"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_e_nest"), @@ -1610,7 +1610,7 @@ def MatchingFor(*versions) -> bool: ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_npc_fish"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_npc_henna"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_npc_kakashi"), - ActorRel(MatchingFor("GZ2E01"), "d_a_npc_kkri"), + ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_npc_kkri"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_npc_kolin"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_npc_maro"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_npc_taro"), @@ -1713,9 +1713,9 @@ def MatchingFor(*versions) -> bool: ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_e_dd"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_e_df"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_e_dk"), - ActorRel(MatchingFor("GZ2E01"), "d_a_e_dt"), + ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_e_dt"), ActorRel(NonMatching, "d_a_e_fb"), - ActorRel(MatchingFor("GZ2E01"), "d_a_e_fk"), + ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_e_fk"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_e_fs"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_e_fz"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_e_gb"), @@ -1728,7 +1728,7 @@ def MatchingFor(*versions) -> bool: ActorRel(NonMatching, "d_a_e_hm"), ActorRel(NonMatching, "d_a_e_hp"), ActorRel(NonMatching, "d_a_e_hz"), - ActorRel(MatchingFor("GZ2E01"), "d_a_e_hzelda"), + ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_e_hzelda"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_e_is"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_e_kg"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_e_kk"), @@ -1863,7 +1863,7 @@ def MatchingFor(*versions) -> bool: ActorRel(NonMatching, "d_a_npc_lud"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_npc_midp"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_npc_mk"), - ActorRel(NonMatching, "d_a_npc_moi"), + ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_npc_moi"), ActorRel(NonMatching, "d_a_npc_moir", extra_cflags=[DANPCF_C_HACK]), ActorRel(NonMatching, "d_a_npc_myna2"), ActorRel(NonMatching, "d_a_npc_ne"), @@ -1976,8 +1976,8 @@ def MatchingFor(*versions) -> bool: ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_obj_firepillar"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_obj_firepillar2"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_obj_flag"), - ActorRel(Equivalent, "d_a_obj_flag2"), # weak function order - ActorRel(NonMatching, "d_a_obj_flag3"), + ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_obj_flag2"), + ActorRel(Equivalent, "d_a_obj_flag3"), # weak function order ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_obj_food"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_obj_fw"), ActorRel(NonMatching, "d_a_obj_gadget"), @@ -2158,7 +2158,7 @@ def MatchingFor(*versions) -> bool: ActorRel(NonMatching, "d_a_obj_spinLift"), ActorRel(NonMatching, "d_a_obj_ss_drink"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_obj_ss_item"), - ActorRel(MatchingFor("GZ2E01"), "d_a_obj_stairBlock"), + ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_obj_stairBlock"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_obj_stone"), ActorRel(MatchingFor("GZ2E01", "GZ2J01"), "d_a_obj_stopper"), ActorRel(NonMatching, "d_a_obj_stopper2"), diff --git a/include/JSystem/J3DGraphAnimator/J3DJoint.h b/include/JSystem/J3DGraphAnimator/J3DJoint.h index b20b48d792f..beb4004dcfe 100644 --- a/include/JSystem/J3DGraphAnimator/J3DJoint.h +++ b/include/JSystem/J3DGraphAnimator/J3DJoint.h @@ -69,7 +69,7 @@ class J3DJoint { void setYounger(J3DJoint* pYounger) { mYounger = pYounger; } void setCurrentMtxCalc(J3DMtxCalc* pMtxCalc) { mCurrentMtxCalc = pMtxCalc; } J3DTransformInfo& getTransformInfo() { return mTransformInfo; } - void setTransformInfo(J3DTransformInfo& i_info) { mTransformInfo = i_info; } + void setTransformInfo(const J3DTransformInfo& i_info) { mTransformInfo = i_info; } Vec* getMax() { return &mMax; } Vec* getMin() { return &mMin; } void setCallBack(J3DJointCallBack callback) { mCallBack = callback; } diff --git a/include/d/actor/d_a_npc_kasi_mich.h b/include/d/actor/d_a_npc_kasi_mich.h index d40c2a44896..e6a19be0b19 100644 --- a/include/d/actor/d_a_npc_kasi_mich.h +++ b/include/d/actor/d_a_npc_kasi_mich.h @@ -75,6 +75,7 @@ class daNpcKasiMich_c : public daNpcF_c { /* 80A28F74 */ int escape(int); /* 80A2908C */ int iyan_look(int); /* 80A29164 */ int turn_hana(int); + void dummy(); /* 80A291E8 */ int wait_dummy(int); /* 80A2926C */ int cheer(int); /* 80A29458 */ BOOL _turn_to_link(s16); diff --git a/include/d/actor/d_a_obj_flag2.h b/include/d/actor/d_a_obj_flag2.h index 7b6f2046c72..1eff9572c5b 100644 --- a/include/d/actor/d_a_obj_flag2.h +++ b/include/d/actor/d_a_obj_flag2.h @@ -25,7 +25,6 @@ class FlagCloth_c : public J3DPacket { /* 80BEE0B8 */ cXyz getTargetPos() { return mPositions[4]; } /* 80BECF30 */ void draw(); - /* 80BED9C4 */ virtual ~FlagCloth_c() {} cXyz* getPos() { return mPositions; } cXyz* getNormal() { return mNormals; } @@ -76,7 +75,6 @@ class daObjFlag2_c : public fopAc_ac_c { /* 80BED44C */ void setCollision(); /* 80BED480 */ int createHeap(); /* 80BED6A0 */ int create(); - /* 80BED7A4 */ daObjFlag2_c(); /* 80BEDCE0 */ int draw(); /* 80BEDEE0 */ ~daObjFlag2_c(); inline int execute(); diff --git a/include/d/actor/d_a_obj_flag3.h b/include/d/actor/d_a_obj_flag3.h index 77e51e271d2..f3e70d3d0f4 100644 --- a/include/d/actor/d_a_obj_flag3.h +++ b/include/d/actor/d_a_obj_flag3.h @@ -16,13 +16,20 @@ class FlagCloth2_c : public J3DPacket { public: /* 80BEEDE4 */ void execute(); /* 80BEEF74 */ inline void calcFlagNormal(cXyz*, int); + static void initCcSphere(fopAc_ac_c*); /* 80BEF278 */ inline cXyz calcFlagFactor(cXyz*, cXyz*, cXyz*, int); /* 80BEF790 */ virtual ~FlagCloth2_c(); /* 80BEFD08 */ void initFlagPos(cXyz*, fopAc_ac_c*); /* 80BF00A0 */ virtual void draw(); - /* 80BF0434 */ cXyz getTargetPos() { return mPositions[4]; } + /* 80BF0434 */ cXyz getTargetPos() { return mPositions[4]; } - inline void calcFlagNormalBack(); + void calcFlagNormalBack() { + cXyz* pNormal = getNormal(); + cXyz* pNormalBack = getNormalBack(); + for (int i = 0; i < 36; pNormal++, pNormalBack++, i++) { + pNormalBack->set(-pNormal->x, -pNormal->y, -pNormal->z); + } + } cXyz* getPos() { return mPositions; } cXyz* getVec() { return mVecs; } cXyz* getNormal() { return mNormals; } @@ -43,14 +50,7 @@ class FlagCloth2_c : public J3DPacket { } } - void calcFlagFactorSub(cXyz* param_1, cXyz* param_2, cXyz* param_3, f32 param_4) { - cXyz acStack_2c = *param_2 - *param_1; - param_4 = acStack_2c.abs() - param_4; - cXyz cStack_38 = acStack_2c.normZC(); - param_4 *= mSpringRate; - cStack_38 *= param_4; - *param_3 += cStack_38; - } + void calcFlagFactorSub(cXyz* param_1, cXyz* param_2, cXyz* param_3, f32 param_4); /* 0x010 */ GXTexObj mTexObj; /* 0x030 */ dKy_tevstr_c mTevStr; diff --git a/include/d/actor/d_a_obj_ito.h b/include/d/actor/d_a_obj_ito.h index 86b00b17212..58e05ec3aa0 100644 --- a/include/d/actor/d_a_obj_ito.h +++ b/include/d/actor/d_a_obj_ito.h @@ -15,7 +15,7 @@ struct ito_s { /* 0x000 */ mDoExt_3DlineMat0_c mLineMat; - /* 0x01C */ f32 field_0x1c[120]; + /* 0x01C */ f32 field_0x1c[6][20]; /* 0x1FC */ cXyz field_0x1fc[6]; /* 0x244 */ s16 field_0x244[6]; /* 0x250 */ f32 field_0x250; diff --git a/include/d/d_a_obj.h b/include/d/d_a_obj.h index 70adf5b4ab2..aa1f5f65666 100644 --- a/include/d/d_a_obj.h +++ b/include/d/d_a_obj.h @@ -22,13 +22,11 @@ int PrmAbstract(const fopAc_ac_c* i_actor, T i_prmA, T i_prmB) { return ((1 << i_prmA) - 1) & (param >> i_prmB); } -#ifdef DEBUG class HioVarious_c { public: static void init(JORReflexible*, const char*); static void clean(JORReflexible*); }; -#endif }; // namespace daObj diff --git a/src/d/actor/d_a_ep.cpp b/src/d/actor/d_a_ep.cpp index eca3869cc1d..7cfc73cfda7 100644 --- a/src/d/actor/d_a_ep.cpp +++ b/src/d/actor/d_a_ep.cpp @@ -5,10 +5,11 @@ #include "d/dolzel_rel.h" #include "d/actor/d_a_ep.h" -#include "d/d_com_inf_game.h" -#include "m_Do/m_Do_lib.h" +#include "d/actor/d_a_player.h" #include "d/d_a_obj.h" +#include "d/d_com_inf_game.h" #include "d/d_s_play.h" +#include "m_Do/m_Do_lib.h" /* 804681F8-804682F8 000078 0100+00 1/1 0/0 0/0 .text hahen_draw__FP8ep_class */ static void hahen_draw(ep_class* i_this) { @@ -280,22 +281,21 @@ static void hahen_cast(ep_class* i_this, ep_hahen_s* hahen_s) { /* 804690F8-80469568 000F78 0470+00 1/1 0/0 0/0 .text hahen_move__FP8ep_class */ static void hahen_move(ep_class* i_this) { - // NONMATCHING - equivalent in debug.... fopAc_ac_c* a_this = i_this; - fopAc_ac_c* player = dComIfGp_getPlayer(0); - dBgS_LinChk dStack_cc; ep_hahen_s* epHahenS; + daPy_py_c* player = static_cast(dComIfGp_getPlayer(0)); + dBgS_LinChk dStack_cc; if (!fopAcM_checkCarryNow(a_this)) { f32 fVar1 = 50.0f; s8 bVar2 = false; cXyz local_d8; for (int iters = 0; iters < 10; iters++) { - epHahenS = i_this->mHahen; + epHahenS = static_cast(i_this->mHahen); for (int j = 0; j < 6; j++, epHahenS++) { local_d8 = player->current.pos - epHahenS->field_0x4; if (local_d8.abs() < fVar1) { - cLib_onBit(a_this->attention_info.flags, fopAc_AttnFlag_ETC_e); + cLib_onBit(a_this->attention_info.flags, fopAc_AttnFlag_CARRY_e); a_this->current.pos = epHahenS->field_0x4; a_this->attention_info.position = a_this->eyePos = a_this->current.pos; a_this->current.angle = a_this->shape_angle = epHahenS->field_0x28; @@ -313,7 +313,7 @@ static void hahen_move(ep_class* i_this) { fVar1 += 20.0f; } } else { - cLib_offBit(a_this->attention_info.flags, fopAc_AttnFlag_ETC_e); + cLib_offBit(a_this->attention_info.flags, fopAc_AttnFlag_CARRY_e); i_this->mHahen[i_this->field_0xa78].field_0x97 = 3; i_this->mHahen[i_this->field_0xa78].field_0x4 = a_this->current.pos; i_this->mHahen[i_this->field_0xa78].field_0x28 = a_this->shape_angle; @@ -325,7 +325,7 @@ static void hahen_move(ep_class* i_this) { if (epHahenS->field_0x98) { --epHahenS->field_0x98; } - + if (i_this->field_0xa79 == 3) { if (epHahenS->field_0x97 == 1) { hahen_normal(i_this, epHahenS); @@ -819,10 +819,10 @@ static int daEp_CreateHeap(fopAc_ac_c* a_this) { // NONMATCHING - equiv in debug ep_class* i_this = (ep_class*)a_this; - J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("Ep", model_d[i_this->field_0xa5a]); + void* modelData = dComIfG_getObjectRes("Ep", model_d[i_this->field_0xa5a]); JUT_ASSERT(0x855, modelData != 0); - i_this->mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); + i_this->mpModel = mDoExt_J3DModel__create((J3DModelData*)modelData, 0x80000, 0x11000084); if (i_this->mpModel == NULL) { return 0; } @@ -830,11 +830,11 @@ static int daEp_CreateHeap(fopAc_ac_c* a_this) { MtxScale(0.0f, 0.0f, 0.0f, 0); i_this->mpModel->setBaseTRMtx(*calc_mtx); - modelData = (J3DModelData*)dComIfG_getObjectRes("Ep", 7); + modelData = dComIfG_getObjectRes("Ep", 7); JUT_ASSERT(0x884, modelData != 0); for (int i = 0; i < 6; i++) { - i_this->mHahen[i].mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); + i_this->mHahen[i].mpModel = mDoExt_J3DModel__create((J3DModelData*)modelData, 0x80000, 0x11000084); if (i_this->mHahen[i].mpModel == NULL) { return 0; } diff --git a/src/d/actor/d_a_npc_kasi_kyu.cpp b/src/d/actor/d_a_npc_kasi_kyu.cpp index 31f17316a83..a69616a8892 100644 --- a/src/d/actor/d_a_npc_kasi_kyu.cpp +++ b/src/d/actor/d_a_npc_kasi_kyu.cpp @@ -1354,7 +1354,7 @@ int daNpcKasiKyu_c::cheer(int param_1) { fopAcM_SetSpeedF(this, 0.0f); mpMorf->setPlaySpeed(0.0f); mTalked = false; - field_0x1460 = 20; + field_0x1460 = 12; mMode = 1; break; diff --git a/src/d/actor/d_a_npc_kasi_mich.cpp b/src/d/actor/d_a_npc_kasi_mich.cpp index 58d5bd1488b..7e57f0671fd 100644 --- a/src/d/actor/d_a_npc_kasi_mich.cpp +++ b/src/d/actor/d_a_npc_kasi_mich.cpp @@ -977,7 +977,7 @@ int daNpcKasiMich_c::chace_st(int param_1) { case 1: if (_turn_to_link(0xC00)) { - setAction(&daNpcKasiMich_c::chace); + setAction(&daNpcKasiMich_c::wait); } break; } @@ -1010,7 +1010,7 @@ int daNpcKasiMich_c::chace(int param_1) { setAction(&daNpcKasiMich_c::wait); } } else { - setAction(&daNpcKasiMich_c::chace_st); + setAction(&daNpcKasiMich_c::wait); } break; } @@ -1054,7 +1054,7 @@ int daNpcKasiMich_c::turn_link(int param_1) { case 1: if (_turn_to_link(0x1000)) { - setAction(&daNpcKasiMich_c::wait); + setAction(&daNpcKasiMich_c::chace); break; } } @@ -1082,7 +1082,7 @@ int daNpcKasiMich_c::turn_home(int param_1) { shape_angle.y = current.angle.y; if (bVar1) { - setAction(&daNpcKasiMich_c::wait_dummy); + setAction(&daNpcKasiMich_c::wait); } break; } @@ -1106,7 +1106,7 @@ int daNpcKasiMich_c::turn_center(int param_1) { case 1: if (_turn_pos(mCenterPos, 0x1000)) { - setAction(&daNpcKasiMich_c::wait_dummy); + setAction(&daNpcKasiMich_c::chace_st); } break; } @@ -1193,7 +1193,7 @@ int daNpcKasiMich_c::kya_stop(int param_1) { case 0: if (mMotion != MOT_MICH_KYA_TALK) { - setAction(&daNpcKasiMich_c::wait); + setAction(&daNpcKasiMich_c::chace); } else { mMode = 1; } @@ -1201,7 +1201,7 @@ int daNpcKasiMich_c::kya_stop(int param_1) { case 1: if (mpMorf->getFrame() == 19.0f || mpMorf->getFrame() == 1.0f) { - setAction(&daNpcKasiMich_c::wait_dummy); + setAction(&daNpcKasiMich_c::wait); } break; } @@ -1285,6 +1285,13 @@ int daNpcKasiMich_c::iyan_look(int param_1) { return 1; } +void daNpcKasiMich_c::dummy() { + setAction(&daNpcKasiMich_c::wait_dummy); + setAction(&daNpcKasiMich_c::wait); + setAction(&daNpcKasiMich_c::wait_dummy); + setAction(&daNpcKasiMich_c::wait_dummy); +} + /* 80A29164-80A291E8 003084 0084+00 1/0 0/0 0/0 .text turn_hana__15daNpcKasiMich_cFi */ int daNpcKasiMich_c::turn_hana(int param_1) { switch (mMode) { diff --git a/src/d/actor/d_a_npc_moi.cpp b/src/d/actor/d_a_npc_moi.cpp index a87bdb68d89..c1e2c2c2d62 100644 --- a/src/d/actor/d_a_npc_moi.cpp +++ b/src/d/actor/d_a_npc_moi.cpp @@ -154,6 +154,32 @@ daNpc_Moi_c::cutFunc daNpc_Moi_c::mCutList[5] = { &daNpc_Moi_c::cutFindWolf, }; +enum Motion { + /* 0x00 */ MOT_UNK_0 = 0, + /* 0x01 */ MOT_UNK_1 = 1, + /* 0x02 */ MOT_UNK_2 = 2, + /* 0x03 */ MOT_UNK_3 = 3, + /* 0x04 */ MOT_UNK_4 = 4, + /* 0x05 */ MOT_UNK_5 = 5, + /* 0x08 */ MOT_UNK_8 = 8, + /* 0x09 */ MOT_UNK_9 = 9, + /* 0x0A */ MOT_UNK_10 = 10, + /* 0x0B */ MOT_UNK_11 = 11, + /* 0x0E */ MOT_UNK_14 = 14, + /* 0x0F */ MOT_UNK_15 = 15, + /* 0x10 */ MOT_UNK_16 = 16, + /* 0x12 */ MOT_UNK_18 = 18, + /* 0x13 */ MOT_UNK_19 = 19, + /* 0x15 */ MOT_UNK_21 = 21, + /* 0x25 */ MOT_UNK_37 = 37, + /* 0x26 */ MOT_UNK_38 = 38, + /* 0x27 */ MOT_UNK_39 = 39, + /* 0x28 */ MOT_UNK_40 = 40, + /* 0x2B */ MOT_UNK_43 = 43, + /* 0x2D */ MOT_UNK_45 = 45, + /* 0x2F */ MOT_UNK_47 = 47, +}; + /* 80A73F4C-80A74150 0000EC 0204+00 1/0 0/0 0/0 .text __dt__11daNpc_Moi_cFv */ daNpc_Moi_c::~daNpc_Moi_c() { if (mpMorf[0] != 0) { @@ -706,22 +732,22 @@ BOOL daNpc_Moi_c::checkChangeEvt() { void daNpc_Moi_c::setAfterTalkMotion() { int iVar2 = 21; switch (mFaceMotionSeqMngr.getNo()) { - case 1: - iVar2 = 18; + case MOT_UNK_1: + iVar2 = MOT_UNK_18; break; - case 2: - iVar2 = 19; + case MOT_UNK_2: + iVar2 = MOT_UNK_19; break; - case 3: - iVar2 = 16; + case MOT_UNK_3: + iVar2 = MOT_UNK_16; break; - case 4: - iVar2 = 14; + case MOT_UNK_4: + iVar2 = MOT_UNK_14; break; - case 5: - iVar2 = 15; + case MOT_UNK_5: + iVar2 = MOT_UNK_15; break; - case 9: + case MOT_UNK_9: return; } mFaceMotionSeqMngr.setNo(iVar2, -1.0f, 0, 0); @@ -1108,7 +1134,7 @@ BOOL daNpc_Moi_c::chkPlayerGetWoodShield() { /* 80A766DC-80A76888 00287C 01AC+00 2/2 0/0 0/0 .text setSSlash__11daNpc_Moi_cFi */ void daNpc_Moi_c::setSSlash(int param_1) { - mMotionSeqMngr.setNo(43, 0.0f, 1, 0); + mMotionSeqMngr.setNo(MOT_UNK_43, 0.0f, 1, 0); /* dSv_event_tmp_flag_c::GUARD_URI - Ordon Village - Rusl is guarding Uli, Ordon village night */ if (dComIfGs_isTmpBit(0x1308)) { mSound.startCreatureVoice(JAISoundID(Z2SE_MOI_V_GUARD_SWING), -1); @@ -1212,7 +1238,7 @@ int daNpc_Moi_c::injuryCheck() { BOOL bVar1 = TRUE; int timer = field_0x1658; - if (mMotionSeqMngr.getNo() == 37 || mMotionSeqMngr.getNo() == 38) { + if (mMotionSeqMngr.getNo() == MOT_UNK_37 || mMotionSeqMngr.getNo() == MOT_UNK_38) { if (mMotionSeqMngr.checkEndSequence()) { cLib_calcTimer(&timer); } else { @@ -1223,23 +1249,23 @@ int daNpc_Moi_c::injuryCheck() { if (bVar1 && timer != 0) { if (field_0x1667 != 0) { if (timer & 1 != 0) { - mMotionSeqMngr.setNo(38, -1.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_38, -1.0f, 0, 0); } else { - mMotionSeqMngr.setNo(37, -1.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_37, -1.0f, 0, 0); } } else { f32 fVar3 = cM_rnd(); fVar3 -= 0.5f; - if (mMotionSeqMngr.getNo() == 38) { + if (mMotionSeqMngr.getNo() == MOT_UNK_38) { fVar3 += 0.25f; } - if (mMotionSeqMngr.getNo() == 37) { + if (mMotionSeqMngr.getNo() == MOT_UNK_37) { fVar3 -= 0.25f; } if (0.0f < fVar3) { - mMotionSeqMngr.setNo(38, -1.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_38, -1.0f, 0, 0); } else { - mMotionSeqMngr.setNo(37, -1.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_37, -1.0f, 0, 0); } } } @@ -1257,7 +1283,7 @@ int daNpc_Moi_c::injuryTurn(cXyz param_1) { if (abs(iVar1) < 0x2000) { bVar1 = TRUE; } else { - mMotionSeqMngr.setNo(40, 4.0f, 1, 0); + mMotionSeqMngr.setNo(MOT_UNK_40, 4.0f, 1, 0); field_0x1664 = mCurAngle.y + 0x4000; mTurnAmount = 0; mStartAngle = current.angle.y; @@ -1330,22 +1356,22 @@ int daNpc_Moi_c::poise() { if (field_0x1669 != 0) { if (field_0x166c != 0) { if (field_0x1664 == mCurAngle.y) { - if (mMotionSeqMngr.getNo() == 43) { + if (mMotionSeqMngr.getNo() == MOT_UNK_43) { if (mMotionSeqMngr.checkEndSequence()) { - mMotionSeqMngr.setNo(10, -1.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_10, -1.0f, 0, 0); field_0x166c = 0; } - } else if (mMotionSeqMngr.getNo() == 10) { - mMotionSeqMngr.setNo(10, -1.0f, 0, 0); + } else if (mMotionSeqMngr.getNo() == MOT_UNK_10) { + mMotionSeqMngr.setNo(MOT_UNK_10, -1.0f, 0, 0); field_0x166c = 0; } } else { step(field_0x1664, -1, -1, 10, 0); } } else { - if (mMotionSeqMngr.getNo() == 43) { + if (mMotionSeqMngr.getNo() == MOT_UNK_43) { if (mMotionSeqMngr.checkEndSequence()) { - mMotionSeqMngr.setNo(10, -1.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_10, -1.0f, 0, 0); field_0x166c = 0; } } else { @@ -1355,7 +1381,7 @@ int daNpc_Moi_c::poise() { setSSlash(0); } else if (field_0x166e) { if (step(field_0x1664, -1, -1, 10, 0)) { - mMotionSeqMngr.setNo(10, -1.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_10, -1.0f, 0, 0); field_0x166e = 0; } } else if ((s16)abs((s16)(fopAcM_searchPlayerAngleY(this) - mCurAngle.y)) < @@ -1371,7 +1397,7 @@ int daNpc_Moi_c::poise() { if (field_0x1648 == 0) { field_0x1648 = cLib_getRndValue(iVar13 * 0.5f, iVar13 * 1.5f); } else if (!cLib_calcTimer(&field_0x1648)) { - mMotionSeqMngr.setNo(43, 0.0f, 1, 0); + mMotionSeqMngr.setNo(MOT_UNK_43, 0.0f, 1, 0); /* dSv_event_tmp_flag_c::GUARD_URI - Ordon Village - Rusl is guarding Uli, Ordon village night */ if (dComIfGs_isTmpBit(0x1308)) { mSound.startCreatureVoice(JAISoundID(Z2SE_MOI_V_GUARD_SWING), -1); @@ -1385,9 +1411,9 @@ int daNpc_Moi_c::poise() { } else { field_0x1664 = fopAcM_searchPlayerAngleY(this); if (field_0x166b != 0) { - mMotionSeqMngr.setNo(10, -1.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_10, -1.0f, 0, 0); } else { - mMotionSeqMngr.setNo(11, -1.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_11, -1.0f, 0, 0); } field_0x1648 = 0; field_0x166e = 1; @@ -1435,26 +1461,26 @@ int daNpc_Moi_c::cutDeliveredSw(int param_1) { if (dComIfGp_getEventManager().getIsAddvance(param_1)) { switch (iVar6) { case 0: - mFaceMotionSeqMngr.setNo(21, 0.0f, 0, 0); + mFaceMotionSeqMngr.setNo(MOT_UNK_21, 0.0f, 0, 0); mMotionSeqMngr.setNo(45, 0.0f, 1, 0); mEventTimer = uVar5; break; case 1: - mFaceMotionSeqMngr.setNo(21, -1.0f, 0, 0); + mFaceMotionSeqMngr.setNo(MOT_UNK_21, -1.0f, 0, 0); mMotionSeqMngr.setNo(45, -1.0f, 0, 0); mEventTimer = uVar5; break; case 2: - mFaceMotionSeqMngr.setNo(21, -1.0f, 0, 0); - mMotionSeqMngr.setNo(0, -1.0f, 0, 0); + mFaceMotionSeqMngr.setNo(MOT_UNK_21, -1.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_0, -1.0f, 0, 0); mEventTimer = uVar5; break; case 3: initTalk(mFlowNodeNo, NULL); break; case 4: - mFaceMotionSeqMngr.setNo(21, -1.0f, 0, 0); - mMotionSeqMngr.setNo(0, -1.0f, 0, 0); + mFaceMotionSeqMngr.setNo(MOT_UNK_21, -1.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_0, -1.0f, 0, 0); } } @@ -1542,8 +1568,8 @@ int daNpc_Moi_c::cutAppearanceMoi(int param_1) { setAngle(home.angle.y); break; case 2: - mFaceMotionSeqMngr.setNo(21, -1.0f, 0, 0); - mMotionSeqMngr.setNo(45, -1.0f, 0, 0); + mFaceMotionSeqMngr.setNo(MOT_UNK_21, -1.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_45, -1.0f, 0, 0); dComIfGp_getEvent().setPt2(this); mEventTimer = local_78; break; @@ -1555,8 +1581,8 @@ int daNpc_Moi_c::cutAppearanceMoi(int param_1) { setPos(cStack_30); break; case 4: - mFaceMotionSeqMngr.setNo(21, -1.0f, 0, 0); - mMotionSeqMngr.setNo(0, -1.0f, 0, 0); + mFaceMotionSeqMngr.setNo(MOT_UNK_21, -1.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_0, -1.0f, 0, 0); initTalk(120, &local_68[0]); break; case 6: @@ -1686,13 +1712,13 @@ int daNpc_Moi_c::cutFindWolf(int param_1) { if (dComIfGp_getEventManager().getIsAddvance(param_1)) { switch (iVar9) { case 0: - mMotionSeqMngr.setNo(10, 0.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_10, 0.0f, 0, 0); speedF = 0.0f; speed.setall(0.0f); break; case 1: - mFaceMotionSeqMngr.setNo(8, 0.0f, 0, 0); - mMotionSeqMngr.setNo(16, 0.0f, 0, 0); + mFaceMotionSeqMngr.setNo(MOT_UNK_8, 0.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_16, 0.0f, 0, 0); mSound.startCreatureVoice(JAISoundID(Z2SE_MOI_V_KUTT), -1); field_0x166b = 1; cStack_30 = mPath.getPntPos(0); @@ -1749,8 +1775,8 @@ int daNpc_Moi_c::wait(void* param_1) { case MODE_ENTER: case MODE_INIT: if (!mStagger.checkStagger()) { - mFaceMotionSeqMngr.setNo(21, -1.0f, 0, 0); - mMotionSeqMngr.setNo(0, -1.0f, 0, 0); + mFaceMotionSeqMngr.setNo(MOT_UNK_21, -1.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_0, -1.0f, 0, 0); field_0x1648 = cLib_getRndValue(iVar4 * 0.5f, iVar4 * 1.5f); mMode = MODE_RUN; } @@ -1783,8 +1809,8 @@ int daNpc_Moi_c::wait(void* param_1) { if (mType == 1) { if (field_0x1648) { if (!cLib_calcTimer(&field_0x1648)) { - mFaceMotionSeqMngr.setNo(21, -1.0f, 0, 0); - mMotionSeqMngr.setNo(47, -1.0f, 0, 0); + mFaceMotionSeqMngr.setNo(MOT_UNK_21, -1.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_47, -1.0f, 0, 0); } } else { if (mMotionSeqMngr.checkEndSequence() || srchPlayerActor()) { @@ -1822,8 +1848,8 @@ int daNpc_Moi_c::walk(void* param_1) { case MODE_ENTER: case MODE_INIT: if (!mStagger.checkStagger()) { - mFaceMotionSeqMngr.setNo(21, -1.0f, 0, 0); - mMotionSeqMngr.setNo(45, -1.0f, 0, 0); + mFaceMotionSeqMngr.setNo(MOT_UNK_21, -1.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_45, -1.0f, 0, 0); mMode = MODE_RUN; } case MODE_RUN: @@ -1864,17 +1890,17 @@ int daNpc_Moi_c::walkOnEggshell(void* param_1) { case MODE_INIT: if (!mStagger.checkStagger()) { if (field_0x1669) { - mFaceMotionSeqMngr.setNo(21, -1.0f, 0, 0); - int motion_no; + mFaceMotionSeqMngr.setNo(MOT_UNK_21, -1.0f, 0, 0); + Motion motion_no; if (field_0x166b) { - motion_no = 10; + motion_no = MOT_UNK_10; } else { - motion_no = 11; + motion_no = MOT_UNK_11; } mMotionSeqMngr.setNo(motion_no, -1.0f, 0, 0); } else { - mFaceMotionSeqMngr.setNo(21, -1.0f, 0, 0); - mMotionSeqMngr.setNo(40, -1.0f, 0, 0); + mFaceMotionSeqMngr.setNo(MOT_UNK_21, -1.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_40, -1.0f, 0, 0); mJntAnm.lookNone(0); field_0x164c = cLib_getRndValue(sVar1 * 0.5f, sVar1 * 1.5f); } @@ -1916,11 +1942,11 @@ int daNpc_Moi_c::walkOnEggshell(void* param_1) { poise(); } else { if (field_0x1669) { - mMotionSeqMngr.setNo(39, -1.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_39, -1.0f, 0, 0); field_0x1669 = 0; field_0x165c = 0; } else { - if (mMotionSeqMngr.getNo() == 39) { + if (mMotionSeqMngr.getNo() == MOT_UNK_39) { if (mMotionSeqMngr.checkEndSequence()) { mMode = MODE_INIT; } @@ -1948,8 +1974,8 @@ int daNpc_Moi_c::rest(void* param_1) { case MODE_ENTER: case MODE_INIT: if (!mStagger.checkStagger()) { - mFaceMotionSeqMngr.setNo(9, -1.0f, 0, 0); - mMotionSeqMngr.setNo(19, -1.0f, 0, 0); + mFaceMotionSeqMngr.setNo(MOT_UNK_9, -1.0f, 0, 0); + mMotionSeqMngr.setNo(MOT_UNK_19, -1.0f, 0, 0); mMode = MODE_RUN; } case MODE_RUN: @@ -1975,12 +2001,12 @@ int daNpc_Moi_c::talk(void* param_1) { if (!mStagger.checkStagger()) { if (field_0x165c) { if (field_0x1669) { - mFaceMotionSeqMngr.setNo(21, -1.0f, 0, 0); - int motion_no; + mFaceMotionSeqMngr.setNo(MOT_UNK_21, -1.0f, 0, 0); + Motion motion_no; if (field_0x166b) { - motion_no = 10; + motion_no = MOT_UNK_10; } else { - motion_no = 11; + motion_no = MOT_UNK_11; } mMotionSeqMngr.setNo(motion_no, -1.0f, 0, 0); } diff --git a/src/d/actor/d_a_npc_moir.cpp b/src/d/actor/d_a_npc_moir.cpp index 239e46837aa..ae4e4d22fb7 100644 --- a/src/d/actor/d_a_npc_moir.cpp +++ b/src/d/actor/d_a_npc_moir.cpp @@ -1281,7 +1281,7 @@ BOOL daNpcMoiR_c::multiTalk(void* param_1) { fopAc_ac_c* speakers[4] = {this, mActorMngr[1].getActorP(), mActorMngr[2].getActorP(), mActorMngr[3].getActorP()}; dComIfGp_setMesgCameraInfoActor(speakers[0], speakers[1], speakers[2], speakers[3], NULL, NULL, NULL, NULL, NULL, NULL); - + switch (field_0xe08) { case 0: initTalk(mMsgNo, NULL); diff --git a/src/d/actor/d_a_npc_zrc.cpp b/src/d/actor/d_a_npc_zrc.cpp index c30dfed55a2..8908b82f59c 100644 --- a/src/d/actor/d_a_npc_zrc.cpp +++ b/src/d/actor/d_a_npc_zrc.cpp @@ -190,7 +190,11 @@ char* daNpc_zrC_c::mEvtCutNameList[2] = { /* 80B9397C-80B93994 000294 0018+00 1/2 0/0 0/0 .data mEvtCutList__11daNpc_zrC_c */ daNpc_zrC_c::EventFn daNpc_zrC_c::mEvtCutList[2] = { NULL, - &ECut_earringGet, + &daNpc_zrC_c::ECut_earringGet, +}; + +enum Event_Cut_Nums { + /* 0x2 */ NUM_EVT_CUTS_e = 0x2, }; /* 80B8DC0C-80B8DD90 0000EC 0184+00 1/1 0/0 0/0 .text __ct__11daNpc_zrC_cFv */ @@ -346,7 +350,7 @@ int daNpc_zrC_c::Execute() { /* 80B8E884-80B8E914 000D64 0090+00 1/1 0/0 0/0 .text Draw__11daNpc_zrC_cFv */ int daNpc_zrC_c::Draw() { mpMorf->getModel()->getModelData()->getMaterialNodePointer(1)->setMaterialAnm(mpMatAnm); - BOOL is_test = chkAction(&test); + BOOL is_test = chkAction(&daNpc_zrC_c::test); return draw(is_test, true, daNpc_zrC_Param_c::m.mShadowDepth, NULL, false); } @@ -1098,20 +1102,20 @@ BOOL daNpc_zrC_c::setAction(ActionFn i_action) { BOOL daNpc_zrC_c::selectAction() { mpNextActionFn = NULL; if (daNpc_zrC_Param_c::m.mTest) { - mpNextActionFn = &test; + mpNextActionFn = &daNpc_zrC_c::test; } else { switch (mType) { case 1: - mpNextActionFn = &waitSick; + mpNextActionFn = &daNpc_zrC_c::waitSick; break; case 2: - mpNextActionFn = &waitPray; + mpNextActionFn = &daNpc_zrC_c::waitPray; break; case 3: - mpNextActionFn = &waitThrone; + mpNextActionFn = &daNpc_zrC_c::waitThrone; break; default: - mpNextActionFn = &wait; + mpNextActionFn = &daNpc_zrC_c::wait; break; } } @@ -1147,17 +1151,18 @@ void daNpc_zrC_c::doNormalAction(BOOL param_0) { /* 80B90D48-80B9113C 003228 03F4+00 1/1 0/0 0/0 .text doEvent__11daNpc_zrC_cFv */ // NONMATCHING minor regalloc BOOL daNpc_zrC_c::doEvent() { + dEvent_manager_c* event_mgr = NULL; BOOL ret = 0; if (dComIfGp_event_runCheck() != FALSE) { - dEvent_manager_c& event_mgr = dComIfGp_getEventManager(); + event_mgr = &dComIfGp_getEventManager(); if ((eventInfo.checkCommandTalk() || eventInfo.checkCommandDemoAccrpt()) && !mSpeakEvent) { mOrderNewEvt = false; } if (eventInfo.checkCommandTalk()) { - if (chkAction(&talk)) { + if (chkAction(&daNpc_zrC_c::talk)) { (this->*mpActionFn)(NULL); } else if (dComIfGp_event_chkTalkXY()) { if (dComIfGp_evmng_ChkPresentEnd()) { @@ -1174,7 +1179,7 @@ BOOL daNpc_zrC_c::doEvent() { } } } else { - setAction(&talk); + setAction(&daNpc_zrC_c::talk); } ret = TRUE; @@ -1184,18 +1189,20 @@ BOOL daNpc_zrC_c::doEvent() { mItemID = -1; } - int staff_id = event_mgr.getMyStaffId(l_myName, NULL, 0); + int staff_id = event_mgr->getMyStaffId(l_myName, NULL, 0); if (staff_id != -1) { mStaffID = staff_id; - int act_idx = event_mgr.getMyActIdx(staff_id, mEvtCutNameList, 2, 0, 0); - if ((this->*mEvtCutList[act_idx])(staff_id)) { - event_mgr.cutEnd(staff_id); + int evtCutNo = event_mgr->getMyActIdx(staff_id, mEvtCutNameList, 2, 0, 0); + JUT_ASSERT(0x8ca, (0 <= evtCutNo) && (evtCutNo < NUM_EVT_CUTS_e)); + JUT_ASSERT(0x8cb, 0 != mEvtCutList[evtCutNo]); + if ((this->*mEvtCutList[evtCutNo])(staff_id)) { + event_mgr->cutEnd(staff_id); } ret = TRUE; } if (eventInfo.checkCommandDemoAccrpt() && mEventIdx != -1 - && event_mgr.endCheck(mEventIdx)) { + && event_mgr->endCheck(mEventIdx)) { dComIfGp_event_reset(); mOrderEvtNo = EVT_NONE; mEventIdx = -1; @@ -1203,8 +1210,8 @@ BOOL daNpc_zrC_c::doEvent() { } } - int msg_timer = mMsgTimer; int expression, motion; + int msg_timer = mMsgTimer; if (ctrlMsgAnm(expression, motion, this, FALSE)) { if (!field_0x9eb) { setExpression(expression, -1.0f); diff --git a/src/d/actor/d_a_obj_flag2.cpp b/src/d/actor/d_a_obj_flag2.cpp index b9aaca58b22..61677a04ec9 100644 --- a/src/d/actor/d_a_obj_flag2.cpp +++ b/src/d/actor/d_a_obj_flag2.cpp @@ -12,7 +12,6 @@ #include "d/d_a_obj.h" #include "d/d_cc_d.h" #include "d/d_com_inf_game.h" -#include "dol2asm.h" #ifdef DEBUG class daObjFlag2_Hio_c : public JORReflexible { @@ -428,13 +427,6 @@ static int createSolidHeap(fopAc_ac_c* i_this) { return static_cast(i_this)->createHeap(); } -/* ############################################################################################## */ -/* 80BEE1E8-80BEE1E8 00010C 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80BEE212 = "FlagObj%02d"; -#pragma pop - /* 80BED6A0-80BED7A4 0010C0 0104+00 1/1 0/0 0/0 .text create__12daObjFlag2_cFv */ int daObjFlag2_c::create() { fopAcM_SetupActor(this, daObjFlag2_c); @@ -461,9 +453,6 @@ int daObjFlag2_c::create() { return rv; } -/* 80BED7A4-80BED9C4 0011C4 0220+00 1/1 0/0 0/0 .text __ct__12daObjFlag2_cFv */ -daObjFlag2_c::daObjFlag2_c() {} - /* 80BEDCE0-80BEDDA0 001700 00C0+00 1/1 0/0 0/0 .text draw__12daObjFlag2_cFv */ int daObjFlag2_c::draw() { g_env_light.settingTevStruct(0x10, ¤t.pos, &tevStr); diff --git a/src/d/actor/d_a_obj_flag3.cpp b/src/d/actor/d_a_obj_flag3.cpp index 56820b5154f..c9ab66e3ec8 100644 --- a/src/d/actor/d_a_obj_flag3.cpp +++ b/src/d/actor/d_a_obj_flag3.cpp @@ -9,10 +9,8 @@ #include "JSystem/J3DGraphBase/J3DDrawBuffer.h" #include "d/actor/d_a_set_bgobj.h" #include "d/d_com_inf_game.h" -#include "dol2asm.h" #include "d/d_a_obj.h" -#ifdef DEBUG class daObjFlag3_Hio_c : public JORReflexible { public: daObjFlag3_Hio_c() { @@ -51,7 +49,6 @@ class daObjFlag3_Hio_c : public JORReflexible { }; daObjFlag3_Hio_c M_hio; -#endif /* 80BF0458-80BF046C 000000 0014+00 3/3 0/0 0/0 .rodata M_attr__12daObjFlag3_c */ daObjFlag3_Attr_c const daObjFlag3_c::M_attr = { @@ -123,15 +120,24 @@ inline cXyz FlagCloth2_c::calcFlagFactor(cXyz* param_1, cXyz* param_2, cXyz* par } f32 fVar1; if (abs(*pRelPosIdx - param_4) == 1 || abs(*pRelPosIdx - param_4) == 6) { - fVar1 = 84.85281; - } else { fVar1 = 60.0f; + } else { + fVar1 = 84.85281f; } calcFlagFactorSub(param_1 + param_4, param_1 + *pRelPosIdx, &flagFactor, fVar1); } return flagFactor; } +inline void FlagCloth2_c::calcFlagFactorSub(cXyz* param_1, cXyz* param_2, cXyz* param_3, f32 param_4) { + cXyz acStack_2c = *param_2 - *param_1; + param_4 = acStack_2c.abs() - param_4; + cXyz cStack_38 = acStack_2c.normZC(); + param_4 *= mSpringRate; + cStack_38 *= param_4; + *param_3 += cStack_38; +} + /* 80BEEF74-80BEF278 000574 0304+00 2/2 0/0 0/0 .text calcFlagNormal__12FlagCloth2_cFP4cXyzi */ inline void FlagCloth2_c::calcFlagNormal(cXyz* param_1, int param_2) { cXyz* pPos = getPos(); @@ -204,7 +210,7 @@ inline void FlagCloth2_c::calcFlagNormal(cXyz* param_1, int param_2) { param_1->set(cStack_74); } -static void initCcSphereDummy() { +void FlagCloth2_c::initCcSphere(fopAc_ac_c*) { const static dCcD_SrcSph ccSphSrc = { { {0x0, {{0x0, 0x0, 0x0}, {0x10000, 0x11}, 0x0}}, // mObj @@ -218,6 +224,83 @@ static void initCcSphereDummy() { }; } +/* 80BF00A0-80BF0434 0016A0 0394+00 1/0 0/0 0/0 .text draw__12FlagCloth2_cFv */ +inline void FlagCloth2_c::draw() { + j3dSys.reinitGX(); + GXSetNumIndStages(0); + dKy_setLight_again(); + dKy_GxFog_tevstr_set(&mTevStr); + dKy_setLight_mine(&mTevStr); + g_env_light.settingTevStruct(0x10, mpFlagPosition, &mTevStr); + GXClearVtxDesc(); + GXSetVtxDesc(GX_VA_POS, GX_INDEX8); + GXSetVtxDesc(GX_VA_NRM, GX_INDEX8); + GXSetVtxDesc(GX_VA_TEX0, GX_INDEX8); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_F32, 0); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_NRM, GX_CLR_RGB, GX_F32, 0); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_F32, 0); + GXSetArray(GX_VA_POS, getPos(), sizeof(cXyz)); + GXSetArray(GX_VA_NRM, getNormal(), sizeof(cXyz)); + GXSetArray(GX_VA_TEX0, mTexCoord, 8); + GXSetZCompLoc(GX_FALSE); + GXSetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE); + GXLoadTexObj(&mTexObj, GX_TEXMAP0); + GXSetNumChans(1); + GXSetChanCtrl(GX_COLOR0, GX_TRUE, GX_SRC_REG, GX_SRC_REG, 0xff, GX_DF_CLAMP, GX_AF_SPOT); + GXSetNumTexGens(1); + GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 0x3c); + GXSetNumTevStages(1); + GXSetTevSwapMode(GX_TEVSTAGE0, GX_TEV_SWAP0, GX_TEV_SWAP0); + dKy_Global_amb_set(&mTevStr); + GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0); + GXSetTevColor(GX_TEVREG0, (GXColor){0, 0, 0, 0xff}); + GXSetTevKColor(GX_KCOLOR0, (GXColor){0, 0, 0, 0xff}); + GXSetTevKColorSel(GX_TEVSTAGE0, GX_TEV_KCSEL_K0); + GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_KONST, GX_CC_TEXC, GX_CC_RASC, GX_CC_C0); + GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_4, GX_TRUE, GX_TEVPREV); + GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_KONST, GX_CA_TEXA, GX_CA_ZERO); + GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); + GXSetTevKAlphaSel(GX_TEVSTAGE0, GX_TEV_KASEL_K3_A); + GXSetAlphaCompare(GX_GREATER, 0, GX_AOP_OR, GX_GREATER, 0); + Mtx viewModelMtx; + cMtx_concat(j3dSys.getViewMtx(), mModelMtx, viewModelMtx); + GXLoadPosMtxImm(viewModelMtx, 0); + GXLoadNrmMtxImm(viewModelMtx, 0); + GXSetClipMode(GX_CLIP_ENABLE); + GXSetCullMode(GX_CULL_BACK); + + for (int i = 0; i < 5; i++) { + GXBegin(GX_TRIANGLESTRIP, GX_VTXFMT0, 12); + for (int j = 0; j < 6; j++) { + GXPosition1x8(i + j * 6); + GXPosition1x8(i + j * 6); + GXTexCoord1x8(i + j * 6); + GXPosition1x8(i + j * 6 + 1); + GXPosition1x8(i + j * 6 + 1); + GXTexCoord1x8(i + j * 6 + 1); + } + GXEnd(); + } + + GXSetArray(GX_VA_NRM, getNormalBack(), sizeof(cXyz)); + GXSetCullMode(GX_CULL_FRONT); + + for (int i = 0; i < 5; i++) { + GXBegin(GX_TRIANGLESTRIP, GX_VTXFMT0, 12); + for (int j = 0; j < 6; j++) { + GXPosition1x8(i + j * 6); + GXPosition1x8(i + j * 6); + GXTexCoord1x8(i + j * 6); + GXPosition1x8(i + j * 6 + 1); + GXPosition1x8(i + j * 6 + 1); + GXTexCoord1x8(i + j * 6 + 1); + } + GXEnd(); + } + + J3DShape::resetVcdVatCache(); +} + /* 80BEEA78-80BEEC3C 000078 01C4+00 1/1 0/0 0/0 .text createHeap__12daObjFlag3_cFv */ int daObjFlag3_c::createHeap() { s8 flagNum = (u8)shape_angle.x; @@ -287,17 +370,10 @@ int daObjFlag3_c::execute() { #endif mFlagCloth.execute(); - eyePos = mFlagCloth.getTargetPos(); + eyePos.set(mFlagCloth.getTargetPos()); return 1; } -inline void FlagCloth2_c::calcFlagNormalBack() { - cXyz* pNormal = getNormal(); - cXyz* pNormalBack = getNormalBack(); - for (int i = 0; i < 36; pNormal++, pNormalBack++, i++) { - pNormalBack->set(-pNormal->x, -pNormal->y, -pNormal->z); - } -} /* 80BEEDE4-80BEEF74 0003E4 0190+00 1/1 0/0 0/0 .text execute__12FlagCloth2_cFv */ void FlagCloth2_c::execute() { @@ -391,7 +467,7 @@ int daObjFlag3_c::create() { return rv; } -void daObjFlag3_c::initBaseMtx() { +inline void daObjFlag3_c::initBaseMtx() { mDoMtx_stack_c::transS(current.pos); mModel->setBaseTRMtx(mDoMtx_stack_c::get()); fopAcM_SetMtx(this, mModel->getBaseTRMtx()); @@ -411,7 +487,7 @@ void daObjFlag3_c::create_init() { mFlagCloth.setGravity(attr().mGravity); mFlagCloth.setTornado(attr().mTornado); initBaseMtx(); - + #ifdef DEBUG M_hio.ct(); #endif @@ -442,7 +518,7 @@ void FlagCloth2_c::initFlagPos(cXyz* param_0, fopAc_ac_c* param_1) { dVar7 += 60.0f; dVar8 = 0.0f; } - + cXyz* pNormal = getNormal(); for (int i = 0; i < 36; i++, pNormal++) { calcFlagNormal(pNormal, i); @@ -451,83 +527,6 @@ void FlagCloth2_c::initFlagPos(cXyz* param_0, fopAc_ac_c* param_1) { initTexCoord(); } -/* 80BF00A0-80BF0434 0016A0 0394+00 1/0 0/0 0/0 .text draw__12FlagCloth2_cFv */ -void FlagCloth2_c::draw() { - j3dSys.reinitGX(); - GXSetNumIndStages(0); - dKy_setLight_again(); - dKy_GxFog_tevstr_set(&mTevStr); - dKy_setLight_mine(&mTevStr); - g_env_light.settingTevStruct(0x10, mpFlagPosition, &mTevStr); - GXClearVtxDesc(); - GXSetVtxDesc(GX_VA_POS, GX_INDEX8); - GXSetVtxDesc(GX_VA_NRM, GX_INDEX8); - GXSetVtxDesc(GX_VA_TEX0, GX_INDEX8); - GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_F32, 0); - GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_NRM, GX_CLR_RGB, GX_F32, 0); - GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_F32, 0); - GXSetArray(GX_VA_POS, getPos(), sizeof(cXyz)); - GXSetArray(GX_VA_NRM, getNormal(), sizeof(cXyz)); - GXSetArray(GX_VA_TEX0, mTexCoord, 8); - GXSetZCompLoc(GX_FALSE); - GXSetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE); - GXLoadTexObj(&mTexObj, GX_TEXMAP0); - GXSetNumChans(1); - GXSetChanCtrl(GX_COLOR0, GX_TRUE, GX_SRC_REG, GX_SRC_REG, 0xff, GX_DF_CLAMP, GX_AF_SPOT); - GXSetNumTexGens(1); - GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, 0x3c); - GXSetNumTevStages(1); - GXSetTevSwapMode(GX_TEVSTAGE0, GX_TEV_SWAP0, GX_TEV_SWAP0); - dKy_Global_amb_set(&mTevStr); - GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0); - GXSetTevColor(GX_TEVREG0, (GXColor){0, 0, 0, 0xff}); - GXSetTevKColor(GX_KCOLOR0, (GXColor){0, 0, 0, 0xff}); - GXSetTevKColorSel(GX_TEVSTAGE0, GX_TEV_KCSEL_K0); - GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_KONST, GX_CC_TEXC, GX_CC_RASC, GX_CC_C0); - GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_4, GX_TRUE, GX_TEVPREV); - GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_KONST, GX_CA_TEXA, GX_CA_ZERO); - GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); - GXSetTevKAlphaSel(GX_TEVSTAGE0, GX_TEV_KASEL_K3_A); - GXSetAlphaCompare(GX_GREATER, 0, GX_AOP_OR, GX_GREATER, 0); - Mtx viewModelMtx; - cMtx_concat(j3dSys.getViewMtx(), mModelMtx, viewModelMtx); - GXLoadPosMtxImm(viewModelMtx, 0); - GXLoadNrmMtxImm(viewModelMtx, 0); - GXSetClipMode(GX_CLIP_ENABLE); - GXSetCullMode(GX_CULL_BACK); - - for (int i = 0; i < 5; i++) { - GXBegin(GX_TRIANGLESTRIP, GX_VTXFMT0, 12); - for (int j = 0; j < 6; j++) { - GXPosition1x8(i + j * 6); - GXPosition1x8(i + j * 6); - GXTexCoord1x8(i + j * 6); - GXPosition1x8(i + j * 6 + 1); - GXPosition1x8(i + j * 6 + 1); - GXTexCoord1x8(i + j * 6 + 1); - } - GXEnd(); - } - - GXSetArray(GX_VA_NRM, getNormalBack(), sizeof(cXyz)); - GXSetCullMode(GX_CULL_FRONT); - - for (int i = 0; i < 5; i++) { - GXBegin(GX_TRIANGLESTRIP, GX_VTXFMT0, 12); - for (int j = 0; j < 6; j++) { - GXPosition1x8(i + j * 6); - GXPosition1x8(i + j * 6); - GXTexCoord1x8(i + j * 6); - GXPosition1x8(i + j * 6 + 1); - GXPosition1x8(i + j * 6 + 1); - GXTexCoord1x8(i + j * 6 + 1); - } - GXEnd(); - } - - J3DShape::resetVcdVatCache(); -} - /* 80BF058C-80BF05AC -00001 0020+00 1/0 0/0 0/0 .data l_daObjFlag3_Method */ static actor_method_class l_daObjFlag3_Method = { (process_method_func)daObjFlag3_Create, diff --git a/src/d/actor/d_a_obj_ito.cpp b/src/d/actor/d_a_obj_ito.cpp index 0fbaae8b7fc..1aacb8c7584 100644 --- a/src/d/actor/d_a_obj_ito.cpp +++ b/src/d/actor/d_a_obj_ito.cpp @@ -60,13 +60,14 @@ static int daObj_Ito_Draw(obj_ito_class* i_this) { /* 8047B504-8047B9A4 000304 04A0+00 1/1 0/0 0/0 .text cut_line_calc__FP13obj_ito_classP5ito_si */ static void cut_line_calc(obj_ito_class* i_this, ito_s* param_2, int param_3) { - // NONMATCHING + int i; fopAc_ac_c* a_this = &i_this->actor; obj_gm_class* actor_p = (obj_gm_class*)fopAcM_SearchByID(a_this->parentActorID); dBgS_GndChk gnd_chk; + Vec i_pos; cXyz sp104, sp110; cXyz* pos = param_2->mLineMat.getPos(param_3); - f32* pfVar1 = ¶m_2->field_0x1c[param_3 * 20] + 1; + f32* pfVar1 = ¶m_2->field_0x1c[param_3][0] + 1; f32 fVar1 = param_2->field_0x254 - 30.0f; cXyz sp11c(0.0f, 0.0f, 0.0f); cXyz sp128; @@ -81,16 +82,16 @@ static void cut_line_calc(obj_ito_class* i_this, ito_s* param_2, int param_3) { param_2->field_0x244[param_3]++; cLib_addCalc0(¶m_2->field_0x258, 0.1f, XREG_F(1) + 0.5f); + pos++; f32 fVar2 = 0.0f; f32 fVar3 = 0.0f; BOOL bVar1 = false; cXyz sp140; - sp104.z = 0.0f; - sp104.y = 0.0f; - + sp104.y = sp104.z = 0.0f; + if (actor_p != NULL && actor_p->field_0x60a == 1) { bVar1 = true; - cMtx_YrotS(*calc_mtx, actor_p->field_0x64c[param_3 * (hREG_S(3) + 18000)]); + cMtx_YrotS(*calc_mtx, actor_p->field_0x64c[0] + param_3 * (hREG_S(3) + 18000)); sp104.x = hREG_F(8) + 2.0f; MtxPosition(&sp104, &sp140); } @@ -98,8 +99,7 @@ static void cut_line_calc(obj_ito_class* i_this, ito_s* param_2, int param_3) { sp104.x = 0.0f; sp104.z = param_2->field_0x250 * (1.0f - param_3 * 0.03f); - cXyz* pcVar1; - for (int i = 1; pcVar1 = pos + 1, i < 20; i++, pfVar1++, pos = pcVar1) { + for (i = 1; i < 20; i++, pos++, pfVar1++) { sp134.x = param_2->field_0x258 * cM_ssin((XREG_S(0) + 2500) * param_2->field_0x244[param_3] + i * (XREG_S(1) + 8000)); sp134.z = param_2->field_0x258 * cM_ssin((XREG_S(2) + 2000) * param_2->field_0x244[param_3] + i * (XREG_S(3) + 7000)); @@ -108,32 +108,33 @@ static void cut_line_calc(obj_ito_class* i_this, ito_s* param_2, int param_3) { fVar2 = sp140.z * cM_ssin(i * (hREG_S(2) + 4000)); } - sp128 = sp11c * (16 - i); - f32 fVar4 = fVar3 + sp128.x + sp134.x + (pcVar1->x - pos->x); - f32 fVar5 = fVar2 + sp128.z + sp134.z + (pos[1].z - pos->z); - f32 fVar6 = sp128.y + pos[1].y + fVar1; + sp128 = sp11c * (21 - i); + f32 var_f26; + f32 var_f31 = pos[0].x - pos[-1].x + sp134.x + sp128.x + fVar3; + f32 var_f30 = pos[0].z - pos[-1].z + sp134.z + sp128.z + fVar2; + f32 var_f29 = pos[0].y + fVar1 + sp128.y; - if (fVar6 < *pfVar1) { - fVar6 = *pfVar1; + if (var_f29 < *pfVar1) { + var_f29 = *pfVar1; } - f32 fVar7 = pos->y; + var_f26 = var_f29 - pos[-1].y; - cMtx_YrotS(*calc_mtx, cM_atan2s(fVar4, fVar5)); - cMtx_XrotM(*calc_mtx, -cM_atan2s(fVar6 * fVar7, JMAFastSqrt(fVar4 * fVar4 + fVar5 * fVar5))); + cMtx_YrotS(*calc_mtx, cM_atan2s(var_f31, var_f30)); + cMtx_XrotM(*calc_mtx, -cM_atan2s(var_f26, JMAFastSqrt(var_f31 * var_f31 + var_f30 * var_f30))); MtxPosition(&sp104, &sp110); - pcVar1->x = pos->x + sp110.x; - pos[1].y = pos->y + sp110.y; - pos[1].z = pos->z + sp110.z; + pos[0].x = pos[-1].x + sp110.x; + pos[0].y = pos[-1].y + sp110.y; + pos[0].z = pos[-1].z + sp110.z; if ((i_this->field_0x60c + i & 15) == 0) { - Vec* i_pos = pcVar1; - i_pos->y += 200.0f; - gnd_chk.SetPos(i_pos); + i_pos = pos[0]; + i_pos.y += 200.0f; + gnd_chk.SetPos(&i_pos); *pfVar1 = dComIfG_Bgsp().GroundCross(&gnd_chk) + 5.0f; - if (*pfVar1 - pos[1].y > 200.0f) { - *pfVar1 = pos[1].y; + if (pfVar1[0] - pos[0].y > 200.0f) { + pfVar1[0] = pos[0].y; } } } @@ -141,7 +142,6 @@ static void cut_line_calc(obj_ito_class* i_this, ito_s* param_2, int param_3) { /* 8047B9E0-8047BAF8 0007E0 0118+00 1/1 0/0 0/0 .text cut_line__FP13obj_ito_class */ static void cut_line(obj_ito_class* i_this) { - // NONMATCHING fopAc_ac_c* a_this = &i_this->actor; obj_gm_class* actor_p = (obj_gm_class*)fopAcM_SearchByID(a_this->parentActorID); @@ -215,12 +215,11 @@ static void cut_set(obj_ito_class* i_this, int param_2) { /* 8047BF8C-8047C034 000D8C 00A8+00 1/1 0/0 0/0 .text ito_end__FP5ito_s */ static void ito_end(ito_s* i_this) { - // NONMATCHING cLib_addCalc0(&i_this->field_0x250, 1.0f, 1.0f); for (int i = 0; i < 6; i++) { cXyz* pcVar1 = i_this->mLineMat.getPos(i); - f32* pfVar1 = &i_this->field_0x1c[i * 20]; + f32* pfVar1 = &i_this->field_0x1c[i][0]; for (int j = 0; j < 20; j++, pcVar1++, pfVar1++) { pcVar1->y -= 10.0f; @@ -234,7 +233,6 @@ static void ito_end(ito_s* i_this) { /* 8047C034-8047CEE4 000E34 0EB0+00 1/1 0/0 0/0 .text action__FP13obj_ito_class */ static void action(obj_ito_class* i_this) { - // NONMATCHING fopAc_ac_c* a_this = (fopAc_ac_c*)&i_this->actor; obj_gm_class* actor_p = (obj_gm_class*)fopAcM_SearchByID(a_this->parentActorID); if (actor_p == NULL) { @@ -271,7 +269,7 @@ static void action(obj_ito_class* i_this) { } s16 sVar1 = -cM_atan2s(spe8.y, spe8.z); - s16 sVar2 = cM_atan2s(spe8.x, JMAFastSqrt(spe8.y * spe8.y + spe8.z * spe8.z)); + s32 sVar2 = cM_atan2s(spe8.x, JMAFastSqrt(spe8.y * spe8.y + spe8.z * spe8.z)); mDoMtx_stack_c::transS(a_this->current.pos.x, a_this->current.pos.y, a_this->current.pos.z); mDoMtx_stack_c::XrotM(sVar1); mDoMtx_stack_c::YrotM(sVar2); @@ -300,6 +298,7 @@ static void action(obj_ito_class* i_this) { i_this->field_0x574[1]->setBaseTRMtx(mDoMtx_stack_c::get()); if (i_this->field_0x1509 != 0) { + cXyz sp17c = i_this->field_0x14f8; i_this->field_0x14f8 = a_this->current.pos + ((i_this->field_0x618 - a_this->current.pos) * i_this->field_0x1504); if (i_this->field_0x1508 == 0) { @@ -342,8 +341,9 @@ static void action(obj_ito_class* i_this) { dComIfG_Ccsp()->Set(&i_this->field_0x678[i]); if (i_this->field_0x678[i].ChkCoHit()) { - if (actor_p != NULL && i_this->field_0x678[i].GetCoHitObj()->GetAc() != actor_p) { - actor_p->field_0xae4 |= 4; + fopAc_ac_c* var_r25 = i_this->field_0x678[i].GetCoHitObj()->GetAc(); + if (actor_p != NULL && var_r25 != actor_p) { + actor_p->field_0xae4 |= 0x4; } } } @@ -362,18 +362,19 @@ static void action(obj_ito_class* i_this) { atInfo.mpCollider = i_this->field_0x678[i].GetTgHitObj(); at_power_check(&atInfo); - if (atInfo.mAttackPower == 0 && !atInfo.mpCollider->ChkAtType(AT_TYPE_BOOMERANG) && !atInfo.mpCollider->ChkAtType(AT_TYPE_HOOKSHOT)) { + if (atInfo.mAttackPower != 0 || + atInfo.mpCollider->ChkAtType(AT_TYPE_BOOMERANG) || + atInfo.mpCollider->ChkAtType(AT_TYPE_HOOKSHOT) || + i_this->field_0x678[i].GetTgHitGObj()->GetAtMtrl() == 1) { if (i_this->field_0x678[i].GetTgHitGObj()->GetAtMtrl() == 1) { - if (i_this->field_0x678[i].GetTgHitGObj()->GetAtMtrl() == 1) { - i_this->field_0x1509 = 1; - i_this->field_0x150a = i + 1; - } else { - iVar1 = i + 1; - } + i_this->field_0x1509 = 1; + i_this->field_0x150a = i + 1; } else { - if (actor_p != NULL) { - actor_p->field_0xae4 |= 4; - } + iVar1 = i + 1; + } + } else { + if (actor_p != NULL) { + actor_p->field_0xae4 |= 4; } } break; @@ -433,19 +434,21 @@ static void action(obj_ito_class* i_this) { cMtx_YrotS(*calc_mtx, a_this->current.angle.y); cMtx_XrotM(*calc_mtx, a_this->current.angle.x); + cXyz* pcVar1; + s16 sVar5; s16 sVar3 = 0; s16 sVar4 = 0; + cXyz* pcVar2; for (int i = 0; i < 6; i++) { - cXyz* pcVar1 = i_this->field_0x103c.mLineMat.getPos(i); + pcVar1 = i_this->field_0x103c.mLineMat.getPos(i); - cXyz* pcVar2; if (i_this->field_0x570 == 0) { - pcVar2 = actor_p->field_0x684; + pcVar2 = &actor_p->field_0x684[i]; } else { - pcVar2 = actor_p->field_0x6cc; + pcVar2 = &actor_p->field_0x6cc[i]; } - pcVar2 += i; + cXyz sp10c; if (i_this->field_0x610 == 0) { cXyz sp118, sp124; @@ -469,10 +472,10 @@ static void action(obj_ito_class* i_this) { } } - cXyz sp10c = (i_this->field_0x103c.field_0x1fc[i] - *pcVar2) * 0.05263158f; + sp10c = (i_this->field_0x103c.field_0x1fc[i] - *pcVar2) * 0.05263158f; f32 fVar1 = (TREG_F(9) + 20.0f) * a_this->scale.x; f32 fVar2 = fVar1 * ((TREG_F(14) + 1.0f + 1.0f) / 19.0f); - s16 sVar5 = TREG_S(7) + i * 0x2AAA + 22000; + sVar5 = TREG_S(7) + i * 0x2AAA + 22000; if (actor_p != NULL) { sVar3 = actor_p->field_0x64c[0]; @@ -481,7 +484,7 @@ static void action(obj_ito_class* i_this) { spe8.x = 0.0f; spe8.y = 0.0f; - for (int j = 0; j < 20; j++) { + for (int j = 0; j < 20; j++, pcVar1++) { spe8.z = fVar1; MtxPush(); cMtx_YrotM(*calc_mtx, sVar5 + sVar3); @@ -499,8 +502,6 @@ static void action(obj_ito_class* i_this) { *i_this->field_0x1298.mLineMat.getPos(i) = *pcVar1; } } - - pcVar1++; } } @@ -562,7 +563,6 @@ static int daObj_Ito_Delete(obj_ito_class* i_this) { /* 8047D024-8047D1D8 001E24 01B4+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */ static int useHeapInit(fopAc_ac_c* a_this) { - // NONMATCHING obj_ito_class* i_this = (obj_ito_class*)a_this; J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("OBJ_ITO", 3); @@ -584,8 +584,9 @@ static int useHeapInit(fopAc_ac_c* a_this) { return 0; } + f32* pfVar1; for (int i = 0; i < 6; i++) { - f32* pfVar1 = i_this->field_0x103c.mLineMat.getSize(i); + pfVar1 = i_this->field_0x103c.mLineMat.getSize(i); f32 fVar1 = cM_rndF(0.3f) + 0.4f; for (int j = 0; j < 20; j++, pfVar1++) { *pfVar1 = fVar1; @@ -666,7 +667,7 @@ static cPhs__Step daObj_Ito_Create(fopAc_ac_c* a_this) { a_this->scale.x = obj_size[i_this->field_0x571]; if (fopAcM_GetRoomNo(a_this) == 4) { - i_this->field_0x618.set(-5347.0f, hREG_F(1) + 4520.0f + 400.0f, -2342.0f); + i_this->field_0x618.set(-5374.0f, hREG_F(1) + 4520.0f + 400.0f, -2342.0f); } else { cXyz sp9c, spa8; cMtx_YrotS(*calc_mtx, a_this->current.angle.y); diff --git a/src/d/actor/d_a_obj_movebox.cpp b/src/d/actor/d_a_obj_movebox.cpp index 0ccadd29ae1..06ccd046c36 100644 --- a/src/d/actor/d_a_obj_movebox.cpp +++ b/src/d/actor/d_a_obj_movebox.cpp @@ -1025,6 +1025,10 @@ void daObjMovebox::Act_c::mode_afl() { daObj::posMoveF_stream(this, NULL, &cXyz::Zero, viscosity_resistance, inertia_resistance); } +static void dummy() { + delete (dBgS_ObjGndChk*)NULL; +} + void daObjMovebox::Act_c::mode_proc_call() { typedef void (daObjMovebox::Act_c::*modeFunc)(); static modeFunc mode_proc[] = { diff --git a/src/d/actor/d_a_obj_wchain.cpp b/src/d/actor/d_a_obj_wchain.cpp index b143d4e4043..909c6277a29 100644 --- a/src/d/actor/d_a_obj_wchain.cpp +++ b/src/d/actor/d_a_obj_wchain.cpp @@ -130,9 +130,10 @@ s16 daObjWchain_c::getChainAngleZ(cXyz* param_0, int param_1) { } /* 80D3080C-80D310AC 00098C 08A0+00 1/1 0/0 0/0 .text setChainPos__13daObjWchain_cFv */ -// NONMATCHING regalloc, instruction ordering +// NONMATCHING instruction ordering void daObjWchain_c::setChainPos() { cXyz prev_pos, vec1; + if (mRide) { shape_angle.y = daPy_getLinkPlayerActorClass()->shape_angle.y; shape_angle.z = 0; @@ -149,13 +150,19 @@ void daObjWchain_c::setChainPos() { mDoMtx_stack_c::ZXYrotM(shape_angle.x, shape_angle.y, shape_angle.z); static Vec const currentOffset = {0.0f, 0.0f, -53.75f}; mDoMtx_stack_c::multVec(¤tOffset, ¤t.pos); - cXyz* chain_pos = &mChainPos[0xf]; - csXyz* chain_angle = &mChainAngle[0xf]; - cXyz* chain_speed = &mChainSpeed[0xf]; - s16* chain_rotation = &mChainRotation[0xf]; + + csXyz* chain_angle; + cXyz* chain_speed; + cXyz* chain_pos; + int i; + s16* chain_rotation; + chain_pos = &mChainPos[0xf]; + chain_angle = &mChainAngle[0xf]; + chain_speed = &mChainSpeed[0xf]; + chain_rotation = &mChainRotation[0xf]; prev_pos = current.pos; int svar7 = shape_angle.z; - for (int i = 0xf; i >= 0; i--, chain_pos--, chain_angle--, chain_speed--, chain_rotation--) { + for (i = 0xf; i >= 0; i--, chain_pos--, chain_angle--, chain_speed--, chain_rotation--) { chain_angle->z += getChainAngleZ(chain_speed, abs((s16)(chain_angle->z - svar7))); *chain_speed = (prev_pos - *chain_pos) * 0.75; *chain_pos = prev_pos; @@ -187,9 +194,15 @@ void daObjWchain_c::setChainPos() { int local_68 = fvar2 * (1.0f / 17.5f); int ivar5 = local_68 <= 0xf ? local_68 + 1 : 0x10; int chain_no = 0x10 - ivar5; - cXyz* chain_pos = &mChainPos[chain_no]; - csXyz* chain_angle = &mChainAngle[chain_no]; - s16* chain_rotation = &mChainRotation[chain_no]; + + s16* chain_rotation; + cXyz* chain_speed; + cXyz* chain_pos; + csXyz* chain_angle; + + chain_pos = &mChainPos[chain_no]; + chain_angle = &mChainAngle[chain_no]; + chain_rotation = &mChainRotation[chain_no]; chain_pos->set( mRoofPos.x, field_0x7a8 + (mRoofPos.y - (17.5f - (ivar5 * 17.5f - fvar2))), @@ -199,7 +212,7 @@ void daObjWchain_c::setChainPos() { *chain_rotation = 0; chain_pos = mChainPos + 1 + chain_no; chain_angle++; - cXyz* chain_speed = mChainSpeed + 1 + chain_no; + chain_speed = mChainSpeed + 1 + chain_no; chain_rotation++; mDoMtx_stack_c::YrotS(-shape_angle.y); f32 prob = 0.2f; diff --git a/src/d/actor/d_a_obj_web0.cpp b/src/d/actor/d_a_obj_web0.cpp index e4590179f85..aa973d86ced 100644 --- a/src/d/actor/d_a_obj_web0.cpp +++ b/src/d/actor/d_a_obj_web0.cpp @@ -9,7 +9,7 @@ #include "SSystem/SComponent/c_math.h" #include "d/actor/d_a_player.h" #include "d/d_bg_w.h" -#include "dol2asm.h" +#include "d/d_s_play.h" #include "f_op/f_op_actor_mng.h" #include "global.h" @@ -74,6 +74,8 @@ static void damage_check(obj_web0_class* i_this) { /* 80D34794-80D34B24 000354 0390+00 2/1 0/0 0/0 .text daObj_Web0_Execute__FP14obj_web0_class */ // NONMATCHING - reg alloc static int daObj_Web0_Execute(obj_web0_class* i_this) { + u32 sp0C; + s16 sp08; fopAc_ac_c* player = dComIfGp_getPlayer(0); i_this->field_0x57c++; @@ -90,10 +92,10 @@ static int daObj_Web0_Execute(obj_web0_class* i_this) { if (i_this->mDeleteTimer != 0) { if (i_this->mDeleteTimer == 1) { - cXyz sp30(i_this->scale); - sp30.z = 1.0f; + cXyz sp20(i_this->scale); + sp20.z = 1.0f; - dComIfGp_particle_set(0x840C, &i_this->current.pos, &i_this->shape_angle, &sp30); + dComIfGp_particle_set(0x840C, &i_this->current.pos, &i_this->shape_angle, &sp20); i_this->mpBrk->setPlaySpeed(1.0f); } else if (i_this->mDeleteTimer == 41) { i_this->mpBrk->setPlaySpeed(1.0f); @@ -102,7 +104,8 @@ static int daObj_Web0_Execute(obj_web0_class* i_this) { fopAcM_seStartLevel(i_this, Z2SE_OBJ_WEB_BURN, 0); if (i_this->mDeleteTimer == 40 || i_this->mDeleteTimer == 80) { - dComIfGs_onSwitch(fopAcM_GetParam(i_this) >> 0x18, fopAcM_GetRoomNo(i_this)); + sp0C = (fopAcM_GetParam(i_this) & 0xff000000) >> 24; + dComIfGs_onSwitch(sp0C, fopAcM_GetRoomNo(i_this)); fopAcM_delete(i_this); } @@ -112,8 +115,8 @@ static int daObj_Web0_Execute(obj_web0_class* i_this) { } mDoMtx_stack_c::transS(i_this->current.pos.x, i_this->current.pos.y, i_this->current.pos.z); - mDoMtx_stack_c::YrotM(i_this->shape_angle.y); - mDoMtx_stack_c::ZrotM(i_this->shape_angle.z); + mDoMtx_stack_c::YrotM((s16)i_this->shape_angle.y); + mDoMtx_stack_c::ZrotM((s16)i_this->shape_angle.z); mDoMtx_stack_c::scaleM(i_this->scale.x, i_this->scale.y, i_this->scale.z); i_this->mpBrk->play(); @@ -123,33 +126,35 @@ static int daObj_Web0_Execute(obj_web0_class* i_this) { i_this->mReboundTimer--; } - i_this->scale.z = i_this->mReboundTimer * cM_ssin(i_this->mReboundTimer * 0x1900) * 0.075f; + i_this->scale.z = + i_this->mReboundTimer * cM_ssin(i_this->mReboundTimer * 0x1900) * (0.075f + TREG_F(0)); - s16 tmp = (fopAcM_searchPlayerAngleY(i_this) + 0x4000) - i_this->shape_angle.y; - if (tmp < 0) { + s16 playerAngle = fopAcM_searchPlayerAngleY(i_this); + sp08 = (playerAngle + 0x4000) - i_this->shape_angle.y; + if (sp08 < 0) { mDoMtx_stack_c::YrotM(-0x8000); } MTXCopy(mDoMtx_stack_c::get(), i_this->mMtx); i_this->mpBgW->Move(); - cXyz sp3C(i_this->current.pos); + cXyz sp14(i_this->current.pos); if (i_this->field_0x57c & 1) { - sp3C.y -= i_this->scale.x * 70.0f; + sp14.y -= i_this->scale.x * 70.0f; } - s16 svar9 = i_this->shape_angle.y; - if (tmp < 0) { - svar9 += -0x8000; + s16 var_r28 = i_this->shape_angle.y; + if (sp08 < 0) { + var_r28 += -0x8000; } - svar9 -= player->shape_angle.y; - if ((svar9 < 20000 && svar9 > -20000) || i_this->mHitTimer != 0) { - sp3C.x += 20000.0f; + var_r28 -= player->shape_angle.y; + if ((var_r28 < 20000 && var_r28 > -20000) || i_this->mHitTimer != 0) { + sp14.x += 20000.0f; } - i_this->mSphCc.SetC(sp3C); - i_this->mSphCc.SetR(i_this->scale.x * 150.0f); + i_this->mSphCc.SetC(sp14); + i_this->mSphCc.SetR((150.0f + TREG_F(2)) * i_this->scale.x); dComIfG_Ccsp()->Set(&i_this->mSphCc); return 1; diff --git a/src/d/actor/d_a_tbox.cpp b/src/d/actor/d_a_tbox.cpp index 18a14855296..f659889180a 100644 --- a/src/d/actor/d_a_tbox.cpp +++ b/src/d/actor/d_a_tbox.cpp @@ -601,7 +601,7 @@ void daTbox_c::lightColorProc() { } } - int num_frames = var_r25 - var_r24; + int num_frames = var_r24 - var_r25; s16 step_r = std::fabs(key_color[var_r30 + 1].r - key_color[var_r30].r) / num_frames; s16 step_g = std::fabs(key_color[var_r30 + 1].g - key_color[var_r30].g) / num_frames; s16 step_b = std::fabs(key_color[var_r30 + 1].b - key_color[var_r30].b) / num_frames;