pokeemerald/asm/intro_credits_graphics.s
2018-02-16 13:08:21 -06:00

460 lines
7.0 KiB
ArmAsm

.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start sub_817B698
sub_817B698: @ 817B698
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0xC
str r1, [sp, 0x4]
str r2, [sp, 0x8]
lsls r0, 24
lsrs r0, 24
str r0, [sp]
lsls r3, 24
lsrs r3, 24
mov r8, r3
movs r7, 0
cmp r7, r8
bcs _0817B74E
ldr r0, =gSprites
mov r10, r0
movs r2, 0x3F
mov r9, r2
_0817B6C2:
lsls r6, r7, 3
ldr r0, [sp, 0x4]
adds r6, r0
ldrb r1, [r6, 0x1]
ldrb r2, [r6, 0x2]
ldrb r3, [r6, 0x3]
ldr r0, =gUnknown_085F504C
bl CreateSprite
lsls r0, 24
lsrs r0, 24
lsls r5, r0, 4
adds r5, r0
lsls r5, 2
mov r2, r10
adds r4, r5, r2
ldrb r2, [r6]
lsls r1, r2, 26
lsrs r1, 30
lsrs r2, 6
adds r0, r4, 0
movs r3, 0
bl CalcCenterToCornerVec
ldrb r3, [r4, 0x5]
movs r0, 0xC
orrs r3, r0
strb r3, [r4, 0x5]
ldrb r1, [r6]
lsls r1, 26
lsrs r1, 30
lsls r1, 6
ldrb r2, [r4, 0x1]
mov r0, r9
ands r0, r2
orrs r0, r1
strb r0, [r4, 0x1]
ldrb r1, [r6]
lsrs r1, 6
lsls r1, 6
ldrb r2, [r4, 0x3]
mov r0, r9
ands r0, r2
orrs r0, r1
strb r0, [r4, 0x3]
movs r0, 0xF
ands r3, r0
strb r3, [r4, 0x5]
ldr r0, =gSprites + 8
adds r5, r0
ldr r2, [sp, 0x8]
str r2, [r5]
ldrb r1, [r6]
lsls r1, 28
lsrs r1, 28
adds r0, r4, 0
bl StartSpriteAnim
movs r1, 0
mov r0, sp
ldrh r0, [r0]
strh r0, [r4, 0x2E]
ldrh r0, [r6, 0x4]
strh r0, [r4, 0x30]
strh r1, [r4, 0x32]
adds r0, r7, 0x1
lsls r0, 24
lsrs r7, r0, 24
cmp r7, r8
bcc _0817B6C2
_0817B74E:
add sp, 0xC
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end sub_817B698
thumb_func_start sub_817B76C
sub_817B76C: @ 817B76C
push {lr}
ldr r1, =gUnknown_085F50A4
ldr r2, =gUnknown_085F5094
movs r0, 0
movs r3, 0x9
bl sub_817B698
pop {r0}
bx r0
.pool
thumb_func_end sub_817B76C
thumb_func_start sub_817B788
sub_817B788: @ 817B788
push {lr}
ldr r1, =gUnknown_085F5120
ldr r2, =gUnknown_085F5114
movs r0, 0x1
movs r3, 0xC
bl sub_817B698
pop {r0}
bx r0
.pool
thumb_func_end sub_817B788
thumb_func_start sub_817B7A4
sub_817B7A4: @ 817B7A4
push {lr}
ldr r1, =gUnknown_085F519C
ldr r2, =gUnknown_085F5198
movs r0, 0x1
movs r3, 0x6
bl sub_817B698
pop {r0}
bx r0
.pool
thumb_func_end sub_817B7A4
thumb_func_start nullsub_65
nullsub_65: @ 817B7C0
bx lr
thumb_func_end nullsub_65
thumb_func_start sub_817B7C4
sub_817B7C4: @ 817B7C4
push {r4,lr}
ldr r4, =gSprites
movs r1, 0x2E
ldrsh r2, [r0, r1]
lsls r1, r2, 4
adds r1, r2
lsls r1, 2
adds r1, r4
adds r1, 0x3E
ldrb r1, [r1]
movs r2, 0x3E
adds r2, r0
mov r12, r2
movs r2, 0x4
ands r2, r1
mov r1, r12
ldrb r3, [r1]
movs r1, 0x5
negs r1, r1
ands r1, r3
orrs r1, r2
mov r2, r12
strb r1, [r2]
movs r1, 0x2E
ldrsh r2, [r0, r1]
lsls r1, r2, 4
adds r1, r2
lsls r1, 2
adds r1, r4
ldrh r1, [r1, 0x20]
strh r1, [r0, 0x20]
lsls r1, r2, 4
adds r1, r2
lsls r1, 2
adds r1, r4
ldrh r1, [r1, 0x22]
adds r1, 0x8
strh r1, [r0, 0x22]
lsls r1, r2, 4
adds r1, r2
lsls r1, 2
adds r1, r4
ldrh r1, [r1, 0x24]
strh r1, [r0, 0x24]
lsls r1, r2, 4
adds r1, r2
lsls r1, 2
adds r1, r4
ldrh r1, [r1, 0x26]
strh r1, [r0, 0x26]
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_817B7C4
thumb_func_start intro_create_brendan_sprite
intro_create_brendan_sprite: @ 817B834
push {r4-r6,lr}
adds r5, r0, 0
adds r4, r1, 0
ldr r0, =gUnknown_085F51EC
lsls r5, 16
asrs r5, 16
lsls r4, 16
asrs r4, 16
adds r1, r5, 0
adds r2, r4, 0
movs r3, 0x2
bl CreateSprite
adds r6, r0, 0
lsls r6, 24
lsrs r6, 24
ldr r0, =gUnknown_085F523C
adds r4, 0x8
lsls r4, 16
asrs r4, 16
adds r1, r5, 0
adds r2, r4, 0
movs r3, 0x3
bl CreateSprite
lsls r0, 24
lsrs r0, 24
ldr r2, =gSprites
lsls r1, r0, 4
adds r1, r0
lsls r1, 2
adds r1, r2
strh r6, [r1, 0x2E]
adds r0, r6, 0
pop {r4-r6}
pop {r1}
bx r1
.pool
thumb_func_end intro_create_brendan_sprite
thumb_func_start intro_create_may_sprite
intro_create_may_sprite: @ 817B88C
push {r4-r6,lr}
adds r5, r0, 0
adds r4, r1, 0
ldr r0, =gUnknown_085F5204
lsls r5, 16
asrs r5, 16
lsls r4, 16
asrs r4, 16
adds r1, r5, 0
adds r2, r4, 0
movs r3, 0x2
bl CreateSprite
adds r6, r0, 0
lsls r6, 24
lsrs r6, 24
ldr r0, =gUnknown_085F5254
adds r4, 0x8
lsls r4, 16
asrs r4, 16
adds r1, r5, 0
adds r2, r4, 0
movs r3, 0x3
bl CreateSprite
lsls r0, 24
lsrs r0, 24
ldr r2, =gSprites
lsls r1, r0, 4
adds r1, r0
lsls r1, 2
adds r1, r2
strh r6, [r1, 0x2E]
adds r0, r6, 0
pop {r4-r6}
pop {r1}
bx r1
.pool
thumb_func_end intro_create_may_sprite
thumb_func_start nullsub_66
nullsub_66: @ 817B8E4
bx lr
thumb_func_end nullsub_66
thumb_func_start sub_817B8E8
sub_817B8E8: @ 817B8E8
push {r4,lr}
ldr r4, =gSprites
movs r1, 0x2E
ldrsh r2, [r0, r1]
lsls r1, r2, 4
adds r1, r2
lsls r1, 2
adds r1, r4
adds r1, 0x3E
ldrb r1, [r1]
movs r2, 0x3E
adds r2, r0
mov r12, r2
movs r2, 0x4
ands r2, r1
mov r1, r12
ldrb r3, [r1]
movs r1, 0x5
negs r1, r1
ands r1, r3
orrs r1, r2
mov r2, r12
strb r1, [r2]
movs r1, 0x2E
ldrsh r2, [r0, r1]
lsls r1, r2, 4
adds r1, r2
lsls r1, 2
adds r1, r4
ldrh r1, [r1, 0x22]
strh r1, [r0, 0x22]
lsls r1, r2, 4
adds r1, r2
lsls r1, 2
adds r1, r4
ldrh r1, [r1, 0x24]
strh r1, [r0, 0x24]
lsls r1, r2, 4
adds r1, r2
lsls r1, 2
adds r1, r4
ldrh r1, [r1, 0x26]
strh r1, [r0, 0x26]
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_817B8E8
thumb_func_start sub_817B948
sub_817B948: @ 817B948
push {r4-r6,lr}
mov r6, r8
push {r6}
adds r2, r0, 0
adds r5, r1, 0
ldr r0, =gUnknown_085F528C
mov r8, r0
lsls r2, 16
asrs r4, r2, 16
ldr r0, =0xffe00000
adds r2, r0
asrs r2, 16
lsls r5, 16
asrs r5, 16
mov r0, r8
adds r1, r2, 0
adds r2, r5, 0
movs r3, 0x5
bl CreateSprite
adds r6, r0, 0
lsls r6, 24
lsrs r6, 24
adds r4, 0x20
lsls r4, 16
asrs r4, 16
mov r0, r8
adds r1, r4, 0
adds r2, r5, 0
movs r3, 0x6
bl CreateSprite
lsls r0, 24
lsrs r0, 24
ldr r5, =gSprites
lsls r4, r0, 4
adds r4, r0
lsls r4, 2
adds r0, r4, r5
strh r6, [r0, 0x2E]
movs r1, 0x1
bl StartSpriteAnim
adds r5, 0x1C
adds r4, r5
ldr r0, =sub_817B8E8
str r0, [r4]
adds r0, r6, 0
pop {r3}
mov r8, r3
pop {r4-r6}
pop {r1}
bx r1
.pool
thumb_func_end sub_817B948
thumb_func_start intro_create_flygon_sprite
intro_create_flygon_sprite: @ 817B9C4
push {r4-r6,lr}
mov r6, r8
push {r6}
adds r2, r0, 0
adds r5, r1, 0
ldr r0, =gUnknown_085F52A4
mov r8, r0
lsls r2, 16
asrs r4, r2, 16
ldr r0, =0xffe00000
adds r2, r0
asrs r2, 16
lsls r5, 16
asrs r5, 16
mov r0, r8
adds r1, r2, 0
adds r2, r5, 0
movs r3, 0x5
bl CreateSprite
adds r6, r0, 0
lsls r6, 24
lsrs r6, 24
adds r4, 0x20
lsls r4, 16
asrs r4, 16
mov r0, r8
adds r1, r4, 0
adds r2, r5, 0
movs r3, 0x6
bl CreateSprite
lsls r0, 24
lsrs r0, 24
ldr r5, =gSprites
lsls r4, r0, 4
adds r4, r0
lsls r4, 2
adds r0, r4, r5
strh r6, [r0, 0x2E]
movs r1, 0x1
bl StartSpriteAnim
adds r5, 0x1C
adds r4, r5
ldr r0, =sub_817B8E8
str r0, [r4]
adds r0, r6, 0
pop {r3}
mov r8, r3
pop {r4-r6}
pop {r1}
bx r1
.pool
thumb_func_end intro_create_flygon_sprite
.align 2, 0 @ Don't pad with nop.