Match festari/sub_0805FE48

This commit is contained in:
Marcus Huderle 2020-08-07 17:45:48 -05:00
parent 5963472d01
commit 122084a78e
2 changed files with 40 additions and 154 deletions

View File

@ -1,110 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
push {r4, r5, r6, r7, lr}
adds r5, r0, #0
adds r2, r5, #0
adds r2, #0x39
movs r1, #0
ldrsb r1, [r2, r1]
cmp r1, #2
bne _0805FE80
movs r0, #0
strb r1, [r5, #0xc]
strb r0, [r2]
ldr r1, _0805FE7C @ =gLinkEntity
adds r0, r5, #0
bl GetFacingDirection
bl sub_0806F5A4
adds r1, r0, #0
adds r0, r5, #0
bl InitAnimationForceUpdate
adds r0, r5, #0
bl sub_0806F118
b _0805FF14
.align 2, 0
_0805FE7C: .4byte gLinkEntity
_0805FE80:
adds r4, r5, #0
adds r4, #0x84
ldr r1, [r4]
adds r0, r5, #0
bl ExecuteScriptCommandSet
ldr r1, [r4]
adds r0, r5, #0
bl sub_0805FF2C
adds r0, r5, #0
adds r0, #0x80
ldrh r3, [r0]
adds r7, r0, #0
adds r6, r5, #0
adds r6, #0x82
cmp r3, #7
bhi _0805FEC6
ldrh r1, [r6]
movs r0, #1
ands r0, r1
cmp r0, #0
beq _0805FEBA
movs r1, #0xfc
ands r1, r3
ldrb r0, [r5, #0xf]
lsrs r0, r0, #1
adds r3, r1, r0
b _0805FEC6
_0805FEBA:
movs r0, #0xfc
ands r0, r3
ldrb r2, [r5, #0x14]
lsrs r1, r2, #1
adds r3, r0, r1
strb r2, [r5, #0xf]
_0805FEC6:
adds r4, r5, #0
adds r4, #0x58
ldrb r0, [r4]
cmp r3, r0
beq _0805FED8
adds r0, r5, #0
adds r1, r3, #0
bl InitAnimationForceUpdate
_0805FED8:
adds r0, r5, #0
bl UpdateAnimationSingleFrame
adds r0, r5, #0
adds r0, #0x5a
ldrb r1, [r0]
movs r0, #0x80
ands r0, r1
cmp r0, #0
beq _0805FF02
ldrb r0, [r4]
cmp r0, #8
beq _0805FEFE
cmp r0, #8
blt _0805FF02
cmp r0, #0xc
bgt _0805FF02
cmp r0, #0xa
blt _0805FF02
_0805FEFE:
movs r0, #0
strh r0, [r7]
_0805FF02:
ldrh r1, [r6]
mvns r0, r1
adds r0, #1
ands r1, r0
cmp r1, #2
bne _0805FF14
adds r0, r5, #0
bl sub_0806ED78
_0805FF14:
pop {r4, r5, r6, r7, pc}
.align 2, 0
.syntax divided

View File

@ -1,5 +1,6 @@
#include "global.h"
#include "entity.h"
#include "functions.h"
#include "npc.h"
#include "link.h"
@ -30,58 +31,53 @@ void sub_0805FE10(Entity *this)
sub_0807DD50(this);
}
#if NON_MATCHING
void sub_0805FE48(Entity *this)
{
u8 bVar1;
u16 uVar2;
u32 uVar3;
u32 uVar4;
u8 bVar1;
u16 uVar2;
u32 uVar3;
u32 uVar4;
if (this->interactType == 2) {
this->action = 2;
this->interactType = 0;
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
sub_0806F118(this);
}
else {
ExecuteScriptCommandSet(this, *(void **)&this->cutsceneBeh);
sub_0805FF2C(this, *(void **)&this->cutsceneBeh);
if (this->field_0x80 < 8) {
if ((this->field_0x82 & 1) != 0) {
uVar4 = (uVar4 & 0xfc) + (this->field_0xf >> 1);
}
else {
uVar4 = (uVar4 & 0xfc) + (this->animationState >> 1);
this->field_0xf = this->animationState;
}
if (this->interactType == 2) {
this->action = 2;
this->interactType = 0;
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
sub_0806F118(this);
}
if (uVar4 != this->animIndex) {
InitAnimationForceUpdate(this, uVar4);
}
UpdateAnimationSingleFrame(this);
else {
ExecuteScriptCommandSet(this, *(void **)&this->cutsceneBeh);
sub_0805FF2C(this, *(void **)&this->cutsceneBeh);
uVar4 = this->field_0x80.HWORD;
if (uVar4 < 8) {
if ((this->field_0x82.HWORD & 1) != 0) {
uVar4 = (uVar4 & 0xfc) + (this->field_0xf >> 1);
}
else {
uVar4 = (uVar4 & 0xfc) + (this->animationState >> 1);
this->field_0xf = this->animationState;
}
}
if (uVar4 != this->animIndex) {
InitAnimationForceUpdate(this, uVar4);
}
UpdateAnimationSingleFrame(this);
if (this->frames.b.f3)
{
switch (this->animIndex) {
case 8:
case 10:
case 11:
case 12:
this->field_0x80 = 0;
if (this->frames.b.f3)
{
switch (this->animIndex) {
case 8:
case 10:
case 11:
case 12:
this->field_0x80.HWORD = 0;
break;
}
}
if ((this->field_0x82.HWORD & (~this->field_0x82.HWORD + 1)) == 2) {
sub_0806ED78(this);
}
}
if ((this->field_0x82 & (~this->field_0x82 + 1)) == 2) {
sub_0806ED78(this);
}
}
}
#else
NAKED
void sub_0805FE48(Entity *this) {
asm(".include \"asm/non_matching/festari/sub_0805FE48.inc\"");
}
#endif
void sub_0805FF18(Entity *this)
{