Skip to content

d_a_fr and d_a_obj_lp work#2372

Merged
TakaRikka merged 6 commits intozeldaret:mainfrom
carter-ktb21:d_a_fr
Apr 5, 2025
Merged

d_a_fr and d_a_obj_lp work#2372
TakaRikka merged 6 commits intozeldaret:mainfrom
carter-ktb21:d_a_fr

Conversation

@carter-ktb21
Copy link
Copy Markdown
Contributor

No description provided.

/* 0x5C4 */ mDoExt_McaMorf* mMorf;
/* 0x5C8 */ mDoExt_btkAnm* mBtkAnm;
/* 0x5CC */ u8 field_0x5cc;
/* 0x5CD */ char field_0x5cd;
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.

s8 is preferred over char unless it's an actual string

Comment on lines +73 to +82
base_process_class* baseProcess = fpcM_Search(s_wd_sub, i_this);
if (baseProcess) {
layer_class** layer = &baseProcess[7].delete_tag.layer;
for (int i = 0; i < (int)baseProcess[0xec].delete_tag.base.mpNode.mpData; i++) {
cXyz sp48 = *(cXyz*)layer - i_this->current.pos;
if (sp48.abs() < *(f32*)layer * 22.0f) {
return (int)layer;
}

layer = layer + 0x15;
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 is supposed to be some actor class belonging to obj_lp based on the search func

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.

How were you able to tell?

case 2:
if (i_this->mMorf->isStop()) {
anm_init(i_this, 8, 1.0f, 0, 1.0f);
i_this->speedF = l_HIO[2] + cM_rndFX(l_HIO[2] * 0.5f);
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.

l_HIO should be set to it's actual HIO class

Comment on lines +398 to +404
if (i_this->shape_angle.x > 0x1000) {
i_this->shape_angle.x = 0x1000;
} else {
if (i_this->shape_angle.x < -0x2000) {
i_this->shape_angle.x = -0x2000;
}
}
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 nesting

Comment on lines +414 to +419
} else {
if (((i_this->field_0x994 == -1 || !daPy_py_c::checkNowWolf()) && i_this->field_0x5d2 != 5) && i_this->field_0x5d8 < l_HIO[6]) {
i_this->field_0x5d2 = 5;
i_this->field_0x5d4 = 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.

unnecessary nesting

Comment on lines +549 to +567
} else {
if (dComIfGp_event_runCheck() && i_this->eventInfo.checkCommandTalk()) {
i_this->mMsgFlow.init(i_this, i_this->field_0x994, 0, NULL);
i_this->field_0x992 = 1;

OS_REPORT("////////FR MSG FNO %d\n", i_this->field_0x994);
}

if ((i_this->field_0x991 == 2 && i_this->field_0x994 != -1) && daPy_py_c::checkNowWolf()) {
fopAcM_OnStatus(i_this, 0);
cLib_onBit<u32>(i_this->attention_info.flags, 10);
i_this->eventInfo.onCondition(1);
} else {
fopAcM_OffStatus(i_this, 0);
cLib_offBit<u32>(i_this->attention_info.flags, 1);
}

return 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.

there's an early return, so this nest can be removed

// NONMATCHING
if (cDmrNowMidnaTalk()) {
return 1;
} 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.

early return so this nest can be removed


/* 8051B354-8051B35C 001B54 0008+00 1/0 0/0 0/0 .text daFr_IsDelete__FP8fr_class */
static bool daFr_IsDelete(fr_class* param_0) {
static bool daFr_IsDelete(fr_class* 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.

returns int

Comment on lines +638 to +650
} else {
i_this->mBtkAnm = new mDoExt_btkAnm();
if (!i_this->mBtkAnm) {
return 0;
} else {
if (i_this->mBtkAnm->init(i_this->mMorf->getModel()->getModelData(), (J3DAnmTextureSRTKey*)dComIfG_getObjectRes("Fr", 17),
1, 0, 1.0f, 0, -1)) {
return 0;
} else {
return 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.

a lot of unnecessary nesting because of early returns

if (!fopAcM_entrySolidHeap(i_this, useHeapIfrt, 0x14e0)) {
OS_REPORT("//////////////FR SET NON !!\n");
return cPhs_ERROR_e;
} 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.

unnecessary nesting

/* 0x04 */ char field_0x4;
void genMessage(JORMContext*);

/* 0x00 */ J3DFrameCtrl* field_0x0;
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 is a fake member, the first 4 bytes should be taken up by the vtable by making the destructor virtual, which should also be inlined

/* 0x0010 */ cXyz field_0x10[84];
};

STATIC_ASSERT(sizeof(wd_ss) == 0x400); // Could be incorrect size
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.

if the size isn't certainly known i'd prefer not putting a static assert for it yet


dComIfGp_addSimpleModel(modelData, fopAcM_GetRoomNo(i_this), 0);
if (modelData == NULL) {
OS_REPORT(1Bh,"[43;30mリリーパッド:シンプルモデル登録失敗しました。\n",1Bh,"[m");
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 will break debug rom building, add the 0x1B to the string by doing something like \x1B

@carter-ktb21 carter-ktb21 changed the title d_a_fr work d_a_fr and d_a_obj_lp work Apr 4, 2025
@TakaRikka
Copy link
Copy Markdown
Contributor

you have a compile error that'll need to be fixed

@TakaRikka TakaRikka merged commit d640fb8 into zeldaret:main Apr 5, 2025
1 check passed
@carter-ktb21 carter-ktb21 deleted the d_a_fr branch April 9, 2025 11:54
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