Skip to content

d_a_b_gnd ~86% equivalent#2329

Merged
TakaRikka merged 18 commits intozeldaret:mainfrom
carter-ktb21:ganondorf-branch
Mar 18, 2025
Merged

d_a_b_gnd ~86% equivalent#2329
TakaRikka merged 18 commits intozeldaret:mainfrom
carter-ktb21:ganondorf-branch

Conversation

@carter-ktb21
Copy link
Copy Markdown
Contributor

No description provided.

@carter-ktb21 carter-ktb21 marked this pull request as ready for review March 17, 2025 00:51
@TakaRikka
Copy link
Copy Markdown
Contributor

make sure you pull in changes from main and fix conflicts. in this case let main overwrite your local changes since its dtk-template stuff

Copy link
Copy Markdown
Contributor

@TakaRikka TakaRikka left a comment

Choose a reason for hiding this comment

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

since most of the functions are still nonmatching anyway i mostly just have cleanup comments or just some tips to remember in the future. i'll probably end up cleaning more when i do a pass over the TU anyway

Comment thread src/d/actor/d_a_b_gnd.cpp Outdated
Comment on lines +77 to +93
// /* 806029D0-806029DC 000000 000C+00 2/2 0/0 0/0 .data cNullVec__6Z2Calc */
// SECTION_DATA static u8 cNullVec__6Z2Calc[12] = {
// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// };

// /* 806029DC-806029F0 00000C 0004+10 0/0 0/0 0/0 .data @1787 */
// #pragma push
// #pragma force_active on
// SECTION_DATA static u32 lit_1787[1 + 4 /* padding */] = {
// 0x02000201,
// /* padding */
// 0x40080000,
// 0x00000000,
// 0x3FE00000,
// 0x00000000,
// };
// #pragma pop
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.

for all data and such that you've set up, it'd be better to just remove the commented out parts. it just kinda bloats everything

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.

I usually leave it only because the data sections are still nonmatching. It makes it easier to search for specific data sections at least for me. Is there an easier way to do so that makes it unnecessary to have them in comments?

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.

For me, I open up the unmodified file in Github if I need to recover one of the placeholder thingy-mabobs.

Comment thread src/d/actor/d_a_b_gnd.cpp Outdated
Comment on lines +95 to +97
/* 806029F0-806029F4 000020 0004+00 1/1 0/0 0/0 .data l_color$3983 */
SECTION_DATA static u8 l_color[4] = {
0x14,
0x0F,
0x00,
0xFF,
static _GXColor l_color = {
20, 15, 0, -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.

for any data that ends in $XXXX, this means that its an "in-function static" and so can be moved into the body of the function that it's used in. also since color values are all unsigned, it'd be better to use 255 (0xFF) rather than -1

Comment thread src/d/actor/d_a_b_gnd.cpp Outdated
Comment on lines +574 to +576
if (i_this->field_0x2738) {
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.

in cases where there's an early return like this with the rest of the block in one scope, i like to remove the else statement since it functionally does nothing anyway. helps clean it up a little

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 1000% agree with Taka here

Comment thread src/d/actor/d_a_b_gnd.cpp Outdated
Comment on lines +4714 to +4726
if (i_this->mpModelMorf->checkFrame(17.0f)) {
i_this->mZ2Creature.startCreatureVoice(Z2SE_EN_GND_ATTACK_G1, -1);
i_this->mZ2Creature.startCreatureVoice(Z2SE_EN_GND_V_ATTACK_G1, -1);
} else {
if (i_this->mpModelMorf->checkFrame(32.0f)) {
i_this->mZ2Creature.startCreatureVoice(Z2SE_EN_GND_ATTACK_G2, -1);
i_this->mZ2Creature.startCreatureVoice(Z2SE_EN_GND_V_ATTACK_G2, -1);
} else {
if (i_this->mpModelMorf->checkFrame(26.0f)) {
i_this->mZ2Creature.startCreatureVoice(Z2SE_EN_GND_MANTEAU, -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.

just gonna use here as an example, but in many patterns like this you can clean these up with just else if's instead of continually nested if's. the less nests the better

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 1000% agree with Taka here as well

Comment thread src/d/actor/d_a_b_gnd.cpp Outdated
// i_this->mZ2Creature.startCreatureVoice(Z2SE_EN_GND_LAND, -1);
// }
// }
// b
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.

remember that isDelete methods always return int

@carter-ktb21 carter-ktb21 changed the title d_a_b_gnd ~79% equivalent d_a_b_gnd ~86% equivalent Mar 17, 2025
@TakaRikka TakaRikka merged commit 58ba86b into zeldaret:main Mar 18, 2025
1 check passed
Stbn-antier pushed a commit to Stbn-antier/tp that referenced this pull request Mar 24, 2025
* Remade fresh fork with clean main branch

* d_a_b_gnd functions are 40% matching

* Some data work

* daB_GND_Execute 26% matching

* daB_GND_Execute 59% matching

* Create and useHeapInit work

* Cleanup work and demo_camera at 50% matching

* h_damage_check 91% matching

* eff_set_h 76% matching

* b_gnd_g_down 82% matching

* general work

* a little bit of improvement on himo_control1

* General work

* Draw at 96%

* Small gake_check work

* Small data cleanup

* NodeCallBack matching and data cleanup
@carter-ktb21 carter-ktb21 deleted the ganondorf-branch branch March 26, 2025 21:30
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.

3 participants