diff --git a/asm/non_matching/bowMoblin/sub_0803C4B0.inc b/asm/non_matching/bowMoblin/sub_0803C4B0.inc deleted file mode 100644 index 4e3a0ffb..00000000 --- a/asm/non_matching/bowMoblin/sub_0803C4B0.inc +++ /dev/null @@ -1,98 +0,0 @@ - - - .syntax unified - - .text - - push {r4, r5, r6, r7, lr} - adds r5, r0, #0 - movs r1, #0 - strb r1, [r5, #0xf] - adds r0, #0x82 - ldrb r0, [r0] - cmp r0, #1 - bne _0803C54C - bl Random - ldr r1, _0803C4F0 @ =gUnk_080CFFA4 - movs r7, #7 - ands r0, r7 - adds r0, r0, r1 - ldrb r0, [r0] - strb r0, [r5, #0xe] - movs r0, #0x80 - strh r0, [r5, #0x24] - adds r0, r5, #0 - bl sub_08049FA0 - cmp r0, #0 - beq _0803C4F4 - bl Random - adds r4, r0, #0 - movs r0, #6 - ands r4, r0 - lsls r0, r4, #2 - strb r0, [r5, #0x15] - b _0803C556 - .align 2, 0 -_0803C4F0: .4byte gUnk_080CFFA4 -_0803C4F4: - adds r0, r5, #0 - bl sub_08049EE4 - adds r4, r0, #0 - adds r6, r5, #0 - adds r6, #0x83 - ldrb r0, [r6] - cmp r0, #0 - bne _0803C520 - bl Random - ldr r2, _0803C51C @ =gUnk_080CFFAC - movs r1, #0xf - ands r1, r0 - adds r1, r1, r2 - movs r0, #0 - ldrsb r0, [r1, r0] - adds r4, r4, r0 - b _0803C53E - .align 2, 0 -_0803C51C: .4byte gUnk_080CFFAC -_0803C520: - bl Random - ldr r1, _0803C548 @ =gUnk_080CFFAC - ands r0, r7 - adds r0, r0, r1 - ldrb r0, [r0] - lsls r0, r0, #0x18 - asrs r0, r0, #0x18 - adds r4, r4, r0 - ldrb r0, [r5, #0xe] - adds r0, #0x10 - strb r0, [r5, #0xe] - ldrb r0, [r6] - subs r0, #1 - strb r0, [r6] -_0803C53E: - adds r0, r4, #4 - movs r1, #0x18 - ands r0, r1 - strb r0, [r5, #0x15] - b _0803C554 - .align 2, 0 -_0803C548: .4byte gUnk_080CFFAC -_0803C54C: - movs r0, #0xc - strb r0, [r5, #0xe] - strh r1, [r5, #0x24] - ldrb r0, [r5, #0x15] -_0803C554: - lsrs r4, r0, #2 -_0803C556: - ldrb r0, [r5, #0x14] - cmp r4, r0 - beq _0803C564 - strb r4, [r5, #0x14] - adds r0, r5, #0 - bl sub_0803C690 -_0803C564: - pop {r4, r5, r6, r7, pc} - .align 2, 0 - - .syntax divided \ No newline at end of file diff --git a/src/enemy/bowMoblin.c b/src/enemy/bowMoblin.c index 74899e8f..5f945054 100644 --- a/src/enemy/bowMoblin.c +++ b/src/enemy/bowMoblin.c @@ -218,15 +218,16 @@ void sub_0803C400(Entity* this) { } } -NONMATCH("asm/non_matching/bowMoblin/sub_0803C4B0.inc", void sub_0803C4B0(Entity* this)) { +void sub_0803C4B0(Entity* this) { u32 dir; this->field_0xf = 0; if (this->field_0x82.HALF.LO == 1) { this->actionDelay = gUnk_080CFFA4[Random() & 7]; this->speed = 0x80; - if (sub_08049FA0(this)) { - this->direction = (Random() & 6) << 2; + dir = Random(); + dir &= 6; + this->direction = dir << 2; } else { dir = sub_08049EE4(this); if (this->field_0x82.HALF.HI == 0) { @@ -236,24 +237,18 @@ NONMATCH("asm/non_matching/bowMoblin/sub_0803C4B0.inc", void sub_0803C4B0(Entity this->actionDelay += 0x10; this->field_0x82.HALF.HI--; } - - dir = (dir + 4) & 0x18; - this->direction = dir; - dir <<= 2; + dir = (this->direction = (dir + 4) & 0x18) >> 2; } } else { this->actionDelay = 0xc; this->speed = this->field_0xf; - dir = this->direction; - dir <<= 2; + dir = this->direction >> 2; } - - if (this->animationState != dir) { + if (dir != this->animationState) { this->animationState = dir; sub_0803C690(this); } } -END_NONMATCH u32 sub_0803C568(Entity* this) { if (this->field_0x80.HALF.HI == 0) {