mirror of
https://github.com/pret/pmd-red.git
synced 2024-11-27 06:50:30 +00:00
1011 lines
16 KiB
ArmAsm
1011 lines
16 KiB
ArmAsm
#include "asm/constants/gba_constants.inc"
|
|
#include "asm/macros.inc"
|
|
|
|
.syntax unified
|
|
|
|
.text
|
|
|
|
thumb_func_start sub_8082280
|
|
sub_8082280:
|
|
push {r4-r7,lr}
|
|
mov r7, r10
|
|
mov r6, r9
|
|
mov r5, r8
|
|
push {r5-r7}
|
|
ldr r4, _0808266C
|
|
add sp, r4
|
|
adds r5, r0, 0
|
|
str r2, [sp, 0x210]
|
|
lsls r1, 24
|
|
lsrs r1, 24
|
|
str r1, [sp, 0x20C]
|
|
movs r2, 0x82
|
|
lsls r2, 2
|
|
mov r0, sp
|
|
movs r1, 0
|
|
bl memset
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
str r0, [sp, 0x214]
|
|
add r4, sp, 0x208
|
|
adds r0, r5, 0
|
|
adds r1, r4, 0
|
|
bl sub_80831F8
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
str r0, [sp, 0x218]
|
|
adds r0, r5, 0
|
|
bl sub_8083158
|
|
lsls r0, 16
|
|
lsrs r0, 16
|
|
str r0, [sp, 0x21C]
|
|
ldr r1, _08082670
|
|
movs r0, 0
|
|
str r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8083158
|
|
mov r1, sp
|
|
strh r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8082BC0
|
|
mov r1, sp
|
|
strh r0, [r1, 0x4]
|
|
adds r0, r5, 0
|
|
bl sub_8082BC0
|
|
mov r1, sp
|
|
strh r0, [r1, 0x2]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
mov r1, sp
|
|
strb r0, [r1, 0x6]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
mov r1, sp
|
|
strb r0, [r1, 0x7]
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
mov r1, sp
|
|
strb r0, [r1, 0x8]
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
mov r1, sp
|
|
strb r0, [r1, 0x9]
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
mov r1, sp
|
|
strb r0, [r1, 0xA]
|
|
add r1, sp, 0x40
|
|
adds r0, r5, 0
|
|
bl sub_8082F64
|
|
adds r0, r5, 0
|
|
bl sub_8083170
|
|
mov r1, sp
|
|
strh r0, [r1, 0xC]
|
|
adds r0, r5, 0
|
|
bl sub_8083170
|
|
mov r1, sp
|
|
strh r0, [r1, 0xE]
|
|
adds r0, r5, 0
|
|
bl sub_8083170
|
|
mov r1, sp
|
|
strh r0, [r1, 0x10]
|
|
adds r0, r5, 0
|
|
bl sub_8083170
|
|
mov r1, sp
|
|
strh r0, [r1, 0x12]
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
mov r1, sp
|
|
strb r0, [r1, 0x14]
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
mov r1, sp
|
|
strb r0, [r1, 0x15]
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
mov r1, sp
|
|
strb r0, [r1, 0x16]
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
mov r1, sp
|
|
strb r0, [r1, 0x17]
|
|
adds r0, r5, 0
|
|
bl sub_80831A0
|
|
str r0, [sp, 0x18]
|
|
adds r0, r5, 0
|
|
bl sub_8083170
|
|
mov r1, sp
|
|
strh r0, [r1, 0x1C]
|
|
adds r0, r5, 0
|
|
bl sub_8083170
|
|
mov r1, sp
|
|
strh r0, [r1, 0x1E]
|
|
adds r0, r5, 0
|
|
bl sub_8083170
|
|
mov r1, sp
|
|
strh r0, [r1, 0x20]
|
|
adds r0, r5, 0
|
|
bl sub_8083170
|
|
mov r1, sp
|
|
strh r0, [r1, 0x22]
|
|
adds r0, r5, 0
|
|
bl sub_8083170
|
|
mov r1, sp
|
|
strh r0, [r1, 0x24]
|
|
adds r0, r5, 0
|
|
bl sub_8083170
|
|
mov r1, sp
|
|
strh r0, [r1, 0x26]
|
|
adds r0, r5, 0
|
|
bl sub_8083170
|
|
mov r1, sp
|
|
strh r0, [r1, 0x28]
|
|
adds r0, r5, 0
|
|
bl sub_80831C8
|
|
str r0, [sp, 0x2C]
|
|
adds r0, r5, 0
|
|
bl sub_80831C8
|
|
str r0, [sp, 0x30]
|
|
adds r0, r5, 0
|
|
bl sub_80831C8
|
|
str r0, [sp, 0x34]
|
|
adds r0, r5, 0
|
|
bl sub_80831C8
|
|
str r0, [sp, 0x38]
|
|
add r1, sp, 0x44
|
|
adds r0, r5, 0
|
|
bl sub_8082CBC
|
|
adds r0, r5, 0
|
|
bl sub_8082BFC
|
|
add r1, sp, 0x5C
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8082BFC
|
|
mov r1, sp
|
|
adds r1, 0x5D
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8082C18
|
|
mov r1, sp
|
|
adds r1, 0x5E
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8082C18
|
|
mov r1, sp
|
|
adds r1, 0x5F
|
|
strb r0, [r1]
|
|
add r1, sp, 0x60
|
|
adds r0, r5, 0
|
|
bl sub_80820A8
|
|
adds r0, r5, 0
|
|
bl sub_8082BE0
|
|
add r1, sp, 0x64
|
|
strb r0, [r1]
|
|
add r7, sp, 0x78
|
|
add r0, sp, 0x8C
|
|
mov r8, r0
|
|
add r1, sp, 0x90
|
|
mov r9, r1
|
|
add r2, sp, 0x94
|
|
mov r10, r2
|
|
mov r3, sp
|
|
adds r3, 0x3C
|
|
str r3, [sp, 0x270]
|
|
mov r0, sp
|
|
adds r0, 0x98
|
|
str r0, [sp, 0x274]
|
|
mov r1, sp
|
|
adds r1, 0x9C
|
|
str r1, [sp, 0x278]
|
|
mov r2, sp
|
|
adds r2, 0xA0
|
|
str r2, [sp, 0x27C]
|
|
adds r3, 0x6C
|
|
str r3, [sp, 0x284]
|
|
adds r0, 0x14
|
|
str r0, [sp, 0x288]
|
|
adds r1, 0x14
|
|
str r1, [sp, 0x28C]
|
|
adds r2, 0x1C
|
|
str r2, [sp, 0x290]
|
|
adds r3, 0x18
|
|
str r3, [sp, 0x294]
|
|
adds r0, 0x18
|
|
str r0, [sp, 0x298]
|
|
adds r1, 0x18
|
|
str r1, [sp, 0x29C]
|
|
adds r2, 0x14
|
|
str r2, [sp, 0x220]
|
|
adds r3, 0x1C
|
|
str r3, [sp, 0x224]
|
|
adds r0, 0x1C
|
|
str r0, [sp, 0x228]
|
|
adds r1, 0x1C
|
|
str r1, [sp, 0x22C]
|
|
adds r2, 0x18
|
|
str r2, [sp, 0x230]
|
|
adds r3, 0x10
|
|
str r3, [sp, 0x234]
|
|
adds r0, 0x10
|
|
str r0, [sp, 0x238]
|
|
adds r1, 0xD
|
|
str r1, [sp, 0x23C]
|
|
adds r2, 0xA
|
|
str r2, [sp, 0x240]
|
|
adds r3, 0x7
|
|
str r3, [sp, 0x244]
|
|
adds r0, 0x4
|
|
str r0, [sp, 0x248]
|
|
adds r1, 0xA
|
|
str r1, [sp, 0x25C]
|
|
adds r2, 0x3
|
|
str r2, [sp, 0x24C]
|
|
adds r3, 0x3
|
|
str r3, [sp, 0x250]
|
|
adds r0, 0x3
|
|
str r0, [sp, 0x254]
|
|
subs r1, 0x1
|
|
str r1, [sp, 0x258]
|
|
adds r2, 0x7
|
|
str r2, [sp, 0x260]
|
|
adds r3, 0x7
|
|
str r3, [sp, 0x264]
|
|
adds r0, 0x7
|
|
str r0, [sp, 0x268]
|
|
adds r1, 0x5
|
|
str r1, [sp, 0x26C]
|
|
subs r2, 0x58
|
|
str r2, [sp, 0x280]
|
|
add r4, sp, 0x68
|
|
movs r6, 0x3
|
|
_080824DC:
|
|
adds r0, r5, 0
|
|
adds r1, r4, 0
|
|
bl sub_80831F8
|
|
adds r4, 0x4
|
|
subs r6, 0x1
|
|
cmp r6, 0
|
|
bge _080824DC
|
|
adds r0, r5, 0
|
|
adds r1, r7, 0
|
|
bl sub_8082CE4
|
|
adds r0, r5, 0
|
|
mov r1, r8
|
|
bl sub_8082D28
|
|
adds r0, r5, 0
|
|
mov r1, r9
|
|
bl sub_8082D28
|
|
adds r0, r5, 0
|
|
bl sub_8082C84
|
|
movs r4, 0
|
|
mov r3, r10
|
|
strb r0, [r3]
|
|
adds r0, r5, 0
|
|
ldr r1, [sp, 0x270]
|
|
bl sub_8082F80
|
|
adds r0, r5, 0
|
|
bl sub_80831A0
|
|
ldr r1, [sp, 0x274]
|
|
str r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_80831A0
|
|
ldr r2, [sp, 0x278]
|
|
str r0, [r2]
|
|
adds r0, r5, 0
|
|
bl sub_80831A0
|
|
ldr r3, [sp, 0x27C]
|
|
str r0, [r3]
|
|
adds r0, r5, 0
|
|
ldr r1, [sp, 0x284]
|
|
bl sub_8082D34
|
|
adds r0, r5, 0
|
|
ldr r1, [sp, 0x288]
|
|
bl sub_8082D50
|
|
adds r0, r5, 0
|
|
ldr r1, [sp, 0x28C]
|
|
bl sub_8082D7C
|
|
adds r0, r5, 0
|
|
ldr r1, [sp, 0x290]
|
|
bl sub_8082DA8
|
|
adds r0, r5, 0
|
|
ldr r1, [sp, 0x294]
|
|
bl sub_8082DC4
|
|
adds r0, r5, 0
|
|
ldr r1, [sp, 0x298]
|
|
bl sub_8082DE8
|
|
adds r0, r5, 0
|
|
ldr r1, [sp, 0x29C]
|
|
bl sub_8082E04
|
|
adds r0, r5, 0
|
|
ldr r1, [sp, 0x220]
|
|
bl sub_8082E38
|
|
adds r0, r5, 0
|
|
ldr r1, [sp, 0x224]
|
|
bl sub_8082E6C
|
|
adds r0, r5, 0
|
|
ldr r1, [sp, 0x228]
|
|
bl sub_8082E88
|
|
adds r0, r5, 0
|
|
ldr r1, [sp, 0x22C]
|
|
bl sub_8082E94
|
|
adds r0, r5, 0
|
|
ldr r1, [sp, 0x230]
|
|
bl sub_8082EB0
|
|
adds r0, r5, 0
|
|
ldr r1, [sp, 0x234]
|
|
bl sub_8082ECC
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
ldr r1, [sp, 0x238]
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
ldr r2, [sp, 0x23C]
|
|
strb r0, [r2]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
ldr r3, [sp, 0x240]
|
|
strb r0, [r3]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
ldr r1, [sp, 0x244]
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
ldr r2, [sp, 0x248]
|
|
strb r0, [r2]
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
ldr r3, [sp, 0x25C]
|
|
strb r0, [r3]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
ldr r1, [sp, 0x24C]
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
ldr r2, [sp, 0x250]
|
|
strb r0, [r2]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
ldr r3, [sp, 0x254]
|
|
strb r0, [r3]
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
ldr r1, [sp, 0x258]
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
ldr r2, [sp, 0x260]
|
|
strb r0, [r2]
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
ldr r3, [sp, 0x264]
|
|
strb r0, [r3]
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
ldr r1, [sp, 0x268]
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8082C34
|
|
ldr r2, [sp, 0x26C]
|
|
strb r0, [r2]
|
|
adds r0, r5, 0
|
|
bl sub_8082C50
|
|
add r1, sp, 0x100
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8082C6C
|
|
add r1, sp, 0x104
|
|
str r0, [r1]
|
|
add r1, sp, 0x108
|
|
adds r0, r5, 0
|
|
movs r2, 0x5
|
|
bl sub_8083288
|
|
ldr r1, _08082674
|
|
add r1, sp
|
|
adds r0, r5, 0
|
|
movs r2, 0x5
|
|
bl sub_8083288
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
movs r1, 0x89
|
|
lsls r1, 1
|
|
add r1, sp
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
b _08082678
|
|
.align 2, 0
|
|
_0808266C: .4byte 0xfffffd60
|
|
_08082670: .4byte gLeaderPointer
|
|
_08082674: .4byte 0x0000010d
|
|
_08082678:
|
|
ldr r1, _08082818
|
|
add r1, sp
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
add r1, sp, 0x114
|
|
lsls r0, 24
|
|
lsrs r0, 24
|
|
str r0, [r1]
|
|
add r1, sp, 0x118
|
|
adds r0, r5, 0
|
|
bl sub_8082F1C
|
|
add r1, sp, 0x13C
|
|
adds r0, r5, 0
|
|
bl sub_8082F48
|
|
add r1, sp, 0x140
|
|
adds r0, r5, 0
|
|
bl sub_8082F48
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
add r1, sp, 0x144
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
ldr r1, _0808281C
|
|
add r1, sp
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
ldr r1, _08082820
|
|
add r1, sp
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
movs r1, 0xA3
|
|
lsls r1, 1
|
|
add r1, sp
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
add r1, sp, 0x148
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
ldr r1, _08082824
|
|
add r1, sp
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
movs r1, 0xA5
|
|
lsls r1, 1
|
|
add r1, sp
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
ldr r1, _08082828
|
|
add r1, sp
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
add r1, sp, 0x14C
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8083158
|
|
movs r1, 0xA7
|
|
lsls r1, 1
|
|
add r1, sp
|
|
strh r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8083158
|
|
add r1, sp, 0x150
|
|
strh r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
movs r1, 0xA9
|
|
lsls r1, 1
|
|
add r1, sp
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
ldr r1, _0808282C
|
|
add r1, sp
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
add r1, sp, 0x154
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
ldr r1, _08082830
|
|
add r1, sp
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_80831DC
|
|
movs r1, 0xAB
|
|
lsls r1, 1
|
|
add r1, sp
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
add r1, sp, 0x164
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
ldr r1, _08082834
|
|
add r1, sp
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
movs r1, 0xB3
|
|
lsls r1, 1
|
|
add r1, sp
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
ldr r1, _08082838
|
|
add r1, sp
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
add r1, sp, 0x168
|
|
strb r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8083188
|
|
ldr r1, _0808283C
|
|
add r1, sp
|
|
strb r0, [r1]
|
|
add r1, sp, 0x16C
|
|
adds r0, r5, 0
|
|
bl sub_80831F8
|
|
adds r0, r5, 0
|
|
bl sub_80831C8
|
|
add r1, sp, 0x174
|
|
str r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8083158
|
|
add r1, sp, 0x178
|
|
strh r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8083170
|
|
add r1, sp, 0x1F8
|
|
strh r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8083170
|
|
movs r1, 0xFD
|
|
lsls r1, 1
|
|
add r1, sp
|
|
strh r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_80831A0
|
|
add r1, sp, 0x1FC
|
|
str r0, [r1]
|
|
adds r0, r5, 0
|
|
bl sub_8082CA0
|
|
ldr r3, [sp, 0x280]
|
|
strb r0, [r3]
|
|
ldr r0, _08082840
|
|
str r4, [r0]
|
|
ldr r0, [sp, 0x214]
|
|
cmp r0, 0
|
|
beq _080828BE
|
|
ldr r1, [sp, 0x20C]
|
|
cmp r1, 0
|
|
beq _08082844
|
|
mov r0, sp
|
|
movs r2, 0x2
|
|
ldrsh r0, [r0, r2]
|
|
mov r1, sp
|
|
movs r3, 0x4
|
|
ldrsh r1, [r1, r3]
|
|
ldr r2, [sp, 0x210]
|
|
bl sub_80828E0
|
|
b _08082856
|
|
.align 2, 0
|
|
_08082818: .4byte 0x00000113
|
|
_0808281C: .4byte 0x00000145
|
|
_08082820: .4byte 0x00000147
|
|
_08082824: .4byte 0x00000149
|
|
_08082828: .4byte 0x0000014b
|
|
_0808282C: .4byte 0x00000153
|
|
_08082830: .4byte 0x00000155
|
|
_08082834: .4byte 0x00000165
|
|
_08082838: .4byte 0x00000167
|
|
_0808283C: .4byte 0x00000169
|
|
_08082840: .4byte gLeaderPointer
|
|
_08082844:
|
|
mov r0, sp
|
|
movs r1, 0x2
|
|
ldrsh r0, [r0, r1]
|
|
mov r1, sp
|
|
movs r2, 0x4
|
|
ldrsh r1, [r1, r2]
|
|
ldr r2, [sp, 0x210]
|
|
bl sub_8082A08
|
|
_08082856:
|
|
adds r7, r0, 0
|
|
cmp r7, 0
|
|
beq _080828BE
|
|
ldr r6, [r7, 0x70]
|
|
movs r5, 0x82
|
|
lsls r5, 2
|
|
mov r3, sp
|
|
adds r4, r3, r5
|
|
movs r1, 0
|
|
ldrsh r0, [r4, r1]
|
|
ldr r3, _080828D4
|
|
add r3, sp
|
|
movs r2, 0
|
|
ldrsh r1, [r3, r2]
|
|
bl GetTileSafe
|
|
ldr r1, [r4]
|
|
str r1, [r7, 0x8]
|
|
ldr r1, [r4]
|
|
str r1, [r7, 0x4]
|
|
str r7, [r0, 0x10]
|
|
adds r0, r7, 0
|
|
adds r0, 0x20
|
|
movs r4, 0
|
|
add r1, sp, 0x218
|
|
ldrb r1, [r1]
|
|
strb r1, [r0]
|
|
add r2, sp, 0x21C
|
|
ldrh r2, [r2]
|
|
strh r2, [r7, 0x26]
|
|
adds r0, r6, 0
|
|
mov r1, sp
|
|
adds r2, r5, 0
|
|
bl memcpy
|
|
ldr r0, _080828D8
|
|
str r4, [r0]
|
|
ldrb r0, [r6, 0x7]
|
|
cmp r0, 0
|
|
beq _080828B0
|
|
ldr r0, _080828DC
|
|
ldrh r1, [r7, 0x4]
|
|
strh r1, [r0]
|
|
ldrh r1, [r7, 0x6]
|
|
strh r1, [r0, 0x2]
|
|
_080828B0:
|
|
adds r0, r7, 0
|
|
bl LoadIQSkills
|
|
adds r0, r7, 0
|
|
movs r1, 0
|
|
bl sub_804535C
|
|
_080828BE:
|
|
movs r3, 0xA8
|
|
lsls r3, 2
|
|
add sp, r3
|
|
pop {r3-r5}
|
|
mov r8, r3
|
|
mov r9, r4
|
|
mov r10, r5
|
|
pop {r4-r7}
|
|
pop {r0}
|
|
bx r0
|
|
.align 2, 0
|
|
_080828D4: .4byte 0x0000020a
|
|
_080828D8: .4byte gLeaderPointer
|
|
_080828DC: .4byte gUnknown_203B410
|
|
thumb_func_end sub_8082280
|
|
|
|
thumb_func_start sub_80828E0
|
|
sub_80828E0:
|
|
push {r4-r7,lr}
|
|
mov r7, r10
|
|
mov r6, r9
|
|
mov r5, r8
|
|
push {r5-r7}
|
|
adds r5, r2, 0
|
|
lsls r0, 16
|
|
asrs r0, 16
|
|
mov r10, r0
|
|
lsls r1, 16
|
|
asrs r1, 16
|
|
mov r8, r1
|
|
movs r4, 0x1
|
|
negs r4, r4
|
|
mov r0, r8
|
|
bl GetBodySize
|
|
lsls r0, 24
|
|
lsrs r6, r0, 24
|
|
movs r3, 0
|
|
movs r0, 0x6
|
|
subs r7, r0, r6
|
|
ldr r0, _08082914
|
|
mov r9, r0
|
|
b _0808291A
|
|
.align 2, 0
|
|
_08082914: .4byte gUnknown_202EE70
|
|
_08082918:
|
|
adds r3, 0x1
|
|
_0808291A:
|
|
cmp r3, r7
|
|
bgt _0808293E
|
|
movs r2, 0
|
|
cmp r2, r6
|
|
bge _08082938
|
|
mov r0, r9
|
|
adds r1, r3, r0
|
|
b _08082932
|
|
_0808292A:
|
|
adds r1, 0x1
|
|
adds r2, 0x1
|
|
cmp r2, r6
|
|
bge _08082938
|
|
_08082932:
|
|
ldrb r0, [r1]
|
|
cmp r0, 0
|
|
beq _0808292A
|
|
_08082938:
|
|
cmp r2, r6
|
|
bne _08082918
|
|
adds r4, r3, 0
|
|
_0808293E:
|
|
movs r0, 0x1
|
|
negs r0, r0
|
|
cmp r4, r0
|
|
bne _0808294A
|
|
movs r0, 0
|
|
b _080829E6
|
|
_0808294A:
|
|
ldr r2, _080829F4
|
|
ldr r0, [r2]
|
|
lsls r1, r5, 2
|
|
ldr r3, _080829F8
|
|
adds r0, r3
|
|
adds r0, r1
|
|
ldr r7, [r0]
|
|
movs r0, 0x1
|
|
mov r9, r0
|
|
str r0, [r7]
|
|
adds r0, r7, 0
|
|
adds r0, 0x24
|
|
strb r5, [r0]
|
|
lsls r0, r5, 6
|
|
adds r0, r5
|
|
lsls r0, 3
|
|
ldr r1, _080829FC
|
|
adds r0, r1
|
|
ldr r1, [r2]
|
|
adds r1, r0
|
|
str r1, [r7, 0x70]
|
|
movs r5, 0
|
|
mov r3, r10
|
|
strh r3, [r1, 0x2]
|
|
ldr r0, [r7, 0x70]
|
|
mov r1, r8
|
|
strh r1, [r0, 0x4]
|
|
ldr r0, [r7, 0x70]
|
|
strb r5, [r0, 0x6]
|
|
mov r0, r8
|
|
bl GetSpriteData
|
|
str r0, [r7, 0x64]
|
|
lsls r0, r4, 4
|
|
adds r0, 0x40
|
|
adds r1, r7, 0
|
|
adds r1, 0x68
|
|
strh r0, [r1]
|
|
adds r1, 0x2
|
|
movs r0, 0x7
|
|
strb r0, [r1]
|
|
adds r0, r7, 0
|
|
adds r0, 0x6C
|
|
strb r5, [r0]
|
|
adds r1, 0x1
|
|
movs r0, 0xFF
|
|
strb r0, [r1]
|
|
adds r0, r7, 0
|
|
adds r0, 0x6D
|
|
mov r3, r9
|
|
strb r3, [r0]
|
|
adds r0, 0x2
|
|
strb r3, [r0]
|
|
movs r0, 0
|
|
str r0, [r7, 0x1C]
|
|
bl sub_8045ACC
|
|
ldr r0, [r7, 0x70]
|
|
ldr r1, _08082A00
|
|
adds r0, r1
|
|
strb r4, [r0]
|
|
ldr r0, [r7, 0x70]
|
|
movs r3, 0xB4
|
|
lsls r3, 1
|
|
adds r0, r3
|
|
strb r6, [r0]
|
|
cmp r6, 0
|
|
beq _080829E4
|
|
ldr r3, _08082A04
|
|
movs r2, 0x1
|
|
adds r1, r6, 0
|
|
_080829D8:
|
|
adds r0, r4, r3
|
|
strb r2, [r0]
|
|
adds r4, 0x1
|
|
subs r1, 0x1
|
|
cmp r1, 0
|
|
bne _080829D8
|
|
_080829E4:
|
|
adds r0, r7, 0
|
|
_080829E6:
|
|
pop {r3-r5}
|
|
mov r8, r3
|
|
mov r9, r4
|
|
mov r10, r5
|
|
pop {r4-r7}
|
|
pop {r1}
|
|
bx r1
|
|
.align 2, 0
|
|
_080829F4: .4byte gDungeon
|
|
_080829F8: .4byte 0x0001357c
|
|
_080829FC: .4byte 0x0000069c
|
|
_08082A00: .4byte 0x00000167
|
|
_08082A04: .4byte gUnknown_202EE70
|
|
thumb_func_end sub_80828E0
|
|
|
|
thumb_func_start sub_8082A08
|
|
sub_8082A08:
|
|
push {r4-r7,lr}
|
|
mov r7, r10
|
|
mov r6, r9
|
|
mov r5, r8
|
|
push {r5-r7}
|
|
sub sp, 0x4
|
|
adds r5, r2, 0
|
|
lsls r0, 16
|
|
asrs r0, 16
|
|
str r0, [sp]
|
|
lsls r1, 16
|
|
asrs r1, 16
|
|
mov r9, r1
|
|
movs r0, 0x1
|
|
negs r0, r0
|
|
mov r8, r0
|
|
mov r0, r9
|
|
bl GetBodySize
|
|
lsls r0, 24
|
|
lsrs r6, r0, 24
|
|
movs r3, 0
|
|
movs r0, 0x10
|
|
subs r4, r0, r6
|
|
ldr r7, _08082A3C
|
|
b _08082A42
|
|
.align 2, 0
|
|
_08082A3C: .4byte gUnknown_202EE76
|
|
_08082A40:
|
|
adds r3, 0x1
|
|
_08082A42:
|
|
cmp r3, r4
|
|
bgt _08082A64
|
|
movs r2, 0
|
|
cmp r2, r6
|
|
bge _08082A5E
|
|
adds r1, r3, r7
|
|
b _08082A58
|
|
_08082A50:
|
|
adds r1, 0x1
|
|
adds r2, 0x1
|
|
cmp r2, r6
|
|
bge _08082A5E
|
|
_08082A58:
|
|
ldrb r0, [r1]
|
|
cmp r0, 0
|
|
beq _08082A50
|
|
_08082A5E:
|
|
cmp r2, r6
|
|
bne _08082A40
|
|
mov r8, r3
|
|
_08082A64:
|
|
movs r0, 0x1
|
|
negs r0, r0
|
|
cmp r8, r0
|
|
bne _08082A70
|
|
movs r0, 0
|
|
b _08082B1C
|
|
_08082A70:
|
|
ldr r2, _08082B2C
|
|
ldr r0, [r2]
|
|
lsls r1, r5, 2
|
|
ldr r3, _08082B30
|
|
adds r0, r3
|
|
adds r0, r1
|
|
ldr r7, [r0]
|
|
movs r4, 0x1
|
|
str r4, [r7]
|
|
adds r0, r7, 0
|
|
adds r0, 0x24
|
|
movs r1, 0
|
|
mov r10, r1
|
|
strb r5, [r0]
|
|
subs r0, 0x2
|
|
mov r3, r10
|
|
strb r3, [r0]
|
|
lsls r0, r5, 6
|
|
adds r0, r5
|
|
lsls r0, 3
|
|
ldr r1, _08082B34
|
|
adds r0, r1
|
|
ldr r1, [r2]
|
|
adds r1, r0
|
|
str r1, [r7, 0x70]
|
|
movs r5, 0
|
|
mov r2, sp
|
|
ldrh r2, [r2]
|
|
strh r2, [r1, 0x2]
|
|
ldr r0, [r7, 0x70]
|
|
mov r3, r9
|
|
strh r3, [r0, 0x4]
|
|
ldr r0, [r7, 0x70]
|
|
strb r4, [r0, 0x6]
|
|
mov r0, r9
|
|
bl GetSpriteData
|
|
str r0, [r7, 0x64]
|
|
mov r1, r8
|
|
lsls r0, r1, 4
|
|
adds r0, 0xA0
|
|
adds r1, r7, 0
|
|
adds r1, 0x68
|
|
strh r0, [r1]
|
|
adds r1, 0x2
|
|
movs r0, 0x7
|
|
strb r0, [r1]
|
|
adds r0, r7, 0
|
|
adds r0, 0x6C
|
|
strb r5, [r0]
|
|
adds r1, 0x1
|
|
movs r0, 0xFF
|
|
strb r0, [r1]
|
|
adds r0, r7, 0
|
|
adds r0, 0x6D
|
|
strb r4, [r0]
|
|
adds r0, 0x2
|
|
strb r4, [r0]
|
|
mov r2, r10
|
|
str r2, [r7, 0x1C]
|
|
ldr r0, [r7, 0x70]
|
|
ldr r3, _08082B38
|
|
adds r0, r3
|
|
mov r4, r8
|
|
strb r4, [r0]
|
|
ldr r0, [r7, 0x70]
|
|
movs r1, 0xB4
|
|
lsls r1, 1
|
|
adds r0, r1
|
|
strb r6, [r0]
|
|
cmp r6, 0
|
|
beq _08082B16
|
|
ldr r3, _08082B3C
|
|
movs r2, 0x1
|
|
adds r1, r6, 0
|
|
_08082B06:
|
|
mov r4, r8
|
|
adds r0, r4, r3
|
|
strb r2, [r0]
|
|
movs r0, 0x1
|
|
add r8, r0
|
|
subs r1, 0x1
|
|
cmp r1, 0
|
|
bne _08082B06
|
|
_08082B16:
|
|
bl sub_8045ACC
|
|
adds r0, r7, 0
|
|
_08082B1C:
|
|
add sp, 0x4
|
|
pop {r3-r5}
|
|
mov r8, r3
|
|
mov r9, r4
|
|
mov r10, r5
|
|
pop {r4-r7}
|
|
pop {r1}
|
|
bx r1
|
|
.align 2, 0
|
|
_08082B2C: .4byte gDungeon
|
|
_08082B30: .4byte 0x0001358c
|
|
_08082B34: .4byte 0x00000ebc
|
|
_08082B38: .4byte 0x00000167
|
|
_08082B3C: .4byte gUnknown_202EE76
|
|
thumb_func_end sub_8082A08
|
|
|
|
.align 2,0
|