1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-16 21:05:12 +00:00

Decompile the last function in z_en_heishi2.c (#195)

This commit is contained in:
Roman971 2020-06-07 18:37:44 +02:00 committed by GitHub
parent b2df45ae06
commit 93e8dbcc9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 50 additions and 288 deletions

View file

@ -678,91 +678,67 @@ void func_80A546DC(EnHeishi2* this, GlobalContext* globalCtx) {
}
}
/*
// can't get this to match, i think it's mostly functionally equivalent
void func_80A5475C(EnHeishi2* this, GlobalContext* globalCtx) {
Actor* thisx;
s16 yawDiff;
s16 yawDiffTemp;
s16 phi_v0;
thisx = &this->actor;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
if (Text_GetFaceReaction(globalCtx, 5) != 0) {
if (this->unk_30B == 0) {
if (this->initParams == 2) {
this->actionFunc = func_80A53278;
return;
}
if (this->initParams == ((((u16)5) & 0xFFu))) {
if (this->initParams == 5) {
this->actionFunc = func_80A5399C;
return;
}
}
} else {
if (this->unk_30B != 0) {
if (this->initParams == 2) {
this->actionFunc = func_80A53278;
return;
}
if (5 == this->initParams) {
this->actionFunc = func_80A5399C;
return;
}
} else if (this->unk_30B != 0) {
if (this->initParams == 2) {
this->actionFunc = func_80A53278;
return;
}
if (this->initParams == 5) {
this->actionFunc = func_80A5399C;
return;
}
}
if ((func_8002F194(thisx, globalCtx) != 0)) {
if (func_8002F194(&this->actor, globalCtx)) {
if (this->initParams == 2) {
if (this->unk_30E == 1) {
this->actionFunc = func_80A5344C;
return;
}
this->actionFunc = func_80A53278;
return;
}
if (this->initParams == 5) {
phi_v0 = this->unk_300;
if (phi_v0 == 6) {
this->actionFunc = func_80A5399C;
phi_v0 = this->unk_300;
do {
phi_v0 = this->unk_300;
} while (0);
}
if (phi_v0 == 5) {
this->actionFunc = func_80A54954;
phi_v0 = this->unk_300;
do {
phi_v0 = this->unk_300;
} while (0);
}
if (phi_v0 != 4) {
} else {
this->actionFunc = func_80A53278;
return;
}
this->unk_309 = 1;
func_80078884(0x4807);
this->actionFunc = func_80A540C0;
} else if (this->initParams == 5) {
if (this->unk_300 == 6) {
this->actionFunc = func_80A5399C;
}
if (this->unk_300 == 5) {
this->actionFunc = func_80A54954;
}
if (this->unk_300 == 4) {
this->unk_309 = 1;
func_80078884(0x4807);
this->actionFunc = func_80A540C0;
}
return;
}
}
phi_v0 = this->initParams;
} else {
if (this->initParams == 2) {
yawDiffTemp = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
yawDiff = ABS(yawDiffTemp);
if ((!(120.0f < this->actor.xzDistanceFromLink)) && (yawDiff < 0x4300)) {
func_8002F2F4(thisx, globalCtx);
}
}
if (((this->initParams != 2) && (this->initParams != 5)) ||
((yawDiff = ABS((s16)(this->actor.rotTowardsLinkY - this->actor.shape.rot.y)),
!(this->actor.xzDistanceFromLink > 120.0f)) &&
(yawDiff < 0x4300))) {
func_8002F2F4(&this->actor, globalCtx);
}
}
*/
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Heishi2/func_80A5475C.s")
void func_80A54954(EnHeishi2* this, GlobalContext* globalCtx) {
f32 frameCount = SkelAnime_GetFrameCount(&D_06005C30.genericHeader);