Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc FAKE fixes #1783

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open

Misc FAKE fixes #1783

wants to merge 40 commits into from

Conversation

hensldm
Copy link
Collaborator

@hensldm hensldm commented Jan 7, 2025

Tried going through and fixing things marked as FAKE.
Note there are some that I couldn't fully fix, but was able to find a way to match with an if (1) instead. In those cases I did change them to imo the better fake match.

@@ -1687,9 +1687,8 @@ PlayerExplosive Player_GetExplosiveHeld(Player* player) {
PlayerSword Player_SwordFromIA(Player* player, PlayerItemAction itemAction) {
PlayerSword sword = PLAYER_SWORD_KOKIRI;

//! FAKE:
if ((itemAction == PLAYER_IA_LAST_USED) ||
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note I just removed the fake label here as I actually don't think this is a fake.

//! FAKE:
// https://decomp.me/scratch/JrEnl
Matrix_MultVec3f(&(init->elements + i)->dim.vtx[j], &sp54[j]);
Matrix_MultVec3f(init->elements[i].dim.vtx + j, &sp54[j]);
Copy link
Collaborator Author

@hensldm hensldm Jan 7, 2025

Choose a reason for hiding this comment

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

Looks better (though might still be considered a fake). Note this matches what was already in func_809CE068 in BgSpdweb

//! FAKE:
csId = CutsceneManager_GetAdditionalCsId(this->csIdList[i] = csId);
// clang-format off
this->csIdList[i] = csId; \
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Perhaps still a fake, but I prefer this over what it was. Possibly a macro of some kind?

@@ -3803,29 +3802,28 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
}
}
} else if (limbIndex == PLAYER_LIMB_HEAD) {
//! FAKE:
if (((*dList1 != NULL) && ((((void)0, player->currentMask)) != (((void)0, PLAYER_MASK_NONE)))) &&
if (((*dList1 != NULL) && ((u32)player->currentMask != PLAYER_MASK_NONE)) &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would this match too?

Suggested change
if (((*dList1 != NULL) && ((u32)player->currentMask != PLAYER_MASK_NONE)) &&
if (((*dList1 != NULL) && ((PlayerMask)player->currentMask != PLAYER_MASK_NONE)) &&

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Does not work. The real solution would be !player->currentMask, but to keep the comparison to the enum we need the u32 cast (see #1783 (comment))

phi_v1 = &arg0->unk_0480[i];
//! FAKE:
if (1) {}
iter = &arg0->unk_0480[i];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it match if you moved the temp here?

Suggested change
iter = &arg0->unk_0480[i];
EnKusa2UnkBssSubStruct2* iter = &arg0->unk_0480[i];

@@ -263,10 +263,8 @@ void EnPoSisters_MatchPlayerY(EnPoSisters* this, PlayState* play) {
// equalize to player height
Math_ApproachF(&this->actor.world.pos.y, player->actor.world.pos.y + 5.0f, 0.5f, 3.0f);

if (this->floatingBobbingTimer == 0) {
if ((u32)this->floatingBobbingTimer == 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is still kinda fake tho

Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you try !this->floatingBobbingTimer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

!this->floatingBobbingTimer is probably the correct solution, yeah. However I thought we decided it was fine to use u32 casts to still keep the explicit comparison to 0 (we at least have multiple examples of it in the repo already).

@@ -1053,10 +1053,7 @@ void EnTrt_ItemGiven(EnTrt* this, PlayState* play) {
break;

default:
//! FAKE:
if (1) {}
this->textId = 0x849;
Copy link
Collaborator

Choose a reason for hiding this comment

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

It may be a good idea to add a comment noting this is lacking the final break;

@hensldm hensldm removed the Needs-first-approval First approval label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants