From 78d262be7edb0a68135592a622bb381f5c4cdfa6 Mon Sep 17 00:00:00 2001 From: Tal Hayon Date: Sat, 16 Jul 2022 09:44:08 +0300 Subject: [PATCH] Match sub_08026774 --- asm/enemy/chuchuBoss.s | 47 ------------------------------------------ src/enemy/chuchuBoss.c | 13 ++++++++++++ 2 files changed, 13 insertions(+), 47 deletions(-) diff --git a/asm/enemy/chuchuBoss.s b/asm/enemy/chuchuBoss.s index b23c3abd..030e8d44 100644 --- a/asm/enemy/chuchuBoss.s +++ b/asm/enemy/chuchuBoss.s @@ -16,53 +16,6 @@ - thumb_func_start sub_08026774 -sub_08026774: @ 0x08026774 - push {r4, lr} - sub sp, #4 - adds r4, r0, #0 - ldr r1, [r4, #0x54] - adds r1, #0x83 - ldr r0, [r4, #0x50] - adds r0, #0x83 - ldrb r1, [r1] - ldrb r0, [r0] - orrs r1, r0 - ldr r0, [r4, #0x68] - adds r0, #0x83 - ldrb r0, [r0] - orrs r1, r0 - cmp r1, #0 - bne _080267C6 - adds r2, r4, #0 - adds r2, #0x7d - ldrb r0, [r2] - subs r0, #1 - strb r0, [r2] - lsls r0, r0, #0x18 - lsrs r0, r0, #0x18 - cmp r0, #0xff - bne _080267CC - str r1, [sp] - adds r0, r4, #0 - movs r1, #0x80 - movs r2, #0x80 - movs r3, #0x40 - bl sub_08027B98 - adds r0, r4, #0 - adds r0, #0x84 - ldr r1, [r0] - movs r0, #1 - strb r0, [r1, #3] - ldr r0, [r4, #0x54] - movs r1, #1 - bl InitAnimationForceUpdate -_080267C6: - adds r0, r4, #0 - bl sub_080277F8 -_080267CC: - add sp, #4 - pop {r4, pc} thumb_func_start sub_080267D0 sub_080267D0: @ 0x080267D0 diff --git a/src/enemy/chuchuBoss.c b/src/enemy/chuchuBoss.c index 59bf6d76..176af40d 100644 --- a/src/enemy/chuchuBoss.c +++ b/src/enemy/chuchuBoss.c @@ -741,3 +741,16 @@ void sub_08026750(ChuchuBossEntity* this) { sub_08027AA4(this); gUnk_080CC258[this->unk_84->unk_03](this); } + +void sub_08026774(ChuchuBossEntity* this) { + if ((((ChuchuBossEntity*)super->child)->unk_80[3] | ((ChuchuBossEntity*)super->parent)->unk_80[3] | + this->unk_68->unk_80[3]) == 0) { + if (this->unk_7d-- != 0) { + return; + } + sub_08027B98(this, 0x80, 0x80, 0x40, 0); + this->unk_84->unk_03 = 1; + InitAnimationForceUpdate(super->child, 1); + } + sub_080277F8(this); +}