Initial commit for ghost

This commit is contained in:
KDSKardabox 2018-12-09 13:44:07 +05:30
parent 1357449d73
commit f8838491f6
4 changed files with 1123 additions and 808 deletions

View File

@ -5,809 +5,6 @@
.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}

View File

@ -130,6 +130,7 @@ void sub_80A7E6C(u8 spriteId);
void sub_80A805C(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7);
u8 sub_80A80C8(struct Task *task);
void sub_80A8EE4(struct Sprite *);
void sub_80A67F4(struct Sprite *);
enum
{

View File

@ -167,6 +167,7 @@ SECTIONS {
asm/psychic.o(.text);
src/bug.o(.text);
src/rock.o(.text);
src/ghost.o(.text);
asm/ghost.o(.text);
src/dragon.o(.text);
asm/dark.o(.text);

File diff suppressed because it is too large Load Diff