d_a_npc_ks work (#2461)

* Initial work

* Work on ori2 and others

* Work on npc_ks_home

* Work on npc_ks_demo_022

* Chugging through

* Started on demo_camera

* More demo_camera work

* 51% equivalent

* General cleanup

* Fixed compile error in d_a_e_mk

* Small d_a_e_mk fix

* d_a_e_fs fix

* PR cleanup

* Started work on d_a_obj_sw
This commit is contained in:
Carco_21
2025-05-30 06:49:24 -04:00
committed by GitHub
parent 6fd5560738
commit bc94559904
11 changed files with 4377 additions and 3353 deletions
+2 -3
View File
@@ -478,7 +478,6 @@ static bool checkViewArea(cXyz* i_pos) {
}
/* 806BCE5C-806BD0A8 00147C 024C+00 2/1 0/0 0/0 .text e_fs_demowait__FP10e_fs_class */
// NONMATCHING regalloc
static void e_fs_demowait(e_fs_class* i_this) {
cXyz delta;
npc_ks_class* monkey = (npc_ks_class*)fopAcM_SearchByName(PROC_NPC_KS);
@@ -499,8 +498,8 @@ static void e_fs_demowait(e_fs_class* i_this) {
break;
case 2:
delta.x = monkey->current.pos.x - i_this->current.pos.x;
delta.z = monkey->current.pos.z - i_this->current.pos.z;
delta.x = monkey->actor.current.pos.x - i_this->current.pos.x;
delta.z = monkey->actor.current.pos.z - i_this->current.pos.z;
i_this->mTargetAngleY = cM_atan2s(delta.x, delta.z);
if (i_this->mAcch.ChkGroundHit()) {
i_this->mpMorf->setPlaySpeed(1.0f);
+23 -23
View File
@@ -1193,7 +1193,7 @@ static void cam_3d_morf(e_mk_class* i_this, f32 param_2) {
/* 807174E4-8071823C 0034A4 0D58+00 1/1 0/0 0/0 .text demo_camera_start__FP10e_mk_class */
static void demo_camera_start(e_mk_class* i_this) {
// EQUIVALENT - REGALLOC
// NONMATCHING
fopAc_ac_c* a_this = &i_this->enemy;
fopAc_ac_c* actor1, * actor2, * actor3;
daPy_py_c* player = (daPy_py_c*)dComIfGp_getPlayer(0);
@@ -1908,9 +1908,9 @@ static void demo_camera_r04(e_mk_class* i_this) {
switch (i_this->mDemoMode) {
case 1:
if (!i_actor->eventInfo.checkCommandDemoAccrpt()) {
fopAcM_orderPotentialEvent(i_actor, 2, 0xffff, 0);
i_actor->eventInfo.onCondition(dEvtCnd_CANDEMO_e);
if (!i_actor->actor.eventInfo.checkCommandDemoAccrpt()) {
fopAcM_orderPotentialEvent(&i_actor->actor, 2, 0xffff, 0);
i_actor->actor.eventInfo.onCondition(dEvtCnd_CANDEMO_e);
return;
}
@@ -1953,13 +1953,13 @@ static void demo_camera_r04(e_mk_class* i_this) {
}
if (i_this->mDemoCamTimer == 260) {
cMtx_YrotS(*calc_mtx, i_actor->shape_angle.y);
cMtx_YrotS(*calc_mtx, i_actor->actor.shape_angle.y);
sp2c.x = 200.0f;
sp2c.y = 300.0f;
sp2c.z = 300.0f;
MtxPosition(&sp2c, &i_this->mCamEye);
i_this->mCamEye += i_actor->current.pos;
i_this->mCamCenter = i_actor->current.pos;
i_this->mCamEye += i_actor->actor.current.pos;
i_this->mCamCenter = i_actor->actor.current.pos;
i_this->mCamCenter.y += 130.0f;
i_this->mDemoMode = 3;
i_this->mDemoCamTimer = 0;
@@ -1971,8 +1971,8 @@ static void demo_camera_r04(e_mk_class* i_this) {
case 3:
a_this->current.pos.y = a_this->home.pos.y + 10000.0f;
cLib_addCalc2(&i_this->mCamCenter.z, i_actor->current.pos.z, 0.2f, 50.0f);
cLib_addCalc2(&i_this->mCamCenter.y, i_actor->current.pos.y + 130.0f + cM_ssin(i_this->mDemoCamTimer * 0xA00) * 30.0f, 0.2f, 50.0f);
cLib_addCalc2(&i_this->mCamCenter.z, i_actor->actor.current.pos.z, 0.2f, 50.0f);
cLib_addCalc2(&i_this->mCamCenter.y, i_actor->actor.current.pos.y + 130.0f + cM_ssin(i_this->mDemoCamTimer * 0xA00) * 30.0f, 0.2f, 50.0f);
if (i_this->mDemoCamTimer != 93) {
return;
@@ -2004,22 +2004,22 @@ static void demo_camera_r04(e_mk_class* i_this) {
i_this->mDemoMode = 45;
i_this->mDemoCamTimer = 0;
cMtx_YrotS(*calc_mtx, i_actor->shape_angle.y);
cMtx_YrotS(*calc_mtx, i_actor->actor.shape_angle.y);
sp2c.x = -300.0f;
sp2c.y = 200.0f;
sp2c.z = -100.0f;
MtxPosition(&sp2c, &i_this->mCamEye);
i_this->mCamEye += i_actor->current.pos;
i_this->mCamCenter = i_actor->current.pos;
i_this->mCamEye += i_actor->actor.current.pos;
i_this->mCamCenter = i_actor->actor.current.pos;
i_this->mCamCenter.y += 90.0f;
return;
case 45:
cLib_addCalc2(&i_this->mCamCenter.z, i_actor->current.pos.z, 0.2f, 50.0f);
cLib_addCalc2(&i_this->mCamCenter.y, i_actor->current.pos.y + 90.0f + 30.0f * cM_ssin(i_this->mDemoCamTimer * 0xA00), 0.2f, 50.0f);
cLib_addCalc2(&i_this->mCamCenter.z, i_actor->actor.current.pos.z, 0.2f, 50.0f);
cLib_addCalc2(&i_this->mCamCenter.y, i_actor->actor.current.pos.y + 90.0f + 30.0f * cM_ssin(i_this->mDemoCamTimer * 0xA00), 0.2f, 50.0f);
if (i_this->mDemoCamTimer == 10) {
i_actor->field_0x567 = 1;
i_actor->actor.field_0x567 = 1;
}
if (i_this->mDemoCamTimer != 55) {
@@ -2055,8 +2055,8 @@ static void demo_camera_r04(e_mk_class* i_this) {
i_this->mCamEye.set(-477.0f, 3119.0f, 1643.0f);
if (i_this->mDemoCamTimer == 30) {
i_actor->current.pos.z = 1600.0f;
i_actor->current.pos.y = 3200.0f;
i_actor->actor.current.pos.z = 1600.0f;
i_actor->actor.current.pos.y = 3200.0f;
}
if (i_this->mDemoCamTimer != 69) {
@@ -2089,8 +2089,8 @@ static void demo_camera_r04(e_mk_class* i_this) {
i_this->mCamCenter.y += 190.0f;
// fallthrough
case 7:
i_actor->speed.y = 0.0f;
i_actor->current.pos.set(0.0f, 2500.0f, 3373.0f);
i_actor->actor.speed.y = 0.0f;
i_actor->actor.current.pos.set(0.0f, 2500.0f, 3373.0f);
if (i_this->mDemoCamTimer != 250) {
return;
@@ -2100,14 +2100,14 @@ static void demo_camera_r04(e_mk_class* i_this) {
i_this->mDemoCamTimer = 0;
i_actor->mMode++;
i_this->mCamEye.set(-282.0f, 2534.0f, 3147.0f);
i_this->mCamCenter = i_actor->current.pos;
i_this->mCamCenter = i_actor->actor.current.pos;
// fallthrough
case 8:
cLib_addCalc2(&i_this->mCamCenter.y, i_actor->current.pos.y, 0.2f, 50.0f);
cLib_addCalc2(&i_this->mCamCenter.y, i_actor->actor.current.pos.y, 0.2f, 50.0f);
fpcM_Search(s_brg_sub, i_this);
if (i_this->mDemoCamTimer == 65) {
i_actor->current.pos.set(0.0f, 3310.0f, 3427.0f);
i_actor->actor.current.pos.set(0.0f, 3310.0f, 3427.0f);
i_actor->mMode++;
i_this->mDemoMode = 9;
i_this->mDemoCamTimer = 0;
@@ -2238,7 +2238,7 @@ static void demo_camera(e_mk_class* i_this) {
i_no = fopAcM_GetParam(i_actor) >> 24;
if (i_no != 0xFF) {
dComIfGs_onSwitch(i_no, fopAcM_GetRoomNo(i_actor));
dComIfGs_onSwitch(i_no, fopAcM_GetRoomNo(&i_actor->actor));
}
dComIfGp_setNextStage("D_MN05", 0, 4, 0);
+3911 -3186
View File
File diff suppressed because it is too large Load Diff
+223 -125
View File
@@ -6,8 +6,8 @@
//#define VIRTUAL_3DLINEMAT
#include "m_Do/m_Do_ext.h"
#include "d/d_camera.h"
#include "d/actor/d_a_obj_sw.h"
#include "d/d_com_inf_game.h"
#include "dol2asm.h"
@@ -118,154 +118,239 @@ extern "C" extern void* __vt__19mDoExt_3DlineMat1_c[5];
extern "C" extern void* __vt__16Z2SoundObjSimple[8];
extern "C" u8 m_cpadInfo__8mDoCPd_c[256];
extern "C" u8 now__14mDoMtx_stack_c[48];
extern "C" extern u8 g_dComIfG_gameInfo[122384];
extern "C" u8 sincosTable___5JMath[65536];
//
// Declarations:
//
/* ############################################################################################## */
/* 80CF30FC-80CF3100 000000 0004+00 1/1 0/0 0/0 .data l_color$3804 */
SECTION_DATA static u8 l_color[4] = {
0x14,
0x0F,
0x00,
0xFF,
};
/* 80CF0638-80CF0774 000078 013C+00 1/0 0/0 0/0 .text daObj_Sw_Draw__FP12obj_sw_class */
static void daObj_Sw_Draw(obj_sw_class* param_0) {
static int daObj_Sw_Draw(obj_sw_class* i_this) {
// NONMATCHING
static _GXColor l_color = {
0x14,
0x0F,
0x00,
0xFF,
};
fopAc_ac_c* a_this = &i_this->actor;
if (i_this->field_0x570 == 8) {
g_env_light.settingTevStruct(0, &a_this->current.pos, &a_this->tevStr);
obj_sc_s* sc_p = &i_this->field_0x5a8;
for (int i = 0; i < 8; i++) {
if (sc_p->field_0x0 != 0) {
g_env_light.setLightTevColorType_MAJI(sc_p->mpModelMorf->getModel(), &a_this->tevStr);
sc_p->mpModelMorf->entryDL();
if (i == 2 && i_this->field_0x864.mpModel != NULL) {
g_env_light.setLightTevColorType_MAJI(i_this->field_0x864.mpModel, &a_this->tevStr);
mDoExt_modelUpdateDL(i_this->field_0x864.mpModel);
}
}
sc_p = (obj_sc_s *)((s8*)sc_p + 100);
}
} else {
g_env_light.settingTevStruct(16, &a_this->current.pos, &a_this->tevStr);
i_this->field_0xd50.update(63, l_color, &a_this->tevStr);
dComIfGd_set3DlineMat(&i_this->field_0xd50);
}
return 1;
}
/* ############################################################################################## */
/* 80CF3278-80CF327C 000000 0004+00 3/3 0/0 0/0 .bss saru_ct */
static u8 saru_ct[4];
static int saru_ct;
/* 80CF0774-80CF07F8 0001B4 0084+00 1/1 0/0 0/0 .text s_ks_sub__FPvPv */
static void s_ks_sub(void* param_0, void* param_1) {
// NONMATCHING
static void* s_ks_sub(void* i_actor, void* i_data) {
if (fopAcM_IsActor(i_actor) && fopAcM_GetName(i_actor) == PROC_NPC_KS) {
int swBit = fopAcM_GetParam(i_actor) >> 24;
if (swBit != 0xFF) {
if (dComIfGs_isSwitch(swBit, fopAcM_GetRoomNo((fopAc_ac_c*)i_actor))) {
saru_ct++;
}
}
}
return NULL;
}
struct path {
int field_0x0;
f32 field_0x4;
f32 field_0x8;
f32 field_0xc;
};
/* ############################################################################################## */
/* 80CF3100-80CF3210 000004 0110+00 3/3 0/0 0/0 .data sc_path */
SECTION_DATA static u8 sc_path[272] = {
0x00, 0x00, 0x00, 0x01, 0x45, 0xFF, 0x60, 0x00, 0x45, 0x53, 0x40, 0x00, 0xC6, 0x2A, 0x1C, 0x00,
0x00, 0x00, 0x00, 0x01, 0x46, 0x01, 0xC4, 0x00, 0x45, 0x5C, 0x40, 0x00, 0xC6, 0x30, 0x2C, 0x00,
0x00, 0x00, 0x00, 0x01, 0x46, 0x09, 0x18, 0x00, 0x45, 0x65, 0xD0, 0x00, 0xC6, 0x27, 0xA0, 0x00,
0x00, 0x00, 0x00, 0x01, 0x46, 0x09, 0x68, 0x00, 0x45, 0x65, 0xD0, 0x00, 0xC6, 0x32, 0x80, 0x00,
0x00, 0x00, 0x00, 0x01, 0x46, 0x10, 0xCC, 0x00, 0x45, 0x72, 0xF0, 0x00, 0xC6, 0x25, 0x68, 0x00,
0x00, 0x00, 0x00, 0x01, 0x46, 0x0C, 0xD4, 0x00, 0x45, 0x73, 0xE0, 0x00, 0xC6, 0x37, 0x5C, 0x00,
0x00, 0x00, 0x00, 0x01, 0x46, 0x0F, 0x80, 0x00, 0x45, 0x79, 0xD0, 0x00, 0xC6, 0x2F, 0x78, 0x00,
0x00, 0x00, 0x00, 0x01, 0x46, 0x10, 0x58, 0x00, 0x45, 0x80, 0xF8, 0x00, 0xC6, 0x39, 0xB8, 0x00,
0x00, 0x00, 0x00, 0x01, 0x46, 0x16, 0x60, 0x00, 0x45, 0x8F, 0xD0, 0x00, 0xC6, 0x36, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x46, 0x14, 0xA4, 0x00, 0x45, 0x97, 0xB0, 0x00, 0xC6, 0x3E, 0xC4, 0x00,
0x00, 0x00, 0x00, 0x00, 0x46, 0x0D, 0x64, 0x00, 0x45, 0x9D, 0x58, 0x00, 0xC6, 0x3C, 0x48, 0x00,
0x00, 0x00, 0x00, 0x00, 0x46, 0x08, 0x2C, 0x00, 0x45, 0x9E, 0xD8, 0x00, 0xC6, 0x38, 0x24, 0x00,
0x00, 0x00, 0x00, 0x00, 0x46, 0x03, 0xB0, 0x00, 0x45, 0xA2, 0xB0, 0x00, 0xC6, 0x31, 0xF0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x7C, 0x00, 0x45, 0xA7, 0x48, 0x00, 0xC6, 0x2F, 0xC8, 0x00,
0x00, 0x00, 0x00, 0x00, 0x45, 0xF5, 0x58, 0x00, 0x45, 0xAA, 0xA0, 0x00, 0xC6, 0x30, 0x14, 0x00,
0x00, 0x00, 0x00, 0x00, 0x45, 0xED, 0x78, 0x00, 0x45, 0xAD, 0x08, 0x00, 0xC6, 0x2E, 0xC8, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
static path sc_path[17] = {
{1, 8172.0f, 3380.0f, -10887.0f},
{1, 8305.0f, 3524.0f, -11275.0f},
{1, 8774.0f, 3677.0f, -10728.0f},
{1, 8794.0f, 3677.0f, -11424.0f},
{1, 9267.0f, 3887.0f, -10586.0f},
{1, 9013.0f, 3902.0f, -11735.0f},
{1, 9184.0f, 3997.0f, -11230.0f},
{1, 9238.0f, 4127.0f, -11886.0f},
{1, 9624.0f, 4602.0f, -11648.0f},
{0, 9513.0f, 4854.0f, -12209.0f},
{0, 9049.0f, 5035.0f, -12050.0f},
{0, 8715.0f, 5083.0f, -11785.0f},
{0, 8428.0f, 5206.0f, -11388.0f},
{0, 8223.0f, 5353.0f, -11250.0f},
{0, 7851.0f, 5460.0f, -11269.0f},
{0, 7599.0f, 5537.0f, -11186.0f},
{0, 0.0f, 0.0f, 0.0f},
// 0x00000001, 0x45FF6000, 0x45534000, 0xC62A1C00,
// 0x00000001, 0x4601C400, 0x455C4000, 0xC6302C00,
// 0x00000001, 0x46091800, 0x4565D000, 0xC627A000,
// 0x00000001, 0x46096800, 0x4565D000, 0xC6328000,
// 0x00000001, 0x4610CC00, 0x4572F000, 0xC6256800,
// 0x00000001, 0x460CD400, 0x4573E000, 0xC6375C00,
// 0x00000001, 0x460F8000, 0x4579D000, 0xC62F7800,
// 0x00000001, 0x46105800, 0x4580F800, 0xC639B800,
// 0x00000001, 0x46166000, 0x458FD000, 0xC6360000,
// 0x00000000, 0x4614A400, 0x4597B000, 0xC63EC400,
// 0x00000000, 0x460D6400, 0x459D5800, 0xC63C4800,
// 0x00000000, 0x46082C00, 0x459ED800, 0xC6382400,
// 0x00000000, 0x4603B000, 0x45A2B000, 0xC631F000,
// 0x00000000, 0x46007C00, 0x45A74800, 0xC62FC800,
// 0x00000000, 0x45F55800, 0x45AAA000, 0xC6301400,
// 0x00000000, 0x45ED7800, 0x45AD0800, 0xC62EC800,
// 0x00000000, 0x00000000, 0x00000000, 0x00000000,
};
/* 80CF07F8-80CF08F8 000238 0100+00 1/1 0/0 0/0 .text s_ksdel_sub__FPvPv */
static void s_ksdel_sub(void* param_0, void* param_1) {
static void* s_ksdel_sub(void* i_actor, void* i_data) {
// NONMATCHING
if (fopAcM_IsActor(i_actor) && fopAcM_GetName(i_actor) == PROC_NPC_KS) {
fopAcM_delete((fopAc_ac_c*)i_actor);
saru_ct++;
}
return NULL;
}
/* ############################################################################################## */
/* 80CF3000-80CF3004 000000 0004+00 8/8 0/0 0/0 .rodata @3850 */
SECTION_RODATA static u8 const lit_3850[4] = {
0x00,
0x00,
0x00,
0x00,
};
COMPILER_STRIP_GATE(0x80CF3000, &lit_3850);
/* 80CF3004-80CF3008 000004 0004+00 1/1 0/0 0/0 .rodata @3851 */
SECTION_RODATA static f32 const lit_3851 = -1.0f;
COMPILER_STRIP_GATE(0x80CF3004, &lit_3851);
/* 80CF30EC-80CF30EC 0000EC 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
#pragma push
#pragma force_active on
SECTION_DEAD static char const* const stringBase_80CF30EC = "Npc_ksw";
#pragma pop
/* 80CF08F8-80CF09A8 000338 00B0+00 3/3 0/0 0/0 .text anm_init__FP8obj_sc_sifUcf */
static void anm_init(obj_sc_s* param_0, int param_1, f32 param_2, u8 param_3, f32 param_4) {
// NONMATCHING
static void anm_init(obj_sc_s* i_this, int param_2, f32 i_morf, u8 i_mode, f32 i_speed) {
i_this->mpModelMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("Npc_ksw", param_2), i_mode, i_morf,
i_speed, 0.0f, -1.0f, NULL);
i_this->field_0x3c = param_2;
}
/* ############################################################################################## */
/* 80CF3008-80CF300C 000008 0004+00 0/4 0/0 0/0 .rodata @3976 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3976 = 5.0f;
COMPILER_STRIP_GATE(0x80CF3008, &lit_3976);
#pragma pop
/* 80CF300C-80CF3010 00000C 0004+00 0/5 0/0 0/0 .rodata @3977 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3977 = 1.0f;
COMPILER_STRIP_GATE(0x80CF300C, &lit_3977);
#pragma pop
/* 80CF3010-80CF3014 000010 0004+00 0/3 0/0 0/0 .rodata @3978 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3978 = 2.0f;
COMPILER_STRIP_GATE(0x80CF3010, &lit_3978);
#pragma pop
/* 80CF3014-80CF3018 000014 0004+00 0/4 0/0 0/0 .rodata @3979 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3979 = 40.0f;
COMPILER_STRIP_GATE(0x80CF3014, &lit_3979);
#pragma pop
/* 80CF3018-80CF301C 000018 0004+00 0/1 0/0 0/0 .rodata @3980 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3980 = 25.0f;
COMPILER_STRIP_GATE(0x80CF3018, &lit_3980);
#pragma pop
/* 80CF301C-80CF3020 00001C 0004+00 0/1 0/0 0/0 .rodata @3981 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3981 = 1700.0f;
COMPILER_STRIP_GATE(0x80CF301C, &lit_3981);
#pragma pop
/* 80CF3020-80CF3024 000020 0004+00 0/1 0/0 0/0 .rodata @3982 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3982 = -35.0f;
COMPILER_STRIP_GATE(0x80CF3020, &lit_3982);
#pragma pop
/* 80CF3024-80CF3028 000024 0004+00 0/2 0/0 0/0 .rodata @3983 */
#pragma push
#pragma force_active on
SECTION_RODATA static f32 const lit_3983 = 30.0f;
COMPILER_STRIP_GATE(0x80CF3024, &lit_3983);
#pragma pop
/* 80CF09A8-80CF1008 0003E8 0660+00 1/1 0/0 0/0 .text sc_build__FP12obj_sw_class */
static void sc_build(obj_sw_class* param_0) {
static void sc_build(obj_sw_class* i_this) {
// NONMATCHING
}
fopAc_ac_c* a_this = &i_this->actor;
obj_sc_s* sc_p = &i_this->field_0x5a8;
cXyz sp24, sp30;
/* 80CF1008-80CF1044 000A48 003C+00 1/1 0/0 0/0 .text __dt__4cXyzFv */
//cXyz::~cXyz() {
void __dt__4cXyzFv() {
// NONMATCHING
for (int i = 0; i < 8; i++) {
if (sc_p->field_0x34 != 0) {
sc_p->field_0x34--;
}
s16 sVar1;
switch (sc_p->field_0x0) {
case 0:
anm_init(sc_p, 14, 5.0f, 2, 1.0f);
sc_p->field_0x0 = 1;
sc_p->field_0x10 = sc_p->field_0x4;
sc_p->field_0x1c.x = sc_path[sc_p->field_0x38].field_0x4;
sc_p->field_0x1c.y = sc_path[sc_p->field_0x38].field_0x8;
sc_p->field_0x1c.z = sc_path[sc_p->field_0x38].field_0xc;
break;
case 1:
sp24 = sc_p->field_0x1c - sc_p->field_0x4;
cLib_addCalcAngleS2(&sc_p->field_0x2a, cM_atan2s(sp24.x, sp24.z), 1, 0x2000);
if (sc_p->field_0x34 == 0) {
sc_p->field_0x0 = 2;
anm_init(sc_p, 11, 2.0f, 0, 1.0f);
}
break;
case 2:
if (sc_path[sc_p->field_0x38].field_0x0 == 1) {
if (sc_p->field_0x3c == 11) {
if (sc_p->mpModelMorf->isStop()) {
anm_init(sc_p, 12, 1.0f, 0, 1.0f);
sc_p->mSound.startSound(Z2SE_KOSARU_V_JUMP, 0, -1);
sc_p->mSound.startSound(Z2SE_KOSARU_JUMP_START, 0, -1);
sc_p->mSound.startSound(Z2SE_KOSARU_JUMP_WIND, 0, -1);
sc_p->field_0x30 = 40.0f;
}
}
} else {
sc_p->field_0x30 = 25.0f;
}
sp24 = sc_p->field_0x1c - sc_p->field_0x4;
sVar1 = cM_atan2s(sp24.x, sp24.z);
cLib_addCalcAngleS2(&sc_p->field_0x2a, sVar1, 1, 0x2000);
cMtx_YrotS(*calc_mtx, sVar1);
cMtx_XrotM(*calc_mtx, -cM_atan2s(sp24.y, JMAFastSqrt(sp24.x * sp24.x + sp24.z * sp24.z)));
sp24.x = 0.0f;
sp24.y = 0.0f;
sp24.z = sc_p->field_0x30;
MtxPosition(&sp24, &sp30);
sc_p->field_0x4 += sp30;
sp24 = sc_p->field_0x1c - sc_p->field_0x4;
if ((sp24.x * sp24.x + sp24.z * sp24.z) <= 1700.0f) {
sc_p->field_0x4 = sc_p->field_0x1c;
if (sc_p->field_0x38 == 16) {
sc_p->field_0x0 = 3;
anm_init(sc_p, 4, 2.0f, 2, 2.0f);
sc_p->field_0x30 = 0.0f;
sc_p->mSound.startSound(Z2SE_KOSARU_V_WAIT, 0, -1);
} else {
sc_p->field_0x38++;
sc_p->field_0x10 = sc_p->field_0x4;
sc_p->field_0x1c.x = sc_path[sc_p->field_0x38].field_0x4;
sc_p->field_0x1c.y = sc_path[sc_p->field_0x38].field_0x8;
sc_p->field_0x1c.z = sc_path[sc_p->field_0x38].field_0xc;
if (sc_path[sc_p->field_0x38].field_0x0 == 1) {
anm_init(sc_p, 11, 2.0f, 0, 1.0f);
sc_p->field_0x30 = 0.0f;
} else if (sc_p->field_0x3c != 10) {
anm_init(sc_p, 10, 2.0f, 2, 1.0f);
}
}
}
break;
case 3:
cLib_addCalcAngleS2(&sc_p->field_0x2a, a_this->current.angle.y + 0x8000, 2, 0x1000);
cMtx_YrotS(*calc_mtx, sc_p->field_0x2a);
sp24.x = 0.0f;
sp24.y = 0.0f;
sp24.z = -35.0f;
MtxPosition(&sp24, &sp30);
cLib_addCalc2(&sc_p->field_0x4.x, a_this->eyePos.x + sp30.x, 1.0f, 30.0f);
cLib_addCalc2(&sc_p->field_0x4.y, a_this->eyePos.y, 1.0f, 30.0f);
cLib_addCalc2(&sc_p->field_0x4.z, a_this->eyePos.z + sp30.z, 1.0f, 30.0f);
if (sc_p->field_0x4.y <= a_this->eyePos.y + 1.0f) {
sp24 = sc_p->field_0x4 - a_this->eyePos;
anm_init(sc_p, 13, 5.0f, 0, 1.0f);
sc_p->field_0x0 = 10;
sc_p->mSound.startSound(Z2SE_KOSARU_V_WAIT, 0, -1);
if (i == 7) {
i_this->field_0x576 = 2;
i_this->field_0x57c = 120;
int swBit = fopAcM_GetParam(a_this) >> 24;
if (swBit != 0xFF) {
dComIfGs_onSwitch(swBit, fopAcM_GetRoomNo(a_this));
}
}
}
}
if (sc_p->field_0x30 >= 30.0f) {
sc_p->field_0x35 = 1;
}
sc_p = (obj_sc_s *)((s8*)sc_p + 100);
}
}
/* ############################################################################################## */
@@ -360,8 +445,21 @@ COMPILER_STRIP_GATE(0x80CF3060, &lit_4067);
#pragma pop
/* 80CF1044-80CF1384 000A84 0340+00 1/1 0/0 0/0 .text sc_move__FP12obj_sw_class */
static void sc_move(obj_sw_class* param_0) {
static void sc_move(obj_sw_class* i_this) {
// NONMATCHING
cXyz sp24, sp30;
if (i_this->field_0x864.field_0x68 == 0) {
if (i_this->field_0x57a == 0) {
if (cM_rndF(1.0f) >= 0.2f) {
if (cM_rndF(1.0f) >= 0.33f) {
if (cM_rndF(1.0f) >= 0.5f) {
}
}
}
}
}
}
/* ############################################################################################## */