summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarco_21 <144170194+carter-ktb21@users.noreply.github.com>2025-10-22 21:39:18 -0400
committerGitHub <noreply@github.com>2025-10-23 04:39:18 +0300
commit4a5752fe520125ed8b674b09da4980603f2422f3 (patch)
tree60044b043d24302e5f1f1557ce0f771d8d0709bf /src
parentd6711a18c804d90aa4b42aa4a4565c649fddfd30 (diff)
d_a_obj_gm almost matching (#2750)
* linked some objs * major work * equivalent * almost matching * almost matching * PR cleanup
Diffstat (limited to 'src')
-rw-r--r--src/d/actor/d_a_obj_gm.cpp1319
-rw-r--r--src/d/actor/d_a_obj_ito.cpp20
-rw-r--r--src/d/actor/d_a_tbox.cpp2
3 files changed, 693 insertions, 648 deletions
diff --git a/src/d/actor/d_a_obj_gm.cpp b/src/d/actor/d_a_obj_gm.cpp
index 2602c832cc..917f3afd00 100644
--- a/src/d/actor/d_a_obj_gm.cpp
+++ b/src/d/actor/d_a_obj_gm.cpp
@@ -7,720 +7,765 @@
#include "d/actor/d_a_obj_gm.h"
#include "d/d_cc_d.h"
-#include "dol2asm.h"
-
-
-
-
-//
-// Forward References:
-//
-
-extern "C" void __ct__14daObj_Gm_HIO_cFv();
-extern "C" static void daObj_Gm_Draw__FP12obj_gm_class();
-extern "C" static void wall_angle_get__FP12obj_gm_class();
-extern "C" void __dt__4cXyzFv();
-extern "C" static void ito_pos_set__FP12obj_gm_class();
-extern "C" static void bg_fix__FP12obj_gm_class();
-extern "C" static void swing__FP12obj_gm_class();
-extern "C" static void drop__FP12obj_gm_class();
-extern "C" static void action__FP12obj_gm_class();
-extern "C" static void s_tbox_sub__FPvPv();
-extern "C" static void s_so_sub__FPvPv();
-extern "C" static void daObj_Gm_Execute__FP12obj_gm_class();
-extern "C" static bool daObj_Gm_IsDelete__FP12obj_gm_class();
-extern "C" static void daObj_Gm_Delete__FP12obj_gm_class();
-extern "C" static void useHeapInit__FP10fopAc_ac_c();
-extern "C" static void daObj_Gm_Create__FP10fopAc_ac_c();
-extern "C" void __dt__8cM3dGSphFv();
-extern "C" void __dt__8cM3dGAabFv();
-extern "C" void __dt__10dCcD_GSttsFv();
-extern "C" void __dt__12dBgS_ObjAcchFv();
-extern "C" void __dt__12dBgS_AcchCirFv();
-extern "C" void __ct__4cXyzFv();
-extern "C" void __dt__10cCcD_GSttsFv();
-extern "C" void __dt__14daObj_Gm_HIO_cFv();
-extern "C" void __sinit_d_a_obj_gm_cpp();
-extern "C" static void func_80BFD308();
-extern "C" static void func_80BFD310();
-extern "C" extern char const* const d_a_obj_gm__stringBase0;
-
-//
-// External References:
-//
-
-extern "C" void mDoMtx_XrotS__FPA4_fs();
-extern "C" void mDoMtx_XrotM__FPA4_fs();
-extern "C" void mDoMtx_YrotS__FPA4_fs();
-extern "C" void mDoMtx_YrotM__FPA4_fs();
-extern "C" void mDoMtx_ZrotM__FPA4_fs();
-extern "C" void mDoExt_modelUpdateDL__FP8J3DModel();
-extern "C" void mDoExt_J3DModel__create__FP12J3DModelDataUlUl();
-extern "C" void __ct__10fopAc_ac_cFv();
-extern "C" void fopAc_IsActor__FPv();
-extern "C" void fopAcM_delete__FP10fopAc_ac_c();
-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_createItemFromTable__FPC4cXyziiiPC5csXyziPC4cXyzPfPfb();
-extern "C" void fopAcM_createItemForMidBoss__FPC4cXyziiPC5csXyzPC4cXyzii();
-extern "C" void fopAcM_createDisappear__FPC10fopAc_ac_cPC4cXyzUcUcUc();
-extern "C" void fopAcM_effSmokeSet1__FPUlPUlPC4cXyzPC5csXyzfPC12dKy_tevstr_ci();
-extern "C" void fpcEx_Search__FPFPvPv_PvPv();
-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_setSimpleShadow__FP4cXyzffR13cBgS_PolyInfosfP9_GXTexObj();
-extern "C" void onSwitch__10dSv_info_cFii();
-extern "C" void isSwitch__10dSv_info_cCFii();
-extern "C" void make_eff_break_gm_kotubo__5daObjFP10fopAc_ac_c();
-extern "C" void make_eff_break_gm_ootubo__5daObjFP10fopAc_ac_c();
-extern "C" void getRes__14dRes_control_cFPCclP11dRes_info_ci();
-extern "C" void StartShock__12dVibration_cFii4cXyz();
-extern "C" void LineCross__4cBgSFP11cBgS_LinChk();
-extern "C" void __ct__12dBgS_AcchCirFv();
-extern "C" void SetWall__12dBgS_AcchCirFff();
-extern "C" void __dt__9dBgS_AcchFv();
-extern "C" void __ct__9dBgS_AcchFv();
-extern "C" void Set__9dBgS_AcchFP4cXyzP4cXyzP10fopAc_ac_ciP12dBgS_AcchCirP4cXyzP5csXyzP5csXyz();
-extern "C" void CrrPos__9dBgS_AcchFR4dBgS();
-extern "C" void __ct__11dBgS_LinChkFv();
-extern "C" void __dt__11dBgS_LinChkFv();
-extern "C" void Set__11dBgS_LinChkFPC4cXyzPC4cXyzPC10fopAc_ac_c();
-extern "C" void SetObj__16dBgS_PolyPassChkFv();
-extern "C" void __ct__10dCcD_GSttsFv();
-extern "C" void Init__9dCcD_SttsFiiP10fopAc_ac_c();
-extern "C" void __ct__12dCcD_GObjInfFv();
-extern "C" void ChkTgHit__12dCcD_GObjInfFv();
-extern "C" void GetTgHitObj__12dCcD_GObjInfFv();
-extern "C" void Set__8dCcD_SphFRC11dCcD_SrcSph();
-extern "C" void def_se_set__FP10Z2CreatureP8cCcD_ObjUlP10fopAc_ac_c();
-extern "C" void at_power_check__FP11dCcU_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 __mi__4cXyzCFRC3Vec();
-extern "C" void cM_atan2s__Fff();
-extern "C" void cM_rndF__Ff();
-extern "C" void cM_rndFX__Ff();
-extern "C" void __dt__13cBgS_PolyInfoFv();
-extern "C" void __dt__8cM3dGCirFv();
-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 MtxPosition__FP4cXyzP4cXyz();
-extern "C" void MtxPush__Fv();
-extern "C" void MtxPull__Fv();
-extern "C" void __ct__10Z2CreatureFv();
-extern "C" void init__10Z2CreatureFP3VecP3VecUcUc();
-extern "C" void __dl__FPv();
-extern "C" void __construct_array();
-extern "C" void _savegpr_26();
-extern "C" void _savegpr_27();
-extern "C" void _savegpr_28();
-extern "C" void _savegpr_29();
-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 mSimpleTexObj__21dDlst_shadowControl_c[32];
-extern "C" u8 sincosTable___5JMath[65536];
-extern "C" void __register_global_object();
-
-//
-// Declarations:
-//
+#include "d/actor/d_a_obj_so.h"
+#include "d/d_a_obj.h"
+#include "d/d_s_play.h"
+
+enum OBJ_GM_RES_File_ID {
+ /* BMDR */
+ /* 0x3 */ BMDR_K_KUMO_HASI00 = 0x3,
+ /* 0x4 */ BMDR_K_KUMO_IWA00,
+ /* 0x5 */ BMDR_K_KUMO_IWA01,
+ /* 0x6 */ BMDR_K_KUMO_TUBO00,
+ /* 0x7 */ BMDR_K_KUMO_TUBO01,
+};
+
+class daObj_Gm_HIO_c : public JORReflexible {
+public:
+ /* 80BFB14C */ daObj_Gm_HIO_c();
+ /* 80BFD284 */ virtual ~daObj_Gm_HIO_c() {}
+
+ void genMessage(JORMContext*);
+
+ /* 0x4 */ s8 id;
+};
/* 80BFD3E8-80BFD404 000020 001C+00 7/8 0/0 0/0 .data obj_size */
-SECTION_DATA static u8 obj_size[28] = {
- 0x41, 0xF0, 0x00, 0x00, 0x42, 0x48, 0x00, 0x00, 0x42, 0x48, 0x00, 0x00, 0x43, 0x0C,
- 0x00, 0x00, 0x42, 0xC8, 0x00, 0x00, 0x42, 0x8C, 0x00, 0x00, 0x43, 0x48, 0x00, 0x00,
+static f32 obj_size[7] = {
+ 30.0f, 50.0f, 50.0f, 140.0f, 100.0f, 70.0f, 200.0f,
};
/* 80BFD404-80BFD420 00003C 001C+00 0/1 0/0 0/0 .data weg */
-#pragma push
-#pragma force_active on
-SECTION_DATA static u8 weg[28] = {
- 0x42, 0x70, 0x00, 0x00, 0x42, 0x8C, 0x00, 0x00, 0x42, 0xA0, 0x00, 0x00, 0x43, 0x16,
- 0x00, 0x00, 0x42, 0xC8, 0x00, 0x00, 0x42, 0x70, 0x00, 0x00, 0x43, 0x48, 0x00, 0x00,
+static f32 weg[7] = {
+ 60.0f, 70.0f, 80.0f, 150.0f, 100.0f, 60.0f, 200.0f,
};
-#pragma pop
/* 80BFD420-80BFD430 000058 000E+02 0/1 0/0 0/0 .data tim */
-#pragma push
-#pragma force_active on
-SECTION_DATA static u8 tim[14 + 2 /* padding */] = {
- 0x05,
- 0xDC,
- 0x03,
- 0xE8,
- 0x04,
- 0xB0,
- 0x02,
- 0xBC,
- 0x03,
- 0x20,
- 0x03,
- 0xE8,
- 0x02,
- 0xBC,
- /* padding */
- 0x00,
- 0x00,
+static s16 tim[7] = {
+ 1500,
+ 1000,
+ 1200,
+ 700,
+ 800,
+ 1000,
+ 700,
};
-#pragma pop
/* 80BFD430-80BFD44C 000068 001C+00 2/2 0/0 0/0 .data spin_sp */
-SECTION_DATA static u8 spin_sp[28] = {
- 0x43, 0x48, 0x00, 0x00, 0x42, 0xC8, 0x00, 0x00, 0x43, 0x48, 0x00, 0x00, 0x42, 0x85,
- 0x66, 0x66, 0x42, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+static f32 spin_sp[7] = {
+ 200.0f, 100.0f, 200.0f, 66.7f, 80.0f, 0.0f, 0.0f,
};
/* 80BFD44C-80BFD45C 000084 000E+02 1/1 0/0 0/0 .data neg */
-SECTION_DATA static u8 neg[14 + 2 /* padding */] = {
- 0x01,
- 0x2C,
- 0x00,
- 0xC8,
- 0x00,
- 0xFA,
- 0x00,
- 0x78,
- 0x00,
- 0x96,
- 0x00,
- 0xFA,
- 0x00,
- 0x96,
- /* padding */
- 0x00,
- 0x00,
+static s16 neg[7] = {
+ 300,
+ 200,
+ 250,
+ 120,
+ 150,
+ 250,
+ 150,
};
/* 80BFD45C-80BFD478 000094 001C+00 1/1 0/0 0/0 .data obj_size_maji */
-SECTION_DATA static u8 obj_size_maji[28] = {
- 0x3F, 0x2A, 0x7E, 0xFA, 0x3F, 0x4C, 0xCC, 0xCD, 0x3F, 0x33, 0x33, 0x33, 0x3F, 0x99,
- 0x99, 0x9A, 0x3F, 0x80, 0x00, 0x00, 0x3F, 0x33, 0x33, 0x33, 0x3F, 0x99, 0x99, 0x9A,
+static f32 obj_size_maji[7] = {
+ 0.666f, 0.8f, 0.7f, 1.2f, 1.0f, 0.7f, 1.2f,
};
/* 80BFD478-80BFD494 0000B0 001C+00 1/1 0/0 0/0 .data gm_obj_bmd */
-SECTION_DATA static u8 gm_obj_bmd[28] = {
- 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
- 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06,
-};
-
-/* 80BFD494-80BFD4D4 0000CC 0040+00 1/1 0/0 0/0 .data cc_sph_src$4334 */
-static dCcD_SrcSph cc_sph_src = {
- {
- {0x0, {{AT_TYPE_CSTATUE_SWING, 0x2, 0x1f}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj
- {dCcD_SE_NONE, 0x0, 0x2, 0x0, 0x0}, // mGObjAt
- {dCcD_SE_METAL, 0x2, 0x0, 0x0, 0x3}, // mGObjTg
- {0x0}, // mGObjCo
- }, // mObjInf
- {
- {{0.0f, 0.0f, 0.0f}, 40.0f} // mSph
- } // mSphAttr
-};
-
-/* 80BFD4D4-80BFD4F4 -00001 0020+00 1/0 0/0 0/0 .data l_daObj_Gm_Method */
-static actor_method_class l_daObj_Gm_Method = {
- (process_method_func)daObj_Gm_Create__FP10fopAc_ac_c,
- (process_method_func)daObj_Gm_Delete__FP12obj_gm_class,
- (process_method_func)daObj_Gm_Execute__FP12obj_gm_class,
- (process_method_func)daObj_Gm_IsDelete__FP12obj_gm_class,
- (process_method_func)daObj_Gm_Draw__FP12obj_gm_class,
-};
-
-/* 80BFD4F4-80BFD524 -00001 0030+00 0/0 0/0 1/0 .data g_profile_OBJ_GM */
-extern actor_process_profile_definition g_profile_OBJ_GM = {
- fpcLy_CURRENT_e, // mLayerID
- 3, // mListID
- fpcPi_CURRENT_e, // mListPrio
- PROC_OBJ_GM, // mProcName
- &g_fpcLf_Method.base, // sub_method
- sizeof(obj_gm_class), // mSize
- 0, // mSizeOther
- 0, // mParameters
- &g_fopAc_Method.base, // sub_method
- 57, // mPriority
- &l_daObj_Gm_Method, // sub_method
- 0x00044100, // mStatus
- fopAc_ACTOR_e, // mActorType
- fopAc_CULLBOX_CUSTOM_e, // cullType
-};
-
-/* 80BFD524-80BFD530 00015C 000C+00 1/1 0/0 0/0 .data __vt__12dBgS_AcchCir */
-SECTION_DATA extern void* __vt__12dBgS_AcchCir[3] = {
- (void*)NULL /* RTTI */,
- (void*)NULL,
- (void*)__dt__12dBgS_AcchCirFv,
-};
-
-/* 80BFD530-80BFD53C 000168 000C+00 2/2 0/0 0/0 .data __vt__10cCcD_GStts */
-SECTION_DATA extern void* __vt__10cCcD_GStts[3] = {
- (void*)NULL /* RTTI */,
- (void*)NULL,
- (void*)__dt__10cCcD_GSttsFv,
-};
-
-/* 80BFD53C-80BFD548 000174 000C+00 1/1 0/0 0/0 .data __vt__10dCcD_GStts */
-SECTION_DATA extern void* __vt__10dCcD_GStts[3] = {
- (void*)NULL /* RTTI */,
- (void*)NULL,
- (void*)__dt__10dCcD_GSttsFv,
-};
-
-/* 80BFD548-80BFD554 000180 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,
-};
-
-/* 80BFD554-80BFD560 00018C 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,
-};
-
-/* 80BFD560-80BFD584 000198 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_80BFD310,
- (void*)NULL,
- (void*)NULL,
- (void*)func_80BFD308,
-};
-
-/* 80BFD584-80BFD590 0001BC 000C+00 2/2 0/0 0/0 .data __vt__14daObj_Gm_HIO_c */
-SECTION_DATA extern void* __vt__14daObj_Gm_HIO_c[3] = {
- (void*)NULL /* RTTI */,
- (void*)NULL,
- (void*)__dt__14daObj_Gm_HIO_cFv,
+static int gm_obj_bmd[7] = {
+ BMDR_K_KUMO_TUBO00, BMDR_K_KUMO_TUBO01, BMDR_K_KUMO_IWA01, BMDR_K_KUMO_IWA00, BMDR_K_KUMO_HASI00, BMDR_K_KUMO_TUBO00, BMDR_K_KUMO_TUBO00,
};
/* 80BFB14C-80BFB164 0000EC 0018+00 1/1 0/0 0/0 .text __ct__14daObj_Gm_HIO_cFv */
daObj_Gm_HIO_c::daObj_Gm_HIO_c() {
- // NONMATCHING
+ id = -1;
}
-/* ############################################################################################## */
-/* 80BFD32C-80BFD330 000000 0004+00 8/8 0/0 0/0 .rodata @3686 */
-SECTION_RODATA static f32 const lit_3686 = 1.0f;
-COMPILER_STRIP_GATE(0x80BFD32C, &lit_3686);
-
/* 80BFB164-80BFB218 000104 00B4+00 1/0 0/0 0/0 .text daObj_Gm_Draw__FP12obj_gm_class */
-static void daObj_Gm_Draw(obj_gm_class* param_0) {
- // NONMATCHING
+static int daObj_Gm_Draw(obj_gm_class* i_this) {
+ fopAc_ac_c* a_this = (fopAc_ac_c*)&i_this->actor;
+
+ if (i_this->mType < 5) {
+ g_env_light.settingTevStruct(16, &a_this->current.pos, &a_this->tevStr);
+ g_env_light.setLightTevColorType_MAJI(i_this->mModel, &a_this->tevStr);
+ mDoExt_modelUpdateDL(i_this->mModel);
+
+ if (i_this->mAction == 2) {
+ dComIfGd_setSimpleShadow(&a_this->current.pos, i_this->mBgc.GetGroundH(), obj_size[i_this->mType], i_this->mBgc.m_gnd,
+ 0, 1.0f, dDlst_shadowControl_c::getSimpleTex());
+ }
+ }
+
+ return 1;
}
-/* ############################################################################################## */
-/* 80BFD330-80BFD334 000004 0004+00 0/5 0/0 0/0 .rodata @3740 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static u8 const lit_3740[4] = {
- 0x00,
- 0x00,
- 0x00,
- 0x00,
-};
-COMPILER_STRIP_GATE(0x80BFD330, &lit_3740);
-#pragma pop
-
-/* 80BFD334-80BFD338 000008 0004+00 0/2 0/0 0/0 .rodata @3741 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_3741 = -50.0f;
-COMPILER_STRIP_GATE(0x80BFD334, &lit_3741);
-#pragma pop
-
-/* 80BFD338-80BFD33C 00000C 0004+00 0/2 0/0 0/0 .rodata @3742 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_3742 = 5.0f;
-COMPILER_STRIP_GATE(0x80BFD338, &lit_3742);
-#pragma pop
-
-/* 80BFD33C-80BFD340 000010 0004+00 0/1 0/0 0/0 .rodata @3743 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_3743 = 100.0f;
-COMPILER_STRIP_GATE(0x80BFD33C, &lit_3743);
-#pragma pop
-
-/* 80BFD340-80BFD344 000014 0004+00 0/1 0/0 0/0 .rodata @3744 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_3744 = -1.0f;
-COMPILER_STRIP_GATE(0x80BFD340, &lit_3744);
-#pragma pop
-
/* 80BFB218-80BFB3D4 0001B8 01BC+00 1/1 0/0 0/0 .text wall_angle_get__FP12obj_gm_class */
-static void wall_angle_get(obj_gm_class* param_0) {
- // NONMATCHING
+static s16 wall_angle_get(obj_gm_class* i_this) {
+ fopAc_ac_c* a_this = (fopAc_ac_c*)&i_this->actor;
+ dBgS_LinChk lin_chk;
+ cXyz spac, spb8, spa0[2];
+
+ cMtx_YrotS(*calc_mtx, i_this->field_0x720);
+ spac.x = 0.0f;
+ spac.y = 0.0f;
+ spac.z = -50.0f;
+ MtxPosition(&spac, &spb8);
+ spb8 += a_this->current.pos;
+ spac.x = 5.0f;
+ spac.y = 0.0f;
+ spac.z = obj_size[i_this->mType] + 100.0f;
+
+ for (int i = 0; i < 2; i++) {
+ MtxPosition(&spac, &spa0[i]);
+ spac.x *= -1.0f;
+ spa0[i] += spb8;
+ lin_chk.Set(&spb8, &spa0[i], a_this);
+
+ if (dComIfG_Bgsp().LineCross(&lin_chk)) {
+ spa0[i] = lin_chk.GetCross();
+ } else {
+ OS_REPORT("OBJ GM WALL CHECK NON ??\n");
+ return 35;
+ }
+ }
+
+ spac = spa0[1] - spa0[0];
+ return cM_atan2s(spac.x, spac.z) + 0x4000;
}
-/* 80BFB3D4-80BFB410 000374 003C+00 1/1 0/0 0/0 .text __dt__4cXyzFv */
-// cXyz::~cXyz() {
-extern "C" void __dt__4cXyzFv() {
- // NONMATCHING
-}
-
-/* ############################################################################################## */
-/* 80BFD344-80BFD348 000018 0004+00 0/1 0/0 0/0 .rodata @3763 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_3763 = 15.0f;
-COMPILER_STRIP_GATE(0x80BFD344, &lit_3763);
-#pragma pop
-
-/* 80BFD348-80BFD34C 00001C 0004+00 0/2 0/0 0/0 .rodata @3764 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_3764 = 7.0f / 10.0f;
-COMPILER_STRIP_GATE(0x80BFD348, &lit_3764);
-#pragma pop
-
/* 80BFB410-80BFB508 0003B0 00F8+00 3/3 0/0 0/0 .text ito_pos_set__FP12obj_gm_class */
-static void ito_pos_set(obj_gm_class* param_0) {
- // NONMATCHING
+static void ito_pos_set(obj_gm_class* i_this) {
+ cXyz pos;
+ pos.x = 0.0f;
+ pos.z = (JREG_F(9) + 15.0f) * obj_size_maji[i_this->mType];
+ MtxPush();
+
+ for (int i = 0; i < 6; i++) {
+ cMtx_YrotM(*calc_mtx, 0x2AAA);
+ pos.y = obj_size[i_this->mType] * 0.7f;
+ MtxPosition(&pos, &i_this->field_0x684[i]);
+ pos.y = -obj_size[i_this->mType] * 0.7f;
+ MtxPosition(&pos, &i_this->field_0x6cc[i]);
+ }
+
+ MtxPull();
}
-/* ############################################################################################## */
-/* 80BFD34C-80BFD350 000020 0004+00 0/1 0/0 0/0 .rodata @3927 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_3927 = 1.0f / 10.0f;
-COMPILER_STRIP_GATE(0x80BFD34C, &lit_3927);
-#pragma pop
-
-/* 80BFD350-80BFD354 000024 0004+00 0/2 0/0 0/0 .rodata @3928 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_3928 = 1.0f / 20.0f;
-COMPILER_STRIP_GATE(0x80BFD350, &lit_3928);
-#pragma pop
-
-/* 80BFD354-80BFD358 000028 0004+00 0/1 0/0 0/0 .rodata @3929 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_3929 = 12300.0f;
-COMPILER_STRIP_GATE(0x80BFD354, &lit_3929);
-#pragma pop
-
-/* 80BFD358-80BFD35C 00002C 0004+00 0/3 0/0 0/0 .rodata @3930 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_3930 = 40.0f;
-COMPILER_STRIP_GATE(0x80BFD358, &lit_3930);
-#pragma pop
-
-/* 80BFD35C-80BFD360 000030 0004+00 0/1 0/0 0/0 .rodata @3931 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_3931 = 20.0f;
-COMPILER_STRIP_GATE(0x80BFD35C, &lit_3931);
-#pragma pop
-
-/* 80BFD360-80BFD364 000034 0004+00 0/3 0/0 0/0 .rodata @3932 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_3932 = 10000.0f;
-COMPILER_STRIP_GATE(0x80BFD360, &lit_3932);
-#pragma pop
-
-/* 80BFD364-80BFD368 000038 0004+00 0/3 0/0 0/0 .rodata @3933 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_3933 = 10.0f;
-COMPILER_STRIP_GATE(0x80BFD364, &lit_3933);
-#pragma pop
-
-/* 80BFD368-80BFD36C 00003C 0004+00 0/1 0/0 0/0 .rodata @3934 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_3934 = 5000.0f;
-COMPILER_STRIP_GATE(0x80BFD368, &lit_3934);
-#pragma pop
-
/* 80BFB508-80BFBA14 0004A8 050C+00 1/1 0/0 0/0 .text bg_fix__FP12obj_gm_class */
-static void bg_fix(obj_gm_class* param_0) {
- // NONMATCHING
+static void bg_fix(obj_gm_class* i_this) {
+ // NONMATCHING - incorrect instruction generated at line 258
+ fopAc_ac_c* a_this = (fopAc_ac_c*)&i_this->actor;
+ cXyz sp28, sp34;
+
+ if (i_this->field_0x630 > 0.1f) {
+ i_this->field_0x634 = i_this->field_0x630 * cM_ssin(i_this->field_0x640 * tim[i_this->mType]);
+ i_this->field_0x638 = i_this->field_0x630 * cM_ssin(i_this->field_0x640 * (tim[i_this->mType] + 100));
+ cLib_addCalc0(&i_this->field_0x630, 0.05f, 0.1f);
+ i_this->field_0x640++;
+ } else {
+ i_this->field_0x640 = 0;
+ }
+
+ sp28.set(0.0f, 0.0f, weg[i_this->mType]);
+ cMtx_XrotS(*calc_mtx, a_this->current.angle.x);
+ MtxPosition(&sp28, &sp34);
+ MtxTrans(a_this->current.pos.x, a_this->current.pos.y + sp34.y, a_this->current.pos.z, 0);
+ cMtx_YrotM(*calc_mtx, a_this->current.angle.y);
+ cMtx_XrotM(*calc_mtx, a_this->current.angle.x);
+ MtxTrans(i_this->field_0x634, 0.0f, i_this->field_0x638, 1);
+ cMtx_YrotM(*calc_mtx, i_this->field_0x64c[0]);
+ MtxPush();
+ cMtx_YrotM(*calc_mtx, a_this->shape_angle.y);
+ cMtx_XrotM(*calc_mtx, a_this->shape_angle.x);
+ i_this->mModel->setBaseTRMtx(*calc_mtx);
+
+ if (i_this->mType == 5) {
+ if (i_this->field_0x650 != NULL) {
+ ((daTbox_c*)(i_this->field_0x650))->setDrawMtx(*calc_mtx);
+ }
+ } else if (i_this->mType == 6 && i_this->field_0x650 != NULL) {
+ obj_so_class* so_p = (obj_so_class*)(i_this->field_0x650);
+ so_p->field_0x1b60 = 1;
+ MTXCopy(*calc_mtx, so_p->mMtx);
+ }
+ MtxPull();
+
+ sp28.set(0.0f, 0.0f, 0.0f);
+ MtxPosition(&sp28, &i_this->field_0x714);
+ sp34 = i_this->field_0x714;
+
+ if (i_this->field_0x948 != 0) {
+ sp34.y -= 12300.0f;
+ }
+
+ if (i_this->mType < 6) {
+ i_this->mSph.SetC(sp34);
+ i_this->mSph.SetR((JREG_F(3) + 1.0f) * obj_size[i_this->mType]);
+ dComIfG_Ccsp()->Set(&i_this->mSph);
+ }
+
+ a_this->eyePos = i_this->field_0x714;
+ a_this->eyePos.y += 40.0f;
+ a_this->attention_info.position = a_this->eyePos;
+
+ sp28.set(0.0f, obj_size[i_this->mType] * 0.7f, 0.0f);
+ MtxPosition(&sp28, &i_this->field_0x654[0]);
+ sp28.set(0.0f, -obj_size[i_this->mType] * 0.7f, 0.0f);
+ MtxPosition(&sp28, &i_this->field_0x654[1]);
+
+ ito_pos_set(i_this);
+
+ if (i_this->mSph.ChkTgHit()) {
+ i_this->mAtInfo.mpCollider = i_this->mSph.GetTgHitObj();
+ at_power_check(&i_this->mAtInfo);
+
+ if (i_this->mType == 5) {
+ if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_HOOKSHOT)) {
+ a_this->field_0x567 = 1;
+ return;
+ }
+ } else {
+ if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_SLINGSHOT) || i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_HOOKSHOT)) {
+ i_this->mAtInfo.mAttackPower = 1;
+ }
+
+ if (i_this->mAtInfo.mAttackPower != 0 && i_this->mType <= 1) {
+ i_this->field_0x72c = 1;
+ } else {
+ i_this->field_0x948 = 15;
+ i_this->field_0x630 = TREG_F(4) + 20.0f;
+ i_this->field_0x648 = TREG_F(6) + 10000.0f;
+ }
+ }
+ }
+
+ if ((i_this->field_0xae4 & 4) != 0) {
+ i_this->field_0xae4 &= -5;
+ i_this->field_0x630 = TREG_F(14) + 10.0f;
+ i_this->field_0x648 = TREG_F(16) + 5000.0f;
+ }
+
+ i_this->mSph.OffAtSetBit();
+
+ if (i_this->mActionMode == 0) {
+ i_this->mActionMode = 1;
+ i_this->field_0x66c[0] = i_this->field_0x654[0];
+ i_this->field_0x66c[1] = i_this->field_0x654[1];
+ }
+
+ if ((i_this->field_0xae4 & 1) != 0) {
+ i_this->field_0xae4 &= ~1;
+ i_this->mAction = 1;
+ i_this->mActionMode = 0;
+ }
+
+ if ((i_this->field_0xae4 & 2) != 0) {
+ if (i_this->mType >= 5) {
+ fopAcM_delete(a_this);
+ } else {
+ i_this->field_0xae4 &= ~2;
+ i_this->mAction = 2;
+ i_this->mActionMode = 0;
+
+ if (i_this->mType != 0) {
+ i_this->mSph.OnAtSetBit();
+ }
+
+ i_this->field_0x728 = 1.0f;
+ }
+ }
}
-/* ############################################################################################## */
-/* 80BFD36C-80BFD374 000040 0008+00 0/1 0/0 0/0 .rodata @4091 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static u8 const lit_4091[8] = {
- 0x3F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-COMPILER_STRIP_GATE(0x80BFD36C, &lit_4091);
-#pragma pop
-
-/* 80BFD374-80BFD37C 000048 0008+00 0/1 0/0 0/0 .rodata @4092 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static u8 const lit_4092[8] = {
- 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-COMPILER_STRIP_GATE(0x80BFD374, &lit_4092);
-#pragma pop
-
-/* 80BFD37C-80BFD384 000050 0008+00 0/1 0/0 0/0 .rodata @4093 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static u8 const lit_4093[8] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-COMPILER_STRIP_GATE(0x80BFD37C, &lit_4093);
-#pragma pop
-
-/* 80BFD384-80BFD388 000058 0004+00 0/1 0/0 0/0 .rodata @4094 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_4094 = 1500.0f;
-COMPILER_STRIP_GATE(0x80BFD384, &lit_4094);
-#pragma pop
-
-/* 80BFD388-80BFD38C 00005C 0004+00 0/2 0/0 0/0 .rodata @4095 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_4095 = 2000.0f;
-COMPILER_STRIP_GATE(0x80BFD388, &lit_4095);
-#pragma pop
-
-/* 80BFD38C-80BFD394 000060 0004+04 0/2 0/0 0/0 .rodata @4096 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_4096[1 + 1 /* padding */] = {
- 1.0f / 40.0f,
- /* padding */
- 0.0f,
-};
-COMPILER_STRIP_GATE(0x80BFD38C, &lit_4096);
-#pragma pop
-
-/* 80BFD394-80BFD39C 000068 0008+00 0/1 0/0 0/0 .rodata @4098 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static u8 const lit_4098[8] = {
- 0x43, 0x30, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
-};
-COMPILER_STRIP_GATE(0x80BFD394, &lit_4098);
-#pragma pop
-
/* 80BFBA14-80BFC168 0009B4 0754+00 1/1 0/0 0/0 .text swing__FP12obj_gm_class */
-static void swing(obj_gm_class* param_0) {
- // NONMATCHING
+static void swing(obj_gm_class* i_this) {
+ fopAc_ac_c* a_this = (fopAc_ac_c*)&i_this->actor;
+ cXyz sp40, sp4c;
+
+ if (i_this->mSph.ChkTgHit()) {
+ if (i_this->mType <= 1) {
+ i_this->field_0x72c = 1;
+ return;
+ }
+
+ if (i_this->field_0x63c < 0x100 && i_this->field_0x63c > -0x100) {
+ i_this->field_0x640 = 0;
+ i_this->field_0x63c = (KREG_F(15) + 10.0f) * spin_sp[i_this->mType];
+ i_this->field_0x644 = fopAcM_searchPlayerAngleY(a_this);
+ } else if (i_this->field_0x63e < 0x100 && i_this->field_0x63e > -0x100) {
+ s16 angle = i_this->field_0x644 - fopAcM_searchPlayerAngleY(a_this);
+ i_this->field_0x642 = 0;
+ i_this->field_0x63e = i_this->field_0x63c * cM_ssin(angle);
+ }
+ }
+
+ if (i_this->field_0x63c > 0x1000 || i_this->field_0x63c < -0x1000) {
+ if (i_this->mType != 0) {
+ i_this->mSph.OnAtSetBit();
+ }
+ } else {
+ i_this->mSph.OffAtSetBit();
+ }
+
+ switch (i_this->mActionMode) {
+ case 0:
+ sp40 = i_this->field_0x614[0] - i_this->field_0x714;
+ i_this->field_0x62c = sp40.abs();
+ i_this->mActionMode = 1;
+ i_this->field_0x640 = 0x4000;
+ i_this->field_0x63c = a_this->current.angle.x;
+ i_this->field_0x644 = a_this->current.angle.y;
+ a_this->current.angle.y = 0;
+ // fallthrough
+ case 1:
+ i_this->field_0x648 = TREG_F(6) + 10000.0f;
+ a_this->current.angle.x = i_this->field_0x63c * cM_ssin(i_this->field_0x640);
+ a_this->current.angle.z = i_this->field_0x63e * cM_ssin(i_this->field_0x642);
+ sp40.x = i_this->field_0x62c;
+ if (sp40.x > 1500.0f) {
+ sp40.x = 1500.0f;
+ }
+
+ s16 sVar2 = 2000.0f - sp40.x;
+ i_this->field_0x640 += sVar2;
+ i_this->field_0x642 += sVar2;
+ cLib_addCalcAngleS2(&i_this->field_0x63c, 0, 32, YREG_S(3) + 3);
+ cLib_addCalcAngleS2(&i_this->field_0x63e, 0, 32, YREG_S(3) + 3);
+ MtxTrans(i_this->field_0x614[0].x, i_this->field_0x614[0].y, i_this->field_0x614[0].z, 0);
+ cMtx_YrotM(*calc_mtx, i_this->field_0x644);
+ cMtx_YrotM(*calc_mtx, a_this->current.angle.y);
+ cMtx_XrotM(*calc_mtx, a_this->current.angle.x);
+ cMtx_ZrotM(*calc_mtx, a_this->current.angle.z);
+ cMtx_YrotM(*calc_mtx, -i_this->field_0x644);
+ MtxTrans(0.0f, -i_this->field_0x62c, 0.0f, 1);
+ cMtx_YrotM(*calc_mtx, i_this->field_0x64c[0]);
+ MtxPush();
+ cMtx_YrotM(*calc_mtx, a_this->shape_angle.y);
+ cMtx_XrotM(*calc_mtx, a_this->shape_angle.x);
+ i_this->mModel->setBaseTRMtx(*calc_mtx);
+ MtxPull();
+
+ sp40.set(0.0f, 0.0f, 0.0f);
+ sp4c = a_this->current.pos;
+ MtxPosition(&sp40, &a_this->current.pos);
+ a_this->speed = a_this->current.pos - sp4c;
+
+ if (i_this->mType < 5) {
+ i_this->mSph.SetC(a_this->current.pos);
+ dComIfG_Ccsp()->Set(&i_this->mSph);
+ }
+
+ sp40.set(0.0f, obj_size[i_this->mType], 0.0f);
+ MtxPosition(&sp40, &i_this->field_0x654[0]);
+ ito_pos_set(i_this);
+
+ a_this->eyePos = a_this->current.pos;
+ a_this->eyePos.y += 40.0f;
+ a_this->attention_info.position = a_this->eyePos;
+ a_this->current.pos.y -= obj_size[i_this->mType];
+ a_this->old.pos.y -= obj_size[i_this->mType];
+ i_this->mBgc.CrrPos(dComIfG_Bgsp());
+ a_this->current.pos.y += obj_size[i_this->mType];
+ a_this->old.pos.y += obj_size[i_this->mType];
+
+ if (i_this->mBgc.ChkGroundHit() || i_this->mBgc.ChkWallHit()) {
+ if (i_this->mType <= 1) {
+ i_this->field_0x72c = 1;
+ } else {
+ i_this->field_0xae4 |= 2;
+ fopAcM_effSmokeSet1(&i_this->field_0xae8, &i_this->field_0xaec, &a_this->current.pos, NULL, (TREG_F(18) + 0.025f) * obj_size[i_this->mType],
+ &a_this->tevStr, 1);
+ }
+ }
+ break;
+ }
+
+ if ((i_this->field_0xae4 & 2) != 0) {
+ if (i_this->mType >= 5) {
+ fopAcM_delete(a_this);
+ } else {
+ i_this->field_0xae4 &= ~2;
+ i_this->mAction = 2;
+ i_this->mActionMode = 0;
+
+ if (i_this->mType != 0) {
+ i_this->mSph.OnAtSetBit();
+ }
+
+ i_this->field_0x720 = cM_atan2s(a_this->speed.x, a_this->speed.z);
+ a_this->speedF = JMAFastSqrt(a_this->speed.x * a_this->speed.x + a_this->speed.z * a_this->speed.z);
+ i_this->field_0x728 = 1.0f;
+ }
+ }
}
-/* ############################################################################################## */
-/* 80BFD39C-80BFD3A0 000070 0004+00 0/1 0/0 0/0 .rodata @4189 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_4189 = -3.0f / 10.0f;
-COMPILER_STRIP_GATE(0x80BFD39C, &lit_4189);
-#pragma pop
-
-/* 80BFD3A0-80BFD3A4 000074 0004+00 0/1 0/0 0/0 .rodata @4190 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_4190 = 7.0f / 20.0f;
-COMPILER_STRIP_GATE(0x80BFD3A0, &lit_4190);
-#pragma pop
-
-/* 80BFD3A4-80BFD3A8 000078 0004+00 0/1 0/0 0/0 .rodata @4191 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_4191 = 9.0f / 10.0f;
-COMPILER_STRIP_GATE(0x80BFD3A4, &lit_4191);
-#pragma pop
-
/* 80BFC168-80BFC664 001108 04FC+00 1/1 0/0 0/0 .text drop__FP12obj_gm_class */
-static void drop(obj_gm_class* param_0) {
- // NONMATCHING
+static void drop(obj_gm_class* i_this) {
+ fopAc_ac_c* a_this = (fopAc_ac_c*)&i_this->actor;
+ cXyz sp38, sp44;
+
+ cMtx_YrotS(*calc_mtx, i_this->field_0x720);
+ sp38.x = 0.0f;
+ sp38.y = 0.0f;
+ sp38.z = a_this->speedF * i_this->field_0x728;
+ MtxPosition(&sp38, &sp44);
+ a_this->current.pos.x += sp44.x;
+ a_this->current.pos.z += sp44.z;
+ a_this->current.pos.y += a_this->speed.y;
+ a_this->speed.y -= 5.0f;
+ a_this->current.pos.y -= obj_size[i_this->mType];
+ a_this->old.pos.y -= obj_size[i_this->mType];
+ f32 speedY = a_this->speed.y;
+ i_this->mBgc.CrrPos(dComIfG_Bgsp());
+ a_this->current.pos.y += obj_size[i_this->mType];
+ a_this->old.pos.y += obj_size[i_this->mType];
+
+ if (i_this->mBgc.ChkGroundHit()) {
+ if (i_this->mType <= 1) {
+ i_this->field_0x72c = 1;
+ } else {
+ if (speedY < -50.0f) {
+ a_this->speed.y = speedY * -0.3f;
+ }
+
+ if (i_this->mType != 4) {
+ cLib_addCalc0(&a_this->speedF, 1.0f, TREG_F(17) + 1.0f);
+ } else {
+ i_this->field_0x72c = 1;
+ }
+
+ if (i_this->field_0x726 == 0) {
+ i_this->field_0x726 = 1;
+ fopAcM_effSmokeSet1(&i_this->field_0xae8, &i_this->field_0xaec, &a_this->current.pos, NULL, (TREG_F(18) + 0.025f) * obj_size[i_this->mType], &a_this->tevStr, 1);
+
+ if (i_this->mType >= 3) {
+ i_this->mSound.startCreatureSound(Z2SE_EN_AI_HAMMER_HIT, 0, -1);
+ dComIfGp_getVibration().StartShock(YREG_S(2) + 5, 15, cXyz(0.0f, 1.0f, 0.0f));
+ }
+ }
+ }
+ } else {
+ i_this->mSph.OffAtSetBit();
+ }
+
+ if (i_this->mTimers[0] == 0 && i_this->mBgc.ChkWallHit()) {
+ i_this->mTimers[0] = 10;
+ s16 wallAngle = wall_angle_get(i_this);
+ if (a_this->speedF > 5.0f && wallAngle != 35) {
+ i_this->field_0x720 += (s16)(0x8000 - ((s16)(i_this->field_0x720 - wallAngle) << 1));
+ i_this->field_0x722 *= -1;
+ i_this->mTimers[0] = 10;
+ a_this->speedF *= AREG_F(4) + 0.35f;
+ } else {
+ a_this->speedF *= AREG_F(5) + 0.9f;
+ }
+ }
+
+ if (i_this->field_0x726 != 0) {
+ i_this->field_0x722 += (int)(a_this->speedF * i_this->field_0x728 * spin_sp[i_this->mType]);
+ }
+
+ MtxTrans(a_this->current.pos.x, a_this->current.pos.y, a_this->current.pos.z, 0);
+ cMtx_YrotM(*calc_mtx, i_this->field_0x720);
+ cMtx_XrotM(*calc_mtx, i_this->field_0x722);
+ cMtx_YrotM(*calc_mtx, -i_this->field_0x720);
+ cMtx_YrotM(*calc_mtx, a_this->current.angle.y);
+ cMtx_XrotM(*calc_mtx, a_this->current.angle.x);
+ cMtx_YrotM(*calc_mtx, i_this->field_0x64c[0]);
+
+ sp38.set(0.0f, obj_size[i_this->mType], 0.0f);
+ MtxPosition(&sp38, &i_this->field_0x654[0]);
+ sp38.set(0.0f, -obj_size[i_this->mType], 0.0f);
+ MtxPosition(&sp38, &i_this->field_0x654[1]);
+
+ ito_pos_set(i_this);
+
+ cMtx_YrotM(*calc_mtx, a_this->shape_angle.y);
+ cMtx_XrotM(*calc_mtx, a_this->shape_angle.x);
+ i_this->mModel->setBaseTRMtx(*calc_mtx);
+ i_this->mSph.SetC(a_this->current.pos);
+ dComIfG_Ccsp()->Set(&i_this->mSph);
+ a_this->eyePos = a_this->current.pos;
+ a_this->eyePos.y += 40.0f;
+ a_this->attention_info.position = a_this->eyePos;
}
/* 80BFC664-80BFC7D0 001604 016C+00 1/1 0/0 0/0 .text action__FP12obj_gm_class */
-static void action(obj_gm_class* param_0) {
- // NONMATCHING
+static void action(obj_gm_class* i_this) {
+ fopAc_ac_c* a_this = (fopAc_ac_c*)&i_this->actor;
+ s8 bVar1 = 1;
+
+ switch (i_this->mAction) {
+ case 0:
+ bg_fix(i_this);
+ break;
+
+ case 1:
+ swing(i_this);
+ break;
+
+ case 2:
+ drop(i_this);
+ bVar1 = 0;
+ break;
+ }
+
+ if (bVar1) {
+ s16 target = i_this->field_0x648 * cM_ssin(i_this->field_0x608 * neg[i_this->mType]);
+ cLib_addCalc2(&i_this->field_0x648, NREG_F(8) + 2000.0f, 0.05f, TREG_F(5) + 10.0f);
+ cLib_addCalcAngleS2(&i_this->field_0x64c[0], target, 16, 200);
+ }
+
+ if (i_this->mSph.ChkTgHit()) {
+ if (i_this->mType >= 2) {
+ i_this->field_0x948 = 15;
+ def_se_set(&i_this->mSound, i_this->mSph.GetTgHitObj(), 35, NULL);
+ }
+
+ fopAc_ac_c* actor_p = dCc_GetAc(i_this->mSph.GetTgHitObj()->GetAc());
+ if (actor_p != NULL && fopAcM_GetName(actor_p) == PROC_OBJ_GM) {
+ i_this->field_0xae4 |= 2;
+ }
+ }
+
+ fopAcM_OffStatus(a_this, 0);
+ a_this->attention_info.flags = 0;
}
-/* ############################################################################################## */
-/* 80BFD3A8-80BFD3AC 00007C 0004+00 1/1 0/0 0/0 .rodata @4229 */
-SECTION_RODATA static f32 const lit_4229 = 40000.0f;
-COMPILER_STRIP_GATE(0x80BFD3A8, &lit_4229);
-
/* 80BFC7D0-80BFC85C 001770 008C+00 1/1 0/0 0/0 .text s_tbox_sub__FPvPv */
-static void s_tbox_sub(void* param_0, void* param_1) {
- // NONMATCHING
+static void* s_tbox_sub(void* i_actor, void* i_data) {
+ if (fopAcM_IsActor(i_actor) && fopAcM_GetName(i_actor) == PROC_TBOX) {
+ f32 fVar1 = ((fopAc_ac_c*)i_actor)->current.pos.x - ((fopAc_ac_c*)i_data)->current.pos.x;
+ f32 fVar2 = ((fopAc_ac_c*)i_actor)->current.pos.z - ((fopAc_ac_c*)i_data)->current.pos.z;
+ if (fVar1 * fVar1 + fVar2 * fVar2 < 40000.0f) {
+ return i_actor;
+ }
+ }
+
+ return NULL;
}
/* 80BFC85C-80BFC8A8 0017FC 004C+00 1/1 0/0 0/0 .text s_so_sub__FPvPv */
-static void s_so_sub(void* param_0, void* param_1) {
- // NONMATCHING
+static void* s_so_sub(void* i_actor, void* i_data) {
+ if (fopAcM_IsActor(i_actor) && fopAcM_GetName(i_actor) == PROC_OBJ_SO) {
+ return i_actor;
+ }
+
+ return NULL;
}
-/* ############################################################################################## */
-/* 80BFD3AC-80BFD3B0 000080 0004+00 1/1 0/0 0/0 .rodata @4291 */
-SECTION_RODATA static f32 const lit_4291 = 1.0f / 5.0f;
-COMPILER_STRIP_GATE(0x80BFD3AC, &lit_4291);
-/* 80BFC8A8-80BFCAF8 001848 0250+00 2/1 0/0 0/0 .text daObj_Gm_Execute__FP12obj_gm_class
- */
-static void daObj_Gm_Execute(obj_gm_class* param_0) {
- // NONMATCHING
-}
+/* 80BFC8A8-80BFCAF8 001848 0250+00 2/1 0/0 0/0 .text daObj_Gm_Execute__FP12obj_gm_class */
+static int daObj_Gm_Execute(obj_gm_class* i_this) {
+ fopAc_ac_c* a_this = (fopAc_ac_c*)&i_this->actor;
-/* 80BFCAF8-80BFCB00 001A98 0008+00 1/0 0/0 0/0 .text daObj_Gm_IsDelete__FP12obj_gm_class
- */
-static bool daObj_Gm_IsDelete(obj_gm_class* param_0) {
- return true;
-}
+ if (i_this->field_0x650 == NULL) {
+ if (i_this->mType == 5) {
+ i_this->field_0x650 = fpcM_Search(s_tbox_sub, i_this);
+ } else if (i_this->mType == 6) {
+ i_this->field_0x650 = fpcM_Search(s_so_sub, i_this);
+ }
+ }
-/* ############################################################################################## */
-/* 80BFD3C0-80BFD3C0 000094 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
-#pragma push
-#pragma force_active on
-SECTION_DEAD static char const* const stringBase_80BFD3C0 = "OBJ_GM";
-#pragma pop
+ i_this->field_0x608++;
-/* 80BFD598-80BFD59C 000008 0004+00 2/2 0/0 0/0 .bss None */
-static u8 data_80BFD598[4];
+ if (i_this->field_0x948 != 0) {
+ i_this->field_0x948--;
+ }
-/* 80BFCB00-80BFCB74 001AA0 0074+00 1/0 0/0 0/0 .text daObj_Gm_Delete__FP12obj_gm_class
- */
-static void daObj_Gm_Delete(obj_gm_class* param_0) {
- // NONMATCHING
-}
+ for (int i = 0; i < 2; i++) {
+ if (i_this->mTimers[i] != 0) {
+ i_this->mTimers[i]--;
+ }
+ }
-/* 80BFCB74-80BFCBF0 001B14 007C+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */
-static void useHeapInit(fopAc_ac_c* param_0) {
- // NONMATCHING
-}
+ action(i_this);
-/* ############################################################################################## */
-/* 80BFD3B0-80BFD3B4 000084 0004+00 0/1 0/0 0/0 .rodata @4423 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_4423 = -300.0f;
-COMPILER_STRIP_GATE(0x80BFD3B0, &lit_4423);
-#pragma pop
-
-/* 80BFD3B4-80BFD3B8 000088 0004+00 0/1 0/0 0/0 .rodata @4424 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_4424 = 300.0f;
-COMPILER_STRIP_GATE(0x80BFD3B4, &lit_4424);
-#pragma pop
-
-/* 80BFD3B8-80BFD3BC 00008C 0004+00 0/1 0/0 0/0 .rodata @4425 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_4425 = 65536.0f;
-COMPILER_STRIP_GATE(0x80BFD3B8, &lit_4425);
-#pragma pop
-
-/* 80BFD3BC-80BFD3C0 000090 0004+00 0/1 0/0 0/0 .rodata @4426 */
-#pragma push
-#pragma force_active on
-SECTION_RODATA static f32 const lit_4426 = 50.0f;
-COMPILER_STRIP_GATE(0x80BFD3BC, &lit_4426);
-#pragma pop
-
-/* 80BFD59C-80BFD5A8 00000C 000C+00 1/1 0/0 0/0 .bss @3661 */
-static u8 lit_3661[12];
+ i_this->mSound.framework(0, dComIfGp_getReverb(fopAcM_GetRoomNo(a_this)));
-/* 80BFD5A8-80BFD5B0 000018 0008+00 2/2 0/0 0/0 .bss l_HIO */
-static u8 l_HIO[8];
+ if (i_this->field_0x72c != 0) {
+ if (i_this->mSwBit != 0) {
+ dComIfGs_onSwitch(i_this->mSwBit, fopAcM_GetRoomNo(a_this));
+ }
-/* 80BFCBF0-80BFD06C 001B90 047C+00 1/0 0/0 0/0 .text daObj_Gm_Create__FP10fopAc_ac_c */
-static void daObj_Gm_Create(fopAc_ac_c* param_0) {
- // NONMATCHING
-}
+ if (i_this->mType == 0) {
+ daObj::make_eff_break_gm_kotubo(a_this);
+ i_this->mSound.startCreatureSound(JA_SE_OBJ_BREAK_CHINA_S, 0, -1);
-/* 80BFD06C-80BFD0B4 00200C 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGSphFv */
-// cM3dGSph::~cM3dGSph() {
-extern "C" void __dt__8cM3dGSphFv() {
- // NONMATCHING
-}
+ if ((fopAcM_GetParam(a_this) & 0xFF) == 32) {
+ fopAcM_createItemForMidBoss(&a_this->current.pos, fpcNm_ITEM_SMALL_KEY, fopAcM_GetRoomNo(a_this), NULL, NULL, 0, fopAcM_GetParam(a_this) >> 24);
+ }
+ } else if (i_this->mType == 1) {
+ daObj::make_eff_break_gm_ootubo(a_this);
+ i_this->mSound.startCreatureSound(JA_SE_OBJ_BREAK_CHINA_L, 0, -1);
+ } else {
+ fopAcM_createDisappear(a_this, &a_this->current.pos, obj_size[i_this->mType] * 0.2f, 0, a_this->field_0x564);
+ }
-/* 80BFD0B4-80BFD0FC 002054 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGAabFv */
-// cM3dGAab::~cM3dGAab() {
-extern "C" void __dt__8cM3dGAabFv() {
- // NONMATCHING
-}
+ fopAcM_createItemFromTable(&a_this->current.pos, a_this->field_0x565, -1, fopAcM_GetRoomNo(a_this), &a_this->current.angle, 0, NULL, NULL, NULL, false);
+ fopAcM_delete(a_this);
+ }
-/* 80BFD0FC-80BFD158 00209C 005C+00 1/0 0/0 0/0 .text __dt__10dCcD_GSttsFv */
-// dCcD_GStts::~dCcD_GStts() {
-extern "C" void __dt__10dCcD_GSttsFv() {
- // NONMATCHING
+ return 1;
}
-/* 80BFD158-80BFD1C8 0020F8 0070+00 3/2 0/0 0/0 .text __dt__12dBgS_ObjAcchFv */
-// dBgS_ObjAcch::~dBgS_ObjAcch() {
-extern "C" void __dt__12dBgS_ObjAcchFv() {
- // NONMATCHING
+/* 80BFCAF8-80BFCB00 001A98 0008+00 1/0 0/0 0/0 .text daObj_Gm_IsDelete__FP12obj_gm_class */
+static int daObj_Gm_IsDelete(obj_gm_class* i_this) {
+ return 1;
}
-/* 80BFD1C8-80BFD238 002168 0070+00 1/0 0/0 0/0 .text __dt__12dBgS_AcchCirFv */
-// dBgS_AcchCir::~dBgS_AcchCir() {
-extern "C" void __dt__12dBgS_AcchCirFv() {
- // NONMATCHING
-}
+/* 80BFD598-80BFD59C 000008 0004+00 2/2 0/0 0/0 .bss None */
+static bool l_initHIO;
-/* 80BFD238-80BFD23C 0021D8 0004+00 1/1 0/0 0/0 .text __ct__4cXyzFv */
-// cXyz::cXyz() {
-extern "C" void __ct__4cXyzFv() {
- /* empty function */
-}
+/* 80BFCB00-80BFCB74 001AA0 0074+00 1/0 0/0 0/0 .text daObj_Gm_Delete__FP12obj_gm_class */
+static int daObj_Gm_Delete(obj_gm_class* i_this) {
+ fopAc_ac_c* a_this = (fopAc_ac_c*)&i_this->actor;
-/* 80BFD23C-80BFD284 0021DC 0048+00 1/0 0/0 0/0 .text __dt__10cCcD_GSttsFv */
-// cCcD_GStts::~cCcD_GStts() {
-extern "C" void __dt__10cCcD_GSttsFv() {
- // NONMATCHING
-}
+ fopAcM_GetID(a_this);
+ dComIfG_resDelete(&i_this->mPhase, "OBJ_GM");
-/* 80BFD284-80BFD2CC 002224 0048+00 2/1 0/0 0/0 .text __dt__14daObj_Gm_HIO_cFv */
-daObj_Gm_HIO_c::~daObj_Gm_HIO_c() {
- // NONMATCHING
-}
+ if (i_this->mIsFirstSpawn) {
+ l_initHIO = false;
+ }
-/* 80BFD2CC-80BFD308 00226C 003C+00 0/0 1/0 0/0 .text __sinit_d_a_obj_gm_cpp */
-void __sinit_d_a_obj_gm_cpp() {
- // NONMATCHING
+ if (a_this->heap != NULL) {
+ i_this->mSound.deleteObject();
+ }
+
+ return 1;
}
-#pragma push
-#pragma force_active on
-REGISTER_CTORS(0x80BFD2CC, __sinit_d_a_obj_gm_cpp);
-#pragma pop
+/* 80BFCB74-80BFCBF0 001B14 007C+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */
+static int useHeapInit(fopAc_ac_c* a_this) {
+ obj_gm_class* i_this = (obj_gm_class*)a_this;
+
+ J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("OBJ_GM", gm_obj_bmd[i_this->mType]);
+ JUT_ASSERT(1141, modelData != NULL);
-/* 80BFD308-80BFD310 0022A8 0008+00 1/0 0/0 0/0 .text @36@__dt__12dBgS_ObjAcchFv */
-static void func_80BFD308() {
- // NONMATCHING
+ i_this->mModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084);
+ if (i_this->mModel == NULL) {
+ return 0;
+ }
+
+ return 1;
}
-/* 80BFD310-80BFD318 0022B0 0008+00 1/0 0/0 0/0 .text @20@__dt__12dBgS_ObjAcchFv */
-static void func_80BFD310() {
- // NONMATCHING
+/* 80BFD5A8-80BFD5B0 000018 0008+00 2/2 0/0 0/0 .bss l_HIO */
+static daObj_Gm_HIO_c l_HIO;
+
+/* 80BFCBF0-80BFD06C 001B90 047C+00 1/0 0/0 0/0 .text daObj_Gm_Create__FP10fopAc_ac_c */
+static cPhs__Step daObj_Gm_Create(fopAc_ac_c* a_this) {
+ fopAcM_ct(a_this, obj_gm_class);
+ obj_gm_class* i_this = (obj_gm_class*)a_this;
+
+ cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, "OBJ_GM");
+ if (phase == cPhs_COMPLEATE_e) {
+ OS_REPORT("OBJ_GM PARAM %x\n", fopAcM_GetParam(a_this));
+ a_this->field_0x565 = fopAcM_GetParam(a_this);
+ i_this->mType = (fopAcM_GetParam(a_this) >> 8) & 15;
+ if (i_this->mType == 15) {
+ i_this->mType = 0;
+ }
+
+ i_this->field_0x571 = (fopAcM_GetParam(a_this) & 0xF000) >> 12;
+ i_this->mSwBit = a_this->current.angle.z;
+ a_this->shape_angle.z = 0;
+ a_this->current.angle.z = 0;
+
+ if (i_this->mSwBit != 0) {
+ if (dComIfGs_isSwitch(i_this->mSwBit, fopAcM_GetRoomNo(a_this))) {
+ OS_REPORT("OBJ_GM 破壊後なので再セットしません\n");
+ return cPhs_ERROR_e;
+ }
+ }
+
+ OS_REPORT("OBJ_GM//////////////OBJ_GM SET 1 !!\n");
+
+ if (!fopAcM_entrySolidHeap(a_this, useHeapInit, 0x1000)) {
+ OS_REPORT("//////////////OBJ_GM SET NON !!\n");
+ return cPhs_ERROR_e;
+ }
+
+ OS_REPORT("//////////////OBJ_GM SET 2 !!\n");
+
+ if (!l_initHIO) {
+ i_this->mIsFirstSpawn = true;
+ l_initHIO = true;
+ l_HIO.id = -1;
+ }
+
+ fopAcM_SetMtx(a_this, i_this->mModel->getBaseTRMtx());
+ fopAcM_SetMin(a_this, -300.0f, -300.0f, -300.0f);
+ fopAcM_SetMax(a_this, 300.0f, 300.0f, 300.0f);
+ a_this->attention_info.flags = fopAc_AttnFlag_BATTLE_e;
+
+ i_this->mStts.Init(0xFF, 0, a_this);
+
+ static dCcD_SrcSph cc_sph_src = {
+ {
+ {0x0, {{AT_TYPE_CSTATUE_SWING, 0x2, 0x1f}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj
+ {dCcD_SE_NONE, 0x0, 0x2, 0x0, 0x0}, // mGObjAt
+ {dCcD_SE_METAL, 0x2, 0x0, 0x0, 0x3}, // mGObjTg
+ {0x0}, // mGObjCo
+ }, // mObjInf
+ {
+ {{0.0f, 0.0f, 0.0f}, 40.0f} // mSph
+ } // mSphAttr
+ };
+
+ i_this->mSph.Set(cc_sph_src);
+ i_this->mSph.SetStts(&i_this->mStts);
+ i_this->mSound.init(&a_this->current.pos, &a_this->current.pos, 3, 1);
+
+ if (i_this->mType < 5) {
+ a_this->shape_angle.y = cM_rndF(65536.0f);
+ a_this->shape_angle.x = cM_rndFX(10000.0f);
+ }
+
+ i_this->mBgc.Set(fopAcM_GetPosition_p(a_this), fopAcM_GetOldPosition_p(a_this), a_this, 1, &i_this->mAcchCir, fopAcM_GetSpeed_p(a_this), NULL, NULL);
+ i_this->mAcchCir.SetWall(50.0f, obj_size[i_this->mType]);
+
+ i_this->field_0x608 = cM_rndF(65536.0f);
+
+ daObj_Gm_Execute(i_this);
+
+ fopAcM_createChild(PROC_OBJ_ITO, fopAcM_GetID(a_this), i_this->mType << 1, &a_this->current.pos,
+ fopAcM_GetRoomNo(a_this), &a_this->current.angle, NULL, -1, NULL);
+
+ if (i_this->field_0x571 == 1) {
+ fopAcM_createChild(PROC_OBJ_ITO, fopAcM_GetID(a_this), (i_this->mType << 1) | 1, &a_this->current.pos,
+ fopAcM_GetRoomNo(a_this), &a_this->current.angle, NULL, -1, NULL);
+ } else {
+ a_this->current.angle.x = 0;
+ }
+ }
+
+ return phase;
}
-/* 80BFD3C0-80BFD3C0 000094 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
+/* 80BFD4D4-80BFD4F4 -00001 0020+00 1/0 0/0 0/0 .data l_daObj_Gm_Method */
+static actor_method_class l_daObj_Gm_Method = {
+ (process_method_func)daObj_Gm_Create,
+ (process_method_func)daObj_Gm_Delete,
+ (process_method_func)daObj_Gm_Execute,
+ (process_method_func)daObj_Gm_IsDelete,
+ (process_method_func)daObj_Gm_Draw,
+};
+
+/* 80BFD4F4-80BFD524 -00001 0030+00 0/0 0/0 1/0 .data g_profile_OBJ_GM */
+extern actor_process_profile_definition g_profile_OBJ_GM = {
+ fpcLy_CURRENT_e, // mLayerID
+ 3, // mListID
+ fpcPi_CURRENT_e, // mListPrio
+ PROC_OBJ_GM, // mProcName
+ &g_fpcLf_Method.base, // sub_method
+ sizeof(obj_gm_class), // mSize
+ 0, // mSizeOther
+ 0, // mParameters
+ &g_fopAc_Method.base, // sub_method
+ 57, // mPriority
+ &l_daObj_Gm_Method, // sub_method
+ 0x00044100, // mStatus
+ fopAc_ACTOR_e, // mActorType
+ fopAc_CULLBOX_CUSTOM_e, // cullType
+};
diff --git a/src/d/actor/d_a_obj_ito.cpp b/src/d/actor/d_a_obj_ito.cpp
index b0f2c2e591..f3e9dcf036 100644
--- a/src/d/actor/d_a_obj_ito.cpp
+++ b/src/d/actor/d_a_obj_ito.cpp
@@ -72,9 +72,9 @@ static void cut_line_calc(obj_ito_class* i_this, ito_s* param_2, int param_3) {
cXyz sp11c(0.0f, 0.0f, 0.0f);
cXyz sp128;
- if (param_2 == &i_this->field_0x103c && actor_p != NULL && actor_p->field_0x60a == 2) {
- sp11c = *pos - actor_p->current.pos;
- sp11c *= (XREG_F(2) + 0.0018f) * actor_p->speedF;
+ if (param_2 == &i_this->field_0x103c && actor_p != NULL && actor_p->mAction == 2) {
+ sp11c = *pos - actor_p->actor.current.pos;
+ sp11c *= (XREG_F(2) + 0.0018f) * actor_p->actor.speedF;
}
cXyz sp134;
@@ -89,7 +89,7 @@ static void cut_line_calc(obj_ito_class* i_this, ito_s* param_2, int param_3) {
cXyz sp140;
sp104.y = sp104.z = 0.0f;
- if (actor_p != NULL && actor_p->field_0x60a == 1) {
+ if (actor_p != NULL && actor_p->mAction == 1) {
bVar1 = true;
cMtx_YrotS(*calc_mtx, actor_p->field_0x64c[0] + param_3 * (hREG_S(3) + 18000));
sp104.x = hREG_F(8) + 2.0f;
@@ -248,7 +248,7 @@ static void action(obj_ito_class* i_this) {
spe8 = i_this->field_0x618 - a_this->current.pos;
i_this->field_0x624 = a_this->current.pos + (spe8 * 0.5f);
- if (actor_p->field_0x60a == 0) {
+ if (actor_p->mAction == 0) {
spe8 = actor_p->field_0x654[i_this->field_0x570] - actor_p->field_0x66c[i_this->field_0x570];
i_this->field_0x624 += spe8 * (TREG_F(5) + 0.25f);
}
@@ -342,14 +342,14 @@ static void action(obj_ito_class* i_this) {
if (i_this->field_0x678[i].ChkCoHit()) {
fopAc_ac_c* var_r25 = i_this->field_0x678[i].GetCoHitObj()->GetAc();
- if (actor_p != NULL && var_r25 != actor_p) {
+ if (actor_p != NULL && var_r25 != &actor_p->actor) {
actor_p->field_0xae4 |= 0x4;
}
}
}
- if (actor_p != NULL && actor_p->field_0x567 != 0) {
- actor_p->field_0x567 = 0;
+ if (actor_p != NULL && actor_p->actor.field_0x567 != 0) {
+ actor_p->actor.field_0x567 = 0;
actor_p->field_0xae4 |= 2;
cut_set(i_this, 100);
}
@@ -403,7 +403,7 @@ static void action(obj_ito_class* i_this) {
}
}
- if (i_this->field_0x570 == 0 && actor_p->field_0x60a == 2 && i_this->field_0x1038 == 0) {
+ if (i_this->field_0x570 == 0 && actor_p->mAction == 2 && i_this->field_0x1038 == 0) {
cut_set(i_this, 100);
}
}
@@ -430,7 +430,7 @@ static void action(obj_ito_class* i_this) {
i_this->field_0x1038 = 2;
}
- a_this->current.angle = actor_p->current.angle;
+ a_this->current.angle = actor_p->actor.current.angle;
cMtx_YrotS(*calc_mtx, a_this->current.angle.y);
cMtx_XrotM(*calc_mtx, a_this->current.angle.x);
diff --git a/src/d/actor/d_a_tbox.cpp b/src/d/actor/d_a_tbox.cpp
index bf118c9750..45dab484fb 100644
--- a/src/d/actor/d_a_tbox.cpp
+++ b/src/d/actor/d_a_tbox.cpp
@@ -1753,7 +1753,7 @@ void daTbox_c::setBaseMtx() {
mDoMtx_stack_c::transM(0.0f, -50.0f, 0.0f);
if (field_0x9fc != 0) {
- mpModel->setBaseTRMtx(field_0xa00);
+ mpModel->setBaseTRMtx(mDrawMtx);
} else {
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
}