cstaF / obj_rope_bridge done, cleanup obj_dust (#2497)

* d_a_cstaF done

* d_a_obj_rope_bridge done

* obj_dust

* e_ga done
This commit is contained in:
TakaRikka
2025-06-23 14:40:16 -07:00
committed by GitHub
parent c48fb2f545
commit 7cc4484e33
11 changed files with 1547 additions and 1798 deletions
+502 -657
View File
File diff suppressed because it is too large Load Diff
+257 -296
View File
@@ -4,88 +4,275 @@
*/
#include "d/actor/d_a_e_ga.h"
#include "dol2asm.h"
#include "d/d_com_inf_game.h"
#include "d/d_s_play.h"
/* 804FB0EC-804FB110 0000EC 0024+00 1/1 0/0 0/0 .text __ct__12daE_Ga_HIO_cFv */
daE_Ga_HIO_c::daE_Ga_HIO_c() {
id = -1;
base_size = 1.0f;
}
/* 804FB110-804FB1B0 000110 00A0+00 1/0 0/0 0/0 .text daE_Ga_Draw__FP10e_ga_class */
static int daE_Ga_Draw(e_ga_class* a_this) {
fopAc_ac_c* actor = &a_this->actor;
g_env_light.settingTevStruct(0, &actor->current.pos, &actor->tevStr);
ga_s* ga_s = a_this->ga_s;
int room_no = fopAcM_GetRoomNo(actor);
//
// Forward References:
//
for (int i = 0; i < a_this->ga_num; i++, ga_s++) {
if (ga_s->initialized) {
dComIfGp_entrySimpleModel(ga_s->model, room_no);
}
}
extern "C" void __ct__12daE_Ga_HIO_cFv();
extern "C" static void daE_Ga_Draw__FP10e_ga_class();
extern "C" static void ga_fly__FP10e_ga_classP4ga_s();
extern "C" static void bt_fly__FP10e_ga_classP4ga_s();
extern "C" static void ga_control__FP10e_ga_class();
extern "C" static void daE_Ga_Execute__FP10e_ga_class();
extern "C" static bool daE_Ga_IsDelete__FP10e_ga_class();
extern "C" static void daE_Ga_Delete__FP10e_ga_class();
extern "C" static void useHeapInit__FP10fopAc_ac_c();
extern "C" static void daE_Ga_Create__FP10fopAc_ac_c();
extern "C" void __dt__4ga_sFv();
extern "C" void __ct__4ga_sFv();
extern "C" void __dt__12daE_Ga_HIO_cFv();
extern "C" void __sinit_d_a_e_ga_cpp();
extern "C" extern char const* const d_a_e_ga__stringBase0;
return 1;
}
//
// External References:
//
/* 804FB1B0-804FB3A8 0001B0 01F8+00 1/1 0/0 0/0 .text ga_fly__FP10e_ga_classP4ga_s */
static void ga_fly(e_ga_class* a_this, ga_s* ga_s) {
fopAc_ac_c* actor = &a_this->actor;
extern "C" void mDoMtx_XrotM__FPA4_fs();
extern "C" void mDoMtx_YrotS__FPA4_fs();
extern "C" void mDoMtx_YrotM__FPA4_fs();
extern "C" void transM__14mDoMtx_stack_cFfff();
extern "C" void scaleM__14mDoMtx_stack_cFfff();
extern "C" void 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 addSimpleModel__14dComIfG_play_cFP12J3DModelDataiUc();
extern "C" void removeSimpleModel__14dComIfG_play_cFP12J3DModelDatai();
extern "C" void entrySimpleModel__14dComIfG_play_cFP8J3DModeli();
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 settingTevStruct__18dScnKy_env_light_cFiP4cXyzP12dKy_tevstr_c();
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 cLib_addCalcAngleS2__FPssss();
extern "C" void MtxPosition__FP4cXyzP4cXyz();
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" u8 now__14mDoMtx_stack_c[48];
extern "C" extern u8 g_dComIfG_gameInfo[122384];
extern "C" u8 sincosTable___5JMath[65536];
extern "C" extern void* calc_mtx[1 + 1 /* padding */];
extern "C" void __register_global_object();
cXyz sp20;
cXyz sp14;
f32 move_range = 100.0f * a_this->prm2;
//
// Declarations:
//
if (ga_s->move_timer == 0) {
ga_s->move_timer = cM_rndF(10.0f);
ga_s->pos_target.x = actor->home.pos.x + cM_rndFX(move_range);
ga_s->pos_target.y = actor->home.pos.y + cM_rndF(200.0f);
ga_s->pos_target.z = actor->home.pos.z + cM_rndFX(move_range);
/* ############################################################################################## */
/* 804FBB90-804FBB94 000000 0004+00 5/5 0/0 0/0 .rodata @3646 */
SECTION_RODATA static f32 const lit_3646 = 1.0f;
COMPILER_STRIP_GATE(0x804FBB90, &lit_3646);
sp20 = ga_s->pos_target - ga_s->position;
ga_s->rot_target.y = cM_atan2s(sp20.x, sp20.z);
ga_s->rot_target.x = -cM_atan2s(sp20.y, JMAFastSqrt((sp20.x * sp20.x) + (sp20.z * sp20.z)));
}
cLib_addCalcAngleS2(&ga_s->rotation.y, ga_s->rot_target.y, 2, 0x1000);
cLib_addCalcAngleS2(&ga_s->rotation.x, ga_s->rot_target.x, 2, 0x1000);
sp20.x = 0.0f;
sp20.y = 0.0f;
sp20.z = 10.0f;
cMtx_YrotS(*calc_mtx, ga_s->rotation.y);
cMtx_XrotM(*calc_mtx, ga_s->rotation.x);
MtxPosition(&sp20, &sp14);
ga_s->position += sp14;
if (ga_s->position.y < actor->home.pos.y) {
ga_s->position.y = actor->home.pos.y;
ga_s->move_timer = 0;
}
ga_s->field_0x3c = cM_ssin(ga_s->field_0x44);
ga_s->field_0x44 += 0x3E00;
}
/* 804FB3A8-804FB5C0 0003A8 0218+00 1/1 0/0 0/0 .text bt_fly__FP10e_ga_classP4ga_s */
static void bt_fly(e_ga_class* a_this, ga_s* ga_s) {
fopAc_ac_c* actor = &a_this->actor;
cXyz sp20;
cXyz sp14;
f32 move_range = 100.0f * a_this->prm2;
if (ga_s->move_timer == 0) {
ga_s->move_timer = cM_rndF(12.0f);
ga_s->pos_target.x = actor->home.pos.x + cM_rndFX(move_range);
ga_s->pos_target.y = actor->home.pos.y + cM_rndF(200.0f);
ga_s->pos_target.z = actor->home.pos.z + cM_rndFX(move_range);
sp20 = ga_s->pos_target - ga_s->position;
ga_s->rot_target.y = cM_atan2s(sp20.x, sp20.z);
ga_s->rot_target.x = -cM_atan2s(sp20.y, JMAFastSqrt((sp20.x * sp20.x) + (sp20.z * sp20.z)));
}
cLib_addCalcAngleS2(&ga_s->rotation.y, ga_s->rot_target.y, 2, 0x800);
cLib_addCalcAngleS2(&ga_s->rotation.x, ga_s->rot_target.x, 2, 0x800);
sp20.x = 0.0f;
sp20.y = 0.0f;
sp20.z = 7.0f;
cMtx_YrotS(*calc_mtx, ga_s->rotation.y);
cMtx_XrotM(*calc_mtx, ga_s->rotation.x);
MtxPosition(&sp20, &sp14);
ga_s->position.x += sp14.x;
ga_s->position.y += sp14.y;
ga_s->position.z += sp14.z;
if (ga_s->position.y < actor->home.pos.y) {
ga_s->position.y = actor->home.pos.y;
ga_s->move_timer = 0;
}
ga_s->field_0x44 += 0x2E00;
ga_s->field_0x3c = cM_ssin(ga_s->field_0x44);
}
/* 804FB5C0-804FB6F8 0005C0 0138+00 1/1 0/0 0/0 .text ga_control__FP10e_ga_class */
static void ga_control(e_ga_class* a_this) {
cXyz sp10;
ga_s* ga_s = a_this->ga_s;
f32 offset_y;
if (a_this->prm1 == 0) {
offset_y = -15.0f + TREG_F(10);
} else {
offset_y = -5.0f + TREG_F(9);
}
for (int i = 0; i < a_this->ga_num; i++, ga_s++) {
if (ga_s->initialized) {
if (ga_s->move_timer != 0) {
ga_s->move_timer--;
}
if (a_this->prm1 == 0) {
ga_fly(a_this, ga_s);
} else {
bt_fly(a_this, ga_s);
}
mDoMtx_stack_c::transS(ga_s->position.x, ga_s->position.y, ga_s->position.z);
mDoMtx_stack_c::YrotM(ga_s->rotation.y);
mDoMtx_stack_c::XrotM(ga_s->rotation.x);
mDoMtx_stack_c::scaleM(ga_s->size, ga_s->size * ga_s->field_0x3c, ga_s->size);
mDoMtx_stack_c::transM(0.0f, offset_y, 0.0f);
ga_s->model->setBaseTRMtx(mDoMtx_stack_c::get());
}
}
}
/* 804FB6F8-804FB71C 0006F8 0024+00 2/1 0/0 0/0 .text daE_Ga_Execute__FP10e_ga_class */
static int daE_Ga_Execute(e_ga_class* a_this) {
ga_control(a_this);
return 1;
}
/* 804FB71C-804FB724 00071C 0008+00 1/0 0/0 0/0 .text daE_Ga_IsDelete__FP10e_ga_class */
static int daE_Ga_IsDelete(e_ga_class* a_this) {
return 1;
}
/* 804FBC48-804FBC4C 000008 0004+00 2/2 0/0 0/0 .bss None */
static u8 l_HIOInit;
/* 804FB724-804FB7C4 000724 00A0+00 1/0 0/0 0/0 .text daE_Ga_Delete__FP10e_ga_class */
static int daE_Ga_Delete(e_ga_class* a_this) {
fopAc_ac_c* actor = &a_this->actor;
fpc_ProcID id = fopAcM_GetID(actor);
if (a_this->initialized) {
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("E_ga", 3);
dComIfGp_removeSimpleModel(modelData, fopAcM_GetRoomNo(actor));
}
dComIfG_resDelete(&a_this->phase, "E_ga");
if (a_this->HIOInit) {
l_HIOInit = FALSE;
}
return 1;
}
/* 804FB7C4-804FB874 0007C4 00B0+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */
static int useHeapInit(fopAc_ac_c* i_this) {
e_ga_class* a_this = (e_ga_class*)i_this;
void* modelData = dComIfG_getObjectRes("E_Ga", 3);
JUT_ASSERT(450, modelData != 0);
for (int i = 0; i < a_this->ga_num; i++) {
a_this->ga_s[i].model = mDoExt_J3DModel__create((J3DModelData*)modelData, 0x20000, 0x11000084);
if (a_this->ga_s[i].model == NULL) {
return 0;
}
}
return 1;
}
/* 804FBC58-804FBC64 000018 000C+00 2/2 0/0 0/0 .bss l_HIO */
static daE_Ga_HIO_c l_HIO;
/* 804FB874-804FBAB8 000874 0244+00 1/0 0/0 0/0 .text daE_Ga_Create__FP10fopAc_ac_c */
static int daE_Ga_Create(fopAc_ac_c* i_this) {
static const int l_bmdidx[] = {3};
e_ga_class* a_this = (e_ga_class*)i_this;
fopAcM_SetupActor(i_this, e_ga_class);
int phase_state = dComIfG_resLoad(&a_this->phase, "E_Ga");
if (phase_state == cPhs_COMPLEATE_e) {
OS_REPORT("E_GA PARAM %x\n", fopAcM_GetParam(i_this));
a_this->prm0 = fopAcM_GetParam(i_this);
a_this->prm1 = (fopAcM_GetParam(i_this) & 0xFF00) >> 8;
a_this->prm2 = (fopAcM_GetParam(i_this) & 0xFF0000) >> 0x10;
if (a_this->prm1 == 0xFF) {
a_this->prm1 = 0;
}
if (a_this->prm2 == 0xFF) {
a_this->prm1 = 2;
}
a_this->ga_num = a_this->prm0 + 1;
if (a_this->ga_num > 0x100) {
a_this->ga_num = 0x100;
}
OS_REPORT("E_GA//////////////E_GA SET 1 !!\n");
if (!fopAcM_entrySolidHeap(i_this, useHeapInit, 0x1000)) {
OS_REPORT("//////////////E_GA SET NON !!\n");
return cPhs_ERROR_e;
}
OS_REPORT("//////////////E_GA SET 2 !!\n");
if (!l_HIOInit) {
a_this->HIOInit = TRUE;
l_HIOInit = TRUE;
l_HIO.id = -1;
}
for (int i = 0; i < a_this->ga_num; i++) {
a_this->ga_s[i].initialized = TRUE;
a_this->ga_s[i].position = i_this->home.pos;
a_this->ga_s[i].field_0x44 = cM_rndF(0x10000);
if (a_this->prm1 == 0) {
a_this->ga_s[i].size = 0.3f + cM_rndF(0.3f);
} else {
a_this->ga_s[i].size = 0.8f + cM_rndF(0.2f);
}
}
daE_Ga_Execute(a_this);
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("E_ga", 3);
JUT_ASSERT(536, modelData != 0);
if (dComIfGp_addSimpleModel(modelData, fopAcM_GetRoomNo(i_this), FALSE) == -1) {
// "Moth: Simple Model addition failed.\n"
OS_REPORT("\x1B[43;30m蛾:シンプルモデル登録失敗しました。\n\x1B[m");
}
a_this->initialized = TRUE;
}
return phase_state;
}
/* 804FBBE0-804FBC00 -00001 0020+00 1/0 0/0 0/0 .data l_daE_Ga_Method */
static actor_method_class l_daE_Ga_Method = {
(process_method_func)daE_Ga_Create__FP10fopAc_ac_c,
(process_method_func)daE_Ga_Delete__FP10e_ga_class,
(process_method_func)daE_Ga_Execute__FP10e_ga_class,
(process_method_func)daE_Ga_IsDelete__FP10e_ga_class,
(process_method_func)daE_Ga_Draw__FP10e_ga_class,
(process_method_func)daE_Ga_Create,
(process_method_func)daE_Ga_Delete,
(process_method_func)daE_Ga_Execute,
(process_method_func)daE_Ga_IsDelete,
(process_method_func)daE_Ga_Draw,
};
/* 804FBC00-804FBC30 -00001 0030+00 0/0 0/0 1/0 .data g_profile_E_GA */
@@ -105,229 +292,3 @@ extern actor_process_profile_definition g_profile_E_GA = {
fopAc_ACTOR_e, // mActorType
fopAc_CULLBOX_CUSTOM_e, // cullType
};
/* 804FBC30-804FBC3C 000050 000C+00 2/2 0/0 0/0 .data __vt__12daE_Ga_HIO_c */
SECTION_DATA extern void* __vt__12daE_Ga_HIO_c[3] = {
(void*)NULL /* RTTI */,
(void*)NULL,
(void*)__dt__12daE_Ga_HIO_cFv,
};
/* 804FB0EC-804FB110 0000EC 0024+00 1/1 0/0 0/0 .text __ct__12daE_Ga_HIO_cFv */
daE_Ga_HIO_c::daE_Ga_HIO_c() {
// NONMATCHING
}
/* 804FB110-804FB1B0 000110 00A0+00 1/0 0/0 0/0 .text daE_Ga_Draw__FP10e_ga_class */
static void daE_Ga_Draw(e_ga_class* param_0) {
// NONMATCHING
}
/* ############################################################################################## */
/* 804FBB94-804FBB98 000004 0004+00 0/2 0/0 0/0 .rodata @3713 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3713 = 100.0f;
COMPILER_STRIP_GATE(0x804FBB94, &lit_3713);
#pragma pop
/* 804FBB98-804FBB9C 000008 0004+00 0/1 0/0 0/0 .rodata @3714 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3714 = 10.0f;
COMPILER_STRIP_GATE(0x804FBB98, &lit_3714);
#pragma pop
/* 804FBB9C-804FBBA0 00000C 0004+00 0/2 0/0 0/0 .rodata @3715 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3715 = 200.0f;
COMPILER_STRIP_GATE(0x804FBB9C, &lit_3715);
#pragma pop
/* 804FBBA0-804FBBA8 000010 0004+04 0/3 0/0 0/0 .rodata @3716 */
#pragma push
#pragma force_active on
SECTION_RODATA static u8 const lit_3716[4 + 4 /* padding */] = {
0x00,
0x00,
0x00,
0x00,
/* padding */
0x00,
0x00,
0x00,
0x00,
};
COMPILER_STRIP_GATE(0x804FBBA0, &lit_3716);
#pragma pop
/* 804FBBA8-804FBBB0 000018 0008+00 0/2 0/0 0/0 .rodata @3718 */
#pragma push
#pragma force_active on
SECTION_RODATA static u8 const lit_3718[8] = {
0x43, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
COMPILER_STRIP_GATE(0x804FBBA8, &lit_3718);
#pragma pop
/* 804FB1B0-804FB3A8 0001B0 01F8+00 1/1 0/0 0/0 .text ga_fly__FP10e_ga_classP4ga_s */
static void ga_fly(e_ga_class* param_0, ga_s* param_1) {
// NONMATCHING
}
/* ############################################################################################## */
/* 804FBBB0-804FBBB4 000020 0004+00 0/1 0/0 0/0 .rodata @3759 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3759 = 12.0f;
COMPILER_STRIP_GATE(0x804FBBB0, &lit_3759);
#pragma pop
/* 804FBBB4-804FBBB8 000024 0004+00 0/1 0/0 0/0 .rodata @3760 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3760 = 7.0f;
COMPILER_STRIP_GATE(0x804FBBB4, &lit_3760);
#pragma pop
/* 804FB3A8-804FB5C0 0003A8 0218+00 1/1 0/0 0/0 .text bt_fly__FP10e_ga_classP4ga_s */
static void bt_fly(e_ga_class* param_0, ga_s* param_1) {
// NONMATCHING
}
/* ############################################################################################## */
/* 804FBBB8-804FBBBC 000028 0004+00 0/1 0/0 0/0 .rodata @3796 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3796 = -15.0f;
COMPILER_STRIP_GATE(0x804FBBB8, &lit_3796);
#pragma pop
/* 804FBBBC-804FBBC0 00002C 0004+00 0/1 0/0 0/0 .rodata @3797 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3797 = -5.0f;
COMPILER_STRIP_GATE(0x804FBBBC, &lit_3797);
#pragma pop
/* 804FB5C0-804FB6F8 0005C0 0138+00 1/1 0/0 0/0 .text ga_control__FP10e_ga_class */
static void ga_control(e_ga_class* param_0) {
// NONMATCHING
}
/* 804FB6F8-804FB71C 0006F8 0024+00 2/1 0/0 0/0 .text daE_Ga_Execute__FP10e_ga_class */
static void daE_Ga_Execute(e_ga_class* param_0) {
// NONMATCHING
}
/* 804FB71C-804FB724 00071C 0008+00 1/0 0/0 0/0 .text daE_Ga_IsDelete__FP10e_ga_class */
static bool daE_Ga_IsDelete(e_ga_class* param_0) {
return true;
}
/* ############################################################################################## */
/* 804FBBD4-804FBBD4 000044 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
#pragma push
#pragma force_active on
SECTION_DEAD static char const* const stringBase_804FBBD4 = "E_ga";
#pragma pop
/* 804FBC48-804FBC4C 000008 0004+00 2/2 0/0 0/0 .bss None */
static u8 data_804FBC48[4];
/* 804FB724-804FB7C4 000724 00A0+00 1/0 0/0 0/0 .text daE_Ga_Delete__FP10e_ga_class */
static void daE_Ga_Delete(e_ga_class* param_0) {
// NONMATCHING
}
/* ############################################################################################## */
/* 804FBBD4-804FBBD4 000044 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
#pragma push
#pragma force_active on
SECTION_DEAD static char const* const stringBase_804FBBD9 = "E_Ga";
#pragma pop
/* 804FB7C4-804FB874 0007C4 00B0+00 1/1 0/0 0/0 .text useHeapInit__FP10fopAc_ac_c */
static void useHeapInit(fopAc_ac_c* param_0) {
// NONMATCHING
}
/* ############################################################################################## */
/* 804FBBC0-804FBBC4 000030 0004+00 0/0 0/0 0/0 .rodata l_bmdidx$3809 */
#pragma push
#pragma force_active on
SECTION_RODATA static u8 const l_bmdidx[4] = {
0x00,
0x00,
0x00,
0x03,
};
COMPILER_STRIP_GATE(0x804FBBC0, &l_bmdidx);
#pragma pop
/* 804FBBC4-804FBBC8 000034 0004+00 0/1 0/0 0/0 .rodata @3912 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3912 = 65536.0f;
COMPILER_STRIP_GATE(0x804FBBC4, &lit_3912);
#pragma pop
/* 804FBBC8-804FBBCC 000038 0004+00 0/1 0/0 0/0 .rodata @3913 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3913 = 3.0f / 10.0f;
COMPILER_STRIP_GATE(0x804FBBC8, &lit_3913);
#pragma pop
/* 804FBBCC-804FBBD0 00003C 0004+00 0/1 0/0 0/0 .rodata @3914 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3914 = 4.0f / 5.0f;
COMPILER_STRIP_GATE(0x804FBBCC, &lit_3914);
#pragma pop
/* 804FBBD0-804FBBD4 000040 0004+00 0/1 0/0 0/0 .rodata @3915 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3915 = 1.0f / 5.0f;
COMPILER_STRIP_GATE(0x804FBBD0, &lit_3915);
#pragma pop
/* 804FBC4C-804FBC58 00000C 000C+00 1/1 0/0 0/0 .bss @3641 */
static u8 lit_3641[12];
/* 804FBC58-804FBC64 000018 000C+00 2/2 0/0 0/0 .bss l_HIO */
static u8 l_HIO[12];
/* 804FB874-804FBAB8 000874 0244+00 1/0 0/0 0/0 .text daE_Ga_Create__FP10fopAc_ac_c */
static void daE_Ga_Create(fopAc_ac_c* param_0) {
// NONMATCHING
}
/* 804FBAB8-804FBAF4 000AB8 003C+00 1/1 0/0 0/0 .text __dt__4ga_sFv */
ga_s::~ga_s() {
// NONMATCHING
}
/* 804FBAF4-804FBAF8 000AF4 0004+00 1/1 0/0 0/0 .text __ct__4ga_sFv */
ga_s::ga_s() {
/* empty function */
}
/* 804FBAF8-804FBB40 000AF8 0048+00 2/1 0/0 0/0 .text __dt__12daE_Ga_HIO_cFv */
daE_Ga_HIO_c::~daE_Ga_HIO_c() {
// NONMATCHING
}
/* 804FBB40-804FBB7C 000B40 003C+00 0/0 1/0 0/0 .text __sinit_d_a_e_ga_cpp */
void __sinit_d_a_e_ga_cpp() {
// NONMATCHING
}
#pragma push
#pragma force_active on
REGISTER_CTORS(0x804FBB40, __sinit_d_a_e_ga_cpp);
#pragma pop
/* 804FBBD4-804FBBD4 000044 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
+90 -85
View File
@@ -5,50 +5,45 @@
#include "d/actor/d_a_obj_dust.h"
/* 80BE2F98-80BE2FA0 000000 0004+04 4/4 0/0 0/0 .rodata @3673 */
static u8 const lit_3673[4+ 4 /* padding */] = {
0x00,
0x00,
0x00,
0x00,
/* padding */
0x00,
0x00,
0x00,
0x00,
};
/* 80BE3054-80BE3058 -00001 0004+00 3/3 0/0 0/0 .data l_arcName */
static const char* l_arcName = "M_Dust";
namespace {
/* 80BE30F8-80BE30FC 000000 0004+00 2/2 0/0 0/0 .bss e_ymb__26@unnamed@d_a_obj_dust_cpp@ */
static fopAc_ac_c* e_ymb;
/* 80BE30F8-80BE30FC 000000 0004+00 2/2 0/0 0/0 .bss e_ymb__26@unnamed@d_a_obj_dust_cpp@ */
static fopAc_ac_c* e_ymb;
/* 80BE30FC-80BE3100 000004 0004+00 2/2 0/0 0/0 .bss e_ymb_Pos__26@unnamed@d_a_obj_dust_cpp@ */
static cXyz* e_ymb_Pos;
/* 80BE30FC-80BE3100 000004 0004+00 2/2 0/0 0/0 .bss e_ymb_Pos__26@unnamed@d_a_obj_dust_cpp@ */
static cXyz* e_ymb_Pos;
};
/* 80BE2490-80BE24F8 000250 0068+00 1/1 0/0 0/0 .text RideOn_Angle__11daObjDust_cFRsfsf */
void daObjDust_c::RideOn_Angle(s16& i_angle, f32 i_param1, s16 i_param2, f32 i_param3) {
cLib_addCalcAngleS(&i_angle, i_param2 * (i_param1 / i_param3), 1, 0x100, 1);
static f32 dummyFloat() {
return 0.0f;
}
static f64 dummyFloat2() {
return 4503601774854144.0;
}
/* 80BE22B8-80BE2490 000078 01D8+00 1/1 0/0 0/0 .text Search_Ymb__11daObjDust_cFv */
void daObjDust_c::Search_Ymb() {
cXyz ymb_delta(e_ymb_Pos->x - current.pos.x, e_ymb_Pos->y - current.pos.y, e_ymb_Pos->z - current.pos.z);
f32 e_ymb_speed = 0.0f;
cXyz ymb_rel_dist(e_ymb_Pos->x - current.pos.x, e_ymb_Pos->y - current.pos.y, e_ymb_Pos->z - current.pos.z);
mDoMtx_stack_c::YrotS(-shape_angle.y);
mDoMtx_stack_c::multVec(&ymb_delta, &ymb_delta);
mDoMtx_stack_c::multVec(&ymb_rel_dist, &ymb_rel_dist);
if (ymb_delta.x < 750.0f && ymb_delta.x > -750.0f && ymb_delta.z < 450.0f && ymb_delta.z > -450.0f && ymb_delta.y < 600.0f) {
f32 speed = fopAcM_GetSpeedF(e_ymb);
if (speed > 0) {
field_0x5ac = 256.0f + speed * 16.0f;
field_0x5a0 = speed * 31.0f;
if (ymb_rel_dist.x < (750.0f + BREG_F(0)) && ymb_rel_dist.x > (-750.0f - BREG_F(0)) &&
ymb_rel_dist.z < (450.0f + BREG_F(1)) && ymb_rel_dist.z > (-450.0f - BREG_F(1)) &&
ymb_rel_dist.y < (600.0f + BREG_F(7)))
{
e_ymb_speed = fopAcM_GetSpeedF(e_ymb);
if (e_ymb_speed > 0.0f) {
mRideAngleAmplitude = 256.0f + (e_ymb_speed * (16.0f + BREG_F(6)));
mRideOscillationSpeed = e_ymb_speed * (31.0f + BREG_F(5));
cLib_addCalc(&field_0x5d0, -100.0f, 0.5f, 100.0f, 0);
if (mYmbFlag == NULL && mRideOnFlag == NULL && field_0x5a0 > 300.0f && field_0x5a0 < 1900.0f) {
cLib_addCalc(&mOffsetY, -100.0f + BREG_F(8), 0.5f, 100.0f, 0);
if (mYmbFlag == false && mRideOnFlag == true && mRideOscillationSpeed > 300.0f && mRideOscillationSpeed < 1900.0f) {
fopAcM_seStart(this, Z2SE_OBJ_FLOATBOARD_SWING, 0);
mYmbFlag = true;
}
@@ -58,34 +53,44 @@ void daObjDust_c::Search_Ymb() {
}
}
/* 80BE2490-80BE24F8 000250 0068+00 1/1 0/0 0/0 .text RideOn_Angle__11daObjDust_cFRsfsf */
void daObjDust_c::RideOn_Angle(s16& o_angle, f32 i_value, s16 i_scale, f32 i_max) {
cLib_addCalcAngleS(&o_angle, i_scale * (i_value / i_max), 1, 0x100, 1);
}
/* 80BE24F8-80BE2708 0002B8 0210+00 1/1 0/0 0/0 .text Check_RideOn__11daObjDust_cFv */
int daObjDust_c::Check_RideOn() {
daPy_py_c* player = daPy_getPlayerActorClass();
cXyz* player_pos = fopAcM_GetPosition_p(player);
s16 target = 0;
cXyz& player_pos = fopAcM_GetPosition(player);
f32 player_speed = 0.0f;
s16 intensity_target = 0;
mRideOnFlag = false;
cXyz delta_vec(player_pos->x -current.pos.x, player_pos->y - current.pos.y, player_pos->z - current.pos.z);
cXyz player_rel_dist(player_pos.x - current.pos.x, player_pos.y - current.pos.y, player_pos.z - current.pos.z);
mDoMtx_stack_c::YrotS(-shape_angle.y);
mDoMtx_stack_c::multVec(&delta_vec, &delta_vec);
mDoMtx_stack_c::multVec(&player_rel_dist, &player_rel_dist);
if (delta_vec.x < 750.0f && delta_vec.x > -750.0f && delta_vec.z < 450.0f && delta_vec.z > -450.0f) {
RideOn_Angle(field_0x5c8, (s16)-delta_vec.x, 0x200, 750.0);
RideOn_Angle(field_0x5cc, delta_vec.z, 0x200, 450.0);
if (player_rel_dist.x < 750.0f && player_rel_dist.x > -750.0f && player_rel_dist.z < 450.0f && player_rel_dist.z > -450.0f) {
RideOn_Angle(mRideAngle.x, (s16)-player_rel_dist.x, 0x200, 750.0);
RideOn_Angle(mRideAngle.z, player_rel_dist.z, 0x200, 450.0);
f32 var_f30 = 0.0f;
mRideOnFlag = true;
if (fopAcM_GetSpeedF(player) > 0.0f) {
cLib_addCalcAngleS(&field_0x5ac, 0x150, 0xb, 0x100, 0);
target = 0x400;
player_speed = fopAcM_GetSpeedF(player);
if (player_speed > 0.0f) {
cLib_addCalcAngleS(&mRideAngleAmplitude, 0x150, 11, 0x100, 0);
intensity_target = 0x400;
} else {
cLib_addCalcAngleS(&field_0x5ac, 0x100, 0xb, 0x100, 0);
cLib_addCalcAngleS(&mRideAngleAmplitude, 0x100, 11, 0x100, 0);
}
} else {
cLib_addCalcAngleS(&field_0x5ac, 0x100, 0xb, 0x100, 0);
cLib_addCalcAngleS(&field_0x5c8, 0, 2, 0x100, 1);
cLib_addCalcAngleS(&field_0x5cc, 0, 2, 0x100, 1);
cLib_addCalcAngleS(&mRideAngleAmplitude, 0x100, 11, 0x100, 0);
cLib_addCalcAngleS(&mRideAngle.x, 0, 2, 0x100, 1);
cLib_addCalcAngleS(&mRideAngle.z, 0, 2, 0x100, 1);
}
cLib_addCalc(&field_0x5a4, target, 0.05, 100.0f, 0.0f);
cLib_addCalc(&mRideIntensity, intensity_target, 0.05f + HREG_F(13), 100.0f, 0.0f);
return 0;
}
@@ -106,9 +111,12 @@ void daObjDust_c::setBaseMtx() {
/* 80BE2790-80BE27BC 000550 002C+00 1/1 0/0 0/0 .text
* rideCallBack__FP4dBgWP10fopAc_ac_cP10fopAc_ac_c */
static void rideCallBack(dBgW*, fopAc_ac_c* i_bgActor, fopAc_ac_c* i_rideActor) {
if (std::abs(i_rideActor->current.pos.y - i_rideActor->old.pos.y) > 30.0f) {
static_cast<daObjDust_c*>(i_bgActor)->field_0x5a8 = i_rideActor->current.pos.y - i_rideActor->old.pos.y;
static void rideCallBack(dBgW* i_bgw, fopAc_ac_c* i_bgActor, fopAc_ac_c* i_rideActor) {
fopAc_ac_c* ride_actor = (fopAc_ac_c*)i_rideActor;
daObjDust_c* a_this = (daObjDust_c*)i_bgActor;
if (std::abs(ride_actor->current.pos.y - ride_actor->old.pos.y) > 30.0f) {
a_this->mRideBounce = ride_actor->current.pos.y - ride_actor->old.pos.y;
}
}
@@ -126,13 +134,13 @@ static int daObjDust_Execute(daObjDust_c* i_this) {
/* 80BE2808-80BE2810 0005C8 0008+00 1/0 0/0 0/0 .text daObjDust_IsDelete__FP11daObjDust_c
*/
static int daObjDust_IsDelete(daObjDust_c* i_this) {
return true;
return 1;
}
/* 80BE2810-80BE2834 0005D0 0024+00 1/0 0/0 0/0 .text daObjDust_Delete__FP11daObjDust_c
*/
static int daObjDust_Delete(daObjDust_c* i_this) {
fopAcM_GetID(i_this);
fpc_ProcID id = fopAcM_GetID(i_this);
i_this->MoveBGDelete();
return 1;
}
@@ -140,20 +148,19 @@ static int daObjDust_Delete(daObjDust_c* i_this) {
int daObjDust_c::create() {
fopAcM_SetupActor(this, daObjDust_c);
int phaseStep = dComIfG_resLoad(&mPhaseReq, l_arcName);
if (phaseStep == cPhs_COMPLEATE_e) {
phaseStep = MoveBGCreate(
l_arcName,
dComIfG_getObjctResName2Index(l_arcName, "M_FloatingDust01.dzb"),
dBgS_MoveBGProc_TypicalRotY,
0x1060,
NULL);
if (phaseStep == cPhs_ERROR_e) {
return phaseStep;
int phase_state = dComIfG_resLoad(&mPhaseReq, l_arcName);
if (phase_state == cPhs_COMPLEATE_e) {
int dzb_id = dComIfG_getObjctResName2Index(l_arcName, "M_FloatingDust01.dzb");
JUT_ASSERT(116, dzb_id != -1);
phase_state = MoveBGCreate(l_arcName, dzb_id, dBgS_MoveBGProc_TypicalRotY, 0x1060, NULL);
if (phase_state == cPhs_ERROR_e) {
return phase_state;
}
}
fopAcM_setCullSizeBox(this, -200.0f, -50.0f, -200.0f, 200.0f, 50.0f, 200.0f);
mAcch.Set(
fopAcM_GetPosition_p(this),
fopAcM_GetOldPosition_p(this),
@@ -165,25 +172,28 @@ int daObjDust_c::create() {
NULL);
mAcchCir.SetWall(100.0f, 200.0f);
mAcch.CrrPos(dComIfG_Bgsp());
current.pos.y = -18850.0f;
return phaseStep;
current.pos.y = -18850.0f + HREG_F(0) + oREG_F(0);
return phase_state;
}
/* 80BE2834-80BE2A00 0005F4 01CC+00 1/0 0/0 0/0 .text daObjDust_Create__FP10fopAc_ac_c */
static int daObjDust_Create(fopAc_ac_c* i_this) {
daObjDust_c* a_this = (daObjDust_c*)i_this;
fpc_ProcID id = fopAcM_GetID(i_this);
return a_this->create();
}
/* 80BE2A70-80BE2AE8 000830 0078+00 1/0 0/0 0/0 .text CreateHeap__11daObjDust_cFv */
int daObjDust_c::CreateHeap() {
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, "M_FloatingDust01.bmd");
JUT_ASSERT(82, modelData != 0);
JUT_ASSERT(86, modelData != 0);
mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084);
if (mpModel == NULL) {
return 0;
}
return 1;
}
@@ -199,40 +209,35 @@ int daObjDust_c::Create() {
// NONMATCHING somehow this needs to not inline TSinCosTable<13,f32>::sinShort
int daObjDust_c::Execute(Mtx** i_mtx) {
fopAcM_seStartLevel(this, Z2SE_OBJ_FLOATBOARD, 0);
daPy_py_c* pdVar = daPy_getPlayerActorClass();
fopAcM_GetPosition(pdVar);
fopAcM_GetSpeed(pdVar);
daPy_py_c* player = daPy_getPlayerActorClass();
cXyz& player_pos = fopAcM_GetPosition(player);
cXyz& player_speed = fopAcM_GetSpeed(player);
if (fopAcM_SearchByName(PROC_E_YMB, &e_ymb) != 0 && e_ymb != NULL) {
e_ymb_Pos = fopAcM_GetPosition_p(e_ymb);
if (fopAcM_SearchByName(PROC_E_YMB, &e_ymb) && e_ymb != NULL) {
e_ymb_Pos = &fopAcM_GetPosition(e_ymb);
}
field_0x5c4 += field_0x5a4 * 2.0f + 768.0f + field_0x5a0 * 2.0f;
field_0x5c6 += field_0x5a4 * 2.0f + 768.0f + field_0x5a0 * 2.0f;
mRideOscillationPhaseX += 768.0f + TREG_F(1) + ((2.0f + HREG_F(1)) * mRideIntensity) + ((2.0f + BREG_F(3)) * mRideOscillationSpeed);
mRideOscillationPhaseZ += 768.0f + TREG_F(2) + ((2.0f + HREG_F(2)) * mRideIntensity) + ((2.0f + BREG_F(3)) * mRideOscillationSpeed);
Check_RideOn();
if (e_ymb != NULL) {
Search_Ymb();
}
cXyz water_pos(current.pos.x, current.pos.y + 300.0f, current.pos.z);
f32 water_f32;
if(fopAcM_wt_c::waterCheck(&water_pos)) {
water_f32 = fopAcM_wt_c::getWaterY() - 40.0f;
cXyz water_check_pos(current.pos.x, current.pos.y + 300.0f, current.pos.z);
f32 height; //! @bug: uninitialized value. if the waterCheck fails, this causes the platform height to chase to an unintended height, usually y-0
if (fopAcM_wt_c::waterCheck(&water_check_pos)) {
height = fopAcM_wt_c::getWaterY() - 40.0f;
}
cLib_addCalc(&current.pos.y,
water_f32 + cM_ssin(field_0x5c6) * 20.0f + ((field_0x5d0 + 80.0f) + field_0x5a8),
0.1f, 15.0f, 0.1f);
cLib_addCalcAngleS(&shape_angle.x,
field_0x5c8 + field_0x5ac * cM_ssin(field_0x5c4 + 0x2000),
2, 0x1000, 1);
cLib_addCalcAngleS(&shape_angle.z,
field_0x5cc + field_0x5ac * cM_ssin(field_0x5c6),
2, 0x1000, 1);
cLib_chaseF(&field_0x5a8, 0.0f, 1.0f);
cLib_addCalc(&field_0x5a0, 0.0f, 0.01f, 100.0f, 0.0f);
cLib_addCalc(&field_0x5d0, 0.0f, 0.1f, 100.0f, 0.0f);
cLib_addCalc(&current.pos.y, mOffsetY + (HREG_F(0) + (80.0f + height + mRideBounce) + (20.0f * cM_ssin(mRideOscillationPhaseZ))), 0.1f, 15.0f, 0.1f);
cLib_addCalcAngleS(&shape_angle.x, mRideAngle.x + ((1.0f + nREG_F(0)) * mRideAngleAmplitude * cM_ssin(mRideOscillationPhaseX + oREG_S(1) + 0x2000)), 2, 0x1000, 1);
cLib_addCalcAngleS(&shape_angle.z, mRideAngle.z + ((1.0f + nREG_F(1)) * mRideAngleAmplitude * cM_ssin(mRideOscillationPhaseZ)), 2, 0x1000, 1);
cLib_chaseF(&mRideBounce, 0.0f, 1.0f);
cLib_addCalc(&mRideOscillationSpeed, 0.0f, 0.01f + HREG_F(13), 100.0f, 0.0f);
cLib_addCalc(&mOffsetY, 0.0f, 0.1f, 100.0f, 0.0f);
fopAcM_posMoveF(this, mStts.GetCCMoveP());
File diff suppressed because it is too large Load Diff