split roamer and decor inventories

This commit is contained in:
DizzyEggg 2017-09-04 13:01:57 +02:00
parent 75a94ce58e
commit 4bf54bfdd4
27 changed files with 12617 additions and 12585 deletions

View File

@ -1960,7 +1960,7 @@ sub_8070954: @ 8070954
adds r1, r5, 0
movs r2, 0x5
movs r3, 0x20
bl create_pokemon_set_level
bl CreateMon
movs r0, 0x12
add r0, sp
mov r8, r0
@ -2050,7 +2050,7 @@ sub_8070A0C: @ 8070A0C
adds r1, r5, 0
movs r2, 0x5
movs r3, 0x20
bl create_pokemon_set_level
bl CreateMon
movs r0, 0x12
add r0, sp
mov r9, r0

View File

@ -13,7 +13,7 @@ sub_8126968: @ 8126968
cmp r0, 0x7
bhi _0812697E
ldr r2, =gUnknown_0203A14C
ldr r1, =gUnknown_0203BC40
ldr r1, =gDecorationInventories
lsls r0, 3
adds r0, r1
ldr r0, [r0]
@ -756,7 +756,7 @@ _08126FA2:
movs r0, 0xBA
strb r0, [r6]
adds r6, 0x1
ldr r1, =gUnknown_0203BC40
ldr r1, =gDecorationInventories
mov r2, r8
lsls r0, r2, 3
adds r0, r1
@ -883,7 +883,7 @@ sub_81270E8: @ 81270E8
ldrb r0, [r4]
bl sub_8161A38
ldr r2, =gUnknown_0203A14C
ldr r1, =gUnknown_0203BC40
ldr r1, =gDecorationInventories
ldrb r0, [r4]
lsls r0, 3
adds r0, r1
@ -1614,7 +1614,7 @@ sub_8127744: @ 8127744
b _08127782
.pool
_08127770:
ldr r1, =gUnknown_085A5C08
ldr r1, =gDecorations
ldr r0, =gUnknown_0203A14C
ldr r0, [r0]
adds r0, r4
@ -1740,7 +1740,7 @@ _08127842:
mov r3, r8
ldrb r0, [r3]
lsls r0, 3
ldr r1, =gUnknown_0203BC40
ldr r1, =gDecorationInventories
adds r0, r1
ldrb r0, [r0, 0x4]
cmp r2, r0
@ -1807,7 +1807,7 @@ _081278E2:
bls _08127842
movs r5, 0
movs r6, 0
ldr r3, =gUnknown_0203BC40
ldr r3, =gDecorationInventories
mov r8, r3
_081278F4:
ldr r0, =gSaveBlock1Ptr
@ -2193,7 +2193,7 @@ _08127BF0:
ldr r0, =gUnknown_085A5C24
adds r0, r4, r0
str r0, [sp, 0x1C]
ldr r0, =gUnknown_085A5C08
ldr r0, =gDecorations
adds r0, r4, r0
str r0, [sp, 0x24]
ldr r3, [sp, 0x8]
@ -2267,7 +2267,7 @@ _08127C8E:
movs r6, 0
_08127C90:
ldr r3, [sp, 0x18]
ldr r4, =gUnknown_085A5C08
ldr r4, =gDecorations
adds r0, r3, r4
ldrb r0, [r0]
ldr r4, [sp, 0x20]
@ -2360,7 +2360,7 @@ sub_8127D38: @ 8127D38
lsrs r4, r1, 16
lsls r2, 16
lsrs r2, 16
ldr r1, =gUnknown_085A5C08
ldr r1, =gDecorations
lsls r0, r2, 5
adds r0, r1
ldrb r0, [r0, 0x12]
@ -2954,7 +2954,7 @@ sub_812826C: @ 812826C
push {lr}
lsls r0, 24
lsrs r3, r0, 24
ldr r2, =gUnknown_085A5C08
ldr r2, =gDecorations
ldr r0, =gUnknown_0203A172
ldrb r1, [r0]
ldr r0, =gUnknown_0203A14C
@ -3826,7 +3826,7 @@ sub_8128950: @ 8128950
adds r0, r1
ldrb r1, [r0]
lsls r1, 5
ldr r0, =gUnknown_085A5C08
ldr r0, =gDecorations
adds r1, r0
adds r0, r5, 0
bl sub_812853C
@ -3888,7 +3888,7 @@ sub_81289F0: @ 81289F0
bl sub_8197434
adds r0, r4, 0
bl sub_8128AAC
ldr r2, =gUnknown_085A5C08
ldr r2, =gDecorations
ldr r0, =gUnknown_0203A172
ldrb r1, [r0]
ldr r0, =gUnknown_0203A14C
@ -5071,7 +5071,7 @@ gpu_pal_decompress_alloc_tag_and_upload: @ 8129334
lsrs r4, 24
bl sub_8129048
lsls r4, 5
ldr r0, =gUnknown_085A5C08
ldr r0, =gDecorations
adds r4, r0
str r4, [r5]
ldrb r0, [r4, 0x11]
@ -5253,7 +5253,7 @@ AddDecorationIconObjectFromFieldObject: @ 81294C0
adds r0, r6, 0
bl sub_8129048
lsls r4, 5
ldr r0, =gUnknown_085A5C08
ldr r0, =gDecorations
adds r4, r0
str r4, [r6]
ldrb r0, [r4, 0x11]
@ -5539,7 +5539,7 @@ _08129738:
b _08129796
.pool
_08129744:
ldr r3, =gUnknown_085A5C08
ldr r3, =gDecorations
ldr r2, =gUnknown_0203A17C
ldr r1, =gUnknown_0203AA44
ldrh r0, [r4]
@ -5646,7 +5646,7 @@ _08129808:
adds r0, r1
ldrb r0, [r0]
lsls r0, 5
ldr r7, =gUnknown_085A5C08
ldr r7, =gDecorations
adds r0, r7
ldrb r2, [r0, 0x11]
ldr r7, =gUnknown_0203A17C
@ -6271,7 +6271,7 @@ sub_8129D8C: @ 8129D8C
push {lr}
adds r2, r1, 0
lsls r0, 24
ldr r1, =gUnknown_085A5C08
ldr r1, =gDecorations
lsrs r0, 19
adds r0, r1
ldrb r1, [r0, 0x12]
@ -6568,7 +6568,7 @@ _08129FD2:
ldrb r0, [r1]
cmp r0, 0
beq _0812A024
ldr r0, =gUnknown_085A5C08
ldr r0, =gDecorations
ldrb r2, [r1]
lsls r1, r2, 5
adds r1, r0
@ -6651,7 +6651,7 @@ _0812A072:
ands r2, r0
cmp r1, 0
beq _0812A0BA
ldr r0, =gUnknown_085A5C08
ldr r0, =gDecorations
lsls r1, 5
adds r1, r0
ldrb r0, [r1, 0x11]

459
asm/decoration_inventory.s Normal file
View File

@ -0,0 +1,459 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start SetDecorationInventoriesPointers
SetDecorationInventoriesPointers: @ 81617F4
push {r4,lr}
ldr r0, =gDecorationInventories
mov r12, r0
ldr r0, =gSaveBlock1Ptr
ldr r1, [r0]
ldr r2, =0x00002734
adds r0, r1, r2
mov r4, r12
str r0, [r4]
movs r3, 0xA
strb r3, [r4, 0x4]
adds r2, 0xA
adds r0, r1, r2
str r0, [r4, 0x8]
strb r3, [r4, 0xC]
ldr r4, =0x00002748
adds r0, r1, r4
mov r2, r12
str r0, [r2, 0x10]
strb r3, [r2, 0x14]
adds r4, 0xA
adds r0, r1, r4
str r0, [r2, 0x18]
movs r2, 0x1E
mov r0, r12
strb r2, [r0, 0x1C]
adds r4, 0x1E
adds r0, r1, r4
mov r4, r12
str r0, [r4, 0x20]
mov r0, r12
adds r0, 0x24
strb r2, [r0]
ldr r2, =0x0000278e
adds r0, r1, r2
str r0, [r4, 0x28]
mov r0, r12
adds r0, 0x2C
strb r3, [r0]
ldr r4, =0x00002798
adds r0, r1, r4
mov r2, r12
str r0, [r2, 0x30]
adds r2, 0x34
movs r0, 0x28
strb r0, [r2]
adds r4, 0x28
adds r1, r4
mov r0, r12
str r1, [r0, 0x38]
adds r0, 0x3C
strb r3, [r0]
bl sub_8126968
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end SetDecorationInventoriesPointers
thumb_func_start ClearDecorationInventory
ClearDecorationInventory: @ 8161880
push {r4,r5,lr}
lsls r0, 24
movs r3, 0
ldr r1, =gDecorationInventories
lsrs r2, r0, 21
adds r0, r2, r1
ldrb r0, [r0, 0x4]
cmp r3, r0
bcs _081618AA
adds r5, r1, 0
movs r4, 0
_08161896:
adds r0, r2, r5
ldr r1, [r0]
adds r1, r3
strb r4, [r1]
adds r1, r3, 0x1
lsls r1, 24
lsrs r3, r1, 24
ldrb r0, [r0, 0x4]
cmp r3, r0
bcc _08161896
_081618AA:
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end ClearDecorationInventory
thumb_func_start ClearDecorationInventories
ClearDecorationInventories: @ 81618B4
push {r4,lr}
movs r4, 0
_081618B8:
adds r0, r4, 0
bl ClearDecorationInventory
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0x7
bls _081618B8
pop {r4}
pop {r0}
bx r0
thumb_func_end ClearDecorationInventories
thumb_func_start sub_81618D0
sub_81618D0: @ 81618D0
push {r4,lr}
lsls r0, 24
movs r2, 0
ldr r1, =gDecorationInventories
lsrs r0, 21
adds r0, r1
movs r1, 0x4
ldrsb r1, [r0, r1]
cmp r2, r1
bge _0816190C
adds r4, r0, 0
adds r3, r1, 0
_081618E8:
lsls r0, r2, 24
asrs r1, r0, 24
ldr r0, [r4]
adds r0, r1
ldrb r0, [r0]
cmp r0, 0
bne _08161900
adds r0, r1, 0
b _08161910
.pool
_08161900:
adds r0, r1, 0x1
lsls r0, 24
lsrs r2, r0, 24
asrs r0, 24
cmp r0, r3
blt _081618E8
_0816190C:
movs r0, 0x1
negs r0, r0
_08161910:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_81618D0
thumb_func_start sub_8161918
sub_8161918: @ 8161918
push {r4,lr}
lsls r0, 24
lsrs r3, r0, 24
ldr r1, =gDecorations
lsls r0, r3, 5
adds r0, r1
ldrb r0, [r0, 0x13]
movs r2, 0
ldr r1, =gDecorationInventories
lsls r0, 3
adds r0, r1
ldrb r1, [r0, 0x4]
cmp r2, r1
bcs _08161956
ldr r4, [r0]
_08161936:
adds r0, r4, r2
ldrb r0, [r0]
cmp r0, r3
bne _0816194C
movs r0, 0x1
b _08161958
.pool
_0816194C:
adds r0, r2, 0x1
lsls r0, 24
lsrs r2, r0, 24
cmp r2, r1
bcc _08161936
_08161956:
movs r0, 0
_08161958:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_8161918
thumb_func_start DecorationAdd
DecorationAdd: @ 8161960
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
adds r4, r0, 0
cmp r4, 0
beq _081619A0
ldr r1, =gDecorations
lsls r0, r4, 5
adds r0, r1
ldrb r5, [r0, 0x13]
adds r0, r5, 0
bl sub_81618D0
lsls r0, 24
asrs r2, r0, 24
movs r0, 0x1
negs r0, r0
cmp r2, r0
beq _081619A0
ldr r0, =gDecorationInventories
lsls r1, r5, 3
adds r1, r0
ldr r0, [r1]
adds r0, r2
strb r4, [r0]
movs r0, 0x1
b _081619A2
.pool
_081619A0:
movs r0, 0
_081619A2:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end DecorationAdd
thumb_func_start DecorationCheckSpace
DecorationCheckSpace: @ 81619A8
push {lr}
lsls r0, 24
lsrs r0, 24
cmp r0, 0
beq _081619D4
ldr r1, =gDecorations
lsls r0, 5
adds r0, r1
ldrb r0, [r0, 0x13]
bl sub_81618D0
lsls r0, 24
asrs r0, 24
movs r1, 0x1
negs r1, r1
cmp r0, r1
beq _081619D4
movs r0, 0x1
b _081619D6
.pool
_081619D4:
movs r0, 0
_081619D6:
pop {r1}
bx r1
thumb_func_end DecorationCheckSpace
thumb_func_start DecorationRemove
DecorationRemove: @ 81619DC
push {r4-r6,lr}
lsls r0, 24
lsrs r5, r0, 24
movs r3, 0
cmp r5, 0
bne _081619F8
b _08161A26
_081619EA:
movs r0, 0
strb r0, [r1]
adds r0, r6, 0
bl sub_8161A38
movs r0, 0x1
b _08161A28
_081619F8:
ldr r2, =gDecorationInventories
ldr r1, =gDecorations
lsls r0, r5, 5
adds r0, r1
ldrb r4, [r0, 0x13]
lsls r0, r4, 3
adds r0, r2
ldrb r1, [r0, 0x4]
cmp r3, r1
bcs _08161A26
adds r6, r4, 0
adds r4, r0, 0
adds r2, r1, 0
_08161A12:
ldr r0, [r4]
adds r1, r0, r3
ldrb r0, [r1]
cmp r0, r5
beq _081619EA
adds r0, r3, 0x1
lsls r0, 24
lsrs r3, r0, 24
cmp r3, r2
bcc _08161A12
_08161A26:
movs r0, 0
_08161A28:
pop {r4-r6}
pop {r1}
bx r1
.pool
thumb_func_end DecorationRemove
thumb_func_start sub_8161A38
sub_8161A38: @ 8161A38
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x4
lsls r0, 24
movs r6, 0
ldr r2, =gDecorationInventories
lsrs r0, 21
adds r1, r0, r2
ldrb r3, [r1, 0x4]
cmp r6, r3
bcs _08161ABC
adds r7, r0, 0
mov r10, r1
mov r0, r10
str r0, [sp]
_08161A5C:
adds r1, r6, 0x1
lsls r0, r1, 24
lsrs r3, r0, 24
adds r2, r7, 0
mov r12, r1
mov r1, r10
ldrb r1, [r1, 0x4]
cmp r3, r1
bcs _08161AAE
ldr r0, =gDecorationInventories
mov r9, r0
adds r1, r0, 0
mov r8, r1
_08161A76:
mov r0, r9
adds r5, r2, r0
ldr r1, [r5]
adds r0, r1, r3
ldrb r4, [r0]
adds r2, r4, 0
cmp r2, 0
beq _08161A9C
adds r0, r1, r6
ldrb r1, [r0]
cmp r1, 0
beq _08161A92
cmp r1, r2
bls _08161A9C
_08161A92:
ldrb r1, [r0]
strb r4, [r0]
ldr r0, [r5]
adds r0, r3
strb r1, [r0]
_08161A9C:
adds r0, r3, 0x1
lsls r0, 24
lsrs r3, r0, 24
adds r2, r7, 0
mov r1, r8
adds r0, r2, r1
ldrb r0, [r0, 0x4]
cmp r3, r0
bcc _08161A76
_08161AAE:
mov r3, r12
lsls r0, r3, 24
lsrs r6, r0, 24
ldr r0, [sp]
ldrb r0, [r0, 0x4]
cmp r6, r0
bcc _08161A5C
_08161ABC:
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_8161A38
thumb_func_start sub_8161AD0
sub_8161AD0: @ 8161AD0
push {r4,r5,lr}
lsls r0, 24
movs r4, 0
movs r3, 0
ldr r2, =gDecorationInventories
lsrs r1, r0, 21
adds r0, r1, r2
ldrb r0, [r0, 0x4]
cmp r4, r0
bcs _08161B04
adds r5, r2, 0
_08161AE6:
adds r2, r1, r5
ldr r0, [r2]
adds r0, r3
ldrb r0, [r0]
cmp r0, 0
beq _08161AF8
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
_08161AF8:
adds r0, r3, 0x1
lsls r0, 24
lsrs r3, r0, 24
ldrb r2, [r2, 0x4]
cmp r3, r2
bcc _08161AE6
_08161B04:
adds r0, r4, 0
pop {r4,r5}
pop {r1}
bx r1
.pool
thumb_func_end sub_8161AD0
thumb_func_start sub_8161B10
sub_8161B10: @ 8161B10
push {r4,r5,lr}
movs r5, 0
movs r4, 0
_08161B16:
adds r0, r4, 0
bl sub_8161AD0
adds r0, r5, r0
lsls r0, 24
lsrs r5, r0, 24
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0x7
bls _08161B16
adds r0, r5, 0
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8161B10
.align 2, 0 @ Don't pad with nop.

View File

@ -104,7 +104,7 @@ _080713AE:
ldr r1, [sp, 0x3C]
movs r2, 0x5
movs r3, 0x20
bl create_pokemon_set_level
bl CreateMon
movs r4, 0
_0807141E:
adds r1, r4, 0

View File

@ -87,7 +87,7 @@ InitSaveBlockPointersWithRandomOffset: @ 8076BDC
adds r4, r0
str r4, [r1]
bl SetBagItemsPointers
bl sub_81617F4
bl SetDecorationInventoriesPointers
pop {r4,r5}
pop {r0}
bx r0

View File

@ -304,7 +304,7 @@ _0813CCB8:
adds r0, 0x10
adds r1, r2, 0
adds r1, 0x11
bl sub_8161F64
bl GetRoamerLocation
ldr r1, [r5]
ldrb r0, [r1, 0x10]
ldrb r1, [r1, 0x11]

View File

@ -118,9 +118,9 @@ _08067B36:
.pool
thumb_func_end ZeroEnemyPartyMons
thumb_func_start create_pokemon_set_level
@ void create_pokemon_set_level(pokemon *mon, s16 species_num, u8 level, u8 forced_iv, char pokemon_id_is_nonrandom, int pokemon_id, u8 trainer_id_mode, int trainer_id)
create_pokemon_set_level: @ 8067B4C
thumb_func_start CreateMon
@ void CreateMon(pokemon *mon, s16 species_num, u8 level, u8 forced_iv, char pokemon_id_is_nonrandom, int pokemon_id, u8 trainer_id_mode, int trainer_id)
CreateMon: @ 8067B4C
push {r4-r7,lr}
mov r7, r8
push {r7}
@ -172,7 +172,7 @@ create_pokemon_set_level: @ 8067B4C
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end create_pokemon_set_level
thumb_func_end CreateMon
thumb_func_start create_pokemon
@ void create_pokemon(pokemon *mon, s16 species_num, u8 level, u8 forced_iv, char pokemon_id_is_nonrandom, int pokemon_id, u8 trainer_id_mode, int trainer_id)
@ -540,7 +540,7 @@ _08067EB0:
mov r1, r8
adds r2, r7, 0
adds r3, r6, 0
bl create_pokemon_set_level
bl CreateMon
add sp, 0x10
pop {r3,r4}
mov r8, r3
@ -663,7 +663,7 @@ _08067FCE:
adds r1, r7, 0
ldr r2, [sp, 0x14]
mov r3, r10
bl create_pokemon_set_level
bl CreateMon
add sp, 0x18
pop {r3-r5}
mov r8, r3
@ -715,7 +715,7 @@ _0806800A:
adds r1, r6, 0
adds r2, r7, 0
movs r3, 0x20
bl create_pokemon_set_level
bl CreateMon
add sp, 0x10
pop {r3}
mov r8, r3
@ -724,8 +724,8 @@ _0806800A:
bx r0
thumb_func_end sub_8067FF8
thumb_func_start sub_8068060
sub_8068060: @ 8068060
thumb_func_start CreateMonWithIVsPersonality
CreateMonWithIVsPersonality: @ 8068060
push {r4,lr}
sub sp, 0x14
adds r4, r0, 0
@ -743,7 +743,7 @@ sub_8068060: @ 8068060
str r0, [sp, 0xC]
adds r0, r4, 0
movs r3, 0
bl create_pokemon_set_level
bl CreateMon
adds r0, r4, 0
movs r1, 0x42
add r2, sp, 0x10
@ -754,7 +754,7 @@ sub_8068060: @ 8068060
pop {r4}
pop {r0}
bx r0
thumb_func_end sub_8068060
thumb_func_end CreateMonWithIVsPersonality
thumb_func_start sub_80680A0
sub_80680A0: @ 80680A0
@ -775,7 +775,7 @@ sub_80680A0: @ 80680A0
str r3, [sp, 0xC]
adds r0, r5, 0
movs r3, 0
bl create_pokemon_set_level
bl CreateMon
adds r0, r5, 0
movs r1, 0x27
adds r2, r4, 0
@ -832,7 +832,7 @@ pokemon_make_ev_something: @ 8068114
str r6, [sp, 0x8]
str r6, [sp, 0xC]
adds r0, r7, 0
bl create_pokemon_set_level
bl CreateMon
mov r4, r8
movs r1, 0x1
movs r5, 0x5
@ -901,7 +901,7 @@ sub_806819C: @ 806819C
str r0, [sp, 0xC]
adds r0, r7, 0
movs r3, 0
bl create_pokemon_set_level
bl CreateMon
movs r5, 0
add r0, sp, 0x30
mov r9, r0
@ -1114,7 +1114,7 @@ _0806837C:
adds r0, r7, 0
adds r2, r3, 0
movs r3, 0
bl create_pokemon_set_level
bl CreateMon
movs r5, 0
movs r0, 0xD
adds r0, r6
@ -1358,7 +1358,7 @@ sub_8068528: @ 8068528
str r0, [sp, 0xC]
adds r0, r7, 0
movs r3, 0x1F
bl create_pokemon_set_level
bl CreateMon
mov r1, r9
adds r2, r5, r1
adds r2, 0xE
@ -1477,7 +1477,7 @@ _08068664:
ldr r1, [sp, 0x14]
mov r2, r10
mov r3, r9
bl create_pokemon_set_level
bl CreateMon
mov r5, r8
movs r1, 0x1
movs r4, 0x5
@ -1748,7 +1748,7 @@ sub_80688A8: @ 80688A8
str r5, [sp, 0x8]
str r7, [sp, 0xC]
mov r0, r8
bl create_pokemon_set_level
bl CreateMon
mov r0, r8
movs r1, 0x50
add r2, sp, 0x10

View File

@ -3311,7 +3311,7 @@ _0806B730:
str r0, [sp, 0xC]
adds r0, r5, 0
movs r3, 0xF
bl create_pokemon_set_level
bl CreateMon
ldr r1, =gBattleResources
ldr r0, [r1]
adds r1, r7, 0

502
asm/roamer.s Normal file
View File

@ -0,0 +1,502 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start ClearRoamerData
ClearRoamerData: @ 8161B34
push {r4,r5,lr}
ldr r5, =gSaveBlock1Ptr
ldr r0, [r5]
ldr r4, =0x000031dc
adds r0, r4
movs r1, 0
movs r2, 0x1C
bl memset
ldr r0, [r5]
adds r0, r4
ldr r1, =0x00000197
strh r1, [r0, 0x8]
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end ClearRoamerData
thumb_func_start ClearRoamerLocationData
ClearRoamerLocationData: @ 8161B60
push {r4-r6,lr}
movs r2, 0
ldr r6, =sRoamerLocation
ldr r4, =sLocationHistory
movs r3, 0
adds r5, r4, 0x1
_08161B6C:
lsls r1, r2, 1
adds r0, r1, r4
strb r3, [r0]
adds r1, r5
strb r3, [r1]
adds r0, r2, 0x1
lsls r0, 24
lsrs r2, r0, 24
cmp r2, 0x2
bls _08161B6C
movs r0, 0
strb r0, [r6]
strb r0, [r6, 0x1]
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end ClearRoamerLocationData
thumb_func_start CreateInitialRoamerMon
CreateInitialRoamerMon: @ 8161B94
push {r4-r7,lr}
mov r7, r8
push {r7}
sub sp, 0x10
lsls r0, 16
cmp r0, 0
bne _08161BBC
ldr r0, =gSaveBlock1Ptr
ldr r1, [r0]
ldr r2, =0x000031dc
adds r1, r2
ldr r2, =0x00000197
b _08161BC8
.pool
_08161BBC:
ldr r0, =gSaveBlock1Ptr
ldr r1, [r0]
ldr r2, =0x000031dc
adds r1, r2
movs r2, 0xCC
lsls r2, 1
_08161BC8:
strh r2, [r1, 0x8]
adds r7, r0, 0
ldr r6, =gEnemyParty
ldr r0, [r7]
ldr r5, =0x000031dc
adds r0, r5
ldrh r1, [r0, 0x8]
movs r4, 0
str r4, [sp]
str r4, [sp, 0x4]
str r4, [sp, 0x8]
str r4, [sp, 0xC]
adds r0, r6, 0
movs r2, 0x28
movs r3, 0x20
bl CreateMon
ldr r0, [r7]
adds r0, r5
movs r1, 0x28
strb r1, [r0, 0xC]
ldr r0, [r7]
adds r0, r5
strb r4, [r0, 0xD]
ldr r0, [r7]
adds r0, r5
movs r1, 0x1
strb r1, [r0, 0x13]
adds r0, r6, 0
movs r1, 0x42
bl GetMonData
ldr r1, [r7]
adds r1, r5
str r0, [r1]
adds r0, r6, 0
movs r1, 0
bl GetMonData
ldr r1, [r7]
adds r1, r5
str r0, [r1, 0x4]
adds r0, r6, 0
movs r1, 0x3A
bl GetMonData
ldr r1, [r7]
adds r1, r5
movs r2, 0
mov r8, r2
strh r0, [r1, 0xA]
adds r0, r6, 0
movs r1, 0x16
bl GetMonData
ldr r1, [r7]
adds r1, r5
strb r0, [r1, 0xE]
adds r0, r6, 0
movs r1, 0x17
bl GetMonData
ldr r1, [r7]
adds r1, r5
strb r0, [r1, 0xF]
adds r0, r6, 0
movs r1, 0x18
bl GetMonData
ldr r1, [r7]
adds r1, r5
strb r0, [r1, 0x10]
adds r0, r6, 0
movs r1, 0x21
bl GetMonData
ldr r1, [r7]
adds r1, r5
strb r0, [r1, 0x11]
adds r0, r6, 0
movs r1, 0x2F
bl GetMonData
ldr r1, [r7]
adds r1, r5
strb r0, [r1, 0x12]
ldr r4, =sRoamerLocation
mov r0, r8
strb r0, [r4]
bl Random
ldr r5, =sRoamerLocations
lsls r0, 16
lsrs r0, 16
movs r1, 0x14
bl __umodsi3
lsls r0, 16
lsrs r0, 16
lsls r1, r0, 1
adds r1, r0
lsls r1, 1
adds r1, r5
ldrb r0, [r1]
strb r0, [r4, 0x1]
add sp, 0x10
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end CreateInitialRoamerMon
thumb_func_start InitRoamer
InitRoamer: @ 8161CBC
push {lr}
bl ClearRoamerData
bl ClearRoamerLocationData
ldr r0, =gSpecialVar_0x8004
ldrh r0, [r0]
bl CreateInitialRoamerMon
pop {r0}
bx r0
.pool
thumb_func_end InitRoamer
thumb_func_start UpdateLocationHistoryForRoamer
UpdateLocationHistoryForRoamer: @ 8161CD8
ldr r0, =sLocationHistory
ldrb r1, [r0, 0x2]
strb r1, [r0, 0x4]
ldrb r1, [r0, 0x3]
strb r1, [r0, 0x5]
ldrb r1, [r0]
strb r1, [r0, 0x2]
ldrb r1, [r0, 0x1]
strb r1, [r0, 0x3]
ldr r1, =gSaveBlock1Ptr
ldr r2, [r1]
ldrb r1, [r2, 0x4]
strb r1, [r0]
ldrb r1, [r2, 0x5]
strb r1, [r0, 0x1]
bx lr
.pool
thumb_func_end UpdateLocationHistoryForRoamer
thumb_func_start RoamerMoveToOtherLocationSet
RoamerMoveToOtherLocationSet: @ 8161D00
push {r4,r5,lr}
movs r1, 0
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldr r2, =0x000031dc
adds r0, r2
ldrb r0, [r0, 0x13]
cmp r0, 0
beq _08161D3E
ldr r0, =sRoamerLocation
strb r1, [r0]
ldr r5, =sRoamerLocations
adds r4, r0, 0
_08161D1A:
bl Random
lsls r0, 16
lsrs r0, 16
movs r1, 0x14
bl __umodsi3
lsls r0, 16
lsrs r0, 16
lsls r1, r0, 1
adds r1, r0
lsls r1, 1
adds r1, r5
ldrb r1, [r1]
ldrb r0, [r4, 0x1]
cmp r0, r1
beq _08161D1A
strb r1, [r4, 0x1]
_08161D3E:
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end RoamerMoveToOtherLocationSet
thumb_func_start RoamerMove
RoamerMove: @ 8161D54
push {r4-r7,lr}
movs r4, 0
bl Random
lsls r0, 16
movs r1, 0xF0
lsls r1, 12
ands r1, r0
cmp r1, 0
bne _08161D6E
bl RoamerMoveToOtherLocationSet
b _08161DE2
_08161D6E:
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldr r1, =0x000031dc
adds r0, r1
ldrb r0, [r0, 0x13]
cmp r0, 0
beq _08161DE2
ldr r7, =sRoamerLocation
ldr r3, =sRoamerLocations
_08161D80:
lsls r0, r4, 1
adds r0, r4
lsls r2, r0, 1
adds r1, r2, r3
ldrb r0, [r7, 0x1]
ldrb r1, [r1]
cmp r0, r1
bne _08161DD8
ldr r6, =sRoamerLocations
adds r5, r2, 0x1
ldr r4, =sLocationHistory
_08161D96:
bl Random
lsls r0, 16
lsrs r0, 16
movs r1, 0x5
bl __umodsi3
lsls r0, 16
lsrs r0, 16
adds r0, r5
adds r0, r6
ldrb r1, [r0]
ldrb r0, [r4, 0x4]
cmp r0, 0
bne _08161DBA
ldrb r0, [r4, 0x5]
cmp r0, r1
beq _08161D96
_08161DBA:
cmp r1, 0xFF
beq _08161D96
strb r1, [r7, 0x1]
b _08161DE2
.pool
_08161DD8:
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0x13
bls _08161D80
_08161DE2:
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end RoamerMove
thumb_func_start IsRoamerAt
IsRoamerAt: @ 8161DE8
push {lr}
lsls r0, 24
lsrs r2, r0, 24
lsls r1, 24
lsrs r1, 24
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldr r3, =0x000031dc
adds r0, r3
ldrb r0, [r0, 0x13]
cmp r0, 0
beq _08161E20
ldr r0, =sRoamerLocation
ldrb r3, [r0]
cmp r2, r3
bne _08161E20
ldrb r0, [r0, 0x1]
cmp r1, r0
bne _08161E20
movs r0, 0x1
b _08161E22
.pool
_08161E20:
movs r0, 0
_08161E22:
pop {r1}
bx r1
thumb_func_end IsRoamerAt
thumb_func_start CreateRoamerMonInstance
CreateRoamerMonInstance: @ 8161E28
push {r4,r5,lr}
sub sp, 0x4
ldr r5, =gEnemyParty
bl ZeroEnemyPartyMons
ldr r4, =gSaveBlock1Ptr
ldr r0, [r4]
ldr r1, =0x000031dc
adds r0, r1
ldrh r1, [r0, 0x8]
ldrb r2, [r0, 0xC]
ldr r3, [r0]
ldr r0, [r0, 0x4]
str r0, [sp]
adds r0, r5, 0
bl CreateMonWithIVsPersonality
ldr r2, [r4]
ldr r0, =0x000031e9
adds r2, r0
adds r0, r5, 0
movs r1, 0x37
bl SetMonData
ldr r2, [r4]
ldr r1, =0x000031e6
adds r2, r1
adds r0, r5, 0
movs r1, 0x39
bl SetMonData
ldr r2, [r4]
ldr r0, =0x000031ea
adds r2, r0
adds r0, r5, 0
movs r1, 0x16
bl SetMonData
ldr r2, [r4]
ldr r1, =0x000031eb
adds r2, r1
adds r0, r5, 0
movs r1, 0x17
bl SetMonData
ldr r2, [r4]
ldr r0, =0x000031ec
adds r2, r0
adds r0, r5, 0
movs r1, 0x18
bl SetMonData
ldr r2, [r4]
ldr r1, =0x000031ed
adds r2, r1
adds r0, r5, 0
movs r1, 0x21
bl SetMonData
ldr r2, [r4]
ldr r0, =0x000031ee
adds r2, r0
adds r0, r5, 0
movs r1, 0x2F
bl SetMonData
add sp, 0x4
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end CreateRoamerMonInstance
thumb_func_start TryStartRoamerEncounter
TryStartRoamerEncounter: @ 8161EDC
push {lr}
ldr r0, =gSaveBlock1Ptr
ldr r1, [r0]
ldrb r0, [r1, 0x4]
ldrb r1, [r1, 0x5]
bl IsRoamerAt
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
bne _08161F10
bl Random
lsls r0, 16
movs r1, 0xC0
lsls r1, 10
ands r1, r0
cmp r1, 0
bne _08161F10
bl CreateRoamerMonInstance
movs r0, 0x1
b _08161F12
.pool
_08161F10:
movs r0, 0
_08161F12:
pop {r1}
bx r1
thumb_func_end TryStartRoamerEncounter
thumb_func_start UpdateRoamerHPStatus
UpdateRoamerHPStatus: @ 8161F18
push {r4-r6,lr}
adds r6, r0, 0
movs r1, 0x39
bl GetMonData
ldr r5, =gSaveBlock1Ptr
ldr r1, [r5]
ldr r4, =0x000031dc
adds r1, r4
strh r0, [r1, 0xA]
adds r0, r6, 0
movs r1, 0x37
bl GetMonData
ldr r1, [r5]
adds r1, r4
strb r0, [r1, 0xD]
bl RoamerMoveToOtherLocationSet
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end UpdateRoamerHPStatus
thumb_func_start SetRoamerInactive
SetRoamerInactive: @ 8161F4C
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldr r1, =0x000031dc
adds r0, r1
movs r1, 0
strb r1, [r0, 0x13]
bx lr
.pool
thumb_func_end SetRoamerInactive
thumb_func_start GetRoamerLocation
GetRoamerLocation: @ 8161F64
ldr r3, =sRoamerLocation
ldrb r2, [r3]
strb r2, [r0]
ldrb r0, [r3, 0x1]
strb r0, [r1]
bx lr
.pool
thumb_func_end GetRoamerLocation
.align 2, 0 @ Don't pad with nop.

View File

@ -96,7 +96,7 @@ _080326B8:
adds r0, r4, 0
movs r2, 0x2
movs r3, 0x20
bl create_pokemon_set_level
bl CreateMon
str r5, [sp, 0x10]
adds r0, r4, 0
movs r1, 0xC

View File

@ -131,8 +131,8 @@ sub_8084788: @ 8084788
bl FlagReset
bl sub_8085B2C
bl wild_pokemon_reroll
bl mapnumbers_history_shift_sav1_0_2_4_out
bl sub_8161D00
bl UpdateLocationHistoryForRoamer
bl RoamerMoveToOtherLocationSet
pop {r0}
bx r0
.pool
@ -1402,8 +1402,8 @@ _08085116:
cmp r4, 0xC
ble _08085116
bl sub_80A0A2C
bl mapnumbers_history_shift_sav1_0_2_4_out
bl sub_8161D54
bl UpdateLocationHistoryForRoamer
bl RoamerMove
bl sub_80AEE20
bl wild_encounter_reset_coro_args
bl mapheader_run_script_with_tag_x5
@ -1493,8 +1493,8 @@ _08085200:
bl update_sav1_flash_used_on_map
bl sav1_reset_battle_music_maybe
bl mapheader_run_script_with_tag_x3
bl mapnumbers_history_shift_sav1_0_2_4_out
bl sub_8161D00
bl UpdateLocationHistoryForRoamer
bl RoamerMoveToOtherLocationSet
ldrh r1, [r4, 0x12]
ldr r0, =0x00000169
cmp r1, r0

View File

@ -7630,7 +7630,7 @@ sub_813946C: @ 813946C
adds r0, r5, 0
movs r2, 0x7
movs r3, 0x20
bl create_pokemon_set_level
bl CreateMon
movs r1, 0x1
add r0, sp, 0x10
strh r1, [r0]

View File

@ -6633,7 +6633,7 @@ _08038750:
movs r3, 0
str r3, [sp, 0xC]
adds r3, r6, 0
bl create_pokemon_set_level
bl CreateMon
b _080389AC
.pool
_08038794:
@ -6702,7 +6702,7 @@ _080387D6:
str r0, [sp, 0xC]
adds r0, r5, 0
adds r3, r6, 0
bl create_pokemon_set_level
bl CreateMon
movs r6, 0
mov r0, r8
adds r0, 0x6
@ -6794,7 +6794,7 @@ _08038896:
str r0, [sp, 0xC]
adds r0, r4, 0
adds r3, r6, 0
bl create_pokemon_set_level
bl CreateMon
adds r5, 0x6
adds r0, r4, 0
movs r1, 0xC
@ -6868,7 +6868,7 @@ _0803892A:
str r0, [sp, 0xC]
adds r0, r4, 0
adds r3, r6, 0
bl create_pokemon_set_level
bl CreateMon
adds r5, 0x6
adds r0, r4, 0
movs r1, 0xC
@ -16590,7 +16590,7 @@ _0803DF9E:
cmp r4, 0
beq _0803DFDE
ldr r0, =gEnemyParty
bl sub_8161F18
bl UpdateRoamerHPStatus
ldrb r1, [r5]
movs r0, 0x1
ands r0, r1
@ -16599,7 +16599,7 @@ _0803DF9E:
cmp r1, 0x7
bne _0803DFDE
_0803DFDA:
bl sub_8161F4C
bl SetRoamerInactive
_0803DFDE:
movs r0, 0x5A
bl m4aSongNumStop

File diff suppressed because it is too large Load Diff

11568
asm/rom_8161F74.s Normal file

File diff suppressed because it is too large Load Diff

View File

@ -45959,7 +45959,7 @@ _081A4E96:
ldr r0, =0x0000ef2a
str r0, [sp, 0xC]
mov r0, r10
bl create_pokemon_set_level
bl CreateMon
ldr r0, =gUnknown_0861156C
adds r5, r0
adds r5, r6, r5
@ -48556,7 +48556,7 @@ _081A6534:
str r2, [sp, 0xC]
ldr r2, [sp, 0x14]
adds r3, r6, 0
bl create_pokemon_set_level
bl CreateMon
movs r1, 0
mov r2, r9
ldr r0, [r2]
@ -48722,7 +48722,7 @@ _081A6682:
str r2, [sp, 0xC]
ldr r2, [sp, 0x14]
adds r3, r6, 0
bl create_pokemon_set_level
bl CreateMon
movs r1, 0
mov r2, r9
ldr r0, [r2]

View File

@ -1172,7 +1172,7 @@ sub_8099B64: @ 8099B64
ldr r4, =gScriptResult
lsls r0, 24
lsrs r0, 24
bl IsThereStorageSpaceForDecoration
bl DecorationAdd
lsls r0, 24
lsrs r0, 24
strh r0, [r4]
@ -1193,7 +1193,7 @@ sub_8099B90: @ 8099B90
ldr r4, =gScriptResult
lsls r0, 24
lsrs r0, 24
bl sub_81619DC
bl DecorationRemove
lsls r0, 24
asrs r0, 24
strh r0, [r4]
@ -1214,7 +1214,7 @@ sub_8099BBC: @ 8099BBC
ldr r4, =gScriptResult
lsls r0, 24
lsrs r0, 24
bl sub_81619A8
bl DecorationCheckSpace
lsls r0, 24
lsrs r0, 24
strh r0, [r4]

View File

@ -1296,7 +1296,7 @@ sub_80F9244: @ 80F9244
adds r1, r5, 0
adds r2, r3, 0
movs r3, 0x20
bl create_pokemon_set_level
bl CreateMon
add r0, sp, 0x10
mov r1, r8
strb r1, [r0]
@ -1476,7 +1476,7 @@ sub_80F93A0: @ 80F93A0
adds r1, r4, 0
adds r2, r5, 0
movs r3, 0x20
bl create_pokemon_set_level
bl CreateMon
cmp r6, 0
beq _080F93EE
add r0, sp, 0x10

View File

@ -956,7 +956,7 @@ _080E927A:
lsrs r0, 24
cmp r0, 0x77
bhi _080E92AC
ldr r0, =gUnknown_085A5C08
ldr r0, =gDecorations
ldrb r3, [r1]
lsls r1, r3, 5
adds r1, r0
@ -1094,7 +1094,7 @@ _080E93BE:
mov r1, r10
ldrb r0, [r1]
lsls r0, 5
ldr r2, =gUnknown_085A5C08
ldr r2, =gDecorations
adds r0, r2
ldrb r1, [r0, 0x11]
ldrb r0, [r0, 0x13]

View File

@ -740,7 +740,7 @@ _080E008A:
b _080E00EA
.pool
_080E00D8:
ldr r0, =gUnknown_085A5C08
ldr r0, =gDecorations
lsls r1, r7, 5
adds r0, 0x18
adds r1, r0
@ -808,7 +808,7 @@ BuyMenuPrintPriceInList: @ 80E0114
.pool
_080E0164:
ldr r0, =gStringVar1
ldr r2, =gUnknown_085A5C08
ldr r2, =gDecorations
lsls r1, 5
adds r1, r2
ldrh r1, [r1, 0x14]
@ -2038,7 +2038,7 @@ _080E0B80:
movs r3, 0x80
lsls r3, 6
adds r1, r3
ldr r2, =gUnknown_085A5C08
ldr r2, =gDecorations
lsls r0, r5, 5
adds r0, r2
ldrh r0, [r0, 0x14]
@ -2415,7 +2415,7 @@ _080E0F30:
.pool
_080E0F40:
ldrb r0, [r4, 0xA]
bl IsThereStorageSpaceForDecoration
bl DecorationAdd
lsls r0, 24
cmp r0, 0
beq _080E0F70

View File

@ -389,7 +389,7 @@ _080774B2:
movs r1, 0
movs r2, 0
movs r3, 0x20
bl create_pokemon_set_level
bl CreateMon
adds r6, 0x1
cmp r6, 0x5
ble _080774B2
@ -13276,7 +13276,7 @@ sub_807E7E8: @ 807E7E8
str r0, [sp, 0xC]
adds r0, r6, 0
movs r3, 0x20
bl create_pokemon_set_level
bl CreateMon
adds r2, r5, 0
adds r2, 0xE
adds r0, r6, 0

View File

@ -381,7 +381,7 @@ sub_8133D2C: @ 8133D2C
ldr r6, =gScriptResult
movs r0, 0
strh r0, [r6]
ldr r4, =gUnknown_085A5C08
ldr r4, =gDecorations
ldr r5, =gSpecialVar_0x8004
ldrh r0, [r5]
lsls r0, 5
@ -502,10 +502,10 @@ sub_8133E38: @ 8133E38
ldr r1, =gSpecialVar_0x8006
mov r8, r1
ldrb r0, [r1]
bl sub_81619DC
bl DecorationRemove
ldr r0, =gSpecialVar_0x8004
ldrb r0, [r0]
bl IsThereStorageSpaceForDecoration
bl DecorationAdd
ldr r4, =gSpecialVar_0x8005
ldrh r1, [r4]
movs r0, 0xB

View File

@ -1464,7 +1464,7 @@ _080B53D4:
beq _080B53F2
b _080B54FE
_080B53F2:
bl sub_8161EDC
bl TryStartRoamerEncounter
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -1550,7 +1550,7 @@ _080B5492:
lsrs r0, 24
cmp r0, 0x1
bne _080B54FE
bl sub_8161EDC
bl TryStartRoamerEncounter
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -1740,7 +1740,7 @@ _080B562C:
ldr r4, [r0]
cmp r4, 0
beq _080B56F2
bl sub_8161EDC
bl TryStartRoamerEncounter
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -1788,7 +1788,7 @@ _080B568C:
ldr r4, [r0]
cmp r4, 0
beq _080B56F2
bl sub_8161EDC
bl TryStartRoamerEncounter
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1

View File

@ -3626,7 +3626,7 @@ gUnknown_085A1F7C:: @ 85A1F7C
gUnknown_085A1F94:: @ 85A1F94
.incbin "baserom.gba", 0x5a1f94, 0x3c74
gUnknown_085A5C08:: @ 85A5C08
gDecorations:: @ 85A5C08
.incbin "baserom.gba", 0x5a5c08, 0x1
gUnknown_085A5C09:: @ 85A5C09

View File

@ -84,7 +84,7 @@ gUnknown_085CEC10:: @ 85CEC10
gUnknown_085CEC28:: @ 85CEC28
.incbin "baserom.gba", 0x5cec28, 0x8
gUnknown_085CEC30:: @ 85CEC30
sRoamerLocations:: @ 85CEC30
.incbin "baserom.gba", 0x5cec30, 0x80
@ 85CECB0

View File

@ -190,6 +190,9 @@ SECTIONS {
asm/battle_controller_safari.o(.text);
asm/fldeff_sweetscent.o(.text);
asm/rom_815A0D4.o(.text);
asm/decoration_inventory.o(.text);
asm/roamer.o(.text);
asm/rom_8161F74.o(.text);
asm/battle_controller_wally.o(.text);
asm/player_pc.o(.text);
asm/intro.o(.text);

View File

@ -1666,13 +1666,13 @@ gUnknown_0203BC34: @ 203BC34
gUnknown_0203BC38: @ 203BC38
.space 0x8
gUnknown_0203BC40: @ 203BC40
gDecorationInventories: @ 203BC40
.space 0x40
gUnknown_0203BC80: @ 203BC80
sLocationHistory: @ 203BC80
.space 0x6
gUnknown_0203BC86: @ 203BC86
sRoamerLocation: @ 203BC86
.space 0x2
gUnknown_0203BC88: @ 203BC88