From 11b81686e550820758414d4e431475218d095e13 Mon Sep 17 00:00:00 2001 From: hatal175 Date: Tue, 11 Jan 2022 14:06:26 +0100 Subject: [PATCH] Match Sturgeon --- asm/non_matching/sturgeon/Sturgeon.inc | 84 -------------------------- src/npc/sturgeon.c | 15 ++--- 2 files changed, 6 insertions(+), 93 deletions(-) delete mode 100644 asm/non_matching/sturgeon/Sturgeon.inc diff --git a/asm/non_matching/sturgeon/Sturgeon.inc b/asm/non_matching/sturgeon/Sturgeon.inc deleted file mode 100644 index b5d0f078..00000000 --- a/asm/non_matching/sturgeon/Sturgeon.inc +++ /dev/null @@ -1,84 +0,0 @@ - .syntax unified - push {r4, r5, lr} - adds r4, r0, #0 - ldrb r1, [r4, #0x10] - movs r0, #2 - ands r0, r1 - cmp r0, #0 - bne _08064ABC - ldr r0, _08064AB8 @ =gUnk_0810FA44 - ldrb r1, [r4, #0xc] - lsls r1, r1, #2 - adds r1, r1, r0 - ldr r1, [r1] - adds r0, r4, #0 - bl _call_via_r1 - adds r0, r4, #0 - bl sub_0806ED78 - b _08064B42 - .align 2, 0 -_08064AB8: .4byte gUnk_0810FA44 -_08064ABC: - ldrb r1, [r4, #0xc] - adds r5, r1, #0 - cmp r5, #0 - bne _08064AE4 - ldr r1, _08064AE0 @ =gUnk_0810FA38 - adds r0, r4, #0 - bl LoadExtraSpriteData - cmp r0, #0 - beq _08064B42 - movs r0, #1 - strb r0, [r4, #0xc] - strb r5, [r4, #0xe] - adds r0, r4, #0 - bl sub_0807DD50 - b _08064B42 - .align 2, 0 -_08064AE0: .4byte gUnk_0810FA38 -_08064AE4: - movs r0, #0x80 - ands r0, r1 - lsls r0, r0, #0x18 - lsrs r3, r0, #0x18 - cmp r3, #0 - beq _08064B00 - adds r0, r4, #0 - bl UpdateFuseInteraction - cmp r0, #0 - beq _08064B42 - movs r0, #1 - strb r0, [r4, #0xc] - b _08064B42 -_08064B00: - adds r2, r4, #0 - adds r2, #0x39 - movs r0, #0 - ldrsb r0, [r2, r0] - cmp r0, #2 - bne _08064B34 - movs r0, #0xff - orrs r0, r1 - strb r0, [r4, #0xc] - strb r3, [r2] - ldr r1, _08064B30 @ =gPlayerEntity - adds r0, r4, #0 - bl GetFacingDirection - bl sub_0806F5A4 - adds r1, r0, #0 - adds r0, r4, #0 - bl InitAnimationForceUpdate - adds r0, r4, #0 - bl sub_0806F118 - b _08064B42 - .align 2, 0 -_08064B30: .4byte gPlayerEntity -_08064B34: - adds r0, r4, #0 - movs r1, #0 - bl sub_0807DD94 - adds r0, r4, #0 - bl sub_08064C9C -_08064B42: - pop {r4, r5, pc} - .syntax divided diff --git a/src/npc/sturgeon.c b/src/npc/sturgeon.c index f55788f1..5961a0e1 100644 --- a/src/npc/sturgeon.c +++ b/src/npc/sturgeon.c @@ -13,29 +13,27 @@ void sub_08064CC0(Entity* this); extern void (*const gUnk_0810FA44[])(Entity*); void sub_08064C9C(Entity* this); -NONMATCH("asm/non_matching/sturgeon/Sturgeon.inc", void Sturgeon(Entity* this)) { - u8 uVar2; - +void Sturgeon(Entity* this) { if ((this->flags & 2) == 0) { gUnk_0810FA44[this->action](this); sub_0806ED78(this); } else { - uVar2 = this->action; - if (uVar2 == 0) { + if (this->action == 0) { if (LoadExtraSpriteData(this, &gUnk_0810FA38) != 0) { this->action = 1; this->actionDelay = 0; sub_0807DD50(this); } } else { - if ((uVar2 & 0x80) != 0) { + u32 tmp = this->action & 0x80; + if (tmp) { if (UpdateFuseInteraction(this) != 0) { this->action = 1; } } else { if (this->interactType == 2) { - this->action = 0xff; - this->interactType = uVar2 & 0x80; + this->action = this->action | 0xff; + this->interactType = tmp; InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity))); sub_0806F118(this); } else { @@ -46,7 +44,6 @@ NONMATCH("asm/non_matching/sturgeon/Sturgeon.inc", void Sturgeon(Entity* this)) } } } -END_NONMATCH void sub_08064B44(Entity* this) { if (LoadExtraSpriteData(this, &gUnk_0810FA38) != 0) {