sovereignx/asm/gpu_obj.s

4554 lines
74 KiB
ArmAsm
Raw Normal View History

2015-12-03 08:17:29 +00:00
thumb_func_start ResetAllObjectData
; void ResetAllObjectData()
ResetAllObjectData: ; 8006974
2015-10-06 13:46:30 +01:00
push {r4,lr}
movs r0, 0
movs r1, 0x80
2015-12-03 08:17:29 +00:00
bl ResetSpriteRange
bl RemoveAllObjects
bl ClearObjectCopyRequests
2015-10-06 13:46:30 +01:00
bl rotscale_reset_all
2015-12-03 08:17:29 +00:00
bl FreeAllObjectTiles
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
bl AllocObjectTiles
2015-10-06 13:46:30 +01:00
ldr r0, =0x02021bbc
strh r4, [r0]
ldr r0, =0x02021bbe
strh r4, [r0]
pop {r4}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end ResetAllObjectData
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start CallObjectCallbacks
; void CallObjectCallbacks()
CallObjectCallbacks: ; 80069C0
2015-10-06 13:46:30 +01:00
push {r4-r7,lr}
movs r6, 0
movs r7, 0x1
2015-10-10 11:12:48 +01:00
@080069C6:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @080069F6
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @080069F6
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
2015-12-03 08:17:29 +00:00
bl AnimateObject
2015-10-10 11:12:48 +01:00
@080069F6:
2015-10-06 13:46:30 +01:00
adds r0, r6, 0x1
lsls r0, 24
lsrs r6, r0, 24
cmp r6, 0x3F
2015-10-10 11:12:48 +01:00
bls @080069C6
2015-10-06 13:46:30 +01:00
pop {r4-r7}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end CallObjectCallbacks
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start PrepareSpritesForOamLoad
; void PrepareSpritesForOamLoad()
PrepareSpritesForOamLoad: ; 8006A0C
2015-10-06 13:46:30 +01:00
push {r4,r5,lr}
2015-12-03 08:17:29 +00:00
bl UpdateObjectOamCoords
bl BuildObjectPriorityList
bl SortObjectsByPriority
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
bl PopulateSprites
bl CopyTransformationMatricesToSprites
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
thumb_func_end PrepareSpritesForOamLoad
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start UpdateObjectOamCoords
; void UpdateObjectOamCoords()
UpdateObjectOamCoords: ; 8006A58
2015-10-06 13:46:30 +01:00
push {r4-r7,lr}
movs r4, 0
ldr r7, =0x02020630
ldr r0, =0x000001ff
adds r5, r0, 0
ldr r6, =0xfffffe00
2015-10-10 11:12:48 +01:00
@08006A64:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bne @08006B0A
2015-10-06 13:46:30 +01:00
movs r0, 0x2
ands r0, r1
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @08006AD8
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
b @08006B08
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@08006AD8:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
@08006B08:
2015-10-06 13:46:30 +01:00
strb r0, [r3]
2015-10-10 11:12:48 +01:00
@08006B0A:
2015-10-06 13:46:30 +01:00
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0x3F
2015-10-10 11:12:48 +01:00
bls @08006A64
2015-10-06 13:46:30 +01:00
pop {r4-r7}
pop {r0}
bx r0
2015-12-03 08:17:29 +00:00
thumb_func_end UpdateObjectOamCoords
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start BuildObjectPriorityList
; void BuildObjectPriorityList()
BuildObjectPriorityList: ; 8006B1C
2015-10-06 13:46:30 +01:00
push {r4,lr}
movs r2, 0
ldr r4, =0x02020630
ldr r3, =0x02021774
2015-10-10 11:12:48 +01:00
@08006B24:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bls @08006B24
2015-10-06 13:46:30 +01:00
pop {r4}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end BuildObjectPriorityList
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start SortObjectsByPriority
; void SortObjectsByPriority()
SortObjectsByPriority: ; 8006B5C
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
@08006B78:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
ble @08006BBA
2015-10-06 13:46:30 +01:00
add r0, r9
lsls r0, 16
lsrs r1, r0, 16
2015-10-10 11:12:48 +01:00
@08006BBA:
2015-10-06 13:46:30 +01:00
lsls r0, r2, 16
asrs r0, 16
cmp r0, 0x9F
2015-10-10 11:12:48 +01:00
ble @08006BC8
2015-10-06 13:46:30 +01:00
add r0, r9
lsls r0, 16
lsrs r2, r0, 16
2015-10-10 11:12:48 +01:00
@08006BC8:
2015-10-06 13:46:30 +01:00
ldr r0, [r3]
mov r7, r8
ands r0, r7
cmp r0, r8
2015-10-10 11:12:48 +01:00
bne @08006BEC
2015-10-06 13:46:30 +01:00
ldrb r0, [r3, 0x1]
lsrs r0, 6
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @08006BDE
2015-10-06 13:46:30 +01:00
cmp r0, 0x2
2015-10-10 11:12:48 +01:00
bne @08006BEC
@08006BDE:
2015-10-06 13:46:30 +01:00
lsls r0, r1, 16
asrs r0, 16
cmp r0, 0x80
2015-10-10 11:12:48 +01:00
ble @08006BEC
2015-10-06 13:46:30 +01:00
add r0, r9
lsls r0, 16
lsrs r1, r0, 16
2015-10-10 11:12:48 +01:00
@08006BEC:
2015-10-06 13:46:30 +01:00
ldr r0, [r4]
mov r3, r8
ands r0, r3
cmp r0, r8
2015-10-10 11:12:48 +01:00
bne @08006C10
2015-10-06 13:46:30 +01:00
ldrb r0, [r4, 0x1]
lsrs r0, 6
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @08006C02
2015-10-06 13:46:30 +01:00
cmp r0, 0x2
2015-10-10 11:12:48 +01:00
bne @08006C10
@08006C02:
2015-10-06 13:46:30 +01:00
lsls r0, r2, 16
asrs r0, 16
cmp r0, 0x80
2015-10-10 11:12:48 +01:00
ble @08006C10
2015-10-06 13:46:30 +01:00
add r0, r9
lsls r0, 16
lsrs r2, r0, 16
2015-10-10 11:12:48 +01:00
@08006C10:
2015-10-06 13:46:30 +01:00
movs r7, 0x1
add r12, r7
cmp r5, 0
2015-10-10 11:12:48 +01:00
beq @08006CF6
2015-10-06 13:46:30 +01:00
ldr r0, [sp]
cmp r0, r6
2015-10-10 11:12:48 +01:00
bhi @08006C38
2015-10-06 13:46:30 +01:00
cmp r0, r6
2015-10-10 11:12:48 +01:00
bne @08006CF6
b @08006CEE
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@08006C38:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
ble @08006C8A
2015-10-06 13:46:30 +01:00
add r0, r9
lsls r0, 16
lsrs r1, r0, 16
2015-10-10 11:12:48 +01:00
@08006C8A:
2015-10-06 13:46:30 +01:00
lsls r0, r2, 16
asrs r0, 16
cmp r0, 0x9F
2015-10-10 11:12:48 +01:00
ble @08006C98
2015-10-06 13:46:30 +01:00
add r0, r9
lsls r0, 16
lsrs r2, r0, 16
2015-10-10 11:12:48 +01:00
@08006C98:
2015-10-06 13:46:30 +01:00
ldr r0, [r3]
mov r7, r8
ands r0, r7
cmp r0, r8
2015-10-10 11:12:48 +01:00
bne @08006CBC
2015-10-06 13:46:30 +01:00
ldrb r0, [r3, 0x1]
lsrs r0, 6
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @08006CAE
2015-10-06 13:46:30 +01:00
cmp r0, 0x2
2015-10-10 11:12:48 +01:00
bne @08006CBC
@08006CAE:
2015-10-06 13:46:30 +01:00
lsls r0, r1, 16
asrs r0, 16
cmp r0, 0x80
2015-10-10 11:12:48 +01:00
ble @08006CBC
2015-10-06 13:46:30 +01:00
add r0, r9
lsls r0, 16
lsrs r1, r0, 16
2015-10-10 11:12:48 +01:00
@08006CBC:
2015-10-06 13:46:30 +01:00
ldr r0, [r4]
mov r3, r8
ands r0, r3
cmp r0, r8
2015-10-10 11:12:48 +01:00
bne @08006CE0
2015-10-06 13:46:30 +01:00
ldrb r0, [r4, 0x1]
lsrs r0, 6
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @08006CD2
2015-10-06 13:46:30 +01:00
cmp r0, 0x2
2015-10-10 11:12:48 +01:00
bne @08006CE0
@08006CD2:
2015-10-06 13:46:30 +01:00
lsls r0, r2, 16
asrs r0, 16
cmp r0, 0x80
2015-10-10 11:12:48 +01:00
ble @08006CE0
2015-10-06 13:46:30 +01:00
add r0, r9
lsls r0, 16
lsrs r2, r0, 16
2015-10-10 11:12:48 +01:00
@08006CE0:
2015-10-06 13:46:30 +01:00
cmp r5, 0
2015-10-10 11:12:48 +01:00
beq @08006CF6
2015-10-06 13:46:30 +01:00
ldr r7, [sp]
cmp r7, r6
2015-10-10 11:12:48 +01:00
bhi @08006C38
2015-10-06 13:46:30 +01:00
cmp r7, r6
2015-10-10 11:12:48 +01:00
bne @08006CF6
@08006CEE:
2015-10-06 13:46:30 +01:00
lsls r1, 16
lsls r0, r2, 16
cmp r1, r0
2015-10-10 11:12:48 +01:00
blt @08006C38
@08006CF6:
2015-10-06 13:46:30 +01:00
mov r1, r12
lsls r0, r1, 24
lsrs r0, 24
mov r12, r0
cmp r0, 0x3F
2015-10-10 11:12:48 +01:00
bhi @08006D04
b @08006B78
@08006D04:
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
thumb_func_end SortObjectsByPriority
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start CopyTransformationMatricesToSprites
; void CopyTransformationMatricesToSprites()
CopyTransformationMatricesToSprites: ; 8006D1C
2015-10-06 13:46:30 +01:00
push {r4-r6,lr}
movs r4, 0
ldr r5, =0x030022c0
ldr r6, =0x02021bc0
2015-10-10 11:12:48 +01:00
@08006D24:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bls @08006D24
2015-10-06 13:46:30 +01:00
pop {r4-r6}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end CopyTransformationMatricesToSprites
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start PopulateSprites
; void PopulateSprites()
PopulateSprites: ; 8006D68
2015-10-06 13:46:30 +01:00
push {r4-r6,lr}
sub sp, 0x4
movs r4, 0
mov r0, sp
strb r4, [r0]
2015-10-10 11:12:48 +01:00
@08006D72:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bne @08006D9E
2015-10-06 13:46:30 +01:00
adds r0, r2, 0
mov r1, sp
2015-12-03 08:17:29 +00:00
bl AddSprite
2015-10-06 13:46:30 +01:00
lsls r0, 24
cmp r0, 0
2015-10-10 11:12:48 +01:00
bne @08006DD8
@08006D9E:
2015-10-06 13:46:30 +01:00
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0x3F
2015-10-10 11:12:48 +01:00
bls @08006D72
2015-10-06 13:46:30 +01:00
mov r0, sp
ldr r4, =0x02021b38
ldrb r0, [r0]
ldrb r1, [r4]
cmp r0, r1
2015-10-10 11:12:48 +01:00
bcs @08006DD8
2015-10-06 13:46:30 +01:00
mov r1, sp
ldr r5, =0x030022f8
2015-11-26 00:43:06 +00:00
ldr r0, =gDefaultOamAttributes
2015-10-06 13:46:30 +01:00
ldr r2, [r0]
ldr r3, [r0, 0x4]
2015-10-10 11:12:48 +01:00
@08006DBE:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bcc @08006DBE
@08006DD8:
2015-10-06 13:46:30 +01:00
add sp, 0x4
pop {r4-r6}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end PopulateSprites
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start AddObjectToFront
; u8 AddObjectToFront(struct objtemplate *template, u16 x, u16 y, u8 subpriority)
AddObjectToFront: ; 8006DF4
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
@08006E08:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bne @08006E34
2015-10-06 13:46:30 +01:00
str r4, [sp]
adds r0, r3, 0
adds r1, r7, 0
asrs r2, r5, 16
asrs r3, r6, 16
2015-12-03 08:17:29 +00:00
bl AddObject
2015-10-06 13:46:30 +01:00
lsls r0, 24
lsrs r0, 24
2015-10-10 11:12:48 +01:00
b @08006E40
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@08006E34:
2015-10-06 13:46:30 +01:00
adds r0, r3, 0x1
lsls r0, 24
lsrs r3, r0, 24
cmp r3, 0x3F
2015-10-10 11:12:48 +01:00
bls @08006E08
2015-10-06 13:46:30 +01:00
movs r0, 0x40
2015-10-10 11:12:48 +01:00
@08006E40:
2015-10-06 13:46:30 +01:00
add sp, 0x4
pop {r4-r7}
pop {r1}
bx r1
2015-12-03 08:17:29 +00:00
thumb_func_end AddObjectToFront
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start AddObjectToBack
; u8 AddObjectToBack(struct objtemplate *template, u16 x, u16 y, u8 subpriority)
AddObjectToBack: ; 8006E48
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
@08006E66:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bne @08006E98
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
bl AddObject
2015-10-06 13:46:30 +01:00
lsls r0, 24
lsrs r0, 24
2015-10-10 11:12:48 +01:00
b @08006EA6
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@08006E98:
2015-10-06 13:46:30 +01:00
subs r0, r1, 0x1
lsls r0, 16
lsrs r3, r0, 16
asrs r0, 16
cmp r0, r12
2015-10-10 11:12:48 +01:00
bgt @08006E66
2015-10-06 13:46:30 +01:00
movs r0, 0x40
2015-10-10 11:12:48 +01:00
@08006EA6:
2015-10-06 13:46:30 +01:00
add sp, 0x4
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r1}
bx r1
2015-12-03 08:17:29 +00:00
thumb_func_end AddObjectToBack
2015-10-06 13:46:30 +01:00
thumb_func_start obj_add_empty_with_callback
2015-10-10 11:12:48 +01:00
; int obj_add_empty_with_callback(void ( *func)())
obj_add_empty_with_callback: ; 8006EB4
2015-10-06 13:46:30 +01:00
push {r4-r6,lr}
adds r6, r0, 0
2015-10-10 13:20:38 +01:00
ldr r0, =gUnknown_082EC6AC
2015-10-06 13:46:30 +01:00
movs r1, 0
movs r2, 0
movs r3, 0x1F
2015-12-03 08:17:29 +00:00
bl AddObjectToFront
2015-10-06 13:46:30 +01:00
lsls r0, 24
lsrs r5, r0, 24
cmp r5, 0x40
2015-10-10 11:12:48 +01:00
beq @08006EF4
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
b @08006EF6
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@08006EF4:
2015-10-06 13:46:30 +01:00
movs r0, 0x40
2015-10-10 11:12:48 +01:00
@08006EF6:
2015-10-06 13:46:30 +01:00
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end obj_add_empty_with_callback
2015-12-03 08:17:29 +00:00
thumb_func_start AddObject
; u8 AddObject(u8 index, struct objtemplate *template, u16 x, u16 y, u8 subpriority)
AddObject: ; 8006EFC
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
bl RemoveObject
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
bl CalcVecFromObjectCenterToObjectUpperLeft
2015-10-06 13:46:30 +01:00
mov r0, r8
ldrh r1, [r0]
ldr r4, =0xffff0000
lsrs r0, r4, 16
cmp r1, r0
2015-10-10 11:12:48 +01:00
bne @08006FF8
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
bl AllocObjectTiles
2015-10-06 13:46:30 +01:00
lsls r0, 16
lsrs r2, r0, 16
asrs r0, 16
asrs r1, r4, 16
cmp r0, r1
2015-10-10 11:12:48 +01:00
bne @08006FC8
2015-10-06 13:46:30 +01:00
adds r0, r7, 0
2015-12-03 08:17:29 +00:00
bl RemoveObject
2015-10-06 13:46:30 +01:00
movs r0, 0x40
2015-10-10 11:12:48 +01:00
b @08007040
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@08006FC8:
2015-10-06 13:46:30 +01: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]
2015-10-10 11:12:48 +01:00
b @0800700C
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@08006FF8:
2015-10-06 13:46:30 +01:00
mov r1, r8
ldrh r0, [r1]
2015-12-03 08:17:29 +00:00
bl GetObjectTileRangeStartByTag
2015-10-06 13:46:30 +01:00
adds r1, r7, 0
adds r1, 0x40
strh r0, [r1]
adds r0, r7, 0
bl sub_8008324
2015-10-10 11:12:48 +01:00
@0800700C:
2015-10-06 13:46:30 +01:00
ldrb r0, [r7, 0x1]
lsls r0, 30
lsrs r0, 30
movs r1, 0x1
ands r0, r1
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @08007020
2015-10-06 13:46:30 +01:00
adds r0, r7, 0
bl obj_alloc_rotscale_entry
2015-10-10 11:12:48 +01:00
@08007020:
2015-10-06 13:46:30 +01:00
mov r0, r8
ldrh r1, [r0, 0x2]
ldr r0, =0x0000ffff
cmp r1, r0
2015-10-10 11:12:48 +01:00
beq @0800703E
2015-10-06 13:46:30 +01:00
mov r1, r8
ldrh r0, [r1, 0x2]
2015-12-03 08:17:29 +00:00
bl IndexOfObjectPaletteTag
2015-10-06 13:46:30 +01:00
lsls r0, 4
ldrb r2, [r7, 0x5]
movs r1, 0xF
ands r1, r2
orrs r1, r0
strb r1, [r7, 0x5]
2015-10-10 11:12:48 +01:00
@0800703E:
2015-10-06 13:46:30 +01:00
mov r0, r10
2015-10-10 11:12:48 +01:00
@08007040:
2015-10-06 13:46:30 +01:00
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r1}
bx r1
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end AddObject
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start AddObjectAndAnimateForOneFrame
; u8 AddObjectAndAnimateForOneFrame(struct objtemplate *template, u16 x, u16 y, u8 subpriority)
AddObjectAndAnimateForOneFrame: ; 8007054
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
@08007074:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bne @080070CC
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
bl AddObject
2015-10-06 13:46:30 +01:00
lsls r0, 24
lsrs r0, 24
adds r5, r0, 0
cmp r5, 0x40
2015-10-10 11:12:48 +01:00
beq @080070D6
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @080070C0
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
2015-12-03 08:17:29 +00:00
bl AnimateObject
2015-10-10 11:12:48 +01:00
@080070C0:
2015-10-06 13:46:30 +01:00
adds r0, r5, 0
2015-10-10 11:12:48 +01:00
b @080070D8
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@080070CC:
2015-10-06 13:46:30 +01:00
adds r0, r3, 0x1
lsls r0, 24
lsrs r3, r0, 24
cmp r3, 0x3F
2015-10-10 11:12:48 +01:00
bls @08007074
@080070D6:
2015-10-06 13:46:30 +01:00
movs r0, 0x40
2015-10-10 11:12:48 +01:00
@080070D8:
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
thumb_func_end AddObjectAndAnimateForOneFrame
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start RemoveObjectAndFreeTiles
; void RemoveObjectAndFreeTiles(struct obj *object)
RemoveObjectAndFreeTiles: ; 80070E8
2015-10-06 13:46:30 +01:00
push {r4-r7,lr}
adds r5, r0, 0
adds r0, 0x3E
ldrb r1, [r0]
movs r0, 0x1
ands r0, r1
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @08007144
2015-10-06 13:46:30 +01:00
adds r0, r5, 0
adds r0, 0x3F
ldrb r1, [r0]
movs r0, 0x40
ands r0, r1
cmp r0, 0
2015-10-10 11:12:48 +01:00
bne @0800713E
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bcs @0800713E
2015-10-06 13:46:30 +01:00
ldr r0, =0x02021b3c
mov r12, r0
movs r6, 0x7
movs r7, 0x1
2015-10-10 11:12:48 +01:00
@08007122:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bcc @08007122
@0800713E:
2015-10-06 13:46:30 +01:00
adds r0, r5, 0
2015-12-03 08:17:29 +00:00
bl RemoveObject
2015-10-10 11:12:48 +01:00
@08007144:
2015-10-06 13:46:30 +01:00
pop {r4-r7}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end RemoveObjectAndFreeTiles
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start ResetSpriteRange
; void ResetSpriteRange(u8 startIndex, u8 endIndex)
ResetSpriteRange: ; 8007150
2015-10-06 13:46:30 +01:00
push {r4-r6,lr}
lsls r0, 24
lsls r1, 24
lsrs r4, r1, 24
lsrs r3, r0, 24
cmp r3, r4
2015-10-10 11:12:48 +01:00
bcs @08007178
2015-10-06 13:46:30 +01:00
ldr r6, =0x030022f8
2015-11-26 00:43:06 +00:00
ldr r5, =gDefaultOamAttributes
2015-10-10 11:12:48 +01:00
@08007162:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bcc @08007162
@08007178:
2015-10-06 13:46:30 +01:00
pop {r4-r6}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end ResetSpriteRange
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start LoadOamFromSprites
; void LoadOamFromSprites()
LoadOamFromSprites: ; 8007188
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bne @080071A8
2015-10-06 13:46:30 +01:00
adds r0, r2, 0
adds r0, 0x38
movs r1, 0xE0
lsls r1, 19
ldr r2, =0x04000100
bl CpuSet
2015-10-10 11:12:48 +01:00
@080071A8:
2015-10-06 13:46:30 +01:00
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end LoadOamFromSprites
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start ClearObjectCopyRequests
; void ClearObjectCopyRequests()
ClearObjectCopyRequests: ; 80071B8
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
@080071CC:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bls @080071CC
2015-10-06 13:46:30 +01:00
pop {r4,r5}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end ClearObjectCopyRequests
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start ResetSpriteTransformationMatrices
; void ResetSpriteTransformationMatrices()
ResetSpriteTransformationMatrices: ; 80071F8
2015-10-06 13:46:30 +01:00
push {r4,lr}
movs r1, 0
ldr r4, =0x02021bc0
movs r3, 0
movs r2, 0x80
lsls r2, 1
2015-10-10 11:12:48 +01:00
@08007204:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bls @08007204
2015-10-06 13:46:30 +01:00
pop {r4}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end ResetSpriteTransformationMatrices
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start SetSpriteTransformationMatrix
; void SetSpriteTransformationMatrix(u8 index, u16 a, u16 b, u16 c, u16 d)
SetSpriteTransformationMatrix: ; 8007224
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
thumb_func_end SetSpriteTransformationMatrix
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start RemoveObject
; void RemoveObject(struct obj *object)
RemoveObject: ; 8007244
2015-10-06 13:46:30 +01:00
push {lr}
2015-10-10 13:20:38 +01:00
ldr r1, =gUnknown_082EC64C
2015-10-06 13:46:30 +01:00
movs r2, 0x44
bl memcpy
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end RemoveObject
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start CalcVecFromObjectCenterToObjectUpperLeft
; void CalcVecFromObjectCenterToObjectUpperLeft(struct obj *object, u8 shape, u8 size, u8 affineMode)
CalcVecFromObjectCenterToObjectUpperLeft: ; 8007258
2015-10-06 13:46:30 +01:00
push {r4-r6,lr}
adds r6, r0, 0
lsls r1, 24
lsls r2, 24
lsls r3, 24
lsrs r3, 24
2015-10-10 13:20:38 +01:00
ldr r4, =gUnknown_082EC634
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @08007286
2015-10-06 13:46:30 +01:00
lsls r0, r5, 25
lsrs r5, r0, 24
lsls r0, r1, 25
lsrs r1, r0, 24
2015-10-10 11:12:48 +01:00
@08007286:
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
thumb_func_end CalcVecFromObjectCenterToObjectUpperLeft
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start AllocObjectTiles
; s16 AllocObjectTiles(u16 numTiles)
AllocObjectTiles: ; 800729C
2015-10-06 13:46:30 +01:00
push {r4-r7,lr}
mov r7, r9
mov r6, r8
push {r6,r7}
lsls r0, 16
lsrs r4, r0, 16
cmp r4, 0
2015-10-10 11:12:48 +01:00
bne @080072F2
2015-10-06 13:46:30 +01:00
ldr r0, =0x02021b3a
ldrh r3, [r0]
ldr r0, =0x000003ff
cmp r3, r0
2015-10-10 11:12:48 +01:00
bhi @080072DA
2015-10-06 13:46:30 +01:00
ldr r7, =0x02021b3c
movs r6, 0x7
adds r4, r0, 0
movs r5, 0x1
2015-10-10 11:12:48 +01:00
@080072BE:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bls @080072BE
@080072DA:
2015-10-06 13:46:30 +01:00
movs r0, 0
2015-10-10 11:12:48 +01:00
b @080073A4
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@080072EC:
2015-10-06 13:46:30 +01:00
movs r0, 0x1
negs r0, r0
2015-10-10 11:12:48 +01:00
b @080073A4
@080072F2:
2015-10-06 13:46:30 +01:00
ldr r0, =0x02021b3a
ldrh r3, [r0]
ldr r0, =0x02021b3c
mov r9, r0
movs r7, 0x7
movs r6, 0x1
2015-10-10 11:12:48 +01:00
@080072FE:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @08007332
2015-10-06 13:46:30 +01:00
movs r5, 0x80
lsls r5, 3
ldr r2, =0x02021b3c
2015-10-10 11:12:48 +01:00
@08007316:
2015-10-06 13:46:30 +01:00
adds r0, r3, 0x1
lsls r0, 16
lsrs r3, r0, 16
cmp r3, r5
2015-10-10 11:12:48 +01:00
beq @080072EC
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bne @08007316
@08007332:
2015-10-06 13:46:30 +01:00
mov r8, r3
movs r2, 0x1
cmp r2, r4
2015-10-10 11:12:48 +01:00
beq @0800736C
2015-10-06 13:46:30 +01:00
movs r1, 0x80
lsls r1, 3
mov r12, r1
ldr r5, =0x02021b3c
2015-10-10 11:12:48 +01:00
@08007342:
2015-10-06 13:46:30 +01:00
adds r0, r3, 0x1
lsls r0, 16
lsrs r3, r0, 16
cmp r3, r12
2015-10-10 11:12:48 +01:00
beq @080072EC
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bne @08007368
2015-10-06 13:46:30 +01:00
adds r0, r2, 0x1
lsls r0, 16
lsrs r2, r0, 16
cmp r2, r4
2015-10-10 11:12:48 +01:00
bne @08007342
@08007368:
2015-10-06 13:46:30 +01:00
cmp r2, r4
2015-10-10 11:12:48 +01:00
bne @080072FE
@0800736C:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bge @080073A2
2015-10-06 13:46:30 +01:00
ldr r0, =0x02021b3c
mov r8, r0
movs r7, 0x7
adds r4, r1, 0
movs r5, 0x1
2015-10-10 11:12:48 +01:00
@08007386:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
blt @08007386
@080073A2:
2015-10-06 13:46:30 +01:00
asrs r0, r6, 16
2015-10-10 11:12:48 +01:00
@080073A4:
2015-10-06 13:46:30 +01:00
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r1}
bx r1
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end AllocObjectTiles
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start Unused_ObjectTileAllocationBitArrayOp
; unsigned int Unused_ObjectTileAllocationBitArrayOp(u16 tileNum, u8 op)
Unused_ObjectTileAllocationBitArrayOp: ; 80073B8
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bne @080073F0
2015-10-06 13:46:30 +01: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]
2015-10-10 11:12:48 +01:00
b @0800741C
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@080073F0:
2015-10-06 13:46:30 +01:00
cmp r1, 0x1
2015-10-10 11:12:48 +01:00
bne @0800740C
2015-10-06 13:46:30 +01: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]
2015-10-10 11:12:48 +01:00
b @0800741C
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@0800740C:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
@0800741C:
2015-10-06 13:46:30 +01:00
adds r0, r5, 0
pop {r4-r6}
pop {r1}
bx r1
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end Unused_ObjectTileAllocationBitArrayOp
2015-10-06 13:46:30 +01:00
2015-11-29 05:21:42 +00:00
thumb_func_start DummyObjectCallback
2015-12-03 08:17:29 +00:00
; void DummyObjectCallback(struct obj *object)
2015-11-29 05:21:42 +00:00
DummyObjectCallback: ; 8007428
2015-10-06 13:46:30 +01:00
bx lr
2015-11-29 05:21:42 +00:00
thumb_func_end DummyObjectCallback
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start ProcessObjectCopyRequests
; void ProcessObjectCopyRequests()
ProcessObjectCopyRequests: ; 800742C
2015-10-06 13:46:30 +01:00
push {r4-r7,lr}
ldr r0, =0x02021834
ldrb r0, [r0]
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @08007474
2015-10-06 13:46:30 +01:00
movs r4, 0
ldr r1, =0x02021835
ldrb r0, [r1]
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @0800746E
2015-10-06 13:46:30 +01:00
ldr r6, =0x02021838
adds r7, r6, 0x4
adds r5, r1, 0
2015-10-10 11:12:48 +01:00
@08007446:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bne @08007446
@0800746E:
2015-10-06 13:46:30 +01:00
ldr r1, =0x02021834
movs r0, 0
strb r0, [r1]
2015-10-10 11:12:48 +01:00
@08007474:
2015-10-06 13:46:30 +01:00
pop {r4-r7}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end ProcessObjectCopyRequests
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start AddPicToObjectCopyRequests
; void AddPicToObjectCopyRequests(u16 picIndex, u16 targetTileNum, struct obj_tiles *pics)
AddPicToObjectCopyRequests: ; 8007488
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bhi @080074D8
2015-10-06 13:46:30 +01: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]
2015-10-10 11:12:48 +01:00
@080074D8:
2015-10-06 13:46:30 +01:00
pop {r4-r6}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end AddPicToObjectCopyRequests
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start AddTilesToObjectCopyRequests
; void AddTilesToObjectCopyRequests(void *src, void *dest, u16 size)
AddTilesToObjectCopyRequests: ; 80074EC
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bhi @0800752C
2015-10-06 13:46:30 +01: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]
2015-10-10 11:12:48 +01:00
@0800752C:
2015-10-06 13:46:30 +01:00
pop {r4-r6}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end AddTilesToObjectCopyRequests
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start Unused_CopyFromObjects
; void Unused_CopyFromObjects(void *dest)
Unused_CopyFromObjects: ; 800753C
2015-10-06 13:46:30 +01:00
push {r4,lr}
adds r1, r0, 0
ldr r3, =0x02020630
movs r2, 0
ldr r4, =0x000010ff
2015-10-10 11:12:48 +01:00
@08007546:
2015-10-06 13:46:30 +01:00
ldrb r0, [r3]
strb r0, [r1]
adds r1, 0x1
adds r3, 0x1
adds r2, 0x1
cmp r2, r4
2015-10-10 11:12:48 +01:00
bls @08007546
2015-10-06 13:46:30 +01:00
pop {r4}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end Unused_CopyFromObjects
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start Unused_CopyToObjects
; void Unused_CopyToObjects(void *src)
Unused_CopyToObjects: ; 8007564
2015-10-06 13:46:30 +01:00
push {r4,lr}
adds r1, r0, 0
ldr r3, =0x02020630
movs r2, 0
ldr r4, =0x000010ff
2015-10-10 11:12:48 +01:00
@0800756E:
2015-10-06 13:46:30 +01:00
ldrb r0, [r1]
strb r0, [r3]
adds r1, 0x1
adds r3, 0x1
adds r2, 0x1
cmp r2, r4
2015-10-10 11:12:48 +01:00
bls @0800756E
2015-10-06 13:46:30 +01:00
pop {r4}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end Unused_CopyToObjects
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start RemoveAllObjects
; void RemoveAllObjects()
RemoveAllObjects: ; 800758C
2015-10-06 13:46:30 +01:00
push {r4,r5,lr}
movs r4, 0
2015-10-10 11:12:48 +01:00
@08007590:
2015-10-06 13:46:30 +01:00
lsls r0, r4, 4
adds r0, r4
lsls r0, 2
ldr r5, =0x02020630
adds r0, r5
2015-12-03 08:17:29 +00:00
bl RemoveObject
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bls @08007590
2015-10-06 13:46:30 +01:00
lsls r0, r4, 4
adds r0, r4
lsls r0, 2
adds r0, r5
2015-12-03 08:17:29 +00:00
bl RemoveObject
2015-10-06 13:46:30 +01:00
pop {r4,r5}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end RemoveAllObjects
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start FreeObjectTiles
; void FreeObjectTiles(struct obj *object)
FreeObjectTiles: ; 80075C8
2015-10-06 13:46:30 +01:00
push {lr}
ldr r2, [r0, 0x14]
ldrh r1, [r2]
ldr r0, =0x0000ffff
cmp r1, r0
2015-10-10 11:12:48 +01:00
beq @080075DA
2015-10-06 13:46:30 +01:00
adds r0, r1, 0
2015-12-03 08:17:29 +00:00
bl FreeObjectTilesByTag
2015-10-10 11:12:48 +01:00
@080075DA:
2015-10-06 13:46:30 +01:00
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end FreeObjectTiles
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start FreeObjectPalette
; void FreeObjectPalette(struct obj *object)
FreeObjectPalette: ; 80075E4
2015-10-06 13:46:30 +01:00
push {lr}
ldr r0, [r0, 0x14]
ldrh r0, [r0, 0x2]
2015-12-03 08:17:29 +00:00
bl FreeObjectPaletteByTag
2015-10-06 13:46:30 +01:00
pop {r0}
bx r0
2015-12-03 08:17:29 +00:00
thumb_func_end FreeObjectPalette
2015-10-06 13:46:30 +01:00
thumb_func_start obj_free_rotscale_entry
2015-10-10 11:12:48 +01:00
; void obj_free_rotscale_entry(struct obj *obj)
obj_free_rotscale_entry: ; 80075F4
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @0800761A
2015-10-06 13:46:30 +01: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]
2015-10-10 11:12:48 +01:00
@0800761A:
2015-10-06 13:46:30 +01:00
pop {r4}
pop {r0}
bx r0
thumb_func_end obj_free_rotscale_entry
2015-12-03 08:17:29 +00:00
thumb_func_start RemoveObjectAndFreeResources
; void RemoveObjectAndFreeResources(struct obj *object)
RemoveObjectAndFreeResources: ; 8007620
2015-10-06 13:46:30 +01:00
push {r4,lr}
adds r4, r0, 0
2015-12-03 08:17:29 +00:00
bl FreeObjectTiles
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
2015-12-03 08:17:29 +00:00
bl FreeObjectPalette
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
bl obj_free_rotscale_entry
adds r0, r4, 0
2015-12-03 08:17:29 +00:00
bl RemoveObjectAndFreeTiles
2015-10-06 13:46:30 +01:00
pop {r4}
pop {r0}
bx r0
2015-12-03 08:17:29 +00:00
thumb_func_end RemoveObjectAndFreeResources
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start AnimateObject
; void AnimateObject(struct obj *object)
AnimateObject: ; 8007640
2015-10-06 13:46:30 +01:00
push {r4,r5,lr}
adds r4, r0, 0
2015-10-10 13:20:38 +01:00
ldr r2, =gUnknown_082EC6C4
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bne @08007676
2015-10-10 13:20:38 +01:00
ldr r0, =gUnknown_082EC6CC
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
@08007676:
2015-10-06 13:46:30 +01:00
pop {r4,r5}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end AnimateObject
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start BeginObjectImageAnim
; void BeginObjectImageAnim(struct obj *object)
BeginObjectImageAnim: ; 8007688
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @0800776C
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @08007704
2015-10-06 13:46:30 +01:00
subs r0, r3, 0x1
lsls r0, 24
lsrs r3, r0, 24
2015-10-10 11:12:48 +01:00
@08007704:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bne @0800772E
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
adds r1, r7, 0
adds r2, r6, 0
bl obj_set_horizonal_and_vertical_flip
2015-10-10 11:12:48 +01:00
@0800772E:
2015-10-06 13:46:30 +01:00
ldrb r1, [r5]
movs r0, 0x40
ands r0, r1
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @0800775C
2015-10-06 13:46:30 +01: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]
2015-10-10 11:12:48 +01:00
b @0800776C
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@0800775C:
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
bl AddPicToObjectCopyRequests
2015-10-10 11:12:48 +01:00
@0800776C:
2015-10-06 13:46:30 +01:00
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r0}
bx r0
2015-12-03 08:17:29 +00:00
thumb_func_end BeginObjectImageAnim
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start ContinueObjectImageAnim
; void ContinueObjectImageAnim(struct obj *object)
ContinueObjectImageAnim: ; 8007778
2015-10-06 13:46:30 +01:00
push {r4,lr}
adds r4, r0, 0
adds r0, 0x2C
ldrb r1, [r0]
movs r0, 0x3F
ands r0, r1
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @080077C8
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bne @0800780E
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
adds r1, r3, 0
bl obj_set_horizonal_and_vertical_flip
2015-10-10 11:12:48 +01:00
b @0800780E
@080077C8:
2015-10-06 13:46:30 +01:00
movs r0, 0x40
ands r0, r1
cmp r0, 0
2015-10-10 11:12:48 +01:00
bne @0800780E
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bge @080077FE
2015-10-06 13:46:30 +01:00
adds r0, 0x3
lsls r0, 16
lsrs r2, r0, 16
2015-10-10 11:12:48 +01:00
@080077FE:
2015-10-10 13:20:38 +01:00
ldr r0, =gUnknown_082EC6D4
2015-10-06 13:46:30 +01:00
lsls r1, r2, 16
asrs r1, 14
adds r1, r0
ldr r1, [r1]
adds r0, r4, 0
bl _call_via_r1
2015-10-10 11:12:48 +01:00
@0800780E:
2015-10-06 13:46:30 +01:00
pop {r4}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end ContinueObjectImageAnim
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start ImageAnimCmd_frame
; void ImageAnimCmd_frame(struct obj *object)
ImageAnimCmd_frame: ; 8007818
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @08007852
2015-10-06 13:46:30 +01:00
subs r0, r3, 0x1
lsls r0, 24
lsrs r3, r0, 24
2015-10-10 11:12:48 +01:00
@08007852:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bne @0800787C
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
adds r1, r6, 0
adds r2, r5, 0
bl obj_set_horizonal_and_vertical_flip
2015-10-10 11:12:48 +01:00
@0800787C:
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
adds r0, 0x3F
ldrb r1, [r0]
movs r0, 0x40
ands r0, r1
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @080078AC
2015-10-06 13:46:30 +01: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]
2015-10-10 11:12:48 +01:00
b @080078BA
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@080078AC:
2015-10-06 13:46:30 +01:00
mov r0, r8
ldrh r1, [r4, 0x4]
lsls r1, 22
lsrs r1, 22
ldr r2, [r4, 0xC]
2015-12-03 08:17:29 +00:00
bl AddPicToObjectCopyRequests
2015-10-10 11:12:48 +01:00
@080078BA:
2015-10-06 13:46:30 +01:00
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
2015-12-03 08:17:29 +00:00
thumb_func_end ImageAnimCmd_frame
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start ImageAnimCmd_end
; void ImageAnimCmd_end(struct obj *object)
ImageAnimCmd_end: ; 80078C4
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
thumb_func_end ImageAnimCmd_end
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start ImageAnimCmd_jump
; void ImageAnimCmd_jump(struct obj *object)
ImageAnimCmd_jump: ; 80078DC
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @08007930
2015-10-06 13:46:30 +01:00
subs r0, r3, 0x1
lsls r0, 24
lsrs r3, r0, 24
2015-10-10 11:12:48 +01:00
@08007930:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bne @0800795A
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
adds r1, r6, 0
adds r2, r5, 0
bl obj_set_horizonal_and_vertical_flip
2015-10-10 11:12:48 +01:00
@0800795A:
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
adds r0, 0x3F
ldrb r1, [r0]
movs r0, 0x40
ands r0, r1
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @0800798C
2015-10-06 13:46:30 +01: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]
2015-10-10 11:12:48 +01:00
b @0800799A
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@0800798C:
2015-10-06 13:46:30 +01:00
mov r0, r8
ldrh r1, [r4, 0x4]
lsls r1, 22
lsrs r1, 22
ldr r2, [r4, 0xC]
2015-12-03 08:17:29 +00:00
bl AddPicToObjectCopyRequests
2015-10-10 11:12:48 +01:00
@0800799A:
2015-10-06 13:46:30 +01:00
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
2015-12-03 08:17:29 +00:00
thumb_func_end ImageAnimCmd_jump
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start ImageAnimCmd_loop
; void ImageAnimCmd_loop(struct obj *object)
ImageAnimCmd_loop: ; 80079A4
2015-10-06 13:46:30 +01:00
push {lr}
adds r1, r0, 0
adds r0, 0x2D
ldrb r0, [r0]
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @080079B8
2015-10-06 13:46:30 +01:00
adds r0, r1, 0
2015-12-03 08:17:29 +00:00
bl ContinueImageAnimLoop
2015-10-10 11:12:48 +01:00
b @080079BE
@080079B8:
2015-10-06 13:46:30 +01:00
adds r0, r1, 0
2015-12-03 08:17:29 +00:00
bl BeginImageAnimLoop
2015-10-10 11:12:48 +01:00
@080079BE:
2015-10-06 13:46:30 +01:00
pop {r0}
bx r0
2015-12-03 08:17:29 +00:00
thumb_func_end ImageAnimCmd_loop
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start BeginImageAnimLoop
; void BeginImageAnimLoop(struct obj *object)
BeginImageAnimLoop: ; 80079C4
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
bl JumpToTopOfImageAnimLoop
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
2015-12-03 08:17:29 +00:00
bl ContinueObjectImageAnim
2015-10-06 13:46:30 +01:00
pop {r4}
pop {r0}
bx r0
2015-12-03 08:17:29 +00:00
thumb_func_end BeginImageAnimLoop
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start ContinueImageAnimLoop
; void ContinueImageAnimLoop(struct obj *object)
ContinueImageAnimLoop: ; 80079FC
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
bl JumpToTopOfImageAnimLoop
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
2015-12-03 08:17:29 +00:00
bl ContinueObjectImageAnim
2015-10-06 13:46:30 +01:00
pop {r4}
pop {r0}
bx r0
2015-12-03 08:17:29 +00:00
thumb_func_end ContinueImageAnimLoop
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start JumpToTopOfImageAnimLoop
; void JumpToTopOfImageAnimLoop(struct obj *object)
JumpToTopOfImageAnimLoop: ; 8007A1C
2015-10-06 13:46:30 +01:00
push {r4-r7,lr}
mov r12, r0
adds r0, 0x2D
ldrb r0, [r0]
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @08007A88
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @08007A82
2015-10-06 13:46:30 +01:00
adds r6, r1, 0
adds r2, r4, 0
2015-10-10 11:12:48 +01:00
@08007A5C:
2015-10-06 13:46:30 +01:00
ldrb r0, [r2]
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @08007A82
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bne @08007A5C
@08007A82:
2015-10-06 13:46:30 +01:00
ldrb r0, [r4]
subs r0, 0x1
strb r0, [r4]
2015-10-10 11:12:48 +01:00
@08007A88:
2015-10-06 13:46:30 +01:00
pop {r4-r7}
pop {r0}
bx r0
2015-12-03 08:17:29 +00:00
thumb_func_end JumpToTopOfImageAnimLoop
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start BeginObjectRotScalAnim
; void BeginObjectRotScalAnim(struct obj *object)
BeginObjectRotScalAnim: ; 8007A90
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @08007B12
2015-10-06 13:46:30 +01:00
ldr r0, [r6, 0x10]
ldr r0, [r0]
movs r2, 0
ldrsh r1, [r0, r2]
ldr r0, =0x00007fff
cmp r1, r0
2015-10-10 11:12:48 +01:00
beq @08007B12
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @08007B12
2015-10-06 13:46:30 +01:00
movs r0, 0x3A
ldrsh r1, [r6, r0]
movs r0, 0x3C
ldrsh r2, [r6, r0]
adds r0, r6, 0
bl obj_update_pos2
2015-10-10 11:12:48 +01:00
@08007B12:
2015-10-06 13:46:30 +01:00
add sp, 0x8
pop {r4-r7}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end BeginObjectRotScalAnim
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start ContinueObjectRotScalAnim
; void ContinueObjectRotScalAnim(struct obj *object)
ContinueObjectRotScalAnim: ; 8007B24
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @08007BC6
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @08007B60
2015-10-06 13:46:30 +01:00
adds r0, r2, 0
adds r1, r4, 0
bl sub_8007BD8
2015-10-10 11:12:48 +01:00
b @08007BAA
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@08007B60:
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
adds r0, 0x2C
ldrb r1, [r0]
movs r0, 0x80
ands r0, r1
cmp r0, 0
2015-10-10 11:12:48 +01:00
bne @08007BC6
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
ble @08007B98
2015-10-06 13:46:30 +01:00
ldr r2, =0xffff8003
adds r0, r1, r2
lsls r0, 16
lsrs r2, r0, 16
2015-10-10 11:12:48 +01:00
@08007B98:
2015-10-10 13:20:38 +01:00
ldr r0, =gUnknown_082EC6E4
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
@08007BAA:
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
adds r0, 0x3F
ldrb r1, [r0]
movs r0, 0x80
ands r0, r1
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @08007BC6
2015-10-06 13:46:30 +01:00
movs r0, 0x3A
ldrsh r1, [r4, r0]
movs r0, 0x3C
ldrsh r2, [r4, r0]
adds r0, r4, 0
bl obj_update_pos2
2015-10-10 11:12:48 +01:00
@08007BC6:
2015-10-06 13:46:30 +01:00
pop {r4,r5}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end ContinueObjectRotScalAnim
2015-10-06 13:46:30 +01:00
thumb_func_start sub_8007BD8
2015-12-03 08:17:29 +00:00
; void sub_8007BD8(u8 index, struct obj *object)
2015-10-10 11:12:48 +01:00
sub_8007BD8: ; 8007BD8
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bne @08007C02
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
@08007C02:
2015-10-06 13:46:30 +01:00
add sp, 0x8
pop {r4,r5}
pop {r0}
bx r0
thumb_func_end sub_8007BD8
2015-12-03 08:17:29 +00:00
thumb_func_start RotScalAnimCmd_loop
; void RotScalAnimCmd_loop(u8 index, struct obj *object)
RotScalAnimCmd_loop: ; 8007C0C
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @08007C34
2015-10-06 13:46:30 +01:00
adds r0, r2, 0
adds r1, r3, 0
2015-12-03 08:17:29 +00:00
bl ContinueRotScalAnimLoop
2015-10-10 11:12:48 +01:00
b @08007C3C
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@08007C34:
2015-10-06 13:46:30 +01:00
adds r0, r2, 0
adds r1, r3, 0
2015-12-03 08:17:29 +00:00
bl BeginRotScalAnimLoop
2015-10-10 11:12:48 +01:00
@08007C3C:
2015-10-06 13:46:30 +01:00
pop {r0}
bx r0
2015-12-03 08:17:29 +00:00
thumb_func_end RotScalAnimCmd_loop
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start BeginRotScalAnimLoop
; void BeginRotScalAnimLoop(u8 index, struct obj *object)
BeginRotScalAnimLoop: ; 8007C40
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
bl JumpToTopOfRotScalAnimLoop
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
2015-12-03 08:17:29 +00:00
bl ContinueObjectRotScalAnim
2015-10-06 13:46:30 +01:00
pop {r4}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end BeginRotScalAnimLoop
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start ContinueRotScalAnimLoop
; void ContinueRotScalAnimLoop(u8 index, struct obj *object)
ContinueRotScalAnimLoop: ; 8007C7C
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
bl JumpToTopOfRotScalAnimLoop
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
2015-12-03 08:17:29 +00:00
bl ContinueObjectRotScalAnim
2015-10-06 13:46:30 +01:00
pop {r4}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end ContinueRotScalAnimLoop
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start JumpToTopOfRotScalAnimLoop
; void JumpToTopOfRotScalAnimLoop(u8 index, struct obj *object)
JumpToTopOfRotScalAnimLoop: ; 8007CAC
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @08007D0C
2015-10-06 13:46:30 +01:00
ldrb r0, [r2, 0x1]
subs r0, 0x1
strb r0, [r2, 0x1]
adds r4, r3, 0
2015-10-10 11:12:48 +01:00
b @08007CDC
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@08007CD4:
2015-10-06 13:46:30 +01:00
cmp r2, 0
2015-10-10 11:12:48 +01:00
beq @08007D00
2015-10-06 13:46:30 +01:00
subs r0, r2, 0x1
strb r0, [r3, 0x1]
2015-10-10 11:12:48 +01:00
@08007CDC:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bne @08007CD4
@08007D00:
2015-10-06 13:46:30 +01:00
adds r1, r4, r5
lsls r1, 2
adds r1, r6
ldrb r0, [r1, 0x1]
subs r0, 0x1
strb r0, [r1, 0x1]
2015-10-10 11:12:48 +01:00
@08007D0C:
2015-10-06 13:46:30 +01:00
pop {r4-r7}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end JumpToTopOfRotScalAnimLoop
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start RotScalAnimCmd_jump
; void RotScalAnimCmd_jump(u8 index, struct obj *object)
RotScalAnimCmd_jump: ; 8007D18
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
thumb_func_end RotScalAnimCmd_jump
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start RotScalAnimCmd_end
; void RotScalAnimCmd_end(u8 index, struct obj *object)
RotScalAnimCmd_end: ; 8007D64
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
thumb_func_end RotScalAnimCmd_end
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start RotScalAnimCmd_frame
; void RotScalAnimCmd_frame(u8 index, struct obj *object)
RotScalAnimCmd_frame: ; 8007DA0
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
thumb_func_end RotScalAnimCmd_frame
2015-10-06 13:46:30 +01:00
thumb_func_start rotscale_set_indirect
2015-10-10 11:12:48 +01:00
; void rotscale_set_indirect(u8 rotscale_entry_index, s16 rotscale_data[])
rotscale_set_indirect: ; 8007DD8
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
; int obj_get_rotscale_entry_index(struct obj *obj)
obj_get_rotscale_entry_index: ; 8007DF8
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @08007E12
2015-10-06 13:46:30 +01:00
ldrb r0, [r2, 0x3]
lsls r0, 26
lsrs r3, r0, 27
2015-10-10 11:12:48 +01:00
@08007E12:
2015-10-06 13:46:30 +01:00
adds r0, r3, 0
pop {r1}
bx r1
thumb_func_end obj_get_rotscale_entry_index
thumb_func_start sub_8007E18
2015-10-10 11:12:48 +01:00
; void sub_8007E18(struct obj *obj, s16 a2, s16 a3)
sub_8007E18: ; 8007E18
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
; int sub_8007E28(int a1, int a2, int a3)
sub_8007E28: ; 8007E28
2015-10-06 13:46:30 +01:00
push {r4,r5,lr}
adds r3, r0, 0
adds r5, r2, 0
subs r0, r1, r3
cmp r0, 0
2015-10-10 11:12:48 +01:00
bge @08007E3A
2015-10-06 13:46:30 +01:00
negs r0, r0
asrs r4, r0, 9
2015-10-10 11:12:48 +01:00
b @08007E3E
@08007E3A:
2015-10-06 13:46:30 +01:00
asrs r0, 9
negs r4, r0
2015-10-10 11:12:48 +01:00
@08007E3E:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
; void obj_update_pos2(struct obj *obj, int a2, int a3)
obj_update_pos2: ; 8007E54
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @08007EA2
2015-10-10 13:20:38 +01:00
ldr r2, =gUnknown_082EC6F4
2015-10-06 13:46:30 +01: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]
2015-10-10 11:12:48 +01:00
@08007EA2:
2015-10-06 13:46:30 +01:00
cmp r8, r9
2015-10-10 11:12:48 +01:00
beq @08007EDA
2015-10-10 13:20:38 +01:00
ldr r2, =gUnknown_082EC6F4
2015-10-06 13:46:30 +01: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]
2015-10-10 11:12:48 +01:00
@08007EDA:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01: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 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
; void rotscale_reset_half(u8 index)
rotscale_reset_half: ; 8007F64
2015-10-06 13:46:30 +01: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
2015-12-03 08:17:29 +00:00
; void rotscale_reset_full_1(u8 index, u8 a2)
2015-10-10 11:12:48 +01:00
rotscale_reset_full_1: ; 8007F80
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
; void rotscale_reset_full_2(u8 index)
rotscale_reset_full_2: ; 8007FA8
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
; void rotscale_frame_apply_absolute(u8 index, int a2)
rotscale_frame_apply_absolute: ; 8007FD0
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
obj_anim_image_delay_progress: ; 8007FF4
2015-10-06 13:46:30 +01:00
push {lr}
adds r3, r0, 0
adds r3, 0x2C
ldrb r2, [r3]
movs r0, 0x40
ands r0, r2
cmp r0, 0
2015-10-10 11:12:48 +01:00
bne @08008018
2015-10-06 13:46:30 +01: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]
2015-10-10 11:12:48 +01:00
@08008018:
2015-10-06 13:46:30 +01:00
pop {r0}
bx r0
thumb_func_end obj_anim_image_delay_progress
thumb_func_start obj_anim_rotscale_delay_progress
2015-12-03 08:17:29 +00:00
; u8 obj_anim_rotscale_delay_progress(struct obj *object, u8 index)
2015-10-10 11:12:48 +01:00
obj_anim_rotscale_delay_progress: ; 800801C
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bne @08008040
2015-10-06 13:46:30 +01: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]
2015-10-10 11:12:48 +01:00
@08008040:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
; void rotscale_frame_apply_relative_and_sync(u8 index, int a2)
rotscale_frame_apply_relative_and_sync: ; 800804C
2015-10-06 13:46:30 +01: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 11:12:48 +01:00
bl ObjAffineSet
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
; int divide_0x10000_by(int n)
divide_0x10000_by: ; 80080E4
2015-10-06 13:46:30 +01: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
2015-11-24 19:59:32 +00:00
; void rotscale_load_frame(u8 index, struct obj *obj, rotscale_frame *a3)
2015-10-10 11:12:48 +01:00
rotscale_load_frame: ; 80080FC
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
sub_8008168: ; 8008168
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @0800818E
2015-10-06 13:46:30 +01:00
subs r0, 0x1
strb r0, [r2, 0x5]
adds r0, r4, 0
adds r1, r2, 0
bl rotscale_frame_apply_relative_and_sync
2015-10-10 11:12:48 +01:00
b @0800819E
@0800818E:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
@0800819E:
2015-10-06 13:46:30 +01:00
add sp, 0x8
pop {r4}
pop {r0}
bx r0
thumb_func_end sub_8008168
2015-12-03 08:17:29 +00:00
thumb_func_start StartObjectImageAnim
; void StartObjectImageAnim(struct obj *object, u8 whichAnim)
StartObjectImageAnim: ; 80081A8
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
thumb_func_end StartObjectImageAnim
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start StartObjectImageAnimIfDifferent
; void StartObjectImageAnimIfDifferent(struct obj *object, u8 whichAnim)
StartObjectImageAnimIfDifferent: ; 80081C0
2015-10-06 13:46:30 +01:00
push {lr}
adds r2, r0, 0
lsls r1, 24
lsrs r1, 24
adds r0, 0x2A
ldrb r0, [r0]
cmp r0, r1
2015-10-10 11:12:48 +01:00
beq @080081D6
2015-10-06 13:46:30 +01:00
adds r0, r2, 0
2015-12-03 08:17:29 +00:00
bl StartObjectImageAnim
2015-10-10 11:12:48 +01:00
@080081D6:
2015-10-06 13:46:30 +01:00
pop {r0}
bx r0
2015-12-03 08:17:29 +00:00
thumb_func_end StartObjectImageAnimIfDifferent
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start SeekObjectImageAnim
; void SeekObjectImageAnim(struct obj *object, u8 cmdIndex)
SeekObjectImageAnim: ; 80081DC
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
bl ContinueObjectImageAnim
2015-10-06 13:46:30 +01:00
ldrb r2, [r4]
movs r0, 0x3F
ands r0, r2
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @08008244
2015-10-06 13:46:30 +01: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]
2015-10-10 11:12:48 +01:00
@08008244:
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
thumb_func_end SeekObjectImageAnim
2015-10-06 13:46:30 +01:00
thumb_func_start StartObjectRotScalAnim
; void StartObjectRotScalAnim(struct obj *object, u8 whichAnim)
StartObjectRotScalAnim: ; 8008258
2015-10-06 13:46:30 +01: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 13:46:30 +01:00
thumb_func_start StartObjectRotScalAnimIfDifferent
; void StartObjectRotScalAnimIfDifferent(struct obj *object, u8 whichAnim)
StartObjectRotScalAnimIfDifferent: ; 8008284
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @080082AC
2015-10-06 13:46:30 +01:00
adds r0, r5, 0
adds r1, r4, 0
bl StartObjectRotScalAnim
2015-10-10 11:12:48 +01:00
@080082AC:
2015-10-06 13:46:30 +01:00
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end StartObjectRotScalAnimIfDifferent
2015-10-06 13:46:30 +01:00
thumb_func_start sub_80082B8
2015-10-10 11:12:48 +01:00
sub_80082B8: ; 80082B8
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
sub_80082F0: ; 80082F0
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @08008318
2015-10-06 13:46:30 +01:00
adds r0, r5, 0
adds r1, r4, 0
bl sub_80082B8
2015-10-10 11:12:48 +01:00
@08008318:
2015-10-06 13:46:30 +01:00
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_80082F0
thumb_func_start sub_8008324
2015-10-10 11:12:48 +01:00
sub_8008324: ; 8008324
2015-10-06 13:46:30 +01:00
push {lr}
adds r3, r0, 0
adds r0, 0x3F
ldrb r1, [r0]
movs r0, 0x40
ands r0, r1
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @08008370
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bge @08008358
2015-10-06 13:46:30 +01:00
movs r2, 0
2015-10-10 11:12:48 +01:00
@08008358:
2015-10-06 13:46:30 +01: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]
2015-10-10 11:12:48 +01:00
@08008370:
2015-10-06 13:46:30 +01:00
pop {r0}
bx r0
.pool
thumb_func_end sub_8008324
thumb_func_start rotscale_reset_all
2015-10-10 11:12:48 +01:00
; void rotscale_reset_all()
rotscale_reset_all: ; 800837C
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
bl ResetSpriteTransformationMatrices
2015-10-06 13:46:30 +01:00
movs r4, 0
2015-10-10 11:12:48 +01:00
@08008390:
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
bl rotscale_reset_full_2
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0x1F
2015-10-10 11:12:48 +01:00
bls @08008390
2015-10-06 13:46:30 +01:00
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end rotscale_reset_all
thumb_func_start rotscale_alloc_entry
2015-10-10 11:12:48 +01:00
; u8 rotscale_alloc_entry()
rotscale_alloc_entry: ; 80083B0
2015-10-06 13:46:30 +01:00
push {r4,lr}
movs r2, 0
movs r1, 0x1
ldr r0, =0x03003018
ldr r4, [r0]
adds r3, r0, 0
2015-10-10 11:12:48 +01:00
@080083BC:
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
ands r0, r1
cmp r0, 0
2015-10-10 11:12:48 +01:00
bne @080083D4
2015-10-06 13:46:30 +01:00
ldr r0, [r3]
orrs r0, r1
str r0, [r3]
adds r0, r2, 0
2015-10-10 11:12:48 +01:00
b @080083E2
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@080083D4:
2015-10-06 13:46:30 +01:00
adds r0, r2, 0x1
lsls r0, 24
lsrs r2, r0, 24
lsls r1, 1
cmp r2, 0x1F
2015-10-10 11:12:48 +01:00
bls @080083BC
2015-10-06 13:46:30 +01:00
movs r0, 0xFF
2015-10-10 11:12:48 +01:00
@080083E2:
2015-10-06 13:46:30 +01:00
pop {r4}
pop {r1}
bx r1
thumb_func_end rotscale_alloc_entry
thumb_func_start rotscale_free_entry
2015-10-10 11:12:48 +01:00
; void rotscale_free_entry(u8 rotscale_index)
rotscale_free_entry: ; 80083E8
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bcs @08008406
@080083FA:
2015-10-06 13:46:30 +01:00
adds r0, 0x1
lsls r0, 24
lsrs r0, 24
lsls r1, 1
cmp r0, r2
2015-10-10 11:12:48 +01:00
bcc @080083FA
@08008406:
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
bl SetSpriteTransformationMatrix
2015-10-06 13:46:30 +01:00
add sp, 0x4
pop {r0}
bx r0
.pool
thumb_func_end rotscale_free_entry
thumb_func_start obj_alloc_rotscale_entry
2015-10-10 11:12:48 +01:00
; void obj_alloc_rotscale_entry(struct obj *obj)
obj_alloc_rotscale_entry: ; 8008428
2015-10-06 13:46:30 +01:00
push {r4,r5,lr}
adds r4, r0, 0
bl rotscale_alloc_entry
lsls r0, 24
lsrs r5, r0, 24
cmp r5, 0xFF
2015-10-10 11:12:48 +01:00
beq @08008470
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
bl CalcVecFromObjectCenterToObjectUpperLeft
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
@08008470:
2015-10-06 13:46:30 +01:00
pop {r4,r5}
pop {r0}
bx r0
thumb_func_end obj_alloc_rotscale_entry
thumb_func_start sub_8008478
2015-10-10 11:12:48 +01:00
sub_8008478: ; 8008478
2015-10-06 13:46:30 +01: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 11:12:48 +01:00
bl ObjAffineSet
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
thumb_func_start LoadObjectPic
; u16 LoadObjectPic(struct obj_tiles *pic)
LoadObjectPic: ; 80084F8
2015-10-06 13:46:30 +01:00
push {r4-r6,lr}
adds r5, r0, 0
ldrh r0, [r5, 0x4]
lsrs r0, 5
2015-12-03 08:17:29 +00:00
bl AllocObjectTiles
2015-10-06 13:46:30 +01:00
lsls r4, r0, 16
asrs r6, r4, 16
cmp r6, 0
2015-10-10 11:12:48 +01:00
blt @08008534
2015-10-06 13:46:30 +01:00
ldrh r0, [r5, 0x6]
lsrs r4, 16
ldrh r2, [r5, 0x4]
lsrs r2, 5
adds r1, r4, 0
2015-12-03 08:17:29 +00:00
bl AddObjectTileRange
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
b @08008536
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@08008534:
2015-10-06 13:46:30 +01:00
movs r0, 0
2015-10-10 11:12:48 +01:00
@08008536:
2015-10-06 13:46:30 +01:00
pop {r4-r6}
pop {r1}
bx r1
2015-12-03 08:17:29 +00:00
thumb_func_end LoadObjectPic
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start LoadObjectPics
; void LoadObjectPics(struct obj_tiles *pics)
LoadObjectPics: ; 800853C
2015-10-06 13:46:30 +01:00
push {r4,r5,lr}
adds r5, r0, 0
movs r4, 0
ldr r0, [r5]
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @08008560
@08008548:
2015-10-06 13:46:30 +01:00
lsls r0, r4, 3
adds r0, r5, r0
2015-12-03 08:17:29 +00:00
bl LoadObjectPic
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bne @08008548
@08008560:
2015-10-06 13:46:30 +01:00
pop {r4,r5}
pop {r0}
bx r0
2015-12-03 08:17:29 +00:00
thumb_func_end LoadObjectPics
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start FreeObjectTilesByTag
; void FreeObjectTilesByTag(u16 tag)
FreeObjectTilesByTag: ; 8008568
2015-10-06 13:46:30 +01:00
push {r4-r7,lr}
mov r7, r8
push {r7}
lsls r0, 16
lsrs r0, 16
2015-12-03 08:17:29 +00:00
bl IndexOfObjectTilesTag
2015-10-06 13:46:30 +01:00
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0xFF
2015-10-10 11:12:48 +01:00
beq @080085C6
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bge @080085BE
2015-10-06 13:46:30 +01:00
ldr r1, =0x02021b3c
mov r12, r1
movs r6, 0x7
movs r7, 0x1
adds r4, r0, 0
2015-10-10 11:12:48 +01:00
@080085A2:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
blt @080085A2
@080085BE:
2015-10-06 13:46:30 +01:00
mov r0, r8
adds r1, r5, r0
ldr r0, =0x0000ffff
strh r0, [r1]
2015-10-10 11:12:48 +01:00
@080085C6:
2015-10-06 13:46:30 +01:00
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end FreeObjectTilesByTag
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start FreeAllObjectTiles
; void FreeAllObjectTiles()
FreeAllObjectTiles: ; 80085E0
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
@080085F0:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bls @080085F0
2015-10-06 13:46:30 +01:00
pop {r4-r7}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end FreeAllObjectTiles
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start GetObjectTileRangeStartByTag
; u16 GetObjectTileRangeStartByTag(u16 tag)
GetObjectTileRangeStartByTag: ; 8008620
2015-10-06 13:46:30 +01:00
push {lr}
lsls r0, 16
lsrs r0, 16
2015-12-03 08:17:29 +00:00
bl IndexOfObjectTilesTag
2015-10-06 13:46:30 +01:00
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0xFF
2015-10-10 11:12:48 +01:00
beq @08008640
2015-10-06 13:46:30 +01:00
ldr r0, =0x03000a70
lsls r1, 2
adds r1, r0
ldrh r0, [r1]
2015-10-10 11:12:48 +01:00
b @08008642
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@08008640:
2015-10-06 13:46:30 +01:00
ldr r0, =0x0000ffff
2015-10-10 11:12:48 +01:00
@08008642:
2015-10-06 13:46:30 +01:00
pop {r1}
bx r1
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end GetObjectTileRangeStartByTag
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start IndexOfObjectTilesTag
; u8 IndexOfObjectTilesTag(u16 tag)
IndexOfObjectTilesTag: ; 800864C
2015-10-06 13:46:30 +01:00
push {lr}
lsls r0, 16
lsrs r2, r0, 16
movs r1, 0
ldr r3, =0x030009f0
2015-10-10 11:12:48 +01:00
@08008656:
2015-10-06 13:46:30 +01:00
lsls r0, r1, 1
adds r0, r3
ldrh r0, [r0]
cmp r0, r2
2015-10-10 11:12:48 +01:00
bne @08008668
2015-10-06 13:46:30 +01:00
adds r0, r1, 0
2015-10-10 11:12:48 +01:00
b @08008674
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@08008668:
2015-10-06 13:46:30 +01:00
adds r0, r1, 0x1
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0x3F
2015-10-10 11:12:48 +01:00
bls @08008656
2015-10-06 13:46:30 +01:00
movs r0, 0xFF
2015-10-10 11:12:48 +01:00
@08008674:
2015-10-06 13:46:30 +01:00
pop {r1}
bx r1
2015-12-03 08:17:29 +00:00
thumb_func_end IndexOfObjectTilesTag
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start GetTagByObjectTileRangeStart
; u16 GetTagByObjectTileRangeStart(u16 rangeStart)
GetTagByObjectTileRangeStart: ; 8008678
2015-10-06 13:46:30 +01:00
push {r4-r6,lr}
lsls r0, 16
lsrs r3, r0, 16
movs r2, 0
ldr r6, =0x030009f0
ldr r5, =0x0000ffff
ldr r4, =0x03000a70
2015-10-10 11:12:48 +01:00
@08008686:
2015-10-06 13:46:30 +01:00
lsls r0, r2, 1
adds r1, r0, r6
ldrh r0, [r1]
cmp r0, r5
2015-10-10 11:12:48 +01:00
beq @080086AC
2015-10-06 13:46:30 +01:00
lsls r0, r2, 2
adds r0, r4
ldrh r0, [r0]
cmp r0, r3
2015-10-10 11:12:48 +01:00
bne @080086AC
2015-10-06 13:46:30 +01:00
ldrh r0, [r1]
2015-10-10 11:12:48 +01:00
b @080086B8
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@080086AC:
2015-10-06 13:46:30 +01:00
adds r0, r2, 0x1
lsls r0, 24
lsrs r2, r0, 24
cmp r2, 0x3F
2015-10-10 11:12:48 +01:00
bls @08008686
2015-10-06 13:46:30 +01:00
ldr r0, =0x0000ffff
2015-10-10 11:12:48 +01:00
@080086B8:
2015-10-06 13:46:30 +01:00
pop {r4-r6}
pop {r1}
bx r1
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end GetTagByObjectTileRangeStart
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start AddObjectTileRange
; void AddObjectTileRange(u16 tag, u16 start, u16 count)
AddObjectTileRange: ; 80086C4
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
bl IndexOfObjectTilesTag
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
thumb_func_end AddObjectTileRange
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start ResetObjectPaletteAllocator
; void ResetObjectPaletteAllocator()
ResetObjectPaletteAllocator: ; 800870C
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
@0800871C:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bls @0800871C
2015-10-06 13:46:30 +01:00
pop {r4}
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end ResetObjectPaletteAllocator
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start LoadTaggedObjectPalette
; u8 LoadTaggedObjectPalette(struct TaggedObjectPalette *palette)
2015-12-03 08:17:29 +00:00
LoadTaggedObjectPalette: ; 8008744
2015-10-06 13:46:30 +01:00
push {r4,r5,lr}
adds r5, r0, 0
ldrh r0, [r5, 0x4]
2015-12-03 08:17:29 +00:00
bl IndexOfObjectPaletteTag
2015-10-06 13:46:30 +01:00
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0xFF
2015-10-10 11:12:48 +01:00
beq @0800875A
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
2015-10-10 11:12:48 +01:00
b @0800878A
@0800875A:
2015-10-06 13:46:30 +01:00
ldr r0, =0x0000ffff
2015-12-03 08:17:29 +00:00
bl IndexOfObjectPaletteTag
2015-10-06 13:46:30 +01:00
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0xFF
2015-10-10 11:12:48 +01:00
beq @08008788
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
bl LoadObjectPalette
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
2015-10-10 11:12:48 +01:00
b @0800878A
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@08008788:
2015-10-06 13:46:30 +01:00
movs r0, 0xFF
2015-10-10 11:12:48 +01:00
@0800878A:
2015-10-06 13:46:30 +01:00
pop {r4,r5}
pop {r1}
bx r1
2015-12-03 08:17:29 +00:00
thumb_func_end LoadTaggedObjectPalette
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start LoadTaggedObjectPalettes
; void LoadTaggedObjectPalettes(struct TaggedObjectPalette *palettes)
2015-12-03 08:17:29 +00:00
LoadTaggedObjectPalettes: ; 8008790
2015-10-06 13:46:30 +01:00
push {r4,r5,lr}
adds r5, r0, 0
movs r4, 0
2015-10-10 11:12:48 +01:00
b @0800879E
@08008798:
2015-10-06 13:46:30 +01:00
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
2015-10-10 11:12:48 +01:00
@0800879E:
2015-10-06 13:46:30 +01:00
lsls r0, r4, 3
adds r1, r0, r5
ldr r0, [r1]
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @080087B6
2015-10-06 13:46:30 +01:00
adds r0, r1, 0
2015-12-03 08:17:29 +00:00
bl LoadTaggedObjectPalette
2015-10-06 13:46:30 +01:00
lsls r0, 24
lsrs r0, 24
cmp r0, 0xFF
2015-10-10 11:12:48 +01:00
bne @08008798
@080087B6:
2015-10-06 13:46:30 +01:00
pop {r4,r5}
pop {r0}
bx r0
2015-12-03 08:17:29 +00:00
thumb_func_end LoadTaggedObjectPalettes
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start LoadObjectPalette
; void LoadObjectPalette(void *src, u16 destOffset)
LoadObjectPalette: ; 80087BC
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
thumb_func_end LoadObjectPalette
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start AllocObjectPalette
; u8 AllocObjectPalette(u16 tag)
AllocObjectPalette: ; 80087D4
2015-10-06 13:46:30 +01:00
push {r4,lr}
lsls r0, 16
lsrs r4, r0, 16
ldr r0, =0x0000ffff
2015-12-03 08:17:29 +00:00
bl IndexOfObjectPaletteTag
2015-10-06 13:46:30 +01:00
lsls r0, 24
lsrs r2, r0, 24
cmp r2, 0xFF
2015-10-10 11:12:48 +01:00
beq @080087FC
2015-10-06 13:46:30 +01:00
ldr r1, =0x03000cf0
lsls r0, r2, 1
adds r0, r1
strh r4, [r0]
adds r0, r2, 0
2015-10-10 11:12:48 +01:00
b @080087FE
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@080087FC:
2015-10-06 13:46:30 +01:00
movs r0, 0xFF
2015-10-10 11:12:48 +01:00
@080087FE:
2015-10-06 13:46:30 +01:00
pop {r4}
pop {r1}
bx r1
2015-12-03 08:17:29 +00:00
thumb_func_end AllocObjectPalette
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start IndexOfObjectPaletteTag
; u8 IndexOfObjectPaletteTag(u16 tag)
IndexOfObjectPaletteTag: ; 8008804
2015-10-06 13:46:30 +01:00
push {lr}
lsls r0, 16
lsrs r2, r0, 16
ldr r0, =0x0300301c
ldrb r1, [r0]
cmp r1, 0xF
2015-10-10 11:12:48 +01:00
bhi @08008836
2015-10-06 13:46:30 +01:00
ldr r3, =0x03000cf0
2015-10-10 11:12:48 +01:00
@08008814:
2015-10-06 13:46:30 +01:00
lsls r0, r1, 1
adds r0, r3
ldrh r0, [r0]
cmp r0, r2
2015-10-10 11:12:48 +01:00
bne @0800882C
2015-10-06 13:46:30 +01:00
adds r0, r1, 0
2015-10-10 11:12:48 +01:00
b @08008838
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@0800882C:
2015-10-06 13:46:30 +01:00
adds r0, r1, 0x1
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0xF
2015-10-10 11:12:48 +01:00
bls @08008814
@08008836:
2015-10-06 13:46:30 +01:00
movs r0, 0xFF
2015-10-10 11:12:48 +01:00
@08008838:
2015-10-06 13:46:30 +01:00
pop {r1}
bx r1
2015-12-03 08:17:29 +00:00
thumb_func_end IndexOfObjectPaletteTag
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start GetObjectPaletteTagBySlot
; u16 GetObjectPaletteTagBySlot(u8 paletteSlot)
GetObjectPaletteTagBySlot: ; 800883C
2015-10-06 13:46:30 +01:00
lsls r0, 24
ldr r1, =0x03000cf0
lsrs r0, 23
adds r0, r1
ldrh r0, [r0]
bx lr
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end GetObjectPaletteTagBySlot
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start FreeObjectPaletteByTag
; void FreeObjectPaletteByTag(int tag)
FreeObjectPaletteByTag: ; 800884C
2015-10-06 13:46:30 +01:00
push {lr}
lsls r0, 16
lsrs r0, 16
2015-12-03 08:17:29 +00:00
bl IndexOfObjectPaletteTag
2015-10-06 13:46:30 +01:00
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0xFF
2015-10-10 11:12:48 +01:00
beq @08008868
2015-10-06 13:46:30 +01:00
ldr r0, =0x03000cf0
lsls r1, 1
adds r1, r0
ldr r0, =0x0000ffff
strh r0, [r1]
2015-10-10 11:12:48 +01:00
@08008868:
2015-10-06 13:46:30 +01:00
pop {r0}
bx r0
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end FreeObjectPaletteByTag
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start SetSpriteOamTables_NoPriorityFromTable
; void SetSpriteOamTables_NoPriorityFromTable(struct obj *object, u32 spriteOamTables)
SetSpriteOamTables_NoPriorityFromTable: ; 8008874
2015-10-06 13:46:30 +01:00
str r1, [r0, 0x18]
adds r0, 0x42
movs r1, 0x40
strb r1, [r0]
bx lr
2015-12-03 08:17:29 +00:00
thumb_func_end SetSpriteOamTables_NoPriorityFromTable
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start AddSprite
; u8 AddSprite(struct obj *obj, u8 *spriteIndex)
AddSprite: ; 8008880
2015-10-06 13:46:30 +01:00
push {r4,lr}
adds r4, r0, 0
adds r3, r1, 0
ldr r1, =0x02021b38
ldrb r0, [r3]
ldrb r1, [r1]
cmp r0, r1
2015-10-10 11:12:48 +01:00
bcc @08008898
2015-10-06 13:46:30 +01:00
movs r0, 0x1
2015-10-10 11:12:48 +01:00
b @080088E0
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@08008898:
2015-10-06 13:46:30 +01:00
ldr r0, [r4, 0x18]
cmp r0, 0
2015-10-10 11:12:48 +01:00
beq @080088AC
2015-10-06 13:46:30 +01:00
adds r0, r4, 0
adds r0, 0x42
ldrb r1, [r0]
movs r0, 0xC0
ands r0, r1
cmp r0, 0
2015-10-10 11:12:48 +01:00
bne @080088CC
@080088AC:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
b @080088E0
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@080088CC:
2015-10-06 13:46:30 +01:00
ldrb r1, [r3]
lsls r1, 3
ldr r0, =0x030022f8
adds r1, r0
adds r0, r4, 0
adds r2, r3, 0
2015-12-03 08:17:29 +00:00
bl AddSpritesFromSpriteOamTable
2015-10-06 13:46:30 +01:00
lsls r0, 24
lsrs r0, 24
2015-10-10 11:12:48 +01:00
@080088E0:
2015-10-06 13:46:30 +01:00
pop {r4}
pop {r1}
bx r1
.pool
2015-12-03 08:17:29 +00:00
thumb_func_end AddSprite
2015-10-06 13:46:30 +01:00
2015-12-03 08:17:29 +00:00
thumb_func_start AddSpritesFromSpriteOamTable
; u8 AddSpritesFromSpriteOamTable(struct obj *object, struct sprite *sprite, u8 *spriteIndex)
AddSpritesFromSpriteOamTable: ; 80088EC
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bcc @08008910
@08008908:
2015-10-06 13:46:30 +01:00
movs r0, 0x1
2015-10-10 11:12:48 +01:00
b @08008AE6
2015-10-06 13:46:30 +01:00
.pool
2015-10-10 11:12:48 +01:00
@08008910:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @0800892C
2015-10-06 13:46:30 +01:00
ldr r0, [r7, 0x4]
cmp r0, 0
2015-10-10 11:12:48 +01:00
bne @08008942
@0800892C:
2015-10-06 13:46:30 +01: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]
2015-10-10 11:12:48 +01:00
b @08008AE4
@08008942:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bcc @080089A0
b @08008AE4
@080089A0:
2015-10-06 13:46:30 +01:00
lsls r0, r2, 16
asrs r0, 16
str r0, [sp, 0x14]
2015-10-10 11:12:48 +01:00
@080089A6:
2015-10-06 13:46:30 +01:00
mov r2, r8
ldrb r0, [r2]
ldr r1, =0x02021b38
ldrb r1, [r1]
cmp r0, r1
2015-10-10 11:12:48 +01:00
bcs @08008908
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @080089FC
2015-10-06 13:46:30 +01: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 13:20:38 +01:00
ldr r0, =gUnknown_082EC754
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
@080089FC:
2015-10-06 13:46:30 +01:00
mov r1, r10
cmp r1, 0
2015-10-10 11:12:48 +01:00
beq @08008A2E
2015-10-06 13:46:30 +01: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 13:20:38 +01:00
ldr r2, =gUnknown_082EC754
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
@08008A2E:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
beq @08008ACA
2015-10-06 13:46:30 +01: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]
2015-10-10 11:12:48 +01:00
@08008ACA:
2015-10-06 13:46:30 +01: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
2015-10-10 11:12:48 +01:00
bcs @08008AE4
b @080089A6
@08008AE4:
2015-10-06 13:46:30 +01:00
movs r0, 0
2015-10-10 11:12:48 +01:00
@08008AE6:
2015-10-06 13:46:30 +01: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 08:17:29 +00:00
thumb_func_end AddSpritesFromSpriteOamTable