pokeemerald/asm/gpu_obj.s

4562 lines
74 KiB
ArmAsm
Raw Normal View History

2016-09-02 23:11:29 -07:00
.include "asm/macros.s"
.syntax unified
.text
2015-12-03 00:17:29 -08:00
thumb_func_start ResetAllObjectData
2016-09-02 19:51:16 -07:00
@ void ResetAllObjectData()
ResetAllObjectData: @ 8006974
2015-10-06 05:46:30 -07:00
push {r4,lr}
movs r0, 0
movs r1, 0x80
2015-12-03 00:17:29 -08:00
bl ResetSpriteRange
bl RemoveAllObjects
bl ClearObjectCopyRequests
2015-10-06 05:46:30 -07:00
bl rotscale_reset_all
2015-12-03 00:17:29 -08:00
bl FreeAllObjectTiles
2015-10-06 05:46:30 -07:00
ldr r1, =0x02021b38
movs r0, 0x40
strb r0, [r1]
ldr r0, =0x02021b3a
movs r4, 0
strh r4, [r0]
movs r0, 0
2015-12-03 00:17:29 -08:00
bl AllocObjectTiles
2015-10-06 05:46:30 -07:00
ldr r0, =0x02021bbc
strh r4, [r0]
ldr r0, =0x02021bbe
strh r4, [r0]
pop {r4}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end ResetAllObjectData
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start CallObjectCallbacks
2016-09-02 19:51:16 -07:00
@ void CallObjectCallbacks()
CallObjectCallbacks: @ 80069C0
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
movs r6, 0
movs r7, 0x1
2016-01-06 20:23:20 -08:00
_080069C6:
2015-10-06 05:46:30 -07:00
lsls r0, r6, 4
adds r0, r6
lsls r0, 2
ldr r1, =0x02020630
adds r4, r0, r1
adds r5, r4, 0
adds r5, 0x3E
ldrb r1, [r5]
adds r0, r7, 0
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _080069F6
2015-10-06 05:46:30 -07:00
ldr r1, [r4, 0x1C]
adds r0, r4, 0
bl _call_via_r1
ldrb r1, [r5]
adds r0, r7, 0
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _080069F6
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
2015-12-03 00:17:29 -08:00
bl AnimateObject
2016-01-06 20:23:20 -08:00
_080069F6:
2015-10-06 05:46:30 -07:00
adds r0, r6, 0x1
lsls r0, 24
lsrs r6, r0, 24
cmp r6, 0x3F
2016-01-06 20:23:20 -08:00
bls _080069C6
2015-10-06 05:46:30 -07:00
pop {r4-r7}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end CallObjectCallbacks
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start PrepareSpritesForOamLoad
2016-09-02 19:51:16 -07:00
@ void PrepareSpritesForOamLoad()
PrepareSpritesForOamLoad: @ 8006A0C
2015-10-06 05:46:30 -07:00
push {r4,r5,lr}
2015-12-03 00:17:29 -08:00
bl UpdateObjectOamCoords
bl BuildObjectPriorityList
bl SortObjectsByPriority
2015-10-06 05:46:30 -07:00
ldr r5, =0x030022c0
ldr r0, =0x00000439
adds r5, r0
ldrb r0, [r5]
lsls r4, r0, 31
lsrs r4, 31
movs r1, 0x1
orrs r0, r1
strb r0, [r5]
2015-12-03 00:17:29 -08:00
bl PopulateSprites
bl CopyTransformationMatricesToSprites
2015-10-06 05:46:30 -07:00
movs r2, 0x1
ldrb r1, [r5]
movs r0, 0x2
negs r0, r0
ands r0, r1
orrs r4, r0
strb r4, [r5]
ldr r0, =0x02021834
strb r2, [r0]
pop {r4,r5}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end PrepareSpritesForOamLoad
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start UpdateObjectOamCoords
2016-09-02 19:51:16 -07:00
@ void UpdateObjectOamCoords()
UpdateObjectOamCoords: @ 8006A58
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
movs r4, 0
ldr r7, =0x02020630
ldr r0, =0x000001ff
adds r5, r0, 0
ldr r6, =0xfffffe00
2016-01-06 20:23:20 -08:00
_08006A64:
2015-10-06 05:46:30 -07:00
lsls r0, r4, 4
adds r0, r4
lsls r0, 2
adds r3, r0, r7
adds r0, r3, 0
adds r0, 0x3E
ldrb r1, [r0]
movs r0, 0x5
ands r0, r1
cmp r0, 0x1
2016-01-06 20:23:20 -08:00
bne _08006B0A
2015-10-06 05:46:30 -07:00
movs r0, 0x2
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08006AD8
2015-10-06 05:46:30 -07:00
movs r2, 0x20
ldrsh r1, [r3, r2]
movs r2, 0x24
ldrsh r0, [r3, r2]
adds r1, r0
adds r0, r3, 0
adds r0, 0x28
ldrb r0, [r0]
lsls r0, 24
asrs r0, 24
adds r1, r0
ldr r0, =0x02021bbc
movs r2, 0
ldrsh r0, [r0, r2]
adds r1, r0
ands r1, r5
ldrh r2, [r3, 0x2]
adds r0, r6, 0
ands r0, r2
orrs r0, r1
strh r0, [r3, 0x2]
ldrh r1, [r3, 0x26]
ldrh r0, [r3, 0x22]
adds r1, r0
adds r0, r3, 0
adds r0, 0x29
ldrb r0, [r0]
ldr r2, =0x02021bbe
adds r0, r1
ldrb r2, [r2]
adds r0, r2
2016-01-06 20:23:20 -08:00
b _08006B08
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_08006AD8:
2015-10-06 05:46:30 -07:00
movs r2, 0x20
ldrsh r1, [r3, r2]
movs r2, 0x24
ldrsh r0, [r3, r2]
adds r1, r0
adds r0, r3, 0
adds r0, 0x28
ldrb r0, [r0]
lsls r0, 24
asrs r0, 24
adds r1, r0
ands r1, r5
ldrh r2, [r3, 0x2]
adds r0, r6, 0
ands r0, r2
orrs r0, r1
strh r0, [r3, 0x2]
ldrh r1, [r3, 0x26]
ldrh r0, [r3, 0x22]
adds r1, r0
adds r0, r3, 0
adds r0, 0x29
ldrb r0, [r0]
adds r0, r1
2016-01-06 20:23:20 -08:00
_08006B08:
2015-10-06 05:46:30 -07:00
strb r0, [r3]
2016-01-06 20:23:20 -08:00
_08006B0A:
2015-10-06 05:46:30 -07:00
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0x3F
2016-01-06 20:23:20 -08:00
bls _08006A64
2015-10-06 05:46:30 -07:00
pop {r4-r7}
pop {r0}
bx r0
2015-12-03 00:17:29 -08:00
thumb_func_end UpdateObjectOamCoords
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start BuildObjectPriorityList
2016-09-02 19:51:16 -07:00
@ void BuildObjectPriorityList()
BuildObjectPriorityList: @ 8006B1C
2015-10-06 05:46:30 -07:00
push {r4,lr}
movs r2, 0
ldr r4, =0x02020630
ldr r3, =0x02021774
2016-01-06 20:23:20 -08:00
_08006B24:
2015-10-06 05:46:30 -07:00
lsls r0, r2, 4
adds r0, r2
lsls r0, 2
adds r0, r4
adds r1, r0, 0
adds r1, 0x43
ldrb r1, [r1]
ldrb r0, [r0, 0x5]
lsls r0, 28
lsrs r0, 30
lsls r0, 8
orrs r1, r0
lsls r0, r2, 1
adds r0, r3
strh r1, [r0]
adds r0, r2, 0x1
lsls r0, 16
lsrs r2, r0, 16
cmp r2, 0x3F
2016-01-06 20:23:20 -08:00
bls _08006B24
2015-10-06 05:46:30 -07:00
pop {r4}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end BuildObjectPriorityList
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start SortObjectsByPriority
2016-09-02 19:51:16 -07:00
@ void SortObjectsByPriority()
SortObjectsByPriority: @ 8006B5C
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x4
movs r0, 0x1
mov r12, r0
ldr r1, =0x020217f4
mov r10, r1
ldr r3, =0xffffff00
mov r9, r3
ldr r6, =0xc0000300
mov r8, r6
2016-01-06 20:23:20 -08:00
_08006B78:
2015-10-06 05:46:30 -07:00
mov r5, r12
mov r0, r12
subs r0, 0x1
add r0, r10
ldrb r2, [r0]
lsls r0, r2, 4
adds r0, r2
lsls r0, 2
ldr r7, =0x02020630
adds r3, r0, r7
mov r0, r12
add r0, r10
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r4, r0, r7
lsls r2, 1
ldr r0, =0x02021774
adds r2, r0
ldrh r2, [r2]
str r2, [sp]
lsls r1, 1
adds r1, r0
ldrh r6, [r1]
ldrb r1, [r3]
ldrb r2, [r4]
adds r0, r1, 0
cmp r0, 0x9F
2016-01-06 20:23:20 -08:00
ble _08006BBA
2015-10-06 05:46:30 -07:00
add r0, r9
lsls r0, 16
lsrs r1, r0, 16
2016-01-06 20:23:20 -08:00
_08006BBA:
2015-10-06 05:46:30 -07:00
lsls r0, r2, 16
asrs r0, 16
cmp r0, 0x9F
2016-01-06 20:23:20 -08:00
ble _08006BC8
2015-10-06 05:46:30 -07:00
add r0, r9
lsls r0, 16
lsrs r2, r0, 16
2016-01-06 20:23:20 -08:00
_08006BC8:
2015-10-06 05:46:30 -07:00
ldr r0, [r3]
mov r7, r8
ands r0, r7
cmp r0, r8
2016-01-06 20:23:20 -08:00
bne _08006BEC
2015-10-06 05:46:30 -07:00
ldrb r0, [r3, 0x1]
lsrs r0, 6
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08006BDE
2015-10-06 05:46:30 -07:00
cmp r0, 0x2
2016-01-06 20:23:20 -08:00
bne _08006BEC
_08006BDE:
2015-10-06 05:46:30 -07:00
lsls r0, r1, 16
asrs r0, 16
cmp r0, 0x80
2016-01-06 20:23:20 -08:00
ble _08006BEC
2015-10-06 05:46:30 -07:00
add r0, r9
lsls r0, 16
lsrs r1, r0, 16
2016-01-06 20:23:20 -08:00
_08006BEC:
2015-10-06 05:46:30 -07:00
ldr r0, [r4]
mov r3, r8
ands r0, r3
cmp r0, r8
2016-01-06 20:23:20 -08:00
bne _08006C10
2015-10-06 05:46:30 -07:00
ldrb r0, [r4, 0x1]
lsrs r0, 6
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08006C02
2015-10-06 05:46:30 -07:00
cmp r0, 0x2
2016-01-06 20:23:20 -08:00
bne _08006C10
_08006C02:
2015-10-06 05:46:30 -07:00
lsls r0, r2, 16
asrs r0, 16
cmp r0, 0x80
2016-01-06 20:23:20 -08:00
ble _08006C10
2015-10-06 05:46:30 -07:00
add r0, r9
lsls r0, 16
lsrs r2, r0, 16
2016-01-06 20:23:20 -08:00
_08006C10:
2015-10-06 05:46:30 -07:00
movs r7, 0x1
add r12, r7
cmp r5, 0
2016-01-06 20:23:20 -08:00
beq _08006CF6
2015-10-06 05:46:30 -07:00
ldr r0, [sp]
cmp r0, r6
2016-01-06 20:23:20 -08:00
bhi _08006C38
2015-10-06 05:46:30 -07:00
cmp r0, r6
2016-01-06 20:23:20 -08:00
bne _08006CF6
b _08006CEE
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_08006C38:
2015-10-06 05:46:30 -07:00
mov r1, r10
adds r3, r5, r1
ldrb r4, [r3]
subs r2, r5, 0x1
adds r1, r2, r1
ldrb r0, [r1]
strb r0, [r3]
strb r4, [r1]
lsls r2, 24
lsrs r5, r2, 24
subs r0, r5, 0x1
add r0, r10
ldrb r2, [r0]
lsls r0, r2, 4
adds r0, r2
lsls r0, 2
ldr r6, =0x02020630
adds r3, r0, r6
mov r7, r10
adds r0, r5, r7
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r4, r0, r6
lsls r2, 1
ldr r0, =0x02021774
adds r2, r0
ldrh r2, [r2]
str r2, [sp]
lsls r1, 1
adds r1, r0
ldrh r6, [r1]
ldrb r1, [r3]
ldrb r2, [r4]
adds r0, r1, 0
cmp r0, 0x9F
2016-01-06 20:23:20 -08:00
ble _08006C8A
2015-10-06 05:46:30 -07:00
add r0, r9
lsls r0, 16
lsrs r1, r0, 16
2016-01-06 20:23:20 -08:00
_08006C8A:
2015-10-06 05:46:30 -07:00
lsls r0, r2, 16
asrs r0, 16
cmp r0, 0x9F
2016-01-06 20:23:20 -08:00
ble _08006C98
2015-10-06 05:46:30 -07:00
add r0, r9
lsls r0, 16
lsrs r2, r0, 16
2016-01-06 20:23:20 -08:00
_08006C98:
2015-10-06 05:46:30 -07:00
ldr r0, [r3]
mov r7, r8
ands r0, r7
cmp r0, r8
2016-01-06 20:23:20 -08:00
bne _08006CBC
2015-10-06 05:46:30 -07:00
ldrb r0, [r3, 0x1]
lsrs r0, 6
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08006CAE
2015-10-06 05:46:30 -07:00
cmp r0, 0x2
2016-01-06 20:23:20 -08:00
bne _08006CBC
_08006CAE:
2015-10-06 05:46:30 -07:00
lsls r0, r1, 16
asrs r0, 16
cmp r0, 0x80
2016-01-06 20:23:20 -08:00
ble _08006CBC
2015-10-06 05:46:30 -07:00
add r0, r9
lsls r0, 16
lsrs r1, r0, 16
2016-01-06 20:23:20 -08:00
_08006CBC:
2015-10-06 05:46:30 -07:00
ldr r0, [r4]
mov r3, r8
ands r0, r3
cmp r0, r8
2016-01-06 20:23:20 -08:00
bne _08006CE0
2015-10-06 05:46:30 -07:00
ldrb r0, [r4, 0x1]
lsrs r0, 6
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08006CD2
2015-10-06 05:46:30 -07:00
cmp r0, 0x2
2016-01-06 20:23:20 -08:00
bne _08006CE0
_08006CD2:
2015-10-06 05:46:30 -07:00
lsls r0, r2, 16
asrs r0, 16
cmp r0, 0x80
2016-01-06 20:23:20 -08:00
ble _08006CE0
2015-10-06 05:46:30 -07:00
add r0, r9
lsls r0, 16
lsrs r2, r0, 16
2016-01-06 20:23:20 -08:00
_08006CE0:
2015-10-06 05:46:30 -07:00
cmp r5, 0
2016-01-06 20:23:20 -08:00
beq _08006CF6
2015-10-06 05:46:30 -07:00
ldr r7, [sp]
cmp r7, r6
2016-01-06 20:23:20 -08:00
bhi _08006C38
2015-10-06 05:46:30 -07:00
cmp r7, r6
2016-01-06 20:23:20 -08:00
bne _08006CF6
_08006CEE:
2015-10-06 05:46:30 -07:00
lsls r1, 16
lsls r0, r2, 16
cmp r1, r0
2016-01-06 20:23:20 -08:00
blt _08006C38
_08006CF6:
2015-10-06 05:46:30 -07:00
mov r1, r12
lsls r0, r1, 24
lsrs r0, 24
mov r12, r0
cmp r0, 0x3F
2016-01-06 20:23:20 -08:00
bhi _08006D04
b _08006B78
_08006D04:
2015-10-06 05:46:30 -07:00
add sp, 0x4
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end SortObjectsByPriority
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start CopyTransformationMatricesToSprites
2016-09-02 19:51:16 -07:00
@ void CopyTransformationMatricesToSprites()
CopyTransformationMatricesToSprites: @ 8006D1C
2015-10-06 05:46:30 -07:00
push {r4-r6,lr}
movs r4, 0
ldr r5, =0x030022c0
ldr r6, =0x02021bc0
2016-01-06 20:23:20 -08:00
_08006D24:
2015-10-06 05:46:30 -07:00
lsls r2, r4, 2
lsls r1, r4, 5
adds r1, r5
lsls r3, r4, 3
adds r3, r6
ldrh r0, [r3]
strh r0, [r1, 0x3E]
adds r0, r2, 0x1
lsls r0, 3
adds r0, r5
ldrh r1, [r3, 0x2]
strh r1, [r0, 0x3E]
adds r0, r2, 0x2
lsls r0, 3
adds r0, r5
ldrh r1, [r3, 0x4]
strh r1, [r0, 0x3E]
adds r2, 0x3
lsls r2, 3
adds r2, r5
ldrh r0, [r3, 0x6]
strh r0, [r2, 0x3E]
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0x1F
2016-01-06 20:23:20 -08:00
bls _08006D24
2015-10-06 05:46:30 -07:00
pop {r4-r6}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end CopyTransformationMatricesToSprites
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start PopulateSprites
2016-09-02 19:51:16 -07:00
@ void PopulateSprites()
PopulateSprites: @ 8006D68
2015-10-06 05:46:30 -07:00
push {r4-r6,lr}
sub sp, 0x4
movs r4, 0
mov r0, sp
strb r4, [r0]
2016-01-06 20:23:20 -08:00
_08006D72:
2015-10-06 05:46:30 -07:00
ldr r0, =0x020217f4
adds r0, r4, r0
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
ldr r1, =0x02020630
adds r2, r0, r1
adds r0, r2, 0
adds r0, 0x3E
ldrb r1, [r0]
movs r0, 0x5
ands r0, r1
cmp r0, 0x1
2016-01-06 20:23:20 -08:00
bne _08006D9E
2015-10-06 05:46:30 -07:00
adds r0, r2, 0
mov r1, sp
2015-12-03 00:17:29 -08:00
bl AddSprite
2015-10-06 05:46:30 -07:00
lsls r0, 24
cmp r0, 0
2016-01-06 20:23:20 -08:00
bne _08006DD8
_08006D9E:
2015-10-06 05:46:30 -07:00
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0x3F
2016-01-06 20:23:20 -08:00
bls _08006D72
2015-10-06 05:46:30 -07:00
mov r0, sp
ldr r4, =0x02021b38
ldrb r0, [r0]
ldrb r1, [r4]
cmp r0, r1
2016-01-06 20:23:20 -08:00
bcs _08006DD8
2015-10-06 05:46:30 -07:00
mov r1, sp
ldr r5, =0x030022f8
2015-11-25 16:43:06 -08:00
ldr r0, =gDefaultOamAttributes
2015-10-06 05:46:30 -07:00
ldr r2, [r0]
ldr r3, [r0, 0x4]
2016-01-06 20:23:20 -08:00
_08006DBE:
2015-10-06 05:46:30 -07:00
ldrb r0, [r1]
lsls r0, 3
adds r0, r5
str r2, [r0]
str r3, [r0, 0x4]
ldrb r0, [r1]
adds r0, 0x1
strb r0, [r1]
lsls r0, 24
lsrs r0, 24
ldrb r6, [r4]
cmp r0, r6
2016-01-06 20:23:20 -08:00
bcc _08006DBE
_08006DD8:
2015-10-06 05:46:30 -07:00
add sp, 0x4
pop {r4-r6}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end PopulateSprites
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start AddObjectToFront
2016-09-02 19:51:16 -07:00
@ u8 AddObjectToFront(struct objtemplate *template, u16 x, u16 y, u8 subpriority)
AddObjectToFront: @ 8006DF4
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
sub sp, 0x4
adds r7, r0, 0
lsls r3, 24
lsrs r4, r3, 24
movs r3, 0
ldr r0, =0x02020630
mov r12, r0
lsls r5, r1, 16
lsls r6, r2, 16
2016-01-06 20:23:20 -08:00
_08006E08:
2015-10-06 05:46:30 -07:00
lsls r0, r3, 4
adds r0, r3
lsls r0, 2
add r0, r12
adds r0, 0x3E
ldrb r0, [r0]
lsls r0, 31
cmp r0, 0
2016-01-06 20:23:20 -08:00
bne _08006E34
2015-10-06 05:46:30 -07:00
str r4, [sp]
adds r0, r3, 0
adds r1, r7, 0
asrs r2, r5, 16
asrs r3, r6, 16
2015-12-03 00:17:29 -08:00
bl AddObject
2015-10-06 05:46:30 -07:00
lsls r0, 24
lsrs r0, 24
2016-01-06 20:23:20 -08:00
b _08006E40
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_08006E34:
2015-10-06 05:46:30 -07:00
adds r0, r3, 0x1
lsls r0, 24
lsrs r3, r0, 24
cmp r3, 0x3F
2016-01-06 20:23:20 -08:00
bls _08006E08
2015-10-06 05:46:30 -07:00
movs r0, 0x40
2016-01-06 20:23:20 -08:00
_08006E40:
2015-10-06 05:46:30 -07:00
add sp, 0x4
pop {r4-r7}
pop {r1}
bx r1
2015-12-03 00:17:29 -08:00
thumb_func_end AddObjectToFront
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start AddObjectToBack
2016-09-02 19:51:16 -07:00
@ u8 AddObjectToBack(struct objtemplate *template, u16 x, u16 y, u8 subpriority)
AddObjectToBack: @ 8006E48
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
mov r7, r8
push {r7}
sub sp, 0x4
adds r7, r0, 0
lsls r3, 24
lsrs r6, r3, 24
movs r3, 0x3F
ldr r0, =0x02020630
mov r8, r0
movs r0, 0x1
negs r0, r0
mov r12, r0
lsls r4, r1, 16
lsls r5, r2, 16
2016-01-06 20:23:20 -08:00
_08006E66:
2015-10-06 05:46:30 -07:00
lsls r0, r3, 16
asrs r1, r0, 16
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
add r0, r8
adds r0, 0x3E
ldrb r0, [r0]
lsls r0, 31
cmp r0, 0
2016-01-06 20:23:20 -08:00
bne _08006E98
2015-10-06 05:46:30 -07:00
lsls r0, r3, 24
lsrs r0, 24
str r6, [sp]
adds r1, r7, 0
asrs r2, r4, 16
asrs r3, r5, 16
2015-12-03 00:17:29 -08:00
bl AddObject
2015-10-06 05:46:30 -07:00
lsls r0, 24
lsrs r0, 24
2016-01-06 20:23:20 -08:00
b _08006EA6
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_08006E98:
2015-10-06 05:46:30 -07:00
subs r0, r1, 0x1
lsls r0, 16
lsrs r3, r0, 16
asrs r0, 16
cmp r0, r12
2016-01-06 20:23:20 -08:00
bgt _08006E66
2015-10-06 05:46:30 -07:00
movs r0, 0x40
2016-01-06 20:23:20 -08:00
_08006EA6:
2015-10-06 05:46:30 -07:00
add sp, 0x4
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r1}
bx r1
2015-12-03 00:17:29 -08:00
thumb_func_end AddObjectToBack
2015-10-06 05:46:30 -07:00
thumb_func_start obj_add_empty_with_callback
2016-09-02 19:51:16 -07:00
@ int obj_add_empty_with_callback(void ( *func)())
obj_add_empty_with_callback: @ 8006EB4
2015-10-06 05:46:30 -07:00
push {r4-r6,lr}
adds r6, r0, 0
2015-10-10 05:20:38 -07:00
ldr r0, =gUnknown_082EC6AC
2015-10-06 05:46:30 -07:00
movs r1, 0
movs r2, 0
movs r3, 0x1F
2015-12-03 00:17:29 -08:00
bl AddObjectToFront
2015-10-06 05:46:30 -07:00
lsls r0, 24
lsrs r5, r0, 24
cmp r5, 0x40
2016-01-06 20:23:20 -08:00
beq _08006EF4
2015-10-06 05:46:30 -07:00
ldr r4, =0x02020630
lsls r1, r5, 4
adds r1, r5
lsls r1, 2
adds r2, r1, r4
adds r2, 0x3E
ldrb r0, [r2]
movs r3, 0x4
orrs r0, r3
strb r0, [r2]
adds r4, 0x1C
adds r1, r4
str r6, [r1]
adds r0, r5, 0
2016-01-06 20:23:20 -08:00
b _08006EF6
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_08006EF4:
2015-10-06 05:46:30 -07:00
movs r0, 0x40
2016-01-06 20:23:20 -08:00
_08006EF6:
2015-10-06 05:46:30 -07:00
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end obj_add_empty_with_callback
2015-12-03 00:17:29 -08:00
thumb_func_start AddObject
2016-09-02 19:51:16 -07:00
@ u8 AddObject(u8 index, struct objtemplate *template, u16 x, u16 y, u8 subpriority)
AddObject: @ 8006EFC
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
mov r8, r1
adds r5, r2, 0
adds r6, r3, 0
ldr r4, [sp, 0x20]
lsls r0, 24
lsrs r0, 24
mov r10, r0
lsls r5, 16
lsrs r5, 16
lsls r6, 16
lsrs r6, 16
lsls r4, 24
lsrs r4, 24
lsls r0, 4
add r0, r10
lsls r0, 2
ldr r1, =0x02020630
adds r7, r0, r1
adds r0, r7, 0
2015-12-03 00:17:29 -08:00
bl RemoveObject
2015-10-06 05:46:30 -07:00
adds r2, r7, 0
adds r2, 0x3E
ldrb r0, [r2]
movs r1, 0x1
orrs r0, r1
strb r0, [r2]
movs r0, 0x3F
adds r0, r7
mov r9, r0
ldrb r0, [r0]
movs r1, 0x4
orrs r0, r1
movs r1, 0x8
orrs r0, r1
movs r1, 0x40
orrs r0, r1
mov r1, r9
strb r0, [r1]
adds r0, r7, 0
adds r0, 0x43
strb r4, [r0]
mov r1, r8
ldr r0, [r1, 0x4]
ldr r1, [r0, 0x4]
ldr r0, [r0]
str r0, [r7]
str r1, [r7, 0x4]
mov r1, r8
ldr r0, [r1, 0x8]
str r0, [r7, 0x8]
ldr r0, [r1, 0x10]
str r0, [r7, 0x10]
str r1, [r7, 0x14]
ldr r0, [r1, 0x14]
str r0, [r7, 0x1C]
strh r5, [r7, 0x20]
strh r6, [r7, 0x22]
ldrb r3, [r7, 0x1]
lsrs r1, r3, 6
ldrb r2, [r7, 0x3]
lsrs r2, 6
lsls r3, 30
lsrs r3, 30
adds r0, r7, 0
2015-12-03 00:17:29 -08:00
bl CalcVecFromObjectCenterToObjectUpperLeft
2015-10-06 05:46:30 -07:00
mov r0, r8
ldrh r1, [r0]
ldr r4, =0xffff0000
lsrs r0, r4, 16
cmp r1, r0
2016-01-06 20:23:20 -08:00
bne _08006FF8
2015-10-06 05:46:30 -07:00
mov r1, r8
ldr r0, [r1, 0xC]
str r0, [r7, 0xC]
ldrh r0, [r0, 0x4]
lsrs r0, 5
lsls r0, 24
lsrs r0, 24
2015-12-03 00:17:29 -08:00
bl AllocObjectTiles
2015-10-06 05:46:30 -07:00
lsls r0, 16
lsrs r2, r0, 16
asrs r0, 16
asrs r1, r4, 16
cmp r0, r1
2016-01-06 20:23:20 -08:00
bne _08006FC8
2015-10-06 05:46:30 -07:00
adds r0, r7, 0
2015-12-03 00:17:29 -08:00
bl RemoveObject
2015-10-06 05:46:30 -07:00
movs r0, 0x40
2016-01-06 20:23:20 -08:00
b _08007040
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_08006FC8:
2015-10-06 05:46:30 -07:00
ldr r1, =0x000003ff
adds r0, r1, 0
ands r2, r0
ldrh r1, [r7, 0x4]
ldr r0, =0xfffffc00
ands r0, r1
orrs r0, r2
strh r0, [r7, 0x4]
mov r0, r9
ldrb r1, [r0]
movs r0, 0x41
negs r0, r0
ands r0, r1
mov r1, r9
strb r0, [r1]
adds r1, r7, 0
adds r1, 0x40
movs r0, 0
strh r0, [r1]
2016-01-06 20:23:20 -08:00
b _0800700C
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_08006FF8:
2015-10-06 05:46:30 -07:00
mov r1, r8
ldrh r0, [r1]
2015-12-03 00:17:29 -08:00
bl GetObjectTileRangeStartByTag
2015-10-06 05:46:30 -07:00
adds r1, r7, 0
adds r1, 0x40
strh r0, [r1]
adds r0, r7, 0
bl sub_8008324
2016-01-06 20:23:20 -08:00
_0800700C:
2015-10-06 05:46:30 -07:00
ldrb r0, [r7, 0x1]
lsls r0, 30
lsrs r0, 30
movs r1, 0x1
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08007020
2015-10-06 05:46:30 -07:00
adds r0, r7, 0
bl obj_alloc_rotscale_entry
2016-01-06 20:23:20 -08:00
_08007020:
2015-10-06 05:46:30 -07:00
mov r0, r8
ldrh r1, [r0, 0x2]
ldr r0, =0x0000ffff
cmp r1, r0
2016-01-06 20:23:20 -08:00
beq _0800703E
2015-10-06 05:46:30 -07:00
mov r1, r8
ldrh r0, [r1, 0x2]
2015-12-03 00:17:29 -08:00
bl IndexOfObjectPaletteTag
2015-10-06 05:46:30 -07:00
lsls r0, 4
ldrb r2, [r7, 0x5]
movs r1, 0xF
ands r1, r2
orrs r1, r0
strb r1, [r7, 0x5]
2016-01-06 20:23:20 -08:00
_0800703E:
2015-10-06 05:46:30 -07:00
mov r0, r10
2016-01-06 20:23:20 -08:00
_08007040:
2015-10-06 05:46:30 -07:00
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r1}
bx r1
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end AddObject
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start AddObjectAndAnimateForOneFrame
2016-09-02 19:51:16 -07:00
@ u8 AddObjectAndAnimateForOneFrame(struct objtemplate *template, u16 x, u16 y, u8 subpriority)
AddObjectAndAnimateForOneFrame: @ 8007054
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x4
mov r10, r0
lsls r3, 24
lsrs r3, 24
mov r9, r3
movs r3, 0
ldr r5, =0x02020630
lsls r1, 16
mov r12, r1
lsls r2, 16
mov r8, r2
2016-01-06 20:23:20 -08:00
_08007074:
2015-10-06 05:46:30 -07:00
lsls r0, r3, 4
adds r0, r3
lsls r6, r0, 2
adds r4, r6, r5
adds r7, r4, 0
adds r7, 0x3E
ldrb r0, [r7]
lsls r0, 31
cmp r0, 0
2016-01-06 20:23:20 -08:00
bne _080070CC
2015-10-06 05:46:30 -07:00
mov r0, r9
str r0, [sp]
adds r0, r3, 0
mov r1, r10
mov r3, r12
asrs r2, r3, 16
mov r5, r8
asrs r3, r5, 16
2015-12-03 00:17:29 -08:00
bl AddObject
2015-10-06 05:46:30 -07:00
lsls r0, 24
lsrs r0, 24
adds r5, r0, 0
cmp r5, 0x40
2016-01-06 20:23:20 -08:00
beq _080070D6
2015-10-06 05:46:30 -07:00
ldr r1, =0x0202064c
adds r0, r6, r1
ldr r1, [r0]
adds r0, r4, 0
bl _call_via_r1
ldrb r0, [r7]
lsls r0, 31
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _080070C0
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
2015-12-03 00:17:29 -08:00
bl AnimateObject
2016-01-06 20:23:20 -08:00
_080070C0:
2015-10-06 05:46:30 -07:00
adds r0, r5, 0
2016-01-06 20:23:20 -08:00
b _080070D8
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_080070CC:
2015-10-06 05:46:30 -07:00
adds r0, r3, 0x1
lsls r0, 24
lsrs r3, r0, 24
cmp r3, 0x3F
2016-01-06 20:23:20 -08:00
bls _08007074
_080070D6:
2015-10-06 05:46:30 -07:00
movs r0, 0x40
2016-01-06 20:23:20 -08:00
_080070D8:
2015-10-06 05:46:30 -07:00
add sp, 0x4
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r1}
bx r1
2015-12-03 00:17:29 -08:00
thumb_func_end AddObjectAndAnimateForOneFrame
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start RemoveObjectAndFreeTiles
2016-09-02 19:51:16 -07:00
@ void RemoveObjectAndFreeTiles(struct obj *object)
RemoveObjectAndFreeTiles: @ 80070E8
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
adds r5, r0, 0
adds r0, 0x3E
ldrb r1, [r0]
movs r0, 0x1
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08007144
2015-10-06 05:46:30 -07:00
adds r0, r5, 0
adds r0, 0x3F
ldrb r1, [r0]
movs r0, 0x40
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
bne _0800713E
2015-10-06 05:46:30 -07:00
ldr r0, [r5, 0xC]
ldrh r2, [r0, 0x4]
lsrs r2, 5
ldrh r0, [r5, 0x4]
lsls r0, 22
lsrs r1, r0, 22
adds r4, r1, r2
adds r3, r1, 0
cmp r3, r4
2016-01-06 20:23:20 -08:00
bcs _0800713E
2015-10-06 05:46:30 -07:00
ldr r0, =0x02021b3c
mov r12, r0
movs r6, 0x7
movs r7, 0x1
2016-01-06 20:23:20 -08:00
_08007122:
2015-10-06 05:46:30 -07:00
lsrs r2, r3, 3
add r2, r12
adds r0, r3, 0
ands r0, r6
adds r1, r7, 0
lsls r1, r0
ldrb r0, [r2]
bics r0, r1
strb r0, [r2]
adds r0, r3, 0x1
lsls r0, 16
lsrs r3, r0, 16
cmp r3, r4
2016-01-06 20:23:20 -08:00
bcc _08007122
_0800713E:
2015-10-06 05:46:30 -07:00
adds r0, r5, 0
2015-12-03 00:17:29 -08:00
bl RemoveObject
2016-01-06 20:23:20 -08:00
_08007144:
2015-10-06 05:46:30 -07:00
pop {r4-r7}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end RemoveObjectAndFreeTiles
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start ResetSpriteRange
2016-09-02 19:51:16 -07:00
@ void ResetSpriteRange(u8 startIndex, u8 endIndex)
ResetSpriteRange: @ 8007150
2015-10-06 05:46:30 -07:00
push {r4-r6,lr}
lsls r0, 24
lsls r1, 24
lsrs r4, r1, 24
lsrs r3, r0, 24
cmp r3, r4
2016-01-06 20:23:20 -08:00
bcs _08007178
2015-10-06 05:46:30 -07:00
ldr r6, =0x030022f8
2015-11-25 16:43:06 -08:00
ldr r5, =gDefaultOamAttributes
2016-01-06 20:23:20 -08:00
_08007162:
2015-10-06 05:46:30 -07:00
lsls r0, r3, 3
adds r0, r6
ldr r1, [r5]
ldr r2, [r5, 0x4]
str r1, [r0]
str r2, [r0, 0x4]
adds r0, r3, 0x1
lsls r0, 24
lsrs r3, r0, 24
cmp r3, r4
2016-01-06 20:23:20 -08:00
bcc _08007162
_08007178:
2015-10-06 05:46:30 -07:00
pop {r4-r6}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end ResetSpriteRange
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start LoadOamFromSprites
2016-09-02 19:51:16 -07:00
@ void LoadOamFromSprites()
LoadOamFromSprites: @ 8007188
2015-10-06 05:46:30 -07:00
push {lr}
ldr r2, =0x030022c0
ldr r1, =0x00000439
adds r0, r2, r1
ldrb r1, [r0]
movs r0, 0x1
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
bne _080071A8
2015-10-06 05:46:30 -07:00
adds r0, r2, 0
adds r0, 0x38
movs r1, 0xE0
lsls r1, 19
ldr r2, =0x04000100
bl CpuSet
2016-01-06 20:23:20 -08:00
_080071A8:
2015-10-06 05:46:30 -07:00
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end LoadOamFromSprites
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start ClearObjectCopyRequests
2016-09-02 19:51:16 -07:00
@ void ClearObjectCopyRequests()
ClearObjectCopyRequests: @ 80071B8
2015-10-06 05:46:30 -07:00
push {r4,r5,lr}
ldr r0, =0x02021834
movs r1, 0
strb r1, [r0]
ldr r0, =0x02021835
strb r1, [r0]
movs r2, 0
ldr r4, =0x02021838
movs r3, 0
adds r5, r4, 0x4
2016-01-06 20:23:20 -08:00
_080071CC:
2015-10-06 05:46:30 -07:00
lsls r0, r2, 1
adds r0, r2
lsls r0, 2
adds r1, r0, r4
str r3, [r1]
adds r0, r5
str r3, [r0]
strh r3, [r1, 0x8]
adds r0, r2, 0x1
lsls r0, 24
lsrs r2, r0, 24
cmp r2, 0x3F
2016-01-06 20:23:20 -08:00
bls _080071CC
2015-10-06 05:46:30 -07:00
pop {r4,r5}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end ClearObjectCopyRequests
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start ResetSpriteTransformationMatrices
2016-09-02 19:51:16 -07:00
@ void ResetSpriteTransformationMatrices()
ResetSpriteTransformationMatrices: @ 80071F8
2015-10-06 05:46:30 -07:00
push {r4,lr}
movs r1, 0
ldr r4, =0x02021bc0
movs r3, 0
movs r2, 0x80
lsls r2, 1
2016-01-06 20:23:20 -08:00
_08007204:
2015-10-06 05:46:30 -07:00
lsls r0, r1, 3
adds r0, r4
strh r2, [r0]
strh r3, [r0, 0x2]
strh r3, [r0, 0x4]
strh r2, [r0, 0x6]
adds r0, r1, 0x1
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0x1F
2016-01-06 20:23:20 -08:00
bls _08007204
2015-10-06 05:46:30 -07:00
pop {r4}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end ResetSpriteTransformationMatrices
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start SetSpriteTransformationMatrix
2016-09-02 19:51:16 -07:00
@ void SetSpriteTransformationMatrix(u8 index, u16 a, u16 b, u16 c, u16 d)
SetSpriteTransformationMatrix: @ 8007224
2015-10-06 05:46:30 -07:00
push {r4,r5,lr}
ldr r5, [sp, 0xC]
lsls r0, 24
ldr r4, =0x02021bc0
lsrs r0, 21
adds r0, r4
strh r1, [r0]
strh r2, [r0, 0x2]
strh r3, [r0, 0x4]
strh r5, [r0, 0x6]
pop {r4,r5}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end SetSpriteTransformationMatrix
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start RemoveObject
2016-09-02 19:51:16 -07:00
@ void RemoveObject(struct obj *object)
RemoveObject: @ 8007244
2015-10-06 05:46:30 -07:00
push {lr}
2015-10-10 05:20:38 -07:00
ldr r1, =gUnknown_082EC64C
2015-10-06 05:46:30 -07:00
movs r2, 0x44
bl memcpy
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end RemoveObject
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start CalcVecFromObjectCenterToObjectUpperLeft
2016-09-02 19:51:16 -07:00
@ void CalcVecFromObjectCenterToObjectUpperLeft(struct obj *object, u8 shape, u8 size, u8 affineMode)
CalcVecFromObjectCenterToObjectUpperLeft: @ 8007258
2015-10-06 05:46:30 -07:00
push {r4-r6,lr}
adds r6, r0, 0
lsls r1, 24
lsls r2, 24
lsls r3, 24
lsrs r3, 24
2015-10-10 05:20:38 -07:00
ldr r4, =gUnknown_082EC634
2015-10-06 05:46:30 -07:00
lsrs r2, 23
lsrs r1, 21
adds r2, r1
adds r0, r2, r4
ldrb r5, [r0]
adds r4, 0x1
adds r2, r4
ldrb r1, [r2]
movs r0, 0x2
ands r3, r0
cmp r3, 0
2016-01-06 20:23:20 -08:00
beq _08007286
2015-10-06 05:46:30 -07:00
lsls r0, r5, 25
lsrs r5, r0, 24
lsls r0, r1, 25
lsrs r1, r0, 24
2016-01-06 20:23:20 -08:00
_08007286:
2015-10-06 05:46:30 -07:00
adds r0, r6, 0
adds r0, 0x28
strb r5, [r0]
adds r0, 0x1
strb r1, [r0]
pop {r4-r6}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end CalcVecFromObjectCenterToObjectUpperLeft
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start AllocObjectTiles
2016-09-02 19:51:16 -07:00
@ s16 AllocObjectTiles(u16 numTiles)
AllocObjectTiles: @ 800729C
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
mov r7, r9
mov r6, r8
push {r6,r7}
lsls r0, 16
lsrs r4, r0, 16
cmp r4, 0
2016-01-06 20:23:20 -08:00
bne _080072F2
2015-10-06 05:46:30 -07:00
ldr r0, =0x02021b3a
ldrh r3, [r0]
ldr r0, =0x000003ff
cmp r3, r0
2016-01-06 20:23:20 -08:00
bhi _080072DA
2015-10-06 05:46:30 -07:00
ldr r7, =0x02021b3c
movs r6, 0x7
adds r4, r0, 0
movs r5, 0x1
2016-01-06 20:23:20 -08:00
_080072BE:
2015-10-06 05:46:30 -07:00
lsrs r2, r3, 3
adds r2, r7
adds r0, r3, 0
ands r0, r6
adds r1, r5, 0
lsls r1, r0
ldrb r0, [r2]
bics r0, r1
strb r0, [r2]
adds r0, r3, 0x1
lsls r0, 16
lsrs r3, r0, 16
cmp r3, r4
2016-01-06 20:23:20 -08:00
bls _080072BE
_080072DA:
2015-10-06 05:46:30 -07:00
movs r0, 0
2016-01-06 20:23:20 -08:00
b _080073A4
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_080072EC:
2015-10-06 05:46:30 -07:00
movs r0, 0x1
negs r0, r0
2016-01-06 20:23:20 -08:00
b _080073A4
_080072F2:
2015-10-06 05:46:30 -07:00
ldr r0, =0x02021b3a
ldrh r3, [r0]
ldr r0, =0x02021b3c
mov r9, r0
movs r7, 0x7
movs r6, 0x1
2016-01-06 20:23:20 -08:00
_080072FE:
2015-10-06 05:46:30 -07:00
lsrs r0, r3, 3
add r0, r9
ldrb r1, [r0]
adds r0, r3, 0
ands r0, r7
asrs r1, r0
ands r1, r6
cmp r1, 0
2016-01-06 20:23:20 -08:00
beq _08007332
2015-10-06 05:46:30 -07:00
movs r5, 0x80
lsls r5, 3
ldr r2, =0x02021b3c
2016-01-06 20:23:20 -08:00
_08007316:
2015-10-06 05:46:30 -07:00
adds r0, r3, 0x1
lsls r0, 16
lsrs r3, r0, 16
cmp r3, r5
2016-01-06 20:23:20 -08:00
beq _080072EC
2015-10-06 05:46:30 -07:00
lsrs r0, 19
adds r0, r2
ldrb r1, [r0]
adds r0, r3, 0
ands r0, r7
asrs r1, r0
ands r1, r6
cmp r1, 0
2016-01-06 20:23:20 -08:00
bne _08007316
_08007332:
2015-10-06 05:46:30 -07:00
mov r8, r3
movs r2, 0x1
cmp r2, r4
2016-01-06 20:23:20 -08:00
beq _0800736C
2015-10-06 05:46:30 -07:00
movs r1, 0x80
lsls r1, 3
mov r12, r1
ldr r5, =0x02021b3c
2016-01-06 20:23:20 -08:00
_08007342:
2015-10-06 05:46:30 -07:00
adds r0, r3, 0x1
lsls r0, 16
lsrs r3, r0, 16
cmp r3, r12
2016-01-06 20:23:20 -08:00
beq _080072EC
2015-10-06 05:46:30 -07:00
lsrs r0, 19
adds r0, r5
ldrb r1, [r0]
adds r0, r3, 0
ands r0, r7
asrs r1, r0
ands r1, r6
cmp r1, 0
2016-01-06 20:23:20 -08:00
bne _08007368
2015-10-06 05:46:30 -07:00
adds r0, r2, 0x1
lsls r0, 16
lsrs r2, r0, 16
cmp r2, r4
2016-01-06 20:23:20 -08:00
bne _08007342
_08007368:
2015-10-06 05:46:30 -07:00
cmp r2, r4
2016-01-06 20:23:20 -08:00
bne _080072FE
_0800736C:
2015-10-06 05:46:30 -07:00
mov r1, r8
lsls r0, r1, 16
lsrs r3, r0, 16
asrs r1, r0, 16
adds r1, r4, r1
adds r6, r0, 0
cmp r3, r1
2016-01-06 20:23:20 -08:00
bge _080073A2
2015-10-06 05:46:30 -07:00
ldr r0, =0x02021b3c
mov r8, r0
movs r7, 0x7
adds r4, r1, 0
movs r5, 0x1
2016-01-06 20:23:20 -08:00
_08007386:
2015-10-06 05:46:30 -07:00
lsrs r2, r3, 3
add r2, r8
adds r1, r3, 0
ands r1, r7
adds r0, r5, 0
lsls r0, r1
ldrb r1, [r2]
orrs r0, r1
strb r0, [r2]
adds r0, r3, 0x1
lsls r0, 16
lsrs r3, r0, 16
cmp r3, r4
2016-01-06 20:23:20 -08:00
blt _08007386
_080073A2:
2015-10-06 05:46:30 -07:00
asrs r0, r6, 16
2016-01-06 20:23:20 -08:00
_080073A4:
2015-10-06 05:46:30 -07:00
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r1}
bx r1
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end AllocObjectTiles
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start Unused_ObjectTileAllocationBitArrayOp
2016-09-02 19:51:16 -07:00
@ unsigned int Unused_ObjectTileAllocationBitArrayOp(u16 tileNum, u8 op)
Unused_ObjectTileAllocationBitArrayOp: @ 80073B8
2015-10-06 05:46:30 -07:00
push {r4-r6,lr}
lsls r0, 16
lsrs r2, r0, 16
lsls r1, 24
lsrs r1, 24
lsrs r0, 19
lsls r0, 24
lsrs r3, r0, 24
adds r6, r3, 0
movs r0, 0x7
ands r2, r0
adds r4, r2, 0
movs r5, 0
cmp r1, 0
2016-01-06 20:23:20 -08:00
bne _080073F0
2015-10-06 05:46:30 -07:00
movs r0, 0x1
lsls r0, r2
mvns r0, r0
lsls r0, 24
lsrs r2, r0, 24
ldr r0, =0x02021b3c
adds r0, r3, r0
ldrb r1, [r0]
ands r2, r1
strb r2, [r0]
2016-01-06 20:23:20 -08:00
b _0800741C
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_080073F0:
2015-10-06 05:46:30 -07:00
cmp r1, 0x1
2016-01-06 20:23:20 -08:00
bne _0800740C
2015-10-06 05:46:30 -07:00
lsls r1, r2
lsls r0, r1, 24
lsrs r2, r0, 24
ldr r0, =0x02021b3c
adds r0, r3, r0
ldrb r1, [r0]
orrs r2, r1
strb r2, [r0]
2016-01-06 20:23:20 -08:00
b _0800741C
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_0800740C:
2015-10-06 05:46:30 -07:00
movs r0, 0x80
lsls r0, 17
lsls r0, r4
lsrs r5, r0, 24
ldr r0, =0x02021b3c
adds r0, r6, r0
ldrb r0, [r0]
ands r5, r0
2016-01-06 20:23:20 -08:00
_0800741C:
2015-10-06 05:46:30 -07:00
adds r0, r5, 0
pop {r4-r6}
pop {r1}
bx r1
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end Unused_ObjectTileAllocationBitArrayOp
2015-10-06 05:46:30 -07:00
2015-11-28 21:21:42 -08:00
thumb_func_start DummyObjectCallback
2016-09-02 19:51:16 -07:00
@ void DummyObjectCallback(struct obj *object)
DummyObjectCallback: @ 8007428
2015-10-06 05:46:30 -07:00
bx lr
2015-11-28 21:21:42 -08:00
thumb_func_end DummyObjectCallback
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start ProcessObjectCopyRequests
2016-09-02 19:51:16 -07:00
@ void ProcessObjectCopyRequests()
ProcessObjectCopyRequests: @ 800742C
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
ldr r0, =0x02021834
ldrb r0, [r0]
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08007474
2015-10-06 05:46:30 -07:00
movs r4, 0
ldr r1, =0x02021835
ldrb r0, [r1]
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _0800746E
2015-10-06 05:46:30 -07:00
ldr r6, =0x02021838
adds r7, r6, 0x4
adds r5, r1, 0
2016-01-06 20:23:20 -08:00
_08007446:
2015-10-06 05:46:30 -07:00
lsls r1, r4, 1
adds r1, r4
lsls r1, 2
adds r2, r1, r6
ldr r0, [r2]
adds r1, r7
ldr r1, [r1]
ldrh r2, [r2, 0x8]
lsrs r2, 1
bl CpuSet
ldrb r1, [r5]
subs r1, 0x1
strb r1, [r5]
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
lsls r1, 24
cmp r1, 0
2016-01-06 20:23:20 -08:00
bne _08007446
_0800746E:
2015-10-06 05:46:30 -07:00
ldr r1, =0x02021834
movs r0, 0
strb r0, [r1]
2016-01-06 20:23:20 -08:00
_08007474:
2015-10-06 05:46:30 -07:00
pop {r4-r7}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end ProcessObjectCopyRequests
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start AddPicToObjectCopyRequests
2016-09-02 19:51:16 -07:00
@ void AddPicToObjectCopyRequests(u16 picIndex, u16 targetTileNum, struct obj_tiles *pics)
AddPicToObjectCopyRequests: @ 8007488
2015-10-06 05:46:30 -07:00
push {r4-r6,lr}
adds r5, r2, 0
lsls r0, 16
lsrs r2, r0, 16
lsls r1, 16
lsrs r6, r1, 16
ldr r4, =0x02021835
ldrb r0, [r4]
cmp r0, 0x3F
2016-01-06 20:23:20 -08:00
bhi _080074D8
2015-10-06 05:46:30 -07:00
ldr r3, =0x02021838
adds r1, r0, 0
lsls r0, r1, 1
adds r0, r1
lsls r0, 2
adds r0, r3
lsls r2, 3
adds r2, r5
ldr r1, [r2]
str r1, [r0]
ldrb r0, [r4]
lsls r1, r0, 1
adds r1, r0
lsls r1, 2
adds r0, r3, 0x4
adds r1, r0
lsls r0, r6, 5
ldr r5, =0x06010000
adds r0, r5
str r0, [r1]
ldrb r1, [r4]
lsls r0, r1, 1
adds r0, r1
lsls r0, 2
adds r0, r3
ldrh r1, [r2, 0x4]
strh r1, [r0, 0x8]
ldrb r0, [r4]
adds r0, 0x1
strb r0, [r4]
2016-01-06 20:23:20 -08:00
_080074D8:
2015-10-06 05:46:30 -07:00
pop {r4-r6}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end AddPicToObjectCopyRequests
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start AddTilesToObjectCopyRequests
2016-09-02 19:51:16 -07:00
@ void AddTilesToObjectCopyRequests(void *src, void *dest, u16 size)
AddTilesToObjectCopyRequests: @ 80074EC
2015-10-06 05:46:30 -07:00
push {r4-r6,lr}
adds r4, r0, 0
adds r5, r1, 0
lsls r2, 16
lsrs r6, r2, 16
ldr r3, =0x02021835
ldrb r0, [r3]
cmp r0, 0x3F
2016-01-06 20:23:20 -08:00
bhi _0800752C
2015-10-06 05:46:30 -07:00
ldr r2, =0x02021838
adds r1, r0, 0
lsls r0, r1, 1
adds r0, r1
lsls r0, 2
adds r0, r2
str r4, [r0]
ldrb r1, [r3]
lsls r0, r1, 1
adds r0, r1
lsls r0, 2
adds r1, r2, 0x4
adds r0, r1
str r5, [r0]
ldrb r1, [r3]
lsls r0, r1, 1
adds r0, r1
lsls r0, 2
adds r0, r2
strh r6, [r0, 0x8]
ldrb r0, [r3]
adds r0, 0x1
strb r0, [r3]
2016-01-06 20:23:20 -08:00
_0800752C:
2015-10-06 05:46:30 -07:00
pop {r4-r6}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end AddTilesToObjectCopyRequests
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start Unused_CopyFromObjects
2016-09-02 19:51:16 -07:00
@ void Unused_CopyFromObjects(void *dest)
Unused_CopyFromObjects: @ 800753C
2015-10-06 05:46:30 -07:00
push {r4,lr}
adds r1, r0, 0
ldr r3, =0x02020630
movs r2, 0
ldr r4, =0x000010ff
2016-01-06 20:23:20 -08:00
_08007546:
2015-10-06 05:46:30 -07:00
ldrb r0, [r3]
strb r0, [r1]
adds r1, 0x1
adds r3, 0x1
adds r2, 0x1
cmp r2, r4
2016-01-06 20:23:20 -08:00
bls _08007546
2015-10-06 05:46:30 -07:00
pop {r4}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end Unused_CopyFromObjects
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start Unused_CopyToObjects
2016-09-02 19:51:16 -07:00
@ void Unused_CopyToObjects(void *src)
Unused_CopyToObjects: @ 8007564
2015-10-06 05:46:30 -07:00
push {r4,lr}
adds r1, r0, 0
ldr r3, =0x02020630
movs r2, 0
ldr r4, =0x000010ff
2016-01-06 20:23:20 -08:00
_0800756E:
2015-10-06 05:46:30 -07:00
ldrb r0, [r1]
strb r0, [r3]
adds r1, 0x1
adds r3, 0x1
adds r2, 0x1
cmp r2, r4
2016-01-06 20:23:20 -08:00
bls _0800756E
2015-10-06 05:46:30 -07:00
pop {r4}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end Unused_CopyToObjects
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start RemoveAllObjects
2016-09-02 19:51:16 -07:00
@ void RemoveAllObjects()
RemoveAllObjects: @ 800758C
2015-10-06 05:46:30 -07:00
push {r4,r5,lr}
movs r4, 0
2016-01-06 20:23:20 -08:00
_08007590:
2015-10-06 05:46:30 -07:00
lsls r0, r4, 4
adds r0, r4
lsls r0, 2
ldr r5, =0x02020630
adds r0, r5
2015-12-03 00:17:29 -08:00
bl RemoveObject
2015-10-06 05:46:30 -07:00
ldr r0, =0x020217f4
adds r0, r4, r0
strb r4, [r0]
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0x3F
2016-01-06 20:23:20 -08:00
bls _08007590
2015-10-06 05:46:30 -07:00
lsls r0, r4, 4
adds r0, r4
lsls r0, 2
adds r0, r5
2015-12-03 00:17:29 -08:00
bl RemoveObject
2015-10-06 05:46:30 -07:00
pop {r4,r5}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end RemoveAllObjects
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start FreeObjectTiles
2016-09-02 19:51:16 -07:00
@ void FreeObjectTiles(struct obj *object)
FreeObjectTiles: @ 80075C8
2015-10-06 05:46:30 -07:00
push {lr}
ldr r2, [r0, 0x14]
ldrh r1, [r2]
ldr r0, =0x0000ffff
cmp r1, r0
2016-01-06 20:23:20 -08:00
beq _080075DA
2015-10-06 05:46:30 -07:00
adds r0, r1, 0
2015-12-03 00:17:29 -08:00
bl FreeObjectTilesByTag
2016-01-06 20:23:20 -08:00
_080075DA:
2015-10-06 05:46:30 -07:00
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end FreeObjectTiles
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start FreeObjectPalette
2016-09-02 19:51:16 -07:00
@ void FreeObjectPalette(struct obj *object)
FreeObjectPalette: @ 80075E4
2015-10-06 05:46:30 -07:00
push {lr}
ldr r0, [r0, 0x14]
ldrh r0, [r0, 0x2]
2015-12-03 00:17:29 -08:00
bl FreeObjectPaletteByTag
2015-10-06 05:46:30 -07:00
pop {r0}
bx r0
2015-12-03 00:17:29 -08:00
thumb_func_end FreeObjectPalette
2015-10-06 05:46:30 -07:00
thumb_func_start obj_free_rotscale_entry
2016-09-02 19:51:16 -07:00
@ void obj_free_rotscale_entry(struct obj *obj)
obj_free_rotscale_entry: @ 80075F4
2015-10-06 05:46:30 -07:00
push {r4,lr}
adds r4, r0, 0
ldrb r0, [r4, 0x1]
lsls r0, 30
lsrs r0, 30
movs r1, 0x1
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _0800761A
2015-10-06 05:46:30 -07:00
ldrb r0, [r4, 0x3]
lsls r0, 26
lsrs r0, 27
bl rotscale_free_entry
ldrb r1, [r4, 0x1]
movs r0, 0x4
negs r0, r0
ands r0, r1
strb r0, [r4, 0x1]
2016-01-06 20:23:20 -08:00
_0800761A:
2015-10-06 05:46:30 -07:00
pop {r4}
pop {r0}
bx r0
thumb_func_end obj_free_rotscale_entry
2015-12-03 00:17:29 -08:00
thumb_func_start RemoveObjectAndFreeResources
2016-09-02 19:51:16 -07:00
@ void RemoveObjectAndFreeResources(struct obj *object)
RemoveObjectAndFreeResources: @ 8007620
2015-10-06 05:46:30 -07:00
push {r4,lr}
adds r4, r0, 0
2015-12-03 00:17:29 -08:00
bl FreeObjectTiles
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
2015-12-03 00:17:29 -08:00
bl FreeObjectPalette
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
bl obj_free_rotscale_entry
adds r0, r4, 0
2015-12-03 00:17:29 -08:00
bl RemoveObjectAndFreeTiles
2015-10-06 05:46:30 -07:00
pop {r4}
pop {r0}
bx r0
2015-12-03 00:17:29 -08:00
thumb_func_end RemoveObjectAndFreeResources
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start AnimateObject
2016-09-02 19:51:16 -07:00
@ void AnimateObject(struct obj *object)
AnimateObject: @ 8007640
2015-10-06 05:46:30 -07:00
push {r4,r5,lr}
adds r4, r0, 0
2015-10-10 05:20:38 -07:00
ldr r2, =gUnknown_082EC6C4
2015-10-06 05:46:30 -07:00
adds r5, r4, 0
adds r5, 0x3F
ldrb r1, [r5]
movs r0, 0x4
ands r0, r1
adds r0, r2
ldr r1, [r0]
adds r0, r4, 0
bl _call_via_r1
ldr r0, =0x02021cc0
ldrb r0, [r0]
cmp r0, 0
2016-01-06 20:23:20 -08:00
bne _08007676
2015-10-10 05:20:38 -07:00
ldr r0, =gUnknown_082EC6CC
2015-10-06 05:46:30 -07:00
ldrb r1, [r5]
lsls r1, 28
lsrs r1, 31
lsls r1, 2
adds r1, r0
ldr r1, [r1]
adds r0, r4, 0
bl _call_via_r1
2016-01-06 20:23:20 -08:00
_08007676:
2015-10-06 05:46:30 -07:00
pop {r4,r5}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end AnimateObject
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start BeginObjectImageAnim
2016-09-02 19:51:16 -07:00
@ void BeginObjectImageAnim(struct obj *object)
BeginObjectImageAnim: @ 8007688
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
mov r7, r9
mov r6, r8
push {r6,r7}
adds r4, r0, 0
adds r3, r4, 0
adds r3, 0x2B
movs r2, 0
strb r2, [r3]
adds r5, r4, 0
adds r5, 0x3F
ldrb r1, [r5]
movs r0, 0x11
negs r0, r0
ands r0, r1
strb r0, [r5]
adds r0, r4, 0
adds r0, 0x2D
strb r2, [r0]
adds r2, r4, 0
adds r2, 0x2A
ldrb r1, [r2]
ldr r0, [r4, 0x8]
lsls r1, 2
adds r1, r0
ldrb r0, [r3]
ldr r1, [r1]
lsls r0, 2
adds r0, r1
ldrh r0, [r0]
mov r9, r0
lsls r0, 16
mov r8, r0
asrs r1, r0, 16
movs r0, 0x1
negs r0, r0
cmp r1, r0
2016-01-06 20:23:20 -08:00
beq _0800776C
2015-10-06 05:46:30 -07:00
ldrb r1, [r5]
subs r0, 0x4
ands r0, r1
strb r0, [r5]
ldrb r1, [r2]
ldr r0, [r4, 0x8]
lsls r1, 2
adds r1, r0
ldrb r0, [r3]
ldr r1, [r1]
lsls r0, 2
adds r0, r1
ldr r0, [r0]
lsls r1, r0, 10
lsrs r3, r1, 26
lsls r1, r0, 9
lsrs r7, r1, 31
lsls r0, 8
lsrs r6, r0, 31
cmp r3, 0
2016-01-06 20:23:20 -08:00
beq _08007704
2015-10-06 05:46:30 -07:00
subs r0, r3, 0x1
lsls r0, 24
lsrs r3, r0, 24
2016-01-06 20:23:20 -08:00
_08007704:
2015-10-06 05:46:30 -07:00
adds r2, r4, 0
adds r2, 0x2C
movs r0, 0x3F
ands r3, r0
ldrb r1, [r2]
subs r0, 0x7F
ands r0, r1
orrs r0, r3
strb r0, [r2]
ldrb r0, [r4, 0x1]
lsls r0, 30
lsrs r0, 30
movs r1, 0x1
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
bne _0800772E
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
adds r1, r7, 0
adds r2, r6, 0
bl obj_set_horizonal_and_vertical_flip
2016-01-06 20:23:20 -08:00
_0800772E:
2015-10-06 05:46:30 -07:00
ldrb r1, [r5]
movs r0, 0x40
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _0800775C
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
adds r0, 0x40
ldrh r1, [r0]
add r1, r9
ldr r2, =0x000003ff
adds r0, r2, 0
ands r1, r0
ldrh r2, [r4, 0x4]
ldr r0, =0xfffffc00
ands r0, r2
orrs r0, r1
strh r0, [r4, 0x4]
2016-01-06 20:23:20 -08:00
b _0800776C
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_0800775C:
2015-10-06 05:46:30 -07:00
mov r1, r8
lsrs r0, r1, 16
ldrh r1, [r4, 0x4]
lsls r1, 22
lsrs r1, 22
ldr r2, [r4, 0xC]
2015-12-03 00:17:29 -08:00
bl AddPicToObjectCopyRequests
2016-01-06 20:23:20 -08:00
_0800776C:
2015-10-06 05:46:30 -07:00
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r0}
bx r0
2015-12-03 00:17:29 -08:00
thumb_func_end BeginObjectImageAnim
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start ContinueObjectImageAnim
2016-09-02 19:51:16 -07:00
@ void ContinueObjectImageAnim(struct obj *object)
ContinueObjectImageAnim: @ 8007778
2015-10-06 05:46:30 -07:00
push {r4,lr}
adds r4, r0, 0
adds r0, 0x2C
ldrb r1, [r0]
movs r0, 0x3F
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _080077C8
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
bl obj_anim_image_delay_progress
adds r0, r4, 0
adds r0, 0x2A
ldrb r1, [r0]
ldr r0, [r4, 0x8]
lsls r1, 2
adds r1, r0
adds r0, r4, 0
adds r0, 0x2B
ldrb r0, [r0]
ldr r1, [r1]
lsls r0, 2
adds r0, r1
ldr r0, [r0]
lsls r1, r0, 9
lsrs r3, r1, 31
lsls r0, 8
lsrs r2, r0, 31
ldrb r0, [r4, 0x1]
lsls r0, 30
lsrs r0, 30
movs r1, 0x1
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
bne _0800780E
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
adds r1, r3, 0
bl obj_set_horizonal_and_vertical_flip
2016-01-06 20:23:20 -08:00
b _0800780E
_080077C8:
2015-10-06 05:46:30 -07:00
movs r0, 0x40
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
bne _0800780E
2015-10-06 05:46:30 -07:00
adds r2, r4, 0
adds r2, 0x2B
ldrb r0, [r2]
adds r0, 0x1
strb r0, [r2]
adds r0, r4, 0
adds r0, 0x2A
ldrb r0, [r0]
ldr r1, [r4, 0x8]
lsls r0, 2
adds r0, r1
ldrb r1, [r2]
ldr r0, [r0]
lsls r1, 2
adds r1, r0
movs r2, 0x3
movs r3, 0
ldrsh r0, [r1, r3]
cmp r0, 0
2016-01-06 20:23:20 -08:00
bge _080077FE
2015-10-06 05:46:30 -07:00
adds r0, 0x3
lsls r0, 16
lsrs r2, r0, 16
2016-01-06 20:23:20 -08:00
_080077FE:
2015-10-10 05:20:38 -07:00
ldr r0, =gUnknown_082EC6D4
2015-10-06 05:46:30 -07:00
lsls r1, r2, 16
asrs r1, 14
adds r1, r0
ldr r1, [r1]
adds r0, r4, 0
bl _call_via_r1
2016-01-06 20:23:20 -08:00
_0800780E:
2015-10-06 05:46:30 -07:00
pop {r4}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end ContinueObjectImageAnim
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start ImageAnimCmd_frame
2016-09-02 19:51:16 -07:00
@ void ImageAnimCmd_frame(struct obj *object)
ImageAnimCmd_frame: @ 8007818
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
mov r7, r8
push {r7}
adds r4, r0, 0
adds r0, 0x2A
ldrb r1, [r0]
ldr r0, [r4, 0x8]
lsls r1, 2
adds r1, r0
adds r0, r4, 0
adds r0, 0x2B
ldrb r0, [r0]
ldr r1, [r1]
lsls r0, 2
adds r0, r1
ldrh r7, [r0]
mov r8, r7
ldr r0, [r0]
lsls r1, r0, 10
lsrs r3, r1, 26
lsls r1, r0, 9
lsrs r6, r1, 31
lsls r0, 8
lsrs r5, r0, 31
cmp r3, 0
2016-01-06 20:23:20 -08:00
beq _08007852
2015-10-06 05:46:30 -07:00
subs r0, r3, 0x1
lsls r0, 24
lsrs r3, r0, 24
2016-01-06 20:23:20 -08:00
_08007852:
2015-10-06 05:46:30 -07:00
adds r2, r4, 0
adds r2, 0x2C
movs r0, 0x3F
ands r3, r0
ldrb r1, [r2]
subs r0, 0x7F
ands r0, r1
orrs r0, r3
strb r0, [r2]
ldrb r0, [r4, 0x1]
lsls r0, 30
lsrs r0, 30
movs r1, 0x1
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
bne _0800787C
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
adds r1, r6, 0
adds r2, r5, 0
bl obj_set_horizonal_and_vertical_flip
2016-01-06 20:23:20 -08:00
_0800787C:
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
adds r0, 0x3F
ldrb r1, [r0]
movs r0, 0x40
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _080078AC
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
adds r0, 0x40
ldrh r1, [r0]
adds r1, r7
ldr r2, =0x000003ff
adds r0, r2, 0
ands r1, r0
ldrh r2, [r4, 0x4]
ldr r0, =0xfffffc00
ands r0, r2
orrs r0, r1
strh r0, [r4, 0x4]
2016-01-06 20:23:20 -08:00
b _080078BA
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_080078AC:
2015-10-06 05:46:30 -07:00
mov r0, r8
ldrh r1, [r4, 0x4]
lsls r1, 22
lsrs r1, 22
ldr r2, [r4, 0xC]
2015-12-03 00:17:29 -08:00
bl AddPicToObjectCopyRequests
2016-01-06 20:23:20 -08:00
_080078BA:
2015-10-06 05:46:30 -07:00
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
2015-12-03 00:17:29 -08:00
thumb_func_end ImageAnimCmd_frame
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start ImageAnimCmd_end
2016-09-02 19:51:16 -07:00
@ void ImageAnimCmd_end(struct obj *object)
ImageAnimCmd_end: @ 80078C4
2015-10-06 05:46:30 -07:00
adds r2, r0, 0
adds r2, 0x2B
ldrb r1, [r2]
subs r1, 0x1
strb r1, [r2]
adds r0, 0x3F
ldrb r1, [r0]
movs r2, 0x10
orrs r1, r2
strb r1, [r0]
bx lr
2015-12-03 00:17:29 -08:00
thumb_func_end ImageAnimCmd_end
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start ImageAnimCmd_jump
2016-09-02 19:51:16 -07:00
@ void ImageAnimCmd_jump(struct obj *object)
ImageAnimCmd_jump: @ 80078DC
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
mov r7, r8
push {r7}
adds r4, r0, 0
adds r3, r4, 0
adds r3, 0x2A
ldrb r1, [r3]
ldr r0, [r4, 0x8]
lsls r1, 2
adds r1, r0
adds r2, r4, 0
adds r2, 0x2B
ldrb r0, [r2]
ldr r1, [r1]
lsls r0, 2
adds r0, r1
ldr r0, [r0]
lsls r0, 10
lsrs r0, 26
strb r0, [r2]
ldrb r0, [r3]
ldr r1, [r4, 0x8]
lsls r0, 2
adds r0, r1
ldrb r1, [r2]
ldr r0, [r0]
lsls r1, 2
adds r1, r0
ldrh r7, [r1]
mov r8, r7
ldr r0, [r1]
lsls r1, r0, 10
lsrs r3, r1, 26
lsls r1, r0, 9
lsrs r6, r1, 31
lsls r0, 8
lsrs r5, r0, 31
cmp r3, 0
2016-01-06 20:23:20 -08:00
beq _08007930
2015-10-06 05:46:30 -07:00
subs r0, r3, 0x1
lsls r0, 24
lsrs r3, r0, 24
2016-01-06 20:23:20 -08:00
_08007930:
2015-10-06 05:46:30 -07:00
adds r2, r4, 0
adds r2, 0x2C
movs r0, 0x3F
ands r3, r0
ldrb r1, [r2]
subs r0, 0x7F
ands r0, r1
orrs r0, r3
strb r0, [r2]
ldrb r0, [r4, 0x1]
lsls r0, 30
lsrs r0, 30
movs r1, 0x1
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
bne _0800795A
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
adds r1, r6, 0
adds r2, r5, 0
bl obj_set_horizonal_and_vertical_flip
2016-01-06 20:23:20 -08:00
_0800795A:
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
adds r0, 0x3F
ldrb r1, [r0]
movs r0, 0x40
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _0800798C
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
adds r0, 0x40
ldrh r1, [r0]
adds r1, r7
ldr r2, =0x000003ff
adds r0, r2, 0
ands r1, r0
ldrh r2, [r4, 0x4]
ldr r0, =0xfffffc00
ands r0, r2
orrs r0, r1
strh r0, [r4, 0x4]
2016-01-06 20:23:20 -08:00
b _0800799A
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_0800798C:
2015-10-06 05:46:30 -07:00
mov r0, r8
ldrh r1, [r4, 0x4]
lsls r1, 22
lsrs r1, 22
ldr r2, [r4, 0xC]
2015-12-03 00:17:29 -08:00
bl AddPicToObjectCopyRequests
2016-01-06 20:23:20 -08:00
_0800799A:
2015-10-06 05:46:30 -07:00
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
2015-12-03 00:17:29 -08:00
thumb_func_end ImageAnimCmd_jump
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start ImageAnimCmd_loop
2016-09-02 19:51:16 -07:00
@ void ImageAnimCmd_loop(struct obj *object)
ImageAnimCmd_loop: @ 80079A4
2015-10-06 05:46:30 -07:00
push {lr}
adds r1, r0, 0
adds r0, 0x2D
ldrb r0, [r0]
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _080079B8
2015-10-06 05:46:30 -07:00
adds r0, r1, 0
2015-12-03 00:17:29 -08:00
bl ContinueImageAnimLoop
2016-01-06 20:23:20 -08:00
b _080079BE
_080079B8:
2015-10-06 05:46:30 -07:00
adds r0, r1, 0
2015-12-03 00:17:29 -08:00
bl BeginImageAnimLoop
2016-01-06 20:23:20 -08:00
_080079BE:
2015-10-06 05:46:30 -07:00
pop {r0}
bx r0
2015-12-03 00:17:29 -08:00
thumb_func_end ImageAnimCmd_loop
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start BeginImageAnimLoop
2016-09-02 19:51:16 -07:00
@ void BeginImageAnimLoop(struct obj *object)
BeginImageAnimLoop: @ 80079C4
2015-10-06 05:46:30 -07:00
push {r4,lr}
adds r4, r0, 0
adds r0, 0x2A
ldrb r1, [r0]
ldr r0, [r4, 0x8]
lsls r1, 2
adds r1, r0
adds r0, r4, 0
adds r0, 0x2B
ldrb r0, [r0]
ldr r1, [r1]
lsls r0, 2
adds r0, r1
ldr r0, [r0]
lsls r0, 10
lsrs r0, 26
adds r1, r4, 0
adds r1, 0x2D
strb r0, [r1]
adds r0, r4, 0
2015-12-03 00:17:29 -08:00
bl JumpToTopOfImageAnimLoop
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
2015-12-03 00:17:29 -08:00
bl ContinueObjectImageAnim
2015-10-06 05:46:30 -07:00
pop {r4}
pop {r0}
bx r0
2015-12-03 00:17:29 -08:00
thumb_func_end BeginImageAnimLoop
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start ContinueImageAnimLoop
2016-09-02 19:51:16 -07:00
@ void ContinueImageAnimLoop(struct obj *object)
ContinueImageAnimLoop: @ 80079FC
2015-10-06 05:46:30 -07:00
push {r4,lr}
adds r4, r0, 0
adds r1, r4, 0
adds r1, 0x2D
ldrb r0, [r1]
subs r0, 0x1
strb r0, [r1]
adds r0, r4, 0
2015-12-03 00:17:29 -08:00
bl JumpToTopOfImageAnimLoop
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
2015-12-03 00:17:29 -08:00
bl ContinueObjectImageAnim
2015-10-06 05:46:30 -07:00
pop {r4}
pop {r0}
bx r0
2015-12-03 00:17:29 -08:00
thumb_func_end ContinueImageAnimLoop
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start JumpToTopOfImageAnimLoop
2016-09-02 19:51:16 -07:00
@ void JumpToTopOfImageAnimLoop(struct obj *object)
JumpToTopOfImageAnimLoop: @ 8007A1C
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
mov r12, r0
adds r0, 0x2D
ldrb r0, [r0]
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08007A88
2015-10-06 05:46:30 -07:00
mov r3, r12
adds r3, 0x2B
ldrb r0, [r3]
subs r0, 0x1
strb r0, [r3]
mov r5, r12
adds r5, 0x2A
ldrb r1, [r5]
mov r2, r12
ldr r0, [r2, 0x8]
lsls r1, 2
adds r1, r0
ldrb r0, [r3]
ldr r1, [r1]
lsls r0, 2
adds r0, r1
subs r0, 0x4
movs r7, 0
ldrsh r0, [r0, r7]
movs r1, 0x3
negs r1, r1
adds r4, r3, 0
cmp r0, r1
2016-01-06 20:23:20 -08:00
beq _08007A82
2015-10-06 05:46:30 -07:00
adds r6, r1, 0
adds r2, r4, 0
2016-01-06 20:23:20 -08:00
_08007A5C:
2015-10-06 05:46:30 -07:00
ldrb r0, [r2]
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08007A82
2015-10-06 05:46:30 -07:00
subs r0, 0x1
strb r0, [r3]
ldrb r1, [r5]
mov r7, r12
ldr r0, [r7, 0x8]
lsls r1, 2
adds r1, r0
ldrb r0, [r2]
ldr r1, [r1]
lsls r0, 2
adds r0, r1
subs r0, 0x4
movs r1, 0
ldrsh r0, [r0, r1]
cmp r0, r6
2016-01-06 20:23:20 -08:00
bne _08007A5C
_08007A82:
2015-10-06 05:46:30 -07:00
ldrb r0, [r4]
subs r0, 0x1
strb r0, [r4]
2016-01-06 20:23:20 -08:00
_08007A88:
2015-10-06 05:46:30 -07:00
pop {r4-r7}
pop {r0}
bx r0
2015-12-03 00:17:29 -08:00
thumb_func_end JumpToTopOfImageAnimLoop
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start BeginObjectRotScalAnim
2016-09-02 19:51:16 -07:00
@ void BeginObjectRotScalAnim(struct obj *object)
BeginObjectRotScalAnim: @ 8007A90
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
sub sp, 0x8
adds r6, r0, 0
ldrb r0, [r6, 0x1]
lsls r0, 30
lsrs r0, 30
movs r1, 0x1
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08007B12
2015-10-06 05:46:30 -07:00
ldr r0, [r6, 0x10]
ldr r0, [r0]
movs r2, 0
ldrsh r1, [r0, r2]
ldr r0, =0x00007fff
cmp r1, r0
2016-01-06 20:23:20 -08:00
beq _08007B12
2015-10-06 05:46:30 -07:00
adds r0, r6, 0
bl obj_get_rotscale_entry_index
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
adds r0, r4, 0
bl rotscale_reset_half
mov r5, sp
adds r0, r4, 0
adds r1, r6, 0
mov r2, sp
bl rotscale_load_frame
adds r7, r6, 0
adds r7, 0x3F
ldrb r1, [r7]
movs r0, 0x9
negs r0, r0
ands r0, r1
movs r1, 0x21
negs r1, r1
ands r0, r1
strb r0, [r7]
adds r0, r4, 0
mov r1, sp
bl sub_8008168
ldr r1, =0x03000b70
lsls r0, r4, 1
adds r0, r4
lsls r0, 2
adds r0, r1
ldrb r1, [r5, 0x5]
strb r1, [r0, 0x2]
ldrb r1, [r7]
movs r0, 0x80
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08007B12
2015-10-06 05:46:30 -07:00
movs r0, 0x3A
ldrsh r1, [r6, r0]
movs r0, 0x3C
ldrsh r2, [r6, r0]
adds r0, r6, 0
bl obj_update_pos2
2016-01-06 20:23:20 -08:00
_08007B12:
2015-10-06 05:46:30 -07:00
add sp, 0x8
pop {r4-r7}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end BeginObjectRotScalAnim
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start ContinueObjectRotScalAnim
2016-09-02 19:51:16 -07:00
@ void ContinueObjectRotScalAnim(struct obj *object)
ContinueObjectRotScalAnim: @ 8007B24
2015-10-06 05:46:30 -07:00
push {r4,r5,lr}
adds r4, r0, 0
ldrb r0, [r4, 0x1]
lsls r0, 30
lsrs r0, 30
movs r1, 0x1
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08007BC6
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
bl obj_get_rotscale_entry_index
lsls r0, 24
lsrs r2, r0, 24
adds r5, r2, 0
ldr r1, =0x03000b70
lsls r0, r2, 1
adds r0, r2
lsls r0, 2
adds r3, r0, r1
ldrb r0, [r3, 0x2]
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08007B60
2015-10-06 05:46:30 -07:00
adds r0, r2, 0
adds r1, r4, 0
bl sub_8007BD8
2016-01-06 20:23:20 -08:00
b _08007BAA
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_08007B60:
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
adds r0, 0x2C
ldrb r1, [r0]
movs r0, 0x80
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
bne _08007BC6
2015-10-06 05:46:30 -07:00
ldrb r0, [r3, 0x1]
adds r0, 0x1
strb r0, [r3, 0x1]
ldrb r0, [r3]
ldr r1, [r4, 0x10]
lsls r0, 2
adds r0, r1
ldrb r1, [r3, 0x1]
ldr r0, [r0]
lsls r1, 3
adds r1, r0
movs r2, 0x3
movs r0, 0
ldrsh r1, [r1, r0]
ldr r0, =0x00007ffc
cmp r1, r0
2016-01-06 20:23:20 -08:00
ble _08007B98
2015-10-06 05:46:30 -07:00
ldr r2, =0xffff8003
adds r0, r1, r2
lsls r0, 16
lsrs r2, r0, 16
2016-01-06 20:23:20 -08:00
_08007B98:
2015-10-10 05:20:38 -07:00
ldr r0, =gUnknown_082EC6E4
2015-10-06 05:46:30 -07:00
lsls r1, r2, 16
asrs r1, 14
adds r1, r0
ldr r2, [r1]
adds r0, r5, 0
adds r1, r4, 0
bl _call_via_r2
2016-01-06 20:23:20 -08:00
_08007BAA:
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
adds r0, 0x3F
ldrb r1, [r0]
movs r0, 0x80
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08007BC6
2015-10-06 05:46:30 -07:00
movs r0, 0x3A
ldrsh r1, [r4, r0]
movs r0, 0x3C
ldrsh r2, [r4, r0]
adds r0, r4, 0
bl obj_update_pos2
2016-01-06 20:23:20 -08:00
_08007BC6:
2015-10-06 05:46:30 -07:00
pop {r4,r5}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end ContinueObjectRotScalAnim
2015-10-06 05:46:30 -07:00
thumb_func_start sub_8007BD8
2016-09-02 19:51:16 -07:00
@ void sub_8007BD8(u8 index, struct obj *object)
sub_8007BD8: @ 8007BD8
2015-10-06 05:46:30 -07:00
push {r4,r5,lr}
sub sp, 0x8
adds r5, r1, 0
lsls r0, 24
lsrs r4, r0, 24
adds r0, r5, 0
adds r1, r4, 0
bl obj_anim_rotscale_delay_progress
lsls r0, 24
cmp r0, 0
2016-01-06 20:23:20 -08:00
bne _08007C02
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
adds r1, r5, 0
mov r2, sp
bl rotscale_load_frame
adds r0, r4, 0
mov r1, sp
bl rotscale_frame_apply_relative_and_sync
2016-01-06 20:23:20 -08:00
_08007C02:
2015-10-06 05:46:30 -07:00
add sp, 0x8
pop {r4,r5}
pop {r0}
bx r0
thumb_func_end sub_8007BD8
2015-12-03 00:17:29 -08:00
thumb_func_start RotScalAnimCmd_loop
2016-09-02 19:51:16 -07:00
@ void RotScalAnimCmd_loop(u8 index, struct obj *object)
RotScalAnimCmd_loop: @ 8007C0C
2015-10-06 05:46:30 -07:00
push {lr}
adds r3, r1, 0
lsls r0, 24
lsrs r2, r0, 24
ldr r1, =0x03000b70
lsls r0, r2, 1
adds r0, r2
lsls r0, 2
adds r0, r1
ldrb r0, [r0, 0x3]
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08007C34
2015-10-06 05:46:30 -07:00
adds r0, r2, 0
adds r1, r3, 0
2015-12-03 00:17:29 -08:00
bl ContinueRotScalAnimLoop
2016-01-06 20:23:20 -08:00
b _08007C3C
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_08007C34:
2015-10-06 05:46:30 -07:00
adds r0, r2, 0
adds r1, r3, 0
2015-12-03 00:17:29 -08:00
bl BeginRotScalAnimLoop
2016-01-06 20:23:20 -08:00
_08007C3C:
2015-10-06 05:46:30 -07:00
pop {r0}
bx r0
2015-12-03 00:17:29 -08:00
thumb_func_end RotScalAnimCmd_loop
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start BeginRotScalAnimLoop
2016-09-02 19:51:16 -07:00
@ void BeginRotScalAnimLoop(u8 index, struct obj *object)
BeginRotScalAnimLoop: @ 8007C40
2015-10-06 05:46:30 -07:00
push {r4,lr}
adds r4, r1, 0
lsls r0, 24
lsrs r0, 24
ldr r1, =0x03000b70
lsls r3, r0, 1
adds r3, r0
lsls r3, 2
adds r3, r1
ldrb r2, [r3]
ldr r1, [r4, 0x10]
lsls r2, 2
adds r2, r1
ldrb r1, [r3, 0x1]
ldr r2, [r2]
lsls r1, 3
adds r1, r2
ldrh r1, [r1, 0x2]
strb r1, [r3, 0x3]
adds r1, r4, 0
2015-12-03 00:17:29 -08:00
bl JumpToTopOfRotScalAnimLoop
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
2015-12-03 00:17:29 -08:00
bl ContinueObjectRotScalAnim
2015-10-06 05:46:30 -07:00
pop {r4}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end BeginRotScalAnimLoop
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start ContinueRotScalAnimLoop
2016-09-02 19:51:16 -07:00
@ void ContinueRotScalAnimLoop(u8 index, struct obj *object)
ContinueRotScalAnimLoop: @ 8007C7C
2015-10-06 05:46:30 -07:00
push {r4,lr}
adds r4, r1, 0
lsls r0, 24
lsrs r0, 24
ldr r2, =0x03000b70
lsls r1, r0, 1
adds r1, r0
lsls r1, 2
adds r1, r2
ldrb r2, [r1, 0x3]
subs r2, 0x1
strb r2, [r1, 0x3]
adds r1, r4, 0
2015-12-03 00:17:29 -08:00
bl JumpToTopOfRotScalAnimLoop
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
2015-12-03 00:17:29 -08:00
bl ContinueObjectRotScalAnim
2015-10-06 05:46:30 -07:00
pop {r4}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end ContinueRotScalAnimLoop
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start JumpToTopOfRotScalAnimLoop
2016-09-02 19:51:16 -07:00
@ void JumpToTopOfRotScalAnimLoop(u8 index, struct obj *object)
JumpToTopOfRotScalAnimLoop: @ 8007CAC
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
mov r12, r1
lsls r0, 24
lsrs r5, r0, 24
ldr r1, =0x03000b70
lsls r3, r5, 1
adds r0, r3, r5
lsls r0, 2
adds r2, r0, r1
ldrb r0, [r2, 0x3]
adds r6, r1, 0
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08007D0C
2015-10-06 05:46:30 -07:00
ldrb r0, [r2, 0x1]
subs r0, 0x1
strb r0, [r2, 0x1]
adds r4, r3, 0
2016-01-06 20:23:20 -08:00
b _08007CDC
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_08007CD4:
2015-10-06 05:46:30 -07:00
cmp r2, 0
2016-01-06 20:23:20 -08:00
beq _08007D00
2015-10-06 05:46:30 -07:00
subs r0, r2, 0x1
strb r0, [r3, 0x1]
2016-01-06 20:23:20 -08:00
_08007CDC:
2015-10-06 05:46:30 -07:00
adds r0, r4, r5
lsls r0, 2
adds r3, r0, r6
ldrb r0, [r3]
mov r2, r12
ldr r1, [r2, 0x10]
lsls r0, 2
adds r0, r1
ldrb r2, [r3, 0x1]
ldr r1, [r0]
lsls r0, r2, 3
adds r0, r1
subs r0, 0x8
movs r7, 0
ldrsh r1, [r0, r7]
ldr r0, =0x00007ffd
cmp r1, r0
2016-01-06 20:23:20 -08:00
bne _08007CD4
_08007D00:
2015-10-06 05:46:30 -07:00
adds r1, r4, r5
lsls r1, 2
adds r1, r6
ldrb r0, [r1, 0x1]
subs r0, 0x1
strb r0, [r1, 0x1]
2016-01-06 20:23:20 -08:00
_08007D0C:
2015-10-06 05:46:30 -07:00
pop {r4-r7}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end JumpToTopOfRotScalAnimLoop
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start RotScalAnimCmd_jump
2016-09-02 19:51:16 -07:00
@ void RotScalAnimCmd_jump(u8 index, struct obj *object)
RotScalAnimCmd_jump: @ 8007D18
2015-10-06 05:46:30 -07:00
push {r4-r6,lr}
sub sp, 0x8
adds r5, r0, 0
lsls r5, 24
lsrs r5, 24
ldr r0, =0x03000b70
lsls r4, r5, 1
adds r4, r5
lsls r4, 2
adds r4, r0
ldrb r2, [r4]
ldr r0, [r1, 0x10]
lsls r2, 2
adds r2, r0
ldrb r0, [r4, 0x1]
ldr r2, [r2]
lsls r0, 3
adds r0, r2
ldrh r0, [r0, 0x2]
strb r0, [r4, 0x1]
mov r6, sp
adds r0, r5, 0
mov r2, sp
bl rotscale_load_frame
adds r0, r5, 0
mov r1, sp
bl sub_8008168
ldrb r0, [r6, 0x5]
strb r0, [r4, 0x2]
add sp, 0x8
pop {r4-r6}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end RotScalAnimCmd_jump
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start RotScalAnimCmd_end
2016-09-02 19:51:16 -07:00
@ void RotScalAnimCmd_end(u8 index, struct obj *object)
RotScalAnimCmd_end: @ 8007D64
2015-10-06 05:46:30 -07:00
push {lr}
sub sp, 0x8
lsls r0, 24
lsrs r0, 24
movs r2, 0
movs r3, 0
str r2, [sp]
str r3, [sp, 0x4]
adds r1, 0x3F
ldrb r2, [r1]
movs r3, 0x20
orrs r2, r3
strb r2, [r1]
ldr r2, =0x03000b70
lsls r1, r0, 1
adds r1, r0
lsls r1, 2
adds r1, r2
ldrb r2, [r1, 0x1]
subs r2, 0x1
strb r2, [r1, 0x1]
mov r1, sp
bl rotscale_frame_apply_relative_and_sync
add sp, 0x8
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end RotScalAnimCmd_end
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start RotScalAnimCmd_frame
2016-09-02 19:51:16 -07:00
@ void RotScalAnimCmd_frame(u8 index, struct obj *object)
RotScalAnimCmd_frame: @ 8007DA0
2015-10-06 05:46:30 -07:00
push {r4,r5,lr}
sub sp, 0x8
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
mov r5, sp
adds r0, r4, 0
mov r2, sp
bl rotscale_load_frame
adds r0, r4, 0
mov r1, sp
bl sub_8008168
ldr r1, =0x03000b70
lsls r0, r4, 1
adds r0, r4
lsls r0, 2
adds r0, r1
ldrb r1, [r5, 0x5]
strb r1, [r0, 0x2]
add sp, 0x8
pop {r4,r5}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end RotScalAnimCmd_frame
2015-10-06 05:46:30 -07:00
thumb_func_start rotscale_set_indirect
2016-09-02 19:51:16 -07:00
@ void rotscale_set_indirect(u8 rotscale_entry_index, s16 rotscale_data[])
rotscale_set_indirect: @ 8007DD8
2015-10-06 05:46:30 -07:00
lsls r0, 24
ldr r2, =0x02021bc0
lsrs r0, 21
adds r0, r2
ldrh r2, [r1]
strh r2, [r0]
ldrh r2, [r1, 0x2]
strh r2, [r0, 0x2]
ldrh r2, [r1, 0x4]
strh r2, [r0, 0x4]
ldrh r1, [r1, 0x6]
strh r1, [r0, 0x6]
bx lr
.pool
thumb_func_end rotscale_set_indirect
thumb_func_start obj_get_rotscale_entry_index
2016-09-02 19:51:16 -07:00
@ int obj_get_rotscale_entry_index(struct obj *obj)
obj_get_rotscale_entry_index: @ 8007DF8
2015-10-06 05:46:30 -07:00
push {lr}
adds r2, r0, 0
movs r3, 0
ldrb r0, [r2, 0x1]
lsls r0, 30
lsrs r0, 30
movs r1, 0x1
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08007E12
2015-10-06 05:46:30 -07:00
ldrb r0, [r2, 0x3]
lsls r0, 26
lsrs r3, r0, 27
2016-01-06 20:23:20 -08:00
_08007E12:
2015-10-06 05:46:30 -07:00
adds r0, r3, 0
pop {r1}
bx r1
thumb_func_end obj_get_rotscale_entry_index
thumb_func_start sub_8007E18
2016-09-02 19:51:16 -07:00
@ void sub_8007E18(struct obj *obj, s16 a2, s16 a3)
sub_8007E18: @ 8007E18
2015-10-06 05:46:30 -07:00
strh r1, [r0, 0x3A]
strh r2, [r0, 0x3C]
adds r0, 0x3F
ldrb r1, [r0]
movs r2, 0x80
orrs r1, r2
strb r1, [r0]
bx lr
thumb_func_end sub_8007E18
thumb_func_start sub_8007E28
2016-09-02 19:51:16 -07:00
@ int sub_8007E28(int a1, int a2, int a3)
sub_8007E28: @ 8007E28
2015-10-06 05:46:30 -07:00
push {r4,r5,lr}
adds r3, r0, 0
adds r5, r2, 0
subs r0, r1, r3
cmp r0, 0
2016-01-06 20:23:20 -08:00
bge _08007E3A
2015-10-06 05:46:30 -07:00
negs r0, r0
asrs r4, r0, 9
2016-01-06 20:23:20 -08:00
b _08007E3E
_08007E3A:
2015-10-06 05:46:30 -07:00
asrs r0, 9
negs r4, r0
2016-01-06 20:23:20 -08:00
_08007E3E:
2015-10-06 05:46:30 -07:00
adds r0, r5, 0
muls r0, r1
adds r1, r3, 0
bl __udivsi3
adds r0, r4
subs r0, r5, r0
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8007E28
thumb_func_start obj_update_pos2
2016-09-02 19:51:16 -07:00
@ void obj_update_pos2(struct obj *obj, int a2, int a3)
obj_update_pos2: @ 8007E54
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
mov r7, r9
mov r6, r8
push {r6,r7}
adds r5, r0, 0
adds r6, r1, 0
mov r8, r2
ldrb r1, [r5, 0x3]
lsls r0, r1, 26
lsrs r7, r0, 27
movs r0, 0x80
lsls r0, 4
mov r9, r0
cmp r6, r9
2016-01-06 20:23:20 -08:00
beq _08007EA2
2015-10-10 05:20:38 -07:00
ldr r2, =gUnknown_082EC6F4
2015-10-06 05:46:30 -07:00
lsrs r1, 6
lsls r1, 3
ldrb r0, [r5, 0x1]
lsrs r0, 6
lsls r0, 5
adds r1, r0
adds r1, r2
ldr r0, [r1]
lsls r4, r0, 8
lsls r0, 16
ldr r2, =0x02021bc0
lsls r1, r7, 3
adds r1, r2
movs r2, 0
ldrsh r1, [r1, r2]
bl __divsi3
adds r1, r0, 0
adds r0, r4, 0
adds r2, r6, 0
bl sub_8007E28
strh r0, [r5, 0x24]
2016-01-06 20:23:20 -08:00
_08007EA2:
2015-10-06 05:46:30 -07:00
cmp r8, r9
2016-01-06 20:23:20 -08:00
beq _08007EDA
2015-10-10 05:20:38 -07:00
ldr r2, =gUnknown_082EC6F4
2015-10-06 05:46:30 -07:00
ldrb r1, [r5, 0x3]
lsrs r1, 6
lsls r1, 3
ldrb r0, [r5, 0x1]
lsrs r0, 6
lsls r0, 5
adds r1, r0
adds r2, 0x4
adds r1, r2
ldr r0, [r1]
lsls r4, r0, 8
lsls r0, 16
ldr r2, =0x02021bc0
lsls r1, r7, 3
adds r1, r2
movs r2, 0x6
ldrsh r1, [r1, r2]
bl __divsi3
adds r1, r0, 0
adds r0, r4, 0
mov r2, r8
bl sub_8007E28
strh r0, [r5, 0x26]
2016-01-06 20:23:20 -08:00
_08007EDA:
2015-10-06 05:46:30 -07:00
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end obj_update_pos2
thumb_func_start obj_set_horizonal_and_vertical_flip
2016-09-02 19:51:16 -07:00
@ void obj_set_horizonal_and_vertical_flip(struct obj *obj, u8 a2, char a3)
obj_set_horizonal_and_vertical_flip: @ 8007EF0
2015-10-06 05:46:30 -07:00
push {r4-r6,lr}
mov r6, r8
push {r6}
lsls r1, 24
lsrs r1, 24
lsls r2, 24
lsrs r2, 24
ldrb r6, [r0, 0x3]
lsls r3, r6, 26
lsrs r3, 27
movs r4, 0x7
ands r3, r4
lsls r3, 1
subs r4, 0x46
mov r8, r4
mov r5, r8
ands r5, r6
orrs r5, r3
strb r5, [r0, 0x3]
lsls r4, r5, 26
lsrs r4, 27
movs r6, 0x3F
adds r6, r0
mov r12, r6
ldrb r3, [r6]
lsls r3, 31
lsrs r3, 31
eors r1, r3
movs r6, 0x1
ands r1, r6
lsls r1, 3
orrs r4, r1
lsls r4, 1
mov r3, r8
ands r3, r5
orrs r3, r4
strb r3, [r0, 0x3]
lsls r4, r3, 26
lsrs r4, 27
mov r5, r12
ldrb r1, [r5]
lsls r1, 30
lsrs r1, 31
eors r2, r1
ands r2, r6
lsls r2, 4
orrs r4, r2
lsls r4, 1
mov r6, r8
ands r3, r6
orrs r3, r4
strb r3, [r0, 0x3]
pop {r3}
mov r8, r3
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end obj_set_horizonal_and_vertical_flip
thumb_func_start rotscale_reset_half
2016-09-02 19:51:16 -07:00
@ void rotscale_reset_half(u8 index)
rotscale_reset_half: @ 8007F64
2015-10-06 05:46:30 -07:00
lsls r0, 24
lsrs r0, 24
ldr r2, =0x03000b70
lsls r1, r0, 1
adds r1, r0
lsls r1, 2
adds r1, r2
movs r0, 0
strb r0, [r1, 0x1]
strb r0, [r1, 0x2]
strb r0, [r1, 0x3]
bx lr
.pool
thumb_func_end rotscale_reset_half
thumb_func_start rotscale_reset_full_1
2016-09-02 19:51:16 -07:00
@ void rotscale_reset_full_1(u8 index, u8 a2)
rotscale_reset_full_1: @ 8007F80
2015-10-06 05:46:30 -07:00
lsls r0, 24
lsrs r0, 24
ldr r3, =0x03000b70
lsls r2, r0, 1
adds r2, r0
lsls r2, 2
adds r2, r3
movs r3, 0
strb r1, [r2]
strb r3, [r2, 0x1]
strb r3, [r2, 0x2]
strb r3, [r2, 0x3]
movs r0, 0x80
lsls r0, 1
strh r0, [r2, 0x4]
strh r0, [r2, 0x6]
strh r3, [r2, 0x8]
bx lr
.pool
thumb_func_end rotscale_reset_full_1
thumb_func_start rotscale_reset_full_2
2016-09-02 19:51:16 -07:00
@ void rotscale_reset_full_2(u8 index)
rotscale_reset_full_2: @ 8007FA8
2015-10-06 05:46:30 -07:00
lsls r0, 24
lsrs r0, 24
ldr r2, =0x03000b70
lsls r1, r0, 1
adds r1, r0
lsls r1, 2
adds r1, r2
movs r0, 0
strb r0, [r1]
strb r0, [r1, 0x1]
strb r0, [r1, 0x2]
strb r0, [r1, 0x3]
movs r2, 0x80
lsls r2, 1
strh r2, [r1, 0x4]
strh r2, [r1, 0x6]
strh r0, [r1, 0x8]
bx lr
.pool
thumb_func_end rotscale_reset_full_2
thumb_func_start rotscale_frame_apply_absolute
2016-09-02 19:51:16 -07:00
@ void rotscale_frame_apply_absolute(u8 index, int a2)
rotscale_frame_apply_absolute: @ 8007FD0
2015-10-06 05:46:30 -07:00
lsls r0, 24
lsrs r0, 24
ldr r3, =0x03000b70
lsls r2, r0, 1
adds r2, r0
lsls r2, 2
adds r2, r3
ldrh r0, [r1]
strh r0, [r2, 0x4]
ldrh r0, [r1, 0x2]
strh r0, [r2, 0x6]
ldrb r0, [r1, 0x4]
lsls r0, 8
strh r0, [r2, 0x8]
bx lr
.pool
thumb_func_end rotscale_frame_apply_absolute
thumb_func_start obj_anim_image_delay_progress
2016-09-02 19:51:16 -07:00
obj_anim_image_delay_progress: @ 8007FF4
2015-10-06 05:46:30 -07:00
push {lr}
adds r3, r0, 0
adds r3, 0x2C
ldrb r2, [r3]
movs r0, 0x40
ands r0, r2
cmp r0, 0
2016-01-06 20:23:20 -08:00
bne _08008018
2015-10-06 05:46:30 -07:00
lsls r0, r2, 26
lsrs r0, 26
subs r0, 0x1
movs r1, 0x3F
ands r0, r1
movs r1, 0x40
negs r1, r1
ands r1, r2
orrs r1, r0
strb r1, [r3]
2016-01-06 20:23:20 -08:00
_08008018:
2015-10-06 05:46:30 -07:00
pop {r0}
bx r0
thumb_func_end obj_anim_image_delay_progress
thumb_func_start obj_anim_rotscale_delay_progress
2016-09-02 19:51:16 -07:00
@ u8 obj_anim_rotscale_delay_progress(struct obj *object, u8 index)
obj_anim_rotscale_delay_progress: @ 800801C
2015-10-06 05:46:30 -07:00
push {lr}
lsls r1, 24
lsrs r2, r1, 24
adds r3, r0, 0
adds r3, 0x2C
ldrb r1, [r3]
movs r0, 0x80
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
bne _08008040
2015-10-06 05:46:30 -07:00
ldr r0, =0x03000b70
lsls r1, r2, 1
adds r1, r2
lsls r1, 2
adds r1, r0
ldrb r0, [r1, 0x2]
subs r0, 0x1
strb r0, [r1, 0x2]
2016-01-06 20:23:20 -08:00
_08008040:
2015-10-06 05:46:30 -07:00
ldrb r0, [r3]
lsrs r0, 7
pop {r1}
bx r1
.pool
thumb_func_end obj_anim_rotscale_delay_progress
thumb_func_start rotscale_frame_apply_relative_and_sync
2016-09-02 19:51:16 -07:00
@ void rotscale_frame_apply_relative_and_sync(u8 index, int a2)
rotscale_frame_apply_relative_and_sync: @ 800804C
2015-10-06 05:46:30 -07:00
push {r4-r6,lr}
sub sp, 0x10
adds r5, r0, 0
lsls r5, 24
lsrs r5, 24
ldr r0, =0x03000b70
lsls r4, r5, 1
adds r4, r5
lsls r4, 2
adds r4, r0
ldrh r0, [r1]
ldrh r2, [r4, 0x4]
adds r0, r2
strh r0, [r4, 0x4]
ldrh r0, [r1, 0x2]
ldrh r2, [r4, 0x6]
adds r0, r2
strh r0, [r4, 0x6]
ldrb r0, [r1, 0x4]
lsls r0, 8
ldrh r1, [r4, 0x8]
adds r0, r1
ldr r2, =0xffffff00
adds r1, r2, 0
ands r0, r1
strh r0, [r4, 0x8]
movs r1, 0x4
ldrsh r0, [r4, r1]
bl divide_0x10000_by
lsls r0, 16
lsrs r0, 16
ldr r6, =0xffff0000
ldr r1, [sp]
ands r1, r6
orrs r1, r0
str r1, [sp]
movs r2, 0x6
ldrsh r0, [r4, r2]
bl divide_0x10000_by
lsls r0, 16
ldr r2, =0x0000ffff
ldr r1, [sp]
ands r1, r2
orrs r1, r0
str r1, [sp]
ldrh r1, [r4, 0x8]
ldr r0, [sp, 0x4]
ands r0, r6
orrs r0, r1
str r0, [sp, 0x4]
add r4, sp, 0x8
mov r0, sp
adds r1, r4, 0
movs r2, 0x1
movs r3, 0x2
2015-10-10 03:12:48 -07:00
bl ObjAffineSet
2015-10-06 05:46:30 -07:00
adds r0, r5, 0
adds r1, r4, 0
bl rotscale_set_indirect
add sp, 0x10
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end rotscale_frame_apply_relative_and_sync
thumb_func_start divide_0x10000_by
2016-09-02 19:51:16 -07:00
@ int divide_0x10000_by(int n)
divide_0x10000_by: @ 80080E4
2015-10-06 05:46:30 -07:00
push {lr}
adds r1, r0, 0
movs r0, 0x80
lsls r0, 9
lsls r1, 16
asrs r1, 16
bl __divsi3
lsls r0, 16
asrs r0, 16
pop {r1}
bx r1
thumb_func_end divide_0x10000_by
thumb_func_start rotscale_load_frame
2016-09-02 19:51:16 -07:00
@ void rotscale_load_frame(u8 index, struct obj *obj, rotscale_frame *a3)
rotscale_load_frame: @ 80080FC
2015-10-06 05:46:30 -07:00
push {r4,lr}
lsls r0, 24
lsrs r0, 24
ldr r3, =0x03000b70
lsls r4, r0, 1
adds r4, r0
lsls r4, 2
adds r4, r3
ldrb r3, [r4]
ldr r0, [r1, 0x10]
lsls r3, 2
adds r3, r0
ldrb r0, [r4, 0x1]
ldr r3, [r3]
lsls r0, 3
adds r0, r3
ldrh r0, [r0]
strh r0, [r2]
ldrb r3, [r4]
ldr r0, [r1, 0x10]
lsls r3, 2
adds r3, r0
ldrb r0, [r4, 0x1]
ldr r3, [r3]
lsls r0, 3
adds r0, r3
ldrh r0, [r0, 0x2]
strh r0, [r2, 0x2]
ldrb r3, [r4]
ldr r0, [r1, 0x10]
lsls r3, 2
adds r3, r0
ldrb r0, [r4, 0x1]
ldr r3, [r3]
lsls r0, 3
adds r0, r3
ldrb r0, [r0, 0x4]
strb r0, [r2, 0x4]
ldrb r3, [r4]
ldr r0, [r1, 0x10]
lsls r3, 2
adds r3, r0
ldrb r0, [r4, 0x1]
ldr r1, [r3]
lsls r0, 3
adds r0, r1
ldrb r0, [r0, 0x5]
strb r0, [r2, 0x5]
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end rotscale_load_frame
thumb_func_start sub_8008168
2016-09-02 19:51:16 -07:00
sub_8008168: @ 8008168
2015-10-06 05:46:30 -07:00
push {r4,lr}
sub sp, 0x8
adds r2, r1, 0
lsls r0, 24
lsrs r4, r0, 24
movs r0, 0
movs r1, 0
str r0, [sp]
str r1, [sp, 0x4]
ldrb r0, [r2, 0x5]
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _0800818E
2015-10-06 05:46:30 -07:00
subs r0, 0x1
strb r0, [r2, 0x5]
adds r0, r4, 0
adds r1, r2, 0
bl rotscale_frame_apply_relative_and_sync
2016-01-06 20:23:20 -08:00
b _0800819E
_0800818E:
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
adds r1, r2, 0
bl rotscale_frame_apply_absolute
adds r0, r4, 0
mov r1, sp
bl rotscale_frame_apply_relative_and_sync
2016-01-06 20:23:20 -08:00
_0800819E:
2015-10-06 05:46:30 -07:00
add sp, 0x8
pop {r4}
pop {r0}
bx r0
thumb_func_end sub_8008168
2015-12-03 00:17:29 -08:00
thumb_func_start StartObjectImageAnim
2016-09-02 19:51:16 -07:00
@ void StartObjectImageAnim(struct obj *object, u8 whichAnim)
StartObjectImageAnim: @ 80081A8
2015-10-06 05:46:30 -07:00
adds r2, r0, 0
adds r2, 0x2A
strb r1, [r2]
adds r0, 0x3F
ldrb r1, [r0]
movs r2, 0x4
orrs r1, r2
movs r2, 0x11
negs r2, r2
ands r1, r2
strb r1, [r0]
bx lr
2015-12-03 00:17:29 -08:00
thumb_func_end StartObjectImageAnim
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start StartObjectImageAnimIfDifferent
2016-09-02 19:51:16 -07:00
@ void StartObjectImageAnimIfDifferent(struct obj *object, u8 whichAnim)
StartObjectImageAnimIfDifferent: @ 80081C0
2015-10-06 05:46:30 -07:00
push {lr}
adds r2, r0, 0
lsls r1, 24
lsrs r1, 24
adds r0, 0x2A
ldrb r0, [r0]
cmp r0, r1
2016-01-06 20:23:20 -08:00
beq _080081D6
2015-10-06 05:46:30 -07:00
adds r0, r2, 0
2015-12-03 00:17:29 -08:00
bl StartObjectImageAnim
2016-01-06 20:23:20 -08:00
_080081D6:
2015-10-06 05:46:30 -07:00
pop {r0}
bx r0
2015-12-03 00:17:29 -08:00
thumb_func_end StartObjectImageAnimIfDifferent
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start SeekObjectImageAnim
2016-09-02 19:51:16 -07:00
@ void SeekObjectImageAnim(struct obj *object, u8 cmdIndex)
SeekObjectImageAnim: @ 80081DC
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
adds r3, r0, 0
lsls r1, 24
lsrs r1, 24
adds r4, r3, 0
adds r4, 0x2C
ldrb r0, [r4]
lsls r0, 25
lsrs r6, r0, 31
subs r1, 0x1
adds r0, r3, 0
adds r0, 0x2B
strb r1, [r0]
ldrb r1, [r4]
movs r7, 0x40
negs r7, r7
adds r0, r7, 0
ands r0, r1
strb r0, [r4]
adds r2, r3, 0
adds r2, 0x3F
ldrb r1, [r2]
movs r0, 0x5
negs r0, r0
ands r0, r1
movs r1, 0x11
negs r1, r1
ands r0, r1
strb r0, [r2]
ldrb r1, [r4]
movs r5, 0x41
negs r5, r5
adds r0, r5, 0
ands r0, r1
strb r0, [r4]
adds r0, r3, 0
2015-12-03 00:17:29 -08:00
bl ContinueObjectImageAnim
2015-10-06 05:46:30 -07:00
ldrb r2, [r4]
movs r0, 0x3F
ands r0, r2
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08008244
2015-10-06 05:46:30 -07:00
lsls r0, r2, 26
lsrs r0, 26
adds r0, 0x1
movs r1, 0x3F
ands r0, r1
adds r1, r7, 0
ands r1, r2
orrs r1, r0
strb r1, [r4]
2016-01-06 20:23:20 -08:00
_08008244:
2015-10-06 05:46:30 -07:00
lsls r2, r6, 6
ldrb r1, [r4]
adds r0, r5, 0
ands r0, r1
orrs r0, r2
strb r0, [r4]
pop {r4-r7}
pop {r0}
bx r0
2015-12-03 00:17:29 -08:00
thumb_func_end SeekObjectImageAnim
2015-10-06 05:46:30 -07:00
thumb_func_start StartObjectRotScalAnim
2016-09-02 19:51:16 -07:00
@ void StartObjectRotScalAnim(struct obj *object, u8 whichAnim)
StartObjectRotScalAnim: @ 8008258
2015-10-06 05:46:30 -07:00
push {r4,r5,lr}
adds r5, r0, 0
lsls r4, r1, 24
lsrs r4, 24
bl obj_get_rotscale_entry_index
lsls r0, 24
lsrs r0, 24
adds r1, r4, 0
bl rotscale_reset_full_1
adds r5, 0x3F
ldrb r0, [r5]
movs r1, 0x8
orrs r0, r1
movs r1, 0x21
negs r1, r1
ands r0, r1
strb r0, [r5]
pop {r4,r5}
pop {r0}
bx r0
thumb_func_end StartObjectRotScalAnim
2015-10-06 05:46:30 -07:00
thumb_func_start StartObjectRotScalAnimIfDifferent
2016-09-02 19:51:16 -07:00
@ void StartObjectRotScalAnimIfDifferent(struct obj *object, u8 whichAnim)
StartObjectRotScalAnimIfDifferent: @ 8008284
2015-10-06 05:46:30 -07:00
push {r4,r5,lr}
adds r5, r0, 0
lsls r1, 24
lsrs r4, r1, 24
bl obj_get_rotscale_entry_index
lsls r0, 24
lsrs r0, 24
ldr r2, =0x03000b70
lsls r1, r0, 1
adds r1, r0
lsls r1, 2
adds r1, r2
ldrb r0, [r1]
cmp r0, r4
2016-01-06 20:23:20 -08:00
beq _080082AC
2015-10-06 05:46:30 -07:00
adds r0, r5, 0
adds r1, r4, 0
bl StartObjectRotScalAnim
2016-01-06 20:23:20 -08:00
_080082AC:
2015-10-06 05:46:30 -07:00
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end StartObjectRotScalAnimIfDifferent
2015-10-06 05:46:30 -07:00
thumb_func_start sub_80082B8
2016-09-02 19:51:16 -07:00
sub_80082B8: @ 80082B8
2015-10-06 05:46:30 -07:00
push {r4,r5,lr}
adds r5, r0, 0
lsls r4, r1, 24
lsrs r4, 24
bl obj_get_rotscale_entry_index
lsls r0, 24
lsrs r0, 24
ldr r2, =0x03000b70
lsls r1, r0, 1
adds r1, r0
lsls r1, 2
adds r1, r2
strb r4, [r1]
adds r5, 0x3F
ldrb r0, [r5]
movs r1, 0x8
orrs r0, r1
movs r1, 0x21
negs r1, r1
ands r0, r1
strb r0, [r5]
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_80082B8
thumb_func_start sub_80082F0
2016-09-02 19:51:16 -07:00
sub_80082F0: @ 80082F0
2015-10-06 05:46:30 -07:00
push {r4,r5,lr}
adds r5, r0, 0
lsls r1, 24
lsrs r4, r1, 24
bl obj_get_rotscale_entry_index
lsls r0, 24
lsrs r0, 24
ldr r2, =0x03000b70
lsls r1, r0, 1
adds r1, r0
lsls r1, 2
adds r1, r2
ldrb r0, [r1]
cmp r0, r4
2016-01-06 20:23:20 -08:00
beq _08008318
2015-10-06 05:46:30 -07:00
adds r0, r5, 0
adds r1, r4, 0
bl sub_80082B8
2016-01-06 20:23:20 -08:00
_08008318:
2015-10-06 05:46:30 -07:00
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_80082F0
thumb_func_start sub_8008324
2016-09-02 19:51:16 -07:00
sub_8008324: @ 8008324
2015-10-06 05:46:30 -07:00
push {lr}
adds r3, r0, 0
adds r0, 0x3F
ldrb r1, [r0]
movs r0, 0x40
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08008370
2015-10-06 05:46:30 -07:00
adds r0, r3, 0
adds r0, 0x2A
ldrb r1, [r0]
ldr r0, [r3, 0x8]
lsls r1, 2
adds r1, r0
adds r0, r3, 0
adds r0, 0x2B
ldrb r0, [r0]
ldr r1, [r1]
lsls r0, 2
adds r0, r1
ldrh r2, [r0]
movs r1, 0
ldrsh r0, [r0, r1]
cmp r0, 0
2016-01-06 20:23:20 -08:00
bge _08008358
2015-10-06 05:46:30 -07:00
movs r2, 0
2016-01-06 20:23:20 -08:00
_08008358:
2015-10-06 05:46:30 -07:00
adds r0, r3, 0
adds r0, 0x40
ldrh r1, [r0]
adds r1, r2
ldr r2, =0x000003ff
adds r0, r2, 0
ands r1, r0
ldrh r2, [r3, 0x4]
ldr r0, =0xfffffc00
ands r0, r2
orrs r0, r1
strh r0, [r3, 0x4]
2016-01-06 20:23:20 -08:00
_08008370:
2015-10-06 05:46:30 -07:00
pop {r0}
bx r0
.pool
thumb_func_end sub_8008324
thumb_func_start rotscale_reset_all
2016-09-02 19:51:16 -07:00
@ void rotscale_reset_all()
rotscale_reset_all: @ 800837C
2015-10-06 05:46:30 -07:00
push {r4,lr}
ldr r1, =0x02021cc0
movs r0, 0
strb r0, [r1]
ldr r1, =0x03003018
movs r0, 0
str r0, [r1]
2015-12-03 00:17:29 -08:00
bl ResetSpriteTransformationMatrices
2015-10-06 05:46:30 -07:00
movs r4, 0
2016-01-06 20:23:20 -08:00
_08008390:
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
bl rotscale_reset_full_2
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0x1F
2016-01-06 20:23:20 -08:00
bls _08008390
2015-10-06 05:46:30 -07:00
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end rotscale_reset_all
thumb_func_start rotscale_alloc_entry
2016-09-02 19:51:16 -07:00
@ u8 rotscale_alloc_entry()
rotscale_alloc_entry: @ 80083B0
2015-10-06 05:46:30 -07:00
push {r4,lr}
movs r2, 0
movs r1, 0x1
ldr r0, =0x03003018
ldr r4, [r0]
adds r3, r0, 0
2016-01-06 20:23:20 -08:00
_080083BC:
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
bne _080083D4
2015-10-06 05:46:30 -07:00
ldr r0, [r3]
orrs r0, r1
str r0, [r3]
adds r0, r2, 0
2016-01-06 20:23:20 -08:00
b _080083E2
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_080083D4:
2015-10-06 05:46:30 -07:00
adds r0, r2, 0x1
lsls r0, 24
lsrs r2, r0, 24
lsls r1, 1
cmp r2, 0x1F
2016-01-06 20:23:20 -08:00
bls _080083BC
2015-10-06 05:46:30 -07:00
movs r0, 0xFF
2016-01-06 20:23:20 -08:00
_080083E2:
2015-10-06 05:46:30 -07:00
pop {r4}
pop {r1}
bx r1
thumb_func_end rotscale_alloc_entry
thumb_func_start rotscale_free_entry
2016-09-02 19:51:16 -07:00
@ void rotscale_free_entry(u8 rotscale_index)
rotscale_free_entry: @ 80083E8
2015-10-06 05:46:30 -07:00
push {lr}
sub sp, 0x4
lsls r0, 24
lsrs r2, r0, 24
movs r0, 0
movs r1, 0x1
ldr r3, =0x03003018
cmp r0, r2
2016-01-06 20:23:20 -08:00
bcs _08008406
_080083FA:
2015-10-06 05:46:30 -07:00
adds r0, 0x1
lsls r0, 24
lsrs r0, 24
lsls r1, 1
cmp r0, r2
2016-01-06 20:23:20 -08:00
bcc _080083FA
_08008406:
2015-10-06 05:46:30 -07:00
ldr r0, [r3]
bics r0, r1
str r0, [r3]
movs r1, 0x80
lsls r1, 1
str r1, [sp]
adds r0, r2, 0
movs r2, 0
movs r3, 0
2015-12-03 00:17:29 -08:00
bl SetSpriteTransformationMatrix
2015-10-06 05:46:30 -07:00
add sp, 0x4
pop {r0}
bx r0
.pool
thumb_func_end rotscale_free_entry
thumb_func_start obj_alloc_rotscale_entry
2016-09-02 19:51:16 -07:00
@ void obj_alloc_rotscale_entry(struct obj *obj)
obj_alloc_rotscale_entry: @ 8008428
2015-10-06 05:46:30 -07:00
push {r4,r5,lr}
adds r4, r0, 0
bl rotscale_alloc_entry
lsls r0, 24
lsrs r5, r0, 24
cmp r5, 0xFF
2016-01-06 20:23:20 -08:00
beq _08008470
2015-10-06 05:46:30 -07:00
ldrb r3, [r4, 0x1]
lsrs r1, r3, 6
ldrb r2, [r4, 0x3]
lsrs r2, 6
lsls r3, 30
lsrs r3, 30
adds r0, r4, 0
2015-12-03 00:17:29 -08:00
bl CalcVecFromObjectCenterToObjectUpperLeft
2015-10-06 05:46:30 -07:00
movs r0, 0x1F
adds r1, r5, 0
ands r1, r0
lsls r1, 1
ldrb r2, [r4, 0x3]
movs r0, 0x3F
negs r0, r0
ands r0, r2
orrs r0, r1
strb r0, [r4, 0x3]
adds r2, r4, 0
adds r2, 0x3F
ldrb r0, [r2]
movs r1, 0x8
orrs r0, r1
strb r0, [r2]
adds r0, r5, 0
bl rotscale_reset_full_2
2016-01-06 20:23:20 -08:00
_08008470:
2015-10-06 05:46:30 -07:00
pop {r4,r5}
pop {r0}
bx r0
thumb_func_end obj_alloc_rotscale_entry
thumb_func_start sub_8008478
2016-09-02 19:51:16 -07:00
sub_8008478: @ 8008478
2015-10-06 05:46:30 -07:00
push {r4-r6,lr}
mov r6, r8
push {r6}
sub sp, 0x10
adds r6, r0, 0
adds r0, r1, 0
adds r4, r2, 0
adds r5, r3, 0
lsls r6, 24
lsrs r6, 24
lsls r4, 16
lsrs r4, 16
lsls r5, 16
lsrs r5, 16
lsls r0, 16
asrs r0, 16
bl divide_0x10000_by
lsls r0, 16
lsrs r0, 16
ldr r1, =0xffff0000
mov r8, r1
ldr r1, [sp]
mov r2, r8
ands r1, r2
orrs r1, r0
str r1, [sp]
lsls r4, 16
asrs r4, 16
adds r0, r4, 0
bl divide_0x10000_by
lsls r0, 16
ldr r2, =0x0000ffff
ldr r1, [sp]
ands r1, r2
orrs r1, r0
str r1, [sp]
ldr r0, [sp, 0x4]
mov r1, r8
ands r0, r1
orrs r0, r5
str r0, [sp, 0x4]
add r4, sp, 0x8
mov r0, sp
adds r1, r4, 0
movs r2, 0x1
movs r3, 0x2
2015-10-10 03:12:48 -07:00
bl ObjAffineSet
2015-10-06 05:46:30 -07:00
adds r0, r6, 0
adds r1, r4, 0
bl rotscale_set_indirect
add sp, 0x10
pop {r3}
mov r8, r3
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_8008478
2015-12-03 00:17:29 -08:00
thumb_func_start LoadObjectPic
2016-09-02 19:51:16 -07:00
@ u16 LoadObjectPic(struct obj_tiles *pic)
LoadObjectPic: @ 80084F8
2015-10-06 05:46:30 -07:00
push {r4-r6,lr}
adds r5, r0, 0
ldrh r0, [r5, 0x4]
lsrs r0, 5
2015-12-03 00:17:29 -08:00
bl AllocObjectTiles
2015-10-06 05:46:30 -07:00
lsls r4, r0, 16
asrs r6, r4, 16
cmp r6, 0
2016-01-06 20:23:20 -08:00
blt _08008534
2015-10-06 05:46:30 -07:00
ldrh r0, [r5, 0x6]
lsrs r4, 16
ldrh r2, [r5, 0x4]
lsrs r2, 5
adds r1, r4, 0
2015-12-03 00:17:29 -08:00
bl AddObjectTileRange
2015-10-06 05:46:30 -07:00
ldr r0, [r5]
lsls r1, r6, 5
ldr r2, =0x06010000
adds r1, r2
ldrh r2, [r5, 0x4]
lsrs r2, 1
bl CpuSet
adds r0, r4, 0
2016-01-06 20:23:20 -08:00
b _08008536
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_08008534:
2015-10-06 05:46:30 -07:00
movs r0, 0
2016-01-06 20:23:20 -08:00
_08008536:
2015-10-06 05:46:30 -07:00
pop {r4-r6}
pop {r1}
bx r1
2015-12-03 00:17:29 -08:00
thumb_func_end LoadObjectPic
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start LoadObjectPics
2016-09-02 19:51:16 -07:00
@ void LoadObjectPics(struct obj_tiles *pics)
LoadObjectPics: @ 800853C
2015-10-06 05:46:30 -07:00
push {r4,r5,lr}
adds r5, r0, 0
movs r4, 0
ldr r0, [r5]
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _08008560
_08008548:
2015-10-06 05:46:30 -07:00
lsls r0, r4, 3
adds r0, r5, r0
2015-12-03 00:17:29 -08:00
bl LoadObjectPic
2015-10-06 05:46:30 -07:00
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
lsls r0, r4, 3
adds r0, r5
ldr r0, [r0]
cmp r0, 0
2016-01-06 20:23:20 -08:00
bne _08008548
_08008560:
2015-10-06 05:46:30 -07:00
pop {r4,r5}
pop {r0}
bx r0
2015-12-03 00:17:29 -08:00
thumb_func_end LoadObjectPics
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start FreeObjectTilesByTag
2016-09-02 19:51:16 -07:00
@ void FreeObjectTilesByTag(u16 tag)
FreeObjectTilesByTag: @ 8008568
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
mov r7, r8
push {r7}
lsls r0, 16
lsrs r0, 16
2015-12-03 00:17:29 -08:00
bl IndexOfObjectTilesTag
2015-10-06 05:46:30 -07:00
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0xFF
2016-01-06 20:23:20 -08:00
beq _080085C6
2015-10-06 05:46:30 -07:00
ldr r0, =0x03000a70
lsls r1, r4, 2
adds r2, r1, r0
adds r0, 0x2
adds r1, r0
ldrh r0, [r1]
ldrh r3, [r2]
adds r0, r3, r0
ldr r1, =0x030009f0
mov r8, r1
lsls r5, r4, 1
cmp r3, r0
2016-01-06 20:23:20 -08:00
bge _080085BE
2015-10-06 05:46:30 -07:00
ldr r1, =0x02021b3c
mov r12, r1
movs r6, 0x7
movs r7, 0x1
adds r4, r0, 0
2016-01-06 20:23:20 -08:00
_080085A2:
2015-10-06 05:46:30 -07:00
lsrs r2, r3, 3
add r2, r12
adds r0, r3, 0
ands r0, r6
adds r1, r7, 0
lsls r1, r0
ldrb r0, [r2]
bics r0, r1
strb r0, [r2]
adds r0, r3, 0x1
lsls r0, 16
lsrs r3, r0, 16
cmp r3, r4
2016-01-06 20:23:20 -08:00
blt _080085A2
_080085BE:
2015-10-06 05:46:30 -07:00
mov r0, r8
adds r1, r5, r0
ldr r0, =0x0000ffff
strh r0, [r1]
2016-01-06 20:23:20 -08:00
_080085C6:
2015-10-06 05:46:30 -07:00
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end FreeObjectTilesByTag
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start FreeAllObjectTiles
2016-09-02 19:51:16 -07:00
@ void FreeAllObjectTiles()
FreeAllObjectTiles: @ 80085E0
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
movs r2, 0
ldr r7, =0x030009f0
ldr r0, =0x0000ffff
adds r6, r0, 0
ldr r4, =0x03000a70
movs r3, 0
adds r5, r4, 0x2
2016-01-06 20:23:20 -08:00
_080085F0:
2015-10-06 05:46:30 -07:00
lsls r1, r2, 1
adds r1, r7
ldrh r0, [r1]
orrs r0, r6
strh r0, [r1]
lsls r1, r2, 2
adds r0, r1, r4
strh r3, [r0]
adds r1, r5
strh r3, [r1]
adds r0, r2, 0x1
lsls r0, 24
lsrs r2, r0, 24
cmp r2, 0x3F
2016-01-06 20:23:20 -08:00
bls _080085F0
2015-10-06 05:46:30 -07:00
pop {r4-r7}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end FreeAllObjectTiles
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start GetObjectTileRangeStartByTag
2016-09-02 19:51:16 -07:00
@ u16 GetObjectTileRangeStartByTag(u16 tag)
GetObjectTileRangeStartByTag: @ 8008620
2015-10-06 05:46:30 -07:00
push {lr}
lsls r0, 16
lsrs r0, 16
2015-12-03 00:17:29 -08:00
bl IndexOfObjectTilesTag
2015-10-06 05:46:30 -07:00
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0xFF
2016-01-06 20:23:20 -08:00
beq _08008640
2015-10-06 05:46:30 -07:00
ldr r0, =0x03000a70
lsls r1, 2
adds r1, r0
ldrh r0, [r1]
2016-01-06 20:23:20 -08:00
b _08008642
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_08008640:
2015-10-06 05:46:30 -07:00
ldr r0, =0x0000ffff
2016-01-06 20:23:20 -08:00
_08008642:
2015-10-06 05:46:30 -07:00
pop {r1}
bx r1
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end GetObjectTileRangeStartByTag
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start IndexOfObjectTilesTag
2016-09-02 19:51:16 -07:00
@ u8 IndexOfObjectTilesTag(u16 tag)
IndexOfObjectTilesTag: @ 800864C
2015-10-06 05:46:30 -07:00
push {lr}
lsls r0, 16
lsrs r2, r0, 16
movs r1, 0
ldr r3, =0x030009f0
2016-01-06 20:23:20 -08:00
_08008656:
2015-10-06 05:46:30 -07:00
lsls r0, r1, 1
adds r0, r3
ldrh r0, [r0]
cmp r0, r2
2016-01-06 20:23:20 -08:00
bne _08008668
2015-10-06 05:46:30 -07:00
adds r0, r1, 0
2016-01-06 20:23:20 -08:00
b _08008674
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_08008668:
2015-10-06 05:46:30 -07:00
adds r0, r1, 0x1
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0x3F
2016-01-06 20:23:20 -08:00
bls _08008656
2015-10-06 05:46:30 -07:00
movs r0, 0xFF
2016-01-06 20:23:20 -08:00
_08008674:
2015-10-06 05:46:30 -07:00
pop {r1}
bx r1
2015-12-03 00:17:29 -08:00
thumb_func_end IndexOfObjectTilesTag
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start GetTagByObjectTileRangeStart
2016-09-02 19:51:16 -07:00
@ u16 GetTagByObjectTileRangeStart(u16 rangeStart)
GetTagByObjectTileRangeStart: @ 8008678
2015-10-06 05:46:30 -07:00
push {r4-r6,lr}
lsls r0, 16
lsrs r3, r0, 16
movs r2, 0
ldr r6, =0x030009f0
ldr r5, =0x0000ffff
ldr r4, =0x03000a70
2016-01-06 20:23:20 -08:00
_08008686:
2015-10-06 05:46:30 -07:00
lsls r0, r2, 1
adds r1, r0, r6
ldrh r0, [r1]
cmp r0, r5
2016-01-06 20:23:20 -08:00
beq _080086AC
2015-10-06 05:46:30 -07:00
lsls r0, r2, 2
adds r0, r4
ldrh r0, [r0]
cmp r0, r3
2016-01-06 20:23:20 -08:00
bne _080086AC
2015-10-06 05:46:30 -07:00
ldrh r0, [r1]
2016-01-06 20:23:20 -08:00
b _080086B8
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_080086AC:
2015-10-06 05:46:30 -07:00
adds r0, r2, 0x1
lsls r0, 24
lsrs r2, r0, 24
cmp r2, 0x3F
2016-01-06 20:23:20 -08:00
bls _08008686
2015-10-06 05:46:30 -07:00
ldr r0, =0x0000ffff
2016-01-06 20:23:20 -08:00
_080086B8:
2015-10-06 05:46:30 -07:00
pop {r4-r6}
pop {r1}
bx r1
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end GetTagByObjectTileRangeStart
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start AddObjectTileRange
2016-09-02 19:51:16 -07:00
@ void AddObjectTileRange(u16 tag, u16 start, u16 count)
AddObjectTileRange: @ 80086C4
2015-10-06 05:46:30 -07:00
push {r4-r6,lr}
adds r4, r0, 0
adds r5, r1, 0
adds r6, r2, 0
lsls r4, 16
lsrs r4, 16
lsls r5, 16
lsrs r5, 16
lsls r6, 16
lsrs r6, 16
ldr r0, =0x0000ffff
2015-12-03 00:17:29 -08:00
bl IndexOfObjectTilesTag
2015-10-06 05:46:30 -07:00
lsls r0, 24
lsrs r0, 24
ldr r2, =0x030009f0
lsls r1, r0, 1
adds r1, r2
strh r4, [r1]
ldr r1, =0x03000a70
lsls r0, 2
adds r2, r0, r1
strh r5, [r2]
adds r1, 0x2
adds r0, r1
strh r6, [r0]
pop {r4-r6}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end AddObjectTileRange
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start ResetObjectPaletteAllocator
2016-09-02 19:51:16 -07:00
@ void ResetObjectPaletteAllocator()
ResetObjectPaletteAllocator: @ 800870C
2015-10-06 05:46:30 -07:00
push {r4,lr}
ldr r1, =0x0300301c
movs r0, 0
strb r0, [r1]
movs r2, 0
ldr r4, =0x03000cf0
ldr r0, =0x0000ffff
adds r3, r0, 0
2016-01-06 20:23:20 -08:00
_0800871C:
2015-10-06 05:46:30 -07:00
lsls r0, r2, 1
adds r0, r4
ldrh r1, [r0]
orrs r1, r3
strh r1, [r0]
adds r0, r2, 0x1
lsls r0, 24
lsrs r2, r0, 24
cmp r2, 0xF
2016-01-06 20:23:20 -08:00
bls _0800871C
2015-10-06 05:46:30 -07:00
pop {r4}
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end ResetObjectPaletteAllocator
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start LoadTaggedObjectPalette
2016-09-02 19:51:16 -07:00
@ u8 LoadTaggedObjectPalette(struct TaggedObjectPalette *palette)
LoadTaggedObjectPalette: @ 8008744
2015-10-06 05:46:30 -07:00
push {r4,r5,lr}
adds r5, r0, 0
ldrh r0, [r5, 0x4]
2015-12-03 00:17:29 -08:00
bl IndexOfObjectPaletteTag
2015-10-06 05:46:30 -07:00
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0xFF
2016-01-06 20:23:20 -08:00
beq _0800875A
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
2016-01-06 20:23:20 -08:00
b _0800878A
_0800875A:
2015-10-06 05:46:30 -07:00
ldr r0, =0x0000ffff
2015-12-03 00:17:29 -08:00
bl IndexOfObjectPaletteTag
2015-10-06 05:46:30 -07:00
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0xFF
2016-01-06 20:23:20 -08:00
beq _08008788
2015-10-06 05:46:30 -07:00
ldr r1, =0x03000cf0
lsls r0, r4, 1
adds r0, r1
ldrh r1, [r5, 0x4]
strh r1, [r0]
ldr r0, [r5]
lsls r1, r4, 4
2015-12-03 00:17:29 -08:00
bl LoadObjectPalette
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
2016-01-06 20:23:20 -08:00
b _0800878A
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_08008788:
2015-10-06 05:46:30 -07:00
movs r0, 0xFF
2016-01-06 20:23:20 -08:00
_0800878A:
2015-10-06 05:46:30 -07:00
pop {r4,r5}
pop {r1}
bx r1
2015-12-03 00:17:29 -08:00
thumb_func_end LoadTaggedObjectPalette
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start LoadTaggedObjectPalettes
2016-09-02 19:51:16 -07:00
@ void LoadTaggedObjectPalettes(struct TaggedObjectPalette *palettes)
LoadTaggedObjectPalettes: @ 8008790
2015-10-06 05:46:30 -07:00
push {r4,r5,lr}
adds r5, r0, 0
movs r4, 0
2016-01-06 20:23:20 -08:00
b _0800879E
_08008798:
2015-10-06 05:46:30 -07:00
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
2016-01-06 20:23:20 -08:00
_0800879E:
2015-10-06 05:46:30 -07:00
lsls r0, r4, 3
adds r1, r0, r5
ldr r0, [r1]
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _080087B6
2015-10-06 05:46:30 -07:00
adds r0, r1, 0
2015-12-03 00:17:29 -08:00
bl LoadTaggedObjectPalette
2015-10-06 05:46:30 -07:00
lsls r0, 24
lsrs r0, 24
cmp r0, 0xFF
2016-01-06 20:23:20 -08:00
bne _08008798
_080087B6:
2015-10-06 05:46:30 -07:00
pop {r4,r5}
pop {r0}
bx r0
2015-12-03 00:17:29 -08:00
thumb_func_end LoadTaggedObjectPalettes
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start LoadObjectPalette
2016-09-02 19:51:16 -07:00
@ void LoadObjectPalette(void *src, u16 destOffset)
LoadObjectPalette: @ 80087BC
2015-10-06 05:46:30 -07:00
push {lr}
lsls r1, 16
movs r2, 0x80
lsls r2, 17
adds r1, r2
lsrs r1, 16
movs r2, 0x20
bl gpu_pal_apply
pop {r0}
bx r0
2015-12-03 00:17:29 -08:00
thumb_func_end LoadObjectPalette
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start AllocObjectPalette
2016-09-02 19:51:16 -07:00
@ u8 AllocObjectPalette(u16 tag)
AllocObjectPalette: @ 80087D4
2015-10-06 05:46:30 -07:00
push {r4,lr}
lsls r0, 16
lsrs r4, r0, 16
ldr r0, =0x0000ffff
2015-12-03 00:17:29 -08:00
bl IndexOfObjectPaletteTag
2015-10-06 05:46:30 -07:00
lsls r0, 24
lsrs r2, r0, 24
cmp r2, 0xFF
2016-01-06 20:23:20 -08:00
beq _080087FC
2015-10-06 05:46:30 -07:00
ldr r1, =0x03000cf0
lsls r0, r2, 1
adds r0, r1
strh r4, [r0]
adds r0, r2, 0
2016-01-06 20:23:20 -08:00
b _080087FE
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_080087FC:
2015-10-06 05:46:30 -07:00
movs r0, 0xFF
2016-01-06 20:23:20 -08:00
_080087FE:
2015-10-06 05:46:30 -07:00
pop {r4}
pop {r1}
bx r1
2015-12-03 00:17:29 -08:00
thumb_func_end AllocObjectPalette
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start IndexOfObjectPaletteTag
2016-09-02 19:51:16 -07:00
@ u8 IndexOfObjectPaletteTag(u16 tag)
IndexOfObjectPaletteTag: @ 8008804
2015-10-06 05:46:30 -07:00
push {lr}
lsls r0, 16
lsrs r2, r0, 16
ldr r0, =0x0300301c
ldrb r1, [r0]
cmp r1, 0xF
2016-01-06 20:23:20 -08:00
bhi _08008836
2015-10-06 05:46:30 -07:00
ldr r3, =0x03000cf0
2016-01-06 20:23:20 -08:00
_08008814:
2015-10-06 05:46:30 -07:00
lsls r0, r1, 1
adds r0, r3
ldrh r0, [r0]
cmp r0, r2
2016-01-06 20:23:20 -08:00
bne _0800882C
2015-10-06 05:46:30 -07:00
adds r0, r1, 0
2016-01-06 20:23:20 -08:00
b _08008838
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_0800882C:
2015-10-06 05:46:30 -07:00
adds r0, r1, 0x1
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0xF
2016-01-06 20:23:20 -08:00
bls _08008814
_08008836:
2015-10-06 05:46:30 -07:00
movs r0, 0xFF
2016-01-06 20:23:20 -08:00
_08008838:
2015-10-06 05:46:30 -07:00
pop {r1}
bx r1
2015-12-03 00:17:29 -08:00
thumb_func_end IndexOfObjectPaletteTag
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start GetObjectPaletteTagBySlot
2016-09-02 19:51:16 -07:00
@ u16 GetObjectPaletteTagBySlot(u8 paletteSlot)
GetObjectPaletteTagBySlot: @ 800883C
2015-10-06 05:46:30 -07:00
lsls r0, 24
ldr r1, =0x03000cf0
lsrs r0, 23
adds r0, r1
ldrh r0, [r0]
bx lr
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end GetObjectPaletteTagBySlot
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start FreeObjectPaletteByTag
2016-09-02 19:51:16 -07:00
@ void FreeObjectPaletteByTag(int tag)
FreeObjectPaletteByTag: @ 800884C
2015-10-06 05:46:30 -07:00
push {lr}
lsls r0, 16
lsrs r0, 16
2015-12-03 00:17:29 -08:00
bl IndexOfObjectPaletteTag
2015-10-06 05:46:30 -07:00
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0xFF
2016-01-06 20:23:20 -08:00
beq _08008868
2015-10-06 05:46:30 -07:00
ldr r0, =0x03000cf0
lsls r1, 1
adds r1, r0
ldr r0, =0x0000ffff
strh r0, [r1]
2016-01-06 20:23:20 -08:00
_08008868:
2015-10-06 05:46:30 -07:00
pop {r0}
bx r0
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end FreeObjectPaletteByTag
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start SetSpriteOamTables_NoPriorityFromTable
2016-09-02 19:51:16 -07:00
@ void SetSpriteOamTables_NoPriorityFromTable(struct obj *object, u32 spriteOamTables)
SetSpriteOamTables_NoPriorityFromTable: @ 8008874
2015-10-06 05:46:30 -07:00
str r1, [r0, 0x18]
adds r0, 0x42
movs r1, 0x40
strb r1, [r0]
bx lr
2015-12-03 00:17:29 -08:00
thumb_func_end SetSpriteOamTables_NoPriorityFromTable
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start AddSprite
2016-09-02 19:51:16 -07:00
@ u8 AddSprite(struct obj *obj, u8 *spriteIndex)
AddSprite: @ 8008880
2015-10-06 05:46:30 -07:00
push {r4,lr}
adds r4, r0, 0
adds r3, r1, 0
ldr r1, =0x02021b38
ldrb r0, [r3]
ldrb r1, [r1]
cmp r0, r1
2016-01-06 20:23:20 -08:00
bcc _08008898
2015-10-06 05:46:30 -07:00
movs r0, 0x1
2016-01-06 20:23:20 -08:00
b _080088E0
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_08008898:
2015-10-06 05:46:30 -07:00
ldr r0, [r4, 0x18]
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _080088AC
2015-10-06 05:46:30 -07:00
adds r0, r4, 0
adds r0, 0x42
ldrb r1, [r0]
movs r0, 0xC0
ands r0, r1
cmp r0, 0
2016-01-06 20:23:20 -08:00
bne _080088CC
_080088AC:
2015-10-06 05:46:30 -07:00
ldr r0, =0x030022c0
ldrb r2, [r3]
lsls r2, 3
adds r0, 0x38
adds r2, r0
ldr r0, [r4]
ldr r1, [r4, 0x4]
str r0, [r2]
str r1, [r2, 0x4]
ldrb r0, [r3]
adds r0, 0x1
strb r0, [r3]
movs r0, 0
2016-01-06 20:23:20 -08:00
b _080088E0
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_080088CC:
2015-10-06 05:46:30 -07:00
ldrb r1, [r3]
lsls r1, 3
ldr r0, =0x030022f8
adds r1, r0
adds r0, r4, 0
adds r2, r3, 0
2015-12-03 00:17:29 -08:00
bl AddSpritesFromSpriteOamTable
2015-10-06 05:46:30 -07:00
lsls r0, 24
lsrs r0, 24
2016-01-06 20:23:20 -08:00
_080088E0:
2015-10-06 05:46:30 -07:00
pop {r4}
pop {r1}
bx r1
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end AddSprite
2015-10-06 05:46:30 -07:00
2015-12-03 00:17:29 -08:00
thumb_func_start AddSpritesFromSpriteOamTable
2016-09-02 19:51:16 -07:00
@ u8 AddSpritesFromSpriteOamTable(struct obj *object, struct sprite *sprite, u8 *spriteIndex)
AddSpritesFromSpriteOamTable: @ 80088EC
2015-10-06 05:46:30 -07:00
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x1C
adds r3, r0, 0
str r1, [sp]
mov r8, r2
ldr r0, =0x02021b38
ldrb r1, [r2]
ldrb r0, [r0]
cmp r1, r0
2016-01-06 20:23:20 -08:00
bcc _08008910
_08008908:
2015-10-06 05:46:30 -07:00
movs r0, 0x1
2016-01-06 20:23:20 -08:00
b _08008AE6
2015-10-06 05:46:30 -07:00
.pool
2016-01-06 20:23:20 -08:00
_08008910:
2015-10-06 05:46:30 -07:00
adds r0, r3, 0
adds r0, 0x42
ldrb r1, [r0]
lsls r1, 26
lsrs r1, 23
ldr r2, [r3, 0x18]
adds r7, r2, r1
mov r12, r3
str r0, [sp, 0x18]
cmp r7, 0
2016-01-06 20:23:20 -08:00
beq _0800892C
2015-10-06 05:46:30 -07:00
ldr r0, [r7, 0x4]
cmp r0, 0
2016-01-06 20:23:20 -08:00
bne _08008942
_0800892C:
2015-10-06 05:46:30 -07:00
mov r2, r12
ldr r0, [r2]
ldr r1, [r2, 0x4]
ldr r2, [sp]
str r0, [r2]
str r1, [r2, 0x4]
mov r1, r8
ldrb r0, [r1]
adds r0, 0x1
strb r0, [r1]
2016-01-06 20:23:20 -08:00
b _08008AE4
_08008942:
2015-10-06 05:46:30 -07:00
mov r2, r12
ldrh r0, [r2, 0x4]
lsls r0, 22
lsrs r0, 22
str r0, [sp, 0x4]
ldrb r0, [r7]
str r0, [sp, 0xC]
ldrb r0, [r2, 0x3]
lsls r0, 26
lsrs r0, 27
asrs r1, r0, 3
str r1, [sp, 0x10]
movs r1, 0x1
ldr r2, [sp, 0x10]
ands r2, r1
str r2, [sp, 0x10]
asrs r0, 4
mov r10, r0
ands r0, r1
mov r10, r0
mov r1, r12
ldrh r0, [r1, 0x2]
lsls r0, 23
lsrs r0, 23
adds r1, 0x28
ldrb r1, [r1]
lsls r1, 24
asrs r1, 24
subs r0, r1
lsls r0, 16
lsrs r2, r0, 16
mov r1, r12
ldrb r0, [r1]
adds r1, 0x29
ldrb r1, [r1]
lsls r1, 24
asrs r1, 24
subs r0, r1
lsls r0, 16
lsrs r0, 16
str r0, [sp, 0x8]
movs r0, 0
mov r9, r0
ldr r1, [sp, 0xC]
cmp r9, r1
2016-01-06 20:23:20 -08:00
bcc _080089A0
b _08008AE4
_080089A0:
2015-10-06 05:46:30 -07:00
lsls r0, r2, 16
asrs r0, 16
str r0, [sp, 0x14]
2016-01-06 20:23:20 -08:00
_080089A6:
2015-10-06 05:46:30 -07:00
mov r2, r8
ldrb r0, [r2]
ldr r1, =0x02021b38
ldrb r1, [r1]
cmp r0, r1
2016-01-06 20:23:20 -08:00
bcs _08008908
2015-10-06 05:46:30 -07:00
ldr r0, [r7, 0x4]
mov r2, r9
lsls r6, r2, 2
adds r2, r6, r0
movs r0, 0
ldrsb r0, [r2, r0]
lsls r0, 16
lsrs r4, r0, 16
movs r0, 0x1
ldrsb r0, [r2, r0]
lsls r0, 16
lsrs r5, r0, 16
ldr r0, [sp, 0x10]
cmp r0, 0
2016-01-06 20:23:20 -08:00
beq _080089FC
2015-10-06 05:46:30 -07:00
ldr r0, [r2]
lsls r1, r0, 12
lsrs r1, 30
lsls r1, 2
lsls r0, 14
lsrs r0, 30
lsls r0, 4
adds r1, r0
2015-10-10 05:20:38 -07:00
ldr r0, =gUnknown_082EC754
2015-10-06 05:46:30 -07:00
adds r1, r0
ldrb r1, [r1]
lsls r1, 24
asrs r1, 24
lsls r0, r4, 16
asrs r0, 16
adds r0, r1
lsls r0, 16
lsrs r4, r0, 16
mvns r0, r4
adds r0, 0x1
lsls r0, 16
lsrs r4, r0, 16
2016-01-06 20:23:20 -08:00
_080089FC:
2015-10-06 05:46:30 -07:00
mov r1, r10
cmp r1, 0
2016-01-06 20:23:20 -08:00
beq _08008A2E
2015-10-06 05:46:30 -07:00
ldr r0, [r2]
lsls r1, r0, 12
lsrs r1, 30
lsls r1, 2
lsls r0, 14
lsrs r0, 30
lsls r0, 4
adds r1, r0
2015-10-10 05:20:38 -07:00
ldr r2, =gUnknown_082EC754
2015-10-06 05:46:30 -07:00
adds r1, r2
ldrb r1, [r1, 0x1]
lsls r1, 24
asrs r1, 24
lsls r0, r5, 16
asrs r0, 16
adds r0, r1
lsls r0, 16
lsrs r5, r0, 16
mvns r0, r5
adds r0, 0x1
lsls r0, 16
lsrs r5, r0, 16
2016-01-06 20:23:20 -08:00
_08008A2E:
2015-10-06 05:46:30 -07:00
mov r1, r9
lsls r0, r1, 3
ldr r2, [sp]
adds r3, r0, r2
mov r2, r12
ldr r0, [r2]
ldr r1, [r2, 0x4]
str r0, [r3]
str r1, [r3, 0x4]
ldr r0, [r7, 0x4]
adds r0, r6, r0
ldr r1, [r0]
lsls r1, 14
lsrs r1, 30
lsls r1, 6
ldrb r2, [r3, 0x1]
movs r0, 0x3F
ands r0, r2
orrs r0, r1
strb r0, [r3, 0x1]
ldr r0, [r7, 0x4]
adds r0, r6, r0
ldr r1, [r0]
lsls r1, 12
lsrs r1, 30
lsls r1, 6
ldrb r2, [r3, 0x3]
movs r0, 0x3F
ands r0, r2
orrs r0, r1
strb r0, [r3, 0x3]
lsls r1, r4, 16
asrs r1, 16
ldr r0, [sp, 0x14]
adds r1, r0, r1
ldr r2, =0x000001ff
adds r0, r2, 0
ands r1, r0
ldrh r2, [r3, 0x2]
ldr r0, =0xfffffe00
ands r0, r2
orrs r0, r1
strh r0, [r3, 0x2]
ldr r1, [sp, 0x8]
adds r0, r1, r5
strb r0, [r3]
ldr r0, [r7, 0x4]
adds r0, r6, r0
ldr r1, [r0]
lsls r1, 2
lsrs r1, 22
ldr r2, [sp, 0x4]
adds r1, r2, r1
ldr r2, =0x000003ff
adds r0, r2, 0
ands r1, r0
ldrh r2, [r3, 0x4]
ldr r0, =0xfffffc00
ands r0, r2
orrs r0, r1
strh r0, [r3, 0x4]
ldr r0, [sp, 0x18]
ldrb r1, [r0]
movs r0, 0xC0
ands r0, r1
cmp r0, 0x80
2016-01-06 20:23:20 -08:00
beq _08008ACA
2015-10-06 05:46:30 -07:00
ldr r0, [r7, 0x4]
adds r0, r6, r0
ldr r1, [r0]
lsrs r1, 30
lsls r1, 2
ldrb r2, [r3, 0x5]
movs r0, 0xD
negs r0, r0
ands r0, r2
orrs r0, r1
strb r0, [r3, 0x5]
2016-01-06 20:23:20 -08:00
_08008ACA:
2015-10-06 05:46:30 -07:00
mov r0, r9
adds r0, 0x1
lsls r0, 24
lsrs r0, 24
mov r9, r0
mov r1, r8
ldrb r0, [r1]
adds r0, 0x1
strb r0, [r1]
ldr r2, [sp, 0xC]
cmp r9, r2
2016-01-06 20:23:20 -08:00
bcs _08008AE4
b _080089A6
_08008AE4:
2015-10-06 05:46:30 -07:00
movs r0, 0
2016-01-06 20:23:20 -08:00
_08008AE6:
2015-10-06 05:46:30 -07:00
add sp, 0x1C
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r1}
bx r1
.pool
2015-12-03 00:17:29 -08:00
thumb_func_end AddSpritesFromSpriteOamTable
2016-09-02 23:11:29 -07:00
.align 2, 0 @ Don't pad with nop.