summaryrefslogtreecommitdiff
path: root/src/d/actor
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2024-01-15 04:47:27 -0500
committerLagoLunatic <LagoLunatic@users.noreply.github.com>2024-01-15 04:47:27 -0500
commit8485e571b4db3dbf63427ebce70019b66a0f0eb3 (patch)
tree8ff24b557b45ccf4a06ecf580d8a2a8828af706f /src/d/actor
parentf5773a44d1008c1dca01575e03431e09d9a95032 (diff)
d_a_player_main work
Diffstat (limited to 'src/d/actor')
-rw-r--r--src/d/actor/d_a_hookshot.cpp8
-rw-r--r--src/d/actor/d_a_nh.cpp2
-rw-r--r--src/d/actor/d_a_npc_kamome.cpp4
-rw-r--r--src/d/actor/d_a_obj_barrier.cpp2
-rw-r--r--src/d/actor/d_a_obj_mknjd.cpp10
-rw-r--r--src/d/actor/d_a_obj_paper.cpp2
-rw-r--r--src/d/actor/d_a_obj_toripost.cpp4
-rw-r--r--src/d/actor/d_a_player_main.cpp469
-rw-r--r--src/d/actor/d_a_player_main_data.inc14
-rw-r--r--src/d/actor/d_a_player_particle.inc122
-rw-r--r--src/d/actor/d_a_player_sword.inc107
-rw-r--r--src/d/actor/d_a_player_tact.inc8
-rw-r--r--src/d/actor/d_a_swhit0.cpp6
-rw-r--r--src/d/actor/d_a_tag_msg.cpp2
-rw-r--r--src/d/actor/d_a_tbox.cpp6
15 files changed, 523 insertions, 243 deletions
diff --git a/src/d/actor/d_a_hookshot.cpp b/src/d/actor/d_a_hookshot.cpp
index 053ba423..f12184ab 100644
--- a/src/d/actor/d_a_hookshot.cpp
+++ b/src/d/actor/d_a_hookshot.cpp
@@ -104,9 +104,11 @@ static u8 l_matDL[] ALIGN_DECL(32) = {
0x61, 0x94, ((u32)&l_chainS3TCTEX >> 0x05 >> 0x10), ((u32)&l_chainS3TCTEX >> 0x05 >> 0x08), ((u32)&l_chainS3TCTEX >> 0x05 >> 0x00),
0x61, 0x30, 0x00, (l_chainS3TCTEX__width >> 0x08), (l_chainS3TCTEX__width >> 0x00),
0x61, 0x31, 0x00, (l_chainS3TCTEX__height >> 0x08), (l_chainS3TCTEX__height >> 0x00),
- 0x10, 0x00, 0x00, 0x10, 0x40, 0xFF, 0xFF, 0x42, 0x80, 0x08, 0x30, 0x3C, 0xF3, 0xCF, 0x00,
+ 0x10, 0x00, 0x00, 0x10, 0x40, 0xFF, 0xFF, 0x42, 0x80,
+ 0x08, 0x30, 0x3C, 0xF3, 0xCF, 0x00,
0x10, 0x00, 0x00, 0x10, 0x18, 0x3C, 0xF3, 0xCF, 0x00,
- 0x10, 0x00, 0x00, 0x10, 0x0E, 0x00, 0x00, 0x05, 0x43, 0x61, 0x28, 0x3C, 0x00, 0x00,
+ 0x10, 0x00, 0x00, 0x10, 0x0E, 0x00, 0x00, 0x05, 0x43,
+ 0x61, 0x28, 0x3C, 0x00, 0x00,
0x61, 0xC0, 0x08, 0x24, 0xAF,
0x61, 0xC1, 0x08, 0xFF, 0xF0,
0x61, 0x28, 0x3C, 0x00, 0x00,
@@ -169,7 +171,7 @@ void daHookshot_shape::draw() {
chain_pos += chain_offset;
}
- J3DShape::sOldVcdVatCmd = NULL;
+ J3DShape::resetVcdVatCache();
}
/* 800F12C8-800F1324 .text draw__12daHookshot_cFv */
diff --git a/src/d/actor/d_a_nh.cpp b/src/d/actor/d_a_nh.cpp
index 107f8073..e3fe6673 100644
--- a/src/d/actor/d_a_nh.cpp
+++ b/src/d/actor/d_a_nh.cpp
@@ -209,7 +209,7 @@ BOOL daNh_c::checkBinCatch() {
l_HIO.prm.field_0x10, l_HIO.prm.field_0x3c,
1
);
- mEvtInfo.onCondition(0x40);
+ mEvtInfo.onCondition(dEvtCnd_CANCATCH_e);
return FALSE;
}
diff --git a/src/d/actor/d_a_npc_kamome.cpp b/src/d/actor/d_a_npc_kamome.cpp
index 30fc5e90..4c6b0ed1 100644
--- a/src/d/actor/d_a_npc_kamome.cpp
+++ b/src/d/actor/d_a_npc_kamome.cpp
@@ -445,8 +445,8 @@ BOOL daNpc_kam_c::init() {
mEventIdxs[i] = dComIfGp_evmng_getEventIdx(event_name_tbl[i], 0xFF);
}
- mEvtInfo.mpCheckCB = &daNpc_kam_XyCheckCB;
- mEvtInfo.mpEventCB = &daNpc_kam_XyEventCB;
+ mEvtInfo.setXyCheckCB(daNpc_kam_XyCheckCB);
+ mEvtInfo.setXyEventCB(daNpc_kam_XyEventCB);
return TRUE;
}
diff --git a/src/d/actor/d_a_obj_barrier.cpp b/src/d/actor/d_a_obj_barrier.cpp
index f290b0ac..0b8f09d0 100644
--- a/src/d/actor/d_a_obj_barrier.cpp
+++ b/src/d/actor/d_a_obj_barrier.cpp
@@ -257,7 +257,7 @@ void daObjBarrier_c::break_order_proc() {
mBarrierProc = PROC_BREAK_END_WAIT;
} else {
fopAcM_orderOtherEventId(this, mEventID);
- mEvtInfo.onCondition(2);
+ mEvtInfo.onCondition(dEvtCnd_UNK2_e);
}
}
diff --git a/src/d/actor/d_a_obj_mknjd.cpp b/src/d/actor/d_a_obj_mknjd.cpp
index b84cdf2a..2959d445 100644
--- a/src/d/actor/d_a_obj_mknjd.cpp
+++ b/src/d/actor/d_a_obj_mknjd.cpp
@@ -283,8 +283,8 @@ int daObjMknjD::Act_c::Create() {
if (checkItemGet(mGiveItemNo, 1) == 0) {
m043F = 8;
- mEvtInfo.mpCheckCB = daObjMknjD_XyCheckCB;
- mEvtInfo.mpEventCB = daObjMknjD_XyEventCB;
+ mEvtInfo.setXyCheckCB(daObjMknjD_XyCheckCB);
+ mEvtInfo.setXyEventCB(daObjMknjD_XyEventCB);
}
else {
m043F = 0;
@@ -710,7 +710,7 @@ int daObjMknjD::Act_c::Execute(Mtx** i_mtx) {
switch (m043F) {
case 0:
- mEvtInfo.onCondition(1);
+ mEvtInfo.onCondition(dEvtCnd_CANTALK_e);
if (mEvtInfo.checkCommandTalk()) {
m0500 = 1;
@@ -835,8 +835,8 @@ int daObjMknjD::Act_c::Execute(Mtx** i_mtx) {
break;
case 8:
- mEvtInfo.onCondition(1);
- mEvtInfo.onCondition(32);
+ mEvtInfo.onCondition(dEvtCnd_CANTALK_e);
+ mEvtInfo.onCondition(dEvtCnd_CANTALKITEM_e);
if (mEvtInfo.checkCommandTalk()) {
if (dComIfGp_event_chkTalkXY()) {
diff --git a/src/d/actor/d_a_obj_paper.cpp b/src/d/actor/d_a_obj_paper.cpp
index c00a1304..89c5f43d 100644
--- a/src/d/actor/d_a_obj_paper.cpp
+++ b/src/d/actor/d_a_obj_paper.cpp
@@ -172,7 +172,7 @@ namespace daObjPaper {
mode_talk0_init();
}
else {
- mEvtInfo.mCondition |= dEvtCnd_CANTALK_e;
+ mEvtInfo.onCondition(dEvtCnd_CANTALK_e);
}
}
diff --git a/src/d/actor/d_a_obj_toripost.cpp b/src/d/actor/d_a_obj_toripost.cpp
index 9a1c2dd4..bba5528a 100644
--- a/src/d/actor/d_a_obj_toripost.cpp
+++ b/src/d/actor/d_a_obj_toripost.cpp
@@ -525,8 +525,8 @@ void daObjTpost_c::eventOrder() {
};
if(field_0x8F7 == 1 || field_0x8F7 == 2) {
- mEvtInfo.onCondition(1);
- mEvtInfo.onCondition(0x20);
+ mEvtInfo.onCondition(dEvtCnd_CANTALK_e);
+ mEvtInfo.onCondition(dEvtCnd_CANTALKITEM_e);
if(field_0x8F7 == 1) {
fopAcM_orderSpeakEvent(this);
diff --git a/src/d/actor/d_a_player_main.cpp b/src/d/actor/d_a_player_main.cpp
index 288b8471..20b07deb 100644
--- a/src/d/actor/d_a_player_main.cpp
+++ b/src/d/actor/d_a_player_main.cpp
@@ -29,73 +29,70 @@
#include "d/actor/d_a_boko.h"
#include "SSystem/SComponent/c_counter.h"
-#include "d/actor/d_a_player_main_data.inc"
-
-#include "d/actor/d_a_player_HIO.inc"
-
Vec dummy_3569;
JGeometry::TVec3<f32> l_hammer_splash_particle_scale(0.00002f, 0.00002f, 0.00002f);
-GXColor l_freeze_fade_color = {0xFF, 0xFF, 0xFF, 0xFF};
-
cXyz l_debug_keep_pos;
csXyz l_debug_current_angle;
csXyz l_debug_shape_angle;
-u8 daPy_matAnm_c::m_maba_flg;
-u8 daPy_matAnm_c::m_eye_move_flg;
-u8 daPy_matAnm_c::m_maba_timer;
-u8 daPy_matAnm_c::m_morf_frame;
-
-s16 daPy_dmEcallBack_c::m_timer = 0;
-u16 daPy_dmEcallBack_c::m_type = 3;
-
-u8 right_dir_4883[0xC];
-u8 texObj_5157[0x20];
+#include "d/actor/d_a_player_main_data.inc"
-daPy_waterDropPcallBack_c daPy_waterDropEcallBack_c::m_pcallback;
+#include "d/actor/d_a_player_HIO.inc"
-u8 normal_ripple_scale_5638[0xC];
-u8 small_ripple_scale_5641[0xC];
-u8 waterfall_splash_trans_5699[0xC];
-u8 run_splash_scale_6040[0xC];
-u8 run_grass_scale_6043[0xC];
-u8 heavy_emit_smoke_scale_6046[0xC];
-u8 heavy_dyn_smoke_scale_6049[0xC];
-u8 heavy_pat_smoke_scale_6052[0xC];
-u8 tail_scale_6508[0xC];
-u8 arm_flame_scale_6651[0xC];
-u8 _6785[0xC];
-u8 eff_scale0_6784[0xC];
-u8 _6789[0xC];
-u8 eff_scale2_6788[0xC];
-u8 direction_6792[0xC];
-u8 splash_scale_14445[0xC];
-u8 ripple_scale_14448[0xC];
-u8 _15293[0xC];
-u8 arm_pos_15292[0xC];
-u8 _15297[0xC];
-u8 armA_offset_15296[0xC];
-u8 dynamic_scale_16750[0xC];
-u8 particle_scale_16753[0xC];
-u8 _17480[0xC];
-u8 local_height_offset_17479[0xC];
-u8 eff_scale_18886[0xC];
-u8 eff_dscale_18889[0xC];
-u8 eff_pscale_18892[0xC];
-u8 smoke_kusa_particle_scale_21005[0xC];
-u8 emitter_scale_21008[0xC];
-u8 emitter_trans_21011[0xC];
-u8 d_scale_23162[0xC];
-u8 p_scale_23165[0xC];
-u8 emitter_trans_24824[0xC];
-u8 particle_scale_24827[0xC];
-u8 root_mtx_25647[0x30];
+static u8 l_sightDL[] ALIGN_DECL(32) = {
+ 0x10, 0x00, 0x00, 0x10, 0x40, 0xFF, 0xFF, 0x42, 0x00, 0x00, 0x00, 0x00, 0xF3, 0xCF, 0x00,
+ 0x10, 0x00, 0x00, 0x10, 0x18, 0x3C, 0xF3, 0xCF, 0x00,
+ 0x61, 0x28, 0x38, 0x03, 0xC0,
+ 0x61, 0xC0, 0x08, 0x42, 0x8F,
+ 0x61, 0xC1, 0x08, 0xE6, 0x70,
+ 0x61, 0x43, 0x00, 0x00, 0x01,
+ 0x61, 0x40, 0x00, 0x00, 0x06,
+ 0x61, 0x41, 0x00, 0x04, 0xAD,
+ 0x61, 0xF3, 0x64, 0x00, 0x00,
+ 0x10, 0x00, 0x00, 0x10, 0x3F, 0x00, 0x00, 0x00, 0x01,
+ 0x10, 0x00, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x00,
+ 0x61, 0x00, 0x00, 0x00, 0x01,
+ 0x98, 0x00, 0x04, 0x01, 0x01, 0x00, 0x01,
+ 0x01, 0xFF, 0x01, 0x00, 0x00, 0x01, 0x01, 0xFF, 0x00, 0x01, 0x00, 0xFF, 0xFF,
+
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00,
+};
-static mDoExt_offCupOnAupPacket l_offCupOnAupPacket1;
-static mDoExt_offCupOnAupPacket l_offCupOnAupPacket2;
-static mDoExt_onCupOffAupPacket l_onCupOffAupPacket1;
-static mDoExt_onCupOffAupPacket l_onCupOffAupPacket2;
+static Vec waterfall_ripple_scale_5702 = {0.75f, 0.75f, 0.75f};
+static Vec grass_scale_6038 = {1.5f, 1.5f, 1.5f};
+static Vec smoke_scale_6039 = {1.25f, 1.25f, 1.25f};
+static Vec eff_scale_24884 = {1.5f, 1.5f, 1.5f};
+static Quaternion norm_quat_25648 = {0.0f, 0.0f, 0.0f, 1.0f};
+static Vec top_vec_29499 = {0.0f, 70.0f, 0.0f};
+
+const u16 aura_emitter_joint_5412[] = {
+ 0x0007, 0x000B,
+ 0x0008, 0x000C,
+ 0x0021, 0x0026,
+ 0x0022, 0x0027,
+ 0x0000, 0x000F,
+};
+const u16 aura_model_joint_5413[] = {
+ 0x0000, 0x000F,
+ 0x0008, 0x000C,
+ 0x0021, 0x0026,
+};
+const Vec wave_offset_5635 = {0.0f, 18.0f, 0.0f};
+const Vec swim_offset_5636 = {0.0f, 30.0f, 0.0f};
+const Vec swim_side_offset_5637 = {0.0f, 0.0f, 30.0f};
+const u16 eff_joint_8128[] = {
+ 0x0007, 0x000B,
+ 0x001A, 0x000E,
+ 0x001E,
+};
+const Vec ripple_scale_8193 = {0.75f, 0.75f, 0.75f};
+const Vec splash_scale_21927 = {0.3f, 0.3f, 0.3f};
+const Vec ripple_scale_21928 = {0.5f, 0.5f, 0.5f};
static void dummydatafunc(f32* temp, f64* temp2) {
// temporary hack to improve diffs until sdata2 offsets are figured out
@@ -147,85 +144,177 @@ static void dummydatafunc(f32* temp, f64* temp2) {
*temp = 11.0f;
*temp = 17.5f;
*temp = 1000000000.0f;
- OSReport("Adanmae");
- OSReport("d_a_player_dproc.inc");
- OSReport("0");
- OSReport("Halt");
- OSReport("Link");
- OSReport("DEFAULT_GETITEM");
- OSReport("GanonK");
- OSReport("GTower");
- OSReport("d_a_player_bow.inc");
- OSReport("d_a_player_hook.inc");
- OSReport("d_a_player_fan.inc");
- OSReport("d_a_player_hammer.inc");
- OSReport("Type");
- OSReport("Omori");
- OSReport("d_a_player_sword.inc");
- OSReport("M_DaiB");
- OSReport("Xboss2");
- OSReport("M_DragB");
- OSReport("Xboss0");
- OSReport("fall");
- OSReport("d_a_player_main.cpp");
- OSReport("(demo_mode < daPy_demo_c::DEMO_LAST_e) || (demo_mode == daPy_demo_c::DEMO_NEW_ANM0_e)");
- OSReport("Ojhous");
- OSReport("Orichh");
- OSReport("kinBOSS");
- OSReport("Xboss1");
- OSReport("ICE_FAILED");
- OSReport("pos");
- OSReport("angle");
- OSReport("prm0");
- OSReport("prm1");
- OSReport("stick");
- OSReport("face");
- OSReport("GanonM");
- OSReport("sea");
- OSReport("m_tex_anm_heap.m_buffer != 0");
- OSReport("m_texNoAnms != 0");
- OSReport("mat_anm != 0");
- OSReport("m_tex_scroll_heap.m_buffer != 0");
- OSReport("material_num == 2");
- OSReport("m_texMtxAnm != 0");
- OSReport("m_tex_eye_scroll[no] != 0");
- OSReport("tmtx != 0");
- OSReport("mtl->getMaterialAnm() != 0");
- OSReport("tmp_modelData != 0");
- OSReport("aura_p->getModel() != 0");
- OSReport("m_old_fdata != 0");
- OSReport("m_pbCalc[PART_UNDER_e] != 0");
- OSReport("m_pbCalc[PART_UPPER_e] != 0");
- OSReport("m_HIO != 0");
- OSReport("m_anm_heap_under[UNDER_MOVE0_e].m_buffer != 0");
- OSReport("m_sanm_buffer != 0");
- OSReport("m_item_bck_buffer != 0");
- OSReport("tmp_trans_bas != 0");
- OSReport("tmp_trans != 0");
- OSReport("tmp_tp != 0");
- OSReport("tmp_tk != 0");
- OSReport("*i_model != 0");
- OSReport("btk_anm != 0");
- OSReport("brk_anm != 0");
- OSReport("zoff_blend_cnt <= 4");
- OSReport("zoff_none_cnt <= 4");
- OSReport("zon_cnt <= 4");
- OSReport("zon_cnt == 4");
- OSReport("zoff_none_cnt == 4");
- OSReport("zoff_blend_cnt == 4");
- OSReport("dummy_data != 0");
- OSReport("Always");
- OSReport("tmp_tex != 0");
- OSReport("tmp_img != 0");
- OSReport("texture != 0");
- OSReport("textureName != 0");
- OSReport("linktexS3TC");
- OSReport("Pjavdou");
- OSReport("ShipD");
- OSReport("Siren");
- OSReport("data_size < l_sanm_buffer_size");
+ OSReport("Adanmae");
+ OSReport("d_a_player_dproc.inc");
+ OSReport("0");
+ OSReport("Halt");
+ OSReport("Link");
+ OSReport("DEFAULT_GETITEM");
+ OSReport("GanonK");
+ OSReport("GTower");
+ OSReport("d_a_player_bow.inc");
+ OSReport("d_a_player_hook.inc");
+ OSReport("d_a_player_fan.inc");
+ OSReport("d_a_player_hammer.inc");
+ OSReport("Type");
+ OSReport("Omori");
+ OSReport("d_a_player_sword.inc");
+ OSReport("M_DaiB");
+ OSReport("Xboss2");
+ OSReport("M_DragB");
+ OSReport("Xboss0");
+ OSReport("fall");
+ OSReport("d_a_player_main.cpp");
+ OSReport("(demo_mode < daPy_demo_c::DEMO_LAST_e) || (demo_mode == daPy_demo_c::DEMO_NEW_ANM0_e)");
+ OSReport("Ojhous");
+ OSReport("Orichh");
+ OSReport("kinBOSS");
+ OSReport("Xboss1");
+ OSReport("ICE_FAILED");
+ OSReport("pos");
+ OSReport("angle");
+ OSReport("prm0");
+ OSReport("prm1");
+ OSReport("stick");
+ OSReport("face");
+ OSReport("GanonM");
+ OSReport("sea");
+ OSReport("m_tex_anm_heap.m_buffer != 0");
+ OSReport("m_texNoAnms != 0");
+ OSReport("mat_anm != 0");
+ OSReport("m_tex_scroll_heap.m_buffer != 0");
+ OSReport("material_num == 2");
+ OSReport("m_texMtxAnm != 0");
+ OSReport("m_tex_eye_scroll[no] != 0");
+ OSReport("tmtx != 0");
+ OSReport("mtl->getMaterialAnm() != 0");
+ OSReport("tmp_modelData != 0");
+ OSReport("aura_p->getModel() != 0");
+ OSReport("m_old_fdata != 0");
+ OSReport("m_pbCalc[PART_UNDER_e] != 0");
+ OSReport("m_pbCalc[PART_UPPER_e] != 0");
+ OSReport("m_HIO != 0");
+ OSReport("m_anm_heap_under[UNDER_MOVE0_e].m_buffer != 0");
+ OSReport("m_sanm_buffer != 0");
+ OSReport("m_item_bck_buffer != 0");
+ OSReport("tmp_trans_bas != 0");
+ OSReport("tmp_trans != 0");
+ OSReport("tmp_tp != 0");
+ OSReport("tmp_tk != 0");
+ OSReport("*i_model != 0");
+ OSReport("btk_anm != 0");
+ OSReport("brk_anm != 0");
+ OSReport("zoff_blend_cnt <= 4");
+ OSReport("zoff_none_cnt <= 4");
+ OSReport("zon_cnt <= 4");
+ OSReport("zon_cnt == 4");
+ OSReport("zoff_none_cnt == 4");
+ OSReport("zoff_blend_cnt == 4");
+ OSReport("dummy_data != 0");
+ OSReport("Always");
+ OSReport("tmp_tex != 0");
+ OSReport("tmp_img != 0");
+ OSReport("texture != 0");
+ OSReport("textureName != 0");
+ OSReport("linktexS3TC");
+ OSReport("Pjavdou");
+ OSReport("ShipD");
+ OSReport("Siren");
+ OSReport("data_size < l_sanm_buffer_size");
}
+GXColor l_freeze_fade_color = {0xFF, 0xFF, 0xFF, 0xFF};
+
+u8 daPy_matAnm_c::m_maba_flg;
+u8 daPy_matAnm_c::m_eye_move_flg;
+u8 daPy_matAnm_c::m_maba_timer;
+u8 daPy_matAnm_c::m_morf_frame;
+
+#include "d/actor/d_a_player_particle.inc"
+
+#include "d/actor/d_a_player_dproc.inc"
+
+#include "d/actor/d_a_player_ladder.inc"
+
+#include "d/actor/d_a_player_hang.inc"
+
+#include "d/actor/d_a_player_climb.inc"
+
+#include "d/actor/d_a_player_whide.inc"
+
+#include "d/actor/d_a_player_crawl.inc"
+
+#include "d/actor/d_a_player_grab.inc"
+
+#include "d/actor/d_a_player_swim.inc"
+
+#include "d/actor/d_a_player_battle.inc"
+
+#include "d/actor/d_a_player_ship.inc"
+
+#include "d/actor/d_a_player_rope.inc"
+
+#include "d/actor/d_a_player_boomerang.inc"
+
+#include "d/actor/d_a_player_bow.inc"
+
+#include "d/actor/d_a_player_hook.inc"
+
+#include "d/actor/d_a_player_fan.inc"
+
+#include "d/actor/d_a_player_tact.inc"
+
+#include "d/actor/d_a_player_vomit.inc"
+
+#include "d/actor/d_a_player_hammer.inc"
+
+#include "d/actor/d_a_player_pushpull.inc"
+
+#include "d/actor/d_a_player_bottle.inc"
+
+#include "d/actor/d_a_player_weapon.inc"
+
+#include "d/actor/d_a_player_food.inc"
+
+#include "d/actor/d_a_player_sword.inc"
+
+u8 normal_ripple_scale_5638[0xC];
+u8 small_ripple_scale_5641[0xC];
+u8 waterfall_splash_trans_5699[0xC];
+u8 run_splash_scale_6040[0xC];
+u8 run_grass_scale_6043[0xC];
+u8 heavy_emit_smoke_scale_6046[0xC];
+u8 heavy_dyn_smoke_scale_6049[0xC];
+u8 heavy_pat_smoke_scale_6052[0xC];
+u8 tail_scale_6508[0xC];
+u8 arm_flame_scale_6651[0xC];
+u8 _6785[0xC];
+u8 eff_scale0_6784[0xC];
+u8 _6789[0xC];
+u8 eff_scale2_6788[0xC];
+u8 direction_6792[0xC];
+u8 splash_scale_14445[0xC];
+u8 ripple_scale_14448[0xC];
+u8 _15293[0xC];
+u8 arm_pos_15292[0xC];
+u8 _15297[0xC];
+u8 armA_offset_15296[0xC];
+u8 dynamic_scale_16750[0xC];
+u8 particle_scale_16753[0xC];
+u8 _17480[0xC];
+u8 local_height_offset_17479[0xC];
+u8 eff_scale_18886[0xC];
+u8 eff_dscale_18889[0xC];
+u8 eff_pscale_18892[0xC];
+u8 smoke_kusa_particle_scale_21005[0xC];
+u8 emitter_scale_21008[0xC];
+u8 emitter_trans_21011[0xC];
+u8 d_scale_23162[0xC];
+u8 p_scale_23165[0xC];
+u8 emitter_trans_24824[0xC];
+u8 particle_scale_24827[0xC];
+u8 root_mtx_25647[0x30];
+
/* 80102E8C-80102EAC .text daPy_createHeap__FP10fopAc_ac_c */
static BOOL daPy_createHeap(fopAc_ac_c* i_this) {
return static_cast<daPy_lk_c*>(i_this)->createHeap();
@@ -427,6 +516,11 @@ static BOOL daPy_jointCallback1(J3DNode* node, int param_1) {
return TRUE;
}
+static mDoExt_offCupOnAupPacket l_offCupOnAupPacket1;
+static mDoExt_offCupOnAupPacket l_offCupOnAupPacket2;
+static mDoExt_onCupOffAupPacket l_onCupOffAupPacket1;
+static mDoExt_onCupOffAupPacket l_onCupOffAupPacket2;
+
/* 801041B4-801041EC .text setAnimeHeap__9daPy_lk_cFP12JKRSolidHeap */
JKRHeap* daPy_lk_c::setAnimeHeap(JKRSolidHeap* animeHeap) {
animeHeap->freeAll();
@@ -444,12 +538,12 @@ JKRHeap* daPy_lk_c::setItemHeap() {
/* 80104240-80104280 .text setBlurPosResource__9daPy_lk_cFUs */
void daPy_lk_c::setBlurPosResource(u16 index) {
- dComIfGp_getAnmArchive()->readIdxResource(mSwBlur.mpPosBuffer, 0x4800, index);
+ JKRReadIdxResource(mSwBlur.mpPosBuffer, 0x4800, index, dComIfGp_getAnmArchive());
}
/* 80104280-80104364 .text getItemAnimeResource__9daPy_lk_cFUs */
J3DAnmTransform* daPy_lk_c::getItemAnimeResource(u16 index) {
- dComIfGp_getAnmArchive()->readIdxResource(m_item_bck_buffer, 0x1000, index);
+ JKRReadIdxResource(m_item_bck_buffer, 0x1000, index, dComIfGp_getAnmArchive());
JKRHeap* oldHeap = setAnimeHeap(m2ECC);
mDoExt_transAnmBas* bas = new mDoExt_transAnmBas(NULL);
J3DAnmLoaderDataBase::setResource(bas, m_item_bck_buffer);
@@ -460,7 +554,7 @@ J3DAnmTransform* daPy_lk_c::getItemAnimeResource(u16 index) {
/* 80104364-801043F0 .text getAnimeResource__9daPy_lk_cFP14daPy_anmHeap_cUsUl */
J3DAnmTransform* daPy_lk_c::getAnimeResource(daPy_anmHeap_c* anmHeap, u16 index, u32 bufferSize) {
J3DAnmTransform* bck;
- dComIfGp_getAnmArchive()->readIdxResource(anmHeap->m_buffer, bufferSize, index);
+ JKRReadIdxResource(anmHeap->m_buffer, bufferSize, index, dComIfGp_getAnmArchive());
JKRHeap* oldHeap = setAnimeHeap(anmHeap->mpAnimeHeap);
bck = static_cast<J3DAnmTransform*>(J3DAnmLoaderDataBase::load(anmHeap->m_buffer));
mDoExt_setCurrentHeap(oldHeap);
@@ -506,9 +600,9 @@ void daPy_lk_c::setTextureAnimeResource(J3DAnmTexPattern* btp, int r31) {
J3DAnmTexPattern* daPy_lk_c::loadTextureAnimeResource(u32 btpIdx, BOOL isDemo) {
J3DAnmTexPattern* btp;
if (isDemo) {
- dComIfGp_getLkDemoAnmArchive()->readResource(m_tex_anm_heap.m_buffer, 0x1000, btpIdx);
+ JKRReadResource(m_tex_anm_heap.m_buffer, 0x1000, btpIdx, dComIfGp_getLkDemoAnmArchive());
} else {
- dComIfGp_getAnmArchive()->readIdxResource(m_tex_anm_heap.m_buffer, 0x1000, btpIdx);
+ JKRReadIdxResource(m_tex_anm_heap.m_buffer, 0x1000, btpIdx, dComIfGp_getAnmArchive());
}
JKRHeap* oldHeap = setAnimeHeap(m_tex_anm_heap.mpAnimeHeap);
btp = static_cast<J3DAnmTexPattern*>(J3DAnmLoaderDataBase::load(m_tex_anm_heap.m_buffer));
@@ -631,9 +725,9 @@ void daPy_lk_c::setTextureScrollResource(J3DAnmTextureSRTKey* btk, int r31) {
J3DAnmTextureSRTKey* daPy_lk_c::loadTextureScrollResource(u32 btkIdx, BOOL isDemo) {
J3DAnmTextureSRTKey* btk;
if (isDemo) {
- dComIfGp_getLkDemoAnmArchive()->readResource(m_tex_scroll_heap.m_buffer, 0x800, btkIdx);
+ JKRReadResource(m_tex_scroll_heap.m_buffer, 0x800, btkIdx, dComIfGp_getLkDemoAnmArchive());
} else {
- dComIfGp_getAnmArchive()->readIdxResource(m_tex_scroll_heap.m_buffer, 0x800, btkIdx);
+ JKRReadIdxResource(m_tex_scroll_heap.m_buffer, 0x800, btkIdx, dComIfGp_getAnmArchive());
}
JKRHeap* oldHeap = setAnimeHeap(m_tex_scroll_heap.mpAnimeHeap);
btk = static_cast<J3DAnmTextureSRTKey*>(J3DAnmLoaderDataBase::load(m_tex_scroll_heap.m_buffer));
@@ -918,8 +1012,7 @@ BOOL daPy_lk_c::draw() {
} else {
hideHatAndBackle(link_root_joint->getMesh());
}
- bool r4 = dComIfGs_getSelectEquip(0) == SWORD || dComIfGp_getMiniGameType() == 2; // TODO this may be an inline
- if (!r4 && dStage_stagInfo_GetSTType(dComIfGp_getStageStagInfo()) != dStageType_FF1_e ||
+ if (!checkNormalSwordEquip() && dStage_stagInfo_GetSTType(dComIfGp_getStageStagInfo()) != dStageType_FF1_e ||
checkCaughtShapeHide() || checkDemoShieldNoDraw())
{
mpCLModelData->getJointNodePointer(0x0D)->getMesh()->getShape()->hide(); // cl_podA joint
@@ -1165,6 +1258,8 @@ void daPy_lk_c::setNormalSpeedF(f32, f32, f32, f32) {
/* 80108D80-8010959C .text posMoveFromFootPos__9daPy_lk_cFv */
void daPy_lk_c::posMoveFromFootPos() {
/* Nonmatching */
+ static const Vec rtoe_pos_offset = {-14.05f, 0.0f, 5.02f};
+ static const Vec rheel_pos_offset = {-10.85f, 0.0f, -6.52f};
}
/* 8010959C-80109E80 .text posMove__9daPy_lk_cFv */
@@ -1373,17 +1468,17 @@ void daPy_lk_c::deleteEquipItem(BOOL param_1) {
mSwordAnim.changeBckOnly(NULL);
}
m2EAC = NULL;
- mpHeldItemModelAnimTexEx = NULL;
+ mpHeldItemBtk = NULL;
mpBottleContentsModel = NULL;
mpBottleCapModel = NULL;
- mpHeldItemAnimBRK = NULL;
- mpSwordAnimBTK = NULL;
+ mpHeldItemBrk = NULL;
+ mpSwordBtk = NULL;
mpSwordModel1 = NULL;
m3454.end();
mpSwordTipStabModel = NULL;
- m2EF8 = 0;
- m2EF4 = 0;
- m2EF0 = 0;
+ mpCutfBrk2EF8 = 0;
+ mpCutfBtk = 0;
+ mpCutfBpk = 0;
offNoResetFlg1(daPyFlg1_UNK200000);
}
@@ -1420,7 +1515,7 @@ void daPy_lk_c::returnKeepItemData() {
if (mHeldItemType == 0x10B) {
mHeldItemType = 0x100;
} else if (mHeldItemType == 0x103) {
- setSwordModel(1);
+ setSwordModel(TRUE);
} else {
makeItemType();
}
@@ -1926,6 +2021,7 @@ void daPy_lk_c::changeAutoJumpProc() {
/* 80111424-80111A80 .text changeDemoProc__9daPy_lk_cFv */
void daPy_lk_c::changeDemoProc() {
/* Nonmatching */
+ static const Vec tact_scale = {2.5f, 2.5f, 2.5f};
}
/* 80111A80-80111B80 .text changeDeadProc__9daPy_lk_cFv */
@@ -2814,6 +2910,8 @@ void daPy_lk_c::setCollision() {
/* 8011EC0C-8011EEBC .text setAttentionPos__9daPy_lk_cFv */
void daPy_lk_c::setAttentionPos() {
/* Nonmatching */
+ static const Vec offset_39104 = {0.0f, 30.0f, 20.0f};
+ static const Vec offset_39108 = {0.0f, 70.0f, 0.0f};
}
/* 8011EEBC-8011EF94 .text setRoomInfo__9daPy_lk_cFv */
@@ -3058,6 +3156,14 @@ BOOL daPy_lk_c::checkRoofRestart() {
/* 80121870-80122D30 .text execute__9daPy_lk_cFv */
BOOL daPy_lk_c::execute() {
/* Nonmatching */
+ static const Vec nsword_top = {45.0f, -31.0f, 0.0f};
+ static const Vec msword_top = {57.0f, 48.0f, 0.0f};
+ static const Vec boomerang_catch = {12.5f, 47.5f, 36.6f};
+ static const Vec hookshot_root = {22.0f, 0.0f, 0.0f};
+ static const Vec hammer_top = {160.0f, 70.0f, 0.0f};
+ static const Vec hammer_root = {8.0f, 0.0f, 0.0f};
+ static const Vec fan_top = {55.0f, 0.0f, 0.0f};
+ static const Vec head_offset = {40.0f, 0.0f, 0.0f};
}
/* 80122D30-80122D50 .text daPy_Execute__FP9daPy_lk_c */
@@ -3149,7 +3255,7 @@ void daPy_lk_c::initTextureAnime() {
m_tex_anm_heap.m_buffer = new(0x20) u8[0x1000];
JUT_ASSERT(20869, m_tex_anm_heap.m_buffer != 0);
- dComIfGp_getAnmArchive()->readIdxResource(m_tex_anm_heap.m_buffer, 0x1000, LKANM_BTP_TMABAA);
+ JKRReadIdxResource(m_tex_anm_heap.m_buffer, 0x1000, LKANM_BTP_TMABAA, dComIfGp_getAnmArchive());
J3DAnmTexPattern* btp = static_cast<J3DAnmTexPattern*>(J3DAnmLoaderDataBase::load(m_tex_anm_heap.m_buffer));
btp->searchUpdateMaterialID(mpCLModelData);
u16 material_num = btp->getUpdateMaterialNum();
@@ -3196,7 +3302,7 @@ void daPy_lk_c::initTextureScroll() {
m_tex_scroll_heap.m_buffer = new(0x20) u8[0x800];
JUT_ASSERT(20944, m_tex_scroll_heap.m_buffer != 0);
- dComIfGp_getAnmArchive()->readIdxResource(m_tex_scroll_heap.m_buffer, 0x800, LKANM_BTK_TMABA);
+ JKRReadIdxResource(m_tex_scroll_heap.m_buffer, 0x800, LKANM_BTK_TMABA, dComIfGp_getAnmArchive());
J3DAnmTextureSRTKey* btk = static_cast<J3DAnmTextureSRTKey*>(J3DAnmLoaderDataBase::load(m_tex_scroll_heap.m_buffer));
btk->searchUpdateMaterialID(mpCLModelData);
u16 material_num = btk->getUpdateMaterialNum();
@@ -3442,7 +3548,7 @@ void daPy_lk_c::playerInit() {
for (i = 0; i < 2; i++) {
while (mat) {
mat->setMaterialMode(1);
- if (j3dZModeTable[mat->getZMode()->mZModeID].mCompareEnable == 0) {
+ if (mat->getZMode()->getCompareEnable() == 0) {
if (mat->getBlend()->mBlendMode == 1) {
mpZOffBlendShape[zoff_blend_cnt] = mat->getShape();
zoff_blend_cnt++;
@@ -3578,7 +3684,7 @@ void daPy_lk_c::playerInit() {
m3630 = fpcM_ERROR_PROCESS_ID_e;
ResTIMG* blur_img = (ResTIMG*)dComIfG_getObjectRes(l_arcName, LINK_BTI_BLUR);
- mSwBlur.mpBlurTex = blur_img;
+ mSwBlur.mpTex = blur_img;
current.angle.z = 0;
shape_angle.z = 0;
@@ -3726,10 +3832,11 @@ int phase_3(daPy_lk_c* i_this) {
}
static s32 daPy_Create(fopAc_ac_c* i_this) {
- static int (*l_method[3])(daPy_lk_c*) = {
+ static int (*l_method[4])(daPy_lk_c*) = {
phase_1,
phase_2,
phase_3,
+ NULL,
};
daPy_lk_c* player_link = (daPy_lk_c*)i_this;
@@ -4034,55 +4141,7 @@ BOOL daPy_lk_c::getBokoFlamePos(cXyz* outPos) {
return FALSE;
}
-#include "d/actor/d_a_player_particle.inc"
-
-#include "d/actor/d_a_player_dproc.inc"
-
-#include "d/actor/d_a_player_ladder.inc"
-
-#include "d/actor/d_a_player_hang.inc"
-
-#include "d/actor/d_a_player_climb.inc"
-
-#include "d/actor/d_a_player_whide.inc"
-
-#include "d/actor/d_a_player_crawl.inc"
-
-#include "d/actor/d_a_player_grab.inc"
-
-#include "d/actor/d_a_player_swim.inc"
-
-#include "d/actor/d_a_player_battle.inc"
-
-#include "d/actor/d_a_player_ship.inc"
-
-#include "d/actor/d_a_player_rope.inc"
-
-#include "d/actor/d_a_player_boomerang.inc"
-
-#include "d/actor/d_a_player_bow.inc"
-
-#include "d/actor/d_a_player_hook.inc"
-
-#include "d/actor/d_a_player_fan.inc"
-
-#include "d/actor/d_a_player_tact.inc"
-
-#include "d/actor/d_a_player_vomit.inc"
-
-#include "d/actor/d_a_player_hammer.inc"
-
-#include "d/actor/d_a_player_pushpull.inc"
-
-#include "d/actor/d_a_player_bottle.inc"
-
-#include "d/actor/d_a_player_weapon.inc"
-
-#include "d/actor/d_a_player_food.inc"
-
-#include "d/actor/d_a_player_sword.inc"
-
-actor_method_class l_daPy_Method = {
+actor_method_class2 l_daPy_Method = {
(process_method_func)daPy_Create,
(process_method_func)daPy_Delete,
(process_method_func)daPy_Execute,
@@ -4101,7 +4160,7 @@ actor_process_profile_definition2 g_profile_PLAYER = {
/* Parameters */ 0,
/* Leaf SubMtd */ &g_fopAc_Method.base,
/* Priority */ 0x0068,
- /* Actor SubMtd */ &l_daPy_Method,
+ /* Actor SubMtd */ (actor_method_class*)&l_daPy_Method,
/* Status */ fopAcStts_FREEZE_e,
/* Group */ fopAc_PLAYER_e,
/* CullType */ fopAc_CULLBOX_0_e,
diff --git a/src/d/actor/d_a_player_main_data.inc b/src/d/actor/d_a_player_main_data.inc
index 55950223..3349f89f 100644
--- a/src/d/actor/d_a_player_main_data.inc
+++ b/src/d/actor/d_a_player_main_data.inc
@@ -315,13 +315,13 @@ daPy_lk_c::ProcInitTableEntry daPy_lk_c::mProcInitTable[] = {
/* 0x5A */ {&daPy_lk_c::procCutReverse, ModeFlg_00000400},
/* 0x5B */ {&daPy_lk_c::procJumpCut, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_08000000},
/* 0x5C */ {&daPy_lk_c::procJumpCutLand, ModeFlg_00000001 | ModeFlg_00000400 | ModeFlg_08000000},
- /* 0x5D */ {&daPy_lk_c::procBtJump, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_08000000 | ModeFlg_BT},
- /* 0x5E */ {&daPy_lk_c::procBtJumpCut, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_BT},
- /* 0x5F */ {&daPy_lk_c::procBtSlide, ModeFlg_BT},
- /* 0x60 */ {&daPy_lk_c::procBtRoll, ModeFlg_00000400 | ModeFlg_00008000 | ModeFlg_BT},
- /* 0x61 */ {&daPy_lk_c::procBtRollCut, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_08000000 | ModeFlg_BT},
- /* 0x62 */ {&daPy_lk_c::procBtVerticalJump, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_08000000 | ModeFlg_BT},
- /* 0x63 */ {&daPy_lk_c::procBtVerticalJumpCut, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_08000000 | ModeFlg_BT},
+ /* 0x5D */ {&daPy_lk_c::procBtJump, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_08000000 | ModeFlg_PARRY},
+ /* 0x5E */ {&daPy_lk_c::procBtJumpCut, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_PARRY},
+ /* 0x5F */ {&daPy_lk_c::procBtSlide, ModeFlg_PARRY},
+ /* 0x60 */ {&daPy_lk_c::procBtRoll, ModeFlg_00000400 | ModeFlg_00008000 | ModeFlg_PARRY},
+ /* 0x61 */ {&daPy_lk_c::procBtRollCut, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_08000000 | ModeFlg_PARRY},
+ /* 0x62 */ {&daPy_lk_c::procBtVerticalJump, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_08000000 | ModeFlg_PARRY},
+ /* 0x63 */ {&daPy_lk_c::procBtVerticalJumpCut, ModeFlg_MIDAIR | ModeFlg_00000400 | ModeFlg_08000000 | ModeFlg_PARRY},
/* 0x64 */ {&daPy_lk_c::procBtVerticalJumpLand, ModeFlg_00000400},
/* 0x65 */ {&daPy_lk_c::procGuardCrash, 0},
/* 0x66 */ {&daPy_lk_c::procDamage, ModeFlg_DAMAGE | ModeFlg_00000080 | ModeFlg_00000400},
diff --git a/src/d/actor/d_a_player_particle.inc b/src/d/actor/d_a_player_particle.inc
index 6d72ccc9..d2a24253 100644
--- a/src/d/actor/d_a_player_particle.inc
+++ b/src/d/actor/d_a_player_particle.inc
@@ -45,8 +45,56 @@ void daPy_swimTailEcallBack_c::remove() {
}
/* 8012910C-80129310 .text execute__24daPy_swimTailEcallBack_cFP14JPABaseEmitter */
-void daPy_swimTailEcallBack_c::execute(JPABaseEmitter*) {
- /* Nonmatching */
+void daPy_swimTailEcallBack_c::execute(JPABaseEmitter* emitter) {
+ static JGeometry::TVec3<f32> right_dir(-1.0f, 0.0f, 0.0f);
+
+ GXColor ambColor;
+ GXColor difColor;
+ dKy_get_seacolor(&ambColor, &difColor);
+ emitter->setGlobalPrmColor(ambColor.r, ambColor.g, ambColor.b);
+
+ if (field_0x04) {
+ s16 sp8 = emitter->getGlobalAlpha();
+ cLib_chaseS(&sp8, 0, 0x14);
+ emitter->setGlobalAlpha(sp8);
+ if (sp8 == 0) {
+ emitter->becomeInvalidEmitter();
+ emitter->setEmitterCallBackPtr(NULL);
+ mpEmitter = NULL;
+ return;
+ }
+ }
+
+ if (field_0x20 != NULL) {
+ emitter->setGlobalTranslation(field_0x14.x, field_0x14.y, field_0x14.z);
+ JGeometry::TVec3<s16> rot(0, 0, 0);
+ rot.y = field_0x20->y;
+ emitter->setGlobalRotation(rot);
+ }else {
+ JGeometry::TVec3<f32> sp20;
+ emitter->getGlobalTranslation(sp20);
+ getMaxWaterY(&sp20);
+ emitter->setGlobalTranslation(sp20);
+ cLib_chaseF(&field_0x08, 0.0f, 0.08f);
+ }
+
+ emitter->setDirectionalSpeed(1.0f + 12.0f * field_0x08);
+
+ if (field_0x05) {
+ emitter->setDirection(right_dir);
+ }
+
+ for (JSULink<JPABaseParticle>* link = emitter->mActiveParticles.getFirst(); link != NULL;) {
+ JSULink<JPABaseParticle>* nextLink = link->getNext();
+ JPABaseParticle* particle = link->getObject();
+
+ JGeometry::TVec3<f32> sp14;
+ particle->getGlobalPosition(sp14);
+ getMaxWaterY(&sp14);
+ particle->setOffsetPosition(sp14);
+
+ link = nextLink;
+ }
}
/* 80129310-80129348 .text draw__24daPy_swimTailEcallBack_cFP14JPABaseEmitter */
@@ -78,7 +126,70 @@ void daPy_swBlur_c::copySwBlur(MtxP, int) {
/* 80129A78-80129DD0 .text draw__13daPy_swBlur_cFv */
void daPy_swBlur_c::draw() {
- /* Nonmatching */
+ j3dSys.reinitGX();
+ GXSetNumIndStages(0);
+
+ static GXTexObj texObj;
+ u16 texWidth = 16;
+ u16 texHeight = 4;
+ GXTexFmt texFormat = GX_TF_I4;
+ GXInitTexObj(&texObj, (u8*)mpTex + mpTex->imageOffset, texWidth, texHeight, texFormat, GX_CLAMP, GX_CLAMP, GX_FALSE);
+ GXInitTexObjLOD(&texObj, GX_LINEAR, GX_LINEAR, 0.0f, 0.0f, 0.0f, GX_FALSE, GX_FALSE, GX_ANISO_1);
+ GXLoadTexObj(&texObj, GX_TEXMAP0);
+
+ GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_F32, 0);
+ GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_S16, 8);
+ GXClearVtxDesc();
+ GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
+ GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
+ GXSetNumChans(0);
+
+ if (mBlurColorType == 0) {
+ // Normal color.
+ static GXColor n_color = {0xFF, 0xFF, 0xFF, 0x96};
+ GXSetTevColor(GX_TEVREG0, n_color);
+ } else if (mBlurColorType == 1) {
+ // Elixir Soup color.
+ static GXColor y_color = {0xFF, 0xFF, 0x7B, 0x96};
+ GXSetTevColor(GX_TEVREG0, y_color);
+ } else {
+ // Parrying color.
+ static GXColor g_color = {0x5A, 0xFF, 0x5A, 0x96};
+ GXSetTevColor(GX_TEVREG0, g_color);
+ }
+
+ GXSetNumTexGens(1);
+ GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY);
+ GXSetNumTevStages(1);
+ GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL);
+ GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_C0);
+ GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
+ GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_A0, GX_CA_TEXA, GX_CA_ZERO);
+ GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
+ GXLoadPosMtxImm(j3dSys.getViewMtx(), GX_PNMTX0);
+ GXSetCurrentMtx(GX_PNMTX0);
+ GXSetBlendMode(GX_BM_BLEND, GX_BL_SRC_ALPHA, GX_BL_INV_SRC_ALPHA, GX_LO_SET);
+ GXSetCullMode(GX_CULL_NONE);
+ GXSetZMode(GX_TRUE, GX_LEQUAL, GX_FALSE);
+ GXSetAlphaCompare(GX_GREATER, 0, GX_AOP_OR, GX_GREATER, 0);
+
+ int r30 = 0xFF / ((field_0x014 >> 1) + 1);
+ s16 r29 = r30;
+ s16 r28 = 0x00;
+ GXBegin(GX_QUADS, GX_VTXFMT0, 4 + field_0x014*4);
+ for (int i = field_0x014; i >= 0; i--) {
+ GXPosition3f32(field_0x034[i].x, field_0x034[i].y, field_0x034[i].z);
+ GXTexCoord2s16(r29, 0x00);
+ GXPosition3f32(field_0x304[i].x, field_0x304[i].y, field_0x304[i].z);
+ GXTexCoord2s16(r29, 0xFF);
+ GXPosition3f32(field_0x304[i+1].x, field_0x304[i+1].y, field_0x304[i+1].z);
+ GXTexCoord2s16(r28, 0xFF);
+ GXPosition3f32(field_0x034[i+1].x, field_0x034[i+1].y, field_0x034[i+1].z);
+ GXTexCoord2s16(r28, 0x00);
+ r28 = r29;
+ r29 += r30;
+ }
+ J3DShape::resetVcdVatCache();
}
/* 80129DD0-80129E9C .text execute__24daPy_fanSwingEcallBack_cFP14JPABaseEmitter */
@@ -110,6 +221,8 @@ void daPy_followEcallBack_c::end() {
}
}
+daPy_waterDropPcallBack_c daPy_waterDropEcallBack_c::m_pcallback;
+
/* 80129FD4-8012A040 .text execute__25daPy_waterDropEcallBack_cFP14JPABaseEmitter */
void daPy_waterDropEcallBack_c::execute(JPABaseEmitter* emitter) {
daPy_followEcallBack_c::execute(emitter);
@@ -144,6 +257,9 @@ void daPy_mtxPosFollowEcallBack_c::execute(JPABaseEmitter*) {
/* Nonmatching */
}
+s16 daPy_dmEcallBack_c::m_timer = 0;
+u16 daPy_dmEcallBack_c::m_type = 3;
+
/* 8012A160-8012A288 .text execute__18daPy_dmEcallBack_cFP14JPABaseEmitter */
void daPy_dmEcallBack_c::execute(JPABaseEmitter*) {
/* Nonmatching */
diff --git a/src/d/actor/d_a_player_sword.inc b/src/d/actor/d_a_player_sword.inc
index 38ae7353..8aa584e1 100644
--- a/src/d/actor/d_a_player_sword.inc
+++ b/src/d/actor/d_a_player_sword.inc
@@ -11,10 +11,113 @@
*/
#include "d/actor/d_a_player_main.h"
+#include "JSystem/J3DGraphLoader/J3DAnmLoader.h"
+#include "JSystem/JKernel/JKRSolidHeap.h"
/* 80154B80-80154FBC .text setSwordModel__9daPy_lk_cFi */
-void daPy_lk_c::setSwordModel(int) {
- /* Nonmatching */
+void daPy_lk_c::setSwordModel(BOOL r28) {
+ struct sword_model_tbl_s {
+ /* 0x00 */ u16 bladeModel;
+ /* 0x02 */ u16 glowModel;
+ /* 0x04 */ u16 glowBtk;
+ /* 0x06 */ u16 glowBrk;
+ /* 0x08 */ u16 tipStabModel;
+ /* 0x0A */ u16 tipStabBpk;
+ /* 0x0C */ u16 tipStabBtk;
+ /* 0x0E */ u16 tipStabBrk;
+ };
+ static const sword_model_tbl_s sword_model_tbl[] = {
+ {
+ LINK_BDL_SWA,
+ LINK_BDL_YHSLS00,
+ LKANM_BTK_YHSLS00,
+ LKANM_BRK_YHSLS00,
+ LINK_BDL_CUTFH,
+ LKANM_BPK_CUTFH,
+ LKANM_BTK_CUTFH,
+ LKANM_BRK_CUTFH
+ },
+ {
+ LINK_BDL_SWMS,
+ LINK_BDL_YMSLI00,
+ LKANM_BTK_YMSLI00,
+ LKANM_BRK_YMSLI00,
+ LINK_BDL_CUTFM,
+ LKANM_BPK_CUTFM,
+ LKANM_BTK_CUTFM,
+ LKANM_BRK_CUTFM
+ },
+ };
+
+ u8* buffer;
+
+ J3DAnmTransform* bck = checkNormalSwordEquip() ? getItemAnimeResource(LKANM_BCK_CUTAA) : getItemAnimeResource(LKANM_BCK_CUTAMS);
+
+ mHeldItemType = 0x103;
+ JKRHeap* oldHeap = setItemHeap();
+
+ const sword_model_tbl_s& model_tbl = checkNormalSwordEquip() ? sword_model_tbl[0] : sword_model_tbl[1];
+ J3DModelData* modelData = initModel(&mpHeldItemModel, model_tbl.bladeModel, 0x37221222);
+ BOOL ret = mSwordAnim.init(modelData, bck, false, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, 0, -1, false);
+ if (!ret) { JUT_ASSERT(86, 0); }
+
+ if (!checkNormalSwordEquip()) {
+ buffer = new(0x20) u8[0x400];
+ JKRReadIdxResource(buffer, 0x400, LKANM_BTK_TSWMS, dComIfGp_getAnmArchive());
+ mpHeldItemBtk = static_cast<J3DAnmTextureSRTKey*>(J3DAnmLoaderDataBase::load(buffer));
+ mpHeldItemBtk->setFrame(0.0f);
+ mpHeldItemBtk->searchUpdateMaterialID(modelData);
+ modelData->entryTexMtxAnimator(mpHeldItemBtk);
+ }
+
+ mSwBlur.mpPosBuffer = new(0x20) u8[0x4800];
+ modelData = initModel(&mpSwordModel1, model_tbl.glowModel, 0x13000222);
+
+ buffer = new(0x20) u8[0x400];
+ JKRReadIdxResource(buffer, 0x400, model_tbl.glowBtk, dComIfGp_getAnmArchive());
+ mpSwordBtk = static_cast<J3DAnmTextureSRTKey*>(J3DAnmLoaderDataBase::load(buffer));
+ mpSwordBtk->setFrame(0.0f);
+ mpSwordBtk->searchUpdateMaterialID(modelData);
+ modelData->entryTexMtxAnimator(mpSwordBtk);
+
+ buffer = new(0x20) u8[0x400];
+ JKRReadIdxResource(buffer, 0x400, model_tbl.glowBrk, dComIfGp_getAnmArchive());
+ mpHeldItemBrk = static_cast<J3DAnmTevRegKey*>(J3DAnmLoaderDataBase::load(buffer));
+ mpHeldItemBrk->setFrame(0.0f);
+ mpHeldItemBrk->searchUpdateMaterialID(modelData);
+ modelData->entryTevRegAnimator(mpHeldItemBrk);
+
+ modelData = initModel(&mpSwordTipStabModel, model_tbl.tipStabModel, 0x13000223);
+
+ buffer = new(0x20) u8[0x400];
+ JKRReadIdxResource(buffer, 0x400, model_tbl.tipStabBtk, dComIfGp_getAnmArchive());
+ mpCutfBtk = static_cast<J3DAnmTextureSRTKey*>(J3DAnmLoaderDataBase::load(buffer));
+ mpCutfBtk->setFrame(0.0f);
+ mpCutfBtk->searchUpdateMaterialID(modelData);
+ modelData->entryTexMtxAnimator(mpCutfBtk);
+
+ buffer = new(0x20) u8[0x400];
+ JKRReadIdxResource(buffer, 0x400, model_tbl.tipStabBrk, dComIfGp_getAnmArchive());
+ mpCutfBrk2EF8 = static_cast<J3DAnmTevRegKey*>(J3DAnmLoaderDataBase::load(buffer));
+ mpCutfBrk2EF8->setFrame(0.0f);
+ mpCutfBrk2EF8->searchUpdateMaterialID(modelData);
+ modelData->entryTevRegAnimator(mpCutfBrk2EF8);
+
+ buffer = new(0x20) u8[0x400];
+ JKRReadIdxResource(buffer, 0x400, model_tbl.tipStabBpk, dComIfGp_getAnmArchive());
+ mpCutfBpk = static_cast<J3DAnmColor*>(J3DAnmLoaderDataBase::load(buffer));
+ mpCutfBpk->setFrame(0.0f);
+ mpCutfBpk->searchUpdateMaterialID(modelData);
+ modelData->entryMatColorAnimator(mpCutfBpk);
+
+ mDoExt_setCurrentHeap(oldHeap);
+ mDoAud_bgmSetSwordUsing(1);
+ m355C = 0;
+
+ if (r28) {
+ onNoResetFlg1(daPyFlg1_UNK200000);
+ mpSwordBtk->setFrame(mpSwordBtk->getFrameMax() - 0.001f);
+ }
}
/* 80154FBC-80155490 .text setLightSaver__9daPy_lk_cFv */
diff --git a/src/d/actor/d_a_player_tact.inc b/src/d/actor/d_a_player_tact.inc
index 62f8edb2..c5d5a870 100644
--- a/src/d/actor/d_a_player_tact.inc
+++ b/src/d/actor/d_a_player_tact.inc
@@ -40,10 +40,10 @@ void daPy_lk_c::setTactModel() {
J3DModelData* modelData = initModel(&mpHeldItemModel, LINK_BDL_TAKT, 0x37221222);
u8* buffer = new(0x20) u8[0x400];
dComIfGp_getAnmArchive()->readIdxResource(buffer, 0x400, LKANM_BRK_TTAKT);
- mpHeldItemAnimBRK = (J3DAnmTevRegKey*)J3DAnmLoaderDataBase::load(buffer);
- mpHeldItemAnimBRK->setFrame(0.0f);
- mpHeldItemAnimBRK->searchUpdateMaterialID(modelData);
- modelData->entryTevRegAnimator(mpHeldItemAnimBRK);
+ mpHeldItemBrk = (J3DAnmTevRegKey*)J3DAnmLoaderDataBase::load(buffer);
+ mpHeldItemBrk->setFrame(0.0f);
+ mpHeldItemBrk->searchUpdateMaterialID(modelData);
+ modelData->entryTevRegAnimator(mpHeldItemBrk);
mDoExt_setCurrentHeap(oldHeap);
}
diff --git a/src/d/actor/d_a_swhit0.cpp b/src/d/actor/d_a_swhit0.cpp
index 645cb80e..8456f9f9 100644
--- a/src/d/actor/d_a_swhit0.cpp
+++ b/src/d/actor/d_a_swhit0.cpp
@@ -249,7 +249,7 @@ s32 daSwhit0_c::actionOffWait() {
mState = 2;
fopAcM_orderOtherEventId(this, mEventIdx, getEvNo());
- mEvtInfo.onCondition(0x02);
+ mEvtInfo.onCondition(dEvtCnd_UNK2_e);
break;
default:
@@ -279,7 +279,7 @@ s32 daSwhit0_c::actionToOnReady() {
mState = 2;
fopAcM_orderOtherEventId(this, mEventIdx, getEvNo());
- mEvtInfo.onCondition(0x02);
+ mEvtInfo.onCondition(dEvtCnd_UNK2_e);
}
return TRUE;
@@ -295,7 +295,7 @@ s32 daSwhit0_c::actionToOnOrder() {
}
else {
fopAcM_orderOtherEventId(this, mEventIdx, getEvNo());
- mEvtInfo.onCondition(0x02);
+ mEvtInfo.onCondition(dEvtCnd_UNK2_e);
}
return TRUE;
diff --git a/src/d/actor/d_a_tag_msg.cpp b/src/d/actor/d_a_tag_msg.cpp
index 87a7024f..caf4b291 100644
--- a/src/d/actor/d_a_tag_msg.cpp
+++ b/src/d/actor/d_a_tag_msg.cpp
@@ -200,7 +200,7 @@ static BOOL daTag_Msg_actionHunt(daTag_Msg_c* a_this) {
if (a_this->getType2() & 1) {
fopAcM_orderSpeakEvent(a_this);
}
- a_this->mEvtInfo.mCondition |= dEvtCnd_CANTALK_e;
+ a_this->mEvtInfo.onCondition(dEvtCnd_CANTALK_e);
}
return TRUE;
}
diff --git a/src/d/actor/d_a_tbox.cpp b/src/d/actor/d_a_tbox.cpp
index 119a3899..46ff6cb5 100644
--- a/src/d/actor/d_a_tbox.cpp
+++ b/src/d/actor/d_a_tbox.cpp
@@ -1038,7 +1038,7 @@ BOOL daTbox_c::actionOpenWait() {
}
else {
if (boxCheck()) {
- mEvtInfo.onCondition(0x04);
+ mEvtInfo.onCondition(dEvtCnd_CANDOOR_e);
if (getShapeType() == 0) {
mEvtInfo.setEventName("DEFAULT_TREASURE_A");
@@ -1063,7 +1063,7 @@ BOOL daTbox_c::actionSwOnWait() {
else {
if (dComIfGs_isSwitch(getSwNo(), mRoomNo)) {
fopAcM_orderOtherEvent2(this, "DEFAULT_TREASURE_APPEAR", 1);
- mEvtInfo.mCondition |= 2;
+ mEvtInfo.onCondition(dEvtCnd_UNK2_e);
}
}
@@ -1095,7 +1095,7 @@ BOOL daTbox_c::actionGenocide() {
}
else {
fopAcM_orderOtherEvent2(this, "DEFAULT_TREASURE_APPEAR", 1);
- mEvtInfo.mCondition |= 2;
+ mEvtInfo.onCondition(dEvtCnd_UNK2_e);
dComIfGs_onSwitch(getSwNo(), mRoomNo);
}