From 22ec7cd4b54076c6481f414f1bc93d410f172903 Mon Sep 17 00:00:00 2001 From: Zhengwen Jiang Date: Sat, 22 Apr 2023 23:36:46 -0500 Subject: [PATCH] start decompiling scroll_lock --- asm/lava_wall.s | 2677 ---------------------------------------- asm/scroll_lock.s | 945 ++++++++++++++ data/data_20.s | 3 - include/functions.h | 2 +- include/lava_wall.h | 4 +- include/scroll_lock.h | 32 +- linker.ld | 4 +- src/batafire.c | 2 +- src/batty.c | 2 +- src/bombar.c | 2 +- src/bonkers.c | 2 +- src/box_boxer.c | 2 +- src/boxy.c | 2 +- src/crazy_hand.c | 2 +- src/dark_meta_knight.c | 2 +- src/dark_mind.c | 6 +- src/gobbler.c | 2 +- src/golem.c | 4 +- src/king_golem.c | 2 +- src/kracko.c | 2 +- src/lava_wall.c | 51 +- src/master_hand.c | 2 +- src/mega_titan.c | 2 +- src/moley.c | 2 +- src/mr_frosty.c | 2 +- src/phan_phan.c | 2 +- src/scroll_lock.c | 6 +- src/scroll_lock_2.c | 439 +++++++ src/shadow_kirby.c | 2 +- src/wiz.c | 2 +- 30 files changed, 1477 insertions(+), 2732 deletions(-) delete mode 100644 asm/lava_wall.s create mode 100644 asm/scroll_lock.s create mode 100644 src/scroll_lock_2.c diff --git a/asm/lava_wall.s b/asm/lava_wall.s deleted file mode 100644 index f2e9164..0000000 --- a/asm/lava_wall.s +++ /dev/null @@ -1,2677 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_0811C7D0 -sub_0811C7D0: @ 0x0811C7D0 - push {r4, r5, r6, lr} - adds r3, r0, #0 - lsls r1, r1, #0x18 - lsrs r5, r1, #0x18 - lsls r2, r2, #0x10 - lsrs r2, r2, #0x10 - ldr r0, _0811C8A8 @ =gCurLevelInfo - mov ip, r0 - movs r0, #0xcd - lsls r0, r0, #3 - adds r4, r5, #0 - muls r4, r0, r4 - mov r0, ip - adds r0, #0x7c - adds r0, r4, r0 - ldr r1, [r3, #8] - str r1, [r0] - mov r0, ip - adds r0, #0x84 - adds r0, r4, r0 - ldr r1, [r3, #0x10] - str r1, [r0] - mov r0, ip - adds r0, #0x80 - adds r0, r4, r0 - ldr r1, [r3, #0xc] - str r1, [r0] - mov r0, ip - adds r0, #0x88 - adds r0, r4, r0 - ldr r1, [r3, #0x14] - str r1, [r0] - mov r0, ip - adds r0, #0xa0 - adds r0, r4, r0 - ldr r1, [r3, #8] - str r1, [r0] - mov r0, ip - adds r0, #0xa4 - adds r0, r4, r0 - ldr r1, [r3, #0xc] - str r1, [r0] - mov r0, ip - adds r0, #0xa8 - adds r0, r4, r0 - ldr r1, [r3, #0x10] - str r1, [r0] - mov r0, ip - adds r0, #0xac - adds r0, r4, r0 - ldr r1, [r3, #0x14] - str r1, [r0] - movs r6, #0x10 - adds r0, r2, #0 - ands r0, r6 - cmp r0, #0 - beq _0811C8AC - mov r0, ip - adds r0, #0x6c - adds r0, r4, r0 - ldr r1, [r3, #8] - str r1, [r0] - mov r0, ip - adds r0, #0x74 - adds r0, r4, r0 - ldr r1, [r3, #0x10] - str r1, [r0] - mov r0, ip - adds r0, #0x70 - adds r0, r4, r0 - ldr r1, [r3, #0xc] - str r1, [r0] - mov r0, ip - adds r0, #0x78 - adds r0, r4, r0 - ldr r1, [r3, #0x14] - str r1, [r0] - adds r1, r6, #0 - lsls r1, r5 - ldr r2, [r3, #4] - adds r0, r2, #0 - ands r0, r1 - cmp r0, #0 - bne _0811C8B4 - orrs r2, r1 - str r2, [r3, #4] - mov r0, ip - adds r0, #0x90 - adds r0, r4, r0 - ldr r1, [r3, #8] - str r1, [r0] - mov r0, ip - adds r0, #0x94 - adds r0, r4, r0 - ldr r1, [r3, #0xc] - str r1, [r0] - mov r0, ip - adds r0, #0x98 - adds r0, r4, r0 - ldr r1, [r3, #0x10] - str r1, [r0] - mov r0, ip - adds r0, #0x9c - adds r0, r4, r0 - ldr r1, [r3, #0x14] - str r1, [r0] - b _0811C8B4 - .align 2, 0 -_0811C8A8: .4byte gCurLevelInfo -_0811C8AC: - adds r0, r3, #0 - adds r1, r5, #0 - bl sub_0811C8BC -_0811C8B4: - pop {r4, r5, r6} - pop {r0} - bx r0 - .align 2, 0 - - thumb_func_start sub_0811C8BC -sub_0811C8BC: @ 0x0811C8BC - push {r4, r5, r6, r7, lr} - adds r3, r0, #0 - lsls r1, r1, #0x18 - lsrs r6, r1, #0x18 - movs r2, #0x10 - lsls r2, r6 - ldr r1, [r3, #4] - adds r0, r1, #0 - ands r0, r2 - cmp r0, #0 - bne _0811C9BE - orrs r1, r2 - str r1, [r3, #4] - ldr r0, [r3, #0x10] - ldr r1, [r3, #8] - subs r0, r0, r1 - ldr r1, _0811C9C4 @ =0x0000EFFF - ldr r2, _0811C9C8 @ =gCurLevelInfo - mov ip, r2 - cmp r0, r1 - ble _0811C91C - movs r0, #0xcd - lsls r0, r0, #3 - adds r1, r6, #0 - muls r1, r0, r1 - mov r0, ip - adds r0, #0x6c - adds r4, r1, r0 - subs r0, #0x60 - adds r5, r1, r0 - ldr r0, [r5] - ldr r7, _0811C9CC @ =0xFFFFF800 - adds r2, r0, r7 - ldr r0, [r4] - cmp r0, r2 - bgt _0811C906 - str r2, [r4] -_0811C906: - mov r0, ip - adds r0, #0x74 - adds r2, r1, r0 - ldr r0, [r5] - movs r4, #0xf8 - lsls r4, r4, #8 - adds r1, r0, r4 - ldr r0, [r2] - cmp r0, r1 - blt _0811C91C - str r1, [r2] -_0811C91C: - ldr r0, [r3, #0x14] - ldr r1, [r3, #0xc] - subs r0, r0, r1 - ldr r1, _0811C9D0 @ =0x00009FFF - cmp r0, r1 - ble _0811C95E - movs r0, #0xcd - lsls r0, r0, #3 - adds r2, r6, #0 - muls r2, r0, r2 - mov r0, ip - adds r0, #0x70 - adds r3, r2, r0 - subs r0, #0x60 - adds r4, r2, r0 - ldr r0, [r4] - ldr r5, _0811C9CC @ =0xFFFFF800 - adds r1, r0, r5 - ldr r0, [r3] - cmp r0, r1 - bgt _0811C948 - str r1, [r3] -_0811C948: - mov r0, ip - adds r0, #0x78 - adds r2, r2, r0 - ldr r0, [r4] - movs r7, #0xa8 - lsls r7, r7, #8 - adds r1, r0, r7 - ldr r0, [r2] - cmp r0, r1 - blt _0811C95E - str r1, [r2] -_0811C95E: - mov r3, ip - movs r0, #0xcd - lsls r0, r0, #3 - adds r1, r6, #0 - muls r1, r0, r1 - adds r0, r3, #0 - adds r0, #0x90 - adds r4, r1, r0 - subs r0, #0x84 - adds r6, r1, r0 - ldr r0, [r6] - ldr r7, _0811C9CC @ =0xFFFFF800 - adds r2, r0, r7 - ldr r0, [r4] - cmp r0, r2 - bgt _0811C980 - str r2, [r4] -_0811C980: - adds r0, r3, #0 - adds r0, #0x94 - adds r4, r1, r0 - subs r0, #0x84 - adds r5, r1, r0 - ldr r0, [r5] - adds r2, r0, r7 - ldr r0, [r4] - cmp r0, r2 - bgt _0811C996 - str r2, [r4] -_0811C996: - adds r0, r3, #0 - adds r0, #0x98 - adds r3, r1, r0 - ldr r0, [r6] - movs r4, #0xf8 - lsls r4, r4, #8 - adds r2, r0, r4 - ldr r0, [r3] - cmp r0, r2 - blt _0811C9AC - str r2, [r3] -_0811C9AC: - mov r0, ip - adds r0, #0x9c - adds r1, r1, r0 - ldr r0, [r5] - adds r2, r0, r4 - ldr r0, [r1] - cmp r0, r2 - blt _0811C9BE - str r2, [r1] -_0811C9BE: - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_0811C9C4: .4byte 0x0000EFFF -_0811C9C8: .4byte gCurLevelInfo -_0811C9CC: .4byte 0xFFFFF800 -_0811C9D0: .4byte 0x00009FFF - - thumb_func_start sub_0811C9D4 -sub_0811C9D4: @ 0x0811C9D4 - push {r4, r5, r6, r7, lr} - mov r7, r8 - push {r7} - sub sp, #0x10 - adds r6, r0, #0 - movs r7, #0 - strh r7, [r6, #4] - adds r0, #0xb0 - ldr r0, [r0] - ldrh r0, [r0, #0x22] - movs r1, #3 - mov r8, r1 - mov r5, r8 - ands r5, r0 - cmp r5, #1 - beq _0811CA30 - cmp r5, #1 - bgt _0811C9FE - cmp r5, #0 - beq _0811CA0C - b _0811CA06 -_0811C9FE: - cmp r5, #2 - beq _0811CA54 - cmp r5, #3 - beq _0811CA78 -_0811CA06: - adds r4, r6, #0 - adds r4, #0x8c - b _0811CA96 -_0811CA0C: - movs r0, #0x44 - bl EwramMalloc - adds r1, r0, #0 - adds r4, r6, #0 - adds r4, #0x8c - str r1, [r4] - str r7, [sp] - ldr r2, _0811CA2C @ =0x05000011 - mov r0, sp - bl CpuSet - ldr r1, [r4] - movs r0, #1 - b _0811CA94 - .align 2, 0 -_0811CA2C: .4byte 0x05000011 -_0811CA30: - movs r0, #0x54 - bl EwramMalloc - adds r1, r0, #0 - adds r4, r6, #0 - adds r4, #0x8c - str r1, [r4] - str r7, [sp, #4] - add r0, sp, #4 - ldr r2, _0811CA50 @ =0x05000015 - bl CpuSet - ldr r0, [r4] - str r5, [r0] - b _0811CA96 - .align 2, 0 -_0811CA50: .4byte 0x05000015 -_0811CA54: - movs r0, #0x44 - bl EwramMalloc - adds r1, r0, #0 - adds r4, r6, #0 - adds r4, #0x8c - str r1, [r4] - str r7, [sp, #8] - add r0, sp, #8 - ldr r2, _0811CA74 @ =0x05000011 - bl CpuSet - ldr r0, [r4] - mov r1, r8 - str r1, [r0] - b _0811CA96 - .align 2, 0 -_0811CA74: .4byte 0x05000011 -_0811CA78: - movs r0, #0x54 - bl EwramMalloc - adds r1, r0, #0 - adds r4, r6, #0 - adds r4, #0x8c - str r1, [r4] - str r7, [sp, #0xc] - add r0, sp, #0xc - ldr r2, _0811CB08 @ =0x05000015 - bl CpuSet - ldr r1, [r4] - movs r0, #4 -_0811CA94: - str r0, [r1] -_0811CA96: - adds r0, r6, #0 - adds r0, #0x56 - ldrb r1, [r0] - ldr r2, [r4] - ldr r3, _0811CB0C @ =gCurLevelInfo - movs r0, #0xcd - lsls r0, r0, #3 - muls r1, r0, r1 - adds r0, r3, #0 - adds r0, #0x7c - adds r0, r1, r0 - ldr r0, [r0] - str r0, [r2, #0x18] - adds r0, r3, #0 - adds r0, #0x80 - adds r0, r1, r0 - ldr r0, [r0] - str r0, [r2, #0x1c] - adds r0, r3, #0 - adds r0, #0x84 - adds r0, r1, r0 - ldr r0, [r0] - str r0, [r2, #0x20] - adds r0, r3, #0 - adds r0, #0x88 - adds r0, r1, r0 - ldr r0, [r0] - str r0, [r2, #0x24] - adds r0, r3, #0 - adds r0, #0xa0 - adds r0, r1, r0 - ldr r0, [r0] - str r0, [r2, #0x28] - adds r0, r3, #0 - adds r0, #0xa4 - adds r0, r1, r0 - ldr r0, [r0] - str r0, [r2, #0x2c] - adds r0, r3, #0 - adds r0, #0xa8 - adds r0, r1, r0 - ldr r0, [r0] - str r0, [r2, #0x30] - adds r0, r3, #0 - adds r0, #0xac - adds r1, r1, r0 - ldr r0, [r1] - str r0, [r2, #0x34] - ldr r2, [r2] - cmp r2, #2 - beq _0811CB22 - cmp r2, #2 - bhi _0811CB10 - cmp r2, #1 - beq _0811CB1A - b _0811CB38 - .align 2, 0 -_0811CB08: .4byte 0x05000015 -_0811CB0C: .4byte gCurLevelInfo -_0811CB10: - cmp r2, #3 - beq _0811CB2A - cmp r2, #4 - beq _0811CB32 - b _0811CB38 -_0811CB1A: - adds r0, r6, #0 - bl sub_0811CB44 - b _0811CB38 -_0811CB22: - adds r0, r6, #0 - bl sub_0811CBB8 - b _0811CB38 -_0811CB2A: - adds r0, r6, #0 - bl sub_0811CD1C - b _0811CB38 -_0811CB32: - adds r0, r6, #0 - bl sub_0811CD90 -_0811CB38: - add sp, #0x10 - pop {r3} - mov r8, r3 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - - thumb_func_start sub_0811CB44 -sub_0811CB44: @ 0x0811CB44 - push {r4, r5, r6, r7, lr} - mov ip, r0 - adds r0, #0x8c - ldr r4, [r0] - mov r3, ip - adds r3, #0xb0 - ldr r0, [r3] - ldrh r2, [r0, #0x14] - movs r1, #0xff - lsls r1, r1, #8 - adds r0, r1, #0 - ands r0, r2 - lsls r5, r0, #4 - str r5, [r4, #8] - ldr r0, [r3] - ldrb r0, [r0, #0x14] - lsls r2, r0, #0xc - str r2, [r4, #0xc] - ldr r0, [r3] - ldrh r0, [r0, #0x12] - ands r1, r0 - lsls r1, r1, #4 - adds r7, r5, r1 - str r7, [r4, #0x10] - ldr r0, [r3] - ldrb r0, [r0, #0x12] - lsls r0, r0, #0xc - adds r6, r2, r0 - str r6, [r4, #0x14] - ldr r0, [r3] - ldrh r1, [r0, #0x22] - movs r0, #4 - ands r0, r1 - cmp r0, #0 - beq _0811CB9E - movs r1, #0x80 - lsls r1, r1, #4 - adds r0, r5, r1 - str r0, [r4, #8] - adds r0, r2, r1 - str r0, [r4, #0xc] - adds r0, r7, r1 - str r0, [r4, #0x10] - adds r1, r6, r1 - str r1, [r4, #0x14] -_0811CB9E: - ldr r0, _0811CBB4 @ =sub_0811CEF4 - mov r1, ip - str r0, [r1, #0x78] - ldr r0, [r4, #8] - str r0, [r4, #0x38] - ldr r0, [r4, #0xc] - str r0, [r4, #0x3c] - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_0811CBB4: .4byte sub_0811CEF4 - - thumb_func_start sub_0811CBB8 -sub_0811CBB8: @ 0x0811CBB8 - push {r4, r5, r6, r7, lr} - mov r7, r8 - push {r7} - adds r7, r0, #0 - adds r0, #0x8c - ldr r0, [r0] - mov ip, r0 - adds r5, r7, #0 - adds r5, #0xb0 - ldr r0, [r5] - ldrh r0, [r0, #0x14] - movs r4, #0xff - lsls r4, r4, #8 - adds r1, r4, #0 - ands r1, r0 - lsls r1, r1, #4 - mov r0, ip - str r1, [r0, #8] - ldr r0, [r5] - ldrb r2, [r0, #0x14] - lsls r2, r2, #0xc - mov r0, ip - str r2, [r0, #0xc] - ldr r0, [r5] - ldrh r3, [r0, #0x12] - adds r0, r4, #0 - ands r0, r3 - lsls r0, r0, #4 - adds r1, r1, r0 - mov r0, ip - str r1, [r0, #0x10] - ldr r0, [r5] - ldrb r0, [r0, #0x12] - lsls r0, r0, #0xc - adds r2, r2, r0 - mov r1, ip - str r2, [r1, #0x14] - ldr r2, _0811CC74 @ =gCurLevelInfo - movs r0, #0x56 - adds r0, r0, r7 - mov r8, r0 - ldr r0, [r5] - ldrh r1, [r0, #0x18] - adds r0, r4, #0 - ands r0, r1 - lsrs r0, r0, #4 - mov r6, ip - adds r6, #0x44 - strh r0, [r6] - ldr r0, [r5] - ldrh r0, [r0, #0x18] - mov r3, ip - adds r3, #0x46 - strb r0, [r3] - ldr r0, [r5] - ldrh r0, [r0, #0x16] - ands r4, r0 - lsrs r4, r4, #4 - mov r0, ip - adds r0, #0x48 - strh r4, [r0] - ldr r0, [r5] - ldrh r0, [r0, #0x16] - mov r1, ip - adds r1, #0x4a - strb r0, [r1] - movs r0, #0 - ldrsb r0, [r3, r0] - adds r5, r2, #0 - cmp r0, #0 - blt _0811CC7C - mov r1, ip - ldr r3, [r1, #8] - ldr r2, [r1, #0x10] - ldrh r0, [r6] - lsls r0, r0, #8 - adds r2, r2, r0 - str r2, [r1, #0x4c] - mov r0, r8 - ldrb r1, [r0] - movs r0, #0xcd - lsls r0, r0, #3 - muls r0, r1, r0 - adds r0, r0, r5 - adds r0, #0xbc - ldrh r0, [r0] - lsls r0, r0, #8 - ldr r1, _0811CC78 @ =0xFFFFF800 - adds r0, r0, r1 - adds r4, r3, #0 - cmp r2, r0 - ble _0811CC98 - b _0811CC94 - .align 2, 0 -_0811CC74: .4byte gCurLevelInfo -_0811CC78: .4byte 0xFFFFF800 -_0811CC7C: - ldrh r0, [r6] - lsls r0, r0, #8 - mov r1, ip - ldr r2, [r1, #8] - subs r0, r2, r0 - str r0, [r1, #0x4c] - ldr r1, _0811CCD8 @ =0x000007FF - adds r4, r2, #0 - cmp r0, r1 - bgt _0811CC98 - movs r0, #0x80 - lsls r0, r0, #4 -_0811CC94: - mov r1, ip - str r0, [r1, #0x4c] -_0811CC98: - mov r0, ip - adds r0, #0x4a - ldrb r0, [r0] - lsls r0, r0, #0x18 - asrs r0, r0, #0x18 - cmp r0, #0 - blt _0811CCE0 - mov r0, ip - ldr r3, [r0, #0xc] - ldr r2, [r0, #0x14] - adds r0, #0x48 - ldrh r0, [r0] - lsls r0, r0, #8 - adds r2, r2, r0 - mov r1, ip - str r2, [r1, #0x50] - adds r0, r7, #0 - adds r0, #0x56 - ldrb r1, [r0] - movs r0, #0xcd - lsls r0, r0, #3 - muls r0, r1, r0 - adds r0, r0, r5 - adds r0, #0xbe - ldrh r0, [r0] - lsls r0, r0, #8 - ldr r1, _0811CCDC @ =0xFFFFE800 - adds r0, r0, r1 - cmp r2, r0 - ble _0811CD00 - b _0811CCFC - .align 2, 0 -_0811CCD8: .4byte 0x000007FF -_0811CCDC: .4byte 0xFFFFE800 -_0811CCE0: - mov r0, ip - adds r0, #0x48 - ldrh r0, [r0] - lsls r0, r0, #8 - mov r1, ip - ldr r2, [r1, #0xc] - adds r0, r2, r0 - str r0, [r1, #0x50] - ldr r1, _0811CD14 @ =0x000007FF - adds r3, r2, #0 - cmp r0, r1 - bgt _0811CD00 - movs r0, #0x80 - lsls r0, r0, #4 -_0811CCFC: - mov r1, ip - str r0, [r1, #0x50] -_0811CD00: - ldr r0, _0811CD18 @ =sub_0811D158 - str r0, [r7, #0x78] - mov r0, ip - str r4, [r0, #0x38] - str r3, [r0, #0x3c] - pop {r3} - mov r8, r3 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_0811CD14: .4byte 0x000007FF -_0811CD18: .4byte sub_0811D158 - - thumb_func_start sub_0811CD1C -sub_0811CD1C: @ 0x0811CD1C - push {r4, r5, r6, r7, lr} - mov ip, r0 - adds r0, #0x8c - ldr r4, [r0] - mov r3, ip - adds r3, #0xb0 - ldr r0, [r3] - ldrh r2, [r0, #0x14] - movs r1, #0xff - lsls r1, r1, #8 - adds r0, r1, #0 - ands r0, r2 - lsls r5, r0, #4 - str r5, [r4, #8] - ldr r0, [r3] - ldrb r0, [r0, #0x14] - lsls r2, r0, #0xc - str r2, [r4, #0xc] - ldr r0, [r3] - ldrh r0, [r0, #0x12] - ands r1, r0 - lsls r1, r1, #4 - adds r7, r5, r1 - str r7, [r4, #0x10] - ldr r0, [r3] - ldrb r0, [r0, #0x12] - lsls r0, r0, #0xc - adds r6, r2, r0 - str r6, [r4, #0x14] - ldr r0, [r3] - ldrh r1, [r0, #0x22] - movs r0, #4 - ands r0, r1 - cmp r0, #0 - beq _0811CD76 - movs r1, #0x80 - lsls r1, r1, #4 - adds r0, r5, r1 - str r0, [r4, #8] - adds r0, r2, r1 - str r0, [r4, #0xc] - adds r0, r7, r1 - str r0, [r4, #0x10] - adds r1, r6, r1 - str r1, [r4, #0x14] -_0811CD76: - ldr r0, _0811CD8C @ =sub_0811D508 - mov r1, ip - str r0, [r1, #0x78] - ldr r0, [r4, #8] - str r0, [r4, #0x38] - ldr r0, [r4, #0xc] - str r0, [r4, #0x3c] - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_0811CD8C: .4byte sub_0811D508 - - thumb_func_start sub_0811CD90 -sub_0811CD90: @ 0x0811CD90 - push {r4, r5, r6, r7, lr} - mov r7, r8 - push {r7} - adds r7, r0, #0 - adds r0, #0x8c - ldr r0, [r0] - mov ip, r0 - adds r5, r7, #0 - adds r5, #0xb0 - ldr r0, [r5] - ldrh r0, [r0, #0x14] - movs r4, #0xff - lsls r4, r4, #8 - adds r1, r4, #0 - ands r1, r0 - lsls r1, r1, #4 - mov r0, ip - str r1, [r0, #8] - ldr r0, [r5] - ldrb r2, [r0, #0x14] - lsls r2, r2, #0xc - mov r0, ip - str r2, [r0, #0xc] - ldr r0, [r5] - ldrh r3, [r0, #0x12] - adds r0, r4, #0 - ands r0, r3 - lsls r0, r0, #4 - adds r1, r1, r0 - mov r0, ip - str r1, [r0, #0x10] - ldr r0, [r5] - ldrb r0, [r0, #0x12] - lsls r0, r0, #0xc - adds r2, r2, r0 - mov r1, ip - str r2, [r1, #0x14] - ldr r2, _0811CE4C @ =gCurLevelInfo - movs r0, #0x56 - adds r0, r0, r7 - mov r8, r0 - ldr r0, [r5] - ldrh r1, [r0, #0x18] - adds r0, r4, #0 - ands r0, r1 - lsrs r0, r0, #4 - mov r6, ip - adds r6, #0x44 - strh r0, [r6] - ldr r0, [r5] - ldrh r0, [r0, #0x18] - mov r3, ip - adds r3, #0x46 - strb r0, [r3] - ldr r0, [r5] - ldrh r0, [r0, #0x16] - ands r4, r0 - lsrs r4, r4, #4 - mov r0, ip - adds r0, #0x48 - strh r4, [r0] - ldr r0, [r5] - ldrh r0, [r0, #0x16] - mov r1, ip - adds r1, #0x4a - strb r0, [r1] - movs r0, #0 - ldrsb r0, [r3, r0] - adds r5, r2, #0 - cmp r0, #0 - blt _0811CE54 - mov r1, ip - ldr r3, [r1, #8] - ldr r2, [r1, #0x10] - ldrh r0, [r6] - lsls r0, r0, #8 - adds r2, r2, r0 - str r2, [r1, #0x4c] - mov r0, r8 - ldrb r1, [r0] - movs r0, #0xcd - lsls r0, r0, #3 - muls r0, r1, r0 - adds r0, r0, r5 - adds r0, #0xbc - ldrh r0, [r0] - lsls r0, r0, #8 - ldr r1, _0811CE50 @ =0xFFFFF800 - adds r0, r0, r1 - adds r4, r3, #0 - cmp r2, r0 - ble _0811CE70 - b _0811CE6C - .align 2, 0 -_0811CE4C: .4byte gCurLevelInfo -_0811CE50: .4byte 0xFFFFF800 -_0811CE54: - ldrh r0, [r6] - lsls r0, r0, #8 - mov r1, ip - ldr r2, [r1, #8] - subs r0, r2, r0 - str r0, [r1, #0x4c] - ldr r1, _0811CEB0 @ =0x000007FF - adds r4, r2, #0 - cmp r0, r1 - bgt _0811CE70 - movs r0, #0x80 - lsls r0, r0, #4 -_0811CE6C: - mov r1, ip - str r0, [r1, #0x4c] -_0811CE70: - mov r0, ip - adds r0, #0x4a - ldrb r0, [r0] - lsls r0, r0, #0x18 - asrs r0, r0, #0x18 - cmp r0, #0 - blt _0811CEB8 - mov r0, ip - ldr r3, [r0, #0xc] - ldr r2, [r0, #0x14] - adds r0, #0x48 - ldrh r0, [r0] - lsls r0, r0, #8 - adds r2, r2, r0 - mov r1, ip - str r2, [r1, #0x50] - adds r0, r7, #0 - adds r0, #0x56 - ldrb r1, [r0] - movs r0, #0xcd - lsls r0, r0, #3 - muls r0, r1, r0 - adds r0, r0, r5 - adds r0, #0xbe - ldrh r0, [r0] - lsls r0, r0, #8 - ldr r1, _0811CEB4 @ =0xFFFFE800 - adds r0, r0, r1 - cmp r2, r0 - ble _0811CED8 - b _0811CED4 - .align 2, 0 -_0811CEB0: .4byte 0x000007FF -_0811CEB4: .4byte 0xFFFFE800 -_0811CEB8: - mov r0, ip - adds r0, #0x48 - ldrh r0, [r0] - lsls r0, r0, #8 - mov r1, ip - ldr r2, [r1, #0xc] - adds r0, r2, r0 - str r0, [r1, #0x50] - ldr r1, _0811CEEC @ =0x000007FF - adds r3, r2, #0 - cmp r0, r1 - bgt _0811CED8 - movs r0, #0x80 - lsls r0, r0, #4 -_0811CED4: - mov r1, ip - str r0, [r1, #0x50] -_0811CED8: - ldr r0, _0811CEF0 @ =sub_0811D68C - str r0, [r7, #0x78] - mov r0, ip - str r4, [r0, #0x38] - str r3, [r0, #0x3c] - pop {r3} - mov r8, r3 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_0811CEEC: .4byte 0x000007FF -_0811CEF0: .4byte sub_0811D68C - - thumb_func_start sub_0811CEF4 -sub_0811CEF4: @ 0x0811CEF4 - push {r4, r5, r6, r7, lr} - mov r7, sl - mov r6, sb - mov r5, r8 - push {r5, r6, r7} - sub sp, #0x10 - adds r6, r0, #0 - adds r0, #0x8c - ldr r7, [r0] - adds r1, r6, #0 - adds r1, #0x60 - ldr r0, _0811D0A0 @ =gKirbys - mov r8, r0 - adds r0, #0x60 - ldrh r2, [r0] - ldrh r1, [r1] - cmp r2, r1 - beq _0811CF1A - b _0811D138 -_0811CF1A: - movs r0, #0x82 - lsls r0, r0, #2 - add r0, r8 - ldrh r1, [r0] - cmp r1, r2 - beq _0811CF28 - b _0811D138 -_0811CF28: - movs r0, #0xec - lsls r0, r0, #2 - add r0, r8 - ldrh r2, [r0] - cmp r2, r1 - beq _0811CF36 - b _0811D138 -_0811CF36: - movs r0, #0xab - lsls r0, r0, #3 - add r0, r8 - ldrh r0, [r0] - cmp r0, r2 - beq _0811CF44 - b _0811D138 -_0811CF44: - ldr r1, [r6, #0x40] - ldr r2, [r6, #0x44] - adds r5, r6, #0 - adds r5, #0xb0 - ldr r4, [r5] - movs r0, #0x1a - ldrsh r3, [r4, r0] - mov sb, r3 - movs r3, #0x1c - ldrsh r0, [r4, r3] - str r0, [sp] - ldrh r0, [r4, #0x1e] - str r0, [sp, #4] - ldrh r0, [r4, #0x20] - str r0, [sp, #8] - mov r0, r8 - mov r3, sb - bl sub_08039430 - lsls r0, r0, #0x18 - mov sb, r5 - cmp r0, #0 - bne _0811CF74 - b _0811D0B8 -_0811CF74: - movs r0, #0xd4 - lsls r0, r0, #1 - add r0, r8 - ldr r1, [r6, #0x40] - ldr r2, [r6, #0x44] - ldr r5, [r5] - movs r3, #0x1a - ldrsh r4, [r5, r3] - str r4, [sp, #0xc] - movs r3, #0x1c - ldrsh r4, [r5, r3] - str r4, [sp] - ldrh r4, [r5, #0x1e] - str r4, [sp, #4] - ldrh r4, [r5, #0x20] - str r4, [sp, #8] - ldr r3, [sp, #0xc] - bl sub_08039430 - lsls r0, r0, #0x18 - cmp r0, #0 - bne _0811CFA2 - b _0811D0B8 -_0811CFA2: - movs r0, #0xd4 - lsls r0, r0, #2 - add r0, r8 - ldr r1, [r6, #0x40] - ldr r2, [r6, #0x44] - mov r4, sb - ldr r5, [r4] - movs r4, #0x1a - ldrsh r3, [r5, r4] - str r3, [sp, #0xc] - movs r4, #0x1c - ldrsh r3, [r5, r4] - str r3, [sp] - ldrh r4, [r5, #0x1e] - str r4, [sp, #4] - ldrh r4, [r5, #0x20] - str r4, [sp, #8] - ldr r3, [sp, #0xc] - bl sub_08039430 - lsls r0, r0, #0x18 - cmp r0, #0 - beq _0811D0B8 - movs r0, #0x9f - lsls r0, r0, #3 - add r0, r8 - ldr r1, [r6, #0x40] - ldr r2, [r6, #0x44] - mov r3, sb - ldr r5, [r3] - movs r3, #0x1a - ldrsh r4, [r5, r3] - str r4, [sp, #0xc] - movs r3, #0x1c - ldrsh r4, [r5, r3] - str r4, [sp] - ldrh r4, [r5, #0x1e] - str r4, [sp, #4] - ldrh r4, [r5, #0x20] - str r4, [sp, #8] - ldr r3, [sp, #0xc] - bl sub_08039430 - lsls r0, r0, #0x18 - cmp r0, #0 - beq _0811D0B8 - ldr r0, [r7, #4] - movs r2, #1 - adds r1, r0, #0 - ands r1, r2 - cmp r1, #0 - bne _0811D018 - orrs r0, r2 - str r0, [r7, #4] - ldr r0, _0811D0A4 @ =gCurLevelInfo - movs r4, #0xf6 - lsls r4, r4, #1 - adds r0, r0, r4 - str r1, [r0] -_0811D018: - ldr r0, [r7, #4] - movs r2, #2 - adds r1, r0, #0 - ands r1, r2 - cmp r1, #0 - bne _0811D030 - orrs r0, r2 - str r0, [r7, #4] - ldr r0, _0811D0A4 @ =gCurLevelInfo - ldr r2, _0811D0A8 @ =0x00000854 - adds r0, r0, r2 - str r1, [r0] -_0811D030: - ldr r0, [r7, #4] - movs r2, #4 - adds r1, r0, #0 - ands r1, r2 - cmp r1, #0 - bne _0811D048 - orrs r0, r2 - str r0, [r7, #4] - ldr r0, _0811D0A4 @ =gCurLevelInfo - ldr r3, _0811D0AC @ =0x00000EBC - adds r0, r0, r3 - str r1, [r0] -_0811D048: - ldr r0, [r7, #4] - movs r2, #8 - adds r1, r0, #0 - ands r1, r2 - cmp r1, #0 - bne _0811D060 - orrs r0, r2 - str r0, [r7, #4] - ldr r0, _0811D0A4 @ =gCurLevelInfo - ldr r4, _0811D0B0 @ =0x00001524 - adds r0, r0, r4 - str r1, [r0] -_0811D060: - movs r0, #0 - mov sl, r0 - ldr r0, _0811D0B4 @ =gUnk_0203AD44 - ldrb r0, [r0] - cmp sl, r0 - bge _0811D0C2 - mov r5, r8 -_0811D06E: - mov r1, sl - lsls r4, r1, #0x18 - asrs r4, r4, #0x18 - movs r0, #0xd4 - lsls r0, r0, #1 - muls r0, r4, r0 - adds r0, r0, r5 - adds r0, #0x56 - ldrb r1, [r0] - mov r2, sb - ldr r0, [r2] - ldrh r2, [r0, #0x22] - adds r0, r7, #0 - bl sub_0811C7D0 - adds r4, #1 - lsls r4, r4, #0x18 - lsrs r3, r4, #0x18 - mov sl, r3 - asrs r4, r4, #0x18 - ldr r0, _0811D0B4 @ =gUnk_0203AD44 - ldrb r0, [r0] - cmp r4, r0 - blt _0811D06E - b _0811D0C2 - .align 2, 0 -_0811D0A0: .4byte gKirbys -_0811D0A4: .4byte gCurLevelInfo -_0811D0A8: .4byte 0x00000854 -_0811D0AC: .4byte 0x00000EBC -_0811D0B0: .4byte 0x00001524 -_0811D0B4: .4byte gUnk_0203AD44 -_0811D0B8: - ldr r0, [r7, #4] - movs r1, #0x10 - rsbs r1, r1, #0 - ands r0, r1 - str r0, [r7, #4] -_0811D0C2: - ldr r1, _0811D12C @ =gKirbys - mov r4, sl - lsls r0, r4, #0x18 - asrs r4, r0, #0x18 - movs r0, #0xd4 - lsls r0, r0, #1 - muls r0, r4, r0 - adds r0, r0, r1 - movs r1, #0x80 - lsls r1, r1, #1 - adds r0, r0, r1 - ldrb r0, [r0] - lsls r0, r0, #0x18 - asrs r0, r0, #0x18 - cmp r0, #0 - bgt _0811D0EA - adds r0, r6, #0 - adds r1, r4, #0 - bl sub_0811DB48 -_0811D0EA: - mov r2, sb - ldr r5, [r2] - ldrb r0, [r5, #4] - cmp r0, #0 - beq _0811D142 - adds r1, r0, #0 - ldr r3, _0811D130 @ =gCurLevelInfo - adds r0, r6, #0 - adds r0, #0x56 - ldrb r2, [r0] - movs r0, #0xcd - lsls r0, r0, #3 - muls r0, r2, r0 - adds r0, r0, r3 - ldr r3, _0811D134 @ =0x0000065E - adds r0, r0, r3 - ldrb r2, [r0] - movs r0, #0 - bl sub_08002888 - adds r1, r0, #0 - ldr r0, [r1] - cmp r0, #0 - beq _0811D142 - subs r0, #1 - str r0, [r1] - ldr r0, [r6, #8] - movs r1, #0x80 - lsls r1, r1, #5 - orrs r0, r1 - str r0, [r6, #8] - b _0811D142 - .align 2, 0 -_0811D12C: .4byte gKirbys -_0811D130: .4byte gCurLevelInfo -_0811D134: .4byte 0x0000065E -_0811D138: - ldr r0, [r7, #4] - movs r1, #0x10 - rsbs r1, r1, #0 - ands r0, r1 - str r0, [r7, #4] -_0811D142: - ldrh r0, [r6, #4] - adds r0, #1 - strh r0, [r6, #4] - add sp, #0x10 - pop {r3, r4, r5} - mov r8, r3 - mov sb, r4 - mov sl, r5 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - - thumb_func_start sub_0811D158 -sub_0811D158: @ 0x0811D158 - push {r4, r5, r6, r7, lr} - mov r7, sl - mov r6, sb - mov r5, r8 - push {r5, r6, r7} - sub sp, #0x10 - mov sb, r0 - adds r0, #0x8c - ldr r7, [r0] - subs r0, #0x2c - ldrh r2, [r0] - subs r0, #0xa - ldrb r0, [r0] - mov sl, r0 - ldr r0, [r7, #4] - movs r1, #0x80 - lsls r1, r1, #0x15 - ands r0, r1 - cmp r0, #0 - beq _0811D182 - b _0811D378 -_0811D182: - ldr r0, _0811D31C @ =gKirbys - mov r8, r0 - adds r0, #0x60 - ldrh r1, [r0] - cmp r1, r2 - beq _0811D190 - b _0811D36C -_0811D190: - movs r0, #0x82 - lsls r0, r0, #2 - add r0, r8 - ldrh r2, [r0] - cmp r2, r1 - beq _0811D19E - b _0811D36C -_0811D19E: - movs r0, #0xec - lsls r0, r0, #2 - add r0, r8 - ldrh r1, [r0] - cmp r1, r2 - beq _0811D1AC - b _0811D36C -_0811D1AC: - movs r0, #0xab - lsls r0, r0, #3 - add r0, r8 - ldrh r0, [r0] - cmp r0, r1 - beq _0811D1BA - b _0811D36C -_0811D1BA: - mov r2, sb - ldr r1, [r2, #0x40] - ldr r2, [r2, #0x44] - mov r5, sb - adds r5, #0xb0 - ldr r4, [r5] - movs r0, #0x1a - ldrsh r3, [r4, r0] - mov sl, r3 - movs r3, #0x1c - ldrsh r0, [r4, r3] - str r0, [sp] - ldrh r0, [r4, #0x1e] - str r0, [sp, #4] - ldrh r0, [r4, #0x20] - str r0, [sp, #8] - mov r0, r8 - mov r3, sl - bl sub_08039430 - lsls r0, r0, #0x18 - mov sl, r5 - cmp r0, #0 - bne _0811D1EC - b _0811D334 -_0811D1EC: - movs r0, #0xd4 - lsls r0, r0, #1 - add r0, r8 - mov r4, sb - ldr r1, [r4, #0x40] - ldr r2, [r4, #0x44] - ldr r5, [r5] - movs r4, #0x1a - ldrsh r3, [r5, r4] - str r3, [sp, #0xc] - movs r4, #0x1c - ldrsh r3, [r5, r4] - str r3, [sp] - ldrh r4, [r5, #0x1e] - str r4, [sp, #4] - ldrh r4, [r5, #0x20] - str r4, [sp, #8] - ldr r3, [sp, #0xc] - bl sub_08039430 - lsls r0, r0, #0x18 - cmp r0, #0 - bne _0811D21C - b _0811D334 -_0811D21C: - movs r0, #0xd4 - lsls r0, r0, #2 - add r0, r8 - mov r2, sb - ldr r1, [r2, #0x40] - ldr r2, [r2, #0x44] - mov r3, sl - ldr r5, [r3] - movs r3, #0x1a - ldrsh r4, [r5, r3] - str r4, [sp, #0xc] - movs r3, #0x1c - ldrsh r4, [r5, r3] - str r4, [sp] - ldrh r4, [r5, #0x1e] - str r4, [sp, #4] - ldrh r4, [r5, #0x20] - str r4, [sp, #8] - ldr r3, [sp, #0xc] - bl sub_08039430 - lsls r0, r0, #0x18 - cmp r0, #0 - beq _0811D334 - movs r0, #0x9f - lsls r0, r0, #3 - add r0, r8 - mov r4, sb - ldr r1, [r4, #0x40] - ldr r2, [r4, #0x44] - mov r3, sl - ldr r5, [r3] - movs r3, #0x1a - ldrsh r4, [r5, r3] - str r4, [sp, #0xc] - movs r3, #0x1c - ldrsh r4, [r5, r3] - str r4, [sp] - ldrh r4, [r5, #0x1e] - str r4, [sp, #4] - ldrh r4, [r5, #0x20] - str r4, [sp, #8] - ldr r3, [sp, #0xc] - bl sub_08039430 - lsls r0, r0, #0x18 - cmp r0, #0 - beq _0811D334 - ldr r0, [r7, #4] - movs r2, #1 - adds r1, r0, #0 - ands r1, r2 - cmp r1, #0 - bne _0811D296 - orrs r0, r2 - str r0, [r7, #4] - ldr r0, _0811D320 @ =gCurLevelInfo - movs r4, #0xf6 - lsls r4, r4, #1 - adds r0, r0, r4 - str r1, [r0] -_0811D296: - ldr r0, [r7, #4] - movs r2, #2 - adds r1, r0, #0 - ands r1, r2 - cmp r1, #0 - bne _0811D2AE - orrs r0, r2 - str r0, [r7, #4] - ldr r0, _0811D320 @ =gCurLevelInfo - ldr r2, _0811D324 @ =0x00000854 - adds r0, r0, r2 - str r1, [r0] -_0811D2AE: - ldr r0, [r7, #4] - movs r2, #4 - adds r1, r0, #0 - ands r1, r2 - cmp r1, #0 - bne _0811D2C6 - orrs r0, r2 - str r0, [r7, #4] - ldr r0, _0811D320 @ =gCurLevelInfo - ldr r3, _0811D328 @ =0x00000EBC - adds r0, r0, r3 - str r1, [r0] -_0811D2C6: - ldr r0, [r7, #4] - movs r2, #8 - adds r1, r0, #0 - ands r1, r2 - cmp r1, #0 - bne _0811D2DE - orrs r0, r2 - str r0, [r7, #4] - ldr r0, _0811D320 @ =gCurLevelInfo - ldr r4, _0811D32C @ =0x00001524 - adds r0, r0, r4 - str r1, [r0] -_0811D2DE: - movs r6, #0 - ldr r0, _0811D330 @ =gUnk_0203AD44 - ldrb r0, [r0] - cmp r6, r0 - bhs _0811D310 - mov r4, r8 -_0811D2EA: - movs r0, #0xd4 - lsls r0, r0, #1 - muls r0, r6, r0 - adds r0, r0, r4 - adds r0, #0x56 - ldrb r1, [r0] - mov r2, sl - ldr r0, [r2] - ldrh r2, [r0, #0x22] - adds r0, r7, #0 - bl sub_0811C7D0 - adds r0, r6, #1 - lsls r0, r0, #0x18 - lsrs r6, r0, #0x18 - ldr r0, _0811D330 @ =gUnk_0203AD44 - ldrb r0, [r0] - cmp r6, r0 - blo _0811D2EA -_0811D310: - ldr r0, [r7, #4] - movs r1, #0x80 - lsls r1, r1, #0x15 - orrs r0, r1 - b _0811D33C - .align 2, 0 -_0811D31C: .4byte gKirbys -_0811D320: .4byte gCurLevelInfo -_0811D324: .4byte 0x00000854 -_0811D328: .4byte 0x00000EBC -_0811D32C: .4byte 0x00001524 -_0811D330: .4byte gUnk_0203AD44 -_0811D334: - ldr r0, [r7, #4] - movs r1, #0x10 - rsbs r1, r1, #0 - ands r0, r1 -_0811D33C: - str r0, [r7, #4] - ldr r1, _0811D368 @ =gKirbys - movs r0, #0xd4 - lsls r0, r0, #1 - muls r0, r6, r0 - adds r0, r0, r1 - movs r3, #0x80 - lsls r3, r3, #1 - adds r0, r0, r3 - ldrb r0, [r0] - lsls r0, r0, #0x18 - asrs r0, r0, #0x18 - cmp r0, #0 - bgt _0811D360 - mov r0, sb - adds r1, r6, #0 - bl sub_0811DB48 -_0811D360: - mov r4, sl - ldr r5, [r4] - ldrb r0, [r5, #4] - b _0811D4A8 - .align 2, 0 -_0811D368: .4byte gKirbys -_0811D36C: - ldr r0, [r7, #4] - movs r1, #0x10 - rsbs r1, r1, #0 - ands r0, r1 - str r0, [r7, #4] - b _0811D4E2 -_0811D378: - adds r0, r7, #0 - adds r0, #0x46 - movs r1, #0 - ldrsb r1, [r0, r1] - mov r8, r0 - cmp r1, #0 - beq _0811D406 - ldr r4, _0811D3F4 @ =gCurLevelInfo - movs r0, #0xcd - lsls r0, r0, #3 - mov r2, sl - muls r2, r0, r2 - adds r0, r4, #0 - adds r0, #0x7c - adds r6, r2, r0 - mov r0, r8 - movs r1, #0 - ldrsb r1, [r0, r1] - ldr r0, [r6] - adds r0, r0, r1 - str r0, [r6] - adds r0, r4, #0 - adds r0, #0x84 - adds r5, r2, r0 - mov r3, r8 - movs r1, #0 - ldrsb r1, [r3, r1] - ldr r0, [r5] - adds r0, r0, r1 - str r0, [r5] - adds r1, r4, #0 - adds r1, #0xa0 - adds r1, r2, r1 - ldrb r3, [r3] - lsls r3, r3, #0x18 - asrs r3, r3, #0x18 - ldr r0, [r1] - adds r0, r0, r3 - str r0, [r1] - adds r0, r4, #0 - adds r0, #0xa8 - adds r2, r2, r0 - mov r4, r8 - movs r1, #0 - ldrsb r1, [r4, r1] - ldr r0, [r2] - adds r0, r0, r1 - str r0, [r2] - movs r0, #0 - ldrsb r0, [r4, r0] - cmp r0, #0 - beq _0811D406 - cmp r0, #0 - ble _0811D3F8 - ldr r1, [r5] - ldr r0, [r7, #0x4c] - cmp r1, r0 - ble _0811D406 - movs r0, #0 - strb r0, [r4] - b _0811D406 - .align 2, 0 -_0811D3F4: .4byte gCurLevelInfo -_0811D3F8: - ldr r1, [r6] - ldr r0, _0811D478 @ =0x000007FF - cmp r1, r0 - bgt _0811D406 - movs r0, #0 - mov r1, r8 - strb r0, [r1] -_0811D406: - adds r0, r7, #0 - adds r0, #0x4a - movs r1, #0 - ldrsb r1, [r0, r1] - adds r4, r0, #0 - cmp r1, #0 - beq _0811D48E - ldr r5, _0811D47C @ =gCurLevelInfo - movs r0, #0xcd - lsls r0, r0, #3 - mov r2, sl - muls r2, r0, r2 - adds r0, r5, #0 - adds r0, #0x80 - adds r0, r0, r2 - mov ip, r0 - movs r1, #0 - ldrsb r1, [r4, r1] - ldr r0, [r0] - adds r0, r0, r1 - mov r3, ip - str r0, [r3] - adds r0, r5, #0 - adds r0, #0x88 - adds r6, r2, r0 - movs r1, #0 - ldrsb r1, [r4, r1] - ldr r0, [r6] - adds r0, r0, r1 - str r0, [r6] - adds r1, r5, #0 - adds r1, #0xa4 - adds r1, r2, r1 - movs r3, #0 - ldrsb r3, [r4, r3] - ldr r0, [r1] - adds r0, r0, r3 - str r0, [r1] - adds r0, r5, #0 - adds r0, #0xac - adds r2, r2, r0 - movs r1, #0 - ldrsb r1, [r4, r1] - ldr r0, [r2] - adds r0, r0, r1 - str r0, [r2] - movs r0, #0 - ldrsb r0, [r4, r0] - cmp r0, #0 - beq _0811D48E - cmp r0, #0 - ble _0811D480 - ldr r1, [r6] - ldr r0, [r7, #0x50] - cmp r1, r0 - ble _0811D48E - b _0811D48A - .align 2, 0 -_0811D478: .4byte 0x000007FF -_0811D47C: .4byte gCurLevelInfo -_0811D480: - mov r0, ip - ldr r1, [r0] - ldr r0, _0811D4FC @ =0x000007FF - cmp r1, r0 - bgt _0811D48E -_0811D48A: - movs r0, #0 - strb r0, [r4] -_0811D48E: - mov r1, r8 - movs r0, #0 - ldrsb r0, [r1, r0] - cmp r0, #0 - bne _0811D4E2 - movs r0, #0 - ldrsb r0, [r4, r0] - cmp r0, #0 - bne _0811D4E2 - mov r0, sb - adds r0, #0xb0 - ldr r1, [r0] - ldrb r0, [r1, #4] -_0811D4A8: - cmp r0, #0 - beq _0811D4E2 - adds r1, r0, #0 - ldr r3, _0811D500 @ =gCurLevelInfo - mov r0, sb - adds r0, #0x56 - ldrb r2, [r0] - movs r0, #0xcd - lsls r0, r0, #3 - muls r0, r2, r0 - adds r0, r0, r3 - ldr r2, _0811D504 @ =0x0000065E - adds r0, r0, r2 - ldrb r2, [r0] - movs r0, #0 - bl sub_08002888 - adds r1, r0, #0 - ldr r0, [r1] - cmp r0, #0 - beq _0811D4E2 - subs r0, #1 - str r0, [r1] - mov r3, sb - ldr r0, [r3, #8] - movs r1, #0x80 - lsls r1, r1, #5 - orrs r0, r1 - str r0, [r3, #8] -_0811D4E2: - mov r4, sb - ldrh r0, [r4, #4] - adds r0, #1 - strh r0, [r4, #4] - add sp, #0x10 - pop {r3, r4, r5} - mov r8, r3 - mov sb, r4 - mov sl, r5 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_0811D4FC: .4byte 0x000007FF -_0811D500: .4byte gCurLevelInfo -_0811D504: .4byte 0x0000065E - - thumb_func_start sub_0811D508 -sub_0811D508: @ 0x0811D508 - push {r4, r5, r6, r7, lr} - mov r7, sl - mov r6, sb - mov r5, r8 - push {r5, r6, r7} - sub sp, #0x10 - adds r7, r0, #0 - adds r0, #0x8c - ldr r6, [r0] - subs r0, #0x2c - ldrh r0, [r0] - str r0, [sp, #0xc] - movs r0, #0 - b _0811D664 -_0811D524: - movs r0, #0xd4 - lsls r0, r0, #1 - mov r1, sl - muls r1, r0, r1 - mov sb, r1 - ldr r2, _0811D5B4 @ =gKirbys - add r2, sb - mov r8, r2 - mov r0, r8 - adds r0, #0x60 - ldrh r0, [r0] - ldr r3, [sp, #0xc] - cmp r0, r3 - beq _0811D542 - b _0811D648 -_0811D542: - ldr r1, [r7, #0x40] - ldr r2, [r7, #0x44] - adds r5, r7, #0 - adds r5, #0xb0 - ldr r4, [r5] - movs r3, #0x1a - ldrsh r0, [r4, r3] - mov ip, r0 - movs r3, #0x1c - ldrsh r0, [r4, r3] - str r0, [sp] - ldrh r0, [r4, #0x1e] - str r0, [sp, #4] - ldrh r0, [r4, #0x20] - str r0, [sp, #8] - mov r0, r8 - mov r3, ip - bl sub_08039430 - lsls r0, r0, #0x18 - cmp r0, #0 - beq _0811D5C0 - ldr r0, _0811D5B8 @ =gKirbys+0xC - add r0, sb - ldr r0, [r0] - movs r1, #0x80 - lsls r1, r1, #8 - ands r0, r1 - cmp r0, #0 - bne _0811D5CC - movs r2, #1 - mov r0, sl - lsls r2, r0 - ldr r0, [r6, #4] - adds r1, r0, #0 - ands r1, r2 - cmp r1, #0 - bne _0811D5A2 - orrs r0, r2 - str r0, [r6, #4] - movs r0, #0xcd - lsls r0, r0, #3 - mov r2, sl - muls r2, r0, r2 - adds r0, r2, #0 - ldr r3, _0811D5BC @ =gCurLevelInfo+0x1EC - adds r0, r0, r3 - str r1, [r0] -_0811D5A2: - mov r0, r8 - adds r0, #0x56 - ldrb r1, [r0] - ldr r0, [r5] - ldrh r2, [r0, #0x22] - adds r0, r6, #0 - bl sub_0811C7D0 - b _0811D5CC - .align 2, 0 -_0811D5B4: .4byte gKirbys -_0811D5B8: .4byte gKirbys+0xC -_0811D5BC: .4byte gCurLevelInfo+0x1EC -_0811D5C0: - movs r1, #1 - mov r0, sl - lsls r1, r0 - ldr r0, [r6, #4] - bics r0, r1 - str r0, [r6, #4] -_0811D5CC: - movs r0, #0xd4 - lsls r0, r0, #1 - mov r1, sl - muls r1, r0, r1 - adds r0, r1, #0 - ldr r2, _0811D63C @ =gKirbys - adds r0, r0, r2 - movs r3, #0x80 - lsls r3, r3, #1 - adds r0, r0, r3 - ldrb r0, [r0] - lsls r0, r0, #0x18 - asrs r0, r0, #0x18 - cmp r0, #0 - bgt _0811D5FE - adds r0, r7, #0 - mov r1, sl - bl sub_0811DB48 - movs r1, #0x10 - mov r0, sl - lsls r1, r0 - ldr r0, [r6, #4] - bics r0, r1 - str r0, [r6, #4] -_0811D5FE: - ldr r5, [r5] - ldrb r0, [r5, #4] - cmp r0, #0 - beq _0811D65C - adds r1, r0, #0 - adds r0, r7, #0 - adds r0, #0x56 - ldrb r2, [r0] - movs r0, #0xcd - lsls r0, r0, #3 - muls r0, r2, r0 - ldr r2, _0811D640 @ =gCurLevelInfo - adds r0, r0, r2 - ldr r3, _0811D644 @ =0x0000065E - adds r0, r0, r3 - ldrb r2, [r0] - movs r0, #0 - bl sub_08002888 - adds r1, r0, #0 - ldr r0, [r1] - cmp r0, #0 - beq _0811D65C - subs r0, #1 - str r0, [r1] - ldr r0, [r7, #8] - movs r1, #0x80 - lsls r1, r1, #5 - orrs r0, r1 - str r0, [r7, #8] - b _0811D65C - .align 2, 0 -_0811D63C: .4byte gKirbys -_0811D640: .4byte gCurLevelInfo -_0811D644: .4byte 0x0000065E -_0811D648: - movs r0, #0x10 - mov r1, sl - lsls r0, r1 - ldr r1, [r6, #4] - bics r1, r0 - movs r0, #1 - mov r2, sl - lsls r0, r2 - bics r1, r0 - str r1, [r6, #4] -_0811D65C: - mov r0, sl - adds r0, #1 - lsls r0, r0, #0x18 - lsrs r0, r0, #0x18 -_0811D664: - mov sl, r0 - ldr r0, _0811D688 @ =gUnk_0203AD44 - ldrb r0, [r0] - cmp sl, r0 - bhs _0811D670 - b _0811D524 -_0811D670: - ldrh r0, [r7, #4] - adds r0, #1 - strh r0, [r7, #4] - add sp, #0x10 - pop {r3, r4, r5} - mov r8, r3 - mov sb, r4 - mov sl, r5 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_0811D688: .4byte gUnk_0203AD44 - - thumb_func_start sub_0811D68C -sub_0811D68C: @ 0x0811D68C - push {r4, r5, r6, r7, lr} - mov r7, sl - mov r6, sb - mov r5, r8 - push {r5, r6, r7} - sub sp, #0x10 - mov sl, r0 - adds r0, #0x8c - ldr r7, [r0] - subs r0, #0x2c - ldrh r0, [r0] - str r0, [sp, #0xc] - mov r0, sl - adds r0, #0x56 - ldrb r0, [r0] - mov r8, r0 - ldr r0, [r7, #4] - movs r1, #0x80 - lsls r1, r1, #0x15 - ands r0, r1 - cmp r0, #0 - beq _0811D6BA - b _0811D818 -_0811D6BA: - movs r0, #0 - mov sb, r0 - ldr r0, _0811D760 @ =gUnk_0203AD44 - ldrb r0, [r0] - cmp sb, r0 - blo _0811D6C8 - b _0811D986 -_0811D6C8: - movs r0, #0xd4 - lsls r0, r0, #1 - mov r1, sb - muls r1, r0, r1 - mov r8, r1 - ldr r6, _0811D764 @ =gKirbys - add r6, r8 - adds r0, r6, #0 - adds r0, #0x60 - ldrh r0, [r0] - ldr r2, [sp, #0xc] - cmp r0, r2 - beq _0811D6E4 - b _0811D7F0 -_0811D6E4: - mov r3, sl - ldr r1, [r3, #0x40] - ldr r2, [r3, #0x44] - mov r5, sl - adds r5, #0xb0 - ldr r4, [r5] - movs r3, #0x1a - ldrsh r0, [r4, r3] - mov ip, r0 - movs r3, #0x1c - ldrsh r0, [r4, r3] - str r0, [sp] - ldrh r0, [r4, #0x1e] - str r0, [sp, #4] - ldrh r0, [r4, #0x20] - str r0, [sp, #8] - adds r0, r6, #0 - mov r3, ip - bl sub_08039430 - lsls r0, r0, #0x18 - cmp r0, #0 - beq _0811D770 - ldr r0, _0811D768 @ =gKirbys+0xC - add r0, r8 - ldr r0, [r0] - movs r1, #0x80 - lsls r1, r1, #8 - ands r0, r1 - cmp r0, #0 - bne _0811D77C - movs r2, #1 - mov r0, sb - lsls r2, r0 - ldr r0, [r7, #4] - adds r1, r0, #0 - ands r1, r2 - cmp r1, #0 - bne _0811D746 - orrs r0, r2 - str r0, [r7, #4] - movs r0, #0xcd - lsls r0, r0, #3 - mov r2, sb - muls r2, r0, r2 - adds r0, r2, #0 - ldr r3, _0811D76C @ =gCurLevelInfo+0x1EC - adds r0, r0, r3 - str r1, [r0] -_0811D746: - adds r0, r6, #0 - adds r0, #0x56 - ldrb r1, [r0] - ldr r0, [r5] - ldrh r2, [r0, #0x22] - adds r0, r7, #0 - bl sub_0811C7D0 - ldr r0, [r7, #4] - movs r1, #0x80 - lsls r1, r1, #0x15 - orrs r0, r1 - b _0811D77A - .align 2, 0 -_0811D760: .4byte gUnk_0203AD44 -_0811D764: .4byte gKirbys -_0811D768: .4byte gKirbys+0xC -_0811D76C: .4byte gCurLevelInfo+0x1EC -_0811D770: - movs r1, #1 - mov r0, sb - lsls r1, r0 - ldr r0, [r7, #4] - bics r0, r1 -_0811D77A: - str r0, [r7, #4] -_0811D77C: - movs r0, #0xd4 - lsls r0, r0, #1 - mov r1, sb - muls r1, r0, r1 - adds r0, r1, #0 - ldr r2, _0811D7E4 @ =gKirbys - adds r0, r0, r2 - movs r3, #0x80 - lsls r3, r3, #1 - adds r0, r0, r3 - ldrb r0, [r0] - lsls r0, r0, #0x18 - asrs r0, r0, #0x18 - cmp r0, #0 - bgt _0811D7A2 - mov r0, sl - mov r1, sb - bl sub_0811DB48 -_0811D7A2: - ldr r5, [r5] - ldrb r0, [r5, #4] - cmp r0, #0 - beq _0811D7FC - adds r1, r0, #0 - mov r0, sl - adds r0, #0x56 - ldrb r2, [r0] - movs r0, #0xcd - lsls r0, r0, #3 - muls r0, r2, r0 - ldr r2, _0811D7E8 @ =gCurLevelInfo - adds r0, r0, r2 - ldr r3, _0811D7EC @ =0x0000065E - adds r0, r0, r3 - ldrb r2, [r0] - movs r0, #0 - bl sub_08002888 - adds r1, r0, #0 - ldr r0, [r1] - cmp r0, #0 - beq _0811D7FC - subs r0, #1 - str r0, [r1] - mov r1, sl - ldr r0, [r1, #8] - movs r1, #0x80 - lsls r1, r1, #5 - orrs r0, r1 - mov r2, sl - str r0, [r2, #8] - b _0811D7FC - .align 2, 0 -_0811D7E4: .4byte gKirbys -_0811D7E8: .4byte gCurLevelInfo -_0811D7EC: .4byte 0x0000065E -_0811D7F0: - movs r1, #1 - mov r3, sb - lsls r1, r3 - ldr r0, [r7, #4] - bics r0, r1 - str r0, [r7, #4] -_0811D7FC: - mov r0, sb - adds r0, #1 - lsls r0, r0, #0x18 - lsrs r0, r0, #0x18 - mov sb, r0 - ldr r0, _0811D814 @ =gUnk_0203AD44 - ldrb r0, [r0] - cmp sb, r0 - bhs _0811D810 - b _0811D6C8 -_0811D810: - b _0811D986 - .align 2, 0 -_0811D814: .4byte gUnk_0203AD44 -_0811D818: - adds r0, r7, #0 - adds r0, #0x46 - movs r1, #0 - ldrsb r1, [r0, r1] - mov sb, r0 - cmp r1, #0 - beq _0811D8AA - ldr r4, _0811D898 @ =gCurLevelInfo - movs r0, #0xcd - lsls r0, r0, #3 - mov r2, r8 - muls r2, r0, r2 - adds r0, r4, #0 - adds r0, #0x7c - adds r6, r2, r0 - mov r0, sb - movs r1, #0 - ldrsb r1, [r0, r1] - ldr r0, [r6] - adds r0, r0, r1 - str r0, [r6] - adds r0, r4, #0 - adds r0, #0x84 - adds r5, r2, r0 - mov r3, sb - movs r1, #0 - ldrsb r1, [r3, r1] - ldr r0, [r5] - adds r0, r0, r1 - str r0, [r5] - adds r1, r4, #0 - adds r1, #0xa0 - adds r1, r2, r1 - ldrb r3, [r3] - lsls r3, r3, #0x18 - asrs r3, r3, #0x18 - ldr r0, [r1] - adds r0, r0, r3 - str r0, [r1] - adds r0, r4, #0 - adds r0, #0xa8 - adds r2, r2, r0 - mov r0, sb - movs r1, #0 - ldrsb r1, [r0, r1] - ldr r0, [r2] - adds r0, r0, r1 - str r0, [r2] - mov r1, sb - movs r0, #0 - ldrsb r0, [r1, r0] - cmp r0, #0 - beq _0811D8AA - cmp r0, #0 - ble _0811D89C - ldr r1, [r5] - ldr r0, [r7, #0x4c] - cmp r1, r0 - ble _0811D8AA - movs r0, #0 - mov r2, sb - strb r0, [r2] - b _0811D8AA - .align 2, 0 -_0811D898: .4byte gCurLevelInfo -_0811D89C: - ldr r1, [r6] - ldr r0, _0811D91C @ =0x000007FF - cmp r1, r0 - bgt _0811D8AA - movs r0, #0 - mov r3, sb - strb r0, [r3] -_0811D8AA: - adds r0, r7, #0 - adds r0, #0x4a - movs r1, #0 - ldrsb r1, [r0, r1] - adds r4, r0, #0 - cmp r1, #0 - beq _0811D932 - ldr r5, _0811D920 @ =gCurLevelInfo - movs r0, #0xcd - lsls r0, r0, #3 - mov r2, r8 - muls r2, r0, r2 - adds r0, r5, #0 - adds r0, #0x80 - adds r0, r0, r2 - mov r8, r0 - movs r1, #0 - ldrsb r1, [r4, r1] - ldr r0, [r0] - adds r0, r0, r1 - mov r1, r8 - str r0, [r1] - adds r0, r5, #0 - adds r0, #0x88 - adds r6, r2, r0 - movs r1, #0 - ldrsb r1, [r4, r1] - ldr r0, [r6] - adds r0, r0, r1 - str r0, [r6] - adds r1, r5, #0 - adds r1, #0xa4 - adds r1, r2, r1 - movs r3, #0 - ldrsb r3, [r4, r3] - ldr r0, [r1] - adds r0, r0, r3 - str r0, [r1] - adds r0, r5, #0 - adds r0, #0xac - adds r2, r2, r0 - movs r1, #0 - ldrsb r1, [r4, r1] - ldr r0, [r2] - adds r0, r0, r1 - str r0, [r2] - movs r0, #0 - ldrsb r0, [r4, r0] - cmp r0, #0 - beq _0811D932 - cmp r0, #0 - ble _0811D924 - ldr r1, [r6] - ldr r0, [r7, #0x50] - cmp r1, r0 - ble _0811D932 - b _0811D92E - .align 2, 0 -_0811D91C: .4byte 0x000007FF -_0811D920: .4byte gCurLevelInfo -_0811D924: - mov r2, r8 - ldr r1, [r2] - ldr r0, _0811D9A0 @ =0x000007FF - cmp r1, r0 - bgt _0811D932 -_0811D92E: - movs r0, #0 - strb r0, [r4] -_0811D932: - mov r3, sb - movs r0, #0 - ldrsb r0, [r3, r0] - cmp r0, #0 - bne _0811D986 - movs r0, #0 - ldrsb r0, [r4, r0] - cmp r0, #0 - bne _0811D986 - mov r0, sl - adds r0, #0xb0 - ldr r1, [r0] - ldrb r0, [r1, #4] - cmp r0, #0 - beq _0811D986 - adds r1, r0, #0 - ldr r3, _0811D9A4 @ =gCurLevelInfo - mov r0, sl - adds r0, #0x56 - ldrb r2, [r0] - movs r0, #0xcd - lsls r0, r0, #3 - muls r0, r2, r0 - adds r0, r0, r3 - ldr r2, _0811D9A8 @ =0x0000065E - adds r0, r0, r2 - ldrb r2, [r0] - movs r0, #0 - bl sub_08002888 - adds r1, r0, #0 - ldr r0, [r1] - cmp r0, #0 - beq _0811D986 - subs r0, #1 - str r0, [r1] - mov r3, sl - ldr r0, [r3, #8] - movs r1, #0x80 - lsls r1, r1, #5 - orrs r0, r1 - str r0, [r3, #8] -_0811D986: - mov r1, sl - ldrh r0, [r1, #4] - adds r0, #1 - strh r0, [r1, #4] - add sp, #0x10 - pop {r3, r4, r5} - mov r8, r3 - mov sb, r4 - mov sl, r5 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_0811D9A0: .4byte 0x000007FF -_0811D9A4: .4byte gCurLevelInfo -_0811D9A8: .4byte 0x0000065E - - thumb_func_start sub_0811D9AC -sub_0811D9AC: @ 0x0811D9AC - push {r4, r5, r6, r7, lr} - mov r7, sl - mov r6, sb - mov r5, r8 - push {r5, r6, r7} - sub sp, #0xc - adds r7, r0, #0 - ldrh r1, [r7, #0x12] - movs r0, #0x10 - ands r0, r1 - cmp r0, #0 - beq _0811D9D0 - ldrh r0, [r7, #6] - lsls r0, r0, #2 - movs r1, #0x80 - lsls r1, r1, #0x12 - adds r1, r0, r1 - b _0811D9D8 -_0811D9D0: - ldrh r1, [r7, #6] - movs r0, #0xc0 - lsls r0, r0, #0x12 - adds r1, r1, r0 -_0811D9D8: - adds r0, r1, #0 - adds r0, #0x8c - ldr r3, [r0] - subs r0, #0x2c - ldrh r0, [r0] - mov sb, r0 - adds r0, r1, #0 - adds r0, #0x56 - ldrb r0, [r0] - str r0, [sp, #8] - adds r0, r1, #0 - adds r0, #0xb0 - ldr r1, [r0] - ldrb r0, [r1, #2] - mov sl, r0 - ldrb r4, [r1, #3] - str r4, [sp] - ldr r2, _0811DA24 @ =gCurLevelInfo - movs r0, #0xcd - lsls r0, r0, #3 - ldr r4, [sp, #8] - muls r0, r4, r0 - adds r0, r0, r2 - ldr r4, _0811DA28 @ =0x0000065E - adds r0, r0, r4 - ldrb r0, [r0] - str r0, [sp, #4] - ldrh r1, [r1, #0x22] - movs r0, #8 - ands r0, r1 - mov ip, r2 - cmp r0, #0 - bne _0811DB10 - movs r6, #0 - ldr r0, _0811DA2C @ =gUnk_0203AD44 - mov r8, r0 - b _0811DB0A - .align 2, 0 -_0811DA24: .4byte gCurLevelInfo -_0811DA28: .4byte 0x0000065E -_0811DA2C: .4byte gUnk_0203AD44 -_0811DA30: - movs r0, #0xd4 - lsls r0, r0, #1 - muls r0, r6, r0 - ldr r1, _0811DB40 @ =gKirbys - adds r0, r0, r1 - adds r0, #0x60 - ldrh r0, [r0] - cmp r0, sb - bne _0811DB02 - movs r0, #0xcd - lsls r0, r0, #3 - adds r2, r6, #0 - muls r2, r0, r2 - mov r0, ip - adds r0, #0x7c - adds r5, r2, r0 - ldr r1, [r3, #0x38] - ldr r0, [r5] - cmp r1, r0 - bne _0811DB02 - mov r0, ip - adds r0, #0x80 - adds r4, r2, r0 - ldr r1, [r3, #0x3c] - ldr r0, [r4] - cmp r1, r0 - bne _0811DB02 - ldr r0, [r3, #0x18] - str r0, [r5] - ldr r0, [r3, #0x1c] - str r0, [r4] - mov r0, ip - adds r0, #0x84 - adds r0, r2, r0 - ldr r1, [r3, #0x20] - str r1, [r0] - mov r0, ip - adds r0, #0x88 - adds r0, r2, r0 - ldr r1, [r3, #0x24] - str r1, [r0] - mov r0, ip - adds r0, #0xa0 - adds r0, r2, r0 - ldr r1, [r3, #0x28] - str r1, [r0] - mov r0, ip - adds r0, #0xa4 - adds r0, r2, r0 - ldr r1, [r3, #0x2c] - str r1, [r0] - mov r0, ip - adds r0, #0xa8 - adds r0, r2, r0 - ldr r1, [r3, #0x30] - str r1, [r0] - mov r0, ip - adds r0, #0xac - adds r0, r2, r0 - ldr r1, [r3, #0x34] - str r1, [r0] - mov r0, ip - adds r0, #0x6c - adds r0, r2, r0 - ldr r1, [r3, #0x18] - str r1, [r0] - mov r0, ip - adds r0, #0x70 - adds r0, r2, r0 - ldr r1, [r3, #0x1c] - str r1, [r0] - mov r0, ip - adds r0, #0x74 - adds r0, r2, r0 - ldr r1, [r3, #0x20] - str r1, [r0] - mov r0, ip - adds r0, #0x78 - adds r0, r2, r0 - ldr r1, [r3, #0x24] - str r1, [r0] - mov r0, ip - adds r0, #0x90 - adds r0, r2, r0 - ldr r1, [r3, #0x28] - str r1, [r0] - mov r0, ip - adds r0, #0x94 - adds r0, r2, r0 - ldr r1, [r3, #0x2c] - str r1, [r0] - mov r0, ip - adds r0, #0x98 - adds r0, r2, r0 - ldr r1, [r3, #0x30] - str r1, [r0] - mov r0, ip - adds r0, #0x9c - adds r0, r2, r0 - ldr r1, [r3, #0x34] - str r1, [r0] - ldr r4, _0811DB44 @ =gCurLevelInfo+0x1EC - adds r1, r2, r4 - movs r0, #0 - str r0, [r1] -_0811DB02: - adds r0, r6, #1 - lsls r0, r0, #0x18 - lsrs r6, r0, #0x18 - mov r0, r8 -_0811DB0A: - ldrb r0, [r0] - cmp r6, r0 - blo _0811DA30 -_0811DB10: - adds r0, r7, #0 - bl ObjectDestroy - mov r1, sl - cmp r1, #0 - bne _0811DB22 - ldr r4, [sp, #8] - cmp r4, #0xff - beq _0811DB2E -_0811DB22: - mov r0, sl - ldr r1, [sp] - ldr r2, [sp, #4] - movs r3, #1 - bl sub_08001678 -_0811DB2E: - add sp, #0xc - pop {r3, r4, r5} - mov r8, r3 - mov sb, r4 - mov sl, r5 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_0811DB40: .4byte gKirbys -_0811DB44: .4byte gCurLevelInfo+0x1EC - - thumb_func_start sub_0811DB48 -sub_0811DB48: @ 0x0811DB48 - push {r4, r5, r6, lr} - lsls r1, r1, #0x18 - lsrs r5, r1, #0x18 - adds r1, r0, #0 - adds r1, #0x8c - ldr r4, [r1] - adds r0, #0x60 - ldr r2, _0811DC38 @ =gKirbys - movs r1, #0xd4 - lsls r1, r1, #1 - muls r1, r5, r1 - adds r1, r1, r2 - adds r1, #0x60 - ldrh r1, [r1] - ldrh r0, [r0] - cmp r1, r0 - bne _0811DC30 - ldr r3, _0811DC3C @ =gCurLevelInfo - movs r0, #0xcd - lsls r0, r0, #3 - adds r2, r5, #0 - muls r2, r0, r2 - adds r0, r3, #0 - adds r0, #0x7c - adds r6, r2, r0 - ldr r1, [r4, #0x38] - ldr r0, [r6] - cmp r1, r0 - bne _0811DC30 - adds r0, r3, #0 - adds r0, #0x80 - adds r5, r2, r0 - ldr r1, [r4, #0x3c] - ldr r0, [r5] - cmp r1, r0 - bne _0811DC30 - ldr r0, [r4, #0x18] - str r0, [r6] - ldr r0, [r4, #0x1c] - str r0, [r5] - adds r0, r3, #0 - adds r0, #0x84 - adds r0, r2, r0 - ldr r1, [r4, #0x20] - str r1, [r0] - adds r0, r3, #0 - adds r0, #0x88 - adds r0, r2, r0 - ldr r1, [r4, #0x24] - str r1, [r0] - adds r0, r3, #0 - adds r0, #0xa0 - adds r0, r2, r0 - ldr r1, [r4, #0x28] - str r1, [r0] - adds r0, r3, #0 - adds r0, #0xa4 - adds r0, r2, r0 - ldr r1, [r4, #0x2c] - str r1, [r0] - adds r0, r3, #0 - adds r0, #0xa8 - adds r0, r2, r0 - ldr r1, [r4, #0x30] - str r1, [r0] - adds r0, r3, #0 - adds r0, #0xac - adds r0, r2, r0 - ldr r1, [r4, #0x34] - str r1, [r0] - adds r0, r3, #0 - adds r0, #0x6c - adds r0, r2, r0 - ldr r1, [r4, #0x18] - str r1, [r0] - adds r0, r3, #0 - adds r0, #0x70 - adds r0, r2, r0 - ldr r1, [r4, #0x1c] - str r1, [r0] - adds r0, r3, #0 - adds r0, #0x74 - adds r0, r2, r0 - ldr r1, [r4, #0x20] - str r1, [r0] - adds r0, r3, #0 - adds r0, #0x78 - adds r0, r2, r0 - ldr r1, [r4, #0x24] - str r1, [r0] - adds r0, r3, #0 - adds r0, #0x90 - adds r0, r2, r0 - ldr r1, [r4, #0x28] - str r1, [r0] - adds r0, r3, #0 - adds r0, #0x94 - adds r0, r2, r0 - ldr r1, [r4, #0x2c] - str r1, [r0] - adds r0, r3, #0 - adds r0, #0x98 - adds r0, r2, r0 - ldr r1, [r4, #0x30] - str r1, [r0] - adds r0, r3, #0 - adds r0, #0x9c - adds r0, r2, r0 - ldr r1, [r4, #0x34] - str r1, [r0] - movs r1, #0xf6 - lsls r1, r1, #1 - adds r0, r3, r1 - adds r0, r2, r0 - movs r1, #0 - str r1, [r0] -_0811DC30: - pop {r4, r5, r6} - pop {r0} - bx r0 - .align 2, 0 -_0811DC38: .4byte gKirbys -_0811DC3C: .4byte gCurLevelInfo diff --git a/asm/scroll_lock.s b/asm/scroll_lock.s new file mode 100644 index 0000000..dcc80e5 --- /dev/null +++ b/asm/scroll_lock.s @@ -0,0 +1,945 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_0811D508 +sub_0811D508: @ 0x0811D508 + push {r4, r5, r6, r7, lr} + mov r7, sl + mov r6, sb + mov r5, r8 + push {r5, r6, r7} + sub sp, #0x10 + adds r7, r0, #0 + adds r0, #0x8c + ldr r6, [r0] + subs r0, #0x2c + ldrh r0, [r0] + str r0, [sp, #0xc] + movs r0, #0 + b _0811D664 +_0811D524: + movs r0, #0xd4 + lsls r0, r0, #1 + mov r1, sl + muls r1, r0, r1 + mov sb, r1 + ldr r2, _0811D5B4 @ =gKirbys + add r2, sb + mov r8, r2 + mov r0, r8 + adds r0, #0x60 + ldrh r0, [r0] + ldr r3, [sp, #0xc] + cmp r0, r3 + beq _0811D542 + b _0811D648 +_0811D542: + ldr r1, [r7, #0x40] + ldr r2, [r7, #0x44] + adds r5, r7, #0 + adds r5, #0xb0 + ldr r4, [r5] + movs r3, #0x1a + ldrsh r0, [r4, r3] + mov ip, r0 + movs r3, #0x1c + ldrsh r0, [r4, r3] + str r0, [sp] + ldrh r0, [r4, #0x1e] + str r0, [sp, #4] + ldrh r0, [r4, #0x20] + str r0, [sp, #8] + mov r0, r8 + mov r3, ip + bl sub_08039430 + lsls r0, r0, #0x18 + cmp r0, #0 + beq _0811D5C0 + ldr r0, _0811D5B8 @ =gKirbys+0xC + add r0, sb + ldr r0, [r0] + movs r1, #0x80 + lsls r1, r1, #8 + ands r0, r1 + cmp r0, #0 + bne _0811D5CC + movs r2, #1 + mov r0, sl + lsls r2, r0 + ldr r0, [r6, #4] + adds r1, r0, #0 + ands r1, r2 + cmp r1, #0 + bne _0811D5A2 + orrs r0, r2 + str r0, [r6, #4] + movs r0, #0xcd + lsls r0, r0, #3 + mov r2, sl + muls r2, r0, r2 + adds r0, r2, #0 + ldr r3, _0811D5BC @ =gCurLevelInfo+0x1EC + adds r0, r0, r3 + str r1, [r0] +_0811D5A2: + mov r0, r8 + adds r0, #0x56 + ldrb r1, [r0] + ldr r0, [r5] + ldrh r2, [r0, #0x22] + adds r0, r6, #0 + bl sub_0811C7D0 + b _0811D5CC + .align 2, 0 +_0811D5B4: .4byte gKirbys +_0811D5B8: .4byte gKirbys+0xC +_0811D5BC: .4byte gCurLevelInfo+0x1EC +_0811D5C0: + movs r1, #1 + mov r0, sl + lsls r1, r0 + ldr r0, [r6, #4] + bics r0, r1 + str r0, [r6, #4] +_0811D5CC: + movs r0, #0xd4 + lsls r0, r0, #1 + mov r1, sl + muls r1, r0, r1 + adds r0, r1, #0 + ldr r2, _0811D63C @ =gKirbys + adds r0, r0, r2 + movs r3, #0x80 + lsls r3, r3, #1 + adds r0, r0, r3 + ldrb r0, [r0] + lsls r0, r0, #0x18 + asrs r0, r0, #0x18 + cmp r0, #0 + bgt _0811D5FE + adds r0, r7, #0 + mov r1, sl + bl sub_0811DB48 + movs r1, #0x10 + mov r0, sl + lsls r1, r0 + ldr r0, [r6, #4] + bics r0, r1 + str r0, [r6, #4] +_0811D5FE: + ldr r5, [r5] + ldrb r0, [r5, #4] + cmp r0, #0 + beq _0811D65C + adds r1, r0, #0 + adds r0, r7, #0 + adds r0, #0x56 + ldrb r2, [r0] + movs r0, #0xcd + lsls r0, r0, #3 + muls r0, r2, r0 + ldr r2, _0811D640 @ =gCurLevelInfo + adds r0, r0, r2 + ldr r3, _0811D644 @ =0x0000065E + adds r0, r0, r3 + ldrb r2, [r0] + movs r0, #0 + bl sub_08002888 + adds r1, r0, #0 + ldr r0, [r1] + cmp r0, #0 + beq _0811D65C + subs r0, #1 + str r0, [r1] + ldr r0, [r7, #8] + movs r1, #0x80 + lsls r1, r1, #5 + orrs r0, r1 + str r0, [r7, #8] + b _0811D65C + .align 2, 0 +_0811D63C: .4byte gKirbys +_0811D640: .4byte gCurLevelInfo +_0811D644: .4byte 0x0000065E +_0811D648: + movs r0, #0x10 + mov r1, sl + lsls r0, r1 + ldr r1, [r6, #4] + bics r1, r0 + movs r0, #1 + mov r2, sl + lsls r0, r2 + bics r1, r0 + str r1, [r6, #4] +_0811D65C: + mov r0, sl + adds r0, #1 + lsls r0, r0, #0x18 + lsrs r0, r0, #0x18 +_0811D664: + mov sl, r0 + ldr r0, _0811D688 @ =gUnk_0203AD44 + ldrb r0, [r0] + cmp sl, r0 + bhs _0811D670 + b _0811D524 +_0811D670: + ldrh r0, [r7, #4] + adds r0, #1 + strh r0, [r7, #4] + add sp, #0x10 + pop {r3, r4, r5} + mov r8, r3 + mov sb, r4 + mov sl, r5 + pop {r4, r5, r6, r7} + pop {r0} + bx r0 + .align 2, 0 +_0811D688: .4byte gUnk_0203AD44 + + thumb_func_start sub_0811D68C +sub_0811D68C: @ 0x0811D68C + push {r4, r5, r6, r7, lr} + mov r7, sl + mov r6, sb + mov r5, r8 + push {r5, r6, r7} + sub sp, #0x10 + mov sl, r0 + adds r0, #0x8c + ldr r7, [r0] + subs r0, #0x2c + ldrh r0, [r0] + str r0, [sp, #0xc] + mov r0, sl + adds r0, #0x56 + ldrb r0, [r0] + mov r8, r0 + ldr r0, [r7, #4] + movs r1, #0x80 + lsls r1, r1, #0x15 + ands r0, r1 + cmp r0, #0 + beq _0811D6BA + b _0811D818 +_0811D6BA: + movs r0, #0 + mov sb, r0 + ldr r0, _0811D760 @ =gUnk_0203AD44 + ldrb r0, [r0] + cmp sb, r0 + blo _0811D6C8 + b _0811D986 +_0811D6C8: + movs r0, #0xd4 + lsls r0, r0, #1 + mov r1, sb + muls r1, r0, r1 + mov r8, r1 + ldr r6, _0811D764 @ =gKirbys + add r6, r8 + adds r0, r6, #0 + adds r0, #0x60 + ldrh r0, [r0] + ldr r2, [sp, #0xc] + cmp r0, r2 + beq _0811D6E4 + b _0811D7F0 +_0811D6E4: + mov r3, sl + ldr r1, [r3, #0x40] + ldr r2, [r3, #0x44] + mov r5, sl + adds r5, #0xb0 + ldr r4, [r5] + movs r3, #0x1a + ldrsh r0, [r4, r3] + mov ip, r0 + movs r3, #0x1c + ldrsh r0, [r4, r3] + str r0, [sp] + ldrh r0, [r4, #0x1e] + str r0, [sp, #4] + ldrh r0, [r4, #0x20] + str r0, [sp, #8] + adds r0, r6, #0 + mov r3, ip + bl sub_08039430 + lsls r0, r0, #0x18 + cmp r0, #0 + beq _0811D770 + ldr r0, _0811D768 @ =gKirbys+0xC + add r0, r8 + ldr r0, [r0] + movs r1, #0x80 + lsls r1, r1, #8 + ands r0, r1 + cmp r0, #0 + bne _0811D77C + movs r2, #1 + mov r0, sb + lsls r2, r0 + ldr r0, [r7, #4] + adds r1, r0, #0 + ands r1, r2 + cmp r1, #0 + bne _0811D746 + orrs r0, r2 + str r0, [r7, #4] + movs r0, #0xcd + lsls r0, r0, #3 + mov r2, sb + muls r2, r0, r2 + adds r0, r2, #0 + ldr r3, _0811D76C @ =gCurLevelInfo+0x1EC + adds r0, r0, r3 + str r1, [r0] +_0811D746: + adds r0, r6, #0 + adds r0, #0x56 + ldrb r1, [r0] + ldr r0, [r5] + ldrh r2, [r0, #0x22] + adds r0, r7, #0 + bl sub_0811C7D0 + ldr r0, [r7, #4] + movs r1, #0x80 + lsls r1, r1, #0x15 + orrs r0, r1 + b _0811D77A + .align 2, 0 +_0811D760: .4byte gUnk_0203AD44 +_0811D764: .4byte gKirbys +_0811D768: .4byte gKirbys+0xC +_0811D76C: .4byte gCurLevelInfo+0x1EC +_0811D770: + movs r1, #1 + mov r0, sb + lsls r1, r0 + ldr r0, [r7, #4] + bics r0, r1 +_0811D77A: + str r0, [r7, #4] +_0811D77C: + movs r0, #0xd4 + lsls r0, r0, #1 + mov r1, sb + muls r1, r0, r1 + adds r0, r1, #0 + ldr r2, _0811D7E4 @ =gKirbys + adds r0, r0, r2 + movs r3, #0x80 + lsls r3, r3, #1 + adds r0, r0, r3 + ldrb r0, [r0] + lsls r0, r0, #0x18 + asrs r0, r0, #0x18 + cmp r0, #0 + bgt _0811D7A2 + mov r0, sl + mov r1, sb + bl sub_0811DB48 +_0811D7A2: + ldr r5, [r5] + ldrb r0, [r5, #4] + cmp r0, #0 + beq _0811D7FC + adds r1, r0, #0 + mov r0, sl + adds r0, #0x56 + ldrb r2, [r0] + movs r0, #0xcd + lsls r0, r0, #3 + muls r0, r2, r0 + ldr r2, _0811D7E8 @ =gCurLevelInfo + adds r0, r0, r2 + ldr r3, _0811D7EC @ =0x0000065E + adds r0, r0, r3 + ldrb r2, [r0] + movs r0, #0 + bl sub_08002888 + adds r1, r0, #0 + ldr r0, [r1] + cmp r0, #0 + beq _0811D7FC + subs r0, #1 + str r0, [r1] + mov r1, sl + ldr r0, [r1, #8] + movs r1, #0x80 + lsls r1, r1, #5 + orrs r0, r1 + mov r2, sl + str r0, [r2, #8] + b _0811D7FC + .align 2, 0 +_0811D7E4: .4byte gKirbys +_0811D7E8: .4byte gCurLevelInfo +_0811D7EC: .4byte 0x0000065E +_0811D7F0: + movs r1, #1 + mov r3, sb + lsls r1, r3 + ldr r0, [r7, #4] + bics r0, r1 + str r0, [r7, #4] +_0811D7FC: + mov r0, sb + adds r0, #1 + lsls r0, r0, #0x18 + lsrs r0, r0, #0x18 + mov sb, r0 + ldr r0, _0811D814 @ =gUnk_0203AD44 + ldrb r0, [r0] + cmp sb, r0 + bhs _0811D810 + b _0811D6C8 +_0811D810: + b _0811D986 + .align 2, 0 +_0811D814: .4byte gUnk_0203AD44 +_0811D818: + adds r0, r7, #0 + adds r0, #0x46 + movs r1, #0 + ldrsb r1, [r0, r1] + mov sb, r0 + cmp r1, #0 + beq _0811D8AA + ldr r4, _0811D898 @ =gCurLevelInfo + movs r0, #0xcd + lsls r0, r0, #3 + mov r2, r8 + muls r2, r0, r2 + adds r0, r4, #0 + adds r0, #0x7c + adds r6, r2, r0 + mov r0, sb + movs r1, #0 + ldrsb r1, [r0, r1] + ldr r0, [r6] + adds r0, r0, r1 + str r0, [r6] + adds r0, r4, #0 + adds r0, #0x84 + adds r5, r2, r0 + mov r3, sb + movs r1, #0 + ldrsb r1, [r3, r1] + ldr r0, [r5] + adds r0, r0, r1 + str r0, [r5] + adds r1, r4, #0 + adds r1, #0xa0 + adds r1, r2, r1 + ldrb r3, [r3] + lsls r3, r3, #0x18 + asrs r3, r3, #0x18 + ldr r0, [r1] + adds r0, r0, r3 + str r0, [r1] + adds r0, r4, #0 + adds r0, #0xa8 + adds r2, r2, r0 + mov r0, sb + movs r1, #0 + ldrsb r1, [r0, r1] + ldr r0, [r2] + adds r0, r0, r1 + str r0, [r2] + mov r1, sb + movs r0, #0 + ldrsb r0, [r1, r0] + cmp r0, #0 + beq _0811D8AA + cmp r0, #0 + ble _0811D89C + ldr r1, [r5] + ldr r0, [r7, #0x4c] + cmp r1, r0 + ble _0811D8AA + movs r0, #0 + mov r2, sb + strb r0, [r2] + b _0811D8AA + .align 2, 0 +_0811D898: .4byte gCurLevelInfo +_0811D89C: + ldr r1, [r6] + ldr r0, _0811D91C @ =0x000007FF + cmp r1, r0 + bgt _0811D8AA + movs r0, #0 + mov r3, sb + strb r0, [r3] +_0811D8AA: + adds r0, r7, #0 + adds r0, #0x4a + movs r1, #0 + ldrsb r1, [r0, r1] + adds r4, r0, #0 + cmp r1, #0 + beq _0811D932 + ldr r5, _0811D920 @ =gCurLevelInfo + movs r0, #0xcd + lsls r0, r0, #3 + mov r2, r8 + muls r2, r0, r2 + adds r0, r5, #0 + adds r0, #0x80 + adds r0, r0, r2 + mov r8, r0 + movs r1, #0 + ldrsb r1, [r4, r1] + ldr r0, [r0] + adds r0, r0, r1 + mov r1, r8 + str r0, [r1] + adds r0, r5, #0 + adds r0, #0x88 + adds r6, r2, r0 + movs r1, #0 + ldrsb r1, [r4, r1] + ldr r0, [r6] + adds r0, r0, r1 + str r0, [r6] + adds r1, r5, #0 + adds r1, #0xa4 + adds r1, r2, r1 + movs r3, #0 + ldrsb r3, [r4, r3] + ldr r0, [r1] + adds r0, r0, r3 + str r0, [r1] + adds r0, r5, #0 + adds r0, #0xac + adds r2, r2, r0 + movs r1, #0 + ldrsb r1, [r4, r1] + ldr r0, [r2] + adds r0, r0, r1 + str r0, [r2] + movs r0, #0 + ldrsb r0, [r4, r0] + cmp r0, #0 + beq _0811D932 + cmp r0, #0 + ble _0811D924 + ldr r1, [r6] + ldr r0, [r7, #0x50] + cmp r1, r0 + ble _0811D932 + b _0811D92E + .align 2, 0 +_0811D91C: .4byte 0x000007FF +_0811D920: .4byte gCurLevelInfo +_0811D924: + mov r2, r8 + ldr r1, [r2] + ldr r0, _0811D9A0 @ =0x000007FF + cmp r1, r0 + bgt _0811D932 +_0811D92E: + movs r0, #0 + strb r0, [r4] +_0811D932: + mov r3, sb + movs r0, #0 + ldrsb r0, [r3, r0] + cmp r0, #0 + bne _0811D986 + movs r0, #0 + ldrsb r0, [r4, r0] + cmp r0, #0 + bne _0811D986 + mov r0, sl + adds r0, #0xb0 + ldr r1, [r0] + ldrb r0, [r1, #4] + cmp r0, #0 + beq _0811D986 + adds r1, r0, #0 + ldr r3, _0811D9A4 @ =gCurLevelInfo + mov r0, sl + adds r0, #0x56 + ldrb r2, [r0] + movs r0, #0xcd + lsls r0, r0, #3 + muls r0, r2, r0 + adds r0, r0, r3 + ldr r2, _0811D9A8 @ =0x0000065E + adds r0, r0, r2 + ldrb r2, [r0] + movs r0, #0 + bl sub_08002888 + adds r1, r0, #0 + ldr r0, [r1] + cmp r0, #0 + beq _0811D986 + subs r0, #1 + str r0, [r1] + mov r3, sl + ldr r0, [r3, #8] + movs r1, #0x80 + lsls r1, r1, #5 + orrs r0, r1 + str r0, [r3, #8] +_0811D986: + mov r1, sl + ldrh r0, [r1, #4] + adds r0, #1 + strh r0, [r1, #4] + add sp, #0x10 + pop {r3, r4, r5} + mov r8, r3 + mov sb, r4 + mov sl, r5 + pop {r4, r5, r6, r7} + pop {r0} + bx r0 + .align 2, 0 +_0811D9A0: .4byte 0x000007FF +_0811D9A4: .4byte gCurLevelInfo +_0811D9A8: .4byte 0x0000065E + + thumb_func_start sub_0811D9AC +sub_0811D9AC: @ 0x0811D9AC + push {r4, r5, r6, r7, lr} + mov r7, sl + mov r6, sb + mov r5, r8 + push {r5, r6, r7} + sub sp, #0xc + adds r7, r0, #0 + ldrh r1, [r7, #0x12] + movs r0, #0x10 + ands r0, r1 + cmp r0, #0 + beq _0811D9D0 + ldrh r0, [r7, #6] + lsls r0, r0, #2 + movs r1, #0x80 + lsls r1, r1, #0x12 + adds r1, r0, r1 + b _0811D9D8 +_0811D9D0: + ldrh r1, [r7, #6] + movs r0, #0xc0 + lsls r0, r0, #0x12 + adds r1, r1, r0 +_0811D9D8: + adds r0, r1, #0 + adds r0, #0x8c + ldr r3, [r0] + subs r0, #0x2c + ldrh r0, [r0] + mov sb, r0 + adds r0, r1, #0 + adds r0, #0x56 + ldrb r0, [r0] + str r0, [sp, #8] + adds r0, r1, #0 + adds r0, #0xb0 + ldr r1, [r0] + ldrb r0, [r1, #2] + mov sl, r0 + ldrb r4, [r1, #3] + str r4, [sp] + ldr r2, _0811DA24 @ =gCurLevelInfo + movs r0, #0xcd + lsls r0, r0, #3 + ldr r4, [sp, #8] + muls r0, r4, r0 + adds r0, r0, r2 + ldr r4, _0811DA28 @ =0x0000065E + adds r0, r0, r4 + ldrb r0, [r0] + str r0, [sp, #4] + ldrh r1, [r1, #0x22] + movs r0, #8 + ands r0, r1 + mov ip, r2 + cmp r0, #0 + bne _0811DB10 + movs r6, #0 + ldr r0, _0811DA2C @ =gUnk_0203AD44 + mov r8, r0 + b _0811DB0A + .align 2, 0 +_0811DA24: .4byte gCurLevelInfo +_0811DA28: .4byte 0x0000065E +_0811DA2C: .4byte gUnk_0203AD44 +_0811DA30: + movs r0, #0xd4 + lsls r0, r0, #1 + muls r0, r6, r0 + ldr r1, _0811DB40 @ =gKirbys + adds r0, r0, r1 + adds r0, #0x60 + ldrh r0, [r0] + cmp r0, sb + bne _0811DB02 + movs r0, #0xcd + lsls r0, r0, #3 + adds r2, r6, #0 + muls r2, r0, r2 + mov r0, ip + adds r0, #0x7c + adds r5, r2, r0 + ldr r1, [r3, #0x38] + ldr r0, [r5] + cmp r1, r0 + bne _0811DB02 + mov r0, ip + adds r0, #0x80 + adds r4, r2, r0 + ldr r1, [r3, #0x3c] + ldr r0, [r4] + cmp r1, r0 + bne _0811DB02 + ldr r0, [r3, #0x18] + str r0, [r5] + ldr r0, [r3, #0x1c] + str r0, [r4] + mov r0, ip + adds r0, #0x84 + adds r0, r2, r0 + ldr r1, [r3, #0x20] + str r1, [r0] + mov r0, ip + adds r0, #0x88 + adds r0, r2, r0 + ldr r1, [r3, #0x24] + str r1, [r0] + mov r0, ip + adds r0, #0xa0 + adds r0, r2, r0 + ldr r1, [r3, #0x28] + str r1, [r0] + mov r0, ip + adds r0, #0xa4 + adds r0, r2, r0 + ldr r1, [r3, #0x2c] + str r1, [r0] + mov r0, ip + adds r0, #0xa8 + adds r0, r2, r0 + ldr r1, [r3, #0x30] + str r1, [r0] + mov r0, ip + adds r0, #0xac + adds r0, r2, r0 + ldr r1, [r3, #0x34] + str r1, [r0] + mov r0, ip + adds r0, #0x6c + adds r0, r2, r0 + ldr r1, [r3, #0x18] + str r1, [r0] + mov r0, ip + adds r0, #0x70 + adds r0, r2, r0 + ldr r1, [r3, #0x1c] + str r1, [r0] + mov r0, ip + adds r0, #0x74 + adds r0, r2, r0 + ldr r1, [r3, #0x20] + str r1, [r0] + mov r0, ip + adds r0, #0x78 + adds r0, r2, r0 + ldr r1, [r3, #0x24] + str r1, [r0] + mov r0, ip + adds r0, #0x90 + adds r0, r2, r0 + ldr r1, [r3, #0x28] + str r1, [r0] + mov r0, ip + adds r0, #0x94 + adds r0, r2, r0 + ldr r1, [r3, #0x2c] + str r1, [r0] + mov r0, ip + adds r0, #0x98 + adds r0, r2, r0 + ldr r1, [r3, #0x30] + str r1, [r0] + mov r0, ip + adds r0, #0x9c + adds r0, r2, r0 + ldr r1, [r3, #0x34] + str r1, [r0] + ldr r4, _0811DB44 @ =gCurLevelInfo+0x1EC + adds r1, r2, r4 + movs r0, #0 + str r0, [r1] +_0811DB02: + adds r0, r6, #1 + lsls r0, r0, #0x18 + lsrs r6, r0, #0x18 + mov r0, r8 +_0811DB0A: + ldrb r0, [r0] + cmp r6, r0 + blo _0811DA30 +_0811DB10: + adds r0, r7, #0 + bl ObjectDestroy + mov r1, sl + cmp r1, #0 + bne _0811DB22 + ldr r4, [sp, #8] + cmp r4, #0xff + beq _0811DB2E +_0811DB22: + mov r0, sl + ldr r1, [sp] + ldr r2, [sp, #4] + movs r3, #1 + bl sub_08001678 +_0811DB2E: + add sp, #0xc + pop {r3, r4, r5} + mov r8, r3 + mov sb, r4 + mov sl, r5 + pop {r4, r5, r6, r7} + pop {r0} + bx r0 + .align 2, 0 +_0811DB40: .4byte gKirbys +_0811DB44: .4byte gCurLevelInfo+0x1EC + + thumb_func_start sub_0811DB48 +sub_0811DB48: @ 0x0811DB48 + push {r4, r5, r6, lr} + lsls r1, r1, #0x18 + lsrs r5, r1, #0x18 + adds r1, r0, #0 + adds r1, #0x8c + ldr r4, [r1] + adds r0, #0x60 + ldr r2, _0811DC38 @ =gKirbys + movs r1, #0xd4 + lsls r1, r1, #1 + muls r1, r5, r1 + adds r1, r1, r2 + adds r1, #0x60 + ldrh r1, [r1] + ldrh r0, [r0] + cmp r1, r0 + bne _0811DC30 + ldr r3, _0811DC3C @ =gCurLevelInfo + movs r0, #0xcd + lsls r0, r0, #3 + adds r2, r5, #0 + muls r2, r0, r2 + adds r0, r3, #0 + adds r0, #0x7c + adds r6, r2, r0 + ldr r1, [r4, #0x38] + ldr r0, [r6] + cmp r1, r0 + bne _0811DC30 + adds r0, r3, #0 + adds r0, #0x80 + adds r5, r2, r0 + ldr r1, [r4, #0x3c] + ldr r0, [r5] + cmp r1, r0 + bne _0811DC30 + ldr r0, [r4, #0x18] + str r0, [r6] + ldr r0, [r4, #0x1c] + str r0, [r5] + adds r0, r3, #0 + adds r0, #0x84 + adds r0, r2, r0 + ldr r1, [r4, #0x20] + str r1, [r0] + adds r0, r3, #0 + adds r0, #0x88 + adds r0, r2, r0 + ldr r1, [r4, #0x24] + str r1, [r0] + adds r0, r3, #0 + adds r0, #0xa0 + adds r0, r2, r0 + ldr r1, [r4, #0x28] + str r1, [r0] + adds r0, r3, #0 + adds r0, #0xa4 + adds r0, r2, r0 + ldr r1, [r4, #0x2c] + str r1, [r0] + adds r0, r3, #0 + adds r0, #0xa8 + adds r0, r2, r0 + ldr r1, [r4, #0x30] + str r1, [r0] + adds r0, r3, #0 + adds r0, #0xac + adds r0, r2, r0 + ldr r1, [r4, #0x34] + str r1, [r0] + adds r0, r3, #0 + adds r0, #0x6c + adds r0, r2, r0 + ldr r1, [r4, #0x18] + str r1, [r0] + adds r0, r3, #0 + adds r0, #0x70 + adds r0, r2, r0 + ldr r1, [r4, #0x1c] + str r1, [r0] + adds r0, r3, #0 + adds r0, #0x74 + adds r0, r2, r0 + ldr r1, [r4, #0x20] + str r1, [r0] + adds r0, r3, #0 + adds r0, #0x78 + adds r0, r2, r0 + ldr r1, [r4, #0x24] + str r1, [r0] + adds r0, r3, #0 + adds r0, #0x90 + adds r0, r2, r0 + ldr r1, [r4, #0x28] + str r1, [r0] + adds r0, r3, #0 + adds r0, #0x94 + adds r0, r2, r0 + ldr r1, [r4, #0x2c] + str r1, [r0] + adds r0, r3, #0 + adds r0, #0x98 + adds r0, r2, r0 + ldr r1, [r4, #0x30] + str r1, [r0] + adds r0, r3, #0 + adds r0, #0x9c + adds r0, r2, r0 + ldr r1, [r4, #0x34] + str r1, [r0] + movs r1, #0xf6 + lsls r1, r1, #1 + adds r0, r3, r1 + adds r0, r2, r0 + movs r1, #0 + str r1, [r0] +_0811DC30: + pop {r4, r5, r6} + pop {r0} + bx r0 + .align 2, 0 +_0811DC38: .4byte gKirbys +_0811DC3C: .4byte gCurLevelInfo diff --git a/data/data_20.s b/data/data_20.s index d871e08..371cccd 100644 --- a/data/data_20.s +++ b/data/data_20.s @@ -29,6 +29,3 @@ gUnk_08357C54:: @ 08357C54 gUnk_08357C58:: @ 08357C58 .incbin "baserom.gba", 0x357C58, 0x0000004 - -gUnk_08357C5C:: @ 08357C5C - .incbin "baserom.gba", 0x357C5C, 0x0000004 diff --git a/include/functions.h b/include/functions.h index db98b60..d699814 100644 --- a/include/functions.h +++ b/include/functions.h @@ -182,7 +182,7 @@ void sub_080362A4(void); void sub_08036314(struct ObjectBase *); void sub_08036378(void); u8 sub_0803925C(struct ObjectBase*, struct ObjectBase*); -u8 sub_08039430(struct Object2 *, s32, s32, s32, s16, u16, u16); +u8 sub_08039430(struct ObjectBase *, s32, s32, s32, s16, u16, u16); bool32 sub_080395D4(void); void sub_08039600(u16); void sub_08039670(void); diff --git a/include/lava_wall.h b/include/lava_wall.h index dcda12a..aa4d9b4 100644 --- a/include/lava_wall.h +++ b/include/lava_wall.h @@ -5,8 +5,8 @@ #include "task.h" void *CreateLavaWall(struct Object *, u8); -void sub_0811C758(struct Object2* arg0); +void sub_0811C758(struct Object2 *); -void sub_0811D9AC(struct Task *); +extern const struct Unk_02021590 gUnk_08357C5C[]; #endif diff --git a/include/scroll_lock.h b/include/scroll_lock.h index 59625f0..165540b 100644 --- a/include/scroll_lock.h +++ b/include/scroll_lock.h @@ -3,9 +3,39 @@ #include "data.h" #include "global.h" -#include "object.h" + +struct Unk_0811C9D4_0 { + u32 unk0; + u32 unk4; + s32 unk8; + s32 unkC; + s32 unk10; + s32 unk14; + s32 unk18; + s32 unk1C; + s32 unk20; + s32 unk24; + s32 unk28; + s32 unk2C; + s32 unk30; + s32 unk34; + s32 unk38; + s32 unk3C; + s32 filler40; +}; /* size = 0x44 */ + +struct Unk_0811C9D4 { + struct Unk_0811C9D4_0 unk0; + u16 unk44; + s8 unk46; + u16 unk48; + s8 unk4A; + s32 unk4C; + s32 unk50; +}; /* size = 0x54 */ void* CreateScrollLock(struct Object* arg0, u8 arg1); +void sub_0811C9D4(struct Object2 *); extern const struct Unk_02021590 gUnk_08357C60[]; diff --git a/linker.ld b/linker.ld index 050e5a0..b69c9cc 100644 --- a/linker.ld +++ b/linker.ld @@ -340,7 +340,8 @@ SECTIONS { src/destroyable_rock_block.o(.text); asm/code_0811C29C.o(.text); src/lava_wall.o(.text); - asm/lava_wall.o(.text); + src/scroll_lock_2.o(.text); + asm/scroll_lock.o(.text); src/scroll_lock.o(.text); src/cannon_fuse.o(.text); asm/star_stone_block.o(.text); @@ -485,6 +486,7 @@ SECTIONS { src/fire.o(.rodata); src/mirror_door.o(.rodata); data/data_20.o(.rodata); + src/lava_wall.o(.rodata); src/scroll_lock.o(.rodata); src/cannon_fuse.o(.rodata); data/data_19.o(.rodata); diff --git a/src/batafire.c b/src/batafire.c index 244a3aa..5ffc4c8 100644 --- a/src/batafire.c +++ b/src/batafire.c @@ -219,7 +219,7 @@ static void sub_080C939C(struct Object2 *batafire) && batafire->base.roomId == batafire->kirby3->base.base.base.roomId) { - if (sub_08039430(&batafire->kirby3->base.base, + if (sub_08039430(&batafire->kirby3->base.base.base, batafire->base.x, batafire->base.y, batafire->object->unk1A, batafire->object->unk1C, batafire->object->unk1E, batafire->object->unk20)) diff --git a/src/batty.c b/src/batty.c index 8109fbb..7b67f2e 100644 --- a/src/batty.c +++ b/src/batty.c @@ -315,7 +315,7 @@ static void sub_080BD2B4(struct Object2* arg0) { if (arg0->unk83 == 2) { if (++arg0->base.counter > 0x14) { if (arg0->object->unk1A != 0 || arg0->object->unk1C != 0 || arg0->object->unk1E != 0 || arg0->object->unk20 != 0) { - if (sub_08039430(&arg0->kirby3->base.base, arg0->base.x, arg0->base.y, arg0->object->unk1A, arg0->object->unk1C, arg0->object->unk1E, arg0->object->unk20) != 0) { + if (sub_08039430(&arg0->kirby3->base.base.base, arg0->base.x, arg0->base.y, arg0->object->unk1A, arg0->object->unk1C, arg0->object->unk1E, arg0->object->unk20) != 0) { arg0->unk83 = 3; } } diff --git a/src/bombar.c b/src/bombar.c index eeea98f..56f3bad 100644 --- a/src/bombar.c +++ b/src/bombar.c @@ -156,7 +156,7 @@ static void sub_080D7A6C(struct Object2 *bombar) bombar->base.flags |= 4; if (!(bombar->kirby3->base.base.base.unkC & 0x8000) && bombar->base.roomId == bombar->kirby3->base.base.base.roomId - && sub_08039430(&bombar->kirby3->base.base, + && sub_08039430(&bombar->kirby3->base.base.base, bombar->base.x, bombar->base.y, bombar->object->unk1A, bombar->object->unk1C, bombar->object->unk1E, bombar->object->unk20)) diff --git a/src/bonkers.c b/src/bonkers.c index 15616a8..e0a03f0 100644 --- a/src/bonkers.c +++ b/src/bonkers.c @@ -127,7 +127,7 @@ static void sub_080CF68C(struct Object2 *arg0) { else { arg0->base.flags &= ~1; } - if (sub_08039430(&arg0->kirby3->base.base, arg0->object->x * 0x100, arg0->object->y * 0x100, arg0->object->unk1A, arg0->object->unk1C, arg0->object->unk1E, arg0->object->unk20)) { + if (sub_08039430(&arg0->kirby3->base.base.base, arg0->object->x * 0x100, arg0->object->y * 0x100, arg0->object->unk1A, arg0->object->unk1C, arg0->object->unk1E, arg0->object->unk20)) { Macro_081003EC(arg0, &arg0->kirby3->base.base.base); arg0->base.flags &= ~0x200; sub_080CF898(arg0); diff --git a/src/box_boxer.c b/src/box_boxer.c index 3144195..a963ac9 100644 --- a/src/box_boxer.c +++ b/src/box_boxer.c @@ -195,7 +195,7 @@ static void sub_080C72CC(struct Object2 *boxBoxer) boxBoxer->base.flags |= 1; else boxBoxer->base.flags &= ~1; - if (sub_08039430(&boxBoxer->kirby3->base.base, + if (sub_08039430(&boxBoxer->kirby3->base.base.base, boxBoxer->object->x * 0x100, boxBoxer->object->y * 0x100, boxBoxer->object->unk1A, boxBoxer->object->unk1C, boxBoxer->object->unk1E, boxBoxer->object->unk20)) diff --git a/src/boxy.c b/src/boxy.c index 9a78e7f..150612c 100644 --- a/src/boxy.c +++ b/src/boxy.c @@ -124,7 +124,7 @@ static void sub_080D571C(struct Boxy *boxy) boxy->obj2.base.flags |= 1; else boxy->obj2.base.flags &= ~1; - if (sub_08039430(&boxy->obj2.kirby3->base.base, + if (sub_08039430(&boxy->obj2.kirby3->base.base.base, boxy->obj2.object->x * 0x100, boxy->obj2.object->y * 0x100, boxy->obj2.object->unk1A, boxy->obj2.object->unk1C, boxy->obj2.object->unk1E, boxy->obj2.object->unk20)) diff --git a/src/crazy_hand.c b/src/crazy_hand.c index f4acdd1..7620c52 100644 --- a/src/crazy_hand.c +++ b/src/crazy_hand.c @@ -188,7 +188,7 @@ static void sub_080DF4C0(struct CrazyHand *ch) ch->obj2.base.flags |= 4; if (!(ch->obj2.kirby3->base.base.base.unkC & 0x8000) && ch->obj2.base.roomId == ch->obj2.kirby3->base.base.base.roomId - && sub_08039430(&ch->obj2.kirby3->base.base, + && sub_08039430(&ch->obj2.kirby3->base.base.base, ch->obj2.base.x, ch->obj2.base.y, ch->obj2.object->unk1A, ch->obj2.object->unk1C, ch->obj2.object->unk1E, ch->obj2.object->unk20)) diff --git a/src/dark_meta_knight.c b/src/dark_meta_knight.c index 5f194b5..a30af50 100644 --- a/src/dark_meta_knight.c +++ b/src/dark_meta_knight.c @@ -208,7 +208,7 @@ static void sub_080F5974(struct DarkMetaKnight *dmk) dmk->obj2.base.flags |= 4; if (!(dmk->obj2.kirby3->base.base.base.unkC & 0x8000) && dmk->obj2.base.roomId == dmk->obj2.kirby3->base.base.base.roomId - && sub_08039430(&dmk->obj2.kirby3->base.base, dmk->obj2.base.x, dmk->obj2.base.y, dmk->obj2.object->unk1A, dmk->obj2.object->unk1C, dmk->obj2.object->unk1E, dmk->obj2.object->unk20)) + && sub_08039430(&dmk->obj2.kirby3->base.base.base, dmk->obj2.base.x, dmk->obj2.base.y, dmk->obj2.object->unk1A, dmk->obj2.object->unk1C, dmk->obj2.object->unk1E, dmk->obj2.object->unk20)) { Macro_081003EC(&dmk->obj2, &dmk->obj2.kirby3->base.base.base); if (dmk->obj2.object->subtype1) diff --git a/src/dark_mind.c b/src/dark_mind.c index 1702577..f270d45 100644 --- a/src/dark_mind.c +++ b/src/dark_mind.c @@ -711,7 +711,7 @@ static void sub_081003EC(struct DarkMindForm1 *r5) r5->unk0.base.flags |= 4; if (!(r6->base.base.base.unkC & 0x8000) && r5->unk0.base.roomId == r6->base.base.base.roomId - && sub_08039430(&r6->base.base, + && sub_08039430(&r6->base.base.base, r5->unk0.base.x, r5->unk0.base.y, r5->unk0.object->unk1A, @@ -6011,7 +6011,7 @@ static void sub_0810BD28(struct DarkMindForm2 *r5) r5->unk0.base.flags |= 4; if (!(r5->unk0.kirby3->base.base.base.unkC & 0x8000) && r5->unk0.base.roomId == r5->unk0.kirby3->base.base.base.roomId - && sub_08039430(&r5->unk0.kirby3->base.base, + && sub_08039430(&r5->unk0.kirby3->base.base.base, r5->unk0.base.x, r5->unk0.base.y, r5->unk0.object->unk1A, r5->unk0.object->unk1C, r5->unk0.object->unk1E, r5->unk0.object->unk20)) @@ -10543,7 +10543,7 @@ static void sub_08114B28(struct DarkMindTrigger *r5) r5->unk0.kirby3 = sub_0803D368(&r5->unk0.base); r5->unk0.base.flags |= 4; if (!(r5->unk0.kirby3->base.base.base.unkC & 0x8000) && r5->unk0.base.roomId == r5->unk0.kirby3->base.base.base.roomId - && sub_08039430(&r5->unk0.kirby3->base.base, + && sub_08039430(&r5->unk0.kirby3->base.base.base, r5->unk0.base.x, r5->unk0.base.y, r5->unk0.object->unk1A, r5->unk0.object->unk1C, r5->unk0.object->unk1E, r5->unk0.object->unk20)) diff --git a/src/gobbler.c b/src/gobbler.c index be6d9c4..7636c38 100644 --- a/src/gobbler.c +++ b/src/gobbler.c @@ -213,7 +213,7 @@ static void sub_080E3FFC(struct Gobbler *gobbler) gobbler->obj2.kirby3 = sub_0803D368(&gobbler->obj2.base); if (!(gobbler->obj2.kirby3->base.base.base.unkC & 0x8000) && gobbler->obj2.base.roomId == gobbler->obj2.kirby3->base.base.base.roomId - && sub_08039430(&gobbler->obj2.kirby3->base.base, gobbler->obj2.base.x, gobbler->obj2.base.y, gobbler->obj2.object->unk1A, gobbler->obj2.object->unk1C, gobbler->obj2.object->unk1E, gobbler->obj2.object->unk20)) + && sub_08039430(&gobbler->obj2.kirby3->base.base.base, gobbler->obj2.base.x, gobbler->obj2.base.y, gobbler->obj2.object->unk1A, gobbler->obj2.object->unk1C, gobbler->obj2.object->unk1E, gobbler->obj2.object->unk20)) { Macro_081003EC(&gobbler->obj2, &gobbler->obj2.kirby3->base.base.base); sub_080E43B4(gobbler); diff --git a/src/golem.c b/src/golem.c index ed1b848..acc0228 100644 --- a/src/golem.c +++ b/src/golem.c @@ -272,14 +272,14 @@ static void sub_080C57D8(struct Object2 *golem) || golem->object->unk1E || golem->object->unk20) { - if (sub_08039430(&golem->kirby3->base.base, golem->base.x, golem->base.y, + if (sub_08039430(&golem->kirby3->base.base.base, golem->base.x, golem->base.y, golem->object->unk1A, golem->object->unk1C, golem->object->unk1E, golem->object->unk20)) golem->base.flags &= ~8; } else { - if (sub_08039430(&golem->kirby3->base.base, golem->base.x, golem->base.y, -0x28, -0x28, 0x50, 0x3C)) + if (sub_08039430(&golem->kirby3->base.base.base, golem->base.x, golem->base.y, -0x28, -0x28, 0x50, 0x3C)) golem->base.flags &= ~8; } } diff --git a/src/king_golem.c b/src/king_golem.c index 425b561..0bbea92 100644 --- a/src/king_golem.c +++ b/src/king_golem.c @@ -88,7 +88,7 @@ static void sub_080DA2BC(struct KingGolem *kg) kg->obj2.kirby3 = sub_0803D368(&kg->obj2.base); if (!(kg->obj2.kirby3->base.base.base.unkC & 0x8000) && kg->obj2.base.roomId == kg->obj2.kirby3->base.base.base.roomId - && sub_08039430(&kg->obj2.kirby3->base.base, + && sub_08039430(&kg->obj2.kirby3->base.base.base, kg->obj2.base.x, kg->obj2.base.y, kg->obj2.object->unk1A, kg->obj2.object->unk1C, kg->obj2.object->unk1E, kg->obj2.object->unk20)) diff --git a/src/kracko.c b/src/kracko.c index 44026fa..074dc2f 100644 --- a/src/kracko.c +++ b/src/kracko.c @@ -285,7 +285,7 @@ static void sub_080DBA1C(struct Kracko *kracko) kracko->obj2.base.flags |= 4; if (!(kracko->obj2.kirby3->base.base.base.unkC & 0x8000) && kracko->obj2.base.roomId == kracko->obj2.kirby3->base.base.base.roomId - && sub_08039430(&kracko->obj2.kirby3->base.base, + && sub_08039430(&kracko->obj2.kirby3->base.base.base, kracko->obj2.base.x, kracko->obj2.base.y, kracko->obj2.object->unk1A, kracko->obj2.object->unk1C, kracko->obj2.object->unk1E, kracko->obj2.object->unk20)) diff --git a/src/lava_wall.c b/src/lava_wall.c index 6d00537..346d633 100644 --- a/src/lava_wall.c +++ b/src/lava_wall.c @@ -3,8 +3,12 @@ #include "kirby.h" #include "object.h" -void sub_0811C5D8(struct Object2* arg0); -void sub_0811C768(struct Task *); +static void sub_0811C5D8(struct Object2 *); +static void sub_0811C768(struct Task *); + +const struct Unk_02021590 gUnk_08357C5C[] = { + { 0x2D1, 2, 0 }, +}; void *CreateLavaWall(struct Object *template, u8 a2) { @@ -50,42 +54,43 @@ void *CreateLavaWall(struct Object *template, u8 a2) return lavaWall; } -void sub_0811C5D8(struct Object2* arg0) { - if (arg0->object->unk22 & 1) { - if (*sub_08002888(0, arg0->object->unk4, gCurLevelInfo[arg0->base.unk56].unk65E) == 0) { - arg0->base.flags |= 0x1000; +static void sub_0811C5D8(struct Object2 *lavaWall) { + if (lavaWall->object->unk22 & 1) { + if (*sub_08002888(0, lavaWall->object->unk4, gCurLevelInfo[lavaWall->base.unk56].unk65E) == 0) { + lavaWall->base.flags |= 0x1000; } else { - if (arg0->object->unk22 & 2) { - Macro_080A4728(arg0); + if (lavaWall->object->unk22 & 2) { + Macro_080A4728(lavaWall); } - Macro_080A4728(arg0); + Macro_080A4728(lavaWall); } } else { - if (arg0->object->unk22 & 2) { - Macro_080A4728(arg0); + if (lavaWall->object->unk22 & 2) { + Macro_080A4728(lavaWall); } - Macro_080A4728(arg0); + Macro_080A4728(lavaWall); } - ++arg0->base.counter; + ++lavaWall->base.counter; } -void sub_0811C758(struct Object2* arg0) { - arg0->base.counter = 0; - arg0->unk78 = sub_0811C5D8; +void sub_0811C758(struct Object2 *lavaWall) { + lavaWall->base.counter = 0; + lavaWall->unk78 = sub_0811C5D8; } -void sub_0811C768(struct Task* arg0) { - struct Object2 *obj; +static void sub_0811C768(struct Task* t) { + struct Object2 *lavaWall; u8 unk3, unk56, r4; u32 unk2; - obj = TaskGetStructPtr(arg0); - unk56 = obj->base.unk56; - unk2 = obj->object->unk2; - unk3 = obj->object->unk3; + + lavaWall = TaskGetStructPtr(t); + unk56 = lavaWall->base.unk56; + unk2 = lavaWall->object->unk2; + unk3 = lavaWall->object->unk3; r4 = gCurLevelInfo[unk56].unk65E; - ObjectDestroy(arg0); + ObjectDestroy(t); if (unk2 != 0 || unk56 != 0xff) { sub_08001678(unk2, unk3, r4, 1); } diff --git a/src/master_hand.c b/src/master_hand.c index 5d32c04..cfa74e5 100644 --- a/src/master_hand.c +++ b/src/master_hand.c @@ -157,7 +157,7 @@ static void sub_080D1780(struct Object2 *mh) mh->base.flags |= 4; if (!(mh->kirby3->base.base.base.unkC & 0x8000) && mh->base.roomId == mh->kirby3->base.base.base.roomId - && sub_08039430(&mh->kirby3->base.base, + && sub_08039430(&mh->kirby3->base.base.base, mh->base.x, mh->base.y, mh->object->unk1A, mh->object->unk1C, mh->object->unk1E, mh->object->unk20)) diff --git a/src/mega_titan.c b/src/mega_titan.c index cbb38c5..cc44ce7 100644 --- a/src/mega_titan.c +++ b/src/mega_titan.c @@ -304,7 +304,7 @@ static void sub_080EDAD0(struct MegaTitan *mt) mt->obj2.base.flags |= 4; if (!(mt->obj2.kirby3->base.base.base.unkC & 0x8000) && mt->obj2.base.roomId == mt->obj2.kirby3->base.base.base.roomId - && sub_08039430(&mt->obj2.kirby3->base.base, + && sub_08039430(&mt->obj2.kirby3->base.base.base, mt->obj2.base.x, mt->obj2.base.y, mt->obj2.object->unk1A, mt->obj2.object->unk1C, mt->obj2.object->unk1E, mt->obj2.object->unk20)) diff --git a/src/moley.c b/src/moley.c index f1d62d0..9be93c3 100644 --- a/src/moley.c +++ b/src/moley.c @@ -153,7 +153,7 @@ static void sub_080EB2C0(struct Moley *moley) moley->obj2.base.flags |= 4; if (!(moley->obj2.kirby3->base.base.base.unkC & 0x8000) && moley->obj2.base.roomId == moley->obj2.kirby3->base.base.base.roomId - && sub_08039430(&moley->obj2.kirby3->base.base, + && sub_08039430(&moley->obj2.kirby3->base.base.base, moley->obj2.base.x, moley->obj2.base.y, moley->obj2.object->unk1A, moley->obj2.object->unk1C, moley->obj2.object->unk1E, moley->obj2.object->unk20)) diff --git a/src/mr_frosty.c b/src/mr_frosty.c index b26c363..d2f0c29 100644 --- a/src/mr_frosty.c +++ b/src/mr_frosty.c @@ -168,7 +168,7 @@ static void sub_080CB7E8(struct Object2 *mf) mf->base.flags |= 1; else mf->base.flags &= ~1; - if (sub_08039430(&mf->kirby3->base.base, + if (sub_08039430(&mf->kirby3->base.base.base, mf->object->x * 0x100, mf->object->y * 0x100, mf->object->unk1A, mf->object->unk1C, mf->object->unk1E, mf->object->unk20)) diff --git a/src/phan_phan.c b/src/phan_phan.c index 2ac5440..5cf8a4f 100644 --- a/src/phan_phan.c +++ b/src/phan_phan.c @@ -184,7 +184,7 @@ static void sub_080CD6C0(struct Object2 *phanPhan) phanPhan->base.flags |= 1; else phanPhan->base.flags &= ~1; - if (sub_08039430(&phanPhan->kirby3->base.base, + if (sub_08039430(&phanPhan->kirby3->base.base.base, phanPhan->object->x * 0x100, phanPhan->object->y * 0x100, phanPhan->object->unk1A, phanPhan->object->unk1C, phanPhan->object->unk1E, phanPhan->object->unk20)) diff --git a/src/scroll_lock.c b/src/scroll_lock.c index 9e24ec2..f990c25 100644 --- a/src/scroll_lock.c +++ b/src/scroll_lock.c @@ -1,12 +1,16 @@ #include "scroll_lock.h" +#include "object.h" #include "kirby.h" #include "functions.h" -#include "lava_wall.h" + +void sub_0811D9AC(struct Task *); const struct Unk_02021590 gUnk_08357C60[] = { { 0x2D1, 2, 0 }, }; +// TODO: merge with scroll_lock_2.c + void* CreateScrollLock(struct Object* arg0, u8 arg1) { struct Object2 *obj, *obj2; struct Task *task = TaskCreate(ObjectMain, sizeof(struct Object2), 0xff6, 0, sub_0811D9AC); diff --git a/src/scroll_lock_2.c b/src/scroll_lock_2.c new file mode 100644 index 0000000..dd99bcd --- /dev/null +++ b/src/scroll_lock_2.c @@ -0,0 +1,439 @@ +#include "malloc_ewram.h" +#include "scroll_lock.h" +#include "object.h" +#include "kirby.h" +#include "functions.h" + +void sub_0811C8BC(struct Unk_0811C9D4_0 *, u8, u16); +void sub_0811CB44(struct Object2 *); +void sub_0811CBB8(struct Object2 *); +void sub_0811CD1C(struct Object2 *); +void sub_0811CD90(struct Object2 *); +void sub_0811CEF4(struct Object2 *); +void sub_0811D158(struct Object2 *); +void sub_0811D508(struct Object2 *); +void sub_0811D68C(struct Object2 *); +void sub_0811DB48(struct Object2 *, s32); + +void sub_0811C7D0(struct Unk_0811C9D4_0 *a1, u8 a2, u16 a3) +{ + gCurLevelInfo[a2].unk7C = a1->unk8; + gCurLevelInfo[a2].unk84 = a1->unk10; + gCurLevelInfo[a2].unk80 = a1->unkC; + gCurLevelInfo[a2].unk88 = a1->unk14; + gCurLevelInfo[a2].unkA0 = a1->unk8; + gCurLevelInfo[a2].unkA4 = a1->unkC; + gCurLevelInfo[a2].unkA8 = a1->unk10; + gCurLevelInfo[a2].unkAC = a1->unk14; + if (a3 & 0x10) + { + gCurLevelInfo[a2].unk6C = a1->unk8; + gCurLevelInfo[a2].unk74 = a1->unk10; + gCurLevelInfo[a2].unk70 = a1->unkC; + gCurLevelInfo[a2].unk78 = a1->unk14; + if (!(a1->unk4 & (0x10 << a2))) + { + a1->unk4 |= 0x10 << a2; + gCurLevelInfo[a2].unk90 = a1->unk8; + gCurLevelInfo[a2].unk94 = a1->unkC; + gCurLevelInfo[a2].unk98 = a1->unk10; + gCurLevelInfo[a2].unk9C = a1->unk14; + } + } + else + sub_0811C8BC(a1, a2, a3); +} + +void sub_0811C8BC(struct Unk_0811C9D4_0 *a1, u8 a2, u16 a3 __attribute__((unused))) +{ + if (!(a1->unk4 & (0x10 << a2))) { + a1->unk4 |= 0x10 << a2; + if (a1->unk10 - a1->unk8 >= 0xF000) + { + if (gCurLevelInfo[a2].unk6C <= gCurLevelInfo[a2].unkC - 0x800) + gCurLevelInfo[a2].unk6C = gCurLevelInfo[a2].unkC - 0x800; + if (gCurLevelInfo[a2].unk74 >= gCurLevelInfo[a2].unkC + 0xF800) + gCurLevelInfo[a2].unk74 = gCurLevelInfo[a2].unkC + 0xF800; + } + if (a1->unk14 - a1->unkC >= 0xA000) + { + if (gCurLevelInfo[a2].unk70 <= gCurLevelInfo[a2].unk10 - 0x800) + gCurLevelInfo[a2].unk70 = gCurLevelInfo[a2].unk10 - 0x800; + if (gCurLevelInfo[a2].unk78 >= gCurLevelInfo[a2].unk10 + 0xA800) + gCurLevelInfo[a2].unk78 = gCurLevelInfo[a2].unk10 + 0xA800; + } + if (gCurLevelInfo[a2].unk90 <= gCurLevelInfo[a2].unkC - 0x800) + gCurLevelInfo[a2].unk90 = gCurLevelInfo[a2].unkC - 0x800; + if (gCurLevelInfo[a2].unk94 <= gCurLevelInfo[a2].unk10 - 0x800) + gCurLevelInfo[a2].unk94 = gCurLevelInfo[a2].unk10 - 0x800; + if (gCurLevelInfo[a2].unk98 >= gCurLevelInfo[a2].unkC + 0xF800) + gCurLevelInfo[a2].unk98 = gCurLevelInfo[a2].unkC + 0xF800; + if (gCurLevelInfo[a2].unk9C >= gCurLevelInfo[a2].unk10 + 0xF800) + gCurLevelInfo[a2].unk9C = gCurLevelInfo[a2].unk10 + 0xF800; + } +} + +void sub_0811C9D4(struct Object2 *scrollLock) +{ + u8 unk56; + struct Unk_0811C9D4_0 *p; + + scrollLock->base.counter = 0; + switch (scrollLock->object->unk22 & 3) + { + case 0: + scrollLock->unk8C = EwramMalloc(sizeof(struct Unk_0811C9D4_0)); + CpuFill32(0, scrollLock->unk8C, sizeof(struct Unk_0811C9D4_0)); + ((struct Unk_0811C9D4_0 *)scrollLock->unk8C)->unk0 = 1; + break; + case 1: + scrollLock->unk8C = EwramMalloc(sizeof(struct Unk_0811C9D4)); + CpuFill32(0, scrollLock->unk8C, sizeof(struct Unk_0811C9D4)); + ((struct Unk_0811C9D4 *)scrollLock->unk8C)->unk0.unk0 = 1; // 2? + break; + case 2: + scrollLock->unk8C = EwramMalloc(sizeof(struct Unk_0811C9D4_0)); + CpuFill32(0, scrollLock->unk8C, sizeof(struct Unk_0811C9D4_0)); + ((struct Unk_0811C9D4_0 *)scrollLock->unk8C)->unk0 = 3; + break; + case 3: + scrollLock->unk8C = EwramMalloc(sizeof(struct Unk_0811C9D4)); + CpuFill32(0, scrollLock->unk8C, sizeof(struct Unk_0811C9D4)); + ((struct Unk_0811C9D4 *)scrollLock->unk8C)->unk0.unk0 = 4; + break; + } + unk56 = scrollLock->base.unk56; + p = (struct Unk_0811C9D4_0 *)scrollLock->unk8C; + p->unk18 = gCurLevelInfo[unk56].unk7C; + p->unk1C = gCurLevelInfo[unk56].unk80; + p->unk20 = gCurLevelInfo[unk56].unk84; + p->unk24 = gCurLevelInfo[unk56].unk88; + p->unk28 = gCurLevelInfo[unk56].unkA0; + p->unk2C = gCurLevelInfo[unk56].unkA4; + p->unk30 = gCurLevelInfo[unk56].unkA8; + p->unk34 = gCurLevelInfo[unk56].unkAC; + switch (p->unk0) + { + case 1: + sub_0811CB44(scrollLock); + break; + case 2: + sub_0811CBB8(scrollLock); + break; + case 3: + sub_0811CD1C(scrollLock); + break; + case 4: + sub_0811CD90(scrollLock); + break; + } +} + +void sub_0811CB44(struct Object2 *scrollLock) +{ + struct Unk_0811C9D4_0 *p = scrollLock->unk8C; + + p->unk8 = (scrollLock->object->unk14 & 0xFF00) << 4; + p->unkC = (scrollLock->object->unk14 & 0xFF) << 12; + p->unk10 = p->unk8 + ((scrollLock->object->unk12 & 0xFF00) << 4); + p->unk14 = p->unkC + ((scrollLock->object->unk12 & 0xFF) << 12); + if (scrollLock->object->unk22 & 4) + { + p->unk8 += 0x800; + p->unkC += 0x800; + p->unk10 += 0x800; + p->unk14 += 0x800; + } + scrollLock->unk78 = sub_0811CEF4; + p->unk38 = p->unk8; + p->unk3C = p->unkC; +} + +void sub_0811CBB8(struct Object2 *scrollLock) +{ + struct Unk_0811C9D4 *p = scrollLock->unk8C; + + p->unk0.unk8 = (scrollLock->object->unk14 & 0xFF00) << 4; + p->unk0.unkC = (scrollLock->object->unk14 & 0xFF) << 12; + p->unk0.unk10 = p->unk0.unk8 + ((scrollLock->object->unk12 & 0xFF00) << 4); + p->unk0.unk14 = p->unk0.unkC + ((scrollLock->object->unk12 & 0xFF) << 12); +#ifndef NONMATCHING + asm(""::"r"(gCurLevelInfo)); + asm(""::"r"(&scrollLock->base.unk56)); +#endif + p->unk44 = (scrollLock->object->unk18 & 0xFF00) >> 4; + p->unk46 = scrollLock->object->unk18; + p->unk48 = (scrollLock->object->unk16 & 0xFF00) >> 4; + p->unk4A = scrollLock->object->unk16; + if (p->unk46 >= 0) + { + p->unk4C = p->unk0.unk8 + p->unk0.unk10 - p->unk0.unk8 + (p->unk44 << 8); + if (p->unk4C > (gCurLevelInfo[scrollLock->base.unk56].roomWidth << 8) - 0x800) + p->unk4C = (gCurLevelInfo[scrollLock->base.unk56].roomWidth << 8) - 0x800; + } + else + { + p->unk4C = p->unk0.unk8 - (p->unk44 << 8); + if (p->unk4C < 0x800) + p->unk4C = 0x800; + } + if (p->unk4A >= 0) + { + p->unk50 = p->unk0.unkC + p->unk0.unk14 - p->unk0.unkC + (p->unk48 << 8); + if (p->unk50 > (gCurLevelInfo[scrollLock->base.unk56].roomHeight << 8) - 0x1800) + p->unk50 = (gCurLevelInfo[scrollLock->base.unk56].roomHeight << 8) - 0x1800; + } + else + { + p->unk50 = p->unk0.unkC + (p->unk48 << 8); + if (p->unk50 < 0x800) + p->unk50 = 0x800; + } + scrollLock->unk78 = sub_0811D158; + p->unk0.unk38 = p->unk0.unk8; + p->unk0.unk3C = p->unk0.unkC; +} + +void sub_0811CD1C(struct Object2 *scrollLock) +{ + struct Unk_0811C9D4_0 *p = scrollLock->unk8C; + + p->unk8 = (scrollLock->object->unk14 & 0xFF00) << 4; + p->unkC = (scrollLock->object->unk14 & 0xFF) << 12; + p->unk10 = p->unk8 + ((scrollLock->object->unk12 & 0xFF00) << 4); + p->unk14 = p->unkC + ((scrollLock->object->unk12 & 0xFF) << 12); + if (scrollLock->object->unk22 & 4) + { + p->unk8 += 0x800; + p->unkC += 0x800; + p->unk10 += 0x800; + p->unk14 += 0x800; + } + scrollLock->unk78 = sub_0811D508; + p->unk38 = p->unk8; + p->unk3C = p->unkC; +} + +void sub_0811CD90(struct Object2 *scrollLock) +{ + struct Unk_0811C9D4 *p = scrollLock->unk8C; + + p->unk0.unk8 = (scrollLock->object->unk14 & 0xFF00) << 4; + p->unk0.unkC = (scrollLock->object->unk14 & 0xFF) << 12; + p->unk0.unk10 = p->unk0.unk8 + ((scrollLock->object->unk12 & 0xFF00) << 4); + p->unk0.unk14 = p->unk0.unkC + ((scrollLock->object->unk12 & 0xFF) << 12); +#ifndef NONMATCHING + asm(""::"r"(gCurLevelInfo)); + asm(""::"r"(&scrollLock->base.unk56)); +#endif + p->unk44 = (scrollLock->object->unk18 & 0xFF00) >> 4; + p->unk46 = scrollLock->object->unk18; + p->unk48 = (scrollLock->object->unk16 & 0xFF00) >> 4; + p->unk4A = scrollLock->object->unk16; + if (p->unk46 >= 0) + { + p->unk4C = p->unk0.unk8 + p->unk0.unk10 - p->unk0.unk8 + (p->unk44 << 8); + if (p->unk4C > (gCurLevelInfo[scrollLock->base.unk56].roomWidth << 8) - 0x800) + p->unk4C = (gCurLevelInfo[scrollLock->base.unk56].roomWidth << 8) - 0x800; + } + else + { + p->unk4C = p->unk0.unk8 - (p->unk44 << 8); + if (p->unk4C < 0x800) + p->unk4C = 0x800; + } + if (p->unk4A >= 0) + { + p->unk50 = p->unk0.unkC + p->unk0.unk14 - p->unk0.unkC + (p->unk48 << 8); + if (p->unk50 > (gCurLevelInfo[scrollLock->base.unk56].roomHeight << 8) - 0x1800) + p->unk50 = (gCurLevelInfo[scrollLock->base.unk56].roomHeight << 8) - 0x1800; + } + else + { + p->unk50 = p->unk0.unkC + (p->unk48 << 8); + if (p->unk50 < 0x800) + p->unk50 = 0x800; + } + scrollLock->unk78 = sub_0811D68C; + p->unk0.unk38 = p->unk0.unk8; + p->unk0.unk3C = p->unk0.unkC; +} + +void sub_0811CEF4(struct Object2 *scrollLock) +{ + struct Unk_0811C9D4_0 *p = scrollLock->unk8C; + s8 i; + u16 roomId = scrollLock->base.roomId; + + if (gKirbys[0].base.base.base.roomId == roomId + && gKirbys[1].base.base.base.roomId == gKirbys[0].base.base.base.roomId + && gKirbys[2].base.base.base.roomId == gKirbys[1].base.base.base.roomId + && gKirbys[3].base.base.base.roomId == gKirbys[2].base.base.base.roomId) + { + if (sub_08039430(&gKirbys[0].base.base.base, scrollLock->base.x, scrollLock->base.y, scrollLock->object->unk1A, scrollLock->object->unk1C, scrollLock->object->unk1E, scrollLock->object->unk20) + && sub_08039430(&gKirbys[1].base.base.base, scrollLock->base.x, scrollLock->base.y, scrollLock->object->unk1A, scrollLock->object->unk1C, scrollLock->object->unk1E, scrollLock->object->unk20) + && sub_08039430(&gKirbys[2].base.base.base, scrollLock->base.x, scrollLock->base.y, scrollLock->object->unk1A, scrollLock->object->unk1C, scrollLock->object->unk1E, scrollLock->object->unk20) + && sub_08039430(&gKirbys[3].base.base.base, scrollLock->base.x, scrollLock->base.y, scrollLock->object->unk1A, scrollLock->object->unk1C, scrollLock->object->unk1E, scrollLock->object->unk20)) + { + if (!(p->unk4 & 1)) + { + p->unk4 |= 1; + gCurLevelInfo[0].unk1EC = 0; + } + if (!(p->unk4 & 2)) + { + p->unk4 |= 2; + gCurLevelInfo[1].unk1EC = 0; + } + if (!(p->unk4 & 4)) + { + p->unk4 |= 4; + gCurLevelInfo[2].unk1EC = 0; + } + if (!(p->unk4 & 8)) + { + p->unk4 |= 8; + gCurLevelInfo[3].unk1EC = 0; + } + for (i = 0; i < gUnk_0203AD44; ++i) + sub_0811C7D0(p, gKirbys[i].base.base.base.unk56, scrollLock->object->unk22); + } + else + p->unk4 &= ~0xF; + if (gKirbys[i].hp <= 0) // TODO: UB: uninitialized use + sub_0811DB48(scrollLock, i); + if (scrollLock->object->unk4) + { + u32 *pointer = sub_08002888(0, scrollLock->object->unk4, gCurLevelInfo[scrollLock->base.unk56].unk65E); + + if (*pointer) + { + --*pointer; + scrollLock->base.flags |= 0x1000; + } + } + } + else + p->unk4 &= ~0xF; + ++scrollLock->base.counter; +} + +void sub_0811D158(struct Object2 *scrollLock) +{ + struct Unk_0811C9D4 *p = scrollLock->unk8C; + u8 i; + u16 roomId = scrollLock->base.roomId; + u8 unk56 = scrollLock->base.unk56; + + if (!(p->unk0.unk4 & 0x10000000)) + { + if (gKirbys[0].base.base.base.roomId == roomId + && gKirbys[1].base.base.base.roomId == gKirbys[0].base.base.base.roomId + && gKirbys[2].base.base.base.roomId == gKirbys[1].base.base.base.roomId + && gKirbys[3].base.base.base.roomId == gKirbys[2].base.base.base.roomId) + { + if (sub_08039430(&gKirbys[0].base.base.base, scrollLock->base.x, scrollLock->base.y, scrollLock->object->unk1A, scrollLock->object->unk1C, scrollLock->object->unk1E, scrollLock->object->unk20) + && sub_08039430(&gKirbys[1].base.base.base, scrollLock->base.x, scrollLock->base.y, scrollLock->object->unk1A, scrollLock->object->unk1C, scrollLock->object->unk1E, scrollLock->object->unk20) + && sub_08039430(&gKirbys[2].base.base.base, scrollLock->base.x, scrollLock->base.y, scrollLock->object->unk1A, scrollLock->object->unk1C, scrollLock->object->unk1E, scrollLock->object->unk20) + && sub_08039430(&gKirbys[3].base.base.base, scrollLock->base.x, scrollLock->base.y, scrollLock->object->unk1A, scrollLock->object->unk1C, scrollLock->object->unk1E, scrollLock->object->unk20)) + { + if (!(p->unk0.unk4 & 1)) + { + p->unk0.unk4 |= 1; + gCurLevelInfo[0].unk1EC = 0; + } + if (!(p->unk0.unk4 & 2)) + { + p->unk0.unk4 |= 2; + gCurLevelInfo[1].unk1EC = 0; + } + if (!(p->unk0.unk4 & 4)) + { + p->unk0.unk4 |= 4; + gCurLevelInfo[2].unk1EC = 0; + } + if (!(p->unk0.unk4 & 8)) + { + p->unk0.unk4 |= 8; + gCurLevelInfo[3].unk1EC = 0; + } + for (i = 0; i < gUnk_0203AD44; ++i) + sub_0811C7D0(&p->unk0, gKirbys[i].base.base.base.unk56, scrollLock->object->unk22); + p->unk0.unk4 |= 0x10000000; + } + else + p->unk0.unk4 &= ~0xF; + if (gKirbys[i].hp <= 0) // TODO: UB: uninitialized use + sub_0811DB48(scrollLock, i); + if (scrollLock->object->unk4) + { + u32 *pointer = sub_08002888(0, scrollLock->object->unk4, gCurLevelInfo[scrollLock->base.unk56].unk65E); + + if (*pointer) + { + --*pointer; + scrollLock->base.flags |= 0x1000; + } + } + } + else + p->unk0.unk4 &= ~0xF; + } + else + { + if (p->unk46) + { + gCurLevelInfo[unk56].unk7C += p->unk46; + gCurLevelInfo[unk56].unk84 += p->unk46; + gCurLevelInfo[unk56].unkA0 += p->unk46; + gCurLevelInfo[unk56].unkA8 += p->unk46; + if (p->unk46) + { + if (p->unk46 > 0) + { + if (gCurLevelInfo[unk56].unk84 > p->unk4C) + p->unk46 = 0; + } + else + { + if (gCurLevelInfo[unk56].unk7C < 0x800) + p->unk46 = 0; + } + } + } + if (p->unk4A) + { + gCurLevelInfo[unk56].unk80 += p->unk4A; + gCurLevelInfo[unk56].unk88 += p->unk4A; + gCurLevelInfo[unk56].unkA4 += p->unk4A; + gCurLevelInfo[unk56].unkAC += p->unk4A; + if (p->unk4A) + { + if (p->unk4A > 0) + { + if (gCurLevelInfo[unk56].unk88 > p->unk50) + p->unk4A = 0; + } + else + { + if (gCurLevelInfo[unk56].unk80 < 0x800) + p->unk4A = 0; + } + } + } + if (!p->unk46 && !p->unk4A) + { + if (scrollLock->object->unk4) + { + u32 *pointer = sub_08002888(0, scrollLock->object->unk4, gCurLevelInfo[scrollLock->base.unk56].unk65E); + + if (*pointer) + { + --*pointer; + scrollLock->base.flags |= 0x1000; + } + } + } + } + ++scrollLock->base.counter; +} diff --git a/src/shadow_kirby.c b/src/shadow_kirby.c index 7e7a3fa..7e4e039 100644 --- a/src/shadow_kirby.c +++ b/src/shadow_kirby.c @@ -110,7 +110,7 @@ static void sub_08023990(struct Object2 *sk) sk->base.flags |= 4; if (!(sk->kirby3->base.base.base.unkC & 0x8000) && sk->base.roomId == sk->kirby3->base.base.base.roomId - && sub_08039430(&sk->kirby3->base.base, + && sub_08039430(&sk->kirby3->base.base.base, sk->base.x, sk->base.y, sk->object->unk1A, sk->object->unk1C, sk->object->unk1E, sk->object->unk20)) diff --git a/src/wiz.c b/src/wiz.c index 1a98899..9d45066 100644 --- a/src/wiz.c +++ b/src/wiz.c @@ -154,7 +154,7 @@ static void sub_080E7EBC(struct Object2 *wiz) wiz->base.flags |= 4; if (!(wiz->kirby3->base.base.base.unkC & 0x8000) && wiz->base.roomId == wiz->kirby3->base.base.base.roomId - && sub_08039430(&wiz->kirby3->base.base, + && sub_08039430(&wiz->kirby3->base.base.base, wiz->base.x, wiz->base.y, wiz->object->unk1A, wiz->object->unk1C, wiz->object->unk1E, wiz->object->unk20))