From 12e5608104c4fa141858715bc1e4c1fa912b44c0 Mon Sep 17 00:00:00 2001 From: theo3 Date: Wed, 30 Mar 2022 19:31:09 -0700 Subject: [PATCH] sub_080385CC ok --- .../cloudPiranha/sub_080385CC.inc | 65 ------------------- src/enemy/cloudPiranha.c | 9 +-- 2 files changed, 2 insertions(+), 72 deletions(-) delete mode 100644 asm/non_matching/cloudPiranha/sub_080385CC.inc diff --git a/asm/non_matching/cloudPiranha/sub_080385CC.inc b/asm/non_matching/cloudPiranha/sub_080385CC.inc deleted file mode 100644 index 1c1502d3..00000000 --- a/asm/non_matching/cloudPiranha/sub_080385CC.inc +++ /dev/null @@ -1,65 +0,0 @@ - .syntax unified - push {r4, r5, r6, lr} - adds r4, r0, #0 - bl sub_080387F0 - adds r0, r4, #0 - movs r1, #0x60 - bl sub_0803872C - cmp r0, #0 - beq _08038604 - movs r0, #3 - strb r0, [r4, #0xc] - movs r0, #0xc - strb r0, [r4, #0xf] - movs r0, #0x80 - strh r0, [r4, #0x24] - ldr r1, [r4, #0x54] - adds r0, r4, #0 - bl sub_0806FCAC - strb r0, [r4, #0x14] - lsls r0, r0, #2 - strb r0, [r4, #0x15] - ldrb r1, [r4, #0x14] - adds r0, r4, #0 - bl InitializeAnimation - b _08038648 -_08038604: - ldrb r0, [r4, #0xf] - subs r0, #1 - strb r0, [r4, #0xf] - lsls r0, r0, #0x18 - cmp r0, #0 - bne _08038648 - movs r6, #0x10 - strb r6, [r4, #0xf] - ldr r1, [r4, #0x54] - cmp r1, #0 - beq _08038622 - adds r0, r4, #0 - bl sub_0806FCAC - b _08038638 -_08038622: - ldrb r5, [r4, #0x14] - bl Random - ands r0, r6 - cmp r0, #0 - beq _08038632 - adds r1, r5, #2 - b _08038634 -_08038632: - adds r1, r5, #6 -_08038634: - movs r0, #7 - ands r0, r1 -_08038638: - strb r0, [r4, #0x14] - ldrb r0, [r4, #0x14] - lsls r0, r0, #2 - strb r0, [r4, #0x15] - ldrb r1, [r4, #0x14] - adds r0, r4, #0 - bl InitializeAnimation -_08038648: - pop {r4, r5, r6, pc} - .align 2, 0 - .syntax divided diff --git a/src/enemy/cloudPiranha.c b/src/enemy/cloudPiranha.c index 5f4eb371..9e519d4b 100644 --- a/src/enemy/cloudPiranha.c +++ b/src/enemy/cloudPiranha.c @@ -128,7 +128,7 @@ void CloudPiranha_Action1(CloudPiranhaEntity* this) { } } -NONMATCH("asm/non_matching/cloudPiranha/sub_080385CC.inc", void sub_080385CC(CloudPiranhaEntity* this)) { +void sub_080385CC(CloudPiranhaEntity* this) { u32 tmp; sub_080387F0(this); if (sub_0803872C(this, 0x60)) { @@ -145,18 +145,13 @@ NONMATCH("asm/non_matching/cloudPiranha/sub_080385CC.inc", void sub_080385CC(Clo super->animationState = sub_0806FCAC(super, super->child); } else { tmp = super->animationState; - if ((Random() & 0x10) != 0) { - super->animationState = (tmp + 2) & 7; - } else { - super->animationState = (tmp + 6) & 7; - } + super->animationState = (Random() & 0x10) ? ((tmp + 2) & 7) : ((tmp + 6) & 7); } super->direction = super->animationState << 2; InitializeAnimation(super, super->animationState); } } } -END_NONMATCH void CloudPiranha_Action3(CloudPiranhaEntity* this) { s32 tmp;