From 3e556b393f498b63d1377b6d7c0480ddb388fcf6 Mon Sep 17 00:00:00 2001 From: Tal Hayon Date: Tue, 19 Jul 2022 05:01:09 +0300 Subject: [PATCH] Match sub_08027BBC --- asm/enemy/chuchuBoss.s | 82 ------------------------------------------ src/enemy/chuchuBoss.c | 37 +++++++++++++++++++ 2 files changed, 37 insertions(+), 82 deletions(-) diff --git a/asm/enemy/chuchuBoss.s b/asm/enemy/chuchuBoss.s index c1ab45a0..2d1b4536 100644 --- a/asm/enemy/chuchuBoss.s +++ b/asm/enemy/chuchuBoss.s @@ -17,88 +17,6 @@ - thumb_func_start sub_08027BBC -sub_08027BBC: @ 0x08027BBC - push {r4, r5, r6, lr} - adds r6, r0, #0 - movs r4, #0 - movs r0, #0xa - strb r0, [r6, #0xd] - adds r5, r6, #0 - adds r5, #0x84 - ldr r0, [r5] - strb r4, [r0, #1] - adds r0, r6, #0 - movs r1, #7 - movs r2, #1 - bl sub_080276F4 - ldr r0, [r6, #0x54] - adds r0, #0x7d - strb r4, [r0] - movs r3, #0 - strh r4, [r6, #0x24] - ldr r0, [r5] - strb r3, [r0, #3] - movs r0, #0x2e - ldrsh r1, [r6, r0] - ldr r0, [r5] - ldrh r0, [r0, #0xe] - cmp r1, r0 - ble _08027C0A - movs r0, #0x18 - strb r0, [r6, #0x15] - ldr r2, [r6, #0x54] - ldr r1, [r6, #0x50] - ldr r0, [r6, #0x68] - adds r0, #0x85 - strb r3, [r0] - adds r1, #0x85 - strb r3, [r1] - adds r2, #0x85 - strb r3, [r2] - b _08027C22 -_08027C0A: - movs r0, #8 - strb r0, [r6, #0x15] - ldr r3, [r6, #0x54] - ldr r2, [r6, #0x50] - ldr r0, [r6, #0x68] - adds r0, #0x85 - movs r1, #1 - strb r1, [r0] - adds r2, #0x85 - strb r1, [r2] - adds r3, #0x85 - strb r1, [r3] -_08027C22: - ldrb r0, [r6, #0x15] - lsrs r0, r0, #2 - strb r0, [r6, #0x14] - ldr r0, _08027C44 @ =gPlayerEntity - movs r2, #0x32 - ldrsh r1, [r6, r2] - movs r2, #0x32 - ldrsh r0, [r0, r2] - cmp r1, r0 - beq _08027C52 - cmp r1, r0 - ble _08027C48 - adds r0, r6, #0 - adds r0, #0x84 - ldr r1, [r0] - movs r0, #0 - b _08027C50 - .align 2, 0 -_08027C44: .4byte gPlayerEntity -_08027C48: - adds r0, r6, #0 - adds r0, #0x84 - ldr r1, [r0] - movs r0, #0x10 -_08027C50: - strb r0, [r1, #0xc] -_08027C52: - pop {r4, r5, r6, pc} thumb_func_start sub_08027C54 sub_08027C54: @ 0x08027C54 diff --git a/src/enemy/chuchuBoss.c b/src/enemy/chuchuBoss.c index ddaeccc8..ec325015 100644 --- a/src/enemy/chuchuBoss.c +++ b/src/enemy/chuchuBoss.c @@ -1755,3 +1755,40 @@ void sub_08027B98(ChuchuBossEntity* this, u32 unk1, u32 unk2, u32 unk3, u32 unk4 super->timer = 1; } } + +void sub_08027BBC(ChuchuBossEntity* this) { + ChuchuBossEntity* pEVar3; + ChuchuBossEntity* pEVar5; + ChuchuBossEntity* pEVar6; + ChuchuBossEntity* pEVar7; + + super->subAction = 10; + this->unk_84->unk_01 = 0; + sub_080276F4(this, 7, 1); + ((ChuchuBossEntity*)super->child)->unk_7d = 0; + super->speed = 0; + this->unk_84->unk_03 = 0; + if (super->x.HALF.HI > this->unk_84->unk_0e) { + super->direction = 0x18; + pEVar5 = (ChuchuBossEntity*)super->child; + pEVar3 = (ChuchuBossEntity*)super->parent; + *(u8*)((int)this->unk_68 + 0x85) = 0; + *(u8*)((int)pEVar3 + 0x85) = 0; + *(u8*)((int)pEVar5 + 0x85) = 0; + } else { + super->direction = 8; + pEVar6 = (ChuchuBossEntity*)super->child; + pEVar7 = (ChuchuBossEntity*)super->parent; + *(u8*)((int)this->unk_68 + 0x85) = 1; + *(u8*)((int)pEVar7 + 0x85) = 1; + *(u8*)((int)pEVar6 + 0x85) = 1; + } + super->animationState = super->direction >> 2; + if (super->y.HALF.HI != gPlayerEntity.y.HALF.HI) { + if (super->y.HALF.HI > gPlayerEntity.y.HALF.HI) { + this->unk_84->unk_0c = 0; + } else { + this->unk_84->unk_0c = 0x10; + } + } +}