diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2024-03-07 19:23:18 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-07 20:23:18 -0700 |
| commit | ba4847e9cc2514fd722d45e54f7af87ee9de5bbd (patch) | |
| tree | b84de84c303d05af80777f79c7f0579c9b9fadb2 /rel | |
| parent | 22e941fd8c506a8b8ee0d963c5e50dae7ba379bc (diff) | |
d_a_shop_item, d_a_b_go, d_a_b_gos OK (#2085)
* d_a_shop_item OK
* d_a_b_go OK
* d_a_b_gos OK
* remove asm
* some work on d_a_b_oh / d_a_b_zant_sima
* d_a_startAndGoal done
Diffstat (limited to 'rel')
| -rw-r--r-- | rel/d/a/b/d_a_b_go/d_a_b_go.cpp | 879 | ||||
| -rw-r--r-- | rel/d/a/b/d_a_b_gos/d_a_b_gos.cpp | 1031 | ||||
| -rw-r--r-- | rel/d/a/b/d_a_b_oh/d_a_b_oh.cpp | 240 | ||||
| -rw-r--r-- | rel/d/a/b/d_a_b_oh/d_a_b_oh_NONMATCHING.cpp | 1226 | ||||
| -rw-r--r-- | rel/d/a/b/d_a_b_zant_sima/d_a_b_zant_sima.cpp | 231 | ||||
| -rw-r--r-- | rel/d/a/d_a_midna/d_a_midna.cpp | 11 | ||||
| -rw-r--r-- | rel/d/a/d_a_shop_item/d_a_shop_item.cpp | 812 | ||||
| -rw-r--r-- | rel/d/a/d_a_spinner/d_a_spinner.cpp | 2 | ||||
| -rw-r--r-- | rel/d/a/d_a_startAndGoal/Makefile | 1 | ||||
| -rw-r--r-- | rel/d/a/d_a_startAndGoal/d_a_startAndGoal.cpp | 516 |
10 files changed, 2489 insertions, 2460 deletions
diff --git a/rel/d/a/b/d_a_b_go/d_a_b_go.cpp b/rel/d/a/b/d_a_b_go/d_a_b_go.cpp index 629157d481..8287496f59 100644 --- a/rel/d/a/b/d_a_b_go/d_a_b_go.cpp +++ b/rel/d/a/b/d_a_b_go/d_a_b_go.cpp @@ -1,18 +1,13 @@ -// -// Generated By: dol2asm -// Translation Unit: d_a_b_go -// +/** + * d_a_b_go.cpp + * + */ #include "rel/d/a/b/d_a_b_go/d_a_b_go.h" -#include "Z2AudioLib/Z2Creature.h" +#include "SSystem/SComponent/c_math.h" #include "d/com/d_com_inf_game.h" -#include "dol2asm.h" -#include "dolphin/types.h" -#include "f_op/f_op_actor_mng.h" -// -// Types: -// +#define RES_IS_MODEL 0x13 enum daB_GO_ANM { /* 0x04 */ ANM_ATTACK = 4, @@ -36,14 +31,11 @@ enum daB_GO_Action { /* 0x2 */ ACT_ATTACK, }; -#define RES_IS_MODEL 0x13 - class daB_GO_HIO_c { public: /* 806031AC */ daB_GO_HIO_c(); - /* 80603F9C */ ~daB_GO_HIO_c(); + /* 80603F9C */ virtual ~daB_GO_HIO_c() {} - /* 0x00 */ u8 field_0x0[4]; /* 0x04 */ s8 field_0x4; /* 0x08 */ f32 mSmallSize; /* 0x0C */ f32 mNormalSpeed; @@ -51,805 +43,318 @@ public: /* 0x14 */ bool mDisplayModelImage; }; -class b_go_class : public fopAc_ac_c { -public: - /* 80603CA0 */ b_go_class(); - - // private: - /* 0x568 */ u8 field_0x568[0x5ac - 0x568]; - /* 0x5AC */ request_of_phase_process_class mPhase; - /* 0x5B4 */ mDoExt_McaMorfSO* mpMorf; - /* 0x5B8 */ Z2CreatureEnemy mZ2Enemy; - /* 0x65C */ int field_0x65c; - /* 0x660 */ u8 field_0x660; - /* 0x661 */ u8 field_0x661[0x668 - 0x661]; - /* 0x668 */ s16 field_0x668; - /* 0x66A */ s16 mActionID; - /* 0x66C */ s16 field_0x66c; - /* 0x66E */ u8 field_0x66e[0x67e - 0x66e]; - /* 0x67E */ s16 mAngleToPlayer; - /* 0x680 */ f32 mDistToPlayer; - /* 0x684 */ u8 field_0x684[4]; - /* 0x688 */ s16 field_0x688[4]; - /* 0x690 */ s16 field_0x690; - /* 0x692 */ s16 field_0x692; - /* 0x694 */ dBgS_AcchCir mAcchCir; - /* 0x6D4 */ dBgS_Acch mAcch; - /* 0x8AC */ dCcD_Stts mStts; - /* 0x8E8 */ dCcD_Sph field_0x8e8; - /* 0xA20 */ dCcD_Sph field_0xa20; - /* 0xB58 */ dCcD_Cyl field_0xb58; - /* 0xC94 */ u8 field_0xc94[0xc9c - 0xc94]; - /* 0xC9C */ Z2CreatureEnemy* field_0xc9c; - /* 0xCA0 */ u8 field_0xca0[0xcb8 - 0xca0]; - /* 0xCB8 */ u32 mGoronAcID[31]; - /* 0xD34 */ u8 field_0xd34; -}; - -// -// Forward References: -// - -extern "C" void __ct__12daB_GO_HIO_cFv(); -extern "C" static void daB_GO_Draw__FP10b_go_class(); -extern "C" static void anm_init__FP10b_go_classifUcf(); -extern "C" static void damage_check__FP10b_go_class(); -extern "C" static void h_wait__FP10b_go_class(); -extern "C" static void h_walk__FP10b_go_class(); -extern "C" static void h_attack__FP10b_go_class(); -extern "C" static void action__FP10b_go_class(); -extern "C" static void daB_GO_Execute__FP10b_go_class(); -extern "C" static bool daB_GO_IsDelete__FP10b_go_class(); -extern "C" static void daB_GO_Delete__FP10b_go_class(); -extern "C" static void useHeapInit__FP10fopAc_ac_c(); -extern "C" static void daB_GO_Create__FP10fopAc_ac_c(); -extern "C" void __ct__10b_go_classFv(); -extern "C" void __dt__8cM3dGCylFv(); -extern "C" void __dt__8cM3dGSphFv(); -extern "C" void __dt__8cM3dGAabFv(); -extern "C" void __dt__12dBgS_ObjAcchFv(); -extern "C" void __dt__12daB_GO_HIO_cFv(); -extern "C" void __sinit_d_a_b_go_cpp(); -extern "C" static void func_80604020(); -extern "C" static void func_80604028(); -extern "C" extern char const* const d_a_b_go__stringBase0; - -// -// External References: -// - -extern "C" void mDoMtx_YrotS__FPA4_fs(); -extern "C" void mDoMtx_YrotM__FPA4_fs(); -extern "C" void scaleM__14mDoMtx_stack_cFfff(); -extern "C" void -__ct__16mDoExt_McaMorfSOFP12J3DModelDataP25mDoExt_McaMorfCallBack1_cP25mDoExt_McaMorfCallBack2_cP15J3DAnmTransformifiiP10Z2CreatureUlUl(); -extern "C" void setAnm__16mDoExt_McaMorfSOFP15J3DAnmTransformiffff(); -extern "C" void play__16mDoExt_McaMorfSOFUlSc(); -extern "C" void entryDL__16mDoExt_McaMorfSOFv(); -extern "C" void modelCalc__16mDoExt_McaMorfSOFv(); -extern "C" void stopZelAnime__16mDoExt_McaMorfSOFv(); -extern "C" void __ct__10fopAc_ac_cFv(); -extern "C" void fopAcM_createChild__FsUiUlPC4cXyziPC5csXyzPC4cXyzScPFPv_i(); -extern "C" void fopAcM_entrySolidHeap__FP10fopAc_ac_cPFP10fopAc_ac_c_iUl(); -extern "C" void fopAcM_SetMin__FP10fopAc_ac_cfff(); -extern "C" void fopAcM_SetMax__FP10fopAc_ac_cfff(); -extern "C" void fopAcM_searchActorAngleY__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_searchActorDistance__FPC10fopAc_ac_cPC10fopAc_ac_c(); -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 getRes__14dRes_control_cFPCclP11dRes_info_ci(); -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 SetObj__16dBgS_PolyPassChkFv(); -extern "C" void __ct__10dCcD_GSttsFv(); -extern "C" void __ct__12dCcD_GObjInfFv(); -extern "C" void settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c(); -extern "C" void setLightTevColorType_MAJI__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c(); -extern "C" void __ct__5csXyzFsss(); -extern "C" void cM_rndF__Ff(); -extern "C" void cM_rndFX__Ff(); -extern "C" void cLib_addCalc2__FPffff(); -extern "C" void cLib_addCalc0__FPfff(); -extern "C" void cLib_addCalcAngleS2__FPssss(); -extern "C" void MtxPosition__FP4cXyzP4cXyz(); -extern "C" void __ct__15Z2CreatureEnemyFv(); -extern "C" void init__15Z2CreatureEnemyFP3VecP3VecUcUc(); -extern "C" void* __nw__FUl(); -extern "C" void __dl__FPv(); -extern "C" void _savegpr_27(); -extern "C" void _savegpr_28(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_27(); -extern "C" void _restgpr_28(); -extern "C" void _restgpr_29(); -extern "C" extern void* __vt__8dCcD_Sph[36]; -extern "C" extern void* __vt__8dCcD_Cyl[36]; -extern "C" extern void* __vt__9dCcD_Stts[11]; -extern "C" extern void* __vt__12cCcD_SphAttr[25]; -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" void __register_global_object(); - -// -// Declarations: -// - -/* ############################################################################################## */ -/* 80604044-80604048 000000 0004+00 6/6 0/0 0/0 .rodata @3646 */ -SECTION_RODATA static f32 const lit_3646 = 1.5f; -COMPILER_STRIP_GATE(0x80604044, &lit_3646); - -/* 80604048-8060404C 000004 0004+00 0/1 0/0 0/0 .rodata @3647 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3647 = 15.0f; -COMPILER_STRIP_GATE(0x80604048, &lit_3647); -#pragma pop - -/* 8060404C-80604050 000008 0004+00 0/3 0/0 0/0 .rodata @3648 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3648 = 300.0f; -COMPILER_STRIP_GATE(0x8060404C, &lit_3648); -#pragma pop - -/* 80604094-806040B4 -00001 0020+00 1/0 0/0 0/0 .data l_daB_GO_Method */ -SECTION_DATA static void* l_daB_GO_Method[8] = { - (void*)daB_GO_Create__FP10fopAc_ac_c, - (void*)daB_GO_Delete__FP10b_go_class, - (void*)daB_GO_Execute__FP10b_go_class, - (void*)daB_GO_IsDelete__FP10b_go_class, - (void*)daB_GO_Draw__FP10b_go_class, - (void*)NULL, - (void*)NULL, - (void*)NULL, -}; - -/* 806040B4-806040E4 -00001 0030+00 0/0 0/0 1/0 .data g_profile_B_GO */ -SECTION_DATA extern void* g_profile_B_GO[12] = { - (void*)0xFFFFFFFD, (void*)0x0007FFFD, - (void*)0x020F0000, (void*)&g_fpcLf_Method, - (void*)0x00000D38, (void*)NULL, - (void*)NULL, (void*)&g_fopAc_Method, - (void*)0x00D70000, (void*)&l_daB_GO_Method, - (void*)0x00040100, (void*)0x020E0000, -}; - -/* 806040E4-806040F0 000050 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, -}; - -/* 806040F0-806040FC 00005C 000C+00 2/2 0/0 0/0 .data __vt__8cM3dGSph */ -SECTION_DATA extern void* __vt__8cM3dGSph[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGSphFv, -}; - -/* 806040FC-80604108 000068 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, -}; - -/* 80604108-8060412C 000074 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_80604028, - (void*)NULL, - (void*)NULL, - (void*)func_80604020, -}; - -/* 8060412C-80604138 000098 000C+00 2/2 0/0 0/0 .data __vt__12daB_GO_HIO_c */ -SECTION_DATA extern void* __vt__12daB_GO_HIO_c[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__12daB_GO_HIO_cFv, -}; - /* 806031AC-806031EC 0000EC 0040+00 1/1 0/0 0/0 .text __ct__12daB_GO_HIO_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm daB_GO_HIO_c::daB_GO_HIO_c() { - nofralloc -#include "asm/rel/d/a/b/d_a_b_go/d_a_b_go/__ct__12daB_GO_HIO_cFv.s" +daB_GO_HIO_c::daB_GO_HIO_c() { + field_0x4 = -1; + mSmallSize = 1.5f; + mNormalSpeed = 15.0f; + mAttackInitRange = 300; + mDisplayModelImage = false; } -#pragma pop /* ############################################################################################## */ /* 80604140-80604144 000008 0004+00 2/2 0/0 0/0 .bss None */ -static u8 data_80604140[4]; - -/* 80604144-80604150 00000C 000C+00 1/1 0/0 0/0 .bss @3641 */ -static u8 lit_3641[12]; +static bool data_80604140; /* 80604150-80604168 000018 0018+00 6/6 0/0 0/0 .bss l_HIO */ -static u8 l_HIO[24]; +static daB_GO_HIO_c l_HIO; /* 806031EC-80603270 00012C 0084+00 1/0 0/0 0/0 .text daB_GO_Draw__FP10b_go_class */ -static int daB_GO_Draw(b_go_class* b_go) { - if ((*(daB_GO_HIO_c*)l_HIO).mDisplayModelImage) { - J3DModel* model = b_go->mpMorf->getModel(); +static int daB_GO_Draw(b_go_class* i_this) { + if (l_HIO.mDisplayModelImage) { + J3DModel* model = i_this->mpMorf->getModel(); - g_env_light.settingTevStruct(0, &b_go->current.pos, &b_go->tevStr); - g_env_light.setLightTevColorType_MAJI(model->getModelData(), &b_go->tevStr); - b_go->mpMorf->entryDL(); + g_env_light.settingTevStruct(0, &i_this->current.pos, &i_this->tevStr); + g_env_light.setLightTevColorType_MAJI(model->getModelData(), &i_this->tevStr); + i_this->mpMorf->entryDL(); } + return 1; } -/* ############################################################################################## */ -/* 80604050-80604054 00000C 0004+00 1/5 0/0 0/0 .rodata @3673 */ -SECTION_RODATA static u8 const lit_3673[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x80604050, &lit_3673); - -/* 80604054-80604058 000010 0004+00 1/1 0/0 0/0 .rodata @3674 */ -SECTION_RODATA static f32 const lit_3674 = -1.0f; -COMPILER_STRIP_GATE(0x80604054, &lit_3674); - -/* 8060408C-8060408C 000048 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_8060408C = "B_go"; -#pragma pop - /* 80603270-8060331C 0001B0 00AC+00 3/3 0/0 0/0 .text anm_init__FP10b_go_classifUcf */ -// matches with literals -#ifdef NONMATCHING -static void anm_init(b_go_class* b_go, int resID, f32 param_2, u8 param_3, f32 param_4) { - J3DAnmTransform* bck = (J3DAnmTransform*)dComIfG_getObjectRes("B_go", resID); - b_go->mpMorf->setAnm(bck, param_3, param_2, param_4, 0.0f, -1.0f); - b_go->field_0x65c = resID; +static void anm_init(b_go_class* i_this, int i_anmID, f32 i_morf, u8 i_attribute, f32 i_speed) { + J3DAnmTransform* bck = (J3DAnmTransform*)dComIfG_getObjectRes("B_go", i_anmID); + i_this->mpMorf->setAnm(bck, i_attribute, i_morf, i_speed, 0.0f, -1.0f); + i_this->mAnmID = i_anmID; } -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void anm_init(b_go_class* b_go, int resID, f32 param_2, u8 param_3, f32 param_4) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_go/d_a_b_go/anm_init__FP10b_go_classifUcf.s" -} -#pragma pop -#endif /* 8060331C-80603320 00025C 0004+00 1/1 0/0 0/0 .text damage_check__FP10b_go_class */ -static void damage_check(b_go_class* b_go) { - /* empty function */ -} - -/* ############################################################################################## */ -/* 80604058-8060405C 000014 0004+00 0/3 0/0 0/0 .rodata @3702 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3702 = 10.0f; -COMPILER_STRIP_GATE(0x80604058, &lit_3702); -#pragma pop - -/* 8060405C-80604060 000018 0004+00 1/4 0/0 0/0 .rodata @3703 */ -SECTION_RODATA static f32 const lit_3703 = 1.0f; -COMPILER_STRIP_GATE(0x8060405C, &lit_3703); - -/* 80604060-80604064 00001C 0004+00 0/3 0/0 0/0 .rodata @3704 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3704 = 100.0f; -COMPILER_STRIP_GATE(0x80604060, &lit_3704); -#pragma pop - -/* 80604064-80604068 000020 0004+00 0/2 0/0 0/0 .rodata @3705 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3705 = 60.0f; -COMPILER_STRIP_GATE(0x80604064, &lit_3705); -#pragma pop +static void damage_check(b_go_class* i_this) {} /* 80603320-806033F0 000260 00D0+00 1/1 0/0 0/0 .text h_wait__FP10b_go_class */ -// matches with literals -#ifdef NONMATCHING -static void h_wait(b_go_class* b_go) { - b_go->speedF = 0.0f; +static void h_wait(b_go_class* i_this) { + i_this->speedF = 0.0f; - switch (b_go->field_0x66c) { + switch (i_this->mMode) { case 0: - anm_init(b_go, ANM_WAIT_03, 10.0f, 2, 1.0f); - b_go->field_0x66c = 1; - b_go->field_0x688[0] = cM_rndF(60.0f) + 100.0f; + anm_init(i_this, ANM_WAIT_03, 10.0f, 2, 1.0f); + i_this->mMode = 1; + i_this->mTimers[0] = cM_rndF(60.0f) + 100.0f; break; case 1: - if (b_go->field_0x688[0] == 0 || - b_go->mDistToPlayer < (*(daB_GO_HIO_c*)l_HIO).mAttackInitRange) { - b_go->mActionID = ACT_WALK; - b_go->field_0x66c = 0; + if (i_this->mTimers[0] == 0 || i_this->mDistToPlayer < l_HIO.mAttackInitRange) { + i_this->mActionID = ACT_WALK; + i_this->mMode = 0; } break; } } -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void h_wait(b_go_class* param_0) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_go/d_a_b_go/h_wait__FP10b_go_class.s" -} -#pragma pop -#endif - -/* ############################################################################################## */ -/* 80604068-8060406C 000024 0004+00 0/1 0/0 0/0 .rodata @3719 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3719 = 150.0f; -COMPILER_STRIP_GATE(0x80604068, &lit_3719); -#pragma pop /* 806033F0-80603508 000330 0118+00 1/1 0/0 0/0 .text h_walk__FP10b_go_class */ -// matches with literals -#ifdef NONMATCHING -static void h_walk(b_go_class* b_go) { +static void h_walk(b_go_class* i_this) { f32 speed = 0.0f; - switch (b_go->field_0x66c) { + switch (i_this->mMode) { case 0: - anm_init(b_go, ANM_WALK, 10.0f, 2, 1.0f); - b_go->field_0x66c = 1; - b_go->field_0x688[0] = cM_rndF(60.0f) + 150.0f; + anm_init(i_this, ANM_WALK, 10.0f, 2, 1.0f); + i_this->mMode = 1; + i_this->mTimers[0] = cM_rndF(60.0f) + 150.0f; break; case 1: - speed = (*(daB_GO_HIO_c*)l_HIO).mNormalSpeed; - if (b_go->field_0x688[0] == 0) { - b_go->mActionID = ACT_WAIT; - b_go->field_0x66c = 0; - } else if (b_go->mDistToPlayer < (*(daB_GO_HIO_c*)l_HIO).mAttackInitRange) { - b_go->mActionID = ACT_ATTACK; - b_go->field_0x66c = 0; + speed = l_HIO.mNormalSpeed; + if (i_this->mTimers[0] == 0) { + i_this->mActionID = ACT_WAIT; + i_this->mMode = 0; + } else if (i_this->mDistToPlayer < l_HIO.mAttackInitRange) { + i_this->mActionID = ACT_ATTACK; + i_this->mMode = 0; } break; } - cLib_addCalc2(&b_go->speedF, speed, 1.0f, 1.0f); - cLib_addCalcAngleS2(&b_go->current.angle.y, b_go->mAngleToPlayer, 1, 0x200); + cLib_addCalc2(&i_this->speedF, speed, 1.0f, 1.0f); + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mAngleToPlayer, 1, 0x200); } -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void h_walk(b_go_class* param_0) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_go/d_a_b_go/h_walk__FP10b_go_class.s" -} -#pragma pop -#endif /* 80603508-80603638 000448 0130+00 1/1 0/0 0/0 .text h_attack__FP10b_go_class */ -#ifdef NONMATCHING -static void h_attack(b_go_class* b_go) { - int frame = b_go->mpMorf->getFrame(); - cLib_addCalc0(&b_go->speedF, 1.0f, 1.0f); +static void h_attack(b_go_class* i_this) { + int anm_frame = i_this->mpMorf->getFrame(); + cLib_addCalc0(&i_this->speedF, 1.0f, 1.0f); - switch (b_go->field_0x66c) { + switch (i_this->mMode) { case 0: - anm_init(b_go, ANM_ATTACK, 10.0f, 0, 1.0f); - b_go->field_0x66c = 1; + anm_init(i_this, ANM_ATTACK, 10.0f, 0, 1.0f); + i_this->mMode = 1; break; case 1: - if (frame >= 25 && frame <= 33) { - if (frame == 25) { - b_go->mZ2Enemy.startCreatureSound(Z2SE_CM_KAZAKIRI_S, 0, -1); - b_go->field_0x660 = 1; + if (anm_frame >= 25 && anm_frame <= 33) { + if (anm_frame == 25) { + i_this->mSound.startCreatureSound(Z2SE_CM_KAZAKIRI_S, 0, -1); + i_this->unk_0x660 = 1; } else { - b_go->field_0x660 = 2; + i_this->unk_0x660 = 2; } } - if (b_go->mpMorf->isStop()) { - b_go->mActionID = ACT_WAIT; - b_go->field_0x66c = 0; + if (i_this->mpMorf->isStop()) { + i_this->mActionID = ACT_WAIT; + i_this->mMode = 0; } break; } } -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void h_attack(b_go_class* param_0) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_go/d_a_b_go/h_attack__FP10b_go_class.s" -} -#pragma pop -#endif - -/* ############################################################################################## */ -/* 8060406C-80604070 000028 0004+00 0/1 0/0 0/0 .rodata @3784 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3784 = 1000.0f; -COMPILER_STRIP_GATE(0x8060406C, &lit_3784); -#pragma pop - -/* 80604070-80604074 00002C 0004+00 0/1 0/0 0/0 .rodata @3785 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3785 = 200.0f; -COMPILER_STRIP_GATE(0x80604070, &lit_3785); -#pragma pop /* 80603638-806037E8 000578 01B0+00 1/1 0/0 0/0 .text action__FP10b_go_class */ -#ifdef NONMATCHING -static void action(b_go_class* b_go) { - b_go->mAngleToPlayer = fopAcM_searchActorAngleY(b_go, (fopAc_ac_c*)dComIfGp_getPlayer(0)); - b_go->mDistToPlayer = fopAcM_searchActorDistance(b_go, (fopAc_ac_c*)dComIfGp_getPlayer(0)); - - b_go->actor_status = b_go->actor_status; - b_go->attention_info.flags = 0; - - if (b_go->field_0x688[1] == 0) { - if (b_go->field_0x692 != 2) { - b_go->field_0x692 = 2; - b_go->field_0x688[1] = cM_rndF(200.0f) + 1000.0f; +static void action(b_go_class* i_this) { + cXyz speed_offset; + cXyz move_speed; + + i_this->mAngleToPlayer = fopAcM_searchPlayerAngleY(i_this); + i_this->mDistToPlayer = fopAcM_searchPlayerDistance(i_this); + + fopAcM_OffStatus(i_this, 0); + i_this->attention_info.flags = 0; + + if (i_this->mTimers[1] == 0) { + if (i_this->field_0x692 != 2) { + i_this->field_0x692 = 2; + i_this->mTimers[1] = cM_rndF(200.0f) + 1000.0f; } else { - b_go->field_0x692 = 1; - b_go->field_0x688[1] = cM_rndF(100.0f) + 300.0f; + i_this->field_0x692 = 1; + i_this->mTimers[1] = cM_rndF(100.0f) + 300.0f; } } - switch (b_go->mActionID) { + switch (i_this->mActionID) { case ACT_WAIT: - h_wait(b_go); + h_wait(i_this); break; case ACT_WALK: - h_walk(b_go); + h_walk(i_this); break; case ACT_ATTACK: - h_attack(b_go); + h_attack(i_this); break; } - cLib_addCalcAngleS2(&b_go->shape_angle.y, b_go->current.angle.y, 4, 0x2000); - mDoMtx_stack_c::YrotS(b_go->current.angle.y); + cLib_addCalcAngleS2(&i_this->shape_angle.y, i_this->current.angle.y, 4, 0x2000); + cMtx_YrotS(*calc_mtx, i_this->current.angle.y); - cXyz speed; - speed.x = 0.0f; - speed.y = 0.0f; - speed.z = b_go->speedF; + speed_offset.x = 0.0f; + speed_offset.y = 0.0f; + speed_offset.z = i_this->speedF; - cXyz newSpeed; - MtxPosition(&speed, &newSpeed); - b_go->speed.x = newSpeed.x; - b_go->speed.z = newSpeed.z; + MtxPosition(&speed_offset, &move_speed); + i_this->speed.x = move_speed.x; + i_this->speed.z = move_speed.z; - VECAdd(&b_go->current.pos, &b_go->speed, &b_go->current.pos); - b_go->speed.y += b_go->gravity; + i_this->current.pos += i_this->speed; + i_this->speed.y += i_this->gravity; - b_go->mAcch.CrrPos(dComIfG_Bgsp()); -} -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void action(b_go_class* param_0) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_go/d_a_b_go/action__FP10b_go_class.s" + i_this->mAcch.CrrPos(dComIfG_Bgsp()); } -#pragma pop -#endif /* 806037E8-806038EC 000728 0104+00 2/1 0/0 0/0 .text daB_GO_Execute__FP10b_go_class */ -#ifdef NONMATCHING -static int daB_GO_Execute(b_go_class* b_go) { - b_go->field_0x668++; +static int daB_GO_Execute(b_go_class* i_this) { + i_this->unk_0x668++; for (int i = 0; i < 4; i++) { - if (b_go->field_0x688[i] != 0) { - b_go->field_0x688[i]--; + if (i_this->mTimers[i] != 0) { + i_this->mTimers[i]--; } } - if (b_go->field_0x690 != 0) { - b_go->field_0x690--; + if (i_this->unk_0x690 != 0) { + i_this->unk_0x690--; } - action(b_go); - damage_check(b_go); + action(i_this); + damage_check(i_this); + + mDoMtx_stack_c::transS(i_this->current.pos.x, i_this->current.pos.y, i_this->current.pos.z); + mDoMtx_stack_c::YrotM(i_this->shape_angle.y); + mDoMtx_stack_c::scaleM(l_HIO.mSmallSize, l_HIO.mSmallSize, l_HIO.mSmallSize); + i_this->mpMorf->getModel()->i_setBaseTRMtx(mDoMtx_stack_c::get()); - mDoMtx_stack_c::transS(b_go->current.pos.x, b_go->current.pos.y, b_go->current.pos.z); - mDoMtx_stack_c::YrotM(b_go->shape_angle.y); - mDoMtx_stack_c::scaleM((*(daB_GO_HIO_c*)l_HIO).mSmallSize, (*(daB_GO_HIO_c*)l_HIO).mSmallSize, (*(daB_GO_HIO_c*)l_HIO).mSmallSize); - mDoMtx_stack_c::copy(b_go->mpMorf->getModel()->getBaseTRMtx()); - b_go->mpMorf->play(0, dComIfGp_getReverb(b_go->current.roomNo)); - b_go->mpMorf->modelCalc(); + i_this->mpMorf->play(0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); + i_this->mpMorf->modelCalc(); return 1; } -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daB_GO_Execute(b_go_class* param_0) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_go/d_a_b_go/daB_GO_Execute__FP10b_go_class.s" -} -#pragma pop -#endif /* 806038EC-806038F4 00082C 0008+00 1/0 0/0 0/0 .text daB_GO_IsDelete__FP10b_go_class */ -static int daB_GO_IsDelete(b_go_class* param_0) { +static int daB_GO_IsDelete(b_go_class* i_this) { return 1; } /* 806038F4-8060395C 000834 0068+00 1/0 0/0 0/0 .text daB_GO_Delete__FP10b_go_class */ -static int daB_GO_Delete(b_go_class* b_go) { - dComIfG_resDelete(&b_go->mPhase, "B_go"); +static int daB_GO_Delete(b_go_class* i_this) { + dComIfG_resDelete(&i_this->mPhase, "B_go"); - if (b_go->field_0xd34) { - data_80604140[0] = 0; + if (i_this->field_0xd34) { + data_80604140 = 0; } - if (b_go->heap != NULL) { - b_go->mpMorf->stopZelAnime(); + if (i_this->heap != NULL) { + i_this->mpMorf->stopZelAnime(); } return 1; } /* 8060395C-80603A54 00089C 00F8+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */ -// matches with literals -#ifdef NONMATCHING -static int useHeapInit(fopAc_ac_c* i_actor) { - b_go_class* b_go = (b_go_class*)i_actor; - - b_go->mpMorf = new mDoExt_McaMorfSO((J3DModelData*)dComIfG_getObjectRes("B_go", RES_IS_MODEL), - NULL, NULL, - (J3DAnmTransform*)dComIfG_getObjectRes("B_go", ANM_WAIT_03), - 2, 1.0f, 0, -1, &b_go->mZ2Enemy, 0x80000, 0x11000084); - - if (b_go->mpMorf == NULL || b_go->mpMorf->getModel() == NULL) { +static int useHeapInit(fopAc_ac_c* i_this) { + b_go_class* a_this = (b_go_class*)i_this; + + a_this->mpMorf = new mDoExt_McaMorfSO( + (J3DModelData*)dComIfG_getObjectRes("B_go", RES_IS_MODEL), NULL, NULL, + (J3DAnmTransform*)dComIfG_getObjectRes("B_go", ANM_WAIT_03), J3DFrameCtrl::LOOP_REPEAT_e, + 1.0f, 0, -1, &a_this->mSound, 0x80000, 0x11000084); + + if (a_this->mpMorf == NULL || a_this->mpMorf->getModel() == NULL) { return 0; } return 1; } -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm int useHeapInit(fopAc_ac_c* param_0) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_go/d_a_b_go/useHeapInit__FP10fopAc_ac_c.s" -} -#pragma pop -#endif - -/* ############################################################################################## */ -/* 80604074-80604078 000030 0004+00 0/1 0/0 0/0 .rodata @3924 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3924 = -500.0f; -COMPILER_STRIP_GATE(0x80604074, &lit_3924); -#pragma pop - -/* 80604078-8060407C 000034 0004+00 0/1 0/0 0/0 .rodata @3925 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3925 = -2000.0f; -COMPILER_STRIP_GATE(0x80604078, &lit_3925); -#pragma pop - -/* 8060407C-80604080 000038 0004+00 0/1 0/0 0/0 .rodata @3926 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3926 = 500.0f; -COMPILER_STRIP_GATE(0x8060407C, &lit_3926); -#pragma pop - -/* 80604080-80604084 00003C 0004+00 0/1 0/0 0/0 .rodata @3927 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3927 = 2000.0f; -COMPILER_STRIP_GATE(0x80604080, &lit_3927); -#pragma pop - -/* 80604084-80604088 000040 0004+00 0/1 0/0 0/0 .rodata @3928 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3928 = -7.0f; -COMPILER_STRIP_GATE(0x80604084, &lit_3928); -#pragma pop - -/* 80604088-8060408C 000044 0004+00 0/1 0/0 0/0 .rodata @3929 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3929 = 65536.0f; -COMPILER_STRIP_GATE(0x80604088, &lit_3929); -#pragma pop /* 80603A54-80603CA0 000994 024C+00 1/0 0/0 0/0 .text daB_GO_Create__FP10fopAc_ac_c */ -// matches with literals -#ifdef NONMATCHING -static int daB_GO_Create(fopAc_ac_c* i_actor) { - fopAcM_SetupActor(i_actor, b_go_class); - b_go_class* b_go = (b_go_class*)i_actor; +static int daB_GO_Create(fopAc_ac_c* i_this) { + fopAcM_SetupActor(i_this, b_go_class); + b_go_class* a_this = (b_go_class*)i_this; - int phase_state = dComIfG_resLoad(&b_go->mPhase, "B_go"); + OS_REPORT("B_GO//////////////B_GO SET 0 !!\n"); + + int phase_state = dComIfG_resLoad(&a_this->mPhase, "B_go"); if (phase_state == cPhs_COMPLEATE_e) { - if (!fopAcM_entrySolidHeap(i_actor, (heapCallbackFunc)useHeapInit, 0x4B000)) { + OS_REPORT("B_GO PARAM %x\n", fopAcM_GetParam(a_this)); + OS_REPORT("B_GO//////////////B_GO SET 1 !!\n"); + + if (!fopAcM_entrySolidHeap(i_this, useHeapInit, 0x4B000)) { + OS_REPORT("//////////////B_GO SET NON !!\n"); return cPhs_ERROR_e; } - if (data_80604140[0] == 0) { - b_go->field_0xd34 = 1; - data_80604140[0] = 1; - (*(daB_GO_HIO_c*)l_HIO).field_0x4 = -1; - } + OS_REPORT("//////////////B_GO SET 2 !!\n"); - b_go->attention_info.flags = 4; - b_go->cullMtx = b_go->mpMorf->getModel()->getBaseTRMtx(); - fopAcM_SetMin(b_go, -500.0f, -2000.0f, -500.0f); - fopAcM_SetMax(b_go, 500.0f, 2000.0f, 500.0f); - b_go->field_0x562 = 1000; - b_go->field_0x560 = 1000; + if (data_80604140 == 0) { + a_this->field_0xd34 = 1; + data_80604140 = 1; + l_HIO.field_0x4 = -1; + } - b_go->mAcch.Set(&b_go->current.pos, &b_go->old.pos, b_go, 1, &b_go->mAcchCir, - &b_go->speed, NULL, NULL); - b_go->mAcchCir.SetWall(100.0f, 300.0f); + a_this->attention_info.flags = 4; + fopAcM_SetMtx(a_this, a_this->mpMorf->getModel()->getBaseTRMtx()); + fopAcM_SetMin(a_this, -500.0f, -2000.0f, -500.0f); + fopAcM_SetMax(a_this, 500.0f, 2000.0f, 500.0f); + a_this->health = 1000; + a_this->field_0x560 = 1000; - b_go->mZ2Enemy.init(&b_go->current.pos, &b_go->eyePos, 3, 1); - b_go->field_0xc9c = &b_go->mZ2Enemy; + a_this->mAcch.Set(fopAcM_GetPosition_p(a_this), fopAcM_GetOldPosition_p(a_this), a_this, 1, + &a_this->mAcchCir, fopAcM_GetSpeed_p(a_this), NULL, NULL); + a_this->mAcchCir.SetWall(100.0f, 300.0f); - b_go->gravity = -7.0f; - b_go->mActionID = ACT_WAIT; + a_this->mSound.init(&a_this->current.pos, &a_this->eyePos, 3, 1); + a_this->mAtInfo.mpSound = &a_this->mSound; - daB_GO_Execute(b_go); + a_this->gravity = -7.0f; + a_this->mActionID = ACT_WAIT; - cXyz pos; - pos.y = b_go->current.pos.y; + daB_GO_Execute(a_this); - csXyz angle(0, 0, 0); + cXyz child_pos; + child_pos.y = a_this->current.pos.y; - for (int i = 0; i < 31; i++) { - pos.x = cM_rndFX(500.0f) + b_go->current.pos.x; - pos.z = cM_rndFX(500.0f) + b_go->current.pos.z; - angle.y = cM_rndF(65536.0f); + csXyz child_angle(0, 0, 0); + for (int i = 0; i < GORON_CHILD_MAX; i++) { + child_pos.x = cM_rndFX(500.0f) + a_this->current.pos.x; + child_pos.z = cM_rndFX(500.0f) + a_this->current.pos.z; + child_angle.y = cM_rndF(0x10000); - b_go->mGoronAcID[i] = - fopAcM_createChild(PROC_B_GOS, fopAcM_GetID(b_go), i, &pos, fopAcM_GetRoomNo(b_go), - &angle, NULL, -1, NULL); + a_this->mGoronChildIDs[i] = + fopAcM_createChild(PROC_B_GOS, fopAcM_GetID(a_this), i, &child_pos, + fopAcM_GetRoomNo(a_this), &child_angle, NULL, -1, NULL); } } return phase_state; } -#else -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daB_GO_Create(fopAc_ac_c* param_0) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_go/d_a_b_go/daB_GO_Create__FP10fopAc_ac_c.s" -} -#pragma pop -#endif /* 80603CA0-80603E54 000BE0 01B4+00 1/1 0/0 0/0 .text __ct__10b_go_classFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm b_go_class::b_go_class() { - nofralloc -#include "asm/rel/d/a/b/d_a_b_go/d_a_b_go/__ct__10b_go_classFv.s" -} -#pragma pop - -/* 80603E54-80603E9C 000D94 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGCylFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -// asm cM3dGCyl::~cM3dGCyl() { -extern "C" asm void __dt__8cM3dGCylFv() { - nofralloc -#include "asm/rel/d/a/b/d_a_b_go/d_a_b_go/__dt__8cM3dGCylFv.s" -} -#pragma pop - -/* 80603E9C-80603EE4 000DDC 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGSphFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -// asm cM3dGSph::~cM3dGSph() { -extern "C" asm void __dt__8cM3dGSphFv() { - nofralloc -#include "asm/rel/d/a/b/d_a_b_go/d_a_b_go/__dt__8cM3dGSphFv.s" -} -#pragma pop - -/* 80603EE4-80603F2C 000E24 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGAabFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -// asm cM3dGAab::~cM3dGAab() { -extern "C" asm void __dt__8cM3dGAabFv() { - nofralloc -#include "asm/rel/d/a/b/d_a_b_go/d_a_b_go/__dt__8cM3dGAabFv.s" -} -#pragma pop - -/* 80603F2C-80603F9C 000E6C 0070+00 3/2 0/0 0/0 .text __dt__12dBgS_ObjAcchFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -// asm dBgS_ObjAcch::~dBgS_ObjAcch() { -extern "C" asm void __dt__12dBgS_ObjAcchFv() { - nofralloc -#include "asm/rel/d/a/b/d_a_b_go/d_a_b_go/__dt__12dBgS_ObjAcchFv.s" -} -#pragma pop - -/* 80603F9C-80603FE4 000EDC 0048+00 2/1 0/0 0/0 .text __dt__12daB_GO_HIO_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm daB_GO_HIO_c::~daB_GO_HIO_c() { - nofralloc -#include "asm/rel/d/a/b/d_a_b_go/d_a_b_go/__dt__12daB_GO_HIO_cFv.s" -} -#pragma pop - -/* 80603FE4-80604020 000F24 003C+00 0/0 1/0 0/0 .text __sinit_d_a_b_go_cpp */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void __sinit_d_a_b_go_cpp(){ - nofralloc -#include "asm/rel/d/a/b/d_a_b_go/d_a_b_go/__sinit_d_a_b_go_cpp.s" -} -#pragma pop - -#pragma push -#pragma force_active on -REGISTER_CTORS(0x80603FE4, __sinit_d_a_b_go_cpp); -#pragma pop - -/* 80604020-80604028 000F60 0008+00 1/0 0/0 0/0 .text @36@__dt__12dBgS_ObjAcchFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void func_80604020() { - nofralloc -#include "asm/rel/d/a/b/d_a_b_go/d_a_b_go/func_80604020.s" -} -#pragma pop - -/* 80604028-80604030 000F68 0008+00 1/0 0/0 0/0 .text @20@__dt__12dBgS_ObjAcchFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void func_80604028() { - nofralloc -#include "asm/rel/d/a/b/d_a_b_go/d_a_b_go/func_80604028.s" -} -#pragma pop +b_go_class::b_go_class() {} -/* 8060408C-8060408C 000048 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ +/* 80604094-806040B4 -00001 0020+00 1/0 0/0 0/0 .data l_daB_GO_Method */ +static actor_method_class l_daB_GO_Method = { + (process_method_func)daB_GO_Create, (process_method_func)daB_GO_Delete, + (process_method_func)daB_GO_Execute, (process_method_func)daB_GO_IsDelete, + (process_method_func)daB_GO_Draw, +}; + +/* 806040B4-806040E4 -00001 0030+00 0/0 0/0 1/0 .data g_profile_B_GO */ +extern actor_process_profile_definition g_profile_B_GO = { + fpcLy_CURRENT_e, + 7, + fpcPi_CURRENT_e, + PROC_B_GO, + &g_fpcLf_Method.mBase, + sizeof(b_go_class), + 0, + 0, + &g_fopAc_Method.base, + 215, + &l_daB_GO_Method, + 0x40100, + fopAc_ENEMY_e, + fopAc_CULLBOX_CUSTOM_e, +};
\ No newline at end of file diff --git a/rel/d/a/b/d_a_b_gos/d_a_b_gos.cpp b/rel/d/a/b/d_a_b_gos/d_a_b_gos.cpp index aafda4d771..ecab4e26aa 100644 --- a/rel/d/a/b/d_a_b_gos/d_a_b_gos.cpp +++ b/rel/d/a/b/d_a_b_gos/d_a_b_gos.cpp @@ -1,704 +1,451 @@ -// -// Generated By: dol2asm -// Translation Unit: d_a_b_gos -// +/** + * d_a_b_gos.cpp + * Combined Goron Child + */ #include "rel/d/a/b/d_a_b_gos/d_a_b_gos.h" -#include "d/cc/d_cc_d.h" -#include "dol2asm.h" - -// -// Types: -// - -struct request_of_phase_process_class {}; - -struct mDoMtx_stack_c { - /* 8000CD9C */ void transM(f32, f32, f32); - /* 8000CE38 */ void scaleM(f32, f32, f32); - - static u8 now[48]; -}; - -struct mDoExt_McaMorfCallBack2_c {}; - -struct mDoExt_McaMorfCallBack1_c {}; - -struct J3DAnmTransform {}; - -struct J3DModelData {}; - -struct Z2Creature {}; +#include "SSystem/SComponent/c_math.h" +#include "d/com/d_com_inf_game.h" +#include "rel/d/a/b/d_a_b_go/d_a_b_go.h" -struct mDoExt_McaMorfSO { - /* 800107D0 */ mDoExt_McaMorfSO(J3DModelData*, mDoExt_McaMorfCallBack1_c*, - mDoExt_McaMorfCallBack2_c*, J3DAnmTransform*, int, f32, int, - int, Z2Creature*, u32, u32); - /* 80010E70 */ void setAnm(J3DAnmTransform*, int, f32, f32, f32, f32); - /* 800110B0 */ void play(u32, s8); - /* 800111C0 */ void entryDL(); - /* 800111EC */ void modelCalc(); - /* 80011310 */ void stopZelAnime(); -}; - -struct fopAc_ac_c { - /* 80018B64 */ fopAc_ac_c(); -}; - -struct daB_GOS_HIO_c { +class daB_GOS_HIO_c { +public: /* 8060426C */ daB_GOS_HIO_c(); - /* 80605320 */ ~daB_GOS_HIO_c(); -}; - -struct dKy_tevstr_c {}; - -struct dScnKy_env_light_c { - /* 801A37C4 */ void settingTevStruct(int, cXyz*, dKy_tevstr_c*); - /* 801A4DA0 */ void setLightTevColorType_MAJI(J3DModelData*, dKy_tevstr_c*); -}; - -struct dRes_info_c {}; - -struct dRes_control_c { - /* 8003C2EC */ void getRes(char const*, s32, dRes_info_c*, int); -}; + /* 80605320 */ virtual ~daB_GOS_HIO_c() {} -struct dDlst_shadowControl_c { - static u8 mSimpleTexObj[32]; + /* 0x4 */ s8 field_0x4; + /* 0x8 */ f32 mSize; + /* 0xC */ f32 mNormalSpeed; }; -struct dBgS_PolyPassChk { - /* 80078E68 */ void SetObj(); +struct b_gos_j_info { + s16 joint_no; + f32 field_0x4; }; -struct dBgS_ObjAcch { - /* 806052B0 */ ~dBgS_ObjAcch(); -}; - -struct dBgS_AcchCir { - /* 80075EAC */ dBgS_AcchCir(); - /* 80075F58 */ void SetWall(f32, f32); -}; - -struct csXyz {}; - -struct dBgS {}; - -struct dBgS_Acch { - /* 80075F94 */ ~dBgS_Acch(); - /* 800760A0 */ dBgS_Acch(); - /* 80076248 */ void Set(cXyz*, cXyz*, fopAc_ac_c*, int, dBgS_AcchCir*, cXyz*, csXyz*, csXyz*); - /* 80076AAC */ void CrrPos(dBgS&); -}; - -struct cCcS { - /* 80264BA8 */ void Set(cCcD_Obj*); -}; - -struct cBgS_PolyInfo {}; - -struct b_gos_class { - /* 80605024 */ b_gos_class(); -}; - -struct _GXTexObj {}; - -struct Z2CreatureEnemy { - /* 802C0F64 */ Z2CreatureEnemy(); - /* 802C1094 */ void init(Vec*, Vec*, u8, u8); -}; - -struct J3DModel {}; - -// -// Forward References: -// - -extern "C" void __ct__13daB_GOS_HIO_cFv(); -extern "C" static void daB_GOS_Draw__FP11b_gos_class(); -extern "C" static void anm_init__FP11b_gos_classifUcf(); -extern "C" static void damage_check__FP11b_gos_class(); -extern "C" static void wait__FP11b_gos_class(); -extern "C" static void walk__FP11b_gos_class(); -extern "C" static void ball__FP11b_gos_class(); -extern "C" static void stick__FP11b_gos_class(); -extern "C" static void action__FP11b_gos_class(); -extern "C" static void daB_GOS_Execute__FP11b_gos_class(); -extern "C" static bool daB_GOS_IsDelete__FP11b_gos_class(); -extern "C" static void daB_GOS_Delete__FP11b_gos_class(); -extern "C" static void useHeapInit__FP10fopAc_ac_c(); -extern "C" static void daB_GOS_Create__FP10fopAc_ac_c(); -extern "C" void __ct__11b_gos_classFv(); -extern "C" void __dt__8cM3dGCylFv(); -extern "C" void __dt__8cM3dGSphFv(); -extern "C" void __dt__8cM3dGAabFv(); -extern "C" void __dt__12dBgS_ObjAcchFv(); -extern "C" void __dt__13daB_GOS_HIO_cFv(); -extern "C" void __sinit_d_a_b_gos_cpp(); -extern "C" static void func_806053A4(); -extern "C" static void func_806053AC(); -extern "C" extern char const* const d_a_b_gos__stringBase0; - -// -// External References: -// - -extern "C" void mDoMtx_XrotM__FPA4_fs(); -extern "C" void mDoMtx_YrotS__FPA4_fs(); -extern "C" void mDoMtx_YrotM__FPA4_fs(); -extern "C" void transM__14mDoMtx_stack_cFfff(); -extern "C" void scaleM__14mDoMtx_stack_cFfff(); -extern "C" void -__ct__16mDoExt_McaMorfSOFP12J3DModelDataP25mDoExt_McaMorfCallBack1_cP25mDoExt_McaMorfCallBack2_cP15J3DAnmTransformifiiP10Z2CreatureUlUl(); -extern "C" void setAnm__16mDoExt_McaMorfSOFP15J3DAnmTransformiffff(); -extern "C" void play__16mDoExt_McaMorfSOFUlSc(); -extern "C" void entryDL__16mDoExt_McaMorfSOFv(); -extern "C" void modelCalc__16mDoExt_McaMorfSOFv(); -extern "C" void stopZelAnime__16mDoExt_McaMorfSOFv(); -extern "C" void __ct__10fopAc_ac_cFv(); -extern "C" void fopAcIt_Judge__FPFPvPv_PvPv(); -extern "C" void fopAcM_entrySolidHeap__FP10fopAc_ac_cPFP10fopAc_ac_c_iUl(); -extern "C" void fopAcM_SetMin__FP10fopAc_ac_cfff(); -extern "C" void fopAcM_SetMax__FP10fopAc_ac_cfff(); -extern "C" void fopAcM_searchActorAngleY__FPC10fopAc_ac_cPC10fopAc_ac_c(); -extern "C" void fopAcM_searchActorDistance__FPC10fopAc_ac_cPC10fopAc_ac_c(); -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 getRes__14dRes_control_cFPCclP11dRes_info_ci(); -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 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 Set__8dCcD_CylFRC11dCcD_SrcCyl(); -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 __mi__4cXyzCFRC3Vec(); -extern "C" void __ml__4cXyzCFf(); -extern "C" void cM_rndF__Ff(); -extern "C" void SetC__8cM3dGCylFRC4cXyz(); -extern "C" void SetR__8cM3dGCylFf(); -extern "C" void cLib_addCalc2__FPffff(); -extern "C" void cLib_addCalc0__FPfff(); -extern "C" void cLib_addCalcAngleS2__FPssss(); -extern "C" void MtxPosition__FP4cXyzP4cXyz(); -extern "C" void __ct__15Z2CreatureEnemyFv(); -extern "C" void init__15Z2CreatureEnemyFP3VecP3VecUcUc(); -extern "C" void* __nw__FUl(); -extern "C" void __dl__FPv(); -extern "C" void PSMTXCopy(); -extern "C" void PSMTXTrans(); -extern "C" void _savegpr_27(); -extern "C" void _savegpr_28(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_27(); -extern "C" void _restgpr_28(); -extern "C" void _restgpr_29(); -extern "C" extern void* g_fopAc_Method[8]; -extern "C" extern void* g_fpcLf_Method[5 + 1 /* padding */]; -extern "C" extern void* __vt__8dCcD_Sph[36]; -extern "C" extern void* __vt__8dCcD_Cyl[36]; -extern "C" extern void* __vt__9dCcD_Stts[11]; -extern "C" extern void* __vt__12cCcD_SphAttr[25]; -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" extern u8 g_env_light[4880]; -extern "C" extern void* calc_mtx[1 + 1 /* padding */]; -extern "C" void __register_global_object(); - -// -// Declarations: -// - -/* ############################################################################################## */ -/* 806053C8-806053CC 000000 0004+00 9/9 0/0 0/0 .rodata @3646 */ -SECTION_RODATA static f32 const lit_3646 = 1.0f; -COMPILER_STRIP_GATE(0x806053C8, &lit_3646); - -/* 806053CC-806053D0 000004 0004+00 1/2 0/0 0/0 .rodata @3647 */ -SECTION_RODATA static f32 const lit_3647 = 10.0f; -COMPILER_STRIP_GATE(0x806053CC, &lit_3647); - /* 8060541C-80605514 000000 00F8+00 1/1 0/0 0/0 .data j_info */ -SECTION_DATA static u8 j_info[248] = { - 0x00, 0x0E, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, - 0x0F, 0x0D, 0x00, 0x00, 0x3E, 0xAA, 0x7E, 0xFA, 0x0F, 0x0D, 0x00, 0x00, 0x3F, 0x2A, 0x7E, 0xFA, - 0x00, 0x0F, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, - 0x03, 0x04, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, - 0x04, 0x05, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, - 0x00, 0x08, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x08, 0x09, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, - 0x00, 0x09, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x09, 0x0A, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, - 0x00, 0x0A, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, - 0x10, 0x11, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, - 0x11, 0x12, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, - 0x00, 0x13, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x13, 0x14, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, - 0x00, 0x14, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x14, 0x15, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, - 0x00, 0x15, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x03, 0x10, 0x00, 0x00, 0x3E, 0xAA, 0x7E, 0xFA, - 0x03, 0x10, 0x00, 0x00, 0x3F, 0x2A, 0x7E, 0xFA, 0x08, 0x13, 0x00, 0x00, 0x3E, 0xAA, 0x7E, 0xFA, - 0x08, 0x13, 0x00, 0x00, 0x3F, 0x2A, 0x7E, 0xFA, 0x0D, 0x03, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, - 0x0D, 0x08, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, -}; - -/* 80605514-80605558 0000F8 0044+00 1/1 0/0 0/0 .data cc_cyl_src$3915 */ -static dCcD_SrcCyl cc_cyl_src = { - { - {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj - {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt - {dCcD_SE_NONE, 0x5, 0x0, 0x0, 0x2}, // mGObjTg - {0x0}, // mGObjCo - }, // mObjInf - { - {0.0f, 0.0f, 0.0f}, // mCenter - 150.0f, // mRadius - 60.0f // mHeight - } // mCyl -}; - -/* 80605558-80605578 -00001 0020+00 1/0 0/0 0/0 .data l_daB_GOS_Method */ -SECTION_DATA static void* l_daB_GOS_Method[8] = { - (void*)daB_GOS_Create__FP10fopAc_ac_c, - (void*)daB_GOS_Delete__FP11b_gos_class, - (void*)daB_GOS_Execute__FP11b_gos_class, - (void*)daB_GOS_IsDelete__FP11b_gos_class, - (void*)daB_GOS_Draw__FP11b_gos_class, - (void*)NULL, - (void*)NULL, - (void*)NULL, -}; - -/* 80605578-806055A8 -00001 0030+00 0/0 0/0 1/0 .data g_profile_B_GOS */ -SECTION_DATA extern void* g_profile_B_GOS[12] = { - (void*)0xFFFFFFFD, (void*)0x0008FFFD, - (void*)0x02F10000, (void*)&g_fpcLf_Method, - (void*)0x00000CCC, (void*)NULL, - (void*)NULL, (void*)&g_fopAc_Method, - (void*)0x00D80000, (void*)&l_daB_GOS_Method, - (void*)0x00040100, (void*)0x020E0000, -}; - -/* 806055A8-806055B4 00018C 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, -}; - -/* 806055B4-806055C0 000198 000C+00 2/2 0/0 0/0 .data __vt__8cM3dGSph */ -SECTION_DATA extern void* __vt__8cM3dGSph[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__8cM3dGSphFv, -}; - -/* 806055C0-806055CC 0001A4 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, -}; - -/* 806055CC-806055F0 0001B0 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_806053AC, - (void*)NULL, - (void*)NULL, - (void*)func_806053A4, -}; - -/* 806055F0-806055FC 0001D4 000C+00 2/2 0/0 0/0 .data __vt__13daB_GOS_HIO_c */ -SECTION_DATA extern void* __vt__13daB_GOS_HIO_c[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__13daB_GOS_HIO_cFv, +static b_gos_j_info j_info[] = { + {0x000E, 1.0f}, {0x000D, 1.0f}, {0x0F0D, 0.333f}, {0x0F0D, 0.666f}, {0x000F, 1.0f}, + {0x0003, 1.0f}, {0x0304, 0.5f}, {0x0004, 1.0f}, {0x0405, 0.5f}, {0x0005, 1.0f}, + {0x0008, 1.0f}, {0x0809, 0.5f}, {0x0009, 1.0f}, {0x090A, 0.5f}, {0x000A, 1.0f}, + {0x0010, 1.0f}, {0x1011, 0.5f}, {0x0011, 1.0f}, {0x1112, 0.5f}, {0x0012, 1.0f}, + {0x0013, 1.0f}, {0x1314, 0.5f}, {0x0014, 1.0f}, {0x1415, 0.5f}, {0x0015, 1.0f}, + {0x0310, 0.333f}, {0x0310, 0.666f}, {0x0813, 0.333f}, {0x0813, 0.666f}, {0x0D03, 0.5f}, + {0x0D08, 0.5f}, }; /* 8060426C-8060429C 0000EC 0030+00 1/1 0/0 0/0 .text __ct__13daB_GOS_HIO_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm daB_GOS_HIO_c::daB_GOS_HIO_c() { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/__ct__13daB_GOS_HIO_cFv.s" +daB_GOS_HIO_c::daB_GOS_HIO_c() { + field_0x4 = -1; + mSize = 1.0f; + mNormalSpeed = 10.0f; } -#pragma pop - -/* ############################################################################################## */ -/* 806053D0-806053D4 000008 0004+00 0/2 0/0 0/0 .rodata @3674 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3674 = 50.0f; -COMPILER_STRIP_GATE(0x806053D0, &lit_3674); -#pragma pop - -/* 806053D4-806053D8 00000C 0004+00 0/1 0/0 0/0 .rodata @3675 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3675 = 800.0f; -COMPILER_STRIP_GATE(0x806053D4, &lit_3675); -#pragma pop - -/* 806053D8-806053DC 000010 0004+00 2/7 0/0 0/0 .rodata @3676 */ -SECTION_RODATA static u8 const lit_3676[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x806053D8, &lit_3676); /* 8060429C-80604370 00011C 00D4+00 1/0 0/0 0/0 .text daB_GOS_Draw__FP11b_gos_class */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daB_GOS_Draw(b_gos_class* param_0) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/daB_GOS_Draw__FP11b_gos_class.s" +static int daB_GOS_Draw(b_gos_class* i_this) { + J3DModel* model = i_this->mpMorf->getModel(); + + g_env_light.settingTevStruct(0, &i_this->current.pos, &i_this->tevStr); + g_env_light.setLightTevColorType_MAJI(model->getModelData(), &i_this->tevStr); + i_this->mpMorf->entryDL(); + + cXyz sp28; + sp28.set(i_this->current.pos.x, i_this->current.pos.y + 50.0f, i_this->current.pos.z); + i_this->mShadowKey = + dComIfGd_setShadow(i_this->mShadowKey, 1, model, &sp28, 800.0f, 0.0f, i_this->current.pos.y, + i_this->mAcch.GetGroundH(), i_this->mAcch.m_gnd, &i_this->tevStr, 0, + 1.0f, dDlst_shadowControl_c::getSimpleTex()); + return 1; } -#pragma pop - -/* ############################################################################################## */ -/* 806053DC-806053E0 000014 0004+00 1/1 0/0 0/0 .rodata @3684 */ -SECTION_RODATA static f32 const lit_3684 = -1.0f; -COMPILER_STRIP_GATE(0x806053DC, &lit_3684); - -/* 80605414-80605414 00004C 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_80605414 = "B_gos"; -#pragma pop /* 80604370-8060441C 0001F0 00AC+00 3/3 0/0 0/0 .text anm_init__FP11b_gos_classifUcf */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void anm_init(b_gos_class* param_0, int param_1, f32 param_2, u8 param_3, f32 param_4) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/anm_init__FP11b_gos_classifUcf.s" +static void anm_init(b_gos_class* i_this, int i_anmID, f32 i_morf, u8 i_attribute, f32 i_speed) { + J3DAnmTransform* bck = (J3DAnmTransform*)dComIfG_getObjectRes("B_gos", i_anmID); + i_this->mpMorf->setAnm(bck, i_attribute, i_morf, i_speed, 0.0f, -1.0f); + i_this->mAnmID = i_anmID; } -#pragma pop /* 8060441C-80604420 00029C 0004+00 1/1 0/0 0/0 .text damage_check__FP11b_gos_class */ -static void damage_check(b_gos_class* param_0) { - /* empty function */ -} - -/* ############################################################################################## */ -/* 806053E0-806053E4 000018 0004+00 0/4 0/0 0/0 .rodata @3699 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3699 = 5.0f; -COMPILER_STRIP_GATE(0x806053E0, &lit_3699); -#pragma pop - -/* 806053E4-806053E8 00001C 0004+00 0/2 0/0 0/0 .rodata @3700 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3700 = 30.0f; -COMPILER_STRIP_GATE(0x806053E4, &lit_3700); -#pragma pop +static void damage_check(b_gos_class* i_this) {} /* 80604420-806044D8 0002A0 00B8+00 1/1 0/0 0/0 .text wait__FP11b_gos_class */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void wait(b_gos_class* param_0) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/wait__FP11b_gos_class.s" +static void wait(b_gos_class* i_this) { + i_this->speedF = 0.0f; + + switch (i_this->mMode) { + case 0: + anm_init(i_this, 6, 5.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + i_this->mMode = 1; + i_this->mTimers[0] = cM_rndF(30) + 30.0f; + break; + case 1: + if (i_this->mTimers[0] == 0) { + i_this->mAction = 1; + i_this->mMode = 0; + } + break; + } } -#pragma pop - -/* ############################################################################################## */ -/* 806053E8-806053EC 000020 0004+00 1/3 0/0 0/0 .rodata @3711 */ -SECTION_RODATA static f32 const lit_3711 = 60.0f; -COMPILER_STRIP_GATE(0x806053E8, &lit_3711); - -/* 806053EC-806053F0 000024 0004+00 0/2 0/0 0/0 .rodata @3712 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3712 = 65536.0f; -COMPILER_STRIP_GATE(0x806053EC, &lit_3712); -#pragma pop /* 80605608-8060560C 000008 0004+00 3/3 0/0 0/0 .bss boss */ -static u8 boss[4]; +static b_go_class* boss; /* 8060560C-80605610 00000C 0004+00 2/2 0/0 0/0 .bss None */ -static u8 data_8060560C[4]; - -/* 80605610-8060561C 000010 000C+00 1/1 0/0 0/0 .bss @3641 */ -static u8 lit_3641[12]; +static u8 data_8060560C; /* 8060561C-8060562C 00001C 0010+00 5/5 0/0 0/0 .bss l_HIO */ -static u8 l_HIO[16]; +static daB_GOS_HIO_c l_HIO; /* 806044D8-806045E4 000358 010C+00 1/1 0/0 0/0 .text walk__FP11b_gos_class */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void walk(b_gos_class* param_0) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/walk__FP11b_gos_class.s" +static void walk(b_gos_class* i_this) { + f32 speed = 0.0f; + + switch (i_this->mMode) { + case 0: + anm_init(i_this, 4, 5.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f); + i_this->mMode = 1; + i_this->mTimers[0] = cM_rndF(60) + 60.0f; + i_this->mWalkDirection = cM_rndF(0x10000); + break; + case 1: + speed = l_HIO.mNormalSpeed; + if (i_this->mTimers[0] == 0) { + i_this->mAction = 0; + i_this->mMode = 0; + } + break; + } + + cLib_addCalc2(&i_this->speedF, speed, 1.0f, 1.0f); + cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->mWalkDirection, 1, 0x800); } -#pragma pop - -/* ############################################################################################## */ -/* 806053F0-806053F4 000028 0004+00 0/1 0/0 0/0 .rodata @3727 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3727 = 20.0f; -COMPILER_STRIP_GATE(0x806053F0, &lit_3727); -#pragma pop /* 806045E4-806046E0 000464 00FC+00 1/1 0/0 0/0 .text ball__FP11b_gos_class */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void ball(b_gos_class* param_0) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/ball__FP11b_gos_class.s" +static void ball(b_gos_class* i_this) { + switch (i_this->mMode) { + case 0: + i_this->mTimers[0] = cM_rndF(20); + i_this->mMode = 1; + // fallthrough + case 1: + if (i_this->mTimers[0] == 0) { + anm_init(i_this, 5, 5.0f, J3DFrameCtrl::LOOP_ONCE_e, 1.0f); + i_this->mMode = 2; + i_this->mTimers[0] = cM_rndF(30) + 60.0f; + } + break; + case 2: + if (i_this->mTimers[0] == 0) { + i_this->mAction = 3; + i_this->mMode = 0; + } + break; + } + + cLib_addCalc0(&i_this->speedF, 1.0f, 1.0f); } -#pragma pop - -/* ############################################################################################## */ -/* 806053F4-806053F8 00002C 0004+00 0/2 0/0 0/0 .rodata @3774 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3774 = 200.0f; -COMPILER_STRIP_GATE(0x806053F4, &lit_3774); -#pragma pop /* 806046E0-806048E0 000560 0200+00 1/1 0/0 0/0 .text stick__FP11b_gos_class */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void stick(b_gos_class* param_0) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/stick__FP11b_gos_class.s" +static void stick(b_gos_class* i_this) { + cXyz offset; + cXyz move_pos; + + switch (i_this->mMode) { + case 0: + i_this->mMode = 1; + i_this->speedF = 0.0f; + i_this->mAngleOffset = cM_rndF(0x10000); + break; + case 1: + break; + } + + cLib_addCalc2(&i_this->speedF, 200, 1, 1); + + J3DModel* boss_model = boss->mpMorf->getModel(); + MTXCopy(boss_model->i_getAnmMtx(j_info[i_this->mJointIndex].joint_no & 0xFF), *calc_mtx); + + offset.x = 0.0f; + offset.y = 0.0f; + offset.z = 0.0f; + MtxPosition(&offset, &move_pos); + + if (j_info[i_this->mJointIndex].field_0x4 < 1.0f) { + cXyz sp60; + MTXCopy(boss_model->i_getAnmMtx((j_info[i_this->mJointIndex].joint_no >> 8) & 0xFF), + *calc_mtx); + + offset.x = 0.0f; + offset.y = 0.0f; + offset.z = 0.0f; + MtxPosition(&offset, &sp60); + + move_pos += (sp60 - move_pos) * j_info[i_this->mJointIndex].field_0x4; + } + + cLib_addCalc2(&i_this->current.pos.x, move_pos.x, 1.0f, i_this->speedF); + cLib_addCalc2(&i_this->current.pos.y, move_pos.y, 1.0f, i_this->speedF); + cLib_addCalc2(&i_this->current.pos.z, move_pos.z, 1.0f, i_this->speedF); + cLib_addCalcAngleS2(&i_this->current.angle.y, boss->shape_angle.y + i_this->mAngleOffset, 1, + 0x400); } -#pragma pop - -/* ############################################################################################## */ -/* 806053F8-806053FC 000030 0004+00 0/1 0/0 0/0 .rodata @3827 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3827 = 0.5f; -COMPILER_STRIP_GATE(0x806053F8, &lit_3827); -#pragma pop - -/* 806053FC-80605400 000034 0004+00 0/1 0/0 0/0 .rodata @3828 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3828 = -60.0f; -COMPILER_STRIP_GATE(0x806053FC, &lit_3828); -#pragma pop - -/* 80605400-80605404 000038 0004+00 0/1 0/0 0/0 .rodata @3829 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3829 = 2.0f; -COMPILER_STRIP_GATE(0x80605400, &lit_3829); -#pragma pop - -/* 80605404-80605408 00003C 0004+00 0/1 0/0 0/0 .rodata @3830 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3830 = -30.0f; -COMPILER_STRIP_GATE(0x80605404, &lit_3830); -#pragma pop - -/* 80605408-8060540C 000040 0004+00 0/1 0/0 0/0 .rodata @3831 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3831 = 2.5f; -COMPILER_STRIP_GATE(0x80605408, &lit_3831); -#pragma pop /* 806048E0-80604B7C 000760 029C+00 1/1 0/0 0/0 .text action__FP11b_gos_class */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void action(b_gos_class* param_0) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/action__FP11b_gos_class.s" +static void action(b_gos_class* i_this) { + u8 var_r29; + bool on_cyl_co; + bool update_pos; + + cXyz speed_offset; + cXyz move_speed; + + i_this->mAngleToPlayer = fopAcM_searchPlayerAngleY(i_this); + i_this->mDistToPlayer = fopAcM_searchPlayerDistance(i_this); + + fopAcM_OffStatus(i_this, 0); + i_this->attention_info.flags = 0; + + on_cyl_co = true; + update_pos = true; + var_r29 = 0; + + switch (i_this->mAction) { + case 0: + wait(i_this); + break; + case 1: + walk(i_this); + break; + case 2: + ball(i_this); + var_r29 = 1; + break; + case 3: + stick(i_this); + on_cyl_co = false; + update_pos = false; + var_r29 = 2; + break; + } + + if (on_cyl_co) { + i_this->mCyl.OnCoSetBit(); + cXyz* cc_move = i_this->mCcStts.GetCCMoveP(); + + if (cc_move != NULL) { + i_this->current.pos += *cc_move * 0.5f; + } + } else { + i_this->mCyl.OffCoSetBit(); + } + + cLib_addCalcAngleS2(&i_this->shape_angle.y, i_this->current.angle.y, 2, 0x2000); + + if (update_pos == true) { + cMtx_YrotS(*calc_mtx, i_this->current.angle.y); + + speed_offset.x = 0.0f; + speed_offset.y = 0.0f; + speed_offset.z = i_this->speedF * l_HIO.mSize; + + MtxPosition(&speed_offset, &move_speed); + i_this->speed.x = move_speed.x; + i_this->speed.z = move_speed.z; + + i_this->current.pos += i_this->speed; + i_this->speed.y += i_this->gravity; + + i_this->mAcch.CrrPos(dComIfG_Bgsp()); + } + + if (var_r29 != 0) { + if (var_r29 == 2) { + cLib_addCalc2(&i_this->field_0x698, -60, 1, 2); + cLib_addCalc2(&i_this->field_0x69c, -30, 1, 1); + } + + if (boss->field_0x692 == 1) { + i_this->mAction = 0; + i_this->mMode = 0; + i_this->speedF = cM_rndF(10); + i_this->speed.y = cM_rndF(10); + } + } else { + cLib_addCalc0(&i_this->field_0x698, 1.0f, 5.0f); + cLib_addCalc0(&i_this->field_0x69c, 1.0f, 2.5f); + + if (boss->field_0x692 == 2) { + i_this->mAction = 2; + i_this->mMode = 0; + i_this->speedF = 0.0f; + } + } } -#pragma pop /* 80604B7C-80604CF4 0009FC 0178+00 2/1 0/0 0/0 .text daB_GOS_Execute__FP11b_gos_class */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daB_GOS_Execute(b_gos_class* param_0) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/daB_GOS_Execute__FP11b_gos_class.s" +static int daB_GOS_Execute(b_gos_class* i_this) { + i_this->field_0x66c++; + + boss = (b_go_class*)fopAcM_SearchByID(i_this->parentActorID); + + for (int i = 0; i < 4; i++) { + if (i_this->mTimers[i] != 0) { + i_this->mTimers[i]--; + } + } + + if (i_this->field_0x694 != 0) { + i_this->field_0x694--; + } + + action(i_this); + damage_check(i_this); + + mDoMtx_stack_c::transS(i_this->current.pos.x, i_this->current.pos.y, i_this->current.pos.z); + mDoMtx_stack_c::YrotM(i_this->shape_angle.y); + mDoMtx_stack_c::XrotM(i_this->shape_angle.x); + mDoMtx_stack_c::scaleM(l_HIO.mSize, l_HIO.mSize, l_HIO.mSize); + mDoMtx_stack_c::transM(0.0f, i_this->field_0x698, i_this->field_0x69c); + i_this->mpMorf->getModel()->i_setBaseTRMtx(mDoMtx_stack_c::get()); + + i_this->mpMorf->play(0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); + i_this->mpMorf->modelCalc(); + + i_this->mCyl.SetR(60.0f); + i_this->mCyl.SetC(i_this->current.pos); + dComIfG_Ccsp()->Set(&i_this->mCyl); + return 1; } -#pragma pop /* 80604CF4-80604CFC 000B74 0008+00 1/0 0/0 0/0 .text daB_GOS_IsDelete__FP11b_gos_class */ -static bool daB_GOS_IsDelete(b_gos_class* param_0) { - return true; +static int daB_GOS_IsDelete(b_gos_class* i_this) { + return 1; } /* 80604CFC-80604D64 000B7C 0068+00 1/0 0/0 0/0 .text daB_GOS_Delete__FP11b_gos_class */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daB_GOS_Delete(b_gos_class* param_0) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/daB_GOS_Delete__FP11b_gos_class.s" +static int daB_GOS_Delete(b_gos_class* i_this) { + dComIfG_resDelete(&i_this->mPhase, "B_gos"); + + if (i_this->field_0xcc8) { + data_8060560C = 0; + } + + if (i_this->heap != NULL) { + i_this->mpMorf->stopZelAnime(); + } + + return 1; } -#pragma pop /* 80604D64-80604E5C 000BE4 00F8+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void useHeapInit(fopAc_ac_c* param_0) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/useHeapInit__FP10fopAc_ac_c.s" +static int useHeapInit(fopAc_ac_c* i_this) { + b_gos_class* a_this = (b_gos_class*)i_this; + + a_this->mpMorf = new mDoExt_McaMorfSO((J3DModelData*)dComIfG_getObjectRes("B_gos", 9), NULL, + NULL, (J3DAnmTransform*)dComIfG_getObjectRes("B_gos", 6), + J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, -1, &a_this->mSound, + 0x80000, 0x11000084); + + if (a_this->mpMorf == NULL || a_this->mpMorf->getModel() == NULL) { + return false; + } + + return true; } -#pragma pop - -/* ############################################################################################## */ -/* 8060540C-80605410 000044 0004+00 0/1 0/0 0/0 .rodata @3953 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3953 = -200.0f; -COMPILER_STRIP_GATE(0x8060540C, &lit_3953); -#pragma pop - -/* 80605410-80605414 000048 0004+00 0/1 0/0 0/0 .rodata @3954 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3954 = -7.0f; -COMPILER_STRIP_GATE(0x80605410, &lit_3954); -#pragma pop /* 80604E5C-80605024 000CDC 01C8+00 1/0 0/0 0/0 .text daB_GOS_Create__FP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daB_GOS_Create(fopAc_ac_c* param_0) { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/daB_GOS_Create__FP10fopAc_ac_c.s" +static int daB_GOS_Create(fopAc_ac_c* i_this) { + fopAcM_SetupActor(i_this, b_gos_class); + b_gos_class* a_this = (b_gos_class*)i_this; + + OS_REPORT("B_GOS//////////////B_GOS SET 0 !!\n"); + + int phase_state = dComIfG_resLoad(&a_this->mPhase, "B_gos"); + if (phase_state == cPhs_COMPLEATE_e) { + OS_REPORT("B_GOS PARAM %x\n", fopAcM_GetParam(a_this)); + a_this->mJointIndex = fopAcM_GetParam(a_this) & 0xFF; + + OS_REPORT("B_GOS//////////////B_GO SET 1 !!\n"); + + if (!fopAcM_entrySolidHeap(i_this, useHeapInit, 0x4B000)) { + OS_REPORT("//////////////B_GOS SET NON !!\n"); + return cPhs_ERROR_e; + } + + OS_REPORT("//////////////B_GOS SET 2 !!\n"); + + if (data_8060560C == 0) { + a_this->field_0xcc8 = 1; + data_8060560C = 1; + l_HIO.field_0x4 = -1; + } + + a_this->attention_info.flags = 4; + fopAcM_SetMtx(a_this, a_this->mpMorf->getModel()->getBaseTRMtx()); + fopAcM_SetMin(a_this, -200.0f, -200.0f, -200.0f); + fopAcM_SetMax(a_this, 200.0f, 200.0f, 200.0f); + a_this->health = 1000; + a_this->field_0x560 = 1000; + + a_this->mAcch.Set(fopAcM_GetPosition_p(a_this), fopAcM_GetOldPosition_p(a_this), a_this, 1, + &a_this->mAcchCir, fopAcM_GetSpeed_p(a_this), NULL, NULL); + a_this->mAcchCir.SetWall(50.0f, 50.0f); + + a_this->mSound.init(&a_this->current.pos, &a_this->eyePos, 3, 1); + a_this->mAtInfo.mpSound = &a_this->mSound; + + a_this->gravity = -7.0f; + a_this->mAction = 0; + + static dCcD_SrcCyl cc_cyl_src = { + { + {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj + {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt + {dCcD_SE_NONE, 0x5, 0x0, 0x0, 0x2}, // mGObjTg + {0x0}, // mGObjCo + }, // mObjInf + { + {0.0f, 0.0f, 0.0f}, // mCenter + 150.0f, // mRadius + 60.0f // mHeight + } // mCyl + }; + + a_this->mCcStts.Init(0xFA, 0, a_this); + a_this->mCyl.Set(cc_cyl_src); + a_this->mCyl.SetStts(&a_this->mCcStts); + + daB_GOS_Execute(a_this); + } + + return phase_state; } -#pragma pop /* 80605024-806051D8 000EA4 01B4+00 1/1 0/0 0/0 .text __ct__11b_gos_classFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm b_gos_class::b_gos_class() { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/__ct__11b_gos_classFv.s" -} -#pragma pop - -/* 806051D8-80605220 001058 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGCylFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -// asm cM3dGCyl::~cM3dGCyl() { -extern "C" asm void __dt__8cM3dGCylFv() { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/__dt__8cM3dGCylFv.s" -} -#pragma pop - -/* 80605220-80605268 0010A0 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGSphFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -// asm cM3dGSph::~cM3dGSph() { -extern "C" asm void __dt__8cM3dGSphFv() { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/__dt__8cM3dGSphFv.s" -} -#pragma pop - -/* 80605268-806052B0 0010E8 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGAabFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -// asm cM3dGAab::~cM3dGAab() { -extern "C" asm void __dt__8cM3dGAabFv() { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/__dt__8cM3dGAabFv.s" -} -#pragma pop - -/* 806052B0-80605320 001130 0070+00 3/2 0/0 0/0 .text __dt__12dBgS_ObjAcchFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm dBgS_ObjAcch::~dBgS_ObjAcch() { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/__dt__12dBgS_ObjAcchFv.s" -} -#pragma pop - -/* 80605320-80605368 0011A0 0048+00 2/1 0/0 0/0 .text __dt__13daB_GOS_HIO_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm daB_GOS_HIO_c::~daB_GOS_HIO_c() { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/__dt__13daB_GOS_HIO_cFv.s" -} -#pragma pop - -/* 80605368-806053A4 0011E8 003C+00 0/0 1/0 0/0 .text __sinit_d_a_b_gos_cpp */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void __sinit_d_a_b_gos_cpp() { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/__sinit_d_a_b_gos_cpp.s" -} -#pragma pop - -#pragma push -#pragma force_active on -REGISTER_CTORS(0x80605368, __sinit_d_a_b_gos_cpp); -#pragma pop - -/* 806053A4-806053AC 001224 0008+00 1/0 0/0 0/0 .text @36@__dt__12dBgS_ObjAcchFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void func_806053A4() { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/func_806053A4.s" -} -#pragma pop - -/* 806053AC-806053B4 00122C 0008+00 1/0 0/0 0/0 .text @20@__dt__12dBgS_ObjAcchFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void func_806053AC() { - nofralloc -#include "asm/rel/d/a/b/d_a_b_gos/d_a_b_gos/func_806053AC.s" -} -#pragma pop +b_gos_class::b_gos_class() {} -/* 80605414-80605414 00004C 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ +/* 80605558-80605578 -00001 0020+00 1/0 0/0 0/0 .data l_daB_GOS_Method */ +static actor_method_class l_daB_GOS_Method = { + (process_method_func)daB_GOS_Create, (process_method_func)daB_GOS_Delete, + (process_method_func)daB_GOS_Execute, (process_method_func)daB_GOS_IsDelete, + (process_method_func)daB_GOS_Draw, +}; + +/* 80605578-806055A8 -00001 0030+00 0/0 0/0 1/0 .data g_profile_B_GOS */ +extern actor_process_profile_definition g_profile_B_GOS = { + fpcLy_CURRENT_e, + 8, + fpcPi_CURRENT_e, + PROC_B_GOS, + &g_fpcLf_Method.mBase, + sizeof(b_gos_class), + 0, + 0, + &g_fopAc_Method.base, + 216, + &l_daB_GOS_Method, + 0x40100, + fopAc_ENEMY_e, + fopAc_CULLBOX_CUSTOM_e, +};
\ No newline at end of file diff --git a/rel/d/a/b/d_a_b_oh/d_a_b_oh.cpp b/rel/d/a/b/d_a_b_oh/d_a_b_oh.cpp index fa67bbbe8d..815e0c4d64 100644 --- a/rel/d/a/b/d_a_b_oh/d_a_b_oh.cpp +++ b/rel/d/a/b/d_a_b_oh/d_a_b_oh.cpp @@ -921,192 +921,193 @@ static void non(b_oh_class* i_this) { } /* 8061C2C4-8061CB4C 000C84 0888+00 2/1 0/0 0/0 .text action__FP10b_oh_class */ -// close-ish +// matches with literals #ifdef NONMATCHING static void action(b_oh_class* i_this) { - BOOL bvar; - int uvar; - - cXyz local_90; - cXyz cstack_9c; + b_oh_class* a_this = (b_oh_class*)i_this; + int var_r28; + BOOL var_r27; + + cXyz sp90; + cXyz sp9C; - i_this->mAngleToPlayer = fopAcM_searchPlayerAngleY(i_this); - i_this->mDistToPlayer = fopAcM_searchPlayerDistance(i_this); + a_this->mAngleToPlayer = fopAcM_searchPlayerAngleY(a_this); + a_this->mDistToPlayer = fopAcM_searchPlayerDistance(a_this); - fopAcM_OffStatus(i_this, 0); - i_this->attention_info.flags = 0; + fopAcM_OffStatus(a_this, 0); + a_this->attention_info.flags = 0; - uvar = 0; - bvar = true; + var_r28 = 0; + var_r27 = true; - cLib_addCalcAngleS2(&i_this->field_0xc98, 0x800, 1, 0x10); + cLib_addCalcAngleS2(&a_this->field_0xc98, 0x800, 1, 0x10); - switch (i_this->mAction) { + switch (a_this->mAction) { case ACTION_START: - start(i_this); - uvar = 1; + start(a_this); + var_r28 = 1; break; case ACTION_WAIT: - wait(i_this); - uvar = 1; + wait(a_this); + var_r28 = 1; break; case ACTION_ATTACK: - attack(i_this); - uvar = 2; + attack(a_this); + var_r28 = 2; boss->field_0x4794 = 180; break; case ACTION_CAUGHT: - caught(i_this); - bvar = false; - uvar = 3; + caught(a_this); + var_r27 = false; + var_r28 = 3; boss->field_0x4794 = 180; break; case ACTION_END: - end(i_this); - uvar = 1; + end(a_this); + var_r28 = 1; break; case ACTION_NON: - non(i_this); + non(a_this); return; } if (boss->field_0x4752 == 2) { - cLib_addCalc2(&i_this->field_0x60c, 500.0f, 1.0f, 80.0f); + cLib_addCalc2(&a_this->field_0x60c, 500.0f, 1.0f, 80.0f); } - if (uvar == 1) { - f32 fvar15 = i_this->field_0x608 * 500.0f; - f32 fvar14 = i_this->field_0x608 * 1500.0f; - s16 tmp = 2000; + if (var_r28 == 1) { + f32 var_f29 = a_this->field_0x608 * 500.0f; + f32 var_f28 = a_this->field_0x608 * 1500.0f; + s16 var_r5 = 2000; for (int i = i_this->field_0xca8; i < 30; i++) { - f32 fvar = 1.0f; + f32 var_f31 = 1.0f; if (i < 5) { - fvar = i * 0.2f; + var_f31 = i * 0.2f; } else if (i >= 20) { - fvar = (i - 20) * 0.3f + 1.0f; + var_f31 = (i - 20) * 0.3f + 1.0f; } - i_this->field_0x6d0[i].x = fvar * (fvar15 * cM_ssin(i_this->field_0x5f8 + (i * 1800))); - i_this->field_0x6d0[i].y = fvar * (fvar14 * cM_ssin(i_this->field_0x5fa + (i * 1800))); + a_this->field_0x6d0[i].x = var_f31 * (var_f29 * cM_ssin( i_this->field_0x5f8 + (i * 1800) )); + a_this->field_0x6d0[i].y = var_f31 * (var_f28 * cM_ssin( i_this->field_0x5fa + (i * 1800) )); - i_this->field_0x838[i].x = - tmp + fvar * (fvar15 * cM_ssin(i_this->field_0x5fa + (i * 7000)) * 0.5f); - i_this->field_0x838[i].y = - fvar * (fvar14 * cM_ssin(i_this->field_0x5f8 + (i * 7000)) * 0.5f); + a_this->field_0x838[i].x = + var_r5 + var_f31 * (var_f29 * cM_ssin(a_this->field_0x5fa + (i * 7000)) * 0.5f); + a_this->field_0x838[i].y = + var_f31 * (var_f28 * cM_ssin(a_this->field_0x5f8 + (i * 7000)) * 0.5f); - tmp -= 200; - if (tmp < 0) { - tmp = 0; + var_r5 -= 200; + if (var_r5 < 0) { + var_r5 = 0; } - i_this->field_0x964[i] = - i_this->field_0x610 + 1.0f + - i_this->field_0x610 * cM_ssin(i_this->field_0x5f6 + i * -10000); + a_this->field_0x964[i] = + a_this->field_0x610 + 1.0f + + a_this->field_0x610 * cM_ssin(a_this->field_0x5f6 + i * -10000); } - cLib_addCalcAngleS2(&i_this->current.angle.x, -0xF2C, 4, 100); - cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->home.angle.y, 4, 0x100); - } else if (uvar == 2) { - f32 fvar = i_this->field_0xc8c; - for (int i = i_this->field_0xca8; i < 30; i++) { - if (i >= 30 - i_this->field_0xca2) { - i_this->field_0x6d0[i].y = i_this->field_0xca4; + cLib_addCalcAngleS2(&a_this->current.angle.x, -0xF2C, 4, 100); + cLib_addCalcAngleS2(&a_this->current.angle.y, a_this->home.angle.y, 4, 0x100); + } else if (var_r28 == 2) { + f32 var_f4 = a_this->field_0xc8c; + for (int i = a_this->field_0xca8; i < 30; i++) { + if (i >= 30 - a_this->field_0xca2) { + a_this->field_0x6d0[i].y = a_this->field_0xca4; } else { - i_this->field_0x6d0[i].y = 0; + a_this->field_0x6d0[i].y = 0; } if (i >= 13) { - fvar *= i_this->field_0xc90 + 1.0f; + var_f4 *= a_this->field_0xc90 + 1.0f; } - i_this->field_0x6d0[i].x = - fvar * cM_ssin(i_this->field_0xc94 + i * i_this->field_0xc96); + a_this->field_0x6d0[i].x = + var_f4 * cM_ssin(a_this->field_0xc94 + i * a_this->field_0xc96); if (i >= 18) { - i_this->field_0x838[i].x = - i_this->field_0xc9c * cM_ssin(i_this->field_0x5cc * 1000 + i * -4000); + a_this->field_0x838[i].x = + a_this->field_0xc9c * cM_ssin(a_this->field_0x5cc * 1000 + i * -4000); } else { - i_this->field_0x838[i].x = 0; + a_this->field_0x838[i].x = 0; } - i_this->field_0x838[i].y = 0; - i_this->field_0x964[i] = - i_this->field_0x610 + 1.0f + - i_this->field_0x610 * cM_ssin(i_this->field_0x5f6 + i * -10000); + a_this->field_0x838[i].y = 0; + a_this->field_0x964[i] = + a_this->field_0x610 + 1.0f + + a_this->field_0x610 * cM_ssin(a_this->field_0x5f6 + i * -10000); } - } else if (uvar == 3) { - for (int i = i_this->field_0xca8; i < 30; i++) { - i_this->field_0x838[i].y = 0; - i_this->field_0x838[i].x = 0; - - if (i >= 30 - i_this->field_0xca2) { - i_this->field_0x6d0[i].y = i_this->field_0xca4; - i_this->field_0x6d0[i].x = 0; - i_this->field_0x964[i] = 1.0f; + } else if (var_r28 == 3) { + for (int i = a_this->field_0xca8; i < 30; i++) { + a_this->field_0x838[i].y = 0; + a_this->field_0x838[i].x = 0; + + if (i >= 30 - a_this->field_0xca2) { + a_this->field_0x6d0[i].y = a_this->field_0xca4; + a_this->field_0x6d0[i].x = 0; + a_this->field_0x964[i] = 1.0f; } else { - i_this->field_0x6d0[i].y = 0; - i_this->field_0x6d0[i].x = 2250; - i_this->field_0x964[i] = - i_this->field_0x610 + 1.0f + - i_this->field_0x610 * cM_ssin(i_this->field_0x5f6 + i * -10000); + a_this->field_0x6d0[i].y = 0; + a_this->field_0x6d0[i].x = 2250; + a_this->field_0x964[i] = + a_this->field_0x610 + 1.0f + + a_this->field_0x610 * cM_ssin(a_this->field_0x5f6 + i * -10000); } } - cLib_addCalcAngleS2(&i_this->current.angle.x, 0xA92, 4, 0x200); - cLib_addCalcAngleS2(&i_this->current.angle.y, i_this->home.angle.y, 4, 0x800); + cLib_addCalcAngleS2(&a_this->current.angle.x, 0xA92, 4, 0x200); + cLib_addCalcAngleS2(&a_this->current.angle.y, a_this->home.angle.y, 4, 0x800); } - i_this->field_0x600 = - (-i_this->field_0x614 - i_this->field_0x60c) + cM_ssin(i_this->field_0x5cc * 200) * 100.0f; - i_this->field_0x604 = ((100.0f - i_this->field_0x614) - i_this->field_0x60c) + - cM_ssin(i_this->field_0x5cc * 200) * 100.0f; - i_this->field_0x5f8 += (s16)i_this->field_0x600; - i_this->field_0x5fa += (s16)i_this->field_0x604; - i_this->field_0x5fc = i_this->field_0x60c + 2000.0f; - i_this->field_0x5f6 += (s16)i_this->field_0x5fc; - - cLib_addCalc0(&i_this->field_0x60c, 0.1f, 50.0f); - cLib_addCalc2(&i_this->field_0x610, 0.2f, 0.1f, 0.01f); - - if (uvar <= 3) { - cLib_addCalc2(&i_this->mTentacleLength, l_HIO.mLength, 0.1f, 0.5f); + a_this->field_0x600 = + (-a_this->field_0x614 - a_this->field_0x60c) + cM_ssin(a_this->field_0x5cc * 200) * 100.0f; + a_this->field_0x604 = ((100.0f - a_this->field_0x614) - a_this->field_0x60c) + + cM_ssin(a_this->field_0x5cc * 200) * 100.0f; + a_this->field_0x5f8 += (s16)a_this->field_0x600; + a_this->field_0x5fa += (s16)a_this->field_0x604; + a_this->field_0x5fc = a_this->field_0x60c + 2000.0f; + a_this->field_0x5f6 += (s16)a_this->field_0x5fc; + + cLib_addCalc0(&a_this->field_0x60c, 0.1f, 50.0f); + cLib_addCalc2(&a_this->field_0x610, 0.2f, 0.1f, 0.01f); + + if (var_r28 <= 3) { + cLib_addCalc2(&a_this->mTentacleLength, l_HIO.mLength, 0.1f, 0.5f); } - MTXCopy(i_this->mpMorf->getModel()->i_getAnmMtx(i_this->field_0x5c8 + 8), + MTXCopy(boss->mParts[0].field_0x0->getModel()->i_getAnmMtx(a_this->field_0x5c8 + 8), mDoMtx_stack_c::get()); - mDoMtx_stack_c::multVecZero(&i_this->current.pos); + mDoMtx_stack_c::multVecZero(&a_this->current.pos); - local_90.x = i_this->current.pos.x - boss->home.pos.x; - local_90.z = i_this->current.pos.z - boss->home.pos.z; - i_this->home.angle.y = cM_atan2s(local_90.x, local_90.z); - cLib_addCalcAngleS2(&i_this->shape_angle.y, i_this->current.angle.y, 2, 0x2000); - cLib_addCalcAngleS2(&i_this->shape_angle.x, i_this->current.angle.x, 2, 0x2000); + sp90.x = a_this->current.pos.x - boss->home.pos.x; + sp90.z = a_this->current.pos.z - boss->home.pos.z; + a_this->home.angle.y = cM_atan2s(sp90.x, sp90.z); + cLib_addCalcAngleS2(&a_this->shape_angle.y, a_this->current.angle.y, 2, 0x2000); + cLib_addCalcAngleS2(&a_this->shape_angle.x, a_this->current.angle.x, 2, 0x2000); - for (int i = i_this->field_0xca8; i < 30; i++) { + for (int i = a_this->field_0xca8; i < 30; i++) { if (Cinit) { - i_this->field_0x61c[i] = i_this->field_0x6d0[i]; - i_this->field_0x784[i] = i_this->field_0x838[i]; - i_this->field_0x8ec[i] = i_this->field_0x964[i]; + a_this->field_0x61c[i] = a_this->field_0x6d0[i]; + a_this->field_0x784[i] = a_this->field_0x838[i]; + a_this->field_0x8ec[i] = a_this->field_0x964[i]; } else { - cLib_addCalcAngleS2(&i_this->field_0x61c[i].x, i_this->field_0x6d0[i].x, 2, - i_this->field_0xc98); - cLib_addCalcAngleS2(&i_this->field_0x61c[i].y, i_this->field_0x6d0[i].y, 2, - i_this->field_0xc98); - cLib_addCalcAngleS2(&i_this->field_0x784[i].x, i_this->field_0x838[i].x, 2, - i_this->field_0xc98); - cLib_addCalcAngleS2(&i_this->field_0x784[i].y, i_this->field_0x838[i].y, 2, - i_this->field_0xc98); - cLib_addCalc2(&i_this->field_0x8ec[i], i_this->field_0x964[i], 0.5f, 0.2f); - cLib_addCalc0(&i_this->field_0x9dc[i], 0.1f, 0.2f); + cLib_addCalcAngleS2(&a_this->field_0x61c[i].x, a_this->field_0x6d0[i].x, 2, + a_this->field_0xc98); + cLib_addCalcAngleS2(&a_this->field_0x61c[i].y, a_this->field_0x6d0[i].y, 2, + a_this->field_0xc98); + cLib_addCalcAngleS2(&a_this->field_0x784[i].x, a_this->field_0x838[i].x, 2, + a_this->field_0xc98); + cLib_addCalcAngleS2(&a_this->field_0x784[i].y, a_this->field_0x838[i].y, 2, + a_this->field_0xc98); + cLib_addCalc2(&a_this->field_0x8ec[i], a_this->field_0x964[i], 0.5f, 0.2f); + cLib_addCalc0(&a_this->field_0x9dc[i], 0.1f, 0.2f); } } for (int i = 0; i < 15; i++) { - if (bvar && boss->mDemoAction == 0) { - i_this->mColliders[i].OnCoSetBit(); + if (var_r27 && boss->mDemoAction == 0) { + a_this->mColliders[i].OnCoSetBit(); } else { - i_this->mColliders[i].OffCoSetBit(); + a_this->mColliders[i].OffCoSetBit(); } } @@ -1592,7 +1593,8 @@ extern "C" void __ct__5csXyzFv() { #pragma push #pragma optimization_level 0 #pragma optimizewithasm off -asm daB_OH_HIO_c::~daB_OH_HIO_c() { +// asm daB_OH_HIO_c::~daB_OH_HIO_c() { +extern "C" asm void __dt__12daB_OH_HIO_cFv() { nofralloc #include "asm/rel/d/a/b/d_a_b_oh/d_a_b_oh/__dt__12daB_OH_HIO_cFv.s" } diff --git a/rel/d/a/b/d_a_b_oh/d_a_b_oh_NONMATCHING.cpp b/rel/d/a/b/d_a_b_oh/d_a_b_oh_NONMATCHING.cpp new file mode 100644 index 0000000000..f07637241d --- /dev/null +++ b/rel/d/a/b/d_a_b_oh/d_a_b_oh_NONMATCHING.cpp @@ -0,0 +1,1226 @@ +/** + * d_a_b_oh.cpp + * Morpheel Tentacle + */ + +/** + * This almost entirely matches, there's just an issue with extra vtables / weak dtors being emitted + * things like cCcD_ShapeAttr, dCcD/cCcD_Stts, etc + */ + +#include "SSystem/SComponent/c_math.h" +#include "c/c_damagereaction.h" +#include "d/a/d_a_player.h" +#include "d/com/d_com_inf_game.h" +#include "d/d_procname.h" +#include "dol2asm.h" +#include "f_op/f_op_actor_mng.h" +#include "rel/d/a/b/d_a_b_ob/d_a_b_ob.h" +#include "rel/d/a/b/d_a_b_oh/d_a_b_oh.h" + +#define ACTION_START 0 +#define ACTION_WAIT 1 +#define ACTION_ATTACK 2 +#define ACTION_CAUGHT 3 +#define ACTION_END 10 +#define ACTION_NON 11 + +// +// Forward References: +// + +extern "C" void __ct__12daB_OH_HIO_cFv(); +extern "C" static void nodeCallBack__FP8J3DJointi(); +extern "C" static void daB_OH_Draw__FP10b_oh_class(); +extern "C" static void start__FP10b_oh_class(); +extern "C" void __dt__4cXyzFv(); +extern "C" static void wait__FP10b_oh_class(); +extern "C" static void attack__FP10b_oh_class(); +extern "C" static void caught__FP10b_oh_class(); +extern "C" static void end__FP10b_oh_class(); +extern "C" static void non__FP10b_oh_class(); +extern "C" static void action__FP10b_oh_class(); +extern "C" static void damage_check__FP10b_oh_class(); +extern "C" static void daB_OH_Execute__FP10b_oh_class(); +extern "C" static bool daB_OH_IsDelete__FP10b_oh_class(); +extern "C" static void daB_OH_Delete__FP10b_oh_class(); +extern "C" static void useHeapInit__FP10fopAc_ac_c(); +extern "C" void __dt__12J3DFrameCtrlFv(); +extern "C" static void daB_OH_Create__FP10fopAc_ac_c(); +extern "C" void __dt__8dCcD_SphFv(); +extern "C" void __ct__8dCcD_SphFv(); +extern "C" void __dt__8cM3dGSphFv(); +extern "C" void __dt__8cM3dGAabFv(); +extern "C" void __ct__4cXyzFv(); +extern "C" void __dt__5csXyzFv(); +extern "C" void __ct__5csXyzFv(); +extern "C" void __dt__12daB_OH_HIO_cFv(); +extern "C" void __sinit_d_a_b_oh_cpp(); +extern "C" extern char const* const d_a_b_oh__stringBase0; + +// +// External References: +// + +extern "C" void mDoMtx_XrotM__FPA4_fs(); +extern "C" void mDoMtx_YrotM__FPA4_fs(); +extern "C" void mDoMtx_ZrotM__FPA4_fs(); +extern "C" void scaleM__14mDoMtx_stack_cFfff(); +extern "C" void play__14mDoExt_baseAnmFv(); +extern "C" void init__13mDoExt_btkAnmFP16J3DMaterialTableP19J3DAnmTextureSRTKeyiifss(); +extern "C" void entry__13mDoExt_btkAnmFP16J3DMaterialTablef(); +extern "C" void init__13mDoExt_brkAnmFP16J3DMaterialTableP15J3DAnmTevRegKeyiifss(); +extern "C" void entry__13mDoExt_brkAnmFP16J3DMaterialTablef(); +extern "C" void create__21mDoExt_invisibleModelFP8J3DModelUc(); +extern "C" void entryDL__21mDoExt_invisibleModelFP4cXyz(); +extern "C" void +__ct__14mDoExt_McaMorfFP12J3DModelDataP25mDoExt_McaMorfCallBack1_cP25mDoExt_McaMorfCallBack2_cP15J3DAnmTransformifiiiPvUlUl(); +extern "C" void play__14mDoExt_McaMorfFP3VecUlSc(); +extern "C" void modelCalc__14mDoExt_McaMorfFv(); +extern "C" void cDmrNowMidnaTalk__Fv(); +extern "C" void __ct__10fopAc_ac_cFv(); +extern "C" void fopAcIt_Judge__FPFPvPv_PvPv(); +extern "C" void fopAcM_entrySolidHeap__FP10fopAc_ac_cPFP10fopAc_ac_c_iUl(); +extern "C" void fopAcM_searchActorAngleY__FPC10fopAc_ac_cPC10fopAc_ac_c(); +extern "C" void fopAcM_searchActorDistance__FPC10fopAc_ac_cPC10fopAc_ac_c(); +extern "C" void 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 getRes__14dRes_control_cFPCclP11dRes_info_ci(); +extern "C" void setHitMark__13dPa_control_cFUsP10fopAc_ac_cPC4cXyzPC5csXyzPC4cXyzUl(); +extern "C" void +set__13dPa_control_cFUlUcUsPC4cXyzPC12dKy_tevstr_cPC5csXyzPC4cXyzUcP18dPa_levelEcallBackScPC8_GXColorPC8_GXColorPC4cXyzf(); +extern "C" void StartShock__12dVibration_cFii4cXyz(); +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 ChkCoHit__12dCcD_GObjInfFv(); +extern "C" void GetCoHitObj__12dCcD_GObjInfFv(); +extern "C" void Set__8dCcD_SphFRC11dCcD_SrcSph(); +extern "C" void cc_at_check__FP10fopAc_ac_cP11dCcU_AtInfo(); +extern "C" void settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c(); +extern "C" void setLightTevColorType_MAJI__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c(); +extern "C" void GetAc__8cCcD_ObjFv(); +extern "C" void Set__4cCcSFP8cCcD_Obj(); +extern "C" void cM_atan2s__Fff(); +extern "C" void cM_rndF__Ff(); +extern "C" void cM_rndFX__Ff(); +extern "C" void SetC__8cM3dGSphFRC4cXyz(); +extern "C" void SetR__8cM3dGSphFf(); +extern "C" void cLib_addCalc2__FPffff(); +extern "C" void cLib_addCalc0__FPfff(); +extern "C" void cLib_addCalcAngleS2__FPssss(); +extern "C" void MtxTrans__FfffUc(); +extern "C" void MtxScale__FfffUc(); +extern "C" void seStart__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc(); +extern "C" void startTentacleSound__12Z2CreatureOIF10JAISoundIDUcUlSc(); +extern "C" void* __nw__FUl(); +extern "C" void __dl__FPv(); +extern "C" void init__12J3DFrameCtrlFs(); +extern "C" void __construct_array(); +extern "C" void _savegpr_20(); +extern "C" void _savegpr_23(); +extern "C" void _savegpr_24(); +extern "C" void _savegpr_25(); +extern "C" void _savegpr_26(); +extern "C" void _savegpr_27(); +extern "C" void _savegpr_28(); +extern "C" void _savegpr_29(); +extern "C" void _restgpr_20(); +extern "C" void _restgpr_23(); +extern "C" void _restgpr_24(); +extern "C" void _restgpr_25(); +extern "C" void _restgpr_26(); +extern "C" void _restgpr_27(); +extern "C" void _restgpr_28(); +extern "C" void _restgpr_29(); +extern "C" extern void* __vt__8dCcD_Sph[36]; +extern "C" extern void* __vt__9dCcD_Stts[11]; +extern "C" extern void* __vt__12cCcD_SphAttr[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" u8 mCurrentMtx__6J3DSys[48]; +extern "C" u8 sincosTable___5JMath[65536]; +extern "C" extern u8 struct_80450C98[4]; +extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */]; +extern "C" void __register_global_object(); + +// +// Declarations: +// + +/* 8061DAAC-8061DAEC 000030 0040+00 1/1 0/0 0/0 .data cc_sph_src$4457 */ + +/* 8061B72C-8061B75C 0000EC 0030+00 1/1 0/0 0/0 .text __ct__12daB_OH_HIO_cFv */ +daB_OH_HIO_c::daB_OH_HIO_c() { + field_0x4 = -1; + mModelSize = 1.0f; + mLength = 70.0f; +} + +/* 8061B75C-8061B8B0 00011C 0154+00 1/1 0/0 0/0 .text nodeCallBack__FP8J3DJointi */ +static int nodeCallBack(J3DJoint* param_0, int param_1) { + if (param_1 == 0) { + int jnt_no = param_0->getJntNo(); + J3DModel* model_p = j3dSys.getModel(); + b_oh_class* this_ = (b_oh_class*)model_p->getUserArea(); + + if (this_ != NULL && jnt_no >= this_->field_0xca8 && jnt_no <= 29) { + MTXCopy(model_p->i_getAnmMtx(jnt_no), *calc_mtx); + mDoMtx_YrotM(*calc_mtx, this_->field_0x61c[jnt_no].y + this_->field_0x784[jnt_no].y); + mDoMtx_ZrotM(*calc_mtx, this_->field_0x61c[jnt_no].x + this_->field_0x784[jnt_no].x); + MtxTrans(this_->mTentacleLength + -100.0f, 1.0f, 1.0f, 1); + MTXCopy(*calc_mtx, J3DSys::mCurrentMtx); + MtxScale(1.0f, this_->field_0x8ec[jnt_no] + this_->field_0x9dc[jnt_no], + this_->field_0x8ec[jnt_no] + this_->field_0x9dc[jnt_no], 1); + model_p->i_setAnmMtx(jnt_no, *calc_mtx); + } + } + + return 1; +} + +/* 8061B8B0-8061B960 000270 00B0+00 1/0 0/0 0/0 .text daB_OH_Draw__FP10b_oh_class */ +static int daB_OH_Draw(b_oh_class* i_this) { + if (i_this->mAction == ACTION_NON) { + return 1; + } + + J3DModel* model_p = i_this->mpMorf->getModel(); + + g_env_light.settingTevStruct(0, &i_this->current.pos, &i_this->tevStr); + g_env_light.setLightTevColorType_MAJI(model_p, &i_this->tevStr); + + i_this->mpBtk->entry(model_p->getModelData()); + i_this->mpBrk->entry(model_p->getModelData()); + i_this->mInvisModel.entryDL(NULL); + return 1; +} + +/* 8061DB78-8061DB7C 000008 0001+03 2/2 0/0 0/0 .bss @1109 */ +static u8 lit_1109[1 + 3 /* padding */]; + +/* 8061DB7C-8061DB80 00000C 0001+03 0/0 0/0 0/0 .bss @1107 */ +#pragma push +#pragma force_active on +static u8 lit_1107[1 + 3 /* padding */]; +#pragma pop + +/* 8061DB80-8061DB84 000010 0001+03 0/0 0/0 0/0 .bss @1105 */ +#pragma push +#pragma force_active on +static u8 lit_1105[1 + 3 /* padding */]; +#pragma pop + +/* 8061DB84-8061DB88 000014 0001+03 0/0 0/0 0/0 .bss @1104 */ +#pragma push +#pragma force_active on +static u8 lit_1104[1 + 3 /* padding */]; +#pragma pop + +/* 8061DB88-8061DB8C 000018 0001+03 0/0 0/0 0/0 .bss @1099 */ +#pragma push +#pragma force_active on +static u8 lit_1099[1 + 3 /* padding */]; +#pragma pop + +/* 8061DB8C-8061DB90 00001C 0001+03 0/0 0/0 0/0 .bss @1097 */ +#pragma push +#pragma force_active on +static u8 lit_1097[1 + 3 /* padding */]; +#pragma pop + +/* 8061DB90-8061DB94 000020 0001+03 0/0 0/0 0/0 .bss @1095 */ +#pragma push +#pragma force_active on +static u8 lit_1095[1 + 3 /* padding */]; +#pragma pop + +/* 8061DB94-8061DB98 000024 0001+03 0/0 0/0 0/0 .bss @1094 */ +#pragma push +#pragma force_active on +static u8 lit_1094[1 + 3 /* padding */]; +#pragma pop + +/* 8061DB98-8061DB9C 000028 0001+03 0/0 0/0 0/0 .bss @1057 */ +#pragma push +#pragma force_active on +static u8 lit_1057[1 + 3 /* padding */]; +#pragma pop + +/* 8061DB9C-8061DBA0 00002C 0001+03 0/0 0/0 0/0 .bss @1055 */ +#pragma push +#pragma force_active on +static u8 lit_1055[1 + 3 /* padding */]; +#pragma pop + +/* 8061DBA0-8061DBA4 000030 0001+03 0/0 0/0 0/0 .bss @1053 */ +#pragma push +#pragma force_active on +static u8 lit_1053[1 + 3 /* padding */]; +#pragma pop + +/* 8061DBA4-8061DBA8 000034 0001+03 0/0 0/0 0/0 .bss @1052 */ +#pragma push +#pragma force_active on +static u8 lit_1052[1 + 3 /* padding */]; +#pragma pop + +/* 8061DBA8-8061DBAC 000038 0001+03 0/0 0/0 0/0 .bss @1014 */ +#pragma push +#pragma force_active on +static u8 lit_1014[1 + 3 /* padding */]; +#pragma pop + +/* 8061DBAC-8061DBB0 00003C 0001+03 0/0 0/0 0/0 .bss @1012 */ +#pragma push +#pragma force_active on +static u8 lit_1012[1 + 3 /* padding */]; +#pragma pop + +/* 8061DBB0-8061DBB4 000040 0001+03 0/0 0/0 0/0 .bss @1010 */ +#pragma push +#pragma force_active on +static u8 lit_1010[1 + 3 /* padding */]; +#pragma pop + +/* 8061DBB4-8061DBB8 -00001 0004+00 1/2 0/0 0/0 .bss None */ +/* 8061DBB4 0001+00 data_8061DBB4 @1009 */ +/* 8061DBB5 0003+00 data_8061DBB5 None */ +#pragma push +#pragma force_active on +static u8 struct_8061DBB4; +#pragma pop + +static u8 data_8061DBB5; + +/* 8061DBC4-8061DBD4 000054 0010+00 2/3 0/0 0/0 .bss l_HIO */ +static daB_OH_HIO_c l_HIO; + +/* 8061DBD4-8061DBD8 000064 0004+00 6/7 0/0 0/0 .bss boss */ +static b_ob_class* boss; + +/* 8061DBD8-8061DBDC 000068 0004+00 0/1 0/0 0/0 .bss Cinit */ +#pragma push +#pragma force_active on +static int Cinit; +#pragma pop + +/* 8061B960-8061BB18 000320 01B8+00 1/1 0/0 0/0 .text start__FP10b_oh_class */ +static void start(b_oh_class* i_this) { + cXyz sp28; + + switch (i_this->mActionPhase) { + case 0: + if (boss->field_0x4788 != i_this->field_0x5c8) { + i_this->field_0xcac = -1500.0f; + } else { + i_this->field_0x608 = 0.3f; + i_this->mActionPhase = 1; + } + break; + case 1: + if (i_this->field_0xcac < -100.0f) { + for (int i = 0; i < 28; i++) { + MTXCopy(i_this->mpMorf->getModel()->i_getAnmMtx(i), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&sp28); + + if (sp28.y > boss->field_0x47a0) { + sp28.y = boss->field_0x47a0; + i_this->field_0x1f80 = + dComIfGp_particle_set(i_this->field_0x1f80, 0x8808, &sp28, NULL, NULL); + break; + } + } + } + + cLib_addCalc0(&i_this->field_0xcac, 0.1f, 30.0f); + cLib_addCalc2(&i_this->field_0x608, 0.3f, 0.1f, 0.005f); + break; + case 2: + cLib_addCalc2(&i_this->field_0x608, 1.0f, 0.1f, 0.05f); + break; + } +} + +/* 8061BB54-8061BC6C 000514 0118+00 1/1 0/0 0/0 .text wait__FP10b_oh_class */ +static void wait(b_oh_class* i_this) { + daPy_py_c* player_p = (daPy_py_c*)dComIfGp_getPlayer(0); + + switch (i_this->mActionPhase) { + case 0: + i_this->mActionPhase = 1; + i_this->mTimers[0] = (s16)(cM_rndF(30.0f) + 60.0f); + break; + case 1: + cLib_addCalc2(&i_this->field_0x608, 1.0f, 0.1f, 0.005f); + + if (i_this->field_0xca8 == 0 && player_p->current.pos.y < -23000.0f && + i_this->mDistToPlayer < 1300.0f && i_this->mTimers[0] == 0 && boss->field_0x4744 == 0 && + boss->field_0x4794 == 0) + { + i_this->mAction = ACTION_ATTACK; + i_this->mActionPhase = 0; + i_this->field_0xc98 = 0; + boss->field_0x4794 = 3; + } + break; + } +} + +/* 8061BC6C-8061C070 00062C 0404+00 1/1 0/0 0/0 .text attack__FP10b_oh_class */ +static void attack(b_oh_class* i_this) { + daPy_py_c* player_p = (daPy_py_c*)dComIfGp_getPlayer(0); + i_this->field_0xca0++; + + switch (i_this->mActionPhase) { + case 0: + i_this->mActionPhase = 1; + i_this->field_0xc9c = 0.0f; + i_this->field_0xca2 = 0; + i_this->field_0xca4 = 0; + + if ((s16)(i_this->mAngleToPlayer - i_this->current.angle.y) > 0) { + i_this->field_0xc88 = 1; + } else { + i_this->field_0xc88 = -1; + } + + i_this->mActionPhase = 2; + i_this->mTimers[0] = 100; + i_this->field_0xca0 = 0; + i_this->field_0xc98 = 0; + case 1: + case 2: + if (i_this->mTimers[0] == 0) { + i_this->mAction = ACTION_WAIT; + i_this->mActionPhase = 0; + i_this->field_0xc98 = 0; + i_this->field_0xca2 = 0; + return; + } + case 3: + cLib_addCalcAngleS2(&i_this->field_0xc98, 0x200, 1, 32); + + if (i_this->field_0xca0 > 8) { + cLib_addCalc2(&i_this->field_0xc90, -0.12f, 0.8f, 0.02f); + } + + if (i_this->field_0xca0 < 70) { + cLib_addCalcAngleS2(&i_this->field_0xca4, 0, 1, 500); + cLib_addCalcAngleS2(&i_this->current.angle.y, + i_this->mAngleToPlayer + i_this->field_0xc88 * -0x600, 2, 0x400); + cLib_addCalc2(&i_this->field_0xc9c, 200.0f, 0.5f, 50.0f); + + if (i_this->field_0xca0 < 30) { + f32 fvar = player_p->current.pos.y - -24000.0f; + if (fvar > 1000.0f) { + fvar = 1000.0f; + } + + i_this->field_0xc96 = fvar + 3700.0f; + + cLib_addCalcAngleS2(&i_this->current.angle.x, + (s16)(-fvar * 2.0f + 11700.0f) - 0x4000, 1, 1000); + } + } else { + s16 var7; + s16 var3; + + if (i_this->mTimers[1] != 0) { + var7 = 6; + var3 = i_this->field_0xc88 * 9000; + } else { + var7 = 10; + var3 = i_this->field_0xc88 * 5000; + } + + cLib_addCalcAngleS2(&i_this->field_0xca2, var7, 1, 1); + cLib_addCalcAngleS2(&i_this->field_0xca4, var3, 1, 500); + + if (i_this->mTimers[1] == 0 || i_this->mTimers[1] > 10) { + i_this->current.angle.y += (s16)(i_this->field_0xc88 * 300); + } + + if (i_this->mActionPhase == 2) { + for (int i = 7; i < 15; i++) { + if (i_this->mColliders[i].ChkCoHit()) { + cCcD_Obj* obj_p = i_this->mColliders[i].GetCoHitObj(); + if (fopAcM_GetName(obj_p->GetAc()) == PROC_ALINK && + !i_dComIfGp_event_runCheck()) + { + if (!player_p->checkHookshotShootReturnMode() && + boss->field_0x4744 == 0) + { + i_this->mActionPhase = 3; + boss->mDemoAction = 1; + boss->field_0x5ce8 = i_this->field_0x5c8; + i_this->mTimers[1] = 20; + + if (boss->field_0x4752 != 1) { + boss->field_0x4752 = 1; + boss->field_0x4754 = 0; + boss->field_0x4738 = 30; + boss->field_0x473c = 2; + } + + boss->field_0x59e0.startTentacleSound( + Z2SE_EN_OI_TENT_SWING, i_this->field_0x5c8, 0, + dComIfGp_getReverb(fopAcM_GetRoomNo(i_this))); + break; + } + } + } + } + } + } + + cLib_addCalcAngleS2(&i_this->field_0xc94, 22500, 1, 2000); + cLib_addCalc2(&i_this->field_0xc8c, 4000.0f, 1.0f, 400.0f); + if (i_this->mTimers[1] == 1) { + i_this->mAction = ACTION_CAUGHT; + i_this->mActionPhase = 0; + i_this->field_0xc98 = 0; + } + break; + } +} + +/* 8061C070-8061C1F8 000A30 0188+00 1/1 0/0 0/0 .text caught__FP10b_oh_class */ +static void caught(b_oh_class* i_this) { + i_this->field_0x5f4 = 6; + + switch (i_this->mActionPhase) { + case 0: + i_this->mActionPhase = 1; + i_this->mTimers[0] = 10; + i_this->mTimers[1] = 50; + case 1: + i_this->field_0x60c = 500.0f; + cLib_addCalcAngleS2(&i_this->field_0xca2, 6, 1, 1); + cLib_addCalcAngleS2(&i_this->field_0xca4, i_this->field_0xc88 * 9000, 1, 500); + + if (i_this->mTimers[0] == 1) { + boss->field_0x4738 = 21; + boss->field_0x473c = 0; + boss->field_0x59e0.startCreatureVoice(Z2SE_EN_OI_V_EAT, -1); + } + + if (!(i_this->field_0x5cc & 0xF)) { + dComIfGp_getVibration().StartShock(3, 31, cXyz(0.0f, 1.0f, 0.0f)); + } + + if (i_this->mTimers[1] == 0) { + if (boss->mDemoAction != 0) { + boss->mDemoAction = 3; + boss->field_0x5c82 = 0; + } + + i_this->mAction = ACTION_WAIT; + i_this->mActionPhase = 0; + i_this->field_0xc98 = 0; + } + break; + } +} + +/* 8061C1F8-8061C298 000BB8 00A0+00 1/1 0/0 0/0 .text end__FP10b_oh_class */ +static void end(b_oh_class* i_this) { + i_this->field_0x5f4 = 6; + + switch (i_this->mActionPhase) { + case 0: + i_this->mActionPhase = 1; + i_this->mTimers[0] = 70; + break; + case 1: + cLib_addCalc2(&i_this->field_0x60c, 1000.0f, 1.0f, 150.0f); + + if (i_this->mTimers[0] == 0) { + cLib_addCalc0(&i_this->mTentacleLength, 1.0f, 1.0f); + } + break; + } +} + +/* 8061C298-8061C2C4 000C58 002C+00 1/1 0/0 0/0 .text non__FP10b_oh_class */ +static void non(b_oh_class* i_this) { + i_this->field_0x5f4 = 6; + + switch (i_this->mActionPhase) { + case 0: + i_this->mActionPhase = 1; + break; + case 1: + break; + } +} + +/* 8061C2C4-8061CB4C 000C84 0888+00 2/1 0/0 0/0 .text action__FP10b_oh_class */ +static void action(b_oh_class* i_this) { + b_oh_class* a_this = (b_oh_class*)i_this; + int var_r28; + BOOL var_r27; + + cXyz sp90; + cXyz sp9C; + + a_this->mAngleToPlayer = fopAcM_searchPlayerAngleY(a_this); + a_this->mDistToPlayer = fopAcM_searchPlayerDistance(a_this); + + fopAcM_OffStatus(a_this, 0); + a_this->attention_info.flags = 0; + + var_r28 = 0; + var_r27 = true; + + cLib_addCalcAngleS2(&a_this->field_0xc98, 0x800, 1, 0x10); + + switch (a_this->mAction) { + case ACTION_START: + start(a_this); + var_r28 = 1; + break; + case ACTION_WAIT: + wait(a_this); + var_r28 = 1; + break; + case ACTION_ATTACK: + attack(a_this); + var_r28 = 2; + boss->field_0x4794 = 180; + break; + case ACTION_CAUGHT: + caught(a_this); + var_r27 = false; + var_r28 = 3; + boss->field_0x4794 = 180; + break; + case ACTION_END: + end(a_this); + var_r28 = 1; + break; + case ACTION_NON: + non(a_this); + return; + } + + if (boss->field_0x4752 == 2) { + cLib_addCalc2(&a_this->field_0x60c, 500.0f, 1.0f, 80.0f); + } + + if (var_r28 == 1) { + f32 var_f29 = a_this->field_0x608 * 500.0f; + f32 var_f28 = a_this->field_0x608 * 1500.0f; + s16 var_r5 = 2000; + + for (int i = i_this->field_0xca8; i < 30; i++) { + f32 var_f31 = 1.0f; + if (i < 5) { + var_f31 = i * 0.2f; + } else if (i >= 20) { + var_f31 = (i - 20) * 0.3f + 1.0f; + } + + a_this->field_0x6d0[i].x = + var_f31 * (var_f29 * cM_ssin(i_this->field_0x5f8 + (i * 1800))); + a_this->field_0x6d0[i].y = + var_f31 * (var_f28 * cM_ssin(i_this->field_0x5fa + (i * 1800))); + + a_this->field_0x838[i].x = + var_r5 + var_f31 * (var_f29 * cM_ssin(a_this->field_0x5fa + (i * 7000)) * 0.5f); + a_this->field_0x838[i].y = + var_f31 * (var_f28 * cM_ssin(a_this->field_0x5f8 + (i * 7000)) * 0.5f); + + var_r5 -= 200; + if (var_r5 < 0) { + var_r5 = 0; + } + + a_this->field_0x964[i] = + a_this->field_0x610 + 1.0f + + a_this->field_0x610 * cM_ssin(a_this->field_0x5f6 + i * -10000); + } + + cLib_addCalcAngleS2(&a_this->current.angle.x, -0xF2C, 4, 100); + cLib_addCalcAngleS2(&a_this->current.angle.y, a_this->home.angle.y, 4, 0x100); + } else if (var_r28 == 2) { + f32 var_f4 = a_this->field_0xc8c; + for (int i = a_this->field_0xca8; i < 30; i++) { + if (i >= 30 - a_this->field_0xca2) { + a_this->field_0x6d0[i].y = a_this->field_0xca4; + } else { + a_this->field_0x6d0[i].y = 0; + } + + if (i >= 13) { + var_f4 *= a_this->field_0xc90 + 1.0f; + } + + a_this->field_0x6d0[i].x = + var_f4 * cM_ssin(a_this->field_0xc94 + i * a_this->field_0xc96); + + if (i >= 18) { + a_this->field_0x838[i].x = + a_this->field_0xc9c * cM_ssin(a_this->field_0x5cc * 1000 + i * -4000); + } else { + a_this->field_0x838[i].x = 0; + } + + a_this->field_0x838[i].y = 0; + a_this->field_0x964[i] = + a_this->field_0x610 + 1.0f + + a_this->field_0x610 * cM_ssin(a_this->field_0x5f6 + i * -10000); + } + } else if (var_r28 == 3) { + for (int i = a_this->field_0xca8; i < 30; i++) { + a_this->field_0x838[i].y = 0; + a_this->field_0x838[i].x = 0; + + if (i >= 30 - a_this->field_0xca2) { + a_this->field_0x6d0[i].y = a_this->field_0xca4; + a_this->field_0x6d0[i].x = 0; + a_this->field_0x964[i] = 1.0f; + } else { + a_this->field_0x6d0[i].y = 0; + a_this->field_0x6d0[i].x = 2250; + a_this->field_0x964[i] = + a_this->field_0x610 + 1.0f + + a_this->field_0x610 * cM_ssin(a_this->field_0x5f6 + i * -10000); + } + } + + cLib_addCalcAngleS2(&a_this->current.angle.x, 0xA92, 4, 0x200); + cLib_addCalcAngleS2(&a_this->current.angle.y, a_this->home.angle.y, 4, 0x800); + } + + a_this->field_0x600 = + (-a_this->field_0x614 - a_this->field_0x60c) + cM_ssin(a_this->field_0x5cc * 200) * 100.0f; + a_this->field_0x604 = ((100.0f - a_this->field_0x614) - a_this->field_0x60c) + + cM_ssin(a_this->field_0x5cc * 200) * 100.0f; + a_this->field_0x5f8 += (s16)a_this->field_0x600; + a_this->field_0x5fa += (s16)a_this->field_0x604; + a_this->field_0x5fc = a_this->field_0x60c + 2000.0f; + a_this->field_0x5f6 += (s16)a_this->field_0x5fc; + + cLib_addCalc0(&a_this->field_0x60c, 0.1f, 50.0f); + cLib_addCalc2(&a_this->field_0x610, 0.2f, 0.1f, 0.01f); + + if (var_r28 <= 3) { + cLib_addCalc2(&a_this->mTentacleLength, l_HIO.mLength, 0.1f, 0.5f); + } + + MTXCopy(boss->mParts[0].field_0x0->getModel()->i_getAnmMtx(a_this->field_0x5c8 + 8), + mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&a_this->current.pos); + + sp90.x = a_this->current.pos.x - boss->home.pos.x; + sp90.z = a_this->current.pos.z - boss->home.pos.z; + a_this->home.angle.y = cM_atan2s(sp90.x, sp90.z); + cLib_addCalcAngleS2(&a_this->shape_angle.y, a_this->current.angle.y, 2, 0x2000); + cLib_addCalcAngleS2(&a_this->shape_angle.x, a_this->current.angle.x, 2, 0x2000); + + for (int i = a_this->field_0xca8; i < 30; i++) { + if (Cinit) { + a_this->field_0x61c[i] = a_this->field_0x6d0[i]; + a_this->field_0x784[i] = a_this->field_0x838[i]; + a_this->field_0x8ec[i] = a_this->field_0x964[i]; + } else { + cLib_addCalcAngleS2(&a_this->field_0x61c[i].x, a_this->field_0x6d0[i].x, 2, + a_this->field_0xc98); + cLib_addCalcAngleS2(&a_this->field_0x61c[i].y, a_this->field_0x6d0[i].y, 2, + a_this->field_0xc98); + cLib_addCalcAngleS2(&a_this->field_0x784[i].x, a_this->field_0x838[i].x, 2, + a_this->field_0xc98); + cLib_addCalcAngleS2(&a_this->field_0x784[i].y, a_this->field_0x838[i].y, 2, + a_this->field_0xc98); + cLib_addCalc2(&a_this->field_0x8ec[i], a_this->field_0x964[i], 0.5f, 0.2f); + cLib_addCalc0(&a_this->field_0x9dc[i], 0.1f, 0.2f); + } + } + + for (int i = 0; i < 15; i++) { + if (var_r27 && boss->mDemoAction == 0) { + a_this->mColliders[i].OnCoSetBit(); + } else { + a_this->mColliders[i].OffCoSetBit(); + } + } + + Cinit = 0; +} + +/* 8061CB4C-8061CD98 00150C 024C+00 1/1 0/0 0/0 .text damage_check__FP10b_oh_class */ +static void damage_check(b_oh_class* i_this) { + i_this->mCcStts.Move(); + + if (i_this->field_0x5f4 == 0) { + BOOL bvar = false; + for (int i = 7; i < 15; i++) { + if (i_this->mColliders[i].ChkTgHit()) { + i_this->mAtInfo.mpCollider = i_this->mColliders[i].GetTgHitObj(); + i_this->health = 1000; + cc_at_check(i_this, &i_this->mAtInfo); + + MTXCopy(i_this->mpMorf->getModel()->i_getAnmMtx(i * 2 + 1), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&i_this->eyePos); + i_dComIfGp_setHitMark(1, i_this, &i_this->eyePos, NULL, NULL, 0); + mDoAud_seStart(Z2SE_EN_OI_HIT_TENTACLE, &i_this->eyePos, 0, 0); + + bvar = true; + i_this->field_0x5f4 = 20; + break; + } + } + + if (i_this->mAction == ACTION_ATTACK && boss->field_0x5d10) { + boss->field_0x5d10 = 0; + bvar = true; + } + + if (bvar) { + i_this->field_0x60c = 2000.0f; + i_this->field_0x610 = 0.5f; + + if (i_this->mAction != ACTION_WAIT) { + i_this->mAction = ACTION_WAIT; + i_this->mActionPhase = 0; + i_this->field_0xc98 = 0; + i_this->field_0xca2 = 0; + } + + if (boss->mDemoAction != 0) { + boss->mDemoAction = 100; + boss->field_0x4738 = 30; + boss->field_0x473c = 2; + boss->field_0x4794 = 180; + } + + i_this->field_0x5f4 = 6; + boss->field_0x59e0.startCreatureVoice(Z2SE_EN_OI_V_TENT_DAMAGE, -1); + } + } +} + +/* 8061CD98-8061D05C 001758 02C4+00 2/1 0/0 0/0 .text daB_OH_Execute__FP10b_oh_class */ +static int daB_OH_Execute(b_oh_class* i_this) { + if (cDmrNowMidnaTalk()) { + return 1; + } + + if (i_this->field_0x5c8 == 0) { + boss = (b_ob_class*)fopAcM_SearchByID(i_this->parentActorID); + } + + if (boss == NULL) { + return 1; + } + + if (boss->field_0x4752 == 5 && i_this->mAction != ACTION_END) { + i_this->mAction = ACTION_END; + i_this->mActionPhase = 0; + } + + cXyz collider_center; + + i_this->field_0x5cc++; + + for (int i = 0; i < 4; i++) { + if (i_this->mTimers[i] != 0) { + i_this->mTimers[i]--; + } + } + + if (i_this->field_0x5f4 != 0) { + i_this->field_0x5f4--; + } + + damage_check(i_this); + action(i_this); + + mDoMtx_stack_c::transS(i_this->current.pos.x, i_this->current.pos.y + i_this->field_0xcac, + i_this->current.pos.z); + mDoMtx_stack_c::YrotM(i_this->shape_angle.y); + mDoMtx_stack_c::XrotM(i_this->shape_angle.x); + mDoMtx_stack_c::scaleM(l_HIO.mModelSize, l_HIO.mModelSize, l_HIO.mModelSize); + + J3DModel* model_p = i_this->mpMorf->getModel(); + model_p->i_setBaseTRMtx(mDoMtx_stack_c::get()); + i_this->mpMorf->play(NULL, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this)), 0); + i_this->mpBtk->play(); + i_this->mpBrk->play(); + i_this->mpMorf->modelCalc(); + + int tmp = 1; + if (i_this->mDistToPlayer > 150.0f && i_this->mAction == ACTION_WAIT) { + tmp = i_this->field_0x5cc & 1; + } + + for (int i = 0; i < 15; i++) { + MTXCopy(model_p->i_getAnmMtx(tmp + i * 2), mDoMtx_stack_c::get()); + mDoMtx_stack_c::multVecZero(&collider_center); + + if (i_this->mAction >= ACTION_END) { + collider_center.z -= 20000.0f; + } + + i_this->mColliders[i].SetC(collider_center); + + if (i_this->mAction == ACTION_ATTACK) { + i_this->mColliders[i].SetR(l_HIO.mModelSize * 70.0f); + } else { + i_this->mColliders[i].SetR(l_HIO.mModelSize * 50.0f); + } + + dComIfG_Ccsp()->Set(&i_this->mColliders[i]); + } + + return 1; +} + +/* 8061D05C-8061D064 001A1C 0008+00 1/0 0/0 0/0 .text daB_OH_IsDelete__FP10b_oh_class */ +static int daB_OH_IsDelete(b_oh_class* i_this) { + return 1; +} + +/* 8061D064-8061D0B8 001A24 0054+00 1/0 0/0 0/0 .text daB_OH_Delete__FP10b_oh_class */ +static int daB_OH_Delete(b_oh_class* i_this) { + dComIfG_resDelete(&i_this->mPhase, "B_oh"); + if (i_this->field_0x1f86) { + data_8061DBB5 = 0; + } + + return 1; +} + +/* 8061D0B8-8061D39C 001A78 02E4+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */ +static int useHeapInit(fopAc_ac_c* i_this) { + b_oh_class* this_ = (b_oh_class*)i_this; + + this_->mpMorf = new mDoExt_McaMorf((J3DModelData*)dComIfG_getObjectRes("B_oh", 0x29), NULL, + NULL, NULL, 2, 1.0f, 0, -1, 1, NULL, 0, 0x11000284); + if (this_->mpMorf == NULL || this_->mpMorf->getModel() == NULL) { + return 0; + } + + if (!this_->mInvisModel.create(this_->mpMorf->getModel(), 1)) { + return 0; + } + + this_->mpMorf->getModel()->setUserArea((u32)this_); + + for (u16 i = 0; i < this_->mpMorf->getModel()->getModelData()->getJointNum(); i++) { + this_->mpMorf->getModel()->getModelData()->getJointNodePointer(i)->setCallBack( + nodeCallBack); + } + + this_->mpBtk = new mDoExt_btkAnm(); + if (this_->mpBtk == NULL) { + return 0; + } + + J3DAnmTextureSRTKey* btk = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes("B_oh", 0x36); + if (!this_->mpBtk->init(this_->mpMorf->getModel()->getModelData(), btk, TRUE, 2, 1.0f, 0, -1)) { + return 0; + } + + this_->mpBtk->setFrame(cM_rndF(39.0f)); + this_->mpBtk->setPlaySpeed(cM_rndFX(0.1f) + 1.0f); + + this_->mpBrk = new mDoExt_brkAnm(); + if (this_->mpBrk == NULL) { + return 0; + } + + J3DAnmTevRegKey* brk = (J3DAnmTevRegKey*)dComIfG_getObjectRes("B_oh", 0x2F); + if (!this_->mpBrk->init(this_->mpMorf->getModel()->getModelData(), brk, TRUE, 2, 1.0f, 0, -1)) { + return 0; + } + + this_->mpBrk->setFrame(cM_rndF(39.0f)); + this_->mpBrk->setPlaySpeed(cM_rndFX(0.1f) + 1.0f); + + return 1; +} + +/* 8061D3E4-8061D718 001DA4 0334+00 1/0 0/0 0/0 .text daB_OH_Create__FP10fopAc_ac_c */ +static int daB_OH_Create(fopAc_ac_c* i_this) { + fopAcM_SetupActor(i_this, b_oh_class); + b_oh_class* this_ = (b_oh_class*)i_this; + + int phase = dComIfG_resLoad(&this_->mPhase, "B_oh"); + if (phase == cPhs_COMPLEATE_e) { + this_->field_0x5c8 = fopAcM_GetParam(this_) & 0xFF; + + if (!fopAcM_entrySolidHeap(this_, useHeapInit, 0x23E0)) { + return cPhs_ERROR_e; + } + + if (!data_8061DBB5) { + this_->field_0x1f86 = 1; + data_8061DBB5 = 1; + l_HIO.field_0x4 = -1; + } + + this_->health = 1000; + this_->field_0x560 = 1000; + + this_->field_0x5cc = cM_rndF(65536.0f); + this_->field_0x5f6 = cM_rndF(65536.0f); + this_->field_0x5f8 = cM_rndF(65536.0f); + this_->field_0x5fa = cM_rndF(65536.0f); + this_->field_0x614 = cM_rndF(100.0f) + 400.0f; + + static dCcD_SrcSph cc_sph_src = { + { + {0, {{0, 0, 12}, {0xD8FBFDFF, 3}, 0x15}}, + {dCcD_SE_NONE, 0, 0, 0, {0}}, + {dCcD_SE_NONE, 0, 0, 0, {0x80}}, + {0}, + }, + { + { + {0.0f, 0.0f, 0.0f}, + 60.0f, + }, + }, + }; + + this_->mCcStts.Init(0xFF, 0, this_); + for (int i = 0; i < 15; i++) { + this_->mColliders[i].Set(cc_sph_src); + this_->mColliders[i].SetStts(&this_->mCcStts); + this_->mColliders[i].OnTgNoHitMark(); + } + + this_->current.angle.x = -0x3448; + + if (cDmr_SkipInfo) { + this_->mAction = ACTION_WAIT; + this_->mActionPhase = 1; + this_->mTimers[0] = cM_rndF(100.0f) + 200.0f; + this_->mTentacleLength = l_HIO.mLength; + this_->field_0x608 = 1.0f; + Cinit = 1; + } else { + this_->mAction = ACTION_START; + Cinit = 0; + } + + daB_OH_Execute(this_); + } + + return phase; +} + +/* 8061D93C-8061D984 0022FC 0048+00 2/1 0/0 0/0 .text __dt__12daB_OH_HIO_cFv */ +/* #pragma push +#pragma optimization_level 0 +#pragma optimizewithasm off +asm daB_OH_HIO_c::~daB_OH_HIO_c() { + nofralloc +#include "asm/rel/d/a/b/d_a_b_oh/d_a_b_oh/__dt__12daB_OH_HIO_cFv.s" +} +#pragma pop */ + +/* ############################################################################################## */ +/* 8061DBDC-8061DBE0 00006C 0004+00 0/0 0/0 0/0 .bss + * sInstance__40JASGlobalInstance<19JASDefaultBankTable> */ +#pragma push +#pragma force_active on +static u8 data_8061DBDC[4]; +#pragma pop + +/* 8061DBE0-8061DBE4 000070 0004+00 0/0 0/0 0/0 .bss + * sInstance__35JASGlobalInstance<14JASAudioThread> */ +#pragma push +#pragma force_active on +static u8 data_8061DBE0[4]; +#pragma pop + +/* 8061DBE4-8061DBE8 000074 0004+00 0/0 0/0 0/0 .bss sInstance__27JASGlobalInstance<7Z2SeMgr> */ +#pragma push +#pragma force_active on +static u8 data_8061DBE4[4]; +#pragma pop + +/* 8061DBE8-8061DBEC 000078 0004+00 0/0 0/0 0/0 .bss sInstance__28JASGlobalInstance<8Z2SeqMgr> */ +#pragma push +#pragma force_active on +static u8 data_8061DBE8[4]; +#pragma pop + +/* 8061DBEC-8061DBF0 00007C 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2SceneMgr> + */ +#pragma push +#pragma force_active on +static u8 data_8061DBEC[4]; +#pragma pop + +/* 8061DBF0-8061DBF4 000080 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2StatusMgr> + */ +#pragma push +#pragma force_active on +static u8 data_8061DBF0[4]; +#pragma pop + +/* 8061DBF4-8061DBF8 000084 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2DebugSys> + */ +#pragma push +#pragma force_active on +static u8 data_8061DBF4[4]; +#pragma pop + +/* 8061DBF8-8061DBFC 000088 0004+00 0/0 0/0 0/0 .bss + * sInstance__36JASGlobalInstance<15JAISoundStarter> */ +#pragma push +#pragma force_active on +static u8 data_8061DBF8[4]; +#pragma pop + +/* 8061DBFC-8061DC00 00008C 0004+00 0/0 0/0 0/0 .bss + * sInstance__35JASGlobalInstance<14Z2SoundStarter> */ +#pragma push +#pragma force_active on +static u8 data_8061DBFC[4]; +#pragma pop + +/* 8061DC00-8061DC04 000090 0004+00 0/0 0/0 0/0 .bss + * sInstance__33JASGlobalInstance<12Z2SpeechMgr2> */ +#pragma push +#pragma force_active on +static u8 data_8061DC00[4]; +#pragma pop + +/* 8061DC04-8061DC08 000094 0004+00 0/0 0/0 0/0 .bss sInstance__28JASGlobalInstance<8JAISeMgr> */ +#pragma push +#pragma force_active on +static u8 data_8061DC04[4]; +#pragma pop + +/* 8061DC08-8061DC0C 000098 0004+00 0/0 0/0 0/0 .bss sInstance__29JASGlobalInstance<9JAISeqMgr> */ +#pragma push +#pragma force_active on +static u8 data_8061DC08[4]; +#pragma pop + +/* 8061DC0C-8061DC10 00009C 0004+00 0/0 0/0 0/0 .bss + * sInstance__33JASGlobalInstance<12JAIStreamMgr> */ +#pragma push +#pragma force_active on +static u8 data_8061DC0C[4]; +#pragma pop + +/* 8061DC10-8061DC14 0000A0 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2SoundMgr> + */ +#pragma push +#pragma force_active on +static u8 data_8061DC10[4]; +#pragma pop + +/* 8061DC14-8061DC18 0000A4 0004+00 0/0 0/0 0/0 .bss + * sInstance__33JASGlobalInstance<12JAISoundInfo> */ +#pragma push +#pragma force_active on +static u8 data_8061DC14[4]; +#pragma pop + +/* 8061DC18-8061DC1C 0000A8 0004+00 0/0 0/0 0/0 .bss + * sInstance__34JASGlobalInstance<13JAUSoundTable> */ +#pragma push +#pragma force_active on +static u8 data_8061DC18[4]; +#pragma pop + +/* 8061DC1C-8061DC20 0000AC 0004+00 0/0 0/0 0/0 .bss + * sInstance__38JASGlobalInstance<17JAUSoundNameTable> */ +#pragma push +#pragma force_active on +static u8 data_8061DC1C[4]; +#pragma pop + +/* 8061DC20-8061DC24 0000B0 0004+00 0/0 0/0 0/0 .bss + * sInstance__33JASGlobalInstance<12JAUSoundInfo> */ +#pragma push +#pragma force_active on +static u8 data_8061DC20[4]; +#pragma pop + +/* 8061DC24-8061DC28 0000B4 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2SoundInfo> + */ +#pragma push +#pragma force_active on +static u8 data_8061DC24[4]; +#pragma pop + +/* 8061DC28-8061DC2C 0000B8 0004+00 0/0 0/0 0/0 .bss + * sInstance__34JASGlobalInstance<13Z2SoundObjMgr> */ +#pragma push +#pragma force_active on +static u8 data_8061DC28[4]; +#pragma pop + +/* 8061DC2C-8061DC30 0000BC 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2Audience> + */ +#pragma push +#pragma force_active on +static u8 data_8061DC2C[4]; +#pragma pop + +/* 8061DC30-8061DC34 0000C0 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2FxLineMgr> + */ +#pragma push +#pragma force_active on +static u8 data_8061DC30[4]; +#pragma pop + +/* 8061DC34-8061DC38 0000C4 0004+00 0/0 0/0 0/0 .bss sInstance__31JASGlobalInstance<10Z2EnvSeMgr> + */ +#pragma push +#pragma force_active on +static u8 data_8061DC34[4]; +#pragma pop + +/* 8061DC38-8061DC3C 0000C8 0004+00 0/0 0/0 0/0 .bss sInstance__32JASGlobalInstance<11Z2SpeechMgr> + */ +#pragma push +#pragma force_active on +static u8 data_8061DC38[4]; +#pragma pop + +/* 8061DC3C-8061DC40 0000CC 0004+00 0/0 0/0 0/0 .bss + * sInstance__34JASGlobalInstance<13Z2WolfHowlMgr> */ +#pragma push +#pragma force_active on +static u8 data_8061DC3C[4]; +#pragma pop + +/* 8061DA74-8061DA74 0000A0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ + +/* 8061DAEC-8061DB0C -00001 0020+00 1/0 0/0 0/0 .data l_daB_OH_Method */ +SECTION_DATA static void* l_daB_OH_Method[8] = { + (void*)daB_OH_Create__FP10fopAc_ac_c, + (void*)daB_OH_Delete__FP10b_oh_class, + (void*)daB_OH_Execute__FP10b_oh_class, + (void*)daB_OH_IsDelete__FP10b_oh_class, + (void*)daB_OH_Draw__FP10b_oh_class, + (void*)NULL, + (void*)NULL, + (void*)NULL, +}; + +/* 8061DB0C-8061DB3C -00001 0030+00 0/0 0/0 1/0 .data g_profile_B_OH */ +SECTION_DATA extern void* g_profile_B_OH[12] = { + (void*)0xFFFFFFFD, (void*)0x0003FFFD, + (void*)0x00D20000, (void*)&g_fpcLf_Method, + (void*)0x00001F88, (void*)NULL, + (void*)NULL, (void*)&g_fopAc_Method, + (void*)0x00DA0000, (void*)&l_daB_OH_Method, + (void*)0x00044000, (void*)0x020E0000, +};
\ No newline at end of file diff --git a/rel/d/a/b/d_a_b_zant_sima/d_a_b_zant_sima.cpp b/rel/d/a/b/d_a_b_zant_sima/d_a_b_zant_sima.cpp index 7ff67483d4..52fdb6046e 100644 --- a/rel/d/a/b/d_a_b_zant_sima/d_a_b_zant_sima.cpp +++ b/rel/d/a/b/d_a_b_zant_sima/d_a_b_zant_sima.cpp @@ -1,33 +1,21 @@ -// -// Generated By: dol2asm -// Translation Unit: d_a_b_zant_sima -// +/** + * d_a_b_zant_sima.cpp + * Boss Zant Lava Island + */ #include "rel/d/a/b/d_a_b_zant_sima/d_a_b_zant_sima.h" -#include "JSystem/JKernel/JKRHeap.h" #include "SSystem/SComponent/c_math.h" #include "d/a/d_a_player.h" #include "d/com/d_com_inf_game.h" -#include "d/d_procname.h" -// -// Forward References: -// - -static int daB_ZANTS_Draw(daB_ZANTS_c*); -static int daB_ZANTS_Execute(daB_ZANTS_c*); -static int daB_ZANTS_IsDelete(daB_ZANTS_c*); -static int daB_ZANTS_Delete(daB_ZANTS_c*); -static int daB_ZANTS_Create(daB_ZANTS_c*); - -// -// Declarations: -// +#define TIMER_PLAYER 0 +#define TIMER_ZANT 1 /* 806529D8-80652AAC 000078 00D4+00 1/1 0/0 0/0 .text draw__11daB_ZANTS_cFv */ int daB_ZANTS_c::draw() { g_env_light.settingTevStruct(16, ¤t.pos, &tevStr); g_env_light.setLightTevColorType_MAJI(mpModel, &tevStr); + dComIfGd_setListBG(); mpBtkAnm->entry(mpModel->getModelData()); mpBrkAnm->entry(mpModel->getModelData()); @@ -43,13 +31,13 @@ static int daB_ZANTS_Draw(daB_ZANTS_c* i_this) { /* 80652ACC-80652B28 00016C 005C+00 1/1 0/0 0/0 .text * zants_ride_call_back__FP4dBgWP10fopAc_ac_cP10fopAc_ac_c */ -static void zants_ride_call_back(dBgW* param_0, fopAc_ac_c* i_this, fopAc_ac_c* i_target) { +static void zants_ride_call_back(dBgW* i_bgw, fopAc_ac_c* i_this, fopAc_ac_c* i_target) { if (fopAcM_GetName(i_target) == PROC_ALINK) { ((daB_ZANTS_c*)i_this)->mPlayerID = fopAcM_GetID(i_target); - ((daB_ZANTS_c*)i_this)->field_0x584[0] = 3; + ((daB_ZANTS_c*)i_this)->mSinkTimers[TIMER_PLAYER] = 3; } else if (fopAcM_GetName(i_target) == PROC_B_ZANT) { ((daB_ZANTS_c*)i_this)->mBossID = fopAcM_GetID(i_target); - ((daB_ZANTS_c*)i_this)->field_0x584[1] = 3; + ((daB_ZANTS_c*)i_this)->mSinkTimers[TIMER_ZANT] = 3; } } @@ -57,50 +45,61 @@ static void zants_ride_call_back(dBgW* param_0, fopAc_ac_c* i_this, fopAc_ac_c* void daB_ZANTS_c::action() { daPy_py_c* player = daPy_getPlayerActorClass(); if (player->i_checkMagneBootsOn()) { - field_0x584[0] = 3; + mSinkTimers[TIMER_PLAYER] = 3; mPlayerID = fopAcM_GetID(player); } - cXyz pos = current.pos; - fopAc_ac_c* target; - if (field_0x584[1] != 0) { - if (fopAcM_SearchByID(mBossID, &target), target != NULL) { - pos = target->current.pos; + + cXyz target_pos = current.pos; + + if (mSinkTimers[TIMER_ZANT] != 0) { + fopAc_ac_c* target; + fopAcM_SearchByID(mBossID, &target); + + if (target != NULL) { + target_pos = target->current.pos; } } - u8 temp = field_0x584[3]; - field_0x584[3] = 0; - field_0x584[2] = 0; - if (field_0x584[1]) { - field_0x584[3] = 1; - } - if (field_0x584[0]) { - field_0x584[2] = 1; - } - f32 x = pos.x - current.pos.x; - f32 z = pos.z - current.pos.z; - pos.absXZ(current.pos); - cLib_addCalcAngleS2(&field_0x58c.y, cM_atan2s(x, z), 8, 1024); - if (temp == 0 && field_0x584[3] != 0) { - if (field_0x58c.x == 0) { - field_0x58c.y = cM_atan2s(x, z); + + bool prev_sink_zant = mSinkZant; + mSinkZant = false; + mSinkPlayer = false; + if (mSinkTimers[TIMER_ZANT] != 0) { + mSinkZant = true; + } + + if (mSinkTimers[TIMER_PLAYER] != 0) { + mSinkPlayer = true; + } + + f32 x = target_pos.x - current.pos.x; + f32 z = target_pos.z - current.pos.z; + target_pos.absXZ(current.pos); + cLib_addCalcAngleS2(&mRotation.y, cM_atan2s(x, z), 8, 0x400); + + if (!prev_sink_zant && mSinkZant) { + if (mRotation.x == 0) { + mRotation.y = cM_atan2s(x, z); } - field_0x58c.z = 0x400; + mRotation.z = 0x400; } - cLib_addCalcAngleS2(&field_0x58c.x, 0, 8, 64); - field_0x58c.x += field_0x58c.z; - if (0x1400 < field_0x58c.x) { - field_0x58c.x = 0x1400; - field_0x58c.z = 0; + + cLib_addCalcAngleS2(&mRotation.x, 0, 8, 0x40); + mRotation.x += mRotation.z; + if (0x1400 < mRotation.x) { + mRotation.x = 0x1400; + mRotation.z = 0; } - cLib_chaseAngleS(&field_0x58c.z, 0, 128); - f32 temp2 = 150.0f; - if (field_0x584[0] || field_0x584[1]) { - temp2 = 130.0f; + cLib_chaseAngleS(&mRotation.z, 0, 0x80); + + f32 target_height = 150.0f; + if (mSinkTimers[TIMER_PLAYER] != 0 || mSinkTimers[TIMER_ZANT] != 0) { + target_height = 130.0f; } - cLib_addCalc2(&field_0x588, temp2, 0.2f, 20.0f); + + cLib_addCalc2(&mHeight, target_height, 0.2f, 20.0f); for (int i = 0; i < 2; i++) { - if (field_0x584[i] != 0) { - field_0x584[i] -= 1; + if (mSinkTimers[i] != 0) { + mSinkTimers[i]--; } } } @@ -109,17 +108,20 @@ void daB_ZANTS_c::action() { int daB_ZANTS_c::execute() { mpBrkAnm->play(); mpBtkAnm->play(); - mDoMtx_stack_c::transS(current.pos.x, current.pos.y + field_0x588, current.pos.z); - mDoMtx_stack_c::YrotM(field_0x58c.y); - mDoMtx_stack_c::XrotM(field_0x58c.x); - mDoMtx_stack_c::YrotM(-field_0x58c.y); + + mDoMtx_stack_c::transS(current.pos.x, current.pos.y + mHeight, current.pos.z); + mDoMtx_stack_c::YrotM(mRotation.y); + mDoMtx_stack_c::XrotM(mRotation.x); + mDoMtx_stack_c::YrotM(-mRotation.y); mDoMtx_stack_c::ZXYrotM(shape_angle); mDoMtx_stack_c::transM(0.0f, -30.0f, 0.0f); mpModel->i_setBaseTRMtx(mDoMtx_stack_c::get()); - cMtx_copy(mDoMtx_stack_c::get(), field_0x594); - if (mpBgW) { + cMtx_copy(mDoMtx_stack_c::get(), mMtx); + + if (mpBgW != NULL) { mpBgW->Move(); } + action(); return 1; } @@ -137,7 +139,7 @@ static int daB_ZANTS_IsDelete(daB_ZANTS_c* i_this) { /* 80652EC0-80652F18 000560 0058+00 1/1 0/0 0/0 .text _delete__11daB_ZANTS_cFv */ int daB_ZANTS_c::_delete() { dComIfG_resDelete(&mPhase, "MAGNESIMA"); - if (mpBgW) { + if (mpBgW != NULL) { dComIfG_Bgsp().Release(mpBgW); } return 1; @@ -148,65 +150,51 @@ static int daB_ZANTS_Delete(daB_ZANTS_c* i_this) { return i_this->_delete(); } -/* 80653370-80653390 -00001 0020+00 1/0 0/0 0/0 .data l_daB_ZANTS_Method */ -static actor_method_class l_daB_ZANTS_Method = { - (process_method_func)daB_ZANTS_Create, (process_method_func)daB_ZANTS_Delete, - (process_method_func)daB_ZANTS_Execute, (process_method_func)daB_ZANTS_IsDelete, - (process_method_func)daB_ZANTS_Draw, -}; - -/* 80653390-806533C0 -00001 0030+00 0/0 0/0 1/0 .data g_profile_B_ZANTS */ -extern actor_process_profile_definition g_profile_B_ZANTS = { - fpcLy_CURRENT_e, - 3, - fpcPi_CURRENT_e, - PROC_B_ZANTS, - &g_fpcLf_Method.mBase, - sizeof(daB_ZANTS_c), - 0, - 0, - &g_fopAc_Method.base, - 229, - &l_daB_ZANTS_Method, - 0x40000, - fopAc_ACTOR_e, - fopAc_CULLBOX_CUSTOM_e, -}; - /* 80652F38-80653180 0005D8 0248+00 1/1 0/0 0/0 .text CreateHeap__11daB_ZANTS_cFv */ int daB_ZANTS_c::CreateHeap() { J3DModelData* model_data = (J3DModelData*)dComIfG_getObjectRes("MAGNESIMA", 7); mpModel = mDoExt_J3DModel__create(model_data, 0x80000, 0x11000084); if (mpModel == NULL) { - return 0; + return FALSE; } + mpBtkAnm = new mDoExt_btkAnm(); if (mpBtkAnm == NULL) { - return 0; + return FALSE; } - J3DAnmTextureSRTKey* srtkey = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes("MAGNESIMA", 13); - if (!mpBtkAnm->init(mpModel->getModelData(), srtkey, 1, 2, 1.0f, 0, -1)) { - return 0; + + J3DAnmTextureSRTKey* pbtk = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes("MAGNESIMA", 13); + if (!mpBtkAnm->init(mpModel->getModelData(), pbtk, TRUE, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, + -1)) + { + return FALSE; } + mpBrkAnm = new mDoExt_brkAnm(); if (mpBrkAnm == NULL) { - return 0; + return FALSE; } - J3DAnmTevRegKey* tevkey = (J3DAnmTevRegKey*)dComIfG_getObjectRes("MAGNESIMA", 10); - if (!mpBrkAnm->init(mpModel->getModelData(), tevkey, 1, 2, 1.0f, 0, -1)) { - return 0; + + J3DAnmTevRegKey* pbrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes("MAGNESIMA", 10); + if (!mpBrkAnm->init(mpModel->getModelData(), pbrk, TRUE, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, + -1)) + { + return FALSE; } + mpBgW = new dBgW(); if (mpBgW == NULL) { - return 0; + return FALSE; } - cBgD_t* bgt = (cBgD_t*)dComIfG_getObjectRes("MAGNESIMA", 16); - if (mpBgW->Set(bgt, 1, &field_0x594)) { - return 0; + + cBgD_t* pdzb = (cBgD_t*)dComIfG_getObjectRes("MAGNESIMA", 16); + if (mpBgW->Set(pdzb, cBgW::MOVE_BG_e, &mMtx)) { + return FALSE; } + mpBgW->SetCrrFunc(dBgS_MoveBGProc_Typical); mpBgW->SetRideCallback(zants_ride_call_back); - return 1; + return TRUE; } /* 806531C8-806531E8 000868 0020+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */ @@ -217,25 +205,54 @@ static int useHeapInit(fopAc_ac_c* i_this) { /* 806531E8-80653304 000888 011C+00 1/1 0/0 0/0 .text create__11daB_ZANTS_cFv */ int daB_ZANTS_c::create() { fopAcM_SetupActor(this, daB_ZANTS_c); - int result = dComIfG_resLoad(&mPhase, "MAGNESIMA"); - if (result == cPhs_COMPLEATE_e) { + + int phase_state = dComIfG_resLoad(&mPhase, "MAGNESIMA"); + if (phase_state == cPhs_COMPLEATE_e) { if (!fopAcM_entrySolidHeap(this, useHeapInit, 0x3AA0)) { return cPhs_ERROR_e; } + if (mpBgW && dComIfG_Bgsp().Regist(mpBgW, this)) { return cPhs_ERROR_e; } + attention_info.flags = 0; - field_0x588 = 150.0f; + mHeight = 150.0f; fopAcM_SetMtx(this, mpModel->getBaseTRMtx()); fopAcM_SetMin(this, -200.0f, -500.0f, -500.0f); fopAcM_SetMax(this, 200.0f, 500.0f, 500.0f); daB_ZANTS_Execute(this); } - return result; + + return phase_state; } /* 80653304-80653324 0009A4 0020+00 1/0 0/0 0/0 .text daB_ZANTS_Create__FP11daB_ZANTS_c */ static int daB_ZANTS_Create(daB_ZANTS_c* i_this) { return i_this->create(); } + +/* 80653370-80653390 -00001 0020+00 1/0 0/0 0/0 .data l_daB_ZANTS_Method */ +static actor_method_class l_daB_ZANTS_Method = { + (process_method_func)daB_ZANTS_Create, (process_method_func)daB_ZANTS_Delete, + (process_method_func)daB_ZANTS_Execute, (process_method_func)daB_ZANTS_IsDelete, + (process_method_func)daB_ZANTS_Draw, +}; + +/* 80653390-806533C0 -00001 0030+00 0/0 0/0 1/0 .data g_profile_B_ZANTS */ +extern actor_process_profile_definition g_profile_B_ZANTS = { + fpcLy_CURRENT_e, + 3, + fpcPi_CURRENT_e, + PROC_B_ZANTS, + &g_fpcLf_Method.mBase, + sizeof(daB_ZANTS_c), + 0, + 0, + &g_fopAc_Method.base, + 229, + &l_daB_ZANTS_Method, + 0x40000, + fopAc_ACTOR_e, + fopAc_CULLBOX_CUSTOM_e, +};
\ No newline at end of file diff --git a/rel/d/a/d_a_midna/d_a_midna.cpp b/rel/d/a/d_a_midna/d_a_midna.cpp index fc5a14569c..7a7b1df871 100644 --- a/rel/d/a/d_a_midna/d_a_midna.cpp +++ b/rel/d/a/d_a_midna/d_a_midna.cpp @@ -10,17 +10,6 @@ // Types: // -struct fopAcM_lc_c { - /* 8001DC68 */ void lineCheck(cXyz const*, cXyz const*, fopAc_ac_c const*); -}; - -struct fopAcM_gc_c { - /* 8001DCBC */ void gndCheck(cXyz const*); - - static u8 mGndCheck[84]; - static f32 mGroundY; -}; - struct J3DMaterial {}; struct daMidna_matAnm_c { diff --git a/rel/d/a/d_a_shop_item/d_a_shop_item.cpp b/rel/d/a/d_a_shop_item/d_a_shop_item.cpp index 0723a7a553..e667f169a0 100644 --- a/rel/d/a/d_a_shop_item/d_a_shop_item.cpp +++ b/rel/d/a/d_a_shop_item/d_a_shop_item.cpp @@ -1,629 +1,311 @@ -// -// Generated By: dol2asm -// Translation Unit: d_a_shop_item -// +/** + * d_a_shop_item.cpp + * Shop Item Actor + */ #include "rel/d/a/d_a_shop_item/d_a_shop_item.h" -#include "dol2asm.h" - -// -// Types: -// - -struct request_of_phase_process_class {}; - -struct mDoMtx_stack_c { - static u8 now[48]; -}; - -struct mDoLib_clipper { - static f32 mSystemFar; -}; - -struct fopAc_ac_c { - /* 80018B64 */ fopAc_ac_c(); -}; - -struct daShopItem_c { - /* 8059E9B8 */ void getShopArcname(); - /* 8059EC04 */ void getHeapSize(); - /* 8059EC1C */ void CreateInit(); - /* 8059ED58 */ void set_mtx(); - /* 8059EEF4 */ void _execute(); - /* 8059EF48 */ void _draw(); - /* 8059EF9C */ void setListStart(); - /* 8059EFA0 */ void setShadow(); - /* 8059F024 */ void chkFlag(int); - /* 8059F044 */ void getTevFrm(); - /* 8059F064 */ void getBtpFrm(); - /* 8059F084 */ void getShadowSize(); - /* 8059F0A0 */ void getCollisionH(); - /* 8059F0BC */ void getCollisionR(); - - static void* const mData[276]; - static f32 const m_cullfar_max; -}; - -struct daItemBase_c { - /* 80037A74 */ void show(); - /* 80037ACC */ void chkDraw(); - /* 80144724 */ void DeleteBase(char const*); - /* 8014474C */ bool clothCreate(); - /* 80144754 */ bool __CreateHeap(); - /* 80144B94 */ void DrawBase(); - /* 80144C30 */ void RotateYBase(); - /* 80144CC4 */ void settingBeforeDraw(); - /* 80144D18 */ void setTevStr(); - /* 80144D70 */ void setShadow(); - /* 80144EDC */ void animEntry(); - /* 8014503C */ void animPlay(f32, f32, f32, f32, f32, f32); -}; - -struct dKy_tevstr_c {}; - -struct dDlst_shadowControl_c { - static u8 mSimpleTexObj[32]; -}; - -struct dCcD_GStts { - /* 80083760 */ dCcD_GStts(); -}; - -struct dCcD_GObjInf { - /* 80083A28 */ dCcD_GObjInf(); -}; - -struct dBgS_PolyPassChk { - /* 80078E68 */ void SetObj(); -}; - -struct dBgS_ObjAcch { - /* 8059F324 */ ~dBgS_ObjAcch(); -}; - -struct dBgS_AcchCir { - /* 80075EAC */ dBgS_AcchCir(); -}; - -struct dBgS_Acch { - /* 80075F94 */ ~dBgS_Acch(); - /* 800760A0 */ dBgS_Acch(); -}; - -struct cXyz {}; - -struct cM3dGCyl { - /* 8059F294 */ ~cM3dGCyl(); -}; - -struct cM3dGAab { - /* 8059F2DC */ ~cM3dGAab(); -}; - -struct cBgS_PolyInfo {}; - -struct _GXTexObj {}; - -struct J3DModel {}; - -// -// Forward References: -// - -extern "C" void getShopArcname__12daShopItem_cFv(); -extern "C" void getHeapSize__12daShopItem_cFv(); -extern "C" void CreateInit__12daShopItem_cFv(); -extern "C" void set_mtx__12daShopItem_cFv(); -extern "C" void _execute__12daShopItem_cFv(); -extern "C" void _draw__12daShopItem_cFv(); -extern "C" void setListStart__12daShopItem_cFv(); -extern "C" void setShadow__12daShopItem_cFv(); -extern "C" void chkFlag__12daShopItem_cFi(); -extern "C" void getTevFrm__12daShopItem_cFv(); -extern "C" void getBtpFrm__12daShopItem_cFv(); -extern "C" void getShadowSize__12daShopItem_cFv(); -extern "C" void getCollisionH__12daShopItem_cFv(); -extern "C" void getCollisionR__12daShopItem_cFv(); -extern "C" static void daShopItem_Create__FPv(); -extern "C" void __dt__8cM3dGCylFv(); -extern "C" void __dt__8cM3dGAabFv(); -extern "C" void __dt__12dBgS_ObjAcchFv(); -extern "C" static void daShopItem_Delete__FPv(); -extern "C" static void daShopItem_Draw__FPv(); -extern "C" static void daShopItem_Execute__FPv(); -extern "C" static bool daShopItem_IsDelete__FPv(); -extern "C" static void func_8059F420(); -extern "C" static void func_8059F428(); -extern "C" f32 const m_cullfar_max__12daShopItem_c; -extern "C" extern char const* const d_a_shop_item__stringBase0; - -// -// External References: -// - -extern "C" void mDoMtx_ZXYrotM__FPA4_fsss(); -extern "C" void mDoMtx_XrotM__FPA4_fs(); -extern "C" void mDoMtx_YrotM__FPA4_fs(); -extern "C" void __ct__10fopAc_ac_cFv(); -extern "C" void fopAcM_entrySolidHeap__FP10fopAc_ac_cPFP10fopAc_ac_c_iUl(); -extern "C" void fopAcM_setCullSizeBox__FP10fopAc_ac_cffffff(); -extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc(); -extern "C" void -dComIfGd_setShadow__FUlScP8J3DModelP4cXyzffffR13cBgS_PolyInfoP12dKy_tevstr_csfP9_GXTexObj(); -extern "C" void show__12daItemBase_cFv(); -extern "C" void chkDraw__12daItemBase_cFv(); -extern "C" void CheckShopItemCreateHeap__FP10fopAc_ac_c(); -extern "C" void __ct__12dBgS_AcchCirFv(); -extern "C" void __dt__9dBgS_AcchFv(); -extern "C" void __ct__9dBgS_AcchFv(); -extern "C" void SetObj__16dBgS_PolyPassChkFv(); -extern "C" void __ct__10dCcD_GSttsFv(); -extern "C" void __ct__12dCcD_GObjInfFv(); -extern "C" void DeleteBase__12daItemBase_cFPCc(); -extern "C" bool clothCreate__12daItemBase_cFv(); -extern "C" bool __CreateHeap__12daItemBase_cFv(); -extern "C" void DrawBase__12daItemBase_cFv(); -extern "C" void RotateYBase__12daItemBase_cFv(); -extern "C" void settingBeforeDraw__12daItemBase_cFv(); -extern "C" void setTevStr__12daItemBase_cFv(); -extern "C" void setShadow__12daItemBase_cFv(); -extern "C" void animEntry__12daItemBase_cFv(); -extern "C" void animPlay__12daItemBase_cFffffff(); -extern "C" void __dl__FPv(); -extern "C" void PSMTXCopy(); -extern "C" void PSMTXTrans(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_29(); -extern "C" void strcmp(); -extern "C" void* const mData__12daShopItem_c[276]; -extern "C" extern void* g_fopAc_Method[8]; -extern "C" extern void* g_fpcLf_Method[5 + 1 /* padding */]; -extern "C" extern void* __vt__8dCcD_Cyl[36]; -extern "C" extern void* __vt__9dCcD_Stts[11]; -extern "C" extern void* __vt__12daItemBase_c[17 + 1 /* padding */]; -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" f32 mSystemFar__14mDoLib_clipper; - -// -// Declarations: -// - -/* ############################################################################################## */ -/* 8059F48C-8059F48C 000054 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_8059F48C = "R_SP160"; -#pragma pop +#include "d/com/d_com_inf_game.h" +#include "m_Do/m_Do_lib.h" /* 8059E9B8-8059EC04 000078 024C+00 2/2 0/0 0/0 .text getShopArcname__12daShopItem_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daShopItem_c::getShopArcname() { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/getShopArcname__12daShopItem_cFv.s" +const char* daShopItem_c::getShopArcname() { + switch (m_itemNo) { + case NO_ITEM: + if (strcmp("R_SP160", dComIfGp_getStartStageName()) == 0) { + mShopItemID = SHOP_ITEMNO_ARMOR_SOLD; + } else { + mShopItemID = SHOP_ITEMNO_SOLD; + } + break; + case OIL_BOTTLE: + mShopItemID = SHOP_ITEMNO_OIL; + break; + case MILK_BOTTLE: + mShopItemID = SHOP_ITEMNO_MILK; + break; + case HALF_MILK_BOTTLE: + mShopItemID = SHOP_ITEMNO_HALF_MILK; + break; + case RED_BOTTLE: + mShopItemID = SHOP_ITEMNO_RED; + break; + case GREEN_BOTTLE: + mShopItemID = SHOP_ITEMNO_GREEN; + break; + case BLUE_BOTTLE: + mShopItemID = SHOP_ITEMNO_BLUE; + break; + case DROP_BOTTLE: + mShopItemID = SHOP_ITEMNO_DROP; + break; + case ARROW_10: + case ARROW_20: + case ARROW_30: + mShopItemID = SHOP_ITEMNO_ARROW; + break; + case SHIELD: + mShopItemID = SHOP_ITEMNO_SHIELD_B; + break; + case HYLIA_SHIELD: + mShopItemID = SHOP_ITEMNO_SHIELD_A; + break; + case NORMAL_BOMB: + case BOMB_5: + case BOMB_10: + case BOMB_20: + case BOMB_30: + mShopItemID = SHOP_ITEMNO_BOMB; + break; + case WATER_BOMB: + mShopItemID = SHOP_ITEMNO_WATER_BOMB; + break; + case POKE_BOMB: + mShopItemID = SHOP_ITEMNO_POKE_BOMB; + break; + case BOMB_BAG_LV1: + case BOMB_IN_BAG: + mShopItemID = SHOP_ITEMNO_BOMB_BAG; + break; + case BOMB_BAG_LV2: + mShopItemID = SHOP_ITEMNO_BOMB_BAG_LV2; + break; + case BEE_CHILD: + mShopItemID = SHOP_ITEMNO_BEE_CHILD; + break; + case PACHINKO: + mShopItemID = SHOP_ITEMNO_PACHINKO; + break; + case HAWK_EYE: + mShopItemID = SHOP_ITEMNO_HAWKEYE; + break; + case ARMOR: + mShopItemID = SHOP_ITEMNO_ARMOR; + break; + default: + return NULL; + } + + return mData[mShopItemID].get_arcName(); } -#pragma pop -/* ############################################################################################## */ /* 8059F438-8059F43C 000000 0004+00 2/2 0/0 0/0 .rodata m_cullfar_max__12daShopItem_c */ -SECTION_RODATA f32 const daShopItem_c::m_cullfar_max = 5000.0f; -COMPILER_STRIP_GATE(0x8059F438, &daShopItem_c::m_cullfar_max); - -/* 8059F43C-8059F46C 000004 002E+02 1/1 0/0 0/0 .rodata HeapSizeTbl$3665 */ -SECTION_RODATA static u8 const HeapSizeTbl[46 + 2 /* padding */] = { - 0x08, - 0x10, - 0x08, - 0x10, - 0x08, - 0x10, - 0x08, - 0x10, - 0x08, - 0x10, - 0x08, - 0x10, - 0x08, - 0x10, - 0x08, - 0x10, - 0x0E, - 0xB0, - 0x08, - 0x10, - 0x0E, - 0xB0, - 0x39, - 0x90, - 0x39, - 0x90, - 0x80, - 0x00, - 0x08, - 0x10, - 0x15, - 0x40, - 0x08, - 0x10, - 0x08, - 0x10, - 0x08, - 0x10, - 0x43, - 0xA0, - 0x22, - 0x80, - 0x08, - 0x10, - 0x08, - 0x10, - /* padding */ - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x8059F43C, &HeapSizeTbl); +const f32 daShopItem_c::m_cullfar_max = 5000.0f; /* 8059EC04-8059EC1C 0002C4 0018+00 1/1 0/0 0/0 .text getHeapSize__12daShopItem_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daShopItem_c::getHeapSize() { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/getHeapSize__12daShopItem_cFv.s" +u16 daShopItem_c::getHeapSize() { + static const u16 HeapSizeTbl[] = { + 0x0810, 0x0810, 0x0810, 0x0810, 0x0810, 0x0810, 0x0810, 0x0810, + 0x0EB0, 0x0810, 0x0EB0, 0x3990, 0x3990, 0x8000, 0x0810, 0x1540, + 0x0810, 0x0810, 0x0810, 0x43A0, 0x2280, 0x0810, 0x0810, + }; + + u8 a_ShopItemID = getShopItemID(); + OS_REPORT("ShopItemID [%u]\n", a_ShopItemID); + ASSERT(a_ShopItemID < SHOP_ITEMNO_MAX); + + return HeapSizeTbl[a_ShopItemID]; } -#pragma pop - -/* ############################################################################################## */ -/* 8059F46C-8059F470 000034 0004+00 0/1 0/0 0/0 .rodata @3718 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3718 = -100.0f; -COMPILER_STRIP_GATE(0x8059F46C, &lit_3718); -#pragma pop - -/* 8059F470-8059F474 000038 0004+00 0/2 0/0 0/0 .rodata @3719 */ -#pragma push -#pragma force_active on -SECTION_RODATA static u8 const lit_3719[4] = { - 0x00, - 0x00, - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x8059F470, &lit_3719); -#pragma pop - -/* 8059F474-8059F478 00003C 0004+00 0/1 0/0 0/0 .rodata @3720 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3720 = 100.0f; -COMPILER_STRIP_GATE(0x8059F474, &lit_3720); -#pragma pop - -/* 8059F478-8059F47C 000040 0004+00 0/1 0/0 0/0 .rodata @3721 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3721 = 200.0f; -COMPILER_STRIP_GATE(0x8059F478, &lit_3721); -#pragma pop - -/* 8059F47C-8059F480 000044 0004+00 1/3 0/0 0/0 .rodata @3722 */ -SECTION_RODATA static f32 const lit_3722 = 1.0f; -COMPILER_STRIP_GATE(0x8059F47C, &lit_3722); - -/* 8059F480-8059F484 000048 0004+00 0/1 0/0 0/0 .rodata @3723 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3723 = 5000.0f; -COMPILER_STRIP_GATE(0x8059F480, &lit_3723); -#pragma pop - -/* 8059F484-8059F488 00004C 0004+00 0/1 0/0 0/0 .rodata @3724 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3724 = 4.0f / 5.0f; -COMPILER_STRIP_GATE(0x8059F484, &lit_3724); -#pragma pop - -/* 8059F48C-8059F48C 000054 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ -#pragma push -#pragma force_active on -SECTION_DEAD static char const* const stringBase_8059F494 = "R_SP109"; -#pragma pop /* 8059EC1C-8059ED58 0002DC 013C+00 1/1 0/0 0/0 .text CreateInit__12daShopItem_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daShopItem_c::CreateInit() { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/CreateInit__12daShopItem_cFv.s" +void daShopItem_c::CreateInit() { + fopAcM_SetMtx(this, mMtx); + fopAcM_setCullSizeBox(this, -100.0f, 0.0f, -100.0f, 100.0f, 200.0f, 100.0f); + + if (mDoLib_clipper::getFar() > 1.0f) { + fopAcM_setCullSizeFar(this, 5000.0f / mDoLib_clipper::getFar()); + } + + show(); + + if (strcmp("R_SP109", dComIfGp_getStartStageName()) == 0 && dComIfGp_getStartStageRoomNo() == 1) + { + scale.set(mData[mShopItemID].get_scale() * 0.8f, mData[mShopItemID].get_scale() * 0.8f, + mData[mShopItemID].get_scale() * 0.8f); + } else { + scale.set(mData[mShopItemID].get_scale(), mData[mShopItemID].get_scale(), + mData[mShopItemID].get_scale()); + } + + home.pos = current.pos; + set_mtx(); + mpModel->setUserArea(NULL); } -#pragma pop /* 8059ED58-8059EEF4 000418 019C+00 2/2 0/0 0/0 .text set_mtx__12daShopItem_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daShopItem_c::set_mtx() { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/set_mtx__12daShopItem_cFv.s" +void daShopItem_c::set_mtx() { + mpModel->setBaseScale(scale); + + if (daShopItem_prm::getGroup(this) == 15) { + mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); + } else { + mDoMtx_stack_c::transS(current.pos.x, current.pos.y + mData[mShopItemID].get_offsetY(), + current.pos.z); + } + + MTXCopy(mDoMtx_stack_c::get(), mMtx); + mDoMtx_stack_c::YrotM(mAngleY); + + if (daShopItem_prm::getGroup(this) == 15) { + mDoMtx_stack_c::ZXYrotM(-11300, 32700, 7300); + } else { + mDoMtx_stack_c::ZXYrotM(mAngleX + mData[mShopItemID].get_angleX(), + mData[mShopItemID].get_angleY(), mData[mShopItemID].get_angleZ()); + } + + mDoMtx_stack_c::ZXYrotM(current.angle.x, current.angle.y, current.angle.z); + + if (daShopItem_prm::getGroup(this) == 15) { + mDoMtx_stack_c::XrotM(0); + } else { + mDoMtx_stack_c::XrotM(mData[mShopItemID].get_angleOffsetX()); + } + + mpModel->i_setBaseTRMtx(mDoMtx_stack_c::get()); } -#pragma pop /* 8059EEF4-8059EF48 0005B4 0054+00 1/1 0/0 0/0 .text _execute__12daShopItem_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daShopItem_c::_execute() { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/_execute__12daShopItem_cFv.s" +bool daShopItem_c::_execute() { + animPlay(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f); + set_mtx(); + return true; } -#pragma pop /* 8059EF48-8059EF9C 000608 0054+00 1/1 0/0 0/0 .text _draw__12daShopItem_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daShopItem_c::_draw() { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/_draw__12daShopItem_cFv.s" -} -#pragma pop +bool daShopItem_c::_draw() { + if (!chkDraw()) { + return true; + } -/* 8059EF9C-8059EFA0 00065C 0004+00 1/0 0/0 0/0 .text setListStart__12daShopItem_cFv */ -void daShopItem_c::setListStart() { - /* empty function */ + DrawBase(); + return true; } -/* ############################################################################################## */ -/* 8059F488-8059F48C 000050 0004+00 0/1 0/0 0/0 .rodata @3823 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3823 = 80.0f; -COMPILER_STRIP_GATE(0x8059F488, &lit_3823); -#pragma pop +/* 8059EF9C-8059EFA0 00065C 0004+00 1/0 0/0 0/0 .text setListStart__12daShopItem_cFv */ +void daShopItem_c::setListStart() {} /* 8059EFA0-8059F024 000660 0084+00 1/0 0/0 0/0 .text setShadow__12daShopItem_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daShopItem_c::setShadow() { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/setShadow__12daShopItem_cFv.s" +void daShopItem_c::setShadow() { + if (m_itemNo != NO_ITEM) { + daItemBase_c::setShadow(); + } else { + mShadowKey = dComIfGd_setShadow(mShadowKey, 1, mpModel, ¤t.pos, 80.0f, 0.0f, + current.pos.y, mAcch.GetGroundH(), mAcch.m_gnd, &tevStr, 0, + 1.0f, dDlst_shadowControl_c::getSimpleTex()); + } } -#pragma pop /* 8059F024-8059F044 0006E4 0020+00 1/0 0/0 0/0 .text chkFlag__12daShopItem_cFi */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daShopItem_c::chkFlag(int param_0) { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/chkFlag__12daShopItem_cFi.s" +BOOL daShopItem_c::chkFlag(int i_flag) { + return mData[mShopItemID].get_flag() & i_flag; } -#pragma pop /* 8059F044-8059F064 000704 0020+00 1/0 0/0 0/0 .text getTevFrm__12daShopItem_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daShopItem_c::getTevFrm() { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/getTevFrm__12daShopItem_cFv.s" +s8 daShopItem_c::getTevFrm() { + return mData[mShopItemID].get_tevfrm(); } -#pragma pop /* 8059F064-8059F084 000724 0020+00 1/0 0/0 0/0 .text getBtpFrm__12daShopItem_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daShopItem_c::getBtpFrm() { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/getBtpFrm__12daShopItem_cFv.s" +s8 daShopItem_c::getBtpFrm() { + return mData[mShopItemID].get_btpfrm(); } -#pragma pop /* 8059F084-8059F0A0 000744 001C+00 1/0 0/0 0/0 .text getShadowSize__12daShopItem_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daShopItem_c::getShadowSize() { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/getShadowSize__12daShopItem_cFv.s" +u8 daShopItem_c::getShadowSize() { + return mData[mShopItemID].get_shadowSize(); } -#pragma pop /* 8059F0A0-8059F0BC 000760 001C+00 1/0 0/0 0/0 .text getCollisionH__12daShopItem_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daShopItem_c::getCollisionH() { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/getCollisionH__12daShopItem_cFv.s" +u8 daShopItem_c::getCollisionH() { + return mData[mShopItemID].get_collisionH(); } -#pragma pop /* 8059F0BC-8059F0D8 00077C 001C+00 1/0 0/0 0/0 .text getCollisionR__12daShopItem_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daShopItem_c::getCollisionR() { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/getCollisionR__12daShopItem_cFv.s" +u8 daShopItem_c::getCollisionR() { + return mData[mShopItemID].get_collisionR(); } -#pragma pop - -/* ############################################################################################## */ -/* 8059F49C-8059F4BC -00001 0020+00 1/0 0/0 0/0 .data daShopItemMethodTable */ -SECTION_DATA static void* daShopItemMethodTable[8] = { - (void*)daShopItem_Create__FPv, - (void*)daShopItem_Delete__FPv, - (void*)daShopItem_Execute__FPv, - (void*)daShopItem_IsDelete__FPv, - (void*)daShopItem_Draw__FPv, - (void*)NULL, - (void*)NULL, - (void*)NULL, -}; - -/* 8059F4BC-8059F4EC -00001 0030+00 0/0 0/0 1/0 .data g_profile_ShopItem */ -SECTION_DATA extern void* g_profile_ShopItem[12] = { - (void*)0xFFFFFFFD, (void*)0x0007FFFD, - (void*)0x021E0000, (void*)&g_fpcLf_Method, - (void*)0x00000968, (void*)NULL, - (void*)NULL, (void*)&g_fopAc_Method, - (void*)0x00F20000, (void*)&daShopItemMethodTable, - (void*)0x00060100, (void*)0x000E0000, -}; - -/* 8059F4EC-8059F4F8 000050 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, -}; -/* 8059F4F8-8059F504 00005C 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, -}; - -/* 8059F504-8059F528 000068 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_8059F428, - (void*)NULL, - (void*)NULL, - (void*)func_8059F420, -}; - -/* 8059F528-8059F56C 00008C 0044+00 1/1 0/0 0/0 .data __vt__12daShopItem_c */ -SECTION_DATA extern void* __vt__12daShopItem_c[17] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)DrawBase__12daItemBase_cFv, - (void*)setListStart__12daShopItem_cFv, - (void*)settingBeforeDraw__12daItemBase_cFv, - (void*)setTevStr__12daItemBase_cFv, - (void*)setShadow__12daShopItem_cFv, - (void*)animEntry__12daItemBase_cFv, - (void*)RotateYBase__12daItemBase_cFv, - (void*)clothCreate__12daItemBase_cFv, - (void*)__CreateHeap__12daItemBase_cFv, - (void*)chkFlag__12daShopItem_cFi, - (void*)getTevFrm__12daShopItem_cFv, - (void*)getBtpFrm__12daShopItem_cFv, - (void*)getShadowSize__12daShopItem_cFv, - (void*)getCollisionH__12daShopItem_cFv, - (void*)getCollisionR__12daShopItem_cFv, -}; +int daShopItem_c::_create() { + fopAcM_SetupActor(this, daShopItem_c); + + mAngleX = 0; + mAngleY = 0; + m_itemNo = daShopItem_prm::getItemNo(this); + + if (getShopArcname() == NULL) { + // "Display model archive name doesn't exist![%d]\n" + OS_REPORT("陳列用モデルのアーカイブ名がありません![%d]\n", m_itemNo); + m_itemNo = NO_ITEM; + } + + int phase_state = dComIfG_resLoad(&mPhase, getShopArcname()); + switch (phase_state) { + case cPhs_COMPLEATE_e: + if (phase_state == cPhs_COMPLEATE_e) { + if (!fopAcM_entrySolidHeap(this, CheckShopItemCreateHeap, getHeapSize())) { + return cPhs_ERROR_e; + } + + // "Shop Item[%d]Memory:%d used\n" + OS_REPORT("ショップアイテム[%d]メモリ:%x 使用\n", m_itemNo, heap->getHeapSize()); + CreateInit(); + } + break; + } + + return phase_state; +} /* 8059F0D8-8059F294 000798 01BC+00 1/0 0/0 0/0 .text daShopItem_Create__FPv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daShopItem_Create(void* param_0) { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/daShopItem_Create__FPv.s" -} -#pragma pop - -/* 8059F294-8059F2DC 000954 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGCylFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm cM3dGCyl::~cM3dGCyl() { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/__dt__8cM3dGCylFv.s" -} -#pragma pop - -/* 8059F2DC-8059F324 00099C 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGAabFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm cM3dGAab::~cM3dGAab() { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/__dt__8cM3dGAabFv.s" +static int daShopItem_Create(void* i_this) { + return static_cast<daShopItem_c*>(i_this)->_create(); } -#pragma pop - -/* 8059F324-8059F394 0009E4 0070+00 3/2 0/0 0/0 .text __dt__12dBgS_ObjAcchFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm dBgS_ObjAcch::~dBgS_ObjAcch() { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/__dt__12dBgS_ObjAcchFv.s" + +int daShopItem_c::_delete() { + DeleteBase(getShopArcname()); + return 1; } -#pragma pop /* 8059F394-8059F3D0 000A54 003C+00 1/0 0/0 0/0 .text daShopItem_Delete__FPv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daShopItem_Delete(void* param_0) { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/daShopItem_Delete__FPv.s" +static int daShopItem_Delete(void* i_this) { + return static_cast<daShopItem_c*>(i_this)->_delete(); } -#pragma pop /* 8059F3D0-8059F3F4 000A90 0024+00 1/0 0/0 0/0 .text daShopItem_Draw__FPv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daShopItem_Draw(void* param_0) { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/daShopItem_Draw__FPv.s" +static int daShopItem_Draw(void* i_this) { + return static_cast<daShopItem_c*>(i_this)->_draw(); } -#pragma pop /* 8059F3F4-8059F418 000AB4 0024+00 1/0 0/0 0/0 .text daShopItem_Execute__FPv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daShopItem_Execute(void* param_0) { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/daShopItem_Execute__FPv.s" +static int daShopItem_Execute(void* i_this) { + return static_cast<daShopItem_c*>(i_this)->_execute(); } -#pragma pop /* 8059F418-8059F420 000AD8 0008+00 1/0 0/0 0/0 .text daShopItem_IsDelete__FPv */ -static bool daShopItem_IsDelete(void* param_0) { - return true; +static int daShopItem_IsDelete(void* i_this) { + return 1; } -/* 8059F420-8059F428 000AE0 0008+00 1/0 0/0 0/0 .text @36@__dt__12dBgS_ObjAcchFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void func_8059F420() { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/func_8059F420.s" -} -#pragma pop - -/* 8059F428-8059F430 000AE8 0008+00 1/0 0/0 0/0 .text @20@__dt__12dBgS_ObjAcchFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void func_8059F428() { - nofralloc -#include "asm/rel/d/a/d_a_shop_item/d_a_shop_item/func_8059F428.s" -} -#pragma pop +/* 8059F49C-8059F4BC -00001 0020+00 1/0 0/0 0/0 .data daShopItemMethodTable */ +static actor_method_class daShopItemMethodTable = { + (process_method_func)daShopItem_Create, (process_method_func)daShopItem_Delete, + (process_method_func)daShopItem_Execute, (process_method_func)daShopItem_IsDelete, + (process_method_func)daShopItem_Draw, +}; -/* 8059F48C-8059F48C 000054 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */ +/* 8059F4BC-8059F4EC -00001 0030+00 0/0 0/0 1/0 .data g_profile_ShopItem */ +extern actor_process_profile_definition g_profile_ShopItem = { + fpcLy_CURRENT_e, + 7, + fpcPi_CURRENT_e, + PROC_ShopItem, + &g_fpcLf_Method.mBase, + sizeof(daShopItem_c), + 0, + 0, + &g_fopAc_Method.base, + 242, + &daShopItemMethodTable, + 0x60100, + fopAc_ACTOR_e, + fopAc_CULLBOX_CUSTOM_e, +}; diff --git a/rel/d/a/d_a_spinner/d_a_spinner.cpp b/rel/d/a/d_a_spinner/d_a_spinner.cpp index 620bcf263b..29a5cd217c 100644 --- a/rel/d/a/d_a_spinner/d_a_spinner.cpp +++ b/rel/d/a/d_a_spinner/d_a_spinner.cpp @@ -884,7 +884,7 @@ int daSpinner_c::setNextPathNum() { } /* 804D3694-804D36F4 001DF4 0060+00 1/1 0/0 0/0 .text getPathNextPos__11daSpinner_cFv */ -cXyz* daSpinner_c::getPathNextPos() { +Vec* daSpinner_c::getPathNextPos() { s32 add = field_0xa72 + field_0xa73; if (add < 0) { return &(mpPathMove->m_points + mpPathMove->m_num - 1)->m_position; diff --git a/rel/d/a/d_a_startAndGoal/Makefile b/rel/d/a/d_a_startAndGoal/Makefile index bb10e5aecd..8e18654b3b 100644 --- a/rel/d/a/d_a_startAndGoal/Makefile +++ b/rel/d/a/d_a_startAndGoal/Makefile @@ -19,6 +19,7 @@ M706_LIBS := \ M706_CFLAGS := \ -sdata 0 \ -sdata2 0 \ + -sym on \ M706_LDFLAGS := \ -nodefaults \ diff --git a/rel/d/a/d_a_startAndGoal/d_a_startAndGoal.cpp b/rel/d/a/d_a_startAndGoal/d_a_startAndGoal.cpp index b6fb3eff59..f733bdfbb0 100644 --- a/rel/d/a/d_a_startAndGoal/d_a_startAndGoal.cpp +++ b/rel/d/a/d_a_startAndGoal/d_a_startAndGoal.cpp @@ -1,398 +1,258 @@ -// -// Generated By: dol2asm -// Translation Unit: d_a_startAndGoal -// +/** + * d_a_startAndGoal.cpp + * + */ #include "rel/d/a/d_a_startAndGoal/d_a_startAndGoal.h" -#include "dol2asm.h" +#include "d/a/d_a_npc.h" +#include "d/com/d_com_inf_game.h" +#include "d/d_timer.h" +#include "d/meter/d_meter2_info.h" +#include "f_op/f_op_actor_mng.h" -// -// Types: -// +class daStartAndGoal_Path_c : public daNpcF_Path_c { +public: + /* 80D4D7B8 */ BOOL chkPassed2(cXyz); -struct fopAc_ac_c { - /* 80018B64 */ fopAc_ac_c(); + /* 80D4D928 */ virtual ~daStartAndGoal_Path_c() {} }; -struct daStartAndGoal_c { - /* 80D4D84C */ void getType(); - /* 80D4D884 */ void Create(); +class daStartAndGoal_c : public fopAc_ac_c { +public: + /* 80D4D84C */ int getType(); + /* 80D4D884 */ int Create(); /* 80D4D998 */ void init(); /* 80D4DA68 */ void actorPosCheck(); - /* 80D4DB30 */ void readyStartTimer(); - /* 80D4DBAC */ void isStartCheck(); - /* 80D4DBD0 */ void isReadyCheck(); - /* 80D4DC50 */ void Execute(); - /* 80D4DCF4 */ bool Draw(); - /* 80D4DCFC */ void Delete(); -}; - -struct cXyz {}; - -struct daStartAndGoal_Path_c { - /* 80D4D7B8 */ void chkPassed2(cXyz); - /* 80D4D928 */ ~daStartAndGoal_Path_c(); -}; - -struct dPath {}; - -struct daNpcF_SPCurve_c { - /* 80150870 */ void initialize(dPath*, int); - /* 80D4DE68 */ ~daNpcF_SPCurve_c(); -}; - -struct daNpcF_Path_c { - /* 80150900 */ void initialize(); - /* 8015095C */ void setPathInfo(u8, s8, u8); - /* 80150A24 */ void chkPassed(cXyz); - /* 80150BE0 */ void setNextIdx(); - /* 80150C18 */ void getNextIdx(); - /* 80D4DE08 */ ~daNpcF_Path_c(); -}; - -struct dComIfG_play_c { - /* 8002CB9C */ void getTimerNowTimeMs(); - /* 8002CBDC */ void getTimerPtr(); -}; - -struct Z2SeqMgr { - /* 802AF49C */ void subBgmStart(u32); - /* 802AF884 */ void subBgmStop(); -}; - -struct Z2AudioMgr { - static u8 mAudioMgrPtr[4 + 4 /* padding */]; + /* 80D4DB30 */ int readyStartTimer(); + /* 80D4DBAC */ BOOL isStartCheck(); + /* 80D4DBD0 */ BOOL isReadyCheck(); + /* 80D4DC50 */ int Execute(); + /* 80D4DCF4 */ int Draw(); + /* 80D4DCFC */ int Delete(); + + /* 0x568 */ daStartAndGoal_Path_c mPath; + /* 0xB98 */ u8 field_0xb98; + /* 0xB99 */ u8 mType; + /* 0xB9C */ int mAction; + /* 0xBA0 */ bool mStarted; }; -// -// Forward References: -// - -extern "C" void chkPassed2__21daStartAndGoal_Path_cF4cXyz(); -extern "C" void getType__16daStartAndGoal_cFv(); -extern "C" void Create__16daStartAndGoal_cFv(); -extern "C" void __dt__21daStartAndGoal_Path_cFv(); -extern "C" void init__16daStartAndGoal_cFv(); -extern "C" void actorPosCheck__16daStartAndGoal_cFv(); -extern "C" void readyStartTimer__16daStartAndGoal_cFv(); -extern "C" void isStartCheck__16daStartAndGoal_cFv(); -extern "C" void isReadyCheck__16daStartAndGoal_cFv(); -extern "C" void Execute__16daStartAndGoal_cFv(); -extern "C" bool Draw__16daStartAndGoal_cFv(); -extern "C" void Delete__16daStartAndGoal_cFv(); -extern "C" static void daStartAndGoal_Execute__FP16daStartAndGoal_c(); -extern "C" static void daStartAndGoal_Draw__FP16daStartAndGoal_c(); -extern "C" static bool daStartAndGoal_IsDelete__FP16daStartAndGoal_c(); -extern "C" static void daStartAndGoal_Delete__FP16daStartAndGoal_c(); -extern "C" static void daStartAndGoal_create__FP10fopAc_ac_c(); -extern "C" void __dt__13daNpcF_Path_cFv(); -extern "C" void __dt__16daNpcF_SPCurve_cFv(); - -// -// External References: -// - -extern "C" void __ct__10fopAc_ac_cFv(); -extern "C" void getTimerNowTimeMs__14dComIfG_play_cFv(); -extern "C" void getTimerPtr__14dComIfG_play_cFv(); -extern "C" void dComIfG_TimerStart__Fis(); -extern "C" void dComIfG_TimerEnd__Fii(); -extern "C" void dComIfG_TimerDeleteRequest__Fi(); -extern "C" void initialize__16daNpcF_SPCurve_cFP5dPathi(); -extern "C" void initialize__13daNpcF_Path_cFv(); -extern "C" void setPathInfo__13daNpcF_Path_cFUcScUc(); -extern "C" void chkPassed__13daNpcF_Path_cF4cXyz(); -extern "C" void setNextIdx__13daNpcF_Path_cFv(); -extern "C" void getNextIdx__13daNpcF_Path_cFv(); -extern "C" void dTimer_createTimer__FlUlUcUcffff(); -extern "C" void dTimer_isStart__Fv(); -extern "C" void dTimer_isReadyFlag__Fv(); -extern "C" void subBgmStart__8Z2SeqMgrFUl(); -extern "C" void subBgmStop__8Z2SeqMgrFv(); -extern "C" void __dl__FPv(); -extern "C" void _savegpr_29(); -extern "C" void _restgpr_29(); -extern "C" extern void* g_fopAc_Method[8]; -extern "C" extern void* g_fpcLf_Method[5 + 1 /* padding */]; -extern "C" extern u8 g_dComIfG_gameInfo[122384]; -extern "C" extern u8 g_meter2_info[248]; -extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */]; - -// -// Declarations: -// - /* 80D4D7B8-80D4D84C 000078 0094+00 1/1 0/0 0/0 .text chkPassed2__21daStartAndGoal_Path_cF4cXyz */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daStartAndGoal_Path_c::chkPassed2(cXyz param_0) { - nofralloc -#include "asm/rel/d/a/d_a_startAndGoal/d_a_startAndGoal/chkPassed2__21daStartAndGoal_Path_cF4cXyz.s" +BOOL daStartAndGoal_Path_c::chkPassed2(cXyz i_checkPos) { + int var_r31 = 0; + while (var_r31 < 1) { + if (!chkPassed(i_checkPos)) { + break; + } + + var_r31 = 1; + if (setNextIdx()) { + var_r31 = 2; + } + } + + return var_r31 > 0; } -#pragma pop /* 80D4D84C-80D4D884 00010C 0038+00 1/1 0/0 0/0 .text getType__16daStartAndGoal_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daStartAndGoal_c::getType() { - nofralloc -#include "asm/rel/d/a/d_a_startAndGoal/d_a_startAndGoal/getType__16daStartAndGoal_cFv.s" +int daStartAndGoal_c::getType() { + switch (fopAcM_GetParam(this) & 0xFF) { + case 0: + return 0; + case 1: + return 1; + default: + return 2; + } } -#pragma pop /* ############################################################################################## */ -/* 80D4DECC-80D4DEE4 000000 0018+00 4/4 0/0 0/0 .data l_timerType */ -SECTION_DATA static u8 l_timerType[24] = { - 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x01, 0x01, 0x00, 0x00, -}; - -/* 80D4DEE4-80D4DF04 -00001 0020+00 1/0 0/0 0/0 .data l_daStartAndGoal_Method */ -SECTION_DATA static void* l_daStartAndGoal_Method[8] = { - (void*)daStartAndGoal_create__FP10fopAc_ac_c, - (void*)daStartAndGoal_Delete__FP16daStartAndGoal_c, - (void*)daStartAndGoal_Execute__FP16daStartAndGoal_c, - (void*)daStartAndGoal_IsDelete__FP16daStartAndGoal_c, - (void*)daStartAndGoal_Draw__FP16daStartAndGoal_c, - (void*)NULL, - (void*)NULL, - (void*)NULL, -}; - -/* 80D4DF04-80D4DF34 -00001 0030+00 0/0 0/0 1/0 .data g_profile_START_AND_GOAL */ -SECTION_DATA extern void* g_profile_START_AND_GOAL[12] = { - (void*)0xFFFFFFFD, (void*)0x0009FFFD, - (void*)0x03060000, (void*)&g_fpcLf_Method, - (void*)0x00000BA4, (void*)NULL, - (void*)NULL, (void*)&g_fopAc_Method, - (void*)0x01870000, (void*)&l_daStartAndGoal_Method, - (void*)0x00044000, (void*)0x000E0000, +struct timer_info { + /* 0x0 */ s32 mode; + /* 0x4 */ u8 type; + /* 0x5 */ u8 field_0x5; }; -/* 80D4DF34-80D4DF40 000068 000C+00 2/2 0/0 0/0 .data __vt__21daStartAndGoal_Path_c */ -SECTION_DATA extern void* __vt__21daStartAndGoal_Path_c[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__21daStartAndGoal_Path_cFv, -}; - -/* 80D4DF40-80D4DF4C 000074 000C+00 4/4 0/0 0/0 .data __vt__16daNpcF_SPCurve_c */ -SECTION_DATA extern void* __vt__16daNpcF_SPCurve_c[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__16daNpcF_SPCurve_cFv, -}; - -/* 80D4DF4C-80D4DF58 000080 000C+00 3/3 0/0 0/0 .data __vt__13daNpcF_Path_c */ -SECTION_DATA extern void* __vt__13daNpcF_Path_c[3] = { - (void*)NULL /* RTTI */, - (void*)NULL, - (void*)__dt__13daNpcF_Path_cFv, +/* 80D4DECC-80D4DEE4 000000 0018+00 4/4 0/0 0/0 .data l_timerType */ +static timer_info l_timerType[] = { + {3, 0, 1}, + {4, 2, 0}, + {3, 1, 1}, }; /* 80D4D884-80D4D928 000144 00A4+00 1/1 0/0 0/0 .text Create__16daStartAndGoal_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daStartAndGoal_c::Create() { - nofralloc -#include "asm/rel/d/a/d_a_startAndGoal/d_a_startAndGoal/Create__16daStartAndGoal_cFv.s" -} -#pragma pop - -/* 80D4D928-80D4D998 0001E8 0070+00 1/0 0/0 0/0 .text __dt__21daStartAndGoal_Path_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm daStartAndGoal_Path_c::~daStartAndGoal_Path_c() { - nofralloc -#include "asm/rel/d/a/d_a_startAndGoal/d_a_startAndGoal/__dt__21daStartAndGoal_Path_cFv.s" +int daStartAndGoal_c::Create() { + fopAcM_SetupActor(this, daStartAndGoal_c); + + init(); + return cPhs_COMPLEATE_e; } -#pragma pop -/* ############################################################################################## */ /* 80D4DEB8-80D4DEBC 000000 0001+03 1/1 0/0 0/0 .rodata l_DATA */ -SECTION_RODATA static u8 const l_DATA[1 + 3 /* padding */] = { - 0x00, - /* padding */ - 0x00, - 0x00, - 0x00, -}; -COMPILER_STRIP_GATE(0x80D4DEB8, &l_DATA); - -/* 80D4DEBC-80D4DEC0 000004 0004+00 0/1 0/0 0/0 .rodata @3913 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3913 = 210.0f; -COMPILER_STRIP_GATE(0x80D4DEBC, &lit_3913); -#pragma pop - -/* 80D4DEC0-80D4DEC4 000008 0004+00 0/1 0/0 0/0 .rodata @3914 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3914 = 410.0f; -COMPILER_STRIP_GATE(0x80D4DEC0, &lit_3914); -#pragma pop - -/* 80D4DEC4-80D4DEC8 00000C 0004+00 0/1 0/0 0/0 .rodata @3915 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3915 = 32.0f; -COMPILER_STRIP_GATE(0x80D4DEC4, &lit_3915); -#pragma pop - -/* 80D4DEC8-80D4DECC 000010 0004+00 0/1 0/0 0/0 .rodata @3916 */ -#pragma push -#pragma force_active on -SECTION_RODATA static f32 const lit_3916 = 419.0f; -COMPILER_STRIP_GATE(0x80D4DEC8, &lit_3916); -#pragma pop +static const u8 l_DATA[1] = {0}; // unused /* 80D4D998-80D4DA68 000258 00D0+00 1/1 0/0 0/0 .text init__16daStartAndGoal_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daStartAndGoal_c::init() { - nofralloc -#include "asm/rel/d/a/d_a_startAndGoal/d_a_startAndGoal/init__16daStartAndGoal_cFv.s" +void daStartAndGoal_c::init() { + field_0xb98 = 1; + mStarted = false; + mType = getType(); + + mPath.initialize(); + mPath.setPathInfo(fopAcM_GetParam(this) >> 8, fopAcM_GetRoomNo(this), 0); + JUT_ASSERT(0 != mPath.getPathInfo()); + + if (dComIfG_getTimerPtr() == NULL) { + dTimer_createTimer(l_timerType[mType].mode, 9999000, l_timerType[mType].type, 0, 210.0f, + 410.0f, 32.0f, 419.0f); + } + + mAction = 0; } -#pragma pop /* 80D4DA68-80D4DB30 000328 00C8+00 1/1 0/0 0/0 .text actorPosCheck__16daStartAndGoal_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daStartAndGoal_c::actorPosCheck() { - nofralloc -#include "asm/rel/d/a/d_a_startAndGoal/d_a_startAndGoal/actorPosCheck__16daStartAndGoal_cFv.s" +void daStartAndGoal_c::actorPosCheck() { + cXyz pos(daPy_getPlayerActorClass()->current.pos); + if (mPath.chkPassed2(pos)) { + int idx = mPath.getIdx(); + int next_idx = mPath.getNextIdx(); + + if (idx == next_idx) { + mAction = 3; + dComIfG_TimerEnd(l_timerType[mType].mode, -1); + dMeter2Info_setMsgTimeMs(dComIfG_getTimerNowTimeMs()); + } + } } -#pragma pop /* 80D4DB30-80D4DBAC 0003F0 007C+00 0/0 0/0 2/2 .text readyStartTimer__16daStartAndGoal_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daStartAndGoal_c::readyStartTimer() { - nofralloc -#include "asm/rel/d/a/d_a_startAndGoal/d_a_startAndGoal/readyStartTimer__16daStartAndGoal_cFv.s" +int daStartAndGoal_c::readyStartTimer() { + if (dComIfG_TimerStart(l_timerType[mType].mode, 0)) { + mAction = 1; + field_0xb98 = l_timerType[mType].field_0x5; + return 1; + } + + return 0; } -#pragma pop /* 80D4DBAC-80D4DBD0 00046C 0024+00 1/1 0/0 2/2 .text isStartCheck__16daStartAndGoal_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daStartAndGoal_c::isStartCheck() { - nofralloc -#include "asm/rel/d/a/d_a_startAndGoal/d_a_startAndGoal/isStartCheck__16daStartAndGoal_cFv.s" +BOOL daStartAndGoal_c::isStartCheck() { + return dTimer_isStart(); } -#pragma pop /* 80D4DBD0-80D4DC50 000490 0080+00 1/1 0/0 0/0 .text isReadyCheck__16daStartAndGoal_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daStartAndGoal_c::isReadyCheck() { - nofralloc -#include "asm/rel/d/a/d_a_startAndGoal/d_a_startAndGoal/isReadyCheck__16daStartAndGoal_cFv.s" +BOOL daStartAndGoal_c::isReadyCheck() { + if (mStarted) { + return TRUE; + } + + if (dTimer_isReadyFlag()) { + mStarted = true; + + if (mType == 1) { + Z2GetAudioMgr()->subBgmStart(Z2BGM_RIVER_GAME); + } + } + + return dTimer_isStart(); } -#pragma pop /* 80D4DC50-80D4DCF4 000510 00A4+00 1/1 0/0 0/0 .text Execute__16daStartAndGoal_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daStartAndGoal_c::Execute() { - nofralloc -#include "asm/rel/d/a/d_a_startAndGoal/d_a_startAndGoal/Execute__16daStartAndGoal_cFv.s" +int daStartAndGoal_c::Execute() { + switch (mAction) { + case 0: + break; + case 1: + if (isStartCheck()) { + mAction = 2; + + if (mType == 0) { + Z2GetAudioMgr()->subBgmStart(Z2BGM_RIVER_GAME_00); + } + } else { + isReadyCheck(); + break; + } + case 2: + actorPosCheck(); + break; + case 3: + break; + } + + return 1; } -#pragma pop /* 80D4DCF4-80D4DCFC 0005B4 0008+00 1/1 0/0 0/0 .text Draw__16daStartAndGoal_cFv */ -bool daStartAndGoal_c::Draw() { - return true; +int daStartAndGoal_c::Draw() { + return 1; } /* 80D4DCFC-80D4DD80 0005BC 0084+00 1/1 0/0 0/0 .text Delete__16daStartAndGoal_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm void daStartAndGoal_c::Delete() { - nofralloc -#include "asm/rel/d/a/d_a_startAndGoal/d_a_startAndGoal/Delete__16daStartAndGoal_cFv.s" +int daStartAndGoal_c::Delete() { + if (field_0xb98 == 1) { + dComIfG_TimerDeleteRequest(l_timerType[mType].mode); + } + + if (mStarted == true && (mType == 0 || mType == 1)) { + Z2GetAudioMgr()->subBgmStop(); + } + + return 1; } -#pragma pop /* 80D4DD80-80D4DDA0 000640 0020+00 1/0 0/0 0/0 .text daStartAndGoal_Execute__FP16daStartAndGoal_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daStartAndGoal_Execute(daStartAndGoal_c* param_0) { - nofralloc -#include "asm/rel/d/a/d_a_startAndGoal/d_a_startAndGoal/daStartAndGoal_Execute__FP16daStartAndGoal_c.s" +static int daStartAndGoal_Execute(daStartAndGoal_c* i_this) { + return i_this->Execute(); } -#pragma pop /* 80D4DDA0-80D4DDC0 000660 0020+00 1/0 0/0 0/0 .text daStartAndGoal_Draw__FP16daStartAndGoal_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daStartAndGoal_Draw(daStartAndGoal_c* param_0) { - nofralloc -#include "asm/rel/d/a/d_a_startAndGoal/d_a_startAndGoal/daStartAndGoal_Draw__FP16daStartAndGoal_c.s" +static int daStartAndGoal_Draw(daStartAndGoal_c* i_this) { + return i_this->Draw(); } -#pragma pop /* 80D4DDC0-80D4DDC8 000680 0008+00 1/0 0/0 0/0 .text * daStartAndGoal_IsDelete__FP16daStartAndGoal_c */ -static bool daStartAndGoal_IsDelete(daStartAndGoal_c* param_0) { - return true; +static int daStartAndGoal_IsDelete(daStartAndGoal_c* i_this) { + return 1; } /* 80D4DDC8-80D4DDE8 000688 0020+00 1/0 0/0 0/0 .text daStartAndGoal_Delete__FP16daStartAndGoal_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daStartAndGoal_Delete(daStartAndGoal_c* param_0) { - nofralloc -#include "asm/rel/d/a/d_a_startAndGoal/d_a_startAndGoal/daStartAndGoal_Delete__FP16daStartAndGoal_c.s" +static int daStartAndGoal_Delete(daStartAndGoal_c* i_this) { + return i_this->Delete(); } -#pragma pop /* 80D4DDE8-80D4DE08 0006A8 0020+00 1/0 0/0 0/0 .text daStartAndGoal_create__FP10fopAc_ac_c */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -static asm void daStartAndGoal_create(fopAc_ac_c* param_0) { - nofralloc -#include "asm/rel/d/a/d_a_startAndGoal/d_a_startAndGoal/daStartAndGoal_create__FP10fopAc_ac_c.s" -} -#pragma pop - -/* 80D4DE08-80D4DE68 0006C8 0060+00 1/0 0/0 0/0 .text __dt__13daNpcF_Path_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm daNpcF_Path_c::~daNpcF_Path_c() { - nofralloc -#include "asm/rel/d/a/d_a_startAndGoal/d_a_startAndGoal/__dt__13daNpcF_Path_cFv.s" -} -#pragma pop - -/* 80D4DE68-80D4DEB0 000728 0048+00 1/0 0/0 0/0 .text __dt__16daNpcF_SPCurve_cFv */ -#pragma push -#pragma optimization_level 0 -#pragma optimizewithasm off -asm daNpcF_SPCurve_c::~daNpcF_SPCurve_c() { - nofralloc -#include "asm/rel/d/a/d_a_startAndGoal/d_a_startAndGoal/__dt__16daNpcF_SPCurve_cFv.s" +static int daStartAndGoal_create(fopAc_ac_c* i_this) { + return static_cast<daStartAndGoal_c*>(i_this)->Create(); } -#pragma pop + +/* 80D4DEE4-80D4DF04 -00001 0020+00 1/0 0/0 0/0 .data l_daStartAndGoal_Method */ +static actor_method_class l_daStartAndGoal_Method = { + (process_method_func)daStartAndGoal_create, (process_method_func)daStartAndGoal_Delete, + (process_method_func)daStartAndGoal_Execute, (process_method_func)daStartAndGoal_IsDelete, + (process_method_func)daStartAndGoal_Draw, +}; + +/* 80D4DF04-80D4DF34 -00001 0030+00 0/0 0/0 1/0 .data g_profile_START_AND_GOAL */ +extern actor_process_profile_definition g_profile_START_AND_GOAL = { + fpcLy_CURRENT_e, + 9, + fpcPi_CURRENT_e, + PROC_START_AND_GOAL, + &g_fpcLf_Method.mBase, + sizeof(daStartAndGoal_c), + 0, + 0, + &g_fopAc_Method.base, + 391, + &l_daStartAndGoal_Method, + 0x44000, + fopAc_ACTOR_e, + fopAc_CULLBOX_CUSTOM_e, +};
\ No newline at end of file |
