From ec5b248511a0613fb9236630e4b84b69ab550528 Mon Sep 17 00:00:00 2001 From: Zhengwen Jiang Date: Wed, 27 Apr 2022 21:58:42 -0500 Subject: [PATCH] more kirby --- asm/code_0803E324.s | 2148 ------------------------------------------- include/functions.h | 5 + src/kirby.c | 497 ++++++++++ 3 files changed, 502 insertions(+), 2148 deletions(-) diff --git a/asm/code_0803E324.s b/asm/code_0803E324.s index ec630b9..8d31bed 100644 --- a/asm/code_0803E324.s +++ b/asm/code_0803E324.s @@ -5,2154 +5,6 @@ .text - thumb_func_start sub_08061EA8 -sub_08061EA8: @ 0x08061EA8 - push {r4, lr} - adds r2, r0, #0 - movs r1, #0x8c - lsls r1, r1, #1 - adds r0, r2, r1 - ldrh r1, [r0] - movs r3, #0x30 - ands r3, r1 - cmp r3, #0 - beq _08061F18 - movs r0, #0x20 - ands r0, r1 - cmp r0, #0 - beq _08061EEC - ldr r0, [r2, #8] - movs r1, #1 - orrs r0, r1 - str r0, [r2, #8] - adds r2, #0x50 - ldrh r0, [r2] - subs r0, #0x10 - strh r0, [r2] - lsls r0, r0, #0x10 - ldr r1, _08061EE4 @ =0xFE240000 - cmp r0, r1 - bge _08061F3E - ldr r0, _08061EE8 @ =0x0000FE24 - strh r0, [r2] - b _08061F3E - .align 2, 0 -_08061EE4: .4byte 0xFE240000 -_08061EE8: .4byte 0x0000FE24 -_08061EEC: - movs r0, #0x10 - ands r0, r1 - cmp r0, #0 - beq _08061F3E - ldr r0, [r2, #8] - movs r1, #2 - rsbs r1, r1, #0 - ands r0, r1 - str r0, [r2, #8] - adds r1, r2, #0 - adds r1, #0x50 - ldrh r0, [r1] - adds r0, #0x10 - strh r0, [r1] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - movs r2, #0xee - lsls r2, r2, #1 - cmp r0, r2 - ble _08061F3E - strh r2, [r1] - b _08061F3E -_08061F18: - adds r1, r2, #0 - adds r1, #0x50 - ldrh r2, [r1] - movs r4, #0 - ldrsh r0, [r1, r4] - cmp r0, #0 - bge _08061F32 - adds r0, r2, #4 - strh r0, [r1] - lsls r0, r0, #0x10 - cmp r0, #0 - ble _08061F3E - b _08061F3C -_08061F32: - subs r0, r2, #4 - strh r0, [r1] - lsls r0, r0, #0x10 - cmp r0, #0 - bge _08061F3E -_08061F3C: - strh r3, [r1] -_08061F3E: - pop {r4} - pop {r0} - bx r0 - - thumb_func_start sub_08061F44 -sub_08061F44: @ 0x08061F44 - push {r4, r5, r6, lr} - adds r4, r0, #0 - ldr r0, [r4, #0x58] - movs r2, #2 - ands r0, r2 - cmp r0, #0 - beq _08061F60 - adds r0, r4, #0 - bl sub_0805BA58 - adds r0, r4, #0 - bl sub_08059810 - b _080620A2 -_08061F60: - ldr r1, [r4, #8] - adds r0, r1, #0 - ands r0, r2 - cmp r0, #0 - beq _08061FF4 - movs r0, #3 - rsbs r0, r0, #0 - ands r1, r0 - str r1, [r4, #8] - adds r1, r4, #0 - adds r1, #0xd4 - movs r0, #0x6b - strh r0, [r1] - ldr r0, _08062028 @ =sub_080620B0 - str r0, [r4, #0x78] - adds r0, r4, #0 - bl sub_080908A4 - adds r0, r4, #0 - bl sub_08090BAC - ldr r1, _0806202C @ =gKirbys - ldr r0, _08062030 @ =gUnk_0203AD3C - ldrb r2, [r0] - movs r0, #0xd4 - lsls r0, r0, #1 - muls r0, r2, r0 - adds r0, r0, r1 - adds r0, #0x60 - adds r1, r4, #0 - adds r1, #0x60 - ldrh r0, [r0] - ldrh r1, [r1] - cmp r0, r1 - bne _08061FF4 - ldrb r0, [r4] - cmp r0, #0 - bne _08061FB6 - adds r0, r4, #0 - adds r0, #0x56 - ldrb r0, [r0] - cmp r0, r2 - bne _08061FF4 -_08061FB6: - ldr r1, _08062034 @ =gUnk_08D60FA4 - ldr r5, _08062038 @ =gSongTable - ldr r2, _0806203C @ =0x000005FC - adds r0, r5, r2 - ldrh r3, [r0] - lsls r0, r3, #2 - adds r0, r0, r1 - ldr r2, [r0] - ldr r0, [r2, #4] - cmp r0, #0 - blt _08061FDC - movs r1, #0xbf - lsls r1, r1, #3 - adds r0, r5, r1 - ldr r1, [r0] - ldrb r0, [r2, #9] - ldrb r1, [r1, #2] - cmp r0, r1 - bhi _08061FF4 -_08061FDC: - cmp r3, #0 - beq _08061FEE - ldr r0, _08062040 @ =gUnk_0203AD10 - ldr r0, [r0] - movs r1, #0x80 - lsls r1, r1, #1 - ands r0, r1 - cmp r0, #0 - bne _08061FF4 -_08061FEE: - movs r0, #0xbf - bl m4aSongNumStart -_08061FF4: - adds r2, r4, #0 - adds r2, #0x62 - ldrb r1, [r2] - movs r0, #4 - ands r0, r1 - adds r6, r2, #0 - cmp r0, #0 - bne _0806208A - ldr r0, [r4, #0x58] - movs r1, #2 - ands r0, r1 - cmp r0, #0 - beq _0806204C - adds r0, r4, #0 - adds r0, #0x52 - ldrh r1, [r0] - subs r1, #8 - strh r1, [r0] - lsls r1, r1, #0x10 - ldr r2, _08062044 @ =0xFF200000 - adds r5, r0, #0 - cmp r1, r2 - bge _08062064 - ldr r0, _08062048 @ =0x0000FF20 - strh r0, [r5] - b _08062064 - .align 2, 0 -_08062028: .4byte sub_080620B0 -_0806202C: .4byte gKirbys -_08062030: .4byte gUnk_0203AD3C -_08062034: .4byte gUnk_08D60FA4 -_08062038: .4byte gSongTable -_0806203C: .4byte 0x000005FC -_08062040: .4byte gUnk_0203AD10 -_08062044: .4byte 0xFF200000 -_08062048: .4byte 0x0000FF20 -_0806204C: - adds r1, r4, #0 - adds r1, #0x52 - ldrh r0, [r1] - subs r0, #0x26 - strh r0, [r1] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - ldr r2, _080620A8 @ =0xFFFFFD80 - adds r5, r1, #0 - cmp r0, r2 - bge _08062064 - strh r2, [r5] -_08062064: - ldr r0, [r4, #8] - movs r1, #0x80 - lsls r1, r1, #5 - ands r0, r1 - cmp r0, #0 - beq _0806208A - adds r0, r4, #0 - bl sub_08003704 - cmp r0, #0 - beq _08062082 - movs r2, #0 - ldrsh r0, [r5, r2] - cmp r0, #0 - blt _0806208A -_08062082: - ldr r0, [r4, #8] - ldr r1, _080620AC @ =0xFFFFEFFF - ands r0, r1 - str r0, [r4, #8] -_0806208A: - adds r0, r4, #0 - bl sub_08061EA8 - ldrb r1, [r6] - movs r0, #1 - ands r0, r1 - cmp r0, #0 - beq _080620A2 - adds r1, r4, #0 - adds r1, #0x50 - movs r0, #0 - strh r0, [r1] -_080620A2: - pop {r4, r5, r6} - pop {r0} - bx r0 - .align 2, 0 -_080620A8: .4byte 0xFFFFFD80 -_080620AC: .4byte 0xFFFFEFFF - - thumb_func_start sub_080620B0 -sub_080620B0: @ 0x080620B0 - push {r4, r5, r6, lr} - adds r4, r0, #0 - ldr r0, [r4, #0x58] - movs r3, #2 - ands r0, r3 - cmp r0, #0 - beq _080620CC - adds r0, r4, #0 - bl sub_0805BA58 - adds r0, r4, #0 - bl sub_08059810 - b _0806219E -_080620CC: - ldrh r2, [r4, #4] - movs r1, #4 - ldrsh r0, [r4, r1] - cmp r0, #2 - bgt _080620DE - ldr r0, [r4, #8] - movs r1, #4 - orrs r0, r1 - str r0, [r4, #8] -_080620DE: - ldr r1, [r4, #8] - adds r0, r1, #0 - ands r0, r3 - cmp r0, #0 - beq _08062108 - adds r0, r2, #1 - strh r0, [r4, #4] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - cmp r0, #3 - ble _08062108 - movs r0, #3 - rsbs r0, r0, #0 - ands r1, r0 - str r1, [r4, #8] - adds r1, r4, #0 - adds r1, #0xd4 - movs r0, #0x6c - strh r0, [r1] - ldr r0, _0806213C @ =sub_080621AC - str r0, [r4, #0x78] -_08062108: - adds r2, r4, #0 - adds r2, #0x62 - ldrb r1, [r2] - movs r0, #4 - ands r0, r1 - adds r6, r2, #0 - cmp r0, #0 - bne _08062186 - ldr r0, [r4, #0x58] - movs r1, #2 - ands r0, r1 - cmp r0, #0 - beq _08062148 - adds r0, r4, #0 - adds r0, #0x52 - ldrh r1, [r0] - subs r1, #8 - strh r1, [r0] - lsls r1, r1, #0x10 - ldr r2, _08062140 @ =0xFF200000 - adds r5, r0, #0 - cmp r1, r2 - bge _08062160 - ldr r0, _08062144 @ =0x0000FF20 - strh r0, [r5] - b _08062160 - .align 2, 0 -_0806213C: .4byte sub_080621AC -_08062140: .4byte 0xFF200000 -_08062144: .4byte 0x0000FF20 -_08062148: - adds r1, r4, #0 - adds r1, #0x52 - ldrh r0, [r1] - subs r0, #0x26 - strh r0, [r1] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - ldr r2, _080621A4 @ =0xFFFFFD80 - adds r5, r1, #0 - cmp r0, r2 - bge _08062160 - strh r2, [r5] -_08062160: - ldr r0, [r4, #8] - movs r1, #0x80 - lsls r1, r1, #5 - ands r0, r1 - cmp r0, #0 - beq _08062186 - adds r0, r4, #0 - bl sub_08003704 - cmp r0, #0 - beq _0806217E - movs r1, #0 - ldrsh r0, [r5, r1] - cmp r0, #0 - blt _08062186 -_0806217E: - ldr r0, [r4, #8] - ldr r1, _080621A8 @ =0xFFFFEFFF - ands r0, r1 - str r0, [r4, #8] -_08062186: - adds r0, r4, #0 - bl sub_08061EA8 - ldrb r1, [r6] - movs r0, #1 - ands r0, r1 - cmp r0, #0 - beq _0806219E - adds r1, r4, #0 - adds r1, #0x50 - movs r0, #0 - strh r0, [r1] -_0806219E: - pop {r4, r5, r6} - pop {r0} - bx r0 - .align 2, 0 -_080621A4: .4byte 0xFFFFFD80 -_080621A8: .4byte 0xFFFFEFFF - - thumb_func_start sub_080621AC -sub_080621AC: @ 0x080621AC - push {r4, r5, r6, lr} - adds r4, r0, #0 - ldr r0, [r4, #0x58] - movs r2, #2 - ands r0, r2 - cmp r0, #0 - beq _080621C2 - adds r0, r4, #0 - bl sub_0805BA58 - b _0806220E -_080621C2: - ldr r1, [r4, #8] - adds r0, r1, #0 - ands r0, r2 - adds r2, r1, #0 - cmp r0, #0 - beq _0806222E - ldr r1, _080621E0 @ =0x00000103 - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, #0xb - bne _080621E4 - adds r0, r4, #0 - bl sub_080641FC - b _08062292 - .align 2, 0 -_080621E0: .4byte 0x00000103 -_080621E4: - cmp r0, #0xe - bne _080621F0 - adds r0, r4, #0 - bl sub_0806A798 - b _08062292 -_080621F0: - cmp r0, #0x13 - bne _08062204 - movs r0, #0x40 - ands r0, r2 - cmp r0, #0 - beq _08062204 - adds r0, r4, #0 - bl sub_08047EF0 - b _08062292 -_08062204: - ldr r0, [r4, #0x58] - movs r1, #2 - ands r0, r1 - cmp r0, #0 - beq _08062216 -_0806220E: - adds r0, r4, #0 - bl sub_08059810 - b _08062292 -_08062216: - movs r0, #0x60 - ands r0, r2 - cmp r0, #0 - beq _08062226 - adds r0, r4, #0 - bl sub_08044EA8 - b _08062292 -_08062226: - adds r0, r4, #0 - bl sub_0803FE74 - b _08062292 -_0806222E: - adds r2, r4, #0 - adds r2, #0x62 - ldrb r1, [r2] - movs r0, #4 - ands r0, r1 - adds r6, r2, #0 - cmp r0, #0 - bne _0806227A - adds r5, r4, #0 - adds r5, #0x52 - ldrh r0, [r5] - subs r0, #0x26 - strh r0, [r5] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - ldr r1, _08062298 @ =0xFFFFFD80 - cmp r0, r1 - bge _08062254 - strh r1, [r5] -_08062254: - ldr r0, [r4, #8] - movs r1, #0x80 - lsls r1, r1, #5 - ands r0, r1 - cmp r0, #0 - beq _0806227A - adds r0, r4, #0 - bl sub_08003704 - cmp r0, #0 - beq _08062272 - movs r1, #0 - ldrsh r0, [r5, r1] - cmp r0, #0 - blt _0806227A -_08062272: - ldr r0, [r4, #8] - ldr r1, _0806229C @ =0xFFFFEFFF - ands r0, r1 - str r0, [r4, #8] -_0806227A: - adds r0, r4, #0 - bl sub_08061EA8 - ldrb r1, [r6] - movs r0, #1 - ands r0, r1 - cmp r0, #0 - beq _08062292 - adds r1, r4, #0 - adds r1, #0x50 - movs r0, #0 - strh r0, [r1] -_08062292: - pop {r4, r5, r6} - pop {r0} - bx r0 - .align 2, 0 -_08062298: .4byte 0xFFFFFD80 -_0806229C: .4byte 0xFFFFEFFF - - thumb_func_start sub_080622A0 -sub_080622A0: @ 0x080622A0 - push {r4, r5, r6, r7, lr} - mov r7, sb - mov r6, r8 - push {r6, r7} - adds r5, r0, #0 - adds r0, #0xd4 - ldrh r0, [r0] - cmp r0, #0x35 - bne _080622CA - ldr r0, [r5, #0x58] - movs r1, #2 - ands r0, r1 - cmp r0, #0 - beq _080622F6 - adds r0, r5, #0 - bl sub_0805BA58 - adds r0, r5, #0 - bl sub_08059810 - b _08062532 -_080622CA: - ldr r0, [r5, #0x58] - movs r1, #2 - ands r0, r1 - cmp r0, #0 - bne _080622F6 - adds r0, r5, #0 - bl sub_0805BBB4 - adds r0, r5, #0 - adds r0, #0x52 - movs r1, #0 - ldrsh r0, [r0, r1] - cmp r0, #0 - bge _080622EE - adds r0, r5, #0 - bl sub_08044EA8 - b _08062532 -_080622EE: - adds r0, r5, #0 - bl sub_08043360 - b _08062532 -_080622F6: - ldrb r0, [r5, #1] - cmp r0, #8 - bne _08062302 - adds r0, r5, #0 - bl sub_08092C10 -_08062302: - ldrb r2, [r5, #1] - cmp r2, #0xd - bne _08062314 - adds r0, r5, #0 - adds r0, #0xd4 - ldrh r1, [r0] - mov r8, r0 - cmp r1, #0x35 - beq _08062328 -_08062314: - cmp r2, #0x12 - beq _0806231A - b _080624A0 -_0806231A: - adds r0, r5, #0 - adds r0, #0xd4 - ldrh r1, [r0] - mov r8, r0 - cmp r1, #0x42 - beq _08062328 - b _080624A0 -_08062328: - movs r6, #0 - strb r6, [r5, #1] - strh r6, [r5, #2] - ldr r0, [r5, #8] - movs r1, #3 - rsbs r1, r1, #0 - ands r0, r1 - str r0, [r5, #8] - movs r1, #1 - ands r0, r1 - cmp r0, #0 - beq _0806234C - ldr r0, [r5, #0x40] - ldr r2, _08062348 @ =0xFFFFE800 - adds r1, r0, r2 - b _08062354 - .align 2, 0 -_08062348: .4byte 0xFFFFE800 -_0806234C: - ldr r0, [r5, #0x40] - movs r3, #0xc0 - lsls r3, r3, #5 - adds r1, r0, r3 -_08062354: - ldr r0, [r5, #0x44] - movs r3, #0x80 - lsls r3, r3, #4 - adds r2, r0, r3 - ldr r4, _08062454 @ =gCurLevelInfo - movs r0, #0x56 - adds r0, r0, r5 - mov sb, r0 - ldrb r7, [r0] - movs r0, #0xcd - lsls r0, r0, #3 - adds r3, r7, #0 - muls r3, r0, r3 - adds r0, r4, #0 - adds r0, #0x50 - adds r0, r3, r0 - ldr r0, [r0] - cmp r1, r0 - bgt _0806243E - adds r0, r4, #0 - adds r0, #0x48 - adds r0, r3, r0 - ldr r0, [r0] - cmp r1, r0 - blt _0806243E - adds r0, r4, #0 - adds r0, #0x54 - adds r0, r3, r0 - ldr r0, [r0] - cmp r2, r0 - bgt _0806243E - adds r0, r4, #0 - adds r0, #0x4c - adds r0, r3, r0 - ldr r0, [r0] - cmp r2, r0 - blt _0806243E - ldr r4, _08062458 @ =gUnk_082D88B8 - lsls r1, r1, #4 - lsrs r1, r1, #0x10 - lsls r2, r2, #4 - lsrs r2, r2, #0x10 - adds r0, r7, #0 - bl sub_080023E4 - lsls r0, r0, #0x18 - lsrs r0, r0, #0x16 - adds r0, r0, r4 - ldr r6, [r0] - movs r0, #1 - ands r0, r6 - cmp r0, #0 - bne _0806243E - adds r0, r5, #0 - movs r1, #0 - bl sub_08093918 - adds r0, r5, #0 - movs r1, #1 - bl sub_08093918 - ldr r0, _0806245C @ =0x00000201 - adds r1, r5, #0 - bl sub_0806FE64 - ldr r1, _08062460 @ =gKirbys - ldr r0, _08062464 @ =gUnk_0203AD3C - ldrb r2, [r0] - movs r0, #0xd4 - lsls r0, r0, #1 - muls r0, r2, r0 - adds r0, r0, r1 - adds r0, #0x60 - adds r1, r5, #0 - adds r1, #0x60 - ldrh r0, [r0] - ldrh r1, [r1] - cmp r0, r1 - bne _0806243E - ldrb r0, [r5] - cmp r0, #0 - bne _08062400 - mov r1, sb - ldrb r0, [r1] - cmp r0, r2 - bne _0806243E -_08062400: - ldr r1, _08062468 @ =gUnk_08D60FA4 - ldr r4, _0806246C @ =gSongTable - ldr r2, _08062470 @ =0x000005DC - adds r0, r4, r2 - ldrh r3, [r0] - lsls r0, r3, #2 - adds r0, r0, r1 - ldr r2, [r0] - ldr r0, [r2, #4] - cmp r0, #0 - blt _08062426 - movs r1, #0xbb - lsls r1, r1, #3 - adds r0, r4, r1 - ldr r1, [r0] - ldrb r0, [r2, #9] - ldrb r1, [r1, #2] - cmp r0, r1 - bhi _0806243E -_08062426: - cmp r3, #0 - beq _08062438 - ldr r0, _08062474 @ =gUnk_0203AD10 - ldr r0, [r0] - movs r1, #0x80 - lsls r1, r1, #1 - ands r0, r1 - cmp r0, #0 - bne _0806243E -_08062438: - movs r0, #0xbb - bl m4aSongNumStart -_0806243E: - ldr r0, [r5, #0x58] - movs r1, #2 - ands r0, r1 - cmp r0, #0 - beq _08062480 - movs r0, #1 - ands r6, r0 - cmp r6, #0 - beq _08062478 - movs r0, #0x44 - b _08062492 - .align 2, 0 -_08062454: .4byte gCurLevelInfo -_08062458: .4byte gUnk_082D88B8 -_0806245C: .4byte 0x00000201 -_08062460: .4byte gKirbys -_08062464: .4byte gUnk_0203AD3C -_08062468: .4byte gUnk_08D60FA4 -_0806246C: .4byte gSongTable -_08062470: .4byte 0x000005DC -_08062474: .4byte gUnk_0203AD10 -_08062478: - movs r0, #0x43 - mov r3, r8 - strh r0, [r3] - b _08062496 -_08062480: - movs r0, #1 - ands r6, r0 - cmp r6, #0 - beq _08062490 - movs r0, #0x36 - mov r1, r8 - strh r0, [r1] - b _08062496 -_08062490: - movs r0, #0x34 -_08062492: - mov r2, r8 - strh r0, [r2] -_08062496: - ldr r0, _0806249C @ =sub_08062548 - str r0, [r5, #0x78] - b _08062532 - .align 2, 0 -_0806249C: .4byte sub_08062548 -_080624A0: - adds r2, r5, #0 - adds r2, #0x62 - ldrb r1, [r2] - movs r0, #4 - ands r0, r1 - adds r6, r2, #0 - cmp r0, #0 - bne _0806251A - ldr r0, [r5, #0x58] - movs r1, #2 - ands r0, r1 - cmp r0, #0 - beq _080624DC - adds r0, r5, #0 - adds r0, #0x52 - ldrh r1, [r0] - subs r1, #8 - strh r1, [r0] - lsls r1, r1, #0x10 - ldr r2, _080624D4 @ =0xFF200000 - adds r4, r0, #0 - cmp r1, r2 - bge _080624F4 - ldr r0, _080624D8 @ =0x0000FF20 - strh r0, [r4] - b _080624F4 - .align 2, 0 -_080624D4: .4byte 0xFF200000 -_080624D8: .4byte 0x0000FF20 -_080624DC: - adds r1, r5, #0 - adds r1, #0x52 - ldrh r0, [r1] - subs r0, #0x26 - strh r0, [r1] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - ldr r2, _08062540 @ =0xFFFFFD80 - adds r4, r1, #0 - cmp r0, r2 - bge _080624F4 - strh r2, [r4] -_080624F4: - ldr r0, [r5, #8] - movs r1, #0x80 - lsls r1, r1, #5 - ands r0, r1 - cmp r0, #0 - beq _0806251A - adds r0, r5, #0 - bl sub_08003704 - cmp r0, #0 - beq _08062512 - movs r3, #0 - ldrsh r0, [r4, r3] - cmp r0, #0 - blt _0806251A -_08062512: - ldr r0, [r5, #8] - ldr r1, _08062544 @ =0xFFFFEFFF - ands r0, r1 - str r0, [r5, #8] -_0806251A: - adds r0, r5, #0 - bl sub_0805B1B8 - ldrb r1, [r6] - movs r0, #1 - ands r0, r1 - cmp r0, #0 - beq _08062532 - adds r1, r5, #0 - adds r1, #0x50 - movs r0, #0 - strh r0, [r1] -_08062532: - pop {r3, r4} - mov r8, r3 - mov sb, r4 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_08062540: .4byte 0xFFFFFD80 -_08062544: .4byte 0xFFFFEFFF - - thumb_func_start sub_08062548 -sub_08062548: @ 0x08062548 - push {r4, r5, r6, lr} - adds r4, r0, #0 - adds r0, #0xd4 - ldrh r0, [r0] - cmp r0, #0x36 - beq _08062558 - cmp r0, #0x34 - bne _0806256C -_08062558: - ldr r1, [r4, #0x58] - movs r0, #2 - ands r0, r1 - adds r3, r1, #0 - cmp r0, #0 - beq _08062592 - adds r0, r4, #0 - bl sub_0805BA58 - b _080625DC -_0806256C: - ldr r1, [r4, #0x58] - movs r0, #2 - ands r0, r1 - adds r3, r1, #0 - cmp r0, #0 - bne _08062592 - adds r0, r4, #0 - bl sub_0805BBB4 - adds r0, r4, #0 - adds r0, #0x52 - movs r1, #0 - ldrsh r0, [r0, r1] - cmp r0, #0 - blt _080625EC - adds r0, r4, #0 - bl sub_08043360 - b _0806267C -_08062592: - ldr r1, [r4, #8] - movs r5, #2 - adds r0, r1, #0 - ands r0, r5 - cmp r0, #0 - beq _080625FC - ldr r2, _080625B0 @ =0x00000103 - adds r0, r4, r2 - ldrb r0, [r0] - cmp r0, #0xb - bne _080625B4 - adds r0, r4, #0 - bl sub_080641FC - b _0806267C - .align 2, 0 -_080625B0: .4byte 0x00000103 -_080625B4: - cmp r0, #0xe - bne _080625C0 - adds r0, r4, #0 - bl sub_0806A798 - b _0806267C -_080625C0: - cmp r0, #0x13 - bne _080625D4 - movs r0, #0x40 - ands r0, r1 - cmp r0, #0 - beq _080625D4 - adds r0, r4, #0 - bl sub_08047EF0 - b _0806267C -_080625D4: - movs r0, #2 - ands r0, r3 - cmp r0, #0 - beq _080625E4 -_080625DC: - adds r0, r4, #0 - bl sub_08059810 - b _0806267C -_080625E4: - movs r0, #0x60 - ands r0, r1 - cmp r0, #0 - beq _080625F4 -_080625EC: - adds r0, r4, #0 - bl sub_08044EA8 - b _0806267C -_080625F4: - adds r0, r4, #0 - bl sub_0803FE74 - b _0806267C -_080625FC: - adds r2, r4, #0 - adds r2, #0x62 - ldrb r1, [r2] - movs r0, #4 - ands r0, r1 - adds r6, r2, #0 - cmp r0, #0 - bne _08062664 - ands r3, r5 - cmp r3, #0 - beq _08062626 - adds r1, r4, #0 - adds r1, #0x52 - ldrh r0, [r1] - subs r0, #8 - strh r0, [r1] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - movs r2, #0xe0 - rsbs r2, r2, #0 - b _08062636 -_08062626: - adds r1, r4, #0 - adds r1, #0x52 - ldrh r0, [r1] - subs r0, #0x26 - strh r0, [r1] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - ldr r2, _08062684 @ =0xFFFFFD80 -_08062636: - adds r5, r1, #0 - cmp r0, r2 - bge _0806263E - strh r2, [r5] -_0806263E: - ldr r0, [r4, #8] - movs r1, #0x80 - lsls r1, r1, #5 - ands r0, r1 - cmp r0, #0 - beq _08062664 - adds r0, r4, #0 - bl sub_08003704 - cmp r0, #0 - beq _0806265C - movs r1, #0 - ldrsh r0, [r5, r1] - cmp r0, #0 - blt _08062664 -_0806265C: - ldr r0, [r4, #8] - ldr r1, _08062688 @ =0xFFFFEFFF - ands r0, r1 - str r0, [r4, #8] -_08062664: - adds r0, r4, #0 - bl sub_0805B1B8 - ldrb r1, [r6] - movs r0, #1 - ands r0, r1 - cmp r0, #0 - beq _0806267C - adds r1, r4, #0 - adds r1, #0x50 - movs r0, #0 - strh r0, [r1] -_0806267C: - pop {r4, r5, r6} - pop {r0} - bx r0 - .align 2, 0 -_08062684: .4byte 0xFFFFFD80 -_08062688: .4byte 0xFFFFEFFF - - thumb_func_start sub_0806268C -sub_0806268C: @ 0x0806268C - push {r4, r5, r6, lr} - adds r4, r0, #0 - adds r0, #0xd4 - ldrh r0, [r0] - cmp r0, #0x68 - bne _080626B2 - ldr r0, [r4, #0x58] - movs r1, #2 - ands r0, r1 - cmp r0, #0 - beq _080626AA - adds r0, r4, #0 - bl sub_0805BA58 - b _08062736 -_080626AA: - adds r0, r4, #0 - bl sub_0805BE80 - b _080626D6 -_080626B2: - ldr r0, [r4, #0x58] - movs r1, #2 - ands r0, r1 - cmp r0, #0 - bne _080626D6 - adds r0, r4, #0 - bl sub_0805BBB4 - adds r0, r4, #0 - adds r0, #0x52 - movs r1, #0 - ldrsh r0, [r0, r1] - cmp r0, #0 - blt _08062746 - adds r0, r4, #0 - bl sub_08043360 - b _080627C8 -_080626D6: - ldr r1, [r4, #8] - movs r3, #2 - adds r0, r1, #0 - ands r0, r3 - adds r5, r1, #0 - cmp r0, #0 - bne _080626F4 - adds r2, r4, #0 - adds r2, #0x62 - ldrb r1, [r2] - movs r0, #4 - ands r0, r1 - adds r6, r2, #0 - cmp r0, #0 - beq _08062756 -_080626F4: - ldr r1, _08062708 @ =0x00000103 - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, #0xb - bne _0806270C - adds r0, r4, #0 - bl sub_080641FC - b _080627C8 - .align 2, 0 -_08062708: .4byte 0x00000103 -_0806270C: - cmp r0, #0xe - bne _08062718 - adds r0, r4, #0 - bl sub_0806A798 - b _080627C8 -_08062718: - cmp r0, #0x13 - bne _0806272C - movs r0, #0x40 - ands r0, r5 - cmp r0, #0 - beq _0806272C - adds r0, r4, #0 - bl sub_08047EF0 - b _080627C8 -_0806272C: - ldr r0, [r4, #0x58] - movs r1, #2 - ands r0, r1 - cmp r0, #0 - beq _0806273E -_08062736: - adds r0, r4, #0 - bl sub_08059810 - b _080627C8 -_0806273E: - movs r0, #0x60 - ands r0, r5 - cmp r0, #0 - beq _0806274E -_08062746: - adds r0, r4, #0 - bl sub_08044EA8 - b _080627C8 -_0806274E: - adds r0, r4, #0 - bl sub_0803FE74 - b _080627C8 -_08062756: - ldr r0, [r4, #0x58] - ands r0, r3 - cmp r0, #0 - beq _08062772 - adds r1, r4, #0 - adds r1, #0x52 - ldrh r0, [r1] - subs r0, #8 - strh r0, [r1] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - movs r2, #0xe0 - rsbs r2, r2, #0 - b _08062782 -_08062772: - adds r1, r4, #0 - adds r1, #0x52 - ldrh r0, [r1] - subs r0, #0x26 - strh r0, [r1] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - ldr r2, _080627D0 @ =0xFFFFFD80 -_08062782: - adds r5, r1, #0 - cmp r0, r2 - bge _0806278A - strh r2, [r5] -_0806278A: - ldr r0, [r4, #8] - movs r1, #0x80 - lsls r1, r1, #5 - ands r0, r1 - cmp r0, #0 - beq _080627B0 - adds r0, r4, #0 - bl sub_08003704 - cmp r0, #0 - beq _080627A8 - movs r1, #0 - ldrsh r0, [r5, r1] - cmp r0, #0 - blt _080627B0 -_080627A8: - ldr r0, [r4, #8] - ldr r1, _080627D4 @ =0xFFFFEFFF - ands r0, r1 - str r0, [r4, #8] -_080627B0: - adds r0, r4, #0 - bl sub_0805B1B8 - ldrb r1, [r6] - movs r0, #1 - ands r0, r1 - cmp r0, #0 - beq _080627C8 - adds r1, r4, #0 - adds r1, #0x50 - movs r0, #0 - strh r0, [r1] -_080627C8: - pop {r4, r5, r6} - pop {r0} - bx r0 - .align 2, 0 -_080627D0: .4byte 0xFFFFFD80 -_080627D4: .4byte 0xFFFFEFFF - - thumb_func_start sub_080627D8 -sub_080627D8: @ 0x080627D8 - push {r4, lr} - adds r4, r0, #0 - adds r2, r4, #0 - adds r2, #0xd4 - movs r1, #0 - movs r0, #0x35 - strh r0, [r2] - strh r1, [r4, #4] - adds r0, r4, #0 - adds r0, #0xd6 - strh r1, [r0] - subs r0, #0x84 - strh r1, [r0] - movs r1, #0x8c - lsls r1, r1, #1 - adds r0, r4, r1 - ldrh r1, [r0] - movs r0, #0x20 - ands r0, r1 - cmp r0, #0 - beq _0806280A - ldr r0, [r4, #8] - movs r1, #1 - orrs r0, r1 - b _0806281A -_0806280A: - movs r0, #0x10 - ands r0, r1 - cmp r0, #0 - beq _0806281C - ldr r0, [r4, #8] - movs r1, #2 - rsbs r1, r1, #0 - ands r0, r1 -_0806281A: - str r0, [r4, #8] -_0806281C: - ldr r0, [r4, #8] - movs r1, #3 - rsbs r1, r1, #0 - ands r0, r1 - str r0, [r4, #8] - adds r0, r4, #0 - bl sub_0807A10C - ldr r0, _080628A0 @ =sub_080628BC - str r0, [r4, #0x78] - ldr r1, _080628A4 @ =gKirbys - ldr r0, _080628A8 @ =gUnk_0203AD3C - ldrb r2, [r0] - movs r0, #0xd4 - lsls r0, r0, #1 - muls r0, r2, r0 - adds r0, r0, r1 - adds r0, #0x60 - adds r1, r4, #0 - adds r1, #0x60 - ldrh r0, [r0] - ldrh r1, [r1] - cmp r0, r1 - bne _0806289A - ldrb r0, [r4] - cmp r0, #0 - bne _0806285C - adds r0, r4, #0 - adds r0, #0x56 - ldrb r0, [r0] - cmp r0, r2 - bne _0806289A -_0806285C: - ldr r1, _080628AC @ =gUnk_08D60FA4 - ldr r4, _080628B0 @ =gSongTable - ldr r2, _080628B4 @ =0x000005BC - adds r0, r4, r2 - ldrh r3, [r0] - lsls r0, r3, #2 - adds r0, r0, r1 - ldr r2, [r0] - ldr r0, [r2, #4] - cmp r0, #0 - blt _08062882 - movs r1, #0xb7 - lsls r1, r1, #3 - adds r0, r4, r1 - ldr r1, [r0] - ldrb r0, [r2, #9] - ldrb r1, [r1, #2] - cmp r0, r1 - bhi _0806289A -_08062882: - cmp r3, #0 - beq _08062894 - ldr r0, _080628B8 @ =gUnk_0203AD10 - ldr r0, [r0] - movs r1, #0x80 - lsls r1, r1, #1 - ands r0, r1 - cmp r0, #0 - bne _0806289A -_08062894: - movs r0, #0xb7 - bl m4aSongNumStart -_0806289A: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080628A0: .4byte sub_080628BC -_080628A4: .4byte gKirbys -_080628A8: .4byte gUnk_0203AD3C -_080628AC: .4byte gUnk_08D60FA4 -_080628B0: .4byte gSongTable -_080628B4: .4byte 0x000005BC -_080628B8: .4byte gUnk_0203AD10 - - thumb_func_start sub_080628BC -sub_080628BC: @ 0x080628BC - push {r4, r5, r6, r7, lr} - adds r4, r0, #0 - ldr r2, [r4, #0x58] - movs r5, #2 - ands r2, r5 - cmp r2, #0 - beq _080628D6 - bl sub_0805BA58 - adds r0, r4, #0 - bl sub_08059810 - b _08062A70 -_080628D6: - ldr r1, [r4, #8] - adds r0, r1, #0 - ands r0, r5 - adds r3, r1, #0 - cmp r0, #0 - beq _08062920 - movs r1, #0x8c - lsls r1, r1, #1 - adds r0, r4, r1 - ldrh r1, [r0] - adds r0, r5, #0 - ands r0, r1 - cmp r0, #0 - beq _08062900 - adds r1, r4, #0 - adds r1, #0x52 - movs r3, #0 - ldrsh r0, [r1, r3] - cmp r0, #0 - bge _08062900 - strh r2, [r1] -_08062900: - adds r0, r4, #0 - adds r0, #0xd4 - movs r1, #0x34 - strh r1, [r0] - ldr r0, _0806291C @ =sub_08062A80 - str r0, [r4, #0x78] - adds r0, r4, #0 - bl sub_080908A4 - adds r0, r4, #0 - bl sub_08090BAC - b _08062A70 - .align 2, 0 -_0806291C: .4byte sub_08062A80 -_08062920: - movs r1, #4 - ldrsh r0, [r4, r1] - adds r6, r4, #0 - adds r6, #0x50 - cmp r0, #0 - bne _0806297A - movs r2, #0x8c - lsls r2, r2, #1 - adds r0, r4, r2 - ldrh r1, [r0] - movs r0, #0x20 - ands r0, r1 - cmp r0, #0 - beq _0806294C - movs r1, #1 - adds r0, r3, #0 - ands r0, r1 - cmp r0, #0 - bne _0806294C - orrs r3, r1 - str r3, [r4, #8] - b _08062970 -_0806294C: - movs r1, #0x8c - lsls r1, r1, #1 - adds r0, r4, r1 - ldrh r1, [r0] - movs r0, #0x10 - ands r0, r1 - adds r6, r4, #0 - adds r6, #0x50 - cmp r0, #0 - beq _0806297A - movs r0, #1 - ands r0, r3 - cmp r0, #0 - beq _080629AC - movs r0, #2 - rsbs r0, r0, #0 - ands r0, r3 - str r0, [r4, #8] -_08062970: - movs r0, #8 - strh r0, [r4, #4] - ldrh r0, [r6] - rsbs r0, r0, #0 - strh r0, [r6] -_0806297A: - ldr r0, [r4, #8] - movs r1, #1 - ands r0, r1 - cmp r0, #0 - beq _080629AC - ldrh r0, [r6] - subs r0, #0x18 - strh r0, [r6] - lsls r0, r0, #0x10 - asrs r1, r0, #0x10 - ldr r0, _0806299C @ =0xFFFFFF00 - cmp r1, r0 - bge _080629A0 - movs r0, #0xff - lsls r0, r0, #8 - strh r0, [r6] - b _080629C6 - .align 2, 0 -_0806299C: .4byte 0xFFFFFF00 -_080629A0: - movs r0, #0x80 - lsls r0, r0, #1 - cmp r1, r0 - ble _080629C6 - strh r0, [r6] - b _080629C6 -_080629AC: - ldrh r0, [r6] - adds r0, #0x18 - strh r0, [r6] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - movs r1, #0x80 - lsls r1, r1, #1 - cmp r0, r1 - bgt _080629C4 - ldr r1, _080629FC @ =0xFFFFFF00 - cmp r0, r1 - bge _080629C6 -_080629C4: - strh r1, [r6] -_080629C6: - adds r2, r4, #0 - adds r2, #0x62 - ldrb r1, [r2] - movs r0, #4 - ands r0, r1 - adds r7, r2, #0 - cmp r0, #0 - bne _08062A46 - ldr r0, [r4, #0x58] - movs r1, #2 - ands r0, r1 - cmp r0, #0 - beq _08062A08 - adds r0, r4, #0 - adds r0, #0x52 - ldrh r1, [r0] - subs r1, #0x18 - strh r1, [r0] - lsls r1, r1, #0x10 - ldr r2, _08062A00 @ =0xFD800000 - adds r5, r0, #0 - cmp r1, r2 - bge _08062A20 - ldr r0, _08062A04 @ =0x0000FD80 - strh r0, [r5] - b _08062A20 - .align 2, 0 -_080629FC: .4byte 0xFFFFFF00 -_08062A00: .4byte 0xFD800000 -_08062A04: .4byte 0x0000FD80 -_08062A08: - adds r1, r4, #0 - adds r1, #0x52 - ldrh r0, [r1] - subs r0, #0x18 - strh r0, [r1] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - ldr r2, _08062A78 @ =0xFFFFFD80 - adds r5, r1, #0 - cmp r0, r2 - bge _08062A20 - strh r2, [r5] -_08062A20: - ldr r0, [r4, #8] - movs r1, #0x80 - lsls r1, r1, #5 - ands r0, r1 - cmp r0, #0 - beq _08062A46 - adds r0, r4, #0 - bl sub_08003704 - cmp r0, #0 - beq _08062A3E - movs r2, #0 - ldrsh r0, [r5, r2] - cmp r0, #0 - blt _08062A46 -_08062A3E: - ldr r0, [r4, #8] - ldr r1, _08062A7C @ =0xFFFFEFFF - ands r0, r1 - str r0, [r4, #8] -_08062A46: - ldrb r1, [r7] - movs r2, #1 - adds r0, r2, #0 - ands r0, r1 - cmp r0, #0 - beq _08062A62 - ldr r0, [r4, #8] - eors r0, r2 - str r0, [r4, #8] - ldrh r0, [r6] - rsbs r0, r0, #0 - strh r0, [r6] - movs r0, #8 - strh r0, [r4, #4] -_08062A62: - ldrh r1, [r4, #4] - movs r3, #4 - ldrsh r0, [r4, r3] - cmp r0, #0 - beq _08062A70 - subs r0, r1, #1 - strh r0, [r4, #4] -_08062A70: - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_08062A78: .4byte 0xFFFFFD80 -_08062A7C: .4byte 0xFFFFEFFF - - thumb_func_start sub_08062A80 -sub_08062A80: @ 0x08062A80 - push {r4, r5, lr} - adds r4, r0, #0 - ldr r0, [r4, #0x58] - movs r1, #2 - ands r0, r1 - cmp r0, #0 - beq _08062A9C - adds r0, r4, #0 - bl sub_0805BA58 - adds r0, r4, #0 - bl sub_08059810 - b _08062CC6 -_08062A9C: - ldr r2, [r4, #8] - movs r0, #4 - orrs r2, r0 - str r2, [r4, #8] - movs r1, #4 - ldrsh r0, [r4, r1] - adds r3, r4, #0 - adds r3, #0x50 - cmp r0, #0 - bne _08062B00 - movs r1, #0x8c - lsls r1, r1, #1 - adds r0, r4, r1 - ldrh r1, [r0] - movs r0, #0x20 - ands r0, r1 - cmp r0, #0 - beq _08062AD0 - movs r1, #1 - adds r0, r2, #0 - ands r0, r1 - cmp r0, #0 - bne _08062AD0 - orrs r2, r1 - str r2, [r4, #8] - b _08062AF6 -_08062AD0: - movs r2, #0x8c - lsls r2, r2, #1 - adds r0, r4, r2 - ldrh r1, [r0] - movs r0, #0x10 - ands r0, r1 - adds r3, r4, #0 - adds r3, #0x50 - cmp r0, #0 - beq _08062B00 - ldr r1, [r4, #8] - movs r0, #1 - ands r0, r1 - cmp r0, #0 - beq _08062B00 - movs r0, #2 - rsbs r0, r0, #0 - ands r1, r0 - str r1, [r4, #8] -_08062AF6: - movs r0, #8 - strh r0, [r4, #4] - ldrh r0, [r3] - rsbs r0, r0, #0 - strh r0, [r3] -_08062B00: - adds r2, r4, #0 - adds r2, #0x62 - ldrb r1, [r2] - movs r5, #1 - adds r0, r5, #0 - ands r0, r1 - cmp r0, #0 - beq _08062B20 - ldr r0, [r4, #8] - eors r0, r5 - str r0, [r4, #8] - ldrh r0, [r3] - rsbs r0, r0, #0 - strh r0, [r3] - movs r0, #8 - strh r0, [r4, #4] -_08062B20: - ldr r0, [r4, #8] - ands r0, r5 - cmp r0, #0 - beq _08062B48 - ldrh r0, [r3] - subs r0, #0x20 - strh r0, [r3] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - ldr r1, _08062B44 @ =0xFFFFFD00 - cmp r0, r1 - blt _08062B66 - movs r1, #0xc0 - lsls r1, r1, #2 - cmp r0, r1 - ble _08062B68 - b _08062B66 - .align 2, 0 -_08062B44: .4byte 0xFFFFFD00 -_08062B48: - adds r1, r3, #0 - ldrh r0, [r1] - adds r0, #0x20 - strh r0, [r1] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - movs r5, #0xc0 - lsls r5, r5, #2 - cmp r0, r5 - ble _08062B60 - strh r5, [r1] - b _08062B68 -_08062B60: - ldr r1, _08062BB4 @ =0xFFFFFD00 - cmp r0, r1 - bge _08062B68 -_08062B66: - strh r1, [r3] -_08062B68: - movs r3, #0x8d - lsls r3, r3, #1 - adds r0, r4, r3 - ldrh r1, [r0] - movs r0, #2 - ands r0, r1 - cmp r0, #0 - beq _08062B88 - adds r1, r4, #0 - adds r1, #0x52 - movs r3, #0 - ldrsh r0, [r1, r3] - cmp r0, #0 - bge _08062B88 - movs r0, #0 - strh r0, [r1] -_08062B88: - movs r1, #0x8c - lsls r1, r1, #1 - adds r0, r4, r1 - ldrh r1, [r0] - movs r3, #2 - adds r0, r3, #0 - ands r0, r1 - cmp r0, #0 - beq _08062BB8 - adds r1, r4, #0 - adds r1, #0x52 - ldrh r0, [r1] - adds r0, #0x10 - strh r0, [r1] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - movs r2, #0xc0 - lsls r2, r2, #1 - cmp r0, r2 - ble _08062C04 - strh r2, [r1] - b _08062C04 - .align 2, 0 -_08062BB4: .4byte 0xFFFFFD00 -_08062BB8: - ldrb r1, [r2] - movs r0, #4 - ands r0, r1 - cmp r0, #0 - bne _08062C04 - ldr r0, [r4, #0x58] - ands r0, r3 - adds r1, r4, #0 - adds r1, #0x52 - ldrh r0, [r1] - subs r0, #0x18 - strh r0, [r1] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - ldr r2, _08062CCC @ =0xFFFFFD80 - adds r5, r1, #0 - cmp r0, r2 - bge _08062BDE - strh r2, [r5] -_08062BDE: - ldr r0, [r4, #8] - movs r1, #0x80 - lsls r1, r1, #5 - ands r0, r1 - cmp r0, #0 - beq _08062C04 - adds r0, r4, #0 - bl sub_08003704 - cmp r0, #0 - beq _08062BFC - movs r2, #0 - ldrsh r0, [r5, r2] - cmp r0, #0 - blt _08062C04 -_08062BFC: - ldr r0, [r4, #8] - ldr r1, _08062CD0 @ =0xFFFFEFFF - ands r0, r1 - str r0, [r4, #8] -_08062C04: - ldrh r1, [r4, #4] - movs r3, #4 - ldrsh r0, [r4, r3] - cmp r0, #0 - beq _08062C12 - subs r0, r1, #1 - strh r0, [r4, #4] -_08062C12: - adds r2, r4, #0 - adds r2, #0xd6 - ldrh r0, [r2] - adds r1, r0, #1 - strh r1, [r2] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - cmp r0, #0x60 - ble _08062C46 - adds r1, r4, #0 - adds r1, #0xd4 - movs r0, #0x36 - strh r0, [r1] - ldr r0, _08062CD4 @ =sub_08062CF4 - str r0, [r4, #0x78] - ldr r0, [r4, #8] - movs r1, #3 - rsbs r1, r1, #0 - ands r0, r1 - str r0, [r4, #8] - ldr r2, _08062CD8 @ =0x000002A5 - adds r0, r4, #0 - movs r1, #0 - movs r3, #0 - bl sub_0808BA6C -_08062C46: - adds r2, r4, #0 - adds r2, #0xd8 - ldrb r1, [r2] - movs r0, #7 - ands r0, r1 - adds r5, r2, #0 - cmp r0, #0 - bne _08062CC0 - ldr r1, _08062CDC @ =gKirbys - ldr r0, _08062CE0 @ =gUnk_0203AD3C - ldrb r2, [r0] - movs r0, #0xd4 - lsls r0, r0, #1 - muls r0, r2, r0 - adds r0, r0, r1 - adds r0, #0x60 - adds r1, r4, #0 - adds r1, #0x60 - ldrh r0, [r0] - ldrh r1, [r1] - cmp r0, r1 - bne _08062CC0 - ldrb r0, [r4] - cmp r0, #0 - bne _08062C82 - adds r0, r4, #0 - adds r0, #0x56 - ldrb r0, [r0] - cmp r0, r2 - bne _08062CC0 -_08062C82: - ldr r1, _08062CE4 @ =gUnk_08D60FA4 - ldr r4, _08062CE8 @ =gSongTable - ldr r2, _08062CEC @ =0x000005B4 - adds r0, r4, r2 - ldrh r3, [r0] - lsls r0, r3, #2 - adds r0, r0, r1 - ldr r2, [r0] - ldr r0, [r2, #4] - cmp r0, #0 - blt _08062CA8 - movs r1, #0xb6 - lsls r1, r1, #3 - adds r0, r4, r1 - ldr r1, [r0] - ldrb r0, [r2, #9] - ldrb r1, [r1, #2] - cmp r0, r1 - bhi _08062CC0 -_08062CA8: - cmp r3, #0 - beq _08062CBA - ldr r0, _08062CF0 @ =gUnk_0203AD10 - ldr r0, [r0] - movs r1, #0x80 - lsls r1, r1, #1 - ands r0, r1 - cmp r0, #0 - bne _08062CC0 -_08062CBA: - movs r0, #0xb6 - bl m4aSongNumStart -_08062CC0: - ldrb r0, [r5] - adds r0, #1 - strb r0, [r5] -_08062CC6: - pop {r4, r5} - pop {r0} - bx r0 - .align 2, 0 -_08062CCC: .4byte 0xFFFFFD80 -_08062CD0: .4byte 0xFFFFEFFF -_08062CD4: .4byte sub_08062CF4 -_08062CD8: .4byte 0x000002A5 -_08062CDC: .4byte gKirbys -_08062CE0: .4byte gUnk_0203AD3C -_08062CE4: .4byte gUnk_08D60FA4 -_08062CE8: .4byte gSongTable -_08062CEC: .4byte 0x000005B4 -_08062CF0: .4byte gUnk_0203AD10 - - thumb_func_start sub_08062CF4 -sub_08062CF4: @ 0x08062CF4 - push {r4, r5, r6, r7, lr} - adds r4, r0, #0 - ldr r0, [r4, #0x58] - movs r2, #2 - ands r0, r2 - cmp r0, #0 - beq _08062D10 - adds r0, r4, #0 - bl sub_0805BA58 - adds r0, r4, #0 - bl sub_08059810 - b _08062E5C -_08062D10: - ldr r1, [r4, #8] - adds r0, r1, #0 - ands r0, r2 - adds r2, r1, #0 - cmp r0, #0 - beq _08062D34 - movs r0, #0x20 - ands r0, r2 - cmp r0, #0 - beq _08062D2C - adds r0, r4, #0 - bl sub_08044EA8 - b _08062E5C -_08062D2C: - adds r0, r4, #0 - bl sub_0803FE74 - b _08062E5C -_08062D34: - movs r1, #4 - ldrsh r0, [r4, r1] - adds r6, r4, #0 - adds r6, #0x50 - cmp r0, #0 - bne _08062D8E - movs r1, #0x8c - lsls r1, r1, #1 - adds r0, r4, r1 - ldrh r1, [r0] - movs r0, #0x20 - ands r0, r1 - cmp r0, #0 - beq _08062D60 - movs r1, #1 - adds r0, r2, #0 - ands r0, r1 - cmp r0, #0 - bne _08062D60 - orrs r2, r1 - str r2, [r4, #8] - b _08062D84 -_08062D60: - movs r1, #0x8c - lsls r1, r1, #1 - adds r0, r4, r1 - ldrh r1, [r0] - movs r0, #0x10 - ands r0, r1 - adds r6, r4, #0 - adds r6, #0x50 - cmp r0, #0 - beq _08062D8E - movs r0, #1 - ands r0, r2 - cmp r0, #0 - beq _08062D8E - movs r0, #2 - rsbs r0, r0, #0 - ands r0, r2 - str r0, [r4, #8] -_08062D84: - movs r0, #8 - strh r0, [r4, #4] - ldrh r0, [r6] - rsbs r0, r0, #0 - strh r0, [r6] -_08062D8E: - ldrh r1, [r6] - movs r2, #0 - ldrsh r0, [r6, r2] - cmp r0, #0 - bge _08062DA6 - adds r0, r1, #0 - adds r0, #0x2b - strh r0, [r6] - lsls r0, r0, #0x10 - cmp r0, #0 - ble _08062DB6 - b _08062DB2 -_08062DA6: - adds r0, r1, #0 - subs r0, #0x2b - strh r0, [r6] - lsls r0, r0, #0x10 - cmp r0, #0 - bge _08062DB6 -_08062DB2: - movs r0, #0 - strh r0, [r6] -_08062DB6: - adds r2, r4, #0 - adds r2, #0x62 - ldrb r1, [r2] - movs r0, #4 - ands r0, r1 - adds r7, r2, #0 - cmp r0, #0 - bne _08062E32 - ldr r0, [r4, #0x58] - movs r1, #2 - ands r0, r1 - cmp r0, #0 - beq _08062DF4 - adds r0, r4, #0 - adds r0, #0x52 - ldrh r1, [r0] - subs r1, #0x18 - strh r1, [r0] - lsls r1, r1, #0x10 - ldr r2, _08062DEC @ =0xFD800000 - adds r5, r0, #0 - cmp r1, r2 - bge _08062E0C - ldr r0, _08062DF0 @ =0x0000FD80 - strh r0, [r5] - b _08062E0C - .align 2, 0 -_08062DEC: .4byte 0xFD800000 -_08062DF0: .4byte 0x0000FD80 -_08062DF4: - adds r1, r4, #0 - adds r1, #0x52 - ldrh r0, [r1] - subs r0, #0x18 - strh r0, [r1] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - ldr r2, _08062E64 @ =0xFFFFFD80 - adds r5, r1, #0 - cmp r0, r2 - bge _08062E0C - strh r2, [r5] -_08062E0C: - ldr r0, [r4, #8] - movs r1, #0x80 - lsls r1, r1, #5 - ands r0, r1 - cmp r0, #0 - beq _08062E32 - adds r0, r4, #0 - bl sub_08003704 - cmp r0, #0 - beq _08062E2A - movs r1, #0 - ldrsh r0, [r5, r1] - cmp r0, #0 - blt _08062E32 -_08062E2A: - ldr r0, [r4, #8] - ldr r1, _08062E68 @ =0xFFFFEFFF - ands r0, r1 - str r0, [r4, #8] -_08062E32: - ldrb r1, [r7] - movs r2, #1 - adds r0, r2, #0 - ands r0, r1 - cmp r0, #0 - beq _08062E4E - ldr r0, [r4, #8] - eors r0, r2 - str r0, [r4, #8] - ldrh r0, [r6] - rsbs r0, r0, #0 - strh r0, [r6] - movs r0, #8 - strh r0, [r4, #4] -_08062E4E: - ldrh r1, [r4, #4] - movs r2, #4 - ldrsh r0, [r4, r2] - cmp r0, #0 - beq _08062E5C - subs r0, r1, #1 - strh r0, [r4, #4] -_08062E5C: - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_08062E64: .4byte 0xFFFFFD80 -_08062E68: .4byte 0xFFFFEFFF - - thumb_func_start sub_08062E6C -sub_08062E6C: @ 0x08062E6C - push {r4, lr} - adds r4, r0, #0 - adds r1, r4, #0 - adds r1, #0xd4 - movs r2, #0 - movs r0, #0x35 - strh r0, [r1] - strh r2, [r4, #4] - adds r0, r4, #0 - adds r0, #0xd6 - strh r2, [r0] - ldr r1, [r4, #8] - movs r0, #0x41 - rsbs r0, r0, #0 - ands r1, r0 - adds r0, #0x3e - ands r1, r0 - str r1, [r4, #8] - movs r2, #0x8c - lsls r2, r2, #1 - adds r0, r4, r2 - ldrh r2, [r0] - movs r0, #0x20 - ands r0, r2 - cmp r0, #0 - beq _08062EA6 - movs r0, #1 - orrs r1, r0 - b _08062EB4 -_08062EA6: - movs r0, #0x10 - ands r0, r2 - cmp r0, #0 - beq _08062EB6 - movs r0, #2 - rsbs r0, r0, #0 - ands r1, r0 -_08062EB4: - str r1, [r4, #8] -_08062EB6: - ldr r0, [r4, #8] - movs r1, #1 - ands r0, r1 - cmp r0, #0 - beq _08062ECA - adds r1, r4, #0 - adds r1, #0x50 - movs r0, #0x80 - lsls r0, r0, #1 - b _08062ED2 -_08062ECA: - adds r1, r4, #0 - adds r1, #0x50 - movs r0, #0xff - lsls r0, r0, #8 -_08062ED2: - strh r0, [r1] - ldr r0, [r4, #8] - movs r1, #3 - rsbs r1, r1, #0 - ands r0, r1 - str r0, [r4, #8] - adds r0, r4, #0 - bl sub_0807A3E4 - ldr r0, _08062EF0 @ =sub_08062EF4 - str r0, [r4, #0x78] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08062EF0: .4byte sub_08062EF4 - thumb_func_start sub_08062EF4 sub_08062EF4: @ 0x08062EF4 push {r4, r5, r6, r7, lr} diff --git a/include/functions.h b/include/functions.h index 6fd84d8..bd17dc7 100644 --- a/include/functions.h +++ b/include/functions.h @@ -167,6 +167,8 @@ void sub_08078EFC(struct Kirby *); void sub_0807958C(struct Kirby *); void sub_0807988C(struct Kirby *); void sub_08079C28(struct ObjectBase *); +void sub_0807A10C(struct Kirby *); +void sub_0807A3E4(struct Kirby *); struct Object3 *sub_0807A7E8(struct Object2 *); void sub_0807BCE0(struct Kirby *); void sub_0807CFE4(struct Kirby *); @@ -223,6 +225,8 @@ void sub_0808E66C(struct ObjectBase *); void sub_0808E9C8(struct ObjectBase *); void sub_0808EDB8(struct ObjectBase *); void sub_0808F0E8(struct Kirby *); +void sub_080908A4(struct Kirby *); +void sub_08090BAC(struct Kirby *); void sub_08091614(struct Kirby *); void sub_08091B5C(struct Kirby *); void sub_08091F38(struct Kirby *); @@ -234,6 +238,7 @@ void sub_08092C10(struct Kirby *); void sub_08093264(struct Kirby *); void sub_08093390(struct Kirby *, s16, s16); void sub_0809361C(struct Kirby *, u32); +void sub_08093918(struct Kirby *, u8); void sub_08093C74(struct ObjectBase *); void sub_0809513C(struct ObjectBase *, u8, u8); void sub_08098184(struct ObjectBase *); diff --git a/src/kirby.c b/src/kirby.c index 45434c9..0d767ea 100644 --- a/src/kirby.c +++ b/src/kirby.c @@ -178,8 +178,15 @@ void sub_080615E8(struct Kirby *); void sub_08061774(struct Kirby *); void sub_08061B44(struct Kirby *); void sub_08061F44(struct Kirby *); +void sub_080620B0(struct Kirby *); +void sub_080621AC(struct Kirby *); void sub_080622A0(struct Kirby *); +void sub_08062548(struct Kirby *); void sub_0806268C(struct Kirby *); +void sub_080628BC(struct Kirby *); +void sub_08062A80(struct Kirby *); +void sub_08062CF4(struct Kirby *); +void sub_08062EF4(struct Kirby *); extern const struct Unk_02021590 gUnk_0834D918[], gUnk_0834D940[], gUnk_0834EC24[]; extern const struct Unk_02021590 *const gUnk_08D60FB4[], *const gUnk_08D60FDC[]; @@ -13906,3 +13913,493 @@ void sub_08061B44(struct Kirby *kirby) if (kirby->base.base.base.unk62 & 1) kirby->base.base.base.xspeed = 0; } + +void sub_08061EA8(struct Kirby *kirby) +{ + if (kirby->unk118 & 0x30) + { + if (kirby->unk118 & 0x20) + { + kirby->base.base.base.flags |= 1; + kirby->base.base.base.xspeed -= 0x10; + if (kirby->base.base.base.xspeed < -0x1DC) + kirby->base.base.base.xspeed = -0x1DC; + } + else if (kirby->unk118 & 0x10) + { + kirby->base.base.base.flags &= ~1; + kirby->base.base.base.xspeed += 0x10; + if (kirby->base.base.base.xspeed > 0x1DC) + kirby->base.base.base.xspeed = 0x1DC; + } + } + else + { + if (kirby->base.base.base.xspeed < 0) + { + kirby->base.base.base.xspeed += 4; + if (kirby->base.base.base.xspeed > 0) + kirby->base.base.base.xspeed = 0; + } + else + { + kirby->base.base.base.xspeed -= 4; + if (kirby->base.base.base.xspeed < 0) + kirby->base.base.base.xspeed = 0; + } + } +} + +void sub_08061F44(struct Kirby *kirby) +{ + if (kirby->base.base.base.unk58 & 2) + { + sub_0805BA58(kirby); + sub_08059810(kirby); + return; + } + if (kirby->base.base.base.flags & 2) + { + kirby->base.base.base.flags &= ~2; + kirby->unkD4 = 107; + kirby->base.base.unk78 = sub_080620B0; + sub_080908A4(kirby); + sub_08090BAC(kirby); + PlaySfx(&kirby->base.base.base, 191); + } + Macro_080435F8(kirby); + sub_08061EA8(kirby); + if (kirby->base.base.base.unk62 & 1) + kirby->base.base.base.xspeed = 0; +} + +void sub_080620B0(struct Kirby *kirby) +{ + if (kirby->base.base.base.unk58 & 2) + { + sub_0805BA58(kirby); + sub_08059810(kirby); + return; + } + if (kirby->base.base.base.counter < 3) + kirby->base.base.base.flags |= 4; + if (kirby->base.base.base.flags & 2) + { + if (++kirby->base.base.base.counter > 3) + { + kirby->base.base.base.flags &= ~2; + kirby->unkD4 = 108; + kirby->base.base.unk78 = sub_080621AC; + } + } + Macro_080435F8(kirby); + sub_08061EA8(kirby); + if (kirby->base.base.base.unk62 & 1) + kirby->base.base.base.xspeed = 0; +} + +void sub_080621AC(struct Kirby *kirby) +{ + if (kirby->base.base.base.unk58 & 2) + { + sub_0805BA58(kirby); + sub_08059810(kirby); + return; + } + if (kirby->base.base.base.flags & 2) + { + Macro_0803FF64_6(kirby); + return; + } + Macro_080435F8(kirby); + sub_08061EA8(kirby); + if (kirby->base.base.base.unk62 & 1) + kirby->base.base.base.xspeed = 0; +} + +void sub_080622A0(struct Kirby *kirby) +{ + if (kirby->unkD4 == 53) + { + if (kirby->base.base.base.unk58 & 2) + { + sub_0805BA58(kirby); + sub_08059810(kirby); + return; + } + } + else + { + if (!(kirby->base.base.base.unk58 & 2)) + { + sub_0805BBB4(kirby); + if (kirby->base.base.base.yspeed < 0) + sub_08044EA8(kirby); + else + sub_08043360(kirby); + return; + } + } + if (kirby->base.base.base.unk1 == 8) + sub_08092C10(kirby); + if ((kirby->base.base.base.unk1 == 0xD && kirby->unkD4 == 53) + || (kirby->base.base.base.unk1 == 0x12 && kirby->unkD4 == 66)) + { + u32 r6 = 0; + s32 x, y; + + kirby->base.base.base.unk1 = 0; + kirby->base.base.base.unk2 = 0; + kirby->base.base.base.flags &= ~2; + if (kirby->base.base.base.flags & 1) + x = kirby->base.base.base.x - 0x1800; + else + x = kirby->base.base.base.x + 0x1800; + y = kirby->base.base.base.y + 0x800; + if (x <= gCurLevelInfo[kirby->base.base.base.unk56].unk50 + && x >= gCurLevelInfo[kirby->base.base.base.unk56].unk48 + && y <= gCurLevelInfo[kirby->base.base.base.unk56].unk54 + && y >= gCurLevelInfo[kirby->base.base.base.unk56].unk4C) + { + r6 = gUnk_082D88B8[sub_080023E4(kirby->base.base.base.unk56, x >> 12, y >> 12)]; + if (!(r6 & 1)) + { + sub_08093918(kirby, 0); + sub_08093918(kirby, 1); + sub_0806FE64(0x201, &kirby->base.base.base); + PlaySfx(&kirby->base.base.base, 187); + } + } + if (kirby->base.base.base.unk58 & 2) + { + if (r6 & 1) + kirby->unkD4 = 68; + else + kirby->unkD4 = 67; + } + else + { + if (r6 & 1) + kirby->unkD4 = 54; + else + kirby->unkD4 = 52; + } + kirby->base.base.unk78 = sub_08062548; + return; + } + Macro_080435F8(kirby); + sub_0805B1B8(kirby); + if (kirby->base.base.base.unk62 & 1) + kirby->base.base.base.xspeed = 0; +} + +void sub_08062548(struct Kirby *kirby) +{ + if (kirby->unkD4 == 54 || kirby->unkD4 == 52) + { + if (kirby->base.base.base.unk58 & 2) + { + sub_0805BA58(kirby); + sub_08059810(kirby); + return; + } + } + else + { + if (!(kirby->base.base.base.unk58 & 2)) + { + sub_0805BBB4(kirby); + if (kirby->base.base.base.yspeed < 0) + sub_08044EA8(kirby); + else + sub_08043360(kirby); + return; + } + } + if (kirby->base.base.base.flags & 2) + { + Macro_0803FF64_6(kirby); + return; + } + Macro_080435F8(kirby); + sub_0805B1B8(kirby); + if (kirby->base.base.base.unk62 & 1) + kirby->base.base.base.xspeed = 0; +} + +void sub_0806268C(struct Kirby *kirby) +{ + if (kirby->unkD4 == 104) + { + if (kirby->base.base.base.unk58 & 2) + { + sub_0805BA58(kirby); + sub_08059810(kirby); + return; + } + sub_0805BE80(kirby); + } + else + { + if (!(kirby->base.base.base.unk58 & 2)) + { + sub_0805BBB4(kirby); + if (kirby->base.base.base.yspeed < 0) + sub_08044EA8(kirby); + else + sub_08043360(kirby); + return; + } + } + if (kirby->base.base.base.flags & 2 || kirby->base.base.base.unk62 & 4) + { + Macro_0803FF64_6(kirby); + return; + } + Macro_080435F8(kirby); + sub_0805B1B8(kirby); + if (kirby->base.base.base.unk62 & 1) + kirby->base.base.base.xspeed = 0; +} + +void sub_080627D8(struct Kirby *kirby) +{ + kirby->unkD4 = 53; + kirby->base.base.base.counter = 0; + kirby->unkD6 = 0; + kirby->base.base.base.yspeed = 0; + if (kirby->unk118 & 0x20) + kirby->base.base.base.flags |= 1; + else if (kirby->unk118 & 0x10) + kirby->base.base.base.flags &= ~1; + kirby->base.base.base.flags &= ~2; + sub_0807A10C(kirby); + kirby->base.base.unk78 = sub_080628BC; + PlaySfx(&kirby->base.base.base, 183); +} + +#define Macro_080628BC(kirby) \ +({ \ + if (!(kirby)->base.base.base.counter) \ + { \ + if ((kirby)->unk118 & 0x20 && !((kirby)->base.base.base.flags & 1)) \ + { \ + (kirby)->base.base.base.flags |= 1; \ + (kirby)->base.base.base.counter = 8; \ + (kirby)->base.base.base.xspeed = -(kirby)->base.base.base.xspeed; \ + } \ + else if ((kirby)->unk118 & 0x10 && (kirby)->base.base.base.flags & 1) \ + { \ + (kirby)->base.base.base.flags &= ~1; \ + (kirby)->base.base.base.counter = 8; \ + (kirby)->base.base.base.xspeed = -(kirby)->base.base.base.xspeed; \ + } \ + } \ +}) + +void sub_080628BC(struct Kirby *kirby) +{ + if (kirby->base.base.base.unk58 & 2) + { + sub_0805BA58(kirby); + sub_08059810(kirby); + return; + } + if (kirby->base.base.base.flags & 2) + { + if (kirby->unk118 & 2 && kirby->base.base.base.yspeed < 0) + kirby->base.base.base.yspeed = 0; + kirby->unkD4 = 52; + kirby->base.base.unk78 = sub_08062A80; + sub_080908A4(kirby); + sub_08090BAC(kirby); + return; + } + Macro_080628BC(kirby); + if (kirby->base.base.base.flags & 1) + { + kirby->base.base.base.xspeed -= 24; + if (kirby->base.base.base.xspeed < -0x100) + kirby->base.base.base.xspeed = -0x100; + else if (kirby->base.base.base.xspeed > 0x100) + kirby->base.base.base.xspeed = 0x100; + } + else + { + kirby->base.base.base.xspeed += 24; + if (kirby->base.base.base.xspeed > 0x100) + kirby->base.base.base.xspeed = 0x100; + else if (kirby->base.base.base.xspeed < -0x100) + kirby->base.base.base.xspeed = -0x100; + } + if (!(kirby->base.base.base.unk62 & 4)) + { + if (kirby->base.base.base.unk58 & 2) // pointless + { + kirby->base.base.base.yspeed -= 24; + if (kirby->base.base.base.yspeed < -0x280) + kirby->base.base.base.yspeed = -0x280; + } + else + { + kirby->base.base.base.yspeed -= 24; + if (kirby->base.base.base.yspeed < -0x280) + kirby->base.base.base.yspeed = -0x280; + } + Macro_080435F8_2(kirby); + } + if (kirby->base.base.base.unk62 & 1) + { + kirby->base.base.base.flags ^= 1; + kirby->base.base.base.xspeed = -kirby->base.base.base.xspeed; + kirby->base.base.base.counter = 8; + } + if (kirby->base.base.base.counter) + --kirby->base.base.base.counter; +} + +void sub_08062A80(struct Kirby *kirby) +{ + if (kirby->base.base.base.unk58 & 2) + { + sub_0805BA58(kirby); + sub_08059810(kirby); + return; + } + kirby->base.base.base.flags |= 4; + Macro_080628BC(kirby); + if (kirby->base.base.base.unk62 & 1) + { + kirby->base.base.base.flags ^= 1; + kirby->base.base.base.xspeed = -kirby->base.base.base.xspeed; + kirby->base.base.base.counter = 8; + } + if (kirby->base.base.base.flags & 1) + { + kirby->base.base.base.xspeed -= 0x20; + if (kirby->base.base.base.xspeed < -0x300) + kirby->base.base.base.xspeed = -0x300; + else if (kirby->base.base.base.xspeed > 0x300) + kirby->base.base.base.xspeed = 0x300; + } + else + { + kirby->base.base.base.xspeed += 0x20; + if (kirby->base.base.base.xspeed > 0x300) + kirby->base.base.base.xspeed = 0x300; + else if (kirby->base.base.base.xspeed < -0x300) + kirby->base.base.base.xspeed = -0x300; + } + if (kirby->unk11A & 2 && kirby->base.base.base.yspeed < 0) + kirby->base.base.base.yspeed = 0; + if (kirby->unk118 & 2) + { + kirby->base.base.base.yspeed += 0x10; + if (kirby->base.base.base.yspeed > 0x180) + kirby->base.base.base.yspeed = 0x180; + } + else if (!(kirby->base.base.base.unk62 & 4)) + { + if (kirby->base.base.base.unk58 & 2) // pointless + { + kirby->base.base.base.yspeed -= 0x18; + if (kirby->base.base.base.yspeed < -0x280) + kirby->base.base.base.yspeed = -0x280; + } + else + { + kirby->base.base.base.yspeed -= 0x18; + if (kirby->base.base.base.yspeed < -0x280) + kirby->base.base.base.yspeed = -0x280; + } + Macro_080435F8_2(kirby); + } + if (kirby->base.base.base.counter) + --kirby->base.base.base.counter; + if (kirby->unkD6++ > 0x60) + { + kirby->unkD4 = 54; + kirby->base.base.unk78 = sub_08062CF4; + kirby->base.base.base.flags &= ~2; + kirby->base.base.base.flags &= ~2; + sub_0808BA6C(&kirby->base.base.base, 0, 0x2A5, 0); + } + if (!(kirby->unkD8 & 7)) + PlaySfx(&kirby->base.base.base, 182); + ++kirby->unkD8; +} + +void sub_08062CF4(struct Kirby *kirby) +{ + if (kirby->base.base.base.unk58 & 2) + { + sub_0805BA58(kirby); + sub_08059810(kirby); + return; + } + if (kirby->base.base.base.flags & 2) + { + if (kirby->base.base.base.flags & 0x20) + sub_08044EA8(kirby); + else + sub_0803FE74(kirby); + return; + } + Macro_080628BC(kirby); + if (kirby->base.base.base.xspeed < 0) + { + kirby->base.base.base.xspeed += 43; + if (kirby->base.base.base.xspeed > 0) + kirby->base.base.base.xspeed = 0; + } + else + { + kirby->base.base.base.xspeed -= 43; + if (kirby->base.base.base.xspeed < 0) + kirby->base.base.base.xspeed = 0; + } + if (!(kirby->base.base.base.unk62 & 4)) + { + if (kirby->base.base.base.unk58 & 2) // pointless + { + kirby->base.base.base.yspeed -= 24; + if (kirby->base.base.base.yspeed < -0x280) + kirby->base.base.base.yspeed = -0x280; + } + else + { + kirby->base.base.base.yspeed -= 24; + if (kirby->base.base.base.yspeed < -0x280) + kirby->base.base.base.yspeed = -0x280; + } + Macro_080435F8_2(kirby); + } + if (kirby->base.base.base.unk62 & 1) + { + kirby->base.base.base.flags ^= 1; + kirby->base.base.base.xspeed = -kirby->base.base.base.xspeed; + kirby->base.base.base.counter = 8; + } + if (kirby->base.base.base.counter) + --kirby->base.base.base.counter; +} + +void sub_08062E6C(struct Kirby *kirby) +{ + kirby->unkD4 = 53; + kirby->base.base.base.counter = 0; + kirby->unkD6 = 0; + kirby->base.base.base.flags &= ~0x40; + kirby->base.base.base.flags &= ~2; + if (kirby->unk118 & 0x20) + kirby->base.base.base.flags |= 1; + else if (kirby->unk118 & 0x10) + kirby->base.base.base.flags &= ~1; + if (kirby->base.base.base.flags & 1) + kirby->base.base.base.xspeed = 0x100; + else + kirby->base.base.base.xspeed = -0x100; + kirby->base.base.base.flags &= ~2; + sub_0807A3E4(kirby); + kirby->base.base.unk78 = sub_08062EF4; +}