mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-25 19:24:16 +01:00
split asm files
This commit is contained in:
parent
fef81187dc
commit
6f0e42a91a
5647
asm/battle_814AEAC.s
Normal file
5647
asm/battle_814AEAC.s
Normal file
File diff suppressed because it is too large
Load Diff
6204
asm/battle_ai.s
Normal file
6204
asm/battle_ai.s
Normal file
File diff suppressed because it is too large
Load Diff
52255
asm/battle_anim_80FE840.s
Normal file
52255
asm/battle_anim_80FE840.s
Normal file
File diff suppressed because it is too large
Load Diff
3089
asm/battle_message.s
Normal file
3089
asm/battle_message.s
Normal file
File diff suppressed because it is too large
Load Diff
763
asm/battle_records.s
Normal file
763
asm/battle_records.s
Normal file
@ -0,0 +1,763 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_813BF94
|
||||
sub_813BF94: @ 813BF94
|
||||
push {r4,lr}
|
||||
sub sp, 0x4
|
||||
adds r4, r0, 0
|
||||
mov r1, sp
|
||||
movs r0, 0
|
||||
strh r0, [r1]
|
||||
ldr r2, =0x01000008
|
||||
mov r0, sp
|
||||
adds r1, r4, 0
|
||||
bl CpuSet
|
||||
movs r0, 0xFF
|
||||
strb r0, [r4]
|
||||
movs r0, 0
|
||||
strh r0, [r4, 0x8]
|
||||
strh r0, [r4, 0xA]
|
||||
strh r0, [r4, 0xC]
|
||||
strh r0, [r4, 0xE]
|
||||
add sp, 0x4
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813BF94
|
||||
|
||||
thumb_func_start sub_813BFC4
|
||||
sub_813BFC4: @ 813BFC4
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
movs r5, 0x4
|
||||
_0813BFCA:
|
||||
adds r0, r4, 0
|
||||
bl sub_813BF94
|
||||
adds r4, 0x10
|
||||
subs r5, 0x1
|
||||
cmp r5, 0
|
||||
bge _0813BFCA
|
||||
movs r0, 0x17
|
||||
movs r1, 0
|
||||
bl sav12_xor_set
|
||||
movs r0, 0x18
|
||||
movs r1, 0
|
||||
bl sav12_xor_set
|
||||
movs r0, 0x19
|
||||
movs r1, 0
|
||||
bl sav12_xor_set
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_813BFC4
|
||||
|
||||
thumb_func_start sub_813BFF8
|
||||
sub_813BFF8: @ 813BFF8
|
||||
adds r1, r0, 0
|
||||
ldrh r0, [r1, 0xA]
|
||||
ldrh r2, [r1, 0xC]
|
||||
adds r0, r2
|
||||
ldrh r1, [r1, 0xE]
|
||||
adds r0, r1
|
||||
bx lr
|
||||
thumb_func_end sub_813BFF8
|
||||
|
||||
thumb_func_start sub_813C008
|
||||
sub_813C008: @ 813C008
|
||||
push {r4-r7,lr}
|
||||
adds r7, r1, 0
|
||||
lsls r2, 16
|
||||
lsrs r6, r2, 16
|
||||
movs r5, 0
|
||||
adds r4, r0, 0
|
||||
_0813C014:
|
||||
adds r0, r4, 0
|
||||
adds r1, r7, 0
|
||||
movs r2, 0x7
|
||||
bl CompareString_LimitN
|
||||
cmp r0, 0
|
||||
bne _0813C02C
|
||||
ldrh r0, [r4, 0x8]
|
||||
cmp r0, r6
|
||||
bne _0813C02C
|
||||
adds r0, r5, 0
|
||||
b _0813C036
|
||||
_0813C02C:
|
||||
adds r4, 0x10
|
||||
adds r5, 0x1
|
||||
cmp r5, 0x4
|
||||
ble _0813C014
|
||||
movs r0, 0x5
|
||||
_0813C036:
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_813C008
|
||||
|
||||
thumb_func_start sub_813C03C
|
||||
sub_813C03C: @ 813C03C
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x18
|
||||
mov r10, r0
|
||||
movs r1, 0x4
|
||||
_0813C04C:
|
||||
subs r3, r1, 0x1
|
||||
adds r6, r3, 0
|
||||
cmp r3, 0
|
||||
blt _0813C0BA
|
||||
lsls r0, r1, 4
|
||||
add r0, r10
|
||||
str r0, [sp, 0x14]
|
||||
lsls r0, r3, 4
|
||||
mov r2, r10
|
||||
adds r5, r0, r2
|
||||
movs r4, 0x50
|
||||
add r4, r10
|
||||
mov r9, r4
|
||||
add r1, r9
|
||||
mov r8, r1
|
||||
_0813C06A:
|
||||
ldr r0, [sp, 0x14]
|
||||
str r3, [sp, 0x10]
|
||||
bl sub_813BFF8
|
||||
adds r4, r0, 0
|
||||
adds r0, r5, 0
|
||||
bl sub_813BFF8
|
||||
ldr r3, [sp, 0x10]
|
||||
cmp r4, r0
|
||||
ble _0813C0B2
|
||||
mov r1, sp
|
||||
ldr r0, [sp, 0x14]
|
||||
ldm r0!, {r2,r4,r7}
|
||||
stm r1!, {r2,r4,r7}
|
||||
ldr r0, [r0]
|
||||
str r0, [r1]
|
||||
ldr r1, [sp, 0x14]
|
||||
adds r0, r5, 0
|
||||
ldm r0!, {r2,r4,r7}
|
||||
stm r1!, {r2,r4,r7}
|
||||
ldr r0, [r0]
|
||||
str r0, [r1]
|
||||
adds r1, r5, 0
|
||||
mov r0, sp
|
||||
ldm r0!, {r2,r4,r7}
|
||||
stm r1!, {r2,r4,r7}
|
||||
ldr r0, [r0]
|
||||
str r0, [r1]
|
||||
mov r7, r8
|
||||
ldrb r2, [r7]
|
||||
mov r0, r9
|
||||
adds r1, r0, r6
|
||||
ldrb r0, [r1]
|
||||
strb r0, [r7]
|
||||
strb r2, [r1]
|
||||
_0813C0B2:
|
||||
subs r5, 0x10
|
||||
subs r6, 0x1
|
||||
cmp r6, 0
|
||||
bge _0813C06A
|
||||
_0813C0BA:
|
||||
adds r1, r3, 0
|
||||
cmp r1, 0
|
||||
bgt _0813C04C
|
||||
add sp, 0x18
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_813C03C
|
||||
|
||||
thumb_func_start sub_813C0D0
|
||||
sub_813C0D0: @ 813C0D0
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
cmp r1, 0x2
|
||||
beq _0813C100
|
||||
cmp r1, 0x2
|
||||
bgt _0813C0E2
|
||||
cmp r1, 0x1
|
||||
beq _0813C0E8
|
||||
b _0813C12A
|
||||
_0813C0E2:
|
||||
cmp r1, 0x3
|
||||
beq _0813C118
|
||||
b _0813C12A
|
||||
_0813C0E8:
|
||||
ldrh r0, [r2, 0xA]
|
||||
adds r0, 0x1
|
||||
strh r0, [r2, 0xA]
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
ldr r1, =0x0000270f
|
||||
cmp r0, r1
|
||||
bls _0813C12A
|
||||
strh r1, [r2, 0xA]
|
||||
b _0813C12A
|
||||
.pool
|
||||
_0813C100:
|
||||
ldrh r0, [r2, 0xC]
|
||||
adds r0, 0x1
|
||||
strh r0, [r2, 0xC]
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
ldr r1, =0x0000270f
|
||||
cmp r0, r1
|
||||
bls _0813C12A
|
||||
strh r1, [r2, 0xC]
|
||||
b _0813C12A
|
||||
.pool
|
||||
_0813C118:
|
||||
ldrh r0, [r2, 0xE]
|
||||
adds r0, 0x1
|
||||
strh r0, [r2, 0xE]
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
ldr r1, =0x0000270f
|
||||
cmp r0, r1
|
||||
bls _0813C12A
|
||||
strh r1, [r2, 0xE]
|
||||
_0813C12A:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C0D0
|
||||
|
||||
thumb_func_start sub_813C134
|
||||
sub_813C134: @ 813C134
|
||||
push {r4,lr}
|
||||
cmp r0, 0x2
|
||||
beq _0813C14E
|
||||
cmp r0, 0x2
|
||||
bgt _0813C144
|
||||
cmp r0, 0x1
|
||||
beq _0813C14A
|
||||
b _0813C166
|
||||
_0813C144:
|
||||
cmp r0, 0x3
|
||||
beq _0813C152
|
||||
b _0813C166
|
||||
_0813C14A:
|
||||
movs r4, 0x17
|
||||
b _0813C154
|
||||
_0813C14E:
|
||||
movs r4, 0x18
|
||||
b _0813C154
|
||||
_0813C152:
|
||||
movs r4, 0x19
|
||||
_0813C154:
|
||||
adds r0, r4, 0
|
||||
bl sub_80847F8
|
||||
ldr r1, =0x0000270e
|
||||
cmp r0, r1
|
||||
bhi _0813C166
|
||||
adds r0, r4, 0
|
||||
bl sav12_xor_increment
|
||||
_0813C166:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C134
|
||||
|
||||
thumb_func_start sub_813C170
|
||||
sub_813C170: @ 813C170
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
adds r6, r0, 0
|
||||
mov r8, r1
|
||||
mov r10, r3
|
||||
ldr r0, [sp, 0x20]
|
||||
lsls r2, 16
|
||||
lsrs r7, r2, 16
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r9, r0
|
||||
mov r0, r10
|
||||
bl sub_813C134
|
||||
adds r0, r6, 0
|
||||
bl sub_813C03C
|
||||
adds r0, r6, 0
|
||||
mov r1, r8
|
||||
adds r2, r7, 0
|
||||
bl sub_813C008
|
||||
adds r5, r0, 0
|
||||
cmp r5, 0x5
|
||||
bne _0813C1D4
|
||||
movs r5, 0x4
|
||||
adds r4, r6, 0
|
||||
adds r4, 0x40
|
||||
adds r0, r4, 0
|
||||
bl sub_813BF94
|
||||
adds r0, r4, 0
|
||||
mov r1, r8
|
||||
movs r2, 0x7
|
||||
bl CopyString_LimitN
|
||||
strh r7, [r4, 0x8]
|
||||
adds r2, r6, 0
|
||||
adds r2, 0x54
|
||||
ldr r1, =0x020229e8
|
||||
mov r3, r9
|
||||
lsls r0, r3, 3
|
||||
subs r0, r3
|
||||
lsls r0, 2
|
||||
adds r0, r1
|
||||
ldrh r0, [r0, 0x1A]
|
||||
strb r0, [r2]
|
||||
_0813C1D4:
|
||||
lsls r0, r5, 4
|
||||
adds r0, r6, r0
|
||||
mov r1, r10
|
||||
bl sub_813C0D0
|
||||
adds r0, r6, 0
|
||||
bl sub_813C03C
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C170
|
||||
|
||||
thumb_func_start sub_813C1F8
|
||||
sub_813C1F8: @ 813C1F8
|
||||
push {lr}
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x00003150
|
||||
adds r0, r1
|
||||
bl sub_813BFC4
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C1F8
|
||||
|
||||
thumb_func_start sub_813C214
|
||||
sub_813C214: @ 813C214
|
||||
push {lr}
|
||||
movs r1, 0x64
|
||||
muls r1, r0
|
||||
ldr r0, =0x02039b6c
|
||||
adds r1, r0
|
||||
ldrh r0, [r1]
|
||||
adds r0, 0x1
|
||||
strh r0, [r1]
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
ldr r2, =0x0000270f
|
||||
cmp r0, r2
|
||||
bls _0813C230
|
||||
strh r2, [r1]
|
||||
_0813C230:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C214
|
||||
|
||||
thumb_func_start sub_813C23C
|
||||
sub_813C23C: @ 813C23C
|
||||
push {lr}
|
||||
movs r1, 0x64
|
||||
muls r1, r0
|
||||
ldr r0, =0x02039b6e
|
||||
adds r1, r0
|
||||
ldrh r0, [r1]
|
||||
adds r0, 0x1
|
||||
strh r0, [r1]
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
ldr r2, =0x0000270f
|
||||
cmp r0, r2
|
||||
bls _0813C258
|
||||
strh r2, [r1]
|
||||
_0813C258:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C23C
|
||||
|
||||
thumb_func_start sub_813C264
|
||||
sub_813C264: @ 813C264
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
ldr r0, =0x0202433a
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0x1
|
||||
beq _0813C27C
|
||||
cmp r0, 0x2
|
||||
beq _0813C28A
|
||||
b _0813C298
|
||||
.pool
|
||||
_0813C27C:
|
||||
eors r0, r4
|
||||
bl sub_813C214
|
||||
adds r0, r4, 0
|
||||
bl sub_813C23C
|
||||
b _0813C298
|
||||
_0813C28A:
|
||||
movs r0, 0x1
|
||||
eors r0, r4
|
||||
bl sub_813C23C
|
||||
adds r0, r4, 0
|
||||
bl sub_813C214
|
||||
_0813C298:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_813C264
|
||||
|
||||
thumb_func_start sub_813C2A0
|
||||
sub_813C2A0: @ 813C2A0
|
||||
push {r4,lr}
|
||||
sub sp, 0x4
|
||||
adds r4, r0, 0
|
||||
bl InUnionRoom
|
||||
cmp r0, 0x1
|
||||
beq _0813C2DA
|
||||
adds r0, r4, 0
|
||||
bl sub_813C264
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x00003150
|
||||
adds r0, r1
|
||||
movs r1, 0x64
|
||||
adds r3, r4, 0
|
||||
muls r3, r1
|
||||
ldr r2, =0x02039b88
|
||||
adds r1, r3, r2
|
||||
subs r2, 0x30
|
||||
adds r3, r2
|
||||
ldrh r2, [r3, 0xE]
|
||||
ldr r3, =0x0202433a
|
||||
ldrb r3, [r3]
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
str r4, [sp]
|
||||
bl sub_813C170
|
||||
_0813C2DA:
|
||||
add sp, 0x4
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C2A0
|
||||
|
||||
thumb_func_start sub_813C2F4
|
||||
sub_813C2F4: @ 813C2F4
|
||||
push {r4,lr}
|
||||
sub sp, 0xC
|
||||
ldr r4, =0x02021cc4
|
||||
movs r0, 0x17
|
||||
bl sub_80847F8
|
||||
adds r1, r0, 0
|
||||
adds r0, r4, 0
|
||||
movs r2, 0
|
||||
movs r3, 0x4
|
||||
bl ConvertIntToDecimalString
|
||||
ldr r4, =0x02021dc4
|
||||
movs r0, 0x18
|
||||
bl sub_80847F8
|
||||
adds r1, r0, 0
|
||||
adds r0, r4, 0
|
||||
movs r2, 0
|
||||
movs r3, 0x4
|
||||
bl ConvertIntToDecimalString
|
||||
ldr r4, =0x02021ec4
|
||||
movs r0, 0x19
|
||||
bl sub_80847F8
|
||||
adds r1, r0, 0
|
||||
adds r0, r4, 0
|
||||
movs r2, 0
|
||||
movs r3, 0x4
|
||||
bl ConvertIntToDecimalString
|
||||
ldr r4, =0x02021fc4
|
||||
ldr r1, =gUnknown_085EF6A1
|
||||
adds r0, r4, 0
|
||||
bl ExpandStringRefs
|
||||
movs r0, 0x1
|
||||
adds r1, r4, 0
|
||||
movs r2, 0xD0
|
||||
bl GetStringCenterAlignXOffset
|
||||
adds r3, r0, 0
|
||||
ldr r0, =0x0203ab74
|
||||
ldrb r0, [r0]
|
||||
lsls r3, 24
|
||||
lsrs r3, 24
|
||||
movs r1, 0x11
|
||||
str r1, [sp]
|
||||
movs r1, 0
|
||||
str r1, [sp, 0x4]
|
||||
str r1, [sp, 0x8]
|
||||
movs r1, 0x1
|
||||
adds r2, r4, 0
|
||||
bl Print
|
||||
add sp, 0xC
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C2F4
|
||||
|
||||
thumb_func_start sub_813C384
|
||||
sub_813C384: @ 813C384
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
sub sp, 0xC
|
||||
adds r6, r0, 0
|
||||
adds r5, r2, 0
|
||||
lsls r1, 24
|
||||
lsrs r4, r1, 24
|
||||
ldrh r0, [r6, 0xA]
|
||||
cmp r0, 0
|
||||
bne _0813C40C
|
||||
ldr r7, [r6, 0xC]
|
||||
cmp r7, 0
|
||||
bne _0813C40C
|
||||
ldr r0, =0x0203ab74
|
||||
mov r8, r0
|
||||
ldrb r0, [r0]
|
||||
ldr r2, =gUnknown_085B3D84
|
||||
lsls r4, 3
|
||||
adds r4, 0x1
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
str r4, [sp]
|
||||
str r7, [sp, 0x4]
|
||||
str r7, [sp, 0x8]
|
||||
movs r1, 0x1
|
||||
movs r3, 0x8
|
||||
bl Print
|
||||
mov r1, r8
|
||||
ldrb r0, [r1]
|
||||
ldr r5, =gUnknown_085B3D8C
|
||||
str r4, [sp]
|
||||
str r7, [sp, 0x4]
|
||||
str r7, [sp, 0x8]
|
||||
movs r1, 0x1
|
||||
adds r2, r5, 0
|
||||
movs r3, 0x50
|
||||
bl Print
|
||||
mov r1, r8
|
||||
ldrb r0, [r1]
|
||||
str r4, [sp]
|
||||
str r7, [sp, 0x4]
|
||||
str r7, [sp, 0x8]
|
||||
movs r1, 0x1
|
||||
adds r2, r5, 0
|
||||
movs r3, 0x80
|
||||
bl Print
|
||||
mov r1, r8
|
||||
ldrb r0, [r1]
|
||||
str r4, [sp]
|
||||
str r7, [sp, 0x4]
|
||||
str r7, [sp, 0x8]
|
||||
movs r1, 0x1
|
||||
adds r2, r5, 0
|
||||
movs r3, 0xB0
|
||||
bl Print
|
||||
b _0813C4A8
|
||||
.pool
|
||||
_0813C40C:
|
||||
ldr r0, =0x02021cc4
|
||||
movs r1, 0x8
|
||||
bl RepeatStringTerminator
|
||||
ldr r0, =0x02021cc4
|
||||
adds r1, r6, 0
|
||||
movs r2, 0x7
|
||||
bl CopyString_LimitN
|
||||
lsls r1, r5, 24
|
||||
lsrs r1, 24
|
||||
ldr r0, =0x02021cc4
|
||||
bl StopMusicWhileStringIsPrinted
|
||||
ldr r0, =0x0203ab74
|
||||
mov r8, r0
|
||||
ldrb r0, [r0]
|
||||
lsls r4, 3
|
||||
adds r4, 0x1
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
str r4, [sp]
|
||||
movs r5, 0
|
||||
str r5, [sp, 0x4]
|
||||
str r5, [sp, 0x8]
|
||||
movs r1, 0x1
|
||||
ldr r2, =0x02021cc4
|
||||
movs r3, 0x8
|
||||
bl Print
|
||||
ldrh r1, [r6, 0xA]
|
||||
ldr r0, =0x02021cc4
|
||||
movs r2, 0x1
|
||||
movs r3, 0x4
|
||||
bl ConvertIntToDecimalString
|
||||
mov r1, r8
|
||||
ldrb r0, [r1]
|
||||
str r4, [sp]
|
||||
str r5, [sp, 0x4]
|
||||
str r5, [sp, 0x8]
|
||||
movs r1, 0x1
|
||||
ldr r2, =0x02021cc4
|
||||
movs r3, 0x50
|
||||
bl Print
|
||||
ldrh r1, [r6, 0xC]
|
||||
ldr r0, =0x02021cc4
|
||||
movs r2, 0x1
|
||||
movs r3, 0x4
|
||||
bl ConvertIntToDecimalString
|
||||
mov r1, r8
|
||||
ldrb r0, [r1]
|
||||
str r4, [sp]
|
||||
str r5, [sp, 0x4]
|
||||
str r5, [sp, 0x8]
|
||||
movs r1, 0x1
|
||||
ldr r2, =0x02021cc4
|
||||
movs r3, 0x80
|
||||
bl Print
|
||||
ldrh r1, [r6, 0xE]
|
||||
ldr r0, =0x02021cc4
|
||||
movs r2, 0x1
|
||||
movs r3, 0x4
|
||||
bl ConvertIntToDecimalString
|
||||
mov r1, r8
|
||||
ldrb r0, [r1]
|
||||
str r4, [sp]
|
||||
str r5, [sp, 0x4]
|
||||
str r5, [sp, 0x8]
|
||||
movs r1, 0x1
|
||||
ldr r2, =0x02021cc4
|
||||
movs r3, 0xB0
|
||||
bl Print
|
||||
_0813C4A8:
|
||||
add sp, 0xC
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C384
|
||||
|
||||
thumb_func_start sub_813C4BC
|
||||
sub_813C4BC: @ 813C4BC
|
||||
push {r4-r7,lr}
|
||||
mov r7, r9
|
||||
mov r6, r8
|
||||
push {r6,r7}
|
||||
sub sp, 0xC
|
||||
ldr r6, =0x0203ab74
|
||||
ldr r0, =gUnknown_085B3D7C
|
||||
bl AddWindow
|
||||
strb r0, [r6]
|
||||
ldrb r0, [r6]
|
||||
movs r1, 0
|
||||
bl sub_81973FC
|
||||
ldrb r0, [r6]
|
||||
movs r1, 0x11
|
||||
bl FillWindowPixelBuffer
|
||||
ldr r5, =0x02021fc4
|
||||
ldr r1, =gUnknown_085EF68D
|
||||
adds r0, r5, 0
|
||||
bl ExpandStringRefs
|
||||
movs r0, 0x1
|
||||
adds r1, r5, 0
|
||||
movs r2, 0xD0
|
||||
bl GetStringCenterAlignXOffset
|
||||
adds r3, r0, 0
|
||||
ldrb r0, [r6]
|
||||
lsls r3, 24
|
||||
lsrs r3, 24
|
||||
movs r1, 0x1
|
||||
str r1, [sp]
|
||||
movs r4, 0
|
||||
str r4, [sp, 0x4]
|
||||
str r4, [sp, 0x8]
|
||||
adds r2, r5, 0
|
||||
bl Print
|
||||
ldr r0, =0x03005d8c
|
||||
mov r8, r0
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x00003150
|
||||
mov r9, r1
|
||||
add r0, r9
|
||||
bl sub_813C2F4
|
||||
ldr r1, =gUnknown_085EF6BD
|
||||
adds r0, r5, 0
|
||||
bl ExpandStringRefs
|
||||
ldrb r0, [r6]
|
||||
movs r1, 0x29
|
||||
str r1, [sp]
|
||||
str r4, [sp, 0x4]
|
||||
str r4, [sp, 0x8]
|
||||
movs r1, 0x1
|
||||
adds r2, r5, 0
|
||||
movs r3, 0
|
||||
bl Print
|
||||
mov r7, r8
|
||||
movs r6, 0xE0
|
||||
lsls r6, 19
|
||||
mov r5, r9
|
||||
_0813C540:
|
||||
ldr r2, [r7]
|
||||
adds r0, r2, r5
|
||||
lsrs r1, r6, 24
|
||||
ldr r3, =0x000031a0
|
||||
adds r2, r3
|
||||
adds r2, r4
|
||||
ldrb r2, [r2]
|
||||
bl sub_813C384
|
||||
movs r0, 0x80
|
||||
lsls r0, 18
|
||||
adds r6, r0
|
||||
adds r5, 0x10
|
||||
adds r4, 0x1
|
||||
cmp r4, 0x4
|
||||
ble _0813C540
|
||||
ldr r4, =0x0203ab74
|
||||
ldrb r0, [r4]
|
||||
bl PutWindowTilemap
|
||||
ldrb r0, [r4]
|
||||
movs r1, 0x3
|
||||
bl CopyWindowToVram
|
||||
add sp, 0xC
|
||||
pop {r3,r4}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C4BC
|
||||
|
||||
thumb_func_start sub_813C5A0
|
||||
sub_813C5A0: @ 813C5A0
|
||||
push {r4,lr}
|
||||
ldr r4, =0x0203ab74
|
||||
ldrb r0, [r4]
|
||||
movs r1, 0
|
||||
bl sub_819746C
|
||||
ldrb r0, [r4]
|
||||
bl RemoveWindow
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C5A0
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
3550
asm/battle_setup.s
Normal file
3550
asm/battle_setup.s
Normal file
File diff suppressed because it is too large
Load Diff
9774
asm/battle_transition.s
Normal file
9774
asm/battle_transition.s
Normal file
File diff suppressed because it is too large
Load Diff
1120
asm/berry.s
Normal file
1120
asm/berry.s
Normal file
File diff suppressed because it is too large
Load Diff
8788
asm/berry_blender.s
Normal file
8788
asm/berry_blender.s
Normal file
File diff suppressed because it is too large
Load Diff
1538
asm/berry_tag_screen.s
Normal file
1538
asm/berry_tag_screen.s
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,5 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
489
asm/big_shroomish_barboach.s
Normal file
489
asm/big_shroomish_barboach.s
Normal file
@ -0,0 +1,489 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_80F97C8
|
||||
sub_80F97C8: @ 80F97C8
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x8
|
||||
adds r5, r0, 0
|
||||
movs r1, 0
|
||||
bl pokemon_getattr
|
||||
lsls r0, 16
|
||||
str r0, [sp, 0x4]
|
||||
lsrs r0, 16
|
||||
str r0, [sp]
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x27
|
||||
bl pokemon_getattr
|
||||
adds r7, r0, 0
|
||||
movs r6, 0xF
|
||||
ands r7, r6
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x28
|
||||
bl pokemon_getattr
|
||||
mov r8, r0
|
||||
mov r1, r8
|
||||
ands r1, r6
|
||||
mov r8, r1
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x29
|
||||
bl pokemon_getattr
|
||||
mov r9, r0
|
||||
mov r3, r9
|
||||
ands r3, r6
|
||||
mov r9, r3
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x2A
|
||||
bl pokemon_getattr
|
||||
mov r10, r0
|
||||
ands r0, r6
|
||||
mov r10, r0
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x2B
|
||||
bl pokemon_getattr
|
||||
adds r4, r0, 0
|
||||
ands r4, r6
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x2C
|
||||
bl pokemon_getattr
|
||||
adds r2, r0, 0
|
||||
ands r2, r6
|
||||
mov r1, r8
|
||||
mov r3, r9
|
||||
eors r1, r3
|
||||
mov r8, r1
|
||||
mov r0, r8
|
||||
muls r0, r7
|
||||
movs r1, 0xFF
|
||||
ldr r3, [sp]
|
||||
ands r3, r1
|
||||
eors r0, r3
|
||||
eors r4, r2
|
||||
mov r1, r10
|
||||
muls r1, r4
|
||||
ldr r3, [sp, 0x4]
|
||||
lsrs r2, r3, 24
|
||||
eors r1, r2
|
||||
lsls r0, 8
|
||||
adds r0, r1
|
||||
add sp, 0x8
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80F97C8
|
||||
|
||||
thumb_func_start sub_80F986C
|
||||
sub_80F986C: @ 80F986C
|
||||
push {lr}
|
||||
lsls r0, 16
|
||||
lsrs r2, r0, 16
|
||||
movs r1, 0x1
|
||||
ldr r3, =gUnknown_0858D8F0
|
||||
_080F9876:
|
||||
lsls r0, r1, 3
|
||||
adds r0, r3
|
||||
ldrh r0, [r0, 0x4]
|
||||
cmp r2, r0
|
||||
bcs _080F988C
|
||||
subs r0, r1, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
b _080F9898
|
||||
.pool
|
||||
_080F988C:
|
||||
adds r0, r1, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r1, r0, 24
|
||||
cmp r1, 0xE
|
||||
bls _080F9876
|
||||
adds r0, r1, 0
|
||||
_080F9898:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80F986C
|
||||
|
||||
thumb_func_start sub_80F989C
|
||||
sub_80F989C: @ 80F989C
|
||||
push {r4-r7,lr}
|
||||
sub sp, 0x8
|
||||
adds r6, r1, 0
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
lsls r6, 16
|
||||
lsrs r6, 16
|
||||
bl SpeciesToNationalPokedexNum
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
movs r1, 0
|
||||
bl sub_80C0630
|
||||
lsls r0, 16
|
||||
lsrs r7, r0, 16
|
||||
adds r0, r6, 0
|
||||
bl sub_80F986C
|
||||
lsls r0, 24
|
||||
ldr r1, =gUnknown_0858D8F0
|
||||
lsrs r0, 21
|
||||
adds r0, r1
|
||||
ldrh r1, [r0]
|
||||
str r1, [sp]
|
||||
movs r2, 0
|
||||
str r2, [sp, 0x4]
|
||||
ldrb r2, [r0, 0x2]
|
||||
movs r3, 0
|
||||
ldrh r4, [r0, 0x4]
|
||||
movs r5, 0
|
||||
adds r0, r6, 0
|
||||
movs r1, 0
|
||||
subs r0, r4
|
||||
sbcs r1, r5
|
||||
bl __udivdi3
|
||||
ldr r2, [sp]
|
||||
ldr r3, [sp, 0x4]
|
||||
adds r2, r0
|
||||
adcs r3, r1
|
||||
str r2, [sp]
|
||||
str r3, [sp, 0x4]
|
||||
adds r0, r7, 0
|
||||
movs r1, 0
|
||||
bl __muldi3
|
||||
movs r2, 0xA
|
||||
movs r3, 0
|
||||
bl __udivdi3
|
||||
add sp, 0x8
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_80F989C
|
||||
|
||||
thumb_func_start sub_80F9910
|
||||
sub_80F9910: @ 80F9910
|
||||
push {r4,r5,lr}
|
||||
adds r5, r0, 0
|
||||
lsls r4, r1, 2
|
||||
adds r4, r1
|
||||
lsls r4, 1
|
||||
adds r0, r4, 0
|
||||
bl __floatsidf
|
||||
cmp r4, 0
|
||||
bge _080F992C
|
||||
ldr r3, _080F9974
|
||||
ldr r2, _080F9970
|
||||
bl __adddf3
|
||||
_080F992C:
|
||||
ldr r2, _080F9978
|
||||
ldr r3, _080F997C
|
||||
bl __divdf3
|
||||
bl __fixunsdfsi
|
||||
adds r4, r0, 0
|
||||
movs r1, 0xA
|
||||
bl __udivsi3
|
||||
adds r1, r0, 0
|
||||
adds r0, r5, 0
|
||||
movs r2, 0
|
||||
movs r3, 0x8
|
||||
bl ConvertIntToDecimalString
|
||||
adds r5, r0, 0
|
||||
ldr r1, _080F9980
|
||||
bl AppendString
|
||||
adds r5, r0, 0
|
||||
adds r0, r4, 0
|
||||
movs r1, 0xA
|
||||
bl __umodsi3
|
||||
adds r1, r0, 0
|
||||
adds r0, r5, 0
|
||||
movs r2, 0
|
||||
movs r3, 0x1
|
||||
bl ConvertIntToDecimalString
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_080F9970: .4byte 0x41f00000
|
||||
_080F9974: .4byte 0x00000000
|
||||
_080F9978: .4byte 0x40396666
|
||||
_080F997C: .4byte 0x66666666
|
||||
_080F9980: .4byte gUnknown_085EED24
|
||||
thumb_func_end sub_80F9910
|
||||
|
||||
thumb_func_start sub_80F9984
|
||||
sub_80F9984: @ 80F9984
|
||||
push {r4-r7,lr}
|
||||
sub sp, 0x4
|
||||
adds r7, r1, 0
|
||||
lsls r0, 16
|
||||
lsrs r6, r0, 16
|
||||
ldr r1, =0x020375f0
|
||||
ldrh r0, [r1]
|
||||
cmp r0, 0xFF
|
||||
bne _080F99A0
|
||||
movs r0, 0
|
||||
b _080F9A0A
|
||||
.pool
|
||||
_080F99A0:
|
||||
ldrh r1, [r1]
|
||||
movs r0, 0x64
|
||||
muls r1, r0
|
||||
ldr r0, =0x020244ec
|
||||
adds r5, r1, r0
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x2D
|
||||
bl pokemon_getattr
|
||||
cmp r0, 0x1
|
||||
beq _080F99C2
|
||||
adds r0, r5, 0
|
||||
movs r1, 0xB
|
||||
bl pokemon_getattr
|
||||
cmp r0, r6
|
||||
beq _080F99CC
|
||||
_080F99C2:
|
||||
movs r0, 0x1
|
||||
b _080F9A0A
|
||||
.pool
|
||||
_080F99CC:
|
||||
mov r4, sp
|
||||
adds r0, r5, 0
|
||||
bl sub_80F97C8
|
||||
strh r0, [r4]
|
||||
mov r0, sp
|
||||
ldrh r1, [r0]
|
||||
adds r0, r6, 0
|
||||
bl sub_80F989C
|
||||
adds r5, r0, 0
|
||||
ldrh r1, [r7]
|
||||
adds r0, r6, 0
|
||||
bl sub_80F989C
|
||||
adds r4, r0, 0
|
||||
ldr r0, =0x02021dc4
|
||||
adds r1, r5, 0
|
||||
bl sub_80F9910
|
||||
cmp r5, r4
|
||||
bls _080F9A08
|
||||
mov r0, sp
|
||||
ldrh r0, [r0]
|
||||
strh r0, [r7]
|
||||
movs r0, 0x3
|
||||
b _080F9A0A
|
||||
.pool
|
||||
_080F9A08:
|
||||
movs r0, 0x2
|
||||
_080F9A0A:
|
||||
add sp, 0x4
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80F9984
|
||||
|
||||
thumb_func_start sub_80F9A14
|
||||
sub_80F9A14: @ 80F9A14
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
adds r5, r1, 0
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
ldrh r1, [r5]
|
||||
adds r0, r4, 0
|
||||
bl sub_80F989C
|
||||
adds r1, r0, 0
|
||||
ldr r0, =0x02021ec4
|
||||
bl sub_80F9910
|
||||
ldr r0, =0x02021cc4
|
||||
movs r1, 0xB
|
||||
muls r1, r4
|
||||
ldr r2, =gSpeciesNames
|
||||
adds r1, r2
|
||||
bl CopyString
|
||||
ldrh r1, [r5]
|
||||
movs r0, 0x80
|
||||
lsls r0, 8
|
||||
cmp r1, r0
|
||||
bne _080F9A64
|
||||
ldr r0, =0x02021dc4
|
||||
ldr r1, =gUnknown_085ECF6B
|
||||
bl CopyString
|
||||
b _080F9A6E
|
||||
.pool
|
||||
_080F9A64:
|
||||
ldr r0, =0x02021dc4
|
||||
ldr r1, =0x03005d90
|
||||
ldr r1, [r1]
|
||||
bl CopyString
|
||||
_080F9A6E:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80F9A14
|
||||
|
||||
thumb_func_start sub_80F9A7C
|
||||
sub_80F9A7C: @ 80F9A7C
|
||||
push {lr}
|
||||
ldr r0, =0x00004047
|
||||
movs r1, 0x80
|
||||
lsls r1, 8
|
||||
bl VarSet
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80F9A7C
|
||||
|
||||
thumb_func_start sub_80F9A90
|
||||
sub_80F9A90: @ 80F9A90
|
||||
push {lr}
|
||||
ldr r0, =0x00004047
|
||||
bl GetVarPointer
|
||||
adds r1, r0, 0
|
||||
movs r0, 0x95
|
||||
lsls r0, 1
|
||||
bl sub_80F9A14
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80F9A90
|
||||
|
||||
thumb_func_start sub_80F9AAC
|
||||
sub_80F9AAC: @ 80F9AAC
|
||||
push {r4,lr}
|
||||
ldr r0, =0x00004047
|
||||
bl GetVarPointer
|
||||
adds r1, r0, 0
|
||||
ldr r4, =0x020375f0
|
||||
movs r0, 0x95
|
||||
lsls r0, 1
|
||||
bl sub_80F9984
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r4]
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80F9AAC
|
||||
|
||||
thumb_func_start sub_80F9AD4
|
||||
sub_80F9AD4: @ 80F9AD4
|
||||
push {lr}
|
||||
ldr r0, =0x0000404f
|
||||
movs r1, 0x80
|
||||
lsls r1, 8
|
||||
bl VarSet
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80F9AD4
|
||||
|
||||
thumb_func_start sub_80F9AE8
|
||||
sub_80F9AE8: @ 80F9AE8
|
||||
push {lr}
|
||||
ldr r0, =0x0000404f
|
||||
bl GetVarPointer
|
||||
adds r1, r0, 0
|
||||
ldr r0, =0x00000127
|
||||
bl sub_80F9A14
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80F9AE8
|
||||
|
||||
thumb_func_start sub_80F9B04
|
||||
sub_80F9B04: @ 80F9B04
|
||||
push {r4,lr}
|
||||
ldr r0, =0x0000404f
|
||||
bl GetVarPointer
|
||||
adds r1, r0, 0
|
||||
ldr r4, =0x020375f0
|
||||
ldr r0, =0x00000127
|
||||
bl sub_80F9984
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r4]
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80F9B04
|
||||
|
||||
thumb_func_start sub_80F9B30
|
||||
sub_80F9B30: @ 80F9B30
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
sub sp, 0xC
|
||||
lsls r0, 24
|
||||
lsrs r6, r0, 24
|
||||
lsls r1, 24
|
||||
lsrs r5, r1, 24
|
||||
movs r7, 0
|
||||
add r4, sp, 0x8
|
||||
movs r0, 0x1
|
||||
strb r0, [r4]
|
||||
ldr r1, =gUnknown_0858D970
|
||||
mov r0, sp
|
||||
movs r2, 0x7
|
||||
bl memcpy
|
||||
mov r8, r4
|
||||
cmp r6, 0xA
|
||||
bhi _080F9BAC
|
||||
cmp r5, 0x40
|
||||
bhi _080F9BAC
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x000031a8
|
||||
adds r0, r1
|
||||
adds r0, r6
|
||||
strb r5, [r0]
|
||||
movs r5, 0
|
||||
_080F9B6A:
|
||||
movs r0, 0x64
|
||||
adds r1, r5, 0
|
||||
muls r1, r0
|
||||
ldr r0, =0x020244ec
|
||||
adds r4, r1, r0
|
||||
adds r0, r4, 0
|
||||
movs r1, 0xB
|
||||
bl pokemon_getattr
|
||||
cmp r0, 0
|
||||
beq _080F9B9C
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x6
|
||||
bl pokemon_getattr
|
||||
cmp r0, 0
|
||||
bne _080F9B9C
|
||||
mov r1, sp
|
||||
adds r0, r1, r6
|
||||
ldrb r1, [r0]
|
||||
adds r0, r4, 0
|
||||
mov r2, r8
|
||||
bl pokemon_setattr
|
||||
movs r7, 0x1
|
||||
_080F9B9C:
|
||||
adds r5, 0x1
|
||||
cmp r5, 0x5
|
||||
ble _080F9B6A
|
||||
cmp r7, 0
|
||||
beq _080F9BAC
|
||||
ldr r0, =0x0000089b
|
||||
bl FlagSet
|
||||
_080F9BAC:
|
||||
add sp, 0xC
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80F9B30
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
2199
asm/bike.s
Normal file
2199
asm/bike.s
Normal file
File diff suppressed because it is too large
Load Diff
90
asm/blend_palette.s
Normal file
90
asm/blend_palette.s
Normal file
@ -0,0 +1,90 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start pal_fade_1
|
||||
pal_fade_1: @ 806F98C
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x4
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
mov r8, r0
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
mov r12, r1
|
||||
lsls r2, 24
|
||||
lsrs r7, r2, 24
|
||||
mov r0, sp
|
||||
strh r3, [r0]
|
||||
movs r6, 0
|
||||
cmp r6, r12
|
||||
bcs _0806FA12
|
||||
ldr r0, =0x02037714
|
||||
mov r10, r0
|
||||
ldr r1, =0x02037b14
|
||||
mov r9, r1
|
||||
_0806F9BA:
|
||||
mov r0, r8
|
||||
adds r5, r6, r0
|
||||
lsls r5, 16
|
||||
lsrs r5, 15
|
||||
mov r1, r10
|
||||
adds r0, r5, r1
|
||||
ldr r3, [r0]
|
||||
lsls r4, r3, 27
|
||||
lsls r2, r3, 22
|
||||
lsls r3, 17
|
||||
add r5, r9
|
||||
lsrs r4, 27
|
||||
ldr r1, [sp]
|
||||
lsls r0, r1, 27
|
||||
lsrs r0, 27
|
||||
subs r0, r4
|
||||
muls r0, r7
|
||||
asrs r0, 4
|
||||
adds r4, r0
|
||||
lsrs r2, 27
|
||||
lsls r0, r1, 22
|
||||
lsrs r0, 27
|
||||
subs r0, r2
|
||||
muls r0, r7
|
||||
asrs r0, 4
|
||||
adds r2, r0
|
||||
lsls r2, 5
|
||||
orrs r4, r2
|
||||
lsrs r3, 27
|
||||
lsls r1, 17
|
||||
lsrs r1, 27
|
||||
subs r1, r3
|
||||
adds r0, r1, 0
|
||||
muls r0, r7
|
||||
asrs r0, 4
|
||||
adds r3, r0
|
||||
lsls r3, 10
|
||||
orrs r4, r3
|
||||
strh r4, [r5]
|
||||
adds r0, r6, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r6, r0, 16
|
||||
cmp r6, r12
|
||||
bcc _0806F9BA
|
||||
_0806FA12:
|
||||
add sp, 0x4
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end pal_fade_1
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
@ -1,4 +1,5 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
2882
asm/cable_car.s
Normal file
2882
asm/cable_car.s
Normal file
File diff suppressed because it is too large
Load Diff
762
asm/cable_car_util.s
Normal file
762
asm/cable_car_util.s
Normal file
@ -0,0 +1,762 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_81520A8
|
||||
sub_81520A8: @ 81520A8
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x4
|
||||
mov r10, r0
|
||||
ldr r0, [sp, 0x24]
|
||||
ldr r4, [sp, 0x28]
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
mov r9, r1
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
str r2, [sp]
|
||||
lsls r3, 24
|
||||
lsls r0, 24
|
||||
lsrs r7, r0, 24
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
mov r8, r4
|
||||
movs r0, 0
|
||||
lsrs r4, r3, 24
|
||||
cmp r0, r8
|
||||
bcs _08152122
|
||||
_081520DA:
|
||||
ldr r2, [sp]
|
||||
movs r3, 0
|
||||
adds r6, r4, 0x1
|
||||
adds r0, 0x1
|
||||
mov r12, r0
|
||||
cmp r3, r7
|
||||
bcs _0815210C
|
||||
lsls r5, r4, 6
|
||||
_081520EA:
|
||||
lsls r0, r2, 1
|
||||
adds r0, r5
|
||||
add r0, r10
|
||||
mov r1, r9
|
||||
strh r1, [r0]
|
||||
adds r1, r2, 0x1
|
||||
adds r0, r1, 0
|
||||
asrs r0, 5
|
||||
lsls r0, 5
|
||||
subs r0, r1, r0
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
adds r0, r3, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
cmp r3, r7
|
||||
bcc _081520EA
|
||||
_0815210C:
|
||||
adds r0, r6, 0
|
||||
asrs r0, 5
|
||||
lsls r0, 5
|
||||
subs r0, r6, r0
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
mov r1, r12
|
||||
lsls r0, r1, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, r8
|
||||
bcc _081520DA
|
||||
_08152122:
|
||||
add sp, 0x4
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81520A8
|
||||
|
||||
thumb_func_start sub_8152134
|
||||
sub_8152134: @ 8152134
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x4
|
||||
mov r10, r0
|
||||
ldr r0, [sp, 0x24]
|
||||
ldr r4, [sp, 0x28]
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
str r2, [sp]
|
||||
lsls r3, 24
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r12, r0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
mov r9, r4
|
||||
movs r0, 0
|
||||
adds r5, r1, 0
|
||||
lsrs r4, r3, 24
|
||||
cmp r0, r9
|
||||
bcs _081521AE
|
||||
_08152164:
|
||||
ldr r2, [sp]
|
||||
movs r3, 0
|
||||
adds r7, r4, 0x1
|
||||
adds r0, 0x1
|
||||
mov r8, r0
|
||||
cmp r3, r12
|
||||
bcs _08152198
|
||||
lsls r6, r4, 6
|
||||
_08152174:
|
||||
lsls r0, r2, 1
|
||||
adds r0, r6
|
||||
add r0, r10
|
||||
ldrh r1, [r5]
|
||||
strh r1, [r0]
|
||||
adds r5, 0x2
|
||||
adds r1, r2, 0x1
|
||||
adds r0, r1, 0
|
||||
asrs r0, 5
|
||||
lsls r0, 5
|
||||
subs r0, r1, r0
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
adds r0, r3, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
cmp r3, r12
|
||||
bcc _08152174
|
||||
_08152198:
|
||||
adds r0, r7, 0
|
||||
asrs r0, 5
|
||||
lsls r0, 5
|
||||
subs r0, r7, r0
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
mov r1, r8
|
||||
lsls r0, r1, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, r9
|
||||
bcc _08152164
|
||||
_081521AE:
|
||||
add sp, 0x4
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_8152134
|
||||
|
||||
thumb_func_start sub_81521C0
|
||||
sub_81521C0: @ 81521C0
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
movs r5, 0
|
||||
cmp r4, 0
|
||||
beq _081521FE
|
||||
cmp r4, 0x40
|
||||
bls _081521D6
|
||||
movs r4, 0x40
|
||||
_081521D6:
|
||||
ldr r6, =0x0203abb8
|
||||
movs r0, 0x8
|
||||
bl AllocZeroed
|
||||
str r0, [r6]
|
||||
cmp r0, 0
|
||||
beq _081521FE
|
||||
lsls r0, r4, 1
|
||||
adds r0, r4
|
||||
lsls r0, 4
|
||||
bl AllocZeroed
|
||||
ldr r1, [r6]
|
||||
str r0, [r1, 0x4]
|
||||
cmp r0, 0
|
||||
bne _08152208
|
||||
adds r0, r1, 0
|
||||
bl Free
|
||||
str r5, [r6]
|
||||
_081521FE:
|
||||
movs r0, 0
|
||||
b _08152244
|
||||
.pool
|
||||
_08152208:
|
||||
strb r4, [r1]
|
||||
cmp r5, r4
|
||||
bcs _08152242
|
||||
adds r3, r6, 0
|
||||
ldr r0, =gDefaultOamAttributes
|
||||
mov r12, r0
|
||||
movs r2, 0x4
|
||||
mov r8, r2
|
||||
_08152218:
|
||||
ldr r0, [r3]
|
||||
ldr r2, [r0, 0x4]
|
||||
lsls r1, r5, 1
|
||||
adds r1, r5
|
||||
lsls r1, 4
|
||||
adds r2, r1, r2
|
||||
mov r0, r12
|
||||
ldm r0!, {r6,r7}
|
||||
stm r2!, {r6,r7}
|
||||
ldr r0, [r3]
|
||||
ldr r0, [r0, 0x4]
|
||||
adds r1, r0
|
||||
ldrb r0, [r1, 0x19]
|
||||
mov r2, r8
|
||||
orrs r0, r2
|
||||
strb r0, [r1, 0x19]
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
cmp r5, r4
|
||||
bcc _08152218
|
||||
_08152242:
|
||||
movs r0, 0x1
|
||||
_08152244:
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81521C0
|
||||
|
||||
thumb_func_start sub_8152254
|
||||
sub_8152254: @ 8152254
|
||||
push {r4-r7,lr}
|
||||
movs r3, 0
|
||||
ldr r0, =0x0203abb8
|
||||
ldr r2, [r0]
|
||||
adds r5, r0, 0
|
||||
cmp r2, 0
|
||||
bne _0815226C
|
||||
movs r0, 0
|
||||
b _081522C4
|
||||
.pool
|
||||
_0815226C:
|
||||
ldrb r2, [r2]
|
||||
cmp r3, r2
|
||||
bcs _08152292
|
||||
ldr r0, =0x030024f8
|
||||
mov r12, r0
|
||||
ldr r4, =gDefaultOamAttributes
|
||||
adds r2, r5, 0
|
||||
_0815227A:
|
||||
lsls r1, r3, 3
|
||||
add r1, r12
|
||||
adds r0, r4, 0
|
||||
ldm r0!, {r6,r7}
|
||||
stm r1!, {r6,r7}
|
||||
adds r0, r3, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
ldr r0, [r2]
|
||||
ldrb r0, [r0]
|
||||
cmp r3, r0
|
||||
bcc _0815227A
|
||||
_08152292:
|
||||
ldr r1, [r5]
|
||||
ldrb r0, [r1]
|
||||
lsls r2, r0, 1
|
||||
adds r2, r0
|
||||
ldr r0, [r1, 0x4]
|
||||
lsls r2, 4
|
||||
movs r1, 0
|
||||
bl memset
|
||||
ldr r0, [r5]
|
||||
ldr r0, [r0, 0x4]
|
||||
bl Free
|
||||
ldr r0, [r5]
|
||||
movs r4, 0
|
||||
str r4, [r0, 0x4]
|
||||
movs r1, 0
|
||||
movs r2, 0x8
|
||||
bl memset
|
||||
ldr r0, [r5]
|
||||
bl Free
|
||||
str r4, [r5]
|
||||
movs r0, 0x1
|
||||
_081522C4:
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_8152254
|
||||
|
||||
thumb_func_start sub_81522D4
|
||||
sub_81522D4: @ 81522D4
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
movs r6, 0
|
||||
ldr r0, =0x0203abb8
|
||||
ldr r1, [r0]
|
||||
adds r3, r0, 0
|
||||
cmp r1, 0
|
||||
beq _081522EC
|
||||
ldr r0, [r1, 0x4]
|
||||
cmp r0, 0
|
||||
bne _081522F4
|
||||
_081522EC:
|
||||
movs r0, 0
|
||||
b _081523D2
|
||||
.pool
|
||||
_081522F4:
|
||||
ldrb r1, [r1]
|
||||
cmp r6, r1
|
||||
bcs _081523D0
|
||||
adds r7, r3, 0
|
||||
movs r0, 0x3
|
||||
mov r8, r0
|
||||
_08152300:
|
||||
ldr r0, [r7]
|
||||
ldr r1, [r0, 0x4]
|
||||
lsls r0, r6, 1
|
||||
adds r0, r6
|
||||
lsls r5, r0, 4
|
||||
adds r2, r5, r1
|
||||
ldrb r1, [r2, 0x19]
|
||||
movs r0, 0x3
|
||||
ands r0, r1
|
||||
cmp r0, 0x3
|
||||
bne _081523C2
|
||||
ldr r1, [r2, 0x2C]
|
||||
cmp r1, 0
|
||||
beq _08152322
|
||||
adds r0, r2, 0
|
||||
bl _call_via_r1
|
||||
_08152322:
|
||||
ldr r0, [r7]
|
||||
ldr r0, [r0, 0x4]
|
||||
adds r2, r5, r0
|
||||
ldrb r1, [r2, 0x19]
|
||||
movs r0, 0x4
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _08152348
|
||||
lsls r0, r6, 3
|
||||
ldr r1, =0x030024f8
|
||||
adds r0, r1
|
||||
ldr r1, =gDefaultOamAttributes
|
||||
ldm r1!, {r2,r3}
|
||||
stm r0!, {r2,r3}
|
||||
b _081523C0
|
||||
.pool
|
||||
_08152348:
|
||||
ldrb r0, [r2, 0xE]
|
||||
ldrb r4, [r2, 0xA]
|
||||
adds r0, r4
|
||||
strb r0, [r2]
|
||||
ldr r4, [r7]
|
||||
ldr r3, [r4, 0x4]
|
||||
adds r3, r5, r3
|
||||
movs r0, 0x8
|
||||
ldrsh r2, [r3, r0]
|
||||
movs r1, 0xC
|
||||
ldrsh r0, [r3, r1]
|
||||
adds r2, r0
|
||||
ldr r1, =0x000001ff
|
||||
adds r0, r1, 0
|
||||
ands r2, r0
|
||||
ldrh r0, [r3, 0x2]
|
||||
ldr r1, =0xfffffe00
|
||||
mov r12, r1
|
||||
mov r1, r12
|
||||
ands r0, r1
|
||||
orrs r0, r2
|
||||
strh r0, [r3, 0x2]
|
||||
ldr r3, [r4, 0x4]
|
||||
adds r3, r5, r3
|
||||
ldrb r0, [r3, 0x19]
|
||||
lsls r0, 27
|
||||
lsrs r0, 30
|
||||
mov r2, r8
|
||||
ands r0, r2
|
||||
lsls r0, 2
|
||||
ldrb r1, [r3, 0x5]
|
||||
movs r4, 0xD
|
||||
negs r4, r4
|
||||
adds r2, r4, 0
|
||||
ands r1, r2
|
||||
orrs r1, r0
|
||||
strb r1, [r3, 0x5]
|
||||
ldr r4, [r7]
|
||||
ldr r2, [r4, 0x4]
|
||||
adds r2, r5, r2
|
||||
ldrh r3, [r2, 0x14]
|
||||
ldr r1, =0x000003ff
|
||||
adds r0, r1, 0
|
||||
adds r1, r3, 0
|
||||
ands r1, r0
|
||||
mov r12, r1
|
||||
ldrh r0, [r2, 0x4]
|
||||
ldr r3, =0xfffffc00
|
||||
adds r1, r3, 0
|
||||
ands r0, r1
|
||||
mov r1, r12
|
||||
orrs r0, r1
|
||||
strh r0, [r2, 0x4]
|
||||
lsls r1, r6, 3
|
||||
ldr r2, =0x030024f8
|
||||
ldr r0, [r4, 0x4]
|
||||
adds r1, r2
|
||||
adds r0, r5, r0
|
||||
ldm r0!, {r2,r3}
|
||||
stm r1!, {r2,r3}
|
||||
_081523C0:
|
||||
ldr r3, =0x0203abb8
|
||||
_081523C2:
|
||||
adds r0, r6, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r6, r0, 24
|
||||
ldr r0, [r3]
|
||||
ldrb r0, [r0]
|
||||
cmp r6, r0
|
||||
bcc _08152300
|
||||
_081523D0:
|
||||
movs r0, 0x1
|
||||
_081523D2:
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81522D4
|
||||
|
||||
thumb_func_start sub_81523F4
|
||||
sub_81523F4: @ 81523F4
|
||||
push {r4-r6,lr}
|
||||
adds r4, r0, 0
|
||||
lsls r1, 24
|
||||
lsrs r6, r1, 24
|
||||
cmp r4, 0
|
||||
beq _08152430
|
||||
ldrh r0, [r4, 0x10]
|
||||
bl GetObjectTileRangeStartByTag
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
ldr r0, =0x0000ffff
|
||||
cmp r5, r0
|
||||
beq _08152430
|
||||
strb r6, [r4, 0x18]
|
||||
ldrb r0, [r4, 0x1]
|
||||
lsrs r0, 6
|
||||
ldrb r1, [r4, 0x3]
|
||||
lsrs r1, 6
|
||||
bl sub_80355F8
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
muls r0, r6
|
||||
adds r0, r5, r0
|
||||
strh r0, [r4, 0x14]
|
||||
movs r0, 0x1
|
||||
b _08152432
|
||||
.pool
|
||||
_08152430:
|
||||
movs r0, 0
|
||||
_08152432:
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81523F4
|
||||
|
||||
thumb_func_start sub_8152438
|
||||
sub_8152438: @ 8152438
|
||||
push {r4,lr}
|
||||
adds r4, r1, 0
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
ldr r0, =0x0203abb8
|
||||
ldr r0, [r0]
|
||||
cmp r0, 0
|
||||
beq _0815246C
|
||||
ldrb r1, [r0]
|
||||
cmp r2, r1
|
||||
bcs _0815246C
|
||||
ldr r1, [r0, 0x4]
|
||||
lsls r0, r2, 1
|
||||
adds r0, r2
|
||||
lsls r0, 4
|
||||
adds r3, r0, r1
|
||||
ldrb r1, [r3, 0x19]
|
||||
movs r0, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _0815246C
|
||||
str r4, [r3, 0x2C]
|
||||
adds r0, r2, 0
|
||||
b _0815246E
|
||||
.pool
|
||||
_0815246C:
|
||||
movs r0, 0xFF
|
||||
_0815246E:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8152438
|
||||
|
||||
thumb_func_start sub_8152474
|
||||
sub_8152474: @ 8152474
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
lsls r1, 24
|
||||
lsrs r4, r1, 24
|
||||
lsls r2, 16
|
||||
lsrs r5, r2, 16
|
||||
ldr r0, =0x0203abb8
|
||||
ldr r0, [r0]
|
||||
cmp r0, 0
|
||||
beq _081524A8
|
||||
ldrb r1, [r0]
|
||||
cmp r3, r1
|
||||
bcs _081524A8
|
||||
ldr r1, [r0, 0x4]
|
||||
lsls r0, r3, 1
|
||||
adds r0, r3
|
||||
lsls r0, 4
|
||||
adds r2, r0, r1
|
||||
ldrb r1, [r2, 0x19]
|
||||
movs r0, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _081524A8
|
||||
cmp r4, 0x7
|
||||
bls _081524B0
|
||||
_081524A8:
|
||||
movs r0, 0xFF
|
||||
b _081524BC
|
||||
.pool
|
||||
_081524B0:
|
||||
lsls r1, r4, 1
|
||||
adds r0, r2, 0
|
||||
adds r0, 0x1A
|
||||
adds r0, r1
|
||||
strh r5, [r0]
|
||||
adds r0, r3, 0
|
||||
_081524BC:
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8152474
|
||||
|
||||
thumb_func_start sub_81524C4
|
||||
sub_81524C4: @ 81524C4
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x10
|
||||
mov r9, r0
|
||||
ldr r0, [sp, 0x30]
|
||||
ldr r4, [sp, 0x34]
|
||||
ldr r5, [sp, 0x38]
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
str r1, [sp]
|
||||
lsls r2, 16
|
||||
lsrs r2, 16
|
||||
mov r8, r2
|
||||
lsls r3, 16
|
||||
lsrs r3, 16
|
||||
str r3, [sp, 0x4]
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
str r0, [sp, 0x8]
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
str r4, [sp, 0xC]
|
||||
lsls r5, 24
|
||||
lsrs r5, 24
|
||||
mov r10, r5
|
||||
movs r5, 0
|
||||
ldr r0, =0x0203abb8
|
||||
ldr r0, [r0]
|
||||
cmp r0, 0
|
||||
beq _0815255E
|
||||
mov r1, r9
|
||||
cmp r1, 0
|
||||
bne _08152530
|
||||
b _0815255E
|
||||
.pool
|
||||
_08152514:
|
||||
adds r5, r2, 0
|
||||
adds r0, r5, 0
|
||||
movs r1, 0
|
||||
movs r2, 0x30
|
||||
bl memset
|
||||
strb r4, [r5, 0x16]
|
||||
ldrb r0, [r5, 0x19]
|
||||
movs r1, 0x1
|
||||
orrs r0, r1
|
||||
movs r1, 0x2
|
||||
orrs r0, r1
|
||||
strb r0, [r5, 0x19]
|
||||
b _0815255A
|
||||
_08152530:
|
||||
movs r4, 0
|
||||
ldrb r1, [r0]
|
||||
cmp r5, r1
|
||||
bcs _0815255A
|
||||
ldr r6, [r0, 0x4]
|
||||
adds r3, r1, 0
|
||||
movs r7, 0x1
|
||||
_0815253E:
|
||||
lsls r0, r4, 1
|
||||
adds r0, r4
|
||||
lsls r0, 4
|
||||
adds r2, r0, r6
|
||||
ldrb r1, [r2, 0x19]
|
||||
adds r0, r7, 0
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _08152514
|
||||
adds r0, r4, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
cmp r4, r3
|
||||
bcc _0815253E
|
||||
_0815255A:
|
||||
cmp r5, 0
|
||||
bne _08152562
|
||||
_0815255E:
|
||||
movs r0, 0xFF
|
||||
b _081525C0
|
||||
_08152562:
|
||||
adds r1, r5, 0
|
||||
mov r0, r9
|
||||
ldm r0!, {r2,r3}
|
||||
stm r1!, {r2,r3}
|
||||
mov r0, sp
|
||||
ldrh r0, [r0]
|
||||
strh r0, [r5, 0x10]
|
||||
mov r1, r8
|
||||
strh r1, [r5, 0x12]
|
||||
mov r2, sp
|
||||
ldrh r2, [r2, 0x4]
|
||||
strh r2, [r5, 0x8]
|
||||
mov r3, sp
|
||||
ldrh r3, [r3, 0x8]
|
||||
strh r3, [r5, 0xA]
|
||||
mov r0, r8
|
||||
bl IndexOfObjectPaletteTag
|
||||
lsls r0, 4
|
||||
ldrb r1, [r5, 0x5]
|
||||
movs r4, 0xF
|
||||
ands r4, r1
|
||||
orrs r4, r0
|
||||
strb r4, [r5, 0x5]
|
||||
mov r0, r10
|
||||
cmp r0, 0x3
|
||||
bhi _081525B6
|
||||
movs r1, 0x3
|
||||
ands r1, r0
|
||||
lsls r3, r1, 3
|
||||
ldrb r2, [r5, 0x19]
|
||||
movs r0, 0x19
|
||||
negs r0, r0
|
||||
ands r0, r2
|
||||
orrs r0, r3
|
||||
strb r0, [r5, 0x19]
|
||||
lsls r1, 2
|
||||
movs r0, 0xD
|
||||
negs r0, r0
|
||||
ands r4, r0
|
||||
orrs r4, r1
|
||||
strb r4, [r5, 0x5]
|
||||
_081525B6:
|
||||
adds r0, r5, 0
|
||||
ldr r1, [sp, 0xC]
|
||||
bl sub_81523F4
|
||||
ldrb r0, [r5, 0x16]
|
||||
_081525C0:
|
||||
add sp, 0x10
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81524C4
|
||||
|
||||
thumb_func_start sub_81525D0
|
||||
sub_81525D0: @ 81525D0
|
||||
push {r4-r6,lr}
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
ldr r6, =0x0203abb8
|
||||
ldr r0, [r6]
|
||||
cmp r0, 0
|
||||
beq _081525F2
|
||||
ldr r1, [r0, 0x4]
|
||||
lsls r0, r5, 1
|
||||
adds r0, r5
|
||||
lsls r4, r0, 4
|
||||
adds r2, r4, r1
|
||||
ldrb r1, [r2, 0x19]
|
||||
movs r0, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _081525FC
|
||||
_081525F2:
|
||||
movs r0, 0xFF
|
||||
b _0815263C
|
||||
.pool
|
||||
_081525FC:
|
||||
adds r0, r2, 0
|
||||
movs r1, 0
|
||||
movs r2, 0x30
|
||||
bl memset
|
||||
ldr r0, [r6]
|
||||
ldr r0, [r0, 0x4]
|
||||
adds r0, r4, r0
|
||||
movs r1, 0xA0
|
||||
strb r1, [r0]
|
||||
ldr r3, [r6]
|
||||
ldr r2, [r3, 0x4]
|
||||
adds r2, r4, r2
|
||||
ldrh r1, [r2, 0x2]
|
||||
ldr r0, =0xfffffe00
|
||||
ands r0, r1
|
||||
movs r1, 0xF0
|
||||
orrs r0, r1
|
||||
strh r0, [r2, 0x2]
|
||||
ldr r1, [r3, 0x4]
|
||||
adds r1, r4, r1
|
||||
ldrb r0, [r1, 0x19]
|
||||
movs r2, 0x4
|
||||
orrs r0, r2
|
||||
strb r0, [r1, 0x19]
|
||||
lsls r1, r5, 3
|
||||
ldr r0, =0x030024f8
|
||||
adds r1, r0
|
||||
ldr r0, =gDefaultOamAttributes
|
||||
ldm r0!, {r2,r3}
|
||||
stm r1!, {r2,r3}
|
||||
adds r0, r5, 0
|
||||
_0815263C:
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81525D0
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
2842
asm/cable_club.s
Normal file
2842
asm/cable_club.s
Normal file
File diff suppressed because it is too large
Load Diff
1045
asm/calculate_base_damage.s
Normal file
1045
asm/calculate_base_damage.s
Normal file
File diff suppressed because it is too large
Load Diff
399
asm/clear_save_data_screen.s
Normal file
399
asm/clear_save_data_screen.s
Normal file
@ -0,0 +1,399 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start c2_clear_save_data_screen_2
|
||||
c2_clear_save_data_screen_2: @ 817ACC8
|
||||
push {lr}
|
||||
bl sub_817AE00
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _0817ACDC
|
||||
ldr r0, =sub_817ACE4
|
||||
movs r1, 0
|
||||
bl CreateTask
|
||||
_0817ACDC:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end c2_clear_save_data_screen_2
|
||||
|
||||
thumb_func_start sub_817ACE4
|
||||
sub_817ACE4: @ 817ACE4
|
||||
push {r4,lr}
|
||||
sub sp, 0xC
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0x2
|
||||
movs r3, 0xE
|
||||
bl SetWindowBorderStyle
|
||||
ldr r2, =gUnknown_085EFA8F
|
||||
movs r0, 0x1
|
||||
str r0, [sp]
|
||||
movs r0, 0
|
||||
str r0, [sp, 0x4]
|
||||
str r0, [sp, 0x8]
|
||||
movs r1, 0x1
|
||||
movs r3, 0
|
||||
bl Print
|
||||
ldr r0, =gUnknown_085F06D8
|
||||
movs r1, 0x2
|
||||
movs r2, 0xE
|
||||
movs r3, 0x1
|
||||
bl CreateYesNoMenu
|
||||
ldr r1, =0x03005e00
|
||||
lsls r0, r4, 2
|
||||
adds r0, r4
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
ldr r1, =sub_817AD40
|
||||
str r1, [r0]
|
||||
add sp, 0xC
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_817ACE4
|
||||
|
||||
thumb_func_start sub_817AD40
|
||||
sub_817AD40: @ 817AD40
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0xC
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
bl sub_8198C58
|
||||
lsls r0, 24
|
||||
asrs r4, r0, 24
|
||||
cmp r4, 0
|
||||
beq _0817AD68
|
||||
cmp r4, 0
|
||||
bgt _0817AD62
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
cmp r4, r0
|
||||
beq _0817ADA0
|
||||
b _0817ADB2
|
||||
_0817AD62:
|
||||
cmp r4, 0x1
|
||||
beq _0817ADA0
|
||||
b _0817ADB2
|
||||
_0817AD68:
|
||||
movs r0, 0
|
||||
movs r1, 0x11
|
||||
bl FillWindowPixelBuffer
|
||||
ldr r2, =gUnknown_085EFAAA
|
||||
movs r0, 0x1
|
||||
str r0, [sp]
|
||||
str r4, [sp, 0x4]
|
||||
str r4, [sp, 0x8]
|
||||
movs r0, 0
|
||||
movs r1, 0x1
|
||||
movs r3, 0
|
||||
bl Print
|
||||
ldr r1, =0x03005e00
|
||||
lsls r0, r5, 2
|
||||
adds r0, r5
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
ldr r1, =sub_817ADC0
|
||||
str r1, [r0]
|
||||
b _0817ADB2
|
||||
.pool
|
||||
_0817ADA0:
|
||||
movs r0, 0x5
|
||||
bl audio_play
|
||||
adds r0, r5, 0
|
||||
bl DestroyTask
|
||||
ldr r0, =sub_817AFD4
|
||||
bl SetMainCallback2
|
||||
_0817ADB2:
|
||||
add sp, 0xC
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_817AD40
|
||||
|
||||
thumb_func_start sub_817ADC0
|
||||
sub_817ADC0: @ 817ADC0
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
bl calls_flash_erase_block
|
||||
adds r0, r4, 0
|
||||
bl DestroyTask
|
||||
ldr r0, =sub_817AFD4
|
||||
bl SetMainCallback2
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_817ADC0
|
||||
|
||||
thumb_func_start sub_817ADE4
|
||||
sub_817ADE4: @ 817ADE4
|
||||
push {lr}
|
||||
bl RunTasks
|
||||
bl fade_and_return_progress_probably
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_817ADE4
|
||||
|
||||
thumb_func_start sub_817ADF4
|
||||
sub_817ADF4: @ 817ADF4
|
||||
push {lr}
|
||||
bl copy_pal_bg_faded_to_pal_ram
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_817ADF4
|
||||
|
||||
thumb_func_start sub_817AE00
|
||||
sub_817AE00: @ 817AE00
|
||||
push {r4,lr}
|
||||
sub sp, 0xC
|
||||
ldr r0, =0x030022c0
|
||||
movs r1, 0x87
|
||||
lsls r1, 3
|
||||
adds r0, r1
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0
|
||||
beq _0817AE18
|
||||
cmp r0, 0x1
|
||||
bne _0817AE18
|
||||
b _0817AFA4
|
||||
_0817AE18:
|
||||
movs r0, 0
|
||||
bl SetVBlankCallback
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x10
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x12
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x1C
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x1E
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x40
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x44
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x48
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x4A
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x50
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x52
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x54
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
add r0, sp, 0x4
|
||||
movs r4, 0
|
||||
strh r4, [r0]
|
||||
ldr r1, =0x040000d4
|
||||
str r0, [r1]
|
||||
movs r0, 0xC0
|
||||
lsls r0, 19
|
||||
str r0, [r1, 0x4]
|
||||
ldr r0, =0x8100c000
|
||||
str r0, [r1, 0x8]
|
||||
ldr r0, [r1, 0x8]
|
||||
movs r2, 0
|
||||
str r2, [sp, 0x8]
|
||||
add r0, sp, 0x8
|
||||
str r0, [r1]
|
||||
movs r0, 0xE0
|
||||
lsls r0, 19
|
||||
str r0, [r1, 0x4]
|
||||
ldr r0, =0x85000100
|
||||
str r0, [r1, 0x8]
|
||||
ldr r0, [r1, 0x8]
|
||||
add r0, sp, 0x4
|
||||
strh r2, [r0]
|
||||
str r0, [r1]
|
||||
ldr r0, =0x05000002
|
||||
str r0, [r1, 0x4]
|
||||
ldr r0, =0x810001ff
|
||||
str r0, [r1, 0x8]
|
||||
ldr r0, [r1, 0x8]
|
||||
bl sub_80A1A74
|
||||
ldr r2, =0x02037714
|
||||
ldr r0, =0x00007fff
|
||||
strh r0, [r2]
|
||||
ldr r1, =0x02037b14
|
||||
strh r0, [r1]
|
||||
ldr r0, =0x00003945
|
||||
strh r0, [r2, 0x2]
|
||||
strh r0, [r1, 0x2]
|
||||
movs r1, 0
|
||||
ldr r3, =0x06000020
|
||||
ldr r0, =0x00001111
|
||||
adds r2, r0, 0
|
||||
_0817AED4:
|
||||
lsls r0, r1, 1
|
||||
adds r0, r3
|
||||
strh r2, [r0]
|
||||
adds r0, r1, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r1, r0, 16
|
||||
cmp r1, 0xF
|
||||
bls _0817AED4
|
||||
movs r1, 0
|
||||
ldr r4, =0x0600f000
|
||||
movs r3, 0x1
|
||||
ldr r2, =0x000003ff
|
||||
_0817AEEC:
|
||||
lsls r0, r1, 1
|
||||
adds r0, r4
|
||||
strh r3, [r0]
|
||||
adds r0, r1, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r1, r0, 16
|
||||
cmp r1, r2
|
||||
bls _0817AEEC
|
||||
bl ResetTasks
|
||||
bl ResetAllObjectData
|
||||
movs r0, 0
|
||||
bl ResetBgsAndClearDma3BusyFlags
|
||||
ldr r1, =gUnknown_085F06C0
|
||||
movs r0, 0
|
||||
movs r2, 0x2
|
||||
bl InitBgsFromTemplates
|
||||
movs r1, 0x82
|
||||
lsls r1, 5
|
||||
movs r0, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0
|
||||
bl ShowBg
|
||||
movs r0, 0x3
|
||||
bl ShowBg
|
||||
movs r0, 0x50
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
bl sub_817B02C
|
||||
ldr r0, =0x0000ffff
|
||||
str r0, [sp]
|
||||
movs r1, 0
|
||||
movs r2, 0x10
|
||||
movs r3, 0
|
||||
bl pal_fade_maybe
|
||||
movs r0, 0x1
|
||||
bl EnableInterrupts
|
||||
ldr r0, =sub_817ADF4
|
||||
bl SetVBlankCallback
|
||||
ldr r0, =0x030022c0
|
||||
movs r1, 0x87
|
||||
lsls r1, 3
|
||||
adds r0, r1
|
||||
movs r1, 0x1
|
||||
strb r1, [r0]
|
||||
b _0817AFC8
|
||||
.pool
|
||||
_0817AFA4:
|
||||
bl fade_and_return_progress_probably
|
||||
ldr r0, =0x02037fd4
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _0817AFC8
|
||||
ldr r0, =sub_817ADE4
|
||||
bl SetMainCallback2
|
||||
movs r0, 0x1
|
||||
b _0817AFCA
|
||||
.pool
|
||||
_0817AFC8:
|
||||
movs r0, 0
|
||||
_0817AFCA:
|
||||
add sp, 0xC
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_817AE00
|
||||
|
||||
thumb_func_start sub_817AFD4
|
||||
sub_817AFD4: @ 817AFD4
|
||||
push {r4,lr}
|
||||
sub sp, 0x4
|
||||
ldr r0, =0x030022c0
|
||||
movs r1, 0x87
|
||||
lsls r1, 3
|
||||
adds r4, r0, r1
|
||||
ldrb r0, [r4]
|
||||
cmp r0, 0
|
||||
beq _0817AFEA
|
||||
cmp r0, 0x1
|
||||
beq _0817B008
|
||||
_0817AFEA:
|
||||
ldr r0, =0x0000ffff
|
||||
str r0, [sp]
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
movs r3, 0x10
|
||||
bl pal_fade_maybe
|
||||
movs r0, 0x1
|
||||
strb r0, [r4]
|
||||
b _0817B020
|
||||
.pool
|
||||
_0817B008:
|
||||
bl fade_and_return_progress_probably
|
||||
ldr r0, =0x02037fd4
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _0817B020
|
||||
bl FreeAllWindowBuffers
|
||||
bl Reset
|
||||
_0817B020:
|
||||
add sp, 0x4
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_817AFD4
|
||||
|
||||
thumb_func_start sub_817B02C
|
||||
sub_817B02C: @ 817B02C
|
||||
push {lr}
|
||||
ldr r0, =gUnknown_085F06C8
|
||||
bl InitWindows
|
||||
bl DeactivateAllTextPrinters
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
bl FillWindowPixelBuffer
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0x2
|
||||
movs r3, 0xE0
|
||||
bl sub_80987D4
|
||||
ldr r0, =gUnknown_0860F074
|
||||
movs r1, 0xF0
|
||||
movs r2, 0x20
|
||||
bl gpu_pal_apply
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_817B02C
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
214
asm/coins.s
Normal file
214
asm/coins.s
Normal file
@ -0,0 +1,214 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start PrintCoinsString
|
||||
@ void PrintCoinsString(s32 coinAmount)
|
||||
PrintCoinsString: @ 8145B54
|
||||
push {r4,lr}
|
||||
sub sp, 0xC
|
||||
adds r1, r0, 0
|
||||
ldr r0, =0x02021cc4
|
||||
movs r2, 0x1
|
||||
movs r3, 0x4
|
||||
bl ConvertIntToDecimalString
|
||||
ldr r4, =0x02021fc4
|
||||
ldr r1, =gUnknown_085E8DAB
|
||||
adds r0, r4, 0
|
||||
bl ExpandStringRefs
|
||||
movs r0, 0x1
|
||||
adds r1, r4, 0
|
||||
movs r2, 0x40
|
||||
bl GetStringRightAlignXOffset
|
||||
adds r3, r0, 0
|
||||
ldr r0, =0x0203ab9c
|
||||
ldrb r0, [r0]
|
||||
lsls r3, 24
|
||||
lsrs r3, 24
|
||||
movs r1, 0x1
|
||||
str r1, [sp]
|
||||
movs r1, 0
|
||||
str r1, [sp, 0x4]
|
||||
str r1, [sp, 0x8]
|
||||
movs r1, 0x1
|
||||
adds r2, r4, 0
|
||||
bl Print
|
||||
add sp, 0xC
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end PrintCoinsString
|
||||
|
||||
thumb_func_start ShowCoinsWindow
|
||||
@ void ShowCoinsWindow(s32 coinAmount, u8 x, u8 y)
|
||||
ShowCoinsWindow: @ 8145BAC
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0x18
|
||||
adds r5, r0, 0
|
||||
adds r4, r1, 0
|
||||
adds r3, r2, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
lsls r3, 24
|
||||
lsrs r3, 24
|
||||
movs r0, 0x8
|
||||
str r0, [sp]
|
||||
movs r0, 0x2
|
||||
str r0, [sp, 0x4]
|
||||
movs r0, 0xF
|
||||
str r0, [sp, 0x8]
|
||||
ldr r0, =0x00000141
|
||||
str r0, [sp, 0xC]
|
||||
add r0, sp, 0x10
|
||||
movs r1, 0
|
||||
adds r2, r4, 0
|
||||
bl rbox_template_set
|
||||
ldr r4, =0x0203ab9c
|
||||
add r0, sp, 0x10
|
||||
bl AddWindow
|
||||
strb r0, [r4]
|
||||
ldrb r0, [r4]
|
||||
movs r1, 0
|
||||
bl FillWindowPixelBuffer
|
||||
ldrb r0, [r4]
|
||||
bl PutWindowTilemap
|
||||
ldrb r0, [r4]
|
||||
movs r2, 0x85
|
||||
lsls r2, 2
|
||||
movs r1, 0
|
||||
movs r3, 0xE
|
||||
bl SetWindowBorderStyle
|
||||
adds r0, r5, 0
|
||||
bl PrintCoinsString
|
||||
add sp, 0x18
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end ShowCoinsWindow
|
||||
|
||||
thumb_func_start HideCoinsWindow
|
||||
@ void HideCoinsWindow()
|
||||
HideCoinsWindow: @ 8145C14
|
||||
push {r4,lr}
|
||||
ldr r4, =0x0203ab9c
|
||||
ldrb r0, [r4]
|
||||
movs r1, 0x1
|
||||
bl sub_819746C
|
||||
ldrb r0, [r4]
|
||||
bl RemoveWindow
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end HideCoinsWindow
|
||||
|
||||
thumb_func_start GetCoins
|
||||
@ u16 GetCoins()
|
||||
GetCoins: @ 8145C30
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r1, [r0]
|
||||
ldr r0, =0x00000494
|
||||
adds r1, r0
|
||||
ldr r0, =0x03005d90
|
||||
ldr r0, [r0]
|
||||
adds r0, 0xAC
|
||||
ldr r0, [r0]
|
||||
ldrh r1, [r1]
|
||||
eors r0, r1
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end GetCoins
|
||||
|
||||
thumb_func_start SetCoins
|
||||
@ void SetCoins(u16 amount)
|
||||
SetCoins: @ 8145C58
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
ldr r1, =0x03005d8c
|
||||
ldr r2, [r1]
|
||||
ldr r1, =0x03005d90
|
||||
ldr r1, [r1]
|
||||
adds r1, 0xAC
|
||||
ldr r1, [r1]
|
||||
eors r0, r1
|
||||
ldr r1, =0x00000494
|
||||
adds r2, r1
|
||||
strh r0, [r2]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end SetCoins
|
||||
|
||||
thumb_func_start AddCoins
|
||||
@ bool8 AddCoins(u16 amount)
|
||||
AddCoins: @ 8145C80
|
||||
push {r4,lr}
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
bl GetCoins
|
||||
lsls r0, 16
|
||||
lsrs r1, r0, 16
|
||||
ldr r0, =0x0000270e
|
||||
cmp r1, r0
|
||||
bls _08145C9C
|
||||
movs r0, 0
|
||||
b _08145CC0
|
||||
.pool
|
||||
_08145C9C:
|
||||
adds r0, r1, r4
|
||||
cmp r1, r0
|
||||
ble _08145CAC
|
||||
ldr r0, =0x0000270f
|
||||
b _08145CBA
|
||||
.pool
|
||||
_08145CAC:
|
||||
lsls r0, 16
|
||||
lsrs r1, r0, 16
|
||||
ldr r0, =0x0000270f
|
||||
cmp r1, r0
|
||||
bls _08145CB8
|
||||
adds r1, r0, 0
|
||||
_08145CB8:
|
||||
adds r0, r1, 0
|
||||
_08145CBA:
|
||||
bl SetCoins
|
||||
movs r0, 0x1
|
||||
_08145CC0:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end AddCoins
|
||||
|
||||
thumb_func_start SubtractCoins
|
||||
@ bool8 SubtractCoins(u16 amount)
|
||||
SubtractCoins: @ 8145CCC
|
||||
push {r4,lr}
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
bl GetCoins
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
cmp r0, r4
|
||||
bcs _08145CE2
|
||||
movs r0, 0
|
||||
b _08145CEE
|
||||
_08145CE2:
|
||||
subs r0, r4
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
bl SetCoins
|
||||
movs r0, 0x1
|
||||
_08145CEE:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end SubtractCoins
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
15872
asm/contest.s
Normal file
15872
asm/contest.s
Normal file
File diff suppressed because it is too large
Load Diff
5278
asm/contest_ai.s
Normal file
5278
asm/contest_ai.s
Normal file
File diff suppressed because it is too large
Load Diff
3175
asm/contest_effect.s
Normal file
3175
asm/contest_effect.s
Normal file
File diff suppressed because it is too large
Load Diff
5650
asm/contest_link_80F57C4.s
Normal file
5650
asm/contest_link_80F57C4.s
Normal file
File diff suppressed because it is too large
Load Diff
1362
asm/contest_link_80FC4F4.s
Normal file
1362
asm/contest_link_80FC4F4.s
Normal file
File diff suppressed because it is too large
Load Diff
1197
asm/contest_painting.s
Normal file
1197
asm/contest_painting.s
Normal file
File diff suppressed because it is too large
Load Diff
3331
asm/cute_sketch.s
Normal file
3331
asm/cute_sketch.s
Normal file
File diff suppressed because it is too large
Load Diff
3193
asm/daycare.s
Normal file
3193
asm/daycare.s
Normal file
File diff suppressed because it is too large
Load Diff
1019
asm/decompress.s
Normal file
1019
asm/decompress.s
Normal file
File diff suppressed because it is too large
Load Diff
7167
asm/decoration.s
Normal file
7167
asm/decoration.s
Normal file
File diff suppressed because it is too large
Load Diff
975
asm/dewford_trend.s
Normal file
975
asm/dewford_trend.s
Normal file
@ -0,0 +1,975 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_81224D4
|
||||
sub_81224D4: @ 81224D4
|
||||
push {r4-r7,lr}
|
||||
movs r6, 0
|
||||
ldr r5, =0x03005d8c
|
||||
_081224DA:
|
||||
movs r0, 0xA
|
||||
bl sub_811EE38
|
||||
ldr r1, [r5]
|
||||
lsls r4, r6, 3
|
||||
adds r1, r4
|
||||
ldr r2, =0x00002e6c
|
||||
adds r1, r2
|
||||
strh r0, [r1]
|
||||
bl GenerateRandomNumber
|
||||
movs r1, 0x1
|
||||
ands r1, r0
|
||||
cmp r1, 0
|
||||
beq _08122514
|
||||
movs r0, 0xC
|
||||
bl sub_811EE38
|
||||
ldr r1, [r5]
|
||||
adds r1, r4
|
||||
ldr r7, =0x00002e6e
|
||||
adds r1, r7
|
||||
b _08122522
|
||||
.pool
|
||||
_08122514:
|
||||
movs r0, 0xD
|
||||
bl sub_811EE38
|
||||
ldr r1, [r5]
|
||||
adds r1, r4
|
||||
ldr r2, =0x00002e6e
|
||||
adds r1, r2
|
||||
_08122522:
|
||||
strh r0, [r1]
|
||||
bl GenerateRandomNumber
|
||||
ldr r3, [r5]
|
||||
adds r3, r4
|
||||
movs r2, 0x1
|
||||
ands r2, r0
|
||||
ldr r7, =0x00002e69
|
||||
adds r3, r7
|
||||
lsls r2, 6
|
||||
ldrb r0, [r3]
|
||||
movs r7, 0x41
|
||||
negs r7, r7
|
||||
adds r1, r7, 0
|
||||
ands r0, r1
|
||||
orrs r0, r2
|
||||
strb r0, [r3]
|
||||
ldr r0, =0x00002e68
|
||||
adds r1, r4, r0
|
||||
ldr r0, [r5]
|
||||
adds r0, r1
|
||||
bl sub_8122B28
|
||||
adds r0, r6, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r6, r0, 16
|
||||
cmp r6, 0x4
|
||||
bls _081224DA
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x00002e68
|
||||
adds r0, r1
|
||||
movs r1, 0x5
|
||||
movs r2, 0
|
||||
bl sub_8122804
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81224D4
|
||||
|
||||
thumb_func_start sub_8122580
|
||||
sub_8122580: @ 8122580
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x8
|
||||
lsls r0, 16
|
||||
lsrs r1, r0, 16
|
||||
cmp r1, 0
|
||||
bne _08122596
|
||||
b _081226BE
|
||||
_08122596:
|
||||
lsls r0, r1, 2
|
||||
adds r0, r1
|
||||
str r0, [sp]
|
||||
movs r0, 0
|
||||
mov r10, r0
|
||||
movs r1, 0x7F
|
||||
mov r9, r1
|
||||
movs r2, 0x80
|
||||
negs r2, r2
|
||||
mov r8, r2
|
||||
_081225AA:
|
||||
ldr r2, [sp]
|
||||
mov r3, r10
|
||||
lsls r0, r3, 3
|
||||
ldr r4, =0x00002e68
|
||||
adds r0, r4
|
||||
ldr r3, =0x03005d8c
|
||||
ldr r1, [r3]
|
||||
adds r5, r1, r0
|
||||
ldrb r6, [r5, 0x1]
|
||||
movs r0, 0x40
|
||||
ands r0, r6
|
||||
cmp r0, 0
|
||||
bne _08122608
|
||||
ldrb r4, [r5]
|
||||
lsls r3, r4, 25
|
||||
lsrs r1, r3, 25
|
||||
lsls r0, r2, 16
|
||||
lsrs r0, 16
|
||||
cmp r1, r0
|
||||
bcc _081225F8
|
||||
adds r0, r1, 0
|
||||
subs r0, r2
|
||||
mov r1, r9
|
||||
ands r0, r1
|
||||
mov r1, r8
|
||||
ands r1, r4
|
||||
orrs r1, r0
|
||||
strb r1, [r5]
|
||||
movs r0, 0x7F
|
||||
ands r1, r0
|
||||
cmp r1, 0
|
||||
bne _0812269E
|
||||
movs r0, 0x40
|
||||
orrs r0, r6
|
||||
b _0812269C
|
||||
.pool
|
||||
_081225F8:
|
||||
lsrs r0, r3, 25
|
||||
subs r2, r0
|
||||
mov r0, r8
|
||||
ands r0, r4
|
||||
strb r0, [r5]
|
||||
movs r0, 0x40
|
||||
orrs r0, r6
|
||||
strb r0, [r5, 0x1]
|
||||
_08122608:
|
||||
ldrb r7, [r5]
|
||||
lsls r0, r7, 25
|
||||
lsrs r0, 25
|
||||
adds r4, r0, r2
|
||||
ldrh r0, [r5]
|
||||
lsls r6, r0, 18
|
||||
lsls r0, r4, 16
|
||||
lsrs r0, 16
|
||||
lsrs r1, r6, 25
|
||||
cmp r0, r1
|
||||
bls _08122678
|
||||
adds r0, r4, 0
|
||||
bl __umodsi3
|
||||
adds r3, r0, 0
|
||||
lsrs r1, r6, 25
|
||||
adds r0, r4, 0
|
||||
str r3, [sp, 0x4]
|
||||
bl __udivsi3
|
||||
adds r4, r0, 0
|
||||
movs r0, 0x1
|
||||
eors r4, r0
|
||||
ands r4, r0
|
||||
lsls r2, r4, 6
|
||||
ldrb r0, [r5, 0x1]
|
||||
movs r4, 0x41
|
||||
negs r4, r4
|
||||
adds r1, r4, 0
|
||||
ands r0, r1
|
||||
orrs r0, r2
|
||||
strb r0, [r5, 0x1]
|
||||
movs r1, 0x40
|
||||
ands r0, r1
|
||||
ldr r3, [sp, 0x4]
|
||||
cmp r0, 0
|
||||
beq _08122662
|
||||
adds r1, r3, 0
|
||||
mov r0, r9
|
||||
ands r1, r0
|
||||
mov r0, r8
|
||||
ands r0, r7
|
||||
orrs r0, r1
|
||||
strb r0, [r5]
|
||||
b _0812269E
|
||||
_08122662:
|
||||
ldrh r0, [r5]
|
||||
lsls r0, 18
|
||||
lsrs r0, 25
|
||||
subs r0, r3
|
||||
mov r1, r9
|
||||
ands r0, r1
|
||||
mov r1, r8
|
||||
ands r1, r7
|
||||
orrs r1, r0
|
||||
strb r1, [r5]
|
||||
b _0812269E
|
||||
_08122678:
|
||||
mov r2, r9
|
||||
ands r4, r2
|
||||
mov r0, r8
|
||||
ands r0, r7
|
||||
orrs r0, r4
|
||||
strb r0, [r5]
|
||||
lsls r0, 25
|
||||
ldrh r1, [r5]
|
||||
lsls r1, 18
|
||||
lsrs r0, 25
|
||||
lsrs r1, 25
|
||||
cmp r0, r1
|
||||
bne _0812269E
|
||||
ldrb r0, [r5, 0x1]
|
||||
movs r3, 0x41
|
||||
negs r3, r3
|
||||
adds r1, r3, 0
|
||||
ands r0, r1
|
||||
_0812269C:
|
||||
strb r0, [r5, 0x1]
|
||||
_0812269E:
|
||||
mov r0, r10
|
||||
adds r0, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
mov r10, r0
|
||||
cmp r0, 0x4
|
||||
bhi _081226AE
|
||||
b _081225AA
|
||||
_081226AE:
|
||||
ldr r4, =0x03005d8c
|
||||
ldr r0, [r4]
|
||||
ldr r1, =0x00002e68
|
||||
adds r0, r1
|
||||
movs r1, 0x5
|
||||
movs r2, 0
|
||||
bl sub_8122804
|
||||
_081226BE:
|
||||
add sp, 0x8
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8122580
|
||||
|
||||
thumb_func_start sub_81226D8
|
||||
sub_81226D8: @ 81226D8
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
sub sp, 0x8
|
||||
mov r8, r0
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
str r0, [sp]
|
||||
str r1, [sp, 0x4]
|
||||
mov r0, r8
|
||||
bl sub_8122BB0
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _081226F8
|
||||
b _081227F2
|
||||
_081226F8:
|
||||
ldr r4, =0x00000893
|
||||
adds r0, r4, 0
|
||||
bl FlagGet
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _08122744
|
||||
adds r0, r4, 0
|
||||
bl FlagSet
|
||||
ldr r0, =0x00000894
|
||||
bl FlagGet
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _08122744
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r1, [r0]
|
||||
mov r0, r8
|
||||
ldrh r2, [r0]
|
||||
ldr r3, =0x00002e6c
|
||||
adds r0, r1, r3
|
||||
strh r2, [r0]
|
||||
mov r2, r8
|
||||
ldrh r0, [r2, 0x2]
|
||||
adds r3, 0x2
|
||||
adds r1, r3
|
||||
strh r0, [r1]
|
||||
movs r0, 0x1
|
||||
b _081227F4
|
||||
.pool
|
||||
_08122744:
|
||||
mov r0, r8
|
||||
ldrh r1, [r0, 0x2]
|
||||
lsls r1, 16
|
||||
ldrh r0, [r0]
|
||||
orrs r0, r1
|
||||
str r0, [sp, 0x4]
|
||||
movs r1, 0x80
|
||||
lsls r1, 7
|
||||
ldr r0, [sp]
|
||||
orrs r0, r1
|
||||
str r0, [sp]
|
||||
mov r0, sp
|
||||
bl sub_8122B28
|
||||
movs r5, 0
|
||||
_08122762:
|
||||
ldr r6, =0x03005d8c
|
||||
lsls r4, r5, 3
|
||||
ldr r1, =0x00002e68
|
||||
adds r0, r4, r1
|
||||
ldr r1, [r6]
|
||||
adds r1, r0
|
||||
mov r0, sp
|
||||
movs r2, 0
|
||||
bl atk90_changetypestoenemyattacktype
|
||||
lsls r0, 24
|
||||
adds r7, r4, 0
|
||||
cmp r0, 0
|
||||
beq _081227D4
|
||||
movs r2, 0x4
|
||||
mov r12, r6
|
||||
cmp r2, r5
|
||||
bls _081227A6
|
||||
ldr r4, =0x00002e68
|
||||
_08122788:
|
||||
ldr r0, [r6]
|
||||
lsls r3, r2, 3
|
||||
adds r0, r4
|
||||
adds r3, r0, r3
|
||||
subs r2, 0x1
|
||||
lsls r1, r2, 3
|
||||
adds r0, r1
|
||||
ldr r1, [r0, 0x4]
|
||||
ldr r0, [r0]
|
||||
str r0, [r3]
|
||||
str r1, [r3, 0x4]
|
||||
lsls r2, 16
|
||||
lsrs r2, 16
|
||||
cmp r2, r5
|
||||
bhi _08122788
|
||||
_081227A6:
|
||||
mov r3, r12
|
||||
ldr r2, [r3]
|
||||
ldr r0, =0x00002e68
|
||||
adds r2, r0
|
||||
adds r2, r7
|
||||
ldr r0, [sp]
|
||||
ldr r1, [sp, 0x4]
|
||||
str r0, [r2]
|
||||
str r1, [r2, 0x4]
|
||||
cmp r5, 0x4
|
||||
bne _081227C2
|
||||
mov r0, r8
|
||||
bl sub_80EDC60
|
||||
_081227C2:
|
||||
movs r0, 0
|
||||
cmp r5, 0
|
||||
bne _081227F4
|
||||
movs r0, 0x1
|
||||
b _081227F4
|
||||
.pool
|
||||
_081227D4:
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
cmp r5, 0x4
|
||||
bls _08122762
|
||||
ldr r2, [r6]
|
||||
ldr r1, =0x00002e88
|
||||
adds r2, r1
|
||||
ldr r0, [sp]
|
||||
ldr r1, [sp, 0x4]
|
||||
str r0, [r2]
|
||||
str r1, [r2, 0x4]
|
||||
mov r0, r8
|
||||
bl sub_80EDC60
|
||||
_081227F2:
|
||||
movs r0, 0
|
||||
_081227F4:
|
||||
add sp, 0x8
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81226D8
|
||||
|
||||
thumb_func_start sub_8122804
|
||||
sub_8122804: @ 8122804
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
mov r9, r0
|
||||
lsls r1, 16
|
||||
lsrs r7, r1, 16
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
mov r10, r2
|
||||
movs r2, 0
|
||||
cmp r2, r7
|
||||
bcs _0812286C
|
||||
_08122820:
|
||||
adds r1, r2, 0x1
|
||||
lsls r0, r1, 16
|
||||
lsrs r5, r0, 16
|
||||
mov r8, r1
|
||||
cmp r5, r7
|
||||
bcs _08122862
|
||||
lsls r0, r2, 3
|
||||
mov r1, r9
|
||||
adds r6, r1, r0
|
||||
_08122832:
|
||||
lsls r0, r5, 3
|
||||
mov r1, r9
|
||||
adds r4, r1, r0
|
||||
adds r0, r4, 0
|
||||
adds r1, r6, 0
|
||||
mov r2, r10
|
||||
bl atk90_changetypestoenemyattacktype
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _08122858
|
||||
ldr r2, [r4]
|
||||
ldr r3, [r4, 0x4]
|
||||
ldr r0, [r6]
|
||||
ldr r1, [r6, 0x4]
|
||||
str r0, [r4]
|
||||
str r1, [r4, 0x4]
|
||||
str r2, [r6]
|
||||
str r3, [r6, 0x4]
|
||||
_08122858:
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
cmp r5, r7
|
||||
bcc _08122832
|
||||
_08122862:
|
||||
mov r1, r8
|
||||
lsls r0, r1, 16
|
||||
lsrs r2, r0, 16
|
||||
cmp r2, r7
|
||||
bcc _08122820
|
||||
_0812286C:
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_8122804
|
||||
|
||||
thumb_func_start sub_812287C
|
||||
sub_812287C: @ 812287C
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x4
|
||||
mov r8, r0
|
||||
adds r6, r1, 0
|
||||
movs r4, 0x80
|
||||
lsls r4, 1
|
||||
adds r0, r4, 0
|
||||
bl Alloc
|
||||
mov r10, r0
|
||||
cmp r0, 0
|
||||
beq _08122980
|
||||
adds r0, r4, 0
|
||||
bl Alloc
|
||||
adds r7, r0, 0
|
||||
cmp r7, 0
|
||||
bne _081228B0
|
||||
mov r0, r10
|
||||
bl Free
|
||||
b _08122980
|
||||
_081228B0:
|
||||
bl sub_8009FCC
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r9, r0
|
||||
movs r5, 0
|
||||
cmp r5, r9
|
||||
bcs _081228DE
|
||||
_081228C0:
|
||||
lsls r0, r5, 2
|
||||
adds r0, r5
|
||||
lsls r0, 3
|
||||
add r0, r10
|
||||
adds r1, r5, 0
|
||||
muls r1, r6
|
||||
add r1, r8
|
||||
movs r2, 0x28
|
||||
bl memcpy
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
cmp r5, r9
|
||||
bcc _081228C0
|
||||
_081228DE:
|
||||
mov r4, r10
|
||||
mov r8, r7
|
||||
movs r3, 0
|
||||
movs r5, 0
|
||||
cmp r5, r9
|
||||
bcs _08122946
|
||||
_081228EA:
|
||||
movs r6, 0
|
||||
_081228EC:
|
||||
adds r0, r7, 0
|
||||
adds r1, r4, 0
|
||||
adds r2, r3, 0
|
||||
str r3, [sp]
|
||||
bl sub_8122C1C
|
||||
lsls r0, 16
|
||||
asrs r0, 16
|
||||
ldr r3, [sp]
|
||||
cmp r0, 0
|
||||
bge _08122918
|
||||
ldr r0, [r4]
|
||||
ldr r1, [r4, 0x4]
|
||||
mov r2, r8
|
||||
adds r2, 0x8
|
||||
mov r8, r2
|
||||
subs r2, 0x8
|
||||
stm r2!, {r0,r1}
|
||||
adds r0, r3, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r3, r0, 16
|
||||
b _08122930
|
||||
_08122918:
|
||||
lsls r0, 3
|
||||
adds r2, r7, r0
|
||||
ldrb r1, [r2]
|
||||
lsls r1, 25
|
||||
ldrb r0, [r4]
|
||||
lsls r0, 25
|
||||
cmp r1, r0
|
||||
bcs _08122930
|
||||
ldr r0, [r4]
|
||||
ldr r1, [r4, 0x4]
|
||||
str r0, [r2]
|
||||
str r1, [r2, 0x4]
|
||||
_08122930:
|
||||
adds r4, 0x8
|
||||
adds r0, r6, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r6, r0, 16
|
||||
cmp r6, 0x4
|
||||
bls _081228EC
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
cmp r5, r9
|
||||
bcc _081228EA
|
||||
_08122946:
|
||||
adds r0, r7, 0
|
||||
adds r1, r3, 0
|
||||
movs r2, 0x2
|
||||
bl sub_8122804
|
||||
adds r4, r7, 0
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x00002e68
|
||||
adds r1, r0
|
||||
mov r8, r1
|
||||
movs r5, 0
|
||||
_0812295E:
|
||||
ldm r4!, {r0,r1}
|
||||
mov r2, r8
|
||||
adds r2, 0x8
|
||||
mov r8, r2
|
||||
subs r2, 0x8
|
||||
stm r2!, {r0,r1}
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
cmp r5, 0x4
|
||||
bls _0812295E
|
||||
mov r0, r10
|
||||
bl Free
|
||||
adds r0, r7, 0
|
||||
bl Free
|
||||
_08122980:
|
||||
add sp, 0x4
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_812287C
|
||||
|
||||
thumb_func_start sub_8122998
|
||||
sub_8122998: @ 8122998
|
||||
push {lr}
|
||||
ldr r2, =0x03005d8c
|
||||
ldr r0, =0x020375e0
|
||||
ldrh r1, [r0]
|
||||
lsls r1, 3
|
||||
ldr r0, [r2]
|
||||
adds r1, r0
|
||||
ldr r0, =0x02021cc4
|
||||
ldr r2, =0x00002e6c
|
||||
adds r1, r2
|
||||
movs r2, 0x2
|
||||
movs r3, 0x1
|
||||
bl ConvertEasyChatWordsToString
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8122998
|
||||
|
||||
thumb_func_start sub_81229C8
|
||||
sub_81229C8: @ 81229C8
|
||||
push {r4,lr}
|
||||
movs r4, 0
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r3, [r0]
|
||||
ldr r1, =0x00002e68
|
||||
adds r0, r3, r1
|
||||
ldrb r1, [r0]
|
||||
lsls r1, 25
|
||||
lsrs r1, 25
|
||||
ldr r2, =0x00002e70
|
||||
adds r0, r3, r2
|
||||
ldrb r0, [r0]
|
||||
lsls r0, 25
|
||||
lsrs r0, 25
|
||||
subs r1, r0
|
||||
cmp r1, 0x1
|
||||
bgt _08122A0C
|
||||
ldr r1, =0x00002e69
|
||||
adds r0, r3, r1
|
||||
ldrb r1, [r0]
|
||||
movs r2, 0x40
|
||||
adds r0, r2, 0
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _08122A0C
|
||||
ldr r1, =0x00002e71
|
||||
adds r0, r3, r1
|
||||
ldrb r1, [r0]
|
||||
adds r0, r2, 0
|
||||
ands r0, r1
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
negs r0, r0
|
||||
lsrs r4, r0, 31
|
||||
_08122A0C:
|
||||
ldr r0, =0x020375f0
|
||||
strh r4, [r0]
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81229C8
|
||||
|
||||
thumb_func_start sub_8122A30
|
||||
sub_8122A30: @ 8122A30
|
||||
ldr r2, =0x020375f0
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r0, [r0]
|
||||
ldr r3, =0x00002e6c
|
||||
adds r1, r0, r3
|
||||
adds r3, 0x2
|
||||
adds r0, r3
|
||||
ldrh r0, [r0]
|
||||
ldrh r1, [r1]
|
||||
adds r0, r1
|
||||
movs r1, 0x7
|
||||
ands r0, r1
|
||||
strh r0, [r2]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sub_8122A30
|
||||
|
||||
thumb_func_start atk90_changetypestoenemyattacktype
|
||||
atk90_changetypestoenemyattacktype: @ 8122A58
|
||||
push {r4,r5,lr}
|
||||
adds r3, r0, 0
|
||||
adds r5, r1, 0
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
adds r0, r2, 0
|
||||
cmp r2, 0x1
|
||||
beq _08122A9E
|
||||
cmp r2, 0x1
|
||||
bgt _08122A72
|
||||
cmp r2, 0
|
||||
beq _08122A78
|
||||
b _08122B1A
|
||||
_08122A72:
|
||||
cmp r0, 0x2
|
||||
beq _08122ACA
|
||||
b _08122B1A
|
||||
_08122A78:
|
||||
ldrb r0, [r3]
|
||||
lsls r1, r0, 25
|
||||
ldrb r0, [r5]
|
||||
lsls r0, 25
|
||||
cmp r1, r0
|
||||
bhi _08122B16
|
||||
cmp r1, r0
|
||||
bcc _08122AC6
|
||||
ldrh r0, [r3]
|
||||
lsls r3, r0, 18
|
||||
ldrh r0, [r5]
|
||||
lsls r2, r0, 18
|
||||
lsrs r1, r3, 25
|
||||
lsrs r0, r2, 25
|
||||
cmp r1, r0
|
||||
bhi _08122B16
|
||||
lsrs r1, r3, 25
|
||||
lsrs r0, r2, 25
|
||||
b _08122AC2
|
||||
_08122A9E:
|
||||
ldrh r0, [r3]
|
||||
lsls r4, r0, 18
|
||||
ldrh r0, [r5]
|
||||
lsls r2, r0, 18
|
||||
lsrs r1, r4, 25
|
||||
lsrs r0, r2, 25
|
||||
cmp r1, r0
|
||||
bhi _08122B16
|
||||
lsrs r1, r4, 25
|
||||
lsrs r0, r2, 25
|
||||
cmp r1, r0
|
||||
bcc _08122AC6
|
||||
ldrb r0, [r3]
|
||||
lsls r1, r0, 25
|
||||
ldrb r0, [r5]
|
||||
lsls r0, 25
|
||||
cmp r1, r0
|
||||
bhi _08122B16
|
||||
_08122AC2:
|
||||
cmp r1, r0
|
||||
bcs _08122B1A
|
||||
_08122AC6:
|
||||
movs r0, 0
|
||||
b _08122B22
|
||||
_08122ACA:
|
||||
ldrb r0, [r3]
|
||||
lsls r1, r0, 25
|
||||
ldrb r0, [r5]
|
||||
lsls r0, 25
|
||||
cmp r1, r0
|
||||
bhi _08122B16
|
||||
cmp r1, r0
|
||||
bcc _08122AC6
|
||||
ldrh r0, [r3]
|
||||
lsls r4, r0, 18
|
||||
ldrh r0, [r5]
|
||||
lsls r2, r0, 18
|
||||
lsrs r1, r4, 25
|
||||
lsrs r0, r2, 25
|
||||
cmp r1, r0
|
||||
bhi _08122B16
|
||||
lsrs r1, r4, 25
|
||||
lsrs r0, r2, 25
|
||||
cmp r1, r0
|
||||
bcc _08122AC6
|
||||
ldrh r1, [r3, 0x2]
|
||||
ldrh r0, [r5, 0x2]
|
||||
cmp r1, r0
|
||||
bhi _08122B16
|
||||
cmp r1, r0
|
||||
bcc _08122AC6
|
||||
ldrh r1, [r3, 0x4]
|
||||
ldrh r0, [r5, 0x4]
|
||||
cmp r1, r0
|
||||
bhi _08122B16
|
||||
cmp r1, r0
|
||||
bcc _08122AC6
|
||||
ldrh r1, [r3, 0x6]
|
||||
ldrh r0, [r5, 0x6]
|
||||
cmp r1, r0
|
||||
bhi _08122B16
|
||||
cmp r1, r0
|
||||
bcc _08122AC6
|
||||
_08122B16:
|
||||
movs r0, 0x1
|
||||
b _08122B22
|
||||
_08122B1A:
|
||||
bl GenerateRandomNumber
|
||||
movs r1, 0x1
|
||||
ands r0, r1
|
||||
_08122B22:
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end atk90_changetypestoenemyattacktype
|
||||
|
||||
thumb_func_start sub_8122B28
|
||||
sub_8122B28: @ 8122B28
|
||||
push {r4,r5,lr}
|
||||
adds r5, r0, 0
|
||||
bl GenerateRandomNumber
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
movs r1, 0x62
|
||||
bl __umodsi3
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
cmp r4, 0x32
|
||||
bls _08122B6A
|
||||
bl GenerateRandomNumber
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
movs r1, 0x62
|
||||
bl __umodsi3
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
cmp r4, 0x50
|
||||
bls _08122B6A
|
||||
bl GenerateRandomNumber
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
movs r1, 0x62
|
||||
bl __umodsi3
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
_08122B6A:
|
||||
adds r1, r4, 0
|
||||
adds r1, 0x1E
|
||||
movs r0, 0x7F
|
||||
ands r1, r0
|
||||
lsls r1, 7
|
||||
ldrh r2, [r5]
|
||||
ldr r0, =0xffffc07f
|
||||
ands r0, r2
|
||||
orrs r0, r1
|
||||
strh r0, [r5]
|
||||
bl GenerateRandomNumber
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
adds r1, r4, 0x1
|
||||
bl __modsi3
|
||||
adds r0, 0x1E
|
||||
movs r1, 0x7F
|
||||
ands r0, r1
|
||||
ldrb r2, [r5]
|
||||
movs r1, 0x80
|
||||
negs r1, r1
|
||||
ands r1, r2
|
||||
orrs r1, r0
|
||||
strb r1, [r5]
|
||||
bl GenerateRandomNumber
|
||||
strh r0, [r5, 0x2]
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8122B28
|
||||
|
||||
thumb_func_start sub_8122BB0
|
||||
sub_8122BB0: @ 8122BB0
|
||||
push {r4-r6,lr}
|
||||
adds r5, r0, 0
|
||||
movs r4, 0
|
||||
ldr r6, =0x03005d8c
|
||||
_08122BB8:
|
||||
lsls r1, r4, 3
|
||||
ldr r0, [r6]
|
||||
adds r1, r0
|
||||
ldr r0, =0x00002e6c
|
||||
adds r1, r0
|
||||
adds r0, r5, 0
|
||||
bl sub_8122BF0
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _08122BDC
|
||||
movs r0, 0x1
|
||||
b _08122BE8
|
||||
.pool
|
||||
_08122BDC:
|
||||
adds r0, r4, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
cmp r4, 0x4
|
||||
bls _08122BB8
|
||||
movs r0, 0
|
||||
_08122BE8:
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8122BB0
|
||||
|
||||
thumb_func_start sub_8122BF0
|
||||
sub_8122BF0: @ 8122BF0
|
||||
push {r4,lr}
|
||||
adds r3, r0, 0
|
||||
adds r2, r1, 0
|
||||
movs r4, 0
|
||||
_08122BF8:
|
||||
ldrh r1, [r3]
|
||||
ldrh r0, [r2]
|
||||
adds r2, 0x2
|
||||
adds r3, 0x2
|
||||
cmp r1, r0
|
||||
beq _08122C08
|
||||
movs r0, 0
|
||||
b _08122C14
|
||||
_08122C08:
|
||||
adds r0, r4, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
cmp r4, 0x1
|
||||
bls _08122BF8
|
||||
movs r0, 0x1
|
||||
_08122C14:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8122BF0
|
||||
|
||||
thumb_func_start sub_8122C1C
|
||||
sub_8122C1C: @ 8122C1C
|
||||
push {r4-r7,lr}
|
||||
adds r5, r0, 0
|
||||
adds r7, r1, 0
|
||||
lsls r2, 16
|
||||
lsrs r6, r2, 16
|
||||
movs r4, 0
|
||||
cmp r4, r6
|
||||
bge _08122C52
|
||||
_08122C2C:
|
||||
adds r1, r5, 0x4
|
||||
adds r0, r7, 0x4
|
||||
bl sub_8122BF0
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _08122C40
|
||||
lsls r0, r4, 16
|
||||
asrs r0, 16
|
||||
b _08122C56
|
||||
_08122C40:
|
||||
adds r5, 0x8
|
||||
lsls r0, r4, 16
|
||||
movs r1, 0x80
|
||||
lsls r1, 9
|
||||
adds r0, r1
|
||||
lsrs r4, r0, 16
|
||||
asrs r0, 16
|
||||
cmp r0, r6
|
||||
blt _08122C2C
|
||||
_08122C52:
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
_08122C56:
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8122C1C
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
387
asm/diploma.s
Normal file
387
asm/diploma.s
Normal file
@ -0,0 +1,387 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_8177874
|
||||
sub_8177874: @ 8177874
|
||||
push {lr}
|
||||
bl LoadOamFromSprites
|
||||
bl ProcessObjectCopyRequests
|
||||
bl copy_pal_bg_faded_to_pal_ram
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_8177874
|
||||
|
||||
thumb_func_start sub_8177888
|
||||
sub_8177888: @ 8177888
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0xC
|
||||
movs r0, 0
|
||||
bl SetVBlankCallback
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0xE
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0xC
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0xA
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x8
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x1C
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x1E
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x18
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x1A
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x14
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x16
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x10
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x12
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
add r1, sp, 0x4
|
||||
movs r0, 0
|
||||
strh r0, [r1]
|
||||
ldr r1, =0x040000d4
|
||||
add r0, sp, 0x4
|
||||
str r0, [r1]
|
||||
movs r0, 0xC0
|
||||
lsls r0, 19
|
||||
str r0, [r1, 0x4]
|
||||
ldr r0, =0x8100c000
|
||||
str r0, [r1, 0x8]
|
||||
ldr r0, [r1, 0x8]
|
||||
movs r5, 0
|
||||
str r5, [sp, 0x8]
|
||||
add r0, sp, 0x8
|
||||
str r0, [r1]
|
||||
movs r0, 0xE0
|
||||
lsls r0, 19
|
||||
str r0, [r1, 0x4]
|
||||
ldr r0, =0x85000100
|
||||
str r0, [r1, 0x8]
|
||||
ldr r0, [r1, 0x8]
|
||||
add r0, sp, 0x4
|
||||
strh r5, [r0]
|
||||
str r0, [r1]
|
||||
movs r0, 0xA0
|
||||
lsls r0, 19
|
||||
str r0, [r1, 0x4]
|
||||
ldr r0, =0x81000200
|
||||
str r0, [r1, 0x8]
|
||||
ldr r0, [r1, 0x8]
|
||||
bl remove_some_task
|
||||
bl ResetTasks
|
||||
bl ResetAllObjectData
|
||||
bl sub_80A1A74
|
||||
bl ResetObjectPaletteAllocator
|
||||
ldr r0, =gUnknown_085E7088
|
||||
movs r1, 0
|
||||
movs r2, 0x40
|
||||
bl gpu_pal_apply
|
||||
ldr r4, =0x0203bcf0
|
||||
movs r0, 0x80
|
||||
lsls r0, 5
|
||||
bl Alloc
|
||||
str r0, [r4]
|
||||
bl sub_8177B44
|
||||
bl sub_8177B9C
|
||||
bl reset_temp_tile_data_buffers
|
||||
ldr r1, =gUnknown_085E7804
|
||||
str r5, [sp]
|
||||
movs r0, 0x1
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl decompress_and_copy_tile_data_to_vram
|
||||
_0817797C:
|
||||
bl free_temp_tile_data_buffers_if_possible
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
cmp r5, 0
|
||||
bne _0817797C
|
||||
ldr r0, =gUnknown_085E70C8
|
||||
ldr r1, =0x0203bcf0
|
||||
ldr r1, [r1]
|
||||
bl LZDecompressWram
|
||||
movs r0, 0x1
|
||||
bl CopyBgTilemapBufferToVram
|
||||
bl pokedex_diploma_something
|
||||
movs r4, 0x1
|
||||
negs r4, r4
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x10
|
||||
movs r2, 0
|
||||
bl sub_80A2A20
|
||||
str r5, [sp]
|
||||
adds r0, r4, 0
|
||||
movs r1, 0
|
||||
movs r2, 0x10
|
||||
movs r3, 0
|
||||
bl pal_fade_maybe
|
||||
movs r0, 0x1
|
||||
bl EnableInterrupts
|
||||
ldr r0, =sub_8177874
|
||||
bl SetVBlankCallback
|
||||
ldr r0, =sub_8177A08
|
||||
bl SetMainCallback2
|
||||
ldr r0, =sub_8177A20
|
||||
movs r1, 0
|
||||
bl CreateTask
|
||||
add sp, 0xC
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8177888
|
||||
|
||||
thumb_func_start sub_8177A08
|
||||
sub_8177A08: @ 8177A08
|
||||
push {lr}
|
||||
bl RunTasks
|
||||
bl CallObjectCallbacks
|
||||
bl PrepareSpritesForOamLoad
|
||||
bl fade_and_return_progress_probably
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_8177A08
|
||||
|
||||
thumb_func_start sub_8177A20
|
||||
sub_8177A20: @ 8177A20
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
ldr r0, =0x02037fd4
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _08177A40
|
||||
ldr r0, =0x03005e00
|
||||
lsls r1, r2, 2
|
||||
adds r1, r2
|
||||
lsls r1, 3
|
||||
adds r1, r0
|
||||
ldr r0, =sub_8177A50
|
||||
str r0, [r1]
|
||||
_08177A40:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8177A20
|
||||
|
||||
thumb_func_start sub_8177A50
|
||||
sub_8177A50: @ 8177A50
|
||||
push {r4,lr}
|
||||
sub sp, 0x4
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
ldr r0, =0x030022c0
|
||||
ldrh r1, [r0, 0x2E]
|
||||
movs r0, 0x3
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _08177A82
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
movs r1, 0
|
||||
str r1, [sp]
|
||||
movs r2, 0
|
||||
movs r3, 0x10
|
||||
bl pal_fade_maybe
|
||||
ldr r1, =0x03005e00
|
||||
lsls r0, r4, 2
|
||||
adds r0, r4
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
ldr r1, =sub_8177A98
|
||||
str r1, [r0]
|
||||
_08177A82:
|
||||
add sp, 0x4
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8177A50
|
||||
|
||||
thumb_func_start sub_8177A98
|
||||
sub_8177A98: @ 8177A98
|
||||
push {r4,lr}
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
ldr r0, =0x02037fd4
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _08177AC2
|
||||
ldr r0, =0x0203bcf0
|
||||
ldr r0, [r0]
|
||||
bl Free
|
||||
bl FreeAllWindowBuffers
|
||||
adds r0, r4, 0
|
||||
bl DestroyTask
|
||||
ldr r0, =sub_80861E8
|
||||
bl SetMainCallback2
|
||||
_08177AC2:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8177A98
|
||||
|
||||
thumb_func_start pokedex_diploma_something
|
||||
pokedex_diploma_something: @ 8177AD4
|
||||
push {r4,lr}
|
||||
bl sub_80C0944
|
||||
lsls r0, 16
|
||||
cmp r0, 0
|
||||
beq _08177AFC
|
||||
movs r1, 0x80
|
||||
lsls r1, 1
|
||||
movs r0, 0x14
|
||||
bl SetGpuReg
|
||||
ldr r0, =0x02021cc4
|
||||
ldr r1, =gUnknown_085EE855
|
||||
bl CopyString
|
||||
b _08177B0C
|
||||
.pool
|
||||
_08177AFC:
|
||||
movs r0, 0x14
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
ldr r0, =0x02021cc4
|
||||
ldr r1, =gUnknown_085EE84F
|
||||
bl CopyString
|
||||
_08177B0C:
|
||||
ldr r4, =0x02021fc4
|
||||
ldr r1, =gUnknown_085EE85E
|
||||
adds r0, r4, 0
|
||||
bl ExpandStringRefs
|
||||
adds r0, r4, 0
|
||||
movs r1, 0
|
||||
movs r2, 0x1
|
||||
bl sub_8177BCC
|
||||
movs r0, 0
|
||||
bl PutWindowTilemap
|
||||
movs r0, 0
|
||||
movs r1, 0x3
|
||||
bl CopyWindowToVram
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end pokedex_diploma_something
|
||||
|
||||
thumb_func_start sub_8177B44
|
||||
sub_8177B44: @ 8177B44
|
||||
push {lr}
|
||||
movs r0, 0
|
||||
bl ResetBgsAndClearDma3BusyFlags
|
||||
ldr r1, =gUnknown_085E81FC
|
||||
movs r0, 0
|
||||
movs r2, 0x2
|
||||
bl InitBgsFromTemplates
|
||||
ldr r0, =0x0203bcf0
|
||||
ldr r1, [r0]
|
||||
movs r0, 0x1
|
||||
bl SetBgTilemapBuffer
|
||||
movs r1, 0x82
|
||||
lsls r1, 5
|
||||
movs r0, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0
|
||||
bl ShowBg
|
||||
movs r0, 0x1
|
||||
bl ShowBg
|
||||
movs r0, 0x50
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x52
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x54
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8177B44
|
||||
|
||||
thumb_func_start sub_8177B9C
|
||||
sub_8177B9C: @ 8177B9C
|
||||
push {lr}
|
||||
ldr r0, =gUnknown_085E8204
|
||||
bl InitWindows
|
||||
bl DeactivateAllTextPrinters
|
||||
ldr r0, =gUnknown_0860F074
|
||||
movs r1, 0xF0
|
||||
movs r2, 0x20
|
||||
bl gpu_pal_apply
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
bl FillWindowPixelBuffer
|
||||
movs r0, 0
|
||||
bl PutWindowTilemap
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8177B9C
|
||||
|
||||
thumb_func_start sub_8177BCC
|
||||
sub_8177BCC: @ 8177BCC
|
||||
push {r4-r6,lr}
|
||||
sub sp, 0x18
|
||||
adds r6, r0, 0
|
||||
adds r4, r1, 0
|
||||
adds r5, r2, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
lsls r5, 24
|
||||
lsrs r5, 24
|
||||
ldr r1, =gUnknown_085E8214
|
||||
add r0, sp, 0x14
|
||||
movs r2, 0x3
|
||||
bl memcpy
|
||||
movs r0, 0
|
||||
str r0, [sp]
|
||||
str r0, [sp, 0x4]
|
||||
add r0, sp, 0x14
|
||||
str r0, [sp, 0x8]
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
str r0, [sp, 0xC]
|
||||
str r6, [sp, 0x10]
|
||||
movs r0, 0
|
||||
movs r1, 0x1
|
||||
adds r2, r4, 0
|
||||
adds r3, r5, 0
|
||||
bl AddTextPrinterParametrized2
|
||||
add sp, 0x18
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8177BCC
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
@ -1,5 +1,5 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/gba_constants.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
|
11183
asm/easy_chat.s
Normal file
11183
asm/easy_chat.s
Normal file
File diff suppressed because it is too large
Load Diff
1801
asm/egg_hatch.s
Normal file
1801
asm/egg_hatch.s
Normal file
File diff suppressed because it is too large
Load Diff
4216
asm/evolution_scene.s
Normal file
4216
asm/evolution_scene.s
Normal file
File diff suppressed because it is too large
Load Diff
1153
asm/field_camera.s
Normal file
1153
asm/field_camera.s
Normal file
File diff suppressed because it is too large
Load Diff
754
asm/field_door.s
Normal file
754
asm/field_door.s
Normal file
@ -0,0 +1,754 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_808A400
|
||||
sub_808A400: @ 808A400
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
ldrb r0, [r2, 0x3]
|
||||
cmp r0, 0x2
|
||||
bne _0808A420
|
||||
ldrh r1, [r1, 0x2]
|
||||
ldr r0, [r2, 0x4]
|
||||
adds r0, r1
|
||||
ldr r1, =0x06007e00
|
||||
movs r2, 0x80
|
||||
bl CpuFastSet
|
||||
b _0808A42E
|
||||
.pool
|
||||
_0808A420:
|
||||
ldrh r1, [r1, 0x2]
|
||||
ldr r0, [r2, 0x4]
|
||||
adds r0, r1
|
||||
ldr r1, =0x06007f00
|
||||
movs r2, 0x40
|
||||
bl CpuFastSet
|
||||
_0808A42E:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_808A400
|
||||
|
||||
thumb_func_start door_build_blockdef
|
||||
door_build_blockdef: @ 808A438
|
||||
push {r4-r6,lr}
|
||||
adds r6, r0, 0
|
||||
lsls r1, 16
|
||||
lsrs r5, r1, 16
|
||||
movs r4, 0
|
||||
adds r1, r6, 0
|
||||
_0808A444:
|
||||
ldrb r0, [r2]
|
||||
lsls r0, 28
|
||||
lsrs r3, r0, 16
|
||||
adds r2, 0x1
|
||||
adds r0, r5, r4
|
||||
orrs r3, r0
|
||||
strh r3, [r1]
|
||||
adds r1, 0x2
|
||||
adds r4, 0x1
|
||||
cmp r4, 0x3
|
||||
ble _0808A444
|
||||
cmp r4, 0x7
|
||||
bgt _0808A472
|
||||
lsls r0, r4, 1
|
||||
adds r1, r0, r6
|
||||
_0808A462:
|
||||
ldrb r0, [r2]
|
||||
lsls r3, r0, 12
|
||||
adds r2, 0x1
|
||||
strh r3, [r1]
|
||||
adds r1, 0x2
|
||||
adds r4, 0x1
|
||||
cmp r4, 0x7
|
||||
ble _0808A462
|
||||
_0808A472:
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end door_build_blockdef
|
||||
|
||||
thumb_func_start door_patch_tilemap
|
||||
door_patch_tilemap: @ 808A478
|
||||
push {r4-r7,lr}
|
||||
mov r7, r9
|
||||
mov r6, r8
|
||||
push {r6,r7}
|
||||
sub sp, 0x30
|
||||
adds r7, r1, 0
|
||||
mov r9, r2
|
||||
adds r5, r3, 0
|
||||
ldrb r0, [r0, 0x3]
|
||||
cmp r0, 0x2
|
||||
bne _0808A4F4
|
||||
add r4, sp, 0x10
|
||||
movs r1, 0xFC
|
||||
lsls r1, 2
|
||||
adds r0, r4, 0
|
||||
adds r2, r5, 0
|
||||
bl door_build_blockdef
|
||||
mov r6, r9
|
||||
subs r6, 0x1
|
||||
adds r0, r7, 0
|
||||
adds r1, r6, 0
|
||||
adds r2, r4, 0
|
||||
bl DrawDoorMetatileAt
|
||||
movs r1, 0xFD
|
||||
lsls r1, 2
|
||||
adds r0, r5, 0x4
|
||||
mov r8, r0
|
||||
adds r0, r4, 0
|
||||
mov r2, r8
|
||||
bl door_build_blockdef
|
||||
adds r0, r7, 0
|
||||
mov r1, r9
|
||||
adds r2, r4, 0
|
||||
bl DrawDoorMetatileAt
|
||||
movs r1, 0xFE
|
||||
lsls r1, 2
|
||||
adds r0, r4, 0
|
||||
adds r2, r5, 0
|
||||
bl door_build_blockdef
|
||||
adds r5, r7, 0x1
|
||||
adds r0, r5, 0
|
||||
adds r1, r6, 0
|
||||
adds r2, r4, 0
|
||||
bl DrawDoorMetatileAt
|
||||
movs r1, 0xFF
|
||||
lsls r1, 2
|
||||
adds r0, r4, 0
|
||||
mov r2, r8
|
||||
bl door_build_blockdef
|
||||
adds r0, r5, 0
|
||||
mov r1, r9
|
||||
adds r2, r4, 0
|
||||
bl DrawDoorMetatileAt
|
||||
b _0808A522
|
||||
_0808A4F4:
|
||||
movs r1, 0xFE
|
||||
lsls r1, 2
|
||||
mov r0, sp
|
||||
adds r2, r5, 0
|
||||
bl door_build_blockdef
|
||||
mov r1, r9
|
||||
subs r1, 0x1
|
||||
adds r0, r7, 0
|
||||
mov r2, sp
|
||||
bl DrawDoorMetatileAt
|
||||
movs r1, 0xFF
|
||||
lsls r1, 2
|
||||
adds r2, r5, 0x4
|
||||
mov r0, sp
|
||||
bl door_build_blockdef
|
||||
adds r0, r7, 0
|
||||
mov r1, r9
|
||||
mov r2, sp
|
||||
bl DrawDoorMetatileAt
|
||||
_0808A522:
|
||||
add sp, 0x30
|
||||
pop {r3,r4}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end door_patch_tilemap
|
||||
|
||||
thumb_func_start sub_808A530
|
||||
sub_808A530: @ 808A530
|
||||
push {r4-r7,lr}
|
||||
adds r4, r0, 0
|
||||
adds r5, r1, 0
|
||||
adds r6, r2, 0
|
||||
subs r7, r6, 0x1
|
||||
adds r0, r5, 0
|
||||
adds r1, r7, 0
|
||||
bl CurrentMapDrawMetatileAt
|
||||
adds r0, r5, 0
|
||||
adds r1, r6, 0
|
||||
bl CurrentMapDrawMetatileAt
|
||||
ldrb r0, [r4, 0x3]
|
||||
cmp r0, 0x2
|
||||
bne _0808A562
|
||||
adds r4, r5, 0x1
|
||||
adds r0, r4, 0
|
||||
adds r1, r7, 0
|
||||
bl CurrentMapDrawMetatileAt
|
||||
adds r0, r4, 0
|
||||
adds r1, r6, 0
|
||||
bl CurrentMapDrawMetatileAt
|
||||
_0808A562:
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_808A530
|
||||
|
||||
thumb_func_start sub_808A568
|
||||
sub_808A568: @ 808A568
|
||||
push {r4-r7,lr}
|
||||
adds r4, r0, 0
|
||||
adds r5, r1, 0
|
||||
adds r6, r2, 0
|
||||
adds r7, r3, 0
|
||||
ldrh r1, [r5, 0x2]
|
||||
ldr r0, =0x0000ffff
|
||||
cmp r1, r0
|
||||
bne _0808A5B0
|
||||
adds r0, r4, 0
|
||||
adds r1, r6, 0
|
||||
adds r2, r7, 0
|
||||
bl sub_808A530
|
||||
bl sub_808A964
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _0808A5E2
|
||||
ldr r0, =0x020375e0
|
||||
ldrh r1, [r0]
|
||||
adds r1, 0x7
|
||||
ldr r0, =0x020375e2
|
||||
ldrh r2, [r0]
|
||||
adds r2, 0x7
|
||||
adds r0, r4, 0
|
||||
bl sub_808A530
|
||||
b _0808A5E2
|
||||
.pool
|
||||
_0808A5B0:
|
||||
adds r0, r4, 0
|
||||
adds r1, r5, 0
|
||||
bl sub_808A400
|
||||
ldr r3, [r4, 0x8]
|
||||
adds r0, r4, 0
|
||||
adds r1, r6, 0
|
||||
adds r2, r7, 0
|
||||
bl door_patch_tilemap
|
||||
bl sub_808A964
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _0808A5E2
|
||||
ldr r0, =0x020375e0
|
||||
ldrh r1, [r0]
|
||||
adds r1, 0x7
|
||||
ldr r0, =0x020375e2
|
||||
ldrh r2, [r0]
|
||||
adds r2, 0x7
|
||||
ldr r3, [r4, 0x8]
|
||||
adds r0, r4, 0
|
||||
bl door_patch_tilemap
|
||||
_0808A5E2:
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_808A568
|
||||
|
||||
thumb_func_start sub_808A5F0
|
||||
sub_808A5F0: @ 808A5F0
|
||||
push {r4-r6,lr}
|
||||
adds r6, r0, 0
|
||||
adds r5, r1, 0
|
||||
adds r4, r2, 0
|
||||
movs r1, 0xA
|
||||
ldrsh r0, [r4, r1]
|
||||
cmp r0, 0
|
||||
bne _0808A616
|
||||
movs r2, 0x8
|
||||
ldrsh r1, [r4, r2]
|
||||
lsls r1, 2
|
||||
adds r1, r5, r1
|
||||
movs r0, 0xC
|
||||
ldrsh r2, [r4, r0]
|
||||
movs r0, 0xE
|
||||
ldrsh r3, [r4, r0]
|
||||
adds r0, r6, 0
|
||||
bl sub_808A568
|
||||
_0808A616:
|
||||
movs r2, 0xA
|
||||
ldrsh r1, [r4, r2]
|
||||
movs r2, 0x8
|
||||
ldrsh r0, [r4, r2]
|
||||
lsls r0, 2
|
||||
adds r0, r5
|
||||
ldrb r0, [r0]
|
||||
cmp r1, r0
|
||||
bne _0808A644
|
||||
movs r0, 0
|
||||
strh r0, [r4, 0xA]
|
||||
ldrh r0, [r4, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0x8]
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r4, r1]
|
||||
lsls r0, 2
|
||||
adds r0, r5
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0
|
||||
bne _0808A64A
|
||||
movs r0, 0
|
||||
b _0808A64C
|
||||
_0808A644:
|
||||
ldrh r0, [r4, 0xA]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0xA]
|
||||
_0808A64A:
|
||||
movs r0, 0x1
|
||||
_0808A64C:
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_808A5F0
|
||||
|
||||
thumb_func_start task50_overworld_door
|
||||
task50_overworld_door: @ 808A654
|
||||
push {r4,lr}
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
lsls r2, r4, 2
|
||||
adds r2, r4
|
||||
lsls r2, 3
|
||||
ldr r0, =0x03005e08
|
||||
adds r2, r0
|
||||
ldrh r1, [r2]
|
||||
lsls r1, 16
|
||||
ldrh r0, [r2, 0x2]
|
||||
orrs r1, r0
|
||||
ldrh r0, [r2, 0x4]
|
||||
lsls r0, 16
|
||||
ldrh r3, [r2, 0x6]
|
||||
orrs r0, r3
|
||||
bl sub_808A5F0
|
||||
cmp r0, 0
|
||||
bne _0808A682
|
||||
adds r0, r4, 0
|
||||
bl DestroyTask
|
||||
_0808A682:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end task50_overworld_door
|
||||
|
||||
thumb_func_start door_frame_last
|
||||
door_frame_last: @ 808A68C
|
||||
push {lr}
|
||||
adds r1, r0, 0
|
||||
b _0808A694
|
||||
_0808A692:
|
||||
adds r1, 0x4
|
||||
_0808A694:
|
||||
ldrb r0, [r1]
|
||||
cmp r0, 0
|
||||
bne _0808A692
|
||||
subs r0, r1, 0x4
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end door_frame_last
|
||||
|
||||
thumb_func_start door_find
|
||||
door_find: @ 808A6A0
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
b _0808A6B6
|
||||
_0808A6AA:
|
||||
ldrh r0, [r2]
|
||||
cmp r0, r1
|
||||
bne _0808A6B4
|
||||
adds r0, r2, 0
|
||||
b _0808A6BE
|
||||
_0808A6B4:
|
||||
adds r2, 0xC
|
||||
_0808A6B6:
|
||||
ldr r0, [r2, 0x4]
|
||||
cmp r0, 0
|
||||
bne _0808A6AA
|
||||
movs r0, 0
|
||||
_0808A6BE:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end door_find
|
||||
|
||||
thumb_func_start task_overworld_door_add_if_inactive
|
||||
task_overworld_door_add_if_inactive: @ 808A6C4
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
adds r6, r0, 0
|
||||
adds r5, r1, 0
|
||||
adds r7, r2, 0
|
||||
mov r8, r3
|
||||
ldr r4, =task50_overworld_door
|
||||
adds r0, r4, 0
|
||||
bl FuncIsActiveTask
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
beq _0808A718
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x50
|
||||
bl CreateTask
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
ldr r2, =0x03005e08
|
||||
adds r1, r2
|
||||
strh r7, [r1, 0xC]
|
||||
mov r2, r8
|
||||
strh r2, [r1, 0xE]
|
||||
strh r5, [r1, 0x2]
|
||||
lsrs r2, r5, 16
|
||||
strh r2, [r1]
|
||||
strh r6, [r1, 0x6]
|
||||
lsrs r2, r6, 16
|
||||
strh r2, [r1, 0x4]
|
||||
lsls r0, 24
|
||||
asrs r0, 24
|
||||
b _0808A71C
|
||||
.pool
|
||||
_0808A718:
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
_0808A71C:
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end task_overworld_door_add_if_inactive
|
||||
|
||||
thumb_func_start sub_808A728
|
||||
sub_808A728: @ 808A728
|
||||
push {lr}
|
||||
bl sub_808A530
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_808A728
|
||||
|
||||
thumb_func_start sub_808A734
|
||||
sub_808A734: @ 808A734
|
||||
push {r4-r6,lr}
|
||||
adds r4, r0, 0
|
||||
adds r5, r1, 0
|
||||
adds r6, r2, 0
|
||||
adds r0, r5, 0
|
||||
adds r1, r6, 0
|
||||
bl MapGridGetMetatileIdAt
|
||||
adds r1, r0, 0
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
adds r0, r4, 0
|
||||
bl door_find
|
||||
adds r4, r0, 0
|
||||
cmp r4, 0
|
||||
beq _0808A76A
|
||||
ldr r1, =gUnknown_08496F8C
|
||||
adds r0, r1, 0
|
||||
bl door_frame_last
|
||||
adds r1, r0, 0
|
||||
adds r0, r4, 0
|
||||
adds r2, r5, 0
|
||||
adds r3, r6, 0
|
||||
bl sub_808A568
|
||||
_0808A76A:
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_808A734
|
||||
|
||||
thumb_func_start task_overworld_door_add_for_opening_door_at
|
||||
@ s32 task_overworld_door_add_for_opening_door_at(void *a1, s32 x, s32 y)
|
||||
task_overworld_door_add_for_opening_door_at: @ 808A774
|
||||
push {r4-r6,lr}
|
||||
adds r4, r0, 0
|
||||
adds r5, r1, 0
|
||||
adds r6, r2, 0
|
||||
adds r0, r5, 0
|
||||
adds r1, r6, 0
|
||||
bl MapGridGetMetatileIdAt
|
||||
adds r1, r0, 0
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
adds r0, r4, 0
|
||||
bl door_find
|
||||
adds r2, r0, 0
|
||||
adds r4, r2, 0
|
||||
cmp r2, 0
|
||||
bne _0808A79E
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
b _0808A7C0
|
||||
_0808A79E:
|
||||
ldrb r0, [r2, 0x3]
|
||||
cmp r0, 0x2
|
||||
beq _0808A7B0
|
||||
ldr r1, =gUnknown_08496F8C
|
||||
adds r0, r2, 0
|
||||
b _0808A7B4
|
||||
.pool
|
||||
_0808A7B0:
|
||||
ldr r1, =gUnknown_08496FB4
|
||||
adds r0, r4, 0
|
||||
_0808A7B4:
|
||||
adds r2, r5, 0
|
||||
adds r3, r6, 0
|
||||
bl task_overworld_door_add_if_inactive
|
||||
lsls r0, 24
|
||||
asrs r0, 24
|
||||
_0808A7C0:
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end task_overworld_door_add_for_opening_door_at
|
||||
|
||||
thumb_func_start sub_808A7CC
|
||||
sub_808A7CC: @ 808A7CC
|
||||
push {r4-r6,lr}
|
||||
adds r4, r0, 0
|
||||
adds r5, r1, 0
|
||||
adds r6, r2, 0
|
||||
adds r0, r5, 0
|
||||
adds r1, r6, 0
|
||||
bl MapGridGetMetatileIdAt
|
||||
adds r1, r0, 0
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
adds r0, r4, 0
|
||||
bl door_find
|
||||
cmp r0, 0
|
||||
beq _0808A800
|
||||
ldr r1, =gUnknown_08496FA0
|
||||
adds r2, r5, 0
|
||||
adds r3, r6, 0
|
||||
bl task_overworld_door_add_if_inactive
|
||||
lsls r0, 24
|
||||
asrs r0, 24
|
||||
b _0808A804
|
||||
.pool
|
||||
_0808A800:
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
_0808A804:
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_808A7CC
|
||||
|
||||
thumb_func_start cur_mapdata_get_door_x2_at
|
||||
cur_mapdata_get_door_x2_at: @ 808A80C
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
adds r0, r1, 0
|
||||
adds r1, r2, 0
|
||||
bl MapGridGetMetatileIdAt
|
||||
adds r1, r0, 0
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
adds r0, r4, 0
|
||||
bl door_find
|
||||
cmp r0, 0
|
||||
beq _0808A830
|
||||
ldrb r0, [r0, 0x2]
|
||||
lsls r0, 24
|
||||
asrs r0, 24
|
||||
b _0808A834
|
||||
_0808A830:
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
_0808A834:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end cur_mapdata_get_door_x2_at
|
||||
|
||||
thumb_func_start sub_808A83C
|
||||
sub_808A83C: @ 808A83C
|
||||
push {lr}
|
||||
adds r3, r0, 0
|
||||
adds r2, r1, 0
|
||||
ldr r0, =gUnknown_08497174
|
||||
adds r1, r3, 0
|
||||
bl task_overworld_door_add_for_opening_door_at
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_808A83C
|
||||
|
||||
thumb_func_start sub_808A854
|
||||
sub_808A854: @ 808A854
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
adds r5, r1, 0
|
||||
bl MapGridGetMetatileBehaviorAt
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
bl sub_8088EFC
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _0808A876
|
||||
ldr r0, =gUnknown_08497174
|
||||
adds r1, r4, 0
|
||||
adds r2, r5, 0
|
||||
bl sub_808A734
|
||||
_0808A876:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_808A854
|
||||
|
||||
thumb_func_start sub_808A880
|
||||
sub_808A880: @ 808A880
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
adds r5, r1, 0
|
||||
bl MapGridGetMetatileBehaviorAt
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
bl sub_8088EFC
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _0808A8A2
|
||||
ldr r0, =gUnknown_08497174
|
||||
adds r1, r4, 0
|
||||
adds r2, r5, 0
|
||||
bl sub_808A728
|
||||
_0808A8A2:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_808A880
|
||||
|
||||
thumb_func_start sub_808A8AC
|
||||
sub_808A8AC: @ 808A8AC
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
adds r5, r1, 0
|
||||
bl MapGridGetMetatileBehaviorAt
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
bl sub_8088EFC
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _0808A8D8
|
||||
ldr r0, =gUnknown_08497174
|
||||
adds r1, r4, 0
|
||||
adds r2, r5, 0
|
||||
bl sub_808A7CC
|
||||
lsls r0, 24
|
||||
asrs r0, 24
|
||||
b _0808A8DC
|
||||
.pool
|
||||
_0808A8D8:
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
_0808A8DC:
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_808A8AC
|
||||
|
||||
thumb_func_start task_overworld_door_add_if_role_69_for_opening_door_at
|
||||
task_overworld_door_add_if_role_69_for_opening_door_at: @ 808A8E4
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
adds r5, r1, 0
|
||||
bl MapGridGetMetatileBehaviorAt
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
bl sub_8088EFC
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _0808A910
|
||||
ldr r0, =gUnknown_08497174
|
||||
adds r1, r4, 0
|
||||
adds r2, r5, 0
|
||||
bl task_overworld_door_add_for_opening_door_at
|
||||
lsls r0, 24
|
||||
asrs r0, 24
|
||||
b _0808A914
|
||||
.pool
|
||||
_0808A910:
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
_0808A914:
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end task_overworld_door_add_if_role_69_for_opening_door_at
|
||||
|
||||
thumb_func_start sub_808A91C
|
||||
sub_808A91C: @ 808A91C
|
||||
push {lr}
|
||||
ldr r0, =task50_overworld_door
|
||||
bl FuncIsActiveTask
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_808A91C
|
||||
|
||||
thumb_func_start cur_mapdata_get_door_sound_at
|
||||
cur_mapdata_get_door_sound_at: @ 808A930
|
||||
push {lr}
|
||||
adds r3, r0, 0
|
||||
adds r2, r1, 0
|
||||
ldr r0, =gUnknown_08497174
|
||||
adds r1, r3, 0
|
||||
bl cur_mapdata_get_door_x2_at
|
||||
lsls r0, 24
|
||||
asrs r0, 24
|
||||
cmp r0, 0
|
||||
beq _0808A958
|
||||
cmp r0, 0x1
|
||||
bne _0808A954
|
||||
movs r0, 0x12
|
||||
b _0808A95E
|
||||
.pool
|
||||
_0808A954:
|
||||
cmp r0, 0x2
|
||||
beq _0808A95C
|
||||
_0808A958:
|
||||
movs r0, 0x8
|
||||
b _0808A95E
|
||||
_0808A95C:
|
||||
movs r0, 0x2F
|
||||
_0808A95E:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end cur_mapdata_get_door_sound_at
|
||||
|
||||
thumb_func_start sub_808A964
|
||||
sub_808A964: @ 808A964
|
||||
push {lr}
|
||||
ldr r0, =0x00004002
|
||||
bl FlagGet
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _0808A990
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r0, [r0]
|
||||
ldrh r1, [r0, 0x4]
|
||||
ldr r0, =0x0000101a
|
||||
cmp r1, r0
|
||||
bne _0808A990
|
||||
movs r0, 0x1
|
||||
b _0808A992
|
||||
.pool
|
||||
_0808A990:
|
||||
movs r0, 0
|
||||
_0808A992:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_808A964
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
501
asm/field_effect.s
Normal file
501
asm/field_effect.s
Normal file
@ -0,0 +1,501 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start FieldEffectStart
|
||||
@ u8 FieldEffectStart(u8 id)
|
||||
FieldEffectStart: @ 80B5B18
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0x8
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
adds r0, r4, 0
|
||||
bl FieldEffectActiveListAdd
|
||||
ldr r0, =gFieldEffectScriptPointers
|
||||
lsls r4, 2
|
||||
adds r4, r0
|
||||
ldr r0, [r4]
|
||||
str r0, [sp]
|
||||
add r4, sp, 0x4
|
||||
ldr r5, =gUnknown_0855C1F0
|
||||
_080B5B36:
|
||||
ldr r0, [sp]
|
||||
ldrb r0, [r0]
|
||||
lsls r0, 2
|
||||
adds r0, r5
|
||||
ldr r2, [r0]
|
||||
mov r0, sp
|
||||
adds r1, r4, 0
|
||||
bl _call_via_r2
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _080B5B36
|
||||
ldr r0, [sp, 0x4]
|
||||
add sp, 0x8
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end FieldEffectStart
|
||||
|
||||
thumb_func_start FieldEffectCmd_loadtiles
|
||||
@ bool8 FieldEffectCmd_loadtiles(u8 **script, u8 *returnValue)
|
||||
FieldEffectCmd_loadtiles: @ 80B5B60
|
||||
push {lr}
|
||||
ldr r1, [r0]
|
||||
adds r1, 0x1
|
||||
str r1, [r0]
|
||||
bl FieldEffectScript_LoadTiles
|
||||
movs r0, 0x1
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end FieldEffectCmd_loadtiles
|
||||
|
||||
thumb_func_start FieldEffectCmd_loadfadedpal
|
||||
@ bool8 FieldEffectCmd_loadfadedpal(u8 **script, u8 *returnValue)
|
||||
FieldEffectCmd_loadfadedpal: @ 80B5B74
|
||||
push {lr}
|
||||
ldr r1, [r0]
|
||||
adds r1, 0x1
|
||||
str r1, [r0]
|
||||
bl FieldEffectScript_LoadFadedPalette
|
||||
movs r0, 0x1
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end FieldEffectCmd_loadfadedpal
|
||||
|
||||
thumb_func_start FieldEffectCmd_loadpal
|
||||
@ bool8 FieldEffectCmd_loadpal(u8 **script, u8 *returnValue)
|
||||
FieldEffectCmd_loadpal: @ 80B5B88
|
||||
push {lr}
|
||||
ldr r1, [r0]
|
||||
adds r1, 0x1
|
||||
str r1, [r0]
|
||||
bl FieldEffectScript_LoadPalette
|
||||
movs r0, 0x1
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end FieldEffectCmd_loadpal
|
||||
|
||||
thumb_func_start FieldEffectCmd_callnative
|
||||
@ bool8 FieldEffectCmd_callnative(u8 **script, u8 *returnValue)
|
||||
FieldEffectCmd_callnative: @ 80B5B9C
|
||||
push {lr}
|
||||
ldr r2, [r0]
|
||||
adds r2, 0x1
|
||||
str r2, [r0]
|
||||
bl FieldEffectScript_CallNative
|
||||
movs r0, 0x1
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end FieldEffectCmd_callnative
|
||||
|
||||
thumb_func_start FieldEffectCmd_end
|
||||
@ bool8 FieldEffectCmd_end(u8 **script, u8 *returnValue)
|
||||
FieldEffectCmd_end: @ 80B5BB0
|
||||
movs r0, 0
|
||||
bx lr
|
||||
thumb_func_end FieldEffectCmd_end
|
||||
|
||||
thumb_func_start FieldEffectCmd_loadgfx_callnative
|
||||
@ bool8 FieldEffectCmd_loadgfx_callnative(u8 **script, u8 *returnValue)
|
||||
FieldEffectCmd_loadgfx_callnative: @ 80B5BB4
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
adds r5, r1, 0
|
||||
ldr r0, [r4]
|
||||
adds r0, 0x1
|
||||
str r0, [r4]
|
||||
adds r0, r4, 0
|
||||
bl FieldEffectScript_LoadTiles
|
||||
adds r0, r4, 0
|
||||
bl FieldEffectScript_LoadFadedPalette
|
||||
adds r0, r4, 0
|
||||
adds r1, r5, 0
|
||||
bl FieldEffectScript_CallNative
|
||||
movs r0, 0x1
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end FieldEffectCmd_loadgfx_callnative
|
||||
|
||||
thumb_func_start FieldEffectCmd_loadtiles_callnative
|
||||
@ bool8 FieldEffectCmd_loadtiles_callnative(u8 **script, u8 *returnValue)
|
||||
FieldEffectCmd_loadtiles_callnative: @ 80B5BDC
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
adds r5, r1, 0
|
||||
ldr r0, [r4]
|
||||
adds r0, 0x1
|
||||
str r0, [r4]
|
||||
adds r0, r4, 0
|
||||
bl FieldEffectScript_LoadTiles
|
||||
adds r0, r4, 0
|
||||
adds r1, r5, 0
|
||||
bl FieldEffectScript_CallNative
|
||||
movs r0, 0x1
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end FieldEffectCmd_loadtiles_callnative
|
||||
|
||||
thumb_func_start FieldEffectCmd_loadfadedpal_callnative
|
||||
@ bool8 FieldEffectCmd_loadfadedpal_callnative(u8 **script, u8 *returnValue)
|
||||
FieldEffectCmd_loadfadedpal_callnative: @ 80B5C00
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
adds r5, r1, 0
|
||||
ldr r0, [r4]
|
||||
adds r0, 0x1
|
||||
str r0, [r4]
|
||||
adds r0, r4, 0
|
||||
bl FieldEffectScript_LoadFadedPalette
|
||||
adds r0, r4, 0
|
||||
adds r1, r5, 0
|
||||
bl FieldEffectScript_CallNative
|
||||
movs r0, 0x1
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end FieldEffectCmd_loadfadedpal_callnative
|
||||
|
||||
thumb_func_start FieldEffectScript_ReadWord
|
||||
@ u32 FieldEffectScript_ReadWord(u8 **script)
|
||||
FieldEffectScript_ReadWord: @ 80B5C24
|
||||
ldr r2, [r0]
|
||||
ldrb r0, [r2]
|
||||
ldrb r1, [r2, 0x1]
|
||||
lsls r1, 8
|
||||
adds r0, r1
|
||||
ldrb r1, [r2, 0x2]
|
||||
lsls r1, 16
|
||||
adds r0, r1
|
||||
ldrb r1, [r2, 0x3]
|
||||
lsls r1, 24
|
||||
adds r0, r1
|
||||
bx lr
|
||||
thumb_func_end FieldEffectScript_ReadWord
|
||||
|
||||
thumb_func_start FieldEffectScript_LoadTiles
|
||||
@ void FieldEffectScript_LoadTiles(u8 **script)
|
||||
FieldEffectScript_LoadTiles: @ 80B5C3C
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
bl FieldEffectScript_ReadWord
|
||||
adds r5, r0, 0
|
||||
ldrh r0, [r5, 0x6]
|
||||
bl GetObjectTileRangeStartByTag
|
||||
lsls r0, 16
|
||||
ldr r1, =0xffff0000
|
||||
cmp r0, r1
|
||||
bne _080B5C5A
|
||||
adds r0, r5, 0
|
||||
bl LoadObjectPic
|
||||
_080B5C5A:
|
||||
ldr r0, [r4]
|
||||
adds r0, 0x4
|
||||
str r0, [r4]
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end FieldEffectScript_LoadTiles
|
||||
|
||||
thumb_func_start FieldEffectScript_LoadFadedPalette
|
||||
@ void FieldEffectScript_LoadFadedPalette(u8 **script)
|
||||
FieldEffectScript_LoadFadedPalette: @ 80B5C6C
|
||||
push {r4,r5,lr}
|
||||
adds r5, r0, 0
|
||||
bl FieldEffectScript_ReadWord
|
||||
adds r4, r0, 0
|
||||
bl LoadTaggedObjectPalette
|
||||
ldrh r0, [r4, 0x4]
|
||||
bl IndexOfObjectPaletteTag
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
bl sub_80ABE18
|
||||
ldr r0, [r5]
|
||||
adds r0, 0x4
|
||||
str r0, [r5]
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end FieldEffectScript_LoadFadedPalette
|
||||
|
||||
thumb_func_start FieldEffectScript_LoadPalette
|
||||
@ void FieldEffectScript_LoadPalette(u8 **script)
|
||||
FieldEffectScript_LoadPalette: @ 80B5C94
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
bl FieldEffectScript_ReadWord
|
||||
bl LoadTaggedObjectPalette
|
||||
ldr r0, [r4]
|
||||
adds r0, 0x4
|
||||
str r0, [r4]
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end FieldEffectScript_LoadPalette
|
||||
|
||||
thumb_func_start FieldEffectScript_CallNative
|
||||
@ void FieldEffectScript_CallNative(u8 **script, u8 *returnValue)
|
||||
FieldEffectScript_CallNative: @ 80B5CAC
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
adds r5, r1, 0
|
||||
bl FieldEffectScript_ReadWord
|
||||
bl _call_via_r0
|
||||
str r0, [r5]
|
||||
ldr r0, [r4]
|
||||
adds r0, 0x4
|
||||
str r0, [r4]
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end FieldEffectScript_CallNative
|
||||
|
||||
thumb_func_start FieldEffectFreeGraphicsResources
|
||||
@ void FieldEffectFreeGraphicsResources(struct obj *object)
|
||||
FieldEffectFreeGraphicsResources: @ 80B5CC8
|
||||
push {r4,r5,lr}
|
||||
adds r1, r0, 0
|
||||
adds r1, 0x40
|
||||
ldrh r5, [r1]
|
||||
ldrb r4, [r0, 0x5]
|
||||
lsrs r4, 4
|
||||
bl RemoveObjectAndFreeTiles
|
||||
adds r0, r5, 0
|
||||
bl FieldEffectFreeTilesIfUnused
|
||||
adds r0, r4, 0
|
||||
bl FieldEffectFreePaletteIfUnused
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end FieldEffectFreeGraphicsResources
|
||||
|
||||
thumb_func_start FieldEffectStop
|
||||
@ void FieldEffectStop(struct obj *object, u8 id)
|
||||
FieldEffectStop: @ 80B5CEC
|
||||
push {r4,lr}
|
||||
lsls r4, r1, 24
|
||||
lsrs r4, 24
|
||||
bl FieldEffectFreeGraphicsResources
|
||||
adds r0, r4, 0
|
||||
bl FieldEffectActiveListRemove
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end FieldEffectStop
|
||||
|
||||
thumb_func_start FieldEffectFreeTilesIfUnused
|
||||
@ void FieldEffectFreeTilesIfUnused(u16 tileRangeStart)
|
||||
FieldEffectFreeTilesIfUnused: @ 80B5D04
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
adds r0, r4, 0
|
||||
bl GetTagByObjectTileRangeStart
|
||||
lsls r0, 16
|
||||
lsrs r3, r0, 16
|
||||
ldr r0, =0x0000ffff
|
||||
cmp r3, r0
|
||||
beq _080B5D58
|
||||
movs r2, 0
|
||||
ldr r5, =0x02020630
|
||||
_080B5D1E:
|
||||
lsls r0, r2, 4
|
||||
adds r0, r2
|
||||
lsls r0, 2
|
||||
adds r1, r0, r5
|
||||
adds r0, r1, 0
|
||||
adds r0, 0x3E
|
||||
ldrb r0, [r0]
|
||||
lsls r0, 31
|
||||
cmp r0, 0
|
||||
beq _080B5D48
|
||||
adds r0, r1, 0
|
||||
adds r0, 0x3F
|
||||
ldrb r0, [r0]
|
||||
lsls r0, 25
|
||||
cmp r0, 0
|
||||
bge _080B5D48
|
||||
adds r0, r1, 0
|
||||
adds r0, 0x40
|
||||
ldrh r0, [r0]
|
||||
cmp r4, r0
|
||||
beq _080B5D58
|
||||
_080B5D48:
|
||||
adds r0, r2, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
cmp r2, 0x3F
|
||||
bls _080B5D1E
|
||||
adds r0, r3, 0
|
||||
bl FreeObjectTilesByTag
|
||||
_080B5D58:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end FieldEffectFreeTilesIfUnused
|
||||
|
||||
thumb_func_start FieldEffectFreePaletteIfUnused
|
||||
@ void FieldEffectFreePaletteIfUnused(u8 paletteSlot)
|
||||
FieldEffectFreePaletteIfUnused: @ 80B5D68
|
||||
push {r4-r6,lr}
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
adds r0, r4, 0
|
||||
bl GetObjectPaletteTagBySlot
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
ldr r0, =0x0000ffff
|
||||
cmp r5, r0
|
||||
beq _080B5DB0
|
||||
movs r2, 0
|
||||
ldr r6, =0x02020630
|
||||
adds r3, r4, 0
|
||||
_080B5D84:
|
||||
lsls r0, r2, 4
|
||||
adds r0, r2
|
||||
lsls r0, 2
|
||||
adds r1, r0, r6
|
||||
adds r0, r1, 0
|
||||
adds r0, 0x3E
|
||||
ldrb r0, [r0]
|
||||
lsls r0, 31
|
||||
cmp r0, 0
|
||||
beq _080B5DA0
|
||||
ldrb r0, [r1, 0x5]
|
||||
lsrs r0, 4
|
||||
cmp r0, r3
|
||||
beq _080B5DB0
|
||||
_080B5DA0:
|
||||
adds r0, r2, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
cmp r2, 0x3F
|
||||
bls _080B5D84
|
||||
adds r0, r5, 0
|
||||
bl FreeObjectPaletteByTag
|
||||
_080B5DB0:
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end FieldEffectFreePaletteIfUnused
|
||||
|
||||
thumb_func_start FieldEffectActiveListClear
|
||||
@ void FieldEffectActiveListClear()
|
||||
FieldEffectActiveListClear: @ 80B5DC0
|
||||
push {r4,lr}
|
||||
movs r2, 0
|
||||
ldr r4, =0x03000f58
|
||||
movs r3, 0xFF
|
||||
_080B5DC8:
|
||||
adds r0, r2, r4
|
||||
ldrb r1, [r0]
|
||||
orrs r1, r3
|
||||
strb r1, [r0]
|
||||
adds r0, r2, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
cmp r2, 0x1F
|
||||
bls _080B5DC8
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end FieldEffectActiveListClear
|
||||
|
||||
thumb_func_start FieldEffectActiveListAdd
|
||||
@ void FieldEffectActiveListAdd(u8 id)
|
||||
FieldEffectActiveListAdd: @ 80B5DE4
|
||||
push {r4,lr}
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
movs r2, 0
|
||||
ldr r4, =0x03000f58
|
||||
_080B5DEE:
|
||||
adds r1, r2, r4
|
||||
ldrb r0, [r1]
|
||||
cmp r0, 0xFF
|
||||
bne _080B5E00
|
||||
strb r3, [r1]
|
||||
b _080B5E0A
|
||||
.pool
|
||||
_080B5E00:
|
||||
adds r0, r2, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
cmp r2, 0x1F
|
||||
bls _080B5DEE
|
||||
_080B5E0A:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end FieldEffectActiveListAdd
|
||||
|
||||
thumb_func_start FieldEffectActiveListRemove
|
||||
@ void FieldEffectActiveListRemove(u8 id)
|
||||
FieldEffectActiveListRemove: @ 80B5E10
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
movs r2, 0
|
||||
ldr r4, =0x03000f58
|
||||
movs r5, 0xFF
|
||||
_080B5E1C:
|
||||
adds r1, r2, r4
|
||||
ldrb r0, [r1]
|
||||
cmp r0, r3
|
||||
bne _080B5E30
|
||||
orrs r0, r5
|
||||
strb r0, [r1]
|
||||
b _080B5E3A
|
||||
.pool
|
||||
_080B5E30:
|
||||
adds r0, r2, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
cmp r2, 0x1F
|
||||
bls _080B5E1C
|
||||
_080B5E3A:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end FieldEffectActiveListRemove
|
||||
|
||||
thumb_func_start FieldEffectActiveListContains
|
||||
@ void FieldEffectActiveListContains(u8 id)
|
||||
FieldEffectActiveListContains: @ 80B5E40
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
movs r1, 0
|
||||
ldr r3, =0x03000f58
|
||||
_080B5E4A:
|
||||
adds r0, r1, r3
|
||||
ldrb r0, [r0]
|
||||
cmp r0, r2
|
||||
bne _080B5E5C
|
||||
movs r0, 0x1
|
||||
b _080B5E68
|
||||
.pool
|
||||
_080B5E5C:
|
||||
adds r0, r1, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r1, r0, 24
|
||||
cmp r1, 0x1F
|
||||
bls _080B5E4A
|
||||
movs r0, 0
|
||||
_080B5E68:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end FieldEffectActiveListContains
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
4603
asm/field_effect_helpers.s
Normal file
4603
asm/field_effect_helpers.s
Normal file
File diff suppressed because it is too large
Load Diff
1929
asm/field_ground_effect.s
Normal file
1929
asm/field_ground_effect.s
Normal file
File diff suppressed because it is too large
Load Diff
20270
asm/field_map_obj.s
Normal file
20270
asm/field_map_obj.s
Normal file
File diff suppressed because it is too large
Load Diff
337
asm/field_message_box.s
Normal file
337
asm/field_message_box.s
Normal file
@ -0,0 +1,337 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_8098128
|
||||
sub_8098128: @ 8098128
|
||||
ldr r1, =0x020375bc
|
||||
movs r0, 0
|
||||
strb r0, [r1]
|
||||
ldr r2, =0x03003014
|
||||
ldrb r1, [r2]
|
||||
movs r0, 0x2
|
||||
negs r0, r0
|
||||
ands r0, r1
|
||||
movs r1, 0x3
|
||||
negs r1, r1
|
||||
ands r0, r1
|
||||
subs r1, 0x2
|
||||
ands r0, r1
|
||||
subs r1, 0x4
|
||||
ands r0, r1
|
||||
strb r0, [r2]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sub_8098128
|
||||
|
||||
thumb_func_start sub_8098154
|
||||
sub_8098154: @ 8098154
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
lsls r0, r5, 2
|
||||
adds r0, r5
|
||||
lsls r0, 3
|
||||
ldr r1, =0x03005e00
|
||||
adds r4, r0, r1
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r4, r1]
|
||||
cmp r0, 0x1
|
||||
beq _08098188
|
||||
cmp r0, 0x1
|
||||
bgt _0809817C
|
||||
cmp r0, 0
|
||||
beq _08098182
|
||||
b _080981B0
|
||||
.pool
|
||||
_0809817C:
|
||||
cmp r0, 0x2
|
||||
beq _08098198
|
||||
b _080981B0
|
||||
_08098182:
|
||||
bl sub_81973A4
|
||||
b _08098190
|
||||
_08098188:
|
||||
movs r0, 0
|
||||
movs r1, 0x1
|
||||
bl sub_81973C4
|
||||
_08098190:
|
||||
ldrh r0, [r4, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0x8]
|
||||
b _080981B0
|
||||
_08098198:
|
||||
bl sub_8197224
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
cmp r0, 0x1
|
||||
beq _080981B0
|
||||
ldr r1, =0x020375bc
|
||||
movs r0, 0
|
||||
strb r0, [r1]
|
||||
adds r0, r5, 0
|
||||
bl DestroyTask
|
||||
_080981B0:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8098154
|
||||
|
||||
thumb_func_start task_add_textbox
|
||||
task_add_textbox: @ 80981BC
|
||||
push {lr}
|
||||
ldr r0, =sub_8098154
|
||||
movs r1, 0x50
|
||||
bl CreateTask
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end task_add_textbox
|
||||
|
||||
thumb_func_start task_del_textbox
|
||||
task_del_textbox: @ 80981D0
|
||||
push {lr}
|
||||
ldr r0, =sub_8098154
|
||||
bl FindTaskIdByFunc
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0xFF
|
||||
beq _080981E4
|
||||
bl DestroyTask
|
||||
_080981E4:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end task_del_textbox
|
||||
|
||||
thumb_func_start box_related_two__2
|
||||
box_related_two__2: @ 80981EC
|
||||
push {r4,lr}
|
||||
adds r1, r0, 0
|
||||
ldr r4, =0x020375bc
|
||||
ldrb r0, [r4]
|
||||
cmp r0, 0
|
||||
bne _0809820C
|
||||
adds r0, r1, 0
|
||||
movs r1, 0x1
|
||||
bl textbox_fdecode_auto_and_task_add
|
||||
movs r0, 0x2
|
||||
strb r0, [r4]
|
||||
movs r0, 0x1
|
||||
b _0809820E
|
||||
.pool
|
||||
_0809820C:
|
||||
movs r0, 0
|
||||
_0809820E:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end box_related_two__2
|
||||
|
||||
thumb_func_start sub_8098214
|
||||
sub_8098214: @ 8098214
|
||||
push {r4,lr}
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
bl sub_8196094
|
||||
adds r1, r0, 0
|
||||
cmp r1, 0
|
||||
bne _0809822E
|
||||
ldr r0, =0x020375bc
|
||||
strb r1, [r0]
|
||||
adds r0, r4, 0
|
||||
bl DestroyTask
|
||||
_0809822E:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8098214
|
||||
|
||||
thumb_func_start sub_8098238
|
||||
sub_8098238: @ 8098238
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
ldr r5, =0x020375bc
|
||||
ldrb r0, [r5]
|
||||
cmp r0, 0
|
||||
bne _08098270
|
||||
ldr r0, =0x02021fc4
|
||||
adds r1, r4, 0
|
||||
bl ExpandStringRefs
|
||||
ldr r0, =sub_8098214
|
||||
movs r1, 0
|
||||
bl CreateTask
|
||||
adds r0, r4, 0
|
||||
bl sub_8196080
|
||||
movs r0, 0x2
|
||||
strb r0, [r5]
|
||||
movs r0, 0x1
|
||||
b _08098272
|
||||
.pool
|
||||
_08098270:
|
||||
movs r0, 0
|
||||
_08098272:
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8098238
|
||||
|
||||
thumb_func_start box_related_two__3
|
||||
box_related_two__3: @ 8098278
|
||||
push {lr}
|
||||
adds r1, r0, 0
|
||||
ldr r2, =0x020375bc
|
||||
ldrb r0, [r2]
|
||||
cmp r0, 0
|
||||
bne _08098298
|
||||
movs r0, 0x3
|
||||
strb r0, [r2]
|
||||
adds r0, r1, 0
|
||||
movs r1, 0
|
||||
bl textbox_fdecode_auto_and_task_add
|
||||
movs r0, 0x1
|
||||
b _0809829A
|
||||
.pool
|
||||
_08098298:
|
||||
movs r0, 0
|
||||
_0809829A:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end box_related_two__3
|
||||
|
||||
thumb_func_start sub_80982A0
|
||||
sub_80982A0: @ 80982A0
|
||||
push {lr}
|
||||
ldr r2, =0x020375bc
|
||||
movs r1, 0x3
|
||||
strb r1, [r2]
|
||||
movs r1, 0x1
|
||||
bl textbox_fdecode_auto_and_task_add
|
||||
movs r0, 0x1
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_80982A0
|
||||
|
||||
thumb_func_start sub_80982B8
|
||||
sub_80982B8: @ 80982B8
|
||||
push {lr}
|
||||
ldr r1, =0x020375bc
|
||||
ldrb r0, [r1]
|
||||
cmp r0, 0
|
||||
bne _080982D4
|
||||
movs r0, 0x2
|
||||
strb r0, [r1]
|
||||
bl textbox_auto_and_task_add
|
||||
movs r0, 0x1
|
||||
b _080982D6
|
||||
.pool
|
||||
_080982D4:
|
||||
movs r0, 0
|
||||
_080982D6:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80982B8
|
||||
|
||||
thumb_func_start textbox_fdecode_auto_and_task_add
|
||||
textbox_fdecode_auto_and_task_add: @ 80982DC
|
||||
push {r4,lr}
|
||||
adds r2, r0, 0
|
||||
adds r4, r1, 0
|
||||
ldr r0, =0x02021fc4
|
||||
adds r1, r2, 0
|
||||
bl ExpandStringRefs
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
adds r0, r4, 0
|
||||
bl AddTextPrinterForMessage
|
||||
bl task_add_textbox
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end textbox_fdecode_auto_and_task_add
|
||||
|
||||
thumb_func_start textbox_auto_and_task_add
|
||||
textbox_auto_and_task_add: @ 8098304
|
||||
push {lr}
|
||||
movs r0, 0x1
|
||||
bl AddTextPrinterForMessage
|
||||
bl task_add_textbox
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end textbox_auto_and_task_add
|
||||
|
||||
thumb_func_start textbox_close
|
||||
textbox_close: @ 8098314
|
||||
push {lr}
|
||||
bl task_del_textbox
|
||||
movs r0, 0
|
||||
movs r1, 0x1
|
||||
bl sub_8197434
|
||||
ldr r1, =0x020375bc
|
||||
movs r0, 0
|
||||
strb r0, [r1]
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end textbox_close
|
||||
|
||||
thumb_func_start textbox_any_visible
|
||||
textbox_any_visible: @ 8098330
|
||||
ldr r0, =0x020375bc
|
||||
ldrb r0, [r0]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end textbox_any_visible
|
||||
|
||||
thumb_func_start sub_809833C
|
||||
sub_809833C: @ 809833C
|
||||
push {lr}
|
||||
ldr r0, =0x020375bc
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0
|
||||
beq _08098350
|
||||
movs r0, 0
|
||||
b _08098352
|
||||
.pool
|
||||
_08098350:
|
||||
movs r0, 0x1
|
||||
_08098352:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_809833C
|
||||
|
||||
thumb_func_start sub_8098358
|
||||
sub_8098358: @ 8098358
|
||||
push {lr}
|
||||
bl task_del_textbox
|
||||
movs r0, 0
|
||||
movs r1, 0x1
|
||||
bl sub_81973FC
|
||||
ldr r1, =0x020375bc
|
||||
movs r0, 0
|
||||
strb r0, [r1]
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8098358
|
||||
|
||||
thumb_func_start sub_8098374
|
||||
sub_8098374: @ 8098374
|
||||
push {lr}
|
||||
bl task_del_textbox
|
||||
ldr r1, =0x020375bc
|
||||
movs r0, 0
|
||||
strb r0, [r1]
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8098374
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
5452
asm/field_player_avatar.s
Normal file
5452
asm/field_player_avatar.s
Normal file
File diff suppressed because it is too large
Load Diff
323
asm/field_poison.s
Normal file
323
asm/field_poison.s
Normal file
@ -0,0 +1,323 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_80F9568
|
||||
sub_80F9568: @ 80F9568
|
||||
push {lr}
|
||||
movs r1, 0x41
|
||||
bl pokemon_getattr
|
||||
lsls r0, 16
|
||||
lsrs r1, r0, 16
|
||||
cmp r1, 0
|
||||
beq _080F9580
|
||||
movs r0, 0xCE
|
||||
lsls r0, 1
|
||||
cmp r1, r0
|
||||
bne _080F9584
|
||||
_080F9580:
|
||||
movs r0, 0
|
||||
b _080F9586
|
||||
_080F9584:
|
||||
movs r0, 0x1
|
||||
_080F9586:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80F9568
|
||||
|
||||
thumb_func_start sub_80F958C
|
||||
sub_80F958C: @ 80F958C
|
||||
push {r4,r5,lr}
|
||||
ldr r4, =0x020244ec
|
||||
movs r5, 0
|
||||
_080F9592:
|
||||
adds r0, r4, 0
|
||||
bl sub_80F9568
|
||||
cmp r0, 0
|
||||
beq _080F95B0
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x39
|
||||
bl pokemon_getattr
|
||||
cmp r0, 0
|
||||
beq _080F95B0
|
||||
movs r0, 0
|
||||
b _080F95BA
|
||||
.pool
|
||||
_080F95B0:
|
||||
adds r5, 0x1
|
||||
adds r4, 0x64
|
||||
cmp r5, 0x5
|
||||
ble _080F9592
|
||||
movs r0, 0x1
|
||||
_080F95BA:
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80F958C
|
||||
|
||||
thumb_func_start sub_80F95C0
|
||||
sub_80F95C0: @ 80F95C0
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0x4
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
movs r1, 0x64
|
||||
adds r4, r0, 0
|
||||
muls r4, r1
|
||||
ldr r0, =0x020244ec
|
||||
adds r4, r0
|
||||
movs r0, 0
|
||||
str r0, [sp]
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x7
|
||||
bl happiness_algorithm
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x37
|
||||
mov r2, sp
|
||||
bl pokemon_setattr
|
||||
ldr r5, =0x02021cc4
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x2
|
||||
adds r2, r5, 0
|
||||
bl pokemon_getattr
|
||||
adds r0, r5, 0
|
||||
bl GetStringEnd_Limit7
|
||||
add sp, 0x4
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80F95C0
|
||||
|
||||
thumb_func_start sub_80F960C
|
||||
sub_80F960C: @ 80F960C
|
||||
push {r4,lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
movs r1, 0x64
|
||||
muls r1, r0
|
||||
ldr r0, =0x020244ec
|
||||
adds r4, r1, r0
|
||||
adds r0, r4, 0
|
||||
bl sub_80F9568
|
||||
cmp r0, 0
|
||||
beq _080F964C
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x39
|
||||
bl pokemon_getattr
|
||||
cmp r0, 0
|
||||
bne _080F964C
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x37
|
||||
bl pokemon_getattr
|
||||
bl pokemon_ailments_get_primary
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
bne _080F964C
|
||||
movs r0, 0x1
|
||||
b _080F964E
|
||||
.pool
|
||||
_080F964C:
|
||||
movs r0, 0
|
||||
_080F964E:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80F960C
|
||||
|
||||
thumb_func_start sub_80F9654
|
||||
sub_80F9654: @ 80F9654
|
||||
push {r4-r6,lr}
|
||||
lsls r0, 24
|
||||
lsrs r6, r0, 24
|
||||
lsls r0, r6, 2
|
||||
adds r0, r6
|
||||
lsls r0, 3
|
||||
ldr r1, =0x03005e08
|
||||
adds r4, r0, r1
|
||||
movs r0, 0
|
||||
ldrsh r5, [r4, r0]
|
||||
cmp r5, 0x1
|
||||
beq _080F96AE
|
||||
cmp r5, 0x1
|
||||
bgt _080F967C
|
||||
cmp r5, 0
|
||||
beq _080F9682
|
||||
b _080F9722
|
||||
.pool
|
||||
_080F967C:
|
||||
cmp r5, 0x2
|
||||
beq _080F96C0
|
||||
b _080F9722
|
||||
_080F9682:
|
||||
ldrh r1, [r4, 0x2]
|
||||
movs r2, 0x2
|
||||
ldrsh r0, [r4, r2]
|
||||
cmp r0, 0x5
|
||||
bgt _080F96A8
|
||||
_080F968C:
|
||||
lsls r0, r1, 24
|
||||
lsrs r0, 24
|
||||
bl sub_80F960C
|
||||
cmp r0, 0
|
||||
bne _080F96FC
|
||||
ldrh r0, [r4, 0x2]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0x2]
|
||||
adds r1, r0, 0
|
||||
lsls r0, 16
|
||||
asrs r0, 16
|
||||
cmp r0, 0x5
|
||||
ble _080F968C
|
||||
_080F96A8:
|
||||
movs r0, 0x2
|
||||
strh r0, [r4]
|
||||
b _080F9722
|
||||
_080F96AE:
|
||||
bl sub_809833C
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _080F9722
|
||||
ldrh r0, [r4]
|
||||
subs r0, 0x1
|
||||
strh r0, [r4]
|
||||
b _080F9722
|
||||
_080F96C0:
|
||||
bl sub_80F958C
|
||||
adds r1, r0, 0
|
||||
cmp r1, 0
|
||||
beq _080F9714
|
||||
bl InBattlePyramid
|
||||
adds r4, r0, 0
|
||||
bl InBattlePike
|
||||
orrs r4, r0
|
||||
lsls r4, 24
|
||||
cmp r4, 0
|
||||
bne _080F96E6
|
||||
bl sub_81D5C18
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _080F96F0
|
||||
_080F96E6:
|
||||
ldr r0, =0x020375f0
|
||||
strh r5, [r0]
|
||||
b _080F9718
|
||||
.pool
|
||||
_080F96F0:
|
||||
ldr r1, =0x020375f0
|
||||
movs r0, 0x1
|
||||
strh r0, [r1]
|
||||
b _080F9718
|
||||
.pool
|
||||
_080F96FC:
|
||||
ldrb r0, [r4, 0x2]
|
||||
bl sub_80F95C0
|
||||
ldr r0, =gUnknown_085ECF5D
|
||||
bl box_related_two__2
|
||||
ldrh r0, [r4]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4]
|
||||
b _080F9722
|
||||
.pool
|
||||
_080F9714:
|
||||
ldr r0, =0x020375f0
|
||||
strh r1, [r0]
|
||||
_080F9718:
|
||||
bl script_env_2_enable_and_set_ctx_running
|
||||
adds r0, r6, 0
|
||||
bl DestroyTask
|
||||
_080F9722:
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80F9654
|
||||
|
||||
thumb_func_start sub_80F972C
|
||||
sub_80F972C: @ 80F972C
|
||||
push {lr}
|
||||
ldr r0, =sub_80F9654
|
||||
movs r1, 0x50
|
||||
bl CreateTask
|
||||
bl script_env_2_set_ctx_paused
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80F972C
|
||||
|
||||
thumb_func_start overworld_poison
|
||||
overworld_poison: @ 80F9744
|
||||
push {r4-r7,lr}
|
||||
sub sp, 0x4
|
||||
ldr r4, =0x020244ec
|
||||
movs r7, 0
|
||||
movs r6, 0
|
||||
movs r5, 0x5
|
||||
_080F9750:
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x5
|
||||
bl pokemon_getattr
|
||||
cmp r0, 0
|
||||
beq _080F9794
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x37
|
||||
bl pokemon_getattr
|
||||
bl pokemon_ailments_get_primary
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
bne _080F9794
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x39
|
||||
bl pokemon_getattr
|
||||
str r0, [sp]
|
||||
cmp r0, 0
|
||||
beq _080F9786
|
||||
subs r0, 0x1
|
||||
str r0, [sp]
|
||||
cmp r0, 0
|
||||
bne _080F9788
|
||||
_080F9786:
|
||||
adds r6, 0x1
|
||||
_080F9788:
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x39
|
||||
mov r2, sp
|
||||
bl pokemon_setattr
|
||||
adds r7, 0x1
|
||||
_080F9794:
|
||||
adds r4, 0x64
|
||||
subs r5, 0x1
|
||||
cmp r5, 0
|
||||
bge _080F9750
|
||||
cmp r6, 0
|
||||
bne _080F97A4
|
||||
cmp r7, 0
|
||||
beq _080F97A8
|
||||
_080F97A4:
|
||||
bl overworld_posion_effect
|
||||
_080F97A8:
|
||||
cmp r6, 0
|
||||
beq _080F97B4
|
||||
movs r0, 0x2
|
||||
b _080F97BE
|
||||
.pool
|
||||
_080F97B4:
|
||||
cmp r7, 0
|
||||
bne _080F97BC
|
||||
movs r0, 0
|
||||
b _080F97BE
|
||||
_080F97BC:
|
||||
movs r0, 0x1
|
||||
_080F97BE:
|
||||
add sp, 0x4
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end overworld_poison
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
2285
asm/fieldmap.s
Normal file
2285
asm/fieldmap.s
Normal file
File diff suppressed because it is too large
Load Diff
126
asm/flag.s
Normal file
126
asm/flag.s
Normal file
@ -0,0 +1,126 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start GetFlagPointer
|
||||
@ u8 *GetFlagPointer(u16 flagId)
|
||||
GetFlagPointer: @ 809D6EC
|
||||
push {lr}
|
||||
lsls r1, r0, 16
|
||||
lsrs r2, r1, 16
|
||||
adds r3, r2, 0
|
||||
cmp r2, 0
|
||||
bne _0809D6FC
|
||||
movs r0, 0
|
||||
b _0809D72E
|
||||
_0809D6FC:
|
||||
ldr r0, =0x00003fff
|
||||
cmp r2, r0
|
||||
bhi _0809D71C
|
||||
ldr r0, =0x03005d8c
|
||||
lsrs r1, 19
|
||||
ldr r2, =0x00001270
|
||||
adds r1, r2
|
||||
ldr r0, [r0]
|
||||
b _0809D72C
|
||||
.pool
|
||||
_0809D71C:
|
||||
ldr r1, =0xffffc000
|
||||
adds r0, r3, r1
|
||||
cmp r0, 0
|
||||
bge _0809D728
|
||||
ldr r2, =0xffffc007
|
||||
adds r0, r3, r2
|
||||
_0809D728:
|
||||
asrs r0, 3
|
||||
ldr r1, =0x020375fc
|
||||
_0809D72C:
|
||||
adds r0, r1
|
||||
_0809D72E:
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end GetFlagPointer
|
||||
|
||||
thumb_func_start FlagSet
|
||||
@ bool8 FlagSet(u16 flagId)
|
||||
FlagSet: @ 809D740
|
||||
push {r4,lr}
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
adds r0, r4, 0
|
||||
bl GetFlagPointer
|
||||
adds r2, r0, 0
|
||||
cmp r2, 0
|
||||
beq _0809D760
|
||||
movs r0, 0x7
|
||||
ands r0, r4
|
||||
movs r1, 0x1
|
||||
lsls r1, r0
|
||||
ldrb r0, [r2]
|
||||
orrs r1, r0
|
||||
strb r1, [r2]
|
||||
_0809D760:
|
||||
movs r0, 0
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end FlagSet
|
||||
|
||||
thumb_func_start FlagReset
|
||||
@ bool8 FlagReset(u16 flagId)
|
||||
FlagReset: @ 809D768
|
||||
push {r4,lr}
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
adds r0, r4, 0
|
||||
bl GetFlagPointer
|
||||
adds r2, r0, 0
|
||||
cmp r2, 0
|
||||
beq _0809D788
|
||||
movs r0, 0x7
|
||||
ands r0, r4
|
||||
movs r1, 0x1
|
||||
lsls r1, r0
|
||||
ldrb r0, [r2]
|
||||
bics r0, r1
|
||||
strb r0, [r2]
|
||||
_0809D788:
|
||||
movs r0, 0
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end FlagReset
|
||||
|
||||
thumb_func_start FlagGet
|
||||
@ bool8 FlagGet(u16 flagId)
|
||||
FlagGet: @ 809D790
|
||||
push {r4,lr}
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
adds r0, r4, 0
|
||||
bl GetFlagPointer
|
||||
cmp r0, 0
|
||||
beq _0809D7B4
|
||||
ldrb r0, [r0]
|
||||
movs r1, 0x7
|
||||
ands r1, r4
|
||||
asrs r0, r1
|
||||
movs r1, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _0809D7B4
|
||||
movs r0, 0x1
|
||||
b _0809D7B6
|
||||
_0809D7B4:
|
||||
movs r0, 0
|
||||
_0809D7B6:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end FlagGet
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
2514
asm/fldeff_80F9BCC.s
Normal file
2514
asm/fldeff_80F9BCC.s
Normal file
File diff suppressed because it is too large
Load Diff
328
asm/fldeff_emotion.s
Normal file
328
asm/fldeff_emotion.s
Normal file
@ -0,0 +1,328 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start oei_exclamation_mark
|
||||
oei_exclamation_mark: @ 80B4620
|
||||
push {lr}
|
||||
ldr r0, =gUnknown_085507B4
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
movs r3, 0x53
|
||||
bl AddObjectToBack
|
||||
lsls r0, 24
|
||||
lsrs r1, r0, 24
|
||||
cmp r1, 0x40
|
||||
beq _080B4648
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, =0x02020630
|
||||
adds r0, r1
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl sub_80B46D8
|
||||
_080B4648:
|
||||
movs r0, 0
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end oei_exclamation_mark
|
||||
|
||||
thumb_func_start sub_80B4658
|
||||
sub_80B4658: @ 80B4658
|
||||
push {lr}
|
||||
ldr r0, =gUnknown_085507B4
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
movs r3, 0x52
|
||||
bl AddObjectToBack
|
||||
lsls r0, 24
|
||||
lsrs r1, r0, 24
|
||||
cmp r1, 0x40
|
||||
beq _080B4680
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, =0x02020630
|
||||
adds r0, r1
|
||||
movs r1, 0x21
|
||||
movs r2, 0x1
|
||||
bl sub_80B46D8
|
||||
_080B4680:
|
||||
movs r0, 0
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_80B4658
|
||||
|
||||
thumb_func_start sub_80B4690
|
||||
sub_80B4690: @ 80B4690
|
||||
push {r4,lr}
|
||||
ldr r0, =gUnknown_085507CC
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
movs r3, 0x52
|
||||
bl AddObjectToBack
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x40
|
||||
beq _080B46C6
|
||||
lsls r4, r0, 4
|
||||
adds r4, r0
|
||||
lsls r4, 2
|
||||
ldr r0, =0x02020630
|
||||
adds r4, r0
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x2E
|
||||
movs r2, 0
|
||||
bl sub_80B46D8
|
||||
ldrb r1, [r4, 0x5]
|
||||
movs r0, 0xF
|
||||
ands r0, r1
|
||||
movs r1, 0x20
|
||||
orrs r0, r1
|
||||
strb r0, [r4, 0x5]
|
||||
_080B46C6:
|
||||
movs r0, 0
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_80B4690
|
||||
|
||||
thumb_func_start sub_80B46D8
|
||||
@ void sub_80B46D8(struct obj *object, s16 a2, u8 a3)
|
||||
sub_80B46D8: @ 80B46D8
|
||||
push {r4,lr}
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
ldrb r4, [r0, 0x5]
|
||||
movs r3, 0xD
|
||||
negs r3, r3
|
||||
ands r3, r4
|
||||
movs r4, 0x4
|
||||
orrs r3, r4
|
||||
strb r3, [r0, 0x5]
|
||||
movs r3, 0x3E
|
||||
adds r3, r0
|
||||
mov r12, r3
|
||||
ldrb r3, [r3]
|
||||
movs r4, 0x2
|
||||
orrs r3, r4
|
||||
mov r4, r12
|
||||
strb r3, [r4]
|
||||
ldr r4, =0x02038c08
|
||||
ldr r3, [r4]
|
||||
strh r3, [r0, 0x2E]
|
||||
ldr r3, [r4, 0x4]
|
||||
strh r3, [r0, 0x30]
|
||||
ldr r3, [r4, 0x8]
|
||||
strh r3, [r0, 0x32]
|
||||
ldr r3, =0x0000fffb
|
||||
strh r3, [r0, 0x34]
|
||||
strh r1, [r0, 0x3C]
|
||||
adds r1, r2, 0
|
||||
bl StartObjectImageAnim
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80B46D8
|
||||
|
||||
thumb_func_start objc_exclamation_mark_probably
|
||||
objc_exclamation_mark_probably: @ 80B4724
|
||||
push {r4,lr}
|
||||
sub sp, 0x4
|
||||
adds r4, r0, 0
|
||||
ldrh r0, [r4, 0x2E]
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldrh r1, [r4, 0x30]
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
ldrh r2, [r4, 0x32]
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
mov r3, sp
|
||||
bl TryGetFieldObjectIdByLocalIdAndMap
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _080B4756
|
||||
adds r0, r4, 0
|
||||
adds r0, 0x3F
|
||||
ldrb r1, [r0]
|
||||
movs r0, 0x10
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _080B4764
|
||||
_080B4756:
|
||||
ldrh r1, [r4, 0x3C]
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r4, 0
|
||||
bl FieldEffectStop
|
||||
b _080B47B2
|
||||
_080B4764:
|
||||
ldr r2, =0x02037350
|
||||
mov r0, sp
|
||||
ldrb r1, [r0]
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r2
|
||||
ldrb r0, [r0, 0x4]
|
||||
lsls r1, r0, 4
|
||||
adds r1, r0
|
||||
lsls r1, 2
|
||||
ldr r0, =0x02020630
|
||||
adds r1, r0
|
||||
ldrh r3, [r4, 0x34]
|
||||
ldrh r0, [r4, 0x36]
|
||||
adds r2, r3, r0
|
||||
strh r2, [r4, 0x36]
|
||||
ldrh r0, [r1, 0x20]
|
||||
strh r0, [r4, 0x20]
|
||||
ldrh r0, [r1, 0x22]
|
||||
subs r0, 0x10
|
||||
strh r0, [r4, 0x22]
|
||||
ldrh r0, [r1, 0x24]
|
||||
strh r0, [r4, 0x24]
|
||||
ldrh r0, [r1, 0x26]
|
||||
adds r0, r2
|
||||
strh r0, [r4, 0x26]
|
||||
lsls r2, 16
|
||||
asrs r2, 16
|
||||
cmp r2, 0
|
||||
beq _080B47B0
|
||||
adds r0, r3, 0x1
|
||||
strh r0, [r4, 0x34]
|
||||
b _080B47B2
|
||||
.pool
|
||||
_080B47B0:
|
||||
strh r2, [r4, 0x34]
|
||||
_080B47B2:
|
||||
add sp, 0x4
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end objc_exclamation_mark_probably
|
||||
|
||||
thumb_func_start sub_80B47BC
|
||||
sub_80B47BC: @ 80B47BC
|
||||
push {lr}
|
||||
ldr r0, =0x02038bfc
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0
|
||||
beq _080B47D4
|
||||
ldr r0, =0x03006090
|
||||
ldrb r0, [r0, 0xC]
|
||||
b _080B47D8
|
||||
.pool
|
||||
_080B47D4:
|
||||
ldr r0, =0x03006090
|
||||
ldrb r0, [r0]
|
||||
_080B47D8:
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_80B47BC
|
||||
|
||||
thumb_func_start sub_80B47E0
|
||||
sub_80B47E0: @ 80B47E0
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
bls _080B47EE
|
||||
movs r0, 0
|
||||
b _080B4800
|
||||
_080B47EE:
|
||||
cmp r0, 0
|
||||
beq _080B47FC
|
||||
ldr r0, =0x03006090
|
||||
ldrb r0, [r0, 0xC]
|
||||
b _080B4800
|
||||
.pool
|
||||
_080B47FC:
|
||||
ldr r0, =0x03006090
|
||||
ldrb r0, [r0]
|
||||
_080B4800:
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_80B47E0
|
||||
|
||||
thumb_func_start sub_80B4808
|
||||
sub_80B4808: @ 80B4808
|
||||
push {lr}
|
||||
ldr r0, =0x030060ac
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0x1
|
||||
bne _080B4870
|
||||
ldr r2, =0x03006090
|
||||
ldr r0, =0x03006080
|
||||
ldrh r1, [r0]
|
||||
lsls r0, r1, 1
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r2
|
||||
ldrb r1, [r0]
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, =0x02037350
|
||||
adds r0, r1
|
||||
ldrb r0, [r0, 0x18]
|
||||
lsls r0, 28
|
||||
lsrs r0, 28
|
||||
bl GetOppositeDirection
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
bl GetFaceDirectionAnimId
|
||||
ldr r3, =0x03006084
|
||||
strb r0, [r3]
|
||||
movs r0, 0xFE
|
||||
strb r0, [r3, 0x1]
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r0, [r0]
|
||||
ldrb r1, [r0, 0x5]
|
||||
ldrb r2, [r0, 0x4]
|
||||
movs r0, 0xFF
|
||||
bl exec_movement
|
||||
b _080B489E
|
||||
.pool
|
||||
_080B4870:
|
||||
ldr r0, =0x02037590
|
||||
ldrb r1, [r0, 0x5]
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, =0x02037350
|
||||
adds r0, r1
|
||||
ldrb r0, [r0, 0x18]
|
||||
lsls r0, 28
|
||||
lsrs r0, 28
|
||||
bl GetFaceDirectionAnimId
|
||||
ldr r3, =0x03006084
|
||||
strb r0, [r3]
|
||||
movs r0, 0xFE
|
||||
strb r0, [r3, 0x1]
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r0, [r0]
|
||||
ldrb r1, [r0, 0x5]
|
||||
ldrb r2, [r0, 0x4]
|
||||
movs r0, 0xFF
|
||||
bl exec_movement
|
||||
_080B489E:
|
||||
movs r0, 0xFF
|
||||
bl sub_809BE48
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80B4808
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
93
asm/fldeff_strength.s
Normal file
93
asm/fldeff_strength.s
Normal file
@ -0,0 +1,93 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start hm_prepare_rocksmash
|
||||
hm_prepare_rocksmash: @ 8145DC4
|
||||
push {r4,lr}
|
||||
movs r0, 0x57
|
||||
bl npc_before_player_of_type
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
beq _08145DD8
|
||||
movs r0, 0
|
||||
b _08145DF2
|
||||
_08145DD8:
|
||||
ldr r4, =0x020375f0
|
||||
bl brm_get_pokemon_selection
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r4]
|
||||
ldr r1, =0x03005db0
|
||||
ldr r0, =hm_add_c3_launch_phase_2
|
||||
str r0, [r1]
|
||||
ldr r1, =0x0203ceec
|
||||
ldr r0, =sub_8145E0C
|
||||
str r0, [r1]
|
||||
movs r0, 0x1
|
||||
_08145DF2:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end hm_prepare_rocksmash
|
||||
|
||||
thumb_func_start sub_8145E0C
|
||||
sub_8145E0C: @ 8145E0C
|
||||
push {lr}
|
||||
bl brm_get_pokemon_selection
|
||||
ldr r1, =0x02038c08
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
str r0, [r1]
|
||||
ldr r0, =gUnknown_082908FD
|
||||
bl script_env_1_execute_new_script
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8145E0C
|
||||
|
||||
thumb_func_start sub_8145E2C
|
||||
sub_8145E2C: @ 8145E2C
|
||||
push {lr}
|
||||
bl oei_task_add
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r2, =0x03005e00
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
adds r1, r2
|
||||
ldr r2, =sub_8145E74
|
||||
lsrs r0, r2, 16
|
||||
strh r0, [r1, 0x18]
|
||||
strh r2, [r1, 0x1A]
|
||||
ldr r0, =0x02038c08
|
||||
ldr r1, [r0]
|
||||
movs r0, 0x64
|
||||
muls r0, r1
|
||||
ldr r1, =0x020244ec
|
||||
adds r0, r1
|
||||
ldr r1, =0x02021cc4
|
||||
bl GetMonNickname
|
||||
movs r0, 0
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_8145E2C
|
||||
|
||||
thumb_func_start sub_8145E74
|
||||
sub_8145E74: @ 8145E74
|
||||
push {lr}
|
||||
movs r0, 0x28
|
||||
bl FieldEffectActiveListRemove
|
||||
bl script_env_2_enable_and_set_ctx_running
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_8145E74
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
11688
asm/front_pic_anim.s
Normal file
11688
asm/front_pic_anim.s
Normal file
File diff suppressed because it is too large
Load Diff
83
asm/heal_location.s
Normal file
83
asm/heal_location.s
Normal file
@ -0,0 +1,83 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_8122C5C
|
||||
sub_8122C5C: @ 8122C5C
|
||||
push {r4,lr}
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
movs r3, 0
|
||||
ldr r2, =gUnknown_0859F53C
|
||||
_08122C6A:
|
||||
movs r0, 0
|
||||
ldrsb r0, [r2, r0]
|
||||
cmp r0, r4
|
||||
bne _08122C84
|
||||
movs r0, 0x1
|
||||
ldrsb r0, [r2, r0]
|
||||
cmp r0, r1
|
||||
bne _08122C84
|
||||
adds r0, r3, 0x1
|
||||
b _08122C8E
|
||||
.pool
|
||||
_08122C84:
|
||||
adds r2, 0x8
|
||||
adds r3, 0x1
|
||||
cmp r3, 0x15
|
||||
bls _08122C6A
|
||||
movs r0, 0
|
||||
_08122C8E:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8122C5C
|
||||
|
||||
thumb_func_start sub_8122C94
|
||||
sub_8122C94: @ 8122C94
|
||||
push {lr}
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
bl sub_8122C5C
|
||||
cmp r0, 0
|
||||
beq _08122CB4
|
||||
lsls r0, 3
|
||||
ldr r1, =gUnknown_0859F534
|
||||
adds r0, r1
|
||||
b _08122CB6
|
||||
.pool
|
||||
_08122CB4:
|
||||
movs r0, 0
|
||||
_08122CB6:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8122C94
|
||||
|
||||
thumb_func_start sub_8122CBC
|
||||
@ warpdata *sub_8122CBC(int a1)
|
||||
sub_8122CBC: @ 8122CBC
|
||||
push {lr}
|
||||
cmp r0, 0
|
||||
beq _08122CD4
|
||||
cmp r0, 0x16
|
||||
bhi _08122CD4
|
||||
lsls r0, 3
|
||||
ldr r1, =gUnknown_0859F534
|
||||
adds r0, r1
|
||||
b _08122CD6
|
||||
.pool
|
||||
_08122CD4:
|
||||
movs r0, 0
|
||||
_08122CD6:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8122CBC
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
4490
asm/intro.s
Normal file
4490
asm/intro.s
Normal file
File diff suppressed because it is too large
Load Diff
2299
asm/item.s
Normal file
2299
asm/item.s
Normal file
File diff suppressed because it is too large
Load Diff
2863
asm/item_use.s
Normal file
2863
asm/item_use.s
Normal file
File diff suppressed because it is too large
Load Diff
128
asm/landmark.s
Normal file
128
asm/landmark.s
Normal file
@ -0,0 +1,128 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_8145CF4
|
||||
sub_8145CF4: @ 8145CF4
|
||||
push {r4-r6,lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
lsls r2, 24
|
||||
lsrs r5, r2, 24
|
||||
bl sub_8145D48
|
||||
adds r4, r0, 0
|
||||
cmp r4, 0
|
||||
bne _08145D10
|
||||
_08145D0C:
|
||||
movs r0, 0
|
||||
b _08145D42
|
||||
_08145D10:
|
||||
ldr r6, =0x0000ffff
|
||||
b _08145D26
|
||||
.pool
|
||||
_08145D18:
|
||||
subs r0, r5, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
_08145D1E:
|
||||
adds r4, 0x4
|
||||
ldr r0, [r4]
|
||||
cmp r0, 0
|
||||
beq _08145D0C
|
||||
_08145D26:
|
||||
ldr r1, [r4]
|
||||
ldrh r0, [r1, 0x4]
|
||||
cmp r0, r6
|
||||
beq _08145D3A
|
||||
bl FlagGet
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
bne _08145D1E
|
||||
_08145D3A:
|
||||
cmp r5, 0
|
||||
bne _08145D18
|
||||
ldr r0, [r4]
|
||||
ldr r0, [r0]
|
||||
_08145D42:
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8145CF4
|
||||
|
||||
thumb_func_start sub_8145D48
|
||||
sub_8145D48: @ 8145D48
|
||||
push {r4-r6,lr}
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
lsls r1, 24
|
||||
lsrs r6, r1, 24
|
||||
movs r2, 0
|
||||
ldr r0, =gUnknown_085B91B8
|
||||
ldrb r1, [r0]
|
||||
adds r4, r0, 0
|
||||
cmp r1, 0xD5
|
||||
beq _08145DB8
|
||||
adds r1, r4, 0
|
||||
_08145D60:
|
||||
lsls r0, r2, 3
|
||||
adds r0, r1
|
||||
ldrb r0, [r0]
|
||||
cmp r0, r3
|
||||
bhi _08145DB8
|
||||
cmp r0, r3
|
||||
beq _08145D7E
|
||||
adds r0, r2, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r2, r0, 16
|
||||
lsls r0, r2, 3
|
||||
adds r0, r1
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0xD5
|
||||
bne _08145D60
|
||||
_08145D7E:
|
||||
lsls r0, r2, 3
|
||||
adds r0, r1
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0xD5
|
||||
bne _08145D98
|
||||
b _08145DB8
|
||||
.pool
|
||||
_08145D90:
|
||||
adds r0, r4, 0x4
|
||||
adds r0, r1, r0
|
||||
ldr r0, [r0]
|
||||
b _08145DBA
|
||||
_08145D98:
|
||||
cmp r0, r3
|
||||
bne _08145DB8
|
||||
ldr r5, =gUnknown_085B91B8
|
||||
_08145D9E:
|
||||
lsls r1, r2, 3
|
||||
adds r0, r1, r5
|
||||
ldrb r0, [r0, 0x1]
|
||||
cmp r0, r6
|
||||
beq _08145D90
|
||||
adds r0, r2, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r2, r0, 16
|
||||
lsls r0, r2, 3
|
||||
adds r0, r4
|
||||
ldrb r0, [r0]
|
||||
cmp r0, r3
|
||||
beq _08145D9E
|
||||
_08145DB8:
|
||||
movs r0, 0
|
||||
_08145DBA:
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_8145D48
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
757
asm/load_save.s
Normal file
757
asm/load_save.s
Normal file
@ -0,0 +1,757 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start CheckForFlashMemory
|
||||
@ void CheckForFlashMemory()
|
||||
CheckForFlashMemory: @ 8076B68
|
||||
push {lr}
|
||||
bl IdentifyFlash
|
||||
lsls r0, 16
|
||||
cmp r0, 0
|
||||
bne _08076B84
|
||||
ldr r1, =0x03005d88
|
||||
movs r0, 0x1
|
||||
str r0, [r1]
|
||||
bl StartFlashMemoryTimer
|
||||
b _08076B8A
|
||||
.pool
|
||||
_08076B84:
|
||||
ldr r1, =0x03005d88
|
||||
movs r0, 0
|
||||
str r0, [r1]
|
||||
_08076B8A:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end CheckForFlashMemory
|
||||
|
||||
thumb_func_start memclr_stdsav2
|
||||
memclr_stdsav2: @ 8076B94
|
||||
push {lr}
|
||||
sub sp, 0x4
|
||||
mov r1, sp
|
||||
movs r0, 0
|
||||
strh r0, [r1]
|
||||
ldr r1, =0x02024a54
|
||||
ldr r2, =0x010007d6
|
||||
mov r0, sp
|
||||
bl CpuSet
|
||||
add sp, 0x4
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end memclr_stdsav2
|
||||
|
||||
thumb_func_start clear_sav1
|
||||
clear_sav1: @ 8076BB8
|
||||
push {lr}
|
||||
sub sp, 0x4
|
||||
mov r1, sp
|
||||
movs r0, 0
|
||||
strh r0, [r1]
|
||||
ldr r1, =0x02025a00
|
||||
ldr r2, =0x01001f04
|
||||
mov r0, sp
|
||||
bl CpuSet
|
||||
add sp, 0x4
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end clear_sav1
|
||||
|
||||
thumb_func_start InitSaveBlockPointersWithRandomOffset
|
||||
@ void InitSaveBlockPointersWithRandomOffset(u8 offset)
|
||||
InitSaveBlockPointersWithRandomOffset: @ 8076BDC
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
ldr r5, =0x03005d8c
|
||||
bl GenerateRandomNumber
|
||||
adds r4, r0
|
||||
movs r0, 0x7C
|
||||
ands r4, r0
|
||||
ldr r1, =0x03005d90
|
||||
ldr r0, =0x02024a54
|
||||
adds r0, r4, r0
|
||||
str r0, [r1]
|
||||
ldr r0, =0x02025a00
|
||||
adds r0, r4, r0
|
||||
str r0, [r5]
|
||||
ldr r1, =0x03005d94
|
||||
ldr r0, =0x02029808
|
||||
adds r4, r0
|
||||
str r4, [r1]
|
||||
bl init_bag_pockets
|
||||
bl sub_81617F4
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end InitSaveBlockPointersWithRandomOffset
|
||||
|
||||
thumb_func_start saveblock_randomize_and_relocate
|
||||
saveblock_randomize_and_relocate: @ 8076C2C
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x8
|
||||
ldr r5, =0x030022c0
|
||||
ldr r0, [r5, 0xC]
|
||||
str r0, [sp]
|
||||
ldr r1, [r5, 0x10]
|
||||
str r1, [sp, 0x4]
|
||||
movs r0, 0
|
||||
str r0, [r5, 0xC]
|
||||
str r0, [r5, 0x10]
|
||||
ldr r1, =0x0203cf5c
|
||||
str r0, [r1]
|
||||
ldr r4, =0x02000000
|
||||
ldr r0, =0x03005d90
|
||||
ldr r1, [r0]
|
||||
ldr r6, =0x00000f2c
|
||||
adds r0, r4, 0
|
||||
adds r2, r6, 0
|
||||
bl memcpy
|
||||
ldr r1, =0x03005d8c
|
||||
mov r10, r1
|
||||
ldr r1, [r1]
|
||||
ldr r7, =0x00003d88
|
||||
ldr r0, =0x02000f2c
|
||||
adds r2, r7, 0
|
||||
bl memcpy
|
||||
ldr r0, =0x03005d94
|
||||
mov r8, r0
|
||||
ldr r1, [r0]
|
||||
ldr r0, =0x000083d0
|
||||
mov r9, r0
|
||||
ldr r0, =0x02004cb4
|
||||
mov r2, r9
|
||||
bl memcpy
|
||||
ldrb r1, [r4, 0xA]
|
||||
ldrb r0, [r4, 0xB]
|
||||
adds r1, r0
|
||||
ldrb r0, [r4, 0xC]
|
||||
adds r1, r0
|
||||
ldrb r0, [r4, 0xD]
|
||||
adds r0, r1
|
||||
bl InitSaveBlockPointersWithRandomOffset
|
||||
ldr r1, =0x03005d90
|
||||
ldr r0, [r1]
|
||||
adds r1, r4, 0
|
||||
adds r2, r6, 0
|
||||
bl memcpy
|
||||
mov r1, r10
|
||||
ldr r0, [r1]
|
||||
ldr r1, =0x02000f2c
|
||||
adds r2, r7, 0
|
||||
bl memcpy
|
||||
mov r1, r8
|
||||
ldr r0, [r1]
|
||||
ldr r1, =0x02004cb4
|
||||
mov r2, r9
|
||||
bl memcpy
|
||||
movs r1, 0xE0
|
||||
lsls r1, 9
|
||||
adds r0, r4, 0
|
||||
bl InitHeap
|
||||
ldr r0, [sp, 0x4]
|
||||
str r0, [r5, 0x10]
|
||||
ldr r1, [sp]
|
||||
str r1, [r5, 0xC]
|
||||
bl GenerateRandomNumber
|
||||
adds r4, r0, 0
|
||||
bl GenerateRandomNumber
|
||||
lsls r4, 16
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
adds r4, r0
|
||||
adds r0, r4, 0
|
||||
bl saveblock_apply_crypto
|
||||
ldr r1, =0x03005d90
|
||||
ldr r0, [r1]
|
||||
adds r0, 0xAC
|
||||
str r4, [r0]
|
||||
add sp, 0x8
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end saveblock_randomize_and_relocate
|
||||
|
||||
thumb_func_start sav2_x1_query_bit1
|
||||
sav2_x1_query_bit1: @ 8076D24
|
||||
ldr r0, =0x03005d90
|
||||
ldr r0, [r0]
|
||||
ldrb r1, [r0, 0x9]
|
||||
movs r0, 0x1
|
||||
ands r0, r1
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sav2_x1_query_bit1
|
||||
|
||||
thumb_func_start sav2_x9_clear_bit1
|
||||
sav2_x9_clear_bit1: @ 8076D34
|
||||
ldr r0, =0x03005d90
|
||||
ldr r2, [r0]
|
||||
ldrb r1, [r2, 0x9]
|
||||
movs r0, 0xFE
|
||||
ands r0, r1
|
||||
strb r0, [r2, 0x9]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sav2_x9_clear_bit1
|
||||
|
||||
thumb_func_start sub_8076D48
|
||||
sub_8076D48: @ 8076D48
|
||||
ldr r0, =0x03005d90
|
||||
ldr r2, [r0]
|
||||
ldrb r1, [r2, 0x9]
|
||||
movs r0, 0x1
|
||||
orrs r0, r1
|
||||
strb r0, [r2, 0x9]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sub_8076D48
|
||||
|
||||
thumb_func_start sub_8076D5C
|
||||
sub_8076D5C: @ 8076D5C
|
||||
push {lr}
|
||||
movs r0, 0
|
||||
bl sub_8084FAC
|
||||
ldr r0, =0x03005d90
|
||||
ldr r2, [r0]
|
||||
ldrb r1, [r2, 0x9]
|
||||
movs r0, 0x1
|
||||
orrs r0, r1
|
||||
strb r0, [r2, 0x9]
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8076D5C
|
||||
|
||||
thumb_func_start sav2_gender2_inplace_and_xFE
|
||||
sav2_gender2_inplace_and_xFE: @ 8076D78
|
||||
ldr r0, =0x03005d90
|
||||
ldr r2, [r0]
|
||||
ldrb r1, [r2, 0x9]
|
||||
movs r0, 0xFE
|
||||
ands r0, r1
|
||||
strb r0, [r2, 0x9]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sav2_gender2_inplace_and_xFE
|
||||
|
||||
thumb_func_start copy_player_party_to_sav1
|
||||
@ void copy_player_party_to_sav1()
|
||||
copy_player_party_to_sav1: @ 8076D8C
|
||||
push {r4,lr}
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x020244e9
|
||||
ldrb r1, [r1]
|
||||
movs r2, 0x8D
|
||||
lsls r2, 2
|
||||
adds r0, r2
|
||||
strb r1, [r0]
|
||||
movs r4, 0
|
||||
_08076DA0:
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r0, [r0]
|
||||
movs r1, 0x64
|
||||
muls r1, r4
|
||||
adds r0, r1
|
||||
movs r2, 0x8E
|
||||
lsls r2, 2
|
||||
adds r0, r2
|
||||
ldr r2, =0x020244ec
|
||||
adds r1, r2
|
||||
movs r2, 0x64
|
||||
bl memcpy
|
||||
adds r4, 0x1
|
||||
cmp r4, 0x5
|
||||
ble _08076DA0
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end copy_player_party_to_sav1
|
||||
|
||||
thumb_func_start copy_player_party_from_sav1
|
||||
copy_player_party_from_sav1: @ 8076DD4
|
||||
push {r4,r5,lr}
|
||||
ldr r1, =0x020244e9
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r0, [r0]
|
||||
movs r2, 0x8D
|
||||
lsls r2, 2
|
||||
adds r0, r2
|
||||
ldrb r0, [r0]
|
||||
strb r0, [r1]
|
||||
movs r4, 0
|
||||
ldr r5, =0x020244ec
|
||||
_08076DEA:
|
||||
movs r0, 0x64
|
||||
adds r2, r4, 0
|
||||
muls r2, r0
|
||||
adds r0, r2, r5
|
||||
ldr r1, =0x03005d8c
|
||||
ldr r1, [r1]
|
||||
adds r1, r2
|
||||
movs r2, 0x8E
|
||||
lsls r2, 2
|
||||
adds r1, r2
|
||||
movs r2, 0x64
|
||||
bl memcpy
|
||||
adds r4, 0x1
|
||||
cmp r4, 0x5
|
||||
ble _08076DEA
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end copy_player_party_from_sav1
|
||||
|
||||
thumb_func_start save_serialize_npcs
|
||||
save_serialize_npcs: @ 8076E1C
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
ldr r0, =0x03005d8c
|
||||
mov r12, r0
|
||||
movs r5, 0xA3
|
||||
lsls r5, 4
|
||||
mov r8, r5
|
||||
ldr r4, =0x02037350
|
||||
movs r3, 0
|
||||
movs r2, 0xF
|
||||
_08076E32:
|
||||
mov r6, r12
|
||||
ldr r1, [r6]
|
||||
adds r1, r3
|
||||
add r1, r8
|
||||
adds r0, r4, 0
|
||||
ldm r0!, {r5-r7}
|
||||
stm r1!, {r5-r7}
|
||||
ldm r0!, {r5-r7}
|
||||
stm r1!, {r5-r7}
|
||||
ldm r0!, {r5-r7}
|
||||
stm r1!, {r5-r7}
|
||||
adds r4, 0x24
|
||||
adds r3, 0x24
|
||||
subs r2, 0x1
|
||||
cmp r2, 0
|
||||
bge _08076E32
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end save_serialize_npcs
|
||||
|
||||
thumb_func_start save_deserialize_npcs
|
||||
save_deserialize_npcs: @ 8076E64
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
ldr r0, =0x03005d8c
|
||||
mov r12, r0
|
||||
movs r5, 0xA3
|
||||
lsls r5, 4
|
||||
mov r8, r5
|
||||
ldr r4, =0x02037350
|
||||
movs r3, 0
|
||||
movs r2, 0xF
|
||||
_08076E7A:
|
||||
mov r6, r12
|
||||
ldr r1, [r6]
|
||||
adds r1, r3
|
||||
adds r0, r4, 0
|
||||
add r1, r8
|
||||
ldm r1!, {r5-r7}
|
||||
stm r0!, {r5-r7}
|
||||
ldm r1!, {r5-r7}
|
||||
stm r0!, {r5-r7}
|
||||
ldm r1!, {r5-r7}
|
||||
stm r0!, {r5-r7}
|
||||
adds r4, 0x24
|
||||
adds r3, 0x24
|
||||
subs r2, 0x1
|
||||
cmp r2, 0
|
||||
bge _08076E7A
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end save_deserialize_npcs
|
||||
|
||||
thumb_func_start save_serialize_game
|
||||
save_serialize_game: @ 8076EAC
|
||||
push {lr}
|
||||
bl copy_player_party_to_sav1
|
||||
bl save_serialize_npcs
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end save_serialize_game
|
||||
|
||||
thumb_func_start save_deserialize_game
|
||||
save_deserialize_game: @ 8076EBC
|
||||
push {lr}
|
||||
bl copy_player_party_from_sav1
|
||||
bl save_deserialize_npcs
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end save_deserialize_game
|
||||
|
||||
thumb_func_start copy_bags_and_unk_data_from_save_blocks
|
||||
copy_bags_and_unk_data_from_save_blocks: @ 8076ECC
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
movs r2, 0
|
||||
ldr r0, =0x02032180
|
||||
mov r12, r0
|
||||
ldr r1, =0x03005d90
|
||||
mov r10, r1
|
||||
ldr r5, =0x03005d8c
|
||||
movs r3, 0xAC
|
||||
lsls r3, 3
|
||||
ldr r4, =0x02031c58
|
||||
_08076EE8:
|
||||
lsls r0, r2, 2
|
||||
ldr r1, [r5]
|
||||
adds r1, r3
|
||||
adds r1, r0
|
||||
ldr r0, [r1]
|
||||
stm r4!, {r0}
|
||||
adds r2, 0x1
|
||||
cmp r2, 0x1D
|
||||
ble _08076EE8
|
||||
movs r2, 0
|
||||
ldr r0, =0x02031c58
|
||||
ldr r5, =0x03005d8c
|
||||
movs r3, 0xBB
|
||||
lsls r3, 3
|
||||
adds r4, r0, 0
|
||||
adds r4, 0x78
|
||||
_08076F08:
|
||||
lsls r0, r2, 2
|
||||
ldr r1, [r5]
|
||||
adds r1, r3
|
||||
adds r1, r0
|
||||
ldr r0, [r1]
|
||||
stm r4!, {r0}
|
||||
adds r2, 0x1
|
||||
cmp r2, 0x1D
|
||||
ble _08076F08
|
||||
movs r2, 0
|
||||
ldr r0, =0x02031c58
|
||||
ldr r5, =0x03005d8c
|
||||
movs r3, 0xCA
|
||||
lsls r3, 3
|
||||
adds r4, r0, 0
|
||||
adds r4, 0xF0
|
||||
_08076F28:
|
||||
lsls r0, r2, 2
|
||||
ldr r1, [r5]
|
||||
adds r1, r3
|
||||
adds r1, r0
|
||||
ldr r0, [r1]
|
||||
stm r4!, {r0}
|
||||
adds r2, 0x1
|
||||
cmp r2, 0xF
|
||||
ble _08076F28
|
||||
movs r2, 0
|
||||
ldr r0, =0x02031c58
|
||||
ldr r5, =0x03005d8c
|
||||
movs r6, 0x98
|
||||
lsls r6, 1
|
||||
adds r4, r0, r6
|
||||
movs r3, 0xD2
|
||||
lsls r3, 3
|
||||
_08076F4A:
|
||||
lsls r0, r2, 2
|
||||
ldr r1, [r5]
|
||||
adds r1, r3
|
||||
adds r1, r0
|
||||
ldr r0, [r1]
|
||||
stm r4!, {r0}
|
||||
adds r2, 0x1
|
||||
cmp r2, 0x3F
|
||||
ble _08076F4A
|
||||
movs r2, 0
|
||||
ldr r0, =0x02031c58
|
||||
ldr r5, =0x03005d8c
|
||||
movs r7, 0x8C
|
||||
lsls r7, 2
|
||||
adds r4, r0, r7
|
||||
movs r3, 0xF2
|
||||
lsls r3, 3
|
||||
_08076F6C:
|
||||
lsls r0, r2, 2
|
||||
ldr r1, [r5]
|
||||
adds r1, r3
|
||||
adds r1, r0
|
||||
ldr r0, [r1]
|
||||
stm r4!, {r0}
|
||||
adds r2, 0x1
|
||||
cmp r2, 0x2D
|
||||
ble _08076F6C
|
||||
ldr r0, =0x02031c58
|
||||
ldr r1, =0x03005d8c
|
||||
mov r8, r1
|
||||
movs r5, 0xBA
|
||||
lsls r5, 2
|
||||
adds r4, r0, r5
|
||||
movs r3, 0
|
||||
ldr r6, =0x00002be0
|
||||
mov r9, r6
|
||||
movs r2, 0xF
|
||||
_08076F92:
|
||||
mov r7, r8
|
||||
ldr r1, [r7]
|
||||
adds r1, r3
|
||||
adds r0, r4, 0
|
||||
add r1, r9
|
||||
ldm r1!, {r5-r7}
|
||||
stm r0!, {r5-r7}
|
||||
ldm r1!, {r5-r7}
|
||||
stm r0!, {r5-r7}
|
||||
ldm r1!, {r5-r7}
|
||||
stm r0!, {r5-r7}
|
||||
adds r4, 0x24
|
||||
adds r3, 0x24
|
||||
subs r2, 0x1
|
||||
cmp r2, 0
|
||||
bge _08076F92
|
||||
mov r1, r10
|
||||
ldr r0, [r1]
|
||||
adds r0, 0xAC
|
||||
ldr r0, [r0]
|
||||
mov r5, r12
|
||||
str r0, [r5]
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end copy_bags_and_unk_data_from_save_blocks
|
||||
|
||||
thumb_func_start copy_bags_and_unk_data_to_save_blocks
|
||||
copy_bags_and_unk_data_to_save_blocks: @ 8076FE0
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
movs r2, 0
|
||||
ldr r0, =0x03005d90
|
||||
mov r8, r0
|
||||
ldr r1, =0x02032180
|
||||
mov r12, r1
|
||||
ldr r5, =0x03005d8c
|
||||
movs r3, 0xAC
|
||||
lsls r3, 3
|
||||
ldr r4, =0x02031c58
|
||||
_08076FFC:
|
||||
ldr r0, [r5]
|
||||
lsls r1, r2, 2
|
||||
adds r0, r3
|
||||
adds r0, r1
|
||||
ldm r4!, {r1}
|
||||
str r1, [r0]
|
||||
adds r2, 0x1
|
||||
cmp r2, 0x1D
|
||||
ble _08076FFC
|
||||
movs r2, 0
|
||||
ldr r5, =0x03005d8c
|
||||
movs r4, 0xBB
|
||||
lsls r4, 3
|
||||
ldr r0, =0x02031c58
|
||||
adds r3, r0, 0
|
||||
adds r3, 0x78
|
||||
_0807701C:
|
||||
ldr r0, [r5]
|
||||
lsls r1, r2, 2
|
||||
adds r0, r4
|
||||
adds r0, r1
|
||||
ldm r3!, {r1}
|
||||
str r1, [r0]
|
||||
adds r2, 0x1
|
||||
cmp r2, 0x1D
|
||||
ble _0807701C
|
||||
movs r2, 0
|
||||
ldr r5, =0x03005d8c
|
||||
movs r4, 0xCA
|
||||
lsls r4, 3
|
||||
ldr r0, =0x02031c58
|
||||
adds r3, r0, 0
|
||||
adds r3, 0xF0
|
||||
_0807703C:
|
||||
ldr r0, [r5]
|
||||
lsls r1, r2, 2
|
||||
adds r0, r4
|
||||
adds r0, r1
|
||||
ldm r3!, {r1}
|
||||
str r1, [r0]
|
||||
adds r2, 0x1
|
||||
cmp r2, 0xF
|
||||
ble _0807703C
|
||||
movs r2, 0
|
||||
ldr r5, =0x03005d8c
|
||||
movs r4, 0xD2
|
||||
lsls r4, 3
|
||||
ldr r0, =0x02031c58
|
||||
movs r6, 0x98
|
||||
lsls r6, 1
|
||||
adds r3, r0, r6
|
||||
_0807705E:
|
||||
ldr r0, [r5]
|
||||
lsls r1, r2, 2
|
||||
adds r0, r4
|
||||
adds r0, r1
|
||||
ldm r3!, {r1}
|
||||
str r1, [r0]
|
||||
adds r2, 0x1
|
||||
cmp r2, 0x3F
|
||||
ble _0807705E
|
||||
movs r2, 0
|
||||
ldr r5, =0x03005d8c
|
||||
movs r4, 0xF2
|
||||
lsls r4, 3
|
||||
ldr r0, =0x02031c58
|
||||
movs r7, 0x8C
|
||||
lsls r7, 2
|
||||
adds r3, r0, r7
|
||||
_08077080:
|
||||
ldr r0, [r5]
|
||||
lsls r1, r2, 2
|
||||
adds r0, r4
|
||||
adds r0, r1
|
||||
ldm r3!, {r1}
|
||||
str r1, [r0]
|
||||
adds r2, 0x1
|
||||
cmp r2, 0x2D
|
||||
ble _08077080
|
||||
ldr r0, =0x03005d8c
|
||||
mov r9, r0
|
||||
ldr r1, =0x00002be0
|
||||
mov r10, r1
|
||||
ldr r4, =0x02031c58
|
||||
movs r3, 0
|
||||
movs r2, 0xF
|
||||
_080770A0:
|
||||
mov r5, r9
|
||||
ldr r1, [r5]
|
||||
adds r1, r3
|
||||
add r1, r10
|
||||
movs r6, 0xBA
|
||||
lsls r6, 2
|
||||
adds r0, r4, r6
|
||||
ldm r0!, {r5-r7}
|
||||
stm r1!, {r5-r7}
|
||||
ldm r0!, {r5-r7}
|
||||
stm r1!, {r5-r7}
|
||||
ldm r0!, {r5-r7}
|
||||
stm r1!, {r5-r7}
|
||||
adds r4, 0x24
|
||||
adds r3, 0x24
|
||||
subs r2, 0x1
|
||||
cmp r2, 0
|
||||
bge _080770A0
|
||||
mov r7, r8
|
||||
ldr r0, [r7]
|
||||
adds r0, 0xAC
|
||||
ldr r4, [r0]
|
||||
mov r2, r12
|
||||
ldr r1, [r2]
|
||||
str r1, [r0]
|
||||
adds r0, r4, 0
|
||||
bl encrypt_decrypt_all_item_quantities
|
||||
ldr r0, [r7]
|
||||
adds r0, 0xAC
|
||||
str r4, [r0]
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end copy_bags_and_unk_data_to_save_blocks
|
||||
|
||||
thumb_func_start apply_u16_xor_crypto
|
||||
apply_u16_xor_crypto: @ 8077100
|
||||
ldr r2, =0x03005d90
|
||||
ldr r2, [r2]
|
||||
adds r2, 0xAC
|
||||
ldr r2, [r2]
|
||||
ldrh r3, [r0]
|
||||
eors r2, r3
|
||||
eors r2, r1
|
||||
strh r2, [r0]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end apply_u16_xor_crypto
|
||||
|
||||
thumb_func_start apply_u32_xor_crypto
|
||||
apply_u32_xor_crypto: @ 8077118
|
||||
ldr r2, =0x03005d90
|
||||
ldr r3, [r2]
|
||||
adds r3, 0xAC
|
||||
ldr r2, [r0]
|
||||
ldr r3, [r3]
|
||||
eors r2, r3
|
||||
eors r2, r1
|
||||
str r2, [r0]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end apply_u32_xor_crypto
|
||||
|
||||
thumb_func_start saveblock_apply_crypto
|
||||
saveblock_apply_crypto: @ 8077130
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
bl sub_8084864
|
||||
adds r0, r4, 0
|
||||
bl call_encrypt_decrypt_all_item_quantities
|
||||
adds r0, r4, 0
|
||||
bl sub_8024690
|
||||
ldr r5, =0x03005d8c
|
||||
ldr r0, [r5]
|
||||
movs r1, 0x92
|
||||
lsls r1, 3
|
||||
adds r0, r1
|
||||
adds r1, r4, 0
|
||||
bl apply_u32_xor_crypto
|
||||
ldr r0, [r5]
|
||||
ldr r1, =0x00000494
|
||||
adds r0, r1
|
||||
adds r1, r4, 0
|
||||
bl apply_u16_xor_crypto
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end saveblock_apply_crypto
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
381
asm/lottery_corner.s
Normal file
381
asm/lottery_corner.s
Normal file
@ -0,0 +1,381 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_8177558
|
||||
sub_8177558: @ 8177558
|
||||
push {r4,lr}
|
||||
bl GenerateRandomNumber
|
||||
adds r4, r0, 0
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
bl GenerateRandomNumber
|
||||
lsls r0, 16
|
||||
orrs r0, r4
|
||||
bl sub_8177814
|
||||
ldr r0, =0x00004045
|
||||
movs r1, 0
|
||||
bl VarSet
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8177558
|
||||
|
||||
thumb_func_start sub_8177584
|
||||
sub_8177584: @ 8177584
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
bl GenerateRandomNumber
|
||||
lsls r0, 16
|
||||
lsrs r1, r0, 16
|
||||
subs r0, r4, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
ldr r0, =0x0000ffff
|
||||
cmp r4, r0
|
||||
beq _081775B4
|
||||
ldr r5, =0x41c64e6d
|
||||
ldr r3, =0x00003039
|
||||
adds r2, r0, 0
|
||||
_081775A4:
|
||||
adds r0, r1, 0
|
||||
muls r0, r5
|
||||
adds r1, r0, r3
|
||||
subs r0, r4, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
cmp r4, r2
|
||||
bne _081775A4
|
||||
_081775B4:
|
||||
adds r0, r1, 0
|
||||
bl sub_8177814
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8177584
|
||||
|
||||
thumb_func_start sub_81775CC
|
||||
sub_81775CC: @ 81775CC
|
||||
push {lr}
|
||||
bl sub_817783C
|
||||
ldr r1, =0x020375f0
|
||||
strh r0, [r1]
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81775CC
|
||||
|
||||
thumb_func_start sub_81775E0
|
||||
sub_81775E0: @ 81775E0
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x8
|
||||
ldr r1, =0x020375e0
|
||||
movs r0, 0
|
||||
strh r0, [r1]
|
||||
movs r0, 0
|
||||
str r0, [sp, 0x4]
|
||||
movs r1, 0
|
||||
str r1, [sp]
|
||||
movs r7, 0
|
||||
_081775FC:
|
||||
movs r0, 0x64
|
||||
adds r1, r7, 0
|
||||
muls r1, r0
|
||||
ldr r0, =0x020244ec
|
||||
adds r4, r1, r0
|
||||
adds r0, r4, 0
|
||||
movs r1, 0xB
|
||||
bl pokemon_getattr
|
||||
cmp r0, 0
|
||||
beq _08177658
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x2D
|
||||
bl pokemon_getattr
|
||||
cmp r0, 0
|
||||
bne _0817764E
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x1
|
||||
bl pokemon_getattr
|
||||
adds r1, r0, 0
|
||||
ldr r0, =0x020375f0
|
||||
ldrh r0, [r0]
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
bl sub_817778C
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r1, =0x020375e0
|
||||
ldrh r2, [r1]
|
||||
cmp r0, r2
|
||||
bls _0817764E
|
||||
cmp r0, 0x1
|
||||
bls _0817764E
|
||||
subs r0, 0x1
|
||||
strh r0, [r1]
|
||||
movs r0, 0xE
|
||||
str r0, [sp]
|
||||
str r7, [sp, 0x4]
|
||||
_0817764E:
|
||||
adds r0, r7, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r7, r0, 16
|
||||
cmp r7, 0x5
|
||||
bls _081775FC
|
||||
_08177658:
|
||||
movs r7, 0
|
||||
ldr r1, =0x03005d94
|
||||
mov r9, r1
|
||||
_0817765E:
|
||||
movs r6, 0
|
||||
adds r2, r7, 0x1
|
||||
mov r10, r2
|
||||
lsls r0, r7, 2
|
||||
adds r0, r7
|
||||
mov r8, r0
|
||||
_0817766A:
|
||||
mov r1, r8
|
||||
lsls r0, r1, 4
|
||||
subs r0, r1
|
||||
lsls r0, 5
|
||||
adds r5, r0, 0x4
|
||||
mov r2, r9
|
||||
ldr r0, [r2]
|
||||
adds r0, r5
|
||||
lsls r1, r6, 2
|
||||
adds r1, r6
|
||||
lsls r4, r1, 4
|
||||
adds r0, r4
|
||||
movs r1, 0xB
|
||||
bl pokemon_getattr_encrypted
|
||||
cmp r0, 0
|
||||
beq _081776D2
|
||||
mov r1, r9
|
||||
ldr r0, [r1]
|
||||
adds r0, r5
|
||||
adds r0, r4
|
||||
movs r1, 0x2D
|
||||
bl pokemon_getattr_encrypted
|
||||
cmp r0, 0
|
||||
bne _081776D2
|
||||
mov r2, r9
|
||||
ldr r0, [r2]
|
||||
adds r0, r5
|
||||
adds r0, r4
|
||||
movs r1, 0x1
|
||||
bl pokemon_getattr_encrypted
|
||||
adds r1, r0, 0
|
||||
ldr r0, =0x020375f0
|
||||
ldrh r0, [r0]
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
bl sub_817778C
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r1, =0x020375e0
|
||||
ldrh r2, [r1]
|
||||
cmp r0, r2
|
||||
bls _081776D2
|
||||
cmp r0, 0x1
|
||||
bls _081776D2
|
||||
subs r0, 0x1
|
||||
strh r0, [r1]
|
||||
str r7, [sp]
|
||||
str r6, [sp, 0x4]
|
||||
_081776D2:
|
||||
adds r0, r6, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r6, r0, 16
|
||||
cmp r6, 0x1D
|
||||
bls _0817766A
|
||||
mov r1, r10
|
||||
lsls r0, r1, 16
|
||||
lsrs r7, r0, 16
|
||||
cmp r7, 0xD
|
||||
bls _0817765E
|
||||
ldr r3, =0x020375e0
|
||||
ldrh r0, [r3]
|
||||
cmp r0, 0
|
||||
beq _0817776E
|
||||
ldr r2, =0x020375e2
|
||||
ldr r1, =gUnknown_085E7080
|
||||
subs r0, 0x1
|
||||
lsls r0, 1
|
||||
adds r0, r1
|
||||
ldrh r0, [r0]
|
||||
strh r0, [r2]
|
||||
ldr r2, [sp]
|
||||
cmp r2, 0xE
|
||||
bne _0817773C
|
||||
ldr r1, =0x020375e4
|
||||
movs r0, 0
|
||||
strh r0, [r1]
|
||||
movs r0, 0x64
|
||||
ldr r1, [sp, 0x4]
|
||||
muls r0, r1
|
||||
ldr r1, =0x020244ec
|
||||
adds r0, r1
|
||||
ldr r2, =0x02021cc4
|
||||
movs r1, 0x2
|
||||
bl pokemon_getattr
|
||||
b _08177768
|
||||
.pool
|
||||
_0817773C:
|
||||
ldr r1, =0x020375e4
|
||||
movs r0, 0x1
|
||||
strh r0, [r1]
|
||||
ldr r2, =0x03005d94
|
||||
ldr r1, [sp]
|
||||
lsls r0, r1, 2
|
||||
adds r0, r1
|
||||
lsls r1, r0, 4
|
||||
subs r1, r0
|
||||
lsls r1, 5
|
||||
adds r1, 0x4
|
||||
ldr r0, [r2]
|
||||
adds r0, r1
|
||||
ldr r2, [sp, 0x4]
|
||||
lsls r1, r2, 2
|
||||
adds r1, r2
|
||||
lsls r1, 4
|
||||
adds r0, r1
|
||||
ldr r2, =0x02021cc4
|
||||
movs r1, 0x2
|
||||
bl pokemon_getattr_encrypted
|
||||
_08177768:
|
||||
ldr r0, =0x02021cc4
|
||||
bl GetStringEnd_Limit7
|
||||
_0817776E:
|
||||
add sp, 0x8
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81775E0
|
||||
|
||||
thumb_func_start sub_817778C
|
||||
sub_817778C: @ 817778C
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
lsls r0, 16
|
||||
lsrs r6, r0, 16
|
||||
lsls r1, 16
|
||||
lsrs r5, r1, 16
|
||||
movs r0, 0
|
||||
mov r8, r0
|
||||
movs r7, 0
|
||||
ldr r1, =0x0203bcec
|
||||
mov r10, r1
|
||||
ldr r0, =0x0203bcee
|
||||
mov r9, r0
|
||||
_081777AC:
|
||||
adds r0, r6, 0
|
||||
movs r1, 0xA
|
||||
bl __umodsi3
|
||||
adds r4, r0, 0
|
||||
mov r1, r10
|
||||
strh r4, [r1]
|
||||
adds r0, r5, 0
|
||||
movs r1, 0xA
|
||||
bl __umodsi3
|
||||
mov r1, r9
|
||||
strh r0, [r1]
|
||||
lsls r4, 16
|
||||
lsls r0, 16
|
||||
cmp r4, r0
|
||||
bne _081777FA
|
||||
adds r0, r6, 0
|
||||
movs r1, 0xA
|
||||
bl __udivsi3
|
||||
lsls r0, 16
|
||||
lsrs r6, r0, 16
|
||||
adds r0, r5, 0
|
||||
movs r1, 0xA
|
||||
bl __udivsi3
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
mov r0, r8
|
||||
adds r0, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r8, r0
|
||||
adds r0, r7, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r7, r0, 24
|
||||
cmp r7, 0x4
|
||||
bls _081777AC
|
||||
_081777FA:
|
||||
mov r0, r8
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_817778C
|
||||
|
||||
thumb_func_start sub_8177814
|
||||
sub_8177814: @ 8177814
|
||||
push {r4,lr}
|
||||
adds r1, r0, 0
|
||||
lsrs r4, r1, 16
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
ldr r0, =0x0000404b
|
||||
bl VarSet
|
||||
ldr r0, =0x0000404c
|
||||
adds r1, r4, 0
|
||||
bl VarSet
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8177814
|
||||
|
||||
thumb_func_start sub_817783C
|
||||
sub_817783C: @ 817783C
|
||||
push {r4,lr}
|
||||
ldr r0, =0x0000404b
|
||||
bl VarGet
|
||||
adds r4, r0, 0
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
ldr r0, =0x0000404c
|
||||
bl VarGet
|
||||
lsls r0, 16
|
||||
orrs r0, r4
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_817783C
|
||||
|
||||
thumb_func_start sub_8177864
|
||||
sub_8177864: @ 8177864
|
||||
push {lr}
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
bl sub_8177814
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_8177864
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
1035
asm/mail.s
Normal file
1035
asm/mail.s
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,5 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
|
1861
asm/map_obj_8097404.s
Normal file
1861
asm/map_obj_8097404.s
Normal file
File diff suppressed because it is too large
Load Diff
474
asm/map_obj_lock.s
Normal file
474
asm/map_obj_lock.s
Normal file
@ -0,0 +1,474 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start walkrun_is_standing_still
|
||||
walkrun_is_standing_still: @ 8098388
|
||||
push {lr}
|
||||
ldr r0, =0x02037590
|
||||
ldrb r0, [r0, 0x3]
|
||||
cmp r0, 0x1
|
||||
beq _0809839C
|
||||
movs r0, 0x1
|
||||
b _0809839E
|
||||
.pool
|
||||
_0809839C:
|
||||
movs r0, 0
|
||||
_0809839E:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end walkrun_is_standing_still
|
||||
|
||||
thumb_func_start sub_80983A4
|
||||
sub_80983A4: @ 80983A4
|
||||
push {r4,lr}
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
bl walkrun_is_standing_still
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _080983BE
|
||||
bl sub_808B864
|
||||
adds r0, r4, 0
|
||||
bl DestroyTask
|
||||
_080983BE:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80983A4
|
||||
|
||||
thumb_func_start sub_80983C4
|
||||
sub_80983C4: @ 80983C4
|
||||
push {lr}
|
||||
ldr r0, =sub_80983A4
|
||||
bl FuncIsActiveTask
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _080983E0
|
||||
bl sub_808BCF4
|
||||
movs r0, 0x1
|
||||
b _080983E2
|
||||
.pool
|
||||
_080983E0:
|
||||
movs r0, 0
|
||||
_080983E2:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80983C4
|
||||
|
||||
thumb_func_start sub_80983E8
|
||||
sub_80983E8: @ 80983E8
|
||||
push {lr}
|
||||
bl player_bitmagic
|
||||
ldr r0, =sub_80983A4
|
||||
movs r1, 0x50
|
||||
bl CreateTask
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80983E8
|
||||
|
||||
thumb_func_start sub_8098400
|
||||
sub_8098400: @ 8098400
|
||||
push {r4-r6,lr}
|
||||
lsls r0, 24
|
||||
lsrs r6, r0, 24
|
||||
lsls r0, r6, 2
|
||||
adds r0, r6
|
||||
lsls r0, 3
|
||||
ldr r1, =0x03005e00
|
||||
adds r5, r0, r1
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r5, r1]
|
||||
cmp r0, 0
|
||||
bne _0809842A
|
||||
bl walkrun_is_standing_still
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
cmp r4, 0x1
|
||||
bne _0809842A
|
||||
bl sub_808B864
|
||||
strh r4, [r5, 0x8]
|
||||
_0809842A:
|
||||
movs r1, 0xA
|
||||
ldrsh r0, [r5, r1]
|
||||
cmp r0, 0
|
||||
bne _08098452
|
||||
ldr r2, =0x02037350
|
||||
ldr r0, =0x03005df0
|
||||
ldrb r1, [r0]
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r1, r0, r2
|
||||
ldrb r0, [r1]
|
||||
lsls r0, 30
|
||||
cmp r0, 0
|
||||
blt _08098452
|
||||
adds r0, r1, 0
|
||||
bl sub_8097404
|
||||
movs r0, 0x1
|
||||
strh r0, [r5, 0xA]
|
||||
_08098452:
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r5, r1]
|
||||
cmp r0, 0
|
||||
beq _08098468
|
||||
movs r1, 0xA
|
||||
ldrsh r0, [r5, r1]
|
||||
cmp r0, 0
|
||||
beq _08098468
|
||||
adds r0, r6, 0
|
||||
bl DestroyTask
|
||||
_08098468:
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8098400
|
||||
|
||||
thumb_func_start sub_809847C
|
||||
sub_809847C: @ 809847C
|
||||
push {lr}
|
||||
ldr r0, =sub_8098400
|
||||
bl FuncIsActiveTask
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _08098498
|
||||
bl sub_808BCF4
|
||||
movs r0, 0x1
|
||||
b _0809849A
|
||||
.pool
|
||||
_08098498:
|
||||
movs r0, 0
|
||||
_0809849A:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_809847C
|
||||
|
||||
thumb_func_start sub_80984A0
|
||||
sub_80984A0: @ 80984A0
|
||||
push {r4,r5,lr}
|
||||
ldr r4, =0x03005df0
|
||||
ldrb r0, [r4]
|
||||
bl sub_80974D0
|
||||
ldr r0, =sub_8098400
|
||||
movs r1, 0x50
|
||||
bl CreateTask
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
ldr r2, =0x02037350
|
||||
ldrb r1, [r4]
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r1, r0, r2
|
||||
ldrb r0, [r1]
|
||||
lsls r0, 30
|
||||
cmp r0, 0
|
||||
blt _080984DE
|
||||
adds r0, r1, 0
|
||||
bl sub_8097404
|
||||
ldr r0, =0x03005e00
|
||||
lsls r1, r5, 2
|
||||
adds r1, r5
|
||||
lsls r1, 3
|
||||
adds r1, r0
|
||||
movs r0, 0x1
|
||||
strh r0, [r1, 0xA]
|
||||
_080984DE:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80984A0
|
||||
|
||||
thumb_func_start sub_80984F4
|
||||
sub_80984F4: @ 80984F4
|
||||
push {lr}
|
||||
movs r0, 0xFF
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl GetFieldObjectIdByLocalIdAndMap
|
||||
adds r1, r0, 0
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, =0x02037350
|
||||
adds r0, r1
|
||||
bl FieldObjectClearAnimIfSpecialAnimFinished
|
||||
bl sub_80D338C
|
||||
bl sub_809757C
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80984F4
|
||||
|
||||
thumb_func_start sub_8098524
|
||||
sub_8098524: @ 8098524
|
||||
push {r4,lr}
|
||||
ldr r4, =0x02037350
|
||||
ldr r0, =0x03005df0
|
||||
ldrb r1, [r0]
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r1, r0, r4
|
||||
ldrb r0, [r1]
|
||||
lsls r0, 31
|
||||
cmp r0, 0
|
||||
beq _08098542
|
||||
adds r0, r1, 0
|
||||
bl FieldObjectClearAnimIfSpecialAnimFinished
|
||||
_08098542:
|
||||
movs r0, 0xFF
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl GetFieldObjectIdByLocalIdAndMap
|
||||
adds r1, r0, 0
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r4
|
||||
bl FieldObjectClearAnimIfSpecialAnimFinished
|
||||
bl sub_80D338C
|
||||
bl sub_809757C
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8098524
|
||||
|
||||
thumb_func_start sub_8098574
|
||||
sub_8098574: @ 8098574
|
||||
push {lr}
|
||||
ldr r0, =0x03005df0
|
||||
ldrb r1, [r0]
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, =0x02037350
|
||||
adds r0, r1
|
||||
ldr r1, =0x020375f4
|
||||
ldrb r1, [r1]
|
||||
bl FieldObjectFaceOppositeDirection
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8098574
|
||||
|
||||
thumb_func_start sub_809859C
|
||||
sub_809859C: @ 809859C
|
||||
push {lr}
|
||||
ldr r0, =0x03005df0
|
||||
ldrb r1, [r0]
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, =0x02037350
|
||||
adds r0, r1
|
||||
bl FieldObjectClearAnimIfSpecialAnimActive
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_809859C
|
||||
|
||||
thumb_func_start sub_80985BC
|
||||
sub_80985BC: @ 80985BC
|
||||
push {r4-r7,lr}
|
||||
lsls r0, 24
|
||||
lsrs r6, r0, 24
|
||||
lsls r0, r6, 2
|
||||
adds r0, r6
|
||||
lsls r0, 3
|
||||
ldr r1, =0x03005e00
|
||||
adds r5, r0, r1
|
||||
ldrb r7, [r5, 0xC]
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r5, r1]
|
||||
cmp r0, 0
|
||||
bne _080985E8
|
||||
bl walkrun_is_standing_still
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
cmp r4, 0x1
|
||||
bne _080985E8
|
||||
bl sub_808B864
|
||||
strh r4, [r5, 0x8]
|
||||
_080985E8:
|
||||
movs r1, 0xA
|
||||
ldrsh r0, [r5, r1]
|
||||
cmp r0, 0
|
||||
bne _0809860C
|
||||
ldr r0, =0x02037350
|
||||
lsls r1, r7, 3
|
||||
adds r1, r7
|
||||
lsls r1, 2
|
||||
adds r1, r0
|
||||
ldrb r0, [r1]
|
||||
lsls r0, 30
|
||||
cmp r0, 0
|
||||
blt _0809860C
|
||||
adds r0, r1, 0
|
||||
bl sub_8097404
|
||||
movs r0, 0x1
|
||||
strh r0, [r5, 0xA]
|
||||
_0809860C:
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r5, r1]
|
||||
cmp r0, 0
|
||||
beq _08098622
|
||||
movs r1, 0xA
|
||||
ldrsh r0, [r5, r1]
|
||||
cmp r0, 0
|
||||
beq _08098622
|
||||
adds r0, r6, 0
|
||||
bl DestroyTask
|
||||
_08098622:
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80985BC
|
||||
|
||||
thumb_func_start sub_8098630
|
||||
sub_8098630: @ 8098630
|
||||
push {r4-r7,lr}
|
||||
mov r7, r9
|
||||
mov r6, r8
|
||||
push {r6,r7}
|
||||
movs r0, 0
|
||||
bl sub_80B47E0
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
ldr r0, =0x030060a8
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0x2
|
||||
bne _080986E0
|
||||
movs r0, 0x1
|
||||
bl sub_80B47E0
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
adds r5, r0, 0
|
||||
adds r0, r4, 0
|
||||
adds r1, r5, 0
|
||||
bl sub_8098074
|
||||
ldr r7, =sub_80985BC
|
||||
adds r0, r7, 0
|
||||
movs r1, 0x50
|
||||
bl CreateTask
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
ldr r0, =0x03005e00
|
||||
mov r9, r0
|
||||
lsls r0, r2, 2
|
||||
adds r0, r2
|
||||
lsls r0, 3
|
||||
mov r1, r9
|
||||
adds r6, r0, r1
|
||||
strh r4, [r6, 0xC]
|
||||
ldr r2, =0x02037350
|
||||
mov r8, r2
|
||||
lsls r0, r4, 3
|
||||
adds r0, r4
|
||||
lsls r0, 2
|
||||
adds r1, r0, r2
|
||||
ldrb r0, [r1]
|
||||
lsls r0, 30
|
||||
cmp r0, 0
|
||||
blt _0809869A
|
||||
adds r0, r1, 0
|
||||
bl sub_8097404
|
||||
movs r0, 0x1
|
||||
strh r0, [r6, 0xA]
|
||||
_0809869A:
|
||||
adds r0, r7, 0
|
||||
movs r1, 0x51
|
||||
bl CreateTask
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
lsls r0, r2, 2
|
||||
adds r0, r2
|
||||
lsls r0, 3
|
||||
mov r1, r9
|
||||
adds r4, r0, r1
|
||||
strh r5, [r4, 0xC]
|
||||
lsls r0, r5, 3
|
||||
adds r0, r5
|
||||
lsls r0, 2
|
||||
mov r2, r8
|
||||
adds r1, r0, r2
|
||||
ldrb r0, [r1]
|
||||
lsls r0, 30
|
||||
cmp r0, 0
|
||||
blt _0809871A
|
||||
adds r0, r1, 0
|
||||
bl sub_8097404
|
||||
movs r0, 0x1
|
||||
strh r0, [r4, 0xA]
|
||||
b _0809871A
|
||||
.pool
|
||||
_080986E0:
|
||||
adds r0, r4, 0
|
||||
bl sub_80974D0
|
||||
ldr r0, =sub_80985BC
|
||||
movs r1, 0x50
|
||||
bl CreateTask
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
ldr r1, =0x03005e00
|
||||
lsls r0, r2, 2
|
||||
adds r0, r2
|
||||
lsls r0, 3
|
||||
adds r5, r0, r1
|
||||
strh r4, [r5, 0xC]
|
||||
ldr r1, =0x02037350
|
||||
lsls r0, r4, 3
|
||||
adds r0, r4
|
||||
lsls r0, 2
|
||||
adds r1, r0, r1
|
||||
ldrb r0, [r1]
|
||||
lsls r0, 30
|
||||
cmp r0, 0
|
||||
blt _0809871A
|
||||
adds r0, r1, 0
|
||||
bl sub_8097404
|
||||
movs r0, 0x1
|
||||
strh r0, [r5, 0xA]
|
||||
_0809871A:
|
||||
pop {r3,r4}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8098630
|
||||
|
||||
thumb_func_start sub_8098734
|
||||
sub_8098734: @ 8098734
|
||||
push {lr}
|
||||
ldr r0, =sub_80985BC
|
||||
bl FuncIsActiveTask
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _08098750
|
||||
bl sub_808BCF4
|
||||
movs r0, 0x1
|
||||
b _08098752
|
||||
.pool
|
||||
_08098750:
|
||||
movs r0, 0
|
||||
_08098752:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8098734
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
2519
asm/mauville_old_man.s
Normal file
2519
asm/mauville_old_man.s
Normal file
File diff suppressed because it is too large
Load Diff
986
asm/menu_helpers.s
Normal file
986
asm/menu_helpers.s
Normal file
@ -0,0 +1,986 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_8121DA0
|
||||
sub_8121DA0: @ 8121DA0
|
||||
push {r4,lr}
|
||||
sub sp, 0xC
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0xE
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0xC
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0xA
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x8
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
mov r1, sp
|
||||
movs r0, 0
|
||||
strh r0, [r1]
|
||||
movs r1, 0xC0
|
||||
lsls r1, 19
|
||||
ldr r2, =0x0100c000
|
||||
mov r0, sp
|
||||
bl CpuSet
|
||||
movs r4, 0
|
||||
str r4, [sp, 0x4]
|
||||
add r0, sp, 0x4
|
||||
movs r1, 0xE0
|
||||
lsls r1, 19
|
||||
ldr r2, =0x05000100
|
||||
bl CpuSet
|
||||
add r0, sp, 0x8
|
||||
strh r4, [r0]
|
||||
movs r1, 0xA0
|
||||
lsls r1, 19
|
||||
ldr r2, =0x01000200
|
||||
bl CpuSet
|
||||
add sp, 0xC
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8121DA0
|
||||
|
||||
thumb_func_start sub_8121E10
|
||||
sub_8121E10: @ 8121E10
|
||||
push {lr}
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgX
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgY
|
||||
movs r0, 0x1
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgX
|
||||
movs r0, 0x1
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgY
|
||||
movs r0, 0x2
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgX
|
||||
movs r0, 0x2
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgY
|
||||
movs r0, 0x3
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgX
|
||||
movs r0, 0x3
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgY
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_8121E10
|
||||
|
||||
thumb_func_start SetVBlankHBlankCallbacksToNull
|
||||
@ void SetVBlankHBlankCallbacksToNull()
|
||||
SetVBlankHBlankCallbacksToNull: @ 8121E68
|
||||
push {lr}
|
||||
movs r0, 0
|
||||
bl SetVBlankCallback
|
||||
movs r0, 0
|
||||
bl SetHBlankCallback
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end SetVBlankHBlankCallbacksToNull
|
||||
|
||||
thumb_func_start DisplayMessageAndContinueTask
|
||||
@ void DisplayMessageAndContinueTask(u8 taskId, u8 windowId, u16 windowBorderFirstTileNum, u8 windowBorderPalette, u8 fontId, u8 speed, u8 *str, void ( *callback)(u8 taskId))
|
||||
DisplayMessageAndContinueTask: @ 8121E7C
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
sub sp, 0x10
|
||||
ldr r4, [sp, 0x28]
|
||||
ldr r5, [sp, 0x2C]
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r8, r0
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r6, r1, 0
|
||||
lsls r2, 16
|
||||
lsrs r2, 16
|
||||
lsls r3, 24
|
||||
lsrs r3, 24
|
||||
lsls r4, 24
|
||||
lsrs r7, r4, 24
|
||||
lsls r5, 24
|
||||
lsrs r5, 24
|
||||
ldr r0, =0x0203a140
|
||||
strb r6, [r0]
|
||||
adds r0, r6, 0
|
||||
movs r1, 0x1
|
||||
bl sub_8197B1C
|
||||
ldr r4, =0x02021fc4
|
||||
ldr r0, [sp, 0x30]
|
||||
cmp r0, r4
|
||||
beq _08121EC0
|
||||
adds r0, r4, 0
|
||||
ldr r1, [sp, 0x30]
|
||||
bl ExpandStringRefs
|
||||
_08121EC0:
|
||||
ldr r2, =0x03003014
|
||||
ldrb r0, [r2]
|
||||
movs r1, 0x1
|
||||
orrs r0, r1
|
||||
strb r0, [r2]
|
||||
movs r0, 0
|
||||
str r0, [sp]
|
||||
movs r0, 0x2
|
||||
str r0, [sp, 0x4]
|
||||
movs r0, 0x1
|
||||
str r0, [sp, 0x8]
|
||||
movs r0, 0x3
|
||||
str r0, [sp, 0xC]
|
||||
adds r0, r6, 0
|
||||
adds r1, r7, 0
|
||||
adds r2, r4, 0
|
||||
adds r3, r5, 0
|
||||
bl AddTextPrinterParametrized
|
||||
ldr r1, =0x0300117c
|
||||
ldr r0, [sp, 0x34]
|
||||
str r0, [r1]
|
||||
ldr r1, =0x03005e00
|
||||
mov r2, r8
|
||||
lsls r0, r2, 2
|
||||
add r0, r8
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
ldr r1, =Task_ContinueTaskAfterMessagePrints
|
||||
str r1, [r0]
|
||||
add sp, 0x10
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end DisplayMessageAndContinueTask
|
||||
|
||||
thumb_func_start sub_8121F20
|
||||
sub_8121F20: @ 8121F20
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
bl RunTextPrinters
|
||||
adds r0, r4, 0
|
||||
bl IsTextPrinterActive
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8121F20
|
||||
|
||||
thumb_func_start Task_ContinueTaskAfterMessagePrints
|
||||
@ void Task_ContinueTaskAfterMessagePrints(u8 taskId)
|
||||
Task_ContinueTaskAfterMessagePrints: @ 8121F3C
|
||||
push {r4,lr}
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
ldr r0, =0x0203a140
|
||||
ldrb r0, [r0]
|
||||
bl sub_8121F20
|
||||
lsls r0, 16
|
||||
cmp r0, 0
|
||||
bne _08121F5A
|
||||
ldr r0, =0x0300117c
|
||||
ldr r1, [r0]
|
||||
adds r0, r4, 0
|
||||
bl _call_via_r1
|
||||
_08121F5A:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end Task_ContinueTaskAfterMessagePrints
|
||||
|
||||
thumb_func_start sub_8121F68
|
||||
sub_8121F68: @ 8121F68
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r3, =0x0203a138
|
||||
ldr r2, [r1, 0x4]
|
||||
ldr r1, [r1]
|
||||
str r1, [r3]
|
||||
str r2, [r3, 0x4]
|
||||
ldr r2, =0x03005e00
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
adds r1, r2
|
||||
ldr r0, =Task_CallYesOrNoCallback
|
||||
str r0, [r1]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sub_8121F68
|
||||
|
||||
thumb_func_start CreateYesNoMenuWithCallbacks
|
||||
@ void CreateYesNoMenuWithCallbacks(u8 taskId, struct WindowTemplate *windowTemplate, int a3, int a4, int a5, u16 borderFirstTileNum, u8 borderPalette, void ( **callbacks)(u8 taskId))
|
||||
CreateYesNoMenuWithCallbacks: @ 8121F94
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
adds r0, r1, 0
|
||||
ldr r1, [sp, 0x10]
|
||||
ldr r2, [sp, 0x14]
|
||||
ldr r5, [sp, 0x18]
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
movs r3, 0
|
||||
bl CreateYesNoMenu
|
||||
ldr r2, =0x0203a138
|
||||
ldr r0, [r5]
|
||||
ldr r1, [r5, 0x4]
|
||||
str r0, [r2]
|
||||
str r1, [r2, 0x4]
|
||||
ldr r1, =0x03005e00
|
||||
lsls r0, r4, 2
|
||||
adds r0, r4
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
ldr r1, =Task_CallYesOrNoCallback
|
||||
str r1, [r0]
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end CreateYesNoMenuWithCallbacks
|
||||
|
||||
thumb_func_start Task_CallYesOrNoCallback
|
||||
@ void Task_CallYesOrNoCallback(u8 taskId)
|
||||
Task_CallYesOrNoCallback: @ 8121FDC
|
||||
push {r4,lr}
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
bl sub_8198C58
|
||||
lsls r0, 24
|
||||
asrs r1, r0, 24
|
||||
cmp r1, 0
|
||||
beq _08122002
|
||||
cmp r1, 0
|
||||
bgt _08121FFC
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
cmp r1, r0
|
||||
beq _08122018
|
||||
b _08122028
|
||||
_08121FFC:
|
||||
cmp r1, 0x1
|
||||
beq _08122018
|
||||
b _08122028
|
||||
_08122002:
|
||||
movs r0, 0x5
|
||||
bl audio_play
|
||||
ldr r0, =0x0203a138
|
||||
ldr r1, [r0]
|
||||
adds r0, r4, 0
|
||||
bl _call_via_r1
|
||||
b _08122028
|
||||
.pool
|
||||
_08122018:
|
||||
movs r0, 0x5
|
||||
bl audio_play
|
||||
ldr r0, =0x0203a138
|
||||
ldr r1, [r0, 0x4]
|
||||
adds r0, r4, 0
|
||||
bl _call_via_r1
|
||||
_08122028:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end Task_CallYesOrNoCallback
|
||||
|
||||
thumb_func_start AdjustQuantityAccordingToDPadInput
|
||||
@ bool8 AdjustQuantityAccordingToDPadInput(u16 *quantity, u16 maxQuantity)
|
||||
AdjustQuantityAccordingToDPadInput: @ 8122034
|
||||
push {r4-r6,lr}
|
||||
adds r2, r0, 0
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
adds r5, r1, 0
|
||||
ldrh r4, [r2]
|
||||
adds r6, r4, 0
|
||||
ldr r0, =0x030022c0
|
||||
ldrh r0, [r0, 0x30]
|
||||
movs r3, 0xF0
|
||||
ands r3, r0
|
||||
cmp r3, 0x40
|
||||
bne _0812206C
|
||||
adds r0, r4, 0x1
|
||||
strh r0, [r2]
|
||||
movs r3, 0
|
||||
ldrsh r0, [r2, r3]
|
||||
cmp r0, r1
|
||||
ble _0812205E
|
||||
movs r0, 0x1
|
||||
strh r0, [r2]
|
||||
_0812205E:
|
||||
movs r0, 0
|
||||
ldrsh r1, [r2, r0]
|
||||
_08122062:
|
||||
lsls r0, r4, 16
|
||||
b _081220B6
|
||||
.pool
|
||||
_0812206C:
|
||||
cmp r3, 0x80
|
||||
bne _08122082
|
||||
subs r0, r4, 0x1
|
||||
strh r0, [r2]
|
||||
lsls r0, 16
|
||||
cmp r0, 0
|
||||
bgt _0812207C
|
||||
strh r1, [r2]
|
||||
_0812207C:
|
||||
movs r3, 0
|
||||
ldrsh r1, [r2, r3]
|
||||
b _08122062
|
||||
_08122082:
|
||||
cmp r3, 0x10
|
||||
bne _0812209C
|
||||
adds r0, r4, 0
|
||||
adds r0, 0xA
|
||||
strh r0, [r2]
|
||||
movs r1, 0
|
||||
ldrsh r0, [r2, r1]
|
||||
cmp r0, r5
|
||||
ble _08122096
|
||||
strh r5, [r2]
|
||||
_08122096:
|
||||
movs r3, 0
|
||||
ldrsh r1, [r2, r3]
|
||||
b _08122062
|
||||
_0812209C:
|
||||
cmp r3, 0x20
|
||||
bne _081220C6
|
||||
adds r0, r4, 0
|
||||
subs r0, 0xA
|
||||
strh r0, [r2]
|
||||
lsls r0, 16
|
||||
cmp r0, 0
|
||||
bgt _081220B0
|
||||
movs r0, 0x1
|
||||
strh r0, [r2]
|
||||
_081220B0:
|
||||
movs r0, 0
|
||||
ldrsh r1, [r2, r0]
|
||||
lsls r0, r6, 16
|
||||
_081220B6:
|
||||
asrs r0, 16
|
||||
cmp r1, r0
|
||||
beq _081220C6
|
||||
movs r0, 0x5
|
||||
bl audio_play
|
||||
movs r0, 0x1
|
||||
b _081220C8
|
||||
_081220C6:
|
||||
movs r0, 0
|
||||
_081220C8:
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end AdjustQuantityAccordingToDPadInput
|
||||
|
||||
thumb_func_start GetLRKeysState
|
||||
GetLRKeysState: @ 81220D0
|
||||
push {lr}
|
||||
ldr r0, =0x03005d90
|
||||
ldr r0, [r0]
|
||||
ldrb r0, [r0, 0x13]
|
||||
cmp r0, 0x1
|
||||
bne _08122106
|
||||
ldr r0, =0x030022c0
|
||||
ldrh r1, [r0, 0x2E]
|
||||
movs r0, 0x80
|
||||
lsls r0, 2
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _081220F8
|
||||
movs r0, 0x1
|
||||
b _08122108
|
||||
.pool
|
||||
_081220F8:
|
||||
movs r0, 0x80
|
||||
lsls r0, 1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _08122106
|
||||
movs r0, 0x2
|
||||
b _08122108
|
||||
_08122106:
|
||||
movs r0, 0
|
||||
_08122108:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end GetLRKeysState
|
||||
|
||||
thumb_func_start sub_812210C
|
||||
sub_812210C: @ 812210C
|
||||
push {lr}
|
||||
ldr r0, =0x03005d90
|
||||
ldr r0, [r0]
|
||||
ldrb r0, [r0, 0x13]
|
||||
cmp r0, 0x1
|
||||
bne _08122142
|
||||
ldr r0, =0x030022c0
|
||||
ldrh r1, [r0, 0x30]
|
||||
movs r0, 0x80
|
||||
lsls r0, 2
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _08122134
|
||||
movs r0, 0x1
|
||||
b _08122144
|
||||
.pool
|
||||
_08122134:
|
||||
movs r0, 0x80
|
||||
lsls r0, 1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _08122142
|
||||
movs r0, 0x2
|
||||
b _08122144
|
||||
_08122142:
|
||||
movs r0, 0
|
||||
_08122144:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_812210C
|
||||
|
||||
thumb_func_start sub_8122148
|
||||
sub_8122148: @ 8122148
|
||||
push {lr}
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
cmp r0, 0xAF
|
||||
bne _08122174
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r0, [r0]
|
||||
ldrh r1, [r0, 0x4]
|
||||
ldr r0, =0x00001919
|
||||
cmp r1, r0
|
||||
beq _08122166
|
||||
bl InUnionRoom
|
||||
cmp r0, 0x1
|
||||
bne _08122174
|
||||
_08122166:
|
||||
movs r0, 0
|
||||
b _08122176
|
||||
.pool
|
||||
_08122174:
|
||||
movs r0, 0x1
|
||||
_08122176:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8122148
|
||||
|
||||
thumb_func_start itemid_80BF6D8_mail_related
|
||||
itemid_80BF6D8_mail_related: @ 812217C
|
||||
push {r4,lr}
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
bl is_c1_link_related_active
|
||||
cmp r0, 0x1
|
||||
beq _08122192
|
||||
bl InUnionRoom
|
||||
cmp r0, 0x1
|
||||
bne _081221A4
|
||||
_08122192:
|
||||
adds r0, r4, 0
|
||||
bl itemid_is_mail
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
bne _081221A4
|
||||
movs r0, 0
|
||||
b _081221A6
|
||||
_081221A4:
|
||||
movs r0, 0x1
|
||||
_081221A6:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end itemid_80BF6D8_mail_related
|
||||
|
||||
thumb_func_start sub_81221AC
|
||||
sub_81221AC: @ 81221AC
|
||||
push {lr}
|
||||
bl is_c1_link_related_active
|
||||
cmp r0, 0x1
|
||||
beq _081221BE
|
||||
ldr r0, =0x03003124
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0x1
|
||||
bne _081221C8
|
||||
_081221BE:
|
||||
movs r0, 0x1
|
||||
b _081221CA
|
||||
.pool
|
||||
_081221C8:
|
||||
movs r0, 0
|
||||
_081221CA:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81221AC
|
||||
|
||||
thumb_func_start sub_81221D0
|
||||
sub_81221D0: @ 81221D0
|
||||
push {lr}
|
||||
bl sub_81221AC
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _081221E6
|
||||
bl sub_8087598
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
b _081221E8
|
||||
_081221E6:
|
||||
movs r0, 0
|
||||
_081221E8:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81221D0
|
||||
|
||||
thumb_func_start sub_81221EC
|
||||
sub_81221EC: @ 81221EC
|
||||
push {lr}
|
||||
bl sub_81221D0
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
beq _08122202
|
||||
bl sub_800B504
|
||||
cmp r0, 0x1
|
||||
bne _08122206
|
||||
_08122202:
|
||||
movs r0, 0x1
|
||||
b _08122208
|
||||
_08122206:
|
||||
movs r0, 0
|
||||
_08122208:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81221EC
|
||||
|
||||
thumb_func_start atk2D_jumpifarraynotequal
|
||||
atk2D_jumpifarraynotequal: @ 812220C
|
||||
push {r4-r6,lr}
|
||||
adds r6, r2, 0
|
||||
ldr r2, [sp, 0x10]
|
||||
lsls r1, 24
|
||||
lsls r2, 24
|
||||
lsrs r5, r2, 24
|
||||
adds r4, r0, 0
|
||||
movs r0, 0
|
||||
strb r0, [r3]
|
||||
movs r2, 0
|
||||
lsrs r1, 24
|
||||
cmp r2, r1
|
||||
bcs _08122240
|
||||
_08122226:
|
||||
lsls r0, r2, 2
|
||||
adds r0, r4
|
||||
ldrh r0, [r0]
|
||||
cmp r0, 0
|
||||
beq _08122236
|
||||
ldrb r0, [r3]
|
||||
adds r0, 0x1
|
||||
strb r0, [r3]
|
||||
_08122236:
|
||||
adds r0, r2, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r2, r0, 16
|
||||
cmp r2, r1
|
||||
bcc _08122226
|
||||
_08122240:
|
||||
ldrb r0, [r3]
|
||||
adds r1, r0, 0x1
|
||||
strb r1, [r3]
|
||||
lsls r0, r1, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, r5
|
||||
bls _08122252
|
||||
strb r5, [r6]
|
||||
b _08122254
|
||||
_08122252:
|
||||
strb r1, [r6]
|
||||
_08122254:
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end atk2D_jumpifarraynotequal
|
||||
|
||||
thumb_func_start sub_812225C
|
||||
sub_812225C: @ 812225C
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
adds r5, r1, 0
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
lsls r3, 24
|
||||
lsrs r3, 24
|
||||
ldrh r0, [r4]
|
||||
cmp r0, 0
|
||||
beq _0812227A
|
||||
adds r0, r2
|
||||
cmp r0, r3
|
||||
ble _0812227A
|
||||
subs r0, r3, r2
|
||||
strh r0, [r4]
|
||||
_0812227A:
|
||||
ldrh r0, [r4]
|
||||
ldrh r1, [r5]
|
||||
adds r0, r1
|
||||
cmp r0, r3
|
||||
blt _08122290
|
||||
cmp r3, 0
|
||||
bne _0812228C
|
||||
strh r3, [r5]
|
||||
b _08122290
|
||||
_0812228C:
|
||||
subs r0, r3, 0x1
|
||||
strh r0, [r5]
|
||||
_08122290:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_812225C
|
||||
|
||||
thumb_func_start sub_8122298
|
||||
sub_8122298: @ 8122298
|
||||
push {r4-r7,lr}
|
||||
adds r5, r0, 0
|
||||
adds r4, r1, 0
|
||||
ldr r0, [sp, 0x14]
|
||||
lsls r2, 24
|
||||
lsrs r7, r2, 24
|
||||
lsls r3, 24
|
||||
lsrs r6, r3, 24
|
||||
lsls r2, r0, 24
|
||||
lsrs r0, r2, 24
|
||||
movs r1, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _081222F0
|
||||
lsrs r2, 25
|
||||
ldrh r0, [r4]
|
||||
cmp r0, r2
|
||||
bcc _08122322
|
||||
movs r1, 0
|
||||
subs r0, r2
|
||||
cmp r1, r0
|
||||
bge _08122322
|
||||
ldrh r0, [r5]
|
||||
adds r0, r7
|
||||
cmp r0, r6
|
||||
beq _08122322
|
||||
_081222CC:
|
||||
ldrh r0, [r4]
|
||||
subs r0, 0x1
|
||||
strh r0, [r4]
|
||||
ldrh r0, [r5]
|
||||
adds r0, 0x1
|
||||
strh r0, [r5]
|
||||
adds r0, r1, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r1, r0, 24
|
||||
ldrh r0, [r4]
|
||||
subs r0, r2
|
||||
cmp r1, r0
|
||||
bge _08122322
|
||||
ldrh r0, [r5]
|
||||
adds r0, r7
|
||||
cmp r0, r6
|
||||
bne _081222CC
|
||||
b _08122322
|
||||
_081222F0:
|
||||
ldrh r3, [r4]
|
||||
lsrs r2, 25
|
||||
adds r0, r2, 0x1
|
||||
cmp r3, r0
|
||||
blt _08122322
|
||||
movs r1, 0
|
||||
subs r0, r3, r2
|
||||
b _08122316
|
||||
_08122300:
|
||||
ldrh r0, [r4]
|
||||
subs r0, 0x1
|
||||
strh r0, [r4]
|
||||
ldrh r0, [r5]
|
||||
adds r0, 0x1
|
||||
strh r0, [r5]
|
||||
adds r0, r1, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r1, r0, 24
|
||||
ldrh r0, [r4]
|
||||
subs r0, r2
|
||||
_08122316:
|
||||
cmp r1, r0
|
||||
bgt _08122322
|
||||
ldrh r0, [r5]
|
||||
adds r0, r7
|
||||
cmp r0, r6
|
||||
bne _08122300
|
||||
_08122322:
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_8122298
|
||||
|
||||
thumb_func_start sub_8122328
|
||||
sub_8122328: @ 8122328
|
||||
push {lr}
|
||||
ldr r0, =gUnknown_0859F514
|
||||
bl LoadCompressedObjectPic
|
||||
ldr r0, =gUnknown_0859F51C
|
||||
bl LoadCompressedObjectPalette
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8122328
|
||||
|
||||
thumb_func_start sub_8122344
|
||||
sub_8122344: @ 8122344
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
mov r8, r0
|
||||
lsls r1, 24
|
||||
lsrs r6, r1, 24
|
||||
movs r5, 0
|
||||
cmp r5, r6
|
||||
bcs _0812239C
|
||||
ldr r7, =0x02020630
|
||||
_08122358:
|
||||
lsls r1, r5, 4
|
||||
ldr r0, =gUnknown_0859F524
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl AddObjectToFront
|
||||
mov r1, r8
|
||||
adds r4, r1, r5
|
||||
strb r0, [r4]
|
||||
cmp r5, 0
|
||||
beq _0812237E
|
||||
ldrb r1, [r4]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r7
|
||||
movs r1, 0x1
|
||||
bl StartObjectImageAnim
|
||||
_0812237E:
|
||||
ldrb r1, [r4]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r7
|
||||
adds r0, 0x3E
|
||||
ldrb r1, [r0]
|
||||
movs r2, 0x4
|
||||
orrs r1, r2
|
||||
strb r1, [r0]
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
cmp r5, r6
|
||||
bcc _08122358
|
||||
_0812239C:
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8122344
|
||||
|
||||
thumb_func_start sub_81223B0
|
||||
sub_81223B0: @ 81223B0
|
||||
push {r4-r7,lr}
|
||||
adds r6, r0, 0
|
||||
lsls r1, 24
|
||||
lsrs r5, r1, 24
|
||||
movs r4, 0
|
||||
cmp r4, r5
|
||||
bcs _081223F6
|
||||
ldr r7, =0x02020630
|
||||
_081223C0:
|
||||
subs r0, r5, 0x1
|
||||
cmp r4, r0
|
||||
bne _081223DC
|
||||
adds r0, r6, r4
|
||||
ldrb r1, [r0]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r7
|
||||
bl RemoveObjectAndFreeResources
|
||||
b _081223EC
|
||||
.pool
|
||||
_081223DC:
|
||||
adds r0, r6, r4
|
||||
ldrb r1, [r0]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r7
|
||||
bl RemoveObjectAndFreeTiles
|
||||
_081223EC:
|
||||
adds r0, r4, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
cmp r4, r5
|
||||
bcc _081223C0
|
||||
_081223F6:
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81223B0
|
||||
|
||||
thumb_func_start sub_81223FC
|
||||
sub_81223FC: @ 81223FC
|
||||
push {r4-r7,lr}
|
||||
adds r6, r0, 0
|
||||
lsls r1, 24
|
||||
lsrs r4, r1, 24
|
||||
lsls r2, 24
|
||||
lsrs r0, r2, 24
|
||||
movs r3, 0
|
||||
cmp r3, r4
|
||||
bcs _0812243E
|
||||
ldr r1, =0x02020630
|
||||
mov r12, r1
|
||||
movs r1, 0x1
|
||||
ands r0, r1
|
||||
lsls r5, r0, 2
|
||||
movs r7, 0x5
|
||||
negs r7, r7
|
||||
_0812241C:
|
||||
adds r0, r6, r3
|
||||
ldrb r0, [r0]
|
||||
lsls r1, r0, 4
|
||||
adds r1, r0
|
||||
lsls r1, 2
|
||||
add r1, r12
|
||||
adds r1, 0x3E
|
||||
ldrb r2, [r1]
|
||||
adds r0, r7, 0
|
||||
ands r0, r2
|
||||
orrs r0, r5
|
||||
strb r0, [r1]
|
||||
adds r0, r3, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
cmp r3, r4
|
||||
bcc _0812241C
|
||||
_0812243E:
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81223FC
|
||||
|
||||
thumb_func_start sub_8122448
|
||||
@ void sub_8122448(int a1, u8 a2, u16 x, u16 y)
|
||||
sub_8122448: @ 8122448
|
||||
push {r4-r7,lr}
|
||||
mov r7, r9
|
||||
mov r6, r8
|
||||
push {r6,r7}
|
||||
adds r6, r0, 0
|
||||
lsls r1, 24
|
||||
lsrs r4, r1, 24
|
||||
lsls r2, 16
|
||||
lsrs r7, r2, 16
|
||||
lsls r3, 16
|
||||
lsrs r3, 16
|
||||
mov r9, r3
|
||||
movs r0, 0x80
|
||||
ands r0, r4
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r8, r0
|
||||
movs r0, 0x7F
|
||||
ands r4, r0
|
||||
movs r3, 0
|
||||
cmp r3, r4
|
||||
bcs _081224C8
|
||||
ldr r5, =0x02020630
|
||||
lsls r0, r7, 16
|
||||
asrs r0, 16
|
||||
subs r0, 0x8
|
||||
mov r12, r0
|
||||
_0812247E:
|
||||
subs r0, r4, 0x1
|
||||
cmp r3, r0
|
||||
bne _081224A0
|
||||
mov r0, r8
|
||||
cmp r0, 0
|
||||
beq _081224A0
|
||||
adds r2, r6, r3
|
||||
ldrb r1, [r2]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r5
|
||||
mov r1, r12
|
||||
strh r1, [r0, 0x24]
|
||||
b _081224AE
|
||||
.pool
|
||||
_081224A0:
|
||||
adds r2, r6, r3
|
||||
ldrb r1, [r2]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r5
|
||||
strh r7, [r0, 0x24]
|
||||
_081224AE:
|
||||
ldrb r1, [r2]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r5
|
||||
mov r1, r9
|
||||
adds r1, 0x1
|
||||
strh r1, [r0, 0x22]
|
||||
adds r0, r3, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
cmp r3, r4
|
||||
bcc _0812247E
|
||||
_081224C8:
|
||||
pop {r3,r4}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_8122448
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
2610
asm/metatile_behavior.s
Normal file
2610
asm/metatile_behavior.s
Normal file
File diff suppressed because it is too large
Load Diff
946
asm/mon_markings.s
Normal file
946
asm/mon_markings.s
Normal file
@ -0,0 +1,946 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_811F90C
|
||||
sub_811F90C: @ 811F90C
|
||||
ldr r1, =0x0203a124
|
||||
str r0, [r1]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sub_811F90C
|
||||
|
||||
thumb_func_start sub_811F918
|
||||
sub_811F918: @ 811F918
|
||||
push {lr}
|
||||
sub sp, 0x4
|
||||
ldr r0, =0x03005d90
|
||||
ldr r0, [r0]
|
||||
ldrb r0, [r0, 0x14]
|
||||
lsrs r0, 3
|
||||
bl sub_8098758
|
||||
ldr r3, =0x0203a124
|
||||
ldr r2, [r3]
|
||||
ldr r1, [r0]
|
||||
str r1, [r2, 0x2C]
|
||||
ldr r0, [r0, 0x4]
|
||||
str r0, [r2, 0x30]
|
||||
ldr r0, =0x000010b4
|
||||
adds r2, r0
|
||||
movs r1, 0
|
||||
strb r1, [r2]
|
||||
mov r0, sp
|
||||
strh r1, [r0]
|
||||
ldr r1, [r3]
|
||||
adds r1, 0x34
|
||||
ldr r2, =0x01000800
|
||||
bl CpuSet
|
||||
add sp, 0x4
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_811F918
|
||||
|
||||
thumb_func_start sub_811F960
|
||||
sub_811F960: @ 811F960
|
||||
push {r4-r7,lr}
|
||||
ldr r0, =0x0203a124
|
||||
ldr r1, [r0]
|
||||
ldr r2, =0x000010b4
|
||||
adds r0, r1, r2
|
||||
ldrb r2, [r0]
|
||||
lsls r0, r2, 8
|
||||
adds r0, 0x34
|
||||
adds r5, r1, r0
|
||||
cmp r2, 0xD
|
||||
beq _0811FA30
|
||||
cmp r2, 0xD
|
||||
bgt _0811F988
|
||||
cmp r2, 0
|
||||
beq _0811F98E
|
||||
b _0811F9D8
|
||||
.pool
|
||||
_0811F988:
|
||||
cmp r2, 0xE
|
||||
beq _0811FA7C
|
||||
b _0811F9D8
|
||||
_0811F98E:
|
||||
ldr r0, [r1, 0x2C]
|
||||
adds r1, r5, 0
|
||||
movs r2, 0x8
|
||||
bl CpuFastSet
|
||||
movs r4, 0
|
||||
adds r7, r5, 0
|
||||
adds r7, 0xE0
|
||||
_0811F99E:
|
||||
ldr r6, =0x0203a124
|
||||
ldr r0, [r6]
|
||||
ldr r0, [r0, 0x2C]
|
||||
adds r0, 0x20
|
||||
adds r4, 0x1
|
||||
lsls r1, r4, 5
|
||||
adds r1, r5, r1
|
||||
movs r2, 0x8
|
||||
bl CpuFastSet
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
cmp r4, 0x5
|
||||
bls _0811F99E
|
||||
ldr r0, [r6]
|
||||
ldr r0, [r0, 0x2C]
|
||||
adds r0, 0x40
|
||||
adds r1, r7, 0
|
||||
movs r2, 0x8
|
||||
bl CpuFastSet
|
||||
ldr r1, [r6]
|
||||
ldr r0, =0x000010b4
|
||||
adds r1, r0
|
||||
b _0811FA1E
|
||||
.pool
|
||||
_0811F9D8:
|
||||
ldr r0, =0x0203a124
|
||||
ldr r0, [r0]
|
||||
ldr r0, [r0, 0x2C]
|
||||
adds r0, 0x60
|
||||
adds r1, r5, 0
|
||||
movs r2, 0x8
|
||||
bl CpuFastSet
|
||||
movs r4, 0
|
||||
adds r7, r5, 0
|
||||
adds r7, 0xE0
|
||||
_0811F9EE:
|
||||
ldr r6, =0x0203a124
|
||||
ldr r0, [r6]
|
||||
ldr r0, [r0, 0x2C]
|
||||
adds r0, 0x80
|
||||
adds r4, 0x1
|
||||
lsls r1, r4, 5
|
||||
adds r1, r5, r1
|
||||
movs r2, 0x8
|
||||
bl CpuFastSet
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
cmp r4, 0x5
|
||||
bls _0811F9EE
|
||||
ldr r0, [r6]
|
||||
ldr r0, [r0, 0x2C]
|
||||
adds r0, 0xA0
|
||||
adds r1, r7, 0
|
||||
movs r2, 0x8
|
||||
bl CpuFastSet
|
||||
ldr r1, [r6]
|
||||
ldr r2, =0x000010b4
|
||||
adds r1, r2
|
||||
_0811FA1E:
|
||||
ldrb r0, [r1]
|
||||
adds r0, 0x1
|
||||
strb r0, [r1]
|
||||
b _0811FA88
|
||||
.pool
|
||||
_0811FA30:
|
||||
ldr r0, [r1, 0x2C]
|
||||
adds r0, 0xC0
|
||||
adds r1, r5, 0
|
||||
movs r2, 0x8
|
||||
bl CpuFastSet
|
||||
movs r4, 0
|
||||
adds r7, r5, 0
|
||||
adds r7, 0xE0
|
||||
_0811FA42:
|
||||
ldr r6, =0x0203a124
|
||||
ldr r0, [r6]
|
||||
ldr r0, [r0, 0x2C]
|
||||
adds r0, 0xE0
|
||||
adds r4, 0x1
|
||||
lsls r1, r4, 5
|
||||
adds r1, r5, r1
|
||||
movs r2, 0x8
|
||||
bl CpuFastSet
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
cmp r4, 0x5
|
||||
bls _0811FA42
|
||||
ldr r0, [r6]
|
||||
ldr r0, [r0, 0x2C]
|
||||
movs r1, 0x80
|
||||
lsls r1, 1
|
||||
adds r0, r1
|
||||
adds r1, r7, 0
|
||||
movs r2, 0x8
|
||||
bl CpuFastSet
|
||||
ldr r1, [r6]
|
||||
ldr r2, =0x000010b4
|
||||
adds r1, r2
|
||||
ldrb r0, [r1]
|
||||
adds r0, 0x1
|
||||
strb r0, [r1]
|
||||
_0811FA7C:
|
||||
movs r0, 0
|
||||
b _0811FA8A
|
||||
.pool
|
||||
_0811FA88:
|
||||
movs r0, 0x1
|
||||
_0811FA8A:
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_811F960
|
||||
|
||||
thumb_func_start sub_811FA90
|
||||
sub_811FA90: @ 811FA90
|
||||
push {lr}
|
||||
bl sub_811F918
|
||||
_0811FA96:
|
||||
bl sub_811F960
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _0811FA96
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_811FA90
|
||||
|
||||
thumb_func_start sub_811FAA4
|
||||
sub_811FAA4: @ 811FAA4
|
||||
push {r4-r7,lr}
|
||||
lsls r1, 16
|
||||
lsrs r5, r1, 16
|
||||
lsls r2, 16
|
||||
lsrs r6, r2, 16
|
||||
ldr r2, =0x0203a124
|
||||
ldr r3, [r2]
|
||||
movs r1, 0
|
||||
strb r1, [r3, 0x5]
|
||||
ldr r1, [r2]
|
||||
strb r0, [r1, 0x4]
|
||||
movs r3, 0
|
||||
adds r7, r2, 0
|
||||
adds r4, r7, 0
|
||||
movs r2, 0x1
|
||||
_0811FAC2:
|
||||
ldr r0, [r4]
|
||||
adds r1, r0, 0x6
|
||||
adds r1, r3
|
||||
ldrb r0, [r0, 0x4]
|
||||
asrs r0, r3
|
||||
ands r0, r2
|
||||
strb r0, [r1]
|
||||
adds r0, r3, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r3, r0, 16
|
||||
cmp r3, 0x3
|
||||
bls _0811FAC2
|
||||
lsls r0, r5, 16
|
||||
asrs r0, 16
|
||||
lsls r1, r6, 16
|
||||
asrs r1, 16
|
||||
ldr r3, [r7]
|
||||
ldrh r2, [r3]
|
||||
ldrh r3, [r3, 0x2]
|
||||
bl sub_811FC80
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_811FAA4
|
||||
|
||||
thumb_func_start sub_811FAF8
|
||||
sub_811FAF8: @ 811FAF8
|
||||
push {r4-r7,lr}
|
||||
movs r5, 0
|
||||
ldr r4, =0x0203a124
|
||||
_0811FAFE:
|
||||
ldr r0, [r4]
|
||||
ldrh r0, [r0]
|
||||
adds r0, r5, r0
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
bl FreeObjectTilesByTag
|
||||
ldr r0, [r4]
|
||||
ldrh r0, [r0, 0x2]
|
||||
adds r0, r5, r0
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
bl FreeObjectPaletteByTag
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
cmp r5, 0x1
|
||||
bls _0811FAFE
|
||||
movs r5, 0
|
||||
ldr r6, =0x0203a124
|
||||
_0811FB28:
|
||||
ldr r0, [r6]
|
||||
lsls r4, r5, 2
|
||||
adds r0, 0xC
|
||||
adds r0, r4
|
||||
ldr r0, [r0]
|
||||
cmp r0, 0
|
||||
beq _0811FB9A
|
||||
bl RemoveObjectAndFreeTiles
|
||||
ldr r0, [r6]
|
||||
adds r0, 0xC
|
||||
adds r0, r4
|
||||
movs r1, 0
|
||||
str r1, [r0]
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
cmp r5, 0x1
|
||||
bls _0811FB28
|
||||
movs r5, 0
|
||||
ldr r6, =0x0203a124
|
||||
_0811FB52:
|
||||
ldr r0, [r6]
|
||||
lsls r4, r5, 2
|
||||
adds r0, 0x14
|
||||
adds r0, r4
|
||||
ldr r0, [r0]
|
||||
cmp r0, 0
|
||||
beq _0811FB9A
|
||||
bl RemoveObjectAndFreeTiles
|
||||
ldr r0, [r6]
|
||||
adds r0, 0x14
|
||||
adds r0, r4
|
||||
movs r7, 0
|
||||
str r7, [r0]
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
cmp r5, 0x3
|
||||
bls _0811FB52
|
||||
ldr r4, =0x0203a124
|
||||
ldr r0, [r4]
|
||||
ldr r0, [r0, 0x24]
|
||||
cmp r0, 0
|
||||
beq _0811FB8A
|
||||
bl RemoveObjectAndFreeTiles
|
||||
ldr r0, [r4]
|
||||
str r7, [r0, 0x24]
|
||||
_0811FB8A:
|
||||
ldr r0, [r4]
|
||||
ldr r0, [r0, 0x28]
|
||||
cmp r0, 0
|
||||
beq _0811FB9A
|
||||
bl RemoveObjectAndFreeTiles
|
||||
ldr r0, [r4]
|
||||
str r7, [r0, 0x28]
|
||||
_0811FB9A:
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_811FAF8
|
||||
|
||||
thumb_func_start sub_811FBA4
|
||||
sub_811FBA4: @ 811FBA4
|
||||
push {r4,r5,lr}
|
||||
ldr r0, =0x030022c0
|
||||
ldrh r1, [r0, 0x2E]
|
||||
movs r0, 0x40
|
||||
ands r0, r1
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
cmp r5, 0
|
||||
beq _0811FBDC
|
||||
movs r0, 0x5
|
||||
bl audio_play
|
||||
ldr r2, =0x0203a124
|
||||
ldr r1, [r2]
|
||||
ldrb r0, [r1, 0x5]
|
||||
subs r0, 0x1
|
||||
strb r0, [r1, 0x5]
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bge _0811FC64
|
||||
ldr r1, [r2]
|
||||
movs r0, 0x5
|
||||
strb r0, [r1, 0x5]
|
||||
b _0811FC64
|
||||
.pool
|
||||
_0811FBDC:
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
cmp r4, 0
|
||||
beq _0811FC0C
|
||||
movs r0, 0x5
|
||||
bl audio_play
|
||||
ldr r2, =0x0203a124
|
||||
ldr r1, [r2]
|
||||
ldrb r0, [r1, 0x5]
|
||||
adds r0, 0x1
|
||||
strb r0, [r1, 0x5]
|
||||
lsls r0, 24
|
||||
asrs r0, 24
|
||||
cmp r0, 0x5
|
||||
ble _0811FC64
|
||||
ldr r0, [r2]
|
||||
strb r5, [r0, 0x5]
|
||||
b _0811FC64
|
||||
.pool
|
||||
_0811FC0C:
|
||||
movs r0, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _0811FC68
|
||||
movs r0, 0x5
|
||||
bl audio_play
|
||||
ldr r2, =0x0203a124
|
||||
ldr r0, [r2]
|
||||
movs r1, 0x5
|
||||
ldrsb r1, [r0, r1]
|
||||
cmp r1, 0x4
|
||||
beq _0811FC40
|
||||
cmp r1, 0x5
|
||||
beq _0811FC76
|
||||
adds r0, 0x6
|
||||
adds r1, r0, r1
|
||||
movs r2, 0
|
||||
ldrb r0, [r1]
|
||||
cmp r0, 0
|
||||
bne _0811FC62
|
||||
movs r2, 0x1
|
||||
b _0811FC62
|
||||
.pool
|
||||
_0811FC40:
|
||||
strb r4, [r0, 0x4]
|
||||
movs r3, 0
|
||||
adds r4, r2, 0
|
||||
_0811FC46:
|
||||
ldr r2, [r4]
|
||||
adds r0, r2, 0x6
|
||||
adds r0, r3
|
||||
ldrb r0, [r0]
|
||||
lsls r0, r3
|
||||
ldrb r1, [r2, 0x4]
|
||||
orrs r0, r1
|
||||
strb r0, [r2, 0x4]
|
||||
adds r0, r3, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r3, r0, 16
|
||||
cmp r3, 0x3
|
||||
bls _0811FC46
|
||||
b _0811FC76
|
||||
_0811FC62:
|
||||
strb r2, [r1]
|
||||
_0811FC64:
|
||||
movs r0, 0x1
|
||||
b _0811FC78
|
||||
_0811FC68:
|
||||
movs r0, 0x2
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _0811FC64
|
||||
movs r0, 0x5
|
||||
bl audio_play
|
||||
_0811FC76:
|
||||
movs r0, 0
|
||||
_0811FC78:
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_811FBA4
|
||||
|
||||
thumb_func_start sub_811FC80
|
||||
sub_811FC80: @ 811FC80
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x50
|
||||
mov r8, r0
|
||||
mov r9, r1
|
||||
adds r5, r2, 0
|
||||
adds r6, r3, 0
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
mov r8, r0
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
mov r9, r1
|
||||
lsls r5, 16
|
||||
lsrs r5, 16
|
||||
lsls r6, 16
|
||||
lsrs r6, 16
|
||||
ldr r4, =0x0203a124
|
||||
ldr r0, [r4]
|
||||
adds r0, 0x34
|
||||
str r0, [sp, 0x18]
|
||||
add r1, sp, 0x1C
|
||||
movs r7, 0
|
||||
movs r0, 0x80
|
||||
lsls r0, 5
|
||||
strh r0, [r1]
|
||||
mov r0, sp
|
||||
adds r0, 0x1E
|
||||
strh r5, [r0]
|
||||
add r1, sp, 0x20
|
||||
ldr r0, =gUnknown_08DC9628
|
||||
str r0, [sp, 0x20]
|
||||
movs r0, 0xC8
|
||||
lsls r0, 2
|
||||
strh r0, [r1, 0x4]
|
||||
adds r0, r5, 0x1
|
||||
strh r0, [r1, 0x6]
|
||||
add r0, sp, 0x28
|
||||
movs r1, 0
|
||||
movs r2, 0x8
|
||||
bl memset
|
||||
add r2, sp, 0x18
|
||||
mov r10, r2
|
||||
mov r0, sp
|
||||
mov r1, r10
|
||||
movs r2, 0x18
|
||||
bl memcpy
|
||||
ldr r0, [r4]
|
||||
ldr r0, [r0, 0x30]
|
||||
str r0, [sp, 0x30]
|
||||
add r0, sp, 0x34
|
||||
strh r6, [r0]
|
||||
add r1, sp, 0x38
|
||||
ldr r0, =gUnknown_08DC9608
|
||||
str r0, [sp, 0x38]
|
||||
adds r0, r6, 0x1
|
||||
strh r0, [r1, 0x4]
|
||||
add r0, sp, 0x40
|
||||
movs r1, 0
|
||||
movs r2, 0x8
|
||||
bl memset
|
||||
add r4, sp, 0x30
|
||||
mov r0, r10
|
||||
adds r1, r4, 0
|
||||
movs r2, 0x18
|
||||
bl memcpy
|
||||
strh r5, [r4]
|
||||
strh r6, [r4, 0x2]
|
||||
ldr r0, =gUnknown_0859EE7C
|
||||
str r0, [r4, 0x4]
|
||||
ldr r0, =gUnknown_0859EF14
|
||||
str r0, [r4, 0x8]
|
||||
str r7, [r4, 0xC]
|
||||
ldr r0, =gDummyObjectRotScalAnimTable
|
||||
str r0, [r4, 0x10]
|
||||
ldr r0, =TaskDummy7
|
||||
str r0, [r4, 0x14]
|
||||
mov r0, sp
|
||||
bl LoadObjectPics
|
||||
mov r0, r10
|
||||
bl LoadTaggedObjectPalettes
|
||||
movs r5, 0
|
||||
mov r3, r8
|
||||
lsls r3, 16
|
||||
mov r8, r3
|
||||
movs r0, 0x80
|
||||
lsls r0, 14
|
||||
add r0, r8
|
||||
mov r10, r0
|
||||
mov r1, r8
|
||||
str r1, [sp, 0x48]
|
||||
mov r2, r9
|
||||
lsls r2, 16
|
||||
mov r9, r2
|
||||
movs r7, 0x80
|
||||
lsls r7, 14
|
||||
add r7, r9
|
||||
mov r3, r9
|
||||
str r3, [sp, 0x4C]
|
||||
_0811FD58:
|
||||
adds r0, r4, 0
|
||||
mov r2, r10
|
||||
asrs r1, r2, 16
|
||||
asrs r2, r7, 16
|
||||
movs r3, 0x1
|
||||
bl AddObjectToFront
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
cmp r3, 0x40
|
||||
bne _0811FD70
|
||||
b _0811FEFC
|
||||
_0811FD70:
|
||||
ldr r6, =0x0203a124
|
||||
ldr r2, [r6]
|
||||
lsls r0, r5, 2
|
||||
adds r2, 0xC
|
||||
adds r2, r0
|
||||
lsls r0, r3, 4
|
||||
adds r0, r3
|
||||
lsls r0, 2
|
||||
ldr r1, =0x02020630
|
||||
adds r0, r1
|
||||
str r0, [r2]
|
||||
lsls r1, r5, 24
|
||||
lsrs r1, 24
|
||||
bl StartObjectImageAnim
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
cmp r5, 0x1
|
||||
bls _0811FD58
|
||||
ldr r0, [r6]
|
||||
ldr r1, [r0, 0x10]
|
||||
ldr r3, [sp, 0x4C]
|
||||
asrs r0, r3, 16
|
||||
adds r0, 0x60
|
||||
strh r0, [r1, 0x22]
|
||||
ldrh r0, [r4]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4]
|
||||
ldrh r0, [r4, 0x2]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0x2]
|
||||
ldr r0, =gUnknown_0859EEDC
|
||||
str r0, [r4, 0x8]
|
||||
ldr r0, =sub_811FF40
|
||||
str r0, [r4, 0x14]
|
||||
ldr r0, =gUnknown_0859EE84
|
||||
str r0, [r4, 0x4]
|
||||
movs r5, 0
|
||||
ldr r0, [sp, 0x48]
|
||||
movs r1, 0x80
|
||||
lsls r1, 14
|
||||
adds r0, r1
|
||||
mov r9, r0
|
||||
_0811FDC8:
|
||||
lsls r2, r5, 4
|
||||
adds r2, 0x10
|
||||
ldr r3, [sp, 0x4C]
|
||||
asrs r3, 16
|
||||
mov r8, r3
|
||||
add r2, r8
|
||||
lsls r2, 16
|
||||
asrs r2, 16
|
||||
adds r0, r4, 0
|
||||
mov r3, r9
|
||||
asrs r1, r3, 16
|
||||
movs r3, 0
|
||||
bl AddObjectToFront
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
cmp r3, 0x40
|
||||
bne _0811FDEE
|
||||
b _0811FF0C
|
||||
_0811FDEE:
|
||||
ldr r6, =0x0203a124
|
||||
ldr r1, [r6]
|
||||
lsls r0, r5, 2
|
||||
adds r1, 0x14
|
||||
adds r1, r0
|
||||
lsls r0, r3, 4
|
||||
adds r0, r3
|
||||
lsls r0, 2
|
||||
ldr r7, =0x02020630
|
||||
adds r0, r7
|
||||
str r0, [r1]
|
||||
strh r5, [r0, 0x2E]
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
cmp r5, 0x3
|
||||
bls _0811FDC8
|
||||
ldr r0, =DummyObjectCallback
|
||||
str r0, [r4, 0x14]
|
||||
adds r0, r4, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl AddObjectToFront
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
cmp r3, 0x40
|
||||
beq _0811FEA8
|
||||
ldr r0, [r6]
|
||||
lsls r1, r3, 4
|
||||
adds r1, r3
|
||||
lsls r1, 2
|
||||
adds r1, r7
|
||||
str r1, [r0, 0x28]
|
||||
ldrb r3, [r1, 0x1]
|
||||
movs r2, 0x3F
|
||||
adds r0, r2, 0
|
||||
ands r0, r3
|
||||
strb r0, [r1, 0x1]
|
||||
ldr r0, [r6]
|
||||
ldr r1, [r0, 0x28]
|
||||
ldrb r0, [r1, 0x3]
|
||||
ands r2, r0
|
||||
movs r0, 0x80
|
||||
orrs r2, r0
|
||||
strb r2, [r1, 0x3]
|
||||
ldr r0, [r6]
|
||||
ldr r0, [r0, 0x28]
|
||||
movs r1, 0x9
|
||||
bl StartObjectImageAnim
|
||||
ldr r1, [r6]
|
||||
ldr r2, [r1, 0x28]
|
||||
ldr r3, [sp, 0x48]
|
||||
asrs r0, r3, 16
|
||||
adds r0, 0x20
|
||||
strh r0, [r2, 0x20]
|
||||
ldr r2, [r1, 0x28]
|
||||
mov r0, r8
|
||||
adds r0, 0x50
|
||||
strh r0, [r2, 0x22]
|
||||
ldr r0, [r1, 0x28]
|
||||
movs r1, 0x1
|
||||
movs r2, 0x2
|
||||
movs r3, 0
|
||||
bl CalcVecFromObjectCenterToObjectUpperLeft
|
||||
b _0811FEAE
|
||||
.pool
|
||||
_0811FEA8:
|
||||
ldr r1, [r6]
|
||||
movs r0, 0
|
||||
str r0, [r1, 0x28]
|
||||
_0811FEAE:
|
||||
ldr r0, =sub_811FF7C
|
||||
str r0, [r4, 0x14]
|
||||
ldr r0, [sp, 0x48]
|
||||
movs r2, 0xC0
|
||||
lsls r2, 12
|
||||
adds r1, r0, r2
|
||||
asrs r1, 16
|
||||
adds r0, r4, 0
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl AddObjectToFront
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
cmp r3, 0x40
|
||||
beq _0811FF20
|
||||
ldr r0, =0x0203a124
|
||||
ldr r2, [r0]
|
||||
lsls r1, r3, 4
|
||||
adds r1, r3
|
||||
lsls r1, 2
|
||||
ldr r0, =0x02020630
|
||||
adds r1, r0
|
||||
str r1, [r2, 0x24]
|
||||
ldr r3, [sp, 0x4C]
|
||||
asrs r0, r3, 16
|
||||
adds r0, 0x10
|
||||
strh r0, [r1, 0x2E]
|
||||
ldr r0, [r2, 0x24]
|
||||
movs r1, 0x8
|
||||
bl StartObjectImageAnim
|
||||
b _0811FF28
|
||||
.pool
|
||||
_0811FEFC:
|
||||
ldr r0, =0x0203a124
|
||||
ldr r0, [r0]
|
||||
lsls r1, r5, 2
|
||||
adds r0, 0xC
|
||||
b _0811FF14
|
||||
.pool
|
||||
_0811FF0C:
|
||||
ldr r0, =0x0203a124
|
||||
ldr r0, [r0]
|
||||
lsls r1, r5, 2
|
||||
adds r0, 0x14
|
||||
_0811FF14:
|
||||
adds r0, r1
|
||||
movs r1, 0
|
||||
str r1, [r0]
|
||||
b _0811FF28
|
||||
.pool
|
||||
_0811FF20:
|
||||
ldr r0, =0x0203a124
|
||||
ldr r1, [r0]
|
||||
movs r0, 0
|
||||
str r0, [r1, 0x24]
|
||||
_0811FF28:
|
||||
add sp, 0x50
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_811FC80
|
||||
|
||||
thumb_func_start TaskDummy7
|
||||
TaskDummy7: @ 811FF3C
|
||||
bx lr
|
||||
thumb_func_end TaskDummy7
|
||||
|
||||
thumb_func_start sub_811FF40
|
||||
sub_811FF40: @ 811FF40
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
ldr r0, =0x0203a124
|
||||
ldr r0, [r0]
|
||||
movs r3, 0x2E
|
||||
ldrsh r1, [r2, r3]
|
||||
adds r0, 0x6
|
||||
adds r0, r1
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0
|
||||
beq _0811FF6C
|
||||
lsls r1, 1
|
||||
adds r1, 0x1
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r2, 0
|
||||
bl StartObjectImageAnim
|
||||
b _0811FF76
|
||||
.pool
|
||||
_0811FF6C:
|
||||
lsls r1, 25
|
||||
lsrs r1, 24
|
||||
adds r0, r2, 0
|
||||
bl StartObjectImageAnim
|
||||
_0811FF76:
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_811FF40
|
||||
|
||||
thumb_func_start sub_811FF7C
|
||||
sub_811FF7C: @ 811FF7C
|
||||
ldr r1, =0x0203a124
|
||||
ldr r1, [r1]
|
||||
ldrb r1, [r1, 0x5]
|
||||
lsls r1, 24
|
||||
asrs r1, 24
|
||||
lsls r1, 4
|
||||
ldrh r2, [r0, 0x2E]
|
||||
adds r1, r2
|
||||
strh r1, [r0, 0x22]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sub_811FF7C
|
||||
|
||||
thumb_func_start sub_811FF94
|
||||
sub_811FF94: @ 811FF94
|
||||
push {lr}
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
cmp r2, 0
|
||||
bne _0811FFA4
|
||||
ldr r2, =gUnknown_0859E65C
|
||||
_0811FFA4:
|
||||
movs r3, 0x10
|
||||
bl sub_811FFD4
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_811FF94
|
||||
|
||||
thumb_func_start sub_811FFB4
|
||||
sub_811FFB4: @ 811FFB4
|
||||
push {lr}
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
cmp r2, 0
|
||||
bne _0811FFC4
|
||||
ldr r2, =gUnknown_0859E65C
|
||||
_0811FFC4:
|
||||
movs r3, 0x1
|
||||
bl sub_811FFD4
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_811FFB4
|
||||
|
||||
thumb_func_start sub_811FFD4
|
||||
sub_811FFD4: @ 811FFD4
|
||||
push {r4-r6,lr}
|
||||
mov r6, r8
|
||||
push {r6}
|
||||
sub sp, 0x28
|
||||
lsls r0, 16
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
ldr r4, =gUnknown_0859E67C
|
||||
str r4, [sp, 0x18]
|
||||
movs r4, 0x80
|
||||
add r5, sp, 0x18
|
||||
lsrs r6, r0, 16
|
||||
orrs r0, r4
|
||||
str r0, [r5, 0x4]
|
||||
str r2, [sp, 0x20]
|
||||
ldr r0, =0xffff0000
|
||||
mov r8, r0
|
||||
add r4, sp, 0x20
|
||||
ldr r0, [r4, 0x4]
|
||||
mov r2, r8
|
||||
ands r0, r2
|
||||
orrs r0, r1
|
||||
str r0, [r4, 0x4]
|
||||
mov r0, sp
|
||||
movs r2, 0
|
||||
strh r6, [r0]
|
||||
strh r1, [r0, 0x2]
|
||||
ldr r0, =gUnknown_0859EF1C
|
||||
str r0, [sp, 0x4]
|
||||
ldr r0, =gUnknown_0859EFA4
|
||||
str r0, [sp, 0x8]
|
||||
str r2, [sp, 0xC]
|
||||
ldr r0, =gDummyObjectRotScalAnimTable
|
||||
str r0, [sp, 0x10]
|
||||
ldr r0, =TaskDummy7
|
||||
str r0, [sp, 0x14]
|
||||
lsls r3, 23
|
||||
lsrs r3, 16
|
||||
ldr r0, [r5, 0x4]
|
||||
mov r1, r8
|
||||
ands r0, r1
|
||||
orrs r0, r3
|
||||
str r0, [r5, 0x4]
|
||||
adds r0, r5, 0
|
||||
bl LoadObjectPic
|
||||
adds r0, r4, 0
|
||||
bl LoadTaggedObjectPalette
|
||||
mov r0, sp
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl AddObjectToFront
|
||||
lsls r0, 24
|
||||
lsrs r1, r0, 24
|
||||
cmp r1, 0x40
|
||||
bne _08120068
|
||||
movs r0, 0
|
||||
b _08120072
|
||||
.pool
|
||||
_08120068:
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, =0x02020630
|
||||
adds r0, r1
|
||||
_08120072:
|
||||
add sp, 0x28
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_811FFD4
|
||||
|
||||
thumb_func_start sub_8120084
|
||||
sub_8120084: @ 8120084
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 17
|
||||
ldr r2, =gUnknown_0859E67C
|
||||
adds r0, r2
|
||||
movs r2, 0x80
|
||||
movs r3, 0x10
|
||||
bl RequestDma3Copy
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8120084
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
402
asm/money.s
Normal file
402
asm/money.s
Normal file
@ -0,0 +1,402 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start DecryptMoney
|
||||
@ int DecryptMoney(u32 *moneyPointer)
|
||||
DecryptMoney: @ 80E5114
|
||||
ldr r1, =0x03005d90
|
||||
ldr r1, [r1]
|
||||
adds r1, 0xAC
|
||||
ldr r0, [r0]
|
||||
ldr r1, [r1]
|
||||
eors r0, r1
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end DecryptMoney
|
||||
|
||||
thumb_func_start EncryptMoney
|
||||
@ void EncryptMoney(u32 *moneyPointer, u32 moneyAmount)
|
||||
EncryptMoney: @ 80E5128
|
||||
ldr r2, =0x03005d90
|
||||
ldr r2, [r2]
|
||||
adds r2, 0xAC
|
||||
ldr r2, [r2]
|
||||
eors r2, r1
|
||||
str r2, [r0]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end EncryptMoney
|
||||
|
||||
thumb_func_start IsEnoughMoney
|
||||
@ bool8 IsEnoughMoney(u32 *moneyPointer, u32 price)
|
||||
IsEnoughMoney: @ 80E513C
|
||||
push {r4,lr}
|
||||
adds r4, r1, 0
|
||||
bl DecryptMoney
|
||||
cmp r0, r4
|
||||
bcs _080E514C
|
||||
movs r0, 0
|
||||
b _080E514E
|
||||
_080E514C:
|
||||
movs r0, 0x1
|
||||
_080E514E:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end IsEnoughMoney
|
||||
|
||||
thumb_func_start add_money
|
||||
@ void add_money(int *money_ptr, int amount)
|
||||
add_money: @ 80E5154
|
||||
push {r4-r6,lr}
|
||||
adds r6, r0, 0
|
||||
adds r4, r1, 0
|
||||
bl DecryptMoney
|
||||
adds r5, r0, 0
|
||||
adds r0, r5, r4
|
||||
ldr r5, =0x000f423f
|
||||
adds r4, r5, 0
|
||||
cmp r0, r5
|
||||
bhi _080E5178
|
||||
adds r5, r0, 0
|
||||
adds r0, r6, 0
|
||||
bl DecryptMoney
|
||||
cmp r5, r0
|
||||
bcs _080E5178
|
||||
adds r5, r4, 0
|
||||
_080E5178:
|
||||
adds r0, r6, 0
|
||||
adds r1, r5, 0
|
||||
bl EncryptMoney
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end add_money
|
||||
|
||||
thumb_func_start subtract_money
|
||||
@ void subtract_money(int *money_ptr, int amount)
|
||||
subtract_money: @ 80E518C
|
||||
push {r4,r5,lr}
|
||||
adds r5, r0, 0
|
||||
adds r4, r1, 0
|
||||
bl DecryptMoney
|
||||
adds r1, r0, 0
|
||||
cmp r1, r4
|
||||
bcs _080E51A0
|
||||
movs r1, 0
|
||||
b _080E51A2
|
||||
_080E51A0:
|
||||
subs r1, r4
|
||||
_080E51A2:
|
||||
adds r0, r5, 0
|
||||
bl EncryptMoney
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end subtract_money
|
||||
|
||||
thumb_func_start sub_80E51B0
|
||||
sub_80E51B0: @ 80E51B0
|
||||
push {lr}
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r0, [r0]
|
||||
movs r1, 0x92
|
||||
lsls r1, 3
|
||||
adds r0, r1
|
||||
ldr r1, =0x020375e2
|
||||
ldrh r1, [r1]
|
||||
bl IsEnoughMoney
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_80E51B0
|
||||
|
||||
thumb_func_start sub_80E51D4
|
||||
sub_80E51D4: @ 80E51D4
|
||||
push {lr}
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r0, [r0]
|
||||
movs r1, 0x92
|
||||
lsls r1, 3
|
||||
adds r0, r1
|
||||
ldr r1, =0x020375e2
|
||||
ldrh r1, [r1]
|
||||
bl subtract_money
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80E51D4
|
||||
|
||||
thumb_func_start PrintMoneyAmountInMoneyBox
|
||||
@ void PrintMoneyAmountInMoneyBox(u8 windowId, int amount, s8 a3)
|
||||
PrintMoneyAmountInMoneyBox: @ 80E51F4
|
||||
push {lr}
|
||||
sub sp, 0x4
|
||||
adds r3, r1, 0
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
str r2, [sp]
|
||||
movs r1, 0x26
|
||||
movs r2, 0x1
|
||||
bl PrintMoneyAmount
|
||||
add sp, 0x4
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end PrintMoneyAmountInMoneyBox
|
||||
|
||||
thumb_func_start PrintMoneyAmount
|
||||
@ void PrintMoneyAmount(u8 windowId, char x, char y, int amount, u8 a5)
|
||||
PrintMoneyAmount: @ 80E5214
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
sub sp, 0xC
|
||||
ldr r4, [sp, 0x24]
|
||||
lsls r0, 24
|
||||
lsrs r7, r0, 24
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
mov r8, r1
|
||||
lsls r2, 24
|
||||
lsrs r6, r2, 24
|
||||
lsls r4, 24
|
||||
lsrs r5, r4, 24
|
||||
ldr r4, =0x02021cc4
|
||||
adds r0, r4, 0
|
||||
adds r1, r3, 0
|
||||
movs r2, 0
|
||||
movs r3, 0x6
|
||||
bl ConvertIntToDecimalString
|
||||
adds r0, r4, 0
|
||||
bl GetStringLength
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
movs r1, 0x6
|
||||
subs r1, r0
|
||||
ldr r2, =0x02021fc4
|
||||
adds r0, r1, 0
|
||||
subs r1, 0x1
|
||||
cmp r0, 0
|
||||
ble _080E5264
|
||||
movs r3, 0x77
|
||||
_080E5258:
|
||||
strb r3, [r2]
|
||||
adds r2, 0x1
|
||||
adds r0, r1, 0
|
||||
subs r1, 0x1
|
||||
cmp r0, 0
|
||||
bgt _080E5258
|
||||
_080E5264:
|
||||
ldr r1, =gUnknown_085E969C
|
||||
adds r0, r2, 0
|
||||
bl ExpandStringRefs
|
||||
ldr r2, =0x02021fc4
|
||||
str r6, [sp]
|
||||
str r5, [sp, 0x4]
|
||||
movs r0, 0
|
||||
str r0, [sp, 0x8]
|
||||
adds r0, r7, 0
|
||||
movs r1, 0x1
|
||||
mov r3, r8
|
||||
bl Print
|
||||
add sp, 0xC
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end PrintMoneyAmount
|
||||
|
||||
thumb_func_start set_window_border_style_and_print_money_box
|
||||
@ void set_window_border_style_and_print_money_box(u8 windowId, u16 tileStart, u8 palette, int amount)
|
||||
set_window_border_style_and_print_money_box: @ 80E5298
|
||||
push {r4-r6,lr}
|
||||
mov r6, r8
|
||||
push {r6}
|
||||
adds r6, r0, 0
|
||||
adds r4, r1, 0
|
||||
adds r5, r2, 0
|
||||
mov r8, r3
|
||||
lsls r6, 24
|
||||
lsrs r6, 24
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
lsls r5, 24
|
||||
lsrs r5, 24
|
||||
adds r0, r6, 0
|
||||
movs r1, 0
|
||||
adds r2, r4, 0
|
||||
adds r3, r5, 0
|
||||
bl SetWindowBorderStyle
|
||||
adds r0, r6, 0
|
||||
mov r1, r8
|
||||
movs r2, 0
|
||||
bl PrintMoneyAmountInMoneyBox
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end set_window_border_style_and_print_money_box
|
||||
|
||||
thumb_func_start sub_80E52D4
|
||||
sub_80E52D4: @ 80E52D4
|
||||
push {lr}
|
||||
adds r1, r0, 0
|
||||
ldr r0, =0x02039f98
|
||||
ldrb r0, [r0]
|
||||
movs r2, 0
|
||||
bl PrintMoneyAmountInMoneyBox
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80E52D4
|
||||
|
||||
thumb_func_start sub_80E52EC
|
||||
@ void sub_80E52EC(int money, int x, int y)
|
||||
sub_80E52EC: @ 80E52EC
|
||||
push {r4-r6,lr}
|
||||
mov r6, r8
|
||||
push {r6}
|
||||
sub sp, 0x18
|
||||
mov r8, r0
|
||||
adds r4, r1, 0
|
||||
adds r3, r2, 0
|
||||
lsls r4, 24
|
||||
lsls r3, 24
|
||||
lsrs r6, r4, 24
|
||||
movs r0, 0x80
|
||||
lsls r0, 17
|
||||
adds r4, r0
|
||||
lsrs r4, 24
|
||||
lsrs r5, r3, 24
|
||||
adds r3, r0
|
||||
lsrs r3, 24
|
||||
movs r0, 0xA
|
||||
str r0, [sp]
|
||||
movs r0, 0x2
|
||||
str r0, [sp, 0x4]
|
||||
movs r0, 0xF
|
||||
str r0, [sp, 0x8]
|
||||
movs r0, 0x8
|
||||
str r0, [sp, 0xC]
|
||||
add r0, sp, 0x10
|
||||
movs r1, 0
|
||||
adds r2, r4, 0
|
||||
bl rbox_template_set
|
||||
ldr r4, =0x02039f98
|
||||
add r0, sp, 0x10
|
||||
bl AddWindow
|
||||
strb r0, [r4]
|
||||
ldrb r0, [r4]
|
||||
movs r1, 0
|
||||
bl FillWindowPixelBuffer
|
||||
ldrb r0, [r4]
|
||||
bl PutWindowTilemap
|
||||
ldrb r0, [r4]
|
||||
movs r1, 0x1
|
||||
bl CopyWindowToVram
|
||||
ldrb r0, [r4]
|
||||
movs r1, 0x85
|
||||
lsls r1, 2
|
||||
movs r2, 0xE
|
||||
mov r3, r8
|
||||
bl set_window_border_style_and_print_money_box
|
||||
lsls r6, 19
|
||||
movs r0, 0x98
|
||||
lsls r0, 13
|
||||
adds r6, r0
|
||||
lsrs r6, 16
|
||||
lsls r5, 19
|
||||
movs r0, 0xB0
|
||||
lsls r0, 12
|
||||
adds r5, r0
|
||||
lsrs r5, 16
|
||||
adds r0, r6, 0
|
||||
adds r1, r5, 0
|
||||
bl AddMoneyLabelObject
|
||||
add sp, 0x18
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80E52EC
|
||||
|
||||
thumb_func_start sub_80E5384
|
||||
sub_80E5384: @ 80E5384
|
||||
push {r4,lr}
|
||||
bl RemoveMoneyLabelObject
|
||||
ldr r4, =0x02039f98
|
||||
ldrb r0, [r4]
|
||||
movs r1, 0
|
||||
bl sub_8198070
|
||||
ldrb r0, [r4]
|
||||
movs r1, 0x2
|
||||
bl CopyWindowToVram
|
||||
ldrb r0, [r4]
|
||||
bl RemoveWindow
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80E5384
|
||||
|
||||
thumb_func_start AddMoneyLabelObject
|
||||
AddMoneyLabelObject: @ 80E53AC
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
adds r5, r1, 0
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
lsls r5, 16
|
||||
lsrs r5, 16
|
||||
ldr r0, =gUnknown_0858C2A4
|
||||
bl LoadCompressedObjectPic
|
||||
ldr r0, =gUnknown_0858C2AC
|
||||
bl LoadCompressedObjectPalette
|
||||
ldr r0, =gUnknown_0858C28C
|
||||
lsls r4, 16
|
||||
asrs r4, 16
|
||||
lsls r5, 16
|
||||
asrs r5, 16
|
||||
adds r1, r4, 0
|
||||
adds r2, r5, 0
|
||||
movs r3, 0
|
||||
bl AddObjectToFront
|
||||
ldr r1, =0x02039f99
|
||||
strb r0, [r1]
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end AddMoneyLabelObject
|
||||
|
||||
thumb_func_start RemoveMoneyLabelObject
|
||||
RemoveMoneyLabelObject: @ 80E53F4
|
||||
push {lr}
|
||||
ldr r0, =0x02039f99
|
||||
ldrb r1, [r0]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, =0x02020630
|
||||
adds r0, r1
|
||||
bl RemoveObjectAndFreeResources
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end RemoveMoneyLabelObject
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
@ -1,4 +1,5 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
|
669
asm/mystery_event_menu.s
Normal file
669
asm/mystery_event_menu.s
Normal file
@ -0,0 +1,669 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_8178944
|
||||
sub_8178944: @ 8178944
|
||||
push {lr}
|
||||
bl LoadOamFromSprites
|
||||
bl ProcessObjectCopyRequests
|
||||
bl copy_pal_bg_faded_to_pal_ram
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_8178944
|
||||
|
||||
thumb_func_start sub_8178958
|
||||
sub_8178958: @ 8178958
|
||||
push {lr}
|
||||
movs r2, 0
|
||||
ldr r1, =0x020229e8
|
||||
ldrh r0, [r1, 0x1A]
|
||||
ldrh r1, [r1, 0x36]
|
||||
cmp r0, r1
|
||||
bne _08178968
|
||||
movs r2, 0x1
|
||||
_08178968:
|
||||
adds r0, r2, 0
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_8178958
|
||||
|
||||
thumb_func_start sub_8178974
|
||||
sub_8178974: @ 8178974
|
||||
push {r4,lr}
|
||||
sub sp, 0x8
|
||||
bl ResetAllObjectData
|
||||
bl ResetObjectPaletteAllocator
|
||||
bl ResetTasks
|
||||
ldr r0, =sub_8178944
|
||||
bl SetVBlankCallback
|
||||
movs r0, 0
|
||||
bl ResetBgsAndClearDma3BusyFlags
|
||||
ldr r1, =gUnknown_085EFD64
|
||||
movs r0, 0
|
||||
movs r2, 0x1
|
||||
bl InitBgsFromTemplates
|
||||
ldr r0, =gUnknown_085EFD68
|
||||
bl InitWindows
|
||||
lsls r0, 16
|
||||
cmp r0, 0
|
||||
beq _08178A22
|
||||
bl DeactivateAllTextPrinters
|
||||
movs r4, 0
|
||||
_081789AC:
|
||||
lsls r0, r4, 24
|
||||
lsrs r0, 24
|
||||
movs r1, 0
|
||||
bl FillWindowPixelBuffer
|
||||
adds r4, 0x1
|
||||
cmp r4, 0x1
|
||||
ble _081789AC
|
||||
movs r0, 0x1E
|
||||
str r0, [sp]
|
||||
movs r0, 0x14
|
||||
str r0, [sp, 0x4]
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl FillBgTilemapBufferRect_Palette0
|
||||
movs r0, 0
|
||||
movs r1, 0x1
|
||||
movs r2, 0xD0
|
||||
bl sub_809882C
|
||||
movs r0, 0xE0
|
||||
bl sub_81978B0
|
||||
movs r1, 0xA0
|
||||
lsls r1, 1
|
||||
movs r0, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x50
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
ldr r0, =sub_8009404
|
||||
movs r1, 0
|
||||
bl CreateTask
|
||||
bl sub_80A2F30
|
||||
bl RunTasks
|
||||
bl CallObjectCallbacks
|
||||
bl PrepareSpritesForOamLoad
|
||||
bl RunTextPrinters
|
||||
bl fade_and_return_progress_probably
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0x2
|
||||
bl rboxid_80040B8
|
||||
ldr r0, =sub_8178A78
|
||||
bl SetMainCallback2
|
||||
_08178A22:
|
||||
add sp, 0x8
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8178974
|
||||
|
||||
thumb_func_start sub_8178A40
|
||||
sub_8178A40: @ 8178A40
|
||||
push {r4-r6,lr}
|
||||
adds r6, r0, 0
|
||||
adds r4, r1, 0
|
||||
movs r5, 0x1
|
||||
cmp r4, 0
|
||||
bne _08178A54
|
||||
ldr r1, =gUnknown_085EE80A
|
||||
bl CopyString
|
||||
movs r5, 0
|
||||
_08178A54:
|
||||
cmp r4, 0x2
|
||||
bne _08178A5A
|
||||
movs r5, 0
|
||||
_08178A5A:
|
||||
cmp r4, 0x1
|
||||
bne _08178A66
|
||||
ldr r1, =gUnknown_085EE827
|
||||
adds r0, r6, 0
|
||||
bl CopyString
|
||||
_08178A66:
|
||||
adds r0, r5, 0
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_8178A40
|
||||
|
||||
thumb_func_start sub_8178A78
|
||||
sub_8178A78: @ 8178A78
|
||||
push {r4-r6,lr}
|
||||
sub sp, 0x8
|
||||
ldr r1, =0x030022c0
|
||||
movs r2, 0x87
|
||||
lsls r2, 3
|
||||
adds r0, r1, r2
|
||||
ldrb r0, [r0]
|
||||
adds r4, r1, 0
|
||||
cmp r0, 0x10
|
||||
bls _08178A8E
|
||||
b _08178E58
|
||||
_08178A8E:
|
||||
lsls r0, 2
|
||||
ldr r1, =_08178AA0
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.pool
|
||||
.align 2, 0
|
||||
_08178AA0:
|
||||
.4byte _08178AE4
|
||||
.4byte _08178B12
|
||||
.4byte _08178B48
|
||||
.4byte _08178B80
|
||||
.4byte _08178BCC
|
||||
.4byte _08178BDC
|
||||
.4byte _08178C54
|
||||
.4byte _08178D28
|
||||
.4byte _08178D38
|
||||
.4byte _08178D58
|
||||
.4byte _08178D60
|
||||
.4byte _08178D74
|
||||
.4byte _08178DBC
|
||||
.4byte _08178DE0
|
||||
.4byte _08178E0C
|
||||
.4byte _08178E24
|
||||
.4byte _08178E48
|
||||
_08178AE4:
|
||||
movs r0, 0
|
||||
movs r1, 0x1
|
||||
movs r2, 0x1
|
||||
movs r3, 0xD
|
||||
bl SetWindowBorderStyle
|
||||
movs r0, 0
|
||||
bl PutWindowTilemap
|
||||
movs r0, 0
|
||||
movs r1, 0x3
|
||||
bl CopyWindowToVram
|
||||
movs r0, 0
|
||||
bl ShowBg
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
movs r1, 0
|
||||
str r1, [sp]
|
||||
movs r2, 0x10
|
||||
movs r3, 0
|
||||
b _08178E30
|
||||
_08178B12:
|
||||
ldr r0, =0x02037fd4
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _08178B20
|
||||
b _08178E58
|
||||
_08178B20:
|
||||
ldr r1, =gUnknown_085EE765
|
||||
movs r0, 0x1
|
||||
str r0, [sp]
|
||||
movs r0, 0
|
||||
movs r2, 0x1
|
||||
movs r3, 0x2
|
||||
bl sub_8178EC4
|
||||
ldr r1, =0x030022c0
|
||||
movs r2, 0x87
|
||||
lsls r2, 3
|
||||
adds r1, r2
|
||||
b _08178E3C
|
||||
.pool
|
||||
_08178B48:
|
||||
movs r0, 0
|
||||
bl IsTextPrinterActive
|
||||
lsls r0, 16
|
||||
cmp r0, 0
|
||||
beq _08178B56
|
||||
b _08178E58
|
||||
_08178B56:
|
||||
ldr r1, =0x030022c0
|
||||
movs r0, 0x87
|
||||
lsls r0, 3
|
||||
adds r1, r0
|
||||
ldrb r0, [r1]
|
||||
adds r0, 0x1
|
||||
strb r0, [r1]
|
||||
ldr r1, =0x020229c6
|
||||
ldr r2, =0x00005501
|
||||
adds r0, r2, 0
|
||||
strh r0, [r1]
|
||||
bl sub_8009734
|
||||
b _08178E58
|
||||
.pool
|
||||
_08178B80:
|
||||
ldr r0, =0x030030e0
|
||||
ldr r1, [r0]
|
||||
movs r0, 0x20
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _08178B8E
|
||||
b _08178D00
|
||||
_08178B8E:
|
||||
movs r0, 0x1C
|
||||
ands r1, r0
|
||||
cmp r1, 0x4
|
||||
bhi _08178B98
|
||||
b _08178D00
|
||||
_08178B98:
|
||||
movs r0, 0x15
|
||||
bl audio_play
|
||||
ldr r1, =gUnknown_085EE788
|
||||
movs r0, 0x1
|
||||
str r0, [sp]
|
||||
movs r0, 0
|
||||
movs r2, 0x1
|
||||
movs r3, 0x2
|
||||
bl sub_8178EC4
|
||||
ldr r1, =0x030022c0
|
||||
movs r0, 0x87
|
||||
lsls r0, 3
|
||||
adds r1, r0
|
||||
ldrb r0, [r1]
|
||||
adds r0, 0x1
|
||||
strb r0, [r1]
|
||||
b _08178D00
|
||||
.pool
|
||||
_08178BCC:
|
||||
movs r0, 0
|
||||
bl IsTextPrinterActive
|
||||
lsls r0, 16
|
||||
cmp r0, 0
|
||||
beq _08178BDA
|
||||
b _08178E58
|
||||
_08178BDA:
|
||||
b _08178E34
|
||||
_08178BDC:
|
||||
bl sub_800ABAC
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
cmp r2, 0x2
|
||||
bne _08178CD0
|
||||
ldr r4, =0x030022c0
|
||||
ldrh r1, [r4, 0x2E]
|
||||
movs r0, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _08178C38
|
||||
movs r0, 0x5
|
||||
bl audio_play
|
||||
bl sub_800A620
|
||||
movs r0, 0x1
|
||||
movs r1, 0x1
|
||||
movs r2, 0x1
|
||||
movs r3, 0xD
|
||||
bl SetWindowBorderStyle
|
||||
ldr r1, =gUnknown_085EE7BF
|
||||
movs r0, 0
|
||||
str r0, [sp]
|
||||
movs r0, 0x1
|
||||
movs r2, 0x1
|
||||
movs r3, 0x2
|
||||
bl sub_8178EC4
|
||||
movs r0, 0x1
|
||||
bl PutWindowTilemap
|
||||
movs r0, 0x1
|
||||
movs r1, 0x3
|
||||
bl CopyWindowToVram
|
||||
movs r2, 0x87
|
||||
lsls r2, 3
|
||||
adds r1, r4, r2
|
||||
b _08178E3C
|
||||
.pool
|
||||
_08178C38:
|
||||
adds r0, r2, 0
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _08178C42
|
||||
b _08178E58
|
||||
_08178C42:
|
||||
movs r0, 0x5
|
||||
bl audio_play
|
||||
bl sub_80097E8
|
||||
movs r0, 0x87
|
||||
lsls r0, 3
|
||||
adds r1, r4, r0
|
||||
b _08178D1E
|
||||
_08178C54:
|
||||
bl sub_800B320
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _08178D00
|
||||
ldr r0, =0x03003124
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0
|
||||
bne _08178C68
|
||||
b _08178E58
|
||||
_08178C68:
|
||||
movs r0, 0x2
|
||||
movs r1, 0x2
|
||||
bl sub_800A0C8
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x3
|
||||
bne _08178CAC
|
||||
bl sub_800AC34
|
||||
ldr r4, =0x02021fc4
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x1
|
||||
bl sub_8178A40
|
||||
movs r0, 0x1
|
||||
str r0, [sp]
|
||||
movs r0, 0
|
||||
adds r1, r4, 0
|
||||
movs r2, 0x1
|
||||
movs r3, 0x2
|
||||
bl sub_8178EC4
|
||||
ldr r0, =0x030022c0
|
||||
movs r2, 0x87
|
||||
lsls r2, 3
|
||||
adds r0, r2
|
||||
b _08178CF2
|
||||
.pool
|
||||
_08178CAC:
|
||||
bl sub_8178958
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _08178CCC
|
||||
ldr r1, =gUnknown_085EE7CE
|
||||
movs r0, 0x1
|
||||
str r0, [sp]
|
||||
movs r0, 0
|
||||
movs r2, 0x1
|
||||
movs r3, 0x2
|
||||
bl sub_8178EC4
|
||||
b _08178E34
|
||||
.pool
|
||||
_08178CCC:
|
||||
bl sub_80097E8
|
||||
_08178CD0:
|
||||
ldr r4, =0x02021fc4
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x1
|
||||
bl sub_8178A40
|
||||
movs r0, 0x1
|
||||
str r0, [sp]
|
||||
movs r0, 0
|
||||
adds r1, r4, 0
|
||||
movs r2, 0x1
|
||||
movs r3, 0x2
|
||||
bl sub_8178EC4
|
||||
ldr r0, =0x030022c0
|
||||
movs r1, 0x87
|
||||
lsls r1, 3
|
||||
adds r0, r1
|
||||
_08178CF2:
|
||||
movs r1, 0xD
|
||||
strb r1, [r0]
|
||||
b _08178E58
|
||||
.pool
|
||||
_08178D00:
|
||||
ldr r4, =0x030022c0
|
||||
ldrh r1, [r4, 0x2E]
|
||||
movs r0, 0x2
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _08178D0E
|
||||
b _08178E58
|
||||
_08178D0E:
|
||||
movs r0, 0x5
|
||||
bl audio_play
|
||||
bl sub_80097E8
|
||||
movs r2, 0x87
|
||||
lsls r2, 3
|
||||
adds r1, r4, r2
|
||||
_08178D1E:
|
||||
movs r0, 0xF
|
||||
strb r0, [r1]
|
||||
b _08178E58
|
||||
.pool
|
||||
_08178D28:
|
||||
movs r0, 0
|
||||
bl IsTextPrinterActive
|
||||
lsls r0, 16
|
||||
cmp r0, 0
|
||||
beq _08178D36
|
||||
b _08178E58
|
||||
_08178D36:
|
||||
b _08178E34
|
||||
_08178D38:
|
||||
bl sub_800A550
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _08178D44
|
||||
b _08178E58
|
||||
_08178D44:
|
||||
bl sub_800A5B4
|
||||
ldr r1, =0x030022c0
|
||||
movs r2, 0x87
|
||||
lsls r2, 3
|
||||
adds r1, r2
|
||||
b _08178E3C
|
||||
.pool
|
||||
_08178D58:
|
||||
movs r0, 0x87
|
||||
lsls r0, 3
|
||||
adds r1, r4, r0
|
||||
b _08178E3C
|
||||
_08178D60:
|
||||
bl sub_800AC34
|
||||
ldr r1, =0x030022c0
|
||||
movs r2, 0x87
|
||||
lsls r2, 3
|
||||
adds r1, r2
|
||||
b _08178E3C
|
||||
.pool
|
||||
_08178D74:
|
||||
ldr r0, =0x03003124
|
||||
ldrb r6, [r0]
|
||||
cmp r6, 0
|
||||
bne _08178E58
|
||||
ldr r5, =0x0201c000
|
||||
adds r0, r5, 0
|
||||
bl sub_81538A0
|
||||
adds r4, r0, 0
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
str r6, [sp, 0x4]
|
||||
ldr r2, =0x050001f5
|
||||
add r0, sp, 0x4
|
||||
adds r1, r5, 0
|
||||
bl CpuSet
|
||||
ldr r0, =0x02021fc4
|
||||
adds r1, r4, 0
|
||||
bl sub_8178A40
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _08178E34
|
||||
movs r0, 0
|
||||
bl save_game_when_memory_present
|
||||
b _08178E34
|
||||
.pool
|
||||
_08178DBC:
|
||||
ldr r1, =0x02021fc4
|
||||
movs r0, 0x1
|
||||
str r0, [sp]
|
||||
movs r0, 0
|
||||
movs r2, 0x1
|
||||
movs r3, 0x2
|
||||
bl sub_8178EC4
|
||||
ldr r1, =0x030022c0
|
||||
movs r2, 0x87
|
||||
lsls r2, 3
|
||||
adds r1, r2
|
||||
b _08178E3C
|
||||
.pool
|
||||
_08178DE0:
|
||||
movs r0, 0
|
||||
bl IsTextPrinterActive
|
||||
lsls r0, 16
|
||||
lsrs r2, r0, 16
|
||||
cmp r2, 0
|
||||
bne _08178E58
|
||||
ldr r0, =0x030022c0
|
||||
movs r1, 0x87
|
||||
lsls r1, 3
|
||||
adds r0, r1
|
||||
ldrb r1, [r0]
|
||||
adds r1, 0x1
|
||||
strb r1, [r0]
|
||||
ldr r0, =0x0203bcf8
|
||||
strb r2, [r0]
|
||||
b _08178E58
|
||||
.pool
|
||||
_08178E0C:
|
||||
ldrh r1, [r4, 0x2E]
|
||||
movs r0, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _08178E58
|
||||
movs r0, 0x5
|
||||
bl audio_play
|
||||
movs r2, 0x87
|
||||
lsls r2, 3
|
||||
adds r1, r4, r2
|
||||
b _08178E3C
|
||||
_08178E24:
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
movs r1, 0
|
||||
str r1, [sp]
|
||||
movs r2, 0
|
||||
movs r3, 0x10
|
||||
_08178E30:
|
||||
bl pal_fade_maybe
|
||||
_08178E34:
|
||||
ldr r1, =0x030022c0
|
||||
movs r0, 0x87
|
||||
lsls r0, 3
|
||||
adds r1, r0
|
||||
_08178E3C:
|
||||
ldrb r0, [r1]
|
||||
adds r0, 0x1
|
||||
strb r0, [r1]
|
||||
b _08178E58
|
||||
.pool
|
||||
_08178E48:
|
||||
ldr r0, =0x02037fd4
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _08178E58
|
||||
bl Reset
|
||||
_08178E58:
|
||||
ldr r0, =0x030030e0
|
||||
ldr r0, [r0]
|
||||
movs r1, 0x40
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _08178E98
|
||||
bl sub_800ABBC
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _08178E98
|
||||
bl sub_80097E8
|
||||
ldr r4, =0x02021fc4
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x1
|
||||
bl sub_8178A40
|
||||
movs r0, 0x1
|
||||
str r0, [sp]
|
||||
movs r0, 0
|
||||
adds r1, r4, 0
|
||||
movs r2, 0x1
|
||||
movs r3, 0x2
|
||||
bl sub_8178EC4
|
||||
ldr r0, =0x030022c0
|
||||
movs r1, 0x87
|
||||
lsls r1, 3
|
||||
adds r0, r1
|
||||
movs r1, 0xD
|
||||
strb r1, [r0]
|
||||
_08178E98:
|
||||
bl RunTasks
|
||||
bl CallObjectCallbacks
|
||||
bl PrepareSpritesForOamLoad
|
||||
bl RunTextPrinters
|
||||
bl fade_and_return_progress_probably
|
||||
add sp, 0x8
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8178A78
|
||||
|
||||
thumb_func_start sub_8178EC4
|
||||
sub_8178EC4: @ 8178EC4
|
||||
push {r4-r6,lr}
|
||||
mov r6, r10
|
||||
mov r5, r9
|
||||
mov r4, r8
|
||||
push {r4-r6}
|
||||
sub sp, 0x1C
|
||||
adds r5, r0, 0
|
||||
mov r10, r1
|
||||
adds r6, r2, 0
|
||||
ldr r4, [sp, 0x38]
|
||||
lsls r5, 24
|
||||
lsrs r5, 24
|
||||
lsls r6, 24
|
||||
lsrs r6, 24
|
||||
lsls r3, 24
|
||||
lsrs r3, 24
|
||||
movs r0, 0
|
||||
mov r9, r0
|
||||
movs r1, 0x1
|
||||
mov r8, r1
|
||||
add r0, sp, 0x14
|
||||
mov r1, r8
|
||||
strb r1, [r0]
|
||||
adds r1, r0, 0
|
||||
movs r0, 0x2
|
||||
strb r0, [r1, 0x1]
|
||||
movs r0, 0x3
|
||||
strb r0, [r1, 0x2]
|
||||
adds r0, r1, 0
|
||||
ldrb r0, [r0]
|
||||
lsls r1, r0, 4
|
||||
orrs r1, r0
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r5, 0
|
||||
str r3, [sp, 0x18]
|
||||
bl FillWindowPixelBuffer
|
||||
mov r0, r9
|
||||
str r0, [sp]
|
||||
mov r1, r8
|
||||
str r1, [sp, 0x4]
|
||||
add r0, sp, 0x14
|
||||
str r0, [sp, 0x8]
|
||||
lsls r4, 24
|
||||
asrs r4, 24
|
||||
str r4, [sp, 0xC]
|
||||
mov r1, r10
|
||||
str r1, [sp, 0x10]
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x1
|
||||
adds r2, r6, 0
|
||||
ldr r3, [sp, 0x18]
|
||||
bl AddTextPrinterParametrized2
|
||||
add sp, 0x1C
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_8178EC4
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
870
asm/mystery_event_script.s
Normal file
870
asm/mystery_event_script.s
Normal file
@ -0,0 +1,870 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_81537CC
|
||||
sub_81537CC: @ 81537CC
|
||||
push {r4,lr}
|
||||
adds r4, r3, 0
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
lsls r2, 16
|
||||
lsrs r2, 16
|
||||
movs r3, 0x1
|
||||
ands r0, r3
|
||||
cmp r0, 0
|
||||
beq _081537FC
|
||||
ands r1, r3
|
||||
cmp r1, 0
|
||||
beq _081537FC
|
||||
movs r0, 0x4
|
||||
ands r2, r0
|
||||
cmp r2, 0
|
||||
beq _081537FC
|
||||
movs r0, 0x80
|
||||
lsls r0, 2
|
||||
ands r0, r4
|
||||
cmp r0, 0
|
||||
beq _081537FC
|
||||
movs r0, 0x1
|
||||
b _081537FE
|
||||
_081537FC:
|
||||
movs r0, 0
|
||||
_081537FE:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81537CC
|
||||
|
||||
thumb_func_start sub_8153804
|
||||
sub_8153804: @ 8153804
|
||||
push {lr}
|
||||
ldr r0, =0x02021fc4
|
||||
ldr r1, =gUnknown_08674C86
|
||||
bl ExpandStringRefs
|
||||
movs r0, 0x3
|
||||
bl sub_81538C4
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8153804
|
||||
|
||||
thumb_func_start sub_8153820
|
||||
sub_8153820: @ 8153820
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
adds r5, r1, 0
|
||||
ldr r1, =gUnknown_082DED2C
|
||||
ldr r2, =gUnknown_082DED2C + 0x44
|
||||
bl script_env_init
|
||||
adds r0, r4, 0
|
||||
adds r1, r5, 0
|
||||
bl script_setup_bytecode_script
|
||||
str r5, [r4, 0x64]
|
||||
movs r0, 0
|
||||
str r0, [r4, 0x68]
|
||||
str r0, [r4, 0x6C]
|
||||
str r0, [r4, 0x70]
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8153820
|
||||
|
||||
thumb_func_start sub_8153850
|
||||
sub_8153850: @ 8153850
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
bl script_main_handler
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _08153868
|
||||
ldr r0, [r4, 0x70]
|
||||
cmp r0, 0
|
||||
beq _08153868
|
||||
movs r0, 0x1
|
||||
b _0815386A
|
||||
_08153868:
|
||||
movs r0, 0
|
||||
_0815386A:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8153850
|
||||
|
||||
thumb_func_start sub_8153870
|
||||
sub_8153870: @ 8153870
|
||||
push {lr}
|
||||
adds r1, r0, 0
|
||||
ldr r0, =0x0203bbc0
|
||||
bl sub_8153820
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8153870
|
||||
|
||||
thumb_func_start sub_8153884
|
||||
sub_8153884: @ 8153884
|
||||
push {r4,r5,lr}
|
||||
adds r5, r0, 0
|
||||
ldr r4, =0x0203bbc0
|
||||
adds r0, r4, 0
|
||||
bl sub_8153850
|
||||
ldr r1, [r4, 0x6C]
|
||||
str r1, [r5]
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_8153884
|
||||
|
||||
thumb_func_start sub_81538A0
|
||||
sub_81538A0: @ 81538A0
|
||||
push {r4,lr}
|
||||
adds r1, r0, 0
|
||||
ldr r4, =0x0203bbc0
|
||||
adds r0, r4, 0
|
||||
bl sub_8153820
|
||||
_081538AC:
|
||||
adds r0, r4, 0
|
||||
bl sub_8153850
|
||||
cmp r0, 0
|
||||
bne _081538AC
|
||||
ldr r0, [r4, 0x6C]
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81538A0
|
||||
|
||||
thumb_func_start sub_81538C4
|
||||
sub_81538C4: @ 81538C4
|
||||
ldr r1, =0x0203bbc0
|
||||
str r0, [r1, 0x6C]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sub_81538C4
|
||||
|
||||
thumb_func_start sub_81538D0
|
||||
sub_81538D0: @ 81538D0
|
||||
push {lr}
|
||||
movs r2, 0
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x00003b18
|
||||
adds r3, r0, r1
|
||||
movs r1, 0
|
||||
_081538DE:
|
||||
adds r0, r3, r1
|
||||
ldrb r0, [r0]
|
||||
adds r2, r0
|
||||
adds r1, 0x1
|
||||
cmp r1, 0xB
|
||||
bls _081538DE
|
||||
adds r0, r2, 0
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81538D0
|
||||
|
||||
thumb_func_start sub_81538F8
|
||||
sub_81538F8: @ 81538F8
|
||||
push {r4,r5,lr}
|
||||
ldr r5, =0x03005d8c
|
||||
ldr r0, [r5]
|
||||
ldr r1, =0x00003b18
|
||||
adds r4, r0, r1
|
||||
bl sub_81538D0
|
||||
adds r1, r0, 0
|
||||
ldrb r0, [r4]
|
||||
cmp r0, 0
|
||||
beq _0815392A
|
||||
ldrb r0, [r4, 0x1]
|
||||
cmp r0, 0
|
||||
beq _0815392A
|
||||
ldrh r0, [r4, 0x2]
|
||||
cmp r0, 0
|
||||
beq _0815392A
|
||||
cmp r1, 0
|
||||
beq _0815392A
|
||||
ldr r0, [r5]
|
||||
ldr r2, =0x00003b14
|
||||
adds r0, r2
|
||||
ldr r0, [r0]
|
||||
cmp r1, r0
|
||||
beq _0815393C
|
||||
_0815392A:
|
||||
movs r0, 0
|
||||
b _0815393E
|
||||
.pool
|
||||
_0815393C:
|
||||
movs r0, 0x1
|
||||
_0815393E:
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81538F8
|
||||
|
||||
thumb_func_start sub_8153944
|
||||
sub_8153944: @ 8153944
|
||||
push {lr}
|
||||
sub sp, 0x4
|
||||
mov r1, sp
|
||||
movs r0, 0
|
||||
strh r0, [r1]
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r1, [r0]
|
||||
ldr r0, =0x00003b14
|
||||
adds r1, r0
|
||||
ldr r2, =0x01000008
|
||||
mov r0, sp
|
||||
bl CpuSet
|
||||
add sp, 0x4
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8153944
|
||||
|
||||
thumb_func_start sub_8153970
|
||||
sub_8153970: @ 8153970
|
||||
push {r4-r6,lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
adds r3, r0, 0
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r5, r1, 0
|
||||
lsls r2, 16
|
||||
lsrs r2, 16
|
||||
adds r6, r2, 0
|
||||
cmp r3, 0
|
||||
beq _08153990
|
||||
cmp r1, 0
|
||||
beq _08153990
|
||||
cmp r2, 0
|
||||
bne _08153996
|
||||
_08153990:
|
||||
bl sub_8153944
|
||||
b _081539BC
|
||||
_08153996:
|
||||
ldr r4, =0x03005d8c
|
||||
ldr r0, [r4]
|
||||
ldr r1, =0x00003b18
|
||||
adds r0, r1
|
||||
strb r3, [r0]
|
||||
ldr r0, [r4]
|
||||
ldr r2, =0x00003b19
|
||||
adds r0, r2
|
||||
strb r5, [r0]
|
||||
ldr r0, [r4]
|
||||
adds r1, 0x2
|
||||
adds r0, r1
|
||||
strh r6, [r0]
|
||||
bl sub_81538D0
|
||||
ldr r1, [r4]
|
||||
ldr r2, =0x00003b14
|
||||
adds r1, r2
|
||||
str r0, [r1]
|
||||
_081539BC:
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8153970
|
||||
|
||||
thumb_func_start sub_81539D4
|
||||
sub_81539D4: @ 81539D4
|
||||
push {r4-r6,lr}
|
||||
ldr r6, =0x03005d8c
|
||||
ldr r0, [r6]
|
||||
ldr r1, =0x00003b18
|
||||
adds r4, r0, r1
|
||||
bl sub_81538F8
|
||||
cmp r0, 0
|
||||
bne _081539F8
|
||||
bl sub_8153944
|
||||
movs r0, 0
|
||||
b _08153A1A
|
||||
.pool
|
||||
_081539F8:
|
||||
ldrh r5, [r4, 0x2]
|
||||
ldrb r0, [r4, 0x1]
|
||||
subs r0, 0x1
|
||||
strb r0, [r4, 0x1]
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _08153A0C
|
||||
bl sub_8153944
|
||||
b _08153A18
|
||||
_08153A0C:
|
||||
bl sub_81538D0
|
||||
ldr r1, [r6]
|
||||
ldr r2, =0x00003b14
|
||||
adds r1, r2
|
||||
str r0, [r1]
|
||||
_08153A18:
|
||||
adds r0, r5, 0
|
||||
_08153A1A:
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81539D4
|
||||
|
||||
thumb_func_start script_status_stop_and_ret_1
|
||||
script_status_stop_and_ret_1: @ 8153A24
|
||||
push {lr}
|
||||
bl script_stop
|
||||
movs r0, 0x1
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end script_status_stop_and_ret_1
|
||||
|
||||
thumb_func_start sub_8153A30
|
||||
sub_8153A30: @ 8153A30
|
||||
push {r4-r7,lr}
|
||||
adds r7, r0, 0
|
||||
bl script_read_word
|
||||
str r0, [r7, 0x68]
|
||||
adds r0, r7, 0
|
||||
bl script_read_halfword
|
||||
adds r5, r0, 0
|
||||
lsls r5, 16
|
||||
lsrs r5, 16
|
||||
adds r0, r7, 0
|
||||
bl script_read_word
|
||||
adds r6, r0, 0
|
||||
adds r0, r7, 0
|
||||
bl script_read_halfword
|
||||
adds r4, r0, 0
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
adds r0, r7, 0
|
||||
bl script_read_word
|
||||
adds r3, r0, 0
|
||||
adds r0, r5, 0
|
||||
adds r1, r6, 0
|
||||
adds r2, r4, 0
|
||||
bl sub_81537CC
|
||||
cmp r0, 0x1
|
||||
bne _08153A74
|
||||
str r0, [r7, 0x70]
|
||||
b _08153A78
|
||||
_08153A74:
|
||||
bl sub_8153804
|
||||
_08153A78:
|
||||
movs r0, 0x1
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8153A30
|
||||
|
||||
thumb_func_start sub_8153A80
|
||||
sub_8153A80: @ 8153A80
|
||||
movs r0, 0
|
||||
bx lr
|
||||
thumb_func_end sub_8153A80
|
||||
|
||||
thumb_func_start sub_8153A84
|
||||
sub_8153A84: @ 8153A84
|
||||
ldr r1, [r0, 0x8]
|
||||
ldrb r2, [r1]
|
||||
adds r1, 0x1
|
||||
str r1, [r0, 0x8]
|
||||
str r2, [r0, 0x6C]
|
||||
movs r0, 0
|
||||
bx lr
|
||||
thumb_func_end sub_8153A84
|
||||
|
||||
thumb_func_start sub_8153A94
|
||||
sub_8153A94: @ 8153A94
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
ldr r0, [r4, 0x8]
|
||||
ldrb r5, [r0]
|
||||
adds r0, 0x1
|
||||
str r0, [r4, 0x8]
|
||||
adds r0, r4, 0
|
||||
bl script_read_word
|
||||
ldr r1, [r4, 0x68]
|
||||
subs r0, r1
|
||||
ldr r1, [r4, 0x64]
|
||||
adds r1, r0, r1
|
||||
cmp r5, 0xFF
|
||||
beq _08153AB8
|
||||
ldr r0, [r4, 0x6C]
|
||||
cmp r5, r0
|
||||
bne _08153ABE
|
||||
_08153AB8:
|
||||
ldr r0, =0x02021fc4
|
||||
bl ExpandStringRefs
|
||||
_08153ABE:
|
||||
movs r0, 0
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_8153A94
|
||||
|
||||
thumb_func_start sub_8153ACC
|
||||
sub_8153ACC: @ 8153ACC
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
bl script_read_word
|
||||
ldr r1, [r4, 0x68]
|
||||
subs r0, r1
|
||||
ldr r1, [r4, 0x64]
|
||||
adds r0, r1
|
||||
bl script_env_2_execute_new_script
|
||||
movs r0, 0
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8153ACC
|
||||
|
||||
thumb_func_start sub_8153AE8
|
||||
sub_8153AE8: @ 8153AE8
|
||||
push {r4-r7,lr}
|
||||
mov r7, r9
|
||||
mov r6, r8
|
||||
push {r6,r7}
|
||||
adds r7, r0, 0
|
||||
bl sub_80E162C
|
||||
mov r8, r0
|
||||
adds r0, r7, 0
|
||||
bl script_read_word
|
||||
adds r4, r0, 0
|
||||
ldr r0, [r7, 0x68]
|
||||
subs r4, r0
|
||||
ldr r0, [r7, 0x64]
|
||||
adds r4, r0
|
||||
ldr r0, =0x02021cc4
|
||||
mov r9, r0
|
||||
ldr r6, =0x03005d8c
|
||||
ldr r1, [r6]
|
||||
ldr r5, =0x000031f8
|
||||
adds r1, r5
|
||||
movs r2, 0x7
|
||||
bl CopyString_LimitN
|
||||
adds r0, r4, 0
|
||||
bl sub_80E15E4
|
||||
ldr r4, =0x02021dc4
|
||||
ldr r1, [r6]
|
||||
adds r1, r5
|
||||
adds r0, r4, 0
|
||||
movs r2, 0x7
|
||||
bl CopyString_LimitN
|
||||
mov r0, r8
|
||||
cmp r0, 0
|
||||
bne _08153B54
|
||||
ldr r0, =0x02021fc4
|
||||
ldr r1, =gUnknown_08674AE4
|
||||
b _08153B74
|
||||
.pool
|
||||
_08153B54:
|
||||
mov r0, r9
|
||||
adds r1, r4, 0
|
||||
bl CompareString
|
||||
cmp r0, 0
|
||||
beq _08153B70
|
||||
ldr r0, =0x02021fc4
|
||||
ldr r1, =gUnknown_08674B16
|
||||
b _08153B74
|
||||
.pool
|
||||
_08153B70:
|
||||
ldr r0, =0x02021fc4
|
||||
ldr r1, =gUnknown_08674B42
|
||||
_08153B74:
|
||||
bl ExpandStringRefs
|
||||
movs r0, 0x2
|
||||
str r0, [r7, 0x6C]
|
||||
bl sub_80E162C
|
||||
cmp r0, 0x1
|
||||
bne _08153B9C
|
||||
ldr r0, =0x0000402d
|
||||
movs r1, 0x1
|
||||
bl VarSet
|
||||
b _08153BA0
|
||||
.pool
|
||||
_08153B9C:
|
||||
movs r0, 0x1
|
||||
str r0, [r7, 0x6C]
|
||||
_08153BA0:
|
||||
movs r0, 0
|
||||
pop {r3,r4}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8153AE8
|
||||
|
||||
thumb_func_start sub_8153BB0
|
||||
sub_8153BB0: @ 8153BB0
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
ldr r2, [r4, 0x8]
|
||||
ldrb r0, [r2]
|
||||
adds r2, 0x1
|
||||
str r2, [r4, 0x8]
|
||||
ldrb r1, [r2]
|
||||
adds r2, 0x1
|
||||
str r2, [r4, 0x8]
|
||||
bl sub_80F9B30
|
||||
ldr r0, =0x02021fc4
|
||||
ldr r1, =gUnknown_08674B6A
|
||||
bl ExpandStringRefs
|
||||
movs r0, 0x2
|
||||
str r0, [r4, 0x6C]
|
||||
movs r0, 0
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_8153BB0
|
||||
|
||||
thumb_func_start sub_8153BE4
|
||||
sub_8153BE4: @ 8153BE4
|
||||
push {r4-r6,lr}
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5,r6}
|
||||
sub sp, 0x4
|
||||
adds r4, r0, 0
|
||||
ldr r0, [r4, 0x8]
|
||||
ldrb r1, [r0]
|
||||
mov r9, r1
|
||||
adds r0, 0x1
|
||||
str r0, [r4, 0x8]
|
||||
ldrb r1, [r0]
|
||||
mov r8, r1
|
||||
adds r1, r0, 0x1
|
||||
str r1, [r4, 0x8]
|
||||
ldrb r6, [r0, 0x1]
|
||||
adds r1, 0x1
|
||||
str r1, [r4, 0x8]
|
||||
adds r0, r4, 0
|
||||
bl script_read_word
|
||||
adds r5, r0, 0
|
||||
ldr r0, [r4, 0x68]
|
||||
subs r5, r0
|
||||
ldr r0, [r4, 0x64]
|
||||
adds r5, r0
|
||||
adds r0, r4, 0
|
||||
bl script_read_word
|
||||
adds r1, r0, 0
|
||||
ldr r0, [r4, 0x68]
|
||||
subs r1, r0
|
||||
ldr r0, [r4, 0x64]
|
||||
adds r1, r0
|
||||
subs r1, r5
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
str r6, [sp]
|
||||
adds r0, r5, 0
|
||||
mov r2, r9
|
||||
mov r3, r8
|
||||
bl sub_80990FC
|
||||
movs r0, 0
|
||||
add sp, 0x4
|
||||
pop {r3,r4}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8153BE4
|
||||
|
||||
thumb_func_start sub_8153C4C
|
||||
sub_8153C4C: @ 8153C4C
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
bl sub_809D3E8
|
||||
ldr r0, =0x02021fc4
|
||||
ldr r1, =gUnknown_08674B9E
|
||||
bl ExpandStringRefs
|
||||
movs r0, 0x2
|
||||
str r0, [r4, 0x6C]
|
||||
movs r0, 0
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_8153C4C
|
||||
|
||||
thumb_func_start sub_8153C70
|
||||
sub_8153C70: @ 8153C70
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
ldr r1, [r4, 0x8]
|
||||
ldrb r0, [r1]
|
||||
adds r1, 0x1
|
||||
str r1, [r4, 0x8]
|
||||
bl sub_811EFC0
|
||||
ldr r0, =0x02021fc4
|
||||
ldr r1, =gUnknown_08674BD4
|
||||
bl ExpandStringRefs
|
||||
movs r0, 0x2
|
||||
str r0, [r4, 0x6C]
|
||||
movs r0, 0
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_8153C70
|
||||
|
||||
thumb_func_start sub_8153C9C
|
||||
sub_8153C9C: @ 8153C9C
|
||||
push {r4,r5,lr}
|
||||
ldr r1, [r0, 0x8]
|
||||
ldrb r5, [r1]
|
||||
adds r1, 0x1
|
||||
str r1, [r0, 0x8]
|
||||
ldrb r4, [r1]
|
||||
adds r1, 0x1
|
||||
str r1, [r0, 0x8]
|
||||
bl script_read_halfword
|
||||
adds r2, r0, 0
|
||||
lsls r2, 16
|
||||
lsrs r2, 16
|
||||
adds r0, r5, 0
|
||||
adds r1, r4, 0
|
||||
bl sub_8153970
|
||||
movs r0, 0
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8153C9C
|
||||
|
||||
thumb_func_start sub_8153CC8
|
||||
sub_8153CC8: @ 8153CC8
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
sub sp, 0x88
|
||||
adds r6, r0, 0
|
||||
bl script_read_word
|
||||
ldr r1, [r6, 0x68]
|
||||
subs r0, r1
|
||||
ldr r1, [r6, 0x64]
|
||||
adds r5, r0, r1
|
||||
movs r0, 0x64
|
||||
adds r0, r5
|
||||
mov r8, r0
|
||||
add r4, sp, 0x24
|
||||
adds r0, r4, 0
|
||||
adds r1, r5, 0
|
||||
movs r2, 0x64
|
||||
bl memcpy
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x41
|
||||
bl pokemon_getattr
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
movs r0, 0xCE
|
||||
lsls r0, 1
|
||||
cmp r4, r0
|
||||
bne _08153D18
|
||||
ldr r0, =0x02021cc4
|
||||
ldr r1, =gUnknown_085E8264
|
||||
movs r2, 0xB
|
||||
bl CopyString_LimitN
|
||||
b _08153D22
|
||||
.pool
|
||||
_08153D18:
|
||||
ldr r0, =0x02021cc4
|
||||
ldr r1, =gUnknown_085E8268
|
||||
movs r2, 0xB
|
||||
bl CopyString_LimitN
|
||||
_08153D22:
|
||||
ldr r0, =0x020244e9
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0x6
|
||||
bne _08153D4C
|
||||
ldr r0, =0x02021fc4
|
||||
ldr r1, =gUnknown_08674C02
|
||||
bl ExpandStringRefs
|
||||
movs r0, 0x3
|
||||
b _08153DB6
|
||||
.pool
|
||||
_08153D4C:
|
||||
ldr r7, =0x020246e0
|
||||
adds r0, r7, 0
|
||||
adds r1, r5, 0
|
||||
movs r2, 0x64
|
||||
bl memcpy
|
||||
mov r0, sp
|
||||
mov r1, r8
|
||||
movs r2, 0x24
|
||||
bl memcpy
|
||||
movs r0, 0xCE
|
||||
lsls r0, 1
|
||||
cmp r4, r0
|
||||
beq _08153D86
|
||||
adds r0, r4, 0
|
||||
bl SpeciesToNationalPokedexNum
|
||||
adds r4, r0, 0
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x2
|
||||
bl pokedex_flag_operation
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x3
|
||||
bl pokedex_flag_operation
|
||||
_08153D86:
|
||||
adds r0, r7, 0
|
||||
movs r1, 0xC
|
||||
bl pokemon_getattr
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
bl itemid_is_mail
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _08153DA4
|
||||
adds r0, r7, 0
|
||||
mov r1, sp
|
||||
bl sub_80D460C
|
||||
_08153DA4:
|
||||
bl party_compaction
|
||||
bl calc_player_party_count
|
||||
ldr r0, =0x02021fc4
|
||||
ldr r1, =gUnknown_08674BF0
|
||||
bl ExpandStringRefs
|
||||
movs r0, 0x2
|
||||
_08153DB6:
|
||||
str r0, [r6, 0x6C]
|
||||
movs r0, 0
|
||||
add sp, 0x88
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_8153CC8
|
||||
|
||||
thumb_func_start sub_8153DD4
|
||||
sub_8153DD4: @ 8153DD4
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
bl script_read_word
|
||||
adds r1, r0, 0
|
||||
ldr r0, [r4, 0x68]
|
||||
subs r1, r0
|
||||
ldr r0, [r4, 0x64]
|
||||
adds r1, r0
|
||||
ldr r0, =0x03005d90
|
||||
ldr r0, [r0]
|
||||
ldr r2, =0x00000bec
|
||||
adds r0, r2
|
||||
movs r2, 0xBC
|
||||
bl memcpy
|
||||
bl sub_81652B4
|
||||
ldr r0, =0x02021fc4
|
||||
ldr r1, =gUnknown_08674C31
|
||||
bl ExpandStringRefs
|
||||
movs r0, 0x2
|
||||
str r0, [r4, 0x6C]
|
||||
movs r0, 0
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_8153DD4
|
||||
|
||||
thumb_func_start sub_8153E1C
|
||||
sub_8153E1C: @ 8153E1C
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
bl sub_809D5F4
|
||||
ldr r0, =0x02021fc4
|
||||
ldr r1, =gUnknown_085ECAD8
|
||||
bl ExpandStringRefs
|
||||
movs r0, 0x2
|
||||
str r0, [r4, 0x6C]
|
||||
movs r0, 0
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_8153E1C
|
||||
|
||||
thumb_func_start sub_8153E40
|
||||
sub_8153E40: @ 8153E40
|
||||
push {r4-r6,lr}
|
||||
adds r6, r0, 0
|
||||
bl script_read_word
|
||||
adds r5, r0, 0
|
||||
adds r0, r6, 0
|
||||
bl script_read_word
|
||||
adds r4, r0, 0
|
||||
ldr r0, [r6, 0x68]
|
||||
subs r4, r0
|
||||
ldr r0, [r6, 0x64]
|
||||
adds r4, r0
|
||||
adds r0, r6, 0
|
||||
bl script_read_word
|
||||
adds r1, r0, 0
|
||||
ldr r0, [r6, 0x68]
|
||||
subs r1, r0
|
||||
ldr r0, [r6, 0x64]
|
||||
adds r1, r0
|
||||
subs r1, r4
|
||||
adds r0, r4, 0
|
||||
bl sub_806F96C
|
||||
cmp r5, r0
|
||||
beq _08153E7E
|
||||
movs r0, 0
|
||||
str r0, [r6, 0x70]
|
||||
movs r0, 0x1
|
||||
str r0, [r6, 0x6C]
|
||||
_08153E7E:
|
||||
movs r0, 0x1
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8153E40
|
||||
|
||||
thumb_func_start sub_8153E88
|
||||
sub_8153E88: @ 8153E88
|
||||
push {r4-r6,lr}
|
||||
adds r6, r0, 0
|
||||
bl script_read_word
|
||||
adds r5, r0, 0
|
||||
adds r0, r6, 0
|
||||
bl script_read_word
|
||||
adds r4, r0, 0
|
||||
ldr r0, [r6, 0x68]
|
||||
subs r4, r0
|
||||
ldr r0, [r6, 0x64]
|
||||
adds r4, r0
|
||||
adds r0, r6, 0
|
||||
bl script_read_word
|
||||
adds r1, r0, 0
|
||||
ldr r0, [r6, 0x68]
|
||||
subs r1, r0
|
||||
ldr r0, [r6, 0x64]
|
||||
adds r1, r0
|
||||
subs r1, r4
|
||||
adds r0, r4, 0
|
||||
bl sub_806F8D0
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
cmp r5, r0
|
||||
beq _08153ECA
|
||||
movs r0, 0
|
||||
str r0, [r6, 0x70]
|
||||
movs r0, 0x1
|
||||
str r0, [r6, 0x6C]
|
||||
_08153ECA:
|
||||
movs r0, 0x1
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_8153E88
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
4267
asm/naming_screen.s
Normal file
4267
asm/naming_screen.s
Normal file
File diff suppressed because it is too large
Load Diff
380
asm/new_game.s
Normal file
380
asm/new_game.s
Normal file
@ -0,0 +1,380 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start write_word_to_mem
|
||||
@ void write_word_to_mem(int value, int *mem)
|
||||
write_word_to_mem: @ 80842CC
|
||||
strb r0, [r1]
|
||||
lsrs r2, r0, 8
|
||||
strb r2, [r1, 0x1]
|
||||
lsrs r2, r0, 16
|
||||
strb r2, [r1, 0x2]
|
||||
lsrs r0, 24
|
||||
strb r0, [r1, 0x3]
|
||||
bx lr
|
||||
thumb_func_end write_word_to_mem
|
||||
|
||||
thumb_func_start sub_80842DC
|
||||
sub_80842DC: @ 80842DC
|
||||
adds r2, r0, 0
|
||||
ldrb r0, [r2, 0x3]
|
||||
lsls r0, 24
|
||||
ldrb r1, [r2, 0x2]
|
||||
lsls r1, 16
|
||||
orrs r0, r1
|
||||
ldrb r1, [r2, 0x1]
|
||||
lsls r1, 8
|
||||
orrs r0, r1
|
||||
ldrb r1, [r2]
|
||||
orrs r0, r1
|
||||
bx lr
|
||||
thumb_func_end sub_80842DC
|
||||
|
||||
thumb_func_start sub_80842F4
|
||||
sub_80842F4: @ 80842F4
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
adds r3, r1, 0
|
||||
movs r2, 0
|
||||
_080842FC:
|
||||
adds r0, r4, r2
|
||||
adds r1, r3, r2
|
||||
ldrb r1, [r1]
|
||||
strb r1, [r0]
|
||||
adds r2, 0x1
|
||||
cmp r2, 0x3
|
||||
ble _080842FC
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80842F4
|
||||
|
||||
thumb_func_start set_player_trainer_id
|
||||
set_player_trainer_id: @ 8084310
|
||||
push {r4,lr}
|
||||
bl GenerateRandomNumber
|
||||
adds r4, r0, 0
|
||||
bl GetTrainerId
|
||||
lsls r4, 16
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
orrs r4, r0
|
||||
ldr r0, =0x03005d90
|
||||
ldr r1, [r0]
|
||||
adds r1, 0xA
|
||||
adds r0, r4, 0
|
||||
bl write_word_to_mem
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end set_player_trainer_id
|
||||
|
||||
thumb_func_start init_options
|
||||
init_options: @ 808433C
|
||||
ldr r3, =0x03005d90
|
||||
ldr r2, [r3]
|
||||
ldrb r1, [r2, 0x14]
|
||||
movs r0, 0x8
|
||||
negs r0, r0
|
||||
ands r0, r1
|
||||
movs r1, 0x1
|
||||
orrs r0, r1
|
||||
strb r0, [r2, 0x14]
|
||||
ldr r2, [r3]
|
||||
ldrb r1, [r2, 0x14]
|
||||
movs r0, 0x7
|
||||
ands r0, r1
|
||||
strb r0, [r2, 0x14]
|
||||
ldr r2, [r3]
|
||||
ldrb r1, [r2, 0x15]
|
||||
movs r0, 0x2
|
||||
negs r0, r0
|
||||
ands r0, r1
|
||||
strb r0, [r2, 0x15]
|
||||
ldr r2, [r3]
|
||||
ldrb r1, [r2, 0x15]
|
||||
movs r0, 0x3
|
||||
negs r0, r0
|
||||
ands r0, r1
|
||||
strb r0, [r2, 0x15]
|
||||
ldr r2, [r3]
|
||||
ldrb r1, [r2, 0x15]
|
||||
movs r0, 0x5
|
||||
negs r0, r0
|
||||
ands r0, r1
|
||||
strb r0, [r2, 0x15]
|
||||
ldr r2, [r3]
|
||||
ldrb r1, [r2, 0x15]
|
||||
movs r0, 0x9
|
||||
negs r0, r0
|
||||
ands r0, r1
|
||||
strb r0, [r2, 0x15]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end init_options
|
||||
|
||||
thumb_func_start sub_8084390
|
||||
sub_8084390: @ 8084390
|
||||
push {r4,lr}
|
||||
ldr r1, =0x030060b0
|
||||
movs r0, 0
|
||||
strb r0, [r1]
|
||||
ldr r4, =0x03005d90
|
||||
ldr r0, [r4]
|
||||
adds r0, 0x28
|
||||
movs r1, 0
|
||||
movs r2, 0x34
|
||||
bl memset
|
||||
ldr r0, [r4]
|
||||
adds r0, 0x5C
|
||||
movs r1, 0
|
||||
movs r2, 0x34
|
||||
bl memset
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8084390
|
||||
|
||||
thumb_func_start sub_80843C0
|
||||
sub_80843C0: @ 80843C0
|
||||
push {r4-r7,lr}
|
||||
bl sub_80DF040
|
||||
movs r2, 0x8
|
||||
ldr r0, =0x03005d8c
|
||||
mov r12, r0
|
||||
ldr r4, =0x00002e90
|
||||
ldr r3, =gUnknown_08339D1C
|
||||
_080843D0:
|
||||
mov r1, r12
|
||||
ldr r0, [r1]
|
||||
lsls r1, r2, 5
|
||||
adds r0, r1
|
||||
adds r0, r4
|
||||
adds r1, r3, 0
|
||||
ldm r1!, {r5-r7}
|
||||
stm r0!, {r5-r7}
|
||||
ldm r1!, {r5-r7}
|
||||
stm r0!, {r5-r7}
|
||||
ldm r1!, {r5,r6}
|
||||
stm r0!, {r5,r6}
|
||||
adds r2, 0x1
|
||||
cmp r2, 0xC
|
||||
ble _080843D0
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80843C0
|
||||
|
||||
thumb_func_start sub_8084400
|
||||
sub_8084400: @ 8084400
|
||||
push {r4,lr}
|
||||
sub sp, 0x4
|
||||
movs r0, 0
|
||||
str r0, [sp]
|
||||
ldr r4, =0x03005d90
|
||||
ldr r1, [r4]
|
||||
ldr r0, =0x0000064c
|
||||
adds r1, r0
|
||||
ldr r2, =0x05000238
|
||||
mov r0, sp
|
||||
bl CpuSet
|
||||
ldr r0, [r4]
|
||||
ldr r1, =0x00000ee1
|
||||
adds r0, r1
|
||||
movs r1, 0xFF
|
||||
strb r1, [r0]
|
||||
ldr r0, [r4]
|
||||
ldr r1, =0x00000ee9
|
||||
adds r0, r1
|
||||
movs r1, 0x1
|
||||
negs r1, r1
|
||||
strb r1, [r0]
|
||||
add sp, 0x4
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8084400
|
||||
|
||||
thumb_func_start sub_808444C
|
||||
sub_808444C: @ 808444C
|
||||
push {lr}
|
||||
sub sp, 0x4
|
||||
movs r3, 0x1
|
||||
negs r3, r3
|
||||
str r3, [sp]
|
||||
movs r0, 0x19
|
||||
movs r1, 0x28
|
||||
adds r2, r3, 0
|
||||
bl warp1_set
|
||||
bl warp_in
|
||||
add sp, 0x4
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_808444C
|
||||
|
||||
thumb_func_start init_sav2
|
||||
init_sav2: @ 808446C
|
||||
push {lr}
|
||||
bl memclr_stdsav2
|
||||
bl init_options
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end init_sav2
|
||||
|
||||
thumb_func_start sub_808447C
|
||||
sub_808447C: @ 808447C
|
||||
push {lr}
|
||||
ldr r1, =0x020322d4
|
||||
movs r0, 0
|
||||
strb r0, [r1]
|
||||
bl sub_80BB358
|
||||
bl zero_player_party_data
|
||||
bl zero_enemy_party_data
|
||||
bl sub_81AAB70
|
||||
bl sub_813624C
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_808447C
|
||||
|
||||
thumb_func_start NewGameInitData
|
||||
@ void NewGameInitData()
|
||||
NewGameInitData: @ 80844A0
|
||||
push {r4,r5,lr}
|
||||
ldr r0, =0x03006210
|
||||
ldrh r0, [r0]
|
||||
cmp r0, 0
|
||||
beq _080844AE
|
||||
cmp r0, 0x2
|
||||
bne _080844B2
|
||||
_080844AE:
|
||||
bl GameFreakRTC_Reset
|
||||
_080844B2:
|
||||
ldr r1, =0x020322d4
|
||||
movs r0, 0x1
|
||||
strb r0, [r1]
|
||||
ldr r4, =0x03005d90
|
||||
ldr r0, [r4]
|
||||
adds r0, 0xAC
|
||||
movs r5, 0
|
||||
str r5, [r0]
|
||||
bl zero_player_party_data
|
||||
bl zero_enemy_party_data
|
||||
bl sub_80BB2D0
|
||||
bl sub_8084400
|
||||
bl clear_sav1
|
||||
bl sub_80D436C
|
||||
ldr r0, [r4]
|
||||
strb r5, [r0, 0x9]
|
||||
ldr r0, [r4]
|
||||
adds r0, 0xA8
|
||||
str r5, [r0]
|
||||
bl set_player_trainer_id
|
||||
bl reset_playtime
|
||||
bl sub_8084390
|
||||
bl sub_809D300
|
||||
bl sub_80EBEE0
|
||||
bl GabbyAndTyNewGameInitData
|
||||
bl sub_80E8B28
|
||||
bl RemoveAllBerryTrees
|
||||
ldr r4, =0x03005d8c
|
||||
ldr r0, [r4]
|
||||
movs r1, 0x92
|
||||
lsls r1, 3
|
||||
adds r0, r1
|
||||
ldr r1, =0x00000bb8
|
||||
bl EncryptMoney
|
||||
movs r0, 0
|
||||
bl SetCoins
|
||||
bl sub_80D766C
|
||||
bl sub_80847A8
|
||||
bl sub_80843C0
|
||||
bl sub_813C1F8
|
||||
bl sub_80F9A7C
|
||||
bl sub_80F9AD4
|
||||
ldr r0, =0x020244e9
|
||||
strb r5, [r0]
|
||||
bl zero_player_party_data
|
||||
bl sub_80C7770
|
||||
bl sub_8161B34
|
||||
bl sub_8161B60
|
||||
ldr r0, [r4]
|
||||
ldr r1, =0x00000496
|
||||
adds r0, r1
|
||||
strh r5, [r0]
|
||||
bl sub_80D7094
|
||||
bl sub_816ADF4
|
||||
bl sub_8136E88
|
||||
bl sub_81618B4
|
||||
bl sub_811F184
|
||||
bl sub_8120160
|
||||
bl sub_81224D4
|
||||
bl sub_813BA10
|
||||
bl sub_8177558
|
||||
bl sub_808444C
|
||||
ldr r0, =gUnknown_082715DE
|
||||
bl script_env_2_execute_new_script
|
||||
bl sub_80845CC
|
||||
bl copy_strings_to_sav1
|
||||
bl sub_818DA30
|
||||
bl sub_819FAA0
|
||||
bl sub_81A4B14
|
||||
bl sub_8195E10
|
||||
bl sub_801AFD8
|
||||
bl sub_800E5AC
|
||||
bl sub_81D54BC
|
||||
bl sub_80DED74
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end NewGameInitData
|
||||
|
||||
thumb_func_start sub_80845CC
|
||||
sub_80845CC: @ 80845CC
|
||||
push {r4-r6,lr}
|
||||
sub sp, 0x4
|
||||
mov r0, sp
|
||||
movs r5, 0
|
||||
strh r5, [r0]
|
||||
ldr r4, =0x03005d90
|
||||
ldr r1, [r4]
|
||||
movs r0, 0xF6
|
||||
lsls r0, 1
|
||||
adds r1, r0
|
||||
ldr r6, =0x01000008
|
||||
mov r0, sp
|
||||
adds r2, r6, 0
|
||||
bl CpuSet
|
||||
ldr r0, [r4]
|
||||
movs r1, 0xFA
|
||||
lsls r1, 1
|
||||
adds r0, r1
|
||||
movs r1, 0
|
||||
bl sub_802467C
|
||||
bl sub_802E33C
|
||||
mov r0, sp
|
||||
adds r0, 0x2
|
||||
strh r5, [r0]
|
||||
ldr r1, [r4]
|
||||
movs r2, 0x83
|
||||
lsls r2, 2
|
||||
adds r1, r2
|
||||
adds r2, r6, 0
|
||||
bl CpuSet
|
||||
add sp, 0x4
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80845CC
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
1694
asm/option_menu.s
Normal file
1694
asm/option_menu.s
Normal file
File diff suppressed because it is too large
Load Diff
2831
asm/palette.s
Normal file
2831
asm/palette.s
Normal file
File diff suppressed because it is too large
Load Diff
125
asm/play_time.s
Normal file
125
asm/play_time.s
Normal file
@ -0,0 +1,125 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start reset_playtime
|
||||
reset_playtime: @ 80841E4
|
||||
ldr r1, =0x03000e08
|
||||
movs r0, 0
|
||||
strb r0, [r1]
|
||||
ldr r2, =0x03005d90
|
||||
ldr r3, [r2]
|
||||
movs r1, 0
|
||||
movs r0, 0
|
||||
strh r0, [r3, 0xE]
|
||||
strb r1, [r3, 0x10]
|
||||
ldr r0, [r2]
|
||||
strb r1, [r0, 0x11]
|
||||
ldr r0, [r2]
|
||||
strb r1, [r0, 0x12]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end reset_playtime
|
||||
|
||||
thumb_func_start set_max_playtime_if_appropriate
|
||||
set_max_playtime_if_appropriate: @ 8084208
|
||||
push {lr}
|
||||
ldr r1, =0x03000e08
|
||||
movs r0, 0x1
|
||||
strb r0, [r1]
|
||||
ldr r0, =0x03005d90
|
||||
ldr r0, [r0]
|
||||
ldrh r1, [r0, 0xE]
|
||||
ldr r0, =0x000003e7
|
||||
cmp r1, r0
|
||||
bls _08084220
|
||||
bl set_max_playtime
|
||||
_08084220:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end set_max_playtime_if_appropriate
|
||||
|
||||
thumb_func_start sub_8084230
|
||||
sub_8084230: @ 8084230
|
||||
ldr r1, =0x03000e08
|
||||
movs r0, 0
|
||||
strb r0, [r1]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sub_8084230
|
||||
|
||||
thumb_func_start gametime_increment
|
||||
gametime_increment: @ 808423C
|
||||
push {lr}
|
||||
ldr r0, =0x03000e08
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0x1
|
||||
bne _08084294
|
||||
ldr r2, =0x03005d90
|
||||
ldr r0, [r2]
|
||||
ldrb r1, [r0, 0x12]
|
||||
adds r1, 0x1
|
||||
movs r3, 0
|
||||
strb r1, [r0, 0x12]
|
||||
ldr r1, [r2]
|
||||
ldrb r0, [r1, 0x12]
|
||||
cmp r0, 0x3B
|
||||
bls _08084294
|
||||
strb r3, [r1, 0x12]
|
||||
ldr r0, [r2]
|
||||
ldrb r1, [r0, 0x11]
|
||||
adds r1, 0x1
|
||||
strb r1, [r0, 0x11]
|
||||
ldr r1, [r2]
|
||||
ldrb r0, [r1, 0x11]
|
||||
cmp r0, 0x3B
|
||||
bls _08084294
|
||||
strb r3, [r1, 0x11]
|
||||
ldr r0, [r2]
|
||||
ldrb r1, [r0, 0x10]
|
||||
adds r1, 0x1
|
||||
strb r1, [r0, 0x10]
|
||||
ldr r1, [r2]
|
||||
ldrb r0, [r1, 0x10]
|
||||
cmp r0, 0x3B
|
||||
bls _08084294
|
||||
strb r3, [r1, 0x10]
|
||||
ldr r0, [r2]
|
||||
ldrh r1, [r0, 0xE]
|
||||
adds r1, 0x1
|
||||
strh r1, [r0, 0xE]
|
||||
lsls r1, 16
|
||||
ldr r0, =0x03e70000
|
||||
cmp r1, r0
|
||||
bls _08084294
|
||||
bl set_max_playtime
|
||||
_08084294:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end gametime_increment
|
||||
|
||||
thumb_func_start set_max_playtime
|
||||
set_max_playtime: @ 80842A4
|
||||
ldr r1, =0x03000e08
|
||||
movs r0, 0x2
|
||||
strb r0, [r1]
|
||||
ldr r2, =0x03005d90
|
||||
ldr r3, [r2]
|
||||
ldr r0, =0x000003e7
|
||||
strh r0, [r3, 0xE]
|
||||
movs r1, 0x3B
|
||||
strb r1, [r3, 0x10]
|
||||
ldr r0, [r2]
|
||||
strb r1, [r0, 0x11]
|
||||
ldr r0, [r2]
|
||||
strb r1, [r0, 0x12]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end set_max_playtime
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
3436
asm/player_pc.s
Normal file
3436
asm/player_pc.s
Normal file
File diff suppressed because it is too large
Load Diff
13372
asm/pokedex.s
Normal file
13372
asm/pokedex.s
Normal file
File diff suppressed because it is too large
Load Diff
1892
asm/pokedex_area_screen.s
Normal file
1892
asm/pokedex_area_screen.s
Normal file
File diff suppressed because it is too large
Load Diff
1010
asm/pokedex_cry_screen.s
Normal file
1010
asm/pokedex_cry_screen.s
Normal file
File diff suppressed because it is too large
Load Diff
3306
asm/pokemon_1.s
Normal file
3306
asm/pokemon_1.s
Normal file
File diff suppressed because it is too large
Load Diff
3992
asm/pokemon_2.s
Normal file
3992
asm/pokemon_2.s
Normal file
File diff suppressed because it is too large
Load Diff
282
asm/porthole.s
Normal file
282
asm/porthole.s
Normal file
@ -0,0 +1,282 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_80FB59C
|
||||
sub_80FB59C: @ 80FB59C
|
||||
push {r4-r6,lr}
|
||||
sub sp, 0xC
|
||||
mov r4, sp
|
||||
adds r4, 0x5
|
||||
mov r5, sp
|
||||
adds r5, 0x6
|
||||
add r6, sp, 0x8
|
||||
add r0, sp, 0x4
|
||||
adds r1, r4, 0
|
||||
adds r2, r5, 0
|
||||
adds r3, r6, 0
|
||||
bl sub_8137FFC
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _080FB5DE
|
||||
add r0, sp, 0x4
|
||||
ldrb r0, [r0]
|
||||
lsls r0, 24
|
||||
asrs r0, 24
|
||||
movs r1, 0
|
||||
ldrsb r1, [r4, r1]
|
||||
movs r2, 0x1
|
||||
negs r2, r2
|
||||
movs r3, 0
|
||||
ldrsb r3, [r5, r3]
|
||||
movs r4, 0
|
||||
ldrsb r4, [r6, r4]
|
||||
str r4, [sp]
|
||||
bl warp1_set
|
||||
movs r0, 0x1
|
||||
b _080FB5E0
|
||||
_080FB5DE:
|
||||
movs r0, 0
|
||||
_080FB5E0:
|
||||
add sp, 0xC
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80FB59C
|
||||
|
||||
thumb_func_start sub_80FB5E8
|
||||
sub_80FB5E8: @ 80FB5E8
|
||||
push {r4-r7,lr}
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
lsls r0, r5, 2
|
||||
adds r0, r5
|
||||
lsls r0, 3
|
||||
ldr r1, =0x03005e08
|
||||
adds r4, r0, r1
|
||||
ldr r0, =0x000040b4
|
||||
bl GetVarPointer
|
||||
adds r7, r0, 0
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r3, [r0]
|
||||
adds r6, r3, 0x4
|
||||
movs r0, 0
|
||||
ldrsh r2, [r4, r0]
|
||||
cmp r2, 0x1
|
||||
beq _080FB648
|
||||
cmp r2, 0x1
|
||||
bgt _080FB624
|
||||
cmp r2, 0
|
||||
beq _080FB62E
|
||||
b _080FB6E2
|
||||
.pool
|
||||
_080FB624:
|
||||
cmp r2, 0x2
|
||||
beq _080FB68A
|
||||
cmp r2, 0x3
|
||||
beq _080FB6C4
|
||||
b _080FB6E2
|
||||
_080FB62E:
|
||||
ldr r0, =0x02037fd4
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _080FB6E2
|
||||
strh r2, [r4, 0x2]
|
||||
movs r0, 0x2
|
||||
strh r0, [r4]
|
||||
b _080FB6E2
|
||||
.pool
|
||||
_080FB648:
|
||||
ldr r0, =0x030022c0
|
||||
ldrh r1, [r0, 0x2E]
|
||||
adds r0, r2, 0
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _080FB656
|
||||
strh r2, [r4, 0x2]
|
||||
_080FB656:
|
||||
ldrb r1, [r6, 0x1]
|
||||
ldrb r2, [r3, 0x4]
|
||||
movs r0, 0xFF
|
||||
bl sub_80D3340
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _080FB6E2
|
||||
movs r0, 0x1
|
||||
bl sub_8137FC0
|
||||
cmp r0, 0x1
|
||||
bne _080FB686
|
||||
ldrh r0, [r7]
|
||||
cmp r0, 0x2
|
||||
bne _080FB680
|
||||
movs r0, 0x9
|
||||
b _080FB682
|
||||
.pool
|
||||
_080FB680:
|
||||
movs r0, 0xA
|
||||
_080FB682:
|
||||
strh r0, [r7]
|
||||
b _080FB692
|
||||
_080FB686:
|
||||
movs r0, 0x2
|
||||
strh r0, [r4]
|
||||
_080FB68A:
|
||||
movs r1, 0x2
|
||||
ldrsh r0, [r4, r1]
|
||||
cmp r0, 0
|
||||
beq _080FB698
|
||||
_080FB692:
|
||||
movs r0, 0x3
|
||||
strh r0, [r4]
|
||||
b _080FB6E2
|
||||
_080FB698:
|
||||
ldrh r0, [r7]
|
||||
cmp r0, 0x2
|
||||
bne _080FB6AC
|
||||
ldrb r1, [r6, 0x1]
|
||||
ldrb r2, [r6]
|
||||
ldr r3, =gUnknown_0858E8AB
|
||||
b _080FB6B2
|
||||
.pool
|
||||
_080FB6AC:
|
||||
ldrb r1, [r6, 0x1]
|
||||
ldrb r2, [r6]
|
||||
ldr r3, =gUnknown_0858E8AD
|
||||
_080FB6B2:
|
||||
movs r0, 0xFF
|
||||
bl exec_movement
|
||||
movs r0, 0x1
|
||||
strh r0, [r4]
|
||||
b _080FB6E2
|
||||
.pool
|
||||
_080FB6C4:
|
||||
ldr r0, =0x00004001
|
||||
bl FlagReset
|
||||
movs r0, 0x80
|
||||
lsls r0, 7
|
||||
bl FlagReset
|
||||
movs r0, 0
|
||||
bl copy_saved_warp2_bank_and_enter_x_to_warp1
|
||||
bl sp13E_warp_to_last_warp
|
||||
adds r0, r5, 0
|
||||
bl DestroyTask
|
||||
_080FB6E2:
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80FB5E8
|
||||
|
||||
thumb_func_start sub_80FB6EC
|
||||
sub_80FB6EC: @ 80FB6EC
|
||||
push {r4,lr}
|
||||
sub sp, 0x4
|
||||
ldr r1, =DummyObjectCallback
|
||||
movs r0, 0
|
||||
str r0, [sp]
|
||||
movs r0, 0x8C
|
||||
movs r2, 0x70
|
||||
movs r3, 0x50
|
||||
bl AddPseudoFieldObject
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r2, =0x02020630
|
||||
lsls r1, r0, 4
|
||||
adds r1, r0
|
||||
lsls r1, 2
|
||||
adds r4, r1, r2
|
||||
adds r2, r4, 0
|
||||
adds r2, 0x3E
|
||||
ldrb r1, [r2]
|
||||
movs r0, 0x3
|
||||
negs r0, r0
|
||||
ands r0, r1
|
||||
strb r0, [r2]
|
||||
ldr r0, =0x000040b4
|
||||
bl VarGet
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
cmp r0, 0x2
|
||||
bne _080FB74C
|
||||
movs r0, 0x4
|
||||
bl FieldObjectDirectionToImageAnimId
|
||||
adds r1, r0, 0
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r4, 0
|
||||
bl StartObjectImageAnim
|
||||
b _080FB75E
|
||||
.pool
|
||||
_080FB74C:
|
||||
movs r0, 0x3
|
||||
bl FieldObjectDirectionToImageAnimId
|
||||
adds r1, r0, 0
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r4, 0
|
||||
bl StartObjectImageAnim
|
||||
_080FB75E:
|
||||
add sp, 0x4
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80FB6EC
|
||||
|
||||
thumb_func_start sub_80FB768
|
||||
sub_80FB768: @ 80FB768
|
||||
push {lr}
|
||||
bl sub_80FB6EC
|
||||
ldr r2, =0x02037350
|
||||
ldr r0, =0x02037590
|
||||
ldrb r1, [r0, 0x5]
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r2
|
||||
ldrb r1, [r0, 0x1]
|
||||
movs r2, 0x20
|
||||
orrs r1, r2
|
||||
strb r1, [r0, 0x1]
|
||||
bl pal_fill_black
|
||||
ldr r0, =sub_80FB5E8
|
||||
movs r1, 0x50
|
||||
bl CreateTask
|
||||
bl script_env_2_enable
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80FB768
|
||||
|
||||
thumb_func_start sub_80FB7A4
|
||||
sub_80FB7A4: @ 80FB7A4
|
||||
push {lr}
|
||||
ldr r0, =0x0000088d
|
||||
bl FlagSet
|
||||
ldr r0, =0x00004001
|
||||
bl FlagSet
|
||||
movs r0, 0x80
|
||||
lsls r0, 7
|
||||
bl FlagSet
|
||||
ldr r0, =0x03005d8c
|
||||
ldr r0, [r0]
|
||||
movs r1, 0x4
|
||||
ldrsb r1, [r0, r1]
|
||||
movs r2, 0x5
|
||||
ldrsb r2, [r0, r2]
|
||||
movs r3, 0x1
|
||||
negs r3, r3
|
||||
movs r0, 0
|
||||
bl saved_warp2_set
|
||||
bl sub_80FB59C
|
||||
bl sub_80AF8B8
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80FB7A4
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
3711
asm/record_mixing.s
Normal file
3711
asm/record_mixing.s
Normal file
File diff suppressed because it is too large
Load Diff
4288
asm/region_map.s
Normal file
4288
asm/region_map.s
Normal file
File diff suppressed because it is too large
Load Diff
1342
asm/reset_rtc_screen.s
Normal file
1342
asm/reset_rtc_screen.s
Normal file
File diff suppressed because it is too large
Load Diff
65
asm/rng.s
Normal file
65
asm/rng.s
Normal file
@ -0,0 +1,65 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start GenerateRandomNumber
|
||||
@ u16 GenerateRandomNumber()
|
||||
GenerateRandomNumber: @ 806F5CC
|
||||
ldr r2, =0x03005d80
|
||||
ldr r1, [r2]
|
||||
ldr r0, =0x41c64e6d
|
||||
muls r0, r1
|
||||
ldr r1, =0x00006073
|
||||
adds r0, r1
|
||||
str r0, [r2]
|
||||
ldr r2, =0x020249c0
|
||||
ldr r1, [r2]
|
||||
adds r1, 0x1
|
||||
str r1, [r2]
|
||||
lsrs r0, 16
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end GenerateRandomNumber
|
||||
|
||||
thumb_func_start SeedRng
|
||||
@ void SeedRng(u16 seed)
|
||||
SeedRng: @ 806F5F8
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
ldr r1, =0x03005d80
|
||||
str r0, [r1]
|
||||
ldr r1, =0x020249bc
|
||||
movs r0, 0
|
||||
strb r0, [r1]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end SeedRng
|
||||
|
||||
thumb_func_start SeedRng2
|
||||
SeedRng2: @ 806F610
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
ldr r1, =0x03005d84
|
||||
str r0, [r1]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end SeedRng2
|
||||
|
||||
thumb_func_start GenerateRandomNumber2
|
||||
GenerateRandomNumber2: @ 806F620
|
||||
ldr r2, =0x03005d84
|
||||
ldr r1, [r2]
|
||||
ldr r0, =0x41c64e6d
|
||||
muls r0, r1
|
||||
ldr r1, =0x00006073
|
||||
adds r0, r1
|
||||
str r0, [r2]
|
||||
lsrs r0, 16
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end GenerateRandomNumber2
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
3775
asm/rom3.s
Normal file
3775
asm/rom3.s
Normal file
File diff suppressed because it is too large
Load Diff
6825
asm/rom4.s
Normal file
6825
asm/rom4.s
Normal file
File diff suppressed because it is too large
Load Diff
1961
asm/rom5.s
Normal file
1961
asm/rom5.s
Normal file
File diff suppressed because it is too large
Load Diff
12772
asm/rom6.s
Normal file
12772
asm/rom6.s
Normal file
File diff suppressed because it is too large
Load Diff
212175
asm/rom_8032654.s
212175
asm/rom_8032654.s
File diff suppressed because it is too large
Load Diff
92399
asm/rom_8034C54.s
Normal file
92399
asm/rom_8034C54.s
Normal file
File diff suppressed because it is too large
Load Diff
7082
asm/rom_806BD04.s
Normal file
7082
asm/rom_806BD04.s
Normal file
File diff suppressed because it is too large
Load Diff
466
asm/rom_806F640.s
Normal file
466
asm/rom_806F640.s
Normal file
@ -0,0 +1,466 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start object_new_hidden_with_callback
|
||||
object_new_hidden_with_callback: @ 806F640
|
||||
push {r4-r6,lr}
|
||||
adds r6, r0, 0
|
||||
ldr r0, =gUnknown_0832A3A8
|
||||
movs r1, 0xF8
|
||||
movs r2, 0xA8
|
||||
movs r3, 0xE
|
||||
bl AddObjectToFront
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r5, =0x02020630
|
||||
lsls r2, r0, 4
|
||||
adds r2, r0
|
||||
lsls r2, 2
|
||||
adds r3, r2, r5
|
||||
adds r3, 0x3E
|
||||
ldrb r1, [r3]
|
||||
movs r4, 0x4
|
||||
orrs r1, r4
|
||||
strb r1, [r3]
|
||||
adds r5, 0x1C
|
||||
adds r2, r5
|
||||
str r6, [r2]
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end object_new_hidden_with_callback
|
||||
|
||||
thumb_func_start sub_806F67C
|
||||
sub_806F67C: @ 806F67C
|
||||
strh r1, [r0]
|
||||
lsrs r1, 16
|
||||
strh r1, [r0, 0x2]
|
||||
bx lr
|
||||
thumb_func_end sub_806F67C
|
||||
|
||||
thumb_func_start sub_806F684
|
||||
sub_806F684: @ 806F684
|
||||
ldrh r2, [r0]
|
||||
movs r3, 0x2
|
||||
ldrsh r0, [r0, r3]
|
||||
lsls r0, 16
|
||||
orrs r2, r0
|
||||
str r2, [r1]
|
||||
bx lr
|
||||
thumb_func_end sub_806F684
|
||||
|
||||
thumb_func_start sub_806F694
|
||||
sub_806F694: @ 806F694
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
ldr r4, [sp, 0x18]
|
||||
ldr r5, [sp, 0x1C]
|
||||
ldr r6, [sp, 0x20]
|
||||
ldr r7, [sp, 0x24]
|
||||
mov r8, r7
|
||||
str r1, [r0]
|
||||
str r2, [r0, 0x4]
|
||||
strh r3, [r0, 0x8]
|
||||
strh r4, [r0, 0xA]
|
||||
strh r5, [r0, 0xC]
|
||||
strh r6, [r0, 0xE]
|
||||
mov r1, r8
|
||||
strh r1, [r0, 0x10]
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_806F694
|
||||
|
||||
thumb_func_start sub_806F6C0
|
||||
sub_806F6C0: @ 806F6C0
|
||||
push {r4-r6,lr}
|
||||
mov r6, r8
|
||||
push {r6}
|
||||
sub sp, 0x24
|
||||
mov r8, r0
|
||||
ldr r0, [sp, 0x38]
|
||||
ldr r4, [sp, 0x3C]
|
||||
ldr r5, [sp, 0x40]
|
||||
ldr r6, [sp, 0x44]
|
||||
lsls r6, 16
|
||||
lsrs r6, 16
|
||||
lsls r3, 16
|
||||
asrs r3, 16
|
||||
lsls r0, 16
|
||||
asrs r0, 16
|
||||
str r0, [sp]
|
||||
lsls r4, 16
|
||||
asrs r4, 16
|
||||
str r4, [sp, 0x4]
|
||||
lsls r5, 16
|
||||
asrs r5, 16
|
||||
str r5, [sp, 0x8]
|
||||
str r6, [sp, 0xC]
|
||||
add r0, sp, 0x10
|
||||
bl sub_806F694
|
||||
add r0, sp, 0x10
|
||||
mov r1, r8
|
||||
movs r2, 0x1
|
||||
bl BgAffineSet
|
||||
add sp, 0x24
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_806F6C0
|
||||
|
||||
thumb_func_start rfu_MBOOT_CHILD_inheritanceLinkStatus
|
||||
rfu_MBOOT_CHILD_inheritanceLinkStatus: @ 806F70C
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x38
|
||||
str r2, [sp, 0x20]
|
||||
adds r4, r3, 0
|
||||
ldr r7, [sp, 0x58]
|
||||
lsls r0, 24
|
||||
lsls r1, 24
|
||||
ldr r2, =gUnknown_0832A3C0
|
||||
lsrs r1, 23
|
||||
lsrs r0, 21
|
||||
adds r1, r0
|
||||
adds r0, r2, 0x1
|
||||
adds r0, r1, r0
|
||||
ldrb r0, [r0]
|
||||
str r0, [sp, 0x24]
|
||||
adds r1, r2
|
||||
ldrb r1, [r1]
|
||||
str r1, [sp, 0x28]
|
||||
movs r0, 0
|
||||
b _0806F88C
|
||||
.pool
|
||||
_0806F740:
|
||||
movs r5, 0
|
||||
adds r0, 0x1
|
||||
str r0, [sp, 0x30]
|
||||
b _0806F874
|
||||
_0806F748:
|
||||
ldrh r0, [r4]
|
||||
ldr r2, =0x000003ff
|
||||
adds r1, r2, 0
|
||||
ands r1, r0
|
||||
lsls r1, 5
|
||||
mov r8, r1
|
||||
movs r2, 0xC0
|
||||
lsls r2, 4
|
||||
adds r1, r2, 0
|
||||
ands r1, r0
|
||||
mov r2, sp
|
||||
strh r0, [r2, 0x34]
|
||||
cmp r1, 0
|
||||
bne _0806F788
|
||||
ldr r0, [sp, 0x20]
|
||||
add r0, r8
|
||||
adds r1, r7, 0
|
||||
ldr r2, =0x04000008
|
||||
bl CpuSet
|
||||
adds r4, 0x2
|
||||
str r4, [sp, 0x2C]
|
||||
adds r7, 0x20
|
||||
mov r10, r7
|
||||
adds r5, 0x1
|
||||
mov r9, r5
|
||||
b _0806F86A
|
||||
.pool
|
||||
_0806F788:
|
||||
movs r0, 0x80
|
||||
lsls r0, 4
|
||||
cmp r1, r0
|
||||
bne _0806F7CC
|
||||
movs r1, 0
|
||||
adds r4, 0x2
|
||||
str r4, [sp, 0x2C]
|
||||
movs r2, 0x20
|
||||
adds r2, r7
|
||||
mov r10, r2
|
||||
adds r5, 0x1
|
||||
mov r9, r5
|
||||
_0806F7A0:
|
||||
lsls r4, r1, 24
|
||||
asrs r4, 24
|
||||
movs r0, 0x7
|
||||
subs r0, r4
|
||||
lsls r0, 2
|
||||
add r0, r8
|
||||
ldr r1, [sp, 0x20]
|
||||
adds r0, r1, r0
|
||||
lsls r1, r4, 2
|
||||
adds r1, r7, r1
|
||||
ldr r2, =0x04000001
|
||||
bl CpuSet
|
||||
adds r4, 0x1
|
||||
lsls r4, 24
|
||||
lsrs r1, r4, 24
|
||||
asrs r4, 24
|
||||
cmp r4, 0x7
|
||||
ble _0806F7A0
|
||||
b _0806F86A
|
||||
.pool
|
||||
_0806F7CC:
|
||||
movs r1, 0
|
||||
adds r4, 0x2
|
||||
str r4, [sp, 0x2C]
|
||||
movs r2, 0x20
|
||||
adds r2, r7
|
||||
mov r10, r2
|
||||
adds r5, 0x1
|
||||
mov r9, r5
|
||||
movs r0, 0xF
|
||||
mov r12, r0
|
||||
_0806F7E0:
|
||||
movs r2, 0
|
||||
lsls r4, r1, 24
|
||||
lsls r0, r4, 2
|
||||
lsrs r0, 24
|
||||
adds r6, r0, 0x3
|
||||
mov r1, r8
|
||||
adds r5, r1, r0
|
||||
_0806F7EE:
|
||||
lsls r1, r2, 24
|
||||
asrs r1, 24
|
||||
subs r0, r6, r1
|
||||
mov r2, sp
|
||||
adds r3, r2, r0
|
||||
adds r0, r5, r1
|
||||
ldr r2, [sp, 0x20]
|
||||
adds r0, r2, r0
|
||||
ldrb r2, [r0]
|
||||
mov r0, r12
|
||||
ands r0, r2
|
||||
lsls r0, 4
|
||||
lsrs r2, 4
|
||||
orrs r0, r2
|
||||
strb r0, [r3]
|
||||
adds r1, 0x1
|
||||
lsls r1, 24
|
||||
lsrs r2, r1, 24
|
||||
asrs r1, 24
|
||||
cmp r1, 0x3
|
||||
ble _0806F7EE
|
||||
movs r1, 0x80
|
||||
lsls r1, 17
|
||||
adds r0, r4, r1
|
||||
lsrs r1, r0, 24
|
||||
asrs r0, 24
|
||||
cmp r0, 0x7
|
||||
ble _0806F7E0
|
||||
mov r2, sp
|
||||
ldrh r0, [r2, 0x34]
|
||||
movs r2, 0x80
|
||||
lsls r2, 4
|
||||
ands r0, r2
|
||||
cmp r0, 0
|
||||
beq _0806F860
|
||||
movs r1, 0
|
||||
_0806F836:
|
||||
lsls r4, r1, 24
|
||||
asrs r4, 24
|
||||
movs r0, 0x7
|
||||
subs r0, r4
|
||||
lsls r0, 2
|
||||
add r0, sp
|
||||
lsls r1, r4, 2
|
||||
adds r1, r7, r1
|
||||
ldr r2, =0x04000001
|
||||
bl CpuSet
|
||||
adds r4, 0x1
|
||||
lsls r4, 24
|
||||
lsrs r1, r4, 24
|
||||
asrs r4, 24
|
||||
cmp r4, 0x7
|
||||
ble _0806F836
|
||||
b _0806F86A
|
||||
.pool
|
||||
_0806F860:
|
||||
mov r0, sp
|
||||
adds r1, r7, 0
|
||||
ldr r2, =0x04000008
|
||||
bl CpuSet
|
||||
_0806F86A:
|
||||
ldr r4, [sp, 0x2C]
|
||||
mov r7, r10
|
||||
mov r1, r9
|
||||
lsls r0, r1, 24
|
||||
lsrs r5, r0, 24
|
||||
_0806F874:
|
||||
ldr r2, [sp, 0x28]
|
||||
cmp r5, r2
|
||||
bcs _0806F87C
|
||||
b _0806F748
|
||||
_0806F87C:
|
||||
movs r0, 0x20
|
||||
ldr r1, [sp, 0x28]
|
||||
subs r0, r1
|
||||
lsls r0, 1
|
||||
adds r4, r0
|
||||
ldr r2, [sp, 0x30]
|
||||
lsls r0, r2, 24
|
||||
lsrs r0, 24
|
||||
_0806F88C:
|
||||
ldr r1, [sp, 0x24]
|
||||
cmp r0, r1
|
||||
bcs _0806F894
|
||||
b _0806F740
|
||||
_0806F894:
|
||||
add sp, 0x38
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end rfu_MBOOT_CHILD_inheritanceLinkStatus
|
||||
|
||||
thumb_func_start sub_806F8A8
|
||||
sub_806F8A8: @ 806F8A8
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
movs r1, 0
|
||||
movs r3, 0x1
|
||||
_0806F8B0:
|
||||
adds r0, r2, 0
|
||||
ands r0, r3
|
||||
cmp r0, 0
|
||||
beq _0806F8BC
|
||||
adds r0, r1, 0
|
||||
b _0806F8CA
|
||||
_0806F8BC:
|
||||
lsrs r2, 1
|
||||
adds r0, r1, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r1, r0, 24
|
||||
cmp r1, 0x1F
|
||||
bls _0806F8B0
|
||||
movs r0, 0
|
||||
_0806F8CA:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_806F8A8
|
||||
|
||||
thumb_func_start sub_806F8D0
|
||||
sub_806F8D0: @ 806F8D0
|
||||
push {r4-r7,lr}
|
||||
adds r7, r0, 0
|
||||
adds r4, r1, 0
|
||||
ldr r2, =0x00001121
|
||||
movs r3, 0
|
||||
cmp r3, r4
|
||||
bge _0806F91C
|
||||
movs r6, 0x1
|
||||
ldr r0, =0x00008408
|
||||
adds r5, r0, 0
|
||||
_0806F8E4:
|
||||
adds r0, r7, r3
|
||||
ldrb r0, [r0]
|
||||
eors r2, r0
|
||||
movs r1, 0
|
||||
adds r3, 0x1
|
||||
_0806F8EE:
|
||||
adds r0, r2, 0
|
||||
ands r0, r6
|
||||
cmp r0, 0
|
||||
beq _0806F908
|
||||
lsrs r0, r2, 1
|
||||
eors r0, r5
|
||||
lsls r0, 16
|
||||
lsrs r2, r0, 16
|
||||
b _0806F90A
|
||||
.pool
|
||||
_0806F908:
|
||||
lsrs r2, 1
|
||||
_0806F90A:
|
||||
adds r0, r1, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r1, r0, 16
|
||||
cmp r1, 0x7
|
||||
bls _0806F8EE
|
||||
lsls r0, r3, 16
|
||||
lsrs r3, r0, 16
|
||||
cmp r3, r4
|
||||
blt _0806F8E4
|
||||
_0806F91C:
|
||||
mvns r0, r2
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_806F8D0
|
||||
|
||||
thumb_func_start sub_806F928
|
||||
sub_806F928: @ 806F928
|
||||
push {r4-r6,lr}
|
||||
adds r5, r0, 0
|
||||
adds r4, r1, 0
|
||||
ldr r2, =0x00001121
|
||||
movs r3, 0
|
||||
cmp r3, r4
|
||||
bcs _0806F956
|
||||
ldr r6, =gUnknown_0832A3D8
|
||||
_0806F938:
|
||||
lsrs r1, r2, 8
|
||||
adds r0, r5, r3
|
||||
ldrb r0, [r0]
|
||||
eors r2, r0
|
||||
lsls r0, r2, 24
|
||||
lsrs r0, 23
|
||||
adds r0, r6
|
||||
ldrh r0, [r0]
|
||||
adds r2, r0, 0
|
||||
eors r2, r1
|
||||
adds r0, r3, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r3, r0, 16
|
||||
cmp r3, r4
|
||||
bcc _0806F938
|
||||
_0806F956:
|
||||
mvns r0, r2
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_806F928
|
||||
|
||||
thumb_func_start sub_806F96C
|
||||
sub_806F96C: @ 806F96C
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
movs r3, 0
|
||||
movs r2, 0
|
||||
cmp r3, r1
|
||||
bcs _0806F984
|
||||
_0806F978:
|
||||
adds r0, r4, r2
|
||||
ldrb r0, [r0]
|
||||
adds r3, r0
|
||||
adds r2, 0x1
|
||||
cmp r2, r1
|
||||
bcc _0806F978
|
||||
_0806F984:
|
||||
adds r0, r3, 0
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_806F96C
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
8793
asm/rom_8072304.s
Normal file
8793
asm/rom_8072304.s
Normal file
File diff suppressed because it is too large
Load Diff
2854
asm/rom_809BEDC.s
Normal file
2854
asm/rom_809BEDC.s
Normal file
File diff suppressed because it is too large
Load Diff
2236
asm/rom_809D7BC.s
Normal file
2236
asm/rom_809D7BC.s
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user