.text
.align 2
.thumb
.thumb_func
/*
replace pointer(+1) at 7630 to this routine
*/
new_rot_start:
lsl r1, r4, #0x1
add r1, r1, r4
lsl r1, r1, #0x2
add r2, r1, r6
ldr r0, [r2]
push {r2-r5}
mov r2, #0x80
ldr r1, .first_male_back
lsl r2, r2, #0x4
mov r4, #0x0
compare_loop:
cmp r0, r1
beq other_tag
add r1, r1, r2
add r4, #0x1
cmp r4, #0x1A
blt compare_loop
print_picture:
pop {r2-r5}
lsl r1, r4, #0x1
add r1, r1, r4
lsl r1, r1, #0x2
add r1, r1, r7
ldr r1, [r1]
ldrh r2, [r2, #8]
lsr r2, r2, #0x1
swi #0xb
ldr r1, .return_addr
bx r1
.hword 0x0000
.first_male_back: .word 0x08E69EBC
.return_addr: .word 0x08007641
other_tag:
cmp r4, #0xA
blt FR_hero
sub r4, #0xA
change_picture:
cmp r4, #0x4
blt all_maned
sub r4, #0x4
b change_picture
FR_hero:
cmp r4, #0x5
blt all_maned
sub r4, #0x5
b FR_hero
all_maned:
mov r5, r0
ldr r0, .var_4062
bl call_var_load
cmp r0, #0x0
beq print_old_picture
ldr r1, .table_addr
lsl r3 ,r0, #0x5
lsl r0, r0, #0x3
add r0, r0, r3
lsl r5, r4, #0x3 @r5 = frame number
add r4, r1, r5
add r4, r0, r4
ldr r3, [r4]
cmp r3, #0x0
beq print_old_picture
ldr r0, [r4, #0x4]
ldr r1, .first_pallette_slot
mov r2, #0x10
swi 0xb
mov r4, #0xc0
add r1, r1, r4
swi 0xb
ldr r1, .pallete_dump
cmp r5, #0x0 @first frame
bne Other
swi 0xB @player first frame as normal
add r1, r1, r4
mov r8, r8 @trainer pal fix
b Continue
Other:
mov r8, r8 @player pal fix
add r1, r1, r4
swi 0xB
Continue:
mov r0, r3
b print_picture
print_old_picture:
add r0, r5, #0x0
b print_picture
call_var_load:
ldr r1, .var_load
bx r1
.var_load: .word 0x0806E569
.var_4062: .word 0x00004062
.table_addr: .word 0x081ab1d8
.first_pallette_slot: .word 0x05000200
.pallete_dump: .word 0x020377f8