diff --git a/asm/enemy/chuchuBoss.s b/asm/enemy/chuchuBoss.s deleted file mode 100644 index 8ec28073..00000000 --- a/asm/enemy/chuchuBoss.s +++ /dev/null @@ -1,98 +0,0 @@ - .include "asm/macros.inc" - - .include "constants/constants.inc" - - .syntax unified - - .text - - - - - - - - - - - - - - - thumb_func_start sub_08027D20 -sub_08027D20: @ 0x08027D20 -.ifdef EU - push {r4, lr} - adds r4, r0, #0 - movs r1, #0x15 - movs r2, #0 - movs r3, #0 - bl CreateObjectWithParent - adds r3, r0, #0 - cmp r3, #0 - beq _08027D44 - movs r0, #0xc9 - strh r0, [r3, #0x12] - adds r0, r4, #0 - adds r0, #0x60 - ldrh r1, [r0] - adds r0, r3, #0 - adds r0, #0x60 - strh r1, [r0] - ldrb r1, [r4, #0x1a] - lsls r1, r1, #0x1c - lsrs r1, r1, #0x1c - ldrb r2, [r3, #0x1a] - movs r0, #0x10 - rsbs r0, r0, #0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, #0x1a] - ldrh r0, [r3, #0x32] - adds r0, #1 - strh r0, [r3, #0x32] - adds r1, r3, #0 - adds r1, #0x63 - movs r0, #8 - strb r0, [r1] -_08027D44: - adds r0, r3, #0 - pop {r4, pc} -.else - push {r4, r5, lr} - adds r5, r0, #0 - movs r1, #0x15 - movs r2, #0 - movs r3, #0 - bl CreateObjectWithParent - adds r4, r0, #0 - cmp r4, #0 - beq _08027D66 - movs r0, #0xc9 - strh r0, [r4, #0x12] - ldrh r0, [r4, #0x32] - adds r0, #1 - strh r0, [r4, #0x32] - adds r1, r4, #0 - adds r1, #0x63 - movs r0, #8 - strb r0, [r1] - adds r0, r4, #0 - movs r1, #0x3e - bl LoadFixedGFX - ldrb r0, [r5, #0xb] - cmp r0, #0 - bne _08027D5E - adds r0, r4, #0 - movs r1, #0x2b - bl LoadObjPalette - b _08027D66 -_08027D5E: - adds r0, r4, #0 - movs r1, #0x2c - bl LoadObjPalette -_08027D66: - adds r0, r4, #0 - pop {r4, r5, pc} - .align 2, 0 -.endif diff --git a/linker.ld b/linker.ld index 4c15fd31..1cc04d01 100644 --- a/linker.ld +++ b/linker.ld @@ -317,7 +317,6 @@ SECTIONS { src/enemy/pesto.o(.text); src/enemy/puffstool.o(.text); src/enemy/chuchuBoss.o(.text); - asm/enemy/chuchuBoss.o(.text); src/enemy/likeLike.o(.text); src/enemy/spearMoblin.o(.text); src/enemy/businessScrub.o(.text); diff --git a/src/enemy/chuchuBoss.c b/src/enemy/chuchuBoss.c index 769fe86e..62e5e0ff 100644 --- a/src/enemy/chuchuBoss.c +++ b/src/enemy/chuchuBoss.c @@ -133,7 +133,7 @@ void sub_08027BBC(); bool32 sub_08027C54(); void sub_08027C7C(ChuchuBossEntity*, u32); void sub_08027C9C(); -Entity* sub_08027D20(); +Entity* sub_08027D20(ChuchuBossEntity*); // clang-format off void (*const ChuchuBoss_Functions[])(ChuchuBossEntity*) = { @@ -1350,7 +1350,7 @@ void sub_080272D4(ChuchuBossEntity* this) { ((ChuchuBossEntity*)super->child)->unk_68->base.iframes = super->iframes; super->child->parent->iframes = super->iframes; super->child->iframes = super->iframes; - pEVar3 = sub_08027D20(super->child); + pEVar3 = sub_08027D20((ChuchuBossEntity*)super->child); if (pEVar3 != NULL) { pEVar3->x.HALF.HI = super->x.HALF.HI + 1; pEVar3->spriteOffsetY = super->spriteOffsetY + 0x20; @@ -1821,3 +1821,25 @@ void sub_08027C9C(ChuchuBossEntity* this, u32 param_2) { } } } + +Entity* sub_08027D20(ChuchuBossEntity* this) { + Entity* r4 = CreateObjectWithParent(super, OBJECT_15, 0, 0); + if (r4 != NULL) { + r4->spriteIndex = 0xc9; +#ifdef EU + r4->spriteVramOffset = super->spriteVramOffset; + r4->palette.b.b0 = super->palette.b.b0; +#endif + r4->y.HALF.HI += 1; + r4->spriteOffsetY = 8; +#ifndef EU + LoadFixedGFX(r4, 0x3e); + if (super->type2 == 0) { + LoadObjPalette(r4, 0x2b); + } else { + LoadObjPalette(r4, 0x2c); + } +#endif + } + return r4; +}