Match sub_0802CF8C

This commit is contained in:
Tal Hayon
2022-08-10 22:04:06 +03:00
parent dd59d70447
commit 5b44390e0e
2 changed files with 12 additions and 52 deletions
+12 -9
View File
@@ -165,23 +165,26 @@ void sub_0802CF64(Entity* this) {
sub_0802CF8C(this);
}
NONMATCH("asm/non_matching/wallMaster2/sub_0802CF8C.inc", void sub_0802CF8C(Entity* this)) {
void sub_0802CF8C(Entity* this) {
int iVar1;
u32 uVar2;
u32 dir;
const u16* ptr;
u16* ptr2;
uVar2 = (this->direction + 2) & 0x1c;
if ((uVar2 - this->animationState * 4 + 6 > 0xc) ||
((((this->direction + 1) & 7) > 2 && (uVar2 >> 2 != this->animationState)))) {
this->animationState = (uVar2 >> 2);
iVar1 = (uVar2 >> 3) * 2;
dir = Direction8RoundUp(this->direction);
if (dir - Direction8FromAnimationState(this->animationState) + 6 > 12) {
this->animationState = Direction8ToAnimationState(dir);
iVar1 = (dir >> 3) * 2;
ptr = &gUnk_080CD730[iVar1];
this->field_0x74.HWORD = ptr[0];
this->field_0x76.HWORD = ptr[1];
} else if (((this->direction + 1) & 7) > 2 && (Direction8ToAnimationState(dir) != this->animationState)) {
this->animationState = Direction8ToAnimationState(dir);
iVar1 = (dir >> 3) * 2;
ptr = &gUnk_080CD730[iVar1];
this->field_0x74.HWORD = ptr[0];
this->field_0x76.HWORD = ptr[1];
}
}
END_NONMATCH
void sub_0802CFD8(Entity* this) {
u32 unk = gUnk_080CD740[(this->field_0x7a.HALF.LO++ >> 3) & 7];