Skip to content

d_a_npc_coach work#2579

Merged
hatal175 merged 8 commits intozeldaret:mainfrom
carter-ktb21:d_a_npc_coach
Aug 12, 2025
Merged

d_a_npc_coach work#2579
hatal175 merged 8 commits intozeldaret:mainfrom
carter-ktb21:d_a_npc_coach

Conversation

@carter-ktb21
Copy link
Copy Markdown
Contributor

No description provided.

@decomp-dev
Copy link
Copy Markdown

decomp-dev bot commented Aug 11, 2025

Report for GZ2E01 (58a6d8d - aca0d94)

📈 Matched code: 77.05% (+0.10%, +11776 bytes)

✅ 44 new matches
Unit Function Bytes Before After
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::createHeap() +1556 0.26% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::draw() +1093 0.36% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::calcHarnessMotion() +893 0.45% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::execute() +861 0.46% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::checkCoachDamage() +789 0.51% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::setBaseMtx() +740 0.54% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::daNpcCoach_c() +718 5.08% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::initCoachPosition(Vec&, SVec&) +709 0.56% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::~daNpcCoach_c() +493 14.58% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::initCoachBlazing() +480 0.83% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::hitFireArrow(cXyz) +321 1.23% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcChCoach_c::~daNpcChCoach_c() +234 20.12% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcChHarness_c::~daNpcChHarness_c() +202 22.60% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach dCcD_Cyl::~dCcD_Cyl() +200 1.96% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach jointCoachCallBack(J3DJoint*, int) +189 2.08% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::create() +160 2.44% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::ctrlJointHorse(J3DJoint*, J3DModel*) +152 2.56% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach dCcD_Cyl::dCcD_Cyl() +129 3.03% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach arrowStickCallBack(dBgW*, fopAc_ac_c*, fopAc_ac_c*, cXyz&) +117 3.33% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach dBgS_AcchCir::~dBgS_AcchCir() +109 3.57% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach dBgS_ObjAcch::~dBgS_ObjAcch() +109 3.57% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach dCcD_GStts::~dCcD_GStts() +89 4.35% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach s_sub(void*, void*) +85 4.55% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach jointHorseCallBack(J3DJoint*, int) +81 4.76% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::setPosAngle(cXyz&, csXyz&) +81 4.76% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach J3DFrameCtrl::~J3DFrameCtrl() +69 5.56% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach cM3dGPla::~cM3dGPla() +69 5.56% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach cM3dGSph::~cM3dGSph() +69 5.56% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach cM3dGCyl::~cM3dGCyl() +69 5.56% 100.00%
d_a_npc_coach/d/actor/d_a_npc_coach cM3dGAab::~cM3dGAab() +69 5.56% 100.00%

...and 14 more new matches

📈 18 improvements in unmatched functions
Unit Function Bytes Before After
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::calcHorseAnm() +2844 0.14% 97.83%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::calcCoachMotion() +2605 0.15% 99.86%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::create_init() +1841 0.21% 98.58%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::calcHorsePath() +1787 0.21% 95.30%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::calcRearWheelRotate() +1646 0.24% 98.22%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::calcFrontWheelRotate() +1646 0.24% 98.23%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::reinsExecute() +1124 0.33% 91.78%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::calcHorseMotion() +964 0.41% 99.12%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::changeAtherPath(signed char, cXyz&, csXyz&) +854 0.46% 98.35%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::reinsInit() +799 0.46% 91.62%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::initCollision() +766 0.50% 95.42%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::setCoachBlazing(unsigned char) +742 0.52% 96.53%
d_a_npc_coach/d/actor/d_a_npc_coach daNpcCoach_c::deleteFireArrow(unsigned int) +279 1.23% 87.21%
d_a_npc_coach/d/actor/d_a_npc_coach jointFrontWheelCallBack(J3DJoint*, int) +219 1.79% 99.20%
d_a_npc_coach/d/actor/d_a_npc_coach jointRearWheelCallBack(J3DJoint*, int) +219 1.79% 99.20%
d_a_npc_theB/d/actor/d_a_npc_theB daNpcTheB_c::daNpcTheB_c() +83 12.21% 33.68%
d_a_npc_theB/d/actor/d_a_npc_theB daNpcTheB_c::~daNpcTheB_c() +10 18.54% 20.62%
d_a_npc_theB/d/actor/d_a_npc_theB daNpcTheB_c::main() +1 0.68% 0.96%

/* 0x0F0 */ cXyz field_0xf0[10];
/* 0x168 */ f32 field_0x168;
/* 0x16C */ s8 field_0x16c;
/* 0x16D */ u8 field_0x16d[0x170 - 0x16d];
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.

field_0x16d can be removed

/* 0x1C */ s16 field_0x1c;
/* 0x1E */ s16 field_0x1e;
/* 0x20 */ s16 field_0x20;
/* 0x22 */ u8 field_0x22[0x24 - 0x22];
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.

I don't think field_0x22 is needed. not sure though

/* 0x798 */ s16 mCoachRot;
/* 0x79A */ csXyz field_0x79a;
/* 0x7A0 */ csXyz field_0x7a0;
/* 0x7A6 */ u8 field_0x7a6[0x7a8 - 0x7a6];
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.

field_0x7a6 not needed

16.0f,
62.0f,
-58.837898f,
67.626999f,
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.

67.627 not good enough?

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 might be a quirk with beautify_anm_data. @carter-ktb21 , please confirm.

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.

nope that was my bad!


if (field_0x24c0 < 5) {
for (int i = 0; i < 5; i++) {
if (field_0x247c[i] == 0xFFFFFFFF) {
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.

fpcM_ERROR_PROCESS_ID_e

sVar2 = -0x1194;
}

if (sVar1 > 0x1194) {
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.

That's 4500 in decimal - seems prettier

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.

💯. @carter-ktb21 , if you're using objdiff 3+, you can right click hex values to see their decimal values. If the number looks prettier as decimal, then use decimal.

Comment on lines +21 to +22
inline s32 getId() { return field_0xf00; }
inline s32 checkBombDrop() { return field_0xf04; }
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.

inline keyword shouldnt be needed here since its declared in-class


struct daNpcChPath_c {
inline BOOL setPath(int, int, cXyz*, bool);
inline BOOL isClose() { return dPath_ChkClose(mpPath); }
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.

same thing with the in-class inlines here

/* 0x9C */ s32 deceleration_time; // 減速時間 - Deceleration Time
};

struct daNpcChReins_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.

structs that end with _c are presumed to be classes originally

Comment on lines +54 to +55
inline void setTRMtx(MtxP mtx) { mpMorf->getModel()->setBaseTRMtx(mtx); }
inline void setGameOver() { mGameOver = 1; }
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.

same thing about inlines here

param_1 = 0;
uVar2 = 0;
attention_info.flags = 0;
} else {
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 these else nested be condensed?

attention_info.flags = 0;
} else {
if (mCoachBlazing) {
// uVar2 = param_1;
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.

unnecessary comment?

@hatal175 hatal175 merged commit 4ade12f into zeldaret:main Aug 12, 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.

4 participants