tag_allmato almost, swhit0 treesh swball done, misc cleanup (#2312)

* d_a_tag_allmato almost done

* d_a_swhit0 done

* some SSystem cleanup

* treesh done

* swball done, some other rel cleanup
This commit is contained in:
TakaRikka
2025-03-01 04:48:49 -08:00
committed by GitHub
parent 80edf3c8a8
commit f06311cd09
54 changed files with 2162 additions and 1767 deletions
-2
View File
@@ -131,10 +131,8 @@ 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" extern u8 g_dComIfG_gameInfo[122384];
extern "C" u8 mSimpleTexObj__21dDlst_shadowControl_c[32];
extern "C" u8 sincosTable___5JMath[65536];
extern "C" extern u8 mStayNo__20dStage_roomControl_c[4];
extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */];
extern "C" void __register_global_object();
+165 -269
View File
@@ -4,93 +4,176 @@
*/
#include "d/actor/d_a_obj_treesh.h"
#include "dol2asm.h"
//
// Forward References:
//
extern "C" void __ct__14daTreeSh_HIO_cFv();
extern "C" void __dt__5csXyzFv();
extern "C" void __dt__14mDoHIO_entry_cFv();
extern "C" static void nodeCallBack__FP8J3DJointi();
extern "C" void initBaseMtx__10daTreeSh_cFv();
extern "C" void setBaseMtx__10daTreeSh_cFv();
extern "C" void CreateHeap__10daTreeSh_cFv();
extern "C" void Create__10daTreeSh_cFv();
extern "C" void create1st__10daTreeSh_cFv();
extern "C" void Execute__10daTreeSh_cFPPA3_A4_f();
extern "C" void Draw__10daTreeSh_cFv();
extern "C" void Delete__10daTreeSh_cFv();
extern "C" static void daTreeSh_create1st__FP10daTreeSh_c();
extern "C" void __ct__5csXyzFv();
extern "C" static void daTreeSh_MoveBGDelete__FP10daTreeSh_c();
extern "C" static void daTreeSh_MoveBGExecute__FP10daTreeSh_c();
extern "C" static void daTreeSh_MoveBGDraw__FP10daTreeSh_c();
extern "C" void __dt__14daTreeSh_HIO_cFv();
extern "C" void __sinit_d_a_obj_treesh_cpp();
extern "C" extern char const* const d_a_obj_treesh__stringBase0;
//
// External References:
//
extern "C" void mDoMtx_YrotM__FPA4_fs();
extern "C" void transS__14mDoMtx_stack_cFRC4cXyz();
extern "C" void mDoExt_modelUpdateDL__FP8J3DModel();
extern "C" void mDoExt_J3DModel__create__FP12J3DModelDataUlUl();
extern "C" void fopAcM_setCullSizeBox__FP10fopAc_ac_cffffff();
extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc();
extern "C" void dComIfG_resDelete__FP30request_of_phase_process_classPCc();
extern "C" void getRes__14dRes_control_cFPCclP11dRes_info_ci();
extern "C" void dKyw_get_wind_pow__Fv();
extern "C" void __ct__16dBgS_MoveBgActorFv();
extern "C" bool IsDelete__16dBgS_MoveBgActorFv();
extern "C" bool ToFore__16dBgS_MoveBgActorFv();
extern "C" bool ToBack__16dBgS_MoveBgActorFv();
extern "C" void
MoveBGCreate__16dBgS_MoveBgActorFPCciPFP4dBgWPvRC13cBgS_PolyInfobP4cXyzP5csXyzP5csXyz_vUlPA3_A4_f();
extern "C" void MoveBGDelete__16dBgS_MoveBgActorFv();
extern "C" void MoveBGExecute__16dBgS_MoveBgActorFv();
extern "C" void settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c();
extern "C" void setLightTevColorType_MAJI__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c();
extern "C" void cM_rndF__Ff();
extern "C" void cM_rndFX__Ff();
extern "C" void __dl__FPv();
extern "C" void __construct_array();
extern "C" void _savegpr_23();
extern "C" void _savegpr_28();
extern "C" void _restgpr_23();
extern "C" void _restgpr_28();
extern "C" u8 now__14mDoMtx_stack_c[48];
extern "C" extern u8 g_dComIfG_gameInfo[122384];
extern "C" u8 mCurrentMtx__6J3DSys[48];
extern "C" u8 sincosTable___5JMath[65536];
extern "C" void __register_global_object();
//
// Declarations:
//
/* ############################################################################################## */
/* 80D1F8E8-80D1F8E8 000020 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
#pragma push
#pragma force_active on
SECTION_DEAD static char const* const stringBase_80D1F8E8 = "M_TreeSh";
#pragma pop
#include "d/d_com_inf_game.h"
/* 80D1F8F4-80D1F8F8 -00001 0004+00 4/4 0/0 0/0 .data l_arcName */
SECTION_DATA static void* l_arcName = (void*)&d_a_obj_treesh__stringBase0;
static char* l_arcName = "M_TreeSh";
/* 80D1F0CC-80D1F10C 0000EC 0040+00 1/1 0/0 0/0 .text __ct__14daTreeSh_HIO_cFv */
daTreeSh_HIO_c::daTreeSh_HIO_c() {
shake_strength = 800;
shake_speed = 500;
field_0x8 = 0;
field_0xa.z = 0;
field_0xa.y = 0;
field_0xa.x = 0;
}
/* 80D1F190-80D1F258 0001B0 00C8+00 1/1 0/0 0/0 .text nodeCallBack__FP8J3DJointi */
static int nodeCallBack(J3DJoint* i_joint, int param_1) {
if (!param_1) {
int jnt_no = i_joint->getJntNo();
J3DModel* model_p = j3dSys.getModel();
daTreeSh_c* tree_p = (daTreeSh_c*)model_p->getUserArea();
cMtx_copy(model_p->getAnmMtx(jnt_no), mDoMtx_stack_c::get());
if (jnt_no == 1) {
mDoMtx_stack_c::YrotM(tree_p->mRot[0].y);
} else if (jnt_no == 2) {
mDoMtx_stack_c::YrotM(tree_p->mRot[1].y);
}
model_p->setAnmMtx(jnt_no, mDoMtx_stack_c::get());
mDoMtx_copy(mDoMtx_stack_c::get(), j3dSys.mCurrentMtx);
}
return 1;
}
/* 80D1F258-80D1F294 000278 003C+00 1/1 0/0 0/0 .text initBaseMtx__10daTreeSh_cFv */
void daTreeSh_c::initBaseMtx() {
mpModel->setBaseScale(scale);
setBaseMtx();
}
/* 80D1F294-80D1F2E8 0002B4 0054+00 1/1 0/0 0/0 .text setBaseMtx__10daTreeSh_cFv */
void daTreeSh_c::setBaseMtx() {
mDoMtx_stack_c::transS(current.pos);
mDoMtx_stack_c::YrotM(shape_angle.y);
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
}
/* 80D1F2E8-80D1F358 000308 0070+00 1/0 0/0 0/0 .text CreateHeap__10daTreeSh_cFv */
int daTreeSh_c::CreateHeap() {
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 4);
JUT_ASSERT(211, modelData != 0);
mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084);
if (mpModel == NULL) {
return 0;
}
return 1;
}
/* 80D1F358-80D1F414 000378 00BC+00 1/0 0/0 0/0 .text Create__10daTreeSh_cFv */
int daTreeSh_c::Create() {
initBaseMtx();
fopAcM_SetMtx(this, mpModel->getBaseTRMtx());
J3DJoint* joint_p = mpModel->getModelData()->getJointNodePointer(0);
fopAcM_setCullSizeBox(this,
joint_p->getMin()->x, joint_p->getMin()->y, joint_p->getMin()->z,
joint_p->getMax()->x, joint_p->getMax()->y, joint_p->getMax()->z);
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 4);
modelData->getJointNodePointer(1)->setCallBack(nodeCallBack);
modelData->getJointNodePointer(2)->setCallBack(nodeCallBack);
mpModel->setUserArea((u32)this);
return 1;
}
/* 80D1F99C-80D1F9AC 000014 0010+00 2/2 0/0 0/0 .bss l_HIO */
static daTreeSh_HIO_c l_HIO;
/* 80D1F414-80D1F49C 000434 0088+00 1/1 0/0 0/0 .text create1st__10daTreeSh_cFv */
int daTreeSh_c::create1st() {
int phase_state = dComIfG_resLoad(&mPhase, l_arcName);
if (phase_state == cPhs_COMPLEATE_e) {
if (MoveBGCreate(l_arcName, 7, NULL, 0x4000, NULL) == cPhs_ERROR_e) {
return cPhs_ERROR_e;
}
#ifdef DEBUG
l_HIO.entryHIO("針葉樹");
#endif
}
return phase_state;
}
/* 80D1F49C-80D1F648 0004BC 01AC+00 1/0 0/0 0/0 .text Execute__10daTreeSh_cFPPA3_A4_f */
int daTreeSh_c::Execute(Mtx** param_0) {
for (int i = 0; i < 2; i++) {
if (mShakeTimer[i] == 0) {
mShakeTimer[i] = cM_rndF(30.0f) + 15.0f;
field_0x5b8[i] = cM_rndFX(0.3f) + 1.0f;
field_0x5c4[i] = field_0x5b8[i] * (l_HIO.shake_speed * (dKyw_get_wind_pow() + 0.2f));
} else {
mShakeTimer[i]--;
}
field_0x5c0[i] += field_0x5c4[i];
}
mRot[0].y = l_HIO.shake_strength * cM_ssin(field_0x5c0[0]);
mRot[1].y = l_HIO.shake_strength * cM_scos(field_0x5c0[1]);
*param_0 = &mpModel->getBaseTRMtx();
return 1;
}
/* 80D1F648-80D1F6EC 000668 00A4+00 1/0 0/0 0/0 .text Draw__10daTreeSh_cFv */
int daTreeSh_c::Draw() {
g_env_light.settingTevStruct(0x10, &current.pos, &tevStr);
g_env_light.setLightTevColorType_MAJI(mpModel, &tevStr);
dComIfGd_setListBG();
mDoExt_modelUpdateDL(mpModel);
dComIfGd_setList();
return 1;
}
/* 80D1F6EC-80D1F720 00070C 0034+00 1/0 0/0 0/0 .text Delete__10daTreeSh_cFv */
int daTreeSh_c::Delete() {
dComIfG_resDelete(&mPhase, l_arcName);
#ifdef DEBUG
l_HIO.removeHIO();
#endif
return 1;
}
/* 80D1F720-80D1F7AC 000740 008C+00 1/0 0/0 0/0 .text daTreeSh_create1st__FP10daTreeSh_c
*/
static int daTreeSh_create1st(daTreeSh_c* i_this) {
fopAcM_SetupActor(i_this, daTreeSh_c);
return i_this->create1st();
}
/* 80D1F7B0-80D1F7D0 0007D0 0020+00 1/0 0/0 0/0 .text daTreeSh_MoveBGDelete__FP10daTreeSh_c */
static int daTreeSh_MoveBGDelete(daTreeSh_c* i_this) {
return i_this->MoveBGDelete();
}
/* 80D1F7D0-80D1F7F0 0007F0 0020+00 1/0 0/0 0/0 .text daTreeSh_MoveBGExecute__FP10daTreeSh_c */
static int daTreeSh_MoveBGExecute(daTreeSh_c* i_this) {
return i_this->MoveBGExecute();
}
/* 80D1F7F0-80D1F81C 000810 002C+00 1/0 0/0 0/0 .text daTreeSh_MoveBGDraw__FP10daTreeSh_c
*/
static int daTreeSh_MoveBGDraw(daTreeSh_c* i_this) {
return i_this->MoveBGDraw();
}
/* 80D1F8F8-80D1F918 -00001 0020+00 1/0 0/0 0/0 .data daTreeSh_METHODS */
static actor_method_class daTreeSh_METHODS = {
(process_method_func)daTreeSh_create1st__FP10daTreeSh_c,
(process_method_func)daTreeSh_MoveBGDelete__FP10daTreeSh_c,
(process_method_func)daTreeSh_MoveBGExecute__FP10daTreeSh_c,
0,
(process_method_func)daTreeSh_MoveBGDraw__FP10daTreeSh_c,
(process_method_func)daTreeSh_create1st,
(process_method_func)daTreeSh_MoveBGDelete,
(process_method_func)daTreeSh_MoveBGExecute,
(process_method_func)NULL,
(process_method_func)daTreeSh_MoveBGDraw,
};
/* 80D1F918-80D1F948 -00001 0030+00 0/0 0/0 1/0 .data g_profile_TREESH */
@@ -110,190 +193,3 @@ extern actor_process_profile_definition g_profile_TREESH = {
fopAc_ACTOR_e, // mActorType
fopAc_CULLBOX_CUSTOM_e, // cullType
};
/* 80D1F948-80D1F970 000054 0028+00 1/1 0/0 0/0 .data __vt__10daTreeSh_c */
SECTION_DATA extern void* __vt__10daTreeSh_c[10] = {
(void*)NULL /* RTTI */,
(void*)NULL,
(void*)CreateHeap__10daTreeSh_cFv,
(void*)Create__10daTreeSh_cFv,
(void*)Execute__10daTreeSh_cFPPA3_A4_f,
(void*)Draw__10daTreeSh_cFv,
(void*)Delete__10daTreeSh_cFv,
(void*)IsDelete__16dBgS_MoveBgActorFv,
(void*)ToFore__16dBgS_MoveBgActorFv,
(void*)ToBack__16dBgS_MoveBgActorFv,
};
/* 80D1F970-80D1F97C 00007C 000C+00 2/2 0/0 0/0 .data __vt__14daTreeSh_HIO_c */
SECTION_DATA extern void* __vt__14daTreeSh_HIO_c[3] = {
(void*)NULL /* RTTI */,
(void*)NULL,
(void*)__dt__14daTreeSh_HIO_cFv,
};
/* 80D1F97C-80D1F988 000088 000C+00 3/3 0/0 0/0 .data __vt__14mDoHIO_entry_c */
SECTION_DATA extern void* __vt__14mDoHIO_entry_c[3] = {
(void*)NULL /* RTTI */,
(void*)NULL,
(void*)__dt__14mDoHIO_entry_cFv,
};
/* 80D1F0CC-80D1F10C 0000EC 0040+00 1/1 0/0 0/0 .text __ct__14daTreeSh_HIO_cFv */
daTreeSh_HIO_c::daTreeSh_HIO_c() {
// NONMATCHING
}
/* 80D1F10C-80D1F148 00012C 003C+00 1/1 0/0 0/0 .text __dt__5csXyzFv */
// csXyz::~csXyz() {
extern "C" void __dt__5csXyzFv() {
// NONMATCHING
}
/* 80D1F148-80D1F190 000168 0048+00 1/0 0/0 0/0 .text __dt__14mDoHIO_entry_cFv */
// mDoHIO_entry_c::~mDoHIO_entry_c() {
extern "C" void __dt__14mDoHIO_entry_cFv() {
// NONMATCHING
}
/* 80D1F190-80D1F258 0001B0 00C8+00 1/1 0/0 0/0 .text nodeCallBack__FP8J3DJointi */
static void nodeCallBack(J3DJoint* param_0, int param_1) {
// NONMATCHING
}
/* 80D1F258-80D1F294 000278 003C+00 1/1 0/0 0/0 .text initBaseMtx__10daTreeSh_cFv */
void daTreeSh_c::initBaseMtx() {
// NONMATCHING
}
/* 80D1F294-80D1F2E8 0002B4 0054+00 1/1 0/0 0/0 .text setBaseMtx__10daTreeSh_cFv */
void daTreeSh_c::setBaseMtx() {
// NONMATCHING
}
/* 80D1F2E8-80D1F358 000308 0070+00 1/0 0/0 0/0 .text CreateHeap__10daTreeSh_cFv */
void daTreeSh_c::CreateHeap() {
// NONMATCHING
}
/* 80D1F358-80D1F414 000378 00BC+00 1/0 0/0 0/0 .text Create__10daTreeSh_cFv */
void daTreeSh_c::Create() {
// NONMATCHING
}
/* 80D1F414-80D1F49C 000434 0088+00 1/1 0/0 0/0 .text create1st__10daTreeSh_cFv */
void daTreeSh_c::create1st() {
// NONMATCHING
}
/* ############################################################################################## */
/* 80D1F8C8-80D1F8CC 000000 0004+00 1/1 0/0 0/0 .rodata @3767 */
SECTION_RODATA static f32 const lit_3767 = 15.0f;
COMPILER_STRIP_GATE(0x80D1F8C8, &lit_3767);
/* 80D1F8CC-80D1F8D0 000004 0004+00 0/1 0/0 0/0 .rodata @3768 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3768 = 30.0f;
COMPILER_STRIP_GATE(0x80D1F8CC, &lit_3768);
#pragma pop
/* 80D1F8D0-80D1F8D4 000008 0004+00 0/1 0/0 0/0 .rodata @3769 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3769 = 1.0f;
COMPILER_STRIP_GATE(0x80D1F8D0, &lit_3769);
#pragma pop
/* 80D1F8D4-80D1F8D8 00000C 0004+00 0/1 0/0 0/0 .rodata @3770 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3770 = 3.0f / 10.0f;
COMPILER_STRIP_GATE(0x80D1F8D4, &lit_3770);
#pragma pop
/* 80D1F8D8-80D1F8E0 000010 0004+04 0/1 0/0 0/0 .rodata @3771 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3771[1 + 1 /* padding */] = {
1.0f / 5.0f,
/* padding */
0.0f,
};
COMPILER_STRIP_GATE(0x80D1F8D8, &lit_3771);
#pragma pop
/* 80D1F8E0-80D1F8E8 000018 0008+00 0/1 0/0 0/0 .rodata @3774 */
#pragma push
#pragma force_active on
SECTION_RODATA static u8 const lit_3774[8] = {
0x43, 0x30, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
};
COMPILER_STRIP_GATE(0x80D1F8E0, &lit_3774);
#pragma pop
/* 80D1F990-80D1F99C 000008 000C+00 1/1 0/0 0/0 .bss @3618 */
static u8 lit_3618[12];
/* 80D1F99C-80D1F9AC 000014 0010+00 2/2 0/0 0/0 .bss l_HIO */
static u8 l_HIO[16];
/* 80D1F49C-80D1F648 0004BC 01AC+00 1/0 0/0 0/0 .text Execute__10daTreeSh_cFPPA3_A4_f */
void daTreeSh_c::Execute(f32 (**param_0)[3][4]) {
// NONMATCHING
}
/* 80D1F648-80D1F6EC 000668 00A4+00 1/0 0/0 0/0 .text Draw__10daTreeSh_cFv */
void daTreeSh_c::Draw() {
// NONMATCHING
}
/* 80D1F6EC-80D1F720 00070C 0034+00 1/0 0/0 0/0 .text Delete__10daTreeSh_cFv */
void daTreeSh_c::Delete() {
// NONMATCHING
}
/* 80D1F720-80D1F7AC 000740 008C+00 1/0 0/0 0/0 .text daTreeSh_create1st__FP10daTreeSh_c
*/
static void daTreeSh_create1st(daTreeSh_c* param_0) {
// NONMATCHING
}
/* 80D1F7AC-80D1F7B0 0007CC 0004+00 1/1 0/0 0/0 .text __ct__5csXyzFv */
// csXyz::csXyz() {
extern "C" void __ct__5csXyzFv() {
/* empty function */
}
/* 80D1F7B0-80D1F7D0 0007D0 0020+00 1/0 0/0 0/0 .text daTreeSh_MoveBGDelete__FP10daTreeSh_c */
static void daTreeSh_MoveBGDelete(daTreeSh_c* param_0) {
// NONMATCHING
}
/* 80D1F7D0-80D1F7F0 0007F0 0020+00 1/0 0/0 0/0 .text daTreeSh_MoveBGExecute__FP10daTreeSh_c */
static void daTreeSh_MoveBGExecute(daTreeSh_c* param_0) {
// NONMATCHING
}
/* 80D1F7F0-80D1F81C 000810 002C+00 1/0 0/0 0/0 .text daTreeSh_MoveBGDraw__FP10daTreeSh_c
*/
static void daTreeSh_MoveBGDraw(daTreeSh_c* param_0) {
// NONMATCHING
}
/* 80D1F81C-80D1F878 00083C 005C+00 2/1 0/0 0/0 .text __dt__14daTreeSh_HIO_cFv */
daTreeSh_HIO_c::~daTreeSh_HIO_c() {
// NONMATCHING
}
/* 80D1F878-80D1F8B4 000898 003C+00 0/0 1/0 0/0 .text __sinit_d_a_obj_treesh_cpp */
void __sinit_d_a_obj_treesh_cpp() {
// NONMATCHING
}
#pragma push
#pragma force_active on
REGISTER_CTORS(0x80D1F878, __sinit_d_a_obj_treesh_cpp);
#pragma pop
/* 80D1F8E8-80D1F8E8 000020 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
+235 -175
View File
@@ -4,233 +4,293 @@
*/
#include "d/actor/d_a_swBall.h"
#include "dol2asm.h"
#include "d/actor/d_a_obj_carry.h"
#include "d/d_com_inf_game.h"
#include "d/d_lib.h"
#include "d/d_s_play.h"
//
// Forward References:
//
extern "C" static void s_ball_sub__FPvPv();
extern "C" void checkArea_sub__10daSwBall_cFP10fopAc_ac_c();
extern "C" void checkArea__10daSwBall_cFv();
extern "C" void search_ball__10daSwBall_cFv();
extern "C" void Create__10daSwBall_cFv();
extern "C" void create__10daSwBall_cFv();
extern "C" void execute__10daSwBall_cFv();
extern "C" void actionRun__10daSwBall_cFv();
extern "C" void actionStop__10daSwBall_cFv();
extern "C" void PutCrrPos__10daSwBall_cFv();
extern "C" bool _delete__10daSwBall_cFv();
extern "C" static void daSwBall_Execute__FP10daSwBall_c();
extern "C" static void daSwBall_Delete__FP10daSwBall_c();
extern "C" static void daSwBall_Create__FP10fopAc_ac_c();
extern "C" void func_80D4E974(void* _this, u8*);
//
// External References:
//
extern "C" void __ct__10fopAc_ac_cFv();
extern "C" void fopAc_IsActor__FPv();
extern "C" void fopAcIt_Judge__FPFPvPv_PvPv();
extern "C" void fopAcM_searchActorDistanceXZ__FPC10fopAc_ac_cPC10fopAc_ac_c();
extern "C" void fpcEx_Search__FPFPvPv_PvPv();
extern "C" void fpcSch_JudgeByID__FPvPv();
extern "C" void dLib_checkActorInRectangle__FP10fopAc_ac_cP10fopAc_ac_cPC4cXyzPC4cXyz();
extern "C" void onSwitch__10dSv_info_cFii();
extern "C" void offSwitch__10dSv_info_cFii();
extern "C" void cLib_chaseF__FPfff();
extern "C" void cLib_targetAngleY__FPC3VecPC3Vec();
extern "C" void __ptmf_scall();
extern "C" void _savegpr_25();
extern "C" void _savegpr_28();
extern "C" void _restgpr_25();
extern "C" void _restgpr_28();
extern "C" extern u8 g_dComIfG_gameInfo[122384];
//
// Declarations:
//
/* ############################################################################################## */
/* 80D4EA50-80D4EA70 000000 0020+00 2/2 0/0 0/0 .bss l_target_info */
static u8 l_target_info[32];
static fopAc_ac_c* l_target_info[8];
/* 80D4EA70-80D4EA74 000020 0004+00 2/2 0/0 0/0 .bss l_target_info_count */
static u8 l_target_info_count[4];
static int l_target_info_count;
/* 80D4DFD8-80D4E054 000078 007C+00 1/1 0/0 0/0 .text s_ball_sub__FPvPv */
static void s_ball_sub(void* param_0, void* param_1) {
// NONMATCHING
static void* s_ball_sub(void* i_actor, void* i_data) {
if (fopAcM_IsActor(i_actor) && fopAcM_GetName(i_actor) == PROC_Obj_Carry && ((daObjCarry_c*)i_actor)->getType() == daObjCarry_c::TYPE_LV8_BALL) {
if (l_target_info_count < 8) {
l_target_info[l_target_info_count] = (fopAc_ac_c*)i_actor;
l_target_info_count++;
} else {
// "Mysterious Ball Reaction Area Switch: mysterious ball count has exceeded limit!\n"
OS_REPORT("\x1b[43;30m怪しい玉反応領域スイッチ:怪しい玉対応できる数を越えてます!\n\x1b[m");
}
}
return NULL;
}
/* ############################################################################################## */
/* 80D4E998-80D4E99C 000000 0004+00 2/2 0/0 0/0 .rodata @3718 */
SECTION_RODATA static f32 const lit_3718 = 10.0f;
COMPILER_STRIP_GATE(0x80D4E998, &lit_3718);
/* 80D4E99C-80D4E9A0 000004 0004+00 0/1 0/0 0/0 .rodata @3719 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3719 = 100.0f;
COMPILER_STRIP_GATE(0x80D4E99C, &lit_3719);
#pragma pop
/* 80D4E9A0-80D4E9A4 000008 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(0x80D4E9A0, &lit_3720);
#pragma pop
/* 80D4E9A4-80D4E9A8 00000C 0004+00 0/2 0/0 0/0 .rodata @3721 */
#pragma push
#pragma force_active on
SECTION_RODATA static u8 const lit_3721[4] = {
0x00,
0x00,
0x00,
0x00,
};
COMPILER_STRIP_GATE(0x80D4E9A4, &lit_3721);
#pragma pop
/* 80D4E054-80D4E194 0000F4 0140+00 2/2 0/0 0/0 .text checkArea_sub__10daSwBall_cFP10fopAc_ac_c */
void daSwBall_c::checkArea_sub(fopAc_ac_c* param_0) {
// NONMATCHING
BOOL daSwBall_c::checkArea_sub(fopAc_ac_c* i_ball) {
if (getType() == 0) {
if (i_ball->current.pos.y >= current.pos.y - 10.0f && i_ball->current.pos.y < current.pos.y + (100.0f * scale.y) && fopAcM_searchActorDistanceXZ(this, i_ball) < (100.0f * scale.x)) {
return TRUE;
}
} else if (getType() == 1) {
cXyz bound_a(-100.0f * scale.x, 0.0f, -100.0f * scale.z);
cXyz bound_b(100.0f * scale.x, 100.0f * scale.y, 100.0f * scale.z);
bound_a.y += current.pos.y - 10.0f;
bound_b.y += current.pos.y;
if (i_ball->current.pos.y >= bound_a.y && i_ball->current.pos.y < bound_b.y && dLib_checkActorInRectangle(i_ball, this, &bound_a, &bound_b)) {
return TRUE;
}
}
return FALSE;
}
/* 80D4E194-80D4E248 000234 00B4+00 2/2 0/0 0/0 .text checkArea__10daSwBall_cFv */
void daSwBall_c::checkArea() {
// NONMATCHING
BOOL daSwBall_c::checkArea() {
fopAc_ac_c* ball_actors[8];
for (int i = 0; i < 8; i++) {
if (mBallIDs[i] != fpcM_ERROR_PROCESS_ID_e) {
ball_actors[i] = fopAcM_SearchByID(mBallIDs[i]);
} else {
ball_actors[i] = NULL;
}
if (ball_actors[i] != NULL && checkArea_sub(ball_actors[i])) {
return TRUE;
}
}
return FALSE;
}
/* 80D4E248-80D4E374 0002E8 012C+00 1/1 0/0 0/0 .text search_ball__10daSwBall_cFv */
void daSwBall_c::search_ball() {
// NONMATCHING
l_target_info_count = 0;
for (int i = 0; i < 8; i++) {
l_target_info[i] = NULL;
}
fpcM_Search(s_ball_sub, this);
for (int i = 0; i < l_target_info_count; i++) {
if (l_target_info[i] != NULL) {
fpc_ProcID target_id = fopAcM_GetID(l_target_info[i]);
if (target_id != fpcM_ERROR_PROCESS_ID_e) {
int ball_idx = -1;
for (int j = 0; j < 8; j++) {
if (target_id == mBallIDs[j]) {
ball_idx = j;
break;
}
}
if (ball_idx < 0) {
for (int j = 0; j < 8; j++) {
if (mBallIDs[j] == fpcM_ERROR_PROCESS_ID_e) {
mBallIDs[j] = target_id;
break;
}
}
}
}
}
}
}
/* 80D4E374-80D4E42C 000414 00B8+00 1/1 0/0 0/0 .text Create__10daSwBall_cFv */
void daSwBall_c::Create() {
// NONMATCHING
int daSwBall_c::Create() {
for (int i = 0; i < 8; i++) {
mBallIDs[i] = fpcM_ERROR_PROCESS_ID_e;
}
field_0x59c = fpcM_ERROR_PROCESS_ID_e;
execute();
if (checkArea()) {
if (getArg0() == 1) {
mMode = 3;
} else {
mMode = 2;
}
fopAcM_onSwitch(this, getSwbit());
} else {
mMode = 0;
}
return 1;
}
/* 80D4E42C-80D4E494 0004CC 0068+00 1/1 0/0 0/0 .text create__10daSwBall_cFv */
void daSwBall_c::create() {
// NONMATCHING
int daSwBall_c::create() {
fopAcM_SetupActor(this, daSwBall_c);
if (!Create()) {
return cPhs_ERROR_e;
}
return cPhs_COMPLEATE_e;
}
/* ############################################################################################## */
/* 80D4E9AC-80D4E9B8 000000 000C+00 1/1 0/0 0/0 .data cNullVec__6Z2Calc */
SECTION_DATA static u8 cNullVec__6Z2Calc[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
/* 80D4E9B8-80D4E9CC 00000C 0004+10 0/0 0/0 0/0 .data @1787 */
#pragma push
#pragma force_active on
SECTION_DATA static u32 lit_1787[1 + 4 /* padding */] = {
0x02000201,
/* padding */
0x40080000,
0x00000000,
0x3FE00000,
0x00000000,
};
#pragma pop
/* 80D4E9CC-80D4E9D8 -00001 000C+00 0/1 0/0 0/0 .data @3847 */
#pragma push
#pragma force_active on
SECTION_DATA static void* lit_3847[3] = {
(void*)NULL,
(void*)0xFFFFFFFF,
(void*)actionRun__10daSwBall_cFv,
};
#pragma pop
/* 80D4E9D8-80D4E9E4 -00001 000C+00 0/1 0/0 0/0 .data @3848 */
#pragma push
#pragma force_active on
SECTION_DATA static void* lit_3848[3] = {
(void*)NULL,
(void*)0xFFFFFFFF,
(void*)actionStop__10daSwBall_cFv,
};
#pragma pop
/* 80D4E9E4-80D4E9FC 000038 0018+00 0/1 0/0 0/0 .data l_func$3846 */
#pragma push
#pragma force_active on
SECTION_DATA static u8 l_func[24] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
#pragma pop
/* 80D4EA74-80D4EA78 000024 0004+00 1/1 0/0 0/0 .bss None */
static u8 data_80D4EA74[4];
UNK_REL_DATA
/* 80D4E494-80D4E524 000534 0090+00 2/2 0/0 0/0 .text execute__10daSwBall_cFv */
void daSwBall_c::execute() {
// NONMATCHING
int daSwBall_c::execute() {
static void (daSwBall_c::*l_func[])() = {
&daSwBall_c::actionRun,
&daSwBall_c::actionStop,
};
(this->*l_func[mAction])();
return 1;
}
/* 80D4E524-80D4E6C4 0005C4 01A0+00 1/0 0/0 0/0 .text actionRun__10daSwBall_cFv */
void daSwBall_c::actionRun() {
// NONMATCHING
search_ball();
BOOL in_area = checkArea();
switch (mMode) {
case 0:
if (in_area) {
mTimer = getArg1();
if (mTimer == 0xFF) {
mTimer = 15;
}
if (getArg0() == 1) {
if (mTimer == 0) {
fopAcM_onSwitch(this, getSwbit());
mMode = 3;
}
} else if (mTimer == 0) {
fopAcM_onSwitch(this, getSwbit());
mMode = 2;
}
mMode = 1;
}
fopAcM_offSwitch(this, getSwbit());
break;
case 1:
if (!in_area) {
mMode = 0;
} else if (cLib_calcTimer<u8>(&mTimer) == 0) {
mMode = 2;
}
break;
case 2:
fopAcM_onSwitch(this, getSwbit());
if (getArg0() == 1) {
mMode = 3;
} else if (!in_area) {
mMode = 0;
}
break;
case 3:
break;
}
PutCrrPos();
}
/* 80D4E6C4-80D4E6C8 000764 0004+00 1/0 0/0 0/0 .text actionStop__10daSwBall_cFv */
void daSwBall_c::actionStop() {
/* empty function */
}
/* ############################################################################################## */
/* 80D4E9A8-80D4E9AC 000010 0004+00 0/1 0/0 0/0 .rodata @3994 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3994 = 300.0f;
COMPILER_STRIP_GATE(0x80D4E9A8, &lit_3994);
#pragma pop
void daSwBall_c::actionStop() {}
/* 80D4E6C8-80D4E90C 000768 0244+00 1/1 0/0 0/0 .text PutCrrPos__10daSwBall_cFv */
void daSwBall_c::PutCrrPos() {
// NONMATCHING
if (checkPullLBall()) {
daPy_py_c* player = daPy_getPlayerActorClass();
s16 spA = cLib_targetAngleY(&player->current.pos, &current.pos) - player->shape_angle.y;
if (fopAcM_searchPlayerDistanceXZ(this) < 300.0f + KREG_F(0) && spA < 0x4000) {
fopAc_ac_c* grab_actor = fopAcM_SearchByID(player->getGrabActorID());
if (grab_actor != NULL && fopAcM_IsActor(grab_actor) && fopAcM_GetName(grab_actor) == PROC_Obj_Carry) {
daObjCarry_c* carry_obj = (daObjCarry_c*)grab_actor;
if (carry_obj->getType() == daObjCarry_c::TYPE_LV8_BALL) {
player->setForcePutPos(current.pos);
}
}
}
daObjCarry_c* carry_obj;
for (int i = 0; i < 8; i++) {
if (mBallIDs[i] != fpcM_ERROR_PROCESS_ID_e) {
carry_obj = (daObjCarry_c*)fopAcM_SearchByID(mBallIDs[i]);
} else {
carry_obj = NULL;
}
bool sp8 = false;
if (carry_obj != NULL) {
if (field_0x59c == mBallIDs[i] || field_0x59c == fpcM_ERROR_PROCESS_ID_e) {
switch (field_0x593[i]) {
case 0:
if (!fopAcM_checkCarryNow(carry_obj) && checkArea_sub(carry_obj)) {
if (current.pos.x != carry_obj->current.pos.x || current.pos.z != carry_obj->current.pos.z) {
carry_obj->startCtrl();
field_0x593[i] = 1;
}
field_0x59c = mBallIDs[i];
} else {
field_0x59c = fpcM_ERROR_PROCESS_ID_e;
}
break;
case 1:
cLib_chaseF(&carry_obj->current.pos.x, current.pos.x, 10.0f);
cLib_chaseF(&carry_obj->current.pos.z, current.pos.z, 10.0f);
if (0.0f == fopAcM_searchActorDistanceXZ(this, carry_obj)) {
carry_obj->endCtrl();
field_0x593[i] = 0;
}
field_0x59c = mBallIDs[i];
break;
}
}
mIsBallCarry[i] = fopAcM_checkCarryNow(carry_obj) != 0;
}
}
}
}
/* 80D4E90C-80D4E914 0009AC 0008+00 1/1 0/0 0/0 .text _delete__10daSwBall_cFv */
bool daSwBall_c::_delete() {
return true;
int daSwBall_c::_delete() {
return 1;
}
/* 80D4E914-80D4E934 0009B4 0020+00 1/0 0/0 0/0 .text daSwBall_Execute__FP10daSwBall_c */
static void daSwBall_Execute(daSwBall_c* param_0) {
// NONMATCHING
static int daSwBall_Execute(daSwBall_c* i_this) {
return i_this->execute();
}
/* 80D4E934-80D4E954 0009D4 0020+00 1/0 0/0 0/0 .text daSwBall_Delete__FP10daSwBall_c */
static void daSwBall_Delete(daSwBall_c* param_0) {
// NONMATCHING
static int daSwBall_Delete(daSwBall_c* i_this) {
return i_this->_delete();
}
/* 80D4E954-80D4E974 0009F4 0020+00 1/0 0/0 0/0 .text daSwBall_Create__FP10fopAc_ac_c */
static void daSwBall_Create(fopAc_ac_c* param_0) {
// NONMATCHING
static int daSwBall_Create(fopAc_ac_c* i_this) {
return ((daSwBall_c*)i_this)->create();
}
/* 80D4E974-80D4E990 000A14 001C+00 1/1 0/0 0/0 .text cLib_calcTimer<Uc>__FPUc */
extern "C" void func_80D4E974(void* _this, u8* param_0) {
// NONMATCHING
}
/* ############################################################################################## */
/* 80D4E9FC-80D4EA1C -00001 0020+00 1/0 0/0 0/0 .data l_daSwBall_Method */
static actor_method_class l_daSwBall_Method = {
(process_method_func)daSwBall_Create__FP10fopAc_ac_c,
(process_method_func)daSwBall_Delete__FP10daSwBall_c,
(process_method_func)daSwBall_Execute__FP10daSwBall_c,
(process_method_func)daSwBall_Create,
(process_method_func)daSwBall_Delete,
(process_method_func)daSwBall_Execute,
};
/* 80D4EA1C-80D4EA4C -00001 0030+00 0/0 0/0 1/0 .data g_profile_SwBall */
+450 -349
View File
@@ -4,164 +4,86 @@
*/
#include "d/actor/d_a_swhit0.h"
#include "d/d_cc_d.h"
#include "dol2asm.h"
#include "d/d_com_inf_game.h"
#define COLOR_YELLOW 0
#define COLOR_BLUE 1
#define COLOR_RED 2
#define COLOR_GREEN 3
//
// Forward References:
//
extern "C" void getSwNo__10daSwhit0_cFv();
extern "C" void getSwNo2__10daSwhit0_cFv();
extern "C" void getEvNo__10daSwhit0_cFv();
extern "C" void getTimer__10daSwhit0_cFv();
extern "C" void getType__10daSwhit0_cFv();
extern "C" void makeEventId__10daSwhit0_cFv();
extern "C" void CreateHeap__10daSwhit0_cFv();
extern "C" void CreateInit__10daSwhit0_cFv();
extern "C" static void CheckCreateHeap__FP10fopAc_ac_c();
extern "C" void create__10daSwhit0_cFv();
extern "C" void __dt__8cM3dGSphFv();
extern "C" void __dt__8cM3dGAabFv();
extern "C" void __dt__12J3DFrameCtrlFv();
extern "C" void checkHit__10daSwhit0_cFv();
extern "C" void setCombackTimer__10daSwhit0_cFv();
extern "C" void endCombackTimer__10daSwhit0_cFv();
extern "C" void onSwitch__10daSwhit0_cFv();
extern "C" void offSwitch__10daSwhit0_cFv();
extern "C" void DemoProc__10daSwhit0_cFv();
extern "C" void orderEvent__10daSwhit0_cFv();
extern "C" void actionOffWait__10daSwhit0_cFv();
extern "C" void actionToOnReady__10daSwhit0_cFv();
extern "C" void actionToOnOrder__10daSwhit0_cFv();
extern "C" void actionToOnDemo__10daSwhit0_cFv();
extern "C" void actionToOnDemo2__10daSwhit0_cFv();
extern "C" void actionSwWait__10daSwhit0_cFv();
extern "C" void actionOnWait__10daSwhit0_cFv();
extern "C" void setDrawMtx__10daSwhit0_cFv();
extern "C" static void daSwhit0_Draw__FP10daSwhit0_c();
extern "C" static void daSwhit0_Execute__FP10daSwhit0_c();
extern "C" static void daSwhit0_Delete__FP10daSwhit0_c();
extern "C" static void daSwhit0_Create__FP10fopAc_ac_c();
extern "C" void func_8048734C(void* _this, u8*);
extern "C" extern char const* const d_a_swhit0__stringBase0;
//
// External References:
//
extern "C" void mDoMtx_XYZrotM__FPA4_fsss();
extern "C" void play__14mDoExt_baseAnmFv();
extern "C" void init__13mDoExt_brkAnmFP16J3DMaterialTableP15J3DAnmTevRegKeyiifss();
extern "C" void entry__13mDoExt_brkAnmFP16J3DMaterialTablef();
extern "C" void init__13mDoExt_bckAnmFP15J3DAnmTransformiifssb();
extern "C" void entry__13mDoExt_bckAnmFP12J3DModelDataf();
extern "C" void mDoExt_modelUpdateDL__FP8J3DModel();
extern "C" void mDoExt_J3DModel__create__FP12J3DModelDataUlUl();
extern "C" void __ct__10fopAc_ac_cFv();
extern "C" void fopAcM_entrySolidHeap__FP10fopAc_ac_cPFP10fopAc_ac_c_iUl();
extern "C" void fopAcM_orderOtherEventId__FP10fopAc_ac_csUcUsUsUs();
extern "C" void fopAcM_orderMapToolAutoNextEvent__FP10fopAc_ac_cUcsUsUsUs();
extern "C" void dComIfG_resLoad__FP30request_of_phase_process_classPCc();
extern "C" void dComIfG_resDelete__FP30request_of_phase_process_classPCc();
extern "C" void dComIfGp_getReverb__Fi();
extern "C" void onSwitch__10dSv_info_cFii();
extern "C" void offSwitch__10dSv_info_cFii();
extern "C" void isSwitch__10dSv_info_cCFii();
extern "C" void getRes__14dRes_control_cFPCclP11dRes_info_ci();
extern "C" void reset__14dEvt_control_cFv();
extern "C" void getEventIdx__16dEvent_manager_cFPCcUcl();
extern "C" void getEventIdx__16dEvent_manager_cFP10fopAc_ac_cUc();
extern "C" void isMapToolCamera__16dEvent_manager_cFUcl();
extern "C" void endCheck__16dEvent_manager_cFs();
extern "C" void getMyStaffId__16dEvent_manager_cFPCcP10fopAc_ac_ci();
extern "C" void getIsAddvance__16dEvent_manager_cFi();
extern "C" void getMyActIdx__16dEvent_manager_cFiPCPCciii();
extern "C" void cutEnd__16dEvent_manager_cFi();
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 Set__8dCcD_SphFRC11dCcD_SrcSph();
extern "C" void settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c();
extern "C" void setLightTevColorType__18dScnKy_env_light_cFP12J3DModelDataP12dKy_tevstr_c();
extern "C" void Set__4cCcSFP8cCcD_Obj();
extern "C" void SetC__8cM3dGSphFRC4cXyz();
extern "C" void seStart__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc();
extern "C" void __dl__FPv();
extern "C" void init__12J3DFrameCtrlFs();
extern "C" void _savegpr_29();
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" extern u8 g_dComIfG_gameInfo[122384];
extern "C" u8 sincosTable___5JMath[65536];
extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */];
//
// Declarations:
//
/* 804873BC-804873C0 -00001 0004+00 3/3 0/0 0/0 .data l_arcName */
static char* l_arcName = "S_swHit00";
/* 80485FF8-80486004 000078 000C+00 9/9 0/0 0/0 .text getSwNo__10daSwhit0_cFv */
void daSwhit0_c::getSwNo() {
// NONMATCHING
int daSwhit0_c::getSwNo() {
return fopAcM_GetParam(this) & 0xFF;
}
/* 80486004-80486010 000084 000C+00 1/1 0/0 0/0 .text getSwNo2__10daSwhit0_cFv */
void daSwhit0_c::getSwNo2() {
// NONMATCHING
int daSwhit0_c::getSwNo2() {
return home.angle.z & 0xFF;
}
/* 80486010-8048602C 000090 001C+00 3/3 0/0 0/0 .text getEvNo__10daSwhit0_cFv */
void daSwhit0_c::getEvNo() {
// NONMATCHING
u8 daSwhit0_c::getEvNo() {
u8 evNo = (fopAcM_GetParam(this) >> 8) & 0xFF;
if (evNo == 0xFE) {
evNo = 0xFF;
}
return evNo;
}
/* 8048602C-80486048 0000AC 001C+00 1/1 0/0 0/0 .text getTimer__10daSwhit0_cFv */
void daSwhit0_c::getTimer() {
// NONMATCHING
u8 daSwhit0_c::getTimer() {
u8 timer = (fopAcM_GetParam(this) >> 16) & 0xFF;
if (timer == 0xFF) {
timer = 0;
}
return timer;
}
/* 80486048-80486064 0000C8 001C+00 4/4 0/0 0/0 .text getType__10daSwhit0_cFv */
void daSwhit0_c::getType() {
// NONMATCHING
}
u8 daSwhit0_c::getType() {
u8 type = (fopAcM_GetParam(this) >> 30);
if (type >= 4) {
type = 0;
}
/* ############################################################################################## */
/* 80487388-80487388 000018 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
#pragma push
#pragma force_active on
SECTION_DEAD static char const* const stringBase_80487388 = "S_swHit00";
SECTION_DEAD static char const* const stringBase_80487392 = "DEFAULT_SWITCH";
#pragma pop
return type;
}
/* 80486064-804860EC 0000E4 0088+00 1/1 0/0 0/0 .text makeEventId__10daSwhit0_cFv */
void daSwhit0_c::makeEventId() {
// NONMATCHING
u8 prm = (fopAcM_GetParam(this) >> 8) & 0xFF;
if (prm == 0xFE) {
mEventId = dComIfGp_evmng_getEventIdx("DEFAULT_SWITCH", getEvNo());
} else {
mEventId = dComIfGp_getEventManager().getEventIdx(this, getEvNo());
}
}
/* ############################################################################################## */
/* 80487370-80487374 000000 0004+00 6/6 0/0 0/0 .rodata @3685 */
SECTION_RODATA static f32 const lit_3685 = 1.0f;
COMPILER_STRIP_GATE(0x80487370, &lit_3685);
/* 804873BC-804873C0 -00001 0004+00 3/3 0/0 0/0 .data l_arcName */
SECTION_DATA static void* l_arcName = (void*)&d_a_swhit0__stringBase0;
/* 804860EC-80486214 00016C 0128+00 1/1 0/0 0/0 .text CreateHeap__10daSwhit0_cFv */
void daSwhit0_c::CreateHeap() {
// NONMATCHING
}
int daSwhit0_c::CreateHeap() {
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 8);
JUT_ASSERT(193, modelData != 0);
/* ############################################################################################## */
/* 80487374-80487378 000004 0004+00 1/1 0/0 0/0 .rodata @3725 */
SECTION_RODATA static f32 const lit_3725 = 95.0f;
COMPILER_STRIP_GATE(0x80487374, &lit_3725);
mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000202);
if (mpModel == NULL) {
return 0;
}
if (!mBck.init((J3DAnmTransform*)dComIfG_getObjectRes(l_arcName, 5), TRUE, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, -1, false)) {
return 0;
}
if (!mBrk.init(modelData, (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_arcName, 11), FALSE, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, -1)) {
return 0;
}
return 1;
}
/* 804873C0-80487400 000004 0040+00 1/1 0/0 0/0 .data l_sph_src */
static dCcD_SrcSph l_sph_src = {
@@ -177,56 +99,411 @@ static dCcD_SrcSph l_sph_src = {
};
/* 80486214-80486390 000294 017C+00 1/1 0/0 0/0 .text CreateInit__10daSwhit0_cFv */
void daSwhit0_c::CreateInit() {
// NONMATCHING
int daSwhit0_c::CreateInit() {
shape_angle.z = 0;
current.angle.z = 0;
mColliderStts.Init(0xFF, 0xFF, this);
attention_info.position.x += (cM_ssin(home.angle.x) * 95.0f) * cM_ssin(home.angle.y);
attention_info.position.y += cM_scos(home.angle.x) * 95.0f;
attention_info.position.z += (cM_ssin(home.angle.x) * 95.0f) * cM_scos(home.angle.y);
eyePos = attention_info.position;
cXyz sp28;
mSph.Set(l_sph_src);
mSph.SetStts(&mColliderStts);
mSph.SetC(attention_info.position);
if (fopAcM_isSwitch(this, getSwNo())) {
setActio(ACTION_ON_WAIT_e);
onFlag(1);
} else {
setActio(ACTION_OFF_WAIT_e);
offFlag(1);
}
makeEventId();
return 1;
}
/* 80486390-804863B0 000410 0020+00 1/1 0/0 0/0 .text CheckCreateHeap__FP10fopAc_ac_c */
static void CheckCreateHeap(fopAc_ac_c* param_0) {
// NONMATCHING
static int CheckCreateHeap(fopAc_ac_c* i_this) {
return ((daSwhit0_c*)i_this)->CreateHeap();
}
/* ############################################################################################## */
/* 80487388-80487388 000018 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
#pragma push
#pragma force_active on
SECTION_DEAD static char const* const stringBase_804873A1 = "WAIT";
SECTION_DEAD static char const* const stringBase_804873A6 = "CHANGE";
#pragma pop
/* 804863B0-804865B4 000430 0204+00 1/1 0/0 0/0 .text create__10daSwhit0_cFv */
int daSwhit0_c::create() {
fopAcM_SetupActor(this, daSwhit0_c);
/* 80487400-80487408 -00001 0008+00 1/1 0/0 0/0 .data action_table$3953 */
SECTION_DATA static void* action_table[2] = {
(void*)(((char*)&d_a_swhit0__stringBase0) + 0x19),
(void*)(((char*)&d_a_swhit0__stringBase0) + 0x1E),
};
if (subtype != 0) {
setDrawMtx();
cMtx_copy(mDoMtx_stack_c::get(), field_0x5a8);
fopAcM_SetMtx(this, field_0x5a8);
CreateInit();
return cPhs_COMPLEATE_e;
}
/* 80487408-80487410 00004C 0008+00 1/1 0/0 0/0 .data l_color$localstatic3$draw__10daSwhit0_cFv */
SECTION_DATA static u8 data_80487408[8] = {
0x01, 0x00, 0x02, 0x03, 0x03, 0x02, 0x00, 0x01,
};
int phase_state = dComIfG_resLoad(this, l_arcName);
if (phase_state == cPhs_COMPLEATE_e) {
if (!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0xB30)) {
return cPhs_ERROR_e;
}
/* 80487410-8048743C -00001 002C+00 1/1 0/0 0/0 .data @4230 */
SECTION_DATA static void* lit_4230[11] = {
(void*)(((char*)daSwhit0_Execute__FP10daSwhit0_c) + 0x40),
(void*)(((char*)daSwhit0_Execute__FP10daSwhit0_c) + 0x4C),
(void*)(((char*)daSwhit0_Execute__FP10daSwhit0_c) + 0x58),
(void*)(((char*)daSwhit0_Execute__FP10daSwhit0_c) + 0x64),
(void*)(((char*)daSwhit0_Execute__FP10daSwhit0_c) + 0x70),
(void*)(((char*)daSwhit0_Execute__FP10daSwhit0_c) + 0x7C),
(void*)(((char*)daSwhit0_Execute__FP10daSwhit0_c) + 0x88),
(void*)(((char*)daSwhit0_Execute__FP10daSwhit0_c) + 0x58),
(void*)(((char*)daSwhit0_Execute__FP10daSwhit0_c) + 0x64),
(void*)(((char*)daSwhit0_Execute__FP10daSwhit0_c) + 0x70),
(void*)(((char*)daSwhit0_Execute__FP10daSwhit0_c) + 0x7C),
};
mpModel->setBaseScale(scale);
setDrawMtx();
mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
fopAcM_SetMtx(this, mpModel->getBaseTRMtx());
CreateInit();
}
return phase_state;
}
/* 8048668C-80486704 00070C 0078+00 2/2 0/0 0/0 .text checkHit__10daSwhit0_cFv */
bool daSwhit0_c::checkHit() {
if (dComIfGp_event_runCheck()) {
return false;
}
if (cLib_calcTimer<u8>(&mHitWaitTimer) == 0 && mSph.ChkTgHit()) {
mHitWaitTimer = 8;
return true;
}
return false;
}
/* 80486704-80486788 000784 0084+00 1/1 0/0 0/0 .text setCombackTimer__10daSwhit0_cFv */
void daSwhit0_c::setCombackTimer() {
if (getType() == 0 || getType() == 3) {
mCombackTimer = 0;
} else if (getTimer() != 0) {
mCombackTimer = getTimer() * 15;
} else {
mCombackTimer = 0;
}
}
/* 80486788-80486800 000808 0078+00 1/1 0/0 0/0 .text endCombackTimer__10daSwhit0_cFv */
int daSwhit0_c::endCombackTimer() {
if (mCombackTimer > 0) {
if (!fopAcM_isSwitch(this, getSwNo2()) && --mCombackTimer == 0) {
return 1;
}
}
return 0;
}
/* 80486800-80486858 000880 0058+00 4/4 0/0 0/0 .text onSwitch__10daSwhit0_cFv */
void daSwhit0_c::onSwitch() {
fopAcM_onSwitch(this, getSwNo());
onFlag(1);
setCombackTimer();
}
/* 80486858-804868A8 0008D8 0050+00 4/4 0/0 0/0 .text offSwitch__10daSwhit0_cFv */
void daSwhit0_c::offSwitch() {
fopAcM_offSwitch(this, getSwNo());
offFlag(1);
}
/* 804868A8-804869C4 000928 011C+00 2/2 0/0 0/0 .text DemoProc__10daSwhit0_cFv */
int daSwhit0_c::DemoProc() {
static char* action_table[2] = {
"WAIT",
"CHANGE",
};
if (dComIfGp_evmng_getIsAddvance(mStaffId)) {
int act_idx = dComIfGp_evmng_getMyActIdx(mStaffId, action_table, 2, 0, 0);
switch (act_idx) {
case 1:
if (fopAcM_isSwitch(this, getSwNo())) {
offSwitch();
} else {
onSwitch();
}
fopAcM_seStart(this, Z2SE_OBJ_SHOCK_SW_ON, 0);
break;
}
}
dComIfGp_evmng_cutEnd(mStaffId);
return 1;
}
/* 804869C4-80486ABC 000A44 00F8+00 2/2 0/0 0/0 .text orderEvent__10daSwhit0_cFv */
void daSwhit0_c::orderEvent() {
if (strcmp(dComIfGp_getStartStageName(), "D_MN06") == 0 && dComIfGp_getStartStageRoomNo() == 4 && fopAcM_isSwitch(this, 50) && fopAcM_isSwitch(this, 51)) {
fopAcM_orderOtherEventId(this, mEventId, getEvNo(), 0xFFFF, 0, 1);
} else {
fopAcM_orderMapToolAutoNextEvent(this, getEvNo(), mEventId, 0xFFFF, 1, 0);
}
eventInfo.i_onCondition(2);
}
/* 80486ABC-80486BC4 000B3C 0108+00 1/1 0/0 0/0 .text actionOffWait__10daSwhit0_cFv */
int daSwhit0_c::actionOffWait() {
if (checkHit()) {
fopAcM_seStart(this, JA_SE_OBJ_HIT_SHOCK_SWITCH, 0);
if (getType() != 3) {
if (mEventId == -1) {
setActio(ACTION_SW_WAIT_e);
mSwWaitTimer = 0;
} else {
setActio(ACTION_TO_ON_READY_e);
mReadyTimer = 5;
}
}
} else {
if (fopAcM_isSwitch(this, getSwNo())) {
setActio(ACTION_ON_WAIT_e);
onSwitch();
}
}
return 1;
}
/* 80486BC4-80486C28 000C44 0064+00 1/1 0/0 0/0 .text actionToOnReady__10daSwhit0_cFv */
int daSwhit0_c::actionToOnReady() {
if (dComIfGp_event_runCheck()) {
return 1;
}
if (mReadyTimer != 0) {
mReadyTimer--;
} else {
mAction++;
setActio(mAction);
orderEvent();
}
return 1;
}
/* 80486C28-80486CE4 000CA8 00BC+00 1/1 0/0 0/0 .text actionToOnOrder__10daSwhit0_cFv */
int daSwhit0_c::actionToOnOrder() {
if (eventInfo.i_checkCommandDemoAccrpt()) {
if (dComIfGp_evmng_isMapToolCamera(getEvNo())) {
mReadyTimer = 6;
mAction += 2;
setActio(mAction);
} else {
mAction++;
setActio(mAction);
mStaffId = dComIfGp_evmng_getMyStaffId("SWITCH", NULL, 0);
DemoProc();
}
} else {
orderEvent();
}
return 1;
}
/* 80486CE4-80486D88 000D64 00A4+00 1/1 0/0 0/0 .text actionToOnDemo__10daSwhit0_cFv */
int daSwhit0_c::actionToOnDemo() {
if (dComIfGp_evmng_endCheck(mEventId)) {
if (fopAcM_isSwitch(this, getSwNo())) {
setActio(ACTION_ON_WAIT_e);
} else {
setActio(ACTION_OFF_WAIT_e);
}
dComIfGp_event_reset();
return 1;
}
DemoProc();
return 1;
}
/* 80486D88-80486EC4 000E08 013C+00 1/1 0/0 0/0 .text actionToOnDemo2__10daSwhit0_cFv */
int daSwhit0_c::actionToOnDemo2() {
if (mReadyTimer != 0) {
mReadyTimer--;
if (mReadyTimer == 0) {
if (fopAcM_isSwitch(this, getSwNo())) {
offSwitch();
} else {
onSwitch();
}
fopAcM_seStart(this, Z2SE_OBJ_SHOCK_SW_ON, 0);
}
}
if (dComIfGp_evmng_endCheck(mEventId)) {
if (mAction == 5) {
setActio(ACTION_ON_WAIT_e);
onSwitch();
} else {
setActio(ACTION_OFF_WAIT_e);
offSwitch();
}
dComIfGp_event_reset();
return 1;
}
return 1;
}
/* 80486EC4-80486FC0 000F44 00FC+00 1/1 0/0 0/0 .text actionSwWait__10daSwhit0_cFv */
int daSwhit0_c::actionSwWait() {
if (dComIfGp_event_runCheck()) {
return 0;
}
if (++mSwWaitTimer > 30) {
if (!fopAcM_isSwitch(this, getSwNo())) {
setActio(ACTION_ON_WAIT_e);
onSwitch();
} else {
setActio(ACTION_OFF_WAIT_e);
offSwitch();
}
fopAcM_seStart(this, Z2SE_OBJ_SHOCK_SW_ON, 0);
}
return 1;
}
/* 80486FC0-804870E0 001040 0120+00 1/1 0/0 0/0 .text actionOnWait__10daSwhit0_cFv */
int daSwhit0_c::actionOnWait() {
if (!fopAcM_isSwitch(this, getSwNo()) || endCombackTimer()) {
offSwitch();
setActio(ACTION_OFF_WAIT_e);
return 1;
}
if (checkHit()) {
fopAcM_seStart(this, JA_SE_OBJ_HIT_SHOCK_SWITCH, 0);
if (getType() != 0) {
if (mEventId == -1) {
setActio(ACTION_SW_WAIT_e);
mSwWaitTimer = 0;
} else {
setActio(ACTION_TOOL_TO_ON_READY_e);
mReadyTimer = 5;
}
return 1;
}
}
return 1;
}
/* 804870E0-80487138 001160 0058+00 1/1 0/0 0/0 .text setDrawMtx__10daSwhit0_cFv */
void daSwhit0_c::setDrawMtx() {
mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z);
mDoMtx_stack_c::XYZrotM(current.angle.x, current.angle.y, current.angle.z);
}
int daSwhit0_c::draw() {
g_env_light.settingTevStruct(16, &current.pos, &tevStr);
g_env_light.setLightTevColorType(mpModel, &tevStr);
// each set of 2 colors represents an on/off state color
static u8 l_color[] = {
COLOR_BLUE, COLOR_YELLOW,
COLOR_RED, COLOR_GREEN,
COLOR_GREEN, COLOR_RED,
COLOR_YELLOW, COLOR_BLUE,
};
u8* color_p = l_color;
if (checkFlag(1)) {
color_p++;
}
mBrk.setFrame(color_p[getType() * 2]);
J3DModelData* modelData = mpModel->getModelData();
mBck.entry(modelData);
mBrk.entry(modelData);
mDoExt_modelUpdateDL(mpModel);
return 1;
}
/* 80487138-80487228 0011B8 00F0+00 1/0 0/0 0/0 .text daSwhit0_Draw__FP10daSwhit0_c */
static int daSwhit0_Draw(daSwhit0_c* i_this) {
if (i_this->subtype != 0) {
return 1;
}
return i_this->draw();
}
int daSwhit0_c::execute() {
switch (mAction) {
case ACTION_SW_WAIT_e:
actionSwWait();
break;
case ACTION_OFF_WAIT_e:
actionOffWait();
break;
case ACTION_TO_ON_READY_e:
case ACTION_TOOL_TO_ON_READY_e:
actionToOnReady();
break;
case ACTION_TO_ON_ORDER_e:
case ACTION_TOOL_TO_ON_ORDER_e:
actionToOnOrder();
break;
case ACTION_TO_ON_DEMO_e:
case ACTION_TOOL_TO_ON_DEMO_e:
actionToOnDemo();
break;
case ACTION_TO_ON_DEMO2_e:
case ACTION_TOOL_TO_ON_DEMO2_e:
actionToOnDemo2();
break;
case ACTION_ON_WAIT_e:
actionOnWait();
break;
}
return 1;
}
/* 80487228-804872E4 0012A8 00BC+00 2/0 0/0 0/0 .text daSwhit0_Execute__FP10daSwhit0_c */
static int daSwhit0_Execute(daSwhit0_c* i_this) {
i_this->mBck.play();
i_this->execute();
dComIfG_Ccsp()->Set(&i_this->mSph);
return 1;
}
/* 804872E4-8048732C 001364 0048+00 1/0 0/0 0/0 .text daSwhit0_Delete__FP10daSwhit0_c */
static int daSwhit0_Delete(daSwhit0_c* i_this) {
if (i_this->subtype == 0) {
dComIfG_resDelete(i_this, l_arcName);
}
return 1;
}
/* 8048732C-8048734C 0013AC 0020+00 1/0 0/0 0/0 .text daSwhit0_Create__FP10fopAc_ac_c */
static int daSwhit0_Create(fopAc_ac_c* i_this) {
return ((daSwhit0_c*)i_this)->create();
}
/* 8048743C-8048745C -00001 0020+00 1/0 0/0 0/0 .data l_daSwhit0_Method */
static actor_method_class l_daSwhit0_Method = {
(process_method_func)daSwhit0_Create__FP10fopAc_ac_c,
(process_method_func)daSwhit0_Delete__FP10daSwhit0_c,
(process_method_func)daSwhit0_Execute__FP10daSwhit0_c,
0,
(process_method_func)daSwhit0_Draw__FP10daSwhit0_c,
(process_method_func)daSwhit0_Create,
(process_method_func)daSwhit0_Delete,
(process_method_func)daSwhit0_Execute,
(process_method_func)NULL,
(process_method_func)daSwhit0_Draw,
};
/* 8048745C-8048748C -00001 0030+00 0/0 0/0 1/0 .data g_profile_SWHIT0 */
@@ -246,179 +523,3 @@ extern actor_process_profile_definition g_profile_SWHIT0 = {
fopAc_ACTOR_e, // mActorType
fopAc_CULLBOX_0_e, // cullType
};
/* 8048748C-80487498 0000D0 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,
};
/* 80487498-804874A4 0000DC 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,
};
/* 804874A4-804874B0 0000E8 000C+00 2/2 0/0 0/0 .data __vt__12J3DFrameCtrl */
SECTION_DATA extern void* __vt__12J3DFrameCtrl[3] = {
(void*)NULL /* RTTI */,
(void*)NULL,
(void*)__dt__12J3DFrameCtrlFv,
};
/* 804863B0-804865B4 000430 0204+00 1/1 0/0 0/0 .text create__10daSwhit0_cFv */
void daSwhit0_c::create() {
// NONMATCHING
}
/* 804865B4-804865FC 000634 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGSphFv */
// cM3dGSph::~cM3dGSph() {
extern "C" void __dt__8cM3dGSphFv() {
// NONMATCHING
}
/* 804865FC-80486644 00067C 0048+00 1/0 0/0 0/0 .text __dt__8cM3dGAabFv */
// cM3dGAab::~cM3dGAab() {
extern "C" void __dt__8cM3dGAabFv() {
// NONMATCHING
}
/* 80486644-8048668C 0006C4 0048+00 1/0 0/0 0/0 .text __dt__12J3DFrameCtrlFv */
// J3DFrameCtrl::~J3DFrameCtrl() {
extern "C" void __dt__12J3DFrameCtrlFv() {
// NONMATCHING
}
/* 8048668C-80486704 00070C 0078+00 2/2 0/0 0/0 .text checkHit__10daSwhit0_cFv */
void daSwhit0_c::checkHit() {
// NONMATCHING
}
/* 80486704-80486788 000784 0084+00 1/1 0/0 0/0 .text setCombackTimer__10daSwhit0_cFv */
void daSwhit0_c::setCombackTimer() {
// NONMATCHING
}
/* 80486788-80486800 000808 0078+00 1/1 0/0 0/0 .text endCombackTimer__10daSwhit0_cFv */
void daSwhit0_c::endCombackTimer() {
// NONMATCHING
}
/* 80486800-80486858 000880 0058+00 4/4 0/0 0/0 .text onSwitch__10daSwhit0_cFv */
void daSwhit0_c::onSwitch() {
// NONMATCHING
}
/* 80486858-804868A8 0008D8 0050+00 4/4 0/0 0/0 .text offSwitch__10daSwhit0_cFv */
void daSwhit0_c::offSwitch() {
// NONMATCHING
}
/* ############################################################################################## */
/* 80487378-80487380 000008 0004+04 5/5 0/0 0/0 .rodata @3982 */
SECTION_RODATA static f32 const lit_3982[1 + 1 /* padding */] = {
-1.0f,
/* padding */
0.0f,
};
COMPILER_STRIP_GATE(0x80487378, &lit_3982);
/* 804868A8-804869C4 000928 011C+00 2/2 0/0 0/0 .text DemoProc__10daSwhit0_cFv */
void daSwhit0_c::DemoProc() {
// NONMATCHING
}
/* ############################################################################################## */
/* 80487388-80487388 000018 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
#pragma push
#pragma force_active on
SECTION_DEAD static char const* const stringBase_804873AD = "D_MN06";
#pragma pop
/* 804869C4-80486ABC 000A44 00F8+00 2/2 0/0 0/0 .text orderEvent__10daSwhit0_cFv */
void daSwhit0_c::orderEvent() {
// NONMATCHING
}
/* 80486ABC-80486BC4 000B3C 0108+00 1/1 0/0 0/0 .text actionOffWait__10daSwhit0_cFv */
void daSwhit0_c::actionOffWait() {
// NONMATCHING
}
/* 80486BC4-80486C28 000C44 0064+00 1/1 0/0 0/0 .text actionToOnReady__10daSwhit0_cFv */
void daSwhit0_c::actionToOnReady() {
// NONMATCHING
}
/* ############################################################################################## */
/* 80487388-80487388 000018 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
#pragma push
#pragma force_active on
SECTION_DEAD static char const* const stringBase_804873B4 = "SWITCH";
#pragma pop
/* 80486C28-80486CE4 000CA8 00BC+00 1/1 0/0 0/0 .text actionToOnOrder__10daSwhit0_cFv */
void daSwhit0_c::actionToOnOrder() {
// NONMATCHING
}
/* 80486CE4-80486D88 000D64 00A4+00 1/1 0/0 0/0 .text actionToOnDemo__10daSwhit0_cFv */
void daSwhit0_c::actionToOnDemo() {
// NONMATCHING
}
/* 80486D88-80486EC4 000E08 013C+00 1/1 0/0 0/0 .text actionToOnDemo2__10daSwhit0_cFv */
void daSwhit0_c::actionToOnDemo2() {
// NONMATCHING
}
/* 80486EC4-80486FC0 000F44 00FC+00 1/1 0/0 0/0 .text actionSwWait__10daSwhit0_cFv */
void daSwhit0_c::actionSwWait() {
// NONMATCHING
}
/* 80486FC0-804870E0 001040 0120+00 1/1 0/0 0/0 .text actionOnWait__10daSwhit0_cFv */
void daSwhit0_c::actionOnWait() {
// NONMATCHING
}
/* 804870E0-80487138 001160 0058+00 1/1 0/0 0/0 .text setDrawMtx__10daSwhit0_cFv */
void daSwhit0_c::setDrawMtx() {
// NONMATCHING
}
/* ############################################################################################## */
/* 80487380-80487388 000010 0008+00 1/1 0/0 0/0 .rodata @4212 */
SECTION_RODATA static u8 const lit_4212[8] = {
0x43, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
COMPILER_STRIP_GATE(0x80487380, &lit_4212);
/* 80487138-80487228 0011B8 00F0+00 1/0 0/0 0/0 .text daSwhit0_Draw__FP10daSwhit0_c */
static void daSwhit0_Draw(daSwhit0_c* param_0) {
// NONMATCHING
}
/* 80487228-804872E4 0012A8 00BC+00 2/0 0/0 0/0 .text daSwhit0_Execute__FP10daSwhit0_c */
static void daSwhit0_Execute(daSwhit0_c* param_0) {
// NONMATCHING
}
/* 804872E4-8048732C 001364 0048+00 1/0 0/0 0/0 .text daSwhit0_Delete__FP10daSwhit0_c */
static void daSwhit0_Delete(daSwhit0_c* param_0) {
// NONMATCHING
}
/* 8048732C-8048734C 0013AC 0020+00 1/0 0/0 0/0 .text daSwhit0_Create__FP10fopAc_ac_c */
static void daSwhit0_Create(fopAc_ac_c* param_0) {
// NONMATCHING
}
/* 8048734C-80487368 0013CC 001C+00 1/1 0/0 0/0 .text cLib_calcTimer<Uc>__FPUc */
extern "C" void func_8048734C(void* _this, u8* param_0) {
// NONMATCHING
}
/* 80487388-80487388 000018 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
File diff suppressed because it is too large Load Diff
+99 -136
View File
@@ -1,156 +1,112 @@
//
// Generated By: dol2asm
// Translation Unit: d_a_tag_wljump
//
#include "d/actor/d_a_tag_wljump.h"
#include "dol2asm.h"
#include "d/d_path.h"
#include "d/d_procname.h"
#include "d/actor/d_a_player.h"
#include "d/actor/d_a_midna.h"
#include "JSystem/JKernel/JKRHeap.h"
//
// Types:
//
//
// Forward References:
//
extern "C" void create__13daTagWljump_cFv();
extern "C" static void daTagWljump_Create__FP10fopAc_ac_c();
extern "C" void __dt__13daTagWljump_cFv();
extern "C" static void daTagWljump_Delete__FP13daTagWljump_c();
extern "C" void execute__13daTagWljump_cFv();
extern "C" static void daTagWljump_Execute__FP13daTagWljump_c();
extern "C" bool draw__13daTagWljump_cFv();
extern "C" static void daTagWljump_Draw__FP13daTagWljump_c();
//
// External References:
//
extern "C" void __ct__10fopAc_ac_cFv();
extern "C" void __dt__10fopAc_ac_cFv();
extern "C" void isTransformLV__21dSv_player_status_b_cCFi();
extern "C" void isEventBit__11dSv_event_cCFUs();
extern "C" void onSwitch__10dSv_info_cFii();
extern "C" void isSwitch__10dSv_info_cCFii();
extern "C" void reset__14dEvt_control_cFv();
extern "C" void dPath_GetRoomPath__Fii();
extern "C" void request__10dAttHint_cFP10fopAc_ac_ci();
extern "C" void __ct__10dMsgFlow_cFv();
extern "C" void __dt__10dMsgFlow_cFv();
extern "C" void init__10dMsgFlow_cFP10fopAc_ac_ciiPP10fopAc_ac_c();
extern "C" void doFlow__10dMsgFlow_cFP10fopAc_ac_cPP10fopAc_ac_ci();
extern "C" void seStart__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc();
extern "C" void __dl__FPv();
extern "C" void _savegpr_26();
extern "C" void _restgpr_26();
extern "C" u8 m_midnaActor__9daPy_py_c[4];
extern "C" u8 mAudioMgrPtr__10Z2AudioMgr[4 + 4 /* padding */];
//
// Declarations:
//
/* 80D64EB8-80D64FE4 000078 012C+00 1/1 0/0 0/0 .text create__13daTagWljump_cFv */
int daTagWljump_c::create() {
fopAcM_SetupActor(this, daTagWljump_c);
u32 param = (fopAcM_GetParam(this) >> 8) & 0xff;
field_0x571 = (u8)param;
s32 uVar2 = fopAcM_GetParam(this);
if ((uVar2 & 0xff) == 0xff) {
field_0x571 = (fopAcM_GetParam(this) >> 8) & 0xFF;
int path_no = fopAcM_GetParam(this) & 0xFF;
if (path_no == 0xFF) {
return 5;
}
field_0x5c4 = dPath_GetRoomPath(uVar2 & 0xff, fopAcM_GetRoomNo(this));
field_0x5c4 = dPath_GetRoomPath(path_no, fopAcM_GetRoomNo(this));
if (field_0x5c4 == NULL || field_0x5c4->m_num < 2) {
return 5;
return cPhs_ERROR_e;
}
attention_info.distances[fopAc_attn_LOCK_e] = 0x32;
attention_info.distances[fopAc_attn_ETC_e] = 0x32;
attention_info.distances[fopAc_attn_LOCK_e] = 50;
attention_info.distances[fopAc_attn_ETC_e] = 50;
shape_angle.z = 0;
field_0x568 = -1;
field_0x56c[0] = (fopAcM_GetParam(this) >> 16) & 0xf;
if (field_0x56c[0] != 1) {
field_0x56c[0] = 0;
field_0x56c = (fopAcM_GetParam(this) >> 16) & 0xF;
if (field_0x56c != 1) {
field_0x56c = 0;
}
if (field_0x56c[0] == 0 && field_0x571 != 0xff) {
if (dComIfGs_isSwitch(field_0x571, fopAcM_GetHomeRoomNo(this)) == 0) {
if (field_0x56c == 0 && field_0x571 != 0xFF) {
if (!fopAcM_isSwitch(this, field_0x571)) {
field_0x573 = 1;
}
}
return 4;
return cPhs_COMPLEATE_e;
}
/* 80D64FE4-80D65004 0001A4 0020+00 1/0 0/0 0/0 .text daTagWljump_Create__FP10fopAc_ac_c
*/
static int daTagWljump_Create(fopAc_ac_c* param_0) {
return ((daTagWljump_c*)param_0)->create();
static int daTagWljump_Create(fopAc_ac_c* i_this) {
daTagWljump_c* a_this = (daTagWljump_c*)i_this;
fpc_ProcID id = fopAcM_GetID(i_this);
return a_this->create();
}
/* 80D65004-80D65068 0001C4 0064+00 1/1 0/0 0/0 .text __dt__13daTagWljump_cFv */
daTagWljump_c::~daTagWljump_c() {
}
daTagWljump_c::~daTagWljump_c() {}
/* 80D65068-80D65090 000228 0028+00 1/0 0/0 0/0 .text daTagWljump_Delete__FP13daTagWljump_c */
static int daTagWljump_Delete(daTagWljump_c* param_0) {
param_0->~daTagWljump_c();
static int daTagWljump_Delete(daTagWljump_c* i_this) {
fpc_ProcID id = fopAcM_GetID(i_this);
i_this->~daTagWljump_c();
return 1;
}
/* ############################################################################################## */
/* 80D65090-80D6587C 000250 07EC+00 1/1 0/0 0/0 .text execute__13daTagWljump_cFv */
// NONMATCHING - reg swap
// NONMATCHING - reg swap (regs match on debug, probably an inline issue)
int daTagWljump_c::execute() {
attention_info.flags = 0;
if (field_0x56c[1]) {
field_0x56c[1]--;
if (field_0x56d) {
field_0x56d--;
}
daPy_py_c* linkPlayer = daPy_getLinkPlayerActorClass();
daMidna_c* midnaActor = daPy_py_c::getMidnaActor();
if (midnaActor == NULL) {
dStage_dPnt_c* point_p;
daPy_py_c* player = daPy_getLinkPlayerActorClass();
daMidna_c* midna = daPy_py_c::getMidnaActor();
if (midna == NULL) {
return 1;
}
if (eventInfo.checkCommandTalk()) {
s32 bVar2 = 1;
if (!midnaActor->checkShadowModeTalkWait()) {
if (shape_angle.x != 0 &&
(field_0x571 == 0xff ||
!fopAcM_isSwitch(this, field_0x571)))
{
if (field_0x56c[3] == 0) {
mMsgFlow.init(this, shape_angle.x & 0xffff, 0, NULL);
field_0x56c[3] = 1;
mDoAud_seStart(0x10, 0, 0, 0);
BOOL spC = TRUE;
if (!midna->checkShadowModeTalkWait()) {
if (shape_angle.x != 0 && (field_0x571 == 0xff || !fopAcM_isSwitch(this, field_0x571))) {
if (field_0x56f == 0) {
mMsgFlow.init(this, shape_angle.x & 0xFFFF, 0, NULL);
field_0x56f = 1;
mDoAud_seStart(Z2SE_NAVI_TALK_START, NULL, 0, 0);
} else {
;
if (mMsgFlow.doFlow(this, NULL, 0)) {
mDoAud_seStart(0x11, 0, 0, 0);
mDoAud_seStart(Z2SE_NAVI_TALK_END, NULL, 0, 0);
shape_angle.x = 0;
}
}
} else {
field_0x568 = field_0x570;
if (midnaActor->current.pos.abs(eyePos) < 5.0f) {
bVar2 = 0;
if (midna->current.pos.abs(eyePos) < 5.0f) {
spC = FALSE;
}
}
}
if (bVar2) {
if (spC) {
return 1;
}
field_0x56c[3] = 0;
field_0x56f = 0;
dComIfGp_event_reset();
field_0x56c[0] = 0;
field_0x56c = 0;
field_0x572 = 1;
if (field_0x571 != 0xff) {
fopAcM_onSwitch(this, field_0x571);
@@ -158,7 +114,7 @@ int daTagWljump_c::execute() {
} else if (!dComIfGp_getEvent().isOrderOK()) {
field_0x572 = 0;
} else {
if (!midnaActor->checkWolfNoPos()) {
if (!midna->checkWolfNoPos()) {
field_0x574++;
if (field_0x574 >= 5) {
field_0x572 = 0;
@@ -168,40 +124,40 @@ int daTagWljump_c::execute() {
}
}
if (!linkPlayer->i_checkNowWolf() ||
!daPy_py_c::i_checkFirstMidnaDemo() ||
midnaActor->i_checkMidnaTired()) {
if (!player->i_checkNowWolf() || !daPy_py_c::i_checkFirstMidnaDemo() || midna->i_checkMidnaTired()) {
return 1;
}
if (field_0x571 != 0xff && fopAcM_isSwitch(this, field_0x571)) {
field_0x56c[0] = 0;
field_0x56c = 0;
if (field_0x573) {
field_0x573 = 0;
field_0x572 = 1;
field_0x574 = 0;
}
}
if (field_0x56c[0] != 0 || field_0x572 != 0 || field_0x571 == 0xff ||
fopAcM_isSwitch(this, field_0x571))
{
s32 uVar6;
dStage_dPnt_c* pbVar7 = field_0x5c4->m_points;
if (linkPlayer->checkWolfTagLockJumpLand() == 0) {
if (linkPlayer->checkWolfTagLockJump() == 0) {
for (uVar6 = 0; uVar6 < field_0x5c4->m_num; uVar6++, pbVar7++) {
if (linkPlayer->current.pos.abs2(pbVar7->m_position) < pbVar7->field_0x0 * pbVar7->field_0x0 * 10.0f * 10.0f) {
field_0x56a = uVar6;
if (uVar6 == 0) {
if (field_0x56c != 0 || field_0x572 != 0 || field_0x571 == 0xff || fopAcM_isSwitch(this, field_0x571)) {
int var_r28;
point_p = field_0x5c4->m_points;
if (!player->checkWolfTagLockJumpLand()) {
if (!player->checkWolfTagLockJump()) {
for (var_r28 = 0; var_r28 < field_0x5c4->m_num; var_r28++, point_p++) {
if (player->current.pos.abs2(point_p->m_position) < point_p->field_0x0 * point_p->field_0x0 * 10.0f * 10.0f) {
field_0x56a = var_r28;
if (var_r28 == 0) {
field_0x568 = 1;
} else if (uVar6 == field_0x5c4->m_num - 1) {
field_0x568 = uVar6 - 1;
} else if (var_r28 == field_0x5c4->m_num - 1) {
field_0x568 = var_r28 - 1;
} else {
field_0x568 = uVar6 + 1;
field_0x568 = var_r28 + 1;
}
break;
}
}
if (uVar6 == field_0x5c4->m_num) {
if (var_r28 == field_0x5c4->m_num) {
field_0x568 = -1;
}
} else if (mNextCheckFlg) {
@@ -216,32 +172,38 @@ int daTagWljump_c::execute() {
}
}
}
if (field_0x568 >= 0) {
dStage_dPnt_c* pPoint = &field_0x5c4->m_points[field_0x568];
eyePos.set(pPoint->m_position.x, pPoint->m_position.y, pPoint->m_position.z);
point_p = &field_0x5c4->m_points[field_0x568];
eyePos.set(point_p->m_position.x, point_p->m_position.y, point_p->m_position.z);
attention_info.position = eyePos;
attention_info.position.y += 220.0f;
mLandArea = pPoint->mArg0 * 10.0f;
if (pPoint->field_0x1 == 1) {
mLandArea = point_p->mArg0 * 10.0f;
if (point_p->field_0x1 == 1) {
shape_angle.z = 1;
} else {
shape_angle.z = 0;
}
if (field_0x572 == 0) {
if (!g_dComIfG_gameInfo.play.getEvent().runCheck()) {
if (!dComIfGp_event_runCheck()) {
eventInfo.i_onCondition(dEvtCnd_CANTALK_e);
if (!linkPlayer->checkPlayerFly() &&
linkPlayer->eventInfo.chkCondition(dEvtCnd_CANTALK_e)) {
dComIfGp_att_ZHintRequest(this, 0x1ff);
if (field_0x56c[2] == 0) {
field_0x56c[2] = 1;
if (field_0x56c[1] == 0) {
mDoAud_seStart(0xe, 0, 0, 0);
if (!player->checkPlayerFly() && player->eventInfo.chkCondition(dEvtCnd_CANTALK_e)) {
dComIfGp_att_ZHintRequest(this, 0x1FF);
if (field_0x56e == 0) {
field_0x56e = 1;
if (field_0x56d == 0) {
mDoAud_seStart(Z2SE_NAVI_CALLVOICE, 0, 0, 0);
}
field_0x56c[1] = 0x3c;
field_0x56d = 60;
}
}
}
field_0x570 = field_0x568;
field_0x568 = -1;
} else {
@@ -254,17 +216,19 @@ int daTagWljump_c::execute() {
field_0x572 = 0;
field_0x568 = -1;
}
current.pos = attention_info.position;
if (!eventInfo.chkCondition(dEvtCnd_CANTALK_e)) {
field_0x56c[2] = 0;
field_0x56e = 0;
}
return 1;
}
/* 80D6587C-80D6589C 000A3C 0020+00 1/0 0/0 0/0 .text daTagWljump_Execute__FP13daTagWljump_c */
static int daTagWljump_Execute(daTagWljump_c* param_0) {
return param_0->execute();
static int daTagWljump_Execute(daTagWljump_c* i_this) {
return i_this->execute();
}
/* 80D6589C-80D658A4 000A5C 0008+00 1/1 0/0 0/0 .text draw__13daTagWljump_cFv */
@@ -274,11 +238,10 @@ int daTagWljump_c::draw() {
/* 80D658A4-80D658C4 000A64 0020+00 1/0 0/0 0/0 .text daTagWljump_Draw__FP13daTagWljump_c
*/
static int daTagWljump_Draw(daTagWljump_c* param_0) {
return param_0->draw();
static int daTagWljump_Draw(daTagWljump_c* i_this) {
return i_this->draw();
}
/* ############################################################################################## */
/* 80D65914-80D65934 -00001 0020+00 1/0 0/0 0/0 .data l_daTagWljump_Method */
static actor_method_class l_daTagWljump_Method = {
(process_method_func)daTagWljump_Create,
+1 -28
View File
@@ -1,12 +1,3 @@
//
// Generated By: dol2asm
// Translation Unit: d_a_title
//
//
// Issues with ~dDlst_daTitle_c appearing after create rather than end of TU
//
#include "d/actor/d_a_title.h"
#include "d/d_demo.h"
#include "d/d_pane_class_alpha.h"
@@ -26,7 +17,6 @@
/* 80D67D8C-80D67DA8 000014 001C+00 4/4 0/0 0/0 .bss g_daTitHIO */
static daTit_HIO_c g_daTitHIO;
/* ############################################################################################## */
/* 80D67BD4-80D67BE0 000000 000C+00 2/2 0/0 0/0 .rodata @3772 */
static u8 const lit_3772[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -35,23 +25,7 @@ static u8 const lit_3772[12] = {
/* 80D67BE0-80D67BE8 00000C 0006+02 3/3 0/0 0/0 .rodata l_arcName */
static char const l_arcName[6] = "Title";
/* 80D67C40-80D67C4C 000000 000C+00 1/1 0/0 0/0 .data cNullVec__6Z2Calc */
static u8 cNullVec__6Z2Calc[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
/* 80D67C4C-80D67C60 00000C 0004+10 0/0 0/0 0/0 .data @1787 */
#pragma push
#pragma force_active on
static u32 lit_1787[1 + 4 /* padding */] = {
0x02000201,
/* padding */
0x40080000,
0x00000000,
0x3FE00000,
0x00000000,
};
#pragma pop
UNK_REL_DATA;
static procFunc daTitleProc[6] = {
&daTitle_c::loadWait_proc, &daTitle_c::logoDispWait, &daTitle_c::logoDispAnm,
@@ -300,7 +274,6 @@ void daTitle_c::fastLogoDisp() {
/* 80D676F4-80D67768 000CD4 0074+00 1/1 0/0 0/0 .text getDemoPrm__9daTitle_cFv */
int daTitle_c::getDemoPrm() {
// NONMATCHING
dDemo_actor_c* demoActor = dDemo_c::getActor(demoActorID);
dDemo_prm_c* prm;
if (demoActor != NULL && demoActor->checkEnable(1) &&