mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-19 04:57:39 +01:00
3252 lines
50 KiB
ArmAsm
3252 lines
50 KiB
ArmAsm
.include "asm/macros.inc"
|
|
.include "constants/constants.inc"
|
|
|
|
.syntax unified
|
|
|
|
.text
|
|
|
|
thumb_func_start sub_811160C
|
|
sub_811160C: @ 811160C
|
|
push {r4,r5,lr}
|
|
adds r4, r0, 0
|
|
movs r1, 0x1
|
|
bl InitAnimSpritePos
|
|
ldr r0, =gBattleAnimArgs
|
|
ldrh r0, [r0, 0x4]
|
|
strh r0, [r4, 0x2E]
|
|
ldrh r0, [r4, 0x20]
|
|
strh r0, [r4, 0x30]
|
|
ldr r5, =gBattleAnimTarget
|
|
ldrb r0, [r5]
|
|
movs r1, 0x2
|
|
bl GetBattlerSpriteCoord
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
strh r0, [r4, 0x32]
|
|
ldrh r0, [r4, 0x22]
|
|
strh r0, [r4, 0x34]
|
|
ldrb r0, [r5]
|
|
movs r1, 0x3
|
|
bl GetBattlerSpriteCoord
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
strh r0, [r4, 0x36]
|
|
adds r0, r4, 0
|
|
bl sub_80A6FD4
|
|
ldr r0, =sub_8111674
|
|
str r0, [r4, 0x1C]
|
|
movs r0, 0x10
|
|
strh r0, [r4, 0x3A]
|
|
movs r1, 0xFD
|
|
lsls r1, 6
|
|
movs r0, 0x50
|
|
bl SetGpuReg
|
|
ldrh r1, [r4, 0x3A]
|
|
movs r0, 0x52
|
|
bl SetGpuReg
|
|
pop {r4,r5}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_811160C
|
|
|
|
thumb_func_start sub_8111674
|
|
sub_8111674: @ 8111674
|
|
push {r4,lr}
|
|
adds r4, r0, 0
|
|
bl sub_8111764
|
|
adds r0, r4, 0
|
|
bl TranslateAnimLinear
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
beq _08111694
|
|
ldr r0, =sub_81116E8
|
|
str r0, [r4, 0x1C]
|
|
b _081116DE
|
|
.pool
|
|
_08111694:
|
|
movs r1, 0x38
|
|
ldrsh r0, [r4, r1]
|
|
movs r1, 0xA
|
|
bl Sin
|
|
ldrh r1, [r4, 0x24]
|
|
adds r0, r1
|
|
strh r0, [r4, 0x24]
|
|
movs r1, 0x38
|
|
ldrsh r0, [r4, r1]
|
|
movs r1, 0xF
|
|
bl Cos
|
|
ldrh r1, [r4, 0x26]
|
|
adds r0, r1
|
|
strh r0, [r4, 0x26]
|
|
ldrh r2, [r4, 0x38]
|
|
adds r0, r2, 0x5
|
|
movs r1, 0xFF
|
|
ands r0, r1
|
|
strh r0, [r4, 0x38]
|
|
ldrh r0, [r4, 0x38]
|
|
lsls r2, 16
|
|
asrs r2, 16
|
|
cmp r2, 0
|
|
beq _081116CC
|
|
cmp r2, 0xC4
|
|
ble _081116DE
|
|
_081116CC:
|
|
lsls r0, 16
|
|
cmp r0, 0
|
|
ble _081116DE
|
|
ldr r0, =gUnknown_02038440
|
|
movs r1, 0
|
|
ldrsb r1, [r0, r1]
|
|
movs r0, 0xC4
|
|
bl PlaySE12WithPanning
|
|
_081116DE:
|
|
pop {r4}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_8111674
|
|
|
|
thumb_func_start sub_81116E8
|
|
sub_81116E8: @ 81116E8
|
|
push {r4,lr}
|
|
adds r4, r0, 0
|
|
movs r0, 0x1
|
|
strh r0, [r4, 0x2E]
|
|
adds r0, r4, 0
|
|
bl TranslateAnimLinear
|
|
movs r1, 0x38
|
|
ldrsh r0, [r4, r1]
|
|
movs r1, 0xA
|
|
bl Sin
|
|
ldrh r1, [r4, 0x24]
|
|
adds r0, r1
|
|
strh r0, [r4, 0x24]
|
|
movs r1, 0x38
|
|
ldrsh r0, [r4, r1]
|
|
movs r1, 0xF
|
|
bl Cos
|
|
ldrh r1, [r4, 0x26]
|
|
adds r0, r1
|
|
strh r0, [r4, 0x26]
|
|
ldrh r2, [r4, 0x38]
|
|
adds r0, r2, 0x5
|
|
movs r1, 0xFF
|
|
ands r0, r1
|
|
strh r0, [r4, 0x38]
|
|
ldrh r0, [r4, 0x38]
|
|
lsls r2, 16
|
|
asrs r2, 16
|
|
cmp r2, 0
|
|
beq _0811172E
|
|
cmp r2, 0xC4
|
|
ble _0811173A
|
|
_0811172E:
|
|
lsls r0, 16
|
|
cmp r0, 0
|
|
ble _0811173A
|
|
movs r0, 0xC4
|
|
bl PlaySE
|
|
_0811173A:
|
|
movs r1, 0x3A
|
|
ldrsh r0, [r4, r1]
|
|
cmp r0, 0
|
|
bne _08111758
|
|
adds r2, r4, 0
|
|
adds r2, 0x3E
|
|
ldrb r0, [r2]
|
|
movs r1, 0x4
|
|
orrs r0, r1
|
|
strb r0, [r2]
|
|
ldr r0, =sub_80A67F4
|
|
str r0, [r4, 0x1C]
|
|
b _0811175E
|
|
.pool
|
|
_08111758:
|
|
adds r0, r4, 0
|
|
bl sub_8111764
|
|
_0811175E:
|
|
pop {r4}
|
|
pop {r0}
|
|
bx r0
|
|
thumb_func_end sub_81116E8
|
|
|
|
thumb_func_start sub_8111764
|
|
sub_8111764: @ 8111764
|
|
push {r4,lr}
|
|
adds r4, r0, 0
|
|
ldrh r2, [r4, 0x3A]
|
|
movs r1, 0x3A
|
|
ldrsh r0, [r4, r1]
|
|
cmp r0, 0xFF
|
|
ble _08111788
|
|
adds r0, r2, 0x1
|
|
strh r0, [r4, 0x3A]
|
|
lsls r0, 16
|
|
ldr r1, =0x010d0000
|
|
cmp r0, r1
|
|
bne _081117EE
|
|
movs r0, 0
|
|
b _081117EC
|
|
.pool
|
|
_08111788:
|
|
ldrh r1, [r4, 0x3C]
|
|
adds r3, r1, 0x1
|
|
strh r3, [r4, 0x3C]
|
|
movs r0, 0xFF
|
|
ands r0, r1
|
|
cmp r0, 0
|
|
bne _081117EE
|
|
ldr r1, =0xffffff00
|
|
ands r1, r3
|
|
strh r1, [r4, 0x3C]
|
|
movs r0, 0x80
|
|
lsls r0, 1
|
|
ands r0, r1
|
|
cmp r0, 0
|
|
beq _081117B0
|
|
adds r0, r2, 0x1
|
|
b _081117B2
|
|
.pool
|
|
_081117B0:
|
|
subs r0, r2, 0x1
|
|
_081117B2:
|
|
strh r0, [r4, 0x3A]
|
|
ldrh r0, [r4, 0x3A]
|
|
movs r1, 0x10
|
|
subs r1, r0
|
|
lsls r1, 8
|
|
orrs r1, r0
|
|
lsls r1, 16
|
|
lsrs r1, 16
|
|
movs r0, 0x52
|
|
bl SetGpuReg
|
|
movs r2, 0x3A
|
|
ldrsh r0, [r4, r2]
|
|
cmp r0, 0
|
|
beq _081117D4
|
|
cmp r0, 0x10
|
|
bne _081117E0
|
|
_081117D4:
|
|
ldrh r0, [r4, 0x3C]
|
|
movs r2, 0x80
|
|
lsls r2, 1
|
|
adds r1, r2, 0
|
|
eors r0, r1
|
|
strh r0, [r4, 0x3C]
|
|
_081117E0:
|
|
movs r1, 0x3A
|
|
ldrsh r0, [r4, r1]
|
|
cmp r0, 0
|
|
bne _081117EE
|
|
movs r0, 0x80
|
|
lsls r0, 1
|
|
_081117EC:
|
|
strh r0, [r4, 0x3A]
|
|
_081117EE:
|
|
pop {r4}
|
|
pop {r0}
|
|
bx r0
|
|
thumb_func_end sub_8111764
|
|
|
|
thumb_func_start sub_81117F4
|
|
sub_81117F4: @ 81117F4
|
|
push {r4,lr}
|
|
adds r4, r0, 0
|
|
movs r1, 0x1
|
|
bl sub_80A6980
|
|
ldr r1, =sub_8111814
|
|
str r1, [r4, 0x1C]
|
|
adds r0, r4, 0
|
|
bl _call_via_r1
|
|
pop {r4}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_81117F4
|
|
|
|
thumb_func_start sub_8111814
|
|
sub_8111814: @ 8111814
|
|
push {r4,lr}
|
|
adds r4, r0, 0
|
|
movs r1, 0x2E
|
|
ldrsh r0, [r4, r1]
|
|
movs r1, 0x20
|
|
bl Sin
|
|
strh r0, [r4, 0x24]
|
|
movs r1, 0x2E
|
|
ldrsh r0, [r4, r1]
|
|
movs r1, 0x8
|
|
bl Cos
|
|
strh r0, [r4, 0x26]
|
|
ldrh r0, [r4, 0x2E]
|
|
subs r0, 0x41
|
|
lsls r0, 16
|
|
lsrs r0, 16
|
|
cmp r0, 0x82
|
|
bhi _08111848
|
|
ldrb r0, [r4, 0x5]
|
|
movs r1, 0xD
|
|
negs r1, r1
|
|
ands r1, r0
|
|
movs r0, 0x8
|
|
b _08111852
|
|
_08111848:
|
|
ldrb r0, [r4, 0x5]
|
|
movs r1, 0xD
|
|
negs r1, r1
|
|
ands r1, r0
|
|
movs r0, 0x4
|
|
_08111852:
|
|
orrs r1, r0
|
|
strb r1, [r4, 0x5]
|
|
ldrh r0, [r4, 0x2E]
|
|
adds r0, 0x13
|
|
movs r1, 0xFF
|
|
ands r0, r1
|
|
strh r0, [r4, 0x2E]
|
|
ldrh r0, [r4, 0x32]
|
|
adds r0, 0x50
|
|
strh r0, [r4, 0x32]
|
|
lsls r0, 16
|
|
asrs r0, 24
|
|
ldrh r1, [r4, 0x26]
|
|
adds r0, r1
|
|
strh r0, [r4, 0x26]
|
|
ldrh r0, [r4, 0x3C]
|
|
adds r0, 0x1
|
|
strh r0, [r4, 0x3C]
|
|
lsls r0, 16
|
|
asrs r0, 16
|
|
cmp r0, 0x3D
|
|
bne _08111884
|
|
adds r0, r4, 0
|
|
bl DestroyAnimSprite
|
|
_08111884:
|
|
pop {r4}
|
|
pop {r0}
|
|
bx r0
|
|
thumb_func_end sub_8111814
|
|
|
|
thumb_func_start sub_811188C
|
|
sub_811188C: @ 811188C
|
|
push {r4,r5,lr}
|
|
adds r5, r0, 0
|
|
lsls r5, 24
|
|
lsrs r5, 24
|
|
movs r1, 0xFD
|
|
lsls r1, 6
|
|
movs r0, 0x50
|
|
bl SetGpuReg
|
|
movs r1, 0x80
|
|
lsls r1, 5
|
|
movs r0, 0x52
|
|
bl SetGpuReg
|
|
movs r0, 0
|
|
bl GetAnimBattlerSpriteId
|
|
adds r4, r0, 0
|
|
lsls r4, 24
|
|
lsrs r4, 24
|
|
adds r0, r4, 0
|
|
movs r1, 0x1
|
|
bl sub_80A7270
|
|
adds r0, r4, 0
|
|
movs r1, 0x80
|
|
movs r2, 0x80
|
|
movs r3, 0
|
|
bl obj_id_set_rotscale
|
|
ldr r1, =gSprites
|
|
lsls r0, r4, 4
|
|
adds r0, r4
|
|
lsls r0, 2
|
|
adds r0, r1
|
|
adds r0, 0x3E
|
|
ldrb r2, [r0]
|
|
movs r1, 0x5
|
|
negs r1, r1
|
|
ands r1, r2
|
|
strb r1, [r0]
|
|
ldr r1, =gTasks
|
|
lsls r0, r5, 2
|
|
adds r0, r5
|
|
lsls r0, 3
|
|
adds r0, r1
|
|
movs r2, 0
|
|
movs r1, 0x80
|
|
strh r1, [r0, 0x8]
|
|
ldr r1, =gBattleAnimArgs
|
|
ldrh r1, [r1]
|
|
strh r1, [r0, 0xA]
|
|
strh r2, [r0, 0xC]
|
|
movs r1, 0x10
|
|
strh r1, [r0, 0xE]
|
|
ldr r1, =sub_8111914
|
|
str r1, [r0]
|
|
pop {r4,r5}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_811188C
|
|
|
|
thumb_func_start sub_8111914
|
|
sub_8111914: @ 8111914
|
|
push {r4,lr}
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
ldr r2, =gTasks
|
|
lsls r1, r0, 2
|
|
adds r1, r0
|
|
lsls r1, 3
|
|
adds r4, r1, r2
|
|
ldrh r0, [r4, 0x1C]
|
|
adds r0, 0x1
|
|
strh r0, [r4, 0x1C]
|
|
lsls r0, 16
|
|
asrs r0, 16
|
|
cmp r0, 0x3
|
|
bne _0811195C
|
|
movs r0, 0
|
|
strh r0, [r4, 0x1C]
|
|
ldrh r1, [r4, 0xC]
|
|
adds r1, 0x1
|
|
strh r1, [r4, 0xC]
|
|
ldrh r0, [r4, 0xE]
|
|
subs r0, 0x1
|
|
strh r0, [r4, 0xE]
|
|
lsls r0, 8
|
|
orrs r1, r0
|
|
lsls r1, 16
|
|
lsrs r1, 16
|
|
movs r0, 0x52
|
|
bl SetGpuReg
|
|
movs r1, 0xC
|
|
ldrsh r0, [r4, r1]
|
|
cmp r0, 0x9
|
|
bne _0811195C
|
|
ldr r0, =sub_811196C
|
|
str r0, [r4]
|
|
_0811195C:
|
|
pop {r4}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_8111914
|
|
|
|
thumb_func_start sub_811196C
|
|
sub_811196C: @ 811196C
|
|
push {r4,r5,lr}
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
adds r5, r0, 0
|
|
ldr r1, =gTasks
|
|
lsls r0, r5, 2
|
|
adds r0, r5
|
|
lsls r0, 3
|
|
adds r4, r0, r1
|
|
ldrh r1, [r4, 0xA]
|
|
movs r2, 0xA
|
|
ldrsh r0, [r4, r2]
|
|
cmp r0, 0
|
|
ble _08111994
|
|
subs r0, r1, 0x1
|
|
strh r0, [r4, 0xA]
|
|
b _081119D8
|
|
.pool
|
|
_08111994:
|
|
movs r0, 0
|
|
bl GetAnimBattlerSpriteId
|
|
lsls r0, 24
|
|
lsrs r1, r0, 24
|
|
ldrh r0, [r4, 0x8]
|
|
adds r0, 0x8
|
|
strh r0, [r4, 0x8]
|
|
lsls r0, 16
|
|
asrs r0, 16
|
|
cmp r0, 0xFF
|
|
bgt _081119BC
|
|
movs r0, 0x8
|
|
ldrsh r2, [r4, r0]
|
|
adds r0, r1, 0
|
|
adds r1, r2, 0
|
|
movs r3, 0
|
|
bl obj_id_set_rotscale
|
|
b _081119D8
|
|
_081119BC:
|
|
adds r0, r1, 0
|
|
bl sub_80A7344
|
|
adds r0, r5, 0
|
|
bl DestroyAnimVisualTask
|
|
movs r0, 0x50
|
|
movs r1, 0
|
|
bl SetGpuReg
|
|
movs r0, 0x52
|
|
movs r1, 0
|
|
bl SetGpuReg
|
|
_081119D8:
|
|
pop {r4,r5}
|
|
pop {r0}
|
|
bx r0
|
|
thumb_func_end sub_811196C
|
|
|
|
thumb_func_start sub_81119E0
|
|
sub_81119E0: @ 81119E0
|
|
push {r4-r6,lr}
|
|
mov r6, r9
|
|
mov r5, r8
|
|
push {r5,r6}
|
|
sub sp, 0x4
|
|
adds r4, r0, 0
|
|
ldrh r5, [r4, 0x20]
|
|
ldrh r6, [r4, 0x22]
|
|
ldr r0, =gBattleAnimAttacker
|
|
mov r8, r0
|
|
ldrb r0, [r0]
|
|
movs r1, 0x2
|
|
bl GetBattlerSpriteCoord
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
movs r1, 0
|
|
mov r9, r1
|
|
strh r0, [r4, 0x20]
|
|
mov r1, r8
|
|
ldrb r0, [r1]
|
|
movs r1, 0x3
|
|
bl GetBattlerSpriteCoord
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
strh r0, [r4, 0x22]
|
|
mov r1, r9
|
|
strh r1, [r4, 0x2E]
|
|
ldr r2, =gBattleAnimArgs
|
|
ldrh r1, [r2]
|
|
strh r1, [r4, 0x30]
|
|
ldrh r1, [r2, 0x2]
|
|
strh r1, [r4, 0x32]
|
|
ldrh r1, [r2, 0x4]
|
|
strh r1, [r4, 0x34]
|
|
ldrh r1, [r4, 0x20]
|
|
lsls r1, 4
|
|
strh r1, [r4, 0x36]
|
|
lsls r0, 4
|
|
strh r0, [r4, 0x38]
|
|
lsls r5, 16
|
|
asrs r5, 16
|
|
movs r1, 0x20
|
|
ldrsh r0, [r4, r1]
|
|
subs r5, r0
|
|
lsls r5, 4
|
|
movs r0, 0
|
|
ldrsh r1, [r2, r0]
|
|
lsls r1, 1
|
|
adds r0, r5, 0
|
|
str r2, [sp]
|
|
bl __divsi3
|
|
strh r0, [r4, 0x3A]
|
|
lsls r6, 16
|
|
asrs r6, 16
|
|
movs r1, 0x22
|
|
ldrsh r0, [r4, r1]
|
|
subs r6, r0
|
|
lsls r6, 4
|
|
ldr r2, [sp]
|
|
movs r0, 0
|
|
ldrsh r1, [r2, r0]
|
|
lsls r1, 1
|
|
adds r0, r6, 0
|
|
bl __divsi3
|
|
strh r0, [r4, 0x3C]
|
|
ldr r0, =sub_8111A88
|
|
str r0, [r4, 0x1C]
|
|
add sp, 0x4
|
|
pop {r3,r4}
|
|
mov r8, r3
|
|
mov r9, r4
|
|
pop {r4-r6}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_81119E0
|
|
|
|
thumb_func_start sub_8111A88
|
|
sub_8111A88: @ 8111A88
|
|
push {r4,r5,lr}
|
|
adds r5, r0, 0
|
|
movs r1, 0x2E
|
|
ldrsh r0, [r5, r1]
|
|
cmp r0, 0x1
|
|
beq _08111AD2
|
|
cmp r0, 0x1
|
|
bgt _08111A9E
|
|
cmp r0, 0
|
|
beq _08111AA8
|
|
b _08111B96
|
|
_08111A9E:
|
|
cmp r0, 0x2
|
|
beq _08111B3C
|
|
cmp r0, 0x3
|
|
beq _08111B90
|
|
b _08111B96
|
|
_08111AA8:
|
|
ldrh r0, [r5, 0x3A]
|
|
ldrh r2, [r5, 0x36]
|
|
adds r0, r2
|
|
strh r0, [r5, 0x36]
|
|
ldrh r1, [r5, 0x3C]
|
|
ldrh r2, [r5, 0x38]
|
|
adds r1, r2
|
|
strh r1, [r5, 0x38]
|
|
lsls r0, 16
|
|
asrs r0, 20
|
|
strh r0, [r5, 0x20]
|
|
lsls r1, 16
|
|
asrs r1, 20
|
|
strh r1, [r5, 0x22]
|
|
ldrh r0, [r5, 0x30]
|
|
subs r0, 0x1
|
|
strh r0, [r5, 0x30]
|
|
lsls r0, 16
|
|
cmp r0, 0
|
|
bgt _08111B96
|
|
b _08111B82
|
|
_08111AD2:
|
|
ldrh r0, [r5, 0x32]
|
|
subs r0, 0x1
|
|
strh r0, [r5, 0x32]
|
|
lsls r0, 16
|
|
cmp r0, 0
|
|
bgt _08111B96
|
|
ldr r4, =gBattleAnimTarget
|
|
ldrb r0, [r4]
|
|
movs r1, 0x2
|
|
bl GetBattlerSpriteCoord
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
strh r0, [r5, 0x30]
|
|
ldrb r0, [r4]
|
|
movs r1, 0x3
|
|
bl GetBattlerSpriteCoord
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
strh r0, [r5, 0x32]
|
|
ldrh r0, [r5, 0x20]
|
|
lsls r0, 4
|
|
strh r0, [r5, 0x36]
|
|
ldrh r0, [r5, 0x22]
|
|
lsls r0, 4
|
|
strh r0, [r5, 0x38]
|
|
movs r1, 0x30
|
|
ldrsh r0, [r5, r1]
|
|
movs r2, 0x20
|
|
ldrsh r1, [r5, r2]
|
|
subs r0, r1
|
|
lsls r0, 4
|
|
movs r2, 0x34
|
|
ldrsh r1, [r5, r2]
|
|
bl __divsi3
|
|
strh r0, [r5, 0x3A]
|
|
movs r1, 0x32
|
|
ldrsh r0, [r5, r1]
|
|
movs r2, 0x22
|
|
ldrsh r1, [r5, r2]
|
|
subs r0, r1
|
|
lsls r0, 4
|
|
movs r2, 0x34
|
|
ldrsh r1, [r5, r2]
|
|
bl __divsi3
|
|
strh r0, [r5, 0x3C]
|
|
b _08111B82
|
|
.pool
|
|
_08111B3C:
|
|
ldrh r0, [r5, 0x3A]
|
|
ldrh r1, [r5, 0x36]
|
|
adds r0, r1
|
|
strh r0, [r5, 0x36]
|
|
ldrh r1, [r5, 0x3C]
|
|
ldrh r2, [r5, 0x38]
|
|
adds r1, r2
|
|
strh r1, [r5, 0x38]
|
|
lsls r0, 16
|
|
asrs r0, 20
|
|
strh r0, [r5, 0x20]
|
|
lsls r1, 16
|
|
asrs r1, 20
|
|
strh r1, [r5, 0x22]
|
|
ldrh r0, [r5, 0x34]
|
|
subs r0, 0x1
|
|
strh r0, [r5, 0x34]
|
|
lsls r0, 16
|
|
cmp r0, 0
|
|
bgt _08111B96
|
|
ldr r4, =gBattleAnimTarget
|
|
ldrb r0, [r4]
|
|
movs r1, 0x2
|
|
bl GetBattlerSpriteCoord
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
strh r0, [r5, 0x20]
|
|
ldrb r0, [r4]
|
|
movs r1, 0x3
|
|
bl GetBattlerSpriteCoord
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
strh r0, [r5, 0x22]
|
|
_08111B82:
|
|
ldrh r0, [r5, 0x2E]
|
|
adds r0, 0x1
|
|
strh r0, [r5, 0x2E]
|
|
b _08111B96
|
|
.pool
|
|
_08111B90:
|
|
adds r0, r5, 0
|
|
bl move_anim_8074EE0
|
|
_08111B96:
|
|
pop {r4,r5}
|
|
pop {r0}
|
|
bx r0
|
|
thumb_func_end sub_8111A88
|
|
|
|
thumb_func_start sub_8111B9C
|
|
sub_8111B9C: @ 8111B9C
|
|
push {r4,lr}
|
|
adds r4, r0, 0
|
|
movs r1, 0x1
|
|
bl sub_80A6980
|
|
ldr r0, =sub_8111BB4
|
|
str r0, [r4, 0x1C]
|
|
pop {r4}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_8111B9C
|
|
|
|
thumb_func_start sub_8111BB4
|
|
sub_8111BB4: @ 8111BB4
|
|
push {r4-r6,lr}
|
|
adds r3, r0, 0
|
|
movs r5, 0
|
|
movs r6, 0
|
|
adds r0, 0x3F
|
|
ldrb r1, [r0]
|
|
movs r0, 0x10
|
|
ands r0, r1
|
|
cmp r0, 0
|
|
beq _08111C4A
|
|
adds r1, r3, 0
|
|
adds r1, 0x3E
|
|
ldrb r2, [r1]
|
|
movs r0, 0x4
|
|
ands r0, r2
|
|
adds r4, r1, 0
|
|
cmp r0, 0
|
|
bne _08111BDE
|
|
movs r0, 0x4
|
|
orrs r0, r2
|
|
strb r0, [r4]
|
|
_08111BDE:
|
|
movs r1, 0x2E
|
|
ldrsh r0, [r3, r1]
|
|
cmp r0, 0
|
|
beq _08111BEE
|
|
cmp r0, 0x1
|
|
beq _08111BF8
|
|
movs r6, 0x1
|
|
b _08111C02
|
|
_08111BEE:
|
|
movs r1, 0x30
|
|
ldrsh r0, [r3, r1]
|
|
cmp r0, 0x2
|
|
bne _08111C02
|
|
b _08111C06
|
|
_08111BF8:
|
|
movs r1, 0x30
|
|
ldrsh r0, [r3, r1]
|
|
cmp r0, 0x4
|
|
bne _08111C02
|
|
movs r5, 0x1
|
|
_08111C02:
|
|
cmp r5, 0
|
|
beq _08111C38
|
|
_08111C06:
|
|
ldrb r2, [r4]
|
|
lsls r0, r2, 29
|
|
lsrs r0, 31
|
|
movs r1, 0x1
|
|
eors r1, r0
|
|
lsls r1, 2
|
|
movs r0, 0x5
|
|
negs r0, r0
|
|
ands r0, r2
|
|
orrs r0, r1
|
|
strb r0, [r4]
|
|
ldrh r0, [r3, 0x32]
|
|
adds r0, 0x1
|
|
movs r1, 0
|
|
strh r0, [r3, 0x32]
|
|
strh r1, [r3, 0x30]
|
|
lsls r0, 16
|
|
asrs r0, 16
|
|
cmp r0, 0x5
|
|
bne _08111C4A
|
|
strh r1, [r3, 0x32]
|
|
ldrh r0, [r3, 0x2E]
|
|
adds r0, 0x1
|
|
strh r0, [r3, 0x2E]
|
|
b _08111C4A
|
|
_08111C38:
|
|
cmp r6, 0
|
|
beq _08111C44
|
|
adds r0, r3, 0
|
|
bl DestroyAnimSprite
|
|
b _08111C4A
|
|
_08111C44:
|
|
ldrh r0, [r3, 0x30]
|
|
adds r0, 0x1
|
|
strh r0, [r3, 0x30]
|
|
_08111C4A:
|
|
pop {r4-r6}
|
|
pop {r0}
|
|
bx r0
|
|
thumb_func_end sub_8111BB4
|
|
|
|
thumb_func_start sub_8111C50
|
|
sub_8111C50: @ 8111C50
|
|
push {r4-r6,lr}
|
|
lsls r0, 24
|
|
lsrs r4, r0, 24
|
|
lsls r0, r4, 2
|
|
adds r0, r4
|
|
lsls r0, 3
|
|
ldr r1, =gTasks
|
|
adds r5, r0, r1
|
|
movs r0, 0x1
|
|
bl duplicate_obj_of_side_rel2move_in_transparent_mode
|
|
movs r6, 0
|
|
movs r1, 0
|
|
strh r0, [r5, 0x8]
|
|
lsls r0, 16
|
|
cmp r0, 0
|
|
bge _08111C80
|
|
adds r0, r4, 0
|
|
bl DestroyAnimVisualTask
|
|
b _08111D5C
|
|
.pool
|
|
_08111C80:
|
|
strh r1, [r5, 0xA]
|
|
movs r0, 0xF
|
|
strh r0, [r5, 0xC]
|
|
movs r0, 0x2
|
|
strh r0, [r5, 0xE]
|
|
strh r1, [r5, 0x10]
|
|
movs r1, 0xFD
|
|
lsls r1, 6
|
|
movs r0, 0x50
|
|
bl SetGpuReg
|
|
ldrh r1, [r5, 0xE]
|
|
lsls r1, 8
|
|
ldrh r0, [r5, 0xC]
|
|
orrs r1, r0
|
|
lsls r1, 16
|
|
lsrs r1, 16
|
|
movs r0, 0x52
|
|
bl SetGpuReg
|
|
ldr r4, =gSprites
|
|
movs r0, 0x8
|
|
ldrsh r1, [r5, r0]
|
|
lsls r0, r1, 4
|
|
adds r0, r1
|
|
lsls r0, 2
|
|
adds r0, r4
|
|
movs r1, 0x50
|
|
strh r1, [r0, 0x2E]
|
|
ldr r0, =gBattleAnimTarget
|
|
ldrb r0, [r0]
|
|
bl GetBattlerSide
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
bne _08111CF4
|
|
movs r0, 0x8
|
|
ldrsh r1, [r5, r0]
|
|
lsls r0, r1, 4
|
|
adds r0, r1
|
|
lsls r0, 2
|
|
adds r0, r4
|
|
ldr r1, =0x0000ff70
|
|
strh r1, [r0, 0x30]
|
|
movs r0, 0x8
|
|
ldrsh r1, [r5, r0]
|
|
lsls r0, r1, 4
|
|
adds r0, r1
|
|
lsls r0, 2
|
|
adds r0, r4
|
|
movs r1, 0x70
|
|
b _08111D12
|
|
.pool
|
|
_08111CF4:
|
|
movs r0, 0x8
|
|
ldrsh r1, [r5, r0]
|
|
lsls r0, r1, 4
|
|
adds r0, r1
|
|
lsls r0, 2
|
|
adds r0, r4
|
|
movs r1, 0x90
|
|
strh r1, [r0, 0x30]
|
|
movs r0, 0x8
|
|
ldrsh r1, [r5, r0]
|
|
lsls r0, r1, 4
|
|
adds r0, r1
|
|
lsls r0, 2
|
|
adds r0, r4
|
|
ldr r1, =0x0000ff90
|
|
_08111D12:
|
|
strh r1, [r0, 0x32]
|
|
ldr r4, =gSprites
|
|
movs r0, 0x8
|
|
ldrsh r1, [r5, r0]
|
|
lsls r0, r1, 4
|
|
adds r0, r1
|
|
lsls r0, 2
|
|
adds r0, r4
|
|
movs r2, 0
|
|
strh r2, [r0, 0x34]
|
|
movs r0, 0x8
|
|
ldrsh r1, [r5, r0]
|
|
lsls r0, r1, 4
|
|
adds r0, r1
|
|
lsls r0, 2
|
|
adds r0, r4
|
|
strh r2, [r0, 0x36]
|
|
movs r0, 0x8
|
|
ldrsh r1, [r5, r0]
|
|
lsls r0, r1, 4
|
|
adds r0, r1
|
|
lsls r0, 2
|
|
adds r0, r4
|
|
ldr r1, =SpriteCallbackDummy
|
|
bl StoreSpriteCallbackInData6
|
|
movs r0, 0x8
|
|
ldrsh r1, [r5, r0]
|
|
lsls r0, r1, 4
|
|
adds r0, r1
|
|
lsls r0, 2
|
|
adds r4, 0x1C
|
|
adds r0, r4
|
|
ldr r1, =sub_80A656C
|
|
str r1, [r0]
|
|
ldr r0, =sub_8111D78
|
|
str r0, [r5]
|
|
_08111D5C:
|
|
pop {r4-r6}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_8111C50
|
|
|
|
thumb_func_start sub_8111D78
|
|
sub_8111D78: @ 8111D78
|
|
push {r4,lr}
|
|
lsls r0, 24
|
|
lsrs r2, r0, 24
|
|
lsls r0, r2, 2
|
|
adds r0, r2
|
|
lsls r0, 3
|
|
ldr r1, =gTasks
|
|
adds r4, r0, r1
|
|
movs r1, 0x10
|
|
ldrsh r0, [r4, r1]
|
|
cmp r0, 0x1
|
|
beq _08111E1C
|
|
cmp r0, 0x1
|
|
bgt _08111DA0
|
|
cmp r0, 0
|
|
beq _08111DA6
|
|
b _08111E48
|
|
.pool
|
|
_08111DA0:
|
|
cmp r0, 0x2
|
|
beq _08111E42
|
|
b _08111E48
|
|
_08111DA6:
|
|
ldrh r1, [r4, 0xA]
|
|
adds r1, 0x1
|
|
strh r1, [r4, 0xA]
|
|
movs r0, 0x3
|
|
ands r0, r1
|
|
strh r0, [r4, 0x12]
|
|
cmp r0, 0x1
|
|
bne _08111DC4
|
|
ldrh r1, [r4, 0xC]
|
|
movs r2, 0xC
|
|
ldrsh r0, [r4, r2]
|
|
cmp r0, 0
|
|
ble _08111DC4
|
|
subs r0, r1, 0x1
|
|
strh r0, [r4, 0xC]
|
|
_08111DC4:
|
|
movs r1, 0x12
|
|
ldrsh r0, [r4, r1]
|
|
cmp r0, 0x3
|
|
bne _08111DDA
|
|
ldrh r1, [r4, 0xE]
|
|
movs r2, 0xE
|
|
ldrsh r0, [r4, r2]
|
|
cmp r0, 0xF
|
|
bgt _08111DDA
|
|
adds r0, r1, 0x1
|
|
strh r0, [r4, 0xE]
|
|
_08111DDA:
|
|
ldrh r1, [r4, 0xE]
|
|
lsls r1, 8
|
|
ldrh r0, [r4, 0xC]
|
|
orrs r1, r0
|
|
lsls r1, 16
|
|
lsrs r1, 16
|
|
movs r0, 0x52
|
|
bl SetGpuReg
|
|
ldr r1, [r4, 0xC]
|
|
movs r0, 0x80
|
|
lsls r0, 13
|
|
cmp r1, r0
|
|
bne _08111E48
|
|
movs r1, 0xA
|
|
ldrsh r0, [r4, r1]
|
|
cmp r0, 0x50
|
|
ble _08111E48
|
|
movs r2, 0x8
|
|
ldrsh r1, [r4, r2]
|
|
lsls r0, r1, 4
|
|
adds r0, r1
|
|
lsls r0, 2
|
|
ldr r1, =gSprites
|
|
adds r0, r1
|
|
bl obj_delete_but_dont_free_vram
|
|
movs r0, 0x1
|
|
strh r0, [r4, 0x10]
|
|
b _08111E48
|
|
.pool
|
|
_08111E1C:
|
|
ldrh r0, [r4, 0x14]
|
|
adds r0, 0x1
|
|
strh r0, [r4, 0x14]
|
|
lsls r0, 16
|
|
asrs r0, 16
|
|
cmp r0, 0x1
|
|
ble _08111E48
|
|
movs r0, 0x50
|
|
movs r1, 0
|
|
bl SetGpuReg
|
|
movs r0, 0x52
|
|
movs r1, 0
|
|
bl SetGpuReg
|
|
ldrh r0, [r4, 0x10]
|
|
adds r0, 0x1
|
|
strh r0, [r4, 0x10]
|
|
b _08111E48
|
|
_08111E42:
|
|
adds r0, r2, 0
|
|
bl DestroyAnimVisualTask
|
|
_08111E48:
|
|
pop {r4}
|
|
pop {r0}
|
|
bx r0
|
|
thumb_func_end sub_8111D78
|
|
|
|
thumb_func_start sub_8111E50
|
|
sub_8111E50: @ 8111E50
|
|
push {lr}
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
lsls r1, r0, 2
|
|
adds r1, r0
|
|
lsls r1, 3
|
|
ldr r2, =gTasks
|
|
adds r1, r2
|
|
movs r2, 0
|
|
strh r2, [r1, 0x26]
|
|
ldr r2, =sub_8111E78
|
|
str r2, [r1]
|
|
bl _call_via_r2
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_8111E50
|
|
|
|
thumb_func_start sub_8111E78
|
|
sub_8111E78: @ 8111E78
|
|
push {r4-r7,lr}
|
|
mov r7, r8
|
|
push {r7}
|
|
sub sp, 0xC
|
|
lsls r0, 24
|
|
lsrs r4, r0, 24
|
|
lsls r0, r4, 2
|
|
adds r0, r4
|
|
lsls r0, 3
|
|
ldr r1, =gTasks
|
|
adds r5, r0, r1
|
|
ldr r0, =gBattleAnimTarget
|
|
ldrb r0, [r0]
|
|
bl sub_80A8364
|
|
lsls r0, 24
|
|
lsrs r6, r0, 24
|
|
movs r1, 0x26
|
|
ldrsh r0, [r5, r1]
|
|
cmp r0, 0x4
|
|
bls _08111EA4
|
|
b _081120C6
|
|
_08111EA4:
|
|
lsls r0, 2
|
|
ldr r1, =_08111EBC
|
|
adds r0, r1
|
|
ldr r0, [r0]
|
|
mov pc, r0
|
|
.pool
|
|
.align 2, 0
|
|
_08111EBC:
|
|
.4byte _08111ED0
|
|
.4byte _08111FD0
|
|
.4byte _08112014
|
|
.4byte _0811207C
|
|
.4byte _081120A8
|
|
_08111ED0:
|
|
ldr r7, =0x00002771
|
|
adds r0, r7, 0
|
|
bl AllocSpritePalette
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
movs r2, 0
|
|
mov r8, r2
|
|
strh r0, [r5, 0x24]
|
|
cmp r0, 0xFF
|
|
beq _08111EFE
|
|
cmp r0, 0xF
|
|
beq _08111EFE
|
|
movs r0, 0x1
|
|
bl duplicate_obj_of_side_rel2move_in_transparent_mode
|
|
strh r0, [r5, 0x8]
|
|
lsls r0, 16
|
|
cmp r0, 0
|
|
bge _08111F0C
|
|
adds r0, r7, 0
|
|
bl FreeSpritePaletteByTag
|
|
_08111EFE:
|
|
adds r0, r4, 0
|
|
bl DestroyAnimVisualTask
|
|
b _081120CC
|
|
.pool
|
|
_08111F0C:
|
|
ldr r4, =gSprites
|
|
movs r1, 0x8
|
|
ldrsh r0, [r5, r1]
|
|
lsls r1, r0, 4
|
|
adds r1, r0
|
|
lsls r1, 2
|
|
adds r1, r4
|
|
ldrh r2, [r5, 0x24]
|
|
lsls r2, 4
|
|
ldrb r3, [r1, 0x5]
|
|
movs r0, 0xF
|
|
ands r0, r3
|
|
orrs r0, r2
|
|
strb r0, [r1, 0x5]
|
|
movs r2, 0x8
|
|
ldrsh r0, [r5, r2]
|
|
lsls r1, r0, 4
|
|
adds r1, r0
|
|
lsls r1, 2
|
|
adds r1, r4
|
|
ldrb r2, [r1, 0x1]
|
|
movs r0, 0xD
|
|
negs r0, r0
|
|
ands r0, r2
|
|
strb r0, [r1, 0x1]
|
|
movs r0, 0x8
|
|
ldrsh r1, [r5, r0]
|
|
lsls r0, r1, 4
|
|
adds r0, r1
|
|
lsls r0, 2
|
|
adds r0, r4
|
|
ldrb r1, [r0, 0x5]
|
|
movs r2, 0xC
|
|
orrs r1, r2
|
|
strb r1, [r0, 0x5]
|
|
movs r1, 0x8
|
|
ldrsh r0, [r5, r1]
|
|
lsls r2, r0, 4
|
|
adds r2, r0
|
|
lsls r2, 2
|
|
adds r2, r4
|
|
ldr r0, =gBattleSpritesDataPtr
|
|
ldr r1, [r0]
|
|
ldr r0, =gBattleAnimTarget
|
|
ldrb r0, [r0]
|
|
ldr r1, [r1]
|
|
lsls r0, 2
|
|
adds r0, r1
|
|
ldr r1, [r0]
|
|
lsls r1, 31
|
|
adds r2, 0x3E
|
|
lsrs r1, 31
|
|
lsls r1, 2
|
|
ldrb r3, [r2]
|
|
movs r0, 0x5
|
|
negs r0, r0
|
|
ands r0, r3
|
|
orrs r0, r1
|
|
strb r0, [r2]
|
|
mov r2, r8
|
|
strh r2, [r5, 0xA]
|
|
strh r2, [r5, 0xC]
|
|
movs r0, 0x10
|
|
strh r0, [r5, 0xE]
|
|
movs r0, 0x1
|
|
bl GetAnimBattlerSpriteId
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
strh r0, [r5, 0x22]
|
|
movs r0, 0x22
|
|
ldrsh r1, [r5, r0]
|
|
lsls r0, r1, 4
|
|
adds r0, r1
|
|
lsls r0, 2
|
|
adds r0, r4
|
|
ldrb r0, [r0, 0x5]
|
|
lsrs r0, 4
|
|
adds r0, 0x10
|
|
lsls r0, 4
|
|
strh r0, [r5, 0x10]
|
|
cmp r6, 0x1
|
|
bne _08111FC4
|
|
movs r1, 0x80
|
|
lsls r1, 2
|
|
b _08111FC8
|
|
.pool
|
|
_08111FC4:
|
|
movs r1, 0x80
|
|
lsls r1, 3
|
|
_08111FC8:
|
|
movs r0, 0
|
|
bl ClearGpuRegBits
|
|
b _081120C6
|
|
_08111FD0:
|
|
movs r1, 0x24
|
|
ldrsh r0, [r5, r1]
|
|
adds r0, 0x10
|
|
lsls r0, 4
|
|
strh r0, [r5, 0x24]
|
|
movs r2, 0x10
|
|
ldrsh r0, [r5, r2]
|
|
lsls r0, 1
|
|
ldr r1, =gPlttBufferUnfaded
|
|
adds r0, r1
|
|
movs r2, 0x24
|
|
ldrsh r1, [r5, r2]
|
|
lsls r1, 1
|
|
ldr r2, =gPlttBufferFaded
|
|
adds r1, r2
|
|
ldr r2, =0x04000008
|
|
bl CpuSet
|
|
ldrh r0, [r5, 0x10]
|
|
ldr r3, =0x00003c0d
|
|
movs r1, 0x10
|
|
movs r2, 0xA
|
|
bl BlendPalette
|
|
b _081120C6
|
|
.pool
|
|
_08112014:
|
|
ldr r2, =gSprites
|
|
movs r0, 0x22
|
|
ldrsh r1, [r5, r0]
|
|
lsls r0, r1, 4
|
|
adds r0, r1
|
|
lsls r0, 2
|
|
adds r0, r2
|
|
ldrh r1, [r0, 0x26]
|
|
ldrh r0, [r0, 0x22]
|
|
adds r1, r0
|
|
subs r1, 0x20
|
|
lsls r1, 16
|
|
lsrs r2, r1, 16
|
|
cmp r1, 0
|
|
bge _08112034
|
|
movs r2, 0
|
|
_08112034:
|
|
cmp r6, 0x1
|
|
bne _08112054
|
|
lsls r0, r2, 24
|
|
lsrs r0, 24
|
|
adds r1, r2, 0
|
|
adds r1, 0x40
|
|
lsls r1, 24
|
|
lsrs r1, 24
|
|
movs r2, 0
|
|
str r2, [sp]
|
|
movs r2, 0x4
|
|
str r2, [sp, 0x4]
|
|
str r6, [sp, 0x8]
|
|
b _0811206C
|
|
.pool
|
|
_08112054:
|
|
lsls r0, r2, 24
|
|
lsrs r0, 24
|
|
adds r1, r2, 0
|
|
adds r1, 0x40
|
|
lsls r1, 24
|
|
lsrs r1, 24
|
|
movs r2, 0
|
|
str r2, [sp]
|
|
movs r2, 0x8
|
|
str r2, [sp, 0x4]
|
|
movs r2, 0x1
|
|
str r2, [sp, 0x8]
|
|
_0811206C:
|
|
movs r2, 0x2
|
|
movs r3, 0x6
|
|
bl ScanlineEffect_InitWave
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
strh r0, [r5, 0x1C]
|
|
b _081120C6
|
|
_0811207C:
|
|
cmp r6, 0x1
|
|
bne _08112090
|
|
ldr r1, =0x00003f42
|
|
movs r0, 0x50
|
|
bl SetGpuReg
|
|
b _08112098
|
|
.pool
|
|
_08112090:
|
|
ldr r1, =0x00003f44
|
|
movs r0, 0x50
|
|
bl SetGpuReg
|
|
_08112098:
|
|
movs r1, 0x80
|
|
lsls r1, 5
|
|
movs r0, 0x52
|
|
bl SetGpuReg
|
|
b _081120C6
|
|
.pool
|
|
_081120A8:
|
|
cmp r6, 0x1
|
|
bne _081120B8
|
|
movs r1, 0x80
|
|
lsls r1, 2
|
|
movs r0, 0
|
|
bl SetGpuRegBits
|
|
b _081120C2
|
|
_081120B8:
|
|
movs r1, 0x80
|
|
lsls r1, 3
|
|
movs r0, 0
|
|
bl SetGpuRegBits
|
|
_081120C2:
|
|
ldr r0, =sub_81120DC
|
|
str r0, [r5]
|
|
_081120C6:
|
|
ldrh r0, [r5, 0x26]
|
|
adds r0, 0x1
|
|
strh r0, [r5, 0x26]
|
|
_081120CC:
|
|
add sp, 0xC
|
|
pop {r3}
|
|
mov r8, r3
|
|
pop {r4-r7}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_8111E78
|
|
|
|
thumb_func_start sub_81120DC
|
|
sub_81120DC: @ 81120DC
|
|
push {r4,r5,lr}
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
adds r5, r0, 0
|
|
lsls r0, r5, 2
|
|
adds r0, r5
|
|
lsls r0, 3
|
|
ldr r1, =gTasks
|
|
adds r4, r0, r1
|
|
ldrh r1, [r4, 0xA]
|
|
adds r1, 0x1
|
|
strh r1, [r4, 0xA]
|
|
movs r0, 0x1
|
|
ands r0, r1
|
|
strh r0, [r4, 0x12]
|
|
cmp r0, 0
|
|
bne _08112114
|
|
ldr r1, =gSineTable
|
|
movs r2, 0xA
|
|
ldrsh r0, [r4, r2]
|
|
lsls r0, 1
|
|
adds r0, r1
|
|
movs r1, 0
|
|
ldrsh r0, [r0, r1]
|
|
movs r1, 0x12
|
|
bl __divsi3
|
|
strh r0, [r4, 0xC]
|
|
_08112114:
|
|
movs r2, 0x12
|
|
ldrsh r0, [r4, r2]
|
|
cmp r0, 0x1
|
|
bne _08112136
|
|
ldr r1, =gSineTable
|
|
movs r2, 0xA
|
|
ldrsh r0, [r4, r2]
|
|
lsls r0, 1
|
|
adds r0, r1
|
|
movs r1, 0
|
|
ldrsh r0, [r0, r1]
|
|
movs r1, 0x12
|
|
bl __divsi3
|
|
movs r1, 0x10
|
|
subs r1, r0
|
|
strh r1, [r4, 0xE]
|
|
_08112136:
|
|
ldrh r1, [r4, 0xE]
|
|
lsls r1, 8
|
|
ldrh r0, [r4, 0xC]
|
|
orrs r1, r0
|
|
lsls r1, 16
|
|
lsrs r1, 16
|
|
movs r0, 0x52
|
|
bl SetGpuReg
|
|
movs r2, 0xA
|
|
ldrsh r0, [r4, r2]
|
|
cmp r0, 0x80
|
|
bne _0811215E
|
|
movs r0, 0
|
|
strh r0, [r4, 0x26]
|
|
ldr r1, =sub_8112170
|
|
str r1, [r4]
|
|
adds r0, r5, 0
|
|
bl _call_via_r1
|
|
_0811215E:
|
|
pop {r4,r5}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_81120DC
|
|
|
|
thumb_func_start sub_8112170
|
|
sub_8112170: @ 8112170
|
|
push {r4-r6,lr}
|
|
lsls r0, 24
|
|
lsrs r5, r0, 24
|
|
lsls r0, r5, 2
|
|
adds r0, r5
|
|
lsls r0, 3
|
|
ldr r1, =gTasks
|
|
adds r4, r0, r1
|
|
ldr r0, =gBattleAnimTarget
|
|
ldrb r0, [r0]
|
|
bl sub_80A8364
|
|
lsls r0, 24
|
|
lsrs r6, r0, 24
|
|
movs r1, 0x26
|
|
ldrsh r0, [r4, r1]
|
|
cmp r0, 0x1
|
|
beq _081121DC
|
|
cmp r0, 0x1
|
|
bgt _081121A8
|
|
cmp r0, 0
|
|
beq _081121AE
|
|
b _08112258
|
|
.pool
|
|
_081121A8:
|
|
cmp r0, 0x2
|
|
beq _081121F0
|
|
b _08112258
|
|
_081121AE:
|
|
ldr r1, =gScanlineEffect
|
|
movs r0, 0x3
|
|
strb r0, [r1, 0x15]
|
|
movs r0, 0x1
|
|
bl GetAnimBattlerSpriteId
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
strh r0, [r4, 0x24]
|
|
cmp r6, 0x1
|
|
bne _081121D0
|
|
movs r1, 0x80
|
|
lsls r1, 2
|
|
b _081121D4
|
|
.pool
|
|
_081121D0:
|
|
movs r1, 0x80
|
|
lsls r1, 3
|
|
_081121D4:
|
|
movs r0, 0
|
|
bl ClearGpuRegBits
|
|
b _08112258
|
|
_081121DC:
|
|
ldrh r0, [r4, 0x10]
|
|
ldr r3, =0x00003c0d
|
|
movs r1, 0x10
|
|
movs r2, 0
|
|
bl BlendPalette
|
|
b _08112258
|
|
.pool
|
|
_081121F0:
|
|
ldr r3, =gSprites
|
|
movs r0, 0x24
|
|
ldrsh r1, [r4, r0]
|
|
lsls r0, r1, 4
|
|
adds r0, r1
|
|
lsls r0, 2
|
|
adds r0, r3
|
|
adds r0, 0x3E
|
|
ldrb r1, [r0]
|
|
movs r2, 0x4
|
|
orrs r1, r2
|
|
strb r1, [r0]
|
|
movs r0, 0x8
|
|
ldrsh r1, [r4, r0]
|
|
lsls r0, r1, 4
|
|
adds r0, r1
|
|
lsls r0, 2
|
|
adds r0, r3
|
|
bl obj_delete_but_dont_free_vram
|
|
ldr r0, =0x00002771
|
|
bl FreeSpritePaletteByTag
|
|
movs r0, 0x50
|
|
movs r1, 0
|
|
bl SetGpuReg
|
|
movs r0, 0x52
|
|
movs r1, 0
|
|
bl SetGpuReg
|
|
cmp r6, 0x1
|
|
bne _08112248
|
|
movs r1, 0x80
|
|
lsls r1, 2
|
|
movs r0, 0
|
|
bl SetGpuRegBits
|
|
b _08112252
|
|
.pool
|
|
_08112248:
|
|
movs r1, 0x80
|
|
lsls r1, 3
|
|
movs r0, 0
|
|
bl SetGpuRegBits
|
|
_08112252:
|
|
adds r0, r5, 0
|
|
bl DestroyAnimVisualTask
|
|
_08112258:
|
|
ldrh r0, [r4, 0x26]
|
|
adds r0, 0x1
|
|
strh r0, [r4, 0x26]
|
|
pop {r4-r6}
|
|
pop {r0}
|
|
bx r0
|
|
thumb_func_end sub_8112170
|
|
|
|
thumb_func_start sub_8112264
|
|
sub_8112264: @ 8112264
|
|
push {r4-r7,lr}
|
|
mov r7, r10
|
|
mov r6, r9
|
|
mov r5, r8
|
|
push {r5-r7}
|
|
adds r7, r0, 0
|
|
ldr r0, =gBattleAnimArgs
|
|
movs r1, 0
|
|
ldrsh r0, [r0, r1]
|
|
cmp r0, 0
|
|
bne _081122AC
|
|
ldr r4, =gBattleAnimAttacker
|
|
ldrb r0, [r4]
|
|
movs r1, 0
|
|
bl GetBattlerSpriteCoord
|
|
lsls r0, 24
|
|
lsrs r6, r0, 24
|
|
ldrb r0, [r4]
|
|
movs r1, 0x1
|
|
bl GetBattlerSpriteCoord
|
|
lsls r0, 24
|
|
lsrs r0, 8
|
|
movs r2, 0xE0
|
|
lsls r2, 13
|
|
adds r0, r2
|
|
lsrs r5, r0, 16
|
|
ldr r4, =gBattleAnimTarget
|
|
b _081122D0
|
|
.pool
|
|
_081122AC:
|
|
ldr r4, =gBattleAnimTarget
|
|
ldrb r0, [r4]
|
|
movs r1, 0
|
|
bl GetBattlerSpriteCoord
|
|
lsls r0, 24
|
|
lsrs r6, r0, 24
|
|
ldrb r0, [r4]
|
|
movs r1, 0x1
|
|
bl GetBattlerSpriteCoord
|
|
lsls r0, 24
|
|
lsrs r0, 8
|
|
movs r2, 0xE0
|
|
lsls r2, 13
|
|
adds r0, r2
|
|
lsrs r5, r0, 16
|
|
ldr r4, =gBattleAnimAttacker
|
|
_081122D0:
|
|
ldrb r0, [r4]
|
|
movs r1, 0
|
|
bl GetBattlerSpriteCoord
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
mov r10, r0
|
|
ldrb r0, [r4]
|
|
movs r1, 0x1
|
|
bl GetBattlerSpriteCoord
|
|
lsls r0, 24
|
|
lsrs r0, 8
|
|
movs r1, 0xE0
|
|
lsls r1, 13
|
|
adds r0, r1
|
|
lsrs r0, 16
|
|
mov r9, r0
|
|
mov r8, r5
|
|
mov r2, r9
|
|
subs r4, r2, r5
|
|
lsls r4, 16
|
|
lsrs r4, 16
|
|
lsls r0, r6, 4
|
|
strh r0, [r7, 0x2E]
|
|
lsls r0, r5, 4
|
|
strh r0, [r7, 0x30]
|
|
mov r1, r10
|
|
subs r0, r1, r6
|
|
lsls r0, 4
|
|
ldr r5, =gBattleAnimArgs
|
|
movs r2, 0x2
|
|
ldrsh r1, [r5, r2]
|
|
bl __divsi3
|
|
strh r0, [r7, 0x32]
|
|
lsls r4, 16
|
|
asrs r4, 12
|
|
movs r0, 0x2
|
|
ldrsh r1, [r5, r0]
|
|
adds r0, r4, 0
|
|
bl __divsi3
|
|
strh r0, [r7, 0x34]
|
|
ldrh r0, [r5, 0x2]
|
|
strh r0, [r7, 0x36]
|
|
mov r1, r10
|
|
strh r1, [r7, 0x38]
|
|
mov r2, r9
|
|
strh r2, [r7, 0x3A]
|
|
movs r1, 0x36
|
|
ldrsh r0, [r7, r1]
|
|
lsrs r1, r0, 31
|
|
adds r0, r1
|
|
asrs r0, 1
|
|
strh r0, [r7, 0x3C]
|
|
ldrb r1, [r7, 0x5]
|
|
movs r0, 0xD
|
|
negs r0, r0
|
|
ands r0, r1
|
|
movs r1, 0x8
|
|
orrs r0, r1
|
|
strb r0, [r7, 0x5]
|
|
strh r6, [r7, 0x20]
|
|
mov r2, r8
|
|
strh r2, [r7, 0x22]
|
|
ldr r0, =sub_8112384
|
|
str r0, [r7, 0x1C]
|
|
adds r2, r7, 0
|
|
adds r2, 0x3E
|
|
ldrb r0, [r2]
|
|
movs r1, 0x4
|
|
orrs r0, r1
|
|
strb r0, [r2]
|
|
pop {r3-r5}
|
|
mov r8, r3
|
|
mov r9, r4
|
|
mov r10, r5
|
|
pop {r4-r7}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_8112264
|
|
|
|
thumb_func_start sub_8112384
|
|
sub_8112384: @ 8112384
|
|
push {r4,lr}
|
|
adds r2, r0, 0
|
|
ldrh r3, [r2, 0x36]
|
|
movs r1, 0x36
|
|
ldrsh r0, [r2, r1]
|
|
cmp r0, 0
|
|
beq _081123BC
|
|
ldrh r0, [r2, 0x32]
|
|
ldrh r4, [r2, 0x2E]
|
|
adds r0, r4
|
|
strh r0, [r2, 0x2E]
|
|
ldrh r1, [r2, 0x34]
|
|
ldrh r4, [r2, 0x30]
|
|
adds r1, r4
|
|
strh r1, [r2, 0x30]
|
|
lsls r0, 16
|
|
asrs r0, 20
|
|
strh r0, [r2, 0x20]
|
|
lsls r1, 16
|
|
asrs r1, 20
|
|
strh r1, [r2, 0x22]
|
|
subs r0, r3, 0x1
|
|
strh r0, [r2, 0x36]
|
|
lsls r0, 16
|
|
asrs r0, 16
|
|
cmp r0, 0
|
|
bne _081123BC
|
|
strh r0, [r2, 0x2E]
|
|
_081123BC:
|
|
pop {r4}
|
|
pop {r0}
|
|
bx r0
|
|
thumb_func_end sub_8112384
|
|
|
|
thumb_func_start sub_81123C4
|
|
sub_81123C4: @ 81123C4
|
|
push {r4-r7,lr}
|
|
mov r7, r10
|
|
mov r6, r9
|
|
mov r5, r8
|
|
push {r5-r7}
|
|
sub sp, 0x14
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
lsls r1, r0, 2
|
|
adds r1, r0
|
|
lsls r1, 3
|
|
ldr r0, =gTasks
|
|
adds r1, r0
|
|
str r1, [sp]
|
|
movs r1, 0xFD
|
|
lsls r1, 6
|
|
movs r0, 0x50
|
|
bl SetGpuReg
|
|
movs r1, 0x80
|
|
lsls r1, 5
|
|
movs r0, 0x52
|
|
bl SetGpuReg
|
|
movs r0, 0
|
|
ldr r1, [sp]
|
|
strh r0, [r1, 0x12]
|
|
strh r0, [r1, 0x14]
|
|
strh r0, [r1, 0x16]
|
|
strh r0, [r1, 0x18]
|
|
movs r0, 0x10
|
|
strh r0, [r1, 0x1A]
|
|
ldr r2, =gBattleAnimArgs
|
|
ldrh r0, [r2]
|
|
strh r0, [r1, 0x1C]
|
|
ldr r4, =gBattleAnimAttacker
|
|
ldrb r0, [r4]
|
|
movs r1, 0x2
|
|
bl GetBattlerSpriteCoord
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
str r0, [sp, 0x4]
|
|
ldrb r0, [r4]
|
|
movs r1, 0x3
|
|
bl sub_80A861C
|
|
lsls r0, 16
|
|
lsrs r0, 16
|
|
str r0, [sp, 0x8]
|
|
bl IsContest
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
beq _08112434
|
|
b _08112530
|
|
_08112434:
|
|
movs r4, 0
|
|
_08112436:
|
|
lsls r1, r4, 16
|
|
asrs r3, r1, 16
|
|
ldr r0, =gBattleAnimAttacker
|
|
ldrb r2, [r0]
|
|
str r1, [sp, 0x10]
|
|
cmp r3, r2
|
|
beq _08112502
|
|
movs r0, 0x2
|
|
eors r2, r0
|
|
cmp r3, r2
|
|
beq _08112502
|
|
lsls r0, r4, 24
|
|
lsrs r4, r0, 24
|
|
adds r0, r4, 0
|
|
bl IsBattlerSpriteVisible
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
beq _08112502
|
|
ldr r6, [sp, 0x4]
|
|
ldr r3, [sp, 0x8]
|
|
lsls r0, r3, 16
|
|
asrs r7, r0, 16
|
|
ldr r0, =gUnknown_08596DB8
|
|
adds r1, r6, 0
|
|
adds r2, r7, 0
|
|
movs r3, 0x37
|
|
bl CreateSprite
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
mov r8, r0
|
|
cmp r0, 0x40
|
|
beq _08112502
|
|
adds r0, r4, 0
|
|
movs r1, 0x2
|
|
bl GetBattlerSpriteCoord
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
mov r10, r0
|
|
adds r0, r4, 0
|
|
movs r1, 0x3
|
|
bl sub_80A861C
|
|
lsls r0, 16
|
|
lsrs r0, 16
|
|
mov r9, r0
|
|
mov r0, r8
|
|
lsls r5, r0, 4
|
|
add r5, r8
|
|
lsls r5, 2
|
|
ldr r1, =gSprites
|
|
adds r4, r5, r1
|
|
lsls r0, r6, 4
|
|
strh r0, [r4, 0x2E]
|
|
lsls r0, r7, 4
|
|
strh r0, [r4, 0x30]
|
|
mov r2, r10
|
|
subs r0, r2, r6
|
|
lsls r0, 4
|
|
ldr r3, =gBattleAnimArgs
|
|
movs r2, 0x2
|
|
ldrsh r1, [r3, r2]
|
|
bl __divsi3
|
|
strh r0, [r4, 0x32]
|
|
mov r3, r9
|
|
lsls r0, r3, 16
|
|
asrs r0, 16
|
|
subs r0, r7
|
|
lsls r0, 4
|
|
ldr r2, =gBattleAnimArgs
|
|
movs r3, 0x2
|
|
ldrsh r1, [r2, r3]
|
|
bl __divsi3
|
|
strh r0, [r4, 0x34]
|
|
ldr r1, =gBattleAnimArgs
|
|
ldrh r0, [r1, 0x2]
|
|
strh r0, [r4, 0x36]
|
|
mov r2, r10
|
|
strh r2, [r4, 0x38]
|
|
mov r3, r9
|
|
strh r3, [r4, 0x3A]
|
|
ldr r0, =gSprites + 0x1C
|
|
adds r5, r0
|
|
ldr r0, =sub_8112384
|
|
str r0, [r5]
|
|
ldr r2, [sp]
|
|
movs r3, 0x20
|
|
ldrsh r1, [r2, r3]
|
|
adds r1, 0xD
|
|
lsls r1, 1
|
|
adds r0, r2, 0
|
|
adds r0, 0x8
|
|
adds r0, r1
|
|
mov r1, r8
|
|
strh r1, [r0]
|
|
ldrh r0, [r2, 0x20]
|
|
adds r0, 0x1
|
|
strh r0, [r2, 0x20]
|
|
_08112502:
|
|
ldr r2, [sp, 0x10]
|
|
movs r3, 0x80
|
|
lsls r3, 9
|
|
adds r0, r2, r3
|
|
lsrs r4, r0, 16
|
|
asrs r0, 16
|
|
cmp r0, 0x3
|
|
ble _08112436
|
|
b _081125B4
|
|
.pool
|
|
_08112530:
|
|
ldr r0, =gUnknown_08596DB8
|
|
ldr r7, [sp, 0x4]
|
|
ldr r2, [sp, 0x8]
|
|
lsls r1, r2, 16
|
|
asrs r1, 16
|
|
str r1, [sp, 0xC]
|
|
adds r1, r7, 0
|
|
ldr r2, [sp, 0xC]
|
|
movs r3, 0x37
|
|
bl CreateSprite
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
mov r8, r0
|
|
cmp r0, 0x40
|
|
beq _081125B4
|
|
movs r3, 0x30
|
|
mov r10, r3
|
|
movs r0, 0x28
|
|
mov r9, r0
|
|
ldr r6, =gSprites
|
|
mov r1, r8
|
|
lsls r5, r1, 4
|
|
add r5, r8
|
|
lsls r5, 2
|
|
adds r4, r5, r6
|
|
lsls r0, r7, 4
|
|
strh r0, [r4, 0x2E]
|
|
ldr r2, [sp, 0xC]
|
|
lsls r0, r2, 4
|
|
strh r0, [r4, 0x30]
|
|
subs r0, r3, r7
|
|
lsls r0, 4
|
|
ldr r3, =gBattleAnimArgs
|
|
movs r2, 0x2
|
|
ldrsh r1, [r3, r2]
|
|
bl __divsi3
|
|
strh r0, [r4, 0x32]
|
|
mov r3, r9
|
|
ldr r1, [sp, 0xC]
|
|
subs r0, r3, r1
|
|
lsls r0, 4
|
|
ldr r2, =gBattleAnimArgs
|
|
movs r3, 0x2
|
|
ldrsh r1, [r2, r3]
|
|
bl __divsi3
|
|
strh r0, [r4, 0x34]
|
|
ldr r1, =gBattleAnimArgs
|
|
ldrh r0, [r1, 0x2]
|
|
strh r0, [r4, 0x36]
|
|
mov r2, r10
|
|
strh r2, [r4, 0x38]
|
|
mov r3, r9
|
|
strh r3, [r4, 0x3A]
|
|
adds r6, 0x1C
|
|
adds r5, r6
|
|
ldr r0, =sub_8112384
|
|
str r0, [r5]
|
|
mov r1, r8
|
|
ldr r0, [sp]
|
|
strh r1, [r0, 0x22]
|
|
movs r0, 0x1
|
|
ldr r2, [sp]
|
|
strh r0, [r2, 0x20]
|
|
_081125B4:
|
|
ldr r0, =sub_81125E0
|
|
ldr r3, [sp]
|
|
str r0, [r3]
|
|
add sp, 0x14
|
|
pop {r3-r5}
|
|
mov r8, r3
|
|
mov r9, r4
|
|
mov r10, r5
|
|
pop {r4-r7}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_81123C4
|
|
|
|
thumb_func_start sub_81125E0
|
|
sub_81125E0: @ 81125E0
|
|
push {r4,r5,lr}
|
|
lsls r0, 24
|
|
lsrs r5, r0, 24
|
|
lsls r0, r5, 2
|
|
adds r0, r5
|
|
lsls r0, 3
|
|
ldr r1, =gTasks
|
|
adds r4, r0, r1
|
|
movs r0, 0x8
|
|
ldrsh r1, [r4, r0]
|
|
cmp r1, 0x1
|
|
beq _08112696
|
|
cmp r1, 0x1
|
|
bgt _08112608
|
|
cmp r1, 0
|
|
beq _08112616
|
|
b _08112752
|
|
.pool
|
|
_08112608:
|
|
cmp r1, 0x2
|
|
bne _0811260E
|
|
b _08112728
|
|
_0811260E:
|
|
cmp r1, 0x3
|
|
bne _08112614
|
|
b _0811273C
|
|
_08112614:
|
|
b _08112752
|
|
_08112616:
|
|
movs r2, 0x14
|
|
ldrsh r0, [r4, r2]
|
|
cmp r0, 0
|
|
bne _0811267C
|
|
ldrh r0, [r4, 0x12]
|
|
adds r0, 0x1
|
|
strh r0, [r4, 0x12]
|
|
lsls r0, 16
|
|
asrs r0, 16
|
|
cmp r0, 0x1
|
|
ble _0811267C
|
|
strh r1, [r4, 0x12]
|
|
ldrh r0, [r4, 0x16]
|
|
adds r0, 0x1
|
|
strh r0, [r4, 0x16]
|
|
movs r1, 0x1
|
|
ands r0, r1
|
|
cmp r0, 0
|
|
beq _0811264C
|
|
ldrh r1, [r4, 0x18]
|
|
movs r2, 0x18
|
|
ldrsh r0, [r4, r2]
|
|
cmp r0, 0xF
|
|
bgt _0811265A
|
|
adds r0, r1, 0x1
|
|
strh r0, [r4, 0x18]
|
|
b _0811265A
|
|
_0811264C:
|
|
ldrh r1, [r4, 0x1A]
|
|
movs r2, 0x1A
|
|
ldrsh r0, [r4, r2]
|
|
cmp r0, 0
|
|
beq _0811265A
|
|
subs r0, r1, 0x1
|
|
strh r0, [r4, 0x1A]
|
|
_0811265A:
|
|
ldrh r1, [r4, 0x1A]
|
|
lsls r1, 8
|
|
ldrh r0, [r4, 0x18]
|
|
orrs r1, r0
|
|
lsls r1, 16
|
|
lsrs r1, 16
|
|
movs r0, 0x52
|
|
bl SetGpuReg
|
|
movs r1, 0x16
|
|
ldrsh r0, [r4, r1]
|
|
cmp r0, 0x17
|
|
ble _0811267C
|
|
movs r0, 0
|
|
strh r0, [r4, 0x16]
|
|
movs r0, 0x1
|
|
strh r0, [r4, 0x14]
|
|
_0811267C:
|
|
ldrh r1, [r4, 0x1C]
|
|
movs r2, 0x1C
|
|
ldrsh r0, [r4, r2]
|
|
cmp r0, 0
|
|
beq _0811268C
|
|
subs r0, r1, 0x1
|
|
strh r0, [r4, 0x1C]
|
|
b _08112752
|
|
_0811268C:
|
|
movs r1, 0x14
|
|
ldrsh r0, [r4, r1]
|
|
cmp r0, 0
|
|
beq _08112752
|
|
b _08112734
|
|
_08112696:
|
|
ldrh r0, [r4, 0x12]
|
|
adds r0, 0x1
|
|
strh r0, [r4, 0x12]
|
|
lsls r0, 16
|
|
asrs r0, 16
|
|
cmp r0, 0x1
|
|
ble _08112752
|
|
movs r0, 0
|
|
strh r0, [r4, 0x12]
|
|
ldrh r0, [r4, 0x16]
|
|
adds r0, 0x1
|
|
strh r0, [r4, 0x16]
|
|
ands r0, r1
|
|
lsls r0, 16
|
|
cmp r0, 0
|
|
beq _081126C6
|
|
ldrh r1, [r4, 0x18]
|
|
movs r2, 0x18
|
|
ldrsh r0, [r4, r2]
|
|
cmp r0, 0
|
|
beq _081126D4
|
|
subs r0, r1, 0x1
|
|
strh r0, [r4, 0x18]
|
|
b _081126D4
|
|
_081126C6:
|
|
ldrh r1, [r4, 0x1A]
|
|
movs r2, 0x1A
|
|
ldrsh r0, [r4, r2]
|
|
cmp r0, 0xF
|
|
bgt _081126D4
|
|
adds r0, r1, 0x1
|
|
strh r0, [r4, 0x1A]
|
|
_081126D4:
|
|
ldrh r1, [r4, 0x1A]
|
|
lsls r1, 8
|
|
ldrh r0, [r4, 0x18]
|
|
orrs r1, r0
|
|
lsls r1, 16
|
|
lsrs r1, 16
|
|
movs r0, 0x52
|
|
bl SetGpuReg
|
|
ldr r1, [r4, 0x18]
|
|
movs r0, 0x80
|
|
lsls r0, 13
|
|
cmp r1, r0
|
|
bne _08112752
|
|
movs r5, 0
|
|
b _08112718
|
|
_081126F4:
|
|
adds r1, r5, 0
|
|
adds r1, 0xD
|
|
lsls r1, 1
|
|
adds r0, r4, 0
|
|
adds r0, 0x8
|
|
adds r0, r1
|
|
movs r2, 0
|
|
ldrsh r1, [r0, r2]
|
|
lsls r0, r1, 4
|
|
adds r0, r1
|
|
lsls r0, 2
|
|
ldr r1, =gSprites
|
|
adds r0, r1
|
|
bl DestroySprite
|
|
adds r0, r5, 0x1
|
|
lsls r0, 16
|
|
lsrs r5, r0, 16
|
|
_08112718:
|
|
movs r1, 0x20
|
|
ldrsh r0, [r4, r1]
|
|
cmp r5, r0
|
|
blt _081126F4
|
|
b _08112734
|
|
.pool
|
|
_08112728:
|
|
ldrh r0, [r4, 0x12]
|
|
adds r0, 0x1
|
|
strh r0, [r4, 0x12]
|
|
lsls r0, 16
|
|
cmp r0, 0
|
|
ble _08112752
|
|
_08112734:
|
|
ldrh r0, [r4, 0x8]
|
|
adds r0, 0x1
|
|
strh r0, [r4, 0x8]
|
|
b _08112752
|
|
_0811273C:
|
|
movs r0, 0x50
|
|
movs r1, 0
|
|
bl SetGpuReg
|
|
movs r0, 0x52
|
|
movs r1, 0
|
|
bl SetGpuReg
|
|
adds r0, r5, 0
|
|
bl DestroyAnimVisualTask
|
|
_08112752:
|
|
pop {r4,r5}
|
|
pop {r0}
|
|
bx r0
|
|
thumb_func_end sub_81125E0
|
|
|
|
thumb_func_start sub_8112758
|
|
sub_8112758: @ 8112758
|
|
push {r4-r7,lr}
|
|
lsls r0, 24
|
|
lsrs r7, r0, 24
|
|
ldr r0, =gBattle_WIN0H
|
|
movs r1, 0
|
|
strh r1, [r0]
|
|
ldr r0, =gBattle_WIN0V
|
|
strh r1, [r0]
|
|
ldr r1, =0x00003f3f
|
|
movs r0, 0x48
|
|
bl SetGpuReg
|
|
ldr r1, =0x00003f1f
|
|
movs r0, 0x4A
|
|
bl SetGpuReg
|
|
movs r0, 0x50
|
|
movs r1, 0xC8
|
|
bl SetGpuReg
|
|
movs r0, 0x54
|
|
movs r1, 0x10
|
|
bl SetGpuReg
|
|
ldr r0, =gBattleAnimAttacker
|
|
ldrb r0, [r0]
|
|
bl GetBattlerSide
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
bne _081127A0
|
|
bl IsContest
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
beq _081127B8
|
|
_081127A0:
|
|
movs r6, 0x28
|
|
b _081127BA
|
|
.pool
|
|
_081127B8:
|
|
movs r6, 0xC8
|
|
_081127BA:
|
|
ldr r1, =gBattle_WIN0H
|
|
lsls r3, r6, 16
|
|
asrs r2, r3, 16
|
|
lsls r0, r2, 8
|
|
orrs r0, r2
|
|
strh r0, [r1]
|
|
ldr r1, =gBattle_WIN0V
|
|
movs r5, 0x28
|
|
ldr r0, =0x00002828
|
|
strh r0, [r1]
|
|
lsrs r3, 16
|
|
movs r1, 0xF0
|
|
subs r1, r2
|
|
movs r4, 0x48
|
|
ldr r2, =gTasks
|
|
lsls r0, r7, 2
|
|
adds r0, r7
|
|
lsls r0, 3
|
|
adds r0, r2
|
|
strh r3, [r0, 0xA]
|
|
strh r1, [r0, 0xC]
|
|
strh r5, [r0, 0xE]
|
|
strh r4, [r0, 0x10]
|
|
strh r6, [r0, 0x12]
|
|
strh r5, [r0, 0x14]
|
|
ldr r1, =sub_811280C
|
|
str r1, [r0]
|
|
pop {r4-r7}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_8112758
|
|
|
|
thumb_func_start sub_811280C
|
|
sub_811280C: @ 811280C
|
|
push {r4-r7,lr}
|
|
mov r7, r10
|
|
mov r6, r9
|
|
mov r5, r8
|
|
push {r5-r7}
|
|
sub sp, 0x20
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
ldr r2, _0811292C @ =gTasks
|
|
lsls r1, r0, 2
|
|
adds r1, r0
|
|
lsls r1, 3
|
|
adds r4, r1, r2
|
|
ldrh r1, [r4, 0x8]
|
|
adds r0, r1, 0x1
|
|
strh r0, [r4, 0x8]
|
|
ldrh r5, [r4, 0xA]
|
|
ldrh r7, [r4, 0xC]
|
|
ldrh r0, [r4, 0xE]
|
|
mov r10, r0
|
|
ldrh r2, [r4, 0x10]
|
|
str r2, [sp, 0xC]
|
|
ldrh r0, [r4, 0x12]
|
|
ldrh r2, [r4, 0x14]
|
|
mov r8, r2
|
|
lsls r1, 16
|
|
asrs r6, r1, 16
|
|
cmp r6, 0xF
|
|
ble _08112848
|
|
b _08112938
|
|
_08112848:
|
|
lsls r0, 16
|
|
asrs r0, 16
|
|
bl __floatsidf
|
|
str r0, [sp, 0x10]
|
|
str r1, [sp, 0x14]
|
|
lsls r0, r5, 16
|
|
asrs r0, 16
|
|
bl __floatsidf
|
|
ldr r2, _08112930 @ =0x3FB00000
|
|
ldr r3, _08112934 @ =0x00000000
|
|
bl __muldf3
|
|
adds r5, r1, 0
|
|
adds r4, r0, 0
|
|
adds r0, r6, 0
|
|
bl __floatsidf
|
|
str r0, [sp, 0x18]
|
|
str r1, [sp, 0x1C]
|
|
adds r1, r5, 0
|
|
adds r0, r4, 0
|
|
ldr r2, [sp, 0x18]
|
|
ldr r3, [sp, 0x1C]
|
|
bl __muldf3
|
|
adds r3, r1, 0
|
|
adds r2, r0, 0
|
|
ldr r0, [sp, 0x10]
|
|
ldr r1, [sp, 0x14]
|
|
bl __subdf3
|
|
bl __fixunsdfsi
|
|
lsls r0, 16
|
|
lsrs r0, 16
|
|
mov r9, r0
|
|
lsls r0, r7, 16
|
|
asrs r0, 16
|
|
bl __floatsidf
|
|
ldr r2, _08112930 @ =0x3FB00000
|
|
ldr r3, _08112934 @ =0x00000000
|
|
bl __muldf3
|
|
ldr r2, [sp, 0x18]
|
|
ldr r3, [sp, 0x1C]
|
|
bl __muldf3
|
|
adds r3, r1, 0
|
|
adds r2, r0, 0
|
|
ldr r0, [sp, 0x10]
|
|
ldr r1, [sp, 0x14]
|
|
bl __adddf3
|
|
bl __fixunsdfsi
|
|
lsls r0, 16
|
|
lsrs r7, r0, 16
|
|
mov r1, r8
|
|
lsls r0, r1, 16
|
|
asrs r0, 16
|
|
bl __floatsidf
|
|
adds r5, r1, 0
|
|
adds r4, r0, 0
|
|
mov r2, r10
|
|
lsls r0, r2, 16
|
|
asrs r0, 16
|
|
bl __floatsidf
|
|
ldr r2, _08112930 @ =0x3FB00000
|
|
ldr r3, _08112934 @ =0x00000000
|
|
bl __muldf3
|
|
ldr r2, [sp, 0x18]
|
|
ldr r3, [sp, 0x1C]
|
|
bl __muldf3
|
|
adds r3, r1, 0
|
|
adds r2, r0, 0
|
|
adds r1, r5, 0
|
|
adds r0, r4, 0
|
|
bl __subdf3
|
|
bl __fixunsdfsi
|
|
lsls r0, 16
|
|
lsrs r6, r0, 16
|
|
ldr r1, [sp, 0xC]
|
|
lsls r0, r1, 16
|
|
asrs r0, 16
|
|
bl __floatsidf
|
|
ldr r2, _08112930 @ =0x3FB00000
|
|
ldr r3, _08112934 @ =0x00000000
|
|
bl __muldf3
|
|
ldr r2, [sp, 0x18]
|
|
ldr r3, [sp, 0x1C]
|
|
bl __muldf3
|
|
adds r3, r1, 0
|
|
adds r2, r0, 0
|
|
adds r1, r5, 0
|
|
adds r0, r4, 0
|
|
bl __adddf3
|
|
bl __fixunsdfsi
|
|
lsls r0, 16
|
|
lsrs r5, r0, 16
|
|
b _08112966
|
|
.align 2, 0
|
|
_0811292C:
|
|
.4byte gTasks
|
|
_08112930:
|
|
.4byte 0x3FB00000
|
|
_08112934:
|
|
.4byte 0x00000000
|
|
_08112938:
|
|
movs r2, 0
|
|
mov r9, r2
|
|
movs r7, 0xF0
|
|
movs r6, 0
|
|
movs r5, 0x70
|
|
str r6, [sp]
|
|
str r6, [sp, 0x4]
|
|
str r6, [sp, 0x8]
|
|
movs r0, 0x1
|
|
movs r1, 0
|
|
movs r3, 0
|
|
bl sub_80A75AC
|
|
lsls r0, 16
|
|
lsrs r0, 16
|
|
str r6, [sp]
|
|
movs r1, 0
|
|
movs r2, 0x10
|
|
movs r3, 0x10
|
|
bl BeginNormalPaletteFade
|
|
ldr r0, _08112988 @=sub_8112994
|
|
str r0, [r4]
|
|
_08112966:
|
|
ldr r1, _0811298C @=gBattle_WIN0H
|
|
mov r2, r9
|
|
lsls r0, r2, 8
|
|
orrs r7, r0
|
|
strh r7, [r1]
|
|
ldr r1, _08112990 @=gBattle_WIN0V
|
|
lsls r0, r6, 8
|
|
orrs r5, r0
|
|
strh r5, [r1]
|
|
add sp, 0x20
|
|
pop {r3-r5}
|
|
mov r8, r3
|
|
mov r9, r4
|
|
mov r10, r5
|
|
pop {r4-r7}
|
|
pop {r0}
|
|
bx r0
|
|
.align 2, 0
|
|
_08112988:
|
|
.4byte sub_8112994
|
|
_0811298C:
|
|
.4byte gBattle_WIN0H
|
|
_08112990:
|
|
.4byte gBattle_WIN0V
|
|
thumb_func_end sub_811280C
|
|
|
|
thumb_func_start sub_8112994
|
|
sub_8112994: @ 8112994
|
|
push {r4,r5,lr}
|
|
lsls r0, 24
|
|
lsrs r5, r0, 24
|
|
ldr r0, =gPaletteFade
|
|
ldrb r1, [r0, 0x7]
|
|
movs r0, 0x80
|
|
ands r0, r1
|
|
lsls r0, 24
|
|
lsrs r1, r0, 24
|
|
cmp r1, 0
|
|
bne _081129DA
|
|
ldr r0, =gBattle_WIN0H
|
|
strh r1, [r0]
|
|
ldr r0, =gBattle_WIN0V
|
|
strh r1, [r0]
|
|
ldr r4, =0x00003f3f
|
|
movs r0, 0x48
|
|
adds r1, r4, 0
|
|
bl SetGpuReg
|
|
movs r0, 0x4A
|
|
adds r1, r4, 0
|
|
bl SetGpuReg
|
|
movs r0, 0x50
|
|
movs r1, 0
|
|
bl SetGpuReg
|
|
movs r0, 0x54
|
|
movs r1, 0
|
|
bl SetGpuReg
|
|
adds r0, r5, 0
|
|
bl DestroyAnimVisualTask
|
|
_081129DA:
|
|
pop {r4,r5}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_8112994
|
|
|
|
thumb_func_start sub_81129F0
|
|
sub_81129F0: @ 81129F0
|
|
push {r4,lr}
|
|
adds r4, r0, 0
|
|
movs r1, 0x1
|
|
bl InitAnimSpritePos
|
|
ldr r0, =gBattleAnimAttacker
|
|
ldrb r0, [r0]
|
|
bl GetBattlerSide
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
bne _08112A24
|
|
movs r2, 0x18
|
|
ldr r3, =0x0000fffe
|
|
ldrb r0, [r4, 0x3]
|
|
movs r1, 0x3F
|
|
negs r1, r1
|
|
ands r1, r0
|
|
movs r0, 0x10
|
|
orrs r1, r0
|
|
strb r1, [r4, 0x3]
|
|
b _08112A28
|
|
.pool
|
|
_08112A24:
|
|
ldr r2, =0x0000ffe8
|
|
movs r3, 0x2
|
|
_08112A28:
|
|
lsls r0, r2, 16
|
|
asrs r0, 16
|
|
ldrh r1, [r4, 0x20]
|
|
adds r0, r1
|
|
strh r0, [r4, 0x20]
|
|
strh r3, [r4, 0x30]
|
|
movs r0, 0x3C
|
|
strh r0, [r4, 0x2E]
|
|
ldr r0, =sub_8112A4C
|
|
str r0, [r4, 0x1C]
|
|
pop {r4}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_81129F0
|
|
|
|
thumb_func_start sub_8112A4C
|
|
sub_8112A4C: @ 8112A4C
|
|
push {r4,lr}
|
|
adds r3, r0, 0
|
|
ldrh r1, [r3, 0x2E]
|
|
movs r2, 0x2E
|
|
ldrsh r0, [r3, r2]
|
|
cmp r0, 0
|
|
ble _08112A5E
|
|
subs r0, r1, 0x1
|
|
b _08112AC2
|
|
_08112A5E:
|
|
ldrh r0, [r3, 0x30]
|
|
ldrh r4, [r3, 0x24]
|
|
adds r1, r0, r4
|
|
strh r1, [r3, 0x24]
|
|
adds r0, r1, 0x7
|
|
lsls r0, 16
|
|
lsrs r0, 16
|
|
cmp r0, 0xE
|
|
bls _08112AC4
|
|
ldrh r0, [r3, 0x20]
|
|
adds r0, r1
|
|
strh r0, [r3, 0x20]
|
|
movs r0, 0
|
|
strh r0, [r3, 0x24]
|
|
ldrh r2, [r3, 0x4]
|
|
lsls r1, r2, 22
|
|
lsrs r1, 22
|
|
adds r1, 0x8
|
|
ldr r4, =0x000003ff
|
|
adds r0, r4, 0
|
|
ands r1, r0
|
|
ldr r0, =0xfffffc00
|
|
ands r0, r2
|
|
orrs r0, r1
|
|
strh r0, [r3, 0x4]
|
|
ldrh r0, [r3, 0x32]
|
|
adds r0, 0x1
|
|
strh r0, [r3, 0x32]
|
|
lsls r0, 16
|
|
asrs r0, 16
|
|
cmp r0, 0x3
|
|
bne _08112AC0
|
|
movs r0, 0x1E
|
|
strh r0, [r3, 0x2E]
|
|
ldr r0, =sub_80A64B0
|
|
str r0, [r3, 0x1C]
|
|
ldr r1, =sub_8112ACC
|
|
adds r0, r3, 0
|
|
bl StoreSpriteCallbackInData6
|
|
b _08112AC4
|
|
.pool
|
|
_08112AC0:
|
|
movs r0, 0x28
|
|
_08112AC2:
|
|
strh r0, [r3, 0x2E]
|
|
_08112AC4:
|
|
pop {r4}
|
|
pop {r0}
|
|
bx r0
|
|
thumb_func_end sub_8112A4C
|
|
|
|
thumb_func_start sub_8112ACC
|
|
sub_8112ACC: @ 8112ACC
|
|
push {r4,r5,lr}
|
|
adds r4, r0, 0
|
|
movs r0, 0x2E
|
|
ldrsh r5, [r4, r0]
|
|
cmp r5, 0
|
|
bne _08112AF6
|
|
movs r1, 0xFD
|
|
lsls r1, 6
|
|
movs r0, 0x50
|
|
bl SetGpuReg
|
|
movs r0, 0x52
|
|
movs r1, 0x10
|
|
bl SetGpuReg
|
|
ldrh r0, [r4, 0x2E]
|
|
adds r0, 0x1
|
|
strh r0, [r4, 0x2E]
|
|
strh r5, [r4, 0x30]
|
|
strh r5, [r4, 0x32]
|
|
b _08112B3A
|
|
_08112AF6:
|
|
ldrh r1, [r4, 0x30]
|
|
movs r2, 0x30
|
|
ldrsh r0, [r4, r2]
|
|
cmp r0, 0x1
|
|
bgt _08112B06
|
|
adds r0, r1, 0x1
|
|
strh r0, [r4, 0x30]
|
|
b _08112B3A
|
|
_08112B06:
|
|
movs r0, 0
|
|
strh r0, [r4, 0x30]
|
|
ldrh r0, [r4, 0x32]
|
|
adds r0, 0x1
|
|
strh r0, [r4, 0x32]
|
|
movs r1, 0x10
|
|
subs r1, r0
|
|
lsls r0, 8
|
|
orrs r1, r0
|
|
lsls r1, 16
|
|
lsrs r1, 16
|
|
movs r0, 0x52
|
|
bl SetGpuReg
|
|
movs r1, 0x32
|
|
ldrsh r0, [r4, r1]
|
|
cmp r0, 0x10
|
|
bne _08112B3A
|
|
adds r2, r4, 0
|
|
adds r2, 0x3E
|
|
ldrb r0, [r2]
|
|
movs r1, 0x4
|
|
orrs r0, r1
|
|
strb r0, [r2]
|
|
ldr r0, =sub_8112B44
|
|
str r0, [r4, 0x1C]
|
|
_08112B3A:
|
|
pop {r4,r5}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_8112ACC
|
|
|
|
thumb_func_start sub_8112B44
|
|
sub_8112B44: @ 8112B44
|
|
push {r4,lr}
|
|
adds r4, r0, 0
|
|
movs r0, 0x50
|
|
movs r1, 0
|
|
bl SetGpuReg
|
|
movs r0, 0x52
|
|
movs r1, 0
|
|
bl SetGpuReg
|
|
ldr r0, =gBattle_WIN0H
|
|
movs r1, 0
|
|
strh r1, [r0]
|
|
ldr r0, =gBattle_WIN0V
|
|
strh r1, [r0]
|
|
adds r0, r4, 0
|
|
bl DestroyAnimSprite
|
|
pop {r4}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_8112B44
|
|
|
|
thumb_func_start sub_8112B78
|
|
sub_8112B78: @ 8112B78
|
|
push {r4-r7,lr}
|
|
adds r5, r0, 0
|
|
movs r1, 0x2E
|
|
ldrsh r0, [r5, r1]
|
|
movs r1, 0xC
|
|
bl Sin
|
|
strh r0, [r5, 0x24]
|
|
ldr r0, =gBattleAnimAttacker
|
|
ldrb r0, [r0]
|
|
bl GetBattlerSide
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
beq _08112B9C
|
|
ldrh r0, [r5, 0x24]
|
|
negs r0, r0
|
|
strh r0, [r5, 0x24]
|
|
_08112B9C:
|
|
ldrh r0, [r5, 0x2E]
|
|
adds r0, 0x6
|
|
movs r1, 0xFF
|
|
ands r0, r1
|
|
strh r0, [r5, 0x2E]
|
|
movs r1, 0x80
|
|
lsls r1, 1
|
|
adds r0, r1, 0
|
|
ldrh r1, [r5, 0x30]
|
|
adds r0, r1
|
|
strh r0, [r5, 0x30]
|
|
lsls r0, 16
|
|
asrs r0, 24
|
|
negs r0, r0
|
|
strh r0, [r5, 0x26]
|
|
ldrh r0, [r5, 0x3C]
|
|
adds r0, 0x1
|
|
strh r0, [r5, 0x3C]
|
|
lsls r0, 16
|
|
asrs r0, 16
|
|
cmp r0, 0x1
|
|
bne _08112BE8
|
|
ldr r0, =0x0000050b
|
|
strh r0, [r5, 0x3A]
|
|
movs r1, 0xFD
|
|
lsls r1, 6
|
|
movs r0, 0x50
|
|
bl SetGpuReg
|
|
ldrh r1, [r5, 0x3A]
|
|
movs r0, 0x52
|
|
bl SetGpuReg
|
|
b _08112C40
|
|
.pool
|
|
_08112BE8:
|
|
cmp r0, 0x1E
|
|
ble _08112C40
|
|
ldrh r0, [r5, 0x32]
|
|
adds r0, 0x1
|
|
strh r0, [r5, 0x32]
|
|
ldrh r1, [r5, 0x3A]
|
|
lsls r0, r1, 16
|
|
asrs r0, 24
|
|
lsls r0, 16
|
|
movs r6, 0xFF
|
|
ands r6, r1
|
|
movs r1, 0x80
|
|
lsls r1, 9
|
|
adds r0, r1
|
|
lsrs r7, r0, 16
|
|
cmp r7, 0x10
|
|
bls _08112C0C
|
|
movs r7, 0x10
|
|
_08112C0C:
|
|
subs r0, r6, 0x1
|
|
lsls r0, 16
|
|
lsrs r6, r0, 16
|
|
cmp r0, 0
|
|
bge _08112C18
|
|
movs r6, 0
|
|
_08112C18:
|
|
lsls r4, r7, 8
|
|
orrs r4, r6
|
|
lsls r1, r4, 16
|
|
lsrs r1, 16
|
|
movs r0, 0x52
|
|
bl SetGpuReg
|
|
strh r4, [r5, 0x3A]
|
|
cmp r7, 0x10
|
|
bne _08112C40
|
|
cmp r6, 0
|
|
bne _08112C40
|
|
adds r2, r5, 0
|
|
adds r2, 0x3E
|
|
ldrb r0, [r2]
|
|
movs r1, 0x4
|
|
orrs r0, r1
|
|
strb r0, [r2]
|
|
ldr r0, =sub_8112C4C
|
|
str r0, [r5, 0x1C]
|
|
_08112C40:
|
|
pop {r4-r7}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_8112B78
|
|
|
|
thumb_func_start sub_8112C4C
|
|
sub_8112C4C: @ 8112C4C
|
|
push {r4,lr}
|
|
adds r4, r0, 0
|
|
movs r0, 0x50
|
|
movs r1, 0
|
|
bl SetGpuReg
|
|
movs r0, 0x52
|
|
movs r1, 0
|
|
bl SetGpuReg
|
|
adds r0, r4, 0
|
|
bl DestroyAnimSprite
|
|
pop {r4}
|
|
pop {r0}
|
|
bx r0
|
|
thumb_func_end sub_8112C4C
|
|
|
|
thumb_func_start sub_8112C6C
|
|
sub_8112C6C: @ 8112C6C
|
|
push {r4-r6,lr}
|
|
mov r6, r8
|
|
push {r6}
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
lsls r4, r0, 2
|
|
adds r4, r0
|
|
lsls r4, 3
|
|
ldr r0, =gTasks
|
|
adds r4, r0
|
|
movs r6, 0
|
|
strh r6, [r4, 0x8]
|
|
movs r0, 0x10
|
|
mov r8, r0
|
|
mov r0, r8
|
|
strh r0, [r4, 0xA]
|
|
ldr r5, =gBattleAnimAttacker
|
|
ldrb r0, [r5]
|
|
movs r1, 0x2
|
|
bl GetBattlerSpriteCoord
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
strh r0, [r4, 0x1A]
|
|
ldrb r0, [r5]
|
|
bl GetBattlerYCoordWithElevation
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
strh r0, [r4, 0x1C]
|
|
ldrb r0, [r5]
|
|
movs r1, 0x1
|
|
bl sub_80A861C
|
|
lsls r0, 16
|
|
asrs r1, r0, 16
|
|
lsrs r0, 31
|
|
adds r1, r0
|
|
asrs r1, 1
|
|
adds r1, 0x8
|
|
strh r1, [r4, 0x1E]
|
|
strh r6, [r4, 0x16]
|
|
ldrb r0, [r5]
|
|
bl sub_80A8328
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
strh r0, [r4, 0x12]
|
|
ldrb r0, [r5]
|
|
bl sub_80A82E4
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
subs r0, 0x2
|
|
strh r0, [r4, 0x14]
|
|
strh r6, [r4, 0xE]
|
|
mov r0, r8
|
|
strh r0, [r4, 0x10]
|
|
movs r1, 0xFD
|
|
lsls r1, 6
|
|
movs r0, 0x50
|
|
bl SetGpuReg
|
|
movs r1, 0x80
|
|
lsls r1, 5
|
|
movs r0, 0x52
|
|
bl SetGpuReg
|
|
strh r6, [r4, 0x18]
|
|
ldr r0, =sub_8112D10
|
|
str r0, [r4]
|
|
pop {r3}
|
|
mov r8, r3
|
|
pop {r4-r6}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_8112C6C
|
|
|
|
thumb_func_start sub_8112D10
|
|
sub_8112D10: @ 8112D10
|
|
push {r4-r7,lr}
|
|
lsls r0, 24
|
|
lsrs r7, r0, 24
|
|
lsls r0, r7, 2
|
|
adds r0, r7
|
|
lsls r0, 3
|
|
ldr r1, =gTasks
|
|
adds r4, r0, r1
|
|
movs r1, 0x8
|
|
ldrsh r0, [r4, r1]
|
|
cmp r0, 0x5
|
|
bls _08112D2A
|
|
b _08112E96
|
|
_08112D2A:
|
|
lsls r0, 2
|
|
ldr r1, =_08112D3C
|
|
adds r0, r1
|
|
ldr r0, [r0]
|
|
mov pc, r0
|
|
.pool
|
|
.align 2, 0
|
|
_08112D3C:
|
|
.4byte _08112D54
|
|
.4byte _08112DC4
|
|
.4byte _08112E06
|
|
.4byte _08112E1A
|
|
.4byte _08112E70
|
|
.4byte _08112E80
|
|
_08112D54:
|
|
movs r6, 0
|
|
_08112D56:
|
|
movs r2, 0x1A
|
|
ldrsh r1, [r4, r2]
|
|
movs r0, 0x1C
|
|
ldrsh r2, [r4, r0]
|
|
ldrb r3, [r4, 0x14]
|
|
ldr r0, =gUnknown_08596E30
|
|
bl CreateSprite
|
|
lsls r0, 24
|
|
lsrs r2, r0, 24
|
|
cmp r2, 0x40
|
|
beq _08112DAA
|
|
ldr r1, =gSprites
|
|
lsls r0, r2, 4
|
|
adds r0, r2
|
|
lsls r0, 2
|
|
adds r5, r0, r1
|
|
strh r7, [r5, 0x2E]
|
|
ldr r0, =gBattleAnimAttacker
|
|
ldrb r0, [r0]
|
|
bl GetBattlerSide
|
|
movs r1, 0
|
|
lsls r0, 24
|
|
cmp r0, 0
|
|
bne _08112D8C
|
|
movs r1, 0x1
|
|
_08112D8C:
|
|
strh r1, [r5, 0x30]
|
|
movs r0, 0x2A
|
|
muls r0, r6
|
|
movs r1, 0xFF
|
|
ands r0, r1
|
|
strh r0, [r5, 0x32]
|
|
ldrh r0, [r4, 0x1E]
|
|
strh r0, [r5, 0x34]
|
|
lsls r0, r6, 1
|
|
adds r0, r6
|
|
lsls r0, 1
|
|
strh r0, [r5, 0x38]
|
|
ldrh r0, [r4, 0x16]
|
|
adds r0, 0x1
|
|
strh r0, [r4, 0x16]
|
|
_08112DAA:
|
|
adds r0, r6, 0x1
|
|
lsls r0, 16
|
|
lsrs r6, r0, 16
|
|
cmp r6, 0x5
|
|
bls _08112D56
|
|
b _08112E78
|
|
.pool
|
|
_08112DC4:
|
|
ldrh r0, [r4, 0xA]
|
|
adds r0, 0x1
|
|
strh r0, [r4, 0xA]
|
|
movs r1, 0x1
|
|
ands r0, r1
|
|
cmp r0, 0
|
|
beq _08112DE2
|
|
ldrh r1, [r4, 0xE]
|
|
movs r2, 0xE
|
|
ldrsh r0, [r4, r2]
|
|
cmp r0, 0xD
|
|
bgt _08112DF0
|
|
adds r0, r1, 0x1
|
|
strh r0, [r4, 0xE]
|
|
b _08112DF0
|
|
_08112DE2:
|
|
ldrh r1, [r4, 0x10]
|
|
movs r2, 0x10
|
|
ldrsh r0, [r4, r2]
|
|
cmp r0, 0x4
|
|
ble _08112DF0
|
|
subs r0, r1, 0x1
|
|
strh r0, [r4, 0x10]
|
|
_08112DF0:
|
|
movs r1, 0xE
|
|
ldrsh r0, [r4, r1]
|
|
ldrh r2, [r4, 0xE]
|
|
ldrh r1, [r4, 0x10]
|
|
cmp r0, 0xE
|
|
bne _08112E60
|
|
cmp r1, 0x4
|
|
bne _08112E60
|
|
movs r0, 0
|
|
strh r0, [r4, 0xA]
|
|
b _08112E5A
|
|
_08112E06:
|
|
ldrh r0, [r4, 0xA]
|
|
adds r0, 0x1
|
|
strh r0, [r4, 0xA]
|
|
lsls r0, 16
|
|
asrs r0, 16
|
|
cmp r0, 0x1E
|
|
ble _08112E96
|
|
movs r0, 0
|
|
strh r0, [r4, 0xA]
|
|
b _08112E78
|
|
_08112E1A:
|
|
ldrh r0, [r4, 0xA]
|
|
adds r0, 0x1
|
|
strh r0, [r4, 0xA]
|
|
movs r1, 0x1
|
|
ands r0, r1
|
|
cmp r0, 0
|
|
beq _08112E38
|
|
ldrh r1, [r4, 0xE]
|
|
movs r2, 0xE
|
|
ldrsh r0, [r4, r2]
|
|
cmp r0, 0
|
|
ble _08112E46
|
|
subs r0, r1, 0x1
|
|
strh r0, [r4, 0xE]
|
|
b _08112E46
|
|
_08112E38:
|
|
ldrh r1, [r4, 0x10]
|
|
movs r2, 0x10
|
|
ldrsh r0, [r4, r2]
|
|
cmp r0, 0xF
|
|
bgt _08112E46
|
|
adds r0, r1, 0x1
|
|
strh r0, [r4, 0x10]
|
|
_08112E46:
|
|
movs r1, 0xE
|
|
ldrsh r0, [r4, r1]
|
|
ldrh r2, [r4, 0xE]
|
|
ldrh r1, [r4, 0x10]
|
|
cmp r0, 0
|
|
bne _08112E60
|
|
cmp r1, 0x10
|
|
bne _08112E60
|
|
movs r0, 0x1
|
|
strh r0, [r4, 0x18]
|
|
_08112E5A:
|
|
ldrh r0, [r4, 0x8]
|
|
adds r0, 0x1
|
|
strh r0, [r4, 0x8]
|
|
_08112E60:
|
|
lsls r1, 8
|
|
orrs r1, r2
|
|
lsls r1, 16
|
|
lsrs r1, 16
|
|
movs r0, 0x52
|
|
bl SetGpuReg
|
|
b _08112E96
|
|
_08112E70:
|
|
movs r2, 0x16
|
|
ldrsh r0, [r4, r2]
|
|
cmp r0, 0
|
|
bne _08112E96
|
|
_08112E78:
|
|
ldrh r0, [r4, 0x8]
|
|
adds r0, 0x1
|
|
strh r0, [r4, 0x8]
|
|
b _08112E96
|
|
_08112E80:
|
|
movs r0, 0x50
|
|
movs r1, 0
|
|
bl SetGpuReg
|
|
movs r0, 0x52
|
|
movs r1, 0
|
|
bl SetGpuReg
|
|
adds r0, r7, 0
|
|
bl DestroyAnimVisualTask
|
|
_08112E96:
|
|
pop {r4-r7}
|
|
pop {r0}
|
|
bx r0
|
|
thumb_func_end sub_8112D10
|
|
|
|
thumb_func_start sub_8112E9C
|
|
sub_8112E9C: @ 8112E9C
|
|
push {r4,lr}
|
|
adds r4, r0, 0
|
|
movs r1, 0x30
|
|
ldrsh r0, [r4, r1]
|
|
cmp r0, 0
|
|
bne _08112EAE
|
|
ldrh r0, [r4, 0x32]
|
|
adds r0, 0x2
|
|
b _08112EB2
|
|
_08112EAE:
|
|
ldrh r0, [r4, 0x32]
|
|
subs r0, 0x2
|
|
_08112EB2:
|
|
strh r0, [r4, 0x32]
|
|
ldrh r1, [r4, 0x32]
|
|
movs r0, 0xFF
|
|
ands r0, r1
|
|
strh r0, [r4, 0x32]
|
|
movs r2, 0x32
|
|
ldrsh r0, [r4, r2]
|
|
movs r2, 0x34
|
|
ldrsh r1, [r4, r2]
|
|
bl Sin
|
|
strh r0, [r4, 0x24]
|
|
ldrh r0, [r4, 0x32]
|
|
subs r0, 0x41
|
|
lsls r0, 16
|
|
lsrs r0, 16
|
|
cmp r0, 0x7E
|
|
bhi _08112EF4
|
|
ldr r2, =gTasks
|
|
movs r0, 0x2E
|
|
ldrsh r1, [r4, r0]
|
|
lsls r0, r1, 2
|
|
adds r0, r1
|
|
lsls r0, 3
|
|
adds r0, r2
|
|
ldrh r1, [r0, 0x12]
|
|
adds r1, 0x1
|
|
movs r0, 0x3
|
|
ands r1, r0
|
|
b _08112F08
|
|
.pool
|
|
_08112EF4:
|
|
ldr r2, =gTasks
|
|
movs r0, 0x2E
|
|
ldrsh r1, [r4, r0]
|
|
lsls r0, r1, 2
|
|
adds r0, r1
|
|
lsls r0, 3
|
|
adds r0, r2
|
|
movs r2, 0x3
|
|
ldrb r1, [r0, 0x12]
|
|
ands r1, r2
|
|
_08112F08:
|
|
lsls r1, 2
|
|
ldrb r2, [r4, 0x5]
|
|
movs r0, 0xD
|
|
negs r0, r0
|
|
ands r0, r2
|
|
orrs r0, r1
|
|
strb r0, [r4, 0x5]
|
|
ldrh r0, [r4, 0x38]
|
|
adds r0, 0x1
|
|
strh r0, [r4, 0x38]
|
|
movs r1, 0x38
|
|
ldrsh r0, [r4, r1]
|
|
lsls r0, 3
|
|
movs r1, 0xFF
|
|
ands r0, r1
|
|
strh r0, [r4, 0x3A]
|
|
movs r2, 0x3A
|
|
ldrsh r0, [r4, r2]
|
|
movs r1, 0x7
|
|
bl Sin
|
|
strh r0, [r4, 0x26]
|
|
ldr r2, =gTasks
|
|
movs r0, 0x2E
|
|
ldrsh r1, [r4, r0]
|
|
lsls r0, r1, 2
|
|
adds r0, r1
|
|
lsls r0, 3
|
|
adds r1, r0, r2
|
|
movs r2, 0x18
|
|
ldrsh r0, [r1, r2]
|
|
cmp r0, 0
|
|
beq _08112F56
|
|
ldrh r0, [r1, 0x16]
|
|
subs r0, 0x1
|
|
strh r0, [r1, 0x16]
|
|
adds r0, r4, 0
|
|
bl DestroySprite
|
|
_08112F56:
|
|
pop {r4}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_8112E9C
|
|
|
|
thumb_func_start sub_8112F60
|
|
sub_8112F60: @ 8112F60
|
|
adds r3, r0, 0
|
|
adds r3, 0x3E
|
|
ldrb r1, [r3]
|
|
movs r2, 0x4
|
|
orrs r1, r2
|
|
strb r1, [r3]
|
|
ldr r2, =gBattlerSpriteIds
|
|
ldr r1, =gBattleAnimAttacker
|
|
ldrb r1, [r1]
|
|
adds r1, r2
|
|
ldrb r1, [r1]
|
|
strh r1, [r0, 0x38]
|
|
movs r1, 0x80
|
|
strh r1, [r0, 0x2E]
|
|
movs r1, 0xA
|
|
strh r1, [r0, 0x30]
|
|
ldr r2, =gBattleAnimArgs
|
|
ldrh r1, [r2]
|
|
strh r1, [r0, 0x32]
|
|
ldrh r1, [r2, 0x2]
|
|
strh r1, [r0, 0x34]
|
|
ldr r1, =sub_8112FB8
|
|
str r1, [r0, 0x1C]
|
|
ldr r2, =gSprites
|
|
movs r3, 0x38
|
|
ldrsh r1, [r0, r3]
|
|
lsls r0, r1, 4
|
|
adds r0, r1
|
|
lsls r0, 2
|
|
adds r0, r2
|
|
ldrh r1, [r0, 0x22]
|
|
adds r1, 0x8
|
|
strh r1, [r0, 0x22]
|
|
bx lr
|
|
.pool
|
|
thumb_func_end sub_8112F60
|
|
|
|
thumb_func_start sub_8112FB8
|
|
sub_8112FB8: @ 8112FB8
|
|
push {r4,r5,lr}
|
|
adds r5, r0, 0
|
|
ldrh r0, [r5, 0x34]
|
|
movs r1, 0x34
|
|
ldrsh r3, [r5, r1]
|
|
cmp r3, 0
|
|
beq _08113020
|
|
subs r0, 0x1
|
|
strh r0, [r5, 0x34]
|
|
movs r2, 0x2E
|
|
ldrsh r0, [r5, r2]
|
|
movs r2, 0x30
|
|
ldrsh r1, [r5, r2]
|
|
bl Sin
|
|
ldr r4, =gSprites
|
|
movs r1, 0x38
|
|
ldrsh r2, [r5, r1]
|
|
lsls r1, r2, 4
|
|
adds r1, r2
|
|
lsls r1, 2
|
|
adds r1, r4
|
|
strh r0, [r1, 0x24]
|
|
movs r2, 0x2E
|
|
ldrsh r0, [r5, r2]
|
|
movs r2, 0x30
|
|
ldrsh r1, [r5, r2]
|
|
bl Cos
|
|
movs r1, 0x38
|
|
ldrsh r2, [r5, r1]
|
|
lsls r1, r2, 4
|
|
adds r1, r2
|
|
lsls r1, 2
|
|
adds r1, r4
|
|
strh r0, [r1, 0x26]
|
|
ldrh r0, [r5, 0x32]
|
|
ldrh r2, [r5, 0x2E]
|
|
adds r1, r0, r2
|
|
strh r1, [r5, 0x2E]
|
|
lsls r0, r1, 16
|
|
asrs r0, 16
|
|
cmp r0, 0xFF
|
|
ble _08113054
|
|
ldr r2, =0xffffff00
|
|
adds r0, r1, r2
|
|
strh r0, [r5, 0x2E]
|
|
b _08113054
|
|
.pool
|
|
_08113020:
|
|
ldr r2, =gSprites
|
|
movs r0, 0x38
|
|
ldrsh r1, [r5, r0]
|
|
lsls r0, r1, 4
|
|
adds r0, r1
|
|
lsls r0, 2
|
|
adds r0, r2
|
|
strh r3, [r0, 0x24]
|
|
movs r0, 0x38
|
|
ldrsh r1, [r5, r0]
|
|
lsls r0, r1, 4
|
|
adds r0, r1
|
|
lsls r0, 2
|
|
adds r0, r2
|
|
strh r3, [r0, 0x26]
|
|
movs r0, 0x38
|
|
ldrsh r1, [r5, r0]
|
|
lsls r0, r1, 4
|
|
adds r0, r1
|
|
lsls r0, 2
|
|
adds r0, r2
|
|
ldrh r1, [r0, 0x22]
|
|
subs r1, 0x8
|
|
strh r1, [r0, 0x22]
|
|
ldr r0, =move_anim_8074EE0
|
|
str r0, [r5, 0x1C]
|
|
_08113054:
|
|
pop {r4,r5}
|
|
pop {r0}
|
|
bx r0
|
|
.pool
|
|
thumb_func_end sub_8112FB8
|
|
|
|
.align 2, 0
|