mirror of
https://github.com/jiangzhengwenjz/katam.git
synced 2024-11-26 22:50:39 +00:00
more intro
This commit is contained in:
parent
f0dfdbc888
commit
f5e6ad6358
746
asm/intro.s
746
asm/intro.s
@ -5,752 +5,6 @@
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_0814623C
|
||||
sub_0814623C: @ 0x0814623C
|
||||
push {r4, r5, r6, r7, lr}
|
||||
adds r4, r0, #0
|
||||
ldr r7, [r4]
|
||||
ldr r0, _08146280 @ =0x00001417
|
||||
adds r1, r4, r0
|
||||
ldrb r0, [r1]
|
||||
adds r0, #1
|
||||
movs r6, #0
|
||||
strb r0, [r1]
|
||||
ldrb r3, [r1]
|
||||
ldr r2, _08146284 @ =0x00001418
|
||||
adds r5, r4, r2
|
||||
ldrb r2, [r5]
|
||||
subs r0, r2, #2
|
||||
cmp r3, r0
|
||||
bne _0814629C
|
||||
ldr r0, _08146288 @ =0x00000266
|
||||
bl m4aSongNumStart
|
||||
ldr r2, _0814628C @ =gRngVal
|
||||
ldr r1, [r2]
|
||||
ldr r0, _08146290 @ =0x00196225
|
||||
muls r0, r1, r0
|
||||
ldr r1, _08146294 @ =0x3C6EF35F
|
||||
adds r0, r0, r1
|
||||
str r0, [r2]
|
||||
movs r1, #3
|
||||
ands r0, r1
|
||||
subs r0, #1
|
||||
ldr r2, _08146298 @ =0x00001415
|
||||
adds r1, r4, r2
|
||||
strb r0, [r1]
|
||||
b _081462C4
|
||||
.align 2, 0
|
||||
_08146280: .4byte 0x00001417
|
||||
_08146284: .4byte 0x00001418
|
||||
_08146288: .4byte 0x00000266
|
||||
_0814628C: .4byte gRngVal
|
||||
_08146290: .4byte 0x00196225
|
||||
_08146294: .4byte 0x3C6EF35F
|
||||
_08146298: .4byte 0x00001415
|
||||
_0814629C:
|
||||
cmp r3, r2
|
||||
bne _081462C4
|
||||
strb r6, [r1]
|
||||
ldr r2, _081462E8 @ =gRngVal
|
||||
ldr r1, [r2]
|
||||
ldr r0, _081462EC @ =0x00196225
|
||||
muls r0, r1, r0
|
||||
ldr r1, _081462F0 @ =0x3C6EF35F
|
||||
adds r0, r0, r1
|
||||
str r0, [r2]
|
||||
movs r1, #0x1f
|
||||
ands r0, r1
|
||||
adds r0, #3
|
||||
strb r0, [r5]
|
||||
ldr r2, _081462F4 @ =0x00001415
|
||||
adds r0, r4, r2
|
||||
strb r6, [r0]
|
||||
ldr r1, _081462F8 @ =0x00001414
|
||||
adds r0, r4, r1
|
||||
strb r6, [r0]
|
||||
_081462C4:
|
||||
ldr r0, _081462FC @ =gUnk_083877EE
|
||||
ldrh r0, [r0, #0x1c]
|
||||
cmp r7, r0
|
||||
blo _081462E2
|
||||
ldr r2, _081462F4 @ =0x00001415
|
||||
adds r0, r4, r2
|
||||
movs r1, #0
|
||||
strb r1, [r0]
|
||||
subs r2, #1
|
||||
adds r0, r4, r2
|
||||
strb r1, [r0]
|
||||
ldr r0, _08146300 @ =0x00001410
|
||||
adds r1, r4, r0
|
||||
ldr r0, _08146304 @ =nullsub_133
|
||||
str r0, [r1]
|
||||
_081462E2:
|
||||
pop {r4, r5, r6, r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_081462E8: .4byte gRngVal
|
||||
_081462EC: .4byte 0x00196225
|
||||
_081462F0: .4byte 0x3C6EF35F
|
||||
_081462F4: .4byte 0x00001415
|
||||
_081462F8: .4byte 0x00001414
|
||||
_081462FC: .4byte gUnk_083877EE
|
||||
_08146300: .4byte 0x00001410
|
||||
_08146304: .4byte nullsub_133
|
||||
|
||||
thumb_func_start sub_08146308
|
||||
sub_08146308: @ 0x08146308
|
||||
push {r4, r5, r6, r7, lr}
|
||||
sub sp, #4
|
||||
adds r5, r0, #0
|
||||
lsls r1, r1, #0x18
|
||||
lsrs r7, r1, #0x18
|
||||
movs r0, #0x80
|
||||
lsls r0, r0, #0x12
|
||||
adds r1, r1, r0
|
||||
lsrs r6, r1, #0x18
|
||||
ldr r1, _08146380 @ =gUnk_083877D2
|
||||
mov r0, sp
|
||||
movs r2, #4
|
||||
bl memcpy
|
||||
lsls r3, r7, #1
|
||||
adds r0, r5, #0
|
||||
adds r0, #0x32
|
||||
adds r4, r0, r3
|
||||
adds r0, #4
|
||||
adds r0, r0, r3
|
||||
ldrh r0, [r0]
|
||||
ldrh r1, [r4]
|
||||
adds r0, r0, r1
|
||||
strh r0, [r4]
|
||||
ldr r2, _08146384 @ =gBgScrollRegs
|
||||
lsls r1, r6, #2
|
||||
adds r2, r1, r2
|
||||
lsls r0, r0, #0x10
|
||||
lsrs r0, r0, #0x16
|
||||
strh r0, [r2]
|
||||
cmp r0, #0xff
|
||||
ble _08146376
|
||||
ldr r1, _08146388 @ =gBgCntRegs
|
||||
lsls r0, r6, #1
|
||||
adds r0, r0, r1
|
||||
mov r6, sp
|
||||
adds r1, r6, r3
|
||||
ldrh r1, [r1]
|
||||
strh r1, [r0]
|
||||
ldr r1, _0814638C @ =0xFFFFFF00
|
||||
adds r0, r1, #0
|
||||
ldrh r6, [r2]
|
||||
adds r0, r0, r6
|
||||
strh r0, [r2]
|
||||
ldr r1, _08146390 @ =0xFFFFC000
|
||||
adds r0, r1, #0
|
||||
ldrh r6, [r4]
|
||||
adds r0, r0, r6
|
||||
strh r0, [r4]
|
||||
lsls r1, r7, #2
|
||||
adds r0, r5, #0
|
||||
adds r0, #0x3c
|
||||
adds r0, r0, r1
|
||||
ldr r1, _08146394 @ =sub_08146398
|
||||
str r1, [r0]
|
||||
_08146376:
|
||||
add sp, #4
|
||||
pop {r4, r5, r6, r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_08146380: .4byte gUnk_083877D2
|
||||
_08146384: .4byte gBgScrollRegs
|
||||
_08146388: .4byte gBgCntRegs
|
||||
_0814638C: .4byte 0xFFFFFF00
|
||||
_08146390: .4byte 0xFFFFC000
|
||||
_08146394: .4byte sub_08146398
|
||||
|
||||
thumb_func_start sub_08146398
|
||||
sub_08146398: @ 0x08146398
|
||||
push {r4, r5, lr}
|
||||
mov ip, r0
|
||||
lsls r1, r1, #0x18
|
||||
lsrs r1, r1, #0x18
|
||||
adds r5, r1, #0
|
||||
adds r1, r5, #2
|
||||
lsls r1, r1, #0x18
|
||||
lsls r4, r5, #1
|
||||
adds r0, #0x32
|
||||
adds r3, r0, r4
|
||||
adds r0, #4
|
||||
adds r0, r0, r4
|
||||
ldrh r0, [r0]
|
||||
ldrh r2, [r3]
|
||||
adds r0, r0, r2
|
||||
strh r0, [r3]
|
||||
ldr r2, _08146400 @ =gBgScrollRegs
|
||||
lsrs r1, r1, #0x16
|
||||
adds r1, r1, r2
|
||||
lsls r0, r0, #0x10
|
||||
lsrs r0, r0, #0x16
|
||||
strh r0, [r1]
|
||||
cmp r0, #0xff
|
||||
ble _081463D8
|
||||
ldr r2, _08146404 @ =0xFFFFFF00
|
||||
adds r0, r0, r2
|
||||
strh r0, [r1]
|
||||
ldr r1, _08146408 @ =0xFFFFC000
|
||||
adds r0, r1, #0
|
||||
ldrh r2, [r3]
|
||||
adds r0, r0, r2
|
||||
strh r0, [r3]
|
||||
_081463D8:
|
||||
ldr r0, _0814640C @ =gUnk_083877EE
|
||||
adds r1, r4, r5
|
||||
adds r1, #5
|
||||
lsls r1, r1, #1
|
||||
adds r1, r1, r0
|
||||
mov r2, ip
|
||||
ldr r0, [r2]
|
||||
ldrh r1, [r1]
|
||||
cmp r0, r1
|
||||
blo _081463F8
|
||||
lsls r0, r5, #2
|
||||
mov r1, ip
|
||||
adds r1, #0x3c
|
||||
adds r1, r1, r0
|
||||
ldr r0, _08146410 @ =sub_08146414
|
||||
str r0, [r1]
|
||||
_081463F8:
|
||||
pop {r4, r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_08146400: .4byte gBgScrollRegs
|
||||
_08146404: .4byte 0xFFFFFF00
|
||||
_08146408: .4byte 0xFFFFC000
|
||||
_0814640C: .4byte gUnk_083877EE
|
||||
_08146410: .4byte sub_08146414
|
||||
|
||||
thumb_func_start sub_08146414
|
||||
sub_08146414: @ 0x08146414
|
||||
push {r4, r5, r6, r7, lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
sub sp, #4
|
||||
adds r6, r0, #0
|
||||
lsls r1, r1, #0x18
|
||||
lsrs r1, r1, #0x18
|
||||
adds r5, r1, #0
|
||||
adds r0, r5, #2
|
||||
lsls r0, r0, #0x18
|
||||
lsrs r0, r0, #0x18
|
||||
adds r7, r0, #0
|
||||
ldr r1, _081464BC @ =gBgScrollRegs
|
||||
lsls r0, r7, #2
|
||||
adds r4, r0, r1
|
||||
ldrh r0, [r4]
|
||||
mov r8, r0
|
||||
ldr r1, _081464C0 @ =gUnk_083877D6
|
||||
mov r0, sp
|
||||
movs r2, #4
|
||||
bl memcpy
|
||||
lsls r3, r5, #1
|
||||
adds r0, r6, #0
|
||||
adds r0, #0x32
|
||||
adds r2, r0, r3
|
||||
adds r0, #4
|
||||
adds r0, r0, r3
|
||||
ldrh r0, [r0]
|
||||
ldrh r1, [r2]
|
||||
adds r0, r0, r1
|
||||
strh r0, [r2]
|
||||
lsls r0, r0, #0x10
|
||||
lsrs r0, r0, #0x16
|
||||
strh r0, [r4]
|
||||
cmp r0, #0xff
|
||||
ble _0814646E
|
||||
ldr r1, _081464C4 @ =0xFFFFFF00
|
||||
adds r0, r0, r1
|
||||
strh r0, [r4]
|
||||
ldr r1, _081464C8 @ =0xFFFFC000
|
||||
adds r0, r1, #0
|
||||
ldrh r1, [r2]
|
||||
adds r0, r0, r1
|
||||
strh r0, [r2]
|
||||
_0814646E:
|
||||
mov r0, r8
|
||||
cmp r0, #0xf
|
||||
bhi _081464AE
|
||||
movs r1, #0
|
||||
ldrsh r0, [r4, r1]
|
||||
cmp r0, #0xf
|
||||
ble _081464AE
|
||||
ldr r1, _081464CC @ =gBgCntRegs
|
||||
lsls r0, r7, #1
|
||||
adds r0, r0, r1
|
||||
mov r7, sp
|
||||
adds r1, r7, r3
|
||||
ldrh r1, [r1]
|
||||
strh r1, [r0]
|
||||
movs r1, #0x80
|
||||
lsls r1, r1, #1
|
||||
adds r0, r1, #0
|
||||
ldrh r7, [r4]
|
||||
adds r0, r0, r7
|
||||
strh r0, [r4]
|
||||
movs r1, #0x80
|
||||
lsls r1, r1, #7
|
||||
adds r0, r1, #0
|
||||
ldrh r7, [r2]
|
||||
adds r0, r0, r7
|
||||
strh r0, [r2]
|
||||
lsls r1, r5, #2
|
||||
adds r0, r6, #0
|
||||
adds r0, #0x3c
|
||||
adds r0, r0, r1
|
||||
ldr r1, _081464D0 @ =sub_081464D4
|
||||
str r1, [r0]
|
||||
_081464AE:
|
||||
add sp, #4
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4, r5, r6, r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_081464BC: .4byte gBgScrollRegs
|
||||
_081464C0: .4byte gUnk_083877D6
|
||||
_081464C4: .4byte 0xFFFFFF00
|
||||
_081464C8: .4byte 0xFFFFC000
|
||||
_081464CC: .4byte gBgCntRegs
|
||||
_081464D0: .4byte sub_081464D4
|
||||
|
||||
thumb_func_start sub_081464D4
|
||||
sub_081464D4: @ 0x081464D4
|
||||
push {r4, r5, r6, r7, lr}
|
||||
sub sp, #4
|
||||
adds r5, r0, #0
|
||||
lsls r4, r1, #0x18
|
||||
lsrs r7, r4, #0x18
|
||||
movs r0, #0x80
|
||||
lsls r0, r0, #0x12
|
||||
adds r4, r4, r0
|
||||
lsrs r4, r4, #0x18
|
||||
ldr r1, _0814653C @ =gUnk_083877DA
|
||||
mov r0, sp
|
||||
movs r2, #4
|
||||
bl memcpy
|
||||
lsls r3, r7, #1
|
||||
adds r0, r5, #0
|
||||
adds r0, #0x32
|
||||
adds r2, r0, r3
|
||||
adds r0, #4
|
||||
adds r0, r0, r3
|
||||
ldrh r0, [r0]
|
||||
ldrh r1, [r2]
|
||||
adds r0, r0, r1
|
||||
movs r6, #0
|
||||
strh r0, [r2]
|
||||
ldr r1, _08146540 @ =gBgScrollRegs
|
||||
lsls r4, r4, #2
|
||||
adds r4, r4, r1
|
||||
lsls r0, r0, #0x10
|
||||
lsrs r0, r0, #0x16
|
||||
strh r0, [r4]
|
||||
ldr r1, _08146544 @ =0x000001FF
|
||||
cmp r0, r1
|
||||
ble _08146534
|
||||
strh r6, [r2]
|
||||
strh r6, [r4]
|
||||
ldr r2, _08146548 @ =gDispCnt
|
||||
mov r1, sp
|
||||
adds r0, r1, r3
|
||||
ldrh r1, [r0]
|
||||
ldrh r0, [r2]
|
||||
bics r0, r1
|
||||
strh r0, [r2]
|
||||
lsls r1, r7, #2
|
||||
adds r0, r5, #0
|
||||
adds r0, #0x3c
|
||||
adds r0, r0, r1
|
||||
str r6, [r0]
|
||||
_08146534:
|
||||
add sp, #4
|
||||
pop {r4, r5, r6, r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0814653C: .4byte gUnk_083877DA
|
||||
_08146540: .4byte gBgScrollRegs
|
||||
_08146544: .4byte 0x000001FF
|
||||
_08146548: .4byte gDispCnt
|
||||
|
||||
thumb_func_start sub_0814654C
|
||||
sub_0814654C: @ 0x0814654C
|
||||
push {r4, r5, r6, r7, lr}
|
||||
adds r6, r0, #0
|
||||
ldr r0, _081465A0 @ =0x0000140E
|
||||
adds r4, r6, r0
|
||||
ldrh r0, [r4]
|
||||
adds r0, #1
|
||||
strh r0, [r4]
|
||||
ldr r7, _081465A4 @ =gBldRegs
|
||||
movs r1, #0
|
||||
ldrsh r0, [r4, r1]
|
||||
lsls r0, r0, #4
|
||||
ldr r1, _081465A8 @ =gUnk_083877EE
|
||||
ldrh r5, [r1, #0x22]
|
||||
adds r1, r5, #0
|
||||
bl __divsi3
|
||||
strh r0, [r7, #4]
|
||||
movs r1, #0
|
||||
ldrsh r0, [r4, r1]
|
||||
cmp r0, r5
|
||||
blt _0814659A
|
||||
ldr r1, _081465AC @ =gBgCntRegs
|
||||
ldr r0, _081465B0 @ =0x00001C07
|
||||
strh r0, [r1, #2]
|
||||
ldr r0, _081465B4 @ =0x00000241
|
||||
strh r0, [r7]
|
||||
ldr r0, _081465B8 @ =0x00001010
|
||||
strh r0, [r7, #2]
|
||||
movs r0, #0
|
||||
strh r0, [r7, #4]
|
||||
ldr r0, [r6, #8]
|
||||
movs r1, #0x21
|
||||
rsbs r1, r1, #0
|
||||
ands r0, r1
|
||||
str r0, [r6, #8]
|
||||
ldr r0, _081465BC @ =0x00001408
|
||||
adds r1, r6, r0
|
||||
ldr r0, _081465C0 @ =nullsub_134
|
||||
str r0, [r1]
|
||||
_0814659A:
|
||||
pop {r4, r5, r6, r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_081465A0: .4byte 0x0000140E
|
||||
_081465A4: .4byte gBldRegs
|
||||
_081465A8: .4byte gUnk_083877EE
|
||||
_081465AC: .4byte gBgCntRegs
|
||||
_081465B0: .4byte 0x00001C07
|
||||
_081465B4: .4byte 0x00000241
|
||||
_081465B8: .4byte 0x00001010
|
||||
_081465BC: .4byte 0x00001408
|
||||
_081465C0: .4byte nullsub_134
|
||||
|
||||
thumb_func_start sub_081465C4
|
||||
sub_081465C4: @ 0x081465C4
|
||||
push {r4, r5, r6, r7, lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
adds r4, r0, #0
|
||||
ldr r1, _081465DC @ =gUnk_08387D54
|
||||
ldrb r0, [r4, #0x10]
|
||||
ldrb r1, [r1]
|
||||
cmp r0, r1
|
||||
blo _081465E0
|
||||
movs r0, #1
|
||||
b _0814668E
|
||||
.align 2, 0
|
||||
_081465DC: .4byte gUnk_08387D54
|
||||
_081465E0:
|
||||
ldr r1, [r4, #4]
|
||||
movs r2, #1
|
||||
adds r0, r1, #0
|
||||
ands r0, r2
|
||||
cmp r0, #0
|
||||
bne _0814668C
|
||||
ldr r0, [r4, #0xc]
|
||||
ands r0, r2
|
||||
cmp r0, #0
|
||||
beq _08146650
|
||||
movs r0, #2
|
||||
ands r1, r0
|
||||
cmp r1, #0
|
||||
beq _08146650
|
||||
movs r6, #0
|
||||
ldr r0, [r4]
|
||||
cmp r6, r0
|
||||
bhi _0814668C
|
||||
ldr r0, _0814664C @ =gUnk_08387814
|
||||
mov r8, r0
|
||||
_08146608:
|
||||
ldrb r2, [r4, #0x10]
|
||||
lsls r0, r2, #1
|
||||
adds r0, r0, r2
|
||||
lsls r0, r0, #3
|
||||
add r0, r8
|
||||
ldr r0, [r0]
|
||||
adds r7, r6, #1
|
||||
cmp r6, r0
|
||||
bne _08146640
|
||||
ldr r5, _0814664C @ =gUnk_08387814
|
||||
_0814661C:
|
||||
lsls r1, r2, #1
|
||||
adds r1, r1, r2
|
||||
lsls r1, r1, #3
|
||||
adds r1, r1, r5
|
||||
adds r0, r4, #0
|
||||
bl sub_0814669C
|
||||
ldrb r0, [r4, #0x10]
|
||||
adds r0, #1
|
||||
strb r0, [r4, #0x10]
|
||||
ldrb r2, [r4, #0x10]
|
||||
lsls r0, r2, #1
|
||||
adds r0, r0, r2
|
||||
lsls r0, r0, #3
|
||||
adds r0, r0, r5
|
||||
ldr r0, [r0]
|
||||
cmp r6, r0
|
||||
beq _0814661C
|
||||
_08146640:
|
||||
lsls r0, r7, #0x10
|
||||
lsrs r6, r0, #0x10
|
||||
ldr r0, [r4]
|
||||
cmp r6, r0
|
||||
bls _08146608
|
||||
b _0814668C
|
||||
.align 2, 0
|
||||
_0814664C: .4byte gUnk_08387814
|
||||
_08146650:
|
||||
ldr r3, _08146698 @ =gUnk_08387814
|
||||
ldrb r2, [r4, #0x10]
|
||||
lsls r0, r2, #1
|
||||
adds r0, r0, r2
|
||||
lsls r0, r0, #3
|
||||
adds r0, r0, r3
|
||||
ldr r1, [r4]
|
||||
ldr r0, [r0]
|
||||
cmp r1, r0
|
||||
bne _0814668C
|
||||
adds r5, r3, #0
|
||||
_08146666:
|
||||
lsls r1, r2, #1
|
||||
adds r1, r1, r2
|
||||
lsls r1, r1, #3
|
||||
adds r1, r1, r5
|
||||
adds r0, r4, #0
|
||||
bl sub_0814669C
|
||||
ldrb r0, [r4, #0x10]
|
||||
adds r0, #1
|
||||
strb r0, [r4, #0x10]
|
||||
ldrb r2, [r4, #0x10]
|
||||
lsls r0, r2, #1
|
||||
adds r0, r0, r2
|
||||
lsls r0, r0, #3
|
||||
adds r0, r0, r5
|
||||
ldr r1, [r4]
|
||||
ldr r0, [r0]
|
||||
cmp r1, r0
|
||||
beq _08146666
|
||||
_0814668C:
|
||||
movs r0, #0
|
||||
_0814668E:
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4, r5, r6, r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.align 2, 0
|
||||
_08146698: .4byte gUnk_08387814
|
||||
|
||||
thumb_func_start sub_0814669C
|
||||
sub_0814669C: @ 0x0814669C
|
||||
push {r4, r5, r6, r7, lr}
|
||||
mov r7, sb
|
||||
mov r6, r8
|
||||
push {r6, r7}
|
||||
sub sp, #4
|
||||
mov r8, r0
|
||||
adds r7, r1, #0
|
||||
ldr r2, _08146720 @ =gUnk_08D62530
|
||||
ldrb r1, [r7, #4]
|
||||
lsls r0, r1, #1
|
||||
adds r0, r0, r1
|
||||
lsls r0, r0, #1
|
||||
adds r2, #4
|
||||
adds r0, r0, r2
|
||||
ldrh r0, [r0]
|
||||
cmp r0, #0
|
||||
bne _081466C0
|
||||
b _0814681C
|
||||
_081466C0:
|
||||
ldr r5, _08146724 @ =0x000013F6
|
||||
add r5, r8
|
||||
ldrb r0, [r5]
|
||||
adds r0, #1
|
||||
movs r1, #0
|
||||
mov sb, r1
|
||||
strb r0, [r5]
|
||||
ldr r4, _08146728 @ =0x000013F4
|
||||
add r4, r8
|
||||
ldrb r1, [r4]
|
||||
lsls r1, r1, #2
|
||||
ldr r0, _0814672C @ =0x000012EC
|
||||
add r0, r8
|
||||
adds r0, r0, r1
|
||||
ldr r6, [r0]
|
||||
mov r0, sp
|
||||
mov r1, sb
|
||||
strh r1, [r0]
|
||||
ldr r2, _08146730 @ =0x0100001A
|
||||
adds r1, r6, #0
|
||||
bl CpuSet
|
||||
ldr r1, _08146734 @ =0xFFFFFA14
|
||||
adds r0, r6, r1
|
||||
mov r1, r8
|
||||
subs r0, r0, r1
|
||||
ldr r1, _08146738 @ =0xC4EC4EC5
|
||||
muls r0, r1, r0
|
||||
asrs r0, r0, #2
|
||||
strb r0, [r6, #4]
|
||||
ldrb r0, [r4]
|
||||
adds r0, #1
|
||||
movs r1, #0x3f
|
||||
ands r0, r1
|
||||
strb r0, [r4]
|
||||
movs r0, #0
|
||||
ldrsb r0, [r5, r0]
|
||||
cmp r0, #1
|
||||
bne _08146744
|
||||
ldr r1, _0814673C @ =0x000013EC
|
||||
add r1, r8
|
||||
ldr r0, _08146740 @ =0x000013F0
|
||||
add r0, r8
|
||||
str r6, [r0]
|
||||
str r6, [r1]
|
||||
mov r0, sb
|
||||
str r0, [r6, #0x14]
|
||||
b _08146752
|
||||
.align 2, 0
|
||||
_08146720: .4byte gUnk_08D62530
|
||||
_08146724: .4byte 0x000013F6
|
||||
_08146728: .4byte 0x000013F4
|
||||
_0814672C: .4byte 0x000012EC
|
||||
_08146730: .4byte 0x0100001A
|
||||
_08146734: .4byte 0xFFFFFA14
|
||||
_08146738: .4byte 0xC4EC4EC5
|
||||
_0814673C: .4byte 0x000013EC
|
||||
_08146740: .4byte 0x000013F0
|
||||
_08146744:
|
||||
ldr r0, _08146808 @ =0x000013F0
|
||||
add r0, r8
|
||||
ldr r1, [r0]
|
||||
str r6, [r1, #0x18]
|
||||
ldr r1, [r0]
|
||||
str r1, [r6, #0x14]
|
||||
str r6, [r0]
|
||||
_08146752:
|
||||
movs r0, #0
|
||||
str r0, [r6, #0x18]
|
||||
ldr r4, _0814680C @ =gUnk_08387348
|
||||
ldrb r0, [r7, #4]
|
||||
lsls r0, r0, #4
|
||||
adds r0, r0, r4
|
||||
ldrb r0, [r0, #2]
|
||||
lsrs r0, r0, #1
|
||||
adds r0, #0xf0
|
||||
lsls r0, r0, #6
|
||||
strh r0, [r6, #0xa]
|
||||
ldrb r0, [r7, #7]
|
||||
rsbs r0, r0, #0
|
||||
adds r0, #0x78
|
||||
lsls r0, r0, #6
|
||||
strh r0, [r6, #0xc]
|
||||
ldrh r0, [r7, #0xa]
|
||||
lsrs r0, r0, #2
|
||||
rsbs r0, r0, #0
|
||||
strh r0, [r6, #0xe]
|
||||
movs r1, #0xc
|
||||
ldrsh r0, [r7, r1]
|
||||
asrs r0, r0, #2
|
||||
rsbs r0, r0, #0
|
||||
strh r0, [r6, #0x10]
|
||||
ldrb r0, [r7, #4]
|
||||
strb r0, [r6]
|
||||
ldrb r0, [r7, #5]
|
||||
strb r0, [r6, #1]
|
||||
ldrb r0, [r7, #6]
|
||||
strb r0, [r6, #2]
|
||||
ldrb r0, [r7, #9]
|
||||
strb r0, [r6, #6]
|
||||
mov r1, r8
|
||||
ldrb r0, [r1, #0x10]
|
||||
strb r0, [r6, #7]
|
||||
str r1, [r6, #0x20]
|
||||
ldrb r0, [r7, #4]
|
||||
lsls r1, r0, #4
|
||||
adds r0, r4, #0
|
||||
adds r0, #8
|
||||
adds r0, r1, r0
|
||||
ldr r3, [r0]
|
||||
cmp r3, #0
|
||||
bne _081467BC
|
||||
adds r0, r4, #0
|
||||
adds r0, #0xc
|
||||
adds r0, r1, r0
|
||||
ldrb r1, [r7, #0xe]
|
||||
ldr r0, [r0]
|
||||
lsls r1, r1, #2
|
||||
adds r1, r1, r0
|
||||
ldr r3, [r1]
|
||||
_081467BC:
|
||||
str r3, [r6, #0x1c]
|
||||
ldrb r0, [r7, #5]
|
||||
subs r2, r0, #1
|
||||
strb r2, [r6, #1]
|
||||
ldrb r1, [r7, #8]
|
||||
movs r0, #0x10
|
||||
subs r0, r0, r1
|
||||
strb r0, [r6, #5]
|
||||
ldr r0, _08146810 @ =sub_08146CE4
|
||||
cmp r3, r0
|
||||
beq _081467DC
|
||||
movs r0, #0
|
||||
strb r0, [r6, #2]
|
||||
movs r0, #0xff
|
||||
orrs r2, r0
|
||||
strb r2, [r6, #1]
|
||||
_081467DC:
|
||||
ldrb r0, [r6]
|
||||
lsls r0, r0, #4
|
||||
adds r1, r4, #4
|
||||
adds r0, r0, r1
|
||||
ldr r2, [r0]
|
||||
cmp r2, #0
|
||||
beq _081467F2
|
||||
adds r0, r6, #0
|
||||
adds r1, r7, #0
|
||||
bl _call_via_r2
|
||||
_081467F2:
|
||||
ldrb r0, [r6]
|
||||
subs r0, #1
|
||||
lsls r0, r0, #0x18
|
||||
lsrs r0, r0, #0x18
|
||||
cmp r0, #3
|
||||
bhi _08146814
|
||||
mov r0, r8
|
||||
adds r1, r6, #0
|
||||
bl sub_081469D4
|
||||
b _0814681C
|
||||
.align 2, 0
|
||||
_08146808: .4byte 0x000013F0
|
||||
_0814680C: .4byte gUnk_08387348
|
||||
_08146810: .4byte sub_08146CE4
|
||||
_08146814:
|
||||
mov r0, r8
|
||||
adds r1, r6, #0
|
||||
bl sub_0814682C
|
||||
_0814681C:
|
||||
add sp, #4
|
||||
pop {r3, r4}
|
||||
mov r8, r3
|
||||
mov sb, r4
|
||||
pop {r4, r5, r6, r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_0814682C
|
||||
sub_0814682C: @ 0x0814682C
|
||||
push {r4, r5, r6, r7, lr}
|
||||
|
@ -6,8 +6,42 @@
|
||||
#include "data.h"
|
||||
#include "code_0814F274.h"
|
||||
|
||||
struct Unk_08145B64_5EC { // TODO: struct LevelInfo_1E8_14?
|
||||
u8 filler[0x34];
|
||||
struct Unk_08387814 {
|
||||
u32 unk0;
|
||||
u8 unk4;
|
||||
u8 unk5;
|
||||
u8 unk6;
|
||||
u8 unk7;
|
||||
u8 unk8;
|
||||
u8 unk9;
|
||||
u16 unkA;
|
||||
s16 unkC;
|
||||
u8 unkE;
|
||||
u8 fillerF[9];
|
||||
}; /* size = 0x18 */
|
||||
|
||||
struct Unk_08145B64;
|
||||
|
||||
struct Unk_08145B64_5EC {
|
||||
u8 unk0;
|
||||
u8 unk1;
|
||||
u8 unk2;
|
||||
u8 unk3;
|
||||
u8 unk4;
|
||||
u8 unk5;
|
||||
u8 unk6;
|
||||
u8 unk7;
|
||||
u16 filler8;
|
||||
u16 unkA;
|
||||
u16 unkC;
|
||||
u16 unkE;
|
||||
u16 unk10;
|
||||
u16 filler12;
|
||||
struct Unk_08145B64_5EC *unk14;
|
||||
struct Unk_08145B64_5EC *unk18;
|
||||
void (*unk1C)(struct Unk_08145B64 *);
|
||||
struct Unk_08145B64 *unk20;
|
||||
u8 filler24[0x10];
|
||||
}; /* size = 0x34 */
|
||||
|
||||
struct Unk_08145B64 {
|
||||
@ -15,7 +49,8 @@ struct Unk_08145B64 {
|
||||
u32 unk4;
|
||||
u32 unk8;
|
||||
u32 unkC;
|
||||
u8 filler10[2];
|
||||
u8 unk10;
|
||||
u8 unk11;
|
||||
u8 unk12[0x10];
|
||||
struct Object11 unk24;
|
||||
u16 filler30;
|
||||
@ -28,15 +63,18 @@ struct Unk_08145B64 {
|
||||
u8 filler5C8[0x24];
|
||||
struct Unk_08145B64_5EC unk5EC[0x40];
|
||||
struct Unk_08145B64_5EC *unk12EC[0x40];
|
||||
u32 unk13EC;
|
||||
u32 unk13F0;
|
||||
u32 filler13F8;
|
||||
struct Unk_08145B64_5EC *unk13EC;
|
||||
struct Unk_08145B64_5EC *unk13F0;
|
||||
u8 unk13F4;
|
||||
u8 unk13F5;
|
||||
s8 unk13F6;
|
||||
bool32 (*unk13F8)(struct Unk_08145B64 *);
|
||||
u32 filler13FC;
|
||||
void (*unk1400)(struct Unk_08145B64 *);
|
||||
u32 filler1404;
|
||||
void (*unk1408)(struct Unk_08145B64 *);
|
||||
u16 unk140C;
|
||||
s16 unk140E;
|
||||
void (*unk1410)(struct Unk_08145B64 *);
|
||||
u8 unk1414;
|
||||
u8 unk1415;
|
||||
@ -46,4 +84,13 @@ struct Unk_08145B64 {
|
||||
u8 unk1419;
|
||||
}; /* size = 0x141C */
|
||||
|
||||
struct Unk_08387348 {
|
||||
u8 unk0;
|
||||
u8 unk1;
|
||||
u8 unk2;
|
||||
void (*unk4)(struct Unk_08145B64_5EC *, const struct Unk_08387814 *);
|
||||
void (*unk8)(struct Unk_08145B64 *);
|
||||
void (*const *unkC)(struct Unk_08145B64 *);
|
||||
}; /* size = 0x10 */
|
||||
|
||||
#endif
|
||||
|
179
src/intro.c
179
src/intro.c
@ -10,6 +10,12 @@ void sub_08145F38(struct Unk_08145B64 *);
|
||||
void sub_08146018(struct Unk_08145B64 *);
|
||||
void sub_081460CC(struct Unk_08145B64 *);
|
||||
void sub_081461AC(struct Unk_08145B64 *);
|
||||
void sub_08146398(struct Unk_08145B64 *, u8);
|
||||
void sub_08146414(struct Unk_08145B64 *, u8);
|
||||
void sub_081464D4(struct Unk_08145B64 *, u8);
|
||||
void sub_0814669C(struct Unk_08145B64 *, const struct Unk_08387814 *);
|
||||
void sub_0814682C(struct Unk_08145B64 *, struct Unk_08145B64_5EC *);
|
||||
void sub_081469D4(struct Unk_08145B64 *, struct Unk_08145B64_5EC *);
|
||||
bool32 sub_08148CD8(struct Unk_08145B64 *);
|
||||
void sub_081494E4(struct Unk_08145B64 *);
|
||||
void sub_08149628(struct Unk_08145B64 *);
|
||||
@ -19,10 +25,19 @@ void sub_08149680(struct Unk_08145B64 *);
|
||||
void sub_081496C8(struct Unk_08145B64 *);
|
||||
void sub_08149710(struct Unk_08145B64 *, u8);
|
||||
void sub_08149758(struct Unk_08145B64 *);
|
||||
void nullsub_134(struct Unk_08145B64 *);
|
||||
bool32 sub_081497B0(struct Unk_08145B64 *);
|
||||
|
||||
extern const struct Unk_08387348 gUnk_08387348[];
|
||||
extern const u8 gUnk_083877A8[][8];
|
||||
extern const u16 gUnk_083877D2[2];
|
||||
extern const u16 gUnk_083877D6[2];
|
||||
extern const u16 gUnk_083877DA[2];
|
||||
extern const u16 gUnk_083877EE[];
|
||||
extern const struct Unk_08387814 gUnk_08387814[];
|
||||
extern const u8 gUnk_08387D54;
|
||||
|
||||
extern const u16 gUnk_08D62530[][3];
|
||||
|
||||
void sub_08145B64(u16 a1) {
|
||||
u8 i;
|
||||
@ -55,7 +70,7 @@ void sub_08145B64(u16 a1) {
|
||||
var->unk548[i] = &var->unk48[i];
|
||||
for (i = 0; i < 0x40; ++i)
|
||||
var->unk12EC[i] = &var->unk5EC[i];
|
||||
var->unk13EC = var->unk13F0 = 0;
|
||||
var->unk13EC = var->unk13F0 = NULL;
|
||||
for (i = 0; i < 0x10; ++i)
|
||||
var->unk12[i] = 0xFF;
|
||||
}
|
||||
@ -196,3 +211,165 @@ void sub_081461AC(struct Unk_08145B64 *a1) {
|
||||
if (unk0 >= gUnk_083877EE[0xE])
|
||||
a1->unk1410 = nullsub_133;
|
||||
}
|
||||
|
||||
void sub_0814623C(struct Unk_08145B64 *a1) {
|
||||
u32 unk0 = a1->unk0;
|
||||
|
||||
++a1->unk1417;
|
||||
if (a1->unk1417 == a1->unk1418 - 2) {
|
||||
m4aSongNumStart(614);
|
||||
a1->unk1415 = (Rand32() & 3) - 1;
|
||||
} else if (a1->unk1417 == a1->unk1418) {
|
||||
a1->unk1417 = 0;
|
||||
a1->unk1418 = (Rand32() & 0x1F) + 3;
|
||||
a1->unk1415 = 0;
|
||||
a1->unk1414 = 0;
|
||||
}
|
||||
if (unk0 >= gUnk_083877EE[0xE]) {
|
||||
a1->unk1415 = 0;
|
||||
a1->unk1414 = 0;
|
||||
a1->unk1410 = nullsub_133;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08146308(struct Unk_08145B64 *a1, u8 a2) {
|
||||
u8 bg = a2 + 2;
|
||||
u16 cnt[2];
|
||||
|
||||
memcpy(cnt, gUnk_083877D2, sizeof(gUnk_083877D2));
|
||||
a1->unk32[a2] += a1->unk36[a2];
|
||||
gBgScrollRegs[bg][0] = a1->unk32[a2] >> 6;
|
||||
if (gBgScrollRegs[bg][0] >= 0x100) {
|
||||
gBgCntRegs[bg] = cnt[a2];
|
||||
gBgScrollRegs[bg][0] -= 0x100;
|
||||
a1->unk32[a2] -= 0x4000;
|
||||
a1->unk3C[a2] = sub_08146398;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08146398(struct Unk_08145B64 *a1, u8 a2) {
|
||||
u8 bg = a2 + 2;
|
||||
|
||||
a1->unk32[a2] += a1->unk36[a2];
|
||||
gBgScrollRegs[bg][0] = a1->unk32[a2] >> 6;
|
||||
if (gBgScrollRegs[bg][0] >= 0x100) {
|
||||
gBgScrollRegs[bg][0] -= 0x100;
|
||||
a1->unk32[a2] -= 0x4000;
|
||||
}
|
||||
if (a1->unk0 >= gUnk_083877EE[3 * a2 + 5])
|
||||
a1->unk3C[a2] = sub_08146414;
|
||||
}
|
||||
|
||||
void sub_08146414(struct Unk_08145B64 *a1, u8 a2) {
|
||||
u8 bg = a2 + 2;
|
||||
u16 cnt[2];
|
||||
u16 r8 = gBgScrollRegs[bg][0];
|
||||
|
||||
memcpy(cnt, gUnk_083877D6, sizeof(gUnk_083877D6));
|
||||
a1->unk32[a2] += a1->unk36[a2];
|
||||
gBgScrollRegs[bg][0] = a1->unk32[a2] >> 6;
|
||||
if (gBgScrollRegs[bg][0] >= 0x100) {
|
||||
gBgScrollRegs[bg][0] -= 0x100;
|
||||
a1->unk32[a2] -= 0x4000;
|
||||
}
|
||||
if (r8 < 0x10 && gBgScrollRegs[bg][0] >= 0x10) {
|
||||
gBgCntRegs[bg] = cnt[a2];
|
||||
gBgScrollRegs[bg][0] += 0x100;
|
||||
a1->unk32[a2] += 0x4000;
|
||||
a1->unk3C[a2] = sub_081464D4;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_081464D4(struct Unk_08145B64 *a1, u8 a2) {
|
||||
u8 bg = a2 + 2;
|
||||
u16 cnt[2];
|
||||
|
||||
memcpy(cnt, gUnk_083877DA, sizeof(gUnk_083877DA));
|
||||
a1->unk32[a2] += a1->unk36[a2];
|
||||
gBgScrollRegs[bg][0] = a1->unk32[a2] >> 6;
|
||||
if (gBgScrollRegs[bg][0] >= 0x200) {
|
||||
a1->unk32[a2] = 0;
|
||||
gBgScrollRegs[bg][0] = 0;
|
||||
gDispCnt &= ~cnt[a2];
|
||||
a1->unk3C[a2] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0814654C(struct Unk_08145B64 *a1) {
|
||||
++a1->unk140E;
|
||||
gBldRegs.bldY = 0x10 * a1->unk140E / gUnk_083877EE[0x11];
|
||||
if (a1->unk140E >= gUnk_083877EE[0x11]) {
|
||||
gBgCntRegs[1] = BGCNT_PRIORITY(3) | BGCNT_CHARBASE(1) | BGCNT_SCREENBASE(28) | BGCNT_16COLOR | BGCNT_TXT256x256;
|
||||
gBldRegs.bldCnt = BLDCNT_TGT1_BG0 | BLDCNT_TGT2_BG1 | BLDCNT_EFFECT_BLEND;
|
||||
gBldRegs.bldAlpha = BLDALPHA_BLEND(0x10, 0x10);
|
||||
gBldRegs.bldY = 0;
|
||||
a1->unk8 &= ~0x20;
|
||||
a1->unk1408 = nullsub_134;
|
||||
}
|
||||
}
|
||||
|
||||
bool32 sub_081465C4(struct Unk_08145B64 *a1) {
|
||||
if (a1->unk10 >= gUnk_08387D54)
|
||||
return TRUE;
|
||||
else {
|
||||
if (!(a1->unk4 & 1)) {
|
||||
if (a1->unkC & 1 && a1->unk4 & 2) {
|
||||
u16 i;
|
||||
|
||||
for (i = 0; i <= a1->unk0; ++i) {
|
||||
for (; i == gUnk_08387814[a1->unk10].unk0; ++a1->unk10)
|
||||
sub_0814669C(a1, &gUnk_08387814[a1->unk10]);
|
||||
}
|
||||
} else {
|
||||
for (; a1->unk0 == gUnk_08387814[a1->unk10].unk0; ++a1->unk10)
|
||||
sub_0814669C(a1, &gUnk_08387814[a1->unk10]);
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0814669C(struct Unk_08145B64 *a1, const struct Unk_08387814 *a2) {
|
||||
struct Unk_08145B64_5EC *v4;
|
||||
|
||||
if (gUnk_08D62530[a2->unk4][2]) {
|
||||
++a1->unk13F6;
|
||||
v4 = a1->unk12EC[a1->unk13F4];
|
||||
CpuFill16(0, v4, sizeof(struct Unk_08145B64_5EC));
|
||||
// TODO: -0x3B13B13B is 0xC4EC4EC5 when unsigned, which is the multiplicative inverse for 0xD (mod 2^32). But how is it relevant here?
|
||||
v4->unk4 = (s32)(({(s32)v4 - offsetof(struct Unk_08145B64, unk5EC);}) - (s32)a1) * -0x3B13B13B >> 2;
|
||||
a1->unk13F4 = (a1->unk13F4 + 1) & 0x3F;
|
||||
if (a1->unk13F6 == 1) {
|
||||
a1->unk13EC = a1->unk13F0 = v4;
|
||||
v4->unk14 = NULL;
|
||||
} else {
|
||||
a1->unk13F0->unk18 = v4;
|
||||
v4->unk14 = a1->unk13F0;
|
||||
a1->unk13F0 = v4;
|
||||
}
|
||||
v4->unk18 = NULL;
|
||||
v4->unkA = ((gUnk_08387348[a2->unk4].unk2 >> 1) + 0xF0) * 0x40;
|
||||
v4->unkC = (-a2->unk7 + 0x78) << 6;
|
||||
v4->unkE = -(a2->unkA >> 2);
|
||||
v4->unk10 = -(({a2->unkC + 0;}) >> 2);
|
||||
v4->unk0 = a2->unk4;
|
||||
v4->unk1 = a2->unk5;
|
||||
v4->unk2 = a2->unk6;
|
||||
v4->unk6 = a2->unk9;
|
||||
v4->unk7 = a1->unk10;
|
||||
v4->unk20 = a1;
|
||||
v4->unk1C = gUnk_08387348[a2->unk4].unk8 ? gUnk_08387348[a2->unk4].unk8 : gUnk_08387348[a2->unk4].unkC[a2->unkE];
|
||||
v4->unk1 = a2->unk5 - 1;
|
||||
v4->unk5 = 0x10 - a2->unk8;
|
||||
if (v4->unk1C != sub_08146CE4) {
|
||||
v4->unk2 = 0;
|
||||
v4->unk1 = 0xFF;
|
||||
}
|
||||
if (gUnk_08387348[v4->unk0].unk4)
|
||||
gUnk_08387348[v4->unk0].unk4(v4, a2);
|
||||
if (v4->unk0 > 0 && v4->unk0 < 5)
|
||||
sub_081469D4(a1, v4);
|
||||
else
|
||||
sub_0814682C(a1, v4);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user