Skip to content

d_a_e_mf equivalent and d_a_e_dn work#2492

Merged
hatal175 merged 23 commits intozeldaret:mainfrom
carter-ktb21:d_a_e_mf
Jun 20, 2025
Merged

d_a_e_mf equivalent and d_a_e_dn work#2492
hatal175 merged 23 commits intozeldaret:mainfrom
carter-ktb21:d_a_e_mf

Conversation

@carter-ktb21
Copy link
Copy Markdown
Contributor

No description provided.

@decomp-dev
Copy link
Copy Markdown

decomp-dev bot commented Jun 20, 2025

Report for GZ2E01 (ac06966 - ee452c0)

📈 Matched code: 66.70% (+0.62%, +70676 bytes)

✅ 131 new matches:
Unit Function Bytes Before After
d_a_e_dn/d/actor/d_a_e_dn action(e_dn_class*) +5388 0.07% 100.00%
d_a_e_mf/d/actor/d_a_e_mf action(e_mf_class*) +5325 0.08% 100.00%
d_a_e_mf/d/actor/d_a_e_mf daE_MF_Execute(e_mf_class*) +3293 0.12% 100.00%
d_a_e_dn/d/actor/d_a_e_dn e_dn_damage(e_dn_class*) +2965 0.13% 100.00%
d_a_e_mf/d/actor/d_a_e_mf e_mf_damage(e_mf_class*) +2908 0.14% 100.00%
d_a_e_dn/d/actor/d_a_e_dn e_dn_fight_run(e_dn_class*) +2309 0.17% 100.00%
d_a_e_mf/d/actor/d_a_e_mf e_mf_fight_run(e_mf_class*) +2280 0.18% 100.00%
d_a_e_dn/d/actor/d_a_e_dn e_dn_gakejump(e_dn_class*) +1324 0.30% 100.00%
d_a_e_mf/d/actor/d_a_e_mf e_mf_gakejump(e_mf_class*) +1324 0.30% 100.00%
d_a_e_dn/d/actor/d_a_e_dn e_dn_bomb_action(e_dn_class*) +1289 0.31% 100.00%
d_a_e_mf/d/actor/d_a_e_mf e_mf_bomb_action(e_mf_class*) +1276 0.31% 100.00%
d_a_e_dn/d/actor/d_a_e_dn nodeCallBack(J3DJoint*, int) +1208 0.33% 100.00%
d_a_e_mf/d/actor/d_a_e_mf nodeCallBack(J3DJoint*, int) +1208 0.33% 100.00%
d_a_e_dn/d/actor/d_a_e_dn search_bomb(e_dn_class*, int) +1160 0.34% 100.00%
d_a_e_dn/d/actor/d_a_e_dn e_dn_stay(e_dn_class*) +1153 0.35% 100.00%
d_a_e_mf/d/actor/d_a_e_mf e_mf_stay(e_mf_class*) +1153 0.35% 100.00%
d_a_e_mf/d/actor/d_a_e_mf search_bomb(e_mf_class*, int) +1140 0.35% 100.00%
d_a_e_mf/d/actor/d_a_e_mf e_mf_wolfbite(e_mf_class*) +981 0.41% 100.00%
d_a_e_dn/d/actor/d_a_e_dn damage_check(e_dn_class*) +940 0.42% 100.00%
d_a_e_mf/d/actor/d_a_e_mf damage_check(e_mf_class*) +913 0.44% 100.00%
d_a_e_dn/d/actor/d_a_e_dn e_dn_wolfbite(e_dn_class*) +905 0.44% 100.00%
d_a_e_dn/d/actor/d_a_e_dn daE_DN_Create(fopAc_ac_c*) +873 0.46% 100.00%
d_a_e_dn/d/actor/d_a_e_dn e_dn_normal(e_dn_class*) +853 0.47% 100.00%
d_a_e_mf/d/actor/d_a_e_mf e_mf_normal(e_mf_class*) +853 0.47% 100.00%
d_a_e_dn/d/actor/d_a_e_dn e_dn_otoreac(e_dn_class*) +812 0.49% 100.00%
d_a_e_mf/d/actor/d_a_e_mf e_mf_otoreac(e_mf_class*) +812 0.49% 100.00%
d_a_e_mf/d/actor/d_a_e_mf daE_MF_Create(fopAc_ac_c*) +812 0.49% 100.00%
d_a_e_dn/d/actor/d_a_e_dn e_dn_reg(e_dn_class*) +804 0.50% 100.00%
d_a_e_dn/d/actor/d_a_e_dn anm_se_set(e_dn_class*) +760 0.52% 100.00%
d_a_e_mf/d/actor/d_a_e_mf anm_se_set(e_mf_class*) +760 0.52% 100.00%

...and 101 more new matches

📈 1 improvements in unmatched functions:
Unit Function Bytes Before After
d_a_e_dn/d/actor/d_a_e_dn daE_DN_Execute(e_dn_class*) +3302 0.12% 99.92%

Comment thread include/d/actor/d_a_e_dn.h Outdated
@@ -11,16 +15,152 @@
*
*/
class e_dn_class : public fopEn_enemy_c {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't inherit from fopEn_enemy_c, it has it as a field. When you change it, make sure all a_this assignments take the reference from the member variable

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason, doing this messes up the regalloc for a number of functions. Is there some other variation of that process that it should be?

Comment thread include/d/actor/d_a_e_mf.h Outdated
@@ -11,16 +15,145 @@
*
*/
class e_mf_class : public fopEn_enemy_c {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't inherit from fopEn_enemy_c, it has it as a field. When you change it, make sure all a_this assignments take the reference from the member variable

Comment thread include/d/actor/d_a_e_mf.h Outdated
public:
/* 8070A70C */ daE_MF_HIO_c();
/* 80713464 */ ~daE_MF_HIO_c();
/* 80713464 */ virtual ~daE_MF_HIO_c() {};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

; can be removed

Comment thread src/d/actor/d_a_e_dn.cpp Outdated
cLib_addCalcAngleS2(&i_this->field_0x724.x, -0x4000, 1, 0x300);

if (i_this->mObjAcch.ChkGroundHit()) {
if (a_this->health > 0 && daPy_py_c::checkNowWolf() == 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!daPy_py_c::checkNowWolf()

Comment thread src/d/actor/d_a_e_mf.cpp Outdated
i_this->mAtInfo.mHitStatus = 0;
}

if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_UNK) != 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for != 0

Comment thread src/d/actor/d_a_e_mf.cpp Outdated
}

i_this->field_0x724 |= i_this->mAtInfo.mHitBit;
if (i_this->mAtInfo.mHitType == 16 || i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_HOOKSHOT) != 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for != 0

Comment thread src/d/actor/d_a_e_dn.cpp Outdated
if (i_this->field_0xa9c[i].ChkTgHit() != 0) {
i_this->mAtInfo.mpCollider = i_this->field_0xa9c[i].GetTgHitObj();
if (player->getCutType() != daPy_py_c::CUT_TYPE_WOLF_B_LEFT && player->getCutType() != daPy_py_c::CUT_TYPE_WOLF_B_RIGHT &&
i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_WOLF_ATTACK) != 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for != 0

Comment thread src/d/actor/d_a_e_dn.cpp Outdated
}

i_this->field_0x10da = 3;
if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_10000000) != 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for != 0

Comment thread src/d/actor/d_a_e_dn.cpp Outdated
i_this->mAtInfo.mHitStatus = 0;
}

if (i_this->mAtInfo.mpCollider->ChkAtType(AT_TYPE_UNK) != 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just change all the ChkAtType

Comment thread src/d/actor/d_a_e_dn.cpp
break;

case ACTION_REG:
e_dn_reg(i_this);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add break;
Not technically necessary but good practice if people add cases

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not into it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm

@hatal175
Copy link
Copy Markdown
Contributor

hatal175 commented Jun 20, 2025 via email

@carter-ktb21
Copy link
Copy Markdown
Contributor Author

Did you remove/not remove the pointer conversion? Try doing the opposite.

Could you clarify?

I tried "fopEn_enemy_c* a_this = &i_this->actor;". Is there a different way to do it?

@hatal175
Copy link
Copy Markdown
Contributor

hatal175 commented Jun 20, 2025 via email

@carter-ktb21
Copy link
Copy Markdown
Contributor Author

Add the (fopEn_enemy_c*)

Interesting. That works!

@hatal175 hatal175 merged commit 7025de1 into zeldaret:main Jun 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants