From 9ff0f5029f3b109ef50d2a78bf810ed3420f1b62 Mon Sep 17 00:00:00 2001 From: TakaRikka <38417346+TakaRikka@users.noreply.github.com> Date: Mon, 27 Nov 2023 03:14:06 -0800 Subject: [PATCH] most of d_a_alink_wolf done / some misc (#1993) * wip on alink_wolf * setup procvar unions * most of d_a_alink_wolf done + some misc --- include/Runtime.PPCEABI.H/__va_arg.h | 2 +- include/SSystem/SComponent/c_m3d_g_cyl.h | 1 + include/Z2AudioLib/Z2Creature.h | 1 + include/Z2AudioLib/Z2WolfHowlMgr.h | 6 +- include/d/a/d_a_alink.h | 180 +- include/d/a/d_a_player.h | 65 +- include/d/bg/d_bg_s_acch.h | 1 + include/d/cc/d_cc_d.h | 2 + include/d/com/d_com_inf_game.h | 4 + include/d/d_attention.h | 2 +- include/d/d_cam_param.h | 5 +- include/d/d_camera.h | 83 +- include/d/d_jnt_col.h | 4 +- include/d/d_stage.h | 8 +- include/d/event/d_event.h | 4 + include/d/msg/d_msg_object.h | 10 +- include/d/particle/d_particle_copoly.h | 2 + include/d/save/d_save.h | 1 + include/f_op/f_op_actor.h | 11 +- include/f_op/f_op_actor_iter.h | 8 +- include/m_Do/m_Do_audio.h | 8 + include/m_Do/m_Do_ext.h | 3 + include/rel/d/a/d_a_horse/d_a_horse.h | 1 + include/rel/d/a/d_a_kago/d_a_kago.h | 103 +- include/rel/d/a/d_a_midna/d_a_midna.h | 4 +- include/rel/d/a/e/d_a_e_pm/d_a_e_pm.h | 68 +- include/rel/d/a/e/d_a_e_yc/d_a_e_yc.h | 177 +- .../rel/d/a/kytag/d_a_kytag03/d_a_kytag03.h | 23 +- .../rel/d/a/npc/d_a_npc_gwolf/d_a_npc_gwolf.h | 62 +- include/rel/d/a/npc/d_a_npc_tk/d_a_npc_tk.h | 21 +- .../rel/d/a/obj/d_a_obj_crope/d_a_obj_crope.h | 49 +- .../d/a/obj/d_a_obj_sekizoa/d_a_obj_sekizoa.h | 110 +- .../obj/d_a_obj_smw_stone/d_a_obj_smw_stone.h | 19 +- .../d_a_obj_wind_stone/d_a_obj_wind_stone.h | 24 +- .../a/obj/d_a_obj_yobikusa/d_a_obj_yobikusa.h | 2 +- .../d_a_tag_attack_item/d_a_tag_attack_item.h | 2 +- .../rel/d/a/tag/d_a_tag_howl/d_a_tag_howl.h | 7 +- .../tag/d_a_tag_wara_howl/d_a_tag_wara_howl.h | 2 +- libs/Z2AudioLib/Z2WolfHowlMgr.cpp | 5 +- rel/d/a/d_a_kago/d_a_kago.cpp | 3 +- rel/d/a/e/d_a_e_pm/d_a_e_pm.cpp | 3 +- rel/d/a/e/d_a_e_yc/d_a_e_yc.cpp | 3 +- rel/d/a/kytag/d_a_kytag03/d_a_kytag03.cpp | 3 +- rel/d/a/npc/d_a_npc_gwolf/d_a_npc_gwolf.cpp | 3 +- rel/d/a/npc/d_a_npc_tk/d_a_npc_tk.cpp | 60 +- rel/d/a/obj/d_a_obj_carry/d_a_obj_carry.cpp | 8 +- rel/d/a/obj/d_a_obj_crope/d_a_obj_crope.cpp | 3 +- .../a/obj/d_a_obj_sekizoa/d_a_obj_sekizoa.cpp | 3 +- .../d_a_obj_smw_stone/d_a_obj_smw_stone.cpp | 3 +- .../d_a_obj_wind_stone/d_a_obj_wind_stone.cpp | 3 +- .../d_a_tag_attack_item.cpp | 322 +- rel/d/a/tag/d_a_tag_howl/d_a_tag_howl.cpp | 34 +- src/d/a/d_a_alink.cpp | 614 +- src/d/a/d_a_alink_HIO_data.inc | 6 +- src/d/a/d_a_alink_boom.inc | 6 - src/d/a/d_a_alink_bottle.inc | 24 +- src/d/a/d_a_alink_bow.inc | 12 +- src/d/a/d_a_alink_canoe.inc | 20 +- src/d/a/d_a_alink_copyrod.inc | 20 +- src/d/a/d_a_alink_crawl.inc | 6 +- src/d/a/d_a_alink_cut.inc | 241 +- src/d/a/d_a_alink_damage.inc | 32 +- src/d/a/d_a_alink_demo.inc | 514 +- src/d/a/d_a_alink_effect.inc | 2 +- src/d/a/d_a_alink_grab.inc | 18 +- src/d/a/d_a_alink_hang.inc | 64 +- src/d/a/d_a_alink_hook.inc | 155 +- src/d/a/d_a_alink_horse.inc | 28 +- src/d/a/d_a_alink_hvyboots.inc | 4 +- src/d/a/d_a_alink_iceleaf.inc | 24 +- src/d/a/d_a_alink_ironball.inc | 13 +- src/d/a/d_a_alink_kandelaar.inc | 6 +- src/d/a/d_a_alink_link.inc | 343 +- src/d/a/d_a_alink_spinner.inc | 34 +- src/d/a/d_a_alink_sumou.inc | 14 +- src/d/a/d_a_alink_swim.inc | 64 +- src/d/a/d_a_alink_swindow.inc | 10 +- src/d/a/d_a_alink_whistle.inc | 20 +- src/d/a/d_a_alink_wolf.inc | 5472 +++++++++++++++-- src/d/d_camera.cpp | 59 +- src/d/d_ev_camera.cpp | 442 +- 81 files changed, 7642 insertions(+), 2166 deletions(-) diff --git a/include/Runtime.PPCEABI.H/__va_arg.h b/include/Runtime.PPCEABI.H/__va_arg.h index 64378bddb29..e45e0751dc6 100644 --- a/include/Runtime.PPCEABI.H/__va_arg.h +++ b/include/Runtime.PPCEABI.H/__va_arg.h @@ -28,7 +28,7 @@ void* __va_arg(_va_list_struct*, int); // __builtin_va_info: initialize the __va_list_struct // _var_arg_typeof: convert type to integer for __va_arg #define __va_start(list, fmt) __builtin_va_info(&list) -#define __va_arg(list, type) (*((type*)__va_arg(ap, _var_arg_typeof(type)))) +#define __va_arg(list, type) (*((type*)__va_arg(list, _var_arg_typeof(type)))) #define va_start __va_start #define va_arg __va_arg #define va_end __va_end diff --git a/include/SSystem/SComponent/c_m3d_g_cyl.h b/include/SSystem/SComponent/c_m3d_g_cyl.h index 0d109734fe3..f5d176a734a 100644 --- a/include/SSystem/SComponent/c_m3d_g_cyl.h +++ b/include/SSystem/SComponent/c_m3d_g_cyl.h @@ -32,6 +32,7 @@ class cM3dGCyl { void calcMinMax(cXyz*, cXyz*); const cXyz* GetCP(void) const { return &mCenter; } f32 GetR(void) const { return mRadius; } + f32* GetRP() { return &mRadius; } f32 GetH(void) const { return mHeight; } cXyz& GetC() { return mCenter; } diff --git a/include/Z2AudioLib/Z2Creature.h b/include/Z2AudioLib/Z2Creature.h index 50a4823965b..31e26a5d79e 100644 --- a/include/Z2AudioLib/Z2Creature.h +++ b/include/Z2AudioLib/Z2Creature.h @@ -78,6 +78,7 @@ class Z2CreatureLink : public Z2Creature, public Z2LinkSoundStarter { u8 getLinkState() const { return mLinkState; } u8 getMoveSpeed() const { return mMoveSpeed; } bool isRiding() const { return mRiding; } + void i_setLinkState(u8 i_state) { mLinkState = i_state; } static Z2CreatureLink* mLinkPtr; diff --git a/include/Z2AudioLib/Z2WolfHowlMgr.h b/include/Z2AudioLib/Z2WolfHowlMgr.h index e48633730d5..05faf2fd81a 100644 --- a/include/Z2AudioLib/Z2WolfHowlMgr.h +++ b/include/Z2AudioLib/Z2WolfHowlMgr.h @@ -32,7 +32,7 @@ class Z2WolfHowlMgr : public JASGlobalInstance { f32 getNowPitch(); f32 getNowInputValue(); void calcPitchMod(f32, f32); - void startWolfHowlSound(f32, f32, bool, f32); + s8 startWolfHowlSound(f32, f32, bool, f32); void setCorrectData(s8, Z2WolfHowlData*); SongNote getCorrectLine(u8); u8 getCorrectLineNum(); @@ -42,6 +42,10 @@ class Z2WolfHowlMgr : public JASGlobalInstance { int startGuideMelody(bool); void skipCorrectDemo(); + void setCorrectCurve(s8 i_curve) { setCorrectData(i_curve, NULL); } + u32 getTimer() { return mTimer; } + u8 getReleaseTimer() { return mReleaseTimer; } + private: /* 0x00 */ JAISoundHandle field_0x00; /* 0x04 */ JAISoundHandle field_0x04; diff --git a/include/d/a/d_a_alink.h b/include/d/a/d_a_alink.h index e3df5d0ab6c..992afb7fdfc 100644 --- a/include/d/a/d_a_alink.h +++ b/include/d/a/d_a_alink.h @@ -129,7 +129,6 @@ class daAlink_footData_c { /* 800CFCB8 */ ~daAlink_footData_c(); /* 800CFCF4 */ daAlink_footData_c(); -private: /* 0x00 */ u8 field_0x00[2]; /* 0x02 */ u16 field_0x2; /* 0x04 */ u16 field_0x4; @@ -666,12 +665,22 @@ class daAlink_c : public daPy_py_c { FTANM_UNK_7B = 0x7B, FTANM_UNK_7C = 0x7C, FTANM_UNK_8A = 0x8A, + FTANM_UNK_8D = 0x8D, + FTANM_UNK_8E = 0x8E, + FTANM_UNK_8F = 0x8F, FTANM_UNK_90 = 0x90, + FTANM_UNK_91 = 0x91, + FTANM_UNK_95 = 0x95, FTANM_UNK_96 = 0x96, + FTANM_UNK_97 = 0x97, + FTANM_UNK_9A = 0x9A, + FTANM_UNK_9B = 0x9B, FTANM_UNK_9C = 0x9C, FTANM_UNK_9D = 0x9D, FTANM_UNK_9F = 0x9F, FTANM_UNK_A0 = 0xA0, + FTANM_UNK_A1 = 0xA1, + FTANM_UNK_A2 = 0xA2, }; enum daAlink_WARP_MAT_MODE { @@ -1961,7 +1970,7 @@ class daAlink_c : public daPy_py_c { /* 800E53F8 */ void setGrabItemThrow(); /* 800E57AC */ BOOL checkUpperGrabItemThrow(f32); /* 800E5830 */ void putObjLineCheck(dBgS_LinChk&, cXyz*, fopAc_ac_c*); - /* 800E5B6C */ void grabLineCheck(cXyz*, cXyz*); + /* 800E5B6C */ bool grabLineCheck(cXyz*, cXyz*); /* 800E5BB4 */ void setGrabItemActor(fopAc_ac_c*); /* 800E5CBC */ int procGrabReadyInit(); /* 800E5EC8 */ int procGrabReady(); @@ -2739,8 +2748,8 @@ class daAlink_c : public daPy_py_c { /* 801299A8 */ void checkWolfUseAbility(); /* 80129A80 */ int checkWolfGroundSpecialMode(); /* 80129B44 */ int checkNextActionWolf(int); - /* 8012A02C */ void wolfSideBgCheck(s16); - /* 8012A228 */ void checkWolfAttackReverse(int); + /* 8012A02C */ BOOL wolfSideBgCheck(s16); + /* 8012A228 */ BOOL checkWolfAttackReverse(int); /* 8012A330 */ int checkWolfBarrierHitReverse(); /* 8012A41C */ bool checkWolfBarrierWallHit(cBgS_PolyInfo&); /* 8012A498 */ void wolfBgCheck(); @@ -2748,7 +2757,7 @@ class daAlink_c : public daPy_py_c { /* 8012AD1C */ void setWolfFootMatrix(); /* 8012B724 */ void wolfFootBgCheck(); /* 8012BFA8 */ BOOL checkWolfWaitSlipPolygon(); - /* 8012C1F4 */ void setWolfWaitSlip(); + /* 8012C1F4 */ f32 setWolfWaitSlip(); /* 8012C308 */ void checkWolfAtnDoCharge(); /* 8012C30C */ void setWolfChainPos(); /* 8012CB0C */ void setWolfAnmVoice(); @@ -2827,8 +2836,8 @@ class daAlink_c : public daPy_py_c { /* 80133164 */ int procWolfRopeStagger(); /* 8013384C */ int procWolfRopeSubjectivityInit(); /* 80133930 */ int procWolfRopeSubjectivity(); - /* 80133D6C */ void getWolfTagJumpTime() const; - /* 80133EF0 */ cXyz* checkMidnaLockJumpPoint() const; + /* 80133D6C */ int getWolfTagJumpTime() const; + /* 80133EF0 */ const cXyz* checkMidnaLockJumpPoint() const; /* 80134000 */ int procWolfTagJumpInit(fopAc_ac_c*); /* 80134838 */ int procWolfTagJump(); /* 80134DB8 */ int procWolfTagJumpLandInit(fopAc_ac_c*); @@ -2836,7 +2845,7 @@ class daAlink_c : public daPy_py_c { /* 80135160 */ int procWolfGiantPuzzleInit(); /* 801351F8 */ int procWolfGiantPuzzle(); /* 80135458 */ void setWolfHangGroundY(); - /* 801354C8 */ void changeWolfHangEndProc(); + /* 801354C8 */ int changeWolfHangEndProc(); /* 801355EC */ int procWolfHangReadyInit(); /* 80135668 */ int procWolfHangReady(); /* 801356F0 */ int procWolfHangWallCatchInit(int); @@ -2854,9 +2863,9 @@ class daAlink_c : public daPy_py_c { /* 80136F54 */ int procWolfScreamWaitInit(); /* 80136FF8 */ int procWolfScreamWait(); /* 801370E4 */ f32 getWolfLieMoveAnmSpeed(); - /* 8013712C */ void getWolfLieMoveSpeed(); + /* 8013712C */ f32 getWolfLieMoveSpeed(); /* 801371A0 */ BOOL checkMidnaDisappearMode() const; - /* 801371FC */ void checkWolfLieContinue(int); + /* 801371FC */ BOOL checkWolfLieContinue(int); /* 801372B4 */ int checkNextActionWolfFromLie(); /* 80137330 */ void setWolfLieMoveVoice(int); /* 801373F8 */ bool checkWolfLieCode(); @@ -2886,11 +2895,11 @@ class daAlink_c : public daPy_py_c { /* 801391DC */ fopAc_ac_c* getWolfLockActorEnd(); /* 801391E4 */ void searchWolfLockEnemy(fopAc_ac_c*, void*); /* 801392E4 */ void checkWolfComboCnt(); - /* 801393A4 */ void checkWolfAttackAction(); + /* 801393A4 */ BOOL checkWolfAttackAction(); /* 801395B4 */ void setWolfEnemyThrowUpperAnime(daAlink_c::daAlink_WANM, f32); /* 80139600 */ BOOL setWolfEnemyHangBitePos(fopEn_enemy_c*); /* 801396F8 */ void setWolfBiteDamage(fopEn_enemy_c*); - /* 801397A4 */ void checkWolfLockAttackChargeState(); + /* 801397A4 */ BOOL checkWolfLockAttackChargeState(); /* 801398A8 */ int procWolfRollAttackChargeInit(); /* 80139908 */ int procWolfRollAttackCharge(); /* 801399C4 */ int procWolfRollAttackMoveInit(); @@ -3131,8 +3140,10 @@ class daAlink_c : public daPy_py_c { bool i_checkSmallUpperGuardAnime() const { return checkUpperAnime(0x16); } bool i_checkFmChainGrabAnime() const { return checkUpperAnime(0x62) || checkUpperAnime(0x2A0); } - // wrapping functions that use this with "#pragma optimization_level 2" can help fix some issues, but not always + // this might be a fake match, but helps fix usage in many functions +#pragma optimization_level 2 BOOL i_checkAttentionLock() { return mAttention->Lockon(); } +#pragma optimization_level 3 bool checkUpperAnime(u16 i_idx) const { return mUpperAnmHeap[UPPER_2].getIdx() == i_idx; } bool checkUnderAnime(u16 i_idx) const { return mUnderAnmHeap[UNDER_2].getIdx() == i_idx; } @@ -3161,6 +3172,7 @@ class daAlink_c : public daPy_py_c { bool checkWolfGrabAnimeObj() const { return checkUpperAnime(0x2DA); } bool checkWolfGrabAnimeStick() const { return checkUpperAnime(0x2DB); } bool checkWolfGrabAnime() const { return checkWolfGrabAnimeObj() || checkWolfGrabAnimeStick(); } + bool checkWolfSwimDashAnime() const { return checkUnderMove0BckNoArcWolf(WANM_SWIM_DASH); } bool checkKandelaarSwingAnime() const { return false; } bool checkBowChargeWaitAnime() const { return checkUpperAnime(0xA); } bool checkBowReloadAnime() const { return checkUpperAnime(0x9); } @@ -3223,9 +3235,13 @@ class daAlink_c : public daPy_py_c { field_0x2fa3 = 0; field_0x2844.clearData(); } + s32 checkPlayerDemoMode() const { return mDemo.getDemoType(); } + BOOL i_checkSpecialDemoMode() const { return mDemo.getDemoType() == 5; } + static bool checkMidnaChargeAttack() { return i_dComIfGs_isEventBit(0x501); } u16 getMidnaMsgNum() const { return mMidnaMsgNum; } u32 getStartEvent() { return fopAcM_GetParam(this) >> 0x18; } + const daAlink_AnmData* getAnmData(daAlink_ANM anmID) const { return &m_anmDataTable[anmID]; } const daAlink_FaceTexData* getFaceTexData(daAlink_FTANM i_anmID) const { return &m_faceTexDataTable[i_anmID]; } @@ -3279,6 +3295,7 @@ class daAlink_c : public daPy_py_c { void clearIronBallActor() { field_0x173c.SetActor(this); } BOOL checkCanoeRideOwn(const fopAc_ac_c* param_0) const { return checkCanoeRide() && mRideAcKeep.getActorConst() == param_0; } bool checkWolfDashMode() const { return i_checkNoResetFlg1(FLG1_DASH_MODE); } + bool checkWolfLieWaterIn() const { return mWaterY > current.pos.y + 20.5f; } J3DModel* initModel(J3DModelData* p_modelData, u32 param_1) { return initModel(p_modelData, 0x80000, param_1); @@ -3323,10 +3340,12 @@ class daAlink_c : public daPy_py_c { mDamageColorTime = 32 - (mDamageTimer % 16); } + // Gets the cardinal direction of the Left Stick relative to player facing angle int getDirectionFromShapeAngle() const { return getDirectionFromAngle(field_0x2fe2 - shape_angle.y); } + // Gets the cardinal direction of the Left Stick relative to player angle int getDirectionFromCurrentAngle() const { return getDirectionFromAngle(field_0x2fe2 - current.angle.y); } @@ -3381,7 +3400,7 @@ class daAlink_c : public daPy_py_c { /* 0x00650 */ J3DModel* mpLinkModel; /* 0x00654 */ J3DModel* mpLinkFaceModel; /* 0x00658 */ J3DModel* mpLinkHatModel; - /* 0x0065C */ J3DModel* field_0x065c; + /* 0x0065C */ J3DModel* mpLinkHandModel; /* 0x00660 */ J3DModel* mpSwAModel; // Ordon Sword model /* 0x00664 */ J3DModel* mpSwASheathModel; // Ordon Sword sheath model /* 0x00668 */ J3DModel* mpSwMModel; // Master Sword model @@ -3410,10 +3429,10 @@ class daAlink_c : public daPy_py_c { /* 0x006C4 */ J3DAnmTextureSRTKey* m_nSwordBtk; /* 0x006C8 */ J3DAnmTextureSRTKey* m_mSwordBtk; /* 0x006CC */ J3DAnmTevRegKey* m_mSwordBrk; - /* 0x006D0 */ void* field_0x06d0; - /* 0x006D4 */ void* field_0x06d4; - /* 0x006D8 */ void* field_0x06d8; - /* 0x006DC */ void* field_0x06dc; + /* 0x006D0 */ J3DShape* field_0x06d0; + /* 0x006D4 */ J3DShape* field_0x06d4; + /* 0x006D8 */ J3DShape* field_0x06d8; + /* 0x006DC */ J3DShape* field_0x06dc; /* 0x006E0 */ J3DShape* field_0x06e0; /* 0x006E4 */ J3DShape* field_0x06e4; /* 0x006E8 */ J3DShape* field_0x06e8; @@ -3421,9 +3440,9 @@ class daAlink_c : public daPy_py_c { /* 0x006F0 */ J3DShape* field_0x06f0; /* 0x006F4 */ J3DAnmTevRegKey* field_0x06f4; /* 0x006F8 */ J3DAnmTevRegKey* field_0x06f8; - /* 0x006FC */ J3DModel* field_0x06fc; // related to human link - /* 0x00700 */ J3DModel* field_0x0700; - /* 0x00704 */ J3DAnmBase* field_0x0704; + /* 0x006FC */ J3DModel* mpKanteraModel; + /* 0x00700 */ J3DModel* mpKanteraGlowModel; + /* 0x00704 */ J3DAnmTextureSRTKey* mpKanteraGlowBtk; /* 0x00708 */ J3DModel* mHeldItemModel; /* 0x0070C */ J3DModel* mpHookTipModel; // related to held item /* 0x00710 */ J3DModel* field_0x0710; // related to held item @@ -3442,16 +3461,16 @@ class daAlink_c : public daPy_py_c { /* 0x00774 */ u8 field_0x0774[0x77C - 0x774]; /* 0x0077C */ dBgS_ObjLinChk* mpHookshotLinChk; /* 0x00780 */ u8 field_0x780[4]; - /* 0x00784 */ J3DModel* field_0x784[2]; + /* 0x00784 */ J3DModel* mpLinkBootModels[2]; /* 0x0078C */ J3DModel* mpWlChainModels[4]; - /* 0x0079C */ J3DModel* field_0x79c; // related to wolf - /* 0x007A0 */ J3DModel* mpWlMidnaHatModel; - /* 0x007A4 */ J3DModel* field_0x7a4; // related to wolf + /* 0x0079C */ J3DModel* mpWlMidnaModel; + /* 0x007A0 */ J3DModel* mpWlMidnaMaskModel; + /* 0x007A4 */ J3DModel* mpWlMidnaHandModel; /* 0x007A8 */ J3DModel* mpWlMidnaHairModel; - /* 0x007AC */ J3DAnmTevRegKey* field_0x7ac; - /* 0x007B0 */ J3DAnmTevRegKey* field_0x7b0; - /* 0x007B4 */ J3DAnmTevRegKey* field_0x7b4; - /* 0x007B8 */ J3DAnmTevRegKey* field_0x7b8; + /* 0x007AC */ J3DAnmTevRegKey* mpDMidnaBrk; + /* 0x007B0 */ J3DAnmTevRegKey* mpDMidnaMaskBrk; + /* 0x007B4 */ J3DAnmTevRegKey* mpDMidnaHandBrk; + /* 0x007B8 */ J3DAnmTevRegKey* mpDMidnaHairHandBrk; /* 0x007BC */ mDoExt_bckAnm* m_sWindowBck; /* 0x007C0 */ u32 mpWarpTexData; /* 0x007C4 */ daPy_actorKeep_c mWolfLockAcKeep[10]; @@ -3561,8 +3580,8 @@ class daAlink_c : public daPy_py_c { /* 0x02F1C */ dPaPo_c* field_0x2f1c; /* 0x02F20 */ dPa_hermiteEcallBack_c field_0x2f20; /* 0x02F38 */ dPa_hermiteEcallBack_c field_0x2f38; - /* 0x02F50 */ Vec* field_0x2f50; - /* 0x02F54 */ Vec* field_0x2f54; + /* 0x02F50 */ const Vec* field_0x2f50; + /* 0x02F54 */ const Vec* field_0x2f54; /* 0x02F58 */ u16* field_0x2f58; /* 0x02F5C */ LIGHT_INFLUENCE field_0x2f5c; /* 0x02F7C */ u8 field_0x2f7c[16]; @@ -3666,10 +3685,22 @@ class daAlink_c : public daPy_py_c { /* 0x03002 */ s16 field_0x3002; /* 0x03004 */ s16 field_0x3004; /* 0x03006 */ s16 field_0x3006; - /* 0x03008 */ s16 field_0x3008; - /* 0x0300A */ s16 field_0x300a; - /* 0x0300C */ s16 field_0x300c; // might need more accurate name - /* 0x0300E */ csXyz field_0x300e; + // `mProcVar`'s are variables that are context dependent for each `PROC` action. + // (The exact setup may need to be simplified later) + union { + s16 field_0x3008; + s16 mHowlExitID; + } /* 0x03008 */ mProcVar0; + union { + s16 field_0x300a; + } /* 0x0300A */ mProcVar1; + union { + s16 field_0x300c; + s16 mPuzzleAimAngle; + } /* 0x0300C */ mProcVar2; + union { + csXyz field_0x300e; + } /* 0x0300E */ mProcVar3; /* 0x03014 */ s16 mFallVoiceInit; /* 0x03016 */ u8 field_0x3016[2]; /* 0x03018 */ s16 field_0x3018; @@ -3682,30 +3713,10 @@ class daAlink_c : public daPy_py_c { /* 0x03026 */ s16 field_0x3026; /* 0x03028 */ s16 field_0x3028; /* 0x0302A */ u8 field_0x302a[2]; - /* 0x0302C */ s16 field_0x302c; - /* 0x0302E */ s16 field_0x302e; - /* 0x03030 */ s16 field_0x3030; - /* 0x03032 */ s16 field_0x3032; - /* 0x03034 */ s16 field_0x3034; - /* 0x03036 */ s16 field_0x3036; - /* 0x03038 */ u8 field_0x3038[2]; - /* 0x0303A */ s16 field_0x303a; - /* 0x0303C */ u8 field_0x303c[4]; - /* 0x03040 */ s16 field_0x3040; - /* 0x03042 */ s16 field_0x3042; - /* 0x03044 */ s16 field_0x3044; - /* 0x03046 */ s16 field_0x3046; - /* 0x03048 */ s16 field_0x3048; - /* 0x0304A */ s16 field_0x304a; - /* 0x0304C */ u8 field_0x304c[2]; - /* 0x0304E */ s16 field_0x304e; - /* 0x03050 */ u8 field_0x3050[4]; - /* 0x03054 */ s16 field_0x3054; - /* 0x03056 */ s16 field_0x3056; - /* 0x03058 */ u8 field_0x3058[2]; - /* 0x0305A */ s16 field_0x305a; - /* 0x0305C */ s16 field_0x305c; - /* 0x0305E */ u8 field_0x305e[2]; + /* 0x0302C */ s16 field_0x302c[10]; + /* 0x03040 */ s16 field_0x3040[10]; + /* 0x03054 */ s16 field_0x3054[3]; + /* 0x0305A */ s16 field_0x305a[3]; /* 0x03060 */ s16 field_0x3060; /* 0x03062 */ s16 field_0x3062; /* 0x03064 */ s16 field_0x3064; @@ -3731,10 +3742,8 @@ class daAlink_c : public daPy_py_c { /* 0x0308E */ s16 mFastShotTime; /* 0x03090 */ s16 field_0x3090; /* 0x03092 */ s16 field_0x3092; - /* 0x03094 */ s16 field_0x3094; - /* 0x03096 */ u8 field_0x3096[4]; - /* 0x0309A */ s16 field_0x309a; - /* 0x0309C */ u8 field_0x309c[4]; + /* 0x03094 */ s16 field_0x3094[3]; + /* 0x0309A */ s16 field_0x309a[3]; /* 0x030A0 */ s16 field_0x30a0; /* 0x030A2 */ s16 field_0x30a2; /* 0x030A4 */ s16 field_0x30a4; @@ -3851,8 +3860,7 @@ class daAlink_c : public daPy_py_c { /* 0x03298 */ u8 field_0x3298[8]; /* 0x032A0 */ J3DGXColorS10 field_0x32a0[2]; /* 0x032B0 */ J3DGXColorS10 field_0x32b0[2]; - /* 0x032C0 */ s16 field_0x32c0; - /* 0x032C2 */ u8 field_0x32c2[2]; + /* 0x032C0 */ s16 field_0x32c0[2]; /* 0x032C4 */ u16 field_0x32c4; /* 0x032C6 */ u16 field_0x32c6; /* 0x032C8 */ u32 field_0x32c8; @@ -5717,7 +5725,7 @@ class daAlinkHIO_wlAtDown_c0 { static daAlinkHIO_wlAtDown_c1 const m; }; -class daAlinkHIO_wlAtWaTl_c1 { +class daAlinkHIO_wlAtWait_c1 { public: /* 0x00 */ daAlinkHIO_anm_c field_0x0; /* 0x14 */ s16 field_0x14; @@ -5731,53 +5739,21 @@ class daAlinkHIO_wlAtWaTl_c1 { /* 0x30 */ f32 field_0x30; /* 0x34 */ f32 field_0x34; /* 0x38 */ f32 field_0x38; -}; // Size: 0x3C +}; class daAlinkHIO_wlAtWaTl_c0 { public: - static daAlinkHIO_wlAtWaTl_c1 const m; + static daAlinkHIO_wlAtWait_c1 const m; }; -class daAlinkHIO_wlAtWaSc_c1 { -public: - /* 0x00 */ daAlinkHIO_anm_c field_0x0; - /* 0x14 */ s16 field_0x14; - /* 0x16 */ s16 field_0x16; - /* 0x18 */ f32 field_0x18; - /* 0x1C */ f32 field_0x1C; - /* 0x20 */ f32 field_0x20; - /* 0x24 */ f32 field_0x24; - /* 0x28 */ f32 field_0x28; - /* 0x2C */ f32 field_0x2C; - /* 0x30 */ f32 field_0x30; - /* 0x34 */ f32 field_0x34; - /* 0x38 */ f32 field_0x38; -}; // Size: 0x3C - class daAlinkHIO_wlAtWaSc_c0 { public: - static daAlinkHIO_wlAtWaSc_c1 const m; + static daAlinkHIO_wlAtWait_c1 const m; }; -class daAlinkHIO_wlAtWaLr_c1 { -public: - /* 0x00 */ daAlinkHIO_anm_c field_0x0; - /* 0x14 */ s16 field_0x14; - /* 0x16 */ s16 field_0x16; - /* 0x18 */ f32 field_0x18; - /* 0x1C */ f32 field_0x1C; - /* 0x20 */ f32 field_0x20; - /* 0x24 */ f32 field_0x24; - /* 0x28 */ f32 field_0x28; - /* 0x2C */ f32 field_0x2C; - /* 0x30 */ f32 field_0x30; - /* 0x34 */ f32 field_0x34; - /* 0x38 */ f32 field_0x38; -}; // Size: 0x3C - class daAlinkHIO_wlAtWaLr_c0 { public: - static daAlinkHIO_wlAtWaLr_c1 const m; + static daAlinkHIO_wlAtWait_c1 const m; }; class daAlinkHIO_wlAtRoll_c1 { diff --git a/include/d/a/d_a_player.h b/include/d/a/d_a_player.h index cffa2f06329..0c1912b0316 100644 --- a/include/d/a/d_a_player.h +++ b/include/d/a/d_a_player.h @@ -259,6 +259,7 @@ class daPy_py_c : public fopAc_ac_c { FLG1_UNK_10000000 = 0x10000000, FLG1_UNK_4000000 = 0x4000000, FLG1_IS_WOLF = 0x2000000, + FLG1_UNK_800000 = 0x800000, FLG1_DASH_MODE = 0x400000, FLG1_UNK_10000 = 0x10000, FLG1_UNK_8000 = 0x8000, @@ -290,9 +291,11 @@ class daPy_py_c : public fopAc_ac_c { FLG2_STATUS_WINDOW_DRAW = 0x400000, FLG2_UNK_280000 = 0x280000, FLG2_UNK_200000 = 0x200000, + FLG2_UNK_100000 = 0x100000, FLG2_UNK_80000 = 0x80000, FLG2_UNK_40000 = 0x40000, FLG2_UNK_20000 = 0x20000, + FLG2_UNK_10000 = 0x10000, FLG2_SCN_CHG_START = 0x8000, FLG2_UNK_4000 = 0x4000, FLG2_UNK_2000 = 0x2000, @@ -317,11 +320,14 @@ class daPy_py_c : public fopAc_ac_c { FLG3_UNK_4000000 = 0x4000000, FLG3_UNK_2000000 = 0x2000000, FLG3_UNK_1000000 = 0x1000000, + FLG3_UNK_800000 = 0x800000, FLG3_UNK_400000 = 0x400000, + FLG3_UNK_200000 = 0x200000, FLG3_UNK_100000 = 0x100000, FLG3_UNK_80000 = 0x80000, FLG3_COPY_ROD_THROW_AFTER = 0x40000, FLG3_UNK_4000 = 0x4000, + FLG3_UNK_400 = 0x400, FLG3_UNK_200 = 0x200, FLG3_UNK_100 = 0x100, FLG3_UNK_80 = 0x80, @@ -333,6 +339,7 @@ class daPy_py_c : public fopAc_ac_c { enum daPy_ERFLG0 { ERFLG0_UNK_40000000 = 0x40000000, + ERFLG0_UNK_20000000 = 0x20000000, ERFLG0_UNK_10000000 = 0x10000000, ERFLG0_UNK_8000000 = 0x8000000, ERFLG0_UNK_2000000 = 0x2000000, @@ -362,16 +369,19 @@ class daPy_py_c : public fopAc_ac_c { ERFLG1_UNK_20000000 = 0x20000000, ERFLG1_UNK_10000000 = 0x10000000, ERFLG1_UNK_4000000 = 0x4000000, + ERFLG1_UNK_200000 = 0x200000, ERFLG1_UNK_100000 = 0x100000, ERFLG1_UNK_40000 = 0x40000, + ERFLG1_UNK_10000 = 0x10000, ERFLG1_UNK_2000 = 0x2000, ERFLG1_UNK_800 = 0x800, ERFLG1_UNK_400 = 0x400, ERFLG1_UNK_200 = 0x200, ERFLG1_UNK_100 = 0x100, ERFLG1_UNK_80 = 0x80, - ERFLG1_UNK_10 = 0x10, + ERFLG1_UNK_40 = 0x40, ERFLG1_UNK_20 = 0x20, + ERFLG1_UNK_10 = 0x10, ERFLG1_UNK_8 = 8, ERFLG1_UNK_4 = 4, ERFLG1_UNK_2 = 2, @@ -386,9 +396,11 @@ class daPy_py_c : public fopAc_ac_c { }; enum daPy_RFLG0 { + RFLG0_UNK_40000000 = 0x40000000, RFLG0_UNK_8000000 = 0x8000000, RFLG0_UNK_4000000 = 0x4000000, RFLG0_UNK_20000 = 0x20000, + RFLG0_UNK_8000 = 0x8000, RFLG0_UNK_4000 = 0x4000, RFLG0_FRONT_ROLL_CRASH = 0x2000, RFLG0_ENEMY_ATTN_LOCK = 0x1000, @@ -407,6 +419,8 @@ class daPy_py_c : public fopAc_ac_c { RFLG1_UNK_30 = 0x30, RFLG1_UNK_2 = 0x2, RFLG1_WOLF_ATTACK_REVERSE = 0x1, + + RFLG1_UNK_C = 0xC, }; enum { @@ -742,6 +756,7 @@ class daPy_py_c : public fopAc_ac_c { bool checkFrontRollCrash() const { return i_checkResetFlg0(RFLG0_FRONT_ROLL_CRASH); } bool checkWolfAttackReverse() const { return checkResetFlg1(RFLG1_WOLF_ATTACK_REVERSE); } bool checkFreezeDamage() const { return i_checkNoResetFlg1(FLG1_UNK_40000000); } + bool checkWolfTagLockJumpReady() const { return i_checkResetFlg0(RFLG0_UNK_20000); } void onForceAutoJump() { i_onEndResetFlg0(ERFLG0_FORCE_AUTO_JUMP); } void onNotAutoJump() { i_onEndResetFlg0(ERFLG0_NOT_AUTO_JUMP); } @@ -749,6 +764,12 @@ class daPy_py_c : public fopAc_ac_c { void onShieldBackBone() { i_onEndResetFlg1(ERFLG1_GANON_FINISH); } void onFogFade() { i_onNoResetFlg2(FLG2_UNK_4000); } + void offCargoCarry() { + if (checkCargoCarry()) { + mSpecialMode = 0; + } + } + void offGoronSideMove() { if (i_checkGoronSideMove()) { mSpecialMode = 0; @@ -762,38 +783,38 @@ class daPy_py_c : public fopAc_ac_c { // some functions use these function as an inline // is there a better way to handle this? - int i_checkNoResetFlg0(daPy_FLG0 pFlag) const { return mNoResetFlg0 & pFlag; } - int i_checkNoResetFlg1(daPy_FLG1 pFlag) const { return mNoResetFlg1 & pFlag; } - int i_checkNoResetFlg2(daPy_FLG2 pFlag) const { return mNoResetFlg2 & pFlag; } - int i_checkNoResetFlg3(daPy_FLG3 pFlag) const { return mNoResetFlg3 & pFlag; } + u32 i_checkNoResetFlg0(daPy_FLG0 i_flag) const { return mNoResetFlg0 & i_flag; } + u32 i_checkNoResetFlg1(daPy_FLG1 i_flag) const { return mNoResetFlg1 & i_flag; } + u32 i_checkNoResetFlg2(daPy_FLG2 i_flag) const { return mNoResetFlg2 & i_flag; } + u32 i_checkNoResetFlg3(daPy_FLG3 i_flag) const { return mNoResetFlg3 & i_flag; } - void i_onNoResetFlg0(int pFlg) { mNoResetFlg0 |= pFlg; } - void i_onNoResetFlg1(int pFlg) { mNoResetFlg1 |= pFlg; } - void i_onNoResetFlg2(int pFlg) { mNoResetFlg2 |= pFlg; } - void i_onNoResetFlg3(int pFlg) { mNoResetFlg3 |= pFlg; } + void i_onNoResetFlg0(int i_flag) { mNoResetFlg0 |= i_flag; } + void i_onNoResetFlg1(int i_flag) { mNoResetFlg1 |= i_flag; } + void i_onNoResetFlg2(int i_flag) { mNoResetFlg2 |= i_flag; } + void i_onNoResetFlg3(int i_flag) { mNoResetFlg3 |= i_flag; } - void i_offNoResetFlg0(int pFlg) { mNoResetFlg0 &= ~pFlg; } - void i_offNoResetFlg1(int pFlg) { mNoResetFlg1 &= ~pFlg; } - void i_offNoResetFlg2(int pFlg) { mNoResetFlg2 &= ~pFlg; } - void i_offNoResetFlg3(int pFlg) { mNoResetFlg3 &= ~pFlg; } + void i_offNoResetFlg0(int i_flag) { mNoResetFlg0 &= ~i_flag; } + void i_offNoResetFlg1(int i_flag) { mNoResetFlg1 &= ~i_flag; } + void i_offNoResetFlg2(int i_flag) { mNoResetFlg2 &= ~i_flag; } + void i_offNoResetFlg3(int i_flag) { mNoResetFlg3 &= ~i_flag; } void i_offResetFlg0(int flag) { mResetFlg0 &= ~flag; } void i_offResetFlg1(int flag) { mResetFlg1 &= ~flag; } void i_onResetFlg0(int flag) { mResetFlg0 |= flag; } void i_onResetFlg1(int flag) { mResetFlg1 |= flag; } - void i_onEndResetFlg0(int flag) { mEndResetFlg0 |= flag; } - void i_onEndResetFlg2(int flag) { mEndResetFlg2 |= flag; } - void i_offEndResetFlg2(daPy_ERFLG2 flag) { mEndResetFlg2 &= ~flag; } + void i_onEndResetFlg0(int i_flag) { mEndResetFlg0 |= i_flag; } + void i_onEndResetFlg2(int i_flag) { mEndResetFlg2 |= i_flag; } + void i_offEndResetFlg2(daPy_ERFLG2 i_flag) { mEndResetFlg2 &= ~i_flag; } - int i_checkResetFlg0(daPy_py_c::daPy_RFLG0 flag) const { return mResetFlg0 & flag; } - int checkResetFlg1(daPy_py_c::daPy_RFLG1 flag) const { return mResetFlg1 & flag; } + u32 i_checkResetFlg0(daPy_py_c::daPy_RFLG0 i_flag) const { return mResetFlg0 & i_flag; } + u32 checkResetFlg1(daPy_py_c::daPy_RFLG1 i_flag) const { return mResetFlg1 & i_flag; } - int i_checkEndResetFlg0(daPy_py_c::daPy_ERFLG0 flag) const { return mEndResetFlg0 & flag; } - int i_checkEndResetFlg1(daPy_py_c::daPy_ERFLG1 flag) const { return mEndResetFlg1 & flag; } - int i_checkEndResetFlg2(daPy_py_c::daPy_ERFLG2 flag) const { return mEndResetFlg2 & flag; } + u32 i_checkEndResetFlg0(daPy_py_c::daPy_ERFLG0 i_flag) const { return mEndResetFlg0 & i_flag; } + u32 i_checkEndResetFlg1(daPy_py_c::daPy_ERFLG1 i_flag) const { return mEndResetFlg1 & i_flag; } + u32 i_checkEndResetFlg2(daPy_py_c::daPy_ERFLG2 i_flag) const { return mEndResetFlg2 & i_flag; } - void i_onEndResetFlg1(daPy_ERFLG1 pFlg) { mEndResetFlg1 |= pFlg; } + void i_onEndResetFlg1(daPy_ERFLG1 i_flag) { mEndResetFlg1 |= i_flag; } u32 i_checkWolf() const { return i_checkNoResetFlg1(FLG1_IS_WOLF); } BOOL i_checkEquipHeavyBoots() const { return i_checkNoResetFlg0(FLG0_EQUIP_HVY_BOOTS); } diff --git a/include/d/bg/d_bg_s_acch.h b/include/d/bg/d_bg_s_acch.h index f067b030a61..1ebbac54478 100644 --- a/include/d/bg/d_bg_s_acch.h +++ b/include/d/bg/d_bg_s_acch.h @@ -167,6 +167,7 @@ class dBgS_Acch : public cBgS_Chk, public dBgS_Chk { // inline dupe void i_ClrGroundHit() { m_flags &= ~GROUND_HIT; } + bool i_ChkGroundHit() const { return m_flags & GROUND_HIT; } public: /* 0x02C */ u32 m_flags; diff --git a/include/d/cc/d_cc_d.h b/include/d/cc/d_cc_d.h index a069dbf97cf..70282020b4e 100644 --- a/include/d/cc/d_cc_d.h +++ b/include/d/cc/d_cc_d.h @@ -322,6 +322,8 @@ class dCcD_GObjInf : public cCcD_GObjInf { void OffTgShield() { mGObjTg.OffSPrm(0x1); } void OnTgShieldFrontRange() { mGObjTg.OnSPrm(0x8); } void OffTgShieldFrontRange() { mGObjTg.OffSPrm(0x8); } + void OnTgSmallShield() { mGObjTg.OnSPrm(0x10); } + void OffTgSmallShield() { mGObjTg.OffSPrm(0x10); } bool ChkTgIronBallRebound() { return mGObjTg.ChkSPrm(0x100); } s16* GetTgShieldFrontRangeYAngle() { return mGObjTg.GetShieldFrontRangeYAngle(); } s16 GetTgShieldRange() { return mGObjTg.GetShieldRange(); } diff --git a/include/d/com/d_com_inf_game.h b/include/d/com/d_com_inf_game.h index 97bc429e188..a70f4c553e3 100644 --- a/include/d/com/d_com_inf_game.h +++ b/include/d/com/d_com_inf_game.h @@ -1776,6 +1776,10 @@ inline BOOL dComIfGs_isStageMiddleBoss() { return g_dComIfG_gameInfo.info.getMemory().getBit().isStageBossEnemy2(); } +inline void dComIfGs_setTransformStatus(u8 i_status) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().setTransformStatus(i_status); +} + void dComIfGp_setSelectItem(int index); s32 dComIfGp_offHeapLockFlag(int flag); void dComIfGp_createSubExpHeap2D(); diff --git a/include/d/d_attention.h b/include/d/d_attention.h index 6e67a5b3be3..298a81c27b0 100644 --- a/include/d/d_attention.h +++ b/include/d/d_attention.h @@ -207,7 +207,7 @@ class dAttention_c { dAttCatch_c& getCatghTarget() { return mCatghTarget; } u8 getCatchChgItem() { return mCatghTarget.getChangeItem(); } - BOOL chkFlag(u32 flag) { return mFlags & flag; } + BOOL chkFlag(u32 flag) { return (mFlags & flag) ? TRUE : FALSE; } void setFlag(u32 flag) { mFlags |= flag; } void clrFlag(u32 flag) { mFlags &= ~flag; } int GetActionCount() { return mActionCount; } diff --git a/include/d/d_cam_param.h b/include/d/d_cam_param.h index 2f15313165b..92a3fde44b6 100644 --- a/include/d/d_cam_param.h +++ b/include/d/d_cam_param.h @@ -52,7 +52,8 @@ class dCamBGChk_c { struct dCamStyleData { struct StyleData { /* 0x0 */ u32 field_0x0; - /* 0x4 */ u8 field_0x4[0x78 - 0x4]; + /* 0x4 */ u16 field_0x4; + /* 0x6 */ u8 field_0x6[0x78 - 0x6]; }; // Size: 0x78 /* 0x0 */ u8 field_0x0[4]; @@ -87,6 +88,8 @@ class dCamParam_c { /* 0x14 */ int mStyleID; /* 0x18 */ u8 field_0x18[4]; + u16 Algorythmn(s32 i_style) { return mCamStyleData[i_style].field_0x4; } + /* 8008858C */ virtual ~dCamParam_c(); }; diff --git a/include/d/d_camera.h b/include/d/d_camera.h index da4d36b67a7..bedb8faa0e5 100644 --- a/include/d/d_camera.h +++ b/include/d/d_camera.h @@ -77,23 +77,39 @@ struct d2DBSplinePath { /* 801828D4 */ virtual ~d2DBSplinePath(); }; +struct dCamera_event_param { + /* 0x00 */ char name[16]; + /* 0x10 */ int field_0x10; + /* 0x14 */ int value; +}; + struct dCamera_event_data { /* 0x000 */ u8 field_0x0; /* 0x004 */ int field_0x4; - /* 0x008 */ u8 field_0x8[4]; + /* 0x008 */ int field_0x8; /* 0x00C */ int field_0xc; /* 0x010 */ u8 field_0x10; /* 0x014 */ int field_0x14; /* 0x018 */ int field_0x18; /* 0x01C */ int field_0x1c; /* 0x020 */ int field_0x20; - /* 0x024 */ u8 field_0x24[0xEC - 0x24]; + /* 0x024 */ int field_0x24; + /* 0x028 */ u8 field_0x28[0x2C - 0x28]; + /* 0x02C */ dCamera_event_param mEventParams[8]; /* 0x0EC */ dStage_MapEvent_dt_c* field_0xec; /* 0x0F0 */ d2DBSplinePath field_0xf0; }; // Size: 0x124 +struct dCamera_type_data { + /* 0x00 */ char name[24]; + /* 0x18 */ s16 field_0x18[2][11]; +}; // Size: 0x44 + class camera_class; +class dCamera_c; +typedef bool (dCamera_c::*engine_fn)(s32); + class dCamera_c { public: class dCamInfo_c { @@ -163,12 +179,18 @@ class dCamera_c { /* 0x40 */ cSAngle field_0x40; }; // Size: 0x44 - /* 80088A7C */ void StartEventCamera(int, int, ...); - /* 80088BBC */ void EndEventCamera(int); + /* 80088A7C */ int StartEventCamera(int, int, ...); + /* 80088BBC */ int EndEventCamera(int); + /* 80088C24 */ int searchEventArgData(char*); /* 8008908C */ void getEvIntData(int*, char*, int); /* 80088CB0 */ void getEvIntData(int*, char*); - /* 80089154 */ void getEvFloatData(f32*, char*, f32); /* 80088D90 */ void getEvFloatData(f32*, char*); + /* 80089154 */ void getEvFloatData(f32*, char*, f32); + /* 80088E58 */ void getEvFloatListData(f32**, char*); + /* 80088F1C */ void getEvXyzListData(cXyz**, char*); + /* 8008941C */ void getEvStringPntData(char*, char*); + /* 80088FE0 */ void getEvStringPntData(char*); + /* 8008922C */ void getEvXyzData(cXyz*, char*, cXyz); /* 8008933C */ void getEvStringData(char*, char*, char*); /* 800894C4 */ void getEvActor(char*); /* 800895F4 */ void getEvActor(char*, char*); @@ -180,10 +202,11 @@ class dCamera_c { /* 8008BE2C */ void uniformTransEvCamera(); /* 8008BE50 */ void uniformBrakeEvCamera(); /* 8008BE74 */ void uniformAcceleEvCamera(); + /* 8008BE98 */ void transEvCamera(int); /* 8008E938 */ void watchActorEvCamera(); /* 8008FAE8 */ void restorePosEvCamera(); /* 80090174 */ void talktoEvCamera(); - /* 80090230 */ void maptoolIdEvCamera(); + /* 80090230 */ bool maptoolIdEvCamera(); /* 80090478 */ void styleEvCamera(); /* 80090514 */ void gameOverEvCamera(); /* 80091468 */ void tactEvCamera(); @@ -242,7 +265,7 @@ class dCamera_c { /* 8016469C */ void onStyleChange(s32, s32); /* 801647B0 */ void onRoomChange(s32); /* 80164878 */ void getParamTargetActor(s32); - /* 80164944 */ void GetCameraTypeFromMapToolID(s32, s32); + /* 80164944 */ int GetCameraTypeFromMapToolID(s32, s32); /* 80164B64 */ int GetCameraTypeFromCameraName(char const*); /* 80164C10 */ void GetCameraTypeFromToolData(stage_camera2_data_class*); /* 80164C64 */ void pushInfo(dCamera_c::dCamInfo_c*, s16); @@ -270,31 +293,31 @@ class dCamera_c { /* 80167E3C */ void tooNearEscape(cXyz*); /* 80167EF4 */ void getWaterSurfaceHeight(cXyz*); /* 80167FEC */ void checkGroundInfo(); - /* 80168744 */ void chaseCamera(s32); - /* 8016C384 */ void lockonCamera(s32); + /* 80168744 */ bool chaseCamera(s32); + /* 8016C384 */ bool lockonCamera(s32); /* 8016E448 */ void getMsgCmdSpeaker(); /* 8016E4A4 */ void getMsgCmdCut(s32); - /* 8016E4F4 */ void talktoCamera(s32); + /* 8016E4F4 */ bool talktoCamera(s32); /* 80174E18 */ void talkBasePos(fopAc_ac_c*); /* 80174E34 */ void talkEyePos(fopAc_ac_c*); /* 80174EA4 */ bool CalcSubjectAngle(s16*, s16*); /* 80174EAC */ void SaveZoomRatio(); - /* 80174ED4 */ void subjectCamera(s32); - /* 80176074 */ void magneCamera(s32); - /* 801767F8 */ void colosseumCamera(s32); + /* 80174ED4 */ bool subjectCamera(s32); + /* 80176074 */ bool magneCamera(s32); + /* 801767F8 */ bool colosseumCamera(s32); /* 80176DF0 */ bool test1Camera(s32); /* 80176DF8 */ bool test2Camera(s32); - /* 80176E00 */ void towerCamera(s32); - /* 80178E50 */ void hookshotCamera(s32); - /* 80179590 */ void railCamera(s32); - /* 8017A2A0 */ void paraRailCamera(s32); - /* 8017ADC0 */ void rideCamera(s32); + /* 80176E00 */ bool towerCamera(s32); + /* 80178E50 */ bool hookshotCamera(s32); + /* 80179590 */ bool railCamera(s32); + /* 8017A2A0 */ bool paraRailCamera(s32); + /* 8017ADC0 */ bool rideCamera(s32); /* 8017D974 */ bool manualCamera(s32); - /* 8017D97C */ void observeCamera(s32); - /* 8017DFAC */ void fixedFrameCamera(s32); - /* 8017E730 */ void fixedPositionCamera(s32); - /* 8017F25C */ void oneSideCamera(s32); - /* 8017F828 */ void eventCamera(s32); + /* 8017D97C */ bool observeCamera(s32); + /* 8017DFAC */ bool fixedFrameCamera(s32); + /* 8017E730 */ bool fixedPositionCamera(s32); + /* 8017F25C */ bool oneSideCamera(s32); + /* 8017F828 */ bool eventCamera(s32); /* 8018050C */ void currentEvCamera(); /* 801806D4 */ bool letCamera(s32); /* 801806DC */ void setEventRecoveryTrans(s16); @@ -334,7 +357,15 @@ class dCamera_c { f32 TrimHeight() { return mTrimHeight; } int Type() { return mCurType; } + bool i_chkFlag(u32 i_flag) { return mEventFlags & i_flag; } + void i_setFlag(u32 i_flag) { mEventFlags |= i_flag; } + void i_clrFlag(u32 i_flag) { mEventFlags &= ~i_flag; } + +#ifdef NONMATCHING + static engine_fn engine_tbl[]; +#else static u8 engine_tbl[240]; +#endif /* 0x000 */ camera_class* field_0x0; /* 0x004 */ int mRoomNo; @@ -396,7 +427,7 @@ class dCamera_c { /* 0x160 */ int field_0x160; /* 0x164 */ u8 field_0x164[0x170 - 0x164]; /* 0x170 */ int field_0x170; - /* 0x174 */ u32 field_0x174; + /* 0x174 */ u32 mCurCamTypeTimer; /* 0x178 */ u32 mCameraID; /* 0x17C */ u32 mPadID; /* 0x180 */ fopAc_ac_c* mpPlayerActor; @@ -469,8 +500,8 @@ class dCamera_c { /* 0x678 */ int field_0x678; /* 0x67C */ int mCamStyle; /* 0x680 */ int field_0x684; - /* 0x684 */ u8* mCamTypeData; - /* 0x688 */ int field_0x688; + /* 0x684 */ dCamera_type_data* mCamTypeData; + /* 0x688 */ int mCamTypeNum; /* 0x68C */ int mCurType; /* 0x690 */ int mNextType; /* 0x694 */ int mMapToolType; diff --git a/include/d/d_jnt_col.h b/include/d/d_jnt_col.h index fd33fce859b..1705cd3f96a 100644 --- a/include/d/d_jnt_col.h +++ b/include/d/d_jnt_col.h @@ -13,8 +13,8 @@ class dJntColData_c { /* 0x0 */ u8 field_0x0; /* 0x1 */ s8 mType; /* 0x2 */ s16 mJntNum; - /* 0x4 */ u32 field_0x4; - /* 0x8 */ void* field_0x8; + /* 0x4 */ f32 field_0x4; + /* 0x8 */ Vec* field_0x8; }; class dJntCol_c { diff --git a/include/d/d_stage.h b/include/d/d_stage.h index e919c1ffa73..0f4a2403465 100644 --- a/include/d/d_stage.h +++ b/include/d/d_stage.h @@ -344,7 +344,9 @@ struct dStage_MapEvent_dt_c { /* 0x07 */ u8 field_0x7; /* 0x08 */ u8 field_0x8; /* 0x09 */ u8 field_0x9; - /* 0x0A */ u8 field_0xA[0xD - 0xA]; + /* 0x0A */ u8 field_0xA; + /* 0x0B */ u8 field_0xB; + /* 0x0C */ u8 field_0xC; /* 0x0D */ char mName[7]; /* 0x14 */ u16 field_0x14; /* 0x16 */ u8 field_0x16; @@ -1071,6 +1073,10 @@ inline u32 dStage_stagInfo_ChkKeyDisp(stage_stag_info_class* pstag) { return pstag->field_0x09 & 1; } +inline u8 dStage_stagInfo_GetWolfDashType(stage_stag_info_class* pstag) { + return (pstag->field_0x09 >> 6) & 3; +} + inline u32 dStage_sclsInfo_getSceneLayer(stage_scls_info_class* p_info) { return p_info->field_0xb & 0xF; } diff --git a/include/d/event/d_event.h b/include/d/event/d_event.h index d3393d2619c..98d1801872c 100644 --- a/include/d/event/d_event.h +++ b/include/d/event/d_event.h @@ -4,6 +4,8 @@ #include "d/a/d_a_itembase.h" #include "global.h" +int dEv_noFinishSkipProc(void*, int); + struct dStage_MapEvent_dt_c; class fopAc_ac_c; @@ -162,6 +164,8 @@ class dEvt_control_c { bool isChangeOK(void* param_0) { return mChangeOK == param_0; } u8 getPreItemNo() { return mPreItemNo; } u8 getGtItm() { return mGtItm; } + void i_startCheckSkipEdge(void* param_0) { setSkipProc(param_0, dEv_noFinishSkipProc, 0); } + bool i_checkSkipEdge() { return chkFlag2(8) != false; } public: /* 0x000 */ u8 field_0x0[4]; diff --git a/include/d/msg/d_msg_object.h b/include/d/msg/d_msg_object.h index 20a015c0bee..134128c029c 100644 --- a/include/d/msg/d_msg_object.h +++ b/include/d/msg/d_msg_object.h @@ -151,7 +151,7 @@ class dMsgObject_c : public msg_class { /* 80238528 */ void getSelectWord(int); /* 80238544 */ static void setSelectWordFlag(u8); /* 80238574 */ void getSelectWordFlag(); - /* 80238588 */ bool isHowlHearingMode(); + /* 80238588 */ static bool isHowlHearingMode(); /* 802385B4 */ static u8 getSelectBombBagID(); /* 802385E0 */ static s16 getSelectBombPrice(); /* 8023860C */ static void setEquipBombInfo(); @@ -364,6 +364,14 @@ inline void dMsgObject_setEquipBombInfo() { dMsgObject_c::setEquipBombInfo(); } +inline bool dMsgObject_isHowlHearingMode() { + return dMsgObject_c::isHowlHearingMode(); +} + +inline void dMsgObject_onMsgSend() { + dMsgObject_getMsgObjectClass()->onMsgSend(); +} + class dMsgObject_HowlHIO_c { public: /* 80232AEC */ dMsgObject_HowlHIO_c(); diff --git a/include/d/particle/d_particle_copoly.h b/include/d/particle/d_particle_copoly.h index 85f3bb1ef2f..8422fce5f2e 100644 --- a/include/d/particle/d_particle_copoly.h +++ b/include/d/particle/d_particle_copoly.h @@ -21,6 +21,8 @@ class dPaPo_c { /* 80051524 */ JPABaseEmitter* getCenterEmitter(int, int); void clearCenterID() { clearID(field_0x8[0], &field_0x36); } + void changeWaterOffset(f32 i_offset) { mWaterOffset = i_offset; } + void changeRippleOffset(f32 i_offset) { mRippleOffset = i_offset; } /* 0x00 */ u32 field_0x0[2]; /* 0x08 */ u32 field_0x8[2][4]; diff --git a/include/d/save/d_save.h b/include/d/save/d_save.h index 6cfdcc11724..86a3df36fed 100644 --- a/include/d/save/d_save.h +++ b/include/d/save/d_save.h @@ -411,6 +411,7 @@ class dSv_player_status_a_c { void setLife(u16 i_life) { mLife = i_life; } void setMaxLife(u8 i_maxLife) { mMaxLife = i_maxLife; } void setSelectEquip(int i_equipId, u8 i_itemNo) { mSelectEquip[i_equipId] = i_itemNo; } + void setTransformStatus(u8 i_status) { mTransformStatus = i_status; } private: /* 0x00 */ u16 mMaxLife; diff --git a/include/f_op/f_op_actor.h b/include/f_op/f_op_actor.h index c528f9af6cc..dcb373996c1 100644 --- a/include/f_op/f_op_actor.h +++ b/include/f_op/f_op_actor.h @@ -248,11 +248,20 @@ class fopEn_enemy_c : public fopAc_ac_c { bool checkWolfNoLock() const { return mFlags & 0x200; } bool checkHeadLockFlg() const { return mFlags & 0x80; } bool checkDownFlg() const { return mFlags & 0x1; } + bool checkDeadFlg() const { return mFlags & 0x8; } cXyz& getDownPos() { return mDownPos; } cXyz& getHeadLockPos() { return mHeadLockPos; } void onCutDownHitFlg() { mFlags |= 2; } - + void onWolfBiteDamage() { mFlags |= 0x40; } + void onWolfDownStartFlg() { mFlags |= 0x14; } + void onWolfDownPullEndFlg() { mFlags |= 0x20; } + + void setThrowModeCatch() { mThrowMode |= 2; } + void setThrowModeDash() { mThrowMode |= 4; } + void setThrowModeThrowRight() { mThrowMode |= 0x10; } + void setThrowModeThrowLeft() { mThrowMode |= 8; } + /* 0x568 */ cXyz mDownPos; /* 0x574 */ cXyz mHeadLockPos; /* 0x580 */ J3DModel* mBallModel; diff --git a/include/f_op/f_op_actor_iter.h b/include/f_op/f_op_actor_iter.h index 776303157f1..91373ae2907 100644 --- a/include/f_op/f_op_actor_iter.h +++ b/include/f_op/f_op_actor_iter.h @@ -2,10 +2,10 @@ #define F_OP_ACTOR_ITER_H_ -typedef int (*fopAcIt_ExecutorFunc)(void*, void*); -typedef void* (*fopAcIt_JudgeFunc)(void*, void*); +typedef int (*fopAcIt_ExecutorFunc)(void* actor, void* data); +typedef void* (*fopAcIt_JudgeFunc)(void* actor, void* data); -int fopAcIt_Executor(fopAcIt_ExecutorFunc, void*); -void* fopAcIt_Judge(fopAcIt_JudgeFunc, void*); +int fopAcIt_Executor(fopAcIt_ExecutorFunc executeFunc, void* data); +void* fopAcIt_Judge(fopAcIt_JudgeFunc judgeFunc, void* data); #endif \ No newline at end of file diff --git a/include/m_Do/m_Do_audio.h b/include/m_Do/m_Do_audio.h index 1e19e0875bb..a7dea790558 100644 --- a/include/m_Do/m_Do_audio.h +++ b/include/m_Do/m_Do_audio.h @@ -129,6 +129,14 @@ inline void mDoAud_changeSubBgmStatus(s32 param_0) { Z2AudioMgr::getInterface()->changeSubBgmStatus(param_0); } +inline void mDoAud_taktModeMute() { + Z2AudioMgr::getInterface()->taktModeMute(); +} + +inline void mDoAud_taktModeMuteOff() { + Z2AudioMgr::getInterface()->taktModeMuteOff(); +} + inline void mDoAud_mEnvse_framework() { g_mEnvSeMgr.framework(); } diff --git a/include/m_Do/m_Do_ext.h b/include/m_Do/m_Do_ext.h index 3d7647553a1..0e8a46951aa 100644 --- a/include/m_Do/m_Do_ext.h +++ b/include/m_Do/m_Do_ext.h @@ -402,6 +402,7 @@ class mDoExt_MtxCalcOldFrame { bool getOldFrameFlg() { return mOldFrameFlg; } void onOldFrameFlg() { mOldFrameFlg = true; } + void offOldFrameFlg() { mOldFrameFlg = false; } f32 getOldFrameRate() { return mOldFrameRate; } J3DTransformInfo* getOldFrameTransInfo(int i) { return &mOldFrameTransInfo[i]; } u16 getOldFrameStartJoint() { return mOldFrameStartJoint; } @@ -506,6 +507,8 @@ class mDoExt_3DlineMat1_c : public mDoExt_3DlineMat_c { /* 800134F8 */ void setMaterial(); /* 800135D0 */ void draw(); + cXyz* getPos(int i_idx) { return field_0x38[i_idx].field_0x0; } + private: /* 0x08 */ GXTexObj field_0x8; /* 0x28 */ GXColor field_0x28; diff --git a/include/rel/d/a/d_a_horse/d_a_horse.h b/include/rel/d/a/d_a_horse/d_a_horse.h index 59b434f4b8c..e5004b38c4c 100644 --- a/include/rel/d/a/d_a_horse/d_a_horse.h +++ b/include/rel/d/a/d_a_horse/d_a_horse.h @@ -180,6 +180,7 @@ class daHorse_c : public fopAc_ac_c { f32 getMorfFrame() const { return mMorfFrame; } f32 getBlendRate() { return field_0x594[1].getRatio(); } u16 getAnmIdx(int i_idx) const { return mAnmIdx[i_idx]; } + int callHorse(const cXyz* param_0) { return (this->*mpCallHorseFn)(param_0); } daHoZelda_c* i_getZeldaActor() { return (daHoZelda_c*)mZeldaActorKeep.getActor(); } diff --git a/include/rel/d/a/d_a_kago/d_a_kago.h b/include/rel/d/a/d_a_kago/d_a_kago.h index a93392ed876..a543ff0cbe6 100644 --- a/include/rel/d/a/d_a_kago/d_a_kago.h +++ b/include/rel/d/a/d_a_kago/d_a_kago.h @@ -1,6 +1,107 @@ #ifndef D_A_KAGO_H #define D_A_KAGO_H -#include "dolphin/types.h" +#include "f_op/f_op_actor_mng.h" +#include "d/d_path.h" + +class daKago_c : public fopAc_ac_c { +public: + /* 80849660 */ void getBckName(int); + /* 808496F0 */ void setBck(int, u8, f32, f32); + /* 80849798 */ void checkBck(int); + /* 808497F8 */ void draw(); + /* 80849980 */ void executeBalloonMenu(); + /* 80849BA8 */ void checkGroundHeight(cXyz, f32*); + /* 8084A070 */ void checkRoofHeight(cXyz); + /* 8084A210 */ void checkMoveHeight(); + /* 8084A2A8 */ void checkSizeBg(); + /* 8084A6DC */ bool getBeforeGroundHeight(u8); + /* 8084A6E4 */ void demo_skip(int); + /* 8084AA64 */ void DemoSkipCallBack(void*, int); + /* 8084AA98 */ void setActionMode(int, int); + /* 8084AAAC */ void setMidnaTagPos(); + /* 8084AB40 */ void setMidnaRideOn(); + /* 8084AB8C */ void setPlayerRideOn(); + /* 8084ABC8 */ void setRideOff(); + /* 8084AC2C */ void searchNearPassPoint(); + /* 8084AE78 */ void setSceneChange(int); + /* 8084AF40 */ void createBalloonScore(); + /* 8084AFB0 */ void startBalloonScore(); + /* 8084B024 */ void endBalloonScore(); + /* 8084B088 */ void checkNextPath(cXyz); + /* 8084B108 */ void checkHeight(); + /* 8084B134 */ void checkYaguraPos(cXyz); + /* 8084B1E0 */ void checkWallHitFall(int); + /* 8084B56C */ void checkAttackStart(); + /* 8084B5DC */ void getValueY(f32); + /* 8084B6F4 */ void getValueX(f32); + /* 8084B718 */ void getValueAbsX(f32); + /* 8084B744 */ void flySpeedCalcLockOn(); + /* 8084B96C */ void flySpeedCalc(s16, int); + /* 8084C078 */ void checkFlySceneChange(); + /* 8084C178 */ void setFlyAway(); + /* 8084C204 */ void setFlyAnime(); + /* 8084C2CC */ void executeFly(); + /* 8084C8FC */ void executeStagger(); + /* 8084D108 */ void executeWait(); + /* 8084D354 */ void calcAttackMove(int); + /* 8084D50C */ void executeAttack(); + /* 8084DA18 */ void calcCircleCamera(int); + /* 8084DBFC */ void executeEvent(); + /* 8084DD18 */ void initPerchDemo(); + /* 8084E2D4 */ void executePerchDemo(); + /* 8084F09C */ void PerchDemoAwayForward(); + /* 8084FA58 */ void executePerch(); + /* 8084FAA8 */ void executeEvent2(); + /* 8084FB50 */ void initFirstDemo(); + /* 80850384 */ void executeFirstDemo(); + /* 808513E4 */ void executePerch2(); + /* 80851434 */ void executeLandingLakeHairia(); + /* 80851DEC */ void executeLandingBoartHouse(); + /* 808525B0 */ void executeLanding(); + /* 80852610 */ void moveDemoFly(); + /* 80852D90 */ void setFlyEffect(); + /* 80852F14 */ void setDashEffect(); + /* 808530A4 */ void setDamageEffect(); + /* 80853228 */ void setDashBlurEffect(int); + /* 80853460 */ void setWallHitEffect(cXyz, int); + /* 8085350C */ void setSibukiEffect(); + /* 8085366C */ void setDashSibukiEffect(); + /* 80853730 */ void setWaterFallEffect(); + /* 8085392C */ void setFlySound(); + /* 80853BCC */ void action(); + /* 80853EF0 */ void mtx_set(); + /* 80853FB0 */ void cc_set(); + /* 80854058 */ void execute(); + /* 80854190 */ void _delete(); + /* 80854220 */ void ctrlJoint(J3DJoint*, J3DModel*); + /* 808542DC */ void JointCallBack(J3DJoint*, int); + /* 80854328 */ void CreateHeap(); + /* 808544D8 */ void create(); + + void setEvent() { + field_0x6e1 = 0; + field_0x740 = 2; + field_0x744 = 0; + } + + void setKagoPath(u8 i_pathNo) { + if (i_pathNo != 0xFF) { + field_0x76c = dPath_GetRoomPath(i_pathNo, fopAcM_GetRoomNo(this)); + } + } + + MtxP getLegR3Mtx() { return mLegR3Mtx; } + + /* 0x568 */ u8 field_0x568[0x620 - 0x568]; + /* 0x620 */ Mtx mLegR3Mtx; + /* 0x650 */ u8 field_0x650[0x6E1 - 0x650]; + /* 0x6E1 */ u8 field_0x6e1; + /* 0x6E2 */ u8 field_0x6E2[0x740 - 0x6E2]; + /* 0x740 */ int field_0x740; + /* 0x744 */ int field_0x744; + /* 0x748 */ u8 field_0x748[0x76C - 0x748]; + /* 0x76C */ dPath* field_0x76c; +}; #endif /* D_A_KAGO_H */ diff --git a/include/rel/d/a/d_a_midna/d_a_midna.h b/include/rel/d/a/d_a_midna/d_a_midna.h index ac1347e7ad7..529f8de7c9d 100644 --- a/include/rel/d/a/d_a_midna/d_a_midna.h +++ b/include/rel/d/a/d_a_midna/d_a_midna.h @@ -166,10 +166,12 @@ class daMidna_c : public fopAc_ac_c { inline static BOOL checkMidnaRealBody(); - bool i_checkMidnaTired() { + static bool i_checkMidnaTired() { return dComIfGs_isTransformLV(3) && !i_dComIfGs_isEventBit(0x1E08); } + void resetRatBody() {} + static u8 const m_texDataTable[84]; static u8 const m_anmDataTable[636]; diff --git a/include/rel/d/a/e/d_a_e_pm/d_a_e_pm.h b/include/rel/d/a/e/d_a_e_pm/d_a_e_pm.h index 4632ab7df1d..67695e6d74d 100644 --- a/include/rel/d/a/e/d_a_e_pm/d_a_e_pm.h +++ b/include/rel/d/a/e/d_a_e_pm/d_a_e_pm.h @@ -1,6 +1,72 @@ #ifndef D_A_E_PM_H #define D_A_E_PM_H -#include "dolphin/types.h" +#include "f_op/f_op_actor_mng.h" + +class daE_PM_c : public fopEn_enemy_c { +public: + /* 80741FB4 */ void DemoSkip(int); + /* 80742004 */ void DemoSkipCallBack(void*, int); + /* 80742038 */ void CreateHeap(); + /* 80742448 */ void initCcCylinder(); + /* 807424C0 */ void setCcCylinder(); + /* 80742508 */ void ctrlJoint(J3DJoint*, J3DModel*); + /* 80742600 */ void Particle_Set(u16, cXyz); + /* 80742674 */ void SetAnm(int, int, f32, f32); + /* 80742810 */ void Yazirushi(); + /* 807428A8 */ void SearchRndP(); + /* 80742958 */ void SearchFarP(); + /* 80742C94 */ void SearchNearP(); + /* 80742E1C */ void SearchNextPos(); + /* 80742FB4 */ void SetGakkiEffect(); + /* 807430C4 */ void CameraSet(); + /* 80743210 */ void SetStopingCam(); + /* 80743294 */ void SetStopCam(cXyz, f32, f32, s16); + /* 807433E8 */ void SetMoveCam2(f32, f32); + /* 80743524 */ void SetMoveCam(f32, f32); + /* 80743600 */ void SetReleaseCam(); + /* 807436A4 */ void Ap_StartAction(); + /* 80743D8C */ void Ap_CreateAction(); + /* 807444F0 */ void Ap_EscapeAction(); + /* 80744790 */ void AppearAction(); + /* 80744878 */ void DemoBeforeEscape(); + /* 80744DA0 */ void DemoAfterEscape(); + /* 807453F4 */ void DemoMoveAction(); + /* 80745438 */ void WaitAction(); + /* 807455F4 */ void GroundCheck(); + /* 80745970 */ void EscapeAction(); + /* 80745C44 */ void DeathAction(); + /* 80745DBC */ void Action(); + /* 80745ED0 */ void DemoBossStart2(); + /* 80746624 */ void DemoBossStart(); + /* 80747194 */ void BossEscapeAction(); + /* 807476A0 */ void BossDamageAction(); + /* 80747F38 */ void BossWaitAction(); + /* 807480A4 */ void BossDeathAction(); + /* 80748964 */ void BossAction(); + /* 80748B18 */ void Execute(); + /* 80748D74 */ void StartAction(); + /* 8074954C */ void GakkiLoopAction(cXyz, f32); + /* 807499C0 */ void DemoCreateAction(); + /* 80749C0C */ void CreateAction(); + /* 80749D9C */ void CreateChk(); + /* 80749ED0 */ void LampAction(); + /* 8074A14C */ void DamageAction(); + /* 8074A210 */ void At_Check(); + /* 8074A3DC */ void ObjHit(); + /* 8074A644 */ void EyeMove(); + /* 8074A6CC */ void Draw(); + /* 8074AAC0 */ void Delete(); + /* 8074AB28 */ void setBaseMtx(); + /* 8074ABA8 */ void setGakkiBaseMtx(); + /* 8074AC10 */ void setLampBaseMtx(); + /* 8074AEF8 */ void SkipChk(); + /* 8074B4DC */ void Create(); + + void AppearSet() { mAppear = true; } + + /* 0x5AC */ u8 field_0x5ac[0x619 - 0x5AC]; + /* 0x619 */ bool mAppear; +}; #endif /* D_A_E_PM_H */ diff --git a/include/rel/d/a/e/d_a_e_yc/d_a_e_yc.h b/include/rel/d/a/e/d_a_e_yc/d_a_e_yc.h index b8f6238b92d..eecc40dbf17 100644 --- a/include/rel/d/a/e/d_a_e_yc/d_a_e_yc.h +++ b/include/rel/d/a/e/d_a_e_yc/d_a_e_yc.h @@ -1,141 +1,46 @@ #ifndef D_A_E_YC_H #define D_A_E_YC_H -#include "dolphin/types.h" -// #include "f_op/f_op_actor.h" -// #include "Z2AudioLib/Z2Creature.h" -// #include "d/com/d_com_inf_game.h" -// #include "d/bg/d_bg_s_acch.h" -// #include "d/cc/d_cc_d.h" - -// struct dCcD_GStts { -// /* 80083760 */ dCcD_GStts(); -// /* 80083830 */ void Move(); -// }; - -// struct dCcD_Stts { -// /* 80083860 */ void Init(int, int, fopAc_ac_c*); -// }; - -// struct dCcD_SrcSph {}; - -// struct dCcD_Sph { -// /* 80084A34 */ void Set(dCcD_SrcSph const&); -// }; - -// struct cCcD_Obj {}; - -// struct dCcD_GObjInf { -// /* 80083A28 */ dCcD_GObjInf(); -// /* 80084460 */ int ChkTgHit(); -// /* 800844F8 */ cCcD_Obj* GetTgHitObj(); -// }; - -// struct dBgS_PolyPassChk { -// /* 80078E68 */ void SetObj(); -// }; - -// struct dBgS_ObjAcch { -// /* 807F274C */ ~dBgS_ObjAcch(); -// }; - -// struct dBgS_AcchCir { -// /* 80075EAC */ dBgS_AcchCir(); -// /* 80075F58 */ void SetWall(f32, f32); -// }; - -// struct dBgS {}; - -// struct dBgS_Acch { -// /* 80075F94 */ ~dBgS_Acch(); -// /* 800760A0 */ dBgS_Acch(); -// /* 80076248 */ void Set(cXyz*, cXyz*, fopAc_ac_c*, int, dBgS_AcchCir*, cXyz*, csXyz*, csXyz*); -// /* 80076AAC */ void CrrPos(dBgS&); -// }; - -// struct cM3dGSph { -// /* 8026F648 */ void SetC(cXyz const&); -// /* 8026F708 */ void SetR(f32); -// /* 807F26BC */ ~cM3dGSph(); -// }; - -// struct cM3dGAab { -// /* 807F2704 */ ~cM3dGAab(); -// }; - -// struct cCcS { -// /* 80264BA8 */ void Set(cCcD_Obj*); -// }; - -// struct request_of_phase_process_class {}; - -// struct mDoMtx_stack_c { -// /* 8000CE38 */ void scaleM(f32, f32, f32); - -// static u8 now[48]; -// }; - -// struct daE_YC_HIO_c { -// /* 807EFECC */ daE_YC_HIO_c(); -// /* 807F27BC */ ~daE_YC_HIO_c(); -// }; - -// struct dVibration_c { -// /* 8006FA24 */ void StartShock(int, int, cXyz); -// }; - -// struct dPa_levelEcallBack {}; - -// struct dPa_control_c { -// struct level_c { -// /* 8004B918 */ void getEmitter(u32); -// }; - -// /* 8004C218 */ void setHitMark(u16, fopAc_ac_c*, cXyz const*, csXyz const*, cXyz const*, u32); -// /* 8004D4CC */ void set(u32, u8, u16, cXyz const*, dKy_tevstr_c const*, csXyz const*, -// cXyz const*, u8, dPa_levelEcallBack*, s8, _GXColor const*, -// _GXColor const*, cXyz const*, f32); -// /* 8004CA90 */ void set(u8, u16, cXyz const*, dKy_tevstr_c const*, csXyz const*, cXyz const*, -// u8, dPa_levelEcallBack*, s8, _GXColor const*, _GXColor const*, -// cXyz const*, f32); -// }; - -// class e_yc_class : public fopAc_ac_c { -// public: -// /* 0x568 */ u8 field_0x568[80]; -// /* 0x5B8 */ int field_0x5B8; -// /* 0x5BC */ Z2CreatureEnemy mEnemy; -// /* 0x660 */ int mAnm; -// /* 0x664 */ int field_0x664; -// /* 0x668 */ u8 field_0x668[6]; -// /* 0x66E */ s16 mCurrentAction; -// /* 0x670 */ s16 field_0x670; -// /* 0x672 */ u8 field_0x672[2]; -// /* 0x674 */ f32 field_0x674; -// /* 0x678 */ f32 field_0x678; -// /* 0x67C */ f32 field_0x67C; -// /* 0x680 */ s16 field_0x680; -// /* 0x682 */ u8 field_0x682[2]; -// /* 0x684 */ f32 field_0x684; -// /* 0x688 */ u32 field_0x688; -// /* 0x68C */ u8 field_0x68C[4]; -// /* 0x690 */ f32 field_0x690; -// /* 0x694 */ u8 field_0x694[28]; -// /* 0x69C */ f32 field_0x69C; -// /* 0x6A0 */ s16 field_0x6A0; -// /* 0x6A2 */ s16 field_0x6A2; -// /* 0x6A4 */ s16 field_0x6A4; -// /* 0x6A6 */ s16 field_0x6A6; -// /* 0x6A8 */ s16 field_0x6A8; -// /* 0x6AA */ s16 field_0x6AA; -// /* 0x6AC */ void* field_0x6AC; -// /* 0x6B0 */ u8 field_0x6B0[72]; -// /* 0x6F4 */ dBgS_Acch mBgS_Acch; -// /* 0x8CC */ u8 field_0x8CC[28]; -// /* 0x8E8 */ dCcD_GStts mCcD_GStts; -// /* 0x908 */ dCcD_GObjInf mCcD_GObjInf; -// /* 0xA0C */ u8 field_0xA0C[364]; -// /* 0xB78 */ cCcD_Obj* mpTgHitObj; -// }; +#include "f_op/f_op_actor_mng.h" + +class e_yc_class : public fopEn_enemy_c { +public: + MtxP getLegR3Mtx() { return field_0x5B8->getModel()->i_getAnmMtx(28); } + + /* 0x5AC */ u8 field_0x5ac[0x5B8 - 0x5AC]; + /* 0x5B8 */ mDoExt_McaMorfSO* field_0x5B8; + /* 0x5BC */ Z2CreatureEnemy mEnemy; + /* 0x660 */ int mAnm; + /* 0x664 */ int field_0x664; + /* 0x668 */ u8 field_0x668[6]; + /* 0x66E */ s16 mCurrentAction; + /* 0x670 */ s16 field_0x670; + /* 0x672 */ u8 field_0x672[2]; + /* 0x674 */ f32 field_0x674; + /* 0x678 */ f32 field_0x678; + /* 0x67C */ f32 field_0x67C; + /* 0x680 */ s16 field_0x680; + /* 0x682 */ u8 field_0x682[2]; + /* 0x684 */ f32 field_0x684; + /* 0x688 */ u32 field_0x688; + /* 0x68C */ u8 field_0x68C[4]; + /* 0x690 */ f32 field_0x690; + /* 0x694 */ u8 field_0x694[28]; + /* 0x69C */ f32 field_0x69C; + /* 0x6A0 */ s16 field_0x6A0; + /* 0x6A2 */ s16 field_0x6A2; + /* 0x6A4 */ s16 field_0x6A4; + /* 0x6A6 */ s16 field_0x6A6; + /* 0x6A8 */ s16 field_0x6A8; + /* 0x6AA */ s16 field_0x6AA; + /* 0x6AC */ void* field_0x6AC; + /* 0x6B0 */ u8 field_0x6B0[72]; + /* 0x6F4 */ dBgS_Acch mBgS_Acch; + /* 0x8CC */ u8 field_0x8CC[28]; + /* 0x8E8 */ dCcD_GStts mCcD_GStts; + /* 0x908 */ dCcD_GObjInf mCcD_GObjInf; + /* 0xA0C */ u8 field_0xA0C[364]; + /* 0xB78 */ cCcD_Obj* mpTgHitObj; +}; #endif /* D_A_E_YC_H */ diff --git a/include/rel/d/a/kytag/d_a_kytag03/d_a_kytag03.h b/include/rel/d/a/kytag/d_a_kytag03/d_a_kytag03.h index b9589199d0f..b5c3b69de53 100644 --- a/include/rel/d/a/kytag/d_a_kytag03/d_a_kytag03.h +++ b/include/rel/d/a/kytag/d_a_kytag03/d_a_kytag03.h @@ -1,6 +1,27 @@ #ifndef D_A_KYTAG03_H #define D_A_KYTAG03_H -#include "dolphin/types.h" +#include "d/d_path.h" +#include "f_op/f_op_actor_mng.h" + +class kytag03_class : public fopAc_ac_c { +public: + /* 0x568 */ dPath* mpPath; + /* 0x56C */ JPABaseEmitter* mpEmitter; + /* 0x570 */ f32 field_0x570; + /* 0x574 */ f32 field_0x574; + /* 0x578 */ f32 field_0x578; + /* 0x57C */ f32 field_0x57c; + /* 0x580 */ int field_0x580; + /* 0x584 */ u8 field_0x584; + /* 0x585 */ u8 field_0x585; + /* 0x586 */ u8 field_0x586; + /* 0x587 */ u8 field_0x587; + /* 0x588 */ u8 field_0x588; + /* 0x589 */ u8 field_0x589; + /* 0x58A */ u16 field_0x58a; + /* 0x58C */ u8 field_0x58C[0x58E - 0x58C]; + /* 0x58E */ u8 field_0x58e; +}; #endif /* D_A_KYTAG03_H */ diff --git a/include/rel/d/a/npc/d_a_npc_gwolf/d_a_npc_gwolf.h b/include/rel/d/a/npc/d_a_npc_gwolf/d_a_npc_gwolf.h index 36997d7e16c..49edda02ce1 100644 --- a/include/rel/d/a/npc/d_a_npc_gwolf/d_a_npc_gwolf.h +++ b/include/rel/d/a/npc/d_a_npc_gwolf/d_a_npc_gwolf.h @@ -1,6 +1,66 @@ #ifndef D_A_NPC_GWOLF_H #define D_A_NPC_GWOLF_H -#include "dolphin/types.h" +#include "f_op/f_op_actor_mng.h" +#include "d/a/d_a_npc.h" + +class daNpc_GWolf_c : public daNpcF_c { +public: + /* 809F30AC */ daNpc_GWolf_c(); + /* 809F34C0 */ void create(); + /* 809F37C0 */ void CreateHeap(); + /* 809F3BD8 */ void Delete(); + /* 809F3C0C */ void Execute(); + /* 809F3C2C */ void Draw(); + /* 809F3CBC */ void draw(int, int, f32, GXColorS10*, int); + /* 809F3FB8 */ void ctrlJoint(J3DJoint*, J3DModel*); + /* 809F41EC */ void createHeapCallBack(fopAc_ac_c*); + /* 809F420C */ void ctrlJointCallBack(J3DJoint*, int); + /* 809F4E38 */ void getTypeFromParam(); + /* 809F4E84 */ void getModeFromParam(); + /* 809F4F00 */ void isDelete(); + /* 809F4FF4 */ void reset(); + /* 809F520C */ void playMotion(); + /* 809F55D0 */ void chkAction(int (daNpc_GWolf_c::*)(void*)); + /* 809F55FC */ void setAction(int (daNpc_GWolf_c::*)(void*)); + /* 809F56A4 */ void selectAction(); + /* 809F5770 */ void doNormalAction(int); + /* 809F5884 */ void doEvent(); + /* 809F5B60 */ void setLookMode(int); + /* 809F5B84 */ void lookat(); + /* 809F5E0C */ void ECut_attackWarp(int); + /* 809F6548 */ void ECut_attackWarpHorse(int); + /* 809F6BFC */ void ECut_howlingSessionA(int); + /* 809F70A8 */ void meetGWolfSkip(); + /* 809F70EC */ void ECut_meetGWolf(int); + /* 809F71E0 */ void wait(void*); + /* 809F75C0 */ void waitHowling(void*); + /* 809F775C */ void waitBrave(void*); + /* 809F77E4 */ void talk(void*); + /* 809F797C */ void test(void*); + /* 809F7A30 */ void getGroundSlope(dBgS_ObjAcch&, s16); + + /* 809F32C0 */ ~daNpc_GWolf_c(); + /* 809F4258 */ void setParam(); + /* 809F4390 */ BOOL main(); + /* 809F4558 */ BOOL ctrlBtk(); + /* 809F4638 */ void adjustShapeAngle(); + /* 809F4698 */ void setAttnPos(); + /* 809F4BB0 */ bool setExpressionAnm(int, bool); + /* 809F4BB8 */ void setExpression(int, f32); + /* 809F4BBC */ void setMotionAnm(int, f32); + /* 809F4DE8 */ void setMotion(int, f32, int); + /* 809F4E2C */ BOOL drawDbgInfo(); + /* 809F4E34 */ void drawOtherMdls(); + + void setHowlingEndFlag() { field_0xe1c = 2; } + void setHowlingFlag() { field_0xe1c = 1; } + + static void* mEvtCutNameList[5]; + static u8 mEvtCutList[60]; + + /* 0xB48 */ u8 field_0xb48[0xE1C - 0xB48]; + /* 0xE1C */ u8 field_0xe1c; +}; #endif /* D_A_NPC_GWOLF_H */ diff --git a/include/rel/d/a/npc/d_a_npc_tk/d_a_npc_tk.h b/include/rel/d/a/npc/d_a_npc_tk/d_a_npc_tk.h index d848cb8aa78..292665a3e75 100644 --- a/include/rel/d/a/npc/d_a_npc_tk/d_a_npc_tk.h +++ b/include/rel/d/a/npc/d_a_npc_tk/d_a_npc_tk.h @@ -1,14 +1,16 @@ #ifndef D_A_NPC_TK_H #define D_A_NPC_TK_H -#include "dolphin/types.h" +#include "f_op/f_op_actor_mng.h" +#include "d/d_path.h" struct cXyz; class fopAc_ac_c; class J3DJoint; class J3DModel; -struct daNPC_TK_c { +class daNPC_TK_c : public fopAc_ac_c { +public: /* 80B01498 */ void setBck(int, u8, f32, f32); /* 80B0153C */ void checkBck(int); /* 80B01598 */ void draw(); @@ -59,10 +61,19 @@ struct daNPC_TK_c { /* 80B0BBC8 */ void CreateHeap(); /* 80B0BD24 */ void create(); - void setBump() { mBump |= 4; } + void setBump() { mFlags |= 4; } + void setEventWolf() { mFlags |= 0x80; } - u8 field_0x0[0x6BE]; - u16 mBump; + void setHawkPath(u8 i_pathNo) { + if (i_pathNo != 0xFF) { + field_0x6c8 = dPath_GetRoomPath(i_pathNo, fopAcM_GetRoomNo(this)); + } + } + + /* 0x568 */ u8 field_0x568[0x6BE - 0x568]; + /* 0x6BE */ u16 mFlags; + /* 0x6C0 */ u8 field_0x6c0[0x6C8 - 0x6C0]; + /* 0x6C8 */ dPath* field_0x6c8; }; #endif /* D_A_NPC_TK_H */ diff --git a/include/rel/d/a/obj/d_a_obj_crope/d_a_obj_crope.h b/include/rel/d/a/obj/d_a_obj_crope/d_a_obj_crope.h index 6fc3f8a5e4b..f0a092b44f5 100644 --- a/include/rel/d/a/obj/d_a_obj_crope/d_a_obj_crope.h +++ b/include/rel/d/a/obj/d_a_obj_crope/d_a_obj_crope.h @@ -1,6 +1,53 @@ #ifndef D_A_OBJ_CROPE_H #define D_A_OBJ_CROPE_H -#include "dolphin/types.h" +#include "d/cc/d_cc_d.h" +#include "f_op/f_op_actor_mng.h" + +class daObjCrope_c : public fopAc_ac_c { +public: + /* 80BCCCD8 */ void createHeap(); + /* 80BCCD64 */ void create(); + /* 80BCD524 */ ~daObjCrope_c(); + /* 80BCD6C4 */ void setNormalRopePos(); + /* 80BCD9EC */ void setRideRopePos(); + /* 80BCE4FC */ void execute(); + /* 80BCE9BC */ void draw(); + + cXyz* getRopeStartPos() { return mLineMat.getPos(0); } + cXyz* getRopeEndPos() { return &mLineMat.getPos(0)[99]; } + cXyz* getRopeVec() { return &mRopeVec; } + cXyz& getPlayerNearPos() { return mPlayerNearPos; } + void onOutFlg() { mOutFlg = true; } + void setFrontJoint(int i_jointNo) { mFrontJoint = i_jointNo; } + void setBackJoint(int i_jointNo) { mBackJoint = i_jointNo; } + + f32 getStartRate(const cXyz* param_0) { + return field_0x714 ? field_0x724 * (param_0->x - getRopeStartPos()->x) : + field_0x724 * (param_0->z - getRopeStartPos()->z); + } + + void rideKeep() { + setFrontJoint(-2); + setBackJoint(-1); + } + + /* 0x0568 */ request_of_phase_process_class mPhase; + /* 0x0570 */ dCcD_Stts mCcStts; + /* 0x05AC */ dCcD_Sph mCollider; + /* 0x06E4 */ Mtx field_0x6e4; + /* 0x0714 */ u8 field_0x714; + /* 0x0715 */ u8 mOutFlg; + /* 0x0716 */ u8 mCoCancelTimer; + /* 0x0718 */ int mFrontJoint; + /* 0x071C */ int mBackJoint; + /* 0x0720 */ f32 field_0x720; + /* 0x0724 */ f32 field_0x724; + /* 0x0728 */ cXyz mRopeVec; + /* 0x0734 */ cXyz mPlayerNearPos; + /* 0x0740 */ cXyz field_0x740[98]; + /* 0x0BD8 */ cXyz field_0xbd8[98]; + /* 0x1070 */ mDoExt_3DlineMat1_c mLineMat; +}; #endif /* D_A_OBJ_CROPE_H */ diff --git a/include/rel/d/a/obj/d_a_obj_sekizoa/d_a_obj_sekizoa.h b/include/rel/d/a/obj/d_a_obj_sekizoa/d_a_obj_sekizoa.h index 24478afa51e..29183c227ec 100644 --- a/include/rel/d/a/obj/d_a_obj_sekizoa/d_a_obj_sekizoa.h +++ b/include/rel/d/a/obj/d_a_obj_sekizoa/d_a_obj_sekizoa.h @@ -1,6 +1,114 @@ #ifndef D_A_OBJ_SEKIZOA_H #define D_A_OBJ_SEKIZOA_H -#include "dolphin/types.h" +#include "f_op/f_op_actor_mng.h" +#include "d/a/d_a_npc.h" + +class daObj_Sekizoa_c : public daNpcT_c { +public: + /* 80CCE34C */ ~daObj_Sekizoa_c(); + /* 80CCE570 */ void create(); + /* 80CCE8B0 */ void CreateHeap(); + /* 80CCEC54 */ void Delete(); + /* 80CCEC88 */ void Execute(); + /* 80CCECA8 */ void Draw(); + /* 80CCED74 */ void createHeapCallBack(fopAc_ac_c*); + /* 80CCED94 */ void srchSekizoa(void*, void*); + /* 80CCEE30 */ void getSekizoaP(int); + /* 80CCEFA4 */ void getKMsgTagP(); + /* 80CCF03C */ void isDelete(); + /* 80CCF138 */ void reset(); + /* 80CCF708 */ void srchActors(); + /* 80CD04FC */ void setYariAnm(int, int, f32); + /* 80CD0A84 */ void selectAction(); + /* 80CD0B08 */ void chkAction(int (daObj_Sekizoa_c::*)(void*)); + /* 80CD0B34 */ void setAction(int (daObj_Sekizoa_c::*)(void*)); + /* 80CD0BDC */ void checkMoveDirection(); + /* 80CD0DE8 */ void getWaitMotionNo(); + /* 80CD0E30 */ void getGameMotionNo(); + /* 80CD0E78 */ void getNoJumpMotionNo(); + /* 80CD0EAC */ void getHitMotionNo(); + /* 80CD0EE0 */ void getStepMotionNo(); + /* 80CD0F14 */ void jump(); + /* 80CD14D8 */ void landing(); + /* 80CD1688 */ void cutStart(int); + /* 80CD2708 */ void cutTurn(int); + /* 80CD2908 */ void cutJump(int); + /* 80CD2B64 */ void cutGoal(int); + /* 80CD376C */ void cutExit(int); + /* 80CD38F0 */ void cutFree(int); + /* 80CD3BD8 */ void cutExtinction(int); + /* 80CD3F08 */ void wait(void*); + /* 80CD425C */ void puzzle(void*); + /* 80CD45B0 */ void talk(void*); + /* 80CD5A40 */ daObj_Sekizoa_c(daNpcT_faceMotionAnmData_c const*, daNpcT_motionAnmData_c const*, + daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int, + daNpcT_MotionSeqMngr_c::sequenceStepData_c const*, int, + daNpcT_evtData_c const*, char**); + /* 80CD5B84 */ void chkGoal(); + /* 801312C8 */ void setWolfHowling(); + + /* 80CD5B7C */ s32 getBackboneJointNo(); + /* 80CD5B74 */ s32 getHeadJointNo(); + /* 80CCF358 */ void afterJntAnm(int); + /* 80CCF3E4 */ void setParam(); + /* 80CCF6BC */ bool checkChangeEvt(); + /* 80CCF9A8 */ bool evtTalk(); + /* 80CCFAA8 */ bool evtCutProc(); + /* 80CCF704 */ void setAfterTalkMotion(); + /* 80CCFBA0 */ void action(); + /* 80CCFD08 */ void beforeMove(); + /* 80CCFD80 */ void setAttnPos(); + /* 80CD009C */ void setCollision(); + /* 80CD03C0 */ int drawDbgInfo(); + /* 80CD03C8 */ void drawOtherMdl(); + /* 80CD05D0 */ void drawGhost(); + /* 80CD06BC */ bool afterSetMotionAnm(int, int, f32, int); + + u8 getType() { + int prm = fopAcM_GetParam(this) >> 0x1C; + + u8 type; + switch (mSubtype) { + case 0: + switch (prm) { + case 1: + type = 2; + break; + case 2: + type = 4; + break; + case 3: + type = 6; + break; + default: + type = 0; + break; + } + break; + case 1: + switch (prm) { + case 1: + type = 3; + break; + case 2: + type = 5; + break; + default: + type = 1; + break; + } + break; + default: + type = 0; + break; + } + + return type; + } + + static void* mCutNameList[9]; + static u8 mCutList[108]; +}; #endif /* D_A_OBJ_SEKIZOA_H */ diff --git a/include/rel/d/a/obj/d_a_obj_smw_stone/d_a_obj_smw_stone.h b/include/rel/d/a/obj/d_a_obj_smw_stone/d_a_obj_smw_stone.h index 15caae65318..34b3b222346 100644 --- a/include/rel/d/a/obj/d_a_obj_smw_stone/d_a_obj_smw_stone.h +++ b/include/rel/d/a/obj/d_a_obj_smw_stone/d_a_obj_smw_stone.h @@ -1,6 +1,23 @@ #ifndef D_A_OBJ_SMW_STONE_H #define D_A_OBJ_SMW_STONE_H -#include "dolphin/types.h" +#include "f_op/f_op_actor_mng.h" + +class daSmWStone_c : public fopAc_ac_c { +public: + /* 80CDE538 */ daSmWStone_c(); + /* 80CDE588 */ ~daSmWStone_c(); + /* 80CDE614 */ void create(); + /* 80CDE8D8 */ void execute(); + /* 80CDE92C */ void draw(); + /* 80CDEA2C */ void Delete(); + /* 80CDEAA4 */ void exeModeHowl(); + /* 80CDEBA0 */ void setModelMtx(); + /* 80CDEC04 */ void createHeap(); + /* 80CDED30 */ void init(); + /* 80CDED9C */ void chkWlfInRange(); + + int getTuneId() { return 2; } +}; #endif /* D_A_OBJ_SMW_STONE_H */ diff --git a/include/rel/d/a/obj/d_a_obj_wind_stone/d_a_obj_wind_stone.h b/include/rel/d/a/obj/d_a_obj_wind_stone/d_a_obj_wind_stone.h index aabab379b8d..44a06831f57 100644 --- a/include/rel/d/a/obj/d_a_obj_wind_stone/d_a_obj_wind_stone.h +++ b/include/rel/d/a/obj/d_a_obj_wind_stone/d_a_obj_wind_stone.h @@ -1,6 +1,28 @@ #ifndef D_A_OBJ_WIND_STONE_H #define D_A_OBJ_WIND_STONE_H -#include "dolphin/types.h" +#include "f_op/f_op_actor_mng.h" + +class daWindStone_c : public fopAc_ac_c { +public: + /* 80D37A18 */ daWindStone_c(); + /* 80D37A68 */ ~daWindStone_c(); + /* 80D37AF4 */ void createHeap(); + /* 80D37C20 */ void create(); + /* 80D37F0C */ void execute(); + /* 80D37F6C */ void draw(); + /* 80D3806C */ void Delete(); + /* 80D3811C */ void setModelMtx(); + /* 80D38180 */ void init(); + /* 80D381EC */ void chkWlfInRange(); + /* 80D38278 */ void chkEveOccur(); + /* 80D382C4 */ void exeModeHowl(); + /* 80D3835C */ void exeModeMapDisp(); + /* 80D383FC */ void chkMapDispMode(); + /* 80D384C4 */ void getGoldWolfIdx(); + + s8 getTuneId() { return fopAcM_GetParamBit(this, 4, 4); } + int getNextSceneId() { return fopAcM_GetParamBit(this, 0, 4); } +}; #endif /* D_A_OBJ_WIND_STONE_H */ diff --git a/include/rel/d/a/obj/d_a_obj_yobikusa/d_a_obj_yobikusa.h b/include/rel/d/a/obj/d_a_obj_yobikusa/d_a_obj_yobikusa.h index d9d77a8fbff..60ad8fc3787 100644 --- a/include/rel/d/a/obj/d_a_obj_yobikusa/d_a_obj_yobikusa.h +++ b/include/rel/d/a/obj/d_a_obj_yobikusa/d_a_obj_yobikusa.h @@ -33,7 +33,7 @@ class daObjYobikusa_c : public fopAc_ac_c { static u8 const M_attr[64]; static u8 ActionTable[72]; - u8 getType() { return mSubtype & 0x7F; } + int getType() { return mSubtype & 0x7F; } u8 getPathID() { return fopAcM_GetParam(this); } bool isPlayerCorrect() { return (s8)(u8)(fopAcM_GetParam(this) >> 8) > 0; } diff --git a/include/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item.h b/include/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item.h index 13039185d45..0922505e6d9 100644 --- a/include/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item.h +++ b/include/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item.h @@ -1,6 +1,6 @@ #ifndef D_A_TAG_ATTACK_ITEM_H #define D_A_TAG_ATTACK_ITEM_H -#include "dolphin/types.h" +#include "f_op/f_op_actor_mng.h" #endif /* D_A_TAG_ATTACK_ITEM_H */ diff --git a/include/rel/d/a/tag/d_a_tag_howl/d_a_tag_howl.h b/include/rel/d/a/tag/d_a_tag_howl/d_a_tag_howl.h index e77161af760..c43d65da4ef 100644 --- a/include/rel/d/a/tag/d_a_tag_howl/d_a_tag_howl.h +++ b/include/rel/d/a/tag/d_a_tag_howl/d_a_tag_howl.h @@ -6,8 +6,10 @@ class daTag_Howl_c : public fopAc_ac_c { public: - u8 field_0x568; - u8 field_0x569; + /* 0x568 */ s8 mCurveID; + /* 0x569 */ u8 field_0x569; + + s8 getCurveID() { return mCurveID; } /* 8048D958 */ int create(); /* 8048D9BC */ int destroy(); @@ -17,7 +19,6 @@ class daTag_Howl_c : public fopAc_ac_c { /* 8048DC1C */ int getParam(); /* 8048DC68 */ u8 getSwitchBit(); /* 8048DCFC */ virtual ~daTag_Howl_c() {} - }; // Size: 0x570 #endif /* D_A_TAG_HOWL_H */ diff --git a/include/rel/d/a/tag/d_a_tag_wara_howl/d_a_tag_wara_howl.h b/include/rel/d/a/tag/d_a_tag_wara_howl/d_a_tag_wara_howl.h index 83937c34b09..29e46103cae 100644 --- a/include/rel/d/a/tag/d_a_tag_wara_howl/d_a_tag_wara_howl.h +++ b/include/rel/d/a/tag/d_a_tag_wara_howl/d_a_tag_wara_howl.h @@ -15,7 +15,7 @@ class daTagWrHowl_c : public fopAc_ac_c { /* 80D63F74 */ virtual ~daTagWrHowl_c(); - u8 getTuneId() { return fopAcM_GetParamBit(this, 4, 4); } + s8 getTuneId() { return fopAcM_GetParamBit(this, 4, 4); } /* 0x56C */ f32 field_0x56c; /* 0x570 */ f32 field_0x570; diff --git a/libs/Z2AudioLib/Z2WolfHowlMgr.cpp b/libs/Z2AudioLib/Z2WolfHowlMgr.cpp index 69ae5340684..93aa6f93aa2 100644 --- a/libs/Z2AudioLib/Z2WolfHowlMgr.cpp +++ b/libs/Z2AudioLib/Z2WolfHowlMgr.cpp @@ -244,7 +244,7 @@ void Z2WolfHowlMgr::calcPitchMod(f32 param_0, f32 param_1) { } /* 802CAED4-802CB100 2C5814 022C+00 0/0 1/1 0/0 .text startWolfHowlSound__13Z2WolfHowlMgrFffbf */ -void Z2WolfHowlMgr::startWolfHowlSound(f32 param_0, f32 param_1, bool param_2, f32 param_3) { +s8 Z2WolfHowlMgr::startWolfHowlSound(f32 param_0, f32 param_1, bool param_2, f32 param_3) { if (mCorrectCurveID > 1) { Z2GetSeqMgr()->i_setWindStoneVol(0.0f, 0); } @@ -291,7 +291,8 @@ void Z2WolfHowlMgr::startWolfHowlSound(f32 param_0, f32 param_1, bool param_2, f resetState(); } } - checkLine(); + + return checkLine(); } /* 802CB100-802CB320 2C5A40 0220+00 0/0 1/1 0/0 .text diff --git a/rel/d/a/d_a_kago/d_a_kago.cpp b/rel/d/a/d_a_kago/d_a_kago.cpp index d02013d7ec3..e9be8d14754 100644 --- a/rel/d/a/d_a_kago/d_a_kago.cpp +++ b/rel/d/a/d_a_kago/d_a_kago.cpp @@ -3,7 +3,8 @@ // Translation Unit: d_a_kago // -#include "rel/d/a/d_a_kago/d_a_kago.h" +// #include "rel/d/a/d_a_kago/d_a_kago.h" +#include "dolphin/types.h" #include "dol2asm.h" // diff --git a/rel/d/a/e/d_a_e_pm/d_a_e_pm.cpp b/rel/d/a/e/d_a_e_pm/d_a_e_pm.cpp index 045c6d593ef..ffb1e32dd13 100644 --- a/rel/d/a/e/d_a_e_pm/d_a_e_pm.cpp +++ b/rel/d/a/e/d_a_e_pm/d_a_e_pm.cpp @@ -3,7 +3,8 @@ // Translation Unit: d_a_e_pm // -#include "rel/d/a/e/d_a_e_pm/d_a_e_pm.h" +// #include "rel/d/a/e/d_a_e_pm/d_a_e_pm.h" +#include "dolphin/types.h" #include "d/cc/d_cc_d.h" #include "dol2asm.h" diff --git a/rel/d/a/e/d_a_e_yc/d_a_e_yc.cpp b/rel/d/a/e/d_a_e_yc/d_a_e_yc.cpp index 1218ffadf50..259e29d61a6 100644 --- a/rel/d/a/e/d_a_e_yc/d_a_e_yc.cpp +++ b/rel/d/a/e/d_a_e_yc/d_a_e_yc.cpp @@ -3,7 +3,8 @@ // Translation Unit: d_a_e_yc // -#include "rel/d/a/e/d_a_e_yc/d_a_e_yc.h" +// #include "rel/d/a/e/d_a_e_yc/d_a_e_yc.h" +#include "dolphin/types.h" #include "d/cc/d_cc_d.h" #include "dol2asm.h" diff --git a/rel/d/a/kytag/d_a_kytag03/d_a_kytag03.cpp b/rel/d/a/kytag/d_a_kytag03/d_a_kytag03.cpp index 8dc80e0f932..bf9a9410a31 100644 --- a/rel/d/a/kytag/d_a_kytag03/d_a_kytag03.cpp +++ b/rel/d/a/kytag/d_a_kytag03/d_a_kytag03.cpp @@ -3,7 +3,8 @@ // Translation Unit: d_a_kytag03 // -#include "rel/d/a/kytag/d_a_kytag03/d_a_kytag03.h" +// #include "rel/d/a/kytag/d_a_kytag03/d_a_kytag03.h" +#include "dolphin/types.h" #include "dol2asm.h" // diff --git a/rel/d/a/npc/d_a_npc_gwolf/d_a_npc_gwolf.cpp b/rel/d/a/npc/d_a_npc_gwolf/d_a_npc_gwolf.cpp index b861da2f8d7..1274382a623 100644 --- a/rel/d/a/npc/d_a_npc_gwolf/d_a_npc_gwolf.cpp +++ b/rel/d/a/npc/d_a_npc_gwolf/d_a_npc_gwolf.cpp @@ -3,7 +3,8 @@ // Translation Unit: d_a_npc_gwolf // -#include "rel/d/a/npc/d_a_npc_gwolf/d_a_npc_gwolf.h" +// #include "rel/d/a/npc/d_a_npc_gwolf/d_a_npc_gwolf.h" +#include "dolphin/types.h" #include "dol2asm.h" // diff --git a/rel/d/a/npc/d_a_npc_tk/d_a_npc_tk.cpp b/rel/d/a/npc/d_a_npc_tk/d_a_npc_tk.cpp index eb078d5a60d..21733365923 100644 --- a/rel/d/a/npc/d_a_npc_tk/d_a_npc_tk.cpp +++ b/rel/d/a/npc/d_a_npc_tk/d_a_npc_tk.cpp @@ -3,7 +3,8 @@ // Translation Unit: d_a_npc_tk // -#include "rel/d/a/npc/d_a_npc_tk/d_a_npc_tk.h" +// #include "rel/d/a/npc/d_a_npc_tk/d_a_npc_tk.h" +#include "dolphin/types.h" #include "d/cc/d_cc_d.h" #include "dol2asm.h" @@ -236,6 +237,63 @@ struct J3DFrameCtrl { /* 8032842C */ void checkPass(f32); }; +struct daNPC_TK_c { + /* 80B01498 */ void setBck(int, u8, f32, f32); + /* 80B0153C */ void checkBck(int); + /* 80B01598 */ void draw(); + /* 80B016D4 */ void checkBeforeBg(); + /* 80B01878 */ void setActionMode(int); + /* 80B018F4 */ void setAddCalcSpeedXZ(cXyz&, cXyz const&, f32, f32, f32); + /* 80B01C84 */ void chaseTargetPos(cXyz, f32, f32, s16); + /* 80B01D84 */ void getMasterPointer(); + /* 80B01DA0 */ void setMasterShoulder(cXyz*); + /* 80B01E48 */ void setAwayAction(int); + /* 80B01EF4 */ void setFlySE(); + /* 80B02254 */ void executeFly(); + /* 80B026F8 */ void initPerchDemo(int); + /* 80B02B5C */ void executePerchDemo(int); + /* 80B03658 */ void executePerch(); + /* 80B03754 */ void executeHandOn(); + /* 80B039A8 */ void checkWaterSurface(f32); + /* 80B03A70 */ void executeAttack(); + /* 80B048BC */ void executeAway(); + /* 80B04BF8 */ void setCarryActorMtx(); + /* 80B04F64 */ void getTakePosY(); + /* 80B04FA8 */ void getTakeOffPosY(); + /* 80B04FEC */ void executeBack(); + /* 80B05BD0 */ void getHanjoHandPos(); + /* 80B05C7C */ void executeStayHanjo(); + /* 80B05EC8 */ void executeAttackLink(); + /* 80B0686C */ void executeBackHanjo(); + /* 80B07114 */ void checkAttackDemo(); + /* 80B072CC */ void executeAttackDemo(); + /* 80B07610 */ void executeBackHanjoDemo(); + /* 80B08168 */ void executeWolfEvent(); + /* 80B08208 */ void calcWolfDemoCam(); + /* 80B082A4 */ void calcWolfDemoCam2(); + /* 80B0839C */ void executeWolfPerch(); + /* 80B09A3C */ void executeResistanceDemo(); + /* 80B0A444 */ void setHawkSideCamera(cXyz); + /* 80B0A500 */ void setHawkCamera(fopAc_ac_c*); + /* 80B0A568 */ void endHawkCamera(); + /* 80B0A614 */ void calcDemoCamera(); + /* 80B0B004 */ void checkActionSet(); + /* 80B0B284 */ void action(); + /* 80B0B5CC */ void mtx_set(); + /* 80B0B6DC */ void cc_set(); + /* 80B0B7CC */ void execute(); + /* 80B0B918 */ void _delete(); + /* 80B0B9AC */ void ctrlJoint(J3DJoint*, J3DModel*); + /* 80B0BB7C */ void JointCallBack(J3DJoint*, int); + /* 80B0BBC8 */ void CreateHeap(); + /* 80B0BD24 */ void create(); + + void setBump() { mBump |= 4; } + + u8 field_0x0[0x6BE]; + u16 mBump; +}; + // // Forward References: // diff --git a/rel/d/a/obj/d_a_obj_carry/d_a_obj_carry.cpp b/rel/d/a/obj/d_a_obj_carry/d_a_obj_carry.cpp index c7d08b684ad..66c7757cb4d 100644 --- a/rel/d/a/obj/d_a_obj_carry/d_a_obj_carry.cpp +++ b/rel/d/a/obj/d_a_obj_carry/d_a_obj_carry.cpp @@ -764,8 +764,8 @@ static dJntColData_c kibako_jc_data = { 1, 1, 0, - 0x42340000, - &kibako_jv_offset + 45.0f, + (Vec*)kibako_jv_offset }; /* 8047A71C-8047A728 -00001 000C+00 1/1 0/0 0/0 .data taru_jc_data */ @@ -773,8 +773,8 @@ static dJntColData_c taru_jc_data = { 1, 1, 0, - 0x42340000, - &taru_jv_offset + 45.0f, + (Vec*)taru_jv_offset }; /* 8047A728-8047A734 -00001 000C+00 0/1 0/0 0/0 .data @5956 */ diff --git a/rel/d/a/obj/d_a_obj_crope/d_a_obj_crope.cpp b/rel/d/a/obj/d_a_obj_crope/d_a_obj_crope.cpp index 48ca6f3c372..fa6a28ec25d 100644 --- a/rel/d/a/obj/d_a_obj_crope/d_a_obj_crope.cpp +++ b/rel/d/a/obj/d_a_obj_crope/d_a_obj_crope.cpp @@ -3,7 +3,8 @@ // Translation Unit: d_a_obj_crope // -#include "rel/d/a/obj/d_a_obj_crope/d_a_obj_crope.h" +// #include "rel/d/a/obj/d_a_obj_crope/d_a_obj_crope.h" +#include "dolphin/types.h" #include "d/cc/d_cc_d.h" #include "dol2asm.h" diff --git a/rel/d/a/obj/d_a_obj_sekizoa/d_a_obj_sekizoa.cpp b/rel/d/a/obj/d_a_obj_sekizoa/d_a_obj_sekizoa.cpp index 48b5b8e6aa6..5676e48910a 100644 --- a/rel/d/a/obj/d_a_obj_sekizoa/d_a_obj_sekizoa.cpp +++ b/rel/d/a/obj/d_a_obj_sekizoa/d_a_obj_sekizoa.cpp @@ -3,7 +3,8 @@ // Translation Unit: d_a_obj_sekizoa // -#include "rel/d/a/obj/d_a_obj_sekizoa/d_a_obj_sekizoa.h" +// #include "rel/d/a/obj/d_a_obj_sekizoa/d_a_obj_sekizoa.h" +#include "dolphin/types.h" #include "dol2asm.h" // diff --git a/rel/d/a/obj/d_a_obj_smw_stone/d_a_obj_smw_stone.cpp b/rel/d/a/obj/d_a_obj_smw_stone/d_a_obj_smw_stone.cpp index 3914735a19b..1ad8732ec7e 100644 --- a/rel/d/a/obj/d_a_obj_smw_stone/d_a_obj_smw_stone.cpp +++ b/rel/d/a/obj/d_a_obj_smw_stone/d_a_obj_smw_stone.cpp @@ -3,7 +3,8 @@ // Translation Unit: d_a_obj_smw_stone // -#include "rel/d/a/obj/d_a_obj_smw_stone/d_a_obj_smw_stone.h" +// #include "rel/d/a/obj/d_a_obj_smw_stone/d_a_obj_smw_stone.h" +#include "dolphin/types.h" #include "dol2asm.h" // diff --git a/rel/d/a/obj/d_a_obj_wind_stone/d_a_obj_wind_stone.cpp b/rel/d/a/obj/d_a_obj_wind_stone/d_a_obj_wind_stone.cpp index c4e44a29624..669623105d7 100644 --- a/rel/d/a/obj/d_a_obj_wind_stone/d_a_obj_wind_stone.cpp +++ b/rel/d/a/obj/d_a_obj_wind_stone/d_a_obj_wind_stone.cpp @@ -3,7 +3,8 @@ // Translation Unit: d_a_obj_wind_stone // -#include "rel/d/a/obj/d_a_obj_wind_stone/d_a_obj_wind_stone.h" +// #include "rel/d/a/obj/d_a_obj_wind_stone/d_a_obj_wind_stone.h" +#include "dolphin/types.h" #include "dol2asm.h" // diff --git a/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item.cpp b/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item.cpp index c70408043af..71e2f39d545 100644 --- a/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item.cpp +++ b/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item.cpp @@ -4,52 +4,42 @@ // #include "rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item.h" +#include "SSystem/SComponent/c_math.h" +#include "d/a/d_a_player.h" #include "d/cc/d_cc_d.h" +#include "d/com/d_com_inf_game.h" +#include "d/event/d_event_lib.h" #include "dol2asm.h" // // Types: // -struct csXyz { - /* 802673F4 */ csXyz(s16, s16, s16); -}; - -struct mDoMtx_stack_c { - /* 8000CD64 */ void transS(cXyz const&); - /* 8000CF44 */ void ZXYrotM(csXyz const&); -}; - -struct fopAc_ac_c { - /* 80018B64 */ fopAc_ac_c(); - /* 80018C8C */ ~fopAc_ac_c(); -}; - -struct daTagAtkItem_c { +// need to figure out how to use dEvLib_callback_c properly +class daTagAtkItem_c : public fopAc_ac_c /* , public dEvLib_callback_c */ { +public: /* 805A2958 */ void setBaseMtx(); - /* 805A2990 */ void Create(); - /* 805A2A34 */ void create(); - /* 805A2C48 */ void execute(); + /* 805A2990 */ int Create(); + /* 805A2A34 */ int create(); + /* 805A2C48 */ int execute(); /* 805A2CA8 */ void action(); - /* 805A2D10 */ void eventStart(); - /* 805A2D34 */ void eventEnd(); - /* 805A2D58 */ void checkHit(); + /* 805A2D58 */ BOOL checkHit(); /* 805A2F54 */ void createItem(); - /* 805A3038 */ bool _delete(); - /* 805A3118 */ ~daTagAtkItem_c(); -}; + /* 805A3038 */ int _delete(); -struct dEvLib_callback_c { - /* 8004886C */ void eventUpdate(); - /* 80048940 */ void orderEvent(int, int, int); - /* 805A30A0 */ ~dEvLib_callback_c(); - /* 805A30E8 */ bool eventRun(); - /* 805A30F0 */ bool eventStart(); - /* 805A30F8 */ bool eventEnd(); -}; - -struct cCcS { - /* 80264BA8 */ void Set(cCcD_Obj*); + /* 805A3118 */ ~daTagAtkItem_c(); + /* 805A2D10 */ BOOL eventStart(); + /* 805A2D34 */ BOOL eventEnd(); + + u8 getEvId() { return fopAcM_GetParamBit(this, 0x18, 8); } + u8 getNum() { return fopAcM_GetParamBit(this, 8, 8); } + u8 getItemBit() { return fopAcM_GetParamBit(this, 0x10, 8); } + u8 getItemNo() { return fopAcM_GetParamBit(this, 0, 8); } + + /* 0x568 */ u8 temp[0x57C - 0x568]; // remove when dEvLib_callback_c setup + /* 0x57C */ u8 field_0x57C[0x584 - 0x57C]; + /* 0x584 */ dCcD_Stts mCcStts; + /* 0x5C0 */ dCcD_Cyl mCyl; }; // @@ -112,62 +102,48 @@ extern "C" void _savegpr_27(); extern "C" void _savegpr_29(); extern "C" void _restgpr_27(); extern "C" void _restgpr_29(); -extern "C" extern void* g_fopAc_Method[8]; -extern "C" extern void* g_fpcLf_Method[5 + 1 /* padding */]; extern "C" extern void* __vt__8dCcD_Cyl[36]; extern "C" extern void* __vt__9dCcD_Stts[11]; extern "C" extern void* __vt__12cCcD_CylAttr[25]; extern "C" extern void* __vt__14cCcD_ShapeAttr[22]; extern "C" extern void* __vt__9cCcD_Stts[8]; -extern "C" extern u8 g_dComIfG_gameInfo[122384]; // // Declarations: // /* 805A2958-805A2990 000078 0038+00 1/1 0/0 0/0 .text setBaseMtx__14daTagAtkItem_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daTagAtkItem_c::setBaseMtx() { - nofralloc -#include "asm/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item/setBaseMtx__14daTagAtkItem_cFv.s" +void daTagAtkItem_c::setBaseMtx() { + mDoMtx_stack_c::transS(current.pos); + mDoMtx_stack_c::ZXYrotM(shape_angle); } -#pragma pop - -/* ############################################################################################## */ -/* 805A32C8-805A32CC 000000 0004+00 2/2 0/0 0/0 .rodata @3657 */ -SECTION_RODATA static f32 const lit_3657 = 50.0f; -COMPILER_STRIP_GATE(0x805A32C8, &lit_3657); - -/* 805A32CC-805A32D0 000004 0004+00 1/2 0/0 0/0 .rodata @3658 */ -SECTION_RODATA static f32 const lit_3658 = 100.0f; -COMPILER_STRIP_GATE(0x805A32CC, &lit_3658); /* 805A32F4-805A3338 000000 0044+00 1/1 0/0 0/0 .data l_cyl_src */ static dCcD_SrcCyl l_cyl_src = { { - {0x0, {{0x0, 0x0, 0x1f}, {0x400020, 0x11}, 0x78}}, // mObj - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x6}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf + {0x0, {{0x0, 0x0, 0x1f}, {0x400020, 0x11}, 0x78}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x6}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf { - {0.0f, 0.0f, 0.0f}, // mCenter - 50.0f, // mRadius - 100.0f // mHeight - } // mCyl + {0.0f, 0.0f, 0.0f}, // mCenter + 50.0f, // mRadius + 100.0f // mHeight + } // mCyl }; /* 805A2990-805A2A34 0000B0 00A4+00 1/1 0/0 0/0 .text Create__14daTagAtkItem_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daTagAtkItem_c::Create() { - nofralloc -#include "asm/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item/Create__14daTagAtkItem_cFv.s" +int daTagAtkItem_c::Create() { + mCcStts.Init(0, 0xFF, this); + mCyl.Set(l_cyl_src); + mCyl.SetStts(&mCcStts); + mCyl.SetR(mScale.x * 50.0f); + mCyl.SetH(mScale.y * 100.0f); + + current.pos.y = orig.pos.y - mScale.y * 100.0f; + return 1; } -#pragma pop /* ############################################################################################## */ /* 805A3338-805A3358 -00001 0020+00 1/0 0/0 0/0 .data l_daTagAtkItem_Method */ @@ -249,7 +225,7 @@ SECTION_DATA extern void* __vt__17dEvLib_callback_c[6] = { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daTagAtkItem_c::create() { +asm int daTagAtkItem_c::create() { nofralloc #include "asm/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item/func_805A2A34.s" } @@ -289,16 +265,41 @@ extern "C" asm void __dt__10dCcD_GSttsFv() { #pragma pop /* 805A2C48-805A2CA8 000368 0060+00 1/1 0/0 0/0 .text execute__14daTagAtkItem_cFv */ +// matches with dEvLib_callback_c setup +#ifdef NONMATCHING +int daTagAtkItem_c::execute() { + action(); + setBaseMtx(); + eventUpdate(); + mCyl.SetC(current.pos); + dComIfG_Ccsp()->Set(&mCyl); + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daTagAtkItem_c::execute() { +asm int daTagAtkItem_c::execute() { nofralloc #include "asm/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item/execute__14daTagAtkItem_cFv.s" } #pragma pop +#endif /* 805A2CA8-805A2D10 0003C8 0068+00 1/1 0/0 0/0 .text action__14daTagAtkItem_cFv */ +// matches with dEvLib_callback_c setup +#ifdef NONMATCHING +void daTagAtkItem_c::action() { + if (checkHit()) { + if (getEvId() != 0xFF) { + orderEvent(getEvId(), 0xFF, 1); + } else { + createItem(); + fopAcM_delete(this); + } + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -307,155 +308,122 @@ asm void daTagAtkItem_c::action() { #include "asm/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item/action__14daTagAtkItem_cFv.s" } #pragma pop +#endif /* 805A2D10-805A2D34 000430 0024+00 2/1 0/0 0/0 .text eventStart__14daTagAtkItem_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daTagAtkItem_c::eventStart() { - nofralloc -#include "asm/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item/eventStart__14daTagAtkItem_cFv.s" +BOOL daTagAtkItem_c::eventStart() { + createItem(); + return TRUE; } -#pragma pop /* 805A2D34-805A2D58 000454 0024+00 2/1 0/0 0/0 .text eventEnd__14daTagAtkItem_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daTagAtkItem_c::eventEnd() { - nofralloc -#include "asm/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item/eventEnd__14daTagAtkItem_cFv.s" +BOOL daTagAtkItem_c::eventEnd() { + fopAcM_delete(this); + return TRUE; } -#pragma pop - -/* ############################################################################################## */ -/* 805A32D0-805A32D8 000008 0004+04 0/1 0/0 0/0 .rodata @3859 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_3859[4 + 4 /* padding */] = { - 0x00, - 0x00, - 0x00, - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x805A32D0, &lit_3859); -#pragma pop - -/* 805A32D8-805A32E0 000010 0008+00 0/1 0/0 0/0 .rodata @3860 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_3860[8] = { - 0x3F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x805A32D8, &lit_3860); -#pragma pop - -/* 805A32E0-805A32E8 000018 0008+00 0/1 0/0 0/0 .rodata @3861 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_3861[8] = { - 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x805A32E0, &lit_3861); -#pragma pop - -/* 805A32E8-805A32F0 000020 0008+00 0/1 0/0 0/0 .rodata @3862 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_3862[8] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x805A32E8, &lit_3862); -#pragma pop /* 805A2D58-805A2F54 000478 01FC+00 1/1 0/0 0/0 .text checkHit__14daTagAtkItem_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daTagAtkItem_c::checkHit() { - nofralloc -#include "asm/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item/checkHit__14daTagAtkItem_cFv.s" +BOOL daTagAtkItem_c::checkHit() { + if (mCyl.ChkTgHit()) { + cCcD_Obj* hitobj_p = mCyl.GetTgHitObj(); + if (hitobj_p != NULL && + (hitobj_p->ChkAtType(AT_TYPE_IRON_BALL) || hitobj_p->ChkAtType(AT_TYPE_BOMB))) + { +#ifdef DEBUG + // "Attack Reaction Item: Rotate attack hit!\n" + OSReport("攻撃反応アイテム:回転アタックヒット!\n"); +#endif + return true; + } + } + + daPy_py_c* player_p = daPy_getPlayerActorClass(); + + if ((player_p->checkFrontRollCrash() || player_p->checkWolfAttackReverse()) && + player_p->current.pos.absXZ(current.pos) < mScale.x * 50.0f && + fabsf(player_p->current.pos.y - current.pos.y) < mScale.y * 100.0f) + { +#ifdef DEBUG + // "Attack Reaction Item: Rotate attack hit!\n" + OSReport("攻撃反応アイテム:回転アタックヒット!\n"); +#endif + return true; + } + + return false; } -#pragma pop - -/* ############################################################################################## */ -/* 805A32F0-805A32F4 000028 0004+00 1/1 0/0 0/0 .rodata @3898 */ -SECTION_RODATA static f32 const lit_3898 = 32767.0f; -COMPILER_STRIP_GATE(0x805A32F0, &lit_3898); /* 805A2F54-805A3038 000674 00E4+00 2/2 0/0 0/0 .text createItem__14daTagAtkItem_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daTagAtkItem_c::createItem() { - nofralloc -#include "asm/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item/createItem__14daTagAtkItem_cFv.s" +void daTagAtkItem_c::createItem() { + csXyz angle(0, 0, 0); + + int create_num; + if (getNum() == 0xFF) { + create_num = 1; + } else { + create_num = getNum(); + } + + int item_bit = getItemBit(); + for (int i = 0; i < create_num; i++) { + angle.y += (s16)cM_rndFX(0x7FFF); + + fopAcM_createItemFromTable(&orig.pos, getItemNo(), item_bit, fopAcM_GetHomeRoomNo(this), + &angle, 0, NULL, NULL, NULL, false); + + if (item_bit != 0xFF) { + item_bit++; + } + } } -#pragma pop /* 805A3038-805A3040 000758 0008+00 1/1 0/0 0/0 .text _delete__14daTagAtkItem_cFv */ -bool daTagAtkItem_c::_delete() { - return true; +int daTagAtkItem_c::_delete() { + return 1; } /* 805A3040-805A3060 000760 0020+00 1/0 0/0 0/0 .text daTagAtkItem_Execute__FP14daTagAtkItem_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daTagAtkItem_Execute(daTagAtkItem_c* param_0) { - nofralloc -#include "asm/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item/daTagAtkItem_Execute__FP14daTagAtkItem_c.s" +static int daTagAtkItem_Execute(daTagAtkItem_c* i_this) { + return i_this->execute(); } -#pragma pop /* 805A3060-805A3080 000780 0020+00 1/0 0/0 0/0 .text daTagAtkItem_Delete__FP14daTagAtkItem_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daTagAtkItem_Delete(daTagAtkItem_c* param_0) { - nofralloc -#include "asm/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item/daTagAtkItem_Delete__FP14daTagAtkItem_c.s" +static int daTagAtkItem_Delete(daTagAtkItem_c* i_this) { + return i_this->_delete(); } -#pragma pop /* 805A3080-805A30A0 0007A0 0020+00 1/0 0/0 0/0 .text daTagAtkItem_Create__FP14daTagAtkItem_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daTagAtkItem_Create(daTagAtkItem_c* param_0) { - nofralloc -#include "asm/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item/daTagAtkItem_Create__FP14daTagAtkItem_c.s" +static int daTagAtkItem_Create(daTagAtkItem_c* i_this) { + return i_this->create(); } -#pragma pop /* 805A30A0-805A30E8 0007C0 0048+00 1/0 0/0 0/0 .text __dt__17dEvLib_callback_cFv */ #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm dEvLib_callback_c::~dEvLib_callback_c() { +// asm dEvLib_callback_c::~dEvLib_callback_c() { +extern "C" asm void __dt__17dEvLib_callback_cFv() { nofralloc #include "asm/rel/d/a/tag/d_a_tag_attack_item/d_a_tag_attack_item/__dt__17dEvLib_callback_cFv.s" } #pragma pop /* 805A30E8-805A30F0 000808 0008+00 2/0 0/0 0/0 .text eventRun__17dEvLib_callback_cFv */ -bool dEvLib_callback_c::eventRun() { +// bool dEvLib_callback_c::eventRun() { +extern "C" bool eventRun__17dEvLib_callback_cFv() { return true; } /* 805A30F0-805A30F8 000810 0008+00 1/0 0/0 0/0 .text eventStart__17dEvLib_callback_cFv */ -bool dEvLib_callback_c::eventStart() { +// bool dEvLib_callback_c::eventStart() { +extern "C" bool eventStart__17dEvLib_callback_cFv() { return true; } /* 805A30F8-805A3100 000818 0008+00 1/0 0/0 0/0 .text eventEnd__17dEvLib_callback_cFv */ -bool dEvLib_callback_c::eventEnd() { +// bool dEvLib_callback_c::eventEnd() { +extern "C" bool eventEnd__17dEvLib_callback_cFv() { return true; } diff --git a/rel/d/a/tag/d_a_tag_howl/d_a_tag_howl.cpp b/rel/d/a/tag/d_a_tag_howl/d_a_tag_howl.cpp index f08fe95590f..36ccdda6924 100644 --- a/rel/d/a/tag/d_a_tag_howl/d_a_tag_howl.cpp +++ b/rel/d/a/tag/d_a_tag_howl/d_a_tag_howl.cpp @@ -23,12 +23,14 @@ int daTag_Howl_c::destroy() { /* 8048D9C4-8048DA24 0000E4 0060+00 1/1 0/0 0/0 .text execute__12daTag_Howl_cFv */ int daTag_Howl_c::execute() { - this->current.roomNo = dStage_roomControl_c::mStayNo; - this->mAttentionInfo.mFlags = 0; - if (isAreaCheck() != NULL) { - this->mAttentionInfo.mFlags |= 0x80; - this->mAttentionInfo.field_0x0[7] = 0x41; + fopAcM_SetRoomNo(this, dComIfGp_roomControl_getStayNo()); + mAttentionInfo.mFlags = 0; + + if (isAreaCheck()) { + mAttentionInfo.mFlags |= 0x80; + mAttentionInfo.field_0x0[7] = 0x41; } + return 1; } @@ -41,22 +43,26 @@ int daTag_Howl_c::draw() { u8 daTag_Howl_c::isAreaCheck() { if (getSwitchBit() != 0xFF) { if (dComIfGs_isSaveSwitch(getSwitchBit())) { - return 0; + return false; } } - cXyz pos = daPy_getPlayerActorClass()->current.pos - current.pos; - if (dComIfGp_getLinkPlayer()->i_checkNoResetFlg1(daPy_py_c::FLG1_IS_WOLF)) { - if ((pos.absXZ() < mScale.x) && (-mScale.y < pos.y) && (pos.y < mScale.y)) { - return 1; + cXyz vec_to_player = daPy_getPlayerActorClass()->current.pos - current.pos; + if (daPy_py_c::i_checkNowWolf()) { + if (vec_to_player.absXZ() < mScale.x && -mScale.y < vec_to_player.y && + vec_to_player.y < mScale.y) + { + return true; } } - return 0; + + return false; } + /* 8048DC1C-8048DC68 00033C 004C+00 1/1 0/0 0/0 .text getParam__12daTag_Howl_cFv */ int daTag_Howl_c::getParam() { - field_0x568 = mBase.mParameters & 0xf; - field_0x569 = mBase.mParameters >> 0x1e; + mCurveID = fopAcM_GetParam(this) & 0xF; + field_0x569 = fopAcM_GetParam(this) >> 0x1E; mScale.x *= 100.0f; mScale.y *= 100.0f; mScale.z *= 100.0f; @@ -65,7 +71,7 @@ int daTag_Howl_c::getParam() { /* 8048DC68-8048DC74 000388 000C+00 1/1 0/0 0/0 .text getSwitchBit__12daTag_Howl_cFv */ u8 daTag_Howl_c::getSwitchBit() { - return this->mBase.mParameters >> 4 & 0xff; + return (fopAcM_GetParam(this) >> 4) & 0xFF; } /* 8048DC74-8048DC94 000394 0020+00 1/0 0/0 0/0 .text daTag_Howl_Create__FPv */ diff --git a/src/d/a/d_a_alink.cpp b/src/d/a/d_a_alink.cpp index a861df8b208..557fa37ba7a 100644 --- a/src/d/a/d_a_alink.cpp +++ b/src/d/a/d_a_alink.cpp @@ -33,15 +33,12 @@ #include "rel/d/a/tag/d_a_tag_magne/d_a_tag_magne.h" #include "rel/d/a/tag/d_a_tag_mist/d_a_tag_mist.h" #include "rel/d/a/tag/d_a_tag_wljump/d_a_tag_wljump.h" +#include "rel/d/a/obj/d_a_obj_sekizoa/d_a_obj_sekizoa.h" // // Types: // -struct daObj_Sekizoa_c { - /* 801312C8 */ void setWolfHowling(); -}; - struct daObjMovebox { struct Act_c { struct Prm_e {}; @@ -4787,8 +4784,8 @@ COMPILER_STRIP_GATE(0x8038FAC0, &l_crawlTopUpOffset); /* 8038FACC-8038FAD8 01C12C 000C+00 0/1 0/0 0/0 .rodata l_wolfLieTopUpOffset */ #pragma push #pragma force_active on -SECTION_RODATA static u8 const l_wolfLieTopUpOffset[12] = { - 0x00, 0x00, 0x00, 0x00, 0x42, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +SECTION_RODATA static Vec const l_wolfLieTopUpOffset = { + 0.0f, 75.0f, 0.0f }; COMPILER_STRIP_GATE(0x8038FACC, &l_wolfLieTopUpOffset); #pragma pop @@ -4796,8 +4793,8 @@ COMPILER_STRIP_GATE(0x8038FACC, &l_wolfLieTopUpOffset); /* 8038FAD8-8038FAE4 01C138 000C+00 0/1 0/0 0/0 .rodata l_crawlSideOffset */ #pragma push #pragma force_active on -SECTION_RODATA static u8 const l_crawlSideOffset[12] = { - 0x42, 0x5C, 0x00, 0x00, 0x42, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +SECTION_RODATA static Vec const l_crawlSideOffset = { + 55.0f, 80.0f, 0.0f }; COMPILER_STRIP_GATE(0x8038FAD8, &l_crawlSideOffset); #pragma pop @@ -4805,8 +4802,8 @@ COMPILER_STRIP_GATE(0x8038FAD8, &l_crawlSideOffset); /* 8038FAE4-8038FAF0 01C144 000C+00 0/1 0/0 0/0 .rodata l_wolfLieSideOffset */ #pragma push #pragma force_active on -SECTION_RODATA static u8 const l_wolfLieSideOffset[12] = { - 0x42, 0x5C, 0x00, 0x00, 0x42, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +SECTION_RODATA static Vec const l_wolfLieSideOffset = { + 55.0f, 75.0f, 0.0f }; COMPILER_STRIP_GATE(0x8038FAE4, &l_wolfLieSideOffset); #pragma pop @@ -6228,28 +6225,41 @@ SECTION_RODATA static u32 const label[12] = { COMPILER_STRIP_GATE(0x80391E48, &label); /* 80391E78-80391E8C 01E4D8 0014+00 1/1 0/0 0/0 .rodata normalType0$50859 */ -SECTION_RODATA static u8 const normalType0[20] = { - 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, - 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +SECTION_RODATA static int const normalType0[] = { + 3, 3, 3, 0, 0, }; COMPILER_STRIP_GATE(0x80391E78, &normalType0); /* 80391E8C-80391EA0 01E4EC 0014+00 1/1 0/0 0/0 .rodata normalType1$50860 */ -SECTION_RODATA static u8 const normalType1_50860[20] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, +SECTION_RODATA static int const normalType1_50860[] = { + 0, 0, 0, 3, 3, }; COMPILER_STRIP_GATE(0x80391E8C, &normalType1_50860); +struct daAlink_WCutParamTbl { + /* 0x0 */ daAlink_c::daAlink_WANM m_anmID; + /* 0x4 */ u8 m_cutType; +}; // Size: 0x8 + /* 80391EA0-80391EC0 01E500 0020+00 0/1 0/0 0/0 .rodata dataTabl$51470 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const dataTabl[32] = { - 0x00, 0x00, 0x00, 0x40, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x2E, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x43, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x2D, 0x00, 0x00, 0x00, +static const daAlink_WCutParamTbl dataTabl[] = { + { + daAlink_c::WANM_ATTACK_B_LEFT, + daAlink_c::CUT_TYPE_WOLF_B_LEFT, + }, + { + daAlink_c::WANM_ATTACK_B_FRONT, + daAlink_c::CUT_TYPE_WOLF_B_FRONT, + }, + { + daAlink_c::WANM_ATTACK_B_TAIL, + daAlink_c::CUT_TYPE_WOLF_B_BACK, + }, + { + daAlink_c::WANM_ATTACK_B_RIGHT, + daAlink_c::CUT_TYPE_WOLF_B_RIGHT, + }, }; -COMPILER_STRIP_GATE(0x80391EA0, &dataTabl); -#pragma pop /* 80391EC0-80391ECC 01E520 000C+00 1/1 0/0 0/0 .rodata arm1Vec$56040 */ SECTION_RODATA static u8 const arm1Vec[12] = { @@ -11461,21 +11471,133 @@ SECTION_DATA static u8 l_jntColPos17[12] = { }; /* 803B29AC-803B2A84 -00001 00D8+00 1/1 0/0 0/0 .data l_jntColData */ -SECTION_DATA static void* l_jntColData[54] = { - (void*)0x01000001, (void*)0x41900000, (void*)&l_jntColPos0, (void*)0x00000004, - (void*)0x41800000, (void*)&l_jntColPos1, (void*)0x01000007, (void*)0x40E00000, - (void*)&l_jntColPos2, (void*)0x0100000C, (void*)0x40E00000, (void*)&l_jntColPos2, - (void*)0x01000008, (void*)0x40C00000, (void*)&l_jntColPos4, (void*)0x0100000D, - (void*)0x40C00000, (void*)&l_jntColPos4, (void*)0x00000009, (void*)0x40C00000, - (void*)&l_jntColPos6, (void*)0x0000000E, (void*)0x40C00000, (void*)&l_jntColPos6, - (void*)0x01000010, (void*)0x41900000, (void*)&l_jntColPos8, (void*)0x01000012, - (void*)0x41000000, (void*)&l_jntColPos9, (void*)0x01000017, (void*)0x41000000, - (void*)&l_jntColPos10, (void*)0x01000013, (void*)0x40E00000, (void*)&l_jntColPos11, - (void*)0x01000018, (void*)0x40E00000, (void*)&l_jntColPos12, (void*)0x01000014, - (void*)0x40C00000, (void*)&l_jntColPos13, (void*)0x01000019, (void*)0x40C00000, - (void*)&l_jntColPos14, (void*)0x0203000F, (void*)0x42200000, (void*)&l_jntColPos15, - (void*)0x02030005, (void*)0x42200000, (void*)&l_jntColPos16, (void*)0x0003000F, - (void*)0x42340000, (void*)&l_jntColPos17, +static dJntColData_c l_jntColData[] = { + { + 1, + 0, + 1, + 18.0f, + (Vec*)l_jntColPos0, + }, + { + 0, + 0, + 4, + 16.0f, + (Vec*)l_jntColPos1, + }, + { + 1, + 0, + 7, + 7.0f, + (Vec*)l_jntColPos2, + }, + { + 1, + 0, + 12, + 7.0f, + (Vec*)l_jntColPos2, + }, + { + 1, + 0, + 8, + 6.0f, + (Vec*)l_jntColPos4, + }, + { + 1, + 0, + 13, + 6.0f, + (Vec*)l_jntColPos4, + }, + { + 0, + 0, + 9, + 6.0f, + (Vec*)l_jntColPos6, + }, + { + 0, + 0, + 14, + 6.0f, + (Vec*)l_jntColPos6, + }, + { + 1, + 0, + 16, + 18.0f, + (Vec*)l_jntColPos8, + }, + { + 1, + 0, + 18, + 8.0f, + (Vec*)l_jntColPos9, + }, + { + 1, + 0, + 23, + 8.0f, + (Vec*)l_jntColPos10, + }, + { + 1, + 0, + 19, + 7.0f, + (Vec*)l_jntColPos11, + }, + { + 1, + 0, + 24, + 7.0f, + (Vec*)l_jntColPos12, + }, + { + 1, + 0, + 20, + 6.0f, + (Vec*)l_jntColPos13, + }, + { + 1, + 0, + 25, + 6.0f, + (Vec*)l_jntColPos14, + }, + { + 2, + 3, + 15, + 40.0f, + (Vec*)l_jntColPos15, + }, + { + 2, + 3, + 5, + 40.0f, + (Vec*)l_jntColPos16, + }, + { + 0, + 3, + 15, + 45.0f, + (Vec*)l_jntColPos17, + }, }; /* 803B2A84-803B2A9C 00FBA4 0018+00 1/0 0/0 0/0 .data l_wolfJntColPos0 */ @@ -11538,25 +11660,133 @@ SECTION_DATA static u8 l_wolfJntColPos16[24] = { }; /* 803B2B68-803B2C40 -00001 00D8+00 1/1 0/0 0/0 .data l_wolfJntColData */ -SECTION_DATA static void* l_wolfJntColData[54] = { - (void*)0x01000001, (void*)0x41E00000, (void*)&l_wolfJntColPos0, - (void*)0x00000004, (void*)0x41C80000, (void*)&l_wolfJntColPos1, - (void*)0x01000010, (void*)0x41200000, (void*)&l_wolfJntColPos2, - (void*)0x01000015, (void*)0x41200000, (void*)&l_wolfJntColPos2, - (void*)0x01000011, (void*)0x40C00000, (void*)&l_wolfJntColPos4, - (void*)0x01000016, (void*)0x40C00000, (void*)&l_wolfJntColPos4, - (void*)0x01000012, (void*)0x40800000, (void*)&l_wolfJntColPos6, - (void*)0x01000017, (void*)0x40800000, (void*)&l_wolfJntColPos6, - (void*)0x01000013, (void*)0x40800000, (void*)&l_wolfJntColPos8, - (void*)0x01000018, (void*)0x40800000, (void*)&l_wolfJntColPos8, - (void*)0x0100001C, (void*)0x41300000, (void*)&l_wolfJntColPos10, - (void*)0x01000021, (void*)0x41300000, (void*)&l_wolfJntColPos10, - (void*)0x0100001D, (void*)0x40E00000, (void*)&l_wolfJntColPos12, - (void*)0x01000022, (void*)0x40E00000, (void*)&l_wolfJntColPos12, - (void*)0x0100001E, (void*)0x40A00000, (void*)&l_wolfJntColPos14, - (void*)0x01000023, (void*)0x40A00000, (void*)&l_wolfJntColPos14, - (void*)0x0100001F, (void*)0x40C00000, (void*)&l_wolfJntColPos16, - (void*)0x01000024, (void*)0x40A00000, (void*)&l_wolfJntColPos16, +static dJntColData_c l_wolfJntColData[] = { + { + 1, + 0, + 1, + 28.0f, + (Vec*)l_wolfJntColPos0, + }, + { + 0, + 0, + 4, + 25.0f, + (Vec*)l_wolfJntColPos1, + }, + { + 1, + 0, + 16, + 10.0f, + (Vec*)l_wolfJntColPos2, + }, + { + 1, + 0, + 21, + 10.0f, + (Vec*)l_wolfJntColPos2, + }, + { + 1, + 0, + 17, + 6.0f, + (Vec*)l_wolfJntColPos4, + }, + { + 1, + 0, + 22, + 6.0f, + (Vec*)l_wolfJntColPos4, + }, + { + 1, + 0, + 18, + 4.0f, + (Vec*)l_wolfJntColPos6, + }, + { + 1, + 0, + 23, + 4.0f, + (Vec*)l_wolfJntColPos6, + }, + { + 1, + 0, + 19, + 4.0f, + (Vec*)l_wolfJntColPos8, + }, + { + 1, + 0, + 24, + 4.0f, + (Vec*)l_wolfJntColPos8, + }, + { + 1, + 0, + 28, + 11.0f, + (Vec*)l_wolfJntColPos10, + }, + { + 1, + 0, + 33, + 11.0f, + (Vec*)l_wolfJntColPos10, + }, + { + 1, + 0, + 29, + 7.0f, + (Vec*)l_wolfJntColPos12, + }, + { + 1, + 0, + 34, + 7.0f, + (Vec*)l_wolfJntColPos12, + }, + { + 1, + 0, + 30, + 5.0f, + (Vec*)l_wolfJntColPos14, + }, + { + 1, + 0, + 35, + 5.0f, + (Vec*)l_wolfJntColPos14, + }, + { + 1, + 0, + 31, + 6.0f, + (Vec*)l_wolfJntColPos16, + }, + { + 1, + 0, + 36, + 5.0f, + (Vec*)l_wolfJntColPos16, + }, }; /* 803B2C40-803B2C50 00FD60 000D+03 0/1 0/0 0/0 .data defaultPortal$39238 */ @@ -12285,8 +12515,8 @@ extern "C" asm void __dt__14J3DMaterialAnmFv() { /* 800A48F0-800A4910 09F230 0020+00 1/1 0/0 0/0 .text daAlink_createHeap__FP10fopAc_ac_c */ -static int daAlink_createHeap(fopAc_ac_c* link) { - return ((daAlink_c*)link)->createHeap(); +static int daAlink_createHeap(fopAc_ac_c* i_this) { + return ((daAlink_c*)i_this)->createHeap(); } bool daPy_py_c::checkWoodSwordEquip() { @@ -13895,7 +14125,7 @@ asm void daAlink_c::setCollision() { #ifdef NONMATCHING f32 daAlink_c::getBaseAnimeFrame() const { if (mProcID == PROC_SUMOU_ACTION && mSpeedModifier > 0.0f) { - return field_0x300c; + return mProcVar2.field_0x300c; } return mUnderFrameCtrl[0].getFrame(); @@ -15513,7 +15743,7 @@ f32 daAlink_c::getFrontRollRate() { /* 800B4B7C-800B5284 0AF4BC 0708+00 2/2 0/0 0/0 .text decideCommonDoStatus__9daAlink_cFv */ -// almost, small branch issues and need fix for i_checkAttentionLock +// almost, small branch issues #ifdef NONMATCHING void daAlink_c::decideCommonDoStatus() { if (!i_checkFmChainGrabAnime() && i_dComIfGp_getDoStatus() == 0) { @@ -16648,9 +16878,9 @@ BOOL daAlink_c::checkItemChangeFromButton() { } else { u8 i; for (i = 0; i < 2; i++) { - int tmp = checkNewItemChange(i); - if (tmp && itemTriggerCheck(1 << i)) { - return changeItemTriggerKeepProc(i, tmp); + int proc_type = checkNewItemChange(i); + if (proc_type != 0 && itemTriggerCheck(1 << i)) { + return changeItemTriggerKeepProc(i, proc_type); } } @@ -16808,10 +17038,8 @@ int daAlink_c::commonCheckNextAction(int param_0) { } /* 800BA0D0-800BA6A0 0B4A10 05D0+00 91/91 0/0 0/0 .text checkNextAction__9daAlink_cFi */ -// checkAttentionLock issue / literals +// matches with literals #ifdef NONMATCHING -#pragma push -#pragma optimization_level 2 int daAlink_c::checkNextAction(int param_0) { f32 temp_f31 = field_0x594; @@ -16933,7 +17161,6 @@ int daAlink_c::checkNextAction(int param_0) { return ret; } -#pragma pop #else #pragma push #pragma optimization_level 0 @@ -17479,7 +17706,7 @@ void daAlink_c::posMove() { if (checkRootTransClearMode()) { cXyz sp78 = field_0x34d4 - sp108; - if (mProcID == PROC_CLIMB_UP_START && field_0x300e.z != 0) { + if (mProcID == PROC_CLIMB_UP_START && mProcVar3.field_0x300e.z != 0) { sp78 = cXyz::Zero; } @@ -18453,14 +18680,14 @@ bool daAlink_c::checkNotAutoJumpStage() { } /* 800C0678-800C077C 0BAFB8 0104+00 3/3 0/0 0/0 .text checkCastleTownUseItem__9daAlink_cFUs */ -bool daAlink_c::checkCastleTownUseItem(u16 item_id) { +bool daAlink_c::checkCastleTownUseItem(u16 i_itemNo) { if (checkNotBattleStage()) { - if (item_id == KANTERA || checkTradeItem(item_id) || - (item_id == DUNGEON_BACK && checkLv7DungeonShop()) || - (checkRoomSpecial() && (item_id == EMPTY_BOTTLE || checkDungeonWarpItem(item_id))) || - (checkStageName("R_SP128") && item_id == COPY_ROD) || - (checkLv2DungeonRoomSpecial() && item_id == HVY_BOOTS) || - (checkBottleItem(item_id) && item_id != EMPTY_BOTTLE)) + if (i_itemNo == KANTERA || checkTradeItem(i_itemNo) || + (i_itemNo == DUNGEON_BACK && checkLv7DungeonShop()) || + (checkRoomSpecial() && (i_itemNo == EMPTY_BOTTLE || checkDungeonWarpItem(i_itemNo))) || + (checkStageName("R_SP128") && i_itemNo == COPY_ROD) || + (checkLv2DungeonRoomSpecial() && i_itemNo == HVY_BOOTS) || + (checkBottleItem(i_itemNo) && i_itemNo != EMPTY_BOTTLE)) { return true; } else { @@ -18470,7 +18697,92 @@ bool daAlink_c::checkCastleTownUseItem(u16 item_id) { return true; } +enum daAlink_ItemProc { + /* 0 */ ITEM_PROC_NONE, + /* 1 */ ITEM_PROC_BOOTS_EQUIP, + /* 2 */ ITEM_PROC_SET_HVYBOOTS, + /* 3 */ ITEM_PROC_BOTTLE_DRINK, + /* 4 */ ITEM_PROC_SPINNER_READY, + /* 5 */ ITEM_PROC_DUNGEON_WARP_READY, + /* 6 */ ITEM_PROC_BOTTLE_OPEN, + /* 7 */ ITEM_PROC_FISHING_FOOD, + /* 8 */ ITEM_PROC_KANDELAAR_POUR, + /* 9 */ ITEM_PROC_SUBJECTIVITY, + /* 10 */ ITEM_PROC_PICK_PUT, + /* 11 */ ITEM_PROC_OFF_KANDELAAR, + /* 12 */ ITEM_PROC_COMMON_CHANGE_ITEM, + /* 13 */ ITEM_PROC_BOTTLE_SWING, + /* 14 */ ITEM_PROC_NOT_USE_ITEM, + /* 15 */ ITEM_PROC_GRASS_WHISTLE, +}; + /* 800C077C-800C0A9C 0BB0BC 0320+00 1/1 0/0 0/0 .text changeItemTriggerKeepProc__9daAlink_cFUci */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::changeItemTriggerKeepProc(u8 i_selItemIdx, int i_procType) { + u32 sel_item = dComIfGp_getSelectItem(i_selItemIdx); + mSelectItemId = i_selItemIdx; + + if (i_procType == ITEM_PROC_GRASS_WHISTLE) { + procGrassWhistleWaitInit(3, -1, 0, 0, NULL); + } else if (i_procType == ITEM_PROC_BOTTLE_DRINK) { + if (i_checkReinRide()) { + procHorseBottleDrinkInit(sel_item); + } else if (checkCanoeRide()) { + procCanoeBottleDrinkInit(sel_item); + } else { + procBottleDrinkInit(sel_item); + } + } else if (i_procType == ITEM_PROC_KANDELAAR_POUR) { + if (i_checkReinRide()) { + procHorseKandelaarPourInit(); + } else if (checkCanoeRide()) { + procCanoeKandelaarPourInit(); + } else { + procKandelaarPourInit(); + } + } else if (i_procType == ITEM_PROC_FISHING_FOOD) { + procFishingFoodInit(); + } else if (i_procType == ITEM_PROC_BOOTS_EQUIP) { + procBootsEquipInit(); + } else if (i_procType == ITEM_PROC_SET_HVYBOOTS) { + setHeavyBoots(1); + } else if (i_procType == ITEM_PROC_SPINNER_READY) { + procSpinnerReadyInit(); + } else if (i_procType == ITEM_PROC_DUNGEON_WARP_READY) { + procDungeonWarpReadyInit(); + } else if (i_procType == ITEM_PROC_BOTTLE_OPEN) { + procBottleOpenInit(sel_item); + } else if (i_procType == ITEM_PROC_BOTTLE_SWING) { + procBottleSwingInit(NULL, 0); + } else if (i_procType == ITEM_PROC_NOT_USE_ITEM) { + procNotUseItemInit(sel_item); + } else if (i_procType == ITEM_PROC_SUBJECTIVITY) { + procCoSubjectivityInit(); + dComIfGp_setPlayerStatus0(0, 0x200000); + seStartSystem(Z2SE_AL_HAWK_EYE_PUTON); + } else if (i_procType == ITEM_PROC_PICK_PUT) { + procPickPutInit(1); + } else if (i_procType == ITEM_PROC_OFF_KANDELAAR) { + offKandelaarModel(); + } else if (i_procType == ITEM_PROC_COMMON_CHANGE_ITEM) { + field_0x2fde = NO_ITEM; + itemEquip(sel_item); + + if (i_dComIfGp_checkPlayerStatus0(0, 0x2000) && + ((checkBowAndSlingItem(field_0x2fde) || checkHookshotItem(field_0x2fde) || + field_0x2fde == COPY_ROD) || + field_0x2fde == BOOMERANG)) + { + commonChangeItem(); + resetUpperAnime(UPPER_2, -1.0f); + checkItemActionInitStart(); + } + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -18479,9 +18791,156 @@ asm int daAlink_c::changeItemTriggerKeepProc(u8 param_0, int param_1) { #include "asm/d/a/d_a_alink/changeItemTriggerKeepProc__9daAlink_cFUci.s" } #pragma pop +#endif /* 800C0A9C-800C12DC 0BB3DC 0840+00 1/1 0/0 0/0 .text checkNewItemChange__9daAlink_cFUc */ +/** + * Determines whether an item action can occur, and which action to use. + * + * @return a `daAlink_ItemProc` value corresponding to the `PROC` function to run in `changeItemTriggerKeepProc` + */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::checkNewItemChange(u8 param_0) { + u32 sel_item = dComIfGp_getSelectItem(param_0); + + if (checkSpinnerRide() || sel_item == BOMB_BAG_LV1 || + ((sel_item == KANTERA || checkOilBottleItem(sel_item)) && + checkWaterInKandelaarOffset(mWaterY)) || + (checkCanoeRide() && checkStageName("F_SP127")) || checkCloudSea() || + ((i_checkModeFlg(0x40000) || i_checkNoResetFlg0(FLG0_UNDERWATER)) && + !checkAcceptUseItemInWater(sel_item)) || + (i_checkModeFlg(0x40000) && sel_item == WATER_BOMB) || !checkCastleTownUseItem(sel_item) || + (checkBoardRide() && sel_item != 0x103) || + (i_checkModeFlg(0x400) && + (sel_item == EMPTY_BOTTLE || sel_item == POKE_BOMB || sel_item == IRONBALL || + sel_item == COPY_ROD || checkFishingRodItem(sel_item))) || + ((field_0x2fa8 == 6 || field_0x2fbd == 1 || field_0x2fbd == 2 || + mWaterY - current.pos.y > 45.0f || + (field_0x2fbc == 6 && mWaterY - current.pos.y >= 0.0f) || field_0x2fbd == 3) && + sel_item == SPINNER) || + (checkBossRoom() && checkDungeonWarpItem(sel_item)) || + (sel_item == DUNGEON_EXIT && + (checkLv7DungeonShop() || + (checkStageName("D_MN07") && i_fopAcM_isSwitch(this, 0x4D) && + !i_fopAcM_isSwitch(this, 0x18)) || + (checkStageName("D_MN10") && fopAcM_GetRoomNo(this) == 15))) || + (i_checkMagneBootsOn() && sel_item != 0x103 && !checkDrinkBottleItem(sel_item) && + sel_item != HVY_BOOTS && !checkBowItem(sel_item))) + { + return ITEM_PROC_NONE; + } else if (sel_item == HVY_BOOTS || checkDungeonWarpItem(sel_item) || + checkTradeItem(sel_item) || + (checkBottleItem(sel_item) && sel_item != EMPTY_BOTTLE) || sel_item == SPINNER || + sel_item == POKE_BOMB || sel_item == HORSE_FLUTE || sel_item == HAWK_EYE) + { + if (i_checkReinRide() || checkCanoeRide()) { + if (checkDrinkBottleItem(sel_item)) { + return ITEM_PROC_BOTTLE_DRINK; + } + + if (checkOilBottleItem(sel_item) && checkItemSetButton(0x48) != 2) { + return ITEM_PROC_KANDELAAR_POUR; + } + } else if (sel_item == HVY_BOOTS) { + if (!checkBoardRide()) { + if ((mLinkAcch.ChkGroundHit() && !i_checkModeFlg(0x70C52)) || + (i_checkMagneBootsOn() && cBgW_CheckBGround(mMagneBootsTopVec.y)) || + mProcID == PROC_HANG_CLIMB) + { + return ITEM_PROC_BOOTS_EQUIP; + } + return ITEM_PROC_SET_HVYBOOTS; + } + } else if (checkDrinkBottleItem(sel_item) && i_checkMagneBootsOn()) { + if (cBgW_CheckBGround(mMagneBootsTopVec.y)) { + return ITEM_PROC_BOTTLE_DRINK; + } + } else if (mLinkAcch.ChkGroundHit()) { + if (!i_checkModeFlg(0x70C52)) { + if (sel_item == SPINNER) { + cXyz sp38(current.pos.x, current.pos.y + l_autoUpHeight, current.pos.z); + cXyz sp2C(sp38); + cXyz sp20; + + s16 var_r30 = 0; + for (int i = 0; i < 4; i++, var_r30 += 0x2000) { + sp2C.x = sp38.x + cM_ssin(var_r30) * 120.0f; + sp2C.z = sp38.z + cM_scos(var_r30) * 120.0f; + + if (commonLineCheck(&sp38, &sp2C)) { + sp2C.x = (sp38.x * 2.0f) - sp2C.x; + sp2C.z = (sp38.z * 2.0f) - sp2C.z; + sp20 = mLinkLinChk.i_GetCross(); + + if (commonLineCheck(&sp38, &sp2C)) { + if (mLinkLinChk.i_GetCross().abs2XZ(sp20) < 14400.0f) { + return ITEM_PROC_NONE; + } + } + } + } + + return ITEM_PROC_SPINNER_READY; + } else if (checkDungeonWarpItem(sel_item)) { + return ITEM_PROC_DUNGEON_WARP_READY; + } else if (checkItemSetButton(0x108) != 2 && + (sel_item == WORM || sel_item == BEE_CHILD)) + { + int temp_r3_8 = dComIfGp_getSelectItem(checkItemSetButton(0x108)); + if (temp_r3_8 == WORM_ROD || temp_r3_8 == JEWEL_WORM_ROD) { + if (sel_item == BEE_CHILD) { + return ITEM_PROC_BOTTLE_DRINK; + } + return ITEM_PROC_NONE; + } + if (sel_item == BEE_CHILD && + (temp_r3_8 == BEE_ROD || temp_r3_8 == JEWEL_BEE_ROD)) + { + return ITEM_PROC_BOTTLE_DRINK; + } + return ITEM_PROC_FISHING_FOOD; + } else if (checkDrinkBottleItem(sel_item)) { + return ITEM_PROC_BOTTLE_DRINK; + } else if (checkOpenBottleItem(sel_item)) { + return ITEM_PROC_BOTTLE_OPEN; + } else if (checkTradeItem(sel_item)) { + return ITEM_PROC_NOT_USE_ITEM; + } else if (sel_item == HORSE_FLUTE) { + return ITEM_PROC_GRASS_WHISTLE; + } else if (checkOilBottleItem(sel_item) && checkItemSetButton(0x48) != 2) { + return ITEM_PROC_KANDELAAR_POUR; + } else if (sel_item == HAWK_EYE) { + if (acceptSubjectModeChange()) { + return ITEM_PROC_SUBJECTIVITY; + } + } else if (sel_item == POKE_BOMB && dComIfGp_getSelectItemNum(param_0) && + field_0x2fcf < 2) + { + return ITEM_PROC_PICK_PUT; + } + } + } + } else if (sel_item != NO_ITEM && mEquipItem != sel_item) { + if ((checkBombItem(sel_item) && !dComIfGp_getSelectItemNum(param_0)) || + ((sel_item == NORMAL_BOMB || sel_item == WATER_BOMB) && mActiveBombNum >= 3) || + (sel_item == IRONBALL && (!mLinkAcch.ChkGroundHit() || i_checkModeFlg(0x70C52))) || + (sel_item == KANTERA && (i_checkNoResetFlg0(FLG0_UNDERWATER) || + i_checkEndResetFlg1(ERFLG1_UNK_4) || i_checkModeFlg(0x40000)))) + { + return ITEM_PROC_NONE; + } + return ITEM_PROC_COMMON_CHANGE_ITEM; + } + + if (mEquipItem == sel_item && mSelectItemId != param_0 && mEquipItem == EMPTY_BOTTLE) { + return ITEM_PROC_BOTTLE_SWING; + } + + return ITEM_PROC_NONE; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -18490,6 +18949,7 @@ asm int daAlink_c::checkNewItemChange(u8 param_0) { #include "asm/d/a/d_a_alink/checkNewItemChange__9daAlink_cFUc.s" } #pragma pop +#endif /* 800C12DC-800C1704 0BBC1C 0428+00 67/67 0/0 0/0 .text deleteEquipItem__9daAlink_cFii */ #pragma push @@ -18598,7 +19058,7 @@ void daAlink_c::commonProcInit(daAlink_c::daAlink_PROC i_procID) { initForceRideHorse(); } - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { changeWarpMaterial(1); } } else if (mProcID == PROC_GRAB_STAND) { diff --git a/src/d/a/d_a_alink_HIO_data.inc b/src/d/a/d_a_alink_HIO_data.inc index f069583b84d..6b46be6d958 100644 --- a/src/d/a/d_a_alink_HIO_data.inc +++ b/src/d/a/d_a_alink_HIO_data.inc @@ -2911,7 +2911,7 @@ const daAlinkHIO_wlRope_c1 daAlinkHIO_wlRope_c0::m = { /* 8038F4A4-8038F4E0 01BB04 003C+00 0/1 0/0 0/0 .rodata m__22daAlinkHIO_wlAtWaLr_c0 */ #pragma push #pragma force_active on -const daAlinkHIO_wlAtWaLr_c1 daAlinkHIO_wlAtWaLr_c0::m = { +const daAlinkHIO_wlAtWait_c1 daAlinkHIO_wlAtWaLr_c0::m = { { 41, 0.9f, @@ -2936,7 +2936,7 @@ const daAlinkHIO_wlAtWaLr_c1 daAlinkHIO_wlAtWaLr_c0::m = { /* 8038F4E0-8038F51C 01BB40 003C+00 0/1 0/0 0/0 .rodata m__22daAlinkHIO_wlAtWaSc_c0 */ #pragma push #pragma force_active on -const daAlinkHIO_wlAtWaSc_c1 daAlinkHIO_wlAtWaSc_c0::m = { +const daAlinkHIO_wlAtWait_c1 daAlinkHIO_wlAtWaSc_c0::m = { { 15, 0.9f, @@ -2961,7 +2961,7 @@ const daAlinkHIO_wlAtWaSc_c1 daAlinkHIO_wlAtWaSc_c0::m = { /* 8038F51C-8038F558 01BB7C 003C+00 0/1 0/0 0/0 .rodata m__22daAlinkHIO_wlAtWaTl_c0 */ #pragma push #pragma force_active on -const daAlinkHIO_wlAtWaTl_c1 daAlinkHIO_wlAtWaTl_c0::m = { +const daAlinkHIO_wlAtWait_c1 daAlinkHIO_wlAtWaTl_c0::m = { { 42, 1.05f, diff --git a/src/d/a/d_a_alink_boom.inc b/src/d/a/d_a_alink_boom.inc index bf2ab9b9c7e..9f434cbec50 100644 --- a/src/d/a/d_a_alink_boom.inc +++ b/src/d/a/d_a_alink_boom.inc @@ -160,8 +160,6 @@ void daAlink_c::setBoomerangReadyQuake() { } /* 800E055C-800E05E8 0DAE9C 008C+00 2/2 0/0 0/0 .text setBoomerangReadyAnime__9daAlink_cFv */ -#pragma push -#pragma optimization_level 2 void daAlink_c::setBoomerangReadyAnime() { f32 var_f31; if (i_checkAttentionLock()) { @@ -173,7 +171,6 @@ void daAlink_c::setBoomerangReadyAnime() { setUpperAnimeBaseSpeed(0x54, var_f31, lit_6109); setBoomerangReadyQuake(); } -#pragma pop /* 800E05E8-800E0630 0DAF28 0048+00 2/2 0/0 0/0 .text setThrowBoomerangAnime__9daAlink_cFv */ void daAlink_c::setThrowBoomerangAnime() { @@ -313,8 +310,6 @@ void daAlink_c::checkUpperItemActionBoomerangFly() { } /* 800E0BE4-800E0D8C 0DB524 01A8+00 4/4 0/0 0/0 .text checkNextActionBoomerang__9daAlink_cFv */ -#pragma push -#pragma optimization_level 2 int daAlink_c::checkNextActionBoomerang() { if ((checkBoomerangCatchAnime() && mUpperFrameCtrl[2].getFrame() <= daAlinkHIO_boom_c0::m.mCatchAnm.mCheckFrame) || @@ -355,7 +350,6 @@ int daAlink_c::checkNextActionBoomerang() { return procBoomerangMoveInit(); } } -#pragma pop /* 800E0D8C-800E0E64 0DB6CC 00D8+00 1/1 0/0 0/0 .text checkBoomerangCatchAction__9daAlink_cFv */ int daAlink_c::checkBoomerangCatchAction() { diff --git a/src/d/a/d_a_alink_bottle.inc b/src/d/a/d_a_alink_bottle.inc index 58478f88355..4a8ab476db3 100644 --- a/src/d/a/d_a_alink_bottle.inc +++ b/src/d/a/d_a_alink_bottle.inc @@ -119,21 +119,21 @@ int daAlink_c::procBottleDrinkInit(u16 param_0) { setBottleModel(param_0); dComIfGp_setPlayerStatus1(0, 0x2000); field_0x3194 = 1; - field_0x3008 = 0; + mProcVar0.field_0x3008 = 0; u32 id = fopAcM_GetID(this); dCam_getBody()->StartEventCamera(0x12, id, "Type", 1, &field_0x3194, 0); - field_0x300c = 0; - field_0x300e.x = 0; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.x = 0; return 1; } /* 8010F698-8010F6F4 109FD8 005C+00 1/0 0/0 0/0 .text procBottleDrink__9daAlink_cFv */ int daAlink_c::procBottleDrink() { - if (field_0x300e.x != 0) { + if (mProcVar3.field_0x300e.x != 0) { dComIfGp_evmng_cutEnd(field_0x3184); } else { - field_0x300e.x = commonBottleDrink(0); + mProcVar3.field_0x300e.x = commonBottleDrink(0); } return 1; @@ -158,9 +158,9 @@ int daAlink_c::procBottleOpenInit(u16 param_0) { keepItemData(); setBottleModel(param_0); dComIfGp_setPlayerStatus1(0, 0x4000); - field_0x300a = 0; + mProcVar1.field_0x300a = 0; field_0x32cc = -1; - field_0x3008 = 1; + mProcVar0.field_0x3008 = 1; if (mEquipItem == FAIRY) { field_0x3194 = 3; @@ -170,23 +170,23 @@ int daAlink_c::procBottleOpenInit(u16 param_0) { if (mEquipItem == WORM) { field_0x32cc = fopAcM_create(PROC_NPC_WORM, 2, ¤t.pos, fopAcM_GetRoomNo(this), NULL, NULL, -1); - field_0x3008 = 0; - field_0x300a = 1; + mProcVar0.field_0x3008 = 0; + mProcVar1.field_0x300a = 1; } } - field_0x300e.x = 0; + mProcVar3.field_0x300e.x = 0; u32 id = fopAcM_GetID(this); dCam_getBody()->StartEventCamera(0x12, id, "Type", 1, &field_0x3194, 0); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; field_0x27c8.initialize(); if (param_0 == 0x67) { setCylAtParam(0x200, 0, 0, 0, 0, 30.0f, 30.0f); } - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; return 1; } diff --git a/src/d/a/d_a_alink_bow.inc b/src/d/a/d_a_alink_bow.inc index d992495e295..c5952f1b5e1 100644 --- a/src/d/a/d_a_alink_bow.inc +++ b/src/d/a/d_a_alink_bow.inc @@ -167,16 +167,11 @@ asm void daAlink_c::changeArrowType() { #pragma pop /* 800DED88-800DEE1C 0D96C8 0094+00 1/1 0/0 0/0 .text cancelBowMoveRideNotAtn__9daAlink_cFv */ -#pragma push -#pragma optimization_level 2 BOOL daAlink_c::cancelBowMoveRideNotAtn() { return i_checkModeFlg(0x400) && i_checkAttentionLock() && mTargetedActor == NULL; } -#pragma pop /* 800DEE1C-800DEEDC 0D975C 00C0+00 3/3 0/0 0/0 .text cancelBowMove__9daAlink_cFv */ -#pragma push -#pragma optimization_level 2 BOOL daAlink_c::cancelBowMove() { if (mTargetedActor == NULL && !i_checkAttentionLock() && mFastShotTime == 0 && !checkBowReadyAnime() && (!checkBowShootAnime() || mUpperFrameCtrl[2].checkAnmEnd())) @@ -187,7 +182,6 @@ BOOL daAlink_c::cancelBowMove() { return false; } -#pragma pop /* 800DEEDC-800DEFB8 0D981C 00DC+00 3/3 0/0 0/0 .text setBowReadyAnime__9daAlink_cFv */ void daAlink_c::setBowReadyAnime() { @@ -370,7 +364,7 @@ int daAlink_c::procBowMoveInit() { } setBlendAtnMoveAnime(daAlinkHIO_bow_c0::m.mStartInterpolation); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; setBowOrSlingStatus(); return 1; } @@ -379,11 +373,11 @@ int daAlink_c::procBowMoveInit() { int daAlink_c::procBowMove() { cancelBowMove(); - if (mFastShotTime == 0 && field_0x300c != 0 && checkBowWaitAnime() && !itemButton()) { + if (mFastShotTime == 0 && mProcVar2.field_0x300c != 0 && checkBowWaitAnime() && !itemButton()) { resetUpperAnime(UPPER_2, lit_6041); } - field_0x300c = 1; + mProcVar2.field_0x300c = 1; i_onEndResetFlg0(ERFLG0_UNK_8000000); if (!checkNextAction(0)) { diff --git a/src/d/a/d_a_alink_canoe.inc b/src/d/a/d_a_alink_canoe.inc index efa8d80dd93..c139af8da40 100644 --- a/src/d/a/d_a_alink_canoe.inc +++ b/src/d/a/d_a_alink_canoe.inc @@ -127,11 +127,11 @@ BOOL daAlink_c::checkCanoeFishingRodGrabOrPut() const { /* 800F3FC4-800F4008 0EE904 0044+00 2/2 0/0 0/0 .text initCanoeRide__9daAlink_cFv */ void daAlink_c::initCanoeRide() { - field_0x300e.z = 1; + mProcVar3.field_0x300e.z = 1; field_0x3588 = l_waitBaseAnime; field_0x384c = (cXyz*)&l_canoeBaseAnime; mRideStatus = 3; - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; } /* 800F4008-800F40E4 0EE948 00DC+00 2/2 0/0 0/0 .text checkCanoeJumpRide__9daAlink_cFv */ @@ -146,7 +146,7 @@ BOOL daAlink_c::checkCanoeJumpRide() { if (speed.y < FLOAT_LABEL(lit_6108) && canoe != NULL && fopAcM_GetName(canoe) == PROC_CANOE && canoe->checkJumpRideFlg() && !checkDeadHP() && - (mProcID != PROC_FALL || field_0x300e.y != 0)) { + (mProcID != PROC_FALL || mProcVar3.field_0x300e.y != 0)) { return procCanoeJumpRideInit(canoe); } @@ -267,11 +267,11 @@ int daAlink_c::procCanoeRideInit() { if ((s16)(fopAcM_searchActorAngleY(canoe, this) - canoe->shape_angle.y) > 0) { shape_angle.y = canoe->shape_angle.y - 0x4000; - field_0x3008 = 0; + mProcVar0.field_0x3008 = 0; field_0x37c8.x = lit_20991; } else { shape_angle.y = canoe->shape_angle.y + 0x4000; - field_0x3008 = 1; + mProcVar0.field_0x3008 = 1; field_0x37c8.x = lit_20992; } @@ -279,7 +279,7 @@ int daAlink_c::procCanoeRideInit() { current.angle.y = shape_angle.y; initCanoeRide(); - field_0x300e.x = 0x80; + mProcVar3.field_0x300e.x = 0x80; swimOutAfter(1); return 1; } @@ -297,12 +297,12 @@ int daAlink_c::procCanoeRide() { if (frameCtrl->checkAnmEnd()) { procCanoeWaitInit(1); } else if (frameCtrl->getFrame() < lit_7710) { - field_0x300e.x += 0x180; + mProcVar3.field_0x300e.x += 0x180; - if (field_0x3008 == 0) { - canoe->incShapeAngleZ(-field_0x300e.x); + if (mProcVar0.field_0x3008 == 0) { + canoe->incShapeAngleZ(-mProcVar3.field_0x300e.x); } else { - canoe->incShapeAngleZ(field_0x300e.x); + canoe->incShapeAngleZ(mProcVar3.field_0x300e.x); } canoe->incShapeOffsetY(lit_21021); } diff --git a/src/d/a/d_a_alink_copyrod.inc b/src/d/a/d_a_alink_copyrod.inc index 7ec7bc6c2c5..8014128598a 100644 --- a/src/d/a/d_a_alink_copyrod.inc +++ b/src/d/a/d_a_alink_copyrod.inc @@ -73,7 +73,7 @@ BOOL daAlink_c::checkForestOldCentury() { /* 800E145C-800E1530 0DBD9C 00D4+00 1/0 0/0 0/0 .text checkCopyRodTopUse__9daAlink_cFv */ BOOL daAlink_c::checkCopyRodTopUse() { // Event flag 0x2580: Dominion Rod power restored - return (i_dComIfGs_isEventBit(0x2580) && !(mProcID == PROC_UNEQUIP && field_0x300e.x != 0)) || + return (i_dComIfGs_isEventBit(0x2580) && !(mProcID == PROC_UNEQUIP && mProcVar3.field_0x300e.x != 0)) || i_dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo()) == 0x15 || checkForestOldCentury(); } @@ -126,8 +126,6 @@ void daAlink_c::setCopyRodModel() { /* 800E1840-800E191C 0DC180 00DC+00 2/2 0/0 0/0 .text setCopyRodReadyAnime__9daAlink_cFv */ -#pragma push -#pragma optimization_level 2 void daAlink_c::setCopyRodReadyAnime() { f32 speed; if (i_checkAttentionLock()) { @@ -148,7 +146,6 @@ void daAlink_c::setCopyRodReadyAnime() { mAtCps[0].SetAtType(0x1000000); initLockAt(); } -#pragma pop /* 800E191C-800E1A30 0DC25C 0114+00 1/1 0/0 0/0 .text throwCopyRod__9daAlink_cFv */ void daAlink_c::throwCopyRod() { @@ -230,8 +227,6 @@ void daAlink_c::checkUpperItemActionCopyRodFly() { } /* 800E1C44-800E1D6C 0DC584 0128+00 2/2 0/0 0/0 .text checkNextActionCopyRod__9daAlink_cFv */ -#pragma push -#pragma optimization_level 2 int daAlink_c::checkNextActionCopyRod() { if ((checkBoomerangCatchAnime() && mUpperFrameCtrl[2].getFrame() <= daAlinkHIO_boom_c0::m.mCatchAnm.mCheckFrame) || @@ -258,7 +253,6 @@ int daAlink_c::checkNextActionCopyRod() { return procCopyRodMoveInit(); } -#pragma pop /* 800E1D6C-800E1E20 0DC6AC 00B4+00 1/1 0/0 0/0 .text setCopyRodSight__9daAlink_cFv */ void daAlink_c::setCopyRodSight() { @@ -382,8 +376,8 @@ int daAlink_c::procCopyRodSwingInit() { mNormalSpeed = FLOAT_LABEL(lit_6108); current.angle.y = shape_angle.y; - field_0x300c = 1; - field_0x300e.x = 0; + mProcVar2.field_0x300c = 1; + mProcVar3.field_0x300e.x = 0; voiceStart(Z2SE_AL_V_ATTACK_S); mAtCps[0].SetR(lit_11442); @@ -395,7 +389,7 @@ int daAlink_c::procCopyRodSwingInit() { /* 800E21FC-800E2308 0DCB3C 010C+00 1/0 0/0 0/0 .text procCopyRodSwing__9daAlink_cFv */ int daAlink_c::procCopyRodSwing() { daPy_frameCtrl_c* frameCtrl = mUnderFrameCtrl; - field_0x300c = 0; + mProcVar2.field_0x300c = 0; if (frameCtrl->checkAnmEnd()) { setCopyRodControllAnime(); @@ -405,16 +399,16 @@ int daAlink_c::procCopyRodSwing() { setCopyRodControllAnime(); } } else if (frameCtrl->getFrame() >= field_0x3478 && frameCtrl->getFrame() < field_0x347c) { - if (field_0x300e.x == 0) { + if (mProcVar3.field_0x300e.x == 0) { seStartSwordCut(Z2SE_AL_COPYROD_SWING); } - field_0x300e.x = 1; + mProcVar3.field_0x300e.x = 1; if (changeCutReverseProc(ANM_CUT_RECOIL_A)) { return 1; } } else { - field_0x300e.x = 0; + mProcVar3.field_0x300e.x = 0; } return 1; diff --git a/src/d/a/d_a_alink_crawl.inc b/src/d/a/d_a_alink_crawl.inc index da988a8f497..aaba4b5477f 100644 --- a/src/d/a/d_a_alink_crawl.inc +++ b/src/d/a/d_a_alink_crawl.inc @@ -196,7 +196,7 @@ void daAlink_c::setCrawlMoveHoll() { f32 frame_ctrl_rate = mUnderFrameCtrl[0].getRate(); if (frame_ctrl_rate != FLOAT_LABEL(lit_6108)) { - cLib_addCalcAngleS(&shape_angle.y, field_0x300c, 5, 0x1000, 0x800); + cLib_addCalcAngleS(&shape_angle.y, mProcVar2.field_0x300c, 5, 0x1000, 0x800); current.angle.y = shape_angle.y; } @@ -330,8 +330,8 @@ int daAlink_c::procCrawlAutoMoveInit(int param_0, cXyz* param_1) { field_0x37c8 = *param_1; field_0x33cc = lit_6040; field_0x3198 = param_0; - field_0x3008 = 20; - field_0x300a = 300; + mProcVar0.field_0x3008 = 20; + mProcVar1.field_0x300a = 300; dComIfGp_setPlayerStatus0(0, 0x8000000); setCrawlMoveDirectionArrow(); diff --git a/src/d/a/d_a_alink_cut.inc b/src/d/a/d_a_alink_cut.inc index 241e85ed8d0..1bd01c8cc4c 100644 --- a/src/d/a/d_a_alink_cut.inc +++ b/src/d/a/d_a_alink_cut.inc @@ -212,8 +212,6 @@ void daAlink_c::resetCombo(int param_0) { } /* 800D1454-800D152C 0CBD94 00D8+00 1/1 0/0 0/0 .text checkComboCnt__9daAlink_cFv */ -#pragma push -#pragma optimization_level 2 void daAlink_c::checkComboCnt() { if ((mEquipItem == EQUIP_SWORD && mComboCutCount == 2) && (i_checkAttentionLock() && @@ -228,7 +226,6 @@ void daAlink_c::checkComboCnt() { resetCombo(1); } } -#pragma pop /* 800D152C-800D1540 0CBE6C 0014+00 22/22 0/0 0/0 .text setCutType__9daAlink_cFUc */ void daAlink_c::setCutType(u8 type) { @@ -519,10 +516,10 @@ void daAlink_c::setSwordVoiceSe(u32 i_seID) { /* 800D22BC-800D2304 0CCBFC 0048+00 3/3 0/0 0/0 .text setSwordChargeVoiceSe__9daAlink_cFv */ void daAlink_c::setSwordChargeVoiceSe() { - if (field_0x300c != 0) { - field_0x300c--; + if (mProcVar2.field_0x300c != 0) { + mProcVar2.field_0x300c--; - if (field_0x300c == 0) { + if (mProcVar2.field_0x300c == 0) { setSwordVoiceSe(Z2SE_AL_V_TAME); } } @@ -545,8 +542,6 @@ bool daAlink_c::checkCutTurnInputTrigger() { } /* 800D23C0-800D2684 0CCD00 02C4+00 7/7 0/0 0/0 .text checkCutAction__9daAlink_cFv */ -#pragma push -#pragma optimization_level 2 int daAlink_c::checkCutAction() { if (commonCutAction()) { return 1; @@ -580,8 +575,8 @@ int daAlink_c::checkCutAction() { } else { procCutNormalInit(normalType3[cutDir]); } - } else if (mProcID == PROC_CUT_NORMAL && field_0x300a != 4) { - if (field_0x300a == 2) { + } else if (mProcID == PROC_CUT_NORMAL && mProcVar1.field_0x300a != 4) { + if (mProcVar1.field_0x300a == 2) { procCutNormalInit(1); } else { procCutNormalInit(2); @@ -600,18 +595,17 @@ int daAlink_c::checkCutAction() { return 1; } -#pragma pop /* 800D2684-800D26EC 0CCFC4 0068+00 9/9 0/0 0/0 .text checkCutTurnCharge__9daAlink_cFv */ void daAlink_c::checkCutTurnCharge() { if (swordButton()) { - if (field_0x300e.z < 3) { - field_0x300e.z++; + if (mProcVar3.field_0x300e.z < 3) { + mProcVar3.field_0x300e.z++; } else { i_onResetFlg0(RFLG0_UNK_40); } } else { - field_0x300e.z = 0; + mProcVar3.field_0x300e.z = 0; } } @@ -729,9 +723,9 @@ void daAlink_c::cancelCutCharge() { */ void daAlink_c::initCutAtnActorSearch() { if (cLib_distanceAngleS(getShapeAngleYAtnActor(), shape_angle.y) < 0x800) { - field_0x300e.y = 1; + mProcVar3.field_0x300e.y = 1; } else { - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; } field_0x32cc = (u32)mTargetedActor; @@ -740,7 +734,7 @@ void daAlink_c::initCutAtnActorSearch() { /* 800D2C54-800D2C78 0CD594 0024+00 3/3 0/0 0/0 .text checkCutAtnActorChange__9daAlink_cFv */ void daAlink_c::checkCutAtnActorChange() { if (field_0x32cc != (u32)mTargetedActor) { - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; field_0x32cc = (u32)mTargetedActor; } } @@ -797,8 +791,6 @@ asm void daAlink_c::setCutJumpSpeed(int param_0) { #endif /* 800D2F58-800D31B8 0CD898 0260+00 3/3 0/0 0/0 .text procCutNormalInit__9daAlink_cFi */ -#pragma push -#pragma optimization_level 2 int daAlink_c::procCutNormalInit(int i_type) { const daAlink_cutParamTbl* cutParams = &cutParamTable_7312[i_type]; @@ -841,9 +833,9 @@ int daAlink_c::procCutNormalInit(int i_type) { current.angle.y = shape_angle.y; if (!i_checkAttentionLock() && checkInputOnR()) { - field_0x300c = field_0x2fe2; + mProcVar2.field_0x300c = field_0x2fe2; } else { - field_0x300c = shape_angle.y; + mProcVar2.field_0x300c = shape_angle.y; } if (mComboCutCount != 1) { @@ -856,23 +848,22 @@ int daAlink_c::procCutNormalInit(int i_type) { setSwordAtParam(dCcG_At_Spl_UNK_0, 1, cutParams->m_atSe, 2, daAlinkHIO_cut_c0::m.mSwordLength, daAlinkHIO_cut_c0::m.mSwordRadius); setSwordComboVoice(); - field_0x300e.z = 0; + mProcVar3.field_0x300e.z = 0; dComIfGp_setPlayerStatus0(0, 0x8000); setCutWaterDropEffect(); int cutDir = getCutDirection(); if (mComboCutCount == 1 && (cutDir == DIR_LEFT || cutDir == DIR_RIGHT)) { - field_0x300e.x = 1; + mProcVar3.field_0x300e.x = 1; } else { - field_0x300e.x = 0; + mProcVar3.field_0x300e.x = 0; } - field_0x300a = 4; + mProcVar1.field_0x300a = 4; initCutAtnActorSearch(); return 1; } -#pragma pop /* 800D31B8-800D34D8 0CDAF8 0320+00 1/0 0/0 0/0 .text procCutNormal__9daAlink_cFv */ int daAlink_c::procCutNormal() { @@ -890,14 +881,14 @@ int daAlink_c::procCutNormal() { i_onEndResetFlg0(ERFLG0_UNK_8000000); field_0x2f99 = 4; - if (field_0x300e.x != 0 && i_checkNoResetFlg2(FLG2_UNK_2)) { + if (mProcVar3.field_0x300e.x != 0 && i_checkNoResetFlg2(FLG2_UNK_2)) { int cutDir = getCutDirection(); if ((cutDir == DIR_RIGHT && mCutType == CUT_TYPE_NM_LEFT && frameCtrl->getFrame() > lit_7448) || (cutDir == DIR_LEFT && mCutType == CUT_TYPE_NM_RIGHT && frameCtrl->getFrame() > lit_7448)) { - field_0x300a = cutDir; + mProcVar1.field_0x300a = cutDir; } } @@ -909,7 +900,7 @@ int daAlink_c::procCutNormal() { } else { checkNextAction(0); } - } else if ((!(frameCtrl->getFrame() > field_0x3484) && field_0x300a == 4) || + } else if ((!(frameCtrl->getFrame() > field_0x3484) && mProcVar1.field_0x300a == 4) || !checkCutCancelNextMode(3)) { if (frameCtrl->getFrame() > field_0x3484) { @@ -920,14 +911,14 @@ int daAlink_c::procCutNormal() { return 1; } - if (setShapeAngleToAtnActor(field_0x300e.y)) { - field_0x300c = shape_angle.y; + if (setShapeAngleToAtnActor(mProcVar3.field_0x300e.y)) { + mProcVar2.field_0x300c = shape_angle.y; if (cLib_distanceAngleS(getShapeAngleYAtnActor(), shape_angle.y) < 0x800) { - field_0x300e.y = 1; + mProcVar3.field_0x300e.y = 1; } } else { - cLib_addCalcAngleS(&shape_angle.y, field_0x300c, 2, 0x2000, 0x800); + cLib_addCalcAngleS(&shape_angle.y, mProcVar2.field_0x300c, 2, 0x2000, 0x800); } current.angle.y = shape_angle.y; @@ -970,8 +961,8 @@ int daAlink_c::procCutFinishInit(int i_type) { commonProcInit(PROC_CUT_FINISH); setCutType(cutParams->m_cutType); field_0x3198 = cutParams->field_0x4; - field_0x300c = cutParams->field_0xa; - field_0x300e.x = cutParams->field_0xb; + mProcVar2.field_0x300c = cutParams->field_0xa; + mProcVar3.field_0x300e.x = cutParams->field_0xb; BOOL var_r30 = FALSE; if (i_type == 0) { @@ -1022,13 +1013,13 @@ int daAlink_c::procCutFinishInit(int i_type) { if (mComboCutCount == 3) { field_0x3484 = cutData->mComboCheckFrame; - field_0x3008 = cutData->mComboStopTime; + mProcVar0.field_0x3008 = cutData->mComboStopTime; setSwordAtParam(dCcG_At_Spl_UNK_0, 1, cutParams->m_atSe, 2, daAlinkHIO_cut_c0::m.mSwordLength, daAlinkHIO_cut_c0::m.mSwordRadius); field_0x32d0 = Z2SE_AL_SWORD_SWING_S; } else { field_0x3484 = cutData->mCutAnm.mCheckFrame; - field_0x3008 = cutData->mStopTime; + mProcVar0.field_0x3008 = cutData->mStopTime; setSwordAtParam(dCcG_At_Spl_UNK_1, 3, cutParams->m_atSe, (var_r30 ? TRUE : FALSE) + 3, daAlinkHIO_cut_c0::m.mSwordLength, daAlinkHIO_cut_c0::m.mSwordRadius); @@ -1052,7 +1043,7 @@ int daAlink_c::procCutFinishInit(int i_type) { field_0x2f99 = 13; } - field_0x300e.z = 0; + mProcVar3.field_0x300e.z = 0; dComIfGp_setPlayerStatus0(0, 0x8000); setCutWaterDropEffect(); initCutAtnActorSearch(); @@ -1096,18 +1087,18 @@ int daAlink_c::procCutFinish() { field_0x2f99 = 4; } - if (frameCtrl_p->getFrame() >= field_0x300e.x) { + if (frameCtrl_p->getFrame() >= mProcVar3.field_0x300e.x) { onModeFlg(0x100); - } else if (frameCtrl_p->getFrame() >= field_0x300c) { + } else if (frameCtrl_p->getFrame() >= mProcVar2.field_0x300c) { offModeFlg(0x100); } if (checkAnmEnd(frameCtrl_p)) { resetCombo(1); - if (field_0x3008 > 0) { + if (mProcVar0.field_0x3008 > 0) { if (!(frameCtrl_p->getFrame() > field_0x3484) || !checkCutCancelNextMode(3)) { - field_0x3008--; + mProcVar0.field_0x3008--; } } else if (mDemo.getDemoMode() == 0x24 || mDemo.getDemoMode() == 0x54) { dComIfGp_evmng_cutEnd(field_0x3184); @@ -1125,10 +1116,10 @@ int daAlink_c::procCutFinish() { return 1; } - setShapeAngleToAtnActor(field_0x300e.y); + setShapeAngleToAtnActor(mProcVar3.field_0x300e.y); if (cLib_distanceAngleS(getShapeAngleYAtnActor(), shape_angle.y) < 0x800) { - field_0x300e.y = 1; + mProcVar3.field_0x300e.y = 1; } current.angle.y = shape_angle.y; @@ -1199,7 +1190,7 @@ int daAlink_c::procCutFinishJumpUpInit() { daAlinkHIO_cutFnJU_c0::m.mCutAnm.mEndFrame, daAlinkHIO_cutFnJU_c0::m.mCutAnm.mInterpolation); setSwordVoiceSe(Z2SE_AL_V_SOTOMO_ATK); - field_0x300e.z = 0; + mProcVar3.field_0x300e.z = 0; field_0x3478 = current.pos.y; dComIfGp_setPlayerStatus0(0, 0x8000); setCutWaterDropEffect(); @@ -1258,13 +1249,13 @@ int daAlink_c::procCutFinishJumpUpLandInit() { if (mComboCutCount == 3) { field_0x3484 = daAlinkHIO_cutFnJU_c0::m.mComboCheckFrame; - field_0x3008 = daAlinkHIO_cutFnJU_c0::m.mComboStopTime; + mProcVar0.field_0x3008 = daAlinkHIO_cutFnJU_c0::m.mComboStopTime; } else { field_0x3484 = daAlinkHIO_cutFnJU_c0::m.mLandAnm.mCheckFrame; - field_0x3008 = daAlinkHIO_cutFnJU_c0::m.mStopTime; + mProcVar0.field_0x3008 = daAlinkHIO_cutFnJU_c0::m.mStopTime; } - field_0x300e.z = 0; + mProcVar3.field_0x300e.z = 0; field_0x3588 = l_halfAtnWaitBaseAnime; initCutAtnActorSearch(); return 1; @@ -1287,9 +1278,9 @@ int daAlink_c::procCutFinishJumpUpLand() { if (frameCtrl->checkAnmEnd()) { if (mDemo.getDemoMode() == 0x52) { dComIfGp_evmng_cutEnd(field_0x3184); - } else if (field_0x3008 > 0) { + } else if (mProcVar0.field_0x3008 > 0) { if (!(frameCtrl->getFrame() > field_0x3484) || !checkCutCancelNextMode(3)) { - field_0x3008--; + mProcVar0.field_0x3008--; } } else { mNormalSpeed = FLOAT_LABEL(lit_6108); @@ -1301,10 +1292,10 @@ int daAlink_c::procCutFinishJumpUpLand() { resetCombo(1); } - setShapeAngleToAtnActor(field_0x300e.y); + setShapeAngleToAtnActor(mProcVar3.field_0x300e.y); if (cLib_distanceAngleS(getShapeAngleYAtnActor(), shape_angle.y) < 0x800) { - field_0x300e.y = 1; + mProcVar3.field_0x300e.y = 1; } current.angle.y = shape_angle.y; @@ -1330,13 +1321,13 @@ int daAlink_c::procCutReverseInit(daAlink_c::daAlink_ANM i_anmID) { if (i_anmID == ANM_SHIELD_ATTACK_RECOIL) { setSingleAnimeParam(i_anmID, &daAlinkHIO_guard_c0::m.mRecoilAnm); - field_0x300c = 1; + mProcVar2.field_0x300c = 1; field_0x3478 = daAlinkHIO_guard_c0::m.mRecoilAnm.mCheckFrame; field_0x2f98 = 2; setUpperGuardAnime(lit_6041); } else { setSingleAnimeParam(i_anmID, &daAlinkHIO_cut_c0::m.mRecoilAnm); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; field_0x3478 = daAlinkHIO_cut_c0::m.mRecoilAnm.mCheckFrame; field_0x2f98 = 4; } @@ -1344,7 +1335,7 @@ int daAlink_c::procCutReverseInit(daAlink_c::daAlink_ANM i_anmID) { mNormalSpeed = daAlinkHIO_cut_c0::m.mRecoilSpeed; current.angle.y = shape_angle.y - -0x8000; field_0x307e = 0; - field_0x300e.z = 0; + mProcVar3.field_0x300e.z = 0; int temp_r3; if (mCutType == CUT_TYPE_MORTAL_DRAW_A || mCutType == CUT_TYPE_MORTAL_DRAW_B || @@ -1369,12 +1360,12 @@ int daAlink_c::procCutReverse() { daPy_frameCtrl_c* frameCtrl = mUnderFrameCtrl; cLib_chaseF(&mNormalSpeed, FLOAT_LABEL(lit_6108), daAlinkHIO_cut_c0::m.mRecoilDeceleration); - if (field_0x300c == 0) { + if (mProcVar2.field_0x300c == 0) { checkCutTurnCharge(); i_onEndResetFlg0(ERFLG0_UNK_8000000); } - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { setUpperGuardAnime(lit_6041); } @@ -1545,8 +1536,8 @@ int daAlink_c::procCutTurnInit(int param_0, int param_1) { field_0x3484 = cutData->mRightAttackStartFrame; field_0x3488 = cutData->mRightAttackEndFrame; - field_0x300e.y = 1; - field_0x300a = 6; + mProcVar3.field_0x300e.y = 1; + mProcVar1.field_0x300a = 6; } else { anmID = ANM_CUT_TURN_LEFT; anm_data = &cutData->mLeftTurnAnm; @@ -1559,8 +1550,8 @@ int daAlink_c::procCutTurnInit(int param_0, int param_1) { field_0x3484 = cutData->mLeftAttackStartFrame; field_0x3488 = cutData->mLeftAttackEndFrame; - field_0x300e.y = 0; - field_0x300a = 8; + mProcVar3.field_0x300e.y = 0; + mProcVar1.field_0x300a = 8; } field_0x3480 = anm_data->->mCheckFrame; @@ -1610,12 +1601,12 @@ int daAlink_c::procCutTurnInit(int param_0, int param_1) { field_0x347c = lit_6896; field_0x3588 = l_halfAtnWaitBaseAnime; - field_0x3008 = cutData->mStopTime; + mProcVar0.field_0x3008 = cutData->mStopTime; current.angle.y = shape_angle.y; field_0x3180 = 0; dComIfGp_setPlayerStatus0(0, 0x8000); mNormalSpeed = FLOAT_LABEL(lit_6108); - field_0x300e.z = 0; + mProcVar3.field_0x300e.z = 0; setCutWaterDropEffect(); initCutTurnAt(field_0x347c, var_r29_3); return 1; @@ -1651,9 +1642,9 @@ int daAlink_c::procCutTurn() { } if (frameCtrl->checkAnmEnd()) { - if (field_0x3008 > 0) { + if (mProcVar0.field_0x3008 > 0) { if (!(frameCtrl->getFrame() > field_0x3480) || !checkCutCancelNextMode(3)) { - field_0x3008--; + mProcVar0.field_0x3008--; } } else if (mDemo.getDemoMode() == 0x24) { dComIfGp_evmng_cutEnd(field_0x3184); @@ -1693,7 +1684,7 @@ int daAlink_c::procCutTurnChargeInit() { setSingleAnimeParam(ANM_CUT_TURN_CHARGE_START, &daAlinkHIO_cutTurn_c0::m.mChargeAnm); mNormalSpeed = FLOAT_LABEL(lit_6108); current.angle.y = shape_angle.y; - field_0x300c = daAlinkHIO_cut_c0::m.mNormalSwingDuration; + mProcVar2.field_0x300c = daAlinkHIO_cut_c0::m.mNormalSwingDuration; return 1; } @@ -1707,7 +1698,7 @@ int daAlink_c::procCutTurnCharge() { field_0x307e = daAlinkHIO_cut_c0::m.mComboDuration; if (!swordButton() && mDemo.getDemoMode() != 0x5B) { - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { checkCutAction(); } else { cancelCutCharge(); @@ -1748,10 +1739,10 @@ int daAlink_c::procCutTurnMoveInit(int param_0) { if (!checkWoodSwordEquip()) { simpleAnmPlay(m_nSwordBtk); } else { - field_0x3008 = 1; + mProcVar0.field_0x3008 = 1; } - field_0x300c = param_0; + mProcVar2.field_0x300c = param_0; i_onNoResetFlg1(FLG1_UNK_10000000); dComIfGp_setPlayerStatus0(0, 0x40000000); return 1; @@ -1766,9 +1757,9 @@ int daAlink_c::procCutTurnMove() { if (!checkWoodSwordEquip()) { simpleAnmPlay(m_nSwordBtk); } else { - field_0x3008++; - if (field_0x3008 >= 14.0f) { - field_0x3008 = 100; + mProcVar0.field_0x3008++; + if (mProcVar0.field_0x3008 >= 14.0f) { + mProcVar0.field_0x3008 = 100; } } @@ -1779,9 +1770,9 @@ int daAlink_c::procCutTurnMove() { return 1; } - BOOL var_r4 = m_nSwordBtk->getFrame() >= 14.0f || field_0x3008 >= 14.0f; + BOOL var_r4 = m_nSwordBtk->getFrame() >= 14.0f || mProcVar0.field_0x3008 >= 14.0f; - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { if (checkDownAttackState() && !var_r4) { setDoStatusEmphasys(0x30); } else if (checkCutHeadState() && !var_r4) { @@ -1797,7 +1788,7 @@ int daAlink_c::procCutTurnMove() { if (var_r4) { dComIfGp_evmng_cutEnd(field_0x3184); } - } else if ((field_0x300c == 0 && swordButton()) || (field_0x300c != 0 && doButton())) { + } else if ((mProcVar2.field_0x300c == 0 && swordButton()) || (mProcVar2.field_0x300c != 0 && doButton())) { f32 var_f30 = 0.0f; i_onResetFlg0(RFLG0_UNK_10); @@ -1871,12 +1862,12 @@ int daAlink_c::procCutTurnMove() { mSpeedModifier = 1.0f; } } else if (var_r4) { - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { procCutLargeJumpInit(); } else { procCutTurnInit(0, 1); } - } else if (field_0x300c != 0) { + } else if (mProcVar2.field_0x300c != 0) { checkDoCutAction(); } else { cancelCutCharge(); @@ -1908,14 +1899,14 @@ int daAlink_c::procCutDownInit() { resetCombo(1); cXyz sp2C; - field_0x300e.x = 0; + mProcVar3.field_0x300e.x = 0; if (mTargetedActor != NULL) { sp2C = static_cast(mTargetedActor)->getDownPos(); field_0x280c.setData(mTargetedActor); if (fopAcM_GetName(mTargetedActor) == PROC_B_GND) { - field_0x300e.x = 1; + mProcVar3.field_0x300e.x = 1; } } else { sp2C.set(current.pos.x + cM_ssin(shape_angle.y) * 100.0f, current.pos.y, @@ -1923,7 +1914,7 @@ int daAlink_c::procCutDownInit() { field_0x280c.clearData(); } - if (field_0x300e.x != 0) { + if (mProcVar3.field_0x300e.x != 0) { mNormalSpeed = 0.0f; speed.y = 0.0f; offModeFlg(2); @@ -1967,7 +1958,7 @@ int daAlink_c::procCutDownInit() { temp_f1 = JMAFastSqrt(temp_f1 * 2.0f * var_f5); mNormalSpeed = var_f31 / (temp_f1 - var_f4 * var_f5); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; } setSwordVoiceSe(Z2SE_AL_V_TODOME_JUMP); @@ -1988,14 +1979,14 @@ asm int daAlink_c::procCutDownInit() { /* 800D57F8-800D58A0 0D0138 00A8+00 1/0 0/0 0/0 .text procCutDown__9daAlink_cFv */ int daAlink_c::procCutDown() { - if (field_0x300e.x != 0) { + if (mProcVar3.field_0x300e.x != 0) { return 1; } if (mLinkAcch.ChkGroundHit() && speed.y <= FLOAT_LABEL(lit_6108)) { procCutDownLandInit((fopEn_enemy_c*)field_0x280c.getActor()); - } else if (mUnderFrameCtrl[0].checkAnmEnd() && field_0x300c == 0) { - field_0x300c = 1; + } else if (mUnderFrameCtrl[0].checkAnmEnd() && mProcVar2.field_0x300c == 0) { + mProcVar2.field_0x300c = 1; setSingleAnimeParam(ANM_CUT_FINISHING_BLOW_FALL, &daAlinkHIO_cutDown_c0::m.mFallAnm); } @@ -2016,7 +2007,7 @@ int daAlink_c::procCutDownLandInit(fopEn_enemy_c* i_enemy) { mSwordTopPos.abs2XZ(i_enemy->getDownPos()) < 10000.0f && fabsf(i_enemy->current.pos.y - current.pos.y) < 100.0f)) { - field_0x300e.x = 1; + mProcVar3.field_0x300e.x = 1; if (i_enemy != NULL) { i_enemy->onCutDownHitFlg(); @@ -2025,16 +2016,16 @@ int daAlink_c::procCutDownLandInit(fopEn_enemy_c* i_enemy) { } var_r30 = 0x20; - field_0x3008 = daAlinkHIO_cutDown_c0::m.mSuccessStopTime; + mProcVar0.field_0x3008 = daAlinkHIO_cutDown_c0::m.mSuccessStopTime; dComIfGp_getVibration().StartShock(4, 31, cXyz(0.0f, 1.0f, 0.0f)); } else { var_r30 = mPolySound; - field_0x300e.x = 0; - field_0x3008 = daAlinkHIO_cutDown_c0::m.mFailStopTime; + mProcVar3.field_0x300e.x = 0; + mProcVar0.field_0x3008 = daAlinkHIO_cutDown_c0::m.mFailStopTime; } mZ2Link.startCollisionSE(Z2SE_HIT_SWORD_STAB, var_r30); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; mNormalSpeed = 0.0f; i_offResetFlg0(RFLG0_UNK_8000000); @@ -2042,7 +2033,7 @@ int daAlink_c::procCutDownLandInit(fopEn_enemy_c* i_enemy) { setFootEffectProcType(2); i_onResetFlg1(RFLG1_UNK_30); - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; dComIfGp_setPlayerStatus1(0, 0x400000); field_0x3588 = l_halfAtnWaitBaseAnime; @@ -2071,15 +2062,15 @@ int daAlink_c::procCutDownLand() { daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; field_0x2f99 = 4; - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { i_onEndResetFlg0(ERFLG0_UNK_8000000); } if (checkAnmEnd(frameCtrl_p)) { - if (field_0x300c == 0) { - if (field_0x3008 != 0) { - field_0x3008--; - } else if (field_0x300e.x != 0) { + if (mProcVar2.field_0x300c == 0) { + if (mProcVar0.field_0x3008 != 0) { + mProcVar0.field_0x3008--; + } else if (mProcVar3.field_0x300e.x != 0) { if (mDemo.getDemoMode() == 0x51) { dComIfGp_evmng_cutEnd(field_0x3184); } else { @@ -2088,16 +2079,16 @@ int daAlink_c::procCutDownLand() { } else { setSingleAnimeParam(ANM_CUT_FINISHING_BLOW_MISS, &daAlinkHIO_cutDown_c0::m.mMissAnm); - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } } else { checkNextAction(0); } - } else if (field_0x300c != 0) { + } else if (mProcVar2.field_0x300c != 0) { if (frameCtrl_p->getFrame() >= 37.0f) { - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; } else if (frameCtrl_p->getFrame() >= 30.0f) { - field_0x300e.y = 254; + mProcVar3.field_0x300e.y = 254; } if (frameCtrl_p->checkPass(54.0f)) { @@ -2159,7 +2150,7 @@ int daAlink_c::procCutHeadInit() { field_0x3478 = (fvar5 * 2.0f) / (fvar10 * 3.0f * fvar10); mNormalSpeed = field_0x3478 * fvar10 * 2.0f; - field_0x300e.x = 0; + mProcVar3.field_0x300e.x = 0; current.angle.y = sp2C.atan2sX_Z(); shape_angle.y = current.angle.y; @@ -2184,7 +2175,7 @@ asm int daAlink_c::procCutHeadInit() { /* 800D5FC8-800D6130 0D0908 0168+00 1/0 0/0 0/0 .text procCutHead__9daAlink_cFv */ int daAlink_c::procCutHead() { - if (field_0x300e.x == 0) { + if (mProcVar3.field_0x300e.x == 0) { cLib_chaseF(&mNormalSpeed, FLOAT_LABEL(lit_6108), field_0x3478); if (speed.y <= FLOAT_LABEL(lit_6108)) { @@ -2193,7 +2184,7 @@ int daAlink_c::procCutHead() { mNormalSpeed = tmp_0; speed.y = tmp_0; setSpecialGravity(tmp_0, mMaxFallSpeed, 0); - field_0x300e.x = 1; + mProcVar3.field_0x300e.x = 1; setCutWaterDropEffect(); setSwordVoiceSe(Z2SE_AL_V_KABUTO_ATK); } @@ -2259,7 +2250,7 @@ int daAlink_c::procCutLargeJumpChargeInit() { setSingleAnimeParam(ANM_CUT_JUMP_LARGE_CHARGE, &daAlinkHIO_cutLargeJump_c0::m.mChargeAnm); mNormalSpeed = FLOAT_LABEL(lit_6108); current.angle.y = shape_angle.y; - field_0x300c = daAlinkHIO_cut_c0::m.mNormalSwingDuration; + mProcVar2.field_0x300c = daAlinkHIO_cut_c0::m.mNormalSwingDuration; return 1; } @@ -2302,15 +2293,15 @@ int daAlink_c::procCutLargeJumpInit() { field_0x3588 = l_halfAtnWaitBaseAnime; mNormalSpeed = FLOAT_LABEL(lit_6108); current.angle.y = shape_angle.y; - field_0x300c = 0; + mProcVar2.field_0x300c = 0; setSwordAtParam(dCcG_At_Spl_UNK_0, 1, 1, 2, daAlinkHIO_cut_c0::m.mSwordLength, daAlinkHIO_cut_c0::m.mSwordRadius); setCutType(CUT_TYPE_LARGE_JUMP_INIT); setSwordVoiceSe(Z2SE_AL_V_JUMP_ATTACK_L_1); setCutWaterDropEffect(); - field_0x300e.x = 4; - field_0x300e.y = 0; + mProcVar3.field_0x300e.x = 4; + mProcVar3.field_0x300e.y = 0; field_0x3198 = 2; return 1; } @@ -2319,7 +2310,7 @@ int daAlink_c::procCutLargeJumpInit() { int daAlink_c::procCutLargeJump() { daPy_frameCtrl_c* frameCtrl = &mUnderFrameCtrl[0]; - if (field_0x300e.y != 0) { + if (mProcVar3.field_0x300e.y != 0) { field_0x2f99 = 4; } @@ -2327,15 +2318,15 @@ int daAlink_c::procCutLargeJump() { field_0x3198 = getCutTurnDirection(); } - if (field_0x300c == 0) { + if (mProcVar2.field_0x300c == 0) { if (frameCtrl->checkAnmEnd()) { field_0x2f99 = 12; setSingleAnimeParam(ANM_CUT_JUMP_LARGE, &daAlinkHIO_cutLargeJump_c0::m.mCutAnm); - field_0x300c = 1; + mProcVar2.field_0x300c = 1; setSwordVoiceSe(Z2SE_AL_V_JUMP_ATTACK_L_2); } else { if (frameCtrl->getFrame() >= lit_7307) { - field_0x300e.y = 1; + mProcVar3.field_0x300e.y = 1; } if (!i_checkModeFlg(2) && frameCtrl->getFrame() >= lit_7808) { @@ -2355,10 +2346,10 @@ int daAlink_c::procCutLargeJump() { } } } else { - if (field_0x300e.x != 0) { - field_0x300e.x--; + if (mProcVar3.field_0x300e.x != 0) { + mProcVar3.field_0x300e.x--; - if (field_0x300e.x == 0) { + if (mProcVar3.field_0x300e.x == 0) { setSwordAtParam(dCcG_At_Spl_UNK_1, 3, 1, 4, daAlinkHIO_cut_c0::m.mSwordLength, daAlinkHIO_cut_c0::m.mSwordRadius); setCutType(CUT_TYPE_LARGE_JUMP); @@ -2394,7 +2385,7 @@ int daAlink_c::procCutLargeJumpLandInit(int param_0) { setCutType(CUT_TYPE_LARGE_JUMP); field_0x3478 = daAlinkHIO_cutLargeJump_c0::m.mLandAttackRadius; field_0x347c = lit_6896; - field_0x300c = 0; + mProcVar2.field_0x300c = 0; field_0x3198 = param_0; f32 tmp_0 = FLOAT_LABEL(lit_6108); @@ -2432,9 +2423,9 @@ int daAlink_c::procCutLargeJumpLand() { i_onResetFlg0(RFLG0_UNK_2); if (frameCtrl->getFrame() >= daAlinkHIO_cutLargeJump_c0::m.mLandAttackInitFrame) { - if (field_0x300c == 0) { + if (mProcVar2.field_0x300c == 0) { resetAtCollision(0); - field_0x300c = 1; + mProcVar2.field_0x300c = 1; setCutType(CUT_TYPE_LARGE_JUMP_FINISH); initCutTurnAt(field_0x347c, 4); } @@ -2457,9 +2448,9 @@ int daAlink_c::procSwordUnequipSpInit() { mNormalSpeed = FLOAT_LABEL(lit_6108); field_0x3588 = l_halfAtnWaitBaseAnime; field_0x3198 = 0; - field_0x300c = 0; - field_0x300e.x = (0x1E - mDemo.getDemoMode()) != 0; - field_0x300e.y = 0; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.x = (0x1E - mDemo.getDemoMode()) != 0; + mProcVar3.field_0x300e.y = 0; return 1; } @@ -2472,20 +2463,20 @@ int daAlink_c::procSwordUnequipSp() { daPy_frameCtrl_c* frameCtrl = mUnderFrameCtrl; - if (field_0x300e.x != 0) { + if (mProcVar3.field_0x300e.x != 0) { field_0x2f99 = 4; } else { - field_0x300e.x = 1; + mProcVar3.field_0x300e.x = 1; } i_onEndResetFlg0(ERFLG0_UNK_8000000); - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { i_onEndResetFlg1(ERFLG1_GANON_FINISH); } - if (field_0x300e.y == 0 && mDemo.getDemoMode() == 0x1E && mDemo.getParam1() == 1) { - field_0x300e.y = 1; + if (mProcVar3.field_0x300e.y == 0 && mDemo.getDemoMode() == 0x1E && mDemo.getParam1() == 1) { + mProcVar3.field_0x300e.y = 1; setFaceBasicBck(0x149); setFaceBasicBtp(0x3E1); } @@ -2530,7 +2521,7 @@ int daAlink_c::procSwordUnequipSp() { } else { if (frameCtrl->getFrame() >= lit_7710) { field_0x2f93 = 0xFE; - field_0x300c = 1; + mProcVar2.field_0x300c = 1; i_onEndResetFlg1(ERFLG1_GANON_FINISH); } diff --git a/src/d/a/d_a_alink_damage.inc b/src/d/a/d_a_alink_damage.inc index 3f15ce2ea61..1d02a017337 100644 --- a/src/d/a/d_a_alink_damage.inc +++ b/src/d/a/d_a_alink_damage.inc @@ -33,23 +33,23 @@ void daAlink_c::setDkCaught(fopAc_ac_c* param_0) { /* 800D6E24-800D6F00 0D1764 00DC+00 2/2 0/0 0/0 .text freezeTimerDamage__9daAlink_cFv */ void daAlink_c::freezeTimerDamage() { - field_0x3008--; - field_0x300a++; + mProcVar0.field_0x3008--; + mProcVar1.field_0x300a++; - if (field_0x300a % 45 == 0) { + if (mProcVar1.field_0x300a % 45 == 0) { setDamagePoint(1, 1, 0, 0); } if (escapeTrigger()) { - field_0x3008 -= 2; + mProcVar0.field_0x3008 -= 2; } if (checkInputOnR() && abs((s16)(mStickAngle - mPrevStickAngle)) > 0x1000) { - field_0x3008 -= 2; + mProcVar0.field_0x3008 -= 2; } - if (field_0x3008 < 0) { - field_0x3008 = 0; + if (mProcVar0.field_0x3008 < 0) { + mProcVar0.field_0x3008 = 0; } } @@ -425,7 +425,7 @@ asm int daAlink_c::procCoLargeDamageWallInit(int param_0, int param_1, s16 param */ int daAlink_c::procCoLargeDamageWall() { if (mUnderFrameCtrl[0].checkAnmEnd()) { - procCoLargeDamageInit(field_0x3198, field_0x3008, field_0x3080, field_0x3082, NULL, 0); + procCoLargeDamageInit(field_0x3198, mProcVar0.field_0x3008, field_0x3080, field_0x3082, NULL, 0); } return 1; @@ -497,8 +497,8 @@ int daAlink_c::procLandDamage() { } } else { if (frameCtrl->checkAnmEnd()) { - if (field_0x3008 > 0) { - field_0x3008--; + if (mProcVar0.field_0x3008 > 0) { + mProcVar0.field_0x3008--; } else { setSingleAnimeParam(ANM_DMG_FALL_RECOVER, &daAlinkHIO_damFall_c0::m.mStandAnm); field_0x3198 = 1; @@ -582,7 +582,7 @@ asm int daAlink_c::procDkCaught() { void daAlink_c::setScreamWaitAnime() { setSingleAnimeBase(ANM_WAIT_F); voiceStart(Z2SE_AL_V_TERRORED); - field_0x300c = 1; + mProcVar2.field_0x300c = 1; f32 tmp_0 = FLOAT_LABEL(lit_6108); dComIfGp_getVibration().StartQuake(5, 1, cXyz(tmp_0, lit_6040, tmp_0)); @@ -597,7 +597,7 @@ int daAlink_c::procScreamWaitInit() { } else { setSingleAnimeBaseSpeed(ANM_WAIT, daAlinkHIO_move_c0::m.mWaitAnmSpeed, daAlinkHIO_basic_c0::m.mAnmBlendFactor); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; } current.angle.y = shape_angle.y; @@ -611,7 +611,7 @@ int daAlink_c::procScreamWait() { if (!i_checkEndResetFlg1(ERFLG1_UNK_1)) { checkNextAction(0); - } else if (field_0x300c == 0 && i_checkEndResetFlg1(ERFLG1_UNK_2)) { + } else if (mProcVar2.field_0x300c == 0 && i_checkEndResetFlg1(ERFLG1_UNK_2)) { setScreamWaitAnime(); } @@ -719,7 +719,7 @@ int daAlink_c::procCoSwimFreezeReturnInit() { u32 id = fopAcM_GetID(this); dCam_getBody()->StartEventCamera(9, id, "Type", 1, &field_0x3194, 0); - field_0x300c = 0x2D; + mProcVar2.field_0x300c = 0x2D; return 1; } @@ -727,7 +727,7 @@ int daAlink_c::procCoSwimFreezeReturnInit() { // matches with literals #ifdef NONMATCHING int daAlink_c::procCoSwimFreezeReturn() { - if (field_0x300c == 0) { + if (mProcVar2.field_0x300c == 0) { if (checkRestartDead(4, 1)) { i_onNoResetFlg1(FLG1_UNK_40000000); } else { @@ -737,7 +737,7 @@ int daAlink_c::procCoSwimFreezeReturn() { dStage_changeScene(3, 0.0f, mode, fopAcM_GetRoomNo(this), shape_angle.y, -1); } } else { - field_0x300c--; + mProcVar2.field_0x300c--; } return 1; diff --git a/src/d/a/d_a_alink_demo.inc b/src/d/a/d_a_alink_demo.inc index 7faea5ddf5b..462fab2cdc8 100644 --- a/src/d/a/d_a_alink_demo.inc +++ b/src/d/a/d_a_alink_demo.inc @@ -1180,7 +1180,7 @@ BOOL daAlink_c::checkEndMessage(u32 param_0) { /* 80118840-801188B0 113180 0070+00 1/1 0/0 0/0 .text setDemoRightHandIndex__9daAlink_cFUs */ u8 daAlink_c::setDemoRightHandIndex(u16 param_0) { if (param_0 == 0xFD) { - field_0x300e.y = 1; + mProcVar3.field_0x300e.y = 1; return 6; } else if (param_0 == 0xFC) { field_0x2fab |= 0x10; @@ -1524,11 +1524,11 @@ int daAlink_c::procCoToolDemoInit() { mNowAnmPackUpper[1].setAnmTransform(NULL); field_0x3198 = 0; - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; field_0x2fab = 0; deleteEquipItem(FALSE, TRUE); mUnderAnmHeap[0].setBufferSize(0x10800); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; field_0x3478 = FLOAT_LABEL(lit_6108); field_0x37c8 = current.pos; @@ -1545,7 +1545,7 @@ int daAlink_c::procCoToolDemo() { i_onEndResetFlg1(ERFLG1_GANON_FINISH); field_0x3198 = 0; - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; field_0x2fab = 0; if (demo_actor_p != NULL) { @@ -1602,10 +1602,10 @@ int daAlink_c::procCoToolDemo() { } else if (sp14 == 2) { setDemoRide(sp8); } else if (sp14 == 4 && - (field_0x300c == 0 || (sp8 != 0 && field_0x300c == 1) || - (sp8 == 0 && field_0x300c == 2))) + (mProcVar2.field_0x300c == 0 || (sp8 != 0 && mProcVar2.field_0x300c == 1) || + (sp8 == 0 && mProcVar2.field_0x300c == 2))) { - if (field_0x300c == 0) { + if (mProcVar2.field_0x300c == 0) { changeWarpMaterial(WARP_MAT_MODE_0); } @@ -1619,7 +1619,7 @@ int daAlink_c::procCoToolDemo() { field_0x347c = 5.5f; } - field_0x300c = 2; + mProcVar2.field_0x300c = 2; } else { field_0x3484 = 0.0f; mTevStr.field_0x344 = 0.0f; @@ -1631,7 +1631,7 @@ int daAlink_c::procCoToolDemo() { field_0x3480 = 5.5f; } - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } } } @@ -1730,7 +1730,7 @@ int daAlink_c::procCoToolDemo() { } } - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { warpModelTexScroll(); } @@ -1816,7 +1816,7 @@ int daAlink_c::procCoTalkInit() { } } - field_0x3008 = 30; + mProcVar0.field_0x3008 = 30; dComIfGp_setPlayerStatus0(0, 0x10); return 1; } @@ -1864,8 +1864,8 @@ int daAlink_c::procCoTalk() { field_0x3198 = 0; setTalkAnime(); mNormalSpeed = 0.0f; - } else if (field_0x3008 != 0) { - field_0x3008--; + } else if (mProcVar0.field_0x3008 != 0) { + mProcVar0.field_0x3008--; } else { field_0x3198 = 0; setTalkAnime(); @@ -1948,10 +1948,10 @@ int daAlink_c::procCoOpenTreasureInit() { mDoMtx_stack_c::transS(current.pos); mDoMtx_stack_c::YrotM(shape_angle.y); mDoMtx_stack_c::transM(60.0f, 45.0f, 30.0f); - field_0x06fc->i_setBaseTRMtx(mDoMtx_stack_c::get()); + mpKanteraModel->i_setBaseTRMtx(mDoMtx_stack_c::get()); } - field_0x300c = 0; + mProcVar2.field_0x300c = 0; mLinkAcch.SetWallNone(); mLinkAcch.OffLineCheck(); i_onEndResetFlg1(ERFLG1_UNK_8); @@ -1972,8 +1972,8 @@ asm int daAlink_c::procCoOpenTreasureInit() { int daAlink_c::procCoOpenTreasure() { i_onEndResetFlg1(ERFLG1_UNK_8); - if (field_0x300c == 0) { - field_0x300c = 1; + if (mProcVar2.field_0x300c == 0) { + mProcVar2.field_0x300c = 1; } else { field_0x2f99 = 4; } @@ -1996,8 +1996,8 @@ int daAlink_c::procCoUnequipInit() { } mNormalSpeed = 0.0f; - field_0x300c = 0; - field_0x300e.x = 0; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.x = 0; if (i_checkWolf()) { setBlendWolfMoveAnime(daAlinkHIO_wlMove_c0::m.field_0x94); @@ -2013,8 +2013,8 @@ int daAlink_c::procCoUnequipInit() { swordEquip(0); } } else if (mDemo.getParam1() == 2) { - field_0x300c = 1; - field_0x300e.x = 1; + mProcVar2.field_0x300c = 1; + mProcVar3.field_0x300e.x = 1; setSingleAnime(ANM_TRADE_ITEM_PULL_OUT, 1.0f, 0.0f, 39, 3.0f); } } @@ -2034,7 +2034,7 @@ asm int daAlink_c::procCoUnequipInit() { /* 8011A5CC-8011A688 114F0C 00BC+00 1/0 0/0 0/0 .text procCoUnequip__9daAlink_cFv */ int daAlink_c::procCoUnequip() { - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { if (checkAnmEnd(mUnderFrameCtrl)) { setBlendMoveAnime(lit_6109); itemEquip(COPY_ROD); @@ -2043,7 +2043,7 @@ int daAlink_c::procCoUnequip() { mUpperFrameCtrl[2].setFrame(tmp_6); getNowAnmPackUpper(UPPER_2)->setFrame(tmp_6); commonChangeItem(); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; } } else { if (!i_checkWolf()) { @@ -2062,7 +2062,7 @@ int daAlink_c::procCoUnequip() { void daAlink_c::setGetSubBgm(int i_seTypeIdx) { u32 se_type = getSeType[i_seTypeIdx]; - if (se_type == 3 && field_0x300e.y == 0) { + if (se_type == 3 && mProcVar3.field_0x300e.y == 0) { se_type = 7; } @@ -2119,7 +2119,7 @@ int daAlink_c::procCoGetItemInit() { commonProcInit(PROC_GET_ITEM); mNormalSpeed = 0.0f; - field_0x300a = 0; + mProcVar1.field_0x300a = 0; field_0x3478 = 0.0f; if (mDemo.getParam0() != 0) { @@ -2136,13 +2136,13 @@ int daAlink_c::procCoGetItemInit() { dComIfGp_event_setItemPartnerId(item_partner_id); } - field_0x300c = item_no; + mProcVar2.field_0x300c = item_no; } else { daItemBase_c* item_partner_p = (daItemBase_c*)fopAcM_getItemEventPartner(this); if (item_partner_p != NULL) { - field_0x300c = item_partner_p->getItemNo(); + mProcVar2.field_0x300c = item_partner_p->getItemNo(); } else { - field_0x300c = -1; + mProcVar2.field_0x300c = -1; } } @@ -2161,8 +2161,8 @@ int daAlink_c::procCoGetItemInit() { } else if (i_checkModeFlg(0x400)) { setSingleAnimeBase(ANM_HORSE_GET_ITEM); - if (field_0x300c != -1) { - setGetItemFace(field_0x300c); + if (mProcVar2.field_0x300c != -1) { + setGetItemFace(mProcVar2.field_0x300c); } if (i_checkReinRide()) { @@ -2172,17 +2172,17 @@ int daAlink_c::procCoGetItemInit() { } } field_0x3478 = 9.0f; - field_0x300a = 1; + mProcVar1.field_0x300a = 1; } else { if (var_r30 != 0) { setSingleAnimeBase(ANM_GET_A); } else { setSingleAnimeBase(ANM_GET_A_WAIT); - if (field_0x300c != -1) { - setGetItemFace(field_0x300c); + if (mProcVar2.field_0x300c != -1) { + setGetItemFace(mProcVar2.field_0x300c); } - field_0x300a = -7; + mProcVar1.field_0x300a = -7; } field_0x347c = 9.0f; @@ -2192,36 +2192,36 @@ int daAlink_c::procCoGetItemInit() { field_0x3588 = l_waitBaseAnime; } - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; if (var_r31 != 0) { - field_0x300e.x = -0x8000; - field_0x300e.y = 1; + mProcVar3.field_0x300e.x = -0x8000; + mProcVar3.field_0x300e.y = 1; } else if (mDemo.getParam1() == 2) { - field_0x300e.x = 0; + mProcVar3.field_0x300e.x = 0; } else { - field_0x300e.x = + mProcVar3.field_0x300e.x = shape_angle.y - (fopCamM_GetAngleY(dComIfGp_getCamera(field_0x317c)) + 0x8000); - s16 temp_r28 = field_0x300e.x + 0x16C1; - s16 temp_r31 = field_0x300e.x - 0x16C1; + s16 temp_r28 = mProcVar3.field_0x300e.x + 0x16C1; + s16 temp_r31 = mProcVar3.field_0x300e.x - 0x16C1; if (abs(temp_r28) > abs(temp_r31)) { - field_0x300e.x = temp_r31; + mProcVar3.field_0x300e.x = temp_r31; } else { - field_0x300e.x = temp_r28; + mProcVar3.field_0x300e.x = temp_r28; } } current.angle.y = shape_angle.y; mMsgClassID = -1; - field_0x3008 = 0; + mProcVar0.field_0x3008 = 0; field_0x3198 = 0; field_0x32cc = 0; - field_0x300e.z = 0; + mProcVar3.field_0x300e.z = 0; dKy_Itemgetcol_chg_on(); dComIfGp_setPlayerStatus1(0, 0x4000000); - if (field_0x300e.y != 0) { + if (mProcVar3.field_0x300e.y != 0) { i_onEndResetFlg1(ERFLG1_UNK_8); } @@ -2242,7 +2242,7 @@ asm int daAlink_c::procCoGetItemInit() { // matches with literals #ifdef NONMATCHING int daAlink_c::procCoGetItem() { - if (field_0x300e.y != 0) { + if (mProcVar3.field_0x300e.y != 0) { i_onEndResetFlg1(ERFLG1_UNK_8); } @@ -2265,18 +2265,18 @@ int daAlink_c::procCoGetItem() { field_0x2f99 = 4; } - if (field_0x300a == 0 && !(frameCtrl_p->getFrame() < field_0x347c)) { + if (mProcVar1.field_0x300a == 0 && !(frameCtrl_p->getFrame() < field_0x347c)) { if (frameCtrl_p->getFrame() < field_0x3480) { shape_angle.y = current.angle.y - - (field_0x3484 * (field_0x300e.x * (frameCtrl_p->getFrame() - field_0x347c))); + (field_0x3484 * (mProcVar3.field_0x300e.x * (frameCtrl_p->getFrame() - field_0x347c))); - if (field_0x300e.y != 0 && i_checkWolf()) { + if (mProcVar3.field_0x300e.y != 0 && i_checkWolf()) { current.pos.x -= cM_ssin(current.angle.y) * 3.888889f; current.pos.z -= cM_scos(current.angle.y) * 3.888889f; } } else { - shape_angle.y = current.angle.y - field_0x300e.x; + shape_angle.y = current.angle.y - mProcVar3.field_0x300e.x; } } @@ -2292,11 +2292,11 @@ int daAlink_c::procCoGetItem() { } #endif - if (field_0x300c == -1 && item_partner_p != NULL) { - field_0x300c = item_partner_p->getItemNo(); + if (mProcVar2.field_0x300c == -1 && item_partner_p != NULL) { + mProcVar2.field_0x300c = item_partner_p->getItemNo(); if (!i_checkWolf() && (checkUnderMove0BckNoArc(ANM_GET_A_WAIT) || i_checkModeFlg(0x400))) { - setGetItemFace(field_0x300c); + setGetItemFace(mProcVar2.field_0x300c); } } @@ -2305,11 +2305,11 @@ int daAlink_c::procCoGetItem() { field_0x3478 = 100.0f; } - if (field_0x3478 >= 9.0f && field_0x3008 == 0 && field_0x300c != -1) { - field_0x3008 = 1; + if (field_0x3478 >= 9.0f && mProcVar0.field_0x3008 == 0 && mProcVar2.field_0x300c != -1) { + mProcVar0.field_0x3008 = 1; - int get_bgm_type = field_0x300c; - if (field_0x300c == 33 && (dComIfGs_getMaxLife() % 5) == 4) { + int get_bgm_type = mProcVar2.field_0x300c; + if (mProcVar2.field_0x300c == 33 && (dComIfGs_getMaxLife() % 5) == 4) { get_bgm_type = 34; } @@ -2317,8 +2317,8 @@ int daAlink_c::procCoGetItem() { } BOOL var_r27 = true; - if (((field_0x300a == 0 && frameCtrl_p->getFrame() >= (f32)frameCtrl_p->getEnd() - 5.0f) || - field_0x300a != 0) && + if (((mProcVar1.field_0x300a == 0 && frameCtrl_p->getFrame() >= (f32)frameCtrl_p->getEnd() - 5.0f) || + mProcVar1.field_0x300a != 0) && item_partner_p != NULL) { field_0x280c.setData(item_partner_p); @@ -2327,76 +2327,76 @@ int daAlink_c::procCoGetItem() { } if (checkAnmEnd(frameCtrl_p)) { - field_0x300a = 1; + mProcVar1.field_0x300a = 1; if (i_checkWolf()) { setSingleAnimeWolfBase(WANM_GET); } else { setSingleAnimeBase(ANM_GET_A_WAIT); - setGetItemFace(field_0x300c); + setGetItemFace(mProcVar2.field_0x300c); } field_0x2f99 = 12; if (mDemo.getParam1() == 1) { dComIfGp_evmng_cutEnd(field_0x3184); } - } else if (field_0x300a != 0) { + } else if (mProcVar1.field_0x300a != 0) { if (mDemo.getParam1() == 1 && i_checkModeFlg(0x400)) { dComIfGp_evmng_cutEnd(field_0x3184); } - if (field_0x300a < 0) { - field_0x300a++; + if (mProcVar1.field_0x300a < 0) { + mProcVar1.field_0x300a++; - if (field_0x300a == 0) { - field_0x300a = 1; - shape_angle.y = current.angle.y - field_0x300e.x; + if (mProcVar1.field_0x300a == 0) { + mProcVar1.field_0x300a = 1; + shape_angle.y = current.angle.y - mProcVar3.field_0x300e.x; if (mDemo.getParam1() == 1) { dComIfGp_evmng_cutEnd(field_0x3184); } } else { shape_angle.y = - current.angle.y - (field_0x300e.x * (field_0x300a + 7)) * (1.0f / 7.0f); + current.angle.y - (mProcVar3.field_0x300e.x * (mProcVar1.field_0x300a + 7)) * (1.0f / 7.0f); } } if (item_partner_p != NULL) { if (!fpcM_IsCreating(fpcM_GetID(item_partner_p))) { - if (field_0x32cc == 0 && field_0x300c != -1) { - if (field_0x300c == 0x70 && checkStageName("F_SP115")) { + if (field_0x32cc == 0 && mProcVar2.field_0x300c != -1) { + if (mProcVar2.field_0x300c == 0x70 && checkStageName("F_SP115")) { field_0x32cc = 0x6E; - } else if (field_0x300c == 0x23 && checkStageName("D_MN11")) { + } else if (mProcVar2.field_0x300c == 0x23 && checkStageName("D_MN11")) { field_0x32cc = 0x5C0; - } else if (field_0x300c == 0xE0) { + } else if (mProcVar2.field_0x300c == 0xE0) { if (dComIfGs_getPohSpiritNum() == 20) { field_0x32cc = 0x4CF; } else if (dComIfGs_getPohSpiritNum() == 60) { field_0x32cc = 0x4D0; } else { - field_0x32cc = field_0x300c + 0x65; + field_0x32cc = mProcVar2.field_0x300c + 0x65; } - } else if (field_0x300c == 0x21) { + } else if (mProcVar2.field_0x300c == 0x21) { field_0x32cc = heartPieceMessage[dComIfGs_getMaxLife() % 5]; - } else if (field_0x300c == 0x33 && checkStageName("D_MN07")) { + } else if (mProcVar2.field_0x300c == 0x33 && checkStageName("D_MN07")) { field_0x32cc = 0x151; } else { - field_0x32cc = field_0x300c + 0x65; + field_0x32cc = mProcVar2.field_0x300c + 0x65; } } if (field_0x32cc != 0 && checkEndMessage(field_0x32cc)) { if (field_0x32cc < 0x164) { - if (field_0x300c >= 0xC0 && field_0x300c <= 0xD7 && - i_dComIfGs_isItemFirstBit(field_0x300c)) + if (mProcVar2.field_0x300c >= 0xC0 && mProcVar2.field_0x300c <= 0xD7 && + i_dComIfGs_isItemFirstBit(mProcVar2.field_0x300c)) { field_0x32cc += 2000; mMsgClassID = -1; return 1; } - if (field_0x300e.y != 0 && checkTreasureRupeeReturn(field_0x300c)) { - if (field_0x300c == 0xED) { + if (mProcVar3.field_0x300e.y != 0 && checkTreasureRupeeReturn(mProcVar2.field_0x300c)) { + if (mProcVar2.field_0x300c == 0xED) { field_0x32cc = 0x6A; } @@ -2460,7 +2460,7 @@ int daAlink_c::procCoTurnBackInit() { setSingleAnimeBase(ANM_TURN_BACK); } - field_0x300c = 0; + mProcVar2.field_0x300c = 0; return 1; } @@ -2471,7 +2471,7 @@ int daAlink_c::procCoTurnBack() { daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; if (checkAnmEnd(frameCtrl_p)) { - if (field_0x300c == 0) { + if (mProcVar2.field_0x300c == 0) { if (i_checkWolf()) { setBlendWolfMoveAnime(5.0f); } else { @@ -2480,11 +2480,11 @@ int daAlink_c::procCoTurnBack() { 2, 3.0f); } - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } dComIfGp_evmng_cutEnd(field_0x3184); - } else if (field_0x300c != 0) { + } else if (mProcVar2.field_0x300c != 0) { dComIfGp_evmng_cutEnd(field_0x3184); } else if (!i_checkWolf() && frameCtrl_p->getFrame() >= 29.0f) { field_0x2f92 = 1; @@ -2517,20 +2517,20 @@ int daAlink_c::procDoorOpenInit() { s16 end_f = -1; field_0x3478 = daAlinkHIO_basic_c0::m.mAnmBlendFactor; - field_0x3008 = 0; + mProcVar0.field_0x3008 = 0; if (mDemo.getParam0() == 4) { open_anm = ANM_DOOR_OPEN_ROLL; - field_0x300c = 1; - field_0x300e.x = 1; - field_0x300e.y = 0; + mProcVar2.field_0x300c = 1; + mProcVar3.field_0x300e.x = 1; + mProcVar3.field_0x300e.y = 0; } else if (mDemo.getParam0() == 5) { open_anm = ANM_DOOR_OPEN_SLIDE; - field_0x300c = 1; - field_0x300e.x = 1; - field_0x300e.y = 0; + mProcVar2.field_0x300c = 1; + mProcVar3.field_0x300e.x = 1; + mProcVar3.field_0x300e.y = 0; } else { - field_0x300e.x = 0; + mProcVar3.field_0x300e.x = 0; if (mDemo.getParam0() & 1) { open_anm = ANM_DOOR_OPEN_RIGHT; @@ -2542,7 +2542,7 @@ int daAlink_c::procDoorOpenInit() { if (mDemo.getParam0() & 4) { field_0x3478 = 10.0f; - field_0x3008 = 10; + mProcVar0.field_0x3008 = 10; if (open_anm == ANM_DOOR_OPEN_LEFT) { end_f = 14; @@ -2555,8 +2555,8 @@ int daAlink_c::procDoorOpenInit() { field_0x34d4 = l_waitBaseAnime; } - field_0x300e.y = 1; - field_0x300c = 0; + mProcVar3.field_0x300e.y = 1; + mProcVar2.field_0x300c = 0; } setSingleAnime(open_anm, 1.0f, start_f, end_f, 0.0f); @@ -2566,7 +2566,7 @@ int daAlink_c::procDoorOpenInit() { mLinkAcch.OnLineCheckNone(); field_0x3588 = l_waitBaseAnime; field_0x3198 = 0; - field_0x300e.z = 0; + mProcVar3.field_0x300e.z = 0; return 1; } #else @@ -2587,20 +2587,20 @@ int daAlink_c::procDoorOpen() { daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; if (field_0x3198 == 0) { - if (field_0x300c == 0 && field_0x300e.y != 0) { + if (mProcVar2.field_0x300c == 0 && mProcVar3.field_0x300e.y != 0) { if (frameCtrl_p->getFrame() >= 9.0f && frameCtrl_p->getFrame() < field_0x347c) { field_0x2f92 = 3; } else { field_0x2f92 = 4; } - } else if (frameCtrl_p->checkPass(18.0f) && field_0x300e.x != 0) { + } else if (frameCtrl_p->checkPass(18.0f) && mProcVar3.field_0x300e.x != 0) { voiceStart(Z2SE_AL_V_PUSH_ROCK); - field_0x300e.x = 0; + mProcVar3.field_0x300e.x = 0; } } if (checkAnmEnd(frameCtrl_p)) { - if (field_0x3008 != 0) { + if (mProcVar0.field_0x3008 != 0) { daAlink_ANM open_anm; if (mDemo.getParam0() & 1) { open_anm = ANM_DOOR_OPEN_LOCK_RIGHT; @@ -2610,9 +2610,9 @@ int daAlink_c::procDoorOpen() { seStartMapInfo(Z2SE_OBJ_KNOB_DOOR_LOCKED); setSingleAnimeBaseMorf(open_anm, 0.0f); - field_0x3008 = 0; + mProcVar0.field_0x3008 = 0; field_0x2f99 = 5; - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; } else { mLinkAcch.ClrWallNone(); mLinkAcch.OffLineCheckNone(); @@ -2620,15 +2620,15 @@ int daAlink_c::procDoorOpen() { onModeFlg(1); offModeFlg(0x4000); - if (field_0x300c == 0) { + if (mProcVar2.field_0x300c == 0) { setBlendMoveAnime(field_0x3478); } field_0x3198 = 1; } } else if (field_0x3198 == 0) { - if (field_0x300c == 0) { - if (field_0x300e.z == 0) { - field_0x300e.z = 1; + if (mProcVar2.field_0x300c == 0) { + if (mProcVar3.field_0x300e.z == 0) { + mProcVar3.field_0x300e.z = 1; } else { field_0x2f99 = 5; } @@ -2846,9 +2846,9 @@ int daAlink_c::procCoDeadInit(int param_0) { mDamageTimer = 0; if (i_checkWolf()) { - field_0x300e.y = 2; + mProcVar3.field_0x300e.y = 2; } else { - field_0x300e.y = 2; + mProcVar3.field_0x300e.y = 2; } setDeadRideSyncPos(); @@ -2917,14 +2917,14 @@ int daAlink_c::procCoDeadInit(int param_0) { field_0x3478 = 1.0f; } - field_0x300e.x = 0; - field_0x3008 = 0; + mProcVar3.field_0x300e.x = 0; + mProcVar0.field_0x3008 = 0; dComIfGp_setPlayerStatus0(0, 0x20000000); mMsgClassID = 0; setFootEffectProcType(4); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; field_0x3080 = 0; - field_0x300e.z = 0x3F; + mProcVar3.field_0x300e.z = 0x3F; field_0x3198 = -1; return 1; } @@ -2945,9 +2945,9 @@ asm int daAlink_c::procCoDeadInit(int param_0) { int daAlink_c::procCoDead() { daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; - if (field_0x3008 == 0) { + if (mProcVar0.field_0x3008 == 0) { setDeadRideSyncPos(); - field_0x3008 = 1; + mProcVar0.field_0x3008 = 1; return 1; } @@ -2961,11 +2961,11 @@ int daAlink_c::procCoDead() { } if (!i_checkNoResetFlg2(FLG2_UNK_40000)) { - field_0x300e.x++; - if (field_0x300e.x == 2) { + mProcVar3.field_0x300e.x++; + if (mProcVar3.field_0x300e.x == 2) { dCam_getBody()->StartEventCamera(9, fopAcM_GetID(this), 0); - } else if (field_0x300e.x > 10) { - field_0x300e.x = 10; + } else if (mProcVar3.field_0x300e.x > 10) { + mProcVar3.field_0x300e.x = 10; } if (!i_checkModeFlg(0x400)) { @@ -2996,11 +2996,11 @@ int daAlink_c::procCoDead() { d_GameOver_animeStart(mMsgClassID); } - if (field_0x300c == 0 && d_GameOver_CheckDelete(mMsgClassID)) { - field_0x300c = 1; + if (mProcVar2.field_0x300c == 0 && d_GameOver_CheckDelete(mMsgClassID)) { + mProcVar2.field_0x300c = 1; } - if (field_0x300c != 0 && dComIfGp_getGameoverStatus() == 2 && + if (mProcVar2.field_0x300c != 0 && dComIfGp_getGameoverStatus() == 2 && !i_checkNoResetFlg0(FLG0_UNK_4000)) { i_dComIfGp_setItemLifeCount(-(i_dComIfGs_getLife() - 12), 0); @@ -3025,8 +3025,8 @@ int daAlink_c::procCoDead() { (checkStageName("D_MN08C") && !i_dComIfGs_isEventBit(0x2880)))) { var_r3_2 = 0; - } else if (field_0x300e.z != 0x3F) { - var_r3_2 = field_0x300e.z; + } else if (mProcVar3.field_0x300e.z != 0x3F) { + var_r3_2 = mProcVar3.field_0x300e.z; var_r30 = field_0x3198; } else { startRestartRoom(var_r31, 0xC9, 0, 1); @@ -3058,7 +3058,7 @@ int daAlink_c::procCoLookAroundInit() { return 0; } - field_0x300e.x = 0; + mProcVar3.field_0x300e.x = 0; if (i_checkWolf()) { setSingleAnimeWolfBase(WANM_ENTRANCE); @@ -3072,12 +3072,12 @@ int daAlink_c::procCoLookAroundInit() { } else { setSingleAnimeBase(ANM_ENTRANCE); field_0x3588 = l_waitBaseAnime; - field_0x300e.x = 1; + mProcVar3.field_0x300e.x = 1; } } mNormalSpeed = FLOAT_LABEL(lit_6108); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; return 1; } @@ -3085,15 +3085,15 @@ int daAlink_c::procCoLookAroundInit() { int daAlink_c::procCoLookAround() { daPy_frameCtrl_c* frame_ctrl = mUnderFrameCtrl; - if (field_0x300c == 0) { - field_0x300c = 1; + if (mProcVar2.field_0x300c == 0) { + mProcVar2.field_0x300c = 1; } else { field_0x2f99 = 4; } if (checkAnmEnd(frame_ctrl)) { dComIfGp_evmng_cutEnd(field_0x3184); - } else if (field_0x300e.x != 0 && frame_ctrl->checkPass(lit_7808)) { + } else if (mProcVar3.field_0x300e.x != 0 && frame_ctrl->checkPass(lit_7808)) { voiceStart(Z2SE_AL_V_ENTRANCE); } @@ -3185,7 +3185,7 @@ int daAlink_c::procLookUpToGetItemInit() { } setSingleAnimeBaseMorf(ANM_GET_HOLDOUT, lit_7307); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; mNormalSpeed = FLOAT_LABEL(lit_6108); field_0x3588 = l_waitBaseAnime; field_0x2f99 = 12; @@ -3199,12 +3199,12 @@ int daAlink_c::procLookUpToGetItem() { field_0x2f99 = 4; } - if (field_0x300c == 0 && checkAnmEnd(mUpperFrameCtrl)) { - field_0x300c = 1; + if (mProcVar2.field_0x300c == 0 && checkAnmEnd(mUpperFrameCtrl)) { + mProcVar2.field_0x300c = 1; setSingleAnimeBase(ANM_GET_A_WAIT); setFaceBasicBck(0x133); field_0x2f99 = 12; - } else if (field_0x300c != 0) { + } else if (mProcVar2.field_0x300c != 0) { dComIfGp_evmng_cutEnd(field_0x3184); } @@ -3227,8 +3227,8 @@ int daAlink_c::procHandPatInit() { setOldRootQuaternion(0, -0x8000, 0); shape_angle.y += 0x8000; - field_0x300c = 0; - field_0x300e.x = 0; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.x = 0; return 1; } @@ -3238,13 +3238,13 @@ int daAlink_c::procHandPatInit() { int daAlink_c::procHandPat() { daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { if (checkAnmEnd(frameCtrl_p)) { dComIfGp_evmng_cutEnd(field_0x3184); - if (field_0x300e.x == 0) { + if (mProcVar3.field_0x300e.x == 0) { setSingleAnimeBaseSpeed(ANM_WAIT, daAlinkHIO_move_c0::m.mWaitAnmSpeed, 3.0f); - field_0x300e.x = 1; + mProcVar3.field_0x300e.x = 1; } } } else { @@ -3254,7 +3254,7 @@ int daAlink_c::procHandPat() { if (checkAnmEnd(frameCtrl_p)) { setSingleAnimeBase(ANM_WAIT_B_TO_A); - field_0x300c = 1; + mProcVar2.field_0x300c = 1; shape_angle.y += 0x8000; field_0x2fe6 = shape_angle.y; current.angle.y = shape_angle.y; @@ -3312,8 +3312,8 @@ int daAlink_c::procCoFogDeadInit() { field_0x3194 = 0; dCam_getBody()->StartEventCamera(0x13, fopAcM_GetID(this), "Type", 1, &field_0x3194, 0); - field_0x3008 = 60; - field_0x300c = 0; + mProcVar0.field_0x3008 = 60; + mProcVar2.field_0x300c = 0; return 1; } @@ -3334,14 +3334,14 @@ int daAlink_c::procCoFogDead() { } } - if (field_0x3008 > 0) { - field_0x3008--; - } else if (field_0x3008 == 0) { + if (mProcVar0.field_0x3008 > 0) { + mProcVar0.field_0x3008--; + } else if (mProcVar0.field_0x3008 == 0) { if (dStage_changeScene(daTagMist_c::getPlayerNo(), 0.0f, 5, fopAcM_GetRoomNo(this), shape_angle.y, -1)) { seStartSystem(Z2SE_FORCE_BACK); - field_0x3008--; + mProcVar0.field_0x3008--; } } @@ -3379,7 +3379,7 @@ int daAlink_c::procCoNodInit() { } if (i_checkWolf()) { - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } else { if (mDemo.getParam0() == 1) { setUpperAnimeBase(0x24E); @@ -3394,7 +3394,7 @@ int daAlink_c::procCoNodInit() { field_0x2f96 = 4; field_0x2f97 = 10; i_onNoResetFlg1(0x10100000); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; } return 1; @@ -3403,11 +3403,11 @@ int daAlink_c::procCoNodInit() { /* 8011D1F4-8011D268 117B34 0074+00 1/0 0/0 0/0 .text procCoNod__9daAlink_cFv */ int daAlink_c::procCoNod() { if (checkAnmEnd(&mUpperFrameCtrl[2])) { - field_0x300c = 1; + mProcVar2.field_0x300c = 1; resetUpperAnime(UPPER_2, lit_6109); } - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { dComIfGp_evmng_cutEnd(field_0x3184); } @@ -3439,14 +3439,14 @@ int daAlink_c::procCoGlareInit() { } if (i_checkWolf()) { - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } else { setUpperAnimeBase(0xD2); mUpperFrameCtrl[2].setAttribute(2); mUpperFrameCtrl[2].setLoop(45); setFacePriTexture(FTANM_UNK_76); setFacePriBck(0x128); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; field_0x3478 = lit_6041; field_0x2f96 = 4; field_0x2f97 = 10; @@ -3462,13 +3462,13 @@ int daAlink_c::procCoGlare() { if (!i_checkWolf()) { if (field_0x3478 > frame_ctrl->getFrame()) { - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } else { field_0x3478 = frame_ctrl->getFrame(); } } - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { dComIfGp_evmng_cutEnd(field_0x3184); } @@ -3489,7 +3489,7 @@ int daAlink_c::procGoatStopReadyInit() { setSingleAnimeBase(ANM_ATN_COW); mNormalSpeed = FLOAT_LABEL(lit_6108); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; return 1; } @@ -3497,10 +3497,10 @@ int daAlink_c::procGoatStopReadyInit() { int daAlink_c::procGoatStopReady() { if (checkAnmEnd(mUnderFrameCtrl)) { setSingleAnimeBase(ANM_COW_MOVE_LEFT_RIGHT); - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { dComIfGp_evmng_cutEnd(field_0x3184); } @@ -3524,10 +3524,10 @@ int daAlink_c::procCoGetReadySitInit() { if (i_checkWolf()) { setSingleAnimeWolfBaseSpeed(WANM_WAIT, daAlinkHIO_wlMove_c0::m.field_0x70, lit_6109); - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } else { setSingleAnime(ANM_TRES_OPEN_SMALL, lit_6040, lit_8780, -1, lit_6109); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; field_0x3588 = l_waitBaseAnime; field_0x2f99 = 12; } @@ -3538,14 +3538,14 @@ int daAlink_c::procCoGetReadySitInit() { /* 8011D64C-8011D6D0 117F8C 0084+00 1/0 0/0 0/0 .text procCoGetReadySit__9daAlink_cFv */ int daAlink_c::procCoGetReadySit() { if (checkAnmEnd(mUnderFrameCtrl)) { - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } if (!i_checkWolf() && field_0x2f99 != 12) { field_0x2f99 = 4; } - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { dComIfGp_evmng_cutEnd(field_0x3184); } @@ -3609,8 +3609,8 @@ int daAlink_c::procWolfSnowEscapeInit() { field_0x2f99 = 13; field_0x3588 = l_wolfBaseAnime; field_0x3478 = lit_37528; - field_0x300c = 0; - field_0x300e.x = 0; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.x = 0; mNormalSpeed = lit_6845; return 1; } @@ -3621,7 +3621,7 @@ int daAlink_c::procWolfSnowEscapeInit() { int daAlink_c::procWolfSnowEscape() { daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; - if (field_0x300e.x != 0) { + if (mProcVar3.field_0x300e.x != 0) { dComIfGp_evmng_cutEnd(field_0x3184); return 1; } @@ -3644,8 +3644,8 @@ int daAlink_c::procWolfSnowEscape() { field_0x2fe6 = shape_angle.y; current.angle.y = shape_angle.y; - if (field_0x300c == 0) { - field_0x300c = 1; + if (mProcVar2.field_0x300c == 0) { + mProcVar2.field_0x300c = 1; setSingleAnimeWolfParam(WANM_SLIDE_FORWARD_START, &daAlinkHIO_wlSlide_c0::m.field_0x0); field_0x3588 = l_wolfBaseAnime; field_0x3478 = 1.0f / (f32)frameCtrl_p->getEnd(); @@ -3654,7 +3654,7 @@ int daAlink_c::procWolfSnowEscape() { } else { setSingleAnimeWolfBaseSpeed(WANM_WAIT, daAlinkHIO_wlMove_c0::m.field_0x70, 3.0f); field_0x2f99 = 0x30; - field_0x300e.x = 1; + mProcVar3.field_0x300e.x = 1; } } else if (frameCtrl_p->checkPass(12.0f)) { mNormalSpeed = 0.0f; @@ -3686,8 +3686,8 @@ int daAlink_c::procZoraMoveInit() { setSpecialGravity(tmp_0, mMaxFallSpeed, 0); deleteEquipItem(FALSE, TRUE); - field_0x300e.y = 5000; - field_0x300e.z = 0; + mProcVar3.field_0x300e.y = 5000; + mProcVar3.field_0x300e.z = 0; field_0x384c = (cXyz*)&l_boarBaseAnime; return 1; } @@ -3761,29 +3761,29 @@ int daAlink_c::procTradeItemOutInit() { field_0x3198 = setTalkStartBack(&field_0x37c8); if (field_0x3198 == 0) { - field_0x300c = setTradeItemAnime(); + mProcVar2.field_0x300c = setTradeItemAnime(); mNormalSpeed = FLOAT_LABEL(lit_6108); } else { - field_0x300c = 0; + mProcVar2.field_0x300c = 0; } - field_0x300e.x = 0; + mProcVar3.field_0x300e.x = 0; dComIfGp_setPlayerStatus0(0, 0x10); - field_0x300e.y = 1; + mProcVar3.field_0x300e.y = 1; if (mDemo.getParam0() != 1) { if (mDemo.getParam0() == 2) { if (checkLetterItem(mDemo.getParam1())) { - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; } } else { if (checkLetterItem(dComIfGp_event_getPreItemNo())) { - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; } } } - field_0x3008 = 30; + mProcVar0.field_0x3008 = 30; return 1; } @@ -3815,19 +3815,19 @@ int daAlink_c::procTradeItemOut() { current.pos.x = field_0x37c8.x; current.pos.z = field_0x37c8.z; field_0x3198 = 0; - field_0x300c = setTradeItemAnime(); + mProcVar2.field_0x300c = setTradeItemAnime(); mNormalSpeed = 0.0f; - } else if (field_0x3008 != 0) { - field_0x3008--; + } else if (mProcVar0.field_0x3008 != 0) { + mProcVar0.field_0x3008--; } else { field_0x3198 = 0; - field_0x300c = setTradeItemAnime(); + mProcVar2.field_0x300c = setTradeItemAnime(); mNormalSpeed = 0.0f; } } else { current.angle.y = shape_angle.y; - if (field_0x300e.x != 0) { + if (mProcVar3.field_0x300e.x != 0) { if (mDemo.getParam0() == 1) { dComIfGp_evmng_cutEnd(field_0x3184); } else { @@ -3840,8 +3840,8 @@ int daAlink_c::procTradeItemOut() { field_0x280c.setData(item_partner_p); item_partner_p->show(); - if (field_0x300e.y == 0) { - field_0x300e.y = 1; + if (mProcVar3.field_0x300e.y == 0) { + mProcVar3.field_0x300e.y = 1; seStartOnlyReverb(Z2SE_AL_OPEN_LETTER); } @@ -3857,7 +3857,7 @@ int daAlink_c::procTradeItemOut() { } else if (checkAnmEnd(mUnderFrameCtrl)) { setSingleAnimeBase(ANM_TRADE_ITEM_WAIT); onModeFlg(0x100); - field_0x300e.x = 1; + mProcVar3.field_0x300e.x = 1; } else { setTradeItemOutHand(); } @@ -3897,8 +3897,8 @@ int daAlink_c::procNotUseItemInit(int param_0) { mNormalSpeed = FLOAT_LABEL(lit_6108); mMsgClassID = -1; field_0x3198 = param_0; - field_0x300c = 0; - field_0x300e.x = 0; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.x = 0; current.angle.y = shape_angle.y; field_0x3194 = 3; @@ -3907,9 +3907,9 @@ int daAlink_c::procNotUseItemInit(int param_0) { dComIfGp_setPlayerStatus1(0, 0x4000800); if (checkLetterItem(param_0)) { - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; } else { - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; } return 1; } @@ -3926,14 +3926,14 @@ asm int daAlink_c::procNotUseItemInit(int param_0) { /* 8011E57C-8011E6E0 118EBC 0164+00 1/0 0/0 0/0 .text procNotUseItem__9daAlink_cFv */ int daAlink_c::procNotUseItem() { - if (field_0x300c == 0) { + if (mProcVar2.field_0x300c == 0) { u32 item_partner_id = fopAcM_createItemForPresentDemo( ¤t.pos, field_0x3198, 5, -1, fopAcM_GetRoomNo(this), &shape_angle, &mScale); dComIfGp_event_setItemPartnerId(item_partner_id); - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } - if (field_0x300e.x != 0) { + if (mProcVar3.field_0x300e.x != 0) { daItemBase_c* item_partner_p = (daItemBase_c*)fopAcM_getItemEventPartner(this); #ifdef DEBUG if (item_partner_p != NULL && fopAcM_GetName(item_partner_p) != PROC_ITEM && @@ -3950,8 +3950,8 @@ int daAlink_c::procNotUseItem() { field_0x280c.setData(item_partner_p); item_partner_p->show(); - if (field_0x300e.y == 0) { - field_0x300e.y = 1; + if (mProcVar3.field_0x300e.y == 0) { + mProcVar3.field_0x300e.y = 1; seStartOnlyReverb(Z2SE_AL_OPEN_LETTER); } @@ -3965,7 +3965,7 @@ int daAlink_c::procNotUseItem() { } else if (checkAnmEnd(mUnderFrameCtrl)) { setSingleAnimeBase(ANM_TRADE_ITEM_WAIT); onModeFlg(0x100); - field_0x300e.x = 1; + mProcVar3.field_0x300e.x = 1; } else { setTradeItemOutHand(); } @@ -3982,7 +3982,7 @@ int daAlink_c::procSwordReadyInit() { mNormalSpeed = FLOAT_LABEL(lit_6108); current.angle.y = shape_angle.y; setSingleAnimeBase(ANM_DEMO_KAMAE); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; return 1; } @@ -3991,15 +3991,15 @@ int daAlink_c::procSwordReady() { daPy_frameCtrl_c* frame_ctrl = mUnderFrameCtrl; if (checkAnmEnd(frame_ctrl)) { - if (field_0x300c == 0) { + if (mProcVar2.field_0x300c == 0) { setDoubleAnime(FLOAT_LABEL(lit_6108), daAlinkHIO_noActAtnMove_c0::m.mWaitAnmSpeed, daAlinkHIO_noActAtnMove_c0::m.mWaitAnmSpeed, ANM_WAIT_B, ANM_WAIT_B, 2, lit_6109); } - field_0x300c = 1; + mProcVar2.field_0x300c = 1; dComIfGp_evmng_cutEnd(field_0x3184); - } else if (field_0x300c != 0) { + } else if (mProcVar2.field_0x300c != 0) { dComIfGp_evmng_cutEnd(field_0x3184); } else if (frame_ctrl->checkPass(lit_7625)) { voiceStart(Z2SE_AL_V_OUGI_KAMAE); @@ -4121,7 +4121,7 @@ int daAlink_c::procMasterSwordStickInit() { voiceStart(Z2SE_AL_V_MSTR_SW_STICK); mNormalSpeed = FLOAT_LABEL(lit_6108); current.angle.y = shape_angle.y; - field_0x300c = 0; + mProcVar2.field_0x300c = 0; return 1; } @@ -4131,10 +4131,10 @@ int daAlink_c::procMasterSwordStickInit() { int daAlink_c::procMasterSwordStick() { daPy_frameCtrl_c* frame_ctrl = mUnderFrameCtrl; - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { dComIfGp_evmng_cutEnd(field_0x3184); } else if (checkAnmEnd(frame_ctrl)) { - field_0x300c = 1; + mProcVar2.field_0x300c = 1; setSingleAnimeBaseMorf(ANM_DEMO_MASTER_SWORD_WAIT, lit_6041); dComIfGp_evmng_cutEnd(field_0x3184); } else if (frame_ctrl->getFrame() >= lit_14621) { @@ -4152,7 +4152,7 @@ int daAlink_c::procMasterSwordPullInit() { setSingleAnimeBase(ANM_DEMO_MASTER_SWORD_PULL); voiceStart(Z2SE_AL_V_MSTR_SW_PULLOUT); - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; return 1; } @@ -4167,9 +4167,9 @@ int daAlink_c::procMasterSwordPull() { } else if (frame_ctrl->getFrame() >= lit_8780) { field_0x2f93 = 10; } else if (frame_ctrl->getFrame() >= lit_7710) { - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; } else if (frame_ctrl->getFrame() >= lit_6040) { - field_0x300e.y = 4; + mProcVar3.field_0x300e.y = 4; } return 1; @@ -4206,7 +4206,7 @@ int daAlink_c::procDungeonWarpReadyInit() { mNormalSpeed = FLOAT_LABEL(lit_6108); current.angle.y = shape_angle.y; field_0x32cc = id; - field_0x300c = 0; + mProcVar2.field_0x300c = 0; keepItemData(); return 1; @@ -4230,11 +4230,11 @@ int daAlink_c::procDungeonWarpInit() { return 0; } - field_0x300c = 0; - field_0x300e.z = 0; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.z = 0; setSpecialGravity(FLOAT_LABEL(lit_6108), mMaxFallSpeed, 0); - field_0x300e.x = 0; - field_0x300e.y = 0; + mProcVar3.field_0x300e.x = 0; + mProcVar3.field_0x300e.y = 0; return 1; } @@ -4243,25 +4243,25 @@ int daAlink_c::procDungeonWarpInit() { // matches with literals #ifdef NONMATCHING int daAlink_c::procDungeonWarp() { - field_0x300c += 0x200; + mProcVar2.field_0x300c += 0x200; - if (field_0x300c > 0x4000) { - field_0x300c = 0x4000; + if (mProcVar2.field_0x300c > 0x4000) { + mProcVar2.field_0x300c = 0x4000; } else { current.pos.y += 1.0f; } - f32 sin = cM_ssin(field_0x300c); + f32 sin = cM_ssin(mProcVar2.field_0x300c); shape_angle.y += (s16)(14336.0f * sin); - field_0x300e.x = 8.0f * sin + 24.0f * (1.0f - mScale.x); + mProcVar3.field_0x300e.x = 8.0f * sin + 24.0f * (1.0f - mScale.x); - if (field_0x300e.z != 0) { + if (mProcVar3.field_0x300e.z != 0) { return 1; } else { - if (field_0x300c == 0x4000) { - if (field_0x300e.y == 0) { + if (mProcVar2.field_0x300c == 0x4000) { + if (mProcVar3.field_0x300e.y == 0) { dComIfGp_particle_set(0xA61, ¤t.pos, &mTevStr, NULL, NULL); - field_0x300e.y = 1; + mProcVar3.field_0x300e.y = 1; } cLib_addCalc(&mScale.x, 0.0f, 0.5f, 0.4f, 0.005f); @@ -4279,11 +4279,11 @@ int daAlink_c::procDungeonWarp() { dMeter2Info_warpInProc(); } - field_0x300e.z = 1; + mProcVar3.field_0x300e.z = 1; } current.pos.y += 5.0f; field_0x2b98 = (1.0f - mScale.y) * 100.0f; - } else if (field_0x300c >= 0x2000) { + } else if (mProcVar2.field_0x300c >= 0x2000) { cLib_chaseF(&mScale.x, 0.8f, 0.01f); } @@ -4319,9 +4319,9 @@ int daAlink_c::procDungeonWarpSceneStartInit() { createNpcTks(¤t.pos, fopAcM_GetRoomNo(this), 4); } - field_0x300c = 0x4000; - field_0x300e.x = 0x20; - field_0x300e.y = 0; + mProcVar2.field_0x300c = 0x4000; + mProcVar3.field_0x300e.x = 0x20; + mProcVar3.field_0x300e.y = 0; current.pos.y += 120.0f; shape_angle.y += 0x7F7A; @@ -4345,8 +4345,8 @@ asm int daAlink_c::procDungeonWarpSceneStartInit() { // matches with literals #ifdef NONMATCHING int daAlink_c::procDungeonWarpSceneStart() { - if (field_0x300e.y == 0) { - field_0x300e.y = 1; + if (mProcVar3.field_0x300e.y == 0) { + mProcVar3.field_0x300e.y = 1; seStartOnlyReverb(Z2SE_TKC_WARP_OUT); } @@ -4362,17 +4362,17 @@ int daAlink_c::procDungeonWarpSceneStart() { if (!var_r31) { current.pos.y -= 5.0f; } else { - field_0x300c -= 0x200; - if (field_0x300c < 0) { + mProcVar2.field_0x300c -= 0x200; + if (mProcVar2.field_0x300c < 0) { return checkNextAction(0); } current.pos.y -= 1.0f; } - f32 sin = cM_ssin(field_0x300c); + f32 sin = cM_ssin(mProcVar2.field_0x300c); shape_angle.y += (s16)(sin * 14336.0f); - field_0x300e.x = (sin * 8.0f) + ((1.0f - mScale.x) * 24.0f); + mProcVar3.field_0x300e.x = (sin * 8.0f) + ((1.0f - mScale.x) * 24.0f); return 1; } #else @@ -4465,7 +4465,7 @@ void daAlink_c::dungeonReturnWarp() { /* 8011F8B8-8011F9EC 11A1F8 0134+00 1/0 0/0 0/0 .text skipPortalObjWarp__9daAlink_cFv */ void daAlink_c::skipPortalObjWarp() { - if (mProcID == PROC_WARP && field_0x300e.x <= 0) { + if (mProcID == PROC_WARP && mProcVar3.field_0x300e.x <= 0) { return; } @@ -4482,7 +4482,7 @@ void daAlink_c::skipPortalObjWarp() { } if (mProcID == PROC_WARP) { - field_0x300e.x = -1; + mProcVar3.field_0x300e.x = -1; } } @@ -4564,15 +4564,15 @@ int daAlink_c::procCoWarpInit(int param_0, int param_1) { (checkStageName("D_MN08") && fopAcM_GetRoomNo(this) == 0)); field_0x3478 = 0.0f; - field_0x300c = param_0; - field_0x300e.z = 1; - field_0x300a = 0; - field_0x300e.y = 0xFF; + mProcVar2.field_0x300c = param_0; + mProcVar3.field_0x300e.z = 1; + mProcVar1.field_0x300a = 0; + mProcVar3.field_0x300e.y = 0xFF; field_0x3488 = 1.0f; - if (field_0x300c == 0) { + if (mProcVar2.field_0x300c == 0) { field_0x3480 = -0.5f; - field_0x3008 = 0; + mProcVar0.field_0x3008 = 0; if (i_checkWolf()) { field_0x347c = 3.5f; @@ -4628,11 +4628,11 @@ int daAlink_c::procCoWarpInit(int param_0, int param_1) { field_0x3484 = 1.0f; } else { field_0x347c = -0.5f; - field_0x3008 = 45; + mProcVar0.field_0x3008 = 45; if (i_checkWolf()) { field_0x3480 = 3.5f; - field_0x300e.z = 0; + mProcVar3.field_0x300e.z = 0; field_0x3488 = -1.0f; } else { field_0x3480 = 5.5f; @@ -4643,13 +4643,13 @@ int daAlink_c::procCoWarpInit(int param_0, int param_1) { field_0x3484 = 0.0f; if (!mLinkAcch.ChkGroundHit()) { setSpecialGravity(0.0f, mMaxFallSpeed, 0); - field_0x300a = 1; + mProcVar1.field_0x300a = 1; } kytag04_class* kytag04_p = (kytag04_class*)fopAcIt_Judge((fopAcIt_JudgeFunc)daAlink_searchPortal, ¤t.pos); if (kytag04_p != NULL) { - field_0x300e.y = kytag04_p->mNeedDropNum; + mProcVar3.field_0x300e.y = kytag04_p->mNeedDropNum; } } @@ -4657,7 +4657,7 @@ int daAlink_c::procCoWarpInit(int param_0, int param_1) { seStartOnlyReverb(var_r29); } - field_0x300e.x = param_1; + mProcVar3.field_0x300e.x = param_1; warpModelTexScroll(); return 1; } @@ -4676,8 +4676,8 @@ asm int daAlink_c::procCoWarpInit(int param_0, int param_1) { // matches with literals #ifdef NONMATCHING int daAlink_c::procCoWarp() { - if (field_0x300a != 0 && mLinkAcch.ChkGroundHit()) { - field_0x300a = 0; + if (mProcVar1.field_0x300a != 0 && mLinkAcch.ChkGroundHit()) { + mProcVar1.field_0x300a = 0; f32 var_f1; if (i_checkWolf()) { @@ -4690,35 +4690,35 @@ int daAlink_c::procCoWarp() { } if (mDemo.getDemoMode() == 0x2D) { - if (field_0x300e.z == 0) { - field_0x300e.z = 1; + if (mProcVar3.field_0x300e.z == 0) { + mProcVar3.field_0x300e.z = 1; } - if (i_checkWolf() && field_0x300c != 0) { + if (i_checkWolf() && mProcVar2.field_0x300c != 0) { for (int i = 0; i < 6; i++) { setEmitter(&field_0x3240[i], effName_39419[i], ¤t.pos, &shape_angle); } } } - if (field_0x300c != 0 && !i_checkWolf()) { + if (mProcVar2.field_0x300c != 0 && !i_checkWolf()) { setEmitter(&field_0x3240[0], 0x9F3, ¤t.pos, &shape_angle); } - if (field_0x300e.z != 0 && field_0x3488 < 0.0f) { + if (mProcVar3.field_0x300e.z != 0 && field_0x3488 < 0.0f) { seStartOnlyReverb(Z2SE_WOLF_WARP_OUT); field_0x3488 = 1.0f; } - if (field_0x300e.z != 0) { - if (field_0x3008 != 0) { - field_0x3008--; + if (mProcVar3.field_0x300e.z != 0) { + if (mProcVar0.field_0x3008 != 0) { + mProcVar0.field_0x3008--; } else if (warpModelTexScroll()) { - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { if (mDemo.getDemoMode() == 0x2D) { - if (field_0x300a != 0) { + if (mProcVar1.field_0x300a != 0) { if (field_0x3174 == 4) { - dComIfGp_setNextStage(dComIfGp_getStartStageName(), field_0x300e.y, + dComIfGp_setNextStage(dComIfGp_getStartStageName(), mProcVar3.field_0x300e.y, fopAcM_GetRoomNo(this), -1, 0.0f, 5, 1, 0, shape_angle.y, 1, 0); i_changeOriginalDemo(); @@ -4734,12 +4734,12 @@ int daAlink_c::procCoWarp() { } else { return checkWaitAction(); } - } else if (field_0x300e.x != 0) { + } else if (mProcVar3.field_0x300e.x != 0) { skipPortalObjWarp(); } else { dComIfGp_evmng_cutEnd(field_0x3184); } - } else if (field_0x300c == 0 && !i_checkNoResetFlg0(FLG0_PLAYER_NO_DRAW)) { + } else if (mProcVar2.field_0x300c == 0 && !i_checkNoResetFlg0(FLG0_PLAYER_NO_DRAW)) { cXyz sp10(current.pos.x, current.pos.y + (field_0x347c - -0.5f) * 30.0f, current.pos.z); setEmitter(&field_0x3240[0], field_0x32cc, &sp10, &shape_angle); } diff --git a/src/d/a/d_a_alink_effect.inc b/src/d/a/d_a_alink_effect.inc index 12ef8973c25..0cd47da2de1 100644 --- a/src/d/a/d_a_alink_effect.inc +++ b/src/d/a/d_a_alink_effect.inc @@ -342,7 +342,7 @@ asm void daAlink_c::setWolfBarrierHitEffect(dBgS_LinChk& param_0) { /* 80124144-801241E0 11EA84 009C+00 9/9 0/0 0/0 .text setCutWaterDropEffect__9daAlink_cFv */ void daAlink_c::setCutWaterDropEffect() { - if (field_0x32c0 > 0) { + if (field_0x32c0[0] > 0) { cXyz sp18; mDoMtx_multVecZero(mpLinkModel->i_getAnmMtx(1), &sp18); dComIfGp_particle_setColor(0x2A4, &sp18, &mTevStr, NULL, NULL, FLOAT_LABEL(lit_6108), -1, diff --git a/src/d/a/d_a_alink_grab.inc b/src/d/a/d_a_alink_grab.inc index 09d93e8b7c7..d6d30740592 100644 --- a/src/d/a/d_a_alink_grab.inc +++ b/src/d/a/d_a_alink_grab.inc @@ -176,7 +176,7 @@ static u8 lit_4421[12]; #pragma pop /* 80425634-80425640 052354 000C+00 2/3 0/0 0/0 .bss l_wolfRopeBaseAnime */ -static f32 l_wolfRopeBaseAnime[3]; +static Vec l_wolfRopeBaseAnime; /* 80425640-8042564C 052360 000C+00 0/1 0/0 0/0 .bss @14255 */ #pragma push @@ -324,9 +324,9 @@ asm void daAlink_c::putObjLineCheck(dBgS_LinChk& param_0, cXyz* param_1, fopAc_a #pragma pop /* 800E5B6C-800E5BB4 0E04AC 0048+00 3/3 0/0 0/0 .text grabLineCheck__9daAlink_cFP4cXyzP4cXyz */ -void daAlink_c::grabLineCheck(cXyz* i_start, cXyz* i_end) { +bool daAlink_c::grabLineCheck(cXyz* i_start, cXyz* i_end) { mObjLinChk.Set(i_start, i_end, mGrabItemAcKeep.getActor()); - dComIfG_Bgsp().LineCross(&mObjLinChk); + return dComIfG_Bgsp().LineCross(&mObjLinChk); } /* 800E5BB4-800E5CBC 0E04F4 0108+00 6/6 0/0 0/0 .text setGrabItemActor__9daAlink_cFP10fopAc_ac_c @@ -858,8 +858,8 @@ static fopAc_ac_c* daAlink_searchGoat(fopAc_ac_c* i_actor, void*) { /* 800E91C4-800E9210 0E3B04 004C+00 1/0 0/0 0/0 .text cancelGoronThrowEvent__9daAlink_cFv */ void daAlink_c::cancelGoronThrowEvent() { - if (mProcID == PROC_GOAT_CATCH && field_0x300e.z == 0) { - field_0x300e.z = 1; + if (mProcID == PROC_GOAT_CATCH && mProcVar3.field_0x300e.z == 0) { + mProcVar3.field_0x300e.z = 1; i_dComIfGp_event_reset(); } } @@ -892,14 +892,14 @@ int daAlink_c::procGoatMoveInit() { field_0x594 = daAlinkHIO_atnMove_c0::m.mMaxSpeed; setSingleAnimeBase(ANM_ATN_COW); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; fopAc_ac_c* goat_p = (fopAc_ac_c*)fopAcIt_Judge((fopAcIt_JudgeFunc)daAlink_searchGoat, NULL); if (goat_p != NULL) { field_0x280c.setData(goat_p); } - field_0x300e.x = 0; + mProcVar3.field_0x300e.x = 0; deleteEquipItem(FALSE, FALSE); return 1; } @@ -1002,8 +1002,8 @@ int daAlink_c::procGoronMoveInit() { current.angle.y = shape_angle.y + -0x4000; field_0x594 = daAlinkHIO_atnMove_c0::m.mMaxSpeed; setSingleAnimeBase(ANM_ATN_RIGHT); - field_0x300c = 1; - field_0x300e.x = 0; + mProcVar2.field_0x300c = 1; + mProcVar3.field_0x300e.x = 0; return 1; } diff --git a/src/d/a/d_a_alink_hang.inc b/src/d/a/d_a_alink_hang.inc index 59552b5e08a..011d351077d 100644 --- a/src/d/a/d_a_alink_hang.inc +++ b/src/d/a/d_a_alink_hang.inc @@ -398,7 +398,7 @@ int daAlink_c::procHangReadyInit() { commonProcInit(PROC_HANG_READY); setSingleAnimeParam(ANM_CLIMB_JUMP, &daAlinkHIO_wallCatch_c0::m.mJumpAnm); - field_0x300c = field_0x306e + 0x8000; + mProcVar2.field_0x300c = field_0x306e + 0x8000; field_0x3198 = field_0x2f91; f32 tmp_0 = FLOAT_LABEL(lit_6108); @@ -409,11 +409,11 @@ int daAlink_c::procHangReadyInit() { /* 800FC240-800FC2F4 0F6B80 00B4+00 1/0 0/0 0/0 .text procHangReady__9daAlink_cFv */ int daAlink_c::procHangReady() { - cLib_addCalcAngleS(&shape_angle.y, field_0x300c, 2, 0x1000, 0x400); + cLib_addCalcAngleS(&shape_angle.y, mProcVar2.field_0x300c, 2, 0x1000, 0x400); current.angle.y = shape_angle.y; if (checkAnmEnd(mUnderFrameCtrl)) { - shape_angle.y = field_0x300c; + shape_angle.y = mProcVar2.field_0x300c; current.angle.y = shape_angle.y; int hang_init; @@ -443,7 +443,7 @@ int daAlink_c::procHangLeverDownInit() { commonProcInit(PROC_HANG_LEVER_DOWN); field_0x280c.setData(field_0x27f4); setSingleAnimeParam(ANM_CLIMB_JUMP, &daAlinkHIO_wallCatch_c0::m.mJumpAnm); - field_0x300c = field_0x27f4->shape_angle.y + 0x8000; + mProcVar2.field_0x300c = field_0x27f4->shape_angle.y + 0x8000; field_0x3198 = 145; f32 tmp_0 = FLOAT_LABEL(lit_6108); @@ -525,11 +525,11 @@ int daAlink_c::procBossBodyHangInit(fopAc_ac_c* param_0) { setSpecialGravity(tmp_0, mMaxFallSpeed, 0); speed.y = FLOAT_LABEL(lit_6108); - field_0x300c = 0; - field_0x300e.x = 0; - field_0x300e.y = 0; - field_0x3008 = 0; - field_0x300e.z = 0; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.x = 0; + mProcVar3.field_0x300e.y = 0; + mProcVar0.field_0x3008 = 0; + mProcVar3.field_0x300e.z = 0; field_0x3080 = 0; field_0x280c.setData(param_0); @@ -691,8 +691,8 @@ int daAlink_c::procLadderUpEndInit(int param_0) { field_0x30a0 = -0x0800; field_0x33f4 = lit_6041; - field_0x300c = 1; - field_0x300e.y = 1; + mProcVar2.field_0x300c = 1; + mProcVar3.field_0x300e.y = 1; dComIfGp_setPlayerStatus0(0, 0x2000000); return 1; } @@ -711,8 +711,8 @@ int daAlink_c::procLadderUpEnd() { !checkNextAction(1)) { if (frame_ctrl->getFrame() >= lit_15341) { - field_0x300c = 0; - field_0x300e.y = 0; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.y = 0; } else if (frame_ctrl->getFrame() >= lit_17382) { field_0x30a0 = 0; field_0x33f4 = FLOAT_LABEL(lit_6108); @@ -749,8 +749,8 @@ int daAlink_c::procLadderDownStart() { changeLadderMoveProc(0); } } else if (frame_ctrl->getFrame() >= lit_10286) { - field_0x300c = 1; - field_0x300e.y = 1; + mProcVar2.field_0x300c = 1; + mProcVar3.field_0x300e.y = 1; } return 1; @@ -769,8 +769,8 @@ int daAlink_c::procLadderDownEndInit(int param_0) { field_0x30a0 = 0x2800; field_0x33f4 = lit_6040; - field_0x300c = 0; - field_0x300e.y = 0; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.y = 0; dComIfGp_setPlayerStatus0(0, 0x2000000); return 1; } @@ -1211,7 +1211,7 @@ int daAlink_c::procRoofHangStartInit(cBgS_PolyInfo const& param_0, cXyz const& p mNormalSpeed = tmp_0; speed.y = tmp_0; field_0x2f99 = 0x50; - field_0x3008 = param_2; + mProcVar0.field_0x3008 = param_2; return 1; } @@ -1222,11 +1222,11 @@ int daAlink_c::procRoofHangStart() { } if (field_0x33a8 < lit_13700) { - field_0x3008 = 0; + mProcVar0.field_0x3008 = 0; } daPy_frameCtrl_c* frame_ctrl = mUnderFrameCtrl; - if (field_0x3008 == 0 && + if (mProcVar0.field_0x3008 == 0 && (checkAnmEnd(frame_ctrl) || (checkInputOnR() && frame_ctrl->getFrame() > daAlinkHIO_roofHang_c0::m.field_0x0.mCheckFrame))) @@ -1257,10 +1257,10 @@ int daAlink_c::procRoofHangWait() { } if (field_0x33a8 < lit_13700) { - field_0x3008 = 0; + mProcVar0.field_0x3008 = 0; } - if (field_0x3008 == 0) { + if (mProcVar0.field_0x3008 == 0) { checkNextActionRoofHang(); } @@ -1348,17 +1348,17 @@ int daAlink_c::procRoofHangTurnInit() { f32 anm_speed; if ((s16)(field_0x2fe2 - shape_angle.y) < 0) { anm_speed = -daAlinkHIO_roofHang_c0::m.field_0x44; - field_0x3008 = 1; + mProcVar0.field_0x3008 = 1; shape_angle.y += 0x8000; setOldRootQuaternion(0, -0x8000, 0); field_0x2060->getOldFrameTransInfo(0)->mTranslate.z = lit_26275; - field_0x300c = field_0x2fe2; + mProcVar2.field_0x300c = field_0x2fe2; field_0x3478 = FLOAT_LABEL(lit_6108); field_0x347c = lit_7625; } else { anm_speed = daAlinkHIO_roofHang_c0::m.field_0x44; - field_0x3008 = 0; - field_0x300c = field_0x2fe2 + 0x8000; + mProcVar0.field_0x3008 = 0; + mProcVar2.field_0x300c = field_0x2fe2 + 0x8000; field_0x3478 = lit_7625; field_0x347c = lit_26276; } @@ -1366,7 +1366,7 @@ int daAlink_c::procRoofHangTurnInit() { current.angle.y = shape_angle.y; setSingleAnimeBaseSpeed(ANM_ROOF_HANG_TURN, anm_speed, daAlinkHIO_roofHang_c0::m.field_0x48); - if (field_0x3008 != 0) { + if (mProcVar0.field_0x3008 != 0) { setFaceBasicTexture(FTANM_UNK_4); } else { setFaceBasicTexture(FTANM_UNK_3); @@ -1389,7 +1389,7 @@ int daAlink_c::procRoofHangTurn() { daPy_frameCtrl_c* frame_ctrl = mUnderFrameCtrl; if (checkAnmEnd(frame_ctrl)) { - if (field_0x3008 == 0) { + if (mProcVar0.field_0x3008 == 0) { shape_angle.y += 0x8000; current.angle.y = shape_angle.y; setOldRootQuaternion(0, -0x8000, 0); @@ -1399,7 +1399,7 @@ int daAlink_c::procRoofHangTurn() { checkNextActionRoofHang(); } else { if (frame_ctrl->getFrame() >= field_0x3478 && frame_ctrl->getFrame() <= field_0x347c) { - cLib_addCalcAngleS(&shape_angle.y, field_0x300c, 3, 0x200, 0x100); + cLib_addCalcAngleS(&shape_angle.y, mProcVar2.field_0x300c, 3, 0x200, 0x100); current.angle.y = shape_angle.y; } @@ -1441,7 +1441,7 @@ int daAlink_c::procRoofSwitchHangInit(fopAc_ac_c* param_0) { setOldRootQuaternion(0, current.angle.y - shape_angle.y, 0); shape_angle.y = current.angle.y; field_0x2f99 = 0x50; - field_0x300c = 0; + mProcVar2.field_0x300c = 0; return 1; } @@ -1456,8 +1456,8 @@ int daAlink_c::procRoofSwitchHang() { if (checkAnmEnd(mUnderFrameCtrl)) { setSingleAnimeBaseSpeed(ANM_ROOF_HANG_WAIT, daAlinkHIO_roofHang_c0::m.field_0x1C, daAlinkHIO_roofHang_c0::m.field_0x20); - field_0x300c = 1; - } else if (field_0x300c != 0) { + mProcVar2.field_0x300c = 1; + } else if (mProcVar2.field_0x300c != 0) { setDoStatus(0x33); if (doTrigger()) { diff --git a/src/d/a/d_a_alink_hook.inc b/src/d/a/d_a_alink_hook.inc index d19df6d0054..fb0ce5bf246 100644 --- a/src/d/a/d_a_alink_hook.inc +++ b/src/d/a/d_a_alink_hook.inc @@ -360,7 +360,7 @@ void daAlink_c::cancelHookshotShot() { } /* 80108F64-8010903C 1038A4 00D8+00 4/4 0/0 0/0 .text cancelHookshotMove__9daAlink_cFv */ -// checkAttentionLock has weird codegen +// matches with literals #ifdef NONMATCHING bool daAlink_c::cancelHookshotMove() { if (mFastShotTime == 0 && mItemMode == HS_MODE_NONE_e) { @@ -441,8 +441,6 @@ void daAlink_c::initHookshotReady() { /* 801091E4-80109284 103B24 00A0+00 1/1 0/0 0/0 .text setHookshotReadyAnime__9daAlink_cFv */ -#pragma push -#pragma optimization_level 2 void daAlink_c::setHookshotReadyAnime() { f32 speed; if (!i_checkAttentionLock() && mFastShotTime == 0) { @@ -455,12 +453,9 @@ void daAlink_c::setHookshotReadyAnime() { field_0x3020 = 0; initHookshotReady(); } -#pragma pop /* 80109284-801095C8 103BC4 0344+00 3/3 0/0 0/0 .text checkUpperItemActionHookshot__9daAlink_cFv */ -// checkAttentionLock -#ifdef NONMATCHING int daAlink_c::checkUpperItemActionHookshot() { if (checkHookshotWait()) { mSearchBallScale = FLT_MAX; @@ -554,20 +549,8 @@ int daAlink_c::checkUpperItemActionHookshot() { return cancelUpperItemReadyAnime(0); } -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::checkUpperItemActionHookshot() { - nofralloc -#include "asm/d/a/d_a_alink/checkUpperItemActionHookshot__9daAlink_cFv.s" -} -#pragma pop -#endif /* 801095C8-801097A0 103F08 01D8+00 7/7 0/0 0/0 .text checkNextActionHookshot__9daAlink_cFv */ -// matches with a i_checkAttentionLock fix -#ifdef NONMATCHING int daAlink_c::checkNextActionHookshot() { if (mProcID == PROC_HOOKSHOT_ROOF_SHOOT || mProcID == PROC_HOOKSHOT_WALL_SHOOT) { return 0; @@ -610,16 +593,6 @@ int daAlink_c::checkNextActionHookshot() { return procHookshotMoveInit(); } } -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::checkNextActionHookshot() { - nofralloc -#include "asm/d/a/d_a_alink/checkNextActionHookshot__9daAlink_cFv.s" -} -#pragma pop -#endif /* 801097A0-80109890 1040E0 00F0+00 2/2 0/0 0/0 .text setHookshotReturnEnd__9daAlink_cFv */ @@ -830,13 +803,13 @@ void daAlink_c::setHookshotPos() { if (checkHookshotWait() || mItemMode == 2) { csXyz* var_r28; if (mProcID == PROC_HOOKSHOT_WALL_SHOOT || mProcID == PROC_HOOKSHOT_ROOF_SHOOT) { - var_r28 = &field_0x300e; + var_r28 = &mProcVar3.field_0x300e; } else { var_r28 = &mBodyAngle; } if (mProcID == PROC_HOOKSHOT_WALL_SHOOT) { - field_0x301e = field_0x300e.y; + field_0x301e = mProcVar3.field_0x300e.y; } else { field_0x301e = (s16)(shape_angle.y + mBodyAngle.y); } @@ -1223,13 +1196,13 @@ void daAlink_c::initHookshotRoofWaitActor(fopAc_ac_c* i_actor) { mDoMtx_stack_c::XrotS(-i_actor->shape_angle.x); mDoMtx_stack_c::YrotM(-i_actor->shape_angle.y); mDoMtx_stack_c::multVecSR(&field_0x37c8, &field_0x37c8); - field_0x3008 = i_actor->shape_angle.y; + mProcVar0.field_0x3008 = i_actor->shape_angle.y; fopAcM_setHookCarryNow(i_actor); - field_0x300e.y = 1; + mProcVar3.field_0x300e.y = 1; } else { mCargoCarryAcKeep.clearData(); - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; } } @@ -1286,7 +1259,7 @@ int daAlink_c::checkLandHookshotHang() { /* 8010B96C-8010BA6C 1062AC 0100+00 3/3 0/0 0/0 .text commonHookshotRoofWait__9daAlink_cFv */ int daAlink_c::commonHookshotRoofWait() { setJumpMode(); - if (field_0x300e.y != 0) { + if (mProcVar3.field_0x300e.y != 0) { mCargoCarryAcKeep.setActor(); fopAc_ac_c* carryAc_p = mCargoCarryAcKeep.getActor(); @@ -1460,11 +1433,11 @@ int daAlink_c::procHookshotFlyInit() { shape_angle.y = field_0x301e; current.angle.y = shape_angle.y; - field_0x3008 = 1; - field_0x300a = 4; + mProcVar0.field_0x3008 = 1; + mProcVar1.field_0x300a = 4; field_0x2f99 = 0x50; - field_0x300c = mItemMode; - field_0x300e.z = 0; + mProcVar2.field_0x300c = mItemMode; + mProcVar3.field_0x300e.z = 0; procHookshotFly(); return 1; @@ -1506,29 +1479,29 @@ int daAlink_c::procHookshotFly() { setHookshotTopPosFly(); field_0x37d4 = mHookshotTopPos - mHeldItemRootPos; - if (field_0x3008 != 0 && cLib_distanceAngleS(field_0x37d4.atan2sX_Z(), temp_r24) > 0x4000) { + if (mProcVar0.field_0x3008 != 0 && cLib_distanceAngleS(field_0x37d4.atan2sX_Z(), temp_r24) > 0x4000) { setHookshotReturnEnd(); } else { - field_0x3008 = 0; + mProcVar0.field_0x3008 = 0; f32 temp_f31 = field_0x37d4.abs(); f32 temp_f30 = daAlinkHIO_hookshot_c0::m.mStickReturnSpeed + spAC.abs(mHookshotTopPos); - if (temp_f31 < temp_f30 || field_0x300a == 0) { + if (temp_f31 < temp_f30 || mProcVar1.field_0x300a == 0) { setHookshotReturnEnd(); } else { field_0x37d4 *= temp_f30 / temp_f31; seStartOnlyReverbLevel(Z2SE_LK_HS_WIND_UP); if (temp_f31 < temp_f30 * 1.5f) { - field_0x300a--; + mProcVar1.field_0x300a--; } } } current.pos += field_0x37d4; if (checkSetItemTrigger(W_HOOKSHOT) != 0) { - field_0x300e.z = 1; - } else if (field_0x300e.z != 0 && !itemButton()) { - field_0x300e.z = 0; + mProcVar3.field_0x300e.z = 1; + } else if (mProcVar3.field_0x300e.z != 0 && !itemButton()) { + mProcVar3.field_0x300e.z = 0; } if (mItemMode != 5 && mItemMode != HS_MODE_FLY_e) { @@ -1543,7 +1516,7 @@ int daAlink_c::procHookshotFly() { BOOL var_r27 = 0; BOOL force_fall = checkStageName("D_MN10") && fopAcM_GetRoomNo(this) == 4; - if (field_0x300c == 4 && dComIfG_Bgsp().ChkPolySafe(mPolyInfo2)) { + if (mProcVar2.field_0x300c == 4 && dComIfG_Bgsp().ChkPolySafe(mPolyInfo2)) { var_r28 = dComIfG_Bgsp().GetTriPla(mPolyInfo2, &poly); var_r27 = cBgW_CheckBRoof(poly.mNormal.y); if (!checkHookshotStickBG(mPolyInfo2)) { @@ -1589,7 +1562,7 @@ int daAlink_c::procHookshotFly() { procFallInit(1, 5.0f); field_0x2f99 = 0x70; } else if (targetAc_name == PROC_E_PH || targetAc_name == PROC_B_DR || var_r29) { - procHookshotRoofWaitInit(1, targetAc_p, field_0x300e.z); + procHookshotRoofWaitInit(1, targetAc_p, mProcVar3.field_0x300e.z); } else if (var_r28 && dComIfG_Bgsp().GetMonkeyBarsCode(mPolyInfo2)) { cXyz sp88; mDoMtx_stack_c::ZXYrotS(field_0x301c, field_0x301e, 0); @@ -1598,9 +1571,9 @@ int daAlink_c::procHookshotFly() { procRoofHangStartInit(mPolyInfo2, sp88, 0); } else if (var_r28 && var_r27) { - procHookshotRoofWaitInit(1, NULL, field_0x300e.z); + procHookshotRoofWaitInit(1, NULL, mProcVar3.field_0x300e.z); } else if (var_r28 && field_0x2f91 != 3 && fabsf(poly.mNormal.y) < 0.05f) { - procHookshotWallWaitInit(1, poly.mNormal.atan2sX_Z(), field_0x300e.z); + procHookshotWallWaitInit(1, poly.mNormal.atan2sX_Z(), mProcVar3.field_0x300e.z); } else { procFallInit(1, 5.0f); field_0x2f99 = 0x70; @@ -1659,11 +1632,11 @@ int daAlink_c::procHookshotRoofWaitInit(int param_0, fopAc_ac_c* param_1, int pa anm = ANM_HOOKSHOT_HANG_END_RIGHT; } - field_0x300c = 0; + mProcVar2.field_0x300c = 0; setSingleAnimeParam(anm, &daAlinkHIO_hookshot_c0::m.mRoofHangAnm); } else { setHookshotRoofWaitAnime(); - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } resetHookshotMode(); @@ -1679,7 +1652,7 @@ int daAlink_c::procHookshotRoofWaitInit(int param_0, fopAc_ac_c* param_1, int pa } field_0x2b98 = 6.5f; - field_0x300e.z = param_2; + mProcVar3.field_0x300e.z = param_2; dComIfGp_setPlayerStatus1(0, 0x10000); field_0x814.SetWeight(255); @@ -1735,23 +1708,23 @@ int daAlink_c::procHookshotRoofWait() { setShapeAngleToAtnActor(0); - if (field_0x300c == 0) { + if (mProcVar2.field_0x300c == 0) { if (checkSetItemTrigger(W_HOOKSHOT)) { - field_0x300e.z = 1; - } else if (field_0x300e.z != 0 && !itemButton()) { - field_0x300e.z = 0; + mProcVar3.field_0x300e.z = 1; + } else if (mProcVar3.field_0x300e.z != 0 && !itemButton()) { + mProcVar3.field_0x300e.z = 0; } daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; if (frameCtrl_p->checkAnmEnd() || - ((checkInputOnR() || field_0x300e.z != 0 || checkHookshotRoofLv7Boss()) && + ((checkInputOnR() || mProcVar3.field_0x300e.z != 0 || checkHookshotRoofLv7Boss()) && frameCtrl_p->getFrame() > daAlinkHIO_hookshot_c0::m.mRoofHangAnm.mCheckFrame)) { setHookshotRoofWaitAnime(); - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } } else if (!checkHookshotRoofLv7Boss()) { - if (checkSetItemTrigger(W_HOOKSHOT) || field_0x300e.z != 0) { + if (checkSetItemTrigger(W_HOOKSHOT) || mProcVar3.field_0x300e.z != 0) { return procHookshotRoofShootInit(mCargoCarryAcKeep.getActor()); } hookshotRoofTurn(); @@ -1798,8 +1771,8 @@ int daAlink_c::procHookshotRoofShootInit(fopAc_ac_c* param_0) { dComIfGp_setPlayerStatus0(0, 0x4000); field_0x814.SetWeight(255); - field_0x300c = 0; - field_0x300e.x = mBodyAngle.x; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.x = mBodyAngle.x; return 1; } #else @@ -1815,7 +1788,7 @@ asm int daAlink_c::procHookshotRoofShootInit(fopAc_ac_c* param_0) { /* 8010CD60-8010CF6C 1076A0 020C+00 1/0 0/0 0/0 .text procHookshotRoofShoot__9daAlink_cFv */ -// matches with a i_checkAttentionLock fix +// matches with literals #ifdef NONMATCHING int daAlink_c::procHookshotRoofShoot() { if (checkHookshotWait()) { @@ -1838,7 +1811,7 @@ int daAlink_c::procHookshotRoofShoot() { } if (!checkUpperItemActionHookshot()) { - mBodyAngle.x = field_0x300e.x; + mBodyAngle.x = mProcVar3.field_0x300e.x; if (!i_checkAttentionLock() && mFastShotTime == 0) { if (checkHookshotWait()) { @@ -1846,14 +1819,14 @@ int daAlink_c::procHookshotRoofShoot() { mUnderFrameCtrl[0].setFrame(0.0f); getNowAnmPackUnder(UNDER_0)->setFrame(0.0f); - if (field_0x300c != 0 && setBodyAngleToCamera()) { + if (mProcVar2.field_0x300c != 0 && setBodyAngleToCamera()) { setHookshotSight(); } } else { dComIfGp_setPlayerStatus0(0, 0x40000); } - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } else { if (mTargetedActor == NULL && mItemMode == HS_MODE_NONE_e) { return procHookshotRoofWaitInit(0, mCargoCarryAcKeep.getActor(), 0); @@ -1862,7 +1835,7 @@ int daAlink_c::procHookshotRoofShoot() { if (checkHookshotWait()) { mUnderFrameCtrl[0].setRate(1.0f); - if (field_0x300c == 0) { + if (mProcVar2.field_0x300c == 0) { setBodyAngleXReadyAnime(0); hookshotRoofTurn(); } else { @@ -1870,10 +1843,10 @@ int daAlink_c::procHookshotRoofShoot() { } } - field_0x300c = 0; + mProcVar2.field_0x300c = 0; } - field_0x300e.x = mBodyAngle.x; + mProcVar3.field_0x300e.x = mBodyAngle.x; mBodyAngle.x = 0; } @@ -2001,11 +1974,11 @@ int daAlink_c::procHookshotWallWaitInit(int param_0, s16 param_1, int param_2) { anm = ANM_HOOKSHOT_WALL_END_RIGHT; } - field_0x300c = 0; + mProcVar2.field_0x300c = 0; setSingleAnimeParam(anm, &daAlinkHIO_hookshot_c0::m.mWallHangAnm); } else { setHookshotWallWaitAnime(); - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } dComIfGp_setPlayerStatus1(0, 0x2000000); @@ -2020,7 +1993,7 @@ int daAlink_c::procHookshotWallWaitInit(int param_0, s16 param_1, int param_2) { setHookshotHangMoveBGCollect(); } - field_0x300e.z = param_2; + mProcVar3.field_0x300e.z = param_2; return 1; } #else @@ -2078,22 +2051,22 @@ int daAlink_c::procHookshotWallWait() { return procFallInit(1, 5.0f); } - if (field_0x300c == 0) { + if (mProcVar2.field_0x300c == 0) { if (checkSetItemTrigger(W_HOOKSHOT)) { - field_0x300e.z = 1; - } else if (field_0x300e.z != 0 && !itemButton()) { - field_0x300e.z = 0; + mProcVar3.field_0x300e.z = 1; + } else if (mProcVar3.field_0x300e.z != 0 && !itemButton()) { + mProcVar3.field_0x300e.z = 0; } daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; if (frameCtrl_p->checkAnmEnd() || - ((checkInputOnR() || field_0x300e.z != 0) && + ((checkInputOnR() || mProcVar3.field_0x300e.z != 0) && frameCtrl_p->getFrame() > daAlinkHIO_hookshot_c0::m.mWallHangAnm.mCheckFrame)) { setHookshotWallWaitAnime(); - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } - } else if (checkSetItemTrigger(W_HOOKSHOT) || field_0x300e.z != 0) { + } else if (checkSetItemTrigger(W_HOOKSHOT) || mProcVar3.field_0x300e.z != 0) { return procHookshotWallShootInit(); } @@ -2133,10 +2106,10 @@ int daAlink_c::procHookshotWallShootInit() { initHookshotReady(); dComIfGp_setPlayerStatus0(0, 0x4000); - field_0x300c = 0; - field_0x300e.x = mBodyAngle.x; - field_0x300e.y = shape_angle.y; - field_0x310c = field_0x300e.y; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.x = mBodyAngle.x; + mProcVar3.field_0x300e.y = shape_angle.y; + field_0x310c = mProcVar3.field_0x300e.y; setHookshotReadyMaterial(); return 1; } @@ -2153,7 +2126,7 @@ asm int daAlink_c::procHookshotWallShootInit() { /* 8010D6CC-8010D93C 10800C 0270+00 1/0 0/0 0/0 .text procHookshotWallShoot__9daAlink_cFv */ -// matches with a i_checkAttentionLock fix +// matches with literals #ifdef NONMATCHING int daAlink_c::procHookshotWallShoot() { if (checkHookshotWait()) { @@ -2174,8 +2147,8 @@ int daAlink_c::procHookshotWallShoot() { BOOL var_r31 = false; if (!checkUpperItemActionHookshot()) { s16 old_angle = shape_angle.y; - mBodyAngle.x = field_0x300e.x; - shape_angle.y = field_0x300e.y; + mBodyAngle.x = mProcVar3.field_0x300e.x; + shape_angle.y = mProcVar3.field_0x300e.y; if (!i_checkAttentionLock() && mFastShotTime == 0) { if (checkHookshotWait()) { @@ -2183,14 +2156,14 @@ int daAlink_c::procHookshotWallShoot() { mUnderFrameCtrl[0].setFrame(0.0f); getNowAnmPackUnder(UNDER_0)->setFrame(0.0f); - if (field_0x300c != 0 && setBodyAngleToCamera()) { + if (mProcVar2.field_0x300c != 0 && setBodyAngleToCamera()) { var_r31 = true; } } else { dComIfGp_setPlayerStatus0(0, 0x40000); } - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } else { if (mTargetedActor == NULL && mItemMode == HS_MODE_NONE_e) { shape_angle.y = old_angle; @@ -2200,7 +2173,7 @@ int daAlink_c::procHookshotWallShoot() { if (checkHookshotWait()) { setWaterInAnmRate(mUnderFrameCtrl, 1.0f); - if (field_0x300c == 0) { + if (mProcVar2.field_0x300c == 0) { setBodyAngleXReadyAnime(0); if (!setShapeAngleToAtnActor(0)) { @@ -2209,7 +2182,7 @@ int daAlink_c::procHookshotWallShoot() { } } - field_0x300c = 0; + mProcVar2.field_0x300c = 0; } if ((s16)(shape_angle.y - old_angle) > 0x4000) { @@ -2222,10 +2195,10 @@ int daAlink_c::procHookshotWallShoot() { setHookshotSight(); } - field_0x300e.x = mBodyAngle.x; + mProcVar3.field_0x300e.x = mBodyAngle.x; mBodyAngle.x = 0; field_0x310c = shape_angle.y; - field_0x300e.y = shape_angle.y; + mProcVar3.field_0x300e.y = shape_angle.y; shape_angle.y = old_angle; } diff --git a/src/d/a/d_a_alink_horse.inc b/src/d/a/d_a_alink_horse.inc index 1932e1403d1..d8fb19c6faa 100644 --- a/src/d/a/d_a_alink_horse.inc +++ b/src/d/a/d_a_alink_horse.inc @@ -473,7 +473,7 @@ int daAlink_c::setSyncBoarRunPos() { shape_angle.z = sp28.x; current.angle.y = shape_angle.y; - if (mProcID == PROC_BOAR_RUN && field_0x300e.x != 0) { + if (mProcID == PROC_BOAR_RUN && mProcVar3.field_0x300e.x != 0) { mUnderFrameCtrl[0].setFrame(e_wb_p->nowAnimeFrame()); getNowAnmPackUnder(UNDER_0)->setFrame(e_wb_p->nowAnimeFrame()); } @@ -1378,7 +1378,7 @@ int daAlink_c::procHorseCutChargeReadyInit() { resetUnderAnime(UNDER_2, lit_6041); } - field_0x300c = daAlinkHIO_cut_c0::m.mNormalSwingDuration; + mProcVar2.field_0x300c = daAlinkHIO_cut_c0::m.mNormalSwingDuration; field_0x3004 = 0; i_onNoResetFlg1(FLG1_UNK_10000000); return 1; @@ -1410,7 +1410,7 @@ int daAlink_c::procHorseCutTurnInit() { setSyncRide(1); field_0x3478 = daAlinkHIO_hoCutCharge_c0::m.field_0x50; setCylAtParam(getSwordAtType(), dCcG_At_Spl_UNK_1, 3, 1, 3, field_0x3478 * 0.5f, 200.0f); - field_0x300e.y = daAlinkHIO_hoCutCharge_c0::m.field_0x3E; + mProcVar3.field_0x300e.y = daAlinkHIO_hoCutCharge_c0::m.field_0x3E; voiceStart(Z2SE_AL_V_KAITEN); setCutWaterDropEffect(); setHorseZeldaDamage(); @@ -1466,7 +1466,7 @@ int daAlink_c::procHorseBowSubjectInit() { setSyncRidePos(); setBaseRideAnime(); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; setBowOrSlingStatus(); return 1; } @@ -1826,12 +1826,12 @@ int daAlink_c::procHorseRunInit() { setSingleAnimeBaseMorf(ANM_HORSE_TAME_WAIT_B, -1.0f); setSyncHorsePos(); field_0x2fab = 0; - field_0x300e.y = 0; - field_0x300e.z = 0; + mProcVar3.field_0x300e.y = 0; + mProcVar3.field_0x300e.z = 0; field_0x3478 = 1000.0f - cM_rndF(500.0f); - field_0x300c = 0; - field_0x300e.x = 30; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.x = 30; field_0x3004 = 0; field_0x3002 = 0; mDoAud_changeSubBgmStatus(2); @@ -1890,7 +1890,7 @@ int daAlink_c::procHorseGetKeyInit() { deleteEquipItem(FALSE, FALSE); setSingleAnimeBase(ANM_KEY_CATCH); setSyncRidePos(); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; return 1; } @@ -1904,7 +1904,7 @@ int daAlink_c::procHorseGetKey() { } else if (frameCtrl_p->getFrame() >= lit_16038) { field_0x2f92 = 254; field_0x2f93 = 254; - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } else if (frameCtrl_p->getFrame() >= lit_7448) { field_0x2f92 = 2; } else if (frameCtrl_p->getFrame() >= lit_7808) { @@ -1949,14 +1949,14 @@ int daAlink_c::procBoarRunInit() { resetUpperAnime(UPPER_2, -1.0f); resetUnderAnime(UNDER_2, -1.0f); - field_0x300e.y = 0; - field_0x300e.z = 0; + mProcVar3.field_0x300e.y = 0; + mProcVar3.field_0x300e.z = 0; field_0x3478 = 3000.0f - cM_rndF(1500.0f); setSingleAnimeBaseSpeed(ANM_HORSE_TAME_WAIT_A_TO_B, 1.0f, 4.0f); - field_0x300e.x = 0; + mProcVar3.field_0x300e.x = 0; setSyncBoarPos(); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; deleteEquipItem(FALSE, FALSE); return 1; } diff --git a/src/d/a/d_a_alink_hvyboots.inc b/src/d/a/d_a_alink_hvyboots.inc index 1ecc3f6ecb9..2a199e227ed 100644 --- a/src/d/a/d_a_alink_hvyboots.inc +++ b/src/d/a/d_a_alink_hvyboots.inc @@ -411,7 +411,7 @@ int daAlink_c::procMagneBootsFlyInit() { field_0x3478 = 0.0f; field_0x594 = daAlinkHIO_magneBoots_c0::m.mMaxMagneFlySpeed; - field_0x300c = 0; + mProcVar2.field_0x300c = 0; voiceStart(Z2SE_AL_V_MAGNET_CAUGHT); return 1; } @@ -461,7 +461,7 @@ int daAlink_c::procMagneBootsFly() { cLib_addCalcAngleS(&shape_angle.x, sp24.atan2sY_XZ() + -0x4000, 5, 0x1000, 0x100); cLib_addCalcAngleS(&shape_angle.y, sp24.atan2sX_Z(), 5, 0x1000, 0x100); - field_0x300c += 0x1C00; + mProcVar2.field_0x300c += 0x1C00; } return 1; diff --git a/src/d/a/d_a_alink_iceleaf.inc b/src/d/a/d_a_alink_iceleaf.inc index e34994a9d44..fd1ef99bab3 100644 --- a/src/d/a/d_a_alink_iceleaf.inc +++ b/src/d/a/d_a_alink_iceleaf.inc @@ -160,9 +160,9 @@ int daAlink_c::procBoardRowInit() { commonProcInit(PROC_BOARD_ROW); setSingleAnimeBaseSpeed(ANM_RIDE_KICK, getBoardRowAnmSpeed(), daAlinkHIO_board_c0::m.mPushInterpolation); i_onResetFlg1(0x40); - field_0x3008 = 4; - field_0x300e.y = 1; - field_0x300e.z = 0; + mProcVar0.field_0x3008 = 4; + mProcVar3.field_0x300e.y = 1; + mProcVar3.field_0x300e.z = 0; return 1; } @@ -182,9 +182,9 @@ int daAlink_c::procBoardTurnInit() { commonProcInit(PROC_BOARD_TURN); setSingleAnime(ANM_RIDE_JUMP, FLOAT_LABEL(lit_6108), lit_6040, daAlinkHIO_board_c0::m.mAirborneAnm.mEndFrame, lit_6109); mNormalSpeed = FLOAT_LABEL(lit_6108); - field_0x300e.y = shape_angle.y + 0x8000; - field_0x300e.z = 0; - field_0x300a = 0; + mProcVar3.field_0x300e.y = shape_angle.y + 0x8000; + mProcVar3.field_0x300e.z = 0; + mProcVar1.field_0x300a = 0; return 1; } @@ -203,8 +203,8 @@ asm int daAlink_c::procBoardTurn() { #ifdef NONMATCHING int daAlink_c::procBoardJumpInit(f32 param_0, int param_1) { commonProcInit(PROC_BOARD_JUMP); - field_0x3008 = 0; - field_0x300e.z = 1; + mProcVar0.field_0x3008 = 0; + mProcVar3.field_0x300e.z = 1; setSingleAnime(ANM_RIDE_JUMP, FLOAT_LABEL(lit_6108), daAlinkHIO_board_c0::m.mAirborneAnm.mStartFrame, @@ -215,7 +215,7 @@ int daAlink_c::procBoardJumpInit(f32 param_0, int param_1) { speed.y = cLib_minMaxLimit(param_0, daAlinkHIO_board_c0::m.mMinJumpSpeedY, daAlinkHIO_board_c0::m.mMaxJumpSpeedY); } - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; seStartOnlyReverb(Z2SE_AL_SNOBO_JUMP); return 1; } @@ -240,12 +240,12 @@ int daAlink_c::procBoardJump() { if (!i_checkModeFlg(2)) { setBoardLandAnime(); procBoardWaitInit(NULL); - } else if (field_0x300e.z != 0 && field_0x300e.y == 0 && field_0x2060->getOldFrameRate() < lit_8782) { + } else if (mProcVar3.field_0x300e.z != 0 && mProcVar3.field_0x300e.y == 0 && field_0x2060->getOldFrameRate() < lit_8782) { setSingleAnime(ANM_RIDE_JUMP, daAlinkHIO_board_c0::m.mAirborneAnm.mSpeed, daAlinkHIO_board_c0::m.mAirborneAnm.mStartFrame, daAlinkHIO_board_c0::m.mAirborneAnm.mEndFrame, lit_6041); - field_0x300e.y = 1; + mProcVar3.field_0x300e.y = 1; } } @@ -298,7 +298,7 @@ int daAlink_c::procBoardCutInit() { setCommonBoardAnime(0); setCutDash(1, var_r31); - field_0x300e.z = 0; + mProcVar3.field_0x300e.z = 0; return 1; } diff --git a/src/d/a/d_a_alink_ironball.inc b/src/d/a/d_a_alink_ironball.inc index 1a59929ce36..6149067abfa 100644 --- a/src/d/a/d_a_alink_ironball.inc +++ b/src/d/a/d_a_alink_ironball.inc @@ -236,8 +236,6 @@ BOOL daAlink_c::checkUpperItemActionIronBall() { } /* 801153F8-801154E4 10FD38 00EC+00 2/2 0/0 0/0 .text checkNextActionIronBall__9daAlink_cFv */ -#pragma push -#pragma optimization_level 2 int daAlink_c::checkNextActionIronBall() { if (mFastShotTime != 0) { mFastShotTime--; @@ -258,7 +256,6 @@ int daAlink_c::checkNextActionIronBall() { return procIronBallMoveInit(); } } -#pragma pop /* 801154E4-80115564 10FE24 0080+00 1/1 0/0 0/0 .text procIronBallSubjectInit__9daAlink_cFv */ int daAlink_c::procIronBallSubjectInit() { @@ -359,7 +356,7 @@ int daAlink_c::procIronBallThrowInit() { field_0x3588 = l_ironBallBaseAnime; mNormalSpeed = FLOAT_LABEL(lit_6108); current.angle.y = shape_angle.y; - field_0x300c = 0; + mProcVar2.field_0x300c = 0; field_0x3018 = 3; field_0x3024 = 0; field_0x3026 = 0; @@ -385,13 +382,13 @@ int daAlink_c::procIronBallReturnInit() { commonProcInit(PROC_IRON_BALL_RETURN); if (field_0x3018 == 8) { - field_0x300c = 1; + mProcVar2.field_0x300c = 1; setSingleAnimeParam(ANM_IRONBALL_CATCH, &daAlinkHIO_ironBall_c0::m.mCatchAnm); field_0x2f99 = 12; } else { setSingleAnimeBaseSpeed(ANM_IRONBALL_PULL, daAlinkHIO_ironBall_c0::m.mPullAnmSpeed, daAlinkHIO_ironBall_c0::m.mPullInterpolation); field_0x2f99 = 12; - field_0x300c = 0; + mProcVar2.field_0x300c = 0; } field_0x3588 = l_ironBallBaseAnime; @@ -408,8 +405,8 @@ int daAlink_c::procIronBallReturn() { field_0x2f99 = 4; - if (field_0x3018 == 8 && field_0x300c == 0) { - field_0x300c = 1; + if (field_0x3018 == 8 && mProcVar2.field_0x300c == 0) { + mProcVar2.field_0x300c = 1; setSingleAnimeParam(ANM_IRONBALL_CATCH, &daAlinkHIO_ironBall_c0::m.mCatchAnm); field_0x2f99 = 12; seStartOnlyReverb(Z2SE_AL_IB_CATCH); diff --git a/src/d/a/d_a_alink_kandelaar.inc b/src/d/a/d_a_alink_kandelaar.inc index 903e08b6913..18cb8e66d59 100644 --- a/src/d/a/d_a_alink_kandelaar.inc +++ b/src/d/a/d_a_alink_kandelaar.inc @@ -30,14 +30,14 @@ static fopAc_ac_c* daAlink_searchTagKtOnFire(fopAc_ac_c* i_actor, void* param_1) /* 801106E8-8011078C 10B028 00A4+00 1/0 0/0 0/0 .text setKandelaarMtx__9daAlink_cFPA4_fii */ void daAlink_c::setKandelaarMtx(Mtx i_mtx, int param_1, int param_2) { - if (field_0x06fc != NULL) { + if (mpKanteraModel != NULL) { if (i_checkNoResetFlg2(FLG2_UNK_1)) { deleteEquipItem(0, 1); } i_onEndResetFlg1(ERFLG1_UNK_4); - field_0x06fc->i_setBaseTRMtx(i_mtx); + mpKanteraModel->i_setBaseTRMtx(i_mtx); if (param_1 == 0) { i_onEndResetFlg1(ERFLG1_UNK_8); } @@ -163,7 +163,7 @@ asm void daAlink_c::setKandelaarModel() { void daAlink_c::resetOilBottleModel() { deleteEquipItem(0, 1); - if (field_0x300e.x != 0) { + if (mProcVar3.field_0x300e.x != 0) { setKandelaarModel(); mEquipItem = KANTERA; } diff --git a/src/d/a/d_a_alink_link.inc b/src/d/a/d_a_alink_link.inc index 3b6e8ca5635..26965e921eb 100644 --- a/src/d/a/d_a_alink_link.inc +++ b/src/d/a/d_a_alink_link.inc @@ -14,21 +14,21 @@ int daAlink_c::procPreActionUnequipInit(int i_procAfter, fopAc_ac_c* param_1) { mNormalSpeed = FLOAT_LABEL(lit_6108); setBlendMoveAnime(daAlinkHIO_basic_c0::m.mAnmBlendFactor); allUnequip(0); - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; if (param_1 != NULL) { field_0x280c.setData(param_1); - field_0x300e.x = 1; + mProcVar3.field_0x300e.x = 1; if (fopAcM_GetName(param_1) == PROC_Tag_Lv8Gate) { if (mEquipItem == KANTERA) { - field_0x300e.y = 1; + mProcVar3.field_0x300e.y = 1; } else if (i_checkNoResetFlg2(FLG2_UNK_1)) { offKandelaarModel(); } } } else { - field_0x300e.x = 0; + mProcVar3.field_0x300e.x = 0; } field_0x3198 = i_procAfter; @@ -39,7 +39,7 @@ int daAlink_c::procPreActionUnequipInit(int i_procAfter, fopAc_ac_c* param_1) { */ int daAlink_c::procPreActionUnequip() { if (checkNoUpperAnime()) { - if (field_0x300e.x != 0 && (field_0x27f4 == NULL || field_0x27f4 != field_0x280c.getActor())) + if (mProcVar3.field_0x300e.x != 0 && (field_0x27f4 == NULL || field_0x27f4 != field_0x280c.getActor())) { checkWaitAction(); } else if (field_0x3198 == PROC_PUSH_PULL_WAIT) { @@ -384,7 +384,7 @@ int daAlink_c::procWaitTurnInit() { mNormalSpeed = FLOAT_LABEL(lit_6108); } - field_0x300e.x = field_0x2fe2; + mProcVar3.field_0x300e.x = field_0x2fe2; current.angle.y = shape_angle.y; return 1; } @@ -398,7 +398,7 @@ int daAlink_c::procWaitTurn() { } else if (i_checkEndResetFlg0(ERFLG0_UNK_100000)) { return procFloorDownReboundInit(); } else { - s16 angle = cLib_addCalcAngleS(&shape_angle.y, field_0x300e.x, 30, 0x3CDF, 8000); + s16 angle = cLib_addCalcAngleS(&shape_angle.y, mProcVar3.field_0x300e.x, 30, 0x3CDF, 8000); current.angle.y = shape_angle.y; if (checkNextActionFromButton()) { @@ -429,26 +429,26 @@ int daAlink_c::procMoveTurnInit(int param_0) { dComIfGp_setPlayerStatus0(0, 0x800); if (param_0 != 0) { - field_0x300e.x = (daAlinkHIO_move_c0::m.mMaxTurnAngle * 4) + 19030; - field_0x300e.y = daAlinkHIO_move_c0::m.mMaxTurnAngle * 2; - field_0x300a = 2; + mProcVar3.field_0x300e.x = (daAlinkHIO_move_c0::m.mMaxTurnAngle * 4) + 19030; + mProcVar3.field_0x300e.y = daAlinkHIO_move_c0::m.mMaxTurnAngle * 2; + mProcVar1.field_0x300a = 2; current.angle.y = field_0x2fe2; mNormalSpeed *= lit_5943; } else { - field_0x300e.x = daAlinkHIO_move_c0::m.mMaxTurnAngle * 2; - field_0x300e.y = daAlinkHIO_move_c0::m.mMaxTurnAngle; - field_0x300a = 3; + mProcVar3.field_0x300e.x = daAlinkHIO_move_c0::m.mMaxTurnAngle * 2; + mProcVar3.field_0x300e.y = daAlinkHIO_move_c0::m.mMaxTurnAngle; + mProcVar1.field_0x300a = 3; } - field_0x300e.x = daAlinkHIO_move_c0::m.mMaxTurnAngle * 2; - field_0x300e.y = daAlinkHIO_move_c0::m.mMaxTurnAngle; + mProcVar3.field_0x300e.x = daAlinkHIO_move_c0::m.mMaxTurnAngle * 2; + mProcVar3.field_0x300e.y = daAlinkHIO_move_c0::m.mMaxTurnAngle; return 1; } /* 800C3D38-800C3DA0 0BE678 0068+00 1/0 0/0 0/0 .text procMoveTurn__9daAlink_cFv */ int daAlink_c::procMoveTurn() { setSpeedAndAngleNormal(); - cLib_addCalcAngleS(&shape_angle.y, current.angle.y, field_0x300a, field_0x300e.x, field_0x300e.y); + cLib_addCalcAngleS(&shape_angle.y, current.angle.y, mProcVar1.field_0x300a, mProcVar3.field_0x300e.x, mProcVar3.field_0x300e.y); if (!checkNextAction(0)) { setBlendMoveAnime(lit_6041); @@ -473,7 +473,7 @@ int daAlink_c::procSideStepInit(int jump_type) { setSingleAnimeParam(ANM_BACK_JUMP, &daAlinkHIO_sideStep_c0::m.mBackJumpAnm); mNormalSpeed = daAlinkHIO_sideStep_c0::m.mBackJumpSpeedH; speed.y = daAlinkHIO_sideStep_c0::m.mBackJumpSpeedV; - field_0x300a = 0; + mProcVar1.field_0x300a = 0; } else { daAlink_ANM anm_id; if (field_0x2f98 == 2) { @@ -487,7 +487,7 @@ int daAlink_c::procSideStepInit(int jump_type) { setSingleAnimeParam(anm_id, &daAlinkHIO_sideStep_c0::m.mSideJumpAnm); mNormalSpeed = daAlinkHIO_sideStep_c0::m.mSideJumpSpeedH; speed.y = daAlinkHIO_sideStep_c0::m.mSideJumpSpeedV; - field_0x300a = 1; + mProcVar1.field_0x300a = 1; } if (i_checkNoResetFlg0(FLG0_UNDERWATER)) { @@ -496,14 +496,14 @@ int daAlink_c::procSideStepInit(int jump_type) { } voiceStart(Z2SE_AL_V_JUMP_S); - field_0x300c = 0; - field_0x300e.x = 0; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.x = 0; return 1; } /* 800C3F60-800C40F0 0BE8A0 0190+00 1/0 0/0 0/0 .text procSideStep__9daAlink_cFv */ int daAlink_c::procSideStep() { - if (mTargetedActor != NULL && field_0x300a != 0) { + if (mTargetedActor != NULL && mProcVar1.field_0x300a != 0) { s16 actor_angle = fopAcM_searchActorAngleY(this, mTargetedActor); cLib_addCalcAngleS(&shape_angle.y, actor_angle, 5, 0x5E8, 0x13C); @@ -514,14 +514,14 @@ int daAlink_c::procSideStep() { } } - if (doTrigger() && field_0x300a != 0) { - field_0x300c = 1; + if (doTrigger() && mProcVar1.field_0x300a != 0) { + mProcVar2.field_0x300c = 1; } if (checkUpperItemActionFly()) { return 1; - } else if (mLinkAcch.ChkGroundHit() && field_0x300e.x != 0) { - if (field_0x300c != 0 && checkSideRollAction(field_0x2f98)) { + } else if (mLinkAcch.ChkGroundHit() && mProcVar3.field_0x300e.x != 0) { + if (mProcVar2.field_0x300c != 0 && checkSideRollAction(field_0x2f98)) { return 1; } else { return procSideStepLandInit(); @@ -534,7 +534,7 @@ int daAlink_c::procSideStep() { return procFallInit(2, daAlinkHIO_sideStep_c0::m.mFallInterpolation); } - field_0x300e.x = 1; + mProcVar3.field_0x300e.x = 1; checkItemChangeFromButton(); return 1; } @@ -549,7 +549,7 @@ int daAlink_c::procSideStepLandInit() { setSingleAnimeParam(ANM_BACK_JUMP_LAND, &daAlinkHIO_sideStep_c0::m.mBackLandAnm); field_0x3478 = daAlinkHIO_sideStep_c0::m.mBackLandAnm.mCheckFrame; field_0x2f98 = 2; - field_0x300a = 0; + mProcVar1.field_0x300a = 0; field_0x2fb0 = 0; field_0x2fcc = 10; } else { @@ -565,7 +565,7 @@ int daAlink_c::procSideStepLandInit() { setSingleAnimeParam(anm_id, &daAlinkHIO_sideStep_c0::m.mSideLandAnm); field_0x3478 = daAlinkHIO_sideStep_c0::m.mSideLandAnm.mCheckFrame; - field_0x300a = 1; + mProcVar1.field_0x300a = 1; field_0x2fb0 = 8; field_0x2fcc = 0; @@ -579,7 +579,7 @@ int daAlink_c::procSideStepLandInit() { setFootEffectProcType(2); i_onResetFlg1(0x30); mNormalSpeed = FLOAT_LABEL(lit_6108); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; current.angle.y = shape_angle.y; setStepLandVibration(); return 1; @@ -594,8 +594,8 @@ int daAlink_c::procSideStepLand() { field_0x2fcc = 10; } - if (doTrigger() && field_0x300a != 0) { - field_0x300c = 1; + if (doTrigger() && mProcVar1.field_0x300a != 0) { + mProcVar2.field_0x300c = 1; } if (frameCtrl_p->checkAnmEnd()) { @@ -605,7 +605,7 @@ int daAlink_c::procSideStepLand() { checkNextAction(0); } } else if (frameCtrl_p->getFrame() > field_0x3478) { - if (field_0x300c != 0 && checkSideRollAction(field_0x2f98)) { + if (mProcVar2.field_0x300c != 0 && checkSideRollAction(field_0x2f98)) { return 1; } checkNextAction(1); @@ -623,12 +623,12 @@ int daAlink_c::procSlideInit(s16 param_0) { current.angle.y = param_0; if (getMoveBGActorName(mLinkAcch.m_gnd, 0) == PROC_Obj_Lv3R10Saka) { - field_0x300e.x = 1; + mProcVar3.field_0x300e.x = 1; } else { - field_0x300e.x = 0; + mProcVar3.field_0x300e.x = 0; } - if (cLib_distanceAngleS(param_0, shape_angle.y) < 0x3800 || field_0x300e.x != 0) { + if (cLib_distanceAngleS(param_0, shape_angle.y) < 0x3800 || mProcVar3.field_0x300e.x != 0) { field_0x3198 = 1; setSingleAnimeParam(ANM_SLIDE_FORWARD, &daAlinkHIO_slide_c0::m.mForwardSlideAnm); dComIfGp_setPlayerStatus1(0, 0x100); @@ -650,8 +650,8 @@ int daAlink_c::procSlideInit(s16 param_0) { field_0x594 = daAlinkHIO_slide_c0::m.mMaxSpeed; field_0x33cc = FLOAT_LABEL(lit_6108); - field_0x300c = 0; - field_0x300e.y = 0; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.y = 0; return 1; } @@ -671,14 +671,14 @@ int daAlink_c::procSlide() { f32 sin = field_0x33a8 * cM_ssin(field_0x2fe2 - shape_angle.y); if (checkInputOnR()) { - field_0x300c = - cLib_minMaxLimit((s16)(field_0x300c + sin * 256.0f), (s16)-0x1000, (s16)0x1000); + mProcVar2.field_0x300c = + cLib_minMaxLimit((s16)(mProcVar2.field_0x300c + sin * 256.0f), (s16)-0x1000, (s16)0x1000); } else { - cLib_chaseS(&field_0x300c, 0, 64); + cLib_chaseS(&mProcVar2.field_0x300c, 0, 64); } - angleY += field_0x300c; - cLib_addCalcAngleS(&field_0x300e.y, sin * -4096.0f, 3, 300, 50); + angleY += mProcVar2.field_0x300c; + cLib_addCalcAngleS(&mProcVar3.field_0x300e.y, sin * -4096.0f, 3, 300, 50); } cLib_addCalcAngleS(¤t.angle.y, angleY, 4, 0x1000, 0x400); @@ -818,7 +818,7 @@ int daAlink_c::procFrontRollInit() { current.angle.y = shape_angle.y; voiceStart(Z2SE_AL_V_BACKTEN); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; setFootEffectProcType(0); if (is_guard_anime) { i_onNoResetFlg0(2); @@ -891,7 +891,7 @@ int daAlink_c::procFrontRoll() { onModeFlg(1); } - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { procCutFinishInit(2); } else if (!checkNextAction(1)) { cLib_chaseF(&mNormalSpeed, 0.0f, 2.5f); @@ -927,7 +927,7 @@ int daAlink_c::procFrontRoll() { } if (checkForceSwordSwing()) { - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } if (frameCtrl_p->getFrame() > 16.0f) { @@ -1098,13 +1098,13 @@ int daAlink_c::procSideRollInit(int param_0) { if (guard_anime) { i_onNoResetFlg0(FLG0_UNK_2); } - field_0x300c = 0; + mProcVar2.field_0x300c = 0; return 1; } /* 800C5484-800C5700 0BFDC4 027C+00 1/0 0/0 0/0 .text procSideRoll__9daAlink_cFv */ -// issues with i_checkAttentionLock +// matches with literals #ifdef NONMATCHING int daAlink_c::procSideRoll() { i_onEndResetFlg0(ERFLG0_UNK_8000000); @@ -1119,7 +1119,7 @@ int daAlink_c::procSideRoll() { } } - field_0x300c |= checkCutFinishJumpUp(); + mProcVar2.field_0x300c |= checkCutFinishJumpUp(); daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; cM3dGPla poly; @@ -1142,7 +1142,7 @@ int daAlink_c::procSideRoll() { checkNextAction(0); } - } else if (field_0x300c != 0 && !checkNotJumpSinkLimit() && + } else if (mProcVar2.field_0x300c != 0 && !checkNotJumpSinkLimit() && frameCtrl_p->getFrame() > daAlinkHIO_turnMove_c0::m.mTurnAnm.mCheckFrame) { procCutFinishJumpUpInit(); @@ -1221,9 +1221,9 @@ int daAlink_c::procBackJumpInit(int param_0) { if (horse_ride) { onModeFlg(0x2000); - field_0x3008 = 5; + mProcVar0.field_0x3008 = 5; } else { - field_0x3008 = 0; + mProcVar0.field_0x3008 = 0; } if (ganon_finish) { @@ -1245,8 +1245,8 @@ int daAlink_c::procBackJumpInit(int param_0) { /* 800C5964-800C5A54 0C02A4 00F0+00 1/0 0/0 0/0 .text procBackJump__9daAlink_cFv */ int daAlink_c::procBackJump() { - if (field_0x3008 != 0) { - field_0x3008--; + if (mProcVar0.field_0x3008 != 0) { + mProcVar0.field_0x3008--; } else { offModeFlg(0x2000); } @@ -1289,8 +1289,6 @@ int daAlink_c::procBackJumpLandInit(int i_cutDirection) { } /* 800C5AF0-800C5C28 0C0430 0138+00 1/0 0/0 0/0 .text procBackJumpLand__9daAlink_cFv */ -#pragma push -#pragma optimization_level 2 int daAlink_c::procBackJumpLand() { daPy_frameCtrl_c* frameCtrl = mUnderFrameCtrl; @@ -1319,7 +1317,6 @@ int daAlink_c::procBackJumpLand() { return 1; } -#pragma pop /* 800C5C28-800C5CA4 0C0568 007C+00 1/1 0/0 0/0 .text procSlipInit__9daAlink_cFv */ int daAlink_c::procSlipInit() { @@ -1329,7 +1326,7 @@ int daAlink_c::procSlipInit() { field_0x2f9d = 0x40; setFootEffectProcType(1); - field_0x3008 = 5; + mProcVar0.field_0x3008 = 5; return 1; } @@ -1352,9 +1349,9 @@ int daAlink_c::procSlip() { } else { cXyz sp14; cXyz sp8; - field_0x3008--; + mProcVar0.field_0x3008--; - if (mLinkAcch.ChkWallHit() || (field_0x3174 == 8 && field_0x3008 == 0)) { + if (mLinkAcch.ChkWallHit() || (field_0x3174 == 8 && mProcVar0.field_0x3008 == 0)) { mNormalSpeed = 0.0f; checkNextAction(0); return 1; @@ -1419,12 +1416,12 @@ int daAlink_c::procAutoJumpInit(int param_0) { return 0; } - field_0x3008 = 0; + mProcVar0.field_0x3008 = 0; if (chk_mode_400 || (mDemo.getDemoMode() == 0x18 && mDemo.getParam0() == 1)) { if (chk_mode_400) { onModeFlg(0x2000); - field_0x3008 = 5; + mProcVar0.field_0x3008 = 5; } setSingleAnimeBaseSpeed(ANM_JUMP_LAND, 0.0f, @@ -1500,7 +1497,7 @@ int daAlink_c::procAutoJumpInit(int param_0) { voiceStart(Z2SE_AL_V_JUMP_L); i_offNoResetFlg0(FLG0_UNK_40000); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; i_onResetFlg0(RFLG0_UNK_100); mFallVoiceInit = false; return 1; @@ -1534,8 +1531,8 @@ int daAlink_c::procAutoJump() { cLib_chaseF(&mNormalSpeed, 0.0f, 0.1f); } - if (field_0x3008 != 0) { - field_0x3008--; + if (mProcVar0.field_0x3008 != 0) { + mProcVar0.field_0x3008--; } else { offModeFlg(0x2000); } @@ -1576,7 +1573,7 @@ int daAlink_c::procAutoJump() { field_0x2f99 = 4; } - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { setDoStatus(1); if (doTrigger()) { @@ -1587,7 +1584,7 @@ int daAlink_c::procAutoJump() { if (!checkGrabGlide()) { setSpecialGravity(daAlinkHIO_autoJump_c0::m.mGravity, daAlinkHIO_autoJump_c0::m.mMaxFallSpeed, 1); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; resetUpperAnime(UPPER_1, 3.0f); field_0x30a0 = 0; onModeFlg(4); @@ -1625,13 +1622,13 @@ int daAlink_c::procAutoJump() { } else if (speed.y < -mGravity && field_0x2f99 == 4) { if (checkGrabGlide()) { setSpecialGravity(-1.0f, field_0x3478, 0); - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } setSingleAnimeBaseSpeed(ANM_JUMP_LAND, 0.0f, daAlinkHIO_autoJump_c0::m.mJumpFallInterpolation); - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { setUpperAnime(0x276, UPPER_1, 1.0f, 0.0f, -1, 3.0f); } @@ -1672,7 +1669,7 @@ int daAlink_c::procDiveJumpInit() { mNormalSpeed = daAlinkHIO_autoJump_c0::m.mDiveSpeedH; mGravity = daAlinkHIO_autoJump_c0::m.mDiveGravity; - field_0x300c = 0; + mProcVar2.field_0x300c = 0; current.angle.y = shape_angle.y; field_0x33b0 = 92.0f; @@ -1688,10 +1685,10 @@ int daAlink_c::procDiveJump() { return procFrontRollInit(); } - if (field_0x300c == 0) { + if (mProcVar2.field_0x300c == 0) { if (frameCtrl->checkAnmEnd()) { setSingleAnimeParam(ANM_DIVE, &daAlinkHIO_autoJump_c0::m.mDiveConnectAnm); - field_0x300c = 1; + mProcVar2.field_0x300c = 1; field_0x2f99 = 2; } } else { @@ -1725,7 +1722,7 @@ int daAlink_c::procRollJumpInit() { voiceStart(Z2SE_AL_V_GORONJUMP); seStartOnlyReverb(Z2SE_AL_GORON_JUMP_START); - field_0x300c = 1; + mProcVar2.field_0x300c = 1; return 1; } @@ -1743,11 +1740,11 @@ int daAlink_c::procRollJump() { shape_angle.x += daAlinkHIO_autoJump_c0::m.mSpinJumpRotateSpeed; if (shape_angle.x * old_angle <= 0) { - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { seStartOnlyReverb(Z2SE_AL_GORON_JUMP_ROLLING); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; } else { - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } } @@ -1788,7 +1785,7 @@ int daAlink_c::procFallInit(int param_0, f32 param_1) { i_offNoResetFlg0(FLG0_UNDERWATER); } - field_0x300e.z = 0; + mProcVar3.field_0x300e.z = 0; if (param_0 == 1) { mNormalSpeed = 0.0f; @@ -1811,33 +1808,33 @@ int daAlink_c::procFallInit(int param_0, f32 param_1) { mNormalSpeed = field_0x3408; speed.y = field_0x340c; - field_0x300e.z = 1; + mProcVar3.field_0x300e.z = 1; } - field_0x300e.y = temp_r30; + mProcVar3.field_0x300e.y = temp_r30; setSingleAnimeBaseSpeed(ANM_JUMP_LAND, 0.0f, param_1); resetBasAnime(); if (param_0 != 4 && current.angle.y == shape_angle.y && !checkGrabAnime()) { if (mNormalSpeed > 1.0f) { - field_0x3008 = 2; + mProcVar0.field_0x3008 = 2; } else { - field_0x3008 = 1; + mProcVar0.field_0x3008 = 1; } } else { - field_0x3008 = 0; + mProcVar0.field_0x3008 = 0; } if (temp_r29) { - field_0x300a = 2; + mProcVar1.field_0x300a = 2; field_0x32cc = 1; } else { - field_0x300a = 7; + mProcVar1.field_0x300a = 7; field_0x32cc = 0; } - field_0x300c = 0; - field_0x300e.x = param_0 == 3; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.x = param_0 == 3; i_offNoResetFlg0(FLG0_UNK_40000); mFallVoiceInit = 0; return 1; @@ -1855,10 +1852,10 @@ asm int daAlink_c::procFallInit(int param_0, f32 param_1) { /* 800C6D20-800C6F18 0C1660 01F8+00 1/0 0/0 0/0 .text procFall__9daAlink_cFv */ int daAlink_c::procFall() { - if (field_0x300e.z == 0) { + if (mProcVar3.field_0x300e.z == 0) { cLib_chaseF(&mNormalSpeed, FLOAT_LABEL(lit_6108), lit_9054); - } else if (field_0x300e.z > 0) { - field_0x300e.z = -1; + } else if (mProcVar3.field_0x300e.z > 0) { + mProcVar3.field_0x300e.z = -1; return 1; } @@ -1868,13 +1865,13 @@ int daAlink_c::procFall() { } if (mLinkAcch.ChkGroundHit()) { - return checkLandAction(field_0x300e.x); + return checkLandAction(mProcVar3.field_0x300e.x); } if (i_dComIfGs_getLife() != 0) { - if (field_0x3008 == 1) { - if (field_0x300a > 0) { - field_0x300a--; + if (mProcVar0.field_0x3008 == 1) { + if (mProcVar1.field_0x300a > 0) { + mProcVar1.field_0x300a--; } else { setFrontWallType(); @@ -1885,17 +1882,17 @@ int daAlink_c::procFall() { return 1; } } - } else if (field_0x3008 == 2 && checkFrontWallTypeAction()) { + } else if (mProcVar0.field_0x3008 == 2 && checkFrontWallTypeAction()) { return 1; } setFallVoice(); f32 tmp_f1 = (mFallHeight - current.pos.y) * lit_8782; - if (field_0x300c == 0 && tmp_f1 > daAlinkHIO_damFall_c0::m.mFallAnmTransitionHeight) { + if (mProcVar2.field_0x300c == 0 && tmp_f1 > daAlinkHIO_damFall_c0::m.mFallAnmTransitionHeight) { setSingleAnimeBaseSpeed(ANM_DMG_FALL, FLOAT_LABEL(lit_6108), daAlinkHIO_damFall_c0::m.mFallAnmMorf); - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } if (current.angle.y == shape_angle.y && checkCutJumpInFly()) { @@ -1993,12 +1990,12 @@ int daAlink_c::procSmallJumpInit(int param_0) { sp8.z += cM_scos(canoe_p->shape_angle.y) * 175.0f; } - field_0x300c = cLib_targetAngleY(¤t.pos, &sp8); - field_0x300e.x = 1; + mProcVar2.field_0x300c = cLib_targetAngleY(¤t.pos, &sp8); + mProcVar3.field_0x300e.x = 1; setHeavyBoots(0); } else { field_0x3478 = field_0x34ec.y; - field_0x300e.x = 0; + mProcVar3.field_0x300e.x = 0; } } @@ -2051,12 +2048,12 @@ int daAlink_c::procSmallJump() { voiceStart(Z2SE_AL_V_JUMP_S); field_0x2f99 = 7; - if (field_0x300e.x != 0) { - shape_angle.y = field_0x300c; + if (mProcVar3.field_0x300e.x != 0) { + shape_angle.y = mProcVar2.field_0x300c; current.angle.y = shape_angle.y; } - } else if (field_0x300e.x != 0) { - cLib_addCalcAngleS(&shape_angle.y, field_0x300c, 3, 0x1000, 0x400); + } else if (mProcVar3.field_0x300e.x != 0) { + cLib_addCalcAngleS(&shape_angle.y, mProcVar2.field_0x300c, 3, 0x1000, 0x400); current.angle.y = shape_angle.y; } @@ -2080,7 +2077,7 @@ int daAlink_c::procStepMoveInit() { field_0x3478 = lit_5943 * mNormalSpeed; mNormalSpeed = FLOAT_LABEL(lit_6108); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; field_0x3588 = l_waitBaseAnime; return 1; @@ -2091,7 +2088,7 @@ int daAlink_c::procStepMoveInit() { int daAlink_c::procStepMove() { daPy_frameCtrl_c* frameCtrl = mUnderFrameCtrl; - if (field_0x300c == 0) { + if (mProcVar2.field_0x300c == 0) { field_0x2f99 = 4; if (frameCtrl->checkAnmEnd()) { @@ -2112,7 +2109,7 @@ int daAlink_c::procStepMove() { current.pos.set(field_0x34ec.x + cM_ssin(shape_angle.y) * 2.0f, field_0x34ec.y, field_0x34ec.z + cM_scos(shape_angle.y) * 2.0f); field_0x2f99 = 80; - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } return 1; @@ -2141,8 +2138,6 @@ int daAlink_c::procCrouchInit() { } /* 800C76F8-800C77F4 0C2038 00FC+00 1/0 0/0 0/0 .text procCrouch__9daAlink_cFv */ -#pragma push -#pragma optimization_level 2 int daAlink_c::procCrouch() { cLib_chaseF(&mNormalSpeed, FLOAT_LABEL(lit_6108), daAlinkHIO_move_c0::m.mDeceleration); @@ -2160,7 +2155,6 @@ int daAlink_c::procCrouch() { return 1; } -#pragma pop /* ############################################################################################## */ /* 804255F8-80425604 052318 000C+00 0/1 0/0 0/0 .bss @4419 */ @@ -2208,29 +2202,29 @@ int daAlink_c::procCoMetamorphoseInit() { } field_0x3198 = var_r29; - field_0x3008 = 0; - field_0x300e.x = 0; - field_0x300e.y = 0; + mProcVar0.field_0x3008 = 0; + mProcVar3.field_0x300e.x = 0; + mProcVar3.field_0x300e.y = 0; field_0x347c = 1.0f; mFallVoiceInit = 0; if ((i_checkWolf() && mDemo.getDemoMode() == 0x39) || (!i_checkWolf() && mDemo.getDemoMode() == 0x3A)) { - field_0x300a = 1; + mProcVar1.field_0x300a = 1; speed.y = 0.0f; mNormalSpeed = 0.0f; if (i_checkWolf()) { - field_0x300c = shape_angle.x; + mProcVar2.field_0x300c = shape_angle.x; } } else { deleteEquipItem(FALSE, TRUE); if (i_checkEndResetFlg0(ERFLG0_UNK_2) && checkStageName("D_MN08")) { - field_0x300e.y = 1; + mProcVar3.field_0x300e.y = 1; } - field_0x300a = 0; + mProcVar1.field_0x300a = 0; if (i_checkWolf()) { // Transform Wolf -> Human @@ -2238,7 +2232,7 @@ int daAlink_c::procCoMetamorphoseInit() { field_0x3588 = l_wolfBaseAnime; field_0x347c = 0.5f; field_0x3480 = daAlinkHIO_basic_c0::m.mWolfLinkTransformSpeed; - field_0x300c = shape_angle.x; + mProcVar2.field_0x300c = shape_angle.x; daMidna_c* midna = getMidnaActor(); if (i_checkMidnaRide() && daMidna_c::checkMidnaRealBody() && midna->checkDemoTypeNone()) @@ -2286,22 +2280,22 @@ int daAlink_c::procCoMetamorphoseInit() { } if (var_r28) { - field_0x300c = field_0x2ff0; + mProcVar2.field_0x300c = field_0x2ff0; } else { pos -= current.pos; - field_0x300c = pos.atan2sY_XZ(); + mProcVar2.field_0x300c = pos.atan2sY_XZ(); - if (abs(field_0x300c) > cM_deg2s(70.0f)) { - field_0x300c = field_0x2ff0; + if (abs(mProcVar2.field_0x300c) > cM_deg2s(70.0f)) { + mProcVar2.field_0x300c = field_0x2ff0; } } } else { - field_0x300c = 0; + mProcVar2.field_0x300c = 0; } } speed.y = 0.0f; mNormalSpeed = 0.0f; - field_0x300e.z = 0; + mProcVar3.field_0x300e.z = 0; } field_0x3484 = current.pos.y; @@ -2381,11 +2375,11 @@ int daAlink_c::procCoMetamorphoseOnlyInit() { if ((i_checkWolf() && mDemo.getDemoMode() == 0x46) || (!i_checkWolf() && mDemo.getDemoMode() == 0x47)) { - field_0x300c = 1; - field_0x300e.x = 1; + mProcVar2.field_0x300c = 1; + mProcVar3.field_0x300e.x = 1; } else { - field_0x300c = 0; - field_0x300e.x = 0; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.x = 0; } f32 tmp_0 = FLOAT_LABEL(lit_6108); @@ -2398,12 +2392,12 @@ int daAlink_c::procCoMetamorphoseOnlyInit() { /* 800C83A0-800C8460 0C2CE0 00C0+00 1/0 0/0 0/0 .text procCoMetamorphoseOnly__9daAlink_cFv */ int daAlink_c::procCoMetamorphoseOnly() { - if (field_0x300c == 0) { + if (mProcVar2.field_0x300c == 0) { mClothesChangeWaitTimer = 4; - field_0x300c = 1; + mProcVar2.field_0x300c = 1; } else if (mClothesChangeWaitTimer == 0) { - if (field_0x300e.x == 0) { - field_0x300e.x = 1; + if (mProcVar3.field_0x300e.x == 0) { + mProcVar3.field_0x300e.x = 1; if (i_checkWolf()) { setSingleAnimeWolfBaseSpeed(WANM_WAIT, daAlinkHIO_wlMoveNoP_c0::m.field_0x14, @@ -3103,7 +3097,7 @@ int daAlink_c::execute() { } } - if (checkModeFlg(MODE_VINE_CLIMB) && field_0x300c != 0 && + if (checkModeFlg(MODE_VINE_CLIMB) && mProcVar2.field_0x300c != 0 && dComIfG_Bgsp().ChkPolySafe(mPolyInfo1)) { mZ2Link.framework(dKy_pol_sound_get(&mPolyInfo1), mVoiceReverbIntensity); @@ -3191,15 +3185,15 @@ int daAlink_c::execute() { if ((pmidna->checkMidnaTired() || pmidna->checkForceTiredColor()) && !pmidna->checkForceNormalColor()) { - field_0x79c->getModelData()->entryTevRegAnimator(field_0x7ac); - mpWlMidnaHatModel->getModelData()->entryTevRegAnimator(field_0x7b0); - field_0x7a4->getModelData()->entryTevRegAnimator(field_0x7b4); - mpWlMidnaHairModel->getModelData()->entryTevRegAnimator(field_0x7b8); + mpWlMidnaModel->getModelData()->entryTevRegAnimator(mpDMidnaBrk); + mpWlMidnaMaskModel->getModelData()->entryTevRegAnimator(mpDMidnaMaskBrk); + mpWlMidnaHandModel->getModelData()->entryTevRegAnimator(mpDMidnaHandBrk); + mpWlMidnaHairModel->getModelData()->entryTevRegAnimator(mpDMidnaHairHandBrk); } else { - field_0x79c->getModelData()->removeTevRegAnimator(field_0x7ac); - mpWlMidnaHatModel->getModelData()->removeTevRegAnimator(field_0x7b0); - field_0x7a4->getModelData()->removeTevRegAnimator(field_0x7b4); - mpWlMidnaHairModel->getModelData()->removeTevRegAnimator(field_0x7b8); + mpWlMidnaModel->getModelData()->removeTevRegAnimator(mpDMidnaBrk); + mpWlMidnaMaskModel->getModelData()->removeTevRegAnimator(mpDMidnaMaskBrk); + mpWlMidnaHandModel->getModelData()->removeTevRegAnimator(mpDMidnaHandBrk); + mpWlMidnaHairModel->getModelData()->removeTevRegAnimator(mpDMidnaHairHandBrk); } } @@ -3717,7 +3711,7 @@ int daAlink_c::draw() { if (mClothesChangeWaitTimer != 0) { if (mProcID == PROC_METAMORPHOSE) { - if (field_0x300e > 0) { + if (mProcVar3.field_0x300e > 0) { mTevStr.mFogColor.r = 255; } else { mTevStr.mFogColor.r = -255; @@ -3741,9 +3735,9 @@ int daAlink_c::draw() { } else if (mProcID == PROC_METAMORPHOSE || mProcID == PROC_DUNGEON_WARP || mProcID == PROC_DUNGEON_WARP_SCN_START) { - mTevStr.mFogColor.r = field_0x300e.x; - mTevStr.mFogColor.g = field_0x300e.x; - mTevStr.mFogColor.b = field_0x300e.x; + mTevStr.mFogColor.r = mProcVar3.field_0x300e.x; + mTevStr.mFogColor.g = mProcVar3.field_0x300e.x; + mTevStr.mFogColor.b = mProcVar3.field_0x300e.x; } else if (field_0x346c != 0.0f) { f32 var_f2 = fabsf(field_0x346c); mTevStr.mFogColor.r = var_f2 * daAlinkHIO_wolf_c0::m.mLightDropR; @@ -3899,7 +3893,7 @@ int daAlink_c::draw() { } } - modelDraw(field_0x065c, temp_r30); + modelDraw(mpLinkHandModel, temp_r30); if (field_0x2f92 == 0xFB) { modelDraw(mpDemoHLTmpModel, temp_r30); } @@ -3990,13 +3984,13 @@ int daAlink_c::draw() { } if (i_checkNoResetFlg2(FLG2_UNK_1)) { - modelDraw(field_0x06fc, temp_r30); + modelDraw(mpKanteraModel, temp_r30); preKandelaarDraw(); - modelDraw(field_0x0700, temp_r30); + modelDraw(mpKanteraGlowModel, temp_r30); } else if (i_checkNoResetFlg2(FLG2_UNK_20000)) { - basicModelDraw(field_0x06fc); + basicModelDraw(mpKanteraModel); preKandelaarDraw(); - basicModelDraw(field_0x0700); + basicModelDraw(mpKanteraGlowModel); } if (i_checkEquipHeavyBoots()) { @@ -4012,7 +4006,7 @@ int daAlink_c::draw() { mTevStr.mFogColor = color; } - modelDraw(field_0x784[i], temp_r30); + modelDraw(mpLinkBootModels[i], temp_r30); } mTevStr.mFogColor = color; @@ -4101,7 +4095,7 @@ daAlink_c::~daAlink_c() { dComIfGp_2dShowOn(); } - if (mProcID == PROC_WARP || (mProcID == PROC_TOOL_DEMO && field_0x300c != 0)) { + if (mProcID == PROC_WARP || (mProcID == PROC_TOOL_DEMO && mProcVar2.field_0x300c != 0)) { changeWarpMaterial(WARP_MAT_MODE_1); } @@ -4318,7 +4312,7 @@ int daAlink_c::procCoSwimSubjectivityInit() { } dComIfGp_setPlayerStatus0(0, 0x100000); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; return 1; } @@ -4350,7 +4344,7 @@ int daAlink_c::procCoPeepSubjectivityInit() { speed.y = FLOAT_LABEL(lit_6108); dComIfGp_setPlayerStatus0(0, 0x2000); field_0x3478 = lit_6183; - field_0x300c = shape_angle.y; + mProcVar2.field_0x300c = shape_angle.y; return 1; } @@ -4558,12 +4552,9 @@ static u8 dComIfGp_getRStatus() { } /* 800CFF4C-800CFFA4 0CA88C 0058+00 1/1 0/0 0/0 .text checkAttentionLock__9daAlink_cFv */ -#pragma push -#pragma optimization_level 2 BOOL daAlink_c::checkAttentionLock() { return mAttention->Lockon(); } -#pragma pop /* 800CFFA4-800CFFC0 0CA8E4 001C+00 1/1 0/0 0/0 .text dComIfGp_setItemLifeCount__FfUc */ void dComIfGp_setItemLifeCount(f32 amount, u8 type) { @@ -4696,7 +4687,7 @@ BOOL daAlink_c::checkHorseStart() { /* 800D01E0-800D0208 0CAB20 0028+00 1/0 0/0 0/0 .text checkCutTurnCharge__9daAlink_cCFv */ BOOL daAlink_c::checkCutTurnCharge() const { - return mProcID == PROC_CUT_TURN_MOVE && field_0x300c == 0; + return mProcID == PROC_CUT_TURN_MOVE && mProcVar2.field_0x300c == 0; } /* 800D0208-800D0228 0CAB48 0020+00 1/0 0/0 0/0 .text checkAcceptDungeonWarpAlink__9daAlink_cFi */ @@ -4718,13 +4709,13 @@ fopAc_ac_c* daAlink_c::getSpinnerActor() { /* 800D0274-800D027C 0CABB4 0008+00 1/0 0/0 0/0 .text getSumouCounter__9daAlink_cCFv */ s16 daAlink_c::getSumouCounter() const { - return field_0x300c; + return mProcVar2.field_0x300c; } /* 800D027C-800D0284 0CABBC 0008+00 1/0 0/0 0/0 .text checkSumouWithstand__9daAlink_cCFv */ s16 daAlink_c::checkSumouWithstand() const { - return field_0x300e.x; + return mProcVar3.field_0x300e.x; } /* 800D0284-800D0290 0CABC4 000C+00 1/0 0/0 0/0 .text setMidnaMsgNum__9daAlink_cFP10fopAc_ac_cUs @@ -4832,7 +4823,7 @@ BOOL daAlink_c::checkAutoJump() const { /* 800D0414-800D0444 0CAD54 0030+00 1/0 0/0 0/0 .text checkSideStep__9daAlink_cCFv */ bool daAlink_c::checkSideStep() const { - return (mProcID == PROC_SIDESTEP || mProcID == PROC_WOLF_SIDESTEP) && field_0x300a != 0; + return (mProcID == PROC_SIDESTEP || mProcID == PROC_WOLF_SIDESTEP) && mProcVar1.field_0x300a != 0; } /* 800D0444-800D0468 0CAD84 0024+00 1/0 0/0 0/0 .text checkWolfTriggerJump__9daAlink_cCFv @@ -4849,7 +4840,7 @@ BOOL daAlink_c::checkGuardBreakMode() const { /* 800D047C-800D04A4 0CADBC 0028+00 1/0 0/0 0/0 .text checkLv3Slide__9daAlink_cCFv */ bool daAlink_c::checkLv3Slide() const { - return mProcID == PROC_SLIDE && field_0x300e.x != 0; + return mProcID == PROC_SLIDE && mProcVar3.field_0x300e.x != 0; } /* 800D04A4-800D04B8 0CADE4 0014+00 1/0 0/0 0/0 .text checkWolfHowlDemoMode__9daAlink_cCFv */ @@ -4880,7 +4871,7 @@ BOOL daAlink_c::checkHawkWait() const { /* 800D051C-800D0544 0CAE5C 0028+00 1/0 0/0 0/0 .text checkGoatThrow__9daAlink_cCFv */ BOOL daAlink_c::checkGoatThrow() const { - return mProcID == PROC_GOAT_CATCH && field_0x300c != 0; + return mProcID == PROC_GOAT_CATCH && mProcVar2.field_0x300c != 0; } /* 800D0544-800D0570 0CAE84 002C+00 1/0 0/0 0/0 .text checkGoatThrowAfter__9daAlink_cCFv @@ -4940,7 +4931,7 @@ BOOL daAlink_c::checkWolfRSit() const { /* 800D0638-800D0660 0CAF78 0028+00 1/0 0/0 0/0 .text checkBottleDrinkEnd__9daAlink_cCFv */ BOOL daAlink_c::checkBottleDrinkEnd() const { - return mProcID == PROC_BOTTLE_DRINK && field_0x300e.x != 0; + return mProcID == PROC_BOTTLE_DRINK && mProcVar3.field_0x300e.x != 0; } /* 800D0660-800D0674 0CAFA0 0014+00 1/0 0/0 0/0 .text checkWolfDig__9daAlink_cCFv */ @@ -4955,7 +4946,7 @@ BOOL daAlink_c::checkCutCharge() const { /* 800D0688-800D06B0 0CAFC8 0028+00 1/0 0/0 0/0 .text checkCutLargeJumpCharge__9daAlink_cCFv */ BOOL daAlink_c::checkCutLargeJumpCharge() const { - return mProcID == PROC_CUT_TURN_MOVE && field_0x300c != 0; + return mProcID == PROC_CUT_TURN_MOVE && mProcVar2.field_0x300c != 0; } /* 800D06B0-800D06D8 0CAFF0 0028+00 1/0 0/0 0/0 .text checkComboCutTurn__9daAlink_cCFv */ @@ -5003,7 +4994,7 @@ BOOL daAlink_c::checkCutJumpCancelTurn() const { /* 800D07D4-800D07FC 0CB114 0028+00 1/0 0/0 0/0 .text * checkSingleBoarBattleSecondBowReady__9daAlink_cCFv */ BOOL daAlink_c::checkSingleBoarBattleSecondBowReady() const { - return mProcID == PROC_HORSE_BOW_SUBJECT && field_0x300c != 0; + return mProcID == PROC_HORSE_BOW_SUBJECT && mProcVar2.field_0x300c != 0; } /* 800D07FC-800D0818 0CB13C 001C+00 1/0 0/0 0/0 .text cancelDungeonWarpReadyNeck__9daAlink_cFv */ @@ -5028,7 +5019,7 @@ void daAlink_c::onSceneChangeDead(u8 param_0, int param_1) { if (mProcID != PROC_DEAD) { return; } - field_0x300e.z = param_0; + mProcVar3.field_0x300e.z = param_0; field_0x3198 = param_1; } @@ -5041,7 +5032,7 @@ bool daAlink_c::checkNoEquipItem() const { */ s16 daAlink_c::getBoardCutTurnOffsetAngleY() const { if (mProcID == PROC_BOARD_CUT_TURN) { - return field_0x300e.z; + return mProcVar3.field_0x300e.z; } return 0; } @@ -5077,7 +5068,7 @@ void daAlink_c::setSumouPushBackDirection(s16 param_0) { if (mProcID != PROC_SUMOU_MOVE) { return; } - field_0x300e.y = param_0; + mProcVar3.field_0x300e.y = param_0; } /* 800D0930-800D0948 0CB270 0018+00 1/0 0/0 0/0 .text setSumouLoseHeadUp__9daAlink_cFv */ @@ -5105,7 +5096,7 @@ void daAlink_c::setWolfEnemyHangBiteAngle(s16 angle) { if (mProcID != PROC_WOLF_ENEMY_HANG_BITE) { return; } - field_0x300e.y = angle; + mProcVar3.field_0x300e.y = angle; } /* 800D0984-800D0998 0CB2C4 0014+00 1/0 0/0 0/0 .text setSumouGraspCancelCount__9daAlink_cFi */ @@ -5113,7 +5104,7 @@ void daAlink_c::setSumouGraspCancelCount(int param_0) { if (mProcID != PROC_SUMOU_MOVE) { return; } - field_0x300c = param_0; + mProcVar2.field_0x300c = param_0; } /* 800D0998-800D09AC 0CB2D8 0014+00 1/0 0/0 0/0 .text checkItemSwordEquip__9daAlink_cCFv @@ -5140,7 +5131,7 @@ BOOL daAlink_c::checkCutJumpMode() const { /* 800D09DC-800D09E4 0CB31C 0008+00 1/0 0/0 0/0 .text getGiantPuzzleAimAngle__9daAlink_cCFv */ s16 daAlink_c::getGiantPuzzleAimAngle() const { - return field_0x300c; + return mProcVar2.mPuzzleAimAngle; } /* 800D09E4-800D09EC 0CB324 0008+00 1/0 0/0 0/0 .text getSwordChangeWaitTimer__9daAlink_cCFv */ @@ -5150,7 +5141,7 @@ u8 daAlink_c::getSwordChangeWaitTimer() const { /* 800D09EC-800D0A14 0CB32C 0028+00 1/0 0/0 0/0 .text checkMetamorphose__9daAlink_cCFv */ BOOL daAlink_c::checkMetamorphose() const { - return mProcID == PROC_METAMORPHOSE && field_0x300a == 0; + return mProcID == PROC_METAMORPHOSE && mProcVar1.field_0x300a == 0; } /* 800D0A14-800D0A28 0CB354 0014+00 1/0 0/0 0/0 .text checkWolfDownAttackPullOut__9daAlink_cCFv */ @@ -5183,12 +5174,12 @@ bool daAlink_c::checkCopyRodEquip() const { /* 800D0A44-800D0A6C 0CB384 0028+00 1/0 0/0 0/0 .text checkCanoeFishingGetLeft__9daAlink_cCFv */ bool daAlink_c::checkCanoeFishingGetLeft() const { - return mProcID == PROC_CANOE_FISHING_GET && field_0x300e.x == 0; + return mProcID == PROC_CANOE_FISHING_GET && mProcVar3.field_0x300e.x == 0; } /* 800D0A6C-800D0A94 0CB3AC 0028+00 1/0 0/0 0/0 .text checkCanoeFishingGetRight__9daAlink_cCFv */ bool daAlink_c::checkCanoeFishingGetRight() const { - return mProcID == PROC_CANOE_FISHING_GET && field_0x300e.x == 1; + return mProcID == PROC_CANOE_FISHING_GET && mProcVar3.field_0x300e.x == 1; } /* 800D0A94-800D0A9C 0CB3D4 0008+00 1/0 0/0 0/0 .text checkBeeChildDrink__9daAlink_cCFv @@ -5217,7 +5208,7 @@ void daAlink_c::cancelOctaIealHang() { if (mProcID != PROC_BOSS_BODY_HANG) { return; } - field_0x300e.x = 1; + mProcVar3.field_0x300e.x = 1; } /* 800D0B08-800D0B20 0CB448 0018+00 1/0 0/0 0/0 .text cancelDragonHangBackJump__9daAlink_cFv */ @@ -5225,7 +5216,7 @@ void daAlink_c::cancelDragonHangBackJump() { if (mProcID != PROC_BOSS_BODY_HANG) { return; } - field_0x300e.x = -1; + mProcVar3.field_0x300e.x = -1; } /* 800D0B20-800D0B38 0CB460 0018+00 1/0 0/0 0/0 .text setOctaIealWildHang__9daAlink_cFv @@ -5234,7 +5225,7 @@ void daAlink_c::setOctaIealWildHang() { if (mProcID != PROC_BOSS_BODY_HANG) { return; } - field_0x3008 = 1; + mProcVar0.field_0x3008 = 1; } /* 800D0B38-800D0B60 0CB478 0028+00 1/0 0/0 0/0 .text checkDragonHangRide__9daAlink_cCFv diff --git a/src/d/a/d_a_alink_spinner.inc b/src/d/a/d_a_alink_spinner.inc index b218220b3bb..84744353bd9 100644 --- a/src/d/a/d_a_alink_spinner.inc +++ b/src/d/a/d_a_alink_spinner.inc @@ -153,7 +153,7 @@ int daAlink_c::procSpinnerReadyInit() { field_0x3588 = l_waitBaseAnime; field_0x33b0 = field_0x3588.y; field_0x34d4 = l_waitBaseAnime; - field_0x300c = 8; + mProcVar2.field_0x300c = 8; return 1; } @@ -169,11 +169,11 @@ int daAlink_c::procSpinnerReady() { current.pos.x = spinner->current.pos.x; current.pos.z = spinner->current.pos.z; - field_0x300c--; + mProcVar2.field_0x300c--; field_0x2f99 = 15; - if ((field_0x300c < 0 && current.pos.y <= spinner->getModelMtx()[1][3]) || - field_0x300c < -30) { + if ((mProcVar2.field_0x300c < 0 && current.pos.y <= spinner->getModelMtx()[1][3]) || + mProcVar2.field_0x300c < -30) { current.pos.y = spinner->getModelMtx()[1][3]; procSpinnerWaitInit(); } @@ -202,13 +202,13 @@ int daAlink_c::procSpinnerWaitInit() { speed.y = 0.0f; setSpecialGravity(0.0f, mMaxFallSpeed, 0); mNormalSpeed = 0.0f; - field_0x300c = 0; + mProcVar2.field_0x300c = 0; - field_0x300e.x = shape_angle.y; - field_0x300e.y = 0; + mProcVar3.field_0x300e.x = shape_angle.y; + mProcVar3.field_0x300e.y = 0; field_0x3198 = ANM_RIDE_CROUCH; field_0x33b0 = 70.0f; - field_0x300e.z = 0; + mProcVar3.field_0x300e.z = 0; field_0x37a4 = mRideAcKeep.getActor()->current.pos; return 1; @@ -242,9 +242,9 @@ int daAlink_c::procSpinnerWait() { } int itemSetBtn = checkItemSetButton(SPINNER); - if (field_0x300c == 0) { + if (mProcVar2.field_0x300c == 0) { if (!itemButton()) { - field_0x300c = 1; + mProcVar2.field_0x300c = 1; mNormalSpeed = getSpinnerRideSpeedF(); spinner->setMove(mNormalSpeed, getSpinnerRideMoveTime()); } else if (checkInputOnR()) { @@ -258,7 +258,7 @@ int daAlink_c::procSpinnerWait() { } current.angle.y = shape_angle.y; - field_0x300e.x = shape_angle.y; + mProcVar3.field_0x300e.x = shape_angle.y; } } else { if (checkSetItemTrigger(SPINNER) || swordSwingTrigger() || itemSetBtn == 2) { @@ -285,7 +285,7 @@ int daAlink_c::procSpinnerWait() { current.angle.y = spinner->current.angle.y; if (spinner->checkSpinnerTagIntoIncRot()) { - field_0x300e.z = 1; + mProcVar3.field_0x300e.z = 1; setSpinnerStatus(ACTION_STR_SPIN, ACTION_FLG_CONTINUATION); if (field_0x3198 != ANM_RIDE_KICK && field_0x2060->getOldFrameRate() < 0.01f) { @@ -295,7 +295,7 @@ int daAlink_c::procSpinnerWait() { fopAcM_seStartCurrent(spinner, Z2SE_OBJ_SPNR_SW_PUSH, 0); } } else if (spinner->checkSpinnerTagInto()) { - if (field_0x300e.z != 0) { + if (mProcVar3.field_0x300e.z != 0) { setSpinnerStatus(ACTION_STR_SPIN, ACTION_FLG_CONTINUATION); } else { setSpinnerStatus(ACTION_STR_SPIN, ACTION_FLG_DEFAULT); @@ -312,18 +312,18 @@ int daAlink_c::procSpinnerWait() { setSingleAnime(ANM_RIDE_JUMP, 0.0f, daAlinkHIO_board_c0::m.mAirborneAnm.mStartFrame, daAlinkHIO_board_c0::m.mAirborneAnm.mEndFrame, daAlinkHIO_board_c0::m.mAirborneAnm.mInterpolation); - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; } else if (field_0x3198 == ANM_RIDE_JUMP) { if (!spinner->getJumpFlg()) { setSingleAnime(ANM_RIDE_JUMP_LAND, daAlinkHIO_board_c0::m.mLandAnm.mSpeed, daAlinkHIO_board_c0::m.mLandAnm.mStartFrame, 16, daAlinkHIO_board_c0::m.mLandAnm.mInterpolation); field_0x3198 = ANM_RIDE_JUMP_LAND; - } else if (field_0x300e.y == 0 && field_0x2060->getOldFrameRate() < 0.01f) { + } else if (mProcVar3.field_0x300e.y == 0 && field_0x2060->getOldFrameRate() < 0.01f) { setSingleAnime(ANM_RIDE_JUMP, daAlinkHIO_board_c0::m.mAirborneAnm.mSpeed, daAlinkHIO_board_c0::m.mAirborneAnm.mStartFrame, daAlinkHIO_board_c0::m.mAirborneAnm.mEndFrame, -1.0f); - field_0x300e.y = 1; + mProcVar3.field_0x300e.y = 1; } } else if ((field_0x3198 == ANM_RIDE_JUMP_LAND && frameCtrl->checkAnmEnd()) || (field_0x3198 != ANM_RIDE_JUMP_LAND && field_0x3198 != ANM_RIDE_CROUCH)) { @@ -334,7 +334,7 @@ int daAlink_c::procSpinnerWait() { } setSpinnerSyncPos(); - shape_angle.y = field_0x300e.x; + shape_angle.y = mProcVar3.field_0x300e.x; return 1; } diff --git a/src/d/a/d_a_alink_sumou.inc b/src/d/a/d_a_alink_sumou.inc index 85557d523c9..14cc8d54845 100644 --- a/src/d/a/d_a_alink_sumou.inc +++ b/src/d/a/d_a_alink_sumou.inc @@ -51,8 +51,8 @@ int daAlink_c::procSumouReadyInit() { field_0x34d4 = field_0x3588; field_0x2f99 = 4; mSpecialMode = 1; - field_0x300c = 0; - field_0x300e.x = 0; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.x = 0; deleteEquipItem(0, 1); if (mThrowBoomerangAcKeep.getActor() != NULL) { @@ -109,7 +109,7 @@ int daAlink_c::procSumouSideMoveInit() { field_0x2f99 = 12; setFootEffectProcType(5); - field_0x3008 = 15; + mProcVar0.field_0x3008 = 15; return 1; } @@ -159,7 +159,7 @@ int daAlink_c::procSumouStaggerInit() { setSingleAnimeBase(ANM_SUMOU_STAGGER); mNormalSpeed = FLOAT_LABEL(lit_6108); field_0x2f99 = 12; - field_0x3008 = 30; + mProcVar0.field_0x3008 = 30; return 1; } @@ -171,10 +171,10 @@ int daAlink_c::procSumouStagger() { return 1; } - field_0x3008--; + mProcVar0.field_0x3008--; if (mSpecialMode == 0x1C || mSpecialMode == 0x21 || mSpecialMode == 0x1B) { procSumouActionInit(0, 0, 0); - } else if (field_0x3008 == 0) { + } else if (mProcVar0.field_0x3008 == 0) { procSumouSideMoveInit(); } @@ -213,7 +213,7 @@ int daAlink_c::procSumouShikoInit() { field_0x3588 = l_waitBaseAnime; field_0x34d4 = field_0x3588; field_0x2f99 = 12; - field_0x300c = 0; + mProcVar2.field_0x300c = 0; mSpecialMode = 0; setFootEffectProcType(5); diff --git a/src/d/a/d_a_alink_swim.inc b/src/d/a/d_a_alink_swim.inc index 54d5eed54d5..832fb6f2312 100644 --- a/src/d/a/d_a_alink_swim.inc +++ b/src/d/a/d_a_alink_swim.inc @@ -142,7 +142,7 @@ void daAlink_c::swimBgCheck(f32 param_0) { if (getZoraSwim()) { uvar1 = field_0x3080; } else { - uvar1 = field_0x300c; + uvar1 = mProcVar2.field_0x300c; start_pos.y += daAlinkHIO_wlWallHang_c0::m.field_0x78; } @@ -363,7 +363,7 @@ BOOL daAlink_c::checkSwimNeckUpDown() const { /* 80104034-801040F8 0FE974 00C4+00 3/3 0/0 0/0 .text setSwimUpDownOffset__9daAlink_cFv */ void daAlink_c::setSwimUpDownOffset() { - field_0x300c += (s16)((cM_rndF(lit_16570) + lit_27477) * lit_27476); + mProcVar2.field_0x300c += (s16)((cM_rndF(lit_16570) + lit_27477) * lit_27476); f32 var_f1; if (i_checkWolf()) { @@ -376,7 +376,7 @@ void daAlink_c::setSwimUpDownOffset() { var_f1 = daAlinkHIO_swim_c0::m.mWaitVibrationIntensity; } - field_0x2b98 = var_f1 * cM_ssin(field_0x300c); + field_0x2b98 = var_f1 * cM_ssin(mProcVar2.field_0x300c); } /* 801040F8-801041E8 0FEA38 00F0+00 2/2 0/0 0/0 .text procSwimUpInit__9daAlink_cFv */ @@ -394,8 +394,8 @@ int daAlink_c::procSwimUpInit() { mZ2Link.setInWater(false); setSingleAnimeParam(ANM_SWIM_RESURFACE, &daAlinkHIO_swim_c0::m.mResurfaceAnm); dComIfGp_setPlayerStatus0(0, 0x100000); - field_0x3008 = 0; - field_0x300e.y = 0; + mProcVar0.field_0x3008 = 0; + mProcVar3.field_0x300e.y = 0; field_0x3480 = daAlinkHIO_swim_c0::m.mInitHeight; field_0x3000 = 0; @@ -448,10 +448,10 @@ int daAlink_c::procSwimWaitInit(int param_0) { if (param_0) { seStartMapInfo(Z2SE_AL_INTO_WATER); - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; field_0x3480 = daAlinkHIO_swim_c0::m.mInitHeight; } else if (!mode_40000) { - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; field_0x3480 = daAlinkHIO_swim_c0::m.mInitHeight; } @@ -480,8 +480,8 @@ int daAlink_c::procSwimWaitInit(int param_0) { speed.y = FLOAT_LABEL(lit_6108); } - field_0x300c = 0; - field_0x3008 = 0; + mProcVar2.field_0x300c = 0; + mProcVar0.field_0x3008 = 0; field_0x594 = getSwimFrontMaxSpeed(); return 1; } @@ -552,7 +552,7 @@ int daAlink_c::procSwimMoveInit() { if (!mode_40000) { field_0x3480 = daAlinkHIO_swim_c0::m.mInitHeight; - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; } if (proc_swim_dive || proc_dive_jump) { @@ -560,8 +560,8 @@ int daAlink_c::procSwimMoveInit() { if (proc_dive_jump) { field_0x3080 = 0x2800; - field_0x300e.x = field_0x3080; - field_0x300e.y = 1; + mProcVar3.field_0x300e.x = field_0x3080; + mProcVar3.field_0x300e.y = 1; setOldRootQuaternion(-field_0x3080, 0, 0); } } else { @@ -578,7 +578,7 @@ int daAlink_c::procSwimMoveInit() { swimDeleteItem(); dComIfGp_setPlayerStatus0(0, 0x100000); - field_0x3008 = 0; + mProcVar0.field_0x3008 = 0; return 1; } @@ -630,18 +630,18 @@ int daAlink_c::procSwimDiveInit() { speed.y = 0.0f; if (i_checkNoResetFlg0(FLG0_UNK_100)) { - field_0x300c = 1; + mProcVar2.field_0x300c = 1; setSingleAnimeParam(ANM_SWIM_DIVE, &daAlinkHIO_swim_c0::m.mDiveAnm); voiceStart(Z2SE_AL_V_DIVING); } else { - field_0x300c = 0; + mProcVar2.field_0x300c = 0; setSingleAnimeParam(ANM_SWIM_DIVE, &daAlinkHIO_swim_c0::m.mUnderwaterDiveAnm); } field_0x2f99 = 0x10; field_0x3588 = l_waitBaseAnime; field_0x3480 = daAlinkHIO_swim_c0::m.mInitHeight; - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; dComIfGp_setPlayerStatus0(0, 0x100000); field_0x3000 = 30; @@ -666,7 +666,7 @@ asm int daAlink_c::procSwimDiveInit() { int daAlink_c::procSwimDive() { daPy_frameCtrl_c* frame_ctrl = mUnderFrameCtrl; - if (field_0x300c == 0) { + if (mProcVar2.field_0x300c == 0) { setDoStatus(0x4C); } else if (i_checkNoResetFlg0(FLG0_UNK_100) && frame_ctrl->getFrame() > 20.0f) { i_offNoResetFlg0(FLG0_UNK_100); @@ -682,7 +682,7 @@ int daAlink_c::procSwimDive() { field_0x3478 = 1.0f; } - if (frame_ctrl->checkPass(15.0f) && field_0x300c != 0) { + if (frame_ctrl->checkPass(15.0f) && mProcVar2.field_0x300c != 0) { cXyz pos(current.pos.x, mWaterY, current.pos.z); fopKyM_createWpillar(&pos, 0.7f, 0); } @@ -694,10 +694,10 @@ int daAlink_c::procSwimDive() { if (checkAnmEnd(frame_ctrl)) { speed.y = daAlinkHIO_swim_c0::m.mMaxSinkSpeed; - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { field_0x3080 = 0x2800; - field_0x300e.x = field_0x3080; - field_0x300e.y = 1; + mProcVar3.field_0x300e.x = field_0x3080; + mProcVar3.field_0x300e.y = 1; } setOldRootQuaternion(-field_0x3080, 0, 0); @@ -743,12 +743,12 @@ int daAlink_c::procSwimHookshotSubjectInit() { speed.y = FLOAT_LABEL(lit_6108); } - field_0x300c = 0; - field_0x3008 = 0; + mProcVar2.field_0x300c = 0; + mProcVar0.field_0x3008 = 0; field_0x594 = getSwimFrontMaxSpeed(); field_0x3480 = daAlinkHIO_swim_c0::m.mInitHeight; - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; field_0x30d0 = 0; setHookshotReadyMaterial(); @@ -818,7 +818,7 @@ int daAlink_c::procSwimHookshotMoveInit() { speed.y = FLOAT_LABEL(lit_6108); } - field_0x3008 = 0; + mProcVar0.field_0x3008 = 0; if (field_0x3080 != 0) { setOldRootQuaternion(field_0x3080, 0, 0); @@ -826,7 +826,7 @@ int daAlink_c::procSwimHookshotMoveInit() { } field_0x3480 = daAlinkHIO_swim_c0::m.mInitHeight; - field_0x300e.y = 0; + mProcVar3.field_0x300e.y = 0; field_0x30d0 = 0; dComIfGp_setPlayerStatus0(0, 0x104000); @@ -934,11 +934,11 @@ int daAlink_c::procSwimDamageInit(dCcD_GObjInf* param_0) { temp_r30->y, temp_r30->z * cM_scos(shape_angle.y) + temp_r30->x * cM_ssin(shape_angle.y)); - field_0x3008 = + mProcVar0.field_0x3008 = cLib_minMaxLimit(cM_atan2s(sp24.z, sp24.y), (s16)-daAlinkHIO_damSwim_c0::m.field_0x78, (s16)daAlinkHIO_damSwim_c0::m.field_0x78); - field_0x300a = cLib_minMaxLimit( + mProcVar1.field_0x300a = cLib_minMaxLimit( cM_atan2s(sp24.x, -JMAFastSqrt(sp24.y * sp24.y + sp24.z * sp24.z)), (s16)-daAlinkHIO_damSwim_c0::m.field_0x7A, (s16)daAlinkHIO_damSwim_c0::m.field_0x7A); @@ -946,8 +946,8 @@ int daAlink_c::procSwimDamageInit(dCcD_GObjInf* param_0) { if (bvar4) { setSingleAnimeParam(ANM_SWIM_DMG_FREEZE, &daAlinkHIO_damSwim_c0::m.field_0x64); field_0x3478 = daAlinkHIO_damSwim_c0::m.field_0x64.mCheckFrame; - field_0x3008 = 0; - field_0x300a = 0; + mProcVar0.field_0x3008 = 0; + mProcVar1.field_0x300a = 0; } else if (dir == DIR_FORWARD) { setSingleAnimeParam(ANM_SWIM_DMG_FRONT, &daAlinkHIO_damSwim_c0::m.field_0x0); field_0x3478 = daAlinkHIO_damSwim_c0::m.field_0x0.mCheckFrame; @@ -987,8 +987,8 @@ int daAlink_c::procSwimDamage() { daPy_frameCtrl_c* frame_ctrl = mUnderFrameCtrl; f32 fvar8 = cM_fsin(field_0x347c * (frame_ctrl->getFrame() - frame_ctrl->getStart())); - mBodyAngle.x = field_0x3008 * fvar8; - mBodyAngle.z = -field_0x300a * fvar8; + mBodyAngle.x = mProcVar0.field_0x3008 * fvar8; + mBodyAngle.z = -mProcVar1.field_0x300a * fvar8; mBodyAngle.y = 0; if (checkSwimUpAction()) { diff --git a/src/d/a/d_a_alink_swindow.inc b/src/d/a/d_a_alink_swindow.inc index 5ec3e6cb64b..bc48df968b0 100644 --- a/src/d/a/d_a_alink_swindow.inc +++ b/src/d/a/d_a_alink_swindow.inc @@ -87,9 +87,9 @@ int daAlink_c::loadModelDVD() { if (mClothesChangeWaitTimer == 2) { mEyeHL1.remove(); mEyeHL2.remove(); - field_0x79c = NULL; - mpWlMidnaHatModel = NULL; - field_0x7a4 = NULL; + mpWlMidnaModel = NULL; + mpWlMidnaMaskModel = NULL; + mpWlMidnaHandModel = NULL; mpWlMidnaHairModel = NULL; if (!i_checkNoResetFlg2(FLG2_UNK_280000)) { @@ -291,13 +291,13 @@ void daAlink_c::statusWindowDraw() { basicModelDraw(mpLinkModel); if (!i_checkWolf()) { - basicModelDraw(field_0x065c); + basicModelDraw(mpLinkHandModel); basicModelDraw(mpLinkHatModel); basicModelDraw(mpLinkFaceModel); if (i_checkEquipHeavyBoots()) { for (int i = 0; i < 2; i++) { - basicModelDraw(field_0x784[i]); + basicModelDraw(mpLinkBootModels[i]); } } } diff --git a/src/d/a/d_a_alink_whistle.inc b/src/d/a/d_a_alink_whistle.inc index 2647a6bb670..b3c39bf56b2 100644 --- a/src/d/a/d_a_alink_whistle.inc +++ b/src/d/a/d_a_alink_whistle.inc @@ -72,10 +72,10 @@ int daAlink_c::procGrassWhistleGetInit() { field_0x280c.setData(field_0x27f4); daObjYobikusa_c* yobikusa = (daObjYobikusa_c*)field_0x27f4; - field_0x300c = yobikusa->getType(); - field_0x300e.x = yobikusa->getPathID(); - field_0x300e.y = yobikusa->isPlayerCorrect(); - field_0x300e.z = yobikusa->shape_angle.y + 0x8000; + mProcVar2.field_0x300c = yobikusa->getType(); + mProcVar3.field_0x300e.x = yobikusa->getPathID(); + mProcVar3.field_0x300e.y = yobikusa->isPlayerCorrect(); + mProcVar3.field_0x300e.z = yobikusa->shape_angle.y + 0x8000; field_0x37c8.set(yobikusa->current.pos.x + cM_ssin(yobikusa->shape_angle.y) * 50.0f, yobikusa->current.pos.y + 50.0f, yobikusa->current.pos.z + cM_scos(yobikusa->shape_angle.y) * 50.0f); @@ -99,9 +99,9 @@ int daAlink_c::procGrassWhistleGet() { daPy_frameCtrl_c* frameCtrl = mUnderFrameCtrl; if (frameCtrl->checkAnmEnd()) { - procGrassWhistleWaitInit(field_0x300c, field_0x300e.x, field_0x300e.y, field_0x300e.z, &field_0x37c8); + procGrassWhistleWaitInit(mProcVar2.field_0x300c, mProcVar3.field_0x300e.x, mProcVar3.field_0x300e.y, mProcVar3.field_0x300e.z, &field_0x37c8); } else if (mEquipItem == NO_ITEM && frameCtrl->getFrame() >= lit_7710) { - setGrassWhistleModel(field_0x300c); + setGrassWhistleModel(mProcVar2.field_0x300c); if (field_0x280c.getActor() != NULL) { fopAcM_setCarryNow(field_0x280c.getActor(), 0); @@ -140,11 +140,11 @@ int daAlink_c::procCoHorseCallWaitInit(int param_0) { commonProcInit(PROC_HORSE_CALL_WAIT); if (param_0 == 4) { - field_0x300e.y = 2; + mProcVar3.field_0x300e.y = 2; } else if (param_0 == 1) { - field_0x300e.y = 0x3D; + mProcVar3.field_0x300e.y = 0x3D; } else { - field_0x300e.y = 0x10; + mProcVar3.field_0x300e.y = 0x10; } if (i_checkWolf()) { @@ -204,7 +204,7 @@ int daAlink_c::procHawkSubjectInit() { field_0x280c.setData(actor); } - field_0x300c = 0; + mProcVar2.field_0x300c = 0; mBodyAngle.y = 0; deleteEquipItem(0, 1); return 1; diff --git a/src/d/a/d_a_alink_wolf.inc b/src/d/a/d_a_alink_wolf.inc index fda6e65d3f0..5a38cc0ee81 100644 --- a/src/d/a/d_a_alink_wolf.inc +++ b/src/d/a/d_a_alink_wolf.inc @@ -3,7 +3,105 @@ * General Player Wolf action handling */ +#include "JSystem/J3DGraphBase/J3DMaterial.h" +#include "d/a/d_a_alink.h" +#include "d/com/d_com_inf_game.h" +#include "d/msg/d_msg_object.h" +#include "f_op/f_op_kankyo_mng.h" +#include "m_Do/m_Do_controller_pad.h" +#include "rel/d/a/d_a_horse/d_a_horse.h" +#include "rel/d/a/d_a_kago/d_a_kago.h" +#include "rel/d/a/e/d_a_e_pm/d_a_e_pm.h" +#include "rel/d/a/e/d_a_e_yc/d_a_e_yc.h" +#include "rel/d/a/kytag/d_a_kytag03/d_a_kytag03.h" +#include "rel/d/a/npc/d_a_npc_gwolf/d_a_npc_gwolf.h" +#include "rel/d/a/npc/d_a_npc_tk/d_a_npc_tk.h" +#include "rel/d/a/obj/d_a_obj_crope/d_a_obj_crope.h" +#include "rel/d/a/obj/d_a_obj_smw_stone/d_a_obj_smw_stone.h" +#include "rel/d/a/obj/d_a_obj_wind_stone/d_a_obj_wind_stone.h" +#include "rel/d/a/obj/d_a_obj_yobikusa/d_a_obj_yobikusa.h" +#include "rel/d/a/tag/d_a_tag_howl/d_a_tag_howl.h" +#include "rel/d/a/tag/d_a_tag_wara_howl/d_a_tag_wara_howl.h" +#include "rel/d/a/tag/d_a_tag_wljump/d_a_tag_wljump.h" + /* 80126740-80126928 121080 01E8+00 2/2 0/0 0/0 .text changeCommon__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +void daAlink_c::changeCommon() { + fopAcM_SetMtx(this, mpLinkModel->getBaseTRMtx()); + model = mpLinkModel; + + field_0x2060->offOldFrameFlg(); + field_0x2f8c = 0; + resetUpperAnime(UPPER_2, -1.0f); + + i_offNoResetFlg1(FLG1_UNK_20000000); + offKandelaarModel(); + + int i; + for (i = 0; i < 2; i++) { + mFootData1[i].field_0x2 = 0; + mFootData1[i].field_0x4 = 0; + mFootData1[i].field_0x6 = 0; + mFootData2[i].field_0x2 = 0; + mFootData2[i].field_0x4 = 0; + mFootData2[i].field_0x6 = 0; + } + + for (i = 0; i < 10; i++) { + field_0x302c[i] = 0; + field_0x3040[i] = 0; + } + + for (i = 0; i < 3; i++) { + field_0x3054[i] = 0; + field_0x305a[i] = 0; + } + + shape_angle.z = 0; + field_0x2fec = 0; + field_0x2fee = 0; + + mBodyAngle.set(0, 0, 0); + field_0x3080 = 0; + field_0x3082 = 0; + + i_offNoResetFlg1(0x600080); + i_offNoResetFlg2(FLG2_UNK_8000000); + + field_0x2180[0]->init(); + field_0x2180[1]->init(); + + mWolfEyeUpTimer = 0; + resetCombo(1); + + i = 0; + mItemTrigger = 0; + mItemButton = 0; + field_0x2ba4 = 0.0f; + field_0x33a0 = 0.0f; + field_0x2fcc = 0; + + field_0x32a0[0].r = 0; + field_0x32a0[0].g = 0; + field_0x32a0[0].b = 0; + field_0x32a0[1].r = 0; + field_0x32a0[1].g = 0; + field_0x32a0[1].b = 0; + + field_0x2fc4 = 0; + mHotspringRecoverTimer = daAlinkHIO_basic_c0::m.mHotspringRecoverTime; + field_0x2fc9 = 0x10; + + for (; i < 4; i++) { + clearFirePointDamageEffect(i); + } + + field_0x30d0 = 0; + field_0x30d2 = 0; + field_0x2fc3 = 10; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -12,8 +110,148 @@ asm void daAlink_c::changeCommon() { #include "asm/d/a/d_a_alink/changeCommon__9daAlink_cFv.s" } #pragma pop +#endif /* 80126928-80126F3C 121268 0614+00 2/2 0/0 0/0 .text changeWolf__9daAlink_cFv */ +// small regalloc, equivalent? +#ifdef NONMATCHING +void daAlink_c::changeWolf() { + JKRHeap* current_heap = mAnmHeap3.setAnimeHeap(); + + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_wArcName, 14); + mpLinkModel = initModel(modelData, 0x80000, 0x20200); + + J3DModelData* chainModelData = (J3DModelData*)dComIfG_getObjectRes(l_wArcName, 15); + for (u16 i = 0; i < 4; i++) { + mpWlChainModels[i] = initModel(chainModelData, 0x80000, 0); + } + + J3DModelData* midnaModelData = (J3DModelData*)dComIfG_getObjectRes(l_wArcName, 10); + mpWlMidnaModel = initModel(midnaModelData, 0, 0x1020200); + + J3DModelData* midnaMaskModelData = (J3DModelData*)dComIfG_getObjectRes(l_wArcName, 7); + mpWlMidnaMaskModel = initModel(midnaMaskModelData, 0x80000, 0x1000000); + + J3DModelData* midnaHandModelData = (J3DModelData*)dComIfG_getObjectRes(l_wArcName, 6); + mpWlMidnaHandModel = initModel(midnaHandModelData, 0x80000, 0x1000000); + + J3DModelData* midnaHairModelData = (J3DModelData*)dComIfG_getObjectRes(l_wArcName, 11); + mpWlMidnaHairModel = initModel(midnaHairModelData, 0, 0x1000000); + + mpDMidnaBrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_wArcName, 18); + mpDMidnaBrk->searchUpdateMaterialID(mpWlMidnaModel->getModelData()); + mpWlMidnaModel->getModelData()->entryTevRegAnimator(mpDMidnaBrk); + mpDMidnaBrk->setFrame(1.0f); + + mpDMidnaMaskBrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_wArcName, 21); + mpDMidnaMaskBrk->searchUpdateMaterialID(mpWlMidnaMaskModel->getModelData()); + mpWlMidnaMaskModel->getModelData()->entryTevRegAnimator(mpDMidnaMaskBrk); + mpDMidnaMaskBrk->setFrame(1.0f); + + mpDMidnaHandBrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_wArcName, 20); + mpDMidnaHandBrk->searchUpdateMaterialID(mpWlMidnaHandModel->getModelData()); + mpWlMidnaHandModel->getModelData()->entryTevRegAnimator(mpDMidnaHandBrk); + mpDMidnaHandBrk->setFrame(1.0f); + + mpDMidnaHairHandBrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_wArcName, 19); + mpDMidnaHairHandBrk->searchUpdateMaterialID(mpWlMidnaHairModel->getModelData()); + mpWlMidnaHairModel->getModelData()->entryTevRegAnimator(mpDMidnaHairHandBrk); + mpDMidnaHairHandBrk->setFrame(1.0f); + + mDoExt_setCurrentHeap(current_heap); + + dComIfGs_setTransformStatus(1); + mpLinkModel->setUserArea((u32)this); + changeModelDataDirectWolf(0); + mEyeHL1.entry(field_0x064C, "wl_eye_Hilight"); + mEyeHL2.entry(mpWlMidnaModel->getModelData(), "midona_eye_Hlight"); + field_0x064C->getMaterialNodePointer(4)->setMaterialAnm(field_0x2180[0]); + field_0x064C->getMaterialNodePointer(5)->setMaterialAnm(field_0x2180[1]); + field_0x06e8 = field_0x064C->getMaterialNodePointer(1)->getShape(); + + changeCommon(); + i_onNoResetFlg1(FLG1_IS_WOLF); + deleteEquipItem(FALSE, FALSE); + field_0x2e44.init(this, l_wolfJntColData, mpLinkModel, 18); + i_offNoResetFlg1(FLG1_UNK_800000); + + field_0x598 = 115.0f; + mLinkAcch.SetRoofCrrHeight(field_0x598); + field_0x594 = daAlinkHIO_wlMove_c0::m.field_0x64; + + l_autoUpHeight = daAlinkHIO_wlWallHang_c0::m.field_0x78 + 0.01f; + l_autoDownHeight = -l_autoUpHeight; + field_0x3470 = cM_scos(cM_deg2s(daAlinkHIO_wlSlide_c0::m.field_0x5C)); + field_0x3122 = cM_deg2s(daAlinkHIO_wlSlide_c0::m.field_0x60); + field_0x3458 = -60.0f; + field_0x345c = -130.0f; + + field_0x2e44.offPassNum(16); + field_0x2e44.offPassNum(15); + + i_offNoResetFlg0(FLG0_UNDERWATER); + setHeavyBoots(0); + + for (int i = 0; i < 3; i++) { + field_0x3094[i] = 0; + field_0x309a[i] = 0; + } + + mZ2Link.i_setLinkState(1); + field_0x30d6 = 0; + field_0x2fa6 = 0; + field_0x2e54.changeWaterOffset(daAlinkHIO_basic_c0::m.mWolfWaterSurfaceEffectHeight); + field_0x2e54.changeRippleOffset(field_0x598); + mWoodSwordModel = NULL; + field_0x3420 = 1.25f; + field_0x30c6 = 40; + field_0x30a8 = 3; + field_0x30aa = 15; + field_0x30ae = 0x1000; + field_0x3424 = 8.0f; + field_0x3428 = 50.0f; + field_0x2f50 = &l_wolfLieSideOffset; + field_0x2f54 = &l_wolfLieTopUpOffset; + m_swordBlur.field_0x14 = 0; + resetAtCollision(0); + field_0x30b8 = 19; + field_0x30ba = 24; + field_0x30c0 = 19; + field_0x30c2 = 24; + field_0x30c4 = 3; + field_0x30b4 = 4; + field_0x30bc = 31; + field_0x30be = 36; + field_0x32c4 = 1; + field_0x32c6 = 2; + field_0x30b6 = 2; + mAttentionInfo.field_0xa = 50; + + dCcD_Cyl* cyl_p = field_0x850; + for (int i = 0; i < 3; i++) { + cyl_p->OffTgShieldFrontRange(); + cyl_p->OffTgSmallShield(); + cyl_p->OffTgSpShield(); + cyl_p->OffTgShield(); + cyl_p++; + } + + field_0xFB8.StartCAt(current.pos); + field_0xFB8.OffAtSetBit(); + field_0xFB8.OnTgSetBit(); + field_0xFB8.OnCoSetBit(); + field_0xFB8.SetR(40.0f); + + mpKanteraModel = NULL; + mpLinkHatModel = NULL; + mpLinkFaceModel = NULL; + mpLinkHandModel = NULL; + mMagicArmorBodyBrk = NULL; + mMagicArmorHeadBrk = NULL; + + field_0x2fc7 = dStage_stagInfo_GetWolfDashType(i_dComIfGp_getStage()->getStagInfo()); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -22,8 +260,289 @@ asm void daAlink_c::changeWolf() { #include "asm/d/a/d_a_alink/changeWolf__9daAlink_cFv.s" } #pragma pop +#endif /* 80126F3C-80127C54 12187C 0D18+00 2/2 0/0 0/0 .text changeLink__9daAlink_cFi */ +// almost, small regalloc +#ifdef NONMATCHING +void daAlink_c::changeLink(int param_0) { + JKRHeap* current_heap = mAnmHeap3.setAnimeHeap(); + i_offNoResetFlg2(0x180000); + mMagicArmorBodyBrk = NULL; + mMagicArmorHeadBrk = NULL; + + if (i_checkNoResetFlg2(FLG2_UNK_200000)) { + i_offNoResetFlg2(FLG2_UNK_200000); + i_onNoResetFlg2(FLG2_UNK_80000); + + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("alSumou", 0x31); + mpLinkModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084); + + J3DModelData* headModelData = (J3DModelData*)dComIfG_getObjectRes("alSumou", 0x33); + mpLinkHatModel = initModel(headModelData, 0); + + J3DModelData* handModelData = (J3DModelData*)dComIfG_getObjectRes("alSumou", 0x32); + mpLinkHandModel = initModel(handModelData, 0); + } else if (checkCasualWearFlg()) { + i_onNoResetFlg2(FLG2_UNK_100000); + + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_bArcName, "bl.bmd"); + mpLinkModel = initModel(modelData, 0); + + J3DModelData* headModelData = + (J3DModelData*)dComIfG_getObjectRes(l_bArcName, "bl_head.bmd"); + mpLinkHatModel = initModel(headModelData, 0); + + J3DModelData* handModelData = + (J3DModelData*)dComIfG_getObjectRes(l_bArcName, "bl_hands.bmd"); + mpLinkHandModel = initModel(handModelData, 0); + } else if (checkZoraWearFlg()) { + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_zArcName, "zl.bmd"); + mpLinkModel = initModel(modelData, 0); + + J3DModelData* headModelData = + (J3DModelData*)dComIfG_getObjectRes(l_zArcName, "zl_head.bmd"); + mpLinkHatModel = initModel(headModelData, 0); + + J3DModelData* handModelData = + (J3DModelData*)dComIfG_getObjectRes(l_zArcName, "al_hands.bmd"); + mpLinkHandModel = initModel(handModelData, 0); + } else if (checkMagicArmorWearFlg()) { + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_mArcName, "ml.bmd"); + mpLinkModel = initModel(modelData, 0x1000000); + + J3DModelData* headModelData = + (J3DModelData*)dComIfG_getObjectRes(l_mArcName, "ml_head.bmd"); + mpLinkHatModel = initModel(headModelData, 0x1000000); + + J3DModelData* handModelData = + (J3DModelData*)dComIfG_getObjectRes(l_mArcName, "al_hands.bmd"); + mpLinkHandModel = initModel(handModelData, 0); + + if (i_dComIfGs_getRupee() != 0) { + setMagicArmorBrk(1); + } else { + setMagicArmorBrk(0); + } + + mMagicArmorBodyBrk->setFrame(mMagicArmorBodyBrk->getFrameMax()); + mMagicArmorHeadBrk->setFrame(mMagicArmorHeadBrk->getFrameMax()); + } else { + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_kArcName, "al.bmd"); + mpLinkModel = initModel(modelData, 0); + + J3DModelData* headModelData = + (J3DModelData*)dComIfG_getObjectRes(l_kArcName, "al_head.bmd"); + mpLinkHatModel = initModel(headModelData, 0); + + J3DModelData* handModelData = + (J3DModelData*)dComIfG_getObjectRes(l_kArcName, "al_hands.bmd"); + mpLinkHandModel = initModel(handModelData, 0); + } + + if (i_checkNoResetFlg2(FLG2_UNK_200000) || !checkZoraWearFlg()) { + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(mArcName, "al_face.bmd"); + mpLinkFaceModel = initModel(modelData, 0x20200); + } else { + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(mArcName, "zl_face.bmd"); + mpLinkFaceModel = initModel(modelData, 0x20200); + } + + J3DModelData* bootsModelData = (J3DModelData*)dComIfG_getObjectRes(mArcName, "al_bootsH.bmd"); + for (u16 i = 0; i < 2; i++) { + mpLinkBootModels[i] = initModel(bootsModelData, 0); + } + + J3DModelData* kanteraModelData = + (J3DModelData*)dComIfG_getObjectRes(mArcName, "al_kantera.bmd"); + mpKanteraModel = initModelEnv(kanteraModelData, 0); + + J3DModelData* kanteraGlowModelData = + (J3DModelData*)dComIfG_getObjectRes(mArcName, "ef_ktGlow.bmd"); + mpKanteraGlowModel = initModel(kanteraGlowModelData, 0x200); + + mpKanteraGlowBtk = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(mArcName, "ef_ktGlow.btk"); + mpKanteraGlowBtk->setFrame(0.0f); + mpKanteraGlowBtk->searchUpdateMaterialID(kanteraGlowModelData); + kanteraGlowModelData->entryTexMtxAnimator(mpKanteraGlowBtk); + + J3DModelData* woodSwordModelData = (J3DModelData*)dComIfG_getObjectRes(mArcName, "al_SWB.bmd"); + mWoodSwordModel = initModel(woodSwordModelData, 0); + + mDoExt_setCurrentHeap(current_heap); + + dComIfGs_setTransformStatus(0); + mpLinkModel->setUserArea((u32)this); + mpLinkHatModel->setUserArea((u32)this); + changeModelDataDirect(param_0); + field_0x06e4 = NULL; + + u8 var_r27; + if (i_checkNoResetFlg2(FLG2_UNK_80000)) { + field_0x06d8 = field_0x064C->getMaterialNodePointer(4)->getShape(); + field_0x06dc = field_0x064C->getMaterialNodePointer(5)->getShape(); + field_0x06e0 = NULL; + field_0x06e8 = field_0x064C->getMaterialNodePointer(3)->getShape(); + field_0x06ec = NULL; + field_0x06f0 = field_0x064C->getMaterialNodePointer(2)->getShape(); + var_r27 = 2; + } else if (checkCasualWearFlg()) { + field_0x06d8 = field_0x064C->getMaterialNodePointer(3)->getShape(); + field_0x06dc = field_0x064C->getMaterialNodePointer(4)->getShape(); + field_0x06e0 = NULL; + field_0x06e8 = field_0x064C->getMaterialNodePointer(2)->getShape(); + field_0x06ec = field_0x064C->getMaterialNodePointer(0)->getShape(); + field_0x06f0 = field_0x064C->getMaterialNodePointer(1)->getShape(); + var_r27 = 2; + } else if (checkZoraWearFlg()) { + field_0x06d8 = field_0x064C->getMaterialNodePointer(4)->getShape(); + field_0x06dc = field_0x064C->getMaterialNodePointer(5)->getShape(); + field_0x06e0 = field_0x064C->getMaterialNodePointer(8)->getShape(); + field_0x06e4 = field_0x064C->getMaterialNodePointer(9)->getShape(); + field_0x06e4->hide(); + field_0x06e8 = NULL; + field_0x06ec = field_0x064C->getMaterialNodePointer(2)->getShape(); + field_0x06f0 = field_0x064C->getMaterialNodePointer(11)->getShape(); + var_r27 = 3; + } else if (checkMagicArmorWearFlg()) { + field_0x06d8 = field_0x064C->getMaterialNodePointer(4)->getShape(); + field_0x06dc = field_0x064C->getMaterialNodePointer(5)->getShape(); + field_0x06e0 = field_0x064C->getMaterialNodePointer(10)->getShape(); + field_0x06e8 = field_0x064C->getMaterialNodePointer(3)->getShape(); + field_0x06ec = field_0x064C->getMaterialNodePointer(1)->getShape(); + field_0x06f0 = field_0x064C->getMaterialNodePointer(2)->getShape(); + + if (i_dComIfGs_getRupee() != 0) { + var_r27 = 4; + } else { + var_r27 = 5; + } + } else { + field_0x064C->getMaterialNodePointer(16)->getShape()->hide(); + field_0x06d8 = field_0x064C->getMaterialNodePointer(11)->getShape(); + field_0x06dc = field_0x064C->getMaterialNodePointer(12)->getShape(); + field_0x06e0 = field_0x064C->getMaterialNodePointer(6)->getShape(); + field_0x06e8 = field_0x064C->getMaterialNodePointer(8)->getShape(); + field_0x06ec = field_0x064C->getMaterialNodePointer(4)->getShape(); + field_0x06f0 = field_0x064C->getMaterialNodePointer(7)->getShape(); + var_r27 = 0; + } + + if (field_0x06e0 != NULL) { + if (i_checkEquipHeavyBoots()) { + field_0x06e0->hide(); + } else { + field_0x06e0->show(); + + if (checkZoraWearMaskDraw()) { + field_0x06e4->show(); + } + } + } + + field_0x06d0 = field_0x06d8; + field_0x06d4 = field_0x06dc; + + J3DModelData* hand_modeldata = mpLinkHandModel->getModelData(); + for (u16 i = 0; i < 11; i++) { + hand_modeldata->getMaterialNodePointer(i)->getShape()->hide(); + } + + J3DModelData* face_modeldata = mpLinkFaceModel->getModelData(); + face_modeldata->getMaterialNodePointer(2)->setMaterialAnm(field_0x2180[0]); + face_modeldata->getMaterialNodePointer(3)->setMaterialAnm(field_0x2180[1]); + mEyeHL1.entry(face_modeldata, "highlight02"); + + mpKanteraModel->setUserArea((u32)this); + mpKanteraModel->getModelData()->getJointNodePointer(1)->setCallBack( + daAlink_kandelaarModelCallBack); + mZ2Link.i_setLinkState(var_r27); + + if (checkHookshotReadyMaterialOffMode()) { + setHookshotReadyMaterial(); + } + + if (param_0) { + fopAcM_SetMtx(this, mpLinkModel->getBaseTRMtx()); + model = mpLinkModel; + field_0x2060->offOldFrameFlg(); + } else { + changeCommon(); + i_offNoResetFlg1(FLG1_IS_WOLF); + field_0x2e44.init(this, l_jntColData, mpLinkModel, 18); + field_0x3088 = 0; + field_0x302c[7] = -0x3800; + field_0x3060 = 0; + field_0x3062 = shape_angle.y; + + field_0x598 = 180.0f; + mLinkAcch.SetRoofCrrHeight(field_0x598); + field_0x594 = daAlinkHIO_move_c0::m.mMaxSpeed; + + l_autoUpHeight = daAlinkHIO_wallHang_c0::m.field_0x4 + 0.01f; + l_autoDownHeight = -l_autoUpHeight; + field_0x3470 = cM_scos(cM_deg2s(daAlinkHIO_slide_c0::m.mSlideAngle)); + field_0x3122 = cM_deg2s(daAlinkHIO_slide_c0::m.mClimbAngle); + field_0x3458 = -120.0f; + field_0x345c = -200.0f; + + field_0x2e54.changeWaterOffset(daAlinkHIO_basic_c0::m.mWaterSurfaceEffectHeight); + field_0x2e54.changeRippleOffset(field_0x598); + offWolfEyeUp(); + + field_0x3420 = 1.0f; + field_0x30c6 = 35; + field_0x30a8 = 1; + field_0x30aa = 16; + field_0x30ae = 0x2000; + field_0x3424 = 4.0f; + field_0x3428 = 35.0f; + field_0x2f50 = &l_crawlSideOffset; + field_0x2f54 = &l_crawlTopUpOffset; + + resetWolfAtCollision(); + resetWolfBallGrab(); + deleteEquipItem(FALSE, FALSE); + field_0x2fb0 = 0; + + for (int i = 0; i < 10; i++) { + mWolfLockAcKeep[i].clearData(); + } + + mWolfLockNum = 0; + field_0x30b8 = 9; + field_0x30ba = 14; + field_0x30c0 = 10; + field_0x30c2 = 15; + field_0x30c4 = 3; + field_0x30b4 = 4; + field_0x30bc = 21; + field_0x30be = 26; + field_0x30b6 = 5; + field_0x32c4 = 2; + field_0x32c6 = 16; + mAttentionInfo.field_0xa = 10; + + dCcD_Cyl* cyl_p = field_0x850; + for (int i = 0; i < 3; i++) { + cyl_p->OnTgShieldFrontRange(); + cyl_p->OnTgSmallShield(); + cyl_p++; + } + + mMagneBootsTopVec = cXyz::BaseY; + + field_0xFB8.OnAtSetBit(); + field_0xFB8.OffTgSetBit(); + field_0xFB8.OffCoSetBit(); + + mpWlMidnaModel = NULL; + mpWlMidnaMaskModel = NULL; + mpWlMidnaHandModel = NULL; + mpWlMidnaHairModel = NULL; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -32,6 +551,7 @@ asm void daAlink_c::changeLink(int param_0) { #include "asm/d/a/d_a_alink/changeLink__9daAlink_cFi.s" } #pragma pop +#endif /* 80127C54-80127CAC 122594 0058+00 2/2 0/0 0/0 .text onWolfEyeUp__9daAlink_cFv */ void daAlink_c::onWolfEyeUp() { @@ -76,7 +596,7 @@ void daAlink_c::setWolfDigStatus(u8 flag) { BOOL daAlink_c::checkWolfShapeReverse() const { return ((mProcID == PROC_WOLF_SLIDE_READY || mProcID == PROC_WOLF_LOCK_ATTACK_TURN || mProcID == PROC_WOLF_JUMP_AT_SLIDE_LAND) && - field_0x300c != 0) || + mProcVar2.field_0x300c != 0) || mProcID == PROC_WOLF_SLIP_TURN_LAND || (mProcID == PROC_WOLF_LARGE_DAMAGE_UP && field_0x3198 != 0) || mProcID == PROC_WOLF_ROPE_TURN; @@ -106,6 +626,140 @@ BOOL daAlink_c::checkWolfSlowDash() { /* 80127F50-80128478 122890 0528+00 1/1 0/0 0/0 .text setSpeedAndAngleWolf__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +void daAlink_c::setSpeedAndAngleWolf() { + f32 var_f31 = 0.0f; + + f32 var_f30; + f32 var_f29; + s16 var_r30; + s16 var_r29; + s16 var_r28; + if (checkWolfDashMode()) { + var_r30 = daAlinkHIO_wlMove_c0::m.field_0x54; + var_r29 = daAlinkHIO_wlMove_c0::m.field_0x50; + var_r28 = daAlinkHIO_wlMove_c0::m.field_0x52; + if (checkWolfSlowDash()) { + var_f30 = daAlinkHIO_wlMove_c0::m.field_0xEC; + } else if (field_0x2fc7 == 2) { + var_f30 = daAlinkHIO_wlMove_c0::m.field_0xFC; + } else { + var_f30 = daAlinkHIO_wlMove_c0::m.field_0xD0; + } + var_f29 = daAlinkHIO_wlMove_c0::m.field_0x6C; + } else { + var_r30 = daAlinkHIO_wlMoveNoP_c0::m.field_0x4; + var_r29 = daAlinkHIO_wlMoveNoP_c0::m.field_0x0; + var_r28 = daAlinkHIO_wlMoveNoP_c0::m.field_0x2; + var_f30 = daAlinkHIO_wlMoveNoP_c0::m.field_0xC; + var_f29 = daAlinkHIO_wlMoveNoP_c0::m.field_0x10; + } + + BOOL temp_r31 = checkEventRun(); + if (checkInputOnR()) { + s16 temp_r4 = current.angle.y; + BOOL var_r26 = 0; + f32 temp_f28 = field_0x33a8 * field_0x33a8; + f32 temp_f27 = speedF / field_0x594; + + if (cLib_distanceAngleS(field_0x2fe2, current.angle.y) > 0x7000 && + abs(field_0x3180) < 0x5000 && + ((!i_checkModeFlg(1) && !(speedF < 0.001f)) || field_0x33a8 > 0.85f)) + { + if ((i_checkModeFlg(1) || speedF < 0.001f) && !temp_r31 && + (mProcID == PROC_WOLF_WAIT || mProcID == PROC_WOLF_MOVE)) + { + cLib_addCalcAngleS(¤t.angle.y, field_0x2fe2, var_r30, var_r29, var_r28); + if (mProcID == PROC_WOLF_MOVE && temp_f27 > 0.85f) { + var_r26 = 1; + } + } else if (mProcID == PROC_WOLF_MOVE && + ((checkWolfDashMode() && temp_f27 > daAlinkHIO_wlMove_c0::m.field_0xA0) || + (!checkWolfDashMode() && temp_f27 > daAlinkHIO_wlMoveNoP_c0::m.field_0x38))) + { + return; + } else { + cLib_addCalcAngleS(¤t.angle.y, field_0x2fe2, var_r30, var_r29, var_r28); + if (mProcID == PROC_WOLF_MOVE && temp_f27 > 0.85f) { + var_r26 = 1; + } + } + } else { + s16 var_r6; + s16 var_r7; + if (temp_r31 != 0) { + var_r6 = var_r29; + var_r7 = var_r28; + } else { + var_r6 = var_r29 * temp_f28; + if (var_r6 < 10) { + var_r6 = 10; + } + + var_r7 = var_r28 * temp_f28; + if (var_r7 < 1) { + var_r7 = 1; + } + } + + cLib_addCalcAngleS(¤t.angle.y, field_0x2fe2, var_r30, var_r6, var_r7); + } + + if (wolfSideBgCheck(temp_r4)) { + current.angle.y = temp_r4; + i_onEndResetFlg1(ERFLG1_UNK_200000); + + if (cLib_distanceAngleS(field_0x2fe2, current.angle.y) > 0x7000) { + var_r26 = 1; + } + } + + if (!var_r26) { + f32 temp_f27_2 = getStickAngleDistanceRate(); + if (temp_r31) { + var_f31 = temp_f27_2 * (var_f30 * field_0x33a8); + } else { + f32 var_f26 = (1.0f - fabsf(mNormalSpeed / field_0x594)) * 0.3f; + if (checkHeavyStateOn(1, 1) != 0) { + var_f26 *= mHeavySpeedMultiplier; + } + + if ((!i_checkNoResetFlg1(FLG1_UNK_20000000) || + cLib_distanceAngleS(current.angle.y + 0x8000, field_0x3092) >= 0xC00) && + field_0x33a8 > var_f26) + { + var_f31 = temp_f27_2 * (var_f30 * temp_f28); + } + } + } + } + + if (checkInputOnR() || (mProcID == PROC_WOLF_ROLL_ATTACK_MOVE)) { + s16 temp_r26 = shape_angle.y; + s16 var_r4; + if (checkWolfShapeReverse()) { + var_r4 = field_0x2fe2 + 0x8000; + } else { + var_r4 = field_0x2fe2; + } + + cLib_addCalcAngleS(&shape_angle.y, var_r4, var_r30, var_r29 * 2, var_r28 * 2); + + int temp_r3 = (s16)(temp_r26 - current.angle.y) * (s16)(shape_angle.y - current.angle.y); + if (temp_r3 <= 0 && temp_r3 >= -0x1000000) { + shape_angle.y = current.angle.y; + } + } else if (temp_r31 == 0 && !checkInputOnR() && checkAttentionState() && + mProcID == PROC_WOLF_WAIT) + { + cLib_addCalcAngleS(&shape_angle.y, field_0x2fe4, 2, 0x2000, 0x800); + current.angle.y = shape_angle.y; + } + + setNormalSpeedF(var_f31, var_f29); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -114,6 +768,7 @@ asm void daAlink_c::setSpeedAndAngleWolf() { #include "asm/d/a/d_a_alink/setSpeedAndAngleWolf__9daAlink_cFv.s" } #pragma pop +#endif /* 80128478-80128798 122DB8 0320+00 2/2 0/0 0/0 .text setSpeedAndAngleWolfAtn__9daAlink_cFv */ #pragma push @@ -222,7 +877,8 @@ void daAlink_c::setSingleAnimeWolfBaseMorf(daAlink_c::daAlink_WANM i_anmID, f32 /* 801296D8-80129704 124018 002C+00 44/44 0/0 0/0 .text * setSingleAnimeWolfBaseSpeed__9daAlink_cFQ29daAlink_c12daAlink_WANMff */ -void daAlink_c::setSingleAnimeWolfBaseSpeed(daAlink_c::daAlink_WANM i_anmID, f32 i_speed, f32 i_morf) { +void daAlink_c::setSingleAnimeWolfBaseSpeed(daAlink_c::daAlink_WANM i_anmID, f32 i_speed, + f32 i_morf) { setSingleAnimeWolf(i_anmID, i_speed, FLOAT_LABEL(lit_6108), -1, i_morf); } @@ -242,7 +898,8 @@ asm void daAlink_c::setSingleAnimeWolf(daAlink_c::daAlink_WANM i_anmID, f32 i_sp * setSingleAnimeWolfParam__9daAlink_cFQ29daAlink_c12daAlink_WANMPC16daAlinkHIO_anm_c */ void daAlink_c::setSingleAnimeWolfParam(daAlink_c::daAlink_WANM i_anmID, daAlinkHIO_anm_c const* i_anmData) { - setSingleAnimeWolf(i_anmID, i_anmData->mSpeed, i_anmData->mStartFrame, i_anmData->mEndFrame, i_anmData->mInterpolation); + setSingleAnimeWolf(i_anmID, i_anmData->mSpeed, i_anmData->mStartFrame, i_anmData->mEndFrame, + i_anmData->mInterpolation); } /* 8012987C-80129958 1241BC 00DC+00 5/5 0/0 0/0 .text checkWolfLandAction__9daAlink_cFi @@ -290,7 +947,8 @@ void daAlink_c::checkWolfUseAbility() { } else { // event flag 0x4308: senses ability unlocked if (i_dComIfGs_isEventBit(0x4308) && field_0x2fd2 == 0 && !checkEventRun() && - mWolfEyeUp < daAlinkHIO_wolf_c0::m.mSensesLingerTime && wolfSenseTrigger()) { + mWolfEyeUp < daAlinkHIO_wolf_c0::m.mSensesLingerTime && wolfSenseTrigger()) + { if (mWolfEyeUp == 0) { onWolfEyeUp(); } else { @@ -304,7 +962,8 @@ void daAlink_c::checkWolfUseAbility() { */ int daAlink_c::checkWolfGroundSpecialMode() { if (mLinkAcch.ChkGroundHit() && !i_checkModeFlg(MODE_PLAYER_FLY) && - i_checkEndResetFlg0(ERFLG0_UNK_1)) { + i_checkEndResetFlg0(ERFLG0_UNK_1)) + { return procCoMetamorphoseInit(); } else if (mSpecialMode == SMODE_WOLF_PUZZLE || mSpecialMode == 0x28) { return procWolfGiantPuzzleInit(); @@ -320,6 +979,128 @@ int daAlink_c::checkWolfGroundSpecialMode() { /* 80129B44-8012A02C 124484 04E8+00 46/46 0/0 0/0 .text checkNextActionWolf__9daAlink_cFi */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::checkNextActionWolf(int param_0) { + if (checkDeadAction(1)) { + return 1; + } + + if (i_checkEndResetFlg1(ERFLG1_UNK_40) && + (mProcID == PROC_WOLF_WAIT || mProcID == PROC_WOLF_SERVICE_WAIT || + mProcID == PROC_WOLF_TIRED_WAIT || (!checkInputOnR() && mProcID == PROC_WOLF_MOVE) || + mProcID == PROC_WOLF_LIE_START || mProcID == PROC_WOLF_LIE_MOVE || + mProcID == PROC_WOLF_ATN_AC_MOVE)) + { + return procWolfMidnaRideShockInit(); + } + + if ((!checkAttentionState() || + (mProcID != PROC_WOLF_WAIT_ATTACK && mProcID != PROC_WOLF_JUMP_AT_NORMAL_LAND)) && + ((mProcID != PROC_WOLF_WAIT_SLIP && !param_0) || checkInputOnR())) + { + if (checkAttentionState()) { + setSpeedAndAngleWolfAtn(); + } else { + setSpeedAndAngleWolf(); + } + } + + setFrontWallType(); + + if (checkSlope()) { + if (checkWolfDashMode()) { + field_0x594 = daAlinkHIO_wlSlide_c0::m.field_0x68; + } else { + field_0x594 = daAlinkHIO_wlSlide_c0::m.field_0x70; + } + } else if (i_checkFmChainGrabAnime()) { + field_0x594 = 13.0f; + } else if (mTargetedActor != NULL) { + field_0x594 = daAlinkHIO_wlAtnMove_c0::m.field_0x18; + } else if (checkAttentionState()) { + field_0x594 = daAlinkHIO_wlMove_c0::m.field_0xB4; + } else if (i_checkNoResetFlg1(FLG1_DASH_MODE)) { + if (checkWolfSlowDash()) { + field_0x594 = daAlinkHIO_wlMove_c0::m.field_0xE0; + } else if (field_0x2fc7 == 2) { + field_0x594 = daAlinkHIO_wlMove_c0::m.field_0xF0; + } else { + field_0x594 = daAlinkHIO_wlMove_c0::m.field_0xC8; + } + } else if (checkWolfDashMode()) { + field_0x594 = daAlinkHIO_wlMove_c0::m.field_0x64; + } else { + field_0x594 = daAlinkHIO_wlMoveNoP_c0::m.field_0x8; + } + + if (checkWolfGroundSpecialMode()) { + return 1; + } + + if (checkWolfLieContinue(0)) { + return procWolfLieStartInit(0); + } + + if (checkNextActionFromButton()) { + return 1; + } + + fopAc_ac_c* var_r4 = checkWolfRopeHit(&field_0x850[0], field_0x850[0].GetCP(), FALSE); + if (var_r4 == NULL) { + var_r4 = checkWolfRopeHit(&field_0x850[1], ¤t.pos, FALSE); + } + + if (var_r4 != NULL) { + field_0x280c.setData(var_r4); + return procWolfRopeMoveInit(0, 1); + } + + if (param_0 && !checkInputOnR()) { + return 0; + } + + BOOL var_r30; + if (!checkInputOnR() && mProcID == PROC_WOLF_WAIT_SLIP && checkWolfWaitSlipPolygon()) { + var_r30 = 0; + } else if (checkAttentionState()) { + var_r30 = procWolfAtnActorMoveInit(); + } else { + field_0x2f98 = 4; + + if (checkZeroSpeedF()) { + if (!checkEventRun() && field_0x33a8 > 0.85f && abs(field_0x3180) < 0x5000 && + (mProcID == PROC_WOLF_WAIT || mProcID == PROC_WOLF_MOVE) && + cLib_distanceAngleS(field_0x2fe2, current.angle.y) > 0x7000) + { + if (i_checkEndResetFlg1(ERFLG1_UNK_200000)) { + var_r30 = procWolfSlipTurnInit(0); + } else { + var_r30 = 0; + } + + if (var_r30 == 0 && !checkEventRun()) { + var_r30 = checkWaitAction(); + } + } else { + var_r30 = checkWaitAction(); + } + } else if (checkInputOnR() && field_0x2fa8 != 8 && abs(field_0x3180) < 0x5000 && + cLib_distanceAngleS(field_0x2fe2, current.angle.y) > 0x7000 && + ((checkWolfDashMode() && + speedF / field_0x594 > daAlinkHIO_wlMove_c0::m.field_0xA0) || + (!checkWolfDashMode() && + speedF / field_0x594 > daAlinkHIO_wlMoveNoP_c0::m.field_0x38))) + { + var_r30 = procWolfSlipInit(); + } else { + var_r30 = procWolfMoveInit(); + } + } + + return var_r30; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -328,31 +1109,95 @@ asm int daAlink_c::checkNextActionWolf(int param_0) { #include "asm/d/a/d_a_alink/checkNextActionWolf__9daAlink_cFi.s" } #pragma pop +#endif /* 8012A02C-8012A228 12496C 01FC+00 3/3 0/0 0/0 .text wolfSideBgCheck__9daAlink_cFs */ +// matches with literals +#ifdef NONMATCHING +BOOL daAlink_c::wolfSideBgCheck(s16 param_0) { + s16 var_r31 = current.angle.y - param_0; + if (var_r31 == 0) { + return 0; + } + + f32 temp_f31 = cM_scos(param_0); + f32 temp_f30 = cM_ssin(param_0); + f32 temp_f29 = cM_scos(current.angle.y); + f32 temp_f28 = cM_ssin(current.angle.y); + + cXyz sp14(current.pos.x + temp_f30 * 90.0f, current.pos.y + field_0x18B0[2].GetWallH(), + current.pos.z + temp_f31 * 90.0f); + cXyz sp8(current.pos.x + temp_f28 * 90.0f, sp14.y, current.pos.z + temp_f29 * 90.0f); + + if (var_r31 > 0) { + sp8.x += temp_f29 * 35.0f; + sp8.z -= temp_f28 * 35.0f; + } else { + sp8.x -= temp_f29 * 35.0f; + sp8.z += temp_f28 * 35.0f; + } + + if (commonLineCheck(&sp14, &sp8)) { + sp14.x = current.pos.x - temp_f30 * 50.0f; + sp14.z = current.pos.z - temp_f31 * 50.0f; + sp8.x = current.pos.x - temp_f28 * 50.0f; + sp8.z = current.pos.z - temp_f29 * 50.0f; + + if (var_r31 > 0) { + sp8.x -= temp_f29 * 35.0f; + sp8.z += temp_f28 * 35.0f; + } else { + sp8.x += temp_f29 * 35.0f; + sp8.z -= temp_f28 * 35.0f; + } + + if (commonLineCheck(&sp14, &sp8)) { + return true; + } + } + + return false; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daAlink_c::wolfSideBgCheck(s16 param_0) { +asm BOOL daAlink_c::wolfSideBgCheck(s16 param_0) { nofralloc #include "asm/d/a/d_a_alink/wolfSideBgCheck__9daAlink_cFs.s" } #pragma pop +#endif /* 8012A228-8012A330 124B68 0108+00 4/4 0/0 0/0 .text checkWolfAttackReverse__9daAlink_cFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daAlink_c::checkWolfAttackReverse(int param_0) { - nofralloc -#include "asm/d/a/d_a_alink/checkWolfAttackReverse__9daAlink_cFi.s" +BOOL daAlink_c::checkWolfAttackReverse(int param_0) { + if (mProcID != PROC_WOLF_LOCK_ATTACK && checkAtShieldHit(mAtCyl)) { + return procWolfAttackReverseInit(); + } + + if ((i_checkNoResetFlg0(FLG0_UNK_18) && mProcID == PROC_WOLF_DASH) || + (param_0 && !i_checkNoResetFlg3(FLG3_UNK_400) && i_checkNoResetFlg1(FLG1_UNK_20000000) && + cLib_distanceAngleS(field_0x3092, current.angle.y) > 0x6000)) + { + if (mProcID == PROC_WOLF_DASH) { + return procWolfDashReverseInit(0); + } else { + if (i_checkNoResetFlg3(FLG3_UNK_800000)) { + i_dComIfGp_setHitMark(2, NULL, &field_0x378c, &field_0x3166, NULL, 0); + } + + return procWolfAttackReverseInit(); + } + } + + return false; } -#pragma pop /* 8012A330-8012A41C 124C70 00EC+00 1/1 0/0 0/0 .text checkWolfBarrierHitReverse__9daAlink_cFv */ int daAlink_c::checkWolfBarrierHitReverse() { if (field_0x3100 != 0 && mProcID != PROC_FRONT_ROLL_SUCCESS && mProcID != PROC_DAMAGE && - mProcID != PROC_WOLF_ATTACK_REVERSE && mProcID != PROC_WOLF_DASH_REVERSE) { + mProcID != PROC_WOLF_ATTACK_REVERSE && mProcID != PROC_WOLF_DASH_REVERSE) + { if (i_checkWolf()) { return procWolfDashReverseInit(1); } else if (mLinkAcch.ChkGroundHit()) { @@ -448,7 +1293,7 @@ asm BOOL daAlink_c::checkWolfWaitSlipPolygon() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daAlink_c::setWolfWaitSlip() { +asm f32 daAlink_c::setWolfWaitSlip() { nofralloc #include "asm/d/a/d_a_alink/setWolfWaitSlip__9daAlink_cFv.s" } @@ -497,6 +1342,44 @@ asm void daAlink_c::setWolfAnmVoice() { #endif /* 8012CBE4-8012CD28 127524 0144+00 4/4 0/0 0/0 .text procWolfServiceWaitInit__9daAlink_cFi */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfServiceWaitInit(int param_0) { + commonProcInit(PROC_WOLF_SERVICE_WAIT); + mProcVar3.field_0x300e.z = 0; + + if (param_0 == 2) { + setSingleAnimeWolfBase(WANM_SERVICE_WAIT_D); + field_0x3198 = 0; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.z = 1; + } else if (param_0 == 1) { + if (cM_rnd() < 0.5f) { + setSingleAnimeWolfBase(WANM_SERVICE_WAIT_A); + setFaceBasicTexture(FTANM_UNK_8D); + field_0x3198 = 0; + mProcVar2.field_0x300c = 0; + } else { + setSingleAnimeWolf(WANM_SIT, 1.0f, daAlinkHIO_wlLie_c0::m.field_0x0.mStartFrame, + daAlinkHIO_wlLie_c0::m.field_0x0.mEndFrame, + daAlinkHIO_wlLie_c0::m.field_0x0.mInterpolation); + field_0x3198 = 0; + mProcVar2.field_0x300c = 1; + } + } else { + setSingleAnimeWolfBase(WANM_WAIT_A_TO_S); + field_0x3198 = 0; + mProcVar2.field_0x300c = 0; + } + + mProcVar3.field_0x300e.y = 0; + mProcVar0.field_0x3008 = cM_rndF(150.0f) + 150.0f; + mNormalSpeed = 0.0f; + current.angle.y = shape_angle.y; + field_0x2f98 = 4; + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -505,6 +1388,7 @@ asm int daAlink_c::procWolfServiceWaitInit(int param_0) { #include "asm/d/a/d_a_alink/procWolfServiceWaitInit__9daAlink_cFi.s" } #pragma pop +#endif /* 8012CD28-8012CF68 127668 0240+00 1/0 0/0 0/0 .text procWolfServiceWait__9daAlink_cFv */ @@ -583,14 +1467,29 @@ int daAlink_c::procWolfMidnaRideShock() { } /* 8012D1A8-8012D2A8 127AE8 0100+00 13/13 0/0 0/0 .text procWolfWaitInit__9daAlink_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfWaitInit() { - nofralloc -#include "asm/d/a/d_a_alink/procWolfWaitInit__9daAlink_cFv.s" +int daAlink_c::procWolfWaitInit() { + if (checkWolfWaitSlipPolygon() && !checkInputOnR()) { + return procWolfWaitSlipInit(); + } + + if (mProcID == PROC_WOLF_WAIT) { + return 0; + } + + if (mProcID == PROC_WOLF_SERVICE_WAIT && (!checkEventRun() || mProcVar3.field_0x300e.z != 0) && + (field_0x3198 == 0 || !checkAnmEnd(mUnderFrameCtrl)) && checkNoUpperAnime()) + { + return 0; + } + + commonProcInit(PROC_WOLF_WAIT); + setBlendWolfMoveAnime(daAlinkHIO_wlMove_c0::m.field_0xBC); + current.angle.y = shape_angle.y; + field_0x2f98 = 4; + mNormalSpeed = FLOAT_LABEL(lit_6108); + initServiceWaitTime(); + return 1; } -#pragma pop /* 8012D2A8-8012D380 127BE8 00D8+00 1/0 0/0 0/0 .text procWolfWait__9daAlink_cFv */ // matches with literals @@ -604,7 +1503,7 @@ int daAlink_c::procWolfWait() { if (checkServiceWaitMode()) { field_0x30ca--; - + if (field_0x30ca == 0) { procWolfServiceWaitInit(0); } @@ -641,7 +1540,7 @@ int daAlink_c::procWolfMoveInit() { /* 8012D3E4-8012D474 127D24 0090+00 1/0 0/0 0/0 .text procWolfMove__9daAlink_cFv */ int daAlink_c::procWolfMove() { if (!checkNextActionWolf(0) && !checkFrontWallTypeAction()) { - if (mDemo.getDemoMode() == 2) { + if (mDemo.getDemoMode() == 2) { if (mNormalSpeed > field_0x594 * daAlinkHIO_wlMoveNoP_c0::m.field_0x28) { mNormalSpeed = field_0x594 * daAlinkHIO_wlMoveNoP_c0::m.field_0x28; } @@ -655,26 +1554,163 @@ int daAlink_c::procWolfMove() { } /* 8012D474-8012D590 127DB4 011C+00 1/1 0/0 0/0 .text procWolfDashInit__9daAlink_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfDashInit() { - nofralloc -#include "asm/d/a/d_a_alink/procWolfDashInit__9daAlink_cFv.s" -} -#pragma pop +int daAlink_c::procWolfDashInit() { + commonProcInit(PROC_WOLF_DASH); + setSingleAnimeWolfParam(WANM_DASH_START, &daAlinkHIO_wlMove_c0::m.field_0x28); + setFootEffectProcType(3); + current.angle.y = shape_angle.y; -/* 8012D590-8012D8C0 127ED0 0330+00 1/0 0/0 0/0 .text procWolfDash__9daAlink_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfDash() { - nofralloc -#include "asm/d/a/d_a_alink/procWolfDash__9daAlink_cFv.s" + i_onNoResetFlg1(FLG1_DASH_MODE); + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.x = 0; + + if (checkWolfSlowDash()) { + field_0x30d0 = daAlinkHIO_wlMove_c0::m.field_0x5A; + field_0x594 = daAlinkHIO_wlMove_c0::m.field_0xE0; + + if (mNormalSpeed < daAlinkHIO_wlMove_c0::m.field_0xE4) { + mNormalSpeed = daAlinkHIO_wlMove_c0::m.field_0xE4; + } + } else if (field_0x2fc7 == 2) { + field_0x594 = daAlinkHIO_wlMove_c0::m.field_0xF0; + field_0x594 = daAlinkHIO_wlMove_c0::m.field_0xF0; + + if (mNormalSpeed < daAlinkHIO_wlMove_c0::m.field_0xF4) { + mNormalSpeed = daAlinkHIO_wlMove_c0::m.field_0xF4; + } + } else { + field_0x30d0 = daAlinkHIO_wlMove_c0::m.field_0x56; + field_0x594 = daAlinkHIO_wlMove_c0::m.field_0xC8; + + if (mNormalSpeed < daAlinkHIO_wlMove_c0::m.field_0xD4) { + mNormalSpeed = daAlinkHIO_wlMove_c0::m.field_0xD4; + } + } + + return 1; +} + +/* 8012D590-8012D8C0 127ED0 0330+00 1/0 0/0 0/0 .text procWolfDash__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfDash() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + cM3dGPla poly; + + if (getSlidePolygon(&poly)) { + return checkNextActionWolf(0); + } + + f32 step_amount; + if (checkWolfSlowDash()) { + step_amount = daAlinkHIO_wlMove_c0::m.field_0xEC; + } else if (field_0x2fc7 == 2) { + step_amount = daAlinkHIO_wlMove_c0::m.field_0xFC; + } else { + step_amount = daAlinkHIO_wlMove_c0::m.field_0xD0; + } + cLib_chaseF(&mNormalSpeed, field_0x594, step_amount); + + if (checkInputOnR()) { + cLib_addCalcAngleS(¤t.angle.y, field_0x2fe2, daAlinkHIO_wlMove_c0::m.field_0x54, + daAlinkHIO_wlMove_c0::m.field_0x50, daAlinkHIO_wlMove_c0::m.field_0x52); + shape_angle.y = current.angle.y; + } + + if (frameCtrl_p->getFrame() > 3.0f && checkWolfAttackReverse(1)) { + return 1; + } + + if (swordSwingTrigger()) { + mProcVar3.field_0x300e.x = 1; + } + + if (checkAnmEnd(frameCtrl_p)) { + if (mProcVar3.field_0x300e.x != 0) { + return checkWolfAttackAction(); + } + + if (checkWolfSlowDash()) { + field_0x30d2 = daAlinkHIO_wlMove_c0::m.field_0x5C; + } else if (field_0x2fc7 == 2) { + field_0x30d2 = daAlinkHIO_wlMove_c0::m.field_0x60; + } else { + field_0x30d2 = daAlinkHIO_wlMove_c0::m.field_0x58; + } + + return checkNextActionWolf(0); + } else if (frameCtrl_p->getFrame() > daAlinkHIO_wlMove_c0::m.field_0x28.mCheckFrame) { + if (mProcVar3.field_0x300e.x != 0) { + return checkWolfAttackAction(); + } + + if (checkWolfSlowDash()) { + field_0x30d2 = daAlinkHIO_wlMove_c0::m.field_0x5C; + } else if (field_0x2fc7 == 2) { + field_0x30d2 = daAlinkHIO_wlMove_c0::m.field_0x60; + } else { + field_0x30d2 = daAlinkHIO_wlMove_c0::m.field_0x58; + } + + checkNextActionWolf(1); + return 1; + } else if (frameCtrl_p->checkPass(2.5f) || frameCtrl_p->checkPass(14.0f)) { + field_0x2f9d = 0x60; + i_onResetFlg1(RFLG1_UNK_30); + } else if (frameCtrl_p->checkPass(8.0f) || frameCtrl_p->checkPass(16.5f)) { + field_0x2f9d = 0x18; + i_onResetFlg1(RFLG1_UNK_C); + } + + field_0x30a2 = field_0x2fec; + return 1; +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm int daAlink_c::procWolfDash() { + nofralloc +#include "asm/d/a/d_a_alink/procWolfDash__9daAlink_cFv.s" } #pragma pop +#endif /* 8012D8C0-8012DA5C 128200 019C+00 2/2 0/0 0/0 .text procWolfDashReverseInit__9daAlink_cFi */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfDashReverseInit(int param_0) { + commonProcInit(PROC_WOLF_DASH_REVERSE); + setSingleAnimeWolf(WANM_ATTACK_RECOIL_GROUND, daAlinkHIO_wlMove_c0::m.field_0x3C.mSpeed, + daAlinkHIO_wlMove_c0::m.field_0x3C.mStartFrame, 5, + daAlinkHIO_wlMove_c0::m.field_0x3C.mInterpolation); + + if (param_0) { + current.angle.y = field_0x3102 + 0x8000; + if (cLib_distanceAngleS(current.angle.y, shape_angle.y) > 0x6000) { + mNormalSpeed = 10.0f; + speed.y = 10.0f; + } else { + mNormalSpeed = 20.0f; + speed.y = 15.0f; + } + + mProcVar2.field_0x300c = 1; + } else { + mNormalSpeed = daAlinkHIO_wlMove_c0::m.field_0xD8; + speed.y = daAlinkHIO_wlMove_c0::m.field_0xDC; + current.angle.y += 0x8000; + mProcVar2.field_0x300c = 0; + } + + dComIfGp_getVibration().StartShock(5, 15, cXyz(0.0f, 1.0f, 0.0f)); + dKy_Sound_set(current.pos, 100, fopAcM_GetID(this), 5); + seStartOnlyReverb(Z2SE_WOLF_BODYATTACK); + field_0x3588 = l_wolfBaseAnime; + i_onResetFlg0(RFLG0_FRONT_ROLL_CRASH); + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -683,17 +1719,45 @@ asm int daAlink_c::procWolfDashReverseInit(int param_0) { #include "asm/d/a/d_a_alink/procWolfDashReverseInit__9daAlink_cFi.s" } #pragma pop +#endif /* 8012DA5C-8012DBA8 12839C 014C+00 1/0 0/0 0/0 .text procWolfDashReverse__9daAlink_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfDashReverse() { - nofralloc -#include "asm/d/a/d_a_alink/procWolfDashReverse__9daAlink_cFv.s" +int daAlink_c::procWolfDashReverse() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + + if (mProcVar2.field_0x300c == 0) { + field_0x2f99 = 4; + } + + if (!i_checkModeFlg(0x2)) { + if (checkAnmEnd(frameCtrl_p)) { + checkNextActionWolf(0); + } else if (frameCtrl_p->getFrame() > daAlinkHIO_wlMove_c0::m.field_0x3C.mCheckFrame) { + checkNextActionWolf(1); + } + } else if (mProcVar2.field_0x300c != 0) { + mProcVar2.field_0x300c = 0; + } else if (((mLinkAcch.ChkGroundHit() || i_checkEndResetFlg2(ERFLG2_UNK_100)) && + i_checkModeFlg(0x2))) + { + if (checkWolfLandAction(0)) { + return 1; + } + + mNormalSpeed = FLOAT_LABEL(lit_6108); + frameCtrl_p->setFrame(daAlinkHIO_wlMove_c0::m.field_0x3C.mSpeed + frameCtrl_p->getFrame()); + getNowAnmPackUnder(UNDER_0)->setFrame(frameCtrl_p->getFrame()); + frameCtrl_p->setRate(daAlinkHIO_wlMove_c0::m.field_0x3C.mSpeed); + frameCtrl_p->setEnd(daAlinkHIO_wlMove_c0::m.field_0x3C.mEndFrame); + + current.angle.y = shape_angle.y; + offModeFlg(0x2); + onModeFlg(0x8000); + } + + return 1; } -#pragma pop /* 8012DBA8-8012DC44 1284E8 009C+00 1/1 0/0 0/0 .text procWolfAtnActorMoveInit__9daAlink_cFv */ int daAlink_c::procWolfAtnActorMoveInit() { @@ -707,7 +1771,7 @@ int daAlink_c::procWolfAtnActorMoveInit() { setWolfAtnMoveDirection(); setBlendWolfAtnMoveAnime(daAlinkHIO_wlMove_c0::m.field_0x94); - + if (checkWolfAtnWait()) { voiceStartLevel(Z2SE_WL_V_ROAR); } @@ -732,7 +1796,7 @@ int daAlink_c::procWolfAtnActorMove() { } setBlendWolfAtnMoveAnime(lit_6041); - + if (checkWolfAtnWait()) { voiceStartLevel(Z2SE_WL_V_ROAR); } @@ -748,55 +1812,145 @@ int daAlink_c::procWolfWaitTurnInit() { return 0; } - f32 var_f1; + f32 anm_speed; if (checkWolfDashMode()) { - var_f1 = daAlinkHIO_wlMove_c0::m.field_0x74; + anm_speed = daAlinkHIO_wlMove_c0::m.field_0x74; } else { - var_f1 = daAlinkHIO_wlMoveNoP_c0::m.field_0x18; + anm_speed = daAlinkHIO_wlMoveNoP_c0::m.field_0x18; } - setSingleAnimeWolfBaseSpeed(WANM_WALK_A, var_f1, daAlinkHIO_wlMove_c0::m.field_0x94); + setSingleAnimeWolfBaseSpeed(WANM_WALK_A, anm_speed, daAlinkHIO_wlMove_c0::m.field_0x94); if (checkEventRun()) { mNormalSpeed = FLOAT_LABEL(lit_6108); } - field_0x300e.x = field_0x2fe2; + mProcVar3.field_0x300e.x = field_0x2fe2; current.angle.y = shape_angle.y; - return 1; } /* 8012DDB4-8012DEC8 1286F4 0114+00 1/0 0/0 0/0 .text procWolfWaitTurn__9daAlink_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfWaitTurn() { - nofralloc -#include "asm/d/a/d_a_alink/procWolfWaitTurn__9daAlink_cFv.s" +int daAlink_c::procWolfWaitTurn() { + f32 step_amount; + if (checkWolfDashMode()) { + step_amount = daAlinkHIO_wlMove_c0::m.field_0x6C; + } else { + step_amount = daAlinkHIO_wlMoveNoP_c0::m.field_0x10; + } + cLib_chaseF(&mNormalSpeed, FLOAT_LABEL(lit_6108), step_amount); + + if (checkWolfGroundSpecialMode()) { + return 1; + } + + s16 var_r31 = cLib_addCalcAngleS(&shape_angle.y, mProcVar3.field_0x300e.x, 30, 0x3CDF, 8000); + current.angle.y = shape_angle.y; + + if (checkNextActionFromButton()) { + return 1; + } + + if (var_r31 == 0) { + if (checkEventRun()) { + if (mDemo.getDemoMode() == 5) { + dComIfGp_evmng_cutEnd(field_0x3184); + } else { + checkNextActionWolf(0); + } + } else { + checkNextActionWolf(0); + } + } + + return 1; } -#pragma pop /* 8012DEC8-8012E0AC 128808 01E4+00 2/2 0/0 0/0 .text procWolfSideStepInit__9daAlink_cFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfSideStepInit(int param_0) { - nofralloc -#include "asm/d/a/d_a_alink/procWolfSideStepInit__9daAlink_cFi.s" +int daAlink_c::procWolfSideStepInit(int param_0) { + if (field_0x2f98 == 1 && !param_0 && i_checkFirstMidnaDemo() && !checkWolfGrabAnime() && + field_0x2fcc != 0) + { + return procWolfBackJumpInit(0); + } + + commonProcInit(PROC_WOLF_SIDESTEP); + + if (field_0x2f98 == 0 || param_0) { + field_0x2f98 = 1; + } + + if (field_0x2f98 == 1) { + if (mTargetedActor != NULL) { + mProcVar2.field_0x300c = cLib_targetAngleY(¤t.pos, &mTargetedActor->mEyePos); + } else { + mProcVar2.field_0x300c = shape_angle.y; + } + + current.angle.y = shape_angle.y + 0x8000; + setSingleAnimeWolfParam(WANM_BACK_JUMP_START, &daAlinkHIO_wlSideStep_c0::m.field_0x28); + mNormalSpeed = daAlinkHIO_wlSideStep_c0::m.field_0x58; + speed.y = daAlinkHIO_wlSideStep_c0::m.field_0x5C; + mProcVar1.field_0x300a = 0; + } else { + shape_angle.y = field_0x2fe4; + + daAlink_WANM jump_anm; + if (field_0x2f98 == 2) { + jump_anm = WANM_SIDE_JUMP_LEFT_START; + current.angle.y = shape_angle.y + 0x4000; + } else { + jump_anm = WANM_SIDE_JUMP_RIGHT_START; + current.angle.y = shape_angle.y - 0x4000; + } + + setSingleAnimeWolfParam(jump_anm, &daAlinkHIO_wlSideStep_c0::m.field_0x0); + mNormalSpeed = daAlinkHIO_wlSideStep_c0::m.field_0x50; + speed.y = daAlinkHIO_wlSideStep_c0::m.field_0x54; + mProcVar1.field_0x300a = 1; + } + + mProcVar3.field_0x300e.z = 0; + mProcVar3.field_0x300e.x = 0; + voiceStart(Z2SE_WL_V_BREATH_JUMP); + return 1; } -#pragma pop /* 8012E0AC-8012E1E8 1289EC 013C+00 1/0 0/0 0/0 .text procWolfSideStep__9daAlink_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfSideStep() { - nofralloc -#include "asm/d/a/d_a_alink/procWolfSideStep__9daAlink_cFv.s" +int daAlink_c::procWolfSideStep() { + if (mProcVar1.field_0x300a == 0) { + cLib_addCalcAngleS( + &shape_angle.y, mProcVar2.field_0x300c, daAlinkHIO_wlAtnMove_c0::m.field_0x4, + daAlinkHIO_wlAtnMove_c0::m.field_0x0, daAlinkHIO_wlAtnMove_c0::m.field_0x2); + current.angle.y = shape_angle.y + 0x8000; + } else if (mTargetedActor != NULL) { + cLib_addCalcAngleS(&shape_angle.y, fopAcM_searchActorAngleY(this, mTargetedActor), 5, 0x5E8, + 0x13C); + + if (field_0x2f98 == 2) { + current.angle.y = shape_angle.y + 0x4000; + } else { + current.angle.y = shape_angle.y - 0x4000; + } + } + + checkWolfAtnDoCharge(); + + if (mLinkAcch.ChkGroundHit() && mProcVar3.field_0x300e.x != 0) { + return procWolfSideStepLandInit(mProcVar3.field_0x300e.z); + } + + if (mDemo.getDemoMode() != 0x10 && + current.pos.y < mLastJumpPos.y - daAlinkHIO_wlSideStep_c0::m.field_0x60) + { + field_0x2f98 = 0; + return procWolfFallInit(2, daAlinkHIO_wlSideStep_c0::m.field_0x64); + } + + mProcVar3.field_0x300e.x = 1; + return 1; } -#pragma pop /* 8012E1E8-8012E2DC 128B28 00F4+00 1/1 0/0 0/0 .text procWolfSideStepLandInit__9daAlink_cFs */ int daAlink_c::procWolfSideStepLandInit(s16 param_0) { @@ -808,11 +1962,13 @@ int daAlink_c::procWolfSideStepLandInit(s16 param_0) { field_0x2fcc = 10; } else { field_0x2fcc = 0; - setSingleAnimeWolfParam(field_0x2f98 == 2 ? WANM_SIDE_JUMP_LEFT_END : WANM_SIDE_JUMP_RIGHT_END, &daAlinkHIO_wlSideStep_c0::m.field_0x14); + setSingleAnimeWolfParam(field_0x2f98 == 2 ? WANM_SIDE_JUMP_LEFT_END : + WANM_SIDE_JUMP_RIGHT_END, + &daAlinkHIO_wlSideStep_c0::m.field_0x14); field_0x3478 = daAlinkHIO_wlSideStep_c0::m.field_0x14.mCheckFrame; } - field_0x300e.z = param_0; + mProcVar3.field_0x300e.z = param_0; field_0x2f9d = 4; setFootEffectProcType(2); i_onResetFlg1(0xC); @@ -849,32 +2005,65 @@ int daAlink_c::procWolfSideStepLand() { /* 8012E398-8012E508 128CD8 0170+00 3/3 0/0 0/0 .text procWolfBackJumpInit__9daAlink_cFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfBackJumpInit(int param_0) { - nofralloc -#include "asm/d/a/d_a_alink/procWolfBackJumpInit__9daAlink_cFi.s" +int daAlink_c::procWolfBackJumpInit(int param_0) { + commonProcInit(PROC_WOLF_BACKJUMP); + + if (param_0 == 1) { + setSingleAnimeWolfParam(WANM_BACKFLIP_START, &daAlinkHIO_wlAtDown_c0::m.field_0x50); + mNormalSpeed = daAlinkHIO_wlAtDown_c0::m.field_0x94; + speed.y = daAlinkHIO_wlAtDown_c0::m.field_0x98; + voiceStart(Z2SE_WL_V_BREATH_JUMP); + } else { + if (param_0 == 2) { + setSingleAnimeWolf(WANM_BACKFLIP_START, daAlinkHIO_wlAtCjump_c0::m.field_0x44, + daAlinkHIO_wlAtCjump_c0::m.field_0x40, + daAlinkHIO_wlBackJump_c0::m.field_0x0.mEndFrame, + daAlinkHIO_wlBackJump_c0::m.field_0x0.mInterpolation); + } else { + setSingleAnimeWolfParam(WANM_BACKFLIP_START, &daAlinkHIO_wlBackJump_c0::m.field_0x0); + voiceStart(Z2SE_WL_V_BREATH_JUMP); + } + + mNormalSpeed = daAlinkHIO_wlBackJump_c0::m.field_0x28; + speed.y = daAlinkHIO_wlBackJump_c0::m.field_0x2C; + } + + if (mTargetedActor != NULL && param_0 == 0) { + mProcVar2.field_0x300c = cLib_targetAngleY(¤t.pos, &mTargetedActor->mEyePos); + } else { + mProcVar2.field_0x300c = shape_angle.y; + } + + current.angle.y = shape_angle.y + 0x8000; + field_0x3478 = mNormalSpeed; + mProcVar3.field_0x300e.z = 0; + + if (param_0 == 0) { + mProcVar3.field_0x300e.y = 1; + } else { + mProcVar3.field_0x300e.y = 0; + } + + return 1; } -#pragma pop /* 8012E508-8012E5F4 128E48 00EC+00 1/0 0/0 0/0 .text procWolfBackJump__9daAlink_cFv */ int daAlink_c::procWolfBackJump() { - cLib_addCalcAngleS(&shape_angle.y, field_0x300c, - daAlinkHIO_wlAtnMove_c0::m.field_0x4, - daAlinkHIO_wlAtnMove_c0::m.field_0x0, - daAlinkHIO_wlAtnMove_c0::m.field_0x2); + cLib_addCalcAngleS(&shape_angle.y, mProcVar2.field_0x300c, daAlinkHIO_wlAtnMove_c0::m.field_0x4, + daAlinkHIO_wlAtnMove_c0::m.field_0x0, daAlinkHIO_wlAtnMove_c0::m.field_0x2); current.angle.y = shape_angle.y - -0x8000; - if (field_0x300e.y != 0) { + if (mProcVar3.field_0x300e.y != 0) { checkWolfAtnDoCharge(); } backJumpSpeedDec(); if (mUnderFrameCtrl[0].checkAnmEnd() && mLinkAcch.ChkGroundHit()) { - procWolfBackJumpLandInit(field_0x300e.z, field_0x300e.y); - } else if (mDemo.getDemoMode() != 0x10 && current.pos.y < mLastJumpPos.y - daAlinkHIO_wlBackJump_c0::m.field_0x30) { + procWolfBackJumpLandInit(mProcVar3.field_0x300e.z, mProcVar3.field_0x300e.y); + } else if (mDemo.getDemoMode() != 0x10 && + current.pos.y < mLastJumpPos.y - daAlinkHIO_wlBackJump_c0::m.field_0x30) + { field_0x2f98 = 0; procWolfFallInit(2, daAlinkHIO_wlBackJump_c0::m.field_0x34); } @@ -890,8 +2079,8 @@ int daAlink_c::procWolfBackJumpLandInit(s16 param_0, s16 param_1) { field_0x2f9d = 4; setFootEffectProcType(2); field_0x2fcc = 10; - field_0x300e.z = param_0; - field_0x300e.y = param_1; + mProcVar3.field_0x300e.z = param_0; + mProcVar3.field_0x300e.y = param_1; setStepLandVibration(); return 1; @@ -908,7 +2097,7 @@ int daAlink_c::procWolfBackJumpLand() { setWolfAtnMoveDirection(); - if (field_0x300e.y != 0) { + if (mProcVar3.field_0x300e.y != 0) { checkWolfAtnDoCharge(); } @@ -937,20 +2126,58 @@ int daAlink_c::procWolfHowlInit(int param_0) { setSingleAnimeWolfParam(WANM_HOWL_SIT, &daAlinkHIO_wlHowl_c0::m.field_0x14); onModeFlg(0x800000); field_0x3478 = daAlinkHIO_wlHowl_c0::m.field_0x14.mCheckFrame; - field_0x300e.x = 1; + mProcVar3.field_0x300e.x = 1; } else { setSingleAnimeWolfParam(WANM_HOWL, &daAlinkHIO_wlHowl_c0::m.field_0x0); field_0x3478 = daAlinkHIO_wlHowl_c0::m.field_0x0.mCheckFrame; - field_0x300e.x = 0; + mProcVar3.field_0x300e.x = 0; } mNormalSpeed = FLOAT_LABEL(lit_6108); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; return 1; } /* 8012E83C-8012E9C8 12917C 018C+00 1/0 0/0 0/0 .text procWolfHowl__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfHowl() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + + if (checkAnmEnd(frameCtrl_p)) { + if (doButton()) { + procWolfHowlInit(mProcVar3.field_0x300e.x); + } else { + checkNextActionWolf(0); + } + } else if (frameCtrl_p->getFrame() > field_0x3478) { + if (doButton()) { + procWolfHowlInit(mProcVar3.field_0x300e.x); + } else { + checkNextActionWolf(1); + } + } else { + if ((!doButton() || mProcVar2.field_0x300c != 0) && mDemo.getDemoMode() != 0x15 && + mDemo.getDemoMode() != 0x16) + { + if (!(frameCtrl_p->getFrame() < 38.0f)) { + mProcVar2.field_0x300c = 1; + } + } else if (frameCtrl_p->getFrame() > 56.0f) { + frameCtrl_p->setFrame((frameCtrl_p->getFrame() - 56.0f) + 38.0f); + } + + if (frameCtrl_p->getFrame() >= 38.0f && frameCtrl_p->getFrame() <= 56.0f) { + i_onResetFlg0(RFLG0_UNK_40000000); + voiceStartLevel(Z2SE_WL_V_HOWL); + dKy_Sound_set(current.pos, 100, fopAcM_GetID(this), 1); + } + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -959,19 +2186,113 @@ asm int daAlink_c::procWolfHowl() { #include "asm/d/a/d_a_alink/procWolfHowl__9daAlink_cFv.s" } #pragma pop +#endif /* 8012E9C8-8012EB94 129308 01CC+00 2/2 0/0 0/0 .text procWolfAutoJumpInit__9daAlink_cFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfAutoJumpInit(int param_0) { - nofralloc -#include "asm/d/a/d_a_alink/procWolfAutoJumpInit__9daAlink_cFi.s" +int daAlink_c::procWolfAutoJumpInit(int param_0) { + commonProcInit(PROC_WOLF_AUTO_JUMP); + + f32 var_f1; + f32 var_f31; + f32 var_f30; + s16 var_r30; + + if (checkWolfDashMode() && field_0x2fc7 != 3) { + var_f1 = daAlinkHIO_wlAutoJump_c0::m.field_0x00.mSpeed; + field_0x594 = daAlinkHIO_wlAutoJump_c0::m.field_0x70; + var_f31 = daAlinkHIO_wlAutoJump_c0::m.field_0x48; + var_f30 = daAlinkHIO_wlAutoJump_c0::m.field_0x4c; + var_r30 = daAlinkHIO_wlAutoJump_c0::m.field_0x40; + i_onNoResetFlg2(FLG2_UNK_10000); + } else { + var_f1 = daAlinkHIO_wlAutoJump_c0::m.field_0x60; + field_0x594 = daAlinkHIO_wlAutoJump_c0::m.field_0x74; + var_f31 = daAlinkHIO_wlAutoJump_c0::m.field_0x68; + var_f30 = daAlinkHIO_wlAutoJump_c0::m.field_0x6c; + var_r30 = daAlinkHIO_wlAutoJump_c0::m.field_0x42; + } + + setSingleAnimeWolf(WANM_JUMP_ATTACK_START, var_f1, + daAlinkHIO_wlAutoJump_c0::m.field_0x00.mStartFrame, + daAlinkHIO_wlAutoJump_c0::m.field_0x00.mEndFrame, + daAlinkHIO_wlAutoJump_c0::m.field_0x00.mInterpolation); + if (speedF > field_0x594 || param_0 || daAlinkHIO_wlAutoJump_c0::m.field_0x3c == true) { + speedF = field_0x594; + } else if (speedF < var_f31) { + speedF = var_f31; + } + + mNormalSpeed = speedF * var_f30; + speed.y = mNormalSpeed * cM_ssin(var_r30); + mNormalSpeed *= cM_scos(var_r30); + + field_0x3588 = l_wolfBaseAnime; + field_0x33b0 = l_wolfBaseAnime.y; + current.angle.y = shape_angle.y; + + i_offNoResetFlg0(FLG0_UNK_40000); + i_onResetFlg0(RFLG0_UNK_100); + voiceStart(Z2SE_WL_V_BREATH_JUMP); + mProcVar2.field_0x300c = 1; + return 1; } -#pragma pop /* 8012EB94-8012EDD0 1294D4 023C+00 1/0 0/0 0/0 .text procWolfAutoJump__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfAutoJump() { + if (mSpecialMode != 0x27) { + if (checkInputOnR() && getDirectionFromCurrentAngle() == DIR_BACKWARD) { + cLib_chaseF(&mNormalSpeed, 0.0f, field_0x33a8 * 0.2f); + } else if (!checkInputOnR()) { + cLib_chaseF(&mNormalSpeed, 0.0f, 0.1f); + } + } + + field_0x2f99 = 7; + + if (mLinkAcch.ChkGroundHit()) { + return checkWolfLandAction(0); + } + + if (checkFrontWallTypeAction()) { + return 1; + } + + if (checkWolfRopeJumpHang()) { + return 1; + } + + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + + if (!checkUnderMove0BckNoArcWolf(WANM_FALL_LAND) && + (mFallHeight - current.pos.y) * 0.01f > daAlinkHIO_wlDamFall_c0::m.field_0x38) + { + field_0x2f99 = 12; + setSingleAnimeWolfBaseSpeed(WANM_FALL_LAND, 0.0f, daAlinkHIO_wlDamFall_c0::m.field_0x3C); + } else if (checkUnderMove0BckNoArcWolf(WANM_JUMP_ATTACK_START)) { + if (speed.y < -mGravity) { + field_0x2f99 = 12; + setSingleAnimeWolfParam(WANM_JUMP_ATTACK, &daAlinkHIO_wlAutoJump_c0::m.field_0x28); + } else if (checkAnmEnd(frameCtrl_p)) { + field_0x2f99 = 12; + setSingleAnimeWolf(WANM_JUMP_ATTACK, 0.0f, + daAlinkHIO_wlAutoJump_c0::m.field_0x28.mStartFrame, + daAlinkHIO_wlAutoJump_c0::m.field_0x28.mEndFrame, + daAlinkHIO_wlAutoJump_c0::m.field_0x28.mInterpolation); + mProcVar2.field_0x300c = 0; + } + } else if (mProcVar2.field_0x300c == 0 && checkUnderMove0BckNoArcWolf(WANM_JUMP_ATTACK) && + speed.y < -mGravity) + { + mProcVar2.field_0x300c = 1; + frameCtrl_p->setRate(daAlinkHIO_wlAutoJump_c0::m.field_0x28.mSpeed); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -980,27 +2301,125 @@ asm int daAlink_c::procWolfAutoJump() { #include "asm/d/a/d_a_alink/procWolfAutoJump__9daAlink_cFv.s" } #pragma pop +#endif /* 8012EDD0-8012EFB8 129710 01E8+00 12/12 0/0 0/0 .text procWolfFallInit__9daAlink_cFif */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfFallInit(int param_0, f32 param_1) { - nofralloc -#include "asm/d/a/d_a_alink/procWolfFallInit__9daAlink_cFif.s" -} -#pragma pop +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfFallInit(int param_0, f32 i_morf) { + if (!commonProcInitNotSameProc(PROC_WOLF_FALL)) { + return 0; + } -/* 8012EFB8-8012F138 1298F8 0180+00 1/0 0/0 0/0 .text procWolfFall__9daAlink_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfFall() { + mProcVar3.field_0x300e.z = 0; + + if (param_0 == 1) { + mNormalSpeed = 0.0f; + speed.y = 0.0f; + current.angle.y = shape_angle.y; + } else if (param_0 == 4) { + current.angle.y = field_0x2ffe; + dComIfGp_getVibration().StartShock(6, 31, cXyz(0.0f, 1.0f, 0.0f)); + setDamagePointNormal(field_0x318c); + i_onNoResetFlg1(FLG1_THROW_DAMAGE); + + if (mDamageTimer != 0) { + onModeFlg(8); + } + + mNormalSpeed = field_0x3408; + speed.y = field_0x340c; + mProcVar3.field_0x300e.z = 1; + } + + setSingleAnimeWolfBaseSpeed(WANM_JUMP_ATTACK, 0.0f, i_morf); + + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + frameCtrl_p->setFrame(frameCtrl_p->getEnd() - 0.001f); + getNowAnmPackUnder(UNDER_0)->setFrame(frameCtrl_p->getFrame()); + + field_0x3588 = l_wolfBaseAnime; + field_0x2f99 = 12; + resetBasAnime(); + + i_offNoResetFlg0(FLG0_UNK_40000); + if (param_0 != 4 && current.angle.y == shape_angle.y) { + if (mNormalSpeed > 1.0f) { + mProcVar0.field_0x3008 = 2; + } else { + mProcVar0.field_0x3008 = 1; + } + } else { + mProcVar0.field_0x3008 = 0; + } + + mProcVar1.field_0x300a = 7; + return 1; +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm int daAlink_c::procWolfFallInit(int param_0, f32 param_1) { + nofralloc +#include "asm/d/a/d_a_alink/procWolfFallInit__9daAlink_cFif.s" +} +#pragma pop +#endif + +/* 8012EFB8-8012F138 1298F8 0180+00 1/0 0/0 0/0 .text procWolfFall__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfFall() { + if (mProcVar3.field_0x300e.z == 0) { + cLib_chaseF(&mNormalSpeed, 0.0f, 0.1f); + } else if (mProcVar3.field_0x300e.z > 0) { + mProcVar3.field_0x300e.z = -1; + return 1; + } + + field_0x2f99 = 4; + + if (mLinkAcch.ChkGroundHit()) { + return checkWolfLandAction(0); + } + + if (mProcVar0.field_0x3008 == 1) { + if (mProcVar1.field_0x300a > 0) { + mProcVar1.field_0x300a--; + } else if (checkInputOnR() && getDirectionFromShapeAngle() == DIR_FORWARD && + checkFrontWallTypeAction()) + { + return 1; + } + } else if (mProcVar0.field_0x3008 == 2 && checkFrontWallTypeAction()) { + return 1; + } + + if (checkWolfRopeJumpHang()) { + return 1; + } + + if (!checkUnderMove0BckNoArcWolf(WANM_FALL_LAND) && + (mFallHeight - current.pos.y) * 0.01f > daAlinkHIO_wlDamFall_c0::m.field_0x38) + { + field_0x2f99 = 12; + setSingleAnimeWolfBaseSpeed(WANM_FALL_LAND, 0.0f, daAlinkHIO_wlDamFall_c0::m.field_0x3C); + } + + return 1; +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm int daAlink_c::procWolfFall() { nofralloc #include "asm/d/a/d_a_alink/procWolfFall__9daAlink_cFv.s" } #pragma pop +#endif /* 8012F138-8012F1F0 129A78 00B8+00 2/2 0/0 0/0 .text procWolfLandInit__9daAlink_cFv */ // matches with literals @@ -1012,7 +2431,7 @@ int daAlink_c::procWolfLandInit() { setSingleWolfAnimeParam(WANM_JUMP_ATTACK_END, &daAlinkHIO_wlAutoJump_c0::m.field_0x14); field_0x3478 = daAlinkHIO_wlAutoJump_c0::m.field_0x14.mCheckFrame; - field_0x300c = 1; + mProcVar2.field_0x300c = 1; field_0x2f9d = 4; setFootEffectProcType(4); @@ -1035,7 +2454,7 @@ asm int daAlink_c::procWolfLandInit() { int daAlink_c::procWolfLand() { daPy_frameCtrl_c* frameCtrl = mUnderFrameCtrl; - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { field_0x2f99 = 4; } @@ -1054,19 +2473,21 @@ int daAlink_c::procWolfSitInit(int param_0) { return 0; } - if (param_0 != 0 && !checkUnderMove0BckNoArcWolf(WANM_WAIT_SIT) && !checkUnderMove0BckNoArcWolf(WANM_HOWL_SIT)) { + if (param_0 != 0 && !checkUnderMove0BckNoArcWolf(WANM_WAIT_SIT) && + !checkUnderMove0BckNoArcWolf(WANM_HOWL_SIT)) + { setSingleAnimeWolfParam(WANM_SIT, &daAlinkHIO_wlLie_c0::m.field_0x0); field_0x3198 = 0; } else { field_0x3198 = 1; - + if (!checkUnderMove0BckNoArcWolf(WANM_WAIT_SIT)) { - setSingleAnimeWolfBaseSpeed(WANM_WAIT_SIT, daAlinkHIO_wlLie_c0::m.field_0x44, daAlinkHIO_wlLie_c0::m.field_0x48); + setSingleAnimeWolfBaseSpeed(WANM_WAIT_SIT, daAlinkHIO_wlLie_c0::m.field_0x44, + daAlinkHIO_wlLie_c0::m.field_0x48); } } current.angle.y = shape_angle.y; - return 1; } @@ -1074,14 +2495,15 @@ int daAlink_c::procWolfSitInit(int param_0) { int daAlink_c::procWolfSit() { daPy_frameCtrl_c* frameCtrl = mUnderFrameCtrl; - cLib_chaseF(&mNormalSpeed, FLOAT_LABEL(lit_6108), checkWolfDashMode() ? - daAlinkHIO_wlMove_c0::m.field_0x6C : - daAlinkHIO_wlMoveNoP_c0::m.field_0x10); + cLib_chaseF(&mNormalSpeed, FLOAT_LABEL(lit_6108), + checkWolfDashMode() ? daAlinkHIO_wlMove_c0::m.field_0x6C : + daAlinkHIO_wlMoveNoP_c0::m.field_0x10); if (!spActionButton() && mDemo.getDemoMode() != 0xF) { checkNextActionWolfFromLie(); } else if (frameCtrl->checkAnmEnd()) { - setSingleAnimeWolfBaseSpeed(WANM_WAIT_SIT, daAlinkHIO_wlLie_c0::m.field_0x44, daAlinkHIO_wlLie_c0::m.field_0x48); + setSingleAnimeWolfBaseSpeed(WANM_WAIT_SIT, daAlinkHIO_wlLie_c0::m.field_0x44, + daAlinkHIO_wlLie_c0::m.field_0x48); field_0x3198 = 1; } @@ -1097,14 +2519,13 @@ int daAlink_c::procWolfStepMoveInit() { setSingleAnimeWolfParam(WANM_BUMP_START, &daAlinkHIO_wlWallHang_c0::m.field_0x50); field_0x3478 = 0.5f * mNormalSpeed; mNormalSpeed = 0.0f; - field_0x300c = 0; + mProcVar2.field_0x300c = 0; field_0x3588 = l_wolfBaseAnime; current.pos.x -= cM_ssin(shape_angle.y) * 10.0f; current.pos.z -= cM_scos(shape_angle.y) * 10.0f; field_0x2060->getOldFrameTransInfo(0)->mTranslate.z += 10.0f; - return 1; } #else @@ -1119,6 +2540,38 @@ asm int daAlink_c::procWolfStepMoveInit() { #endif /* 8012F500-8012F634 129E40 0134+00 1/0 0/0 0/0 .text procWolfStepMove__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfStepMove() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + + if (mProcVar2.field_0x300c != 0) { + field_0x2f99 = 4; + + if (checkAnmEnd(frameCtrl_p)) { + return checkNextActionWolf(0); + } + + if (frameCtrl_p->getFrame() > daAlinkHIO_wlWallHang_c0::m.field_0x64.mCheckFrame) { + mNormalSpeed = field_0x3478; + + if (checkNextActionWolf(1)) { + return 1; + } + + mNormalSpeed = 0.0f; + } + } else if (checkAnmEnd(frameCtrl_p)) { + setSingleAnimeWolfParam(WANM_BUMP_END, &daAlinkHIO_wlWallHang_c0::m.field_0x64); + current.pos.set(field_0x34ec.x + cM_ssin(shape_angle.y) * 2.0f, field_0x34ec.y, + field_0x34ec.z + cM_scos(shape_angle.y) * 2.0f); + field_0x2f99 = 0x50; + mProcVar2.field_0x300c = 1; + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1127,6 +2580,7 @@ asm int daAlink_c::procWolfStepMove() { #include "asm/d/a/d_a_alink/procWolfStepMove__9daAlink_cFv.s" } #pragma pop +#endif /* 8012F634-8012F6EC 129F74 00B8+00 1/1 0/0 0/0 .text procWolfSlipInit__9daAlink_cFv */ int daAlink_c::procWolfSlipInit() { @@ -1142,11 +2596,48 @@ int daAlink_c::procWolfSlipInit() { current.angle.y = shape_angle.y; field_0x3588 = l_wolfBaseAnime; setFootEffectProcType(1); - return 1; } /* 8012F6EC-8012F840 12A02C 0154+00 1/0 0/0 0/0 .text procWolfSlip__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfSlip() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + + field_0x2f99 = 5; + + f32 var_f2; + if (checkWolfDashMode()) { + var_f2 = daAlinkHIO_wlMove_c0::m.field_0xA8; + } else { + var_f2 = daAlinkHIO_wlMoveNoP_c0::m.field_0x40; + } + cLib_chaseF(&mNormalSpeed, 0.0f, var_f2); + + if (checkAnmEnd(frameCtrl_p)) { + mNormalSpeed = 0.0f; + + if (checkInputOnR()) { + procWolfSlipTurnInit(1); + } else { + current.pos.x += cM_scos(shape_angle.y) * 30.0f; + current.pos.z -= cM_ssin(shape_angle.y) * 30.0f; + + field_0x2060->getOldFrameTransInfo(0)->mTranslate.x -= 30.0f; + checkNextActionWolf(0); + } + } else { + if (mNormalSpeed > 2.5f && frameCtrl_p->getFrame() >= 5.0f) { + field_0x2f9d = 0x78; + } + + seStartMapInfoLevel(Z2SE_FN_WOLF_SLIP); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1155,9 +2646,46 @@ asm int daAlink_c::procWolfSlip() { #include "asm/d/a/d_a_alink/procWolfSlip__9daAlink_cFv.s" } #pragma pop +#endif /* 8012F840-8012F9C0 12A180 0180+00 2/2 0/0 0/0 .text procWolfSlipTurnInit__9daAlink_cFi */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfSlipTurnInit(int param_0) { + if (!commonProcInitNotSameProc(PROC_WOLF_SLIP_TURN)) { + return 0; + } + + f32 var_f31; + if (param_0) { + var_f31 = daAlinkHIO_wlMove_c0::m.field_0x14.mStartFrame; + current.angle.y = shape_angle.y + 0x8000; + + if (checkWolfDashMode()) { + field_0x347c = daAlinkHIO_wlMove_c0::m.field_0xAC; + } else { + field_0x347c = daAlinkHIO_wlMoveNoP_c0::m.field_0x44; + } + } else { + var_f31 = daAlinkHIO_wlMove_c0::m.field_0xB0; + current.angle.y = field_0x2fe2; + setOldRootQuaternion(0, (shape_angle.y - current.angle.y) - 0x8000, 0); + shape_angle.y = current.angle.y + 0x8000; + field_0x347c = 10.0f; + } + + setSingleAnimeWolf(WANM_TURN, daAlinkHIO_wlMove_c0::m.field_0x14.mSpeed, var_f31, 12, + daAlinkHIO_wlMove_c0::m.field_0x14.mInterpolation); + voiceStart(Z2SE_WL_V_BREATH_JUMP); + + mNormalSpeed = 0.0f; + field_0x2f99 = 5; + field_0x3588 = l_wolfBaseAnime; + field_0x3478 = 1.0f / (12.0f - var_f31); + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1166,8 +2694,39 @@ asm int daAlink_c::procWolfSlipTurnInit(int param_0) { #include "asm/d/a/d_a_alink/procWolfSlipTurnInit__9daAlink_cFi.s" } #pragma pop +#endif /* 8012F9C0-8012FB18 12A300 0158+00 1/0 0/0 0/0 .text procWolfSlipTurn__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfSlipTurn() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + field_0x2f99 = 5; + + f32 var_f31 = + (0.5f - field_0x3478 * (frameCtrl_p->getFrame() - frameCtrl_p->getStart())) * 2.0f; + field_0x3588.x = l_wolfBaseAnime.x * var_f31; + field_0x3588.z = l_wolfBaseAnime.z * var_f31; + + if (checkAnmEnd(frameCtrl_p) && mLinkAcch.ChkGroundHit()) { + return procWolfSlipTurnLandInit(); + } + + if (!i_checkModeFlg(2) && frameCtrl_p->getFrame() > 4.5f) { + mNormalSpeed = field_0x347c; + setJumpMode(); + } else if (i_checkModeFlg(2) && + current.pos.y < mLastJumpPos.y - daAlinkHIO_wlMove_c0::m.field_0xC0) + { + setOldRootQuaternion(0, -0x8000, 0); + shape_angle.y = current.angle.y; + field_0x2fe6 = shape_angle.y; + procWolfFallInit(2, daAlinkHIO_wlMove_c0::m.field_0xC4); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1176,14 +2735,14 @@ asm int daAlink_c::procWolfSlipTurn() { #include "asm/d/a/d_a_alink/procWolfSlipTurn__9daAlink_cFv.s" } #pragma pop +#endif /* 8012FB18-8012FBB4 12A458 009C+00 1/1 0/0 0/0 .text procWolfSlipTurnLandInit__9daAlink_cFv */ int daAlink_c::procWolfSlipTurnLandInit() { commonProcInit(PROC_WOLF_SLIP_TURN_LAND); daPy_frameCtrl_c* frameCtrl = mUnderFrameCtrl; - setFrameCtrl(frameCtrl, 0, 0, - daAlinkHIO_wlMove_c0::m.field_0x14.mEndFrame, + setFrameCtrl(frameCtrl, 0, 0, daAlinkHIO_wlMove_c0::m.field_0x14.mEndFrame, daAlinkHIO_wlMove_c0::m.field_0x14.mSpeed, frameCtrl->getFrame() + daAlinkHIO_wlMove_c0::m.field_0x14.mSpeed); @@ -1192,7 +2751,6 @@ int daAlink_c::procWolfSlipTurnLandInit() { setFootEffectProcType(2); field_0x2f9d = 8; field_0x2f98 = 0; - return 1; } @@ -1213,6 +2771,25 @@ int daAlink_c::procWolfSlipTurnLand() { } /* 8012FC38-8012FD2C 12A578 00F4+00 2/2 0/0 0/0 .text procWolfSlideReadyInit__9daAlink_cFsi */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfSlideReadyInit(s16 i_angle, int param_1) { + commonProcInit(PROC_WOLF_SLIDE_READY); + field_0x3090 = 8; + current.angle.y = i_angle; + setSingleAnimeWolfParam(WANM_SLIDE_FORWARD_START, &daAlinkHIO_wlSlide_c0::m.field_0x0); + voiceStart(Z2SE_WL_V_SLIP_ROLL); + + mNormalSpeed = 0.0f; + field_0x594 = daAlinkHIO_wlSlide_c0::m.field_0x54; + field_0x3588 = l_wolfBaseAnime; + field_0x3478 = 1.0f / mUnderFrameCtrl[0].getEnd(); + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.x = param_1; + field_0x814.SetWeight(0xFF); + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1221,8 +2798,42 @@ asm int daAlink_c::procWolfSlideReadyInit(s16 param_0, int param_1) { #include "asm/d/a/d_a_alink/procWolfSlideReadyInit__9daAlink_cFsi.s" } #pragma pop +#endif /* 8012FD2C-8012FE80 12A66C 0154+00 1/0 0/0 0/0 .text procWolfSlideReady__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfSlideReady() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + field_0x2f99 = 5; + + f32 var_f31 = (0.5f - field_0x3478 * frameCtrl_p->getFrame()) * 2.0f; + field_0x3588.x = l_wolfBaseAnime.x * var_f31; + field_0x3588.z = l_wolfBaseAnime.z * var_f31; + + cM3dGPla slide_poly; + if (getSlidePolygon(&slide_poly)) { + cLib_addCalcAngleS(¤t.angle.y, slide_poly.mNormal.atan2sX_Z(), 4, 0x1000, 0x400); + cLib_addCalcAngleS(&shape_angle.y, current.angle.y, 4, 0x1000, 0x400); + } + + if (frameCtrl_p->checkPass(5.0f)) { + mProcVar2.field_0x300c = 1; + } + + if (checkAnmEnd(frameCtrl_p)) { + if (mProcVar3.field_0x300e.x != 0) { + procWolfSlideInit(current.angle.y, 1); + } else { + procWolfSlopeStartInit(1); + } + } else if (frameCtrl_p->checkPass(18.0f)) { + offModeFlg(0x8000); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1231,8 +2842,34 @@ asm int daAlink_c::procWolfSlideReady() { #include "asm/d/a/d_a_alink/procWolfSlideReady__9daAlink_cFv.s" } #pragma pop +#endif /* 8012FE80-8012FFA4 12A7C0 0124+00 2/2 0/0 0/0 .text procWolfSlideInit__9daAlink_cFsi */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfSlideInit(s16 i_angle, int param_1) { + if (cLib_distanceAngleS(i_angle, shape_angle.y) < 0x3800 && !param_1) { + return procWolfSlideReadyInit(i_angle, 1); + } + + commonProcInit(PROC_WOLF_SLIDE); + field_0x814.SetWeight(0xFF); + field_0x3090 = 8; + current.angle.y = i_angle; + setSingleAnimeWolfParam(WANM_SLIDE_BACKWARD, &daAlinkHIO_wlSlide_c0::m.field_0x14); + + if (param_1) { + mUnderFrameCtrl[0].setFrame(daAlinkHIO_wlSlide_c0::m.field_0x14.mEndFrame); + getNowAnmPackUnder(UNDER_0)->setFrame(daAlinkHIO_wlSlide_c0::m.field_0x14.mEndFrame); + } + + dComIfGp_setPlayerStatus1(0, 0x200); + field_0x2f9d = 0x78; + setFootEffectProcType(1); + field_0x594 = daAlinkHIO_wlSlide_c0::m.field_0x54; + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1241,8 +2878,35 @@ asm int daAlink_c::procWolfSlideInit(s16 param_0, int param_1) { #include "asm/d/a/d_a_alink/procWolfSlideInit__9daAlink_cFsi.s" } #pragma pop +#endif /* 8012FFA4-801300D4 12A8E4 0130+00 1/0 0/0 0/0 .text procWolfSlide__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfSlide() { + cM3dGPla slide_poly; + + if (getSlidePolygon(&slide_poly)) { + s16 var_r30 = slide_poly.mNormal.atan2sX_Z(); + cLib_addCalcAngleS(¤t.angle.y, var_r30, 4, 0x1000, 0x400); + cLib_addCalcAngleS(&shape_angle.y, current.angle.y + 0x8000, 4, 0x1000, 0x400); + + mNormalSpeed += daAlinkHIO_wlSlide_c0::m.field_0x58 * + ((1.0f - slide_poly.mNormal.y) * 0.5f + 1.0f) * + cM_scos(current.angle.y - var_r30); + if (mNormalSpeed > field_0x594) { + mNormalSpeed = field_0x594; + } + + field_0x2f9d = 0x78; + seStartMapInfoLevel(Z2SE_FN_WOLF_SLIP); + } else { + procWolfSlideLandInit(); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1251,6 +2915,7 @@ asm int daAlink_c::procWolfSlide() { #include "asm/d/a/d_a_alink/procWolfSlide__9daAlink_cFv.s" } #pragma pop +#endif /* 801300D4-80130138 12AA14 0064+00 1/1 0/0 0/0 .text procWolfSlideLandInit__9daAlink_cFv */ @@ -1291,7 +2956,8 @@ int daAlink_c::procWolfWaitSlipInit() { return 0; } - setSingleAnimeWolfBaseSpeed(WANM_ATN, daAlinkHIO_wlMove_c0::m.field_0xB8, daAlinkHIO_wlMove_c0::m.field_0xBC); + setSingleAnimeWolfBaseSpeed(WANM_ATN, daAlinkHIO_wlMove_c0::m.field_0xB8, + daAlinkHIO_wlMove_c0::m.field_0xBC); mNormalSpeed = FLOAT_LABEL(lit_6108); setWolfWaitSlip(); field_0x2f9d = 120; @@ -1301,6 +2967,53 @@ int daAlink_c::procWolfWaitSlipInit() { } /* 80130268-80130440 12ABA8 01D8+00 1/0 0/0 0/0 .text procWolfWaitSlip__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfWaitSlip() { + f32 var_f31 = mNormalSpeed; + mNormalSpeed = 0.0f; + current.angle.y = shape_angle.y; + + if (checkInputOnR() && checkWolfWaitSlipPolygon()) { + cM3dGPla tri; + dComIfG_Bgsp().GetTriPla(mLinkAcch.m_gnd, &tri); + s16 var_r30 = tri.mNormal.atan2sX_Z(); + + if (getGroundAngle(&mLinkAcch.m_gnd, field_0x2fe2) < -field_0x3122) { + int var_r3 = abs((s16)(var_r30 - shape_angle.y)); + + if (var_r3 >= 0x6000) { + return procWolfSlopeStartInit(0); + } else if (var_r3 <= 0x2000) { + return procWolfSlideReadyInit(current.angle.y, 0); + } + } + } + + if (!checkNextActionWolf(0)) { + f32 temp_f1 = setWolfWaitSlip(); + mNormalSpeed = var_f31 + (daAlinkHIO_wlSlide_c0::m.field_0x74 * (temp_f1 + 1.0f)); + if (mNormalSpeed > daAlinkHIO_wlSlide_c0::m.field_0x78) { + mNormalSpeed = daAlinkHIO_wlSlide_c0::m.field_0x78; + } + + field_0x2f9d = 0x78; + + s16 var_r4; + if (mProcVar2.field_0x300c != 0) { + var_r4 = current.angle.y + 0x8000; + } else { + var_r4 = current.angle.y; + } + + cLib_addCalcAngleS(&shape_angle.y, var_r4, 4, daAlinkHIO_wlSlide_c0::m.field_0x50, + daAlinkHIO_wlSlide_c0::m.field_0x52); + seStartMapInfoLevel(Z2SE_FN_WOLF_SLIP); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1309,6 +3022,7 @@ asm int daAlink_c::procWolfWaitSlip() { #include "asm/d/a/d_a_alink/procWolfWaitSlip__9daAlink_cFv.s" } #pragma pop +#endif /* 80130440-801304D4 12AD80 0094+00 2/2 0/0 0/0 .text procWolfSlopeStartInit__9daAlink_cFi */ int daAlink_c::procWolfSlopeStartInit(int param_0) { @@ -1352,14 +3066,33 @@ static fopAc_ac_c* daAlink_searchGoldWolf(fopAc_ac_c* i_actor, void*) { } /* 80130580-80130654 12AEC0 00D4+00 1/1 0/0 0/0 .text daAlink_searchWolfHowl__FP10fopAc_ac_cPv */ +// matches with literals +#ifdef NONMATCHING +static void* daAlink_searchWolfHowl(fopAc_ac_c* i_actor, void* i_data) { + s16 actor_name = fopAcM_GetName(i_actor); + daAlink_c* player_p = daAlink_getAlinkActorClass(); + + if ((actor_name == PROC_KAGO && i_dComIfGs_isEventBit(0xA10)) || + (actor_name == PROC_E_PM && + player_p->current.pos.abs2XZ(i_actor->current.pos) < 9000000.0f) || + actor_name == PROC_OBJ_SEKIZOA || + (*(fopAc_ac_c**)i_data == NULL && actor_name == player_p->getGrassHowlEventActor())) + { + *(fopAc_ac_c**)i_data = i_actor; + } + + return NULL; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void daAlink_searchWolfHowl(fopAc_ac_c* param_0, void* param_1) { +static asm void* daAlink_searchWolfHowl(fopAc_ac_c* param_0, void* param_1) { nofralloc #include "asm/d/a/d_a_alink/daAlink_searchWolfHowl__FP10fopAc_ac_cPv.s" } #pragma pop +#endif /* 80130654-80130700 12AF94 00AC+00 1/1 0/0 0/0 .text setWolfHowlNotHappen__9daAlink_cFi */ @@ -1372,11 +3105,12 @@ void daAlink_c::setWolfHowlNotHappen(int param_0) { field_0x32cc = 0x535; } - field_0x300c = 0; + mProcVar2.field_0x300c = 0; if (!checkUnderMove0BckNoArcWolf(WANM_HOWL_END)) { if (param_0 != 0) { - setSingleAnimeWolfBaseSpeed(WANM_WAIT_SIT, daAlinkHIO_wlLie_c0::m.field_0x44, daAlinkHIO_wlLie_c0::m.field_0x48); + setSingleAnimeWolfBaseSpeed(WANM_WAIT_SIT, daAlinkHIO_wlLie_c0::m.field_0x44, + daAlinkHIO_wlLie_c0::m.field_0x48); } else { setSingleAnimeWolfBase(WANM_SERVICE_WAIT_D); } @@ -1385,59 +3119,418 @@ void daAlink_c::setWolfHowlNotHappen(int param_0) { /* 80130700-80130BC4 12B040 04C4+00 1/1 0/0 0/0 .text procWolfHowlDemoInit__9daAlink_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfHowlDemoInit() { - nofralloc -#include "asm/d/a/d_a_alink/procWolfHowlDemoInit__9daAlink_cFv.s" -} -#pragma pop +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfHowlDemoInit() { + if (!dComIfGp_event_compulsory(this, 0, 0xFFFF)) { + return 0; + } -/* 80130BC4-801312C8 12B504 0704+00 1/0 0/0 0/0 .text procWolfHowlDemo__9daAlink_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfHowlDemo() { - nofralloc -#include "asm/d/a/d_a_alink/procWolfHowlDemo__9daAlink_cFv.s" -} -#pragma pop + mDemo.i_setSpecialDemoType(); -/* 801312C8-80131408 12BC08 0140+00 1/1 0/0 0/0 .text setWolfHowling__15daObj_Sekizoa_cFv - */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daObj_Sekizoa_c::setWolfHowling() { - nofralloc -#include "asm/d/a/d_a_alink/setWolfHowling__15daObj_Sekizoa_cFv.s" -} -#pragma pop + s16 name; + if (field_0x27f4 != NULL) { + name = fopAcM_GetName(field_0x27f4); + } else { + name = PROC_ALINK; + } -/* 80131408-80131450 12BD48 0048+00 1/0 0/0 0/0 .text checkWolfRope__9daAlink_cFv */ + if (name == PROC_Tag_WaraHowl) { + shape_angle.y = field_0x27f4->shape_angle.y; + current.angle.y = shape_angle.y; + } else { + f32 var_f31 = cM_ssin(shape_angle.y) * 200.0f; + f32 var_f30 = cM_scos(shape_angle.y) * 200.0f; + + cXyz sp14; + cXyz sp8; + sp14.set(mAttentionInfo.mPosition.x, mAttentionInfo.mPosition.y - 50.0f, + mAttentionInfo.mPosition.z); + sp8.set(sp14.x + var_f31, sp14.y, sp14.z + var_f30); + + if (commonLineCheck(&sp14, &sp8)) { + sp8.x = sp14.x - var_f31; + sp8.z = sp14.z - var_f30; + + if (!commonLineCheck(&sp14, &sp8)) { + shape_angle.y += 0x8000; + } else { + sp8.x = sp14.x + var_f30; + sp8.z = sp14.z - var_f31; + + if (!commonLineCheck(&sp14, &sp8)) { + shape_angle.y += 0x4000; + } else { + sp8.x = sp14.x - var_f30; + sp8.z = sp14.z + var_f31; + + if (!commonLineCheck(&sp14, &sp8)) { + shape_angle.y -= 0x4000; + } + } + } + current.angle.y = shape_angle.y; + } + } + + commonProcInit(PROC_WOLF_HOWL_DEMO); + field_0x3198 = -1; + mProcVar3.field_0x300e.z = -1; + mProcVar3.field_0x300e.y = 0; + mProcVar0.field_0x3008 = -1; + + if (name != PROC_ALINK) { + if (name == PROC_Obj_Yobikusa) { + daObjYobikusa_c* yobikusa_p = (daObjYobikusa_c*)field_0x27f4; + + mZ2WolfHowlMgr.setCorrectCurve(yobikusa_p->getType()); + mProcVar3.field_0x300e.z = yobikusa_p->getPathID(); + shape_angle.y = yobikusa_p->shape_angle.y; + current.angle.y = shape_angle.y; + + if (yobikusa_p->getType() == 0) { + field_0x3198 = 0x100; + } else if (yobikusa_p->getType() == 1) { + field_0x3198 = 0xEE; + } + } else if (name == PROC_TAG_HOWL) { + mZ2WolfHowlMgr.setCorrectCurve(static_cast(field_0x27f4)->getCurveID()); + } else if (name == PROC_Obj_WindStone) { + mZ2WolfHowlMgr.setCorrectCurve(static_cast(field_0x27f4)->getTuneId()); + mProcVar0.field_0x3008 = static_cast(field_0x27f4)->getNextSceneId(); + mProcVar3.field_0x300e.y = 1; + } else if (name == PROC_Obj_SmWStone) { + mZ2WolfHowlMgr.setCorrectCurve(static_cast(field_0x27f4)->getTuneId()); + mProcVar3.field_0x300e.y = 1; + } else if (name == PROC_Tag_WaraHowl) { + mZ2WolfHowlMgr.setCorrectCurve(static_cast(field_0x27f4)->getTuneId()); + } else { + mZ2WolfHowlMgr.setCorrectCurve(-1); + } + } else { + mZ2WolfHowlMgr.setCorrectCurve(-1); + } + + mNormalSpeed = 0.0f; + + if (!checkUnderMove0BckNoArcWolf(WANM_WAIT_SIT) && !checkUnderMove0BckNoArcWolf(WANM_LISTEN) && + !checkUnderMove0BckNoArcWolf(WANM_HOWL_SIT)) + { + setSingleAnimeWolfParam(WANM_SIT, &daAlinkHIO_wlLie_c0::m.field_0x0); + field_0x347c = -1.0f; + } else { + field_0x347c = 10.0f; + + if (mProcVar3.field_0x300e.y == 0) { + setSingleAnimeWolfBaseSpeed(WANM_WAIT_SIT, daAlinkHIO_wlLie_c0::m.field_0x44, + daAlinkHIO_wlLie_c0::m.field_0x48); + } else { + setSingleAnimeWolfBase(WANM_LISTEN); + setFaceBasicTexture(FTANM_UNK_A2); + } + } + + dCam_getBody()->StartEventCamera(12, fopAcM_GetID(this), 0); + mProcVar1.field_0x300a = 0; + mMsgClassID = -1; + field_0x32cc = 0x5DD; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.x = -1; + mDoAud_taktModeMute(); + + if (checkStageName("F_SP200")) { + fopAc_ac_c* gwolf_p = + (fopAc_ac_c*)fopAcIt_Judge((fopAcIt_JudgeFunc)daAlink_searchGoldWolf, NULL); + field_0x280c.setData(gwolf_p); + } else { + field_0x280c.clearData(); + } + + dComIfGp_setPlayerStatus1(0, 0x4000000); + return 1; +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm int daAlink_c::procWolfHowlDemoInit() { + nofralloc +#include "asm/d/a/d_a_alink/procWolfHowlDemoInit__9daAlink_cFv.s" +} +#pragma pop +#endif + +/* 80130BC4-801312C8 12B504 0704+00 1/0 0/0 0/0 .text procWolfHowlDemo__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfHowlDemo() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + daNpc_GWolf_c* gwolf_p = (daNpc_GWolf_c*)field_0x280c.getActor(); + + BOOL skip_edge = i_dComIfGp_getEvent().i_checkSkipEdge(); + if (skip_edge) { + mZ2WolfHowlMgr.skipCorrectDemo(); + } + + if (checkEndMessage(field_0x32cc) || + (skip_edge && (field_0x32cc == 0x535 || field_0x32cc == 0x532))) + { + if (mProcVar2.field_0x300c == 0) { + resetSpecialEvent(); + field_0x30b2 = 0; + field_0x30b0 = 0; + mDoAud_taktModeMuteOff(); + return 1; + } + } else if (field_0x32cc == 0x535 || field_0x32cc == 0x532) { + if (checkUnderMove0BckNoArcWolf(WANM_HOWL_END) && checkAnmEnd(frameCtrl_p)) { + setSingleAnimeWolfBase(WANM_SERVICE_WAIT_D); + } + + return 1; + } + + if (field_0x347c < 0.0f) { + if (checkAnmEnd(frameCtrl_p)) { + if (mProcVar3.field_0x300e.y != 0) { + setSingleAnimeWolfBase(WANM_LISTEN); + setFaceBasicTexture(FTANM_UNK_A2); + } else { + setSingleAnimeWolfBaseSpeed(WANM_WAIT_SIT, daAlinkHIO_wlLie_c0::m.field_0x44, + daAlinkHIO_wlLie_c0::m.field_0x48); + } + + field_0x347c = 1.0f; + } + } else if (field_0x347c > 1.5f) { + field_0x347c -= 1.0f; + } else { + bool var_r26 = mDoCPd_c::getHoldA(PAD_1) != false; + if (mProcVar3.field_0x300e.y != 0 && mProcVar2.field_0x300c != 0) { + var_r26 = false; + } + + if (checkUnderMove0BckNoArcWolf(WANM_HOWL_SUCCESS)) { + if (gwolf_p == NULL) { + i_dComIfGp_getEvent().i_startCheckSkipEdge(this); + } + } else if (checkUnderMove0BckNoArcWolf(WANM_HOWL_END)) { + if (gwolf_p == NULL) { + i_dComIfGp_getEvent().i_startCheckSkipEdge(this); + } + } else if ((var_r26 || mZ2WolfHowlMgr.getTimer() != 0) && + mZ2WolfHowlMgr.getReleaseTimer() != 30) + { + if (!checkUnderMove0BckNoArcWolf(WANM_HOWL_SIT) || mProcVar1.field_0x300a == 0) { + mProcVar1.field_0x300a = 1; + setSingleAnimeWolfParam(WANM_HOWL_SIT, &daAlinkHIO_wlHowl_c0::m.field_0x14); + } else { + if (frameCtrl_p->getFrame() > 56.0f) { + frameCtrl_p->setFrame((frameCtrl_p->getFrame() - 56.0f) + 38.0f); + } + + if (frameCtrl_p->getFrame() >= 38.0f && frameCtrl_p->getFrame() <= 56.0f) { + i_onResetFlg0(RFLG0_UNK_40000000); + } + } + } else { + if (mZ2WolfHowlMgr.getReleaseTimer() == 30) { + frameCtrl_p->setFrame(56.0f); + field_0x2060->initOldFrameMorf(3.0f, 0, 40); + } + + mProcVar1.field_0x300a = 0; + + if (dMsgObject_isHowlHearingMode() && + (checkAnmEnd(frameCtrl_p) || checkUnderMove0BckNoArcWolf(WANM_WAIT_SIT))) + { + setSingleAnimeWolfBase(WANM_LISTEN); + setFaceBasicTexture(FTANM_UNK_A2); + } else if (checkAnmEnd(frameCtrl_p)) { + setSingleAnimeWolfBaseSpeed(WANM_WAIT_SIT, daAlinkHIO_wlLie_c0::m.field_0x44, + daAlinkHIO_wlLie_c0::m.field_0x48); + } + } + + s16 var_r25 = mProcVar3.field_0x300e.x; + f32 stick_y = mDoCPd_c::getStickY(PAD_1); + mProcVar3.field_0x300e.x = mZ2WolfHowlMgr.startWolfHowlSound(0.0f, stick_y, var_r26, 0.0f); + s16 var_r26_2 = 0; + + if (mProcVar3.field_0x300e.x == -1 || skip_edge) { + if (checkUnderMove0BckNoArcWolf(WANM_HOWL_END) || skip_edge) { + if (checkAnmEnd(frameCtrl_p) || skip_edge) { + if (mProcVar0.mHowlExitID >= 0) { + dStage_changeScene(mProcVar0.mHowlExitID, 0.0f, 0, fopAcM_GetRoomNo(this), + shape_angle.y, -1); + } else { + fopAc_ac_c* actor_p = NULL; + if (gwolf_p == NULL) { + fopAcIt_Executor((fopAcIt_ExecutorFunc)daAlink_searchWolfHowl, + &actor_p); + } else { + actor_p = gwolf_p; + } + + field_0x30b2 = 0; + field_0x30b0 = 0; + + if (actor_p != NULL) { + fopAcM_OnStatus(actor_p, 0x800); + + if (fopAcM_GetName(actor_p) == PROC_KAGO) { + static_cast(actor_p)->setEvent(); + static_cast(actor_p)->setKagoPath( + mProcVar3.field_0x300e.z); + } else if (fopAcM_GetName(actor_p) == PROC_OBJ_SEKIZOA) { + static_cast(actor_p)->setWolfHowling(); + } else if (fopAcM_GetName(actor_p) == PROC_E_PM) { + static_cast(actor_p)->AppearSet(); + } else if (fopAcM_GetName(actor_p) == PROC_HORSE) { + int ret = static_cast(actor_p)->callHorse(¤t.pos); + + if (ret == 1 || ret == 2) { + mDoAud_taktModeMuteOff(); + return procCoHorseCallWaitInit(ret); + } + + if (ret != 3) { + setWolfHowlNotHappen(skip_edge); + return 1; + } + } else if (fopAcM_GetName(actor_p) == PROC_NPC_TK) { + static_cast(actor_p)->setEventWolf(); + static_cast(actor_p)->setHawkPath( + mProcVar3.field_0x300e.z); + } + } else if (mProcVar3.field_0x300e.y == 0) { + setWolfHowlNotHappen(skip_edge); + return 1; + } + + if (gwolf_p == NULL) { + resetSpecialEvent(); + } else { + endDemoMode(); + } + + mDoAud_taktModeMuteOff(); + } + + procWolfServiceWaitInit(2); + return 1; + } + } else if (var_r25 != -1) { + setSingleAnimeWolfBase(WANM_HOWL_END); + if (gwolf_p != NULL) { + gwolf_p->setHowlingEndFlag(); + } + } else { + var_r26_2 = (s16)(stick_y * -6144.0f); + } + } else if (mProcVar2.field_0x300c == 0) { + mProcVar2.field_0x300c = 1; + dMsgObject_onMsgSend(); + setSingleAnimeWolfBase(WANM_HOWL_SUCCESS); + mUnderFrameCtrl[0].setLoop(27); + mUnderFrameCtrl[0].setAttribute(2); + setFaceBasicTexture(FTANM_UNK_A1); + + if (gwolf_p != NULL) { + fopAcM_OnStatus(gwolf_p, 0x800); + gwolf_p->setHowlingFlag(); + i_dComIfGp_event_reset(); + + dCam_getBody()->EndEventCamera(fopAcM_GetID(this)); + } else { + i_dComIfGp_getEvent().i_startCheckSkipEdge(this); + } + } + + cLib_addCalcAngleS(&field_0x30b2, var_r26_2, 5, 0x800, 0x100); + } + + return 1; +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm int daAlink_c::procWolfHowlDemo() { + nofralloc +#include "asm/d/a/d_a_alink/procWolfHowlDemo__9daAlink_cFv.s" +} +#pragma pop +#endif + +/* 801312C8-80131408 12BC08 0140+00 1/1 0/0 0/0 .text setWolfHowling__15daObj_Sekizoa_cFv + */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm void daObj_Sekizoa_c::setWolfHowling() { + nofralloc +#include "asm/d/a/d_a_alink/setWolfHowling__15daObj_Sekizoa_cFv.s" +} +#pragma pop + +/* 80131408-80131450 12BD48 0048+00 1/0 0/0 0/0 .text checkWolfRope__9daAlink_cFv */ BOOL daAlink_c::checkWolfRope() { - return i_checkModeFlg(0x20000) && field_0x280c.getActor() != NULL && fopAcM_GetName(field_0x280c.getActor()) == PROC_Obj_Crope; + return i_checkModeFlg(0x20000) && field_0x280c.getActor() != NULL && + fopAcM_GetName(field_0x280c.getActor()) == PROC_Obj_Crope; } /* 80131450-80131628 12BD90 01D8+00 2/2 0/0 0/0 .text * checkWolfRopeHit__9daAlink_cCFP12dCcD_GObjInfPC4cXyzi */ +// matches with literals +#ifdef NONMATCHING +fopAc_ac_c* daAlink_c::checkWolfRopeHit(dCcD_GObjInf* i_collider, cXyz const* param_1, + int param_2) const { + daObjCrope_c* rope_p = (daObjCrope_c*)i_collider->GetCoHitAc(); + + if (i_collider->ChkCoHit() && rope_p != NULL && fopAcM_GetName(rope_p) == PROC_Obj_Crope) { + if (param_2) { + if (rope_p->getRopeStartPos()->abs2XZ(*param_1) > 10000.0f) { + if (rope_p->getRopeEndPos()->abs2XZ(*param_1) > 10000.0f) { + return rope_p; + } + } + } else if (checkInputOnR()) { + mDoMtx_stack_c::YrotS(-rope_p->shape_angle.y); + mDoMtx_stack_c::transM(-rope_p->getRopeStartPos()->x, -rope_p->getRopeStartPos()->y, + -rope_p->getRopeStartPos()->z); + + cXyz sp44; + cXyz sp38; + mDoMtx_stack_c::multVec(param_1, &sp44); + mDoMtx_stack_c::multVec(rope_p->getRopeEndPos(), &sp38); + + if (fabsf(sp44.x) < 40.0f && (sp44.z > -10.0f || sp44.z - sp38.z < 10.0f)) { + return rope_p; + } + } + } + + return NULL; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off asm fopAc_ac_c* daAlink_c::checkWolfRopeHit(dCcD_GObjInf* param_0, cXyz const* param_1, - int param_2) const { + int param_2) const { nofralloc #include "asm/d/a/d_a_alink/checkWolfRopeHit__9daAlink_cCFP12dCcD_GObjInfPC4cXyzi.s" } #pragma pop +#endif /* 80131628-801316A4 12BF68 007C+00 2/2 0/0 0/0 .text checkWolfRopeJumpHang__9daAlink_cFv */ int daAlink_c::checkWolfRopeJumpHang() { - fopAc_ac_c* hit_actor = checkWolfRopeHit(&field_0x850[0], ¤t.pos, 1); + fopAc_ac_c* hit_actor = checkWolfRopeHit(&field_0x850[0], ¤t.pos, TRUE); if (hit_actor == NULL) { - hit_actor = checkWolfRopeHit(&field_0xFB8, ¤t.pos, 1); + hit_actor = checkWolfRopeHit(&field_0xFB8, ¤t.pos, TRUE); } if (hit_actor != NULL) { @@ -1474,6 +3567,43 @@ asm f32 daAlink_c::getWolfRopeMoveSpeed() { #endif /* 80131718-801319F0 12C058 02D8+00 6/6 0/0 0/0 .text setWolfRopePosY__9daAlink_cFv */ +#ifdef NONMATCHING +int daAlink_c::setWolfRopePosY() { + daObjCrope_c* temp_r3 = (daObjCrope_c*)field_0x280c.getActor(); + cXyz* temp_r28 = temp_r3->getRopeStartPos(); + cXyz* temp_r27 = temp_r3->getRopeEndPos(); + cXyz* temp_r26 = temp_r3->getRopeVec(); + f32 temp_f30 = temp_r3->getStartRate(¤t.pos); + + if (mProcID == PROC_WOLF_ROPE_MOVE && (temp_r3->getStartRate(&mLeftHandPos) < 0.0f || + temp_r3->getStartRate(&mLeftHandPos) > 1.0f || + temp_r3->getStartRate(&mRightHandPos) < 0.0f || + temp_r3->getStartRate(&mRightHandPos) > 1.0f || + temp_r3->getStartRate(&mLeftFootPos) < 0.0f || + temp_r3->getStartRate(&mLeftFootPos) > 1.0f || + temp_r3->getStartRate(&mRightFootPos) < 0.0f || + temp_r3->getStartRate(&mRightFootPos) > 1.0f)) + { + if (temp_r28->abs2XZ(current.pos) > temp_r27->abs2XZ(current.pos)) { + current.pos.y = temp_r27->y; + } else { + current.pos.y = temp_r28->y; + } + temp_r3->onOutFlg(); + return 1; + } else { + if (temp_f30 < 0.0f) { + current.pos.y = temp_r28->y; + } else if (temp_f30 > 1.0f) { + current.pos.y = temp_r27->y; + } else { + current.pos.y = ((temp_r28->y + (temp_f30 * temp_r26->y)) - 40.0f) - + (10.0f * cM_fsin(M_PI * temp_f30)); + } + return 0; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1482,6 +3612,7 @@ asm int daAlink_c::setWolfRopePosY() { #include "asm/d/a/d_a_alink/setWolfRopePosY__9daAlink_cFv.s" } #pragma pop +#endif /* 801319F0-80131A6C 12C330 007C+00 5/5 0/0 0/0 .text initWolfRopeShapeAngle__9daAlink_cFv */ s16 daAlink_c::initWolfRopeShapeAngle() { @@ -1501,6 +3632,19 @@ s16 daAlink_c::initWolfRopeShapeAngle() { } /* 80131A6C-80131AFC 12C3AC 0090+00 5/5 0/0 0/0 .text wolfRopeSwingInc__9daAlink_cFf */ +// matches with literals +#ifdef NONMATCHING +void daAlink_c::wolfRopeSwingInc(f32 param_0) { + field_0x3478 += param_0; + + u32 var_r6 = (u32)((field_0x3478 * 127.0f) / 100.0f); + if (var_r6 > 127) { + var_r6 = 127; + } + + mDoAud_seStart(Z2SE_FN_ROPE_CREAK_ADD, ¤t.pos, var_r6, mVoiceReverbIntensity); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1509,8 +3653,33 @@ asm void daAlink_c::wolfRopeSwingInc(f32 param_0) { #include "asm/d/a/d_a_alink/wolfRopeSwingInc__9daAlink_cFf.s" } #pragma pop +#endif /* 80131AFC-80131C00 12C43C 0104+00 8/8 0/0 0/0 .text setWolfRopeOffsetY__9daAlink_cFi */ +// matches with literals +#ifdef NONMATCHING +void daAlink_c::setWolfRopeOffsetY(int param_0) { + if (param_0) { + field_0x3478 = 0.0f; + field_0x2b98 = 0.0f; + mProcVar0.field_0x3008 = 0; + } else { + if (field_0x3478 > 100.0f) { + field_0x3478 = 100.0f; + } + + cLib_addCalc(&field_0x3478, 2.0f, 0.05f, 1.0f, 0.05f); + field_0x2b98 = field_0x3478 * (cM_scos(mProcVar0.field_0x3008) - 1.0f) * 0.5f; + + f32 var_f3 = field_0x3478 - 2.0f; + if (var_f3 > 2.0f) { + var_f3 = 2.0f; + } + + mProcVar0.field_0x3008 += var_f3 * (f32)0x600 + (f32)0xC00; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1519,6 +3688,7 @@ asm void daAlink_c::setWolfRopeOffsetY(int param_0) { #include "asm/d/a/d_a_alink/setWolfRopeOffsetY__9daAlink_cFi.s" } #pragma pop +#endif /* 80131C00-80131C74 12C540 0074+00 2/2 0/0 0/0 .text getDirectionRopeMove__9daAlink_cCFv */ @@ -1542,6 +3712,39 @@ int daAlink_c::getDirectionRopeMove() const { /* 80131C74-80131DA0 12C5B4 012C+00 5/5 0/0 0/0 .text procWolfRopeMoveInit__9daAlink_cFii */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfRopeMoveInit(int param_0, int param_1) { + daObjCrope_c* rope_p = (daObjCrope_c*)field_0x280c.getActor(); + commonProcInit(PROC_WOLF_ROPE_MOVE); + mProcVar2.field_0x300c = initWolfRopeShapeAngle(); + current.angle.y = shape_angle.y; + + setSingleAnimeWolfBaseSpeed(WANM_ROPE_WALK, 0.0f, daAlinkHIO_wlRope_c0::m.field_0x20); + if (param_0) { + mUnderFrameCtrl[0].setFrame(13.5f); + getNowAnmPackUnder(UNDER_0)->setFrame(13.5f); + } + + setSpecialGravity(0.0f, mMaxFallSpeed, 0); + speed.y = 0.0f; + + if (param_1) { + current.pos = rope_p->getPlayerNearPos(); + field_0x3478 = 0.0f; + mProcVar0.field_0x3008 = 0; + } + + setWolfRopeOffsetY(setWolfRopePosY()); + if (checkWolfGrabAnime()) { + field_0x30a0 = -0x1800; + } + + mProcVar3.field_0x300e.x = 0; + initServiceWaitTime(); + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1550,6 +3753,7 @@ asm int daAlink_c::procWolfRopeMoveInit(int param_0, int param_1) { #include "asm/d/a/d_a_alink/procWolfRopeMoveInit__9daAlink_cFii.s" } #pragma pop +#endif /* 80131DA0-80132738 12C6E0 0998+00 1/0 0/0 0/0 .text procWolfRopeMove__9daAlink_cFv */ #pragma push @@ -1563,6 +3767,62 @@ asm int daAlink_c::procWolfRopeMove() { /* 80132738-80132914 12D078 01DC+00 5/5 0/0 0/0 .text procWolfRopeHangInit__9daAlink_cFi */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfRopeHangInit(int param_0) { + daObjCrope_c* rope_p = (daObjCrope_c*)field_0x280c.getActor(); + commonProcInit(PROC_WOLF_ROPE_HANG); + + if (param_0 != 4) { + mProcVar3.field_0x300e.x = 0; + setSingleAnimeWolf(WANM_HANG, daAlinkHIO_wlRope_c0::m.field_0x28, 0.0f, 16, + daAlinkHIO_wlRope_c0::m.field_0x2C); + rope_p->rideKeep(); + } else { + mProcVar3.field_0x300e.x = 1; + + daAlink_WANM climb_anm; + s16 temp_r0 = shape_angle.y - rope_p->shape_angle.y; + if ((temp_r0 >= 0 && temp_r0 < 0x4000) || temp_r0 <= -0x4000) { + param_0 = 3; + climb_anm = WANM_ROPE_CLIMB_RIGHT; + } else { + param_0 = 2; + climb_anm = WANM_ROPE_CLIMB_LEFT; + } + + setSingleAnimeWolfBaseSpeed(climb_anm, daAlinkHIO_wlRope_c0::m.field_0x28, + daAlinkHIO_wlRope_c0::m.field_0x30); + rope_p->setFrontJoint(19); + rope_p->setBackJoint(23); + current.pos = rope_p->getPlayerNearPos(); + + field_0x2f99 = 0; + dComIfGp_getVibration().StartShock(2, 15, cXyz(0.0f, 1.0f, 0.0f)); + } + + field_0x3198 = param_0; + mProcVar3.field_0x300e.y = initWolfRopeShapeAngle(); + mProcVar2.field_0x300c = 0; + + if (param_0 == 2) { + shape_angle.y -= 0x4000; + mProcVar3.field_0x300e.y = -mProcVar3.field_0x300e.y; + } else { + shape_angle.y += 0x4000; + } + + wolfRopeSwingInc(50.0f); + mProcVar0.field_0x3008 = 0; + setWolfRopePosY(); + setWolfRopeOffsetY(0); + setSpecialGravity(0.0f, mMaxFallSpeed, 0); + speed.y = 0.0f; + mNormalSpeed = 0.0f; + shape_angle.x = 0; + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1571,6 +3831,7 @@ asm int daAlink_c::procWolfRopeHangInit(int param_0) { #include "asm/d/a/d_a_alink/procWolfRopeHangInit__9daAlink_cFi.s" } #pragma pop +#endif /* 80132914-80132D68 12D254 0454+00 1/0 0/0 0/0 .text procWolfRopeHang__9daAlink_cFv */ #pragma push @@ -1584,6 +3845,27 @@ asm int daAlink_c::procWolfRopeHang() { /* 80132D68-80132E88 12D6A8 0120+00 1/1 0/0 0/0 .text procWolfRopeTurnInit__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfRopeTurnInit() { + commonProcInit(PROC_WOLF_ROPE_TURN); + setSingleAnimeWolfParam(WANM_ROPE_TURN, &daAlinkHIO_wlRope_c0::m.field_0x0); + voiceStart(Z2SE_WL_V_BREATH_JUMP); + setSpecialGravity(0.0f, mMaxFallSpeed, 0); + speed.y = 0.0f; + mNormalSpeed = 0.0f; + + mProcVar3.field_0x300e.x = initWolfRopeShapeAngle(); + current.angle.y = shape_angle.y + 0x8000; + field_0x3588 = l_wolfBaseAnime; + shape_angle.x = 0; + field_0x37c8 = current.pos; + mProcVar2.field_0x300c = 0; + field_0x347c = 1.0f / mUnderFrameCtrl[0].getEnd(); + static_cast(field_0x280c.getActor())->rideKeep(); + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1592,6 +3874,7 @@ asm int daAlink_c::procWolfRopeTurnInit() { #include "asm/d/a/d_a_alink/procWolfRopeTurnInit__9daAlink_cFv.s" } #pragma pop +#endif /* 80132E88-80133054 12D7C8 01CC+00 1/0 0/0 0/0 .text procWolfRopeTurn__9daAlink_cFv */ #pragma push @@ -1604,6 +3887,37 @@ asm int daAlink_c::procWolfRopeTurn() { #pragma pop /* 80133054-80133164 12D994 0110+00 1/1 0/0 0/0 .text procWolfRopeStaggerInit__9daAlink_cFi */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfRopeStaggerInit(int param_0) { + commonProcInit(PROC_WOLF_ROPE_STAGGER); + + if (param_0 == 4) { + setSingleAnimeWolfBase(WANM_ROPE_WAIT); + mNormalSpeed = 0.0f; + mProcVar3.field_0x300e.x = 1; + } else { + setSingleAnimeWolfBase(WANM_ROPE_FALTER); + field_0x3588 = l_wolfRopeBaseAnime; + mProcVar3.field_0x300e.x = 0; + } + + mProcVar3.field_0x300e.y = param_0; + mProcVar2.field_0x300c = initWolfRopeShapeAngle(); + setSpecialGravity(0.0f, mMaxFallSpeed, 0); + speed.y = 0.0f; + current.angle.y = shape_angle.y; + + if (checkWolfGrabAnime()) { + field_0x30a0 = -0x1800; + } + + daObjCrope_c* rope_p = (daObjCrope_c*)field_0x280c.getActor(); + rope_p->setFrontJoint(19); + rope_p->setBackJoint(31); + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1612,6 +3926,7 @@ asm int daAlink_c::procWolfRopeStaggerInit(int param_0) { #include "asm/d/a/d_a_alink/procWolfRopeStaggerInit__9daAlink_cFi.s" } #pragma pop +#endif /* 80133164-8013384C 12DAA4 06E8+00 1/0 0/0 0/0 .text procWolfRopeStagger__9daAlink_cFv */ @@ -1630,10 +3945,11 @@ int daAlink_c::procWolfRopeSubjectivityInit() { commonProcInit(PROC_WOLF_ROPE_SUBJECTIVITY); if (!checkUnderMove0BckNoArcWolf(WANM_ROPE_WALK)) { - setSingleAnimeWolfBaseSpeed(WANM_ROPE_WALK, FLOAT_LABEL(lit_6108), daAlinkHIO_wlRope_c0::m.field_0x20); + setSingleAnimeWolfBaseSpeed(WANM_ROPE_WALK, FLOAT_LABEL(lit_6108), + daAlinkHIO_wlRope_c0::m.field_0x20); } - field_0x300c = initWolfRopeShapeAngle(); + mProcVar2.field_0x300c = initWolfRopeShapeAngle(); current.angle.y = shape_angle.y; setSpecialGravity(FLOAT_LABEL(lit_6108), mMaxFallSpeed, 0); @@ -1664,24 +3980,67 @@ asm int daAlink_c::procWolfRopeSubjectivity() { /* 80133D6C-80133EF0 12E6AC 0184+00 0/0 0/0 1/1 .text getWolfTagJumpTime__9daAlink_cCFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::getWolfTagJumpTime() const { + int time; + if (mProcID == PROC_WOLF_TAG_JUMP) { + time = mProcVar0.field_0x3008 + (int)((daAlinkHIO_wlPoint_c0::m.field_0x28.mCheckFrame - + daAlinkHIO_wlPoint_c0::m.field_0x28.mStartFrame) / + daAlinkHIO_wlPoint_c0::m.field_0x28.mSpeed); + } else { + time = (int)(checkMidnaLockJumpPoint()->abs(current.pos) / + daAlinkHIO_wlPoint_c0::m.field_0x68); + } + + time -= 2; + if (time < 1) { + time = 1; + } + + return time; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daAlink_c::getWolfTagJumpTime() const { +asm int daAlink_c::getWolfTagJumpTime() const { nofralloc #include "asm/d/a/d_a_alink/getWolfTagJumpTime__9daAlink_cCFv.s" } #pragma pop +#endif /* 80133EF0-80134000 12E830 0110+00 3/3 1/1 1/1 .text checkMidnaLockJumpPoint__9daAlink_cCFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm cXyz* daAlink_c::checkMidnaLockJumpPoint() const { - nofralloc -#include "asm/d/a/d_a_alink/checkMidnaLockJumpPoint__9daAlink_cCFv.s" +const cXyz* daAlink_c::checkMidnaLockJumpPoint() const { + if ((!mLinkAcch.i_ChkGroundHit() && mProcID != PROC_WOLF_TAG_JUMP) || checkMidnaUseAbility() || + getMidnaActor()->mEvtInfo.checkCommandTalk()) + { + return NULL; + } + + daPy_py_c* player_p = daPy_getLinkPlayerActorClass(); + fopAc_ac_c* partner_p = fopAcM_getTalkEventPartner(player_p); + fopAc_ac_c* wljump_p = NULL; + + if (checkWolfTagLockJumpReady()) { + return &field_0x3738; + } + + if (mProcID == PROC_WOLF_TAG_JUMP && field_0x280c.getActorConst() != NULL) { + wljump_p = field_0x280c.getActorConst(); + } else if (field_0x27f4 != NULL && fopAcM_GetName(field_0x27f4) == PROC_Tag_Wljump) { + wljump_p = field_0x27f4; + } else if (partner_p != NULL && fopAcM_GetName(partner_p) == PROC_Tag_Wljump) { + wljump_p = partner_p; + } + + if (wljump_p != NULL) { + return static_cast(wljump_p)->getLockPos(); + } + + return NULL; } -#pragma pop /* 80134000-80134838 12E940 0838+00 4/4 0/0 0/0 .text * procWolfTagJumpInit__9daAlink_cFP10fopAc_ac_c */ @@ -1706,6 +4065,33 @@ asm int daAlink_c::procWolfTagJump() { /* 80134DB8-80134EBC 12F6F8 0104+00 1/1 0/0 0/0 .text * procWolfTagJumpLandInit__9daAlink_cFP10fopAc_ac_c */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfTagJumpLandInit(fopAc_ac_c* param_0) { + commonProcInit(PROC_WOLF_TAG_JUMP_LAND); + setSingleAnimeWolfParam(WANM_ATTACK_A_END_FRONT, &daAlinkHIO_wlPoint_c0::m.field_0x3C); + + if (field_0x2fa8 == 8) { + mNormalSpeed = daAlinkHIO_wlPoint_c0::m.field_0x6C; + } else { + mNormalSpeed = 0.0f; + } + + speed.y = 0.0f; + field_0x3588 = l_wolfBaseAnime; + + if (param_0 != NULL) { + field_0x280c.setData(param_0); + } + + field_0x2f9d = 0x78; + setFootEffectProcType(1); + field_0x2f99 = 12; + + dComIfGp_getVibration().StartShock(2, 15, cXyz(0.0f, 1.0f, 0.0f)); + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1714,9 +4100,50 @@ asm int daAlink_c::procWolfTagJumpLandInit(fopAc_ac_c* param_0) { #include "asm/d/a/d_a_alink/procWolfTagJumpLandInit__9daAlink_cFP10fopAc_ac_c.s" } #pragma pop +#endif /* 80134EBC-80135050 12F7FC 0194+00 1/0 0/0 0/0 .text procWolfTagJumpLand__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfTagJumpLand() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + + daTagWljump_c* wljump_p = (daTagWljump_c*)field_0x280c.getActor(); + if (wljump_p != NULL && wljump_p->getLockPos() != NULL) { + i_onResetFlg0(RFLG0_UNK_20000); + field_0x3738 = *wljump_p->getLockPos(); + + if (frameCtrl_p->getFrame() > daAlinkHIO_wlPoint_c0::m.field_0x3C.mCheckFrame) { + setDoStatus(0x93); + + if (doTrigger()) { + return procWolfTagJumpInit(field_0x280c.getActor()); + } + } + } + + field_0x2f99 = 4; + if (cLib_addCalc(&mNormalSpeed, 0.0f, daAlinkHIO_wlPoint_c0::m.field_0x70, + daAlinkHIO_wlPoint_c0::m.field_0x74, + daAlinkHIO_wlPoint_c0::m.field_0x78) < 3.0f) + { + if (checkAnmEnd(frameCtrl_p)) { + checkNextActionWolf(0); + } else if (!(frameCtrl_p->getFrame() > daAlinkHIO_wlPoint_c0::m.field_0x3C.mCheckFrame) || + !checkNextActionWolf(1)) + { + field_0x2f9d = 0x78; + seStartMapInfoLevel(Z2SE_FN_WOLF_SLIP); + } + } else { + field_0x2f9d = 0x78; + seStartMapInfoLevel(Z2SE_FN_WOLF_SLIP); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1725,27 +4152,31 @@ asm int daAlink_c::procWolfTagJumpLand() { #include "asm/d/a/d_a_alink/procWolfTagJumpLand__9daAlink_cFv.s" } #pragma pop +#endif /* 80135050-801350A4 12F990 0054+00 1/1 0/0 0/0 .text daAlink_searchGiant__FP10fopAc_ac_cPv */ -static fopAc_ac_c* daAlink_searchGiant(fopAc_ac_c* param_0, void* param_1) { - cXyz* tmp = static_cast(param_1); +static fopAc_ac_c* daAlink_searchGiant(fopAc_ac_c* i_actor, void* i_data) { + cXyz* gnd_chk_pos = static_cast(i_data); - if (fopAcM_GetName(param_0) == PROC_OBJ_SEKIZOA && param_0->current.pos.abs2(*tmp) < lit_49124) { - return param_0; + if (fopAcM_GetName(i_actor) == PROC_OBJ_SEKIZOA && + i_actor->current.pos.abs2(*gnd_chk_pos) < lit_49124) + { + return i_actor; } return NULL; } /* 801350A4-80135160 12F9E4 00BC+00 1/1 0/0 0/0 .text daAlink_searchGiantTalk__FP10fopAc_ac_cPv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daAlink_searchGiantTalk(fopAc_ac_c* param_0, void* param_1) { - nofralloc -#include "asm/d/a/d_a_alink/daAlink_searchGiantTalk__FP10fopAc_ac_cPv.s" +static void* daAlink_searchGiantTalk(fopAc_ac_c* i_actor, void* i_data) { + if (fopAcM_GetName(i_actor) == PROC_OBJ_SEKIZOA && + static_cast(i_actor)->getType() == 0) + { + return i_actor; + } + + return NULL; } -#pragma pop /* 80135160-801351F8 12FAA0 0098+00 1/1 0/0 0/0 .text procWolfGiantPuzzleInit__9daAlink_cFv */ int daAlink_c::procWolfGiantPuzzleInit() { @@ -1757,7 +4188,7 @@ int daAlink_c::procWolfGiantPuzzleInit() { current.angle.y = shape_angle.y; field_0x2f98 = 4; - field_0x300c = shape_angle.y; + mProcVar2.mPuzzleAimAngle = shape_angle.y; field_0x3478 = FLOAT_LABEL(lit_6108); field_0x347c = daAlinkHIO_wlMoveNoP_c0::m.field_0x10; field_0x594 = daAlinkHIO_wlMoveNoP_c0::m.field_0x8; @@ -1768,6 +4199,67 @@ int daAlink_c::procWolfGiantPuzzleInit() { /* 801351F8-80135458 12FB38 0260+00 1/0 0/0 0/0 .text procWolfGiantPuzzle__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfGiantPuzzle() { + if (mSpecialMode == 0) { + return checkNextActionWolf(0); + } + + if (!i_checkNoResetFlg0(FLG0_UNK_4000) && mProcVar2.field_0x300c == shape_angle.y && + mSpecialMode != 0x28 && checkZeroSpeedF()) + { + setDoStatusEmphasys(0x1C); + + if (doTrigger()) { + fopAc_ac_c* giant_p = + (fopAc_ac_c*)fopAcIt_Judge((fopAcIt_JudgeFunc)daAlink_searchGiantTalk, NULL); + if (giant_p != NULL) { + fopAcM_orderTalkEvent(this, giant_p, 0, 0); + } + } else if (checkInputOnR()) { + int direction = getDirectionFromShapeAngle(); + if (direction == DIR_FORWARD) { + cXyz gnd_chk_pos(current.pos.x + cM_ssin(shape_angle.y) * 600.0f, + current.pos.y + 10.0f, + current.pos.z + cM_scos(shape_angle.y) * 600.0f); + mLinkGndChk.SetPos(&gnd_chk_pos); + + if (fabsf(dComIfG_Bgsp().GroundCross(&mLinkGndChk) - current.pos.y) < 0.1f && + fopAcIt_Judge((fopAcIt_JudgeFunc)daAlink_searchGiant, &gnd_chk_pos) == NULL) + { + field_0x347c = daAlinkHIO_wlMoveNoP_c0::m.field_0xC; + field_0x3478 = field_0x594; + } + } else if (direction == DIR_LEFT) { + mProcVar2.mPuzzleAimAngle += 0x4000; + } else if (direction == DIR_RIGHT) { + mProcVar2.mPuzzleAimAngle -= 0x4000; + } else { + mProcVar2.mPuzzleAimAngle += 0x8000; + } + } + } + + cLib_chaseF(&mNormalSpeed, field_0x3478, field_0x347c); + + if (mProcVar2.mPuzzleAimAngle != shape_angle.y) { + cLib_addCalcAngleS( + &shape_angle.y, mProcVar2.mPuzzleAimAngle, daAlinkHIO_wlMoveNoP_c0::m.field_0x4, + daAlinkHIO_wlMoveNoP_c0::m.field_0x0, daAlinkHIO_wlMoveNoP_c0::m.field_0x2); + current.angle.y = shape_angle.y; + } + + if (checkZeroSpeedF()) { + onModeFlg(1); + } else { + offModeFlg(1); + } + + setBlendWolfMoveAnime(-1.0f); + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1776,6 +4268,7 @@ asm int daAlink_c::procWolfGiantPuzzle() { #include "asm/d/a/d_a_alink/procWolfGiantPuzzle__9daAlink_cFv.s" } #pragma pop +#endif /* 80135458-801354C8 12FD98 0070+00 2/2 0/0 0/0 .text setWolfHangGroundY__9daAlink_cFv */ void daAlink_c::setWolfHangGroundY() { @@ -1788,26 +4281,55 @@ void daAlink_c::setWolfHangGroundY() { /* 801354C8-801355EC 12FE08 0124+00 2/2 0/0 0/0 .text changeWolfHangEndProc__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::changeWolfHangEndProc() { + setWolfHangGroundY(); + + f32 var_f1; + if (i_checkNoResetFlg0(FLG0_UNK_80) && mWaterY > field_0x33d8) { + var_f1 = daAlinkHIO_wlSwim_c0::m.field_0x48 + daAlinkHIO_wlSwim_c0::m.field_0x94; + } else { + var_f1 = daAlinkHIO_wlWallHang_c0::m.field_0x88; + } + + if (current.pos.y < (field_0x33d8 + var_f1) - 1.0f) { + return procWolfLandInit(); + } else { + setDoStatus(0x33); + + if (doTrigger()) { + current.pos.x -= cM_ssin(shape_angle.y) * 50.0f; + current.pos.z -= cM_scos(shape_angle.y) * 50.0f; + + i_onNoResetFlg2(FLG2_UNK_200); + procWolfFallInit(2, daAlinkHIO_wlWallHang_c0::m.field_0x98); + return 1; + } + } + + return 0; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daAlink_c::changeWolfHangEndProc() { +asm int daAlink_c::changeWolfHangEndProc() { nofralloc #include "asm/d/a/d_a_alink/changeWolfHangEndProc__9daAlink_cFv.s" } #pragma pop +#endif /* 801355EC-80135668 12FF2C 007C+00 2/2 0/0 0/0 .text procWolfHangReadyInit__9daAlink_cFv */ int daAlink_c::procWolfHangReadyInit() { commonProcInit(PROC_WOLF_HANG_READY); - setSingleAnimeWolf(WANM_VJMP_START, - daAlinkHIO_wlWallHang_c0::m.field_0x0.mSpeed, - daAlinkHIO_wlWallHang_c0::m.field_0x0.mStartFrame, - 12, + setSingleAnimeWolf(WANM_VJMP_START, daAlinkHIO_wlWallHang_c0::m.field_0x0.mSpeed, + daAlinkHIO_wlWallHang_c0::m.field_0x0.mStartFrame, 12, daAlinkHIO_wlWallHang_c0::m.field_0x0.mInterpolation); field_0x3198 = field_0x2f91; - field_0x300c = field_0x306e + 0x8000; + mProcVar2.field_0x300c = field_0x306e + 0x8000; f32 tmp_0 = FLOAT_LABEL(lit_6108); mNormalSpeed = tmp_0; @@ -1820,11 +4342,11 @@ int daAlink_c::procWolfHangReadyInit() { int daAlink_c::procWolfHangReady() { daPy_frameCtrl_c* frameCtrl = mUnderFrameCtrl; - cLib_addCalcAngleS(&shape_angle.y, field_0x300c, 2, 0x1000, 0x400); + cLib_addCalcAngleS(&shape_angle.y, mProcVar2.field_0x300c, 2, 0x1000, 0x400); current.angle.y = shape_angle.y; if (frameCtrl->checkAnmEnd()) { - shape_angle.y = field_0x300c; + shape_angle.y = mProcVar2.field_0x300c; current.angle.y = shape_angle.y; if (!procWolfHangWallCatchInit(field_0x3198)) { @@ -1847,6 +4369,58 @@ asm int daAlink_c::procWolfHangWallCatchInit(int param_0) { /* 80135AF4-80135CD8 130434 01E4+00 1/0 0/0 0/0 .text procWolfHangWallCatch__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfHangWallCatch() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + + if (mProcVar3.field_0x300e.x != 0 && frameCtrl_p->getFrame() >= 23.0f) { + field_0x2f99 = 4; + offModeFlg(0x4000); + } else if (changeWolfHangEndProc()) { + return 1; + } + + f32 temp_f2 = field_0x3478; + field_0x3478 = mpLinkModel->i_getAnmMtx(0)[1][3]; + if (temp_f2 < field_0x33b8 && field_0x3478 >= field_0x33b8) { + seStartMapInfo(Z2SE_WL_OUTOF_WATER); + } + + if (checkAnmEnd(frameCtrl_p)) { + if (mProcVar3.field_0x300e.x == 0) { + if (field_0x3174 == 6) { + if (mProcVar3.field_0x300e.y == 0) { + setSingleAnimeWolf(WANM_HANG, daAlinkHIO_wlWallHang_c0::m.field_0x28.mSpeed, + 35.0f, daAlinkHIO_wlWallHang_c0::m.field_0x28.mEndFrame, + 5.0f); + mProcVar3.field_0x300e.y = 1; + } + } else { + setSingleAnimeWolf(WANM_VJMP_CLIMB, daAlinkHIO_wlWallHang_c0::m.field_0x14.mSpeed, + 17.0f, daAlinkHIO_wlWallHang_c0::m.field_0x14.mEndFrame, 2.0f); + mProcVar3.field_0x300e.x = 1; + } + } else { + checkNextActionWolf(0); + int temp_r3 = mProcVar2.field_0x300c; + + if (mProcID == PROC_WOLF_WAIT && temp_r3 != 0) { + procWolfSwimEndWaitInit(0); + } + + i_onNoResetFlg1(FLG1_UNK_20); + } + } else if (mProcVar3.field_0x300e.x != 0 && + frameCtrl_p->getFrame() > daAlinkHIO_wlWallHang_c0::m.field_0x14.mCheckFrame && + checkNextActionWolf(1)) + { + i_onNoResetFlg1(FLG1_UNK_20); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1855,9 +4429,62 @@ asm int daAlink_c::procWolfHangWallCatch() { #include "asm/d/a/d_a_alink/procWolfHangWallCatch__9daAlink_cFv.s" } #pragma pop +#endif /* 80135CD8-80135F00 130618 0228+00 1/1 0/0 0/0 .text * procWolfHangFallStartInit__9daAlink_cFP8cM3dGPla */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfHangFallStartInit(cM3dGPla* param_0) { + if (mProcID == PROC_WOLF_HANG_WALL_CATCH || i_checkNoResetFlg1(FLG1_UNK_20)) { + return 0; + } + + s16 var_r30 = param_0->mNormal.atan2sX_Z(); + current.pos.x -= param_0->mNormal.x * 1.5f; + current.pos.z -= param_0->mNormal.z * 1.5f; + + checkHangStartSideWall(var_r30); + + cXyz gnd_chk_pos(current.pos.x, current.pos.y + 50.0f, current.pos.z); + mLinkGndChk.SetPos(&gnd_chk_pos); + gnd_chk_pos.y = dComIfG_Bgsp().GroundCross(&mLinkGndChk); + + if (gnd_chk_pos.y != -1000000000.0f) { + if (gnd_chk_pos.y < current.pos.y + l_autoDownHeight) { + return 0; + } + + current.pos.y = gnd_chk_pos.y; + } + + commonProcInit(PROC_WOLF_HANG_FALL_START); + setOldRootQuaternion(0, shape_angle.y - (var_r30 + 0x8000), 0); + shape_angle.y = var_r30 + 0x8000; + current.angle.y = shape_angle.y; + + setSingleAnimeWolfParam(WANM_HANG, &daAlinkHIO_wlWallHang_c0::m.field_0x28); + + f32 sin = cM_ssin(shape_angle.y); + f32 cos = cM_scos(shape_angle.y); + cXyz line_start(current.pos.x - sin * 50.0f, current.pos.y - 120.0f, + current.pos.z - cos * 50.0f); + cXyz line_end(current.pos.x + sin, line_start.y, current.pos.z + cos); + + if (commonLineCheck(&line_start, &line_end)) { + mProcVar2.field_0x300c = 1; + } else { + mProcVar2.field_0x300c = 0; + } + + mProcVar3.field_0x300e.x = 0; + mNormalSpeed = 0.0f; + speed.y = 0.0f; + dComIfGp_setPlayerStatus0(0, 0x100); + field_0x33d8 = mLinkAcch.GetGroundH(); + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1866,9 +4493,42 @@ asm int daAlink_c::procWolfHangFallStartInit(cM3dGPla* param_0) { #include "asm/d/a/d_a_alink/procWolfHangFallStartInit__9daAlink_cFP8cM3dGPla.s" } #pragma pop +#endif /* 80135F00-80136064 130840 0164+00 1/0 0/0 0/0 .text procWolfHangFallStart__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfHangFallStart() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + + if (field_0x2060->getOldFrameRate() < 0.1f && changeWolfHangEndProc()) { + return 1; + } + + if (frameCtrl_p->checkPass(6.0f)) { + dComIfGp_getVibration().StartShock(1, 1, cXyz(0.0f, 1.0f, 0.0f)); + } + + if (mProcVar2.field_0x300c == 0 && mProcVar3.field_0x300e.x == 0) { + if (frameCtrl_p->getFrame() > 22.0f) { + frameCtrl_p->setFrame(22.0f); + getNowAnmPackUnder(UNDER_0)->setFrame(22.0f); + + if (checkInputOnR() && getDirectionFromShapeAngle() == DIR_FORWARD) { + mProcVar3.field_0x300e.x = 1; + } + } + } else if (checkAnmEnd(mUnderFrameCtrl) && + ((checkInputOnR() && getDirectionFromShapeAngle() == DIR_FORWARD) || + mProcVar3.field_0x300e.x != 0)) + { + procWolfHangWallCatchInit(8); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1877,6 +4537,7 @@ asm int daAlink_c::procWolfHangFallStart() { #include "asm/d/a/d_a_alink/procWolfHangFallStart__9daAlink_cFv.s" } #pragma pop +#endif /* 80136064-801360EC 1309A4 0088+00 1/1 0/0 0/0 .text setWolfHeadDamage__9daAlink_cFv */ void daAlink_c::setWolfHeadDamage() { @@ -1899,14 +4560,36 @@ asm int daAlink_c::procWolfDamageInit(dCcD_GObjInf* param_0) { #pragma pop /* 80136508-80136624 130E48 011C+00 1/0 0/0 0/0 .text procWolfDamage__9daAlink_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfDamage() { - nofralloc -#include "asm/d/a/d_a_alink/procWolfDamage__9daAlink_cFv.s" +int daAlink_c::procWolfDamage() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + + cLib_chaseF(&mNormalSpeed, FLOAT_LABEL(lit_6108), daAlinkHIO_wlDamNormal_c0::m.field_0x58); + field_0x2f99 = 5; + + if (checkFreezeDamage()) { + freezeTimerDamage(); + } + + if (checkAnmEnd(frameCtrl_p)) { + current.angle.y = shape_angle.y; + + if (!checkFreezeDamage()) { + checkNextActionWolf(0); + } else if (mProcVar0.field_0x3008 == 0) { + seStartOnlyReverb(Z2SE_AL_FREEZE_RECOVER); + procWolfRollAttackInit(1, 2); + onModeFlg(8); + } + } else if (frameCtrl_p->getFrame() > field_0x3478) { + current.angle.y = shape_angle.y; + + if (!checkNextActionWolf(1)) { + current.angle.y = mProcVar3.field_0x300e.y; + } + } + + return 1; } -#pragma pop /* 80136624-801369E4 130F64 03C0+00 2/2 0/0 0/0 .text procWolfLargeDamageUpInit__9daAlink_cFiiss */ @@ -1931,6 +4614,52 @@ asm int daAlink_c::procWolfLargeDamageUp() { #pragma pop /* 80136C18-80136DE4 131558 01CC+00 1/1 0/0 0/0 .text procWolfLandDamageInit__9daAlink_cFi */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfLandDamageInit(int param_0) { + f32 var_f31; + + if (param_0 == 2) { + if (!checkEventRun()) { + setLandDamagePoint(8); + } + + var_f31 = daAlinkHIO_wlDamFall_c0::m.field_0x0.mStartFrame; + mProcVar0.field_0x3008 = daAlinkHIO_damFall_c0::m.mBigStopTime; + dComIfGp_getVibration().StartShock(5, 31, cXyz(0.0f, 1.0f, 0.0f)); + } else { + var_f31 = daAlinkHIO_wlDamFall_c0::m.field_0x34; + mProcVar0.field_0x3008 = daAlinkHIO_wlDamFall_c0::m.field_0x28; + + if (param_0 == 1) { + if (!checkEventRun()) { + setLandDamagePoint(4); + } + + dComIfGp_getVibration().StartShock(4, 31, cXyz(0.0f, 1.0f, 0.0f)); + } + } + + commonProcInit(PROC_WOLF_LAND_DAMAGE); + mNormalSpeed = 0.0f; + + if (param_0 == 0) { + offModeFlg(8); + } else { + seStartOnlyReverb(JA_SE_LK_FALL_DAMAGE); + voiceStart(Z2SE_WL_V_LAND_DAMAGE); + } + + setSingleAnimeWolf(WANM_FALL_LAND, daAlinkHIO_wlDamFall_c0::m.field_0x0.mSpeed, var_f31, + daAlinkHIO_wlDamFall_c0::m.field_0x0.mEndFrame, + daAlinkHIO_wlDamFall_c0::m.field_0x0.mInterpolation); + setFaceBasicTexture(FTANM_UNK_95); + field_0x3198 = 0; + field_0x2f9d = 4; + setFootEffectProcType(4); + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1939,6 +4668,7 @@ asm int daAlink_c::procWolfLandDamageInit(int param_0) { #include "asm/d/a/d_a_alink/procWolfLandDamageInit__9daAlink_cFi.s" } #pragma pop +#endif /* 80136DE4-80136EC4 131724 00E0+00 1/0 0/0 0/0 .text procWolfLandDamage__9daAlink_cFv */ int daAlink_c::procWolfLandDamage() { @@ -1951,8 +4681,8 @@ int daAlink_c::procWolfLandDamage() { checkNextActionWolf(1); } } else if (frameCtrl->checkAnmEnd()) { - if (field_0x3008 > 0) { - field_0x3008--; + if (mProcVar0.field_0x3008 > 0) { + mProcVar0.field_0x3008--; } else { setSingleAnimeWolfParam(WANM_FALL_LAND_START, &daAlinkHIO_wlDamFall_c0::m.field_0x14); setFaceBasicTexture(FTANM_UNK_96); @@ -1964,6 +4694,17 @@ int daAlink_c::procWolfLandDamage() { } /* 80136EC4-80136F54 131804 0090+00 2/2 0/0 0/0 .text setWolfScreamWaitAnime__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +void daAlink_c::setWolfScreamWaitAnime() { + setSingleAnimeWolfBase(WANM_WAIT_STUNNED); + setFaceBasicTexture(FTANM_UNK_91); + voiceStart(Z2SE_WL_V_TERRORED); + + mProcVar2.field_0x300c = 1; + dComIfGp_getVibration().StartQuake(5, 1, cXyz(0.0f, 1.0f, 0.0f)); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -1972,6 +4713,7 @@ asm void daAlink_c::setWolfScreamWaitAnime() { #include "asm/d/a/d_a_alink/setWolfScreamWaitAnime__9daAlink_cFv.s" } #pragma pop +#endif /* 80136F54-80136FF8 131894 00A4+00 1/1 0/0 0/0 .text procWolfScreamWaitInit__9daAlink_cFv */ int daAlink_c::procWolfScreamWaitInit() { @@ -1979,12 +4721,13 @@ int daAlink_c::procWolfScreamWaitInit() { if (i_checkEndResetFlg1(ERFLG1_UNK_2)) { setWolfScreamWaitAnime(); } else { - setSingleAnimeWolfBaseSpeed(WANM_WAIT, daAlinkHIO_wlMoveNoP_c0::m.field_0x14, daAlinkHIO_wlMove_c0::m.field_0xBC); - field_0x300c = 0; + setSingleAnimeWolfBaseSpeed(WANM_WAIT, daAlinkHIO_wlMoveNoP_c0::m.field_0x14, + daAlinkHIO_wlMove_c0::m.field_0xBC); + mProcVar2.field_0x300c = 0; } mNormalSpeed = FLOAT_LABEL(lit_6108); - field_0x300e.x = 0; + mProcVar3.field_0x300e.x = 0; field_0x3588 = l_wolfBaseAnime; return 1; @@ -1995,7 +4738,7 @@ int daAlink_c::procWolfScreamWait() { daPy_frameCtrl_c* frameCtrl = mUnderFrameCtrl; if (!i_checkEndResetFlg1(ERFLG1_UNK_1)) { - if (field_0x300e.x != 0) { + if (mProcVar3.field_0x300e.x != 0) { field_0x2f99 = 5; if (frameCtrl->checkAnmEnd()) { @@ -2004,15 +4747,14 @@ int daAlink_c::procWolfScreamWait() { checkNextActionWolf(1); } } else { - field_0x300e.x = 1; + mProcVar3.field_0x300e.x = 1; setSingleAnimeWolf(WANM_DMG_AIR_FRONT_GETUP, - daAlinkHIO_wlDamLarge_c0::m.field_0x0.mSpeed, - lit_8676, + daAlinkHIO_wlDamLarge_c0::m.field_0x0.mSpeed, lit_8676, daAlinkHIO_wlDamLarge_c0::m.field_0x0.mEndFrame, daAlinkHIO_wlDamLarge_c0::m.field_0x0.mInterpolation); field_0x2f99 = 13; } - } else if (field_0x300c == 0 && i_checkEndResetFlg1(ERFLG1_UNK_2)) { + } else if (mProcVar2.field_0x300c == 0 && i_checkEndResetFlg1(ERFLG1_UNK_2)) { setWolfScreamWaitAnime(); } @@ -2026,38 +4768,74 @@ f32 daAlink_c::getWolfLieMoveAnmSpeed() { return lit_5943 + (field_0x33a8 * lit_7624); } - return getAnmSpeedStickRate(daAlinkHIO_wlLie_c0::m.field_0x3C, daAlinkHIO_wlLie_c0::m.field_0x38); + return getAnmSpeedStickRate(daAlinkHIO_wlLie_c0::m.field_0x3C, + daAlinkHIO_wlLie_c0::m.field_0x38); } /* 8013712C-801371A0 131A6C 0074+00 3/3 0/0 0/0 .text getWolfLieMoveSpeed__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +f32 daAlink_c::getWolfLieMoveSpeed() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + + f32 var_f1; + if (frameCtrl_p->getFrame() >= 15.0f) { + var_f1 = frameCtrl_p->getFrame() - 15.0f; + } else { + var_f1 = frameCtrl_p->getFrame(); + } + + return daAlinkHIO_wlLie_c0::m.field_0x34 * frameCtrl_p->getRate() * + cM_fsin(var_f1 * 0.2094395f); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daAlink_c::getWolfLieMoveSpeed() { +asm f32 daAlink_c::getWolfLieMoveSpeed() { nofralloc #include "asm/d/a/d_a_alink/getWolfLieMoveSpeed__9daAlink_cFv.s" } #pragma pop +#endif /* 801371A0-801371FC 131AE0 005C+00 0/0 0/0 2/2 .text checkMidnaDisappearMode__9daAlink_cCFv */ BOOL daAlink_c::checkMidnaDisappearMode() const { return mProcID == PROC_WOLF_DIG_THROUGH || - (i_checkWolf() && i_dComIfGp_checkPlayerStatus0(0, 0x8000000) && - !i_dComIfGp_checkPlayerStatus0(0, 0x10) && - (mTargetedActor == NULL || !(mTargetedActor->mAttentionInfo.mFlags & 0x800000))); + (i_checkWolf() && i_dComIfGp_checkPlayerStatus0(0, 0x8000000) && + !i_dComIfGp_checkPlayerStatus0(0, 0x10) && + (mTargetedActor == NULL || !(mTargetedActor->mAttentionInfo.mFlags & 0x800000))); } /* 801371FC-801372B4 131B3C 00B8+00 3/3 0/0 0/0 .text checkWolfLieContinue__9daAlink_cFi */ +// matches with literals +#ifdef NONMATCHING +BOOL daAlink_c::checkWolfLieContinue(int param_0) { + cM3dGPla slide_poly; + + if ((param_0 || + ((mTargetedActor != NULL && (mTargetedActor->mAttentionInfo.mFlags & 0x800000)) && + (fopAcM_GetName(mTargetedActor) == PROC_NPC_JAGAR || + fopAcM_GetName(mTargetedActor) == PROC_NPC_BOU))) && + !getSlidePolygon(&slide_poly) && !checkWolfLieWaterIn()) + { + return true; + } + + return false; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daAlink_c::checkWolfLieContinue(int param_0) { +asm BOOL daAlink_c::checkWolfLieContinue(int param_0) { nofralloc #include "asm/d/a/d_a_alink/checkWolfLieContinue__9daAlink_cFi.s" } #pragma pop +#endif /* 801372B4-80137330 131BF4 007C+00 3/3 0/0 0/0 .text checkNextActionWolfFromLie__9daAlink_cFv */ int daAlink_c::checkNextActionWolfFromLie() { @@ -2065,10 +4843,10 @@ int daAlink_c::checkNextActionWolfFromLie() { if (field_0x2f8c == 1 || field_0x2f8c == 2 || field_0x2f8c == 3) { field_0x2060->initOldFrameMorf(daAlinkHIO_wlLie_c0::m.field_0x30, 0, 40); } - return 1; + return true; } - return 0; + return false; } /* 80137330-801373F8 131C70 00C8+00 3/3 0/0 0/0 .text setWolfLieMoveVoice__9daAlink_cFi @@ -2076,14 +4854,15 @@ int daAlink_c::checkNextActionWolfFromLie() { void daAlink_c::setWolfLieMoveVoice(int param_0) { daPy_frameCtrl_c* frameCtrl = mUnderFrameCtrl; - if (frameCtrl->getRate() == FLOAT_LABEL(lit_6108) && field_0x300e.z != 0) { - field_0x300e.z--; + if (frameCtrl->getRate() == FLOAT_LABEL(lit_6108) && mProcVar3.field_0x300e.z != 0) { + mProcVar3.field_0x300e.z--; } if ((param_0 != 0 && (frameCtrl->checkPass(lit_17382) || frameCtrl->checkPass(lit_7451))) || - (frameCtrl->getRate() == FLOAT_LABEL(lit_6108) && field_0x300e.z == 0)) { + (frameCtrl->getRate() == FLOAT_LABEL(lit_6108) && mProcVar3.field_0x300e.z == 0)) + { voiceStart(Z2SE_WL_V_BREATH_WALK); - field_0x300e.z = 30; + mProcVar3.field_0x300e.z = 30; } } @@ -2098,6 +4877,30 @@ bool daAlink_c::checkWolfLieCode() { /* 80137420-8013753C 131D60 011C+00 2/2 0/0 0/0 .text procWolfLieStartInit__9daAlink_cFi */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfLieStartInit(int param_0) { + commonProcInit(PROC_WOLF_LIE_START); + field_0x3588 = l_wolfBaseAnime; + setSingleAnimeWolfParam(WANM_CROUCH, &daAlinkHIO_wlLie_c0::m.field_0x14); + + if (param_0) { + shape_angle.y = field_0x306e + 0x8000; + current.pos.x = field_0x34ec.x + cM_ssin(field_0x306e) * 90.0f; + current.pos.z = field_0x34ec.z + cM_scos(field_0x306e) * 90.0f; + mProcVar3.field_0x300e.y = 1; + } else { + mProcVar3.field_0x300e.y = 0; + } + + mNormalSpeed = 0.0f; + current.angle.y = shape_angle.y; + field_0x2f99 = 0; + mProcVar3.field_0x300e.z = 30; + dComIfGp_setPlayerStatus0(0, 0x8000000); + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2106,40 +4909,135 @@ asm int daAlink_c::procWolfLieStartInit(int param_0) { #include "asm/d/a/d_a_alink/procWolfLieStartInit__9daAlink_cFi.s" } #pragma pop +#endif /* 8013753C-80137634 131E7C 00F8+00 1/0 0/0 0/0 .text procWolfLieStart__9daAlink_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfLieStart() { - nofralloc -#include "asm/d/a/d_a_alink/procWolfLieStart__9daAlink_cFv.s" +int daAlink_c::procWolfLieStart() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + decideCrawlDoStatus(); + + if (mProcVar3.field_0x300e.y != 0) { + if (checkAnmEnd(frameCtrl_p)) { + procWolfLieMoveInit(1); + } + } else if (!checkWolfLieContinue(0)) { + checkNextActionWolfFromLie(); + } else if (checkInputOnR() && + (checkAnmEnd(frameCtrl_p) || + frameCtrl_p->getFrame() > daAlinkHIO_wlLie_c0::m.field_0x14.mCheckFrame)) + { + procWolfLieMoveInit(0); + } else { + field_0x2f99 = 4; + setWolfLieMoveVoice(0); + setTalkStatus(); + orderTalk(1); + } + + return 1; } -#pragma pop /* 80137634-801377F0 131F74 01BC+00 5/5 0/0 0/0 .text procWolfLieMoveInit__9daAlink_cFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfLieMoveInit(int param_0) { - nofralloc -#include "asm/d/a/d_a_alink/procWolfLieMoveInit__9daAlink_cFi.s" -} -#pragma pop +// regalloc +#ifdef NONMATCHING +int daAlink_c::procWolfLieMoveInit(int param_0) { + BOOL var_r30 = mProcID == PROC_TALK; + BOOL var_r29 = checkUnderMove0BckNoArcWolf(WANM_CROUCH_WALK) == FALSE; + BOOL var_r28 = i_dComIfGp_checkPlayerStatus0(0, 0x2000); -/* 801377F0-80137C90 132130 04A0+00 1/0 0/0 0/0 .text procWolfLieMove__9daAlink_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfLieMove() { - nofralloc -#include "asm/d/a/d_a_alink/procWolfLieMove__9daAlink_cFv.s" -} + if (!commonProcInitNotSameProc(PROC_WOLF_LIE_MOVE)) { + return 0; + } + + mProcVar3.field_0x300e.x = 0; + + if (!var_r29) { + if (var_r30) { + var_r29 = true; + } else { + onModeFlg(0x6000); + } + } else { + f32 anm_speed = getWolfLieMoveAnmSpeed(); + + if (mDemo.getDemoMode() == 0x2C) { + anm_speed = 0.0f; + } else if (param_0) { + mProcVar3.field_0x300e.x = 1; + onModeFlg(0x6000); + } else if (getDirectionFromShapeAngle() == DIR_BACKWARD) { + anm_speed *= -1.0f; + } + + current.angle.y = shape_angle.y; + setSingleAnimeWolfBaseSpeed(WANM_CROUCH_WALK, anm_speed, daAlinkHIO_wlLie_c0::m.field_0x40); + } + + field_0x3198 = var_r29 ^ 1; + mProcVar3.field_0x300e.y = var_r30; + field_0x2f99 = 0xD; + + dComIfGp_setPlayerStatus0(0, 0x8000000); + if (var_r28) { + dComIfGp_setPlayerStatus0(0, 0x2000); + } + + mProcVar3.field_0x300e.z = 30; + + if (i_checkAttentionLock()) { + field_0x2fe4 = shape_angle.y; + } + + return 1; +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm int daAlink_c::procWolfLieMoveInit(int param_0) { + nofralloc +#include "asm/d/a/d_a_alink/procWolfLieMoveInit__9daAlink_cFi.s" +} +#pragma pop +#endif + +/* 801377F0-80137C90 132130 04A0+00 1/0 0/0 0/0 .text procWolfLieMove__9daAlink_cFv */ +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm int daAlink_c::procWolfLieMove() { + nofralloc +#include "asm/d/a/d_a_alink/procWolfLieMove__9daAlink_cFv.s" +} #pragma pop /* 80137C90-80137D4C 1325D0 00BC+00 1/1 0/0 0/0 .text procWolfLieAutoMoveInit__9daAlink_cFiP4cXyz */ +// regalloc +#ifdef NONMATCHING +int daAlink_c::procWolfLieAutoMoveInit(int param_0, cXyz* param_1) { + BOOL var_r30 = i_dComIfGp_checkPlayerStatus0(0, 0x2000); + commonProcInit(PROC_WOLF_LIE_AUTO_MOVE); + + field_0x37c8 = *param_1; + field_0x3198 = param_0; + mProcVar0.field_0x3008 = 20; + mProcVar1.field_0x300a = 300; + + setCrawlMoveDirectionArrow(); + mNormalSpeed = FLOAT_LABEL(lit_6108); + field_0x2f99 = 13; + + dComIfGp_setPlayerStatus0(0, 0x8000000); + if (var_r30) { + dComIfGp_setPlayerStatus0(0, 0x2000); + } + + mProcVar3.field_0x300e.z = 30; + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2148,6 +5046,7 @@ asm int daAlink_c::procWolfLieAutoMoveInit(int param_0, cXyz* param_1) { #include "asm/d/a/d_a_alink/procWolfLieAutoMoveInit__9daAlink_cFiP4cXyz.s" } #pragma pop +#endif /* 80137D4C-80138000 13268C 02B4+00 1/0 0/0 0/0 .text procWolfLieAutoMove__9daAlink_cFv */ @@ -2161,6 +5060,50 @@ asm int daAlink_c::procWolfLieAutoMove() { #pragma pop /* 80138000-80138188 132940 0188+00 2/2 0/0 0/0 .text setSpeedAndAngleSwimWolf__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +void daAlink_c::setSpeedAndAngleSwimWolf() { + if (checkWolfDashMode()) { + field_0x594 = daAlinkHIO_wlSwim_c0::m.field_0x50; + } else { + field_0x594 = daAlinkHIO_wlSwim_c0::m.field_0x80; + } + + f32 var_f31; + if (checkInputOnR()) { + s16 prev_angle = current.angle.y; + cLib_addCalcAngleS(¤t.angle.y, field_0x2fe2, daAlinkHIO_wlSwim_c0::m.field_0x3C, + daAlinkHIO_wlSwim_c0::m.field_0x40, daAlinkHIO_wlSwim_c0::m.field_0x3E); + + var_f31 = field_0x33a8 * 3.0f * cM_scos(current.angle.y - prev_angle); + shape_angle.y = current.angle.y; + } else { + var_f31 = 0.0f; + } + + if (checkWolfSwimDashAnime()) { + var_f31 = 3.0f; + } + + if (checkAttentionState() && mProcID == PROC_WOLF_SWIM_WAIT) { + if (mTargetedActor != NULL) { + setShapeAngleToAtnActor(0); + } else { + cLib_addCalcAngleS(&shape_angle.y, field_0x2fe4, daAlinkHIO_wlSwim_c0::m.field_0x42, + daAlinkHIO_wlSwim_c0::m.field_0x46, + daAlinkHIO_wlSwim_c0::m.field_0x44); + } + + current.angle.y = shape_angle.y; + } + + setNormalSpeedF(var_f31, daAlinkHIO_wlSwim_c0::m.field_0x54); + + if (i_dComIfGp_checkPlayerStatus0(0, 0x10)) { + mNormalSpeed = 0.0f; + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2169,8 +5112,30 @@ asm void daAlink_c::setSpeedAndAngleSwimWolf() { #include "asm/d/a/d_a_alink/setSpeedAndAngleSwimWolf__9daAlink_cFv.s" } #pragma pop +#endif /* 80138188-801381F8 132AC8 0070+00 2/2 0/0 0/0 .text getWolfSwimMoveAnmSpeed__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +f32 daAlink_c::getWolfSwimMoveAnmSpeed() { + f32 anm_speed = fabsf(mNormalSpeed) / field_0x594; + if (anm_speed > 1.0f) { + anm_speed = 1.0f; + } + + if (checkWolfDashMode()) { + anm_speed = + daAlinkHIO_wlSwim_c0::m.field_0x70 + + anm_speed * (daAlinkHIO_wlSwim_c0::m.field_0x74 - daAlinkHIO_wlSwim_c0::m.field_0x70); + } else { + anm_speed = + daAlinkHIO_wlSwim_c0::m.field_0x8C + + anm_speed * (daAlinkHIO_wlSwim_c0::m.field_0x90 - daAlinkHIO_wlSwim_c0::m.field_0x8C); + } + + return anm_speed; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2179,8 +5144,53 @@ asm f32 daAlink_c::getWolfSwimMoveAnmSpeed() { #include "asm/d/a/d_a_alink/getWolfSwimMoveAnmSpeed__9daAlink_cFv.s" } #pragma pop +#endif /* 801381F8-801383D8 132B38 01E0+00 2/2 0/0 0/0 .text decideDoStatusSwimWolf__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::decideDoStatusSwimWolf() { + setTalkStatus(); + + if (orderTalk(1)) { + return 1; + } + + if (field_0x27f4 != NULL && fopAcM_GetName(field_0x27f4) == PROC_Obj_Drop) { + setDoStatus(0x39); + if (doTrigger()) { + fopAcM_setCarryNow(field_0x27f4, 0); + i_onResetFlg0(RFLG0_UNK_8000); + } + } else if (i_checkNoResetFlg0(FLG0_UNK_100) && field_0x30d2 == 0 && !checkWolfSwimDashAnime() && + mProcID == PROC_WOLF_SWIM_MOVE) + { + setDoStatus(9); + + if (doTrigger()) { + i_onNoResetFlg1(FLG1_DASH_MODE); + + if (field_0x2fc7 == 1 || field_0x2fc7 == 3) { + field_0x30d0 = daAlinkHIO_wlMove_c0::m.field_0x5A; + } else if (field_0x2fc7 == 2) { + field_0x30d0 = daAlinkHIO_wlMove_c0::m.field_0x5E; + } else { + field_0x30d0 = daAlinkHIO_wlMove_c0::m.field_0x56; + } + + setSingleAnimeWolfParam(WANM_SWIM_DASH, &daAlinkHIO_wlSwim_c0::m.field_0x28); + } + } + + if (checkWolfSwimDashAnime() && mUnderFrameCtrl[0].checkPass(7.0f)) { + cXyz pillar_pos(current.pos.x + cM_ssin(shape_angle.y) * 60.0f, current.pos.y, + current.pos.z + cM_scos(shape_angle.y) * 60.0f); + fopKyM_createWpillar(&pillar_pos, 0.75f, 0); + } + + return 0; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2189,16 +5199,23 @@ asm int daAlink_c::decideDoStatusSwimWolf() { #include "asm/d/a/d_a_alink/decideDoStatusSwimWolf__9daAlink_cFv.s" } #pragma pop +#endif /* 801383D8-80138484 132D18 00AC+00 2/2 0/0 0/0 .text procWolfSwimUpInit__9daAlink_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfSwimUpInit() { - nofralloc -#include "asm/d/a/d_a_alink/procWolfSwimUpInit__9daAlink_cFv.s" +int daAlink_c::procWolfSwimUpInit() { + commonProcInit(PROC_WOLF_SWIM_UP); + speed.y = FLOAT_LABEL(lit_6108); + current.pos.y = mWaterY; + i_onNoResetFlg0(FLG0_UNK_100); + + mZ2Link.setInWater(false); + setSingleAnimeWolfParam(WANM_SWIM_RESURFACE, &daAlinkHIO_wlSwim_c0::m.field_0x0); + setFaceBasicTexture(FTANM_UNK_8E); + dComIfGp_setPlayerStatus0(0, 0x100000); + seStartMapInfo(Z2SE_WL_OUTOF_WATER); + mProcVar3.field_0x300e.z = 1; + return 1; } -#pragma pop /* 80138484-8013852C 132DC4 00A8+00 1/0 0/0 0/0 .text procWolfSwimUp__9daAlink_cFv */ int daAlink_c::procWolfSwimUp() { @@ -2207,7 +5224,9 @@ int daAlink_c::procWolfSwimUp() { if (frameCtrl->checkAnmEnd()) { procWolfSwimWaitInit(0); - } else if (checkInputOnR() && frameCtrl->getFrame() > daAlinkHIO_wlSwim_c0::m.field_0x0.mCheckFrame) { + } else if (checkInputOnR() && + frameCtrl->getFrame() > daAlinkHIO_wlSwim_c0::m.field_0x0.mCheckFrame) + { procWolfSwimMoveInit(); } else { current.pos.y = mWaterY; @@ -2218,6 +5237,45 @@ int daAlink_c::procWolfSwimUp() { /* 8013852C-80138644 132E6C 0118+00 7/7 0/0 0/0 .text procWolfSwimWaitInit__9daAlink_cFi */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfSwimWaitInit(int param_0) { + f32 morf; + if (mProcID == PROC_WOLF_SWIM_UP) { + morf = 0.0f; + } else { + morf = daAlinkHIO_wlSwim_c0::m.field_0x68; + } + + commonProcInit(PROC_WOLF_SWIM_WAIT); + + if (param_0) { + seStartMapInfo(Z2SE_WL_INTO_WATER); + mProcVar3.field_0x300e.y = 0; + mProcVar3.field_0x300e.z = 1; + } else { + mProcVar3.field_0x300e.z = 0; + } + + f32 anm_speed; + if (checkWolfDashMode()) { + anm_speed = daAlinkHIO_wlSwim_c0::m.field_0x64; + } else { + anm_speed = daAlinkHIO_wlSwim_c0::m.field_0x88; + } + + setSingleAnimeWolfBaseSpeed(WANM_SWIM_WAIT, anm_speed, morf); + dComIfGp_setPlayerStatus0(0, 0x100000); + + if (i_checkNoResetFlg0(FLG0_UNK_100)) { + current.pos.y = mWaterY; + speed.y = 0.0f; + } + + mProcVar2.field_0x300c = 0; + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2226,6 +5284,7 @@ asm int daAlink_c::procWolfSwimWaitInit(int param_0) { #include "asm/d/a/d_a_alink/procWolfSwimWaitInit__9daAlink_cFi.s" } #pragma pop +#endif /* 80138644-8013871C 132F84 00D8+00 1/0 0/0 0/0 .text procWolfSwimWait__9daAlink_cFv */ int daAlink_c::procWolfSwimWait() { @@ -2262,7 +5321,8 @@ int daAlink_c::procWolfSwimWait() { */ int daAlink_c::procWolfSwimMoveInit() { commonProcInit(PROC_WOLF_SWIM_MOVE); - setSingleAnimeWolfBaseSpeed(WANM_SWIM, getWolfSwimMoveAnmSpeed(), daAlinkHIO_wlSwim_c0::m.field_0x78); + setSingleAnimeWolfBaseSpeed(WANM_SWIM, getWolfSwimMoveAnmSpeed(), + daAlinkHIO_wlSwim_c0::m.field_0x78); if (i_checkNoResetFlg0(FLG0_UNK_100)) { current.pos.y = mWaterY; @@ -2274,35 +5334,115 @@ int daAlink_c::procWolfSwimMoveInit() { } /* 801387A0-8013890C 1330E0 016C+00 1/0 0/0 0/0 .text procWolfSwimMove__9daAlink_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfSwimMove() { - nofralloc -#include "asm/d/a/d_a_alink/procWolfSwimMove__9daAlink_cFv.s" +int daAlink_c::procWolfSwimMove() { + setSpeedAndAngleSwimWolf(); + + if (!checkWolfSwimDashAnime()) { + mUnderFrameCtrl[0].setRate(getWolfSwimMoveAnmSpeed()); + } + + if (checkSwimUpAction()) { + return 1; + } + + if (decideDoStatusSwimWolf()) { + return 1; + } + + if (checkAnmEnd(mUnderFrameCtrl) && checkWolfSwimDashAnime()) { + setSingleAnimeWolfBaseSpeed(WANM_SWIM, getWolfSwimMoveAnmSpeed(), + daAlinkHIO_wlSwim_c0::m.field_0x78); + + if (field_0x2fc7 == 1 || field_0x2fc7 == 3) { + field_0x30d2 = daAlinkHIO_wlMove_c0::m.field_0x5C; + } else if (field_0x2fc7 == 2) { + field_0x30d2 = daAlinkHIO_wlMove_c0::m.field_0x60; + } else { + field_0x30d2 = daAlinkHIO_wlMove_c0::m.field_0x58; + } + } + + if (checkFrontWallTypeAction()) { + swimOutAfter(1); + return 1; + } + + if (!checkInputOnR() && !checkWolfSwimDashAnime()) { + procWolfSwimWaitInit(0); + } + + return 1; } -#pragma pop /* 8013890C-80138A18 13324C 010C+00 2/2 0/0 0/0 .text procWolfSwimEndWaitInit__9daAlink_cFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfSwimEndWaitInit(int param_0) { - nofralloc -#include "asm/d/a/d_a_alink/procWolfSwimEndWaitInit__9daAlink_cFi.s" +int daAlink_c::procWolfSwimEndWaitInit(int param_0) { + commonProcInit(PROC_WOLF_SWIM_END_WAIT); + setSingleAnimeWolfParam(WANM_WAIT_SHAKE, &daAlinkHIO_wlSwim_c0::m.field_0x14); + setFaceBasicTexture(FTANM_UNK_8F); + + mDoMtx_multVecZero(mpLinkModel->i_getAnmMtx(3), &field_0x37c8); + + if (param_0 == 0) { + mProcVar3.field_0x300e.x = 0; + } else if (field_0x2fbb == 13) { + mProcVar3.field_0x300e.x = 2; + } else { + mProcVar3.field_0x300e.x = 1; + } + + JPABaseEmitter* spC = NULL; + JPABaseEmitter* sp8 = NULL; + + field_0x32cc = 0; + if (param_0 != 0) { + field_0x31bc = 0; + } else { + for (int i = 0; i < 2; i++) { + field_0x32c0[i] = 0; + } + } + + setWolfSwimEndEffect(&spC, &sp8); + mProcVar2.field_0x300c = param_0; + return 1; } -#pragma pop /* 80138A18-80138B6C 133358 0154+00 1/0 0/0 0/0 .text procWolfSwimEndWait__9daAlink_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfSwimEndWait() { - nofralloc -#include "asm/d/a/d_a_alink/procWolfSwimEndWait__9daAlink_cFv.s" +int daAlink_c::procWolfSwimEndWait() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + mDoMtx_multVecZero(mpLinkModel->i_getAnmMtx(3), &field_0x37c8); + + if (frameCtrl_p->checkPass(lit_7977)) { + if (mProcVar2.field_0x300c == 0) { + seStartOnlyReverb(Z2SE_WOLF_WIPE_OFF_WATER); + } else { + seStartOnlyReverb(Z2SE_WOLF_WIPE_OFF_DUST); + } + } + + JPABaseEmitter* spC = NULL; + JPABaseEmitter* sp8 = NULL; + setWolfSwimEndEffect(&spC, &sp8); + + if (checkAnmEnd(frameCtrl_p)) { + checkNextActionWolf(0); + } else if (frameCtrl_p->getFrame() > daAlinkHIO_wlSwim_c0::m.field_0x14.mCheckFrame) { + checkNextActionWolf(1); + } + + if (mProcID != PROC_WOLF_SWIM_END_WAIT) { + if (spC != NULL) { + spC->stopDrawParticle(); + } + + if (sp8 != NULL) { + sp8->stopDrawParticle(); + } + } + + return 1; } -#pragma pop /* 80138B6C-80138C04 1334AC 0098+00 1/0 0/0 0/0 .text * onWolfEnemyBiteAll__9daAlink_cFP10fopAc_ac_cQ29daPy_py_c9daPy_FLG2 */ @@ -2312,7 +5452,9 @@ bool daAlink_c::onWolfEnemyBiteAll(fopAc_ac_c* param_0, daPy_py_c::daPy_FLG2 par } if (param_1 == 8) { - if (mCutType != 0x2C && mCutType != 0x2D && mCutType != 0x31 && mCutType != 0x39 && mCutType != 0x32) { + if (mCutType != 0x2C && mCutType != 0x2D && mCutType != 0x31 && mCutType != 0x39 && + mCutType != 0x32) + { return 0; } } else if (mCutType != 0x39) { @@ -2345,26 +5487,69 @@ void daAlink_c::checkWolfEnemyThrowAction() { /* 80138CB8-80138DC0 1335F8 0108+00 1/1 0/0 0/0 .text setWolfLockDomeModel__9daAlink_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daAlink_c::setWolfLockDomeModel() { - nofralloc -#include "asm/d/a/d_a_alink/setWolfLockDomeModel__9daAlink_cFv.s" +void daAlink_c::setWolfLockDomeModel() { + JKRHeap* prev_heap = setItemHeap(); + + mHeldItemModel = initModel(loadAramBmd(799, 0x1C00), 0x200); + field_0x0718 = loadAramItemBtk(0x3A6, mHeldItemModel); + field_0x0724 = loadAramItemBrk(0x324, mHeldItemModel); + mDoExt_setCurrentHeap(prev_heap); + + mEquipItem = 0x109; + field_0x3018 = 0; + mSearchBallScale = daAlinkHIO_wlAtLock_c0::m.field_0x28.mSpeed; + + dComIfGp_setPlayerStatus1(0, 0x800000); + seStartOnlyReverb(Z2SE_MIDNA_BIND_AREA_OPEN); + + if (dKy_darkworld_check()) { + field_0x0724->setFrame(lit_6040); + } else { + field_0x0724->setFrame(FLOAT_LABEL(lit_6108)); + } } -#pragma pop /* 80138DC0-80138F18 133700 0158+00 1/1 0/0 0/0 .text setWolfBallModel__9daAlink_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daAlink_c::setWolfBallModel() { - nofralloc -#include "asm/d/a/d_a_alink/setWolfBallModel__9daAlink_cFv.s" +void daAlink_c::setWolfBallModel() { + JKRHeap* prev_heap = setItemHeap(); + + mHeldItemModel = initModel((J3DModelData*)dComIfG_getObjectRes(l_arcName, 0x25), 0x200); + field_0x0718 = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(l_arcName, 0x49); + field_0x0718->searchUpdateMaterialID(mHeldItemModel->getModelData()); + + mpHookSound = new Z2SoundObjSimple(); + mDoExt_setCurrentHeap(prev_heap); + + mEquipItem = 0x10A; + field_0x33dc = FLOAT_LABEL(lit_6108); + mDoMtx_multVecZero(mpLinkModel->i_getAnmMtx(6), &mHeldItemRootPos); + mIronBallCenterPos = mHeldItemRootPos; + mHookshotTopPos = mHeldItemRootPos; + + field_0x2f38.setOldPosP(&mHookshotTopPos, &mIronBallCenterPos); + field_0x32d4 = 0; + mpHookSound->init(&mHeldItemRootPos, 1); } -#pragma pop /* 80138F18-80139048 133858 0130+00 2/2 0/0 0/0 .text resetWolfBallGrab__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +void daAlink_c::resetWolfBallGrab() { + if (mEquipItem == 0x10A) { + seStartOnlyReverb(Z2SE_OBJ_POU_SOUL_BREAK); + deleteEquipItem(FALSE, FALSE); + + if (checkWolfGrabAnimeObj()) { + resetUpperAnime(UPPER_2, 3.0f); + } + + dComIfGp_particle_setColor(0x86CE, &mHeldItemRootPos, &mTevStr, NULL, NULL, 0.0f, 0xFF); + dComIfGp_particle_setColor(0x86CF, &mHeldItemRootPos, &mTevStr, NULL, NULL, 0.0f, 0xFF); + i_onEndResetFlg0(ERFLG0_UNK_20000000); + i_offNoResetFlg3(FLG3_UNK_200000); + } +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2373,6 +5558,7 @@ asm void daAlink_c::resetWolfBallGrab() { #include "asm/d/a/d_a_alink/resetWolfBallGrab__9daAlink_cFv.s" } #pragma pop +#endif /* 80139048-8013911C 133988 00D4+00 1/1 0/0 0/0 .text checkWolfLockData__9daAlink_cFv */ #ifdef NONMATCHING @@ -2384,7 +5570,7 @@ void daAlink_c::checkWolfLockData() { for (int i = 0; i < mWolfLockNum; i++) { if (mWolfLockAcKeep[i].getActor() == NULL) { int var_r29 = i; - + for (; var_r29 < mWolfLockNum - 1; var_r29++) { mWolfLockAcKeep[i].setData(mWolfLockAcKeep[i + 1].getActor()); } @@ -2407,11 +5593,11 @@ asm void daAlink_c::checkWolfLockData() { #endif /* 8013911C-8013916C 133A5C 0050+00 1/0 0/0 0/0 .text checkWolfLock__9daAlink_cCFP10fopAc_ac_c */ -bool daAlink_c::checkWolfLock(fopAc_ac_c* p_actor) const { - u32 id = fopAcM_GetID(p_actor); +bool daAlink_c::checkWolfLock(fopAc_ac_c* i_actor) const { + u32 actor_id = fopAcM_GetID(i_actor); for (int i = 0; i < mWolfLockNum; i++) { - if (id == mWolfLockAcKeep[i].getID()) { + if (actor_id == mWolfLockAcKeep[i].getID()) { return true; } } @@ -2419,11 +5605,11 @@ bool daAlink_c::checkWolfLock(fopAc_ac_c* p_actor) const { } /* 8013916C-801391DC 133AAC 0070+00 1/0 0/0 0/0 .text cancelWolfLock__9daAlink_cFP10fopAc_ac_c */ -bool daAlink_c::cancelWolfLock(fopAc_ac_c* p_actor) { - u32 id = fopAcM_GetID(p_actor); +bool daAlink_c::cancelWolfLock(fopAc_ac_c* i_actor) { + u32 actor_id = fopAcM_GetID(i_actor); for (int i = 0; i < mWolfLockNum; i++) { - if (id == mWolfLockAcKeep[i].getID()) { + if (actor_id == mWolfLockAcKeep[i].getID()) { mWolfLockAcKeep[i].clearData(); return true; } @@ -2439,39 +5625,39 @@ fopAc_ac_c* daAlink_c::getWolfLockActorEnd() { /* 801391E4-801392A8 133B24 00C4+00 1/1 0/0 0/0 .text * searchWolfLockEnemy__9daAlink_cFP10fopAc_ac_cPv */ -void daAlink_c::searchWolfLockEnemy(fopAc_ac_c* param_0, void* param_1) { - fopAc_ac_c** tmp = (fopAc_ac_c**)param_1; +void daAlink_c::searchWolfLockEnemy(fopAc_ac_c* i_actor, void* i_data) { + fopAc_ac_c** lock_actor_pp = (fopAc_ac_c**)i_data; for (int i = 0; i < mWolfLockNum; i++) { - if (mWolfLockAcKeep[i].getActor() == param_0) { + if (mWolfLockAcKeep[i].getActor() == i_actor) { return; } } - fopEn_enemy_c* enemy = static_cast(param_0); - if (fopAcM_GetGroup(enemy) == 2 && enemy->mAttentionInfo.mFlags & 5 && !enemy->checkWolfNoLock()) { - f32 d = current.pos.abs2(enemy->mEyePos); + fopEn_enemy_c* enemy_p = static_cast(i_actor); + if (fopAcM_GetGroup(enemy_p) == 2 && enemy_p->mAttentionInfo.mFlags & 5 && + !enemy_p->checkWolfNoLock()) + { + f32 dist_to_enemy = current.pos.abs2(enemy_p->mEyePos); - if (enemy->mEyePos.y >= current.pos.y - lit_6895 && d < field_0x3478) { - field_0x3478 = d; - *tmp = param_0; + if (enemy_p->mEyePos.y >= current.pos.y - lit_6895 && dist_to_enemy < field_0x3478) { + field_0x3478 = dist_to_enemy; + *lock_actor_pp = i_actor; } } } /* 801392A8-801392E4 133BE8 003C+00 1/1 0/0 0/0 .text * daAlink_searchWolfLockEnemy__FP10fopAc_ac_cPv */ -static int daAlink_searchWolfLockEnemy(fopAc_ac_c* param_0, void* param_1) { - daAlink_getAlinkActorClass()->searchWolfLockEnemy(param_0, param_1); +static int daAlink_searchWolfLockEnemy(fopAc_ac_c* i_actor, void* i_data) { + daAlink_getAlinkActorClass()->searchWolfLockEnemy(i_actor, i_data); return 0; } /* 801392E4-801393A4 133C24 00C0+00 1/1 0/0 0/0 .text checkWolfComboCnt__9daAlink_cFv */ -// checkAttentionLock -#ifdef NONMATCHING void daAlink_c::checkWolfComboCnt() { if (!i_dComIfGp_checkPlayerStatus1(0, 0x1000000)) { - if (mComboCutCount == 2 && checkAttentionLock() && field_0x10f0.ChkAtHit()) { + if (mComboCutCount == 2 && i_checkAttentionLock() && mAtCyl.ChkAtHit()) { i_onNoResetFlg0(FLG0_UNK_8000); } @@ -2482,38 +5668,70 @@ void daAlink_c::checkWolfComboCnt() { } } } -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daAlink_c::checkWolfComboCnt() { - nofralloc -#include "asm/d/a/d_a_alink/checkWolfComboCnt__9daAlink_cFv.s" -} -#pragma pop -#endif /* 801393A4-801395B4 133CE4 0210+00 4/4 0/0 0/0 .text checkWolfAttackAction__9daAlink_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daAlink_c::checkWolfAttackAction() { - nofralloc -#include "asm/d/a/d_a_alink/checkWolfAttackAction__9daAlink_cFv.s" -} -#pragma pop +BOOL daAlink_c::checkWolfAttackAction() { + if (mComboCutCount == 4) { + resetCombo(1); + } -/* 801395B4-80139600 133EF4 004C+00 2/2 0/0 0/0 .text - * setWolfEnemyThrowUpperAnime__9daAlink_cFQ29daAlink_c12daAlink_WANMf */ -void daAlink_c::setWolfEnemyThrowUpperAnime(daAlink_c::daAlink_WANM i_anmID, f32 param_1) { - setUpperAnime(i_anmID == WANM_FLING_LEFT ? (u16)0x2BD : (u16)0x2BE, UPPER_2, daAlinkHIO_wlAtBite_c0::m.field_0x2C, param_1, -1, lit_6041); -} + mComboCutCount++; + int atk_direction = getCutDirection(); -/* 80139600-801396F8 133F40 00F8+00 2/2 0/0 0/0 .text - * setWolfEnemyHangBitePos__9daAlink_cFP13fopEn_enemy_c */ -// matches with literals -#ifdef NONMATCHING + if (checkWolfDashMode()) { + mComboCutCount = 4; + return procWolfJumpAttackInit(0); + } else if (i_checkNoResetFlg0(FLG0_UNK_8000)) { + if (mComboCutCount == 4) { + if (atk_direction == DIR_NONE) { + return procWolfWaitAttackInit(2); + } else if (atk_direction == DIR_FORWARD || atk_direction == DIR_LEFT) { + return procWolfJumpAttackInit(0); + } else { + return procWolfRollAttackInit(1, 0); + } + } else if (atk_direction == DIR_RIGHT || atk_direction == DIR_BACKWARD) { + return procWolfWaitAttackInit(2); + } else { + return procWolfJumpAttackInit(2); + } + } else if (mComboCutCount == 4) { + if (mTargetedActor == NULL) { + if (atk_direction == DIR_LEFT || atk_direction == DIR_NONE) { + return procWolfWaitAttackInit(2); + } else { + return procWolfJumpAttackInit(0); + } + } else if (atk_direction == DIR_LEFT) { + return procWolfRollAttackInit(0, 0); + } else if (atk_direction == DIR_RIGHT) { + return procWolfRollAttackInit(1, 0); + } else if (atk_direction == DIR_FORWARD) { + return procWolfJumpAttackInit(0); + } else { + return procWolfJumpAttackInit(2); + } + } else if (mComboCutCount == 2) { + return procWolfWaitAttackInit(normalType0[atk_direction]); + } else if (mComboCutCount == 1 && atk_direction == DIR_FORWARD) { + return procWolfJumpAttackInit(0); + } else { + return procWolfWaitAttackInit(normalType1_50860[atk_direction]); + } +} + +/* 801395B4-80139600 133EF4 004C+00 2/2 0/0 0/0 .text + * setWolfEnemyThrowUpperAnime__9daAlink_cFQ29daAlink_c12daAlink_WANMf */ +void daAlink_c::setWolfEnemyThrowUpperAnime(daAlink_c::daAlink_WANM i_anmID, f32 param_1) { + setUpperAnime(i_anmID == WANM_FLING_LEFT ? (u16)0x2BD : (u16)0x2BE, UPPER_2, + daAlinkHIO_wlAtBite_c0::m.field_0x2C, param_1, -1, lit_6041); +} + +/* 80139600-801396F8 133F40 00F8+00 2/2 0/0 0/0 .text + * setWolfEnemyHangBitePos__9daAlink_cFP13fopEn_enemy_c */ +// matches with literals +#ifdef NONMATCHING BOOL daAlink_c::setWolfEnemyHangBitePos(fopEn_enemy_c* i_enemy) { if (i_enemy != NULL) { current.pos = i_enemy->getDownPos(); @@ -2556,6 +5774,17 @@ static Vec l_wolfBiteHitMarkScale; /* 801396F8-801397A4 134038 00AC+00 1/1 0/0 0/0 .text * setWolfBiteDamage__9daAlink_cFP13fopEn_enemy_c */ +// matches with literals +#ifdef NONMATCHING +void daAlink_c::setWolfBiteDamage(fopEn_enemy_c* i_enemy) { + i_enemy->onWolfBiteDamage(); + + cXyz pos; + mDoMtx_multVecZero(mpLinkModel->i_getAnmMtx(13), &pos); + i_dComIfGp_setHitMark(1, i_enemy, &pos, &shape_angle, (cXyz*)&l_wolfBiteHitMarkScale, 0); + dComIfGp_getVibration().StartShock(3, 31, cXyz(0.0f, 1.0f, 0.0f)); +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2564,23 +5793,21 @@ asm void daAlink_c::setWolfBiteDamage(fopEn_enemy_c* param_0) { #include "asm/d/a/d_a_alink/setWolfBiteDamage__9daAlink_cFP13fopEn_enemy_c.s" } #pragma pop +#endif /* 801397A4-801398A8 1340E4 0104+00 1/1 0/0 0/0 .text checkWolfLockAttackChargeState__9daAlink_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daAlink_c::checkWolfLockAttackChargeState() { - nofralloc -#include "asm/d/a/d_a_alink/checkWolfLockAttackChargeState__9daAlink_cFv.s" +BOOL daAlink_c::checkWolfLockAttackChargeState() { + return i_checkMidnaRide() && checkMidnaChargeAttack() && !daMidna_c::i_checkMidnaTired() && + daMidna_c::checkMidnaRealBody(); } -#pragma pop /* 801398A8-80139908 1341E8 0060+00 1/1 0/0 0/0 .text procWolfRollAttackChargeInit__9daAlink_cFv */ int daAlink_c::procWolfRollAttackChargeInit() { commonProcInit(PROC_WOLF_ROLL_ATTACK_CHARGE); - setSingleAnimeWolfBaseSpeed(WANM_CUT_TURN_CHARGE, FLOAT_LABEL(lit_6108), daAlinkHIO_wlAttack_c0::m.mReadyInterpolation); + setSingleAnimeWolfBaseSpeed(WANM_CUT_TURN_CHARGE, FLOAT_LABEL(lit_6108), + daAlinkHIO_wlAttack_c0::m.mReadyInterpolation); voiceStartLevel(Z2SE_WL_V_ROAR); return 1; } @@ -2612,18 +5839,128 @@ int daAlink_c::procWolfRollAttackMoveInit() { onModeFlg(1); } - field_0x3008 = daAlinkHIO_wlAttack_c0::m.mUnkTime; - field_0x300a = daAlinkHIO_wlAtLock_c0::m.field_0x28.mEndFrame; - field_0x300e.z = 30; + mProcVar0.field_0x3008 = daAlinkHIO_wlAttack_c0::m.mUnkTime; + mProcVar1.field_0x300a = daAlinkHIO_wlAtLock_c0::m.field_0x28.mEndFrame; + mProcVar3.field_0x300e.z = 30; field_0x3198 = 0; field_0x2fe4 = shape_angle.y; voiceStartLevel(Z2SE_WL_V_ROAR); dComIfGp_setPlayerStatus0(0, 0x40000000); - return 1; } /* 80139A70-80139DE0 1343B0 0370+00 1/0 0/0 0/0 .text procWolfRollAttackMove__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfRollAttackMove() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + + if (checkWolfGroundSpecialMode()) { + return 1; + } + + if (!swordButton() || mProcVar1.field_0x300a == 0) { + if (mTargetedActor != NULL) { + shape_angle.y = cLib_targetAngleY(¤t.pos, &mTargetedActor->mEyePos); + current.angle.y = shape_angle.y; + } + + if (mProcVar0.field_0x3008 == 0) { + if (mWolfLockNum != 0) { + resetCombo(1); + return procWolfLockAttackInit(0); + } else { + return procWolfRollAttackInit(1, 0); + } + } + + return checkWolfAttackAction(); + } + + if (mProcVar0.field_0x3008 != 0) { + mProcVar0.field_0x3008--; + + if (mProcVar0.field_0x3008 == 0 && checkWolfLockAttackChargeState()) { + setWolfLockDomeModel(); + } + } else { + i_onResetFlg0(RFLG0_UNK_10); + + if (mEquipItem == 0x109) { + seStartOnlyReverbLevel(Z2SE_MIDNA_BIND_AREA_SUS); + mProcVar1.field_0x300a--; + + if (mSearchBallScale < daAlinkHIO_wlAtLock_c0::m.field_0x28.mStartFrame && + cLib_chaseF(&mSearchBallScale, daAlinkHIO_wlAtLock_c0::m.field_0x28.mStartFrame, + daAlinkHIO_wlAtLock_c0::m.field_0x28.mInterpolation)) + { + field_0x3018 = 1; + } + + if (mWolfLockNum < 10) { + field_0x3478 = mSearchBallScale * mSearchBallScale; + + fopAc_ac_c* lock_actor_p = NULL; + fopAcIt_Executor((fopAcIt_ExecutorFunc)daAlink_searchWolfLockEnemy, &lock_actor_p); + + if (lock_actor_p != NULL) { + for (int i = mWolfLockNum - 1; i >= 0; i--) { + mWolfLockAcKeep[i + 1].setData(mWolfLockAcKeep[i].getActor()); + } + + mWolfLockAcKeep[0].setData(lock_actor_p); + mWolfLockNum++; + } + } + } + } + + voiceStartLevel(Z2SE_WL_V_ROAR); + + BOOL var_r28 = 0; + f32 anm_speed = getWolfLieMoveAnmSpeed(); + + if (frameCtrl_p->getRate() > 0.0f) { + frameCtrl_p->setRate(anm_speed); + } else if (frameCtrl_p->getRate() < 0.0f) { + frameCtrl_p->setRate(-anm_speed); + } else { + var_r28 = 1; + } + + setWolfAtnMoveDirection(); + + if (var_r28 == true || frameCtrl_p->checkPass(0.0f) || frameCtrl_p->checkPass(15.0f)) { + if (checkInputOnR()) { + if (field_0x2f98 != 1) { + frameCtrl_p->setRate(anm_speed); + frameCtrl_p->setLoop(0); + } else { + frameCtrl_p->setRate(-anm_speed); + frameCtrl_p->setLoop(frameCtrl_p->getEnd()); + } + + initBasAnime(); + } else if (!var_r28) { + stopHalfMoveAnime(15.0f); + } + } + + setSpeedAndAngleWolfAtn(); + mNormalSpeed = getWolfLieMoveSpeed(); + if (mNormalSpeed < 0.0f) { + mNormalSpeed *= -1.0f; + } + + if (checkZeroSpeedF()) { + onModeFlg(1); + } else { + offModeFlg(1); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2632,6 +5969,7 @@ asm int daAlink_c::procWolfRollAttackMove() { #include "asm/d/a/d_a_alink/procWolfRollAttackMove__9daAlink_cFv.s" } #pragma pop +#endif /* 80139DE0-8013A4F8 134720 0718+00 5/5 0/0 0/0 .text procWolfJumpAttackInit__9daAlink_cFi */ #pragma push @@ -2644,6 +5982,89 @@ asm int daAlink_c::procWolfJumpAttackInit(int param_0) { #pragma pop /* 8013A4F8-8013A7EC 134E38 02F4+00 1/0 0/0 0/0 .text procWolfJumpAttack__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfJumpAttack() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + + if (mProcVar3.field_0x300e.x != 0 && mNormalSpeed > daAlinkHIO_wlAtCjump_c0::m.field_0x5C) { + cLib_chaseF(&mNormalSpeed, daAlinkHIO_wlAtCjump_c0::m.field_0x5C, + daAlinkHIO_wlAtCjump_c0::m.field_0x60); + } + + if (mAtCyl.ChkAtHit()) { + field_0x3198 = 1; + + if (mProcVar3.field_0x300e.y != 0 && mProcVar3.field_0x300e.x == 0) { + mNormalSpeed *= daAlinkHIO_wlAtCjump_c0::m.field_0x58; + mProcVar3.field_0x300e.x = 1; + } + } + + if (checkWolfAttackReverse(field_0x32cc)) { + return 1; + } + + if (mLinkAcch.ChkGroundHit() && checkWolfLandAction(0)) { + return 1; + } + + if (mLinkAcch.ChkGroundHit() && checkSlideAction()) { + dComIfGp_getVibration().StartShock(1, 15, cXyz(0.0f, 1.0f, 0.0f)); + return 1; + } + + field_0x32cc = 1; + + if (mProcVar1.field_0x300a != 1) { + field_0x307e = daAlinkHIO_wlAttack_c0::m.mComboDuration; + } + + if (mProcVar0.field_0x3008 != 0 && checkFrontWallTypeAction()) { + return 1; + } + + field_0x2f99 = 7; + + if (mLinkAcch.ChkGroundHit()) { + dComIfGp_getVibration().StartShock(1, 15, cXyz(0.0f, 1.0f, 0.0f)); + + if (i_checkNoResetFlg2(FLG2_UNK_8)) { + procWolfEnemyThrowInit(4); + } else if (mProcVar3.field_0x300e.z != 0 || mProcVar1.field_0x300a == 2 || + mProcVar1.field_0x300a == 3) + { + procWolfJumpAttackSlideLandInit(field_0x3198, 1, mProcVar1.field_0x300a == 2); + } else { + procWolfJumpAttackNormalLandInit(0); + } + return 1; + } + + if (i_checkNoResetFlg2(FLG2_UNK_40)) { + return procWolfEnemyHangBiteInit(); + } + + if (checkAnmEnd(frameCtrl_p)) { + if (mProcVar2.field_0x300c == 0) { + mProcVar2.field_0x300c = 1; + setSingleAnimeWolfBaseSpeed(WANM_ATTACK_A, daAlinkHIO_wlAtNjump_c0::m.field_0x24, + daAlinkHIO_wlAtNjump_c0::m.field_0x28); + i_onResetFlg0(RFLG0_UNK_2); + } else { + i_onResetFlg0(RFLG0_UNK_2); + } + } else { + i_onResetFlg0(RFLG0_UNK_2); + + if (current.pos.y < mLastJumpPos.y - daAlinkHIO_wlAttack_c0::m.mFallHeight) { + procWolfFallInit(2, daAlinkHIO_wlAttack_c0::m.mFallInterpolation); + } + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2652,6 +6073,7 @@ asm int daAlink_c::procWolfJumpAttack() { #include "asm/d/a/d_a_alink/procWolfJumpAttack__9daAlink_cFv.s" } #pragma pop +#endif /* 8013A7EC-8013A8A0 13512C 00B4+00 2/2 0/0 0/0 .text procWolfJumpAttackKickInit__9daAlink_cFv */ int daAlink_c::procWolfJumpAttackKickInit() { @@ -2681,16 +6103,96 @@ int daAlink_c::procWolfJumpAttackKick() { /* 8013A8FC-8013AAC4 13523C 01C8+00 2/2 0/0 0/0 .text * procWolfJumpAttackSlideLandInit__9daAlink_cFiii */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfJumpAttackSlideLandInit(int param_0, int param_1, int param_2) { - nofralloc -#include "asm/d/a/d_a_alink/procWolfJumpAttackSlideLandInit__9daAlink_cFiii.s" +int daAlink_c::procWolfJumpAttackSlideLandInit(int param_0, int param_1, int param_2) { + commonProcInit(PROC_WOLF_JUMP_AT_SLIDE_LAND); + + if (mTargetedActor == NULL || !param_0 || + (fopAcM_GetGroup(mTargetedActor) == 2 && + static_cast(mTargetedActor)->checkDeadFlg())) + { + mProcVar3.field_0x300e.y = 0; + } else { + mProcVar3.field_0x300e.y = 1; + } + + if ((mTargetedActor != NULL && fopAcM_GetGroup(mTargetedActor) == 2 && param_0 && + !static_cast(mTargetedActor)->checkDeadFlg() && + fopAcM_seenActorAngleY(this, mTargetedActor) > 0x5000) || + param_2) + { + setSingleAnimeWolfParam(WANM_ATTACK_A_END_BACK, &daAlinkHIO_wlAtLand_c0::m.field_0x28); + mProcVar2.field_0x300c = 1; + field_0x3588.set(-l_wolfBaseAnime.x, l_wolfBaseAnime.y, -l_wolfBaseAnime.z); + field_0x3478 = daAlinkHIO_wlAtLand_c0::m.field_0x28.mCheckFrame; + } else { + setSingleAnimeWolfParam(WANM_ATTACK_A_END_FRONT, &daAlinkHIO_wlAtLand_c0::m.field_0x14); + mProcVar2.field_0x300c = 0; + field_0x3588 = l_wolfBaseAnime; + field_0x3478 = daAlinkHIO_wlAtLand_c0::m.field_0x14.mCheckFrame; + } + + field_0x2f9d = 4; + setFootEffectProcType(1); + mProcVar0.field_0x3008 = param_2; + + mNormalSpeed *= lit_5943; + if (param_1) { + field_0x2f99 = 4; + } + + mProcVar3.field_0x300e.z = 0; + field_0x307e = daAlinkHIO_wlAttack_c0::m.mComboDuration; + field_0x2f98 = 0; + return 1; } -#pragma pop /* 8013AAC4-8013AC44 135404 0180+00 1/0 0/0 0/0 .text procWolfJumpAttackSlideLand__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfJumpAttackSlideLand() { + if (checkWolfGroundSpecialMode()) { + return 1; + } + + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + + field_0x2f99 = 4; + cLib_addCalc(&mNormalSpeed, 0.0f, 0.3f, daAlinkHIO_wlAtLand_c0::m.field_0x3C, 0.5f); + + if (mProcVar3.field_0x300e.y != 0) { + setShapeAngleToAtnActor(0); + } + + setComboReserb(); + checkCutTurnCharge(); + + if (checkAnmEnd(frameCtrl_p)) { + if (checkZeroSpeedF()) { + current.angle.y = shape_angle.y; + + if (mProcVar0.field_0x3008 != 0) { + procWolfJumpAttackInit(3); + } else { + checkNextActionWolf(0); + } + } + } else if (frameCtrl_p->getFrame() > field_0x3478 && mNormalSpeed <= 5.0f) { + s16 prev_angle = current.angle.y; + current.angle.y = shape_angle.y; + + if (mProcVar0.field_0x3008 != 0) { + procWolfJumpAttackInit(3); + } else if (!checkNextActionWolf(1)) { + current.angle.y = prev_angle; + } + } else if (mNormalSpeed > 5.0f) { + field_0x2f9d = 4; + seStartMapInfoLevel(Z2SE_FN_WOLF_SLIP); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2699,18 +6201,19 @@ asm int daAlink_c::procWolfJumpAttackSlideLand() { #include "asm/d/a/d_a_alink/procWolfJumpAttackSlideLand__9daAlink_cFv.s" } #pragma pop +#endif /* 8013AC44-8013ACF4 135584 00B0+00 1/1 0/0 0/0 .text * procWolfJumpAttackNormalLandInit__9daAlink_cFi */ int daAlink_c::procWolfJumpAttackNormalLandInit(int param_0) { commonProcInit(PROC_WOLF_JUMP_AT_NORMAL_LAND); setSingleAnimeWolfParam(WANM_ATTACK_A_END, &daAlinkHIO_wlAtLand_c0::m.field_0x0); - + setFootEffectProcType(2); field_0x2f9d = 0x18; mNormalSpeed = FLOAT_LABEL(lit_6108); - field_0x300e.z = 0; - field_0x300c = param_0; + mProcVar3.field_0x300e.z = 0; + mProcVar2.field_0x300c = param_0; field_0x2f99 = 12; field_0x307e = daAlinkHIO_wlAttack_c0::m.mComboDuration; @@ -2738,7 +6241,7 @@ int daAlink_c::procWolfJumpAttackNormalLand() { if (frameCtrl->checkAnmEnd()) { checkNextActionWolf(0); } else if (frameCtrl->getFrame() > daAlinkHIO_wlAtLand_c0::m.field_0x0.mCheckFrame) { - if (field_0x300c != 0) { + if (mProcVar2.field_0x300c != 0) { shape_angle.y -= -0x8000; return procWolfJumpAttackInit(3); } @@ -2752,16 +6255,141 @@ int daAlink_c::procWolfJumpAttackNormalLand() { } /* 8013ADF0-8013AFC0 135730 01D0+00 2/2 0/0 0/0 .text procWolfWaitAttackInit__9daAlink_cFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfWaitAttackInit(int param_0) { - nofralloc -#include "asm/d/a/d_a_alink/procWolfWaitAttackInit__9daAlink_cFi.s" +int daAlink_c::procWolfWaitAttackInit(int i_attackType) { + const daAlinkHIO_wlAtWait_c1* atk_hio; + const daAlink_WCutParamTbl* atk_params = &dataTabl[i_attackType]; + + commonProcInit(PROC_WOLF_WAIT_ATTACK); + setCutType(atk_params->m_cutType); + mProcVar2.field_0x300c = 0; + + if (i_attackType == 2) { + atk_hio = &daAlinkHIO_wlAtWaTl_c0::m; + mProcVar3.field_0x300e.x = 0; + } else if (i_attackType == 1) { + atk_hio = &daAlinkHIO_wlAtWaSc_c0::m; + mProcVar3.field_0x300e.x = 1; + } else { + atk_hio = &daAlinkHIO_wlAtWaLr_c0::m; + mProcVar3.field_0x300e.x = 1; + } + + f32 var_f2; + if (mComboCutCount == 4) { + setCylAtParam(0x80000000, dCcG_At_Spl_UNK_1, 3, 4, 3, atk_hio->field_0x34, + atk_hio->field_0x38); + field_0x3478 = atk_hio->field_0x0.mCheckFrame; + mProcVar0.field_0x3008 = atk_hio->field_0x14; + var_f2 = atk_hio->field_0x0.mStartFrame; + } else { + setCylAtParam(0x80000000, dCcG_At_Spl_UNK_0, 1, 4, 2, atk_hio->field_0x34, + atk_hio->field_0x38); + field_0x3478 = atk_hio->field_0x28; + mProcVar0.field_0x3008 = atk_hio->field_0x16; + var_f2 = atk_hio->field_0x2C; + } + + setSingleAnimeWolf(atk_params->m_anmID, atk_hio->field_0x0.mSpeed, var_f2, + atk_hio->field_0x0.mEndFrame, atk_hio->field_0x0.mInterpolation); + + if (mTargetedActor != NULL) { + shape_angle.y = cLib_targetAngleY(¤t.pos, &mTargetedActor->mEyePos); + } + + current.angle.y = shape_angle.y; + mProcVar3.field_0x300e.z = 0; + mProcVar1.field_0x300a = 2; + field_0x347c = atk_hio->field_0x20; + field_0x3480 = atk_hio->field_0x24; + field_0x3484 = atk_hio->field_0x1C; + field_0x3488 = atk_hio->field_0x18; + field_0x3438 = atk_hio->field_0x30; + field_0x307e = daAlinkHIO_wlAttack_c0::m.mComboDuration; + field_0x3588 = l_wolfBaseAnime; + + if (mComboCutCount != 1) { + field_0x2f99 = 13; + } + + return 1; } -#pragma pop /* 8013AFC0-8013B2A0 135900 02E0+00 1/0 0/0 0/0 .text procWolfWaitAttack__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfWaitAttack() { + if (checkWolfGroundSpecialMode()) { + return 1; + } + + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + + field_0x2f99 = 5; + cLib_chaseF(&mNormalSpeed, 0.0f, daAlinkHIO_wlMoveNoP_c0::m.field_0x10); + setComboReserb(); + checkCutTurnCharge(); + + if (mCutType != CUT_TYPE_WOLF_B_BACK && checkWolfAttackReverse(mProcVar1.field_0x300a == 0)) { + return 1; + } + + if (i_checkNoResetFlg2(FLG2_UNK_8) && frameCtrl_p->getFrame() >= 14.0f) { + return procWolfEnemyThrowInit(mCutType == CUT_TYPE_WOLF_B_LEFT ? 2 : 3); + } + + if (checkAnmEnd(frameCtrl_p)) { + resetCombo(1); + + if (mDemo.getDemoMode() == 0x2B) { + dComIfGp_evmng_cutEnd(field_0x3184); + } else if (mProcVar0.field_0x3008 > 0) { + if (!(frameCtrl_p->getFrame() > field_0x3478) || !checkNextActionWolf(1)) { + mProcVar0.field_0x3008--; + } + } else { + mNormalSpeed = 0.0f; + checkNextActionWolf(0); + } + } else if (frameCtrl_p->getFrame() > field_0x3478) { + if (!checkNextActionWolf(1)) { + resetCombo(1); + } + } else { + setShapeAngleToAtnActor(1); + current.angle.y = shape_angle.y; + + if (frameCtrl_p->checkPass(field_0x3484)) { + mNormalSpeed = field_0x3488; + } + + if (mProcVar2.field_0x300c == 0 && frameCtrl_p->getFrame() >= 3.0f) { + if (mComboCutCount == 4) { + voiceStart(Z2SE_WL_V_ATTACK_L); + } else { + voiceStart(Z2SE_WL_V_ATTACK_S); + } + + if (mProcVar3.field_0x300e.x == 0) { + seStartOnlyReverb(Z2SE_WOLFATTACK_WIND_TAIL); + } else { + seStartOnlyReverb(Z2SE_WOLFATTACK_WIND_S); + } + + mProcVar2.field_0x300c = 1; + } + + if (frameCtrl_p->getFrame() >= field_0x347c && frameCtrl_p->getFrame() < field_0x3480) { + i_onResetFlg0(RFLG0_UNK_2); + + if (mProcVar1.field_0x300a != 0) { + mProcVar1.field_0x300a--; + } + } + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2770,8 +6398,53 @@ asm int daAlink_c::procWolfWaitAttack() { #include "asm/d/a/d_a_alink/procWolfWaitAttack__9daAlink_cFv.s" } #pragma pop +#endif /* 8013B2A0-8013B424 135BE0 0184+00 5/5 0/0 0/0 .text procWolfRollAttackInit__9daAlink_cFii */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfRollAttackInit(int param_0, int param_1) { + commonProcInit(PROC_WOLF_ROLL_ATTACK); + + if (param_0 == 2) { + param_0 = getCutTurnDirection(); + } + + daAlink_WANM anm; + if (param_0 == 1) { + anm = WANM_CUT_TURN_RIGHT; + mProcVar2.field_0x300c = 1; + setCutType(CUT_TYPE_WOLF_TURN_RIGHT); + } else { + anm = WANM_CUT_TURN_LEFT; + mProcVar2.field_0x300c = 0; + setCutType(CUT_TYPE_WOLF_TURN_LEFT); + } + + setSingleAnimeWolfParam(anm, &daAlinkHIO_wlAtRoll_c0::m.field_0x0); + field_0x3478 = daAlinkHIO_wlAtRoll_c0::m.field_0x14; + setCylAtParam(0x40000000, dCcG_At_Spl_UNK_1, 3, 4, 3, field_0x3478 * 0.5f, 155.0f); + mNormalSpeed = 0.0f; + mProcVar3.field_0x300e.x = param_1; + + if (param_1 != 0) { + mUnderFrameCtrl[0].setStart(daAlinkHIO_wlAtRoll_c0::m.field_0x1C); + } else { + seStartOnlyReverb(Z2SE_WOLFATTACK_WIND_L); + voiceStart(Z2SE_WL_V_ATTACK_SPIN); + } + + current.angle.y = shape_angle.y; + field_0x3180 = 0; + + if (getMidnaActor() != NULL) { + // NOTE: this call does nothing + getMidnaActor()->resetRatBody(); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2780,8 +6453,37 @@ asm int daAlink_c::procWolfRollAttackInit(int param_0, int param_1) { #include "asm/d/a/d_a_alink/procWolfRollAttackInit__9daAlink_cFii.s" } #pragma pop +#endif /* 8013B424-8013B528 135D64 0104+00 1/0 0/0 0/0 .text procWolfRollAttack__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfRollAttack() { + if (checkWolfGroundSpecialMode()) { + return 1; + } + + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + cLib_chaseF(&mNormalSpeed, 0.0f, daAlinkHIO_wlMoveNoP_c0::m.field_0x10); + + if (checkAnmEnd(frameCtrl_p)) { + checkNextActionWolf(0); + } else if (frameCtrl_p->getFrame() > daAlinkHIO_wlAtRoll_c0::m.field_0x0.mCheckFrame) { + checkNextActionWolf(1); + } else if (mProcVar3.field_0x300e.x == 0 && frameCtrl_p->getFrame() >= 4.0f && + frameCtrl_p->getFrame() < 13.0f) + { + if (!i_checkNoResetFlg0(FLG0_UNK_40)) { + mNormalSpeed = daAlinkHIO_wlAtRoll_c0::m.field_0x18; + } + + i_onResetFlg0(RFLG0_UNK_2); + cLib_chaseF(mAtCyl.GetRP(), field_0x3478, 20.0f); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2790,8 +6492,51 @@ asm int daAlink_c::procWolfRollAttack() { #include "asm/d/a/d_a_alink/procWolfRollAttack__9daAlink_cFv.s" } #pragma pop +#endif /* 8013B528-8013B808 135E68 02E0+00 1/1 0/0 0/0 .text procWolfDownAttackInit__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfDownAttackInit() { + commonProcInit(PROC_WOLF_DOWN_ATTACK); + setSingleAnimeWolfParam(WANM_ATTACK_POE_START, &daAlinkHIO_wlAtDown_c0::m.field_0x0); + + cXyz sp24(static_cast(mTargetedActor)->getDownPos()); + sp24.y += 50.0f; + + if (fopAcM_gc_c::gndCheck(&sp24)) { + sp24.y = fopAcM_gc_c::getGroundY(); + } else { + sp24.y -= 50.0f; + } + + current.angle.y = cLib_targetAngleY(¤t.pos, &sp24); + + sp24.x -= cM_ssin(current.angle.y) * 80.0f; + sp24.z -= cM_scos(current.angle.y) * 80.0f; + + f32 var_f1 = current.pos.absXZ(sp24); + if (var_f1 > 800.0f) { + var_f1 = 800.0f; + } + + speed.y = daAlinkHIO_wlAtDown_c0::m.field_0x90; + + f32 temp_f3 = speed.y + mGravity; + f32 var_f0 = temp_f3 * temp_f3 + mGravity * 2.0f * (sp24.y - current.pos.y); + if (var_f0 < 0.0f) { + mNormalSpeed = (var_f1 * mGravity) / -temp_f3; + } else { + mNormalSpeed = (var_f1 * mGravity) / (-JMAFastSqrt(var_f0) - temp_f3); + } + + mProcVar2.field_0x300c = 0; + field_0x280c.setData(mTargetedActor); + voiceStart(Z2SE_WL_V_ATTACK_POU_ST); + seStartOnlyReverb(Z2SE_WOLFATTACK_WIND_S); + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2800,8 +6545,35 @@ asm int daAlink_c::procWolfDownAttackInit() { #include "asm/d/a/d_a_alink/procWolfDownAttackInit__9daAlink_cFv.s" } #pragma pop +#endif /* 8013B808-8013B964 136148 015C+00 1/0 0/0 0/0 .text procWolfDownAttack__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfDownAttack() { + if (mLinkAcch.ChkGroundHit() && speed.y <= 0.0f) { + fopEn_enemy_c* enemy_p = (fopEn_enemy_c*)field_0x280c.getActor(); + + if (enemy_p != NULL && enemy_p->checkDownFlg() && + mEyePos.abs2XZ(enemy_p->getDownPos()) < 10000.0f && + fabsf(enemy_p->current.pos.y - current.pos.y) < 50.0f) + { + procWolfDownAtLandInit(enemy_p); + } else { + procWolfDownAtMissLandInit(); + } + } else if (checkAnmEnd(mUnderFrameCtrl)) { + if (checkUnderMove0BckNoArcWolf(WANM_ATTACK_POE_START)) { + setSingleAnimeWolfParam(WANM_ATTACK_POE, &daAlinkHIO_wlAtDown_c0::m.field_0x14); + shape_angle.y = current.angle.y; + } + } else if (checkUnderMove0BckNoArcWolf(WANM_ATTACK_POE_START)) { + cLib_addCalcAngleS(&shape_angle.y, current.angle.y, 2, 0x2000, 0x800); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2810,9 +6582,28 @@ asm int daAlink_c::procWolfDownAttack() { #include "asm/d/a/d_a_alink/procWolfDownAttack__9daAlink_cFv.s" } #pragma pop +#endif /* 8013B964-8013BA44 1362A4 00E0+00 1/1 0/0 0/0 .text * procWolfDownAtLandInit__9daAlink_cFP13fopEn_enemy_c */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfDownAtLandInit(fopEn_enemy_c* i_enemy) { + commonProcInit(PROC_WOLF_DOWN_AT_LAND); + field_0x280c.setData(i_enemy); + setSingleAnimeWolfParam(WANM_ATTACK_POE_END, &daAlinkHIO_wlAtDown_c0::m.field_0x28); + + field_0x2f9d = 4; + setFootEffectProcType(2); + i_enemy->onWolfDownStartFlg(); + mNormalSpeed = 0.0f; + setWolfBallModel(); + + voiceStart(Z2SE_WL_V_ATTACK_POU_BITE); + dComIfGp_getVibration().StartShock(2, 15, cXyz(0.0f, 1.0f, 0.0f)); + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2821,8 +6612,48 @@ asm int daAlink_c::procWolfDownAtLandInit(fopEn_enemy_c* param_0) { #include "asm/d/a/d_a_alink/procWolfDownAtLandInit__9daAlink_cFP13fopEn_enemy_c.s" } #pragma pop +#endif /* 8013BA44-8013BC94 136384 0250+00 1/0 0/0 0/0 .text procWolfDownAtLand__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfDownAtLand() { + if (checkWolfGroundSpecialMode()) { + return 1; + } + + fopEn_enemy_c* enemy_p = (fopEn_enemy_c*)field_0x280c.getActor(); + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + + if (checkAnmEnd(frameCtrl_p)) { + if (checkUnderMove0BckNoArcWolf(WANM_PULL_OUT)) { + setUpperAnime(0x2DA, UPPER_2, 0.0f, 20.0f, -1, -1.0f); + + if (enemy_p != NULL) { + enemy_p->onWolfDownPullEndFlg(); + + dComIfGp_particle_setColor(0x86CA, &enemy_p->getDownPos(), &mTevStr, NULL, NULL, + 0.0f, 0xFF); + dComIfGp_particle_setColor(0x86CB, &enemy_p->getDownPos(), &mTevStr, NULL, NULL, + 0.0f, 0xFF); + dComIfGp_particle_setColor(0x86CC, &enemy_p->getDownPos(), &mTevStr, NULL, NULL, + 0.0f, 0xFF); + } + + return procWolfBackJumpInit(1); + } + + setSingleAnimeWolfParam(WANM_PULL_OUT, &daAlinkHIO_wlAtDown_c0::m.field_0x78); + dComIfGp_getVibration().StartShock(2, 15, cXyz(0.0f, 1.0f, 0.0f)); + } else if (checkUnderMove0BckNoArcWolf(WANM_ATTACK_POE_END) && + (frameCtrl_p->checkPass(9.0f) || frameCtrl_p->checkPass(16.0f))) + { + dComIfGp_getVibration().StartShock(2, 15, cXyz(0.0f, 1.0f, 0.0f)); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2831,8 +6662,25 @@ asm int daAlink_c::procWolfDownAtLand() { #include "asm/d/a/d_a_alink/procWolfDownAtLand__9daAlink_cFv.s" } #pragma pop +#endif /* 8013BC94-8013BD54 1365D4 00C0+00 1/1 0/0 0/0 .text procWolfDownAtMissLandInit__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfDownAtMissLandInit() { + commonProcInit(PROC_WOLF_DOWN_AT_MISS_LAND); + setSingleAnimeWolfParam(WANM_ATTACK_POE_MISS, &daAlinkHIO_wlAtDown_c0::m.field_0x64); + setFaceBasicTexture(FTANM_UNK_97); + + mNormalSpeed = 0.0f; + setFootEffectProcType(1); + field_0x2f9d = 0x18; + field_0x3588 = l_wolfBaseAnime; + + dComIfGp_getVibration().StartShock(1, 15, cXyz(0.0f, 1.0f, 0.0f)); + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2841,6 +6689,7 @@ asm int daAlink_c::procWolfDownAtMissLandInit() { #include "asm/d/a/d_a_alink/procWolfDownAtMissLandInit__9daAlink_cFv.s" } #pragma pop +#endif /* 8013BD54-8013BE24 136694 00D0+00 1/0 0/0 0/0 .text procWolfDownAtMissLand__9daAlink_cFv */ int daAlink_c::procWolfDownAtMissLand() { @@ -2875,6 +6724,65 @@ asm int daAlink_c::procWolfLockAttackInit(int param_0) { #pragma pop /* 8013C3E4-8013C630 136D24 024C+00 1/0 0/0 0/0 .text procWolfLockAttack__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfLockAttack() { + BOOL var_r29 = false; + for (int i = 0; i < 3; i++) { + if (checkAtShieldHit(field_0x850[i])) { + var_r29 = true; + break; + } + } + + if (var_r29 || (checkAtShieldHit(mAtCyl) && (mAtCyl.GetAtHitAc() == NULL || + fopAcM_GetName(mAtCyl.GetAtHitAc()) != PROC_E_FB))) + { + return procCoLargeDamageInit(-4, 1, 0, 0, NULL, 2); + } + + if (checkWolfAttackReverse(1)) { + return 1; + } + + if (mProcVar0.field_0x3008 != 0) { + mProcVar0.field_0x3008--; + + if (mProcVar0.field_0x3008 == 0) { + setSpecialGravity(daAlinkHIO_wlAtLock_c0::m.field_0x48, mMaxFallSpeed, 0); + } + } else if (mNormalSpeed > 30.0f) { + cLib_addCalc(&mNormalSpeed, 30.0f, 0.3f, 5.0f, 1.0f); + } + + if (checkAnmEnd(mUnderFrameCtrl) && checkUnderMove0BckNoArcWolf(WANM_ATTACK_A_START)) { + setSingleAnimeWolfBaseSpeed(WANM_ATTACK_A, daAlinkHIO_wlAtNjump_c0::m.field_0x24, + daAlinkHIO_wlAtNjump_c0::m.field_0x28); + } + + if (mLinkAcch.ChkGroundHit() || (mProcVar3.field_0x300e.z != 0 && current.pos.y < mWaterY)) { + if (!mLinkAcch.ChkGroundHit()) { + current.pos.y = mWaterY; + } + + if (mWolfLockNum != 0) { + procWolfLockAttackTurnInit(mProcVar1.field_0x300a); + } else { + if (mNormalSpeed > daAlinkHIO_wlAtNjump_c0::m.field_0x18) { + mNormalSpeed = daAlinkHIO_wlAtNjump_c0::m.field_0x18; + } + + procWolfJumpAttackSlideLandInit(0, 0, 0); + } + } else { + mZ2Link.startLinkSoundLevel(Z2SE_WOLFATTACK_WIND_RUSH, mComboCutCount, + mVoiceReverbIntensity); + i_onResetFlg0(RFLG0_UNK_2); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2883,8 +6791,45 @@ asm int daAlink_c::procWolfLockAttack() { #include "asm/d/a/d_a_alink/procWolfLockAttack__9daAlink_cFv.s" } #pragma pop +#endif /* 8013C630-8013C7A4 136F70 0174+00 1/1 0/0 0/0 .text procWolfLockAttackTurnInit__9daAlink_cFi */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfLockAttackTurnInit(int param_0) { + commonProcInit(PROC_WOLF_LOCK_ATTACK_TURN); + + if (abs((s16)(cLib_targetAngleY(¤t.pos, &mWolfLockAcKeep[0].getActor()->mEyePos) - + shape_angle.y)) > 0x4000) + { + setSingleAnimeWolfParam(WANM_ATTACK_A_END_BACK, &daAlinkHIO_wlAtLock_c0::m.field_0x14); + mProcVar2.field_0x300c = 1; + field_0x3588.set(-l_wolfBaseAnime.x, l_wolfBaseAnime.y, -l_wolfBaseAnime.z); + } else { + setSingleAnimeWolfParam(WANM_ATTACK_A_END_FRONT, &daAlinkHIO_wlAtLock_c0::m.field_0x0); + mProcVar2.field_0x300c = 0; + field_0x3588 = l_wolfBaseAnime; + } + + if (mWolfLockAcKeep[0].getActor() != NULL && + fopAcM_GetName(mWolfLockAcKeep[0].getActor()) == PROC_E_YMB) + { + mProcVar3.field_0x300e.z = 1; + } else { + mProcVar3.field_0x300e.z = 0; + } + + field_0x2f9d = 4; + setFootEffectProcType(1); + mNormalSpeed *= 0.5f; + field_0x2f99 = 4; + dComIfGp_setPlayerStatus1(0, 0x1000000); + i_offResetFlg0(RFLG0_UNK_8000000); + mComboCutCount++; + mProcVar1.field_0x300a = param_0; + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2893,8 +6838,44 @@ asm int daAlink_c::procWolfLockAttackTurnInit(int param_0) { #include "asm/d/a/d_a_alink/procWolfLockAttackTurnInit__9daAlink_cFi.s" } #pragma pop +#endif /* 8013C7A4-8013C8C8 1370E4 0124+00 1/0 0/0 0/0 .text procWolfLockAttackTurn__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfLockAttackTurn() { + field_0x2f99 = 4; + + if (mProcVar3.field_0x300e.z != 0 && current.pos.y < mWaterY) { + current.pos.y = mWaterY; + } + + if (mWolfLockNum != 0) { + s16 target_angle = cLib_targetAngleY(¤t.pos, &mWolfLockAcKeep[0].getActor()->mEyePos); + if (mProcVar2.field_0x300c != 0) { + target_angle += 0x8000; + } + + cLib_addCalcAngleS(&shape_angle.y, target_angle, 2, 0x2000, 0x800); + } + + cLib_addCalc(&mNormalSpeed, 0.0f, 0.3f, 5.0f, 1.0f); + + if (checkAnmEnd(mUnderFrameCtrl)) { + if (mWolfLockNum != 0) { + procWolfLockAttackInit(mProcVar1.field_0x300a); + } else if (checkZeroSpeedF()) { + current.angle.y = shape_angle.y; + checkNextActionWolf(0); + } else { + field_0x2f9d = 4; + seStartMapInfoLevel(Z2SE_FN_WOLF_SLIP); + } + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2903,8 +6884,29 @@ asm int daAlink_c::procWolfLockAttackTurn() { #include "asm/d/a/d_a_alink/procWolfLockAttackTurn__9daAlink_cFv.s" } #pragma pop +#endif /* 8013C8C8-8013C9EC 137208 0124+00 1/1 0/0 0/0 .text procWolfAttackReverseInit__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfAttackReverseInit() { + commonProcInit(PROC_WOLF_ATTACK_REVERSE); + setSingleAnimeWolfBase(WANM_ATTACK_RECOIL_START); + setFaceBasicTexture(FTANM_UNK_9A); + + mNormalSpeed = daAlinkHIO_wlAttack_c0::m.mJumpBackSpeedH; + speed.y = daAlinkHIO_wlAttack_c0::m.mJumpBackSpeedV; + current.angle.y += 0x8000; + + dComIfGp_getVibration().StartShock(5, 15, cXyz(0.0f, 1.0f, 0.0f)); + dKy_Sound_set(current.pos, 100, fopAcM_GetID(this), 5); + seStartOnlyReverb(Z2SE_WOLF_BODYATTACK); + + i_onResetFlg1(RFLG1_WOLF_ATTACK_REVERSE); + field_0x3588 = l_wolfBaseAnime; + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2913,9 +6915,48 @@ asm int daAlink_c::procWolfAttackReverseInit() { #include "asm/d/a/d_a_alink/procWolfAttackReverseInit__9daAlink_cFv.s" } #pragma pop +#endif /* 8013C9EC-8013CB48 13732C 015C+00 1/0 0/0 0/0 .text procWolfAttackReverse__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfAttackReverse() { + if (checkWolfGroundSpecialMode()) { + return 1; + } + + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + field_0x2f99 = 4; + + if (!i_checkModeFlg(2)) { + if (frameCtrl_p->checkPass(30.0f)) { + voiceStart(Z2SE_WL_V_NOSE); + } + + if (checkAnmEnd(frameCtrl_p)) { + checkNextActionWolf(0); + } else if (frameCtrl_p->getFrame() > daAlinkHIO_wlAttack_c0::m.mLandAnm.mCheckFrame) { + checkNextActionWolf(1); + } + } else if ((mLinkAcch.ChkGroundHit() || i_checkEndResetFlg2(ERFLG2_UNK_100)) && + i_checkModeFlg(2)) + { + if (checkWolfLandAction(0)) { + return 1; + } + + mNormalSpeed = 0.0f; + setSingleAnimeWolfParam(WANM_ATTACK_RECOIL_END, &daAlinkHIO_wlAttack_c0::m.mLandAnm); + setFaceBasicTexture(FTANM_UNK_9B); + current.angle.y = shape_angle.y; + offModeFlg(2); + onModeFlg(1); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2923,9 +6964,42 @@ asm int daAlink_c::procWolfAttackReverse() { nofralloc #include "asm/d/a/d_a_alink/procWolfAttackReverse__9daAlink_cFv.s" } -#pragma pop - -/* 8013CB48-8013CC5C 137488 0114+00 2/2 0/0 0/0 .text procWolfEnemyThrowInit__9daAlink_cFi */ +#pragma pop +#endif + +/* 8013CB48-8013CC5C 137488 0114+00 2/2 0/0 0/0 .text procWolfEnemyThrowInit__9daAlink_cFi */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfEnemyThrowInit(int param_0) { + commonProcInit(PROC_WOLF_ENEMY_THROW); + + daAlink_WANM anm; + if (param_0 == 2 || (param_0 == 4 && cM_rnd() < 0.5f)) { + anm = WANM_FLING_LEFT; + i_onNoResetFlg2(FLG2_WOLF_ENEMY_LEFT_THROW); + } else { + anm = WANM_FLING_RIGHT; + i_offNoResetFlg2(FLG2_WOLF_ENEMY_LEFT_THROW); + } + + f32 var_f31; + if (param_0 == 4) { + var_f31 = 0.0f; + } else { + var_f31 = 3.0f; + } + + setSingleAnimeWolf(anm, daAlinkHIO_wlAtBite_c0::m.field_0x2C, var_f31, -1, + daAlinkHIO_wlAtBite_c0::m.field_0x30); + setWolfEnemyThrowUpperAnime(anm, var_f31); + field_0x3588 = l_wolfBaseAnime; + mNormalSpeed = 0.0f; + speed.y = 0.0f; + field_0x2f99 = 13; + current.angle.y = shape_angle.y; + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2934,6 +7008,7 @@ asm int daAlink_c::procWolfEnemyThrowInit(int param_0) { #include "asm/d/a/d_a_alink/procWolfEnemyThrowInit__9daAlink_cFi.s" } #pragma pop +#endif /* 8013CC5C-8013CCF4 13759C 0098+00 1/0 0/0 0/0 .text procWolfEnemyThrow__9daAlink_cFv */ int daAlink_c::procWolfEnemyThrow() { @@ -2968,12 +7043,12 @@ int daAlink_c::procWolfEnemyHangBiteInit() { } else { current.angle.y = shape_angle.y; field_0x2f99 = 0x50; - field_0x3008 = daAlinkHIO_wlAtBite_c0::m.field_0x28; - field_0x300a = 0; - field_0x300c = 0; - field_0x300e.x = 0; + mProcVar0.field_0x3008 = daAlinkHIO_wlAtBite_c0::m.field_0x28; + mProcVar1.field_0x300a = 0; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.x = 0; field_0x3478 = daAlinkHIO_wlAtBite_c0::m.field_0x40; - field_0x300e.y = shape_angle.y; + mProcVar3.field_0x300e.y = shape_angle.y; voiceStart(Z2SE_WL_V_BITE_ATTACK); dComIfGp_setPlayerStatus1(0, 0x200000); } @@ -2983,6 +7058,84 @@ int daAlink_c::procWolfEnemyHangBiteInit() { /* 8013CDEC-8013D0D4 13772C 02E8+00 1/0 0/0 0/0 .text procWolfEnemyHangBite__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfEnemyHangBite() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + + fopEn_enemy_c* enemy_p = (fopEn_enemy_c*)field_0x281c.getActor(); + if (!setWolfEnemyHangBitePos(enemy_p)) { + return procWolfJumpAttackKickInit(); + } + + cLib_addCalcAngleS(&shape_angle.y, mProcVar3.field_0x300e.y, 2, 0x2000, 0x800); + current.angle.y = shape_angle.y; + setDoStatusContinuation(3); + + if (doTrigger()) { + mProcVar3.field_0x300e.x = 1; + mProcVar0.field_0x3008 = daAlinkHIO_wlAtBite_c0::m.field_0x28; + } else if (mProcVar0.field_0x3008 != 0) { + mProcVar0.field_0x3008--; + } + + if (mProcVar2.field_0x300c == 0) { + if (checkAnmEnd(frameCtrl_p)) { + if (mProcVar3.field_0x300e.x != 0) { + setSingleAnimeWolfBaseSpeed(WANM_CATCH, field_0x3478, 3.0f); + mProcVar3.field_0x300e.x = 0; + mProcVar2.field_0x300c = 1; + } else if (mProcVar0.field_0x3008 == 0) { + return procWolfJumpAttackKickInit(); + } + } + } else { + if (mProcVar0.field_0x3008 == 0) { + return procWolfJumpAttackKickInit(); + } + + if (doTrigger()) { + cLib_chaseF(&field_0x3478, daAlinkHIO_wlAtBite_c0::m.field_0x48, + daAlinkHIO_wlAtBite_c0::m.field_0x50); + } else { + cLib_chaseF(&field_0x3478, daAlinkHIO_wlAtBite_c0::m.field_0x40, + daAlinkHIO_wlAtBite_c0::m.field_0x58); + } + + if (frameCtrl_p->getRate() < 0.1f) { + if (mProcVar3.field_0x300e.x != 0) { + mProcVar3.field_0x300e.x = 0; + frameCtrl_p->setRate(field_0x3478); + } + } else { + frameCtrl_p->setRate(field_0x3478); + + if (frameCtrl_p->checkPass(0.0f) || frameCtrl_p->checkPass(17.0f)) { + if (mProcVar3.field_0x300e.x == 0) { + if (frameCtrl_p->checkPass(0.0f)) { + frameCtrl_p->setFrame(0.0f); + } else { + frameCtrl_p->setFrame(17.0f); + } + + getNowAnmPackUnder(UNDER_0)->setFrame(frameCtrl_p->getFrame()); + frameCtrl_p->setRate(0.0f); + } else { + mProcVar3.field_0x300e.x = 0; + } + } else if (frameCtrl_p->checkPass(14.0f) || frameCtrl_p->checkPass(36.0f)) { + setWolfBiteDamage(enemy_p); + } else if (frameCtrl_p->checkPass(7.5f) || frameCtrl_p->checkPass(30.0f)) { + voiceStart(Z2SE_WL_V_BITE_ATTACK); + } else if (frameCtrl_p->checkPass(20.0f)) { + voiceStart(Z2SE_WL_V_BITE_THROAT); + } + } + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -2991,8 +7144,64 @@ asm int daAlink_c::procWolfEnemyHangBite() { #include "asm/d/a/d_a_alink/procWolfEnemyHangBite__9daAlink_cFv.s" } #pragma pop +#endif /* 8013D0D4-8013D3FC 137A14 0328+00 1/1 0/0 0/0 .text procWolfGrabUpInit__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfGrabUpInit() { + if (fopAcM_checkCarryNow(field_0x27f4)) { + return checkNextActionWolf(0); + } + + if (fopAcM_GetName(field_0x27f4) == PROC_Obj_MasterSword) { + setGrabItemActor(field_0x27f4); + return 1; + } + + commonProcInit(PROC_WOLF_GRAB_UP); + + f32 var_f31; + if (!fopAcM_CheckCarryType(field_0x27f4, fopAcM_CARRY_ITEM)) { + setSingleAnimeWolfParam(WANM_PICKUP_A, &daAlinkHIO_wlGrab_c0::m.field_0x0); + var_f31 = 120.0f; + field_0x3478 = 10.0f; + field_0x347c = daAlinkHIO_wlGrab_c0::m.field_0x0.mCheckFrame; + } else { + setSingleAnimeWolfParam(WANM_PICKUP_B, &daAlinkHIO_wlGrab_c0::m.field_0x28); + var_f31 = 80.0f; + field_0x3478 = 7.0f; + field_0x347c = daAlinkHIO_wlGrab_c0::m.field_0x28.mCheckFrame; + } + + setGrabItemActor(field_0x27f4); + shape_angle.y = fopAcM_searchActorAngleY(this, field_0x27f4); + current.angle.y = shape_angle.y; + mProcVar2.field_0x300c = shape_angle.y; + field_0x37c8 = field_0x27f4->current.pos - field_0x3510; + mProcVar3.field_0x300e.x = 0; + + if (fopAcM_GetName(field_0x27f4) != PROC_Obj_Drop && + fopAcM_GetName(field_0x27f4) != PROC_Obj_Sword) + { + f32 prev_x = current.pos.x; + f32 prev_z = current.pos.z; + + current.pos.x = field_0x27f4->current.pos.x - var_f31 * cM_ssin(shape_angle.y); + current.pos.z = field_0x27f4->current.pos.z - var_f31 * cM_scos(shape_angle.y); + field_0x37c8.x -= current.pos.x - prev_x; + field_0x37c8.z -= current.pos.z - prev_z; + } + + field_0x33e4 = field_0x27f4->current.pos.absXZ(current.pos) - 100.0f; + if (field_0x33e4 < 0.0f) { + field_0x33e4 = 0.0f; + } + + mNormalSpeed = 0.0f; + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -3001,8 +7210,45 @@ asm int daAlink_c::procWolfGrabUpInit() { #include "asm/d/a/d_a_alink/procWolfGrabUpInit__9daAlink_cFv.s" } #pragma pop +#endif /* 8013D3FC-8013D588 137D3C 018C+00 1/0 0/0 0/0 .text procWolfGrabUp__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfGrabUp() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + fopAc_ac_c* item_p = mGrabItemAcKeep.getActor(); + + if (item_p == NULL) { + return checkNextActionWolf(0); + } + + if (frameCtrl_p->checkPass(field_0x3478)) { + i_onResetFlg0(RFLG0_UNK_8000); + fopAcM_setStageLayer(item_p); + voiceStart(Z2SE_WL_V_HOLD_MOUTH); + } + + if (frameCtrl_p->getFrame() >= field_0x3478) { + mProcVar3.field_0x300e.x = 1; + } + + if (checkAnmEnd(frameCtrl_p)) { + setUpperAnime(mUnderAnmHeap[0].getIdx(), UPPER_2, 0.0f, frameCtrl_p->getEnd() - 0.001f, -1, + -1.0f); + checkNextActionWolf(0); + } else if (frameCtrl_p->getFrame() > field_0x347c) { + setUpperAnime(mUnderAnmHeap[0].getIdx(), UPPER_2, 0.0f, frameCtrl_p->getEnd() - 0.001f, -1, + -1.0f); + + if (!checkNextActionWolf(1)) { + resetUpperAnime(UPPER_2, -1.0f); + } + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -3011,6 +7257,7 @@ asm int daAlink_c::procWolfGrabUp() { #include "asm/d/a/d_a_alink/procWolfGrabUp__9daAlink_cFv.s" } #pragma pop +#endif /* 8013D588-8013D65C 137EC8 00D4+00 2/2 0/0 0/0 .text procWolfGrabPutInit__9daAlink_cFv */ @@ -3037,6 +7284,50 @@ int daAlink_c::procWolfGrabPutInit() { } /* 8013D65C-8013D818 137F9C 01BC+00 1/0 0/0 0/0 .text procWolfGrabPut__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfGrabPut() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + fopAc_ac_c* actor_p = mGrabItemAcKeep.getActor(); + + if (frameCtrl_p->getFrame() < field_0x3478) { + if (actor_p != NULL) { + actor_p->speedF = 0.0f; + actor_p->current.pos.x += field_0x33e4 * cM_ssin(shape_angle.y); + actor_p->current.pos.z += field_0x33e4 * cM_scos(shape_angle.y); + freeGrabItem(); + } + + if (checkAnmEnd(frameCtrl_p)) { + if (mDemo.getDemoMode() == 13) { + dComIfGp_evmng_cutEnd(field_0x3184); + } else { + checkNextActionWolf(0); + } + } else if (frameCtrl_p->getFrame() < field_0x347c) { + checkNextActionWolf(1); + } + } else { + if (actor_p == NULL) { + if (mDemo.getDemoMode() == 13) { + dComIfGp_evmng_cutEnd(field_0x3184); + return 1; + } else { + return checkNextActionWolf(0); + } + } + + if (grabLineCheck(&field_0x34e0, &actor_p->current.pos) && dBgS_CheckBWallPoly(mObjLinChk)) + { + cXyz sp8 = actor_p->current.pos - mObjLinChk.i_GetCross(); + current.pos.x -= sp8.x * 1.5f; + current.pos.z -= sp8.z * 1.5f; + } + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -3045,6 +7336,7 @@ asm int daAlink_c::procWolfGrabPut() { #include "asm/d/a/d_a_alink/procWolfGrabPut__9daAlink_cFv.s" } #pragma pop +#endif /* 8013D818-8013D86C 138158 0054+00 1/1 0/0 0/0 .text procWolfGrabThrowInit__9daAlink_cFv */ @@ -3078,6 +7370,43 @@ int daAlink_c::procWolfGrabThrow() { } /* 8013D930-8013DA8C 138270 015C+00 1/1 0/0 0/0 .text procWolfPushInit__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfPushInit() { + commonProcInit(PROC_WOLF_PUSH); + mProcVar3.field_0x300e.x = 18; + + s16 var_r5; + if (fopAcM_CheckCarryType(field_0x27f4, fopAcM_CARRY_TYPE_1)) { + mProcVar2.field_0x300c = 1; + var_r5 = 24; + } else { + mProcVar2.field_0x300c = 0; + var_r5 = mProcVar3.field_0x300e.x; + } + setSingleAnimeWolf(WANM_PUSH_LIGHT, 1.0f, 0.0f, var_r5, 3.0f); + mUnderFrameCtrl[0].setAttribute(0); + + mNormalSpeed = 0.0f; + shape_angle.y = fopAcM_searchActorAngleY(this, field_0x27f4); + current.angle.y = shape_angle.y; + field_0x3588 = l_wolfBaseAnime; + field_0x2f99 = 12; + field_0x34d4 = l_wolfBaseAnime; + + current.pos.x += cM_ssin(shape_angle.y) * 50.0f; + current.pos.z += cM_scos(shape_angle.y) * 50.0f; + + if (fopAcM_CheckCarryType(field_0x27f4, fopAcM_CARRY_TYPE_1)) { + mProcVar2.field_0x300c = 1; + } else { + mProcVar2.field_0x300c = 0; + } + + field_0x280c.setData(field_0x27f4); + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -3086,6 +7415,7 @@ asm int daAlink_c::procWolfPushInit() { #include "asm/d/a/d_a_alink/procWolfPushInit__9daAlink_cFv.s" } #pragma pop +#endif /* 8013DA8C-8013DB58 1383CC 00CC+00 1/0 0/0 0/0 .text procWolfPush__9daAlink_cFv */ int daAlink_c::procWolfPush() { @@ -3094,14 +7424,15 @@ int daAlink_c::procWolfPush() { field_0x2f99 = 4; if (frameCtrl->checkAnmEnd()) { - if (field_0x300c != 0) { - setSingleAnimeWolf(WANM_PUSH_LIGHT, lit_6040, FLOAT_LABEL(lit_6108), field_0x300e.x, lit_6109); + if (mProcVar2.field_0x300c != 0) { + setSingleAnimeWolf(WANM_PUSH_LIGHT, lit_6040, FLOAT_LABEL(lit_6108), + mProcVar3.field_0x300e.x, lit_6109); mUnderFrameCtrl[0].setAttribute(0); - field_0x300c = 0; + mProcVar2.field_0x300c = 0; } else { checkNextActionWolf(0); } - } else if (field_0x300c == 0 && frameCtrl->checkPass(lit_52470)) { + } else if (mProcVar2.field_0x300c == 0 && frameCtrl->checkPass(lit_52470)) { if (field_0x280c.getActor() != NULL) { fopAcM_setCarryNow(field_0x280c.getActor(), 0); } @@ -3112,9 +7443,9 @@ int daAlink_c::procWolfPush() { /* 8013DB58-8013DB6C 138498 0014+00 1/1 0/0 0/0 .text daAlink_searchEnemyCargo__FP10fopAc_ac_cPv */ -static fopAc_ac_c* daAlink_searchEnemyCargo(fopAc_ac_c* param_0, void*) { - if (fopAcM_GetName(param_0) == PROC_E_YC) { - return param_0; +static fopAc_ac_c* daAlink_searchEnemyCargo(fopAc_ac_c* i_actor, void*) { + if (fopAcM_GetName(i_actor) == PROC_E_YC) { + return i_actor; } return NULL; @@ -3131,31 +7462,72 @@ int daAlink_c::procWolfCargoCarryInit() { speed.y = tmp_0; setSpecialGravity(tmp_0, mMaxFallSpeed, 0); - daAlink_WANM wanm; + daAlink_WANM anm; if (checkCargoCarry()) { - field_0x300c = 1; - wanm = WANM_WAIT_KARGOROK; + mProcVar2.field_0x300c = 1; + anm = WANM_WAIT_KARGOROK; } else { - field_0x300c = 0; - - fopAc_ac_c* cargo_actor = (fopAc_ac_c*)fopAcIt_Judge((fopAcIt_JudgeFunc)daAlink_searchEnemyCargo, NULL); + mProcVar2.field_0x300c = 0; + + fopAc_ac_c* cargo_actor = + (fopAc_ac_c*)fopAcIt_Judge((fopAcIt_JudgeFunc)daAlink_searchEnemyCargo, NULL); if (cargo_actor != NULL) { field_0x280c.setData(cargo_actor); } - wanm = WANM_CATCH_KARGOROK; + anm = WANM_CATCH_KARGOROK; } if (!dComIfGp_evmng_checkStartDemo()) { voiceStart(Z2SE_WL_V_CATCHED); } - setSingleAnimeWolfBase(wanm); + setSingleAnimeWolfBase(anm); return 1; } /* 8013DC5C-8013DDF8 13859C 019C+00 1/0 0/0 0/0 .text procWolfCargoCarry__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfCargoCarry() { + setJumpMode(); + + if (mProcVar2.field_0x300c != 0) { + mCargoCarryAcKeep.setActor(); + if (mCargoCarryAcKeep.getActor() == NULL || !checkCargoCarry()) { + offCargoCarry(); + return checkNextActionWolf(0); + } + + daKago_c* kago_p = (daKago_c*)mCargoCarryAcKeep.getActor(); + mDoMtx_stack_c::copy(kago_p->getLegR3Mtx()); + mDoMtx_stack_c::transM(-9.0f, -17.0f, -30.0f); + mDoMtx_stack_c::multVecZero(¤t.pos); + mDoMtx_stack_c::ZXYrotM(-0x1928, 0x3FFF, 0); + mDoMtx_MtxToRot(mDoMtx_stack_c::get(), &shape_angle); + current.angle.y = shape_angle.y; + + checkSubjectAction(); + } else { + if (i_checkEndResetFlg1(ERFLG1_UNK_10000)) { + return checkNextActionWolf(0); + } + + e_yc_class* yc_p = (e_yc_class*)field_0x280c.getActor(); + mDoMtx_stack_c::copy(yc_p->getLegR3Mtx()); + mDoMtx_stack_c::transM(-9.0f, -7.0f, -30.0f); + mDoMtx_stack_c::multVecZero(¤t.pos); + mDoMtx_stack_c::ZXYrotM(0x770C, 0, -0x4C94); + mDoMtx_MtxToRot(mDoMtx_stack_c::get(), &shape_angle); + current.angle.y = shape_angle.y; + + voiceStartLevel(Z2SE_WL_V_CATCHED_LOOP); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -3164,6 +7536,7 @@ asm int daAlink_c::procWolfCargoCarry() { #include "asm/d/a/d_a_alink/procWolfCargoCarry__9daAlink_cFv.s" } #pragma pop +#endif /* 8013DDF8-8013DE70 138738 0078+00 1/1 0/0 0/0 .text procWolfChainUpInit__9daAlink_cFv */ @@ -3186,13 +7559,16 @@ int daAlink_c::procWolfChainUp() { daPy_frameCtrl_c* frameCtrl = mUnderFrameCtrl; setWallGrabStatus(0x96, 2); - - if (frameCtrl->checkAnmEnd() || (checkInputOnR() && frameCtrl->getFrame() > daAlinkHIO_wlGrab_c0::m.field_0x28.mCheckFrame)) { + + if (frameCtrl->checkAnmEnd() || + (checkInputOnR() && frameCtrl->getFrame() > daAlinkHIO_wlGrab_c0::m.field_0x28.mCheckFrame)) + { u8 old_2fa3 = field_0x2fa3; fopAc_ac_c* old_actor = field_0x2844.getActor(); procWolfWaitInit(); - setUpperAnimeBaseSpeed(m_wlAnmDataTable[WANM_CHAIN_PULL].field_0x0, FLOAT_LABEL(lit_6108), lit_6109); + setUpperAnimeBaseSpeed(m_wlAnmDataTable[WANM_CHAIN_PULL].field_0x0, FLOAT_LABEL(lit_6108), + lit_6109); if (old_actor != NULL) { field_0x2fa3 = old_2fa3; @@ -3204,16 +7580,105 @@ int daAlink_c::procWolfChainUp() { } /* 8013DF30-8013E034 138870 0104+00 1/1 0/0 0/0 .text procWolfGanonCatchInit__9daAlink_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm int daAlink_c::procWolfGanonCatchInit() { - nofralloc -#include "asm/d/a/d_a_alink/procWolfGanonCatchInit__9daAlink_cFv.s" +int daAlink_c::procWolfGanonCatchInit() { + if (!dComIfGp_event_compulsory(this, 0, 0xFFEF)) { + return 0; + } + + mDemo.i_setSpecialDemoType(); + field_0x27f4->mStatus |= 0x800; + + commonProcInit(PROC_WOLF_GANON_CATCH); + field_0x280c.setData(field_0x27f4); + static_cast(field_0x27f4)->setThrowModeCatch(); + setSingleAnimeWolfBase(WANM_PIG_GANON_CATCH_ST); + + shape_angle.y = cLib_targetAngleY(¤t.pos, &field_0x27f4->current.pos); + current.angle.y = shape_angle.y + 0x8000; + + mNormalSpeed = lit_6895; + mProcVar3.field_0x300e.z = 30; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.x = 0; + setFootEffectProcType(0); + field_0x2f9d = 0x60; + mProcVar3.field_0x300e.y = 4; + return 1; } -#pragma pop /* 8013E034-8013E240 138974 020C+00 1/0 0/0 0/0 .text procWolfGanonCatch__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfGanonCatch() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + + if (mProcVar2.field_0x300c == 0) { + fopEn_enemy_c* ganon_p = (fopEn_enemy_c*)field_0x280c.getActor(); + if (ganon_p == NULL) { + resetSpecialEvent(); + procWolfWaitInit(); + return 1; + } + + if (!doButton() || !mLinkAcch.ChkGroundHit()) { + resetSpecialEvent(); + ganon_p->setThrowModeDash(); + procWolfWaitInit(); + return 1; + } + + if (checkAnmEnd(frameCtrl_p)) { + setSingleAnimeWolfBase(WANM_PIG_GANON_CATCH_END); + } + + if (checkInputOnR()) { + int direction = getDirectionFromAngle(mStickAngle); + if (direction == DIR_LEFT || direction == DIR_RIGHT) { + mProcVar3.field_0x300e.y = direction; + } + } + + if (cLib_chaseF(&mNormalSpeed, 0.0f, 1.0f)) { + if (mProcVar3.field_0x300e.z != 0) { + mProcVar3.field_0x300e.z--; + } else { + if (mProcVar3.field_0x300e.y == DIR_LEFT) { + setSingleAnimeWolfBase(WANM_PIG_GANON_THROW_LEFT_START); + ganon_p->setThrowModeThrowLeft(); + } else if (mProcVar3.field_0x300e.y == DIR_RIGHT) { + setSingleAnimeWolfBase(WANM_PIG_GANON_THROW_RIGHT_START); + ganon_p->setThrowModeThrowRight(); + } else { + resetSpecialEvent(); + ganon_p->setThrowModeDash(); + procWolfWaitInit(); + return 1; + } + + mProcVar2.field_0x300c = 1; + current.angle.y = shape_angle.y; + } + } else if (mNormalSpeed > 5.0f) { + field_0x2f9d = 0x60; + } + } else { + if (checkAnmEnd(frameCtrl_p)) { + if (mProcVar3.field_0x300e.y == DIR_LEFT) { + setSingleAnimeWolfBase(WANM_PIG_GANON_THROW_LEFT_END); + } else { + setSingleAnimeWolfBase(WANM_PIG_GANON_THROW_RIGHT_END); + } + } + + if (mProcVar3.field_0x300e.x != 0) { + resetSpecialEvent(); + procWolfWaitInit(); + } + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -3222,6 +7687,7 @@ asm int daAlink_c::procWolfGanonCatch() { #include "asm/d/a/d_a_alink/procWolfGanonCatch__9daAlink_cFv.s" } #pragma pop +#endif /* 8013E240-8013E2A8 138B80 0068+00 1/1 0/0 0/0 .text procWolfChainReadyInit__9daAlink_cFv */ int daAlink_c::procWolfChainReadyInit() { @@ -3229,8 +7695,8 @@ int daAlink_c::procWolfChainReadyInit() { field_0x280c.setData(field_0x27f4); setSingleAnimeWolfParam(WANM_ATTACK_A_START, &daAlinkHIO_wlAtNjump_c0::m.field_0x0); mNormalSpeed = FLOAT_LABEL(lit_6108); - field_0x300c = 0; - field_0x300e.x = 0; + mProcVar2.field_0x300c = 0; + mProcVar3.field_0x300e.x = 0; return 1; } @@ -3297,6 +7763,44 @@ asm int daAlink_c::procWolfDigThroughInit(int param_0) { #pragma pop /* 8013F7C4-8013F90C 13A104 0148+00 1/0 0/0 0/0 .text procWolfDigThrough__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfDigThrough() { + daPy_frameCtrl_c* frameCtrl_p = mUnderFrameCtrl; + field_0x2f99 = 4; + + if (mProcVar3.field_0x300e.x != 0) { + onSceneChangeArea(mProcVar3.field_0x300e.y, 0xFF, NULL); + } else { + if (checkAnmEnd(frameCtrl_p)) { + if (mProcVar3.field_0x300e.z != 0) { + dComIfGs_setRestartRoom(current.pos, shape_angle.y, getStartRoomNo()); + } + + resetSpecialEvent(); + + if (checkInputOnR()) { + checkNextActionWolf(0); + } else { + field_0x2f99 = 4; + procWolfSwimEndWaitInit(1); + } + + return 1; + } + + if (mProcVar3.field_0x300e.y >= 0 && frameCtrl_p->checkPass(21.0f)) { + mProcVar3.field_0x300e.x = 1; + } + } + + if (frameCtrl_p->checkPass(100.0f)) { + voiceStart(Z2SE_WL_V_BREATH_RUN); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -3305,6 +7809,7 @@ asm int daAlink_c::procWolfDigThrough() { #include "asm/d/a/d_a_alink/procWolfDigThrough__9daAlink_cFv.s" } #pragma pop +#endif /* 8013F90C-8013FA14 13A24C 0108+00 1/1 0/0 0/0 .text setSmellSave__9daAlink_cFv */ void daAlink_c::setSmellSave() { @@ -3312,25 +7817,78 @@ void daAlink_c::setSmellSave() { dComIfGs_offEventBit(0x2F04); // OFF: Got Medicine Scent } - dMsgObject_setSmellType(field_0x300e.z); + dMsgObject_setSmellType(mProcVar3.field_0x300e.z); - if (field_0x300e.z == SMELL_MEDICINE) { + if (mProcVar3.field_0x300e.z == SMELL_MEDICINE) { dComIfGs_onEventBit(0x2F04); // ON: Got Medicine Scent - } else if (field_0x300e.z == SMELL_CHILDREN) { + } else if (mProcVar3.field_0x300e.z == SMELL_CHILDREN) { i_fopAcM_onSwitch(this, 102); - } else if (field_0x300e.z == SMELL_YELIA_POUCH) { + } else if (mProcVar3.field_0x300e.z == SMELL_YELIA_POUCH) { i_fopAcM_onSwitch(this, 103); - } else if (field_0x300e.z == SMELL_FISH) { + } else if (mProcVar3.field_0x300e.z == SMELL_FISH) { dComIfGs_onEventBit(0x6120); // ON: Got Reekfish scent - } else if (field_0x300e.z == SMELL_POH) { + } else if (mProcVar3.field_0x300e.z == SMELL_POH) { dComIfGs_onEventBit(0x6210); // ON: Got Poe scent } - setGetSubBgm(field_0x300e.z); + setGetSubBgm(mProcVar3.field_0x300e.z); } /* 8013FA14-8013FC24 13A354 0210+00 1/1 0/0 0/0 .text procWolfGetSmellInit__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfGetSmellInit() { + if (!dComIfGp_event_compulsory(this, 0, 0xFFFF)) { + return 0; + } + + mDemo.i_setSpecialDemoType(); + commonProcInit(PROC_WOLF_GET_SMELL); + setSingleAnimeWolfBaseSpeed(WANM_SMELL, daAlinkHIO_wlChain_c0::m.field_0x54, + daAlinkHIO_wlChain_c0::m.field_0x58); + voiceStartLevel(Z2SE_WL_V_SNIFF); + + shape_angle.y = fopAcM_searchActorAngleY(this, field_0x27f4); + current.angle.y = shape_angle.y; + + current.pos.x = field_0x27f4->current.pos.x - cM_ssin(shape_angle.y) * 100.0f; + current.pos.z = field_0x27f4->current.pos.z - cM_scos(shape_angle.y) * 100.0f; + + field_0x280c.setData(field_0x27f4); + static_cast(field_0x27f4)->field_0x588 = 1; + static_cast(field_0x27f4)->field_0x587 = 0; + mProcVar3.field_0x300e.z = static_cast(field_0x27f4)->field_0x589; + fopAcM_OnStatus(field_0x27f4, 0x800); + + dComIfGp_setPlayerStatus1(0, 0x4000000); + mProcVar2.field_0x300c = 0; + + if (dComIfGs_getCollectSmell() == NO_ITEM) { + field_0x3198 = 0xBBC; + } else { + field_0x3198 = 0xBBB; + } + + field_0x319c = -1; + + if (mProcVar3.field_0x300e.z == SMELL_YELIA_POUCH) { + field_0x319c = 0x2220; + } else if (mProcVar3.field_0x300e.z == SMELL_CHILDREN) { + field_0x319c = 0x2240; + } + + if (field_0x319c < 0 || i_dComIfGs_isEventBit(field_0x319c)) { + field_0x319c = -1; + } + + mProcVar3.field_0x300e.y = 0; + mNormalSpeed = 0.0f; + field_0x3588 = l_wolfBaseAnime; + onWolfEyeUp(); + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -3339,8 +7897,87 @@ asm int daAlink_c::procWolfGetSmellInit() { #include "asm/d/a/d_a_alink/procWolfGetSmellInit__9daAlink_cFv.s" } #pragma pop +#endif /* 8013FC24-8013FF28 13A564 0304+00 1/0 0/0 0/0 .text procWolfGetSmell__9daAlink_cFv */ +// matches with literals +#ifdef NONMATCHING +int daAlink_c::procWolfGetSmell() { + kytag03_class* kytag3_p = (kytag03_class*)field_0x280c.getActor(); + + if (field_0x319c >= 0) { + if (i_checkSpecialDemoMode()) { + i_dComIfGp_getEvent().reset(this); + dComIfGp_clearPlayerStatus1(0, 0x4000000); + + if (mProcVar3.field_0x300e.z == SMELL_YELIA_POUCH) { + fopAcM_orderOtherEvent(this, "SMELL_1st", 0xFFFF, 0x400, 1); + } else { + fopAcM_orderOtherEvent(this, "SMELL_Child", 0xFFFF, 0x400, 1); + } + + mDemo.setSystemDemoType(); + } else if (mDemo.getParam0() == 0) { + dComIfGs_onEventBit(field_0x319c); + dComIfGp_evmng_cutEnd(field_0x3184); + + if (kytag3_p != NULL) { + kytag3_p->field_0x588 = 0; + } + } + } + + if (checkUnderMove0BckNoArcWolf(WANM_SMELL)) { + voiceStartLevel(Z2SE_WL_V_SNIFF); + } + + if (mProcVar3.field_0x300e.y != 0) { + field_0x2f99 = 4; + } + + if (mProcVar2.field_0x300c != 0) { + if (mMsgFlow.doFlow(this, NULL, 0)) { + if (kytag3_p != NULL) { + kytag3_p->field_0x588 = 0; + } + resetSpecialEvent(); + } else if (mMsgFlow.getChoiceNo() == 0 && + mProcVar3.field_0x300e.z != dComIfGs_getCollectSmell()) + { + setSmellSave(); + } + } else if (mProcVar3.field_0x300e.y == 0) { + if ((kytag3_p == NULL || (field_0x319c < 0 && kytag3_p->field_0x588 == 2)) || + (mDemo.getDemoMode() == 0x37 && mDemo.getParam0() == 1)) + { + setSingleAnimeWolf(WANM_GET_A, 1.0f, 10.0f, -1, 3.0f); + dComIfGp_setPlayerStatus1(0, 0x4000000); + + if (kytag3_p != NULL) { + fopAcM_OnStatus(kytag3_p, 0x800); + } + + mProcVar3.field_0x300e.y = 1; + + dCam_getBody()->StartEventCamera(8, fopAcM_GetID(this), 0); + field_0x2f99 = 12; + + if (field_0x3198 == 0xBBC) { + setSmellSave(); + } + } else if (mProcVar0.field_0x3008 != 0) { + mProcVar0.field_0x3008--; + } + } else if (checkAnmEnd(mUnderFrameCtrl)) { + setSingleAnimeWolfBase(WANM_GET); + field_0x2f99 = 12; + mProcVar2.field_0x300c = 1; + mMsgFlow.init(this, field_0x3198, 0, NULL); + } + + return 1; +} +#else #pragma push #pragma optimization_level 0 #pragma optimizewithasm off @@ -3348,4 +7985,5 @@ asm int daAlink_c::procWolfGetSmell() { nofralloc #include "asm/d/a/d_a_alink/procWolfGetSmell__9daAlink_cFv.s" } -#pragma pop \ No newline at end of file +#pragma pop +#endif diff --git a/src/d/d_camera.cpp b/src/d/d_camera.cpp index 54ba7c6d3be..d4f71af7d85 100644 --- a/src/d/d_camera.cpp +++ b/src/d/d_camera.cpp @@ -984,6 +984,30 @@ SECTION_DATA static void* lit_4497[3] = { #pragma pop /* 803BA25C-803BA34C 01737C 00F0+00 2/3 3/3 0/0 .data engine_tbl__9dCamera_c */ +#ifdef NONMATCHING +engine_fn dCamera_c::engine_tbl[] = { + &dCamera_c::letCamera, + &dCamera_c::chaseCamera, + &dCamera_c::lockonCamera, + &dCamera_c::talktoCamera, + &dCamera_c::subjectCamera, + &dCamera_c::fixedPositionCamera, + &dCamera_c::fixedFrameCamera, + &dCamera_c::towerCamera, + &dCamera_c::rideCamera, + &dCamera_c::manualCamera, + &dCamera_c::eventCamera, + &dCamera_c::hookshotCamera, + &dCamera_c::colosseumCamera, + &dCamera_c::observeCamera, + &dCamera_c::magneCamera, + &dCamera_c::railCamera, + &dCamera_c::paraRailCamera, + &dCamera_c::oneSideCamera, + &dCamera_c::test1Camera, + &dCamera_c::test2Camera, +}; +#else SECTION_DATA u8 dCamera_c::engine_tbl[240] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1001,6 +1025,7 @@ SECTION_DATA u8 dCamera_c::engine_tbl[240] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; +#endif /* 803BA34C-803BA378 -00001 002C+00 1/1 0/0 0/0 .data @7128 */ SECTION_DATA static void* lit_7128[11] = { @@ -2012,7 +2037,7 @@ asm void dCamera_c::getParamTargetActor(s32 param_0) { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dCamera_c::GetCameraTypeFromMapToolID(s32 param_0, s32 param_1) { +asm int dCamera_c::GetCameraTypeFromMapToolID(s32 param_0, s32 param_1) { nofralloc #include "asm/d/d_camera/GetCameraTypeFromMapToolID__9dCamera_cFll.s" } @@ -2577,7 +2602,7 @@ SECTION_SDATA2 static f32 lit_10582 = -50.0f; #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dCamera_c::chaseCamera(s32 param_0) { +asm bool dCamera_c::chaseCamera(s32 param_0) { nofralloc #include "asm/d/d_camera/chaseCamera__9dCamera_cFl.s" } @@ -2691,7 +2716,7 @@ SECTION_SDATA2 static f32 lit_11175 = 1.0f / 50.0f; #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dCamera_c::lockonCamera(s32 param_0) { +asm bool dCamera_c::lockonCamera(s32 param_0) { nofralloc #include "asm/d/d_camera/lockonCamera__9dCamera_cFl.s" } @@ -2838,7 +2863,7 @@ SECTION_SDATA2 static f32 lit_12297 = 7.0f / 25.0f; #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dCamera_c::talktoCamera(s32 param_0) { +asm bool dCamera_c::talktoCamera(s32 param_0) { nofralloc #include "asm/d/d_camera/talktoCamera__9dCamera_cFl.s" } @@ -2914,7 +2939,7 @@ SECTION_SDATA2 static f32 lit_12869 = -511.0f; #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dCamera_c::subjectCamera(s32 param_0) { +asm bool dCamera_c::subjectCamera(s32 param_0) { nofralloc #include "asm/d/d_camera/subjectCamera__9dCamera_cFl.s" } @@ -2928,7 +2953,7 @@ SECTION_SDATA2 static f32 lit_13132 = 4.0f; #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dCamera_c::magneCamera(s32 param_0) { +asm bool dCamera_c::magneCamera(s32 param_0) { nofralloc #include "asm/d/d_camera/magneCamera__9dCamera_cFl.s" } @@ -2942,7 +2967,7 @@ SECTION_SDATA2 static f32 lit_13314 = 0.9990000128746033f; #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dCamera_c::colosseumCamera(s32 param_0) { +asm bool dCamera_c::colosseumCamera(s32 param_0) { nofralloc #include "asm/d/d_camera/colosseumCamera__9dCamera_cFl.s" } @@ -2966,7 +2991,7 @@ SECTION_SDATA2 static f32 lit_13673 = 1.0f / 40.0f; #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dCamera_c::towerCamera(s32 param_0) { +asm bool dCamera_c::towerCamera(s32 param_0) { nofralloc #include "asm/d/d_camera/towerCamera__9dCamera_cFl.s" } @@ -2995,7 +3020,7 @@ SECTION_SDATA2 static f32 lit_14064 = -100.0f; #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dCamera_c::hookshotCamera(s32 param_0) { +asm bool dCamera_c::hookshotCamera(s32 param_0) { nofralloc #include "asm/d/d_camera/hookshotCamera__9dCamera_cFl.s" } @@ -3014,7 +3039,7 @@ static u8 struct_80451040[4]; #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dCamera_c::railCamera(s32 param_0) { +asm bool dCamera_c::railCamera(s32 param_0) { nofralloc #include "asm/d/d_camera/railCamera__9dCamera_cFl.s" } @@ -3033,7 +3058,7 @@ static u8 struct_80451044[4]; #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dCamera_c::paraRailCamera(s32 param_0) { +asm bool dCamera_c::paraRailCamera(s32 param_0) { nofralloc #include "asm/d/d_camera/paraRailCamera__9dCamera_cFl.s" } @@ -3106,7 +3131,7 @@ SECTION_SDATA2 static f32 lit_15487 = 1.1500000953674316f; #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dCamera_c::rideCamera(s32 param_0) { +asm bool dCamera_c::rideCamera(s32 param_0) { nofralloc #include "asm/d/d_camera/rideCamera__9dCamera_cFl.s" } @@ -3138,7 +3163,7 @@ SECTION_SDATA2 static f32 lit_15773 = 4.0f / 3.0f; #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dCamera_c::observeCamera(s32 param_0) { +asm bool dCamera_c::observeCamera(s32 param_0) { nofralloc #include "asm/d/d_camera/observeCamera__9dCamera_cFl.s" } @@ -3148,7 +3173,7 @@ asm void dCamera_c::observeCamera(s32 param_0) { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dCamera_c::fixedFrameCamera(s32 param_0) { +asm bool dCamera_c::fixedFrameCamera(s32 param_0) { nofralloc #include "asm/d/d_camera/fixedFrameCamera__9dCamera_cFl.s" } @@ -3159,7 +3184,7 @@ asm void dCamera_c::fixedFrameCamera(s32 param_0) { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dCamera_c::fixedPositionCamera(s32 param_0) { +asm bool dCamera_c::fixedPositionCamera(s32 param_0) { nofralloc #include "asm/d/d_camera/fixedPositionCamera__9dCamera_cFl.s" } @@ -3169,7 +3194,7 @@ asm void dCamera_c::fixedPositionCamera(s32 param_0) { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dCamera_c::oneSideCamera(s32 param_0) { +asm bool dCamera_c::oneSideCamera(s32 param_0) { nofralloc #include "asm/d/d_camera/oneSideCamera__9dCamera_cFl.s" } @@ -3227,7 +3252,7 @@ SECTION_DEAD static char const* const stringBase_803942F2 = "WideMode"; #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void dCamera_c::eventCamera(s32 param_0) { +asm bool dCamera_c::eventCamera(s32 param_0) { nofralloc #include "asm/d/d_camera/eventCamera__9dCamera_cFl.s" } diff --git a/src/d/d_ev_camera.cpp b/src/d/d_ev_camera.cpp index 9e5542ff0ab..775ce5d8ac7 100644 --- a/src/d/d_ev_camera.cpp +++ b/src/d/d_ev_camera.cpp @@ -4,224 +4,26 @@ // #include "d/d_ev_camera.h" +#include "d/a/d_a_alink.h" +#include "d/com/d_com_inf_game.h" +#include "d/d_camera.h" +#include "d/d_demo.h" #include "dol2asm.h" +#include "m_Do/m_Do_controller_pad.h" // // Types: // -struct mDoCPd_c { - static u8 m_cpadInfo[256]; -}; - -struct fopAc_ac_c {}; - -struct daPy_py_c { - /* 800977B4 */ void checkMidnaRide() const; - /* 80097850 */ bool checkCanoeRide() const; - /* 80097858 */ bool checkBoardRide() const; - /* 80097860 */ bool checkSpinnerRide() const; - /* 80097868 */ bool checkBoarRide() const; - - static u8 m_midnaActor[4]; -}; - struct daMidna_c { /* 800977A8 */ void checkNoDraw() const; }; -struct daAlink_c { - /* 80097870 */ void getShadowTalkAtnPos(); -}; - -struct dEvt_control_c { - /* 800432EC */ void convPId(unsigned int); - /* 800434D8 */ void searchMapEventData(u8); -}; - -struct Vec {}; - -struct cXyz { - /* 80009184 */ ~cXyz(); - /* 8008E790 */ void abs() const; - /* 8008E8D0 */ void operator-=(Vec const&); - /* 8008E904 */ void operator+=(Vec const&); - /* 800977D8 */ void operator=(cXyz const&); - /* 800977F4 */ cXyz(cXyz const&); - /* 80266AE4 */ void operator+(Vec const&) const; - /* 80266B34 */ void operator-(Vec const&) const; - /* 80266B84 */ void operator*(f32) const; - /* 80266CE4 */ void norm() const; - /* 80266EF4 */ void normalize(); - - static f32 Zero[3]; -}; - -struct dEvent_manager_c { - /* 800480EC */ void getMySubstanceP(int, char const*, int); - /* 80048144 */ void getMySubstanceNum(int, char const*); - /* 800483C4 */ void setGoal(cXyz*); -}; - -struct dDemo_object_c { - /* 80039128 */ void getActiveCamera(); -}; - -struct dDemo_c { - static u8 m_object[4]; -}; - -struct dCcS { - /* 80086D8C */ void ChkCamera(cXyz&, cXyz&, f32, fopAc_ac_c*, fopAc_ac_c*, fopAc_ac_c*); -}; - -struct dCamera_c { - struct dCamInfo_c {}; - - /* 80088A7C */ void StartEventCamera(int, int, ...); - /* 80088BBC */ void EndEventCamera(int); - /* 80088C24 */ void searchEventArgData(char*); - /* 8008908C */ void getEvIntData(int*, char*, int); - /* 80088CB0 */ void getEvIntData(int*, char*); - /* 80088D90 */ void getEvFloatData(f32*, char*); - /* 80089154 */ void getEvFloatData(f32*, char*, f32); - /* 80088E58 */ void getEvFloatListData(f32**, char*); - /* 80088F1C */ void getEvXyzListData(cXyz**, char*); - /* 8008941C */ void getEvStringPntData(char*, char*); - /* 80088FE0 */ void getEvStringPntData(char*); - /* 8008922C */ void getEvXyzData(cXyz*, char*, cXyz); - /* 8008933C */ void getEvStringData(char*, char*, char*); - /* 800894C4 */ void getEvActor(char*); - /* 800895F4 */ void getEvActor(char*, char*); - /* 80089730 */ void pauseEvCamera(); - /* 800897E8 */ void fixedFrameEvCamera(); - /* 8008A510 */ void stokerEvCamera(); - /* 8008A974 */ void rollingEvCamera(); - /* 8008B9B0 */ void fixedPositionEvCamera(); - /* 8008BE2C */ void uniformTransEvCamera(); - /* 8008BE50 */ void uniformBrakeEvCamera(); - /* 8008BE74 */ void uniformAcceleEvCamera(); - /* 8008BE98 */ void transEvCamera(int); - /* 8008E938 */ void watchActorEvCamera(); - /* 8008FAE8 */ void restorePosEvCamera(); - /* 80090174 */ void talktoEvCamera(); - /* 80090230 */ void maptoolIdEvCamera(); - /* 80090478 */ void styleEvCamera(); - /* 80090514 */ void gameOverEvCamera(); - /* 80091468 */ void tactEvCamera(); - /* 800923B8 */ bool turnToActorEvCamera(); - /* 800923C0 */ void stbWaitEvCamera(); - /* 800924D0 */ void saveEvCamera(); - /* 8009258C */ void loadEvCamera(); - /* 800929AC */ void useItem0EvCamera(); - /* 800937AC */ void useItem1EvCamera(); - /* 80094240 */ void getItemEvCamera(); - /* 80094A70 */ void possessedEvCamera(); - /* 80095010 */ void fixedFramesEvCamera(); - /* 8009544C */ void bSplineEvCamera(); - /* 800956E4 */ void twoActor0EvCamera(); - /* 80095E7C */ void peepHoleEvCamera(); - /* 80095FD0 */ void digHoleEvCamera(); - /* 800965AC */ void hintTalkEvCamera(); - /* 80096EDC */ void bspTransEvCamera(); - /* 80097694 */ bool portalWarpEvCamera(); - /* 8009771C */ void attentionPos(fopAc_ac_c*); - /* 80097738 */ void directionOf(fopAc_ac_c*); - /* 8009775C */ void positionOf(fopAc_ac_c*); - /* 80097778 */ void setFlag(u32); - /* 8009778C */ void eyePos(fopAc_ac_c*); - /* 80164944 */ void GetCameraTypeFromMapToolID(s32, s32); - /* 80164C64 */ void pushInfo(dCamera_c::dCamInfo_c*, s16); - /* 80164E20 */ void relationalPos(fopAc_ac_c*, fopAc_ac_c*, cXyz*, f32); - /* 80164D6C */ void relationalPos(fopAc_ac_c*, cXyz*); - /* 8016517C */ void pointInSight(cXyz*); - /* 80165AF0 */ void lineBGCheck(cXyz*, cXyz*, u32); - /* 801659F4 */ void lineBGCheck(cXyz*, cXyz*, cXyz*, u32); - /* 80180C68 */ void Reset(); - /* 80181170 */ void StartBlure(int, fopAc_ac_c*, f32, f32); - /* 80181208 */ void SetBlureAlpha(f32); - /* 80181210 */ void SetBlureScale(f32, f32, f32); - /* 80181220 */ void SetBlurePosition(f32, f32, f32); - - static u8 engine_tbl[240]; -}; - -struct dCamParam_c { - /* 80088620 */ void SearchStyle(u32); -}; - -struct cSAngle { - /* 80030510 */ ~cSAngle(); - /* 80270F68 */ cSAngle(cSAngle const&); - /* 80270FC8 */ cSAngle(f32); - /* 80270F98 */ cSAngle(s16); - /* 8027100C */ void Val(f32); - /* 80271030 */ void Degree() const; - /* 802710CC */ void Abs() const; - /* 802710E8 */ void Inv() const; - /* 80271120 */ void Cos() const; - /* 802711A4 */ void operator-(cSAngle const&) const; - /* 80271148 */ void operator-() const; - /* 80271174 */ void operator+(cSAngle const&) const; - /* 802711FC */ void operator+(s16) const; - /* 802711D4 */ void operator+=(cSAngle const&); - /* 80271264 */ void operator*(f32) const; - /* 802712B4 */ void operator*=(f32); - - static u8 _0[2 + 2 /* padding */]; - static u8 _90[2 + 2 /* padding */]; -}; - -struct dCamMath { - /* 8008813C */ void rationalBezierRatio(f32, f32); - /* 80088384 */ void xyzRotateY(cXyz&, cSAngle); - /* 800883EC */ void xyzHorizontalDistance(cXyz&, cXyz&); -}; - -struct d2DBSplinePath { - /* 80097878 */ void Init(s32, s32); - /* 80097904 */ void Step(); - /* 80097B20 */ void Calc(f32*); - /* 80097A6C */ void Calc(cXyz*); -}; - -struct camera_class {}; - -struct cSGlobe { - /* 8007167C */ ~cSGlobe(); - /* 8008E774 */ void operator=(cSGlobe const&); - /* 8008E894 */ void U(cSAngle const&); - /* 8008FA58 */ void V(cSAngle const&); - /* 80271880 */ cSGlobe(cXyz const&); - /* 802717F0 */ cSGlobe(cSGlobe const&); - /* 80271850 */ cSGlobe(f32, cSAngle const&, cSAngle const&); - /* 80271A08 */ void Val(f32, cSAngle const&, cSAngle const&); - /* 80271A70 */ void Val(cXyz const&); - /* 80271AB4 */ void Xyz() const; - /* 80271B30 */ void Norm() const; - /* 80271B7C */ void Invert(); -}; - -struct cM3dGPla { - /* 8001DB90 */ ~cM3dGPla(); -}; - -struct cM3dGLin { - /* 80036A5C */ ~cM3dGLin(); - /* 8026F2A8 */ cM3dGLin(cXyz const&, cXyz const&); -}; - -struct cBgS_PolyInfo {}; - -struct cBgS { - /* 80074744 */ void GetTriPla(cBgS_PolyInfo const&, cM3dGPla*) const; -}; - // // Forward References: // -extern "C" static void func_800889F8(); +extern "C" static bool func_800889F8(int); extern "C" void StartEventCamera__9dCamera_cFiie(); extern "C" void EndEventCamera__9dCamera_cFi(); extern "C" void searchEventArgData__9dCamera_cFPc(); @@ -375,10 +177,6 @@ extern "C" void Xyz__7cSGlobeCFv(); extern "C" void Norm__7cSGlobeCFv(); extern "C" void Invert__7cSGlobeFv(); extern "C" void __dl__FPv(); -extern "C" void PSVECAdd(); -extern "C" void PSVECSubtract(); -extern "C" void PSVECSquareMag(); -extern "C" void __va_arg(); extern "C" void __register_global_object(); extern "C" void __ptmf_scall(); extern "C" void _savegpr_24(); @@ -393,15 +191,10 @@ extern "C" void _restgpr_26(); extern "C" void _restgpr_27(); extern "C" void _restgpr_28(); extern "C" void _restgpr_29(); -extern "C" void strcmp(); -extern "C" void strcpy(); extern "C" extern void* __vt__8cM3dGPla[3]; extern "C" u8 engine_tbl__9dCamera_c[240]; extern "C" u8 m_cpadInfo__8mDoCPd_c[256]; -extern "C" extern u8 g_dComIfG_gameInfo[122384]; extern "C" f32 Zero__4cXyz[3]; -extern "C" extern u32 __float_nan; -extern "C" extern u8 mStayNo__20dStage_roomControl_c[4]; extern "C" u8 m_object__7dDemo_c[4]; extern "C" extern u8 struct_80450F88[8]; extern "C" u8 m_midnaActor__9daPy_py_c[4]; @@ -417,7 +210,7 @@ extern "C" u8 _90__7cSAngle[2 + 2 /* padding */]; #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -static asm void func_800889F8() { +static asm bool func_800889F8(int) { nofralloc #include "asm/d/d_ev_camera/func_800889F8.s" } @@ -425,35 +218,74 @@ static asm void func_800889F8() { /* 80088A7C-80088BBC 0833BC 0140+00 0/0 15/15 2/2 .text StartEventCamera__9dCamera_cFiie */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dCamera_c::StartEventCamera(int param_0, int param_1, ...) { - nofralloc -#include "asm/d/d_ev_camera/StartEventCamera__9dCamera_cFiie.s" +int dCamera_c::StartEventCamera(int param_0, int param_1, ...) { + if (i_chkFlag(0x20000000)) { + return 0; + } + + mEventData.field_0x14 = param_1; + mEventData.field_0x18 = param_0; + + va_list args; + va_start(args, param_1); + for (int i = 0; i < 8; i++) { + char* param_name = va_arg(args, char*); + if (param_name != NULL) { + strcpy(mEventData.mEventParams[i].name, param_name); + mEventData.mEventParams[i].field_0x10 = va_arg(args, int); + mEventData.mEventParams[i].value = va_arg(args, int); + } else { + mEventData.mEventParams[i].name[0] = 0; + break; + } + } + va_end(args); + + i_setFlag(0x20000000); + mCurCamTypeTimer = 0; + mEventData.field_0x0 = 0; + return 1; } -#pragma pop /* 80088BBC-80088C24 0834FC 0068+00 0/0 3/3 4/4 .text EndEventCamera__9dCamera_cFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dCamera_c::EndEventCamera(int param_0) { - nofralloc -#include "asm/d/d_ev_camera/EndEventCamera__9dCamera_cFi.s" +int dCamera_c::EndEventCamera(int param_0) { + if (!i_chkFlag(0x20000000)) { + return 0; + } + + if (mEventData.field_0x14 == -1 || mEventData.field_0x14 == param_0) { + i_clrFlag(0x20000000); + mEventData.field_0x0 = 1; + + if (i_dComIfGp_getEvent().runCheck()) { + i_dComIfGp_getEventManager().setCameraPlay(2); + } + + return 1; + } + + return 0; } -#pragma pop /* 80088C24-80088CB0 083564 008C+00 10/10 0/0 0/0 .text searchEventArgData__9dCamera_cFPc */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dCamera_c::searchEventArgData(char* param_0) { - nofralloc -#include "asm/d/d_ev_camera/searchEventArgData__9dCamera_cFPc.s" +int dCamera_c::searchEventArgData(char* i_eventName) { + int i; + bool found_event = false; + + for (i = 0; i < 8; i++) { + if (*mEventData.mEventParams[i].name == 0) { + break; + } + + if (strcmp(mEventData.mEventParams[i].name, i_eventName) == 0) { + found_event = true; + break; + } + } + + return found_event ? i : -1; } -#pragma pop /* 80088CB0-80088D90 0835F0 00E0+00 3/3 1/1 0/0 .text getEvIntData__9dCamera_cFPiPc */ #pragma push @@ -846,7 +678,8 @@ static asm void func_8008E750() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void cSGlobe::operator=(cSGlobe const& param_0) { +// asm void cSGlobe::operator=(cSGlobe const& param_0) { +extern "C" asm void __as__7cSGlobeFRC7cSGlobe() { nofralloc #include "asm/d/d_ev_camera/__as__7cSGlobeFRC7cSGlobe.s" } @@ -856,7 +689,8 @@ asm void cSGlobe::operator=(cSGlobe const& param_0) { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void cXyz::abs() const { +// asm void cXyz::abs() const { +extern "C" asm void abs__4cXyzCFv() { nofralloc #include "asm/d/d_ev_camera/abs__4cXyzCFv.s" } @@ -866,7 +700,8 @@ asm void cXyz::abs() const { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void cSGlobe::U(cSAngle const& param_0) { +// asm void cSGlobe::U(cSAngle const& param_0) { +extern "C" asm void U__7cSGlobeFRC7cSAngle() { nofralloc #include "asm/d/d_ev_camera/U__7cSGlobeFRC7cSAngle.s" } @@ -876,7 +711,8 @@ asm void cSGlobe::U(cSAngle const& param_0) { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void cXyz::operator-=(Vec const& param_0) { +// asm void cXyz::operator-=(Vec const& param_0) { +extern "C" asm void __ami__4cXyzFRC3Vec() { nofralloc #include "asm/d/d_ev_camera/__ami__4cXyzFRC3Vec.s" } @@ -886,7 +722,8 @@ asm void cXyz::operator-=(Vec const& param_0) { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void cXyz::operator+=(Vec const& param_0) { +// asm void cXyz::operator+=(Vec const& param_0) { +extern "C" asm void __apl__4cXyzFRC3Vec() { nofralloc #include "asm/d/d_ev_camera/__apl__4cXyzFRC3Vec.s" } @@ -968,7 +805,8 @@ asm void dCamera_c::watchActorEvCamera() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void cSGlobe::V(cSAngle const& param_0) { +// asm void cSGlobe::V(cSAngle const& param_0) { +extern "C" asm void V__7cSGlobeFRC7cSAngle() { nofralloc #include "asm/d/d_ev_camera/V__7cSGlobeFRC7cSAngle.s" } @@ -1033,14 +871,98 @@ SECTION_DEAD static char const* const stringBase_8037AC5C = "CameraID"; #pragma pop /* 80090230-80090478 08AB70 0248+00 0/0 1/0 0/0 .text maptoolIdEvCamera__9dCamera_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void dCamera_c::maptoolIdEvCamera() { +// matches with sinit +#ifdef NONMATCHING +bool dCamera_c::maptoolIdEvCamera() { + if (mCurCamTypeTimer == 0) { + int id; + getEvIntData(&id, "ID", g_dComIfG_gameInfo.play.getEvent().getMapToolId()); + + mEventData.field_0x8 = 0; + field_0x160 = 0; + mCurCamTypeTimer = 0; + mEventData.field_0xec = dEvt_control_c::searchMapEventData(id); +#ifdef DEBUG + OSReport("%06d: %s: %d: map data ID %d %x\n", field_0xa8, __FILE__, 2792, id, + mEventData.field_0xec); +#endif + + int var_r6 = 0xFF; + if (mEventData.field_0xec != NULL && mEventData.field_0xec->mType == 0) { + var_r6 = mEventData.field_0xec->field_0x16; + } + + getEvIntData(&mEventData.field_0x24, "CameraID", var_r6); + } + + int temp_r31 = mEventData.field_0x24; + if (mEventData.field_0xec == NULL || temp_r31 == 0xFF) { +#ifdef DEBUG + OSReport("%d: %s: %d: ERROR!! no map data!!!\n", field_0xa8, __FILE__, 2805); +#endif + return 1; + } + + int room_no = dComIfGp_roomControl_getStayNo(); + if (func_800889F8(mEventData.field_0xec->field_0x4)) { + room_no = -1; + } + + if (mEventData.field_0xec->mType == 0 && mEventData.field_0xec->field_0xC != 0xFF) { + if (mEventData.field_0xec->field_0xC & 1) { + i_clrFlag(0x200000); + } + + if (mEventData.field_0xec->field_0xC & 2) { + field_0x88 = 0; + } + } + + mEventData.field_0xc = GetCameraTypeFromMapToolID(temp_r31, room_no); + bool var_r31 = 0; + + if (mEventData.field_0xc != 0xFF) { + s32 style = mCamTypeData[mEventData.field_0xc].field_0x18[field_0x190][0]; +#ifdef DEBUG + if (mCurCamTypeTimer == 0) { + OSReport("type %d mode %d style %d\n", mEventData.field_0xc, 0, style); + } +#endif + bool var_r3 = (this->*engine_tbl[mCamParam.Algorythmn(style)])(style); + + if (mEventData.field_0xec->mType == 0) { + if (mEventData.field_0xec->field_0x14 == 0xFF || + mCurCamTypeTimer > mEventData.field_0xec->field_0x14) + { + var_r31 = 1; + } + } else { + return var_r3; + } + } else { + mEventData.field_0xec = NULL; + var_r31 = 1; + } + + if (var_r31) { + if (mEventData.field_0xec->mType == 0 && (mEventData.field_0xec->field_0xC & 0x20)) { + return mDoCPd_c::getHoldA(mPadID) || mDoCPd_c::getHoldB(mPadID); + } + return 1; + } + + return 0; +} +#else +#pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm bool dCamera_c::maptoolIdEvCamera() { nofralloc #include "asm/d/d_ev_camera/maptoolIdEvCamera__9dCamera_cFv.s" } #pragma pop +#endif /* ############################################################################################## */ /* 8037AAF4-8037AAF4 007154 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ @@ -1986,8 +1908,7 @@ bool dCamera_c::portalWarpEvCamera() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void __sinit_d_ev_camera_cpp() { - nofralloc +asm void __sinit_d_ev_camera_cpp(){nofralloc #include "asm/d/d_ev_camera/__sinit_d_ev_camera_cpp.s" } #pragma pop @@ -2062,7 +1983,8 @@ asm void daMidna_c::checkNoDraw() const { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daPy_py_c::checkMidnaRide() const { +// asm void daPy_py_c::checkMidnaRide() const { +extern "C" asm void checkMidnaRide__9daPy_py_cCFv() { nofralloc #include "asm/d/d_ev_camera/checkMidnaRide__9daPy_py_cCFv.s" } @@ -2072,7 +1994,8 @@ asm void daPy_py_c::checkMidnaRide() const { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void fopAcM_GetID(void const* param_0) { +// asm void fopAcM_GetID(void const* param_0) { +extern "C" asm void fopAcM_GetID__FPCv() { nofralloc #include "asm/d/d_ev_camera/fopAcM_GetID__FPCv.s" } @@ -2082,7 +2005,8 @@ asm void fopAcM_GetID(void const* param_0) { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void cXyz::operator=(cXyz const& param_0) { +// asm void cXyz::operator=(cXyz const& param_0) { +extern "C" asm void __as__4cXyzFRC4cXyz() { nofralloc #include "asm/d/d_ev_camera/__as__4cXyzFRC4cXyz.s" } @@ -2092,7 +2016,8 @@ asm void cXyz::operator=(cXyz const& param_0) { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm cXyz::cXyz(cXyz const& param_0) { +// asm cXyz::cXyz(cXyz const& param_0) { +extern "C" asm void __ct__4cXyzFRC4cXyz() { nofralloc #include "asm/d/d_ev_camera/__ct__4cXyzFRC4cXyz.s" } @@ -2116,22 +2041,26 @@ void func_8009784C() { } /* 80097850-80097858 092190 0008+00 0/0 1/0 0/0 .text checkCanoeRide__9daPy_py_cCFv */ -bool daPy_py_c::checkCanoeRide() const { +// bool daPy_py_c::checkCanoeRide() const { +extern "C" bool checkCanoeRide__9daPy_py_cCFv() { return false; } /* 80097858-80097860 092198 0008+00 0/0 1/0 0/0 .text checkBoardRide__9daPy_py_cCFv */ -bool daPy_py_c::checkBoardRide() const { +// bool daPy_py_c::checkBoardRide() const { +extern "C" bool checkBoardRide__9daPy_py_cCFv() { return false; } /* 80097860-80097868 0921A0 0008+00 0/0 1/0 0/0 .text checkSpinnerRide__9daPy_py_cCFv */ -bool daPy_py_c::checkSpinnerRide() const { +// bool daPy_py_c::checkSpinnerRide() const { +extern "C" bool checkSpinnerRide__9daPy_py_cCFv() { return false; } /* 80097868-80097870 0921A8 0008+00 0/0 1/0 0/0 .text checkBoarRide__9daPy_py_cCFv */ -bool daPy_py_c::checkBoarRide() const { +// bool daPy_py_c::checkBoarRide() const { +extern "C" bool checkBoarRide__9daPy_py_cCFv() { return false; } @@ -2140,7 +2069,8 @@ bool daPy_py_c::checkBoarRide() const { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm void daAlink_c::getShadowTalkAtnPos() { +// asm void daAlink_c::getShadowTalkAtnPos() { +extern "C" asm void getShadowTalkAtnPos__9daAlink_cFv() { nofralloc #include "asm/d/d_ev_camera/getShadowTalkAtnPos__9daAlink_cFv.s" }