mirror of
https://github.com/jiangzhengwenjz/katam.git
synced 2024-11-23 05:00:01 +00:00
finish decompiling code_0801DA58
This commit is contained in:
parent
b6781a0562
commit
29c2b58197
@ -1,858 +0,0 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_0801DC70
|
||||
sub_0801DC70: @ 0x0801DC70
|
||||
push {r4, r5, r6, r7, lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
ldr r4, [sp, #0x18]
|
||||
lsls r0, r0, #0x10
|
||||
lsrs r0, r0, #0x10
|
||||
lsls r2, r2, #0x10
|
||||
lsls r4, r4, #0x10
|
||||
lsrs r4, r4, #0x10
|
||||
mov ip, r4
|
||||
ldr r4, _0801DD14 @ =gUnk_082D7850
|
||||
ldr r5, _0801DD18 @ =0x00000C1C
|
||||
adds r4, r4, r5
|
||||
ldr r7, [r4]
|
||||
ldrh r5, [r7]
|
||||
ldr r4, _0801DD1C @ =gUnk_082DE690
|
||||
mov r8, r4
|
||||
lsrs r2, r2, #0xe
|
||||
adds r4, #2
|
||||
adds r4, r2, r4
|
||||
ldrh r6, [r4]
|
||||
subs r4, r6, #1
|
||||
muls r4, r5, r4
|
||||
lsls r4, r4, #1
|
||||
ldr r5, [r7, #0x18]
|
||||
adds r5, r5, r4
|
||||
add r2, r8
|
||||
ldrh r2, [r2]
|
||||
lsls r4, r2, #1
|
||||
adds r5, r5, r4
|
||||
subs r5, #2
|
||||
mov r8, r5
|
||||
adds r5, r3, #0
|
||||
lsls r1, r1, #0x10
|
||||
asrs r1, r1, #0x10
|
||||
adds r1, #1
|
||||
subs r6, r6, r1
|
||||
add r6, ip
|
||||
subs r2, #1
|
||||
subs r2, r2, r0
|
||||
lsls r2, r2, #0x10
|
||||
lsrs r2, r2, #0x10
|
||||
lsls r6, r6, #0x10
|
||||
lsrs r0, r6, #0x10
|
||||
cmp r0, #0x14
|
||||
bhi _0801DD08
|
||||
movs r3, #0
|
||||
asrs r6, r6, #0xb
|
||||
_0801DCD0:
|
||||
lsls r4, r2, #0x10
|
||||
lsrs r0, r4, #0x10
|
||||
lsls r3, r3, #0x10
|
||||
cmp r0, #0x1e
|
||||
bhi _0801DCF6
|
||||
asrs r2, r4, #0x10
|
||||
adds r2, r6, r2
|
||||
lsls r2, r2, #1
|
||||
adds r2, r2, r5
|
||||
ldrh r0, [r7]
|
||||
mov r1, ip
|
||||
muls r1, r0, r1
|
||||
adds r0, r1, #0
|
||||
asrs r1, r3, #0x10
|
||||
adds r0, r0, r1
|
||||
lsls r0, r0, #1
|
||||
add r0, r8
|
||||
ldrh r0, [r0]
|
||||
strh r0, [r2]
|
||||
_0801DCF6:
|
||||
movs r2, #0x80
|
||||
lsls r2, r2, #9
|
||||
adds r1, r3, r2
|
||||
adds r0, r4, r2
|
||||
lsrs r2, r0, #0x10
|
||||
lsrs r3, r1, #0x10
|
||||
asrs r1, r1, #0x10
|
||||
cmp r1, #3
|
||||
ble _0801DCD0
|
||||
_0801DD08:
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4, r5, r6, r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0801DD14: .4byte gUnk_082D7850
|
||||
_0801DD18: .4byte 0x00000C1C
|
||||
_0801DD1C: .4byte gUnk_082DE690
|
||||
|
||||
thumb_func_start sub_0801DD20
|
||||
sub_0801DD20: @ 0x0801DD20
|
||||
push {r4, r5, r6, r7, lr}
|
||||
mov r7, sl
|
||||
mov r6, sb
|
||||
mov r5, r8
|
||||
push {r5, r6, r7}
|
||||
adds r6, r0, #0
|
||||
adds r4, r1, #0
|
||||
adds r5, r2, #0
|
||||
mov sb, r3
|
||||
lsls r6, r6, #0x10
|
||||
lsrs r6, r6, #0x10
|
||||
lsls r4, r4, #0x10
|
||||
lsrs r4, r4, #0x10
|
||||
lsls r5, r5, #0x10
|
||||
lsrs r5, r5, #0x10
|
||||
ldr r2, _0801DDF0 @ =gUnk_082D7850
|
||||
ldr r1, _0801DDF4 @ =gUnk_082DE698
|
||||
lsls r0, r5, #1
|
||||
adds r0, r0, r1
|
||||
ldrh r0, [r0]
|
||||
lsls r0, r0, #2
|
||||
adds r0, r0, r2
|
||||
ldr r0, [r0]
|
||||
mov r8, r0
|
||||
ldr r0, [r0, #8]
|
||||
ldr r2, [sp, #0x20]
|
||||
lsls r1, r2, #5
|
||||
ldr r2, _0801DDF8 @ =0x06008000
|
||||
adds r1, r1, r2
|
||||
bl LZ77UnCompVram
|
||||
mov r0, r8
|
||||
ldr r0, [r0, #0x18]
|
||||
mov ip, r0
|
||||
ldr r1, _0801DDFC @ =gUnk_082DE690
|
||||
lsls r5, r5, #2
|
||||
adds r0, r1, #2
|
||||
adds r0, r5, r0
|
||||
mvns r4, r4
|
||||
ldrh r0, [r0]
|
||||
adds r4, r4, r0
|
||||
lsls r4, r4, #0x10
|
||||
lsrs r0, r4, #0x10
|
||||
movs r3, #0
|
||||
adds r5, r5, r1
|
||||
mvns r6, r6
|
||||
ldrh r5, [r5]
|
||||
adds r6, r6, r5
|
||||
lsls r6, r6, #0x10
|
||||
mov sl, r6
|
||||
_0801DD84:
|
||||
mov r1, sl
|
||||
lsrs r2, r1, #0x10
|
||||
lsls r0, r0, #0x10
|
||||
lsrs r1, r0, #0x10
|
||||
mov r8, r0
|
||||
lsls r6, r3, #0x10
|
||||
cmp r1, #0x14
|
||||
bhi _0801DDCE
|
||||
movs r5, #0
|
||||
asrs r7, r0, #0xb
|
||||
asrs r4, r6, #0xe
|
||||
_0801DD9A:
|
||||
lsls r3, r2, #0x10
|
||||
lsrs r0, r3, #0x10
|
||||
lsls r2, r5, #0x10
|
||||
cmp r0, #0x1e
|
||||
bhi _0801DDBC
|
||||
asrs r0, r3, #0x10
|
||||
adds r0, r7, r0
|
||||
lsls r0, r0, #1
|
||||
add r0, sb
|
||||
asrs r1, r2, #0x10
|
||||
adds r1, r4, r1
|
||||
lsls r1, r1, #1
|
||||
add r1, ip
|
||||
ldrh r1, [r1]
|
||||
ldr r5, [sp, #0x20]
|
||||
adds r1, r1, r5
|
||||
strh r1, [r0]
|
||||
_0801DDBC:
|
||||
movs r0, #0x80
|
||||
lsls r0, r0, #9
|
||||
adds r1, r2, r0
|
||||
adds r0, r3, r0
|
||||
lsrs r2, r0, #0x10
|
||||
lsrs r5, r1, #0x10
|
||||
asrs r1, r1, #0x10
|
||||
cmp r1, #3
|
||||
ble _0801DD9A
|
||||
_0801DDCE:
|
||||
movs r2, #0x80
|
||||
lsls r2, r2, #9
|
||||
adds r1, r6, r2
|
||||
adds r0, r2, #0
|
||||
add r0, r8
|
||||
lsrs r0, r0, #0x10
|
||||
lsrs r3, r1, #0x10
|
||||
asrs r1, r1, #0x10
|
||||
cmp r1, #4
|
||||
ble _0801DD84
|
||||
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
|
||||
_0801DDF0: .4byte gUnk_082D7850
|
||||
_0801DDF4: .4byte gUnk_082DE698
|
||||
_0801DDF8: .4byte 0x06008000
|
||||
_0801DDFC: .4byte gUnk_082DE690
|
||||
|
||||
thumb_func_start sub_0801DE00
|
||||
sub_0801DE00: @ 0x0801DE00
|
||||
push {r4, r5, r6, r7, lr}
|
||||
mov r7, sl
|
||||
mov r6, sb
|
||||
mov r5, r8
|
||||
push {r5, r6, r7}
|
||||
sub sp, #4
|
||||
adds r5, r0, #0
|
||||
movs r0, #0xc0
|
||||
lsls r0, r0, #2
|
||||
mov r8, r0
|
||||
ldrh r0, [r5, #0x24]
|
||||
lsls r0, r0, #5
|
||||
ldrh r1, [r5, #0x22]
|
||||
adds r0, r0, r1
|
||||
lsls r0, r0, #1
|
||||
ldr r1, [r5, #0xc]
|
||||
adds r1, r1, r0
|
||||
mov sl, r1
|
||||
ldrh r1, [r5, #0x30]
|
||||
lsrs r1, r1, #3
|
||||
ldrh r0, [r5, #0x32]
|
||||
lsrs r0, r0, #3
|
||||
movs r4, #0
|
||||
ldr r2, _0801DEBC @ =gUnk_082DE690
|
||||
mov sb, r2
|
||||
lsls r7, r1, #0x10
|
||||
lsls r6, r0, #0x10
|
||||
_0801DE36:
|
||||
adds r0, r5, #0
|
||||
adds r0, #0xdc
|
||||
ldrh r0, [r0]
|
||||
cmp r4, r0
|
||||
beq _0801DE8A
|
||||
ldr r1, _0801DEC0 @ =gUnk_082DE69A
|
||||
lsls r0, r4, #1
|
||||
adds r0, r0, r1
|
||||
ldrb r1, [r0]
|
||||
movs r0, #2
|
||||
movs r2, #0
|
||||
bl sub_08002888
|
||||
ldr r0, [r0]
|
||||
cmp r0, #0
|
||||
bne _0801DEA0
|
||||
lsls r0, r4, #2
|
||||
mov r2, sb
|
||||
adds r1, r0, r2
|
||||
ldr r2, _0801DEC4 @ =gUnk_082DE692
|
||||
adds r0, r0, r2
|
||||
ldrh r3, [r0]
|
||||
movs r0, #0
|
||||
ldrsh r2, [r1, r0]
|
||||
adds r0, r2, #3
|
||||
asrs r1, r7, #0x10
|
||||
cmp r0, r1
|
||||
ble _0801DEA0
|
||||
adds r1, #0x1e
|
||||
subs r0, r2, #1
|
||||
cmp r1, r0
|
||||
ble _0801DEA0
|
||||
lsls r0, r3, #0x10
|
||||
asrs r2, r0, #0x10
|
||||
adds r0, r2, #4
|
||||
asrs r1, r6, #0x10
|
||||
cmp r0, r1
|
||||
ble _0801DEA0
|
||||
adds r1, #0x14
|
||||
subs r0, r2, #1
|
||||
cmp r1, r0
|
||||
ble _0801DEA0
|
||||
_0801DE8A:
|
||||
movs r1, #0x14
|
||||
rsbs r1, r1, #0
|
||||
add r8, r1
|
||||
mov r2, r8
|
||||
str r2, [sp]
|
||||
asrs r0, r7, #0x10
|
||||
asrs r1, r6, #0x10
|
||||
adds r2, r4, #0
|
||||
mov r3, sl
|
||||
bl sub_0801DD20
|
||||
_0801DEA0:
|
||||
adds r0, r4, #1
|
||||
lsls r0, r0, #0x10
|
||||
lsrs r4, r0, #0x10
|
||||
cmp r4, #0
|
||||
beq _0801DE36
|
||||
add sp, #4
|
||||
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
|
||||
_0801DEBC: .4byte gUnk_082DE690
|
||||
_0801DEC0: .4byte gUnk_082DE69A
|
||||
_0801DEC4: .4byte gUnk_082DE692
|
||||
|
||||
thumb_func_start sub_0801DEC8
|
||||
sub_0801DEC8: @ 0x0801DEC8
|
||||
push {r4, r5, r6, lr}
|
||||
adds r4, r0, #0
|
||||
adds r5, r4, #0
|
||||
adds r5, #0xd0
|
||||
ldr r0, [r5]
|
||||
cmp r0, #0
|
||||
beq _0801DEDE
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x80
|
||||
bl sub_0815604C
|
||||
_0801DEDE:
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x80
|
||||
bl sub_08155128
|
||||
cmp r0, #0
|
||||
bne _0801DEF8
|
||||
str r0, [r5]
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x90
|
||||
ldr r1, _0801DF2C @ =0x0000FFC0
|
||||
strh r1, [r0]
|
||||
adds r0, #2
|
||||
strh r1, [r0]
|
||||
_0801DEF8:
|
||||
adds r6, r4, #0
|
||||
adds r6, #0xd4
|
||||
ldr r0, [r6]
|
||||
adds r5, r4, #0
|
||||
adds r5, #0xa8
|
||||
cmp r0, #0
|
||||
beq _0801DF0C
|
||||
adds r0, r5, #0
|
||||
bl sub_0815604C
|
||||
_0801DF0C:
|
||||
adds r0, r5, #0
|
||||
bl sub_08155128
|
||||
cmp r0, #0
|
||||
bne _0801DF24
|
||||
str r0, [r6]
|
||||
adds r0, r4, #0
|
||||
adds r0, #0xb8
|
||||
ldr r1, _0801DF2C @ =0x0000FFC0
|
||||
strh r1, [r0]
|
||||
adds r0, #2
|
||||
strh r1, [r0]
|
||||
_0801DF24:
|
||||
pop {r4, r5, r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0801DF2C: .4byte 0x0000FFC0
|
||||
|
||||
thumb_func_start sub_0801DF30
|
||||
sub_0801DF30: @ 0x0801DF30
|
||||
push {r4, r5, r6, r7, lr}
|
||||
adds r7, r0, #0
|
||||
adds r4, r7, #0
|
||||
adds r4, #0xe2
|
||||
ldrh r1, [r4]
|
||||
lsls r0, r1, #2
|
||||
adds r0, r0, r1
|
||||
lsls r0, r0, #3
|
||||
adds r0, #0x80
|
||||
adds r0, r7, r0
|
||||
adds r2, r7, #0
|
||||
adds r2, #0x88
|
||||
ldr r1, [r2]
|
||||
ldr r3, _0801DFD4 @ =0xFFFBFFFF
|
||||
ands r1, r3
|
||||
str r1, [r2]
|
||||
adds r2, #0x28
|
||||
ldr r1, [r2]
|
||||
ands r1, r3
|
||||
str r1, [r2]
|
||||
ldrh r1, [r4]
|
||||
lsls r1, r1, #2
|
||||
adds r2, #0x20
|
||||
adds r2, r2, r1
|
||||
movs r1, #1
|
||||
str r1, [r2]
|
||||
movs r6, #0
|
||||
strb r6, [r0, #0x1a]
|
||||
movs r1, #0xff
|
||||
strb r1, [r0, #0x1b]
|
||||
ldr r3, _0801DFD8 @ =gUnk_082DE690
|
||||
adds r5, r7, #0
|
||||
adds r5, #0xdc
|
||||
ldrh r2, [r5]
|
||||
lsls r2, r2, #2
|
||||
adds r1, r2, r3
|
||||
ldrh r1, [r1]
|
||||
lsls r1, r1, #3
|
||||
ldr r4, _0801DFDC @ =gUnk_082DE694
|
||||
adds r2, r2, r4
|
||||
ldrh r2, [r2]
|
||||
subs r1, r1, r2
|
||||
adds r1, #8
|
||||
strh r1, [r0, #0x10]
|
||||
ldrh r1, [r5]
|
||||
lsls r1, r1, #2
|
||||
adds r3, #2
|
||||
adds r3, r1, r3
|
||||
ldrh r2, [r3]
|
||||
lsls r2, r2, #3
|
||||
adds r4, #2
|
||||
adds r1, r1, r4
|
||||
ldrh r1, [r1]
|
||||
subs r2, r2, r1
|
||||
adds r3, r7, #0
|
||||
adds r3, #0xe0
|
||||
ldr r4, _0801DFE0 @ =0x0000FFFF
|
||||
adds r1, r4, #0
|
||||
ldrh r3, [r3]
|
||||
adds r1, r1, r3
|
||||
lsls r1, r1, #3
|
||||
adds r2, r2, r1
|
||||
strh r2, [r0, #0x12]
|
||||
bl sub_08155128
|
||||
movs r0, #0xff
|
||||
lsls r0, r0, #1
|
||||
bl m4aSongNumStart
|
||||
adds r0, r7, #0
|
||||
adds r0, #0xde
|
||||
strh r6, [r0]
|
||||
adds r1, r7, #0
|
||||
adds r1, #0xd8
|
||||
ldr r0, _0801DFE4 @ =sub_0801E0D8
|
||||
str r0, [r1]
|
||||
adds r0, r7, #0
|
||||
bl sub_0801DEC8
|
||||
pop {r4, r5, r6, r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0801DFD4: .4byte 0xFFFBFFFF
|
||||
_0801DFD8: .4byte gUnk_082DE690
|
||||
_0801DFDC: .4byte gUnk_082DE694
|
||||
_0801DFE0: .4byte 0x0000FFFF
|
||||
_0801DFE4: .4byte sub_0801E0D8
|
||||
|
||||
thumb_func_start sub_0801DFE8
|
||||
sub_0801DFE8: @ 0x0801DFE8
|
||||
push {lr}
|
||||
movs r0, #0
|
||||
bl sub_0801DA58
|
||||
pop {r0}
|
||||
bx r0
|
||||
|
||||
thumb_func_start sub_0801DFF4
|
||||
sub_0801DFF4: @ 0x0801DFF4
|
||||
push {lr}
|
||||
ldr r0, _0801E010 @ =gCurTask
|
||||
ldr r2, [r0]
|
||||
ldrh r1, [r2, #0x12]
|
||||
movs r0, #0x10
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _0801E014
|
||||
ldrh r0, [r2, #6]
|
||||
lsls r0, r0, #2
|
||||
movs r1, #0x80
|
||||
lsls r1, r1, #0x12
|
||||
adds r2, r0, r1
|
||||
b _0801E01C
|
||||
.align 2, 0
|
||||
_0801E010: .4byte gCurTask
|
||||
_0801E014:
|
||||
ldrh r1, [r2, #6]
|
||||
movs r0, #0xc0
|
||||
lsls r0, r0, #0x12
|
||||
adds r2, r1, r0
|
||||
_0801E01C:
|
||||
adds r0, r2, #0
|
||||
adds r0, #0xd8
|
||||
ldr r1, [r0]
|
||||
adds r0, r2, #0
|
||||
bl _call_via_r1
|
||||
pop {r0}
|
||||
bx r0
|
||||
|
||||
thumb_func_start nullsub_28
|
||||
nullsub_28: @ 0x0801E02C
|
||||
bx lr
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_0801E030
|
||||
sub_0801E030: @ 0x0801E030
|
||||
adds r0, #0xd8
|
||||
ldr r1, _0801E038 @ =sub_0801E03C
|
||||
str r1, [r0]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_0801E038: .4byte sub_0801E03C
|
||||
|
||||
thumb_func_start sub_0801E03C
|
||||
sub_0801E03C: @ 0x0801E03C
|
||||
push {r4, r5, r6, lr}
|
||||
adds r5, r0, #0
|
||||
ldr r0, _0801E098 @ =gUnk_082D7850
|
||||
ldr r1, _0801E09C @ =0x00000C1C
|
||||
adds r0, r0, r1
|
||||
ldr r6, [r0]
|
||||
ldr r1, _0801E0A0 @ =gBackgrounds
|
||||
ldr r0, _0801E0A4 @ =gRoomProps
|
||||
ldr r2, _0801E0A8 @ =0x00007D46
|
||||
adds r0, r0, r2
|
||||
ldrh r0, [r0]
|
||||
lsls r0, r0, #2
|
||||
adds r0, r0, r1
|
||||
ldr r4, [r0]
|
||||
adds r1, r5, #0
|
||||
adds r1, #0xde
|
||||
movs r0, #0
|
||||
strh r0, [r1]
|
||||
adds r0, r5, #0
|
||||
bl sub_0801DE00
|
||||
ldr r0, [r6, #0x10]
|
||||
movs r1, #0
|
||||
movs r2, #0x60
|
||||
bl sub_0803D21C
|
||||
ldr r0, [r4, #0x10]
|
||||
ldrb r1, [r4, #0x14]
|
||||
ldrh r2, [r4, #0x16]
|
||||
bl sub_0803D21C
|
||||
movs r0, #7
|
||||
bl sub_0803C95C
|
||||
ldrh r2, [r0, #8]
|
||||
movs r3, #0xc0
|
||||
lsls r3, r3, #1
|
||||
adds r1, r3, #0
|
||||
orrs r1, r2
|
||||
strh r1, [r0, #8]
|
||||
adds r5, #0xd8
|
||||
ldr r0, _0801E0AC @ =sub_0801E0B0
|
||||
str r0, [r5]
|
||||
pop {r4, r5, r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0801E098: .4byte gUnk_082D7850
|
||||
_0801E09C: .4byte 0x00000C1C
|
||||
_0801E0A0: .4byte gBackgrounds
|
||||
_0801E0A4: .4byte gRoomProps
|
||||
_0801E0A8: .4byte 0x00007D46
|
||||
_0801E0AC: .4byte sub_0801E0B0
|
||||
|
||||
thumb_func_start sub_0801E0B0
|
||||
sub_0801E0B0: @ 0x0801E0B0
|
||||
push {lr}
|
||||
adds r3, r0, #0
|
||||
adds r2, r3, #0
|
||||
adds r2, #0xde
|
||||
ldrh r0, [r2]
|
||||
adds r1, r0, #1
|
||||
strh r1, [r2]
|
||||
lsls r0, r0, #0x10
|
||||
lsrs r0, r0, #0x10
|
||||
cmp r0, #0x20
|
||||
bls _0801E0CE
|
||||
adds r1, r3, #0
|
||||
adds r1, #0xd8
|
||||
ldr r0, _0801E0D4 @ =sub_0801E1A0
|
||||
str r0, [r1]
|
||||
_0801E0CE:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0801E0D4: .4byte sub_0801E1A0
|
||||
|
||||
thumb_func_start sub_0801E0D8
|
||||
sub_0801E0D8: @ 0x0801E0D8
|
||||
push {r4, r5, lr}
|
||||
sub sp, #4
|
||||
adds r5, r0, #0
|
||||
adds r2, r5, #0
|
||||
adds r2, #0xde
|
||||
ldrh r0, [r2]
|
||||
adds r1, r0, #1
|
||||
strh r1, [r2]
|
||||
lsls r0, r0, #0x10
|
||||
lsrs r0, r0, #0x10
|
||||
cmp r0, #2
|
||||
bls _0801E11E
|
||||
ldrh r0, [r5, #0x30]
|
||||
lsrs r0, r0, #3
|
||||
ldrh r1, [r5, #0x32]
|
||||
lsrs r1, r1, #3
|
||||
subs r2, #2
|
||||
ldrh r2, [r2]
|
||||
ldrh r4, [r5, #0x24]
|
||||
lsls r4, r4, #5
|
||||
ldrh r3, [r5, #0x22]
|
||||
adds r4, r4, r3
|
||||
lsls r4, r4, #1
|
||||
ldr r3, [r5, #0xc]
|
||||
adds r3, r3, r4
|
||||
adds r4, r5, #0
|
||||
adds r4, #0xe0
|
||||
ldrh r4, [r4]
|
||||
str r4, [sp]
|
||||
bl sub_0801DC70
|
||||
adds r1, r5, #0
|
||||
adds r1, #0xd8
|
||||
ldr r0, _0801E12C @ =sub_0801E130
|
||||
str r0, [r1]
|
||||
_0801E11E:
|
||||
adds r0, r5, #0
|
||||
bl sub_0801DEC8
|
||||
add sp, #4
|
||||
pop {r4, r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0801E12C: .4byte sub_0801E130
|
||||
|
||||
thumb_func_start sub_0801E130
|
||||
sub_0801E130: @ 0x0801E130
|
||||
push {lr}
|
||||
adds r3, r0, #0
|
||||
adds r2, r3, #0
|
||||
adds r2, #0xde
|
||||
ldrh r0, [r2]
|
||||
adds r1, r0, #1
|
||||
strh r1, [r2]
|
||||
lsls r0, r0, #0x10
|
||||
lsrs r0, r0, #0x10
|
||||
cmp r0, #6
|
||||
bls _0801E14E
|
||||
adds r1, r3, #0
|
||||
adds r1, #0xd8
|
||||
ldr r0, _0801E158 @ =sub_0801E15C
|
||||
str r0, [r1]
|
||||
_0801E14E:
|
||||
adds r0, r3, #0
|
||||
bl sub_0801DEC8
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0801E158: .4byte sub_0801E15C
|
||||
|
||||
thumb_func_start sub_0801E15C
|
||||
sub_0801E15C: @ 0x0801E15C
|
||||
push {lr}
|
||||
adds r3, r0, #0
|
||||
adds r2, r3, #0
|
||||
adds r2, #0xe2
|
||||
ldrh r0, [r2]
|
||||
movs r1, #1
|
||||
eors r0, r1
|
||||
strh r0, [r2]
|
||||
adds r1, r3, #0
|
||||
adds r1, #0xe0
|
||||
ldrh r0, [r1]
|
||||
adds r0, #1
|
||||
strh r0, [r1]
|
||||
lsls r0, r0, #0x10
|
||||
lsrs r0, r0, #0x10
|
||||
cmp r0, #5
|
||||
beq _0801E188
|
||||
subs r1, #8
|
||||
ldr r0, _0801E184 @ =sub_0801DF30
|
||||
b _0801E18E
|
||||
.align 2, 0
|
||||
_0801E184: .4byte sub_0801DF30
|
||||
_0801E188:
|
||||
adds r1, r3, #0
|
||||
adds r1, #0xd8
|
||||
ldr r0, _0801E19C @ =sub_0801E1B4
|
||||
_0801E18E:
|
||||
str r0, [r1]
|
||||
adds r0, r3, #0
|
||||
bl sub_0801DEC8
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0801E19C: .4byte sub_0801E1B4
|
||||
|
||||
thumb_func_start sub_0801E1A0
|
||||
sub_0801E1A0: @ 0x0801E1A0
|
||||
adds r2, r0, #0
|
||||
adds r2, #0xde
|
||||
movs r1, #0
|
||||
strh r1, [r2]
|
||||
adds r0, #0xd8
|
||||
ldr r1, _0801E1B0 @ =sub_0801E1D0
|
||||
str r1, [r0]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_0801E1B0: .4byte sub_0801E1D0
|
||||
|
||||
thumb_func_start sub_0801E1B4
|
||||
sub_0801E1B4: @ 0x0801E1B4
|
||||
push {lr}
|
||||
adds r2, r0, #0
|
||||
adds r2, #0xde
|
||||
movs r1, #0
|
||||
strh r1, [r2]
|
||||
subs r2, #6
|
||||
ldr r1, _0801E1CC @ =sub_0801E1F8
|
||||
str r1, [r2]
|
||||
bl sub_0801DEC8
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0801E1CC: .4byte sub_0801E1F8
|
||||
|
||||
thumb_func_start sub_0801E1D0
|
||||
sub_0801E1D0: @ 0x0801E1D0
|
||||
push {lr}
|
||||
adds r3, r0, #0
|
||||
adds r2, r3, #0
|
||||
adds r2, #0xde
|
||||
ldrh r0, [r2]
|
||||
adds r1, r0, #1
|
||||
strh r1, [r2]
|
||||
lsls r0, r0, #0x10
|
||||
lsrs r0, r0, #0x10
|
||||
cmp r0, #0x3c
|
||||
bls _0801E1EE
|
||||
adds r1, r3, #0
|
||||
adds r1, #0xd8
|
||||
ldr r0, _0801E1F4 @ =sub_0801E224
|
||||
str r0, [r1]
|
||||
_0801E1EE:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0801E1F4: .4byte sub_0801E224
|
||||
|
||||
thumb_func_start sub_0801E1F8
|
||||
sub_0801E1F8: @ 0x0801E1F8
|
||||
push {lr}
|
||||
adds r3, r0, #0
|
||||
adds r2, r3, #0
|
||||
adds r2, #0xde
|
||||
ldrh r0, [r2]
|
||||
adds r1, r0, #1
|
||||
strh r1, [r2]
|
||||
lsls r0, r0, #0x10
|
||||
lsrs r0, r0, #0x10
|
||||
cmp r0, #0x3c
|
||||
bls _0801E216
|
||||
adds r1, r3, #0
|
||||
adds r1, #0xd8
|
||||
ldr r0, _0801E220 @ =sub_0801E238
|
||||
str r0, [r1]
|
||||
_0801E216:
|
||||
adds r0, r3, #0
|
||||
bl sub_0801DEC8
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0801E220: .4byte sub_0801E238
|
||||
|
||||
thumb_func_start sub_0801E224
|
||||
sub_0801E224: @ 0x0801E224
|
||||
adds r2, r0, #0
|
||||
adds r2, #0xe0
|
||||
movs r1, #0
|
||||
strh r1, [r2]
|
||||
adds r0, #0xd8
|
||||
ldr r1, _0801E234 @ =sub_0801DF30
|
||||
str r1, [r0]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_0801E234: .4byte sub_0801DF30
|
||||
|
||||
thumb_func_start sub_0801E238
|
||||
sub_0801E238: @ 0x0801E238
|
||||
push {r4, lr}
|
||||
sub sp, #4
|
||||
adds r4, r0, #0
|
||||
ldr r1, _0801E280 @ =0x00007FFF
|
||||
mov r0, sp
|
||||
strh r1, [r0]
|
||||
adds r1, r4, #0
|
||||
adds r1, #0xde
|
||||
movs r0, #0
|
||||
strh r0, [r1]
|
||||
movs r0, #7
|
||||
bl sub_0803CA20
|
||||
ldrh r2, [r0, #8]
|
||||
movs r3, #0xc0
|
||||
lsls r3, r3, #1
|
||||
adds r1, r3, #0
|
||||
orrs r1, r2
|
||||
strh r1, [r0, #8]
|
||||
ldr r1, _0801E284 @ =0x0000FFFF
|
||||
strh r1, [r0, #4]
|
||||
movs r1, #1
|
||||
rsbs r1, r1, #0
|
||||
strh r1, [r0, #6]
|
||||
mov r0, sp
|
||||
movs r1, #0
|
||||
movs r2, #1
|
||||
bl sub_0803D21C
|
||||
adds r4, #0xd8
|
||||
ldr r0, _0801E288 @ =sub_0801E28C
|
||||
str r0, [r4]
|
||||
add sp, #4
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0801E280: .4byte 0x00007FFF
|
||||
_0801E284: .4byte 0x0000FFFF
|
||||
_0801E288: .4byte sub_0801E28C
|
||||
|
||||
thumb_func_start sub_0801E28C
|
||||
sub_0801E28C: @ 0x0801E28C
|
||||
push {lr}
|
||||
adds r3, r0, #0
|
||||
adds r2, r3, #0
|
||||
adds r2, #0xde
|
||||
ldrh r0, [r2]
|
||||
adds r1, r0, #1
|
||||
strh r1, [r2]
|
||||
lsls r0, r0, #0x10
|
||||
lsrs r0, r0, #0x10
|
||||
cmp r0, #0x20
|
||||
bls _0801E2AA
|
||||
adds r1, r3, #0
|
||||
adds r1, #0xd8
|
||||
ldr r0, _0801E2B0 @ =sub_0801E2B4
|
||||
str r0, [r1]
|
||||
_0801E2AA:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0801E2B0: .4byte sub_0801E2B4
|
||||
|
||||
thumb_func_start sub_0801E2B4
|
||||
sub_0801E2B4: @ 0x0801E2B4
|
||||
push {lr}
|
||||
bl sub_08039670
|
||||
ldr r0, _0801E2C8 @ =gCurTask
|
||||
ldr r0, [r0]
|
||||
bl TaskDestroy
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0801E2C8: .4byte gCurTask
|
@ -3,21 +3,6 @@
|
||||
|
||||
.section .rodata
|
||||
|
||||
gUnk_082DE690:: @ 082DE690
|
||||
.incbin "baserom.gba", 0x2DE690, 0x0000002
|
||||
|
||||
gUnk_082DE692:: @ 082DE692
|
||||
.incbin "baserom.gba", 0x2DE692, 0x0000002
|
||||
|
||||
gUnk_082DE694:: @ 082DE694
|
||||
.incbin "baserom.gba", 0x2DE694, 0x0000004
|
||||
|
||||
gUnk_082DE698:: @ 082DE698
|
||||
.incbin "baserom.gba", 0x2DE698, 0x0000002
|
||||
|
||||
gUnk_082DE69A:: @ 082DE69A
|
||||
.incbin "baserom.gba", 0x2DE69A, 0x0000002
|
||||
|
||||
gUnk_082DE69C:: @ 082DE69C
|
||||
.incbin "baserom.gba", 0x2DE69C, 0x0000210
|
||||
|
||||
|
@ -17,4 +17,6 @@ struct Unk_0801DA58
|
||||
u16 unkE2;
|
||||
}; /* size = 0xE4 */
|
||||
|
||||
void sub_0801DA58(u16);
|
||||
|
||||
#endif
|
||||
|
@ -51,7 +51,7 @@ struct LevelInfo_1A0_Full {
|
||||
u16 unk22;
|
||||
};
|
||||
|
||||
extern const struct LevelInfo_1A0 *const gBackgrounds[];
|
||||
extern const struct LevelInfo_1A0 *const gBackgrounds[]; // TODO: a better name
|
||||
extern const struct LevelInfo_1A0 *const gForegroundTilemaps[]; // most fields are 0 -- will be crafted by other structs
|
||||
|
||||
// see sub_08001408
|
||||
@ -439,17 +439,6 @@ struct Unk_02038590 {
|
||||
u8 fillerE2[0x12];
|
||||
}; /* size = 0xF4 */
|
||||
|
||||
struct Unk_082D7850 {
|
||||
u8 filler0[2];
|
||||
u16 unk2;
|
||||
u8 filler4[4];
|
||||
void* unk8;
|
||||
u8 fillerC[4];
|
||||
u16* unk10;
|
||||
u8 filler14[4];
|
||||
u16* unk18;
|
||||
};
|
||||
|
||||
struct Unk_082EAB98 {
|
||||
void *unk00[4];
|
||||
u32 unk10;
|
||||
@ -660,7 +649,7 @@ struct Unk_3007DE0 {
|
||||
u8 unk2A;
|
||||
};
|
||||
|
||||
extern const struct Unk_082D7850* gUnk_082D7850[];
|
||||
extern const struct LevelInfo_1A0* gUnk_082D7850[];
|
||||
extern const u32 gUnk_082D88B8[];
|
||||
extern const u16 gUnk_082D8CB8[];
|
||||
extern const u16 gUnk_082D8CF0[];
|
||||
|
@ -241,7 +241,6 @@ SECTIONS {
|
||||
src/shard.o(.text);
|
||||
src/code_0801C6F8.o(.text);
|
||||
src/code_0801DA58.o(.text);
|
||||
asm/code_0801C6F8.o(.text);
|
||||
asm/special_hub_mirror.o(.text);
|
||||
src/subgame_menu.o(.text);
|
||||
asm/code_08020220.o(.text);
|
||||
|
@ -150,7 +150,7 @@ static void sub_0801C8DC(struct Unk_0801C6F8 *var)
|
||||
gBgCntRegs[0] = BGCNT_PRIORITY(2) | BGCNT_CHARBASE(2) | BGCNT_16COLOR | BGCNT_SCREENBASE(30);
|
||||
BgInit(&var->unk0, 0x6008000, 0, 0x600F000, 0, 0, 0x306, 0, 0, 0, 0, 0x1E, 0x14, 0, 0, 0, 0x1B,
|
||||
0, 0, 0x7FFF, 0x7FFF);
|
||||
LZ77UnCompVram(gUnk_082D7850[0x306]->unk8, (u16 *)var->unk0.unk4);
|
||||
LZ77UnCompVram(gUnk_082D7850[0x306]->tileset, (u16 *)var->unk0.unk4);
|
||||
sub_08153060(&var->unk0);
|
||||
var->unk208 = sub_0801C990;
|
||||
}
|
||||
@ -275,11 +275,11 @@ static void sub_0801CA30(struct Unk_0801C6F8 *var)
|
||||
static void sub_0801CC30(struct Unk_0801C6F8 *var)
|
||||
{
|
||||
struct Sprite sprite;
|
||||
const struct Unk_082D7850 *r2 = gUnk_082D7850[0x306];
|
||||
const struct LevelInfo_1A0 *r2 = gUnk_082D7850[0x306];
|
||||
const struct LevelInfo_1A0 *bg = gBackgrounds[gRoomProps[0x321].backgroundIdx];
|
||||
struct Unk_02022930_0 *unkStruct;
|
||||
|
||||
sub_0803D21C(r2->unk10, 0, 0x60);
|
||||
sub_0803D21C(r2->palette, 0, 0x60);
|
||||
sub_0803D21C(bg->palette, bg->paletteOffset, bg->paletteSize);
|
||||
unkStruct = sub_0803C95C(7);
|
||||
unkStruct->unk8 |= 0x180;
|
||||
|
@ -4,11 +4,27 @@
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
void sub_0801DFF4(void);
|
||||
void nullsub_28(struct Task *);
|
||||
void sub_0801E030(struct Unk_0801DA58 *);
|
||||
static void sub_0801DFF4(void);
|
||||
static void nullsub_28(struct Task *);
|
||||
static void sub_0801E030(struct Unk_0801DA58 *);
|
||||
static void sub_0801E03C(struct Unk_0801DA58 *);
|
||||
static void sub_0801E0B0(struct Unk_0801DA58 *);
|
||||
static void sub_0801E0D8(struct Unk_0801DA58 *);
|
||||
static void sub_0801E130(struct Unk_0801DA58 *);
|
||||
static void sub_0801E15C(struct Unk_0801DA58 *);
|
||||
static void sub_0801E1A0(struct Unk_0801DA58 *);
|
||||
static void sub_0801E1B4(struct Unk_0801DA58 *);
|
||||
static void sub_0801E1D0(struct Unk_0801DA58 *);
|
||||
static void sub_0801E1F8(struct Unk_0801DA58 *);
|
||||
static void sub_0801E224(struct Unk_0801DA58 *);
|
||||
static void sub_0801E238(struct Unk_0801DA58 *);
|
||||
static void sub_0801E28C(struct Unk_0801DA58 *);
|
||||
static void sub_0801E2B4(struct Unk_0801DA58 *);
|
||||
|
||||
extern const u16 gUnk_082DE694[][2];
|
||||
static const u16 gUnk_082DE690[][2] = { { 0xE, 6 } };
|
||||
static const u16 gUnk_082DE694[][2] = { { 0, 0 } };
|
||||
static const u16 gUnk_082DE698[] = { 0x308 };
|
||||
static const u8 gUnk_082DE69A[] = { 0x12, 0 };
|
||||
|
||||
void sub_0801DA58(u16 a1)
|
||||
{
|
||||
@ -64,7 +80,7 @@ void sub_0801DA58(u16 a1)
|
||||
gBgCntRegs[3] = BGCNT_PRIORITY(2) | BGCNT_CHARBASE(2) | BGCNT_SCREENBASE(30);
|
||||
BgInit(&var->unk0, 0x6008000, 0, 0x600F000, 0, 0, 0x307, 0, 0, 0, 0, 0x1E, 0x14, 0, 0, 0, 0x1B,
|
||||
gUnk_082DE694[var->unkDC][0], gUnk_082DE694[var->unkDC][1], 0x7FFF, 0x7FFF);
|
||||
LZ77UnCompVram(gUnk_082D7850[0x307]->unk8, (u16 *)var->unk0.unk4);
|
||||
LZ77UnCompVram(gUnk_082D7850[0x307]->tileset, (u16 *)var->unk0.unk4);
|
||||
sub_08153060(&var->unk0);
|
||||
bg = gBackgrounds[gRoomProps[0x321].backgroundIdx];
|
||||
gBgScrollRegs[0][0] = 0;
|
||||
@ -81,3 +97,255 @@ void sub_0801DA58(u16 a1)
|
||||
dst += 0x20;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_0801DC70(s16 a1, s16 a2, u16 a3, u16 *a4, u16 a5)
|
||||
{
|
||||
const struct LevelInfo_1A0 *r7 = gUnk_082D7850[0x307];
|
||||
u16 width = r7->width;
|
||||
const u16 *src = r7->tilemap + (gUnk_082DE690[a3][1] - 1) * width + gUnk_082DE690[a3][0] - 1;
|
||||
u16 *dst = a4;
|
||||
s16 r6 = gUnk_082DE690[a3][1] - (a2 + 1) + a5;
|
||||
s16 r2 = gUnk_082DE690[a3][0] - 1 - a1;
|
||||
s16 i;
|
||||
|
||||
if (r6 >= 0 && r6 <= 0x14)
|
||||
for (i = 0; i < 4; ++i, ++r2)
|
||||
if (r2 >= 0 && r2 <= 0x1E)
|
||||
dst[r6 * 0x20 + r2] = src[r7->width * a5 + i];
|
||||
}
|
||||
|
||||
static void sub_0801DD20(s16 a1, s16 a2, u16 a3, u16 *a4, u32 a5)
|
||||
{
|
||||
const struct LevelInfo_1A0 *r8 = gUnk_082D7850[gUnk_082DE698[a3]];
|
||||
const u16 *src;
|
||||
s16 r4, sl;
|
||||
s16 i, j;
|
||||
|
||||
LZ77UnCompVram(r8->tileset, 0x10 * a5 + (u16 *)0x6008000);
|
||||
src = r8->tilemap;
|
||||
r4 = gUnk_082DE690[a3][1] + ~a2;
|
||||
for (i = 0; i < 5; ++i, ++r4)
|
||||
{
|
||||
sl = gUnk_082DE690[a3][0] + ~a1; // Why not unroll sl?
|
||||
if (r4 >= 0 && r4 <= 0x14)
|
||||
for (j = 0; j < 4; ++j, ++sl)
|
||||
if (sl >= 0 && sl <= 0x1E)
|
||||
a4[r4 * 0x20 + sl] = src[i * 4 + j] + a5;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_0801DE00(struct Unk_0801DA58 *var)
|
||||
{
|
||||
u16 i;
|
||||
u32 tileId = 0x300;
|
||||
u16 *tilemapVram = (u16 *)var->unk0.tilemapVram + ({ 0x20 * var->unk0.unk24 + var->unk0.unk22; });
|
||||
s16 scrollX = var->unk0.scrollX >> 3;
|
||||
s16 scrollY = var->unk0.scrollY >> 3;
|
||||
|
||||
for (i = 0; i < 1; ++i)
|
||||
{
|
||||
if (i != var->unkDC)
|
||||
{
|
||||
s16 var1, var2;
|
||||
|
||||
if (*sub_08002888(2, gUnk_082DE69A[i * 2], 0))
|
||||
continue;
|
||||
var1 = gUnk_082DE690[i][0];
|
||||
var2 = gUnk_082DE690[i][1];
|
||||
if (var1 + 3 <= scrollX
|
||||
|| scrollX + 0x1E <= var1 - 1
|
||||
|| var2 + 4 <= scrollY
|
||||
|| scrollY + 0x14 <= var2 - 1)
|
||||
continue;
|
||||
}
|
||||
tileId -= 0x14;
|
||||
sub_0801DD20(scrollX, scrollY, i, tilemapVram, tileId);
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_0801DEC8(struct Unk_0801DA58 *var)
|
||||
{
|
||||
if (var->unkD0[0])
|
||||
sub_0815604C(&var->unk80[0]);
|
||||
if (!sub_08155128(&var->unk80[0]))
|
||||
{
|
||||
var->unkD0[0] = 0;
|
||||
var->unk80[0].x = -0x40;
|
||||
var->unk80[0].y = -0x40;
|
||||
}
|
||||
if (var->unkD0[1])
|
||||
sub_0815604C(&var->unk80[1]);
|
||||
if (!sub_08155128(&var->unk80[1]))
|
||||
{
|
||||
var->unkD0[1] = 0;
|
||||
var->unk80[1].x = -0x40;
|
||||
var->unk80[1].y = -0x40;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_0801DF30(struct Unk_0801DA58 *var)
|
||||
{
|
||||
struct Sprite *sprite = &var->unk80[var->unkE2];
|
||||
|
||||
var->unk80[0].unk8 &= ~0x40000;
|
||||
var->unk80[1].unk8 &= ~0x40000;
|
||||
var->unkD0[var->unkE2] = 1;
|
||||
sprite->variant = 0;
|
||||
sprite->unk1B = 0xFF;
|
||||
sprite->x = 8 * gUnk_082DE690[var->unkDC][0] - gUnk_082DE694[var->unkDC][0] + 8;
|
||||
#ifndef NONMATCHING
|
||||
{
|
||||
register s32 term1, term2 asm("r1");
|
||||
register s32 value asm("r3");
|
||||
u16 *pointer;
|
||||
s32 xffff;
|
||||
|
||||
term1 = 8 * gUnk_082DE690[var->unkDC][1] - gUnk_082DE694[var->unkDC][1];
|
||||
pointer = &var->unkE0;
|
||||
xffff = 0xFFFF;
|
||||
term2 = xffff;
|
||||
asm(""::"r"(term2));
|
||||
term2 += value = *pointer;
|
||||
term2 *= 8;
|
||||
sprite->y = term1 += term2;
|
||||
asm(""::"r"(xffff));
|
||||
}
|
||||
#else
|
||||
sprite->y = 8 * gUnk_082DE690[var->unkDC][1] - gUnk_082DE694[var->unkDC][1] + 8 * (var->unkE0 - 1);
|
||||
#endif
|
||||
sub_08155128(sprite);
|
||||
m4aSongNumStart(510);
|
||||
var->unkDE = 0;
|
||||
var->unkD8 = sub_0801E0D8;
|
||||
sub_0801DEC8(var);
|
||||
}
|
||||
|
||||
static void sub_0801DFE8(void)
|
||||
{
|
||||
sub_0801DA58(0);
|
||||
}
|
||||
|
||||
static void sub_0801DFF4(void)
|
||||
{
|
||||
struct Unk_0801DA58 *var = TaskGetStructPtr(gCurTask);
|
||||
|
||||
var->unkD8(var);
|
||||
}
|
||||
|
||||
static void nullsub_28(struct Task *t)
|
||||
{}
|
||||
|
||||
static void sub_0801E030(struct Unk_0801DA58 *var)
|
||||
{
|
||||
var->unkD8 = sub_0801E03C;
|
||||
}
|
||||
|
||||
static void sub_0801E03C(struct Unk_0801DA58 *var)
|
||||
{
|
||||
const struct LevelInfo_1A0 *r6 = gUnk_082D7850[0x307];
|
||||
const struct LevelInfo_1A0 *bg = gBackgrounds[gRoomProps[0x321].backgroundIdx];
|
||||
|
||||
var->unkDE = 0;
|
||||
sub_0801DE00(var);
|
||||
sub_0803D21C(r6->palette, 0, 0x60);
|
||||
sub_0803D21C(bg->palette, bg->paletteOffset, bg->paletteSize);
|
||||
sub_0803C95C(7)->unk8 |= 0x180;
|
||||
var->unkD8 = sub_0801E0B0;
|
||||
}
|
||||
|
||||
static void sub_0801E0B0(struct Unk_0801DA58 *var)
|
||||
{
|
||||
if (var->unkDE++ > 0x20)
|
||||
var->unkD8 = sub_0801E1A0;
|
||||
}
|
||||
|
||||
static void sub_0801E0D8(struct Unk_0801DA58 *var)
|
||||
{
|
||||
if (var->unkDE++ > 2)
|
||||
{
|
||||
sub_0801DC70(
|
||||
var->unk0.scrollX >> 3,
|
||||
var->unk0.scrollY >> 3,
|
||||
var->unkDC,
|
||||
(u16 *)var->unk0.tilemapVram + ({ 0x20 * var->unk0.unk24 + var->unk0.unk22; }),
|
||||
var->unkE0
|
||||
);
|
||||
var->unkD8 = sub_0801E130;
|
||||
}
|
||||
sub_0801DEC8(var);
|
||||
}
|
||||
|
||||
static void sub_0801E130(struct Unk_0801DA58 *var)
|
||||
{
|
||||
if (var->unkDE++ > 6)
|
||||
var->unkD8 = sub_0801E15C;
|
||||
sub_0801DEC8(var);
|
||||
}
|
||||
|
||||
static void sub_0801E15C(struct Unk_0801DA58 *var)
|
||||
{
|
||||
var->unkE2 ^= 1;
|
||||
if (++var->unkE0 != 5)
|
||||
var->unkD8 = sub_0801DF30;
|
||||
else
|
||||
var->unkD8 = sub_0801E1B4;
|
||||
sub_0801DEC8(var);
|
||||
}
|
||||
|
||||
static void sub_0801E1A0(struct Unk_0801DA58 *var)
|
||||
{
|
||||
var->unkDE = 0;
|
||||
var->unkD8 = sub_0801E1D0;
|
||||
}
|
||||
|
||||
static void sub_0801E1B4(struct Unk_0801DA58 *var)
|
||||
{
|
||||
var->unkDE = 0;
|
||||
var->unkD8 = sub_0801E1F8;
|
||||
sub_0801DEC8(var);
|
||||
}
|
||||
|
||||
static void sub_0801E1D0(struct Unk_0801DA58 *var)
|
||||
{
|
||||
if (var->unkDE++ > 0x3C)
|
||||
var->unkD8 = sub_0801E224;
|
||||
}
|
||||
|
||||
static void sub_0801E1F8(struct Unk_0801DA58 *var)
|
||||
{
|
||||
if (var->unkDE++ > 0x3C)
|
||||
var->unkD8 = sub_0801E238;
|
||||
sub_0801DEC8(var);
|
||||
}
|
||||
|
||||
static void sub_0801E224(struct Unk_0801DA58 *var)
|
||||
{
|
||||
var->unkE0 = 0;
|
||||
var->unkD8 = sub_0801DF30;
|
||||
}
|
||||
|
||||
static void sub_0801E238(struct Unk_0801DA58 *var)
|
||||
{
|
||||
u16 color = RGB_WHITE;
|
||||
struct Unk_02022930_0 *unkStruct;
|
||||
|
||||
var->unkDE = 0;
|
||||
unkStruct = sub_0803CA20(7);
|
||||
unkStruct->unk8 |= 0x180;
|
||||
unkStruct->unk4 = 0xFFFF;
|
||||
unkStruct->unk6 = 0xFFFF;
|
||||
sub_0803D21C(&color, 0, 1);
|
||||
var->unkD8 = sub_0801E28C;
|
||||
}
|
||||
|
||||
static void sub_0801E28C(struct Unk_0801DA58 *var)
|
||||
{
|
||||
if (var->unkDE++ > 0x20)
|
||||
var->unkD8 = sub_0801E2B4;
|
||||
}
|
||||
|
||||
static void sub_0801E2B4(struct Unk_0801DA58 *var)
|
||||
{
|
||||
sub_08039670();
|
||||
TaskDestroy(gCurTask);
|
||||
}
|
||||
|
12
src/logo.c
12
src/logo.c
@ -118,10 +118,10 @@ static void LogoCopyGraphics(u8 arg0, u16 arg1, u16 arg2) {
|
||||
u16 i;
|
||||
u16 r5, r1_2, r0_2;
|
||||
void *r4, *r7, *r6;
|
||||
const struct Unk_082D7850* r1 = gUnk_082D7850[arg1];
|
||||
r4 = r1->unk8;
|
||||
r7 = r1->unk18;
|
||||
r5 = r1->unk2;
|
||||
const struct LevelInfo_1A0* r1 = gUnk_082D7850[arg1];
|
||||
r4 = r1->tileset;
|
||||
r7 = r1->tilemap;
|
||||
r5 = r1->height;
|
||||
r1_2 = (gBgCntRegs[arg0] >> 2) & 3;
|
||||
r0_2 = (gBgCntRegs[arg0] >> 8) & 0x1f;
|
||||
r6 = (void*)(VRAM + (r0_2 << 0xb) + (arg2 >> 3 << 6));
|
||||
@ -134,11 +134,11 @@ static void LogoCopyGraphics(u8 arg0, u16 arg1, u16 arg2) {
|
||||
static void LogoCopyPalette(u16 arg0, u8 arg1, u8 arg2, u16 arg3) {
|
||||
if (arg3 != 0) {
|
||||
if (gUnk_03002440 & 0x10000) {
|
||||
sub_08158334(gUnk_082D7850[arg0]->unk10 + arg1, arg2, arg3);
|
||||
sub_08158334(gUnk_082D7850[arg0]->palette + arg1, arg2, arg3);
|
||||
}
|
||||
else {
|
||||
s32 var = arg3 * 2;
|
||||
DmaCopy16(3, gUnk_082D7850[arg0]->unk10 + arg1, gBgPalette + arg2, var);
|
||||
DmaCopy16(3, gUnk_082D7850[arg0]->palette + arg1, gBgPalette + arg2, var);
|
||||
gUnk_03002440 |= 1;
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ extern const void *const gUnk_08D60AAC[][6];
|
||||
|
||||
static void sub_0801EC2C(u16, s32);
|
||||
static void sub_0801ED94(struct SubGameMenu*);
|
||||
static void sub_0801EDF8(struct SubGameMenu *);
|
||||
static void sub_0801EDF8(struct SubGameMenu*);
|
||||
static void sub_0801F1F4(void);
|
||||
static void sub_0801F2E8(struct SubGameMenu*);
|
||||
static void sub_0801F34C(struct SubGameMenu*);
|
||||
@ -87,11 +87,6 @@ void sub_0801E6C4(s32 arg0) {
|
||||
gBldRegs.bldY = 0x1f;
|
||||
}
|
||||
|
||||
#define GetUnk8AndUnk18(_unk8, _unk18, array, index) ({ \
|
||||
(_unk8) = gUnk_082D7850[(array)[(index)][gUnk_08D60A80]]->unk8; \
|
||||
(_unk18) = gUnk_082D7850[(array)[(index)][gUnk_08D60A80]]->unk18; \
|
||||
})
|
||||
|
||||
void sub_0801E754(s32 sb) {
|
||||
u16 r4;
|
||||
u32 r6;
|
||||
@ -105,19 +100,20 @@ void sub_0801E754(s32 sb) {
|
||||
gBgScrollRegs[0][0] = 0;
|
||||
gBgScrollRegs[0][1] = 0;
|
||||
if (gUnk_03002440 & 0x10000) {
|
||||
sub_08158334(gUnk_082D7850[r4]->unk10, 0, 0x100);
|
||||
sub_08158334(gUnk_082D7850[r4]->palette, 0, 0x100);
|
||||
} else {
|
||||
DmaCopy16(3, gUnk_082D7850[r4]->unk10, gBgPalette, sizeof(gBgPalette));
|
||||
DmaCopy16(3, gUnk_082D7850[r4]->palette, gBgPalette, sizeof(gBgPalette));
|
||||
gUnk_03002440 |= 1;
|
||||
}
|
||||
LZ77UnCompVram(gUnk_082D7850[r4]->unk8, (void *)0x06008000);
|
||||
LZ77UnCompVram(gUnk_082D7850[r4]->tileset, (void *)0x06008000);
|
||||
for (r6 = 0; r6 < 20; ++r6) {
|
||||
#ifndef NONMATCHING
|
||||
asm("":::"memory");
|
||||
#endif
|
||||
DmaCopy16(3, gUnk_082D7850[r4]->unk18 + 30 * r6, (void *)0x0600F800 + 64 * r6, 60);
|
||||
DmaCopy16(3, gUnk_082D7850[r4]->tilemap + 30 * r6, (void *)0x0600F800 + 64 * r6, 60);
|
||||
}
|
||||
GetUnk8AndUnk18(r0_, r7, gUnk_082DE93C, sb);
|
||||
r0_ = gUnk_082D7850[gUnk_082DE93C[sb][gUnk_08D60A80]]->tileset;
|
||||
r7 = gUnk_082D7850[gUnk_082DE93C[sb][gUnk_08D60A80]]->tilemap;
|
||||
gBgCntRegs[1] = BGCNT_PRIORITY(2) | BGCNT_CHARBASE(3) | BGCNT_SCREENBASE(30) | BGCNT_16COLOR;
|
||||
gBgScrollRegs[1][0] = 0;
|
||||
LZ77UnCompVram(r0_, (void *)0x0600CC80);
|
||||
@ -127,7 +123,8 @@ void sub_0801E754(s32 sb) {
|
||||
for (r5 = 0; r5 < 8; ++r5)
|
||||
for (r2 = 0; r2 < 8; ++r2)
|
||||
(32 * r5 + r2)[(u16 *)ip] = r7[8 * r5 + r2] + 100;
|
||||
GetUnk8AndUnk18(r0, r5_, gUnk_082DE90C, sb);
|
||||
r0 = gUnk_082D7850[gUnk_082DE90C[sb][gUnk_08D60A80]]->tileset;
|
||||
r5_ = gUnk_082D7850[gUnk_082DE90C[sb][gUnk_08D60A80]]->tilemap;
|
||||
gBgCntRegs[2] = BGCNT_PRIORITY(1) | BGCNT_CHARBASE(3) | BGCNT_SCREENBASE(28) | BGCNT_TXT512x256 | BGCNT_16COLOR;
|
||||
gBgScrollRegs[2][0] = 0;
|
||||
gBgScrollRegs[2][1] = 0;
|
||||
@ -292,7 +289,7 @@ static void sub_0801EDF8(struct SubGameMenu *r6) {
|
||||
BgInit(r6_, 0x6008000, 0, 0x600F800, 0, 0, r4, 0, 0, 0, 0, 0x1E, 0x14, 0, 0, 0, 8,
|
||||
0, 0, 0x7FFF, 0x7FFF);
|
||||
sub_08153060(r6_);
|
||||
LZ77UnCompVram(gUnk_082D7850[r4]->unk8, (u16 *)r6_->unk4);
|
||||
LZ77UnCompVram(gUnk_082D7850[r4]->tileset, (u16 *)r6_->unk4);
|
||||
gDispCnt |= DISPCNT_BG0_ON;
|
||||
if (r6->unk150 == 3) {
|
||||
s32 idx = 3; // required for matching
|
||||
@ -302,7 +299,7 @@ static void sub_0801EDF8(struct SubGameMenu *r6) {
|
||||
BgInit(r4_, 0x6000000, 0, 0x600E000, 0, 0, r5, 0, 0, 0, 0, 0x1E, 0x14, 0, 0, 0, 0x19,
|
||||
0, 0, 0x7FFF, 0x7FFF);
|
||||
sub_08153060(r4_);
|
||||
LZ77UnCompVram(gUnk_082D7850[r5]->unk8, (u16 *)r4_->unk4);
|
||||
LZ77UnCompVram(gUnk_082D7850[r5]->tileset, (u16 *)r4_->unk4);
|
||||
gDispCnt |= DISPCNT_BG1_ON;
|
||||
}
|
||||
r6->unk154 = sub_0801FDB8;
|
||||
@ -454,7 +451,7 @@ static void sub_0801F34C(struct SubGameMenu *r6) {
|
||||
BgInit(r6_, 0x6008000, 0, 0x600F800, 0, 0, r4, 0, 0, 0, 0, 0x1E, 0x14, 0, 0, 0, 8,
|
||||
0, 0, 0x7FFF, 0x7FFF);
|
||||
sub_08153060(r6_);
|
||||
LZ77UnCompVram(gUnk_082D7850[r4]->unk8, (u16 *)0x6008000);
|
||||
LZ77UnCompVram(gUnk_082D7850[r4]->tileset, (u16 *)0x6008000);
|
||||
gDispCnt |= DISPCNT_BG0_ON;
|
||||
if (r6->unk150 == 3) {
|
||||
s32 idx = 3; // required for matching
|
||||
@ -464,7 +461,7 @@ static void sub_0801F34C(struct SubGameMenu *r6) {
|
||||
BgInit(r4_, 0x6000000, 0, 0x600E000, 0, 0, r5, 0, 0, 0, 0, 0x1E, 0x14, 0, 0, 0, 0x19,
|
||||
0, 0, 0x7FFF, 0x7FFF);
|
||||
sub_08153060(r4_);
|
||||
LZ77UnCompVram(gUnk_082D7850[r5]->unk8, (u16 *)r4_->unk4);
|
||||
LZ77UnCompVram(gUnk_082D7850[r5]->tileset, (u16 *)r4_->unk4);
|
||||
gDispCnt |= DISPCNT_BG1_ON;
|
||||
}
|
||||
r6->unk154 = sub_0801F4BC;
|
||||
@ -475,7 +472,8 @@ static void sub_0801F4BC(struct SubGameMenu* arg0) {
|
||||
if (r4 != 3 && gUnk_0203AD3C != 0) {
|
||||
u16 i, *vram, *r4_3;
|
||||
u8 *r4_2;
|
||||
GetUnk8AndUnk18(r4_2, r4_3, gUnk_082DE8DC, r4);
|
||||
r4_2 = gUnk_082D7850[gUnk_082DE8DC[r4][gUnk_08D60A80]]->tileset;
|
||||
r4_3 = gUnk_082D7850[gUnk_082DE8DC[r4][gUnk_08D60A80]]->tilemap;
|
||||
LZ77UnCompVram(r4_2, (void*)VRAM + 0xC000);
|
||||
DmaFill32(3, 0, (void*)VRAM + 0xCC60, 0x20);
|
||||
gUnk_030060A0.parts[1] = 0x63;
|
||||
@ -589,7 +587,8 @@ static void sub_0801F7F8(void) {
|
||||
static void sub_0801F8EC(struct SubGameMenu* arg0) {
|
||||
u16 i, j, *vram, *unk18;
|
||||
u8 *unk8;
|
||||
GetUnk8AndUnk18(unk8, unk18, gUnk_082DE96C, arg0->unk150);
|
||||
unk8 = gUnk_082D7850[gUnk_082DE96C[arg0->unk150][gUnk_08D60A80]]->tileset;
|
||||
unk18 = gUnk_082D7850[gUnk_082DE96C[arg0->unk150][gUnk_08D60A80]]->tilemap;
|
||||
gBgCntRegs[1] = BGCNT_PRIORITY(2) | BGCNT_CHARBASE(3) | BGCNT_SCREENBASE(30) | BGCNT_16COLOR;
|
||||
gBgScrollRegs[1][0] = 0;
|
||||
LZ77UnCompVram(unk8, (void*)VRAM + 0xCC80);
|
||||
|
@ -138,9 +138,9 @@ static inline void LoadBg(u8 bg, u16 r0, void* dest) {
|
||||
u32 r1;
|
||||
void* r7, *r6, *r0_2;
|
||||
|
||||
r0_2 = gUnk_082D7850[r0]->unk8;
|
||||
r7 = gUnk_082D7850[r0]->unk18;
|
||||
r5 = gUnk_082D7850[r0]->unk2;
|
||||
r0_2 = gUnk_082D7850[r0]->tileset;
|
||||
r7 = gUnk_082D7850[r0]->tilemap;
|
||||
r5 = gUnk_082D7850[r0]->height;
|
||||
r1 = (gBgCntRegs[bg] >> 2) & 3;
|
||||
r6 = (((gBgCntRegs[bg] >> 8) & 0x1f) << 0xb) + dest;
|
||||
LZ77UnCompVram(r0_2, (r1 << 0xe) + (void*)VRAM);
|
||||
@ -172,10 +172,10 @@ static void TitleScreenGraphicsInit(struct TitleStruct* arg0) {
|
||||
r0 = gUnk_08387D58[gUnk_08D60A80][0];
|
||||
|
||||
if (gUnk_03002440 & 0x10000) {
|
||||
sub_08158334_wrapper(gUnk_082D7850[r0]->unk10, 0, 0x100);
|
||||
sub_08158334_wrapper(gUnk_082D7850[r0]->palette, 0, 0x100);
|
||||
}
|
||||
else {
|
||||
DmaCopy16(3, gUnk_082D7850[r0]->unk10, gBgPalette, 0x200);
|
||||
DmaCopy16(3, gUnk_082D7850[r0]->palette, gBgPalette, 0x200);
|
||||
gUnk_03002440 |= 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user