decompiled up to sub_81C13B0

This commit is contained in:
U-User-PC\User 2017-10-03 15:42:28 -04:00
parent 40eb03542b
commit 0a88d1042a
2 changed files with 502 additions and 806 deletions

View File

@ -5,481 +5,6 @@
.text
thumb_func_start sub_81C1070
sub_81C1070: @ 81C1070
push {r4-r7,lr}
mov r7, r9
mov r6, r8
push {r6,r7}
adds r7, r0, 0
adds r4, r1, 0
mov r8, r2
lsls r4, 24
lsrs r4, 24
movs r0, 0x5
bl PlaySE
mov r0, r8
ldrb r6, [r0]
movs r2, 0
lsls r4, 24
asrs r4, 24
mov r12, r4
movs r1, 0
ldrsh r4, [r7, r1]
ldrb r0, [r7]
lsls r3, r0, 24
_081C109C:
lsls r0, r6, 24
asrs r0, 24
add r0, r12
lsls r0, 24
lsrs r6, r0, 24
asrs r0, 24
cmp r0, r4
ble _081C10B0
movs r6, 0
b _081C10B6
_081C10B0:
cmp r0, 0
bge _081C10B6
lsrs r6, r3, 24
_081C10B6:
lsls r0, r6, 24
asrs r1, r0, 24
mov r9, r0
cmp r1, 0x4
bne _081C10C2
b _081C11CC
_081C10C2:
ldr r0, =gUnknown_0203CF1C
ldr r0, [r0]
lsls r1, 1
adds r0, 0x84
adds r0, r1
ldrh r5, [r0]
cmp r5, 0
bne _081C10E2
lsls r0, r2, 24
movs r1, 0x80
lsls r1, 17
adds r0, r1
lsrs r2, r0, 24
asrs r0, 24
cmp r0, 0x3
ble _081C109C
_081C10E2:
adds r0, r5, 0
bl sub_81C240C
movs r0, 0x1
bl schedule_bg_copy_tilemap_to_vram
movs r0, 0x2
bl schedule_bg_copy_tilemap_to_vram
adds r0, r5, 0
bl sub_81C3E9C
mov r1, r8
ldrb r0, [r1]
cmp r0, 0x4
bne _081C1110
ldr r0, =gUnknown_0203CF1C
ldr r0, [r0]
ldr r1, =0x000040c4
adds r0, r1
ldrh r0, [r0]
cmp r0, 0
beq _081C1118
_081C1110:
movs r1, 0x2
ldrsh r0, [r7, r1]
cmp r0, 0x1
bne _081C115E
_081C1118:
movs r0, 0x13
bl ClearWindowTilemap
ldr r2, =gSprites
ldr r0, =gUnknown_0203CF1C
ldr r0, [r0]
ldr r1, =0x000040d5
adds r0, r1
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r2
adds r0, 0x3E
ldrb r0, [r0]
lsls r0, 29
cmp r0, 0
blt _081C1142
movs r0, 0xD
bl ClearWindowTilemap
_081C1142:
movs r0, 0
bl schedule_bg_copy_tilemap_to_vram
movs r4, 0x3
negs r4, r4
movs r0, 0x9
adds r1, r4, 0
bl sub_81C1DA4
movs r0, 0x9
adds r1, r4, 0
adds r2, r5, 0
bl sub_81C1EFC
_081C115E:
mov r1, r8
ldrb r0, [r1]
cmp r0, 0x4
beq _081C11A0
mov r1, r9
asrs r0, r1, 24
cmp r0, 0x4
bne _081C11A0
ldr r0, =gUnknown_0203CF1C
ldr r0, [r0]
ldr r1, =0x000040c4
adds r0, r1
ldrh r0, [r0]
cmp r0, 0
bne _081C11A0
movs r0, 0xE
bl ClearWindowTilemap
movs r0, 0xF
bl ClearWindowTilemap
movs r0, 0
bl schedule_bg_copy_tilemap_to_vram
movs r0, 0
movs r1, 0x3
bl sub_81C1DA4
movs r0, 0
movs r1, 0x3
movs r2, 0
bl sub_81C1EFC
_081C11A0:
mov r0, r8
strb r6, [r0]
ldr r0, =gUnknown_0203CF1C
ldr r0, [r0]
ldr r1, =0x000040c6
adds r0, r1
cmp r8, r0
bne _081C11E0
movs r0, 0x8
bl sub_81C4D18
b _081C11E6
.pool
_081C11CC:
ldr r0, =gUnknown_0203CF1C
ldr r0, [r0]
ldr r1, =0x000040c4
adds r0, r1
ldrh r5, [r0]
b _081C10E2
.pool
_081C11E0:
movs r0, 0x12
bl sub_81C4D18
_081C11E6:
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_81C1070
thumb_func_start sub_81C11F4
sub_81C11F4: @ 81C11F4
push {r4,r5,lr}
lsls r0, 24
lsrs r5, r0, 24
movs r0, 0x8
bl sub_81C4C60
movs r0, 0x6
bl ClearWindowTilemap
movs r0, 0x5
bl PutWindowTilemap
movs r0, 0
bl sub_81C3E9C
ldr r4, =gUnknown_0203CF1C
ldr r0, [r4]
ldr r1, =0x000020bc
adds r0, r1
movs r1, 0x3
movs r2, 0x1
bl sub_81C2194
ldr r0, [r4]
ldr r1, =0x000030bc
adds r0, r1
movs r1, 0x1
movs r2, 0x1
bl sub_81C2194
bl sub_81C4064
ldr r0, [r4]
ldr r1, =0x000040c6
adds r0, r1
ldrb r0, [r0]
cmp r0, 0x4
beq _081C125E
movs r0, 0xE
bl ClearWindowTilemap
movs r0, 0xF
bl ClearWindowTilemap
movs r0, 0
movs r1, 0x3
bl sub_81C1DA4
movs r0, 0
movs r1, 0x3
movs r2, 0
bl sub_81C1EFC
_081C125E:
movs r0, 0
bl schedule_bg_copy_tilemap_to_vram
movs r0, 0x1
bl schedule_bg_copy_tilemap_to_vram
movs r0, 0x2
bl schedule_bg_copy_tilemap_to_vram
ldr r0, =gTasks
lsls r1, r5, 2
adds r1, r5
lsls r1, 3
adds r1, r0
ldr r0, =sub_81C0510
str r0, [r1]
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_81C11F4
thumb_func_start sub_81C129C
sub_81C129C: @ 81C129C
push {r4,lr}
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
ldr r0, =gUnknown_0203CF1C
ldr r0, [r0]
ldr r2, =0x000040c6
adds r1, r0, r2
ldrb r1, [r1]
adds r2, 0x1
adds r0, r2
strb r1, [r0]
movs r0, 0x1
bl sub_81C4C84
movs r0, 0x12
bl sub_81C4AF8
ldr r1, =gTasks
lsls r0, r4, 2
adds r0, r4
lsls r0, 3
adds r0, r1
ldr r1, =sub_81C12E4
str r1, [r0]
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_81C129C
thumb_func_start sub_81C12E4
sub_81C12E4: @ 81C12E4
push {r4-r6,lr}
lsls r0, 24
lsrs r5, r0, 24
adds r6, r5, 0
lsls r0, r5, 2
adds r0, r5
lsls r0, 3
ldr r1, =gTasks + 0x8
adds r4, r0, r1
bl sub_81221EC
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
beq _081C13AA
ldr r0, =gMain
ldrh r1, [r0, 0x2E]
movs r0, 0x40
ands r0, r1
cmp r0, 0
beq _081C1338
movs r0, 0x3
strh r0, [r4]
movs r1, 0x1
negs r1, r1
ldr r0, =gUnknown_0203CF1C
ldr r2, [r0]
ldr r0, =0x000040c7
adds r2, r0
adds r0, r4, 0
bl sub_81C1070
b _081C13AA
.pool
_081C1338:
movs r0, 0x80
ands r0, r1
cmp r0, 0
beq _081C1360
movs r0, 0x3
strh r0, [r4]
ldr r0, =gUnknown_0203CF1C
ldr r2, [r0]
ldr r0, =0x000040c7
adds r2, r0
adds r0, r4, 0
movs r1, 0x1
bl sub_81C1070
b _081C13AA
.pool
_081C1360:
movs r0, 0x1
ands r0, r1
cmp r0, 0
beq _081C139A
ldr r0, =gUnknown_0203CF1C
ldr r0, [r0]
ldr r2, =0x000040c6
adds r1, r0, r2
adds r2, 0x1
adds r0, r2
ldrb r1, [r1]
ldrb r0, [r0]
cmp r1, r0
bne _081C1390
adds r0, r5, 0
movs r1, 0
bl sub_81C13B0
b _081C13AA
.pool
_081C1390:
adds r0, r5, 0
movs r1, 0x1
bl sub_81C13B0
b _081C13AA
_081C139A:
movs r0, 0x2
ands r0, r1
cmp r0, 0
beq _081C13AA
adds r0, r6, 0
movs r1, 0
bl sub_81C13B0
_081C13AA:
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end sub_81C12E4
thumb_func_start sub_81C13B0
sub_81C13B0: @ 81C13B0
push {r4-r7,lr}
adds r4, r1, 0
lsls r0, 24
lsrs r7, r0, 24
lsls r4, 24
lsrs r4, 24
movs r0, 0x5
bl PlaySE
movs r0, 0
bl sub_81C4C84
movs r0, 0x12
bl sub_81C4C60
cmp r4, 0x1
bne _081C1464
ldr r0, =gUnknown_0203CF1C
ldr r3, [r0]
ldr r1, =0x000040bd
adds r0, r3, r1
ldrb r0, [r0]
cmp r0, 0
bne _081C1410
ldr r0, [r3]
ldr r2, =0x000040be
adds r1, r3, r2
ldrb r2, [r1]
movs r1, 0x64
muls r1, r2
adds r0, r1
ldr r4, =0x000040c6
adds r1, r3, r4
ldrb r1, [r1]
adds r4, 0x1
adds r2, r3, r4
ldrb r2, [r2]
bl sub_81C14BC
b _081C1430
.pool
_081C1410:
ldr r0, [r3]
ldr r2, =0x000040be
adds r1, r3, r2
ldrb r2, [r1]
lsls r1, r2, 2
adds r1, r2
lsls r1, 4
adds r0, r1
ldr r4, =0x000040c6
adds r1, r3, r4
ldrb r1, [r1]
adds r4, 0x1
adds r2, r3, r4
ldrb r2, [r2]
bl sub_81C15EC
_081C1430:
ldr r5, =gUnknown_0203CF1C
ldr r0, [r5]
adds r0, 0xC
bl sub_81C0098
ldr r1, [r5]
ldr r6, =0x000040c6
adds r0, r1, r6
ldrb r0, [r0]
ldr r4, =0x000040c7
adds r1, r4
ldrb r1, [r1]
bl sub_81C40A0
ldr r1, [r5]
adds r0, r1, r6
ldrb r0, [r0]
adds r1, r4
ldrb r1, [r1]
bl sub_81C4568
ldr r0, [r5]
adds r4, r0, r4
ldrb r1, [r4]
adds r0, r6
strb r1, [r0]
_081C1464:
ldr r0, =gUnknown_0203CF1C
ldr r1, [r0]
ldr r2, =0x000040c6
adds r0, r1, r2
ldrb r0, [r0]
lsls r0, 1
adds r1, 0x84
adds r1, r0
ldrh r4, [r1]
adds r0, r4, 0
bl sub_81C3E9C
adds r0, r4, 0
bl sub_81C240C
movs r0, 0x1
bl schedule_bg_copy_tilemap_to_vram
movs r0, 0x2
bl schedule_bg_copy_tilemap_to_vram
ldr r1, =gTasks
lsls r0, r7, 2
adds r0, r7
lsls r0, 3
adds r0, r1
ldr r1, =sub_81C0F44
str r1, [r0]
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end sub_81C13B0
thumb_func_start sub_81C14BC
sub_81C14BC: @ 81C14BC
push {r4-r7,lr}

File diff suppressed because it is too large Load Diff