2016-11-01 18:08:48 +01:00
|
|
|
.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}
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r0, =gStringVar4
|
2017-11-07 23:11:48 +01:00
|
|
|
ldr r1, =gText_MysteryGiftCantBeUsed
|
2017-01-14 20:53:20 +01:00
|
|
|
bl StringExpandPlaceholders
|
2016-11-01 18:08:48 +01:00
|
|
|
movs r0, 0x3
|
2017-10-12 09:06:19 +02:00
|
|
|
bl SetMysteryEventScriptStatus
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2017-09-10 23:05:23 +02:00
|
|
|
bl InitScriptContext
|
2016-11-01 18:08:48 +01:00
|
|
|
adds r0, r4, 0
|
|
|
|
adds r1, r5, 0
|
2017-09-10 23:05:23 +02:00
|
|
|
bl SetupBytecodeScript
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2017-09-10 23:05:23 +02:00
|
|
|
bl RunScriptCommand
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2016-11-01 19:35:16 +01:00
|
|
|
ldr r0, =gUnknown_0203BBC0
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2016-11-01 19:35:16 +01:00
|
|
|
ldr r4, =gUnknown_0203BBC0
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2016-11-01 19:35:16 +01:00
|
|
|
ldr r4, =gUnknown_0203BBC0
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
|
|
|
|
2017-10-12 09:06:19 +02:00
|
|
|
thumb_func_start SetMysteryEventScriptStatus
|
|
|
|
SetMysteryEventScriptStatus: @ 81538C4
|
2016-11-01 19:35:16 +01:00
|
|
|
ldr r1, =gUnknown_0203BBC0
|
2016-11-01 18:08:48 +01:00
|
|
|
str r0, [r1, 0x6C]
|
|
|
|
bx lr
|
|
|
|
.pool
|
2017-10-12 09:06:19 +02:00
|
|
|
thumb_func_end SetMysteryEventScriptStatus
|
2016-11-01 18:08:48 +01:00
|
|
|
|
|
|
|
thumb_func_start sub_81538D0
|
|
|
|
sub_81538D0: @ 81538D0
|
|
|
|
push {lr}
|
|
|
|
movs r2, 0
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r0, =gSaveBlock1Ptr
|
2016-11-01 18:08:48 +01:00
|
|
|
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}
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r5, =gSaveBlock1Ptr
|
2016-11-01 18:08:48 +01:00
|
|
|
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]
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r0, =gSaveBlock1Ptr
|
2016-11-01 18:08:48 +01:00
|
|
|
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:
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r4, =gSaveBlock1Ptr
|
2016-11-01 18:08:48 +01:00
|
|
|
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}
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r6, =gSaveBlock1Ptr
|
2016-11-01 18:08:48 +01:00
|
|
|
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}
|
2017-09-10 23:05:23 +02:00
|
|
|
bl StopScript
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2017-09-10 23:05:23 +02:00
|
|
|
bl ScriptReadWord
|
2016-11-01 18:08:48 +01:00
|
|
|
str r0, [r7, 0x68]
|
|
|
|
adds r0, r7, 0
|
2017-09-10 23:05:23 +02:00
|
|
|
bl ScriptReadHalfword
|
2016-11-01 18:08:48 +01:00
|
|
|
adds r5, r0, 0
|
|
|
|
lsls r5, 16
|
|
|
|
lsrs r5, 16
|
|
|
|
adds r0, r7, 0
|
2017-09-10 23:05:23 +02:00
|
|
|
bl ScriptReadWord
|
2016-11-01 18:08:48 +01:00
|
|
|
adds r6, r0, 0
|
|
|
|
adds r0, r7, 0
|
2017-09-10 23:05:23 +02:00
|
|
|
bl ScriptReadHalfword
|
2016-11-01 18:08:48 +01:00
|
|
|
adds r4, r0, 0
|
|
|
|
lsls r4, 16
|
|
|
|
lsrs r4, 16
|
|
|
|
adds r0, r7, 0
|
2017-09-10 23:05:23 +02:00
|
|
|
bl ScriptReadWord
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2017-09-10 23:05:23 +02:00
|
|
|
bl ScriptReadWord
|
2016-11-01 18:08:48 +01:00
|
|
|
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:
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r0, =gStringVar4
|
|
|
|
bl StringExpandPlaceholders
|
2016-11-01 18:08:48 +01:00
|
|
|
_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
|
2017-09-10 23:05:23 +02:00
|
|
|
bl ScriptReadWord
|
2016-11-01 18:08:48 +01:00
|
|
|
ldr r1, [r4, 0x68]
|
|
|
|
subs r0, r1
|
|
|
|
ldr r1, [r4, 0x64]
|
|
|
|
adds r0, r1
|
2017-09-03 22:50:17 +02:00
|
|
|
bl ScriptContext2_RunNewScript
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2017-09-13 11:16:26 +02:00
|
|
|
bl IsEnigmaBerryValid
|
2016-11-01 18:08:48 +01:00
|
|
|
mov r8, r0
|
|
|
|
adds r0, r7, 0
|
2017-09-10 23:05:23 +02:00
|
|
|
bl ScriptReadWord
|
2016-11-01 18:08:48 +01:00
|
|
|
adds r4, r0, 0
|
|
|
|
ldr r0, [r7, 0x68]
|
|
|
|
subs r4, r0
|
|
|
|
ldr r0, [r7, 0x64]
|
|
|
|
adds r4, r0
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r0, =gStringVar1
|
2016-11-01 18:08:48 +01:00
|
|
|
mov r9, r0
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r6, =gSaveBlock1Ptr
|
2016-11-01 18:08:48 +01:00
|
|
|
ldr r1, [r6]
|
|
|
|
ldr r5, =0x000031f8
|
|
|
|
adds r1, r5
|
|
|
|
movs r2, 0x7
|
2017-01-14 20:53:20 +01:00
|
|
|
bl StringCopyN
|
2016-11-01 18:08:48 +01:00
|
|
|
adds r0, r4, 0
|
2017-09-13 11:16:26 +02:00
|
|
|
bl SetEnigmaBerry
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r4, =gStringVar2
|
2016-11-01 18:08:48 +01:00
|
|
|
ldr r1, [r6]
|
|
|
|
adds r1, r5
|
|
|
|
adds r0, r4, 0
|
|
|
|
movs r2, 0x7
|
2017-01-14 20:53:20 +01:00
|
|
|
bl StringCopyN
|
2016-11-01 18:08:48 +01:00
|
|
|
mov r0, r8
|
|
|
|
cmp r0, 0
|
|
|
|
bne _08153B54
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r0, =gStringVar4
|
2017-11-07 23:11:48 +01:00
|
|
|
ldr r1, =gText_MysteryGiftBerry
|
2016-11-01 18:08:48 +01:00
|
|
|
b _08153B74
|
|
|
|
.pool
|
|
|
|
_08153B54:
|
|
|
|
mov r0, r9
|
|
|
|
adds r1, r4, 0
|
2017-01-14 20:53:20 +01:00
|
|
|
bl StringCompare
|
2016-11-01 18:08:48 +01:00
|
|
|
cmp r0, 0
|
|
|
|
beq _08153B70
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r0, =gStringVar4
|
2017-11-07 23:11:48 +01:00
|
|
|
ldr r1, =gText_MysteryGiftBerryTransform
|
2016-11-01 18:08:48 +01:00
|
|
|
b _08153B74
|
|
|
|
.pool
|
|
|
|
_08153B70:
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r0, =gStringVar4
|
2017-11-07 23:11:48 +01:00
|
|
|
ldr r1, =gText_MysteryGiftBerryObtained
|
2016-11-01 18:08:48 +01:00
|
|
|
_08153B74:
|
2017-01-14 20:53:20 +01:00
|
|
|
bl StringExpandPlaceholders
|
2016-11-01 18:08:48 +01:00
|
|
|
movs r0, 0x2
|
|
|
|
str r0, [r7, 0x6C]
|
2017-09-13 11:16:26 +02:00
|
|
|
bl IsEnigmaBerryValid
|
2016-11-01 18:08:48 +01:00
|
|
|
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]
|
2017-09-08 22:23:14 +02:00
|
|
|
bl GiveGiftRibbonToParty
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r0, =gStringVar4
|
2017-11-07 23:11:48 +01:00
|
|
|
ldr r1, =gText_MysteryGiftSpecialRibbon
|
2017-01-14 20:53:20 +01:00
|
|
|
bl StringExpandPlaceholders
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2017-09-10 23:05:23 +02:00
|
|
|
bl ScriptReadWord
|
2016-11-01 18:08:48 +01:00
|
|
|
adds r5, r0, 0
|
|
|
|
ldr r0, [r4, 0x68]
|
|
|
|
subs r5, r0
|
|
|
|
ldr r0, [r4, 0x64]
|
|
|
|
adds r5, r0
|
|
|
|
adds r0, r4, 0
|
2017-09-10 23:05:23 +02:00
|
|
|
bl ScriptReadWord
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2017-09-10 23:05:23 +02:00
|
|
|
bl InitRamScript
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2017-09-02 21:43:53 +02:00
|
|
|
bl EnableNationalPokedex
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r0, =gStringVar4
|
2017-11-07 23:11:48 +01:00
|
|
|
ldr r1, =gText_MysteryGiftNationalDex
|
2017-01-14 20:53:20 +01:00
|
|
|
bl StringExpandPlaceholders
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r0, =gStringVar4
|
2017-11-07 23:11:48 +01:00
|
|
|
ldr r1, =gText_MysteryGiftRareWord
|
2017-01-14 20:53:20 +01:00
|
|
|
bl StringExpandPlaceholders
|
2016-11-01 18:08:48 +01:00
|
|
|
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]
|
2017-09-10 23:05:23 +02:00
|
|
|
bl ScriptReadHalfword
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2017-09-10 23:05:23 +02:00
|
|
|
bl ScriptReadWord
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2017-02-04 03:34:56 +01:00
|
|
|
bl GetMonData
|
2016-11-01 18:08:48 +01:00
|
|
|
lsls r0, 16
|
|
|
|
lsrs r4, r0, 16
|
|
|
|
movs r0, 0xCE
|
|
|
|
lsls r0, 1
|
|
|
|
cmp r4, r0
|
|
|
|
bne _08153D18
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r0, =gStringVar1
|
2017-09-16 21:24:47 +02:00
|
|
|
ldr r1, =gText_EggNickname
|
2016-11-01 18:08:48 +01:00
|
|
|
movs r2, 0xB
|
2017-01-14 20:53:20 +01:00
|
|
|
bl StringCopyN
|
2016-11-01 18:08:48 +01:00
|
|
|
b _08153D22
|
|
|
|
.pool
|
|
|
|
_08153D18:
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r0, =gStringVar1
|
2017-09-12 08:23:34 +02:00
|
|
|
ldr r1, =gText_Pokemon
|
2016-11-01 18:08:48 +01:00
|
|
|
movs r2, 0xB
|
2017-01-14 20:53:20 +01:00
|
|
|
bl StringCopyN
|
2016-11-01 18:08:48 +01:00
|
|
|
_08153D22:
|
2017-09-03 22:50:17 +02:00
|
|
|
ldr r0, =gPlayerPartyCount
|
2016-11-01 18:08:48 +01:00
|
|
|
ldrb r0, [r0]
|
|
|
|
cmp r0, 0x6
|
|
|
|
bne _08153D4C
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r0, =gStringVar4
|
2017-11-07 23:11:48 +01:00
|
|
|
ldr r1, =gText_MysteryGiftFullParty
|
2017-01-14 20:53:20 +01:00
|
|
|
bl StringExpandPlaceholders
|
2016-11-01 18:08:48 +01:00
|
|
|
movs r0, 0x3
|
|
|
|
b _08153DB6
|
|
|
|
.pool
|
|
|
|
_08153D4C:
|
2017-09-06 22:01:43 +02:00
|
|
|
ldr r7, =gPlayerParty + 500
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2017-09-12 15:05:40 +02:00
|
|
|
bl GetSetPokedexFlag
|
2016-11-01 18:08:48 +01:00
|
|
|
adds r0, r4, 0
|
|
|
|
movs r1, 0x3
|
2017-09-12 15:05:40 +02:00
|
|
|
bl GetSetPokedexFlag
|
2016-11-01 18:08:48 +01:00
|
|
|
_08153D86:
|
|
|
|
adds r0, r7, 0
|
|
|
|
movs r1, 0xC
|
2017-02-04 03:34:56 +01:00
|
|
|
bl GetMonData
|
2016-11-01 18:08:48 +01:00
|
|
|
lsls r0, 16
|
|
|
|
lsrs r0, 16
|
2017-12-03 19:19:11 +01:00
|
|
|
bl ItemIsMail
|
2016-11-01 18:08:48 +01:00
|
|
|
lsls r0, 24
|
|
|
|
cmp r0, 0
|
|
|
|
beq _08153DA4
|
|
|
|
adds r0, r7, 0
|
|
|
|
mov r1, sp
|
2017-11-14 20:23:25 +01:00
|
|
|
bl GiveMailToMon2
|
2016-11-01 18:08:48 +01:00
|
|
|
_08153DA4:
|
2017-11-14 20:23:25 +01:00
|
|
|
bl CompactPartySlots
|
2017-09-06 18:34:18 +02:00
|
|
|
bl CalculatePlayerPartyCount
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r0, =gStringVar4
|
2017-11-07 23:11:48 +01:00
|
|
|
ldr r1, =gText_MysteryGiftSentOver
|
2017-01-14 20:53:20 +01:00
|
|
|
bl StringExpandPlaceholders
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2017-09-10 23:05:23 +02:00
|
|
|
bl ScriptReadWord
|
2016-11-01 18:08:48 +01:00
|
|
|
adds r1, r0, 0
|
|
|
|
ldr r0, [r4, 0x68]
|
|
|
|
subs r1, r0
|
|
|
|
ldr r0, [r4, 0x64]
|
|
|
|
adds r1, r0
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r0, =gSaveBlock2Ptr
|
2016-11-01 18:08:48 +01:00
|
|
|
ldr r0, [r0]
|
|
|
|
ldr r2, =0x00000bec
|
|
|
|
adds r0, r2
|
|
|
|
movs r2, 0xBC
|
|
|
|
bl memcpy
|
|
|
|
bl sub_81652B4
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r0, =gStringVar4
|
2017-11-07 23:11:48 +01:00
|
|
|
ldr r1, =gText_MysteryGiftNewTrainer
|
2017-01-14 20:53:20 +01:00
|
|
|
bl StringExpandPlaceholders
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2017-09-02 22:31:37 +02:00
|
|
|
bl EnableResetRTC
|
2017-01-14 20:53:20 +01:00
|
|
|
ldr r0, =gStringVar4
|
2017-09-20 21:38:05 +02:00
|
|
|
ldr r1, =gText_InGameClockUsable
|
2017-01-14 20:53:20 +01:00
|
|
|
bl StringExpandPlaceholders
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2017-09-10 23:05:23 +02:00
|
|
|
bl ScriptReadWord
|
2016-11-01 18:08:48 +01:00
|
|
|
adds r5, r0, 0
|
|
|
|
adds r0, r6, 0
|
2017-09-10 23:05:23 +02:00
|
|
|
bl ScriptReadWord
|
2016-11-01 18:08:48 +01:00
|
|
|
adds r4, r0, 0
|
|
|
|
ldr r0, [r6, 0x68]
|
|
|
|
subs r4, r0
|
|
|
|
ldr r0, [r6, 0x64]
|
|
|
|
adds r4, r0
|
|
|
|
adds r0, r6, 0
|
2017-09-10 23:05:23 +02:00
|
|
|
bl ScriptReadWord
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2017-01-15 02:33:43 +01:00
|
|
|
bl CalcByteArraySum
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2017-09-10 23:05:23 +02:00
|
|
|
bl ScriptReadWord
|
2016-11-01 18:08:48 +01:00
|
|
|
adds r5, r0, 0
|
|
|
|
adds r0, r6, 0
|
2017-09-10 23:05:23 +02:00
|
|
|
bl ScriptReadWord
|
2016-11-01 18:08:48 +01:00
|
|
|
adds r4, r0, 0
|
|
|
|
ldr r0, [r6, 0x68]
|
|
|
|
subs r4, r0
|
|
|
|
ldr r0, [r6, 0x64]
|
|
|
|
adds r4, r0
|
|
|
|
adds r0, r6, 0
|
2017-09-10 23:05:23 +02:00
|
|
|
bl ScriptReadWord
|
2016-11-01 18:08:48 +01:00
|
|
|
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
|
2017-01-15 02:33:43 +01:00
|
|
|
bl CalcCRC16
|
2016-11-01 18:08:48 +01:00
|
|
|
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.
|