.global mega_animation_script_data
.equ ANIM_XX, 0x2831
.equ ANIM_YY, 0x2832
.equ ANIM_ZZ, 0x2833 @@ New particles are not the reason of the problem, already checked
.equ TheValue, 0x40
.equ SizeRom, 0x8000000
@Buffer Particles:
.byte 0x00
.hword ANIM_XX
.byte 0x00
.hword ANIM_YY
.byte 0x00
.hword ANIM_ZZ
@Charge rainbow particle
.byte 0x0A , 0x02 , 0x0C , 0x0C , 0x08 , 0x1C , 0x8C , 0x00 , 0xC0 , 0x0D , 0x03
.byte 0x03 , 0x05 , 0x5A , 0x11 , 0x08 , 0x02 , 0x06 , 0x02 , 0x00 , 0x00 , 0x00
.byte 0x06 , 0x00 , 0x00 , 0x00 , 0x0B , 0x00 , 0xFF , 0x2F
.byte 0x0E
.word anim_rainbow_x+SizeRom
.byte 0x0E
.word anim_rainbow_x+SizeRom
.byte 0x0E
.word anim_rainbow_x+SizeRom
.byte 0x05 , 0x0B
@Load mega stone :
.byte 0x02 , 0x0D , 0x04 , 0x00 , 0x17 , 0x0A , 0x00 , 0x0C , 0x0C , 0x08 , 0x19 , 0xC9 , 0x00 , 0xC0
.byte 0x02
.word anim_mega_stone_x+SizeRom
.byte 0x29 , 0x04 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00
@Whiteout screen:
.byte 0x04 , 0x14 , 0x03 , 0x65 , 0x66 , 0x11 , 0x08 , 0x05 , 0x05 , 0x05 , 0x00 , 0x02 , 0x00 , 0x00 , 0x00
.byte 0x10 , 0x00 , 0xFF , 0xFF , 0x03 , 0x49 , 0x68 , 0x11 , 0x08 , 0x05 , 0x05
.hword ANIM_YY
.byte 0x02 , 0x00 , 0x00 , 0x00 , 0x10 , 0x00 , 0xFF , 0xFF , 0x05 , 0x03 , 0x49 , 0x68 , 0x11 , 0x08 , 0x05
@Swap_spprite:
.byte 0x00 , 0x03
.word swap_sprite_routine+SizeRom+1 @@@@@@@@@@ Your routine swap sprite
.byte 0x02 , 0x00
@Return screen:
.byte 0x00 , 0x2D , 0x27 , 0x03 , 0x65 , 0x66 , 0x11 , 0x08, 0x05 , 0x05 , 0x05 , 0x00 , 0x02 , 0x00
.byte 0x10 , 0x00 , 0x00 , 0x00 , 0xFF , 0xFF , 0x03 , 0xDD , 0x52 , 0x11 , 0x08 , 0x05 , 0x03 , 0x01
.byte 0x00 , 0x05 , 0x00 , 0x0E , 0x00 , 0x05 , 0x0B
@ Show Mega evolution symbol:
.byte 0x02 , 0x04 , 0x01 , 0x0A , 0x03 , 0x19 , 0x79 , 0x00 , 0x3F
.byte 0x02
.word anim_mega_symbol_x+SizeRom
.byte 0x82 , 0x00 , 0x05 , 0x0B , 0x0D , 0x08 , 0x08
.align 2
anim_rainbow_x:
.byte 0x02
.word anim_rainbow_y+SizeRom
.byte 0x02 , 0x03 , 0x03 , 0x28 , 0x00 , 0xF6 , 0x0D , 0x00 , 0x04 , 0x03
.byte 0x02
.word anim_rainbow_y+SizeRom
.byte 0x02 , 0x03 , 0xDD , 0xFF , 0xF6 , 0xFF , 0x0D , 0x00 , 0x04 , 0x03
.byte 0x02
.word anim_rainbow_y+SizeRom
.byte 0x02 , 0x03 , 0x0F , 0x00 , 0xD8 , 0xFF , 0x0D , 0x00 , 0x04 , 0x03
.byte 0x02
.word anim_rainbow_y+SizeRom
.byte 0x02 , 0x03 , 0xF6 , 0xFF , 0xE0 , 0xFF , 0x0D , 0x00 , 0x04 , 0x03
.byte 0x02
.word anim_rainbow_y+SizeRom
.byte 0x02 , 0x03 , 0x19 , 0x00 , 0xEC , 0xFF , 0x0D , 0x00 , 0x04 , 0x03
.byte 0x02
.word anim_rainbow_y+SizeRom
.byte 0x02 , 0x03 , 0xD8 , 0xFF , 0xEC , 0xFF , 0x0D , 0x00 , 0x04 , 0x03
.byte 0x02
.word anim_rainbow_y+SizeRom
.byte 0x02 , 0x03 , 0x05 , 0x00 , 0xD8 , 0xFF , 0x0D , 0x00 , 0x04 , 0x03 , 0x0F
.align 2
anim_rainbow_y:
.hword ANIM_XX
.hword ANIM_XX
.byte 0x8C , 0x4A , 0x52 , 0x08 , 0xC8 , 0x21 , 0x59 , 0x08 , 0x00 , 0x00 , 0x00 , 0x00
.byte 0xDC , 0x21 , 0x59 , 0x08 , 0xE1 , 0xE8 , 0x0F , 0x08
.align 2
anim_mega_stone_x:
.hword ANIM_YY
.hword ANIM_YY
.byte 0xFC , 0x4A , 0x52 , 0x08 , 0x9C , 0xC6 , 0x2E , 0x08 , 0x00 , 0x00 , 0x00 , 0x00 , 0x94
.byte 0x68 , 0x59 , 0x08 , 0xC9 , 0x77 , 0x0A , 0x08
.align 2
anim_mega_symbol_x:
.hword ANIM_ZZ
.hword ANIM_ZZ
.byte 0x34 , 0x4A , 0x52 , 0x08 , 0x9C , 0xC6 , 0x2E , 0x08 , 0x00 , 0x00 , 0x00 , 0x00
.byte 0xA8 , 0xC6 , 0x2E , 0x08 , 0x79 , 0x2B , 0x11 , 0x08
.align 2
swap_sprite_routine:
push {r4-r7, lr}
ldr r1, Attackeranim
ldr r2, battle_side_objid
ldrb r3, [r1]
ldrb r2, [r2, r3]
ldr r3, tasks
mov r12, r3
lsl r4, r0, #2
add r4, r4, r0
lsl r4, r4, #3
add r4, r12
mov r7, r4
ldrh r3, [r4, #0x1C]
cmp r3, #2
beq AddTaskMaybe
cmp r3, #0
beq Hidingsprite
cmp r3, #1
beq WeRefreshGraphics
cmp r3, #3
beq TaskRunningSomething
cmp r3, #4
bne End
lsl r3, r2, #4
add r2, r3, r2
ldr r3, somethingnotsureeither
mov r12, r3
lsl r2, r2, #2
ldrh r3, [r4, #0x1E]
add r2, r12
strh r3, [r2]
push {r0-r2}
ldr r0, Attackeranim
ldrb r0, [r0]
mov r1, #0x58
mul r1, r0
ldr r2, BattleData
add r1, r2
ldrh r1, [r1]
ldr r3, shadupdate
bl Jump
pop {r0-r2}
ldr r3, move_anim_task_del
bl Jump
End:
pop {r4-r7, pc}
WeRefreshGraphics:
ldr r3, Refreshgraphics
ldrb r0, [r1]
mov r1, #1
bl Jump
AddEnd:
ldrh r3, [r4, #0x1C]
add r3, #1
strh r3, [r4, #0x1C]
b End
Hidingsprite:
ldr r0, somethingnotsureeither
mov r12, r0
lsl r3, r2, #4
add r3, r3, r2
lsl r3, r3, #2
add r3, r12
mov r5, r3
ldrh r0, [r3]
strh r0, [r4, #0x1E]
mov r0, #TheValue
neg r0, r0
strh r0, [r3]
ldrh r3, [r4, #0x1C]
add r3, #1
strh r3, [r4, #0x1C]
b End
TaskRunningSomething:
ldr r3, task_find_id_by_funcptr
ldr r0, SomeRoutine
bl Jump
ldr r3, task_is_running
bl Jump
cmp r0, #0
bne End
ldrh r3, [r4, #0x1C]
add r3, #1
strh r3, [r4, #0x1C]
b End
AddTaskMaybe:
lsl r3, r2, #4
add r2, r3, r2
ldr r3, somethingnotsure
mov r12, r3
mov r1, #4
lsl r2, r2, #2
add r2, r12
ldrb r3, [r2]
bic r3, r1
strb r3, [r2]
ldr r0, SomeRoutine
ldr r3, taskadd
mov r1, #5
ldr r6, tasks
bl Jump
lsl r3, r0, #2
add r0, r3, r0
mov r3, #0
lsl r0, r0, #3
add r0, r6, r0
strh r3, [r0, #8]
ldr r3, Attackeranim
ldrb r3, [r3]
strh r3, [r0, #0xC]
ldrh r3, [r4, #0x1C]
add r3, #1
strh r3, [r4, #0x1C]
b End
Jump:
bx r3
.align 2
shadupdate: .word 0x805EE54+1
BattleData: .word 0x02024084
Attackeranim: .word 0x2038436
battle_side_objid: .word 0x20241E4
tasks: .word 0x3005E00
somethingnotsure: .word 0x202066E @@@ Not sure this is the exact location, have to test/ask
somethingnotsureeither: .word 0x2020650 @@@ Not sure this is the exact location, have to test/ask
SomeRoutine: .word 0x80A4980+1
taskadd: .word 0x80A8FB0+1
Refreshgraphics: .word 0x805E8F4+1
task_find_id_by_funcptr: .word 0x80A921C+1
task_is_running: .word 0x80A91E4+1
move_anim_task_del: .word 0x80A3C1C+1