diff options
-rw-r--r-- | arm9/arm9.lsf | 1 | ||||
-rw-r--r-- | arm9/asm/unk_0202F150.s | 959 | ||||
-rw-r--r-- | arm9/global.inc | 9 | ||||
-rw-r--r-- | arm9/src/unk_0202F150_c.c | 417 |
4 files changed, 433 insertions, 953 deletions
diff --git a/arm9/arm9.lsf b/arm9/arm9.lsf index 05a905ee..7aad650f 100644 --- a/arm9/arm9.lsf +++ b/arm9/arm9.lsf @@ -127,6 +127,7 @@ Static arm9 Object unk_0202D8D0.o Object unk_0202DB14.o Object unk_0202E29C.o + Object unk_0202F150_c.o Object unk_0202F150.o Object unk_02031480.o Object unk_02031734.o diff --git a/arm9/asm/unk_0202F150.s b/arm9/asm/unk_0202F150.s index a4efe28d..873f7d0b 100644 --- a/arm9/asm/unk_0202F150.s +++ b/arm9/asm/unk_0202F150.s @@ -5,971 +5,24 @@ .section .bss - .global UNK_021C59F4 -UNK_021C59F4: ; 0x021C59F4 - .space 0x8 .section .data - .global UNK_02105D58 -UNK_02105D58: ; 0x02105D58 - .byte 4, 4 + .text - thumb_func_start FUN_0202F150 -FUN_0202F150: ; 0x0202F150 - push {r4-r6, lr} - add r6, r1, #0x0 - mov r4, #0x0 - ldr r1, _0202F2BC ; =UNK_021C59F4 - cmp r0, #0x0 - strb r4, [r1, #0x0] - beq _0202F25C - bl FUN_02033534 - lsl r0, r0, #0x10 - lsr r0, r0, #0x10 - bl FUN_0202D858 - add r5, r0, #0x1 - ldr r0, _0202F2BC ; =UNK_021C59F4 - ldr r0, [r0, #0x4] - cmp r0, #0x0 - beq _0202F178 - mov r0, #0x1 - pop {r4-r6, pc} -_0202F178: - mov r0, #0xf - bl FUN_02031480 - ldr r1, _0202F2C0 ; =0x0000068C - mov r0, #0xf - bl AllocFromHeap - ldr r1, _0202F2BC ; =UNK_021C59F4 - ldr r2, _0202F2C0 ; =0x0000068C - str r0, [r1, #0x4] - add r1, r4, #0x0 - bl MI_CpuFill8 - ldr r2, _0202F2BC ; =UNK_021C59F4 - ldr r1, _0202F2C4 ; =0x00000658 - ldr r0, [r2, #0x4] - add r6, #0x40 - str r6, [r0, r1] - add r0, r1, #0x0 - ldr r3, [r2, #0x4] - add r6, r4, #0x0 - add r0, #0x25 - strb r6, [r3, r0] - add r0, r1, #0x0 - ldr r3, [r2, #0x4] - mov r6, #0x1b - add r0, #0x26 - strb r6, [r3, r0] - ldr r2, [r2, #0x4] - mov r0, #0xf - ldr r1, [r2, r1] - lsl r1, r1, #0x1 - bl AllocFromHeap - ldr r2, _0202F2BC ; =UNK_021C59F4 - ldr r1, _0202F2C8 ; =0x0000045C - ldr r3, [r2, #0x4] - str r0, [r3, r1] - ldr r2, [r2, #0x4] - ldr r1, _0202F2C4 ; =0x00000658 - mov r0, #0xf - ldr r1, [r2, r1] - bl AllocFromHeap - ldr r2, _0202F2BC ; =UNK_021C59F4 - mov r1, #0x46 - ldr r3, [r2, #0x4] - lsl r1, r1, #0x4 - str r0, [r3, r1] - ldr r2, [r2, #0x4] - ldr r1, _0202F2C4 ; =0x00000658 - mov r0, #0xf - ldr r1, [r2, r1] - mul r1, r5 - bl AllocFromHeap - ldr r2, _0202F2BC ; =UNK_021C59F4 - ldr r1, _0202F2CC ; =0x00000458 - ldr r3, [r2, #0x4] - str r0, [r3, r1] - ldr r2, [r2, #0x4] - ldr r1, _0202F2C4 ; =0x00000658 - mov r0, #0xf - ldr r1, [r2, r1] - mul r1, r5 - bl AllocFromHeap - ldr r1, _0202F2BC ; =UNK_021C59F4 - ldr r2, [r1, #0x4] - ldr r1, _0202F2D0 ; =0x00000454 - str r0, [r2, r1] - bl FUN_02033534 - cmp r0, #0xa - ldr r2, _0202F2D4 ; =0x0000054C - bne _0202F236 - ldr r0, _0202F2BC ; =UNK_021C59F4 - mov r1, #0x64 - ldr r3, [r0, #0x4] - add r0, r3, r2 - sub r2, #0xe8 - add r2, r3, r2 - bl FUN_0202D7D8 - ldr r0, _0202F2BC ; =UNK_021C59F4 - mov r1, #0x32 - ldr r3, [r0, #0x4] - ldr r2, _0202F2D8 ; =0x0000056C - lsl r1, r1, #0x4 - add r0, r3, r2 - sub r2, #0x90 - add r2, r3, r2 - bl FUN_0202D7D8 - b _0202F268 -_0202F236: - ldr r0, _0202F2BC ; =UNK_021C59F4 - mov r1, #0x14 - ldr r3, [r0, #0x4] - add r0, r3, r2 - sub r2, #0xe8 - add r2, r3, r2 - bl FUN_0202D7D8 - ldr r0, _0202F2BC ; =UNK_021C59F4 - add r1, r6, #0x0 - ldr r3, [r0, #0x4] - ldr r2, _0202F2D8 ; =0x0000056C - add r1, #0xfd - add r0, r3, r2 - sub r2, #0x90 - add r2, r3, r2 - bl FUN_0202D7D8 - b _0202F268 -_0202F25C: - ldr r0, [r1, #0x4] - mov r4, #0x1 - cmp r0, #0x0 - bne _0202F268 - bl ErrorHandling -_0202F268: - ldr r2, _0202F2BC ; =UNK_021C59F4 - ldr r1, _0202F2DC ; =0x0000065C - ldr r3, [r2, #0x4] - mov r0, #0x0 - strh r0, [r3, r1] - mov r5, #0xff - add r1, #0x1b -_0202F276: - ldr r3, [r2, #0x4] - add r3, r3, r0 - add r0, r0, #0x1 - strb r5, [r3, r1] - cmp r0, #0x4 - blt _0202F276 - cmp r4, #0x0 - bne _0202F28A - bl FUN_0202F2F0 -_0202F28A: - ldr r0, _0202F2BC ; =UNK_021C59F4 - ldr r1, [r0, #0x4] - ldr r0, _0202F2E0 ; =0x000005F8 - add r0, r1, r0 - bl FUN_020312BC - cmp r4, #0x0 - bne _0202F2AC - mov r1, #0x0 - ldr r0, _0202F2E4 ; =FUN_0202FB20 - add r2, r1, #0x0 - bl FUN_0200CA60 - ldr r1, _0202F2BC ; =UNK_021C59F4 - ldr r2, [r1, #0x4] - ldr r1, _0202F2E8 ; =0x00000548 - str r0, [r2, r1] -_0202F2AC: - ldr r0, _0202F2BC ; =UNK_021C59F4 - mov r2, #0x0 - ldr r1, [r0, #0x4] - ldr r0, _0202F2EC ; =0x00000687 - strb r2, [r1, r0] - mov r0, #0x1 - pop {r4-r6, pc} - nop -_0202F2BC: .word UNK_021C59F4 -_0202F2C0: .word 0x0000068C -_0202F2C4: .word 0x00000658 -_0202F2C8: .word 0x0000045C -_0202F2CC: .word 0x00000458 -_0202F2D0: .word 0x00000454 -_0202F2D4: .word 0x0000054C -_0202F2D8: .word 0x0000056C -_0202F2DC: .word 0x0000065C -_0202F2E0: .word 0x000005F8 -_0202F2E4: .word FUN_0202FB20 -_0202F2E8: .word 0x00000548 -_0202F2EC: .word 0x00000687 - thumb_func_start FUN_0202F2F0 -FUN_0202F2F0: ; 0x0202F2F0 - push {r3-r7, lr} - ldr r3, _0202F54C ; =UNK_021C59F4 - ldr r2, _0202F550 ; =0x0000062C - ldr r1, [r3, #0x4] - mov r0, #0x0 - strb r0, [r1, r2] - ldr r4, [r3, #0x4] - add r1, r2, #0x1 - strb r0, [r4, r1] - add r1, r2, #0x0 - ldr r4, [r3, #0x4] - add r1, #0x53 - strb r0, [r4, r1] - ldr r1, [r3, #0x4] - add r2, #0x54 - strb r0, [r1, r2] - bl FUN_02033534 - lsl r0, r0, #0x10 - lsr r0, r0, #0x10 - bl FUN_0202D858 - add r6, r0, #0x1 - ldr r0, _0202F54C ; =UNK_021C59F4 - ldr r2, _0202F554 ; =0x00000658 - ldr r3, [r0, #0x4] - ldr r0, _0202F558 ; =0x00000458 - mov r1, #0x0 - ldr r0, [r3, r0] - ldr r3, [r3, r2] - add r2, r3, #0x0 - mul r2, r6 - bl MI_CpuFill8 - mov r4, #0x0 - cmp r6, #0x0 - ble _0202F360 - ldr r7, _0202F54C ; =UNK_021C59F4 - add r5, r4, #0x0 -_0202F33E: - ldr r3, [r7, #0x4] - ldr r0, _0202F554 ; =0x00000658 - ldr r1, _0202F558 ; =0x00000458 - ldr r2, [r3, r0] - ldr r0, _0202F55C ; =0x000004E8 - add r0, r3, r0 - ldr r3, [r3, r1] - add r1, r4, #0x0 - mul r1, r2 - add r0, r0, r5 - add r1, r3, r1 - bl FUN_0202D394 - add r4, r4, #0x1 - add r5, #0xc - cmp r4, r6 - blt _0202F33E -_0202F360: - ldr r0, _0202F54C ; =UNK_021C59F4 - ldr r2, _0202F554 ; =0x00000658 - ldr r3, [r0, #0x4] - ldr r0, _0202F560 ; =0x00000454 - mov r1, #0x0 - ldr r0, [r3, r0] - ldr r3, [r3, r2] - add r2, r3, #0x0 - mul r2, r6 - bl MI_CpuFill8 - mov r5, #0x0 - cmp r6, #0x0 - ble _0202F3A2 - ldr r7, _0202F54C ; =UNK_021C59F4 - add r4, r5, #0x0 -_0202F380: - ldr r3, [r7, #0x4] - ldr r0, _0202F554 ; =0x00000658 - ldr r1, _0202F560 ; =0x00000454 - ldr r2, [r3, r0] - ldr r0, _0202F564 ; =0x0000047C - add r0, r3, r0 - ldr r3, [r3, r1] - add r1, r5, #0x0 - mul r1, r2 - add r0, r0, r4 - add r1, r3, r1 - bl FUN_0202D394 - add r5, r5, #0x1 - add r4, #0xc - cmp r5, r6 - blt _0202F380 -_0202F3A2: - ldr r0, _0202F54C ; =UNK_021C59F4 - mov r2, #0x6 - ldr r1, [r0, #0x4] - mov r0, #0xb5 - lsl r0, r0, #0x2 - add r0, r1, r0 - mov r1, #0x0 - lsl r2, r2, #0x6 - bl MI_CpuFill8 - ldr r0, _0202F54C ; =UNK_021C59F4 - mov r1, #0xb5 - ldr r2, [r0, #0x4] - ldr r0, _0202F568 ; =0x000004DC - lsl r1, r1, #0x2 - add r0, r2, r0 - add r1, r2, r1 - mov r2, #0x6 - lsl r2, r2, #0x6 - bl FUN_0202D394 - mov r0, #0xee - add r2, r0, #0x0 - mov r3, #0x85 - ldr r4, _0202F54C ; =UNK_021C59F4 - mov r1, #0x0 - add r2, #0x66 - lsl r3, r3, #0x2 -_0202F3DA: - ldr r5, [r4, #0x4] - add r5, r5, r1 - strb r0, [r5, r2] - ldr r5, [r4, #0x4] - add r5, r5, r1 - add r1, r1, #0x1 - strb r0, [r5, r3] - cmp r1, #0xc0 - blt _0202F3DA - ldr r0, _0202F54C ; =UNK_021C59F4 - mov r2, #0x42 - ldr r0, [r0, #0x4] - mov r1, #0x0 - add r0, #0x4c - lsl r2, r2, #0x2 - bl MI_CpuFill8 - ldr r0, _0202F54C ; =UNK_021C59F4 - mov r2, #0x42 - ldr r1, [r0, #0x4] - ldr r0, _0202F56C ; =0x00000464 - lsl r2, r2, #0x2 - add r0, r1, r0 - add r1, #0x4c - bl FUN_0202D394 - ldr r1, _0202F54C ; =UNK_021C59F4 - mov r2, #0xff - ldr r0, [r1, #0x4] - mov r3, #0x1 - strb r2, [r0, #0x0] - ldr r0, [r1, #0x4] - add r0, #0x26 - strb r2, [r0, #0x0] - mov r2, #0xee -_0202F420: - ldr r0, [r1, #0x4] - strb r2, [r0, r3] - ldr r0, [r1, #0x4] - add r0, r0, r3 - add r0, #0x26 - add r3, r3, #0x1 - strb r2, [r0, #0x0] - cmp r3, #0x26 - blt _0202F420 - ldr r0, _0202F54C ; =UNK_021C59F4 - ldr r2, _0202F554 ; =0x00000658 - ldr r3, [r0, #0x4] - ldr r0, _0202F570 ; =0x0000045C - ldr r2, [r3, r2] - ldr r0, [r3, r0] - mov r1, #0x0 - lsl r2, r2, #0x1 - bl MI_CpuFill8 - ldr r0, _0202F54C ; =UNK_021C59F4 - mov r1, #0x47 - ldr r3, [r0, #0x4] - ldr r2, _0202F554 ; =0x00000658 - lsl r1, r1, #0x4 - add r0, r3, r1 - sub r1, #0x14 - ldr r2, [r3, r2] - ldr r1, [r3, r1] - lsl r2, r2, #0x1 - bl FUN_0202D394 - mov r2, #0x0 - ldr r0, _0202F54C ; =UNK_021C59F4 - ldr r1, _0202F574 ; =0x00000684 - ldr r3, [r0, #0x4] - mov r12, r2 - strb r2, [r3, r1] - ldr r3, [r0, #0x4] - add r1, r1, #0x1 - strb r2, [r3, r1] - add r1, r2, #0x0 - add r7, r2, #0x0 - add r6, r2, #0x0 -_0202F476: - ldr r3, [r0, #0x4] - add r4, r3, r2 - ldr r3, _0202F578 ; =0x0000065F - strb r6, [r4, r3] - ldr r3, [r0, #0x4] - ldr r4, _0202F57C ; =0x00000667 - add r5, r3, r2 - mov r3, #0x1 - strb r3, [r5, r4] - ldr r3, [r0, #0x4] - add r4, #0x8 - add r5, r3, r2 - mov r3, #0x1 - strb r3, [r5, r4] - ldr r4, [r0, #0x4] - mov r3, r12 - add r4, r4, r3 - mov r3, #0x61 - lsl r3, r3, #0x4 - strh r6, [r4, r3] - ldr r3, [r0, #0x4] - mov r4, #0xee - add r5, r3, r1 - ldr r3, _0202F580 ; =0x00000596 - add r2, r2, #0x1 - strb r4, [r5, r3] - ldr r3, [r0, #0x4] - ldr r4, _0202F584 ; =0x0000FFFF - add r5, r3, r1 - ldr r3, _0202F588 ; =0x00000594 - strh r4, [r5, r3] - ldr r3, [r0, #0x4] - add r4, r3, r1 - mov r3, #0x59 - lsl r3, r3, #0x4 - str r6, [r4, r3] - ldr r3, [r0, #0x4] - add r4, r3, r1 - ldr r3, _0202F58C ; =0x0000058C - add r1, #0xc - str r6, [r4, r3] - ldr r3, [r0, #0x4] - add r4, r3, r7 - ldr r3, _0202F590 ; =0x00000638 - add r7, r7, #0x4 - str r6, [r4, r3] - mov r3, r12 - add r3, r3, #0x2 - mov r12, r3 - cmp r2, #0x8 - blt _0202F476 - ldr r1, _0202F54C ; =UNK_021C59F4 - ldr r0, _0202F594 ; =0x00000634 - ldr r2, [r1, #0x4] - sub r3, r0, #0x4 - str r6, [r2, r0] - ldr r4, [r1, #0x4] - mov r2, #0x1 - str r2, [r4, r3] - add r3, r0, #0x0 - ldr r4, [r1, #0x4] - sub r3, #0x3e - mov r2, #0xee - strb r2, [r4, r3] - add r3, r0, #0x0 - ldr r4, [r1, #0x4] - ldr r2, _0202F584 ; =0x0000FFFF - sub r3, #0x40 - strh r2, [r4, r3] - add r2, r0, #0x0 - ldr r3, [r1, #0x4] - sub r2, #0x44 - str r6, [r3, r2] - add r2, r0, #0x0 - ldr r3, [r1, #0x4] - sub r2, #0x48 - str r6, [r3, r2] - add r3, r0, #0x0 - ldr r4, [r1, #0x4] - add r3, #0x4e - mov r2, #0x1 - strb r2, [r4, r3] - add r3, r0, #0x0 - ldr r4, [r1, #0x4] - add r3, #0x4f - strb r2, [r4, r3] - ldr r2, _0202F598 ; =UNK_02105D58 - mov r3, #0x4 - strb r3, [r2, #0x1] - strb r3, [r2, #0x0] - ldr r1, [r1, #0x4] - sub r0, #0xe8 - add r0, r1, r0 - bl FUN_0202D804 - ldr r0, _0202F54C ; =UNK_021C59F4 - ldr r1, [r0, #0x4] - ldr r0, _0202F59C ; =0x0000056C - add r0, r1, r0 - bl FUN_0202D804 - ldr r0, _0202F54C ; =UNK_021C59F4 - mov r2, #0x0 - ldr r1, [r0, #0x4] - ldr r0, _0202F5A0 ; =0x00000688 - strb r2, [r1, r0] - pop {r3-r7, pc} - .balign 4 -_0202F54C: .word UNK_021C59F4 -_0202F550: .word 0x0000062C -_0202F554: .word 0x00000658 -_0202F558: .word 0x00000458 -_0202F55C: .word 0x000004E8 -_0202F560: .word 0x00000454 -_0202F564: .word 0x0000047C -_0202F568: .word 0x000004DC -_0202F56C: .word 0x00000464 -_0202F570: .word 0x0000045C -_0202F574: .word 0x00000684 -_0202F578: .word 0x0000065F -_0202F57C: .word 0x00000667 -_0202F580: .word 0x00000596 -_0202F584: .word 0x0000FFFF -_0202F588: .word 0x00000594 -_0202F58C: .word 0x0000058C -_0202F590: .word 0x00000638 -_0202F594: .word 0x00000634 -_0202F598: .word UNK_02105D58 -_0202F59C: .word 0x0000056C -_0202F5A0: .word 0x00000688 - thumb_func_start FUN_0202F5A4 -FUN_0202F5A4: ; 0x0202F5A4 - push {r3-r7, lr} - ldr r1, _0202F7D4 ; =UNK_021C59F4 - ldr r0, _0202F7D8 ; =0x0000062C - ldr r2, [r1, #0x4] - mov r3, #0x0 - strb r3, [r2, r0] - ldr r1, [r1, #0x4] - add r0, r0, #0x1 - strb r3, [r1, r0] - bl FUN_02033534 - lsl r0, r0, #0x10 - lsr r0, r0, #0x10 - bl FUN_0202D858 - add r6, r0, #0x1 - ldr r0, _0202F7D4 ; =UNK_021C59F4 - ldr r2, _0202F7DC ; =0x00000658 - ldr r3, [r0, #0x4] - ldr r0, _0202F7E0 ; =0x00000458 - mov r1, #0x0 - ldr r0, [r3, r0] - ldr r3, [r3, r2] - add r2, r3, #0x0 - mul r2, r6 - bl MI_CpuFill8 - mov r4, #0x0 - cmp r6, #0x0 - ble _0202F606 - ldr r7, _0202F7D4 ; =UNK_021C59F4 - add r5, r4, #0x0 -_0202F5E4: - ldr r3, [r7, #0x4] - ldr r0, _0202F7DC ; =0x00000658 - ldr r1, _0202F7E0 ; =0x00000458 - ldr r2, [r3, r0] - ldr r0, _0202F7E4 ; =0x000004E8 - add r0, r3, r0 - ldr r3, [r3, r1] - add r1, r4, #0x0 - mul r1, r2 - add r0, r0, r5 - add r1, r3, r1 - bl FUN_0202D394 - add r4, r4, #0x1 - add r5, #0xc - cmp r4, r6 - blt _0202F5E4 -_0202F606: - ldr r0, _0202F7D4 ; =UNK_021C59F4 - ldr r2, _0202F7DC ; =0x00000658 - ldr r3, [r0, #0x4] - ldr r0, _0202F7E8 ; =0x00000454 - mov r1, #0x0 - ldr r0, [r3, r0] - ldr r3, [r3, r2] - add r2, r3, #0x0 - mul r2, r6 - bl MI_CpuFill8 - mov r5, #0x0 - cmp r6, #0x0 - ble _0202F648 - ldr r7, _0202F7D4 ; =UNK_021C59F4 - add r4, r5, #0x0 -_0202F626: - ldr r3, [r7, #0x4] - ldr r0, _0202F7DC ; =0x00000658 - ldr r1, _0202F7E8 ; =0x00000454 - ldr r2, [r3, r0] - ldr r0, _0202F7EC ; =0x0000047C - add r0, r3, r0 - ldr r3, [r3, r1] - add r1, r5, #0x0 - mul r1, r2 - add r0, r0, r4 - add r1, r3, r1 - bl FUN_0202D394 - add r5, r5, #0x1 - add r4, #0xc - cmp r5, r6 - blt _0202F626 -_0202F648: - ldr r0, _0202F7D4 ; =UNK_021C59F4 - mov r2, #0x6 - ldr r1, [r0, #0x4] - mov r0, #0xb5 - lsl r0, r0, #0x2 - add r0, r1, r0 - mov r1, #0x0 - lsl r2, r2, #0x6 - bl MI_CpuFill8 - ldr r0, _0202F7D4 ; =UNK_021C59F4 - mov r1, #0xb5 - ldr r2, [r0, #0x4] - ldr r0, _0202F7F0 ; =0x000004DC - lsl r1, r1, #0x2 - add r0, r2, r0 - add r1, r2, r1 - mov r2, #0x6 - lsl r2, r2, #0x6 - bl FUN_0202D394 - mov r0, #0xee - add r2, r0, #0x0 - mov r3, #0x85 - ldr r4, _0202F7D4 ; =UNK_021C59F4 - mov r1, #0x0 - add r2, #0x66 - lsl r3, r3, #0x2 -_0202F680: - ldr r5, [r4, #0x4] - add r5, r5, r1 - strb r0, [r5, r2] - ldr r5, [r4, #0x4] - add r5, r5, r1 - add r1, r1, #0x1 - strb r0, [r5, r3] - cmp r1, #0xc0 - blt _0202F680 - ldr r0, _0202F7D4 ; =UNK_021C59F4 - mov r2, #0x42 - ldr r0, [r0, #0x4] - mov r1, #0x0 - add r0, #0x4c - lsl r2, r2, #0x2 - bl MI_CpuFill8 - ldr r0, _0202F7D4 ; =UNK_021C59F4 - mov r2, #0x42 - ldr r1, [r0, #0x4] - ldr r0, _0202F7F4 ; =0x00000464 - lsl r2, r2, #0x2 - add r0, r1, r0 - add r1, #0x4c - bl FUN_0202D394 - ldr r1, _0202F7D4 ; =UNK_021C59F4 - mov r2, #0xff - ldr r0, [r1, #0x4] - mov r3, #0x1 - strb r2, [r0, #0x0] - ldr r0, [r1, #0x4] - add r0, #0x26 - strb r2, [r0, #0x0] - mov r2, #0xee -_0202F6C6: - ldr r0, [r1, #0x4] - strb r2, [r0, r3] - ldr r0, [r1, #0x4] - add r0, r0, r3 - add r0, #0x26 - add r3, r3, #0x1 - strb r2, [r0, #0x0] - cmp r3, #0x26 - blt _0202F6C6 - ldr r0, _0202F7D4 ; =UNK_021C59F4 - ldr r2, _0202F7DC ; =0x00000658 - ldr r3, [r0, #0x4] - ldr r0, _0202F7F8 ; =0x0000045C - ldr r2, [r3, r2] - ldr r0, [r3, r0] - mov r1, #0x0 - lsl r2, r2, #0x1 - bl MI_CpuFill8 - ldr r0, _0202F7D4 ; =UNK_021C59F4 - mov r1, #0x47 - ldr r3, [r0, #0x4] - ldr r2, _0202F7DC ; =0x00000658 - lsl r1, r1, #0x4 - add r0, r3, r1 - sub r1, #0x14 - ldr r2, [r3, r2] - ldr r1, [r3, r1] - lsl r2, r2, #0x1 - bl FUN_0202D394 - ldr r0, _0202F7D4 ; =UNK_021C59F4 - mov r3, #0x0 - ldr r2, [r0, #0x4] - ldr r1, _0202F7FC ; =0x00000684 - add r7, r3, #0x0 - strb r3, [r2, r1] - ldr r2, [r0, #0x4] - add r1, r1, #0x1 - strb r3, [r2, r1] - add r1, r3, #0x0 - add r2, r3, #0x0 -_0202F71A: - ldr r4, [r0, #0x4] - add r5, r4, r3 - ldr r4, _0202F800 ; =0x0000065F - strb r7, [r5, r4] - ldr r4, [r0, #0x4] - ldr r5, _0202F804 ; =0x00000667 - add r6, r4, r3 - mov r4, #0x1 - strb r4, [r6, r5] - ldr r4, [r0, #0x4] - add r5, #0x8 - add r6, r4, r3 - mov r4, #0x1 - strb r4, [r6, r5] - ldr r4, [r0, #0x4] - add r3, r3, #0x1 - add r5, r4, r1 - mov r4, #0x61 - lsl r4, r4, #0x4 - strh r7, [r5, r4] - ldr r4, [r0, #0x4] - ldr r5, _0202F808 ; =0x00000596 - add r6, r4, r2 - mov r4, #0xee - strb r4, [r6, r5] - ldr r4, [r0, #0x4] - ldr r5, _0202F80C ; =0x0000FFFF - add r6, r4, r2 - ldr r4, _0202F810 ; =0x00000594 - add r1, r1, #0x2 - strh r5, [r6, r4] - ldr r4, [r0, #0x4] - add r5, r4, r2 - mov r4, #0x59 - lsl r4, r4, #0x4 - str r7, [r5, r4] - ldr r4, [r0, #0x4] - add r5, r4, r2 - ldr r4, _0202F814 ; =0x0000058C - add r2, #0xc - str r7, [r5, r4] - cmp r3, #0x8 - blt _0202F71A - ldr r1, _0202F7D4 ; =UNK_021C59F4 - add r0, r4, #0x0 - ldr r3, [r1, #0x4] - add r0, #0xa4 - mov r2, #0x1 - str r2, [r3, r0] - add r3, r0, #0x0 - ldr r4, [r1, #0x4] - sub r3, #0x3a - mov r2, #0xee - strb r2, [r4, r3] - add r3, r0, #0x0 - ldr r4, [r1, #0x4] - ldr r2, _0202F80C ; =0x0000FFFF - sub r3, #0x3c - strh r2, [r4, r3] - add r2, r0, #0x0 - ldr r3, [r1, #0x4] - sub r2, #0x40 - str r7, [r3, r2] - add r2, r0, #0x0 - ldr r3, [r1, #0x4] - sub r2, #0x44 - str r7, [r3, r2] - add r3, r0, #0x0 - ldr r4, [r1, #0x4] - add r3, #0x52 - mov r2, #0x1 - strb r2, [r4, r3] - add r3, r0, #0x0 - ldr r4, [r1, #0x4] - add r3, #0x53 - strb r2, [r4, r3] - ldr r1, [r1, #0x4] - sub r0, #0xe4 - add r0, r1, r0 - bl FUN_0202D804 - ldr r0, _0202F7D4 ; =UNK_021C59F4 - ldr r1, [r0, #0x4] - ldr r0, _0202F818 ; =0x0000056C - add r0, r1, r0 - bl FUN_0202D804 - ldr r0, _0202F7D4 ; =UNK_021C59F4 - mov r2, #0x0 - ldr r1, [r0, #0x4] - ldr r0, _0202F81C ; =0x00000688 - strb r2, [r1, r0] - pop {r3-r7, pc} - .balign 4 -_0202F7D4: .word UNK_021C59F4 -_0202F7D8: .word 0x0000062C -_0202F7DC: .word 0x00000658 -_0202F7E0: .word 0x00000458 -_0202F7E4: .word 0x000004E8 -_0202F7E8: .word 0x00000454 -_0202F7EC: .word 0x0000047C -_0202F7F0: .word 0x000004DC -_0202F7F4: .word 0x00000464 -_0202F7F8: .word 0x0000045C -_0202F7FC: .word 0x00000684 -_0202F800: .word 0x0000065F -_0202F804: .word 0x00000667 -_0202F808: .word 0x00000596 -_0202F80C: .word 0x0000FFFF -_0202F810: .word 0x00000594 -_0202F814: .word 0x0000058C -_0202F818: .word 0x0000056C -_0202F81C: .word 0x00000688 - thumb_func_start FUN_0202F820 -FUN_0202F820: ; 0x0202F820 - push {r4-r6, lr} - add r5, r0, #0x0 - ldr r0, _0202F8B8 ; =UNK_021C59F4 - ldr r3, _0202F8BC ; =0x0000065F - ldr r1, [r0, #0x4] - mov r2, #0x0 - add r1, r1, r5 - strb r2, [r1, r3] - ldr r4, [r0, #0x4] - mov r1, #0x1 - add r6, r4, r5 - add r4, r3, #0x0 - add r4, #0x8 - strb r1, [r6, r4] - ldr r6, [r0, #0x4] - lsl r4, r5, #0x2 - add r6, r6, r4 - add r4, r3, #0x0 - sub r4, #0x27 - str r2, [r6, r4] - ldr r2, [r0, #0x4] - add r4, r2, r5 - add r2, r3, #0x0 - add r2, #0x10 - strb r1, [r4, r2] - ldr r1, [r0, #0x4] - sub r0, r3, #0x7 - ldr r2, [r1, r0] - ldr r3, _0202F8C0 ; =0x0000047C - mov r0, #0xc - add r4, r5, #0x0 - mul r4, r0 - add r0, r1, r3 - sub r3, #0x28 - ldr r3, [r1, r3] - add r1, r5, #0x0 - mul r1, r2 - add r0, r0, r4 - add r1, r3, r1 - bl FUN_0202D394 - ldr r0, _0202F8B8 ; =UNK_021C59F4 - ldr r3, _0202F8C4 ; =0x000004E8 - ldr r1, [r0, #0x4] - ldr r0, _0202F8C8 ; =0x00000658 - ldr r2, [r1, r0] - add r0, r1, r3 - sub r3, #0x90 - ldr r3, [r1, r3] - add r1, r5, #0x0 - mul r1, r2 - add r0, r0, r4 - add r1, r3, r1 - bl FUN_0202D394 - ldr r3, _0202F8B8 ; =UNK_021C59F4 - ldr r2, _0202F8CC ; =0x00000596 - ldr r0, [r3, #0x4] - mov r1, #0xee - add r0, r0, r4 - strb r1, [r0, r2] - ldr r0, [r3, #0x4] - ldr r5, _0202F8D0 ; =0x0000FFFF - add r1, r0, r4 - sub r0, r2, #0x2 - strh r5, [r1, r0] - ldr r1, [r3, #0x4] - mov r0, #0x0 - add r5, r1, r4 - sub r1, r2, #0x6 - str r0, [r5, r1] - ldr r1, [r3, #0x4] - sub r2, #0xa - add r1, r1, r4 - str r0, [r1, r2] - pop {r4-r6, pc} - .balign 4 -_0202F8B8: .word UNK_021C59F4 -_0202F8BC: .word 0x0000065F -_0202F8C0: .word 0x0000047C -_0202F8C4: .word 0x000004E8 -_0202F8C8: .word 0x00000658 -_0202F8CC: .word 0x00000596 -_0202F8D0: .word 0x0000FFFF - thumb_func_start FUN_0202F8D4 -FUN_0202F8D4: ; 0x0202F8D4 - push {r4-r6, lr} - ldr r4, _0202F908 ; =UNK_021C59F4 - ldr r6, _0202F90C ; =0x00000667 - mov r5, #0x1 -_0202F8DC: - lsl r0, r5, #0x10 - lsr r0, r0, #0x10 - bl FUN_02030E7C - cmp r0, #0x0 - bne _0202F900 - ldr r0, [r4, #0x4] - add r0, r0, r5 - ldrb r0, [r0, r6] - cmp r0, #0x0 - bne _0202F900 - bl FUN_02031280 - cmp r0, #0x0 - bne _0202F900 - add r0, r5, #0x0 - bl FUN_0202F820 -_0202F900: - add r5, r5, #0x1 - cmp r5, #0x8 - blt _0202F8DC - pop {r4-r6, pc} - .balign 4 -_0202F908: .word UNK_021C59F4 -_0202F90C: .word 0x00000667 - thumb_func_start FUN_0202F910 -FUN_0202F910: ; 0x0202F910 - ldr r3, _0202F914 ; =FUN_0202F820 - bx r3 - .balign 4 -_0202F914: .word FUN_0202F820 - thumb_func_start FUN_0202F918 -FUN_0202F918: ; 0x0202F918 - push {r3-r7, lr} - add r5, r0, #0x0 - add r6, r1, #0x0 - add r7, r2, #0x0 - str r3, [sp, #0x0] - mov r4, #0x1 - bl FUN_02033534 - cmp r0, #0x13 - bge _0202F93E - ldr r2, [sp, #0x0] - add r0, r5, #0x0 - add r1, r6, #0x0 - bl FUN_0202E5F8 - add r4, r0, #0x0 - ldr r0, _0202F94C ; =FUN_0202F910 - bl FUN_0202D330 -_0202F93E: - add r0, r5, #0x0 - add r1, r7, #0x0 - bl FUN_0202F150 - add r0, r4, #0x0 - pop {r3-r7, pc} - nop -_0202F94C: .word FUN_0202F910 + + + + + thumb_func_start FUN_0202F950 FUN_0202F950: ; 0x0202F950 diff --git a/arm9/global.inc b/arm9/global.inc index a00970de..2e1926cd 100644 --- a/arm9/global.inc +++ b/arm9/global.inc @@ -8517,3 +8517,12 @@ .extern FUN_02025490 .extern FUN_020254A0 .extern FUN_020254B4 +.extern UNK_021C59F4 +.extern UNK_02105D58 +.extern FUN_0202F150 +.extern FUN_0202F2F0 +.extern FUN_0202F5A4 +.extern FUN_0202F820 +.extern FUN_0202F8D4 +.extern FUN_0202F910 +.extern FUN_0202F918 diff --git a/arm9/src/unk_0202F150_c.c b/arm9/src/unk_0202F150_c.c new file mode 100644 index 00000000..e618469a --- /dev/null +++ b/arm9/src/unk_0202F150_c.c @@ -0,0 +1,417 @@ +#include "global.h" +#include "MI_memory.h" +#include "heap.h" + +struct +{ + u8 unk00; + struct UnkStruct1 *unk04; +} UNK_021C59F4; + +// struct UnkStruct2 { +// u8 unk00; +// u8 unk01; +// }; + +u8 UNK_02105D58 = 4; +u8 UNK_02105D59 = 4; + +extern int FUN_02033534(); +extern u32 FUN_0202D858(u16 param0); +extern void FUN_02031480(u32 param0); +extern void FUN_0202D7D8(u32 *param0, u32 param1, u32 param2); +extern void FUN_0202F2F0(); +extern void FUN_020312BC(u32 param0); +extern void FUN_0202FB20(); + +extern u32 FUN_0200CA60(void (*param0)(), u32 param1, u32 param2); +extern void FUN_0202D394(u32 param0, u32 param1, u32 param2); + +extern void FUN_0202D804(u32 *param0); +extern u32 FUN_02030E7C(u16 param0); + +struct UnkStruct1 +{ + u8 unk000[38]; + u8 unk026[38]; + u8 unk04c[264]; + u8 unk154[192]; + u8 unk214[192]; + u8 unk2D4[384]; + u32 unk454; + u32 unk458; + u32 unk45C; + u32 unk460; + u32 unk464; + u8 unk468[0x8]; + u32 unk470; + u8 unk474[0x8]; + struct + { + u32 unk00; + u32 unk04; + u32 unk08; + } unk47C[8]; + u32 unk4DC; + u8 unk4E0[0x8]; + struct + { + u32 unk00; + u32 unk04; + u32 unk08; + } unk4E8[8]; + u32 unk548; + u8 unk54C[32]; + u8 unk56C[32]; + struct + { + u32 unk00; + u32 unk04; + u16 unk08; + u8 unk0a; + u8 unk0b; + } unk58C[8]; + u32 unk5EC; + u32 unk5F0; + u16 unk5F4; + u8 unk5F6; + u8 unk5F7; + u32 unk5F8; + u8 unk5FC[0x14]; + u16 unk610[8]; + u8 unk620[0xc]; + u8 unk62C; + u8 unk62D; + u8 unk62E[0x2]; + u32 unk630; + u32 unk634; + u32 unk638[8]; + u32 unk658; + u16 unk65C; + u8 unk65E; + u8 unk65F[8]; + u8 unk667[8]; + u8 unk66F[8]; + u8 unk677[4]; + u8 unk67B[0x2]; + u8 unk67D; + u8 unk67E; + u8 unk67F; + u8 unk680; + u8 unk681; + u8 unk682; + u8 unk683; + u8 unk684; + u8 unk685; + u8 unk686; + u8 unk687; + u8 unk688; + u8 unk689[0x3]; +}; + +THUMB_FUNC u32 FUN_0202F150(u32 param0, u32 param1) +{ + u32 r4 = 0; + UNK_021C59F4.unk00 = 0; + if (param0 != 0) + { + u32 res = FUN_0202D858(FUN_02033534()) + 1; + + if (UNK_021C59F4.unk04 != 0) + { + return 1; + } + + FUN_02031480(0xf); + struct UnkStruct1 *ptr = (struct UnkStruct1 *)AllocFromHeap(0xf, 0x68C); + UNK_021C59F4.unk04 = ptr; + MI_CpuFill8(ptr, 0, 0x68C); + + UNK_021C59F4.unk04->unk658 = param1 + 0x40; + UNK_021C59F4.unk04->unk67D = 0; + UNK_021C59F4.unk04->unk67E = 0x1b; + + UNK_021C59F4.unk04->unk45C = AllocFromHeap(0xf, UNK_021C59F4.unk04->unk658 << 1); + + UNK_021C59F4.unk04->unk460 = AllocFromHeap(0xf, UNK_021C59F4.unk04->unk658); + + UNK_021C59F4.unk04->unk458 = AllocFromHeap(0xf, res * UNK_021C59F4.unk04->unk658); + + UNK_021C59F4.unk04->unk454 = AllocFromHeap(0xf, res * UNK_021C59F4.unk04->unk658); + + if (FUN_02033534() == 0xa) + { + FUN_0202D7D8(UNK_021C59F4.unk04->unk54C, 0x64, &UNK_021C59F4.unk04->unk464); + FUN_0202D7D8(UNK_021C59F4.unk04->unk56C, 0x32 << 4, &UNK_021C59F4.unk04->unk4DC); + } + else + { + FUN_0202D7D8(UNK_021C59F4.unk04->unk54C, 0x14, &UNK_021C59F4.unk04->unk464); + FUN_0202D7D8(UNK_021C59F4.unk04->unk56C, 0x1b + 0xfd, &UNK_021C59F4.unk04->unk4DC); + } + } + else + { + + r4 = 1; + if (UNK_021C59F4.unk04 == 0) + { + ErrorHandling(); + } + } + + UNK_021C59F4.unk04->unk65C = 0; + + for (int i = 0; i < 4; i++) + { + UNK_021C59F4.unk04->unk677[i] = 0xff; + } + + if (r4 == 0) + { + FUN_0202F2F0(); + } + + FUN_020312BC(&UNK_021C59F4.unk04->unk5F8); + + if (r4 == 0) + { + u32 res2 = FUN_0200CA60(FUN_0202FB20, 0, 0); + + UNK_021C59F4.unk04->unk548 = res2; + } + + UNK_021C59F4.unk04->unk687 = 0; + + return 1; +} + +THUMB_FUNC void FUN_0202F2F0() +{ + UNK_021C59F4.unk04->unk62C = 0; + UNK_021C59F4.unk04->unk62D = 0; + UNK_021C59F4.unk04->unk67F = 0; + UNK_021C59F4.unk04->unk680 = 0; + + s32 res = FUN_0202D858(FUN_02033534()) + 1; + + MI_CpuFill8(UNK_021C59F4.unk04->unk458, 0, UNK_021C59F4.unk04->unk658 * res); + + int i; + for (i = 0; i < res; i++) + { + FUN_0202D394(&UNK_021C59F4.unk04->unk4E8[i], + UNK_021C59F4.unk04->unk458 + i * UNK_021C59F4.unk04->unk658, + UNK_021C59F4.unk04->unk658); + } + + MI_CpuFill8(UNK_021C59F4.unk04->unk454, 0, UNK_021C59F4.unk04->unk658 * res); + + for (i = 0; i < res; i++) + { + FUN_0202D394(&UNK_021C59F4.unk04->unk47C[i], + UNK_021C59F4.unk04->unk454 + i * UNK_021C59F4.unk04->unk658, + UNK_021C59F4.unk04->unk658); + } + + MI_CpuFill8(&UNK_021C59F4.unk04->unk2D4, 0, 6 << 6); + FUN_0202D394(&UNK_021C59F4.unk04->unk4DC, &UNK_021C59F4.unk04->unk2D4, 6 << 6); + + for (i = 0; i < 0xc0; i++) + { + UNK_021C59F4.unk04->unk154[i] = 0xee; + UNK_021C59F4.unk04->unk214[i] = 0xee; + } + + MI_CpuFill8(&UNK_021C59F4.unk04->unk04c, 0, 0x42 << 2); + FUN_0202D394(&UNK_021C59F4.unk04->unk464, &UNK_021C59F4.unk04->unk04c, 0x42 << 2); + + UNK_021C59F4.unk04->unk000[0] = 0xff; + UNK_021C59F4.unk04->unk026[0] = 0xff; + + for (i = 1; i < 0x26; i++) + { + UNK_021C59F4.unk04->unk000[i] = 0xee; + UNK_021C59F4.unk04->unk026[i] = 0xee; + } + + MI_CpuFill8(UNK_021C59F4.unk04->unk45C, 0, UNK_021C59F4.unk04->unk658 << 1); + + FUN_0202D394( + &UNK_021C59F4.unk04->unk470, UNK_021C59F4.unk04->unk45C, UNK_021C59F4.unk04->unk658 * 2); + + UNK_021C59F4.unk04->unk684 = 0; + UNK_021C59F4.unk04->unk685 = 0; + + for (i = 0; i < 8; i++) + { + UNK_021C59F4.unk04->unk65F[i] = 0; + UNK_021C59F4.unk04->unk667[i] = 1; + UNK_021C59F4.unk04->unk66F[i] = 1; + UNK_021C59F4.unk04->unk610[i] = 0; + + UNK_021C59F4.unk04->unk58C[i].unk0a = 0xee; + UNK_021C59F4.unk04->unk58C[i].unk08 = 0xffff; + UNK_021C59F4.unk04->unk58C[i].unk04 = 0; + UNK_021C59F4.unk04->unk58C[i].unk00 = 0; + + UNK_021C59F4.unk04->unk638[i] = 0; + } + + UNK_021C59F4.unk04->unk634 = 0; + UNK_021C59F4.unk04->unk630 = 1; + UNK_021C59F4.unk04->unk5F6 = 0xee; + UNK_021C59F4.unk04->unk5F4 = 0xffff; + UNK_021C59F4.unk04->unk5F0 = 0; + UNK_021C59F4.unk04->unk5EC = 0; + UNK_021C59F4.unk04->unk682 = 1; + UNK_021C59F4.unk04->unk683 = 1; + + UNK_02105D59 = 4; + UNK_02105D58 = 4; + + FUN_0202D804(UNK_021C59F4.unk04->unk54C); + FUN_0202D804(UNK_021C59F4.unk04->unk56C); + + UNK_021C59F4.unk04->unk688 = 0; +} + +THUMB_FUNC void FUN_0202F5A4() +{ + UNK_021C59F4.unk04->unk62C = 0; + UNK_021C59F4.unk04->unk62D = 0; + + s32 res = FUN_0202D858(FUN_02033534()) + 1; + + MI_CpuFill8(UNK_021C59F4.unk04->unk458, 0, UNK_021C59F4.unk04->unk658 * res); + + int i; + for (i = 0; i < res; i++) + { + FUN_0202D394(&UNK_021C59F4.unk04->unk4E8[i], + UNK_021C59F4.unk04->unk458 + i * UNK_021C59F4.unk04->unk658, + UNK_021C59F4.unk04->unk658); + } + + MI_CpuFill8(UNK_021C59F4.unk04->unk454, 0, UNK_021C59F4.unk04->unk658 * res); + + for (i = 0; i < res; i++) + { + FUN_0202D394(&UNK_021C59F4.unk04->unk47C[i], + UNK_021C59F4.unk04->unk454 + i * UNK_021C59F4.unk04->unk658, + UNK_021C59F4.unk04->unk658); + } + + MI_CpuFill8(&UNK_021C59F4.unk04->unk2D4, 0, 6 << 6); + FUN_0202D394(&UNK_021C59F4.unk04->unk4DC, &UNK_021C59F4.unk04->unk2D4, 6 << 6); + + for (i = 0; i < 0xc0; i++) + { + UNK_021C59F4.unk04->unk154[i] = 0xee; + UNK_021C59F4.unk04->unk214[i] = 0xee; + } + + MI_CpuFill8(&UNK_021C59F4.unk04->unk04c, 0, 0x42 << 2); + FUN_0202D394(&UNK_021C59F4.unk04->unk464, &UNK_021C59F4.unk04->unk04c, 0x42 << 2); + + UNK_021C59F4.unk04->unk000[0] = 0xff; + UNK_021C59F4.unk04->unk026[0] = 0xff; + + for (i = 1; i < 0x26; i++) + { + UNK_021C59F4.unk04->unk000[i] = 0xee; + UNK_021C59F4.unk04->unk026[i] = 0xee; + } + + MI_CpuFill8(UNK_021C59F4.unk04->unk45C, 0, UNK_021C59F4.unk04->unk658 << 1); + FUN_0202D394( + &UNK_021C59F4.unk04->unk470, UNK_021C59F4.unk04->unk45C, UNK_021C59F4.unk04->unk658 * 2); + + UNK_021C59F4.unk04->unk684 = 0; + UNK_021C59F4.unk04->unk685 = 0; + + for (i = 0; i < 8; i++) + { + UNK_021C59F4.unk04->unk65F[i] = 0; + UNK_021C59F4.unk04->unk667[i] = 1; + UNK_021C59F4.unk04->unk66F[i] = 1; + UNK_021C59F4.unk04->unk610[i] = 0; + + UNK_021C59F4.unk04->unk58C[i].unk0a = 0xee; + UNK_021C59F4.unk04->unk58C[i].unk08 = 0xffff; + UNK_021C59F4.unk04->unk58C[i].unk04 = 0; + UNK_021C59F4.unk04->unk58C[i].unk00 = 0; + } + + UNK_021C59F4.unk04->unk630 = 1; + UNK_021C59F4.unk04->unk5F6 = 0xee; + UNK_021C59F4.unk04->unk5F4 = 0xffff; + UNK_021C59F4.unk04->unk5F0 = 0; + UNK_021C59F4.unk04->unk5EC = 0; + UNK_021C59F4.unk04->unk682 = 1; + UNK_021C59F4.unk04->unk683 = 1; + + FUN_0202D804(UNK_021C59F4.unk04->unk54C); + FUN_0202D804(UNK_021C59F4.unk04->unk56C); + + UNK_021C59F4.unk04->unk688 = 0; +} + +THUMB_FUNC void FUN_0202F820(u32 param0) +{ + UNK_021C59F4.unk04->unk65F[param0] = 0; + + UNK_021C59F4.unk04->unk667[param0] = 1; + + UNK_021C59F4.unk04->unk638[param0] = 0; + + UNK_021C59F4.unk04->unk66F[param0] = 1; + + FUN_0202D394(&UNK_021C59F4.unk04->unk47C[param0], + UNK_021C59F4.unk04->unk454 + param0 * UNK_021C59F4.unk04->unk658, + UNK_021C59F4.unk04->unk658); + + FUN_0202D394(&UNK_021C59F4.unk04->unk4E8[param0], + UNK_021C59F4.unk04->unk458 + param0 * UNK_021C59F4.unk04->unk658, + UNK_021C59F4.unk04->unk658); + + UNK_021C59F4.unk04->unk58C[param0].unk0a = 0xee; + UNK_021C59F4.unk04->unk58C[param0].unk08 = 0xffff; + UNK_021C59F4.unk04->unk58C[param0].unk04 = 0; + UNK_021C59F4.unk04->unk58C[param0].unk00 = 0; +} + +extern u32 FUN_02031280(); + +THUMB_FUNC void FUN_0202F8D4() +{ + for (int i = 1; i < 8; i++) + { + if (FUN_02030E7C(i) == 0 && UNK_021C59F4.unk04->unk667[i] == 0 && FUN_02031280() == 0) + { + FUN_0202F820(i); + } + } +} + +THUMB_FUNC void FUN_0202F910(u32 param0) +{ + FUN_0202F820(param0); +} + +extern u32 FUN_0202E5F8(u32 param0, u32 param1, u32 param2); +extern void FUN_0202D330(void (*param0)(u32)); + +THUMB_FUNC u32 FUN_0202F918(u32 param0, u32 param1, u32 param2, u32 param3) +{ + u32 ret = 1; + if (FUN_02033534() < 0x13) + { + ret = FUN_0202E5F8(param0, param1, param3); + FUN_0202D330(FUN_0202F910); + } + + FUN_0202F150(param0, param2); + + return ret; +}
\ No newline at end of file |