Match sub_08022E40

This commit is contained in:
Tal Hayon 2022-08-25 23:17:20 +03:00
parent 0b9a4310d9
commit e866e5620b
2 changed files with 7 additions and 72 deletions

View File

@ -1,62 +0,0 @@
.syntax unified
.text
push {r4, r5, lr}
adds r4, r0, #0
ldrh r1, [r4, #0x2e]
adds r0, #0x74
strh r1, [r0]
ldrh r0, [r4, #0x32]
adds r1, r4, #0
adds r1, #0x76
strh r0, [r1]
ldr r2, [r4, #0x50]
adds r2, #0x79
ldrb r0, [r2]
adds r0, #1
movs r3, #7
ands r0, r3
adds r0, #0x7c
adds r0, r4, r0
ldrb r1, [r0]
movs r0, #0xf
ands r0, r1
subs r0, #8
lsrs r1, r1, #4
lsls r0, r0, #0x18
asrs r0, r0, #0x18
ldrh r5, [r4, #0x2e]
adds r0, r0, r5
strh r0, [r4, #0x2e]
subs r1, #8
ldrh r0, [r4, #0x32]
adds r1, r1, r0
strh r1, [r4, #0x32]
adds r1, r4, #0
adds r1, #0x84
ldrb r0, [r2]
adds r0, #1
ands r0, r3
lsls r0, r0, #2
ldr r1, [r1]
lsrs r1, r0
movs r0, #7
ands r1, r0
strb r1, [r4, #0x14]
ldrb r0, [r4, #0xa]
cmp r0, #3
bne _08022EA2
adds r0, r1, #0
adds r0, #0xa
strb r0, [r4, #0x1e]
b _08022EA8
_08022EA2:
adds r0, r4, #0
bl sub_08022EAC
_08022EA8:
pop {r4, r5, pc}
.align 2, 0
.syntax divided

View File

@ -146,12 +146,9 @@ void sub_08022DE8(Entity* this) {
}
}
// this definition is only here, so clang-tidy does not mess gUnk_080CBBBC up.
extern void sub_08022E40(Entity* this);
NONMATCH("asm/non_matching/moldorm/sub_08022E40.inc", void sub_08022E40(Entity* this)) {
void sub_08022E40(Entity* this) {
u32 bVar1;
u32 bVar2;
u32 animationState;
u32 tmp;
u32 tmp2;
u8* ptr;
@ -159,21 +156,21 @@ NONMATCH("asm/non_matching/moldorm/sub_08022E40.inc", void sub_08022E40(Entity*
this->field_0x74.HWORD = this->x.HALF.HI;
this->field_0x76.HWORD = this->y.HALF.HI;
tmp2 = (this->parent->field_0x78.HALF.HI + 1) & 7;
bVar1 = ((u8*)&this->field_0x7c)[tmp2];
ptr = (u8*)&this->field_0x7c + tmp2;
bVar1 = *ptr;
tmp = (bVar1 & 0xf) - 8;
bVar1 >>= 4;
this->x.HALF.HI = ((short)((tmp * 0x100)) >> 8) + this->x.HALF.HI;
bVar1 -= 8;
this->y.HALF.HI = bVar1 + this->y.HALF.HI;
bVar2 = (u8)(*(u32*)&this->cutsceneBeh >> (((this->parent->field_0x78.HALF.HI + 1) & 7) << 2)) & 7;
this->animationState = bVar2;
animationState = (u8)(*(u32*)&this->cutsceneBeh >> (((this->parent->field_0x78.HALF.HI + 1) & 7) << 2)) & 7;
this->animationState = animationState;
if (this->type == 3) {
this->frameIndex = bVar2 + 10;
this->frameIndex = animationState + 10;
} else {
sub_08022EAC(this);
}
}
END_NONMATCH
void sub_08022EAC(Entity* this) {
int iVar1;