Merge pull request #523 from Ibot02/chuchuBoss

This commit is contained in:
notyourav 2022-06-29 13:41:05 -07:00 committed by GitHub
commit 0e23fba381
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 776 additions and 630 deletions

View File

@ -6,560 +6,6 @@
.text
thumb_func_start ChuchuBoss_OnDeath
ChuchuBoss_OnDeath: @ 0x08025CD4
push {r4, r5, lr}
adds r4, r0, #0
bl sub_08078B48
ldrb r3, [r4, #0xa]
cmp r3, #0
bne _08025DA4
ldrb r0, [r4, #0xd]
cmp r0, #0xc
beq _08025CFE
movs r0, #0xc
strb r0, [r4, #0xd]
adds r0, r4, #0
adds r0, #0x84
ldr r0, [r0]
strb r3, [r0, #3]
ldr r0, [r4, #0x54]
movs r1, #9
bl InitAnimationForceUpdate
b _08025D9C
_08025CFE:
adds r5, r4, #0
adds r5, #0x84
ldr r0, [r5]
ldrb r0, [r0, #3]
cmp r0, #0
beq _08025D10
cmp r0, #1
beq _08025D28
b _08025D9C
_08025D10:
adds r0, r4, #0
movs r1, #0x3f
bl sub_08027C7C
ldr r0, [r5]
movs r1, #1
strb r1, [r0, #3]
adds r1, r4, #0
adds r1, #0x7d
movs r0, #0x78
strb r0, [r1]
b _08025D9C
_08025D28:
adds r2, r4, #0
adds r2, #0x7d
ldrb r0, [r2]
subs r1, r0, #1
strb r1, [r2]
lsls r0, r1, #0x18
lsrs r0, r0, #0x18
cmp r0, #0xff
bne _08025D84
ldr r1, [r4, #0x54]
adds r1, #0x6d
ldrb r0, [r1]
movs r2, #2
orrs r0, r2
strb r0, [r1]
ldr r1, [r4, #0x68]
adds r1, #0x6d
ldrb r0, [r1]
orrs r0, r2
strb r0, [r1]
ldr r1, [r4, #0x50]
adds r1, #0x6d
ldrb r0, [r1]
orrs r0, r2
strb r0, [r1]
ldr r2, [r4, #0x54]
ldr r1, [r4, #0x50]
ldr r0, [r4, #0x68]
adds r0, #0x45
strb r3, [r0]
adds r1, #0x45
strb r3, [r1]
adds r2, #0x45
strb r3, [r2]
ldr r0, _08025D80 @ =gPauseMenuOptions
strb r3, [r0]
movs r0, #0x94
lsls r0, r0, #1
bl SoundReq
adds r0, r4, #0
bl GenericDeath
b _08025D9C
.align 2, 0
_08025D80: .4byte gPauseMenuOptions
_08025D84:
lsls r0, r1, #0x18
lsrs r0, r0, #0x18
movs r1, #0x3f
cmp r0, #0x50
bhi _08025D96
movs r1, #0xf
cmp r0, #0x1e
bls _08025D96
movs r1, #0x1f
_08025D96:
adds r0, r4, #0
bl sub_08027C7C
_08025D9C:
adds r0, r4, #0
bl sub_08027870
b _08025DBC
_08025DA4:
adds r2, r4, #0
adds r2, #0x6d
ldrb r1, [r2]
movs r0, #2
ands r0, r1
cmp r0, #0
beq _08025DBC
movs r0, #2
orrs r0, r1
strb r0, [r2]
bl DeleteThisEntity
_08025DBC:
pop {r4, r5, pc}
.align 2, 0
thumb_func_start ChuchuBoss_OnTick
ChuchuBoss_OnTick: @ 0x08025DC0
push {lr}
ldr r2, _08025DD4 @ =gUnk_080CC1B0
ldrb r1, [r0, #0xc]
lsls r1, r1, #2
adds r1, r1, r2
ldr r1, [r1]
bl _call_via_r1
pop {pc}
.align 2, 0
_08025DD4: .4byte gUnk_080CC1B0
thumb_func_start sub_08025DD8
sub_08025DD8: @ 0x08025DD8
push {r4, r5, r6, r7, lr}
adds r5, r0, #0
movs r0, #1
strb r0, [r5, #0xc]
ldrb r1, [r5, #0xa]
cmp r1, #8
bne _08025DF2
movs r0, #4
strb r0, [r5, #0xa]
ldr r0, [r5, #0x54]
ldr r0, [r0, #0x48]
str r0, [r5, #0x48]
b _0802605E
_08025DF2:
ldr r6, _08025E48 @ =gUnk_080CC1B8
movs r4, #3
movs r3, #3
adds r0, r3, #0
ands r0, r1
lsls r0, r0, #2
adds r0, r0, r6
ldrb r0, [r0, #1]
movs r1, #0x29
adds r1, r1, r5
mov ip, r1
movs r1, #7
ands r1, r0
mov r0, ip
ldrb r2, [r0]
movs r0, #8
rsbs r0, r0, #0
ands r0, r2
orrs r0, r1
mov r1, ip
strb r0, [r1]
adds r1, r5, #0
adds r1, #0x76
movs r0, #0xa0
strh r0, [r1]
adds r1, #4
strh r0, [r1]
adds r1, #4
movs r0, #0
strh r0, [r1]
ldrb r0, [r5, #0x19]
orrs r0, r4
strb r0, [r5, #0x19]
ldrb r0, [r5, #0xa]
ands r3, r0
cmp r3, #1
bne _08025E4C
adds r0, r5, #0
movs r1, #0
bl InitAnimationForceUpdate
b _08025E58
.align 2, 0
_08025E48: .4byte gUnk_080CC1B8
_08025E4C:
lsls r0, r3, #2
adds r0, r0, r6
ldrb r1, [r0]
adds r0, r5, #0
bl InitializeAnimation
_08025E58:
ldrb r0, [r5, #0xa]
movs r6, #3
ands r6, r0
cmp r6, #0
beq _08025E86
cmp r6, #0
bge _08025E68
b _08026050
_08025E68:
cmp r6, #3
ble _08025E6E
b _08026050
_08025E6E:
ldr r4, [r5, #0x48]
adds r0, r5, #0
bl AllocMutableHitbox
adds r1, r0, #0
cmp r1, #0
beq _08025E7E
b _08026020
_08025E7E:
ldr r0, [r5, #0x68]
adds r0, #0x45
strb r1, [r0]
b _0802605E
_08025E86:
strb r0, [r5, #0xb]
movs r0, #0x10
bl zMalloc
adds r4, r5, #0
adds r4, #0x84
str r0, [r4]
cmp r0, #0
beq _08025EA2
adds r0, r5, #0
bl AllocMutableHitbox
cmp r0, #0
bne _08025EAA
_08025EA2:
adds r0, r5, #0
bl GenericDeath
b _0802605E
_08025EAA:
ldr r0, [r4]
str r0, [r5, #0x64]
ldr r2, [r5, #0x48]
ldr r1, _0802601C @ =gUnk_080FD238
ldrb r0, [r1]
strb r0, [r2]
ldr r2, [r5, #0x48]
ldrb r0, [r1, #1]
strb r0, [r2, #1]
ldr r2, [r5, #0x48]
ldrb r0, [r1, #2]
strb r0, [r2, #2]
ldr r2, [r5, #0x48]
ldrb r0, [r1, #3]
strb r0, [r2, #3]
ldr r2, [r5, #0x48]
ldrb r0, [r1, #4]
strb r0, [r2, #4]
ldr r2, [r5, #0x48]
ldrb r0, [r1, #5]
strb r0, [r2, #5]
ldr r2, [r5, #0x48]
ldrb r0, [r1, #6]
strb r0, [r2, #6]
ldr r2, [r5, #0x48]
ldrb r0, [r1, #7]
strb r0, [r2, #7]
strb r6, [r5, #0xd]
adds r1, r5, #0
adds r1, #0x6d
ldrb r0, [r1]
movs r7, #1
orrs r0, r7
strb r0, [r1]
ldr r0, [r4]
strb r6, [r0, #6]
ldr r0, [r4]
strb r6, [r0, #5]
ldr r1, [r4]
movs r0, #0xf
strb r0, [r1, #1]
ldr r0, [r4]
strb r6, [r0, #3]
ldr r0, [r4]
strb r6, [r0, #4]
ldr r1, [r4]
ldrh r0, [r5, #0x2e]
strh r0, [r1, #0xe]
ldrb r0, [r5, #0xa]
movs r1, #3
orrs r1, r0
movs r0, #0x13
bl CreateEnemy
adds r2, r0, #0
str r2, [r5, #0x68]
cmp r2, #0
beq _08025F46
adds r0, r5, #0
adds r0, #0x38
ldrb r1, [r0]
adds r0, r2, #0
adds r0, #0x38
strb r1, [r0]
ldr r1, [r5, #0x68]
ldrh r0, [r5, #0x2e]
strh r0, [r1, #0x2e]
ldr r1, [r5, #0x68]
ldrh r0, [r5, #0x32]
subs r0, #0xe
strh r0, [r1, #0x32]
ldr r1, [r5, #0x68]
movs r0, #0xe
strb r0, [r1, #0xe]
ldr r0, [r5, #0x68]
str r5, [r0, #0x50]
ldr r0, [r5, #0x68]
str r5, [r0, #0x68]
_08025F46:
ldrb r0, [r5, #0xa]
movs r1, #2
orrs r1, r0
movs r0, #0x13
bl CreateEnemy
adds r2, r0, #0
str r2, [r5, #0x50]
cmp r2, #0
beq _08025F8C
adds r0, r5, #0
adds r0, #0x38
ldrb r1, [r0]
adds r0, r2, #0
adds r0, #0x38
strb r1, [r0]
ldr r1, [r5, #0x50]
ldrh r0, [r5, #0x2e]
strh r0, [r1, #0x2e]
ldr r1, [r5, #0x50]
ldr r0, [r5, #0x68]
ldrh r0, [r0, #0x32]
subs r0, #0x12
strh r0, [r1, #0x32]
ldr r1, [r5, #0x50]
movs r0, #0x12
strb r0, [r1, #0xe]
ldr r1, [r5, #0x50]
ldr r0, [r5, #0x68]
str r0, [r1, #0x50]
ldr r1, [r5, #0x68]
ldr r0, [r5, #0x50]
str r0, [r1, #0x54]
ldr r0, [r5, #0x50]
str r5, [r0, #0x68]
_08025F8C:
ldrb r0, [r5, #0xa]
adds r1, r7, #0
orrs r1, r0
movs r0, #0x13
bl CreateEnemy
adds r2, r0, #0
str r2, [r5, #0x54]
cmp r2, #0
beq _08025FD6
adds r0, r5, #0
adds r0, #0x38
ldrb r1, [r0]
adds r0, r2, #0
adds r0, #0x38
strb r1, [r0]
ldr r1, [r5, #0x54]
ldrh r0, [r5, #0x2e]
strh r0, [r1, #0x2e]
ldr r1, [r5, #0x54]
ldr r0, [r5, #0x50]
ldrh r0, [r0, #0x32]
subs r0, #0xe
strh r0, [r1, #0x32]
ldr r1, [r5, #0x54]
movs r0, #0xe
strb r0, [r1, #0xe]
ldr r1, [r5, #0x54]
ldr r0, [r5, #0x50]
str r0, [r1, #0x50]
ldr r0, [r5, #0x54]
str r5, [r0, #0x54]
ldr r1, [r5, #0x50]
ldr r0, [r5, #0x54]
str r0, [r1, #0x54]
ldr r0, [r5, #0x54]
str r5, [r0, #0x68]
_08025FD6:
movs r0, #0x13
movs r1, #8
bl CreateEnemy
adds r1, r0, #0
cmp r1, #0
beq _08025FE6
str r5, [r1, #0x54]
_08025FE6:
adds r0, r5, #0
movs r1, #0x49
movs r2, #1
movs r3, #0
bl CreateObjectWithParent
adds r1, r0, #0
cmp r1, #0
beq _08025FFC
ldr r0, [r5, #0x54]
str r0, [r1, #0x54]
_08025FFC:
ldrb r0, [r5, #0xa]
cmp r0, #0
beq _08026050
adds r0, r5, #0
movs r1, #0x49
movs r2, #3
movs r3, #0
bl CreateObjectWithParent
adds r1, r0, #0
cmp r1, #0
beq _08026050
ldr r0, [r5, #0x54]
str r0, [r1, #0x54]
b _08026050
.align 2, 0
_0802601C: .4byte gUnk_080FD238
_08026020:
ldr r1, [r5, #0x48]
ldrb r0, [r4]
strb r0, [r1]
ldr r1, [r5, #0x48]
ldrb r0, [r4, #1]
strb r0, [r1, #1]
ldr r1, [r5, #0x48]
ldrb r0, [r4, #2]
strb r0, [r1, #2]
ldr r1, [r5, #0x48]
ldrb r0, [r4, #3]
strb r0, [r1, #3]
ldr r1, [r5, #0x48]
ldrb r0, [r4, #4]
strb r0, [r1, #4]
ldr r1, [r5, #0x48]
ldrb r0, [r4, #5]
strb r0, [r1, #5]
ldr r1, [r5, #0x48]
ldrb r0, [r4, #6]
strb r0, [r1, #6]
ldr r1, [r5, #0x48]
ldrb r0, [r4, #7]
strb r0, [r1, #7]
_08026050:
ldrb r1, [r5, #0xa]
movs r0, #3
ands r0, r1
strb r0, [r5, #0xa]
adds r0, r5, #0
bl sub_08026060
_0802605E:
pop {r4, r5, r6, r7, pc}
thumb_func_start sub_08026060
sub_08026060: @ 0x08026060
push {r4, lr}
adds r4, r0, #0
ldr r1, _0802608C @ =gUnk_080CC1C8
ldrb r0, [r4, #0xa]
lsls r0, r0, #2
adds r0, r0, r1
ldr r1, [r0]
adds r0, r4, #0
bl _call_via_r1
adds r0, r4, #0
adds r0, #0x76
ldrh r1, [r0]
adds r0, #4
ldrh r2, [r0]
adds r0, #4
ldrh r3, [r0]
adds r0, r4, #0
bl SetAffineInfo
pop {r4, pc}
.align 2, 0
_0802608C: .4byte gUnk_080CC1C8
thumb_func_start sub_08026090
sub_08026090: @ 0x08026090
push {r4, lr}
adds r4, r0, #0
ldrb r0, [r4, #0xd]
cmp r0, #0
bne _080260EA
ldr r0, [r4, #0x54]
adds r0, #0x45
ldrb r0, [r0]
cmp r0, #0
bne _080260B8
ldrb r1, [r4, #0x10]
movs r0, #0x7f
ands r0, r1
strb r0, [r4, #0x10]
movs r0, #1
strb r0, [r4, #0xd]
movs r0, #0xfa
strb r0, [r4, #0xe]
ldr r0, _080260D4 @ =gRoomControls
str r4, [r0, #0x30]
_080260B8:
ldr r0, [r4, #0x54]
ldrb r1, [r0, #0x10]
strb r1, [r4, #0x10]
ldr r1, [r0, #0x48]
str r1, [r4, #0x48]
adds r0, #0x3f
ldrb r1, [r0]
cmp r1, #0x7e
bne _080260D8
adds r0, r4, #0
adds r0, #0x3f
strb r1, [r0]
b _080260E0
.align 2, 0
_080260D4: .4byte gRoomControls
_080260D8:
adds r1, r4, #0
adds r1, #0x3f
movs r0, #0x7c
strb r0, [r1]
_080260E0:
ldr r0, [r4, #0x54]
adds r1, r4, #0
bl CopyPosition
b _08026106
_080260EA:
bl sub_08078B48
ldrb r0, [r4, #0xe]
subs r0, #1
strb r0, [r4, #0xe]
lsls r0, r0, #0x18
lsrs r0, r0, #0x18
cmp r0, #0xff
bne _08026106
ldr r1, _08026108 @ =gRoomControls
ldr r0, _0802610C @ =gPlayerEntity
str r0, [r1, #0x30]
bl DeleteThisEntity
_08026106:
pop {r4, pc}
.align 2, 0
_08026108: .4byte gRoomControls
_0802610C: .4byte gPlayerEntity
thumb_func_start sub_08026110
sub_08026110: @ 0x08026110
push {r4, r5, r6, r7, lr}

View File

@ -0,0 +1,120 @@
.syntax unified
push {r4, r5, lr}
adds r4, r0, #0
bl sub_08078B48
ldrb r3, [r4, #0xa]
cmp r3, #0
bne _08025DA4
ldrb r0, [r4, #0xd]
cmp r0, #0xc
beq _08025CFE
movs r0, #0xc
strb r0, [r4, #0xd]
adds r0, r4, #0
adds r0, #0x84
ldr r0, [r0]
strb r3, [r0, #3]
ldr r0, [r4, #0x54]
movs r1, #9
bl InitAnimationForceUpdate
b _08025D9C
_08025CFE:
adds r5, r4, #0
adds r5, #0x84
ldr r0, [r5]
ldrb r0, [r0, #3]
cmp r0, #0
beq _08025D10
cmp r0, #1
beq _08025D28
b _08025D9C
_08025D10:
adds r0, r4, #0
movs r1, #0x3f
bl sub_08027C7C
ldr r0, [r5]
movs r1, #1
strb r1, [r0, #3]
adds r1, r4, #0
adds r1, #0x7d
movs r0, #0x78
strb r0, [r1]
b _08025D9C
_08025D28:
adds r2, r4, #0
adds r2, #0x7d
ldrb r0, [r2]
subs r1, r0, #1
strb r1, [r2]
lsls r0, r1, #0x18
lsrs r0, r0, #0x18
cmp r0, #0xff
bne _08025D84
ldr r1, [r4, #0x54]
adds r1, #0x6d
ldrb r0, [r1]
movs r2, #2
orrs r0, r2
strb r0, [r1]
ldr r1, [r4, #0x68]
adds r1, #0x6d
ldrb r0, [r1]
orrs r0, r2
strb r0, [r1]
ldr r1, [r4, #0x50]
adds r1, #0x6d
ldrb r0, [r1]
orrs r0, r2
strb r0, [r1]
ldr r2, [r4, #0x54]
ldr r1, [r4, #0x50]
ldr r0, [r4, #0x68]
adds r0, #0x45
strb r3, [r0]
adds r1, #0x45
strb r3, [r1]
adds r2, #0x45
strb r3, [r2]
ldr r0, _08025D80 @ =gPauseMenuOptions
strb r3, [r0]
movs r0, #0x94
lsls r0, r0, #1
bl SoundReq
adds r0, r4, #0
bl GenericDeath
b _08025D9C
.align 2, 0
_08025D80: .4byte gPauseMenuOptions
_08025D84:
lsls r0, r1, #0x18
lsrs r0, r0, #0x18
movs r1, #0x3f
cmp r0, #0x50
bhi _08025D96
movs r1, #0xf
cmp r0, #0x1e
bls _08025D96
movs r1, #0x1f
_08025D96:
adds r0, r4, #0
bl sub_08027C7C
_08025D9C:
adds r0, r4, #0
bl sub_08027870
b _08025DBC
_08025DA4:
adds r2, r4, #0
adds r2, #0x6d
ldrb r1, [r2]
movs r0, #2
ands r0, r1
cmp r0, #0
beq _08025DBC
movs r0, #2
orrs r0, r1
strb r0, [r2]
bl DeleteThisEntity
_08025DBC:
pop {r4, r5, pc}
.align 2, 0
.syntax divided

View File

@ -0,0 +1,328 @@
.syntax unified
push {r4, r5, r6, r7, lr}
adds r5, r0, #0
movs r0, #1
strb r0, [r5, #0xc]
ldrb r1, [r5, #0xa]
cmp r1, #8
bne _08025DF2
movs r0, #4
strb r0, [r5, #0xa]
ldr r0, [r5, #0x54]
ldr r0, [r0, #0x48]
str r0, [r5, #0x48]
b _0802605E
_08025DF2:
ldr r6, _08025E48 @ =gUnk_080CC1B8
movs r4, #3
movs r3, #3
adds r0, r3, #0
ands r0, r1
lsls r0, r0, #2
adds r0, r0, r6
ldrb r0, [r0, #1]
movs r1, #0x29
adds r1, r1, r5
mov ip, r1
movs r1, #7
ands r1, r0
mov r0, ip
ldrb r2, [r0]
movs r0, #8
rsbs r0, r0, #0
ands r0, r2
orrs r0, r1
mov r1, ip
strb r0, [r1]
adds r1, r5, #0
adds r1, #0x76
movs r0, #0xa0
strh r0, [r1]
adds r1, #4
strh r0, [r1]
adds r1, #4
movs r0, #0
strh r0, [r1]
ldrb r0, [r5, #0x19]
orrs r0, r4
strb r0, [r5, #0x19]
ldrb r0, [r5, #0xa]
ands r3, r0
cmp r3, #1
bne _08025E4C
adds r0, r5, #0
movs r1, #0
bl InitAnimationForceUpdate
b _08025E58
.align 2, 0
_08025E48: .4byte gUnk_080CC1B8
_08025E4C:
lsls r0, r3, #2
adds r0, r0, r6
ldrb r1, [r0]
adds r0, r5, #0
bl InitializeAnimation
_08025E58:
ldrb r0, [r5, #0xa]
movs r6, #3
ands r6, r0
cmp r6, #0
beq _08025E86
cmp r6, #0
bge _08025E68
b _08026050
_08025E68:
cmp r6, #3
ble _08025E6E
b _08026050
_08025E6E:
ldr r4, [r5, #0x48]
adds r0, r5, #0
bl AllocMutableHitbox
adds r1, r0, #0
cmp r1, #0
beq _08025E7E
b _08026020
_08025E7E:
ldr r0, [r5, #0x68]
adds r0, #0x45
strb r1, [r0]
b _0802605E
_08025E86:
strb r0, [r5, #0xb]
movs r0, #0x10
bl zMalloc
adds r4, r5, #0
adds r4, #0x84
str r0, [r4]
cmp r0, #0
beq _08025EA2
adds r0, r5, #0
bl AllocMutableHitbox
cmp r0, #0
bne _08025EAA
_08025EA2:
adds r0, r5, #0
bl GenericDeath
b _0802605E
_08025EAA:
ldr r0, [r4]
str r0, [r5, #0x64]
ldr r2, [r5, #0x48]
ldr r1, _0802601C @ =gUnk_080FD238
ldrb r0, [r1]
strb r0, [r2]
ldr r2, [r5, #0x48]
ldrb r0, [r1, #1]
strb r0, [r2, #1]
ldr r2, [r5, #0x48]
ldrb r0, [r1, #2]
strb r0, [r2, #2]
ldr r2, [r5, #0x48]
ldrb r0, [r1, #3]
strb r0, [r2, #3]
ldr r2, [r5, #0x48]
ldrb r0, [r1, #4]
strb r0, [r2, #4]
ldr r2, [r5, #0x48]
ldrb r0, [r1, #5]
strb r0, [r2, #5]
ldr r2, [r5, #0x48]
ldrb r0, [r1, #6]
strb r0, [r2, #6]
ldr r2, [r5, #0x48]
ldrb r0, [r1, #7]
strb r0, [r2, #7]
strb r6, [r5, #0xd]
adds r1, r5, #0
adds r1, #0x6d
ldrb r0, [r1]
movs r7, #1
orrs r0, r7
strb r0, [r1]
ldr r0, [r4]
strb r6, [r0, #6]
ldr r0, [r4]
strb r6, [r0, #5]
ldr r1, [r4]
movs r0, #0xf
strb r0, [r1, #1]
ldr r0, [r4]
strb r6, [r0, #3]
ldr r0, [r4]
strb r6, [r0, #4]
ldr r1, [r4]
ldrh r0, [r5, #0x2e]
strh r0, [r1, #0xe]
ldrb r0, [r5, #0xa]
movs r1, #3
orrs r1, r0
movs r0, #0x13
bl CreateEnemy
adds r2, r0, #0
str r2, [r5, #0x68]
cmp r2, #0
beq _08025F46
adds r0, r5, #0
adds r0, #0x38
ldrb r1, [r0]
adds r0, r2, #0
adds r0, #0x38
strb r1, [r0]
ldr r1, [r5, #0x68]
ldrh r0, [r5, #0x2e]
strh r0, [r1, #0x2e]
ldr r1, [r5, #0x68]
ldrh r0, [r5, #0x32]
subs r0, #0xe
strh r0, [r1, #0x32]
ldr r1, [r5, #0x68]
movs r0, #0xe
strb r0, [r1, #0xe]
ldr r0, [r5, #0x68]
str r5, [r0, #0x50]
ldr r0, [r5, #0x68]
str r5, [r0, #0x68]
_08025F46:
ldrb r0, [r5, #0xa]
movs r1, #2
orrs r1, r0
movs r0, #0x13
bl CreateEnemy
adds r2, r0, #0
str r2, [r5, #0x50]
cmp r2, #0
beq _08025F8C
adds r0, r5, #0
adds r0, #0x38
ldrb r1, [r0]
adds r0, r2, #0
adds r0, #0x38
strb r1, [r0]
ldr r1, [r5, #0x50]
ldrh r0, [r5, #0x2e]
strh r0, [r1, #0x2e]
ldr r1, [r5, #0x50]
ldr r0, [r5, #0x68]
ldrh r0, [r0, #0x32]
subs r0, #0x12
strh r0, [r1, #0x32]
ldr r1, [r5, #0x50]
movs r0, #0x12
strb r0, [r1, #0xe]
ldr r1, [r5, #0x50]
ldr r0, [r5, #0x68]
str r0, [r1, #0x50]
ldr r1, [r5, #0x68]
ldr r0, [r5, #0x50]
str r0, [r1, #0x54]
ldr r0, [r5, #0x50]
str r5, [r0, #0x68]
_08025F8C:
ldrb r0, [r5, #0xa]
adds r1, r7, #0
orrs r1, r0
movs r0, #0x13
bl CreateEnemy
adds r2, r0, #0
str r2, [r5, #0x54]
cmp r2, #0
beq _08025FD6
adds r0, r5, #0
adds r0, #0x38
ldrb r1, [r0]
adds r0, r2, #0
adds r0, #0x38
strb r1, [r0]
ldr r1, [r5, #0x54]
ldrh r0, [r5, #0x2e]
strh r0, [r1, #0x2e]
ldr r1, [r5, #0x54]
ldr r0, [r5, #0x50]
ldrh r0, [r0, #0x32]
subs r0, #0xe
strh r0, [r1, #0x32]
ldr r1, [r5, #0x54]
movs r0, #0xe
strb r0, [r1, #0xe]
ldr r1, [r5, #0x54]
ldr r0, [r5, #0x50]
str r0, [r1, #0x50]
ldr r0, [r5, #0x54]
str r5, [r0, #0x54]
ldr r1, [r5, #0x50]
ldr r0, [r5, #0x54]
str r0, [r1, #0x54]
ldr r0, [r5, #0x54]
str r5, [r0, #0x68]
_08025FD6:
movs r0, #0x13
movs r1, #8
bl CreateEnemy
adds r1, r0, #0
cmp r1, #0
beq _08025FE6
str r5, [r1, #0x54]
_08025FE6:
adds r0, r5, #0
movs r1, #0x49
movs r2, #1
movs r3, #0
bl CreateObjectWithParent
adds r1, r0, #0
cmp r1, #0
beq _08025FFC
ldr r0, [r5, #0x54]
str r0, [r1, #0x54]
_08025FFC:
ldrb r0, [r5, #0xa]
cmp r0, #0
beq _08026050
adds r0, r5, #0
movs r1, #0x49
movs r2, #3
movs r3, #0
bl CreateObjectWithParent
adds r1, r0, #0
cmp r1, #0
beq _08026050
ldr r0, [r5, #0x54]
str r0, [r1, #0x54]
b _08026050
.align 2, 0
_0802601C: .4byte gUnk_080FD238
_08026020:
ldr r1, [r5, #0x48]
ldrb r0, [r4]
strb r0, [r1]
ldr r1, [r5, #0x48]
ldrb r0, [r4, #1]
strb r0, [r1, #1]
ldr r1, [r5, #0x48]
ldrb r0, [r4, #2]
strb r0, [r1, #2]
ldr r1, [r5, #0x48]
ldrb r0, [r4, #3]
strb r0, [r1, #3]
ldr r1, [r5, #0x48]
ldrb r0, [r4, #4]
strb r0, [r1, #4]
ldr r1, [r5, #0x48]
ldrb r0, [r4, #5]
strb r0, [r1, #5]
ldr r1, [r5, #0x48]
ldrb r0, [r4, #6]
strb r0, [r1, #6]
ldr r1, [r5, #0x48]
ldrb r0, [r4, #7]
strb r0, [r1, #7]
_08026050:
ldrb r1, [r5, #0xa]
movs r0, #3
ands r0, r1
strb r0, [r5, #0xa]
adds r0, r5, #0
bl sub_08026060
_0802605E:
pop {r4, r5, r6, r7, pc}
.syntax divided

View File

@ -1,106 +1,151 @@
#define NENT_DEPRECATED
/**
* @file chuchuBoss.c
* @ingroup Enemies
*
* @brief Chuchu Boss enemy
*/
#include "global.h"
#include "enemy.h"
#include "object.h"
#include "functions.h"
extern void (*const ChuchuBoss_Functions[])(Entity*);
extern void (*const gUnk_080CC1B0[])(Entity*);
extern const u8 gUnk_080CC1B8[];
extern void (*const gUnk_080CC1C8[])(Entity*);
extern void (*const gUnk_080CC1DC[])(Entity*);
extern void (*const gUnk_080CC20C[])(Entity*);
typedef struct {
u8 unk_00[1];
u8 unk_01;
u8 unk_02[1];
u8 unk_03;
u8 unk_04;
s8 unk_05;
u8 unk_06;
u8 unk_07[7];
u16 unk_0e;
} Helper;
static_assert(sizeof(Helper) == 0x10);
typedef struct _ChuchuBossEntity {
Entity base;
struct _ChuchuBossEntity* unk_68;
u8 unk_6c[1];
struct {
u8 unk0 : 1;
u8 unk1 : 1;
} PACKED unk_6d;
u8 unk_6e[2];
u8 unk_70[0x4];
union SplitWord unk_74;
union SplitWord unk_78;
u8 unk_7c[1];
u8 unk_7d;
u16 unk_7e;
u8 unk_80[4];
Helper* unk_84;
} ChuchuBossEntity;
extern void (*const ChuchuBoss_Functions[])(ChuchuBossEntity*);
extern void (*const gUnk_080CC1B0[])(ChuchuBossEntity*);
typedef struct {
u8 unk_00, unk_01, unk_2, unk_03;
} struct_080CC1B8;
extern const struct_080CC1B8 gUnk_080CC1B8[];
extern void (*const gUnk_080CC1C8[])(ChuchuBossEntity*);
extern void (*const gUnk_080CC1DC[])(ChuchuBossEntity*);
extern void (*const gUnk_080CC20C[])(ChuchuBossEntity*);
extern const u8 gUnk_080CC234[];
extern const u8 gUnk_080CC24F[];
extern void (*const gUnk_080CC258[])(Entity*);
extern void (*const gUnk_080CC264[])(Entity*);
extern void (*const gUnk_080CC26C[])(Entity*);
extern void (*const gUnk_080CC258[])(ChuchuBossEntity*);
extern void (*const gUnk_080CC264[])(ChuchuBossEntity*);
extern void (*const gUnk_080CC26C[])(ChuchuBossEntity*);
extern const u8 gUnk_080CC278[];
extern const u16 gUnk_080CC27C[];
extern const u16 gUnk_080CC29C[];
extern const u16 gUnk_080CC2BC[];
extern const s8 gUnk_080CC2DC[];
extern Hitbox gUnk_080FD238;
void ChuchuBoss(Entity* this) {
ChuchuBoss_Functions[GetNextFunction(this)]((Entity*)this);
}
void ChuchuBoss(Entity* this);
void ChuchuBoss_OnKnockback(ChuchuBossEntity* this);
void ChuchuBoss_OnTick(ChuchuBossEntity*);
void ChuchuBoss_OnDeath(ChuchuBossEntity*);
void sub_08025DD8(ChuchuBossEntity*);
void sub_08026060(ChuchuBossEntity*);
void sub_08026090(ChuchuBossEntity*);
void sub_08026110(ChuchuBossEntity*);
void sub_0802626C(ChuchuBossEntity*);
void sub_080262A8(ChuchuBossEntity*);
void sub_08026328(ChuchuBossEntity*);
void sub_08026358(ChuchuBossEntity*);
void sub_080263B4(ChuchuBossEntity*);
void sub_08026414(ChuchuBossEntity*);
void sub_0802647C(ChuchuBossEntity*);
void sub_080264AC(ChuchuBossEntity*);
void sub_080264D4(ChuchuBossEntity*);
void sub_0802650C(ChuchuBossEntity*);
void sub_0802653C(ChuchuBossEntity*);
void sub_08026580(ChuchuBossEntity*);
void sub_08026634(ChuchuBossEntity*);
void sub_08026750(ChuchuBossEntity*);
void sub_08026774(ChuchuBossEntity*);
void sub_080267D0(ChuchuBossEntity*);
void sub_08026808(ChuchuBossEntity*);
void sub_0802686C(ChuchuBossEntity*);
void sub_080268C8(ChuchuBossEntity*);
void sub_080268EC(ChuchuBossEntity*);
void sub_08026914(ChuchuBossEntity*);
void sub_0802694C(ChuchuBossEntity*);
void sub_08026968(ChuchuBossEntity*);
void sub_080269CC(ChuchuBossEntity*);
void sub_08026BE8(ChuchuBossEntity*);
void sub_08026C40(ChuchuBossEntity*);
void sub_08026E1C(ChuchuBossEntity*);
void sub_08026F1C(ChuchuBossEntity*);
void sub_08026FA4(ChuchuBossEntity*);
void sub_08027064(ChuchuBossEntity*);
void sub_0802720C(ChuchuBossEntity*);
void sub_080272D4(ChuchuBossEntity*);
void ChuchuBoss_OnKnockback(Entity* this) {
GenericKnockback(this);
if (this->type == 0) {
sub_08027870(this);
}
}
void ChuchuBoss_OnTick(Entity*);
void ChuchuBoss_OnDeath(Entity*);
void sub_08025DD8(Entity*);
void sub_08026060(Entity*);
void sub_08026110(Entity*);
void sub_080272D4(Entity*);
void sub_0802720C(Entity*);
void sub_08026090(Entity*);
void sub_0802626C(Entity*);
void sub_08026580(Entity*);
void sub_08026634(Entity*);
void sub_08026750(Entity*);
void sub_0802686C(Entity*);
void sub_080268C8(Entity*);
void sub_0802694C(Entity*);
void sub_08026C40(Entity*);
void sub_08026E1C(Entity*);
void sub_08026FA4(Entity*);
void sub_08027064(Entity*);
void sub_08026F1C(Entity*);
void sub_080262A8(Entity*);
void sub_08026328(Entity*);
void sub_08026358(Entity*);
void sub_080263B4(Entity*);
void sub_08026414(Entity*);
void sub_0802647C(Entity*);
void sub_080264AC(Entity*);
void sub_080264D4(Entity*);
void sub_0802650C(Entity*);
void sub_0802653C(Entity*);
void sub_08026774(Entity*);
void sub_080267D0(Entity*);
void sub_08026808(Entity*);
void sub_080268EC(Entity*);
void sub_08026914(Entity*);
void sub_08026968(Entity*);
void sub_080269CC(Entity*);
void sub_08026BE8(Entity*);
// as-yet unknown types (could return things)
void sub_08027548();
void sub_0802757C();
void sub_080276F4();
void sub_080277B8();
void sub_080277F8();
void sub_08027870();
void sub_08027984();
void sub_080279AC();
void sub_080279E8();
void sub_08027A60();
void sub_08027AA4();
void sub_08027B98();
void sub_08027BBC();
void sub_08027C54();
void sub_08027C7C(ChuchuBossEntity*, u32);
void sub_08027C9C();
void sub_08027D20();
// clang-format off
void (*const ChuchuBoss_Functions[])(Entity*) = {
void (*const ChuchuBoss_Functions[])(ChuchuBossEntity*) = {
ChuchuBoss_OnTick,
ChuchuBoss_OnTick,
ChuchuBoss_OnKnockback,
ChuchuBoss_OnDeath,
GenericConfused,
(void (*)(ChuchuBossEntity*)) GenericConfused,
};
void (*const gUnk_080CC1B0[])(Entity*) = {
void (*const gUnk_080CC1B0[])(ChuchuBossEntity*) = {
sub_08025DD8,
sub_08026060,
};
const u8 gUnk_080CC1B8[] = {
0, 4,
0, 0,
0, 4,
0, 0,
1, 4,
0, 0,
2, 4,
0, 0,
const struct_080CC1B8 gUnk_080CC1B8[] = {
{0, 4, 0, 0},
{0, 4, 0, 0},
{1, 4, 0, 0},
{2, 4, 0, 0},
};
void (*const gUnk_080CC1C8[])(Entity*) = {
void (*const gUnk_080CC1C8[])(ChuchuBossEntity*) = {
sub_08026110,
sub_080272D4,
sub_0802720C,
@ -108,7 +153,7 @@ void (*const gUnk_080CC1C8[])(Entity*) = {
sub_08026090,
};
void (*const gUnk_080CC1DC[])(Entity*) = {
void (*const gUnk_080CC1DC[])(ChuchuBossEntity*) = {
sub_0802626C,
sub_08026580,
sub_08026634,
@ -123,7 +168,7 @@ void (*const gUnk_080CC1DC[])(Entity*) = {
sub_08026F1C,
};
void (*const gUnk_080CC20C[])(Entity*) = {
void (*const gUnk_080CC20C[])(ChuchuBossEntity*) = {
sub_080262A8,
sub_08026328,
sub_08026358,
@ -151,18 +196,18 @@ const u8 gUnk_080CC24F[] = {
4, 6, 6, 8,
};
void (*const gUnk_080CC258[])(Entity*) = {
void (*const gUnk_080CC258[])(ChuchuBossEntity*) = {
sub_08026774,
sub_080267D0,
sub_08026808,
};
void (*const gUnk_080CC264[])(Entity*) = {
void (*const gUnk_080CC264[])(ChuchuBossEntity*) = {
sub_080268EC,
sub_08026914,
};
void (*const gUnk_080CC26C[])(Entity*) = {
void (*const gUnk_080CC26C[])(ChuchuBossEntity*) = {
sub_08026968,
sub_080269CC,
sub_08026BE8,
@ -198,3 +243,210 @@ const s8 gUnk_080CC2DC[] = {
-7, -9, -7,
};
// clang-format on
void ChuchuBoss(Entity* this) {
ChuchuBoss_Functions[GetNextFunction(this)]((ChuchuBossEntity*)this);
}
void ChuchuBoss_OnKnockback(ChuchuBossEntity* this) {
GenericKnockback(super);
if (super->type == 0) {
sub_08027870(super);
}
}
NONMATCH("asm/non_matching/chuchuBoss/ChuchuBoss_OnDeath.inc", void ChuchuBoss_OnDeath(ChuchuBossEntity* this)) {
sub_08078B48();
if (super->type == 0) {
if (super->subAction != 0xC) {
super->subAction = 0xC;
this->unk_84->unk_03 = 0;
InitAnimationForceUpdate(super->child, 9);
} else {
switch (this->unk_84->unk_03) {
case 0:
sub_08027C7C(this, 0x3F);
this->unk_84->unk_03 = 1;
this->unk_7d = 0x78;
break;
case 1:
if (this->unk_7d-- == 0) {
((GenericEntity*)super->child)->field_0x6c.HALF.HI |= 2;
this->unk_68->unk_6d.unk1 = 1;
((GenericEntity*)super->parent)->field_0x6c.HALF.HI |= 2;
super->child->health = 0;
this->unk_68->base.health = 0;
super->parent->health = 0;
gPauseMenuOptions.disabled = 0;
SoundReq(SFX_BOSS_DIE);
GenericDeath(super);
} else {
u32 tmp = 0x3F;
if (this->unk_7d <= 0x50) {
tmp = 0xF;
if (this->unk_7d > 0x1E) {
tmp = 0x1F;
}
}
sub_08027C7C(this, tmp);
}
break;
default:
break;
}
}
sub_08027870(super);
} else {
if (this->unk_6d.unk1) {
this->unk_6d.unk1 = 1;
DeleteThisEntity();
}
}
}
END_NONMATCH
void ChuchuBoss_OnTick(ChuchuBossEntity* this) {
gUnk_080CC1B0[super->action](this);
}
NONMATCH("asm/non_matching/chuchuBoss/sub_08025DD8.inc", void sub_08025DD8(ChuchuBossEntity* this)) {
super->action = 1;
if (super->type == 8) {
super->type = 4;
super->hitbox = super->child->hitbox;
} else {
super->spritePriority.b0 = gUnk_080CC1B8[super->type & 3].unk_01;
this->unk_74.HALF.HI = 0xa0;
this->unk_78.HALF.HI = 0xa0;
this->unk_7e = 0;
super->spriteRendering.b0 = 3;
if ((super->type & 3) == 1) {
InitAnimationForceUpdate(super, 0);
} else {
InitializeAnimation(super, gUnk_080CC1B8[super->type & 3].unk_00);
}
switch (super->type & 3) {
Hitbox* hitbox;
case 0:
super->type2 = super->type & 3;
this->unk_84 = zMalloc(sizeof(Helper));
if (!this->unk_84 || !AllocMutableHitbox(super)) {
GenericDeath(super);
return;
}
super->myHeap = this->unk_84;
super->hitbox->offset_x = gUnk_080FD238.offset_x;
super->hitbox->offset_y = gUnk_080FD238.offset_y;
super->hitbox->unk2[0] = gUnk_080FD238.unk2[0];
super->hitbox->unk2[1] = gUnk_080FD238.unk2[1];
super->hitbox->unk2[2] = gUnk_080FD238.unk2[2];
super->hitbox->unk2[3] = gUnk_080FD238.unk2[3];
super->hitbox->width = gUnk_080FD238.width;
super->hitbox->height = gUnk_080FD238.height;
super->subAction = 0;
this->unk_6d.unk0 = 1;
this->unk_84->unk_06 = 0;
this->unk_84->unk_05 = 0;
this->unk_84->unk_01 = 0xF;
this->unk_84->unk_03 = 0;
this->unk_84->unk_04 = 0;
this->unk_84->unk_0e = super->x.HALF.HI;
this->unk_68 = (ChuchuBossEntity*)CreateEnemy(CHUCHU_BOSS, super->type | 3);
if (this->unk_68) {
this->unk_68->base.collisionLayer = super->collisionLayer;
this->unk_68->base.x.HALF.HI = super->x.HALF.HI;
this->unk_68->base.y.HALF.HI = super->y.HALF.HI - 0xE;
this->unk_68->base.timer = 0xE;
this->unk_68->base.parent = super;
this->unk_68->unk_68 = this;
}
super->parent = CreateEnemy(CHUCHU_BOSS, super->type | 2);
if (super->parent) {
super->parent->collisionLayer = super->collisionLayer;
super->parent->x.HALF.HI = super->x.HALF.HI;
super->parent->y.HALF.HI = this->unk_68->base.y.HALF.HI - 0x12;
super->parent->timer = 0x12;
super->parent->parent = (Entity*)this->unk_68;
this->unk_68->base.child = super->parent;
((ChuchuBossEntity*)super->parent)->unk_68 = this;
}
super->child = CreateEnemy(CHUCHU_BOSS, super->type | 1);
if (super->child) {
super->child->collisionLayer = super->collisionLayer;
super->child->x.HALF.HI = super->x.HALF.HI;
super->child->y.HALF.HI = super->parent->y.HALF.HI - 0xe;
super->child->timer = 0xe;
super->child->parent = super->parent;
super->child->child = super;
super->parent->child = super->child;
((ChuchuBossEntity*)super->child)->unk_68 = this;
}
{
Entity* tmp;
tmp = CreateEnemy(CHUCHU_BOSS, 8);
if (tmp) {
tmp->child = super;
}
tmp = CreateObjectWithParent(super, OBJECT_49, 1, 0);
if (tmp) {
tmp->child = super->child;
}
if (super->type != 0) {
tmp = CreateObjectWithParent(super, OBJECT_49, 3, 0);
if (tmp) {
tmp->child = super->child;
}
}
}
break;
case 1 ... 3:
hitbox = super->hitbox;
if (!AllocMutableHitbox(super)) {
this->unk_68->base.health = 0;
return;
}
super->hitbox->offset_x = hitbox->offset_x;
super->hitbox->offset_y = hitbox->offset_y;
super->hitbox->unk2[0] = hitbox->unk2[0];
super->hitbox->unk2[1] = hitbox->unk2[1];
super->hitbox->unk2[2] = hitbox->unk2[2];
super->hitbox->unk2[3] = hitbox->unk2[3];
super->hitbox->width = hitbox->width;
super->hitbox->height = hitbox->height;
break;
}
super->type &= 3;
sub_08026060(this);
}
}
END_NONMATCH
void sub_08026060(ChuchuBossEntity* this) {
gUnk_080CC1C8[super->type](this);
SetAffineInfo(super, this->unk_74.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7e);
}
void sub_08026090(ChuchuBossEntity* this) {
if (super->subAction == 0) {
if (super->child->health == 0) {
super->flags &= ~0x80;
super->subAction = 1;
super->timer = 250;
gRoomControls.camera_target = super;
}
super->flags = super->child->flags;
super->hitbox = super->child->hitbox;
if (super->child->hitType == 0x7E) {
super->hitType = 0x7E;
} else {
super->hitType = 0x7C;
}
CopyPosition(super->child, super);
} else {
sub_08078B48();
if (super->timer-- == 0) {
gRoomControls.camera_target = &gPlayerEntity;
DeleteThisEntity();
}
}
}