From 9945ba05af614d9423afb97214b715c3cb5a9283 Mon Sep 17 00:00:00 2001 From: Tal Hayon Date: Wed, 11 Dec 2024 20:03:44 +0200 Subject: [PATCH 1/3] daObj_BouMato_c OK --- .../GZ2E01/rels/d_a_obj_boumato/symbols.txt | 24 +- configure.py | 2 +- include/d/actor/d_a_arrow.h | 1 + include/d/actor/d_a_npc.h | 1 + include/d/actor/d_a_obj_boumato.h | 60 +- include/d/d_procname.h | 2 +- src/d/actor/d_a_obj_automata.cpp | 2 +- src/d/actor/d_a_obj_boumato.cpp | 838 ++++++------------ 8 files changed, 353 insertions(+), 577 deletions(-) diff --git a/config/GZ2E01/rels/d_a_obj_boumato/symbols.txt b/config/GZ2E01/rels/d_a_obj_boumato/symbols.txt index 796ee6a781c..9999758da6b 100644 --- a/config/GZ2E01/rels/d_a_obj_boumato/symbols.txt +++ b/config/GZ2E01/rels/d_a_obj_boumato/symbols.txt @@ -26,11 +26,11 @@ setSwayParam__15daObj_BouMato_cFP10fopAc_ac_c = .text:0x00001108; // type:functi setEnvTevColor__15daObj_BouMato_cFv = .text:0x0000129C; // type:function size:0x5C scope:global setRoomNo__15daObj_BouMato_cFv = .text:0x000012F8; // type:function size:0x44 scope:global setMtx__15daObj_BouMato_cFv = .text:0x0000133C; // type:function size:0x84 scope:global -daObj_BouMato_Create__FPv = .text:0x000013C0; // type:function size:0x20 scope:global -daObj_BouMato_Delete__FPv = .text:0x000013E0; // type:function size:0x20 scope:global -daObj_BouMato_Execute__FPv = .text:0x00001400; // type:function size:0x20 scope:global -daObj_BouMato_Draw__FPv = .text:0x00001420; // type:function size:0x20 scope:global -daObj_BouMato_IsDelete__FPv = .text:0x00001440; // type:function size:0x8 scope:global +daObj_BouMato_Create__FPv = .text:0x000013C0; // type:function size:0x20 scope:local +daObj_BouMato_Delete__FPv = .text:0x000013E0; // type:function size:0x20 scope:local +daObj_BouMato_Execute__FPv = .text:0x00001400; // type:function size:0x20 scope:local +daObj_BouMato_Draw__FPv = .text:0x00001420; // type:function size:0x20 scope:local +daObj_BouMato_IsDelete__FPv = .text:0x00001440; // type:function size:0x8 scope:local __dt__10cCcD_GSttsFv = .text:0x00001448; // type:function size:0x48 scope:global __sinit_d_a_obj_boumato_cpp = .text:0x00001490; // type:function size:0x74 scope:local __dt__21daObj_BouMato_Param_cFv = .text:0x00001504; // type:function size:0x48 scope:global @@ -41,7 +41,7 @@ __destroy_global_chain_reference = .dtors:0x00000000; // type:object size:0x4 sc _dtors = .dtors:0x00000000; // type:label scope:global ...rodata.0 = .rodata:0x00000000; // type:label scope:local m__21daObj_BouMato_Param_c = .rodata:0x00000000; // type:object size:0x1C scope:global -l_ccDObjData = .rodata:0x0000001C; // type:object size:0x30 scope:global +l_ccDObjData = .rodata:0x0000001C; // type:object size:0x30 scope:local @3956 = .rodata:0x0000004C; // type:object size:0x4 scope:local @3957 = .rodata:0x00000050; // type:object size:0x4 scope:local @3958 = .rodata:0x00000054; // type:object size:0x4 scope:local @@ -62,11 +62,11 @@ l_ccDObjData = .rodata:0x0000001C; // type:object size:0x30 scope:global @4356 = .rodata:0x00000098; // type:object size:0x4 scope:local @4359 = .rodata:0x000000A0; // type:object size:0x8 scope:local @stringBase0 = .rodata:0x000000A8; // type:object size:0x13 scope:local data:string_table -l_ccDCyl = .data:0x00000000; // type:object size:0x44 scope:global -l_resName = .data:0x00000044; // type:object size:0x4 scope:global data:4byte +l_ccDCyl = .data:0x00000000; // type:object size:0x44 scope:local +l_resName = .data:0x00000044; // type:object size:0x4 scope:local data:4byte jntCoOffset$4044 = .data:0x00000048; // type:object size:0x18 scope:local jntCoData$4045 = .data:0x00000060; // type:object size:0xC scope:local -daObj_BouMato_MethodTable = .data:0x0000006C; // type:object size:0x20 scope:global +daObj_BouMato_MethodTable = .data:0x0000006C; // type:object size:0x20 scope:local g_profile_OBJ_BOUMATO = .data:0x0000008C; // type:object size:0x30 scope:global __vt__12dBgS_ObjAcch = .data:0x000000BC; // type:object size:0x24 scope:global __vt__10cCcD_GStts = .data:0x000000E0; // type:object size:0xC scope:global @@ -78,7 +78,7 @@ __vt__8cM3dGLin = .data:0x0000011C; // type:object size:0xC scope:global __vt__15daObj_BouMato_c = .data:0x00000128; // type:object size:0xC scope:global __vt__21daObj_BouMato_Param_c = .data:0x00000134; // type:object size:0xC scope:global __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:global -l_findActorPtrs = .bss:0x00000008; // type:object size:0x190 scope:global -l_findCount = .bss:0x00000198; // type:object size:0x4 scope:global data:4byte +l_findActorPtrs = .bss:0x00000008; // type:object size:0x190 scope:local +l_findCount = .bss:0x00000198; // type:object size:0x4 scope:local data:4byte @3830 = .bss:0x0000019C; // type:object size:0xC scope:local -l_HIO = .bss:0x000001A8; // type:object size:0x4 scope:global data:4byte +l_HIO = .bss:0x000001A8; // type:object size:0x4 scope:local data:4byte diff --git a/configure.py b/configure.py index 81c240e52a4..5e400ba3a38 100644 --- a/configure.py +++ b/configure.py @@ -1778,7 +1778,7 @@ def MatchingFor(*versions): ActorRel(Matching, "d_a_obj_bmWindow"), ActorRel(NonMatching, "d_a_obj_bmshutter"), ActorRel(Matching, "d_a_obj_bombf"), - ActorRel(NonMatching, "d_a_obj_boumato"), + ActorRel(Matching, "d_a_obj_boumato"), ActorRel(NonMatching, "d_a_obj_brg"), ActorRel(Matching, "d_a_obj_bsGate"), ActorRel(NonMatching, "d_a_obj_bubblePilar"), diff --git a/include/d/actor/d_a_arrow.h b/include/d/actor/d_a_arrow.h index 41af4378778..b330655ca5a 100644 --- a/include/d/actor/d_a_arrow.h +++ b/include/d/actor/d_a_arrow.h @@ -58,6 +58,7 @@ class daArrow_c : public fopAc_ac_c { void setBombArrowExplode() { field_0x950 = 0; } bool checkBombArrow() const { return mArrowType == true; } + u32 getHitAcID() { return mHitAcID; } void setShoot() { fopAcM_SetParam(this, 1); } void setChargeShoot() { fopAcM_SetParam(this, 2); } diff --git a/include/d/actor/d_a_npc.h b/include/d/actor/d_a_npc.h index 9b16ab6a1a8..7825a2a1f64 100644 --- a/include/d/actor/d_a_npc.h +++ b/include/d/actor/d_a_npc.h @@ -587,6 +587,7 @@ u8 daNpcT_getDistTableIdx(int param_0, int param_1); BOOL daNpcT_chkDoBtnIsSpeak(fopAc_ac_c* i_ActorP); void daNpcT_offTmpBit(u32 i_idx); void daNpcT_onTmpBit(u32 i_idx); +BOOL daNpcT_chkTmpBit(u32 i_idx); void daNpcT_onEvtBit(u32 i_idx); struct daBaseNpc_matAnm_c { diff --git a/include/d/actor/d_a_obj_boumato.h b/include/d/actor/d_a_obj_boumato.h index e113f069d7e..02623377d67 100644 --- a/include/d/actor/d_a_obj_boumato.h +++ b/include/d/actor/d_a_obj_boumato.h @@ -1,6 +1,8 @@ #ifndef D_A_OBJ_BOUMATO_H #define D_A_OBJ_BOUMATO_H +#include "d/d_bg_s_acch.h" +#include "d/d_jnt_col.h" #include "f_op/f_op_actor_mng.h" #include "d/d_cc_d.h" @@ -13,34 +15,64 @@ * */ class daObj_BouMato_c : public fopAc_ac_c { +private: + /* 0x568 */ int field_0x568; + /* 0x56C */ request_of_phase_process_class mPhase; + /* 0x574 */ J3DModel* mModel; + /* 0x578 */ dBgS_ObjAcch mAcch; + /* 0x750 */ dCcD_Stts mStts; + /* 0x78C */ dBgS_AcchCir mAcchCir; + /* 0x7CC */ cBgS_GndChk mGndChk; + /* 0x808 */ dCcD_Cyl mCyl; + /* 0x944 */ cM3dGCyl mCyl2; + /* 0x95C */ cM3dGLin mGLin; + /* 0x978 */ dBgS_LinChk mLinChk; + /* 0x9E8 */ dJntCol_c mJntCol; + /* 0x9F8 */ csXyz field_0x9f8[3]; + /* 0xA0A */ u16 field_0xa0a; + /* 0xA0C */ int mCutType; + /* 0xA10 */ int field_0xa10; + /* 0xA14 */ f32 mGroundH; + /* 0xA18 */ f32 field_0xa18[3]; + /* 0xA24 */ s16 field_0xa24[3]; + /* 0xA2A */ s16 field_0xa2a; + /* 0xA2C */ int mShadowId; + /* 0xA30 */ s16 field_0xa30; + /* 0xA32 */ u8 field_0xa32; + /* 0xA34 */ fpc_ProcID mTargetId; + /* 0xA38 */ u8 field_0xa38; + /* 0xA39 */ bool mIsCurTurnRight; + public: - /* 80BBAFEC */ ~daObj_BouMato_c(); - /* 80BBB230 */ void create(); - /* 80BBB770 */ void CreateHeap(); - /* 80BBB800 */ void Delete(); - /* 80BBB834 */ void Execute(); - /* 80BBBD80 */ void Draw(); - /* 80BBBE50 */ void createHeapCallBack(fopAc_ac_c*); - /* 80BBBE70 */ void tgHitCallBack(fopAc_ac_c*, dCcD_GObjInf*, fopAc_ac_c*, dCcD_GObjInf*); - /* 80BBBEA0 */ void srchArrow(void*, void*); + /* 80BBAFEC */ virtual ~daObj_BouMato_c(); + /* 80BBB230 */ int create(); + /* 80BBB770 */ int CreateHeap(); + /* 80BBB800 */ int Delete(); + /* 80BBB834 */ int Execute(); + /* 80BBBD80 */ int Draw(); + /* 80BBBE50 */ static int createHeapCallBack(fopAc_ac_c*); + /* 80BBBE70 */ static void tgHitCallBack(fopAc_ac_c*, dCcD_GObjInf*, fopAc_ac_c*, dCcD_GObjInf*); + /* 80BBBEA0 */ static void* srchArrow(void*, void*); /* 80BBBF4C */ void deleteStuckArrow(); - /* 80BBBFF8 */ void getResName(); + /* 80BBBFF8 */ char* getResName(); /* 80BBC008 */ void setSwayParam(fopAc_ac_c*); /* 80BBC19C */ void setEnvTevColor(); /* 80BBC1F8 */ void setRoomNo(); /* 80BBC23C */ void setMtx(); -private: - /* 0x568 */ u8 field_0x568[0xa40 - 0x568]; + u8 getType() { return 0; } + u8 getOffSwBit() { return (fopAcM_GetParam(this) & 0xff00) >> 8; } + u8 getOnSwBit() { return (fopAcM_GetParam(this) & 0xff0000) >> 16; } + void setCutType(u8 cutType) { mCutType = cutType; } }; STATIC_ASSERT(sizeof(daObj_BouMato_c) == 0xa40); class daObj_BouMato_Param_c { public: - /* 80BBC404 */ ~daObj_BouMato_Param_c(); + /* 80BBC404 */ virtual ~daObj_BouMato_Param_c() {} - static u8 const m[28]; + static f32 const m[7]; }; diff --git a/include/d/d_procname.h b/include/d/d_procname.h index 21c6600ce26..fe95a88b961 100644 --- a/include/d/d_procname.h +++ b/include/d/d_procname.h @@ -796,4 +796,4 @@ enum { PROC_GAMEOVER = 0x0317, }; -#endif /* D_PROCNAME_H */ \ No newline at end of file +#endif /* D_PROCNAME_H */ diff --git a/src/d/actor/d_a_obj_automata.cpp b/src/d/actor/d_a_obj_automata.cpp index ec27fb933b9..19fdf2cd7bc 100644 --- a/src/d/actor/d_a_obj_automata.cpp +++ b/src/d/actor/d_a_obj_automata.cpp @@ -50,7 +50,7 @@ static dCcD_SrcGObjInf const l_ccDObjData = {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt {dCcD_SE_STONE, 0x0, 0x0, 0x0, 0x0}, // mGObjTg {0x0}, // mGObjCo - }; +}; /* 80BA6CE0-80BA6D24 000030 0044+00 1/2 0/0 0/0 .data l_ccDCyl */ static dCcD_SrcCyl l_ccDCyl = { diff --git a/src/d/actor/d_a_obj_boumato.cpp b/src/d/actor/d_a_obj_boumato.cpp index 9b26da992fb..3f4ea6fed69 100644 --- a/src/d/actor/d_a_obj_boumato.cpp +++ b/src/d/actor/d_a_obj_boumato.cpp @@ -4,162 +4,31 @@ */ #include "d/actor/d_a_obj_boumato.h" -#include "d/d_cc_d.h" -#include "dol2asm.h" - - - -// -// Forward References: -// - -extern "C" void __dt__15daObj_BouMato_cFv(); -extern "C" void __dt__5csXyzFv(); -extern "C" void create__15daObj_BouMato_cFv(); -extern "C" void __ct__5csXyzFv(); -extern "C" void __dt__8cM3dGLinFv(); -extern "C" void __dt__8cM3dGCylFv(); -extern "C" void __dt__8cM3dGAabFv(); -extern "C" void __dt__12dBgS_AcchCirFv(); -extern "C" void __dt__10dCcD_GSttsFv(); -extern "C" void __dt__12dBgS_ObjAcchFv(); -extern "C" void CreateHeap__15daObj_BouMato_cFv(); -extern "C" void Delete__15daObj_BouMato_cFv(); -extern "C" void Execute__15daObj_BouMato_cFv(); -extern "C" void Draw__15daObj_BouMato_cFv(); -extern "C" void createHeapCallBack__15daObj_BouMato_cFP10fopAc_ac_c(); -extern "C" void -tgHitCallBack__15daObj_BouMato_cFP10fopAc_ac_cP12dCcD_GObjInfP10fopAc_ac_cP12dCcD_GObjInf(); -extern "C" void srchArrow__15daObj_BouMato_cFPvPv(); -extern "C" void deleteStuckArrow__15daObj_BouMato_cFv(); -extern "C" void getResName__15daObj_BouMato_cFv(); -extern "C" void setSwayParam__15daObj_BouMato_cFP10fopAc_ac_c(); -extern "C" void setEnvTevColor__15daObj_BouMato_cFv(); -extern "C" void setRoomNo__15daObj_BouMato_cFv(); -extern "C" void setMtx__15daObj_BouMato_cFv(); -extern "C" static void daObj_BouMato_Create__FPv(); -extern "C" static void daObj_BouMato_Delete__FPv(); -extern "C" static void daObj_BouMato_Execute__FPv(); -extern "C" static void daObj_BouMato_Draw__FPv(); -extern "C" static bool daObj_BouMato_IsDelete__FPv(); -extern "C" void __dt__10cCcD_GSttsFv(); -extern "C" void __sinit_d_a_obj_boumato_cpp(); -extern "C" void __dt__21daObj_BouMato_Param_cFv(); -extern "C" static void func_80BBC44C(); -extern "C" static void func_80BBC454(); -extern "C" u8 const m__21daObj_BouMato_Param_c[28]; -extern "C" extern char const* const d_a_obj_boumato__stringBase0; - -// -// External References: -// - -extern "C" void mDoMtx_XrotM__FPA4_fs(); -extern "C" void mDoMtx_YrotS__FPA4_fs(); -extern "C" void mDoMtx_ZrotM__FPA4_fs(); -extern "C" void scaleM__14mDoMtx_stack_cFRC4cXyz(); -extern "C" void ZXYrotM__14mDoMtx_stack_cFRC5csXyz(); -extern "C" void mDoExt_modelUpdateDL__FP8J3DModel(); -extern "C" void mDoExt_J3DModel__create__FP12J3DModelDataUlUl(); -extern "C" void __ct__10fopAc_ac_cFv(); -extern "C" void __dt__10fopAc_ac_cFv(); -extern "C" void fopAcIt_Judge__FPFPvPv_PvPv(); -extern "C" void fopAcM_delete__FP10fopAc_ac_c(); -extern "C" void fopAcM_entrySolidHeap__FP10fopAc_ac_cPFP10fopAc_ac_c_iUl(); -extern "C" void fopAcM_setCullSizeBox__FP10fopAc_ac_cffffff(); -extern "C" void fopAcM_posMoveF__FP10fopAc_ac_cPC4cXyz(); -extern "C" void fopAcM_searchActorAngleY__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fpcEx_IsExist__FUi(); -extern "C" void fpcSch_JudgeByID__FPvPv(); -extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfG_resDelete__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfGp_getReverb__Fi(); -extern "C" void -dComIfGd_setShadow__FUlScP8J3DModelP4cXyzffffR13cBgS_PolyInfoP12dKy_tevstr_csfP9_GXTexObj(); -extern "C" void onSwitch__10dSv_info_cFii(); -extern "C" void isSwitch__10dSv_info_cCFii(); -extern "C" void __ct__9dJntCol_cFv(); -extern "C" void init__9dJntCol_cFP10fopAc_ac_cPC13dJntColData_cP8J3DModeli(); -extern "C" void getRes__14dRes_control_cFPCclP11dRes_info_ci(); -extern "C" void reset__14dEvt_control_cFv(); -extern "C" void endCheck__16dEvent_manager_cFs(); -extern "C" void getMyStaffId__16dEvent_manager_cFPCcP10fopAc_ac_ci(); -extern "C" void cutEnd__16dEvent_manager_cFi(); -extern "C" void GetPolyColor__4dBgSFRC13cBgS_PolyInfo(); -extern "C" void GetRoomId__4dBgSFRC13cBgS_PolyInfo(); -extern "C" void __ct__12dBgS_AcchCirFv(); -extern "C" void __dt__9dBgS_AcchFv(); -extern "C" void __ct__9dBgS_AcchFv(); -extern "C" void Set__9dBgS_AcchFP4cXyzP4cXyzP10fopAc_ac_ciP12dBgS_AcchCirP4cXyzP5csXyzP5csXyz(); -extern "C" void CrrPos__9dBgS_AcchFR4dBgS(); -extern "C" void __ct__11dBgS_LinChkFv(); -extern "C" void __dt__11dBgS_LinChkFv(); -extern "C" void SetObj__16dBgS_PolyPassChkFv(); -extern "C" void GetAc__22dCcD_GAtTgCoCommonBaseFv(); -extern "C" void __ct__10dCcD_GSttsFv(); -extern "C" void Move__10dCcD_GSttsFv(); -extern "C" void Init__9dCcD_SttsFiiP10fopAc_ac_c(); -extern "C" void __ct__12dCcD_GObjInfFv(); -extern "C" void __dt__12dCcD_GObjInfFv(); -extern "C" void ChkTgHit__12dCcD_GObjInfFv(); -extern "C" void GetTgHitObj__12dCcD_GObjInfFv(); -extern "C" void Set__8dCcD_CylFRC11dCcD_SrcCyl(); -extern "C" void daNpcT_chkEvtBit__FUl(); -extern "C" void daNpcT_offTmpBit__FUl(); -extern "C" void daNpcT_chkTmpBit__FUl(); -extern "C" void settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c(); -extern "C" void setLightTevColorType_MAJI__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c(); -extern "C" void Set__4cCcSFP8cCcD_Obj(); -extern "C" void __ct__11cBgS_GndChkFv(); -extern "C" void __dt__11cBgS_GndChkFv(); -extern "C" void __dt__13cBgS_PolyInfoFv(); -extern "C" void __dt__8cM3dGCirFv(); -extern "C" void SetC__8cM3dGCylFRC4cXyz(); -extern "C" void SetH__8cM3dGCylFf(); -extern "C" void SetR__8cM3dGCylFf(); -extern "C" void cLib_addCalc2__FPffff(); -extern "C" void seStart__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc(); -extern "C" void __dl__FPv(); -extern "C" void __destroy_arr(); -extern "C" void __construct_array(); -extern "C" void _savegpr_25(); -extern "C" void _savegpr_28(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_25(); -extern "C" void _restgpr_28(); -extern "C" void _restgpr_29(); -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" u8 now__14mDoMtx_stack_c[48]; -extern "C" extern u8 g_dComIfG_gameInfo[122384]; -extern "C" u8 mSimpleTexObj__21dDlst_shadowControl_c[32]; -extern "C" u8 sincosTable___5JMath[65536]; -extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */]; -extern "C" void __register_global_object(); - -// -// Declarations: -// +#include "SSystem/SComponent/c_counter.h" +#include "d/actor/d_a_arrow.h" +#include "d/actor/d_a_npc.h" +#include "d/actor/d_a_player.h" +#include "d/d_com_inf_game.h" -/* ############################################################################################## */ -/* 80BBC518-80BBC518 0000A8 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80BBC518 = ""; -SECTION_DEAD static char const* const stringBase_80BBC519 = "H_BouMato"; -#pragma pop +static const char* dummyString() { return ""; } -/* 80BBC52C-80BBC570 000000 0044+00 2/2 0/0 0/0 .data l_ccDCyl */ -static dCcD_SrcCyl l_ccDCyl = { - { - {0x0, {{0x0, 0x0, 0x0}, {0x0, 0x0}, 0x0}}, // mObj +/* 80BBC470-80BBC48C 000000 001C+00 4/4 0/0 0/0 .rodata m__21daObj_BouMato_Param_c */ +f32 const daObj_BouMato_Param_c::m[7] = { + 0.0f, -3.0f, 1.0f, 400.0f, 300.0f, 4.0f, 20.0f, +}; + +/* 80BBC48C-80BBC4BC 00001C 0030+00 1/1 0/0 0/0 .rodata l_ccDObjData */ +static dCcD_SrcGObjInf const l_ccDObjData = +{ + {0x0, {{0x0, 0x0, 0}, {0xD8FBFDFF, 0x1F}, 0x79}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjTg + {dCcD_SE_STONE, 0x0, 0x0, 0x0, 0x0}, // mGObjTg {0x0}, // mGObjCo - }, // mObjInf +}; + +/* 80BBC52C-80BBC570 000000 0044+00 2/2 0/0 0/0 .data l_ccDCyl */ +static dCcD_SrcCyl l_ccDCyl = { + l_ccDObjData, // mObjInf { {0.0f, 0.0f, 0.0f}, // mCenter 0.0f, // mRadius @@ -168,485 +37,358 @@ static dCcD_SrcCyl l_ccDCyl = { }; /* 80BBC570-80BBC574 -00001 0004+00 1/1 0/0 0/0 .data l_resName */ -SECTION_DATA static void* l_resName = (void*)(((char*)&d_a_obj_boumato__stringBase0) + 0x1); +static char* l_resName = "H_BouMato"; /* 80BBC574-80BBC58C 000048 0018+00 1/0 0/0 0/0 .data jntCoOffset$4044 */ -SECTION_DATA static u8 jntCoOffset[24] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x43, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -/* 80BBC58C-80BBC598 -00001 000C+00 1/1 0/0 0/0 .data jntCoData$4045 */ -SECTION_DATA static void* jntCoData[3] = { - (void*)0x01010000, - (void*)0x40800000, - (void*)&jntCoOffset, -}; - -/* 80BBC598-80BBC5B8 -00001 0020+00 1/0 0/0 0/0 .data daObj_BouMato_MethodTable */ -static actor_method_class daObj_BouMato_MethodTable = { - (process_method_func)daObj_BouMato_Create__FPv, - (process_method_func)daObj_BouMato_Delete__FPv, - (process_method_func)daObj_BouMato_Execute__FPv, - (process_method_func)daObj_BouMato_IsDelete__FPv, - (process_method_func)daObj_BouMato_Draw__FPv, -}; - -/* 80BBC5B8-80BBC5E8 -00001 0030+00 0/0 0/0 1/0 .data g_profile_OBJ_BOUMATO */ -extern actor_process_profile_definition g_profile_OBJ_BOUMATO = { - fpcLy_CURRENT_e, // mLayerID - 7, // mListID - fpcPi_CURRENT_e, // mListPrio - PROC_OBJ_BOUMATO, // mProcName - &g_fpcLf_Method.base, // sub_method - sizeof(daObj_BouMato_c), // mSize - 0, // mSizeOther - 0, // mParameters - &g_fopAc_Method.base, // sub_method - 80, // mPriority - &daObj_BouMato_MethodTable, // sub_method - 0x00044100, // mStatus - fopAc_ACTOR_e, // mActorType - fopAc_CULLBOX_CUSTOM_e, // cullType -}; - -/* 80BBC5E8-80BBC60C 0000BC 0024+00 3/3 0/0 0/0 .data __vt__12dBgS_ObjAcch */ -SECTION_DATA extern void* __vt__12dBgS_ObjAcch[9] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12dBgS_ObjAcchFv, - (void*)NULL, - (void*)NULL, - (void*)func_80BBC454, - (void*)NULL, - (void*)NULL, - (void*)func_80BBC44C, -}; - -/* 80BBC60C-80BBC618 0000E0 000C+00 3/3 0/0 0/0 .data __vt__10cCcD_GStts */ -SECTION_DATA extern void* __vt__10cCcD_GStts[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__10cCcD_GSttsFv, -}; - -/* 80BBC618-80BBC624 0000EC 000C+00 2/2 0/0 0/0 .data __vt__10dCcD_GStts */ -SECTION_DATA extern void* __vt__10dCcD_GStts[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__10dCcD_GSttsFv, -}; - -/* 80BBC624-80BBC630 0000F8 000C+00 2/2 0/0 0/0 .data __vt__12dBgS_AcchCir */ -SECTION_DATA extern void* __vt__12dBgS_AcchCir[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12dBgS_AcchCirFv, +static Vec jntCoOffset[2] = { + {0.0f, 0.0f, 0.0f}, + {0.0f, 300.0f, 0.0f}, }; -/* 80BBC630-80BBC63C 000104 000C+00 3/3 0/0 0/0 .data __vt__8cM3dGAab */ -SECTION_DATA extern void* __vt__8cM3dGAab[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGAabFv, -}; - -/* 80BBC63C-80BBC648 000110 000C+00 3/3 0/0 0/0 .data __vt__8cM3dGCyl */ -SECTION_DATA extern void* __vt__8cM3dGCyl[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGCylFv, -}; - -/* 80BBC648-80BBC654 00011C 000C+00 3/3 0/0 0/0 .data __vt__8cM3dGLin */ -SECTION_DATA extern void* __vt__8cM3dGLin[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGLinFv, -}; - -/* 80BBC654-80BBC660 000128 000C+00 2/2 0/0 0/0 .data __vt__15daObj_BouMato_c */ -SECTION_DATA extern void* __vt__15daObj_BouMato_c[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__15daObj_BouMato_cFv, +// /* 80BBC58C-80BBC598 -00001 000C+00 1/1 0/0 0/0 .data jntCoData$4045 */ +static dJntColData_c jntCoData = { + 1, 1, 0, 4.0f, jntCoOffset, }; /* 80BBAFEC-80BBB1F4 0000EC 0208+00 1/0 0/0 0/0 .text __dt__15daObj_BouMato_cFv */ daObj_BouMato_c::~daObj_BouMato_c() { - // NONMATCHING -} - -/* 80BBB1F4-80BBB230 0002F4 003C+00 2/2 0/0 0/0 .text __dt__5csXyzFv */ -// csXyz::~csXyz() { -extern "C" void __dt__5csXyzFv() { - // NONMATCHING + OS_REPORT("|%06d:%x|daObj_BouMato_c -> デストラクト\n", g_Counter, this); + dComIfG_resDelete(&mPhase, getResName()); } -/* ############################################################################################## */ -/* 80BBC470-80BBC48C 000000 001C+00 4/4 0/0 0/0 .rodata m__21daObj_BouMato_Param_c */ -SECTION_RODATA u8 const daObj_BouMato_Param_c::m[28] = { - 0x00, 0x00, 0x00, 0x00, 0xC0, 0x40, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x43, 0xC8, - 0x00, 0x00, 0x43, 0x96, 0x00, 0x00, 0x40, 0x80, 0x00, 0x00, 0x41, 0xA0, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80BBC470, &daObj_BouMato_Param_c::m); - -/* 80BBC48C-80BBC4BC 00001C 0030+00 1/1 0/0 0/0 .rodata l_ccDObjData */ -SECTION_RODATA static u8 const l_ccDObjData[48] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xD8, 0xFB, 0xFD, 0xFF, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80BBC48C, &l_ccDObjData); - -/* 80BBC4BC-80BBC4C0 00004C 0004+00 0/1 0/0 0/0 .rodata @3956 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3956 = -300.0f; -COMPILER_STRIP_GATE(0x80BBC4BC, &lit_3956); -#pragma pop - -/* 80BBC4C0-80BBC4C4 000050 0004+00 0/1 0/0 0/0 .rodata @3957 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3957 = -50.0f; -COMPILER_STRIP_GATE(0x80BBC4C0, &lit_3957); -#pragma pop - -/* 80BBC4C4-80BBC4C8 000054 0004+00 0/1 0/0 0/0 .rodata @3958 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3958 = 300.0f; -COMPILER_STRIP_GATE(0x80BBC4C4, &lit_3958); -#pragma pop - -/* 80BBC4C8-80BBC4CC 000058 0004+00 0/1 0/0 0/0 .rodata @3959 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3959 = 450.0f; -COMPILER_STRIP_GATE(0x80BBC4C8, &lit_3959); -#pragma pop - /* 80BBB230-80BBB558 000330 0328+00 1/1 0/0 0/0 .text create__15daObj_BouMato_cFv */ -void daObj_BouMato_c::create() { - // NONMATCHING -} - -/* 80BBB558-80BBB55C 000658 0004+00 1/1 0/0 0/0 .text __ct__5csXyzFv */ -// csXyz::csXyz() { -extern "C" void __ct__5csXyzFv() { - /* empty function */ -} - -/* 80BBB55C-80BBB5A4 00065C 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGLinFv */ -// cM3dGLin::~cM3dGLin() { -extern "C" void __dt__8cM3dGLinFv() { - // NONMATCHING -} - -/* 80BBB5A4-80BBB5EC 0006A4 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGCylFv */ -// cM3dGCyl::~cM3dGCyl() { -extern "C" void __dt__8cM3dGCylFv() { - // NONMATCHING -} - -/* 80BBB5EC-80BBB634 0006EC 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGAabFv */ -// cM3dGAab::~cM3dGAab() { -extern "C" void __dt__8cM3dGAabFv() { - // NONMATCHING -} - -/* 80BBB634-80BBB6A4 000734 0070+00 1/0 0/0 0/0 .text __dt__12dBgS_AcchCirFv */ -// dBgS_AcchCir::~dBgS_AcchCir() { -extern "C" void __dt__12dBgS_AcchCirFv() { - // NONMATCHING -} - -/* 80BBB6A4-80BBB700 0007A4 005C+00 1/0 0/0 0/0 .text __dt__10dCcD_GSttsFv */ -// dCcD_GStts::~dCcD_GStts() { -extern "C" void __dt__10dCcD_GSttsFv() { - // NONMATCHING -} - -/* 80BBB700-80BBB770 000800 0070+00 3/2 0/0 0/0 .text __dt__12dBgS_ObjAcchFv */ -// dBgS_ObjAcch::~dBgS_ObjAcch() { -extern "C" void __dt__12dBgS_ObjAcchFv() { - // NONMATCHING +int daObj_BouMato_c::create() { + fopAcM_SetupActor(this, daObj_BouMato_c); + field_0xa32 = getType(); + int rv = dComIfG_resLoad(&mPhase, getResName()); + if (rv == cPhs_COMPLEATE_e) { + OS_REPORT("\t(%s:%d) onSWBit:%02x, offSWBit:%02x<%08x>\n", fopAcM_getProcNameString(this), getType(), getOnSwBit(), + getOffSwBit(), fopAcM_GetParam(this)); + OS_REPORT("\n"); + if (fopAcM_entrySolidHeap(this, createHeapCallBack, 0x810) == 0) { + return cPhs_ERROR_e; + } + mModel->getModelData(); + fopAcM_SetMtx(this, mModel->getBaseTRMtx()); + fopAcM_setCullSizeBox(this, -300.0f, -50.0f, -300.0f, 300.0f, 450.0f, 300.0f); + mAcch.Set(fopAcM_GetPosition_p(this), fopAcM_GetOldPosition_p(this), this, 1, + &mAcchCir, fopAcM_GetSpeed_p(this), fopAcM_GetAngle_p(this), fopAcM_GetShapeAngle_p(this)); + mAcch.CrrPos(dComIfG_Bgsp()); + mGndChk = mAcch.m_gnd; + mGroundH = mAcch.GetGroundH(); + setEnvTevColor(); + setRoomNo(); + mStts.Init(0xff, 0, this); + mCyl.Set(l_ccDCyl); + mCyl.SetStts(&mStts); + mCyl.SetTgHitCallback(tgHitCallBack); + daNpcT_offTmpBit(0x3c); + daNpcT_offTmpBit(0x3f); + daNpcT_offTmpBit(0x40); + daNpcT_offTmpBit(0x41); + daNpcT_offTmpBit(0x42); + mTargetId = -1; + Execute(); + } + return rv; } /* 80BBB770-80BBB800 000870 0090+00 1/1 0/0 0/0 .text CreateHeap__15daObj_BouMato_cFv */ -void daObj_BouMato_c::CreateHeap() { - // NONMATCHING +int daObj_BouMato_c::CreateHeap() { + J3DModelData* mdlData_p = (J3DModelData*)dComIfG_getObjectRes(getResName(), 4); + JUT_ASSERT(374, 0 != mdlData_p); + mModel = mDoExt_J3DModel__create(mdlData_p, 0x80000, 0x11000084); + if (mModel == NULL) { + return 0; + } + return mJntCol.init(this, &jntCoData, mModel, 1) ? 1 : 0; } /* 80BBB800-80BBB834 000900 0034+00 1/1 0/0 0/0 .text Delete__15daObj_BouMato_cFv */ -void daObj_BouMato_c::Delete() { - // NONMATCHING +int daObj_BouMato_c::Delete() { + OS_REPORT("|%06d:%x|daObj_BouMato_c -> Delete\n", g_Counter, this); + this->~daObj_BouMato_c(); + return 1; } -/* ############################################################################################## */ -/* 80BBC4CC-80BBC4D0 00005C 0004+00 0/3 0/0 0/0 .rodata @4241 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4241 = 1.0f; -COMPILER_STRIP_GATE(0x80BBC4CC, &lit_4241); -#pragma pop - -/* 80BBC4D0-80BBC4D4 000060 0004+00 0/1 0/0 0/0 .rodata @4242 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4242 = -1.0f; -COMPILER_STRIP_GATE(0x80BBC4D0, &lit_4242); -#pragma pop - -/* 80BBC4D4-80BBC4D8 000064 0004+00 0/2 0/0 0/0 .rodata @4243 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4243 = -1000000000.0f; -COMPILER_STRIP_GATE(0x80BBC4D4, &lit_4243); -#pragma pop - -/* 80BBC4D8-80BBC4DC 000068 0004+00 0/1 0/0 0/0 .rodata @4244 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4244[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x80BBC4D8, &lit_4244); -#pragma pop - -/* 80BBC4DC-80BBC4E0 00006C 0004+00 0/1 0/0 0/0 .rodata @4245 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4245 = 3.0f / 40.0f; -COMPILER_STRIP_GATE(0x80BBC4DC, &lit_4245); -#pragma pop - -/* 80BBC4E0-80BBC4E4 000070 0004+00 0/1 0/0 0/0 .rodata @4246 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4246 = 50.0f; -COMPILER_STRIP_GATE(0x80BBC4E0, &lit_4246); -#pragma pop - -/* 80BBC4E4-80BBC4E8 000074 0004+00 0/1 0/0 0/0 .rodata @4247 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4247 = 1.0f / 10.0f; -COMPILER_STRIP_GATE(0x80BBC4E4, &lit_4247); -#pragma pop - -/* 80BBC4E8-80BBC4EC 000078 0004+00 0/1 0/0 0/0 .rodata @4248 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4248 = 100.0f; -COMPILER_STRIP_GATE(0x80BBC4E8, &lit_4248); -#pragma pop - -/* 80BBC4EC-80BBC4F0 00007C 0004+00 0/1 0/0 0/0 .rodata @4249 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4249 = 0.125f; -COMPILER_STRIP_GATE(0x80BBC4EC, &lit_4249); -#pragma pop - -/* 80BBC4F0-80BBC4F4 000080 0004+00 0/1 0/0 0/0 .rodata @4250 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4250 = 125.0f; -COMPILER_STRIP_GATE(0x80BBC4F0, &lit_4250); -#pragma pop - -/* 80BBC518-80BBC518 0000A8 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80BBC523 = "BouMato"; -#pragma pop - /* 80BBB834-80BBBD80 000934 054C+00 2/2 0/0 0/0 .text Execute__15daObj_BouMato_cFv */ -void daObj_BouMato_c::Execute() { - // NONMATCHING +int daObj_BouMato_c::Execute() { + cXyz cStack_34; + cXyz local_40; + mStts.Move(); + + u8 dVar1 = field_0xa38; + field_0xa38 = 1; + if (getOnSwBit() == 0xff || (getOnSwBit() != 0xff && dComIfGs_isSwitch(getOnSwBit(), fopAcM_GetRoomNo(this)))) { + if (daNpcT_chkTmpBit(0x3c) || (daNpcT_chkEvtBit(0x4b) && daNpcT_chkEvtBit(0x4c))) { + field_0xa38 = 0; + } + } + attention_info.flags = 0; + if (field_0xa38 == 1 && dVar1 == 0) { + deleteStuckArrow(); + } + dComIfG_play_c& play = g_dComIfG_gameInfo.play; + if (play.getEvent().runCheck() && !eventInfo.checkCommandTalk()) { + if (eventInfo.checkCommandDemoAccrpt() && dComIfGp_getEventManager().endCheck(field_0xa30)) { + play.getEvent().reset(); + field_0xa30 = -1; + } else { + int staffId = dComIfGp_getEventManager().getMyStaffId("BouMato", this, -1); + if (staffId != -1) { + dComIfGp_getEventManager().cutEnd(staffId); + } + } + } + if (field_0xa10 != 0) { + field_0xa10--; + } + if (field_0xa10 == 0 && mCyl.ChkTgHit()) { + if (mCyl.GetTgHitObj()->ChkAtType(AT_TYPE_ARROW)) { + mTargetId = fopAcM_GetID(mCyl.GetTgHitAc()); + if (getOffSwBit() != 0xff) { + if (!dComIfGs_isSwitch(getOffSwBit(), fopAcM_GetRoomNo(this))) { + dComIfGs_onSwitch(getOffSwBit(), fopAcM_GetRoomNo(this)); + } + } + fopAcM_seStartCurrent(this, Z2SE_OBJ_ARW_TRGT_BRK_LAST, 0); + } + setSwayParam(mCyl.GetTgHitAc()); + } + fopAcM_posMoveF(this, mStts.GetCCMoveP()); + mAcch.CrrPos(dComIfG_Bgsp()); + mGndChk = mAcch.m_gnd; + mGroundH = mAcch.GetGroundH(); + if (mGroundH != -1e9f) { + setEnvTevColor(); + setRoomNo(); + } + for (int i = 0; i < 3; i++) { + if (mIsCurTurnRight) { + mDoMtx_stack_c::YrotS(field_0xa24[i]); + cStack_34.set(0.0f, 0.0f, field_0xa18[i]); + mDoMtx_stack_c::multVec(&cStack_34, &local_40); + field_0x9f8[i].x = local_40.z; + field_0x9f8[i].z = -local_40.x; + field_0xa24[i] -= cM_deg2s(45.0f); + } else { + mDoMtx_stack_c::YrotS(field_0xa2a); + cStack_34.set(0.0f, 0.0f, + field_0xa18[i] * cM_ssin(field_0xa24[i])); + mDoMtx_stack_c::multVec((Vec*)&cStack_34, (Vec*)&local_40); + field_0x9f8[i].x = local_40.z; + field_0x9f8[i].z = -local_40.x; + field_0xa24[i] += cM_deg2s(45.0f); + } + } + cLib_addCalc2(field_0xa18, 0, 0.075f, 50.0f); + cLib_addCalc2(field_0xa18 + 1, 0, 0.1f, 100.0f); + cLib_addCalc2(field_0xa18 + 2, 0, 0.125f, 125.0f); + setMtx(); + attention_info.position = current.pos; + attention_info.position.y += daObj_BouMato_Param_c::m[0]; + eyePos = attention_info.position; + if (field_0xa38 == 0) { + mCyl.SetC(current.pos); + mCyl.SetH(daObj_BouMato_Param_c::m[4]); + mCyl.SetR(daObj_BouMato_Param_c::m[5]); + dComIfG_Ccsp()->Set(&mCyl); + } + mCyl.ClrTgHit(); + return 1; } -/* ############################################################################################## */ -/* 80BBC4F4-80BBC4F8 000084 0004+00 0/1 0/0 0/0 .rodata @4266 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4266 = 20.0f; -COMPILER_STRIP_GATE(0x80BBC4F4, &lit_4266); -#pragma pop - /* 80BBBD80-80BBBE50 000E80 00D0+00 1/1 0/0 0/0 .text Draw__15daObj_BouMato_cFv */ -void daObj_BouMato_c::Draw() { - // NONMATCHING +int daObj_BouMato_c::Draw() { + if (field_0xa38 == 0) { + g_env_light.settingTevStruct(0, ¤t.pos, &tevStr); + g_env_light.setLightTevColorType_MAJI(mModel, &tevStr); + mDoExt_modelUpdateDL(mModel); + if (mGroundH != -1e9f) { + mShadowId = + dComIfGd_setShadow(mShadowId, 1, mModel, ¤t.pos, daObj_BouMato_Param_c::m[3], + 20.0f, current.pos.y, mGroundH, mGndChk, &tevStr, 0, 1.0f, + dDlst_shadowControl_c::getSimpleTex()); + } + } + return 1; } /* 80BBBE50-80BBBE70 000F50 0020+00 1/1 0/0 0/0 .text * createHeapCallBack__15daObj_BouMato_cFP10fopAc_ac_c */ -void daObj_BouMato_c::createHeapCallBack(fopAc_ac_c* param_0) { - // NONMATCHING +int daObj_BouMato_c::createHeapCallBack(fopAc_ac_c* i_this) { + return static_cast(i_this)->CreateHeap(); } /* 80BBBE70-80BBBEA0 000F70 0030+00 1/1 0/0 0/0 .text * tgHitCallBack__15daObj_BouMato_cFP10fopAc_ac_cP12dCcD_GObjInfP10fopAc_ac_cP12dCcD_GObjInf */ -void daObj_BouMato_c::tgHitCallBack(fopAc_ac_c* param_0, dCcD_GObjInf* param_1, - fopAc_ac_c* param_2, dCcD_GObjInf* param_3) { - // NONMATCHING +void daObj_BouMato_c::tgHitCallBack(fopAc_ac_c* param_1, dCcD_GObjInf* param_2, + fopAc_ac_c* param_3, dCcD_GObjInf* param_4) { + u8 cutType = 0; + if (param_3 != NULL) { + if (fopAcM_GetProfName(param_3) == PROC_ALINK) { + cutType = static_cast(param_3)->getCutType(); + } else { + cutType = daPy_py_c::CUT_TYPE_NM_VERTICAL; + } + } + static_cast(param_1)->setCutType(cutType); } /* ############################################################################################## */ /* 80BBC678-80BBC808 000008 0190+00 2/2 0/0 0/0 .bss l_findActorPtrs */ -static u8 l_findActorPtrs[400]; +static daArrow_c* l_findActorPtrs[100]; /* 80BBC808-80BBC80C 000198 0004+00 2/2 0/0 0/0 .bss l_findCount */ -static u8 l_findCount[4]; +static u32 l_findCount; /* 80BBBEA0-80BBBF4C 000FA0 00AC+00 1/1 0/0 0/0 .text srchArrow__15daObj_BouMato_cFPvPv */ -void daObj_BouMato_c::srchArrow(void* param_0, void* param_1) { - // NONMATCHING +void* daObj_BouMato_c::srchArrow(void* param_1, void* param_2) { + if (l_findCount < 100 && param_1 != NULL && param_1 != param_2) { + if (fopAcM_IsExecuting(fopAcM_GetID(param_1)) && fopAcM_GetName(param_1) == PROC_ARROW && + static_cast(param_1)->getHitAcID() != -1) + { + l_findActorPtrs[l_findCount] = (daArrow_c*)param_1; + l_findCount++; + } + } + return NULL; } /* 80BBBF4C-80BBBFF8 00104C 00AC+00 1/1 0/0 0/0 .text deleteStuckArrow__15daObj_BouMato_cFv */ void daObj_BouMato_c::deleteStuckArrow() { - // NONMATCHING + l_findCount = 0; + fopAcM_Search(srchArrow, this); + for (int i = 0; i < (int)l_findCount; i++) { + daArrow_c* pArrow = l_findActorPtrs[i]; + if (this == fopAcM_SearchByID(pArrow->getHitAcID())) { + fopAcM_delete(pArrow); + } + } } /* 80BBBFF8-80BBC008 0010F8 0010+00 3/3 0/0 0/0 .text getResName__15daObj_BouMato_cFv */ -void daObj_BouMato_c::getResName() { - // NONMATCHING +char* daObj_BouMato_c::getResName() { + return l_resName; } -/* ############################################################################################## */ -/* 80BBC4F8-80BBC504 000088 000C+00 0/1 0/0 0/0 .rodata @4327 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4327[12] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80BBC4F8, &lit_4327); -#pragma pop - -/* 80BBC504-80BBC508 000094 0004+00 0/1 0/0 0/0 .rodata @4355 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4355 = 3.0f / 5.0f; -COMPILER_STRIP_GATE(0x80BBC504, &lit_4355); -#pragma pop - -/* 80BBC508-80BBC510 000098 0004+04 0/1 0/0 0/0 .rodata @4356 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_4356[1 + 1 /* padding */] = { - 0x43360B61, - /* padding */ - 0x00000000, -}; -COMPILER_STRIP_GATE(0x80BBC508, &lit_4356); -#pragma pop - -/* 80BBC510-80BBC518 0000A0 0008+00 0/1 0/0 0/0 .rodata @4359 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4359[8] = { - 0x43, 0x30, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80BBC510, &lit_4359); -#pragma pop - /* 80BBC008-80BBC19C 001108 0194+00 1/1 0/0 0/0 .text * setSwayParam__15daObj_BouMato_cFP10fopAc_ac_c */ -void daObj_BouMato_c::setSwayParam(fopAc_ac_c* param_0) { - // NONMATCHING +void daObj_BouMato_c::setSwayParam(fopAc_ac_c* param_1) { + f32 dVar7 = 1.0f; + f32 local_48[3] = {0.0f, 0.0f, daObj_BouMato_Param_c::m[6]};; + field_0xa2a = (fopAcM_searchActorAngleY(this, param_1) - shape_angle.y) + 0x8000; + field_0xa10 = 8; + mIsCurTurnRight = false; + if (fopAcM_GetProfName(param_1) == PROC_ALINK) { + switch (mCutType) { + case daPy_py_c::CUT_TYPE_NM_RIGHT: + case daPy_py_c::CUT_TYPE_NM_LEFT: + case daPy_py_c::CUT_TYPE_FINISH_LEFT: + case daPy_py_c::CUT_TYPE_FINISH_VERTICAL: + if (mCutType == daPy_py_c::CUT_TYPE_NM_RIGHT) { + field_0xa2a -= 0x4000; + } + if (mCutType == daPy_py_c::CUT_TYPE_NM_LEFT) { + field_0xa2a += 0x4000; + } + dVar7 = 0.6f; + break; + case daPy_py_c::CUT_TYPE_TURN_RIGHT: + field_0xa10 = 20; + mIsCurTurnRight = true; + break; + default: + dVar7 = 0.6f; + break; + } + } else { + dVar7 = 0.6f; + } + for (int i = 0; i < 3; i++) { + field_0xa18[i] = dVar7 * cM_deg2s(local_48[i]); + field_0xa24[i] = 0x4000; + } } /* 80BBC19C-80BBC1F8 00129C 005C+00 2/2 0/0 0/0 .text setEnvTevColor__15daObj_BouMato_cFv */ void daObj_BouMato_c::setEnvTevColor() { - // NONMATCHING + tevStr.mEnvrIdxOverride = dComIfG_Bgsp().GetPolyColor(mGndChk); + tevStr.mRoomNo = dComIfG_Bgsp().GetRoomId(mGndChk); } /* 80BBC1F8-80BBC23C 0012F8 0044+00 2/2 0/0 0/0 .text setRoomNo__15daObj_BouMato_cFv */ void daObj_BouMato_c::setRoomNo() { - // NONMATCHING + s32 roomId = dComIfG_Bgsp().GetRoomId(mGndChk); + fopAcM_SetRoomNo(this, roomId); + mStts.SetRoomId(roomId); } /* 80BBC23C-80BBC2C0 00133C 0084+00 1/1 0/0 0/0 .text setMtx__15daObj_BouMato_cFv */ void daObj_BouMato_c::setMtx() { - // NONMATCHING + mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); + mDoMtx_stack_c::ZXYrotM(shape_angle); + mDoMtx_stack_c::XrotM(field_0x9f8[2].x); + mDoMtx_stack_c::ZrotM(field_0x9f8[2].z); + mDoMtx_stack_c::scaleM(scale); + mModel->setBaseTRMtx(mDoMtx_stack_c::get()); } /* 80BBC2C0-80BBC2E0 0013C0 0020+00 1/0 0/0 0/0 .text daObj_BouMato_Create__FPv */ -static void daObj_BouMato_Create(void* param_0) { - // NONMATCHING +static int daObj_BouMato_Create(void* i_this) { + return static_cast(i_this)->create(); } /* 80BBC2E0-80BBC300 0013E0 0020+00 1/0 0/0 0/0 .text daObj_BouMato_Delete__FPv */ -static void daObj_BouMato_Delete(void* param_0) { - // NONMATCHING +static int daObj_BouMato_Delete(void* i_this) { + return static_cast(i_this)->Delete(); } /* 80BBC300-80BBC320 001400 0020+00 1/0 0/0 0/0 .text daObj_BouMato_Execute__FPv */ -static void daObj_BouMato_Execute(void* param_0) { - // NONMATCHING +static int daObj_BouMato_Execute(void* i_this) { + return static_cast(i_this)->Execute(); } /* 80BBC320-80BBC340 001420 0020+00 1/0 0/0 0/0 .text daObj_BouMato_Draw__FPv */ -static void daObj_BouMato_Draw(void* param_0) { - // NONMATCHING +static int daObj_BouMato_Draw(void* i_this) { + return static_cast(i_this)->Draw(); } /* 80BBC340-80BBC348 001440 0008+00 1/0 0/0 0/0 .text daObj_BouMato_IsDelete__FPv */ -static bool daObj_BouMato_IsDelete(void* param_0) { - return true; +static int daObj_BouMato_IsDelete(void* i_this) { + return 1; } -/* 80BBC348-80BBC390 001448 0048+00 1/0 0/0 0/0 .text __dt__10cCcD_GSttsFv */ -// cCcD_GStts::~cCcD_GStts() { -extern "C" void __dt__10cCcD_GSttsFv() { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80BBC660-80BBC66C 000134 000C+00 2/2 0/0 0/0 .data __vt__21daObj_BouMato_Param_c */ -SECTION_DATA extern void* __vt__21daObj_BouMato_Param_c[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__21daObj_BouMato_Param_cFv, -}; - -/* 80BBC80C-80BBC818 00019C 000C+00 1/1 0/0 0/0 .bss @3830 */ -static u8 lit_3830[12]; - /* 80BBC818-80BBC81C 0001A8 0004+00 1/1 0/0 0/0 .bss l_HIO */ -static u8 l_HIO[4]; - -/* 80BBC390-80BBC404 001490 0074+00 0/0 1/0 0/0 .text __sinit_d_a_obj_boumato_cpp */ -void __sinit_d_a_obj_boumato_cpp() { - // NONMATCHING -} +static daObj_BouMato_Param_c l_HIO; -#pragma push -#pragma force_active on -REGISTER_CTORS(0x80BBC390, __sinit_d_a_obj_boumato_cpp); -#pragma pop - -/* 80BBC404-80BBC44C 001504 0048+00 2/1 0/0 0/0 .text __dt__21daObj_BouMato_Param_cFv */ -daObj_BouMato_Param_c::~daObj_BouMato_Param_c() { - // NONMATCHING -} - -/* 80BBC44C-80BBC454 00154C 0008+00 1/0 0/0 0/0 .text @36@__dt__12dBgS_ObjAcchFv */ -static void func_80BBC44C() { - // NONMATCHING -} +/* 80BBC598-80BBC5B8 -00001 0020+00 1/0 0/0 0/0 .data daObj_BouMato_MethodTable */ +static actor_method_class daObj_BouMato_MethodTable = { + (process_method_func)daObj_BouMato_Create, + (process_method_func)daObj_BouMato_Delete, + (process_method_func)daObj_BouMato_Execute, + (process_method_func)daObj_BouMato_IsDelete, + (process_method_func)daObj_BouMato_Draw, +}; -/* 80BBC454-80BBC45C 001554 0008+00 1/0 0/0 0/0 .text @20@__dt__12dBgS_ObjAcchFv */ -static void func_80BBC454() { - // NONMATCHING -} +/* 80BBC5B8-80BBC5E8 -00001 0030+00 0/0 0/0 1/0 .data g_profile_OBJ_BOUMATO */ +extern actor_process_profile_definition g_profile_OBJ_BOUMATO = { + fpcLy_CURRENT_e, // mLayerID + 7, // mListID + fpcPi_CURRENT_e, // mListPrio + PROC_OBJ_BOUMATO, // mProcName + &g_fpcLf_Method.base, // sub_method + sizeof(daObj_BouMato_c), // mSize + 0, // mSizeOther + 0, // mParameters + &g_fopAc_Method.base, // sub_method + 80, // mPriority + &daObj_BouMato_MethodTable, // sub_method + 0x00044100, // mStatus + fopAc_ACTOR_e, // mActorType + fopAc_CULLBOX_CUSTOM_e, // cullType +}; /* 80BBC518-80BBC518 0000A8 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ From 82c6512c939099912af4fca21f03b78fd158bf6c Mon Sep 17 00:00:00 2001 From: Tal Hayon Date: Thu, 12 Dec 2024 11:07:58 +0200 Subject: [PATCH 2/3] daObjGraRock_c Matched except template function order --- configure.py | 2 +- include/d/actor/d_a_npc.h | 1 + include/d/actor/d_a_obj_gra_rock.h | 42 +- include/f_op/f_op_actor_mng.h | 8 + include/m_Do/m_Do_ext.h | 1 + src/d/actor/d_a_obj_gra_rock.cpp | 668 +++++++++++------------------ 6 files changed, 298 insertions(+), 424 deletions(-) diff --git a/configure.py b/configure.py index 5e400ba3a38..14670ff50e6 100644 --- a/configure.py +++ b/configure.py @@ -1830,7 +1830,7 @@ def MatchingFor(*versions): ActorRel(NonMatching, "d_a_obj_gomikabe"), ActorRel(NonMatching, "d_a_obj_gra2"), ActorRel(Matching, "d_a_obj_graWall"), - ActorRel(NonMatching, "d_a_obj_gra_rock"), + ActorRel(Equivalent, "d_a_obj_gra_rock"), ActorRel(Matching, "d_a_obj_grave_stone"), ActorRel(Matching, "d_a_obj_groundwater"), ActorRel(NonMatching, "d_a_obj_grz_rock"), diff --git a/include/d/actor/d_a_npc.h b/include/d/actor/d_a_npc.h index 7825a2a1f64..631beb377a2 100644 --- a/include/d/actor/d_a_npc.h +++ b/include/d/actor/d_a_npc.h @@ -1006,6 +1006,7 @@ BOOL daNpcF_chkEvtBit(u32 i_idx); void daNpcF_onEvtBit(u32 i_idx); BOOL daNpcF_chkTmpBit(u32 i_idx); void daNpcF_offTmpBit(u32 i_idx); +u8 daNpcF_getDistTableIdx(int param_0, int param_1); BOOL daNpcF_chkPointInArea(cXyz, cXyz, cXyz, s16); int daNpcF_getPlayerInfoFromPlayerList(int param_0, int i_roomNo, cXyz& param_2, csXyz& param_3); s16 daNpcF_getGroundAngle(cBgS_PolyInfo*, s16); diff --git a/include/d/actor/d_a_obj_gra_rock.h b/include/d/actor/d_a_obj_gra_rock.h index a2b9cebc3af..4283b092389 100644 --- a/include/d/actor/d_a_obj_gra_rock.h +++ b/include/d/actor/d_a_obj_gra_rock.h @@ -1,6 +1,8 @@ #ifndef D_A_OBJ_GRA_ROCK_H #define D_A_OBJ_GRA_ROCK_H +#include "d/d_bg_s_acch.h" +#include "d/d_bg_s_movebg_actor.h" #include "f_op/f_op_actor_mng.h" #include "d/d_cc_d.h" @@ -12,7 +14,7 @@ * @details * */ -class daObjGraRock_c : public fopAc_ac_c { +class daObjGraRock_c : public dBgS_MoveBgActor { public: /* 80C110F8 */ void setAttnPos(); /* 80C11444 */ void setBaseMtx(); @@ -21,21 +23,39 @@ class daObjGraRock_c : public fopAc_ac_c { /* 80C11730 */ void setEnvTevColor(); /* 80C1178C */ void setRoomNo(); /* 80C117D0 */ void col_set(); - /* 80C11964 */ void checkHitAt(cCcD_Obj*); - /* 80C11970 */ void Create(); - /* 80C11B68 */ void CreateHeap(); - /* 80C11C64 */ void create(); - /* 80C11FF0 */ void Execute(f32 (**)[3][4]); - /* 80C120FC */ void Draw(); - /* 80C121C4 */ void Delete(); + /* 80C11964 */ int checkHitAt(cCcD_Obj*); + /* 80C11970 */ int Create(); + /* 80C11B68 */ int CreateHeap(); + /* 80C11C64 */ int create(); + /* 80C11FF0 */ int Execute(Mtx**); + /* 80C120FC */ int Draw(); + /* 80C121C4 */ int Delete(); - static u8 const mCcDCyl[68]; + static dCcD_SrcCyl const mCcDCyl; private: - /* 0x568 */ u8 field_0x568[0x9cc - 0x568]; + /* 0x5A0 */ request_of_phase_process_class mPhases[5]; + /* 0x5C8 */ J3DModel* mModel; + /* 0x5CC */ mDoExt_btpAnm mBtp; + /* 0x5E4 */ dBgS_ObjAcch mAcch; + /* 0x7BC */ dCcD_Stts mStts; + /* 0x7F8 */ dBgS_AcchCir mAcchCir; + /* 0x838 */ dCcD_Cyl mCyl; + /* 0x974 */ cBgS_GndChk mGndChk; + /* 0x9B0 */ s16 field_0x9b0; + /* 0x9B2 */ s16 field_0x9b2; + /* 0x9B4 */ s16 field_0x9b4; + /* 0x9B6 */ s16 field_0x9b6; + /* 0x9B8 */ s16 field_0x9b8; + /* 0x9BA */ s16 field_0x9ba; + /* 0x9BC */ u8 field_0x9bc; + /* 0x9BD */ u8 field_0x9bd; + /* 0x9BD */ s16 field_0x9be; + /* 0x9C0 */ u32 mParticleIds[2]; + /* 0x9BD */ u8 field_0x9c8; }; -STATIC_ASSERT(sizeof(daObjGraRock_c) == 0x9cc); +//STATIC_ASSERT(sizeof(daObjGraRock_c) == 0x9cc); #endif /* D_A_OBJ_GRA_ROCK_H */ diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h index c17a35b6670..096fc441c50 100644 --- a/include/f_op/f_op_actor_mng.h +++ b/include/f_op/f_op_actor_mng.h @@ -396,6 +396,14 @@ inline f32 fopAcM_getCullSizeFar(const fopAc_ac_c* i_actor) { return i_actor->cullSizeFar; } +inline const Vec* fopAcM_getCullSizeBoxMin(const fopAc_ac_c* i_actor) { + return &i_actor->cull.box.min; +} + +inline const Vec* fopAcM_getCullSizeBoxMax(const fopAc_ac_c* i_actor) { + return &i_actor->cull.box.max; +} + inline void fopAcM_SetCullSize(fopAc_ac_c* i_actor, s8 i_cullsize) { i_actor->cullType = i_cullsize; } diff --git a/include/m_Do/m_Do_ext.h b/include/m_Do/m_Do_ext.h index 0d557415a7e..1e0cc7f4e32 100644 --- a/include/m_Do/m_Do_ext.h +++ b/include/m_Do/m_Do_ext.h @@ -33,6 +33,7 @@ class mDoExt_baseAnm { void setPlayMode(int i_mode) { mFrameCtrl.setAttribute(i_mode); } void setLoopFrame(f32 i_frame) { mFrameCtrl.setLoop(i_frame); } bool isStop() { return mFrameCtrl.checkState(1) || mFrameCtrl.getRate() == 0.0f; } + bool isLoop() { return mFrameCtrl.checkState(2); } void reset() { mFrameCtrl.reset(); } BOOL checkFrame(f32 frame) { return mFrameCtrl.checkPass(frame); } diff --git a/src/d/actor/d_a_obj_gra_rock.cpp b/src/d/actor/d_a_obj_gra_rock.cpp index b52d2fb15bf..e13fe09261e 100644 --- a/src/d/actor/d_a_obj_gra_rock.cpp +++ b/src/d/actor/d_a_obj_gra_rock.cpp @@ -4,496 +4,340 @@ */ #include "d/actor/d_a_obj_gra_rock.h" -#include "dol2asm.h" +#include "d/actor/d_a_npc.h" +#include "d/d_bg_w.h" - -// -// Forward References: -// - -extern "C" void setAttnPos__14daObjGraRock_cFv(); -extern "C" void setBaseMtx__14daObjGraRock_cFv(); -extern "C" void setPrtcl__14daObjGraRock_cFv(); -extern "C" void bombParticleSet__14daObjGraRock_cFv(); -extern "C" void setEnvTevColor__14daObjGraRock_cFv(); -extern "C" void setRoomNo__14daObjGraRock_cFv(); -extern "C" void col_set__14daObjGraRock_cFv(); -extern "C" void checkHitAt__14daObjGraRock_cFP8cCcD_Obj(); -extern "C" void Create__14daObjGraRock_cFv(); -extern "C" void CreateHeap__14daObjGraRock_cFv(); -extern "C" void create__14daObjGraRock_cFv(); -extern "C" void __dt__8cM3dGCylFv(); -extern "C" void __dt__8cM3dGAabFv(); -extern "C" void __dt__12dBgS_ObjAcchFv(); -extern "C" void __dt__12J3DFrameCtrlFv(); -extern "C" void Execute__14daObjGraRock_cFPPA3_A4_f(); -extern "C" void Draw__14daObjGraRock_cFv(); -extern "C" void Delete__14daObjGraRock_cFv(); -extern "C" static void daObjGraRock_Draw__FP14daObjGraRock_c(); -extern "C" static void daObjGraRock_Execute__FP14daObjGraRock_c(); -extern "C" static bool daObjGraRock_IsDelete__FP14daObjGraRock_c(); -extern "C" static void daObjGraRock_Delete__FP14daObjGraRock_c(); -extern "C" static void daObjGraRock_create__FP10fopAc_ac_c(); -extern "C" void func_80C122F0(void* _this, s16*); -extern "C" void func_80C1230C(void* _this, u8*); -extern "C" void func_80C12328(void* _this, int, int); -extern "C" static void func_80C123A4(); -extern "C" static void func_80C123AC(); -extern "C" u8 const mCcDCyl__14daObjGraRock_c[68]; -extern "C" extern char const* const d_a_obj_gra_rock__stringBase0; - -// -// External References: -// - -extern "C" void mDoMtx_ZXYrotS__FPA4_fsss(); -extern "C" void mDoMtx_ZXYrotM__FPA4_fsss(); -extern "C" void play__14mDoExt_baseAnmFv(); -extern "C" void init__13mDoExt_btpAnmFP16J3DMaterialTableP16J3DAnmTexPatterniifss(); -extern "C" void entry__13mDoExt_btpAnmFP16J3DMaterialTables(); -extern "C" void mDoExt_modelUpdateDL__FP8J3DModel(); -extern "C" void mDoExt_J3DModel__create__FP12J3DModelDataUlUl(); -extern "C" void fopAcM_delete__FP10fopAc_ac_c(); -extern "C" void fopAcM_create__FsUlPC4cXyziPC5csXyzPC4cXyzSc(); -extern "C" void fopAcM_setCullSizeBox__FP10fopAc_ac_cffffff(); -extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfG_resDelete__FP30request_of_phase_process_classPCc(); -extern "C" void onSwitch__10dSv_info_cFii(); -extern "C" void getRes__14dRes_control_cFPCcPCcP11dRes_info_ci(); -extern "C" void getObjectResName2Index__14dRes_control_cFPCcPCc(); -extern "C" void -set__13dPa_control_cFUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf(); -extern "C" void -set__13dPa_control_cFUlUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf(); -extern "C" void LockonTarget__12dAttention_cFl(); -extern "C" void LockonTruth__12dAttention_cFv(); -extern "C" void Release__4cBgSFP9dBgW_Base(); -extern "C" void GetPolyColor__4dBgSFRC13cBgS_PolyInfo(); -extern "C" void GetRoomId__4dBgSFRC13cBgS_PolyInfo(); -extern "C" void dBgS_MoveBGProc_TypicalRotY__FP4dBgWPvRC13cBgS_PolyInfobP4cXyzP5csXyzP5csXyz(); -extern "C" void __ct__12dBgS_AcchCirFv(); -extern "C" void SetWall__12dBgS_AcchCirFff(); -extern "C" void __dt__9dBgS_AcchFv(); -extern "C" void __ct__9dBgS_AcchFv(); -extern "C" void Set__9dBgS_AcchFP4cXyzP4cXyzP10fopAc_ac_ciP12dBgS_AcchCirP4cXyzP5csXyzP5csXyz(); -extern "C" void CrrPos__9dBgS_AcchFR4dBgS(); -extern "C" void __ct__16dBgS_MoveBgActorFv(); -extern "C" bool IsDelete__16dBgS_MoveBgActorFv(); -extern "C" bool ToFore__16dBgS_MoveBgActorFv(); -extern "C" bool ToBack__16dBgS_MoveBgActorFv(); -extern "C" void -MoveBGCreate__16dBgS_MoveBgActorFPCciPFP4dBgWPvRC13cBgS_PolyInfobP4cXyzP5csXyzP5csXyz_vUlPA3_A4_f(); -extern "C" void MoveBGDelete__16dBgS_MoveBgActorFv(); -extern "C" void MoveBGExecute__16dBgS_MoveBgActorFv(); -extern "C" void SetObj__16dBgS_PolyPassChkFv(); -extern "C" void __ct__10dCcD_GSttsFv(); -extern "C" void Init__9dCcD_SttsFiiP10fopAc_ac_c(); -extern "C" void __ct__12dCcD_GObjInfFv(); -extern "C" void ChkTgHit__12dCcD_GObjInfFv(); -extern "C" void GetTgHitObj__12dCcD_GObjInfFv(); -extern "C" void Set__8dCcD_CylFRC11dCcD_SrcCyl(); -extern "C" void daNpcF_chkEvtBit__FUl(); -extern "C" void daNpcF_onEvtBit__FUl(); -extern "C" void daNpcF_getDistTableIdx__Fii(); -extern "C" void settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c(); -extern "C" void setLightTevColorType_MAJI__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c(); -extern "C" void Set__4cCcSFP8cCcD_Obj(); -extern "C" void cM_rndF__Ff(); -extern "C" void __ct__11cBgS_GndChkFv(); -extern "C" void ChkUsed__9cBgW_BgIdCFv(); -extern "C" void SetC__8cM3dGCylFRC4cXyz(); -extern "C" void SetH__8cM3dGCylFf(); -extern "C" void SetR__8cM3dGCylFf(); -extern "C" void seStart__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc(); -extern "C" void __dl__FPv(); -extern "C" void init__12J3DFrameCtrlFs(); -extern "C" void _savegpr_24(); -extern "C" void _savegpr_25(); -extern "C" void _savegpr_27(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_24(); -extern "C" void _restgpr_25(); -extern "C" void _restgpr_27(); -extern "C" void _restgpr_29(); -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" u8 now__14mDoMtx_stack_c[48]; -extern "C" extern u8 g_dComIfG_gameInfo[122384]; -extern "C" u8 sincosTable___5JMath[65536]; -extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */]; - -// -// Declarations: -// - -/* ############################################################################################## */ /* 80C123BC-80C12400 000000 0044+00 3/3 0/0 0/0 .rodata mCcDCyl__14daObjGraRock_c */ -SECTION_RODATA u8 const daObjGraRock_c::mCcDCyl[68] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x00, 0x00, 0x00, 0x11, 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, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80C123BC, &daObjGraRock_c::mCcDCyl); - -/* 80C12400-80C12404 000044 0004+00 1/4 0/0 0/0 .rodata @3857 */ -SECTION_RODATA static u8 const lit_3857[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x80C12400, &lit_3857); - -/* 80C12404-80C12408 000048 0004+00 0/2 0/0 0/0 .rodata @3858 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3858 = 680.0f; -COMPILER_STRIP_GATE(0x80C12404, &lit_3858); -#pragma pop - -/* 80C12408-80C1240C 00004C 0004+00 0/2 0/0 0/0 .rodata @3859 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3859 = 145.0f; -COMPILER_STRIP_GATE(0x80C12408, &lit_3859); -#pragma pop - -/* 80C1240C-80C12410 000050 0004+00 4/6 0/0 0/0 .rodata @3860 */ -SECTION_RODATA static f32 const lit_3860 = 1.0f; -COMPILER_STRIP_GATE(0x80C1240C, &lit_3860); - -/* 80C12410-80C12414 000054 0004+00 0/2 0/0 0/0 .rodata @3861 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3861 = -1.0f; -COMPILER_STRIP_GATE(0x80C12410, &lit_3861); -#pragma pop - -/* 80C12414-80C1241C 000058 0004+04 0/1 0/0 0/0 .rodata @3862 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3862[1 + 1 /* padding */] = { - 90.0f, - /* padding */ - 0.0f, -}; -COMPILER_STRIP_GATE(0x80C12414, &lit_3862); -#pragma pop - -/* 80C1241C-80C12424 000060 0008+00 1/2 0/0 0/0 .rodata @3864 */ -SECTION_RODATA static u8 const lit_3864[8] = { - 0x43, 0x30, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, +dCcD_SrcCyl const daObjGraRock_c::mCcDCyl = { + { + {0x0, {{0x0, 0x0, 0x0}, {0x2020, 0x11}, 0x0}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {0.0f, 0.0f, 0.0f}, // mCenter + 0.0f, // mRadius + 0.0f // mHeight + } // mCyl }; -COMPILER_STRIP_GATE(0x80C1241C, &lit_3864); /* 80C110F8-80C11444 000078 034C+00 1/1 0/0 0/0 .text setAttnPos__14daObjGraRock_cFv */ void daObjGraRock_c::setAttnPos() { - // NONMATCHING + cXyz cStack_50(0.0f, 680.0f, 145.0f); + mDoMtx_stack_c::ZXYrotS(current.angle.x, current.angle.y, current.angle.z); + mDoMtx_stack_c::multVec(&cStack_50, &attention_info.position); + attention_info.position += current.pos; + attention_info.distances[0] = daNpcF_getDistTableIdx(8, 5); + attention_info.flags = 1; + dAttention_c& attention = dComIfGp_getAttention(); + if (attention.LockonTruth()) { + if (attention.LockonTarget(0) == this && field_0x9bc == 0 && field_0x9b6 == 0) { + field_0x9b6 = 90; + field_0x9bd = 3; + s16 sVar4 = cLib_getRndValue(0, 0x10000); + s16 sVar5 = cLib_getRndValue(0x400, 0x200); + field_0x9b2 = sVar5 * cM_scos(sVar4); + field_0x9b4 = sVar5 * cM_ssin(sVar4); + field_0x9b8 = cLib_getRndValue(2, 2); + field_0x9ba = cLib_getRndValue(2, 2); + Z2GetAudioMgr()->seStart(Z2SE_OBJ_ZR_GRN_ROCK_GRGR, ¤t.pos, 0, 0, 1.0f, 1.0f, + -1.0f, -1.0f, 0); + Z2GetAudioMgr()->seStart(Z2SE_GRA_V_YURAYURA, &attention_info.position, 0, 0, 1.0f, + 1.0f, -1.0f, -1.0f, 0); + } + field_0x9bc = 1; + } else { + field_0x9bc = 0; + } + if (cLib_calcTimer(&field_0x9b6) != 0) { + current.angle.x = ((f32)field_0x9b2 * (f32)field_0x9b6 / 90.0f) * cM_ssin((field_0x9b8 * (field_0x9b6 * 0x10000)) / 90); + current.angle.z = ((f32)field_0x9b4 * (f32)field_0x9b6 / 90.0f) * cM_ssin((field_0x9ba * (field_0x9b6 * 0x10000)) / 90); + setPrtcl(); + } + shape_angle = current.angle; } /* 80C11444-80C114C0 0003C4 007C+00 2/2 0/0 0/0 .text setBaseMtx__14daObjGraRock_cFv */ void daObjGraRock_c::setBaseMtx() { - // NONMATCHING + mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); + mDoMtx_stack_c::ZXYrotM(shape_angle.x, shape_angle.y, shape_angle.z); + mModel->setBaseTRMtx(mDoMtx_stack_c::get()); + MTXCopy(mDoMtx_stack_c::get(), mBgMtx); } -/* ############################################################################################## */ /* 80C12424-80C12428 000068 0004+00 1/1 0/0 0/0 .rodata l_prticles_id$3890 */ -SECTION_RODATA static u8 const l_prticles_id[4] = { - 0x87, - 0x5F, - 0x87, - 0x60, +static u16 const l_prticles_id[2] = { + 0x875F, + 0x8760, }; -COMPILER_STRIP_GATE(0x80C12424, &l_prticles_id); /* 80C114C0-80C1157C 000440 00BC+00 1/1 0/0 0/0 .text setPrtcl__14daObjGraRock_cFv */ void daObjGraRock_c::setPrtcl() { - // NONMATCHING + for (int i = 0; i < 2; i++) { + mParticleIds[i] = dComIfGp_particle_set(mParticleIds[i], l_prticles_id[i], ¤t.pos, + ¤t.angle, &scale); + } } /* 80C1157C-80C11730 0004FC 01B4+00 1/1 0/0 0/0 .text bombParticleSet__14daObjGraRock_cFv */ void daObjGraRock_c::bombParticleSet() { - // NONMATCHING + dComIfGp_particle_set(0x875b, ¤t.pos, &tevStr, ¤t.angle, 0); + dComIfGp_particle_set(0x8767, ¤t.pos, &tevStr, ¤t.angle, 0); + dComIfGp_particle_set(0x875c, ¤t.pos, &tevStr, ¤t.angle, 0); + dComIfGp_particle_set(0x875d, ¤t.pos, &tevStr, ¤t.angle, 0); + dComIfGp_particle_set(0x875e, ¤t.pos, &tevStr, ¤t.angle, 0); } /* 80C11730-80C1178C 0006B0 005C+00 1/1 0/0 0/0 .text setEnvTevColor__14daObjGraRock_cFv */ void daObjGraRock_c::setEnvTevColor() { - // NONMATCHING + tevStr.mEnvrIdxOverride = dComIfG_Bgsp().GetPolyColor(mGndChk); + tevStr.mRoomNo = dComIfG_Bgsp().GetRoomId(mGndChk); } /* 80C1178C-80C117D0 00070C 0044+00 1/1 0/0 0/0 .text setRoomNo__14daObjGraRock_cFv */ void daObjGraRock_c::setRoomNo() { - // NONMATCHING + s32 roomId = dComIfG_Bgsp().GetRoomId(mGndChk); + fopAcM_SetRoomNo(this, roomId); + mStts.SetRoomId(roomId); } /* 80C117D0-80C11964 000750 0194+00 1/1 0/0 0/0 .text col_set__14daObjGraRock_cFv */ void daObjGraRock_c::col_set() { - // NONMATCHING + if (mCyl.ChkTgHit()) { + if (checkHitAt(mCyl.GetTgHitObj())) { + cXyz acStack_2c(0.0f, 680.0f, 145.0f); + mDoMtx_stack_c::ZXYrotS(current.angle.x, current.angle.y, current.angle.z); + mDoMtx_stack_c::multVec(&acStack_2c, &acStack_2c); + acStack_2c += current.pos; + bombParticleSet(); + daNpcF_onEvtBit(0x150); + dComIfGs_onSwitch(field_0x9c8, fopAcM_GetRoomNo(this)); + csXyz local_34(current.angle); + local_34.x = 2; + fopAcM_create(PROC_NPC_GRA, 0x5fffff00, &acStack_2c, fopAcM_GetRoomNo(this), &local_34, 0, + -1); + Z2GetAudioMgr()->seStart(Z2SE_OBJ_ZR_GRN_ROCK_BRK, ¤t.pos, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, + 0); + fopAcM_delete(this); + return; + } + mCyl.ClrTgHit(); + } + dComIfG_Ccsp()->Set(&mCyl); } /* 80C11964-80C11970 0008E4 000C+00 1/1 0/0 0/0 .text checkHitAt__14daObjGraRock_cFP8cCcD_Obj */ -void daObjGraRock_c::checkHitAt(cCcD_Obj* param_0) { - // NONMATCHING +int daObjGraRock_c::checkHitAt(cCcD_Obj* hitObj) { + return hitObj->ChkAtType(AT_TYPE_BOMB) ? 1 : 0; } -/* ############################################################################################## */ -/* 80C12428-80C1242C 00006C 0004+00 0/1 0/0 0/0 .rodata @4024 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_4024 = 0xC3A438D5; -COMPILER_STRIP_GATE(0x80C12428, &lit_4024); -#pragma pop - -/* 80C1242C-80C12430 000070 0004+00 0/1 0/0 0/0 .rodata @4025 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4025 = -150.0f; -COMPILER_STRIP_GATE(0x80C1242C, &lit_4025); -#pragma pop - -/* 80C12430-80C12434 000074 0004+00 0/1 0/0 0/0 .rodata @4026 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_4026 = 0xC3C01581; -COMPILER_STRIP_GATE(0x80C12430, &lit_4026); -#pragma pop - -/* 80C12434-80C12438 000078 0004+00 0/1 0/0 0/0 .rodata @4027 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_4027 = 0x43A1274C; -COMPILER_STRIP_GATE(0x80C12434, &lit_4027); -#pragma pop - -/* 80C12438-80C1243C 00007C 0004+00 0/1 0/0 0/0 .rodata @4028 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_4028 = 0x4483F1C2; -COMPILER_STRIP_GATE(0x80C12438, &lit_4028); -#pragma pop - -/* 80C1243C-80C12440 000080 0004+00 0/1 0/0 0/0 .rodata @4029 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_4029 = 0x43C89F9E; -COMPILER_STRIP_GATE(0x80C1243C, &lit_4029); -#pragma pop - /* 80C11970-80C11B68 0008F0 01F8+00 1/0 0/0 0/0 .text Create__14daObjGraRock_cFv */ -void daObjGraRock_c::Create() { - // NONMATCHING +int daObjGraRock_c::Create() { + setBaseMtx(); + fopAcM_SetMtx(this, mModel->getBaseTRMtx()); + fopAcM_setCullSizeBox(this, -328.444f, -150.0f, + -384.168f, 322.307f, + 1055.554931640625f, 401.247f); + mAcchCir.SetWall(0.0f, 0.0f); + mAcch.Set(fopAcM_GetPosition_p(this), fopAcM_GetOldPosition_p(this), this, 1, + &mAcchCir, fopAcM_GetSpeed_p(this), fopAcM_GetAngle_p(this), fopAcM_GetShapeAngle_p(this)); + mStts.Init(0xff, 0, this); + mCyl.Set(mCcDCyl); + mCyl.SetStts(&mStts); + fopAcM_getCullSizeBoxMin(this); + const Vec* cullMax = fopAcM_getCullSizeBoxMax(this); + f32 fVar1; + if (cullMax->x > cullMax->z) { + fVar1 = cullMax->x; + } else { + fVar1 = cullMax->z; + } + mCyl.SetC(current.pos); + mCyl.SetH(cullMax->y); + mCyl.SetR(fVar1); + mAcch.CrrPos(dComIfG_Bgsp()); + mGndChk = mAcch.m_gnd; + setEnvTevColor(); + setRoomNo(); + for (int i = 0; i < 2; i++) { + mParticleIds[i] = 0xffffffff; + } + field_0x9b0 = 0; + field_0x9b6 = 0; + field_0x9bc = 0; + field_0x9bd = 0; + field_0x9be = cLib_getRndValue(90, 90); + return 1; } -/* ############################################################################################## */ -/* 80C12440-80C12440 000084 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80C12440 = "M_VBom"; -SECTION_DEAD static char const* const stringBase_80C12447 = "grA_base"; -SECTION_DEAD static char const* const stringBase_80C12450 = "grA_mdl"; -SECTION_DEAD static char const* const stringBase_80C12458 = "grA_Rock"; -SECTION_DEAD static char const* const stringBase_80C12461 = "grA_RockD"; -SECTION_DEAD static char const* const stringBase_80C1246B = "M_VBom_Zora.bmd"; -SECTION_DEAD static char const* const stringBase_80C1247B = "M_VBom_Zora.btp"; -#pragma pop - /* 80C1249C-80C124B0 -00001 0014+00 3/3 0/0 0/0 .data l_arcName */ -SECTION_DATA static void* l_arcName[5] = { - (void*)&d_a_obj_gra_rock__stringBase0, - (void*)(((char*)&d_a_obj_gra_rock__stringBase0) + 0x7), - (void*)(((char*)&d_a_obj_gra_rock__stringBase0) + 0x10), - (void*)(((char*)&d_a_obj_gra_rock__stringBase0) + 0x18), - (void*)(((char*)&d_a_obj_gra_rock__stringBase0) + 0x21), +static char* l_arcName[5] = { + "M_VBom", + "grA_base", + "grA_mdl", + "grA_Rock", + "grA_RockD", }; /* 80C11B68-80C11C64 000AE8 00FC+00 1/0 0/0 0/0 .text CreateHeap__14daObjGraRock_cFv */ -void daObjGraRock_c::CreateHeap() { - // NONMATCHING +int daObjGraRock_c::CreateHeap() { + J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName[0], "M_VBom_Zora.bmd"); + JUT_ASSERT(488, modelData != 0); + mModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11020084); + if (mModel == NULL) { + return 0; + } + J3DAnmTexPattern* btp_p = + (J3DAnmTexPattern*)dComIfG_getObjectRes(l_arcName[0], "M_VBom_Zora.btp"); + JUT_ASSERT(501, btp_p != 0); + if (mBtp.init(modelData, btp_p, 1, 2, 1.0f, 0, -1) == 0) { + return 0; + } + mBtp.setPlaySpeed(1.0f); + return 1; } -/* ############################################################################################## */ -/* 80C12440-80C12440 000084 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80C1248B = "M_VBom_Zora.dzb"; -#pragma pop - -/* 80C124B0-80C124D0 -00001 0020+00 1/0 0/0 0/0 .data l_daObjGraRock_Method */ -static actor_method_class l_daObjGraRock_Method = { - (process_method_func)daObjGraRock_create__FP10fopAc_ac_c, - (process_method_func)daObjGraRock_Delete__FP14daObjGraRock_c, - (process_method_func)daObjGraRock_Execute__FP14daObjGraRock_c, - (process_method_func)daObjGraRock_IsDelete__FP14daObjGraRock_c, - (process_method_func)daObjGraRock_Draw__FP14daObjGraRock_c, -}; - -/* 80C124D0-80C12500 -00001 0030+00 0/0 0/0 1/0 .data g_profile_Obj_GraRock */ -extern actor_process_profile_definition g_profile_Obj_GraRock = { - fpcLy_CURRENT_e, // mLayerID - 3, // mListID - fpcPi_CURRENT_e, // mListPrio - PROC_Obj_GraRock, // mProcName - &g_fpcLf_Method.base, // sub_method - sizeof(daObjGraRock_c), // mSize - 0, // mSizeOther - 0, // mParameters - &g_fopAc_Method.base, // sub_method - 609, // mPriority - &l_daObjGraRock_Method, // sub_method - 0x00044100, // mStatus - fopAc_ACTOR_e, // mActorType - fopAc_CULLBOX_CUSTOM_e, // cullType -}; - -/* 80C12500-80C1250C 000064 000C+00 2/2 0/0 0/0 .data __vt__8cM3dGCyl */ -SECTION_DATA extern void* __vt__8cM3dGCyl[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGCylFv, -}; - -/* 80C1250C-80C12518 000070 000C+00 2/2 0/0 0/0 .data __vt__8cM3dGAab */ -SECTION_DATA extern void* __vt__8cM3dGAab[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGAabFv, -}; - -/* 80C12518-80C1253C 00007C 0024+00 2/2 0/0 0/0 .data __vt__12dBgS_ObjAcch */ -SECTION_DATA extern void* __vt__12dBgS_ObjAcch[9] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12dBgS_ObjAcchFv, - (void*)NULL, - (void*)NULL, - (void*)func_80C123AC, - (void*)NULL, - (void*)NULL, - (void*)func_80C123A4, -}; - -/* 80C1253C-80C12548 0000A0 000C+00 2/2 0/0 0/0 .data __vt__12J3DFrameCtrl */ -SECTION_DATA extern void* __vt__12J3DFrameCtrl[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12J3DFrameCtrlFv, -}; - -/* 80C12548-80C12570 0000AC 0028+00 1/1 0/0 0/0 .data __vt__14daObjGraRock_c */ -SECTION_DATA extern void* __vt__14daObjGraRock_c[10] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)CreateHeap__14daObjGraRock_cFv, - (void*)Create__14daObjGraRock_cFv, - (void*)Execute__14daObjGraRock_cFPPA3_A4_f, - (void*)Draw__14daObjGraRock_cFv, - (void*)Delete__14daObjGraRock_cFv, - (void*)IsDelete__16dBgS_MoveBgActorFv, - (void*)ToFore__16dBgS_MoveBgActorFv, - (void*)ToBack__16dBgS_MoveBgActorFv, -}; - /* 80C11C64-80C11EA8 000BE4 0244+00 1/1 0/0 0/0 .text create__14daObjGraRock_cFv */ -void daObjGraRock_c::create() { - // NONMATCHING -} - -/* 80C11EA8-80C11EF0 000E28 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGCylFv */ -// cM3dGCyl::~cM3dGCyl() { -extern "C" void __dt__8cM3dGCylFv() { - // NONMATCHING -} - -/* 80C11EF0-80C11F38 000E70 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGAabFv */ -// cM3dGAab::~cM3dGAab() { -extern "C" void __dt__8cM3dGAabFv() { - // NONMATCHING -} - -/* 80C11F38-80C11FA8 000EB8 0070+00 3/2 0/0 0/0 .text __dt__12dBgS_ObjAcchFv */ -// dBgS_ObjAcch::~dBgS_ObjAcch() { -extern "C" void __dt__12dBgS_ObjAcchFv() { - // NONMATCHING -} - -/* 80C11FA8-80C11FF0 000F28 0048+00 1/0 0/0 0/0 .text __dt__12J3DFrameCtrlFv */ -// J3DFrameCtrl::~J3DFrameCtrl() { -extern "C" void __dt__12J3DFrameCtrlFv() { - // NONMATCHING +int daObjGraRock_c::create() { + fopAcM_SetupActor(this, daObjGraRock_c); + field_0x9c8 = fopAcM_GetParam(this); + int i; + int completedNum; + int rv; + completedNum = 0; + for (i = 0; i < 5; i++) { + rv = dComIfG_resLoad(&mPhases[i], l_arcName[i]); + if (rv == cPhs_ERROR_e || rv == cPhs_UNK3_e) { + return cPhs_ERROR_e; + } + if (rv == cPhs_COMPLEATE_e) { + completedNum++; + } + } + if (i == completedNum) { + int dzb_id = dComIfG_getObjctResName2Index(l_arcName[0], "M_VBom_Zora.dzb"); + JUT_ASSERT(550, dzb_id != -1); + rv = MoveBGCreate(l_arcName[0], dzb_id, + dBgS_MoveBGProc_TypicalRotY, 0x2d50, NULL); + if (daNpcF_chkEvtBit(0x150)) { + rv = cPhs_ERROR_e; + } + if (rv == cPhs_ERROR_e) { + return rv; + } + } + return rv; } /* 80C11FF0-80C120FC 000F70 010C+00 1/0 0/0 0/0 .text Execute__14daObjGraRock_cFPPA3_A4_f */ -void daObjGraRock_c::Execute(f32 (**param_0)[3][4]) { - // NONMATCHING +int daObjGraRock_c::Execute(Mtx** pMtx) { + mBtp.play(); + if (field_0x9bd != 0) { + if (mBtp.isLoop()) { + if (cLib_calcTimer(&field_0x9bd) == 0) { + mBtp.setPlaySpeed(0.0f); + field_0x9be = cLib_getRndValue(90, 90); + } + } else { + mBtp.setPlaySpeed(1.0f); + } + } else { + if (cLib_calcTimer(&field_0x9be) == 0) { + mBtp.setPlaySpeed(1.0); + if (mBtp.isLoop()) { + field_0x9be = cLib_getRndValue(90, 90); + mBtp.setPlaySpeed(0.0f); + } + } else { + mBtp.setPlaySpeed(0.0f); + } + } + col_set(); + *pMtx = &mBgMtx; + setAttnPos(); + setBaseMtx(); + return 1; } /* 80C120FC-80C121C4 00107C 00C8+00 1/0 0/0 0/0 .text Draw__14daObjGraRock_cFv */ -void daObjGraRock_c::Draw() { - // NONMATCHING +int daObjGraRock_c::Draw() { + g_env_light.settingTevStruct(0, ¤t.pos, &tevStr); + g_env_light.setLightTevColorType_MAJI(mModel, &tevStr); + dComIfGd_setListBG(); + mBtp.entry(mModel->getModelData()); + mDoExt_modelUpdateDL(mModel); + dComIfGd_setList(); + return 1; } /* 80C121C4-80C1225C 001144 0098+00 1/0 0/0 0/0 .text Delete__14daObjGraRock_cFv */ -void daObjGraRock_c::Delete() { - // NONMATCHING +int daObjGraRock_c::Delete() { + for (int i = 0; i < 5; i = i + 1) { + dComIfG_resDelete(&mPhases[i], l_arcName[i]); + } + if (mpBgW != NULL && mpBgW->ChkUsed()) { + if (dComIfG_Bgsp().Release(mpBgW) != 0) { + OS_REPORT("Release Error\n"); + } + } + return 1; } /* 80C1225C-80C12288 0011DC 002C+00 1/0 0/0 0/0 .text daObjGraRock_Draw__FP14daObjGraRock_c */ -static void daObjGraRock_Draw(daObjGraRock_c* param_0) { - // NONMATCHING +static int daObjGraRock_Draw(daObjGraRock_c* i_this) { + return i_this->Draw(); } /* 80C12288-80C122A8 001208 0020+00 1/0 0/0 0/0 .text daObjGraRock_Execute__FP14daObjGraRock_c */ -static void daObjGraRock_Execute(daObjGraRock_c* param_0) { - // NONMATCHING +static int daObjGraRock_Execute(daObjGraRock_c* i_this) { + return i_this->MoveBGExecute(); } /* 80C122A8-80C122B0 001228 0008+00 1/0 0/0 0/0 .text daObjGraRock_IsDelete__FP14daObjGraRock_c */ -static bool daObjGraRock_IsDelete(daObjGraRock_c* param_0) { - return true; +static int daObjGraRock_IsDelete(daObjGraRock_c* i_this) { + return 1; } /* 80C122B0-80C122D0 001230 0020+00 1/0 0/0 0/0 .text daObjGraRock_Delete__FP14daObjGraRock_c */ -static void daObjGraRock_Delete(daObjGraRock_c* param_0) { - // NONMATCHING +static int daObjGraRock_Delete(daObjGraRock_c* i_this) { + return i_this->MoveBGDelete(); } /* 80C122D0-80C122F0 001250 0020+00 1/0 0/0 0/0 .text daObjGraRock_create__FP10fopAc_ac_c */ -static void daObjGraRock_create(fopAc_ac_c* param_0) { - // NONMATCHING -} - -/* 80C122F0-80C1230C 001270 001C+00 2/2 0/0 0/0 .text cLib_calcTimer__FPs */ -extern "C" void func_80C122F0(void* _this, s16* param_0) { - // NONMATCHING +static int daObjGraRock_create(fopAc_ac_c* i_this) { + return static_cast(i_this)->create(); } -/* 80C1230C-80C12328 00128C 001C+00 1/1 0/0 0/0 .text cLib_calcTimer__FPUc */ -extern "C" void func_80C1230C(void* _this, u8* param_0) { - // NONMATCHING -} - -/* 80C12328-80C123A4 0012A8 007C+00 3/3 0/0 0/0 .text cLib_getRndValue__Fii */ -extern "C" void func_80C12328(void* _this, int param_0, int param_1) { - // NONMATCHING -} - -/* 80C123A4-80C123AC 001324 0008+00 1/0 0/0 0/0 .text @36@__dt__12dBgS_ObjAcchFv */ -static void func_80C123A4() { - // NONMATCHING -} +/* 80C124B0-80C124D0 -00001 0020+00 1/0 0/0 0/0 .data l_daObjGraRock_Method */ +static actor_method_class l_daObjGraRock_Method = { + (process_method_func)daObjGraRock_create, + (process_method_func)daObjGraRock_Delete, + (process_method_func)daObjGraRock_Execute, + (process_method_func)daObjGraRock_IsDelete, + (process_method_func)daObjGraRock_Draw, +}; -/* 80C123AC-80C123B4 00132C 0008+00 1/0 0/0 0/0 .text @20@__dt__12dBgS_ObjAcchFv */ -static void func_80C123AC() { - // NONMATCHING -} +/* 80C124D0-80C12500 -00001 0030+00 0/0 0/0 1/0 .data g_profile_Obj_GraRock */ +extern actor_process_profile_definition g_profile_Obj_GraRock = { + fpcLy_CURRENT_e, // mLayerID + 3, // mListID + fpcPi_CURRENT_e, // mListPrio + PROC_Obj_GraRock, // mProcName + &g_fpcLf_Method.base, // sub_method + sizeof(daObjGraRock_c), // mSize + 0, // mSizeOther + 0, // mParameters + &g_fopAc_Method.base, // sub_method + 609, // mPriority + &l_daObjGraRock_Method, // sub_method + 0x00044100, // mStatus + fopAc_ACTOR_e, // mActorType + fopAc_CULLBOX_CUSTOM_e, // cullType +}; /* 80C12440-80C12440 000084 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ From 21271a0a1515ce9ec1203a9d5d92a3edad37811f Mon Sep 17 00:00:00 2001 From: Tal Hayon Date: Thu, 12 Dec 2024 21:52:00 +0200 Subject: [PATCH 3/3] daBkyRock_c OK --- .../GZ2E01/rels/d_a_obj_bky_rock/symbols.txt | 18 +- configure.py | 2 +- include/SSystem/SComponent/c_cc_d.h | 1 + include/d/actor/d_a_obj_bky_rock.h | 59 +- include/d/d_model.h | 2 + src/d/actor/d_a_obj_bky_rock.cpp | 909 +++++++----------- 6 files changed, 397 insertions(+), 594 deletions(-) diff --git a/config/GZ2E01/rels/d_a_obj_bky_rock/symbols.txt b/config/GZ2E01/rels/d_a_obj_bky_rock/symbols.txt index a47740c664c..88e20694103 100644 --- a/config/GZ2E01/rels/d_a_obj_bky_rock/symbols.txt +++ b/config/GZ2E01/rels/d_a_obj_bky_rock/symbols.txt @@ -1,7 +1,7 @@ _prolog = .text:0x00000000; // type:function size:0x2C scope:global _epilog = .text:0x0000002C; // type:function size:0x2C scope:global _unresolved = .text:0x00000058; // type:function size:0x20 scope:global -daBkyRock_c_createHeap__FP10fopAc_ac_c = .text:0x00000078; // type:function size:0x20 scope:global +daBkyRock_c_createHeap__FP10fopAc_ac_c = .text:0x00000078; // type:function size:0x20 scope:local __ct__11daBkyRock_cFv = .text:0x00000098; // type:function size:0xBC scope:global __ct__Q211daBkyRock_c10_pieceDataFv = .text:0x00000154; // type:function size:0xC scope:global __dt__8dCcD_CylFv = .text:0x00000160; // type:function size:0xCC scope:global @@ -27,16 +27,16 @@ initChangeModeAfter__11daBkyRock_cFv = .text:0x0000103C; // type:function size:0 pieceMove__11daBkyRock_cFv = .text:0x00001058; // type:function size:0x170 scope:global pieceMoveInit__11daBkyRock_cFv = .text:0x000011C8; // type:function size:0x290 scope:global callBombEmt__11daBkyRock_cFiPCUs = .text:0x00001458; // type:function size:0x138 scope:global -daBkyRock_create__FP11daBkyRock_c = .text:0x00001590; // type:function size:0x54 scope:global -daBkyRock_Delete__FP11daBkyRock_c = .text:0x000015E4; // type:function size:0x20 scope:global -daBkyRock_execute__FP11daBkyRock_c = .text:0x00001604; // type:function size:0x20 scope:global -daBkyRock_draw__FP11daBkyRock_c = .text:0x00001624; // type:function size:0x20 scope:global +daBkyRock_create__FP11daBkyRock_c = .text:0x00001590; // type:function size:0x54 scope:local +daBkyRock_Delete__FP11daBkyRock_c = .text:0x000015E4; // type:function size:0x20 scope:local +daBkyRock_execute__FP11daBkyRock_c = .text:0x00001604; // type:function size:0x20 scope:local +daBkyRock_draw__FP11daBkyRock_c = .text:0x00001624; // type:function size:0x20 scope:local __dt__10cCcD_GSttsFv = .text:0x00001644; // type:function size:0x48 scope:global __sinit_d_a_obj_bky_rock_cpp = .text:0x0000168C; // type:function size:0x58 scope:local _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global ...rodata.0 = .rodata:0x00000000; // type:label scope:local -VIBMODE_POWER = .rodata:0x00000000; // type:object size:0xC scope:global +VIBMODE_POWER = .rodata:0x00000000; // type:object size:0xC scope:local PARTICLE_SCALE = .rodata:0x0000000C; // type:object size:0x8 scope:global PARTICLE_OFFSET_POS_Y = .rodata:0x00000014; // type:object size:0x8 scope:global FIRST_PARTICLE_NAME = .rodata:0x0000001C; // type:object size:0x8 scope:global @@ -75,14 +75,14 @@ PIECE_SCALE_BASE$4100 = .rodata:0x00000148; // type:object size:0x8 scope:local @4165 = .rodata:0x00000160; // type:object size:0x4 scope:local @stringBase0 = .rodata:0x00000164; // type:object size:0x7 scope:local data:string_table ...data.0 = .data:0x00000000; // type:label scope:local -cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:global +cNullVec__6Z2Calc = .data:0x00000000; // type:object size:0xC scope:local @1787 = .data:0x0000000C; // type:object size:0x4 scope:local -l_arcName = .data:0x00000020; // type:object size:0x4 scope:global data:4byte +l_arcName = .data:0x00000020; // type:object size:0x4 scope:local data:4byte @3933 = .data:0x00000024; // type:object size:0xC scope:local @3934 = .data:0x00000030; // type:object size:0xC scope:local @3935 = .data:0x0000003C; // type:object size:0xC scope:local s_exeProc__11daBkyRock_c = .data:0x00000048; // type:object size:0x24 scope:global data:4byte -daBkyRock_METHODS = .data:0x0000006C; // type:object size:0x20 scope:global +daBkyRock_METHODS = .data:0x0000006C; // type:object size:0x20 scope:local g_profile_BkyRock = .data:0x0000008C; // type:object size:0x30 scope:global __vt__11daBkyRock_c = .data:0x000000BC; // type:object size:0xC scope:global __vt__10cCcD_GStts = .data:0x000000C8; // type:object size:0xC scope:global diff --git a/configure.py b/configure.py index 14670ff50e6..6d4015b2e4f 100644 --- a/configure.py +++ b/configure.py @@ -1774,7 +1774,7 @@ def MatchingFor(*versions): ActorRel(NonMatching, "d_a_obj_bemos"), ActorRel(NonMatching, "d_a_obj_bhbridge"), ActorRel(Matching, "d_a_obj_bk_leaf"), - ActorRel(NonMatching, "d_a_obj_bky_rock"), + ActorRel(Matching, "d_a_obj_bky_rock"), ActorRel(Matching, "d_a_obj_bmWindow"), ActorRel(NonMatching, "d_a_obj_bmshutter"), ActorRel(Matching, "d_a_obj_bombf"), diff --git a/include/SSystem/SComponent/c_cc_d.h b/include/SSystem/SComponent/c_cc_d.h index 320762ae961..2e7393be492 100644 --- a/include/SSystem/SComponent/c_cc_d.h +++ b/include/SSystem/SComponent/c_cc_d.h @@ -17,6 +17,7 @@ enum CcG_Tg_HitMark { CcG_Tg_UNK_MARK_3 = 3, CcG_Tg_UNK_MARK_6 = 6, CcG_Tg_UNK_MARK_8 = 8, + CcG_Tg_UNK_MARK_9 = 9, }; class cCcD_PntAttr; diff --git a/include/d/actor/d_a_obj_bky_rock.h b/include/d/actor/d_a_obj_bky_rock.h index c58837ddba6..2771435fb5d 100644 --- a/include/d/actor/d_a_obj_bky_rock.h +++ b/include/d/actor/d_a_obj_bky_rock.h @@ -1,6 +1,8 @@ #ifndef D_A_OBJ_BKY_ROCK_H #define D_A_OBJ_BKY_ROCK_H +#include "d/d_cc_d.h" +#include "d/d_model.h" #include "f_op/f_op_actor_mng.h" /** @@ -11,41 +13,72 @@ * @details * */ -class daBkyRock_c : public fopAc_ac_c { +class daBkyRock_c : public fopAc_ac_c, public request_of_phase_process_class { public: struct _pieceData { public: - /* 80BB6914 */ _pieceData(); + /* 80BB6914 */ _pieceData() { mMdlObj.mpObj = NULL; } + + /* 0x00 */ dMdl_obj_c mMdlObj; + /* 0x34 */ Vec position; + /* 0x40 */ f32 targetX; + /* 0x44 */ f32 targetZ; + /* 0x48 */ f32 scale; + /* 0x4C */ f32 speedY; + /* 0x50 */ s16 rotationX; + /* 0x52 */ s16 rotationZ; + /* 0x54 */ s16 rotationSpeed; + }; + + typedef void (daBkyRock_c::*exeProc)(); + + enum Mode { + MODE_0, + MODE_1, + MODE_2, }; /* 80BB6858 */ daBkyRock_c(); - /* 80BB6B5C */ ~daBkyRock_c(); - /* 80BB6C4C */ void create(); - /* 80BB6D60 */ void execute(); - /* 80BB6D84 */ void draw(); - /* 80BB6EB8 */ void Delete(); + /* 80BB6B5C */ virtual ~daBkyRock_c(); + /* 80BB6C4C */ int create(); + /* 80BB6D60 */ int execute(); + /* 80BB6D84 */ int draw(); + /* 80BB6EB8 */ int Delete(); /* 80BB6F64 */ void setModelMtx(); - /* 80BB6FD4 */ void createHeap(); + /* 80BB6FD4 */ int createHeap(); /* 80BB7144 */ void init(); /* 80BB72FC */ void middleExe(); /* 80BB7364 */ void exeModeNoDamage(); /* 80BB7458 */ void exeModeDamage(); /* 80BB75D8 */ void exeModePiece(); - /* 80BB7690 */ void chkHitBombArrow(); + /* 80BB7690 */ bool chkHitBombArrow(); /* 80BB776C */ void initChangeModeBefore(); /* 80BB77FC */ void initChangeModeAfter(); /* 80BB7818 */ void pieceMove(); /* 80BB7988 */ void pieceMoveInit(); /* 80BB7C18 */ void callBombEmt(int, u16 const*); - static u8 const s_CcDCyl[68]; - static u8 s_exeProc[36]; + u8 getSwBit0() { return fopAcM_GetParamBit(this, 4, 8); } + u8 getSwBit1() { return fopAcM_GetParamBit(this, 12, 8); } + s8 getNameNo() { return fopAcM_GetParamBit(this, 0, 4); } + + static dCcD_SrcCyl const s_CcDCyl; + static exeProc s_exeProc[3]; private: - /* 0x568 */ u8 field_0x568[0xf50 - 0x568]; + /* 0x568 */ int mVibrationTimer; + /* 0x578 */ u8 mMode; + /* 0x579 */ bool field_0x579; + /* 0x57A */ bool field_0x57a; + /* 0x57B */ Mtx mMtx; + /* 0x5AC */ dBgW* mBgW; + /* 0x5B0 */ dCcD_Stts mStts; + /* 0x5EC */ dCcD_Cyl mCyls[2]; + /* 0x864 */ J3DModel* mModels[3]; + /* 0x870 */ _pieceData mPieces[20]; }; -STATIC_ASSERT(sizeof(daBkyRock_c) == 0xf50); +//STATIC_ASSERT(sizeof(daBkyRock_c) == 0xf50); #endif /* D_A_OBJ_BKY_ROCK_H */ diff --git a/include/d/d_model.h b/include/d/d_model.h index 9dc33d0ef21..0215637e3d0 100644 --- a/include/d/d_model.h +++ b/include/d/d_model.h @@ -2,6 +2,7 @@ #define D_D_MODEL_H #include "JSystem/J3DGraphBase/J3DPacket.h" +#include "m_Do/m_Do_mtx.h" class J3DModelData; class dKy_tevstr_c; @@ -9,6 +10,7 @@ class dKy_tevstr_c; class dMdl_obj_c { public: MtxP getMtx() { return mMtx; } + void setMtx(Mtx mtx) { cMtx_copy(mtx, mMtx); } /* 0x00 */ Mtx mMtx; /* 0x30 */ dMdl_obj_c* mpObj; diff --git a/src/d/actor/d_a_obj_bky_rock.cpp b/src/d/actor/d_a_obj_bky_rock.cpp index ca89f3602bd..485189ca836 100644 --- a/src/d/actor/d_a_obj_bky_rock.cpp +++ b/src/d/actor/d_a_obj_bky_rock.cpp @@ -4,151 +4,26 @@ */ #include "d/actor/d_a_obj_bky_rock.h" +#include "SSystem/SComponent/c_math.h" +#include "d/d_bg_w.h" +#include "d/d_model.h" +#include "d/d_com_inf_game.h" #include "dol2asm.h" -// -// Forward References: -// - -extern "C" static void daBkyRock_c_createHeap__FP10fopAc_ac_c(); -extern "C" void __ct__11daBkyRock_cFv(); -extern "C" void __ct__Q211daBkyRock_c10_pieceDataFv(); -extern "C" void __dt__8dCcD_CylFv(); -extern "C" void __ct__8dCcD_CylFv(); -extern "C" void __dt__8cM3dGCylFv(); -extern "C" void __dt__8cM3dGAabFv(); -extern "C" void __dt__10dCcD_GSttsFv(); -extern "C" void __dt__11daBkyRock_cFv(); -extern "C" void create__11daBkyRock_cFv(); -extern "C" void execute__11daBkyRock_cFv(); -extern "C" void draw__11daBkyRock_cFv(); -extern "C" void Delete__11daBkyRock_cFv(); -extern "C" void setModelMtx__11daBkyRock_cFv(); -extern "C" void createHeap__11daBkyRock_cFv(); -extern "C" void init__11daBkyRock_cFv(); -extern "C" void middleExe__11daBkyRock_cFv(); -extern "C" void exeModeNoDamage__11daBkyRock_cFv(); -extern "C" void exeModeDamage__11daBkyRock_cFv(); -extern "C" void exeModePiece__11daBkyRock_cFv(); -extern "C" void chkHitBombArrow__11daBkyRock_cFv(); -extern "C" void initChangeModeBefore__11daBkyRock_cFv(); -extern "C" void initChangeModeAfter__11daBkyRock_cFv(); -extern "C" void pieceMove__11daBkyRock_cFv(); -extern "C" void pieceMoveInit__11daBkyRock_cFv(); -extern "C" void callBombEmt__11daBkyRock_cFiPCUs(); -extern "C" static void daBkyRock_create__FP11daBkyRock_c(); -extern "C" static void daBkyRock_Delete__FP11daBkyRock_c(); -extern "C" static void daBkyRock_execute__FP11daBkyRock_c(); -extern "C" static void daBkyRock_draw__FP11daBkyRock_c(); -extern "C" void __dt__10cCcD_GSttsFv(); -extern "C" void __sinit_d_a_obj_bky_rock_cpp(); -extern "C" u8 const s_CcDCyl__11daBkyRock_c[68]; -extern "C" extern char const* const d_a_obj_bky_rock__stringBase0; -extern "C" u8 s_exeProc__11daBkyRock_c[36]; - -// -// External References: -// - -extern "C" void mDoMtx_YrotM__FPA4_fs(); -extern "C" void mDoMtx_ZrotM__FPA4_fs(); -extern "C" void scaleM__14mDoMtx_stack_cFfff(); -extern "C" void mDoExt_modelUpdate__FP8J3DModel(); -extern "C" void mDoExt_J3DModel__create__FP12J3DModelDataUlUl(); -extern "C" void __ct__10fopAc_ac_cFv(); -extern "C" void __dt__10fopAc_ac_cFv(); -extern "C" void fopAcM_delete__FP10fopAc_ac_c(); -extern "C" void fopAcM_entrySolidHeap__FP10fopAc_ac_cPFP10fopAc_ac_c_iUl(); -extern "C" void fopAcM_setCullSizeBox__FP10fopAc_ac_cffffff(); -extern "C" void waterCheck__11fopAcM_wt_cFPC4cXyz(); -extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfG_resDelete__FP30request_of_phase_process_classPCc(); -extern "C" void dComIfGp_getReverb__Fi(); -extern "C" void onSwitch__10dSv_info_cFii(); -extern "C" void isSwitch__10dSv_info_cCFii(); -extern "C" void getRes__14dRes_control_cFPCclP11dRes_info_ci(); -extern "C" void -set__13dPa_control_cFUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf(); -extern "C" void StartQuake__12dVibration_cFii4cXyz(); -extern "C" void StopQuake__12dVibration_cFi(); -extern "C" void CheckQuake__12dVibration_cFv(); -extern "C" void Release__4cBgSFP9dBgW_Base(); -extern "C" void Regist__4dBgSFP9dBgW_BaseP10fopAc_ac_c(); -extern "C" void Set__4cBgWFP6cBgD_tUlPA3_A4_f(); -extern "C" void __ct__4dBgWFv(); -extern "C" void __ct__10dCcD_GSttsFv(); -extern "C" void Init__9dCcD_SttsFiiP10fopAc_ac_c(); -extern "C" void __ct__12dCcD_GObjInfFv(); -extern "C" void __dt__12dCcD_GObjInfFv(); -extern "C" void ChkTgHit__12dCcD_GObjInfFv(); -extern "C" void GetTgHitObj__12dCcD_GObjInfFv(); -extern "C" void Set__8dCcD_CylFRC11dCcD_SrcCyl(); -extern "C" void entryObj__6dMdl_cFP10dMdl_obj_c(); -extern "C" void entry__10dMdl_mng_cFP12J3DModelDataUsi(); -extern "C" void settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c(); -extern "C" void setLightTevColorType_MAJI__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c(); -extern "C" void Set__4cCcSFP8cCcD_Obj(); -extern "C" void __ct__5csXyzFsss(); -extern "C" void cM_rndF__Ff(); -extern "C" void ChkUsed__9cBgW_BgIdCFv(); -extern "C" void SetC__8cM3dGCylFRC4cXyz(); -extern "C" void SetH__8cM3dGCylFf(); -extern "C" void SetR__8cM3dGCylFf(); -extern "C" void cLib_addCalc__FPfffff(); -extern "C" void seStart__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc(); -extern "C" void* __nw__FUl(); -extern "C" void __dl__FPv(); -extern "C" void __destroy_arr(); -extern "C" void __construct_array(); -extern "C" void __ptmf_test(); -extern "C" void __ptmf_scall(); -extern "C" void _savegpr_20(); -extern "C" void _savegpr_24(); -extern "C" void _savegpr_25(); -extern "C" void _savegpr_26(); -extern "C" void _savegpr_28(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_20(); -extern "C" void _restgpr_24(); -extern "C" void _restgpr_25(); -extern "C" void _restgpr_26(); -extern "C" void _restgpr_28(); -extern "C" void _restgpr_29(); -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" u8 now__14mDoMtx_stack_c[48]; -extern "C" extern u8 g_dComIfG_gameInfo[122384]; -extern "C" f32 mWaterY__11fopAcM_wt_c[1 + 1 /* padding */]; -extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */]; - -// -// Declarations: -// - /* 80BB6838-80BB6858 000078 0020+00 1/1 0/0 0/0 .text daBkyRock_c_createHeap__FP10fopAc_ac_c */ -static void daBkyRock_c_createHeap(fopAc_ac_c* param_0) { - // NONMATCHING +static int daBkyRock_c_createHeap(fopAc_ac_c* i_this) { + return static_cast(i_this)->createHeap(); } -/* ############################################################################################## */ -/* 80BB8014-80BB8014 000164 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80BB8014 = "BYRock"; -#pragma pop - /* 80BB801C-80BB8028 000000 000C+00 1/1 0/0 0/0 .data cNullVec__6Z2Calc */ -SECTION_DATA static u8 cNullVec__6Z2Calc[12] = { +static u8 cNullVec__6Z2Calc[12] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; /* 80BB8028-80BB803C 00000C 0004+10 0/0 0/0 0/0 .data @1787 */ #pragma push #pragma force_active on -SECTION_DATA static u32 lit_1787[1 + 4 /* padding */] = { +static u32 lit_1787[1 + 4 /* padding */] = { 0x02000201, /* padding */ 0x40080000, @@ -159,583 +34,475 @@ SECTION_DATA static u32 lit_1787[1 + 4 /* padding */] = { #pragma pop /* 80BB803C-80BB8040 -00001 0004+00 3/3 0/0 0/0 .data l_arcName */ -SECTION_DATA static void* l_arcName = (void*)&d_a_obj_bky_rock__stringBase0; - -/* 80BB8040-80BB804C -00001 000C+00 0/1 0/0 0/0 .data @3933 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_3933[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)exeModeNoDamage__11daBkyRock_cFv, -}; -#pragma pop - -/* 80BB804C-80BB8058 -00001 000C+00 0/1 0/0 0/0 .data @3934 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_3934[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)exeModeDamage__11daBkyRock_cFv, -}; -#pragma pop - -/* 80BB8058-80BB8064 -00001 000C+00 0/1 0/0 0/0 .data @3935 */ -#pragma push -#pragma force_active on -SECTION_DATA static void* lit_3935[3] = { - (void*)NULL, - (void*)0xFFFFFFFF, - (void*)exeModePiece__11daBkyRock_cFv, -}; -#pragma pop +static char* l_arcName = "BYRock"; /* 80BB8064-80BB8088 000048 0024+00 1/2 0/0 0/0 .data s_exeProc__11daBkyRock_c */ -SECTION_DATA u8 daBkyRock_c::s_exeProc[36] = { - 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, 0x00, 0x00, 0x00, 0x00, -}; - -/* 80BB8088-80BB80A8 -00001 0020+00 1/0 0/0 0/0 .data daBkyRock_METHODS */ -static actor_method_class daBkyRock_METHODS = { - (process_method_func)daBkyRock_create__FP11daBkyRock_c, - (process_method_func)daBkyRock_Delete__FP11daBkyRock_c, - (process_method_func)daBkyRock_execute__FP11daBkyRock_c, - 0, - (process_method_func)daBkyRock_draw__FP11daBkyRock_c, -}; - -/* 80BB80A8-80BB80D8 -00001 0030+00 0/0 0/0 1/0 .data g_profile_BkyRock */ -extern actor_process_profile_definition g_profile_BkyRock = { - fpcLy_CURRENT_e, // mLayerID - 7, // mListID - fpcPi_CURRENT_e, // mListPrio - PROC_BkyRock, // mProcName - &g_fpcLf_Method.base, // sub_method - sizeof(daBkyRock_c), // mSize - 0, // mSizeOther - 0, // mParameters - &g_fopAc_Method.base, // sub_method - 728, // mPriority - &daBkyRock_METHODS, // sub_method - 0x00044100, // mStatus - fopAc_ENV_e, // mActorType - fopAc_CULLBOX_CUSTOM_e, // cullType -}; - -/* 80BB80D8-80BB80E4 0000BC 000C+00 2/2 0/0 0/0 .data __vt__11daBkyRock_c */ -SECTION_DATA extern void* __vt__11daBkyRock_c[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__11daBkyRock_cFv, +daBkyRock_c::exeProc daBkyRock_c::s_exeProc[3] = { + &daBkyRock_c::exeModeNoDamage, + &daBkyRock_c::exeModeDamage, + &daBkyRock_c::exeModePiece, }; /* 80BB6858-80BB6914 000098 00BC+00 2/2 0/0 0/0 .text __ct__11daBkyRock_cFv */ daBkyRock_c::daBkyRock_c() { - // NONMATCHING -} - -/* 80BB6914-80BB6920 000154 000C+00 1/1 0/0 0/0 .text __ct__Q211daBkyRock_c10_pieceDataFv - */ -daBkyRock_c::_pieceData::_pieceData() { - // NONMATCHING -} - -/* ############################################################################################## */ -/* 80BB80E4-80BB80F0 0000C8 000C+00 3/3 0/0 0/0 .data __vt__10cCcD_GStts */ -SECTION_DATA extern void* __vt__10cCcD_GStts[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__10cCcD_GSttsFv, -}; - -/* 80BB80F0-80BB80FC 0000D4 000C+00 2/2 0/0 0/0 .data __vt__10dCcD_GStts */ -SECTION_DATA extern void* __vt__10dCcD_GStts[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__10dCcD_GSttsFv, -}; - -/* 80BB80FC-80BB8108 0000E0 000C+00 3/3 0/0 0/0 .data __vt__8cM3dGAab */ -SECTION_DATA extern void* __vt__8cM3dGAab[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGAabFv, -}; - -/* 80BB8108-80BB8114 0000EC 000C+00 3/3 0/0 0/0 .data __vt__8cM3dGCyl */ -SECTION_DATA extern void* __vt__8cM3dGCyl[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGCylFv, -}; - -/* 80BB6920-80BB69EC 000160 00CC+00 2/2 0/0 0/0 .text __dt__8dCcD_CylFv */ -// dCcD_Cyl::~dCcD_Cyl() { -extern "C" void __dt__8dCcD_CylFv() { - // NONMATCHING -} - -/* 80BB69EC-80BB6A70 00022C 0084+00 1/1 0/0 0/0 .text __ct__8dCcD_CylFv */ -// dCcD_Cyl::dCcD_Cyl() { -extern "C" void __ct__8dCcD_CylFv() { - // NONMATCHING -} - -/* 80BB6A70-80BB6AB8 0002B0 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGCylFv */ -// cM3dGCyl::~cM3dGCyl() { -extern "C" void __dt__8cM3dGCylFv() { - // NONMATCHING -} - -/* 80BB6AB8-80BB6B00 0002F8 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGAabFv */ -// cM3dGAab::~cM3dGAab() { -extern "C" void __dt__8cM3dGAabFv() { - // NONMATCHING -} - -/* 80BB6B00-80BB6B5C 000340 005C+00 1/0 0/0 0/0 .text __dt__10dCcD_GSttsFv */ -// dCcD_GStts::~dCcD_GStts() { -extern "C" void __dt__10dCcD_GSttsFv() { - // NONMATCHING + mBgW = NULL; + mMode = MODE_0; + memset(mModels, 0, sizeof(mModels)); } /* 80BB6B5C-80BB6C4C 00039C 00F0+00 1/0 0/0 0/0 .text __dt__11daBkyRock_cFv */ daBkyRock_c::~daBkyRock_c() { - // NONMATCHING + dComIfG_resDelete(this, l_arcName); } /* 80BB6C4C-80BB6D60 00048C 0114+00 1/1 0/0 0/0 .text create__11daBkyRock_cFv */ -void daBkyRock_c::create() { - // NONMATCHING +int daBkyRock_c::create() { + fopAcM_SetupActor(this, daBkyRock_c); + u8 swBit0 = getSwBit0(); + if (fopAcM_isSwitch(this, swBit0)) { + return cPhs_ERROR_e; + } + int rv = dComIfG_resLoad(this, l_arcName); + if (rv == cPhs_COMPLEATE_e) { + if (fopAcM_entrySolidHeap( + this, daBkyRock_c_createHeap, 0x2000) == 0) { + return cPhs_ERROR_e; + } + if (getNameNo() == 1) { + if (dComIfG_Bgsp().Regist(mBgW, this) != 0) { + return cPhs_ERROR_e; + } + } + init(); + } + return rv; } /* 80BB6D60-80BB6D84 0005A0 0024+00 1/1 0/0 0/0 .text execute__11daBkyRock_cFv */ -void daBkyRock_c::execute() { - // NONMATCHING +int daBkyRock_c::execute() { + middleExe(); + return 1; } /* 80BB6D84-80BB6EB8 0005C4 0134+00 1/1 0/0 0/0 .text draw__11daBkyRock_cFv */ -void daBkyRock_c::draw() { - // NONMATCHING +int daBkyRock_c::draw() { + g_env_light.settingTevStruct( 0, + ¤t.pos, &tevStr); + g_env_light.setLightTevColorType_MAJI( + + mModels[mMode], &tevStr); + if (field_0x57a) { + dMdl_c* dMdl = dMdl_mng_c::entry(mModels[2]->getModelData(), NULL, current.roomNo); + if (dMdl != NULL) { + _pieceData* piece = mPieces; + for (int i = 0; i < 20; i++, piece++) { + mDoMtx_stack_c::transS(piece->position.x, piece->position.y, piece->position.z); + mDoMtx_stack_c::YrotM(piece->rotationX); + mDoMtx_stack_c::ZrotM(piece->rotationZ); + mDoMtx_stack_c::scaleM(piece->scale, piece->scale, piece->scale); + piece->mMdlObj.setMtx(mDoMtx_stack_c::get()); + dMdl->entryObj(&piece->mMdlObj); + } + } + } + if (mMode != MODE_2) { + mDoExt_modelUpdate(mModels[mMode]); + } + return 1; } /* 80BB6EB8-80BB6F64 0006F8 00AC+00 1/1 0/0 0/0 .text Delete__11daBkyRock_cFv */ -void daBkyRock_c::Delete() { - // NONMATCHING +int daBkyRock_c::Delete() { + if (dComIfGp_getVibration().CheckQuake()) { + dComIfGp_getVibration().StopQuake(0x1f); + } + if (getNameNo() == 1 && mBgW != NULL && mBgW->ChkUsed()) { + dComIfG_Bgsp().Release(mBgW); + } + this->~daBkyRock_c(); + return 1; } /* 80BB6F64-80BB6FD4 0007A4 0070+00 3/3 0/0 0/0 .text setModelMtx__11daBkyRock_cFv */ void daBkyRock_c::setModelMtx() { - // NONMATCHING + mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); + mDoMtx_stack_c::YrotM(shape_angle.y); + mModels[mMode]->setBaseTRMtx(mDoMtx_stack_c::get()); } -/* ############################################################################################## */ /* 80BB7EB0-80BB7EBC 000000 000C+00 8/8 0/0 0/0 .rodata VIBMODE_POWER */ -SECTION_RODATA static u8 const VIBMODE_POWER[12] = { - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, +static int const VIBMODE_POWER[3] = { + 2, 3, 3, }; -COMPILER_STRIP_GATE(0x80BB7EB0, &VIBMODE_POWER); /* 80BB7EBC-80BB7EC4 00000C 0008+00 0/1 0/0 0/0 .rodata PARTICLE_SCALE */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const PARTICLE_SCALE[8] = { - 0x00, 0x00, 0x06, 0xD6, 0x00, 0x00, 0x08, 0xE3, +static int const PARTICLE_SCALE[2] = { + 0x6D6, 0x8E3, }; -COMPILER_STRIP_GATE(0x80BB7EBC, &PARTICLE_SCALE); -#pragma pop /* 80BB7EC4-80BB7ECC 000014 0008+00 0/1 0/0 0/0 .rodata PARTICLE_OFFSET_POS_Y */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const PARTICLE_OFFSET_POS_Y[8] = { - 0x00, 0x00, 0x01, 0x68, 0x00, 0x00, 0x01, 0x2C, +static int const PARTICLE_OFFSET_POS_Y[2] = { + 0x168, 0x12C, }; -COMPILER_STRIP_GATE(0x80BB7EC4, &PARTICLE_OFFSET_POS_Y); -#pragma pop /* 80BB7ECC-80BB7ED4 00001C 0008+00 0/1 0/0 0/0 .rodata FIRST_PARTICLE_NAME */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const FIRST_PARTICLE_NAME[8] = { - 0x89, 0xC4, 0x89, 0xC5, 0x89, 0xC6, 0x89, 0xC7, +static u16 const FIRST_PARTICLE_NAME[4] = { + 0x89C4, 0x89C5, 0x89C6, 0x89C7, }; -COMPILER_STRIP_GATE(0x80BB7ECC, &FIRST_PARTICLE_NAME); -#pragma pop /* 80BB7ED4-80BB7EE0 000024 000C+00 0/1 0/0 0/0 .rodata SECOND_PARTICLE_NAME */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const SECOND_PARTICLE_NAME[12] = { - 0x89, 0xC2, 0x89, 0xC3, 0x89, 0xC4, 0x89, 0xC5, 0x89, 0xC6, 0x89, 0xC7, +static u16 const SECOND_PARTICLE_NAME[6] = { + 0x89C2, 0x89C3, 0x89C4, 0x89C5, 0x89C6, 0x89C7, }; -COMPILER_STRIP_GATE(0x80BB7ED4, &SECOND_PARTICLE_NAME); -#pragma pop /* 80BB7EE0-80BB7F24 000030 0044+00 0/1 0/0 0/0 .rodata s_CcDCyl__11daBkyRock_c */ -#pragma push -#pragma force_active on -SECTION_RODATA u8 const daBkyRock_c::s_CcDCyl[68] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x20, 0xA0, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +dCcD_SrcCyl const daBkyRock_c::s_CcDCyl = { + { + {0x0, {{0x0, 0x0, 0x0}, {0x20a0, 0x11}, 0x0}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x1}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {0.0f, 0.0f, 0.0f}, // mCenter + 0.0f, // mRadius + 0.0f // mHeight + } // mCyl }; -COMPILER_STRIP_GATE(0x80BB7EE0, &daBkyRock_c::s_CcDCyl); -#pragma pop /* 80BB7F24-80BB7F3C 000074 0018+00 1/1 0/0 0/0 .rodata BMD_IDX$3845 */ -SECTION_RODATA static u8 const BMD_IDX[24] = { - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x08, - 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08, +static int const BMD_IDX[2][3] = { + {4, 5, 8}, + {6, 7, 8}, }; -COMPILER_STRIP_GATE(0x80BB7F24, &BMD_IDX); /* 80BB6FD4-80BB7144 000814 0170+00 1/1 0/0 0/0 .text createHeap__11daBkyRock_cFv */ -void daBkyRock_c::createHeap() { - // NONMATCHING +int daBkyRock_c::createHeap() { + int nameNo = getNameNo(); + for (int i = 0; i < 3; i++) { + J3DModelData* a_model_data_p = + (J3DModelData*)dComIfG_getObjectRes(l_arcName, BMD_IDX[nameNo][i]); + JUT_ASSERT(481, a_model_data_p != 0); + mModels[i] = mDoExt_J3DModel__create(a_model_data_p, 0x80000, 0x11000084); + if (mModels[i] == NULL) { + return 0; + } + } + if (nameNo == 1) { + mBgW = new dBgW(); + if (mBgW == NULL) { + return 0; + } + mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); + mDoMtx_stack_c::YrotM(shape_angle.y); + MTXCopy(mDoMtx_stack_c::get(), mMtx); + cBgD_t* bgD = (cBgD_t*)dComIfG_getObjectRes(l_arcName, 11); + if (mBgW->Set(bgD, 1, &mMtx) == 1) { + return 0; + } + } + return 1; } /* ############################################################################################## */ /* 80BB7F3C-80BB7F6C 00008C 0030+00 0/1 0/0 0/0 .rodata COL_OFFSET_POS$3888 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const COL_OFFSET_POS[48] = { - 0xC2, 0xC8, 0x00, 0x00, 0xC3, 0x7A, 0x00, 0x00, 0xC2, 0xC8, 0x00, 0x00, 0x42, 0xC8, 0x00, 0x00, - 0xC3, 0x7A, 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, +static Vec const COL_OFFSET_POS[2][2] = { + {{-100.0f, -250.0f, -100.0f}, {100.0f, -250.0f, 0.0f}}, + {{0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}}, }; -COMPILER_STRIP_GATE(0x80BB7F3C, &COL_OFFSET_POS); -#pragma pop /* 80BB7F6C-80BB7F7C 0000BC 0010+00 0/1 0/0 0/0 .rodata COL_INIT_HEIGHT$3889 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const COL_INIT_HEIGHT[16] = { - 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x02, 0x8A, 0x00, 0x00, 0x03, 0x84, 0x00, 0x00, 0x03, 0x84, +static int const COL_INIT_HEIGHT[2][2] = { + {0x190, 0x28A}, {0x384, 0x384}, }; -COMPILER_STRIP_GATE(0x80BB7F6C, &COL_INIT_HEIGHT); -#pragma pop /* 80BB7F7C-80BB7F8C 0000CC 0010+00 0/1 0/0 0/0 .rodata COL_INIT_RADIUS$3890 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const COL_INIT_RADIUS[16] = { - 0x00, 0x00, 0x00, 0xFA, 0x00, 0x00, 0x02, 0x26, 0x00, 0x00, 0x02, 0x8A, 0x00, 0x00, 0x03, 0x20, +static int const COL_INIT_RADIUS[2][2] = { + 0xFA, 0x226, 0x28A, 0x320, }; -COMPILER_STRIP_GATE(0x80BB7F7C, &COL_INIT_RADIUS); -#pragma pop - -/* 80BB7F8C-80BB7F90 0000DC 0004+00 0/1 0/0 0/0 .rodata @3925 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3925 = 1.5f; -COMPILER_STRIP_GATE(0x80BB7F8C, &lit_3925); -#pragma pop - -/* 80BB7F90-80BB7F94 0000E0 0004+00 0/1 0/0 0/0 .rodata @3926 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3926 = -800.0f; -COMPILER_STRIP_GATE(0x80BB7F90, &lit_3926); -#pragma pop - -/* 80BB7F94-80BB7F98 0000E4 0004+00 0/1 0/0 0/0 .rodata @3927 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3927 = -500.0f; -COMPILER_STRIP_GATE(0x80BB7F94, &lit_3927); -#pragma pop - -/* 80BB7F98-80BB7F9C 0000E8 0004+00 0/2 0/0 0/0 .rodata @3928 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3928 = 800.0f; -COMPILER_STRIP_GATE(0x80BB7F98, &lit_3928); -#pragma pop - -/* 80BB7F9C-80BB7FA0 0000EC 0004+00 0/1 0/0 0/0 .rodata @3929 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3929 = 1000.0f; -COMPILER_STRIP_GATE(0x80BB7F9C, &lit_3929); -#pragma pop - -/* 80BB7FA0-80BB7FA8 0000F0 0008+00 0/3 0/0 0/0 .rodata @3931 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_3931[8] = { - 0x43, 0x30, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, -}; -COMPILER_STRIP_GATE(0x80BB7FA0, &lit_3931); -#pragma pop /* 80BB7144-80BB72FC 000984 01B8+00 1/1 0/0 0/0 .text init__11daBkyRock_cFv */ void daBkyRock_c::init() { - // NONMATCHING + mMode = MODE_0; + field_0x57a = false; + int nameNo = getNameNo(); + mStts.Init(0xff, 0, this); + for (int i = 0; i < 2; i++) { + mCyls[i].Set(s_CcDCyl); + mCyls[i].SetStts(&mStts); + cXyz cylCenter(current.pos.x + COL_OFFSET_POS[nameNo][i].x, + current.pos.y + COL_OFFSET_POS[nameNo][i].y, + current.pos.z + COL_OFFSET_POS[nameNo][i].z); + mCyls[i].SetC(cylCenter); + mCyls[i].SetH(COL_INIT_HEIGHT[nameNo][i]); + mCyls[i].SetR(COL_INIT_RADIUS[nameNo][i]); + } + mCyls[1].SetTgHitMark(CcG_Tg_UNK_MARK_9); + field_0x579 = false; + mVibrationTimer = 0; + setModelMtx(); + fopAcM_SetMtx(this, mModels[mMode]->getBaseTRMtx()); + fopAcM_setCullSizeFar(this, 1.5f); + fopAcM_setCullSizeBox(this, -800.0f, -500.0f, -800.0f, 800.0f, 1000.0f, 800.0f); } /* 80BB72FC-80BB7364 000B3C 0068+00 1/1 0/0 0/0 .text middleExe__11daBkyRock_cFv */ void daBkyRock_c::middleExe() { - // NONMATCHING + if (s_exeProc[mMode] != NULL) { + (this->*(s_exeProc[mMode]))(); + } } -/* ############################################################################################## */ -/* 80BB7FA8-80BB7FAC 0000F8 0004+00 0/5 0/0 0/0 .rodata @3961 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3961 = 1.0f; -COMPILER_STRIP_GATE(0x80BB7FA8, &lit_3961); -#pragma pop - -/* 80BB7FAC-80BB7FB0 0000FC 0004+00 0/2 0/0 0/0 .rodata @3962 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3962 = -1.0f; -COMPILER_STRIP_GATE(0x80BB7FAC, &lit_3962); -#pragma pop - /* 80BB7364-80BB7458 000BA4 00F4+00 1/0 0/0 0/0 .text exeModeNoDamage__11daBkyRock_cFv */ void daBkyRock_c::exeModeNoDamage() { - // NONMATCHING + if (chkHitBombArrow()) { + initChangeModeBefore(); + callBombEmt(4, FIRST_PARTICLE_NAME); + fopAcM_seStartCurrent(this, Z2SE_OBJ_BOMB_ROCK_BRK_WTR_1, 0); + mMode = MODE_1; + initChangeModeAfter(); + } + setModelMtx(); + for (int i = 0; i < 2; i++) { + dComIfG_Ccsp()->Set(&mCyls[i]); + } } /* 80BB7458-80BB75D8 000C98 0180+00 1/0 0/0 0/0 .text exeModeDamage__11daBkyRock_cFv */ void daBkyRock_c::exeModeDamage() { - // NONMATCHING + if (mVibrationTimer != 0) { + mVibrationTimer--; + if (mVibrationTimer <= 0) { + if (dComIfGp_getVibration().CheckQuake()) { + dComIfGp_getVibration().StopQuake(0x1f); + } + } + } + pieceMove(); + bool hitBombArrow = chkHitBombArrow(); + if (!hitBombArrow) { + field_0x579 = true; + } + if (hitBombArrow && field_0x579) { + initChangeModeBefore(); + callBombEmt(6, SECOND_PARTICLE_NAME); + fopAcM_seStartCurrent(this, Z2SE_OBJ_BOMB_ROCK_BRK_WTR_2, 0); + mMode = MODE_2; + u8 swBit0 = getSwBit0(); + fopAcM_onSwitch(this, swBit0); + initChangeModeAfter(); + } + setModelMtx(); + for (int i = 0; i < 2; i++) { + dComIfG_Ccsp()->Set(&mCyls[i]); + } } -/* ############################################################################################## */ -/* 80BB7FB0-80BB7FB4 000100 0004+00 0/3 0/0 0/0 .rodata @4018 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_4018[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x80BB7FB0, &lit_4018); -#pragma pop - /* 80BB75D8-80BB7690 000E18 00B8+00 1/0 0/0 0/0 .text exeModePiece__11daBkyRock_cFv */ void daBkyRock_c::exeModePiece() { - // NONMATCHING + pieceMove(); + if (mVibrationTimer != 0) { + if (!dComIfGp_getVibration().CheckQuake()) { + dComIfGp_getVibration().StartQuake(VIBMODE_POWER[mMode], 0x1f, + cXyz(0.0f, 1.0f, 0.0f)); + } + mVibrationTimer--; + if (mVibrationTimer <= 0) { + fopAcM_delete(this); + } + } } /* 80BB7690-80BB776C 000ED0 00DC+00 2/2 0/0 0/0 .text chkHitBombArrow__11daBkyRock_cFv */ -void daBkyRock_c::chkHitBombArrow() { - // NONMATCHING +bool daBkyRock_c::chkHitBombArrow() { + if (getNameNo() == 1) { + u8 swBit1 = getSwBit1(); + if (!fopAcM_isSwitch(this, swBit1)) { + return false; + } + } + for (int i = 0; i < 2; i++) { + if (i == 0 && mCyls[i].ChkTgHit()) { + cCcD_Obj* hitObj = mCyls[i].GetTgHitObj(); + if (hitObj != NULL && hitObj->ChkAtType(AT_TYPE_BOMB)) { + return 1; + } + mCyls[i].ClrTgHit(); + } + } + return 0; } /* ############################################################################################## */ /* 80BB7FB4-80BB7FBC 000104 0008+00 0/1 0/0 0/0 .rodata VIBMODE_TIMER$4051 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const VIBMODE_TIMER[8] = { - 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x28, +static int const VIBMODE_TIMER[2] = { + 30, 40, }; -COMPILER_STRIP_GATE(0x80BB7FB4, &VIBMODE_TIMER); -#pragma pop /* 80BB776C-80BB77FC 000FAC 0090+00 2/2 0/0 0/0 .text initChangeModeBefore__11daBkyRock_cFv */ void daBkyRock_c::initChangeModeBefore() { - // NONMATCHING + dComIfGp_getVibration().StartQuake(VIBMODE_POWER[mMode], 0x1f, cXyz(0.0f, 1.0f, 0.0f)); + mVibrationTimer = VIBMODE_TIMER[mMode]; + pieceMoveInit(); } /* 80BB77FC-80BB7818 00103C 001C+00 2/2 0/0 0/0 .text initChangeModeAfter__11daBkyRock_cFv */ void daBkyRock_c::initChangeModeAfter() { - // NONMATCHING + fopAcM_SetMtx(this, mModels[mMode]->getBaseTRMtx()); } -/* ############################################################################################## */ -/* 80BB7FBC-80BB7FC0 00010C 0004+00 0/1 0/0 0/0 .rodata @4086 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4086 = 150.0f; -COMPILER_STRIP_GATE(0x80BB7FBC, &lit_4086); -#pragma pop - -/* 80BB7FC0-80BB7FC4 000110 0004+00 0/1 0/0 0/0 .rodata @4087 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4087 = 1.0f / 10.0f; -COMPILER_STRIP_GATE(0x80BB7FC0, &lit_4087); -#pragma pop - -/* 80BB7FC4-80BB7FC8 000114 0004+00 0/1 0/0 0/0 .rodata @4088 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4088 = 15.0f; -COMPILER_STRIP_GATE(0x80BB7FC4, &lit_4088); -#pragma pop - -/* 80BB7FC8-80BB7FCC 000118 0004+00 0/1 0/0 0/0 .rodata @4089 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4089 = 2.0f; -COMPILER_STRIP_GATE(0x80BB7FC8, &lit_4089); -#pragma pop - -/* 80BB7FCC-80BB7FD0 00011C 0004+00 0/1 0/0 0/0 .rodata @4090 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4090 = 8.0f; -COMPILER_STRIP_GATE(0x80BB7FCC, &lit_4090); -#pragma pop - -/* 80BB7FD0-80BB7FD4 000120 0004+00 0/1 0/0 0/0 .rodata @4091 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4091 = 9.0f / 10.0f; -COMPILER_STRIP_GATE(0x80BB7FD0, &lit_4091); -#pragma pop - -/* 80BB7FD4-80BB7FD8 000124 0004+00 0/1 0/0 0/0 .rodata @4092 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4092 = 1.0f / 20.0f; -COMPILER_STRIP_GATE(0x80BB7FD4, &lit_4092); -#pragma pop - /* 80BB7818-80BB7988 001058 0170+00 2/2 0/0 0/0 .text pieceMove__11daBkyRock_cFv */ void daBkyRock_c::pieceMove() { - // NONMATCHING + if (field_0x57a) { + f32 dVar5 = current.pos.y; + if (fopAcM_wt_c::waterCheck(¤t.pos)) { + dVar5 = fopAcM_wt_c::getWaterY() - 150.0f; + } + field_0x57a = false; + _pieceData* piece = mPieces; + for (int i = 0; i < 20; i++, piece++) { + cLib_addCalc(&piece->position.x, piece->targetX, 0.1f, 15.0f, 2.0f); + cLib_addCalc(&piece->position.z, piece->targetZ, 0.1f, 15.0f, 2.0f); + piece->speedY -= 8.0f; + piece->position.y += piece->speedY; + if (piece->position.y > dVar5) { + field_0x57a = true; + } else { + piece->scale *= 0.9f; + if (piece->scale > 0.05f) { + field_0x57a = true; + } + } + // !@bug Passing an s16 pointer as a f32 pointer + cLib_addCalc((f32*)&piece->rotationSpeed, 0.0f, 0.1f, 15.0f, 2.0f); + piece->rotationX += piece->rotationSpeed; + piece->rotationZ += piece->rotationSpeed; + } + } } /* ############################################################################################## */ /* 80BB7FD8-80BB7FE0 000128 0008+00 0/1 0/0 0/0 .rodata DROP_OFFSET_POS$4096 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const DROP_OFFSET_POS[8] = { - 0x00, 0x00, 0x01, 0x5E, 0x00, 0x00, 0x0D, 0xAC, +static int const DROP_OFFSET_POS[2] = { + 0x015E, 0x0DAC, }; -COMPILER_STRIP_GATE(0x80BB7FD8, &DROP_OFFSET_POS); -#pragma pop /* 80BB7FE0-80BB7FE8 000130 0008+00 0/1 0/0 0/0 .rodata INIT_SPEED_Y_BASE$4097 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const INIT_SPEED_Y_BASE[8] = { - 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x28, +static int const INIT_SPEED_Y_BASE[2] = { + 20, 40, }; -COMPILER_STRIP_GATE(0x80BB7FE0, &INIT_SPEED_Y_BASE); -#pragma pop /* 80BB7FE8-80BB7FF0 000138 0008+00 0/1 0/0 0/0 .rodata INIT_SPEED_Y_RANGE$4098 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const INIT_SPEED_Y_RANGE[8] = { - 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x78, +static int const INIT_SPEED_Y_RANGE[2] = { + 60, 120, }; -COMPILER_STRIP_GATE(0x80BB7FE8, &INIT_SPEED_Y_RANGE); -#pragma pop /* 80BB7FF0-80BB7FF8 000140 0008+00 0/1 0/0 0/0 .rodata PIECE_SCALE_RANGE$4099 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const PIECE_SCALE_RANGE[8] = { - 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x23, +static int const PIECE_SCALE_RANGE[2] = { + 25, 35, }; -COMPILER_STRIP_GATE(0x80BB7FF0, &PIECE_SCALE_RANGE); -#pragma pop /* 80BB7FF8-80BB8000 000148 0008+00 0/1 0/0 0/0 .rodata PIECE_SCALE_BASE$4100 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const PIECE_SCALE_BASE[8] = { - 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x14, +static int const PIECE_SCALE_BASE[2] = { + 8, 20, }; -COMPILER_STRIP_GATE(0x80BB7FF8, &PIECE_SCALE_BASE); -#pragma pop - -/* 80BB8000-80BB8004 000150 0004+00 0/1 0/0 0/0 .rodata @4120 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4120 = 500.0f; -COMPILER_STRIP_GATE(0x80BB8000, &lit_4120); -#pragma pop - -/* 80BB8004-80BB8008 000154 0004+00 0/1 0/0 0/0 .rodata @4121 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4121 = 1.0f / 100.0f; -COMPILER_STRIP_GATE(0x80BB8004, &lit_4121); -#pragma pop - -/* 80BB8008-80BB800C 000158 0004+00 0/1 0/0 0/0 .rodata @4122 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4122 = 65535.0f; -COMPILER_STRIP_GATE(0x80BB8008, &lit_4122); -#pragma pop - -/* 80BB800C-80BB8010 00015C 0004+00 0/1 0/0 0/0 .rodata @4123 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_4123 = 4096.0f; -COMPILER_STRIP_GATE(0x80BB800C, &lit_4123); -#pragma pop /* 80BB7988-80BB7C18 0011C8 0290+00 1/1 0/0 0/0 .text pieceMoveInit__11daBkyRock_cFv */ void daBkyRock_c::pieceMoveInit() { - // NONMATCHING + int nameNo = getNameNo(); + field_0x57a = true; + f32 speedYBase = INIT_SPEED_Y_BASE[nameNo]; + f32 speedYRange = INIT_SPEED_Y_RANGE[nameNo]; + int mode = mMode; + _pieceData* piece = mPieces; + for (int i = 0; i < 20; i++, piece++) { + int local_84; + if ((i & 1) != 0) { + local_84 = 1; + } else { + local_84 = -1; + } + int local_88; + if ((i & 2) != 0) { + local_88 = 1; + } else { + local_88 = -1; + } + piece->position.x = current.pos.x + local_84 * cM_rndF(500.0f); + piece->position.y = current.pos.y + cM_rndF(500.0f); + piece->position.z = current.pos.z + local_88 * cM_rndF(500.0f); + f32 dropOffset = DROP_OFFSET_POS[nameNo] + cM_rndF(800.0f); + piece->targetX = current.pos.x + local_84 * dropOffset; + piece->targetZ = current.pos.z + local_88 * dropOffset; + piece->scale = 0.01f * (PIECE_SCALE_BASE[nameNo] + cM_rndF(PIECE_SCALE_RANGE[mode])); + piece->speedY = speedYBase + cM_rndF(speedYRange); + piece->rotationX = cM_rndF(65535.0f); + piece->rotationZ = cM_rndF(65535.0f); + piece->rotationSpeed = local_84 * ((s16)cM_rndF(4096.0f) + 0x2000); + } } -/* ############################################################################################## */ -/* 80BB8010-80BB8014 000160 0004+00 0/1 0/0 0/0 .rodata @4165 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u32 const lit_4165 = 0x3A83126F; -COMPILER_STRIP_GATE(0x80BB8010, &lit_4165); -#pragma pop - /* 80BB7C18-80BB7D50 001458 0138+00 2/2 0/0 0/0 .text callBombEmt__11daBkyRock_cFiPCUs */ -void daBkyRock_c::callBombEmt(int param_0, u16 const* param_1) { - // NONMATCHING +void daBkyRock_c::callBombEmt(int particleNum, u16 const* particleIds) { + int nameNo = getNameNo(); + cXyz pos(current.pos.x, current.pos.y - PARTICLE_OFFSET_POS_Y[nameNo], current.pos.z); + csXyz rotation(0, 0, 0); + f32 scale = PARTICLE_SCALE[nameNo] * 0.001f; + cXyz particleScale(scale, scale, scale); + for (int i = 0; i < particleNum; i++) { + dComIfGp_particle_set(particleIds[i], &pos, &rotation, &particleScale); + } } /* 80BB7D50-80BB7DA4 001590 0054+00 1/0 0/0 0/0 .text daBkyRock_create__FP11daBkyRock_c */ -static void daBkyRock_create(daBkyRock_c* param_0) { - // NONMATCHING +static int daBkyRock_create(daBkyRock_c* i_this) { + fopAcM_SetupActor(i_this, daBkyRock_c); + return i_this->create(); } /* 80BB7DA4-80BB7DC4 0015E4 0020+00 1/0 0/0 0/0 .text daBkyRock_Delete__FP11daBkyRock_c */ -static void daBkyRock_Delete(daBkyRock_c* param_0) { - // NONMATCHING +static int daBkyRock_Delete(daBkyRock_c* i_this) { + return i_this->Delete(); } /* 80BB7DC4-80BB7DE4 001604 0020+00 1/0 0/0 0/0 .text daBkyRock_execute__FP11daBkyRock_c */ -static void daBkyRock_execute(daBkyRock_c* param_0) { - // NONMATCHING +static int daBkyRock_execute(daBkyRock_c* i_this) { + return i_this->execute(); } /* 80BB7DE4-80BB7E04 001624 0020+00 1/0 0/0 0/0 .text daBkyRock_draw__FP11daBkyRock_c */ -static void daBkyRock_draw(daBkyRock_c* param_0) { - // NONMATCHING -} - -/* 80BB7E04-80BB7E4C 001644 0048+00 1/0 0/0 0/0 .text __dt__10cCcD_GSttsFv */ -// cCcD_GStts::~cCcD_GStts() { -extern "C" void __dt__10cCcD_GSttsFv() { - // NONMATCHING +static int daBkyRock_draw(daBkyRock_c* i_this) { + return i_this->draw(); } -/* 80BB7E4C-80BB7EA4 00168C 0058+00 0/0 1/0 0/0 .text __sinit_d_a_obj_bky_rock_cpp */ -void __sinit_d_a_obj_bky_rock_cpp() { - // NONMATCHING -} +/* 80BB8088-80BB80A8 -00001 0020+00 1/0 0/0 0/0 .data daBkyRock_METHODS */ +static actor_method_class daBkyRock_METHODS = { + (process_method_func)daBkyRock_create, + (process_method_func)daBkyRock_Delete, + (process_method_func)daBkyRock_execute, + NULL, + (process_method_func)daBkyRock_draw, +}; -#pragma push -#pragma force_active on -REGISTER_CTORS(0x80BB7E4C, __sinit_d_a_obj_bky_rock_cpp); -#pragma pop +/* 80BB80A8-80BB80D8 -00001 0030+00 0/0 0/0 1/0 .data g_profile_BkyRock */ +extern actor_process_profile_definition g_profile_BkyRock = { + fpcLy_CURRENT_e, // mLayerID + 7, // mListID + fpcPi_CURRENT_e, // mListPrio + PROC_BkyRock, // mProcName + &g_fpcLf_Method.base, // sub_method + sizeof(daBkyRock_c), // mSize + 0, // mSizeOther + 0, // mParameters + &g_fopAc_Method.base, // sub_method + 728, // mPriority + &daBkyRock_METHODS, // sub_method + 0x00044100, // mStatus + fopAc_ENV_e, // mActorType + fopAc_CULLBOX_CUSTOM_e, // cullType +}; /* 80BB8014-80BB8014 000164 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */