mirror of
https://github.com/zeldaret/tww.git
synced 2026-10-09 13:36:50 -04:00
Small tu matches (#1221)
* d_detect OK * processor OK * d_a_obj_msdan2 OK * d_a_fallrock_tag OK * feedback fallrock_tag
This commit is contained in:
+4
-4
@@ -557,7 +557,7 @@ config.libs = [
|
||||
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_kankyo_wether.cpp"),
|
||||
Object(NonMatching, "d/d_kankyo_rain.cpp"),
|
||||
Object(Matching, "d/d_kankyo_demo.cpp"),
|
||||
Object(NonMatching, "d/d_detect.cpp"),
|
||||
Object(MatchingFor("GZLE01"), "d/d_detect.cpp"),
|
||||
Object(Matching, "d/d_vibration.cpp"),
|
||||
Object(Matching, "d/d_vib_pattern.cpp"),
|
||||
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_attention.cpp"),
|
||||
@@ -918,7 +918,7 @@ config.libs = [
|
||||
[
|
||||
Object(Matching, "JSystem/JMessage/data.cpp"),
|
||||
Object(Matching, "JSystem/JMessage/control.cpp"),
|
||||
Object(NonMatching, "JSystem/JMessage/processor.cpp"),
|
||||
Object(MatchingFor("GZLE01"), "JSystem/JMessage/processor.cpp"),
|
||||
Object(NonMatching, "JSystem/JMessage/resource.cpp"),
|
||||
],
|
||||
),
|
||||
@@ -1639,7 +1639,7 @@ config.libs = [
|
||||
ActorRel(Matching, "d_a_deku_item"),
|
||||
ActorRel(Matching, "d_a_dk"),
|
||||
ActorRel(Matching, "d_a_dummy"),
|
||||
ActorRel(NonMatching, "d_a_fallrock_tag"),
|
||||
ActorRel(MatchingFor("GZLE01"), "d_a_fallrock_tag"),
|
||||
ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_fan"),
|
||||
ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_fganon"),
|
||||
ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_fgmahou"),
|
||||
@@ -1778,7 +1778,7 @@ config.libs = [
|
||||
ActorRel(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d_a_obj_mknjd"),
|
||||
ActorRel(Matching, "d_a_obj_mmrr"),
|
||||
ActorRel(NonMatching, "d_a_obj_msdan"),
|
||||
ActorRel(NonMatching, "d_a_obj_msdan2"),
|
||||
ActorRel(MatchingFor("GZLE01"), "d_a_obj_msdan2"),
|
||||
ActorRel(Matching, "d_a_obj_msdan_sub"),
|
||||
ActorRel(NonMatching, "d_a_obj_msdan_sub2"),
|
||||
ActorRel(Matching, "d_a_obj_mtest"),
|
||||
|
||||
@@ -1,19 +1,42 @@
|
||||
#ifndef D_A_FALLROCK_TAG_H
|
||||
#define D_A_FALLROCK_TAG_H
|
||||
|
||||
#include "c/c_dylink.h"
|
||||
#include "f_op/f_op_actor.h"
|
||||
|
||||
struct daFallRockTag_Data_c {
|
||||
/* 0x00 */ f32 mRange;
|
||||
/* 0x04 */ f32 mScaleMin;
|
||||
/* 0x08 */ f32 mScaleMax;
|
||||
/* 0x0C */ f32 field_0x0c;
|
||||
/* 0x10 */ f32 field_0x10;
|
||||
/* 0x14 */ s16 field_0x14;
|
||||
/* 0x16 */ s16 mTimerOffset;
|
||||
/* 0x18 */ s16 mRockNumPerSec;
|
||||
}; // Size: 0x1C
|
||||
|
||||
class daFallRockTag_c : public fopAc_ac_c {
|
||||
public:
|
||||
~daFallRockTag_c() {
|
||||
cDyl_Unlink(fpcNm_FallRock_e);
|
||||
}
|
||||
|
||||
inline cPhs_State create();
|
||||
inline BOOL draw();
|
||||
inline BOOL execute();
|
||||
void getData(); // weak but not inlined?
|
||||
inline daFallRockTag_Data_c* getData();
|
||||
|
||||
void createRock(cXyz*, cXyz*, csXyz*, int, unsigned long);
|
||||
void createRock(cXyz*, cXyz*, csXyz*, int, u32);
|
||||
|
||||
static f32 m_div_num;
|
||||
static daFallRockTag_Data_c m_data;
|
||||
|
||||
public:
|
||||
/* Place member variables here */
|
||||
};
|
||||
/* 0x290 */ u8 field_0x290[0x298 - 0x290];
|
||||
/* 0x298 */ int field_0x298;
|
||||
/* 0x29C */ u8 field_0x29c[0x29E - 0x29C];
|
||||
/* 0x29E */ u8 mSchBit;
|
||||
/* 0x29F */ u8 field_0x29f[0x2A0 - 0x29F];
|
||||
}; // Size: 0x2A0
|
||||
|
||||
#endif /* D_A_FALLROCK_TAG_H */
|
||||
|
||||
@@ -2,19 +2,27 @@
|
||||
#define D_A_OBJ_MSDAN2_H
|
||||
|
||||
#include "f_op/f_op_actor.h"
|
||||
#include "d/d_a_obj.h"
|
||||
|
||||
namespace daObjMsdan2 {
|
||||
class Act_c : public fopAc_ac_c {
|
||||
public:
|
||||
void prm_get_swSave() const {}
|
||||
|
||||
enum Prm_e {
|
||||
PRM_SWSAVE_W = 0x08,
|
||||
PRM_SWSAVE_S = 0x00,
|
||||
};
|
||||
|
||||
int prm_get_swSave() const { return daObj::PrmAbstract<Prm_e>(this, PRM_SWSAVE_W, PRM_SWSAVE_S); }
|
||||
|
||||
cPhs_State Mthd_Create();
|
||||
BOOL Mthd_Execute();
|
||||
BOOL Mthd_Delete();
|
||||
|
||||
|
||||
public:
|
||||
/* Place member variables here */
|
||||
};
|
||||
/* 0x290 */ u8 field_0x290[0x298 - 0x290];
|
||||
/* 0x298 */ s16 mEventIdx;
|
||||
/* 0x29C */ int mMode;
|
||||
}; // Size: 0x2A0
|
||||
};
|
||||
|
||||
#endif /* D_A_OBJ_MSDAN2_H */
|
||||
|
||||
@@ -247,9 +247,8 @@ const char* TProcessor::process_select_limited_(TProcessor* proc) {
|
||||
|
||||
/* 8029F428-8029F444 .text process_select___Q28JMessage10TProcessorFPQ28JMessage10TProcessor */
|
||||
const char* TProcessor::process_select_(TProcessor* proc) {
|
||||
/* Nonmatching */
|
||||
SelectCallBackWork* work = (SelectCallBackWork*) &proc->mStatusData.mCallBackWork;
|
||||
u32 offs = ((const u32*)work->mTable)[0];
|
||||
u32 offs = JGadget::binary::TParseValue<JGadget::binary::TParseValue_endian_big_<u32> >::parse(work->mTable);
|
||||
work->mTable = (const char*)work->mTable + sizeof(offs);
|
||||
return &work->mBase[offs];
|
||||
}
|
||||
@@ -274,7 +273,6 @@ TSequenceProcessor::~TSequenceProcessor() {
|
||||
|
||||
/* 8029F4E0-8029F658 .text process__Q28JMessage18TSequenceProcessorFPCc */
|
||||
const char* TSequenceProcessor::process(const char* stop) {
|
||||
/* Nonmatching */
|
||||
do {
|
||||
switch (mStatus) {
|
||||
case kStatus_Normal:
|
||||
@@ -302,7 +300,7 @@ const char* TSequenceProcessor::process(const char* stop) {
|
||||
}
|
||||
} else {
|
||||
mStatus = kStatus_Normal;
|
||||
if (rt < work->mTarget && mStatusData.mCallBack(this))
|
||||
if (rt < work->mTarget && ((OnBranchRegisterCallBack*)mStatusData.mCallBack)(this, rt))
|
||||
on_branch(mControl->getMessageEntry(), mControl->getMessageData_begin());
|
||||
}
|
||||
}
|
||||
@@ -492,16 +490,14 @@ bool TSequenceProcessor::process_jump_(TSequenceProcessor* proc) {
|
||||
|
||||
/* 8029FA88-8029FAB8 .text process_branch_limited___Q28JMessage18TSequenceProcessorFPQ28JMessage18TSequenceProcessorUl */
|
||||
bool TSequenceProcessor::process_branch_limited_(TSequenceProcessor* proc, u32 choice) {
|
||||
/* Nonmatching */
|
||||
BranchCallBackWork* work = (BranchCallBackWork*) &proc->mStatusData.mCallBackWork;
|
||||
return process_setMessage_index_(proc->mControl, ((u16*)work->mTable)[choice]);
|
||||
return process_setMessage_index_(proc->mControl, JGadget::binary::TParseValue<JGadget::binary::TParseValue_endian_big_<u16> >::parse(work->mTable, choice));
|
||||
}
|
||||
|
||||
/* 8029FAB8-8029FAE8 .text process_branch___Q28JMessage18TSequenceProcessorFPQ28JMessage18TSequenceProcessorUl */
|
||||
bool TSequenceProcessor::process_branch_(TSequenceProcessor* proc, u32 choice) {
|
||||
/* Nonmatching */
|
||||
BranchCallBackWork* work = (BranchCallBackWork*) &proc->mStatusData.mCallBackWork;
|
||||
return process_setMessage_code_(proc->mControl, ((u32*)work->mTable)[choice]);
|
||||
return process_setMessage_code_(proc->mControl, JGadget::binary::TParseValue<JGadget::binary::TParseValue_endian_big_<u32> >::parse(work->mTable, choice));
|
||||
}
|
||||
|
||||
/* 8029FAE8-8029FB20 .text __ct__Q28JMessage19TRenderingProcessorFPQ28JMessage8TControl */
|
||||
|
||||
@@ -5,6 +5,23 @@
|
||||
|
||||
#include "d/dolzel_rel.h" // IWYU pragma: keep
|
||||
#include "d/actor/d_a_fallrock_tag.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "d/d_kankyo.h"
|
||||
#include "f_op/f_op_actor_mng.h"
|
||||
#include "m_Do/m_Do_audio.h"
|
||||
#include "SSystem/SComponent/c_math.h"
|
||||
|
||||
f32 daFallRockTag_c::m_div_num = 6.0f;
|
||||
daFallRockTag_Data_c daFallRockTag_c::m_data = {
|
||||
250.0f,
|
||||
0.3f,
|
||||
0.8f,
|
||||
-70.0f,
|
||||
-7.0f,
|
||||
90,
|
||||
90,
|
||||
3,
|
||||
};
|
||||
|
||||
/* 00000078-00000080 .text daFallRockTag_Draw__FP15daFallRockTag_c */
|
||||
static BOOL daFallRockTag_Draw(daFallRockTag_c*) {
|
||||
@@ -12,8 +29,38 @@ static BOOL daFallRockTag_Draw(daFallRockTag_c*) {
|
||||
}
|
||||
|
||||
/* 00000080-000002A0 .text daFallRockTag_Execute__FP15daFallRockTag_c */
|
||||
static BOOL daFallRockTag_Execute(daFallRockTag_c*) {
|
||||
/* Nonmatching */
|
||||
static BOOL daFallRockTag_Execute(daFallRockTag_c* i_this) {
|
||||
int endTime = (int)(dStage_stagInfo_GetSchSec(dComIfGp_getStageStagInfo()) / daFallRockTag_c::m_div_num) * 30;
|
||||
u8 schbit = dKy_get_schbit();
|
||||
if (schbit & i_this->mSchBit) {
|
||||
if (endTime < dKy_get_schbit_timer()) {
|
||||
int timer = dKy_get_schbit_timer();
|
||||
timer -= i_this->getData()->mTimerOffset;
|
||||
if (timer % (30 / i_this->getData()->mRockNumPerSec) == 0) {
|
||||
cXyz scale;
|
||||
cXyz pos;
|
||||
f32 range = i_this->getData()->mRange * i_this->scale.x;
|
||||
pos.x = cM_rndFX(range);
|
||||
pos.y = 0.0f;
|
||||
pos.z = cM_rndFX(range - std::fabsf(pos.x));
|
||||
|
||||
f32 scaleMin = i_this->getData()->mScaleMin;
|
||||
f32 s = scaleMin + cM_rndF(i_this->getData()->mScaleMax - scaleMin);
|
||||
scale.x = scale.y = scale.z = s;
|
||||
|
||||
csXyz angle;
|
||||
angle.x = cM_rndF(32767.0f);
|
||||
angle.y = cM_rndF(32767.0f);
|
||||
angle.z = cM_rndF(32767.0f);
|
||||
|
||||
i_this->createRock(&pos, &scale, &angle, fopAcM_GetRoomNo(i_this), 0);
|
||||
fopAcM_seStart(i_this, JA_SE_ATM_RAKUBAN, 0);
|
||||
}
|
||||
} else {
|
||||
i_this->field_0x298 = 0;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 000002A0-000002A8 .text daFallRockTag_IsDelete__FP15daFallRockTag_c */
|
||||
@@ -22,23 +69,41 @@ static BOOL daFallRockTag_IsDelete(daFallRockTag_c*) {
|
||||
}
|
||||
|
||||
/* 000002A8-000002EC .text daFallRockTag_Delete__FP15daFallRockTag_c */
|
||||
static BOOL daFallRockTag_Delete(daFallRockTag_c*) {
|
||||
/* Nonmatching */
|
||||
static BOOL daFallRockTag_Delete(daFallRockTag_c* i_this) {
|
||||
i_this->~daFallRockTag_c();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
cPhs_State daFallRockTag_c::create() {
|
||||
fopAcM_SetupActor(this, daFallRockTag_c);
|
||||
|
||||
cPhs_State ret = cDyl_LinkASync(fpcNm_FallRock_e);
|
||||
if (ret != cPhs_COMPLEATE_e) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
mSchBit = fopAcM_GetParam(this);
|
||||
fopAcM_offDraw(this);
|
||||
return cPhs_COMPLEATE_e;
|
||||
}
|
||||
|
||||
/* 000002EC-00000360 .text daFallRockTag_Create__FP10fopAc_ac_c */
|
||||
static cPhs_State daFallRockTag_Create(fopAc_ac_c*) {
|
||||
/* Nonmatching */
|
||||
static cPhs_State daFallRockTag_Create(fopAc_ac_c* i_this) {
|
||||
return ((daFallRockTag_c*)i_this)->create();
|
||||
}
|
||||
|
||||
/* 00000360-000003D8 .text createRock__15daFallRockTag_cFP4cXyzP4cXyzP5csXyziUl */
|
||||
void daFallRockTag_c::createRock(cXyz*, cXyz*, csXyz*, int, unsigned long) {
|
||||
/* Nonmatching */
|
||||
void daFallRockTag_c::createRock(cXyz* i_pos, cXyz* i_scale, csXyz* i_angle, int i_roomNo, u32 i_params) {
|
||||
cXyz pos;
|
||||
pos.x = current.pos.x + i_pos->x;
|
||||
pos.y = current.pos.y + i_pos->y;
|
||||
pos.z = current.pos.z + i_pos->z;
|
||||
fopAcM_create(fpcNm_FallRock_e, i_params, &pos, i_roomNo, i_angle, i_scale);
|
||||
}
|
||||
|
||||
/* 000003D8-000003E4 .text getData__15daFallRockTag_cFv */
|
||||
void daFallRockTag_c::getData() {
|
||||
/* Nonmatching */
|
||||
daFallRockTag_Data_c* daFallRockTag_c::getData() {
|
||||
return &m_data;
|
||||
}
|
||||
|
||||
static actor_method_class l_daFallRockTag_Method = {
|
||||
|
||||
@@ -8,17 +8,56 @@
|
||||
|
||||
/* 00000078-0000024C .text Mthd_Create__Q211daObjMsdan25Act_cFv */
|
||||
cPhs_State daObjMsdan2::Act_c::Mthd_Create() {
|
||||
/* Nonmatching */
|
||||
fopAcM_SetupActor(this, daObjMsdan2::Act_c);
|
||||
|
||||
cXyz pos = current.pos;
|
||||
csXyz angle = current.angle;
|
||||
angle.y += 0x8000;
|
||||
pos.y += 400.0f;
|
||||
for (int i = 0; i < 16; i++) {
|
||||
pos.x += 50.0f * cM_ssin(current.angle.y);
|
||||
pos.z += 50.0f * cM_scos(current.angle.y);
|
||||
fopAcM_create(fpcNm_Obj_MsdanSub2_e, (i << 8) + prm_get_swSave(), &pos, current.roomNo, &angle);
|
||||
}
|
||||
|
||||
mEventIdx = dComIfGp_evmng_getEventIdx("Msdan2");
|
||||
if (fopAcM_isSwitch(this, prm_get_swSave())) {
|
||||
mMode = 3;
|
||||
} else {
|
||||
mMode = 0;
|
||||
}
|
||||
return cPhs_COMPLEATE_e;
|
||||
}
|
||||
|
||||
/* 0000024C-00000344 .text Mthd_Execute__Q211daObjMsdan25Act_cFv */
|
||||
BOOL daObjMsdan2::Act_c::Mthd_Execute() {
|
||||
/* Nonmatching */
|
||||
switch (mMode) {
|
||||
case 0:
|
||||
if (fopAcM_isSwitch(this, prm_get_swSave())) {
|
||||
fopAcM_orderOtherEventId(this, mEventIdx);
|
||||
mMode = 1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (eventInfo.checkCommandDemoAccrpt()) {
|
||||
mMode = 2;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (dComIfGp_evmng_endCheck(mEventIdx)) {
|
||||
dComIfGp_event_reset();
|
||||
mMode = 3;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* 00000344-0000034C .text Mthd_Delete__Q211daObjMsdan25Act_cFv */
|
||||
BOOL daObjMsdan2::Act_c::Mthd_Delete() {
|
||||
/* Nonmatching */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
namespace daObjMsdan2 {
|
||||
|
||||
+14
-13
@@ -39,11 +39,13 @@ dDetect_c::~dDetect_c() {}
|
||||
|
||||
/* 8009C0F8-8009C14C .text proc__9dDetect_cFv */
|
||||
void dDetect_c::proc() {
|
||||
/* Nonmatching - 1 literal load order */
|
||||
if (mPlace[0].mTimer > 0) {
|
||||
mPlace[0].mTimer--;
|
||||
} else if (mPlace[0].mTimer < 0) {
|
||||
mPlace[0].mTimer = 1;
|
||||
dDetectPlace_c* place = mPlace;
|
||||
for (int i = 0; i < ARRAY_SIZE(mPlace); i++, place++) {
|
||||
if (place->mTimer > 0) {
|
||||
place->mTimer--;
|
||||
} else if (place->mTimer < 0) {
|
||||
place->mTimer = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (mTimer > 0) {
|
||||
@@ -78,15 +80,14 @@ bool dDetect_c::chk_quake(const cXyz* pos) const {
|
||||
|
||||
/* 8009C1E0-8009C254 .text set_quake__9dDetect_cFPC4cXyz */
|
||||
void dDetect_c::set_quake(const cXyz* pos) {
|
||||
/* Nonmatching - regalloc, load order */
|
||||
if (pos) {
|
||||
if (!mPlace[0].chk_enable()) {
|
||||
mPlace[0].mTimer = -1;
|
||||
mPlace[0].mPos = *pos;
|
||||
} else {
|
||||
// Possible fakematch: There's a double branch here that probably means something got optimized out, but
|
||||
// it's not clear what it was, or if this is exactly the right spot for it.
|
||||
mPlace[0].mPos.y = mPlace[0].mPos.y;
|
||||
dDetectPlace_c* place = mPlace;
|
||||
for (int i = 0; i < ARRAY_SIZE(mPlace); i++, place++) {
|
||||
if (!place->chk_enable()) {
|
||||
place->mTimer = -1;
|
||||
place->mPos = *pos;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mTimer = -1;
|
||||
|
||||
Reference in New Issue
Block a user