diff --git a/asm/non_matching/sturgeon/sub_08064B88.inc b/asm/non_matching/sturgeon/sub_08064B88.inc deleted file mode 100644 index c1b3a290..00000000 --- a/asm/non_matching/sturgeon/sub_08064B88.inc +++ /dev/null @@ -1,83 +0,0 @@ - .syntax unified - push {r4, r5, lr} - adds r4, r0, #0 - adds r5, r4, #0 - adds r5, #0x39 - movs r0, #0 - ldrsb r0, [r5, r0] - cmp r0, #1 - beq _08064BFA - cmp r0, #1 - bgt _08064BA2 - cmp r0, #0 - beq _08064BA8 - b _08064BFA -_08064BA2: - cmp r0, #2 - beq _08064BCE - b _08064BFA -_08064BA8: - adds r0, r4, #0 - bl sub_0806EE20 - adds r2, r0, #0 - adds r0, r4, #0 - adds r0, #0x3e - ldrb r0, [r0] - strb r0, [r4, #0x14] - cmp r2, #0 - beq _08064BC6 - movs r1, #0x7f - ands r1, r2 - adds r0, r4, #0 - bl InitializeAnimation -_08064BC6: - adds r0, r4, #0 - bl GetNextFrame - b _08064C28 -_08064BCE: - movs r0, #3 - strb r0, [r4, #0xc] - adds r0, r4, #0 - bl GetAnimationState - adds r1, r0, #0 - cmp r1, #0 - bge _08064BE0 - ldrb r1, [r4, #0x14] -_08064BE0: - adds r0, r4, #0 - adds r0, #0x58 - ldrb r0, [r0] - strb r0, [r4, #0xf] - adds r0, r4, #0 - bl InitializeAnimation - movs r0, #0 - strb r0, [r5] - adds r0, r4, #0 - bl sub_0806F118 - b _08064C28 -_08064BFA: - movs r0, #2 - strb r0, [r4, #0xc] - adds r0, r4, #0 - bl GetAnimationState - adds r1, r0, #0 - cmp r1, #0 - bge _08064C0C - ldrb r1, [r4, #0x14] -_08064C0C: - adds r0, r4, #0 - adds r0, #0x58 - ldrb r0, [r0] - strb r0, [r4, #0xf] - adds r0, r4, #0 - bl InitializeAnimation - adds r1, r4, #0 - adds r1, #0x39 - movs r0, #0 - strb r0, [r1] - adds r0, r4, #0 - bl sub_08064CD8 -_08064C28: - pop {r4, r5, pc} - .align 2, 0 - .syntax divided diff --git a/src/npc/sturgeon.c b/src/npc/sturgeon.c index 90903566..89e06fbb 100644 --- a/src/npc/sturgeon.c +++ b/src/npc/sturgeon.c @@ -14,6 +14,8 @@ void sub_08064CC0(Entity* this); extern void (*const gUnk_0810FA44[])(Entity*); void sub_08064C9C(Entity* this); +void sub_08064CD8(Entity* this); + void Sturgeon(Entity* this) { if ((this->flags & ENT_SCRIPTED) == 0) { gUnk_0810FA44[this->action](this); @@ -57,7 +59,43 @@ void sub_08064B44(Entity* this) { } } -ASM_FUNC("asm/non_matching/sturgeon/sub_08064B88.inc", void sub_08064B88(Entity* this)) +void sub_08064B88(Entity* this) { + s32 temp; + s32 temp2; + + switch (this->interactType) { + case 0: + temp = sub_0806EE20(this); + this->animationState = this->knockbackDirection; + if (temp != 0) { + InitializeAnimation(this, temp & 0x7f); + } + GetNextFrame(this); + break; + case 2: + this->action = 3; + temp2 = GetAnimationState(this); + if (temp2 < 0) { + temp2 = this->animationState; + } + this->subtimer = this->animIndex; + InitializeAnimation(this, temp2); + this->interactType = 0; + sub_0806F118(this); + break; + case 1: + default: + this->action = 2; + temp2 = GetAnimationState(this); + if (temp2 < 0) { + temp2 = this->animationState; + } + this->subtimer = this->animIndex; + InitializeAnimation(this, temp2); + this->interactType = 0; + sub_08064CD8(this); + } +} void sub_08064C2C(Entity* this) { if ((gMessage.doTextBox & 0x7f) == 0) {