summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm/battle_1.s20
-rw-r--r--asm/battle_2.s568
-rw-r--r--asm/battle_ai_switch_items.s82
-rw-r--r--asm/battle_anim.s48
-rw-r--r--asm/battle_anim_8074480.s138
-rw-r--r--asm/battle_anim_80989F8.s22
-rw-r--r--asm/battle_anim_80A22E8.s398
-rw-r--r--asm/battle_anim_80DE2C0.s88
-rw-r--r--asm/battle_anim_80EEC0C.s30
-rw-r--r--asm/battle_anim_sound_tasks.s4
-rw-r--r--asm/battle_controller_link_opponent.s250
-rw-r--r--asm/battle_controller_link_partner.s216
-rw-r--r--asm/battle_controller_oak.s282
-rw-r--r--asm/battle_controller_opponent.s230
-rw-r--r--asm/battle_controller_player.s336
-rw-r--r--asm/battle_controller_pokedude.s296
-rw-r--r--asm/battle_controller_safari.s32
-rw-r--r--asm/battle_controllers.s96
-rw-r--r--asm/battle_dome_cards.s12
-rw-r--r--asm/battle_gfx_sfx_util.s156
-rw-r--r--asm/battle_interface.s110
-rw-r--r--asm/battle_message.s198
-rw-r--r--asm/battle_records.s4
-rw-r--r--asm/battle_script_commands.s844
-rw-r--r--asm/battle_setup.s16
-rw-r--r--asm/battle_tower.s46
-rw-r--r--asm/battle_transition.s4
-rw-r--r--asm/battle_util.s644
-rw-r--r--asm/battle_util2.s12
-rw-r--r--asm/bike.s24
-rw-r--r--asm/cable_club.s40
-rw-r--r--asm/calculate_base_damage.s1123
-rw-r--r--asm/daycare.s50
-rw-r--r--asm/decompress.s8
-rw-r--r--asm/easy_chat.s4
-rw-r--r--asm/egg_hatch.s36
-rw-r--r--asm/event_data.s8
-rw-r--r--asm/evolution_scene.s214
-rw-r--r--asm/field_control_avatar.s18
-rw-r--r--asm/field_effect.s180
-rw-r--r--asm/field_effect_helpers.s80
-rw-r--r--asm/field_fadetransition.s44
-rw-r--r--asm/field_map_obj.s396
-rw-r--r--asm/field_player_avatar.s184
-rw-r--r--asm/field_poison.s6
-rw-r--r--asm/field_screen_effect.s4
-rw-r--r--asm/field_specials.s38
-rw-r--r--asm/hall_of_fame.s24
-rw-r--r--asm/help_system.s16
-rw-r--r--asm/help_system_812B1E0.s4
-rw-r--r--asm/intro.s8
-rw-r--r--asm/item.s2
-rw-r--r--asm/item_menu.s4
-rw-r--r--asm/item_use.s8
-rw-r--r--asm/learn_move.s4
-rw-r--r--asm/link.s44
-rw-r--r--asm/link_rfu_2.s26
-rw-r--r--asm/link_rfu_3.s94
-rw-r--r--asm/load_save.s814
-rw-r--r--asm/mail_data.s16
-rw-r--r--asm/main_menu.s4
-rw-r--r--asm/map_obj_80688E4.s12
-rw-r--r--asm/map_obj_lock.s24
-rw-r--r--asm/mevent.s12
-rw-r--r--asm/mevent_server.s8
-rw-r--r--asm/mystery_event_script.s8
-rw-r--r--asm/naming_screen.s4
-rw-r--r--asm/new_game.s4
-rw-r--r--asm/oak_speech.s4
-rw-r--r--asm/overworld.s68
-rw-r--r--asm/party_menu.s120
-rw-r--r--asm/pokeball.s28
-rw-r--r--asm/pokedex_screen.s40
-rw-r--r--asm/pokemon_1.s2431
-rw-r--r--asm/pokemon_2.s3902
-rw-r--r--asm/pokemon_3.s4503
-rw-r--r--asm/pokemon_item_effect.s1972
-rw-r--r--asm/pokemon_size_record.s6
-rw-r--r--asm/pokemon_storage_system.s114
-rw-r--r--asm/pokemon_summary_screen.s36
-rw-r--r--asm/post_battle_event_funcs.s2
-rw-r--r--asm/quest_log.s20
-rw-r--r--asm/quest_log_8150454.s20
-rw-r--r--asm/quest_log_battle.s24
-rw-r--r--asm/reset_save_heap.s8
-rw-r--r--asm/reshow_battle_screen.s68
-rw-r--r--asm/roamer.s14
-rw-r--r--asm/rom6.s16
-rw-r--r--asm/save.s2156
-rw-r--r--asm/save_failed_screen.s18
-rw-r--r--asm/scrcmd.s28
-rw-r--r--asm/script_movement.s8
-rw-r--r--asm/script_pokemon_util_80A0058.s24
-rw-r--r--asm/script_pokemon_util_80BF8FC.s14
-rw-r--r--asm/shop.s8
-rw-r--r--asm/ss_anne.s16
-rw-r--r--asm/start_menu.s4
-rw-r--r--asm/teachy_tv.s4
-rw-r--r--asm/title_screen.s8
-rw-r--r--asm/trade.s126
-rw-r--r--asm/trainer_card.s4
-rw-r--r--asm/trainer_see.s38
-rw-r--r--asm/trainer_tower.s12
-rw-r--r--asm/unk_810C3A4.s12
-rw-r--r--asm/unk_814D5C8.s4
-rw-r--r--asm/unk_8159F40.s20
-rw-r--r--asm/unk_815EDDC.s2
-rw-r--r--common_syms/load_save.txt4
-rw-r--r--common_syms/save.txt12
-rw-r--r--data/data.s59
-rw-r--r--data/data_83F5738.s631
-rw-r--r--data/data_83FECCC.s (renamed from data/data_84827AC.s)1325
-rw-r--r--data/data_8468C98.s689
-rw-r--r--data/text/trainer_class_names.inc107
-rw-r--r--include/battle.h31
-rw-r--r--include/battle_controllers.h2
-rw-r--r--include/battle_util.h5
-rw-r--r--include/constants/flags.h7
-rw-r--r--include/constants/items.h3
-rw-r--r--include/constants/pokemon.h80
-rw-r--r--include/global.h72
-rw-r--r--include/link.h2
-rw-r--r--include/load_save.h4
-rw-r--r--include/malloc.h1
-rw-r--r--include/pokemon.h16
-rw-r--r--include/save.h102
-rw-r--r--ld_script.txt17
-rw-r--r--src/battle_ai_script_commands.c27
-rw-r--r--src/load_save.c297
-rw-r--r--src/pokemon.c5609
-rw-r--r--src/save.c919
-rw-r--r--src/vs_seeker.c20
-rw-r--r--sym_common.txt49
-rw-r--r--sym_ewram.txt69
134 files changed, 12517 insertions, 22323 deletions
diff --git a/asm/battle_1.s b/asm/battle_1.s
index db55d2dcb..e93a714eb 100644
--- a/asm/battle_1.s
+++ b/asm/battle_1.s
@@ -537,7 +537,7 @@ _0800F5E8:
beq _0800F666
cmp r2, 0x1
bne _0800F632
- ldr r2, _0800F620 @ =gUnknown_202273C
+ ldr r2, _0800F620 @ =gLinkPlayers
ldr r0, _0800F624 @ =gBattleStruct
ldr r0, [r0]
adds r0, 0xB5
@@ -556,7 +556,7 @@ _0800F5E8:
b _0800F6F0
.align 2, 0
_0800F61C: .4byte gBattleTypeFlags
-_0800F620: .4byte gUnknown_202273C
+_0800F620: .4byte gLinkPlayers
_0800F624: .4byte gBattleStruct
_0800F628:
cmp r0, 0x2
@@ -565,7 +565,7 @@ _0800F628:
bne _0800F6F0
b _0800F682
_0800F632:
- ldr r2, _0800F654 @ =gUnknown_202273C
+ ldr r2, _0800F654 @ =gLinkPlayers
ldr r0, _0800F658 @ =gBattleStruct
ldr r0, [r0]
adds r0, 0xB5
@@ -583,7 +583,7 @@ _0800F632:
beq _0800F682
b _0800F6F0
.align 2, 0
-_0800F654: .4byte gUnknown_202273C
+_0800F654: .4byte gLinkPlayers
_0800F658: .4byte gBattleStruct
_0800F65C:
cmp r0, 0x2
@@ -594,7 +594,7 @@ _0800F65C:
_0800F666:
cmp r2, 0x1
bne _0800F6A4
- ldr r2, _0800F694 @ =gUnknown_202273C
+ ldr r2, _0800F694 @ =gLinkPlayers
ldr r0, _0800F698 @ =gBattleStruct
ldr r0, [r0]
adds r0, 0xB5
@@ -615,12 +615,12 @@ _0800F682:
bl sub_80D87BC
b _0800F6F0
.align 2, 0
-_0800F694: .4byte gUnknown_202273C
+_0800F694: .4byte gLinkPlayers
_0800F698: .4byte gBattleStruct
_0800F69C: .4byte gUnknown_83FE874
_0800F6A0: .4byte gUnknown_83FE87B
_0800F6A4:
- ldr r2, _0800F6D0 @ =gUnknown_202273C
+ ldr r2, _0800F6D0 @ =gLinkPlayers
ldr r0, _0800F6D4 @ =gBattleStruct
ldr r0, [r0]
adds r0, 0xB5
@@ -641,7 +641,7 @@ _0800F6BC:
bl sub_80D87BC
b _0800F6F0
.align 2, 0
-_0800F6D0: .4byte gUnknown_202273C
+_0800F6D0: .4byte gLinkPlayers
_0800F6D4: .4byte gBattleStruct
_0800F6D8: .4byte gUnknown_83FE874
_0800F6DC: .4byte gUnknown_83FE87B
@@ -781,7 +781,7 @@ _0800F7CC:
adds r6, r5, 0
eors r6, r0
adds r1, r6, 0
- ldr r4, _0800F848 @ =gUnknown_202273C
+ ldr r4, _0800F848 @ =gLinkPlayers
lsls r0, r5, 3
subs r0, r5
lsls r0, 2
@@ -832,7 +832,7 @@ _0800F830:
b _0800FAC4
.align 2, 0
_0800F844: .4byte gBattleStruct
-_0800F848: .4byte gUnknown_202273C
+_0800F848: .4byte gLinkPlayers
_0800F84C: .4byte gTasks
_0800F850:
ldr r0, _0800F8CC @ =0x00002710
diff --git a/asm/battle_2.s b/asm/battle_2.s
index 086603fe1..8abec7a86 100644
--- a/asm/battle_2.s
+++ b/asm/battle_2.s
@@ -8,7 +8,7 @@
thumb_func_start sub_800FD9C
sub_800FD9C: @ 800FD9C
push {r4,lr}
- bl sub_804C0A4
+ bl MoveSaveBlocks_ResetHeap
bl sub_802E03C
bl AllocateBattleSpritesData
bl AllocateMonSpritesGfx
@@ -232,7 +232,7 @@ _0800FF98:
_0800FFAE:
adds r0, r4, 0
movs r1, 0x3
- bl sub_80436F8
+ bl AdjustFriendship
adds r4, 0x64
cmp r4, r5
ble _0800FFAE
@@ -481,7 +481,7 @@ _08010194:
cmp r0, 0x1
bne _08010250
movs r5, 0
- ldr r3, _08010238 @ =gUnknown_2023F54
+ ldr r3, _08010238 @ =gEnigmaBerries
ldr r0, _0801023C @ =gSaveBlock1Ptr
mov r8, r0
adds r6, r3, 0
@@ -560,7 +560,7 @@ _080101EC:
b _080103FC
.align 2, 0
_08010234: .4byte gBattleTypeFlags
-_08010238: .4byte gUnknown_2023F54
+_08010238: .4byte gEnigmaBerries
_0801023C: .4byte gSaveBlock1Ptr
_08010240: .4byte 0x000030ec
_08010244: .4byte 0x00003108
@@ -574,7 +574,7 @@ _08010250:
bl sub_809C8A0
adds r6, r0, 0
movs r5, 0
- ldr r4, _080102BC @ =gUnknown_2023F54
+ ldr r4, _080102BC @ =gEnigmaBerries
adds r7, r4, 0
adds r7, 0x38
adds r3, r4, 0
@@ -622,15 +622,15 @@ _0801029C:
strb r1, [r0]
b _080103FC
.align 2, 0
-_080102BC: .4byte gUnknown_2023F54
+_080102BC: .4byte gEnigmaBerries
_080102C0:
movs r0, 0x40
ands r1, r0
cmp r1, 0
beq _0801034C
movs r5, 0
- ldr r3, _08010340 @ =gUnknown_2023F54
- ldr r2, _08010344 @ =gUnknown_202273C
+ ldr r3, _08010340 @ =gEnigmaBerries
+ ldr r2, _08010344 @ =gLinkPlayers
mov r9, r2
adds r6, r3, 0
movs r4, 0x8
@@ -692,12 +692,12 @@ _0801031C:
ble _080102D8
b _080103FC
.align 2, 0
-_08010340: .4byte gUnknown_2023F54
-_08010344: .4byte gUnknown_202273C
+_08010340: .4byte gEnigmaBerries
+_08010344: .4byte gLinkPlayers
_08010348: .4byte gUnknown_202211C
_0801034C:
movs r5, 0
- ldr r4, _0801040C @ =gUnknown_2023F54
+ ldr r4, _0801040C @ =gEnigmaBerries
mov r9, r4
_08010352:
lsls r0, r5, 8
@@ -750,7 +750,7 @@ _08010378:
orrs r0, r4
strb r0, [r1]
movs r4, 0
- ldr r0, _0801040C @ =gUnknown_2023F54
+ ldr r0, _0801040C @ =gEnigmaBerries
adds r0, 0x8
adds r2, r0
adds r3, r0
@@ -796,7 +796,7 @@ _080103FC:
pop {r0}
bx r0
.align 2, 0
-_0801040C: .4byte gUnknown_2023F54
+_0801040C: .4byte gEnigmaBerries
_08010410: .4byte gUnknown_202211C
thumb_func_end sub_801017C
@@ -1560,7 +1560,7 @@ _08010A6A:
_08010A78:
cmp r4, r6
beq _08010ABA
- ldr r2, _08010A9C @ =gUnknown_202273C
+ ldr r2, _08010A9C @ =gLinkPlayers
adds r0, r7, r2
ldrh r1, [r0, 0x18]
movs r3, 0x1
@@ -1576,7 +1576,7 @@ _08010A78:
beq _08010AAC
b _08010ABA
.align 2, 0
-_08010A9C: .4byte gUnknown_202273C
+_08010A9C: .4byte gLinkPlayers
_08010AA0:
adds r0, r5, r2
ldrh r1, [r0, 0x18]
@@ -1835,7 +1835,7 @@ _08010CE2:
bl sub_8010414
bl sub_801017C
bl sub_8044708
- ldr r0, _08010D4C @ =gUnknown_201C000
+ ldr r0, _08010D4C @ =gDecompressionBuffer
ldr r1, _08010D50 @ =gPlayerParty
movs r2, 0x96
lsls r2, 1
@@ -1862,7 +1862,7 @@ _08010CE2:
adds r2, r1, 0
ldr r0, _08010D5C @ =gUnknown_2022118
adds r3, r0, 0x2
- ldr r5, _08010D60 @ =gUnknown_202273C
+ ldr r5, _08010D60 @ =gLinkPlayers
movs r4, 0x3F
movs r7, 0x80
lsls r7, 1
@@ -1877,12 +1877,12 @@ _08010D3A:
beq _08010D6E
b _08010D9C
.align 2, 0
-_08010D4C: .4byte gUnknown_201C000
+_08010D4C: .4byte gDecompressionBuffer
_08010D50: .4byte gPlayerParty
_08010D54: .4byte sub_800F6FC
_08010D58: .4byte gTasks
_08010D5C: .4byte gUnknown_2022118
-_08010D60: .4byte gUnknown_202273C
+_08010D60: .4byte gLinkPlayers
_08010D64:
cmp r0, 0x2
beq _08010D7E
@@ -1940,14 +1940,14 @@ _08010DC2:
bl bitmask_all_link_players_but_self
lsls r0, 24
lsrs r0, 24
- ldr r1, _08010DDC @ =gUnknown_201C000
+ ldr r1, _08010DDC @ =gDecompressionBuffer
movs r2, 0xC8
bl SendBlock
ldr r1, _08010DD8 @ =gUnknown_2023E82
b _080110EA
.align 2, 0
_08010DD8: .4byte gUnknown_2023E82
-_08010DDC: .4byte gUnknown_201C000
+_08010DDC: .4byte gDecompressionBuffer
_08010DE0:
bl GetBlockReceivedStatus
movs r1, 0xF
@@ -1967,7 +1967,7 @@ _08010DEE:
_08010E00:
cmp r6, r7
bne _08010E34
- ldr r0, _08010E1C @ =gUnknown_202273C
+ ldr r0, _08010E1C @ =gLinkPlayers
adds r0, r5, r0
ldrh r0, [r0, 0x18]
cmp r0, 0x2
@@ -1979,7 +1979,7 @@ _08010E00:
b _08010EBE
.align 2, 0
_08010E18: .4byte gUnknown_2022118
-_08010E1C: .4byte gUnknown_202273C
+_08010E1C: .4byte gLinkPlayers
_08010E20:
cmp r0, 0x3
bne _08010EBE
@@ -1994,7 +1994,7 @@ _08010E2C:
.align 2, 0
_08010E30: .4byte gUnknown_20243B0
_08010E34:
- ldr r2, _08010E54 @ =gUnknown_202273C
+ ldr r2, _08010E54 @ =gLinkPlayers
adds r0, r5, r2
ldrh r1, [r0, 0x18]
movs r3, 0x1
@@ -2011,7 +2011,7 @@ _08010E34:
beq _08010E66
b _08010E8C
.align 2, 0
-_08010E54: .4byte gUnknown_202273C
+_08010E54: .4byte gLinkPlayers
_08010E58:
mov r1, r8
adds r0, r1, r2
@@ -2120,7 +2120,7 @@ _08010F0E:
_08010F20:
cmp r6, r7
bne _08010F54
- ldr r0, _08010F3C @ =gUnknown_202273C
+ ldr r0, _08010F3C @ =gLinkPlayers
adds r0, r5, r0
ldrh r0, [r0, 0x18]
cmp r0, 0x2
@@ -2132,7 +2132,7 @@ _08010F20:
b _08010FDE
.align 2, 0
_08010F38: .4byte gUnknown_2022118
-_08010F3C: .4byte gUnknown_202273C
+_08010F3C: .4byte gLinkPlayers
_08010F40:
cmp r0, 0x3
bne _08010FDE
@@ -2147,7 +2147,7 @@ _08010F4C:
.align 2, 0
_08010F50: .4byte gUnknown_2024478
_08010F54:
- ldr r2, _08010F74 @ =gUnknown_202273C
+ ldr r2, _08010F74 @ =gLinkPlayers
adds r0, r5, r2
ldrh r1, [r0, 0x18]
movs r3, 0x1
@@ -2164,7 +2164,7 @@ _08010F54:
beq _08010F86
b _08010FAC
.align 2, 0
-_08010F74: .4byte gUnknown_202273C
+_08010F74: .4byte gLinkPlayers
_08010F78:
mov r1, r8
adds r0, r1, r2
@@ -2724,7 +2724,7 @@ _080113CE:
ldrh r1, [r0, 0x4]
movs r0, 0xB
muls r0, r1
- ldr r1, _08011450 @ =gUnknown_8245EE0
+ ldr r1, _08011450 @ =gSpeciesNames
adds r0, r1
ldrb r0, [r0]
adds r5, r2, 0
@@ -2779,7 +2779,7 @@ _08011410:
bl CreateMon
b _0801166C
.align 2, 0
-_08011450: .4byte gUnknown_8245EE0
+_08011450: .4byte gSpeciesNames
_08011454:
adds r0, r2, 0
adds r0, 0x24
@@ -2792,7 +2792,7 @@ _08011454:
ldrh r1, [r0, 0x4]
movs r0, 0xB
muls r0, r1
- ldr r1, _0801150C @ =gUnknown_8245EE0
+ ldr r1, _0801150C @ =gSpeciesNames
adds r0, r1
ldrb r0, [r0]
mov r8, r2
@@ -2856,25 +2856,25 @@ _080114E0:
adds r1, 0xD
adds r0, r5, 0
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
adds r1, r6, 0
adds r1, 0x11
ldrh r0, [r4]
lsls r2, r0, 1
adds r2, r0
lsls r2, 2
- ldr r0, _08011510 @ =gUnknown_8250C08
+ ldr r0, _08011510 @ =gBattleMoves+0x4
adds r2, r0
adds r0, r5, 0
- bl sub_804037C
+ bl SetMonData
adds r4, 0x2
adds r6, 0x1
cmp r6, 0x3
ble _080114E0
b _0801166C
.align 2, 0
-_0801150C: .4byte gUnknown_8245EE0
-_08011510: .4byte gUnknown_8250C08
+_0801150C: .4byte gSpeciesNames
+_08011510: .4byte gBattleMoves+0x4
_08011514:
adds r0, r2, 0
adds r0, 0x24
@@ -2887,7 +2887,7 @@ _08011514:
ldrh r1, [r0, 0x4]
movs r0, 0xB
muls r0, r1
- ldr r1, _080115A4 @ =gUnknown_8245EE0
+ ldr r1, _080115A4 @ =gSpeciesNames
adds r0, r1
ldrb r0, [r0]
adds r5, r2, 0
@@ -2945,10 +2945,10 @@ _08011556:
adds r0, r4, 0
movs r1, 0xC
adds r2, r5, 0
- bl sub_804037C
+ bl SetMonData
b _0801166C
.align 2, 0
-_080115A4: .4byte gUnknown_8245EE0
+_080115A4: .4byte gSpeciesNames
_080115A8:
adds r0, r4, 0
adds r0, 0x24
@@ -2961,7 +2961,7 @@ _080115A8:
ldrh r1, [r0, 0x4]
movs r0, 0xB
muls r0, r1
- ldr r1, _080116BC @ =gUnknown_8245EE0
+ ldr r1, _080116BC @ =gSpeciesNames
adds r0, r1
ldrb r0, [r0]
mov r8, r2
@@ -3020,7 +3020,7 @@ _080115EA:
adds r0, r4, 0
movs r1, 0xC
adds r2, r5, 0
- bl sub_804037C
+ bl SetMonData
movs r6, 0
adds r5, r4, 0
mov r0, r8
@@ -3031,17 +3031,17 @@ _08011642:
adds r1, 0xD
adds r0, r5, 0
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
adds r1, r6, 0
adds r1, 0x11
ldrh r0, [r4]
lsls r2, r0, 1
adds r2, r0
lsls r2, 2
- ldr r0, _080116C0 @ =gUnknown_8250C08
+ ldr r0, _080116C0 @ =gBattleMoves+0x4
adds r2, r0
adds r0, r5, 0
- bl sub_804037C
+ bl SetMonData
adds r4, 0x2
adds r6, 0x1
cmp r6, 0x3
@@ -3092,8 +3092,8 @@ _080116AC:
pop {r1}
bx r1
.align 2, 0
-_080116BC: .4byte gUnknown_8245EE0
-_080116C0: .4byte gUnknown_8250C08
+_080116BC: .4byte gSpeciesNames
+_080116C0: .4byte gBattleMoves+0x4
_080116C4: .4byte gTrainers
_080116C8: .4byte gBattleTypeFlags
thumb_func_end sub_80112E0
@@ -3300,7 +3300,7 @@ sub_801184C: @ 801184C
ands r0, r1
cmp r0, 0
beq _080118BC
- ldr r1, _0801189C @ =gUnknown_202273C
+ ldr r1, _0801189C @ =gLinkPlayers
lsls r0, r2, 3
subs r0, r2
lsls r0, 2
@@ -3316,7 +3316,7 @@ sub_801184C: @ 801184C
.align 2, 0
_08011894: .4byte gBattleStruct
_08011898: .4byte gBattleTypeFlags
-_0801189C: .4byte gUnknown_202273C
+_0801189C: .4byte gLinkPlayers
_080118A0:
cmp r0, 0x2
beq _080118BC
@@ -3881,7 +3881,7 @@ sub_8011D0C: @ 8011D0C
adds r0, r4, 0
movs r1, 0x3
adds r2, r5, 0
- bl sub_804037C
+ bl SetMonData
_08011D54:
add sp, 0x10
pop {r4,r5}
@@ -4155,7 +4155,7 @@ _08011F50:
cmp r4, r0
bne _08011F74
ldr r0, _08011F6C @ =gUnknown_83AE03C
- ldr r1, _08011F70 @ =gUnknown_2024024
+ ldr r1, _08011F70 @ =gBattleMonForms
adds r1, r6, r1
ldrb r1, [r1]
lsls r1, 2
@@ -4165,7 +4165,7 @@ _08011F50:
.align 2, 0
_08011F68: .4byte 0x00000181
_08011F6C: .4byte gUnknown_83AE03C
-_08011F70: .4byte gUnknown_2024024
+_08011F70: .4byte gBattleMonForms
_08011F74:
movs r0, 0xCE
lsls r0, 1
@@ -4233,14 +4233,14 @@ _08011FE8:
ldrh r0, [r4, 0x2E]
lsls r0, 24
lsrs r0, 24
- bl GetBankIdentity
- ldr r1, _0801203C @ =gUnknown_202401C
+ bl GetBattlerPosition
+ ldr r1, _0801203C @ =gMonSpritesGfxPtr
ldr r1, [r1]
lsls r0, 24
lsrs r0, 22
adds r1, 0x4
adds r1, r0
- ldr r2, _08012040 @ =gUnknown_2024024
+ ldr r2, _08012040 @ =gBattleMonForms
movs r3, 0x2E
ldrsh r0, [r4, r3]
adds r0, r2
@@ -4260,7 +4260,7 @@ _0801201A:
subs r0, 0x1
cmp r0, 0
bge _0801201A
- ldr r0, _08012040 @ =gUnknown_2024024
+ ldr r0, _08012040 @ =gBattleMonForms
movs r3, 0x2E
ldrsh r1, [r4, r3]
adds r1, r0
@@ -4272,8 +4272,8 @@ _08012034:
pop {r0}
bx r0
.align 2, 0
-_0801203C: .4byte gUnknown_202401C
-_08012040: .4byte gUnknown_2024024
+_0801203C: .4byte gMonSpritesGfxPtr
+_08012040: .4byte gBattleMonForms
thumb_func_end sub_8011FB4
thumb_func_start sub_8012044
@@ -4799,7 +4799,7 @@ sub_80123E4: @ 80123E4
ldr r1, _08012428 @ =gActiveBattler
movs r0, 0
strb r0, [r1]
- ldr r0, _0801242C @ =gUnknown_2023BCC
+ ldr r0, _0801242C @ =gBattlersCount
ldrb r0, [r0]
cmp r0, 0
beq _0801241E
@@ -4814,7 +4814,7 @@ _08012400:
ldrb r0, [r4]
adds r0, 0x1
strb r0, [r4]
- ldr r1, _0801242C @ =gUnknown_2023BCC
+ ldr r1, _0801242C @ =gBattlersCount
lsls r0, 24
lsrs r0, 24
ldrb r1, [r1]
@@ -4827,7 +4827,7 @@ _0801241E:
.align 2, 0
_08012424: .4byte gUnknown_3004F84
_08012428: .4byte gActiveBattler
-_0801242C: .4byte gUnknown_2023BCC
+_0801242C: .4byte gBattlersCount
_08012430: .4byte gUnknown_3004FE0
thumb_func_end sub_80123E4
@@ -4903,7 +4903,7 @@ _0801246C:
cmp r2, 0x3
ble _08012464
movs r5, 0
- ldr r3, _080126F8 @ =gUnknown_2023DE4
+ ldr r3, _080126F8 @ =gSideTimers
ldr r4, _080126FC @ =gSideAffecting
movs r2, 0x1
_080124C6:
@@ -5182,7 +5182,7 @@ _080126E8: .4byte gStatuses3
_080126EC: .4byte gUnknown_2023DD4
_080126F0: .4byte gUnknown_2023DC0
_080126F4: .4byte gBattleResources
-_080126F8: .4byte gUnknown_2023DE4
+_080126F8: .4byte gSideTimers
_080126FC: .4byte gSideAffecting
_08012700: .4byte sBattler_AI
_08012704: .4byte gBattlerTarget
@@ -5262,7 +5262,7 @@ _080127B0:
cmp r5, 0x7
ble _080127B0
movs r5, 0
- ldr r7, _080128DC @ =gUnknown_2023BCC
+ ldr r7, _080128DC @ =gBattlersCount
ldrb r7, [r7]
cmp r5, r7
bge _08012824
@@ -5310,7 +5310,7 @@ _08012816:
adds r3, 0x1C
adds r4, 0x4
adds r5, 0x1
- ldr r0, _080128DC @ =gUnknown_2023BCC
+ ldr r0, _080128DC @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
blt _080127D2
@@ -5346,7 +5346,7 @@ _08012838:
ands r0, r2
str r0, [r1]
movs r5, 0
- ldr r6, _080128DC @ =gUnknown_2023BCC
+ ldr r6, _080128DC @ =gBattlersCount
ldrb r6, [r6]
cmp r5, r6
bge _0801290C
@@ -5354,11 +5354,11 @@ _08012838:
movs r6, 0
_0801286C:
ldrb r0, [r7]
- bl GetBankSide
+ bl GetBattlerSide
adds r4, r0, 0
lsls r0, r5, 24
lsrs r0, 24
- bl GetBankSide
+ bl GetBattlerSide
lsls r4, 24
lsls r0, 24
cmp r4, r0
@@ -5386,7 +5386,7 @@ _0801286C:
_080128AC:
adds r6, 0x1C
adds r5, 0x1
- ldr r0, _080128DC @ =gUnknown_2023BCC
+ ldr r0, _080128DC @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
blt _0801286C
@@ -5402,7 +5402,7 @@ _080128CC: .4byte gBattleMoves
_080128D0: .4byte gCurrentMove
_080128D4: .4byte gStatuses3
_080128D8: .4byte gBattleMons
-_080128DC: .4byte gUnknown_2023BCC
+_080128DC: .4byte gBattlersCount
_080128E0: .4byte gUnknown_2023C34
_080128E4: .4byte 0xfbffffff
_080128E8: .4byte 0x15100007
@@ -5427,7 +5427,7 @@ _0801290C:
ldr r7, _08012B80 @ =gBattleStruct
ldr r3, _08012B84 @ =gUnknown_2023FF8
mov r10, r3
- ldr r6, _08012B88 @ =gUnknown_2023BCC
+ ldr r6, _08012B88 @ =gBattlersCount
ldrb r6, [r6]
cmp r5, r6
bge _0801296C
@@ -5470,7 +5470,7 @@ _08012944:
str r1, [r3]
_08012962:
adds r5, 0x1
- ldr r3, _08012B88 @ =gUnknown_2023BCC
+ ldr r3, _08012B88 @ =gBattlersCount
ldrb r3, [r3]
cmp r5, r3
blt _08012924
@@ -5672,7 +5672,7 @@ _08012A1A:
adds r0, 0xE7
strb r3, [r0]
movs r5, 0
- ldr r0, _08012B88 @ =gUnknown_2023BCC
+ ldr r0, _08012B88 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
bge _08012B3C
@@ -5707,7 +5707,7 @@ _08012B14:
adds r0, 0xE1
strb r3, [r0]
adds r5, 0x1
- ldr r2, _08012B88 @ =gUnknown_2023BCC
+ ldr r2, _08012B88 @ =gBattlersCount
ldrb r2, [r2]
cmp r5, r2
blt _08012AFC
@@ -5748,7 +5748,7 @@ _08012B3C:
_08012B7C: .4byte gBattleMons
_08012B80: .4byte gBattleStruct
_08012B84: .4byte gUnknown_2023FF8
-_08012B88: .4byte gUnknown_2023BCC
+_08012B88: .4byte gBattlersCount
_08012B8C: .4byte gUnknown_2023C34
_08012B90: .4byte gBitTable
_08012B94: .4byte gActiveBattler
@@ -5809,7 +5809,7 @@ _08012BEE:
adds r0, r6
str r1, [r0]
movs r3, 0
- ldr r0, _08012F74 @ =gUnknown_2023BCC
+ ldr r0, _08012F74 @ =gBattlersCount
ldrb r0, [r0]
cmp r3, r0
bge _08012C8A
@@ -5866,7 +5866,7 @@ _08012C7C:
adds r4, 0x58
adds r5, 0x1C
adds r3, 0x1
- ldr r0, _08012F74 @ =gUnknown_2023BCC
+ ldr r0, _08012F74 @ =gBattlersCount
ldrb r0, [r0]
cmp r3, r0
blt _08012C26
@@ -6150,7 +6150,7 @@ _08012CA8:
adds r0, 0xE7
strb r3, [r0]
movs r3, 0
- ldr r0, _08012F74 @ =gUnknown_2023BCC
+ ldr r0, _08012F74 @ =gBattlersCount
ldrb r0, [r0]
cmp r3, r0
bge _08012F04
@@ -6187,7 +6187,7 @@ _08012EDC:
adds r0, 0xE1
strb r4, [r0]
adds r3, 0x1
- ldr r2, _08012F74 @ =gUnknown_2023BCC
+ ldr r2, _08012F74 @ =gBattlersCount
ldrb r2, [r2]
cmp r3, r2
blt _08012EC4
@@ -6243,7 +6243,7 @@ _08012F64: .4byte gUnknown_2023FF8
_08012F68: .4byte gUnknown_2023FFC
_08012F6C: .4byte gUnknown_2023E8C
_08012F70: .4byte gBattleMons
-_08012F74: .4byte gUnknown_2023BCC
+_08012F74: .4byte gBattlersCount
_08012F78: .4byte gBitTable
_08012F7C: .4byte gDisableStructs
_08012F80: .4byte 0xfbffffff
@@ -6278,7 +6278,7 @@ _08012FC0:
movs r0, 0
movs r1, 0
movs r2, 0
- bl EmitGetMonData
+ bl BtlController_EmitGetMonData
ldrb r0, [r4]
bl MarkBufferBankForExecution
ldrb r0, [r5]
@@ -6295,7 +6295,7 @@ _08012FE4:
ldrb r0, [r5, 0x1]
adds r0, 0x1
strb r0, [r5, 0x1]
- ldr r1, _0801300C @ =gUnknown_2023BCC
+ ldr r1, _0801300C @ =gBattlersCount
lsls r0, 24
lsrs r0, 24
ldrb r1, [r1]
@@ -6307,7 +6307,7 @@ _08012FE4:
b _0801301A
.align 2, 0
_08013008: .4byte gUnknown_2023BC8
-_0801300C: .4byte gUnknown_2023BCC
+_0801300C: .4byte gBattlersCount
_08013010: .4byte gUnknown_3004F84
_08013014: .4byte BattleIntroPrepareBackgroundSlide
_08013018:
@@ -6326,7 +6326,7 @@ BattleIntroPrepareBackgroundSlide: @ 8013020
cmp r5, 0
bne _08013050
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r4, _0801305C @ =gActiveBattler
strb r0, [r4]
ldr r0, _08013060 @ =gUnknown_2022B50
@@ -6369,7 +6369,7 @@ sub_8013070: @ 8013070
_08013084:
ldr r2, _080130D8 @ =gActiveBattler
strb r1, [r2]
- ldr r0, _080130DC @ =gUnknown_2023BCC
+ ldr r0, _080130DC @ =gBattlersCount
ldrb r0, [r0]
cmp r1, r0
bcc _08013092
@@ -6391,7 +6391,7 @@ _080130A0:
beq _080130E8
ldr r4, _080130D8 @ =gActiveBattler
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080130E8
@@ -6411,7 +6411,7 @@ _080130C6:
.align 2, 0
_080130D4: .4byte gUnknown_2023BC8
_080130D8: .4byte gActiveBattler
-_080130DC: .4byte gUnknown_2023BCC
+_080130DC: .4byte gBattlersCount
_080130E0: .4byte gBattleMons
_080130E4: .4byte gBattleTypeFlags
_080130E8:
@@ -6478,7 +6478,7 @@ _080130FA:
adds r1, 0x20
strb r0, [r1]
ldrb r0, [r2]
- bl GetBankSide
+ bl GetBattlerSide
ldr r1, _0801323C @ =gBattleStruct
lsls r0, 24
lsrs r0, 23
@@ -6521,7 +6521,7 @@ _08013196:
_080131B6:
ldr r4, _08013238 @ =gActiveBattler
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
cmp r0, 0
bne _080131D0
@@ -6537,7 +6537,7 @@ _080131D0:
cmp r0, 0
beq _0801324C
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -6548,7 +6548,7 @@ _080131D0:
bl MarkBufferBankForExecution
_080131F6:
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -6582,7 +6582,7 @@ _08013244: .4byte gBattleTypeFlags
_08013248: .4byte 0x0001aa02
_0801324C:
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -6644,13 +6644,13 @@ _080132C2:
beq _080132F8
ldr r4, _0801332C @ =gActiveBattler
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x2
beq _080132EC
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
@@ -6665,7 +6665,7 @@ _080132F8:
ldrb r0, [r2]
adds r0, 0x1
strb r0, [r2]
- ldr r1, _08013330 @ =gUnknown_2023BCC
+ ldr r1, _08013330 @ =gBattlersCount
lsls r0, 24
lsrs r0, 24
ldrb r1, [r1]
@@ -6688,7 +6688,7 @@ _08013314:
_08013324: .4byte 0x0001aa02
_08013328: .4byte gBattleTypeFlags
_0801332C: .4byte gActiveBattler
-_08013330: .4byte gUnknown_2023BCC
+_08013330: .4byte gBattlersCount
_08013334: .4byte gUnknown_3004F84
_08013338: .4byte BattleIntroDrawPartySummaryScreens
thumb_func_end sub_8013070
@@ -6762,7 +6762,7 @@ _080133B6:
cmp r7, 0x5
ble _08013366
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r4, _08013410 @ =gActiveBattler
strb r0, [r4]
movs r0, 0
@@ -6817,7 +6817,7 @@ _0801342E:
cmp r7, 0x5
ble _080133E2
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r4, _0801345C @ =gActiveBattler
strb r0, [r4]
movs r0, 0
@@ -6902,7 +6902,7 @@ BattleIntroPrintTrainerWantsToBattle: @ 80134DC
cmp r0, 0
bne _080134FE
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _08013508 @ =gActiveBattler
strb r0, [r1]
ldrb r1, [r1]
@@ -6942,7 +6942,7 @@ sub_8013514: @ 8013514
cmp r0, r1
bne _0801354A
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _08013560 @ =gBattleScripting
strb r0, [r1, 0x17]
ldr r0, _08013564 @ =gUnknown_81D91A1
@@ -6967,7 +6967,7 @@ sub_8013568: @ 8013568
cmp r0, 0
bne _0801358A
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
@@ -6994,14 +6994,14 @@ sub_801359C: @ 801359C
bne _0801360C
ldr r2, _08013618 @ =gActiveBattler
strb r1, [r2]
- ldr r0, _0801361C @ =gUnknown_2023BCC
+ ldr r0, _0801361C @ =gBattlersCount
ldrb r0, [r0]
cmp r1, r0
bcs _08013606
adds r4, r2, 0
_080135B4:
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -7018,7 +7018,7 @@ _080135CE:
cmp r0, 0
beq _080135F4
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
@@ -7031,7 +7031,7 @@ _080135F4:
ldrb r0, [r4]
adds r0, 0x1
strb r0, [r4]
- ldr r1, _0801361C @ =gUnknown_2023BCC
+ ldr r1, _0801361C @ =gBattlersCount
lsls r0, 24
lsrs r0, 24
ldrb r1, [r1]
@@ -7048,7 +7048,7 @@ _0801360C:
.align 2, 0
_08013614: .4byte gUnknown_2023BC8
_08013618: .4byte gActiveBattler
-_0801361C: .4byte gUnknown_2023BCC
+_0801361C: .4byte gBattlersCount
_08013620: .4byte gBattleTypeFlags
_08013624: .4byte gUnknown_3004F84
_08013628: .4byte sub_801362C
@@ -7063,7 +7063,7 @@ sub_801362C: @ 801362C
bne _0801369C
ldr r2, _080136A8 @ =gActiveBattler
strb r1, [r2]
- ldr r0, _080136AC @ =gUnknown_2023BCC
+ ldr r0, _080136AC @ =gBattlersCount
ldrb r0, [r0]
cmp r1, r0
bcs _08013696
@@ -7074,7 +7074,7 @@ sub_801362C: @ 801362C
adds r7, 0x48
_0801364C:
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -7102,7 +7102,7 @@ _08013684:
ldrb r0, [r4]
adds r0, 0x1
strb r0, [r4]
- ldr r1, _080136AC @ =gUnknown_2023BCC
+ ldr r1, _080136AC @ =gBattlersCount
lsls r0, 24
lsrs r0, 24
ldrb r1, [r1]
@@ -7119,7 +7119,7 @@ _0801369C:
.align 2, 0
_080136A4: .4byte gUnknown_2023BC8
_080136A8: .4byte gActiveBattler
-_080136AC: .4byte gUnknown_2023BCC
+_080136AC: .4byte gBattlersCount
_080136B0: .4byte gBattleMons
_080136B4: .4byte gBattleTypeFlags
_080136B8: .4byte 0x0001aa02
@@ -7160,7 +7160,7 @@ sub_80136E4: @ 80136E4
cmp r0, 0
bne _0801370C
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
@@ -7189,14 +7189,14 @@ sub_8013728: @ 8013728
bne _080137AC
ldr r2, _080137B8 @ =gActiveBattler
strb r1, [r2]
- ldr r0, _080137BC @ =gUnknown_2023BCC
+ ldr r0, _080137BC @ =gBattlersCount
ldrb r0, [r0]
cmp r1, r0
bcs _08013790
adds r4, r2, 0
_08013740:
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
cmp r0, 0
bne _08013758
@@ -7212,7 +7212,7 @@ _08013758:
cmp r0, 0
beq _0801377E
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x2
@@ -7225,7 +7225,7 @@ _0801377E:
ldrb r0, [r4]
adds r0, 0x1
strb r0, [r4]
- ldr r1, _080137BC @ =gUnknown_2023BCC
+ ldr r1, _080137BC @ =gBattlersCount
lsls r0, 24
lsrs r0, 24
ldrb r1, [r1]
@@ -7253,7 +7253,7 @@ _080137AC:
.align 2, 0
_080137B4: .4byte gUnknown_2023BC8
_080137B8: .4byte gActiveBattler
-_080137BC: .4byte gUnknown_2023BCC
+_080137BC: .4byte gBattlersCount
_080137C0: .4byte gBattleTypeFlags
_080137C4: .4byte gBattleStruct
_080137C8: .4byte gUnknown_3004F84
@@ -7269,7 +7269,7 @@ sub_80137D0: @ 80137D0
bne _0801383A
ldr r2, _08013844 @ =gActiveBattler
strb r1, [r2]
- ldr r0, _08013848 @ =gUnknown_2023BCC
+ ldr r0, _08013848 @ =gBattlersCount
ldrb r0, [r0]
cmp r1, r0
bcs _0801381E
@@ -7277,7 +7277,7 @@ sub_80137D0: @ 80137D0
ldr r5, _0801384C @ =gBattlerPartyIndexes
_080137EA:
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _0801380C
@@ -7294,7 +7294,7 @@ _0801380C:
ldrb r0, [r4]
adds r0, 0x1
strb r0, [r4]
- ldr r1, _08013848 @ =gUnknown_2023BCC
+ ldr r1, _08013848 @ =gBattlersCount
lsls r0, 24
lsrs r0, 24
ldrb r1, [r1]
@@ -7322,7 +7322,7 @@ _0801383A:
.align 2, 0
_08013840: .4byte gUnknown_2023BC8
_08013844: .4byte gActiveBattler
-_08013848: .4byte gUnknown_2023BCC
+_08013848: .4byte gBattlersCount
_0801384C: .4byte gBattlerPartyIndexes
_08013850: .4byte gBattleStruct
_08013854: .4byte gUnknown_3004F84
@@ -7351,7 +7351,7 @@ _08013874:
cmp r0, 0
bne _080138FA
movs r5, 0
- ldr r1, _080138A8 @ =gUnknown_2023BCC
+ ldr r1, _080138A8 @ =gBattlersCount
adds r3, r1, 0
ldrb r0, [r1]
cmp r5, r0
@@ -7370,7 +7370,7 @@ _0801389A:
.align 2, 0
_080138A0: .4byte gUnknown_2023BC8
_080138A4: .4byte gBattleStruct
-_080138A8: .4byte gUnknown_2023BCC
+_080138A8: .4byte gBattlersCount
_080138AC: .4byte gUnknown_2023BDE
_080138B0:
adds r4, r5, 0x1
@@ -7379,7 +7379,7 @@ _080138B0:
cmp r8, r1
bge _080138EE
ldr r6, _08013924 @ =gUnknown_2023BDE
- ldr r3, _08013928 @ =gUnknown_2023BCC
+ ldr r3, _08013928 @ =gBattlersCount
lsls r7, r5, 24
_080138C0:
adds r0, r5, r6
@@ -7400,7 +7400,7 @@ _080138C0:
ldr r3, [sp, 0x4]
_080138E4:
adds r4, 0x1
- ldr r0, _08013928 @ =gUnknown_2023BCC
+ ldr r0, _08013928 @ =gBattlersCount
ldrb r0, [r0]
cmp r4, r0
blt _080138C0
@@ -7424,7 +7424,7 @@ _080138FA:
movs r1, 0
movs r2, 0
movs r3, 0xFF
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
beq _08013930
@@ -7435,13 +7435,13 @@ _080138FA:
b _08013ADA
.align 2, 0
_08013924: .4byte gUnknown_2023BDE
-_08013928: .4byte gUnknown_2023BCC
+_08013928: .4byte gBattlersCount
_0801392C: .4byte gBattleStruct
_08013930:
ldr r2, _08013AE8 @ =gBattleStruct
ldr r0, [r2]
adds r0, 0x4C
- ldr r1, _08013AEC @ =gUnknown_2023BCC
+ ldr r1, _08013AEC @ =gBattlersCount
ldrb r0, [r0]
ldrb r1, [r1]
cmp r0, r1
@@ -7458,7 +7458,7 @@ _08013944:
str r0, [sp]
movs r2, 0
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
beq _0801396A
@@ -7480,7 +7480,7 @@ _0801396A:
_0801397C:
ldr r0, [r4]
adds r0, 0x4C
- ldr r1, _08013AEC @ =gUnknown_2023BCC
+ ldr r1, _08013AEC @ =gBattlersCount
ldrb r0, [r0]
ldrb r1, [r1]
cmp r0, r1
@@ -7492,7 +7492,7 @@ _0801398A:
movs r1, 0
movs r2, 0
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r0, 24
cmp r0, 0
@@ -7504,7 +7504,7 @@ _080139A4:
movs r1, 0
movs r2, 0
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
beq _080139BA
@@ -7513,7 +7513,7 @@ _080139BA:
ldr r2, _08013AE8 @ =gBattleStruct
ldr r0, [r2]
adds r0, 0xD9
- ldr r1, _08013AEC @ =gUnknown_2023BCC
+ ldr r1, _08013AEC @ =gBattlersCount
ldrb r0, [r0]
adds r3, r1, 0
ldrb r1, [r3]
@@ -7551,7 +7551,7 @@ _080139F6:
bne _08013ADA
ldr r0, [r4]
adds r0, 0xD9
- ldr r1, _08013AEC @ =gUnknown_2023BCC
+ ldr r1, _08013AEC @ =gBattlersCount
ldrb r0, [r0]
ldrb r1, [r1]
cmp r0, r1
@@ -7611,7 +7611,7 @@ _08013A74:
cmp r0, r1
bge _08013A74
movs r5, 0
- ldr r3, _08013AEC @ =gUnknown_2023BCC
+ ldr r3, _08013AEC @ =gBattlersCount
ldr r2, _08013AE8 @ =gBattleStruct
ldr r6, _08013B0C @ =gBattleScripting
ldr r7, _08013B10 @ =gMoveResultFlags
@@ -7668,7 +7668,7 @@ _08013ADA:
bx r0
.align 2, 0
_08013AE8: .4byte gBattleStruct
-_08013AEC: .4byte gUnknown_2023BCC
+_08013AEC: .4byte gBattlersCount
_08013AF0: .4byte gUnknown_2023BDE
_08013AF4: .4byte gUnknown_2023D7C
_08013AF8: .4byte gUnknown_2023DC4
@@ -7692,7 +7692,7 @@ sub_8013B1C: @ 8013B1C
ldr r1, _08013BB8 @ =gUnknown_3004F84
ldr r0, _08013BBC @ =sub_8013BD4
str r0, [r1]
- ldr r3, _08013BC0 @ =gUnknown_2023BCC
+ ldr r3, _08013BC0 @ =gBattlersCount
ldr r1, _08013BC4 @ =gUnknown_2023E82
movs r2, 0
adds r0, r1, 0x7
@@ -7735,7 +7735,7 @@ _08013B4A:
bl CancelMultiTurnMoves
_08013B7C:
adds r4, 0x1
- ldr r0, _08013BC0 @ =gUnknown_2023BCC
+ ldr r0, _08013BC0 @ =gBattlersCount
ldrb r0, [r0]
cmp r4, r0
blt _08013B4A
@@ -7767,7 +7767,7 @@ _08013BAC:
_08013BB4: .4byte gUnknown_2023BC8
_08013BB8: .4byte gUnknown_3004F84
_08013BBC: .4byte sub_8013BD4
-_08013BC0: .4byte gUnknown_2023BCC
+_08013BC0: .4byte gBattlersCount
_08013BC4: .4byte gUnknown_2023E82
_08013BC8: .4byte gBattleMons
_08013BCC: .4byte gBattleStruct
@@ -7879,7 +7879,7 @@ _08013CB0:
strb r0, [r1, 0x13]
_08013CBC:
movs r2, 0
- ldr r4, _08013D34 @ =gUnknown_2023BCC
+ ldr r4, _08013D34 @ =gBattlersCount
ldr r0, _08013D38 @ =gBattleStruct
mov r8, r0
ldr r1, _08013D3C @ =gUnknown_3004F84
@@ -7940,7 +7940,7 @@ _08013D20:
bx r0
.align 2, 0
_08013D30: .4byte gBattleResults
-_08013D34: .4byte gUnknown_2023BCC
+_08013D34: .4byte gBattlersCount
_08013D38: .4byte gBattleStruct
_08013D3C: .4byte gUnknown_3004F84
_08013D40: .4byte gAbsentBattlerFlags
@@ -7963,7 +7963,7 @@ IsRunningFromBattleImpossible: @ 8013D54
ldrh r0, [r1, 0x2E]
cmp r0, 0xAF
bne _08013D84
- ldr r1, _08013D80 @ =gUnknown_2023F54
+ ldr r1, _08013D80 @ =gEnigmaBerries
lsls r0, r2, 3
subs r0, r2
lsls r0, 2
@@ -7973,14 +7973,14 @@ IsRunningFromBattleImpossible: @ 8013D54
.align 2, 0
_08013D78: .4byte gBattleMons
_08013D7C: .4byte gActiveBattler
-_08013D80: .4byte gUnknown_2023F54
+_08013D80: .4byte gEnigmaBerries
_08013D84:
ldrh r0, [r1, 0x2E]
bl ItemId_GetHoldEffect
lsls r0, 24
lsrs r2, r0, 24
_08013D8E:
- ldr r1, _08013EA4 @ =gUnknown_2023D6F
+ ldr r1, _08013EA4 @ =gPotentialItemEffectBattler
ldr r3, _08013EA8 @ =gActiveBattler
ldrb r0, [r3]
strb r0, [r1]
@@ -8008,11 +8008,11 @@ _08013DAA:
b _08013F18
_08013DBE:
adds r0, r2, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r6, r0, 24
movs r5, 0
- ldr r0, _08013EB4 @ =gUnknown_2023BCC
+ ldr r0, _08013EB4 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
bge _08013E52
@@ -8020,7 +8020,7 @@ _08013DBE:
_08013DD4:
lsrs r4, r7, 24
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r6, r0
@@ -8037,7 +8037,7 @@ _08013DD4:
b _08013F20
_08013DF8:
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r6, r0
@@ -8077,7 +8077,7 @@ _08013E42:
lsls r0, 17
adds r7, r0
adds r5, 0x1
- ldr r0, _08013EB4 @ =gUnknown_2023BCC
+ ldr r0, _08013EB4 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
blt _08013DD4
@@ -8089,7 +8089,7 @@ _08013E52:
movs r0, 0xF
movs r2, 0x2A
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r5, r0, 24
cmp r5, 0
@@ -8113,7 +8113,7 @@ _08013E8A:
ldr r0, _08013EB8 @ =gBattleScripting
subs r1, r5, 0x1
strb r1, [r0, 0x17]
- ldr r2, _08013EBC @ =gUnknown_2023D6A
+ ldr r2, _08013EBC @ =gLastUsedAbility
adds r0, r1, 0
muls r0, r3
adds r0, r6
@@ -8124,13 +8124,13 @@ _08013E8A:
movs r0, 0x2
b _08013F5C
.align 2, 0
-_08013EA4: .4byte gUnknown_2023D6F
+_08013EA4: .4byte gPotentialItemEffectBattler
_08013EA8: .4byte gActiveBattler
_08013EAC: .4byte gBattleTypeFlags
_08013EB0: .4byte gBattleMons
-_08013EB4: .4byte gUnknown_2023BCC
+_08013EB4: .4byte gBattlersCount
_08013EB8: .4byte gBattleScripting
-_08013EBC: .4byte gUnknown_2023D6A
+_08013EBC: .4byte gLastUsedAbility
_08013EC0: .4byte gUnknown_2023E82
_08013EC4:
ldr r1, _08013EF8 @ =gBattleMons
@@ -8181,7 +8181,7 @@ _08013F1C: .4byte gBattleTypeFlags
_08013F20:
ldr r0, _08013F30 @ =gBattleScripting
strb r5, [r0, 0x17]
- ldr r1, _08013F34 @ =gUnknown_2023D6A
+ ldr r1, _08013F34 @ =gLastUsedAbility
ldrb r0, [r2]
strb r0, [r1]
ldr r1, _08013F38 @ =gUnknown_2023E82
@@ -8189,12 +8189,12 @@ _08013F20:
b _08013F5C
.align 2, 0
_08013F30: .4byte gBattleScripting
-_08013F34: .4byte gUnknown_2023D6A
+_08013F34: .4byte gLastUsedAbility
_08013F38: .4byte gUnknown_2023E82
_08013F3C:
ldr r0, _08013F4C @ =gBattleScripting
strb r5, [r0, 0x17]
- ldr r1, _08013F50 @ =gUnknown_2023D6A
+ ldr r1, _08013F50 @ =gLastUsedAbility
ldrb r0, [r2]
strb r0, [r1]
ldr r1, _08013F54 @ =gUnknown_2023E82
@@ -8202,7 +8202,7 @@ _08013F3C:
b _08013F5C
.align 2, 0
_08013F4C: .4byte gBattleScripting
-_08013F50: .4byte gUnknown_2023D6A
+_08013F50: .4byte gLastUsedAbility
_08013F54: .4byte gUnknown_2023E82
_08013F58:
ldr r1, _08013F68 @ =gUnknown_2023E82
@@ -8340,7 +8340,7 @@ sub_8014040: @ 8014040
strb r1, [r0, 0x4]
ldr r0, _08014090 @ =gActiveBattler
strb r1, [r0]
- ldr r0, _08014094 @ =gUnknown_2023BCC
+ ldr r0, _08014094 @ =gBattlersCount
adds r2, r0, 0
ldrb r0, [r2]
cmp r1, r0
@@ -8349,7 +8349,7 @@ sub_8014040: @ 8014040
_08014064:
ldr r4, _08014090 @ =gActiveBattler
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r5, r0, 24
ldr r1, _0801408C @ =gUnknown_2023E82
@@ -8368,7 +8368,7 @@ _08014080:
.align 2, 0
_0801408C: .4byte gUnknown_2023E82
_08014090: .4byte gActiveBattler
-_08014094: .4byte gUnknown_2023BCC
+_08014094: .4byte gBattlersCount
_08014098: .4byte _0801409C
.align 2, 0
_0801409C:
@@ -8401,7 +8401,7 @@ _080140B8:
beq _08014114
eors r5, r1
adds r0, r5, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, [r4]
adds r1, 0x91
ldrb r1, [r1]
@@ -8415,7 +8415,7 @@ _080140B8:
bne _08014114
ldr r4, _08014160 @ =gUnknown_2023E82
adds r0, r5, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
adds r0, r4
@@ -8853,7 +8853,7 @@ _080144C0:
adds r1, r2, 0
movs r2, 0x17
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0
@@ -8863,7 +8863,7 @@ _080144C0:
movs r0, 0xC
movs r2, 0x47
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0
@@ -8894,7 +8894,7 @@ _08014510:
movs r0, 0xF
movs r2, 0x2A
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0
@@ -8921,7 +8921,7 @@ _08014548:
orrs r1, r0
lsls r1, 24
lsrs r1, 24
- ldr r0, _0801457C @ =gUnknown_2023D6A
+ ldr r0, _0801457C @ =gLastUsedAbility
ldrb r3, [r0]
ldr r4, _08014580 @ =gBattleStruct
ldr r0, _08014574 @ =gActiveBattler
@@ -8939,7 +8939,7 @@ _08014548:
.align 2, 0
_08014574: .4byte gActiveBattler
_08014578: .4byte gBattleMons
-_0801457C: .4byte gUnknown_2023D6A
+_0801457C: .4byte gLastUsedAbility
_08014580: .4byte gBattleStruct
_08014584:
ldr r0, _080145A8 @ =gActiveBattler
@@ -9061,12 +9061,12 @@ _08014670:
movs r0, 0x6
strb r0, [r1]
ldrb r0, [r2]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x2
eors r0, r1
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
adds r0, r4
@@ -9587,7 +9587,7 @@ _08014ACA:
bne _08014AFE
adds r0, r5, 0
eors r0, r1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _08014B18 @ =gBattleStruct
ldr r1, [r1]
adds r1, 0x91
@@ -9762,7 +9762,7 @@ _08014C4E:
ldrb r1, [r0]
adds r1, 0x1
strb r1, [r0]
- ldr r0, _08014C98 @ =gUnknown_2023BCC
+ ldr r0, _08014C98 @ =gBattlersCount
lsls r1, 24
lsrs r1, 24
adds r2, r0, 0
@@ -9793,7 +9793,7 @@ _08014C88: .4byte gUnknown_2023BC8
_08014C8C: .4byte gBitTable
_08014C90: .4byte gActiveBattler
_08014C94: .4byte gUnknown_2023E82
-_08014C98: .4byte gUnknown_2023BCC
+_08014C98: .4byte gBattlersCount
_08014C9C: .4byte gUnknown_3004F84
_08014CA0: .4byte sub_80150A8
thumb_func_end sub_8014040
@@ -9851,7 +9851,7 @@ GetWhoStrikesFirst: @ 8014CD8
movs r1, 0
movs r2, 0xD
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
bne _08014DA0
@@ -9861,7 +9861,7 @@ GetWhoStrikesFirst: @ 8014CD8
movs r1, 0
movs r2, 0x4D
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
bne _08014DA0
@@ -9943,7 +9943,7 @@ _08014DA4:
adds r4, r0, r1
ldrh r0, [r4, 0x6]
muls r3, r0
- ldr r2, _08014DEC @ =gUnknown_825DEAD
+ ldr r2, _08014DEC @ =gStatStageRatios
movs r1, 0x1B
ldrsb r1, [r4, r1]
lsls r1, 1
@@ -9958,7 +9958,7 @@ _08014DA4:
ldrh r0, [r4, 0x2E]
cmp r0, 0xAF
bne _08014DF4
- ldr r1, _08014DF0 @ =gUnknown_2023F54
+ ldr r1, _08014DF0 @ =gEnigmaBerries
mov r3, r9
lsls r0, r3, 3
subs r0, r3
@@ -9969,8 +9969,8 @@ _08014DA4:
b _08014E08
.align 2, 0
_08014DE8: .4byte gBattleMons
-_08014DEC: .4byte gUnknown_825DEAD
-_08014DF0: .4byte gUnknown_2023F54
+_08014DEC: .4byte gStatStageRatios
+_08014DF0: .4byte gEnigmaBerries
_08014DF4:
ldrh r0, [r4, 0x2E]
bl ItemId_GetHoldEffect
@@ -9993,7 +9993,7 @@ _08014E08:
cmp r0, 0
beq _08014E3C
mov r0, r9
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08014E3C
@@ -10050,7 +10050,7 @@ _08014E80:
ldrh r0, [r4, 0x6]
adds r3, r0, 0
muls r3, r7
- ldr r2, _08014ED4 @ =gUnknown_825DEAD
+ ldr r2, _08014ED4 @ =gStatStageRatios
movs r1, 0x1B
ldrsb r1, [r4, r1]
lsls r1, 1
@@ -10065,7 +10065,7 @@ _08014E80:
ldrh r0, [r4, 0x2E]
cmp r0, 0xAF
bne _08014EDC
- ldr r1, _08014ED8 @ =gUnknown_2023F54
+ ldr r1, _08014ED8 @ =gEnigmaBerries
mov r3, r10
lsls r0, r3, 3
subs r0, r3
@@ -10079,8 +10079,8 @@ _08014EC4: .4byte gBattleTypeFlags
_08014EC8: .4byte 0x00000822
_08014ECC: .4byte gBattleMons
_08014ED0: .4byte gUnknown_2023E80
-_08014ED4: .4byte gUnknown_825DEAD
-_08014ED8: .4byte gUnknown_2023F54
+_08014ED4: .4byte gStatStageRatios
+_08014ED8: .4byte gEnigmaBerries
_08014EDC:
ldrh r0, [r4, 0x2E]
bl ItemId_GetHoldEffect
@@ -10103,7 +10103,7 @@ _08014EF0:
cmp r0, 0
beq _08014F20
mov r0, r10
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08014F20
@@ -10332,7 +10332,7 @@ sub_80150A8: @ 80150A8
beq _08015114
ldr r0, _08015100 @ =gActiveBattler
strb r3, [r0]
- ldr r4, _08015104 @ =gUnknown_2023BCC
+ ldr r4, _08015104 @ =gBattlersCount
mov r8, r0
ldrb r0, [r4]
cmp r3, r0
@@ -10365,7 +10365,7 @@ _080150D8:
.align 2, 0
_080150FC: .4byte gBattleTypeFlags
_08015100: .4byte gActiveBattler
-_08015104: .4byte gUnknown_2023BCC
+_08015104: .4byte gBattlersCount
_08015108: .4byte gUnknown_2023BDA
_0801510C: .4byte gUnknown_2023D7C
_08015110: .4byte gUnknown_2023BDE
@@ -10376,7 +10376,7 @@ _08015114:
beq _08015164
ldr r0, _08015158 @ =gActiveBattler
strb r3, [r0]
- ldr r1, _0801515C @ =gUnknown_2023BCC
+ ldr r1, _0801515C @ =gBattlersCount
mov r8, r0
adds r2, r1, 0
ldrb r2, [r2]
@@ -10394,7 +10394,7 @@ _08015136:
strb r0, [r7]
lsls r0, 24
lsrs r0, 24
- ldr r1, _0801515C @ =gUnknown_2023BCC
+ ldr r1, _0801515C @ =gBattlersCount
ldrb r1, [r1]
cmp r0, r1
bcs _08015174
@@ -10406,7 +10406,7 @@ _08015136:
b _08015172
.align 2, 0
_08015158: .4byte gActiveBattler
-_0801515C: .4byte gUnknown_2023BCC
+_0801515C: .4byte gBattlersCount
_08015160: .4byte gUnknown_2023D7C
_08015164:
ldr r0, _080151D8 @ =gUnknown_2023D7C
@@ -10440,14 +10440,14 @@ _08015174:
mov r12, r0
ldr r1, _080151F0 @ =gBattleStruct
mov r9, r1
- ldr r7, _080151F4 @ =gUnknown_2023BCC
+ ldr r7, _080151F4 @ =gBattlersCount
ldrb r7, [r7]
cmp r5, r7
bge _080151CC
adds r7, r6, 0
adds r6, r4, 0
adds r4, r2, 0
- ldr r2, _080151F4 @ =gUnknown_2023BCC
+ ldr r2, _080151F4 @ =gBattlersCount
_080151AE:
mov r0, r8
ldrb r0, [r0]
@@ -10480,12 +10480,12 @@ _080151E4: .4byte gUnknown_2023BDE
_080151E8: .4byte gUnknown_3004F84
_080151EC: .4byte CheckFocusPunch_ClearVarsBeforeTurnStarts
_080151F0: .4byte gBattleStruct
-_080151F4: .4byte gUnknown_2023BCC
+_080151F4: .4byte gBattlersCount
_080151F8:
movs r0, 0
mov r1, r8
strb r0, [r1]
- ldr r2, _08015288 @ =gUnknown_2023BCC
+ ldr r2, _08015288 @ =gBattlersCount
ldrb r0, [r2]
cmp r0, 0
beq _0801523E
@@ -10515,7 +10515,7 @@ _0801522C:
strb r0, [r2]
lsls r0, 24
lsrs r0, 24
- ldr r1, _08015288 @ =gUnknown_2023BCC
+ ldr r1, _08015288 @ =gBattlersCount
ldrb r1, [r1]
cmp r0, r1
bcc _0801520E
@@ -10523,7 +10523,7 @@ _0801523E:
movs r0, 0
mov r2, r8
strb r0, [r2]
- ldr r7, _08015288 @ =gUnknown_2023BCC
+ ldr r7, _08015288 @ =gBattlersCount
ldrb r0, [r7]
cmp r0, 0
beq _08015282
@@ -10552,7 +10552,7 @@ _08015270:
strb r0, [r2]
lsls r0, 24
lsrs r0, 24
- ldr r1, _08015288 @ =gUnknown_2023BCC
+ ldr r1, _08015288 @ =gBattlersCount
ldrb r1, [r1]
cmp r0, r1
bcc _08015252
@@ -10560,7 +10560,7 @@ _08015282:
movs r5, 0
b _080152F0
.align 2, 0
-_08015288: .4byte gUnknown_2023BCC
+_08015288: .4byte gBattlersCount
_0801528C: .4byte gUnknown_2023D7C
_08015290: .4byte gUnknown_2023BDA
_08015294: .4byte gUnknown_2023BDE
@@ -10604,14 +10604,14 @@ _080152A8:
bl SwapTurnOrder
_080152E4:
adds r4, 0x1
- ldr r0, _08015320 @ =gUnknown_2023BCC
+ ldr r0, _08015320 @ =gBattlersCount
ldrb r0, [r0]
cmp r4, r0
blt _080152A8
_080152EE:
adds r5, r7, 0
_080152F0:
- ldr r1, _08015320 @ =gUnknown_2023BCC
+ ldr r1, _08015320 @ =gBattlersCount
ldrb r0, [r1]
subs r0, 0x1
cmp r5, r0
@@ -10636,7 +10636,7 @@ _08015304:
.align 2, 0
_08015318: .4byte gUnknown_2023BDA
_0801531C: .4byte gUnknown_2023BDE
-_08015320: .4byte gUnknown_2023BCC
+_08015320: .4byte gBattlersCount
_08015324: .4byte gUnknown_3004F84
_08015328: .4byte CheckFocusPunch_ClearVarsBeforeTurnStarts
_0801532C: .4byte gBattleStruct
@@ -10655,7 +10655,7 @@ TurnValuesCleanUp: @ 8015330
ldr r1, _08015388 @ =gActiveBattler
movs r0, 0
strb r0, [r1]
- ldr r0, _0801538C @ =gUnknown_2023BCC
+ ldr r0, _0801538C @ =gBattlersCount
ldrb r2, [r0]
adds r5, r1, 0
cmp r2, 0
@@ -10690,7 +10690,7 @@ _0801535E:
b _080153F8
.align 2, 0
_08015388: .4byte gActiveBattler
-_0801538C: .4byte gUnknown_2023BCC
+_0801538C: .4byte gBattlersCount
_08015390: .4byte gUnknown_2023E8C
_08015394: .4byte gUnknown_2023C34
_08015398: .4byte gDisableStructs
@@ -10765,13 +10765,13 @@ _08015416:
strb r0, [r5]
lsls r0, 24
lsrs r0, 24
- ldr r1, _08015448 @ =gUnknown_2023BCC
+ ldr r1, _08015448 @ =gBattlersCount
ldrb r1, [r1]
cmp r0, r1
bcc _0801535E
_08015428:
movs r0, 0
- ldr r2, _0801544C @ =gUnknown_2023DE4
+ ldr r2, _0801544C @ =gSideTimers
strb r0, [r2, 0x8]
strb r0, [r2, 0x14]
pop {r3-r5}
@@ -10784,8 +10784,8 @@ _08015428:
.align 2, 0
_08015440: .4byte 0xffbfffff
_08015444: .4byte 0xfeffffff
-_08015448: .4byte gUnknown_2023BCC
-_0801544C: .4byte gUnknown_2023DE4
+_08015448: .4byte gBattlersCount
+_0801544C: .4byte gSideTimers
thumb_func_end TurnValuesCleanUp
thumb_func_start SpecialStatusesClear
@@ -10794,7 +10794,7 @@ SpecialStatusesClear: @ 8015450
ldr r2, _08015494 @ =gActiveBattler
movs r0, 0
strb r0, [r2]
- ldr r0, _08015498 @ =gUnknown_2023BCC
+ ldr r0, _08015498 @ =gBattlersCount
ldrb r1, [r0]
adds r6, r0, 0
cmp r1, 0
@@ -10829,7 +10829,7 @@ _0801548E:
bx r0
.align 2, 0
_08015494: .4byte gActiveBattler
-_08015498: .4byte gUnknown_2023BCC
+_08015498: .4byte gBattlersCount
_0801549C: .4byte gUnknown_2023ECC
thumb_func_end SpecialStatusesClear
@@ -10846,7 +10846,7 @@ CheckFocusPunch_ClearVarsBeforeTurnStarts: @ 80154A0
ldr r2, _0801552C @ =gBattleStruct
ldr r0, [r2]
adds r0, 0x48
- ldr r1, _08015530 @ =gUnknown_2023BCC
+ ldr r1, _08015530 @ =gBattlersCount
ldrb r0, [r0]
mov r12, r2
adds r6, r1, 0
@@ -10906,7 +10906,7 @@ _080154CC:
.align 2, 0
_08015528: .4byte gUnknown_2023DD0
_0801552C: .4byte gBattleStruct
-_08015530: .4byte gUnknown_2023BCC
+_08015530: .4byte gBattlersCount
_08015534: .4byte gActiveBattler
_08015538: .4byte sBattler_AI
_0801553C: .4byte gUnknown_2023DC4
@@ -10991,7 +10991,7 @@ _080155D8:
adds r0, r1
ldr r0, [r0]
bl _call_via_r0
- ldr r0, _08015630 @ =gUnknown_2023BCC
+ ldr r0, _08015630 @ =gBattlersCount
ldrb r1, [r4]
ldrb r0, [r0]
cmp r1, r0
@@ -11017,7 +11017,7 @@ _08015620: .4byte gUnknown_2023BE3
_08015624: .4byte gBattleStruct
_08015628: .4byte gUnknown_2023BE2
_0801562C: .4byte gUnknown_8250038
-_08015630: .4byte gUnknown_2023BCC
+_08015630: .4byte gBattlersCount
_08015634: .4byte gUnknown_2023DD0
_08015638: .4byte 0xffefffff
_0801563C: .4byte gUnknown_3004F84
@@ -11057,12 +11057,12 @@ sub_8015670: @ 8015670
ands r0, r1
cmp r0, 0
beq _080156C4
- ldr r1, _080156B0 @ =gUnknown_2022AB8
+ ldr r1, _080156B0 @ =gBattleTextBuff1
ldr r4, _080156B4 @ =gUnknown_2023E8A
ldrb r0, [r4]
strb r0, [r1]
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _080156B8 @ =sBattler_AI
strb r0, [r1]
ldr r1, _080156BC @ =gUnknown_2023D74
@@ -11076,7 +11076,7 @@ sub_8015670: @ 8015670
.align 2, 0
_080156A8: .4byte gUnknown_2023BE3
_080156AC: .4byte gBattleTypeFlags
-_080156B0: .4byte gUnknown_2022AB8
+_080156B0: .4byte gBattleTextBuff1
_080156B4: .4byte gUnknown_2023E8A
_080156B8: .4byte sBattler_AI
_080156BC: .4byte gUnknown_2023D74
@@ -11180,12 +11180,12 @@ sub_801578C: @ 801578C
ands r0, r4
cmp r0, 0
beq _080157E0
- ldr r1, _080157CC @ =gUnknown_2022AB8
+ ldr r1, _080157CC @ =gBattleTextBuff1
ldr r4, _080157D0 @ =gUnknown_2023E8A
ldrb r0, [r4]
strb r0, [r1]
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _080157D4 @ =sBattler_AI
strb r0, [r1]
ldr r1, _080157D8 @ =gUnknown_2023D74
@@ -11199,7 +11199,7 @@ sub_801578C: @ 801578C
.align 2, 0
_080157C4: .4byte gUnknown_2023BE3
_080157C8: .4byte gBattleTypeFlags
-_080157CC: .4byte gUnknown_2022AB8
+_080157CC: .4byte gBattleTextBuff1
_080157D0: .4byte gUnknown_2023E8A
_080157D4: .4byte sBattler_AI
_080157D8: .4byte gUnknown_2023D74
@@ -11230,7 +11230,7 @@ _0801580C:
strb r4, [r0, 0x5]
_08015810:
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _08015820 @ =sBattler_AI
strb r0, [r1]
b _0801582A
@@ -11316,7 +11316,7 @@ sub_80158BC: @ 80158BC
ldr r1, _080158F0 @ =gUnknown_2023BE3
movs r0, 0
strb r0, [r1]
- ldr r1, _080158F4 @ =gUnknown_2022AB8
+ ldr r1, _080158F4 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x7
@@ -11341,7 +11341,7 @@ sub_80158BC: @ 80158BC
bx lr
.align 2, 0
_080158F0: .4byte gUnknown_2023BE3
-_080158F4: .4byte gUnknown_2022AB8
+_080158F4: .4byte gBattleTextBuff1
_080158F8: .4byte sBattler_AI
_080158FC: .4byte gBattlerPartyIndexes
_08015900: .4byte gUnknown_2023D74
@@ -11368,7 +11368,7 @@ sub_8015910: @ 8015910
bne _080159BC
ldr r2, _08015980 @ =gActiveBattler
strb r1, [r2]
- ldr r0, _08015984 @ =gUnknown_2023BCC
+ ldr r0, _08015984 @ =gBattlersCount
ldrb r0, [r0]
cmp r1, r0
bcs _080159BC
@@ -11379,7 +11379,7 @@ sub_8015910: @ 8015910
adds r7, 0x30
_08015942:
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080159AA
@@ -11405,7 +11405,7 @@ _08015974: .4byte gUnknown_2023BE3
_08015978: .4byte gBattleTypeFlags
_0801597C: .4byte 0x00080b92
_08015980: .4byte gActiveBattler
-_08015984: .4byte gUnknown_2023BCC
+_08015984: .4byte gBattlersCount
_08015988: .4byte gBattleMons
_0801598C: .4byte gBattleResults
_08015990:
@@ -11425,7 +11425,7 @@ _080159AA:
ldrb r0, [r4]
adds r0, 0x1
strb r0, [r4]
- ldr r1, _080159EC @ =gUnknown_2023BCC
+ ldr r1, _080159EC @ =gBattlersCount
lsls r0, 24
lsrs r0, 24
ldrb r1, [r1]
@@ -11453,7 +11453,7 @@ _080159D0:
str r0, [r1]
b _08015A1E
.align 2, 0
-_080159EC: .4byte gUnknown_2023BCC
+_080159EC: .4byte gBattlersCount
_080159F0: .4byte gBattleTypeFlags
_080159F4: .4byte gUnknown_3004F84
_080159F8: .4byte sub_8015A30
@@ -11563,7 +11563,7 @@ _08015AAE:
adds r4, r1, r0
adds r0, r4, 0
movs r1, 0
- bl sub_8042EC4
+ bl GetEvolutionTargetSpecies
lsls r0, 16
lsrs r2, r0, 16
cmp r2, 0
@@ -12081,7 +12081,7 @@ _08015F10:
_08015F18:
ldr r0, _08015F38 @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08015F40
@@ -12103,12 +12103,12 @@ _08015F40:
_08015F48:
ldr r4, _08015FB4 @ =sBattler_AI
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
movs r1, 0x1
eors r0, r1
lsls r0, 24
lsrs r6, r0, 24
- ldr r1, _08015FB8 @ =gUnknown_2023DE4
+ ldr r1, _08015FB8 @ =gSideTimers
lsls r0, r6, 1
adds r0, r6
lsls r0, 2
@@ -12128,10 +12128,10 @@ _08015F48:
cmp r0, 0
bne _08015FC8
ldrb r0, [r3]
- bl GetBankSide
+ bl GetBattlerSide
adds r4, r0, 0
ldrb r0, [r5, 0x9]
- bl GetBankSide
+ bl GetBattlerSide
lsls r4, 24
lsls r0, 24
cmp r4, r0
@@ -12151,7 +12151,7 @@ _08015F48:
_08015FAC: .4byte gBattleResults
_08015FB0: .4byte gCurrentMove
_08015FB4: .4byte sBattler_AI
-_08015FB8: .4byte gUnknown_2023DE4
+_08015FB8: .4byte gSideTimers
_08015FBC: .4byte gBattleMoves
_08015FC0: .4byte gBattleMons
_08015FC4: .4byte gBattlerTarget
@@ -12166,7 +12166,7 @@ _08015FC8:
bne _08015FDA
b _080162A0
_08015FDA:
- ldr r1, _080160EC @ =gUnknown_2023DE4
+ ldr r1, _080160EC @ =gSideTimers
lsls r0, r6, 1
adds r0, r6
lsls r0, 2
@@ -12214,19 +12214,19 @@ _08016028:
b _080161F8
_08016030:
adds r0, r6, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r6, r0, 24
ldr r1, _08016100 @ =gActiveBattler
strb r5, [r1]
- ldr r0, _08016104 @ =gUnknown_2023BCC
+ ldr r0, _08016104 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
bcs _080160A8
adds r4, r1, 0
_08016048:
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r6, r0
@@ -12265,7 +12265,7 @@ _08016096:
ldrb r0, [r4]
adds r0, 0x1
strb r0, [r4]
- ldr r1, _08016104 @ =gUnknown_2023BCC
+ ldr r1, _08016104 @ =gBattlersCount
lsls r0, 24
lsrs r0, 24
ldrb r1, [r1]
@@ -12290,7 +12290,7 @@ _080160B0:
beq _08016130
ldr r0, _080160E8 @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08016110
@@ -12304,13 +12304,13 @@ _080160B0:
.align 2, 0
_080160E4: .4byte gBattleTypeFlags
_080160E8: .4byte sBattler_AI
-_080160EC: .4byte gUnknown_2023DE4
+_080160EC: .4byte gSideTimers
_080160F0: .4byte gBattleMoves
_080160F4: .4byte gCurrentMove
_080160F8: .4byte gBattleMons
_080160FC: .4byte gBattleStruct
_08016100: .4byte gActiveBattler
-_08016104: .4byte gUnknown_2023BCC
+_08016104: .4byte gBattlersCount
_08016108: .4byte gUnknown_2023D4C
_0801610C:
movs r0, 0x3
@@ -12326,7 +12326,7 @@ _08016110:
_08016120:
movs r0, 0x2
_08016122:
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _0801612C @ =gBattlerTarget
strb r0, [r1]
b _08016140
@@ -12358,10 +12358,10 @@ _08016140:
_0801615A:
ldr r6, _0801617C @ =sBattler_AI
ldrb r0, [r6]
- bl GetBankSide
+ bl GetBattlerSide
adds r4, r0, 0
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r4, 24
lsls r0, 24
cmp r4, r0
@@ -12376,12 +12376,12 @@ _08016184: .4byte gAbsentBattlerFlags
_08016188: .4byte gBitTable
_0801618C:
ldrb r0, [r6]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x1
eors r0, r1
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
strb r0, [r5]
ldrb r1, [r7]
ldrb r2, [r5]
@@ -12442,7 +12442,7 @@ _080161F8:
cmp r0, 0
beq _080162A0
ldrb r0, [r3]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08016244
@@ -12470,7 +12470,7 @@ _08016244:
_08016254:
movs r0, 0x2
_08016256:
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _08016290 @ =gBattlerTarget
strb r0, [r1]
ldr r0, _08016294 @ =gAbsentBattlerFlags
@@ -12486,10 +12486,10 @@ _08016256:
beq _0801632C
ldr r0, _0801629C @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
adds r4, r0, 0
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r4, 24
lsls r0, 24
cmp r4, r0
@@ -12522,10 +12522,10 @@ _080162A0:
beq _0801632C
ldrb r0, [r2]
str r3, [sp, 0x4]
- bl GetBankSide
+ bl GetBattlerSide
adds r4, r0, 0
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r4, 24
lsls r0, 24
ldr r3, [sp, 0x4]
@@ -12540,12 +12540,12 @@ _080162EC: .4byte gAbsentBattlerFlags
_080162F0: .4byte gBitTable
_080162F4:
ldrb r0, [r3]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x1
eors r0, r1
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
strb r0, [r5]
ldrb r1, [r6]
ldrb r2, [r5]
@@ -12558,12 +12558,12 @@ _08016310:
beq _0801632C
adds r0, r2, 0
_0801631A:
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x2
eors r0, r1
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
strb r0, [r5]
_0801632C:
ldr r4, _08016360 @ =gUnknown_2023D74
@@ -12623,7 +12623,7 @@ sub_8016374: @ 8016374
ldrb r0, [r3]
adds r0, r1
strb r2, [r0]
- ldr r2, _080163FC @ =gUnknown_2022AB8
+ ldr r2, _080163FC @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r2]
movs r0, 0x7
@@ -12665,7 +12665,7 @@ _080163EC: .4byte gUnknown_2022974
_080163F0: .4byte gUnknown_2022976
_080163F4: .4byte gUnknown_2023FF8
_080163F8: .4byte gUnknown_2023FFC
-_080163FC: .4byte gUnknown_2022AB8
+_080163FC: .4byte gBattleTextBuff1
_08016400: .4byte gBattleStruct
_08016404: .4byte gBattleScripting
_08016408: .4byte gUnknown_2023D74
@@ -12768,7 +12768,7 @@ _080164E0: .4byte gUnknown_81D99FC
_080164E4: .4byte gUnknown_2023BE3
_080164E8:
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08016510
@@ -12933,7 +12933,7 @@ _08016644: .4byte gUnknown_2023D74
_08016648: .4byte gUnknown_81D99E4
_0801664C: .4byte gUnknown_2023BE3
_08016650:
- ldr r3, _080166C4 @ =gUnknown_2022AB8
+ ldr r3, _080166C4 @ =gBattleTextBuff1
movs r4, 0xFD
strb r4, [r3]
movs r0, 0x5
@@ -12942,7 +12942,7 @@ _08016650:
strb r2, [r3, 0x2]
movs r0, 0xFF
strb r0, [r3, 0x3]
- ldr r1, _080166C8 @ =gUnknown_2022AC8
+ ldr r1, _080166C8 @ =gBattleTextBuff2
strb r4, [r1]
strb r5, [r1, 0x1]
movs r0, 0xD2
@@ -12993,8 +12993,8 @@ _080166B4:
strb r1, [r2, 0x11]
b _08016706
.align 2, 0
-_080166C4: .4byte gUnknown_2022AB8
-_080166C8: .4byte gUnknown_2022AC8
+_080166C4: .4byte gBattleTextBuff1
+_080166C8: .4byte gBattleTextBuff2
_080166CC: .4byte gUnknown_2023D74
_080166D0: .4byte gUnknown_81D99E4
_080166D4: .4byte gUnknown_2023BE3
@@ -13068,7 +13068,7 @@ sub_8016748: @ 8016748
ldrh r0, [r1, 0x2E]
cmp r0, 0xAF
bne _08016774
- ldr r1, _08016770 @ =gUnknown_2023F54
+ ldr r1, _08016770 @ =gEnigmaBerries
lsls r0, r4, 3
subs r0, r4
lsls r0, 2
@@ -13077,14 +13077,14 @@ sub_8016748: @ 8016748
b _0801677E
.align 2, 0
_0801676C: .4byte gBattleMons
-_08016770: .4byte gUnknown_2023F54
+_08016770: .4byte gEnigmaBerries
_08016774:
ldrh r0, [r1, 0x2E]
bl ItemId_GetHoldEffect
lsls r0, 24
lsrs r1, r0, 24
_0801677E:
- ldr r0, _080167AC @ =gUnknown_2023D6F
+ ldr r0, _080167AC @ =gPotentialItemEffectBattler
strb r4, [r0]
cmp r1, 0x25
bne _080167BC
@@ -13107,7 +13107,7 @@ _0801677E:
strb r0, [r2, 0x1]
b _08016816
.align 2, 0
-_080167AC: .4byte gUnknown_2023D6F
+_080167AC: .4byte gPotentialItemEffectBattler
_080167B0: .4byte gUnknown_2023D68
_080167B4: .4byte gBattleMons
_080167B8: .4byte gUnknown_2023E8C
@@ -13122,7 +13122,7 @@ _080167BC:
ldrb r1, [r0]
cmp r1, 0x32
bne _080167F8
- ldr r0, _080167F0 @ =gUnknown_2023D6A
+ ldr r0, _080167F0 @ =gLastUsedAbility
strb r1, [r0]
ldr r0, _080167F4 @ =gUnknown_2023E8C
lsls r2, r4, 4
@@ -13137,7 +13137,7 @@ _080167BC:
b _08016816
.align 2, 0
_080167EC: .4byte gBattleMons
-_080167F0: .4byte gUnknown_2023D6A
+_080167F0: .4byte gLastUsedAbility
_080167F4: .4byte gUnknown_2023E8C
_080167F8:
ldr r0, _08016820 @ =gBattleTypeFlags
@@ -13150,7 +13150,7 @@ _080167F8:
cmp r0, r1
bne _08016824
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _0801687A
@@ -13209,7 +13209,7 @@ _0801687A:
cmp r6, 0
beq _0801688C
ldr r1, _08016898 @ =gUnknown_2023BE2
- ldr r0, _0801689C @ =gUnknown_2023BCC
+ ldr r0, _0801689C @ =gBattlersCount
ldrb r0, [r0]
strb r0, [r1]
ldr r1, _080168A0 @ =gUnknown_2023E8A
@@ -13223,7 +13223,7 @@ _0801688C:
.align 2, 0
_08016894: .4byte gBattleStruct
_08016898: .4byte gUnknown_2023BE2
-_0801689C: .4byte gUnknown_2023BCC
+_0801689C: .4byte gBattlersCount
_080168A0: .4byte gUnknown_2023E8A
thumb_func_end sub_8016748
@@ -13243,7 +13243,7 @@ sub_80168A4: @ 80168A4
ands r0, r1
cmp r0, 0
beq _0801694C
- ldr r0, _08016904 @ =gUnknown_2023BCC
+ ldr r0, _08016904 @ =gBattlersCount
ldrb r1, [r0]
strb r1, [r5]
ldr r2, _08016908 @ =gActiveBattler
@@ -13257,7 +13257,7 @@ sub_80168A4: @ 80168A4
ldr r5, _08016910 @ =gUnknown_2023E8A
_080168D8:
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08016914
@@ -13274,7 +13274,7 @@ _080168F4: .4byte sBattler_AI
_080168F8: .4byte gUnknown_2023BDE
_080168FC: .4byte gUnknown_2023BE2
_08016900: .4byte gBattleTypeFlags
-_08016904: .4byte gUnknown_2023BCC
+_08016904: .4byte gBattlersCount
_08016908: .4byte gActiveBattler
_0801690C: .4byte gUnknown_2023D7C
_08016910: .4byte gUnknown_2023E8A
@@ -13293,7 +13293,7 @@ _08016926:
ldrb r0, [r4]
adds r0, 0x1
strb r0, [r4]
- ldr r1, _08016944 @ =gUnknown_2023BCC
+ ldr r1, _08016944 @ =gBattlersCount
lsls r0, 24
lsrs r0, 24
ldrb r1, [r1]
@@ -13307,11 +13307,11 @@ _08016938:
strb r1, [r0]
b _080169D8
.align 2, 0
-_08016944: .4byte gUnknown_2023BCC
+_08016944: .4byte gBattlersCount
_08016948: .4byte gUnknown_2023E8A
_0801694C:
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _0801698C
@@ -13365,7 +13365,7 @@ _080169C0: .4byte gUnknown_2023D74
_080169C4: .4byte gUnknown_81D893A
_080169C8: .4byte gUnknown_2023BE3
_080169CC:
- ldr r0, _080169E0 @ =gUnknown_2023BCC
+ ldr r0, _080169E0 @ =gBattlersCount
ldrb r0, [r0]
strb r0, [r5]
ldr r1, _080169E4 @ =gUnknown_2023E8A
@@ -13377,7 +13377,7 @@ _080169D8:
pop {r0}
bx r0
.align 2, 0
-_080169E0: .4byte gUnknown_2023BCC
+_080169E0: .4byte gBattlersCount
_080169E4: .4byte gUnknown_2023E8A
thumb_func_end sub_80168A4
@@ -13687,7 +13687,7 @@ HandleAction_SafriZoneRun: @ 8016C60
strb r0, [r2]
movs r0, 0x11
bl PlaySE
- ldr r0, _08016C94 @ =gUnknown_2023BCC
+ ldr r0, _08016C94 @ =gBattlersCount
ldrb r0, [r0]
strb r0, [r4]
ldr r1, _08016C98 @ =gUnknown_2023E8A
@@ -13700,7 +13700,7 @@ HandleAction_SafriZoneRun: @ 8016C60
_08016C88: .4byte sBattler_AI
_08016C8C: .4byte gUnknown_2023BDE
_08016C90: .4byte gUnknown_2023BE2
-_08016C94: .4byte gUnknown_2023BCC
+_08016C94: .4byte gBattlersCount
_08016C98: .4byte gUnknown_2023E8A
thumb_func_end HandleAction_SafriZoneRun
@@ -13718,7 +13718,7 @@ HandleAction_Action9: @ 8016C9C
strh r1, [r0]
ldr r0, _08016CF8 @ =gUnknown_2022976
strh r1, [r0]
- ldr r1, _08016CFC @ =gUnknown_2022AB8
+ ldr r1, _08016CFC @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x7
@@ -13749,7 +13749,7 @@ _08016CEC: .4byte gUnknown_2023BDE
_08016CF0: .4byte gUnknown_2023BE2
_08016CF4: .4byte gUnknown_2022974
_08016CF8: .4byte gUnknown_2022976
-_08016CFC: .4byte gUnknown_2022AB8
+_08016CFC: .4byte gBattleTextBuff1
_08016D00: .4byte gBattlerPartyIndexes
_08016D04: .4byte gUnknown_2023D74
_08016D08: .4byte gUnknown_81D9A04
diff --git a/asm/battle_ai_switch_items.s b/asm/battle_ai_switch_items.s
index f38d58172..bdc1283db 100644
--- a/asm/battle_ai_switch_items.s
+++ b/asm/battle_ai_switch_items.s
@@ -28,7 +28,7 @@ ShouldSwitchIfPerishSong: @ 8039188
cmp r0, 0
bne _080391E4
adds r0, r2, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 25
ldr r1, _080391E0 @ =gBattleStruct
@@ -73,7 +73,7 @@ _08039204: .4byte gBattleTypeFlags
_08039208:
ldr r0, _0803922C @ =gActiveBattler
ldrb r0, [r0]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 25
ldr r1, _08039230 @ =gBattleStruct
@@ -93,7 +93,7 @@ _08039230: .4byte gBattleStruct
_08039234:
ldr r4, _0803936C @ =gBattleMons
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
movs r1, 0x58
@@ -106,7 +106,7 @@ _08039234:
b _0803935C
_08039250:
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r2, r0, 24
movs r6, 0
@@ -185,7 +185,7 @@ _080392A4:
movs r1, 0x2E
bl GetMonData
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r2, r0, 24
movs r4, 0
@@ -305,12 +305,12 @@ _080393D6:
beq _08039442
mov r8, r3
mov r0, r8
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r4, 0x2
eors r0, r4
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _08039424 @ =gAbsentBattlerFlags
ldrb r1, [r1]
ldr r2, _08039428 @ =gBitTable
@@ -333,11 +333,11 @@ _08039424: .4byte gAbsentBattlerFlags
_08039428: .4byte gBitTable
_0803942C:
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
eors r0, r4
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r7, r0, 24
b _08039446
@@ -396,7 +396,7 @@ _0803949C: .4byte gBattleMons
_080394A0:
ldr r0, _080394C4 @ =gActiveBattler
ldrb r0, [r0]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 25
ldr r1, _080394C8 @ =gBattleStruct
@@ -616,7 +616,7 @@ _08039664:
ldr r0, _08039690 @ =gActiveBattler
ldrb r0, [r0]
_08039668:
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 25
ldr r1, _08039694 @ =gBattleStruct
@@ -650,7 +650,7 @@ ai_has_super_effective_move_on_field: @ 8039698
lsrs r0, 24
mov r8, r0
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r3, r0, 24
ldr r0, _08039730 @ =gAbsentBattlerFlags
@@ -727,7 +727,7 @@ _08039744:
b _080397C4
_08039748:
movs r0, 0x2
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r3, r0, 24
ldr r0, _080397D0 @ =gAbsentBattlerFlags
@@ -898,12 +898,12 @@ _0803987A:
beq _08039918
mov r9, r3
mov r0, r9
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r4, 0x2
eors r0, r4
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _080398CC @ =gAbsentBattlerFlags
ldrb r1, [r1]
ldr r2, _080398D0 @ =gBitTable
@@ -928,11 +928,11 @@ _080398CC: .4byte gAbsentBattlerFlags
_080398D0: .4byte gBitTable
_080398D4:
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
eors r0, r4
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
mov r10, r0
@@ -940,7 +940,7 @@ _080398D4:
_080398EC:
ldr r0, _08039910 @ =gActiveBattler
ldrb r0, [r0]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 25
ldr r1, _08039914 @ =gBattleStruct
@@ -1170,7 +1170,7 @@ _08039ABA:
adds r1, r2, 0
movs r2, 0x17
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r0, 24
cmp r0, 0
@@ -1182,7 +1182,7 @@ _08039AD2:
movs r0, 0xC
movs r2, 0x47
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r0, 24
cmp r0, 0
@@ -1194,7 +1194,7 @@ _08039AEA:
movs r1, 0
movs r2, 0x2A
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
beq _08039B1C
@@ -1226,12 +1226,12 @@ _08039B1C:
ldr r4, _08039B60 @ =gActiveBattler
ldrb r7, [r4]
adds r0, r7, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r5, 0x2
eors r0, r5
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _08039B70 @ =gAbsentBattlerFlags
ldrb r1, [r1]
ldr r2, _08039B74 @ =gBitTable
@@ -1254,11 +1254,11 @@ _08039B70: .4byte gAbsentBattlerFlags
_08039B74: .4byte gBitTable
_08039B78:
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
eors r0, r5
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r6, r0, 24
b _08039B94
@@ -1396,7 +1396,7 @@ _08039C94:
beq _08039D8C
ldr r0, _08039CE0 @ =gActiveBattler
ldrb r0, [r0]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 25
ldr r1, _08039CE4 @ =gBattleStruct
@@ -1417,7 +1417,7 @@ _08039C94:
cmp r0, 0
bne _08039CE8
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r5, r0, 24
adds r6, r5, 0
@@ -1428,11 +1428,11 @@ _08039CE0: .4byte gActiveBattler
_08039CE4: .4byte gBattleStruct
_08039CE8:
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r6, r0, 24
movs r0, 0x3
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r5, r0, 24
_08039CFC:
@@ -1476,7 +1476,7 @@ _08039D3E:
_08039D44:
ldr r0, _08039D88 @ =gActiveBattler
ldrb r0, [r0]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 25
ldr r1, _08039D84 @ =gBattleStruct
@@ -1487,7 +1487,7 @@ _08039D44:
_08039D5A:
ldr r4, _08039D88 @ =gActiveBattler
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
ldrb r2, [r4]
ldr r1, _08039D84 @ =gBattleStruct
ldr r1, [r1]
@@ -1628,12 +1628,12 @@ _08039E5E:
beq _08039EF8
str r2, [sp, 0xC]
adds r0, r2, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r5, 0x2
eors r0, r5
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _08039EA4 @ =gAbsentBattlerFlags
ldrb r1, [r1]
ldr r2, _08039EA8 @ =gBitTable
@@ -1655,11 +1655,11 @@ _08039EA4: .4byte gAbsentBattlerFlags
_08039EA8: .4byte gBitTable
_08039EAC:
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
eors r0, r5
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
str r0, [sp, 0x10]
@@ -1690,7 +1690,7 @@ _08039EF0: .4byte gAbsentBattlerFlags
_08039EF4: .4byte gBitTable
_08039EF8:
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
mov r10, r0
@@ -2151,7 +2151,7 @@ _0803A26E:
bne _0803A286
b _0803A644
_0803A286:
- ldr r1, _0803A2B0 @ =gUnknown_82528BC
+ ldr r1, _0803A2B0 @ =gItemEffectTable
subs r0, 0xD
lsls r0, 2
adds r0, r1
@@ -2171,7 +2171,7 @@ _0803A296:
.align 2, 0
_0803A2A8: .4byte gEnemyParty
_0803A2AC: .4byte gBattleResources
-_0803A2B0: .4byte gUnknown_82528BC
+_0803A2B0: .4byte gItemEffectTable
_0803A2B4: .4byte gSaveBlock1Ptr
_0803A2B8: .4byte 0x00003108
_0803A2BC:
@@ -2576,7 +2576,7 @@ _0803A5C4: .4byte gDisableStructs
_0803A5C8:
ldr r4, _0803A630 @ =gActiveBattler
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r3, r0, 24
ldr r2, _0803A634 @ =gDisableStructs
@@ -2588,7 +2588,7 @@ _0803A5C8:
ldrb r0, [r0, 0x16]
cmp r0, 0
beq _0803A5F8
- ldr r0, _0803A638 @ =gUnknown_2023DE4
+ ldr r0, _0803A638 @ =gSideTimers
lsls r1, r3, 1
adds r1, r3
lsls r1, 2
@@ -2628,7 +2628,7 @@ _0803A5FC:
.align 2, 0
_0803A630: .4byte gActiveBattler
_0803A634: .4byte gDisableStructs
-_0803A638: .4byte gUnknown_2023DE4
+_0803A638: .4byte gSideTimers
_0803A63C: .4byte gBattleStruct
_0803A640: .4byte gBattleResources
_0803A644:
diff --git a/asm/battle_anim.s b/asm/battle_anim.s
index c258fa7b1..7f9d4d26e 100644
--- a/asm/battle_anim.s
+++ b/asm/battle_anim.s
@@ -156,7 +156,7 @@ sub_80725D4: @ 80725D4
_08072600:
lsls r0, r4, 24
lsrs r0, 24
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08072624
@@ -994,7 +994,7 @@ _08072C62:
cmp r0, 0
beq _08072D12
adds r0, r5, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
movs r1, 0xFF
lsls r1, 24
@@ -1078,7 +1078,7 @@ _08072D12:
cmp r0, 0
beq _08072DCE
adds r0, r5, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
movs r1, 0xFF
lsls r1, 24
@@ -1325,7 +1325,7 @@ _08072E5E:
adds r0, r4, 0
bl CpuSet
adds r0, r7, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
@@ -1451,7 +1451,7 @@ _08072F84:
adds r0, r4, 0
bl CpuSet
adds r0, r7, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
@@ -1817,7 +1817,7 @@ sub_807331C: @ 807331C
cmp r0, 0x1
beq _0807338E
ldrb r0, [r4, 0xC]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
movs r1, 0xFF
lsls r1, 24
@@ -1902,7 +1902,7 @@ _080733CE:
cmp r0, 0
beq _08073416
adds r0, r4, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
movs r1, 0xFF
lsls r1, 24
@@ -1940,7 +1940,7 @@ _08073416:
cmp r0, 0
beq _08073464
adds r0, r4, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
movs r1, 0xFF
lsls r1, 24
@@ -2115,7 +2115,7 @@ sub_8073558: @ 8073558
ldrb r4, [r5, 0xC]
adds r6, r4, 0
adds r0, r4, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
movs r1, 0xFF
lsls r1, 24
@@ -2471,7 +2471,7 @@ sub_80737E4: @ 80737E4
lsrs r4, r0, 24
ldr r0, _08073828 @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08073830
@@ -2787,7 +2787,7 @@ sub_8073A44: @ 8073A44
cmp r0, 0
beq _08073A80
adds r0, r2, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
movs r4, 0xC0
cmp r0, 0
@@ -2799,13 +2799,13 @@ _08073A78: .4byte gUnknown_2024018
_08073A7C: .4byte gUnknown_2037F1A
_08073A80:
adds r0, r2, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08073ABA
ldr r0, _08073AA8 @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08073AE6
@@ -2828,7 +2828,7 @@ _08073AAC:
_08073ABA:
ldr r0, _08073ADC @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -2889,7 +2889,7 @@ sub_8073B08: @ 8073B08
cmp r0, 0
beq _08073B44
adds r0, r2, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
movs r4, 0xC0
cmp r0, 0
@@ -2901,7 +2901,7 @@ _08073B3C: .4byte gUnknown_2024018
_08073B40: .4byte gUnknown_2037F1A
_08073B44:
adds r0, r2, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08073B56
@@ -3771,7 +3771,7 @@ _080741E4:
ldr r0, _08074210 @ =gUnknown_2037F1A
_080741E6:
ldrb r0, [r0]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0
@@ -3825,11 +3825,11 @@ sub_807423C: @ 807423C
str r0, [r1]
ldr r7, _08074270 @ =gUnknown_2037F1A
ldrb r0, [r7]
- bl GetBankSide
+ bl GetBattlerSide
adds r4, r0, 0
ldr r5, _08074274 @ =gUnknown_2037F1B
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r4, 24
lsls r0, 24
cmp r4, r0
@@ -3845,7 +3845,7 @@ _08074274: .4byte gUnknown_2037F1B
_08074278:
ldrb r0, [r7]
_0807427A:
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0
@@ -3948,11 +3948,11 @@ sub_8074320: @ 8074320
beq _080743C2
ldr r6, _08074368 @ =gUnknown_2037F1A
ldrb r0, [r6]
- bl GetBankSide
+ bl GetBattlerSide
adds r4, r0, 0
ldr r5, _0807436C @ =gUnknown_2037F1B
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r4, 24
lsls r0, 24
cmp r4, r0
@@ -4030,11 +4030,11 @@ sub_80743C8: @ 80743C8
beq _0807444C
ldr r6, _08074410 @ =gUnknown_2037F1A
ldrb r0, [r6]
- bl GetBankSide
+ bl GetBattlerSide
adds r4, r0, 0
ldr r5, _08074414 @ =gUnknown_2037F1B
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r4, 24
lsls r0, 24
cmp r4, r0
diff --git a/asm/battle_anim_8074480.s b/asm/battle_anim_8074480.s
index 5e4dfecb0..1881e7a8f 100644
--- a/asm/battle_anim_8074480.s
+++ b/asm/battle_anim_8074480.s
@@ -31,7 +31,7 @@ _0807449C:
_080744B0:
ldr r4, _080744D0 @ =gUnknown_83AE01C
adds r0, r5, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 22
ldr r1, _080744D4 @ =gBattleTypeFlags
@@ -49,7 +49,7 @@ _080744D4: .4byte gBattleTypeFlags
_080744D8:
ldr r4, _080744F8 @ =gUnknown_83AE01C
adds r0, r5, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 22
ldr r1, _080744FC @ =gBattleTypeFlags
@@ -66,7 +66,7 @@ _080744F8: .4byte gUnknown_83AE01C
_080744FC: .4byte gBattleTypeFlags
_08074500:
adds r0, r5, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08074538
@@ -148,7 +148,7 @@ sub_8074590: @ 8074590
lsrs r4, r1, 16
adds r7, r4, 0
adds r0, r5, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08074674
@@ -227,7 +227,7 @@ _08074638:
cmp r4, r0
bne _08074658
ldr r0, _08074650 @ =gUnknown_83AE050
- ldr r1, _08074654 @ =gUnknown_2024024
+ ldr r1, _08074654 @ =gBattleMonForms
adds r1, r5, r1
ldrb r1, [r1]
adds r1, r0
@@ -236,7 +236,7 @@ _08074638:
.align 2, 0
_0807464C: .4byte 0x00000181
_08074650: .4byte gUnknown_83AE050
-_08074654: .4byte gUnknown_2024024
+_08074654: .4byte gBattleMonForms
_08074658:
movs r0, 0xCE
lsls r0, 1
@@ -328,7 +328,7 @@ _08074704:
cmp r4, r0
bne _08074728
ldr r0, _08074720 @ =gUnknown_83AE03C
- ldr r1, _08074724 @ =gUnknown_2024024
+ ldr r1, _08074724 @ =gBattleMonForms
adds r1, r6, r1
ldrb r1, [r1]
lsls r1, 2
@@ -338,7 +338,7 @@ _08074704:
.align 2, 0
_0807471C: .4byte 0x00000181
_08074720: .4byte gUnknown_83AE03C
-_08074724: .4byte gUnknown_2024024
+_08074724: .4byte gBattleMonForms
_08074728:
movs r0, 0xCE
lsls r0, 1
@@ -373,7 +373,7 @@ sub_807474C: @ 807474C
adds r7, r4, 0
movs r5, 0
adds r0, r6, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -382,7 +382,7 @@ sub_807474C: @ 807474C
cmp r4, r0
bne _08074788
ldr r0, _08074780 @ =gUnknown_83AE04C
- ldr r1, _08074784 @ =gUnknown_2024024
+ ldr r1, _08074784 @ =gBattleMonForms
adds r1, r6, r1
ldrb r1, [r1]
adds r1, r0
@@ -391,7 +391,7 @@ sub_807474C: @ 807474C
.align 2, 0
_0807477C: .4byte 0x00000181
_08074780: .4byte gUnknown_83AE04C
-_08074784: .4byte gUnknown_2024024
+_08074784: .4byte gBattleMonForms
_08074788:
movs r0, 0xCE
lsls r0, 1
@@ -425,7 +425,7 @@ sub_80747AC: @ 80747AC
lsls r2, 24
lsrs r7, r2, 24
adds r0, r6, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080747D4
@@ -451,7 +451,7 @@ _080747D4:
lsrs r5, r0, 16
_080747F2:
adds r0, r6, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
ldr r3, _0807483C @ =gUnknown_83AE01C
lsls r0, 24
lsrs r0, 22
@@ -469,7 +469,7 @@ _080747F2:
cmp r7, 0
beq _08074832
adds r0, r6, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _0807482C
@@ -564,7 +564,7 @@ GetSubstituteSpriteDefault_Y: @ 80748BC
lsls r0, 24
lsrs r4, r0, 24
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080748E0
@@ -600,7 +600,7 @@ sub_8074900: @ 8074900
lsls r0, 24
lsrs r4, r0, 24
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -631,7 +631,7 @@ sub_807492C: @ 807492C
lsls r0, 24
lsrs r6, r0, 24
adds r0, r5, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08074978
@@ -686,7 +686,7 @@ _080749B0:
ldrh r4, [r1, 0x2]
_080749B2:
adds r0, r5, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080749CC
@@ -1605,7 +1605,7 @@ _08075030: .4byte gUnknown_2037F1A
_08075034: .4byte gUnknown_2037F1B
_08075038:
ldrb r0, [r7]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08075050
@@ -1820,8 +1820,8 @@ _080751BC: .4byte gUnknown_2037F1A
_080751C0: .4byte gUnknown_2037F02
thumb_func_end sub_8075160
- thumb_func_start GetBankSide
-GetBankSide: @ 80751C4
+ thumb_func_start GetBattlerSide
+GetBattlerSide: @ 80751C4
lsls r0, 24
lsrs r0, 24
ldr r1, _080751D4 @ =gUnknown_2023BD6
@@ -1832,10 +1832,10 @@ GetBankSide: @ 80751C4
bx lr
.align 2, 0
_080751D4: .4byte gUnknown_2023BD6
- thumb_func_end GetBankSide
+ thumb_func_end GetBattlerSide
- thumb_func_start GetBankIdentity
-GetBankIdentity: @ 80751D8
+ thumb_func_start GetBattlerPosition
+GetBattlerPosition: @ 80751D8
lsls r0, 24
lsrs r0, 24
ldr r1, _080751E4 @ =gUnknown_2023BD6
@@ -1844,15 +1844,15 @@ GetBankIdentity: @ 80751D8
bx lr
.align 2, 0
_080751E4: .4byte gUnknown_2023BD6
- thumb_func_end GetBankIdentity
+ thumb_func_end GetBattlerPosition
- thumb_func_start GetBankByIdentity
-GetBankByIdentity: @ 80751E8
+ thumb_func_start GetBattlerAtPosition
+GetBattlerAtPosition: @ 80751E8
push {r4,lr}
lsls r0, 24
lsrs r3, r0, 24
movs r1, 0
- ldr r0, _0807521C @ =gUnknown_2023BCC
+ ldr r0, _0807521C @ =gBattlersCount
ldrb r2, [r0]
cmp r1, r2
bcs _08075212
@@ -1876,9 +1876,9 @@ _08075212:
pop {r1}
bx r1
.align 2, 0
-_0807521C: .4byte gUnknown_2023BCC
+_0807521C: .4byte gBattlersCount
_08075220: .4byte gUnknown_2023BD6
- thumb_func_end GetBankByIdentity
+ thumb_func_end GetBattlerAtPosition
thumb_func_start sub_8075224
sub_8075224: @ 8075224
@@ -1892,7 +1892,7 @@ sub_8075224: @ 8075224
cmp r0, 0xFF
beq _08075288
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08075260
@@ -3346,7 +3346,7 @@ sub_8075CB8: @ 8075CB8
cmp r0, 0
beq _08075CF2
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
bl sub_8072DF0
@@ -3354,7 +3354,7 @@ sub_8075CB8: @ 8075CB8
cmp r0, 0
beq _08075CF2
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
adds r0, 0x10
@@ -3364,7 +3364,7 @@ _08075CF2:
cmp r5, 0
beq _08075D1E
movs r0, 0x2
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
bl sub_8072DF0
@@ -3372,7 +3372,7 @@ _08075CF2:
cmp r0, 0
beq _08075D1E
movs r0, 0x2
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
adds r1, r0, 0
@@ -3384,7 +3384,7 @@ _08075D1E:
cmp r6, 0
beq _08075D4A
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
bl sub_8072DF0
@@ -3392,7 +3392,7 @@ _08075D1E:
cmp r0, 0
beq _08075D4A
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
adds r1, r0, 0
@@ -3404,7 +3404,7 @@ _08075D4A:
cmp r7, 0
beq _08075D76
movs r0, 0x3
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
bl sub_8072DF0
@@ -3412,7 +3412,7 @@ _08075D4A:
cmp r0, 0
beq _08075D76
movs r0, 0x3
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
adds r1, r0, 0
@@ -3439,7 +3439,7 @@ sub_8075D88: @ 8075D88
push {lr}
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
pop {r1}
@@ -3520,7 +3520,7 @@ _08075E16:
bl sub_8075160
ldr r0, _08075E70 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08075E30
@@ -3571,7 +3571,7 @@ sub_8075E80: @ 8075E80
bl sub_8075160
ldr r0, _08075EE0 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08075EA0
@@ -3670,7 +3670,7 @@ _08075F4A:
ldrb r6, [r0]
ldr r0, _08075FAC @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08075F62
@@ -4437,7 +4437,7 @@ _08076508:
bne _080765AC
lsls r0, r4, 24
lsrs r0, 24
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08076568
@@ -4825,7 +4825,7 @@ _080767EC: .4byte gUnknown_2037F1A
sub_80767F0: @ 80767F0
push {r4-r6,lr}
movs r5, 0
- ldr r0, _08076850 @ =gUnknown_2023BCC
+ ldr r0, _08076850 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
bge _0807684A
@@ -4864,7 +4864,7 @@ _080767FE:
strb r2, [r0, 0x5]
_08076840:
adds r5, 0x1
- ldr r0, _08076850 @ =gUnknown_2023BCC
+ ldr r0, _08076850 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
blt _080767FE
@@ -4873,7 +4873,7 @@ _0807684A:
pop {r0}
bx r0
.align 2, 0
-_08076850: .4byte gUnknown_2023BCC
+_08076850: .4byte gBattlersCount
_08076854: .4byte gSprites
_08076858: .4byte gUnknown_2023D44
thumb_func_end sub_80767F0
@@ -4883,7 +4883,7 @@ sub_807685C: @ 807685C
push {lr}
lsls r0, 24
lsrs r0, 24
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
movs r1, 0x1E
@@ -4907,7 +4907,7 @@ sub_8076884: @ 8076884
push {lr}
lsls r0, 24
lsrs r0, 24
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0
@@ -4933,7 +4933,7 @@ sub_80768B0: @ 80768B0
push {lr}
lsls r0, 24
lsrs r0, 24
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0
@@ -4994,7 +4994,7 @@ sub_80768D0: @ 80768D0
bl AllocSpritePalette
lsls r0, 24
lsrs r5, r0, 24
- ldr r4, _080769B8 @ =gUnknown_202401C
+ ldr r4, _080769B8 @ =gMonSpritesGfxPtr
ldr r0, [r4]
cmp r0, 0
beq _0807694E
@@ -5052,7 +5052,7 @@ _0807699A:
lsls r0, r6, 3
ldr r1, _080769C0 @ =gUnknown_82350AC
adds r0, r1
- ldr r1, _080769B8 @ =gUnknown_202401C
+ ldr r1, _080769B8 @ =gMonSpritesGfxPtr
ldr r1, [r1]
movs r3, 0xBE
lsls r3, 1
@@ -5063,14 +5063,14 @@ _0807699A:
.align 2, 0
_080769B0: .4byte gUnknown_83AE084
_080769B4: .4byte gUnknown_83AE054
-_080769B8: .4byte gUnknown_202401C
+_080769B8: .4byte gMonSpritesGfxPtr
_080769BC: .4byte gUnknown_2024018
_080769C0: .4byte gUnknown_82350AC
_080769C4:
lsls r0, r6, 3
ldr r1, _080769E4 @ =gUnknown_82350AC
adds r0, r1
- ldr r1, _080769E8 @ =gUnknown_202401C
+ ldr r1, _080769E8 @ =gMonSpritesGfxPtr
ldr r1, [r1]
movs r2, 0xBE
lsls r2, 1
@@ -5084,7 +5084,7 @@ _080769C4:
b _08076A7C
.align 2, 0
_080769E4: .4byte gUnknown_82350AC
-_080769E8: .4byte gUnknown_202401C
+_080769E8: .4byte gMonSpritesGfxPtr
_080769EC:
adds r0, r6, 0
ldr r1, [sp, 0x3C]
@@ -5122,7 +5122,7 @@ _08076A32:
lsls r0, r6, 3
ldr r1, _08076A58 @ =gUnknown_823654C
adds r0, r1
- ldr r1, _08076A5C @ =gUnknown_202401C
+ ldr r1, _08076A5C @ =gMonSpritesGfxPtr
ldr r1, [r1]
movs r2, 0xBE
lsls r2, 1
@@ -5138,12 +5138,12 @@ _08076A46:
.align 2, 0
_08076A54: .4byte gUnknown_2024018
_08076A58: .4byte gUnknown_823654C
-_08076A5C: .4byte gUnknown_202401C
+_08076A5C: .4byte gMonSpritesGfxPtr
_08076A60:
lsls r0, r6, 3
ldr r1, _08076AC8 @ =gUnknown_823654C
adds r0, r1
- ldr r1, _08076ACC @ =gUnknown_202401C
+ ldr r1, _08076ACC @ =gMonSpritesGfxPtr
ldr r1, [r1]
movs r3, 0xBE
lsls r3, 1
@@ -5154,7 +5154,7 @@ _08076A60:
mov r3, r8
bl sub_800ECF0
_08076A7C:
- ldr r5, _08076ACC @ =gUnknown_202401C
+ ldr r5, _08076ACC @ =gMonSpritesGfxPtr
ldr r0, [r5]
movs r4, 0xBE
lsls r4, 1
@@ -5191,7 +5191,7 @@ _08076A7C:
b _08076AEE
.align 2, 0
_08076AC8: .4byte gUnknown_823654C
-_08076ACC: .4byte gUnknown_202401C
+_08076ACC: .4byte gMonSpritesGfxPtr
_08076AD0: .4byte 0x06010000
_08076AD4: .4byte gUnknown_83AE054
_08076AD8: .4byte gUnknown_82349CC
@@ -5250,7 +5250,7 @@ sub_8076B2C: @ 8076B2C
lsls r1, 24
lsrs r1, 24
mov r9, r1
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08076C08
@@ -5431,7 +5431,7 @@ _08076CA6:
ldr r0, _08076CBC @ =0x00000181
cmp r7, r0
bne _08076CC8
- ldr r0, _08076CC0 @ =gUnknown_2024024
+ ldr r0, _08076CC0 @ =gBattleMonForms
add r0, r8
ldrb r0, [r0]
lsls r0, 2
@@ -5440,7 +5440,7 @@ _08076CA6:
b _08076CDE
.align 2, 0
_08076CBC: .4byte 0x00000181
-_08076CC0: .4byte gUnknown_2024024
+_08076CC0: .4byte gBattleMonForms
_08076CC4: .4byte gUnknown_83AE03C
_08076CC8:
movs r0, 0xCE
@@ -5721,7 +5721,7 @@ sub_8076ED8: @ 8076ED8
bl sub_8074FCC
ldr r0, _08076F10 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08076F18
@@ -5783,7 +5783,7 @@ sub_8076F58: @ 8076F58
adds r4, r0, 0
ldr r0, _08076F80 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08076F88
@@ -5844,7 +5844,7 @@ sub_8076FD0: @ 8076FD0
bl sub_8074FCC
ldr r0, _08076FF4 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08076FFC
@@ -5901,7 +5901,7 @@ sub_8077030: @ 8077030
strh r0, [r5, 0x8]
ldr r7, _080770C8 @ =gUnknown_2037F1A
ldrb r0, [r7]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
movs r1, 0x8
cmp r0, 0
@@ -6212,7 +6212,7 @@ sub_807729C: @ 807729C
lsrs r0, 24
strh r0, [r5, 0x22]
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080772D4
@@ -6302,7 +6302,7 @@ sub_8077350: @ 8077350
strh r0, [r4, 0x36]
ldr r0, _0807738C @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08077390
diff --git a/asm/battle_anim_80989F8.s b/asm/battle_anim_80989F8.s
index 5d2362087..41dc60f9f 100644
--- a/asm/battle_anim_80989F8.s
+++ b/asm/battle_anim_80989F8.s
@@ -207,7 +207,7 @@ _08098B6C:
_08098B70:
movs r0, 0x3
_08098B72:
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r4, r0, 24
adds r0, r4, 0
@@ -878,7 +878,7 @@ sub_809907C: @ 809907C
lsrs r4, r0, 24
ldr r0, _080990A4 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08099098
@@ -909,7 +909,7 @@ sub_80990AC: @ 80990AC
strb r0, [r2]
ldr r0, _080990D4 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080990DC
@@ -1206,7 +1206,7 @@ _080992FE:
adds r0, r2, r0
ldrb r6, [r0]
adds r0, r2, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08099328
@@ -1299,7 +1299,7 @@ _080993BE:
adds r0, r1, r0
ldrb r7, [r0]
adds r0, r1, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080993E8
@@ -1418,7 +1418,7 @@ sub_809949C: @ 809949C
lsrs r7, r0, 16
ldr r0, _08099524 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080994CE
@@ -1642,7 +1642,7 @@ _08099664:
strh r2, [r5, 0x8]
ldr r0, _08099688 @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08099690
@@ -1723,7 +1723,7 @@ sub_8099704: @ 8099704
lsrs r5, r0, 24
ldr r6, _08099754 @ =gUnknown_2037F1A
ldrb r0, [r6]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08099720
@@ -1829,7 +1829,7 @@ _080997D8: .4byte gTasks
_080997DC: .4byte gSprites
_080997E0:
ldrb r0, [r4, 0x12]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08099808
@@ -2121,7 +2121,7 @@ _08099A14:
ldr r0, _08099A6C @ =gUnknown_2037F1B
_08099A16:
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
movs r1, 0
lsls r0, 24
cmp r0, 0
@@ -2208,7 +2208,7 @@ _08099AC0:
ldr r0, _08099AF0 @ =gUnknown_2037F1B
_08099AC2:
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08099AD4
diff --git a/asm/battle_anim_80A22E8.s b/asm/battle_anim_80A22E8.s
index 90b0c8c86..2c5feb2f1 100644
--- a/asm/battle_anim_80A22E8.s
+++ b/asm/battle_anim_80A22E8.s
@@ -24,7 +24,7 @@ sub_80A22E8: @ 80A22E8
strh r0, [r4, 0x30]
ldr r0, _080A2320 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080A2324
@@ -412,7 +412,7 @@ sub_80A25EC: @ 80A25EC
lsrs r0, 24
strh r0, [r5, 0x22]
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080A2638
@@ -523,7 +523,7 @@ sub_80A26F0: @ 80A26F0
bl sub_8075160
ldr r0, _080A2750 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080A2710
@@ -1080,7 +1080,7 @@ sub_80A2B38: @ 80A2B38
adds r4, r0, 0
ldr r0, _080A2B58 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080A2B5C
@@ -1135,7 +1135,7 @@ sub_80A2B9C: @ 80A2B9C
bl sub_8075160
ldr r0, _080A2BF0 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080A2BBC
@@ -1197,11 +1197,11 @@ _080A2C1C:
bl sub_8075068
ldr r0, _080A2C50 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
adds r4, r0, 0
ldr r0, _080A2C48 @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r4, 24
lsls r0, 24
cmp r4, r0
@@ -1664,7 +1664,7 @@ sub_80A2F74: @ 80A2F74
strh r1, [r5, 0x24]
ldr r0, _080A2FFC @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080A2FBE
@@ -1793,7 +1793,7 @@ sub_80A3098: @ 80A3098
_080A30AA:
ldr r6, _080A30FC @ =gUnknown_2037F1B
ldrb r0, [r6]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080A30C2
@@ -2485,7 +2485,7 @@ sub_80A35F4: @ 80A35F4
lsls r0, 24
lsrs r6, r0, 24
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0
@@ -3021,7 +3021,7 @@ sub_80A39C0: @ 80A39C0
bl sub_8076B2C
strh r0, [r5, 0x1E]
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
movs r2, 0x1
@@ -3833,7 +3833,7 @@ _080A405C:
_080A405E:
ldrb r6, [r0]
adds r0, r6, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080A4088
@@ -4310,7 +4310,7 @@ sub_80A43F8: @ 80A43F8
adds r4, r0, 0
ldr r0, _080A4418 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080A4420
@@ -4355,7 +4355,7 @@ sub_80A4450: @ 80A4450
adds r5, r0, 0
ldr r0, _080A4488 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080A446A
@@ -4439,7 +4439,7 @@ sub_80A44E0: @ 80A44E0
lsrs r0, 24
strh r0, [r5, 0x22]
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080A4514
@@ -4600,7 +4600,7 @@ _080A463E:
strh r4, [r6, 0x22]
ldr r0, _080A4670 @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080A4656
@@ -4854,7 +4854,7 @@ sub_80A481C: @ 80A481C
strh r0, [r5, 0x2E]
ldr r0, _080A4840 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080A4844
@@ -4987,7 +4987,7 @@ _080A4906:
adds r0, r4
strh r0, [r5, 0x22]
ldrb r0, [r6]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080A4944
@@ -5649,7 +5649,7 @@ sub_80A4E40: @ 80A4E40
bl sub_8074FCC
ldr r0, _080A4E6C @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080A4E74
@@ -5741,7 +5741,7 @@ sub_80A4EF4: @ 80A4EF4
bl sub_8074FCC
ldr r0, _080A4F24 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080A4F2C
@@ -6368,7 +6368,7 @@ sub_80A5398: @ 80A5398
strh r0, [r4, 0x2E]
ldr r5, _080A53D8 @ =gUnknown_2037F1A
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
movs r2, 0x2
negs r2, r2
@@ -6417,7 +6417,7 @@ sub_80A53E8: @ 80A53E8
movs r1, 0
bl sub_80758E0
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
strh r0, [r5, 0x3A]
@@ -6478,7 +6478,7 @@ sub_80A5474: @ 80A5474
strh r0, [r4, 0x2E]
ldr r5, _080A54B4 @ =gUnknown_2037F1A
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
movs r1, 0x3
cmp r0, 0
@@ -6547,12 +6547,12 @@ sub_80A54E8: @ 80A54E8
ldrb r0, [r0]
strh r0, [r5, 0x34]
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
strh r0, [r5, 0x3A]
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080A552C
@@ -6656,7 +6656,7 @@ _080A55BC:
ldrb r0, [r0]
strh r0, [r4, 0x32]
ldrb r0, [r2]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x34]
@@ -6770,7 +6770,7 @@ sub_80A5694: @ 80A5694
movs r4, 0
strh r0, [r5, 0x8]
ldrb r0, [r2]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r2, r0, 24
strh r2, [r5, 0xA]
@@ -7776,7 +7776,7 @@ sub_80A5E34: @ 80A5E34
lsls r0, 24
lsrs r7, r0, 24
movs r4, 0
- ldr r0, _080A5E9C @ =gUnknown_2023BCC
+ ldr r0, _080A5E9C @ =gBattlersCount
ldrb r0, [r0]
cmp r4, r0
bcs _080A5E90
@@ -7788,7 +7788,7 @@ _080A5E48:
cmp r0, 0x1
bne _080A5E64
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080A5E64
@@ -7801,7 +7801,7 @@ _080A5E64:
cmp r0, 0x1
bne _080A5E82
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -7813,7 +7813,7 @@ _080A5E82:
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
- ldr r0, _080A5E9C @ =gUnknown_2023BCC
+ ldr r0, _080A5E9C @ =gBattlersCount
ldrb r0, [r0]
cmp r4, r0
bcc _080A5E48
@@ -7824,7 +7824,7 @@ _080A5E90:
pop {r0}
bx r0
.align 2, 0
-_080A5E9C: .4byte gUnknown_2023BCC
+_080A5E9C: .4byte gBattlersCount
_080A5EA0: .4byte gUnknown_2037F02
_080A5EA4: .4byte gUnknown_3004FF0
thumb_func_end sub_80A5E34
@@ -7845,7 +7845,7 @@ _080A5EB2:
lsls r0, 24
lsrs r4, r0, 24
_080A5EC2:
- ldr r0, _080A5EDC @ =gUnknown_2023BCC
+ ldr r0, _080A5EDC @ =gBattlersCount
ldrb r0, [r0]
cmp r4, r0
bcc _080A5EB2
@@ -7856,7 +7856,7 @@ _080A5EC2:
bx r0
.align 2, 0
_080A5ED8: .4byte gUnknown_3004FF0
-_080A5EDC: .4byte gUnknown_2023BCC
+_080A5EDC: .4byte gBattlersCount
thumb_func_end sub_80A5EA8
thumb_func_start sub_80A5EE0
@@ -8380,7 +8380,7 @@ _080A62D0: .4byte 0xffffec00
_080A62D4:
ldr r0, _080A6314 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080A631C
@@ -9148,7 +9148,7 @@ sub_80A68B0: @ 80A68B0
adds r6, r0, 0
ldr r7, _080A6934 @ =gUnknown_2037F1A
ldrb r0, [r7]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -9452,7 +9452,7 @@ sub_80A6B0C: @ 80A6B0C
lsls r0, 24
lsrs r5, r0, 24
adds r0, r5, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080A6B2C
@@ -9513,7 +9513,7 @@ _080A6B82:
adds r1, r5, 0
bl sub_80A6B0C
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
negs r1, r0
@@ -9802,7 +9802,7 @@ _080A6DAE:
adds r1, r5, 0
bl sub_80A6B0C
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080A6DD4
@@ -10075,7 +10075,7 @@ sub_80A6F8C: @ 80A6F8C
adds r0, r1
ldrb r6, [r0]
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080A6FE4
@@ -10231,7 +10231,7 @@ sub_80A70DC: @ 80A70DC
ldrb r0, [r0]
adds r1, r0, r1
ldrb r4, [r1]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080A7118
@@ -10356,7 +10356,7 @@ sub_80A71D8: @ 80A71D8
bl sub_8074FCC
ldr r0, _080A71FC @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080A7204
@@ -10384,7 +10384,7 @@ _080A7210:
strh r0, [r4, 0x22]
ldr r0, _080A7248 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080A724C
@@ -10492,7 +10492,7 @@ _080A72E8: .4byte gUnknown_2037F02
_080A72EC:
ldr r0, _080A73B4 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080A730E
@@ -11485,7 +11485,7 @@ sub_80A7A88: @ 80A7A88
lsrs r7, r0, 16
ldr r0, _080A7B30 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080A7ACC
@@ -11571,7 +11571,7 @@ sub_80A7B54: @ 80A7B54
strh r0, [r4, 0x24]
ldr r0, _080A7BC0 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080A7B78
@@ -11784,7 +11784,7 @@ sub_80A7D04: @ 80A7D04
bl sub_8075160
ldr r0, _080A7D54 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080A7D22
@@ -12824,7 +12824,7 @@ sub_80A851C: @ 80A851C
adds r4, r0, 0
ldr r5, _080A854C @ =gUnknown_2037F1A
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080A8550
@@ -12903,7 +12903,7 @@ _080A85C8:
_080A85CA:
ldrb r5, [r0]
adds r0, r5, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -13053,7 +13053,7 @@ sub_80A86A4: @ 80A86A4
strh r0, [r4, 0x1A]
ldr r0, _080A8720 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -13754,7 +13754,7 @@ _080A8C34:
lsls r0, 24
lsrs r4, r0, 24
adds r0, r5, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080A8C60
@@ -13863,7 +13863,7 @@ _080A8D08:
str r3, [sp, 0x4]
_080A8D10:
adds r0, r7, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080A8D6C
@@ -14025,7 +14025,7 @@ _080A8E4C:
strh r0, [r2, 0x2]
_080A8E6C:
mov r0, r8
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080A8E90
@@ -14129,7 +14129,7 @@ sub_80A8F38: @ 80A8F38
bl sub_8075160
ldr r0, _080A8F6C @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
movs r1, 0xA0
cmp r0, 0
@@ -14174,7 +14174,7 @@ sub_80A8F7C: @ 80A8F7C
strh r2, [r4, 0x2E]
ldr r0, _080A8FE8 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
movs r1, 0xA0
cmp r0, 0
@@ -14523,7 +14523,7 @@ sub_80A9210: @ 80A9210
strh r0, [r4, 0x20]
ldr r0, _080A9248 @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080A9250
@@ -15155,7 +15155,7 @@ _080A96CC:
lsls r0, 6
bl AllocZeroed
adds r1, r0, 0
- ldr r0, _080A9758 @ =gUnknown_202401C
+ ldr r0, _080A9758 @ =gMonSpritesGfxPtr
ldr r0, [r0]
movs r2, 0xBE
lsls r2, 1
@@ -15165,7 +15165,7 @@ _080A96CC:
bl LZDecompressWram
movs r4, 0
_080A9700:
- ldr r5, _080A9758 @ =gUnknown_202401C
+ ldr r5, _080A9758 @ =gMonSpritesGfxPtr
ldr r0, [r5]
movs r1, 0xBE
lsls r1, 1
@@ -15205,7 +15205,7 @@ _080A9700:
.align 2, 0
_080A9750: .4byte 0x000027de
_080A9754: .4byte 0x00002710
-_080A9758: .4byte gUnknown_202401C
+_080A9758: .4byte gMonSpritesGfxPtr
_080A975C: .4byte gUnknown_8D227E4
thumb_func_end sub_80A96B4
@@ -15288,7 +15288,7 @@ sub_80A97E8: @ 80A97E8
bl sub_8075160
ldr r6, _080A9850 @ =gUnknown_2037F1A
ldrb r0, [r6]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080A9808
@@ -16226,7 +16226,7 @@ _080A9F94: .4byte gUnknown_8E7F874
_080A9F98:
ldr r0, _080A9FB4 @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -17369,7 +17369,7 @@ _080AA854:
_080AA856:
ldrb r6, [r0]
adds r0, r6, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -17936,7 +17936,7 @@ sub_80AAC98: @ 80AAC98
adds r6, r0, 0
ldr r5, _080AACC0 @ =gUnknown_2037F1A
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080AACC8
@@ -17979,7 +17979,7 @@ _080AACDA:
strb r0, [r2]
ldr r0, _080AADA4 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080AAD10
@@ -18176,7 +18176,7 @@ sub_80AAE84: @ 80AAE84
bl sub_8075160
ldr r0, _080AAEAC @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080AAEB4
@@ -18570,7 +18570,7 @@ sub_80AB168: @ 80AB168
cmp r0, 0
bne _080AB1C2
ldrb r0, [r7]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080AB1BC
@@ -18624,11 +18624,11 @@ sub_80AB1F8: @ 80AB1F8
adds r6, r0, 0
ldr r5, _080AB2B8 @ =gUnknown_2037F1A
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
adds r4, r0, 0
ldr r0, _080AB2BC @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r4, 24
lsls r0, 24
cmp r4, r0
@@ -18639,12 +18639,12 @@ sub_80AB1F8: @ 80AB1F8
negs r0, r0
strh r0, [r4]
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
cmp r0, 0
beq _080AB23A
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -18676,7 +18676,7 @@ _080AB260:
bl sub_8075160
ldr r0, _080AB2B8 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080AB27A
@@ -18858,7 +18858,7 @@ sub_80AB38C: @ 80AB38C
bl SetAnimBgAttribute
ldr r0, _080AB400 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -18982,7 +18982,7 @@ _080AB4F4: .4byte gUnknown_202297A
_080AB4F8:
ldr r0, _080AB528 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0x1
@@ -20131,7 +20131,7 @@ sub_80ABDC8: @ 80ABDC8
push {r4,r5,lr}
ldr r4, _080ABDEC @ =gUnknown_2037F1A
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080ABDFC
@@ -20438,7 +20438,7 @@ sub_80AC00C: @ 80AC00C
strh r0, [r4, 0xA]
ldr r0, _080AC040 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080AC044
@@ -20849,7 +20849,7 @@ sub_80AC328: @ 80AC328
lsrs r0, 24
strh r0, [r5, 0x10]
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
movs r2, 0x1
negs r2, r2
@@ -21656,7 +21656,7 @@ sub_80AC990: @ 80AC990
bl sub_8074FCC
ldr r0, _080AC9C4 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080AC9CC
@@ -21712,7 +21712,7 @@ sub_80ACA00: @ 80ACA00
adds r4, r0, 0
ldr r0, _080ACA2C @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080ACA34
@@ -21804,7 +21804,7 @@ sub_80ACAA8: @ 80ACAA8
bl sub_8074FCC
ldr r0, _080ACACC @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080ACAD4
@@ -21963,24 +21963,24 @@ sub_80ACBDC: @ 80ACBDC
adds r6, r0, 0
ldr r5, _080ACC34 @ =gUnknown_2037F1A
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
adds r4, r0, 0
ldr r0, _080ACC38 @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r4, 24
lsls r0, 24
cmp r4, r0
bne _080ACC22
movs r0, 0x2
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldrb r1, [r5]
lsls r0, 24
lsrs r0, 24
cmp r1, r0
beq _080ACC1A
movs r0, 0x3
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldrb r1, [r5]
lsls r0, 24
lsrs r0, 24
@@ -22352,7 +22352,7 @@ sub_80ACEA4: @ 80ACEA4
strh r0, [r4, 0x10]
ldr r0, _080ACF0C @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x12]
@@ -22778,7 +22778,7 @@ sub_80AD1F8: @ 80AD1F8
ldrh r4, [r0, 0x20]
ldr r0, _080AD24C @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080AD250
@@ -22960,7 +22960,7 @@ sub_80AD374: @ 80AD374
lsrs r4, r0, 16
ldr r0, _080AD3B0 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080AD3B4
@@ -23223,7 +23223,7 @@ _080AD55C:
strh r0, [r5, 0x3C]
ldr r0, _080AD588 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080AD58C
@@ -23258,7 +23258,7 @@ _080AD5B4:
strh r0, [r5, 0x30]
ldr r0, _080AD5D4 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080AD5D8
@@ -23564,7 +23564,7 @@ sub_80AD800: @ 80AD800
adds r4, r1, r0
ldr r0, _080AD864 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
movs r2, 0x1
negs r2, r2
@@ -24082,7 +24082,7 @@ sub_80ADBEC: @ 80ADBEC
adds r4, r0, 0
ldr r0, _080ADC0C @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080ADC14
@@ -24140,7 +24140,7 @@ sub_80ADC58: @ 80ADC58
adds r4, r0, 0
ldr r0, _080ADC78 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080ADC80
@@ -24206,7 +24206,7 @@ sub_80ADCB8: @ 80ADCB8
strh r0, [r5, 0x22]
ldr r0, _080ADD00 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080ADD08
@@ -24613,7 +24613,7 @@ sub_80AE000: @ 80AE000
bne _080AE01C
ldr r0, _080AE060 @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080AE024
@@ -24685,7 +24685,7 @@ _080AE092:
cmp r0, 0
bne _080AE0AA
adds r0, r6, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080AE0B2
@@ -25637,7 +25637,7 @@ sub_80AE7DC: @ 80AE7DC
movs r0, 0x10
strh r0, [r5, 0x3C]
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -25756,7 +25756,7 @@ _080AE8D4:
lsrs r0, 24
strh r0, [r5, 0x24]
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080AE910
@@ -25932,7 +25932,7 @@ _080AEA3E:
_080AEA40:
ldr r4, _080AEA80 @ =gUnknown_2037F1A
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
movs r2, 0x1
negs r2, r2
@@ -27131,7 +27131,7 @@ sub_80AF330: @ 80AF330
strh r0, [r4, 0x32]
ldr r0, _080AF368 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080AF370
@@ -27205,7 +27205,7 @@ _080AF3D4:
bl sub_8076D9C
ldr r0, _080AF420 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080AF3FA
@@ -27319,7 +27319,7 @@ _080AF4B8:
_080AF4CA:
ldr r0, _080AF4E8 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080AF4F0
@@ -27445,7 +27445,7 @@ sub_80AF5A4: @ 80AF5A4
strh r0, [r4, 0x2E]
ldr r0, _080AF600 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
ldr r1, _080AF604 @ =0x0000ffec
cmp r0, 0
@@ -27483,7 +27483,7 @@ sub_80AF60C: @ 80AF60C
adds r4, r0, 0
ldr r0, _080AF660 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
ldr r1, _080AF664 @ =0x0000ffec
cmp r0, 0
@@ -27632,7 +27632,7 @@ _080AF724:
_080AF736:
ldr r0, _080AF758 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080AF760
@@ -27835,7 +27835,7 @@ _080AF8B0:
bl sub_8076D9C
ldr r0, _080AF8F4 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080AF8D6
@@ -27904,7 +27904,7 @@ _080AF938:
movs r1, 0
bl sub_8076D9C
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080AF964
@@ -27950,7 +27950,7 @@ _080AF996:
movs r1, 0
bl sub_8076D9C
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080AF9C0
@@ -27997,7 +27997,7 @@ _080AF9FA:
strh r0, [r5, 0x3A]
ldr r0, _080AFA40 @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080AFA10
@@ -29317,7 +29317,7 @@ sub_80B0458: @ 80B0458
ldrh r0, [r4, 0x2]
lsls r0, 20
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r5, r0, 24
adds r0, r5, 0
@@ -29648,7 +29648,7 @@ _080B071A:
strh r0, [r5, 0x2E]
ldr r0, _080B0784 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B0742
@@ -29874,7 +29874,7 @@ sub_80B08DC: @ 80B08DC
bne _080B0904
ldr r0, _080B0924 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B0904
@@ -30296,7 +30296,7 @@ sub_80B0C28: @ 80B0C28
cmp r0, r1
bne _080B0C54
ldrb r0, [r2]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -30312,7 +30312,7 @@ _080B0C54:
bl sub_8075114
ldr r0, _080B0CA4 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B0C72
@@ -31225,7 +31225,7 @@ _080B1364: .4byte gUnknown_2037F1A
_080B1368: .4byte gUnknown_2037F1B
_080B136C:
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080B138C
@@ -31324,7 +31324,7 @@ sub_80B13F8: @ 80B13F8
ldr r0, _080B147C @ =gUnknown_2037F16
ldrb r6, [r0]
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080B1442
@@ -31395,7 +31395,7 @@ _080B14A8:
_080B14BC:
ldr r0, _080B14E4 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B14D2
@@ -31510,7 +31510,7 @@ _080B158E:
strh r0, [r4, 0x1C]
ldr r0, _080B15BC @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080B15C4
@@ -31662,7 +31662,7 @@ _080B16B8:
bl sub_8076D9C
ldr r0, _080B171C @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B16E6
@@ -31795,7 +31795,7 @@ sub_80B17C4: @ 80B17C4
bl sub_8076D9C
ldr r0, _080B1828 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B17F0
@@ -31862,7 +31862,7 @@ _080B1854:
bl sub_8076D9C
ldr r0, _080B1898 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B187A
@@ -32096,7 +32096,7 @@ sub_80B1A1C: @ 80B1A1C
bl sub_8075160
ldr r0, _080B1A88 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B1A3C
@@ -32169,7 +32169,7 @@ sub_80B1AB8: @ 80B1AB8
adds r5, r0, 0
ldr r4, _080B1B54 @ =gUnknown_2037F1A
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B1AE4
@@ -32360,7 +32360,7 @@ sub_80B1C3C: @ 80B1C3C
adds r5, r0, 0
ldr r0, _080B1C64 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B1C6C
@@ -32546,7 +32546,7 @@ _080B1DB0:
_080B1DB2:
ldrb r6, [r0]
adds r0, r6, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080B1DC8
@@ -33875,7 +33875,7 @@ _080B27A4:
bne _080B27BC
ldr r0, _080B2810 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B27D2
@@ -33886,7 +33886,7 @@ _080B27BC:
bne _080B27D8
ldr r0, _080B2814 @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080B27D8
@@ -34833,7 +34833,7 @@ sub_80B2ECC: @ 80B2ECC
adds r6, r0, 0
ldr r0, _080B2F84 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B2EE8
@@ -34859,7 +34859,7 @@ _080B2EFE:
cmp r0, 0
bne _080B2F5A
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r4, r0, 24
adds r7, r4, 0
@@ -34905,7 +34905,7 @@ _080B2F5A:
beq _080B2F90
ldr r0, _080B2F84 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080B2F88
@@ -34923,7 +34923,7 @@ _080B2F88:
_080B2F90:
ldr r5, _080B3000 @ =gUnknown_2037F1A
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B2FA6
@@ -35098,7 +35098,7 @@ sub_80B30B0: @ 80B30B0
cmp r0, 0
bne _080B3146
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r4, r0, 24
adds r6, r4, 0
@@ -35172,7 +35172,7 @@ sub_80B3168: @ 80B3168
cmp r0, 0
bne _080B31C0
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
adds r4, r0, 0
@@ -35239,7 +35239,7 @@ _080B31EA:
beq _080B3232
ldr r0, _080B3220 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080B3224
@@ -35317,7 +35317,7 @@ sub_80B3278: @ 80B3278
lsrs r0, 24
strh r0, [r5, 0x22]
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B32C8
@@ -35384,7 +35384,7 @@ sub_80B32F4: @ 80B32F4
lsls r1, 16
lsrs r7, r1, 16
ldrb r0, [r6]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -35581,7 +35581,7 @@ sub_80B3480: @ 80B3480
strh r1, [r4, 0xC]
ldr r0, _080B34D0 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
movs r1, 0x8
cmp r0, 0
@@ -37023,7 +37023,7 @@ _080B3FD4: .4byte gUnknown_2037F02
_080B3FD8:
ldr r0, _080B406C @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080B4008
@@ -37116,7 +37116,7 @@ _080B409C: .4byte gUnknown_2037F02
_080B40A0:
ldr r0, _080B4118 @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080B40BC
@@ -37293,7 +37293,7 @@ sub_80B41F8: @ 80B41F8
bl sub_8076D9C
ldr r0, _080B422C @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B4234
@@ -37321,7 +37321,7 @@ _080B4240:
strh r0, [r4, 0x22]
ldr r0, _080B426C @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080B425C
@@ -37492,7 +37492,7 @@ _080B4380: .4byte gUnknown_2037F02
_080B4384:
ldr r0, _080B4480 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B43A6
@@ -37513,22 +37513,22 @@ _080B43A6:
bne _080B43F6
ldr r0, _080B4480 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
adds r4, r0, 0
ldr r5, _080B4488 @ =gUnknown_2037F1B
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r4, 24
lsls r0, 24
cmp r4, r0
bne _080B43F6
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
cmp r0, 0
beq _080B43E4
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -37622,7 +37622,7 @@ sub_80B4494: @ 80B4494
bl sub_8075160
ldr r0, _080B4500 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B44B4
@@ -37923,7 +37923,7 @@ sub_80B46F8: @ 80B46F8
bl AnimateSprite
ldr r0, _080B4724 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B4728
@@ -38132,7 +38132,7 @@ _080B48B0:
beq _080B48CA
ldr r0, _080B4900 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B48CA
@@ -38378,7 +38378,7 @@ sub_80B4AA8: @ 80B4AA8
beq _080B4AF4
ldr r0, _080B4AF0 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B4AF4
@@ -39121,7 +39121,7 @@ sub_80B5074: @ 80B5074
adds r4, r0, 0
ldr r0, _080B509C @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -40248,7 +40248,7 @@ _080B58DC:
strh r1, [r0, 0x2E]
ldr r0, _080B5948 @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080B5950
@@ -41614,7 +41614,7 @@ sub_80B63B4: @ 80B63B4
bl SetGpuReg
ldr r0, _080B6410 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080B63FC
@@ -41897,7 +41897,7 @@ sub_80B664C: @ 80B664C
bl sub_8075160
ldr r0, _080B6678 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080B6680
@@ -42103,7 +42103,7 @@ sub_80B67D4: @ 80B67D4
strh r0, [r5, 0x24]
ldr r0, _080B683C @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B67F8
@@ -42348,7 +42348,7 @@ _080B69B2:
strh r7, [r5, 0x2E]
ldr r0, _080B6A1C @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
movs r1, 0
lsls r0, 24
cmp r0, 0
@@ -42824,7 +42824,7 @@ _080B6D8C:
lsls r0, 6
bl AllocZeroed
adds r1, r0, 0
- ldr r5, _080B6DFC @ =gUnknown_202401C
+ ldr r5, _080B6DFC @ =gMonSpritesGfxPtr
ldr r0, [r5]
movs r4, 0xBE
lsls r4, 1
@@ -42866,7 +42866,7 @@ _080B6D8C:
str r1, [r0]
b _080B6F1E
.align 2, 0
-_080B6DFC: .4byte gUnknown_202401C
+_080B6DFC: .4byte gMonSpritesGfxPtr
_080B6E00: .4byte gUnknown_8E7F4AC
_080B6E04:
ldrh r0, [r6, 0xA]
@@ -43435,7 +43435,7 @@ sub_80B725C: @ 80B725C
lsrs r0, 24
strh r0, [r5, 0x22]
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B72AC
@@ -43514,7 +43514,7 @@ sub_80B72F8: @ 80B72F8
strh r0, [r5, 0x36]
ldr r0, _080B7354 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B735C
@@ -43637,7 +43637,7 @@ sub_80B741C: @ 80B741C
adds r4, r0, 0
ldr r0, _080B7444 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B7436
@@ -44901,7 +44901,7 @@ sub_80B7DA4: @ 80B7DA4
adds r0, 0x20
strh r0, [r5, 0x26]
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080B7E14
@@ -45351,7 +45351,7 @@ _080B817C:
adds r0, 0x4
strh r0, [r5, 0x26]
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080B81D0
@@ -46085,13 +46085,13 @@ _080B8750:
bne _080B87CA
ldr r4, _080B8804 @ =gUnknown_2037F1A
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
beq _080B8780
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
cmp r0, 0
bne _080B87CA
@@ -46134,7 +46134,7 @@ _080B8780:
_080B87CA:
ldr r4, _080B8804 @ =gUnknown_2037F1A
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B8818
@@ -46489,7 +46489,7 @@ _080B8ADA:
beq _080B8B06
_080B8AE0:
adds r0, r4, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r4, r0, 24
adds r0, r4, 0
@@ -46680,7 +46680,7 @@ sub_80B8C54: @ 80B8C54
bl sub_8075114
ldr r0, _080B8CB4 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080B8C74
@@ -48355,7 +48355,7 @@ sub_80B9904: @ 80B9904
strh r0, [r4, 0x2E]
ldr r0, _080B9940 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0
@@ -48887,7 +48887,7 @@ sub_80B9CE4: @ 80B9CE4
strh r1, [r0, 0x12]
strh r5, [r0, 0x18]
movs r4, 0
- ldr r0, _080B9D90 @ =gUnknown_2023BCC
+ ldr r0, _080B9D90 @ =gBattlersCount
ldrb r1, [r0]
mov r9, r3
mov r8, r2
@@ -48947,7 +48947,7 @@ _080B9D5A:
.align 2, 0
_080B9D88: .4byte gTasks
_080B9D8C: .4byte gUnknown_2037F02
-_080B9D90: .4byte gUnknown_2023BCC
+_080B9D90: .4byte gBattlersCount
_080B9D94: .4byte gUnknown_2037F1A
_080B9D98: .4byte gUnknown_2037F1B
_080B9D9C: .4byte sub_80B9DF0
@@ -49732,7 +49732,7 @@ _080BA362:
cmp r0, 0x1
bhi _080BA3B4
movs r4, 0
- ldr r5, _080BA3C0 @ =gUnknown_2023BCC
+ ldr r5, _080BA3C0 @ =gBattlersCount
ldrb r0, [r5]
cmp r4, r0
bcs _080BA3B4
@@ -49767,7 +49767,7 @@ _080BA3BA:
pop {r0}
bx r0
.align 2, 0
-_080BA3C0: .4byte gUnknown_2023BCC
+_080BA3C0: .4byte gBattlersCount
_080BA3C4: .4byte gSprites
_080BA3C8: .4byte gUnknown_2023D44
thumb_func_end sub_80BA320
@@ -50062,7 +50062,7 @@ sub_80BA5F8: @ 80BA5F8
adds r4, r0, 0
ldr r0, _080BA628 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080BA61C
@@ -51035,13 +51035,13 @@ _080BAD7A:
bne _080BADFE
ldr r5, _080BAE38 @ =gUnknown_2037F1A
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
beq _080BADAA
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
cmp r0, 0
bne _080BADFE
@@ -51089,7 +51089,7 @@ _080BADAA:
_080BADFE:
ldr r4, _080BAE38 @ =gUnknown_2037F1A
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080BAE4C
@@ -51506,14 +51506,14 @@ _080BB18E:
cmp r0, 0
bne _080BB20A
ldrb r0, [r1]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
beq _080BB1C0
ldr r0, [r4]
ldrb r0, [r0]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
cmp r0, 0
bne _080BB20A
@@ -51557,7 +51557,7 @@ _080BB20A:
ldr r4, _080BB234 @ =gUnknown_20399B4
ldr r0, [r4]
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080BB25C
@@ -52348,7 +52348,7 @@ sub_80BB82C: @ 80BB82C
beq _080BB868
ldr r0, _080BB89C @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080BB868
@@ -52456,7 +52456,7 @@ sub_80BB920: @ 80BB920
lsrs r4, 24
ldr r0, _080BB944 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
ldr r1, _080BB948 @ =gUnknown_2037F02
lsls r0, 24
lsrs r0, 24
@@ -52479,7 +52479,7 @@ sub_80BB94C: @ 80BB94C
lsrs r4, 24
ldr r0, _080BB970 @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
ldr r1, _080BB974 @ =gUnknown_2037F02
lsls r0, 24
lsrs r0, 24
@@ -52689,7 +52689,7 @@ _080BBAFC:
movs r0, 0xA
bl SetGpuReg
adds r0, r7, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080BBB3C
@@ -53068,7 +53068,7 @@ sub_80BBE10: @ 80BBE10
movs r0, 0x80
lsls r0, 6
bl AllocZeroed
- ldr r1, _080BBE38 @ =gUnknown_202401C
+ ldr r1, _080BBE38 @ =gMonSpritesGfxPtr
ldr r1, [r1]
movs r2, 0xBE
lsls r2, 1
@@ -53080,7 +53080,7 @@ sub_80BBE10: @ 80BBE10
pop {r0}
bx r0
.align 2, 0
-_080BBE38: .4byte gUnknown_202401C
+_080BBE38: .4byte gMonSpritesGfxPtr
thumb_func_end sub_80BBE10
thumb_func_start sub_80BBE3C
@@ -53089,7 +53089,7 @@ sub_80BBE3C: @ 80BBE3C
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
- ldr r6, _080BBE68 @ =gUnknown_202401C
+ ldr r6, _080BBE68 @ =gMonSpritesGfxPtr
ldr r0, [r6]
movs r5, 0xBE
lsls r5, 1
@@ -53106,7 +53106,7 @@ sub_80BBE3C: @ 80BBE3C
pop {r0}
bx r0
.align 2, 0
-_080BBE68: .4byte gUnknown_202401C
+_080BBE68: .4byte gMonSpritesGfxPtr
thumb_func_end sub_80BBE3C
thumb_func_start sub_80BBE6C
@@ -53161,7 +53161,7 @@ _080BBEC2:
adds r4, r0, 0
adds r4, 0x10
_080BBEC8:
- ldr r0, _080BBEFC @ =gUnknown_202401C
+ ldr r0, _080BBEFC @ =gMonSpritesGfxPtr
ldr r1, [r0]
ldr r0, _080BBF00 @ =gUnknown_2037F02
movs r2, 0x2
@@ -53185,7 +53185,7 @@ _080BBEC8:
bx r0
.align 2, 0
_080BBEF8: .4byte gUnknown_2037F1B
-_080BBEFC: .4byte gUnknown_202401C
+_080BBEFC: .4byte gMonSpritesGfxPtr
_080BBF00: .4byte gUnknown_2037F02
_080BBF04: .4byte gUnknown_20371F8
thumb_func_end sub_80BBE6C
@@ -53245,7 +53245,7 @@ _080BBF64:
lsls r0, r4, 5
ldr r1, _080BBF98 @ =gUnknown_20371F8
adds r0, r1
- ldr r1, _080BBF9C @ =gUnknown_202401C
+ ldr r1, _080BBF9C @ =gMonSpritesGfxPtr
ldr r2, [r1]
ldr r1, _080BBFA0 @ =gUnknown_2037F02
movs r3, 0x2
@@ -53267,7 +53267,7 @@ _080BBF64:
.align 2, 0
_080BBF94: .4byte gUnknown_2037F1B
_080BBF98: .4byte gUnknown_20371F8
-_080BBF9C: .4byte gUnknown_202401C
+_080BBF9C: .4byte gMonSpritesGfxPtr
_080BBFA0: .4byte gUnknown_2037F02
thumb_func_end sub_80BBF08
@@ -53401,11 +53401,11 @@ sub_80BC090: @ 80BC090
lsrs r5, r0, 24
ldr r0, _080BC0B8 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
adds r4, r0, 0
ldr r0, _080BC0BC @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r4, 24
lsls r0, 24
cmp r4, r0
@@ -55242,15 +55242,15 @@ sub_80BCEF4: @ 80BCEF4
lsls r5, 16
lsrs r5, 16
adds r0, r4, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
- ldr r1, _080BCFC4 @ =gUnknown_202401C
+ ldr r1, _080BCFC4 @ =gMonSpritesGfxPtr
ldr r2, [r1]
lsls r4, 2
adds r2, 0x4
adds r2, r4
- ldr r1, _080BCFC8 @ =gUnknown_2024024
+ ldr r1, _080BCFC8 @ =gBattleMonForms
adds r0, r1
ldrb r1, [r0]
lsls r1, 11
@@ -55319,8 +55319,8 @@ _080BCFA0:
pop {r0}
bx r0
.align 2, 0
-_080BCFC4: .4byte gUnknown_202401C
-_080BCFC8: .4byte gUnknown_2024024
+_080BCFC4: .4byte gMonSpritesGfxPtr
+_080BCFC8: .4byte gBattleMonForms
thumb_func_end sub_80BCEF4
thumb_func_start sub_80BCFCC
@@ -55355,7 +55355,7 @@ sub_80BCFCC: @ 80BCFCC
lsls r0, 24
mov r9, r0
ldr r4, _080BD090 @ =0x040000d4
- ldr r0, _080BD094 @ =gUnknown_202401C
+ ldr r0, _080BD094 @ =gMonSpritesGfxPtr
ldr r0, [r0]
lsrs r2, 22
adds r0, 0x4
@@ -55429,7 +55429,7 @@ _080BD080:
bx r0
.align 2, 0
_080BD090: .4byte 0x040000d4
-_080BD094: .4byte gUnknown_202401C
+_080BD094: .4byte gMonSpritesGfxPtr
_080BD098: .4byte 0x80000400
thumb_func_end sub_80BCFCC
diff --git a/asm/battle_anim_80DE2C0.s b/asm/battle_anim_80DE2C0.s
index b80374308..9b56509a2 100644
--- a/asm/battle_anim_80DE2C0.s
+++ b/asm/battle_anim_80DE2C0.s
@@ -810,7 +810,7 @@ sub_80DE8B0: @ 80DE8B0
bl sub_8076D9C
ldr r0, _080DE918 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080DE8E4
@@ -963,7 +963,7 @@ sub_80DE9D8: @ 80DE9D8
bne _080DEA2C
ldr r0, _080DEA18 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080DEA1C
@@ -1063,7 +1063,7 @@ sub_80DEAB4: @ 80DEAB4
lsrs r4, r0, 24
ldr r0, _080DEAD0 @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -2604,7 +2604,7 @@ sub_80DF688: @ 80DF688
adds r4, r0, 0
ldr r0, _080DF6A0 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080DF6A8
@@ -2638,7 +2638,7 @@ sub_80DF6C0: @ 80DF6C0
strh r0, [r4, 0x2E]
ldr r0, _080DF6E0 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080DF6E4
@@ -3155,16 +3155,16 @@ _080DFAB4: .4byte gUnknown_2037F1A
_080DFAB8: .4byte gUnknown_2037F1B
_080DFABC:
ldrb r0, [r6]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r1, r0, 24
_080DFAC6:
- ldr r0, _080DFB08 @ =gUnknown_202401C
+ ldr r0, _080DFB08 @ =gMonSpritesGfxPtr
ldr r2, [r0]
lsls r0, r1, 2
adds r2, 0x4
adds r2, r0
- ldr r1, _080DFB0C @ =gUnknown_2024024
+ ldr r1, _080DFB0C @ =gBattleMonForms
ldr r0, _080DFB10 @ =gUnknown_2037F1A
ldrb r0, [r0]
adds r0, r1
@@ -3192,8 +3192,8 @@ _080DFB00:
strh r0, [r1, 0x8]
b _080DFBCE
.align 2, 0
-_080DFB08: .4byte gUnknown_202401C
-_080DFB0C: .4byte gUnknown_2024024
+_080DFB08: .4byte gMonSpritesGfxPtr
+_080DFB0C: .4byte gBattleMonForms
_080DFB10: .4byte gUnknown_2037F1A
_080DFB14: .4byte 0x04000200
_080DFB18: .4byte gTasks
@@ -3258,7 +3258,7 @@ _080DFB8A:
bne _080DFBC8
ldr r4, _080DFBD8 @ =gUnknown_2037F1A
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -3447,7 +3447,7 @@ _080DFD2C: .4byte 0x0000ffc8
_080DFD30:
ldr r0, _080DFD48 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080DFD54
@@ -4091,7 +4091,7 @@ _080E0260: .4byte 0x0000ffc8
_080E0264:
ldr r0, _080E02A4 @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r4, r0, 24
bl sub_8075290
@@ -4176,7 +4176,7 @@ _080E0304:
strh r0, [r5, 0xE]
ldr r0, _080E033C @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -4428,7 +4428,7 @@ _080E04FE:
strh r0, [r4, 0x32]
ldr r0, _080E052C @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080E0530
@@ -4539,7 +4539,7 @@ _080E05E8:
ldr r0, _080E0620 @ =gUnknown_2037F1B
_080E05EA:
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -4756,7 +4756,7 @@ sub_80E0790: @ 80E0790
adds r4, r0, 0
ldr r0, _080E07AC @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0
@@ -4800,7 +4800,7 @@ sub_80E07E0: @ 80E07E0
strh r0, [r4, 0x2E]
ldr r0, _080E0820 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080E0824
@@ -5301,7 +5301,7 @@ _080E0BB2:
cmp r0, 0
bne _080E0BD8
ldrb r0, [r6, 0x1E]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsls r2, r5, 4
cmp r0, 0
@@ -5828,7 +5828,7 @@ sub_80E0FB8: @ 80E0FB8
bl GetAnimBankSpriteId
ldr r0, _080E1040 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080E107C
@@ -5866,7 +5866,7 @@ sub_80E0FB8: @ 80E0FB8
cmp r0, 0
bne _080E1074
adds r0, r2, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080E1054
@@ -5940,7 +5940,7 @@ _080E107C:
cmp r0, 0
bne _080E110C
adds r0, r2, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080E10F4
@@ -6251,7 +6251,7 @@ _080E1326:
movs r0, 0x18
strh r0, [r4, 0x18]
adds r0, r5, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -7020,7 +7020,7 @@ sub_80E1928: @ 80E1928
bl StartSpriteAffineAnim
ldr r0, _080E1984 @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080E194E
@@ -7465,7 +7465,7 @@ sub_80E1C48: @ 80E1C48
strh r0, [r4, 0x14]
_080E1C8C:
ldrb r0, [r2]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080E1CBC
@@ -8019,7 +8019,7 @@ sub_80E20D4: @ 80E20D4
adds r5, r0, 0
ldr r6, _080E212C @ =gUnknown_2037F1A
ldrb r0, [r6]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -8084,7 +8084,7 @@ _080E2152:
_080E2160:
ldr r0, _080E218C @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080E2180
@@ -8158,7 +8158,7 @@ sub_80E21CC: @ 80E21CC
strh r1, [r6, 0x16]
ldr r5, _080E2220 @ =gUnknown_2037F1A
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080E2224
@@ -8697,7 +8697,7 @@ _080E258A:
bl sub_8075068
mov r1, r10
ldrb r0, [r1]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -9651,7 +9651,7 @@ _080E2D40: .4byte 0x0000ffff
_080E2D44:
ldr r0, _080E2D58 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080E2D60
@@ -9916,7 +9916,7 @@ _080E2F3A:
ldrh r0, [r4, 0x3C]
lsls r0, 24
lsrs r0, 24
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -10303,7 +10303,7 @@ sub_80E321C: @ 80E321C
movs r1, 0x3
bl sub_8074480
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080E3258
@@ -10649,7 +10649,7 @@ sub_80E34D0: @ 80E34D0
adds r5, r0, 0
ldr r4, _080E34F4 @ =gUnknown_2037F1B
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080E34FC
@@ -11268,7 +11268,7 @@ _080E3978:
strh r0, [r6, 0xA]
ldr r0, _080E39C8 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
mov r9, r4
cmp r0, 0
@@ -11339,7 +11339,7 @@ _080E3A28: .4byte gTasks
_080E3A2C:
ldr r4, _080E3A90 @ =gUnknown_2037F1A
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080E3ACC
@@ -11561,7 +11561,7 @@ _080E3BEC:
strh r0, [r6, 0xA]
ldr r0, _080E3C3C @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
mov r9, r4
cmp r0, 0
@@ -11618,7 +11618,7 @@ _080E3C5A:
bne _080E3CDA
ldr r0, _080E3CB0 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080E3CB8
@@ -11702,7 +11702,7 @@ _080E3D0C:
bl sub_8076B20
ldr r0, _080E3D60 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
mov r9, r4
cmp r0, 0
@@ -11765,7 +11765,7 @@ _080E3D90:
mov r10, r0
ldrb r0, [r0]
str r2, [sp, 0x18]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
mov r9, r4
ldr r2, [sp, 0x18]
@@ -11911,7 +11911,7 @@ _080E3E96:
strb r0, [r2]
ldr r0, _080E3F20 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -11981,7 +11981,7 @@ _080E3F6A:
strh r0, [r4, 0x32]
ldr r0, _080E3F94 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080E3F98
@@ -12242,7 +12242,7 @@ sub_80E4160: @ 80E4160
strh r0, [r4, 0xE]
ldr r0, _080E41CC @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
movs r2, 0x1
negs r2, r2
@@ -12425,7 +12425,7 @@ sub_80E42DC: @ 80E42DC
adds r4, r0, 0
ldr r0, _080E4330 @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
ldrh r0, [r4, 0x2E]
ldrh r1, [r4, 0x30]
@@ -12469,7 +12469,7 @@ sub_80E4334: @ 80E4334
adds r4, r0, 0
ldr r0, _080E436C @ =gUnknown_2037F1B
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080E4378
diff --git a/asm/battle_anim_80EEC0C.s b/asm/battle_anim_80EEC0C.s
index 84c8c93e2..bb6d8d8d8 100644
--- a/asm/battle_anim_80EEC0C.s
+++ b/asm/battle_anim_80EEC0C.s
@@ -906,7 +906,7 @@ sub_80EF344: @ 80EF344
adds r1, r0, r1
ldrb r1, [r1]
mov r9, r1
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080EF38C
@@ -1376,7 +1376,7 @@ _080EF708:
lsls r4, 24
lsrs r4, 24
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
bl sub_807685C
@@ -1429,7 +1429,7 @@ _080EF708:
ldr r0, _080EF7D8 @ =SpriteCallbackDummy
str r0, [r4]
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _080EF7DC @ =gUnknown_2023D44
lsls r0, 24
lsrs r0, 24
@@ -1475,7 +1475,7 @@ sub_80EF7EC: @ 80EF7EC
lsrs r5, r0, 24
ldr r6, _080EF84C @ =gSprites
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _080EF850 @ =gUnknown_2023D44
lsls r0, 24
lsrs r0, 24
@@ -1532,7 +1532,7 @@ sub_80EF864: @ 80EF864
lsrs r5, r0, 24
ldr r6, _080EF8B8 @ =gSprites
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r4, _080EF8BC @ =gUnknown_2023D44
lsls r0, 24
lsrs r0, 24
@@ -1548,7 +1548,7 @@ sub_80EF864: @ 80EF864
cmp r0, 0
bge _080EF8B0
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
adds r0, r4
@@ -5120,7 +5120,7 @@ _080F1466:
adds r0, r4
strh r0, [r5, 0x8]
ldrb r0, [r3]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080F14A8
@@ -5198,7 +5198,7 @@ _080F150A:
adds r0, r2
strh r0, [r5, 0x8]
ldrb r0, [r3]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080F1540
@@ -5240,7 +5240,7 @@ _080F1558:
strh r1, [r0, 0x8]
ldr r0, _080F1594 @ =gUnknown_2037F1A
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r2, r0, 24
cmp r2, 0
@@ -5745,7 +5745,7 @@ _080F1948:
cmp r0, 0
bne _080F1990
mov r0, r8
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
movs r1, 0x3F
cmp r0, 0
@@ -5986,7 +5986,7 @@ sub_80F1B3C: @ 80F1B3C
movs r0, 0x1E
strh r0, [r4, 0x2E]
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
movs r1, 0
@@ -5998,7 +5998,7 @@ sub_80F1B3C: @ 80F1B3C
adds r0, r1
strh r0, [r4, 0x32]
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
movs r1, 0x1
@@ -6159,7 +6159,7 @@ sub_80F1C8C: @ 80F1C8C
_080F1CA4: .4byte gUnknown_2037F02
_080F1CA8:
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _080F1CB8 @ =gUnknown_2037F1A
strb r0, [r1]
movs r0, 0x1
@@ -6168,12 +6168,12 @@ _080F1CA8:
_080F1CB8: .4byte gUnknown_2037F1A
_080F1CBC:
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _080F1CDC @ =gUnknown_2037F1A
strb r0, [r1]
movs r0, 0
_080F1CC8:
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _080F1CE0 @ =gUnknown_2037F1B
strb r0, [r1]
_080F1CD0:
diff --git a/asm/battle_anim_sound_tasks.s b/asm/battle_anim_sound_tasks.s
index d6e095db4..016e8b093 100644
--- a/asm/battle_anim_sound_tasks.s
+++ b/asm/battle_anim_sound_tasks.s
@@ -375,7 +375,7 @@ _080DD0E0: .4byte gUnknown_2037F1B
_080DD0E4: .4byte gUnknown_2037F02
_080DD0E8:
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080DD10C
@@ -487,7 +487,7 @@ _080DD1BC: .4byte gUnknown_2037F1B
_080DD1C0: .4byte gUnknown_2037F02
_080DD1C4:
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080DD1E8
diff --git a/asm/battle_controller_link_opponent.s b/asm/battle_controller_link_opponent.s
index 405114d91..d5a9b8ae6 100644
--- a/asm/battle_controller_link_opponent.s
+++ b/asm/battle_controller_link_opponent.s
@@ -286,7 +286,7 @@ _0803A888:
ldr r0, _0803A964 @ =gActiveBattler
mov r8, r0
ldrb r0, [r0]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r3, r0, 24
cmp r3, 0x1
@@ -376,7 +376,7 @@ _0803A936:
beq _0803A97C
mov r1, r8
ldrb r0, [r1]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -523,7 +523,7 @@ _0803AA6C:
cmp r0, 0
beq _0803AABA
ldrb r0, [r7]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
@@ -2541,12 +2541,12 @@ _0803BB54:
adds r0, r4, 0
movs r1, 0xB
adds r2, r7, 0
- bl sub_804037C
+ bl SetMonData
adds r2, r7, 0
adds r2, 0x2E
adds r0, r4, 0
movs r1, 0xC
- bl sub_804037C
+ bl SetMonData
movs r0, 0
mov r8, r0
movs r0, 0x3B
@@ -2587,12 +2587,12 @@ _0803BBBA:
adds r1, 0xD
mov r0, r9
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
mov r1, r8
adds r1, 0x11
mov r0, r9
adds r2, r6, 0
- bl sub_804037C
+ bl SetMonData
adds r6, 0x1
adds r4, 0x2
movs r0, 0x1
@@ -2608,15 +2608,15 @@ _0803BBBA:
adds r0, r4, 0
movs r1, 0x15
mov r2, r10
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x20
ldr r2, [sp, 0x20]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x19
ldr r2, [sp, 0x28]
- bl sub_804037C
+ bl SetMonData
ldrb r0, [r7, 0x14]
lsls r0, 27
lsrs r0, 27
@@ -2625,7 +2625,7 @@ _0803BBBA:
adds r0, r4, 0
movs r1, 0x27
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldrh r0, [r7, 0x14]
lsls r0, 22
@@ -2634,7 +2634,7 @@ _0803BBBA:
adds r0, r4, 0
movs r1, 0x28
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldrb r0, [r7, 0x15]
lsls r0, 25
@@ -2643,7 +2643,7 @@ _0803BBBA:
adds r0, r4, 0
movs r1, 0x29
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldr r0, [r7, 0x14]
lsls r0, 12
@@ -2652,7 +2652,7 @@ _0803BBBA:
adds r0, r4, 0
movs r1, 0x2A
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldrh r0, [r7, 0x16]
lsls r0, 23
@@ -2661,7 +2661,7 @@ _0803BBBA:
adds r0, r4, 0
movs r1, 0x2B
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldrb r0, [r7, 0x17]
lsls r0, 26
@@ -2670,47 +2670,47 @@ _0803BBBA:
adds r0, r4, 0
movs r1, 0x2C
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0
ldr r2, [sp, 0x2C]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x37
ldr r2, [sp, 0x30]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x38
ldr r2, [sp, 0x1C]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x39
ldr r2, [sp, 0x18]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3A
ldr r2, [sp, 0x24]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3B
ldr r2, [sp, 0x4]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3C
ldr r2, [sp, 0x8]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3D
ldr r2, [sp, 0xC]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3E
ldr r2, [sp, 0x10]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3F
ldr r2, [sp, 0x14]
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803BCE8: .4byte gEnemyParty
@@ -2723,7 +2723,7 @@ _0803BCEC:
lsls r2, 9
adds r2, r3
movs r1, 0xB
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803BD04: .4byte gEnemyParty
@@ -2736,7 +2736,7 @@ _0803BD08:
lsls r2, 9
adds r2, r3
movs r1, 0xC
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803BD20: .4byte gEnemyParty
@@ -2758,12 +2758,12 @@ _0803BD3C:
adds r1, 0xD
adds r0, r7, 0
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
mov r1, r8
adds r1, 0x11
adds r0, r7, 0
adds r2, r6, 0
- bl sub_804037C
+ bl SetMonData
adds r6, 0x1
adds r4, 0x2
movs r0, 0x1
@@ -2777,7 +2777,7 @@ _0803BD3C:
adds r0, r1
movs r1, 0x15
mov r2, r9
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803BD74: .4byte gEnemyParty
@@ -2809,7 +2809,7 @@ _0803BD98:
adds r0, r4, 0
movs r1, 0x11
str r3, [sp, 0x34]
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r6]
lsls r2, 9
ldr r3, [sp, 0x34]
@@ -2817,7 +2817,7 @@ _0803BD98:
adds r2, r0
adds r0, r4, 0
movs r1, 0x12
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r6]
lsls r2, 9
ldr r3, [sp, 0x34]
@@ -2825,7 +2825,7 @@ _0803BD98:
adds r2, r0
adds r0, r4, 0
movs r1, 0x13
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r6]
lsls r2, 9
ldr r3, [sp, 0x34]
@@ -2833,7 +2833,7 @@ _0803BD98:
adds r2, r0
adds r0, r4, 0
movs r1, 0x14
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r6]
lsls r2, 9
ldr r3, [sp, 0x34]
@@ -2841,7 +2841,7 @@ _0803BD98:
adds r2, r0
adds r0, r4, 0
movs r1, 0x15
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803BDFC: .4byte gEnemyParty
@@ -2860,7 +2860,7 @@ _0803BE00:
_0803BE16:
adds r3, 0x3
adds r2, r3
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803BE20: .4byte gEnemyParty
@@ -2874,7 +2874,7 @@ _0803BE28:
lsls r2, 9
adds r2, r3
movs r1, 0x1
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803BE40: .4byte gEnemyParty
@@ -2887,7 +2887,7 @@ _0803BE44:
lsls r2, 9
adds r2, r3
movs r1, 0x19
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803BE5C: .4byte gEnemyParty
@@ -2900,7 +2900,7 @@ _0803BE60:
lsls r2, 9
adds r2, r3
movs r1, 0x1A
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803BE78: .4byte gEnemyParty
@@ -2913,7 +2913,7 @@ _0803BE7C:
lsls r2, 9
adds r2, r3
movs r1, 0x1B
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803BE94: .4byte gEnemyParty
@@ -2926,7 +2926,7 @@ _0803BE98:
lsls r2, 9
adds r2, r3
movs r1, 0x1C
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803BEB0: .4byte gEnemyParty
@@ -2939,7 +2939,7 @@ _0803BEB4:
lsls r2, 9
adds r2, r3
movs r1, 0x1D
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803BECC: .4byte gEnemyParty
@@ -2952,7 +2952,7 @@ _0803BED0:
lsls r2, 9
adds r2, r3
movs r1, 0x1E
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803BEE8: .4byte gEnemyParty
@@ -2965,7 +2965,7 @@ _0803BEEC:
lsls r2, 9
adds r2, r3
movs r1, 0x1F
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803BF04: .4byte gEnemyParty
@@ -2978,7 +2978,7 @@ _0803BF08:
lsls r2, 9
adds r2, r3
movs r1, 0x20
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803BF20: .4byte gEnemyParty
@@ -2991,7 +2991,7 @@ _0803BF24:
lsls r2, 9
adds r2, r3
movs r1, 0x22
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803BF3C: .4byte gEnemyParty
@@ -3004,7 +3004,7 @@ _0803BF40:
lsls r2, 9
adds r2, r3
movs r1, 0x23
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803BF58: .4byte gEnemyParty
@@ -3017,7 +3017,7 @@ _0803BF5C:
lsls r2, 9
adds r2, r3
movs r1, 0x24
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803BF74: .4byte gEnemyParty
@@ -3030,7 +3030,7 @@ _0803BF78:
lsls r2, 9
adds r2, r3
movs r1, 0x25
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803BF90: .4byte gEnemyParty
@@ -3043,7 +3043,7 @@ _0803BF94:
lsls r2, 9
adds r2, r3
movs r1, 0x26
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803BFAC: .4byte gEnemyParty
@@ -3059,7 +3059,7 @@ _0803BFB0:
adds r0, r4, 0
movs r1, 0x27
str r3, [sp, 0x34]
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r6]
lsls r2, 9
ldr r3, [sp, 0x34]
@@ -3067,7 +3067,7 @@ _0803BFB0:
adds r2, r0
adds r0, r4, 0
movs r1, 0x28
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r6]
lsls r2, 9
ldr r3, [sp, 0x34]
@@ -3075,7 +3075,7 @@ _0803BFB0:
adds r2, r0
adds r0, r4, 0
movs r1, 0x29
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r6]
lsls r2, 9
ldr r3, [sp, 0x34]
@@ -3083,7 +3083,7 @@ _0803BFB0:
adds r2, r0
adds r0, r4, 0
movs r1, 0x2A
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r6]
lsls r2, 9
ldr r3, [sp, 0x34]
@@ -3091,7 +3091,7 @@ _0803BFB0:
adds r2, r0
adds r0, r4, 0
movs r1, 0x2B
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r6]
lsls r2, 9
ldr r3, [sp, 0x34]
@@ -3110,7 +3110,7 @@ _0803C024:
lsls r2, 9
adds r2, r3
movs r1, 0x27
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C03C: .4byte gEnemyParty
@@ -3123,7 +3123,7 @@ _0803C040:
lsls r2, 9
adds r2, r3
movs r1, 0x28
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C058: .4byte gEnemyParty
@@ -3136,7 +3136,7 @@ _0803C05C:
lsls r2, 9
adds r2, r3
movs r1, 0x29
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C074: .4byte gEnemyParty
@@ -3149,7 +3149,7 @@ _0803C078:
lsls r2, 9
adds r2, r3
movs r1, 0x2A
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C090: .4byte gEnemyParty
@@ -3162,7 +3162,7 @@ _0803C094:
lsls r2, 9
adds r2, r3
movs r1, 0x2B
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C0AC: .4byte gEnemyParty
@@ -3176,7 +3176,7 @@ _0803C0B0:
adds r2, r3
_0803C0BE:
movs r1, 0x2C
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C0C8: .4byte gEnemyParty
@@ -3189,7 +3189,7 @@ _0803C0CC:
lsls r2, 9
adds r2, r3
movs r1, 0
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C0E4: .4byte gEnemyParty
@@ -3202,7 +3202,7 @@ _0803C0E8:
lsls r2, 9
adds r2, r3
movs r1, 0x9
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C100: .4byte gEnemyParty
@@ -3215,7 +3215,7 @@ _0803C104:
lsls r2, 9
adds r2, r3
movs r1, 0x37
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C11C: .4byte gEnemyParty
@@ -3228,7 +3228,7 @@ _0803C120:
lsls r2, 9
adds r2, r3
movs r1, 0x38
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C138: .4byte gEnemyParty
@@ -3241,7 +3241,7 @@ _0803C13C:
lsls r2, 9
adds r2, r3
movs r1, 0x39
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C154: .4byte gEnemyParty
@@ -3254,7 +3254,7 @@ _0803C158:
lsls r2, 9
adds r2, r3
movs r1, 0x3A
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C170: .4byte gEnemyParty
@@ -3267,7 +3267,7 @@ _0803C174:
lsls r2, 9
adds r2, r3
movs r1, 0x3B
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C18C: .4byte gEnemyParty
@@ -3280,7 +3280,7 @@ _0803C190:
lsls r2, 9
adds r2, r3
movs r1, 0x3C
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C1A8: .4byte gEnemyParty
@@ -3293,7 +3293,7 @@ _0803C1AC:
lsls r2, 9
adds r2, r3
movs r1, 0x3D
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C1C4: .4byte gEnemyParty
@@ -3306,7 +3306,7 @@ _0803C1C8:
lsls r2, 9
adds r2, r3
movs r1, 0x3E
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C1E0: .4byte gEnemyParty
@@ -3319,7 +3319,7 @@ _0803C1E4:
lsls r2, 9
adds r2, r3
movs r1, 0x3F
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C1FC: .4byte gEnemyParty
@@ -3332,7 +3332,7 @@ _0803C200:
lsls r2, 9
adds r2, r3
movs r1, 0x16
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C218: .4byte gEnemyParty
@@ -3345,7 +3345,7 @@ _0803C21C:
lsls r2, 9
adds r2, r3
movs r1, 0x17
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C234: .4byte gEnemyParty
@@ -3358,7 +3358,7 @@ _0803C238:
lsls r2, 9
adds r2, r3
movs r1, 0x18
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C250: .4byte gEnemyParty
@@ -3371,7 +3371,7 @@ _0803C254:
lsls r2, 9
adds r2, r3
movs r1, 0x21
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C26C: .4byte gEnemyParty
@@ -3384,7 +3384,7 @@ _0803C270:
lsls r2, 9
adds r2, r3
movs r1, 0x2F
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C288: .4byte gEnemyParty
@@ -3397,7 +3397,7 @@ _0803C28C:
lsls r2, 9
adds r2, r3
movs r1, 0x30
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C2A4: .4byte gEnemyParty
@@ -3410,7 +3410,7 @@ _0803C2A8:
lsls r2, 9
adds r2, r3
movs r1, 0x32
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C2C0: .4byte gEnemyParty
@@ -3423,7 +3423,7 @@ _0803C2C4:
lsls r2, 9
adds r2, r3
movs r1, 0x33
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C2DC: .4byte gEnemyParty
@@ -3436,7 +3436,7 @@ _0803C2E0:
lsls r2, 9
adds r2, r3
movs r1, 0x34
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C2F8: .4byte gEnemyParty
@@ -3449,7 +3449,7 @@ _0803C2FC:
lsls r2, 9
adds r2, r3
movs r1, 0x35
- bl sub_804037C
+ bl SetMonData
b _0803C32C
.align 2, 0
_0803C314: .4byte gEnemyParty
@@ -3462,7 +3462,7 @@ _0803C318:
lsls r2, 9
adds r2, r3
movs r1, 0x36
- bl sub_804037C
+ bl SetMonData
_0803C32C:
add sp, 0x38
pop {r3-r5}
@@ -3571,13 +3571,13 @@ LinkOpponentHandleLoadPokeSprite: @ 803C3B4
add r0, r9
bl BattleLoadOpponentMonSpriteGfx
ldrb r0, [r6]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
adds r0, r4, 0
bl sub_803F7D4
- ldr r0, _0803C4E8 @ =gUnknown_20244DC
+ ldr r0, _0803C4E8 @ =gMultiuseSpriteTemplate
mov r8, r0
ldrb r0, [r6]
movs r1, 0x2
@@ -3641,7 +3641,7 @@ LinkOpponentHandleLoadPokeSprite: @ 803C3B4
adds r0, r1
lsls r0, 2
adds r0, r5
- ldr r1, _0803C4F8 @ =gUnknown_2024024
+ ldr r1, _0803C4F8 @ =gBattleMonForms
adds r2, r1
ldrb r1, [r2]
bl StartSpriteAnim
@@ -3677,11 +3677,11 @@ LinkOpponentHandleLoadPokeSprite: @ 803C3B4
_0803C4DC: .4byte gBattlerPartyIndexes
_0803C4E0: .4byte gActiveBattler
_0803C4E4: .4byte gEnemyParty
-_0803C4E8: .4byte gUnknown_20244DC
+_0803C4E8: .4byte gMultiuseSpriteTemplate
_0803C4EC: .4byte gUnknown_2023D44
_0803C4F0: .4byte gSprites
_0803C4F4: .4byte 0x0000ff10
-_0803C4F8: .4byte gUnknown_2024024
+_0803C4F8: .4byte gBattleMonForms
_0803C4FC: .4byte gUnknown_3004FE0
_0803C500: .4byte sub_803AC14
thumb_func_end LinkOpponentHandleLoadPokeSprite
@@ -3775,13 +3775,13 @@ sub_803C550: @ 803C550
adds r1, r6, 0
bl BattleLoadOpponentMonSpriteGfx
adds r0, r6, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
mov r0, r8
bl sub_803F7D4
- ldr r0, _0803C6C0 @ =gUnknown_20244DC
+ ldr r0, _0803C6C0 @ =gMultiuseSpriteTemplate
mov r9, r0
adds r0, r6, 0
movs r1, 0x2
@@ -3844,7 +3844,7 @@ sub_803C550: @ 803C550
adds r0, r1
lsls r0, 2
adds r0, r5
- ldr r1, _0803C6CC @ =gUnknown_2024024
+ ldr r1, _0803C6CC @ =gBattleMonForms
adds r6, r1
ldrb r1, [r6]
bl StartSpriteAnim
@@ -3892,10 +3892,10 @@ _0803C6B0: .4byte gUnknown_2022BC4
_0803C6B4: .4byte gEnemyParty
_0803C6B8: .4byte sub_8033E3C
_0803C6BC: .4byte gUnknown_3004FFC
-_0803C6C0: .4byte gUnknown_20244DC
+_0803C6C0: .4byte gMultiuseSpriteTemplate
_0803C6C4: .4byte gUnknown_2023D44
_0803C6C8: .4byte gSprites
-_0803C6CC: .4byte gUnknown_2024024
+_0803C6CC: .4byte gBattleMonForms
_0803C6D0: .4byte SpriteCallbackDummy
thumb_func_end sub_803C550
@@ -4056,7 +4056,7 @@ sub_803C7F8: @ 803C7F8
beq _0803C8C0
ldr r6, _0803C888 @ =gActiveBattler
ldrb r0, [r6]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x2
ands r1, r0
movs r7, 0xC8
@@ -4066,7 +4066,7 @@ sub_803C7F8: @ 803C7F8
_0803C820:
ldrb r0, [r6]
bl GetBankMultiplayerId
- ldr r5, _0803C88C @ =gUnknown_202273C
+ ldr r5, _0803C88C @ =gLinkPlayers
lsls r1, r0, 3
subs r1, r0
lsls r1, 2
@@ -4097,7 +4097,7 @@ _0803C820:
cmp r4, 0x3
bne _0803C8A0
_0803C866:
- ldr r4, _0803C88C @ =gUnknown_202273C
+ ldr r4, _0803C88C @ =gLinkPlayers
ldr r0, _0803C888 @ =gActiveBattler
ldrb r0, [r0]
bl GetBankMultiplayerId
@@ -4108,20 +4108,20 @@ _0803C866:
ldrb r0, [r1, 0x13]
cmp r0, 0
beq _0803C894
- ldr r0, _0803C890 @ =gUnknown_82538A8
+ ldr r0, _0803C890 @ =gFacilityClassToPicIndex
adds r0, 0x3D
b _0803C990
.align 2, 0
_0803C884: .4byte gBattleTypeFlags
_0803C888: .4byte gActiveBattler
-_0803C88C: .4byte gUnknown_202273C
-_0803C890: .4byte gUnknown_82538A8
+_0803C88C: .4byte gLinkPlayers
+_0803C890: .4byte gFacilityClassToPicIndex
_0803C894:
- ldr r0, _0803C89C @ =gUnknown_82538A8
+ ldr r0, _0803C89C @ =gFacilityClassToPicIndex
adds r0, 0x3A
b _0803C990
.align 2, 0
-_0803C89C: .4byte gUnknown_82538A8
+_0803C89C: .4byte gFacilityClassToPicIndex
_0803C8A0:
ldrb r0, [r6]
bl GetBankMultiplayerId
@@ -4132,11 +4132,11 @@ _0803C8A0:
ldrb r0, [r1, 0x13]
cmp r0, 0
beq _0803C98C
- ldr r0, _0803C8BC @ =gUnknown_82538A8
+ ldr r0, _0803C8BC @ =gFacilityClassToPicIndex
adds r0, 0x87
b _0803C990
.align 2, 0
-_0803C8BC: .4byte gUnknown_82538A8
+_0803C8BC: .4byte gFacilityClassToPicIndex
_0803C8C0:
movs r7, 0xB0
ldr r0, _0803C8D8 @ =gTrainerBattleOpponent_A
@@ -4153,7 +4153,7 @@ _0803C8C0:
_0803C8D8: .4byte gTrainerBattleOpponent_A
_0803C8DC:
bl GetMultiplayerId
- ldr r6, _0803C954 @ =gUnknown_202273C
+ ldr r6, _0803C954 @ =gLinkPlayers
movs r5, 0x1
eors r0, r5
lsls r0, 24
@@ -4192,7 +4192,7 @@ _0803C8DC:
cmp r4, 0x3
bne _0803C968
_0803C930:
- ldr r4, _0803C954 @ =gUnknown_202273C
+ ldr r4, _0803C954 @ =gLinkPlayers
bl GetMultiplayerId
movs r1, 0x1
eors r0, r1
@@ -4205,18 +4205,18 @@ _0803C930:
ldrb r0, [r1, 0x13]
cmp r0, 0
beq _0803C95C
- ldr r0, _0803C958 @ =gUnknown_82538A8
+ ldr r0, _0803C958 @ =gFacilityClassToPicIndex
adds r0, 0x3D
b _0803C990
.align 2, 0
-_0803C954: .4byte gUnknown_202273C
-_0803C958: .4byte gUnknown_82538A8
+_0803C954: .4byte gLinkPlayers
+_0803C958: .4byte gFacilityClassToPicIndex
_0803C95C:
- ldr r0, _0803C964 @ =gUnknown_82538A8
+ ldr r0, _0803C964 @ =gFacilityClassToPicIndex
adds r0, 0x3A
b _0803C990
.align 2, 0
-_0803C964: .4byte gUnknown_82538A8
+_0803C964: .4byte gFacilityClassToPicIndex
_0803C968:
bl GetMultiplayerId
eors r0, r5
@@ -4229,13 +4229,13 @@ _0803C968:
ldrb r0, [r1, 0x13]
cmp r0, 0
beq _0803C98C
- ldr r0, _0803C988 @ =gUnknown_82538A8
+ ldr r0, _0803C988 @ =gFacilityClassToPicIndex
adds r0, 0x87
b _0803C990
.align 2, 0
-_0803C988: .4byte gUnknown_82538A8
+_0803C988: .4byte gFacilityClassToPicIndex
_0803C98C:
- ldr r0, _0803CAC8 @ =gUnknown_82538A8
+ ldr r0, _0803CAC8 @ =gFacilityClassToPicIndex
adds r0, 0x86
_0803C990:
ldrb r0, [r0]
@@ -4248,13 +4248,13 @@ _0803C992:
bl sub_80346C4
mov r1, r8
ldrb r0, [r1]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
mov r0, r9
- bl sub_803F864
- ldr r5, _0803CAD0 @ =gUnknown_20244DC
+ bl SetMultiuseSpriteTemplateToTrainerBack
+ ldr r5, _0803CAD0 @ =gMultiuseSpriteTemplate
adds r6, r7, 0
ldr r1, _0803CAD4 @ =gUnknown_823932C
mov r2, r9
@@ -4388,9 +4388,9 @@ _0803C992:
pop {r0}
bx r0
.align 2, 0
-_0803CAC8: .4byte gUnknown_82538A8
+_0803CAC8: .4byte gFacilityClassToPicIndex
_0803CACC: .4byte gActiveBattler
-_0803CAD0: .4byte gUnknown_20244DC
+_0803CAD0: .4byte gMultiuseSpriteTemplate
_0803CAD4: .4byte gUnknown_823932C
_0803CAD8: .4byte gUnknown_2023D44
_0803CADC: .4byte gSprites
@@ -4969,7 +4969,7 @@ sub_803CF50: @ 803CF50
lsls r0, 24
cmp r0, 0
beq _0803CF98
- ldr r0, _0803CF94 @ =gUnknown_202298C
+ ldr r0, _0803CF94 @ =gDisplayedStringBattle
movs r1, 0x40
bl sub_80D87BC
b _0803CFA0
@@ -4978,9 +4978,9 @@ _0803CF84: .4byte gUnknown_2022974
_0803CF88: .4byte gUnknown_2022976
_0803CF8C: .4byte gActiveBattler
_0803CF90: .4byte gUnknown_2022BC6
-_0803CF94: .4byte gUnknown_202298C
+_0803CF94: .4byte gDisplayedStringBattle
_0803CF98:
- ldr r0, _0803CFB4 @ =gUnknown_202298C
+ ldr r0, _0803CFB4 @ =gDisplayedStringBattle
movs r1, 0
bl sub_80D87BC
_0803CFA0:
@@ -4995,7 +4995,7 @@ _0803CFA0:
pop {r0}
bx r0
.align 2, 0
-_0803CFB4: .4byte gUnknown_202298C
+_0803CFB4: .4byte gDisplayedStringBattle
_0803CFB8: .4byte gUnknown_3004FE0
_0803CFBC: .4byte gActiveBattler
_0803CFC0: .4byte CompleteOnInactiveTextPrinter_5
@@ -5501,7 +5501,7 @@ RecordedOpponentHandlePlaySE: @ 803D370
push {r4,lr}
ldr r4, _0803D3AC @ =gActiveBattler
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
movs r3, 0x3F
cmp r0, 0
@@ -5883,7 +5883,7 @@ RecordedOpponentHandleDrawPartyStatusSummary: @ 803D67C
cmp r0, 0
beq _0803D6AC
adds r0, r2, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _0803D6AC
diff --git a/asm/battle_controller_link_partner.s b/asm/battle_controller_link_partner.s
index 876d380ee..7480e8b12 100644
--- a/asm/battle_controller_link_partner.s
+++ b/asm/battle_controller_link_partner.s
@@ -2244,12 +2244,12 @@ _080D5478:
adds r0, r4, 0
movs r1, 0xB
adds r2, r6, 0
- bl sub_804037C
+ bl SetMonData
adds r2, r6, 0
adds r2, 0x2E
adds r0, r4, 0
movs r1, 0xC
- bl sub_804037C
+ bl SetMonData
movs r0, 0
mov r8, r0
movs r0, 0x3B
@@ -2290,12 +2290,12 @@ _080D54DE:
adds r1, 0xD
mov r0, r9
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
mov r1, r8
adds r1, 0x11
mov r0, r9
adds r2, r7, 0
- bl sub_804037C
+ bl SetMonData
adds r7, 0x1
adds r4, 0x2
movs r0, 0x1
@@ -2311,15 +2311,15 @@ _080D54DE:
adds r0, r4, 0
movs r1, 0x15
mov r2, r10
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x20
ldr r2, [sp, 0x20]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x19
ldr r2, [sp, 0x28]
- bl sub_804037C
+ bl SetMonData
ldrb r0, [r6, 0x14]
lsls r0, 27
lsrs r0, 27
@@ -2328,7 +2328,7 @@ _080D54DE:
adds r0, r4, 0
movs r1, 0x27
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldrh r0, [r6, 0x14]
lsls r0, 22
@@ -2337,7 +2337,7 @@ _080D54DE:
adds r0, r4, 0
movs r1, 0x28
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldrb r0, [r6, 0x15]
lsls r0, 25
@@ -2346,7 +2346,7 @@ _080D54DE:
adds r0, r4, 0
movs r1, 0x29
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldr r0, [r6, 0x14]
lsls r0, 12
@@ -2355,7 +2355,7 @@ _080D54DE:
adds r0, r4, 0
movs r1, 0x2A
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldrh r0, [r6, 0x16]
lsls r0, 23
@@ -2364,7 +2364,7 @@ _080D54DE:
adds r0, r4, 0
movs r1, 0x2B
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldrb r0, [r6, 0x17]
lsls r0, 26
@@ -2373,47 +2373,47 @@ _080D54DE:
adds r0, r4, 0
movs r1, 0x2C
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0
ldr r2, [sp, 0x2C]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x37
ldr r2, [sp, 0x30]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x38
ldr r2, [sp, 0x1C]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x39
ldr r2, [sp, 0x18]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3A
ldr r2, [sp, 0x24]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3B
ldr r2, [sp, 0x4]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3C
ldr r2, [sp, 0x8]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3D
ldr r2, [sp, 0xC]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3E
ldr r2, [sp, 0x10]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3F
ldr r2, [sp, 0x14]
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D560C: .4byte gPlayerParty
@@ -2427,7 +2427,7 @@ _080D5610:
lsls r2, 9
adds r2, r7
movs r1, 0xB
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5628: .4byte gPlayerParty
@@ -2442,7 +2442,7 @@ _080D5630:
lsls r2, 9
adds r2, r7
movs r1, 0xC
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5648: .4byte gPlayerParty
@@ -2466,12 +2466,12 @@ _080D566A:
adds r1, 0xD
adds r0, r7, 0
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
mov r1, r8
adds r1, 0x11
adds r0, r7, 0
adds r2, r6, 0
- bl sub_804037C
+ bl SetMonData
adds r6, 0x1
adds r4, 0x2
movs r0, 0x1
@@ -2485,7 +2485,7 @@ _080D566A:
adds r0, r1
movs r1, 0x15
mov r2, r9
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D56A4: .4byte gPlayerParty
@@ -2519,35 +2519,35 @@ _080D56D0:
adds r2, r7
adds r0, r4, 0
movs r1, 0x11
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x1
adds r2, r0
adds r0, r4, 0
movs r1, 0x12
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x2
adds r2, r0
adds r0, r4, 0
movs r1, 0x13
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x3
adds r2, r0
adds r0, r4, 0
movs r1, 0x14
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x4
adds r2, r0
adds r0, r4, 0
movs r1, 0x15
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D572C: .4byte gPlayerParty
@@ -2568,7 +2568,7 @@ _080D5734:
_080D574C:
adds r3, 0x3
adds r2, r3
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5758: .4byte gPlayerParty
@@ -2584,7 +2584,7 @@ _080D5764:
lsls r2, 9
adds r2, r7
movs r1, 0x1
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D577C: .4byte gPlayerParty
@@ -2599,7 +2599,7 @@ _080D5784:
lsls r2, 9
adds r2, r7
movs r1, 0x19
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D579C: .4byte gPlayerParty
@@ -2614,7 +2614,7 @@ _080D57A4:
lsls r2, 9
adds r2, r7
movs r1, 0x1A
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D57BC: .4byte gPlayerParty
@@ -2629,7 +2629,7 @@ _080D57C4:
lsls r2, 9
adds r2, r7
movs r1, 0x1B
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D57DC: .4byte gPlayerParty
@@ -2644,7 +2644,7 @@ _080D57E4:
lsls r2, 9
adds r2, r7
movs r1, 0x1C
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D57FC: .4byte gPlayerParty
@@ -2659,7 +2659,7 @@ _080D5804:
lsls r2, 9
adds r2, r7
movs r1, 0x1D
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D581C: .4byte gPlayerParty
@@ -2674,7 +2674,7 @@ _080D5824:
lsls r2, 9
adds r2, r7
movs r1, 0x1E
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D583C: .4byte gPlayerParty
@@ -2689,7 +2689,7 @@ _080D5844:
lsls r2, 9
adds r2, r7
movs r1, 0x1F
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D585C: .4byte gPlayerParty
@@ -2704,7 +2704,7 @@ _080D5864:
lsls r2, 9
adds r2, r7
movs r1, 0x20
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D587C: .4byte gPlayerParty
@@ -2719,7 +2719,7 @@ _080D5884:
lsls r2, 9
adds r2, r7
movs r1, 0x22
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D589C: .4byte gPlayerParty
@@ -2734,7 +2734,7 @@ _080D58A4:
lsls r2, 9
adds r2, r7
movs r1, 0x23
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D58BC: .4byte gPlayerParty
@@ -2749,7 +2749,7 @@ _080D58C4:
lsls r2, 9
adds r2, r7
movs r1, 0x24
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D58DC: .4byte gPlayerParty
@@ -2764,7 +2764,7 @@ _080D58E4:
lsls r2, 9
adds r2, r7
movs r1, 0x25
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D58FC: .4byte gPlayerParty
@@ -2779,7 +2779,7 @@ _080D5904:
lsls r2, 9
adds r2, r7
movs r1, 0x26
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D591C: .4byte gPlayerParty
@@ -2796,35 +2796,35 @@ _080D5924:
adds r2, r7
adds r0, r4, 0
movs r1, 0x27
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x1
adds r2, r0
adds r0, r4, 0
movs r1, 0x28
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x2
adds r2, r0
adds r0, r4, 0
movs r1, 0x29
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x3
adds r2, r0
adds r0, r4, 0
movs r1, 0x2A
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x4
adds r2, r0
adds r0, r4, 0
movs r1, 0x2B
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x5
@@ -2844,7 +2844,7 @@ _080D5994:
lsls r2, 9
adds r2, r7
movs r1, 0x27
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D59AC: .4byte gPlayerParty
@@ -2859,7 +2859,7 @@ _080D59B4:
lsls r2, 9
adds r2, r7
movs r1, 0x28
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D59CC: .4byte gPlayerParty
@@ -2874,7 +2874,7 @@ _080D59D4:
lsls r2, 9
adds r2, r7
movs r1, 0x29
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D59EC: .4byte gPlayerParty
@@ -2889,7 +2889,7 @@ _080D59F4:
lsls r2, 9
adds r2, r7
movs r1, 0x2A
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5A0C: .4byte gPlayerParty
@@ -2904,7 +2904,7 @@ _080D5A14:
lsls r2, 9
adds r2, r7
movs r1, 0x2B
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5A2C: .4byte gPlayerParty
@@ -2920,7 +2920,7 @@ _080D5A34:
adds r2, r7
_080D5A44:
movs r1, 0x2C
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5A4C: .4byte gPlayerParty
@@ -2935,7 +2935,7 @@ _080D5A54:
lsls r2, 9
adds r2, r7
movs r1, 0
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5A6C: .4byte gPlayerParty
@@ -2950,7 +2950,7 @@ _080D5A74:
lsls r2, 9
adds r2, r7
movs r1, 0x9
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5A8C: .4byte gPlayerParty
@@ -2965,7 +2965,7 @@ _080D5A94:
lsls r2, 9
adds r2, r7
movs r1, 0x37
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5AAC: .4byte gPlayerParty
@@ -2980,7 +2980,7 @@ _080D5AB4:
lsls r2, 9
adds r2, r7
movs r1, 0x38
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5ACC: .4byte gPlayerParty
@@ -2995,7 +2995,7 @@ _080D5AD4:
lsls r2, 9
adds r2, r7
movs r1, 0x39
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5AEC: .4byte gPlayerParty
@@ -3010,7 +3010,7 @@ _080D5AF4:
lsls r2, 9
adds r2, r7
movs r1, 0x3A
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5B0C: .4byte gPlayerParty
@@ -3025,7 +3025,7 @@ _080D5B14:
lsls r2, 9
adds r2, r7
movs r1, 0x3B
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5B2C: .4byte gPlayerParty
@@ -3040,7 +3040,7 @@ _080D5B34:
lsls r2, 9
adds r2, r7
movs r1, 0x3C
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5B4C: .4byte gPlayerParty
@@ -3055,7 +3055,7 @@ _080D5B54:
lsls r2, 9
adds r2, r7
movs r1, 0x3D
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5B6C: .4byte gPlayerParty
@@ -3070,7 +3070,7 @@ _080D5B74:
lsls r2, 9
adds r2, r7
movs r1, 0x3E
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5B8C: .4byte gPlayerParty
@@ -3085,7 +3085,7 @@ _080D5B94:
lsls r2, 9
adds r2, r7
movs r1, 0x3F
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5BAC: .4byte gPlayerParty
@@ -3100,7 +3100,7 @@ _080D5BB4:
lsls r2, 9
adds r2, r7
movs r1, 0x16
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5BCC: .4byte gPlayerParty
@@ -3115,7 +3115,7 @@ _080D5BD4:
lsls r2, 9
adds r2, r7
movs r1, 0x17
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5BEC: .4byte gPlayerParty
@@ -3130,7 +3130,7 @@ _080D5BF4:
lsls r2, 9
adds r2, r7
movs r1, 0x18
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5C0C: .4byte gPlayerParty
@@ -3145,7 +3145,7 @@ _080D5C14:
lsls r2, 9
adds r2, r7
movs r1, 0x21
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5C2C: .4byte gPlayerParty
@@ -3160,7 +3160,7 @@ _080D5C34:
lsls r2, 9
adds r2, r7
movs r1, 0x2F
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5C4C: .4byte gPlayerParty
@@ -3175,7 +3175,7 @@ _080D5C54:
lsls r2, 9
adds r2, r7
movs r1, 0x30
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5C6C: .4byte gPlayerParty
@@ -3190,7 +3190,7 @@ _080D5C74:
lsls r2, 9
adds r2, r7
movs r1, 0x32
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5C8C: .4byte gPlayerParty
@@ -3205,7 +3205,7 @@ _080D5C94:
lsls r2, 9
adds r2, r7
movs r1, 0x33
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5CAC: .4byte gPlayerParty
@@ -3220,7 +3220,7 @@ _080D5CB4:
lsls r2, 9
adds r2, r7
movs r1, 0x34
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5CCC: .4byte gPlayerParty
@@ -3235,7 +3235,7 @@ _080D5CD4:
lsls r2, 9
adds r2, r7
movs r1, 0x35
- bl sub_804037C
+ bl SetMonData
b _080D5D0A
.align 2, 0
_080D5CEC: .4byte gPlayerParty
@@ -3250,7 +3250,7 @@ _080D5CF4:
lsls r2, 9
adds r2, r7
movs r1, 0x36
- bl sub_804037C
+ bl SetMonData
_080D5D0A:
ldr r2, _080D5D3C @ =gBattlerPartyIndexes
ldr r0, _080D5D38 @ =gActiveBattler
@@ -3365,13 +3365,13 @@ LinkPartnerHandleLoadPokeSprite: @ 80D5DB4
lsls r4, 16
lsrs r4, 16
ldrb r0, [r6]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
adds r0, r4, 0
bl sub_803F7D4
- ldr r0, _080D5EB4 @ =gUnknown_20244DC
+ ldr r0, _080D5EB4 @ =gMultiuseSpriteTemplate
mov r8, r0
ldrb r0, [r6]
movs r1, 0x2
@@ -3435,7 +3435,7 @@ LinkPartnerHandleLoadPokeSprite: @ 80D5DB4
adds r0, r1
lsls r0, 2
adds r0, r5
- ldr r1, _080D5EC4 @ =gUnknown_2024024
+ ldr r1, _080D5EC4 @ =gBattleMonForms
adds r2, r1
ldrb r1, [r2]
bl StartSpriteAnim
@@ -3454,11 +3454,11 @@ LinkPartnerHandleLoadPokeSprite: @ 80D5DB4
_080D5EA8: .4byte gBattlerPartyIndexes
_080D5EAC: .4byte gActiveBattler
_080D5EB0: .4byte gPlayerParty
-_080D5EB4: .4byte gUnknown_20244DC
+_080D5EB4: .4byte gMultiuseSpriteTemplate
_080D5EB8: .4byte gUnknown_2023D44
_080D5EBC: .4byte gSprites
_080D5EC0: .4byte 0x0000ff10
-_080D5EC4: .4byte gUnknown_2024024
+_080D5EC4: .4byte gBattleMonForms
_080D5EC8: .4byte gUnknown_3004FE0
_080D5ECC: .4byte sub_80D4590
thumb_func_end LinkPartnerHandleLoadPokeSprite
@@ -3557,13 +3557,13 @@ sub_80D5F40: @ 80D5F40
mov r1, r9
strb r0, [r1]
adds r0, r6, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
mov r0, r8
bl sub_803F7D4
- ldr r0, _080D6098 @ =gUnknown_20244DC
+ ldr r0, _080D6098 @ =gMultiuseSpriteTemplate
mov r10, r0
adds r0, r6, 0
movs r1, 0x2
@@ -3626,7 +3626,7 @@ sub_80D5F40: @ 80D5F40
adds r0, r1
lsls r0, 2
adds r0, r5
- ldr r1, _080D60A4 @ =gUnknown_2024024
+ ldr r1, _080D60A4 @ =gBattleMonForms
adds r6, r1
ldrb r1, [r6]
bl StartSpriteAnim
@@ -3674,10 +3674,10 @@ _080D6088: .4byte gUnknown_2022BC4
_080D608C: .4byte gPlayerParty
_080D6090: .4byte sub_8033E3C
_080D6094: .4byte gUnknown_3004FFC
-_080D6098: .4byte gUnknown_20244DC
+_080D6098: .4byte gMultiuseSpriteTemplate
_080D609C: .4byte gUnknown_2023D44
_080D60A0: .4byte gSprites
-_080D60A4: .4byte gUnknown_2024024
+_080D60A4: .4byte gBattleMonForms
_080D60A8: .4byte SpriteCallbackDummy
thumb_func_end sub_80D5F40
@@ -3829,7 +3829,7 @@ sub_80D61C8: @ 80D61C8
push {r7}
ldr r6, _080D6240 @ =gActiveBattler
ldrb r0, [r6]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x2
ands r1, r0
movs r7, 0x20
@@ -3839,7 +3839,7 @@ sub_80D61C8: @ 80D61C8
_080D61E2:
ldrb r0, [r6]
bl GetBankMultiplayerId
- ldr r5, _080D6244 @ =gUnknown_202273C
+ ldr r5, _080D6244 @ =gLinkPlayers
lsls r1, r0, 3
subs r1, r0
lsls r1, 2
@@ -3873,7 +3873,7 @@ _080D6228:
ldr r0, _080D6240 @ =gActiveBattler
ldrb r0, [r0]
bl GetBankMultiplayerId
- ldr r2, _080D6244 @ =gUnknown_202273C
+ ldr r2, _080D6244 @ =gLinkPlayers
lsls r1, r0, 3
subs r1, r0
lsls r1, 2
@@ -3883,7 +3883,7 @@ _080D6228:
b _080D6258
.align 2, 0
_080D6240: .4byte gActiveBattler
-_080D6244: .4byte gUnknown_202273C
+_080D6244: .4byte gLinkPlayers
_080D6248:
ldrb r0, [r6]
bl GetBankMultiplayerId
@@ -3898,13 +3898,13 @@ _080D6258:
adds r0, r4, 0
bl sub_8034750
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
adds r0, r4, 0
- bl sub_803F864
- ldr r6, _080D631C @ =gUnknown_20244DC
+ bl SetMultiuseSpriteTemplateToTrainerBack
+ ldr r6, _080D631C @ =gMultiuseSpriteTemplate
mov r8, r7
ldr r0, _080D6320 @ =gUnknown_8239F8C
lsls r4, 2
@@ -3985,7 +3985,7 @@ _080D6258:
bx r0
.align 2, 0
_080D6318: .4byte gActiveBattler
-_080D631C: .4byte gUnknown_20244DC
+_080D631C: .4byte gMultiuseSpriteTemplate
_080D6320: .4byte gUnknown_8239F8C
_080D6324: .4byte gUnknown_2023D44
_080D6328: .4byte gSprites
@@ -4590,7 +4590,7 @@ sub_80D67CC: @ 80D67CC
lsls r0, 24
cmp r0, 0
beq _080D6814
- ldr r0, _080D6810 @ =gUnknown_202298C
+ ldr r0, _080D6810 @ =gDisplayedStringBattle
movs r1, 0x40
bl sub_80D87BC
b _080D681C
@@ -4599,9 +4599,9 @@ _080D6800: .4byte gUnknown_2022974
_080D6804: .4byte gUnknown_2022976
_080D6808: .4byte gActiveBattler
_080D680C: .4byte gUnknown_2022BC6
-_080D6810: .4byte gUnknown_202298C
+_080D6810: .4byte gDisplayedStringBattle
_080D6814:
- ldr r0, _080D6830 @ =gUnknown_202298C
+ ldr r0, _080D6830 @ =gDisplayedStringBattle
movs r1, 0
bl sub_80D87BC
_080D681C:
@@ -4616,7 +4616,7 @@ _080D681C:
pop {r0}
bx r0
.align 2, 0
-_080D6830: .4byte gUnknown_202298C
+_080D6830: .4byte gDisplayedStringBattle
_080D6834: .4byte gUnknown_3004FE0
_080D6838: .4byte gActiveBattler
_080D683C: .4byte sub_80D4718
@@ -5122,7 +5122,7 @@ LinkPartnerHandleEffectivenessSound: @ 80D6BEC
push {r4,lr}
ldr r4, _080D6C28 @ =gActiveBattler
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
movs r3, 0x3F
cmp r0, 0
@@ -5315,7 +5315,7 @@ sub_80D6CD4: @ 80D6CD4
lsrs r7, r0, 24
ldrb r0, [r6]
bl GetBankMultiplayerId
- ldr r4, _080D6DF8 @ =gUnknown_202273C
+ ldr r4, _080D6DF8 @ =gLinkPlayers
lsls r1, r0, 3
subs r1, r0
lsls r1, 2
@@ -5349,7 +5349,7 @@ _080D6DC2:
ldr r0, _080D6DE0 @ =gActiveBattler
ldrb r0, [r0]
bl GetBankMultiplayerId
- ldr r2, _080D6DF8 @ =gUnknown_202273C
+ ldr r2, _080D6DF8 @ =gLinkPlayers
lsls r1, r0, 3
subs r1, r0
lsls r1, 2
@@ -5365,7 +5365,7 @@ _080D6DE8: .4byte 0x0000ffd8
_080D6DEC: .4byte sub_8075590
_080D6DF0: .4byte sub_80335F8
_080D6DF4: .4byte 0x0000d6f9
-_080D6DF8: .4byte gUnknown_202273C
+_080D6DF8: .4byte gLinkPlayers
_080D6DFC:
ldrb r0, [r6]
bl GetBankMultiplayerId
@@ -5605,7 +5605,7 @@ sub_80D6FDC: @ 80D6FDC
cmp r0, 0
beq _080D700C
adds r0, r2, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080D700C
diff --git a/asm/battle_controller_oak.s b/asm/battle_controller_oak.s
index b5905ade8..16fb18cdf 100644
--- a/asm/battle_controller_oak.s
+++ b/asm/battle_controller_oak.s
@@ -275,13 +275,13 @@ _080E77AC:
cmp r0, 0
beq _080E7838
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x2
bne _080E7838
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _080E7824 @ =gAbsentBattlerFlags
ldrb r1, [r1]
ldr r2, _080E7828 @ =gBitTable
@@ -1104,7 +1104,7 @@ _080E7E4A:
movs r1, 0x19
bl GetMonData
str r0, [sp, 0x4]
- ldr r3, _080E7F10 @ =gUnknown_8253AE4
+ ldr r3, _080E7F10 @ =gExperienceTables
adds r4, 0x1
lsls r4, 2
ldr r2, _080E7F14 @ =gBaseStats
@@ -1129,7 +1129,7 @@ _080E7E4A:
adds r0, r6, 0
movs r1, 0x19
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
bl CalculateMonStats
ldr r2, [sp]
@@ -1173,7 +1173,7 @@ _080E7EFE:
_080E7F04: .4byte gTasks
_080E7F08: .4byte gBattlerPartyIndexes
_080E7F0C: .4byte gPlayerParty
-_080E7F10: .4byte gUnknown_8253AE4
+_080E7F10: .4byte gExperienceTables
_080E7F14: .4byte gBaseStats
_080E7F18: .4byte gActiveBattler
_080E7F1C: .4byte sub_80E8190
@@ -1194,7 +1194,7 @@ _080E7F38:
add r2, sp, 0x4
adds r0, r6, 0
movs r1, 0x19
- bl sub_804037C
+ bl SetMonData
ldr r1, _080E7F58 @ =gUnknown_3004FE0
ldr r3, [sp, 0x8]
lsls r0, r3, 2
@@ -1273,7 +1273,7 @@ sub_80E7F7C: @ 80E7F7C
movs r1, 0x19
bl GetMonData
adds r3, r0, 0
- ldr r6, _080E803C @ =gUnknown_8253AE4
+ ldr r6, _080E803C @ =gExperienceTables
lsls r1, r4, 2
ldr r2, _080E8040 @ =gBaseStats
lsls r0, r5, 3
@@ -1318,7 +1318,7 @@ sub_80E7F7C: @ 80E7F7C
.align 2, 0
_080E8034: .4byte gTasks
_080E8038: .4byte gPlayerParty
-_080E803C: .4byte gUnknown_8253AE4
+_080E803C: .4byte gExperienceTables
_080E8040: .4byte gBaseStats
_080E8044: .4byte gUnknown_3004FF0
_080E8048: .4byte sub_80E804C
@@ -1396,7 +1396,7 @@ _080E807C:
bl GetMonData
lsls r0, 16
lsrs r0, 16
- ldr r3, _080E814C @ =gUnknown_8253AE4
+ ldr r3, _080E814C @ =gExperienceTables
adds r4, 0x1
lsls r4, 2
ldr r2, _080E8150 @ =gBaseStats
@@ -1422,7 +1422,7 @@ _080E807C:
adds r0, r5, 0
movs r1, 0x19
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r5, 0
bl CalculateMonStats
ldr r2, [sp]
@@ -1445,7 +1445,7 @@ _080E807C:
.align 2, 0
_080E8144: .4byte gUnknown_3004FF0
_080E8148: .4byte gPlayerParty
-_080E814C: .4byte gUnknown_8253AE4
+_080E814C: .4byte gExperienceTables
_080E8150: .4byte gBaseStats
_080E8154: .4byte gActiveBattler
_080E8158: .4byte sub_80E8190
@@ -1454,7 +1454,7 @@ _080E815C:
add r2, sp, 0x4
adds r0, r5, 0
movs r1, 0x19
- bl sub_804037C
+ bl SetMonData
ldr r1, _080E8188 @ =gUnknown_3004FE0
lsls r0, r7, 2
adds r0, r1
@@ -1746,7 +1746,7 @@ _080E83BA:
adds r5, 0x95
adds r4, 0x97
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r2, r0, 0
lsls r2, 24
lsrs r2, 24
@@ -1780,13 +1780,13 @@ _080E8404: .4byte gUnknown_2037AB8
_080E8408:
ldr r0, _080E8418 @ =gUnknown_83FDAE2
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r0, _080E841C @ =gUnknown_202298C
+ ldr r0, _080E841C @ =gDisplayedStringBattle
movs r1, 0x18
bl sub_80D87BC
b _080E851E
.align 2, 0
_080E8418: .4byte gUnknown_83FDAE2
-_080E841C: .4byte gUnknown_202298C
+_080E841C: .4byte gDisplayedStringBattle
_080E8420:
movs r0, 0x18
bl IsTextPrinterActive
@@ -1831,14 +1831,14 @@ _080E8468:
bne _080E855E
ldr r0, _080E8488 @ =gUnknown_83FDB92
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r0, _080E848C @ =gUnknown_202298C
+ ldr r0, _080E848C @ =gDisplayedStringBattle
movs r1, 0x18
bl sub_80D87BC
b _080E851E
.align 2, 0
_080E8484: .4byte gUnknown_2037AB8
_080E8488: .4byte gUnknown_83FDB92
-_080E848C: .4byte gUnknown_202298C
+_080E848C: .4byte gDisplayedStringBattle
_080E8490:
movs r0, 0x18
bl IsTextPrinterActive
@@ -1881,14 +1881,14 @@ _080E84D8:
bne _080E855E
ldr r0, _080E84F8 @ =gUnknown_83FDBEF
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r0, _080E84FC @ =gUnknown_202298C
+ ldr r0, _080E84FC @ =gDisplayedStringBattle
movs r1, 0x18
bl sub_80D87BC
b _080E851E
.align 2, 0
_080E84F4: .4byte gUnknown_2037AB8
_080E84F8: .4byte gUnknown_83FDBEF
-_080E84FC: .4byte gUnknown_202298C
+_080E84FC: .4byte gDisplayedStringBattle
_080E8500:
movs r0, 0x18
bl IsTextPrinterActive
@@ -1924,7 +1924,7 @@ _080E8530:
cmp r4, 0
bne _080E855E
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
bl sub_80EF0E0
@@ -2083,12 +2083,12 @@ _080E866C: .4byte gUnknown_2037AB8
_080E8670:
adds r0, r2, 0
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r0, _080E8680 @ =gUnknown_202298C
+ ldr r0, _080E8680 @ =gDisplayedStringBattle
movs r1, 0x18
bl sub_80D87BC
b _080E86A2
.align 2, 0
-_080E8680: .4byte gUnknown_202298C
+_080E8680: .4byte gDisplayedStringBattle
_080E8684:
movs r0, 0x18
bl IsTextPrinterActive
@@ -2124,7 +2124,7 @@ _080E86B4:
bl sub_80EB524
ldr r0, _080E86DC @ =gActiveBattler
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080E86E0
@@ -2263,13 +2263,13 @@ _080E87E4: .4byte gUnknown_2037AB8
_080E87E8:
ldr r0, _080E87F8 @ =gUnknown_83FDCD2
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r0, _080E87FC @ =gUnknown_202298C
+ ldr r0, _080E87FC @ =gDisplayedStringBattle
movs r1, 0x18
bl sub_80D87BC
b _080E8868
.align 2, 0
_080E87F8: .4byte gUnknown_83FDCD2
-_080E87FC: .4byte gUnknown_202298C
+_080E87FC: .4byte gDisplayedStringBattle
_080E8800:
movs r0, 0x18
bl IsTextPrinterActive
@@ -3833,12 +3833,12 @@ _080E94FC:
adds r0, r4, 0
movs r1, 0xB
adds r2, r6, 0
- bl sub_804037C
+ bl SetMonData
adds r2, r6, 0
adds r2, 0x2E
adds r0, r4, 0
movs r1, 0xC
- bl sub_804037C
+ bl SetMonData
movs r0, 0
mov r8, r0
movs r0, 0x3B
@@ -3879,12 +3879,12 @@ _080E9562:
adds r1, 0xD
mov r0, r9
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
mov r1, r8
adds r1, 0x11
mov r0, r9
adds r2, r7, 0
- bl sub_804037C
+ bl SetMonData
adds r7, 0x1
adds r4, 0x2
movs r0, 0x1
@@ -3900,15 +3900,15 @@ _080E9562:
adds r0, r4, 0
movs r1, 0x15
mov r2, r10
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x20
ldr r2, [sp, 0x20]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x19
ldr r2, [sp, 0x28]
- bl sub_804037C
+ bl SetMonData
ldrb r0, [r6, 0x14]
lsls r0, 27
lsrs r0, 27
@@ -3917,7 +3917,7 @@ _080E9562:
adds r0, r4, 0
movs r1, 0x27
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldrh r0, [r6, 0x14]
lsls r0, 22
@@ -3926,7 +3926,7 @@ _080E9562:
adds r0, r4, 0
movs r1, 0x28
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldrb r0, [r6, 0x15]
lsls r0, 25
@@ -3935,7 +3935,7 @@ _080E9562:
adds r0, r4, 0
movs r1, 0x29
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldr r0, [r6, 0x14]
lsls r0, 12
@@ -3944,7 +3944,7 @@ _080E9562:
adds r0, r4, 0
movs r1, 0x2A
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldrh r0, [r6, 0x16]
lsls r0, 23
@@ -3953,7 +3953,7 @@ _080E9562:
adds r0, r4, 0
movs r1, 0x2B
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldrb r0, [r6, 0x17]
lsls r0, 26
@@ -3962,47 +3962,47 @@ _080E9562:
adds r0, r4, 0
movs r1, 0x2C
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0
ldr r2, [sp, 0x2C]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x37
ldr r2, [sp, 0x30]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x38
ldr r2, [sp, 0x1C]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x39
ldr r2, [sp, 0x18]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3A
ldr r2, [sp, 0x24]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3B
ldr r2, [sp, 0x4]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3C
ldr r2, [sp, 0x8]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3D
ldr r2, [sp, 0xC]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3E
ldr r2, [sp, 0x10]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3F
ldr r2, [sp, 0x14]
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9690: .4byte gPlayerParty
@@ -4016,7 +4016,7 @@ _080E9694:
lsls r2, 9
adds r2, r7
movs r1, 0xB
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E96AC: .4byte gPlayerParty
@@ -4031,7 +4031,7 @@ _080E96B4:
lsls r2, 9
adds r2, r7
movs r1, 0xC
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E96CC: .4byte gPlayerParty
@@ -4055,12 +4055,12 @@ _080E96EE:
adds r1, 0xD
adds r0, r7, 0
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
mov r1, r8
adds r1, 0x11
adds r0, r7, 0
adds r2, r6, 0
- bl sub_804037C
+ bl SetMonData
adds r6, 0x1
adds r4, 0x2
movs r0, 0x1
@@ -4074,7 +4074,7 @@ _080E96EE:
adds r0, r1
movs r1, 0x15
mov r2, r9
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9728: .4byte gPlayerParty
@@ -4108,35 +4108,35 @@ _080E9754:
adds r2, r7
adds r0, r4, 0
movs r1, 0x11
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x1
adds r2, r0
adds r0, r4, 0
movs r1, 0x12
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x2
adds r2, r0
adds r0, r4, 0
movs r1, 0x13
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x3
adds r2, r0
adds r0, r4, 0
movs r1, 0x14
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x4
adds r2, r0
adds r0, r4, 0
movs r1, 0x15
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E97B0: .4byte gPlayerParty
@@ -4157,7 +4157,7 @@ _080E97B8:
_080E97D0:
adds r3, 0x3
adds r2, r3
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E97DC: .4byte gPlayerParty
@@ -4173,7 +4173,7 @@ _080E97E8:
lsls r2, 9
adds r2, r7
movs r1, 0x1
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9800: .4byte gPlayerParty
@@ -4188,7 +4188,7 @@ _080E9808:
lsls r2, 9
adds r2, r7
movs r1, 0x19
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9820: .4byte gPlayerParty
@@ -4203,7 +4203,7 @@ _080E9828:
lsls r2, 9
adds r2, r7
movs r1, 0x1A
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9840: .4byte gPlayerParty
@@ -4218,7 +4218,7 @@ _080E9848:
lsls r2, 9
adds r2, r7
movs r1, 0x1B
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9860: .4byte gPlayerParty
@@ -4233,7 +4233,7 @@ _080E9868:
lsls r2, 9
adds r2, r7
movs r1, 0x1C
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9880: .4byte gPlayerParty
@@ -4248,7 +4248,7 @@ _080E9888:
lsls r2, 9
adds r2, r7
movs r1, 0x1D
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E98A0: .4byte gPlayerParty
@@ -4263,7 +4263,7 @@ _080E98A8:
lsls r2, 9
adds r2, r7
movs r1, 0x1E
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E98C0: .4byte gPlayerParty
@@ -4278,7 +4278,7 @@ _080E98C8:
lsls r2, 9
adds r2, r7
movs r1, 0x1F
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E98E0: .4byte gPlayerParty
@@ -4293,7 +4293,7 @@ _080E98E8:
lsls r2, 9
adds r2, r7
movs r1, 0x20
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9900: .4byte gPlayerParty
@@ -4308,7 +4308,7 @@ _080E9908:
lsls r2, 9
adds r2, r7
movs r1, 0x22
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9920: .4byte gPlayerParty
@@ -4323,7 +4323,7 @@ _080E9928:
lsls r2, 9
adds r2, r7
movs r1, 0x23
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9940: .4byte gPlayerParty
@@ -4338,7 +4338,7 @@ _080E9948:
lsls r2, 9
adds r2, r7
movs r1, 0x24
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9960: .4byte gPlayerParty
@@ -4353,7 +4353,7 @@ _080E9968:
lsls r2, 9
adds r2, r7
movs r1, 0x25
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9980: .4byte gPlayerParty
@@ -4368,7 +4368,7 @@ _080E9988:
lsls r2, 9
adds r2, r7
movs r1, 0x26
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E99A0: .4byte gPlayerParty
@@ -4385,35 +4385,35 @@ _080E99A8:
adds r2, r7
adds r0, r4, 0
movs r1, 0x27
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x1
adds r2, r0
adds r0, r4, 0
movs r1, 0x28
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x2
adds r2, r0
adds r0, r4, 0
movs r1, 0x29
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x3
adds r2, r0
adds r0, r4, 0
movs r1, 0x2A
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x4
adds r2, r0
adds r0, r4, 0
movs r1, 0x2B
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x5
@@ -4433,7 +4433,7 @@ _080E9A18:
lsls r2, 9
adds r2, r7
movs r1, 0x27
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9A30: .4byte gPlayerParty
@@ -4448,7 +4448,7 @@ _080E9A38:
lsls r2, 9
adds r2, r7
movs r1, 0x28
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9A50: .4byte gPlayerParty
@@ -4463,7 +4463,7 @@ _080E9A58:
lsls r2, 9
adds r2, r7
movs r1, 0x29
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9A70: .4byte gPlayerParty
@@ -4478,7 +4478,7 @@ _080E9A78:
lsls r2, 9
adds r2, r7
movs r1, 0x2A
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9A90: .4byte gPlayerParty
@@ -4493,7 +4493,7 @@ _080E9A98:
lsls r2, 9
adds r2, r7
movs r1, 0x2B
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9AB0: .4byte gPlayerParty
@@ -4509,7 +4509,7 @@ _080E9AB8:
adds r2, r7
_080E9AC8:
movs r1, 0x2C
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9AD0: .4byte gPlayerParty
@@ -4524,7 +4524,7 @@ _080E9AD8:
lsls r2, 9
adds r2, r7
movs r1, 0
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9AF0: .4byte gPlayerParty
@@ -4539,7 +4539,7 @@ _080E9AF8:
lsls r2, 9
adds r2, r7
movs r1, 0x9
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9B10: .4byte gPlayerParty
@@ -4554,7 +4554,7 @@ _080E9B18:
lsls r2, 9
adds r2, r7
movs r1, 0x37
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9B30: .4byte gPlayerParty
@@ -4569,7 +4569,7 @@ _080E9B38:
lsls r2, 9
adds r2, r7
movs r1, 0x38
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9B50: .4byte gPlayerParty
@@ -4584,7 +4584,7 @@ _080E9B58:
lsls r2, 9
adds r2, r7
movs r1, 0x39
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9B70: .4byte gPlayerParty
@@ -4599,7 +4599,7 @@ _080E9B78:
lsls r2, 9
adds r2, r7
movs r1, 0x3A
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9B90: .4byte gPlayerParty
@@ -4614,7 +4614,7 @@ _080E9B98:
lsls r2, 9
adds r2, r7
movs r1, 0x3B
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9BB0: .4byte gPlayerParty
@@ -4629,7 +4629,7 @@ _080E9BB8:
lsls r2, 9
adds r2, r7
movs r1, 0x3C
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9BD0: .4byte gPlayerParty
@@ -4644,7 +4644,7 @@ _080E9BD8:
lsls r2, 9
adds r2, r7
movs r1, 0x3D
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9BF0: .4byte gPlayerParty
@@ -4659,7 +4659,7 @@ _080E9BF8:
lsls r2, 9
adds r2, r7
movs r1, 0x3E
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9C10: .4byte gPlayerParty
@@ -4674,7 +4674,7 @@ _080E9C18:
lsls r2, 9
adds r2, r7
movs r1, 0x3F
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9C30: .4byte gPlayerParty
@@ -4689,7 +4689,7 @@ _080E9C38:
lsls r2, 9
adds r2, r7
movs r1, 0x16
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9C50: .4byte gPlayerParty
@@ -4704,7 +4704,7 @@ _080E9C58:
lsls r2, 9
adds r2, r7
movs r1, 0x17
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9C70: .4byte gPlayerParty
@@ -4719,7 +4719,7 @@ _080E9C78:
lsls r2, 9
adds r2, r7
movs r1, 0x18
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9C90: .4byte gPlayerParty
@@ -4734,7 +4734,7 @@ _080E9C98:
lsls r2, 9
adds r2, r7
movs r1, 0x21
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9CB0: .4byte gPlayerParty
@@ -4749,7 +4749,7 @@ _080E9CB8:
lsls r2, 9
adds r2, r7
movs r1, 0x2F
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9CD0: .4byte gPlayerParty
@@ -4764,7 +4764,7 @@ _080E9CD8:
lsls r2, 9
adds r2, r7
movs r1, 0x30
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9CF0: .4byte gPlayerParty
@@ -4779,7 +4779,7 @@ _080E9CF8:
lsls r2, 9
adds r2, r7
movs r1, 0x32
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9D10: .4byte gPlayerParty
@@ -4794,7 +4794,7 @@ _080E9D18:
lsls r2, 9
adds r2, r7
movs r1, 0x33
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9D30: .4byte gPlayerParty
@@ -4809,7 +4809,7 @@ _080E9D38:
lsls r2, 9
adds r2, r7
movs r1, 0x34
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9D50: .4byte gPlayerParty
@@ -4824,7 +4824,7 @@ _080E9D58:
lsls r2, 9
adds r2, r7
movs r1, 0x35
- bl sub_804037C
+ bl SetMonData
b _080E9D8E
.align 2, 0
_080E9D70: .4byte gPlayerParty
@@ -4839,7 +4839,7 @@ _080E9D78:
lsls r2, 9
adds r2, r7
movs r1, 0x36
- bl sub_804037C
+ bl SetMonData
_080E9D8E:
ldr r2, _080E9DC0 @ =gBattlerPartyIndexes
ldr r0, _080E9DBC @ =gActiveBattler
@@ -4970,13 +4970,13 @@ sub_80E9E6C: @ 80E9E6C
ldr r0, [r4]
ldrb r5, [r0, 0x8]
ldrb r0, [r6]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
adds r0, r5, 0
- bl sub_803F864
- ldr r0, _080E9ED4 @ =gUnknown_20244DC
+ bl SetMultiuseSpriteTemplateToTrainerBack
+ ldr r0, _080E9ED4 @ =gMultiuseSpriteTemplate
ldr r2, _080E9ED8 @ =gUnknown_8239F8C
ldr r1, [r4]
ldrb r1, [r1, 0x8]
@@ -5000,7 +5000,7 @@ sub_80E9E6C: @ 80E9E6C
_080E9EC8: .4byte gBattleTypeFlags
_080E9ECC: .4byte gSaveBlock2Ptr
_080E9ED0: .4byte gActiveBattler
-_080E9ED4: .4byte gUnknown_20244DC
+_080E9ED4: .4byte gMultiuseSpriteTemplate
_080E9ED8: .4byte gUnknown_8239F8C
_080E9EDC: .4byte gUnknown_2023D44
_080E9EE0:
@@ -5009,13 +5009,13 @@ _080E9EE0:
movs r0, 0x5
bl sub_8034750
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
movs r0, 0x5
- bl sub_803F864
- ldr r0, _080E9F90 @ =gUnknown_20244DC
+ bl SetMultiuseSpriteTemplateToTrainerBack
+ ldr r0, _080E9F90 @ =gMultiuseSpriteTemplate
ldr r1, _080E9F94 @ =gUnknown_8239F8C
ldrb r1, [r1, 0x14]
movs r2, 0x8
@@ -5088,7 +5088,7 @@ _080E9F1C:
bx r0
.align 2, 0
_080E9F8C: .4byte gActiveBattler
-_080E9F90: .4byte gUnknown_20244DC
+_080E9F90: .4byte gMultiuseSpriteTemplate
_080E9F94: .4byte gUnknown_8239F8C
_080E9F98: .4byte gUnknown_2023D44
_080E9F9C: .4byte gSprites
@@ -5116,13 +5116,13 @@ sub_80E9FB0: @ 80E9FB0
ldr r0, [r4]
ldrb r5, [r0, 0x8]
ldrb r0, [r6]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
adds r0, r5, 0
- bl sub_803F864
- ldr r0, _080EA018 @ =gUnknown_20244DC
+ bl SetMultiuseSpriteTemplateToTrainerBack
+ ldr r0, _080EA018 @ =gMultiuseSpriteTemplate
ldr r2, _080EA01C @ =gUnknown_8239F8C
ldr r1, [r4]
ldrb r1, [r1, 0x8]
@@ -5146,7 +5146,7 @@ sub_80E9FB0: @ 80E9FB0
_080EA00C: .4byte gBattleTypeFlags
_080EA010: .4byte gSaveBlock2Ptr
_080EA014: .4byte gActiveBattler
-_080EA018: .4byte gUnknown_20244DC
+_080EA018: .4byte gMultiuseSpriteTemplate
_080EA01C: .4byte gUnknown_8239F8C
_080EA020: .4byte gUnknown_2023D44
_080EA024:
@@ -5155,13 +5155,13 @@ _080EA024:
movs r0, 0x5
bl sub_8034750
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
movs r0, 0x5
- bl sub_803F864
- ldr r0, _080EA0D4 @ =gUnknown_20244DC
+ bl SetMultiuseSpriteTemplateToTrainerBack
+ ldr r0, _080EA0D4 @ =gMultiuseSpriteTemplate
ldr r1, _080EA0D8 @ =gUnknown_8239F8C
ldrb r1, [r1, 0x14]
movs r2, 0x8
@@ -5234,7 +5234,7 @@ _080EA060:
bx r0
.align 2, 0
_080EA0D0: .4byte gActiveBattler
-_080EA0D4: .4byte gUnknown_20244DC
+_080EA0D4: .4byte gMultiuseSpriteTemplate
_080EA0D8: .4byte gUnknown_8239F8C
_080EA0DC: .4byte gUnknown_2023D44
_080EA0E0: .4byte gSprites
@@ -5388,7 +5388,7 @@ sub_80EA1F8: @ 80EA1F8
ldr r5, _080EA240 @ =gActiveBattler
ldrb r4, [r5]
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r2, r0, 0
lsls r2, 24
lsrs r2, 24
@@ -5432,7 +5432,7 @@ sub_80EA24C: @ 80EA24C
strb r0, [r1]
ldrb r4, [r5]
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r2, r0, 0
lsls r2, 24
lsrs r2, 24
@@ -5812,14 +5812,14 @@ _080EA570:
lsls r0, 24
cmp r0, 0
beq _080EA590
- ldr r0, _080EA58C @ =gUnknown_202298C
+ ldr r0, _080EA58C @ =gDisplayedStringBattle
movs r1, 0x40
bl sub_80D87BC
b _080EA598
.align 2, 0
-_080EA58C: .4byte gUnknown_202298C
+_080EA58C: .4byte gDisplayedStringBattle
_080EA590:
- ldr r0, _080EA5B4 @ =gUnknown_202298C
+ ldr r0, _080EA5B4 @ =gDisplayedStringBattle
movs r1, 0
bl sub_80D87BC
_080EA598:
@@ -5838,7 +5838,7 @@ _080EA598:
beq _080EA5F8
b _080EA64C
.align 2, 0
-_080EA5B4: .4byte gUnknown_202298C
+_080EA5B4: .4byte gDisplayedStringBattle
_080EA5B8: .4byte gBattleTypeFlags
_080EA5BC:
cmp r1, 0xE3
@@ -5928,7 +5928,7 @@ sub_80EA66C: @ 80EA66C
push {lr}
ldr r0, _080EA684 @ =gActiveBattler
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080EA688
@@ -6047,7 +6047,7 @@ _080EA770:
ldr r0, _080EA784 @ =gUnknown_83FE6FA
bl BattleStringExpandPlaceholdersToDisplayedString
_080EA776:
- ldr r0, _080EA788 @ =gUnknown_202298C
+ ldr r0, _080EA788 @ =gDisplayedStringBattle
movs r1, 0x1
bl sub_80D87BC
pop {r4}
@@ -6055,7 +6055,7 @@ _080EA776:
bx r0
.align 2, 0
_080EA784: .4byte gUnknown_83FE6FA
-_080EA788: .4byte gUnknown_202298C
+_080EA788: .4byte gDisplayedStringBattle
thumb_func_end sub_80EA6FC
thumb_func_start sub_80EA78C
@@ -6189,7 +6189,7 @@ sub_80EA870: @ 80EA870
adds r0, r1
ldr r1, _080EA8C4 @ =sub_80E7A70
str r1, [r0]
- ldr r1, _080EA8C8 @ =gUnknown_2024004
+ ldr r1, _080EA8C8 @ =gBattlerInMenuId
ldrb r0, [r2]
strb r0, [r1]
movs r3, 0
@@ -6215,7 +6215,7 @@ _080EA89E:
_080EA8BC: .4byte gUnknown_3004FE0
_080EA8C0: .4byte gActiveBattler
_080EA8C4: .4byte sub_80E7A70
-_080EA8C8: .4byte gUnknown_2024004
+_080EA8C8: .4byte gBattlerInMenuId
_080EA8CC: .4byte gUnknown_203B0DC
_080EA8D0: .4byte gUnknown_2022BC4
thumb_func_end sub_80EA870
@@ -6301,7 +6301,7 @@ _080EA940:
adds r0, r1
ldr r1, _080EA9A4 @ =sub_80E79B8
str r1, [r0]
- ldr r1, _080EA9A8 @ =gUnknown_2024004
+ ldr r1, _080EA9A8 @ =gBattlerInMenuId
ldrb r0, [r2]
strb r0, [r1]
add sp, 0x4
@@ -6318,7 +6318,7 @@ _080EA998: .4byte gBattleStruct
_080EA99C: .4byte gUnknown_203B0DC
_080EA9A0: .4byte gUnknown_3004FE0
_080EA9A4: .4byte sub_80E79B8
-_080EA9A8: .4byte gUnknown_2024004
+_080EA9A8: .4byte gBattlerInMenuId
thumb_func_end sub_80EA8D4
thumb_func_start sub_80EA9AC
@@ -7066,13 +7066,13 @@ sub_80EAF34: @ 80EAF34
mov r1, r9
strb r0, [r1]
adds r0, r6, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
mov r0, r8
bl sub_803F7D4
- ldr r0, _080EB094 @ =gUnknown_20244DC
+ ldr r0, _080EB094 @ =gMultiuseSpriteTemplate
mov r10, r0
adds r0, r6, 0
movs r1, 0x2
@@ -7135,7 +7135,7 @@ sub_80EAF34: @ 80EAF34
adds r0, r1
lsls r0, 2
adds r0, r5
- ldr r1, _080EB0A0 @ =gUnknown_2024024
+ ldr r1, _080EB0A0 @ =gBattleMonForms
adds r6, r1
ldrb r1, [r6]
bl StartSpriteAnim
@@ -7184,10 +7184,10 @@ _080EB084: .4byte gUnknown_2022BC4
_080EB088: .4byte gPlayerParty
_080EB08C: .4byte sub_8033E3C
_080EB090: .4byte gUnknown_3004FFC
-_080EB094: .4byte gUnknown_20244DC
+_080EB094: .4byte gMultiuseSpriteTemplate
_080EB098: .4byte gUnknown_2023D44
_080EB09C: .4byte gSprites
-_080EB0A0: .4byte gUnknown_2024024
+_080EB0A0: .4byte gBattleMonForms
_080EB0A4: .4byte SpriteCallbackDummy
thumb_func_end sub_80EAF34
@@ -7262,7 +7262,7 @@ sub_80EB11C: @ 80EB11C
cmp r0, 0
beq _080EB14C
adds r0, r2, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080EB14C
diff --git a/asm/battle_controller_opponent.s b/asm/battle_controller_opponent.s
index 5a7b6d684..0405efdf1 100644
--- a/asm/battle_controller_opponent.s
+++ b/asm/battle_controller_opponent.s
@@ -2567,12 +2567,12 @@ _08036F9C:
adds r0, r4, 0
movs r1, 0xB
adds r2, r7, 0
- bl sub_804037C
+ bl SetMonData
adds r2, r7, 0
adds r2, 0x2E
adds r0, r4, 0
movs r1, 0xC
- bl sub_804037C
+ bl SetMonData
movs r0, 0
mov r8, r0
movs r0, 0x3B
@@ -2613,12 +2613,12 @@ _08037002:
adds r1, 0xD
mov r0, r9
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
mov r1, r8
adds r1, 0x11
mov r0, r9
adds r2, r6, 0
- bl sub_804037C
+ bl SetMonData
adds r6, 0x1
adds r4, 0x2
movs r0, 0x1
@@ -2634,15 +2634,15 @@ _08037002:
adds r0, r4, 0
movs r1, 0x15
mov r2, r10
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x20
ldr r2, [sp, 0x20]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x19
ldr r2, [sp, 0x28]
- bl sub_804037C
+ bl SetMonData
ldrb r0, [r7, 0x14]
lsls r0, 27
lsrs r0, 27
@@ -2651,7 +2651,7 @@ _08037002:
adds r0, r4, 0
movs r1, 0x27
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldrh r0, [r7, 0x14]
lsls r0, 22
@@ -2660,7 +2660,7 @@ _08037002:
adds r0, r4, 0
movs r1, 0x28
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldrb r0, [r7, 0x15]
lsls r0, 25
@@ -2669,7 +2669,7 @@ _08037002:
adds r0, r4, 0
movs r1, 0x29
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldr r0, [r7, 0x14]
lsls r0, 12
@@ -2678,7 +2678,7 @@ _08037002:
adds r0, r4, 0
movs r1, 0x2A
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldrh r0, [r7, 0x16]
lsls r0, 23
@@ -2687,7 +2687,7 @@ _08037002:
adds r0, r4, 0
movs r1, 0x2B
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldrb r0, [r7, 0x17]
lsls r0, 26
@@ -2696,47 +2696,47 @@ _08037002:
adds r0, r4, 0
movs r1, 0x2C
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0
ldr r2, [sp, 0x2C]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x37
ldr r2, [sp, 0x30]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x38
ldr r2, [sp, 0x1C]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x39
ldr r2, [sp, 0x18]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3A
ldr r2, [sp, 0x24]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3B
ldr r2, [sp, 0x4]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3C
ldr r2, [sp, 0x8]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3D
ldr r2, [sp, 0xC]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3E
ldr r2, [sp, 0x10]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3F
ldr r2, [sp, 0x14]
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037130: .4byte gEnemyParty
@@ -2749,7 +2749,7 @@ _08037134:
lsls r2, 9
adds r2, r3
movs r1, 0xB
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_0803714C: .4byte gEnemyParty
@@ -2762,7 +2762,7 @@ _08037150:
lsls r2, 9
adds r2, r3
movs r1, 0xC
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037168: .4byte gEnemyParty
@@ -2784,12 +2784,12 @@ _08037184:
adds r1, 0xD
adds r0, r7, 0
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
mov r1, r8
adds r1, 0x11
adds r0, r7, 0
adds r2, r6, 0
- bl sub_804037C
+ bl SetMonData
adds r6, 0x1
adds r4, 0x2
movs r0, 0x1
@@ -2803,7 +2803,7 @@ _08037184:
adds r0, r1
movs r1, 0x15
mov r2, r9
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_080371BC: .4byte gEnemyParty
@@ -2835,7 +2835,7 @@ _080371E0:
adds r0, r4, 0
movs r1, 0x11
str r3, [sp, 0x34]
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r6]
lsls r2, 9
ldr r3, [sp, 0x34]
@@ -2843,7 +2843,7 @@ _080371E0:
adds r2, r0
adds r0, r4, 0
movs r1, 0x12
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r6]
lsls r2, 9
ldr r3, [sp, 0x34]
@@ -2851,7 +2851,7 @@ _080371E0:
adds r2, r0
adds r0, r4, 0
movs r1, 0x13
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r6]
lsls r2, 9
ldr r3, [sp, 0x34]
@@ -2859,7 +2859,7 @@ _080371E0:
adds r2, r0
adds r0, r4, 0
movs r1, 0x14
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r6]
lsls r2, 9
ldr r3, [sp, 0x34]
@@ -2867,7 +2867,7 @@ _080371E0:
adds r2, r0
adds r0, r4, 0
movs r1, 0x15
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037244: .4byte gEnemyParty
@@ -2886,7 +2886,7 @@ _08037248:
_0803725E:
adds r3, 0x3
adds r2, r3
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037268: .4byte gEnemyParty
@@ -2900,7 +2900,7 @@ _08037270:
lsls r2, 9
adds r2, r3
movs r1, 0x1
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037288: .4byte gEnemyParty
@@ -2913,7 +2913,7 @@ _0803728C:
lsls r2, 9
adds r2, r3
movs r1, 0x19
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_080372A4: .4byte gEnemyParty
@@ -2926,7 +2926,7 @@ _080372A8:
lsls r2, 9
adds r2, r3
movs r1, 0x1A
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_080372C0: .4byte gEnemyParty
@@ -2939,7 +2939,7 @@ _080372C4:
lsls r2, 9
adds r2, r3
movs r1, 0x1B
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_080372DC: .4byte gEnemyParty
@@ -2952,7 +2952,7 @@ _080372E0:
lsls r2, 9
adds r2, r3
movs r1, 0x1C
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_080372F8: .4byte gEnemyParty
@@ -2965,7 +2965,7 @@ _080372FC:
lsls r2, 9
adds r2, r3
movs r1, 0x1D
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037314: .4byte gEnemyParty
@@ -2978,7 +2978,7 @@ _08037318:
lsls r2, 9
adds r2, r3
movs r1, 0x1E
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037330: .4byte gEnemyParty
@@ -2991,7 +2991,7 @@ _08037334:
lsls r2, 9
adds r2, r3
movs r1, 0x1F
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_0803734C: .4byte gEnemyParty
@@ -3004,7 +3004,7 @@ _08037350:
lsls r2, 9
adds r2, r3
movs r1, 0x20
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037368: .4byte gEnemyParty
@@ -3017,7 +3017,7 @@ _0803736C:
lsls r2, 9
adds r2, r3
movs r1, 0x22
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037384: .4byte gEnemyParty
@@ -3030,7 +3030,7 @@ _08037388:
lsls r2, 9
adds r2, r3
movs r1, 0x23
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_080373A0: .4byte gEnemyParty
@@ -3043,7 +3043,7 @@ _080373A4:
lsls r2, 9
adds r2, r3
movs r1, 0x24
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_080373BC: .4byte gEnemyParty
@@ -3056,7 +3056,7 @@ _080373C0:
lsls r2, 9
adds r2, r3
movs r1, 0x25
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_080373D8: .4byte gEnemyParty
@@ -3069,7 +3069,7 @@ _080373DC:
lsls r2, 9
adds r2, r3
movs r1, 0x26
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_080373F4: .4byte gEnemyParty
@@ -3085,7 +3085,7 @@ _080373F8:
adds r0, r4, 0
movs r1, 0x27
str r3, [sp, 0x34]
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r6]
lsls r2, 9
ldr r3, [sp, 0x34]
@@ -3093,7 +3093,7 @@ _080373F8:
adds r2, r0
adds r0, r4, 0
movs r1, 0x28
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r6]
lsls r2, 9
ldr r3, [sp, 0x34]
@@ -3101,7 +3101,7 @@ _080373F8:
adds r2, r0
adds r0, r4, 0
movs r1, 0x29
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r6]
lsls r2, 9
ldr r3, [sp, 0x34]
@@ -3109,7 +3109,7 @@ _080373F8:
adds r2, r0
adds r0, r4, 0
movs r1, 0x2A
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r6]
lsls r2, 9
ldr r3, [sp, 0x34]
@@ -3117,7 +3117,7 @@ _080373F8:
adds r2, r0
adds r0, r4, 0
movs r1, 0x2B
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r6]
lsls r2, 9
ldr r3, [sp, 0x34]
@@ -3136,7 +3136,7 @@ _0803746C:
lsls r2, 9
adds r2, r3
movs r1, 0x27
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037484: .4byte gEnemyParty
@@ -3149,7 +3149,7 @@ _08037488:
lsls r2, 9
adds r2, r3
movs r1, 0x28
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_080374A0: .4byte gEnemyParty
@@ -3162,7 +3162,7 @@ _080374A4:
lsls r2, 9
adds r2, r3
movs r1, 0x29
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_080374BC: .4byte gEnemyParty
@@ -3175,7 +3175,7 @@ _080374C0:
lsls r2, 9
adds r2, r3
movs r1, 0x2A
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_080374D8: .4byte gEnemyParty
@@ -3188,7 +3188,7 @@ _080374DC:
lsls r2, 9
adds r2, r3
movs r1, 0x2B
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_080374F4: .4byte gEnemyParty
@@ -3202,7 +3202,7 @@ _080374F8:
adds r2, r3
_08037506:
movs r1, 0x2C
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037510: .4byte gEnemyParty
@@ -3215,7 +3215,7 @@ _08037514:
lsls r2, 9
adds r2, r3
movs r1, 0
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_0803752C: .4byte gEnemyParty
@@ -3228,7 +3228,7 @@ _08037530:
lsls r2, 9
adds r2, r3
movs r1, 0x9
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037548: .4byte gEnemyParty
@@ -3241,7 +3241,7 @@ _0803754C:
lsls r2, 9
adds r2, r3
movs r1, 0x37
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037564: .4byte gEnemyParty
@@ -3254,7 +3254,7 @@ _08037568:
lsls r2, 9
adds r2, r3
movs r1, 0x38
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037580: .4byte gEnemyParty
@@ -3267,7 +3267,7 @@ _08037584:
lsls r2, 9
adds r2, r3
movs r1, 0x39
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_0803759C: .4byte gEnemyParty
@@ -3280,7 +3280,7 @@ _080375A0:
lsls r2, 9
adds r2, r3
movs r1, 0x3A
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_080375B8: .4byte gEnemyParty
@@ -3293,7 +3293,7 @@ _080375BC:
lsls r2, 9
adds r2, r3
movs r1, 0x3B
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_080375D4: .4byte gEnemyParty
@@ -3306,7 +3306,7 @@ _080375D8:
lsls r2, 9
adds r2, r3
movs r1, 0x3C
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_080375F0: .4byte gEnemyParty
@@ -3319,7 +3319,7 @@ _080375F4:
lsls r2, 9
adds r2, r3
movs r1, 0x3D
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_0803760C: .4byte gEnemyParty
@@ -3332,7 +3332,7 @@ _08037610:
lsls r2, 9
adds r2, r3
movs r1, 0x3E
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037628: .4byte gEnemyParty
@@ -3345,7 +3345,7 @@ _0803762C:
lsls r2, 9
adds r2, r3
movs r1, 0x3F
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037644: .4byte gEnemyParty
@@ -3358,7 +3358,7 @@ _08037648:
lsls r2, 9
adds r2, r3
movs r1, 0x16
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037660: .4byte gEnemyParty
@@ -3371,7 +3371,7 @@ _08037664:
lsls r2, 9
adds r2, r3
movs r1, 0x17
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_0803767C: .4byte gEnemyParty
@@ -3384,7 +3384,7 @@ _08037680:
lsls r2, 9
adds r2, r3
movs r1, 0x18
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037698: .4byte gEnemyParty
@@ -3397,7 +3397,7 @@ _0803769C:
lsls r2, 9
adds r2, r3
movs r1, 0x21
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_080376B4: .4byte gEnemyParty
@@ -3410,7 +3410,7 @@ _080376B8:
lsls r2, 9
adds r2, r3
movs r1, 0x2F
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_080376D0: .4byte gEnemyParty
@@ -3423,7 +3423,7 @@ _080376D4:
lsls r2, 9
adds r2, r3
movs r1, 0x30
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_080376EC: .4byte gEnemyParty
@@ -3436,7 +3436,7 @@ _080376F0:
lsls r2, 9
adds r2, r3
movs r1, 0x32
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037708: .4byte gEnemyParty
@@ -3449,7 +3449,7 @@ _0803770C:
lsls r2, 9
adds r2, r3
movs r1, 0x33
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037724: .4byte gEnemyParty
@@ -3462,7 +3462,7 @@ _08037728:
lsls r2, 9
adds r2, r3
movs r1, 0x34
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_08037740: .4byte gEnemyParty
@@ -3475,7 +3475,7 @@ _08037744:
lsls r2, 9
adds r2, r3
movs r1, 0x35
- bl sub_804037C
+ bl SetMonData
b _08037774
.align 2, 0
_0803775C: .4byte gEnemyParty
@@ -3488,7 +3488,7 @@ _08037760:
lsls r2, 9
adds r2, r3
movs r1, 0x36
- bl sub_804037C
+ bl SetMonData
_08037774:
add sp, 0x38
pop {r3-r5}
@@ -3644,13 +3644,13 @@ _08037890:
_080378AA:
ldr r7, _0803799C @ =gActiveBattler
ldrb r0, [r7]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
mov r0, r8
bl sub_803F7D4
- ldr r6, _080379A0 @ =gUnknown_20244DC
+ ldr r6, _080379A0 @ =gMultiuseSpriteTemplate
ldrb r0, [r7]
movs r1, 0x2
bl sub_8074480
@@ -3717,7 +3717,7 @@ _080378AA:
adds r0, r1
lsls r0, 2
adds r0, r5
- ldr r1, _080379B0 @ =gUnknown_2024024
+ ldr r1, _080379B0 @ =gBattleMonForms
adds r2, r1
ldrb r1, [r2]
bl StartSpriteAnim
@@ -3758,11 +3758,11 @@ _08037986:
bx r0
.align 2, 0
_0803799C: .4byte gActiveBattler
-_080379A0: .4byte gUnknown_20244DC
+_080379A0: .4byte gMultiuseSpriteTemplate
_080379A4: .4byte gUnknown_2023D44
_080379A8: .4byte gSprites
_080379AC: .4byte 0x0000ff10
-_080379B0: .4byte gUnknown_2024024
+_080379B0: .4byte gBattleMonForms
_080379B4: .4byte gBattleTypeFlags
_080379B8: .4byte gBattlerPartyIndexes
_080379BC: .4byte gEnemyParty
@@ -3867,13 +3867,13 @@ sub_8037A28: @ 8037A28
adds r1, r6, 0
bl BattleLoadOpponentMonSpriteGfx
adds r0, r6, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
mov r0, r8
bl sub_803F7D4
- ldr r0, _08037B98 @ =gUnknown_20244DC
+ ldr r0, _08037B98 @ =gMultiuseSpriteTemplate
mov r9, r0
adds r0, r6, 0
movs r1, 0x2
@@ -3936,7 +3936,7 @@ sub_8037A28: @ 8037A28
adds r0, r1
lsls r0, 2
adds r0, r5
- ldr r1, _08037BA4 @ =gUnknown_2024024
+ ldr r1, _08037BA4 @ =gBattleMonForms
adds r6, r1
ldrb r1, [r6]
bl StartSpriteAnim
@@ -3984,10 +3984,10 @@ _08037B88: .4byte gUnknown_2022BC4
_08037B8C: .4byte gEnemyParty
_08037B90: .4byte sub_8033E3C
_08037B94: .4byte gUnknown_3004FFC
-_08037B98: .4byte gUnknown_20244DC
+_08037B98: .4byte gMultiuseSpriteTemplate
_08037B9C: .4byte gUnknown_2023D44
_08037BA0: .4byte gSprites
-_08037BA4: .4byte gUnknown_2024024
+_08037BA4: .4byte gBattleMonForms
_08037BA8: .4byte SpriteCallbackDummy
thumb_func_end sub_8037A28
@@ -4198,13 +4198,13 @@ _08037D3A:
bl sub_80346C4
mov r1, r8
ldrb r0, [r1]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
mov r0, r9
- bl sub_803F864
- ldr r5, _08037E74 @ =gUnknown_20244DC
+ bl SetMultiuseSpriteTemplateToTrainerBack
+ ldr r5, _08037E74 @ =gMultiuseSpriteTemplate
ldr r1, _08037E78 @ =gUnknown_823932C
mov r2, r9
lsls r0, r2, 2
@@ -4339,7 +4339,7 @@ _08037D3A:
.align 2, 0
_08037E6C: .4byte gTrainers
_08037E70: .4byte gActiveBattler
-_08037E74: .4byte gUnknown_20244DC
+_08037E74: .4byte gMultiuseSpriteTemplate
_08037E78: .4byte gUnknown_823932C
_08037E7C: .4byte gUnknown_2023D44
_08037E80: .4byte gSprites
@@ -4417,13 +4417,13 @@ _08037F0E:
bl sub_80346C4
mov r1, r8
ldrb r0, [r1]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
mov r0, r9
- bl sub_803F864
- ldr r0, _08038048 @ =gUnknown_20244DC
+ bl SetMultiuseSpriteTemplateToTrainerBack
+ ldr r0, _08038048 @ =gMultiuseSpriteTemplate
ldr r2, _0803804C @ =gUnknown_823932C
mov r3, r9
lsls r1, r3, 2
@@ -4559,7 +4559,7 @@ _08037F0E:
.align 2, 0
_08038040: .4byte gTrainers
_08038044: .4byte gActiveBattler
-_08038048: .4byte gUnknown_20244DC
+_08038048: .4byte gMultiuseSpriteTemplate
_0803804C: .4byte gUnknown_823932C
_08038050: .4byte gUnknown_2023D44
_08038054: .4byte gSprites
@@ -5130,7 +5130,7 @@ sub_80384BC: @ 80384BC
lsls r0, 24
cmp r0, 0
beq _08038504
- ldr r0, _08038500 @ =gUnknown_202298C
+ ldr r0, _08038500 @ =gDisplayedStringBattle
movs r1, 0x40
bl sub_80D87BC
b _0803850C
@@ -5139,9 +5139,9 @@ _080384F0: .4byte gUnknown_2022974
_080384F4: .4byte gUnknown_2022976
_080384F8: .4byte gActiveBattler
_080384FC: .4byte gUnknown_2022BC6
-_08038500: .4byte gUnknown_202298C
+_08038500: .4byte gDisplayedStringBattle
_08038504:
- ldr r0, _08038534 @ =gUnknown_202298C
+ ldr r0, _08038534 @ =gDisplayedStringBattle
movs r1, 0
bl sub_80D87BC
_0803850C:
@@ -5165,7 +5165,7 @@ _0803850C:
ldr r1, _08038548 @ =sub_80E85C0
b _08038574
.align 2, 0
-_08038534: .4byte gUnknown_202298C
+_08038534: .4byte gDisplayedStringBattle
_08038538: .4byte gBattleTypeFlags
_0803853C: .4byte 0x0000017f
_08038540: .4byte gUnknown_3004FE0
@@ -5292,7 +5292,7 @@ _0803861C:
cmp r0, 0
beq _08038656
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r5, _08038674 @ =gBattlerTarget
strb r0, [r5]
ldr r0, _08038678 @ =gAbsentBattlerFlags
@@ -5306,7 +5306,7 @@ _0803861C:
cmp r1, 0
beq _08038656
movs r0, 0x2
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
strb r0, [r5]
_08038656:
ldr r0, _08038674 @ =gBattlerTarget
@@ -5371,7 +5371,7 @@ _080386C4:
lsls r1, 24
lsrs r1, 24
adds r0, r1, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r2, r0, 0
lsls r2, 24
lsrs r2, 16
@@ -5384,7 +5384,7 @@ _080386C4:
_080386F4: .4byte gBattleTypeFlags
_080386F8:
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r2, r0, 0
lsls r2, 24
lsrs r2, 16
@@ -5427,7 +5427,7 @@ sub_8038744: @ 8038744
push {r4-r6,lr}
ldr r6, _08038788 @ =gActiveBattler
ldrb r0, [r6]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 25
ldr r5, _0803878C @ =gBattleStruct
@@ -5449,7 +5449,7 @@ sub_8038744: @ 8038744
cmp r0, 0
bne _08038794
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r5, r0, 24
adds r6, r5, 0
@@ -5460,11 +5460,11 @@ _0803878C: .4byte gBattleStruct
_08038790: .4byte gBattleTypeFlags
_08038794:
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r6, r0, 24
movs r0, 0x3
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r5, r0, 24
_080387A8:
@@ -5500,7 +5500,7 @@ _080387DC: .4byte gEnemyParty
_080387E0: .4byte gBattlerPartyIndexes
_080387E4:
ldrb r0, [r6]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 25
ldr r1, [r5]
@@ -5508,7 +5508,7 @@ _080387E4:
adds r0, 0x92
ldrb r4, [r0]
ldrb r0, [r6]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 25
ldr r1, [r5]
@@ -5990,7 +5990,7 @@ OpponentHandleEffectivenessSound: @ 8038B9C
push {r4,lr}
ldr r4, _08038BD8 @ =gActiveBattler
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
movs r3, 0x3F
cmp r0, 0
@@ -6372,7 +6372,7 @@ sub_8038EA8: @ 8038EA8
cmp r0, 0
beq _08038ED8
adds r0, r2, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08038ED8
diff --git a/asm/battle_controller_player.s b/asm/battle_controller_player.s
index 6c6587e9c..1ae03fe5e 100644
--- a/asm/battle_controller_player.s
+++ b/asm/battle_controller_player.s
@@ -348,13 +348,13 @@ _0802E5A8:
cmp r0, 0
beq _0802E634
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x2
bne _0802E634
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _0802E620 @ =gAbsentBattlerFlags
ldrb r1, [r1]
ldr r2, _0802E624 @ =gBitTable
@@ -451,7 +451,7 @@ sub_802E674: @ 802E674
movs r3, 0x1
bl dp11b_obj_instanciate
movs r4, 0
- ldr r0, _0802E710 @ =gUnknown_2023BCC
+ ldr r0, _0802E710 @ =gBattlersCount
ldrb r0, [r0]
cmp r0, 0
beq _0802E6B6
@@ -466,7 +466,7 @@ _0802E69A:
bl dp11b_obj_free
_0802E6AC:
adds r4, 0x1
- ldr r0, _0802E710 @ =gUnknown_2023BCC
+ ldr r0, _0802E710 @ =gBattlersCount
ldrb r0, [r0]
cmp r4, r0
blt _0802E69A
@@ -511,7 +511,7 @@ _0802E6B6:
.align 2, 0
_0802E708: .4byte gUnknown_8250980
_0802E70C: .4byte gUnknown_3004FF4
-_0802E710: .4byte gUnknown_2023BCC
+_0802E710: .4byte gBattlersCount
_0802E714: .4byte gMain
_0802E718: .4byte gSprites
_0802E71C: .4byte gUnknown_2023D44
@@ -592,7 +592,7 @@ _0802E7AA:
adds r5, r3, 0
_0802E7CC:
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r1, r0, 24
movs r4, 0
@@ -622,9 +622,9 @@ _0802E804:
mov r1, sp
adds r0, r1, r4
ldrb r0, [r0]
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
strb r0, [r5]
- ldr r1, _0802E838 @ =gUnknown_2023BCC
+ ldr r1, _0802E838 @ =gBattlersCount
lsls r0, 24
lsrs r0, 24
ldrb r1, [r1]
@@ -632,7 +632,7 @@ _0802E804:
beq _0802E7FC
movs r4, 0
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -643,7 +643,7 @@ _0802E804:
beq _0802E846
b _0802E884
.align 2, 0
-_0802E838: .4byte gUnknown_2023BCC
+_0802E838: .4byte gBattlersCount
_0802E83C:
cmp r0, 0x2
beq _0802E846
@@ -733,7 +733,7 @@ _0802E8CE:
adds r5, r3, 0
_0802E8F0:
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r1, r0, 24
movs r4, 0
@@ -763,9 +763,9 @@ _0802E928:
mov r1, sp
adds r0, r1, r4
ldrb r0, [r0]
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
strb r0, [r5]
- ldr r1, _0802E95C @ =gUnknown_2023BCC
+ ldr r1, _0802E95C @ =gBattlersCount
lsls r0, 24
lsrs r0, 24
ldrb r1, [r1]
@@ -773,7 +773,7 @@ _0802E928:
beq _0802E920
movs r4, 0
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -784,7 +784,7 @@ _0802E928:
beq _0802E96A
b _0802E9A8
.align 2, 0
-_0802E95C: .4byte gUnknown_2023BCC
+_0802E95C: .4byte gBattlersCount
_0802E960:
cmp r0, 0x2
beq _0802E96A
@@ -948,13 +948,13 @@ _0802EAA4: .4byte gActiveBattler
_0802EAA8:
ldr r0, _0802EAEC @ =gActiveBattler
ldrb r0, [r0]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
movs r2, 0x1
movs r0, 0x1
ands r0, r1
eors r0, r2
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _0802EAF0 @ =gUnknown_3004FF4
strb r0, [r1]
_0802EAC2:
@@ -1005,7 +1005,7 @@ _0802EB04:
cmp r0, 0
bne _0802EB3A
movs r0, 0
- bl sub_803F5B4
+ bl CountAliveMons
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -1071,7 +1071,7 @@ _0802EBAC: .4byte sub_802E674
_0802EBB0: .4byte gUnknown_3004FF4
_0802EBB4:
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _0802EBD4 @ =gAbsentBattlerFlags
ldrb r1, [r1]
ldr r2, _0802EBD8 @ =gBitTable
@@ -1090,7 +1090,7 @@ _0802EBD8: .4byte gBitTable
_0802EBDC:
movs r0, 0x1
_0802EBDE:
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _0802EC00 @ =gUnknown_3004FF4
_0802EBE4:
strb r0, [r1]
@@ -1925,7 +1925,7 @@ _0802F26A:
adds r1, r6, 0
adds r1, 0xD
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
mov r1, r9
ldrb r0, [r1]
lsls r0, 1
@@ -1938,7 +1938,7 @@ _0802F26A:
adds r1, r6, 0
adds r1, 0x11
adds r2, r5, 0
- bl sub_804037C
+ bl SetMonData
adds r5, 0x1
adds r4, 0x2
adds r6, 0x1
@@ -1956,7 +1956,7 @@ _0802F26A:
adds r0, r1
movs r1, 0x15
ldr r2, [sp, 0x1C]
- bl sub_804037C
+ bl SetMonData
_0802F2C8:
ldr r0, _0802F30C @ =gBattleTypeFlags
ldr r0, [r0]
@@ -3433,7 +3433,7 @@ _0802FEF2:
movs r1, 0x19
bl GetMonData
str r0, [sp, 0x4]
- ldr r3, _0802FFB8 @ =gUnknown_8253AE4
+ ldr r3, _0802FFB8 @ =gExperienceTables
adds r4, 0x1
lsls r4, 2
ldr r2, _0802FFBC @ =gBaseStats
@@ -3458,7 +3458,7 @@ _0802FEF2:
adds r0, r6, 0
movs r1, 0x19
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
bl CalculateMonStats
ldr r2, [sp]
@@ -3502,7 +3502,7 @@ _0802FFA6:
_0802FFAC: .4byte gTasks
_0802FFB0: .4byte gBattlerPartyIndexes
_0802FFB4: .4byte gPlayerParty
-_0802FFB8: .4byte gUnknown_8253AE4
+_0802FFB8: .4byte gExperienceTables
_0802FFBC: .4byte gBaseStats
_0802FFC0: .4byte gActiveBattler
_0802FFC4: .4byte sub_8030238
@@ -3523,7 +3523,7 @@ _0802FFE0:
add r2, sp, 0x4
adds r0, r6, 0
movs r1, 0x19
- bl sub_804037C
+ bl SetMonData
ldr r1, _08030000 @ =gUnknown_3004FE0
ldr r3, [sp, 0x8]
lsls r0, r3, 2
@@ -3602,7 +3602,7 @@ sub_8030024: @ 8030024
movs r1, 0x19
bl GetMonData
adds r3, r0, 0
- ldr r6, _080300E4 @ =gUnknown_8253AE4
+ ldr r6, _080300E4 @ =gExperienceTables
lsls r1, r4, 2
ldr r2, _080300E8 @ =gBaseStats
lsls r0, r5, 3
@@ -3647,7 +3647,7 @@ sub_8030024: @ 8030024
.align 2, 0
_080300DC: .4byte gTasks
_080300E0: .4byte gPlayerParty
-_080300E4: .4byte gUnknown_8253AE4
+_080300E4: .4byte gExperienceTables
_080300E8: .4byte gBaseStats
_080300EC: .4byte gUnknown_3004FF0
_080300F0: .4byte sub_80300F4
@@ -3725,7 +3725,7 @@ _08030124:
bl GetMonData
lsls r0, 16
lsrs r0, 16
- ldr r3, _080301F4 @ =gUnknown_8253AE4
+ ldr r3, _080301F4 @ =gExperienceTables
adds r4, 0x1
lsls r4, 2
ldr r2, _080301F8 @ =gBaseStats
@@ -3751,7 +3751,7 @@ _08030124:
adds r0, r5, 0
movs r1, 0x19
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r5, 0
bl CalculateMonStats
ldr r2, [sp]
@@ -3774,7 +3774,7 @@ _08030124:
.align 2, 0
_080301EC: .4byte gUnknown_3004FF0
_080301F0: .4byte gPlayerParty
-_080301F4: .4byte gUnknown_8253AE4
+_080301F4: .4byte gExperienceTables
_080301F8: .4byte gBaseStats
_080301FC: .4byte gActiveBattler
_08030200: .4byte sub_8030238
@@ -3783,7 +3783,7 @@ _08030204:
add r2, sp, 0x4
adds r0, r5, 0
movs r1, 0x19
- bl sub_804037C
+ bl SetMonData
ldr r1, _08030230 @ =gUnknown_3004FE0
lsls r0, r7, 2
adds r0, r1
@@ -4557,7 +4557,7 @@ sub_8030830: @ 8030830
movs r0, 0
strb r0, [r2]
movs r5, 0
- ldr r6, _0803089C @ =gUnknown_202298C
+ ldr r6, _0803089C @ =gDisplayedStringBattle
adds r4, r1, r3
adds r7, r2, 0
_08030848:
@@ -4597,7 +4597,7 @@ _08030880:
_08030890: .4byte gActiveBattler
_08030894: .4byte gUnknown_2022BC8
_08030898: .4byte gUnknown_3004FF8
-_0803089C: .4byte gUnknown_202298C
+_0803089C: .4byte gDisplayedStringBattle
_080308A0: .4byte gUnknown_83FE770
_080308A4: .4byte gUnknown_8247094
thumb_func_end sub_8030830
@@ -4605,7 +4605,7 @@ _080308A4: .4byte gUnknown_8247094
thumb_func_start MoveSelectionDisplayPpString
MoveSelectionDisplayPpString: @ 80308A8
push {r4,lr}
- ldr r4, _080308C4 @ =gUnknown_202298C
+ ldr r4, _080308C4 @ =gDisplayedStringBattle
ldr r1, _080308C8 @ =gUnknown_83FE766
adds r0, r4, 0
bl StringCopy
@@ -4616,7 +4616,7 @@ MoveSelectionDisplayPpString: @ 80308A8
pop {r0}
bx r0
.align 2, 0
-_080308C4: .4byte gUnknown_202298C
+_080308C4: .4byte gDisplayedStringBattle
_080308C8: .4byte gUnknown_83FE766
thumb_func_end MoveSelectionDisplayPpString
@@ -4637,7 +4637,7 @@ MoveSelectionDisplayPpNumber: @ 80308CC
lsls r4, r1, 9
adds r0, r5, 0x4
adds r4, r0
- ldr r6, _08030938 @ =gUnknown_202298C
+ ldr r6, _08030938 @ =gDisplayedStringBattle
ldr r5, _0803093C @ =gUnknown_2023FFC
adds r1, r5
adds r0, r4, 0
@@ -4671,7 +4671,7 @@ _08030928:
.align 2, 0
_08030930: .4byte gUnknown_2022BC4
_08030934: .4byte gActiveBattler
-_08030938: .4byte gUnknown_202298C
+_08030938: .4byte gDisplayedStringBattle
_0803093C: .4byte gUnknown_2023FFC
thumb_func_end MoveSelectionDisplayPpNumber
@@ -4683,7 +4683,7 @@ MoveSelectionDisplayMoveType: @ 8030940
lsls r4, 9
ldr r0, _080309B0 @ =gUnknown_2022BC8
adds r4, r0
- ldr r6, _080309B4 @ =gUnknown_202298C
+ ldr r6, _080309B4 @ =gDisplayedStringBattle
ldr r1, _080309B8 @ =gUnknown_83FE76A
adds r0, r6, 0
bl StringCopy
@@ -4729,7 +4729,7 @@ MoveSelectionDisplayMoveType: @ 8030940
.align 2, 0
_080309AC: .4byte gActiveBattler
_080309B0: .4byte gUnknown_2022BC8
-_080309B4: .4byte gUnknown_202298C
+_080309B4: .4byte gDisplayedStringBattle
_080309B8: .4byte gUnknown_83FE76A
_080309BC: .4byte gUnknown_83FE770
_080309C0: .4byte gBattleMoves
@@ -6192,12 +6192,12 @@ _080315C4:
adds r0, r4, 0
movs r1, 0xB
adds r2, r6, 0
- bl sub_804037C
+ bl SetMonData
adds r2, r6, 0
adds r2, 0x2E
adds r0, r4, 0
movs r1, 0xC
- bl sub_804037C
+ bl SetMonData
movs r0, 0
mov r8, r0
movs r0, 0x3B
@@ -6238,12 +6238,12 @@ _0803162A:
adds r1, 0xD
mov r0, r9
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
mov r1, r8
adds r1, 0x11
mov r0, r9
adds r2, r7, 0
- bl sub_804037C
+ bl SetMonData
adds r7, 0x1
adds r4, 0x2
movs r0, 0x1
@@ -6259,15 +6259,15 @@ _0803162A:
adds r0, r4, 0
movs r1, 0x15
mov r2, r10
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x20
ldr r2, [sp, 0x20]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x19
ldr r2, [sp, 0x28]
- bl sub_804037C
+ bl SetMonData
ldrb r0, [r6, 0x14]
lsls r0, 27
lsrs r0, 27
@@ -6276,7 +6276,7 @@ _0803162A:
adds r0, r4, 0
movs r1, 0x27
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldrh r0, [r6, 0x14]
lsls r0, 22
@@ -6285,7 +6285,7 @@ _0803162A:
adds r0, r4, 0
movs r1, 0x28
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldrb r0, [r6, 0x15]
lsls r0, 25
@@ -6294,7 +6294,7 @@ _0803162A:
adds r0, r4, 0
movs r1, 0x29
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldr r0, [r6, 0x14]
lsls r0, 12
@@ -6303,7 +6303,7 @@ _0803162A:
adds r0, r4, 0
movs r1, 0x2A
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldrh r0, [r6, 0x16]
lsls r0, 23
@@ -6312,7 +6312,7 @@ _0803162A:
adds r0, r4, 0
movs r1, 0x2B
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
ldrb r0, [r6, 0x17]
lsls r0, 26
@@ -6321,47 +6321,47 @@ _0803162A:
adds r0, r4, 0
movs r1, 0x2C
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0
ldr r2, [sp, 0x2C]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x37
ldr r2, [sp, 0x30]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x38
ldr r2, [sp, 0x1C]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x39
ldr r2, [sp, 0x18]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3A
ldr r2, [sp, 0x24]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3B
ldr r2, [sp, 0x4]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3C
ldr r2, [sp, 0x8]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3D
ldr r2, [sp, 0xC]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3E
ldr r2, [sp, 0x10]
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3F
ldr r2, [sp, 0x14]
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031758: .4byte gPlayerParty
@@ -6375,7 +6375,7 @@ _0803175C:
lsls r2, 9
adds r2, r7
movs r1, 0xB
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031774: .4byte gPlayerParty
@@ -6390,7 +6390,7 @@ _0803177C:
lsls r2, 9
adds r2, r7
movs r1, 0xC
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031794: .4byte gPlayerParty
@@ -6414,12 +6414,12 @@ _080317B6:
adds r1, 0xD
adds r0, r7, 0
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
mov r1, r8
adds r1, 0x11
adds r0, r7, 0
adds r2, r6, 0
- bl sub_804037C
+ bl SetMonData
adds r6, 0x1
adds r4, 0x2
movs r0, 0x1
@@ -6433,7 +6433,7 @@ _080317B6:
adds r0, r1
movs r1, 0x15
mov r2, r9
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_080317F0: .4byte gPlayerParty
@@ -6467,35 +6467,35 @@ _0803181C:
adds r2, r7
adds r0, r4, 0
movs r1, 0x11
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x1
adds r2, r0
adds r0, r4, 0
movs r1, 0x12
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x2
adds r2, r0
adds r0, r4, 0
movs r1, 0x13
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x3
adds r2, r0
adds r0, r4, 0
movs r1, 0x14
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x4
adds r2, r0
adds r0, r4, 0
movs r1, 0x15
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031878: .4byte gPlayerParty
@@ -6516,7 +6516,7 @@ _08031880:
_08031898:
adds r3, 0x3
adds r2, r3
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_080318A4: .4byte gPlayerParty
@@ -6532,7 +6532,7 @@ _080318B0:
lsls r2, 9
adds r2, r7
movs r1, 0x1
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_080318C8: .4byte gPlayerParty
@@ -6547,7 +6547,7 @@ _080318D0:
lsls r2, 9
adds r2, r7
movs r1, 0x19
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_080318E8: .4byte gPlayerParty
@@ -6562,7 +6562,7 @@ _080318F0:
lsls r2, 9
adds r2, r7
movs r1, 0x1A
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031908: .4byte gPlayerParty
@@ -6577,7 +6577,7 @@ _08031910:
lsls r2, 9
adds r2, r7
movs r1, 0x1B
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031928: .4byte gPlayerParty
@@ -6592,7 +6592,7 @@ _08031930:
lsls r2, 9
adds r2, r7
movs r1, 0x1C
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031948: .4byte gPlayerParty
@@ -6607,7 +6607,7 @@ _08031950:
lsls r2, 9
adds r2, r7
movs r1, 0x1D
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031968: .4byte gPlayerParty
@@ -6622,7 +6622,7 @@ _08031970:
lsls r2, 9
adds r2, r7
movs r1, 0x1E
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031988: .4byte gPlayerParty
@@ -6637,7 +6637,7 @@ _08031990:
lsls r2, 9
adds r2, r7
movs r1, 0x1F
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_080319A8: .4byte gPlayerParty
@@ -6652,7 +6652,7 @@ _080319B0:
lsls r2, 9
adds r2, r7
movs r1, 0x20
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_080319C8: .4byte gPlayerParty
@@ -6667,7 +6667,7 @@ _080319D0:
lsls r2, 9
adds r2, r7
movs r1, 0x22
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_080319E8: .4byte gPlayerParty
@@ -6682,7 +6682,7 @@ _080319F0:
lsls r2, 9
adds r2, r7
movs r1, 0x23
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031A08: .4byte gPlayerParty
@@ -6697,7 +6697,7 @@ _08031A10:
lsls r2, 9
adds r2, r7
movs r1, 0x24
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031A28: .4byte gPlayerParty
@@ -6712,7 +6712,7 @@ _08031A30:
lsls r2, 9
adds r2, r7
movs r1, 0x25
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031A48: .4byte gPlayerParty
@@ -6727,7 +6727,7 @@ _08031A50:
lsls r2, 9
adds r2, r7
movs r1, 0x26
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031A68: .4byte gPlayerParty
@@ -6744,35 +6744,35 @@ _08031A70:
adds r2, r7
adds r0, r4, 0
movs r1, 0x27
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x1
adds r2, r0
adds r0, r4, 0
movs r1, 0x28
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x2
adds r2, r0
adds r0, r4, 0
movs r1, 0x29
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x3
adds r2, r0
adds r0, r4, 0
movs r1, 0x2A
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x4
adds r2, r0
adds r0, r4, 0
movs r1, 0x2B
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x5
@@ -6792,7 +6792,7 @@ _08031AE0:
lsls r2, 9
adds r2, r7
movs r1, 0x27
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031AF8: .4byte gPlayerParty
@@ -6807,7 +6807,7 @@ _08031B00:
lsls r2, 9
adds r2, r7
movs r1, 0x28
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031B18: .4byte gPlayerParty
@@ -6822,7 +6822,7 @@ _08031B20:
lsls r2, 9
adds r2, r7
movs r1, 0x29
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031B38: .4byte gPlayerParty
@@ -6837,7 +6837,7 @@ _08031B40:
lsls r2, 9
adds r2, r7
movs r1, 0x2A
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031B58: .4byte gPlayerParty
@@ -6852,7 +6852,7 @@ _08031B60:
lsls r2, 9
adds r2, r7
movs r1, 0x2B
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031B78: .4byte gPlayerParty
@@ -6868,7 +6868,7 @@ _08031B80:
adds r2, r7
_08031B90:
movs r1, 0x2C
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031B98: .4byte gPlayerParty
@@ -6883,7 +6883,7 @@ _08031BA0:
lsls r2, 9
adds r2, r7
movs r1, 0
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031BB8: .4byte gPlayerParty
@@ -6898,7 +6898,7 @@ _08031BC0:
lsls r2, 9
adds r2, r7
movs r1, 0x9
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031BD8: .4byte gPlayerParty
@@ -6913,7 +6913,7 @@ _08031BE0:
lsls r2, 9
adds r2, r7
movs r1, 0x37
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031BF8: .4byte gPlayerParty
@@ -6928,7 +6928,7 @@ _08031C00:
lsls r2, 9
adds r2, r7
movs r1, 0x38
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031C18: .4byte gPlayerParty
@@ -6943,7 +6943,7 @@ _08031C20:
lsls r2, 9
adds r2, r7
movs r1, 0x39
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031C38: .4byte gPlayerParty
@@ -6958,7 +6958,7 @@ _08031C40:
lsls r2, 9
adds r2, r7
movs r1, 0x3A
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031C58: .4byte gPlayerParty
@@ -6973,7 +6973,7 @@ _08031C60:
lsls r2, 9
adds r2, r7
movs r1, 0x3B
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031C78: .4byte gPlayerParty
@@ -6988,7 +6988,7 @@ _08031C80:
lsls r2, 9
adds r2, r7
movs r1, 0x3C
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031C98: .4byte gPlayerParty
@@ -7003,7 +7003,7 @@ _08031CA0:
lsls r2, 9
adds r2, r7
movs r1, 0x3D
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031CB8: .4byte gPlayerParty
@@ -7018,7 +7018,7 @@ _08031CC0:
lsls r2, 9
adds r2, r7
movs r1, 0x3E
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031CD8: .4byte gPlayerParty
@@ -7033,7 +7033,7 @@ _08031CE0:
lsls r2, 9
adds r2, r7
movs r1, 0x3F
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031CF8: .4byte gPlayerParty
@@ -7048,7 +7048,7 @@ _08031D00:
lsls r2, 9
adds r2, r7
movs r1, 0x16
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031D18: .4byte gPlayerParty
@@ -7063,7 +7063,7 @@ _08031D20:
lsls r2, 9
adds r2, r7
movs r1, 0x17
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031D38: .4byte gPlayerParty
@@ -7078,7 +7078,7 @@ _08031D40:
lsls r2, 9
adds r2, r7
movs r1, 0x18
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031D58: .4byte gPlayerParty
@@ -7093,7 +7093,7 @@ _08031D60:
lsls r2, 9
adds r2, r7
movs r1, 0x21
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031D78: .4byte gPlayerParty
@@ -7108,7 +7108,7 @@ _08031D80:
lsls r2, 9
adds r2, r7
movs r1, 0x2F
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031D98: .4byte gPlayerParty
@@ -7123,7 +7123,7 @@ _08031DA0:
lsls r2, 9
adds r2, r7
movs r1, 0x30
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031DB8: .4byte gPlayerParty
@@ -7138,7 +7138,7 @@ _08031DC0:
lsls r2, 9
adds r2, r7
movs r1, 0x32
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031DD8: .4byte gPlayerParty
@@ -7153,7 +7153,7 @@ _08031DE0:
lsls r2, 9
adds r2, r7
movs r1, 0x33
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031DF8: .4byte gPlayerParty
@@ -7168,7 +7168,7 @@ _08031E00:
lsls r2, 9
adds r2, r7
movs r1, 0x34
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031E18: .4byte gPlayerParty
@@ -7183,7 +7183,7 @@ _08031E20:
lsls r2, 9
adds r2, r7
movs r1, 0x35
- bl sub_804037C
+ bl SetMonData
b _08031E56
.align 2, 0
_08031E38: .4byte gPlayerParty
@@ -7198,7 +7198,7 @@ _08031E40:
lsls r2, 9
adds r2, r7
movs r1, 0x36
- bl sub_804037C
+ bl SetMonData
_08031E56:
ldr r2, _08031E88 @ =gBattlerPartyIndexes
ldr r0, _08031E84 @ =gActiveBattler
@@ -7437,13 +7437,13 @@ sub_8031FF4: @ 8031FF4
mov r1, r9
strb r0, [r1]
adds r0, r6, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
mov r0, r8
bl sub_803F7D4
- ldr r0, _0803214C @ =gUnknown_20244DC
+ ldr r0, _0803214C @ =gMultiuseSpriteTemplate
mov r10, r0
adds r0, r6, 0
movs r1, 0x2
@@ -7506,7 +7506,7 @@ sub_8031FF4: @ 8031FF4
adds r0, r1
lsls r0, 2
adds r0, r5
- ldr r1, _08032158 @ =gUnknown_2024024
+ ldr r1, _08032158 @ =gBattleMonForms
adds r6, r1
ldrb r1, [r6]
bl StartSpriteAnim
@@ -7554,10 +7554,10 @@ _0803213C: .4byte gUnknown_2022BC4
_08032140: .4byte gPlayerParty
_08032144: .4byte sub_8033E3C
_08032148: .4byte gUnknown_3004FFC
-_0803214C: .4byte gUnknown_20244DC
+_0803214C: .4byte gMultiuseSpriteTemplate
_08032150: .4byte gUnknown_2023D44
_08032154: .4byte gSprites
-_08032158: .4byte gUnknown_2024024
+_08032158: .4byte gBattleMonForms
_0803215C: .4byte SpriteCallbackDummy
thumb_func_end sub_8031FF4
@@ -7715,7 +7715,7 @@ sub_803227C: @ 803227C
beq _080322AC
ldr r0, _080322A8 @ =gActiveBattler
ldrb r0, [r0]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x2
ands r1, r0
movs r7, 0x20
@@ -7736,7 +7736,7 @@ _080322AE:
cmp r0, 0
beq _0803233C
bl GetMultiplayerId
- ldr r5, _08032324 @ =gUnknown_202273C
+ ldr r5, _08032324 @ =gLinkPlayers
lsls r0, 24
lsrs r0, 24
lsls r1, r0, 3
@@ -7772,7 +7772,7 @@ _080322AE:
bne _08032328
_08032306:
bl GetMultiplayerId
- ldr r2, _08032324 @ =gUnknown_202273C
+ ldr r2, _08032324 @ =gLinkPlayers
lsls r0, 24
lsrs r0, 24
lsls r1, r0, 3
@@ -7784,7 +7784,7 @@ _08032306:
b _08032342
.align 2, 0
_08032320: .4byte gBattleTypeFlags
-_08032324: .4byte gUnknown_202273C
+_08032324: .4byte gLinkPlayers
_08032328:
bl GetMultiplayerId
lsls r0, 24
@@ -7805,13 +7805,13 @@ _08032342:
adds r0, r4, 0
bl sub_8034750
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
adds r0, r4, 0
- bl sub_803F864
- ldr r6, _08032408 @ =gUnknown_20244DC
+ bl SetMultiuseSpriteTemplateToTrainerBack
+ ldr r6, _08032408 @ =gMultiuseSpriteTemplate
mov r8, r7
ldr r0, _0803240C @ =gUnknown_8239F8C
lsls r4, 2
@@ -7893,7 +7893,7 @@ _08032342:
.align 2, 0
_08032400: .4byte gSaveBlock2Ptr
_08032404: .4byte gActiveBattler
-_08032408: .4byte gUnknown_20244DC
+_08032408: .4byte gMultiuseSpriteTemplate
_0803240C: .4byte gUnknown_8239F8C
_08032410: .4byte gUnknown_2023D44
_08032414: .4byte gSprites
@@ -7913,7 +7913,7 @@ sub_8032428: @ 8032428
cmp r0, 0
beq _080324B8
bl GetMultiplayerId
- ldr r5, _080324A0 @ =gUnknown_202273C
+ ldr r5, _080324A0 @ =gLinkPlayers
lsls r0, 24
lsrs r0, 24
lsls r1, r0, 3
@@ -7949,7 +7949,7 @@ sub_8032428: @ 8032428
bne _080324A4
_08032482:
bl GetMultiplayerId
- ldr r2, _080324A0 @ =gUnknown_202273C
+ ldr r2, _080324A0 @ =gLinkPlayers
lsls r0, 24
lsrs r0, 24
lsls r1, r0, 3
@@ -7961,7 +7961,7 @@ _08032482:
b _080324BE
.align 2, 0
_0803249C: .4byte gBattleTypeFlags
-_080324A0: .4byte gUnknown_202273C
+_080324A0: .4byte gLinkPlayers
_080324A4:
bl GetMultiplayerId
lsls r0, 24
@@ -7982,13 +7982,13 @@ _080324BE:
adds r0, r4, 0
bl sub_8034750
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
adds r0, r4, 0
- bl sub_803F864
- ldr r0, _08032570 @ =gUnknown_20244DC
+ bl SetMultiuseSpriteTemplateToTrainerBack
+ ldr r0, _08032570 @ =gMultiuseSpriteTemplate
ldr r1, _08032574 @ =gUnknown_8239F8C
lsls r4, 2
adds r4, r1
@@ -8061,7 +8061,7 @@ _080324BE:
.align 2, 0
_08032568: .4byte gSaveBlock2Ptr
_0803256C: .4byte gActiveBattler
-_08032570: .4byte gUnknown_20244DC
+_08032570: .4byte gMultiuseSpriteTemplate
_08032574: .4byte gUnknown_8239F8C
_08032578: .4byte gUnknown_2023D44
_0803257C: .4byte gSprites
@@ -8307,7 +8307,7 @@ sub_803275C: @ 803275C
ldr r5, _080327A4 @ =gActiveBattler
ldrb r4, [r5]
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r2, r0, 0
lsls r2, 24
lsrs r2, 24
@@ -8351,7 +8351,7 @@ PlayerHandleBallThrowAnim: @ 80327B0
strb r0, [r1]
ldrb r4, [r5]
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r2, r0, 0
lsls r2, 24
lsrs r2, 24
@@ -8764,7 +8764,7 @@ sub_8032AFC: @ 8032AFC
lsls r0, 24
cmp r0, 0
beq _08032B44
- ldr r0, _08032B40 @ =gUnknown_202298C
+ ldr r0, _08032B40 @ =gDisplayedStringBattle
movs r1, 0x40
bl sub_80D87BC
b _08032B4C
@@ -8773,9 +8773,9 @@ _08032B30: .4byte gUnknown_2022974
_08032B34: .4byte gUnknown_2022976
_08032B38: .4byte gActiveBattler
_08032B3C: .4byte gUnknown_2022BC6
-_08032B40: .4byte gUnknown_202298C
+_08032B40: .4byte gDisplayedStringBattle
_08032B44:
- ldr r0, _08032B60 @ =gUnknown_202298C
+ ldr r0, _08032B60 @ =gDisplayedStringBattle
movs r1, 0
bl sub_80D87BC
_08032B4C:
@@ -8790,7 +8790,7 @@ _08032B4C:
pop {r0}
bx r0
.align 2, 0
-_08032B60: .4byte gUnknown_202298C
+_08032B60: .4byte gDisplayedStringBattle
_08032B64: .4byte gUnknown_3004FE0
_08032B68: .4byte gActiveBattler
_08032B6C: .4byte sub_8030610
@@ -8801,7 +8801,7 @@ sub_8032B70: @ 8032B70
push {lr}
ldr r0, _08032B88 @ =gActiveBattler
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08032B8C
@@ -8880,7 +8880,7 @@ _08032BF6:
bl ActionSelectionCreateCursorAt
ldr r0, _08032C40 @ =gUnknown_83FE6D5
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r0, _08032C44 @ =gUnknown_202298C
+ ldr r0, _08032C44 @ =gDisplayedStringBattle
movs r1, 0x1
bl sub_80D87BC
pop {r4}
@@ -8894,7 +8894,7 @@ _08032C34: .4byte gUnknown_83FDA4C
_08032C38: .4byte gUnknown_83FE725
_08032C3C: .4byte gUnknown_2023FF8
_08032C40: .4byte gUnknown_83FE6D5
-_08032C44: .4byte gUnknown_202298C
+_08032C44: .4byte gDisplayedStringBattle
thumb_func_end sub_8032BD4
thumb_func_start nullsub_14
@@ -8997,7 +8997,7 @@ sub_8032CEC: @ 8032CEC
adds r0, r1
ldr r1, _08032D40 @ =sub_8030700
str r1, [r0]
- ldr r1, _08032D44 @ =gUnknown_2024004
+ ldr r1, _08032D44 @ =gBattlerInMenuId
ldrb r0, [r2]
strb r0, [r1]
movs r3, 0
@@ -9023,7 +9023,7 @@ _08032D1A:
_08032D38: .4byte gUnknown_3004FE0
_08032D3C: .4byte gActiveBattler
_08032D40: .4byte sub_8030700
-_08032D44: .4byte gUnknown_2024004
+_08032D44: .4byte gBattlerInMenuId
_08032D48: .4byte gUnknown_203B0DC
_08032D4C: .4byte gUnknown_2022BC4
thumb_func_end sub_8032CEC
@@ -9109,7 +9109,7 @@ _08032DBC:
adds r0, r1
ldr r1, _08032E20 @ =sub_8030628
str r1, [r0]
- ldr r1, _08032E24 @ =gUnknown_2024004
+ ldr r1, _08032E24 @ =gBattlerInMenuId
ldrb r0, [r2]
strb r0, [r1]
add sp, 0x4
@@ -9126,7 +9126,7 @@ _08032E14: .4byte gBattleStruct
_08032E18: .4byte gUnknown_203B0DC
_08032E1C: .4byte gUnknown_3004FE0
_08032E20: .4byte sub_8030628
-_08032E24: .4byte gUnknown_2024004
+_08032E24: .4byte gBattlerInMenuId
thumb_func_end sub_8032D50
thumb_func_start sub_8032E28
@@ -9479,7 +9479,7 @@ PlayerHandleStatusXor: @ 80330C8
adds r0, r5
movs r1, 0x37
mov r2, sp
- bl sub_804037C
+ bl SetMonData
bl PlayerBufferExecCompleted
add sp, 0x4
pop {r3}
@@ -9818,7 +9818,7 @@ PlayerHandlePlaySE: @ 8033390
push {r4,lr}
ldr r4, _080333CC @ =gActiveBattler
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
movs r3, 0x3F
cmp r0, 0
@@ -10290,7 +10290,7 @@ PlayerHandleDrawPartyStatusSummary: @ 803376C
cmp r0, 0
beq _0803379C
adds r0, r2, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _0803379C
@@ -10846,10 +10846,10 @@ _08033C4C:
b _08033D92
_08033C54:
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r4, r0, 0
movs r0, 0x3
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _08033C7C @ =gBitTable
lsls r4, 24
lsrs r4, 22
@@ -10927,10 +10927,10 @@ _08033CE4:
b _08033D90
_08033CEA:
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r4, r0, 0
movs r0, 0x2
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _08033D10 @ =gBitTable
lsls r4, 24
lsrs r4, 22
@@ -10947,12 +10947,12 @@ _08033CEA:
_08033D10: .4byte gBitTable
_08033D14:
ldrb r0, [r3]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x2
eors r0, r1
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _08033D34 @ =gBitTable
lsls r0, 24
lsrs r0, 22
@@ -10974,19 +10974,19 @@ _08033D42:
_08033D48: .4byte gBitTable
_08033D4C:
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r5, r0, 0
ldr r0, _08033DAC @ =gActiveBattler
ldrb r0, [r0]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x2
eors r0, r1
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r4, r0, 0
movs r0, 0x3
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r3, _08033DB0 @ =gBitTable
lsls r5, 24
lsrs r5, 22
diff --git a/asm/battle_controller_pokedude.s b/asm/battle_controller_pokedude.s
index fcfa5d275..5c3c0ebf0 100644
--- a/asm/battle_controller_pokedude.s
+++ b/asm/battle_controller_pokedude.s
@@ -1080,7 +1080,7 @@ _08156922:
movs r1, 0x19
bl GetMonData
str r0, [sp, 0x4]
- ldr r3, _081569E8 @ =gUnknown_8253AE4
+ ldr r3, _081569E8 @ =gExperienceTables
adds r4, 0x1
lsls r4, 2
ldr r2, _081569EC @ =gBaseStats
@@ -1105,7 +1105,7 @@ _08156922:
adds r0, r6, 0
movs r1, 0x19
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
bl CalculateMonStats
ldr r2, [sp]
@@ -1149,7 +1149,7 @@ _081569D6:
_081569DC: .4byte gTasks
_081569E0: .4byte gBattlerPartyIndexes
_081569E4: .4byte gPlayerParty
-_081569E8: .4byte gUnknown_8253AE4
+_081569E8: .4byte gExperienceTables
_081569EC: .4byte gBaseStats
_081569F0: .4byte gActiveBattler
_081569F4: .4byte sub_8156C68
@@ -1170,7 +1170,7 @@ _08156A10:
add r2, sp, 0x4
adds r0, r6, 0
movs r1, 0x19
- bl sub_804037C
+ bl SetMonData
ldr r1, _08156A30 @ =gUnknown_3004FE0
ldr r3, [sp, 0x8]
lsls r0, r3, 2
@@ -1249,7 +1249,7 @@ sub_8156A54: @ 8156A54
movs r1, 0x19
bl GetMonData
adds r3, r0, 0
- ldr r6, _08156B14 @ =gUnknown_8253AE4
+ ldr r6, _08156B14 @ =gExperienceTables
lsls r1, r4, 2
ldr r2, _08156B18 @ =gBaseStats
lsls r0, r5, 3
@@ -1294,7 +1294,7 @@ sub_8156A54: @ 8156A54
.align 2, 0
_08156B0C: .4byte gTasks
_08156B10: .4byte gPlayerParty
-_08156B14: .4byte gUnknown_8253AE4
+_08156B14: .4byte gExperienceTables
_08156B18: .4byte gBaseStats
_08156B1C: .4byte gUnknown_3004FF0
_08156B20: .4byte sub_8156B24
@@ -1372,7 +1372,7 @@ _08156B54:
bl GetMonData
lsls r0, 16
lsrs r0, 16
- ldr r3, _08156C24 @ =gUnknown_8253AE4
+ ldr r3, _08156C24 @ =gExperienceTables
adds r4, 0x1
lsls r4, 2
ldr r2, _08156C28 @ =gBaseStats
@@ -1398,7 +1398,7 @@ _08156B54:
adds r0, r5, 0
movs r1, 0x19
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r5, 0
bl CalculateMonStats
ldr r2, [sp]
@@ -1421,7 +1421,7 @@ _08156B54:
.align 2, 0
_08156C1C: .4byte gUnknown_3004FF0
_08156C20: .4byte gPlayerParty
-_08156C24: .4byte gUnknown_8253AE4
+_08156C24: .4byte gExperienceTables
_08156C28: .4byte gBaseStats
_08156C2C: .4byte gActiveBattler
_08156C30: .4byte sub_8156C68
@@ -1430,7 +1430,7 @@ _08156C34:
add r2, sp, 0x4
adds r0, r5, 0
movs r1, 0x19
- bl sub_804037C
+ bl SetMonData
ldr r1, _08156C60 @ =gUnknown_3004FE0
lsls r0, r7, 2
adds r0, r1
@@ -1630,7 +1630,7 @@ sub_8156DCC: @ 8156DCC
push {r4-r6,lr}
ldr r4, _08156E2C @ =gActiveBattler
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08156E3C
@@ -2124,7 +2124,7 @@ sub_81571A0: @ 81571A0
movs r4, 0
ldr r0, _081571CC @ =gActiveBattler
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _081571D4
@@ -2865,7 +2865,7 @@ sub_81577B4: @ 81577B4
ldr r1, _081577E8 @ =gUnknown_2022BC7
adds r5, r2, r1
mov r8, r5
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _081577F0
@@ -2973,12 +2973,12 @@ _0815791C:
adds r0, r6, 0
movs r1, 0xB
mov r2, r8
- bl sub_804037C
+ bl SetMonData
mov r2, r8
adds r2, 0x2E
adds r0, r6, 0
movs r1, 0xC
- bl sub_804037C
+ bl SetMonData
movs r4, 0
movs r0, 0x3B
add r0, r8
@@ -3020,12 +3020,12 @@ _0815797A:
adds r1, 0xD
adds r0, r6, 0
adds r2, r5, 0
- bl sub_804037C
+ bl SetMonData
adds r1, r4, 0
adds r1, 0x11
adds r0, r6, 0
adds r2, r7, 0
- bl sub_804037C
+ bl SetMonData
adds r7, 0x1
adds r5, 0x2
adds r4, 0x1
@@ -3034,15 +3034,15 @@ _0815797A:
adds r0, r6, 0
movs r1, 0x15
mov r2, r9
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
movs r1, 0x20
mov r2, r10
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
movs r1, 0x19
ldr r2, [sp, 0x10]
- bl sub_804037C
+ bl SetMonData
mov r1, r8
ldrb r0, [r1, 0x14]
lsls r0, 27
@@ -3052,7 +3052,7 @@ _0815797A:
adds r0, r6, 0
movs r1, 0x27
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
mov r2, r8
ldrh r0, [r2, 0x14]
@@ -3062,7 +3062,7 @@ _0815797A:
adds r0, r6, 0
movs r1, 0x28
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
mov r2, r8
ldrb r0, [r2, 0x15]
@@ -3072,7 +3072,7 @@ _0815797A:
adds r0, r6, 0
movs r1, 0x29
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
mov r2, r8
ldr r0, [r2, 0x14]
@@ -3082,7 +3082,7 @@ _0815797A:
adds r0, r6, 0
movs r1, 0x2A
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
mov r2, r8
ldrh r0, [r2, 0x16]
@@ -3092,7 +3092,7 @@ _0815797A:
adds r0, r6, 0
movs r1, 0x2B
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, sp
mov r2, r8
ldrb r0, [r2, 0x17]
@@ -3102,47 +3102,47 @@ _0815797A:
adds r0, r6, 0
movs r1, 0x2C
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
movs r1, 0
ldr r2, [sp, 0x14]
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
movs r1, 0x37
ldr r2, [sp, 0x18]
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
movs r1, 0x38
ldr r2, [sp, 0x8]
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
movs r1, 0x39
ldr r2, [sp, 0x4]
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
movs r1, 0x3A
ldr r2, [sp, 0xC]
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
movs r1, 0x3B
ldr r2, [sp, 0x1C]
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
movs r1, 0x3C
ldr r2, [sp, 0x20]
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
movs r1, 0x3D
ldr r2, [sp, 0x24]
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
movs r1, 0x3E
ldr r2, [sp, 0x28]
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
movs r1, 0x3F
ldr r2, [sp, 0x2C]
- bl sub_804037C
+ bl SetMonData
b _0815809A
_08157AA4:
ldr r0, _08157AB8 @ =gActiveBattler
@@ -3152,7 +3152,7 @@ _08157AA4:
adds r2, r0
adds r0, r6, 0
movs r1, 0xB
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157AB8: .4byte gActiveBattler
@@ -3165,7 +3165,7 @@ _08157AC0:
adds r2, r0
adds r0, r6, 0
movs r1, 0xC
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157AD4: .4byte gActiveBattler
@@ -3182,12 +3182,12 @@ _08157AE8:
adds r1, 0xD
adds r0, r6, 0
adds r2, r5, 0
- bl sub_804037C
+ bl SetMonData
adds r1, r4, 0
adds r1, 0x11
adds r0, r6, 0
adds r2, r7, 0
- bl sub_804037C
+ bl SetMonData
adds r7, 0x1
adds r5, 0x2
adds r4, 0x1
@@ -3196,7 +3196,7 @@ _08157AE8:
adds r0, r6, 0
movs r1, 0x15
mov r2, r8
- bl sub_804037C
+ bl SetMonData
b _0815809A
_08157B16:
ldr r0, _08157B28 @ =gActiveBattler
@@ -3217,35 +3217,35 @@ _08157B2C:
adds r2, r4
adds r0, r6, 0
movs r1, 0x11
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r4, 0x1
adds r2, r0
adds r0, r6, 0
movs r1, 0x12
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r4, 0x2
adds r2, r0
adds r0, r6, 0
movs r1, 0x13
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r4, 0x3
adds r2, r0
adds r0, r6, 0
movs r1, 0x14
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r4, 0x4
adds r2, r4
adds r0, r6, 0
movs r1, 0x15
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157B80: .4byte gActiveBattler
@@ -3262,7 +3262,7 @@ _08157B96:
adds r0, r3, 0x3
adds r2, r0
adds r0, r6, 0
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157BA4: .4byte gActiveBattler
@@ -3274,7 +3274,7 @@ _08157BA8:
adds r2, r0
adds r0, r6, 0
movs r1, 0x1
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157BBC: .4byte gActiveBattler
@@ -3287,7 +3287,7 @@ _08157BC4:
adds r2, r0
adds r0, r6, 0
movs r1, 0x19
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157BD8: .4byte gActiveBattler
@@ -3300,7 +3300,7 @@ _08157BE0:
adds r2, r0
adds r0, r6, 0
movs r1, 0x1A
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157BF4: .4byte gActiveBattler
@@ -3313,7 +3313,7 @@ _08157BFC:
adds r2, r0
adds r0, r6, 0
movs r1, 0x1B
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157C10: .4byte gActiveBattler
@@ -3326,7 +3326,7 @@ _08157C18:
adds r2, r0
adds r0, r6, 0
movs r1, 0x1C
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157C2C: .4byte gActiveBattler
@@ -3339,7 +3339,7 @@ _08157C34:
adds r2, r0
adds r0, r6, 0
movs r1, 0x1D
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157C48: .4byte gActiveBattler
@@ -3352,7 +3352,7 @@ _08157C50:
adds r2, r0
adds r0, r6, 0
movs r1, 0x1E
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157C64: .4byte gActiveBattler
@@ -3365,7 +3365,7 @@ _08157C6C:
adds r2, r0
adds r0, r6, 0
movs r1, 0x1F
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157C80: .4byte gActiveBattler
@@ -3378,7 +3378,7 @@ _08157C88:
adds r2, r0
adds r0, r6, 0
movs r1, 0x20
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157C9C: .4byte gActiveBattler
@@ -3391,7 +3391,7 @@ _08157CA4:
adds r2, r0
adds r0, r6, 0
movs r1, 0x22
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157CB8: .4byte gActiveBattler
@@ -3404,7 +3404,7 @@ _08157CC0:
adds r2, r0
adds r0, r6, 0
movs r1, 0x23
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157CD4: .4byte gActiveBattler
@@ -3417,7 +3417,7 @@ _08157CDC:
adds r2, r0
adds r0, r6, 0
movs r1, 0x24
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157CF0: .4byte gActiveBattler
@@ -3430,7 +3430,7 @@ _08157CF8:
adds r2, r0
adds r0, r6, 0
movs r1, 0x25
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157D0C: .4byte gActiveBattler
@@ -3443,7 +3443,7 @@ _08157D14:
adds r2, r0
adds r0, r6, 0
movs r1, 0x26
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157D28: .4byte gActiveBattler
@@ -3456,35 +3456,35 @@ _08157D30:
adds r2, r4
adds r0, r6, 0
movs r1, 0x27
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r4, 0x1
adds r2, r0
adds r0, r6, 0
movs r1, 0x28
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r4, 0x2
adds r2, r0
adds r0, r6, 0
movs r1, 0x29
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r4, 0x3
adds r2, r0
adds r0, r6, 0
movs r1, 0x2A
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r4, 0x4
adds r2, r0
adds r0, r6, 0
movs r1, 0x2B
- bl sub_804037C
+ bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r4, 0x5
@@ -3501,7 +3501,7 @@ _08157D94:
adds r2, r0
adds r0, r6, 0
movs r1, 0x27
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157DA8: .4byte gActiveBattler
@@ -3514,7 +3514,7 @@ _08157DB0:
adds r2, r0
adds r0, r6, 0
movs r1, 0x28
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157DC4: .4byte gActiveBattler
@@ -3527,7 +3527,7 @@ _08157DCC:
adds r2, r0
adds r0, r6, 0
movs r1, 0x29
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157DE0: .4byte gActiveBattler
@@ -3540,7 +3540,7 @@ _08157DE8:
adds r2, r0
adds r0, r6, 0
movs r1, 0x2A
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157DFC: .4byte gActiveBattler
@@ -3553,7 +3553,7 @@ _08157E04:
adds r2, r0
adds r0, r6, 0
movs r1, 0x2B
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157E18: .4byte gActiveBattler
@@ -3567,7 +3567,7 @@ _08157E20:
_08157E2A:
adds r0, r6, 0
movs r1, 0x2C
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157E34: .4byte gActiveBattler
@@ -3580,7 +3580,7 @@ _08157E3C:
adds r2, r0
adds r0, r6, 0
movs r1, 0
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157E50: .4byte gActiveBattler
@@ -3593,7 +3593,7 @@ _08157E58:
adds r2, r0
adds r0, r6, 0
movs r1, 0x9
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157E6C: .4byte gActiveBattler
@@ -3606,7 +3606,7 @@ _08157E74:
adds r2, r0
adds r0, r6, 0
movs r1, 0x37
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157E88: .4byte gActiveBattler
@@ -3619,7 +3619,7 @@ _08157E90:
adds r2, r0
adds r0, r6, 0
movs r1, 0x38
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157EA4: .4byte gActiveBattler
@@ -3632,7 +3632,7 @@ _08157EAC:
adds r2, r0
adds r0, r6, 0
movs r1, 0x39
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157EC0: .4byte gActiveBattler
@@ -3645,7 +3645,7 @@ _08157EC8:
adds r2, r0
adds r0, r6, 0
movs r1, 0x3A
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157EDC: .4byte gActiveBattler
@@ -3658,7 +3658,7 @@ _08157EE4:
adds r2, r0
adds r0, r6, 0
movs r1, 0x3B
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157EF8: .4byte gActiveBattler
@@ -3671,7 +3671,7 @@ _08157F00:
adds r2, r0
adds r0, r6, 0
movs r1, 0x3C
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157F14: .4byte gActiveBattler
@@ -3684,7 +3684,7 @@ _08157F1C:
adds r2, r0
adds r0, r6, 0
movs r1, 0x3D
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157F30: .4byte gActiveBattler
@@ -3697,7 +3697,7 @@ _08157F38:
adds r2, r0
adds r0, r6, 0
movs r1, 0x3E
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157F4C: .4byte gActiveBattler
@@ -3710,7 +3710,7 @@ _08157F54:
adds r2, r0
adds r0, r6, 0
movs r1, 0x3F
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157F68: .4byte gActiveBattler
@@ -3723,7 +3723,7 @@ _08157F70:
adds r2, r0
adds r0, r6, 0
movs r1, 0x16
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157F84: .4byte gActiveBattler
@@ -3736,7 +3736,7 @@ _08157F8C:
adds r2, r0
adds r0, r6, 0
movs r1, 0x17
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157FA0: .4byte gActiveBattler
@@ -3749,7 +3749,7 @@ _08157FA8:
adds r2, r0
adds r0, r6, 0
movs r1, 0x18
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157FBC: .4byte gActiveBattler
@@ -3762,7 +3762,7 @@ _08157FC4:
adds r2, r0
adds r0, r6, 0
movs r1, 0x21
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157FD8: .4byte gActiveBattler
@@ -3775,7 +3775,7 @@ _08157FE0:
adds r2, r0
adds r0, r6, 0
movs r1, 0x2F
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08157FF4: .4byte gActiveBattler
@@ -3788,7 +3788,7 @@ _08157FFC:
adds r2, r0
adds r0, r6, 0
movs r1, 0x30
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08158010: .4byte gActiveBattler
@@ -3801,7 +3801,7 @@ _08158018:
adds r2, r0
adds r0, r6, 0
movs r1, 0x32
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_0815802C: .4byte gActiveBattler
@@ -3814,7 +3814,7 @@ _08158034:
adds r2, r0
adds r0, r6, 0
movs r1, 0x33
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08158048: .4byte gActiveBattler
@@ -3827,7 +3827,7 @@ _08158050:
adds r2, r0
adds r0, r6, 0
movs r1, 0x34
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08158064: .4byte gActiveBattler
@@ -3840,7 +3840,7 @@ _0815806C:
adds r2, r0
adds r0, r6, 0
movs r1, 0x35
- bl sub_804037C
+ bl SetMonData
b _0815809A
.align 2, 0
_08158080: .4byte gActiveBattler
@@ -3853,7 +3853,7 @@ _08158088:
adds r2, r0
adds r0, r6, 0
movs r1, 0x36
- bl sub_804037C
+ bl SetMonData
_0815809A:
ldr r2, _081580CC @ =gBattlerPartyIndexes
ldr r0, _081580C4 @ =gActiveBattler
@@ -3927,13 +3927,13 @@ sub_81580E0: @ 81580E0
lsls r5, 24
lsrs r5, 24
ldrb r0, [r6]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
mov r0, r8
bl sub_803F7D4
- ldr r0, _08158220 @ =gUnknown_20244DC
+ ldr r0, _08158220 @ =gMultiuseSpriteTemplate
mov r9, r0
ldrb r0, [r6]
movs r1, 0x2
@@ -4001,7 +4001,7 @@ sub_81580E0: @ 81580E0
adds r0, r1
lsls r0, 2
adds r0, r5
- ldr r1, _08158230 @ =gUnknown_2024024
+ ldr r1, _08158230 @ =gBattleMonForms
adds r2, r1
ldrb r1, [r2]
bl StartSpriteAnim
@@ -4037,11 +4037,11 @@ sub_81580E0: @ 81580E0
_08158214: .4byte gActiveBattler
_08158218: .4byte gBattlerPartyIndexes
_0815821C: .4byte gEnemyParty
-_08158220: .4byte gUnknown_20244DC
+_08158220: .4byte gMultiuseSpriteTemplate
_08158224: .4byte gUnknown_2023D44
_08158228: .4byte gSprites
_0815822C: .4byte 0x0000ff10
-_08158230: .4byte gUnknown_2024024
+_08158230: .4byte gBattleMonForms
_08158234: .4byte gUnknown_3004FE0
_08158238: .4byte sub_8156184
thumb_func_end sub_81580E0
@@ -4175,7 +4175,7 @@ sub_8158344: @ 8158344
push {r7}
ldr r7, _081583D8 @ =gActiveBattler
ldrb r0, [r7]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _081583F0
@@ -4183,13 +4183,13 @@ sub_8158344: @ 8158344
movs r0, 0x4
bl sub_8034750
ldrb r0, [r7]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
movs r0, 0x4
- bl sub_803F864
- ldr r0, _081583DC @ =gUnknown_20244DC
+ bl SetMultiuseSpriteTemplateToTrainerBack
+ ldr r0, _081583DC @ =gMultiuseSpriteTemplate
ldr r1, _081583E0 @ =gUnknown_8239F8C
ldrb r1, [r1, 0x10]
movs r2, 0x8
@@ -4241,7 +4241,7 @@ sub_8158344: @ 8158344
b _081584E2
.align 2, 0
_081583D8: .4byte gActiveBattler
-_081583DC: .4byte gUnknown_20244DC
+_081583DC: .4byte gMultiuseSpriteTemplate
_081583E0: .4byte gUnknown_8239F8C
_081583E4: .4byte gUnknown_2023D44
_081583E8: .4byte gSprites
@@ -4251,13 +4251,13 @@ _081583F0:
movs r0, 0x84
bl sub_80346C4
ldrb r0, [r7]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
movs r0, 0x84
- bl sub_803F864
- ldr r5, _08158510 @ =gUnknown_20244DC
+ bl SetMultiuseSpriteTemplateToTrainerBack
+ ldr r5, _08158510 @ =gMultiuseSpriteTemplate
ldr r0, _08158514 @ =gUnknown_823932C
movs r1, 0x84
mov r8, r1
@@ -4385,7 +4385,7 @@ _081584E2:
pop {r0}
bx r0
.align 2, 0
-_08158510: .4byte gUnknown_20244DC
+_08158510: .4byte gMultiuseSpriteTemplate
_08158514: .4byte gUnknown_823932C
_08158518: .4byte gUnknown_2023D44
_0815851C: .4byte gSprites
@@ -4408,13 +4408,13 @@ sub_8158544: @ 8158544
movs r0, 0x4
bl sub_8034750
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
movs r0, 0x4
- bl sub_803F864
- ldr r0, _081585F0 @ =gUnknown_20244DC
+ bl SetMultiuseSpriteTemplateToTrainerBack
+ ldr r0, _081585F0 @ =gMultiuseSpriteTemplate
ldr r1, _081585F4 @ =gUnknown_8239F8C
ldrb r1, [r1, 0x10]
movs r2, 0x8
@@ -4484,7 +4484,7 @@ sub_8158544: @ 8158544
bx r0
.align 2, 0
_081585EC: .4byte gActiveBattler
-_081585F0: .4byte gUnknown_20244DC
+_081585F0: .4byte gMultiuseSpriteTemplate
_081585F4: .4byte gUnknown_8239F8C
_081585F8: .4byte gUnknown_2023D44
_081585FC: .4byte gSprites
@@ -4554,7 +4554,7 @@ _08158670:
bne _0815872A
strb r0, [r3, 0x4]
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0
@@ -4667,7 +4667,7 @@ sub_8158754: @ 8158754
ldr r5, _0815879C @ =gActiveBattler
ldrb r4, [r5]
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r2, r0, 0
lsls r2, 24
lsrs r2, 24
@@ -4711,7 +4711,7 @@ sub_81587A8: @ 81587A8
strb r0, [r1]
ldrb r4, [r5]
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r2, r0, 0
lsls r2, 24
lsrs r2, 24
@@ -5072,7 +5072,7 @@ sub_8158A88: @ 8158A88
lsls r0, 24
cmp r0, 0
beq _08158AD0
- ldr r0, _08158ACC @ =gUnknown_202298C
+ ldr r0, _08158ACC @ =gDisplayedStringBattle
movs r1, 0x40
bl sub_80D87BC
b _08158AD8
@@ -5081,9 +5081,9 @@ _08158ABC: .4byte gUnknown_2022974
_08158AC0: .4byte gUnknown_2022976
_08158AC4: .4byte gActiveBattler
_08158AC8: .4byte gUnknown_2022BC6
-_08158ACC: .4byte gUnknown_202298C
+_08158ACC: .4byte gDisplayedStringBattle
_08158AD0:
- ldr r0, _08158AEC @ =gUnknown_202298C
+ ldr r0, _08158AEC @ =gDisplayedStringBattle
movs r1, 0
bl sub_80D87BC
_08158AD8:
@@ -5098,7 +5098,7 @@ _08158AD8:
pop {r0}
bx r0
.align 2, 0
-_08158AEC: .4byte gUnknown_202298C
+_08158AEC: .4byte gDisplayedStringBattle
_08158AF0: .4byte gUnknown_3004FE0
_08158AF4: .4byte gActiveBattler
_08158AF8: .4byte sub_815623C
@@ -5109,7 +5109,7 @@ sub_8158AFC: @ 8158AFC
push {lr}
ldr r0, _08158B14 @ =gActiveBattler
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08158B18
@@ -5160,7 +5160,7 @@ sub_8158B60: @ 8158B60
push {r4,lr}
ldr r4, _08158BBC @ =gActiveBattler
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08158BDC
@@ -5193,7 +5193,7 @@ _08158B8E:
bl ActionSelectionCreateCursorAt
ldr r0, _08158BD4 @ =gUnknown_83FE6D5
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r0, _08158BD8 @ =gUnknown_202298C
+ ldr r0, _08158BD8 @ =gDisplayedStringBattle
movs r1, 0x1
bl sub_80D87BC
b _08158BE8
@@ -5205,7 +5205,7 @@ _08158BC8: .4byte gUnknown_83FDA4C
_08158BCC: .4byte gUnknown_83FE725
_08158BD0: .4byte gUnknown_2023FF8
_08158BD4: .4byte gUnknown_83FE6D5
-_08158BD8: .4byte gUnknown_202298C
+_08158BD8: .4byte gDisplayedStringBattle
_08158BDC:
ldr r0, _08158BF0 @ =gUnknown_3004FE0
ldrb r1, [r4]
@@ -5268,7 +5268,7 @@ sub_8158C48: @ 8158C48
push {r4,lr}
ldr r4, _08158C68 @ =gActiveBattler
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08158C74
@@ -5317,7 +5317,7 @@ sub_8158C90: @ 8158C90
adds r0, r1
ldr r1, _08158CE4 @ =sub_8156594
str r1, [r0]
- ldr r1, _08158CE8 @ =gUnknown_2024004
+ ldr r1, _08158CE8 @ =gBattlerInMenuId
ldrb r0, [r2]
strb r0, [r1]
movs r3, 0
@@ -5343,7 +5343,7 @@ _08158CBE:
_08158CDC: .4byte gUnknown_3004FE0
_08158CE0: .4byte gActiveBattler
_08158CE4: .4byte sub_8156594
-_08158CE8: .4byte gUnknown_2024004
+_08158CE8: .4byte gBattlerInMenuId
_08158CEC: .4byte gUnknown_203B0DC
_08158CF0: .4byte gUnknown_2022BC4
thumb_func_end sub_8158C90
@@ -5429,7 +5429,7 @@ _08158D60:
adds r0, r1
ldr r1, _08158DC4 @ =sub_81564F0
str r1, [r0]
- ldr r1, _08158DC8 @ =gUnknown_2024004
+ ldr r1, _08158DC8 @ =gBattlerInMenuId
ldrb r0, [r2]
strb r0, [r1]
add sp, 0x4
@@ -5446,7 +5446,7 @@ _08158DB8: .4byte gBattleStruct
_08158DBC: .4byte gUnknown_203B0DC
_08158DC0: .4byte gUnknown_3004FE0
_08158DC4: .4byte sub_81564F0
-_08158DC8: .4byte gUnknown_2024004
+_08158DC8: .4byte gBattlerInMenuId
thumb_func_end sub_8158CF4
thumb_func_start sub_8158DCC
@@ -5463,7 +5463,7 @@ sub_8158DD8: @ 8158DD8
sub sp, 0x4
ldr r4, _08158DFC @ =gActiveBattler
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08158E08
@@ -5653,7 +5653,7 @@ sub_8158F6C: @ 8158F6C
cmp r0, 0
bne _08158FF2
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08158FA8
@@ -5779,7 +5779,7 @@ sub_815907C: @ 815907C
sub sp, 0x4
ldr r4, _081590A0 @ =gActiveBattler
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _081590AC
@@ -5823,7 +5823,7 @@ _081590BC:
adds r0, r4, 0
movs r1, 0x37
mov r2, sp
- bl sub_804037C
+ bl SetMonData
bl PlayerPartnerBufferExecCompleted
add sp, 0x4
pop {r4}
@@ -6048,7 +6048,7 @@ sub_815926C: @ 815926C
push {r4,lr}
ldr r4, _08159290 @ =gActiveBattler
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _0815929C
@@ -6331,13 +6331,13 @@ sub_8159478: @ 8159478
mov r1, r9
strb r0, [r1]
adds r0, r6, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
mov r0, r8
bl sub_803F7D4
- ldr r0, _081595D8 @ =gUnknown_20244DC
+ ldr r0, _081595D8 @ =gMultiuseSpriteTemplate
mov r10, r0
adds r0, r6, 0
movs r1, 0x2
@@ -6400,7 +6400,7 @@ sub_8159478: @ 8159478
adds r0, r1
lsls r0, 2
adds r0, r5
- ldr r1, _081595E4 @ =gUnknown_2024024
+ ldr r1, _081595E4 @ =gBattleMonForms
adds r6, r1
ldrb r1, [r6]
bl StartSpriteAnim
@@ -6449,10 +6449,10 @@ _081595C8: .4byte gUnknown_2022BC4
_081595CC: .4byte gPlayerParty
_081595D0: .4byte sub_8033E3C
_081595D4: .4byte gUnknown_3004FFC
-_081595D8: .4byte gUnknown_20244DC
+_081595D8: .4byte gMultiuseSpriteTemplate
_081595DC: .4byte gUnknown_2023D44
_081595E0: .4byte gSprites
-_081595E4: .4byte gUnknown_2024024
+_081595E4: .4byte gBattleMonForms
_081595E8: .4byte SpriteCallbackDummy
thumb_func_end sub_8159478
@@ -6527,7 +6527,7 @@ sub_8159660: @ 8159660
cmp r0, 0
beq _08159690
adds r0, r2, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08159690
@@ -6757,7 +6757,7 @@ sub_8159824: @ 8159824
ldr r7, [r0]
ldr r4, _081598BC @ =gActiveBattler
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _0815985C
@@ -6786,7 +6786,7 @@ _0815985C:
cmp r0, r1
bne _0815992C
adds r0, r2, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08159888
@@ -6956,7 +6956,7 @@ sub_8159998: @ 8159998
cmp r0, r4
bne _08159A48
adds r0, r2, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _081599DE
@@ -7267,13 +7267,13 @@ _08159C44:
strh r0, [r1]
bl sub_8159EF0
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r0, _08159C60 @ =gUnknown_202298C
+ ldr r0, _08159C60 @ =gDisplayedStringBattle
movs r1, 0x18
bl sub_80D87BC
b _08159C94
.align 2, 0
_08159C5C: .4byte gUnknown_2022976
-_08159C60: .4byte gUnknown_202298C
+_08159C60: .4byte gDisplayedStringBattle
_08159C64:
movs r0, 0x18
bl IsTextPrinterActive
@@ -7402,7 +7402,7 @@ _08159D62:
adds r5, 0x95
adds r4, 0x94
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r2, r0, 0
lsls r2, 24
lsrs r2, 24
@@ -7468,12 +7468,12 @@ _08159DF0: .4byte gUnknown_2037AB8
_08159DF4:
bl sub_8159EF0
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r0, _08159E08 @ =gUnknown_202298C
+ ldr r0, _08159E08 @ =gDisplayedStringBattle
movs r1, 0x18
bl sub_80D87BC
b _08159E84
.align 2, 0
-_08159E08: .4byte gUnknown_202298C
+_08159E08: .4byte gDisplayedStringBattle
_08159E0C:
movs r0, 0x18
bl IsTextPrinterActive
@@ -7566,7 +7566,7 @@ _08159EA4:
bl PlayBGM
_08159EC8:
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
bl sub_80EF0E0
diff --git a/asm/battle_controller_safari.s b/asm/battle_controller_safari.s
index a4e877dcb..e221fe8e9 100644
--- a/asm/battle_controller_safari.s
+++ b/asm/battle_controller_safari.s
@@ -623,13 +623,13 @@ SafariHandleDrawTrainerPic: @ 80DD9C4
ldr r0, [r4]
ldrb r6, [r0, 0x8]
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
adds r0, r6, 0
- bl sub_803F864
- ldr r0, _080DDA84 @ =gUnknown_20244DC
+ bl SetMultiuseSpriteTemplateToTrainerBack
+ ldr r0, _080DDA84 @ =gMultiuseSpriteTemplate
ldr r2, _080DDA88 @ =gUnknown_8239F8C
ldr r1, [r4]
ldrb r1, [r1, 0x8]
@@ -704,7 +704,7 @@ SafariHandleDrawTrainerPic: @ 80DD9C4
.align 2, 0
_080DDA7C: .4byte gSaveBlock2Ptr
_080DDA80: .4byte gActiveBattler
-_080DDA84: .4byte gUnknown_20244DC
+_080DDA84: .4byte gMultiuseSpriteTemplate
_080DDA88: .4byte gUnknown_8239F8C
_080DDA8C: .4byte gUnknown_2023D44
_080DDA90: .4byte gSprites
@@ -760,7 +760,7 @@ sub_80DDAD4: @ 80DDAD4
ldr r5, _080DDB1C @ =gActiveBattler
ldrb r4, [r5]
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r2, r0, 0
lsls r2, 24
lsrs r2, 24
@@ -804,7 +804,7 @@ sub_80DDB28: @ 80DDB28
strb r0, [r1]
ldrb r4, [r5]
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r2, r0, 0
lsls r2, 24
lsrs r2, 24
@@ -866,7 +866,7 @@ sub_80DDBA0: @ 80DDBA0
lsls r0, 24
cmp r0, 0
beq _080DDBE8
- ldr r0, _080DDBE4 @ =gUnknown_202298C
+ ldr r0, _080DDBE4 @ =gDisplayedStringBattle
movs r1, 0x40
bl sub_80D87BC
b _080DDBF0
@@ -875,9 +875,9 @@ _080DDBD4: .4byte gUnknown_2022974
_080DDBD8: .4byte gUnknown_2022976
_080DDBDC: .4byte gActiveBattler
_080DDBE0: .4byte gUnknown_2022BC6
-_080DDBE4: .4byte gUnknown_202298C
+_080DDBE4: .4byte gDisplayedStringBattle
_080DDBE8:
- ldr r0, _080DDC04 @ =gUnknown_202298C
+ ldr r0, _080DDC04 @ =gDisplayedStringBattle
movs r1, 0
bl sub_80D87BC
_080DDBF0:
@@ -892,7 +892,7 @@ _080DDBF0:
pop {r0}
bx r0
.align 2, 0
-_080DDC04: .4byte gUnknown_202298C
+_080DDC04: .4byte gDisplayedStringBattle
_080DDC08: .4byte gUnknown_3004FE0
_080DDC0C: .4byte gActiveBattler
_080DDC10: .4byte CompleteOnInactiveTextPrinter_3
@@ -903,7 +903,7 @@ sub_80DDC14: @ 80DDC14
push {lr}
ldr r0, _080DDC2C @ =gActiveBattler
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080DDC30
@@ -982,7 +982,7 @@ _080DDC9A:
bl ActionSelectionCreateCursorAt
ldr r0, _080DDCE4 @ =gUnknown_83FE6E6
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r0, _080DDCE8 @ =gUnknown_202298C
+ ldr r0, _080DDCE8 @ =gDisplayedStringBattle
movs r1, 0x1
bl sub_80D87BC
pop {r4}
@@ -996,7 +996,7 @@ _080DDCD8: .4byte gUnknown_83FDA4C
_080DDCDC: .4byte gUnknown_83FE747
_080DDCE0: .4byte gUnknown_2023FF8
_080DDCE4: .4byte gUnknown_83FE6E6
-_080DDCE8: .4byte gUnknown_202298C
+_080DDCE8: .4byte gDisplayedStringBattle
thumb_func_end sub_80DDC78
thumb_func_start sub_80DDCEC
@@ -1033,7 +1033,7 @@ sub_80DDD04: @ 80DDD04
adds r0, r1
ldr r1, _080DDD3C @ =sub_80DD82C
str r1, [r0]
- ldr r1, _080DDD40 @ =gUnknown_2024004
+ ldr r1, _080DDD40 @ =gBattlerInMenuId
ldrb r0, [r2]
strb r0, [r1]
add sp, 0x4
@@ -1043,7 +1043,7 @@ sub_80DDD04: @ 80DDD04
_080DDD34: .4byte gUnknown_3004FE0
_080DDD38: .4byte gActiveBattler
_080DDD3C: .4byte sub_80DD82C
-_080DDD40: .4byte gUnknown_2024004
+_080DDD40: .4byte gBattlerInMenuId
thumb_func_end sub_80DDD04
thumb_func_start sub_80DDD44
@@ -1239,7 +1239,7 @@ SafariHandlePlaySE: @ 80DDE70
push {r4,lr}
ldr r4, _080DDEAC @ =gActiveBattler
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
movs r3, 0x3F
cmp r0, 0
diff --git a/asm/battle_controllers.s b/asm/battle_controllers.s
index feb5fb81c..71c39120f 100644
--- a/asm/battle_controllers.s
+++ b/asm/battle_controllers.s
@@ -81,7 +81,7 @@ _0800D298:
movs r4, 0
str r4, [r0]
bl ClearBattleAnimationVars
- bl sub_8043FBC
+ bl ClearBattleMonForms
bl BattleAI_HandleItemUseBeforeAISetup
ldr r0, _0800D304 @ =gUnknown_2022B54
str r4, [r0]
@@ -129,7 +129,7 @@ _0800D328:
cmp r0, 0
bne _0800D356
movs r4, 0
- ldr r0, _0800D360 @ =gUnknown_2023BCC
+ ldr r0, _0800D360 @ =gBattlersCount
ldrb r1, [r0]
cmp r4, r1
bge _0800D356
@@ -149,7 +149,7 @@ _0800D356:
bx r0
.align 2, 0
_0800D35C: .4byte gBattleTypeFlags
-_0800D360: .4byte gUnknown_2023BCC
+_0800D360: .4byte gBattlersCount
thumb_func_end sub_800D30C
thumb_func_start sub_800D364
@@ -177,7 +177,7 @@ sub_800D364: @ 800D364
strb r3, [r0]
str r1, [r2, 0x4]
strb r4, [r0, 0x1]
- ldr r1, _0800D3B0 @ =gUnknown_2023BCC
+ ldr r1, _0800D3B0 @ =gBattlersCount
movs r0, 0x2
b _0800D478
.align 2, 0
@@ -187,7 +187,7 @@ _0800D3A0: .4byte sub_80123C0
_0800D3A4: .4byte gUnknown_3004FE0
_0800D3A8: .4byte sub_81560A4
_0800D3AC: .4byte gUnknown_2023BD6
-_0800D3B0: .4byte gUnknown_2023BCC
+_0800D3B0: .4byte gBattlersCount
_0800D3B4:
movs r0, 0x80
ands r0, r2
@@ -224,7 +224,7 @@ _0800D3E8:
str r0, [r2, 0x4]
movs r0, 0x1
strb r0, [r1, 0x1]
- ldr r1, _0800D410 @ =gUnknown_2023BCC
+ ldr r1, _0800D410 @ =gBattlersCount
movs r0, 0x2
b _0800D478
.align 2, 0
@@ -232,7 +232,7 @@ _0800D400: .4byte gUnknown_3004FE0
_0800D404: .4byte SetBankFuncToPlayerBufferRunCommand
_0800D408: .4byte gUnknown_2023BD6
_0800D40C: .4byte sub_8035A7C
-_0800D410: .4byte gUnknown_2023BCC
+_0800D410: .4byte gBattlersCount
_0800D414:
ldr r1, _0800D444 @ =gUnknown_3004F84
ldr r0, _0800D448 @ =sub_80123C0
@@ -279,7 +279,7 @@ _0800D458:
movs r0, 0x3
strb r0, [r1, 0x3]
_0800D474:
- ldr r1, _0800D490 @ =gUnknown_2023BCC
+ ldr r1, _0800D490 @ =gBattlersCount
movs r0, 0x4
_0800D478:
strb r0, [r1]
@@ -291,7 +291,7 @@ _0800D480: .4byte gUnknown_3004FE0
_0800D484: .4byte SetBankFuncToPlayerBufferRunCommand
_0800D488: .4byte gUnknown_2023BD6
_0800D48C: .4byte sub_8035A7C
-_0800D490: .4byte gUnknown_2023BCC
+_0800D490: .4byte gBattlersCount
thumb_func_end sub_800D364
thumb_func_start sub_800D494
@@ -323,7 +323,7 @@ sub_800D494: @ 800D494
ldr r0, _0800D4E8 @ =sub_803A668
str r0, [r2, 0x4]
strb r5, [r1, 0x1]
- ldr r1, _0800D4EC @ =gUnknown_2023BCC
+ ldr r1, _0800D4EC @ =gBattlersCount
movs r0, 0x2
b _0800D752
.align 2, 0
@@ -334,7 +334,7 @@ _0800D4DC: .4byte gUnknown_3004FE0
_0800D4E0: .4byte SetBankFuncToPlayerBufferRunCommand
_0800D4E4: .4byte gUnknown_2023BD6
_0800D4E8: .4byte sub_803A668
-_0800D4EC: .4byte gUnknown_2023BCC
+_0800D4EC: .4byte gBattlersCount
_0800D4F0:
ldr r2, _0800D508 @ =gUnknown_3004FE0
ldr r0, _0800D50C @ =SetBankFuncToPlayerBufferRunCommand
@@ -344,7 +344,7 @@ _0800D4F0:
ldr r0, _0800D514 @ =sub_803A668
str r0, [r2]
strb r5, [r1]
- ldr r1, _0800D518 @ =gUnknown_2023BCC
+ ldr r1, _0800D518 @ =gBattlersCount
movs r0, 0x2
b _0800D752
.align 2, 0
@@ -352,7 +352,7 @@ _0800D508: .4byte gUnknown_3004FE0
_0800D50C: .4byte SetBankFuncToPlayerBufferRunCommand
_0800D510: .4byte gUnknown_2023BD6
_0800D514: .4byte sub_803A668
-_0800D518: .4byte gUnknown_2023BCC
+_0800D518: .4byte gBattlersCount
_0800D51C:
movs r5, 0x41
ands r5, r0
@@ -405,7 +405,7 @@ _0800D56C:
movs r0, 0x3
strb r0, [r1, 0x2]
_0800D588:
- ldr r0, _0800D5A0 @ =gUnknown_2023BCC
+ ldr r0, _0800D5A0 @ =gBattlersCount
strb r6, [r0]
b _0800D754
.align 2, 0
@@ -413,7 +413,7 @@ _0800D590: .4byte gUnknown_3004FE0
_0800D594: .4byte SetBankFuncToPlayerBufferRunCommand
_0800D598: .4byte gUnknown_2023BD6
_0800D59C: .4byte sub_803A668
-_0800D5A0: .4byte gUnknown_2023BCC
+_0800D5A0: .4byte gBattlersCount
_0800D5A4:
bl GetMultiplayerId
lsls r0, 24
@@ -429,7 +429,7 @@ _0800D5A4:
_0800D5BC:
movs r0, 0
mov r10, r0
- ldr r1, _0800D5EC @ =gUnknown_202273C
+ ldr r1, _0800D5EC @ =gLinkPlayers
mov r12, r1
ldr r7, _0800D5F0 @ =gUnknown_2023BD6
mov r8, r0
@@ -451,21 +451,21 @@ _0800D5D0:
.align 2, 0
_0800D5E4: .4byte gUnknown_3004F84
_0800D5E8: .4byte sub_80123C0
-_0800D5EC: .4byte gUnknown_202273C
+_0800D5EC: .4byte gLinkPlayers
_0800D5F0: .4byte gUnknown_2023BD6
_0800D5F4: .4byte gBattlerPartyIndexes
_0800D5F8:
cmp r0, 0x3
bne _0800D61A
_0800D5FC:
- ldr r0, _0800D60C @ =gUnknown_202273C
+ ldr r0, _0800D60C @ =gLinkPlayers
adds r0, r4, r0
ldrb r0, [r0, 0x18]
movs r1, 0
bl sub_8127DA8
b _0800D61A
.align 2, 0
-_0800D60C: .4byte gUnknown_202273C
+_0800D60C: .4byte gLinkPlayers
_0800D610:
lsls r0, 24
lsrs r0, 24
@@ -474,7 +474,7 @@ _0800D610:
_0800D61A:
cmp r10, r5
bne _0800D66A
- ldr r0, _0800D640 @ =gUnknown_202273C
+ ldr r0, _0800D640 @ =gLinkPlayers
adds r3, r4, r0
ldrh r1, [r3, 0x18]
lsls r1, 2
@@ -492,7 +492,7 @@ _0800D61A:
beq _0800D650
b _0800D740
.align 2, 0
-_0800D640: .4byte gUnknown_202273C
+_0800D640: .4byte gLinkPlayers
_0800D644: .4byte gUnknown_3004FE0
_0800D648: .4byte SetBankFuncToPlayerBufferRunCommand
_0800D64C:
@@ -514,7 +514,7 @@ _0800D660:
ldrh r0, [r3, 0x18]
b _0800D738
_0800D66A:
- ldr r2, _0800D690 @ =gUnknown_202273C
+ ldr r2, _0800D690 @ =gLinkPlayers
adds r0, r4, r2
ldrh r1, [r0, 0x18]
movs r3, 0x1
@@ -534,7 +534,7 @@ _0800D66A:
beq _0800D6A6
b _0800D6EC
.align 2, 0
-_0800D690: .4byte gUnknown_202273C
+_0800D690: .4byte gLinkPlayers
_0800D694:
lsls r0, r5, 3
subs r0, r5
@@ -639,7 +639,7 @@ _0800D740:
bgt _0800D74E
b _0800D5D0
_0800D74E:
- ldr r1, _0800D764 @ =gUnknown_2023BCC
+ ldr r1, _0800D764 @ =gBattlersCount
movs r0, 0x4
_0800D752:
strb r0, [r1]
@@ -652,7 +652,7 @@ _0800D754:
pop {r0}
bx r0
.align 2, 0
-_0800D764: .4byte gUnknown_2023BCC
+_0800D764: .4byte gBattlersCount
thumb_func_end sub_800D494
thumb_func_start sub_800D768
@@ -801,7 +801,7 @@ _0800D888:
_0800D890:
mov r8, r10
_0800D892:
- ldr r0, _0800D8AC @ =gUnknown_2023BCC
+ ldr r0, _0800D8AC @ =gBattlersCount
ldrb r0, [r0]
cmp r8, r0
bge _0800D89C
@@ -815,7 +815,7 @@ _0800D89C:
pop {r0}
bx r0
.align 2, 0
-_0800D8AC: .4byte gUnknown_2023BCC
+_0800D8AC: .4byte gBattlersCount
thumb_func_end sub_800D768
thumb_func_start PrepareBufferDataTransfer
@@ -1413,7 +1413,7 @@ sub_800DD28: @ 800DD28
ands r0, r1
cmp r0, 0
beq _0800DE28
- ldr r0, _0800DD64 @ =gUnknown_202273C
+ ldr r0, _0800DD64 @ =gLinkPlayers
ldr r1, [r0, 0x14]
ldr r0, _0800DD68 @ =0x00002211
cmp r1, r0
@@ -1426,7 +1426,7 @@ sub_800DD28: @ 800DD28
.align 2, 0
_0800DD5C: .4byte gUnknown_3003F64
_0800DD60: .4byte gBattleTypeFlags
-_0800DD64: .4byte gUnknown_202273C
+_0800DD64: .4byte gLinkPlayers
_0800DD68: .4byte 0x00002211
_0800DD6C: .4byte gUnknown_2022118
_0800DD70:
@@ -1709,8 +1709,8 @@ _0800DF9C: .4byte gBitTable
_0800DFA0: .4byte gTasks
thumb_func_end Task_HandleCopyReceivedLinkBuffersData
- thumb_func_start EmitGetMonData
-EmitGetMonData: @ 800DFA4
+ thumb_func_start BtlController_EmitGetMonData
+BtlController_EmitGetMonData: @ 800DFA4
push {r4,lr}
adds r4, r1, 0
lsls r0, 24
@@ -1728,7 +1728,7 @@ EmitGetMonData: @ 800DFA4
bx r0
.align 2, 0
_0800DFC4: .4byte gUnknown_2022874
- thumb_func_end EmitGetMonData
+ thumb_func_end BtlController_EmitGetMonData
thumb_func_start EmitGetRawMonData
EmitGetRawMonData: @ 800DFC8
@@ -2106,7 +2106,7 @@ EmitMoveAnimation: @ 800E1FC
movs r1, 0
movs r2, 0xD
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r0, 24
cmp r0, 0
@@ -2116,7 +2116,7 @@ EmitMoveAnimation: @ 800E1FC
movs r1, 0
movs r2, 0x4D
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
bne _0800E29C
@@ -2194,7 +2194,7 @@ EmitPrintString: @ 800E2D4
ldr r0, _0800E3C4 @ =gUnknown_2023D68
ldrh r0, [r0]
strh r0, [r1, 0x4]
- ldr r0, _0800E3C8 @ =gUnknown_2023D6A
+ ldr r0, _0800E3C8 @ =gLastUsedAbility
ldrb r0, [r0]
strb r0, [r1, 0x6]
ldr r0, _0800E3CC @ =gBattleScripting
@@ -2210,7 +2210,7 @@ EmitPrintString: @ 800E2D4
adds r0, 0xAD
ldrb r0, [r0]
strb r0, [r3, 0x9]
- ldr r0, _0800E3D4 @ =gUnknown_2023D6F
+ ldr r0, _0800E3D4 @ =gPotentialItemEffectBattler
ldrb r0, [r0]
strb r0, [r3, 0xA]
ldr r3, _0800E3D8 @ =gBattleMoves
@@ -2243,12 +2243,12 @@ _0800E35A:
adds r5, 0x10
mov r4, r12
adds r4, 0x20
- ldr r6, _0800E3E4 @ =gUnknown_2022AC8
+ ldr r6, _0800E3E4 @ =gBattleTextBuff2
mov r2, r12
adds r2, 0x30
_0800E378:
adds r1, r5, r3
- ldr r7, _0800E3E8 @ =gUnknown_2022AB8
+ ldr r7, _0800E3E8 @ =gBattleTextBuff1
adds r0, r3, r7
ldrb r0, [r0]
strb r0, [r1]
@@ -2281,15 +2281,15 @@ _0800E3B8: .4byte gUnknown_2023E8A
_0800E3BC: .4byte gCurrentMove
_0800E3C0: .4byte gUnknown_2023D4C
_0800E3C4: .4byte gUnknown_2023D68
-_0800E3C8: .4byte gUnknown_2023D6A
+_0800E3C8: .4byte gLastUsedAbility
_0800E3CC: .4byte gBattleScripting
_0800E3D0: .4byte gBattleStruct
-_0800E3D4: .4byte gUnknown_2023D6F
+_0800E3D4: .4byte gPotentialItemEffectBattler
_0800E3D8: .4byte gBattleMoves
_0800E3DC: .4byte gUnknown_2022AD8
_0800E3E0: .4byte gBattleMons
-_0800E3E4: .4byte gUnknown_2022AC8
-_0800E3E8: .4byte gUnknown_2022AB8
+_0800E3E4: .4byte gBattleTextBuff2
+_0800E3E8: .4byte gBattleTextBuff1
thumb_func_end EmitPrintString
thumb_func_start EmitPrintSelectionString
@@ -2323,7 +2323,7 @@ EmitPrintSelectionString: @ 800E3EC
ldr r0, _0800E4B4 @ =gUnknown_2023D68
ldrh r0, [r0]
strh r0, [r1, 0x4]
- ldr r0, _0800E4B8 @ =gUnknown_2023D6A
+ ldr r0, _0800E4B8 @ =gLastUsedAbility
ldrb r0, [r0]
strb r0, [r1, 0x6]
ldr r0, _0800E4BC @ =gBattleScripting
@@ -2356,12 +2356,12 @@ _0800E44E:
adds r5, 0x10
mov r4, r12
adds r4, 0x20
- ldr r6, _0800E4CC @ =gUnknown_2022AC8
+ ldr r6, _0800E4CC @ =gBattleTextBuff2
mov r2, r12
adds r2, 0x30
_0800E46C:
adds r1, r5, r3
- ldr r7, _0800E4D0 @ =gUnknown_2022AB8
+ ldr r7, _0800E4D0 @ =gBattleTextBuff1
adds r0, r3, r7
ldrb r0, [r0]
strb r0, [r1]
@@ -2393,13 +2393,13 @@ _0800E4A8: .4byte gUnknown_2022874
_0800E4AC: .4byte gCurrentMove
_0800E4B0: .4byte gUnknown_2023D4C
_0800E4B4: .4byte gUnknown_2023D68
-_0800E4B8: .4byte gUnknown_2023D6A
+_0800E4B8: .4byte gLastUsedAbility
_0800E4BC: .4byte gBattleScripting
_0800E4C0: .4byte gBattleStruct
_0800E4C4: .4byte gUnknown_2022AD8
_0800E4C8: .4byte gBattleMons
-_0800E4CC: .4byte gUnknown_2022AC8
-_0800E4D0: .4byte gUnknown_2022AB8
+_0800E4CC: .4byte gBattleTextBuff2
+_0800E4D0: .4byte gBattleTextBuff1
thumb_func_end EmitPrintSelectionString
thumb_func_start EmitChooseAction
diff --git a/asm/battle_dome_cards.s b/asm/battle_dome_cards.s
index 877f1ee42..3ff8f9318 100644
--- a/asm/battle_dome_cards.s
+++ b/asm/battle_dome_cards.s
@@ -291,7 +291,7 @@ _0810BD90: .4byte gUnknown_203AD40
_0810BD94: .4byte gUnknown_82349BC
_0810BD98:
ldr r0, _0810BDA4 @ =gUnknown_203AD40
- ldr r1, _0810BDA8 @ =gUnknown_82390DC
+ ldr r1, _0810BDA8 @ =gTrainerFrontAnimsPtrTable
ldr r1, [r1]
str r1, [r0, 0x8]
_0810BDA0:
@@ -299,7 +299,7 @@ _0810BDA0:
bx r0
.align 2, 0
_0810BDA4: .4byte gUnknown_203AD40
-_0810BDA8: .4byte gUnknown_82390DC
+_0810BDA8: .4byte gTrainerFrontAnimsPtrTable
thumb_func_end uns_builder_assign_animtable1
thumb_func_start oamt_spawn_poke_or_trainer_picture
@@ -1082,21 +1082,21 @@ sub_810C374: @ 810C374
bne _0810C39A
cmp r0, 0
beq _0810C394
- ldr r0, _0810C390 @ =gUnknown_82538A8
+ ldr r0, _0810C390 @ =gFacilityClassToPicIndex
adds r0, 0x87
ldrb r0, [r0]
b _0810C39A
.align 2, 0
-_0810C390: .4byte gUnknown_82538A8
+_0810C390: .4byte gFacilityClassToPicIndex
_0810C394:
- ldr r0, _0810C3A0 @ =gUnknown_82538A8
+ ldr r0, _0810C3A0 @ =gFacilityClassToPicIndex
adds r0, 0x86
ldrb r0, [r0]
_0810C39A:
pop {r1}
bx r1
.align 2, 0
-_0810C3A0: .4byte gUnknown_82538A8
+_0810C3A0: .4byte gFacilityClassToPicIndex
thumb_func_end sub_810C374
.align 2, 0 @ Don't pad with nop.
diff --git a/asm/battle_gfx_sfx_util.s b/asm/battle_gfx_sfx_util.s
index e56df1923..dd319645e 100644
--- a/asm/battle_gfx_sfx_util.s
+++ b/asm/battle_gfx_sfx_util.s
@@ -348,7 +348,7 @@ TryHandleLaunchBattleTableAnimation: @ 803401C
ands r0, r7
cmp r0, 0
beq _08034064
- ldr r0, _08034060 @ =gUnknown_2024024
+ ldr r0, _08034060 @ =gBattleMonForms
adds r0, r6, r0
movs r2, 0x7F
adds r1, r7, 0
@@ -357,7 +357,7 @@ TryHandleLaunchBattleTableAnimation: @ 803401C
movs r0, 0x1
b _08034132
.align 2, 0
-_08034060: .4byte gUnknown_2024024
+_08034060: .4byte gBattleMonForms
_08034064:
ldr r0, _08034090 @ =gUnknown_2024018
mov r9, r0
@@ -753,12 +753,12 @@ _0803436C:
bl GetMonData
mov r10, r0
mov r0, r8
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsls r2, r5, 3
ldr r1, _080343C4 @ =gUnknown_82350AC
adds r2, r1
- ldr r1, _080343C8 @ =gUnknown_202401C
+ ldr r1, _080343C8 @ =gMonSpritesGfxPtr
ldr r1, [r1]
lsrs r0, 22
adds r1, 0x4
@@ -789,7 +789,7 @@ _0803436C:
.align 2, 0
_080343C0: .4byte gUnknown_2024008
_080343C4: .4byte gUnknown_82350AC
-_080343C8: .4byte gUnknown_202401C
+_080343C8: .4byte gMonSpritesGfxPtr
_080343CC: .4byte gUnknown_2024018
_080343D0:
adds r0, r5, 0
@@ -829,7 +829,7 @@ _080343DA:
adds r1, r4
adds r0, r6, 0
bl LZDecompressWram
- ldr r0, _08034480 @ =gUnknown_2024024
+ ldr r0, _08034480 @ =gBattleMonForms
add r0, r8
ldrb r1, [r0]
lsls r1, 5
@@ -872,7 +872,7 @@ _08034468:
.align 2, 0
_08034478: .4byte 0x00000181
_0803447C: .4byte gBattleStruct
-_08034480: .4byte gUnknown_2024024
+_08034480: .4byte gBattleMonForms
_08034484: .4byte gUnknown_2024018
_08034488: .4byte 0x00007fff
_0803448C: .4byte gUnknown_20375F8
@@ -924,7 +924,7 @@ _080344E4:
bl GetMonData
str r0, [sp, 0x4]
mov r0, r8
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r7, r0, 24
movs r0, 0x1
@@ -948,7 +948,7 @@ _0803451C:
lsls r0, r5, 3
ldr r1, _08034540 @ =gUnknown_823654C
adds r0, r1
- ldr r1, _08034544 @ =gUnknown_202401C
+ ldr r1, _08034544 @ =gMonSpritesGfxPtr
ldr r1, [r1]
lsls r2, r7, 2
adds r1, 0x4
@@ -962,12 +962,12 @@ _0803451C:
_08034538: .4byte gUnknown_2024008
_0803453C: .4byte gUnknown_2024018
_08034540: .4byte gUnknown_823654C
-_08034544: .4byte gUnknown_202401C
+_08034544: .4byte gMonSpritesGfxPtr
_08034548:
lsls r0, r5, 3
ldr r1, _08034584 @ =gUnknown_823654C
adds r0, r1
- ldr r1, _08034588 @ =gUnknown_202401C
+ ldr r1, _08034588 @ =gMonSpritesGfxPtr
ldr r1, [r1]
lsls r2, r7, 2
adds r1, 0x4
@@ -995,7 +995,7 @@ _08034562:
b _0803459A
.align 2, 0
_08034584: .4byte gUnknown_823654C
-_08034588: .4byte gUnknown_202401C
+_08034588: .4byte gMonSpritesGfxPtr
_0803458C: .4byte gUnknown_2024018
_08034590:
adds r0, r5, 0
@@ -1035,7 +1035,7 @@ _0803459A:
adds r1, r4
adds r0, r6, 0
bl LZDecompressWram
- ldr r0, _08034640 @ =gUnknown_2024024
+ ldr r0, _08034640 @ =gBattleMonForms
add r0, r8
ldrb r1, [r0]
lsls r1, 5
@@ -1077,7 +1077,7 @@ _08034626:
.align 2, 0
_08034638: .4byte 0x00000181
_0803463C: .4byte gBattleStruct
-_08034640: .4byte gUnknown_2024024
+_08034640: .4byte gBattleMonForms
_08034644: .4byte gUnknown_2024018
_08034648: .4byte 0x00007fff
_0803464C: .4byte gUnknown_20375F8
@@ -1091,10 +1091,10 @@ sub_8034658: @ 8034658
lsls r4, r1, 24
lsrs r4, 24
adds r0, r4, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
ldr r2, _080346B8 @ =gUnknown_8E93B38
- ldr r1, _080346BC @ =gUnknown_202401C
+ ldr r1, _080346BC @ =gMonSpritesGfxPtr
ldr r1, [r1]
lsrs r0, 22
adds r1, 0x4
@@ -1129,7 +1129,7 @@ sub_8034658: @ 8034658
bx r0
.align 2, 0
_080346B8: .4byte gUnknown_8E93B38
-_080346BC: .4byte gUnknown_202401C
+_080346BC: .4byte gMonSpritesGfxPtr
_080346C0: .4byte gUnknown_8E93B14
thumb_func_end sub_8034658
@@ -1145,13 +1145,13 @@ sub_80346C4: @ 80346C4
lsrs r5, 16
lsls r0, 24
lsrs r0, 24
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r4, r0, 0
lsls r4, 24
lsls r5, 3
ldr r6, _0803473C @ =gUnknown_823957C
adds r6, r5, r6
- ldr r0, _08034740 @ =gUnknown_202401C
+ ldr r0, _08034740 @ =gMonSpritesGfxPtr
mov r8, r0
ldr r0, [r0]
lsrs r4, 22
@@ -1193,7 +1193,7 @@ sub_80346C4: @ 80346C4
bx r0
.align 2, 0
_0803473C: .4byte gUnknown_823957C
-_08034740: .4byte gUnknown_202401C
+_08034740: .4byte gMonSpritesGfxPtr
_08034744: .4byte 0xffff0000
_08034748: .4byte 0x0000ffff
_0803474C: .4byte gUnknown_8239A1C
@@ -1467,7 +1467,7 @@ _0803495A:
LoadBattleBarGfx: @ 8034964
push {lr}
ldr r0, _0803497C @ =gUnknown_8D093D8
- ldr r1, _08034980 @ =gUnknown_202401C
+ ldr r1, _08034980 @ =gMonSpritesGfxPtr
ldr r1, [r1]
movs r2, 0xBA
lsls r2, 1
@@ -1478,7 +1478,7 @@ LoadBattleBarGfx: @ 8034964
bx r0
.align 2, 0
_0803497C: .4byte gUnknown_8D093D8
-_08034980: .4byte gUnknown_202401C
+_08034980: .4byte gMonSpritesGfxPtr
thumb_func_end LoadBattleBarGfx
thumb_func_start BattleInitAllSprites
@@ -1577,7 +1577,7 @@ _08034A34:
_08034A44: .4byte gUnknown_3004FF0
_08034A48:
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08034A90
@@ -1632,7 +1632,7 @@ _08034ABA:
ldrb r0, [r4]
adds r0, 0x1
strb r0, [r4]
- ldr r1, _08034AE4 @ =gUnknown_2023BCC
+ ldr r1, _08034AE4 @ =gBattlersCount
lsls r0, 24
lsrs r0, 24
ldrb r1, [r1]
@@ -1650,7 +1650,7 @@ _08034AD0:
_08034AD8: .4byte gUnknown_3004FF0
_08034ADC: .4byte gBattlerPartyIndexes
_08034AE0: .4byte gEnemyParty
-_08034AE4: .4byte gUnknown_2023BCC
+_08034AE4: .4byte gBattlersCount
_08034AE8:
bl LoadAndCreateEnemyShadowSprites
bl sub_8127CAC
@@ -1706,7 +1706,7 @@ CopyAllBattleSpritesInvisibilities: @ 8034B40
mov r6, r8
push {r6,r7}
movs r4, 0
- ldr r5, _08034BA4 @ =gUnknown_2023BCC
+ ldr r5, _08034BA4 @ =gBattlersCount
ldrb r0, [r5]
cmp r4, r0
bge _08034B96
@@ -1753,7 +1753,7 @@ _08034B96:
pop {r0}
bx r0
.align 2, 0
-_08034BA4: .4byte gUnknown_2023BCC
+_08034BA4: .4byte gBattlersCount
_08034BA8: .4byte gSprites
_08034BAC: .4byte gUnknown_2024018
_08034BB0: .4byte gUnknown_2023D44
@@ -1813,7 +1813,7 @@ sub_8034BF4: @ 8034BF4
beq _08034C16
b _08034D88
_08034C16:
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
mov r10, r0
@@ -1854,7 +1854,7 @@ _08034C16:
lsls r0, r1, 3
ldr r1, _08034D60 @ =gUnknown_82350AC
adds r0, r1
- ldr r4, _08034D64 @ =gUnknown_202401C
+ ldr r4, _08034D64 @ =gMonSpritesGfxPtr
ldr r1, [r4]
mov r2, r10
lsls r5, r2, 2
@@ -1927,7 +1927,7 @@ _08034C16:
adds r0, r1
lsls r0, 2
adds r0, r5
- ldr r1, _08034D7C @ =gUnknown_2024024
+ ldr r1, _08034D7C @ =gBattleMonForms
add r1, r9
ldrb r1, [r1]
bl StartSpriteAnim
@@ -1940,10 +1940,10 @@ _08034C16:
movs r1, 0xB
mov r2, r8
muls r2, r1
- ldr r1, _08034D80 @ =gUnknown_8245EE0
+ ldr r1, _08034D80 @ =gSpeciesNames
adds r2, r1
movs r1, 0x2
- bl sub_804037C
+ bl SetMonData
ldr r4, _08034D84 @ =gUnknown_3004FF0
add r4, r9
ldrb r0, [r4]
@@ -1962,14 +1962,14 @@ _08034C16:
_08034D58: .4byte gBattlerPartyIndexes
_08034D5C: .4byte gEnemyParty
_08034D60: .4byte gUnknown_82350AC
-_08034D64: .4byte gUnknown_202401C
+_08034D64: .4byte gMonSpritesGfxPtr
_08034D68: .4byte gSprites
_08034D6C: .4byte gUnknown_2023D44
_08034D70: .4byte 0x06010000
_08034D74: .4byte 0x040000d4
_08034D78: .4byte 0x84000200
-_08034D7C: .4byte gUnknown_2024024
-_08034D80: .4byte gUnknown_8245EE0
+_08034D7C: .4byte gBattleMonForms
+_08034D80: .4byte gSpeciesNames
_08034D84: .4byte gUnknown_3004FF0
_08034D88:
cmp r2, 0
@@ -2008,7 +2008,7 @@ _08034D88:
mov r1, r10
movs r2, 0x20
bl LoadPalette
- ldr r1, _08034E38 @ =gUnknown_2024024
+ ldr r1, _08034E38 @ =gBattleMonForms
add r1, r9
ldr r0, [r4]
ldr r0, [r0, 0x8]
@@ -2052,19 +2052,19 @@ _08034E28: .4byte gUnknown_2023D44
_08034E2C: .4byte gSprites
_08034E30: .4byte gUnknown_2024018
_08034E34: .4byte gBattleStruct
-_08034E38: .4byte gUnknown_2024024
+_08034E38: .4byte gBattleMonForms
_08034E3C: .4byte 0x00007fff
_08034E40: .4byte gUnknown_20375F8
_08034E44: .4byte gUnknown_20371F8
_08034E48: .4byte 0x04000008
_08034E4C:
mov r0, r9
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
mov r10, r0
ldr r0, [sp]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -2098,7 +2098,7 @@ _08034E90:
lsrs r0, 16
mov r8, r0
mov r0, r9
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08034F10
@@ -2124,7 +2124,7 @@ _08034E90:
lsls r0, r2, 3
ldr r1, _08034F04 @ =gUnknown_823654C
adds r0, r1
- ldr r1, _08034F08 @ =gUnknown_202401C
+ ldr r1, _08034F08 @ =gMonSpritesGfxPtr
ldr r1, [r1]
mov r3, r10
lsls r5, r3, 2
@@ -2143,7 +2143,7 @@ _08034E90:
_08034EFC: .4byte gBattlerPartyIndexes
_08034F00: .4byte gPlayerParty
_08034F04: .4byte gUnknown_823654C
-_08034F08: .4byte gUnknown_202401C
+_08034F08: .4byte gMonSpritesGfxPtr
_08034F0C: .4byte gUnknown_2024008
_08034F10:
ldr r0, _08035074 @ =gBattlerPartyIndexes
@@ -2168,7 +2168,7 @@ _08034F10:
lsls r0, r2, 3
ldr r1, _0803507C @ =gUnknown_82350AC
adds r0, r1
- ldr r1, _08035080 @ =gUnknown_202401C
+ ldr r1, _08035080 @ =gMonSpritesGfxPtr
ldr r1, [r1]
mov r3, r10
lsls r5, r3, 2
@@ -2184,7 +2184,7 @@ _08034F10:
bl HandleLoadSpecialPokePic_DontHandleDeoxys
_08034F5E:
str r4, [sp, 0x14]
- ldr r0, _08035080 @ =gUnknown_202401C
+ ldr r0, _08035080 @ =gMonSpritesGfxPtr
ldr r0, [r0]
adds r0, 0x4
adds r0, r5
@@ -2244,7 +2244,7 @@ _08034F5E:
adds r1, r4
adds r0, r6, 0
bl LZDecompressWram
- ldr r0, _080350A4 @ =gUnknown_2024024
+ ldr r0, _080350A4 @ =gBattleMonForms
ldr r1, [sp]
adds r0, r1, r0
ldrb r1, [r0]
@@ -2276,7 +2276,7 @@ _08034FFC:
adds r0, r3, r0
mov r1, r8
strh r1, [r0, 0x2]
- ldr r0, _080350A4 @ =gUnknown_2024024
+ ldr r0, _080350A4 @ =gBattleMonForms
mov r2, r9
adds r4, r2, r0
ldr r3, [sp]
@@ -2316,7 +2316,7 @@ _08035062:
_08035074: .4byte gBattlerPartyIndexes
_08035078: .4byte gEnemyParty
_0803507C: .4byte gUnknown_82350AC
-_08035080: .4byte gUnknown_202401C
+_08035080: .4byte gMonSpritesGfxPtr
_08035084: .4byte gUnknown_2024008
_08035088: .4byte gUnknown_2023D44
_0803508C: .4byte gSprites
@@ -2325,7 +2325,7 @@ _08035094: .4byte 0x040000d4
_08035098: .4byte 0x84000200
_0803509C: .4byte 0x00000181
_080350A0: .4byte gBattleStruct
-_080350A4: .4byte gUnknown_2024024
+_080350A4: .4byte gBattleMonForms
_080350A8: .4byte 0x00007fff
_080350AC: .4byte gUnknown_20375F8
_080350B0: .4byte gUnknown_20371F8
@@ -2343,16 +2343,16 @@ sub_80350BC: @ 80350BC
cmp r1, 0
bne _08035158
adds r0, r4, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r5, r0, 24
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080350FC
ldr r0, _080350F4 @ =gUnknown_8D2D0B4
- ldr r1, _080350F8 @ =gUnknown_202401C
+ ldr r1, _080350F8 @ =gMonSpritesGfxPtr
ldr r1, [r1]
lsls r4, r5, 2
adds r1, 0x4
@@ -2362,10 +2362,10 @@ sub_80350BC: @ 80350BC
b _0803510E
.align 2, 0
_080350F4: .4byte gUnknown_8D2D0B4
-_080350F8: .4byte gUnknown_202401C
+_080350F8: .4byte gMonSpritesGfxPtr
_080350FC:
ldr r0, _08035144 @ =gUnknown_8D2D2F4
- ldr r1, _08035148 @ =gUnknown_202401C
+ ldr r1, _08035148 @ =gMonSpritesGfxPtr
ldr r1, [r1]
lsls r4, r5, 2
adds r1, 0x4
@@ -2376,7 +2376,7 @@ _0803510E:
movs r3, 0x1
lsls r6, 4
ldr r7, _0803514C @ =gUnknown_8D2D090
- ldr r0, _08035148 @ =gUnknown_202401C
+ ldr r0, _08035148 @ =gMonSpritesGfxPtr
ldr r0, [r0]
adds r0, 0x4
adds r4, r0, r4
@@ -2402,13 +2402,13 @@ _08035120:
b _0803519A
.align 2, 0
_08035144: .4byte gUnknown_8D2D2F4
-_08035148: .4byte gUnknown_202401C
+_08035148: .4byte gMonSpritesGfxPtr
_0803514C: .4byte gUnknown_8D2D090
_08035150: .4byte 0x040000d4
_08035154: .4byte 0x84000200
_08035158:
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08035184
@@ -2465,7 +2465,7 @@ LoadBattleMonGfxAndAnimate: @ 80351A8
lsls r0, 2
ldr r1, _080351E4 @ =gSprites
adds r4, r0, r1
- ldr r0, _080351E8 @ =gUnknown_2024024
+ ldr r0, _080351E8 @ =gBattleMonForms
adds r0, r6, r0
ldrb r1, [r0]
adds r0, r4, 0
@@ -2477,7 +2477,7 @@ LoadBattleMonGfxAndAnimate: @ 80351A8
b _080351F2
.align 2, 0
_080351E4: .4byte gSprites
-_080351E8: .4byte gUnknown_2024024
+_080351E8: .4byte gBattleMonForms
_080351EC:
adds r0, r6, 0
bl GetBankSpriteDefault_Y
@@ -2640,7 +2640,7 @@ _0803530E:
BattleStopLowHpSound: @ 8035314
push {r4-r6,lr}
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r4, r0, 24
ldr r5, _08035364 @ =gUnknown_2024018
@@ -2720,12 +2720,12 @@ sub_803539C: @ 803539C
cmp r0, 0
beq _08035432
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
mov r8, r0
movs r0, 0x2
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
mov r9, r0
@@ -2799,7 +2799,7 @@ sub_8035450: @ 8035450
lsrs r0, 24
mov r8, r0
movs r5, 0
- ldr r0, _080354E0 @ =gUnknown_2023BCC
+ ldr r0, _080354E0 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
bge _08035520
@@ -2862,7 +2862,7 @@ _0803547C:
strb r1, [r0, 0x3]
b _08035514
.align 2, 0
-_080354E0: .4byte gUnknown_2023BCC
+_080354E0: .4byte gBattlersCount
_080354E4: .4byte gSprites
_080354E8: .4byte gUnknown_2023D44
_080354EC: .4byte gUnknown_2024018
@@ -2888,7 +2888,7 @@ _080354F0:
_08035514:
adds r6, 0xC
adds r5, 0x1
- ldr r0, _08035534 @ =gUnknown_2023BCC
+ ldr r0, _08035534 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
blt _0803547C
@@ -2902,7 +2902,7 @@ _08035520:
bx r0
.align 2, 0
_08035530: .4byte gUnknown_2024018
-_08035534: .4byte gUnknown_2023BCC
+_08035534: .4byte gBattlersCount
thumb_func_end sub_8035450
thumb_func_start LoadAndCreateEnemyShadowSprites
@@ -2913,7 +2913,7 @@ LoadAndCreateEnemyShadowSprites: @ 8035538
ldr r0, _08035614 @ =gUnknown_8250A0C
bl sub_800F034
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r5, r0, 0
lsls r5, 24
lsrs r5, 24
@@ -2962,7 +2962,7 @@ LoadAndCreateEnemyShadowSprites: @ 8035538
cmp r0, 0
beq _0803560A
movs r0, 0x3
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r5, r0, 0
lsls r5, 24
lsrs r5, 24
@@ -3147,7 +3147,7 @@ SetBankEnemyShadowSpriteCallback: @ 8035708
lsls r1, 16
lsrs r5, r1, 16
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08035784
@@ -3371,7 +3371,7 @@ ClearTemporarySpeciesSpriteData: @ 803589C
movs r3, 0
movs r2, 0
strh r2, [r0, 0x2]
- ldr r0, _080358D0 @ =gUnknown_2024024
+ ldr r0, _080358D0 @ =gBattleMonForms
adds r0, r4, r0
strb r3, [r0]
cmp r1, 0
@@ -3384,7 +3384,7 @@ _080358C4:
bx r0
.align 2, 0
_080358CC: .4byte gUnknown_2024018
-_080358D0: .4byte gUnknown_2024024
+_080358D0: .4byte gBattleMonForms
thumb_func_end ClearTemporarySpeciesSpriteData
thumb_func_start AllocateMonSpritesGfx
@@ -3395,7 +3395,7 @@ AllocateMonSpritesGfx: @ 80358D4
mov r5, r8
push {r5-r7}
movs r6, 0
- ldr r4, _080359A4 @ =gUnknown_202401C
+ ldr r4, _080359A4 @ =gMonSpritesGfxPtr
str r6, [r4]
movs r0, 0xC0
lsls r0, 1
@@ -3407,7 +3407,7 @@ AllocateMonSpritesGfx: @ 80358D4
ldr r1, [r4]
str r0, [r1]
_080358FA:
- ldr r0, _080359A4 @ =gUnknown_202401C
+ ldr r0, _080359A4 @ =gMonSpritesGfxPtr
ldr r1, [r0]
lsls r4, r6, 2
adds r2, r1, 0x4
@@ -3436,7 +3436,7 @@ _080358FA:
mov r12, r8
adds r7, r4, 0
_08035932:
- ldr r2, _080359A4 @ =gUnknown_202401C
+ ldr r2, _080359A4 @ =gMonSpritesGfxPtr
ldr r1, [r2]
lsls r4, r5, 3
add r4, r12
@@ -3459,7 +3459,7 @@ _08035932:
lsrs r5, r0, 24
cmp r5, 0x3
bls _08035932
- ldr r1, _080359A4 @ =gUnknown_202401C
+ ldr r1, _080359A4 @ =gMonSpritesGfxPtr
ldr r2, [r1]
mov r5, r9
adds r0, r5, r6
@@ -3479,7 +3479,7 @@ _08035932:
movs r0, 0x80
lsls r0, 5
bl AllocZeroed
- ldr r1, _080359A4 @ =gUnknown_202401C
+ ldr r1, _080359A4 @ =gMonSpritesGfxPtr
ldr r1, [r1]
movs r2, 0xBA
lsls r2, 1
@@ -3493,14 +3493,14 @@ _08035932:
pop {r0}
bx r0
.align 2, 0
-_080359A4: .4byte gUnknown_202401C
+_080359A4: .4byte gMonSpritesGfxPtr
_080359A8: .4byte gUnknown_825DEF0
thumb_func_end AllocateMonSpritesGfx
thumb_func_start FreeMonSpritesGfx
FreeMonSpritesGfx: @ 80359AC
push {r4-r6,lr}
- ldr r6, _08035A24 @ =gUnknown_202401C
+ ldr r6, _08035A24 @ =gMonSpritesGfxPtr
ldr r0, [r6]
cmp r0, 0
beq _08035A1E
@@ -3558,7 +3558,7 @@ _08035A1E:
pop {r0}
bx r0
.align 2, 0
-_08035A24: .4byte gUnknown_202401C
+_08035A24: .4byte gMonSpritesGfxPtr
thumb_func_end FreeMonSpritesGfx
thumb_func_start ShouldPlayNormalPokeCry
diff --git a/asm/battle_interface.s b/asm/battle_interface.s
index 3e3fb6500..85c9e4af9 100644
--- a/asm/battle_interface.s
+++ b/asm/battle_interface.s
@@ -273,7 +273,7 @@ CreateBankHealthboxSprites: @ 8047CE0
cmp r0, 0
bne _08047DF4
mov r0, r10
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08047D78
@@ -385,12 +385,12 @@ _08047DEC: .4byte 0xfffffc00
_08047DF0: .4byte sub_8048128
_08047DF4:
mov r0, r10
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08047E98
mov r0, r10
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 25
@@ -406,7 +406,7 @@ _08047DF4:
lsls r0, 24
lsrs r6, r0, 24
mov r0, r10
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 25
@@ -459,7 +459,7 @@ _08047E90: .4byte 0xfffffc00
_08047E94: .4byte sub_8048128
_08047E98:
mov r0, r10
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 25
@@ -475,7 +475,7 @@ _08047E98:
lsls r0, 24
lsrs r6, r0, 24
mov r0, r10
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 25
@@ -544,7 +544,7 @@ _08047F1C:
mov r8, r1
add r4, r8
mov r0, r10
- bl GetBankSide
+ bl GetBattlerSide
adds r1, r0, 0
lsls r1, 24
lsrs r1, 21
@@ -984,7 +984,7 @@ UpdateOamPriorityInAllHealthboxes: @ 804828C
lsls r0, 24
lsrs r0, 24
movs r6, 0
- ldr r1, _08048310 @ =gUnknown_2023BCC
+ ldr r1, _08048310 @ =gBattlersCount
mov r8, r1
ldrb r2, [r1]
cmp r6, r2
@@ -1046,7 +1046,7 @@ _08048304:
pop {r0}
bx r0
.align 2, 0
-_08048310: .4byte gUnknown_2023BCC
+_08048310: .4byte gBattlersCount
_08048314: .4byte gSprites
_08048318: .4byte gUnknown_3004FF0
thumb_func_end UpdateOamPriorityInAllHealthboxes
@@ -1063,7 +1063,7 @@ SetBankHealthboxSpritePos: @ 804831C
cmp r0, 0
bne _08048348
adds r0, r6, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08048342
@@ -1076,7 +1076,7 @@ _08048342:
b _08048380
_08048348:
adds r0, r6, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -1165,7 +1165,7 @@ UpdateLvlInHealthbox: @ 8048398
ldrh r0, [r1, 0x3A]
lsls r0, 24
lsrs r0, 24
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08048420
@@ -1226,7 +1226,7 @@ sub_8048440: @ 8048440
ldrh r0, [r4, 0x3A]
lsls r0, 24
lsrs r0, 24
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08048514
@@ -1321,7 +1321,7 @@ _08048514:
cmp r0, 0x1
beq _0804854C
adds r0, r6, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -1341,7 +1341,7 @@ _08048564:
ldrh r0, [r7, 0x3A]
lsls r0, 24
lsrs r0, 24
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08048580
@@ -1366,7 +1366,7 @@ _0804858A:
movs r2, 0x1
movs r3, 0x3
bl ConvertIntToDecimalStringN
- ldr r0, _08048608 @ =gUnknown_202401C
+ ldr r0, _08048608 @ =gMonSpritesGfxPtr
ldr r0, [r0]
movs r1, 0xBA
lsls r1, 1
@@ -1387,7 +1387,7 @@ _0804858A:
lsls r0, 2
adds r4, r0, r1
_080485C6:
- ldr r0, _08048608 @ =gUnknown_202401C
+ ldr r0, _08048608 @ =gMonSpritesGfxPtr
ldr r0, [r0]
movs r1, 0xBA
lsls r1, 1
@@ -1421,7 +1421,7 @@ _080485F8:
pop {r0}
bx r0
.align 2, 0
-_08048608: .4byte gUnknown_202401C
+_08048608: .4byte gMonSpritesGfxPtr
_0804860C: .4byte gSprites
_08048610: .4byte 0x06010000
_08048614: .4byte 0x04000008
@@ -1492,7 +1492,7 @@ _0804866A:
ldr r1, _08048704 @ =gUnknown_8260540
bl StringCopy
_08048698:
- ldr r0, _08048708 @ =gUnknown_202401C
+ ldr r0, _08048708 @ =gMonSpritesGfxPtr
ldr r0, [r0]
movs r3, 0xBA
lsls r3, 1
@@ -1517,7 +1517,7 @@ _08048698:
_080486C6:
cmp r4, 0x2
bhi _08048714
- ldr r0, _08048708 @ =gUnknown_202401C
+ ldr r0, _08048708 @ =gMonSpritesGfxPtr
ldr r0, [r0]
movs r1, 0xBA
lsls r1, 1
@@ -1543,11 +1543,11 @@ _080486F8: .4byte gUnknown_8260542
_080486FC: .4byte gSprites
_08048700: .4byte gUnknown_2024018
_08048704: .4byte gUnknown_8260540
-_08048708: .4byte gUnknown_202401C
+_08048708: .4byte gMonSpritesGfxPtr
_0804870C: .4byte 0x06010000
_08048710: .4byte 0x04000008
_08048714:
- ldr r0, _08048790 @ =gUnknown_202401C
+ ldr r0, _08048790 @ =gMonSpritesGfxPtr
ldr r0, [r0]
movs r3, 0xBA
lsls r3, 1
@@ -1577,7 +1577,7 @@ _08048748:
mov r3, r8
cmp r3, 0
bne _080487A8
- ldr r0, _08048790 @ =gUnknown_202401C
+ ldr r0, _08048790 @ =gMonSpritesGfxPtr
ldr r0, [r0]
movs r1, 0xBA
lsls r1, 1
@@ -1608,7 +1608,7 @@ _08048748:
bl CpuSet
b _080487DC
.align 2, 0
-_08048790: .4byte gUnknown_202401C
+_08048790: .4byte gMonSpritesGfxPtr
_08048794: .4byte 0x06010020
_08048798: .4byte 0x04000008
_0804879C: .4byte gSprites
@@ -1616,7 +1616,7 @@ _080487A0: .4byte 0x06010000
_080487A4: .4byte 0x05000008
_080487A8:
mov r0, r10
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080487DC
@@ -1678,8 +1678,8 @@ sub_80487F8: @ 80487F8
ldrh r0, [r0, 0x3A]
lsls r0, 24
lsrs r0, 24
- bl GetBankIdentity
- ldr r1, _080488B4 @ =gUnknown_202401C
+ bl GetBattlerPosition
+ ldr r1, _080488B4 @ =gMonSpritesGfxPtr
ldr r2, [r1]
movs r3, 0xBA
lsls r3, 1
@@ -1745,7 +1745,7 @@ _080488A8:
.align 2, 0
_080488AC: .4byte gUnknown_826052C
_080488B0: .4byte gSprites
-_080488B4: .4byte gUnknown_202401C
+_080488B4: .4byte gMonSpritesGfxPtr
_080488B8: .4byte gUnknown_8463E60
_080488BC:
adds r0, r1, 0
@@ -1866,7 +1866,7 @@ _08048966:
adds r2, r0, 0
movs r0, 0xBA
strb r0, [r2, 0x8]
- ldr r5, _08048A08 @ =gUnknown_202401C
+ ldr r5, _08048A08 @ =gMonSpritesGfxPtr
ldr r0, [r5]
movs r2, 0xBA
lsls r2, 1
@@ -1910,7 +1910,7 @@ _080489F8: .4byte 0x04000008
_080489FC: .4byte gSprites
_08048A00: .4byte 0x06010000
_08048A04: .4byte gBattleStruct
-_08048A08: .4byte gUnknown_202401C
+_08048A08: .4byte gMonSpritesGfxPtr
_08048A0C:
ldr r0, [r5]
movs r3, 0xBA
@@ -1955,7 +1955,7 @@ sub_8048A4C: @ 8048A4C
sub sp, 0x4
movs r0, 0
mov r9, r0
- ldr r0, _08048B78 @ =gUnknown_2023BCC
+ ldr r0, _08048B78 @ =gBattlersCount
ldrb r0, [r0]
cmp r9, r0
blt _08048A66
@@ -1986,7 +1986,7 @@ _08048A8C:
lsls r0, r2, 24
lsrs r7, r0, 24
adds r0, r7, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -1998,7 +1998,7 @@ _08048AA2:
cmp r0, 0
bne _08048ABA
adds r0, r7, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08048ABA
@@ -2032,7 +2032,7 @@ _08048ABA:
lsls r0, 27
lsrs r4, r0, 31
adds r0, r7, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08048BE8
@@ -2096,7 +2096,7 @@ _08048B16:
ldr r2, _08048B9C @ =gPlayerParty
b _08048C6E
.align 2, 0
-_08048B78: .4byte gUnknown_2023BCC
+_08048B78: .4byte gBattlersCount
_08048B7C: .4byte gSprites
_08048B80: .4byte gBattlerPartyIndexes
_08048B84: .4byte gUnknown_3004FF0
@@ -2258,7 +2258,7 @@ _08048CE0:
add r8, r0
movs r1, 0x1
add r9, r1
- ldr r0, _08048D10 @ =gUnknown_2023BCC
+ ldr r0, _08048D10 @ =gBattlersCount
ldrb r0, [r0]
cmp r9, r0
bge _08048CF2
@@ -2276,7 +2276,7 @@ _08048CF2:
_08048D04: .4byte gEnemyParty
_08048D08: .4byte gBattleTypeFlags
_08048D0C: .4byte gUnknown_3004FF0
-_08048D10: .4byte gUnknown_2023BCC
+_08048D10: .4byte gBattlersCount
thumb_func_end sub_8048A4C
thumb_func_start sub_8048D14
@@ -2299,14 +2299,14 @@ sub_8048D14: @ 8048D14
str r3, [sp, 0x10]
cmp r4, 0
beq _08048D44
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
beq _08048D88
_08048D44:
ldr r0, [sp, 0x8]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08048D64
@@ -2588,7 +2588,7 @@ _08048F66:
b _08048E80
_08048F86:
ldr r0, [sp, 0x8]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _0804906E
@@ -2966,7 +2966,7 @@ _0804925A:
_08049268:
ldr r0, [sp, 0x8]
str r3, [sp, 0x14]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r2, r0, 24
ldr r3, [sp, 0x14]
@@ -3555,7 +3555,7 @@ sub_80496C0: @ 80496C0
lsls r0, 24
lsrs r0, 24
mov r8, r0
- ldr r0, _08049760 @ =gUnknown_202298C
+ ldr r0, _08049760 @ =gDisplayedStringBattle
ldr r1, _08049764 @ =gUnknown_8260556
bl StringCopy
adds r5, r0, 0
@@ -3592,7 +3592,7 @@ sub_80496C0: @ 80496C0
_08049720:
movs r0, 0xB
muls r1, r0
- ldr r0, _08049768 @ =gUnknown_8245EE0
+ ldr r0, _08049768 @ =gSpeciesNames
adds r1, r0
mov r0, sp
bl StringCompare
@@ -3623,9 +3623,9 @@ _08049754:
movs r0, 0xB
b _08049782
.align 2, 0
-_08049760: .4byte gUnknown_202298C
+_08049760: .4byte gDisplayedStringBattle
_08049764: .4byte gUnknown_8260556
-_08049768: .4byte gUnknown_8245EE0
+_08049768: .4byte gSpeciesNames
_0804976C: .4byte gSprites
_08049770:
movs r0, 0xB
@@ -3642,7 +3642,7 @@ _08049782:
strb r0, [r5]
movs r0, 0xFF
strb r0, [r5, 0x1]
- ldr r0, _080497E4 @ =gUnknown_202298C
+ ldr r0, _080497E4 @ =gDisplayedStringBattle
add r3, sp, 0xC
movs r1, 0
movs r2, 0x3
@@ -3659,7 +3659,7 @@ _08049782:
ldrh r0, [r1, 0x3A]
lsls r0, 24
lsrs r0, 24
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080497F8
@@ -3684,7 +3684,7 @@ _080497D4:
bl sub_804A6E8
b _08049804
.align 2, 0
-_080497E4: .4byte gUnknown_202298C
+_080497E4: .4byte gDisplayedStringBattle
_080497E8: .4byte gSprites
_080497EC: .4byte 0x06010040
_080497F0: .4byte 0x06010400
@@ -3742,7 +3742,7 @@ sub_804981C: @ 804981C
lsls r0, 24
lsrs r4, r0, 24
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _0804991C
@@ -3862,7 +3862,7 @@ UpdateStatusIconInHealthbox: @ 8049934
lsrs r0, 24
mov r10, r0
adds r0, r7, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080499A4
@@ -4090,7 +4090,7 @@ _08049AF4:
cmp r0, 0x1
beq _08049B62
adds r0, r7, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -4386,7 +4386,7 @@ UpdateHealthboxAttribute: @ 8049D98
cmp r0, 0
bne _08049DD4
mov r0, r9
- bl GetBankSide
+ bl GetBattlerSide
_08049DD4:
ldr r1, _08049F44 @ =gSprites
lsls r0, r6, 4
@@ -4396,7 +4396,7 @@ _08049DD4:
ldrh r0, [r0, 0x3A]
lsls r0, 24
lsrs r0, 24
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08049DF0
@@ -4499,7 +4499,7 @@ _08049E96:
movs r1, 0x19
bl GetMonData
adds r3, r0, 0
- ldr r0, _08049F48 @ =gUnknown_8253AE4
+ ldr r0, _08049F48 @ =gExperienceTables
mov r12, r0
lsls r1, r4, 2
ldr r2, _08049F4C @ =gBaseStats
@@ -4565,7 +4565,7 @@ _08049F2E:
b _08049FC6
.align 2, 0
_08049F44: .4byte gSprites
-_08049F48: .4byte gUnknown_8253AE4
+_08049F48: .4byte gExperienceTables
_08049F4C: .4byte gBaseStats
_08049F50:
cmp r7, 0x3
diff --git a/asm/battle_message.s b/asm/battle_message.s
index 9a9ca1f2f..47dbf0870 100644
--- a/asm/battle_message.s
+++ b/asm/battle_message.s
@@ -26,7 +26,7 @@ sub_80D7274: @ 80D7274
ldr r2, _080D733C @ =gUnknown_2023D68
ldrh r0, [r1, 0x4]
strh r0, [r2]
- ldr r2, _080D7340 @ =gUnknown_2023D6A
+ ldr r2, _080D7340 @ =gLastUsedAbility
ldrb r0, [r1, 0x6]
strb r0, [r2]
ldr r5, _080D7344 @ =gBattleScripting
@@ -42,7 +42,7 @@ sub_80D7274: @ 80D7274
ldr r1, [r4]
ldrb r1, [r1, 0x9]
strb r1, [r0]
- ldr r1, _080D734C @ =gUnknown_2023D6F
+ ldr r1, _080D734C @ =gPotentialItemEffectBattler
ldr r2, [r4]
ldrb r0, [r2, 0xA]
strb r0, [r1]
@@ -53,7 +53,7 @@ sub_80D7274: @ 80D7274
movs r2, 0
mov r12, r8
mov r10, r5
- ldr r1, _080D7350 @ =gUnknown_2022AB8
+ ldr r1, _080D7350 @ =gBattleTextBuff1
mov r9, r1
ldr r3, _080D7354 @ =gUnknown_2039A30
_080D72D6:
@@ -67,10 +67,10 @@ _080D72D6:
cmp r2, 0x3
ble _080D72D6
movs r2, 0
- ldr r0, _080D7350 @ =gUnknown_2022AB8
+ ldr r0, _080D7350 @ =gBattleTextBuff1
mov r8, r0
ldr r3, _080D7330 @ =gUnknown_2039A34
- ldr r5, _080D7358 @ =gUnknown_2022AC8
+ ldr r5, _080D7358 @ =gBattleTextBuff2
ldr r4, _080D735C @ =gUnknown_2022AD8
_080D72F4:
mov r0, r8
@@ -109,13 +109,13 @@ _080D7330: .4byte gUnknown_2039A34
_080D7334: .4byte gActiveBattler
_080D7338: .4byte gUnknown_2022BC8
_080D733C: .4byte gUnknown_2023D68
-_080D7340: .4byte gUnknown_2023D6A
+_080D7340: .4byte gLastUsedAbility
_080D7344: .4byte gBattleScripting
_080D7348: .4byte gBattleStruct
-_080D734C: .4byte gUnknown_2023D6F
-_080D7350: .4byte gUnknown_2022AB8
+_080D734C: .4byte gPotentialItemEffectBattler
+_080D7350: .4byte gBattleTextBuff1
_080D7354: .4byte gUnknown_2039A30
-_080D7358: .4byte gUnknown_2022AC8
+_080D7358: .4byte gBattleTextBuff2
_080D735C: .4byte gUnknown_2022AD8
_080D7360: .4byte _080D7364
.align 2, 0
@@ -217,7 +217,7 @@ _080D7424: .4byte gUnknown_83FD2AA
_080D7428:
mov r1, r12
ldrb r0, [r1]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080D7468
@@ -297,7 +297,7 @@ _080D74C4: .4byte gUnknown_83FD3B1
_080D74C8:
mov r1, r12
ldrb r0, [r1]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080D7520
@@ -369,7 +369,7 @@ _080D7554: .4byte gUnknown_83FD522
_080D7558:
mov r1, r10
ldrb r0, [r1, 0x17]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080D75B0
@@ -452,7 +452,7 @@ _080D75F0:
lsls r0, 1
cmp r1, r0
bls _080D762C
- ldr r0, _080D7620 @ =gUnknown_2022AC8
+ ldr r0, _080D7620 @ =gBattleTextBuff2
ldr r2, _080D7624 @ =gUnknown_83FEA28
ldr r1, _080D7628 @ =gBattleStruct
ldr r1, [r1]
@@ -465,11 +465,11 @@ _080D75F0:
b _080D763C
.align 2, 0
_080D761C: .4byte gUnknown_2039A34
-_080D7620: .4byte gUnknown_2022AC8
+_080D7620: .4byte gBattleTextBuff2
_080D7624: .4byte gUnknown_83FEA28
_080D7628: .4byte gBattleStruct
_080D762C:
- ldr r0, _080D7648 @ =gUnknown_2022AC8
+ ldr r0, _080D7648 @ =gBattleTextBuff2
ldrh r2, [r2]
movs r1, 0xD
muls r1, r2
@@ -477,16 +477,16 @@ _080D762C:
adds r1, r2
bl StringCopy
_080D763C:
- ldr r0, _080D7648 @ =gUnknown_2022AC8
+ ldr r0, _080D7648 @ =gBattleTextBuff2
bl sub_80D8720
ldr r7, _080D7650 @ =gUnknown_83FD57B
b _080D77DC
.align 2, 0
-_080D7648: .4byte gUnknown_2022AC8
+_080D7648: .4byte gBattleTextBuff2
_080D764C: .4byte gUnknown_8247094
_080D7650: .4byte gUnknown_83FD57B
_080D7654:
- ldr r4, _080D7694 @ =gUnknown_2022AB8
+ ldr r4, _080D7694 @ =gBattleTextBuff1
ldrb r1, [r4]
movs r0, 0x80
ands r0, r1
@@ -497,7 +497,7 @@ _080D7654:
strb r0, [r4]
mov r1, r12
ldrb r0, [r1]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -509,7 +509,7 @@ _080D7654:
eors r0, r1
strb r0, [r4]
_080D7682:
- ldr r0, _080D7694 @ =gUnknown_2022AB8
+ ldr r0, _080D7694 @ =gBattleTextBuff1
ldrb r0, [r0]
subs r0, 0x2
lsls r0, 24
@@ -519,7 +519,7 @@ _080D7682:
ldr r7, _080D7698 @ =gUnknown_83FCC8A
b _080D77DC
.align 2, 0
-_080D7694: .4byte gUnknown_2022AB8
+_080D7694: .4byte gBattleTextBuff1
_080D7698: .4byte gUnknown_83FCC8A
_080D769C:
ldr r0, _080D76AC @ =gBattleTypeFlags
@@ -552,7 +552,7 @@ _080D76D0: .4byte gUnknown_83FE9D4
_080D76D4:
mov r1, r12
ldrb r0, [r1]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -570,7 +570,7 @@ _080D76F0:
ands r0, r1
cmp r0, 0
beq _080D7738
- ldr r0, _080D7714 @ =gUnknown_2022AB8
+ ldr r0, _080D7714 @ =gBattleTextBuff1
ldrb r0, [r0]
cmp r0, 0x2
beq _080D7728
@@ -581,7 +581,7 @@ _080D76F0:
b _080D77DC
.align 2, 0
_080D7710: .4byte gBattleTypeFlags
-_080D7714: .4byte gUnknown_2022AB8
+_080D7714: .4byte gBattleTextBuff1
_080D7718:
cmp r0, 0x3
beq _080D7730
@@ -608,7 +608,7 @@ _080D7738:
lsls r0, 4
cmp r1, r0
bne _080D7780
- ldr r0, _080D775C @ =gUnknown_2022AB8
+ ldr r0, _080D775C @ =gBattleTextBuff1
ldrb r0, [r0]
cmp r0, 0x2
beq _080D7770
@@ -619,7 +619,7 @@ _080D7738:
b _080D77DC
.align 2, 0
_080D7758: .4byte gTrainerBattleOpponent_A
-_080D775C: .4byte gUnknown_2022AB8
+_080D775C: .4byte gBattleTextBuff1
_080D7760:
cmp r0, 0x3
beq _080D7778
@@ -640,7 +640,7 @@ _080D7778:
.align 2, 0
_080D777C: .4byte gUnknown_83FE9FF
_080D7780:
- ldr r0, _080D7794 @ =gUnknown_2022AB8
+ ldr r0, _080D7794 @ =gBattleTextBuff1
ldrb r0, [r0]
cmp r0, 0x2
beq _080D77A8
@@ -650,7 +650,7 @@ _080D7780:
beq _080D779E
b _080D77DC
.align 2, 0
-_080D7794: .4byte gUnknown_2022AB8
+_080D7794: .4byte gBattleTextBuff1
_080D7798:
cmp r0, 0x3
beq _080D77B0
@@ -674,13 +674,13 @@ _080D77B8:
ldr r0, _080D77C8 @ =0x00000181
cmp r6, r0
bls _080D77D0
- ldr r1, _080D77CC @ =gUnknown_202298C
+ ldr r1, _080D77CC @ =gDisplayedStringBattle
movs r0, 0xFF
strb r0, [r1]
b _080D77E2
.align 2, 0
_080D77C8: .4byte 0x00000181
-_080D77CC: .4byte gUnknown_202298C
+_080D77CC: .4byte gDisplayedStringBattle
_080D77D0:
ldr r1, _080D77F0 @ =gUnknown_83FDF3C
adds r0, r6, 0
@@ -706,12 +706,12 @@ _080D77F0: .4byte gUnknown_83FDF3C
thumb_func_start BattleStringExpandPlaceholdersToDisplayedString
BattleStringExpandPlaceholdersToDisplayedString: @ 80D77F4
push {lr}
- ldr r1, _080D7800 @ =gUnknown_202298C
- bl sub_80D7868
+ ldr r1, _080D7800 @ =gDisplayedStringBattle
+ bl BattleStringExpandPlaceholders
pop {r1}
bx r1
.align 2, 0
-_080D7800: .4byte gUnknown_202298C
+_080D7800: .4byte gDisplayedStringBattle
thumb_func_end BattleStringExpandPlaceholdersToDisplayedString
thumb_func_start TryGetStatusString
@@ -770,8 +770,8 @@ _080D785E:
bx r1
thumb_func_end TryGetStatusString
- thumb_func_start sub_80D7868
-sub_80D7868: @ 80D7868
+ thumb_func_start BattleStringExpandPlaceholders
+BattleStringExpandPlaceholders: @ 80D7868
push {r4-r7,lr}
mov r7, r9
mov r6, r8
@@ -859,7 +859,7 @@ _080D78B0:
.4byte _080D8250
.4byte _080D79B8
_080D7974:
- ldr r5, _080D7984 @ =gUnknown_2022AB8
+ ldr r5, _080D7984 @ =gBattleTextBuff1
ldrb r0, [r5]
cmp r0, 0xFD
bne _080D798C
@@ -867,7 +867,7 @@ _080D7974:
adds r0, r5, 0
b _080D79C4
.align 2, 0
-_080D7984: .4byte gUnknown_2022AB8
+_080D7984: .4byte gBattleTextBuff1
_080D7988: .4byte gStringVar1
_080D798C:
adds r0, r5, 0
@@ -880,14 +880,14 @@ _080D799C:
adds r4, r5, 0
bl _080D8382
_080D79A2:
- ldr r1, _080D79B0 @ =gUnknown_2022AC8
+ ldr r1, _080D79B0 @ =gBattleTextBuff2
ldrb r0, [r1]
cmp r0, 0xFD
bne _080D79D8
ldr r4, _080D79B4 @ =gStringVar2
b _080D79C2
.align 2, 0
-_080D79B0: .4byte gUnknown_2022AC8
+_080D79B0: .4byte gBattleTextBuff2
_080D79B4: .4byte gStringVar2
_080D79B8:
ldr r1, _080D79D0 @ =gUnknown_2022AD8
@@ -924,7 +924,7 @@ _080D79F4:
_080D79FC: .4byte gStringVar3
_080D7A00:
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _080D7A1C @ =gBattlerPartyIndexes
lsls r0, 24
lsrs r0, 23
@@ -940,7 +940,7 @@ _080D7A1C: .4byte gBattlerPartyIndexes
_080D7A20: .4byte gPlayerParty
_080D7A24:
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _080D7A40 @ =gBattlerPartyIndexes
lsls r0, 24
lsrs r0, 23
@@ -956,7 +956,7 @@ _080D7A40: .4byte gBattlerPartyIndexes
_080D7A44: .4byte gEnemyParty
_080D7A48:
movs r0, 0x2
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _080D7A64 @ =gBattlerPartyIndexes
lsls r0, 24
lsrs r0, 23
@@ -972,7 +972,7 @@ _080D7A64: .4byte gBattlerPartyIndexes
_080D7A68: .4byte gPlayerParty
_080D7A6C:
movs r0, 0x3
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _080D7A88 @ =gBattlerPartyIndexes
lsls r0, 24
lsrs r0, 23
@@ -988,7 +988,7 @@ _080D7A88: .4byte gBattlerPartyIndexes
_080D7A8C: .4byte gEnemyParty
_080D7A90:
ldr r2, _080D7AB0 @ =gBattlerPartyIndexes
- ldr r1, _080D7AB4 @ =gUnknown_202273C
+ ldr r1, _080D7AB4 @ =gLinkPlayers
lsls r0, r7, 3
subs r0, r7
lsls r0, 2
@@ -1004,11 +1004,11 @@ _080D7A90:
bl _080D82AA
.align 2, 0
_080D7AB0: .4byte gBattlerPartyIndexes
-_080D7AB4: .4byte gUnknown_202273C
+_080D7AB4: .4byte gLinkPlayers
_080D7AB8: .4byte gPlayerParty
_080D7ABC:
ldr r2, _080D7AE0 @ =gBattlerPartyIndexes
- ldr r1, _080D7AE4 @ =gUnknown_202273C
+ ldr r1, _080D7AE4 @ =gLinkPlayers
lsls r0, r7, 3
subs r0, r7
lsls r0, 2
@@ -1026,11 +1026,11 @@ _080D7ABC:
bl _080D82AA
.align 2, 0
_080D7AE0: .4byte gBattlerPartyIndexes
-_080D7AE4: .4byte gUnknown_202273C
+_080D7AE4: .4byte gLinkPlayers
_080D7AE8: .4byte gEnemyParty
_080D7AEC:
ldr r2, _080D7B10 @ =gBattlerPartyIndexes
- ldr r1, _080D7B14 @ =gUnknown_202273C
+ ldr r1, _080D7B14 @ =gLinkPlayers
lsls r0, r7, 3
subs r0, r7
lsls r0, 2
@@ -1048,11 +1048,11 @@ _080D7AEC:
bl _080D82AA
.align 2, 0
_080D7B10: .4byte gBattlerPartyIndexes
-_080D7B14: .4byte gUnknown_202273C
+_080D7B14: .4byte gLinkPlayers
_080D7B18: .4byte gPlayerParty
_080D7B1C:
ldr r2, _080D7B40 @ =gBattlerPartyIndexes
- ldr r1, _080D7B44 @ =gUnknown_202273C
+ ldr r1, _080D7B44 @ =gLinkPlayers
lsls r0, r7, 3
subs r0, r7
lsls r0, 2
@@ -1070,12 +1070,12 @@ _080D7B1C:
b _080D82AA
.align 2, 0
_080D7B40: .4byte gBattlerPartyIndexes
-_080D7B44: .4byte gUnknown_202273C
+_080D7B44: .4byte gLinkPlayers
_080D7B48: .4byte gEnemyParty
_080D7B4C:
ldr r4, _080D7B70 @ =sBattler_AI
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
adds r2, r4, 0
cmp r0, 0
@@ -1106,11 +1106,11 @@ _080D7B8A:
cmp r0, 0xFF
bne _080D7B80
ldrb r0, [r2]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
movs r0, 0x1
ands r0, r1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _080D7BB8 @ =gBattlerPartyIndexes
lsls r0, 24
lsrs r0, 23
@@ -1126,11 +1126,11 @@ _080D7BB8: .4byte gBattlerPartyIndexes
_080D7BBC: .4byte gEnemyParty
_080D7BC0:
ldrb r0, [r2]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
movs r0, 0x1
ands r0, r1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _080D7BDC @ =gBattlerPartyIndexes
lsls r0, 24
lsrs r0, 23
@@ -1142,16 +1142,16 @@ _080D7BDC: .4byte gBattlerPartyIndexes
_080D7BE0:
ldr r4, _080D7C14 @ =sBattler_AI
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080D7C20
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
movs r0, 0x1
ands r0, r1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _080D7C18 @ =gBattlerPartyIndexes
lsls r0, 24
lsrs r0, 23
@@ -1169,11 +1169,11 @@ _080D7C18: .4byte gBattlerPartyIndexes
_080D7C1C: .4byte gPlayerParty
_080D7C20:
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
movs r0, 0x1
ands r0, r1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _080D7C44 @ =gBattlerPartyIndexes
lsls r0, 24
lsrs r0, 23
@@ -1190,7 +1190,7 @@ _080D7C48: .4byte gEnemyParty
_080D7C4C:
ldr r5, _080D7C98 @ =sBattler_AI
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080D7CB0
@@ -1246,7 +1246,7 @@ _080D7CBC: .4byte gBattlerPartyIndexes
_080D7CC0:
ldr r5, _080D7D0C @ =gBattlerTarget
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080D7D24
@@ -1302,7 +1302,7 @@ _080D7D30: .4byte gBattlerPartyIndexes
_080D7D34:
ldr r5, _080D7D80 @ =gUnknown_2023D6E
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080D7D98
@@ -1358,7 +1358,7 @@ _080D7DA4: .4byte gBattlerPartyIndexes
_080D7DA8:
ldr r5, _080D7DF4 @ =gActiveBattler
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080D7E0C
@@ -1414,7 +1414,7 @@ _080D7E18: .4byte gBattlerPartyIndexes
_080D7E1C:
ldr r5, _080D7E68 @ =gBattleScripting
ldrb r0, [r5, 0x17]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080D7E80
@@ -1531,7 +1531,7 @@ _080D7EE4:
ldrb r0, [r0]
cmp r0, 0
beq _080D7F2C
- ldr r2, _080D7F28 @ =gUnknown_2023D6F
+ ldr r2, _080D7F28 @ =gPotentialItemEffectBattler
ldrb r1, [r2]
movs r0, 0x1
ands r0, r1
@@ -1542,9 +1542,9 @@ _080D7EE4:
_080D7F1C: .4byte gBattleTypeFlags
_080D7F20: .4byte gUnknown_2023D68
_080D7F24: .4byte gBattleStruct
-_080D7F28: .4byte gUnknown_2023D6F
+_080D7F28: .4byte gPotentialItemEffectBattler
_080D7F2C:
- ldr r2, _080D7F40 @ =gUnknown_2023D6F
+ ldr r2, _080D7F40 @ =gPotentialItemEffectBattler
ldrb r1, [r2]
movs r0, 0x1
ands r0, r1
@@ -1556,9 +1556,9 @@ _080D7F38:
subs r1, r0
b _080D7F64
.align 2, 0
-_080D7F40: .4byte gUnknown_2023D6F
+_080D7F40: .4byte gPotentialItemEffectBattler
_080D7F44:
- ldr r2, _080D7F7C @ =gUnknown_202273C
+ ldr r2, _080D7F7C @ =gLinkPlayers
ldr r0, _080D7F80 @ =gBattleStruct
ldr r0, [r0]
adds r0, 0xB5
@@ -1567,7 +1567,7 @@ _080D7F44:
subs r0, r1
lsls r0, 2
adds r0, r2
- ldr r1, _080D7F84 @ =gUnknown_2023D6F
+ ldr r1, _080D7F84 @ =gPotentialItemEffectBattler
ldrb r2, [r1]
ldrh r0, [r0, 0x18]
cmp r0, r2
@@ -1576,7 +1576,7 @@ _080D7F44:
subs r1, r2
_080D7F64:
lsls r1, 2
- ldr r0, _080D7F88 @ =gUnknown_2023F54
+ ldr r0, _080D7F88 @ =gEnigmaBerries
adds r1, r0
mov r0, sp
bl StringCopy
@@ -1586,10 +1586,10 @@ _080D7F64:
mov r4, sp
b _080D8382
.align 2, 0
-_080D7F7C: .4byte gUnknown_202273C
+_080D7F7C: .4byte gLinkPlayers
_080D7F80: .4byte gBattleStruct
-_080D7F84: .4byte gUnknown_2023D6F
-_080D7F88: .4byte gUnknown_2023F54
+_080D7F84: .4byte gPotentialItemEffectBattler
+_080D7F88: .4byte gEnigmaBerries
_080D7F8C: .4byte gUnknown_83FD8AF
_080D7F90:
ldr r4, _080D7F94 @ =gUnknown_83FD8A2
@@ -1610,10 +1610,10 @@ _080D7FA0:
.align 2, 0
_080D7FAC: .4byte gUnknown_2023D68
_080D7FB0:
- ldr r0, _080D7FB4 @ =gUnknown_2023D6A
+ ldr r0, _080D7FB4 @ =gLastUsedAbility
b _080D7FF0
.align 2, 0
-_080D7FB4: .4byte gUnknown_2023D6A
+_080D7FB4: .4byte gLastUsedAbility
_080D7FB8:
ldr r1, _080D7FC0 @ =gUnknown_2039A30
ldr r0, _080D7FC4 @ =sBattler_AI
@@ -1726,12 +1726,12 @@ _080D8084:
movs r0, 0xD
_080D8094:
muls r1, r0
- ldr r0, _080D80A0 @ =gUnknown_823E558
+ ldr r0, _080D80A0 @ =gTrainerClassNames
adds r4, r1, r0
b _080D8382
.align 2, 0
_080D809C: .4byte gTrainers
-_080D80A0: .4byte gUnknown_823E558
+_080D80A0: .4byte gTrainerClassNames
_080D80A4:
ldr r0, _080D80E8 @ =gTrainerBattleOpponent_A
ldrh r2, [r0]
@@ -1840,7 +1840,7 @@ _080D8162:
.align 2, 0
_080D8170: .4byte gUnknown_2022744
_080D8174:
- ldr r4, _080D8184 @ =gUnknown_202273C
+ ldr r4, _080D8184 @ =gLinkPlayers
lsls r0, r7, 3
subs r0, r7
lsls r0, 2
@@ -1849,9 +1849,9 @@ _080D8174:
movs r0, 0x2
b _080D81AA
.align 2, 0
-_080D8184: .4byte gUnknown_202273C
+_080D8184: .4byte gLinkPlayers
_080D8188:
- ldr r4, _080D8198 @ =gUnknown_202273C
+ ldr r4, _080D8198 @ =gLinkPlayers
lsls r0, r7, 3
subs r0, r7
lsls r0, 2
@@ -1860,9 +1860,9 @@ _080D8188:
movs r0, 0x1
b _080D81AA
.align 2, 0
-_080D8198: .4byte gUnknown_202273C
+_080D8198: .4byte gLinkPlayers
_080D819C:
- ldr r4, _080D81BC @ =gUnknown_202273C
+ ldr r4, _080D81BC @ =gLinkPlayers
lsls r0, r7, 3
subs r0, r7
lsls r0, 2
@@ -1879,7 +1879,7 @@ _080D81AA:
adds r4, r1, r4
b _080D8382
.align 2, 0
-_080D81BC: .4byte gUnknown_202273C
+_080D81BC: .4byte gLinkPlayers
_080D81C0:
ldr r0, _080D81D4 @ =gBattleScripting
ldrb r0, [r0, 0x17]
@@ -1959,7 +1959,7 @@ _080D825C: .4byte gStringVar4
_080D8260:
ldr r0, _080D82B4 @ =gBattleScripting
ldrb r0, [r0, 0x17]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _080D82CC
@@ -2053,7 +2053,7 @@ _080D8320:
ldr r0, _080D8334 @ =gBattlerTarget
_080D8322:
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
ldr r4, _080D8338 @ =gUnknown_83FD569
cmp r0, 0
@@ -2073,7 +2073,7 @@ _080D8348:
ldr r0, _080D835C @ =gBattlerTarget
_080D834A:
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
ldr r4, _080D8360 @ =gUnknown_83FD560
cmp r0, 0
@@ -2093,7 +2093,7 @@ _080D8370:
ldr r0, _080D83D4 @ =gBattlerTarget
_080D8372:
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
ldr r4, _080D83D8 @ =gUnknown_83FD572
cmp r0, 0
@@ -2177,7 +2177,7 @@ _080D83FA:
pop {r4-r7}
pop {r1}
bx r1
- thumb_func_end sub_80D7868
+ thumb_func_end BattleStringExpandPlaceholders
thumb_func_start ExpandBattleTextBuffPlaceholders
ExpandBattleTextBuffPlaceholders: @ 80D8418
@@ -2310,7 +2310,7 @@ _080D8504:
_080D8510: .4byte gUnknown_824F1A0
_080D8514:
ldrb r0, [r4, 0x1]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080D8538
@@ -2385,7 +2385,7 @@ _080D85A0:
_080D85B2:
adds r4, r5, r7
ldrb r0, [r4, 0x1]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080D85D8
@@ -2454,7 +2454,7 @@ _080D8628:
beq _080D86A6
cmp r2, 0xAF
bne _080D869C
- ldr r2, _080D8678 @ =gUnknown_202273C
+ ldr r2, _080D8678 @ =gLinkPlayers
ldr r0, _080D867C @ =gBattleStruct
ldr r0, [r0]
adds r0, 0xB5
@@ -2463,7 +2463,7 @@ _080D8628:
subs r0, r1
lsls r0, 2
adds r0, r2
- ldr r1, _080D8680 @ =gUnknown_2023D6F
+ ldr r1, _080D8680 @ =gPotentialItemEffectBattler
ldrb r2, [r1]
ldrh r0, [r0, 0x18]
cmp r0, r2
@@ -2471,7 +2471,7 @@ _080D8628:
lsls r1, r2, 3
subs r1, r2
lsls r1, 2
- ldr r0, _080D8684 @ =gUnknown_2023F54
+ ldr r0, _080D8684 @ =gEnigmaBerries
adds r1, r0
adds r0, r6, 0
bl StringCopy
@@ -2479,10 +2479,10 @@ _080D8628:
b _080D868E
.align 2, 0
_080D8674: .4byte gBattleTypeFlags
-_080D8678: .4byte gUnknown_202273C
+_080D8678: .4byte gLinkPlayers
_080D867C: .4byte gBattleStruct
-_080D8680: .4byte gUnknown_2023D6F
-_080D8684: .4byte gUnknown_2023F54
+_080D8680: .4byte gPotentialItemEffectBattler
+_080D8684: .4byte gEnigmaBerries
_080D8688: .4byte gUnknown_83FD8AF
_080D868C:
ldr r1, _080D8698 @ =gUnknown_83FD8A2
diff --git a/asm/battle_records.s b/asm/battle_records.s
index 797830e95..4a134cd0c 100644
--- a/asm/battle_records.s
+++ b/asm/battle_records.s
@@ -980,7 +980,7 @@ sub_80CD98C: @ 80CD98C
ldrh r2, [r2, 0xE]
ldr r3, _080CD9EC @ =gUnknown_2023E8A
ldrb r3, [r3]
- ldr r5, _080CD9F0 @ =gUnknown_202273C
+ ldr r5, _080CD9F0 @ =gLinkPlayers
lsls r4, r6, 3
subs r4, r6
lsls r4, 2
@@ -999,7 +999,7 @@ _080CD9E0: .4byte gSaveBlock2Ptr
_080CD9E4: .4byte 0x00000a98
_080CD9E8: .4byte gUnknown_2039654
_080CD9EC: .4byte gUnknown_2023E8A
-_080CD9F0: .4byte gUnknown_202273C
+_080CD9F0: .4byte gLinkPlayers
thumb_func_end sub_80CD98C
thumb_func_start sub_80CD9F4
diff --git a/asm/battle_script_commands.s b/asm/battle_script_commands.s
index 9d165dd4c..29dcfecca 100644
--- a/asm/battle_script_commands.s
+++ b/asm/battle_script_commands.s
@@ -67,7 +67,7 @@ _0801D7D6:
movs r0, 0x2
movs r2, 0
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
beq _0801D7EE
@@ -230,7 +230,7 @@ _0801D944: .4byte gUnknown_2023D74
_0801D948: .4byte gUnknown_81D8FAA
_0801D94C:
movs r2, 0
- ldr r0, _0801D9C8 @ =gUnknown_2023BCC
+ ldr r0, _0801D9C8 @ =gBattlersCount
ldrb r0, [r0]
cmp r2, r0
bge _0801D98E
@@ -280,7 +280,7 @@ _0801D98E:
negs r0, r0
ands r0, r3
strb r0, [r1]
- ldr r4, _0801D9E0 @ =gUnknown_2023D6A
+ ldr r4, _0801D9E0 @ =gLastUsedAbility
movs r0, 0x1F
strb r0, [r4]
bl BattleScriptPushCursor
@@ -293,13 +293,13 @@ _0801D98E:
bl sub_80C71D0
b _0801DAFC
.align 2, 0
-_0801D9C8: .4byte gUnknown_2023BCC
+_0801D9C8: .4byte gBattlersCount
_0801D9CC: .4byte gUnknown_2023E8C
_0801D9D0: .4byte gBattleMoves
_0801D9D4: .4byte gUnknown_2023BDE
_0801D9D8: .4byte gCurrentMove
_0801D9DC: .4byte gUnknown_2023ECC
-_0801D9E0: .4byte gUnknown_2023D6A
+_0801D9E0: .4byte gLastUsedAbility
_0801D9E4: .4byte gUnknown_2023D74
_0801D9E8: .4byte gUnknown_81D938D
_0801D9EC:
@@ -495,7 +495,7 @@ _0801DB70:
movs r0, 0x3
movs r2, 0
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
bne _0801DB8E
@@ -724,7 +724,7 @@ _0801DD36:
movs r1, 0
movs r2, 0xD
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r0, 24
lsls r4, r5, 1
@@ -735,7 +735,7 @@ _0801DD36:
movs r1, 0
movs r2, 0x4D
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
bne _0801DD86
@@ -818,7 +818,7 @@ sub_801DDC4: @ 801DDC4
beq _0801DE12
ldr r0, _0801DE6C @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _0801DE56
@@ -844,7 +844,7 @@ _0801DE12:
bne _0801DE48
ldr r0, _0801DE6C @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _0801DE56
@@ -1047,7 +1047,7 @@ _0801DFC0:
movs r1, 0
movs r2, 0xD
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r0, 24
str r4, [sp, 0x4]
@@ -1058,7 +1058,7 @@ _0801DFC0:
movs r1, 0
movs r2, 0x4D
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
bne _0801E012
@@ -1110,7 +1110,7 @@ _0801E050:
movs r1, 0
movs r2, 0xD
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r0, 24
cmp r0, 0
@@ -1120,7 +1120,7 @@ _0801E050:
movs r1, 0
movs r2, 0x4D
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
bne _0801E0A8
@@ -1179,7 +1179,7 @@ _0801E0D4:
ldrh r0, [r1, 0x2E]
cmp r0, 0xAF
bne _0801E118
- ldr r1, _0801E114 @ =gUnknown_2023F54
+ ldr r1, _0801E114 @ =gEnigmaBerries
lsls r0, r2, 3
subs r0, r2
lsls r0, 2
@@ -1194,7 +1194,7 @@ _0801E104: .4byte gBattleWeather
_0801E108: .4byte gUnknown_82504FC
_0801E10C: .4byte gBattleMons
_0801E110: .4byte gBattlerTarget
-_0801E114: .4byte gUnknown_2023F54
+_0801E114: .4byte gEnigmaBerries
_0801E118:
ldrh r0, [r1, 0x2E]
bl ItemId_GetHoldEffect
@@ -1209,7 +1209,7 @@ _0801E118:
lsls r0, 24
lsrs r2, r0, 24
_0801E134:
- ldr r0, _0801E198 @ =gUnknown_2023D6F
+ ldr r0, _0801E198 @ =gPotentialItemEffectBattler
ldr r1, _0801E19C @ =gBattlerTarget
ldrb r1, [r1]
strb r1, [r0]
@@ -1259,7 +1259,7 @@ _0801E192:
movs r0, 0x2
b _0801E1B4
.align 2, 0
-_0801E198: .4byte gUnknown_2023D6F
+_0801E198: .4byte gPotentialItemEffectBattler
_0801E19C: .4byte gBattlerTarget
_0801E1A0: .4byte gMoveResultFlags
_0801E1A4: .4byte gBattleTypeFlags
@@ -1389,7 +1389,7 @@ _0801E296:
adds r1, r3, 0
movs r2, 0x2E
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r0, 24
adds r6, r0, 0x1
@@ -1402,7 +1402,7 @@ _0801E2AC:
movs r0, 0x10
movs r2, 0x2E
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r0, 24
adds r6, r0
@@ -1575,7 +1575,7 @@ sub_801E408: @ 801E408
ldrh r0, [r0, 0x2E]
cmp r0, 0xAF
bne _0801E438
- ldr r1, _0801E434 @ =gUnknown_2023F54
+ ldr r1, _0801E434 @ =gEnigmaBerries
lsls r0, r2, 3
subs r0, r2
lsls r0, 2
@@ -1585,13 +1585,13 @@ sub_801E408: @ 801E408
.align 2, 0
_0801E42C: .4byte gBattleMons
_0801E430: .4byte sBattler_AI
-_0801E434: .4byte gUnknown_2023F54
+_0801E434: .4byte gEnigmaBerries
_0801E438:
bl ItemId_GetHoldEffect
lsls r0, 24
lsrs r6, r0, 24
_0801E440:
- ldr r1, _0801E4CC @ =gUnknown_2023D6F
+ ldr r1, _0801E4CC @ =gPotentialItemEffectBattler
ldr r3, _0801E4D0 @ =sBattler_AI
ldrb r0, [r3]
strb r0, [r1]
@@ -1668,7 +1668,7 @@ _0801E4C0:
adds r0, r2, r0
b _0801E4E2
.align 2, 0
-_0801E4CC: .4byte gUnknown_2023D6F
+_0801E4CC: .4byte gPotentialItemEffectBattler
_0801E4D0: .4byte sBattler_AI
_0801E4D4: .4byte gBattleMons
_0801E4D8: .4byte gBattleMoves
@@ -1774,7 +1774,7 @@ atk05_damagecalc: @ 801E59C
ldr r4, _0801E654 @ =gSideAffecting
ldr r5, _0801E658 @ =gBattlerTarget
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x1
ands r1, r0
lsls r1, 1
@@ -1802,7 +1802,7 @@ atk05_damagecalc: @ 801E59C
str r4, [sp, 0x8]
ldrb r4, [r5]
str r4, [sp, 0xC]
- bl sub_803ECEC
+ bl CalculateBaseDamage
ldr r4, _0801E670 @ =gBattleMoveDamage
ldr r1, _0801E674 @ =gCritMultiplier
ldrb r1, [r1]
@@ -1889,7 +1889,7 @@ AI_CalcDmg: @ 801E68C
lsrs r5, 24
ldr r4, _0801E744 @ =gSideAffecting
adds r0, r5, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x1
ands r1, r0
lsls r1, 1
@@ -1914,7 +1914,7 @@ AI_CalcDmg: @ 801E68C
str r4, [sp, 0x4]
str r7, [sp, 0x8]
str r5, [sp, 0xC]
- bl sub_803ECEC
+ bl CalculateBaseDamage
ldr r4, _0801E758 @ =gBattleMoveDamage
movs r1, 0
strh r1, [r6]
@@ -2175,7 +2175,7 @@ _0801E8C0:
mov r1, r8
cmp r1, 0x4
bne _0801E938
- ldr r3, _0801E924 @ =gUnknown_2023D6A
+ ldr r3, _0801E924 @ =gLastUsedAbility
strb r0, [r3]
ldr r2, _0801E928 @ =gMoveResultFlags
ldrb r0, [r2]
@@ -2206,7 +2206,7 @@ _0801E914: .4byte gBattleMons
_0801E918: .4byte sBattler_AI
_0801E91C: .4byte gBattleMoveDamage
_0801E920: .4byte gBattlerTarget
-_0801E924: .4byte gUnknown_2023D6A
+_0801E924: .4byte gLastUsedAbility
_0801E928: .4byte gMoveResultFlags
_0801E92C: .4byte gUnknown_2023DA0
_0801E930: .4byte gUnknown_2023DA8
@@ -2333,7 +2333,7 @@ _0801EA10:
ldrb r0, [r0, 0x1]
cmp r0, 0
beq _0801EA52
- ldr r3, _0801EAA0 @ =gUnknown_2023D6A
+ ldr r3, _0801EAA0 @ =gLastUsedAbility
strb r6, [r3]
movs r0, 0x1
orrs r0, r4
@@ -2391,7 +2391,7 @@ _0801EA90: .4byte sBattler_AI
_0801EA94: .4byte gCurrentMove
_0801EA98: .4byte gMoveResultFlags
_0801EA9C: .4byte gBattleMoves
-_0801EAA0: .4byte gUnknown_2023D6A
+_0801EAA0: .4byte gLastUsedAbility
_0801EAA4: .4byte gUnknown_2023DA0
_0801EAA8: .4byte gUnknown_2023DA8
_0801EAAC: .4byte gUnknown_2023E82
@@ -2458,7 +2458,7 @@ _0801EB08:
mov r0, r12
cmp r0, 0x4
bne _0801EB4C
- ldr r0, _0801EB44 @ =gUnknown_2023D6A
+ ldr r0, _0801EB44 @ =gLastUsedAbility
strb r1, [r0]
ldr r0, _0801EB48 @ =gUnknown_2023E82
mov r1, r12
@@ -2470,7 +2470,7 @@ _0801EB08:
.align 2, 0
_0801EB3C: .4byte gBattleMons
_0801EB40: .4byte gBattlerTarget
-_0801EB44: .4byte gUnknown_2023D6A
+_0801EB44: .4byte gLastUsedAbility
_0801EB48: .4byte gUnknown_2023E82
_0801EB4C:
ldr r1, _0801EB58 @ =gUnknown_824F050
@@ -2702,7 +2702,7 @@ _0801ECC2:
ldrb r0, [r0, 0x1]
cmp r0, 0
beq _0801ED18
- ldr r0, _0801ED34 @ =gUnknown_2023D6A
+ ldr r0, _0801ED34 @ =gLastUsedAbility
strb r4, [r0]
ldr r1, _0801ED38 @ =gUnknown_2023E82
movs r0, 0x3
@@ -2723,7 +2723,7 @@ _0801ED24: .4byte gMoveResultFlags
_0801ED28: .4byte gUnknown_2023E8C
_0801ED2C: .4byte sBattler_AI
_0801ED30: .4byte gBattleMoves
-_0801ED34: .4byte gUnknown_2023D6A
+_0801ED34: .4byte gLastUsedAbility
_0801ED38: .4byte gUnknown_2023E82
thumb_func_end CheckWonderGuardAndLevitate
@@ -3278,7 +3278,7 @@ _0801F136:
ldrh r0, [r1, 0x2E]
cmp r0, 0xAF
bne _0801F16C
- ldr r1, _0801F168 @ =gUnknown_2023F54
+ ldr r1, _0801F168 @ =gEnigmaBerries
lsls r0, r2, 3
subs r0, r2
lsls r0, 2
@@ -3290,7 +3290,7 @@ _0801F136:
_0801F15C: .4byte gBattleMoveDamage
_0801F160: .4byte gBattleMons
_0801F164: .4byte gBattlerTarget
-_0801F168: .4byte gUnknown_2023F54
+_0801F168: .4byte gEnigmaBerries
_0801F16C:
ldrh r0, [r1, 0x2E]
bl ItemId_GetHoldEffect
@@ -3304,7 +3304,7 @@ _0801F16C:
lsls r0, 24
lsrs r6, r0, 24
_0801F186:
- ldr r1, _0801F248 @ =gUnknown_2023D6F
+ ldr r1, _0801F248 @ =gPotentialItemEffectBattler
ldr r5, _0801F24C @ =gBattlerTarget
ldrb r0, [r5]
strb r0, [r1]
@@ -3401,7 +3401,7 @@ _0801F216:
strb r1, [r0]
b _0801F294
.align 2, 0
-_0801F248: .4byte gUnknown_2023D6F
+_0801F248: .4byte gPotentialItemEffectBattler
_0801F24C: .4byte gBattlerTarget
_0801F250: .4byte gUnknown_2023ECC
_0801F254: .4byte gBattleMons
@@ -3482,7 +3482,7 @@ _0801F2E6:
ldrh r0, [r1, 0x2E]
cmp r0, 0xAF
bne _0801F31C
- ldr r1, _0801F318 @ =gUnknown_2023F54
+ ldr r1, _0801F318 @ =gEnigmaBerries
lsls r0, r2, 3
subs r0, r2
lsls r0, 2
@@ -3494,7 +3494,7 @@ _0801F2E6:
_0801F30C: .4byte gBattleMoveDamage
_0801F310: .4byte gBattleMons
_0801F314: .4byte gBattlerTarget
-_0801F318: .4byte gUnknown_2023F54
+_0801F318: .4byte gEnigmaBerries
_0801F31C:
ldrh r0, [r1, 0x2E]
bl ItemId_GetHoldEffect
@@ -3508,7 +3508,7 @@ _0801F31C:
lsls r0, 24
lsrs r6, r0, 24
_0801F336:
- ldr r1, _0801F3DC @ =gUnknown_2023D6F
+ ldr r1, _0801F3DC @ =gPotentialItemEffectBattler
ldr r5, _0801F3E0 @ =gBattlerTarget
ldrb r0, [r5]
strb r0, [r1]
@@ -3591,7 +3591,7 @@ _0801F3B2:
strb r1, [r0]
b _0801F420
.align 2, 0
-_0801F3DC: .4byte gUnknown_2023D6F
+_0801F3DC: .4byte gPotentialItemEffectBattler
_0801F3E0: .4byte gBattlerTarget
_0801F3E4: .4byte gUnknown_2023ECC
_0801F3E8: .4byte gBattleMons
@@ -3719,7 +3719,7 @@ _0801F4CE:
ldrh r1, [r3]
ldr r6, _0801F540 @ =gBattleScripting
ldrb r2, [r6, 0x18]
- ldr r0, _0801F550 @ =gUnknown_2024020
+ ldr r0, _0801F550 @ =gBattleMovePower
ldrh r3, [r0]
ldr r0, _0801F554 @ =gBattleMoveDamage
ldr r0, [r0]
@@ -3764,7 +3764,7 @@ _0801F540: .4byte gBattleScripting
_0801F544: .4byte gMoveResultFlags
_0801F548: .4byte gActiveBattler
_0801F54C: .4byte sBattler_AI
-_0801F550: .4byte gUnknown_2024020
+_0801F550: .4byte gBattleMovePower
_0801F554: .4byte gBattleMoveDamage
_0801F558: .4byte gBattleMons
_0801F55C: .4byte gDisableStructs
@@ -3880,7 +3880,7 @@ _0801F636:
ldrb r0, [r4]
bl MarkBufferBankForExecution
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _0801F662
@@ -4645,7 +4645,7 @@ _0801FC38:
adds r0, r2
ldrh r0, [r0, 0x2E]
strh r0, [r4]
- ldr r1, _0801FC6C @ =gUnknown_2023D6F
+ ldr r1, _0801FC6C @ =gPotentialItemEffectBattler
ldrb r0, [r3]
strb r0, [r1]
movs r0, 0x3F
@@ -4659,7 +4659,7 @@ _0801FC38:
_0801FC60: .4byte gUnknown_2023D68
_0801FC64: .4byte gBattleMons
_0801FC68: .4byte gBattlerTarget
-_0801FC6C: .4byte gUnknown_2023D6F
+_0801FC6C: .4byte gPotentialItemEffectBattler
_0801FC70: .4byte gUnknown_2023D74
_0801FC74: .4byte gUnknown_81D9641
_0801FC78:
@@ -4720,7 +4720,7 @@ _0801FCD0:
adds r0, r2
ldrh r0, [r0, 0x2E]
strh r0, [r4]
- ldr r1, _0801FD0C @ =gUnknown_2023D6F
+ ldr r1, _0801FD0C @ =gPotentialItemEffectBattler
ldrb r0, [r3]
strb r0, [r1]
movs r0, 0x3F
@@ -4734,7 +4734,7 @@ _0801FCD0:
_0801FD00: .4byte gUnknown_2023D68
_0801FD04: .4byte gBattleMons
_0801FD08: .4byte gBattlerTarget
-_0801FD0C: .4byte gUnknown_2023D6F
+_0801FD0C: .4byte gPotentialItemEffectBattler
_0801FD10: .4byte gUnknown_2023D74
_0801FD14: .4byte gUnknown_81D9641
_0801FD18:
@@ -4985,7 +4985,7 @@ BankGetTurnOrder: @ 801FEE8
lsls r0, 24
lsrs r2, r0, 24
movs r1, 0
- ldr r0, _0801FF18 @ =gUnknown_2023BCC
+ ldr r0, _0801FF18 @ =gBattlersCount
ldrb r3, [r0]
cmp r1, r3
bge _0801FF0E
@@ -5008,7 +5008,7 @@ _0801FF0E:
pop {r1}
bx r1
.align 2, 0
-_0801FF18: .4byte gUnknown_2023BCC
+_0801FF18: .4byte gBattlersCount
_0801FF1C: .4byte gUnknown_2023BDE
thumb_func_end BankGetTurnOrder
@@ -5076,7 +5076,7 @@ _0801FF84:
beq _0801FFB2
mov r2, r9
ldrb r0, [r2]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -5111,7 +5111,7 @@ _0801FFB2:
_0801FFE6:
mov r3, r9
ldrb r0, [r3]
- bl GetBankIdentity
+ bl GetBattlerPosition
ldr r2, _080200B4 @ =gSideAffecting
movs r1, 0x1
ands r1, r0
@@ -5240,7 +5240,7 @@ _080200D6:
ldr r0, _08020130 @ =gActiveBattler
movs r1, 0
strb r1, [r0]
- ldr r1, _08020134 @ =gUnknown_2023BCC
+ ldr r1, _08020134 @ =gBattlersCount
ldrb r3, [r1]
adds r7, r0, 0
mov r12, r1
@@ -5275,10 +5275,10 @@ _08020110:
b _08020144
.align 2, 0
_08020130: .4byte gActiveBattler
-_08020134: .4byte gUnknown_2023BCC
+_08020134: .4byte gBattlersCount
_08020138:
ldr r0, _08020184 @ =gActiveBattler
- ldr r2, _08020188 @ =gUnknown_2023BCC
+ ldr r2, _08020188 @ =gBattlersCount
ldrb r1, [r2]
strb r1, [r0]
adds r7, r0, 0
@@ -5321,7 +5321,7 @@ _0802017C:
b _08020560
.align 2, 0
_08020184: .4byte gActiveBattler
-_08020188: .4byte gUnknown_2023BCC
+_08020188: .4byte gBattlersCount
_0802018C:
mov r2, r9
ldrb r1, [r2]
@@ -5337,7 +5337,7 @@ _0802018C:
cmp r5, 0x80
bne _080201E4
_080201A6:
- ldr r0, _080201D4 @ =gUnknown_2023D6A
+ ldr r0, _080201D4 @ =gLastUsedAbility
strb r1, [r0]
mov r3, r9
ldrb r0, [r3]
@@ -5361,7 +5361,7 @@ _080201C0:
_080201D2:
b _080204A8
.align 2, 0
-_080201D4: .4byte gUnknown_2023D6A
+_080201D4: .4byte gLastUsedAbility
_080201D8: .4byte gUnknown_2023D74
_080201DC: .4byte gUnknown_81D9438
_080201E0: .4byte gUnknown_2023DD0
@@ -5460,7 +5460,7 @@ _08020270:
cmp r5, 0x80
bne _080202B4
_0802028A:
- ldr r0, _080202A8 @ =gUnknown_2023D6A
+ ldr r0, _080202A8 @ =gLastUsedAbility
strb r1, [r0]
mov r3, r9
ldrb r0, [r3]
@@ -5473,7 +5473,7 @@ _0802028A:
ldr r0, _080202B0 @ =gUnknown_81D9420
b _080201C0
.align 2, 0
-_080202A8: .4byte gUnknown_2023D6A
+_080202A8: .4byte gLastUsedAbility
_080202AC: .4byte gUnknown_2023D74
_080202B0: .4byte gUnknown_81D9420
_080202B4:
@@ -5561,7 +5561,7 @@ _08020346:
movs r1, 0
movs r2, 0xD
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r0, 24
cmp r0, 0
@@ -5571,7 +5571,7 @@ _08020346:
movs r1, 0
movs r2, 0x4D
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
bne _08020382
@@ -5651,7 +5651,7 @@ _080203E4:
beq _08020402
b _08020570
_08020402:
- ldr r0, _08020420 @ =gUnknown_2023D6A
+ ldr r0, _08020420 @ =gLastUsedAbility
strb r2, [r0]
mov r3, r9
ldrb r0, [r3]
@@ -5664,7 +5664,7 @@ _08020402:
ldr r0, _08020428 @ =gUnknown_81D942C
b _080201C0
.align 2, 0
-_08020420: .4byte gUnknown_2023D6A
+_08020420: .4byte gLastUsedAbility
_08020424: .4byte gUnknown_2023D74
_08020428: .4byte gUnknown_81D942C
_0802042C:
@@ -5694,7 +5694,7 @@ _08020440:
cmp r5, 0x80
bne _080204AE
_0802045A:
- ldr r0, _08020494 @ =gUnknown_2023D6A
+ ldr r0, _08020494 @ =gLastUsedAbility
strb r1, [r0]
mov r1, r9
ldrb r0, [r1]
@@ -5721,7 +5721,7 @@ _08020484:
str r1, [r2]
bl _0802110A
.align 2, 0
-_08020494: .4byte gUnknown_2023D6A
+_08020494: .4byte gLastUsedAbility
_08020498: .4byte gUnknown_2023D74
_0802049C: .4byte gUnknown_81D9438
_080204A0: .4byte gUnknown_2023DD0
@@ -6123,7 +6123,7 @@ _0802082C:
beq _0802084C
bl _080210EC
_0802084C:
- ldr r0, _08020864 @ =gUnknown_2023D6A
+ ldr r0, _08020864 @ =gLastUsedAbility
strb r1, [r0]
mov r1, r9
ldrb r0, [r1]
@@ -6134,7 +6134,7 @@ _0802084C:
str r0, [r1]
bl _0802110A
.align 2, 0
-_08020864: .4byte gUnknown_2023D6A
+_08020864: .4byte gLastUsedAbility
_08020868: .4byte gUnknown_2023D74
_0802086C: .4byte gUnknown_81D9452
_08020870:
@@ -6228,7 +6228,7 @@ _08020930: .4byte gUnknown_2023E82
_08020934:
ldr r5, _08020984 @ =sBattler_AI
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x1
ands r1, r0
cmp r1, 0
@@ -6656,11 +6656,11 @@ _08020CA8:
_08020CB8:
ldr r4, _08020D68 @ =sBattler_AI
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r6, r0, 24
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -6728,7 +6728,7 @@ _08020D26:
ldr r1, _08020D88 @ =gUnknown_2023D74
ldr r0, _08020D8C @ =gUnknown_81D948E
str r0, [r1]
- ldr r1, _08020D90 @ =gUnknown_2023D6A
+ ldr r1, _08020D90 @ =gLastUsedAbility
ldrb r0, [r7]
muls r0, r3
add r0, r8
@@ -6751,7 +6751,7 @@ _08020D80: .4byte gBattleMons
_08020D84: .4byte gBattlerTarget
_08020D88: .4byte gUnknown_2023D74
_08020D8C: .4byte gUnknown_81D948E
-_08020D90: .4byte gUnknown_2023D6A
+_08020D90: .4byte gLastUsedAbility
_08020D94:
ldr r4, _08020E60 @ =sBattler_AI
mov r10, r4
@@ -7068,7 +7068,7 @@ _08021018:
ldrh r0, [r1, 0x2E]
cmp r0, 0
beq _080210EC
- ldr r0, _0802104C @ =gUnknown_2023D6A
+ ldr r0, _0802104C @ =gLastUsedAbility
strb r2, [r0]
ldr r1, _08021050 @ =gUnknown_2023D74
ldr r0, _08021054 @ =gUnknown_81D948E
@@ -7078,7 +7078,7 @@ _08021018:
bl sub_80C71D0
b _0802110A
.align 2, 0
-_0802104C: .4byte gUnknown_2023D6A
+_0802104C: .4byte gLastUsedAbility
_08021050: .4byte gUnknown_2023D74
_08021054: .4byte gUnknown_81D948E
_08021058:
@@ -7086,7 +7086,7 @@ _08021058:
cmp r0, 0
beq _080210EC
adds r0, r3, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r6, r0, 24
ldr r1, _080210D0 @ =gUnknown_2023D68
@@ -7415,7 +7415,7 @@ _080212E4:
bl BattleScriptPop
str r4, [r6]
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
ldr r1, _08021328 @ =gSideAffecting
lsls r0, 24
lsrs r0, 23
@@ -7493,7 +7493,7 @@ _08021392:
bl BattleScriptPush
str r4, [r6]
ldrb r0, [r7]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080213F4
@@ -7608,10 +7608,10 @@ _08021492:
ldr r0, _0802155C @ =sBattler_AI
mov r8, r0
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
adds r4, r0, 0
ldrb r0, [r6]
- bl GetBankSide
+ bl GetBattlerSide
lsls r4, 24
lsls r0, 24
cmp r4, r0
@@ -7666,7 +7666,7 @@ _08021492:
bl EmitSetMonData
ldrb r0, [r5]
bl MarkBufferBankForExecution
- ldr r1, _08021588 @ =gUnknown_2022AB8
+ ldr r1, _08021588 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x2
@@ -7708,7 +7708,7 @@ _08021578: .4byte gBattlerTarget
_0802157C: .4byte gCurrentMove
_08021580: .4byte gUnknown_81D8FA3
_08021584: .4byte gActiveBattler
-_08021588: .4byte gUnknown_2022AB8
+_08021588: .4byte gBattleTextBuff1
_0802158C:
ldr r0, [r6]
adds r0, 0x7
@@ -7955,12 +7955,12 @@ atk1E_jumpifability: @ 8021730
movs r0, 0xD
adds r2, r5, 0
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0
beq _08021804
- ldr r1, _0802178C @ =gUnknown_2023D6A
+ ldr r1, _0802178C @ =gLastUsedAbility
strb r5, [r1]
str r7, [r6]
subs r4, 0x1
@@ -7971,7 +7971,7 @@ atk1E_jumpifability: @ 8021730
.align 2, 0
_08021784: .4byte gUnknown_2023D74
_08021788: .4byte sBattler_AI
-_0802178C: .4byte gUnknown_2023D6A
+_0802178C: .4byte gLastUsedAbility
_08021790:
cmp r0, 0x9
bne _080217C8
@@ -7982,12 +7982,12 @@ _08021790:
movs r0, 0xC
adds r2, r5, 0
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0
beq _08021804
- ldr r1, _080217C4 @ =gUnknown_2023D6A
+ ldr r1, _080217C4 @ =gLastUsedAbility
strb r5, [r1]
str r7, [r6]
subs r4, 0x1
@@ -7997,7 +7997,7 @@ _08021790:
b _080217EC
.align 2, 0
_080217C0: .4byte sBattler_AI
-_080217C4: .4byte gUnknown_2023D6A
+_080217C4: .4byte gLastUsedAbility
_080217C8:
ldrb r0, [r2, 0x1]
bl sub_8016E24
@@ -8011,7 +8011,7 @@ _080217C8:
ldrb r1, [r0]
cmp r1, r8
bne _08021804
- ldr r0, _080217FC @ =gUnknown_2023D6A
+ ldr r0, _080217FC @ =gLastUsedAbility
strb r1, [r0]
str r7, [r6]
ldrb r1, [r0]
@@ -8023,7 +8023,7 @@ _080217EC:
b _0802180A
.align 2, 0
_080217F8: .4byte gBattleMons
-_080217FC: .4byte gUnknown_2023D6A
+_080217FC: .4byte gLastUsedAbility
_08021800: .4byte gBattleScripting
_08021804:
ldr r0, [r6]
@@ -8048,7 +8048,7 @@ atk1F_jumpifsideaffecting: @ 8021818
bne _08021838
ldr r0, _08021834 @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankIdentity
+ bl GetBattlerPosition
b _08021842
.align 2, 0
_08021830: .4byte gUnknown_2023D74
@@ -8056,7 +8056,7 @@ _08021834: .4byte sBattler_AI
_08021838:
ldr r0, _08021878 @ =gBattlerTarget
ldrb r0, [r0]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r4, 0x1
_08021842:
ands r4, r0
@@ -8402,7 +8402,7 @@ _08021AC8:
_08021AE4:
ldr r4, _08021B34 @ =gUnknown_2023D6D
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -8856,7 +8856,7 @@ _08021EAE:
_08021EB4:
strb r1, [r0]
_08021EB6:
- ldr r1, _08021F60 @ =gUnknown_2022AB8
+ ldr r1, _08021F60 @ =gBattleTextBuff1
movs r2, 0
mov r12, r2
movs r3, 0xFD
@@ -8874,7 +8874,7 @@ _08021EB6:
strb r0, [r1, 0x3]
movs r0, 0xFF
strb r0, [r1, 0x4]
- ldr r1, _08021F64 @ =gUnknown_2022AC8
+ ldr r1, _08021F64 @ =gBattleTextBuff2
strb r3, [r1]
mov r0, r12
strb r0, [r1, 0x1]
@@ -8939,8 +8939,8 @@ _08021F4C:
b _08022052
.align 2, 0
_08021F5C: .4byte gBattleStruct
-_08021F60: .4byte gUnknown_2022AB8
-_08021F64: .4byte gUnknown_2022AC8
+_08021F60: .4byte gBattleTextBuff1
+_08021F64: .4byte gBattleTextBuff2
_08021F68: .4byte gUnknown_2022AD8
_08021F6C: .4byte gPlayerParty
_08021F70: .4byte gBattleMons
@@ -9112,7 +9112,7 @@ _080220B0:
adds r1, r2, 0
bl HandleLowHpMusicChange
_080220DA:
- ldr r1, _08022330 @ =gUnknown_2022AB8
+ ldr r1, _08022330 @ =gBattleTextBuff1
movs r3, 0xFD
strb r3, [r1]
movs r0, 0x4
@@ -9127,7 +9127,7 @@ _080220DA:
strb r0, [r1, 0x3]
movs r0, 0xFF
strb r0, [r1, 0x4]
- ldr r4, _08022334 @ =gUnknown_2022AC8
+ ldr r4, _08022334 @ =gBattleTextBuff2
strb r3, [r4]
movs r0, 0x1
strb r0, [r4, 0x1]
@@ -9182,7 +9182,7 @@ _080220DA:
adds r0, r1, 0
adds r0, r7
movs r1, 0
- bl sub_80436F8
+ bl AdjustFriendship
ldr r1, _08022328 @ =gBattlerPartyIndexes
mov r2, r9
ldr r0, [r2]
@@ -9386,8 +9386,8 @@ _08022320: .4byte gUnknown_20233C4
_08022324: .4byte gBattleTypeFlags
_08022328: .4byte gBattlerPartyIndexes
_0802232C: .4byte gPlayerParty
-_08022330: .4byte gUnknown_2022AB8
-_08022334: .4byte gUnknown_2022AC8
+_08022330: .4byte gBattleTextBuff1
+_08022334: .4byte gBattleTextBuff2
_08022338: .4byte gUnknown_3004FD4
_0802233C: .4byte gBitTable
_08022340: .4byte gUnknown_2023D74
@@ -9573,7 +9573,7 @@ _08022498:
beq _08022582
movs r3, 0
movs r5, 0
- ldr r0, _08022548 @ =gUnknown_2023BCC
+ ldr r0, _08022548 @ =gBattlersCount
ldrb r1, [r0]
mov r12, r0
ldr r7, _0802254C @ =gUnknown_2023D74
@@ -9650,7 +9650,7 @@ _08022538: .4byte gPlayerParty
_0802253C: .4byte gUnknown_2023E8A
_08022540: .4byte gEnemyParty
_08022544: .4byte gBattleTypeFlags
-_08022548: .4byte gUnknown_2023BCC
+_08022548: .4byte gBattlersCount
_0802254C: .4byte gUnknown_2023D74
_08022550: .4byte gUnknown_2023DD0
_08022554: .4byte gUnknown_2023ECC
@@ -10859,7 +10859,7 @@ atk43_jumpifabilitypresent: @ 8022DCC
movs r0, 0x13
movs r1, 0
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
beq _08022E08
@@ -11226,13 +11226,13 @@ _0802309C:
ldr r6, _08023120 @ =gActiveBattler
ldrb r0, [r6]
str r3, [sp]
- bl GetBankIdentity
+ bl GetBattlerPosition
mov r1, r10
ands r1, r0
lsls r0, r1, 1
adds r0, r1
lsls r0, 2
- ldr r1, _08023124 @ =gUnknown_2023DE4
+ ldr r1, _08023124 @ =gSideTimers
adds r0, r1
ldrb r0, [r0, 0x4]
ldr r3, [sp]
@@ -11295,7 +11295,7 @@ _08023104:
b _08023190
.align 2, 0
_08023120: .4byte gActiveBattler
-_08023124: .4byte gUnknown_2023DE4
+_08023124: .4byte gSideTimers
_08023128: .4byte gBattleMons
_0802312C: .4byte gUnknown_2023D74
_08023130:
@@ -11454,7 +11454,7 @@ _08023232:
ldrh r0, [r1, 0x2E]
cmp r0, 0xAF
bne _08023278
- ldr r1, _08023274 @ =gUnknown_2023F54
+ ldr r1, _08023274 @ =gEnigmaBerries
lsls r0, r2, 3
subs r0, r2
lsls r0, 2
@@ -11467,7 +11467,7 @@ _08023264: .4byte 0x0000ffff
_08023268: .4byte gUnknown_2023D74
_0802326C: .4byte gBattleMons
_08023270: .4byte sBattler_AI
-_08023274: .4byte gUnknown_2023F54
+_08023274: .4byte gEnigmaBerries
_08023278:
ldrh r0, [r1, 0x2E]
bl ItemId_GetHoldEffect
@@ -11639,10 +11639,10 @@ _080233EE:
b _080237C8
_080233F8:
adds r0, r1, 0
- bl GetBankSide
+ bl GetBattlerSide
adds r4, r0, 0
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r4, 24
lsls r0, 24
cmp r4, r0
@@ -11813,7 +11813,7 @@ _0802355C:
movs r0, 0x7
movs r2, 0
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
bne _08023576
@@ -11832,7 +11832,7 @@ _08023580:
movs r0, 0x4
movs r2, 0
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
b _080236F6
.align 2, 0
_08023594: .4byte gBattlerTarget
@@ -11843,7 +11843,7 @@ _08023598:
movs r1, 0
movs r2, 0
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
bne _080235B0
@@ -11864,7 +11864,7 @@ _080235C0:
movs r0, 0x8
movs r2, 0
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
bne _080235DA
@@ -11963,7 +11963,7 @@ _08023684: .4byte gBattleMons
_08023688: .4byte sBattler_AI
_0802368C:
movs r4, 0
- ldr r0, _080236C0 @ =gUnknown_2023BCC
+ ldr r0, _080236C0 @ =gBattlersCount
ldrb r3, [r0]
cmp r4, r3
blt _08023698
@@ -11991,7 +11991,7 @@ _080236B0:
blt _080236A2
b _08023846
.align 2, 0
-_080236C0: .4byte gUnknown_2023BCC
+_080236C0: .4byte gBattlersCount
_080236C4: .4byte gBattleStruct
_080236C8: .4byte gBattleMons
_080236CC:
@@ -12135,7 +12135,7 @@ _080237D8:
lsls r0, 29
cmp r0, 0
blt _08023846
- ldr r0, _08023810 @ =gUnknown_2023BCC
+ ldr r0, _08023810 @ =gBattlersCount
ldrb r0, [r0]
cmp r2, r0
bcs _08023846
@@ -12152,12 +12152,12 @@ _08023806:
.align 2, 0
_08023808: .4byte gUnknown_2023ECC
_0802380C: .4byte gBattlerTarget
-_08023810: .4byte gUnknown_2023BCC
+_08023810: .4byte gBattlersCount
_08023814: .4byte gStatuses3
_08023818: .4byte 0x000400c0
_0802381C:
movs r4, 0
- ldr r0, _08023850 @ =gUnknown_2023BCC
+ ldr r0, _08023850 @ =gBattlersCount
ldrb r2, [r0]
cmp r4, r2
bge _08023846
@@ -12186,7 +12186,7 @@ _08023846:
strb r0, [r1, 0x14]
b _08023BB4
.align 2, 0
-_08023850: .4byte gUnknown_2023BCC
+_08023850: .4byte gBattlersCount
_08023854: .4byte gDisableStructs
_08023858: .4byte 0xfeffffff
_0802385C: .4byte gUnknown_2023C34
@@ -12571,12 +12571,12 @@ _08023B28:
bne _08023BAC
ldr r7, _08023C28 @ =gBattlerTarget
ldrb r0, [r7]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x2
eors r0, r1
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r2, r0, 24
ldr r1, _08023C2C @ =gBattleMons
@@ -12692,7 +12692,7 @@ atk4A_typecalc2: @ 8023C38
mov r1, r8
cmp r1, 0x4
bne _08023CCC
- ldr r3, _08023CAC @ =gUnknown_2023D6A
+ ldr r3, _08023CAC @ =gLastUsedAbility
strb r0, [r3]
ldr r2, _08023CB0 @ =gMoveResultFlags
ldrb r0, [r2]
@@ -12716,7 +12716,7 @@ _08023C9C: .4byte gBattleMoves
_08023CA0: .4byte gCurrentMove
_08023CA4: .4byte gBattleMons
_08023CA8: .4byte gBattlerTarget
-_08023CAC: .4byte gUnknown_2023D6A
+_08023CAC: .4byte gLastUsedAbility
_08023CB0: .4byte gMoveResultFlags
_08023CB4: .4byte gUnknown_2023DA0
_08023CB8: .4byte gUnknown_2023E82
@@ -12892,7 +12892,7 @@ _08023DF0:
ldrb r0, [r0, 0x1]
cmp r0, 0
beq _08023E2A
- ldr r3, _08023E70 @ =gUnknown_2023D6A
+ ldr r3, _08023E70 @ =gLastUsedAbility
strb r6, [r3]
ldr r2, _08023E74 @ =gMoveResultFlags
ldrb r0, [r2]
@@ -12943,7 +12943,7 @@ _08023E60: .4byte gBattlerTarget
_08023E64: .4byte sBattler_AI
_08023E68: .4byte gCurrentMove
_08023E6C: .4byte gBattleMoves
-_08023E70: .4byte gUnknown_2023D6A
+_08023E70: .4byte gLastUsedAbility
_08023E74: .4byte gMoveResultFlags
_08023E78: .4byte gUnknown_2023DA0
_08023E7C: .4byte gUnknown_2023E82
@@ -13023,7 +13023,7 @@ atk4C_getswitchedmondata: @ 8023ED8
ldrb r2, [r0]
movs r0, 0
movs r1, 0
- bl EmitGetMonData
+ bl BtlController_EmitGetMonData
ldrb r0, [r4]
bl MarkBufferBankForExecution
ldr r0, [r5]
@@ -13126,7 +13126,7 @@ _08023F84:
adds r1, 0x20
strb r0, [r1]
ldrb r0, [r7]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r2, r0, 24
ldr r0, _080240B8 @ =gUnknown_2023F20
@@ -13194,7 +13194,7 @@ _08024068:
ldr r3, _080240A8 @ =gActiveBattler
ldrb r2, [r3]
strb r2, [r0, 0x17]
- ldr r1, _080240D0 @ =gUnknown_2022AB8
+ ldr r1, _080240D0 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x7
@@ -13230,7 +13230,7 @@ _080240C0: .4byte gBattlerPartyIndexes
_080240C4: .4byte gBattleMoves
_080240C8: .4byte gCurrentMove
_080240CC: .4byte gBattleScripting
-_080240D0: .4byte gUnknown_2022AB8
+_080240D0: .4byte gBattleTextBuff1
thumb_func_end sub_8023F48
thumb_func_start sub_80240D4
@@ -13247,7 +13247,7 @@ sub_80240D4: @ 80240D4
ldr r6, _08024170 @ =gActiveBattler
strb r0, [r6]
ldrb r0, [r6]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -13383,7 +13383,7 @@ _08024204:
beq _080242A4
ldr r4, _08024294 @ =gActiveBattler
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
ldr r1, _08024298 @ =gPlayerParty
@@ -13453,13 +13453,13 @@ _080242A0: .4byte gBattlerPartyIndexes
_080242A4:
ldr r0, _080242D4 @ =gActiveBattler
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0x1
bne _080242E4
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r7, r0, 24
ldr r0, [r5]
@@ -13467,7 +13467,7 @@ _080242A4:
cmp r0, 0
beq _080242D8
movs r0, 0x3
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r6, r0, 24
b _080242DA
@@ -13483,7 +13483,7 @@ _080242DA:
_080242E0: .4byte gEnemyParty
_080242E4:
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r7, r0, 24
ldr r0, [r5]
@@ -13492,7 +13492,7 @@ _080242E4:
cmp r0, 0
beq _08024304
movs r0, 0x2
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r6, r0, 24
b _08024306
@@ -13654,7 +13654,7 @@ _08024422:
beq _08024510
ldr r1, _080244A0 @ =gActiveBattler
strb r7, [r1]
- ldr r0, _080244A4 @ =gUnknown_2023BCC
+ ldr r0, _080244A4 @ =gBattlersCount
ldrb r0, [r0]
cmp r7, r0
bcc _0802443C
@@ -13708,7 +13708,7 @@ _08024446:
_08024498: .4byte gUnknown_2023D74
_0802449C: .4byte gBattleTypeFlags
_080244A0: .4byte gActiveBattler
-_080244A4: .4byte gUnknown_2023BCC
+_080244A4: .4byte gBattlersCount
_080244A8: .4byte gUnknown_2023DD0
_080244AC: .4byte gBitTable
_080244B0: .4byte gAbsentBattlerFlags
@@ -13747,7 +13747,7 @@ _080244F6:
ldrb r0, [r4]
adds r0, 0x1
strb r0, [r4]
- ldr r1, _0802450C @ =gUnknown_2023BCC
+ ldr r1, _0802450C @ =gBattlersCount
lsls r0, 24
lsrs r0, 24
ldrb r1, [r1]
@@ -13755,7 +13755,7 @@ _080244F6:
bcc _08024446
b _080248A6
.align 2, 0
-_0802450C: .4byte gUnknown_2023BCC
+_0802450C: .4byte gBattlersCount
_08024510:
ands r0, r1
cmp r0, 0
@@ -14387,7 +14387,7 @@ _08024A4C:
ldr r4, _08024AA4 @ =gBitTable
ldr r2, [r4]
ands r2, r5
- ldr r6, _08024AA8 @ =gUnknown_2023BCC
+ ldr r6, _08024AA8 @ =gBattlersCount
cmp r2, 0
bne _08024A88
adds r7, r6, 0
@@ -14424,7 +14424,7 @@ _08024A92:
_08024A9C: .4byte gUnknown_2023DD0
_08024AA0: .4byte gUnknown_2023D6D
_08024AA4: .4byte gBitTable
-_08024AA8: .4byte gUnknown_2023BCC
+_08024AA8: .4byte gBattlersCount
_08024AAC:
movs r0, 0x80
ands r0, r1
@@ -14525,7 +14525,7 @@ _08024B34:
adds r0, 0x6
str r0, [r6]
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
cmp r0, 0
bne _08024B94
@@ -14545,7 +14545,7 @@ _08024B94:
ldr r1, _08024BD8 @ =gActiveBattler
movs r0, 0
strb r0, [r1]
- ldr r0, _08024BEC @ =gUnknown_2023BCC
+ ldr r0, _08024BEC @ =gBattlersCount
ldrb r0, [r0]
cmp r0, 0
beq _08024C2E
@@ -14563,7 +14563,7 @@ _08024BC4:
ldrb r0, [r4]
adds r0, 0x1
strb r0, [r4]
- ldr r1, _08024BEC @ =gUnknown_2023BCC
+ ldr r1, _08024BEC @ =gBattlersCount
lsls r0, 24
lsrs r0, 24
ldrb r1, [r1]
@@ -14576,15 +14576,15 @@ _08024BDC: .4byte gBattleStruct
_08024BE0: .4byte gBattlerPartyIndexes
_08024BE4: .4byte gBattleResults
_08024BE8: .4byte gBattleTypeFlags
-_08024BEC: .4byte gUnknown_2023BCC
+_08024BEC: .4byte gBattlersCount
_08024BF0:
adds r0, r7, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x1
eors r0, r1
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r4, _08024C3C @ =gActiveBattler
strb r0, [r4]
ldr r0, _08024C40 @ =gAbsentBattlerFlags
@@ -14654,7 +14654,7 @@ _08024C80:
b _08024E0E
_08024C86:
movs r3, 0
- ldr r0, _08024CB8 @ =gUnknown_2023BCC
+ ldr r0, _08024CB8 @ =gBattlersCount
ldrb r1, [r0]
cmp r3, r1
blt _08024C92
@@ -14682,7 +14682,7 @@ _08024CAC:
blt _08024C9C
b _08024E0E
.align 2, 0
-_08024CB8: .4byte gUnknown_2023BCC
+_08024CB8: .4byte gBattlersCount
_08024CBC: .4byte gBattleStruct
_08024CC0: .4byte gUnknown_20233C4
_08024CC4:
@@ -14811,7 +14811,7 @@ _08024DBC:
ldrb r0, [r7]
bl sub_8013F6C
_08024DC2:
- ldr r1, _08024E1C @ =gUnknown_2022AB8
+ ldr r1, _08024E1C @ =gBattleTextBuff1
movs r5, 0xFD
strb r5, [r1]
movs r0, 0x6
@@ -14832,7 +14832,7 @@ _08024DC2:
strb r0, [r1, 0x3]
movs r0, 0xFF
strb r0, [r1, 0x4]
- ldr r2, _08024E28 @ =gUnknown_2022AC8
+ ldr r2, _08024E28 @ =gBattleTextBuff2
strb r5, [r2]
movs r0, 0x7
strb r0, [r2, 0x1]
@@ -14859,10 +14859,10 @@ _08024E16:
pop {r0}
bx r0
.align 2, 0
-_08024E1C: .4byte gUnknown_2022AB8
+_08024E1C: .4byte gBattleTextBuff1
_08024E20: .4byte gBattleMons
_08024E24: .4byte sBattler_AI
-_08024E28: .4byte gUnknown_2022AC8
+_08024E28: .4byte gBattleTextBuff2
_08024E2C: .4byte gActiveBattler
_08024E30: .4byte gUnknown_20233C4
_08024E34: .4byte gUnknown_2023D74
@@ -14905,7 +14905,7 @@ sub_8024E38: @ 8024E38
ands r0, r2
strb r0, [r1]
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
ldr r5, _08024F54 @ =gSideAffecting
lsls r0, 24
lsrs r0, 23
@@ -14918,7 +14918,7 @@ sub_8024E38: @ 8024E38
cmp r0, 0
bne _08024F88
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 23
adds r0, r5
@@ -14950,7 +14950,7 @@ sub_8024E38: @ 8024E38
cmp r0, 0x1A
beq _08024F88
adds r0, r2, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 23
adds r0, r5
@@ -14959,8 +14959,8 @@ sub_8024E38: @ 8024E38
orrs r1, r2
strh r1, [r0]
ldrb r0, [r4]
- bl GetBankSide
- ldr r2, _08024F5C @ =gUnknown_2023DE4
+ bl GetBattlerSide
+ ldr r2, _08024F5C @ =gSideTimers
lsls r0, 24
lsrs r0, 24
lsls r1, r0, 1
@@ -15003,7 +15003,7 @@ _08024F4C: .4byte gBitTable
_08024F50: .4byte gUnknown_2023ECC
_08024F54: .4byte gSideAffecting
_08024F58: .4byte gBattleMons
-_08024F5C: .4byte gUnknown_2023DE4
+_08024F5C: .4byte gSideTimers
_08024F60: .4byte gBattleMoveDamage
_08024F64: .4byte gBattleScripting
_08024F68: .4byte gUnknown_81D8CBE
@@ -15047,7 +15047,7 @@ _08024FAE:
str r0, [sp]
movs r2, 0
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
beq _08024FC4
@@ -15061,7 +15061,7 @@ _08024FC4:
cmp r0, 0
bne _080250C6
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
ldr r1, _08025070 @ =gSideAffecting
lsls r0, 24
lsrs r0, 23
@@ -15071,7 +15071,7 @@ _08024FC4:
ands r1, r2
strh r1, [r0]
movs r4, 0
- ldr r0, _08025078 @ =gUnknown_2023BCC
+ ldr r0, _08025078 @ =gBattlersCount
ldrb r3, [r0]
cmp r4, r3
bge _08025012
@@ -15094,7 +15094,7 @@ _0802500A:
blt _08024FFC
_08025012:
movs r4, 0
- ldr r0, _08025078 @ =gUnknown_2023BCC
+ ldr r0, _08025078 @ =gBattlersCount
ldrb r0, [r0]
cmp r4, r0
bge _08025046
@@ -15103,7 +15103,7 @@ _08025012:
_08025020:
lsls r0, r4, 24
lsrs r0, 24
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 23
adds r0, 0xA8
@@ -15115,7 +15115,7 @@ _08025020:
ldrh r0, [r0, 0x28]
strh r0, [r1]
adds r4, 0x1
- ldr r0, _08025078 @ =gUnknown_2023BCC
+ ldr r0, _08025078 @ =gBattlersCount
ldrb r0, [r0]
cmp r4, r0
blt _08025020
@@ -15141,7 +15141,7 @@ _08025068: .4byte gActiveBattler
_0802506C: .4byte gDisableStructs
_08025070: .4byte gSideAffecting
_08025074: .4byte 0x0000fdff
-_08025078: .4byte gUnknown_2023BCC
+_08025078: .4byte gBattlersCount
_0802507C: .4byte gUnknown_2023BDE
_08025080: .4byte gUnknown_2023BDA
_08025084: .4byte gBattleStruct
@@ -15150,7 +15150,7 @@ _0802508C: .4byte gUnknown_2023DD0
_08025090: .4byte gUnknown_2023D6D
_08025094: .4byte gBitTable
_08025098:
- ldr r0, _080250D4 @ =gUnknown_2023BCC
+ ldr r0, _080250D4 @ =gBattlersCount
ldrb r3, [r1]
ldrb r0, [r0]
cmp r3, r0
@@ -15184,7 +15184,7 @@ _080250C6:
pop {r0}
bx r0
.align 2, 0
-_080250D4: .4byte gUnknown_2023BCC
+_080250D4: .4byte gBattlersCount
_080250D8: .4byte gAbsentBattlerFlags
thumb_func_end sub_8024E38
@@ -15203,7 +15203,7 @@ _080250EC: .4byte gUnknown_2023D74
_080250F0:
movs r0, 0x1
_080250F2:
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _08025114 @ =gActiveBattler
strb r0, [r1]
movs r0, 0
@@ -15308,7 +15308,7 @@ _080251C0: .4byte gActiveBattler
atk57: @ 80251C4
push {r4,lr}
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r4, _080251F0 @ =gActiveBattler
strb r0, [r4]
ldr r0, _080251F4 @ =gUnknown_2023E8A
@@ -15434,7 +15434,7 @@ _080252C4: .4byte 0x0000ffff
_080252C8: .4byte gUnknown_2023D74
_080252CC:
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _08025364 @ =gActiveBattler
strb r0, [r1]
ldr r2, _08025368 @ =gBattlerPartyIndexes
@@ -15471,7 +15471,7 @@ _0802530C:
cmp r0, 0
beq _08025358
movs r0, 0x2
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _08025364 @ =gActiveBattler
strb r0, [r1]
ldr r2, _08025368 @ =gBattlerPartyIndexes
@@ -15667,13 +15667,13 @@ _080254B6:
ldr r1, _080254EC @ =gBattleStruct
ldr r1, [r1]
ldrb r1, [r1, 0x10]
- ldr r2, _080254F0 @ =gUnknown_2024029
+ ldr r2, _080254F0 @ =gPlayerPartyCount
ldrb r2, [r2]
subs r2, 0x1
lsls r2, 24
lsrs r2, 24
ldr r3, _080254F4 @ =sub_8077764
- ldr r4, _080254F8 @ =gUnknown_2024022
+ ldr r4, _080254F8 @ =gMoveToLearn
ldrh r4, [r4]
str r4, [sp]
bl sub_8134738
@@ -15687,9 +15687,9 @@ _080254D8:
_080254E4: .4byte gUnknown_2037AB8
_080254E8: .4byte gPlayerParty
_080254EC: .4byte gBattleStruct
-_080254F0: .4byte gUnknown_2024029
+_080254F0: .4byte gPlayerPartyCount
_080254F4: .4byte sub_8077764
-_080254F8: .4byte gUnknown_2024022
+_080254F8: .4byte gMoveToLearn
_080254FC: .4byte gBattleScripting
_08025500:
ldr r0, _0802552C @ =gUnknown_2037AB8
@@ -15768,7 +15768,7 @@ _0802558C:
lsls r0, 24
orrs r1, r0
str r1, [r3]
- ldr r1, _08025684 @ =gUnknown_2022AC8
+ ldr r1, _08025684 @ =gBattleTextBuff2
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x2
@@ -15792,7 +15792,7 @@ _0802558C:
muls r1, r0
adds r0, r1, 0
adds r0, r7
- ldr r7, _08025688 @ =gUnknown_2024022
+ ldr r7, _08025688 @ =gMoveToLearn
ldrh r1, [r7]
adds r2, r5, 0
bl SetMonMoveSlot
@@ -15865,7 +15865,7 @@ _08025622:
adds r0, r4, 0
adds r1, r5, 0
bl RemoveBattleMonPPBonus
- ldr r0, _08025688 @ =gUnknown_2024022
+ ldr r0, _08025688 @ =gMoveToLearn
ldrh r1, [r0]
adds r0, r4, 0
adds r2, r5, 0
@@ -15873,8 +15873,8 @@ _08025622:
b _080256D0
.align 2, 0
_08025680: .4byte gUnknown_2023D74
-_08025684: .4byte gUnknown_2022AC8
-_08025688: .4byte gUnknown_2024022
+_08025684: .4byte gBattleTextBuff2
+_08025688: .4byte gMoveToLearn
_0802568C: .4byte gBattlerPartyIndexes
_08025690: .4byte gBattleMons
_08025694: .4byte gDisableStructs
@@ -16308,7 +16308,7 @@ _080259FA:
bl sub_8054C04
adds r4, r0, 0
_08025A00:
- ldr r1, _08025A40 @ =gUnknown_2022AB8
+ ldr r1, _08025A40 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x1
@@ -16340,7 +16340,7 @@ _08025A00:
str r0, [r1]
b _08025A62
.align 2, 0
-_08025A40: .4byte gUnknown_2022AB8
+_08025A40: .4byte gBattleTextBuff1
_08025A44: .4byte gUnknown_2023D74
_08025A48:
ldr r3, _08025A6C @ =gUnknown_2023D74
@@ -16393,7 +16393,7 @@ _08025AA0:
movs r0, 0
movs r1, 0
movs r2, 0
- bl EmitGetMonData
+ bl BtlController_EmitGetMonData
ldrb r0, [r6]
bl MarkBufferBankForExecution
ldrb r0, [r5]
@@ -16503,7 +16503,7 @@ atk60_incrementgamestat: @ 8025B74
push {lr}
ldr r0, _08025B9C @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08025B8E
@@ -16540,7 +16540,7 @@ atk61_drawpartystatussummary: @ 8025BA4
ldr r1, _08025C10 @ =gActiveBattler
strb r0, [r1]
ldrb r0, [r1]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
ldr r1, _08025C14 @ =gEnemyParty
mov r8, r1
@@ -17020,7 +17020,7 @@ _08025FA4: .4byte gUnknown_2023D74
atk68_cancelallactions: @ 8025FA8
push {r4,r5,lr}
movs r1, 0
- ldr r2, _08025FD4 @ =gUnknown_2023BCC
+ ldr r2, _08025FD4 @ =gBattlersCount
ldr r5, _08025FD8 @ =gUnknown_2023D74
ldrb r0, [r2]
cmp r1, r0
@@ -17042,7 +17042,7 @@ _08025FC6:
pop {r0}
bx r0
.align 2, 0
-_08025FD4: .4byte gUnknown_2023BCC
+_08025FD4: .4byte gBattlersCount
_08025FD8: .4byte gUnknown_2023D74
_08025FDC: .4byte gUnknown_2023BDA
thumb_func_end atk68_cancelallactions
@@ -17060,7 +17060,7 @@ atk69_adjustsetdamage: @ 8025FE0
ldrh r0, [r1, 0x2E]
cmp r0, 0xAF
bne _08026014
- ldr r1, _08026010 @ =gUnknown_2023F54
+ ldr r1, _08026010 @ =gEnigmaBerries
lsls r0, r2, 3
subs r0, r2
lsls r0, 2
@@ -17071,7 +17071,7 @@ atk69_adjustsetdamage: @ 8025FE0
.align 2, 0
_08026008: .4byte gBattleMons
_0802600C: .4byte gBattlerTarget
-_08026010: .4byte gUnknown_2023F54
+_08026010: .4byte gEnigmaBerries
_08026014:
ldrh r0, [r1, 0x2E]
bl ItemId_GetHoldEffect
@@ -17085,7 +17085,7 @@ _08026014:
lsls r0, 24
lsrs r6, r0, 24
_0802602E:
- ldr r1, _080260F0 @ =gUnknown_2023D6F
+ ldr r1, _080260F0 @ =gPotentialItemEffectBattler
ldr r5, _080260F4 @ =gBattlerTarget
ldrb r0, [r5]
strb r0, [r1]
@@ -17182,7 +17182,7 @@ _080260BE:
strb r1, [r0]
b _0802613C
.align 2, 0
-_080260F0: .4byte gUnknown_2023D6F
+_080260F0: .4byte gPotentialItemEffectBattler
_080260F4: .4byte gBattlerTarget
_080260F8: .4byte gUnknown_2023ECC
_080260FC: .4byte gBattleMons
@@ -17283,7 +17283,7 @@ _080261C8: .4byte gBattleMons
thumb_func_start atk6B_atknameinbuff1
atk6B_atknameinbuff1: @ 80261CC
- ldr r1, _080261F8 @ =gUnknown_2022AB8
+ ldr r1, _080261F8 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x7
@@ -17305,7 +17305,7 @@ atk6B_atknameinbuff1: @ 80261CC
str r0, [r1]
bx lr
.align 2, 0
-_080261F8: .4byte gUnknown_2022AB8
+_080261F8: .4byte gBattleTextBuff1
_080261FC: .4byte sBattler_AI
_08026200: .4byte gBattlerPartyIndexes
_08026204: .4byte gUnknown_2023D74
@@ -18039,7 +18039,7 @@ _080267EC: .4byte gUnknown_2023D74
atk6E_setatktoplayer0: @ 80267F0
push {lr}
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _08026808 @ =sBattler_AI
strb r0, [r1]
ldr r1, _0802680C @ =gUnknown_2023D74
@@ -18088,7 +18088,7 @@ atk70_recordlastability: @ 8026844
ldr r1, _08026870 @ =gActiveBattler
strb r0, [r1]
ldrb r0, [r1]
- ldr r1, _08026874 @ =gUnknown_2023D6A
+ ldr r1, _08026874 @ =gLastUsedAbility
ldrb r1, [r1]
bl sub_80C71D0
ldr r0, [r4]
@@ -18100,17 +18100,17 @@ atk70_recordlastability: @ 8026844
.align 2, 0
_0802686C: .4byte gUnknown_2023D74
_08026870: .4byte gActiveBattler
-_08026874: .4byte gUnknown_2023D6A
+_08026874: .4byte gLastUsedAbility
thumb_func_end atk70_recordlastability
thumb_func_start BufferMoveToLearnIntoBattleTextBuff2
BufferMoveToLearnIntoBattleTextBuff2: @ 8026878
- ldr r2, _08026898 @ =gUnknown_2022AC8
+ ldr r2, _08026898 @ =gBattleTextBuff2
movs r0, 0xFD
strb r0, [r2]
movs r0, 0x2
strb r0, [r2, 0x1]
- ldr r0, _0802689C @ =gUnknown_2024022
+ ldr r0, _0802689C @ =gMoveToLearn
ldrh r1, [r0]
strb r1, [r2, 0x2]
movs r0, 0xFF
@@ -18122,8 +18122,8 @@ BufferMoveToLearnIntoBattleTextBuff2: @ 8026878
strb r0, [r2, 0x4]
bx lr
.align 2, 0
-_08026898: .4byte gUnknown_2022AC8
-_0802689C: .4byte gUnknown_2024022
+_08026898: .4byte gBattleTextBuff2
+_0802689C: .4byte gMoveToLearn
thumb_func_end BufferMoveToLearnIntoBattleTextBuff2
thumb_func_start atk71_buffermovetolearn
@@ -18290,7 +18290,7 @@ atk74_hpthresholds2: @ 80269A8
lsls r4, 24
lsrs r4, 24
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
ldr r1, _08026A18 @ =gBattleStruct
ldr r6, [r1]
@@ -18360,7 +18360,7 @@ _08026A54: .4byte gUnknown_2023D74
atk75_useitemonopponent: @ 8026A58
push {lr}
sub sp, 0x4
- ldr r2, _08026A98 @ =gUnknown_2024004
+ ldr r2, _08026A98 @ =gBattlerInMenuId
ldr r1, _08026A9C @ =sBattler_AI
ldrb r0, [r1]
strb r0, [r2]
@@ -18380,7 +18380,7 @@ atk75_useitemonopponent: @ 8026A58
movs r3, 0x1
str r3, [sp]
movs r3, 0
- bl sub_80413E4
+ bl PokemonUseItemEffects
ldr r1, _08026AAC @ =gUnknown_2023D74
ldr r0, [r1]
adds r0, 0x1
@@ -18389,7 +18389,7 @@ atk75_useitemonopponent: @ 8026A58
pop {r0}
bx r0
.align 2, 0
-_08026A98: .4byte gUnknown_2024004
+_08026A98: .4byte gBattlerInMenuId
_08026A9C: .4byte sBattler_AI
_08026AA0: .4byte gBattlerPartyIndexes
_08026AA4: .4byte gEnemyParty
@@ -18453,12 +18453,12 @@ _08026B2C:
ldrb r0, [r4]
strb r0, [r1]
ldrb r0, [r1]
- bl GetBankSide
+ bl GetBattlerSide
movs r1, 0x1
eors r0, r1
lsls r0, 24
lsrs r0, 24
- ldr r2, _08026B70 @ =gUnknown_2023DE4
+ ldr r2, _08026B70 @ =gSideTimers
lsls r1, r0, 1
adds r1, r0
lsls r1, 2
@@ -18479,7 +18479,7 @@ _08026B2C:
.align 2, 0
_08026B68: .4byte sBattler_AI
_08026B6C: .4byte gBattlerTarget
-_08026B70: .4byte gUnknown_2023DE4
+_08026B70: .4byte gSideTimers
_08026B74: .4byte gBattleMons
_08026B78:
ldr r0, _08026B84 @ =gBattlerTarget
@@ -18677,7 +18677,7 @@ _08026CF4:
movs r0, 0x1
strb r0, [r1]
mov r8, r1
- ldr r0, _08026D44 @ =gUnknown_2023BCC
+ ldr r0, _08026D44 @ =gBattlersCount
mov r4, r8
ldrb r5, [r0]
ldr r6, _08026D48 @ =gBattleMons
@@ -18711,7 +18711,7 @@ _08026D2A:
.align 2, 0
_08026D3C: .4byte gUnknown_2023E82
_08026D40: .4byte gActiveBattler
-_08026D44: .4byte gUnknown_2023BCC
+_08026D44: .4byte gBattlersCount
_08026D48: .4byte gBattleMons
_08026D4C: .4byte gBitTable
_08026D50:
@@ -18725,7 +18725,7 @@ _08026D50:
_08026D5C: .4byte gActiveBattler
_08026D60: .4byte gBattleMons
_08026D64:
- ldr r0, _08026D94 @ =gUnknown_2023BCC
+ ldr r0, _08026D94 @ =gBattlersCount
ldrb r0, [r0]
cmp r0, 0x3
bhi _08026D6E
@@ -18751,7 +18751,7 @@ _08026D84:
bl MarkBufferBankForExecution
b _08026F4E
.align 2, 0
-_08026D94: .4byte gUnknown_2023BCC
+_08026D94: .4byte gBattlersCount
_08026D98: .4byte gActiveBattler
_08026D9C: .4byte gBattleMons
_08026DA0:
@@ -18760,7 +18760,7 @@ _08026DA0:
strb r1, [r0, 0x5]
mov r8, r1
movs r7, 0
- ldr r0, _08026F2C @ =gUnknown_2023BCC
+ ldr r0, _08026F2C @ =gBattlersCount
mov r12, r0
ldrb r2, [r0]
cmp r8, r2
@@ -18850,7 +18850,7 @@ _08026E4E:
cmp r0, 0
beq _08026E88
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r4, _08026F3C @ =gActiveBattler
strb r0, [r4]
movs r0, 0
@@ -18925,7 +18925,7 @@ _08026EEC:
cmp r2, 0
beq _08026F4E
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r4, _08026F3C @ =gActiveBattler
strb r0, [r4]
movs r0, 0
@@ -18947,7 +18947,7 @@ _08026EEC:
b _08026F4E
.align 2, 0
_08026F28: .4byte gUnknown_2023E82
-_08026F2C: .4byte gUnknown_2023BCC
+_08026F2C: .4byte gBattlersCount
_08026F30: .4byte gBattleMons
_08026F34: .4byte 0xf7ffffff
_08026F38: .4byte gPlayerParty
@@ -19004,7 +19004,7 @@ atk77_setprotectlike: @ 8026F68
_08026F98:
ldr r0, _08027040 @ =gUnknown_2023BE2
ldrb r1, [r0]
- ldr r0, _08027044 @ =gUnknown_2023BCC
+ ldr r0, _08027044 @ =gBattlersCount
ldrb r0, [r0]
subs r0, 0x1
cmp r1, r0
@@ -19086,7 +19086,7 @@ _08027034: .4byte gUnknown_2023DB0
_08027038: .4byte sBattler_AI
_0802703C: .4byte gDisableStructs
_08027040: .4byte gUnknown_2023BE2
-_08027044: .4byte gUnknown_2023BCC
+_08027044: .4byte gBattlersCount
_08027048: .4byte gUnknown_82507E0
_0802704C: .4byte gBattleMoves
_08027050: .4byte gCurrentMove
@@ -19139,7 +19139,7 @@ atk78_faintifabilitynotdamp: @ 80270A4
bne _080271A8
ldr r1, _08027164 @ =gBattlerTarget
strb r2, [r1]
- ldr r0, _08027168 @ =gUnknown_2023BCC
+ ldr r0, _08027168 @ =gBattlersCount
ldrb r3, [r0]
adds r5, r1, 0
mov r8, r0
@@ -19229,7 +19229,7 @@ _08027152:
.align 2, 0
_08027160: .4byte gUnknown_2023BC8
_08027164: .4byte gBattlerTarget
-_08027168: .4byte gUnknown_2023BCC
+_08027168: .4byte gBattlersCount
_0802716C: .4byte gBattleMons
_08027170: .4byte gActiveBattler
_08027174: .4byte sBattler_AI
@@ -19239,7 +19239,7 @@ _08027180: .4byte gUnknown_2023D74
_08027184: .4byte gBitTable
_08027188: .4byte gAbsentBattlerFlags
_0802718C:
- ldr r1, _080271B4 @ =gUnknown_2023D6A
+ ldr r1, _080271B4 @ =gLastUsedAbility
movs r0, 0x6
strb r0, [r1]
ldrb r0, [r5]
@@ -19259,7 +19259,7 @@ _080271A8:
pop {r0}
bx r0
.align 2, 0
-_080271B4: .4byte gUnknown_2023D6A
+_080271B4: .4byte gLastUsedAbility
_080271B8: .4byte gUnknown_2023D74
_080271BC: .4byte gUnknown_81D93AF
thumb_func_end atk78_faintifabilitynotdamp
@@ -19343,7 +19343,7 @@ atk7A_jumpifnexttargetvalid: @ 8027220
adds r3, r0, 0
ldr r6, _080272A8 @ =gAbsentBattlerFlags
ldr r5, _080272AC @ =gBitTable
- ldr r0, _080272B0 @ =gUnknown_2023BCC
+ ldr r0, _080272B0 @ =gBattlersCount
mov r12, r0
ldrb r0, [r2]
cmp r1, r0
@@ -19382,7 +19382,7 @@ _080272A0: .4byte gBattlerTarget
_080272A4: .4byte sBattler_AI
_080272A8: .4byte gAbsentBattlerFlags
_080272AC: .4byte gBitTable
-_080272B0: .4byte gUnknown_2023BCC
+_080272B0: .4byte gBattlersCount
_080272B4:
str r4, [r7]
b _080272BC
@@ -19468,7 +19468,7 @@ atk7C_trymirrormove: @ 8027340
mov r5, r8
push {r5-r7}
sub sp, 0x8
- ldr r2, _080273E0 @ =gUnknown_2023BCC
+ ldr r2, _080273E0 @ =gBattlersCount
ldr r0, _080273E4 @ =gBattleStruct
mov r10, r0
movs r1, 0
@@ -19547,7 +19547,7 @@ _080273AC:
strh r3, [r4]
b _08027426
.align 2, 0
-_080273E0: .4byte gUnknown_2023BCC
+_080273E0: .4byte gBattlersCount
_080273E4: .4byte gBattleStruct
_080273E8: .4byte sBattler_AI
_080273EC: .4byte 0x0000ffff
@@ -19682,7 +19682,7 @@ atk7E_setreflect: @ 80274FC
push {r4-r6,lr}
ldr r6, _0802752C @ =sBattler_AI
ldrb r0, [r6]
- bl GetBankIdentity
+ bl GetBattlerPosition
ldr r4, _08027530 @ =gSideAffecting
movs r5, 0x1
adds r1, r5, 0
@@ -19709,7 +19709,7 @@ _08027534: .4byte gMoveResultFlags
_08027538: .4byte gUnknown_2023E82
_0802753C:
ldrb r0, [r6]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r5, 0
ands r1, r0
lsls r1, 1
@@ -19719,8 +19719,8 @@ _0802753C:
orrs r0, r2
strh r0, [r1]
ldrb r0, [r6]
- bl GetBankIdentity
- ldr r4, _080275A0 @ =gUnknown_2023DE4
+ bl GetBattlerPosition
+ ldr r4, _080275A0 @ =gSideTimers
adds r1, r5, 0
ands r1, r0
lsls r0, r1, 1
@@ -19730,7 +19730,7 @@ _0802753C:
movs r1, 0x5
strb r1, [r0]
ldrb r0, [r6]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r5, 0
ands r1, r0
lsls r0, r1, 1
@@ -19745,7 +19745,7 @@ _0802753C:
cmp r0, 0
beq _080275AC
movs r0, 0x1
- bl sub_803F5B4
+ bl CountAliveMons
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0x2
@@ -19754,7 +19754,7 @@ _0802753C:
strb r1, [r0, 0x5]
b _080275B2
.align 2, 0
-_080275A0: .4byte gUnknown_2023DE4
+_080275A0: .4byte gSideTimers
_080275A4: .4byte gBattleTypeFlags
_080275A8: .4byte gUnknown_2023E82
_080275AC:
@@ -20108,7 +20108,7 @@ UproarWakeUpCheck: @ 8027830
lsls r0, 24
lsrs r3, r0, 24
movs r2, 0
- ldr r0, _08027888 @ =gUnknown_2023BCC
+ ldr r0, _08027888 @ =gBattlersCount
ldrb r1, [r0]
mov r8, r0
cmp r2, r1
@@ -20148,7 +20148,7 @@ _0802785C:
strb r0, [r7, 0x5]
b _080278A4
.align 2, 0
-_08027888: .4byte gUnknown_2023BCC
+_08027888: .4byte gBattlersCount
_0802788C: .4byte gBattleMons
_08027890: .4byte gBattleScripting
_08027894: .4byte gUnknown_2023E82
@@ -20224,7 +20224,7 @@ _08027900:
cmp r1, 0x48
bne _0802793C
_08027918:
- ldr r2, _08027934 @ =gUnknown_2023D6A
+ ldr r2, _08027934 @ =gLastUsedAbility
strb r0, [r2]
ldr r1, _08027938 @ =gUnknown_2023E82
movs r0, 0x2
@@ -20236,7 +20236,7 @@ _08027918:
b _08027942
.align 2, 0
_08027930: .4byte gBattleMons
-_08027934: .4byte gUnknown_2023D6A
+_08027934: .4byte gLastUsedAbility
_08027938: .4byte gUnknown_2023E82
_0802793C:
ldr r0, [r5]
@@ -20279,7 +20279,7 @@ _08027980:
adds r0, 0x1
movs r3, 0
strb r0, [r1, 0x9]
- ldr r2, _080279B8 @ =gUnknown_2022AB8
+ ldr r2, _080279B8 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r2]
movs r0, 0x1
@@ -20306,7 +20306,7 @@ _080279AA:
pop {r0}
bx r0
.align 2, 0
-_080279B8: .4byte gUnknown_2022AB8
+_080279B8: .4byte gBattleTextBuff1
_080279BC: .4byte gUnknown_2023E82
_080279C0: .4byte gUnknown_2023D74
thumb_func_end atk85_stockpile
@@ -20355,7 +20355,7 @@ _08027A08:
ldr r4, _08027AC0 @ =gSideAffecting
ldr r5, _08027AC4 @ =gBattlerTarget
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x1
ands r1, r0
lsls r1, 1
@@ -20378,7 +20378,7 @@ _08027A08:
str r4, [sp, 0x8]
ldrb r4, [r5]
str r4, [sp, 0xC]
- bl sub_803ECEC
+ bl CalculateBaseDamage
ldrb r2, [r6]
lsls r1, r2, 3
subs r1, r2
@@ -20646,7 +20646,7 @@ _08027C4E:
_08027C64:
movs r0, 0xDF
ands r5, r0
- ldr r1, _08027CDC @ =gUnknown_2022AB8
+ ldr r1, _08027CDC @ =gBattleTextBuff1
movs r4, 0
movs r2, 0xFD
strb r2, [r1]
@@ -20663,10 +20663,10 @@ _08027C64:
blt _08027C88
b _08027F6C
_08027C88:
- ldr r4, _08027CE0 @ =gUnknown_2023DE4
+ ldr r4, _08027CE0 @ =gSideTimers
ldr r1, _08027CD4 @ =gActiveBattler
ldrb r0, [r1]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x1
ands r1, r0
lsls r0, r1, 1
@@ -20703,8 +20703,8 @@ _08027C88:
.align 2, 0
_08027CD4: .4byte gActiveBattler
_08027CD8: .4byte gBattlerTarget
-_08027CDC: .4byte gUnknown_2022AB8
-_08027CE0: .4byte gUnknown_2023DE4
+_08027CDC: .4byte gBattleTextBuff1
+_08027CE0: .4byte gSideTimers
_08027CE4: .4byte gCurrentMove
_08027CE8: .4byte gUnknown_2023ECC
_08027CEC: .4byte gUnknown_2023D74
@@ -20810,7 +20810,7 @@ _08027DB4:
ldr r1, _08027E00 @ =gUnknown_2023D74
ldr r0, _08027E04 @ =gUnknown_81D9416
str r0, [r1]
- ldr r1, _08027E08 @ =gUnknown_2023D6A
+ ldr r1, _08027E08 @ =gLastUsedAbility
ldrb r0, [r2]
movs r3, 0x58
muls r0, r3
@@ -20837,7 +20837,7 @@ _08027DF8: .4byte gBattleScripting
_08027DFC: .4byte gActiveBattler
_08027E00: .4byte gUnknown_2023D74
_08027E04: .4byte gUnknown_81D9416
-_08027E08: .4byte gUnknown_2023D6A
+_08027E08: .4byte gLastUsedAbility
_08027E0C:
ldr r1, _08027E58 @ =gActiveBattler
ldrb r0, [r1]
@@ -20864,7 +20864,7 @@ _08027E0C:
ldr r1, _08027E60 @ =gUnknown_2023D74
ldr r0, _08027E64 @ =gUnknown_81D947E
str r0, [r1]
- ldr r1, _08027E68 @ =gUnknown_2023D6A
+ ldr r1, _08027E68 @ =gLastUsedAbility
ldrb r0, [r3]
muls r0, r4
add r0, r10
@@ -20880,7 +20880,7 @@ _08027E58: .4byte gActiveBattler
_08027E5C: .4byte gBattleScripting
_08027E60: .4byte gUnknown_2023D74
_08027E64: .4byte gUnknown_81D947E
-_08027E68: .4byte gUnknown_2023D6A
+_08027E68: .4byte gLastUsedAbility
_08027E6C:
ldr r4, _08027EBC @ =gActiveBattler
ldrb r0, [r4]
@@ -20909,7 +20909,7 @@ _08027E8E:
ldr r1, _08027EC4 @ =gUnknown_2023D74
ldr r0, _08027EC8 @ =gUnknown_81D947E
str r0, [r1]
- ldr r1, _08027ECC @ =gUnknown_2023D6A
+ ldr r1, _08027ECC @ =gLastUsedAbility
ldrb r0, [r2]
muls r0, r4
add r0, r10
@@ -20925,7 +20925,7 @@ _08027EBC: .4byte gActiveBattler
_08027EC0: .4byte gBattleScripting
_08027EC4: .4byte gUnknown_2023D74
_08027EC8: .4byte gUnknown_81D947E
-_08027ECC: .4byte gUnknown_2023D6A
+_08027ECC: .4byte gLastUsedAbility
_08027ED0:
ldr r3, _08027F5C @ =gActiveBattler
ldrb r1, [r3]
@@ -20946,7 +20946,7 @@ _08027EE8:
ands r0, r1
negs r0, r0
lsls r0, 24
- ldr r3, _08027F60 @ =gUnknown_2022AC8
+ ldr r3, _08027F60 @ =gBattleTextBuff2
movs r4, 0
movs r1, 0xFD
strb r1, [r3]
@@ -21002,14 +21002,14 @@ _08027F56:
b _08027FF0
.align 2, 0
_08027F5C: .4byte gActiveBattler
-_08027F60: .4byte gUnknown_2022AC8
+_08027F60: .4byte gBattleTextBuff2
_08027F64: .4byte gBattlerTarget
_08027F68: .4byte gUnknown_2023E82
_08027F6C:
asrs r6, r0, 28
movs r0, 0x7
ands r6, r0
- ldr r3, _08027FCC @ =gUnknown_2022AC8
+ ldr r3, _08027FCC @ =gBattleTextBuff2
strb r2, [r3]
movs r2, 0x1
cmp r6, 0x2
@@ -21057,7 +21057,7 @@ _08027FC2:
mov r8, r1
b _08027FF0
.align 2, 0
-_08027FCC: .4byte gUnknown_2022AC8
+_08027FCC: .4byte gBattleTextBuff2
_08027FD0: .4byte gBattleMons
_08027FD4: .4byte gActiveBattler
_08027FD8: .4byte gUnknown_2023E82
@@ -21193,7 +21193,7 @@ _080280C8: .4byte gBattleScripting
atk8A_normalisebuffs: @ 80280CC
push {r4-r7,lr}
movs r2, 0
- ldr r0, _08028114 @ =gUnknown_2023BCC
+ ldr r0, _08028114 @ =gBattlersCount
ldrb r1, [r0]
ldr r0, _08028118 @ =gUnknown_2023D74
mov r12, r0
@@ -21230,7 +21230,7 @@ _08028104:
pop {r0}
bx r0
.align 2, 0
-_08028114: .4byte gUnknown_2023BCC
+_08028114: .4byte gBattlersCount
_08028118: .4byte gUnknown_2023D74
_0802811C: .4byte gBattleMons
thumb_func_end atk8A_normalisebuffs
@@ -21500,7 +21500,7 @@ sub_802830C: @ 802830C
_08028320:
ldr r5, _080283A8 @ =gBattlerTarget
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
ldr r1, _080283AC @ =gEnemyParty
mov r8, r1
@@ -22043,7 +22043,7 @@ _08028752:
add r0, r8
adds r0, 0x22
strb r2, [r0]
- ldr r1, _080287A0 @ =gUnknown_2022AB8
+ ldr r1, _080287A0 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x3
@@ -22064,7 +22064,7 @@ _08028790:
pop {r0}
bx r0
.align 2, 0
-_080287A0: .4byte gUnknown_2022AB8
+_080287A0: .4byte gBattleTextBuff1
_080287A4: .4byte gUnknown_2023D74
thumb_func_end atk90_tryconversiontypechange
@@ -22095,7 +22095,7 @@ atk91_givepaydaymoney: @ 80287A8
adds r0, r1
adds r1, r4, 0
bl AddMoney
- ldr r1, _0802881C @ =gUnknown_2022AB8
+ ldr r1, _0802881C @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x1
@@ -22123,7 +22123,7 @@ _0802880C: .4byte gBattleTypeFlags
_08028810: .4byte gUnknown_2023E7E
_08028814: .4byte gBattleStruct
_08028818: .4byte gSaveBlock1Ptr
-_0802881C: .4byte gUnknown_2022AB8
+_0802881C: .4byte gBattleTextBuff1
_08028820: .4byte gUnknown_2023D74
_08028824: .4byte gUnknown_81D911D
_08028828:
@@ -22144,7 +22144,7 @@ atk92_setlightscreen: @ 802883C
push {r4-r6,lr}
ldr r5, _0802886C @ =sBattler_AI
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
ldr r4, _08028870 @ =gSideAffecting
movs r6, 0x1
adds r1, r6, 0
@@ -22171,7 +22171,7 @@ _08028874: .4byte gMoveResultFlags
_08028878: .4byte gUnknown_2023E82
_0802887C:
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r6, 0
ands r1, r0
lsls r1, 1
@@ -22181,8 +22181,8 @@ _0802887C:
orrs r0, r2
strh r0, [r1]
ldrb r0, [r5]
- bl GetBankIdentity
- ldr r4, _080288E0 @ =gUnknown_2023DE4
+ bl GetBattlerPosition
+ ldr r4, _080288E0 @ =gSideTimers
adds r1, r6, 0
ands r1, r0
lsls r0, r1, 1
@@ -22192,7 +22192,7 @@ _0802887C:
movs r1, 0x5
strb r1, [r0, 0x2]
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r6, 0
ands r1, r0
lsls r0, r1, 1
@@ -22207,7 +22207,7 @@ _0802887C:
cmp r0, 0
beq _080288EC
movs r0, 0x1
- bl sub_803F5B4
+ bl CountAliveMons
lsls r0, 24
lsrs r0, 24
cmp r0, 0x2
@@ -22216,7 +22216,7 @@ _0802887C:
movs r0, 0x4
b _080288F0
.align 2, 0
-_080288E0: .4byte gUnknown_2023DE4
+_080288E0: .4byte gSideTimers
_080288E4: .4byte gBattleTypeFlags
_080288E8: .4byte gUnknown_2023E82
_080288EC:
@@ -22252,7 +22252,7 @@ atk93_tryKO: @ 8028908
ldrh r0, [r1, 0x2E]
cmp r0, 0xAF
bne _08028940
- ldr r1, _0802893C @ =gUnknown_2023F54
+ ldr r1, _0802893C @ =gEnigmaBerries
lsls r0, r2, 3
subs r0, r2
lsls r0, 2
@@ -22263,7 +22263,7 @@ atk93_tryKO: @ 8028908
.align 2, 0
_08028934: .4byte gBattleMons
_08028938: .4byte gBattlerTarget
-_0802893C: .4byte gUnknown_2023F54
+_0802893C: .4byte gEnigmaBerries
_08028940:
ldrh r0, [r1, 0x2E]
bl ItemId_GetHoldEffect
@@ -22277,7 +22277,7 @@ _08028940:
lsls r0, 24
lsrs r6, r0, 24
_0802895A:
- ldr r1, _080289D4 @ =gUnknown_2023D6F
+ ldr r1, _080289D4 @ =gPotentialItemEffectBattler
ldr r5, _080289D8 @ =gBattlerTarget
ldrb r0, [r5]
strb r0, [r1]
@@ -22325,7 +22325,7 @@ _08028998:
movs r1, 0x1
orrs r0, r1
strb r0, [r2]
- ldr r0, _080289E8 @ =gUnknown_2023D6A
+ ldr r0, _080289E8 @ =gLastUsedAbility
strb r4, [r0]
ldr r1, _080289EC @ =gUnknown_2023D74
ldr r0, _080289F0 @ =gUnknown_81D93A1
@@ -22336,12 +22336,12 @@ _08028998:
bl sub_80C71D0
b _08028C48
.align 2, 0
-_080289D4: .4byte gUnknown_2023D6F
+_080289D4: .4byte gPotentialItemEffectBattler
_080289D8: .4byte gBattlerTarget
_080289DC: .4byte gUnknown_2023ECC
_080289E0: .4byte gBattleMons
_080289E4: .4byte gMoveResultFlags
-_080289E8: .4byte gUnknown_2023D6A
+_080289E8: .4byte gLastUsedAbility
_080289EC: .4byte gUnknown_2023D74
_080289F0: .4byte gUnknown_81D93A1
_080289F4:
@@ -22733,7 +22733,7 @@ sub_8028CF0: @ 8028CF0
bne _08028D18
ldr r0, _08028DC0 @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -22746,7 +22746,7 @@ _08028D18:
movs r1, 0
movs r2, 0xD
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r0, 24
cmp r0, 0
@@ -22758,7 +22758,7 @@ _08028D32:
movs r1, 0
movs r2, 0x4D
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
beq _08028D48
@@ -22934,7 +22934,7 @@ sub_8028E90: @ 8028E90
push {r5-r7}
ldr r4, _08028EBC @ =sBattler_AI
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08028EC8
@@ -22964,7 +22964,7 @@ _08028ED8:
adds r5, r1, r0
ldr r4, _08028F04 @ =gBattlerTarget
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08028F0C
@@ -23026,7 +23026,7 @@ _08028F1C:
ldr r1, _08028F88 @ =gUnknown_2023D74
ldr r0, _08028F8C @ =gUnknown_81D9444
str r0, [r1]
- ldr r0, _08028F90 @ =gUnknown_2023D6A
+ ldr r0, _08028F90 @ =gLastUsedAbility
strb r2, [r0]
ldrb r0, [r5]
movs r1, 0xC
@@ -23039,7 +23039,7 @@ _08028F80: .4byte gBattlerTarget
_08028F84: .4byte gBattleMons
_08028F88: .4byte gUnknown_2023D74
_08028F8C: .4byte gUnknown_81D9444
-_08028F90: .4byte gUnknown_2023D6A
+_08028F90: .4byte gLastUsedAbility
_08028F94:
mov r0, r10
mov r1, r9
@@ -23144,7 +23144,7 @@ _08029054:
bne _080290D4
ldr r2, _080290C0 @ =gActiveBattler
strb r1, [r2]
- ldr r0, _080290C4 @ =gUnknown_2023BCC
+ ldr r0, _080290C4 @ =gBattlersCount
ldrb r0, [r0]
cmp r1, r0
bcs _08029164
@@ -23179,7 +23179,7 @@ _080290A2:
ldrb r0, [r4]
adds r0, 0x1
strb r0, [r4]
- ldr r1, _080290C4 @ =gUnknown_2023BCC
+ ldr r1, _080290C4 @ =gBattlersCount
lsls r0, 24
lsrs r0, 24
ldrb r1, [r1]
@@ -23190,7 +23190,7 @@ _080290A2:
_080290B8: .4byte gUnknown_2023BC8
_080290BC: .4byte gUnknown_2023D74
_080290C0: .4byte gActiveBattler
-_080290C4: .4byte gUnknown_2023BCC
+_080290C4: .4byte gBattlersCount
_080290C8: .4byte gBitTable
_080290CC: .4byte gBattleMons
_080290D0: .4byte gAbsentBattlerFlags
@@ -23233,12 +23233,12 @@ _08029114:
cmp r0, 0
beq _08029164
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x2
eors r0, r1
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
strb r0, [r4]
ldrb r1, [r6]
ldrb r2, [r4]
@@ -23312,10 +23312,10 @@ _080291CC: .4byte gBattleMons
thumb_func_start atk99_setmist
atk99_setmist: @ 80291D0
push {r4-r6,lr}
- ldr r6, _08029200 @ =gUnknown_2023DE4
+ ldr r6, _08029200 @ =gSideTimers
ldr r4, _08029204 @ =sBattler_AI
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r5, 0x1
adds r1, r5, 0
ands r1, r0
@@ -23335,13 +23335,13 @@ atk99_setmist: @ 80291D0
strb r5, [r0, 0x5]
b _0802925E
.align 2, 0
-_08029200: .4byte gUnknown_2023DE4
+_08029200: .4byte gSideTimers
_08029204: .4byte sBattler_AI
_08029208: .4byte gMoveResultFlags
_0802920C: .4byte gUnknown_2023E82
_08029210:
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r5, 0
ands r1, r0
lsls r0, r1, 1
@@ -23351,7 +23351,7 @@ _08029210:
movs r1, 0x5
strb r1, [r0, 0x4]
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r5, 0
ands r1, r0
lsls r0, r1, 1
@@ -23361,7 +23361,7 @@ _08029210:
ldrb r1, [r4]
strb r1, [r0, 0x5]
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
ldr r2, _0802926C @ =gSideAffecting
adds r1, r5, 0
ands r1, r0
@@ -23542,7 +23542,7 @@ _08029350:
movs r0, 0xF
ands r0, r2
strb r0, [r1, 0x18]
- ldr r1, _0802942C @ =gUnknown_2022AB8
+ ldr r1, _0802942C @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x6
@@ -23605,7 +23605,7 @@ _08029400:
.align 2, 0
_08029424: .4byte sBattler_AI
_08029428: .4byte gDisableStructs
-_0802942C: .4byte gUnknown_2022AB8
+_0802942C: .4byte gBattleTextBuff1
_08029430: .4byte gActiveBattler
_08029434: .4byte gBattleMoves
_08029438: .4byte gUnknown_2023BF0
@@ -23933,7 +23933,7 @@ _080296B0:
movs r1, 0x5
strb r1, [r0]
_080296C4:
- ldr r1, _0802971C @ =gUnknown_2022AB8
+ ldr r1, _0802971C @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x2
@@ -23977,7 +23977,7 @@ _080296C4:
str r0, [r4]
b _08029744
.align 2, 0
-_0802971C: .4byte gUnknown_2022AB8
+_0802971C: .4byte gBattleTextBuff1
_08029720: .4byte gDisableStructs
_08029724: .4byte gBitTable
_08029728:
@@ -24157,7 +24157,7 @@ atkA1_counterdamagecalculator: @ 8029880
push {r4-r6,lr}
ldr r4, _080298F0 @ =sBattler_AI
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r6, r0, 24
ldr r5, _080298F4 @ =gUnknown_2023E8C
@@ -24165,7 +24165,7 @@ atkA1_counterdamagecalculator: @ 8029880
lsls r0, 4
adds r0, r5
ldrb r0, [r0, 0xC]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r2, r0, 24
ldrb r0, [r4]
@@ -24189,7 +24189,7 @@ atkA1_counterdamagecalculator: @ 8029880
ldr r1, _080298FC @ =gBattleMoveDamage
lsls r0, r3, 1
str r0, [r1]
- ldr r1, _08029900 @ =gUnknown_2023DE4
+ ldr r1, _08029900 @ =gSideTimers
lsls r0, r2, 1
adds r0, r2
lsls r0, 2
@@ -24212,7 +24212,7 @@ _080298F0: .4byte sBattler_AI
_080298F4: .4byte gUnknown_2023E8C
_080298F8: .4byte gBattleMons
_080298FC: .4byte gBattleMoveDamage
-_08029900: .4byte gUnknown_2023DE4
+_08029900: .4byte gSideTimers
_08029904: .4byte gBattlerTarget
_08029908:
ldr r2, _08029924 @ =gBattlerTarget
@@ -24274,7 +24274,7 @@ atkA2_mirrorcoatdamagecalculator: @ 8029978
push {r4-r6,lr}
ldr r4, _080299E8 @ =sBattler_AI
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r6, r0, 24
ldr r5, _080299EC @ =gUnknown_2023E8C
@@ -24282,7 +24282,7 @@ atkA2_mirrorcoatdamagecalculator: @ 8029978
lsls r0, 4
adds r0, r5
ldrb r0, [r0, 0xD]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r2, r0, 24
ldrb r0, [r4]
@@ -24307,7 +24307,7 @@ atkA2_mirrorcoatdamagecalculator: @ 8029978
ldr r1, _080299F4 @ =gBattleMoveDamage
lsls r0, r3, 1
str r0, [r1]
- ldr r1, _080299F8 @ =gUnknown_2023DE4
+ ldr r1, _080299F8 @ =gSideTimers
lsls r0, r2, 1
adds r0, r2
lsls r0, 2
@@ -24330,7 +24330,7 @@ _080299E8: .4byte sBattler_AI
_080299EC: .4byte gUnknown_2023E8C
_080299F0: .4byte gBattleMons
_080299F4: .4byte gBattleMoveDamage
-_080299F8: .4byte gUnknown_2023DE4
+_080299F8: .4byte gSideTimers
_080299FC: .4byte gBattlerTarget
_08029A00:
ldr r2, _08029A1C @ =gBattlerTarget
@@ -24453,7 +24453,7 @@ _08029AC4:
ldrb r0, [r0]
cmp r0, 0
beq _08029B88
- ldr r1, _08029B80 @ =gUnknown_2022AB8
+ ldr r1, _08029B80 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x2
@@ -24523,7 +24523,7 @@ _08029B70: .4byte gBattleMons
_08029B74: .4byte gBattlerTarget
_08029B78: .4byte gLastUsedMove
_08029B7C: .4byte gDisableStructs
-_08029B80: .4byte gUnknown_2022AB8
+_08029B80: .4byte gBattleTextBuff1
_08029B84: .4byte gUnknown_2023D74
_08029B88:
ldr r3, _08029BB0 @ =gUnknown_2023D74
@@ -24875,7 +24875,7 @@ _08029E2C:
adds r0, r7
adds r0, 0x22
strb r5, [r0]
- ldr r1, _08029E50 @ =gUnknown_2022AB8
+ ldr r1, _08029E50 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x3
@@ -24886,7 +24886,7 @@ _08029E2C:
ldr r1, _08029E54 @ =gUnknown_2023D74
b _08029E82
.align 2, 0
-_08029E50: .4byte gUnknown_2022AB8
+_08029E50: .4byte gBattleTextBuff1
_08029E54: .4byte gUnknown_2023D74
_08029E58:
mov r0, r8
@@ -24901,7 +24901,7 @@ _08029E58:
adds r0, r7
adds r0, 0x22
strb r2, [r0]
- ldr r1, _08029E90 @ =gUnknown_2022AB8
+ ldr r1, _08029E90 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x3
@@ -24917,7 +24917,7 @@ _08029E82:
b _08029F80
.align 2, 0
_08029E8C: .4byte gBattleMons
-_08029E90: .4byte gUnknown_2022AB8
+_08029E90: .4byte gBattleTextBuff1
_08029E94:
movs r4, 0
mov r8, r4
@@ -25264,7 +25264,7 @@ _0802A0F2:
ldr r0, _0802A184 @ =gActiveBattler
ldrb r0, [r0]
bl MarkBufferBankForExecution
- ldr r1, _0802A188 @ =gUnknown_2022AB8
+ ldr r1, _0802A188 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x2
@@ -25299,7 +25299,7 @@ _0802A178: .4byte gBattlerTarget
_0802A17C: .4byte gUnknown_2023D48
_0802A180: .4byte gBattleMoves
_0802A184: .4byte gActiveBattler
-_0802A188: .4byte gUnknown_2022AB8
+_0802A188: .4byte gBattleTextBuff1
_0802A18C: .4byte gUnknown_2023D74
_0802A190:
ldr r3, _0802A1BC @ =gUnknown_2023D74
@@ -25628,12 +25628,12 @@ TrySetDestinyBondToHappen: @ 802A3F8
push {r4,r5,lr}
ldr r0, _0802A448 @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r5, r0, 24
ldr r4, _0802A44C @ =gBattlerTarget
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r3, r0, 24
ldr r1, _0802A450 @ =gBattleMons
@@ -25827,7 +25827,7 @@ _0802A55E:
bge _0802A57C
adds r6, r0, 0
_0802A57C:
- ldr r1, _0802A668 @ =gUnknown_2022AB8
+ ldr r1, _0802A668 @ =gBattleTextBuff1
movs r5, 0xFD
strb r5, [r1]
movs r0, 0x2
@@ -25847,7 +25847,7 @@ _0802A57C:
strb r0, [r1, 0x3]
movs r0, 0xFF
strb r0, [r1, 0x4]
- ldr r4, _0802A66C @ =gUnknown_2022AC8
+ ldr r4, _0802A66C @ =gBattleTextBuff2
adds r0, r4, 0
adds r1, r6, 0
movs r2, 0
@@ -25938,8 +25938,8 @@ _0802A658: .4byte gLastUsedMove
_0802A65C: .4byte gBattlerTarget
_0802A660: .4byte 0x0000ffff
_0802A664: .4byte gBattleMons
-_0802A668: .4byte gUnknown_2022AB8
-_0802A66C: .4byte gUnknown_2022AC8
+_0802A668: .4byte gBattleTextBuff1
+_0802A66C: .4byte gBattleTextBuff2
_0802A670: .4byte gActiveBattler
_0802A674: .4byte gDisableStructs
_0802A678: .4byte gBitTable
@@ -25993,7 +25993,7 @@ _0802A6CC:
strb r0, [r6, 0x5]
ldr r5, _0802A728 @ =sBattler_AI
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
ldr r1, _0802A72C @ =gEnemyParty
mov r10, r1
@@ -26049,14 +26049,14 @@ _0802A74C:
ldr r7, _0802A7C0 @ =gActiveBattler
ldr r0, _0802A7C4 @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r2, 0x2
mov r9, r2
mov r1, r9
eors r0, r1
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _0802A7C8 @ =gBattleScripting
strb r0, [r1, 0x17]
strb r0, [r7]
@@ -26242,12 +26242,12 @@ _0802A8B6:
ands r0, r6
str r0, [r1]
ldrb r0, [r2]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x2
eors r0, r1
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r4, _0802A980 @ =gActiveBattler
strb r0, [r4]
ldr r0, _0802A984 @ =gBattleTypeFlags
@@ -26390,12 +26390,12 @@ atkB0_trysetspikes: @ 802AA18
push {r4,lr}
ldr r4, _0802AA6C @ =sBattler_AI
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
movs r1, 0x1
eors r0, r1
lsls r0, 24
lsrs r0, 24
- ldr r1, _0802AA70 @ =gUnknown_2023DE4
+ ldr r1, _0802AA70 @ =gSideTimers
lsls r2, r0, 1
adds r0, r2, r0
lsls r0, 2
@@ -26429,7 +26429,7 @@ atkB0_trysetspikes: @ 802AA18
b _0802AA96
.align 2, 0
_0802AA6C: .4byte sBattler_AI
-_0802AA70: .4byte gUnknown_2023DE4
+_0802AA70: .4byte gSideTimers
_0802AA74: .4byte gUnknown_2023ECC
_0802AA78: .4byte gUnknown_2023D74
_0802AA7C:
@@ -26488,7 +26488,7 @@ atkB2_trysetperishsong: @ 802AAD4
push {r6,r7}
movs r6, 0
movs r3, 0
- ldr r0, _0802AB18 @ =gUnknown_2023BCC
+ ldr r0, _0802AB18 @ =gBattlersCount
adds r7, r0, 0
ldr r0, _0802AB1C @ =sBattler_AI
mov r8, r0
@@ -26519,7 +26519,7 @@ _0802AB14:
adds r6, 0x1
b _0802AB34
.align 2, 0
-_0802AB18: .4byte gUnknown_2023BCC
+_0802AB18: .4byte gBattlersCount
_0802AB1C: .4byte sBattler_AI
_0802AB20: .4byte gBattleMons
_0802AB24: .4byte gDisableStructs
@@ -26540,7 +26540,7 @@ _0802AB40:
mov r1, r8
ldrb r0, [r1]
bl PressurePPLoseOnUsingPerishSong
- ldr r0, _0802AB6C @ =gUnknown_2023BCC
+ ldr r0, _0802AB6C @ =gBattlersCount
ldrb r0, [r0]
cmp r6, r0
bne _0802AB74
@@ -26559,7 +26559,7 @@ _0802AB40:
str r1, [r3]
b _0802AB7C
.align 2, 0
-_0802AB6C: .4byte gUnknown_2023BCC
+_0802AB6C: .4byte gBattlersCount
_0802AB70: .4byte gUnknown_2023D74
_0802AB74:
ldr r1, _0802AB88 @ =gUnknown_2023D74
@@ -27078,7 +27078,7 @@ atkB8_setsafeguard: @ 802AF74
push {r4-r7,lr}
ldr r7, _0802AFA8 @ =sBattler_AI
ldrb r0, [r7]
- bl GetBankIdentity
+ bl GetBattlerPosition
ldr r4, _0802AFAC @ =gSideAffecting
movs r6, 0x1
adds r1, r6, 0
@@ -27106,7 +27106,7 @@ _0802AFB0: .4byte gMoveResultFlags
_0802AFB4: .4byte gUnknown_2023E82
_0802AFB8:
ldrb r0, [r7]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r6, 0
ands r1, r0
lsls r1, 1
@@ -27116,8 +27116,8 @@ _0802AFB8:
orrs r0, r2
strh r0, [r1]
ldrb r0, [r7]
- bl GetBankIdentity
- ldr r5, _0802B010 @ =gUnknown_2023DE4
+ bl GetBattlerPosition
+ ldr r5, _0802B010 @ =gSideTimers
adds r1, r6, 0
ands r1, r0
lsls r0, r1, 1
@@ -27127,7 +27127,7 @@ _0802AFB8:
movs r4, 0x5
strb r4, [r0, 0x6]
ldrb r0, [r7]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r6, 0
ands r1, r0
lsls r0, r1, 1
@@ -27147,7 +27147,7 @@ _0802B000:
pop {r0}
bx r0
.align 2, 0
-_0802B010: .4byte gUnknown_2023DE4
+_0802B010: .4byte gSideTimers
_0802B014: .4byte gUnknown_2023E82
_0802B018: .4byte gUnknown_2023D74
thumb_func_end atkB8_setsafeguard
@@ -27229,7 +27229,7 @@ _0802B0AC:
strh r0, [r1]
movs r3, 0xA
_0802B0B4:
- ldr r1, _0802B124 @ =gUnknown_2022AB8
+ ldr r1, _0802B124 @ =gBattleTextBuff1
movs r2, 0
movs r0, 0xFD
strb r0, [r1]
@@ -27243,7 +27243,7 @@ _0802B0B4:
strb r0, [r1, 0x5]
ldr r1, _0802B128 @ =gBattlerTarget
strb r2, [r1]
- ldr r0, _0802B12C @ =gUnknown_2023BCC
+ ldr r0, _0802B12C @ =gBattlersCount
ldrb r3, [r0]
adds r6, r1, 0
ldr r0, _0802B130 @ =gUnknown_2023D74
@@ -27287,9 +27287,9 @@ _0802B10C:
bx r0
.align 2, 0
_0802B120: .4byte gDynamicBasePower
-_0802B124: .4byte gUnknown_2022AB8
+_0802B124: .4byte gBattleTextBuff1
_0802B128: .4byte gBattlerTarget
-_0802B12C: .4byte gUnknown_2023BCC
+_0802B12C: .4byte gBattlersCount
_0802B130: .4byte gUnknown_2023D74
_0802B134: .4byte sBattler_AI
_0802B138: .4byte gBitTable
@@ -27309,7 +27309,7 @@ atkBA_jumpifnopursuitswitchdmg: @ 802B140
bne _0802B170
ldr r0, _0802B168 @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _0802B16C
@@ -27324,7 +27324,7 @@ _0802B16C:
_0802B170:
ldr r0, _0802B184 @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _0802B188
@@ -27335,7 +27335,7 @@ _0802B184: .4byte sBattler_AI
_0802B188:
movs r0, 0x2
_0802B18A:
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _0802B264 @ =gBattlerTarget
strb r0, [r1]
ldr r0, _0802B268 @ =gUnknown_2023D7C
@@ -27389,7 +27389,7 @@ _0802B1A2:
cmp r0, 0xE4
bne _0802B2A8
movs r1, 0
- ldr r0, _0802B280 @ =gUnknown_2023BCC
+ ldr r0, _0802B280 @ =gBattlersCount
ldr r2, _0802B284 @ =gCurrentMove
mov r8, r2
ldr r7, _0802B288 @ =gUnknown_2023D48
@@ -27455,7 +27455,7 @@ _0802B270: .4byte gBattleStruct
_0802B274: .4byte gBattleMons
_0802B278: .4byte gDisableStructs
_0802B27C: .4byte gUnknown_2023DC4
-_0802B280: .4byte gUnknown_2023BCC
+_0802B280: .4byte gBattlersCount
_0802B284: .4byte gCurrentMove
_0802B288: .4byte gUnknown_2023D48
_0802B28C: .4byte gUnknown_2023D49
@@ -27677,7 +27677,7 @@ atkBE_rapidspinfree: @ 802B3F4
adds r0, r2
ldrb r0, [r0, 0x14]
strb r0, [r3]
- ldr r1, _0802B47C @ =gUnknown_2022AB8
+ ldr r1, _0802B47C @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x2
@@ -27705,7 +27705,7 @@ _0802B46C: .4byte gBattleScripting
_0802B470: .4byte gBattlerTarget
_0802B474: .4byte 0xffff1fff
_0802B478: .4byte gBattleStruct
-_0802B47C: .4byte gUnknown_2022AB8
+_0802B47C: .4byte gBattleTextBuff1
_0802B480: .4byte gUnknown_2023D74
_0802B484: .4byte gUnknown_81D8DF3
_0802B488:
@@ -27739,7 +27739,7 @@ _0802B4C0: .4byte gUnknown_2023D74
_0802B4C4: .4byte gUnknown_81D8E04
_0802B4C8:
adds r0, r2, 0
- bl GetBankSide
+ bl GetBattlerSide
ldr r4, _0802B518 @ =gSideAffecting
lsls r0, 24
lsrs r0, 23
@@ -27750,7 +27750,7 @@ _0802B4C8:
cmp r0, 0
beq _0802B52C
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 23
adds r0, r4
@@ -27760,8 +27760,8 @@ _0802B4C8:
movs r4, 0
strh r1, [r0]
ldrb r0, [r5]
- bl GetBankSide
- ldr r2, _0802B520 @ =gUnknown_2023DE4
+ bl GetBattlerSide
+ ldr r2, _0802B520 @ =gSideTimers
lsls r0, 24
lsrs r0, 24
lsls r1, r0, 1
@@ -27776,7 +27776,7 @@ _0802B4C8:
.align 2, 0
_0802B518: .4byte gSideAffecting
_0802B51C: .4byte 0x0000ffef
-_0802B520: .4byte gUnknown_2023DE4
+_0802B520: .4byte gSideTimers
_0802B524: .4byte gUnknown_2023D74
_0802B528: .4byte gUnknown_81D8E0B
_0802B52C:
@@ -27844,7 +27844,7 @@ atkC0_recoverbasedonsunlight: @ 802B570
movs r1, 0
movs r2, 0xD
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r0, 24
cmp r0, 0
@@ -27854,7 +27854,7 @@ atkC0_recoverbasedonsunlight: @ 802B570
movs r1, 0
movs r2, 0x4D
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
beq _0802B5F0
@@ -28081,7 +28081,7 @@ atkC2_selectfirstvalidtarget: @ 802B774
ldr r0, _0802B7D0 @ =gBattlerTarget
movs r1, 0
strb r1, [r0]
- ldr r1, _0802B7D4 @ =gUnknown_2023BCC
+ ldr r1, _0802B7D4 @ =gBattlersCount
ldrb r1, [r1]
adds r6, r0, 0
ldr r0, _0802B7D8 @ =gUnknown_2023D74
@@ -28126,7 +28126,7 @@ _0802B7BE:
bx r0
.align 2, 0
_0802B7D0: .4byte gBattlerTarget
-_0802B7D4: .4byte gUnknown_2023BCC
+_0802B7D4: .4byte gBattlersCount
_0802B7D8: .4byte gUnknown_2023D74
_0802B7DC: .4byte sBattler_AI
_0802B7E0: .4byte gBitTable
@@ -28189,7 +28189,7 @@ _0802B82C:
strb r1, [r0]
ldr r4, _0802B8D4 @ =gSideAffecting
ldrb r0, [r7]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x1
mov r10, r1
ands r1, r0
@@ -28212,7 +28212,7 @@ _0802B82C:
str r4, [sp, 0x8]
ldrb r4, [r7]
str r4, [sp, 0xC]
- bl sub_803ECEC
+ bl CalculateBaseDamage
ldrb r1, [r7]
lsls r1, 2
mov r2, r8
@@ -28285,7 +28285,7 @@ atkC4_trydobeatup: @ 802B910
push {r6,r7}
ldr r0, _0802B954 @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
ldr r7, _0802B958 @ =gEnemyParty
cmp r0, 0
@@ -28375,7 +28375,7 @@ _0802B9D0:
ldrb r2, [r1]
cmp r2, 0x5
bhi _0802BAD4
- ldr r1, _0802BAAC @ =gUnknown_2022AB8
+ ldr r1, _0802BAAC @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x4
@@ -28474,7 +28474,7 @@ _0802BA9C:
b _0802BB0E
.align 2, 0
_0802BAA8: .4byte gUnknown_2023E82
-_0802BAAC: .4byte gUnknown_2022AB8
+_0802BAAC: .4byte gBattleTextBuff1
_0802BAB0: .4byte sBattler_AI
_0802BAB4: .4byte gUnknown_2023D74
_0802BAB8: .4byte gBattleMoveDamage
@@ -28828,8 +28828,8 @@ atkCA_setforcedtarget: @ 802BD68
push {r4,r5,lr}
ldr r4, _0802BDA8 @ =sBattler_AI
ldrb r0, [r4]
- bl GetBankSide
- ldr r5, _0802BDAC @ =gUnknown_2023DE4
+ bl GetBattlerSide
+ ldr r5, _0802BDAC @ =gSideTimers
lsls r0, 24
lsrs r0, 24
lsls r1, r0, 1
@@ -28839,7 +28839,7 @@ atkCA_setforcedtarget: @ 802BD68
movs r0, 0x1
strb r0, [r1, 0x8]
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
lsls r1, r0, 1
@@ -28857,7 +28857,7 @@ atkCA_setforcedtarget: @ 802BD68
bx r0
.align 2, 0
_0802BDA8: .4byte sBattler_AI
-_0802BDAC: .4byte gUnknown_2023DE4
+_0802BDAC: .4byte gSideTimers
_0802BDB0: .4byte gUnknown_2023D74
thumb_func_end atkCA_setforcedtarget
@@ -29193,12 +29193,12 @@ atkD1_trysethelpinghand: @ 802C038
push {r4,lr}
ldr r4, _0802C0A0 @ =sBattler_AI
ldrb r0, [r4]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x2
eors r0, r1
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r3, _0802C0A4 @ =gBattlerTarget
strb r0, [r3]
ldr r0, _0802C0A8 @ =gBattleTypeFlags
@@ -29286,7 +29286,7 @@ sub_802C0E0: @ 802C0E0
bne _0802C1DE
ldr r0, _0802C200 @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -29305,12 +29305,12 @@ sub_802C0E0: @ 802C0E0
_0802C120:
ldr r6, _0802C200 @ =sBattler_AI
ldrb r0, [r6]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r4, r0, 24
ldr r7, _0802C20C @ =gBattlerTarget
ldrb r0, [r7]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r5, r0, 24
ldr r0, _0802C1FC @ =gBattleTypeFlags
@@ -29433,7 +29433,7 @@ _0802C224:
ldr r1, _0802C24C @ =gUnknown_2023D74
ldr r0, _0802C250 @ =gUnknown_81D948E
str r0, [r1]
- ldr r1, _0802C254 @ =gUnknown_2023D6A
+ ldr r1, _0802C254 @ =gLastUsedAbility
ldrb r0, [r7]
muls r0, r5
add r0, r8
@@ -29447,7 +29447,7 @@ _0802C224:
.align 2, 0
_0802C24C: .4byte gUnknown_2023D74
_0802C250: .4byte gUnknown_81D948E
-_0802C254: .4byte gUnknown_2023D6A
+_0802C254: .4byte gLastUsedAbility
_0802C258:
ldr r3, _0802C344 @ =gBattleStruct
mov r10, r3
@@ -29532,7 +29532,7 @@ _0802C258:
ldr r0, [r1]
adds r0, 0x5
str r0, [r1]
- ldr r1, _0802C354 @ =gUnknown_2022AB8
+ ldr r1, _0802C354 @ =gBattleTextBuff1
movs r3, 0xFD
strb r3, [r1]
movs r2, 0xA
@@ -29544,7 +29544,7 @@ _0802C258:
strb r0, [r1, 0x3]
movs r0, 0xFF
strb r0, [r1, 0x4]
- ldr r1, _0802C358 @ =gUnknown_2022AC8
+ ldr r1, _0802C358 @ =gBattleTextBuff2
strb r3, [r1]
strb r2, [r1, 0x1]
mov r2, r9
@@ -29568,8 +29568,8 @@ _0802C344: .4byte gBattleStruct
_0802C348: .4byte sBattler_AI
_0802C34C: .4byte gActiveBattler
_0802C350: .4byte gUnknown_2023D74
-_0802C354: .4byte gUnknown_2022AB8
-_0802C358: .4byte gUnknown_2022AC8
+_0802C354: .4byte gBattleTextBuff1
+_0802C358: .4byte gBattleTextBuff2
_0802C35C: .4byte gUnknown_2023E82
_0802C360:
ldrh r0, [r6]
@@ -29621,7 +29621,7 @@ atkD3_trycopyability: @ 802C390
adds r0, r3
adds r0, 0x20
strb r1, [r0]
- ldr r1, _0802C3DC @ =gUnknown_2023D6A
+ ldr r1, _0802C3DC @ =gLastUsedAbility
ldrb r0, [r4]
muls r0, r2
adds r0, r3
@@ -29637,7 +29637,7 @@ atkD3_trycopyability: @ 802C390
_0802C3D0: .4byte gBattleMons
_0802C3D4: .4byte gBattlerTarget
_0802C3D8: .4byte sBattler_AI
-_0802C3DC: .4byte gUnknown_2023D6A
+_0802C3DC: .4byte gLastUsedAbility
_0802C3E0: .4byte gUnknown_2023D74
_0802C3E4:
ldr r3, _0802C404 @ =gUnknown_2023D74
@@ -29702,7 +29702,7 @@ _0802C44C: .4byte gUnknown_2023F20
_0802C450: .4byte sBattler_AI
_0802C454: .4byte gBattlerPartyIndexes
_0802C458:
- ldr r1, _0802C4BC @ =gUnknown_2022AB8
+ ldr r1, _0802C4BC @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x4
@@ -29755,7 +29755,7 @@ _0802C4A4:
str r1, [r7]
b _0802C4D4
.align 2, 0
-_0802C4BC: .4byte gUnknown_2022AB8
+_0802C4BC: .4byte gBattleTextBuff1
_0802C4C0: .4byte gBattlerTarget
_0802C4C4: .4byte gUnknown_2023F20
_0802C4C8: .4byte gBattleMoveDamage
@@ -30150,7 +30150,7 @@ _0802C7B4: .4byte gStatuses3
_0802C7B8: .4byte gUnknown_2023D74
_0802C7BC:
adds r0, r2, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
mov r8, r0
@@ -30160,7 +30160,7 @@ _0802C7BC:
b _0802C82E
_0802C7D2:
adds r0, r6, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r8, r0
@@ -30211,12 +30211,12 @@ _0802C828:
lsls r0, 24
lsrs r6, r0, 24
_0802C82E:
- ldr r0, _0802C86C @ =gUnknown_2023BCC
+ ldr r0, _0802C86C @ =gBattlersCount
ldrb r0, [r0]
cmp r6, r0
bcc _0802C7D2
_0802C836:
- ldr r0, _0802C86C @ =gUnknown_2023BCC
+ ldr r0, _0802C86C @ =gBattlersCount
ldrb r0, [r0]
cmp r6, r0
bne _0802C858
@@ -30244,7 +30244,7 @@ _0802C858:
.align 2, 0
_0802C864: .4byte sBattler_AI
_0802C868: .4byte gBattleMons
-_0802C86C: .4byte gUnknown_2023BCC
+_0802C86C: .4byte gBattlersCount
_0802C870: .4byte gUnknown_2023D74
thumb_func_end atkDB_tryimprision
@@ -30388,7 +30388,7 @@ atkDE_asistattackselect: @ 802C964
str r0, [sp, 0x4]
ldr r0, _0802CA88 @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x1
ands r1, r0
ldr r0, _0802CA8C @ =gPlayerParty
@@ -30577,7 +30577,7 @@ atkDF_trysetmagiccoat: @ 802CAE4
strb r1, [r0]
ldr r0, _0802CB38 @ =gUnknown_2023BE2
ldrb r1, [r0]
- ldr r0, _0802CB3C @ =gUnknown_2023BCC
+ ldr r0, _0802CB3C @ =gBattlersCount
ldrb r0, [r0]
subs r0, 0x1
cmp r1, r0
@@ -30601,7 +30601,7 @@ _0802CB2C: .4byte gBattlerTarget
_0802CB30: .4byte sBattler_AI
_0802CB34: .4byte gUnknown_2023ECC
_0802CB38: .4byte gUnknown_2023BE2
-_0802CB3C: .4byte gUnknown_2023BCC
+_0802CB3C: .4byte gBattlersCount
_0802CB40: .4byte gUnknown_2023D74
_0802CB44:
ldr r0, _0802CB60 @ =gUnknown_2023E8C
@@ -30640,7 +30640,7 @@ atkE0_trysetsnatch: @ 802CB68
strb r1, [r0]
ldr r0, _0802CBB4 @ =gUnknown_2023BE2
ldrb r1, [r0]
- ldr r0, _0802CBB8 @ =gUnknown_2023BCC
+ ldr r0, _0802CBB8 @ =gBattlersCount
ldrb r0, [r0]
subs r0, 0x1
cmp r1, r0
@@ -30663,7 +30663,7 @@ atkE0_trysetsnatch: @ 802CB68
_0802CBAC: .4byte gUnknown_2023ECC
_0802CBB0: .4byte sBattler_AI
_0802CBB4: .4byte gUnknown_2023BE2
-_0802CBB8: .4byte gUnknown_2023BCC
+_0802CBB8: .4byte gBattlersCount
_0802CBBC: .4byte gUnknown_2023D74
_0802CBC0:
ldr r0, _0802CBDC @ =gUnknown_2023E8C
@@ -30695,10 +30695,10 @@ atkE1_trygetintimidatetarget: @ 802CBE4
ldrb r0, [r0]
strb r0, [r4, 0x17]
ldrb r0, [r4, 0x17]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r5, r0, 24
- ldr r2, _0802CC90 @ =gUnknown_2022AB8
+ ldr r2, _0802CC90 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r2]
movs r0, 0x9
@@ -30714,7 +30714,7 @@ atkE1_trygetintimidatetarget: @ 802CBE4
movs r0, 0xFF
strb r0, [r2, 0x3]
ldr r2, _0802CC98 @ =gBattlerTarget
- ldr r1, _0802CC9C @ =gUnknown_2023BCC
+ ldr r1, _0802CC9C @ =gBattlersCount
ldrb r0, [r2]
ldrb r1, [r1]
cmp r0, r1
@@ -30723,7 +30723,7 @@ atkE1_trygetintimidatetarget: @ 802CBE4
ldr r6, _0802CCA0 @ =gBitTable
_0802CC2A:
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, r5
@@ -30735,14 +30735,14 @@ _0802CC2A:
adds r0, r6
ldr r0, [r0]
ands r1, r0
- ldr r2, _0802CC9C @ =gUnknown_2023BCC
+ ldr r2, _0802CC9C @ =gBattlersCount
cmp r1, 0
beq _0802CC60
_0802CC4C:
ldrb r0, [r4]
adds r0, 0x1
strb r0, [r4]
- ldr r1, _0802CC9C @ =gUnknown_2023BCC
+ ldr r1, _0802CC9C @ =gBattlersCount
lsls r0, 24
lsrs r0, 24
adds r2, r1, 0
@@ -30773,10 +30773,10 @@ _0802CC6A:
.align 2, 0
_0802CC88: .4byte gBattleScripting
_0802CC8C: .4byte gBattleStruct
-_0802CC90: .4byte gUnknown_2022AB8
+_0802CC90: .4byte gBattleTextBuff1
_0802CC94: .4byte gBattleMons
_0802CC98: .4byte gBattlerTarget
-_0802CC9C: .4byte gUnknown_2023BCC
+_0802CC9C: .4byte gBattlersCount
_0802CCA0: .4byte gBitTable
_0802CCA4: .4byte gAbsentBattlerFlags
_0802CCA8: .4byte gUnknown_2023D74
@@ -31080,7 +31080,7 @@ _0802CEF6:
ldr r1, _0802CF28 @ =gUnknown_8250848
adds r2, r1
movs r1, 0xC
- bl sub_804037C
+ bl SetMonData
_0802CF0A:
adds r7, r4, 0
cmp r7, 0x5
@@ -31284,7 +31284,7 @@ atkE9_setweatherballtype: @ 802D090
movs r1, 0
movs r2, 0xD
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r0, 24
cmp r0, 0
@@ -31294,7 +31294,7 @@ atkE9_setweatherballtype: @ 802D090
movs r1, 0
movs r2, 0x4D
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
bne _0802D130
@@ -31494,7 +31494,7 @@ atkEB_settypetoterrain: @ 802D1F0
ldrb r0, [r0]
adds r1, 0x22
strb r0, [r1]
- ldr r1, _0802D270 @ =gUnknown_2022AB8
+ ldr r1, _0802D270 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x3
@@ -31515,7 +31515,7 @@ _0802D260: .4byte gBattleMons
_0802D264: .4byte sBattler_AI
_0802D268: .4byte gUnknown_8250888
_0802D26C: .4byte gUnknown_2022B50
-_0802D270: .4byte gUnknown_2022AB8
+_0802D270: .4byte gBattleTextBuff1
_0802D274: .4byte gUnknown_2023D74
_0802D278:
ldr r3, _0802D29C @ =gUnknown_2023D74
@@ -31546,12 +31546,12 @@ atkEC_pursuitrelated: @ 802D2A0
push {r4-r6,lr}
ldr r5, _0802D314 @ =sBattler_AI
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x2
eors r0, r1
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r4, _0802D318 @ =gActiveBattler
strb r0, [r4]
ldr r0, _0802D31C @ =gBattleTypeFlags
@@ -31681,12 +31681,12 @@ atkEE_removelightscreenreflect: @ 802D3B8
push {r4,lr}
ldr r0, _0802D400 @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
movs r1, 0x1
eors r0, r1
lsls r0, 24
lsrs r0, 24
- ldr r1, _0802D404 @ =gUnknown_2023DE4
+ ldr r1, _0802D404 @ =gSideTimers
lsls r3, r0, 1
adds r0, r3, r0
lsls r0, 2
@@ -31716,7 +31716,7 @@ _0802D3E0:
b _0802D41E
.align 2, 0
_0802D400: .4byte sBattler_AI
-_0802D404: .4byte gUnknown_2023DE4
+_0802D404: .4byte gSideTimers
_0802D408: .4byte gSideAffecting
_0802D40C: .4byte 0x0000fffe
_0802D410: .4byte 0x0000fffd
@@ -32067,7 +32067,7 @@ _0802D6BC:
adds r0, r1
ldr r2, _0802D71C @ =gUnknown_2023D68
movs r1, 0x26
- bl sub_804037C
+ bl SetMonData
bl CalculatePlayerPartyCount
lsls r0, 24
lsrs r0, 24
@@ -32144,7 +32144,7 @@ _0802D76C:
adds r0, r1
movs r1, 0x26
adds r2, r5, 0
- bl sub_804037C
+ bl SetMonData
bl CalculatePlayerPartyCount
lsls r0, 24
lsrs r0, 24
@@ -33070,7 +33070,7 @@ _0802DF18:
ldr r2, [r1]
adds r2, 0x6D
movs r1, 0x2
- bl sub_804037C
+ bl SetMonData
b _0802DF8C
.align 2, 0
_0802DF54: .4byte gMain
@@ -33183,14 +33183,14 @@ sub_802E020: @ 802E020
movs r0, 0xC
strb r0, [r1]
ldr r1, _0802E034 @ =gUnknown_2023BE2
- ldr r0, _0802E038 @ =gUnknown_2023BCC
+ ldr r0, _0802E038 @ =gBattlersCount
ldrb r0, [r0]
strb r0, [r1]
bx lr
.align 2, 0
_0802E030: .4byte gUnknown_2023BE3
_0802E034: .4byte gUnknown_2023BE2
-_0802E038: .4byte gUnknown_2023BCC
+_0802E038: .4byte gBattlersCount
thumb_func_end sub_802E020
.align 2, 0 @ Don't pad with nop.
diff --git a/asm/battle_setup.s b/asm/battle_setup.s
index 27ac6b473..26b218421 100644
--- a/asm/battle_setup.s
+++ b/asm/battle_setup.s
@@ -260,7 +260,7 @@ sub_807F810: @ 807F810
ldr r0, _0807F860 @ =gEnemyParty
ldr r2, _0807F864 @ =gUnknown_841D148
movs r1, 0x2
- bl sub_804037C
+ bl SetMonData
movs r0, 0x7
bl IncrementGameStat
movs r0, 0x8
@@ -396,7 +396,7 @@ _0807F960:
ldr r0, _0807F990 @ =gEnemyParty
ldr r2, _0807F994 @ =gUnknown_841D148
movs r1, 0x2
- bl sub_804037C
+ bl SetMonData
movs r0, 0x7
bl IncrementGameStat
movs r0, 0x8
@@ -579,7 +579,7 @@ _0807FAF4: .4byte gBattleTypeFlags
thumb_func_start sub_807FAF8
sub_807FAF8: @ 807FAF8
push {lr}
- bl sub_804C230
+ bl LoadPlayerParty
bl sub_807FB40
pop {r0}
bx r0
@@ -594,7 +594,7 @@ sub_807FB08: @ 807FB08
ldr r1, _0807FB38 @ =gMain
ldr r0, _0807FB3C @ =sub_807FAF8
str r0, [r1, 0x8]
- bl copy_player_party_to_sav1
+ bl SavePlayerParty
bl sub_8159F40
bl GetWildBattleTransition
lsls r0, 24
@@ -1650,7 +1650,7 @@ TrainerWantsBattle: @ 8080334
ldr r2, _08080368 @ =gUnknown_3005074
strb r0, [r2]
ldr r4, _0808036C @ =gUnknown_20370D2
- ldr r3, _08080370 @ =gUnknown_2036E38
+ ldr r3, _08080370 @ =gMapObjects
lsls r2, r0, 3
adds r2, r0
lsls r2, 2
@@ -1669,7 +1669,7 @@ TrainerWantsBattle: @ 8080334
.align 2, 0
_08080368: .4byte gUnknown_3005074
_0808036C: .4byte gUnknown_20370D2
-_08080370: .4byte gUnknown_2036E38
+_08080370: .4byte gMapObjects
_08080374: .4byte gUnknown_81A4EB4
thumb_func_end TrainerWantsBattle
@@ -1698,7 +1698,7 @@ sub_8080398: @ 8080398
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _080803C8 @ =gUnknown_2036E38
+ ldr r0, _080803C8 @ =gMapObjects
adds r4, r0
ldrb r0, [r4, 0x18]
lsls r0, 28
@@ -1714,7 +1714,7 @@ sub_8080398: @ 8080398
bx r0
.align 2, 0
_080803C4: .4byte gUnknown_3005074
-_080803C8: .4byte gUnknown_2036E38
+_080803C8: .4byte gMapObjects
thumb_func_end sub_8080398
thumb_func_start sub_80803CC
diff --git a/asm/battle_tower.s b/asm/battle_tower.s
index 45107fad1..34b80978c 100644
--- a/asm/battle_tower.s
+++ b/asm/battle_tower.s
@@ -939,7 +939,7 @@ sub_80E6078: @ 80E6078
ldrb r0, [r1]
cmp r0, 0xC8
bne _080E60A4
- ldr r1, _080E609C @ =gUnknown_82538A8
+ ldr r1, _080E609C @ =gFacilityClassToPicIndex
ldr r2, _080E60A0 @ =0x000004a1
adds r0, r3, r2
ldrb r0, [r0]
@@ -948,12 +948,12 @@ sub_80E6078: @ 80E6078
.align 2, 0
_080E6094: .4byte gSaveBlock2Ptr
_080E6098: .4byte 0x0000056c
-_080E609C: .4byte gUnknown_82538A8
+_080E609C: .4byte gFacilityClassToPicIndex
_080E60A0: .4byte 0x000004a1
_080E60A4:
cmp r0, 0x63
bls _080E60C4
- ldr r2, _080E60C0 @ =gUnknown_82538A8
+ ldr r2, _080E60C0 @ =gFacilityClassToPicIndex
ldrb r0, [r1]
subs r0, 0x64
movs r1, 0xA4
@@ -965,9 +965,9 @@ _080E60A4:
adds r0, r2
b _080E60D6
.align 2, 0
-_080E60C0: .4byte gUnknown_82538A8
+_080E60C0: .4byte gFacilityClassToPicIndex
_080E60C4:
- ldr r3, _080E60DC @ =gUnknown_82538A8
+ ldr r3, _080E60DC @ =gFacilityClassToPicIndex
ldr r2, _080E60E0 @ =gUnknown_83FFAC4
ldrb r1, [r1]
lsls r0, r1, 2
@@ -981,7 +981,7 @@ _080E60D6:
pop {r1}
bx r1
.align 2, 0
-_080E60DC: .4byte gUnknown_82538A8
+_080E60DC: .4byte gFacilityClassToPicIndex
_080E60E0: .4byte gUnknown_83FFAC4
thumb_func_end sub_80E6078
@@ -995,7 +995,7 @@ sub_80E60E4: @ 80E60E4
ldrb r0, [r1]
cmp r0, 0xC8
bne _080E6110
- ldr r1, _080E6108 @ =gUnknown_825393E
+ ldr r1, _080E6108 @ =gFacilityClassToTrainerClass
ldr r2, _080E610C @ =0x000004a1
adds r0, r3, r2
ldrb r0, [r0]
@@ -1004,12 +1004,12 @@ sub_80E60E4: @ 80E60E4
.align 2, 0
_080E6100: .4byte gSaveBlock2Ptr
_080E6104: .4byte 0x0000056c
-_080E6108: .4byte gUnknown_825393E
+_080E6108: .4byte gFacilityClassToTrainerClass
_080E610C: .4byte 0x000004a1
_080E6110:
cmp r0, 0x63
bhi _080E6130
- ldr r3, _080E6128 @ =gUnknown_825393E
+ ldr r3, _080E6128 @ =gFacilityClassToTrainerClass
ldr r2, _080E612C @ =gUnknown_83FFAC4
ldrb r1, [r1]
lsls r0, r1, 2
@@ -1020,10 +1020,10 @@ _080E6110:
adds r0, r3
b _080E6144
.align 2, 0
-_080E6128: .4byte gUnknown_825393E
+_080E6128: .4byte gFacilityClassToTrainerClass
_080E612C: .4byte gUnknown_83FFAC4
_080E6130:
- ldr r2, _080E614C @ =gUnknown_825393E
+ ldr r2, _080E614C @ =gFacilityClassToTrainerClass
ldrb r0, [r1]
subs r0, 0x64
movs r1, 0xA4
@@ -1038,7 +1038,7 @@ _080E6144:
pop {r1}
bx r1
.align 2, 0
-_080E614C: .4byte gUnknown_825393E
+_080E614C: .4byte gFacilityClassToTrainerClass
thumb_func_end sub_80E60E4
thumb_func_start sub_80E6150
@@ -1465,7 +1465,7 @@ _080E646E:
adds r0, r4, 0
movs r1, 0x20
add r2, sp, 0xC
- bl sub_804037C
+ bl SetMonData
mov r0, r8
add r0, r10
ldrb r2, [r0, 0x2]
@@ -1474,7 +1474,7 @@ _080E646E:
adds r2, r0
adds r0, r4, 0
movs r1, 0xC
- bl sub_804037C
+ bl SetMonData
mov r6, r9
_080E64A0:
cmp r6, 0x3
@@ -1523,7 +1523,7 @@ _080E64EC:
movs r0, 0xB
adds r1, r5, 0
muls r1, r0
- ldr r0, _080E651C @ =gUnknown_8245EE0
+ ldr r0, _080E651C @ =gSpeciesNames
adds r1, r0
adds r0, r6, 0
bl StringAppend
@@ -1537,7 +1537,7 @@ _080E64EC:
.align 2, 0
_080E6514: .4byte gStringVar1
_080E6518: .4byte gUnknown_83FE859
-_080E651C: .4byte gUnknown_8245EE0
+_080E651C: .4byte gSpeciesNames
_080E6520:
cmp r4, 0x8
beq _080E6538
@@ -1999,7 +1999,7 @@ _080E6874:
adds r0, r4, 0
movs r1, 0xC
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r5, 0x1
cmp r5, 0x5
ble _080E6874
@@ -2101,7 +2101,7 @@ _080E6948:
adds r0, r4
movs r1, 0xC
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r5, 0x1
cmp r5, 0x5
ble _080E6948
@@ -3306,7 +3306,7 @@ _080E72EA:
adds r0, r4, 0
adds r1, r7, 0
adds r2, r6, 0
- bl sub_804037C
+ bl SetMonData
_080E731A:
adds r5, 0x1
cmp r5, 0x2
@@ -3437,7 +3437,7 @@ _080E741C: .4byte gPlayerParty
thumb_func_start GetEreaderTrainerFrontSpriteId
GetEreaderTrainerFrontSpriteId: @ 80E7420
- ldr r1, _080E7434 @ =gUnknown_82538A8
+ ldr r1, _080E7434 @ =gFacilityClassToPicIndex
ldr r0, _080E7438 @ =gSaveBlock2Ptr
ldr r0, [r0]
ldr r2, _080E743C @ =0x000004a1
@@ -3447,14 +3447,14 @@ GetEreaderTrainerFrontSpriteId: @ 80E7420
ldrb r0, [r0]
bx lr
.align 2, 0
-_080E7434: .4byte gUnknown_82538A8
+_080E7434: .4byte gFacilityClassToPicIndex
_080E7438: .4byte gSaveBlock2Ptr
_080E743C: .4byte 0x000004a1
thumb_func_end GetEreaderTrainerFrontSpriteId
thumb_func_start GetEreaderTrainerClassId
GetEreaderTrainerClassId: @ 80E7440
- ldr r1, _080E7454 @ =gUnknown_825393E
+ ldr r1, _080E7454 @ =gFacilityClassToTrainerClass
ldr r0, _080E7458 @ =gSaveBlock2Ptr
ldr r0, [r0]
ldr r2, _080E745C @ =0x000004a1
@@ -3464,7 +3464,7 @@ GetEreaderTrainerClassId: @ 80E7440
ldrb r0, [r0]
bx lr
.align 2, 0
-_080E7454: .4byte gUnknown_825393E
+_080E7454: .4byte gFacilityClassToTrainerClass
_080E7458: .4byte gSaveBlock2Ptr
_080E745C: .4byte 0x000004a1
thumb_func_end GetEreaderTrainerClassId
diff --git a/asm/battle_transition.s b/asm/battle_transition.s
index 70453eb32..921482d16 100644
--- a/asm/battle_transition.s
+++ b/asm/battle_transition.s
@@ -4942,7 +4942,7 @@ sub_80D2EA4: @ 80D2EA4
adds r2, 0x2A
lsls r2, 16
asrs r2, 16
- ldr r5, _080D3004 @ =gUnknown_201C000
+ ldr r5, _080D3004 @ =gDecompressionBuffer
str r5, [sp]
movs r3, 0
bl CreateTrainerSprite
@@ -5077,7 +5077,7 @@ sub_80D2EA4: @ 80D2EA4
_080D2FF8: .4byte gReservedSpritePaletteCount
_080D2FFC: .4byte gUnknown_83FA494
_080D3000: .4byte gUnknown_83FA4AE
-_080D3004: .4byte gUnknown_201C000
+_080D3004: .4byte gDecompressionBuffer
_080D3008: .4byte gSaveBlock2Ptr
_080D300C: .4byte gSprites
_080D3010: .4byte sub_80D301C
diff --git a/asm/battle_util.s b/asm/battle_util.s
index 1c180978d..04202e9da 100644
--- a/asm/battle_util.s
+++ b/asm/battle_util.s
@@ -74,7 +74,7 @@ _08016EB4:
_08016EB8:
movs r0, 0x1
_08016EBA:
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r2, r0, 24
_08016EC2:
@@ -199,12 +199,12 @@ PressurePPLoseOnUsingImprision: @ 8016F90
movs r0, 0x4
mov r8, r0
adds r0, r5, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
mov r9, r0
movs r4, 0
- ldr r0, _080170B0 @ =gUnknown_2023BCC
+ ldr r0, _080170B0 @ =gBattlersCount
ldrb r0, [r0]
cmp r4, r0
bge _08017038
@@ -217,7 +217,7 @@ PressurePPLoseOnUsingImprision: @ 8016F90
_08016FC6:
lsls r0, r4, 24
lsrs r0, 24
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
adds r6, r4, 0x1
@@ -270,7 +270,7 @@ _08017016:
strb r0, [r1]
_0801702E:
adds r4, r6, 0
- ldr r0, _080170B0 @ =gUnknown_2023BCC
+ ldr r0, _080170B0 @ =gBattlersCount
ldrb r0, [r0]
cmp r4, r0
blt _08016FC6
@@ -335,7 +335,7 @@ _080170A0:
pop {r0}
bx r0
.align 2, 0
-_080170B0: .4byte gUnknown_2023BCC
+_080170B0: .4byte gBattlersCount
_080170B4: .4byte gBattleMons
_080170B8: .4byte gDisableStructs
_080170BC: .4byte gBitTable
@@ -354,7 +354,7 @@ PressurePPLoseOnUsingPerishSong: @ 80170C4
lsrs r3, r0, 24
movs r6, 0x4
movs r1, 0
- ldr r0, _080171BC @ =gUnknown_2023BCC
+ ldr r0, _080171BC @ =gBattlersCount
mov r8, r0
ldrb r0, [r0]
cmp r1, r0
@@ -472,7 +472,7 @@ _080171AA:
pop {r0}
bx r0
.align 2, 0
-_080171BC: .4byte gUnknown_2023BCC
+_080171BC: .4byte gBattlersCount
_080171C0: .4byte gBattleMons
_080171C4: .4byte gUnknown_2023BF0
_080171C8: .4byte gUnknown_2023C08
@@ -491,7 +491,7 @@ MarkAllBufferBanksForExecution: @ 80171D8
cmp r0, 0
beq _08017218
movs r2, 0
- ldr r4, _0801720C @ =gUnknown_2023BCC
+ ldr r4, _0801720C @ =gBattlersCount
ldrb r0, [r4]
cmp r2, r0
bge _08017236
@@ -510,12 +510,12 @@ _080171F4:
b _08017236
.align 2, 0
_08017208: .4byte gBattleTypeFlags
-_0801720C: .4byte gUnknown_2023BCC
+_0801720C: .4byte gBattlersCount
_08017210: .4byte gUnknown_2023BC8
_08017214: .4byte gBitTable
_08017218:
movs r2, 0
- ldr r4, _0801723C @ =gUnknown_2023BCC
+ ldr r4, _0801723C @ =gBattlersCount
ldrb r0, [r4]
cmp r2, r0
bge _08017236
@@ -535,7 +535,7 @@ _08017236:
pop {r0}
bx r0
.align 2, 0
-_0801723C: .4byte gUnknown_2023BCC
+_0801723C: .4byte gBattlersCount
_08017240: .4byte gUnknown_2023BC8
_08017244: .4byte gBitTable
thumb_func_end MarkAllBufferBanksForExecution
@@ -752,7 +752,7 @@ ResetSentPokesToOpponentValue: @ 80173D0
strb r3, [r0]
strb r3, [r0, 0x1]
movs r1, 0
- ldr r0, _08017428 @ =gUnknown_2023BCC
+ ldr r0, _08017428 @ =gBattlersCount
ldrb r2, [r0]
adds r6, r0, 0
cmp r1, r2
@@ -794,7 +794,7 @@ _0801741E:
bx r0
.align 2, 0
_08017424: .4byte gUnknown_2023F4E
-_08017428: .4byte gUnknown_2023BCC
+_08017428: .4byte gBattlersCount
_0801742C: .4byte gBitTable
_08017430: .4byte gBattlerPartyIndexes
thumb_func_end ResetSentPokesToOpponentValue
@@ -808,7 +808,7 @@ sub_8017434: @ 8017434
lsrs r5, r0, 24
movs r4, 0
adds r0, r5, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -822,7 +822,7 @@ sub_8017434: @ 8017434
adds r0, r1
strb r4, [r0]
adds r5, r4, 0
- ldr r0, _080174A8 @ =gUnknown_2023BCC
+ ldr r0, _080174A8 @ =gBattlersCount
ldrb r2, [r0]
mov r8, r1
cmp r4, r2
@@ -861,7 +861,7 @@ _08017498:
bx r0
.align 2, 0
_080174A4: .4byte gUnknown_2023F4E
-_080174A8: .4byte gUnknown_2023BCC
+_080174A8: .4byte gBattlersCount
_080174AC: .4byte gAbsentBattlerFlags
_080174B0: .4byte gBitTable
_080174B4: .4byte gBattlerPartyIndexes
@@ -873,7 +873,7 @@ sub_80174B8: @ 80174B8
lsls r0, 24
lsrs r4, r0, 24
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -883,7 +883,7 @@ sub_80174B8: @ 80174B8
b _0801750A
_080174D4:
movs r3, 0x1
- ldr r5, _08017510 @ =gUnknown_2023BCC
+ ldr r5, _08017510 @ =gBattlersCount
ldrb r0, [r5]
cmp r3, r0
bge _0801750A
@@ -915,7 +915,7 @@ _0801750A:
pop {r0}
bx r0
.align 2, 0
-_08017510: .4byte gUnknown_2023BCC
+_08017510: .4byte gBattlersCount
_08017514: .4byte gUnknown_2023F4E
_08017518: .4byte gBitTable
_0801751C: .4byte gBattlerPartyIndexes
@@ -1124,7 +1124,7 @@ _0801768E:
ldrh r0, [r1, 0x2E]
cmp r0, 0xAF
bne _080176E8
- ldr r1, _080176E4 @ =gUnknown_2023F54
+ ldr r1, _080176E4 @ =gEnigmaBerries
lsls r0, r2, 3
subs r0, r2
lsls r0, 2
@@ -1146,14 +1146,14 @@ _080176D4: .4byte gUnknown_81D8EB7
_080176D8: .4byte gBattleMoves
_080176DC: .4byte gUnknown_81D8EC6
_080176E0: .4byte gUnknown_81D8F9F
-_080176E4: .4byte gUnknown_2023F54
+_080176E4: .4byte gEnigmaBerries
_080176E8:
ldrh r0, [r1, 0x2E]
bl ItemId_GetHoldEffect
lsls r0, 24
lsrs r3, r0, 24
_080176F2:
- ldr r2, _08017774 @ =gUnknown_2023D6F
+ ldr r2, _08017774 @ =gPotentialItemEffectBattler
ldr r1, _08017778 @ =gActiveBattler
ldrb r0, [r1]
strb r0, [r2]
@@ -1221,7 +1221,7 @@ _08017768:
pop {r1}
bx r1
.align 2, 0
-_08017774: .4byte gUnknown_2023D6F
+_08017774: .4byte gPotentialItemEffectBattler
_08017778: .4byte gActiveBattler
_0801777C: .4byte gBattleMons
_08017780: .4byte 0x0000ffff
@@ -1260,7 +1260,7 @@ CheckMoveLimitations: @ 801779C
ldrh r0, [r1, 0x2E]
cmp r0, 0xAF
bne _080177EC
- ldr r2, _080177E8 @ =gUnknown_2023F54
+ ldr r2, _080177E8 @ =gEnigmaBerries
lsls r1, r7, 3
subs r0, r1, r7
lsls r0, 2
@@ -1271,7 +1271,7 @@ CheckMoveLimitations: @ 801779C
.align 2, 0
_080177E0: .4byte gBattleStruct
_080177E4: .4byte gBattleMons
-_080177E8: .4byte gUnknown_2023F54
+_080177E8: .4byte gEnigmaBerries
_080177EC:
ldrh r0, [r1, 0x2E]
str r3, [sp, 0x14]
@@ -1282,7 +1282,7 @@ _080177EC:
lsls r1, r7, 3
ldr r3, [sp, 0x14]
_080177FE:
- ldr r0, _08017978 @ =gUnknown_2023D6F
+ ldr r0, _08017978 @ =gPotentialItemEffectBattler
strb r7, [r0]
movs r0, 0
mov r9, r0
@@ -1481,7 +1481,7 @@ _08017966:
pop {r1}
bx r1
.align 2, 0
-_08017978: .4byte gUnknown_2023D6F
+_08017978: .4byte gPotentialItemEffectBattler
_0801797C: .4byte gDisableStructs
_08017980: .4byte gBattleMons
_08017984: .4byte gUnknown_2023BF0
@@ -1524,7 +1524,7 @@ sub_8017998: @ 8017998
cmp r0, 0
beq _08017A1C
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r4, r0, 0
bl Random
movs r1, 0x1
@@ -1535,7 +1535,7 @@ sub_8017998: @ 8017998
lsls r4, 24
lsrs r4, 24
adds r0, r4, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r2, _08017A18 @ =gUnknown_20233C4
ldrb r1, [r5]
lsls r1, 9
@@ -1551,12 +1551,12 @@ _08017A14: .4byte gBattleTypeFlags
_08017A18: .4byte gUnknown_20233C4
_08017A1C:
ldrb r0, [r5]
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x1
eors r0, r1
lsls r0, 24
lsrs r0, 24
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r2, _08017A3C @ =gUnknown_20233C4
ldrb r1, [r5]
lsls r1, 9
@@ -1599,12 +1599,12 @@ GetImprisonedMovesCount: @ 8017A64
lsls r1, 16
lsrs r5, r1, 16
movs r6, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
mov r9, r0
movs r4, 0
- ldr r0, _08017AF8 @ =gUnknown_2023BCC
+ ldr r0, _08017AF8 @ =gBattlersCount
ldrb r0, [r0]
cmp r6, r0
bge _08017AE8
@@ -1613,7 +1613,7 @@ GetImprisonedMovesCount: @ 8017A64
_08017A8E:
lsls r0, r4, 24
lsrs r0, 24
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
adds r3, r4, 0x1
@@ -1654,7 +1654,7 @@ _08017AD4:
lsrs r6, r0, 24
_08017ADE:
adds r4, r3, 0
- ldr r0, _08017AF8 @ =gUnknown_2023BCC
+ ldr r0, _08017AF8 @ =gBattlersCount
ldrb r0, [r0]
cmp r4, r0
blt _08017A8E
@@ -1667,7 +1667,7 @@ _08017AE8:
pop {r1}
bx r1
.align 2, 0
-_08017AF8: .4byte gUnknown_2023BCC
+_08017AF8: .4byte gBattlersCount
_08017AFC: .4byte gUnknown_2023BF0
_08017B00: .4byte gStatuses3
thumb_func_end GetImprisonedMovesCount
@@ -1684,7 +1684,7 @@ UpdateTurnCounters: @ 8017B04
ldr r1, _08017BA8 @ =sBattler_AI
mov r2, r9
strb r2, [r1]
- ldr r0, _08017BAC @ =gUnknown_2023BCC
+ ldr r0, _08017BAC @ =gBattlersCount
ldrb r4, [r0]
adds r6, r1, 0
mov r10, r0
@@ -1763,7 +1763,7 @@ _08017B9E:
mov pc, r0
.align 2, 0
_08017BA8: .4byte sBattler_AI
-_08017BAC: .4byte gUnknown_2023BCC
+_08017BAC: .4byte gBattlersCount
_08017BB0: .4byte gBattlerTarget
_08017BB4: .4byte gBattleStruct
_08017BB8: .4byte gAbsentBattlerFlags
@@ -1784,7 +1784,7 @@ _08017BC4:
.4byte _08018220
_08017BF0:
movs r5, 0
- ldr r1, _08017C10 @ =gUnknown_2023BCC
+ ldr r1, _08017C10 @ =gBattlersCount
mov r10, r1
ldrb r2, [r1]
cmp r5, r2
@@ -1801,7 +1801,7 @@ _08017C0A:
movs r5, 0
b _08017C58
.align 2, 0
-_08017C10: .4byte gUnknown_2023BCC
+_08017C10: .4byte gBattlersCount
_08017C14: .4byte gUnknown_2023BDE
_08017C18:
adds r4, r5, 0x1
@@ -1810,7 +1810,7 @@ _08017C18:
cmp r6, r1
bge _08017C56
ldr r7, _08017D14 @ =gUnknown_2023BDE
- ldr r0, _08017D18 @ =gUnknown_2023BCC
+ ldr r0, _08017D18 @ =gBattlersCount
mov r10, r0
lsls r1, r5, 24
mov r8, r1
@@ -1831,7 +1831,7 @@ _08017C2C:
bl SwapTurnOrder
_08017C4C:
adds r4, 0x1
- ldr r0, _08017D18 @ =gUnknown_2023BCC
+ ldr r0, _08017D18 @ =gBattlersCount
ldrb r0, [r0]
cmp r4, r0
blt _08017C2C
@@ -1866,12 +1866,12 @@ _08017C84:
mov r8, r3
movs r7, 0
ldr r6, _08017D24 @ =sBattler_AI
- ldr r5, _08017D28 @ =gUnknown_2022AB8
+ ldr r5, _08017D28 @ =gBattleTextBuff1
_08017C8E:
ldr r0, [r1]
adds r0, 0xDB
ldrb r4, [r0]
- ldr r2, _08017D2C @ =gUnknown_2023DE4
+ ldr r2, _08017D2C @ =gSideTimers
lsls r1, r4, 1
adds r0, r1, r4
lsls r0, 2
@@ -1938,12 +1938,12 @@ _08017D06:
b _08017F60
.align 2, 0
_08017D14: .4byte gUnknown_2023BDE
-_08017D18: .4byte gUnknown_2023BCC
+_08017D18: .4byte gBattlersCount
_08017D1C: .4byte gBattleStruct
_08017D20: .4byte gActiveBattler
_08017D24: .4byte sBattler_AI
-_08017D28: .4byte gUnknown_2022AB8
-_08017D2C: .4byte gUnknown_2023DE4
+_08017D28: .4byte gBattleTextBuff1
+_08017D2C: .4byte gSideTimers
_08017D30: .4byte gSideAffecting
_08017D34: .4byte 0x0000fffe
_08017D38: .4byte gUnknown_81D8B32
@@ -1961,12 +1961,12 @@ _08017D4A:
movs r2, 0
mov r8, r2
ldr r7, _08017DE4 @ =sBattler_AI
- ldr r5, _08017DE8 @ =gUnknown_2022AB8
+ ldr r5, _08017DE8 @ =gBattleTextBuff1
_08017D56:
ldr r0, [r1]
adds r0, 0xDB
ldrb r4, [r0]
- ldr r2, _08017DEC @ =gUnknown_2023DE4
+ ldr r2, _08017DEC @ =gSideTimers
lsls r1, r4, 1
adds r0, r1, r4
lsls r0, 2
@@ -2036,8 +2036,8 @@ _08017DD4:
b _08017EA4
.align 2, 0
_08017DE4: .4byte sBattler_AI
-_08017DE8: .4byte gUnknown_2022AB8
-_08017DEC: .4byte gUnknown_2023DE4
+_08017DE8: .4byte gBattleTextBuff1
+_08017DEC: .4byte gSideTimers
_08017DF0: .4byte gActiveBattler
_08017DF4: .4byte gSideAffecting
_08017DF8: .4byte 0x0000fffd
@@ -2056,12 +2056,12 @@ _08017E08:
movs r2, 0
mov r8, r2
ldr r7, _08017EC4 @ =sBattler_AI
- ldr r5, _08017EC8 @ =gUnknown_2022AB8
+ ldr r5, _08017EC8 @ =gBattleTextBuff1
_08017E20:
ldr r0, [r1]
adds r0, 0xDB
ldrb r4, [r0]
- ldr r1, _08017ECC @ =gUnknown_2023DE4
+ ldr r1, _08017ECC @ =gSideTimers
lsls r3, r4, 1
adds r0, r3, r4
lsls r0, 2
@@ -2143,8 +2143,8 @@ _08017EAC:
.align 2, 0
_08017EC0: .4byte gActiveBattler
_08017EC4: .4byte sBattler_AI
-_08017EC8: .4byte gUnknown_2022AB8
-_08017ECC: .4byte gUnknown_2023DE4
+_08017EC8: .4byte gBattleTextBuff1
+_08017ECC: .4byte gSideTimers
_08017ED0: .4byte gSideAffecting
_08017ED4: .4byte 0x0000feff
_08017ED8: .4byte gUnknown_81D8B32
@@ -2163,7 +2163,7 @@ _08017EF4:
ldr r0, [r1]
adds r0, 0xDB
ldrb r4, [r0]
- ldr r2, _08017F88 @ =gUnknown_2023DE4
+ ldr r2, _08017F88 @ =gSideTimers
lsls r1, r4, 1
adds r0, r1, r4
lsls r0, 2
@@ -2235,7 +2235,7 @@ _08017F68:
.align 2, 0
_08017F80: .4byte gActiveBattler
_08017F84: .4byte sBattler_AI
-_08017F88: .4byte gUnknown_2023DE4
+_08017F88: .4byte gSideTimers
_08017F8C: .4byte gSideAffecting
_08017F90: .4byte 0x0000ffdf
_08017F94: .4byte gUnknown_81D8B43
@@ -2244,7 +2244,7 @@ _08017F9C:
mov r2, r12
ldr r0, [r2]
adds r0, 0xDB
- ldr r1, _08018030 @ =gUnknown_2023BCC
+ ldr r1, _08018030 @ =gBattlersCount
ldrb r0, [r0]
ldrb r1, [r1]
cmp r0, r1
@@ -2302,7 +2302,7 @@ _08017FF8:
_0801800E:
ldr r0, [r2]
adds r0, 0xDB
- ldr r1, _08018030 @ =gUnknown_2023BCC
+ ldr r1, _08018030 @ =gBattlersCount
ldrb r0, [r0]
ldrb r1, [r1]
cmp r0, r1
@@ -2320,7 +2320,7 @@ _08018024:
strb r0, [r1, 0x3]
b _0801822A
.align 2, 0
-_08018030: .4byte gUnknown_2023BCC
+_08018030: .4byte gBattlersCount
_08018034: .4byte gActiveBattler
_08018038: .4byte gUnknown_2023BDE
_0801803C: .4byte gUnknown_2023F20
@@ -2597,7 +2597,7 @@ TurnBasedEffects: @ 8018258
str r0, [r2]
ldr r5, _08018294 @ =gBattleStruct
ldr r2, [r5]
- ldr r0, _08018298 @ =gUnknown_2023BCC
+ ldr r0, _08018298 @ =gBattlersCount
ldrb r1, [r2, 0x1]
adds r7, r5, 0
mov r8, r0
@@ -2611,7 +2611,7 @@ _08018288:
_0801828C: .4byte gUnknown_2023DD0
_08018290: .4byte 0x01000020
_08018294: .4byte gBattleStruct
-_08018298: .4byte gUnknown_2023BCC
+_08018298: .4byte gBattlersCount
_0801829C:
ldr r3, _080182D0 @ =gActiveBattler
ldr r4, _080182D4 @ =sBattler_AI
@@ -2731,7 +2731,7 @@ _080183AC:
movs r0, 0x1
movs r2, 0
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
bne _080183C6
@@ -3099,7 +3099,7 @@ _08018664:
adds r0, r2
ldrb r0, [r0, 0x5]
strb r0, [r1, 0x11]
- ldr r1, _080186E4 @ =gUnknown_2022AB8
+ ldr r1, _080186E4 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x2
@@ -3136,12 +3136,12 @@ _080186D4: .4byte gBattleMons
_080186D8: .4byte 0xffffe000
_080186DC: .4byte gBattleScripting
_080186E0: .4byte gBattleStruct
-_080186E4: .4byte gUnknown_2022AB8
+_080186E4: .4byte gBattleTextBuff1
_080186E8: .4byte gUnknown_2023D74
_080186EC: .4byte gUnknown_81D9124
_080186F0: .4byte gBattleMoveDamage
_080186F4:
- ldr r2, _08018724 @ =gUnknown_2022AB8
+ ldr r2, _08018724 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r2]
movs r0, 0x2
@@ -3167,7 +3167,7 @@ _08018720:
ldr r0, [r1]
b _08018C04
.align 2, 0
-_08018724: .4byte gUnknown_2022AB8
+_08018724: .4byte gBattleTextBuff1
_08018728: .4byte gBattleStruct
_0801872C: .4byte gUnknown_2023D74
_08018730: .4byte gUnknown_81D9136
@@ -3270,7 +3270,7 @@ _080187EE:
bcc _080187CE
_080187FC:
ldr r2, _08018814 @ =sBattler_AI
- ldr r1, _08018818 @ =gUnknown_2023BCC
+ ldr r1, _08018818 @ =gBattlersCount
ldrb r0, [r2]
ldrb r1, [r1]
cmp r0, r1
@@ -3281,7 +3281,7 @@ _080187FC:
.align 2, 0
_08018810: .4byte gBattleMons
_08018814: .4byte sBattler_AI
-_08018818: .4byte gUnknown_2023BCC
+_08018818: .4byte gBattlersCount
_0801881C:
ldr r5, _08018854 @ =gActiveBattler
ldrb r0, [r5]
@@ -3825,7 +3825,7 @@ _08018C4C:
_08018C50:
ldr r5, _08018C88 @ =gBattleStruct
ldr r2, [r5]
- ldr r0, _08018C8C @ =gUnknown_2023BCC
+ ldr r0, _08018C8C @ =gBattlersCount
ldrb r1, [r2, 0x1]
adds r7, r5, 0
mov r8, r0
@@ -3855,7 +3855,7 @@ _08018C78:
bx r1
.align 2, 0
_08018C88: .4byte gBattleStruct
-_08018C8C: .4byte gUnknown_2023BCC
+_08018C8C: .4byte gBattlersCount
_08018C90: .4byte gUnknown_2023DD0
_08018C94: .4byte 0xfeffffdf
thumb_func_end TurnBasedEffects
@@ -3893,7 +3893,7 @@ _08018CD0: .4byte gBattleStruct
_08018CD4:
ldr r2, _08018D20 @ =0x00000181
adds r0, r3, r2
- ldr r1, _08018D24 @ =gUnknown_2023BCC
+ ldr r1, _08018D24 @ =gBattlersCount
ldrb r0, [r0]
mov r8, r1
ldrb r6, [r1]
@@ -3902,7 +3902,7 @@ _08018CD4:
b _08018E16
_08018CE6:
ldr r4, _08018D28 @ =gActiveBattler
- ldr r5, _08018D2C @ =gUnknown_2022AB8
+ ldr r5, _08018D2C @ =gBattleTextBuff1
ldr r6, _08018D30 @ =gUnknown_2023F20
movs r0, 0x8
adds r0, r6
@@ -3933,9 +3933,9 @@ _08018CFC:
b _08018E04
.align 2, 0
_08018D20: .4byte 0x00000181
-_08018D24: .4byte gUnknown_2023BCC
+_08018D24: .4byte gBattlersCount
_08018D28: .4byte gActiveBattler
-_08018D2C: .4byte gUnknown_2022AB8
+_08018D2C: .4byte gBattleTextBuff1
_08018D30: .4byte gUnknown_2023F20
_08018D34: .4byte gBattlerTarget
_08018D38: .4byte gAbsentBattlerFlags
@@ -4059,7 +4059,7 @@ _08018E2C:
ldr r0, [r3]
ldr r2, _08018E7C @ =0x00000181
adds r0, r2
- ldr r1, _08018E80 @ =gUnknown_2023BCC
+ ldr r1, _08018E80 @ =gBattlersCount
ldrb r0, [r0]
mov r8, r1
ldrb r4, [r1]
@@ -4068,7 +4068,7 @@ _08018E2C:
b _08018F68
_08018E42:
ldr r5, _08018E84 @ =gActiveBattler
- ldr r4, _08018E88 @ =gUnknown_2022AB8
+ ldr r4, _08018E88 @ =gBattleTextBuff1
ldr r6, _08018E8C @ =gDisableStructs
mov r12, r6
ldr r0, _08018E90 @ =sBattler_AI
@@ -4099,9 +4099,9 @@ _08018E4E:
b _08018F54
.align 2, 0
_08018E7C: .4byte 0x00000181
-_08018E80: .4byte gUnknown_2023BCC
+_08018E80: .4byte gBattlersCount
_08018E84: .4byte gActiveBattler
-_08018E88: .4byte gUnknown_2022AB8
+_08018E88: .4byte gBattleTextBuff1
_08018E8C: .4byte gDisableStructs
_08018E90: .4byte sBattler_AI
_08018E94: .4byte gUnknown_2023BDE
@@ -4305,7 +4305,7 @@ _0801901C:
adds r0, 0x1
strb r0, [r1]
movs r5, 0
- ldr r0, _080190E8 @ =gUnknown_2023BCC
+ ldr r0, _080190E8 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
bge _0801906E
@@ -4332,7 +4332,7 @@ _0801903C:
strb r0, [r6]
_08019064:
adds r5, 0x1
- ldr r0, _080190E8 @ =gUnknown_2023BCC
+ ldr r0, _080190E8 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
blt _0801903C
@@ -4388,7 +4388,7 @@ _080190C6:
ldrb r1, [r0]
adds r1, 0x1
strb r1, [r0]
- ldr r0, _080190E8 @ =gUnknown_2023BCC
+ ldr r0, _080190E8 @ =gBattlersCount
lsls r1, 24
lsrs r1, 24
ldrb r0, [r0]
@@ -4401,7 +4401,7 @@ _080190C6:
strb r1, [r0]
b _08019264
.align 2, 0
-_080190E8: .4byte gUnknown_2023BCC
+_080190E8: .4byte gBattlersCount
_080190EC: .4byte gAbsentBattlerFlags
_080190F0: .4byte gBitTable
_080190F4: .4byte gBattleStruct
@@ -4419,7 +4419,7 @@ _08019108:
ldrb r0, [r1]
adds r0, 0x1
strb r0, [r1]
- ldr r1, _0801913C @ =gUnknown_2023BCC
+ ldr r1, _0801913C @ =gBattlersCount
lsls r0, 24
lsrs r0, 24
ldrb r1, [r1]
@@ -4433,7 +4433,7 @@ _08019108:
.align 2, 0
_08019134: .4byte gUnknown_2023D6D
_08019138: .4byte gBattleStruct
-_0801913C: .4byte gUnknown_2023BCC
+_0801913C: .4byte gBattlersCount
_08019140:
ldr r0, [r2]
adds r0, 0x4D
@@ -4485,7 +4485,7 @@ _0801916A:
_08019198:
adds r0, r3, 0x1
strb r0, [r4]
- ldr r1, _080191C4 @ =gUnknown_2023BCC
+ ldr r1, _080191C4 @ =gBattlersCount
lsls r0, 24
lsrs r0, 24
ldrb r1, [r1]
@@ -4499,7 +4499,7 @@ _080191B4: .4byte gBattleStruct
_080191B8: .4byte gBattleMons
_080191BC: .4byte gBitTable
_080191C0: .4byte gAbsentBattlerFlags
-_080191C4: .4byte gUnknown_2023BCC
+_080191C4: .4byte gBattlersCount
_080191C8:
mov r1, r8
ldr r0, [r1]
@@ -4507,7 +4507,7 @@ _080191C8:
ldrb r1, [r0]
adds r1, 0x1
strb r1, [r0]
- ldr r0, _080191EC @ =gUnknown_2023BCC
+ ldr r0, _080191EC @ =gBattlersCount
lsls r1, 24
lsrs r1, 24
ldrb r0, [r0]
@@ -4521,7 +4521,7 @@ _080191E0:
strb r1, [r0]
b _08019264
.align 2, 0
-_080191EC: .4byte gUnknown_2023BCC
+_080191EC: .4byte gBattlersCount
_080191F0:
mov r1, r8
ldr r0, [r1]
@@ -4536,7 +4536,7 @@ _080191FC:
movs r1, 0
movs r2, 0
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r0, 24
cmp r0, 0
@@ -4548,7 +4548,7 @@ _08019216:
movs r1, 0
movs r2, 0
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
beq _0801922C
@@ -4569,7 +4569,7 @@ _08019240:
movs r1, 0
movs r2, 0
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
beq _08019256
@@ -4608,7 +4608,7 @@ _08019280: .4byte gBattleStruct
TryClearRageStatuses: @ 8019284
push {r4-r6,lr}
movs r3, 0
- ldr r0, _080192C4 @ =gUnknown_2023BCC
+ ldr r0, _080192C4 @ =gBattlersCount
adds r5, r0, 0
ldrb r0, [r5]
cmp r3, r0
@@ -4641,7 +4641,7 @@ _080192BC:
pop {r0}
bx r0
.align 2, 0
-_080192C4: .4byte gUnknown_2023BCC
+_080192C4: .4byte gBattlersCount
_080192C8: .4byte gUnknown_2023DC4
_080192CC: .4byte gUnknown_2023C34
_080192D0: .4byte 0xff7fffff
@@ -5315,7 +5315,7 @@ _08019868:
adds r0, r1, 0
movs r2, 0x1
movs r3, 0
- bl sub_803ECEC
+ bl CalculateBaseDamage
ldr r1, _080198C0 @ =gBattleMoveDamage
str r0, [r1]
ldr r0, _080198C4 @ =gUnknown_2023E8C
@@ -5432,7 +5432,7 @@ _08019974:
_08019988:
ldr r0, _080199A0 @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _080199AC
@@ -5765,7 +5765,7 @@ _08019C40:
lsls r0, 24
lsrs r7, r0, 24
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
ldr r1, _08019CC4 @ =gEnemyParty
mov r8, r1
@@ -5826,17 +5826,17 @@ _08019CC4: .4byte gEnemyParty
_08019CC8: .4byte gPlayerParty
_08019CCC:
adds r0, r3, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
bne _08019CF8
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r7, r0, 24
movs r0, 0x3
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r6, r0, 24
ldr r0, _08019CF4 @ =gEnemyParty
@@ -5846,11 +5846,11 @@ _08019CCC:
_08019CF4: .4byte gEnemyParty
_08019CF8:
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r7, r0, 24
movs r0, 0x2
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r6, r0, 24
ldr r1, _08019DA0 @ =gPlayerParty
@@ -5964,7 +5964,7 @@ sub_8019DAC: @ 8019DAC
movs r1, 0
movs r2, 0xD
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
bne _08019DFE
@@ -5973,7 +5973,7 @@ sub_8019DAC: @ 8019DAC
movs r1, 0
movs r2, 0x4D
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
beq _08019E24
@@ -6002,7 +6002,7 @@ _08019E24:
movs r1, 0
movs r2, 0xD
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r0, 24
cmp r0, 0
@@ -6012,7 +6012,7 @@ _08019E24:
movs r1, 0
movs r2, 0x4D
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
beq _08019E54
@@ -6124,8 +6124,8 @@ _08019F10: .4byte gBattleWeather
_08019F14: .4byte gBattleMons
thumb_func_end sub_8019DAC
- thumb_func_start sub_8019F18
-sub_8019F18: @ 8019F18
+ thumb_func_start AbilityBattleEffects
+AbilityBattleEffects: @ 8019F18
push {r4-r7,lr}
mov r7, r10
mov r6, r9
@@ -6149,7 +6149,7 @@ sub_8019F18: @ 8019F18
movs r0, 0
mov r9, r0
ldr r5, _08019F74 @ =sBattler_AI
- ldr r1, _08019F78 @ =gUnknown_2023BCC
+ ldr r1, _08019F78 @ =gBattlersCount
ldrb r0, [r5]
ldrb r1, [r1]
cmp r0, r1
@@ -6158,7 +6158,7 @@ sub_8019F18: @ 8019F18
strb r1, [r5]
_08019F54:
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08019F84
@@ -6173,7 +6173,7 @@ _08019F54:
b _08019F94
.align 2, 0
_08019F74: .4byte sBattler_AI
-_08019F78: .4byte gUnknown_2023BCC
+_08019F78: .4byte gBattlersCount
_08019F7C: .4byte gBattlerPartyIndexes
_08019F80: .4byte gPlayerParty
_08019F84:
@@ -6188,7 +6188,7 @@ _08019F84:
_08019F94:
adds r6, r1, r0
ldr r5, _08019FCC @ =gBattlerTarget
- ldr r1, _08019FD0 @ =gUnknown_2023BCC
+ ldr r1, _08019FD0 @ =gBattlersCount
ldrb r0, [r5]
ldrb r1, [r1]
cmp r0, r1
@@ -6197,7 +6197,7 @@ _08019F94:
strb r2, [r5]
_08019FA6:
ldrb r0, [r5]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08019FD8
@@ -6214,7 +6214,7 @@ _08019FA6:
_08019FC4: .4byte gBattlerPartyIndexes
_08019FC8: .4byte gEnemyParty
_08019FCC: .4byte gBattlerTarget
-_08019FD0: .4byte gUnknown_2023BCC
+_08019FD0: .4byte gBattlersCount
_08019FD4: .4byte gPlayerParty
_08019FD8:
ldr r1, _0801A038 @ =gBattlerPartyIndexes
@@ -6258,7 +6258,7 @@ _0801A02A:
mov r3, r8
cmp r3, 0
beq _0801A048
- ldr r0, _0801A044 @ =gUnknown_2023D6A
+ ldr r0, _0801A044 @ =gLastUsedAbility
strb r3, [r0]
mov r8, r0
b _0801A05E
@@ -6266,9 +6266,9 @@ _0801A02A:
_0801A038: .4byte gBattlerPartyIndexes
_0801A03C: .4byte gEnemyParty
_0801A040: .4byte gBattleTypeFlags
-_0801A044: .4byte gUnknown_2023D6A
+_0801A044: .4byte gLastUsedAbility
_0801A048:
- ldr r2, _0801A078 @ =gUnknown_2023D6A
+ ldr r2, _0801A078 @ =gLastUsedAbility
ldr r1, _0801A07C @ =gBattleMons
movs r0, 0x58
mov r3, r10
@@ -6295,7 +6295,7 @@ _0801A066:
ands r5, r0
b _0801A094
.align 2, 0
-_0801A078: .4byte gUnknown_2023D6A
+_0801A078: .4byte gLastUsedAbility
_0801A07C: .4byte gBattleMons
_0801A080: .4byte gCurrentMove
_0801A084: .4byte gBattleStruct
@@ -6364,7 +6364,7 @@ _0801A0DC:
.4byte _0801B8B4
_0801A12C:
ldr r2, _0801A160 @ =sBattler_AI
- ldr r0, _0801A164 @ =gUnknown_2023BCC
+ ldr r0, _0801A164 @ =gBattlersCount
ldrb r1, [r2]
adds r3, r0, 0
ldrb r4, [r3]
@@ -6394,7 +6394,7 @@ _0801A15C:
bl _0801BBAA
.align 2, 0
_0801A160: .4byte sBattler_AI
-_0801A164: .4byte gUnknown_2023BCC
+_0801A164: .4byte gBattlersCount
_0801A168:
cmp r0, 0x16
bne _0801A16E
@@ -6681,13 +6681,13 @@ _0801A3C8:
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
- ldr r0, _0801A3DC @ =gUnknown_2023BCC
+ ldr r0, _0801A3DC @ =gBattlersCount
ldrb r0, [r0]
cmp r4, r0
bcc _0801A3B4
bl _0801BBAA
.align 2, 0
-_0801A3DC: .4byte gUnknown_2023BCC
+_0801A3DC: .4byte gBattlersCount
_0801A3E0:
ldr r7, _0801A410 @ =gBattleMons
movs r0, 0x58
@@ -6731,7 +6731,7 @@ _0801A426:
movs r1, 0
movs r2, 0xD
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
lsrs r0, 24
cmp r0, 0
@@ -6743,7 +6743,7 @@ _0801A442:
movs r1, 0
movs r2, 0x4D
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
beq _0801A45A
@@ -6809,7 +6809,7 @@ _0801A4D2:
ands r0, r1
cmp r0, 0
beq _0801A4E4
- ldr r0, _0801A564 @ =gUnknown_2022AB8
+ ldr r0, _0801A564 @ =gBattleTextBuff1
ldr r1, _0801A568 @ =gUnknown_8250094
bl StringCopy
_0801A4E4:
@@ -6818,7 +6818,7 @@ _0801A4E4:
ands r0, r1
cmp r0, 0
beq _0801A4F6
- ldr r0, _0801A564 @ =gUnknown_2022AB8
+ ldr r0, _0801A564 @ =gBattleTextBuff1
ldr r1, _0801A56C @ =gUnknown_825009C
bl StringCopy
_0801A4F6:
@@ -6827,7 +6827,7 @@ _0801A4F6:
ands r0, r1
cmp r0, 0
beq _0801A508
- ldr r0, _0801A564 @ =gUnknown_2022AB8
+ ldr r0, _0801A564 @ =gBattleTextBuff1
ldr r1, _0801A570 @ =gUnknown_82500A4
bl StringCopy
_0801A508:
@@ -6836,7 +6836,7 @@ _0801A508:
ands r0, r1
cmp r0, 0
beq _0801A51A
- ldr r0, _0801A564 @ =gUnknown_2022AB8
+ ldr r0, _0801A564 @ =gBattleTextBuff1
ldr r1, _0801A574 @ =gUnknown_82500AC
bl StringCopy
_0801A51A:
@@ -6845,7 +6845,7 @@ _0801A51A:
ands r0, r1
cmp r0, 0
beq _0801A52C
- ldr r0, _0801A564 @ =gUnknown_2022AB8
+ ldr r0, _0801A564 @ =gBattleTextBuff1
ldr r1, _0801A578 @ =gUnknown_82500B4
bl StringCopy
_0801A52C:
@@ -6874,7 +6874,7 @@ _0801A52C:
bl MarkBufferBankForExecution
bl _0801BB5A
.align 2, 0
-_0801A564: .4byte gUnknown_2022AB8
+_0801A564: .4byte gBattleTextBuff1
_0801A568: .4byte gUnknown_8250094
_0801A56C: .4byte gUnknown_825009C
_0801A570: .4byte gUnknown_82500A4
@@ -7407,7 +7407,7 @@ _0801AA10:
_0801AA1A:
strb r5, [r3]
strb r5, [r2]
- ldr r1, _0801AA50 @ =gUnknown_2022AB8
+ ldr r1, _0801AA50 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x3
@@ -7426,7 +7426,7 @@ _0801AA40: .4byte gBattleMoves
_0801AA44: .4byte gUnknown_2023ECC
_0801AA48: .4byte gBattlerTarget
_0801AA4C: .4byte gBattleMons
-_0801AA50: .4byte gUnknown_2022AB8
+_0801AA50: .4byte gBattleTextBuff1
_0801AA54: .4byte gUnknown_2023D74
_0801AA58: .4byte gUnknown_81D949C
_0801AA5C:
@@ -8085,7 +8085,7 @@ _0801B00C: .4byte gUnknown_81D94BE
_0801B010:
movs r4, 0
mov r10, r4
- ldr r0, _0801B044 @ =gUnknown_2023BCC
+ ldr r0, _0801B044 @ =gBattlersCount
ldrb r0, [r0]
cmp r10, r0
bcc _0801B020
@@ -8111,7 +8111,7 @@ _0801B03A:
ldr r0, [r0]
mov pc, r0
.align 2, 0
-_0801B044: .4byte gUnknown_2023BCC
+_0801B044: .4byte gBattlersCount
_0801B048: .4byte gBattleMons
_0801B04C: .4byte _0801B050
.align 2, 0
@@ -8197,12 +8197,12 @@ _0801B158:
bne _0801B172
b _0801B29E
_0801B172:
- ldr r0, _0801B17C @ =gUnknown_2022AB8
+ ldr r0, _0801B17C @ =gBattleTextBuff1
ldr r1, _0801B180 @ =gUnknown_8250094
b _0801B264
.align 2, 0
_0801B178: .4byte 0x00000f88
-_0801B17C: .4byte gUnknown_2022AB8
+_0801B17C: .4byte gBattleTextBuff1
_0801B180: .4byte gUnknown_8250094
_0801B184:
movs r0, 0x58
@@ -8219,14 +8219,14 @@ _0801B184:
bne _0801B19E
b _0801B29E
_0801B19E:
- ldr r0, _0801B1AC @ =gUnknown_2022AB8
+ ldr r0, _0801B1AC @ =gBattleTextBuff1
ldr r1, _0801B1B0 @ =gUnknown_82500BC
bl StringCopy
movs r2, 0x2
mov r9, r2
b _0801B2A4
.align 2, 0
-_0801B1AC: .4byte gUnknown_2022AB8
+_0801B1AC: .4byte gBattleTextBuff1
_0801B1B0: .4byte gUnknown_82500BC
_0801B1B4:
movs r0, 0x58
@@ -8241,11 +8241,11 @@ _0801B1B4:
ands r0, r1
cmp r0, 0
beq _0801B29E
- ldr r0, _0801B1D4 @ =gUnknown_2022AB8
+ ldr r0, _0801B1D4 @ =gBattleTextBuff1
ldr r1, _0801B1D8 @ =gUnknown_82500A4
b _0801B264
.align 2, 0
-_0801B1D4: .4byte gUnknown_2022AB8
+_0801B1D4: .4byte gBattleTextBuff1
_0801B1D8: .4byte gUnknown_82500A4
_0801B1DC:
movs r0, 0x58
@@ -8265,7 +8265,7 @@ _0801B1DC:
ldr r1, _0801B20C @ =0xf7ffffff
ands r0, r1
str r0, [r2]
- ldr r0, _0801B210 @ =gUnknown_2022AB8
+ ldr r0, _0801B210 @ =gBattleTextBuff1
ldr r1, _0801B214 @ =gUnknown_825009C
bl StringCopy
movs r0, 0x1
@@ -8273,7 +8273,7 @@ _0801B1DC:
b _0801B2A4
.align 2, 0
_0801B20C: .4byte 0xf7ffffff
-_0801B210: .4byte gUnknown_2022AB8
+_0801B210: .4byte gBattleTextBuff1
_0801B214: .4byte gUnknown_825009C
_0801B218:
movs r0, 0x58
@@ -8288,14 +8288,14 @@ _0801B218:
ands r0, r1
cmp r0, 0
beq _0801B29E
- ldr r0, _0801B240 @ =gUnknown_2022AB8
+ ldr r0, _0801B240 @ =gBattleTextBuff1
ldr r1, _0801B244 @ =gUnknown_82500AC
bl StringCopy
movs r2, 0x1
mov r9, r2
b _0801B2A4
.align 2, 0
-_0801B240: .4byte gUnknown_2022AB8
+_0801B240: .4byte gBattleTextBuff1
_0801B244: .4byte gUnknown_82500AC
_0801B248:
movs r0, 0x58
@@ -8310,7 +8310,7 @@ _0801B248:
ands r0, r1
cmp r0, 0
beq _0801B29E
- ldr r0, _0801B270 @ =gUnknown_2022AB8
+ ldr r0, _0801B270 @ =gBattleTextBuff1
ldr r1, _0801B274 @ =gUnknown_82500B4
_0801B264:
bl StringCopy
@@ -8318,7 +8318,7 @@ _0801B264:
mov r9, r4
b _0801B2A4
.align 2, 0
-_0801B270: .4byte gUnknown_2022AB8
+_0801B270: .4byte gBattleTextBuff1
_0801B274: .4byte gUnknown_82500B4
_0801B278:
movs r0, 0x58
@@ -8334,7 +8334,7 @@ _0801B278:
ands r0, r1
cmp r0, 0
beq _0801B29E
- ldr r0, _0801B2B4 @ =gUnknown_2022AB8
+ ldr r0, _0801B2B4 @ =gBattleTextBuff1
ldr r1, _0801B2B8 @ =gUnknown_82500C4
bl StringCopy
movs r2, 0x3
@@ -8353,7 +8353,7 @@ _0801B2A4:
beq _0801B2C4
b _0801B304
.align 2, 0
-_0801B2B4: .4byte gUnknown_2022AB8
+_0801B2B4: .4byte gBattleTextBuff1
_0801B2B8: .4byte gUnknown_82500C4
_0801B2BC:
mov r0, r9
@@ -8435,7 +8435,7 @@ _0801B358:
lsls r0, 24
lsrs r0, 24
mov r10, r0
- ldr r0, _0801B370 @ =gUnknown_2023BCC
+ ldr r0, _0801B370 @ =gBattlersCount
ldrb r0, [r0]
cmp r10, r0
bcs _0801B36C
@@ -8443,11 +8443,11 @@ _0801B358:
_0801B36C:
bl _0801BBAA
.align 2, 0
-_0801B370: .4byte gUnknown_2023BCC
+_0801B370: .4byte gBattlersCount
_0801B374:
movs r2, 0
mov r10, r2
- ldr r0, _0801B3C0 @ =gUnknown_2023BCC
+ ldr r0, _0801B3C0 @ =gBattlersCount
ldrb r0, [r0]
cmp r10, r0
bcc _0801B384
@@ -8478,13 +8478,13 @@ _0801B3AA:
lsls r0, 24
lsrs r0, 24
mov r10, r0
- ldr r0, _0801B3C0 @ =gUnknown_2023BCC
+ ldr r0, _0801B3C0 @ =gBattlersCount
ldrb r0, [r0]
cmp r10, r0
bcc _0801B386
bl _0801BBAA
.align 2, 0
-_0801B3C0: .4byte gUnknown_2023BCC
+_0801B3C0: .4byte gBattlersCount
_0801B3C4: .4byte gBattleMons
_0801B3C8:
mov r4, r8
@@ -8612,7 +8612,7 @@ _0801B4CC: .4byte gUnknown_2023D74
_0801B4D0: .4byte gUnknown_81D94CE
_0801B4D4:
movs r5, 0
- ldr r0, _0801B50C @ =gUnknown_2023BCC
+ ldr r0, _0801B50C @ =gBattlersCount
ldrb r1, [r0]
cmp r5, r1
blt _0801B4E0
@@ -8642,12 +8642,12 @@ _0801B4FE:
blt _0801B4EE
b _0801BBAA
.align 2, 0
-_0801B50C: .4byte gUnknown_2023BCC
+_0801B50C: .4byte gBattlersCount
_0801B510: .4byte gBattleMons
_0801B514: .4byte gStatuses3
_0801B518:
movs r5, 0
- ldr r0, _0801B5F4 @ =gUnknown_2023BCC
+ ldr r0, _0801B5F4 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
blt _0801B524
@@ -8681,17 +8681,17 @@ _0801B53C:
_0801B552:
lsls r0, r5, 24
lsrs r0, 24
- bl GetBankIdentity
+ bl GetBattlerPosition
movs r1, 0x1
adds r6, r0, 0
eors r6, r1
ands r6, r1
adds r0, r6, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r4, r0, 24
adds r0, r6, 0x2
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r7, r0, 24
ldr r0, _0801B604 @ =gBattleTypeFlags
@@ -8735,7 +8735,7 @@ _0801B584:
lsls r1, 1
orrs r6, r1
adds r0, r6, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
mov r2, r8
strb r0, [r2]
ldrb r0, [r2]
@@ -8752,16 +8752,16 @@ _0801B584:
adds r0, r4
adds r0, 0x20
ldrb r0, [r0]
- ldr r2, _0801B608 @ =gUnknown_2023D6A
+ ldr r2, _0801B608 @ =gLastUsedAbility
strb r0, [r2]
b _0801B6C4
.align 2, 0
-_0801B5F4: .4byte gUnknown_2023BCC
+_0801B5F4: .4byte gBattlersCount
_0801B5F8: .4byte gActiveBattler
_0801B5FC: .4byte gBattleMons
_0801B600: .4byte gStatuses3
_0801B604: .4byte gBattleTypeFlags
-_0801B608: .4byte gUnknown_2023D6A
+_0801B608: .4byte gLastUsedAbility
_0801B60C:
ldr r3, _0801B650 @ =gBattleMons
movs r2, 0x58
@@ -8794,12 +8794,12 @@ _0801B60C:
adds r0, r3
adds r0, 0x20
ldrb r0, [r0]
- ldr r2, _0801B654 @ =gUnknown_2023D6A
+ ldr r2, _0801B654 @ =gLastUsedAbility
strb r0, [r2]
b _0801B6C4
.align 2, 0
_0801B650: .4byte gBattleMons
-_0801B654: .4byte gUnknown_2023D6A
+_0801B654: .4byte gLastUsedAbility
_0801B658:
ldr r3, _0801B698 @ =gBattleMons
movs r2, 0x58
@@ -8854,7 +8854,7 @@ _0801B69C:
strb r1, [r0]
ldrb r0, [r2]
_0801B6C0:
- ldr r1, _0801B6F4 @ =gUnknown_2023D6A
+ ldr r1, _0801B6F4 @ =gLastUsedAbility
strb r0, [r1]
_0801B6C4:
mov r0, r9
@@ -8875,7 +8875,7 @@ _0801B6D6:
adds r4, 0x4
str r4, [sp, 0x20]
adds r5, 0x1
- ldr r0, _0801B6F8 @ =gUnknown_2023BCC
+ ldr r0, _0801B6F8 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
bge _0801B6EE
@@ -8884,11 +8884,11 @@ _0801B6EE:
b _0801BBAA
.align 2, 0
_0801B6F0: .4byte gBattleMons
-_0801B6F4: .4byte gUnknown_2023D6A
-_0801B6F8: .4byte gUnknown_2023BCC
+_0801B6F4: .4byte gLastUsedAbility
+_0801B6F8: .4byte gBattlersCount
_0801B6FC:
movs r5, 0
- ldr r0, _0801B734 @ =gUnknown_2023BCC
+ ldr r0, _0801B734 @ =gBattlersCount
ldrb r1, [r0]
cmp r5, r1
blt _0801B708
@@ -8918,16 +8918,16 @@ _0801B726:
blt _0801B716
b _0801BBAA
.align 2, 0
-_0801B734: .4byte gUnknown_2023BCC
+_0801B734: .4byte gBattlersCount
_0801B738: .4byte gBattleMons
_0801B73C: .4byte gStatuses3
_0801B740:
mov r0, r10
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r6, r0, 24
movs r5, 0
- ldr r0, _0801B790 @ =gUnknown_2023BCC
+ ldr r0, _0801B790 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
blt _0801B756
@@ -8938,7 +8938,7 @@ _0801B756:
_0801B75A:
lsls r0, r5, 24
lsrs r0, 24
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
adds r4, r5, 0x1
@@ -8951,29 +8951,29 @@ _0801B75A:
ldrb r0, [r0]
cmp r0, r7
bne _0801B784
- ldr r0, _0801B798 @ =gUnknown_2023D6A
+ ldr r0, _0801B798 @ =gLastUsedAbility
strb r7, [r0]
lsls r0, r4, 24
lsrs r0, 24
mov r9, r0
_0801B784:
adds r5, r4, 0
- ldr r0, _0801B790 @ =gUnknown_2023BCC
+ ldr r0, _0801B790 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
blt _0801B75A
b _0801BBAA
.align 2, 0
-_0801B790: .4byte gUnknown_2023BCC
+_0801B790: .4byte gBattlersCount
_0801B794: .4byte gBattleMons
-_0801B798: .4byte gUnknown_2023D6A
+_0801B798: .4byte gLastUsedAbility
_0801B79C:
mov r0, r10
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r6, r0, 24
movs r5, 0
- ldr r0, _0801B7EC @ =gUnknown_2023BCC
+ ldr r0, _0801B7EC @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
blt _0801B7B2
@@ -8984,7 +8984,7 @@ _0801B7B2:
_0801B7B6:
lsls r0, r5, 24
lsrs r0, 24
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
adds r4, r5, 0x1
@@ -8997,22 +8997,22 @@ _0801B7B6:
ldrb r0, [r0]
cmp r0, r7
bne _0801B7E0
- ldr r0, _0801B7F4 @ =gUnknown_2023D6A
+ ldr r0, _0801B7F4 @ =gLastUsedAbility
strb r7, [r0]
lsls r0, r4, 24
lsrs r0, 24
mov r9, r0
_0801B7E0:
adds r5, r4, 0
- ldr r0, _0801B7EC @ =gUnknown_2023BCC
+ ldr r0, _0801B7EC @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
blt _0801B7B6
b _0801BBAA
.align 2, 0
-_0801B7EC: .4byte gUnknown_2023BCC
+_0801B7EC: .4byte gBattlersCount
_0801B7F0: .4byte gBattleMons
-_0801B7F4: .4byte gUnknown_2023D6A
+_0801B7F4: .4byte gLastUsedAbility
_0801B7F8:
mov r2, r8
ldrb r0, [r2]
@@ -9021,7 +9021,7 @@ _0801B7F8:
cmp r0, 0xFE
beq _0801B858
movs r5, 0
- ldr r0, _0801B818 @ =gUnknown_2023BCC
+ ldr r0, _0801B818 @ =gBattlersCount
adds r3, r0, 0
ldrb r4, [r3]
cmp r5, r4
@@ -9031,11 +9031,11 @@ _0801B812:
ldr r2, _0801B81C @ =gBattleMons
b _0801B890
.align 2, 0
-_0801B818: .4byte gUnknown_2023BCC
+_0801B818: .4byte gBattlersCount
_0801B81C: .4byte gBattleMons
_0801B820:
movs r5, 0
- ldr r0, _0801B850 @ =gUnknown_2023BCC
+ ldr r0, _0801B850 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
blt _0801B82C
@@ -9062,11 +9062,11 @@ _0801B848:
blt _0801B834
b _0801BBAA
.align 2, 0
-_0801B850: .4byte gUnknown_2023BCC
+_0801B850: .4byte gBattlersCount
_0801B854: .4byte gStatuses3
_0801B858:
movs r5, 0
- ldr r0, _0801B888 @ =gUnknown_2023BCC
+ ldr r0, _0801B888 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
blt _0801B864
@@ -9093,7 +9093,7 @@ _0801B880:
blt _0801B86C
b _0801BBAA
.align 2, 0
-_0801B888: .4byte gUnknown_2023BCC
+_0801B888: .4byte gBattlersCount
_0801B88C: .4byte gStatuses3
_0801B890:
movs r0, 0x58
@@ -9117,7 +9117,7 @@ _0801B8AA:
b _0801BBAA
_0801B8B4:
movs r5, 0
- ldr r0, _0801B8F0 @ =gUnknown_2023BCC
+ ldr r0, _0801B8F0 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
blt _0801B8C0
@@ -9150,10 +9150,10 @@ _0801B8E8:
blt _0801B8C6
b _0801BBAA
.align 2, 0
-_0801B8F0: .4byte gUnknown_2023BCC
+_0801B8F0: .4byte gBattlersCount
_0801B8F4: .4byte gBattleMons
_0801B8F8:
- ldr r0, _0801B908 @ =gUnknown_2023D6A
+ ldr r0, _0801B908 @ =gLastUsedAbility
strb r7, [r0]
adds r0, r5, 0x1
lsls r0, 24
@@ -9161,14 +9161,14 @@ _0801B8F8:
mov r9, r0
b _0801B94A
.align 2, 0
-_0801B908: .4byte gUnknown_2023D6A
+_0801B908: .4byte gLastUsedAbility
_0801B90C:
mov r0, r10
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r6, r0, 24
movs r5, 0
- ldr r0, _0801B99C @ =gUnknown_2023BCC
+ ldr r0, _0801B99C @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
bge _0801B94A
@@ -9176,7 +9176,7 @@ _0801B90C:
_0801B922:
lsls r0, r5, 24
lsrs r0, 24
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, r6
@@ -9190,7 +9190,7 @@ _0801B922:
beq _0801B8F8
_0801B940:
adds r5, 0x1
- ldr r0, _0801B99C @ =gUnknown_2023BCC
+ ldr r0, _0801B99C @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
blt _0801B922
@@ -9201,7 +9201,7 @@ _0801B94A:
b _0801BBB0
_0801B952:
movs r5, 0
- ldr r0, _0801B99C @ =gUnknown_2023BCC
+ ldr r0, _0801B99C @ =gBattlersCount
ldrb r0, [r0]
cmp r9, r0
blt _0801B95E
@@ -9220,36 +9220,36 @@ _0801B962:
bne _0801B990
lsls r0, r5, 24
lsrs r0, 24
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, r6
bne _0801B990
cmp r5, r10
beq _0801B990
- ldr r0, _0801B9A4 @ =gUnknown_2023D6A
+ ldr r0, _0801B9A4 @ =gLastUsedAbility
strb r7, [r0]
lsls r0, r4, 24
lsrs r0, 24
mov r9, r0
_0801B990:
adds r5, r4, 0
- ldr r0, _0801B99C @ =gUnknown_2023BCC
+ ldr r0, _0801B99C @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
blt _0801B962
b _0801BBAA
.align 2, 0
-_0801B99C: .4byte gUnknown_2023BCC
+_0801B99C: .4byte gBattlersCount
_0801B9A0: .4byte gBattleMons
-_0801B9A4: .4byte gUnknown_2023D6A
+_0801B9A4: .4byte gLastUsedAbility
_0801B9A8:
mov r0, r10
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r6, r0, 24
movs r5, 0
- ldr r0, _0801B9F8 @ =gUnknown_2023BCC
+ ldr r0, _0801B9F8 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
blt _0801B9BE
@@ -9259,7 +9259,7 @@ _0801B9BE:
_0801B9C0:
lsls r0, r5, 24
lsrs r0, 24
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, r6
@@ -9271,7 +9271,7 @@ _0801B9C0:
ldrb r0, [r0]
cmp r0, r7
bne _0801B9EC
- ldr r0, _0801BA00 @ =gUnknown_2023D6A
+ ldr r0, _0801BA00 @ =gLastUsedAbility
strb r7, [r0]
mov r0, r9
adds r0, 0x1
@@ -9280,22 +9280,22 @@ _0801B9C0:
mov r9, r0
_0801B9EC:
adds r5, 0x1
- ldr r0, _0801B9F8 @ =gUnknown_2023BCC
+ ldr r0, _0801B9F8 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
blt _0801B9C0
b _0801BBAA
.align 2, 0
-_0801B9F8: .4byte gUnknown_2023BCC
+_0801B9F8: .4byte gBattlersCount
_0801B9FC: .4byte gBattleMons
-_0801BA00: .4byte gUnknown_2023D6A
+_0801BA00: .4byte gLastUsedAbility
_0801BA04:
mov r0, r10
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r6, r0, 24
movs r5, 0
- ldr r0, _0801BA54 @ =gUnknown_2023BCC
+ ldr r0, _0801BA54 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
blt _0801BA1A
@@ -9305,7 +9305,7 @@ _0801BA1A:
_0801BA1C:
lsls r0, r5, 24
lsrs r0, 24
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, r6
@@ -9317,7 +9317,7 @@ _0801BA1C:
ldrb r0, [r0]
cmp r0, r7
bne _0801BA48
- ldr r0, _0801BA5C @ =gUnknown_2023D6A
+ ldr r0, _0801BA5C @ =gLastUsedAbility
strb r7, [r0]
mov r0, r9
adds r0, 0x1
@@ -9326,15 +9326,15 @@ _0801BA1C:
mov r9, r0
_0801BA48:
adds r5, 0x1
- ldr r0, _0801BA54 @ =gUnknown_2023BCC
+ ldr r0, _0801BA54 @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
blt _0801BA1C
b _0801BBAA
.align 2, 0
-_0801BA54: .4byte gUnknown_2023BCC
+_0801BA54: .4byte gBattlersCount
_0801BA58: .4byte gBattleMons
-_0801BA5C: .4byte gUnknown_2023D6A
+_0801BA5C: .4byte gLastUsedAbility
_0801BA60:
ldr r0, _0801BA78 @ =gUnknown_81D92F8
bl BattleScriptPushCursorAndCallback
@@ -9394,7 +9394,7 @@ _0801BAC8:
str r0, [r1]
ldr r0, _0801BB24 @ =gBattleScripting
strb r5, [r0, 0x17]
- ldr r1, _0801BB28 @ =gUnknown_2022AB8
+ ldr r1, _0801BB28 @ =gBattleTextBuff1
movs r4, 0xFD
strb r4, [r1]
movs r0, 0x4
@@ -9410,11 +9410,11 @@ _0801BAC8:
strb r0, [r1, 0x3]
movs r0, 0xFF
strb r0, [r1, 0x4]
- ldr r1, _0801BB34 @ =gUnknown_2022AC8
+ ldr r1, _0801BB34 @ =gBattleTextBuff2
strb r4, [r1]
movs r0, 0x9
strb r0, [r1, 0x1]
- ldr r0, _0801BB38 @ =gUnknown_2023D6A
+ ldr r0, _0801BB38 @ =gLastUsedAbility
ldrb r0, [r0]
strb r0, [r1, 0x2]
movs r0, 0x1
@@ -9426,11 +9426,11 @@ _0801BB18: .4byte gUnknown_81D92A1
_0801BB1C: .4byte gStatuses3
_0801BB20: .4byte 0xffefffff
_0801BB24: .4byte gBattleScripting
-_0801BB28: .4byte gUnknown_2022AB8
+_0801BB28: .4byte gBattleTextBuff1
_0801BB2C: .4byte gActiveBattler
_0801BB30: .4byte gBattlerPartyIndexes
-_0801BB34: .4byte gUnknown_2022AC8
-_0801BB38: .4byte gUnknown_2023D6A
+_0801BB34: .4byte gBattleTextBuff2
+_0801BB38: .4byte gLastUsedAbility
_0801BB3C:
mov r3, r8
strb r1, [r3]
@@ -9461,7 +9461,7 @@ _0801BB70: .4byte gUnknown_81D9310
_0801BB74: .4byte gBattleStruct
_0801BB78:
movs r5, 0
- ldr r0, _0801BBD8 @ =gUnknown_2023BCC
+ ldr r0, _0801BBD8 @ =gBattlersCount
ldrb r1, [r0]
cmp r5, r1
bge _0801BBAA
@@ -9469,7 +9469,7 @@ _0801BB78:
adds r2, r1, 0
adds r1, r0, 0
adds r1, 0x20
- ldr r3, _0801BBE0 @ =gUnknown_2023D6A
+ ldr r3, _0801BBE0 @ =gLastUsedAbility
_0801BB8C:
ldrb r0, [r1]
cmp r0, r7
@@ -9495,7 +9495,7 @@ _0801BBB0:
ldr r0, [sp, 0x4]
cmp r0, 0xB
bhi _0801BBC6
- ldr r1, _0801BBE0 @ =gUnknown_2023D6A
+ ldr r1, _0801BBE0 @ =gLastUsedAbility
ldrb r0, [r1]
cmp r0, 0xFF
beq _0801BBC6
@@ -9513,10 +9513,10 @@ _0801BBC6:
pop {r1}
bx r1
.align 2, 0
-_0801BBD8: .4byte gUnknown_2023BCC
+_0801BBD8: .4byte gBattlersCount
_0801BBDC: .4byte gBattleMons
-_0801BBE0: .4byte gUnknown_2023D6A
- thumb_func_end sub_8019F18
+_0801BBE0: .4byte gLastUsedAbility
+ thumb_func_end AbilityBattleEffects
thumb_func_start BattleScriptExecute
BattleScriptExecute: @ 801BBE4
@@ -9615,7 +9615,7 @@ sub_801BC68: @ 801BC68
lsrs r0, 16
cmp r0, 0xAF
bne _0801BCC0
- ldr r1, _0801BCBC @ =gUnknown_2023F54
+ ldr r1, _0801BCBC @ =gEnigmaBerries
lsls r0, r7, 3
subs r0, r7
lsls r0, 2
@@ -9626,7 +9626,7 @@ sub_801BC68: @ 801BC68
.align 2, 0
_0801BCB4: .4byte gUnknown_2023D68
_0801BCB8: .4byte gBattleMons
-_0801BCBC: .4byte gUnknown_2023F54
+_0801BCBC: .4byte gEnigmaBerries
_0801BCC0:
ldrh r0, [r4]
bl ItemId_GetHoldEffect
@@ -9648,7 +9648,7 @@ _0801BCD4:
str r0, [sp, 0x14]
cmp r0, 0xAF
bne _0801BD08
- ldr r1, _0801BD04 @ =gUnknown_2023F54
+ ldr r1, _0801BD04 @ =gEnigmaBerries
lsls r0, r2, 3
subs r0, r2
lsls r0, 2
@@ -9660,7 +9660,7 @@ _0801BCD4:
.align 2, 0
_0801BCFC: .4byte gBattleMons
_0801BD00: .4byte sBattler_AI
-_0801BD04: .4byte gUnknown_2023F54
+_0801BD04: .4byte gEnigmaBerries
_0801BD08:
ldr r0, [sp, 0x14]
bl ItemId_GetHoldEffect
@@ -9758,7 +9758,7 @@ _0801BDB8:
_0801BDD0:
ldr r0, _0801BDF0 @ =gBattleScripting
strb r7, [r0, 0x17]
- ldr r0, _0801BDF4 @ =gUnknown_2023D6F
+ ldr r0, _0801BDF4 @ =gPotentialItemEffectBattler
strb r7, [r0]
ldr r1, _0801BDF8 @ =gActiveBattler
ldr r0, _0801BDFC @ =sBattler_AI
@@ -9770,7 +9770,7 @@ _0801BDD0:
.align 2, 0
_0801BDEC: .4byte gBattleMons
_0801BDF0: .4byte gBattleScripting
-_0801BDF4: .4byte gUnknown_2023D6F
+_0801BDF4: .4byte gPotentialItemEffectBattler
_0801BDF8: .4byte gActiveBattler
_0801BDFC: .4byte sBattler_AI
_0801BE00: .4byte gUnknown_81D95D9
@@ -9886,7 +9886,7 @@ _0801BF2C:
bl _0801C952
_0801BF34:
adds r0, r7, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _0801BF58
@@ -9970,7 +9970,7 @@ _0801BFDC:
add r0, sp, 0x4
strb r1, [r0]
_0801BFE0:
- ldr r1, _0801C020 @ =gUnknown_2022AB8
+ ldr r1, _0801C020 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x2
@@ -9999,7 +9999,7 @@ _0801BFE0:
str r0, [sp, 0xC]
bl _0801C95A
.align 2, 0
-_0801C020: .4byte gUnknown_2022AB8
+_0801C020: .4byte gBattleTextBuff1
_0801C024: .4byte gUnknown_81D960C
_0801C028: .4byte gActiveBattler
_0801C02C:
@@ -10036,7 +10036,7 @@ _0801C04A:
_0801C066:
ldr r0, _0801C084 @ =gBattleScripting
strb r7, [r0, 0x17]
- ldr r0, _0801C088 @ =gUnknown_2023D6F
+ ldr r0, _0801C088 @ =gPotentialItemEffectBattler
strb r7, [r0]
ldr r1, _0801C08C @ =gActiveBattler
ldr r0, _0801C090 @ =sBattler_AI
@@ -10048,7 +10048,7 @@ _0801C066:
.align 2, 0
_0801C080: .4byte gBattleMons
_0801C084: .4byte gBattleScripting
-_0801C088: .4byte gUnknown_2023D6F
+_0801C088: .4byte gPotentialItemEffectBattler
_0801C08C: .4byte gActiveBattler
_0801C090: .4byte sBattler_AI
_0801C094: .4byte gUnknown_81D95D9
@@ -10117,7 +10117,7 @@ _0801C112:
beq _0801C11A
bl _0801C952
_0801C11A:
- ldr r1, _0801C170 @ =gUnknown_2022AB8
+ ldr r1, _0801C170 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x8
@@ -10161,7 +10161,7 @@ _0801C14E:
_0801C16C:
b _0801C30C
.align 2, 0
-_0801C170: .4byte gUnknown_2022AB8
+_0801C170: .4byte gBattleTextBuff1
_0801C174: .4byte gBattleMoveDamage
_0801C178:
movs r0, 0x58
@@ -10180,7 +10180,7 @@ _0801C190:
beq _0801C198
bl _0801C952
_0801C198:
- ldr r1, _0801C1EC @ =gUnknown_2022AB8
+ ldr r1, _0801C1EC @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x8
@@ -10224,7 +10224,7 @@ _0801C1CC:
_0801C1EA:
b _0801C3A0
.align 2, 0
-_0801C1EC: .4byte gUnknown_2022AB8
+_0801C1EC: .4byte gBattleTextBuff1
_0801C1F0: .4byte gBattleMoveDamage
_0801C1F4:
movs r0, 0x58
@@ -10244,7 +10244,7 @@ _0801C20C:
beq _0801C212
b _0801C952
_0801C212:
- ldr r1, _0801C26C @ =gUnknown_2022AB8
+ ldr r1, _0801C26C @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x8
@@ -10289,7 +10289,7 @@ _0801C248:
bl BattleScriptExecute
b _0801C27E
.align 2, 0
-_0801C26C: .4byte gUnknown_2022AB8
+_0801C26C: .4byte gBattleTextBuff1
_0801C270: .4byte gBattleMoveDamage
_0801C274: .4byte gUnknown_81D964F
_0801C278:
@@ -10319,7 +10319,7 @@ _0801C2A0:
beq _0801C2A6
b _0801C952
_0801C2A6:
- ldr r1, _0801C300 @ =gUnknown_2022AB8
+ ldr r1, _0801C300 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x8
@@ -10365,7 +10365,7 @@ _0801C2F8:
bl BattleScriptExecute
b _0801C312
.align 2, 0
-_0801C300: .4byte gUnknown_2022AB8
+_0801C300: .4byte gBattleTextBuff1
_0801C304: .4byte gBattleMoveDamage
_0801C308: .4byte gUnknown_81D964F
_0801C30C:
@@ -10394,7 +10394,7 @@ _0801C332:
beq _0801C338
b _0801C952
_0801C338:
- ldr r1, _0801C394 @ =gUnknown_2022AB8
+ ldr r1, _0801C394 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x8
@@ -10440,7 +10440,7 @@ _0801C38A:
bl BattleScriptExecute
b _0801C3A6
.align 2, 0
-_0801C394: .4byte gUnknown_2022AB8
+_0801C394: .4byte gBattleTextBuff1
_0801C398: .4byte gBattleMoveDamage
_0801C39C: .4byte gUnknown_81D964F
_0801C3A0:
@@ -10475,7 +10475,7 @@ _0801C3CE:
ble _0801C3D8
b _0801C952
_0801C3D8:
- ldr r1, _0801C408 @ =gUnknown_2022AB8
+ ldr r1, _0801C408 @ =gBattleTextBuff1
movs r2, 0xFD
strb r2, [r1]
movs r0, 0x5
@@ -10484,7 +10484,7 @@ _0801C3D8:
strb r0, [r1, 0x2]
movs r0, 0xFF
strb r0, [r1, 0x3]
- ldr r1, _0801C40C @ =gUnknown_2022AC8
+ ldr r1, _0801C40C @ =gBattleTextBuff2
strb r2, [r1]
strb r6, [r1, 0x1]
movs r0, 0xD2
@@ -10500,8 +10500,8 @@ _0801C3D8:
movs r0, 0xF
b _0801C56C
.align 2, 0
-_0801C408: .4byte gUnknown_2022AB8
-_0801C40C: .4byte gUnknown_2022AC8
+_0801C408: .4byte gBattleTextBuff1
+_0801C40C: .4byte gBattleTextBuff2
_0801C410: .4byte gUnknown_2023D6E
_0801C414: .4byte gBattleScripting
_0801C418:
@@ -10527,7 +10527,7 @@ _0801C436:
ble _0801C440
b _0801C952
_0801C440:
- ldr r1, _0801C460 @ =gUnknown_2022AB8
+ ldr r1, _0801C460 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x5
@@ -10544,7 +10544,7 @@ _0801C440:
movs r0, 0x10
b _0801C506
.align 2, 0
-_0801C460: .4byte gUnknown_2022AB8
+_0801C460: .4byte gBattleTextBuff1
_0801C464: .4byte gUnknown_2023D6E
_0801C468: .4byte gBattleScripting
_0801C46C:
@@ -10570,7 +10570,7 @@ _0801C48A:
ble _0801C494
b _0801C952
_0801C494:
- ldr r1, _0801C4B4 @ =gUnknown_2022AB8
+ ldr r1, _0801C4B4 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x5
@@ -10587,7 +10587,7 @@ _0801C494:
movs r0, 0x11
b _0801C56C
.align 2, 0
-_0801C4B4: .4byte gUnknown_2022AB8
+_0801C4B4: .4byte gBattleTextBuff1
_0801C4B8: .4byte gUnknown_2023D6E
_0801C4BC: .4byte gBattleScripting
_0801C4C0:
@@ -10613,7 +10613,7 @@ _0801C4DE:
ble _0801C4E8
b _0801C952
_0801C4E8:
- ldr r1, _0801C518 @ =gUnknown_2022AB8
+ ldr r1, _0801C518 @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x5
@@ -10637,7 +10637,7 @@ _0801C506:
str r2, [sp, 0xC]
b _0801C95A
.align 2, 0
-_0801C518: .4byte gUnknown_2022AB8
+_0801C518: .4byte gBattleTextBuff1
_0801C51C: .4byte gUnknown_2023D6E
_0801C520: .4byte gBattleScripting
_0801C524: .4byte gUnknown_81D9679
@@ -10664,7 +10664,7 @@ _0801C546:
ble _0801C550
b _0801C952
_0801C550:
- ldr r1, _0801C57C @ =gUnknown_2022AB8
+ ldr r1, _0801C57C @ =gBattleTextBuff1
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x5
@@ -10687,7 +10687,7 @@ _0801C56C:
str r5, [sp, 0xC]
b _0801C95A
.align 2, 0
-_0801C57C: .4byte gUnknown_2022AB8
+_0801C57C: .4byte gBattleTextBuff1
_0801C580: .4byte gUnknown_2023D6E
_0801C584: .4byte gBattleScripting
_0801C588: .4byte gUnknown_81D9679
@@ -10799,7 +10799,7 @@ _0801C638:
asrs r0, 24
cmp r0, 0xC
beq _0801C638
- ldr r1, _0801C6AC @ =gUnknown_2022AB8
+ ldr r1, _0801C6AC @ =gBattleTextBuff1
movs r2, 0
movs r3, 0xFD
strb r3, [r1]
@@ -10810,7 +10810,7 @@ _0801C638:
strb r0, [r1, 0x2]
movs r0, 0xFF
strb r0, [r1, 0x3]
- ldr r0, _0801C6B0 @ =gUnknown_2022AC8
+ ldr r0, _0801C6B0 @ =gBattleTextBuff2
strb r3, [r0]
strb r2, [r0, 0x1]
movs r1, 0xD1
@@ -10838,8 +10838,8 @@ _0801C638:
b _0801C95A
.align 2, 0
_0801C6A8: .4byte gUnknown_2023BFC
-_0801C6AC: .4byte gUnknown_2022AB8
-_0801C6B0: .4byte gUnknown_2022AC8
+_0801C6AC: .4byte gBattleTextBuff1
+_0801C6B0: .4byte gBattleTextBuff2
_0801C6B4: .4byte gUnknown_2023D6E
_0801C6B8: .4byte gBattleScripting
_0801C6BC: .4byte gUnknown_81D9679
@@ -11025,7 +11025,7 @@ _0801C816:
ands r2, r0
cmp r2, 0
beq _0801C82E
- ldr r0, _0801C8BC @ =gUnknown_2022AB8
+ ldr r0, _0801C8BC @ =gBattleTextBuff1
ldr r1, _0801C8C0 @ =gUnknown_8250094
bl StringCopy
movs r0, 0x1
@@ -11044,7 +11044,7 @@ _0801C82E:
ldr r1, _0801C8C4 @ =0xf7ffffff
ands r0, r1
str r0, [r2]
- ldr r0, _0801C8BC @ =gUnknown_2022AB8
+ ldr r0, _0801C8BC @ =gBattleTextBuff1
ldr r1, _0801C8C8 @ =gUnknown_825009C
bl StringCopy
movs r2, 0x1
@@ -11055,7 +11055,7 @@ _0801C854:
ands r0, r1
cmp r0, 0
beq _0801C86A
- ldr r0, _0801C8BC @ =gUnknown_2022AB8
+ ldr r0, _0801C8BC @ =gBattleTextBuff1
ldr r1, _0801C8CC @ =gUnknown_82500A4
bl StringCopy
movs r3, 0x1
@@ -11066,7 +11066,7 @@ _0801C86A:
ands r0, r1
cmp r0, 0
beq _0801C880
- ldr r0, _0801C8BC @ =gUnknown_2022AB8
+ ldr r0, _0801C8BC @ =gBattleTextBuff1
ldr r1, _0801C8D0 @ =gUnknown_82500AC
bl StringCopy
movs r0, 0x1
@@ -11077,7 +11077,7 @@ _0801C880:
ands r0, r1
cmp r0, 0
beq _0801C896
- ldr r0, _0801C8BC @ =gUnknown_2022AB8
+ ldr r0, _0801C8BC @ =gBattleTextBuff1
ldr r1, _0801C8D4 @ =gUnknown_82500B4
bl StringCopy
movs r1, 0x1
@@ -11089,7 +11089,7 @@ _0801C896:
ands r0, r2
cmp r0, 0
beq _0801C8AE
- ldr r0, _0801C8BC @ =gUnknown_2022AB8
+ ldr r0, _0801C8BC @ =gBattleTextBuff1
ldr r1, _0801C8D8 @ =gUnknown_82500BC
bl StringCopy
movs r3, 0x1
@@ -11102,7 +11102,7 @@ _0801C8AE:
movs r0, 0
b _0801C8E4
.align 2, 0
-_0801C8BC: .4byte gUnknown_2022AB8
+_0801C8BC: .4byte gBattleTextBuff1
_0801C8C0: .4byte gUnknown_8250094
_0801C8C4: .4byte 0xf7ffffff
_0801C8C8: .4byte gUnknown_825009C
@@ -11157,7 +11157,7 @@ _0801C91C:
ldr r0, _0801C978 @ =0xfff0ffff
ands r2, r0
str r2, [r1]
- ldr r0, _0801C97C @ =gUnknown_2022AB8
+ ldr r0, _0801C97C @ =gBattleTextBuff1
ldr r1, _0801C980 @ =gUnknown_82500C4
bl StringCopy
ldr r0, _0801C984 @ =gUnknown_81D95BF
@@ -11175,7 +11175,7 @@ _0801C952:
_0801C95A:
ldr r0, _0801C98C @ =gBattleScripting
strb r7, [r0, 0x17]
- ldr r0, _0801C990 @ =gUnknown_2023D6F
+ ldr r0, _0801C990 @ =gPotentialItemEffectBattler
strb r7, [r0]
ldr r4, _0801C994 @ =gActiveBattler
ldr r0, _0801C998 @ =sBattler_AI
@@ -11189,12 +11189,12 @@ _0801C95A:
b _0801CFA6
.align 2, 0
_0801C978: .4byte 0xfff0ffff
-_0801C97C: .4byte gUnknown_2022AB8
+_0801C97C: .4byte gBattleTextBuff1
_0801C980: .4byte gUnknown_82500C4
_0801C984: .4byte gUnknown_81D95BF
_0801C988: .4byte gUnknown_2023E82
_0801C98C: .4byte gBattleScripting
-_0801C990: .4byte gUnknown_2023D6F
+_0801C990: .4byte gPotentialItemEffectBattler
_0801C994: .4byte gActiveBattler
_0801C998: .4byte sBattler_AI
_0801C99C:
@@ -11248,7 +11248,7 @@ _0801C9F4: .4byte gDisableStructs
_0801C9F8: .4byte gBitTable
_0801C9FC:
movs r7, 0
- ldr r0, _0801CA2C @ =gUnknown_2023BCC
+ ldr r0, _0801CA2C @ =gBattlersCount
ldrb r0, [r0]
cmp r7, r0
bcc _0801CA08
@@ -11265,7 +11265,7 @@ _0801CA08:
lsrs r0, 16
cmp r0, 0xAF
bne _0801CA3C
- ldr r1, _0801CA38 @ =gUnknown_2023F54
+ ldr r1, _0801CA38 @ =gEnigmaBerries
lsls r0, r7, 3
subs r0, r7
lsls r0, 2
@@ -11273,10 +11273,10 @@ _0801CA08:
ldrb r5, [r0, 0x7]
b _0801CA4C
.align 2, 0
-_0801CA2C: .4byte gUnknown_2023BCC
+_0801CA2C: .4byte gBattlersCount
_0801CA30: .4byte gUnknown_2023D68
_0801CA34: .4byte gBattleMons
-_0801CA38: .4byte gUnknown_2023F54
+_0801CA38: .4byte gEnigmaBerries
_0801CA3C:
ldrh r0, [r4]
bl ItemId_GetHoldEffect
@@ -11517,7 +11517,7 @@ _0801CC5C:
ldr r0, _0801CC84 @ =0xfff0ffff
ands r1, r0
str r1, [r2]
- ldr r0, _0801CC88 @ =gUnknown_2022AB8
+ ldr r0, _0801CC88 @ =gBattleTextBuff1
ldr r1, _0801CC8C @ =gUnknown_82500C4
bl StringCopy
bl BattleScriptPushCursor
@@ -11533,7 +11533,7 @@ _0801CC5C:
.align 2, 0
_0801CC80: .4byte gBattleMons
_0801CC84: .4byte 0xfff0ffff
-_0801CC88: .4byte gUnknown_2022AB8
+_0801CC88: .4byte gBattleTextBuff1
_0801CC8C: .4byte gUnknown_82500C4
_0801CC90: .4byte gUnknown_2023E82
_0801CC94: .4byte gUnknown_2023D74
@@ -11564,7 +11564,7 @@ _0801CCC4:
ands r2, r0
cmp r2, 0
beq _0801CCD4
- ldr r0, _0801CD64 @ =gUnknown_2022AB8
+ ldr r0, _0801CD64 @ =gBattleTextBuff1
ldr r1, _0801CD68 @ =gUnknown_8250094
bl StringCopy
_0801CCD4:
@@ -11580,7 +11580,7 @@ _0801CCD4:
ldr r1, _0801CD6C @ =0xf7ffffff
ands r0, r1
str r0, [r2]
- ldr r0, _0801CD64 @ =gUnknown_2022AB8
+ ldr r0, _0801CD64 @ =gBattleTextBuff1
ldr r1, _0801CD70 @ =gUnknown_825009C
bl StringCopy
_0801CCF4:
@@ -11589,7 +11589,7 @@ _0801CCF4:
ands r0, r1
cmp r0, 0
beq _0801CD06
- ldr r0, _0801CD64 @ =gUnknown_2022AB8
+ ldr r0, _0801CD64 @ =gBattleTextBuff1
ldr r1, _0801CD74 @ =gUnknown_82500A4
bl StringCopy
_0801CD06:
@@ -11598,7 +11598,7 @@ _0801CD06:
ands r0, r1
cmp r0, 0
beq _0801CD18
- ldr r0, _0801CD64 @ =gUnknown_2022AB8
+ ldr r0, _0801CD64 @ =gBattleTextBuff1
ldr r1, _0801CD78 @ =gUnknown_82500AC
bl StringCopy
_0801CD18:
@@ -11607,7 +11607,7 @@ _0801CD18:
ands r0, r1
cmp r0, 0
beq _0801CD2A
- ldr r0, _0801CD64 @ =gUnknown_2022AB8
+ ldr r0, _0801CD64 @ =gBattleTextBuff1
ldr r1, _0801CD7C @ =gUnknown_82500B4
bl StringCopy
_0801CD2A:
@@ -11617,7 +11617,7 @@ _0801CD2A:
ands r0, r3
cmp r0, 0
beq _0801CD3E
- ldr r0, _0801CD64 @ =gUnknown_2022AB8
+ ldr r0, _0801CD64 @ =gBattleTextBuff1
ldr r1, _0801CD80 @ =gUnknown_82500BC
bl StringCopy
_0801CD3E:
@@ -11640,7 +11640,7 @@ _0801CD58:
b _0801CDF6
.align 2, 0
_0801CD60: .4byte gBattleMons
-_0801CD64: .4byte gUnknown_2022AB8
+_0801CD64: .4byte gBattleTextBuff1
_0801CD68: .4byte gUnknown_8250094
_0801CD6C: .4byte 0xf7ffffff
_0801CD70: .4byte gUnknown_825009C
@@ -11684,7 +11684,7 @@ _0801CDB4:
beq _0801CE34
ldr r0, _0801CDE0 @ =gBattleScripting
strb r7, [r0, 0x17]
- ldr r0, _0801CDE4 @ =gUnknown_2023D6F
+ ldr r0, _0801CDE4 @ =gPotentialItemEffectBattler
strb r7, [r0]
bl BattleScriptPushCursor
ldr r1, _0801CDE8 @ =gUnknown_2023D74
@@ -11694,7 +11694,7 @@ _0801CDB4:
.align 2, 0
_0801CDDC: .4byte gBattleMons
_0801CDE0: .4byte gBattleScripting
-_0801CDE4: .4byte gUnknown_2023D6F
+_0801CDE4: .4byte gPotentialItemEffectBattler
_0801CDE8: .4byte gUnknown_2023D74
_0801CDEC: .4byte gUnknown_81D95DF
_0801CDF0:
@@ -11704,7 +11704,7 @@ _0801CDF0:
_0801CDF6:
ldr r0, _0801CE24 @ =gBattleScripting
strb r7, [r0, 0x17]
- ldr r0, _0801CE28 @ =gUnknown_2023D6F
+ ldr r0, _0801CE28 @ =gPotentialItemEffectBattler
strb r7, [r0]
ldr r4, _0801CE2C @ =gActiveBattler
strb r7, [r4]
@@ -11725,14 +11725,14 @@ _0801CE08:
b _0801CFA6
.align 2, 0
_0801CE24: .4byte gBattleScripting
-_0801CE28: .4byte gUnknown_2023D6F
+_0801CE28: .4byte gPotentialItemEffectBattler
_0801CE2C: .4byte gActiveBattler
_0801CE30: .4byte gUnknown_2023C30
_0801CE34:
adds r0, r7, 0x1
lsls r0, 24
lsrs r7, r0, 24
- ldr r0, _0801CE48 @ =gUnknown_2023BCC
+ ldr r0, _0801CE48 @ =gBattlersCount
ldrb r0, [r0]
cmp r7, r0
bcs _0801CE44
@@ -11740,7 +11740,7 @@ _0801CE34:
_0801CE44:
b _0801CFA6
.align 2, 0
-_0801CE48: .4byte gUnknown_2023BCC
+_0801CE48: .4byte gBattlersCount
_0801CE4C:
ldr r7, _0801CE64 @ =gBattleMoveDamage
ldr r0, [r7]
@@ -11871,7 +11871,7 @@ _0801CF10:
mov r2, sp
ldrh r2, [r2, 0x14]
strh r2, [r0]
- ldr r0, _0801CFD4 @ =gUnknown_2023D6F
+ ldr r0, _0801CFD4 @ =gPotentialItemEffectBattler
strb r3, [r0]
ldr r0, _0801CFD8 @ =gBattleScripting
strb r3, [r0, 0x17]
@@ -11924,7 +11924,7 @@ _0801CFC4: .4byte 0x0000ffff
_0801CFC8: .4byte sBattler_AI
_0801CFCC: .4byte gBattleMons
_0801CFD0: .4byte gUnknown_2023D68
-_0801CFD4: .4byte gUnknown_2023D6F
+_0801CFD4: .4byte gPotentialItemEffectBattler
_0801CFD8: .4byte gBattleScripting
_0801CFDC: .4byte gUnknown_2023D74
_0801CFE0: .4byte gUnknown_81D9622
@@ -12098,12 +12098,12 @@ _0801D0A0:
_0801D1A4:
ldr r0, _0801D284 @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
movs r1, 0x1
eors r0, r1
lsls r0, 24
lsrs r4, r0, 24
- ldr r1, _0801D288 @ =gUnknown_2023DE4
+ ldr r1, _0801D288 @ =gSideTimers
lsls r0, r4, 1
adds r0, r4
lsls r0, 2
@@ -12123,7 +12123,7 @@ _0801D1A4:
_0801D1D6:
ldr r0, _0801D284 @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r4, r0, 24
lsls r0, r7, 1
@@ -12132,7 +12132,7 @@ _0801D1E6:
bl Random
lsls r0, 16
lsrs r0, 16
- ldr r1, _0801D290 @ =gUnknown_2023BCC
+ ldr r1, _0801D290 @ =gBattlersCount
ldrb r1, [r1]
bl __modsi3
lsls r0, 24
@@ -12142,7 +12142,7 @@ _0801D1E6:
cmp r5, r3
beq _0801D1E6
adds r0, r5, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r4, r0
@@ -12171,7 +12171,7 @@ _0801D234:
movs r0, 0x10
movs r2, 0x1F
movs r3, 0
- bl sub_8019F18
+ bl AbilityBattleEffects
lsls r0, 24
cmp r0, 0
bne _0801D24A
@@ -12208,9 +12208,9 @@ _0801D25E:
b _0801D39C
.align 2, 0
_0801D284: .4byte sBattler_AI
-_0801D288: .4byte gUnknown_2023DE4
+_0801D288: .4byte gSideTimers
_0801D28C: .4byte gBattleMons
-_0801D290: .4byte gUnknown_2023BCC
+_0801D290: .4byte gBattlersCount
_0801D294: .4byte gAbsentBattlerFlags
_0801D298: .4byte gBitTable
_0801D29C: .4byte gBattleMoves
@@ -12218,7 +12218,7 @@ _0801D2A0: .4byte gUnknown_2023ECC
_0801D2A4:
ldr r0, _0801D2B8 @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
movs r2, 0x1
movs r0, 0x1
@@ -12230,12 +12230,12 @@ _0801D2B8: .4byte sBattler_AI
_0801D2BC:
ldr r0, _0801D2F0 @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
movs r1, 0x1
eors r0, r1
lsls r0, 24
lsrs r4, r0, 24
- ldr r1, _0801D2F4 @ =gUnknown_2023DE4
+ ldr r1, _0801D2F4 @ =gSideTimers
lsls r0, r4, 1
adds r0, r4
lsls r0, 2
@@ -12256,7 +12256,7 @@ _0801D2EC:
b _0801D39C
.align 2, 0
_0801D2F0: .4byte sBattler_AI
-_0801D2F4: .4byte gUnknown_2023DE4
+_0801D2F4: .4byte gSideTimers
_0801D2F8: .4byte gBattleMons
_0801D2FC:
ldr r0, _0801D330 @ =gBattleTypeFlags
@@ -12271,7 +12271,7 @@ _0801D2FC:
beq _0801D378
ldr r0, _0801D334 @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _0801D33C
@@ -12299,7 +12299,7 @@ _0801D33C:
_0801D34C:
movs r0, 0x2
_0801D34E:
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r5, r0, 24
ldr r0, _0801D370 @ =gAbsentBattlerFlags
@@ -12320,13 +12320,13 @@ _0801D374: .4byte gBitTable
_0801D378:
ldr r0, _0801D394 @ =sBattler_AI
ldrb r0, [r0]
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
movs r2, 0x1
movs r0, 0x1
ands r0, r1
eors r0, r2
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r5, r0, 24
b _0801D39C
@@ -12360,7 +12360,7 @@ HasObedientBitSet: @ 801D3C0
lsls r0, 24
lsrs r4, r0, 24
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -12429,7 +12429,7 @@ sub_801D438: @ 801D438
bne _0801D4F4
ldr r4, _0801D500 @ =sBattler_AI
ldrb r0, [r4]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -12686,7 +12686,7 @@ _0801D634:
cmp r0, 0xF
beq _0801D6CC
movs r2, 0
- ldr r0, _0801D6C0 @ =gUnknown_2023BCC
+ ldr r0, _0801D6C0 @ =gBattlersCount
ldrb r3, [r0]
adds r7, r0, 0
cmp r2, r3
@@ -12718,7 +12718,7 @@ _0801D6AA:
.align 2, 0
_0801D6B8: .4byte gBattleMons
_0801D6BC: .4byte sBattler_AI
-_0801D6C0: .4byte gUnknown_2023BCC
+_0801D6C0: .4byte gBattlersCount
_0801D6C4: .4byte gUnknown_2023D74
_0801D6C8: .4byte gUnknown_81D9504
_0801D6CC:
@@ -12759,7 +12759,7 @@ _0801D6F4:
adds r0, r1, 0
movs r2, 0x1
movs r3, 0
- bl sub_803ECEC
+ bl CalculateBaseDamage
ldr r1, _0801D74C @ =gBattleMoveDamage
str r0, [r1]
ldr r1, _0801D750 @ =gBattlerTarget
diff --git a/asm/battle_util2.s b/asm/battle_util2.s
index d83b79202..8cfbe3120 100644
--- a/asm/battle_util2.s
+++ b/asm/battle_util2.s
@@ -229,11 +229,11 @@ sub_802E228: @ 802E228
cmp r0, 0
beq _0802E274
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r4, r0, 24
movs r0, 0x3
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r3, r0, 24
ldr r2, _0802E270 @ =gBattleMons
@@ -256,7 +256,7 @@ _0802E26C: .4byte gBattleTypeFlags
_0802E270: .4byte gBattleMons
_0802E274:
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r4, r0, 24
_0802E27E:
@@ -289,7 +289,7 @@ _0802E27E:
ldr r1, _0802E2C8 @ =gPlayerParty
adds r0, r1
movs r1, 0x9
- bl sub_80436F8
+ bl AdjustFriendship
b _0802E302
.align 2, 0
_0802E2C0: .4byte gBattleMons
@@ -305,7 +305,7 @@ _0802E2CC:
ldr r1, _0802E2E8 @ =gPlayerParty
adds r0, r1
movs r1, 0x7
- bl sub_80436F8
+ bl AdjustFriendship
b _0802E302
.align 2, 0
_0802E2E4: .4byte gBattlerPartyIndexes
@@ -320,7 +320,7 @@ _0802E2EC:
ldr r1, _0802E30C @ =gPlayerParty
adds r0, r1
movs r1, 0x7
- bl sub_80436F8
+ bl AdjustFriendship
_0802E302:
pop {r4,r5}
pop {r0}
diff --git a/asm/bike.s b/asm/bike.s
index 2a1219968..1f891f930 100644
--- a/asm/bike.s
+++ b/asm/bike.s
@@ -77,7 +77,7 @@ sub_80BD100: @ 80BD100
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _080BD160 @ =gUnknown_2036E38
+ ldr r0, _080BD160 @ =gMapObjects
adds r4, r0
bl player_get_direction_upper_nybble
lsls r0, 24
@@ -106,7 +106,7 @@ sub_80BD100: @ 80BD100
b _080BD1B6
.align 2, 0
_080BD15C: .4byte gUnknown_2037078
-_080BD160: .4byte gUnknown_2036E38
+_080BD160: .4byte gMapObjects
_080BD164: .4byte gMain
_080BD168:
ldrb r0, [r6]
@@ -204,7 +204,7 @@ sub_80BD1E8: @ 80BD1E8
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _080BD244 @ =gUnknown_2036E38
+ ldr r1, _080BD244 @ =gMapObjects
adds r0, r1
ldrb r0, [r0, 0x1E]
bl sub_805A1DC
@@ -227,7 +227,7 @@ sub_80BD1E8: @ 80BD1E8
b _080BD270
.align 2, 0
_080BD240: .4byte gUnknown_2037078
-_080BD244: .4byte gUnknown_2036E38
+_080BD244: .4byte gMapObjects
_080BD248:
movs r0, 0x2
strb r0, [r4, 0x2]
@@ -281,7 +281,7 @@ sub_80BD28C: @ 80BD28C
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _080BD2C4 @ =gUnknown_2036E38
+ ldr r1, _080BD2C4 @ =gMapObjects
adds r5, r0, r1
ldrb r1, [r5, 0x1E]
adds r0, r4, 0
@@ -299,7 +299,7 @@ _080BD2B2:
bx r0
.align 2, 0
_080BD2C0: .4byte gUnknown_2037078
-_080BD2C4: .4byte gUnknown_2036E38
+_080BD2C4: .4byte gMapObjects
thumb_func_end sub_80BD28C
thumb_func_start sub_80BD2C8
@@ -313,7 +313,7 @@ sub_80BD2C8: @ 80BD2C8
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _080BD2FC @ =gUnknown_2036E38
+ ldr r1, _080BD2FC @ =gMapObjects
adds r5, r0, r1
ldrb r1, [r5, 0x1E]
adds r0, r4, 0
@@ -327,7 +327,7 @@ sub_80BD2C8: @ 80BD2C8
b _080BD350
.align 2, 0
_080BD2F8: .4byte gUnknown_2037078
-_080BD2FC: .4byte gUnknown_2036E38
+_080BD2FC: .4byte gMapObjects
_080BD300:
adds r0, r4, 0
bl sub_80BD3A0
@@ -425,7 +425,7 @@ sub_80BD3A0: @ 80BD3A0
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _080BD408 @ =gUnknown_2036E38
+ ldr r0, _080BD408 @ =gMapObjects
adds r4, r0
ldrh r1, [r4, 0x10]
add r0, sp, 0x4
@@ -463,7 +463,7 @@ sub_80BD3A0: @ 80BD3A0
bx r1
.align 2, 0
_080BD404: .4byte gUnknown_2037078
-_080BD408: .4byte gUnknown_2036E38
+_080BD408: .4byte gMapObjects
thumb_func_end sub_80BD3A0
thumb_func_start sub_80BD40C
@@ -689,7 +689,7 @@ player_should_look_direction_be_enforced_upon_movement: @ 80BD58C
lsls r0, 24
cmp r0, 0
beq _080BD5C0
- ldr r2, _080BD5B8 @ =gUnknown_2036E38
+ ldr r2, _080BD5B8 @ =gMapObjects
ldr r0, _080BD5BC @ =gUnknown_2037078
ldrb r1, [r0, 0x5]
lsls r0, r1, 3
@@ -704,7 +704,7 @@ player_should_look_direction_be_enforced_upon_movement: @ 80BD58C
movs r0, 0
b _080BD5C2
.align 2, 0
-_080BD5B8: .4byte gUnknown_2036E38
+_080BD5B8: .4byte gMapObjects
_080BD5BC: .4byte gUnknown_2037078
_080BD5C0:
movs r0, 0x1
diff --git a/asm/cable_club.s b/asm/cable_club.s
index eeb9471db..ff9035000 100644
--- a/asm/cable_club.s
+++ b/asm/cable_club.s
@@ -800,10 +800,10 @@ _08080D88: .4byte sub_8080E6C
sub_8080D8C: @ 8080D8C
push {r4,r5,lr}
movs r5, 0
- ldr r4, _08080D94 @ =gUnknown_202273C
+ ldr r4, _08080D94 @ =gLinkPlayers
b _08080DAC
.align 2, 0
-_08080D94: .4byte gUnknown_202273C
+_08080D94: .4byte gLinkPlayers
_08080D98:
ldrb r0, [r4]
subs r0, 0x1
@@ -929,7 +929,7 @@ sub_8080E6C: @ 8080E6C
mov r8, r0
b _08080EF8
_08080E9A:
- ldr r1, _08080ED0 @ =gUnknown_202273C
+ ldr r1, _08080ED0 @ =gLinkPlayers
lsls r0, r5, 3
subs r0, r5
lsls r0, 2
@@ -956,7 +956,7 @@ _08080E9A:
strb r0, [r4]
b _08080EF2
.align 2, 0
-_08080ED0: .4byte gUnknown_202273C
+_08080ED0: .4byte gLinkPlayers
_08080ED4: .4byte gUnknown_2022118
_08080ED8: .4byte gUnknown_2039624
_08080EDC:
@@ -1580,7 +1580,7 @@ _080813AA:
.align 2, 0
_080813B4: .4byte gUnknown_3003F64
_080813B8:
- ldr r0, _080813CC @ =gUnknown_202273C
+ ldr r0, _080813CC @ =gLinkPlayers
ldr r0, [r0, 0x4]
movs r1, 0x1
ands r0, r1
@@ -1590,7 +1590,7 @@ _080813B8:
bl PlayMapChosenOrBattleBGM
b _080813DC
.align 2, 0
-_080813CC: .4byte gUnknown_202273C
+_080813CC: .4byte gLinkPlayers
_080813D0: .4byte 0x00000109
_080813D4:
movs r0, 0x85
@@ -1740,10 +1740,10 @@ _080814F0:
b _0808160A
_08081504:
movs r4, 0
- ldr r5, _0808150C @ =gUnknown_202273C
+ ldr r5, _0808150C @ =gLinkPlayers
b _08081536
.align 2, 0
-_0808150C: .4byte gUnknown_202273C
+_0808150C: .4byte gLinkPlayers
_08081510:
lsls r1, r4, 8
ldr r2, _08081548 @ =gUnknown_2022118
@@ -1798,7 +1798,7 @@ _0808156A:
strh r0, [r6]
b _0808160A
_0808157A:
- ldr r0, _08081590 @ =gUnknown_202273C
+ ldr r0, _08081590 @ =gLinkPlayers
ldr r0, [r0, 0x4]
movs r1, 0x1
ands r0, r1
@@ -1808,14 +1808,14 @@ _0808157A:
bl PlayMapChosenOrBattleBGM
b _080815A0
.align 2, 0
-_08081590: .4byte gUnknown_202273C
+_08081590: .4byte gLinkPlayers
_08081594: .4byte 0x00000109
_08081598:
movs r0, 0x85
lsls r0, 1
bl PlayMapChosenOrBattleBGM
_080815A0:
- ldr r0, _080815B8 @ =gUnknown_202273C
+ ldr r0, _080815B8 @ =gLinkPlayers
ldr r1, _080815BC @ =0x00002211
str r1, [r0, 0x14]
ldr r0, _080815C0 @ =gUnknown_20370C0
@@ -1828,7 +1828,7 @@ _080815A0:
beq _080815CA
b _080815EA
.align 2, 0
-_080815B8: .4byte gUnknown_202273C
+_080815B8: .4byte gLinkPlayers
_080815BC: .4byte 0x00002211
_080815C0: .4byte gUnknown_20370C0
_080815C4:
@@ -1924,8 +1924,8 @@ sub_8081668: @ 8081668
ands r0, r1
str r0, [r2]
bl sub_8055DB8
- bl sub_804C230
- bl sub_804C440
+ bl LoadPlayerParty
+ bl SavePlayerBag
bl sub_81134B8
ldr r0, _080816B8 @ =gUnknown_20370C0
ldrh r0, [r0]
@@ -1955,7 +1955,7 @@ _080816BC: .4byte gUnknown_300502C
_080816C0: .4byte gUnknown_3003F3C
_080816C4: .4byte gUnknown_2023E8A
_080816C8:
- ldr r4, _080816E8 @ =gUnknown_202273C
+ ldr r4, _080816E8 @ =gLinkPlayers
bl GetMultiplayerId
eors r0, r5
lsls r0, 24
@@ -1970,9 +1970,9 @@ _080816C8:
bl sub_8144714
b _0808170A
.align 2, 0
-_080816E8: .4byte gUnknown_202273C
+_080816E8: .4byte gLinkPlayers
_080816EC:
- ldr r4, _08081718 @ =gUnknown_202273C
+ ldr r4, _08081718 @ =gLinkPlayers
bl GetMultiplayerId
eors r0, r5
lsls r0, 24
@@ -1993,7 +1993,7 @@ _0808170A:
ldr r0, _08081720 @ =sub_8081624
b _08081728
.align 2, 0
-_08081718: .4byte gUnknown_202273C
+_08081718: .4byte gLinkPlayers
_0808171C: .4byte gMain
_08081720: .4byte sub_8081624
_08081724:
@@ -2025,8 +2025,8 @@ sub_8081744: @ 8081744
cmp r1, 0x5
bne _08081760
_08081758:
- bl sub_804C230
- bl sub_804C440
+ bl LoadPlayerParty
+ bl SavePlayerBag
_08081760:
movs r0, 0x7F
bl copy_saved_warp2_bank_and_enter_x_to_warp1
diff --git a/asm/calculate_base_damage.s b/asm/calculate_base_damage.s
deleted file mode 100644
index b474a1249..000000000
--- a/asm/calculate_base_damage.s
+++ /dev/null
@@ -1,1123 +0,0 @@
- .include "asm/macros.inc"
- .include "constants/constants.inc"
-
- .syntax unified
-
- .text
-
- thumb_func_start sub_803ECEC
-sub_803ECEC: @ 803ECEC
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x2C
- adds r6, r0, 0
- str r1, [sp, 0x4]
- str r2, [sp, 0x8]
- ldr r0, [sp, 0x4C]
- ldr r1, [sp, 0x50]
- ldr r2, [sp, 0x54]
- ldr r4, [sp, 0x58]
- lsls r3, 16
- lsrs r3, 16
- str r3, [sp, 0xC]
- lsls r0, 16
- lsrs r3, r0, 16
- lsls r1, 24
- lsrs r7, r1, 24
- lsls r2, 24
- lsrs r2, 24
- str r2, [sp, 0x10]
- lsls r4, 24
- lsrs r4, 24
- movs r5, 0
- cmp r3, 0
- bne _0803ED40
- ldr r2, _0803ED38 @ =gUnknown_2024020
- ldr r1, _0803ED3C @ =gBattleMoves
- ldr r3, [sp, 0x8]
- lsls r0, r3, 1
- adds r0, r3
- lsls r0, 2
- adds r0, r1
- ldrb r0, [r0, 0x1]
- strh r0, [r2]
- b _0803ED44
- .align 2, 0
-_0803ED38: .4byte gUnknown_2024020
-_0803ED3C: .4byte gBattleMoves
-_0803ED40:
- ldr r0, _0803ED5C @ =gUnknown_2024020
- strh r3, [r0]
-_0803ED44:
- cmp r7, 0
- bne _0803ED64
- ldr r1, _0803ED60 @ =gBattleMoves
- ldr r7, [sp, 0x8]
- lsls r0, r7, 1
- adds r0, r7
- lsls r0, 2
- adds r0, r1
- ldrb r0, [r0, 0x2]
- mov r9, r0
- b _0803ED6E
- .align 2, 0
-_0803ED5C: .4byte gUnknown_2024020
-_0803ED60: .4byte gBattleMoves
-_0803ED64:
- movs r0, 0x3F
- mov r9, r0
- mov r1, r9
- ands r1, r7
- mov r9, r1
-_0803ED6E:
- ldrh r7, [r6, 0x2]
- ldr r2, [sp, 0x4]
- ldrh r2, [r2, 0x4]
- str r2, [sp, 0x14]
- ldrh r3, [r6, 0x8]
- mov r8, r3
- ldr r0, [sp, 0x4]
- ldrh r0, [r0, 0xA]
- str r0, [sp, 0x18]
- ldrh r0, [r6, 0x2E]
- cmp r0, 0xAF
- bne _0803EDA0
- ldr r1, _0803ED9C @ =gUnknown_2023F54
- ldr r2, [sp, 0x10]
- lsls r0, r2, 3
- subs r0, r2
- lsls r0, 2
- adds r0, r1
- ldrb r3, [r0, 0x7]
- mov r10, r3
- ldrb r0, [r0, 0x1A]
- b _0803EDB6
- .align 2, 0
-_0803ED9C: .4byte gUnknown_2023F54
-_0803EDA0:
- ldrh r0, [r6, 0x2E]
- bl ItemId_GetHoldEffect
- lsls r0, 24
- lsrs r0, 24
- mov r10, r0
- ldrh r0, [r6, 0x2E]
- bl ItemId_GetHoldEffectParam
- lsls r0, 24
- lsrs r0, 24
-_0803EDB6:
- str r0, [sp, 0x20]
- ldr r1, [sp, 0x4]
- ldrh r0, [r1, 0x2E]
- cmp r0, 0xAF
- bne _0803EDE6
- ldr r1, _0803EDD0 @ =gUnknown_2023F54
- lsls r0, r4, 3
- subs r0, r4
- lsls r0, 2
- adds r0, r1
- ldrb r0, [r0, 0x7]
- str r0, [sp, 0x1C]
- b _0803EDFC
- .align 2, 0
-_0803EDD0: .4byte gUnknown_2023F54
-_0803EDD4:
- ldr r0, [sp, 0x20]
- adds r0, 0x64
- muls r0, r7
- movs r1, 0x64
- bl __divsi3
- lsls r0, 16
- lsrs r7, r0, 16
- b _0803EF44
-_0803EDE6:
- ldr r2, [sp, 0x4]
- ldrh r0, [r2, 0x2E]
- bl ItemId_GetHoldEffect
- lsls r0, 24
- lsrs r0, 24
- str r0, [sp, 0x1C]
- ldr r3, [sp, 0x4]
- ldrh r0, [r3, 0x2E]
- bl ItemId_GetHoldEffectParam
-_0803EDFC:
- adds r0, r6, 0
- adds r0, 0x20
- ldrb r1, [r0]
- str r0, [sp, 0x24]
- cmp r1, 0x25
- beq _0803EE0C
- cmp r1, 0x4A
- bne _0803EE10
-_0803EE0C:
- lsls r0, r7, 17
- lsrs r7, r0, 16
-_0803EE10:
- ldr r0, _0803EF28 @ =gBattleTypeFlags
- ldr r0, [r0]
- ldr r1, _0803EF2C @ =0x00000802
- ands r0, r1
- cmp r0, 0
- bne _0803EEE8
- movs r0, 0x82
- lsls r0, 4
- bl FlagGet
- lsls r0, 24
- cmp r0, 0
- beq _0803EE44
- ldr r0, [sp, 0x10]
- bl GetBankSide
- lsls r0, 24
- cmp r0, 0
- bne _0803EE44
- movs r0, 0x6E
- muls r0, r7
- movs r1, 0x64
- bl __divsi3
- lsls r0, 16
- lsrs r7, r0, 16
-_0803EE44:
- ldr r0, _0803EF28 @ =gBattleTypeFlags
- ldr r0, [r0]
- ldr r1, _0803EF2C @ =0x00000802
- ands r0, r1
- cmp r0, 0
- bne _0803EEE8
- ldr r0, _0803EF30 @ =0x00000824
- bl FlagGet
- lsls r0, 24
- cmp r0, 0
- beq _0803EE7A
- adds r0, r4, 0
- bl GetBankSide
- lsls r0, 24
- cmp r0, 0
- bne _0803EE7A
- movs r0, 0x6E
- ldr r1, [sp, 0x14]
- muls r0, r1
- movs r1, 0x64
- bl __divsi3
- lsls r0, 16
- lsrs r0, 16
- str r0, [sp, 0x14]
-_0803EE7A:
- ldr r0, _0803EF28 @ =gBattleTypeFlags
- ldr r0, [r0]
- ldr r1, _0803EF2C @ =0x00000802
- ands r0, r1
- cmp r0, 0
- bne _0803EEE8
- ldr r0, _0803EF34 @ =0x00000826
- bl FlagGet
- lsls r0, 24
- cmp r0, 0
- beq _0803EEB2
- ldr r0, [sp, 0x10]
- bl GetBankSide
- lsls r0, 24
- cmp r0, 0
- bne _0803EEB2
- movs r0, 0x6E
- mov r2, r8
- muls r2, r0
- adds r0, r2, 0
- movs r1, 0x64
- bl __divsi3
- lsls r0, 16
- lsrs r0, 16
- mov r8, r0
-_0803EEB2:
- ldr r0, _0803EF28 @ =gBattleTypeFlags
- ldr r0, [r0]
- ldr r1, _0803EF2C @ =0x00000802
- ands r0, r1
- cmp r0, 0
- bne _0803EEE8
- ldr r0, _0803EF34 @ =0x00000826
- bl FlagGet
- lsls r0, 24
- cmp r0, 0
- beq _0803EEE8
- adds r0, r4, 0
- bl GetBankSide
- lsls r0, 24
- cmp r0, 0
- bne _0803EEE8
- movs r0, 0x6E
- ldr r3, [sp, 0x18]
- muls r0, r3
- movs r1, 0x64
- bl __divsi3
- lsls r0, 16
- lsrs r0, 16
- str r0, [sp, 0x18]
-_0803EEE8:
- movs r2, 0
- ldr r4, _0803EF38 @ =gUnknown_825DECC
- ldr r0, [sp, 0x4]
- adds r0, 0x20
- str r0, [sp, 0x28]
- adds r3, r4, 0
-_0803EEF4:
- lsls r1, r2, 1
- ldrb r0, [r3]
- cmp r10, r0
- bne _0803EF3C
- adds r0, r4, 0x1
- adds r0, r1, r0
- ldrb r0, [r0]
- cmp r9, r0
- bne _0803EF3C
- mov r1, r9
- cmp r1, 0x8
- bhi _0803EF0E
- b _0803EDD4
-_0803EF0E:
- ldr r0, [sp, 0x20]
- adds r0, 0x64
- mov r2, r8
- muls r2, r0
- adds r0, r2, 0
- movs r1, 0x64
- bl __divsi3
- lsls r0, 16
- lsrs r0, 16
- mov r8, r0
- b _0803EF44
- .align 2, 0
-_0803EF28: .4byte gBattleTypeFlags
-_0803EF2C: .4byte 0x00000802
-_0803EF30: .4byte 0x00000824
-_0803EF34: .4byte 0x00000826
-_0803EF38: .4byte gUnknown_825DECC
-_0803EF3C:
- adds r3, 0x2
- adds r2, 0x1
- cmp r2, 0x10
- bls _0803EEF4
-_0803EF44:
- mov r3, r10
- cmp r3, 0x1D
- bne _0803EF58
- movs r0, 0x96
- muls r0, r7
- movs r1, 0x64
- bl __divsi3
- lsls r0, 16
- lsrs r7, r0, 16
-_0803EF58:
- mov r0, r10
- cmp r0, 0x22
- bne _0803EF90
- ldr r0, _0803F244 @ =gBattleTypeFlags
- ldr r0, [r0]
- movs r1, 0x80
- lsls r1, 1
- ands r0, r1
- cmp r0, 0
- bne _0803EF90
- ldr r1, _0803F248 @ =0xfffffe69
- adds r0, r1, 0
- ldrh r2, [r6]
- adds r0, r2
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0x1
- bhi _0803EF90
- movs r0, 0x96
- mov r3, r8
- muls r3, r0
- adds r0, r3, 0
- movs r1, 0x64
- bl __divsi3
- lsls r0, 16
- lsrs r0, 16
- mov r8, r0
-_0803EF90:
- ldr r0, [sp, 0x1C]
- cmp r0, 0x22
- bne _0803EFC8
- ldr r0, _0803F244 @ =gBattleTypeFlags
- ldr r0, [r0]
- movs r1, 0x80
- lsls r1, 1
- ands r0, r1
- cmp r0, 0
- bne _0803EFC8
- ldr r1, _0803F248 @ =0xfffffe69
- adds r0, r1, 0
- ldr r2, [sp, 0x4]
- ldrh r2, [r2]
- adds r0, r2
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0x1
- bhi _0803EFC8
- movs r0, 0x96
- ldr r3, [sp, 0x18]
- muls r0, r3
- movs r1, 0x64
- bl __divsi3
- lsls r0, 16
- lsrs r0, 16
- str r0, [sp, 0x18]
-_0803EFC8:
- mov r0, r10
- cmp r0, 0x23
- bne _0803EFDE
- ldrh r1, [r6]
- ldr r0, _0803F24C @ =0x00000175
- cmp r1, r0
- bne _0803EFDE
- mov r1, r8
- lsls r0, r1, 17
- lsrs r0, 16
- mov r8, r0
-_0803EFDE:
- ldr r2, [sp, 0x1C]
- cmp r2, 0x24
- bne _0803EFF6
- ldr r3, [sp, 0x4]
- ldrh r1, [r3]
- ldr r0, _0803F24C @ =0x00000175
- cmp r1, r0
- bne _0803EFF6
- ldr r1, [sp, 0x18]
- lsls r0, r1, 17
- lsrs r0, 16
- str r0, [sp, 0x18]
-_0803EFF6:
- mov r2, r10
- cmp r2, 0x2D
- bne _0803F00A
- ldrh r0, [r6]
- cmp r0, 0x19
- bne _0803F00A
- mov r3, r8
- lsls r0, r3, 17
- lsrs r0, 16
- mov r8, r0
-_0803F00A:
- ldr r0, [sp, 0x1C]
- cmp r0, 0x40
- bne _0803F020
- ldr r1, [sp, 0x4]
- ldrh r0, [r1]
- cmp r0, 0x84
- bne _0803F020
- ldr r2, [sp, 0x14]
- lsls r0, r2, 17
- lsrs r0, 16
- str r0, [sp, 0x14]
-_0803F020:
- mov r3, r10
- cmp r3, 0x41
- bne _0803F036
- ldrh r0, [r6]
- subs r0, 0x68
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0x1
- bhi _0803F036
- lsls r0, r7, 17
- lsrs r7, r0, 16
-_0803F036:
- ldr r1, [sp, 0x28]
- ldrb r0, [r1]
- cmp r0, 0x2F
- bne _0803F04E
- mov r2, r9
- cmp r2, 0xA
- beq _0803F048
- cmp r2, 0xF
- bne _0803F04E
-_0803F048:
- mov r3, r8
- lsrs r3, 1
- mov r8, r3
-_0803F04E:
- ldr r0, [sp, 0x24]
- ldrb r4, [r0]
- cmp r4, 0x37
- bne _0803F064
- movs r0, 0x96
- muls r0, r7
- movs r1, 0x64
- bl __divsi3
- lsls r0, 16
- lsrs r7, r0, 16
-_0803F064:
- cmp r4, 0x39
- bne _0803F092
- movs r0, 0
- str r0, [sp]
- movs r0, 0xE
- movs r1, 0
- movs r2, 0x3A
- movs r3, 0
- bl sub_8019F18
- lsls r0, 24
- cmp r0, 0
- beq _0803F092
- movs r0, 0x96
- mov r1, r8
- muls r1, r0
- adds r0, r1, 0
- movs r1, 0x64
- bl __divsi3
- lsls r0, 16
- lsrs r0, 16
- mov r8, r0
-_0803F092:
- ldr r2, [sp, 0x24]
- ldrb r0, [r2]
- cmp r0, 0x3A
- bne _0803F0C4
- movs r0, 0
- str r0, [sp]
- movs r0, 0xE
- movs r1, 0
- movs r2, 0x39
- movs r3, 0
- bl sub_8019F18
- lsls r0, 24
- cmp r0, 0
- beq _0803F0C4
- movs r0, 0x96
- mov r3, r8
- muls r3, r0
- adds r0, r3, 0
- movs r1, 0x64
- bl __divsi3
- lsls r0, 16
- lsrs r0, 16
- mov r8, r0
-_0803F0C4:
- ldr r1, [sp, 0x24]
- ldrb r0, [r1]
- cmp r0, 0x3E
- bne _0803F0E0
- ldr r0, [r6, 0x4C]
- cmp r0, 0
- beq _0803F0E0
- movs r0, 0x96
- muls r0, r7
- movs r1, 0x64
- bl __divsi3
- lsls r0, 16
- lsrs r7, r0, 16
-_0803F0E0:
- ldr r2, [sp, 0x28]
- ldrb r0, [r2]
- cmp r0, 0x3F
- bne _0803F102
- ldr r3, [sp, 0x4]
- ldr r0, [r3, 0x4C]
- cmp r0, 0
- beq _0803F102
- movs r0, 0x96
- ldr r1, [sp, 0x14]
- muls r0, r1
- movs r1, 0x64
- bl __divsi3
- lsls r0, 16
- lsrs r0, 16
- str r0, [sp, 0x14]
-_0803F102:
- mov r2, r9
- cmp r2, 0xD
- bne _0803F126
- movs r0, 0
- str r0, [sp]
- movs r0, 0xE
- movs r1, 0
- movs r2, 0
- movs r3, 0xFD
- bl sub_8019F18
- lsls r0, 24
- cmp r0, 0
- beq _0803F126
- ldr r1, _0803F250 @ =gUnknown_2024020
- ldrh r0, [r1]
- lsrs r0, 1
- strh r0, [r1]
-_0803F126:
- mov r3, r9
- cmp r3, 0xA
- bne _0803F14A
- movs r0, 0
- str r0, [sp]
- movs r0, 0xE
- movs r1, 0
- movs r2, 0
- movs r3, 0xFE
- bl sub_8019F18
- lsls r0, 24
- cmp r0, 0
- beq _0803F14A
- ldr r1, _0803F250 @ =gUnknown_2024020
- ldrh r0, [r1]
- lsrs r0, 1
- strh r0, [r1]
-_0803F14A:
- mov r0, r9
- cmp r0, 0xC
- bne _0803F17A
- ldr r1, [sp, 0x24]
- ldrb r0, [r1]
- cmp r0, 0x41
- bne _0803F17A
- ldrh r0, [r6, 0x2C]
- movs r1, 0x3
- bl __udivsi3
- ldrh r1, [r6, 0x28]
- lsls r0, 16
- lsrs r0, 16
- cmp r1, r0
- bhi _0803F17A
- ldr r4, _0803F250 @ =gUnknown_2024020
- ldrh r1, [r4]
- movs r0, 0x96
- muls r0, r1
- movs r1, 0x64
- bl __divsi3
- strh r0, [r4]
-_0803F17A:
- mov r2, r9
- cmp r2, 0xA
- bne _0803F1AA
- ldr r3, [sp, 0x24]
- ldrb r0, [r3]
- cmp r0, 0x42
- bne _0803F1AA
- ldrh r0, [r6, 0x2C]
- movs r1, 0x3
- bl __udivsi3
- ldrh r1, [r6, 0x28]
- lsls r0, 16
- lsrs r0, 16
- cmp r1, r0
- bhi _0803F1AA
- ldr r4, _0803F250 @ =gUnknown_2024020
- ldrh r1, [r4]
- movs r0, 0x96
- muls r0, r1
- movs r1, 0x64
- bl __divsi3
- strh r0, [r4]
-_0803F1AA:
- mov r0, r9
- cmp r0, 0xB
- bne _0803F1DA
- ldr r1, [sp, 0x24]
- ldrb r0, [r1]
- cmp r0, 0x43
- bne _0803F1DA
- ldrh r0, [r6, 0x2C]
- movs r1, 0x3
- bl __udivsi3
- ldrh r1, [r6, 0x28]
- lsls r0, 16
- lsrs r0, 16
- cmp r1, r0
- bhi _0803F1DA
- ldr r4, _0803F250 @ =gUnknown_2024020
- ldrh r1, [r4]
- movs r0, 0x96
- muls r0, r1
- movs r1, 0x64
- bl __divsi3
- strh r0, [r4]
-_0803F1DA:
- mov r2, r9
- cmp r2, 0x6
- bne _0803F20A
- ldr r3, [sp, 0x24]
- ldrb r0, [r3]
- cmp r0, 0x44
- bne _0803F20A
- ldrh r0, [r6, 0x2C]
- movs r1, 0x3
- bl __udivsi3
- ldrh r1, [r6, 0x28]
- lsls r0, 16
- lsrs r0, 16
- cmp r1, r0
- bhi _0803F20A
- ldr r4, _0803F250 @ =gUnknown_2024020
- ldrh r1, [r4]
- movs r0, 0x96
- muls r0, r1
- movs r1, 0x64
- bl __divsi3
- strh r0, [r4]
-_0803F20A:
- ldr r2, _0803F254 @ =gBattleMoves
- ldr r0, _0803F258 @ =gCurrentMove
- ldrh r1, [r0]
- lsls r0, r1, 1
- adds r0, r1
- lsls r0, 2
- adds r0, r2
- ldrb r0, [r0]
- cmp r0, 0x7
- bne _0803F224
- ldr r0, [sp, 0x14]
- lsrs r0, 1
- str r0, [sp, 0x14]
-_0803F224:
- mov r1, r9
- cmp r1, 0x8
- bls _0803F22C
- b _0803F38A
-_0803F22C:
- ldr r0, _0803F25C @ =gCritMultiplier
- ldrb r1, [r0]
- adds r4, r0, 0
- cmp r1, 0x2
- bne _0803F268
- movs r0, 0x19
- ldrsb r0, [r6, r0]
- cmp r0, 0x6
- ble _0803F264
- ldr r2, _0803F260 @ =gUnknown_825DEAD
- b _0803F26E
- .align 2, 0
-_0803F244: .4byte gBattleTypeFlags
-_0803F248: .4byte 0xfffffe69
-_0803F24C: .4byte 0x00000175
-_0803F250: .4byte gUnknown_2024020
-_0803F254: .4byte gBattleMoves
-_0803F258: .4byte gCurrentMove
-_0803F25C: .4byte gCritMultiplier
-_0803F260: .4byte gUnknown_825DEAD
-_0803F264:
- adds r5, r7, 0
- b _0803F286
-_0803F268:
- ldr r2, _0803F2B8 @ =gUnknown_825DEAD
- movs r0, 0x19
- ldrsb r0, [r6, r0]
-_0803F26E:
- lsls r0, 1
- adds r1, r0, r2
- ldrb r1, [r1]
- adds r5, r7, 0
- muls r5, r1
- adds r2, 0x1
- adds r0, r2
- ldrb r1, [r0]
- adds r0, r5, 0
- bl __divsi3
- adds r5, r0, 0
-_0803F286:
- ldr r0, _0803F2BC @ =gUnknown_2024020
- ldrh r0, [r0]
- muls r5, r0
- adds r0, r6, 0
- adds r0, 0x2A
- ldrb r0, [r0]
- lsls r0, 1
- movs r1, 0x5
- bl __divsi3
- adds r0, 0x2
- muls r5, r0
- ldrb r0, [r4]
- cmp r0, 0x2
- bne _0803F2C4
- ldr r2, [sp, 0x4]
- movs r0, 0x1A
- ldrsb r0, [r2, r0]
- cmp r0, 0x5
- bgt _0803F2C0
- ldr r2, _0803F2B8 @ =gUnknown_825DEAD
- ldr r3, [sp, 0x4]
- movs r0, 0x1A
- ldrsb r0, [r3, r0]
- b _0803F2CC
- .align 2, 0
-_0803F2B8: .4byte gUnknown_825DEAD
-_0803F2BC: .4byte gUnknown_2024020
-_0803F2C0:
- ldr r3, [sp, 0x14]
- b _0803F2E6
-_0803F2C4:
- ldr r2, _0803F344 @ =gUnknown_825DEAD
- ldr r1, [sp, 0x4]
- movs r0, 0x1A
- ldrsb r0, [r1, r0]
-_0803F2CC:
- lsls r0, 1
- adds r1, r0, r2
- ldrb r1, [r1]
- ldr r7, [sp, 0x14]
- adds r3, r7, 0
- muls r3, r1
- adds r2, 0x1
- adds r0, r2
- ldrb r1, [r0]
- adds r0, r3, 0
- bl __divsi3
- adds r3, r0, 0
-_0803F2E6:
- adds r0, r5, 0
- adds r1, r3, 0
- bl __divsi3
- adds r5, r0, 0
- movs r1, 0x32
- bl __divsi3
- adds r5, r0, 0
- ldr r0, [r6, 0x4C]
- movs r1, 0x10
- ands r0, r1
- cmp r0, 0
- beq _0803F310
- ldr r1, [sp, 0x24]
- ldrb r0, [r1]
- cmp r0, 0x3E
- beq _0803F310
- lsrs r0, r5, 31
- adds r0, r5, r0
- asrs r5, r0, 1
-_0803F310:
- movs r0, 0x1
- ldr r2, [sp, 0xC]
- ands r0, r2
- cmp r0, 0
- beq _0803F352
- ldrb r1, [r4]
- cmp r1, 0x1
- bne _0803F352
- ldr r0, _0803F348 @ =gBattleTypeFlags
- ldr r0, [r0]
- ands r0, r1
- cmp r0, 0
- beq _0803F34C
- movs r0, 0x2
- bl sub_803F5B4
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x2
- bne _0803F34C
- adds r0, r5, 0
- movs r1, 0x3
- bl __divsi3
- lsls r5, r0, 1
- b _0803F352
- .align 2, 0
-_0803F344: .4byte gUnknown_825DEAD
-_0803F348: .4byte gBattleTypeFlags
-_0803F34C:
- lsrs r0, r5, 31
- adds r0, r5, r0
- asrs r5, r0, 1
-_0803F352:
- ldr r0, _0803F3B0 @ =gBattleTypeFlags
- ldr r0, [r0]
- movs r1, 0x1
- ands r0, r1
- cmp r0, 0
- beq _0803F384
- ldr r0, _0803F3B4 @ =gBattleMoves
- ldr r3, [sp, 0x8]
- lsls r1, r3, 1
- adds r1, r3
- lsls r1, 2
- adds r1, r0
- ldrb r0, [r1, 0x6]
- cmp r0, 0x8
- bne _0803F384
- movs r0, 0x2
- bl sub_803F5B4
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x2
- bne _0803F384
- lsrs r0, r5, 31
- adds r0, r5, r0
- asrs r5, r0, 1
-_0803F384:
- cmp r5, 0
- bne _0803F38A
- movs r5, 0x1
-_0803F38A:
- mov r7, r9
- cmp r7, 0x9
- bne _0803F392
- movs r5, 0
-_0803F392:
- mov r0, r9
- cmp r0, 0x9
- bhi _0803F39A
- b _0803F59C
-_0803F39A:
- ldr r0, _0803F3B8 @ =gCritMultiplier
- ldrb r1, [r0]
- adds r4, r0, 0
- cmp r1, 0x2
- bne _0803F3C4
- movs r0, 0x1C
- ldrsb r0, [r6, r0]
- cmp r0, 0x6
- ble _0803F3C0
- ldr r2, _0803F3BC @ =gUnknown_825DEAD
- b _0803F3CA
- .align 2, 0
-_0803F3B0: .4byte gBattleTypeFlags
-_0803F3B4: .4byte gBattleMoves
-_0803F3B8: .4byte gCritMultiplier
-_0803F3BC: .4byte gUnknown_825DEAD
-_0803F3C0:
- mov r5, r8
- b _0803F3E2
-_0803F3C4:
- ldr r2, _0803F410 @ =gUnknown_825DEAD
- movs r0, 0x1C
- ldrsb r0, [r6, r0]
-_0803F3CA:
- lsls r0, 1
- adds r1, r0, r2
- ldrb r1, [r1]
- mov r5, r8
- muls r5, r1
- adds r2, 0x1
- adds r0, r2
- ldrb r1, [r0]
- adds r0, r5, 0
- bl __divsi3
- adds r5, r0, 0
-_0803F3E2:
- ldr r0, _0803F414 @ =gUnknown_2024020
- ldrh r0, [r0]
- muls r5, r0
- adds r0, r6, 0
- adds r0, 0x2A
- ldrb r0, [r0]
- lsls r0, 1
- movs r1, 0x5
- bl __divsi3
- adds r0, 0x2
- muls r5, r0
- ldrb r0, [r4]
- cmp r0, 0x2
- bne _0803F41C
- ldr r1, [sp, 0x4]
- movs r0, 0x1D
- ldrsb r0, [r1, r0]
- cmp r0, 0x5
- bgt _0803F418
- ldr r2, _0803F410 @ =gUnknown_825DEAD
- b _0803F424
- .align 2, 0
-_0803F410: .4byte gUnknown_825DEAD
-_0803F414: .4byte gUnknown_2024020
-_0803F418:
- ldr r3, [sp, 0x18]
- b _0803F43E
-_0803F41C:
- ldr r2, _0803F484 @ =gUnknown_825DEAD
- ldr r7, [sp, 0x4]
- movs r0, 0x1D
- ldrsb r0, [r7, r0]
-_0803F424:
- lsls r0, 1
- adds r1, r0, r2
- ldrb r1, [r1]
- ldr r6, [sp, 0x18]
- adds r3, r6, 0
- muls r3, r1
- adds r2, 0x1
- adds r0, r2
- ldrb r1, [r0]
- adds r0, r3, 0
- bl __divsi3
- adds r3, r0, 0
-_0803F43E:
- adds r0, r5, 0
- adds r1, r3, 0
- bl __divsi3
- adds r5, r0, 0
- movs r1, 0x32
- bl __divsi3
- adds r5, r0, 0
- movs r0, 0x2
- ldr r7, [sp, 0xC]
- ands r0, r7
- cmp r0, 0
- beq _0803F492
- ldrb r1, [r4]
- cmp r1, 0x1
- bne _0803F492
- ldr r0, _0803F488 @ =gBattleTypeFlags
- ldr r0, [r0]
- ands r0, r1
- cmp r0, 0
- beq _0803F48C
- movs r0, 0x2
- bl sub_803F5B4
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x2
- bne _0803F48C
- adds r0, r5, 0
- movs r1, 0x3
- bl __divsi3
- lsls r5, r0, 1
- b _0803F492
- .align 2, 0
-_0803F484: .4byte gUnknown_825DEAD
-_0803F488: .4byte gBattleTypeFlags
-_0803F48C:
- lsrs r0, r5, 31
- adds r0, r5, r0
- asrs r5, r0, 1
-_0803F492:
- ldr r0, _0803F50C @ =gBattleTypeFlags
- ldr r0, [r0]
- movs r1, 0x1
- ands r0, r1
- cmp r0, 0
- beq _0803F4C4
- ldr r0, _0803F510 @ =gBattleMoves
- ldr r2, [sp, 0x8]
- lsls r1, r2, 1
- adds r1, r2
- lsls r1, 2
- adds r1, r0
- ldrb r0, [r1, 0x6]
- cmp r0, 0x8
- bne _0803F4C4
- movs r0, 0x2
- bl sub_803F5B4
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x2
- bne _0803F4C4
- lsrs r0, r5, 31
- adds r0, r5, r0
- asrs r5, r0, 1
-_0803F4C4:
- movs r0, 0
- str r0, [sp]
- movs r0, 0xE
- movs r1, 0
- movs r2, 0xD
- movs r3, 0
- bl sub_8019F18
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0
- bne _0803F574
- str r0, [sp]
- movs r0, 0xE
- movs r1, 0
- movs r2, 0x4D
- movs r3, 0
- bl sub_8019F18
- lsls r0, 24
- cmp r0, 0
- bne _0803F574
- ldr r2, _0803F514 @ =gBattleWeather
- ldrh r1, [r2]
- movs r0, 0x1
- ands r0, r1
- adds r4, r2, 0
- cmp r0, 0
- beq _0803F52C
- mov r3, r9
- cmp r3, 0xA
- beq _0803F518
- cmp r3, 0xB
- beq _0803F520
- b _0803F52C
- .align 2, 0
-_0803F50C: .4byte gBattleTypeFlags
-_0803F510: .4byte gBattleMoves
-_0803F514: .4byte gBattleWeather
-_0803F518:
- lsrs r0, r5, 31
- adds r0, r5, r0
- asrs r5, r0, 1
- b _0803F52C
-_0803F520:
- lsls r0, r5, 4
- subs r0, r5
- movs r1, 0xA
- bl __divsi3
- adds r5, r0, 0
-_0803F52C:
- ldrh r1, [r4]
- movs r0, 0x9F
- ands r0, r1
- cmp r0, 0
- beq _0803F544
- ldr r0, _0803F55C @ =gCurrentMove
- ldrh r0, [r0]
- cmp r0, 0x4C
- bne _0803F544
- lsrs r0, r5, 31
- adds r0, r5, r0
- asrs r5, r0, 1
-_0803F544:
- ldrh r1, [r4]
- movs r0, 0x60
- ands r0, r1
- cmp r0, 0
- beq _0803F574
- mov r6, r9
- cmp r6, 0xA
- beq _0803F560
- cmp r6, 0xB
- beq _0803F56E
- b _0803F574
- .align 2, 0
-_0803F55C: .4byte gCurrentMove
-_0803F560:
- lsls r0, r5, 4
- subs r0, r5
- movs r1, 0xA
- bl __divsi3
- adds r5, r0, 0
- b _0803F574
-_0803F56E:
- lsrs r0, r5, 31
- adds r0, r5, r0
- asrs r5, r0, 1
-_0803F574:
- ldr r0, _0803F5B0 @ =gBattleResources
- ldr r0, [r0]
- ldr r0, [r0, 0x4]
- ldr r7, [sp, 0x10]
- lsls r1, r7, 2
- adds r0, r1
- ldr r0, [r0]
- movs r1, 0x1
- ands r0, r1
- cmp r0, 0
- beq _0803F59C
- mov r0, r9
- cmp r0, 0xA
- bne _0803F59C
- lsls r0, r5, 4
- subs r0, r5
- movs r1, 0xA
- bl __divsi3
- adds r5, r0, 0
-_0803F59C:
- adds r0, r5, 0x2
- add sp, 0x2C
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r1}
- bx r1
- .align 2, 0
-_0803F5B0: .4byte gBattleResources
- thumb_func_end sub_803ECEC
-
- .align 2, 0 @ Don't pad with nop.
diff --git a/asm/daycare.s b/asm/daycare.s
index 9357c5cdb..7479ef544 100644
--- a/asm/daycare.s
+++ b/asm/daycare.s
@@ -331,7 +331,7 @@ _08045628:
movs r6, 0
cmp r0, r7
bne _08045638
- ldr r0, _08045658 @ =gUnknown_2024022
+ ldr r0, _08045658 @ =gMoveToLearn
ldrh r1, [r0]
adds r0, r4, 0
bl DeleteFirstMoveAndGiveMoveToMon
@@ -352,7 +352,7 @@ _0804564C:
pop {r0}
bx r0
.align 2, 0
-_08045658: .4byte gUnknown_2024022
+_08045658: .4byte gMoveToLearn
thumb_func_end ApplyDaycareExperience
thumb_func_start TakeSelectedPokemonFromDaycare
@@ -386,7 +386,7 @@ TakeSelectedPokemonFromDaycare: @ 804565C
add r2, sp, 0x64
mov r0, sp
movs r1, 0x19
- bl sub_804037C
+ bl SetMonData
mov r0, sp
bl ApplyDaycareExperience
_080456AA:
@@ -488,7 +488,7 @@ GetLevelAfterDaycareSteps: @ 804574C
add r2, sp, 0x50
mov r0, sp
movs r1, 0x19
- bl sub_80404D0
+ bl SetBoxMonData
mov r0, sp
bl GetLevelFromBoxMonExp
lsls r0, 24
@@ -766,7 +766,7 @@ sub_8045970: @ 8045970
lsrs r2, r0, 16
movs r0, 0
mov r8, r0
- ldr r0, _0804599C @ =gUnknown_8259754
+ ldr r0, _0804599C @ =gEvolutionTable
mov r12, r0
_08045982:
movs r7, 0
@@ -784,7 +784,7 @@ _08045990:
lsrs r2, r4, 16
b _080459CC
.align 2, 0
-_0804599C: .4byte gUnknown_8259754
+_0804599C: .4byte gEvolutionTable
_080459A0:
adds r1, 0x1
cmp r1, 0x4
@@ -1039,7 +1039,7 @@ _08045B64:
strb r0, [r2]
mov r0, r9
movs r1, 0x27
- bl sub_804037C
+ bl SetMonData
b _08045C0E
_08045B82:
add r4, sp, 0x10
@@ -1094,7 +1094,7 @@ _08045BD0:
movs r1, 0x2B
_08045BE8:
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
b _08045C0E
_08045BF0:
add r4, sp, 0x10
@@ -1109,7 +1109,7 @@ _08045BF0:
mov r0, r9
movs r1, 0x2C
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
_08045C0E:
adds r0, r5, 0x1
lsls r0, 24
@@ -1783,7 +1783,7 @@ sub_80460D4: @ 80460D4
strb r0, [r2]
mov r0, sp
movs r1, 0x2D
- bl sub_804037C
+ bl SetMonData
ldr r0, _0804614C @ =gPlayerParty
movs r1, 0xFA
lsls r1, 1
@@ -1842,11 +1842,11 @@ CreateEgg: @ 8046150
adds r0, r7, 0
movs r1, 0x26
add r2, sp, 0x10
- bl sub_804037C
+ bl SetMonData
ldr r2, _08046200 @ =gUnknown_825F83E
adds r0, r7, 0
movs r1, 0x2
- bl sub_804037C
+ bl SetMonData
lsls r2, r5, 3
subs r2, r5
lsls r2, 2
@@ -1854,15 +1854,15 @@ CreateEgg: @ 8046150
adds r2, r0
adds r0, r7, 0
movs r1, 0x20
- bl sub_804037C
+ bl SetMonData
adds r0, r7, 0
movs r1, 0x24
mov r2, r8
- bl sub_804037C
+ bl SetMonData
adds r0, r7, 0
movs r1, 0x3
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
cmp r6, 0
beq _080461E2
add r2, sp, 0x14
@@ -1870,7 +1870,7 @@ CreateEgg: @ 8046150
strb r0, [r2]
adds r0, r7, 0
movs r1, 0x23
- bl sub_804037C
+ bl SetMonData
_080461E2:
mov r2, sp
adds r2, 0x15
@@ -1878,7 +1878,7 @@ _080461E2:
strb r0, [r2]
adds r0, r7, 0
movs r1, 0x2D
- bl sub_804037C
+ bl SetMonData
add sp, 0x18
pop {r3,r4}
mov r8, r3
@@ -1936,11 +1936,11 @@ SetInitialEggData: @ 8046208
adds r0, r6, 0
movs r1, 0x26
add r2, sp, 0x10
- bl sub_804037C
+ bl SetMonData
ldr r2, _080462A4 @ =gUnknown_825F83E
adds r0, r6, 0
movs r1, 0x2
- bl sub_804037C
+ bl SetMonData
lsls r2, r5, 3
subs r2, r5
lsls r2, 2
@@ -1948,15 +1948,15 @@ SetInitialEggData: @ 8046208
adds r2, r0
adds r0, r6, 0
movs r1, 0x20
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
movs r1, 0x24
mov r2, r9
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
movs r1, 0x3
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
add sp, 0x14
pop {r3,r4}
mov r8, r3
@@ -2089,11 +2089,11 @@ _08046390:
adds r0, r4, 0
movs r1, 0x20
mov r2, sp
- bl sub_804037C
+ bl SetMonData
_0804639E:
adds r5, 0x1
_080463A0:
- ldr r0, _080463B4 @ =gUnknown_2024029
+ ldr r0, _080463B4 @ =gPlayerPartyCount
ldrb r0, [r0]
cmp r5, r0
bcc _08046350
@@ -2105,7 +2105,7 @@ _080463AA:
pop {r1}
bx r1
.align 2, 0
-_080463B4: .4byte gUnknown_2024029
+_080463B4: .4byte gPlayerPartyCount
thumb_func_end sub_80462C4
thumb_func_start sub_80463B8
diff --git a/asm/decompress.s b/asm/decompress.s
index 9cff25817..8c213a8d1 100644
--- a/asm/decompress.s
+++ b/asm/decompress.s
@@ -27,7 +27,7 @@ LoadCompressedObjectPic: @ 800EBCC
sub sp, 0x8
adds r4, r0, 0
ldr r0, [r4]
- ldr r5, _0800EBFC @ =gUnknown_201C000
+ ldr r5, _0800EBFC @ =gDecompressionBuffer
adds r1, r5, 0
bl LZ77UnCompWram
str r5, [sp]
@@ -45,7 +45,7 @@ LoadCompressedObjectPic: @ 800EBCC
pop {r1}
bx r1
.align 2, 0
-_0800EBFC: .4byte gUnknown_201C000
+_0800EBFC: .4byte gDecompressionBuffer
thumb_func_end LoadCompressedObjectPic
thumb_func_start LoadCompressedObjectPicOverrideBuffer
@@ -76,7 +76,7 @@ LoadCompressedObjectPalette: @ 800EC28
sub sp, 0x8
adds r5, r0, 0
ldr r0, [r5]
- ldr r4, _0800EC54 @ =gUnknown_201C000
+ ldr r4, _0800EC54 @ =gDecompressionBuffer
adds r1, r4, 0
bl LZ77UnCompWram
str r4, [sp]
@@ -93,7 +93,7 @@ LoadCompressedObjectPalette: @ 800EC28
pop {r0}
bx r0
.align 2, 0
-_0800EC54: .4byte gUnknown_201C000
+_0800EC54: .4byte gDecompressionBuffer
_0800EC58: .4byte 0xffff0000
thumb_func_end LoadCompressedObjectPalette
diff --git a/asm/easy_chat.s b/asm/easy_chat.s
index 6e20b06da..05a45baa1 100644
--- a/asm/easy_chat.s
+++ b/asm/easy_chat.s
@@ -158,11 +158,11 @@ _080BD810:
_080BD814:
movs r0, 0xB
muls r0, r2
- ldr r1, _080BD820 @ =gUnknown_8245EE0
+ ldr r1, _080BD820 @ =gSpeciesNames
adds r0, r1
b _080BD846
.align 2, 0
-_080BD820: .4byte gUnknown_8245EE0
+_080BD820: .4byte gSpeciesNames
_080BD824:
movs r0, 0xD
muls r0, r2
diff --git a/asm/egg_hatch.s b/asm/egg_hatch.s
index 16732a4d3..02d8f123f 100644
--- a/asm/egg_hatch.s
+++ b/asm/egg_hatch.s
@@ -110,7 +110,7 @@ _08046CC8:
adds r2, r0
adds r2, 0x10
adds r0, r5, 0
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
@@ -123,7 +123,7 @@ _08046CE6:
lsls r2, r4, 2
adds r2, r7, r2
adds r0, r5, 0
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
@@ -135,30 +135,30 @@ _08046CE6:
adds r0, r5, 0
movs r1, 0x3
mov r2, r9
- bl sub_804037C
+ bl SetMonData
adds r0, r5, 0
movs r1, 0x25
mov r2, r10
- bl sub_804037C
+ bl SetMonData
adds r0, r5, 0
movs r1, 0x8
ldr r2, [sp, 0x40]
- bl sub_804037C
+ bl SetMonData
movs r0, 0x78
ldr r1, [sp, 0x44]
strb r0, [r1]
adds r0, r5, 0
movs r1, 0x20
ldr r2, [sp, 0x44]
- bl sub_804037C
+ bl SetMonData
adds r0, r5, 0
movs r1, 0x22
ldr r2, [sp, 0x4C]
- bl sub_804037C
+ bl SetMonData
adds r0, r5, 0
movs r1, 0x50
ldr r2, [sp, 0x48]
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
adds r1, r5, 0
movs r2, 0x64
@@ -193,7 +193,7 @@ AddHatchedMonToParty: @ 8046D60
adds r0, r5, 0
movs r1, 0x2D
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
adds r0, r5, 0
movs r1, 0xB
bl GetMonData
@@ -206,7 +206,7 @@ AddHatchedMonToParty: @ 8046D60
adds r0, r5, 0
movs r1, 0x2
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
bl SpeciesToNationalPokedexNum
adds r4, r0, 0
@@ -227,20 +227,20 @@ AddHatchedMonToParty: @ 8046D60
strh r0, [r2]
adds r0, r5, 0
movs r1, 0x26
- bl sub_804037C
+ bl SetMonData
add r2, sp, 0x10
movs r0, 0
strh r0, [r2]
adds r0, r5, 0
movs r1, 0x24
- bl sub_804037C
+ bl SetMonData
bl sav1_map_get_name
mov r2, sp
adds r2, 0x12
strb r0, [r2]
adds r0, r5, 0
movs r1, 0x23
- bl sub_804037C
+ bl SetMonData
adds r0, r5, 0
bl MonRestorePP
adds r0, r5, 0
@@ -400,7 +400,7 @@ _08046F1C:
lsls r0, r4, 3
ldr r1, _08046F64 @ =gUnknown_82350AC
adds r0, r1
- ldr r1, _08046F68 @ =gUnknown_202401C
+ ldr r1, _08046F68 @ =gMonSpritesGfxPtr
ldr r2, [r1]
mov r6, r8
lsls r1, r6, 1
@@ -419,14 +419,14 @@ _08046F1C:
b _08046FA6
.align 2, 0
_08046F64: .4byte gUnknown_82350AC
-_08046F68: .4byte gUnknown_202401C
+_08046F68: .4byte gMonSpritesGfxPtr
_08046F6C:
adds r0, r5, 0
bl GetMonSpritePalStruct
ldrh r0, [r0, 0x4]
adds r1, r4, 0
bl sub_803F7D4
- ldr r0, _08046FB4 @ =gUnknown_20244DC
+ ldr r0, _08046FB4 @ =gMultiuseSpriteTemplate
movs r1, 0x78
movs r2, 0x46
movs r3, 0x6
@@ -456,7 +456,7 @@ _08046FA6:
pop {r1}
bx r1
.align 2, 0
-_08046FB4: .4byte gUnknown_20244DC
+_08046FB4: .4byte gMultiuseSpriteTemplate
_08046FB8: .4byte gSprites
_08046FBC: .4byte SpriteCallbackDummy
thumb_func_end sub_8046ED0
@@ -778,7 +778,7 @@ EggHatchSetMonNickname: @ 80472A0
adds r0, r1
ldr r2, _080472D8 @ =gStringVar3
movs r1, 0x2
- bl sub_804037C
+ bl SetMonData
bl FreeMonSpritesGfx
ldr r0, _080472DC @ =gUnknown_3000E74
ldr r0, [r0]
diff --git a/asm/event_data.s b/asm/event_data.s
index e2758639f..1875449fa 100644
--- a/asm/event_data.s
+++ b/asm/event_data.s
@@ -829,9 +829,9 @@ sub_806E6FC: @ 806E6FC
strh r0, [r1]
ldr r1, _0806E790 @ =gUnknown_20370D2
strh r0, [r1]
- ldr r1, _0806E794 @ =gUnknown_20370D6
+ ldr r1, _0806E794 @ =gSpecialVar_MonBoxId
strh r0, [r1]
- ldr r1, _0806E798 @ =gUnknown_20370D8
+ ldr r1, _0806E798 @ =gSpecialVar_MonBoxPos
strh r0, [r1]
ldr r1, _0806E79C @ =gUnknown_20370DA
strh r0, [r1]
@@ -857,8 +857,8 @@ _0806E784: .4byte gUnknown_20370D4
_0806E788: .4byte gUnknown_20370D0
_0806E78C: .4byte gUnknown_203AD30
_0806E790: .4byte gUnknown_20370D2
-_0806E794: .4byte gUnknown_20370D6
-_0806E798: .4byte gUnknown_20370D8
+_0806E794: .4byte gSpecialVar_MonBoxId
+_0806E798: .4byte gSpecialVar_MonBoxPos
_0806E79C: .4byte gUnknown_20370DA
_0806E7A0: .4byte gUnknown_20370DC
_0806E7A4: .4byte gUnknown_20370DE
diff --git a/asm/evolution_scene.s b/asm/evolution_scene.s
index 1966dcaca..4ee374bed 100644
--- a/asm/evolution_scene.s
+++ b/asm/evolution_scene.s
@@ -221,7 +221,7 @@ EvolutionScene: @ 80CDDF4
mov r2, r10
muls r2, r1
adds r1, r2, 0
- ldr r2, _080CE0B4 @ =gUnknown_8245EE0
+ ldr r2, _080CE0B4 @ =gSpeciesNames
adds r1, r2
bl StringCopy
adds r0, r4, 0
@@ -241,7 +241,7 @@ EvolutionScene: @ 80CDDF4
lsls r0, r5, 3
ldr r1, _080CE0B8 @ =gUnknown_82350AC
adds r0, r1
- ldr r2, _080CE0BC @ =gUnknown_202401C
+ ldr r2, _080CE0BC @ =gMonSpritesGfxPtr
ldr r1, [r2]
ldr r1, [r1, 0x8]
adds r2, r5, 0
@@ -258,7 +258,7 @@ EvolutionScene: @ 80CDDF4
adds r0, r5, 0
movs r1, 0x1
bl sub_803F7D4
- ldr r0, _080CE0C0 @ =gUnknown_20244DC
+ ldr r0, _080CE0C0 @ =gMultiuseSpriteTemplate
mov r8, r0
ldr r1, _080CE0C4 @ =gDummySpriteAffineAnimTable
str r1, [r0, 0x10]
@@ -297,7 +297,7 @@ EvolutionScene: @ 80CDDF4
lsls r0, r1, 3
ldr r2, _080CE0B8 @ =gUnknown_82350AC
adds r0, r2
- ldr r2, _080CE0BC @ =gUnknown_202401C
+ ldr r2, _080CE0BC @ =gMonSpritesGfxPtr
ldr r1, [r2]
ldr r1, [r1, 0x10]
mov r2, r10
@@ -414,10 +414,10 @@ _080CE0A4: .4byte gReservedSpritePaletteCount
_080CE0A8: .4byte gUnknown_2039A20
_080CE0AC: .4byte gStringVar1
_080CE0B0: .4byte gStringVar2
-_080CE0B4: .4byte gUnknown_8245EE0
+_080CE0B4: .4byte gSpeciesNames
_080CE0B8: .4byte gUnknown_82350AC
-_080CE0BC: .4byte gUnknown_202401C
-_080CE0C0: .4byte gUnknown_20244DC
+_080CE0BC: .4byte gMonSpritesGfxPtr
+_080CE0C0: .4byte gMultiuseSpriteTemplate
_080CE0C4: .4byte gDummySpriteAffineAnimTable
_080CE0C8: .4byte gSprites
_080CE0CC: .4byte nullsub_10
@@ -526,7 +526,7 @@ CB2_EvolutionSceneLoadGraphics: @ 80CE0E8
lsls r0, r5, 3
ldr r1, _080CE2B8 @ =gUnknown_82350AC
adds r0, r1
- ldr r1, _080CE2BC @ =gUnknown_202401C
+ ldr r1, _080CE2BC @ =gMonSpritesGfxPtr
ldr r1, [r1]
ldr r1, [r1, 0x10]
adds r2, r5, 0
@@ -543,7 +543,7 @@ CB2_EvolutionSceneLoadGraphics: @ 80CE0E8
adds r0, r5, 0
movs r1, 0x3
bl sub_803F7D4
- ldr r0, _080CE2C0 @ =gUnknown_20244DC
+ ldr r0, _080CE2C0 @ =gMultiuseSpriteTemplate
ldr r1, _080CE2C4 @ =gDummySpriteAffineAnimTable
str r1, [r0, 0x10]
movs r1, 0x78
@@ -619,8 +619,8 @@ _080CE2AC: .4byte gUnknown_2022982
_080CE2B0: .4byte gUnknown_2022B50
_080CE2B4: .4byte gReservedSpritePaletteCount
_080CE2B8: .4byte gUnknown_82350AC
-_080CE2BC: .4byte gUnknown_202401C
-_080CE2C0: .4byte gUnknown_20244DC
+_080CE2BC: .4byte gMonSpritesGfxPtr
+_080CE2C0: .4byte gMultiuseSpriteTemplate
_080CE2C4: .4byte gDummySpriteAffineAnimTable
_080CE2C8: .4byte gSprites
_080CE2CC: .4byte nullsub_10
@@ -772,7 +772,7 @@ _080CE414:
lsls r0, r6, 3
ldr r1, _080CE454 @ =gUnknown_82350AC
adds r0, r1
- ldr r1, _080CE458 @ =gUnknown_202401C
+ ldr r1, _080CE458 @ =gMonSpritesGfxPtr
ldr r1, [r1]
ldr r1, [r1, 0x10]
adds r2, r6, 0
@@ -789,12 +789,12 @@ _080CE414:
b _080CE4EC
.align 2, 0
_080CE454: .4byte gUnknown_82350AC
-_080CE458: .4byte gUnknown_202401C
+_080CE458: .4byte gMonSpritesGfxPtr
_080CE45C:
adds r0, r6, 0
movs r1, 0x1
bl sub_803F7D4
- ldr r0, _080CE4B4 @ =gUnknown_20244DC
+ ldr r0, _080CE4B4 @ =gMultiuseSpriteTemplate
ldr r1, _080CE4B8 @ =gDummySpriteAffineAnimTable
str r1, [r0, 0x10]
movs r1, 0x78
@@ -832,7 +832,7 @@ _080CE45C:
bl sub_80504B0
b _080CE534
.align 2, 0
-_080CE4B4: .4byte gUnknown_20244DC
+_080CE4B4: .4byte gMultiuseSpriteTemplate
_080CE4B8: .4byte gDummySpriteAffineAnimTable
_080CE4BC: .4byte gUnknown_2039A20
_080CE4C0: .4byte gSprites
@@ -921,7 +921,7 @@ TradeEvolutionScene: @ 80CE540
ldr r0, _080CE6B4 @ =gStringVar2
movs r1, 0xB
muls r1, r5
- ldr r2, _080CE6B8 @ =gUnknown_8245EE0
+ ldr r2, _080CE6B8 @ =gSpeciesNames
adds r1, r2
bl StringCopy
ldr r1, _080CE6BC @ =gAffineAnimsDisabled
@@ -953,7 +953,7 @@ TradeEvolutionScene: @ 80CE540
lsls r0, r5, 3
ldr r1, _080CE6C4 @ =gUnknown_82350AC
adds r0, r1
- ldr r1, _080CE6C8 @ =gUnknown_202401C
+ ldr r1, _080CE6C8 @ =gMonSpritesGfxPtr
ldr r1, [r1]
ldr r1, [r1, 0x8]
adds r2, r5, 0
@@ -970,7 +970,7 @@ TradeEvolutionScene: @ 80CE540
adds r0, r5, 0
movs r1, 0x1
bl sub_803F7D4
- ldr r0, _080CE6CC @ =gUnknown_20244DC
+ ldr r0, _080CE6CC @ =gMultiuseSpriteTemplate
ldr r1, _080CE6D0 @ =gDummySpriteAffineAnimTable
str r1, [r0, 0x10]
movs r1, 0x78
@@ -1066,12 +1066,12 @@ TradeEvolutionScene: @ 80CE540
.align 2, 0
_080CE6B0: .4byte gStringVar1
_080CE6B4: .4byte gStringVar2
-_080CE6B8: .4byte gUnknown_8245EE0
+_080CE6B8: .4byte gSpeciesNames
_080CE6BC: .4byte gAffineAnimsDisabled
_080CE6C0: .4byte gUnknown_2039A20
_080CE6C4: .4byte gUnknown_82350AC
-_080CE6C8: .4byte gUnknown_202401C
-_080CE6CC: .4byte gUnknown_20244DC
+_080CE6C8: .4byte gMonSpritesGfxPtr
+_080CE6CC: .4byte gMultiuseSpriteTemplate
_080CE6D0: .4byte gDummySpriteAffineAnimTable
_080CE6D4: .4byte gSprites
_080CE6D8: .4byte nullsub_10
@@ -1133,7 +1133,7 @@ CreateShedinja: @ 80CE748
str r0, [sp, 0x8]
add r0, r10
lsls r7, r0, 3
- ldr r1, _080CE8C4 @ =gUnknown_8259754
+ ldr r1, _080CE8C4 @ =gEvolutionTable
adds r1, r7
mov r8, r1
ldrh r0, [r1]
@@ -1141,7 +1141,7 @@ CreateShedinja: @ 80CE748
beq _080CE778
b _080CE8B2
_080CE778:
- ldr r6, _080CE8C8 @ =gUnknown_2024029
+ ldr r6, _080CE8C8 @ =gPlayerPartyCount
ldrb r0, [r6]
cmp r0, 0x5
bls _080CE782
@@ -1158,11 +1158,11 @@ _080CE782:
ldrb r0, [r6]
muls r0, r5
adds r0, r4
- ldr r1, _080CE8C4 @ =gUnknown_8259754
+ ldr r1, _080CE8C4 @ =gEvolutionTable
adds r2, r1, r7
adds r2, 0xC
movs r1, 0xB
- bl sub_804037C
+ bl SetMonData
ldrb r0, [r6]
muls r0, r5
adds r0, r4
@@ -1170,28 +1170,28 @@ _080CE782:
ldrh r2, [r1, 0xC]
movs r1, 0xB
muls r2, r1
- ldr r1, _080CE8D0 @ =gUnknown_8245EE0
+ ldr r1, _080CE8D0 @ =gSpeciesNames
adds r2, r1
movs r1, 0x2
- bl sub_804037C
+ bl SetMonData
ldrb r0, [r6]
muls r0, r5
adds r0, r4
movs r1, 0xC
mov r2, sp
- bl sub_804037C
+ bl SetMonData
ldrb r0, [r6]
muls r0, r5
adds r0, r4
movs r1, 0x8
mov r2, sp
- bl sub_804037C
+ bl SetMonData
ldrb r0, [r6]
muls r0, r5
adds r0, r4
movs r1, 0xA
mov r2, sp
- bl sub_804037C
+ bl SetMonData
movs r4, 0x32
ldr r0, [sp, 0x8]
mov r8, r0
@@ -1204,12 +1204,12 @@ _080CE7F0:
adds r0, r1
adds r1, r4, 0
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r4, 0x1
cmp r4, 0x36
ble _080CE7F0
movs r4, 0x43
- ldr r7, _080CE8C8 @ =gUnknown_2024029
+ ldr r7, _080CE8C8 @ =gPlayerPartyCount
_080CE80C:
ldrb r0, [r7]
movs r6, 0x64
@@ -1218,17 +1218,17 @@ _080CE80C:
adds r0, r5
adds r1, r4, 0
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r4, 0x1
cmp r4, 0x4F
ble _080CE80C
- ldr r4, _080CE8C8 @ =gUnknown_2024029
+ ldr r4, _080CE8C8 @ =gPlayerPartyCount
ldrb r0, [r4]
muls r0, r6
adds r0, r5
movs r1, 0x37
mov r2, sp
- bl sub_804037C
+ bl SetMonData
movs r0, 0xFF
str r0, [sp]
ldrb r0, [r4]
@@ -1236,13 +1236,13 @@ _080CE80C:
adds r0, r5
movs r1, 0x40
mov r2, sp
- bl sub_804037C
+ bl SetMonData
ldrb r0, [r4]
muls r0, r6
adds r0, r5
bl CalculateMonStats
bl CalculatePlayerPartyCount
- ldr r0, _080CE8C4 @ =gUnknown_8259754
+ ldr r0, _080CE8C4 @ =gEvolutionTable
mov r4, r8
add r4, r10
lsls r4, 3
@@ -1280,7 +1280,7 @@ _080CE80C:
ldr r2, _080CE8D8 @ =gUnknown_83F8440
mov r0, r9
movs r1, 0x2
- bl sub_804037C
+ bl SetMonData
_080CE8B2:
add sp, 0xC
pop {r3-r5}
@@ -1291,10 +1291,10 @@ _080CE8B2:
pop {r0}
bx r0
.align 2, 0
-_080CE8C4: .4byte gUnknown_8259754
-_080CE8C8: .4byte gUnknown_2024029
+_080CE8C4: .4byte gEvolutionTable
+_080CE8C8: .4byte gPlayerPartyCount
_080CE8CC: .4byte gPlayerParty
-_080CE8D0: .4byte gUnknown_8245EE0
+_080CE8D0: .4byte gSpeciesNames
_080CE8D4: .4byte 0x0000012f
_080CE8D8: .4byte gUnknown_83F8440
thumb_func_end CreateShedinja
@@ -1817,7 +1817,7 @@ _080CED3A:
adds r2, 0xC
mov r0, r9
movs r1, 0xB
- bl sub_804037C
+ bl SetMonData
mov r0, r9
bl CalculateMonStats
ldrh r1, [r4, 0xA]
@@ -1881,7 +1881,7 @@ _080CEDC6:
movs r1, 0x2
add r2, sp, 0x4
bl GetMonData
- ldr r0, _080CEE24 @ =gUnknown_2022AB8
+ ldr r0, _080CEE24 @ =gBattleTextBuff1
add r1, sp, 0x4
bl StringCopy10
ldr r0, _080CEE28 @ =0x0000ffff
@@ -1892,7 +1892,7 @@ _080CEDC6:
b _080CF528
.align 2, 0
_080CEE20: .4byte gTasks
-_080CEE24: .4byte gUnknown_2022AB8
+_080CEE24: .4byte gBattleTextBuff1
_080CEE28: .4byte 0x0000ffff
_080CEE2C:
ldr r0, _080CEE3C @ =0x0000fffe
@@ -2088,7 +2088,7 @@ _080CEFB6:
ldr r0, _080CEFEC @ =gUnknown_83FDF3C
ldr r0, [r0, 0xC]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r0, _080CEFF0 @ =gUnknown_202298C
+ ldr r0, _080CEFF0 @ =gDisplayedStringBattle
movs r1, 0
bl sub_80D87BC
ldr r0, _080CEFF4 @ =gTasks
@@ -2106,7 +2106,7 @@ _080CEFDE:
.align 2, 0
_080CEFE8: .4byte 0x00000101
_080CEFEC: .4byte gUnknown_83FDF3C
-_080CEFF0: .4byte gUnknown_202298C
+_080CEFF0: .4byte gDisplayedStringBattle
_080CEFF4: .4byte gTasks
_080CEFF8:
movs r0, 0
@@ -2191,7 +2191,7 @@ _080CF0A2:
ldr r0, _080CF0C8 @ =gUnknown_83FDF3C
ldr r0, [r0, 0x10]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r0, _080CF0CC @ =gUnknown_202298C
+ ldr r0, _080CF0CC @ =gDisplayedStringBattle
movs r1, 0
bl sub_80D87BC
ldr r0, _080CF0D0 @ =gTasks
@@ -2204,7 +2204,7 @@ _080CF0A2:
b _080CF526
.align 2, 0
_080CF0C8: .4byte gUnknown_83FDF3C
-_080CF0CC: .4byte gUnknown_202298C
+_080CF0CC: .4byte gDisplayedStringBattle
_080CF0D0: .4byte gTasks
_080CF0D4:
movs r0, 0
@@ -2223,7 +2223,7 @@ _080CF0EE:
ldr r0, _080CF110 @ =gUnknown_83FDF3C
ldr r0, [r0, 0x14]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r0, _080CF114 @ =gUnknown_202298C
+ ldr r0, _080CF114 @ =gDisplayedStringBattle
movs r1, 0
bl sub_80D87BC
ldr r0, _080CF118 @ =gTasks
@@ -2236,7 +2236,7 @@ _080CF0EE:
b _080CF526
.align 2, 0
_080CF110: .4byte gUnknown_83FDF3C
-_080CF114: .4byte gUnknown_202298C
+_080CF114: .4byte gDisplayedStringBattle
_080CF118: .4byte gTasks
_080CF11C:
movs r0, 0
@@ -2251,7 +2251,7 @@ _080CF11C:
ldr r0, _080CF1A8 @ =gUnknown_83FDF3C
ldr r0, [r0, 0x18]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r0, _080CF1AC @ =gUnknown_202298C
+ ldr r0, _080CF1AC @ =gDisplayedStringBattle
movs r1, 0
bl sub_80D87BC
ldr r0, _080CF1B0 @ =gTasks
@@ -2305,7 +2305,7 @@ _080CF176:
b _080CF528
.align 2, 0
_080CF1A8: .4byte gUnknown_83FDF3C
-_080CF1AC: .4byte gUnknown_202298C
+_080CF1AC: .4byte gDisplayedStringBattle
_080CF1B0: .4byte gTasks
_080CF1B4: .4byte gUnknown_83FE791
_080CF1B8: .4byte gUnknown_2023E82
@@ -2440,13 +2440,13 @@ _080CF2C2:
lsls r5, 3
adds r5, r1
ldrb r1, [r5, 0x1C]
- ldr r2, _080CF300 @ =gUnknown_2024029
+ ldr r2, _080CF300 @ =gPlayerPartyCount
ldrb r2, [r2]
subs r2, 0x1
lsls r2, 24
lsrs r2, 24
ldr r3, _080CF304 @ =CB2_EvolutionSceneLoadGraphics
- ldr r4, _080CF308 @ =gUnknown_2024022
+ ldr r4, _080CF308 @ =gMoveToLearn
ldrh r4, [r4]
str r4, [sp]
bl sub_8134738
@@ -2458,9 +2458,9 @@ _080CF2C2:
_080CF2F4: .4byte gUnknown_2037AB8
_080CF2F8: .4byte gPlayerParty
_080CF2FC: .4byte gTasks
-_080CF300: .4byte gUnknown_2024029
+_080CF300: .4byte gPlayerPartyCount
_080CF304: .4byte CB2_EvolutionSceneLoadGraphics
-_080CF308: .4byte gUnknown_2024022
+_080CF308: .4byte gMoveToLearn
_080CF30C:
ldr r0, _080CF340 @ =gUnknown_2037AB8
ldrb r1, [r0, 0x7]
@@ -2508,7 +2508,7 @@ _080CF34C:
adds r0, r3
ldr r0, [r0]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r0, _080CF390 @ =gUnknown_202298C
+ ldr r0, _080CF390 @ =gDisplayedStringBattle
movs r1, 0
bl sub_80D87BC
ldr r1, _080CF394 @ =gTasks
@@ -2522,10 +2522,10 @@ _080CF34C:
.align 2, 0
_080CF388: .4byte gUnknown_83FDF3C
_080CF38C: .4byte 0x000004cc
-_080CF390: .4byte gUnknown_202298C
+_080CF390: .4byte gDisplayedStringBattle
_080CF394: .4byte gTasks
_080CF398:
- ldr r1, _080CF3D4 @ =gUnknown_2022AC8
+ ldr r1, _080CF3D4 @ =gBattleTextBuff2
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x2
@@ -2540,7 +2540,7 @@ _080CF398:
mov r0, r9
adds r1, r4, 0
bl RemoveMonPPBonus
- ldr r0, _080CF3D8 @ =gUnknown_2024022
+ ldr r0, _080CF3D8 @ =gMoveToLearn
ldrh r1, [r0]
mov r0, r9
adds r2, r4, 0
@@ -2554,8 +2554,8 @@ _080CF398:
adds r0, 0x1
b _080CF526
.align 2, 0
-_080CF3D4: .4byte gUnknown_2022AC8
-_080CF3D8: .4byte gUnknown_2024022
+_080CF3D4: .4byte gBattleTextBuff2
+_080CF3D8: .4byte gMoveToLearn
_080CF3DC: .4byte gTasks
_080CF3E0:
ldr r0, _080CF408 @ =gUnknown_83FDF3C
@@ -2564,7 +2564,7 @@ _080CF3E0:
adds r0, r1
ldr r0, [r0]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r0, _080CF40C @ =gUnknown_202298C
+ ldr r0, _080CF40C @ =gDisplayedStringBattle
movs r1, 0
bl sub_80D87BC
ldr r0, _080CF410 @ =gTasks
@@ -2577,7 +2577,7 @@ _080CF3E0:
b _080CF526
.align 2, 0
_080CF408: .4byte gUnknown_83FDF3C
-_080CF40C: .4byte gUnknown_202298C
+_080CF40C: .4byte gDisplayedStringBattle
_080CF410: .4byte gTasks
_080CF414:
movs r0, 0
@@ -2596,7 +2596,7 @@ _080CF42E:
ldr r0, _080CF450 @ =gUnknown_83FDF3C
ldr r0, [r0, 0x1C]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r0, _080CF454 @ =gUnknown_202298C
+ ldr r0, _080CF454 @ =gDisplayedStringBattle
movs r1, 0
bl sub_80D87BC
ldr r0, _080CF458 @ =gTasks
@@ -2609,7 +2609,7 @@ _080CF42E:
b _080CF526
.align 2, 0
_080CF450: .4byte gUnknown_83FDF3C
-_080CF454: .4byte gUnknown_202298C
+_080CF454: .4byte gDisplayedStringBattle
_080CF458: .4byte gTasks
_080CF45C:
movs r0, 0
@@ -2627,7 +2627,7 @@ _080CF45C:
adds r0, r1
ldr r0, [r0]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r0, _080CF49C @ =gUnknown_202298C
+ ldr r0, _080CF49C @ =gDisplayedStringBattle
movs r1, 0
bl sub_80D87BC
ldr r1, _080CF4A0 @ =gTasks
@@ -2640,13 +2640,13 @@ _080CF45C:
b _080CF528
.align 2, 0
_080CF498: .4byte gUnknown_83FDF3C
-_080CF49C: .4byte gUnknown_202298C
+_080CF49C: .4byte gDisplayedStringBattle
_080CF4A0: .4byte gTasks
_080CF4A4:
ldr r0, _080CF4CC @ =gUnknown_83FDF3C
ldr r0, [r0, 0x20]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r0, _080CF4D0 @ =gUnknown_202298C
+ ldr r0, _080CF4D0 @ =gDisplayedStringBattle
movs r1, 0
bl sub_80D87BC
ldr r1, _080CF4D4 @ =gTasks
@@ -2663,13 +2663,13 @@ _080CF4A4:
b _080CF528
.align 2, 0
_080CF4CC: .4byte gUnknown_83FDF3C
-_080CF4D0: .4byte gUnknown_202298C
+_080CF4D0: .4byte gDisplayedStringBattle
_080CF4D4: .4byte gTasks
_080CF4D8:
ldr r0, _080CF4F8 @ =gUnknown_83FDF3C
ldr r0, [r0, 0x24]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r0, _080CF4FC @ =gUnknown_202298C
+ ldr r0, _080CF4FC @ =gDisplayedStringBattle
movs r1, 0
bl sub_80D87BC
ldr r1, _080CF500 @ =gTasks
@@ -2683,7 +2683,7 @@ _080CF4F2:
b _080CF528
.align 2, 0
_080CF4F8: .4byte gUnknown_83FDF3C
-_080CF4FC: .4byte gUnknown_202298C
+_080CF4FC: .4byte gDisplayedStringBattle
_080CF500: .4byte gTasks
_080CF504:
movs r0, 0
@@ -3124,7 +3124,7 @@ _080CF8A8:
adds r2, 0xC
mov r0, r8
movs r1, 0xB
- bl sub_804037C
+ bl SetMonData
mov r0, r8
bl CalculateMonStats
ldrh r1, [r4, 0xA]
@@ -3191,7 +3191,7 @@ _080CF940:
movs r1, 0x2
add r2, sp, 0xC
bl GetMonData
- ldr r0, _080CF990 @ =gUnknown_2022AB8
+ ldr r0, _080CF990 @ =gBattleTextBuff1
add r1, sp, 0xC
bl StringCopy10
ldr r0, _080CF994 @ =0x0000ffff
@@ -3202,7 +3202,7 @@ _080CF940:
b _080D003A
.align 2, 0
_080CF98C: .4byte gTasks
-_080CF990: .4byte gUnknown_2022AB8
+_080CF990: .4byte gBattleTextBuff1
_080CF994: .4byte 0x0000ffff
_080CF998:
ldr r0, _080CF9A8 @ =0x0000fffe
@@ -3373,7 +3373,7 @@ _080CFAF2:
ldr r0, _080CFB28 @ =gUnknown_83FDF3C
ldr r0, [r0, 0xC]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r1, _080CFB2C @ =gUnknown_202298C
+ ldr r1, _080CFB2C @ =gDisplayedStringBattle
movs r0, 0
movs r2, 0x1
bl sub_8054508
@@ -3391,7 +3391,7 @@ _080CFB1A:
.align 2, 0
_080CFB24: .4byte 0x00000101
_080CFB28: .4byte gUnknown_83FDF3C
-_080CFB2C: .4byte gUnknown_202298C
+_080CFB2C: .4byte gDisplayedStringBattle
_080CFB30: .4byte gTasks
_080CFB34:
movs r0, 0
@@ -3474,7 +3474,7 @@ _080CFBDA:
ldr r0, _080CFC00 @ =gUnknown_83FDF3C
ldr r0, [r0, 0x10]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r1, _080CFC04 @ =gUnknown_202298C
+ ldr r1, _080CFC04 @ =gDisplayedStringBattle
movs r0, 0
movs r2, 0x1
bl sub_8054508
@@ -3487,7 +3487,7 @@ _080CFBDA:
b _080D0038
.align 2, 0
_080CFC00: .4byte gUnknown_83FDF3C
-_080CFC04: .4byte gUnknown_202298C
+_080CFC04: .4byte gDisplayedStringBattle
_080CFC08: .4byte gTasks
_080CFC0C:
movs r0, 0
@@ -3506,7 +3506,7 @@ _080CFC26:
ldr r0, _080CFC48 @ =gUnknown_83FDF3C
ldr r0, [r0, 0x14]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r1, _080CFC4C @ =gUnknown_202298C
+ ldr r1, _080CFC4C @ =gDisplayedStringBattle
movs r0, 0
movs r2, 0x1
bl sub_8054508
@@ -3519,7 +3519,7 @@ _080CFC26:
b _080D0038
.align 2, 0
_080CFC48: .4byte gUnknown_83FDF3C
-_080CFC4C: .4byte gUnknown_202298C
+_080CFC4C: .4byte gDisplayedStringBattle
_080CFC50: .4byte gTasks
_080CFC54:
movs r0, 0
@@ -3534,7 +3534,7 @@ _080CFC54:
ldr r0, _080CFCE8 @ =gUnknown_83FDF3C
ldr r0, [r0, 0x18]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r1, _080CFCEC @ =gUnknown_202298C
+ ldr r1, _080CFCEC @ =gDisplayedStringBattle
movs r0, 0
movs r2, 0x1
bl sub_8054508
@@ -3592,7 +3592,7 @@ _080CFCAE:
b _080D003A
.align 2, 0
_080CFCE8: .4byte gUnknown_83FDF3C
-_080CFCEC: .4byte gUnknown_202298C
+_080CFCEC: .4byte gDisplayedStringBattle
_080CFCF0: .4byte gTasks
_080CFCF4: .4byte gUnknown_826D1CC
_080CFCF8: .4byte gUnknown_2023E82
@@ -3622,7 +3622,7 @@ _080CFD1C:
adds r0, r3
ldr r0, [r0]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r1, _080CFD68 @ =gUnknown_202298C
+ ldr r1, _080CFD68 @ =gDisplayedStringBattle
movs r0, 0
movs r2, 0x1
bl sub_8054508
@@ -3650,7 +3650,7 @@ _080CFD56:
.align 2, 0
_080CFD60: .4byte gUnknown_2023E82
_080CFD64: .4byte gUnknown_83FDF3C
-_080CFD68: .4byte gUnknown_202298C
+_080CFD68: .4byte gDisplayedStringBattle
_080CFD6C: .4byte gTasks
_080CFD70:
ldr r1, _080CFD9C @ =gUnknown_2023E82
@@ -3662,7 +3662,7 @@ _080CFD70:
adds r0, r1
ldr r0, [r0]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r1, _080CFDA4 @ =gUnknown_202298C
+ ldr r1, _080CFDA4 @ =gDisplayedStringBattle
movs r0, 0
movs r2, 0x1
bl sub_8054508
@@ -3676,7 +3676,7 @@ _080CFD70:
.align 2, 0
_080CFD9C: .4byte gUnknown_2023E82
_080CFDA0: .4byte gUnknown_83FDF3C
-_080CFDA4: .4byte gUnknown_202298C
+_080CFDA4: .4byte gDisplayedStringBattle
_080CFDA8: .4byte gTasks
_080CFDAC:
ldr r0, _080CFE14 @ =gUnknown_2037AB8
@@ -3709,13 +3709,13 @@ _080CFDC6:
lsls r5, 3
adds r5, r1
ldrb r1, [r5, 0x1C]
- ldr r2, _080CFE24 @ =gUnknown_2024029
+ ldr r2, _080CFE24 @ =gPlayerPartyCount
ldrb r2, [r2]
subs r2, 0x1
lsls r2, 24
lsrs r2, 24
ldr r3, _080CFE28 @ =CB2_TradeEvolutionSceneLoadGraphics
- ldr r4, _080CFE2C @ =gUnknown_2024022
+ ldr r4, _080CFE2C @ =gMoveToLearn
ldrh r4, [r4]
str r4, [sp]
bl sub_8134738
@@ -3728,9 +3728,9 @@ _080CFE14: .4byte gUnknown_2037AB8
_080CFE18: .4byte gUnknown_3003F3C
_080CFE1C: .4byte gPlayerParty
_080CFE20: .4byte gTasks
-_080CFE24: .4byte gUnknown_2024029
+_080CFE24: .4byte gPlayerPartyCount
_080CFE28: .4byte CB2_TradeEvolutionSceneLoadGraphics
-_080CFE2C: .4byte gUnknown_2024022
+_080CFE2C: .4byte gMoveToLearn
_080CFE30:
ldr r0, _080CFE64 @ =gUnknown_2037AB8
ldrb r1, [r0, 0x7]
@@ -3779,7 +3779,7 @@ _080CFE74:
adds r0, r3
ldr r0, [r0]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r1, _080CFEB8 @ =gUnknown_202298C
+ ldr r1, _080CFEB8 @ =gDisplayedStringBattle
movs r0, 0
movs r2, 0x1
bl sub_8054508
@@ -3793,10 +3793,10 @@ _080CFE74:
.align 2, 0
_080CFEB0: .4byte gUnknown_83FDF3C
_080CFEB4: .4byte 0x000004cc
-_080CFEB8: .4byte gUnknown_202298C
+_080CFEB8: .4byte gDisplayedStringBattle
_080CFEBC: .4byte gTasks
_080CFEC0:
- ldr r1, _080CFF14 @ =gUnknown_2022AC8
+ ldr r1, _080CFF14 @ =gBattleTextBuff2
movs r0, 0xFD
strb r0, [r1]
movs r0, 0x2
@@ -3811,7 +3811,7 @@ _080CFEC0:
mov r0, r8
adds r1, r4, 0
bl RemoveMonPPBonus
- ldr r0, _080CFF18 @ =gUnknown_2024022
+ ldr r0, _080CFF18 @ =gMoveToLearn
ldrh r1, [r0]
mov r0, r8
adds r2, r4, 0
@@ -3822,7 +3822,7 @@ _080CFEC0:
adds r0, r1
ldr r0, [r0]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r1, _080CFF20 @ =gUnknown_202298C
+ ldr r1, _080CFF20 @ =gDisplayedStringBattle
movs r0, 0
movs r2, 0x1
bl sub_8054508
@@ -3834,10 +3834,10 @@ _080CFEC0:
adds r0, 0x1
b _080D0038
.align 2, 0
-_080CFF14: .4byte gUnknown_2022AC8
-_080CFF18: .4byte gUnknown_2024022
+_080CFF14: .4byte gBattleTextBuff2
+_080CFF18: .4byte gMoveToLearn
_080CFF1C: .4byte gUnknown_83FDF3C
-_080CFF20: .4byte gUnknown_202298C
+_080CFF20: .4byte gDisplayedStringBattle
_080CFF24: .4byte gTasks
_080CFF28:
movs r0, 0
@@ -3856,7 +3856,7 @@ _080CFF42:
ldr r0, _080CFF64 @ =gUnknown_83FDF3C
ldr r0, [r0, 0x1C]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r1, _080CFF68 @ =gUnknown_202298C
+ ldr r1, _080CFF68 @ =gDisplayedStringBattle
movs r0, 0
movs r2, 0x1
bl sub_8054508
@@ -3869,7 +3869,7 @@ _080CFF42:
b _080D0038
.align 2, 0
_080CFF64: .4byte gUnknown_83FDF3C
-_080CFF68: .4byte gUnknown_202298C
+_080CFF68: .4byte gDisplayedStringBattle
_080CFF6C: .4byte gTasks
_080CFF70:
movs r0, 0
@@ -3887,7 +3887,7 @@ _080CFF70:
adds r0, r3
ldr r0, [r0]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r1, _080CFFB0 @ =gUnknown_202298C
+ ldr r1, _080CFFB0 @ =gDisplayedStringBattle
movs r0, 0
movs r2, 0x1
bl sub_8054508
@@ -3900,13 +3900,13 @@ _080CFF70:
b _080D003A
.align 2, 0
_080CFFAC: .4byte gUnknown_83FDF3C
-_080CFFB0: .4byte gUnknown_202298C
+_080CFFB0: .4byte gDisplayedStringBattle
_080CFFB4: .4byte gTasks
_080CFFB8:
ldr r0, _080CFFE0 @ =gUnknown_83FDF3C
ldr r0, [r0, 0x20]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r1, _080CFFE4 @ =gUnknown_202298C
+ ldr r1, _080CFFE4 @ =gDisplayedStringBattle
movs r0, 0
movs r2, 0x1
bl sub_8054508
@@ -3923,13 +3923,13 @@ _080CFFB8:
b _080D003A
.align 2, 0
_080CFFE0: .4byte gUnknown_83FDF3C
-_080CFFE4: .4byte gUnknown_202298C
+_080CFFE4: .4byte gDisplayedStringBattle
_080CFFE8: .4byte gTasks
_080CFFEC:
ldr r0, _080D000C @ =gUnknown_83FDF3C
ldr r0, [r0, 0x24]
bl BattleStringExpandPlaceholdersToDisplayedString
- ldr r1, _080D0010 @ =gUnknown_202298C
+ ldr r1, _080D0010 @ =gDisplayedStringBattle
movs r0, 0
movs r2, 0x1
bl sub_8054508
@@ -3943,7 +3943,7 @@ _080D0006:
b _080D003A
.align 2, 0
_080D000C: .4byte gUnknown_83FDF3C
-_080D0010: .4byte gUnknown_202298C
+_080D0010: .4byte gDisplayedStringBattle
_080D0014: .4byte gTasks
_080D0018:
movs r0, 0
diff --git a/asm/field_control_avatar.s b/asm/field_control_avatar.s
index 6b981dea8..c4551463d 100644
--- a/asm/field_control_avatar.s
+++ b/asm/field_control_avatar.s
@@ -906,7 +906,7 @@ _0806CF7E:
lsrs r3, r0, 24
cmp r3, 0x10
beq _0806CF9E
- ldr r1, _0806CFA8 @ =gUnknown_2036E38
+ ldr r1, _0806CFA8 @ =gMapObjects
lsls r2, r3, 3
adds r0, r2, r3
lsls r0, 2
@@ -920,7 +920,7 @@ _0806CF9E:
b _0806CFDE
.align 2, 0
_0806CFA4: .4byte gUnknown_826D2D8
-_0806CFA8: .4byte gUnknown_2036E38
+_0806CFA8: .4byte gMapObjects
_0806CFAC:
movs r4, 0
ldr r1, _0806CFE4 @ =gUnknown_2031DEC
@@ -978,7 +978,7 @@ sub_806CFF4: @ 806CFF4
lsrs r5, r0, 24
cmp r5, 0x10
beq _0806D02A
- ldr r2, _0806D098 @ =gUnknown_2036E38
+ ldr r2, _0806D098 @ =gMapObjects
lsls r1, r5, 3
adds r0, r1, r5
lsls r0, 2
@@ -1016,7 +1016,7 @@ _0806D02A:
lsrs r5, r0, 24
cmp r5, 0x10
beq _0806D092
- ldr r2, _0806D098 @ =gUnknown_2036E38
+ ldr r2, _0806D098 @ =gMapObjects
lsls r1, r5, 3
adds r0, r1, r5
lsls r0, 2
@@ -1031,7 +1031,7 @@ _0806D078:
bne _0806D0A0
adds r0, r6, r5
lsls r0, 2
- ldr r1, _0806D098 @ =gUnknown_2036E38
+ ldr r1, _0806D098 @ =gMapObjects
adds r0, r1
bl FieldObjectCheckIfSpecialAnimFinishedOrInactive
lsls r0, 24
@@ -1041,13 +1041,13 @@ _0806D092:
movs r0, 0
b _0806D0C8
.align 2, 0
-_0806D098: .4byte gUnknown_2036E38
+_0806D098: .4byte gMapObjects
_0806D09C: .4byte gUnknown_826D2D8
_0806D0A0:
ldr r0, _0806D0D4 @ =gUnknown_3005074
strb r5, [r0]
ldr r4, _0806D0D8 @ =gUnknown_20370D2
- ldr r1, _0806D0DC @ =gUnknown_2036E38
+ ldr r1, _0806D0DC @ =gMapObjects
adds r0, r6, r5
lsls r0, 2
adds r0, r1
@@ -1071,7 +1071,7 @@ _0806D0C8:
.align 2, 0
_0806D0D4: .4byte gUnknown_3005074
_0806D0D8: .4byte gUnknown_20370D2
-_0806D0DC: .4byte gUnknown_2036E38
+_0806D0DC: .4byte gMapObjects
_0806D0E0: .4byte gUnknown_20370D4
thumb_func_end sub_806CFF4
@@ -1887,7 +1887,7 @@ AdjustFriendship_step: @ 806D74C
_0806D76A:
adds r0, r5, 0
movs r1, 0x5
- bl sub_80436F8
+ bl AdjustFriendship
adds r5, 0x64
subs r4, 0x1
cmp r4, 0
diff --git a/asm/field_effect.s b/asm/field_effect.s
index 1382a6dae..4edbbca95 100644
--- a/asm/field_effect.s
+++ b/asm/field_effect.s
@@ -734,7 +734,7 @@ sub_8083970: @ 8083970
str r2, [sp, 0x4]
movs r1, 0
str r1, [sp, 0x8]
- ldr r1, _080839C0 @ =gUnknown_823730C
+ ldr r1, _080839C0 @ =gMonPaletteTable
lsls r4, r0, 3
adds r4, r1
ldrh r1, [r4, 0x4]
@@ -758,7 +758,7 @@ sub_8083970: @ 8083970
lsrs r0, 24
b _080839CA
.align 2, 0
-_080839C0: .4byte gUnknown_823730C
+_080839C0: .4byte gMonPaletteTable
_080839C4: .4byte 0x0000ffff
_080839C8:
movs r0, 0x40
@@ -2067,7 +2067,7 @@ mapldr_08084390: @ 8084390
ldr r0, _080843E8 @ =c3_080843F8
movs r1, 0
bl CreateTask
- ldr r4, _080843EC @ =gUnknown_2036E38
+ ldr r4, _080843EC @ =gMapObjects
ldr r3, _080843F0 @ =gUnknown_2037078
ldrb r1, [r3, 0x5]
lsls r0, r1, 3
@@ -2101,7 +2101,7 @@ _080843D2:
bx r0
.align 2, 0
_080843E8: .4byte c3_080843F8
-_080843EC: .4byte gUnknown_2036E38
+_080843EC: .4byte gMapObjects
_080843F0: .4byte gUnknown_2037078
_080843F4: .4byte gUnknown_3005020
thumb_func_end mapldr_08084390
@@ -2214,7 +2214,7 @@ sub_80844BC: @ 80844BC
lsls r5, r0, 3
adds r5, r0
lsls r5, 2
- ldr r0, _0808455C @ =gUnknown_2036E38
+ ldr r0, _0808455C @ =gMapObjects
mov r8, r0
add r5, r8
ldrb r0, [r6, 0x4]
@@ -2279,7 +2279,7 @@ sub_80844BC: @ 80844BC
bx r1
.align 2, 0
_08084558: .4byte gUnknown_2037078
-_0808455C: .4byte gUnknown_2036E38
+_0808455C: .4byte gMapObjects
_08084560: .4byte gSprites
thumb_func_end sub_80844BC
@@ -2331,7 +2331,7 @@ sub_8084580: @ 8084580
movs r0, 0x1
strh r0, [r5, 0xA]
strh r1, [r5, 0xC]
- ldr r2, _080845F0 @ =gUnknown_2036E38
+ ldr r2, _080845F0 @ =gMapObjects
ldrb r0, [r6, 0x5]
lsls r1, r0, 3
adds r1, r0
@@ -2355,7 +2355,7 @@ sub_8084580: @ 8084580
_080845E4: .4byte gUnknown_2037078
_080845E8: .4byte gSprites
_080845EC: .4byte gSpriteCoordOffsetY
-_080845F0: .4byte gUnknown_2036E38
+_080845F0: .4byte gMapObjects
thumb_func_end sub_8084580
thumb_func_start sub_80845F4
@@ -2367,7 +2367,7 @@ sub_80845F4: @ 80845F4
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _080846A4 @ =gUnknown_2036E38
+ ldr r1, _080846A4 @ =gMapObjects
adds r6, r0, r1
ldrb r1, [r2, 0x4]
lsls r0, r1, 4
@@ -2450,7 +2450,7 @@ _08084698:
bx r1
.align 2, 0
_080846A0: .4byte gUnknown_2037078
-_080846A4: .4byte gUnknown_2036E38
+_080846A4: .4byte gMapObjects
_080846A8: .4byte gSprites
thumb_func_end sub_80845F4
@@ -2650,7 +2650,7 @@ sub_8084820: @ 8084820
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0808488C @ =gUnknown_2036E38
+ ldr r1, _0808488C @ =gMapObjects
adds r4, r0, r1
adds r0, r4, 0
bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive
@@ -2693,7 +2693,7 @@ _0808487E:
bx r1
.align 2, 0
_08084888: .4byte gUnknown_2037078
-_0808488C: .4byte gUnknown_2036E38
+_0808488C: .4byte gMapObjects
thumb_func_end sub_8084820
thumb_func_start sub_8084890
@@ -2944,7 +2944,7 @@ sub_8084A5C: @ 8084A5C
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _08084AC0 @ =gUnknown_2036E38
+ ldr r0, _08084AC0 @ =gMapObjects
adds r4, r0
movs r0, 0x4
bl sub_8063EB8
@@ -2979,7 +2979,7 @@ sub_8084A5C: @ 8084A5C
b _08084AC6
.align 2, 0
_08084ABC: .4byte gUnknown_2037078
-_08084AC0: .4byte gUnknown_2036E38
+_08084AC0: .4byte gMapObjects
_08084AC4:
movs r1, 0
_08084AC6:
@@ -3189,7 +3189,7 @@ sub_8084C3C: @ 8084C3C
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08084C98 @ =gUnknown_2036E38
+ ldr r1, _08084C98 @ =gMapObjects
adds r4, r0, r1
adds r0, r4, 0
bl FieldObjectClearAnimIfSpecialAnimFinished
@@ -3220,7 +3220,7 @@ _08084C8A:
bx r1
.align 2, 0
_08084C94: .4byte gUnknown_2037078
-_08084C98: .4byte gUnknown_2036E38
+_08084C98: .4byte gMapObjects
_08084C9C: .4byte sub_8084A24
thumb_func_end sub_8084C3C
@@ -3273,7 +3273,7 @@ _08084CEA:
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
- ldr r0, _08084D20 @ =gUnknown_2036E38
+ ldr r0, _08084D20 @ =gMapObjects
adds r1, r0
ldr r2, [r2]
adds r0, r4, 0
@@ -3288,7 +3288,7 @@ _08084CEA:
_08084D14: .4byte gUnknown_83CC084
_08084D18: .4byte gTasks
_08084D1C: .4byte gUnknown_2037078
-_08084D20: .4byte gUnknown_2036E38
+_08084D20: .4byte gMapObjects
thumb_func_end sub_8084CD8
thumb_func_start sub_8084D24
@@ -3537,7 +3537,7 @@ dive_3_unknown: @ 8084ED4
lsls r0, 24
cmp r0, 0
bne _08084F18
- ldr r2, _08084F20 @ =gUnknown_2036E38
+ ldr r2, _08084F20 @ =gMapObjects
ldr r0, _08084F24 @ =gUnknown_2037078
ldrb r1, [r0, 0x5]
lsls r0, r1, 3
@@ -3560,7 +3560,7 @@ _08084F18:
pop {r1}
bx r1
.align 2, 0
-_08084F20: .4byte gUnknown_2036E38
+_08084F20: .4byte gMapObjects
_08084F24: .4byte gUnknown_2037078
_08084F28: .4byte sub_8084E60
thumb_func_end dive_3_unknown
@@ -3600,7 +3600,7 @@ _08084F58:
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
- ldr r0, _08084F98 @ =gUnknown_2036E38
+ ldr r0, _08084F98 @ =gMapObjects
adds r1, r0
ldrb r0, [r5, 0x4]
lsls r2, r0, 4
@@ -3621,7 +3621,7 @@ _08084F58:
_08084F8C: .4byte gUnknown_83CC0A4
_08084F90: .4byte gTasks
_08084F94: .4byte gUnknown_2037078
-_08084F98: .4byte gUnknown_2036E38
+_08084F98: .4byte gMapObjects
_08084F9C: .4byte gSprites
thumb_func_end sub_8084F44
@@ -3946,7 +3946,7 @@ _080851FC:
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
- ldr r0, _0808523C @ =gUnknown_2036E38
+ ldr r0, _0808523C @ =gMapObjects
adds r1, r0
ldrb r0, [r5, 0x4]
lsls r2, r0, 4
@@ -3967,7 +3967,7 @@ _080851FC:
_08085230: .4byte gUnknown_83CC0BC
_08085234: .4byte gTasks
_08085238: .4byte gUnknown_2037078
-_0808523C: .4byte gUnknown_2036E38
+_0808523C: .4byte gMapObjects
_08085240: .4byte gSprites
thumb_func_end sub_80851E8
@@ -4209,7 +4209,7 @@ _080853F8:
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
- ldr r0, _08085438 @ =gUnknown_2036E38
+ ldr r0, _08085438 @ =gMapObjects
adds r1, r0
ldrb r0, [r5, 0x4]
lsls r2, r0, 4
@@ -4230,7 +4230,7 @@ _080853F8:
_0808542C: .4byte gUnknown_83CC0CC
_08085430: .4byte gTasks
_08085434: .4byte gUnknown_2037078
-_08085438: .4byte gUnknown_2036E38
+_08085438: .4byte gMapObjects
_0808543C: .4byte gSprites
thumb_func_end sub_80853E4
@@ -4546,7 +4546,7 @@ sub_8085690: @ 8085690
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _080856D8 @ =gUnknown_2036E38
+ ldr r1, _080856D8 @ =gMapObjects
adds r6, r0, r1
adds r4, r5, 0
adds r4, 0x8
@@ -4572,7 +4572,7 @@ sub_8085690: @ 8085690
b _08085702
.align 2, 0
_080856D4: .4byte gUnknown_2037078
-_080856D8: .4byte gUnknown_2036E38
+_080856D8: .4byte gMapObjects
_080856DC:
movs r1, 0x8
ldrsh r0, [r4, r1]
@@ -4973,7 +4973,7 @@ sub_80859D4: @ 80859D4
ldr r1, _08085A14 @ =gUnknown_3005020
movs r0, 0
str r0, [r1]
- ldr r2, _08085A18 @ =gUnknown_2036E38
+ ldr r2, _08085A18 @ =gMapObjects
ldr r0, _08085A1C @ =gUnknown_2037078
ldrb r1, [r0, 0x5]
lsls r0, r1, 3
@@ -4991,7 +4991,7 @@ sub_80859D4: @ 80859D4
bx r0
.align 2, 0
_08085A14: .4byte gUnknown_3005020
-_08085A18: .4byte gUnknown_2036E38
+_08085A18: .4byte gMapObjects
_08085A1C: .4byte gUnknown_2037078
_08085A20: .4byte sub_8085A24
thumb_func_end sub_80859D4
@@ -5056,7 +5056,7 @@ sub_8085A80: @ 8085A80
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08085AD8 @ =gUnknown_2036E38
+ ldr r1, _08085AD8 @ =gMapObjects
adds r6, r0, r1
adds r1, r4, 0
adds r1, 0xA
@@ -5088,7 +5088,7 @@ sub_8085A80: @ 8085A80
b _08085B10
.align 2, 0
_08085AD4: .4byte gUnknown_2037078
-_08085AD8: .4byte gUnknown_2036E38
+_08085AD8: .4byte gMapObjects
_08085ADC:
movs r2, 0xE
ldrsh r0, [r5, r2]
@@ -5226,7 +5226,7 @@ sub_8085BD0: @ 8085BD0
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08085C5C @ =gUnknown_2036E38
+ ldr r1, _08085C5C @ =gMapObjects
adds r5, r0, r1
ldrh r1, [r4, 0xA]
movs r2, 0xA
@@ -5282,7 +5282,7 @@ _08085C4A:
.align 2, 0
_08085C54: .4byte gUnknown_83CC108
_08085C58: .4byte gUnknown_2037078
-_08085C5C: .4byte gUnknown_2036E38
+_08085C5C: .4byte gMapObjects
thumb_func_end sub_8085BD0
thumb_func_start sub_8085C60
@@ -5299,7 +5299,7 @@ sub_8085C60: @ 8085C60
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08085D2C @ =gUnknown_2036E38
+ ldr r1, _08085D2C @ =gMapObjects
adds r3, r0, r1
ldrb r1, [r2, 0x4]
lsls r0, r1, 4
@@ -5387,7 +5387,7 @@ _08085D1A:
.align 2, 0
_08085D24: .4byte gUnknown_83CC108
_08085D28: .4byte gUnknown_2037078
-_08085D2C: .4byte gUnknown_2036E38
+_08085D2C: .4byte gMapObjects
_08085D30: .4byte gSprites
thumb_func_end sub_8085C60
@@ -5439,7 +5439,7 @@ mapldr_08085D88: @ 8085D88
ldr r1, _08085DCC @ =gUnknown_3005020
movs r0, 0
str r0, [r1]
- ldr r2, _08085DD0 @ =gUnknown_2036E38
+ ldr r2, _08085DD0 @ =gMapObjects
ldr r0, _08085DD4 @ =gUnknown_2037078
ldrb r1, [r0, 0x5]
lsls r0, r1, 3
@@ -5458,7 +5458,7 @@ mapldr_08085D88: @ 8085D88
bx r0
.align 2, 0
_08085DCC: .4byte gUnknown_3005020
-_08085DD0: .4byte gUnknown_2036E38
+_08085DD0: .4byte gMapObjects
_08085DD4: .4byte gUnknown_2037078
_08085DD8: .4byte sub_8085DDC
thumb_func_end mapldr_08085D88
@@ -5518,7 +5518,7 @@ sub_8085E0C: @ 8085E0C
adds r0, r1
negs r0, r0
strh r0, [r2, 0x26]
- ldr r3, _08085E94 @ =gUnknown_2036E38
+ ldr r3, _08085E94 @ =gMapObjects
ldrb r0, [r5, 0x5]
lsls r1, r0, 3
adds r1, r0
@@ -5554,7 +5554,7 @@ _08085E82:
_08085E88: .4byte gUnknown_2037078
_08085E8C: .4byte gSprites
_08085E90: .4byte gSpriteCoordOffsetY
-_08085E94: .4byte gUnknown_2036E38
+_08085E94: .4byte gMapObjects
thumb_func_end sub_8085E0C
thumb_func_start sub_8085E98
@@ -5571,7 +5571,7 @@ sub_8085E98: @ 8085E98
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08085F08 @ =gUnknown_2036E38
+ ldr r1, _08085F08 @ =gMapObjects
adds r6, r0, r1
ldrb r1, [r2, 0x4]
lsls r0, r1, 4
@@ -5613,7 +5613,7 @@ sub_8085E98: @ 8085E98
.align 2, 0
_08085F00: .4byte gUnknown_83CC108
_08085F04: .4byte gUnknown_2037078
-_08085F08: .4byte gUnknown_2036E38
+_08085F08: .4byte gMapObjects
_08085F0C: .4byte gSprites
_08085F10:
ldrb r1, [r5, 0x5]
@@ -5704,7 +5704,7 @@ sub_8085F9C: @ 8085F9C
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08086020 @ =gUnknown_2036E38
+ ldr r1, _08086020 @ =gMapObjects
adds r5, r0, r1
ldrh r0, [r4, 0xA]
subs r0, 0x1
@@ -5751,7 +5751,7 @@ _08086010:
.align 2, 0
_08086018: .4byte gUnknown_83CC108
_0808601C: .4byte gUnknown_2037078
-_08086020: .4byte gUnknown_2036E38
+_08086020: .4byte gMapObjects
_08086024: .4byte sub_8085DDC
thumb_func_end sub_8085F9C
@@ -7014,7 +7014,7 @@ sub_80869C0: @ 80869C0
adds r0, r6, 0
mov r1, r8
bl PlayerGetDestCoords
- ldr r2, _08086A1C @ =gUnknown_2036E38
+ ldr r2, _08086A1C @ =gMapObjects
ldrb r1, [r5, 0x5]
lsls r0, r1, 3
adds r0, r1
@@ -7035,7 +7035,7 @@ sub_80869C0: @ 80869C0
bx r0
.align 2, 0
_08086A18: .4byte gUnknown_2037078
-_08086A1C: .4byte gUnknown_2036E38
+_08086A1C: .4byte gMapObjects
thumb_func_end sub_80869C0
thumb_func_start sub_8086A20
@@ -7047,7 +7047,7 @@ sub_8086A20: @ 8086A20
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08086A68 @ =gUnknown_2036E38
+ ldr r1, _08086A68 @ =gMapObjects
adds r4, r0, r1
adds r0, r4, 0
bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive
@@ -7073,7 +7073,7 @@ _08086A5C:
bx r0
.align 2, 0
_08086A64: .4byte gUnknown_2037078
-_08086A68: .4byte gUnknown_2036E38
+_08086A68: .4byte gMapObjects
thumb_func_end sub_8086A20
thumb_func_start sub_8086A6C
@@ -7085,7 +7085,7 @@ sub_8086A6C: @ 8086A6C
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08086AAC @ =gUnknown_2036E38
+ ldr r1, _08086AAC @ =gMapObjects
adds r0, r1
bl FieldObjectCheckIfSpecialAnimFinishedOrInactive
lsls r0, 24
@@ -7109,7 +7109,7 @@ _08086AA2:
bx r0
.align 2, 0
_08086AA8: .4byte gUnknown_2037078
-_08086AAC: .4byte gUnknown_2036E38
+_08086AAC: .4byte gMapObjects
_08086AB0: .4byte gUnknown_20386E0
thumb_func_end sub_8086A6C
@@ -7127,7 +7127,7 @@ sub_8086AB4: @ 8086AB4
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _08086B28 @ =gUnknown_2036E38
+ ldr r0, _08086B28 @ =gMapObjects
adds r4, r0
movs r0, 0x2
bl sub_805C808
@@ -7167,7 +7167,7 @@ _08086B1E:
bx r0
.align 2, 0
_08086B24: .4byte gUnknown_2037078
-_08086B28: .4byte gUnknown_2036E38
+_08086B28: .4byte gMapObjects
_08086B2C: .4byte gUnknown_20386E0
thumb_func_end sub_8086AB4
@@ -7179,7 +7179,7 @@ sub_8086B30: @ 8086B30
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08086BA0 @ =gUnknown_2036E38
+ ldr r1, _08086BA0 @ =gMapObjects
adds r4, r0, r1
adds r0, r4, 0
bl FieldObjectClearAnimIfSpecialAnimFinished
@@ -7220,7 +7220,7 @@ _08086B96:
bx r0
.align 2, 0
_08086B9C: .4byte gUnknown_2037078
-_08086BA0: .4byte gUnknown_2036E38
+_08086BA0: .4byte gMapObjects
_08086BA4: .4byte sub_8086990
thumb_func_end sub_8086B30
@@ -7299,7 +7299,7 @@ sub_8086C24: @ 8086C24
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08086C6C @ =gUnknown_2036E38
+ ldr r1, _08086C6C @ =gMapObjects
adds r4, r0, r1
adds r0, r4, 0
bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive
@@ -7325,7 +7325,7 @@ _08086C60:
bx r0
.align 2, 0
_08086C68: .4byte gUnknown_2037078
-_08086C6C: .4byte gUnknown_2036E38
+_08086C6C: .4byte gMapObjects
thumb_func_end sub_8086C24
thumb_func_start sub_8086C70
@@ -7337,7 +7337,7 @@ sub_8086C70: @ 8086C70
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08086CA0 @ =gUnknown_2036E38
+ ldr r1, _08086CA0 @ =gMapObjects
adds r4, r0, r1
adds r0, r4, 0
bl FieldObjectClearAnimIfSpecialAnimFinished
@@ -7353,7 +7353,7 @@ sub_8086C70: @ 8086C70
b _08086CAE
.align 2, 0
_08086C9C: .4byte gUnknown_2037078
-_08086CA0: .4byte gUnknown_2036E38
+_08086CA0: .4byte gMapObjects
_08086CA4:
movs r0, 0x8
ands r0, r1
@@ -7403,7 +7403,7 @@ sub_8086CF4: @ 8086CF4
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08086D30 @ =gUnknown_2036E38
+ ldr r1, _08086D30 @ =gMapObjects
adds r0, r1
bl FieldObjectClearAnimIfSpecialAnimFinished
lsls r0, 24
@@ -7424,7 +7424,7 @@ _08086D26:
bx r0
.align 2, 0
_08086D2C: .4byte gUnknown_2037078
-_08086D30: .4byte gUnknown_2036E38
+_08086D30: .4byte gMapObjects
_08086D34: .4byte sub_8086BD0
thumb_func_end sub_8086CF4
@@ -7596,7 +7596,7 @@ sub_8086E70: @ 8086E70
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08086EC4 @ =gUnknown_2036E38
+ ldr r1, _08086EC4 @ =gMapObjects
adds r4, r0, r1
adds r0, r4, 0
bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive
@@ -7627,7 +7627,7 @@ _08086EB8:
bx r0
.align 2, 0
_08086EC0: .4byte gUnknown_2037078
-_08086EC4: .4byte gUnknown_2036E38
+_08086EC4: .4byte gMapObjects
thumb_func_end sub_8086E70
thumb_func_start sub_8086EC8
@@ -7639,7 +7639,7 @@ sub_8086EC8: @ 8086EC8
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08086F04 @ =gUnknown_2036E38
+ ldr r1, _08086F04 @ =gMapObjects
adds r0, r1
bl FieldObjectClearAnimIfSpecialAnimFinished
lsls r0, 24
@@ -7660,7 +7660,7 @@ _08086EF8:
bx r0
.align 2, 0
_08086F00: .4byte gUnknown_2037078
-_08086F04: .4byte gUnknown_2036E38
+_08086F04: .4byte gMapObjects
_08086F08: .4byte gUnknown_20386E0
thumb_func_end sub_8086EC8
@@ -7678,7 +7678,7 @@ sub_8086F0C: @ 8086F0C
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08086F60 @ =gUnknown_2036E38
+ ldr r1, _08086F60 @ =gMapObjects
adds r5, r0, r1
ldrh r1, [r4, 0x26]
movs r0, 0x8
@@ -7705,7 +7705,7 @@ _08086F54:
bx r0
.align 2, 0
_08086F5C: .4byte gUnknown_2037078
-_08086F60: .4byte gUnknown_2036E38
+_08086F60: .4byte gMapObjects
thumb_func_end sub_8086F0C
thumb_func_start sub_8086F64
@@ -7729,7 +7729,7 @@ sub_8086F64: @ 8086F64
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08086FA4 @ =gUnknown_2036E38
+ ldr r1, _08086FA4 @ =gMapObjects
adds r0, r1
movs r1, 0x2
bl sub_8063CA4
@@ -7739,7 +7739,7 @@ _08086F98:
bx r0
.align 2, 0
_08086FA0: .4byte gUnknown_2037078
-_08086FA4: .4byte gUnknown_2036E38
+_08086FA4: .4byte gMapObjects
thumb_func_end sub_8086F64
thumb_func_start sub_8086FA8
@@ -7751,7 +7751,7 @@ sub_8086FA8: @ 8086FA8
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08086FF8 @ =gUnknown_2036E38
+ ldr r1, _08086FF8 @ =gMapObjects
adds r2, r0, r1
ldrh r1, [r4, 0xC]
movs r3, 0xC
@@ -7782,7 +7782,7 @@ _08086FEC:
bx r0
.align 2, 0
_08086FF4: .4byte gUnknown_2037078
-_08086FF8: .4byte gUnknown_2036E38
+_08086FF8: .4byte gMapObjects
thumb_func_end sub_8086FA8
thumb_func_start sub_8086FFC
@@ -7801,7 +7801,7 @@ sub_8086FFC: @ 8086FFC
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _08087064 @ =gUnknown_2036E38
+ ldr r0, _08087064 @ =gMapObjects
adds r4, r0
movs r0, 0x2
bl sub_805C808
@@ -7836,7 +7836,7 @@ _0808705A:
bx r0
.align 2, 0
_08087060: .4byte gUnknown_2037078
-_08087064: .4byte gUnknown_2036E38
+_08087064: .4byte gMapObjects
_08087068: .4byte gSprites
thumb_func_end sub_8086FFC
@@ -7856,7 +7856,7 @@ sub_808706C: @ 808706C
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _08087108 @ =gUnknown_2036E38
+ ldr r0, _08087108 @ =gMapObjects
adds r4, r0
adds r0, r4, 0
bl FieldObjectClearAnimIfSpecialAnimActive
@@ -7915,7 +7915,7 @@ _080870FC:
bx r0
.align 2, 0
_08087104: .4byte gUnknown_2037078
-_08087108: .4byte gUnknown_2036E38
+_08087108: .4byte gMapObjects
_0808710C: .4byte gSprites
_08087110: .4byte gSaveBlock2Ptr
_08087114: .4byte sub_8087828
@@ -8430,7 +8430,7 @@ sub_80874C8: @ 80874C8
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _080875B8 @ =gUnknown_2036E38
+ ldr r1, _080875B8 @ =gMapObjects
adds r5, r0, r1
adds r0, r5, 0
bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive
@@ -8532,7 +8532,7 @@ _080875AE:
bx r0
.align 2, 0
_080875B4: .4byte gUnknown_2037078
-_080875B8: .4byte gUnknown_2036E38
+_080875B8: .4byte gMapObjects
_080875BC: .4byte gSprites
_080875C0: .4byte gSaveBlock2Ptr
_080875C4: .4byte sub_8087828
@@ -8566,7 +8566,7 @@ _080875F2:
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08087640 @ =gUnknown_2036E38
+ ldr r1, _08087640 @ =gMapObjects
adds r0, r1
ldrb r0, [r0, 0x4]
lsls r4, r0, 4
@@ -8598,7 +8598,7 @@ _08087630:
.align 2, 0
_08087638: .4byte gSprites
_0808763C: .4byte gUnknown_2037078
-_08087640: .4byte gUnknown_2036E38
+_08087640: .4byte gMapObjects
thumb_func_end sub_80875C8
thumb_func_start sub_8087644
@@ -8658,7 +8658,7 @@ sub_8087698: @ 8087698
lsls r5, r0, 3
adds r5, r0
lsls r5, 2
- ldr r0, _08087708 @ =gUnknown_2036E38
+ ldr r0, _08087708 @ =gMapObjects
adds r5, r0
ldrb r0, [r5, 0x4]
lsls r4, r0, 4
@@ -8698,7 +8698,7 @@ _080876FC:
bx r0
.align 2, 0
_08087704: .4byte gUnknown_2037078
-_08087708: .4byte gUnknown_2036E38
+_08087708: .4byte gMapObjects
_0808770C: .4byte gSprites
thumb_func_end sub_8087698
@@ -8711,7 +8711,7 @@ sub_8087710: @ 8087710
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08087744 @ =gUnknown_2036E38
+ ldr r1, _08087744 @ =gMapObjects
adds r0, r1
bl FieldObjectClearAnimIfSpecialAnimFinished
lsls r0, 24
@@ -8728,7 +8728,7 @@ _08087738:
bx r0
.align 2, 0
_08087740: .4byte gUnknown_2037078
-_08087744: .4byte gUnknown_2036E38
+_08087744: .4byte gMapObjects
thumb_func_end sub_8087710
thumb_func_start sub_8087748
@@ -8776,7 +8776,7 @@ fishE: @ 8087780
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _080877F4 @ =gUnknown_2036E38
+ ldr r1, _080877F4 @ =gMapObjects
adds r4, r0, r1
movs r7, 0
ldrh r1, [r5, 0x26]
@@ -8816,7 +8816,7 @@ _080877EA:
bx r0
.align 2, 0
_080877F0: .4byte gUnknown_2037078
-_080877F4: .4byte gUnknown_2036E38
+_080877F4: .4byte gMapObjects
_080877F8: .4byte sub_8087498
thumb_func_end fishE
@@ -8991,7 +8991,7 @@ sub_8087924: @ 8087924
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _080879C8 @ =gUnknown_2036E38
+ ldr r0, _080879C8 @ =gMapObjects
adds r4, r0
movs r0, 0x10
ldrsh r5, [r4, r0]
@@ -9055,7 +9055,7 @@ _080879BA:
bx r1
.align 2, 0
_080879C4: .4byte gUnknown_20386E0
-_080879C8: .4byte gUnknown_2036E38
+_080879C8: .4byte gMapObjects
_080879CC: .4byte sub_80879D8
_080879D0: .4byte gTasks
_080879D4: .4byte gSprites
@@ -9148,7 +9148,7 @@ _08087A78:
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _08087AB0 @ =gUnknown_2036E38
+ ldr r0, _08087AB0 @ =gMapObjects
adds r4, r0
ldrh r0, [r5, 0x4]
strh r0, [r6, 0x20]
@@ -9169,7 +9169,7 @@ _08087AA8:
pop {r0}
bx r0
.align 2, 0
-_08087AB0: .4byte gUnknown_2036E38
+_08087AB0: .4byte gMapObjects
thumb_func_end sub_80879D8
thumb_func_start sub_8087AB4
@@ -9381,7 +9381,7 @@ sub_8087C2C: @ 8087C2C
asrs r0, 16
cmp r0, 0x78
ble _08087C9A
- ldr r2, _08087CA4 @ =gUnknown_2036E38
+ ldr r2, _08087CA4 @ =gMapObjects
movs r1, 0x4
ldrsh r0, [r7, r1]
lsls r1, r0, 3
@@ -9427,7 +9427,7 @@ _08087C9A:
pop {r0}
bx r0
.align 2, 0
-_08087CA4: .4byte gUnknown_2036E38
+_08087CA4: .4byte gMapObjects
_08087CA8: .4byte gSprites
_08087CAC: .4byte 0x0000ffff
_08087CB0: .4byte 0x00007fff
diff --git a/asm/field_effect_helpers.s b/asm/field_effect_helpers.s
index a26978dfd..dfdc880fb 100644
--- a/asm/field_effect_helpers.s
+++ b/asm/field_effect_helpers.s
@@ -253,7 +253,7 @@ sub_80DAF50: @ 80DAF50
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _080DAF98 @ =gUnknown_2036E38
+ ldr r1, _080DAF98 @ =gMapObjects
adds r7, r0, r1
ldrb r1, [r7, 0x4]
lsls r0, r1, 4
@@ -281,7 +281,7 @@ _080DAF88:
strb r0, [r2]
b _080DB0AE
.align 2, 0
-_080DAF98: .4byte gUnknown_2036E38
+_080DAF98: .4byte gMapObjects
_080DAF9C: .4byte gSprites
_080DAFA0: .4byte 0x00020001
_080DAFA4:
@@ -587,7 +587,7 @@ oei_shadow: @ 80DB1DC
bl GetFieldObjectIdByLocalIdAndMap
lsls r0, 24
lsrs r0, 24
- ldr r2, _080DB26C @ =gUnknown_2036E38
+ ldr r2, _080DB26C @ =gMapObjects
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
@@ -649,7 +649,7 @@ _080DB260:
bx r1
.align 2, 0
_080DB268: .4byte gUnknown_20386E0
-_080DB26C: .4byte gUnknown_2036E38
+_080DB26C: .4byte gMapObjects
_080DB270: .4byte gUnknown_83A0010
_080DB274: .4byte gUnknown_83FECD2
_080DB278: .4byte gSprites
@@ -685,7 +685,7 @@ _080DB2AE:
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _080DB33C @ =gUnknown_2036E38
+ ldr r1, _080DB33C @ =gMapObjects
adds r4, r0, r1
ldrb r0, [r4, 0x4]
lsls r1, r0, 4
@@ -748,7 +748,7 @@ _080DB334:
pop {r0}
bx r0
.align 2, 0
-_080DB33C: .4byte gUnknown_2036E38
+_080DB33C: .4byte gMapObjects
_080DB340: .4byte gSprites
_080DB344: .4byte 0x00400001
thumb_func_end oamc_shadow
@@ -929,7 +929,7 @@ _080DB4A0:
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _080DB4F0 @ =gUnknown_2036E38
+ ldr r1, _080DB4F0 @ =gMapObjects
adds r2, r0, r1
ldr r0, [r2, 0x10]
ldr r1, [r5, 0x30]
@@ -966,7 +966,7 @@ _080DB4E4:
pop {r0}
bx r0
.align 2, 0
-_080DB4F0: .4byte gUnknown_2036E38
+_080DB4F0: .4byte gMapObjects
thumb_func_end unc_grass_normal
thumb_func_start FldEff_JumpTallGrass
@@ -1280,7 +1280,7 @@ _080DB750:
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _080DB794 @ =gUnknown_2036E38
+ ldr r1, _080DB794 @ =gMapObjects
adds r2, r0, r1
ldr r0, [r2, 0x10]
ldr r1, [r5, 0x30]
@@ -1309,7 +1309,7 @@ _080DB786:
pop {r0}
bx r0
.align 2, 0
-_080DB794: .4byte gUnknown_2036E38
+_080DB794: .4byte gMapObjects
thumb_func_end unc_grass_tall
thumb_func_start FldEff_JumpLongGrass
@@ -1382,7 +1382,7 @@ sub_80DB808: @ 80DB808
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
- ldr r0, _080DB8A0 @ =gUnknown_2036E38
+ ldr r0, _080DB8A0 @ =gMapObjects
adds r5, r1, r0
ldr r0, _080DB8A4 @ =gUnknown_83A0010
ldr r0, [r0, 0x78]
@@ -1446,7 +1446,7 @@ _080DB894:
bx r1
.align 2, 0
_080DB89C: .4byte gUnknown_20386E0
-_080DB8A0: .4byte gUnknown_2036E38
+_080DB8A0: .4byte gMapObjects
_080DB8A4: .4byte gUnknown_83A0010
_080DB8A8: .4byte gSprites
thumb_func_end sub_80DB808
@@ -1472,7 +1472,7 @@ sub_80DB8AC: @ 80DB8AC
lsls r0, 24
cmp r0, 0
bne _080DB8EA
- ldr r5, _080DB8F4 @ =gUnknown_2036E38
+ ldr r5, _080DB8F4 @ =gMapObjects
mov r0, sp
ldrb r1, [r0]
lsls r0, r1, 3
@@ -1489,7 +1489,7 @@ _080DB8EA:
bl FieldEffectStop
b _080DB98E
.align 2, 0
-_080DB8F4: .4byte gUnknown_2036E38
+_080DB8F4: .4byte gMapObjects
_080DB8F8:
ldrb r0, [r1, 0x5]
bl GetFieldObjectGraphicsInfo
@@ -1839,7 +1839,7 @@ FldEff_Splash: @ 80DBB88
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
- ldr r0, _080DBC20 @ =gUnknown_2036E38
+ ldr r0, _080DBC20 @ =gMapObjects
adds r5, r1, r0
ldr r0, _080DBC24 @ =gUnknown_83A0010
ldr r0, [r0, 0x34]
@@ -1900,7 +1900,7 @@ _080DBC12:
bx r1
.align 2, 0
_080DBC1C: .4byte gUnknown_20386E0
-_080DBC20: .4byte gUnknown_2036E38
+_080DBC20: .4byte gMapObjects
_080DBC24: .4byte gUnknown_83A0010
_080DBC28: .4byte gSprites
thumb_func_end FldEff_Splash
@@ -1937,7 +1937,7 @@ _080DBC5C:
b _080DBCA6
_080DBC66:
ldr r3, _080DBCB0 @ =gSprites
- ldr r2, _080DBCB4 @ =gUnknown_2036E38
+ ldr r2, _080DBCB4 @ =gMapObjects
mov r0, sp
ldrb r1, [r0]
lsls r0, r1, 3
@@ -1974,7 +1974,7 @@ _080DBCA6:
bx r0
.align 2, 0
_080DBCB0: .4byte gSprites
-_080DBCB4: .4byte gUnknown_2036E38
+_080DBCB4: .4byte gMapObjects
thumb_func_end sub_80DBC2C
thumb_func_start FldEff_JumpSmallSplash
@@ -2104,7 +2104,7 @@ FldEff_FeetInFlowingWater: @ 80DBD98
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
- ldr r0, _080DBE3C @ =gUnknown_2036E38
+ ldr r0, _080DBE3C @ =gMapObjects
adds r6, r1, r0
ldr r0, _080DBE40 @ =gUnknown_83A0010
ldr r0, [r0, 0x34]
@@ -2171,7 +2171,7 @@ _080DBE2E:
bx r1
.align 2, 0
_080DBE38: .4byte gUnknown_20386E0
-_080DBE3C: .4byte gUnknown_2036E38
+_080DBE3C: .4byte gMapObjects
_080DBE40: .4byte gUnknown_83A0010
_080DBE44: .4byte gSprites
_080DBE48: .4byte sub_80DBE50
@@ -2197,7 +2197,7 @@ sub_80DBE50: @ 80DBE50
lsls r0, 24
cmp r0, 0
bne _080DBE8A
- ldr r2, _080DBE94 @ =gUnknown_2036E38
+ ldr r2, _080DBE94 @ =gMapObjects
mov r0, sp
ldrb r1, [r0]
lsls r0, r1, 3
@@ -2214,7 +2214,7 @@ _080DBE8A:
bl FieldEffectStop
b _080DBEE2
.align 2, 0
-_080DBE94: .4byte gUnknown_2036E38
+_080DBE94: .4byte gMapObjects
_080DBE98:
ldrb r1, [r5, 0x4]
lsls r0, r1, 4
@@ -2323,7 +2323,7 @@ sub_80DBF50: @ 80DBF50
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
- ldr r0, _080DBFE8 @ =gUnknown_2036E38
+ ldr r0, _080DBFE8 @ =gMapObjects
adds r5, r1, r0
ldr r0, _080DBFEC @ =gUnknown_83A0010
ldr r0, [r0, 0x7C]
@@ -2387,7 +2387,7 @@ _080DBFDC:
bx r1
.align 2, 0
_080DBFE4: .4byte gUnknown_20386E0
-_080DBFE8: .4byte gUnknown_2036E38
+_080DBFE8: .4byte gMapObjects
_080DBFEC: .4byte gUnknown_83A0010
_080DBFF0: .4byte gSprites
thumb_func_end sub_80DBF50
@@ -2411,7 +2411,7 @@ sub_80DBFF4: @ 80DBFF4
lsls r0, 24
cmp r0, 0
bne _080DC02E
- ldr r5, _080DC038 @ =gUnknown_2036E38
+ ldr r5, _080DC038 @ =gMapObjects
mov r0, sp
ldrb r1, [r0]
lsls r0, r1, 3
@@ -2428,7 +2428,7 @@ _080DC02E:
bl FieldEffectStop
b _080DC080
.align 2, 0
-_080DC038: .4byte gUnknown_2036E38
+_080DC038: .4byte gMapObjects
_080DC03C:
ldrb r0, [r1, 0x5]
bl GetFieldObjectGraphicsInfo
@@ -2863,7 +2863,7 @@ sub_80DC348: @ 80DC348
movs r2, 0x32
ldrsh r1, [r4, r2]
bl CurrentMapDrawMetatileAt
- ldr r2, _080DC3A0 @ =gUnknown_2036E38
+ ldr r2, _080DC3A0 @ =gMapObjects
ldr r0, _080DC3A4 @ =gUnknown_2037078
ldrb r1, [r0, 0x5]
lsls r0, r1, 3
@@ -2880,7 +2880,7 @@ sub_80DC348: @ 80DC348
pop {r0}
bx r0
.align 2, 0
-_080DC3A0: .4byte gUnknown_2036E38
+_080DC3A0: .4byte gMapObjects
_080DC3A4: .4byte gUnknown_2037078
thumb_func_end sub_80DC348
@@ -3081,7 +3081,7 @@ sub_80DC4F8: @ 80DC4F8
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _080DC548 @ =gUnknown_2036E38
+ ldr r0, _080DC548 @ =gMapObjects
adds r4, r0
ldrb r0, [r4, 0x4]
lsls r5, r0, 4
@@ -3112,7 +3112,7 @@ sub_80DC4F8: @ 80DC4F8
pop {r0}
bx r0
.align 2, 0
-_080DC548: .4byte gUnknown_2036E38
+_080DC548: .4byte gMapObjects
_080DC54C: .4byte gSprites
thumb_func_end sub_80DC4F8
@@ -3454,7 +3454,7 @@ FldEff_SandPile: @ 80DC7B0
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
- ldr r0, _080DC860 @ =gUnknown_2036E38
+ ldr r0, _080DC860 @ =gMapObjects
adds r6, r1, r0
ldr r0, _080DC864 @ =gUnknown_83A0010
ldr r0, [r0, 0x74]
@@ -3528,7 +3528,7 @@ _080DC854:
bx r1
.align 2, 0
_080DC85C: .4byte gUnknown_20386E0
-_080DC860: .4byte gUnknown_2036E38
+_080DC860: .4byte gMapObjects
_080DC864: .4byte gUnknown_83A0010
_080DC868: .4byte gSprites
thumb_func_end FldEff_SandPile
@@ -3552,7 +3552,7 @@ sub_80DC86C: @ 80DC86C
lsls r0, 24
cmp r0, 0
bne _080DC8A6
- ldr r2, _080DC8B0 @ =gUnknown_2036E38
+ ldr r2, _080DC8B0 @ =gMapObjects
mov r0, sp
ldrb r1, [r0]
lsls r0, r1, 3
@@ -3569,7 +3569,7 @@ _080DC8A6:
bl FieldEffectStop
b _080DC926
.align 2, 0
-_080DC8B0: .4byte gUnknown_2036E38
+_080DC8B0: .4byte gMapObjects
_080DC8B4:
ldr r2, _080DC930 @ =gSprites
ldrb r1, [r1, 0x4]
@@ -3608,7 +3608,7 @@ _080DC8F6:
strh r6, [r4, 0x20]
strh r5, [r4, 0x22]
ldr r3, _080DC930 @ =gSprites
- ldr r2, _080DC934 @ =gUnknown_2036E38
+ ldr r2, _080DC934 @ =gMapObjects
mov r0, sp
ldrb r1, [r0]
lsls r0, r1, 3
@@ -3635,7 +3635,7 @@ _080DC926:
bx r0
.align 2, 0
_080DC930: .4byte gSprites
-_080DC934: .4byte gUnknown_2036E38
+_080DC934: .4byte gMapObjects
thumb_func_end sub_80DC86C
thumb_func_start FldEff_Bubbles
@@ -3882,7 +3882,7 @@ sub_80DCAC8: @ 80DCAC8
adds r0, r5, 0
bl FieldEffectStop
_080DCAF8:
- ldr r4, _080DCBB0 @ =gUnknown_2036E38
+ ldr r4, _080DCBB0 @ =gMapObjects
mov r0, sp
ldrb r1, [r0]
lsls r0, r1, 3
@@ -3975,7 +3975,7 @@ _080DCBA8:
pop {r0}
bx r0
.align 2, 0
-_080DCBB0: .4byte gUnknown_2036E38
+_080DCBB0: .4byte gMapObjects
_080DCBB4: .4byte gSprites
thumb_func_end sub_80DCAC8
@@ -4217,7 +4217,7 @@ _080DCD5E:
lsls r0, r7, 3
adds r0, r7
lsls r0, 2
- ldr r1, _080DCDF8 @ =gUnknown_2036E38
+ ldr r1, _080DCDF8 @ =gMapObjects
adds r4, r0, r1
ldrb r0, [r4]
lsls r0, 31
@@ -4291,7 +4291,7 @@ _080DCDD8:
strb r0, [r2]
b _080DCE0A
.align 2, 0
-_080DCDF8: .4byte gUnknown_2036E38
+_080DCDF8: .4byte gMapObjects
_080DCDFC: .4byte gSprites
_080DCE00:
adds r0, r7, 0x1
diff --git a/asm/field_fadetransition.s b/asm/field_fadetransition.s
index 1b3aaf9d3..36e8e1c84 100644
--- a/asm/field_fadetransition.s
+++ b/asm/field_fadetransition.s
@@ -727,7 +727,7 @@ _0807E0AE:
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0807E0E8 @ =gUnknown_2036E38
+ ldr r1, _0807E0E8 @ =gMapObjects
adds r0, r1
movs r1, 0x10
bl sub_8063CA4
@@ -735,7 +735,7 @@ _0807E0AE:
strh r0, [r4, 0x8]
b _0807E206
.align 2, 0
-_0807E0E8: .4byte gUnknown_2036E38
+_0807E0E8: .4byte gMapObjects
_0807E0EC:
ldrh r0, [r4, 0x24]
adds r0, 0x1
@@ -781,13 +781,13 @@ _0807E10E:
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0807E15C @ =gUnknown_2036E38
+ ldr r1, _0807E15C @ =gMapObjects
adds r0, r1
bl FieldObjectClearAnimIfSpecialAnimFinished
b _0807E1F2
.align 2, 0
_0807E158: .4byte sub_807F204
-_0807E15C: .4byte gUnknown_2036E38
+_0807E15C: .4byte gMapObjects
_0807E160:
bl sub_807E418
cmp r0, 0
@@ -804,7 +804,7 @@ _0807E160:
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0807E194 @ =gUnknown_2036E38
+ ldr r1, _0807E194 @ =gMapObjects
adds r0, r1
movs r1, 0x10
bl sub_8063CA4
@@ -812,7 +812,7 @@ _0807E160:
strh r0, [r4, 0x8]
b _0807E206
.align 2, 0
-_0807E194: .4byte gUnknown_2036E38
+_0807E194: .4byte gMapObjects
_0807E198:
bl walkrun_is_standing_still
lsls r0, 24
@@ -836,14 +836,14 @@ _0807E198:
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0807E1D8 @ =gUnknown_2036E38
+ ldr r1, _0807E1D8 @ =gMapObjects
adds r0, r1
bl FieldObjectClearAnimIfSpecialAnimFinished
movs r0, 0x3
strh r0, [r4, 0x8]
b _0807E206
.align 2, 0
-_0807E1D8: .4byte gUnknown_2036E38
+_0807E1D8: .4byte gMapObjects
_0807E1DC:
movs r1, 0xA
ldrsh r0, [r4, r1]
@@ -927,7 +927,7 @@ _0807E25E:
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _0807E2A4 @ =gUnknown_2036E38
+ ldr r0, _0807E2A4 @ =gMapObjects
adds r4, r0
bl player_get_direction_lower_nybble
lsls r0, 24
@@ -942,7 +942,7 @@ _0807E25E:
strh r0, [r5, 0x8]
b _0807E2C6
.align 2, 0
-_0807E2A4: .4byte gUnknown_2036E38
+_0807E2A4: .4byte gMapObjects
_0807E2A8:
bl walkrun_is_standing_still
lsls r0, 24
@@ -1729,7 +1729,7 @@ _0807E8AE:
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r4, _0807E8F0 @ =gUnknown_2036E38
+ ldr r4, _0807E8F0 @ =gMapObjects
adds r0, r4
bl FieldObjectClearAnimIfSpecialAnimActive
movs r0, 0xFF
@@ -1749,7 +1749,7 @@ _0807E8AE:
strh r0, [r5, 0x8]
b _0807E976
.align 2, 0
-_0807E8F0: .4byte gUnknown_2036E38
+_0807E8F0: .4byte gMapObjects
_0807E8F4:
bl walkrun_is_standing_still
lsls r0, 24
@@ -1774,7 +1774,7 @@ _0807E8F4:
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0807E93C @ =gUnknown_2036E38
+ ldr r1, _0807E93C @ =gMapObjects
adds r0, r1
bl FieldObjectClearAnimIfSpecialAnimFinished
movs r0, 0
@@ -1783,7 +1783,7 @@ _0807E8F4:
strh r0, [r5, 0x8]
b _0807E976
.align 2, 0
-_0807E93C: .4byte gUnknown_2036E38
+_0807E93C: .4byte gMapObjects
_0807E940:
movs r1, 0xA
ldrsh r0, [r5, r1]
@@ -1836,7 +1836,7 @@ sub_807E980: @ 807E980
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0807E9C8 @ =gUnknown_2036E38
+ ldr r1, _0807E9C8 @ =gMapObjects
adds r6, r0, r1
ldrb r1, [r2, 0x4]
lsls r0, r1, 4
@@ -1856,7 +1856,7 @@ sub_807E980: @ 807E980
.align 2, 0
_0807E9C0: .4byte gTasks+0x8
_0807E9C4: .4byte gUnknown_2037078
-_0807E9C8: .4byte gUnknown_2036E38
+_0807E9C8: .4byte gMapObjects
_0807E9CC: .4byte gSprites
_0807E9D0:
cmp r0, 0x2
@@ -1995,7 +1995,7 @@ sub_807EAC4: @ 807EAC4
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _0807EB60 @ =gUnknown_2036E38
+ ldr r2, _0807EB60 @ =gMapObjects
adds r0, r2
mov r8, r0
lsls r1, 16
@@ -2051,7 +2051,7 @@ _0807EB4C:
.align 2, 0
_0807EB58: .4byte gUnknown_2037078
_0807EB5C: .4byte gSprites
-_0807EB60: .4byte gUnknown_2036E38
+_0807EB60: .4byte gMapObjects
thumb_func_end sub_807EAC4
thumb_func_start sub_807EB64
@@ -2069,7 +2069,7 @@ sub_807EB64: @ 807EB64
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _0807EBB8 @ =gUnknown_2036E38
+ ldr r0, _0807EBB8 @ =gMapObjects
adds r4, r0
bl player_get_direction_lower_nybble
lsls r0, 24
@@ -2093,7 +2093,7 @@ sub_807EB64: @ 807EB64
bx r0
.align 2, 0
_0807EBB4: .4byte gUnknown_2037078
-_0807EBB8: .4byte gUnknown_2036E38
+_0807EBB8: .4byte gMapObjects
thumb_func_end sub_807EB64
thumb_func_start sub_807EBBC
@@ -2272,7 +2272,7 @@ _0807ED0C:
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _0807ED98 @ =gUnknown_2036E38
+ ldr r0, _0807ED98 @ =gMapObjects
adds r4, r0
adds r0, r1, 0
bl sub_8064270
@@ -2333,7 +2333,7 @@ _0807ED0C:
bx r0
.align 2, 0
_0807ED94: .4byte gUnknown_2037078
-_0807ED98: .4byte gUnknown_2036E38
+_0807ED98: .4byte gMapObjects
_0807ED9C: .4byte gSprites
thumb_func_end sub_807ECBC
diff --git a/asm/field_map_obj.s b/asm/field_map_obj.s
index 068f9c554..84f023d19 100644
--- a/asm/field_map_obj.s
+++ b/asm/field_map_obj.s
@@ -28,7 +28,7 @@ npc_clear_ids_and_state: @ 805DE2C
npcs_clear_ids_and_state: @ 805DE4C
push {r4,r5,lr}
movs r4, 0
- ldr r5, _0805DE70 @ =gUnknown_2036E38
+ ldr r5, _0805DE70 @ =gMapObjects
_0805DE52:
lsls r0, r4, 3
adds r0, r4
@@ -44,7 +44,7 @@ _0805DE52:
pop {r0}
bx r0
.align 2, 0
-_0805DE70: .4byte gUnknown_2036E38
+_0805DE70: .4byte gMapObjects
thumb_func_end npcs_clear_ids_and_state
thumb_func_start sub_805DE74
@@ -141,11 +141,11 @@ _0805DF2C: .4byte gSprites
sub_805DF30: @ 805DF30
push {lr}
movs r1, 0
- ldr r2, _0805DF3C @ =gUnknown_2036E38
+ ldr r2, _0805DF3C @ =gMapObjects
ldrb r0, [r2]
b _0805DF54
.align 2, 0
-_0805DF3C: .4byte gUnknown_2036E38
+_0805DF3C: .4byte gMapObjects
_0805DF40:
adds r0, r1, 0x1
lsls r0, 24
@@ -219,7 +219,7 @@ _0805DFA8:
GetFieldObjectIdByXY: @ 805DFB0
push {r4-r6,lr}
movs r3, 0
- ldr r5, _0805DFF0 @ =gUnknown_2036E38
+ ldr r5, _0805DFF0 @ =gMapObjects
lsls r0, 16
asrs r4, r0, 16
lsls r1, 16
@@ -253,7 +253,7 @@ _0805DFE8:
pop {r1}
bx r1
.align 2, 0
-_0805DFF0: .4byte gUnknown_2036E38
+_0805DFF0: .4byte gMapObjects
thumb_func_end GetFieldObjectIdByXY
thumb_func_start GetFieldObjectIdByLocalIdAndMapInternal
@@ -266,7 +266,7 @@ GetFieldObjectIdByLocalIdAndMapInternal: @ 805DFF4
lsls r2, 24
lsrs r2, 24
movs r1, 0
- ldr r6, _0805E02C @ =gUnknown_2036E38
+ ldr r6, _0805E02C @ =gMapObjects
_0805E006:
lsls r0, r1, 3
adds r0, r1
@@ -288,7 +288,7 @@ _0805E006:
adds r0, r1, 0
b _0805E03C
.align 2, 0
-_0805E02C: .4byte gUnknown_2036E38
+_0805E02C: .4byte gMapObjects
_0805E030:
adds r0, r1, 0x1
lsls r0, 24
@@ -308,7 +308,7 @@ GetFieldObjectIdByLocalId: @ 805E044
lsls r0, 24
lsrs r3, r0, 24
movs r2, 0
- ldr r4, _0805E068 @ =gUnknown_2036E38
+ ldr r4, _0805E068 @ =gMapObjects
_0805E04E:
lsls r0, r2, 3
adds r0, r2
@@ -324,7 +324,7 @@ _0805E04E:
adds r0, r2, 0
b _0805E078
.align 2, 0
-_0805E068: .4byte gUnknown_2036E38
+_0805E068: .4byte gMapObjects
_0805E06C:
adds r0, r2, 0x1
lsls r0, 24
@@ -414,7 +414,7 @@ _0805E10A:
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805E13C @ =gUnknown_2036E38
+ ldr r1, _0805E13C @ =gMapObjects
adds r4, r0, r1
adds r0, r4, 0
bl npc_clear_ids_and_state
@@ -434,7 +434,7 @@ _0805E10A:
adds r0, r1
b _0805E14E
.align 2, 0
-_0805E13C: .4byte gUnknown_2036E38
+_0805E13C: .4byte gMapObjects
_0805E140:
ldrh r0, [r5, 0x4]
adds r0, 0x7
@@ -839,7 +839,7 @@ GetAvailableFieldObjectSlot: @ 805E414
lsls r2, 24
lsrs r4, r2, 24
movs r2, 0
- ldr r1, _0805E470 @ =gUnknown_2036E38
+ ldr r1, _0805E470 @ =gMapObjects
ldrb r0, [r1]
lsls r0, 31
adds r7, r1, 0
@@ -881,11 +881,11 @@ _0805E46C:
movs r0, 0x1
b _0805E4A8
.align 2, 0
-_0805E470: .4byte gUnknown_2036E38
+_0805E470: .4byte gMapObjects
_0805E474:
mov r0, r12
strb r2, [r0]
- ldr r1, _0805E4B0 @ =gUnknown_2036E38
+ ldr r1, _0805E4B0 @ =gMapObjects
_0805E47A:
lsls r0, r2, 3
adds r0, r2
@@ -916,7 +916,7 @@ _0805E4A8:
pop {r1}
bx r1
.align 2, 0
-_0805E4B0: .4byte gUnknown_2036E38
+_0805E4B0: .4byte gMapObjects
thumb_func_end GetAvailableFieldObjectSlot
thumb_func_start RemoveFieldObject
@@ -958,7 +958,7 @@ RemoveFieldObjectByLocalIdAndMap: @ 805E4C8
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805E50C @ =gUnknown_2036E38
+ ldr r1, _0805E50C @ =gMapObjects
adds r0, r1
bl RemoveFieldObject
_0805E506:
@@ -966,7 +966,7 @@ _0805E506:
pop {r0}
bx r0
.align 2, 0
-_0805E50C: .4byte gUnknown_2036E38
+_0805E50C: .4byte gMapObjects
thumb_func_end RemoveFieldObjectByLocalIdAndMap
thumb_func_start RemoveFieldObjectInternal
@@ -1019,7 +1019,7 @@ _0805E560:
lsls r0, r4, 3
adds r0, r4
lsls r0, 2
- ldr r1, _0805E58C @ =gUnknown_2036E38
+ ldr r1, _0805E58C @ =gMapObjects
adds r0, r1
bl RemoveFieldObject
_0805E576:
@@ -1033,7 +1033,7 @@ _0805E576:
bx r0
.align 2, 0
_0805E588: .4byte gUnknown_2037078
-_0805E58C: .4byte gUnknown_2036E38
+_0805E58C: .4byte gMapObjects
thumb_func_end unref_sub_808D958
thumb_func_start sub_805E590
@@ -1071,7 +1071,7 @@ _0805E5CA:
lsls r4, r0, 3
adds r0, r4, r0
lsls r0, 2
- ldr r1, _0805E5F4 @ =gUnknown_2036E38
+ ldr r1, _0805E5F4 @ =gMapObjects
adds r5, r0, r1
ldrb r0, [r5, 0x5]
bl GetFieldObjectGraphicsInfo
@@ -1087,7 +1087,7 @@ _0805E5CA:
bl npc_load_two_palettes__no_record
b _0805E606
.align 2, 0
-_0805E5F4: .4byte gUnknown_2036E38
+_0805E5F4: .4byte gMapObjects
_0805E5F8:
cmp r0, 0xA
bne _0805E606
@@ -1116,7 +1116,7 @@ _0805E614:
lsrs r7, r0, 24
cmp r7, 0x40
bne _0805E650
- ldr r0, _0805E64C @ =gUnknown_2036E38
+ ldr r0, _0805E64C @ =gMapObjects
mov r2, r8
adds r1, r4, r2
lsls r1, 2
@@ -1130,7 +1130,7 @@ _0805E614:
b _0805E718
.align 2, 0
_0805E648: .4byte 0x0000ffff
-_0805E64C: .4byte gUnknown_2036E38
+_0805E64C: .4byte gMapObjects
_0805E650:
lsls r0, r7, 4
adds r0, r7
@@ -1302,7 +1302,7 @@ SpawnFieldObject: @ 805E72C
_0805E7A4: .4byte 0xffff0000
_0805E7A8:
ldr r4, _0805E7EC @ =gSprites
- ldr r1, _0805E7F0 @ =gUnknown_2036E38
+ ldr r1, _0805E7F0 @ =gMapObjects
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
@@ -1338,7 +1338,7 @@ _0805E7DE:
bx r1
.align 2, 0
_0805E7EC: .4byte gSprites
-_0805E7F0: .4byte gUnknown_2036E38
+_0805E7F0: .4byte gMapObjects
thumb_func_end SpawnFieldObject
thumb_func_start SpawnSpecialFieldObject
@@ -2035,7 +2035,7 @@ _0805ED2E:
lsls r0, r3, 3
adds r0, r3
lsls r0, 2
- ldr r1, _0805ED68 @ =gUnknown_2036E38
+ ldr r1, _0805ED68 @ =gMapObjects
adds r2, r0, r1
ldr r0, [r2]
ldr r1, _0805ED6C @ =0x00010001
@@ -2054,7 +2054,7 @@ _0805ED56:
bx r0
.align 2, 0
_0805ED64: .4byte gUnknown_2031DEC
-_0805ED68: .4byte gUnknown_2036E38
+_0805ED68: .4byte gMapObjects
_0805ED6C: .4byte 0x00010001
thumb_func_end RemoveFieldObjectsOutsideView
@@ -2138,7 +2138,7 @@ sub_805EDF0: @ 805EDF0
lsrs r5, 16
bl ClearPlayerAvatarInfo
movs r6, 0
- ldr r7, _0805EE38 @ =gUnknown_2036E38
+ ldr r7, _0805EE38 @ =gMapObjects
lsls r4, 16
lsls r5, 16
_0805EE0A:
@@ -2165,7 +2165,7 @@ _0805EE24:
pop {r0}
bx r0
.align 2, 0
-_0805EE38: .4byte gUnknown_2036E38
+_0805EE38: .4byte gMapObjects
thumb_func_end sub_805EDF0
thumb_func_start sub_805EE3C
@@ -2207,7 +2207,7 @@ _0805EE70:
lsls r0, r1, 3
add r0, r8
lsls r0, 2
- ldr r1, _0805EFE4 @ =gUnknown_2036E38
+ ldr r1, _0805EFE4 @ =gMapObjects
adds r6, r0, r1
movs r0, 0
str r0, [sp, 0x20]
@@ -2376,7 +2376,7 @@ _0805EFCE:
bx r0
.align 2, 0
_0805EFE0: .4byte gUnknown_2031DEC
-_0805EFE4: .4byte gUnknown_2036E38
+_0805EFE4: .4byte gMapObjects
_0805EFE8: .4byte 0xffff0000
_0805EFEC: .4byte 0x0000ffff
_0805EFF0: .4byte gSprites
@@ -2421,7 +2421,7 @@ SetPlayerAvatarFieldObjectIdAndObjectId: @ 805F02C
ldr r5, _0805F058 @ =gUnknown_2037078
strb r0, [r5, 0x5]
strb r1, [r5, 0x4]
- ldr r1, _0805F05C @ =gUnknown_2036E38
+ ldr r1, _0805F05C @ =gMapObjects
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
@@ -2437,7 +2437,7 @@ SetPlayerAvatarFieldObjectIdAndObjectId: @ 805F02C
bx r0
.align 2, 0
_0805F058: .4byte gUnknown_2037078
-_0805F05C: .4byte gUnknown_2036E38
+_0805F05C: .4byte gMapObjects
thumb_func_end SetPlayerAvatarFieldObjectIdAndObjectId
thumb_func_start sub_805F060
@@ -2649,7 +2649,7 @@ FieldObjectSetGraphicsIdByLocalIdAndMap: @ 805F1D8
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805F214 @ =gUnknown_2036E38
+ ldr r1, _0805F214 @ =gMapObjects
adds r0, r1
adds r1, r4, 0
bl sub_805F060
@@ -2659,7 +2659,7 @@ _0805F20C:
pop {r0}
bx r0
.align 2, 0
-_0805F214: .4byte gUnknown_2036E38
+_0805F214: .4byte gMapObjects
thumb_func_end FieldObjectSetGraphicsIdByLocalIdAndMap
thumb_func_start FieldObjectTurn
@@ -2725,7 +2725,7 @@ FieldObjectTurnByLocalIdAndMap: @ 805F268
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805F2A4 @ =gUnknown_2036E38
+ ldr r1, _0805F2A4 @ =gMapObjects
adds r0, r1
adds r1, r4, 0
bl FieldObjectTurn
@@ -2735,7 +2735,7 @@ _0805F29C:
pop {r0}
bx r0
.align 2, 0
-_0805F2A4: .4byte gUnknown_2036E38
+_0805F2A4: .4byte gMapObjects
thumb_func_end FieldObjectTurnByLocalIdAndMap
thumb_func_start PlayerObjectTurn
@@ -2747,13 +2747,13 @@ PlayerObjectTurn: @ 805F2A8
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _0805F2C4 @ =gUnknown_2036E38
+ ldr r2, _0805F2C4 @ =gMapObjects
adds r0, r2
bl FieldObjectTurn
pop {r0}
bx r0
.align 2, 0
-_0805F2C4: .4byte gUnknown_2036E38
+_0805F2C4: .4byte gMapObjects
thumb_func_end PlayerObjectTurn
thumb_func_start GetFieldObjectGraphicsInfo
@@ -2819,7 +2819,7 @@ npc_by_local_id_and_map_set_field_1_bit_x20: @ 805F314
lsls r0, 24
cmp r0, 0
bne _0805F356
- ldr r2, _0805F360 @ =gUnknown_2036E38
+ ldr r2, _0805F360 @ =gMapObjects
mov r0, sp
ldrb r0, [r0]
lsls r1, r0, 3
@@ -2842,7 +2842,7 @@ _0805F356:
pop {r0}
bx r0
.align 2, 0
-_0805F360: .4byte gUnknown_2036E38
+_0805F360: .4byte gMapObjects
thumb_func_end npc_by_local_id_and_map_set_field_1_bit_x20
thumb_func_start FieldObjectGetLocalIdAndMap
@@ -2874,7 +2874,7 @@ sub_805F378: @ 805F378
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805F3A4 @ =gUnknown_2036E38
+ ldr r1, _0805F3A4 @ =gMapObjects
adds r0, r1
ldrb r1, [r0]
movs r2, 0x4
@@ -2884,7 +2884,7 @@ _0805F3A0:
pop {r0}
bx r0
.align 2, 0
-_0805F3A4: .4byte gUnknown_2036E38
+_0805F3A4: .4byte gMapObjects
thumb_func_end sub_805F378
thumb_func_start sub_805F3A8
@@ -2909,7 +2909,7 @@ sub_805F3A8: @ 805F3A8
lsls r2, r0, 3
adds r2, r0
lsls r2, 2
- ldr r0, _0805F3F8 @ =gUnknown_2036E38
+ ldr r0, _0805F3F8 @ =gMapObjects
adds r2, r0
ldrb r1, [r2, 0x4]
lsls r0, r1, 4
@@ -2929,7 +2929,7 @@ _0805F3EE:
pop {r0}
bx r0
.align 2, 0
-_0805F3F8: .4byte gUnknown_2036E38
+_0805F3F8: .4byte gMapObjects
_0805F3FC: .4byte gSprites
thumb_func_end sub_805F3A8
@@ -2953,7 +2953,7 @@ sub_805F400: @ 805F400
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
- ldr r0, _0805F444 @ =gUnknown_2036E38
+ ldr r0, _0805F444 @ =gMapObjects
adds r1, r0
ldrb r2, [r1, 0x3]
movs r0, 0x5
@@ -2969,7 +2969,7 @@ _0805F43C:
pop {r0}
bx r0
.align 2, 0
-_0805F444: .4byte gUnknown_2036E38
+_0805F444: .4byte gMapObjects
thumb_func_end sub_805F400
thumb_func_start sub_805F448
@@ -2992,7 +2992,7 @@ sub_805F448: @ 805F448
lsls r0, 24
cmp r0, 0
bne _0805F48C
- ldr r2, _0805F494 @ =gUnknown_2036E38
+ ldr r2, _0805F494 @ =gMapObjects
mov r0, sp
ldrb r1, [r0]
lsls r0, r1, 3
@@ -3013,7 +3013,7 @@ _0805F48C:
pop {r0}
bx r0
.align 2, 0
-_0805F494: .4byte gUnknown_2036E38
+_0805F494: .4byte gMapObjects
_0805F498: .4byte gSprites
thumb_func_end sub_805F448
@@ -3483,7 +3483,7 @@ sub_805F7C4: @ 805F7C4
lsls r0, r3, 3
adds r0, r3
lsls r0, 2
- ldr r3, _0805F814 @ =gUnknown_2036E38
+ ldr r3, _0805F814 @ =gMapObjects
adds r0, r3
movs r3, 0xE0
lsls r3, 11
@@ -3498,7 +3498,7 @@ _0805F80C:
pop {r0}
bx r0
.align 2, 0
-_0805F814: .4byte gUnknown_2036E38
+_0805F814: .4byte gMapObjects
thumb_func_end sub_805F7C4
thumb_func_start npc_coords_shift_still
@@ -3523,7 +3523,7 @@ UpdateFieldObjectCoordsForCameraUpdate: @ 805F82C
cmp r0, 0
beq _0805F884
movs r3, 0
- ldr r5, _0805F890 @ =gUnknown_2036E38
+ ldr r5, _0805F890 @ =gMapObjects
movs r0, 0x4
ldrsh r4, [r2, r0]
movs r0, 0x8
@@ -3567,7 +3567,7 @@ _0805F884:
bx r0
.align 2, 0
_0805F88C: .4byte gUnknown_2036E18
-_0805F890: .4byte gUnknown_2036E38
+_0805F890: .4byte gMapObjects
thumb_func_end UpdateFieldObjectCoordsForCameraUpdate
thumb_func_start GetFieldObjectIdByXYZ
@@ -3582,7 +3582,7 @@ GetFieldObjectIdByXYZ: @ 805F894
lsls r2, 24
lsrs r5, r2, 24
movs r4, 0
- ldr r0, _0805F8E0 @ =gUnknown_2036E38
+ ldr r0, _0805F8E0 @ =gMapObjects
mov r8, r0
_0805F8AC:
lsls r0, r4, 3
@@ -3611,7 +3611,7 @@ _0805F8AC:
adds r0, r4, 0
b _0805F8F0
.align 2, 0
-_0805F8E0: .4byte gUnknown_2036E38
+_0805F8E0: .4byte gMapObjects
_0805F8E4:
adds r0, r4, 0x1
lsls r0, 24
@@ -4098,7 +4098,7 @@ GetFieldObjectScriptPointerByFieldObjectId: @ 805FC38
push {lr}
lsls r0, 24
lsrs r0, 24
- ldr r1, _0805FC58 @ =gUnknown_2036E38
+ ldr r1, _0805FC58 @ =gMapObjects
lsls r2, r0, 3
adds r2, r0
lsls r2, 2
@@ -4110,7 +4110,7 @@ GetFieldObjectScriptPointerByFieldObjectId: @ 805FC38
pop {r1}
bx r1
.align 2, 0
-_0805FC58: .4byte gUnknown_2036E38
+_0805FC58: .4byte gMapObjects
thumb_func_end GetFieldObjectScriptPointerByFieldObjectId
thumb_func_start GetFieldObjectFlagIdByLocalIdAndMap
@@ -4133,7 +4133,7 @@ GetFieldObjectFlagIdByFieldObjectId: @ 805FC74
push {lr}
lsls r0, 24
lsrs r0, 24
- ldr r1, _0805FC98 @ =gUnknown_2036E38
+ ldr r1, _0805FC98 @ =gMapObjects
lsls r2, r0, 3
adds r2, r0
lsls r2, 2
@@ -4147,7 +4147,7 @@ GetFieldObjectFlagIdByFieldObjectId: @ 805FC74
pop {r1}
bx r1
.align 2, 0
-_0805FC98: .4byte gUnknown_2036E38
+_0805FC98: .4byte gMapObjects
thumb_func_end GetFieldObjectFlagIdByFieldObjectId
thumb_func_start sub_805FC9C
@@ -4165,7 +4165,7 @@ sub_805FC9C: @ 805FC9C
lsls r0, 24
cmp r0, 0
bne _0805FCD0
- ldr r2, _0805FCCC @ =gUnknown_2036E38
+ ldr r2, _0805FCCC @ =gMapObjects
mov r0, sp
ldrb r1, [r0]
lsls r0, r1, 3
@@ -4175,7 +4175,7 @@ sub_805FC9C: @ 805FC9C
ldrb r0, [r0, 0x7]
b _0805FCD2
.align 2, 0
-_0805FCCC: .4byte gUnknown_2036E38
+_0805FCCC: .4byte gMapObjects
_0805FCD0:
movs r0, 0xFF
_0805FCD2:
@@ -4203,7 +4203,7 @@ sub_805FCD8: @ 805FCD8
sub_805FCF0: @ 805FCF0
lsls r0, 24
lsrs r0, 24
- ldr r2, _0805FD04 @ =gUnknown_2036E38
+ ldr r2, _0805FD04 @ =gMapObjects
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
@@ -4211,7 +4211,7 @@ sub_805FCF0: @ 805FCF0
ldrb r0, [r1, 0x7]
bx lr
.align 2, 0
-_0805FD04: .4byte gUnknown_2036E38
+_0805FD04: .4byte gMapObjects
thumb_func_end sub_805FCF0
thumb_func_start sub_805FD08
@@ -4229,7 +4229,7 @@ sub_805FD08: @ 805FD08
lsls r0, 24
cmp r0, 0
bne _0805FD3C
- ldr r2, _0805FD38 @ =gUnknown_2036E38
+ ldr r2, _0805FD38 @ =gMapObjects
mov r0, sp
ldrb r1, [r0]
lsls r0, r1, 3
@@ -4239,7 +4239,7 @@ sub_805FD08: @ 805FD08
ldrb r0, [r0, 0x1D]
b _0805FD3E
.align 2, 0
-_0805FD38: .4byte gUnknown_2036E38
+_0805FD38: .4byte gMapObjects
_0805FD3C:
movs r0, 0xFF
_0805FD3E:
@@ -4252,7 +4252,7 @@ _0805FD3E:
FieldObjectGetBerryTreeId: @ 805FD44
lsls r0, 24
lsrs r0, 24
- ldr r2, _0805FD58 @ =gUnknown_2036E38
+ ldr r2, _0805FD58 @ =gMapObjects
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
@@ -4260,7 +4260,7 @@ FieldObjectGetBerryTreeId: @ 805FD44
ldrb r0, [r1, 0x1D]
bx lr
.align 2, 0
-_0805FD58: .4byte gUnknown_2036E38
+_0805FD58: .4byte gMapObjects
thumb_func_end FieldObjectGetBerryTreeId
thumb_func_start GetFieldObjectTemplateByLocalIdAndMap
@@ -4463,7 +4463,7 @@ sub_805FE94: @ 805FE94
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805FEC8 @ =gUnknown_2036E38
+ ldr r1, _0805FEC8 @ =gMapObjects
adds r0, r1
bl sub_805FE5C
_0805FEC2:
@@ -4471,7 +4471,7 @@ _0805FEC2:
pop {r0}
bx r0
.align 2, 0
-_0805FEC8: .4byte gUnknown_2036E38
+_0805FEC8: .4byte gMapObjects
thumb_func_end sub_805FE94
thumb_func_start npc_paltag_set_load
@@ -4602,14 +4602,14 @@ sub_805FFB4: @ 805FFB4
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _0805FFD0 @ =gUnknown_2036E38
+ ldr r2, _0805FFD0 @ =gMapObjects
adds r0, r2
ldr r2, _0805FFD4 @ =sub_805FFD8
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_0805FFD0: .4byte gUnknown_2036E38
+_0805FFD0: .4byte gMapObjects
_0805FFD4: .4byte sub_805FFD8
thumb_func_end sub_805FFB4
@@ -4628,14 +4628,14 @@ sub_805FFDC: @ 805FFDC
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _0805FFF8 @ =gUnknown_2036E38
+ ldr r2, _0805FFF8 @ =gMapObjects
adds r0, r2
ldr r2, _0805FFFC @ =sub_8060000
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_0805FFF8: .4byte gUnknown_2036E38
+_0805FFF8: .4byte gMapObjects
_0805FFFC: .4byte sub_8060000
thumb_func_end sub_805FFDC
@@ -4667,14 +4667,14 @@ sub_8060020: @ 8060020
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _0806003C @ =gUnknown_2036E38
+ ldr r2, _0806003C @ =gMapObjects
adds r0, r2
ldr r2, _08060040 @ =sub_8060044
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_0806003C: .4byte gUnknown_2036E38
+_0806003C: .4byte gMapObjects
_08060040: .4byte sub_8060044
thumb_func_end sub_8060020
@@ -5437,14 +5437,14 @@ sub_806058C: @ 806058C
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _080605A8 @ =gUnknown_2036E38
+ ldr r2, _080605A8 @ =gMapObjects
adds r0, r2
ldr r2, _080605AC @ =sub_80605B0
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_080605A8: .4byte gUnknown_2036E38
+_080605A8: .4byte gMapObjects
_080605AC: .4byte sub_80605B0
thumb_func_end sub_806058C
@@ -5610,14 +5610,14 @@ sub_80606CC: @ 80606CC
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _080606E8 @ =gUnknown_2036E38
+ ldr r2, _080606E8 @ =gMapObjects
adds r0, r2
ldr r2, _080606EC @ =sub_80606F0
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_080606E8: .4byte gUnknown_2036E38
+_080606E8: .4byte gMapObjects
_080606EC: .4byte sub_80606F0
thumb_func_end sub_80606CC
@@ -5825,14 +5825,14 @@ sub_8060850: @ 8060850
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _0806086C @ =gUnknown_2036E38
+ ldr r2, _0806086C @ =gMapObjects
adds r0, r2
ldr r2, _08060870 @ =sub_8060874
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_0806086C: .4byte gUnknown_2036E38
+_0806086C: .4byte gMapObjects
_08060870: .4byte sub_8060874
thumb_func_end sub_8060850
@@ -6040,14 +6040,14 @@ sub_80609D4: @ 80609D4
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _080609F0 @ =gUnknown_2036E38
+ ldr r2, _080609F0 @ =gMapObjects
adds r0, r2
ldr r2, _080609F4 @ =sub_80609F8
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_080609F0: .4byte gUnknown_2036E38
+_080609F0: .4byte gMapObjects
_080609F4: .4byte sub_80609F8
thumb_func_end sub_80609D4
@@ -6133,14 +6133,14 @@ sub_8060A74: @ 8060A74
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08060A90 @ =gUnknown_2036E38
+ ldr r2, _08060A90 @ =gMapObjects
adds r0, r2
ldr r2, _08060A94 @ =sub_8060A98
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08060A90: .4byte gUnknown_2036E38
+_08060A90: .4byte gMapObjects
_08060A94: .4byte sub_8060A98
thumb_func_end sub_8060A74
@@ -6306,14 +6306,14 @@ sub_8060BB4: @ 8060BB4
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08060BD0 @ =gUnknown_2036E38
+ ldr r2, _08060BD0 @ =gMapObjects
adds r0, r2
ldr r2, _08060BD4 @ =sub_8060BD8
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08060BD0: .4byte gUnknown_2036E38
+_08060BD0: .4byte gMapObjects
_08060BD4: .4byte sub_8060BD8
thumb_func_end sub_8060BB4
@@ -6479,14 +6479,14 @@ sub_8060CF4: @ 8060CF4
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08060D10 @ =gUnknown_2036E38
+ ldr r2, _08060D10 @ =gMapObjects
adds r0, r2
ldr r2, _08060D14 @ =sub_8060D18
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08060D10: .4byte gUnknown_2036E38
+_08060D10: .4byte gMapObjects
_08060D14: .4byte sub_8060D18
thumb_func_end sub_8060CF4
@@ -6652,14 +6652,14 @@ sub_8060E34: @ 8060E34
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08060E50 @ =gUnknown_2036E38
+ ldr r2, _08060E50 @ =gMapObjects
adds r0, r2
ldr r2, _08060E54 @ =sub_8060E58
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08060E50: .4byte gUnknown_2036E38
+_08060E50: .4byte gMapObjects
_08060E54: .4byte sub_8060E58
thumb_func_end sub_8060E34
@@ -6825,14 +6825,14 @@ sub_8060F74: @ 8060F74
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08060F90 @ =gUnknown_2036E38
+ ldr r2, _08060F90 @ =gMapObjects
adds r0, r2
ldr r2, _08060F94 @ =sub_8060F98
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08060F90: .4byte gUnknown_2036E38
+_08060F90: .4byte gMapObjects
_08060F94: .4byte sub_8060F98
thumb_func_end sub_8060F74
@@ -6998,14 +6998,14 @@ sub_80610B4: @ 80610B4
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _080610D0 @ =gUnknown_2036E38
+ ldr r2, _080610D0 @ =gMapObjects
adds r0, r2
ldr r2, _080610D4 @ =sub_80610D8
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_080610D0: .4byte gUnknown_2036E38
+_080610D0: .4byte gMapObjects
_080610D4: .4byte sub_80610D8
thumb_func_end sub_80610B4
@@ -7171,14 +7171,14 @@ sub_80611F4: @ 80611F4
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08061210 @ =gUnknown_2036E38
+ ldr r2, _08061210 @ =gMapObjects
adds r0, r2
ldr r2, _08061214 @ =sub_8061218
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08061210: .4byte gUnknown_2036E38
+_08061210: .4byte gMapObjects
_08061214: .4byte sub_8061218
thumb_func_end sub_80611F4
@@ -7344,14 +7344,14 @@ sub_8061334: @ 8061334
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08061350 @ =gUnknown_2036E38
+ ldr r2, _08061350 @ =gMapObjects
adds r0, r2
ldr r2, _08061354 @ =sub_8061358
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08061350: .4byte gUnknown_2036E38
+_08061350: .4byte gMapObjects
_08061354: .4byte sub_8061358
thumb_func_end sub_8061334
@@ -7517,14 +7517,14 @@ sub_8061474: @ 8061474
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08061490 @ =gUnknown_2036E38
+ ldr r2, _08061490 @ =gMapObjects
adds r0, r2
ldr r2, _08061494 @ =sub_8061498
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08061490: .4byte gUnknown_2036E38
+_08061490: .4byte gMapObjects
_08061494: .4byte sub_8061498
thumb_func_end sub_8061474
@@ -7690,14 +7690,14 @@ sub_80615B4: @ 80615B4
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _080615D0 @ =gUnknown_2036E38
+ ldr r2, _080615D0 @ =gMapObjects
adds r0, r2
ldr r2, _080615D4 @ =sub_80615D8
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_080615D0: .4byte gUnknown_2036E38
+_080615D0: .4byte gMapObjects
_080615D4: .4byte sub_80615D8
thumb_func_end sub_80615B4
@@ -7863,14 +7863,14 @@ sub_80616F4: @ 80616F4
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08061710 @ =gUnknown_2036E38
+ ldr r2, _08061710 @ =gMapObjects
adds r0, r2
ldr r2, _08061714 @ =sub_8061718
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08061710: .4byte gUnknown_2036E38
+_08061710: .4byte gMapObjects
_08061714: .4byte sub_8061718
thumb_func_end sub_80616F4
@@ -8006,14 +8006,14 @@ sub_80617F8: @ 80617F8
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08061814 @ =gUnknown_2036E38
+ ldr r2, _08061814 @ =gMapObjects
adds r0, r2
ldr r2, _08061818 @ =sub_806181C
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08061814: .4byte gUnknown_2036E38
+_08061814: .4byte gMapObjects
_08061818: .4byte sub_806181C
thumb_func_end sub_80617F8
@@ -8149,14 +8149,14 @@ sub_80618FC: @ 80618FC
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08061918 @ =gUnknown_2036E38
+ ldr r2, _08061918 @ =gMapObjects
adds r0, r2
ldr r2, _0806191C @ =sub_8061920
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08061918: .4byte gUnknown_2036E38
+_08061918: .4byte gMapObjects
_0806191C: .4byte sub_8061920
thumb_func_end sub_80618FC
@@ -8465,14 +8465,14 @@ sub_8061B5C: @ 8061B5C
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08061B78 @ =gUnknown_2036E38
+ ldr r2, _08061B78 @ =gMapObjects
adds r0, r2
ldr r2, _08061B7C @ =sub_8061B80
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08061B78: .4byte gUnknown_2036E38
+_08061B78: .4byte gMapObjects
_08061B7C: .4byte sub_8061B80
thumb_func_end sub_8061B5C
@@ -8542,14 +8542,14 @@ sub_8061BE8: @ 8061BE8
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08061C04 @ =gUnknown_2036E38
+ ldr r2, _08061C04 @ =gMapObjects
adds r0, r2
ldr r2, _08061C08 @ =sub_8061C0C
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08061C04: .4byte gUnknown_2036E38
+_08061C04: .4byte gMapObjects
_08061C08: .4byte sub_8061C0C
thumb_func_end sub_8061BE8
@@ -8619,14 +8619,14 @@ sub_8061C74: @ 8061C74
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08061C90 @ =gUnknown_2036E38
+ ldr r2, _08061C90 @ =gMapObjects
adds r0, r2
ldr r2, _08061C94 @ =sub_8061C98
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08061C90: .4byte gUnknown_2036E38
+_08061C90: .4byte gMapObjects
_08061C94: .4byte sub_8061C98
thumb_func_end sub_8061C74
@@ -8696,14 +8696,14 @@ sub_8061D00: @ 8061D00
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08061D1C @ =gUnknown_2036E38
+ ldr r2, _08061D1C @ =gMapObjects
adds r0, r2
ldr r2, _08061D20 @ =sub_8061D24
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08061D1C: .4byte gUnknown_2036E38
+_08061D1C: .4byte gMapObjects
_08061D20: .4byte sub_8061D24
thumb_func_end sub_8061D00
@@ -8773,14 +8773,14 @@ sub_8061D8C: @ 8061D8C
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08061DA8 @ =gUnknown_2036E38
+ ldr r2, _08061DA8 @ =gMapObjects
adds r0, r2
ldr r2, _08061DAC @ =sub_8061DB0
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08061DA8: .4byte gUnknown_2036E38
+_08061DA8: .4byte gMapObjects
_08061DAC: .4byte sub_8061DB0
thumb_func_end sub_8061D8C
@@ -8850,14 +8850,14 @@ sub_8061E18: @ 8061E18
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08061E34 @ =gUnknown_2036E38
+ ldr r2, _08061E34 @ =gMapObjects
adds r0, r2
ldr r2, _08061E38 @ =sub_8061E3C
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08061E34: .4byte gUnknown_2036E38
+_08061E34: .4byte gMapObjects
_08061E38: .4byte sub_8061E3C
thumb_func_end sub_8061E18
@@ -8927,14 +8927,14 @@ sub_8061EA4: @ 8061EA4
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08061EC0 @ =gUnknown_2036E38
+ ldr r2, _08061EC0 @ =gMapObjects
adds r0, r2
ldr r2, _08061EC4 @ =sub_8061EC8
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08061EC0: .4byte gUnknown_2036E38
+_08061EC0: .4byte gMapObjects
_08061EC4: .4byte sub_8061EC8
thumb_func_end sub_8061EA4
@@ -9004,14 +9004,14 @@ sub_8061F30: @ 8061F30
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08061F4C @ =gUnknown_2036E38
+ ldr r2, _08061F4C @ =gMapObjects
adds r0, r2
ldr r2, _08061F50 @ =sub_8061F54
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08061F4C: .4byte gUnknown_2036E38
+_08061F4C: .4byte gMapObjects
_08061F50: .4byte sub_8061F54
thumb_func_end sub_8061F30
@@ -9081,14 +9081,14 @@ sub_8061FBC: @ 8061FBC
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08061FD8 @ =gUnknown_2036E38
+ ldr r2, _08061FD8 @ =gMapObjects
adds r0, r2
ldr r2, _08061FDC @ =sub_8061FE0
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08061FD8: .4byte gUnknown_2036E38
+_08061FD8: .4byte gMapObjects
_08061FDC: .4byte sub_8061FE0
thumb_func_end sub_8061FBC
@@ -9158,14 +9158,14 @@ sub_8062048: @ 8062048
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08062064 @ =gUnknown_2036E38
+ ldr r2, _08062064 @ =gMapObjects
adds r0, r2
ldr r2, _08062068 @ =sub_806206C
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08062064: .4byte gUnknown_2036E38
+_08062064: .4byte gMapObjects
_08062068: .4byte sub_806206C
thumb_func_end sub_8062048
@@ -9235,14 +9235,14 @@ sub_80620D4: @ 80620D4
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _080620F0 @ =gUnknown_2036E38
+ ldr r2, _080620F0 @ =gMapObjects
adds r0, r2
ldr r2, _080620F4 @ =sub_80620F8
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_080620F0: .4byte gUnknown_2036E38
+_080620F0: .4byte gMapObjects
_080620F4: .4byte sub_80620F8
thumb_func_end sub_80620D4
@@ -9312,14 +9312,14 @@ sub_8062160: @ 8062160
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _0806217C @ =gUnknown_2036E38
+ ldr r2, _0806217C @ =gMapObjects
adds r0, r2
ldr r2, _08062180 @ =sub_8062184
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_0806217C: .4byte gUnknown_2036E38
+_0806217C: .4byte gMapObjects
_08062180: .4byte sub_8062184
thumb_func_end sub_8062160
@@ -9389,14 +9389,14 @@ sub_80621EC: @ 80621EC
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08062208 @ =gUnknown_2036E38
+ ldr r2, _08062208 @ =gMapObjects
adds r0, r2
ldr r2, _0806220C @ =sub_8062210
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08062208: .4byte gUnknown_2036E38
+_08062208: .4byte gMapObjects
_0806220C: .4byte sub_8062210
thumb_func_end sub_80621EC
@@ -9466,14 +9466,14 @@ sub_8062278: @ 8062278
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08062294 @ =gUnknown_2036E38
+ ldr r2, _08062294 @ =gMapObjects
adds r0, r2
ldr r2, _08062298 @ =sub_806229C
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08062294: .4byte gUnknown_2036E38
+_08062294: .4byte gMapObjects
_08062298: .4byte sub_806229C
thumb_func_end sub_8062278
@@ -9543,14 +9543,14 @@ sub_8062304: @ 8062304
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08062320 @ =gUnknown_2036E38
+ ldr r2, _08062320 @ =gMapObjects
adds r0, r2
ldr r2, _08062324 @ =sub_8062328
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08062320: .4byte gUnknown_2036E38
+_08062320: .4byte gMapObjects
_08062324: .4byte sub_8062328
thumb_func_end sub_8062304
@@ -9620,14 +9620,14 @@ sub_8062390: @ 8062390
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _080623AC @ =gUnknown_2036E38
+ ldr r2, _080623AC @ =gMapObjects
adds r0, r2
ldr r2, _080623B0 @ =sub_80623B4
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_080623AC: .4byte gUnknown_2036E38
+_080623AC: .4byte gMapObjects
_080623B0: .4byte sub_80623B4
thumb_func_end sub_8062390
@@ -9697,14 +9697,14 @@ sub_806241C: @ 806241C
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08062438 @ =gUnknown_2036E38
+ ldr r2, _08062438 @ =gMapObjects
adds r0, r2
ldr r2, _0806243C @ =sub_8062440
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08062438: .4byte gUnknown_2036E38
+_08062438: .4byte gMapObjects
_0806243C: .4byte sub_8062440
thumb_func_end sub_806241C
@@ -9774,14 +9774,14 @@ sub_80624A8: @ 80624A8
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _080624C4 @ =gUnknown_2036E38
+ ldr r2, _080624C4 @ =gMapObjects
adds r0, r2
ldr r2, _080624C8 @ =sub_80624CC
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_080624C4: .4byte gUnknown_2036E38
+_080624C4: .4byte gMapObjects
_080624C8: .4byte sub_80624CC
thumb_func_end sub_80624A8
@@ -9851,14 +9851,14 @@ sub_8062534: @ 8062534
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08062550 @ =gUnknown_2036E38
+ ldr r2, _08062550 @ =gMapObjects
adds r0, r2
ldr r2, _08062554 @ =sub_8062558
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08062550: .4byte gUnknown_2036E38
+_08062550: .4byte gMapObjects
_08062554: .4byte sub_8062558
thumb_func_end sub_8062534
@@ -9928,14 +9928,14 @@ sub_80625C0: @ 80625C0
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _080625DC @ =gUnknown_2036E38
+ ldr r2, _080625DC @ =gMapObjects
adds r0, r2
ldr r2, _080625E0 @ =sub_80625E4
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_080625DC: .4byte gUnknown_2036E38
+_080625DC: .4byte gMapObjects
_080625E0: .4byte sub_80625E4
thumb_func_end sub_80625C0
@@ -10005,14 +10005,14 @@ sub_806264C: @ 806264C
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08062668 @ =gUnknown_2036E38
+ ldr r2, _08062668 @ =gMapObjects
adds r0, r2
ldr r2, _0806266C @ =sub_8062670
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08062668: .4byte gUnknown_2036E38
+_08062668: .4byte gMapObjects
_0806266C: .4byte sub_8062670
thumb_func_end sub_806264C
@@ -10082,14 +10082,14 @@ sub_80626D8: @ 80626D8
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _080626F4 @ =gUnknown_2036E38
+ ldr r2, _080626F4 @ =gMapObjects
adds r0, r2
ldr r2, _080626F8 @ =sub_80626FC
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_080626F4: .4byte gUnknown_2036E38
+_080626F4: .4byte gMapObjects
_080626F8: .4byte sub_80626FC
thumb_func_end sub_80626D8
@@ -10159,14 +10159,14 @@ sub_8062764: @ 8062764
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08062780 @ =gUnknown_2036E38
+ ldr r2, _08062780 @ =gMapObjects
adds r0, r2
ldr r2, _08062784 @ =sub_8062788
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08062780: .4byte gUnknown_2036E38
+_08062780: .4byte gMapObjects
_08062784: .4byte sub_8062788
thumb_func_end sub_8062764
@@ -10236,14 +10236,14 @@ sub_80627F0: @ 80627F0
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _0806280C @ =gUnknown_2036E38
+ ldr r2, _0806280C @ =gMapObjects
adds r0, r2
ldr r2, _08062810 @ =sub_8062814
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_0806280C: .4byte gUnknown_2036E38
+_0806280C: .4byte gMapObjects
_08062810: .4byte sub_8062814
thumb_func_end sub_80627F0
@@ -10313,14 +10313,14 @@ sub_806287C: @ 806287C
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08062898 @ =gUnknown_2036E38
+ ldr r2, _08062898 @ =gMapObjects
adds r0, r2
ldr r2, _0806289C @ =sub_80628A0
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08062898: .4byte gUnknown_2036E38
+_08062898: .4byte gMapObjects
_0806289C: .4byte sub_80628A0
thumb_func_end sub_806287C
@@ -10368,7 +10368,7 @@ sub_80628E4: @ 80628E4
push {r4-r7,lr}
adds r6, r0, 0
adds r7, r1, 0
- ldr r2, _08062908 @ =gUnknown_2036E38
+ ldr r2, _08062908 @ =gMapObjects
ldr r3, _0806290C @ =gUnknown_2037078
ldrb r1, [r3, 0x5]
lsls r0, r1, 3
@@ -10385,7 +10385,7 @@ _08062904:
movs r0, 0
b _08062938
.align 2, 0
-_08062908: .4byte gUnknown_2036E38
+_08062908: .4byte gMapObjects
_0806290C: .4byte gUnknown_2037078
_08062910:
ldr r5, _08062940 @ =gUnknown_83A6390
@@ -11064,14 +11064,14 @@ sub_8062E60: @ 8062E60
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _08062E7C @ =gUnknown_2036E38
+ ldr r2, _08062E7C @ =gMapObjects
adds r0, r2
ldr r2, _08062E80 @ =sub_8062E84
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_08062E7C: .4byte gUnknown_2036E38
+_08062E7C: .4byte gMapObjects
_08062E80: .4byte sub_8062E84
thumb_func_end sub_8062E60
@@ -11099,7 +11099,7 @@ mss_08062EA4: @ 8062EA4
push {r4-r7,lr}
adds r6, r0, 0
adds r7, r1, 0
- ldr r2, _08062EC8 @ =gUnknown_2036E38
+ ldr r2, _08062EC8 @ =gMapObjects
ldr r3, _08062ECC @ =gUnknown_2037078
ldrb r1, [r3, 0x5]
lsls r0, r1, 3
@@ -11116,7 +11116,7 @@ _08062EC4:
movs r0, 0
b _08062EF8
.align 2, 0
-_08062EC8: .4byte gUnknown_2036E38
+_08062EC8: .4byte gMapObjects
_08062ECC: .4byte gUnknown_2037078
_08062ED0:
ldr r5, _08062F00 @ =gUnknown_83A6390
@@ -11154,7 +11154,7 @@ FieldObjectCB_TreeDisguise: @ 8062F08
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
- ldr r0, _08062F6C @ =gUnknown_2036E38
+ ldr r0, _08062F6C @ =gMapObjects
adds r4, r1, r0
adds r6, r4, 0
adds r6, 0x21
@@ -11188,7 +11188,7 @@ _08062F50:
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08062F6C @ =gUnknown_2036E38
+ ldr r1, _08062F6C @ =gMapObjects
adds r0, r1
ldr r2, _08062F74 @ =sub_8062F78
adds r1, r5, 0
@@ -11197,7 +11197,7 @@ _08062F50:
pop {r0}
bx r0
.align 2, 0
-_08062F6C: .4byte gUnknown_2036E38
+_08062F6C: .4byte gMapObjects
_08062F70: .4byte gUnknown_20386E0
_08062F74: .4byte sub_8062F78
thumb_func_end FieldObjectCB_TreeDisguise
@@ -11220,7 +11220,7 @@ FieldObjectCB_MountainDisguise: @ 8062F84
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
- ldr r0, _08062FE8 @ =gUnknown_2036E38
+ ldr r0, _08062FE8 @ =gMapObjects
adds r4, r1, r0
adds r6, r4, 0
adds r6, 0x21
@@ -11254,7 +11254,7 @@ _08062FCC:
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08062FE8 @ =gUnknown_2036E38
+ ldr r1, _08062FE8 @ =gMapObjects
adds r0, r1
ldr r2, _08062FF0 @ =sub_8062F78
adds r1, r5, 0
@@ -11263,7 +11263,7 @@ _08062FCC:
pop {r0}
bx r0
.align 2, 0
-_08062FE8: .4byte gUnknown_2036E38
+_08062FE8: .4byte gMapObjects
_08062FEC: .4byte gUnknown_20386E0
_08062FF0: .4byte sub_8062F78
thumb_func_end FieldObjectCB_MountainDisguise
@@ -11274,7 +11274,7 @@ FieldObjectCB_Hidden1: @ 8062FF4
adds r3, r0, 0
movs r1, 0x3C
ldrsh r0, [r3, r1]
- ldr r4, _08063050 @ =gUnknown_2036E38
+ ldr r4, _08063050 @ =gMapObjects
cmp r0, 0
bne _08063034
movs r0, 0x2E
@@ -11316,7 +11316,7 @@ _08063034:
pop {r0}
bx r0
.align 2, 0
-_08063050: .4byte gUnknown_2036E38
+_08063050: .4byte gMapObjects
_08063054: .4byte sub_8063058
thumb_func_end FieldObjectCB_Hidden1
@@ -11374,14 +11374,14 @@ sub_80630A0: @ 80630A0
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _080630BC @ =gUnknown_2036E38
+ ldr r2, _080630BC @ =gMapObjects
adds r0, r2
ldr r2, _080630C0 @ =sub_80630C4
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_080630BC: .4byte gUnknown_2036E38
+_080630BC: .4byte gMapObjects
_080630C0: .4byte sub_80630C4
thumb_func_end sub_80630A0
@@ -11436,14 +11436,14 @@ sub_8063110: @ 8063110
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _0806312C @ =gUnknown_2036E38
+ ldr r2, _0806312C @ =gMapObjects
adds r0, r2
ldr r2, _08063130 @ =sub_8063134
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_0806312C: .4byte gUnknown_2036E38
+_0806312C: .4byte gMapObjects
_08063130: .4byte sub_8063134
thumb_func_end sub_8063110
@@ -11498,14 +11498,14 @@ sub_8063180: @ 8063180
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _0806319C @ =gUnknown_2036E38
+ ldr r2, _0806319C @ =gMapObjects
adds r0, r2
ldr r2, _080631A0 @ =sub_80631A4
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_0806319C: .4byte gUnknown_2036E38
+_0806319C: .4byte gMapObjects
_080631A0: .4byte sub_80631A4
thumb_func_end sub_8063180
@@ -11560,14 +11560,14 @@ sub_80631F0: @ 80631F0
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _0806320C @ =gUnknown_2036E38
+ ldr r2, _0806320C @ =gMapObjects
adds r0, r2
ldr r2, _08063210 @ =sub_8063214
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_0806320C: .4byte gUnknown_2036E38
+_0806320C: .4byte gMapObjects
_08063210: .4byte sub_8063214
thumb_func_end sub_80631F0
@@ -11657,14 +11657,14 @@ sub_8063298: @ 8063298
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _080632B4 @ =gUnknown_2036E38
+ ldr r2, _080632B4 @ =gMapObjects
adds r0, r2
ldr r2, _080632B8 @ =sub_8063304
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_080632B4: .4byte gUnknown_2036E38
+_080632B4: .4byte gMapObjects
_080632B8: .4byte sub_8063304
thumb_func_end sub_8063298
@@ -11677,14 +11677,14 @@ sub_80632BC: @ 80632BC
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _080632D8 @ =gUnknown_2036E38
+ ldr r2, _080632D8 @ =gMapObjects
adds r0, r2
ldr r2, _080632DC @ =sub_8063324
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_080632D8: .4byte gUnknown_2036E38
+_080632D8: .4byte gMapObjects
_080632DC: .4byte sub_8063324
thumb_func_end sub_80632BC
@@ -11697,14 +11697,14 @@ sub_80632E0: @ 80632E0
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _080632FC @ =gUnknown_2036E38
+ ldr r2, _080632FC @ =gMapObjects
adds r0, r2
ldr r2, _08063300 @ =sub_8063344
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_080632FC: .4byte gUnknown_2036E38
+_080632FC: .4byte gMapObjects
_08063300: .4byte sub_8063344
thumb_func_end sub_80632E0
@@ -12628,7 +12628,7 @@ _08063912:
lsls r0, r4, 3
adds r0, r4
lsls r0, 2
- ldr r1, _08063968 @ =gUnknown_2036E38
+ ldr r1, _08063968 @ =gMapObjects
adds r2, r0, r1
ldrb r0, [r2]
lsls r0, 31
@@ -12669,7 +12669,7 @@ _0806394C:
movs r0, 0x1
b _08063978
.align 2, 0
-_08063968: .4byte gUnknown_2036E38
+_08063968: .4byte gMapObjects
_0806396C:
adds r0, r4, 0x1
lsls r0, 24
@@ -12699,7 +12699,7 @@ IsBerryTreeSparkling: @ 8063980
cmp r0, 0
bne _080639CC
ldr r3, _080639C4 @ =gSprites
- ldr r2, _080639C8 @ =gUnknown_2036E38
+ ldr r2, _080639C8 @ =gMapObjects
mov r0, sp
ldrb r1, [r0]
lsls r0, r1, 3
@@ -12720,7 +12720,7 @@ IsBerryTreeSparkling: @ 8063980
b _080639CE
.align 2, 0
_080639C4: .4byte gSprites
-_080639C8: .4byte gUnknown_2036E38
+_080639C8: .4byte gMapObjects
_080639CC:
movs r0, 0
_080639CE:
@@ -12745,7 +12745,7 @@ sub_80639D4: @ 80639D4
cmp r0, 0
bne _08063A12
ldr r3, _08063A18 @ =gSprites
- ldr r2, _08063A1C @ =gUnknown_2036E38
+ ldr r2, _08063A1C @ =gMapObjects
mov r0, sp
ldrb r1, [r0]
lsls r0, r1, 3
@@ -12767,7 +12767,7 @@ _08063A12:
bx r0
.align 2, 0
_08063A18: .4byte gSprites
-_08063A1C: .4byte gUnknown_2036E38
+_08063A1C: .4byte gMapObjects
thumb_func_end sub_80639D4
thumb_func_start MoveCoords
@@ -18661,7 +18661,7 @@ sub_806637C: @ 806637C
ldrsh r0, [r5, r1]
movs r2, 0x12
ldrsh r1, [r5, r2]
- ldr r4, _080663D4 @ =gUnknown_2036E38
+ ldr r4, _080663D4 @ =gMapObjects
mov r2, sp
ldrb r2, [r2]
lsls r3, r2, 3
@@ -18687,7 +18687,7 @@ _080663C6:
pop {r1}
bx r1
.align 2, 0
-_080663D4: .4byte gUnknown_2036E38
+_080663D4: .4byte gMapObjects
thumb_func_end sub_806637C
thumb_func_start sub_80663D8
@@ -18708,7 +18708,7 @@ sub_80663D8: @ 80663D8
ldrsh r0, [r5, r1]
movs r2, 0x12
ldrsh r1, [r5, r2]
- ldr r4, _08066438 @ =gUnknown_2036E38
+ ldr r4, _08066438 @ =gMapObjects
mov r2, sp
ldrb r2, [r2]
lsls r3, r2, 3
@@ -18737,7 +18737,7 @@ _0806642A:
pop {r1}
bx r1
.align 2, 0
-_08066438: .4byte gUnknown_2036E38
+_08066438: .4byte gMapObjects
thumb_func_end sub_80663D8
thumb_func_start sub_806643C
diff --git a/asm/field_player_avatar.s b/asm/field_player_avatar.s
index 93a13f293..f0621961a 100644
--- a/asm/field_player_avatar.s
+++ b/asm/field_player_avatar.s
@@ -14,14 +14,14 @@ sub_805B3B8: @ 805B3B8
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _0805B3D4 @ =gUnknown_2036E38
+ ldr r2, _0805B3D4 @ =gMapObjects
adds r0, r2
ldr r2, _0805B3D8 @ =sub_805B3DC
bl FieldObjectStep
pop {r0}
bx r0
.align 2, 0
-_0805B3D4: .4byte gUnknown_2036E38
+_0805B3D4: .4byte gMapObjects
_0805B3D8: .4byte sub_805B3DC
thumb_func_end sub_805B3B8
@@ -48,7 +48,7 @@ sub_805B3E0: @ 805B3E0
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805B458 @ =gUnknown_2036E38
+ ldr r1, _0805B458 @ =gMapObjects
adds r5, r0, r1
adds r0, r5, 0
bl sub_805CC40
@@ -85,7 +85,7 @@ _0805B448:
bx r0
.align 2, 0
_0805B454: .4byte gUnknown_2037078
-_0805B458: .4byte gUnknown_2036E38
+_0805B458: .4byte gMapObjects
thumb_func_end sub_805B3E0
thumb_func_start sub_805B45C
@@ -222,7 +222,7 @@ sub_805B528: @ 805B528
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805B594 @ =gUnknown_2036E38
+ ldr r1, _0805B594 @ =gMapObjects
adds r1, r0, r1
str r1, [r4]
ldrb r0, [r1]
@@ -254,7 +254,7 @@ _0805B586:
.align 2, 0
_0805B58C: .4byte gUnknown_2037078
_0805B590: .4byte gUnknown_2036E30
-_0805B594: .4byte gUnknown_2036E38
+_0805B594: .4byte gMapObjects
_0805B598:
movs r0, 0
_0805B59A:
@@ -273,7 +273,7 @@ sub_805B5A0: @ 805B5A0
ands r0, r1
cmp r0, 0
bne _0805B610
- ldr r2, _0805B5F8 @ =gUnknown_2036E38
+ ldr r2, _0805B5F8 @ =gMapObjects
ldrb r1, [r3, 0x5]
lsls r0, r1, 3
adds r0, r1
@@ -308,7 +308,7 @@ _0805B5CC:
b _0805B628
.align 2, 0
_0805B5F4: .4byte gUnknown_2037078
-_0805B5F8: .4byte gUnknown_2036E38
+_0805B5F8: .4byte gMapObjects
_0805B5FC: .4byte gUnknown_835B764
_0805B600:
ldr r0, _0805B60C @ =gUnknown_2037078
@@ -362,7 +362,7 @@ ForcedMovement_None: @ 805B644
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805B68C @ =gUnknown_2036E38
+ ldr r1, _0805B68C @ =gMapObjects
adds r0, r1
ldrb r2, [r0, 0x1]
movs r1, 0x3
@@ -386,7 +386,7 @@ _0805B67E:
bx r1
.align 2, 0
_0805B688: .4byte gUnknown_2037078
-_0805B68C: .4byte gUnknown_2036E38
+_0805B68C: .4byte gMapObjects
thumb_func_end ForcedMovement_None
thumb_func_start DoForcedMovement
@@ -461,7 +461,7 @@ DoForcedMovementInCurrentDirection: @ 805B708
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _0805B738 @ =gUnknown_2036E38
+ ldr r2, _0805B738 @ =gMapObjects
adds r0, r2
ldrb r2, [r0, 0x1]
movs r3, 0x4
@@ -476,7 +476,7 @@ DoForcedMovementInCurrentDirection: @ 805B708
bx r1
.align 2, 0
_0805B734: .4byte gUnknown_2037078
-_0805B738: .4byte gUnknown_2036E38
+_0805B738: .4byte gMapObjects
thumb_func_end DoForcedMovementInCurrentDirection
thumb_func_start ForcedMovement_Slip
@@ -683,7 +683,7 @@ ForcedMovement_Slide: @ 805B88C
lsls r2, r3, 3
adds r2, r3
lsls r2, 2
- ldr r3, _0805B8C0 @ =gUnknown_2036E38
+ ldr r3, _0805B8C0 @ =gMapObjects
adds r2, r3
ldrb r3, [r2, 0x1]
movs r4, 0x4
@@ -699,7 +699,7 @@ ForcedMovement_Slide: @ 805B88C
bx r1
.align 2, 0
_0805B8BC: .4byte gUnknown_2037078
-_0805B8C0: .4byte gUnknown_2036E38
+_0805B8C0: .4byte gMapObjects
thumb_func_end ForcedMovement_Slide
thumb_func_start ForcedMovement_SlideSouth
@@ -919,7 +919,7 @@ _0805BA30:
lsls r0, 24
cmp r0, 0
beq _0805BA8C
- ldr r2, _0805BA70 @ =gUnknown_2036E38
+ ldr r2, _0805BA70 @ =gMapObjects
ldrb r1, [r6, 0x5]
lsls r0, r1, 3
adds r0, r1
@@ -938,7 +938,7 @@ _0805BA30:
b _0805BA7A
.align 2, 0
_0805BA6C: .4byte 0x0000082f
-_0805BA70: .4byte gUnknown_2036E38
+_0805BA70: .4byte gMapObjects
_0805BA74:
adds r0, r4, 0
bl sub_805C17C
@@ -979,7 +979,7 @@ sub_805BAAC: @ 805BAAC
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805BAE8 @ =gUnknown_2036E38
+ ldr r1, _0805BAE8 @ =gMapObjects
adds r0, r1
ldrh r2, [r0, 0x10]
mov r1, sp
@@ -1000,7 +1000,7 @@ sub_805BAAC: @ 805BAAC
b _0805BB00
.align 2, 0
_0805BAE4: .4byte gUnknown_2037078
-_0805BAE8: .4byte gUnknown_2036E38
+_0805BAE8: .4byte gMapObjects
_0805BAEC:
movs r0, 0x1
mov r1, sp
@@ -1039,7 +1039,7 @@ sub_805BB1C: @ 805BB1C
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805BB98 @ =gUnknown_2036E38
+ ldr r1, _0805BB98 @ =gMapObjects
adds r5, r0, r1
ldrh r1, [r5, 0x10]
add r0, sp, 0x4
@@ -1086,7 +1086,7 @@ sub_805BB1C: @ 805BB1C
b _0805BB9E
.align 2, 0
_0805BB94: .4byte gUnknown_2037078
-_0805BB98: .4byte gUnknown_2036E38
+_0805BB98: .4byte gMapObjects
_0805BB9C:
movs r0, 0x8
_0805BB9E:
@@ -1291,7 +1291,7 @@ sub_805BCEC: @ 805BCEC
lsrs r6, r0, 24
cmp r6, 0x10
beq _0805BDA0
- ldr r0, _0805BD9C @ =gUnknown_2036E38
+ ldr r0, _0805BD9C @ =gMapObjects
lsls r1, r6, 3
adds r1, r6
lsls r1, 2
@@ -1347,7 +1347,7 @@ _0805BD8A:
b _0805BDA2
.align 2, 0
_0805BD98: .4byte 0x00000805
-_0805BD9C: .4byte gUnknown_2036E38
+_0805BD9C: .4byte gMapObjects
_0805BDA0:
movs r0, 0
_0805BDA2:
@@ -1431,7 +1431,7 @@ _0805BE14:
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805BE58 @ =gUnknown_2036E38
+ ldr r1, _0805BE58 @ =gMapObjects
adds r0, r1
ldr r1, [r2]
bl _call_via_r1
@@ -1452,7 +1452,7 @@ _0805BE48:
.align 2, 0
_0805BE50: .4byte gUnknown_2037078
_0805BE54: .4byte gUnknown_835B844
-_0805BE58: .4byte gUnknown_2036E38
+_0805BE58: .4byte gMapObjects
thumb_func_end DoPlayerAvatarTransition
thumb_func_start nullsub_22
@@ -1552,7 +1552,7 @@ _0805BEF6:
thumb_func_start player_is_anim_in_certain_ranges
player_is_anim_in_certain_ranges: @ 805BEFC
push {lr}
- ldr r2, _0805BF48 @ =gUnknown_2036E38
+ ldr r2, _0805BF48 @ =gMapObjects
ldr r0, _0805BF4C @ =gUnknown_2037078
ldrb r1, [r0, 0x5]
lsls r0, r1, 3
@@ -1590,7 +1590,7 @@ _0805BF42:
movs r0, 0x1
b _0805BF52
.align 2, 0
-_0805BF48: .4byte gUnknown_2036E38
+_0805BF48: .4byte gMapObjects
_0805BF4C: .4byte gUnknown_2037078
_0805BF50:
movs r0, 0
@@ -1629,7 +1629,7 @@ PlayerIsAnimActive: @ 805BF7C
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805BF9C @ =gUnknown_2036E38
+ ldr r1, _0805BF9C @ =gMapObjects
adds r0, r1
bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive
lsls r0, 24
@@ -1638,7 +1638,7 @@ PlayerIsAnimActive: @ 805BF7C
bx r1
.align 2, 0
_0805BF98: .4byte gUnknown_2037078
-_0805BF9C: .4byte gUnknown_2036E38
+_0805BF9C: .4byte gMapObjects
thumb_func_end PlayerIsAnimActive
thumb_func_start PlayerCheckIfAnimFinishedOrInactive
@@ -1649,7 +1649,7 @@ PlayerCheckIfAnimFinishedOrInactive: @ 805BFA0
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805BFC0 @ =gUnknown_2036E38
+ ldr r1, _0805BFC0 @ =gMapObjects
adds r0, r1
bl FieldObjectCheckIfSpecialAnimFinishedOrInactive
lsls r0, 24
@@ -1658,12 +1658,12 @@ PlayerCheckIfAnimFinishedOrInactive: @ 805BFA0
bx r1
.align 2, 0
_0805BFBC: .4byte gUnknown_2037078
-_0805BFC0: .4byte gUnknown_2036E38
+_0805BFC0: .4byte gMapObjects
thumb_func_end PlayerCheckIfAnimFinishedOrInactive
thumb_func_start player_set_x22
player_set_x22: @ 805BFC4
- ldr r3, _0805BFD8 @ =gUnknown_2036E38
+ ldr r3, _0805BFD8 @ =gMapObjects
ldr r1, _0805BFDC @ =gUnknown_2037078
ldrb r2, [r1, 0x5]
lsls r1, r2, 3
@@ -1674,13 +1674,13 @@ player_set_x22: @ 805BFC4
strb r0, [r1]
bx lr
.align 2, 0
-_0805BFD8: .4byte gUnknown_2036E38
+_0805BFD8: .4byte gMapObjects
_0805BFDC: .4byte gUnknown_2037078
thumb_func_end player_set_x22
thumb_func_start player_get_x22
player_get_x22: @ 805BFE0
- ldr r2, _0805BFF4 @ =gUnknown_2036E38
+ ldr r2, _0805BFF4 @ =gMapObjects
ldr r0, _0805BFF8 @ =gUnknown_2037078
ldrb r1, [r0, 0x5]
lsls r0, r1, 3
@@ -1691,7 +1691,7 @@ player_get_x22: @ 805BFE0
ldrb r0, [r0]
bx lr
.align 2, 0
-_0805BFF4: .4byte gUnknown_2036E38
+_0805BFF4: .4byte gMapObjects
_0805BFF8: .4byte gUnknown_2037078
thumb_func_end player_get_x22
@@ -1706,14 +1706,14 @@ sub_805BFFC: @ 805BFFC
lsls r0, r2, 3
adds r0, r2
lsls r0, 2
- ldr r2, _0805C020 @ =gUnknown_2036E38
+ ldr r2, _0805C020 @ =gMapObjects
adds r0, r2
bl FieldObjectForceSetSpecialAnim
pop {r0}
bx r0
.align 2, 0
_0805C01C: .4byte gUnknown_2037078
-_0805C020: .4byte gUnknown_2036E38
+_0805C020: .4byte gMapObjects
thumb_func_end sub_805BFFC
thumb_func_start sub_805C024
@@ -1734,7 +1734,7 @@ sub_805C024: @ 805C024
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805C068 @ =gUnknown_2036E38
+ ldr r1, _0805C068 @ =gMapObjects
adds r0, r1
adds r1, r5, 0
bl sub_8063CA4
@@ -1749,7 +1749,7 @@ _0805C05E:
bx r0
.align 2, 0
_0805C064: .4byte gUnknown_2037078
-_0805C068: .4byte gUnknown_2036E38
+_0805C068: .4byte gMapObjects
thumb_func_end sub_805C024
thumb_func_start sub_805C06C
@@ -1762,7 +1762,7 @@ sub_805C06C: @ 805C06C
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805C0A0 @ =gUnknown_2036E38
+ ldr r1, _0805C0A0 @ =gMapObjects
adds r0, r1
adds r1, r4, 0
bl sub_8063CA4
@@ -1778,7 +1778,7 @@ _0805C094:
bx r0
.align 2, 0
_0805C09C: .4byte gUnknown_2037078
-_0805C0A0: .4byte gUnknown_2036E38
+_0805C0A0: .4byte gMapObjects
thumb_func_end sub_805C06C
thumb_func_start sub_805C0A4
@@ -2056,7 +2056,7 @@ _0805C27E:
lsls r0, 24
cmp r0, 0
beq _0805C2A6
- ldr r2, _0805C2B0 @ =gUnknown_2036E38
+ ldr r2, _0805C2B0 @ =gMapObjects
ldrb r1, [r4, 0x5]
lsls r0, r1, 3
adds r0, r1
@@ -2075,7 +2075,7 @@ _0805C2A6:
bx r0
.align 2, 0
_0805C2AC: .4byte gUnknown_2037078
-_0805C2B0: .4byte gUnknown_2036E38
+_0805C2B0: .4byte gMapObjects
thumb_func_end sub_805C270
thumb_func_start sub_805C2B4
@@ -2301,7 +2301,7 @@ sub_805C438: @ 805C438
lsls r0, 24
lsrs r5, r0, 24
adds r6, r5, 0
- ldr r2, _0805C4E8 @ =gUnknown_2036E38
+ ldr r2, _0805C4E8 @ =gMapObjects
ldr r0, _0805C4EC @ =gUnknown_2037078
ldrb r1, [r0, 0x5]
lsls r0, r1, 3
@@ -2378,7 +2378,7 @@ _0805C4DE:
pop {r0}
bx r0
.align 2, 0
-_0805C4E8: .4byte gUnknown_2036E38
+_0805C4E8: .4byte gMapObjects
_0805C4EC: .4byte gUnknown_2037078
_0805C4F0: .4byte gUnknown_835B864
thumb_func_end sub_805C438
@@ -2388,7 +2388,7 @@ GetXYCoordsOneStepInFrontOfPlayer: @ 805C4F4
push {r4,r5,lr}
adds r4, r0, 0
adds r5, r1, 0
- ldr r3, _0805C530 @ =gUnknown_2036E38
+ ldr r3, _0805C530 @ =gMapObjects
ldr r2, _0805C534 @ =gUnknown_2037078
ldrb r1, [r2, 0x5]
lsls r0, r1, 3
@@ -2414,14 +2414,14 @@ GetXYCoordsOneStepInFrontOfPlayer: @ 805C4F4
pop {r0}
bx r0
.align 2, 0
-_0805C530: .4byte gUnknown_2036E38
+_0805C530: .4byte gMapObjects
_0805C534: .4byte gUnknown_2037078
thumb_func_end GetXYCoordsOneStepInFrontOfPlayer
thumb_func_start PlayerGetDestCoords
PlayerGetDestCoords: @ 805C538
push {r4,r5,lr}
- ldr r5, _0805C560 @ =gUnknown_2036E38
+ ldr r5, _0805C560 @ =gMapObjects
ldr r4, _0805C564 @ =gUnknown_2037078
ldrb r3, [r4, 0x5]
lsls r2, r3, 3
@@ -2441,7 +2441,7 @@ PlayerGetDestCoords: @ 805C538
pop {r0}
bx r0
.align 2, 0
-_0805C560: .4byte gUnknown_2036E38
+_0805C560: .4byte gMapObjects
_0805C564: .4byte gUnknown_2037078
thumb_func_end PlayerGetDestCoords
@@ -2455,7 +2455,7 @@ plaer_get_pos_including_state_based_drift: @ 805C568
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805C5C0 @ =gUnknown_2036E38
+ ldr r1, _0805C5C0 @ =gMapObjects
adds r3, r0, r1
ldrb r1, [r3]
movs r0, 0xC0
@@ -2493,7 +2493,7 @@ _0805C5B0:
mov pc, r0
.align 2, 0
_0805C5BC: .4byte gUnknown_2037078
-_0805C5C0: .4byte gUnknown_2036E38
+_0805C5C0: .4byte gMapObjects
_0805C5C4: .4byte gSprites
_0805C5C8: .4byte _0805C5CC
.align 2, 0
@@ -2584,7 +2584,7 @@ _0805C6BC:
thumb_func_start player_get_direction_lower_nybble
player_get_direction_lower_nybble: @ 805C6C4
- ldr r2, _0805C6DC @ =gUnknown_2036E38
+ ldr r2, _0805C6DC @ =gMapObjects
ldr r0, _0805C6E0 @ =gUnknown_2037078
ldrb r1, [r0, 0x5]
lsls r0, r1, 3
@@ -2596,13 +2596,13 @@ player_get_direction_lower_nybble: @ 805C6C4
lsrs r0, 28
bx lr
.align 2, 0
-_0805C6DC: .4byte gUnknown_2036E38
+_0805C6DC: .4byte gMapObjects
_0805C6E0: .4byte gUnknown_2037078
thumb_func_end player_get_direction_lower_nybble
thumb_func_start player_get_direction_upper_nybble
player_get_direction_upper_nybble: @ 805C6E4
- ldr r2, _0805C6F8 @ =gUnknown_2036E38
+ ldr r2, _0805C6F8 @ =gMapObjects
ldr r0, _0805C6FC @ =gUnknown_2037078
ldrb r1, [r0, 0x5]
lsls r0, r1, 3
@@ -2613,13 +2613,13 @@ player_get_direction_upper_nybble: @ 805C6E4
lsrs r0, 4
bx lr
.align 2, 0
-_0805C6F8: .4byte gUnknown_2036E38
+_0805C6F8: .4byte gMapObjects
_0805C6FC: .4byte gUnknown_2037078
thumb_func_end player_get_direction_upper_nybble
thumb_func_start PlayerGetZCoord
PlayerGetZCoord: @ 805C700
- ldr r2, _0805C714 @ =gUnknown_2036E38
+ ldr r2, _0805C714 @ =gMapObjects
ldr r0, _0805C718 @ =gUnknown_2037078
ldrb r1, [r0, 0x5]
lsls r0, r1, 3
@@ -2630,7 +2630,7 @@ PlayerGetZCoord: @ 805C700
lsrs r0, 4
bx lr
.align 2, 0
-_0805C714: .4byte gUnknown_2036E38
+_0805C714: .4byte gMapObjects
_0805C718: .4byte gUnknown_2037078
thumb_func_end PlayerGetZCoord
@@ -2644,7 +2644,7 @@ sub_805C71C: @ 805C71C
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805C748 @ =gUnknown_2036E38
+ ldr r1, _0805C748 @ =gMapObjects
adds r0, r1
lsls r3, 16
asrs r3, 16
@@ -2656,7 +2656,7 @@ sub_805C71C: @ 805C71C
bx r0
.align 2, 0
_0805C744: .4byte gUnknown_2037078
-_0805C748: .4byte gUnknown_2036E38
+_0805C748: .4byte gMapObjects
thumb_func_end sub_805C71C
thumb_func_start TestPlayerAvatarFlags
@@ -2704,7 +2704,7 @@ sub_805C780: @ 805C780
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _0805C7C4 @ =gUnknown_2036E38
+ ldr r0, _0805C7C4 @ =gMapObjects
adds r4, r0
adds r0, r4, 0
bl npc_clear_strange_bits
@@ -2727,7 +2727,7 @@ _0805C7B8:
bx r0
.align 2, 0
_0805C7C0: .4byte gUnknown_2037078
-_0805C7C4: .4byte gUnknown_2036E38
+_0805C7C4: .4byte gMapObjects
thumb_func_end sub_805C780
thumb_func_start sub_805C7C8
@@ -2882,7 +2882,7 @@ IsPlayerFacingSurfableFishableWater: @ 805C8B0
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _0805C928 @ =gUnknown_2036E38
+ ldr r0, _0805C928 @ =gMapObjects
adds r4, r0
ldrh r1, [r4, 0x10]
mov r0, sp
@@ -2930,7 +2930,7 @@ IsPlayerFacingSurfableFishableWater: @ 805C8B0
b _0805C92E
.align 2, 0
_0805C924: .4byte gUnknown_2037078
-_0805C928: .4byte gUnknown_2036E38
+_0805C928: .4byte gMapObjects
_0805C92C:
movs r0, 0
_0805C92E:
@@ -3152,7 +3152,7 @@ InitPlayerAvatar: @ 805CA3C
lsls r4, r5, 3
adds r4, r5
lsls r4, 2
- ldr r0, _0805CAFC @ =gUnknown_2036E38
+ ldr r0, _0805CAFC @ =gMapObjects
adds r4, r0
ldrb r0, [r4, 0x2]
movs r1, 0x1
@@ -3182,7 +3182,7 @@ InitPlayerAvatar: @ 805CA3C
pop {r0}
bx r0
.align 2, 0
-_0805CAFC: .4byte gUnknown_2036E38
+_0805CAFC: .4byte gMapObjects
_0805CB00: .4byte gUnknown_2037078
thumb_func_end InitPlayerAvatar
@@ -3191,7 +3191,7 @@ sub_805CB04: @ 805CB04
push {r4-r6,lr}
lsls r0, 24
lsrs r4, r0, 24
- ldr r6, _0805CB64 @ =gUnknown_2036E38
+ ldr r6, _0805CB64 @ =gMapObjects
ldr r5, _0805CB68 @ =gUnknown_2037078
ldrb r0, [r5, 0x5]
lsls r1, r0, 3
@@ -3236,7 +3236,7 @@ _0805CB5C:
pop {r0}
bx r0
.align 2, 0
-_0805CB64: .4byte gUnknown_2036E38
+_0805CB64: .4byte gMapObjects
_0805CB68: .4byte gUnknown_2037078
_0805CB6C: .4byte gSprites
thumb_func_end sub_805CB04
@@ -3249,7 +3249,7 @@ sub_805CB70: @ 805CB70
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _0805CBB0 @ =gUnknown_2036E38
+ ldr r0, _0805CBB0 @ =gMapObjects
adds r4, r0
movs r0, 0x3
bl sub_805C808
@@ -3271,7 +3271,7 @@ sub_805CB70: @ 805CB70
bx r0
.align 2, 0
_0805CBAC: .4byte gUnknown_2037078
-_0805CBB0: .4byte gUnknown_2036E38
+_0805CBB0: .4byte gMapObjects
_0805CBB4: .4byte gSprites
thumb_func_end sub_805CB70
@@ -3311,7 +3311,7 @@ sub_805CBE8: @ 805CBE8
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _0805CC24 @ =gUnknown_2036E38
+ ldr r0, _0805CC24 @ =gMapObjects
adds r4, r0
bl sub_805CBB8
adds r1, r0, 0
@@ -3332,7 +3332,7 @@ sub_805CBE8: @ 805CBE8
bx r0
.align 2, 0
_0805CC20: .4byte gUnknown_2037078
-_0805CC24: .4byte gUnknown_2036E38
+_0805CC24: .4byte gMapObjects
_0805CC28: .4byte gSprites
thumb_func_end sub_805CBE8
@@ -3468,7 +3468,7 @@ taskFF_bump_boulder: @ 805CD0C
lsrs r0, 24
ldr r6, _0805CD54 @ =gUnknown_835B8A0
ldr r2, _0805CD58 @ =gTasks
- ldr r5, _0805CD5C @ =gUnknown_2036E38
+ ldr r5, _0805CD5C @ =gMapObjects
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
@@ -3502,7 +3502,7 @@ _0805CD20:
.align 2, 0
_0805CD54: .4byte gUnknown_835B8A0
_0805CD58: .4byte gTasks
-_0805CD5C: .4byte gUnknown_2036E38
+_0805CD5C: .4byte gMapObjects
_0805CD60: .4byte gUnknown_2037078
thumb_func_end taskFF_bump_boulder
@@ -3677,7 +3677,7 @@ _0805CEB2:
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
- ldr r0, _0805CEE8 @ =gUnknown_2036E38
+ ldr r0, _0805CEE8 @ =gMapObjects
adds r1, r0
ldr r2, [r2]
adds r0, r4, 0
@@ -3692,7 +3692,7 @@ _0805CEB2:
_0805CEDC: .4byte gUnknown_835B8AC
_0805CEE0: .4byte gTasks
_0805CEE4: .4byte gUnknown_2037078
-_0805CEE8: .4byte gUnknown_2036E38
+_0805CEE8: .4byte gMapObjects
thumb_func_end sub_805CEA0
thumb_func_start PlayerAvatar_DoSecretBaseMatJump
@@ -3785,7 +3785,7 @@ _0805CF8A:
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
- ldr r0, _0805CFC0 @ =gUnknown_2036E38
+ ldr r0, _0805CFC0 @ =gMapObjects
adds r1, r0
ldr r2, [r2]
adds r0, r4, 0
@@ -3800,7 +3800,7 @@ _0805CF8A:
_0805CFB4: .4byte gUnknown_835B8B0
_0805CFB8: .4byte gTasks
_0805CFBC: .4byte gUnknown_2037078
-_0805CFC0: .4byte gUnknown_2036E38
+_0805CFC0: .4byte gMapObjects
thumb_func_end sub_805CF78
thumb_func_start sub_805CFC4
@@ -4070,7 +4070,7 @@ taskFF_0805D1D4: @ 805D1D4
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805D234 @ =gUnknown_2036E38
+ ldr r1, _0805D234 @ =gMapObjects
adds r5, r0, r1
adds r0, r5, 0
bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive
@@ -4106,7 +4106,7 @@ _0805D228:
bx r0
.align 2, 0
_0805D230: .4byte gUnknown_2037078
-_0805D234: .4byte gUnknown_2036E38
+_0805D234: .4byte gMapObjects
_0805D238: .4byte gTasks
_0805D23C: .4byte sub_805D240
thumb_func_end taskFF_0805D1D4
@@ -4121,7 +4121,7 @@ sub_805D240: @ 805D240
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805D2B8 @ =gUnknown_2036E38
+ ldr r1, _0805D2B8 @ =gMapObjects
adds r4, r0, r1
adds r0, r4, 0
bl FieldObjectClearAnimIfSpecialAnimFinished
@@ -4164,7 +4164,7 @@ _0805D2AE:
bx r0
.align 2, 0
_0805D2B4: .4byte gUnknown_2037078
-_0805D2B8: .4byte gUnknown_2036E38
+_0805D2B8: .4byte gMapObjects
_0805D2BC: .4byte gSprites
thumb_func_end sub_805D240
@@ -4281,7 +4281,7 @@ fish1: @ 805D35C
ldrh r1, [r6]
adds r1, r0
strh r1, [r5, 0x22]
- ldr r3, _0805D3EC @ =gUnknown_2036E38
+ ldr r3, _0805D3EC @ =gMapObjects
ldr r2, _0805D3F0 @ =gUnknown_2037078
ldrb r1, [r2, 0x5]
lsls r0, r1, 3
@@ -4316,7 +4316,7 @@ fish1: @ 805D35C
.align 2, 0
_0805D3E4: .4byte gUnknown_835B90C
_0805D3E8: .4byte gUnknown_835B912
-_0805D3EC: .4byte gUnknown_2036E38
+_0805D3EC: .4byte gMapObjects
_0805D3F0: .4byte gUnknown_2037078
thumb_func_end fish1
@@ -4727,7 +4727,7 @@ _0805D6EA:
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _0805D77C @ =gUnknown_2036E38
+ ldr r0, _0805D77C @ =gMapObjects
mov r8, r0
add r4, r8
ldrh r1, [r5, 0x24]
@@ -4777,7 +4777,7 @@ _0805D748:
.align 2, 0
_0805D774: .4byte gUnknown_2037078
_0805D778: .4byte gSprites
-_0805D77C: .4byte gUnknown_2036E38
+_0805D77C: .4byte gMapObjects
_0805D780:
movs r1, 0xA
ldrsh r0, [r5, r1]
@@ -4971,7 +4971,7 @@ sub_805D8D8: @ 805D8D8
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _0805D97C @ =gUnknown_2036E38
+ ldr r0, _0805D97C @ =gMapObjects
mov r8, r0
add r4, r8
ldrh r1, [r6, 0x24]
@@ -5024,7 +5024,7 @@ _0805D968:
.align 2, 0
_0805D974: .4byte gUnknown_2037078
_0805D978: .4byte gSprites
-_0805D97C: .4byte gUnknown_2036E38
+_0805D97C: .4byte gMapObjects
thumb_func_end sub_805D8D8
thumb_func_start sub_805D980
@@ -5159,7 +5159,7 @@ _0805DA78:
ands r0, r1
cmp r0, 0
beq _0805DA9C
- ldr r2, _0805DAAC @ =gUnknown_2036E38
+ ldr r2, _0805DAAC @ =gMapObjects
ldrb r1, [r3, 0x5]
lsls r0, r1, 3
adds r0, r1
@@ -5177,7 +5177,7 @@ _0805DA9C:
.align 2, 0
_0805DAA4: .4byte 0x0000fff8
_0805DAA8: .4byte gUnknown_2037078
-_0805DAAC: .4byte gUnknown_2036E38
+_0805DAAC: .4byte gMapObjects
thumb_func_end sub_805D9C4
thumb_func_start sub_805DAB0
@@ -5247,7 +5247,7 @@ sub_805DB04: @ 805DB04
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805DB4C @ =gUnknown_2036E38
+ ldr r1, _0805DB4C @ =gMapObjects
adds r4, r0, r1
ldrb r1, [r4, 0x4]
lsls r0, r1, 4
@@ -5271,7 +5271,7 @@ sub_805DB04: @ 805DB04
b _0805DBFA
.align 2, 0
_0805DB48: .4byte gUnknown_2037078
-_0805DB4C: .4byte gUnknown_2036E38
+_0805DB4C: .4byte gMapObjects
_0805DB50: .4byte gSprites
_0805DB54: .4byte gTasks+0x8
_0805DB58:
@@ -5406,7 +5406,7 @@ sub_805DC38: @ 805DC38
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805DC84 @ =gUnknown_2036E38
+ ldr r1, _0805DC84 @ =gMapObjects
adds r4, r0, r1
ldrb r1, [r4, 0x4]
lsls r0, r1, 4
@@ -5431,7 +5431,7 @@ sub_805DC38: @ 805DC38
b _0805DDBA
.align 2, 0
_0805DC80: .4byte gUnknown_2037078
-_0805DC84: .4byte gUnknown_2036E38
+_0805DC84: .4byte gMapObjects
_0805DC88: .4byte gSprites
_0805DC8C: .4byte gTasks+0x8
_0805DC90:
diff --git a/asm/field_poison.s b/asm/field_poison.s
index 348812b06..930f5b403 100644
--- a/asm/field_poison.s
+++ b/asm/field_poison.s
@@ -74,11 +74,11 @@ MonFaintFromPoisonOnField: @ 80A04B8
str r0, [sp]
adds r0, r4, 0
movs r1, 0x8
- bl sub_80436F8
+ bl AdjustFriendship
adds r0, r4, 0
movs r1, 0x37
mov r2, sp
- bl sub_804037C
+ bl SetMonData
ldr r5, _080A0500 @ =gStringVar1
adds r0, r4, 0
movs r1, 0x2
@@ -279,7 +279,7 @@ _080A065C:
adds r0, r4, 0
movs r1, 0x39
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r7, 0x1
_080A0668:
adds r4, 0x64
diff --git a/asm/field_screen_effect.s b/asm/field_screen_effect.s
index 2a6ee5c65..a1a51b908 100644
--- a/asm/field_screen_effect.s
+++ b/asm/field_screen_effect.s
@@ -942,7 +942,7 @@ _0807F542:
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0807F580 @ =gUnknown_2036E38
+ ldr r1, _0807F580 @ =gMapObjects
adds r0, r1
movs r1, 0x2
bl FieldObjectTurn
@@ -958,7 +958,7 @@ _0807F542:
.align 2, 0
_0807F578: .4byte gUnknown_841B5B6
_0807F57C: .4byte gUnknown_2037078
-_0807F580: .4byte gUnknown_2036E38
+_0807F580: .4byte gMapObjects
_0807F584: .4byte gTasks
_0807F588:
lsls r4, r6, 2
diff --git a/asm/field_specials.s b/asm/field_specials.s
index 5132df30e..ec2cb2147 100644
--- a/asm/field_specials.s
+++ b/asm/field_specials.s
@@ -604,7 +604,7 @@ SpawnScriptFieldObject: @ 80CAA34
bl SpawnSpecialFieldObjectParametrized
lsls r0, 24
lsrs r0, 24
- ldr r2, _080CAA84 @ =gUnknown_2036E38
+ ldr r2, _080CAA84 @ =gMapObjects
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
@@ -620,7 +620,7 @@ SpawnScriptFieldObject: @ 80CAA34
bx r0
.align 2, 0
_080CAA80: .4byte gSaveBlock1Ptr
-_080CAA84: .4byte gUnknown_2036E38
+_080CAA84: .4byte gMapObjects
thumb_func_end SpawnScriptFieldObject
thumb_func_start RemoveScriptFieldObject
@@ -713,7 +713,7 @@ GivLeadMonEffortRibbon: @ 80CAB08
adds r0, r1
movs r1, 0x47
mov r2, sp
- bl sub_804037C
+ bl SetMonData
add sp, 0x4
pop {r0}
bx r0
@@ -1457,7 +1457,7 @@ _080CB0EA:
lsrs r0, 16
movs r1, 0xB
muls r1, r0
- ldr r0, _080CB120 @ =gUnknown_8245EE0
+ ldr r0, _080CB120 @ =gSpeciesNames
adds r1, r0
adds r0, r4, 0
bl StringCopy
@@ -1470,7 +1470,7 @@ _080CB110: .4byte 0x0000ffff
_080CB114: .4byte 0x0000403b
_080CB118: .4byte 0x00004035
_080CB11C: .4byte gStringVar1
-_080CB120: .4byte gUnknown_8245EE0
+_080CB120: .4byte gSpeciesNames
thumb_func_end sub_80CB0A8
thumb_func_start sub_80CB124
@@ -3167,7 +3167,7 @@ sub_80CBE00: @ 80CBE00
_080CBE18: .4byte gUnknown_20370DA
_080CBE1C: .4byte gUnknown_3005074
_080CBE20:
- ldr r2, _080CBE4C @ =gUnknown_2036E38
+ ldr r2, _080CBE4C @ =gMapObjects
ldrb r1, [r1]
lsls r0, r1, 3
adds r0, r1
@@ -3191,7 +3191,7 @@ _080CBE48:
pop {r1}
bx r1
.align 2, 0
-_080CBE4C: .4byte gUnknown_2036E38
+_080CBE4C: .4byte gMapObjects
thumb_func_end sub_80CBE00
thumb_func_start sub_80CBE50
@@ -3225,7 +3225,7 @@ sub_80CBE50: @ 80CBE50
bl GetMonData
movs r1, 0xB
muls r0, r1
- ldr r1, _080CBEAC @ =gUnknown_8245EE0
+ ldr r1, _080CBEAC @ =gSpeciesNames
adds r0, r1
adds r1, r6, 0
bl StringCompare
@@ -3236,7 +3236,7 @@ sub_80CBE50: @ 80CBE50
.align 2, 0
_080CBEA4: .4byte gPlayerParty
_080CBEA8: .4byte gStringVar1
-_080CBEAC: .4byte gUnknown_8245EE0
+_080CBEAC: .4byte gSpeciesNames
_080CBEB0:
movs r0, 0x1
_080CBEB2:
@@ -3407,9 +3407,9 @@ ChangeBoxPokemonNickname: @ 80CBFE0
mov r6, r8
push {r6}
sub sp, 0x8
- ldr r0, _080CC050 @ =gUnknown_20370D6
+ ldr r0, _080CC050 @ =gSpecialVar_MonBoxId
ldrb r0, [r0]
- ldr r1, _080CC054 @ =gUnknown_20370D8
+ ldr r1, _080CC054 @ =gSpecialVar_MonBoxPos
ldrb r1, [r1]
bl GetBoxedMonPtr
adds r6, r0, 0
@@ -3453,8 +3453,8 @@ ChangeBoxPokemonNickname: @ 80CBFE0
pop {r0}
bx r0
.align 2, 0
-_080CC050: .4byte gUnknown_20370D6
-_080CC054: .4byte gUnknown_20370D8
+_080CC050: .4byte gSpecialVar_MonBoxId
+_080CC054: .4byte gSpecialVar_MonBoxPos
_080CC058: .4byte gStringVar3
_080CC05C: .4byte gStringVar2
_080CC060: .4byte ChangeBoxPokemonNickname_CB
@@ -3463,9 +3463,9 @@ _080CC060: .4byte ChangeBoxPokemonNickname_CB
thumb_func_start ChangeBoxPokemonNickname_CB
ChangeBoxPokemonNickname_CB: @ 80CC064
push {lr}
- ldr r0, _080CC07C @ =gUnknown_20370D6
+ ldr r0, _080CC07C @ =gSpecialVar_MonBoxId
ldrb r0, [r0]
- ldr r1, _080CC080 @ =gUnknown_20370D8
+ ldr r1, _080CC080 @ =gSpecialVar_MonBoxPos
ldrb r1, [r1]
ldr r2, _080CC084 @ =gStringVar2
bl SetBoxMonNickFromAnyBox
@@ -3473,8 +3473,8 @@ ChangeBoxPokemonNickname_CB: @ 80CC064
pop {r0}
bx r0
.align 2, 0
-_080CC07C: .4byte gUnknown_20370D6
-_080CC080: .4byte gUnknown_20370D8
+_080CC07C: .4byte gSpecialVar_MonBoxId
+_080CC080: .4byte gSpecialVar_MonBoxPos
_080CC084: .4byte gStringVar2
thumb_func_end ChangeBoxPokemonNickname_CB
@@ -3576,7 +3576,7 @@ ChangePokemonNickname_CB: @ 80CC144
adds r0, r1
ldr r2, _080CC16C @ =gStringVar2
movs r1, 0x2
- bl sub_804037C
+ bl SetMonData
bl c2_exit_to_overworld_1_continue_scripts_restart_music
pop {r0}
bx r0
@@ -4619,7 +4619,7 @@ sub_80CC948: @ 80CC948
ldr r1, _080CC96C @ =gPlayerParty
adds r0, r1
movs r1, 0x6
- bl sub_80436F8
+ bl AdjustFriendship
ldr r0, _080CC970 @ =0x00004025
movs r1, 0
bl VarSet
diff --git a/asm/hall_of_fame.s b/asm/hall_of_fame.s
index 0f66e62de..e2cf4c477 100644
--- a/asm/hall_of_fame.s
+++ b/asm/hall_of_fame.s
@@ -429,7 +429,7 @@ Task_Hof_InitTeamSaveData: @ 80F2114
lsls r0, 24
lsrs r0, 24
mov r9, r0
- ldr r7, _080F2140 @ =gUnknown_201C000
+ ldr r7, _080F2140 @ =gDecompressionBuffer
bl sub_8112450
ldr r0, _080F2144 @ =gUnknown_203AB44
ldrb r0, [r0]
@@ -442,11 +442,11 @@ Task_Hof_InitTeamSaveData: @ 80F2114
bl memset
b _080F2162
.align 2, 0
-_080F2140: .4byte gUnknown_201C000
+_080F2140: .4byte gDecompressionBuffer
_080F2144: .4byte gUnknown_203AB44
_080F2148:
movs r0, 0x3
- bl sub_80DA4FC
+ bl Save_LoadGameData
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -483,7 +483,7 @@ _080F218C:
cmp r5, 0x31
bls _080F21B2
_080F2190:
- ldr r4, _080F220C @ =gUnknown_201C000
+ ldr r4, _080F220C @ =gDecompressionBuffer
adds r6, r4, 0
adds r4, 0x78
movs r5, 0
@@ -541,7 +541,7 @@ _080F21B2:
bx r0
.align 2, 0
_080F2208: .4byte 0x000001ff
-_080F220C: .4byte gUnknown_201C000
+_080F220C: .4byte gDecompressionBuffer
_080F2210: .4byte gUnknown_203AB38
_080F2214: .4byte gUnknown_8419F54
_080F2218: .4byte gTasks
@@ -554,7 +554,7 @@ sub_80F2220: @ 80F2220
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
- ldr r1, _080F2254 @ =gUnknown_30053A4
+ ldr r1, _080F2254 @ =gGameContinueCallback
ldr r0, _080F2258 @ =CB2_DoHallOfFameScreenDontSaveData
str r0, [r1]
movs r0, 0x3
@@ -574,7 +574,7 @@ sub_80F2220: @ 80F2220
pop {r0}
bx r0
.align 2, 0
-_080F2254: .4byte gUnknown_30053A4
+_080F2254: .4byte gGameContinueCallback
_080F2258: .4byte CB2_DoHallOfFameScreenDontSaveData
_080F225C: .4byte gTasks
_080F2260: .4byte sub_80F2264
@@ -1609,7 +1609,7 @@ sub_80F2AA4: @ 80F2AA4
movs r3, 0xC
bl sub_810F558
movs r0, 0x3
- bl sub_80DA4FC
+ bl Save_LoadGameData
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@@ -1626,7 +1626,7 @@ _080F2AD8: .4byte 0x00000226
_080F2ADC: .4byte gTasks
_080F2AE0: .4byte sub_80F30A4
_080F2AE4:
- ldr r0, _080F2B2C @ =gUnknown_201C000
+ ldr r0, _080F2B2C @ =gDecompressionBuffer
ldr r4, _080F2B30 @ =gUnknown_203AB38
ldr r1, [r4]
movs r2, 0x80
@@ -1663,7 +1663,7 @@ _080F2B1A:
subs r0, r2, 0x1
b _080F2B46
.align 2, 0
-_080F2B2C: .4byte gUnknown_201C000
+_080F2B2C: .4byte gDecompressionBuffer
_080F2B30: .4byte gUnknown_203AB38
_080F2B34: .4byte 0x000001ff
_080F2B38: .4byte gTasks
@@ -2624,7 +2624,7 @@ _080F32C4:
lsrs r1, 23
movs r2, 0xB
muls r1, r2
- ldr r2, _080F3324 @ =gUnknown_8245EE0
+ ldr r2, _080F3324 @ =gSpeciesNames
adds r1, r2
bl StringCopy
adds r6, r0, 0
@@ -2641,7 +2641,7 @@ _080F3318:
.align 2, 0
_080F331C: .4byte gUnknown_840C23C
_080F3320: .4byte 0x000001ff
-_080F3324: .4byte gUnknown_8245EE0
+_080F3324: .4byte gSpeciesNames
_080F3328:
lsls r0, r1, 23
lsrs r0, 23
diff --git a/asm/help_system.s b/asm/help_system.s
index 21ae494aa..b0d5c5f34 100644
--- a/asm/help_system.s
+++ b/asm/help_system.s
@@ -463,7 +463,7 @@ _0813BC58: .4byte gUnknown_203F18A
thumb_func_start sub_813BC5C
sub_813BC5C: @ 813BC5C
push {lr}
- ldr r0, _0813BC70 @ =gUnknown_201C000
+ ldr r0, _0813BC70 @ =gDecompressionBuffer
ldr r1, _0813BC74 @ =0x0600c000
movs r2, 0x80
lsls r2, 7
@@ -472,7 +472,7 @@ sub_813BC5C: @ 813BC5C
pop {r0}
bx r0
.align 2, 0
-_0813BC70: .4byte gUnknown_201C000
+_0813BC70: .4byte gDecompressionBuffer
_0813BC74: .4byte 0x0600c000
thumb_func_end sub_813BC5C
@@ -1586,7 +1586,7 @@ sub_813C4CC: @ 813C4CC
movs r1, 0xF
movs r2, 0x2
bl GenerateFontHalfRowLookupTable
- ldr r1, _0813C508 @ =gUnknown_201C000
+ ldr r1, _0813C508 @ =gDecompressionBuffer
str r4, [sp]
movs r0, 0x1A
str r0, [sp, 0x4]
@@ -1601,7 +1601,7 @@ sub_813C4CC: @ 813C4CC
pop {r0}
bx r0
.align 2, 0
-_0813C508: .4byte gUnknown_201C000
+_0813C508: .4byte gDecompressionBuffer
thumb_func_end sub_813C4CC
thumb_func_start sub_813C50C
@@ -1617,7 +1617,7 @@ sub_813C50C: @ 813C50C
ldr r2, _0813C578 @ =0x0000eeee
adds r0, r2, 0
strh r0, [r1]
- ldr r4, _0813C57C @ =gUnknown_201C000
+ ldr r4, _0813C57C @ =gDecompressionBuffer
ldr r2, _0813C580 @ =0x01001a00
adds r0, r1, 0
adds r1, r4, 0
@@ -1658,7 +1658,7 @@ sub_813C50C: @ 813C50C
bx r0
.align 2, 0
_0813C578: .4byte 0x0000eeee
-_0813C57C: .4byte gUnknown_201C000
+_0813C57C: .4byte gDecompressionBuffer
_0813C580: .4byte 0x01001a00
thumb_func_end sub_813C50C
@@ -1751,7 +1751,7 @@ sub_813C624: @ 813C624
ldr r2, _0813C640 @ =0x0000ffff
adds r0, r2, 0
strh r0, [r1]
- ldr r1, _0813C644 @ =gUnknown_201C000
+ ldr r1, _0813C644 @ =gDecompressionBuffer
ldr r2, _0813C648 @ =0x01001a00
mov r0, sp
bl CpuSet
@@ -1760,7 +1760,7 @@ sub_813C624: @ 813C624
bx r0
.align 2, 0
_0813C640: .4byte 0x0000ffff
-_0813C644: .4byte gUnknown_201C000
+_0813C644: .4byte gDecompressionBuffer
_0813C648: .4byte 0x01001a00
thumb_func_end sub_813C624
diff --git a/asm/help_system_812B1E0.s b/asm/help_system_812B1E0.s
index ee485cc71..b95ad8666 100644
--- a/asm/help_system_812B1E0.s
+++ b/asm/help_system_812B1E0.s
@@ -321,7 +321,7 @@ sub_812B40C: @ 812B40C
ldrb r0, [r0]
cmp r0, 0x1
beq _0812B42E
- ldr r0, _0812B438 @ =gUnknown_30053A0
+ ldr r0, _0812B438 @ =gSaveFileStatus
ldrh r0, [r0]
cmp r0, 0
beq _0812B440
@@ -337,7 +337,7 @@ _0812B42E:
b _0812B44E
.align 2, 0
_0812B434: .4byte gUnknown_203B0EE
-_0812B438: .4byte gUnknown_30053A0
+_0812B438: .4byte gSaveFileStatus
_0812B43C: .4byte 0x0000083c
_0812B440:
ldr r0, _0812B454 @ =0x0000083c
diff --git a/asm/intro.s b/asm/intro.s
index 2d8a626b4..62951aa55 100644
--- a/asm/intro.s
+++ b/asm/intro.s
@@ -306,10 +306,10 @@ c2_copyright_1: @ 80EC820
cmp r0, 0
bne _080EC858
bl sub_8054A28
- bl ResetSaveCounters
+ bl Save_ResetSaveCounters
movs r0, 0
- bl sub_80DA4FC
- ldr r0, _080EC85C @ =gUnknown_30053A0
+ bl Save_LoadGameData
+ ldr r0, _080EC85C @ =gSaveFileStatus
ldrh r0, [r0]
cmp r0, 0
beq _080EC846
@@ -328,7 +328,7 @@ _080EC858:
pop {r0}
bx r0
.align 2, 0
-_080EC85C: .4byte gUnknown_30053A0
+_080EC85C: .4byte gSaveFileStatus
_080EC860: .4byte gSaveBlock2Ptr
thumb_func_end c2_copyright_1
diff --git a/asm/item.s b/asm/item.s
index b5d30b995..08df51656 100644
--- a/asm/item.s
+++ b/asm/item.s
@@ -81,7 +81,7 @@ _08099E04:
adds r0, 0x2
mov r1, r8
str r2, [sp]
- bl sub_804C56C
+ bl ApplyNewEncryptionKeyToHword
adds r6, 0x1
ldr r2, [sp]
ldrb r4, [r4, 0x4]
diff --git a/asm/item_menu.s b/asm/item_menu.s
index 07fefddfe..15e3a352d 100644
--- a/asm/item_menu.s
+++ b/asm/item_menu.s
@@ -6629,7 +6629,7 @@ _0810B396:
cmp r0, 0x1
bne _0810B3B8
bl FreeRestoreBattleData
- bl sub_804C230
+ bl LoadPlayerParty
b _0810B4B6
.align 2, 0
_0810B3B0: .4byte gTasks+0x8
@@ -6791,7 +6791,7 @@ sub_810B4BC: @ 810B4BC
cmp r0, 0x1
bne _0810B50C
bl FreeRestoreBattleData
- bl sub_804C230
+ bl LoadPlayerParty
b _0810B5C6
.align 2, 0
_0810B504: .4byte gTasks+0x8
diff --git a/asm/item_use.s b/asm/item_use.s
index 7a2b12d90..26e7edd87 100644
--- a/asm/item_use.s
+++ b/asm/item_use.s
@@ -743,7 +743,7 @@ _080A1578:
movs r1, 0x11
adds r2, r4, 0
movs r3, 0
- bl ExecuteTableBasedItemEffect_
+ bl ExecuteTableBasedItemEffect
lsls r0, 24
cmp r0, 0
bne _080A1592
@@ -1886,7 +1886,7 @@ sub_80A1E7C: @ 80A1E7C
lsls r0, 24
lsrs r4, r0, 24
ldr r1, _080A1EBC @ =gBattlerPartyIndexes
- ldr r0, _080A1EC0 @ =gUnknown_2024004
+ ldr r0, _080A1EC0 @ =gBattlerInMenuId
ldrb r0, [r0]
lsls r0, 1
adds r0, r1
@@ -1900,7 +1900,7 @@ sub_80A1E7C: @ 80A1E7C
lsls r2, 24
lsrs r2, 24
movs r3, 0
- bl ExecuteTableBasedItemEffect_
+ bl ExecuteTableBasedItemEffect
lsls r0, 24
lsrs r2, r0, 24
cmp r2, 0
@@ -1913,7 +1913,7 @@ sub_80A1E7C: @ 80A1E7C
b _080A1EE4
.align 2, 0
_080A1EBC: .4byte gBattlerPartyIndexes
-_080A1EC0: .4byte gUnknown_2024004
+_080A1EC0: .4byte gBattlerInMenuId
_080A1EC4: .4byte gPlayerParty
_080A1EC8: .4byte gUnknown_203AD30
_080A1ECC: .4byte gUnknown_84169DC
diff --git a/asm/learn_move.s b/asm/learn_move.s
index eba23b712..743067bfe 100644
--- a/asm/learn_move.s
+++ b/asm/learn_move.s
@@ -744,7 +744,7 @@ _080E4C7E:
lsls r2, 2
adds r1, r5, r2
ldrb r1, [r1]
- ldr r2, _080E4CDC @ =gUnknown_2024029
+ ldr r2, _080E4CDC @ =gPlayerPartyCount
ldrb r2, [r2]
subs r2, 0x1
lsls r2, 24
@@ -768,7 +768,7 @@ _080E4CCC: .4byte 0x00000263
_080E4CD0: .4byte 0x00000a68
_080E4CD4: .4byte 0x00000a6a
_080E4CD8: .4byte gPlayerParty
-_080E4CDC: .4byte gUnknown_2024029
+_080E4CDC: .4byte gPlayerPartyCount
_080E4CE0: .4byte sub_80E4800
_080E4CE4:
ldr r1, [r7]
diff --git a/asm/link.s b/asm/link.s
index 0849f6590..586ee46a8 100644
--- a/asm/link.s
+++ b/asm/link.s
@@ -1033,7 +1033,7 @@ _08009CC0:
mov r10, r7
cmp r1, r0
bls _08009D10
- ldr r0, _08009D08 @ =gUnknown_201C000
+ ldr r0, _08009D08 @ =gDecompressionBuffer
mov r8, r0
movs r2, 0
adds r5, r3, 0
@@ -1058,7 +1058,7 @@ _08009CE4:
b _08009D40
.align 2, 0
_08009D04: .4byte gUnknown_3000E18
-_08009D08: .4byte gUnknown_201C000
+_08009D08: .4byte gDecompressionBuffer
_08009D0C: .4byte gUnknown_3003ED0
_08009D10:
movs r2, 0
@@ -1112,7 +1112,7 @@ _08009D40:
lsls r0, r6, 3
subs r0, r6
lsls r0, 2
- ldr r1, _08009DD0 @ =gUnknown_202273C
+ ldr r1, _08009DD0 @ =gLinkPlayers
adds r2, r0, r1
adds r1, r2, 0
mov r0, r8
@@ -1155,7 +1155,7 @@ _08009DBC:
_08009DC4: .4byte gUnknown_2022118
_08009DC8: .4byte gUnknown_3003ED0
_08009DCC: .4byte gUnknown_3003EB8
-_08009DD0: .4byte gUnknown_202273C
+_08009DD0: .4byte gLinkPlayers
_08009DD4: .4byte gUnknown_82345C0
_08009DD8: .4byte c2_800ACD4
_08009DDC:
@@ -1599,12 +1599,12 @@ _0800A100:
bl sub_80098B8
_0800A112:
movs r6, 0
- ldr r4, _0800A120 @ =gUnknown_202273C
+ ldr r4, _0800A120 @ =gLinkPlayers
movs r5, 0
b _0800A138
.align 2, 0
_0800A11C: .4byte gUnknown_3003EAC
-_0800A120: .4byte gUnknown_202273C
+_0800A120: .4byte gLinkPlayers
_0800A124:
adds r0, r4, 0
adds r0, 0x14
@@ -1628,7 +1628,7 @@ _0800A138:
lsrs r0, 24
cmp r7, r0
bne _0800A1B8
- ldr r0, _0800A170 @ =gUnknown_202273C
+ ldr r0, _0800A170 @ =gLinkPlayers
ldr r1, [r0, 0x14]
ldr r0, _0800A174 @ =0x00001133
cmp r1, r0
@@ -1643,7 +1643,7 @@ _0800A138:
ldr r2, _0800A178 @ =gUnknown_3000E54
b _0800A1E0
.align 2, 0
-_0800A170: .4byte gUnknown_202273C
+_0800A170: .4byte gLinkPlayers
_0800A174: .4byte 0x00001133
_0800A178: .4byte gUnknown_3000E54
_0800A17C:
@@ -1715,10 +1715,10 @@ IsLinkPlayerDataExchangeComplete: @ 800A1F0
push {r4-r6,lr}
movs r6, 0
movs r4, 0
- ldr r5, _0800A1FC @ =gUnknown_202273C
+ ldr r5, _0800A1FC @ =gLinkPlayers
b _0800A220
.align 2, 0
-_0800A1FC: .4byte gUnknown_202273C
+_0800A1FC: .4byte gLinkPlayers
_0800A200:
lsls r0, r4, 3
subs r0, r4
@@ -1772,7 +1772,7 @@ _0800A254: .4byte gUnknown_3000E54
GetLinkPlayerTrainerId: @ 800A258
lsls r0, 24
lsrs r0, 24
- ldr r2, _0800A26C @ =gUnknown_202273C
+ ldr r2, _0800A26C @ =gLinkPlayers
lsls r1, r0, 3
subs r1, r0
lsls r1, 2
@@ -1781,13 +1781,13 @@ GetLinkPlayerTrainerId: @ 800A258
ldr r0, [r1]
bx lr
.align 2, 0
-_0800A26C: .4byte gUnknown_202273C
+_0800A26C: .4byte gLinkPlayers
thumb_func_end GetLinkPlayerTrainerId
thumb_func_start sub_800A270
sub_800A270: @ 800A270
push {r4,r5,lr}
- ldr r5, _0800A290 @ =gUnknown_202273C
+ ldr r5, _0800A290 @ =gLinkPlayers
movs r4, 0x4
_0800A276:
adds r0, r5, 0
@@ -1802,7 +1802,7 @@ _0800A276:
pop {r0}
bx r0
.align 2, 0
-_0800A290: .4byte gUnknown_202273C
+_0800A290: .4byte gLinkPlayers
thumb_func_end sub_800A270
thumb_func_start ResetBlockSend
@@ -2706,7 +2706,7 @@ sub_800A900: @ 800A900
bl GetMultiplayerId
ldr r1, _0800A938 @ =gUnknown_3003F60
strb r0, [r1]
- ldr r4, _0800A93C @ =gUnknown_202273C
+ ldr r4, _0800A93C @ =gLinkPlayers
ldr r3, _0800A940 @ =gUnknown_20227C8
movs r2, 0x4
_0800A914:
@@ -2729,7 +2729,7 @@ _0800A914:
.align 2, 0
_0800A934: .4byte gUnknown_3003F40
_0800A938: .4byte gUnknown_3003F60
-_0800A93C: .4byte gUnknown_202273C
+_0800A93C: .4byte gLinkPlayers
_0800A940: .4byte gUnknown_20227C8
thumb_func_end sub_800A900
@@ -2760,7 +2760,7 @@ sub_800A95C: @ 800A95C
adds r6, r0, 0
cmp r5, r2
bge _0800A986
- ldr r1, _0800A994 @ =gUnknown_202273C
+ ldr r1, _0800A994 @ =gLinkPlayers
ldr r0, _0800A998 @ =gUnknown_20227C8
adds r4, r0, 0x4
adds r3, r1, 0x4
@@ -2784,7 +2784,7 @@ _0800A986:
b _0800A99E
.align 2, 0
_0800A990: .4byte gUnknown_3003F40
-_0800A994: .4byte gUnknown_202273C
+_0800A994: .4byte gLinkPlayers
_0800A998: .4byte gUnknown_20227C8
_0800A99C:
movs r0, 0x1
@@ -2805,7 +2805,7 @@ sub_800A9A4: @ 800A9A4
cmp r4, r0
bcs _0800AA04
ldr r6, _0800AA14 @ =gUnknown_20227C8
- ldr r5, _0800AA18 @ =gUnknown_202273C
+ ldr r5, _0800AA18 @ =gLinkPlayers
movs r0, 0x8
adds r0, r6
mov r8, r0
@@ -2853,7 +2853,7 @@ _0800AA04:
.align 2, 0
_0800AA10: .4byte gUnknown_3003F40
_0800AA14: .4byte gUnknown_20227C8
-_0800AA18: .4byte gUnknown_202273C
+_0800AA18: .4byte gLinkPlayers
_0800AA1C: .4byte gUnknown_3003EAC
_0800AA20: .4byte c2_800ACD4
thumb_func_end sub_800A9A4
@@ -3731,7 +3731,7 @@ sub_800B110: @ 800B110
lsls r2, r0, 3
subs r2, r0
lsls r2, 2
- ldr r0, _0800B16C @ =gUnknown_202273C
+ ldr r0, _0800B16C @ =gLinkPlayers
adds r2, r0
adds r1, r2, 0
adds r0, r4, 0
@@ -3765,7 +3765,7 @@ _0800B160:
bx r0
.align 2, 0
_0800B168: .4byte gUnknown_2022118
-_0800B16C: .4byte gUnknown_202273C
+_0800B16C: .4byte gLinkPlayers
_0800B170: .4byte gUnknown_82345C0
_0800B174: .4byte c2_800ACD4
thumb_func_end sub_800B110
diff --git a/asm/link_rfu_2.s b/asm/link_rfu_2.s
index 9ae197c87..b606854a3 100644
--- a/asm/link_rfu_2.s
+++ b/asm/link_rfu_2.s
@@ -82,7 +82,7 @@ _080F863E:
bl CpuSet
mov r0, r9
strh r5, [r0]
- ldr r1, _080F86BC @ =gUnknown_202273C
+ ldr r1, _080F86BC @ =gLinkPlayers
ldr r2, _080F86C0 @ =0x01000046
bl CpuSet
add sp, 0x8
@@ -101,7 +101,7 @@ _080F86AC: .4byte gUnknown_3003F50
_080F86B0: .4byte 0x01000008
_080F86B4: .4byte gUnknown_3003ED0
_080F86B8: .4byte 0x01000028
-_080F86BC: .4byte gUnknown_202273C
+_080F86BC: .4byte gLinkPlayers
_080F86C0: .4byte 0x01000046
thumb_func_end sub_80F85F8
@@ -4706,7 +4706,7 @@ _080FAA10:
cmp r4, 0x3
ble _080FAA10
adds r6, r2, 0
- ldr r5, _080FAA54 @ =gUnknown_202273C
+ ldr r5, _080FAA54 @ =gLinkPlayers
movs r4, 0x4
_080FAA24:
adds r0, r5, 0
@@ -4731,7 +4731,7 @@ _080FAA24:
.align 2, 0
_080FAA4C: .4byte gUnknown_3005450
_080FAA50: .4byte 0x00000996
-_080FAA54: .4byte gUnknown_202273C
+_080FAA54: .4byte gLinkPlayers
thumb_func_end sub_80FA9FC
thumb_func_start sub_80FAA58
@@ -4874,7 +4874,7 @@ _080FAB70:
lsls r2, r4, 8
ldr r0, _080FAB9C @ =gUnknown_2022118
adds r2, r0
- ldr r1, _080FABA0 @ =gUnknown_202273C
+ ldr r1, _080FABA0 @ =gLinkPlayers
lsls r0, r4, 3
subs r0, r4
lsls r0, 2
@@ -4891,7 +4891,7 @@ _080FAB70:
b _080FAC2E
.align 2, 0
_080FAB9C: .4byte gUnknown_2022118
-_080FABA0: .4byte gUnknown_202273C
+_080FABA0: .4byte gLinkPlayers
_080FABA4:
ldr r5, _080FAC40 @ =gUnknown_2022618
adds r1, r5, 0
@@ -4918,7 +4918,7 @@ _080FABC6:
adds r2, 0x1
cmp r2, 0x3
ble _080FABC6
- ldr r1, _080FAC50 @ =gUnknown_202273C
+ ldr r1, _080FAC50 @ =gLinkPlayers
adds r0, r5, 0
adds r0, 0x14
movs r2, 0x8C
@@ -4936,7 +4936,7 @@ _080FABEE:
ldrb r0, [r1, 0xD]
strb r0, [r5, 0xF]
movs r2, 0
- ldr r3, _080FAC50 @ =gUnknown_202273C
+ ldr r3, _080FAC50 @ =gLinkPlayers
mov r12, r3
adds r4, r5, 0
adds r4, 0x10
@@ -4977,7 +4977,7 @@ _080FAC40: .4byte gUnknown_2022618
_080FAC44: .4byte gUnknown_843EDE4
_080FAC48: .4byte gUnknown_3005450
_080FAC4C: .4byte 0x00000996
-_080FAC50: .4byte gUnknown_202273C
+_080FAC50: .4byte gLinkPlayers
_080FAC54: .4byte gTasks
_080FAC58:
adds r0, r3, 0
@@ -5512,7 +5512,7 @@ sub_80FB030: @ 80FB030
mov r8, r1
movs r4, 0
movs r6, 0x1
- ldr r2, _080FB0E0 @ =gUnknown_202273C
+ ldr r2, _080FB0E0 @ =gLinkPlayers
mov r12, r2
ldr r0, _080FB0E4 @ =0x00000996
adds r0, r3
@@ -5573,7 +5573,7 @@ _080FB0C4:
_080FB0D4: .4byte gUnknown_3005450
_080FB0D8: .4byte 0x0000099a
_080FB0DC: .4byte 0x0000099b
-_080FB0E0: .4byte gUnknown_202273C
+_080FB0E0: .4byte gLinkPlayers
_080FB0E4: .4byte 0x00000996
thumb_func_end sub_80FB030
@@ -10016,7 +10016,7 @@ _080FD258:
lsrs r0, 24
cmp r4, r0
beq _080FD29E
- ldr r2, _080FD328 @ =gUnknown_202273C
+ ldr r2, _080FD328 @ =gLinkPlayers
adds r0, r5, r2
ldrh r0, [r0, 0x1A]
cmp r0, 0x1
@@ -10115,7 +10115,7 @@ _080FD318:
pop {r0}
bx r0
.align 2, 0
-_080FD328: .4byte gUnknown_202273C
+_080FD328: .4byte gLinkPlayers
_080FD32C: .4byte 0x00003bac
_080FD330: .4byte gSaveBlock1Ptr
_080FD334: .4byte 0x00003ba8
diff --git a/asm/link_rfu_3.s b/asm/link_rfu_3.s
index f4e12b60f..c564cd83c 100644
--- a/asm/link_rfu_3.s
+++ b/asm/link_rfu_3.s
@@ -3157,12 +3157,12 @@ _081172C0:
ldr r0, _081172E0 @ =gUnknown_2039624
adds r7, r0, 0
adds r7, 0x38
- ldr r6, _081172E4 @ =gUnknown_202273C
+ ldr r6, _081172E4 @ =gLinkPlayers
adds r5, r0, 0
b _08117302
.align 2, 0
_081172E0: .4byte gUnknown_2039624
-_081172E4: .4byte gUnknown_202273C
+_081172E4: .4byte gLinkPlayers
_081172E8:
lsls r0, r4, 8
ldr r1, _08117338 @ =gUnknown_2022118
@@ -3273,9 +3273,9 @@ sub_81173C0: @ 81173C0
lsls r6, 16
lsrs r6, 16
bl sp000_heal_pokemon
- bl copy_player_party_to_sav1
- bl copy_bags_and_unk_data_from_save_blocks
- ldr r5, _0811742C @ =gUnknown_202273C
+ bl SavePlayerParty
+ bl LoadPlayerBag
+ ldr r5, _0811742C @ =gLinkPlayers
ldr r0, _08117430 @ =0x00002211
str r0, [r5, 0x14]
bl GetMultiplayerId
@@ -3315,7 +3315,7 @@ sub_81173C0: @ 81173C0
pop {r0}
bx r0
.align 2, 0
-_0811742C: .4byte gUnknown_202273C
+_0811742C: .4byte gLinkPlayers
_08117430: .4byte 0x00002211
_08117434: .4byte gMain
_08117438: .4byte sub_8081668
@@ -3661,8 +3661,8 @@ _081177A0:
movs r1, 0x1
bl sub_8117594
bl sp000_heal_pokemon
- bl copy_player_party_to_sav1
- bl copy_bags_and_unk_data_from_save_blocks
+ bl SavePlayerParty
+ bl LoadPlayerBag
movs r0, 0x1
str r0, [sp]
movs r0, 0
@@ -3674,8 +3674,8 @@ _081177C4: .4byte gUnknown_2022618
_081177C8:
bl sub_80563F0
bl sp000_heal_pokemon
- bl copy_player_party_to_sav1
- bl copy_bags_and_unk_data_from_save_blocks
+ bl SavePlayerParty
+ bl LoadPlayerBag
ldr r0, _081177EC @ =gUnknown_2022618
movs r1, 0x1
bl sub_8117594
@@ -3690,8 +3690,8 @@ _081177EC: .4byte gUnknown_2022618
_081177F0:
bl sub_80563F0
bl sp000_heal_pokemon
- bl copy_player_party_to_sav1
- bl copy_bags_and_unk_data_from_save_blocks
+ bl SavePlayerParty
+ bl LoadPlayerBag
ldr r0, _08117814 @ =gUnknown_2022618
movs r1, 0x1
bl sub_8117594
@@ -6054,7 +6054,7 @@ _08118CB6:
bl sub_80F9E2C
ldr r0, _08118CDC @ =gStringVar4
ldr r2, _08118CE0 @ =gUnknown_845842C
- ldr r1, _08118CE4 @ =gUnknown_202273C
+ ldr r1, _08118CE4 @ =gLinkPlayers
ldrb r1, [r1, 0x13]
lsls r1, 2
adds r1, r2
@@ -6065,7 +6065,7 @@ _08118CB6:
.align 2, 0
_08118CDC: .4byte gStringVar4
_08118CE0: .4byte gUnknown_845842C
-_08118CE4: .4byte gUnknown_202273C
+_08118CE4: .4byte gLinkPlayers
_08118CE8:
ldr r0, _08118D10 @ =gUnknown_203B058
strb r5, [r0]
@@ -6218,7 +6218,7 @@ _08118E36:
ldrb r2, [r4]
movs r1, 0x40
orrs r1, r2
- ldr r2, _08118E5C @ =gUnknown_202273C
+ ldr r2, _08118E5C @ =gLinkPlayers
ldrb r2, [r2, 0x13]
bl sub_811AE68
strb r5, [r4]
@@ -6226,7 +6226,7 @@ _08118E36:
.align 2, 0
_08118E54: .4byte gStringVar4
_08118E58: .4byte gUnknown_203B058
-_08118E5C: .4byte gUnknown_202273C
+_08118E5C: .4byte gLinkPlayers
_08118E60:
movs r0, 0x2
ldrsh r1, [r7, r0]
@@ -6885,7 +6885,7 @@ _08119414:
lsrs r0, 22
movs r1, 0xB
muls r1, r0
- ldr r0, _08119458 @ =gUnknown_8245EE0
+ ldr r0, _08119458 @ =gSpeciesNames
adds r1, r0
adds r0, r4, 0
bl StringCopy
@@ -6907,7 +6907,7 @@ _0811944A:
b _081198DC
.align 2, 0
_08119454: .4byte gStringVar1
-_08119458: .4byte gUnknown_8245EE0
+_08119458: .4byte gSpeciesNames
_0811945C: .4byte gStringVar2
_08119460: .4byte gStringVar4
_08119464: .4byte gUnknown_8458DBC
@@ -7519,7 +7519,7 @@ sub_8119944: @ 8119944
cmp r0, 0
beq _08119994
ldr r0, _08119978 @ =gStringVar4
- ldr r1, _0811997C @ =gUnknown_202273C
+ ldr r1, _0811997C @ =gLinkPlayers
adds r1, 0x2F
ldrb r1, [r1]
adds r2, r5, 0
@@ -7538,7 +7538,7 @@ sub_8119944: @ 8119944
b _08119996
.align 2, 0
_08119978: .4byte gStringVar4
-_0811997C: .4byte gUnknown_202273C
+_0811997C: .4byte gLinkPlayers
_08119980: .4byte gUnknown_203B058
_08119984:
cmp r0, 0x2
@@ -10003,7 +10003,7 @@ _0811AC3C:
movs r0, 0xB
mov r2, r8
muls r2, r0
- ldr r0, _0811ACA0 @ =gUnknown_8245EE0
+ ldr r0, _0811ACA0 @ =gSpeciesNames
adds r2, r0
str r5, [sp]
str r4, [sp, 0x4]
@@ -10041,7 +10041,7 @@ _0811AC90:
pop {r0}
bx r0
.align 2, 0
-_0811ACA0: .4byte gUnknown_8245EE0
+_0811ACA0: .4byte gSpeciesNames
thumb_func_end sub_811ABE4
thumb_func_start sub_811ACA4
@@ -10227,7 +10227,7 @@ _0811ADE0:
beq _0811AE40
adds r4, 0x1
_0811ADFA:
- ldr r0, _0811AE0C @ =gUnknown_2024029
+ ldr r0, _0811AE0C @ =gPlayerPartyCount
ldrb r0, [r0]
cmp r4, r0
blt _0811ADE0
@@ -10235,10 +10235,10 @@ _0811ADFA:
b _0811AE5C
.align 2, 0
_0811AE08: .4byte gPlayerParty
-_0811AE0C: .4byte gUnknown_2024029
+_0811AE0C: .4byte gPlayerPartyCount
_0811AE10:
movs r4, 0
- ldr r0, _0811AE44 @ =gUnknown_2024029
+ ldr r0, _0811AE44 @ =gPlayerPartyCount
ldrb r0, [r0]
cmp r4, r0
bge _0811AE5A
@@ -10265,12 +10265,12 @@ _0811AE40:
movs r0, 0
b _0811AE5C
.align 2, 0
-_0811AE44: .4byte gUnknown_2024029
+_0811AE44: .4byte gPlayerPartyCount
_0811AE48: .4byte gBaseStats
_0811AE4C: .4byte gPlayerParty
_0811AE50:
adds r4, 0x1
- ldr r0, _0811AE64 @ =gUnknown_2024029
+ ldr r0, _0811AE64 @ =gPlayerPartyCount
ldrb r0, [r0]
cmp r4, r0
blt _0811AE1C
@@ -10281,7 +10281,7 @@ _0811AE5C:
pop {r1}
bx r1
.align 2, 0
-_0811AE64: .4byte gUnknown_2024029
+_0811AE64: .4byte gPlayerPartyCount
thumb_func_end sub_811ADD0
thumb_func_start sub_811AE68
@@ -10349,7 +10349,7 @@ sub_811AECC: @ 811AECC
bl GetMultiplayerId
lsls r0, 24
lsrs r3, r0, 24
- ldr r2, _0811AF00 @ =gUnknown_202273C
+ ldr r2, _0811AF00 @ =gLinkPlayers
movs r0, 0x1
adds r1, r3, 0
eors r1, r0
@@ -10366,7 +10366,7 @@ sub_811AECC: @ 811AECC
beq _0811AF0A
b _0811AF60
.align 2, 0
-_0811AF00: .4byte gUnknown_202273C
+_0811AF00: .4byte gLinkPlayers
_0811AF04:
cmp r6, 0x45
beq _0811AF44
@@ -10480,14 +10480,14 @@ _0811AFC8:
ldrh r2, [r4, 0xA]
movs r1, 0xB
muls r1, r2
- ldr r2, _0811AFF4 @ =gUnknown_8245EE0
+ ldr r2, _0811AFF4 @ =gSpeciesNames
adds r1, r2
bl StringCopy
movs r4, 0
b _0811AFFA
.align 2, 0
_0811AFF0: .4byte gUnknown_203B06C
-_0811AFF4: .4byte gUnknown_8245EE0
+_0811AFF4: .4byte gSpeciesNames
_0811AFF8:
adds r4, 0x1
_0811AFFA:
@@ -10509,7 +10509,7 @@ _0811AFFA:
ldrh r1, [r5, 0x2]
movs r0, 0xB
muls r1, r0
- ldr r0, _0811B048 @ =gUnknown_8245EE0
+ ldr r0, _0811B048 @ =gSpeciesNames
adds r1, r0
adds r0, r6, 0
adds r0, 0x79
@@ -10527,7 +10527,7 @@ _0811B030:
b _0811B080
.align 2, 0
_0811B044: .4byte gUnknown_3007460
-_0811B048: .4byte gUnknown_8245EE0
+_0811B048: .4byte gSpeciesNames
_0811B04C: .4byte gUnknown_8457DB8
_0811B050:
movs r4, 0
@@ -10626,7 +10626,7 @@ sub_811B0F0: @ 811B0F0
push {r4-r6,lr}
movs r6, 0
movs r5, 0
- ldr r0, _0811B138 @ =gUnknown_2024029
+ ldr r0, _0811B138 @ =gPlayerPartyCount
ldrb r0, [r0]
cmp r6, r0
bge _0811B130
@@ -10651,7 +10651,7 @@ _0811B0FE:
adds r6, 0x1
_0811B126:
adds r5, 0x1
- ldr r0, _0811B138 @ =gUnknown_2024029
+ ldr r0, _0811B138 @ =gPlayerPartyCount
ldrb r0, [r0]
cmp r5, r0
blt _0811B0FE
@@ -10661,7 +10661,7 @@ _0811B130:
movs r0, 0
b _0811B142
.align 2, 0
-_0811B138: .4byte gUnknown_2024029
+_0811B138: .4byte gPlayerPartyCount
_0811B13C: .4byte gPlayerParty
_0811B140:
movs r0, 0x1
@@ -10807,7 +10807,7 @@ _0811B212:
_0811B238:
adds r5, 0x1
_0811B23A:
- ldr r0, _0811B254 @ =gUnknown_2024029
+ ldr r0, _0811B254 @ =gPlayerPartyCount
ldrb r0, [r0]
cmp r5, r0
blt _0811B212
@@ -10820,7 +10820,7 @@ _0811B242:
bx r1
.align 2, 0
_0811B250: .4byte gPlayerParty
-_0811B254: .4byte gUnknown_2024029
+_0811B254: .4byte gPlayerPartyCount
thumb_func_end sub_811B1EC
thumb_func_start sub_811B258
@@ -10866,7 +10866,7 @@ sub_811B298: @ 811B298
sub_811B2A8: @ 811B2A8
push {r4,lr}
movs r4, 0x80
- ldr r3, _0811B2D4 @ =gUnknown_202273C
+ ldr r3, _0811B2D4 @ =gLinkPlayers
lsls r1, r0, 3
subs r1, r0
lsls r1, 2
@@ -10886,7 +10886,7 @@ sub_811B2A8: @ 811B2A8
pop {r1}
bx r1
.align 2, 0
-_0811B2D4: .4byte gUnknown_202273C
+_0811B2D4: .4byte gLinkPlayers
thumb_func_end sub_811B2A8
thumb_func_start sub_811B2D8
@@ -10960,7 +10960,7 @@ sub_811B31C: @ 811B31C
lsrs r0, 16
movs r1, 0xD
muls r1, r0
- ldr r0, _0811B4B4 @ =gUnknown_823E558
+ ldr r0, _0811B4B4 @ =gTrainerClassNames
adds r1, r0
adds r0, r6, 0
bl StringCopy
@@ -11109,7 +11109,7 @@ _0811B45E:
b _0811B4F0
.align 2, 0
_0811B4B0: .4byte gUnknown_2039624
-_0811B4B4: .4byte gUnknown_823E558
+_0811B4B4: .4byte gTrainerClassNames
_0811B4B8: .4byte gUnknown_84594B0
_0811B4BC: .4byte gUnknown_84594C4
_0811B4C0: .4byte gStringVar4
@@ -11378,7 +11378,7 @@ sub_811B66C: @ 811B66C
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0811B6C0 @ =gUnknown_2036E38
+ ldr r1, _0811B6C0 @ =gMapObjects
adds r4, r0, r1
adds r0, r4, 0
bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive
@@ -11396,7 +11396,7 @@ sub_811B66C: @ 811B66C
.align 2, 0
_0811B6B8: .4byte gUnknown_8457120
_0811B6BC: .4byte gSaveBlock1Ptr
-_0811B6C0: .4byte gUnknown_2036E38
+_0811B6C0: .4byte gMapObjects
_0811B6C4:
ldr r0, _0811B6DC @ =gUnknown_8457138 "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/rfu_union_tool.c"
ldr r1, _0811B6E0 @ =0x00000183
@@ -11437,7 +11437,7 @@ sub_811B6E8: @ 811B6E8
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0811B72C @ =gUnknown_2036E38
+ ldr r1, _0811B72C @ =gMapObjects
adds r4, r0, r1
adds r0, r4, 0
bl FieldObjectClearAnimIfSpecialAnimFinished
@@ -11449,7 +11449,7 @@ sub_811B6E8: @ 811B6E8
.align 2, 0
_0811B724: .4byte gUnknown_8457120
_0811B728: .4byte gSaveBlock1Ptr
-_0811B72C: .4byte gUnknown_2036E38
+_0811B72C: .4byte gMapObjects
_0811B730:
bl ScriptContext2_IsEnabled
lsls r0, 24
diff --git a/asm/load_save.s b/asm/load_save.s
deleted file mode 100644
index f18414c41..000000000
--- a/asm/load_save.s
+++ /dev/null
@@ -1,814 +0,0 @@
- .include "asm/macros.inc"
- .include "constants/constants.inc"
-
- .syntax unified
-
- .text
-
- thumb_func_start CheckForFlashMemory
-CheckForFlashMemory: @ 804BFE4
- push {lr}
- bl IdentifyFlash
- lsls r0, 16
- cmp r0, 0
- bne _0804C000
- ldr r1, _0804BFFC @ =gUnknown_3005004
- movs r0, 0x1
- str r0, [r1]
- bl InitFlashTimer
- b _0804C006
- .align 2, 0
-_0804BFFC: .4byte gUnknown_3005004
-_0804C000:
- ldr r1, _0804C00C @ =gUnknown_3005004
- movs r0, 0
- str r0, [r1]
-_0804C006:
- pop {r0}
- bx r0
- .align 2, 0
-_0804C00C: .4byte gUnknown_3005004
- thumb_func_end CheckForFlashMemory
-
- thumb_func_start ClearSav2
-ClearSav2: @ 804C010
- push {lr}
- sub sp, 0x4
- mov r1, sp
- movs r0, 0
- strh r0, [r1]
- ldr r1, _0804C02C @ =gSaveBlock2
- ldr r2, _0804C030 @ =0x010007d2
- mov r0, sp
- bl CpuSet
- add sp, 0x4
- pop {r0}
- bx r0
- .align 2, 0
-_0804C02C: .4byte gSaveBlock2
-_0804C030: .4byte 0x010007d2
- thumb_func_end ClearSav2
-
- thumb_func_start ClearSav1
-ClearSav1: @ 804C034
- push {lr}
- sub sp, 0x4
- mov r1, sp
- movs r0, 0
- strh r0, [r1]
- ldr r1, _0804C050 @ =gSaveBlock1
- ldr r2, _0804C054 @ =0x01001ef4
- mov r0, sp
- bl CpuSet
- add sp, 0x4
- pop {r0}
- bx r0
- .align 2, 0
-_0804C050: .4byte gSaveBlock1
-_0804C054: .4byte 0x01001ef4
- thumb_func_end ClearSav1
-
- thumb_func_start SetSaveBlocksPointers
-SetSaveBlocksPointers: @ 804C058
- push {r4,r5,lr}
- ldr r4, _0804C08C @ =gSaveBlock1Ptr
- ldr r5, [r4]
- bl Random
- movs r1, 0x7C
- ands r1, r0
- ldr r2, _0804C090 @ =gSaveBlock2Ptr
- ldr r0, _0804C094 @ =gSaveBlock2
- adds r0, r1, r0
- str r0, [r2]
- ldr r0, _0804C098 @ =gSaveBlock1
- adds r0, r1, r0
- str r0, [r4]
- ldr r2, _0804C09C @ =gUnknown_3005010
- ldr r0, _0804C0A0 @ =gPokemonStorage
- adds r1, r0
- str r1, [r2]
- bl sub_8099E44
- adds r0, r5, 0
- bl sub_8110840
- pop {r4,r5}
- pop {r0}
- bx r0
- .align 2, 0
-_0804C08C: .4byte gSaveBlock1Ptr
-_0804C090: .4byte gSaveBlock2Ptr
-_0804C094: .4byte gSaveBlock2
-_0804C098: .4byte gSaveBlock1
-_0804C09C: .4byte gUnknown_3005010
-_0804C0A0: .4byte gPokemonStorage
- thumb_func_end SetSaveBlocksPointers
-
- thumb_func_start sub_804C0A4
-sub_804C0A4: @ 804C0A4
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x8
- ldr r4, _0804C160 @ =gMain
- ldr r0, [r4, 0xC]
- str r0, [sp]
- ldr r1, [r4, 0x10]
- str r1, [sp, 0x4]
- movs r0, 0
- str r0, [r4, 0xC]
- str r0, [r4, 0x10]
- str r0, [r4, 0x20]
- ldr r5, _0804C164 @ =gHeap
- ldr r0, _0804C168 @ =gSaveBlock2Ptr
- ldr r1, [r0]
- ldr r0, _0804C16C @ =0x00000f24
- mov r9, r0
- adds r0, r5, 0
- mov r2, r9
- bl memcpy
- ldr r1, _0804C170 @ =gSaveBlock1Ptr
- mov r10, r1
- ldr r1, [r1]
- ldr r7, _0804C174 @ =0x00003d68
- ldr r0, _0804C178 @ =gHeap + 0xf24
- adds r2, r7, 0
- bl memcpy
- ldr r6, _0804C17C @ =gUnknown_3005010
- ldr r1, [r6]
- ldr r0, _0804C180 @ =0x000083d0
- mov r8, r0
- ldr r0, _0804C184 @ =gHeap + 0x4c8c
- mov r2, r8
- bl memcpy
- bl SetSaveBlocksPointers
- ldr r1, _0804C168 @ =gSaveBlock2Ptr
- ldr r0, [r1]
- adds r1, r5, 0
- mov r2, r9
- bl memcpy
- mov r1, r10
- ldr r0, [r1]
- ldr r1, _0804C178 @ =gHeap + 0xf24
- adds r2, r7, 0
- bl memcpy
- ldr r0, [r6]
- ldr r1, _0804C184 @ =gHeap + 0x4c8c
- mov r2, r8
- bl memcpy
- movs r1, 0xE0
- lsls r1, 9
- adds r0, r5, 0
- bl InitHeap
- ldr r0, [sp, 0x4]
- str r0, [r4, 0x10]
- ldr r1, [sp]
- str r1, [r4, 0xC]
- bl Random
- adds r4, r0, 0
- bl Random
- lsls r4, 16
- lsls r0, 16
- lsrs r0, 16
- adds r4, r0
- adds r0, r4, 0
- bl sub_804C5A4
- ldr r1, _0804C168 @ =gSaveBlock2Ptr
- ldr r0, [r1]
- movs r1, 0xF2
- lsls r1, 4
- adds r0, r1
- 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
- .align 2, 0
-_0804C160: .4byte gMain
-_0804C164: .4byte gHeap
-_0804C168: .4byte gSaveBlock2Ptr
-_0804C16C: .4byte 0x00000f24
-_0804C170: .4byte gSaveBlock1Ptr
-_0804C174: .4byte 0x00003d68
-_0804C178: .4byte gHeap + 0xf24
-_0804C17C: .4byte gUnknown_3005010
-_0804C180: .4byte 0x000083d0
-_0804C184: .4byte gHeap + 0x4c8c
- thumb_func_end sub_804C0A4
-
- thumb_func_start sav2_x1_query_bit1
-sav2_x1_query_bit1: @ 804C188
- ldr r0, _0804C194 @ =gSaveBlock2Ptr
- ldr r0, [r0]
- ldrb r1, [r0, 0x9]
- movs r0, 0x1
- ands r0, r1
- bx lr
- .align 2, 0
-_0804C194: .4byte gSaveBlock2Ptr
- thumb_func_end sav2_x1_query_bit1
-
- thumb_func_start sav2_x9_clear_bit1
-sav2_x9_clear_bit1: @ 804C198
- ldr r0, _0804C1A8 @ =gSaveBlock2Ptr
- ldr r2, [r0]
- ldrb r1, [r2, 0x9]
- movs r0, 0xFE
- ands r0, r1
- strb r0, [r2, 0x9]
- bx lr
- .align 2, 0
-_0804C1A8: .4byte gSaveBlock2Ptr
- thumb_func_end sav2_x9_clear_bit1
-
- thumb_func_start sub_804C1AC
-sub_804C1AC: @ 804C1AC
- ldr r0, _0804C1BC @ =gSaveBlock2Ptr
- ldr r2, [r0]
- ldrb r1, [r2, 0x9]
- movs r0, 0x1
- orrs r0, r1
- strb r0, [r2, 0x9]
- bx lr
- .align 2, 0
-_0804C1BC: .4byte gSaveBlock2Ptr
- thumb_func_end sub_804C1AC
-
- thumb_func_start sub_804C1C0
-sub_804C1C0: @ 804C1C0
- push {lr}
- movs r0, 0
- bl sub_8055778
- ldr r0, _0804C1D8 @ =gSaveBlock2Ptr
- ldr r2, [r0]
- ldrb r1, [r2, 0x9]
- movs r0, 0x1
- orrs r0, r1
- strb r0, [r2, 0x9]
- pop {r0}
- bx r0
- .align 2, 0
-_0804C1D8: .4byte gSaveBlock2Ptr
- thumb_func_end sub_804C1C0
-
- thumb_func_start sav2_gender2_inplace_and_xFE
-sav2_gender2_inplace_and_xFE: @ 804C1DC
- ldr r0, _0804C1EC @ =gSaveBlock2Ptr
- ldr r2, [r0]
- ldrb r1, [r2, 0x9]
- movs r0, 0xFE
- ands r0, r1
- strb r0, [r2, 0x9]
- bx lr
- .align 2, 0
-_0804C1EC: .4byte gSaveBlock2Ptr
- thumb_func_end sav2_gender2_inplace_and_xFE
-
- thumb_func_start copy_player_party_to_sav1
-copy_player_party_to_sav1: @ 804C1F0
- push {r4,lr}
- ldr r0, _0804C224 @ =gSaveBlock1Ptr
- ldr r0, [r0]
- ldr r1, _0804C228 @ =gUnknown_2024029
- ldrb r1, [r1]
- adds r0, 0x34
- strb r1, [r0]
- movs r4, 0
-_0804C200:
- ldr r0, _0804C224 @ =gSaveBlock1Ptr
- ldr r0, [r0]
- movs r1, 0x64
- muls r1, r4
- adds r0, r1
- ldr r2, _0804C22C @ =gPlayerParty
- adds r1, r2
- adds r0, 0x38
- movs r2, 0x64
- bl memcpy
- adds r4, 0x1
- cmp r4, 0x5
- ble _0804C200
- pop {r4}
- pop {r0}
- bx r0
- .align 2, 0
-_0804C224: .4byte gSaveBlock1Ptr
-_0804C228: .4byte gUnknown_2024029
-_0804C22C: .4byte gPlayerParty
- thumb_func_end copy_player_party_to_sav1
-
- thumb_func_start sub_804C230
-sub_804C230: @ 804C230
- push {r4,r5,lr}
- ldr r1, _0804C264 @ =gUnknown_2024029
- ldr r0, _0804C268 @ =gSaveBlock1Ptr
- ldr r0, [r0]
- adds r0, 0x34
- ldrb r0, [r0]
- strb r0, [r1]
- movs r4, 0
- ldr r5, _0804C26C @ =gPlayerParty
-_0804C242:
- movs r0, 0x64
- adds r2, r4, 0
- muls r2, r0
- adds r0, r2, r5
- ldr r1, _0804C268 @ =gSaveBlock1Ptr
- ldr r1, [r1]
- adds r1, r2
- adds r1, 0x38
- movs r2, 0x64
- bl memcpy
- adds r4, 0x1
- cmp r4, 0x5
- ble _0804C242
- pop {r4,r5}
- pop {r0}
- bx r0
- .align 2, 0
-_0804C264: .4byte gUnknown_2024029
-_0804C268: .4byte gSaveBlock1Ptr
-_0804C26C: .4byte gPlayerParty
- thumb_func_end sub_804C230
-
- thumb_func_start save_serialize_npcs
-save_serialize_npcs: @ 804C270
- push {r4-r7,lr}
- mov r7, r8
- push {r7}
- ldr r0, _0804C2B0 @ =gSaveBlock1Ptr
- mov r12, r0
- movs r5, 0xD4
- lsls r5, 3
- mov r8, r5
- ldr r4, _0804C2B4 @ =gUnknown_2036E38
- movs r3, 0
- movs r2, 0xF
-_0804C286:
- 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 _0804C286
- pop {r3}
- mov r8, r3
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_0804C2B0: .4byte gSaveBlock1Ptr
-_0804C2B4: .4byte gUnknown_2036E38
- thumb_func_end save_serialize_npcs
-
- thumb_func_start sub_804C2B8
-sub_804C2B8: @ 804C2B8
- push {r4-r7,lr}
- mov r7, r8
- push {r7}
- ldr r0, _0804C2F8 @ =gSaveBlock1Ptr
- mov r12, r0
- movs r5, 0xD4
- lsls r5, 3
- mov r8, r5
- ldr r4, _0804C2FC @ =gUnknown_2036E38
- movs r3, 0
- movs r2, 0xF
-_0804C2CE:
- 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 _0804C2CE
- pop {r3}
- mov r8, r3
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_0804C2F8: .4byte gSaveBlock1Ptr
-_0804C2FC: .4byte gUnknown_2036E38
- thumb_func_end sub_804C2B8
-
- thumb_func_start SaveSerializedGame
-SaveSerializedGame: @ 804C300
- push {lr}
- bl copy_player_party_to_sav1
- bl save_serialize_npcs
- pop {r0}
- bx r0
- thumb_func_end SaveSerializedGame
-
- thumb_func_start LoadSerializedGame
-LoadSerializedGame: @ 804C310
- push {lr}
- bl sub_804C230
- bl sub_804C2B8
- pop {r0}
- bx r0
- thumb_func_end LoadSerializedGame
-
- thumb_func_start copy_bags_and_unk_data_from_save_blocks
-copy_bags_and_unk_data_from_save_blocks: @ 804C320
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- movs r2, 0
- ldr r0, _0804C424 @ =gUnknown_2031C8C
- mov r12, r0
- ldr r1, _0804C428 @ =gSaveBlock2Ptr
- mov r10, r1
- ldr r5, _0804C42C @ =gSaveBlock1Ptr
- movs r3, 0xC4
- lsls r3, 2
- ldr r4, _0804C430 @ =gUnknown_2031764
-_0804C33C:
- lsls r0, r2, 2
- ldr r1, [r5]
- adds r1, r3
- adds r1, r0
- ldr r0, [r1]
- stm r4!, {r0}
- adds r2, 0x1
- cmp r2, 0x29
- ble _0804C33C
- movs r2, 0
- ldr r0, _0804C430 @ =gUnknown_2031764
- ldr r5, _0804C42C @ =gSaveBlock1Ptr
- movs r3, 0xEE
- lsls r3, 2
- adds r4, r0, 0
- adds r4, 0xA8
-_0804C35C:
- 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 _0804C35C
- movs r2, 0
- ldr r0, _0804C430 @ =gUnknown_2031764
- ldr r5, _0804C42C @ =gSaveBlock1Ptr
- movs r6, 0x90
- lsls r6, 1
- adds r4, r0, r6
- movs r3, 0x86
- lsls r3, 3
-_0804C37E:
- lsls r0, r2, 2
- ldr r1, [r5]
- adds r1, r3
- adds r1, r0
- ldr r0, [r1]
- stm r4!, {r0}
- adds r2, 0x1
- cmp r2, 0xC
- ble _0804C37E
- movs r2, 0
- ldr r0, _0804C430 @ =gUnknown_2031764
- ldr r5, _0804C42C @ =gSaveBlock1Ptr
- movs r7, 0xAA
- lsls r7, 1
- adds r4, r0, r7
- ldr r3, _0804C434 @ =0x00000464
-_0804C39E:
- lsls r0, r2, 2
- ldr r1, [r5]
- adds r1, r3
- adds r1, r0
- ldr r0, [r1]
- stm r4!, {r0}
- adds r2, 0x1
- cmp r2, 0x39
- ble _0804C39E
- movs r2, 0
- ldr r0, _0804C430 @ =gUnknown_2031764
- ldr r5, _0804C42C @ =gSaveBlock1Ptr
- movs r1, 0x8F
- lsls r1, 2
- adds r4, r0, r1
- ldr r3, _0804C438 @ =0x0000054c
-_0804C3BE:
- lsls r0, r2, 2
- ldr r1, [r5]
- adds r1, r3
- adds r1, r0
- ldr r0, [r1]
- stm r4!, {r0}
- adds r2, 0x1
- cmp r2, 0x2A
- ble _0804C3BE
- ldr r0, _0804C430 @ =gUnknown_2031764
- ldr r5, _0804C42C @ =gSaveBlock1Ptr
- mov r8, r5
- movs r6, 0xBA
- lsls r6, 2
- adds r4, r0, r6
- movs r3, 0
- ldr r7, _0804C43C @ =0x00002cd0
- mov r9, r7
- movs r2, 0xF
-_0804C3E4:
- mov r0, r8
- ldr r1, [r0]
- 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 _0804C3E4
- mov r1, r10
- ldr r0, [r1]
- movs r5, 0xF2
- lsls r5, 4
- adds r0, r5
- ldr r0, [r0]
- mov r6, r12
- str r0, [r6]
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_0804C424: .4byte gUnknown_2031C8C
-_0804C428: .4byte gSaveBlock2Ptr
-_0804C42C: .4byte gSaveBlock1Ptr
-_0804C430: .4byte gUnknown_2031764
-_0804C434: .4byte 0x00000464
-_0804C438: .4byte 0x0000054c
-_0804C43C: .4byte 0x00002cd0
- thumb_func_end copy_bags_and_unk_data_from_save_blocks
-
- thumb_func_start sub_804C440
-sub_804C440: @ 804C440
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- movs r2, 0
- ldr r0, _0804C550 @ =gSaveBlock2Ptr
- mov r8, r0
- ldr r1, _0804C554 @ =gUnknown_2031C8C
- mov r12, r1
- ldr r5, _0804C558 @ =gSaveBlock1Ptr
- movs r3, 0xC4
- lsls r3, 2
- ldr r4, _0804C55C @ =gUnknown_2031764
-_0804C45C:
- ldr r0, [r5]
- lsls r1, r2, 2
- adds r0, r3
- adds r0, r1
- ldm r4!, {r1}
- str r1, [r0]
- adds r2, 0x1
- cmp r2, 0x29
- ble _0804C45C
- movs r2, 0
- ldr r5, _0804C558 @ =gSaveBlock1Ptr
- movs r4, 0xEE
- lsls r4, 2
- ldr r0, _0804C55C @ =gUnknown_2031764
- adds r3, r0, 0
- adds r3, 0xA8
-_0804C47C:
- 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 _0804C47C
- movs r2, 0
- ldr r5, _0804C558 @ =gSaveBlock1Ptr
- movs r4, 0x86
- lsls r4, 3
- ldr r0, _0804C55C @ =gUnknown_2031764
- movs r6, 0x90
- lsls r6, 1
- adds r3, r0, r6
-_0804C49E:
- ldr r0, [r5]
- lsls r1, r2, 2
- adds r0, r4
- adds r0, r1
- ldm r3!, {r1}
- str r1, [r0]
- adds r2, 0x1
- cmp r2, 0xC
- ble _0804C49E
- movs r2, 0
- ldr r5, _0804C558 @ =gSaveBlock1Ptr
- ldr r4, _0804C560 @ =0x00000464
- ldr r0, _0804C55C @ =gUnknown_2031764
- movs r7, 0xAA
- lsls r7, 1
- adds r3, r0, r7
-_0804C4BE:
- ldr r0, [r5]
- lsls r1, r2, 2
- adds r0, r4
- adds r0, r1
- ldm r3!, {r1}
- str r1, [r0]
- adds r2, 0x1
- cmp r2, 0x39
- ble _0804C4BE
- movs r2, 0
- ldr r5, _0804C558 @ =gSaveBlock1Ptr
- ldr r4, _0804C564 @ =0x0000054c
- ldr r0, _0804C55C @ =gUnknown_2031764
- movs r1, 0x8F
- lsls r1, 2
- adds r3, r0, r1
-_0804C4DE:
- ldr r0, [r5]
- lsls r1, r2, 2
- adds r0, r4
- adds r0, r1
- ldm r3!, {r1}
- str r1, [r0]
- adds r2, 0x1
- cmp r2, 0x2A
- ble _0804C4DE
- ldr r2, _0804C558 @ =gSaveBlock1Ptr
- mov r9, r2
- ldr r5, _0804C568 @ =0x00002cd0
- mov r10, r5
- ldr r4, _0804C55C @ =gUnknown_2031764
- movs r3, 0
- movs r2, 0xF
-_0804C4FE:
- mov r6, r9
- ldr r1, [r6]
- adds r1, r3
- add r1, r10
- movs r7, 0xBA
- lsls r7, 2
- adds r0, r4, r7
- 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 _0804C4FE
- mov r1, r8
- ldr r0, [r1]
- movs r5, 0xF2
- lsls r5, 4
- adds r0, r5
- ldr r4, [r0]
- mov r2, r12
- ldr r1, [r2]
- str r1, [r0]
- adds r0, r4, 0
- bl ApplyNewEncryptionKeyToBagItems
- mov r6, r8
- ldr r0, [r6]
- adds r0, r5
- str r4, [r0]
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_0804C550: .4byte gSaveBlock2Ptr
-_0804C554: .4byte gUnknown_2031C8C
-_0804C558: .4byte gSaveBlock1Ptr
-_0804C55C: .4byte gUnknown_2031764
-_0804C560: .4byte 0x00000464
-_0804C564: .4byte 0x0000054c
-_0804C568: .4byte 0x00002cd0
- thumb_func_end sub_804C440
-
- thumb_func_start sub_804C56C
-sub_804C56C: @ 804C56C
- ldr r2, _0804C584 @ =gSaveBlock2Ptr
- ldr r2, [r2]
- movs r3, 0xF2
- lsls r3, 4
- adds r2, r3
- ldr r2, [r2]
- ldrh r3, [r0]
- eors r2, r3
- eors r2, r1
- strh r2, [r0]
- bx lr
- .align 2, 0
-_0804C584: .4byte gSaveBlock2Ptr
- thumb_func_end sub_804C56C
-
- thumb_func_start sub_804C588
-sub_804C588: @ 804C588
- ldr r2, _0804C5A0 @ =gSaveBlock2Ptr
- ldr r3, [r2]
- movs r2, 0xF2
- lsls r2, 4
- adds r3, r2
- ldr r2, [r0]
- ldr r3, [r3]
- eors r2, r3
- eors r2, r1
- str r2, [r0]
- bx lr
- .align 2, 0
-_0804C5A0: .4byte gSaveBlock2Ptr
- thumb_func_end sub_804C588
-
- thumb_func_start sub_804C5A4
-sub_804C5A4: @ 804C5A4
- push {r4-r7,lr}
- adds r5, r0, 0
- ldr r7, _0804C5F8 @ =gSaveBlock1Ptr
- ldr r6, _0804C5FC @ =0x00003d38
- movs r4, 0x3
-_0804C5AE:
- ldr r0, [r7]
- adds r0, r6
- adds r0, 0x4
- adds r1, r5, 0
- bl sub_804C588
- adds r6, 0xC
- subs r4, 0x1
- cmp r4, 0
- bge _0804C5AE
- adds r0, r5, 0
- bl sub_8054F38
- adds r0, r5, 0
- bl ApplyNewEncryptionKeyToBagItems_
- adds r0, r5, 0
- bl sub_815EE6C
- ldr r4, _0804C5F8 @ =gSaveBlock1Ptr
- ldr r0, [r4]
- movs r1, 0xA4
- lsls r1, 2
- adds r0, r1
- adds r1, r5, 0
- bl sub_804C588
- ldr r0, [r4]
- movs r1, 0xA5
- lsls r1, 2
- adds r0, r1
- adds r1, r5, 0
- bl sub_804C56C
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_0804C5F8: .4byte gSaveBlock1Ptr
-_0804C5FC: .4byte 0x00003d38
- thumb_func_end sub_804C5A4
-
- .align 2, 0 @ Don't pad with nop.
diff --git a/asm/mail_data.s b/asm/mail_data.s
index 5f577039b..421aaf452 100644
--- a/asm/mail_data.s
+++ b/asm/mail_data.s
@@ -301,11 +301,11 @@ _08097E36:
mov r0, r8
movs r1, 0x40
mov r2, r9
- bl sub_804037C
+ bl SetMonData
mov r0, r8
movs r1, 0xC
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, r9
ldrb r0, [r1]
b _08097EEE
@@ -413,7 +413,7 @@ GiveMailToMon2: @ 8097F44
adds r0, r6, 0
movs r1, 0x40
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
mov r0, sp
strb r5, [r0]
mov r1, sp
@@ -422,7 +422,7 @@ GiveMailToMon2: @ 8097F44
adds r0, r6, 0
movs r1, 0xC
mov r2, sp
- bl sub_804037C
+ bl SetMonData
ldrb r0, [r4]
b _08097FAA
.align 2, 0
@@ -476,11 +476,11 @@ TakeMailFromMon: @ 8097FB8
strb r1, [r0, 0x1]
adds r0, r4, 0
movs r1, 0x40
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0xC
mov r2, sp
- bl sub_804037C
+ bl SetMonData
_08098008:
add sp, 0x8
pop {r4}
@@ -577,11 +577,11 @@ _08098060:
adds r0, r5, 0
movs r1, 0x40
mov r2, r9
- bl sub_804037C
+ bl SetMonData
adds r0, r5, 0
movs r1, 0xC
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r7, 0
b _080980E8
.align 2, 0
diff --git a/asm/main_menu.s b/asm/main_menu.s
index 9c1302cdc..ff1ab95cc 100644
--- a/asm/main_menu.s
+++ b/asm/main_menu.s
@@ -254,7 +254,7 @@ _0800C4E8:
movs r0, 0x54
movs r1, 0x7
bl SetGpuReg
- ldr r0, _0800C53C @ =gUnknown_30053A0
+ ldr r0, _0800C53C @ =gSaveFileStatus
ldrh r4, [r0]
cmp r4, 0x2
beq _0800C58C
@@ -267,7 +267,7 @@ _0800C4E8:
b _0800C5E8
.align 2, 0
_0800C538: .4byte gUnknown_2037AB8
-_0800C53C: .4byte gUnknown_30053A0
+_0800C53C: .4byte gSaveFileStatus
_0800C540:
cmp r4, 0x4
beq _0800C60C
diff --git a/asm/map_obj_80688E4.s b/asm/map_obj_80688E4.s
index 5ba346f0b..0f878255c 100644
--- a/asm/map_obj_80688E4.s
+++ b/asm/map_obj_80688E4.s
@@ -86,7 +86,7 @@ _0806896E:
player_bitmagic: @ 8068974
push {r4,r5,lr}
movs r4, 0
- ldr r5, _080689A8 @ =gUnknown_2036E38
+ ldr r5, _080689A8 @ =gMapObjects
_0806897A:
lsls r0, r4, 3
adds r0, r4
@@ -112,7 +112,7 @@ _08068998:
pop {r0}
bx r0
.align 2, 0
-_080689A8: .4byte gUnknown_2036E38
+_080689A8: .4byte gMapObjects
_080689AC: .4byte gUnknown_2037078
thumb_func_end player_bitmagic
@@ -122,7 +122,7 @@ FreezeMapObjectsExceptOne: @ 80689B0
lsls r0, 24
lsrs r5, r0, 24
movs r4, 0
- ldr r6, _080689EC @ =gUnknown_2036E38
+ ldr r6, _080689EC @ =gMapObjects
_080689BA:
cmp r4, r5
beq _080689DC
@@ -150,7 +150,7 @@ _080689DC:
pop {r0}
bx r0
.align 2, 0
-_080689EC: .4byte gUnknown_2036E38
+_080689EC: .4byte gMapObjects
_080689F0: .4byte gUnknown_2037078
thumb_func_end FreezeMapObjectsExceptOne
@@ -213,7 +213,7 @@ _08068A58: .4byte gSprites
UnfreezeMapObjects: @ 8068A5C
push {r4,r5,lr}
movs r4, 0
- ldr r5, _08068A88 @ =gUnknown_2036E38
+ ldr r5, _08068A88 @ =gMapObjects
_08068A62:
lsls r0, r4, 3
adds r0, r4
@@ -235,7 +235,7 @@ _08068A78:
pop {r0}
bx r0
.align 2, 0
-_08068A88: .4byte gUnknown_2036E38
+_08068A88: .4byte gMapObjects
thumb_func_end UnfreezeMapObjects
thumb_func_start little_step
diff --git a/asm/map_obj_lock.s b/asm/map_obj_lock.s
index 2b3cbfc5a..a5a61662d 100644
--- a/asm/map_obj_lock.s
+++ b/asm/map_obj_lock.s
@@ -100,7 +100,7 @@ _080695F6:
ldrsh r0, [r5, r1]
cmp r0, 0
bne _0806961E
- ldr r2, _08069640 @ =gUnknown_2036E38
+ ldr r2, _08069640 @ =gMapObjects
ldr r0, _08069644 @ =gUnknown_3005074
ldrb r1, [r0]
lsls r0, r1, 3
@@ -132,7 +132,7 @@ _08069634:
bx r0
.align 2, 0
_0806963C: .4byte gTasks
-_08069640: .4byte gUnknown_2036E38
+_08069640: .4byte gMapObjects
_08069644: .4byte gUnknown_3005074
thumb_func_end sub_80695CC
@@ -167,7 +167,7 @@ LockSelectedMapObject: @ 806966C
bl CreateTask
lsls r0, 24
lsrs r5, r0, 24
- ldr r2, _080696B8 @ =gUnknown_2036E38
+ ldr r2, _080696B8 @ =gMapObjects
ldrb r1, [r4]
lsls r0, r1, 3
adds r0, r1
@@ -193,7 +193,7 @@ _080696AA:
.align 2, 0
_080696B0: .4byte gUnknown_3005074
_080696B4: .4byte sub_80695CC
-_080696B8: .4byte gUnknown_2036E38
+_080696B8: .4byte gMapObjects
_080696BC: .4byte gTasks
thumb_func_end LockSelectedMapObject
@@ -210,7 +210,7 @@ sub_80696C0: @ 80696C0
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _080696EC @ =gUnknown_2036E38
+ ldr r1, _080696EC @ =gMapObjects
adds r0, r1
bl FieldObjectClearAnimIfSpecialAnimFinished
bl sub_80974D8
@@ -218,13 +218,13 @@ sub_80696C0: @ 80696C0
pop {r0}
bx r0
.align 2, 0
-_080696EC: .4byte gUnknown_2036E38
+_080696EC: .4byte gMapObjects
thumb_func_end sub_80696C0
thumb_func_start sub_80696F0
sub_80696F0: @ 80696F0
push {r4,lr}
- ldr r4, _08069738 @ =gUnknown_2036E38
+ ldr r4, _08069738 @ =gMapObjects
ldr r0, _0806973C @ =gUnknown_3005074
ldrb r1, [r0]
lsls r0, r1, 3
@@ -256,7 +256,7 @@ _0806970E:
pop {r0}
bx r0
.align 2, 0
-_08069738: .4byte gUnknown_2036E38
+_08069738: .4byte gMapObjects
_0806973C: .4byte gUnknown_3005074
thumb_func_end sub_80696F0
@@ -268,7 +268,7 @@ sub_8069740: @ 8069740
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08069760 @ =gUnknown_2036E38
+ ldr r1, _08069760 @ =gMapObjects
adds r0, r1
ldr r1, _08069764 @ =gUnknown_20370D4
ldrb r1, [r1]
@@ -277,7 +277,7 @@ sub_8069740: @ 8069740
bx r0
.align 2, 0
_0806975C: .4byte gUnknown_3005074
-_08069760: .4byte gUnknown_2036E38
+_08069760: .4byte gMapObjects
_08069764: .4byte gUnknown_20370D4
thumb_func_end sub_8069740
@@ -289,14 +289,14 @@ sub_8069768: @ 8069768
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08069784 @ =gUnknown_2036E38
+ ldr r1, _08069784 @ =gMapObjects
adds r0, r1
bl FieldObjectClearAnimIfSpecialAnimActive
pop {r0}
bx r0
.align 2, 0
_08069780: .4byte gUnknown_3005074
-_08069784: .4byte gUnknown_2036E38
+_08069784: .4byte gMapObjects
thumb_func_end sub_8069768
.align 2, 0 @ Don't pad with nop.
diff --git a/asm/mevent.s b/asm/mevent.s
index 5d90586d5..697266a39 100644
--- a/asm/mevent.s
+++ b/asm/mevent.s
@@ -122,7 +122,7 @@ _081436B8: .4byte gUnknown_3003F84
thumb_func_start sub_81436BC
sub_81436BC: @ 81436BC
push {lr}
- ldr r0, _081436E0 @ =gUnknown_201C000
+ ldr r0, _081436E0 @ =gDecompressionBuffer
movs r2, 0x80
lsls r2, 6
movs r1, 0
@@ -137,7 +137,7 @@ sub_81436BC: @ 81436BC
pop {r0}
bx r0
.align 2, 0
-_081436E0: .4byte gUnknown_201C000
+_081436E0: .4byte gDecompressionBuffer
_081436E4: .4byte gUnknown_202271A
_081436E8: .4byte 0x00005502
thumb_func_end sub_81436BC
@@ -775,7 +775,7 @@ _08143C12:
strb r0, [r4, 0x8]
b _08143D1A
_08143C1C:
- ldr r0, _08143C30 @ =gUnknown_201C000
+ ldr r0, _08143C30 @ =gDecompressionBuffer
bl sub_815D6B4
strb r0, [r4, 0xE]
ldrb r0, [r4, 0xE]
@@ -784,7 +784,7 @@ _08143C1C:
strb r0, [r4, 0x8]
b _08143D1A
.align 2, 0
-_08143C30: .4byte gUnknown_201C000
+_08143C30: .4byte gDecompressionBuffer
_08143C34:
ldr r0, _08143C48 @ =gUnknown_3003F64
ldrb r0, [r0]
@@ -803,7 +803,7 @@ _08143C4C:
strb r0, [r4, 0x8]
b _08143D1A
_08143C52:
- ldr r0, _08143C70 @ =gUnknown_201C000
+ ldr r0, _08143C70 @ =gDecompressionBuffer
bl sub_815D794
cmp r0, 0
beq _08143C78
@@ -815,7 +815,7 @@ _08143C52:
strb r0, [r4, 0x8]
b _08143D1A
.align 2, 0
-_08143C70: .4byte gUnknown_201C000
+_08143C70: .4byte gDecompressionBuffer
_08143C74: .4byte gUnknown_841DE99
_08143C78:
movs r0, 0x16
diff --git a/asm/mevent_server.s b/asm/mevent_server.s
index 1def33127..5772b19f4 100644
--- a/asm/mevent_server.s
+++ b/asm/mevent_server.s
@@ -820,7 +820,7 @@ _08144E30:
.align 2, 0
_08144E48: .4byte gSaveBlock2Ptr
_08144E4C:
- ldr r0, _08144E68 @ =gUnknown_201C000
+ ldr r0, _08144E68 @ =gDecompressionBuffer
ldr r1, [r4, 0x18]
movs r2, 0x80
lsls r2, 3
@@ -837,7 +837,7 @@ _08144E62:
pop {r1}
bx r1
.align 2, 0
-_08144E68: .4byte gUnknown_201C000
+_08144E68: .4byte gDecompressionBuffer
thumb_func_end sub_8144CA0
thumb_func_start sub_8144E6C
@@ -894,7 +894,7 @@ _08144EB4:
sub_8144EBC: @ 8144EBC
push {r4,lr}
adds r4, r0, 0
- ldr r3, _08144EE4 @ =gUnknown_201C000
+ ldr r3, _08144EE4 @ =gDecompressionBuffer
adds r0, r4, 0x4
ldr r1, _08144EE8 @ =gSaveBlock2Ptr
ldr r1, [r1]
@@ -913,7 +913,7 @@ _08144EDC:
pop {r1}
bx r1
.align 2, 0
-_08144EE4: .4byte gUnknown_201C000
+_08144EE4: .4byte gDecompressionBuffer
_08144EE8: .4byte gSaveBlock2Ptr
_08144EEC: .4byte gSaveBlock1Ptr
thumb_func_end sub_8144EBC
diff --git a/asm/mystery_event_script.s b/asm/mystery_event_script.s
index 18b6066d9..b150bb586 100644
--- a/asm/mystery_event_script.s
+++ b/asm/mystery_event_script.s
@@ -511,20 +511,20 @@ sub_80DAB80: @ 80DAB80
cmp r4, r0
bne _080DABD0
ldr r0, _080DABC8 @ =gStringVar1
- ldr r1, _080DABCC @ =gUnknown_8415A62
+ ldr r1, _080DABCC @ =gText_EggNickname
movs r2, 0xB
bl StringCopyN
b _080DABDA
.align 2, 0
_080DABC8: .4byte gStringVar1
-_080DABCC: .4byte gUnknown_8415A62
+_080DABCC: .4byte gText_EggNickname
_080DABD0:
ldr r0, _080DABF0 @ =gStringVar1
ldr r1, _080DABF4 @ =gUnknown_8415A66
movs r2, 0xB
bl StringCopyN
_080DABDA:
- ldr r0, _080DABF8 @ =gUnknown_2024029
+ ldr r0, _080DABF8 @ =gPlayerPartyCount
ldrb r0, [r0]
cmp r0, 0x6
bne _080DAC04
@@ -536,7 +536,7 @@ _080DABDA:
.align 2, 0
_080DABF0: .4byte gStringVar1
_080DABF4: .4byte gUnknown_8415A66
-_080DABF8: .4byte gUnknown_2024029
+_080DABF8: .4byte gPlayerPartyCount
_080DABFC: .4byte gStringVar4
_080DAC00: .4byte gUnknown_8488D8E
_080DAC04:
diff --git a/asm/naming_screen.s b/asm/naming_screen.s
index e42ed45d8..2601ab1f1 100644
--- a/asm/naming_screen.s
+++ b/asm/naming_screen.s
@@ -3524,7 +3524,7 @@ sub_809F4F0: @ 809F4F0
ldrh r1, [r0]
movs r0, 0xB
muls r1, r0
- ldr r0, _0809F560 @ =gUnknown_8245EE0
+ ldr r0, _0809F560 @ =gSpeciesNames
adds r1, r0
add r0, sp, 0xC
bl StringCopy
@@ -3565,7 +3565,7 @@ sub_809F4F0: @ 809F4F0
.align 2, 0
_0809F558: .4byte gUnknown_203998C
_0809F55C: .4byte 0x00001e34
-_0809F560: .4byte gUnknown_8245EE0
+_0809F560: .4byte gSpeciesNames
_0809F564: .4byte 0x00001e28
_0809F568: .4byte 0x00001e14
thumb_func_end sub_809F4F0
diff --git a/asm/new_game.s b/asm/new_game.s
index d7808dba7..b8f6515ef 100644
--- a/asm/new_game.s
+++ b/asm/new_game.s
@@ -253,7 +253,7 @@ sub_8054A60: @ 8054A60
bl sub_80A0904
bl sub_80A0958
bl sub_806E190
- ldr r0, _08054B64 @ =gUnknown_2024029
+ ldr r0, _08054B64 @ =gPlayerPartyCount
strb r5, [r0]
bl ZeroPlayerPartyMons
bl sub_808C7E0
@@ -291,7 +291,7 @@ _08054B54: .4byte 0x00003a4c
_08054B58: .4byte gUnknown_2031DB0
_08054B5C: .4byte gSaveBlock2Ptr
_08054B60: .4byte 0x00000bb8
-_08054B64: .4byte gUnknown_2024029
+_08054B64: .4byte gPlayerPartyCount
_08054B68: .4byte 0x00000296
_08054B6C: .4byte gUnknown_81A6481
thumb_func_end sub_8054A60
diff --git a/asm/oak_speech.s b/asm/oak_speech.s
index c5591fc0e..54451e618 100644
--- a/asm/oak_speech.s
+++ b/asm/oak_speech.s
@@ -4637,7 +4637,7 @@ sub_8130F2C: @ 8130F2C
movs r0, 0x1D
movs r1, 0
bl sub_803F7D4
- ldr r0, _08130FA8 @ =gUnknown_20244DC
+ ldr r0, _08130FA8 @ =gMultiuseSpriteTemplate
movs r1, 0x60
movs r2, 0x60
movs r3, 0x1
@@ -4677,7 +4677,7 @@ sub_8130F2C: @ 8130F2C
.align 2, 0
_08130FA0: .4byte gUnknown_8235194
_08130FA4: .4byte gUnknown_82373F4
-_08130FA8: .4byte gUnknown_20244DC
+_08130FA8: .4byte gMultiuseSpriteTemplate
_08130FAC: .4byte gSprites
_08130FB0: .4byte SpriteCallbackDummy
_08130FB4: .4byte gTasks
diff --git a/asm/overworld.s b/asm/overworld.s
index 5e6315b9f..b7c629261 100644
--- a/asm/overworld.s
+++ b/asm/overworld.s
@@ -421,7 +421,7 @@ _08054F40:
ldr r0, [r6]
adds r0, r1
adds r1, r5, 0
- bl sub_804C588
+ bl ApplyNewEncryptionKeyToWord
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
@@ -4439,7 +4439,7 @@ _08056E60:
thumb_func_start MoveSaveBlocks_ResetHeap_
MoveSaveBlocks_ResetHeap_: @ 8056E74
push {lr}
- bl sub_804C0A4
+ bl MoveSaveBlocks_ResetHeap
pop {r0}
bx r0
thumb_func_end MoveSaveBlocks_ResetHeap_
@@ -4734,7 +4734,7 @@ sub_8057100: @ 8057100
thumb_func_start sub_8057114
sub_8057114: @ 8057114
push {lr}
- ldr r2, _08057138 @ =gUnknown_2036E38
+ ldr r2, _08057138 @ =gMapObjects
ldr r3, _0805713C @ =gUnknown_2037078
ldrb r1, [r3, 0x5]
lsls r0, r1, 3
@@ -4750,7 +4750,7 @@ sub_8057114: @ 8057114
pop {r0}
bx r0
.align 2, 0
-_08057138: .4byte gUnknown_2036E38
+_08057138: .4byte gMapObjects
_0805713C: .4byte gUnknown_2037078
thumb_func_end sub_8057114
@@ -4834,7 +4834,7 @@ sub_80571A8: @ 80571A8
ldrb r0, [r0]
cmp r6, r0
bcs _08057212
- ldr r7, _0805722C @ =gUnknown_202273C
+ ldr r7, _0805722C @ =gLinkPlayers
_080571D8:
lsls r5, r6, 24
lsrs r5, 24
@@ -4874,7 +4874,7 @@ _08057212:
.align 2, 0
_08057224: .4byte gUnknown_300502C
_08057228: .4byte gUnknown_3005030
-_0805722C: .4byte gUnknown_202273C
+_0805722C: .4byte gLinkPlayers
thumb_func_end sub_80571A8
thumb_func_start sub_8057230
@@ -4885,7 +4885,7 @@ sub_8057230: @ 8057230
ldrb r0, [r0]
cmp r4, r0
bcs _0805725E
- ldr r5, _08057268 @ =gUnknown_202273C
+ ldr r5, _08057268 @ =gLinkPlayers
_0805723E:
lsls r0, r4, 24
lsrs r0, 24
@@ -4908,7 +4908,7 @@ _0805725E:
bx r0
.align 2, 0
_08057264: .4byte gUnknown_3005030
-_08057268: .4byte gUnknown_202273C
+_08057268: .4byte gLinkPlayers
thumb_func_end sub_8057230
thumb_func_start sub_805726C
@@ -7200,7 +7200,7 @@ SpawnLinkPlayerMapObject: @ 805839C
lsls r5, r6, 3
adds r5, r6
lsls r5, 2
- ldr r0, _08058444 @ =gUnknown_2036E38
+ ldr r0, _08058444 @ =gMapObjects
adds r5, r0
adds r0, r4, 0
bl ZeroLinkPlayerMapObject
@@ -7248,7 +7248,7 @@ SpawnLinkPlayerMapObject: @ 805839C
bx r0
.align 2, 0
_08058440: .4byte gUnknown_2031DEC
-_08058444: .4byte gUnknown_2036E38
+_08058444: .4byte gMapObjects
thumb_func_end SpawnLinkPlayerMapObject
thumb_func_start InitLinkPlayerMapObjectPos
@@ -7300,7 +7300,7 @@ sub_8058488: @ 8058488
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
- ldr r0, _080584B4 @ =gUnknown_2036E38
+ ldr r0, _080584B4 @ =gMapObjects
adds r1, r0
strb r2, [r1, 0x19]
_080584AA:
@@ -7308,7 +7308,7 @@ _080584AA:
bx r0
.align 2, 0
_080584B0: .4byte gUnknown_2031DEC
-_080584B4: .4byte gUnknown_2036E38
+_080584B4: .4byte gMapObjects
thumb_func_end sub_8058488
thumb_func_start sub_80584B8
@@ -7322,7 +7322,7 @@ sub_80584B8: @ 80584B8
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _080584FC @ =gUnknown_2036E38
+ ldr r1, _080584FC @ =gMapObjects
adds r4, r0, r1
ldrb r0, [r4, 0x4]
cmp r0, 0x40
@@ -7346,7 +7346,7 @@ _080584E4:
bx r0
.align 2, 0
_080584F8: .4byte gUnknown_2031DEC
-_080584FC: .4byte gUnknown_2036E38
+_080584FC: .4byte gMapObjects
_08058500: .4byte gSprites
thumb_func_end sub_80584B8
@@ -7360,13 +7360,13 @@ sub_8058504: @ 8058504
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08058520 @ =gUnknown_2036E38
+ ldr r1, _08058520 @ =gMapObjects
adds r0, r1
ldrb r0, [r0, 0x4]
bx lr
.align 2, 0
_0805851C: .4byte gUnknown_2031DEC
-_08058520: .4byte gUnknown_2036E38
+_08058520: .4byte gMapObjects
thumb_func_end sub_8058504
thumb_func_start sub_8058524
@@ -7379,7 +7379,7 @@ sub_8058524: @ 8058524
lsls r0, r3, 3
adds r0, r3
lsls r0, 2
- ldr r3, _08058548 @ =gUnknown_2036E38
+ ldr r3, _08058548 @ =gMapObjects
adds r0, r3
ldrh r3, [r0, 0x10]
strh r3, [r1]
@@ -7388,7 +7388,7 @@ sub_8058524: @ 8058524
bx lr
.align 2, 0
_08058544: .4byte gUnknown_2031DEC
-_08058548: .4byte gUnknown_2036E38
+_08058548: .4byte gMapObjects
thumb_func_end sub_8058524
thumb_func_start sub_805854C
@@ -7401,13 +7401,13 @@ sub_805854C: @ 805854C
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08058568 @ =gUnknown_2036E38
+ ldr r1, _08058568 @ =gMapObjects
adds r0, r1
ldrb r0, [r0, 0x19]
bx lr
.align 2, 0
_08058564: .4byte gUnknown_2031DEC
-_08058568: .4byte gUnknown_2036E38
+_08058568: .4byte gMapObjects
thumb_func_end sub_805854C
thumb_func_start sub_805856C
@@ -7420,7 +7420,7 @@ sub_805856C: @ 805856C
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805858C @ =gUnknown_2036E38
+ ldr r1, _0805858C @ =gMapObjects
adds r0, r1
ldrb r0, [r0, 0xB]
lsls r0, 28
@@ -7428,7 +7428,7 @@ sub_805856C: @ 805856C
bx lr
.align 2, 0
_08058588: .4byte gUnknown_2031DEC
-_0805858C: .4byte gUnknown_2036E38
+_0805858C: .4byte gMapObjects
thumb_func_end sub_805856C
thumb_func_start sub_8058590
@@ -7441,7 +7441,7 @@ sub_8058590: @ 8058590
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _080585B4 @ =gUnknown_2036E38
+ ldr r1, _080585B4 @ =gMapObjects
adds r0, r1
adds r0, 0x21
movs r1, 0
@@ -7451,7 +7451,7 @@ sub_8058590: @ 8058590
bx lr
.align 2, 0
_080585B0: .4byte gUnknown_2031DEC
-_080585B4: .4byte gUnknown_2036E38
+_080585B4: .4byte gMapObjects
thumb_func_end sub_8058590
thumb_func_start GetLinkPlayerIdAt
@@ -7479,7 +7479,7 @@ _080585DA:
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08058600 @ =gUnknown_2036E38
+ ldr r1, _08058600 @ =gMapObjects
adds r1, r0, r1
movs r6, 0x10
ldrsh r0, [r1, r6]
@@ -7493,7 +7493,7 @@ _080585DA:
b _08058610
.align 2, 0
_080585FC: .4byte gUnknown_2031DEC
-_08058600: .4byte gUnknown_2036E38
+_08058600: .4byte gMapObjects
_08058604:
adds r0, r2, 0x1
lsls r0, 24
@@ -7521,7 +7521,7 @@ sub_8058618: @ 8058618
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0805864C @ =gUnknown_2036E38
+ ldr r1, _0805864C @ =gMapObjects
adds r6, r0, r1
ldrb r0, [r5]
cmp r0, 0
@@ -7535,7 +7535,7 @@ sub_8058618: @ 8058618
b _08058674
.align 2, 0
_08058648: .4byte gUnknown_2031DEC
-_0805864C: .4byte gUnknown_2036E38
+_0805864C: .4byte gMapObjects
_08058650:
ldr r4, _0805867C @ =gUnknown_826D374
ldr r1, _08058680 @ =gUnknown_826D33C
@@ -7780,7 +7780,7 @@ npc_080587EC: @ 80587EC
mov r12, r2
lsls r3, 16
movs r4, 0
- ldr r0, _08058850 @ =gUnknown_2036E38
+ ldr r0, _08058850 @ =gMapObjects
mov r9, r0
lsrs r2, r3, 16
mov r10, r2
@@ -7820,7 +7820,7 @@ _0805884A:
movs r0, 0x1
b _0805886A
.align 2, 0
-_08058850: .4byte gUnknown_2036E38
+_08058850: .4byte gMapObjects
_08058854:
adds r0, r4, 0x1
lsls r0, 24
@@ -7857,7 +7857,7 @@ sub_8058878: @ 8058878
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _080588B8 @ =gUnknown_2036E38
+ ldr r1, _080588B8 @ =gMapObjects
adds r4, r0, r1
ldrb r0, [r2]
cmp r0, 0
@@ -7875,7 +7875,7 @@ sub_8058878: @ 8058878
b _080588C6
.align 2, 0
_080588B4: .4byte gUnknown_2031DEC
-_080588B8: .4byte gUnknown_2036E38
+_080588B8: .4byte gMapObjects
_080588BC:
ldrb r0, [r4]
lsls r0, 30
@@ -7931,7 +7931,7 @@ SpriteCB_LinkPlayer: @ 805890C
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08058974 @ =gUnknown_2036E38
+ ldr r1, _08058974 @ =gMapObjects
adds r6, r0, r1
ldrh r0, [r6, 0xC]
strh r0, [r5, 0x20]
@@ -7967,7 +7967,7 @@ SpriteCB_LinkPlayer: @ 805890C
b _0805898A
.align 2, 0
_08058970: .4byte gUnknown_2031DEC
-_08058974: .4byte gUnknown_2036E38
+_08058974: .4byte gMapObjects
_08058978:
ldrb r0, [r6, 0x19]
bl get_go_image_anim_num
diff --git a/asm/party_menu.s b/asm/party_menu.s
index c23e401ef..5b27201b9 100644
--- a/asm/party_menu.s
+++ b/asm/party_menu.s
@@ -1299,7 +1299,7 @@ _0811F4A2:
adds r0, r6, 0
movs r1, 0x3
adds r2, r4, 0
- bl sub_8042EC4
+ bl GetEvolutionTargetSpecies
lsls r0, 16
cmp r0, 0
bne _0811F492
@@ -2796,12 +2796,12 @@ _08120016:
_08120024:
cmp r1, 0x6
bne _08120034
- ldr r0, _08120030 @ =gUnknown_2024029
+ ldr r0, _08120030 @ =gPlayerPartyCount
ldrb r0, [r0]
subs r0, 0x1
b _081200EC
.align 2, 0
-_08120030: .4byte gUnknown_2024029
+_08120030: .4byte gPlayerPartyCount
_08120034:
cmp r1, 0x7
bne _08120058
@@ -2816,12 +2816,12 @@ _08120034:
.align 2, 0
_08120048: .4byte gUnknown_203B09C
_0812004C:
- ldr r0, _08120054 @ =gUnknown_2024029
+ ldr r0, _08120054 @ =gPlayerPartyCount
ldrb r0, [r0]
subs r0, 0x1
b _081200EC
.align 2, 0
-_08120054: .4byte gUnknown_2024029
+_08120054: .4byte gPlayerPartyCount
_08120058:
subs r0, 0x1
b _081200EC
@@ -2833,7 +2833,7 @@ _0812005C:
beq _081200EA
movs r1, 0
ldrsb r1, [r4, r1]
- ldr r0, _08120084 @ =gUnknown_2024029
+ ldr r0, _08120084 @ =gPlayerPartyCount
ldrb r0, [r0]
subs r0, 0x1
cmp r1, r0
@@ -2847,7 +2847,7 @@ _0812005C:
movs r0, 0x6
b _081200EC
.align 2, 0
-_08120084: .4byte gUnknown_2024029
+_08120084: .4byte gPlayerPartyCount
_08120088: .4byte gUnknown_203B09C
_0812008C:
movs r0, 0x7
@@ -2856,7 +2856,7 @@ _08120090:
adds r0, r2, 0x1
b _081200EC
_08120094:
- ldr r0, _081200B8 @ =gUnknown_2024029
+ ldr r0, _081200B8 @ =gPlayerPartyCount
ldrb r0, [r0]
cmp r0, 0x1
beq _081200EE
@@ -2874,7 +2874,7 @@ _08120094:
movs r0, 0x1
b _081200EC
.align 2, 0
-_081200B8: .4byte gUnknown_2024029
+_081200B8: .4byte gPlayerPartyCount
_081200BC: .4byte gUnknown_203B09C
_081200C0:
movs r0, 0
@@ -2947,12 +2947,12 @@ _08120124:
_08120132:
cmp r0, 0x6
bne _08120144
- ldr r0, _08120140 @ =gUnknown_2024029
+ ldr r0, _08120140 @ =gPlayerPartyCount
ldrb r0, [r0]
subs r0, 0x1
b _0812028E
.align 2, 0
-_08120140: .4byte gUnknown_2024029
+_08120140: .4byte gPlayerPartyCount
_08120144:
cmp r0, 0x7
bne _08120160
@@ -3557,7 +3557,7 @@ _081205F2:
adds r0, r6, 0
movs r1, 0xC
mov r2, sp
- bl sub_804037C
+ bl SetMonData
_08120606:
add sp, 0x4
pop {r4-r7}
@@ -3592,7 +3592,7 @@ _0812062C:
adds r0, r4, 0
movs r1, 0xC
mov r2, sp
- bl sub_804037C
+ bl SetMonData
movs r0, 0x2
b _0812064E
_0812064C:
@@ -3672,7 +3672,7 @@ sub_81206A8: @ 81206A8
adds r0, r4
movs r1, 0x39
adds r2, r7, 0
- bl sub_804037C
+ bl SetMonData
movs r3, 0x8
ldrsh r2, [r7, r3]
adds r0, r2, 0
@@ -3961,7 +3961,7 @@ sub_81208E4: @ 81208E4
cmp r0, 0
bne _08120944
movs r4, 0
- ldr r0, _0812093C @ =gUnknown_2024029
+ ldr r0, _0812093C @ =gPlayerPartyCount
ldrb r0, [r0]
cmp r4, r0
bcs _0812096E
@@ -3980,7 +3980,7 @@ _0812090C:
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
- ldr r0, _0812093C @ =gUnknown_2024029
+ ldr r0, _0812093C @ =gPlayerPartyCount
ldrb r0, [r0]
cmp r4, r0
bcc _0812090C
@@ -3988,7 +3988,7 @@ _0812090C:
.align 2, 0
_08120934: .4byte gUnknown_203B0A0
_08120938: .4byte gUnknown_20370C2
-_0812093C: .4byte gUnknown_2024029
+_0812093C: .4byte gPlayerPartyCount
_08120940: .4byte gPlayerParty
_08120944:
movs r4, 0
@@ -4009,7 +4009,7 @@ _08120948:
lsls r0, 24
lsrs r4, r0, 24
_08120966:
- ldr r0, _08120978 @ =gUnknown_2024029
+ ldr r0, _08120978 @ =gPlayerPartyCount
ldrb r0, [r0]
cmp r4, r0
bcc _08120948
@@ -4019,7 +4019,7 @@ _0812096E:
bx r0
.align 2, 0
_08120974: .4byte gPlayerParty
-_08120978: .4byte gUnknown_2024029
+_08120978: .4byte gPlayerPartyCount
thumb_func_end sub_81208E4
thumb_func_start sub_812097C
@@ -4877,7 +4877,7 @@ _08120FAC: .4byte sub_8120FB0
sub_8120FB0: @ 8120FB0
push {lr}
bl FreeRestoreBattleData
- bl sub_804C230
+ bl LoadPlayerParty
bl sub_815AC20
ldr r0, _08120FC8 @ =sub_815ABFC
bl SetMainCallback2
@@ -6010,7 +6010,7 @@ _081218EC:
movs r0, 0xB
adds r1, r5, 0
muls r1, r0
- ldr r0, _0812190C @ =gUnknown_8245EE0
+ ldr r0, _0812190C @ =gSpeciesNames
adds r1, r0
mov r0, r9
bl StringCompare
@@ -6024,7 +6024,7 @@ _08121900:
beq _08121950
b _08121982
.align 2, 0
-_0812190C: .4byte gUnknown_8245EE0
+_0812190C: .4byte gSpeciesNames
_08121910:
ldr r5, _08121944 @ =gUnknown_845A2B8
ldrb r0, [r5]
@@ -8673,7 +8673,7 @@ sub_8122D78: @ 8122D78
_08122D8C:
ldr r0, _08122DB0 @ =gPlayerParty
ldrb r1, [r4, 0x9]
- ldr r2, _08122DB4 @ =gUnknown_2024029
+ ldr r2, _08122DB4 @ =gPlayerPartyCount
ldrb r2, [r2]
subs r2, 0x1
lsls r2, 24
@@ -8689,7 +8689,7 @@ _08122D8C:
.align 2, 0
_08122DAC: .4byte gUnknown_203B0A0
_08122DB0: .4byte gPlayerParty
-_08122DB4: .4byte gUnknown_2024029
+_08122DB4: .4byte gPlayerPartyCount
_08122DB8: .4byte sub_8122DBC
thumb_func_end sub_8122D78
@@ -10327,7 +10327,7 @@ sub_8123ACC: @ 8123ACC
adds r0, r5, 0
movs r1, 0xC
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
ldrh r0, [r4]
movs r1, 0x1
bl sub_809A1D8
@@ -12727,7 +12727,7 @@ sub_8124E48: @ 8124E48
muls r0, r6
adds r0, r5
movs r1, 0x4
- bl sub_80436F8
+ bl AdjustFriendship
ldrh r1, [r7]
movs r0, 0xA9
lsls r0, 1
@@ -12815,7 +12815,7 @@ sub_8124EFC: @ 8124EFC
bl SetMonMoveSlot
adds r0, r5, 0
movs r1, 0x4
- bl sub_80436F8
+ bl AdjustFriendship
ldrh r2, [r7]
movs r0, 0x4
adds r1, r5, 0
@@ -12920,7 +12920,7 @@ IsHPRecoveryItem: @ 8125018
_0812502C: .4byte gSaveBlock1Ptr
_08125030: .4byte 0x00003108
_08125034:
- ldr r1, _0812504C @ =gUnknown_82528BC
+ ldr r1, _0812504C @ =gItemEffectTable
subs r0, 0xD
lsls r0, 2
adds r0, r1
@@ -12934,7 +12934,7 @@ _0812503E:
movs r0, 0
b _08125052
.align 2, 0
-_0812504C: .4byte gUnknown_82528BC
+_0812504C: .4byte gItemEffectTable
_08125050:
movs r0, 0x1
_08125052:
@@ -13217,7 +13217,7 @@ _081252A0:
adds r1, r5, 0
_081252BA:
adds r3, r6, 0
- bl ExecuteTableBasedItemEffect_
+ bl ExecuteTableBasedItemEffect
lsls r0, 24
lsrs r0, 24
pop {r4-r6}
@@ -13278,7 +13278,7 @@ _08125330:
adds r0, r5, 0
adds r1, r6, 0
movs r3, 0
- bl sub_8042414
+ bl PokemonUseItemEffects2
lsls r0, 24
lsrs r4, r0, 24
_08125342:
@@ -13749,7 +13749,7 @@ _08125710: .4byte gUnknown_203AD30
_08125714: .4byte gSaveBlock1Ptr
_08125718: .4byte 0x00003108
_0812571C:
- ldr r1, _0812574C @ =gUnknown_82528BC
+ ldr r1, _0812574C @ =gItemEffectTable
subs r0, 0xD
lsls r0, 2
adds r0, r1
@@ -13773,7 +13773,7 @@ _08125726:
bl sub_8125958
b _0812577E
.align 2, 0
-_0812574C: .4byte gUnknown_82528BC
+_0812574C: .4byte gItemEffectTable
_08125750: .4byte gUnknown_203B0A0
_08125754:
adds r0, r4, 0
@@ -13882,7 +13882,7 @@ sub_812580C: @ 812580C
ldrh r1, [r1]
ldrb r2, [r3, 0x9]
ldrb r3, [r3, 0xE]
- bl sub_8042414
+ bl PokemonUseItemEffects2
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
@@ -14399,7 +14399,7 @@ sub_8125C48: @ 8125C48
bne _08125C84
adds r0, r5, 0
movs r1, 0x4
- bl sub_80436F8
+ bl AdjustFriendship
movs r0, 0xA9
lsls r0, 1
cmp r4, r0
@@ -14637,7 +14637,7 @@ sub_8125E4C: @ 8125E4C
ldr r0, _08125E74 @ =gPlayerParty
ldr r4, _08125E78 @ =gUnknown_203B0A0
ldrb r1, [r4, 0x9]
- ldr r2, _08125E7C @ =gUnknown_2024029
+ ldr r2, _08125E7C @ =gPlayerPartyCount
ldrb r2, [r2]
subs r2, 0x1
lsls r2, 24
@@ -14653,7 +14653,7 @@ sub_8125E4C: @ 8125E4C
.align 2, 0
_08125E74: .4byte gPlayerParty
_08125E78: .4byte gUnknown_203B0A0
-_08125E7C: .4byte gUnknown_2024029
+_08125E7C: .4byte gPlayerPartyCount
_08125E80: .4byte sub_8125E84
thumb_func_end sub_8125E4C
@@ -15175,7 +15175,7 @@ dp05_rare_candy: @ 81262AC
adds r0, r4, 0
adds r1, r5, 0
movs r3, 0
- bl sub_8042414
+ bl PokemonUseItemEffects2
lsls r0, 24
lsrs r4, r0, 24
b _081262F6
@@ -15693,7 +15693,7 @@ sub_8126704: @ 8126704
adds r0, r7, 0
movs r1, 0
movs r2, 0
- bl sub_8042EC4
+ bl GetEvolutionTargetSpecies
lsls r0, 16
lsrs r4, r0, 16
cmp r4, 0
@@ -15750,7 +15750,7 @@ sub_8126770: @ 8126770
ldr r1, _081267E4 @ =gStringVar1
bl GetMonNickname
ldr r0, _081267E8 @ =gStringVar2
- ldr r6, _081267EC @ =gUnknown_2024022
+ ldr r6, _081267EC @ =gMoveToLearn
ldrh r2, [r6]
movs r1, 0xD
muls r1, r2
@@ -15786,7 +15786,7 @@ _081267DC: .4byte gUnknown_203B0A0
_081267E0: .4byte gPlayerParty
_081267E4: .4byte gStringVar1
_081267E8: .4byte gStringVar2
-_081267EC: .4byte gUnknown_2024022
+_081267EC: .4byte gMoveToLearn
_081267F0: .4byte gUnknown_8247094
_081267F4: .4byte gStringVar4
_081267F8: .4byte gUnknown_8416DF7
@@ -16210,7 +16210,7 @@ sub_8126B60: @ 8126B60
ldrh r1, [r1]
ldrb r2, [r2, 0x9]
movs r3, 0
- bl sub_8042414
+ bl PokemonUseItemEffects2
lsls r0, 24
cmp r0, 0
beq _08126BC8
@@ -16297,7 +16297,7 @@ sub_8126C24: @ 8126C24
ldr r1, _08126C5C @ =gUnknown_203AD30
ldrh r2, [r1]
movs r1, 0x2
- bl sub_8042EC4
+ bl GetEvolutionTargetSpecies
lsls r0, 16
lsrs r0, 16
cmp r0, 0x97
@@ -16339,7 +16339,7 @@ _08126C7C:
_08126C8C: .4byte gSaveBlock1Ptr
_08126C90: .4byte 0x00003108
_08126C94:
- ldr r1, _08126CC4 @ =gUnknown_82528BC
+ ldr r1, _08126CC4 @ =gItemEffectTable
lsls r0, r2, 2
adds r0, r1
ldr r4, [r0]
@@ -16365,7 +16365,7 @@ _08126CBE:
movs r0, 0
b _08126DC2
.align 2, 0
-_08126CC4: .4byte gUnknown_82528BC
+_08126CC4: .4byte gItemEffectTable
_08126CC8:
movs r2, 0x40
adds r0, r2, 0
@@ -16968,7 +16968,7 @@ sub_812713C: @ 812713C
adds r0, r5, 0
movs r1, 0xC
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
ldrh r0, [r4]
movs r1, 0x1
bl sub_809A1D8
@@ -18220,7 +18220,7 @@ _08127B3C:
b _08127B68
_08127B40:
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08127B62
@@ -18239,7 +18239,7 @@ _08127B62:
lsls r0, 24
lsrs r4, r0, 24
_08127B68:
- ldr r0, _08127B94 @ =gUnknown_2023BCC
+ ldr r0, _08127B94 @ =gBattlersCount
ldrb r0, [r0]
cmp r4, r0
bcc _08127B40
@@ -18259,7 +18259,7 @@ _08127B68:
b _08127C86
.align 2, 0
_08127B90: .4byte gBattlerPartyIndexes
-_08127B94: .4byte gUnknown_2023BCC
+_08127B94: .4byte gBattlersCount
_08127B98: .4byte gPlayerParty
_08127B9C: .4byte gStringVar4
_08127BA0: .4byte gUnknown_8416ACB
@@ -18305,7 +18305,7 @@ _08127BEC:
movs r0, 0x1
strb r0, [r1]
ldr r1, _08127C38 @ =gBattlerPartyIndexes
- ldr r0, _08127C3C @ =gUnknown_2024004
+ ldr r0, _08127C3C @ =gBattlerInMenuId
ldrb r0, [r0]
lsls r0, 1
adds r0, r1
@@ -18328,7 +18328,7 @@ _08127BEC:
_08127C30: .4byte gUnknown_203B0C1
_08127C34: .4byte gUnknown_203B0C0
_08127C38: .4byte gBattlerPartyIndexes
-_08127C3C: .4byte gUnknown_2024004
+_08127C3C: .4byte gBattlerInMenuId
_08127C40:
movs r0, 0x64
muls r0, r5
@@ -18345,7 +18345,7 @@ _08127C58: .4byte gStringVar1
_08127C5C: .4byte gStringVar4
_08127C60: .4byte gUnknown_8416A3A
_08127C64:
- ldr r0, _08127C98 @ =gUnknown_2024004
+ ldr r0, _08127C98 @ =gBattlerInMenuId
ldrb r0, [r0]
ldr r1, _08127C9C @ =gBattlerPartyIndexes
lsls r0, 1
@@ -18371,7 +18371,7 @@ _08127C8C:
pop {r1}
bx r1
.align 2, 0
-_08127C98: .4byte gUnknown_2024004
+_08127C98: .4byte gBattlerInMenuId
_08127C9C: .4byte gBattlerPartyIndexes
_08127CA0: .4byte gStringVar1
_08127CA4: .4byte gStringVar4
@@ -18431,7 +18431,7 @@ _08127D02:
bne _08127D40
movs r5, 0x1
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
mov r2, sp
ldr r1, _08127D3C @ =gBattlerPartyIndexes
lsls r0, 24
@@ -18459,7 +18459,7 @@ _08127D3C: .4byte gBattlerPartyIndexes
_08127D40:
movs r5, 0x2
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
mov r1, sp
ldr r4, _08127DA4 @ =gBattlerPartyIndexes
lsls r0, 24
@@ -18468,7 +18468,7 @@ _08127D40:
ldrh r0, [r0]
strb r0, [r1]
movs r0, 0x2
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
mov r1, sp
lsls r0, 24
lsrs r0, 23
@@ -18545,24 +18545,24 @@ sub_8127DCC: @ 8127DCC
lsrs r7, r1, 24
lsls r0, 24
lsrs r0, 24
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08127DF4
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r4, r0, 24
movs r0, 0x2
b _08127E00
_08127DF4:
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r4, r0, 24
movs r0, 0x3
_08127E00:
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r6, r0, 24
bl sub_811FA20
diff --git a/asm/pokeball.s b/asm/pokeball.s
index 5408e5567..b5d718a13 100644
--- a/asm/pokeball.s
+++ b/asm/pokeball.s
@@ -90,7 +90,7 @@ _0804A9D8:
mov r9, r0
ldrb r6, [r1, 0xE]
adds r0, r6, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _0804AA04
@@ -130,7 +130,7 @@ _0804AA12:
ands r0, r1
cmp r0, 0
beq _0804AA60
- ldr r4, _0804AA5C @ =gUnknown_202273C
+ ldr r4, _0804AA5C @ =gLinkPlayers
adds r0, r6, 0
bl GetBankMultiplayerId
lsls r1, r0, 3
@@ -144,7 +144,7 @@ _0804AA12:
_0804AA50: .4byte gBattlerPartyIndexes
_0804AA54: .4byte gPlayerParty
_0804AA58: .4byte gBattleTypeFlags
-_0804AA5C: .4byte gUnknown_202273C
+_0804AA5C: .4byte gLinkPlayers
_0804AA60:
ldr r0, _0804AAB8 @ =gSaveBlock2Ptr
ldr r0, [r0]
@@ -247,7 +247,7 @@ _0804AB30: .4byte gSprites
_0804AB34: .4byte SpriteCB_OpponentMonSendOut
_0804AB38:
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r1, _0804AB64 @ =gBattlerTarget
strb r0, [r1]
movs r2, 0x1
@@ -1213,7 +1213,7 @@ sub_804B268: @ 804B268
b _0804B420
_0804B2DA:
adds r0, r5, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _0804B310
@@ -1253,13 +1253,13 @@ _0804B324:
lsrs r0, 16
mov r8, r0
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
cmp r5, r0
beq _0804B34E
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
cmp r5, r0
@@ -1323,13 +1323,13 @@ _0804B3C8: .4byte 0x0000ffff
_0804B3CC: .4byte gUnknown_2024018
_0804B3D0:
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
cmp r5, r0
beq _0804B3EC
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
cmp r5, r0
@@ -1858,7 +1858,7 @@ _0804B7C8:
movs r0, 0x3A
ldrsh r4, [r5, r0]
movs r0, 0x2
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
cmp r4, r0
@@ -1935,7 +1935,7 @@ SpriteCB_OpponentMonSendOut: @ 804B868
movs r0, 0x3A
ldrsh r4, [r5, r0]
movs r0, 0x3
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
cmp r4, r0
@@ -2612,7 +2612,7 @@ sub_804BD94: @ 804BD94
ldr r0, _0804BE1C @ =sub_804BE48
str r0, [r4, 0x1C]
adds r0, r5, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _0804BDE2
@@ -2641,7 +2641,7 @@ _0804BDE2:
ldr r1, [r1]
bl _call_via_r1
adds r0, r5, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x2
@@ -2856,7 +2856,7 @@ GetBankPokeballItemId: @ 804BF90
lsls r0, 24
lsrs r4, r0, 24
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _0804BFBC
diff --git a/asm/pokedex_screen.s b/asm/pokedex_screen.s
index 9cd8b78f0..280cda46d 100644
--- a/asm/pokedex_screen.s
+++ b/asm/pokedex_screen.s
@@ -1967,7 +1967,7 @@ _0810356C:
lsrs r0, 16
movs r1, 0xB
muls r0, r1
- ldr r1, _081035C0 @ =gUnknown_8245EE0
+ ldr r1, _081035C0 @ =gSpeciesNames
adds r0, r1
str r0, [r2]
mov r10, r5
@@ -1975,7 +1975,7 @@ _0810356C:
b _081035D6
.align 2, 0
_081035BC: .4byte gUnknown_203ACF0
-_081035C0: .4byte gUnknown_8245EE0
+_081035C0: .4byte gSpeciesNames
_081035C4:
ldr r2, _081035FC @ =gUnknown_203ACF0
ldr r0, [r2]
@@ -2048,7 +2048,7 @@ _0810360C:
lsrs r0, 16
movs r1, 0xB
muls r0, r1
- ldr r1, _08103698 @ =gUnknown_8245EE0
+ ldr r1, _08103698 @ =gSpeciesNames
adds r0, r1
str r0, [r2]
adds r0, r5, 0
@@ -2080,7 +2080,7 @@ _08103682:
.align 2, 0
_08103690: .4byte gUnknown_203ACF0
_08103694: .4byte gUnknown_8443FC0
-_08103698: .4byte gUnknown_8245EE0
+_08103698: .4byte gSpeciesNames
_0810369C:
movs r1, 0
mov r8, r1
@@ -2124,7 +2124,7 @@ _081036A4:
lsrs r0, 16
movs r1, 0xB
muls r0, r1
- ldr r1, _08103738 @ =gUnknown_8245EE0
+ ldr r1, _08103738 @ =gSpeciesNames
adds r0, r1
str r0, [r2]
adds r0, r5, 0
@@ -2156,7 +2156,7 @@ _08103722:
.align 2, 0
_08103730: .4byte gUnknown_203ACF0
_08103734: .4byte gUnknown_84448FE
-_08103738: .4byte gUnknown_8245EE0
+_08103738: .4byte gSpeciesNames
_0810373C:
movs r1, 0
mov r8, r1
@@ -2197,7 +2197,7 @@ _08103744:
lsrs r0, 16
movs r1, 0xB
muls r0, r1
- ldr r1, _081037D0 @ =gUnknown_8245EE0
+ ldr r1, _081037D0 @ =gSpeciesNames
adds r0, r1
str r0, [r2]
adds r0, r5, 0
@@ -2228,7 +2228,7 @@ _081037BA:
.align 2, 0
_081037C8: .4byte gUnknown_203ACF0
_081037CC: .4byte gUnknown_84442F6
-_081037D0: .4byte gUnknown_8245EE0
+_081037D0: .4byte gSpeciesNames
_081037D4: .4byte 0x00000181
_081037D8:
movs r1, 0
@@ -2270,7 +2270,7 @@ _081037E0:
lsrs r0, 16
movs r1, 0xB
muls r0, r1
- ldr r1, _0810386C @ =gUnknown_8245EE0
+ ldr r1, _0810386C @ =gSpeciesNames
adds r0, r1
str r0, [r2]
adds r0, r5, 0
@@ -2301,7 +2301,7 @@ _08103856:
.align 2, 0
_08103864: .4byte gUnknown_203ACF0
_08103868: .4byte gUnknown_84445FA
-_0810386C: .4byte gUnknown_8245EE0
+_0810386C: .4byte gSpeciesNames
_08103870: .4byte 0x00000181
_08103874:
movs r1, 0
@@ -2338,7 +2338,7 @@ _08103878:
lsrs r0, 16
movs r1, 0xB
muls r0, r1
- ldr r1, _081038CC @ =gUnknown_8245EE0
+ ldr r1, _081038CC @ =gSpeciesNames
adds r0, r1
str r0, [r2]
mov r10, r5
@@ -2346,7 +2346,7 @@ _08103878:
b _081038E2
.align 2, 0
_081038C8: .4byte gUnknown_203ACF0
-_081038CC: .4byte gUnknown_8245EE0
+_081038CC: .4byte gSpeciesNames
_081038D0:
ldr r2, _08103918 @ =gUnknown_203ACF0
ldr r0, [r2]
@@ -4988,7 +4988,7 @@ _08104D72:
movs r1, 0xB
mov r2, r8
muls r2, r1
- ldr r1, _08104E70 @ =gUnknown_8245EE0
+ ldr r1, _08104E70 @ =gSpeciesNames
adds r2, r1
movs r1, 0xD
str r1, [sp]
@@ -5038,7 +5038,7 @@ _08104E60: .4byte gUnknown_203ACF0
_08104E64: .4byte gUnknown_84521CC
_08104E68: .4byte gUnknown_8452334
_08104E6C: .4byte gUnknown_8440124
-_08104E70: .4byte gUnknown_8245EE0
+_08104E70: .4byte gSpeciesNames
_08104E74: .4byte gUnknown_8443600
_08104E78:
ldrb r0, [r1]
@@ -6926,7 +6926,7 @@ sub_8105D64: @ 8105D64
adds r0, r1
ldr r0, [r0]
mov r12, r0
- ldr r7, _08105E18 @ =gUnknown_201C000
+ ldr r7, _08105E18 @ =gDecompressionBuffer
movs r5, 0
movs r1, 0
_08105DA6:
@@ -6988,7 +6988,7 @@ _08105E02:
bx r0
.align 2, 0
_08105E14: .4byte gUnknown_843FAB0
-_08105E18: .4byte gUnknown_201C000
+_08105E18: .4byte gDecompressionBuffer
thumb_func_end sub_8105D64
thumb_func_start sub_8105E1C
@@ -7091,7 +7091,7 @@ sub_8105E1C: @ 8105E1C
ldrh r2, [r1]
movs r1, 0xB
muls r2, r1
- ldr r1, _08105FE0 @ =gUnknown_8245EE0
+ ldr r1, _08105FE0 @ =gSpeciesNames
adds r2, r1
str r5, [sp]
mov r1, r8
@@ -7189,7 +7189,7 @@ _08105FD0: .4byte gUnknown_84521D4
_08105FD4: .4byte gUnknown_203ACF0
_08105FD8: .4byte gUnknown_84521DC
_08105FDC: .4byte gUnknown_84521E4
-_08105FE0: .4byte gUnknown_8245EE0
+_08105FE0: .4byte gSpeciesNames
_08105FE4: .4byte gUnknown_8415FAD
_08105FE8: .4byte gUnknown_8415FB3
_08105FEC:
@@ -7710,7 +7710,7 @@ _08106478:
ldr r3, [sp, 0x1C]
adds r2, r3, 0
muls r2, r1
- ldr r1, _081066B0 @ =gUnknown_8245EE0
+ ldr r1, _081066B0 @ =gSpeciesNames
adds r2, r1
movs r1, 0xC
str r1, [sp]
@@ -7973,7 +7973,7 @@ _08106534:
bl SetOamMatrix
b _081066E2
.align 2, 0
-_081066B0: .4byte gUnknown_8245EE0
+_081066B0: .4byte gSpeciesNames
_081066B4: .4byte gBaseStats
_081066B8: .4byte gUnknown_203ACF0
_081066BC: .4byte gUnknown_8452368
diff --git a/asm/pokemon_1.s b/asm/pokemon_1.s
deleted file mode 100644
index 5a1bd568a..000000000
--- a/asm/pokemon_1.s
+++ /dev/null
@@ -1,2431 +0,0 @@
- .include "asm/macros.inc"
- .include "constants/constants.inc"
-
- .syntax unified
-
- .text
-
- thumb_func_start ZeroBoxMonData
-ZeroBoxMonData: @ 803D97C
- push {lr}
- adds r2, r0, 0
- movs r1, 0
- movs r3, 0
-_0803D984:
- adds r0, r2, r1
- strb r3, [r0]
- adds r1, 0x1
- cmp r1, 0x4F
- bls _0803D984
- pop {r0}
- bx r0
- thumb_func_end ZeroBoxMonData
-
- thumb_func_start ZeroMonData
-ZeroMonData: @ 803D994
- push {r4,lr}
- sub sp, 0x4
- adds r4, r0, 0
- bl ZeroBoxMonData
- movs r0, 0
- str r0, [sp]
- adds r0, r4, 0
- movs r1, 0x37
- mov r2, sp
- bl sub_804037C
- adds r0, r4, 0
- movs r1, 0x38
- mov r2, sp
- bl sub_804037C
- adds r0, r4, 0
- movs r1, 0x39
- mov r2, sp
- bl sub_804037C
- adds r0, r4, 0
- movs r1, 0x3A
- mov r2, sp
- bl sub_804037C
- adds r0, r4, 0
- movs r1, 0x3B
- mov r2, sp
- bl sub_804037C
- adds r0, r4, 0
- movs r1, 0x3C
- mov r2, sp
- bl sub_804037C
- adds r0, r4, 0
- movs r1, 0x3D
- mov r2, sp
- bl sub_804037C
- adds r0, r4, 0
- movs r1, 0x3E
- mov r2, sp
- bl sub_804037C
- adds r0, r4, 0
- movs r1, 0x3F
- mov r2, sp
- bl sub_804037C
- movs r0, 0xFF
- str r0, [sp]
- adds r0, r4, 0
- movs r1, 0x40
- mov r2, sp
- bl sub_804037C
- add sp, 0x4
- pop {r4}
- pop {r0}
- bx r0
- thumb_func_end ZeroMonData
-
- thumb_func_start ZeroPlayerPartyMons
-ZeroPlayerPartyMons: @ 803DA14
- push {r4,r5,lr}
- ldr r4, _0803DA30 @ =gPlayerParty
- movs r0, 0xFA
- lsls r0, 1
- adds r5, r4, r0
-_0803DA1E:
- adds r0, r4, 0
- bl ZeroMonData
- adds r4, 0x64
- cmp r4, r5
- ble _0803DA1E
- pop {r4,r5}
- pop {r0}
- bx r0
- .align 2, 0
-_0803DA30: .4byte gPlayerParty
- thumb_func_end ZeroPlayerPartyMons
-
- thumb_func_start ZeroEnemyPartyMons
-ZeroEnemyPartyMons: @ 803DA34
- push {r4,r5,lr}
- ldr r4, _0803DA50 @ =gEnemyParty
- movs r0, 0xFA
- lsls r0, 1
- adds r5, r4, r0
-_0803DA3E:
- adds r0, r4, 0
- bl ZeroMonData
- adds r4, 0x64
- cmp r4, r5
- ble _0803DA3E
- pop {r4,r5}
- pop {r0}
- bx r0
- .align 2, 0
-_0803DA50: .4byte gEnemyParty
- thumb_func_end ZeroEnemyPartyMons
-
- thumb_func_start CreateMon
-CreateMon: @ 803DA54
- push {r4-r7,lr}
- mov r7, r8
- push {r7}
- sub sp, 0x1C
- mov r8, r0
- adds r6, r1, 0
- ldr r4, [sp, 0x34]
- ldr r7, [sp, 0x38]
- ldr r5, [sp, 0x3C]
- lsls r6, 16
- lsrs r6, 16
- add r0, sp, 0x10
- strb r2, [r0]
- lsls r3, 24
- lsrs r3, 24
- lsls r4, 24
- lsrs r4, 24
- lsls r5, 24
- lsrs r5, 24
- mov r0, r8
- str r3, [sp, 0x18]
- bl ZeroMonData
- str r4, [sp]
- str r7, [sp, 0x4]
- str r5, [sp, 0x8]
- ldr r0, [sp, 0x40]
- str r0, [sp, 0xC]
- mov r0, r8
- adds r1, r6, 0
- add r2, sp, 0x10
- ldrb r2, [r2]
- ldr r3, [sp, 0x18]
- bl CreateBoxMon
- mov r0, r8
- movs r1, 0x38
- add r2, sp, 0x10
- bl sub_804037C
- movs r0, 0xFF
- str r0, [sp, 0x14]
- add r2, sp, 0x14
- mov r0, r8
- movs r1, 0x40
- bl sub_804037C
- mov r0, r8
- bl CalculateMonStats
- add sp, 0x1C
- pop {r3}
- mov r8, r3
- pop {r4-r7}
- pop {r0}
- bx r0
- thumb_func_end CreateMon
-
- thumb_func_start CreateBoxMon
-CreateBoxMon: @ 803DAC4
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x20
- adds r7, r0, 0
- ldr r4, [sp, 0x40]
- ldr r0, [sp, 0x48]
- movs r5, 0xE
- add r5, sp
- strh r1, [r5]
- add r6, sp, 0x10
- strb r2, [r6]
- mov r5, sp
- adds r5, 0x11
- strb r3, [r5]
- lsls r4, 24
- lsrs r4, 24
- lsls r0, 24
- lsrs r0, 24
- mov r10, r0
- adds r0, r7, 0
- bl ZeroBoxMonData
- cmp r4, 0
- beq _0803DB00
- ldr r0, [sp, 0x44]
- str r0, [sp, 0x14]
- b _0803DB14
-_0803DB00:
- bl Random
- adds r4, r0, 0
- bl Random
- lsls r4, 16
- lsrs r4, 16
- lsls r0, 16
- orrs r4, r0
- str r4, [sp, 0x14]
-_0803DB14:
- add r2, sp, 0x14
- adds r0, r7, 0
- movs r1, 0
- bl sub_80404D0
- add r0, sp, 0x18
- mov r9, r0
- add r5, sp, 0xC
- mov r1, r10
- cmp r1, 0x2
- bne _0803DB6C
- ldr r2, _0803DB64 @ =0xffff0000
- mov r8, r2
- ldr r6, _0803DB68 @ =0x0000ffff
-_0803DB30:
- bl Random
- adds r4, r0, 0
- bl Random
- lsls r4, 16
- lsrs r4, 16
- lsls r0, 16
- orrs r4, r0
- str r4, [sp, 0x18]
- adds r1, r4, 0
- mov r3, r8
- ands r1, r3
- lsrs r1, 16
- ands r4, r6
- eors r1, r4
- ldr r2, [sp, 0x14]
- adds r0, r2, 0
- ands r0, r3
- lsrs r0, 16
- eors r1, r0
- ands r2, r6
- eors r1, r2
- cmp r1, 0x7
- bls _0803DB30
- b _0803DB92
- .align 2, 0
-_0803DB64: .4byte 0xffff0000
-_0803DB68: .4byte 0x0000ffff
-_0803DB6C:
- mov r0, r10
- cmp r0, 0x1
- bne _0803DB78
- ldr r0, [sp, 0x4C]
- str r0, [sp, 0x18]
- b _0803DB92
-_0803DB78:
- ldr r0, _0803DCBC @ =gSaveBlock2Ptr
- ldr r2, [r0]
- ldrb r1, [r2, 0xA]
- ldrb r0, [r2, 0xB]
- lsls r0, 8
- orrs r1, r0
- ldrb r0, [r2, 0xC]
- lsls r0, 16
- orrs r1, r0
- ldrb r0, [r2, 0xD]
- lsls r0, 24
- orrs r1, r0
- str r1, [sp, 0x18]
-_0803DB92:
- adds r0, r7, 0
- movs r1, 0x1
- mov r2, r9
- bl sub_80404D0
- adds r0, r7, 0
- bl CalculateBoxMonChecksum
- strh r0, [r5]
- adds r0, r7, 0
- movs r1, 0x9
- adds r2, r5, 0
- bl sub_80404D0
- adds r0, r7, 0
- bl EncryptBoxMon
- mov r0, sp
- ldrh r1, [r0, 0xE]
- bl GetSpeciesName
- adds r0, r7, 0
- movs r1, 0x2
- mov r2, sp
- bl sub_80404D0
- ldr r2, _0803DCC0 @ =gGameLanguage
- adds r0, r7, 0
- movs r1, 0x3
- bl sub_80404D0
- ldr r5, _0803DCBC @ =gSaveBlock2Ptr
- ldr r2, [r5]
- adds r0, r7, 0
- movs r1, 0x7
- bl sub_80404D0
- adds r0, r7, 0
- movs r1, 0xB
- mov r2, sp
- adds r2, 0xE
- bl sub_80404D0
- ldr r4, _0803DCC4 @ =gBaseStats
- mov r2, sp
- ldrh r1, [r2, 0xE]
- lsls r0, r1, 3
- subs r0, r1
- lsls r0, 2
- adds r0, r4
- ldrb r1, [r0, 0x13]
- movs r0, 0xCA
- lsls r0, 1
- adds r2, r1, 0
- muls r2, r0
- mov r3, sp
- ldrb r0, [r3, 0x10]
- lsls r0, 2
- ldr r1, _0803DCC8 @ =gUnknown_8253AE4
- adds r0, r1
- adds r2, r0
- adds r0, r7, 0
- movs r1, 0x19
- bl sub_80404D0
- mov r1, sp
- ldrh r0, [r1, 0xE]
- lsls r2, r0, 3
- subs r2, r0
- lsls r2, 2
- adds r4, 0x12
- adds r2, r4
- adds r0, r7, 0
- movs r1, 0x20
- bl sub_80404D0
- bl sav1_map_get_name
- lsls r0, 24
- lsrs r0, 24
- str r0, [sp, 0x18]
- adds r0, r7, 0
- movs r1, 0x23
- mov r2, r9
- bl sub_80404D0
- adds r0, r7, 0
- movs r1, 0x24
- add r2, sp, 0x10
- bl sub_80404D0
- ldr r2, _0803DCCC @ =gGameVersion
- adds r0, r7, 0
- movs r1, 0x25
- bl sub_80404D0
- movs r0, 0x4
- str r0, [sp, 0x18]
- adds r0, r7, 0
- movs r1, 0x26
- mov r2, r9
- bl sub_80404D0
- ldr r2, [r5]
- adds r2, 0x8
- adds r0, r7, 0
- movs r1, 0x31
- bl sub_80404D0
- mov r2, sp
- ldrb r0, [r2, 0x11]
- cmp r0, 0x1F
- bhi _0803DCD0
- adds r0, r7, 0
- movs r1, 0x27
- adds r2, 0x11
- bl sub_80404D0
- adds r0, r7, 0
- movs r1, 0x28
- mov r2, sp
- adds r2, 0x11
- bl sub_80404D0
- adds r0, r7, 0
- movs r1, 0x29
- mov r2, sp
- adds r2, 0x11
- bl sub_80404D0
- adds r0, r7, 0
- movs r1, 0x2A
- mov r2, sp
- adds r2, 0x11
- bl sub_80404D0
- adds r0, r7, 0
- movs r1, 0x2B
- mov r2, sp
- adds r2, 0x11
- bl sub_80404D0
- adds r0, r7, 0
- movs r1, 0x2C
- mov r2, sp
- adds r2, 0x11
- bl sub_80404D0
- b _0803DD58
- .align 2, 0
-_0803DCBC: .4byte gSaveBlock2Ptr
-_0803DCC0: .4byte gGameLanguage
-_0803DCC4: .4byte gBaseStats
-_0803DCC8: .4byte gUnknown_8253AE4
-_0803DCCC: .4byte gGameVersion
-_0803DCD0:
- bl Random
- lsls r0, 16
- lsrs r0, 16
- str r0, [sp, 0x18]
- movs r3, 0x1F
- mov r8, r3
- ands r0, r3
- str r0, [sp, 0x1C]
- add r4, sp, 0x1C
- adds r0, r7, 0
- movs r1, 0x27
- adds r2, r4, 0
- bl sub_80404D0
- ldr r0, [sp, 0x18]
- movs r6, 0xF8
- lsls r6, 2
- ands r0, r6
- lsrs r0, 5
- str r0, [sp, 0x1C]
- adds r0, r7, 0
- movs r1, 0x28
- adds r2, r4, 0
- bl sub_80404D0
- ldr r0, [sp, 0x18]
- movs r5, 0xF8
- lsls r5, 7
- ands r0, r5
- lsrs r0, 10
- str r0, [sp, 0x1C]
- adds r0, r7, 0
- movs r1, 0x29
- adds r2, r4, 0
- bl sub_80404D0
- bl Random
- lsls r0, 16
- lsrs r0, 16
- str r0, [sp, 0x18]
- mov r1, r8
- ands r0, r1
- str r0, [sp, 0x1C]
- adds r0, r7, 0
- movs r1, 0x2A
- adds r2, r4, 0
- bl sub_80404D0
- ldr r0, [sp, 0x18]
- ands r0, r6
- lsrs r0, 5
- str r0, [sp, 0x1C]
- adds r0, r7, 0
- movs r1, 0x2B
- adds r2, r4, 0
- bl sub_80404D0
- ldr r0, [sp, 0x18]
- ands r0, r5
- lsrs r0, 10
- str r0, [sp, 0x1C]
- adds r0, r7, 0
- movs r1, 0x2C
- adds r2, r4, 0
- bl sub_80404D0
-_0803DD58:
- ldr r2, _0803DD94 @ =gBaseStats
- mov r3, sp
- ldrh r1, [r3, 0xE]
- lsls r0, r1, 3
- subs r0, r1
- lsls r0, 2
- adds r0, r2
- ldrb r0, [r0, 0x17]
- cmp r0, 0
- beq _0803DD7E
- ldr r0, [sp, 0x14]
- movs r1, 0x1
- ands r0, r1
- str r0, [sp, 0x18]
- adds r0, r7, 0
- movs r1, 0x2E
- mov r2, r9
- bl sub_80404D0
-_0803DD7E:
- adds r0, r7, 0
- bl GiveBoxMonInitialMoveset
- add sp, 0x20
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_0803DD94: .4byte gBaseStats
- thumb_func_end CreateBoxMon
-
- thumb_func_start CreateMonWithNature
-CreateMonWithNature: @ 803DD98
- push {r4-r7,lr}
- mov r7, r9
- mov r6, r8
- push {r6,r7}
- sub sp, 0x10
- mov r9, r0
- ldr r0, [sp, 0x2C]
- lsls r1, 16
- lsrs r1, 16
- mov r8, r1
- lsls r2, 24
- lsrs r7, r2, 24
- lsls r3, 24
- lsrs r6, r3, 24
- lsls r0, 24
- lsrs r5, r0, 24
-_0803DDB8:
- bl Random
- adds r4, r0, 0
- bl Random
- lsls r4, 16
- lsrs r4, 16
- lsls r0, 16
- orrs r4, r0
- adds r0, r4, 0
- bl GetNatureFromPersonality
- lsls r0, 24
- lsrs r0, 24
- cmp r5, r0
- bne _0803DDB8
- movs r0, 0x1
- str r0, [sp]
- str r4, [sp, 0x4]
- movs r0, 0
- str r0, [sp, 0x8]
- str r0, [sp, 0xC]
- mov r0, r9
- mov r1, r8
- adds r2, r7, 0
- adds r3, r6, 0
- bl CreateMon
- add sp, 0x10
- pop {r3,r4}
- mov r8, r3
- mov r9, r4
- pop {r4-r7}
- pop {r0}
- bx r0
- thumb_func_end CreateMonWithNature
-
- thumb_func_start CreateMonWithGenderNatureLetter
-CreateMonWithGenderNatureLetter: @ 803DE00
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x18
- str r0, [sp, 0x10]
- ldr r4, [sp, 0x38]
- ldr r5, [sp, 0x3C]
- ldr r0, [sp, 0x40]
- lsls r1, 16
- lsrs r7, r1, 16
- lsls r2, 24
- lsrs r2, 24
- str r2, [sp, 0x14]
- lsls r3, 24
- lsrs r3, 24
- mov r10, r3
- lsls r4, 24
- lsrs r4, 24
- mov r8, r4
- lsls r5, 24
- lsrs r6, r5, 24
- lsls r0, 24
- lsrs r1, r0, 24
- mov r9, r1
- movs r1, 0xFF
- lsls r1, 24
- adds r0, r1
- lsrs r0, 24
- cmp r0, 0x1B
- bhi _0803DEA6
-_0803DE40:
- bl Random
- adds r4, r0, 0
- bl Random
- lsls r4, 16
- lsrs r4, 16
- lsls r0, 16
- orrs r4, r0
- movs r0, 0xC0
- lsls r0, 18
- ands r0, r4
- lsrs r0, 18
- movs r1, 0xC0
- lsls r1, 10
- ands r1, r4
- lsrs r1, 12
- orrs r0, r1
- movs r1, 0xC0
- lsls r1, 2
- ands r1, r4
- lsrs r1, 6
- orrs r0, r1
- movs r1, 0x3
- ands r1, r4
- orrs r0, r1
- movs r1, 0x1C
- bl __umodsi3
- lsls r0, 16
- lsrs r5, r0, 16
- adds r0, r4, 0
- bl GetNatureFromPersonality
- lsls r0, 24
- lsrs r0, 24
- cmp r6, r0
- bne _0803DE40
- adds r0, r7, 0
- adds r1, r4, 0
- bl GetGenderFromSpeciesAndPersonality
- lsls r0, 24
- lsrs r0, 24
- cmp r8, r0
- bne _0803DE40
- mov r0, r9
- subs r0, 0x1
- cmp r5, r0
- bne _0803DE40
- b _0803DED6
-_0803DEA6:
- bl Random
- adds r4, r0, 0
- bl Random
- lsls r4, 16
- lsrs r4, 16
- lsls r0, 16
- orrs r4, r0
- adds r0, r4, 0
- bl GetNatureFromPersonality
- lsls r0, 24
- lsrs r0, 24
- cmp r6, r0
- bne _0803DEA6
- adds r0, r7, 0
- adds r1, r4, 0
- bl GetGenderFromSpeciesAndPersonality
- lsls r0, 24
- lsrs r0, 24
- cmp r8, r0
- bne _0803DEA6
-_0803DED6:
- movs r0, 0x1
- str r0, [sp]
- str r4, [sp, 0x4]
- movs r0, 0
- str r0, [sp, 0x8]
- str r0, [sp, 0xC]
- ldr r0, [sp, 0x10]
- adds r1, r7, 0
- ldr r2, [sp, 0x14]
- mov r3, r10
- bl CreateMon
- 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 CreateMonWithGenderNatureLetter
-
- thumb_func_start CreateMaleMon
-CreateMaleMon: @ 803DF00
- push {r4-r7,lr}
- mov r7, r8
- push {r7}
- sub sp, 0x10
- mov r8, r0
- lsls r1, 16
- lsrs r6, r1, 16
- lsls r2, 24
- lsrs r7, r2, 24
-_0803DF12:
- bl Random
- adds r4, r0, 0
- bl Random
- lsls r4, 16
- lsrs r5, r4, 16
- lsls r0, 16
- orrs r5, r0
- bl Random
- adds r4, r0, 0
- bl Random
- lsls r4, 16
- lsrs r4, 16
- lsls r0, 16
- orrs r4, r0
- adds r0, r6, 0
- adds r1, r4, 0
- bl GetGenderFromSpeciesAndPersonality
- lsls r0, 24
- cmp r0, 0
- bne _0803DF12
- movs r0, 0x1
- str r0, [sp]
- str r4, [sp, 0x4]
- str r0, [sp, 0x8]
- str r5, [sp, 0xC]
- mov r0, r8
- adds r1, r6, 0
- adds r2, r7, 0
- movs r3, 0x20
- bl CreateMon
- add sp, 0x10
- pop {r3}
- mov r8, r3
- pop {r4-r7}
- pop {r0}
- bx r0
- thumb_func_end CreateMaleMon
-
- thumb_func_start CreateMonWithIVsPersonality
-CreateMonWithIVsPersonality: @ 803DF68
- push {r4,lr}
- sub sp, 0x14
- adds r4, r0, 0
- str r3, [sp, 0x10]
- ldr r3, [sp, 0x1C]
- lsls r1, 16
- lsrs r1, 16
- lsls r2, 24
- lsrs r2, 24
- movs r0, 0x1
- str r0, [sp]
- str r3, [sp, 0x4]
- movs r0, 0
- str r0, [sp, 0x8]
- str r0, [sp, 0xC]
- adds r0, r4, 0
- movs r3, 0
- bl CreateMon
- adds r0, r4, 0
- movs r1, 0x42
- add r2, sp, 0x10
- bl sub_804037C
- adds r0, r4, 0
- bl CalculateMonStats
- add sp, 0x14
- pop {r4}
- pop {r0}
- bx r0
- thumb_func_end CreateMonWithIVsPersonality
-
- thumb_func_start CreateMonWithIVsOTID
-CreateMonWithIVsOTID: @ 803DFA8
- push {r4,r5,lr}
- sub sp, 0x10
- adds r5, r0, 0
- adds r4, r3, 0
- ldr r3, [sp, 0x1C]
- lsls r1, 16
- lsrs r1, 16
- lsls r2, 24
- lsrs r2, 24
- movs r0, 0
- str r0, [sp]
- str r0, [sp, 0x4]
- movs r0, 0x1
- str r0, [sp, 0x8]
- str r3, [sp, 0xC]
- adds r0, r5, 0
- movs r3, 0
- bl CreateMon
- adds r0, r5, 0
- movs r1, 0x27
- adds r2, r4, 0
- bl sub_804037C
- adds r2, r4, 0x1
- adds r0, r5, 0
- movs r1, 0x28
- bl sub_804037C
- adds r2, r4, 0x2
- adds r0, r5, 0
- movs r1, 0x29
- bl sub_804037C
- adds r2, r4, 0x3
- adds r0, r5, 0
- movs r1, 0x2A
- bl sub_804037C
- adds r2, r4, 0x4
- adds r0, r5, 0
- movs r1, 0x2B
- bl sub_804037C
- adds r4, 0x5
- adds r0, r5, 0
- movs r1, 0x2C
- adds r2, r4, 0
- bl sub_804037C
- adds r0, r5, 0
- bl CalculateMonStats
- add sp, 0x10
- pop {r4,r5}
- pop {r0}
- bx r0
- thumb_func_end CreateMonWithIVsOTID
-
- thumb_func_start CreateMonWithEVSpread
-CreateMonWithEVSpread: @ 803E01C
- push {r4-r7,lr}
- mov r7, r8
- push {r7}
- sub sp, 0x14
- adds r7, r0, 0
- ldr r0, [sp, 0x2C]
- lsls r1, 16
- lsrs r1, 16
- lsls r2, 24
- lsrs r2, 24
- lsls r3, 24
- lsrs r3, 24
- lsls r0, 24
- lsrs r0, 24
- mov r8, r0
- movs r6, 0
- str r6, [sp]
- str r6, [sp, 0x4]
- str r6, [sp, 0x8]
- str r6, [sp, 0xC]
- adds r0, r7, 0
- bl CreateMon
- mov r4, r8
- movs r1, 0x1
- movs r5, 0x5
-_0803E050:
- adds r0, r4, 0
- ands r0, r1
- cmp r0, 0
- beq _0803E05A
- adds r6, 0x1
-_0803E05A:
- lsrs r4, 1
- subs r5, 0x1
- cmp r5, 0
- bge _0803E050
- movs r0, 0xFF
- lsls r0, 1
- adds r1, r6, 0
- bl __divsi3
- add r1, sp, 0x10
- strh r0, [r1]
- movs r4, 0x1
- movs r5, 0
-_0803E074:
- mov r0, r8
- ands r0, r4
- cmp r0, 0
- beq _0803E088
- adds r1, r5, 0
- adds r1, 0x1A
- adds r0, r7, 0
- add r2, sp, 0x10
- bl sub_804037C
-_0803E088:
- lsls r0, r4, 25
- lsrs r4, r0, 24
- adds r5, 0x1
- cmp r5, 0x5
- ble _0803E074
- adds r0, r7, 0
- bl CalculateMonStats
- add sp, 0x14
- pop {r3}
- mov r8, r3
- pop {r4-r7}
- pop {r0}
- bx r0
- thumb_func_end CreateMonWithEVSpread
-
- thumb_func_start sub_803E0A4
-sub_803E0A4: @ 803E0A4
- push {r4-r7,lr}
- sub sp, 0x14
- adds r7, r0, 0
- adds r6, r1, 0
- ldrh r1, [r6]
- ldrb r2, [r6, 0xC]
- movs r3, 0x1
- str r3, [sp]
- ldr r0, [r6, 0x1C]
- str r0, [sp, 0x4]
- str r3, [sp, 0x8]
- ldr r0, [r6, 0x14]
- str r0, [sp, 0xC]
- adds r0, r7, 0
- movs r3, 0
- bl CreateMon
- movs r5, 0
- adds r4, r6, 0x4
-_0803E0CA:
- ldrh r1, [r4]
- lsls r2, r5, 24
- lsrs r2, 24
- adds r0, r7, 0
- bl SetMonMoveSlot
- adds r4, 0x2
- adds r5, 0x1
- cmp r5, 0x3
- ble _0803E0CA
- adds r2, r6, 0
- adds r2, 0xD
- adds r0, r7, 0
- movs r1, 0x15
- bl sub_804037C
- adds r2, r6, 0x2
- adds r0, r7, 0
- movs r1, 0xC
- bl sub_804037C
- adds r2, r6, 0
- adds r2, 0x20
- adds r0, r7, 0
- movs r1, 0x2
- bl sub_804037C
- adds r2, r6, 0
- adds r2, 0x2B
- adds r0, r7, 0
- movs r1, 0x20
- bl sub_804037C
- adds r2, r6, 0
- adds r2, 0xE
- adds r0, r7, 0
- movs r1, 0x1A
- bl sub_804037C
- adds r2, r6, 0
- adds r2, 0xF
- adds r0, r7, 0
- movs r1, 0x1B
- bl sub_804037C
- adds r2, r6, 0
- adds r2, 0x10
- adds r0, r7, 0
- movs r1, 0x1C
- bl sub_804037C
- adds r2, r6, 0
- adds r2, 0x11
- adds r0, r7, 0
- movs r1, 0x1D
- bl sub_804037C
- adds r2, r6, 0
- adds r2, 0x12
- adds r0, r7, 0
- movs r1, 0x1E
- bl sub_804037C
- adds r2, r6, 0
- adds r2, 0x13
- adds r0, r7, 0
- movs r1, 0x1F
- bl sub_804037C
- ldrb r0, [r6, 0x1B]
- lsrs r0, 7
- add r1, sp, 0x10
- strb r0, [r1]
- adds r0, r7, 0
- movs r1, 0x2E
- add r2, sp, 0x10
- bl sub_804037C
- add r1, sp, 0x10
- ldrb r0, [r6, 0x18]
- lsls r0, 27
- lsrs r0, 27
- strb r0, [r1]
- adds r0, r7, 0
- movs r1, 0x27
- add r2, sp, 0x10
- bl sub_804037C
- add r1, sp, 0x10
- ldrh r0, [r6, 0x18]
- lsls r0, 22
- lsrs r0, 27
- strb r0, [r1]
- adds r0, r7, 0
- movs r1, 0x28
- add r2, sp, 0x10
- bl sub_804037C
- add r1, sp, 0x10
- ldrb r0, [r6, 0x19]
- lsls r0, 25
- lsrs r0, 27
- strb r0, [r1]
- adds r0, r7, 0
- movs r1, 0x29
- add r2, sp, 0x10
- bl sub_804037C
- add r1, sp, 0x10
- ldr r0, [r6, 0x18]
- lsls r0, 12
- lsrs r0, 27
- strb r0, [r1]
- adds r0, r7, 0
- movs r1, 0x2A
- add r2, sp, 0x10
- bl sub_804037C
- add r1, sp, 0x10
- ldrh r0, [r6, 0x1A]
- lsls r0, 23
- lsrs r0, 27
- strb r0, [r1]
- adds r0, r7, 0
- movs r1, 0x2B
- add r2, sp, 0x10
- bl sub_804037C
- add r1, sp, 0x10
- ldrb r0, [r6, 0x1B]
- lsls r0, 26
- lsrs r0, 27
- strb r0, [r1]
- adds r0, r7, 0
- movs r1, 0x2C
- add r2, sp, 0x10
- bl sub_804037C
- adds r0, r7, 0
- bl CalculateMonStats
- add sp, 0x14
- pop {r4-r7}
- pop {r0}
- bx r0
- thumb_func_end sub_803E0A4
-
- thumb_func_start sub_803E1EC
-sub_803E1EC: @ 803E1EC
- push {r4-r7,lr}
- mov r7, r8
- push {r7}
- sub sp, 0x14
- mov r8, r0
- ldr r4, [sp, 0x2C]
- ldr r6, [sp, 0x30]
- ldr r5, [sp, 0x34]
- ldr r7, [sp, 0x38]
- lsls r1, 16
- lsrs r1, 16
- lsls r2, 24
- lsrs r2, 24
- lsls r3, 24
- lsrs r3, 24
- lsls r4, 24
- lsrs r4, 24
- lsls r5, 24
- lsrs r5, 24
- movs r0, 0x1
- str r0, [sp, 0x10]
- str r4, [sp]
- str r6, [sp, 0x4]
- str r5, [sp, 0x8]
- str r7, [sp, 0xC]
- mov r0, r8
- bl CreateMon
- mov r0, r8
- movs r1, 0x50
- add r2, sp, 0x10
- bl sub_804037C
- add sp, 0x14
- pop {r3}
- mov r8, r3
- pop {r4-r7}
- pop {r0}
- bx r0
- thumb_func_end sub_803E1EC
-
- thumb_func_start sub_803E23C
-sub_803E23C: @ 803E23C
- push {r4-r7,lr}
- mov r7, r9
- mov r6, r8
- push {r6,r7}
- adds r7, r0, 0
- adds r6, r1, 0
- movs r1, 0xB
- movs r2, 0
- bl GetMonData
- strh r0, [r6]
- adds r0, r7, 0
- movs r1, 0xC
- movs r2, 0
- bl GetMonData
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0xAF
- bne _0803E266
- movs r0, 0
-_0803E266:
- strh r0, [r6, 0x2]
- movs r5, 0
- movs r0, 0x2B
- adds r0, r6
- mov r8, r0
- movs r1, 0x20
- adds r1, r6
- mov r9, r1
- adds r4, r6, 0x4
-_0803E278:
- adds r1, r5, 0
- adds r1, 0xD
- adds r0, r7, 0
- movs r2, 0
- bl GetMonData
- strh r0, [r4]
- adds r4, 0x2
- adds r5, 0x1
- cmp r5, 0x3
- ble _0803E278
- adds r0, r7, 0
- movs r1, 0x38
- movs r2, 0
- bl GetMonData
- strb r0, [r6, 0xC]
- adds r0, r7, 0
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- strb r0, [r6, 0xD]
- adds r0, r7, 0
- movs r1, 0x1
- movs r2, 0
- bl GetMonData
- str r0, [r6, 0x14]
- adds r0, r7, 0
- movs r1, 0x1A
- movs r2, 0
- bl GetMonData
- strb r0, [r6, 0xE]
- adds r0, r7, 0
- movs r1, 0x1B
- movs r2, 0
- bl GetMonData
- strb r0, [r6, 0xF]
- adds r0, r7, 0
- movs r1, 0x1C
- movs r2, 0
- bl GetMonData
- strb r0, [r6, 0x10]
- adds r0, r7, 0
- movs r1, 0x1D
- movs r2, 0
- bl GetMonData
- strb r0, [r6, 0x11]
- adds r0, r7, 0
- movs r1, 0x1E
- movs r2, 0
- bl GetMonData
- strb r0, [r6, 0x12]
- adds r0, r7, 0
- movs r1, 0x1F
- movs r2, 0
- bl GetMonData
- strb r0, [r6, 0x13]
- adds r0, r7, 0
- movs r1, 0x20
- movs r2, 0
- bl GetMonData
- mov r1, r8
- strb r0, [r1]
- adds r0, r7, 0
- movs r1, 0x27
- movs r2, 0
- bl GetMonData
- movs r4, 0x1F
- ands r0, r4
- ldrb r2, [r6, 0x18]
- movs r1, 0x20
- negs r1, r1
- ands r1, r2
- orrs r1, r0
- strb r1, [r6, 0x18]
- adds r0, r7, 0
- movs r1, 0x28
- movs r2, 0
- bl GetMonData
- movs r5, 0x1F
- ands r0, r5
- lsls r0, 5
- ldrh r2, [r6, 0x18]
- ldr r1, _0803E3DC @ =0xfffffc1f
- ands r1, r2
- orrs r1, r0
- strh r1, [r6, 0x18]
- adds r0, r7, 0
- movs r1, 0x29
- movs r2, 0
- bl GetMonData
- ands r0, r4
- lsls r0, 2
- ldrb r2, [r6, 0x19]
- movs r1, 0x7D
- negs r1, r1
- ands r1, r2
- orrs r1, r0
- strb r1, [r6, 0x19]
- adds r0, r7, 0
- movs r1, 0x2A
- movs r2, 0
- bl GetMonData
- movs r1, 0x1F
- ands r1, r0
- lsls r1, 15
- ldr r0, [r6, 0x18]
- ldr r2, _0803E3E0 @ =0xfff07fff
- ands r0, r2
- orrs r0, r1
- str r0, [r6, 0x18]
- adds r0, r7, 0
- movs r1, 0x2B
- movs r2, 0
- bl GetMonData
- ands r0, r5
- lsls r0, 4
- ldrh r2, [r6, 0x1A]
- ldr r1, _0803E3E4 @ =0xfffffe0f
- ands r1, r2
- orrs r1, r0
- strh r1, [r6, 0x1A]
- adds r0, r7, 0
- movs r1, 0x2C
- movs r2, 0
- bl GetMonData
- ands r0, r4
- lsls r0, 1
- ldrb r2, [r6, 0x1B]
- movs r1, 0x3F
- negs r1, r1
- ands r1, r2
- orrs r1, r0
- strb r1, [r6, 0x1B]
- adds r0, r7, 0
- movs r1, 0x2E
- movs r2, 0
- bl GetMonData
- lsls r0, 7
- ldrb r2, [r6, 0x1B]
- movs r1, 0x7F
- ands r1, r2
- orrs r1, r0
- strb r1, [r6, 0x1B]
- adds r0, r7, 0
- movs r1, 0
- movs r2, 0
- bl GetMonData
- str r0, [r6, 0x1C]
- adds r0, r7, 0
- movs r1, 0x2
- mov r2, r9
- bl GetMonData
- pop {r3,r4}
- mov r8, r3
- mov r9, r4
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_0803E3DC: .4byte 0xfffffc1f
-_0803E3E0: .4byte 0xfff07fff
-_0803E3E4: .4byte 0xfffffe0f
- thumb_func_end sub_803E23C
-
- thumb_func_start CalculateBoxMonChecksum
-CalculateBoxMonChecksum: @ 803E3E8
- push {r4-r7,lr}
- mov r7, r8
- push {r7}
- adds r4, r0, 0
- movs r6, 0
- ldr r1, [r4]
- movs r2, 0
- bl GetSubstruct
- adds r5, r0, 0
- ldr r1, [r4]
- adds r0, r4, 0
- movs r2, 0x1
- bl GetSubstruct
- adds r7, r0, 0
- ldr r1, [r4]
- adds r0, r4, 0
- movs r2, 0x2
- bl GetSubstruct
- mov r8, r0
- ldr r1, [r4]
- adds r0, r4, 0
- movs r2, 0x3
- bl GetSubstruct
- adds r3, r0, 0
- movs r1, 0x5
-_0803E422:
- ldrh r0, [r5]
- adds r0, r6, r0
- lsls r0, 16
- lsrs r6, r0, 16
- adds r5, 0x2
- subs r1, 0x1
- cmp r1, 0
- bge _0803E422
- adds r2, r7, 0
- movs r1, 0x5
-_0803E436:
- ldrh r0, [r2]
- adds r0, r6, r0
- lsls r0, 16
- lsrs r6, r0, 16
- adds r2, 0x2
- subs r1, 0x1
- cmp r1, 0
- bge _0803E436
- mov r2, r8
- movs r1, 0x5
-_0803E44A:
- ldrh r0, [r2]
- adds r0, r6, r0
- lsls r0, 16
- lsrs r6, r0, 16
- adds r2, 0x2
- subs r1, 0x1
- cmp r1, 0
- bge _0803E44A
- adds r2, r3, 0
- movs r1, 0x5
-_0803E45E:
- ldrh r0, [r2]
- adds r0, r6, r0
- lsls r0, 16
- lsrs r6, r0, 16
- adds r2, 0x2
- subs r1, 0x1
- cmp r1, 0
- bge _0803E45E
- adds r0, r6, 0
- pop {r3}
- mov r8, r3
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end CalculateBoxMonChecksum
-
- thumb_func_start CalculateMonStats
-CalculateMonStats: @ 803E47C
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x40
- adds r5, r0, 0
- movs r1, 0x3A
- movs r2, 0
- bl GetMonData
- mov r8, r0
- adds r0, r5, 0
- movs r1, 0x39
- movs r2, 0
- bl GetMonData
- str r0, [sp, 0x1C]
- adds r0, r5, 0
- movs r1, 0x27
- movs r2, 0
- bl GetMonData
- adds r6, r0, 0
- adds r0, r5, 0
- movs r1, 0x1A
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- adds r0, r5, 0
- movs r1, 0x28
- movs r2, 0
- bl GetMonData
- mov r10, r0
- adds r0, r5, 0
- movs r1, 0x1B
- movs r2, 0
- bl GetMonData
- mov r9, r0
- adds r0, r5, 0
- movs r1, 0x29
- movs r2, 0
- bl GetMonData
- str r0, [sp, 0x20]
- adds r0, r5, 0
- movs r1, 0x1C
- movs r2, 0
- bl GetMonData
- str r0, [sp, 0x24]
- adds r0, r5, 0
- movs r1, 0x2A
- movs r2, 0
- bl GetMonData
- str r0, [sp, 0x28]
- adds r0, r5, 0
- movs r1, 0x1D
- movs r2, 0
- bl GetMonData
- str r0, [sp, 0x2C]
- adds r0, r5, 0
- movs r1, 0x2B
- movs r2, 0
- bl GetMonData
- str r0, [sp, 0x30]
- adds r0, r5, 0
- movs r1, 0x1E
- movs r2, 0
- bl GetMonData
- str r0, [sp, 0x34]
- adds r0, r5, 0
- movs r1, 0x2C
- movs r2, 0
- bl GetMonData
- str r0, [sp, 0x38]
- adds r0, r5, 0
- movs r1, 0x1F
- movs r2, 0
- bl GetMonData
- str r0, [sp, 0x3C]
- adds r0, r5, 0
- movs r1, 0xB
- movs r2, 0
- bl GetMonData
- lsls r0, 16
- lsrs r7, r0, 16
- adds r0, r5, 0
- bl GetLevelFromMonExp
- lsls r0, 24
- lsrs r0, 24
- str r0, [sp]
- adds r0, r5, 0
- movs r1, 0x38
- mov r2, sp
- bl sub_804037C
- ldr r0, _0803E564 @ =0x0000012f
- cmp r7, r0
- bne _0803E568
- movs r0, 0x1
- str r0, [sp, 0x4]
- lsls r6, r7, 3
- b _0803E596
- .align 2, 0
-_0803E564: .4byte 0x0000012f
-_0803E568:
- ldr r1, _0803E734 @ =gBaseStats
- lsls r2, r7, 3
- subs r0, r2, r7
- lsls r0, 2
- adds r0, r1
- ldrb r0, [r0]
- lsls r0, 1
- adds r1, r0, r6
- adds r0, r4, 0
- adds r6, r2, 0
- cmp r0, 0
- bge _0803E582
- adds r0, 0x3
-_0803E582:
- asrs r0, 2
- adds r0, r1, r0
- ldr r4, [sp]
- muls r0, r4
- movs r1, 0x64
- bl __divsi3
- adds r0, r4
- adds r0, 0xA
- str r0, [sp, 0x4]
-_0803E596:
- ldr r1, _0803E738 @ =gBattleScripting
- add r2, sp, 0x4
- ldrb r0, [r2]
- mov r3, r8
- subs r0, r3
- adds r1, 0x23
- strb r0, [r1]
- lsls r0, 24
- cmp r0, 0
- bne _0803E5AE
- movs r0, 0x1
- strb r0, [r1]
-_0803E5AE:
- adds r0, r5, 0
- movs r1, 0x3A
- bl sub_804037C
- ldr r0, _0803E734 @ =gBaseStats
- subs r1, r6, r7
- lsls r1, 2
- adds r6, r1, r0
- ldrb r0, [r6, 0x1]
- lsls r0, 1
- mov r2, r10
- adds r1, r0, r2
- mov r0, r9
- cmp r0, 0
- bge _0803E5CE
- adds r0, 0x3
-_0803E5CE:
- asrs r0, 2
- adds r0, r1, r0
- ldr r1, [sp]
- muls r0, r1
- movs r1, 0x64
- bl __divsi3
- adds r0, 0x5
- str r0, [sp, 0x8]
- adds r0, r5, 0
- bl GetNature
- lsls r0, 24
- lsrs r0, 24
- add r4, sp, 0x8
- ldrh r1, [r4]
- movs r2, 0x1
- bl nature_stat_mod
- lsls r0, 16
- lsrs r0, 16
- str r0, [sp, 0x8]
- adds r0, r5, 0
- movs r1, 0x3B
- adds r2, r4, 0
- bl sub_804037C
- ldrb r0, [r6, 0x2]
- lsls r0, 1
- ldr r3, [sp, 0x20]
- adds r1, r0, r3
- ldr r0, [sp, 0x24]
- cmp r0, 0
- bge _0803E614
- adds r0, 0x3
-_0803E614:
- asrs r0, 2
- adds r0, r1, r0
- ldr r1, [sp]
- muls r0, r1
- movs r1, 0x64
- bl __divsi3
- adds r0, 0x5
- str r0, [sp, 0xC]
- adds r0, r5, 0
- bl GetNature
- lsls r0, 24
- lsrs r0, 24
- add r4, sp, 0xC
- ldrh r1, [r4]
- movs r2, 0x2
- bl nature_stat_mod
- lsls r0, 16
- lsrs r0, 16
- str r0, [sp, 0xC]
- adds r0, r5, 0
- movs r1, 0x3C
- adds r2, r4, 0
- bl sub_804037C
- ldrb r0, [r6, 0x3]
- lsls r0, 1
- ldr r2, [sp, 0x28]
- adds r1, r0, r2
- ldr r0, [sp, 0x2C]
- cmp r0, 0
- bge _0803E65A
- adds r0, 0x3
-_0803E65A:
- asrs r0, 2
- adds r0, r1, r0
- ldr r1, [sp]
- muls r0, r1
- movs r1, 0x64
- bl __divsi3
- adds r0, 0x5
- str r0, [sp, 0x10]
- adds r0, r5, 0
- bl GetNature
- lsls r0, 24
- lsrs r0, 24
- add r4, sp, 0x10
- ldrh r1, [r4]
- movs r2, 0x3
- bl nature_stat_mod
- lsls r0, 16
- lsrs r0, 16
- str r0, [sp, 0x10]
- adds r0, r5, 0
- movs r1, 0x3D
- adds r2, r4, 0
- bl sub_804037C
- ldrb r0, [r6, 0x4]
- lsls r0, 1
- ldr r3, [sp, 0x30]
- adds r1, r0, r3
- ldr r0, [sp, 0x34]
- cmp r0, 0
- bge _0803E6A0
- adds r0, 0x3
-_0803E6A0:
- asrs r0, 2
- adds r0, r1, r0
- ldr r1, [sp]
- muls r0, r1
- movs r1, 0x64
- bl __divsi3
- adds r0, 0x5
- str r0, [sp, 0x14]
- adds r0, r5, 0
- bl GetNature
- lsls r0, 24
- lsrs r0, 24
- add r4, sp, 0x14
- ldrh r1, [r4]
- movs r2, 0x4
- bl nature_stat_mod
- lsls r0, 16
- lsrs r0, 16
- str r0, [sp, 0x14]
- adds r0, r5, 0
- movs r1, 0x3E
- adds r2, r4, 0
- bl sub_804037C
- ldrb r0, [r6, 0x5]
- lsls r0, 1
- ldr r2, [sp, 0x38]
- adds r1, r0, r2
- ldr r0, [sp, 0x3C]
- cmp r0, 0
- bge _0803E6E6
- adds r0, 0x3
-_0803E6E6:
- asrs r0, 2
- adds r0, r1, r0
- ldr r1, [sp]
- muls r0, r1
- movs r1, 0x64
- bl __divsi3
- adds r0, 0x5
- str r0, [sp, 0x18]
- adds r0, r5, 0
- bl GetNature
- lsls r0, 24
- lsrs r0, 24
- add r4, sp, 0x18
- ldrh r1, [r4]
- movs r2, 0x5
- bl nature_stat_mod
- lsls r0, 16
- lsrs r0, 16
- str r0, [sp, 0x18]
- adds r0, r5, 0
- movs r1, 0x3F
- adds r2, r4, 0
- bl sub_804037C
- ldr r0, _0803E73C @ =0x0000012f
- cmp r7, r0
- bne _0803E740
- ldr r0, [sp, 0x1C]
- cmp r0, 0
- bne _0803E72E
- mov r3, r8
- cmp r3, 0
- bne _0803E764
-_0803E72E:
- movs r0, 0x1
- b _0803E758
- .align 2, 0
-_0803E734: .4byte gBaseStats
-_0803E738: .4byte gBattleScripting
-_0803E73C: .4byte 0x0000012f
-_0803E740:
- ldr r1, [sp, 0x1C]
- cmp r1, 0
- bne _0803E750
- mov r0, r8
- cmp r0, 0
- bne _0803E764
- ldr r0, [sp, 0x4]
- b _0803E758
-_0803E750:
- ldr r0, [sp, 0x4]
- mov r2, r8
- subs r0, r2
- adds r0, r1, r0
-_0803E758:
- str r0, [sp, 0x1C]
- add r2, sp, 0x1C
- adds r0, r5, 0
- movs r1, 0x39
- bl sub_804037C
-_0803E764:
- add sp, 0x40
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- thumb_func_end CalculateMonStats
-
- thumb_func_start BoxMonToMon
-BoxMonToMon: @ 803E774
- push {r4,lr}
- sub sp, 0x4
- adds r2, r0, 0
- adds r4, r1, 0
- movs r0, 0
- str r0, [sp]
- adds r0, r4, 0
- adds r1, r2, 0
- movs r2, 0x50
- bl memcpy
- adds r0, r4, 0
- movs r1, 0x37
- mov r2, sp
- bl sub_804037C
- adds r0, r4, 0
- movs r1, 0x39
- mov r2, sp
- bl sub_804037C
- adds r0, r4, 0
- movs r1, 0x3A
- mov r2, sp
- bl sub_804037C
- movs r0, 0xFF
- str r0, [sp]
- adds r0, r4, 0
- movs r1, 0x40
- mov r2, sp
- bl sub_804037C
- adds r0, r4, 0
- bl CalculateMonStats
- add sp, 0x4
- pop {r4}
- pop {r0}
- bx r0
- thumb_func_end BoxMonToMon
-
- thumb_func_start GetLevelFromMonExp
-GetLevelFromMonExp: @ 803E7C4
- push {r4-r6,lr}
- adds r5, r0, 0
- movs r1, 0xB
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- lsls r4, 16
- lsrs r4, 16
- adds r0, r5, 0
- movs r1, 0x19
- movs r2, 0
- bl GetMonData
- adds r3, r0, 0
- movs r2, 0x1
- ldr r6, _0803E828 @ =gUnknown_8253AE4
- ldr r1, _0803E82C @ =gBaseStats
- lsls r0, r4, 3
- subs r0, r4
- lsls r0, 2
- adds r1, r0, r1
- ldrb r0, [r1, 0x13]
- movs r5, 0xCA
- lsls r5, 1
- muls r0, r5
- adds r0, 0x4
- adds r0, r6
- ldr r0, [r0]
- cmp r0, r3
- bhi _0803E81A
- adds r4, r1, 0
-_0803E804:
- adds r2, 0x1
- cmp r2, 0x64
- bgt _0803E81A
- lsls r1, r2, 2
- ldrb r0, [r4, 0x13]
- muls r0, r5
- adds r1, r0
- adds r1, r6
- ldr r0, [r1]
- cmp r0, r3
- bls _0803E804
-_0803E81A:
- subs r0, r2, 0x1
- lsls r0, 24
- lsrs r0, 24
- pop {r4-r6}
- pop {r1}
- bx r1
- .align 2, 0
-_0803E828: .4byte gUnknown_8253AE4
-_0803E82C: .4byte gBaseStats
- thumb_func_end GetLevelFromMonExp
-
- thumb_func_start GetLevelFromBoxMonExp
-GetLevelFromBoxMonExp: @ 803E830
- push {r4-r6,lr}
- adds r5, r0, 0
- movs r1, 0xB
- movs r2, 0
- bl GetBoxMonData
- adds r4, r0, 0
- lsls r4, 16
- lsrs r4, 16
- adds r0, r5, 0
- movs r1, 0x19
- movs r2, 0
- bl GetBoxMonData
- adds r3, r0, 0
- movs r2, 0x1
- ldr r6, _0803E894 @ =gUnknown_8253AE4
- ldr r1, _0803E898 @ =gBaseStats
- lsls r0, r4, 3
- subs r0, r4
- lsls r0, 2
- adds r1, r0, r1
- ldrb r0, [r1, 0x13]
- movs r5, 0xCA
- lsls r5, 1
- muls r0, r5
- adds r0, 0x4
- adds r0, r6
- ldr r0, [r0]
- cmp r0, r3
- bhi _0803E886
- adds r4, r1, 0
-_0803E870:
- adds r2, 0x1
- cmp r2, 0x64
- bgt _0803E886
- lsls r1, r2, 2
- ldrb r0, [r4, 0x13]
- muls r0, r5
- adds r1, r0
- adds r1, r6
- ldr r0, [r1]
- cmp r0, r3
- bls _0803E870
-_0803E886:
- subs r0, r2, 0x1
- lsls r0, 24
- lsrs r0, 24
- pop {r4-r6}
- pop {r1}
- bx r1
- .align 2, 0
-_0803E894: .4byte gUnknown_8253AE4
-_0803E898: .4byte gBaseStats
- thumb_func_end GetLevelFromBoxMonExp
-
- thumb_func_start GiveMoveToMon
-GiveMoveToMon: @ 803E89C
- push {lr}
- lsls r1, 16
- lsrs r1, 16
- bl GiveMoveToBoxMon
- lsls r0, 16
- lsrs r0, 16
- pop {r1}
- bx r1
- thumb_func_end GiveMoveToMon
-
- thumb_func_start GiveMoveToBoxMon
-GiveMoveToBoxMon: @ 803E8B0
- push {r4-r7,lr}
- sub sp, 0x4
- adds r7, r0, 0
- mov r0, sp
- strh r1, [r0]
- movs r5, 0
- mov r6, sp
-_0803E8BE:
- adds r4, r5, 0
- adds r4, 0xD
- adds r0, r7, 0
- adds r1, r4, 0
- movs r2, 0
- bl GetBoxMonData
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0
- bne _0803E8FC
- adds r0, r7, 0
- adds r1, r4, 0
- mov r2, sp
- bl sub_80404D0
- adds r1, r5, 0
- adds r1, 0x11
- ldrh r0, [r6]
- lsls r2, r0, 1
- adds r2, r0
- lsls r2, 2
- ldr r0, _0803E8F8 @ =gUnknown_8250C08
- adds r2, r0
- adds r0, r7, 0
- bl sub_80404D0
- ldrh r0, [r6]
- b _0803E914
- .align 2, 0
-_0803E8F8: .4byte gUnknown_8250C08
-_0803E8FC:
- ldrh r1, [r6]
- cmp r0, r1
- bne _0803E90C
- ldr r0, _0803E908 @ =0x0000fffe
- b _0803E914
- .align 2, 0
-_0803E908: .4byte 0x0000fffe
-_0803E90C:
- adds r5, 0x1
- cmp r5, 0x3
- ble _0803E8BE
- ldr r0, _0803E91C @ =0x0000ffff
-_0803E914:
- add sp, 0x4
- pop {r4-r7}
- pop {r1}
- bx r1
- .align 2, 0
-_0803E91C: .4byte 0x0000ffff
- thumb_func_end GiveMoveToBoxMon
-
- thumb_func_start GiveMoveToBattleMon
-GiveMoveToBattleMon: @ 803E920
- push {r4,r5,lr}
- lsls r1, 16
- lsrs r4, r1, 16
- movs r3, 0
- adds r5, r0, 0
- adds r5, 0x24
- ldr r2, _0803E94C @ =gBattleMoves
- lsls r1, r4, 1
- adds r1, r4
- lsls r1, 2
- adds r2, r1, r2
- adds r1, r0, 0
- adds r1, 0xC
-_0803E93A:
- ldrh r0, [r1]
- cmp r0, 0
- bne _0803E950
- strh r4, [r1]
- adds r1, r5, r3
- ldrb r0, [r2, 0x4]
- strb r0, [r1]
- adds r0, r4, 0
- b _0803E95A
- .align 2, 0
-_0803E94C: .4byte gBattleMoves
-_0803E950:
- adds r1, 0x2
- adds r3, 0x1
- cmp r3, 0x3
- ble _0803E93A
- ldr r0, _0803E960 @ =0x0000ffff
-_0803E95A:
- pop {r4,r5}
- pop {r1}
- bx r1
- .align 2, 0
-_0803E960: .4byte 0x0000ffff
- thumb_func_end GiveMoveToBattleMon
-
- thumb_func_start SetMonMoveSlot
-SetMonMoveSlot: @ 803E964
- push {r4,r5,lr}
- sub sp, 0x4
- adds r5, r0, 0
- adds r4, r2, 0
- mov r0, sp
- strh r1, [r0]
- lsls r4, 24
- lsrs r4, 24
- adds r1, r4, 0
- adds r1, 0xD
- adds r0, r5, 0
- mov r2, sp
- bl sub_804037C
- adds r4, 0x11
- mov r0, sp
- ldrh r0, [r0]
- lsls r2, r0, 1
- adds r2, r0
- lsls r2, 2
- ldr r0, _0803E9A0 @ =gUnknown_8250C08
- adds r2, r0
- adds r0, r5, 0
- adds r1, r4, 0
- bl sub_804037C
- add sp, 0x4
- pop {r4,r5}
- pop {r0}
- bx r0
- .align 2, 0
-_0803E9A0: .4byte gUnknown_8250C08
- thumb_func_end SetMonMoveSlot
-
- thumb_func_start SetBattleMonMoveSlot
-SetBattleMonMoveSlot: @ 803E9A4
- push {r4,lr}
- lsls r1, 16
- lsrs r1, 16
- lsls r2, 24
- lsrs r2, 24
- lsls r4, r2, 1
- adds r3, r0, 0
- adds r3, 0xC
- adds r3, r4
- strh r1, [r3]
- adds r0, 0x24
- adds r0, r2
- ldr r3, _0803E9D0 @ =gBattleMoves
- lsls r2, r1, 1
- adds r2, r1
- lsls r2, 2
- adds r2, r3
- ldrb r1, [r2, 0x4]
- strb r1, [r0]
- pop {r4}
- pop {r0}
- bx r0
- .align 2, 0
-_0803E9D0: .4byte gBattleMoves
- thumb_func_end SetBattleMonMoveSlot
-
- thumb_func_start GiveMonInitialMoveset
-GiveMonInitialMoveset: @ 803E9D4
- push {lr}
- bl GiveBoxMonInitialMoveset
- pop {r0}
- bx r0
- thumb_func_end GiveMonInitialMoveset
-
- thumb_func_start GiveBoxMonInitialMoveset
-GiveBoxMonInitialMoveset: @ 803E9E0
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x4
- mov r8, r0
- movs r1, 0xB
- movs r2, 0
- bl GetBoxMonData
- adds r4, r0, 0
- lsls r4, 16
- lsrs r4, 16
- mov r0, r8
- bl GetLevelFromBoxMonExp
- lsls r0, 24
- lsrs r0, 24
- mov r10, r0
- ldr r0, _0803EA7C @ =gUnknown_825D7B4
- lsls r6, r4, 2
- adds r0, r6, r0
- ldr r0, [r0]
- ldrh r1, [r0]
- ldr r2, _0803EA80 @ =0xffff0000
- lsrs r0, r2, 16
- cmp r1, r0
- beq _0803EA6C
- mov r9, r2
- movs r3, 0
-_0803EA1E:
- ldr r0, _0803EA7C @ =gUnknown_825D7B4
- adds r7, r6, r0
- ldr r0, [r7]
- adds r0, r3, r0
- ldrh r2, [r0]
- movs r1, 0xFE
- lsls r1, 8
- adds r0, r1, 0
- ands r0, r2
- mov r4, r10
- lsls r1, r4, 9
- cmp r0, r1
- bgt _0803EA6C
- ldr r1, _0803EA84 @ =0x000001ff
- adds r0, r1, 0
- adds r4, r0, 0
- ands r4, r2
- mov r0, r8
- adds r1, r4, 0
- str r3, [sp]
- bl GiveMoveToBoxMon
- lsls r0, 16
- mov r1, r9
- lsrs r5, r1, 16
- ldr r3, [sp]
- cmp r0, r9
- bne _0803EA60
- mov r0, r8
- adds r1, r4, 0
- bl DeleteFirstMoveAndGiveMoveToBoxMon
- ldr r3, [sp]
-_0803EA60:
- adds r3, 0x2
- ldr r0, [r7]
- adds r0, r3, r0
- ldrh r0, [r0]
- cmp r0, r5
- bne _0803EA1E
-_0803EA6C:
- add sp, 0x4
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_0803EA7C: .4byte gUnknown_825D7B4
-_0803EA80: .4byte 0xffff0000
-_0803EA84: .4byte 0x000001ff
- thumb_func_end GiveBoxMonInitialMoveset
-
- thumb_func_start MonTryLearningNewMove
-MonTryLearningNewMove: @ 803EA88
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x4
- mov r8, r0
- lsls r4, r1, 24
- lsrs r4, 24
- movs r0, 0
- str r0, [sp]
- mov r0, r8
- movs r1, 0xB
- movs r2, 0
- bl GetMonData
- lsls r0, 16
- lsrs r0, 16
- mov r9, r0
- mov r0, r8
- movs r1, 0x38
- movs r2, 0
- bl GetMonData
- lsls r0, 24
- lsrs r0, 24
- mov r10, r0
- cmp r4, 0
- beq _0803EB20
- ldr r4, _0803EB0C @ =gUnknown_2024028
- mov r1, sp
- ldrb r1, [r1]
- strb r1, [r4]
- ldr r2, _0803EB10 @ =gUnknown_825D7B4
- mov r5, r9
- lsls r3, r5, 2
- adds r5, r3, r2
- ldr r0, [r5]
- ldrh r1, [r0]
- movs r7, 0xFE
- lsls r7, 8
- adds r0, r7, 0
- ands r0, r1
- adds r6, r4, 0
- mov r12, r2
- mov r1, r10
- lsls r4, r1, 9
- cmp r0, r4
- beq _0803EB48
- adds r2, r6, 0
- ldr r0, _0803EB14 @ =0x0000ffff
- mov r12, r0
- adds r6, r7, 0
- adds r3, r5, 0
-_0803EAF4:
- ldrb r0, [r2]
- adds r0, 0x1
- strb r0, [r2]
- ldrb r0, [r2]
- ldr r1, [r3]
- lsls r0, 1
- adds r0, r1
- ldrh r1, [r0]
- cmp r1, r12
- bne _0803EB18
- movs r0, 0
- b _0803EB74
- .align 2, 0
-_0803EB0C: .4byte gUnknown_2024028
-_0803EB10: .4byte gUnknown_825D7B4
-_0803EB14: .4byte 0x0000ffff
-_0803EB18:
- adds r0, r6, 0
- ands r0, r1
- cmp r0, r4
- bne _0803EAF4
-_0803EB20:
- ldr r3, _0803EB84 @ =gUnknown_825D7B4
- mov r1, r9
- lsls r4, r1, 2
- adds r1, r4, r3
- ldr r2, _0803EB88 @ =gUnknown_2024028
- ldrb r0, [r2]
- ldr r1, [r1]
- lsls r0, 1
- adds r0, r1
- ldrh r1, [r0]
- movs r0, 0xFE
- lsls r0, 8
- ands r0, r1
- mov r5, r10
- lsls r1, r5, 9
- adds r6, r2, 0
- mov r12, r3
- adds r3, r4, 0
- cmp r0, r1
- bne _0803EB72
-_0803EB48:
- ldr r2, _0803EB8C @ =gUnknown_2024022
- mov r0, r12
- adds r1, r3, r0
- ldrb r0, [r6]
- ldr r1, [r1]
- lsls r0, 1
- adds r0, r1
- ldrh r1, [r0]
- ldr r0, _0803EB90 @ =0x000001ff
- ands r0, r1
- strh r0, [r2]
- ldrb r0, [r6]
- adds r0, 0x1
- strb r0, [r6]
- ldrh r1, [r2]
- mov r0, r8
- bl GiveMoveToMon
- lsls r0, 16
- lsrs r0, 16
- str r0, [sp]
-_0803EB72:
- ldr r0, [sp]
-_0803EB74:
- add sp, 0x4
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r1}
- bx r1
- .align 2, 0
-_0803EB84: .4byte gUnknown_825D7B4
-_0803EB88: .4byte gUnknown_2024028
-_0803EB8C: .4byte gUnknown_2024022
-_0803EB90: .4byte 0x000001ff
- thumb_func_end MonTryLearningNewMove
-
- thumb_func_start DeleteFirstMoveAndGiveMoveToMon
-DeleteFirstMoveAndGiveMoveToMon: @ 803EB94
- push {r4-r7,lr}
- mov r7, r9
- mov r6, r8
- push {r6,r7}
- sub sp, 0x10
- adds r6, r0, 0
- lsls r1, 16
- lsrs r1, 16
- mov r8, r1
- movs r4, 0
- add r7, sp, 0x8
- add r0, sp, 0xC
- mov r9, r0
- mov r5, sp
-_0803EBB0:
- adds r1, r4, 0
- adds r1, 0xE
- adds r0, r6, 0
- movs r2, 0
- bl GetMonData
- strh r0, [r5]
- adds r1, r4, 0
- adds r1, 0x12
- adds r0, r6, 0
- movs r2, 0
- bl GetMonData
- adds r1, r7, r4
- strb r0, [r1]
- adds r5, 0x2
- adds r4, 0x1
- cmp r4, 0x2
- ble _0803EBB0
- adds r0, r6, 0
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- mov r1, r9
- strb r0, [r1]
- ldrb r0, [r1]
- lsrs r0, 2
- strb r0, [r1]
- mov r0, sp
- mov r2, r8
- strh r2, [r0, 0x6]
- ldr r1, _0803EC3C @ =gBattleMoves
- mov r2, r8
- lsls r0, r2, 1
- add r0, r8
- lsls r0, 2
- adds r0, r1
- ldrb r0, [r0, 0x4]
- strb r0, [r7, 0x3]
- movs r4, 0
- mov r5, sp
-_0803EC04:
- adds r1, r4, 0
- adds r1, 0xD
- adds r0, r6, 0
- adds r2, r5, 0
- bl sub_804037C
- adds r1, r4, 0
- adds r1, 0x11
- adds r2, r7, r4
- adds r0, r6, 0
- bl sub_804037C
- adds r5, 0x2
- adds r4, 0x1
- cmp r4, 0x3
- ble _0803EC04
- adds r0, r6, 0
- movs r1, 0x15
- mov r2, r9
- bl sub_804037C
- add sp, 0x10
- pop {r3,r4}
- mov r8, r3
- mov r9, r4
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_0803EC3C: .4byte gBattleMoves
- thumb_func_end DeleteFirstMoveAndGiveMoveToMon
-
- thumb_func_start DeleteFirstMoveAndGiveMoveToBoxMon
-DeleteFirstMoveAndGiveMoveToBoxMon: @ 803EC40
- push {r4-r7,lr}
- mov r7, r9
- mov r6, r8
- push {r6,r7}
- sub sp, 0x10
- adds r6, r0, 0
- lsls r1, 16
- lsrs r1, 16
- mov r8, r1
- movs r4, 0
- add r7, sp, 0x8
- add r0, sp, 0xC
- mov r9, r0
- mov r5, sp
-_0803EC5C:
- adds r1, r4, 0
- adds r1, 0xE
- adds r0, r6, 0
- movs r2, 0
- bl GetBoxMonData
- strh r0, [r5]
- adds r1, r4, 0
- adds r1, 0x12
- adds r0, r6, 0
- movs r2, 0
- bl GetBoxMonData
- adds r1, r7, r4
- strb r0, [r1]
- adds r5, 0x2
- adds r4, 0x1
- cmp r4, 0x2
- ble _0803EC5C
- adds r0, r6, 0
- movs r1, 0x15
- movs r2, 0
- bl GetBoxMonData
- mov r1, r9
- strb r0, [r1]
- ldrb r0, [r1]
- lsrs r0, 2
- strb r0, [r1]
- mov r0, sp
- mov r2, r8
- strh r2, [r0, 0x6]
- ldr r1, _0803ECE8 @ =gBattleMoves
- mov r2, r8
- lsls r0, r2, 1
- add r0, r8
- lsls r0, 2
- adds r0, r1
- ldrb r0, [r0, 0x4]
- strb r0, [r7, 0x3]
- movs r4, 0
- mov r5, sp
-_0803ECB0:
- adds r1, r4, 0
- adds r1, 0xD
- adds r0, r6, 0
- adds r2, r5, 0
- bl sub_80404D0
- adds r1, r4, 0
- adds r1, 0x11
- adds r2, r7, r4
- adds r0, r6, 0
- bl sub_80404D0
- adds r5, 0x2
- adds r4, 0x1
- cmp r4, 0x3
- ble _0803ECB0
- adds r0, r6, 0
- movs r1, 0x15
- mov r2, r9
- bl sub_80404D0
- add sp, 0x10
- pop {r3,r4}
- mov r8, r3
- mov r9, r4
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_0803ECE8: .4byte gBattleMoves
- thumb_func_end DeleteFirstMoveAndGiveMoveToBoxMon
-
- .align 2, 0 @ Don't pad with nop.
diff --git a/asm/pokemon_2.s b/asm/pokemon_2.s
deleted file mode 100644
index 22246bf87..000000000
--- a/asm/pokemon_2.s
+++ /dev/null
@@ -1,3902 +0,0 @@
- .include "asm/macros.inc"
- .include "constants/constants.inc"
-
- .syntax unified
-
- .text
-
- thumb_func_start sub_803F5B4
-sub_803F5B4: @ 803F5B4
- push {r4-r6,lr}
- lsls r0, 24
- lsrs r0, 24
- adds r1, r0, 0
- movs r6, 0
- cmp r0, 0x1
- beq _0803F608
- cmp r0, 0x1
- bgt _0803F5CC
- cmp r0, 0
- beq _0803F5D2
- b _0803F68A
-_0803F5CC:
- cmp r1, 0x2
- beq _0803F650
- b _0803F68A
-_0803F5D2:
- movs r5, 0
- ldr r0, _0803F5FC @ =gActiveBattler
- ldrb r3, [r0]
- ldr r4, _0803F600 @ =gAbsentBattlerFlags
- ldr r2, _0803F604 @ =gBitTable
-_0803F5DC:
- cmp r5, r3
- beq _0803F5F0
- ldrb r0, [r4]
- ldr r1, [r2]
- ands r0, r1
- cmp r0, 0
- bne _0803F5F0
- adds r0, r6, 0x1
- lsls r0, 24
- lsrs r6, r0, 24
-_0803F5F0:
- adds r2, 0x4
- adds r5, 0x1
- cmp r5, 0x3
- ble _0803F5DC
- b _0803F68A
- .align 2, 0
-_0803F5FC: .4byte gActiveBattler
-_0803F600: .4byte gAbsentBattlerFlags
-_0803F604: .4byte gBitTable
-_0803F608:
- movs r5, 0
-_0803F60A:
- lsls r0, r5, 24
- lsrs r0, 24
- bl GetBankSide
- adds r4, r0, 0
- ldr r0, _0803F644 @ =sBattler_AI
- ldrb r0, [r0]
- bl GetBankSide
- lsls r4, 24
- lsls r0, 24
- cmp r4, r0
- bne _0803F63C
- ldr r0, _0803F648 @ =gAbsentBattlerFlags
- ldrb r1, [r0]
- ldr r2, _0803F64C @ =gBitTable
- lsls r0, r5, 2
- adds r0, r2
- ldr r0, [r0]
- ands r1, r0
- cmp r1, 0
- bne _0803F63C
- adds r0, r6, 0x1
- lsls r0, 24
- lsrs r6, r0, 24
-_0803F63C:
- adds r5, 0x1
- cmp r5, 0x3
- ble _0803F60A
- b _0803F68A
- .align 2, 0
-_0803F644: .4byte sBattler_AI
-_0803F648: .4byte gAbsentBattlerFlags
-_0803F64C: .4byte gBitTable
-_0803F650:
- movs r5, 0
-_0803F652:
- lsls r0, r5, 24
- lsrs r0, 24
- bl GetBankSide
- adds r4, r0, 0
- ldr r0, _0803F694 @ =gBattlerTarget
- ldrb r0, [r0]
- bl GetBankSide
- lsls r4, 24
- lsls r0, 24
- cmp r4, r0
- bne _0803F684
- ldr r0, _0803F698 @ =gAbsentBattlerFlags
- ldrb r1, [r0]
- ldr r2, _0803F69C @ =gBitTable
- lsls r0, r5, 2
- adds r0, r2
- ldr r0, [r0]
- ands r1, r0
- cmp r1, 0
- bne _0803F684
- adds r0, r6, 0x1
- lsls r0, 24
- lsrs r6, r0, 24
-_0803F684:
- adds r5, 0x1
- cmp r5, 0x3
- ble _0803F652
-_0803F68A:
- adds r0, r6, 0
- pop {r4-r6}
- pop {r1}
- bx r1
- .align 2, 0
-_0803F694: .4byte gBattlerTarget
-_0803F698: .4byte gAbsentBattlerFlags
-_0803F69C: .4byte gBitTable
- thumb_func_end sub_803F5B4
-
- thumb_func_start GetDefaultMoveTarget
-GetDefaultMoveTarget: @ 803F6A0
- push {r4-r6,lr}
- lsls r0, 24
- lsrs r0, 24
- bl GetBankIdentity
- movs r1, 0x1
- movs r6, 0x1
- adds r4, r6, 0
- ands r4, r0
- eors r4, r1
- adds r5, r4, 0
- ldr r0, _0803F6C4 @ =gBattleTypeFlags
- ldr r0, [r0]
- ands r0, r6
- cmp r0, 0
- bne _0803F6C8
- adds r0, r4, 0
- b _0803F712
- .align 2, 0
-_0803F6C4: .4byte gBattleTypeFlags
-_0803F6C8:
- movs r0, 0
- bl sub_803F5B4
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x1
- bls _0803F6EC
- bl Random
- adds r1, r6, 0
- ands r1, r0
- cmp r1, 0
- bne _0803F6E8
- movs r0, 0x2
- eors r0, r4
- b _0803F712
-_0803F6E8:
- adds r0, r4, 0
- b _0803F712
-_0803F6EC:
- ldr r0, _0803F704 @ =gAbsentBattlerFlags
- ldrb r1, [r0]
- ldr r2, _0803F708 @ =gBitTable
- lsls r0, r4, 2
- adds r0, r2
- ldr r0, [r0]
- ands r1, r0
- cmp r1, 0
- bne _0803F70C
- adds r0, r4, 0
- b _0803F712
- .align 2, 0
-_0803F704: .4byte gAbsentBattlerFlags
-_0803F708: .4byte gBitTable
-_0803F70C:
- movs r0, 0x2
- eors r5, r0
- adds r0, r5, 0
-_0803F712:
- bl GetBankByIdentity
- lsls r0, 24
- lsrs r0, 24
- pop {r4-r6}
- pop {r1}
- bx r1
- thumb_func_end GetDefaultMoveTarget
-
- thumb_func_start GetMonGender
-GetMonGender: @ 803F720
- push {lr}
- bl GetBoxMonGender
- lsls r0, 24
- lsrs r0, 24
- pop {r1}
- bx r1
- thumb_func_end GetMonGender
-
- thumb_func_start GetBoxMonGender
-GetBoxMonGender: @ 803F730
- push {r4,r5,lr}
- adds r4, r0, 0
- movs r1, 0xB
- movs r2, 0
- bl GetBoxMonData
- lsls r0, 16
- lsrs r5, r0, 16
- adds r0, r4, 0
- movs r1, 0
- movs r2, 0
- bl GetBoxMonData
- adds r2, r0, 0
- ldr r1, _0803F780 @ =gBaseStats
- lsls r0, r5, 3
- subs r0, r5
- lsls r0, 2
- adds r0, r1
- ldrb r0, [r0, 0x10]
- cmp r0, 0
- beq _0803F786
- cmp r0, 0
- blt _0803F768
- cmp r0, 0xFF
- bgt _0803F768
- cmp r0, 0xFE
- bge _0803F786
-_0803F768:
- ldr r1, _0803F780 @ =gBaseStats
- lsls r0, r5, 3
- subs r0, r5
- lsls r0, 2
- adds r0, r1
- ldrb r1, [r0, 0x10]
- movs r0, 0xFF
- ands r0, r2
- cmp r1, r0
- bhi _0803F784
- movs r0, 0
- b _0803F786
- .align 2, 0
-_0803F780: .4byte gBaseStats
-_0803F784:
- movs r0, 0xFE
-_0803F786:
- pop {r4,r5}
- pop {r1}
- bx r1
- thumb_func_end GetBoxMonGender
-
- thumb_func_start GetGenderFromSpeciesAndPersonality
-GetGenderFromSpeciesAndPersonality: @ 803F78C
- push {lr}
- adds r3, r1, 0
- lsls r0, 16
- lsrs r2, r0, 16
- ldr r1, _0803F7C8 @ =gBaseStats
- lsls r0, r2, 3
- subs r0, r2
- lsls r0, 2
- adds r0, r1
- ldrb r0, [r0, 0x10]
- cmp r0, 0
- beq _0803F7CE
- cmp r0, 0
- blt _0803F7B0
- cmp r0, 0xFF
- bgt _0803F7B0
- cmp r0, 0xFE
- bge _0803F7CE
-_0803F7B0:
- lsls r0, r2, 3
- subs r0, r2
- lsls r0, 2
- adds r0, r1
- ldrb r1, [r0, 0x10]
- movs r0, 0xFF
- ands r0, r3
- cmp r1, r0
- bhi _0803F7CC
- movs r0, 0
- b _0803F7CE
- .align 2, 0
-_0803F7C8: .4byte gBaseStats
-_0803F7CC:
- movs r0, 0xFE
-_0803F7CE:
- pop {r1}
- bx r1
- thumb_func_end GetGenderFromSpeciesAndPersonality
-
- thumb_func_start sub_803F7D4
-sub_803F7D4: @ 803F7D4
- push {r4-r6,lr}
- lsls r0, 16
- lsrs r5, r0, 16
- lsls r1, 24
- lsrs r4, r1, 24
- ldr r0, _0803F808 @ =gUnknown_202401C
- ldr r2, [r0]
- cmp r2, 0
- beq _0803F810
- cmp r4, 0x3
- bls _0803F7EC
- movs r4, 0
-_0803F7EC:
- ldr r0, _0803F80C @ =gUnknown_20244DC
- lsls r1, r4, 1
- adds r1, r4
- lsls r1, 3
- adds r1, r2, r1
- adds r2, r0, 0
- adds r1, 0x14
- ldm r1!, {r3,r4,r6}
- stm r2!, {r3,r4,r6}
- ldm r1!, {r3,r4,r6}
- stm r2!, {r3,r4,r6}
- adds r3, r0, 0
- b _0803F84C
- .align 2, 0
-_0803F808: .4byte gUnknown_202401C
-_0803F80C: .4byte gUnknown_20244DC
-_0803F810:
- ldr r0, _0803F828 @ =gUnknown_20244F4
- ldr r1, [r0]
- cmp r1, 0
- beq _0803F830
- ldrb r0, [r1]
- lsrs r0, 4
- cmp r4, r0
- blt _0803F822
- movs r4, 0
-_0803F822:
- ldr r3, _0803F82C @ =gUnknown_20244DC
- ldr r2, [r1, 0x10]
- b _0803F83A
- .align 2, 0
-_0803F828: .4byte gUnknown_20244F4
-_0803F82C: .4byte gUnknown_20244DC
-_0803F830:
- cmp r4, 0x3
- bls _0803F836
- movs r4, 0
-_0803F836:
- ldr r3, _0803F858 @ =gUnknown_20244DC
- ldr r2, _0803F85C @ =gUnknown_825DEF0
-_0803F83A:
- lsls r0, r4, 1
- adds r0, r4
- lsls r0, 3
- adds r1, r3, 0
- adds r0, r2
- ldm r0!, {r2,r4,r6}
- stm r1!, {r2,r4,r6}
- ldm r0!, {r2,r4,r6}
- stm r1!, {r2,r4,r6}
-_0803F84C:
- strh r5, [r3, 0x2]
- ldr r0, _0803F860 @ =gUnknown_82349BC
- str r0, [r3, 0x8]
- pop {r4-r6}
- pop {r0}
- bx r0
- .align 2, 0
-_0803F858: .4byte gUnknown_20244DC
-_0803F85C: .4byte gUnknown_825DEF0
-_0803F860: .4byte gUnknown_82349BC
- thumb_func_end sub_803F7D4
-
- thumb_func_start sub_803F864
-sub_803F864: @ 803F864
- push {r4-r6,lr}
- lsls r0, 16
- lsrs r4, r0, 16
- lsls r1, 24
- lsrs r3, r1, 24
- ldr r0, _0803F89C @ =gUnknown_20244DC
- strh r4, [r0, 0x2]
- adds r5, r0, 0
- cmp r3, 0
- beq _0803F87C
- cmp r3, 0x2
- bne _0803F8A8
-_0803F87C:
- ldr r2, _0803F8A0 @ =gUnknown_825DF50
- lsls r0, r4, 1
- adds r0, r4
- lsls r0, 3
- adds r1, r5, 0
- adds r0, r2
- ldm r0!, {r2,r3,r6}
- stm r1!, {r2,r3,r6}
- ldm r0!, {r2,r3,r6}
- stm r1!, {r2,r3,r6}
- ldr r1, _0803F8A4 @ =gUnknown_8239F74
- lsls r0, r4, 2
- adds r0, r1
- ldr r0, [r0]
- b _0803F8E8
- .align 2, 0
-_0803F89C: .4byte gUnknown_20244DC
-_0803F8A0: .4byte gUnknown_825DF50
-_0803F8A4: .4byte gUnknown_8239F74
-_0803F8A8:
- ldr r0, _0803F8C8 @ =gUnknown_202401C
- ldr r1, [r0]
- cmp r1, 0
- beq _0803F8CC
- lsls r0, r3, 1
- adds r0, r3
- lsls r0, 3
- adds r0, r1, r0
- adds r1, r5, 0
- adds r0, 0x14
- ldm r0!, {r2,r3,r6}
- stm r1!, {r2,r3,r6}
- ldm r0!, {r2,r3,r6}
- stm r1!, {r2,r3,r6}
- b _0803F8E0
- .align 2, 0
-_0803F8C8: .4byte gUnknown_202401C
-_0803F8CC:
- ldr r0, _0803F8F0 @ =gUnknown_825DEF0
- lsls r1, r3, 1
- adds r1, r3
- lsls r1, 3
- adds r2, r5, 0
- adds r1, r0
- ldm r1!, {r0,r3,r6}
- stm r2!, {r0,r3,r6}
- ldm r1!, {r0,r3,r6}
- stm r2!, {r0,r3,r6}
-_0803F8E0:
- ldr r0, _0803F8F4 @ =gUnknown_82390DC
- lsls r1, r4, 2
- adds r1, r0
- ldr r0, [r1]
-_0803F8E8:
- str r0, [r5, 0x8]
- pop {r4-r6}
- pop {r0}
- bx r0
- .align 2, 0
-_0803F8F0: .4byte gUnknown_825DEF0
-_0803F8F4: .4byte gUnknown_82390DC
- thumb_func_end sub_803F864
-
- thumb_func_start EncryptBoxMon
-EncryptBoxMon: @ 803F8F8
- push {r4,lr}
- adds r3, r0, 0
- movs r4, 0
- adds r2, r3, 0
- adds r2, 0x20
-_0803F902:
- ldr r0, [r2]
- ldr r1, [r3]
- eors r0, r1
- str r0, [r2]
- ldr r1, [r3, 0x4]
- eors r0, r1
- stm r2!, {r0}
- adds r4, 0x1
- cmp r4, 0xB
- bls _0803F902
- pop {r4}
- pop {r0}
- bx r0
- thumb_func_end EncryptBoxMon
-
- thumb_func_start DecryptBoxMon
-DecryptBoxMon: @ 803F91C
- push {r4,lr}
- adds r3, r0, 0
- movs r4, 0
- adds r2, r3, 0
- adds r2, 0x20
-_0803F926:
- ldr r0, [r2]
- ldr r1, [r3, 0x4]
- eors r0, r1
- str r0, [r2]
- ldr r1, [r3]
- eors r0, r1
- stm r2!, {r0}
- adds r4, 0x1
- cmp r4, 0xB
- bls _0803F926
- pop {r4}
- pop {r0}
- bx r0
- thumb_func_end DecryptBoxMon
-
- thumb_func_start GetSubstruct
-GetSubstruct: @ 803F940
- push {r4-r6,lr}
- adds r5, r0, 0
- adds r0, r1, 0
- lsls r2, 24
- lsrs r4, r2, 24
- movs r6, 0
- movs r1, 0x18
- bl __umodsi3
- cmp r0, 0x17
- bls _0803F958
- b _0803FBE0
-_0803F958:
- lsls r0, 2
- ldr r1, _0803F964 @ =_0803F968
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .align 2, 0
-_0803F964: .4byte _0803F968
- .align 2, 0
-_0803F968:
- .4byte _0803F9C8
- .4byte _0803F9EC
- .4byte _0803FA08
- .4byte _0803FA1E
- .4byte _0803FA34
- .4byte _0803FA50
- .4byte _0803FA66
- .4byte _0803FA7C
- .4byte _0803FA8C
- .4byte _0803FAAA
- .4byte _0803FAC2
- .4byte _0803FAD2
- .4byte _0803FAE6
- .4byte _0803FAF8
- .4byte _0803FB0A
- .4byte _0803FB1C
- .4byte _0803FB2E
- .4byte _0803FB40
- .4byte _0803FB52
- .4byte _0803FB68
- .4byte _0803FB7C
- .4byte _0803FB8A
- .4byte _0803FB9C
- .4byte _0803FBB0
-_0803F9C8:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- bne _0803F9D2
- b _0803FBD8
-_0803F9D2:
- cmp r4, 0x1
- bgt _0803F9DE
-_0803F9D6:
- cmp r4, 0
- bne _0803F9DC
- b _0803FBDE
-_0803F9DC:
- b _0803FBE0
-_0803F9DE:
- cmp r4, 0x2
- bne _0803F9E4
- b _0803FBD2
-_0803F9E4:
- cmp r4, 0x3
- beq _0803F9EA
- b _0803FBE0
-_0803F9EA:
- b _0803FBCC
-_0803F9EC:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- bne _0803F9F6
- b _0803FBD8
-_0803F9F6:
- cmp r4, 0x1
- ble _0803F9D6
-_0803F9FA:
- cmp r4, 0x2
- bne _0803FA00
- b _0803FBCC
-_0803FA00:
- cmp r4, 0x3
- beq _0803FA06
- b _0803FBE0
-_0803FA06:
- b _0803FBD2
-_0803FA08:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- bne _0803FA12
- b _0803FBD2
-_0803FA12:
- cmp r4, 0x1
- ble _0803F9D6
- cmp r4, 0x2
- bne _0803FA1C
- b _0803FBD8
-_0803FA1C:
- b _0803F9E4
-_0803FA1E:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- bne _0803FA28
- b _0803FBCC
-_0803FA28:
- cmp r4, 0x1
- ble _0803F9D6
- cmp r4, 0x2
- bne _0803FA32
- b _0803FBD8
-_0803FA32:
- b _0803FA00
-_0803FA34:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- bne _0803FA3E
- b _0803FBD2
-_0803FA3E:
- cmp r4, 0x1
- ble _0803F9D6
-_0803FA42:
- cmp r4, 0x2
- bne _0803FA48
- b _0803FBCC
-_0803FA48:
- cmp r4, 0x3
- beq _0803FA4E
- b _0803FBE0
-_0803FA4E:
- b _0803FBD8
-_0803FA50:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- bne _0803FA5A
- b _0803FBCC
-_0803FA5A:
- cmp r4, 0x1
- ble _0803F9D6
- cmp r4, 0x2
- bne _0803FA64
- b _0803FBD2
-_0803FA64:
- b _0803FA48
-_0803FA66:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- bne _0803FA70
- b _0803FBDE
-_0803FA70:
- cmp r4, 0x1
- bgt _0803F9DE
-_0803FA74:
- cmp r4, 0
- bne _0803FA7A
- b _0803FBD8
-_0803FA7A:
- b _0803FBE0
-_0803FA7C:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- bne _0803FA86
- b _0803FBDE
-_0803FA86:
- cmp r4, 0x1
- ble _0803FA74
- b _0803F9FA
-_0803FA8C:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- bne _0803FA96
- b _0803FBDE
-_0803FA96:
- cmp r4, 0x1
- bgt _0803FAA2
-_0803FA9A:
- cmp r4, 0
- bne _0803FAA0
- b _0803FBD2
-_0803FAA0:
- b _0803FBE0
-_0803FAA2:
- cmp r4, 0x2
- bne _0803FAA8
- b _0803FBD8
-_0803FAA8:
- b _0803F9E4
-_0803FAAA:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- bne _0803FAB4
- b _0803FBDE
-_0803FAB4:
- cmp r4, 0x1
- bgt _0803FABA
- b _0803FBBC
-_0803FABA:
- cmp r4, 0x2
- bne _0803FAC0
- b _0803FBD8
-_0803FAC0:
- b _0803FA00
-_0803FAC2:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- bne _0803FACC
- b _0803FBDE
-_0803FACC:
- cmp r4, 0x1
- ble _0803FA9A
- b _0803FA42
-_0803FAD2:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- bne _0803FADC
- b _0803FBDE
-_0803FADC:
- cmp r4, 0x1
- ble _0803FBBC
- cmp r4, 0x2
- beq _0803FBD2
- b _0803FA48
-_0803FAE6:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- beq _0803FBD2
- cmp r4, 0x1
- ble _0803FA74
- cmp r4, 0x2
- beq _0803FBDE
- b _0803F9E4
-_0803FAF8:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- beq _0803FBCC
- cmp r4, 0x1
- ble _0803FA74
- cmp r4, 0x2
- beq _0803FBDE
- b _0803FA00
-_0803FB0A:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- beq _0803FBD8
- cmp r4, 0x1
- ble _0803FA9A
- cmp r4, 0x2
- beq _0803FBDE
- b _0803F9E4
-_0803FB1C:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- beq _0803FBD8
- cmp r4, 0x1
- ble _0803FBBC
- cmp r4, 0x2
- beq _0803FBDE
- b _0803FA00
-_0803FB2E:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- beq _0803FBCC
- cmp r4, 0x1
- ble _0803FA9A
- cmp r4, 0x2
- beq _0803FBDE
- b _0803FA48
-_0803FB40:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- beq _0803FBD2
- cmp r4, 0x1
- ble _0803FBBC
- cmp r4, 0x2
- beq _0803FBDE
- b _0803FA48
-_0803FB52:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- beq _0803FBD2
- cmp r4, 0x1
- ble _0803FA74
-_0803FB5E:
- cmp r4, 0x2
- beq _0803FBCC
-_0803FB62:
- cmp r4, 0x3
- bne _0803FBE0
- b _0803FBDE
-_0803FB68:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- beq _0803FBCC
- cmp r4, 0x1
- bgt _0803FB76
- b _0803FA74
-_0803FB76:
- cmp r4, 0x2
- beq _0803FBD2
- b _0803FB62
-_0803FB7C:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- beq _0803FBD8
- cmp r4, 0x1
- ble _0803FA9A
- b _0803FB5E
-_0803FB8A:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- beq _0803FBD8
- cmp r4, 0x1
- ble _0803FBBC
- cmp r4, 0x2
- beq _0803FBD2
- b _0803FB62
-_0803FB9C:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- beq _0803FBCC
- cmp r4, 0x1
- bgt _0803FBAA
- b _0803FA9A
-_0803FBAA:
- cmp r4, 0x2
- beq _0803FBD8
- b _0803FB62
-_0803FBB0:
- adds r0, r5, 0
- adds r0, 0x20
- cmp r4, 0x1
- beq _0803FBD2
- cmp r4, 0x1
- bgt _0803FBC2
-_0803FBBC:
- cmp r4, 0
- beq _0803FBCC
- b _0803FBE0
-_0803FBC2:
- cmp r4, 0x2
- beq _0803FBD8
- cmp r4, 0x3
- beq _0803FBDE
- b _0803FBE0
-_0803FBCC:
- adds r6, r5, 0
- adds r6, 0x44
- b _0803FBE0
-_0803FBD2:
- adds r6, r5, 0
- adds r6, 0x38
- b _0803FBE0
-_0803FBD8:
- adds r6, r5, 0
- adds r6, 0x2C
- b _0803FBE0
-_0803FBDE:
- adds r6, r0, 0
-_0803FBE0:
- adds r0, r6, 0
- pop {r4-r6}
- pop {r1}
- bx r1
- thumb_func_end GetSubstruct
-
- thumb_func_start GetMonData
-GetMonData: @ 803FBE8
- push {r4,lr}
- adds r4, r0, 0
- adds r3, r1, 0
- adds r0, r3, 0
- subs r0, 0x37
- cmp r0, 0x21
- bls _0803FBF8
- b _0803FD36
-_0803FBF8:
- lsls r0, 2
- ldr r1, _0803FC04 @ =_0803FC08
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .align 2, 0
-_0803FC04: .4byte _0803FC08
- .align 2, 0
-_0803FC08:
- .4byte _0803FC90
- .4byte _0803FC94
- .4byte _0803FC9C
- .4byte _0803FCA4
- .4byte _0803FCAC
- .4byte _0803FCBE
- .4byte _0803FCD0
- .4byte _0803FCE2
- .4byte _0803FCF4
- .4byte _0803FD2E
- .4byte _0803FD36
- .4byte _0803FD36
- .4byte _0803FD36
- .4byte _0803FD36
- .4byte _0803FD36
- .4byte _0803FD36
- .4byte _0803FD36
- .4byte _0803FD36
- .4byte _0803FD36
- .4byte _0803FD36
- .4byte _0803FD36
- .4byte _0803FD36
- .4byte _0803FD36
- .4byte _0803FD36
- .4byte _0803FD36
- .4byte _0803FD36
- .4byte _0803FD36
- .4byte _0803FD36
- .4byte _0803FD36
- .4byte _0803FD06
- .4byte _0803FD0E
- .4byte _0803FD16
- .4byte _0803FD1E
- .4byte _0803FD26
-_0803FC90:
- ldr r0, [r4, 0x50]
- b _0803FD3E
-_0803FC94:
- adds r0, r4, 0
- adds r0, 0x54
- ldrb r0, [r0]
- b _0803FD3E
-_0803FC9C:
- adds r0, r4, 0
- adds r0, 0x56
- ldrh r0, [r0]
- b _0803FD3E
-_0803FCA4:
- adds r0, r4, 0
- adds r0, 0x58
- ldrh r0, [r0]
- b _0803FD3E
-_0803FCAC:
- adds r0, r4, 0
- movs r1, 0x1
- bl GetDeoxysStat
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0
- bne _0803FD3E
- b _0803FD06
-_0803FCBE:
- adds r0, r4, 0
- movs r1, 0x2
- bl GetDeoxysStat
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0
- bne _0803FD3E
- b _0803FD0E
-_0803FCD0:
- adds r0, r4, 0
- movs r1, 0x3
- bl GetDeoxysStat
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0
- bne _0803FD3E
- b _0803FD16
-_0803FCE2:
- adds r0, r4, 0
- movs r1, 0x4
- bl GetDeoxysStat
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0
- bne _0803FD3E
- b _0803FD1E
-_0803FCF4:
- adds r0, r4, 0
- movs r1, 0x5
- bl GetDeoxysStat
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0
- bne _0803FD3E
- b _0803FD26
-_0803FD06:
- adds r0, r4, 0
- adds r0, 0x5A
- ldrh r0, [r0]
- b _0803FD3E
-_0803FD0E:
- adds r0, r4, 0
- adds r0, 0x5C
- ldrh r0, [r0]
- b _0803FD3E
-_0803FD16:
- adds r0, r4, 0
- adds r0, 0x5E
- ldrh r0, [r0]
- b _0803FD3E
-_0803FD1E:
- adds r0, r4, 0
- adds r0, 0x60
- ldrh r0, [r0]
- b _0803FD3E
-_0803FD26:
- adds r0, r4, 0
- adds r0, 0x62
- ldrh r0, [r0]
- b _0803FD3E
-_0803FD2E:
- adds r0, r4, 0
- adds r0, 0x55
- ldrb r0, [r0]
- b _0803FD3E
-_0803FD36:
- adds r0, r4, 0
- adds r1, r3, 0
- bl GetBoxMonData
-_0803FD3E:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end GetMonData
-
- thumb_func_start GetBoxMonData
-GetBoxMonData: @ 803FD44
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x4
- mov r8, r0
- str r1, [sp]
- adds r6, r2, 0
- movs r4, 0
- mov r9, r4
- mov r10, r4
- movs r7, 0
- movs r5, 0
- cmp r1, 0xA
- ble _0803FDC2
- ldr r1, [r0]
- movs r2, 0
- bl GetSubstruct
- mov r9, r0
- mov r0, r8
- ldr r1, [r0]
- movs r2, 0x1
- bl GetSubstruct
- mov r10, r0
- mov r2, r8
- ldr r1, [r2]
- mov r0, r8
- movs r2, 0x2
- bl GetSubstruct
- adds r7, r0, 0
- mov r0, r8
- ldr r1, [r0]
- movs r2, 0x3
- bl GetSubstruct
- adds r5, r0, 0
- mov r0, r8
- bl DecryptBoxMon
- mov r0, r8
- bl CalculateBoxMonChecksum
- lsls r0, 16
- lsrs r0, 16
- mov r1, r8
- ldrh r1, [r1, 0x1C]
- cmp r0, r1
- beq _0803FDC2
- mov r2, r8
- ldrb r0, [r2, 0x13]
- movs r1, 0x1
- orrs r0, r1
- movs r1, 0x4
- orrs r0, r1
- strb r0, [r2, 0x13]
- ldrb r0, [r5, 0x7]
- movs r1, 0x40
- orrs r0, r1
- strb r0, [r5, 0x7]
-_0803FDC2:
- ldr r0, [sp]
- cmp r0, 0x53
- bls _0803FDCA
- b _0804035C
-_0803FDCA:
- lsls r0, 2
- ldr r1, _0803FDD4 @ =_0803FDD8
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .align 2, 0
-_0803FDD4: .4byte _0803FDD8
- .align 2, 0
-_0803FDD8:
- .4byte _0803FF28
- .4byte _0803FF2E
- .4byte _0803FF34
- .4byte _0803FFE8
- .4byte _0803FFEE
- .4byte _0803FFF4
- .4byte _0803FFFA
- .4byte _08040000
- .4byte _0804001C
- .4byte _08040022
- .4byte _08040028
- .4byte _0804002E
- .4byte _08040046
- .4byte _0804005E
- .4byte _0804005E
- .4byte _0804005E
- .4byte _0804005E
- .4byte _0804006A
- .4byte _0804006A
- .4byte _0804006A
- .4byte _0804006A
- .4byte _08040052
- .4byte _0804008C
- .4byte _08040090
- .4byte _08040094
- .4byte _0804004C
- .4byte _08040074
- .4byte _08040078
- .4byte _0804007C
- .4byte _08040080
- .4byte _08040084
- .4byte _08040088
- .4byte _08040058
- .4byte _08040098
- .4byte _080400A4
- .4byte _080400A8
- .4byte _080400AC
- .4byte _080400B4
- .4byte _080400BC
- .4byte _080400C6
- .4byte _080400CE
- .4byte _080400D6
- .4byte _080400DE
- .4byte _080400E6
- .4byte _080400EE
- .4byte _080400F6
- .4byte _080400FA
- .4byte _0804009C
- .4byte _080400A0
- .4byte _080400C0
- .4byte _08040100
- .4byte _08040108
- .4byte _08040110
- .4byte _08040118
- .4byte _08040120
- .4byte _0804035C
- .4byte _0804035C
- .4byte _0804035C
- .4byte _0804035C
- .4byte _0804035C
- .4byte _0804035C
- .4byte _0804035C
- .4byte _0804035C
- .4byte _0804035C
- .4byte _0804035C
- .4byte _08040186
- .4byte _080401AC
- .4byte _08040128
- .4byte _0804012E
- .4byte _08040132
- .4byte _08040136
- .4byte _0804013A
- .4byte _08040142
- .4byte _0804014A
- .4byte _08040152
- .4byte _0804015A
- .4byte _08040160
- .4byte _08040168
- .4byte _08040170
- .4byte _08040178
- .4byte _08040180
- .4byte _080401E6
- .4byte _08040240
- .4byte _080402C2
-_0803FF28:
- mov r1, r8
- ldr r4, [r1]
- b _0804035C
-_0803FF2E:
- mov r2, r8
- ldr r4, [r2, 0x4]
- b _0804035C
-_0803FF34:
- mov r0, r8
- ldrb r1, [r0, 0x13]
- movs r0, 0x1
- ands r0, r1
- cmp r0, 0
- beq _0803FF6C
- movs r4, 0
- ldr r0, _0803FF68 @ =gUnknown_83FE868
- ldrb r1, [r0]
- adds r2, r0, 0
- cmp r1, 0xFF
- beq _08040014
- adds r3, r2, 0
-_0803FF4E:
- adds r0, r6, r4
- adds r1, r4, r3
- ldrb r1, [r1]
- strb r1, [r0]
- adds r4, 0x1
- cmp r4, 0x9
- bhi _08040014
- adds r0, r4, r2
- ldrb r0, [r0]
- cmp r0, 0xFF
- bne _0803FF4E
- b _08040014
- .align 2, 0
-_0803FF68: .4byte gUnknown_83FE868
-_0803FF6C:
- movs r0, 0x4
- ands r0, r1
- cmp r0, 0
- beq _0803FF8C
- ldr r1, _0803FF88 @ =gUnknown_8415A62
- adds r0, r6, 0
- bl StringCopy
- adds r0, r6, 0
- bl StringLength
- lsls r0, 16
- lsrs r4, r0, 16
- b _0804035C
- .align 2, 0
-_0803FF88: .4byte gUnknown_8415A62
-_0803FF8C:
- mov r1, r8
- ldrb r0, [r1, 0x12]
- cmp r0, 0x1
- bne _0803FFD2
- movs r0, 0xFC
- strb r0, [r6]
- movs r0, 0x15
- strb r0, [r6, 0x1]
- movs r4, 0x2
- movs r3, 0
- ldrb r0, [r1, 0x8]
- cmp r0, 0xFF
- beq _0803FFC0
- mov r2, r8
- adds r2, 0x8
-_0803FFAA:
- adds r1, r6, r4
- ldrb r0, [r2]
- strb r0, [r1]
- adds r4, 0x1
- adds r2, 0x1
- adds r3, 0x1
- cmp r3, 0x5
- bgt _0803FFC0
- ldrb r0, [r2]
- cmp r0, 0xFF
- bne _0803FFAA
-_0803FFC0:
- adds r1, r6, r4
- movs r0, 0xFC
- strb r0, [r1]
- adds r4, 0x1
- adds r1, r6, r4
- movs r0, 0x16
- strb r0, [r1]
- adds r4, 0x1
- b _08040014
-_0803FFD2:
- movs r4, 0
- mov r2, r8
- adds r2, 0x8
-_0803FFD8:
- adds r0, r6, r4
- adds r1, r2, r4
- ldrb r1, [r1]
- strb r1, [r0]
- adds r4, 0x1
- cmp r4, 0x9
- bls _0803FFD8
- b _08040014
-_0803FFE8:
- mov r2, r8
- ldrb r4, [r2, 0x12]
- b _0804035C
-_0803FFEE:
- mov r6, r8
- ldrb r0, [r6, 0x13]
- b _08040162
-_0803FFF4:
- mov r1, r8
- ldrb r0, [r1, 0x13]
- b _0804016A
-_0803FFFA:
- mov r2, r8
- ldrb r0, [r2, 0x13]
- b _08040172
-_08040000:
- movs r4, 0
- mov r2, r8
- adds r2, 0x14
-_08040006:
- adds r0, r6, r4
- adds r1, r2, r4
- ldrb r1, [r1]
- strb r1, [r0]
- adds r4, 0x1
- cmp r4, 0x6
- bls _08040006
-_08040014:
- adds r1, r6, r4
- movs r0, 0xFF
- strb r0, [r1]
- b _0804035C
-_0804001C:
- mov r6, r8
- ldrb r4, [r6, 0x1B]
- b _0804035C
-_08040022:
- mov r0, r8
- ldrh r4, [r0, 0x1C]
- b _0804035C
-_08040028:
- mov r1, r8
- ldrh r4, [r1, 0x1E]
- b _0804035C
-_0804002E:
- mov r2, r8
- ldrb r1, [r2, 0x13]
- movs r0, 0x1
- ands r0, r1
- movs r4, 0xCE
- lsls r4, 1
- cmp r0, 0
- beq _08040040
- b _0804035C
-_08040040:
- mov r6, r9
- ldrh r4, [r6]
- b _0804035C
-_08040046:
- mov r0, r9
- ldrh r4, [r0, 0x2]
- b _0804035C
-_0804004C:
- mov r1, r9
- ldr r4, [r1, 0x4]
- b _0804035C
-_08040052:
- mov r2, r9
- ldrb r4, [r2, 0x8]
- b _0804035C
-_08040058:
- mov r6, r9
- ldrb r4, [r6, 0x9]
- b _0804035C
-_0804005E:
- ldr r0, [sp]
- subs r0, 0xD
- lsls r0, 1
- add r0, r10
- ldrh r4, [r0]
- b _0804035C
-_0804006A:
- ldr r0, [sp]
- add r0, r10
- subs r0, 0x9
- ldrb r4, [r0]
- b _0804035C
-_08040074:
- ldrb r4, [r7]
- b _0804035C
-_08040078:
- ldrb r4, [r7, 0x1]
- b _0804035C
-_0804007C:
- ldrb r4, [r7, 0x2]
- b _0804035C
-_08040080:
- ldrb r4, [r7, 0x3]
- b _0804035C
-_08040084:
- ldrb r4, [r7, 0x4]
- b _0804035C
-_08040088:
- ldrb r4, [r7, 0x5]
- b _0804035C
-_0804008C:
- ldrb r4, [r7, 0x6]
- b _0804035C
-_08040090:
- ldrb r4, [r7, 0x7]
- b _0804035C
-_08040094:
- ldrb r4, [r7, 0x8]
- b _0804035C
-_08040098:
- ldrb r4, [r7, 0x9]
- b _0804035C
-_0804009C:
- ldrb r4, [r7, 0xA]
- b _0804035C
-_080400A0:
- ldrb r4, [r7, 0xB]
- b _0804035C
-_080400A4:
- ldrb r4, [r5]
- b _0804035C
-_080400A8:
- ldrb r4, [r5, 0x1]
- b _0804035C
-_080400AC:
- ldrb r0, [r5, 0x2]
- lsls r0, 25
- lsrs r4, r0, 25
- b _0804035C
-_080400B4:
- ldrh r0, [r5, 0x2]
- lsls r0, 21
- lsrs r4, r0, 28
- b _0804035C
-_080400BC:
- ldrb r0, [r5, 0x3]
- b _0804017A
-_080400C0:
- ldrb r0, [r5, 0x3]
- lsrs r4, r0, 7
- b _0804035C
-_080400C6:
- ldrb r0, [r5, 0x4]
- lsls r0, 27
- lsrs r4, r0, 27
- b _0804035C
-_080400CE:
- ldrh r0, [r5, 0x4]
- lsls r0, 22
- lsrs r4, r0, 27
- b _0804035C
-_080400D6:
- ldrb r0, [r5, 0x5]
- lsls r0, 25
- lsrs r4, r0, 27
- b _0804035C
-_080400DE:
- ldr r0, [r5, 0x4]
- lsls r0, 12
- lsrs r4, r0, 27
- b _0804035C
-_080400E6:
- ldrh r0, [r5, 0x6]
- lsls r0, 23
- lsrs r4, r0, 27
- b _0804035C
-_080400EE:
- ldrb r0, [r5, 0x7]
- lsls r0, 26
- lsrs r4, r0, 27
- b _0804035C
-_080400F6:
- ldrb r0, [r5, 0x7]
- b _08040154
-_080400FA:
- ldrb r0, [r5, 0x7]
- lsrs r4, r0, 7
- b _0804035C
-_08040100:
- ldrb r0, [r5, 0x8]
- lsls r0, 29
- lsrs r4, r0, 29
- b _0804035C
-_08040108:
- ldrb r0, [r5, 0x8]
- lsls r0, 26
- lsrs r4, r0, 29
- b _0804035C
-_08040110:
- ldrh r0, [r5, 0x8]
- lsls r0, 23
- lsrs r4, r0, 29
- b _0804035C
-_08040118:
- ldrb r0, [r5, 0x9]
- lsls r0, 28
- lsrs r4, r0, 29
- b _0804035C
-_08040120:
- ldrb r0, [r5, 0x9]
- lsls r0, 25
- lsrs r4, r0, 29
- b _0804035C
-_08040128:
- ldrb r0, [r5, 0x9]
- lsrs r4, r0, 7
- b _0804035C
-_0804012E:
- ldrb r0, [r5, 0xA]
- b _08040162
-_08040132:
- ldrb r0, [r5, 0xA]
- b _0804016A
-_08040136:
- ldrb r0, [r5, 0xA]
- b _08040172
-_0804013A:
- ldrb r0, [r5, 0xA]
- lsls r0, 28
- lsrs r4, r0, 31
- b _0804035C
-_08040142:
- ldrb r0, [r5, 0xA]
- lsls r0, 27
- lsrs r4, r0, 31
- b _0804035C
-_0804014A:
- ldrb r0, [r5, 0xA]
- lsls r0, 26
- lsrs r4, r0, 31
- b _0804035C
-_08040152:
- ldrb r0, [r5, 0xA]
-_08040154:
- lsls r0, 25
- lsrs r4, r0, 31
- b _0804035C
-_0804015A:
- ldrb r0, [r5, 0xA]
- lsrs r4, r0, 7
- b _0804035C
-_08040160:
- ldrb r0, [r5, 0xB]
-_08040162:
- lsls r0, 31
- lsrs r4, r0, 31
- b _0804035C
-_08040168:
- ldrb r0, [r5, 0xB]
-_0804016A:
- lsls r0, 30
- lsrs r4, r0, 31
- b _0804035C
-_08040170:
- ldrb r0, [r5, 0xB]
-_08040172:
- lsls r0, 29
- lsrs r4, r0, 31
- b _0804035C
-_08040178:
- ldrb r0, [r5, 0xB]
-_0804017A:
- lsls r0, 25
- lsrs r4, r0, 28
- b _0804035C
-_08040180:
- ldrb r0, [r5, 0xB]
- lsrs r4, r0, 7
- b _0804035C
-_08040186:
- mov r0, r9
- ldrh r4, [r0]
- cmp r4, 0
- bne _08040190
- b _0804035C
-_08040190:
- ldrb r0, [r5, 0x7]
- lsls r0, 25
- cmp r0, 0
- blt _080401A6
- mov r2, r8
- ldrb r1, [r2, 0x13]
- movs r0, 0x1
- ands r0, r1
- cmp r0, 0
- bne _080401A6
- b _0804035C
-_080401A6:
- movs r4, 0xCE
- lsls r4, 1
- b _0804035C
-_080401AC:
- ldrb r0, [r5, 0x4]
- lsls r0, 27
- lsrs r4, r0, 27
- ldrh r1, [r5, 0x4]
- movs r0, 0xF8
- lsls r0, 2
- ands r0, r1
- orrs r4, r0
- ldrb r0, [r5, 0x5]
- lsls r0, 25
- lsrs r0, 27
- lsls r0, 10
- orrs r4, r0
- ldr r0, [r5, 0x4]
- movs r1, 0xF8
- lsls r1, 12
- ands r0, r1
- orrs r4, r0
- ldrh r0, [r5, 0x6]
- lsls r0, 23
- lsrs r0, 27
- lsls r0, 20
- orrs r4, r0
- ldrb r0, [r5, 0x7]
- lsls r0, 26
- lsrs r0, 27
- lsls r0, 25
- orrs r4, r0
- b _0804035C
-_080401E6:
- mov r1, r9
- ldrh r0, [r1]
- cmp r0, 0
- bne _080401F0
- b _0804035C
-_080401F0:
- ldrb r0, [r5, 0x7]
- lsls r0, 25
- cmp r0, 0
- bge _080401FA
- b _0804035C
-_080401FA:
- ldrh r0, [r6]
- ldr r1, _08040238 @ =0x00000163
- cmp r0, r1
- bne _08040204
- b _0804035C
-_08040204:
- mov r2, r10
- ldrh r5, [r2]
- adds r7, r1, 0
- adds r2, r6, 0
- ldr r1, _0804023C @ =gBitTable
-_0804020E:
- ldrh r3, [r2]
- cmp r5, r3
- beq _08040228
- mov r6, r10
- ldrh r0, [r6, 0x2]
- cmp r0, r3
- beq _08040228
- ldrh r0, [r6, 0x4]
- cmp r0, r3
- beq _08040228
- ldrh r0, [r6, 0x6]
- cmp r0, r3
- bne _0804022C
-_08040228:
- ldr r0, [r1]
- orrs r4, r0
-_0804022C:
- adds r2, 0x2
- adds r1, 0x4
- ldrh r0, [r2]
- cmp r0, r7
- bne _0804020E
- b _0804035C
- .align 2, 0
-_08040238: .4byte 0x00000163
-_0804023C: .4byte gBitTable
-_08040240:
- movs r4, 0
- mov r1, r9
- ldrh r0, [r1]
- cmp r0, 0
- bne _0804024C
- b _0804035C
-_0804024C:
- ldrb r0, [r5, 0x7]
- lsls r0, 25
- cmp r0, 0
- bge _08040256
- b _0804035C
-_08040256:
- ldrb r0, [r5, 0x8]
- lsls r1, r0, 29
- lsrs r4, r1, 29
- lsls r0, 26
- lsrs r0, 29
- adds r4, r0
- ldrh r0, [r5, 0x8]
- lsls r0, 23
- lsrs r0, 29
- adds r4, r0
- ldrb r1, [r5, 0x9]
- lsls r0, r1, 28
- lsrs r0, 29
- adds r4, r0
- lsls r0, r1, 25
- lsrs r0, 29
- adds r4, r0
- lsrs r1, 7
- adds r4, r1
- ldrb r1, [r5, 0xA]
- lsls r0, r1, 31
- lsrs r0, 31
- adds r4, r0
- lsls r0, r1, 30
- lsrs r0, 31
- adds r4, r0
- lsls r0, r1, 29
- lsrs r0, 31
- adds r4, r0
- lsls r0, r1, 28
- lsrs r0, 31
- adds r4, r0
- lsls r0, r1, 27
- lsrs r0, 31
- adds r4, r0
- lsls r0, r1, 26
- lsrs r0, 31
- adds r4, r0
- lsls r0, r1, 25
- lsrs r0, 31
- adds r4, r0
- lsrs r1, 7
- adds r4, r1
- ldrb r1, [r5, 0xB]
- lsls r0, r1, 31
- lsrs r0, 31
- adds r4, r0
- lsls r0, r1, 30
- lsrs r0, 31
- adds r4, r0
- lsls r1, 29
- lsrs r1, 31
- adds r4, r1
- b _0804035C
-_080402C2:
- movs r4, 0
- mov r2, r9
- ldrh r0, [r2]
- cmp r0, 0
- beq _0804035C
- ldrb r0, [r5, 0x7]
- lsls r0, 25
- cmp r0, 0
- blt _0804035C
- ldrb r2, [r5, 0x9]
- lsrs r4, r2, 7
- ldrb r1, [r5, 0x8]
- lsls r0, r1, 29
- lsrs r0, 28
- orrs r4, r0
- lsls r1, 26
- lsrs r1, 29
- lsls r1, 4
- orrs r4, r1
- ldrh r0, [r5, 0x8]
- lsls r0, 23
- lsrs r0, 29
- lsls r0, 7
- orrs r4, r0
- lsls r0, r2, 28
- lsrs r0, 29
- lsls r0, 10
- orrs r4, r0
- lsls r2, 25
- lsrs r2, 29
- lsls r2, 13
- orrs r4, r2
- ldrb r1, [r5, 0xA]
- lsls r0, r1, 31
- lsrs r0, 31
- lsls r0, 16
- orrs r4, r0
- lsls r0, r1, 30
- lsrs r0, 31
- lsls r0, 17
- orrs r4, r0
- lsls r0, r1, 29
- lsrs r0, 31
- lsls r0, 18
- orrs r4, r0
- lsls r0, r1, 28
- lsrs r0, 31
- lsls r0, 19
- orrs r4, r0
- lsls r0, r1, 27
- lsrs r0, 31
- lsls r0, 20
- orrs r4, r0
- lsls r0, r1, 26
- lsrs r0, 31
- lsls r0, 21
- orrs r4, r0
- lsls r0, r1, 25
- lsrs r0, 31
- lsls r0, 22
- orrs r4, r0
- lsrs r1, 7
- lsls r1, 23
- orrs r4, r1
- ldrb r1, [r5, 0xB]
- lsls r0, r1, 31
- lsrs r0, 31
- lsls r0, 24
- orrs r4, r0
- lsls r0, r1, 30
- lsrs r0, 31
- lsls r0, 25
- orrs r4, r0
- lsls r1, 29
- lsrs r1, 31
- lsls r1, 26
- orrs r4, r1
-_0804035C:
- ldr r6, [sp]
- cmp r6, 0xA
- ble _08040368
- mov r0, r8
- bl EncryptBoxMon
-_08040368:
- adds r0, r4, 0
- add sp, 0x4
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end GetBoxMonData
-
- thumb_func_start sub_804037C
-sub_804037C: @ 804037C
- push {r4,lr}
- adds r3, r0, 0
- adds r4, r1, 0
- adds r0, r4, 0
- subs r0, 0x37
- cmp r0, 0x21
- bls _0804038C
- b _080404C0
-_0804038C:
- lsls r0, 2
- ldr r1, _08040398 @ =_0804039C
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .align 2, 0
-_08040398: .4byte _0804039C
- .align 2, 0
-_0804039C:
- .4byte _08040424
- .4byte _0804043C
- .4byte _08040446
- .4byte _08040456
- .4byte _08040466
- .4byte _08040476
- .4byte _08040486
- .4byte _08040496
- .4byte _080404A6
- .4byte _080404B6
- .4byte _080404C8
- .4byte _080404C0
- .4byte _080404C0
- .4byte _080404C0
- .4byte _080404C0
- .4byte _080404C0
- .4byte _080404C0
- .4byte _080404C0
- .4byte _080404C0
- .4byte _080404C0
- .4byte _080404C0
- .4byte _080404C0
- .4byte _080404C0
- .4byte _080404C0
- .4byte _080404C0
- .4byte _080404C0
- .4byte _080404C0
- .4byte _080404C0
- .4byte _080404C0
- .4byte _08040466
- .4byte _08040476
- .4byte _08040486
- .4byte _08040496
- .4byte _080404A6
-_08040424:
- ldrb r1, [r2]
- ldrb r0, [r2, 0x1]
- lsls r0, 8
- adds r1, r0
- ldrb r0, [r2, 0x2]
- lsls r0, 16
- adds r1, r0
- ldrb r0, [r2, 0x3]
- lsls r0, 24
- adds r1, r0
- str r1, [r3, 0x50]
- b _080404C8
-_0804043C:
- ldrb r1, [r2]
- adds r0, r3, 0
- adds r0, 0x54
- strb r1, [r0]
- b _080404C8
-_08040446:
- ldrb r0, [r2]
- ldrb r1, [r2, 0x1]
- lsls r1, 8
- adds r0, r1
- adds r1, r3, 0
- adds r1, 0x56
- strh r0, [r1]
- b _080404C8
-_08040456:
- ldrb r0, [r2]
- ldrb r1, [r2, 0x1]
- lsls r1, 8
- adds r0, r1
- adds r1, r3, 0
- adds r1, 0x58
- strh r0, [r1]
- b _080404C8
-_08040466:
- ldrb r0, [r2]
- ldrb r1, [r2, 0x1]
- lsls r1, 8
- adds r0, r1
- adds r1, r3, 0
- adds r1, 0x5A
- strh r0, [r1]
- b _080404C8
-_08040476:
- ldrb r0, [r2]
- ldrb r1, [r2, 0x1]
- lsls r1, 8
- adds r0, r1
- adds r1, r3, 0
- adds r1, 0x5C
- strh r0, [r1]
- b _080404C8
-_08040486:
- ldrb r0, [r2]
- ldrb r1, [r2, 0x1]
- lsls r1, 8
- adds r0, r1
- adds r1, r3, 0
- adds r1, 0x5E
- strh r0, [r1]
- b _080404C8
-_08040496:
- ldrb r0, [r2]
- ldrb r1, [r2, 0x1]
- lsls r1, 8
- adds r0, r1
- adds r1, r3, 0
- adds r1, 0x60
- strh r0, [r1]
- b _080404C8
-_080404A6:
- ldrb r0, [r2]
- ldrb r1, [r2, 0x1]
- lsls r1, 8
- adds r0, r1
- adds r1, r3, 0
- adds r1, 0x62
- strh r0, [r1]
- b _080404C8
-_080404B6:
- ldrb r1, [r2]
- adds r0, r3, 0
- adds r0, 0x55
- strb r1, [r0]
- b _080404C8
-_080404C0:
- adds r0, r3, 0
- adds r1, r4, 0
- bl sub_80404D0
-_080404C8:
- pop {r4}
- pop {r0}
- bx r0
- thumb_func_end sub_804037C
-
- thumb_func_start sub_80404D0
-sub_80404D0: @ 80404D0
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- adds r7, r0, 0
- mov r10, r1
- adds r4, r2, 0
- movs r0, 0
- mov r8, r0
- mov r9, r0
- movs r6, 0
- movs r5, 0
- cmp r1, 0xA
- ble _08040550
- ldr r1, [r7]
- adds r0, r7, 0
- movs r2, 0
- bl GetSubstruct
- mov r8, r0
- ldr r1, [r7]
- adds r0, r7, 0
- movs r2, 0x1
- bl GetSubstruct
- mov r9, r0
- ldr r1, [r7]
- adds r0, r7, 0
- movs r2, 0x2
- bl GetSubstruct
- adds r6, r0, 0
- ldr r1, [r7]
- adds r0, r7, 0
- movs r2, 0x3
- bl GetSubstruct
- adds r5, r0, 0
- adds r0, r7, 0
- bl DecryptBoxMon
- adds r0, r7, 0
- bl CalculateBoxMonChecksum
- lsls r0, 16
- lsrs r0, 16
- ldrh r1, [r7, 0x1C]
- cmp r0, r1
- beq _08040550
- ldrb r0, [r7, 0x13]
- movs r1, 0x1
- orrs r0, r1
- movs r1, 0x4
- orrs r0, r1
- strb r0, [r7, 0x13]
- ldrb r0, [r5, 0x7]
- movs r1, 0x40
- orrs r0, r1
- strb r0, [r5, 0x7]
- adds r0, r7, 0
- bl EncryptBoxMon
- b _08040AEE
-_08040550:
- mov r0, r10
- cmp r0, 0x50
- bls _08040558
- b _08040ADA
-_08040558:
- lsls r0, 2
- ldr r1, _08040564 @ =_08040568
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .align 2, 0
-_08040564: .4byte _08040568
- .align 2, 0
-_08040568:
- .4byte _080406AC
- .4byte _080406C4
- .4byte _080406DC
- .4byte _080406F2
- .4byte _080406F8
- .4byte _08040708
- .4byte _0804071A
- .4byte _0804072C
- .4byte _08040742
- .4byte _08040748
- .4byte _08040754
- .4byte _08040760
- .4byte _08040780
- .4byte _080407B8
- .4byte _080407B8
- .4byte _080407B8
- .4byte _080407B8
- .4byte _080407CC
- .4byte _080407CC
- .4byte _080407CC
- .4byte _080407CC
- .4byte _080407A8
- .4byte _080407FC
- .4byte _08040802
- .4byte _08040808
- .4byte _0804078E
- .4byte _080407D8
- .4byte _080407DE
- .4byte _080407E4
- .4byte _080407EA
- .4byte _080407F0
- .4byte _080407F6
- .4byte _080407B0
- .4byte _0804080E
- .4byte _08040820
- .4byte _08040826
- .4byte _0804082C
- .4byte _08040840
- .4byte _08040858
- .4byte _0804087E
- .4byte _08040892
- .4byte _080408AC
- .4byte _080408C2
- .4byte _080408DC
- .4byte _080408F4
- .4byte _08040908
- .4byte _08040938
- .4byte _08040814
- .4byte _0804081A
- .4byte _0804086E
- .4byte _08040948
- .4byte _08040956
- .4byte _0804096C
- .4byte _08040984
- .4byte _08040994
- .4byte _08040ADA
- .4byte _08040ADA
- .4byte _08040ADA
- .4byte _08040ADA
- .4byte _08040ADA
- .4byte _08040ADA
- .4byte _08040ADA
- .4byte _08040ADA
- .4byte _08040ADA
- .4byte _08040ADA
- .4byte _08040ADA
- .4byte _08040A92
- .4byte _080409AA
- .4byte _080409BA
- .4byte _080409C8
- .4byte _080409D8
- .4byte _080409E8
- .4byte _080409F8
- .4byte _08040A08
- .4byte _08040A18
- .4byte _08040A2E
- .4byte _08040A3E
- .4byte _08040A4C
- .4byte _08040A5C
- .4byte _08040A6C
- .4byte _08040A82
-_080406AC:
- ldrb r1, [r4]
- ldrb r0, [r4, 0x1]
- lsls r0, 8
- adds r1, r0
- ldrb r0, [r4, 0x2]
- lsls r0, 16
- adds r1, r0
- ldrb r0, [r4, 0x3]
- lsls r0, 24
- adds r1, r0
- str r1, [r7]
- b _08040ADA
-_080406C4:
- ldrb r1, [r4]
- ldrb r0, [r4, 0x1]
- lsls r0, 8
- adds r1, r0
- ldrb r0, [r4, 0x2]
- lsls r0, 16
- adds r1, r0
- ldrb r0, [r4, 0x3]
- lsls r0, 24
- adds r1, r0
- str r1, [r7, 0x4]
- b _08040ADA
-_080406DC:
- movs r2, 0
- adds r3, r7, 0
- adds r3, 0x8
-_080406E2:
- adds r0, r3, r2
- adds r1, r4, r2
- ldrb r1, [r1]
- strb r1, [r0]
- adds r2, 0x1
- cmp r2, 0x9
- ble _080406E2
- b _08040ADA
-_080406F2:
- ldrb r0, [r4]
- strb r0, [r7, 0x12]
- b _08040ADA
-_080406F8:
- ldrb r0, [r4]
- movs r1, 0x1
- ands r1, r0
- ldrb r2, [r7, 0x13]
- movs r0, 0x2
- negs r0, r0
- ands r0, r2
- b _08040926
-_08040708:
- ldrb r0, [r4]
- movs r1, 0x1
- ands r1, r0
- lsls r1, 1
- ldrb r2, [r7, 0x13]
- movs r0, 0x3
- negs r0, r0
- ands r0, r2
- b _08040926
-_0804071A:
- ldrb r0, [r4]
- movs r1, 0x1
- ands r1, r0
- lsls r1, 2
- ldrb r2, [r7, 0x13]
- movs r0, 0x5
- negs r0, r0
- ands r0, r2
- b _08040926
-_0804072C:
- movs r2, 0
- adds r3, r7, 0
- adds r3, 0x14
-_08040732:
- adds r0, r3, r2
- adds r1, r4, r2
- ldrb r1, [r1]
- strb r1, [r0]
- adds r2, 0x1
- cmp r2, 0x6
- ble _08040732
- b _08040ADA
-_08040742:
- ldrb r0, [r4]
- strb r0, [r7, 0x1B]
- b _08040ADA
-_08040748:
- ldrb r1, [r4]
- ldrb r0, [r4, 0x1]
- lsls r0, 8
- adds r1, r0
- strh r1, [r7, 0x1C]
- b _08040ADA
-_08040754:
- ldrb r1, [r4]
- ldrb r0, [r4, 0x1]
- lsls r0, 8
- adds r1, r0
- strh r1, [r7, 0x1E]
- b _08040ADA
-_08040760:
- ldrb r1, [r4]
- ldrb r0, [r4, 0x1]
- lsls r0, 8
- adds r1, r0
- mov r0, r8
- strh r1, [r0]
- lsls r1, 16
- cmp r1, 0
- beq _08040778
- ldrb r0, [r7, 0x13]
- movs r1, 0x2
- b _08040926
-_08040778:
- ldrb r1, [r7, 0x13]
- movs r0, 0x3
- negs r0, r0
- b _08040932
-_08040780:
- ldrb r1, [r4]
- ldrb r0, [r4, 0x1]
- lsls r0, 8
- adds r1, r0
- mov r0, r8
- strh r1, [r0, 0x2]
- b _08040ADA
-_0804078E:
- ldrb r1, [r4]
- ldrb r0, [r4, 0x1]
- lsls r0, 8
- adds r1, r0
- ldrb r0, [r4, 0x2]
- lsls r0, 16
- adds r1, r0
- ldrb r0, [r4, 0x3]
- lsls r0, 24
- adds r1, r0
- mov r0, r8
- str r1, [r0, 0x4]
- b _08040ADA
-_080407A8:
- ldrb r0, [r4]
- mov r1, r8
- strb r0, [r1, 0x8]
- b _08040ADA
-_080407B0:
- ldrb r0, [r4]
- mov r1, r8
- strb r0, [r1, 0x9]
- b _08040ADA
-_080407B8:
- mov r2, r10
- subs r2, 0xD
- lsls r2, 1
- add r2, r9
- ldrb r1, [r4]
- ldrb r0, [r4, 0x1]
- lsls r0, 8
- adds r1, r0
- strh r1, [r2]
- b _08040ADA
-_080407CC:
- mov r0, r9
- add r0, r10
- subs r0, 0x9
- ldrb r1, [r4]
- strb r1, [r0]
- b _08040ADA
-_080407D8:
- ldrb r0, [r4]
- strb r0, [r6]
- b _08040ADA
-_080407DE:
- ldrb r0, [r4]
- strb r0, [r6, 0x1]
- b _08040ADA
-_080407E4:
- ldrb r0, [r4]
- strb r0, [r6, 0x2]
- b _08040ADA
-_080407EA:
- ldrb r0, [r4]
- strb r0, [r6, 0x3]
- b _08040ADA
-_080407F0:
- ldrb r0, [r4]
- strb r0, [r6, 0x4]
- b _08040ADA
-_080407F6:
- ldrb r0, [r4]
- strb r0, [r6, 0x5]
- b _08040ADA
-_080407FC:
- ldrb r0, [r4]
- strb r0, [r6, 0x6]
- b _08040ADA
-_08040802:
- ldrb r0, [r4]
- strb r0, [r6, 0x7]
- b _08040ADA
-_08040808:
- ldrb r0, [r4]
- strb r0, [r6, 0x8]
- b _08040ADA
-_0804080E:
- ldrb r0, [r4]
- strb r0, [r6, 0x9]
- b _08040ADA
-_08040814:
- ldrb r0, [r4]
- strb r0, [r6, 0xA]
- b _08040ADA
-_0804081A:
- ldrb r0, [r4]
- strb r0, [r6, 0xB]
- b _08040ADA
-_08040820:
- ldrb r0, [r4]
- strb r0, [r5]
- b _08040ADA
-_08040826:
- ldrb r0, [r4]
- strb r0, [r5, 0x1]
- b _08040ADA
-_0804082C:
- ldrb r1, [r4]
- movs r0, 0x7F
- ands r1, r0
- ldrb r2, [r5, 0x2]
- movs r0, 0x80
- negs r0, r0
- ands r0, r2
- orrs r0, r1
- strb r0, [r5, 0x2]
- b _08040ADA
-_08040840:
- ldrb r1, [r4]
- movs r0, 0xF
- ands r1, r0
- lsls r1, 7
- ldrh r2, [r5, 0x2]
- ldr r0, _08040854 @ =0xfffff87f
- ands r0, r2
- orrs r0, r1
- strh r0, [r5, 0x2]
- b _08040ADA
- .align 2, 0
-_08040854: .4byte 0xfffff87f
-_08040858:
- ldrb r1, [r4]
- movs r0, 0xF
- ands r1, r0
- lsls r1, 3
- ldrb r2, [r5, 0x3]
- movs r0, 0x79
- negs r0, r0
- ands r0, r2
- orrs r0, r1
- strb r0, [r5, 0x3]
- b _08040ADA
-_0804086E:
- ldrb r0, [r4]
- lsls r0, 7
- ldrb r2, [r5, 0x3]
- movs r1, 0x7F
- ands r1, r2
- orrs r1, r0
- strb r1, [r5, 0x3]
- b _08040ADA
-_0804087E:
- ldrb r1, [r4]
- movs r0, 0x1F
- ands r1, r0
- ldrb r2, [r5, 0x4]
- movs r0, 0x20
- negs r0, r0
- ands r0, r2
- orrs r0, r1
- strb r0, [r5, 0x4]
- b _08040ADA
-_08040892:
- ldrb r1, [r4]
- movs r0, 0x1F
- ands r1, r0
- lsls r1, 5
- ldrh r2, [r5, 0x4]
- ldr r0, _080408A8 @ =0xfffffc1f
- ands r0, r2
- orrs r0, r1
- strh r0, [r5, 0x4]
- b _08040ADA
- .align 2, 0
-_080408A8: .4byte 0xfffffc1f
-_080408AC:
- ldrb r1, [r4]
- movs r0, 0x1F
- ands r1, r0
- lsls r1, 2
- ldrb r2, [r5, 0x5]
- movs r0, 0x7D
- negs r0, r0
- ands r0, r2
- orrs r0, r1
- strb r0, [r5, 0x5]
- b _08040ADA
-_080408C2:
- ldrb r2, [r4]
- movs r0, 0x1F
- ands r2, r0
- lsls r2, 15
- ldr r0, [r5, 0x4]
- ldr r1, _080408D8 @ =0xfff07fff
- ands r0, r1
- orrs r0, r2
- str r0, [r5, 0x4]
- b _08040ADA
- .align 2, 0
-_080408D8: .4byte 0xfff07fff
-_080408DC:
- ldrb r1, [r4]
- movs r0, 0x1F
- ands r1, r0
- lsls r1, 4
- ldrh r2, [r5, 0x6]
- ldr r0, _080408F0 @ =0xfffffe0f
- ands r0, r2
- orrs r0, r1
- strh r0, [r5, 0x6]
- b _08040ADA
- .align 2, 0
-_080408F0: .4byte 0xfffffe0f
-_080408F4:
- ldrb r1, [r4]
- movs r0, 0x1F
- ands r1, r0
- lsls r1, 1
- ldrb r2, [r5, 0x7]
- movs r0, 0x3F
- negs r0, r0
- ands r0, r2
- orrs r0, r1
- b _08040AD8
-_08040908:
- ldrb r1, [r4]
- movs r0, 0x1
- ands r1, r0
- lsls r1, 6
- ldrb r2, [r5, 0x7]
- movs r0, 0x41
- negs r0, r0
- ands r0, r2
- orrs r0, r1
- strb r0, [r5, 0x7]
- lsls r0, 25
- cmp r0, 0
- bge _0804092C
- ldrb r0, [r7, 0x13]
- movs r1, 0x4
-_08040926:
- orrs r0, r1
- strb r0, [r7, 0x13]
- b _08040ADA
-_0804092C:
- ldrb r1, [r7, 0x13]
- movs r0, 0x5
- negs r0, r0
-_08040932:
- ands r0, r1
- strb r0, [r7, 0x13]
- b _08040ADA
-_08040938:
- ldrb r0, [r4]
- lsls r0, 7
- ldrb r2, [r5, 0x7]
- movs r1, 0x7F
- ands r1, r2
- orrs r1, r0
- strb r1, [r5, 0x7]
- b _08040ADA
-_08040948:
- ldrb r1, [r4]
- movs r0, 0x7
- ands r1, r0
- ldrb r2, [r5, 0x8]
- movs r0, 0x8
- negs r0, r0
- b _08040964
-_08040956:
- ldrb r1, [r4]
- movs r0, 0x7
- ands r1, r0
- lsls r1, 3
- ldrb r2, [r5, 0x8]
- movs r0, 0x39
- negs r0, r0
-_08040964:
- ands r0, r2
- orrs r0, r1
- strb r0, [r5, 0x8]
- b _08040ADA
-_0804096C:
- ldrb r1, [r4]
- movs r0, 0x7
- ands r1, r0
- lsls r1, 6
- ldrh r2, [r5, 0x8]
- ldr r0, _08040980 @ =0xfffffe3f
- ands r0, r2
- orrs r0, r1
- strh r0, [r5, 0x8]
- b _08040ADA
- .align 2, 0
-_08040980: .4byte 0xfffffe3f
-_08040984:
- ldrb r1, [r4]
- movs r0, 0x7
- ands r1, r0
- lsls r1, 1
- ldrb r2, [r5, 0x9]
- movs r0, 0xF
- negs r0, r0
- b _080409A2
-_08040994:
- ldrb r1, [r4]
- movs r0, 0x7
- ands r1, r0
- lsls r1, 4
- ldrb r2, [r5, 0x9]
- movs r0, 0x71
- negs r0, r0
-_080409A2:
- ands r0, r2
- orrs r0, r1
- strb r0, [r5, 0x9]
- b _08040ADA
-_080409AA:
- ldrb r0, [r4]
- lsls r0, 7
- ldrb r2, [r5, 0x9]
- movs r1, 0x7F
- ands r1, r2
- orrs r1, r0
- strb r1, [r5, 0x9]
- b _08040ADA
-_080409BA:
- ldrb r1, [r4]
- movs r0, 0x1
- ands r1, r0
- ldrb r2, [r5, 0xA]
- movs r0, 0x2
- negs r0, r0
- b _08040A26
-_080409C8:
- ldrb r1, [r4]
- movs r0, 0x1
- ands r1, r0
- lsls r1, 1
- ldrb r2, [r5, 0xA]
- movs r0, 0x3
- negs r0, r0
- b _08040A26
-_080409D8:
- ldrb r1, [r4]
- movs r0, 0x1
- ands r1, r0
- lsls r1, 2
- ldrb r2, [r5, 0xA]
- movs r0, 0x5
- negs r0, r0
- b _08040A26
-_080409E8:
- ldrb r1, [r4]
- movs r0, 0x1
- ands r1, r0
- lsls r1, 3
- ldrb r2, [r5, 0xA]
- movs r0, 0x9
- negs r0, r0
- b _08040A26
-_080409F8:
- ldrb r1, [r4]
- movs r0, 0x1
- ands r1, r0
- lsls r1, 4
- ldrb r2, [r5, 0xA]
- movs r0, 0x11
- negs r0, r0
- b _08040A26
-_08040A08:
- ldrb r1, [r4]
- movs r0, 0x1
- ands r1, r0
- lsls r1, 5
- ldrb r2, [r5, 0xA]
- movs r0, 0x21
- negs r0, r0
- b _08040A26
-_08040A18:
- ldrb r1, [r4]
- movs r0, 0x1
- ands r1, r0
- lsls r1, 6
- ldrb r2, [r5, 0xA]
- movs r0, 0x41
- negs r0, r0
-_08040A26:
- ands r0, r2
- orrs r0, r1
- strb r0, [r5, 0xA]
- b _08040ADA
-_08040A2E:
- ldrb r0, [r4]
- lsls r0, 7
- ldrb r2, [r5, 0xA]
- movs r1, 0x7F
- ands r1, r2
- orrs r1, r0
- strb r1, [r5, 0xA]
- b _08040ADA
-_08040A3E:
- ldrb r1, [r4]
- movs r0, 0x1
- ands r1, r0
- ldrb r2, [r5, 0xB]
- movs r0, 0x2
- negs r0, r0
- b _08040A7A
-_08040A4C:
- ldrb r1, [r4]
- movs r0, 0x1
- ands r1, r0
- lsls r1, 1
- ldrb r2, [r5, 0xB]
- movs r0, 0x3
- negs r0, r0
- b _08040A7A
-_08040A5C:
- ldrb r1, [r4]
- movs r0, 0x1
- ands r1, r0
- lsls r1, 2
- ldrb r2, [r5, 0xB]
- movs r0, 0x5
- negs r0, r0
- b _08040A7A
-_08040A6C:
- ldrb r1, [r4]
- movs r0, 0xF
- ands r1, r0
- lsls r1, 3
- ldrb r2, [r5, 0xB]
- movs r0, 0x79
- negs r0, r0
-_08040A7A:
- ands r0, r2
- orrs r0, r1
- strb r0, [r5, 0xB]
- b _08040ADA
-_08040A82:
- ldrb r0, [r4]
- lsls r0, 7
- ldrb r2, [r5, 0xB]
- movs r1, 0x7F
- ands r1, r2
- orrs r1, r0
- strb r1, [r5, 0xB]
- b _08040ADA
-_08040A92:
- ldrb r1, [r4]
- movs r4, 0x1F
- adds r2, r1, 0
- ands r2, r4
- ldrb r3, [r5, 0x4]
- movs r0, 0x20
- negs r0, r0
- ands r0, r3
- orrs r0, r2
- strb r0, [r5, 0x4]
- lsrs r1, 5
- ands r1, r4
- lsls r1, 5
- ldrh r2, [r5, 0x4]
- ldr r0, _08040AFC @ =0xfffffc1f
- ands r0, r2
- orrs r0, r1
- strh r0, [r5, 0x4]
- ldrb r1, [r5, 0x5]
- movs r0, 0x7D
- negs r0, r0
- ands r0, r1
- strb r0, [r5, 0x5]
- ldr r0, [r5, 0x4]
- ldr r1, _08040B00 @ =0xfff07fff
- ands r0, r1
- str r0, [r5, 0x4]
- ldrh r1, [r5, 0x6]
- ldr r0, _08040B04 @ =0xfffffe0f
- ands r0, r1
- strh r0, [r5, 0x6]
- ldrb r1, [r5, 0x7]
- movs r0, 0x3F
- negs r0, r0
- ands r0, r1
-_08040AD8:
- strb r0, [r5, 0x7]
-_08040ADA:
- mov r0, r10
- cmp r0, 0xA
- ble _08040AEE
- adds r0, r7, 0
- bl CalculateBoxMonChecksum
- strh r0, [r7, 0x1C]
- adds r0, r7, 0
- bl EncryptBoxMon
-_08040AEE:
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_08040AFC: .4byte 0xfffffc1f
-_08040B00: .4byte 0xfff07fff
-_08040B04: .4byte 0xfffffe0f
- thumb_func_end sub_80404D0
-
- thumb_func_start CopyMon
-CopyMon: @ 8040B08
- push {lr}
- bl memcpy
- pop {r0}
- bx r0
- thumb_func_end CopyMon
-
- thumb_func_start GiveMonToPlayer
-GiveMonToPlayer: @ 8040B14
- push {r4-r6,lr}
- adds r6, r0, 0
- ldr r4, _08040B40 @ =gSaveBlock2Ptr
- ldr r2, [r4]
- movs r1, 0x7
- bl sub_804037C
- ldr r2, [r4]
- adds r2, 0x8
- adds r0, r6, 0
- movs r1, 0x31
- bl sub_804037C
- ldr r2, [r4]
- adds r2, 0xA
- adds r0, r6, 0
- movs r1, 0x1
- bl sub_804037C
- movs r5, 0
- b _08040B46
- .align 2, 0
-_08040B40: .4byte gSaveBlock2Ptr
-_08040B44:
- adds r5, 0x1
-_08040B46:
- cmp r5, 0x5
- bgt _08040B80
- movs r0, 0x64
- adds r1, r5, 0
- muls r1, r0
- ldr r0, _08040B78 @ =gPlayerParty
- adds r4, r1, r0
- adds r0, r4, 0
- movs r1, 0xB
- movs r2, 0
- bl GetMonData
- cmp r0, 0
- bne _08040B44
- adds r0, r4, 0
- adds r1, r6, 0
- movs r2, 0x64
- bl CopyMon
- ldr r1, _08040B7C @ =gUnknown_2024029
- adds r0, r5, 0x1
- strb r0, [r1]
- movs r0, 0
- b _08040B8A
- .align 2, 0
-_08040B78: .4byte gPlayerParty
-_08040B7C: .4byte gUnknown_2024029
-_08040B80:
- adds r0, r6, 0
- bl SendMonToPC
- lsls r0, 24
- lsrs r0, 24
-_08040B8A:
- pop {r4-r6}
- pop {r1}
- bx r1
- thumb_func_end GiveMonToPlayer
-
- thumb_func_start SendMonToPC
-SendMonToPC: @ 8040B90
- push {r4-r7,lr}
- mov r7, r8
- push {r7}
- mov r8, r0
- ldr r0, _08040C04 @ =0x00004037
- bl VarGet
- lsls r0, 24
- lsrs r0, 24
- bl set_unknown_box_id
- bl StorageGetCurrentBox
- lsls r0, 24
- lsrs r5, r0, 24
-_08040BAE:
- movs r6, 0
- lsls r7, r5, 24
-_08040BB2:
- lsls r1, r6, 24
- lsrs r1, 24
- lsrs r0, r7, 24
- bl GetBoxedMonPtr
- adds r4, r0, 0
- movs r1, 0xB
- movs r2, 0
- bl GetBoxMonData
- cmp r0, 0
- bne _08040C14
- mov r0, r8
- bl MonRestorePP
- adds r0, r4, 0
- mov r1, r8
- movs r2, 0x50
- bl CopyMon
- ldr r0, _08040C08 @ =gUnknown_20370D6
- strh r5, [r0]
- ldr r0, _08040C0C @ =gUnknown_20370D8
- strh r6, [r0]
- bl get_unknown_box_id
- lsls r0, 16
- lsrs r0, 16
- cmp r0, r5
- beq _08040BF4
- ldr r0, _08040C10 @ =0x00000843
- bl FlagClear
-_08040BF4:
- lsls r1, r5, 16
- ldr r0, _08040C04 @ =0x00004037
- lsrs r1, 16
- bl VarSet
- movs r0, 0x1
- b _08040C30
- .align 2, 0
-_08040C04: .4byte 0x00004037
-_08040C08: .4byte gUnknown_20370D6
-_08040C0C: .4byte gUnknown_20370D8
-_08040C10: .4byte 0x00000843
-_08040C14:
- adds r6, 0x1
- cmp r6, 0x1D
- ble _08040BB2
- adds r5, 0x1
- cmp r5, 0xE
- bne _08040C22
- movs r5, 0
-_08040C22:
- bl StorageGetCurrentBox
- lsls r0, 24
- lsrs r0, 24
- cmp r5, r0
- bne _08040BAE
- movs r0, 0x2
-_08040C30:
- pop {r3}
- mov r8, r3
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end SendMonToPC
-
- thumb_func_start CalculatePlayerPartyCount
-CalculatePlayerPartyCount: @ 8040C3C
- push {r4,lr}
- ldr r0, _08040C48 @ =gUnknown_2024029
- movs r1, 0
- strb r1, [r0]
- b _08040C54
- .align 2, 0
-_08040C48: .4byte gUnknown_2024029
-_08040C4C:
- ldrb r0, [r4]
- adds r0, 0x1
- strb r0, [r4]
- adds r0, r4, 0
-_08040C54:
- adds r4, r0, 0
- ldrb r0, [r4]
- cmp r0, 0x5
- bhi _08040C72
- adds r1, r0, 0
- movs r0, 0x64
- muls r0, r1
- ldr r1, _08040C7C @ =gPlayerParty
- adds r0, r1
- movs r1, 0xB
- movs r2, 0
- bl GetMonData
- cmp r0, 0
- bne _08040C4C
-_08040C72:
- ldrb r0, [r4]
- pop {r4}
- pop {r1}
- bx r1
- .align 2, 0
-_08040C7C: .4byte gPlayerParty
- thumb_func_end CalculatePlayerPartyCount
-
- thumb_func_start CalculateEnemyPartyCount
-CalculateEnemyPartyCount: @ 8040C80
- push {r4,lr}
- ldr r0, _08040C8C @ =gUnknown_202402A
- movs r1, 0
- strb r1, [r0]
- b _08040C98
- .align 2, 0
-_08040C8C: .4byte gUnknown_202402A
-_08040C90:
- ldrb r0, [r4]
- adds r0, 0x1
- strb r0, [r4]
- adds r0, r4, 0
-_08040C98:
- adds r4, r0, 0
- ldrb r0, [r4]
- cmp r0, 0x5
- bhi _08040CB6
- adds r1, r0, 0
- movs r0, 0x64
- muls r0, r1
- ldr r1, _08040CC0 @ =gEnemyParty
- adds r0, r1
- movs r1, 0xB
- movs r2, 0
- bl GetMonData
- cmp r0, 0
- bne _08040C90
-_08040CB6:
- ldrb r0, [r4]
- pop {r4}
- pop {r1}
- bx r1
- .align 2, 0
-_08040CC0: .4byte gEnemyParty
- thumb_func_end CalculateEnemyPartyCount
-
- thumb_func_start GetMonsStateToDoubles
-GetMonsStateToDoubles: @ 8040CC4
- push {r4-r6,lr}
- movs r6, 0
- bl CalculatePlayerPartyCount
- ldr r1, _08040D30 @ =gUnknown_2024029
- ldrb r0, [r1]
- cmp r0, 0x1
- beq _08040D28
- movs r5, 0
- ldrb r1, [r1]
- cmp r6, r1
- bge _08040D20
-_08040CDC:
- movs r0, 0x64
- adds r1, r5, 0
- muls r1, r0
- ldr r0, _08040D34 @ =gPlayerParty
- adds r4, r1, r0
- adds r0, r4, 0
- movs r1, 0x39
- movs r2, 0
- bl GetMonData
- cmp r0, 0
- beq _08040D16
- adds r0, r4, 0
- movs r1, 0x41
- movs r2, 0
- bl GetMonData
- cmp r0, 0
- beq _08040D16
- adds r0, r4, 0
- movs r1, 0x41
- movs r2, 0
- bl GetMonData
- movs r1, 0xCE
- lsls r1, 1
- cmp r0, r1
- beq _08040D16
- adds r6, 0x1
-_08040D16:
- adds r5, 0x1
- ldr r0, _08040D30 @ =gUnknown_2024029
- ldrb r0, [r0]
- cmp r5, r0
- blt _08040CDC
-_08040D20:
- movs r0, 0
- cmp r6, 0x1
- bgt _08040D28
- movs r0, 0x2
-_08040D28:
- pop {r4-r6}
- pop {r1}
- bx r1
- .align 2, 0
-_08040D30: .4byte gUnknown_2024029
-_08040D34: .4byte gPlayerParty
- thumb_func_end GetMonsStateToDoubles
-
- thumb_func_start GetAbilityBySpecies
-GetAbilityBySpecies: @ 8040D38
- push {lr}
- lsls r0, 16
- lsrs r3, r0, 16
- lsls r1, 24
- cmp r1, 0
- beq _08040D5C
- ldr r2, _08040D54 @ =gUnknown_2023D6A
- ldr r1, _08040D58 @ =gBaseStats
- lsls r0, r3, 3
- subs r0, r3
- lsls r0, 2
- adds r0, r1
- ldrb r0, [r0, 0x17]
- b _08040D6A
- .align 2, 0
-_08040D54: .4byte gUnknown_2023D6A
-_08040D58: .4byte gBaseStats
-_08040D5C:
- ldr r2, _08040D74 @ =gUnknown_2023D6A
- ldr r1, _08040D78 @ =gBaseStats
- lsls r0, r3, 3
- subs r0, r3
- lsls r0, 2
- adds r0, r1
- ldrb r0, [r0, 0x16]
-_08040D6A:
- strb r0, [r2]
- ldrb r0, [r2]
- pop {r1}
- bx r1
- .align 2, 0
-_08040D74: .4byte gUnknown_2023D6A
-_08040D78: .4byte gBaseStats
- thumb_func_end GetAbilityBySpecies
-
- thumb_func_start GetMonAbility
-GetMonAbility: @ 8040D7C
- push {r4,r5,lr}
- adds r5, r0, 0
- movs r1, 0xB
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- lsls r4, 16
- lsrs r4, 16
- adds r0, r5, 0
- movs r1, 0x2E
- movs r2, 0
- bl GetMonData
- adds r1, r0, 0
- lsls r1, 24
- lsrs r1, 24
- adds r0, r4, 0
- bl GetAbilityBySpecies
- lsls r0, 24
- lsrs r0, 24
- pop {r4,r5}
- pop {r1}
- bx r1
- thumb_func_end GetMonAbility
-
- thumb_func_start CreateSecretBaseEnemyParty
-CreateSecretBaseEnemyParty: @ 8040DB0
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x14
- adds r5, r0, 0
- bl ZeroEnemyPartyMons
- ldr r4, _08040ED8 @ =gBattleResources
- ldr r0, [r4]
- ldr r0, [r0]
- adds r1, r5, 0
- movs r2, 0xA0
- bl memcpy
- movs r0, 0
- mov r9, r0
-_08040DD4:
- ldr r1, _08040ED8 @ =gBattleResources
- ldr r3, [r1]
- ldr r2, [r3]
- mov r4, r9
- lsls r7, r4, 1
- adds r0, r2, 0
- adds r0, 0x7C
- adds r1, r0, r7
- ldrh r0, [r1]
- adds r4, 0x1
- str r4, [sp, 0x10]
- cmp r0, 0
- beq _08040EAE
- movs r0, 0x64
- mov r6, r9
- muls r6, r0
- ldr r4, _08040EDC @ =gEnemyParty
- mov r8, r4
- adds r5, r6, r4
- ldrh r1, [r1]
- adds r0, r2, 0
- adds r0, 0x94
- add r0, r9
- ldrb r2, [r0]
- movs r0, 0x1
- str r0, [sp]
- ldr r0, [r3]
- mov r3, r9
- lsls r4, r3, 2
- adds r0, 0x34
- adds r0, r4
- ldr r0, [r0]
- str r0, [sp, 0x4]
- movs r0, 0x2
- str r0, [sp, 0x8]
- movs r0, 0
- str r0, [sp, 0xC]
- adds r0, r5, 0
- movs r3, 0xF
- bl CreateMon
- ldr r1, _08040ED8 @ =gBattleResources
- ldr r0, [r1]
- adds r1, r7, 0
- adds r1, 0x88
- ldr r2, [r0]
- adds r2, r1
- adds r0, r5, 0
- movs r1, 0xC
- bl sub_804037C
- movs r5, 0
- mov r10, r4
- mov r7, r9
- adds r7, 0x9A
- mov r4, r8
-_08040E44:
- adds r1, r5, 0
- adds r1, 0x1A
- ldr r2, _08040ED8 @ =gBattleResources
- ldr r0, [r2]
- ldr r2, [r0]
- adds r2, r7
- adds r0, r6, r4
- bl sub_804037C
- adds r5, 0x1
- cmp r5, 0x5
- ble _08040E44
- movs r5, 0
- movs r3, 0x64
- mov r0, r9
- muls r0, r3
- ldr r1, _08040EDC @ =gEnemyParty
- adds r7, r0, r1
- mov r4, r10
- lsls r0, r4, 1
- adds r6, r0, 0
- adds r6, 0x4C
- adds r4, r0, 0
-_08040E72:
- adds r1, r5, 0
- adds r1, 0xD
- ldr r2, _08040ED8 @ =gBattleResources
- ldr r0, [r2]
- ldr r2, [r0]
- adds r2, r6
- adds r0, r7, 0
- bl sub_804037C
- adds r1, r5, 0
- adds r1, 0x11
- ldr r3, _08040ED8 @ =gBattleResources
- ldr r0, [r3]
- ldr r0, [r0]
- adds r0, 0x4C
- adds r0, r4
- ldrh r0, [r0]
- lsls r2, r0, 1
- adds r2, r0
- lsls r2, 2
- ldr r0, _08040EE0 @ =gUnknown_8250C08
- adds r2, r0
- adds r0, r7, 0
- bl sub_804037C
- adds r6, 0x2
- adds r4, 0x2
- adds r5, 0x1
- cmp r5, 0x3
- ble _08040E72
-_08040EAE:
- ldr r4, [sp, 0x10]
- mov r9, r4
- cmp r4, 0x5
- ble _08040DD4
- ldr r1, _08040EE4 @ =gBattleTypeFlags
- movs r0, 0x8
- str r0, [r1]
- ldr r1, _08040EE8 @ =gTrainerBattleOpponent_A
- movs r2, 0x80
- lsls r2, 3
- adds r0, r2, 0
- strh r0, [r1]
- add sp, 0x14
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_08040ED8: .4byte gBattleResources
-_08040EDC: .4byte gEnemyParty
-_08040EE0: .4byte gUnknown_8250C08
-_08040EE4: .4byte gBattleTypeFlags
-_08040EE8: .4byte gTrainerBattleOpponent_A
- thumb_func_end CreateSecretBaseEnemyParty
-
- thumb_func_start GetSecretBaseTrainerPicIndex
-GetSecretBaseTrainerPicIndex: @ 8040EEC
- push {r4,r5,lr}
- ldr r5, _08040F20 @ =gUnknown_825DFE0
- ldr r0, _08040F24 @ =gBattleResources
- ldr r0, [r0]
- ldr r4, [r0]
- ldrb r0, [r4, 0x9]
- movs r1, 0x5
- bl __umodsi3
- lsls r0, 24
- lsrs r0, 24
- ldrb r2, [r4, 0x1]
- lsls r2, 27
- lsrs r2, 31
- lsls r1, r2, 2
- adds r1, r2
- adds r0, r1
- adds r0, r5
- ldrb r0, [r0]
- ldr r1, _08040F28 @ =gUnknown_82538A8
- adds r0, r1
- ldrb r0, [r0]
- pop {r4,r5}
- pop {r1}
- bx r1
- .align 2, 0
-_08040F20: .4byte gUnknown_825DFE0
-_08040F24: .4byte gBattleResources
-_08040F28: .4byte gUnknown_82538A8
- thumb_func_end GetSecretBaseTrainerPicIndex
-
- thumb_func_start GetSecretBaseTrainerNameIndex
-GetSecretBaseTrainerNameIndex: @ 8040F2C
- push {r4,r5,lr}
- ldr r5, _08040F60 @ =gUnknown_825DFE0
- ldr r0, _08040F64 @ =gBattleResources
- ldr r0, [r0]
- ldr r4, [r0]
- ldrb r0, [r4, 0x9]
- movs r1, 0x5
- bl __umodsi3
- lsls r0, 24
- lsrs r0, 24
- ldrb r2, [r4, 0x1]
- lsls r2, 27
- lsrs r2, 31
- lsls r1, r2, 2
- adds r1, r2
- adds r0, r1
- adds r0, r5
- ldrb r0, [r0]
- ldr r1, _08040F68 @ =gUnknown_825393E
- adds r0, r1
- ldrb r0, [r0]
- pop {r4,r5}
- pop {r1}
- bx r1
- .align 2, 0
-_08040F60: .4byte gUnknown_825DFE0
-_08040F64: .4byte gBattleResources
-_08040F68: .4byte gUnknown_825393E
- thumb_func_end GetSecretBaseTrainerNameIndex
-
- thumb_func_start IsPlayerPartyAndPokemonStorageFull
-IsPlayerPartyAndPokemonStorageFull: @ 8040F6C
- push {r4,lr}
- movs r4, 0
-_08040F70:
- movs r0, 0x64
- muls r0, r4
- ldr r1, _08040F88 @ =gPlayerParty
- adds r0, r1
- movs r1, 0xB
- movs r2, 0
- bl GetMonData
- cmp r0, 0
- bne _08040F8C
- movs r0, 0
- b _08040F9A
- .align 2, 0
-_08040F88: .4byte gPlayerParty
-_08040F8C:
- adds r4, 0x1
- cmp r4, 0x5
- ble _08040F70
- bl IsPokemonStorageFull
- lsls r0, 24
- lsrs r0, 24
-_08040F9A:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end IsPlayerPartyAndPokemonStorageFull
-
- thumb_func_start IsPokemonStorageFull
-IsPokemonStorageFull: @ 8040FA0
- push {r4-r6,lr}
- movs r6, 0
-_08040FA4:
- movs r4, 0
- lsls r5, r6, 24
-_08040FA8:
- lsls r1, r4, 24
- lsrs r1, 24
- lsrs r0, r5, 24
- movs r2, 0xB
- bl GetBoxMonDataFromAnyBox
- cmp r0, 0
- bne _08040FBC
- movs r0, 0
- b _08040FCA
-_08040FBC:
- adds r4, 0x1
- cmp r4, 0x1D
- ble _08040FA8
- adds r6, 0x1
- cmp r6, 0xD
- ble _08040FA4
- movs r0, 0x1
-_08040FCA:
- pop {r4-r6}
- pop {r1}
- bx r1
- thumb_func_end IsPokemonStorageFull
-
- thumb_func_start GetSpeciesName
-GetSpeciesName: @ 8040FD0
- push {r4-r7,lr}
- adds r6, r0, 0
- lsls r1, 16
- lsrs r5, r1, 16
- movs r1, 0
- movs r0, 0xCE
- lsls r0, 1
- mov r12, r0
- ldr r7, _08040FEC @ =gUnknown_8245EE0
- movs r0, 0xB
- muls r0, r5
- adds r3, r0, r7
- adds r2, r6, 0
- b _08040FF6
- .align 2, 0
-_08040FEC: .4byte gUnknown_8245EE0
-_08040FF0:
- adds r3, 0x1
- adds r2, 0x1
- adds r1, 0x1
-_08040FF6:
- adds r4, r6, r1
- cmp r1, 0x9
- bgt _08041010
- cmp r5, r12
- bls _08041006
- adds r0, r1, r7
- ldrb r0, [r0]
- b _08041008
-_08041006:
- ldrb r0, [r3]
-_08041008:
- strb r0, [r2]
- ldrb r0, [r4]
- cmp r0, 0xFF
- bne _08040FF0
-_08041010:
- movs r0, 0xFF
- strb r0, [r4]
- pop {r4-r7}
- pop {r0}
- bx r0
- thumb_func_end GetSpeciesName
-
- thumb_func_start CalculatePPWithBonus
-CalculatePPWithBonus: @ 804101C
- push {r4,lr}
- lsls r0, 16
- lsrs r0, 16
- lsls r2, 24
- lsrs r2, 24
- ldr r4, _0804105C @ =gBattleMoves
- lsls r3, r0, 1
- adds r3, r0
- lsls r3, 2
- adds r3, r4
- ldrb r4, [r3, 0x4]
- ldr r0, _08041060 @ =gUnknown_825DEA1
- adds r0, r2, r0
- ldrb r3, [r0]
- ands r3, r1
- lsls r2, 1
- asrs r3, r2
- lsls r0, r3, 2
- adds r0, r3
- lsls r0, 2
- muls r0, r4
- movs r1, 0x64
- bl __divsi3
- adds r4, r0
- lsls r4, 24
- lsrs r4, 24
- adds r0, r4, 0
- pop {r4}
- pop {r1}
- bx r1
- .align 2, 0
-_0804105C: .4byte gBattleMoves
-_08041060: .4byte gUnknown_825DEA1
- thumb_func_end CalculatePPWithBonus
-
- thumb_func_start RemoveMonPPBonus
-RemoveMonPPBonus: @ 8041064
- push {r4,r5,lr}
- sub sp, 0x4
- adds r5, r0, 0
- lsls r4, r1, 24
- lsrs r4, 24
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- lsls r0, 24
- lsrs r0, 24
- mov r1, sp
- strb r0, [r1]
- ldr r1, _0804109C @ =gUnknown_825DEA5
- adds r4, r1
- ldrb r1, [r4]
- ands r1, r0
- mov r0, sp
- strb r1, [r0]
- adds r0, r5, 0
- movs r1, 0x15
- mov r2, sp
- bl sub_804037C
- add sp, 0x4
- pop {r4,r5}
- pop {r0}
- bx r0
- .align 2, 0
-_0804109C: .4byte gUnknown_825DEA5
- thumb_func_end RemoveMonPPBonus
-
- thumb_func_start RemoveBattleMonPPBonus
-RemoveBattleMonPPBonus: @ 80410A0
- lsls r1, 24
- lsrs r1, 24
- adds r0, 0x3B
- ldr r2, _080410B4 @ =gUnknown_825DEA5
- adds r1, r2
- ldrb r2, [r0]
- ldrb r1, [r1]
- ands r1, r2
- strb r1, [r0]
- bx lr
- .align 2, 0
-_080410B4: .4byte gUnknown_825DEA5
- thumb_func_end RemoveBattleMonPPBonus
-
- thumb_func_start CopyPlayerPartyMonToBattleData
-CopyPlayerPartyMonToBattleData: @ 80410B8
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x18
- lsls r0, 24
- lsrs r0, 24
- str r0, [sp, 0x14]
- lsls r1, 24
- lsrs r1, 24
- mov r9, r1
- movs r0, 0x64
- mov r5, r9
- muls r5, r0
- ldr r0, _080413A4 @ =gPlayerParty
- adds r5, r0
- adds r0, r5, 0
- movs r1, 0xB
- movs r2, 0
- bl GetMonData
- ldr r1, _080413A8 @ =gBattleMons
- mov r8, r1
- movs r1, 0x58
- ldr r2, [sp, 0x14]
- adds r4, r2, 0
- muls r4, r1
- mov r3, r8
- adds r6, r4, r3
- strh r0, [r6]
- adds r0, r5, 0
- movs r1, 0xC
- movs r2, 0
- bl GetMonData
- strh r0, [r6, 0x2E]
- movs r6, 0
- mov r0, r8
- adds r0, 0x24
- adds r7, r4, r0
-_0804110A:
- adds r1, r6, 0
- adds r1, 0xD
- adds r0, r5, 0
- movs r2, 0
- bl GetMonData
- movs r1, 0xC
- add r1, r8
- mov r10, r1
- adds r1, r4, r1
- strh r0, [r1]
- adds r1, r6, 0
- adds r1, 0x11
- adds r0, r5, 0
- movs r2, 0
- bl GetMonData
- strb r0, [r7]
- adds r7, 0x1
- adds r4, 0x2
- adds r6, 0x1
- cmp r6, 0x3
- ble _0804110A
- movs r0, 0x64
- mov r4, r9
- muls r4, r0
- ldr r0, _080413A4 @ =gPlayerParty
- adds r4, r0
- adds r0, r4, 0
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- movs r2, 0xC
- negs r2, r2
- add r2, r10
- mov r9, r2
- movs r1, 0x58
- ldr r3, [sp, 0x14]
- adds r5, r3, 0
- muls r5, r1
- adds r7, r5, r2
- adds r1, r7, 0
- adds r1, 0x3B
- strb r0, [r1]
- adds r0, r4, 0
- movs r1, 0x20
- movs r2, 0
- bl GetMonData
- adds r1, r7, 0
- adds r1, 0x2B
- strb r0, [r1]
- adds r0, r4, 0
- movs r1, 0x19
- movs r2, 0
- bl GetMonData
- mov r1, r10
- adds r1, 0x38
- adds r1, r5, r1
- str r0, [r1]
- adds r0, r4, 0
- movs r1, 0x27
- movs r2, 0
- bl GetMonData
- movs r6, 0x1F
- ands r0, r6
- ldrb r2, [r7, 0x14]
- movs r1, 0x20
- negs r1, r1
- ands r1, r2
- orrs r1, r0
- strb r1, [r7, 0x14]
- adds r0, r4, 0
- movs r1, 0x28
- movs r2, 0
- bl GetMonData
- movs r1, 0x1F
- mov r8, r1
- mov r2, r8
- ands r0, r2
- lsls r0, 5
- ldrh r2, [r7, 0x14]
- ldr r1, _080413AC @ =0xfffffc1f
- ands r1, r2
- orrs r1, r0
- strh r1, [r7, 0x14]
- adds r0, r4, 0
- movs r1, 0x29
- movs r2, 0
- bl GetMonData
- ands r0, r6
- lsls r0, 2
- ldrb r2, [r7, 0x15]
- movs r1, 0x7D
- negs r1, r1
- ands r1, r2
- orrs r1, r0
- strb r1, [r7, 0x15]
- adds r0, r4, 0
- movs r1, 0x2A
- movs r2, 0
- bl GetMonData
- movs r1, 0x1F
- ands r1, r0
- lsls r1, 15
- ldr r0, [r7, 0x14]
- ldr r2, _080413B0 @ =0xfff07fff
- ands r0, r2
- orrs r0, r1
- str r0, [r7, 0x14]
- adds r0, r4, 0
- movs r1, 0x2B
- movs r2, 0
- bl GetMonData
- mov r3, r8
- ands r0, r3
- lsls r0, 4
- ldrh r2, [r7, 0x16]
- ldr r1, _080413B4 @ =0xfffffe0f
- ands r1, r2
- orrs r1, r0
- strh r1, [r7, 0x16]
- adds r0, r4, 0
- movs r1, 0x2C
- movs r2, 0
- bl GetMonData
- ands r0, r6
- lsls r0, 1
- ldrb r2, [r7, 0x17]
- movs r1, 0x3F
- negs r1, r1
- ands r1, r2
- orrs r1, r0
- strb r1, [r7, 0x17]
- adds r0, r4, 0
- movs r1, 0
- movs r2, 0
- bl GetMonData
- mov r1, r10
- adds r1, 0x3C
- adds r1, r5, r1
- str r0, [r1]
- adds r0, r4, 0
- movs r1, 0x37
- movs r2, 0
- bl GetMonData
- mov r1, r10
- adds r1, 0x40
- adds r1, r5, r1
- str r0, [r1]
- adds r0, r4, 0
- movs r1, 0x38
- movs r2, 0
- bl GetMonData
- adds r1, r7, 0
- adds r1, 0x2A
- strb r0, [r1]
- adds r0, r4, 0
- movs r1, 0x39
- movs r2, 0
- bl GetMonData
- strh r0, [r7, 0x28]
- adds r0, r4, 0
- movs r1, 0x3A
- movs r2, 0
- bl GetMonData
- strh r0, [r7, 0x2C]
- adds r0, r4, 0
- movs r1, 0x3B
- movs r2, 0
- bl GetMonData
- strh r0, [r7, 0x2]
- adds r0, r4, 0
- movs r1, 0x3C
- movs r2, 0
- bl GetMonData
- strh r0, [r7, 0x4]
- adds r0, r4, 0
- movs r1, 0x3D
- movs r2, 0
- bl GetMonData
- strh r0, [r7, 0x6]
- adds r0, r4, 0
- movs r1, 0x3E
- movs r2, 0
- bl GetMonData
- strh r0, [r7, 0x8]
- adds r0, r4, 0
- movs r1, 0x3F
- movs r2, 0
- bl GetMonData
- strh r0, [r7, 0xA]
- adds r0, r4, 0
- movs r1, 0x2D
- movs r2, 0
- bl GetMonData
- movs r1, 0x1
- ands r0, r1
- lsls r0, 6
- ldrb r2, [r7, 0x17]
- movs r1, 0x41
- negs r1, r1
- ands r1, r2
- orrs r1, r0
- strb r1, [r7, 0x17]
- adds r0, r4, 0
- movs r1, 0x2E
- movs r2, 0
- bl GetMonData
- lsls r0, 7
- ldrb r2, [r7, 0x17]
- movs r1, 0x7F
- ands r1, r2
- orrs r1, r0
- strb r1, [r7, 0x17]
- adds r0, r4, 0
- movs r1, 0x1
- movs r2, 0
- bl GetMonData
- mov r1, r10
- adds r1, 0x48
- adds r1, r5, r1
- str r0, [r1]
- ldr r2, _080413B8 @ =gBaseStats
- ldrh r1, [r7]
- lsls r0, r1, 3
- subs r0, r1
- lsls r0, 2
- adds r0, r2
- ldrb r0, [r0, 0x6]
- adds r1, r7, 0
- adds r1, 0x21
- strb r0, [r1]
- ldrh r1, [r7]
- lsls r0, r1, 3
- subs r0, r1
- lsls r0, 2
- adds r0, r2
- ldrb r0, [r0, 0x7]
- adds r1, r7, 0
- adds r1, 0x22
- strb r0, [r1]
- ldrh r0, [r7]
- ldrb r1, [r7, 0x17]
- lsrs r1, 7
- bl GetAbilityBySpecies
- adds r1, r7, 0
- adds r1, 0x20
- strb r0, [r1]
- adds r0, r4, 0
- movs r1, 0x2
- mov r2, sp
- bl GetMonData
- mov r0, r10
- adds r0, 0x24
- adds r0, r5, r0
- mov r1, sp
- bl StringCopy10
- mov r2, r10
- adds r2, 0x30
- adds r2, r5, r2
- adds r0, r4, 0
- movs r1, 0x7
- bl GetMonData
- ldr r0, [sp, 0x14]
- bl GetBankSide
- ldr r1, _080413BC @ =gBattleStruct
- lsls r0, 24
- lsrs r0, 23
- adds r0, 0xA8
- ldr r1, [r1]
- adds r1, r0
- ldrh r0, [r7, 0x28]
- strh r0, [r1]
- movs r2, 0x6
- mov r1, r9
- movs r6, 0x7
- add r5, r10
- adds r0, r5, 0
- adds r0, 0x13
-_0804136E:
- strb r2, [r0]
- subs r0, 0x1
- subs r6, 0x1
- cmp r6, 0
- bge _0804136E
- movs r2, 0
- movs r0, 0x58
- ldr r3, [sp, 0x14]
- muls r0, r3
- adds r1, 0x50
- adds r0, r1
- str r2, [r0]
- ldr r0, [sp, 0x14]
- bl sub_80174B8
- ldr r0, [sp, 0x14]
- movs r1, 0
- bl ClearTemporarySpeciesSpriteData
- add sp, 0x18
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_080413A4: .4byte gPlayerParty
-_080413A8: .4byte gBattleMons
-_080413AC: .4byte 0xfffffc1f
-_080413B0: .4byte 0xfff07fff
-_080413B4: .4byte 0xfffffe0f
-_080413B8: .4byte gBaseStats
-_080413BC: .4byte gBattleStruct
- thumb_func_end CopyPlayerPartyMonToBattleData
-
- .align 2, 0 @ Don't pad with nop.
diff --git a/asm/pokemon_3.s b/asm/pokemon_3.s
index b8fc0356d..42ab9387b 100644
--- a/asm/pokemon_3.s
+++ b/asm/pokemon_3.s
@@ -5,4471 +5,6 @@
.text
- thumb_func_start sub_80423A4
-sub_80423A4: @ 80423A4
- push {r4-r6,lr}
- sub sp, 0x4
- adds r5, r0, 0
- adds r4, r2, 0
- lsls r3, 24
- lsrs r6, r3, 24
- movs r1, 0x37
- movs r2, 0
- bl GetMonData
- adds r1, r0, 0
- str r1, [sp]
- ands r0, r4
- cmp r0, 0
- beq _08042408
- mvns r4, r4
- ands r1, r4
- str r1, [sp]
- adds r0, r5, 0
- movs r1, 0x37
- mov r2, sp
- bl sub_804037C
- ldr r0, _080423FC @ =gMain
- ldr r1, _08042400 @ =0x00000439
- adds r0, r1
- ldrb r1, [r0]
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- beq _080423F6
- cmp r6, 0x4
- beq _080423F6
- ldr r0, _08042404 @ =gBattleMons
- movs r1, 0x58
- muls r1, r6
- adds r0, 0x4C
- adds r1, r0
- ldr r0, [r1]
- ands r0, r4
- str r0, [r1]
-_080423F6:
- movs r0, 0
- b _0804240A
- .align 2, 0
-_080423FC: .4byte gMain
-_08042400: .4byte 0x00000439
-_08042404: .4byte gBattleMons
-_08042408:
- movs r0, 0x1
-_0804240A:
- add sp, 0x4
- pop {r4-r6}
- pop {r1}
- bx r1
- thumb_func_end sub_80423A4
-
- thumb_func_start sub_8042414
-sub_8042414: @ 8042414
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x20
- mov r8, r0
- lsls r1, 16
- lsrs r1, 16
- str r1, [sp]
- lsls r2, 24
- lsrs r2, 24
- str r2, [sp, 0x4]
- lsls r3, 24
- lsrs r3, 24
- str r3, [sp, 0x8]
- movs r0, 0x1
- str r0, [sp, 0x10]
- movs r1, 0x6
- mov r10, r1
- movs r2, 0
- str r2, [sp, 0x18]
- movs r0, 0x4
- str r0, [sp, 0x1C]
- mov r0, r8
- movs r1, 0xC
- bl GetMonData
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0xAF
- beq _08042458
- bl ItemId_GetHoldEffect
-_08042458:
- ldr r1, _080424B0 @ =gUnknown_2023D6F
- ldr r0, _080424B4 @ =gUnknown_2024004
- ldrb r2, [r0]
- strb r2, [r1]
- ldr r0, _080424B8 @ =gMain
- ldr r1, _080424BC @ =0x00000439
- adds r0, r1
- ldrb r1, [r0]
- movs r0, 0x2
- ands r0, r1
- lsls r0, 24
- lsrs r1, r0, 24
- cmp r1, 0
- beq _080424F8
- ldr r0, _080424C0 @ =gActiveBattler
- strb r2, [r0]
- ldrb r0, [r0]
- bl GetBankSide
- lsls r0, 24
- lsrs r0, 24
- negs r1, r0
- orrs r1, r0
- lsrs r1, 31
- str r1, [sp, 0xC]
- ldr r0, _080424C4 @ =gUnknown_2023BCC
- ldr r4, [sp]
- subs r4, 0xD
- ldrb r0, [r0]
- cmp r1, r0
- bge _08042504
- ldr r2, _080424C8 @ =gBattlerPartyIndexes
- lsls r0, r1, 1
- adds r0, r2
- ldrh r3, [r0]
- ldr r1, [sp, 0x4]
- lsls r0, r1, 16
- lsrs r1, r0, 16
- adds r5, r0, 0
- cmp r3, r1
- bne _080424CC
- ldr r2, [sp, 0xC]
- str r2, [sp, 0x1C]
- b _08042504
- .align 2, 0
-_080424B0: .4byte gUnknown_2023D6F
-_080424B4: .4byte gUnknown_2024004
-_080424B8: .4byte gMain
-_080424BC: .4byte 0x00000439
-_080424C0: .4byte gActiveBattler
-_080424C4: .4byte gUnknown_2023BCC
-_080424C8: .4byte gBattlerPartyIndexes
-_080424CC:
- ldr r0, [sp, 0xC]
- adds r0, 0x2
- str r0, [sp, 0xC]
- ldr r0, _080424F4 @ =gUnknown_2023BCC
- ldr r1, [sp, 0xC]
- ldrb r0, [r0]
- cmp r1, r0
- bge _08042504
- lsls r0, r1, 1
- adds r0, r2
- ldrh r1, [r0]
- lsrs r0, r5, 16
- cmp r1, r0
- bne _080424CC
- ldr r2, [sp, 0xC]
- lsls r0, r2, 24
- lsrs r0, 24
- str r0, [sp, 0x1C]
- b _08042504
- .align 2, 0
-_080424F4: .4byte gUnknown_2023BCC
-_080424F8:
- ldr r0, _08042520 @ =gActiveBattler
- strb r1, [r0]
- movs r0, 0x4
- str r0, [sp, 0x1C]
- ldr r4, [sp]
- subs r4, 0xD
-_08042504:
- lsls r0, r4, 16
- lsrs r0, 16
- cmp r0, 0xA5
- bhi _08042578
- ldr r1, _08042524 @ =gUnknown_82528BC
- lsls r0, r4, 2
- adds r0, r1
- ldr r0, [r0]
- cmp r0, 0
- bne _08042528
- ldr r1, [sp]
- cmp r1, 0xAF
- beq _0804252E
- b _08042578
- .align 2, 0
-_08042520: .4byte gActiveBattler
-_08042524: .4byte gUnknown_82528BC
-_08042528:
- ldr r2, [sp]
- cmp r2, 0xAF
- bne _0804257C
-_0804252E:
- ldr r0, _08042550 @ =gMain
- ldr r1, _08042554 @ =0x00000439
- adds r0, r1
- ldrb r1, [r0]
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- beq _08042560
- ldr r0, _08042558 @ =gActiveBattler
- ldrb r1, [r0]
- lsls r0, r1, 3
- subs r0, r1
- lsls r0, 2
- ldr r1, _0804255C @ =gUnknown_2023F5C
- adds r0, r1
- b _0804257C
- .align 2, 0
-_08042550: .4byte gMain
-_08042554: .4byte 0x00000439
-_08042558: .4byte gActiveBattler
-_0804255C: .4byte gUnknown_2023F5C
-_08042560:
- ldr r0, _0804256C @ =gSaveBlock1Ptr
- ldr r0, [r0]
- ldr r2, _08042570 @ =0x00003108
- adds r2, r0, r2
- str r2, [sp, 0x14]
- b _0804257E
- .align 2, 0
-_0804256C: .4byte gSaveBlock1Ptr
-_08042570: .4byte 0x00003108
-_08042574:
- movs r0, 0
- b _08042BD8
-_08042578:
- movs r0, 0x1
- b _08042BD8
-_0804257C:
- str r0, [sp, 0x14]
-_0804257E:
- movs r0, 0
- str r0, [sp, 0xC]
-_08042582:
- ldr r1, [sp, 0xC]
- cmp r1, 0x5
- bls _0804258A
- b _08042BCA
-_0804258A:
- lsls r0, r1, 2
- ldr r1, _08042594 @ =_08042598
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .align 2, 0
-_08042594: .4byte _08042598
- .align 2, 0
-_08042598:
- .4byte _080425B0
- .4byte _0804264C
- .4byte _080426A8
- .4byte _08042708
- .4byte _08042850
- .4byte _08042A6A
-_080425B0:
- ldr r0, [sp, 0x14]
- ldr r1, [sp, 0xC]
- adds r2, r0, r1
- ldrb r1, [r2]
- movs r0, 0x80
- ands r0, r1
- adds r5, r2, 0
- cmp r0, 0
- beq _080425F4
- ldr r0, _0804263C @ =gMain
- ldr r2, _08042640 @ =0x00000439
- adds r0, r2
- ldrb r1, [r0]
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- beq _080425F4
- ldr r0, [sp, 0x1C]
- cmp r0, 0x4
- beq _080425F4
- ldr r1, _08042644 @ =gBattleMons
- movs r0, 0x58
- ldr r2, [sp, 0x1C]
- muls r0, r2
- adds r1, 0x50
- adds r0, r1
- ldr r0, [r0]
- movs r1, 0xF0
- lsls r1, 12
- ands r0, r1
- cmp r0, 0
- beq _080425F4
- movs r0, 0
- str r0, [sp, 0x10]
-_080425F4:
- ldrb r1, [r5]
- movs r0, 0x30
- ands r0, r1
- cmp r0, 0
- beq _0804261C
- ldr r1, _08042644 @ =gBattleMons
- ldr r0, _08042648 @ =gActiveBattler
- ldrb r2, [r0]
- movs r0, 0x58
- muls r0, r2
- adds r1, 0x50
- adds r0, r1
- ldr r0, [r0]
- movs r1, 0x80
- lsls r1, 13
- ands r0, r1
- cmp r0, 0
- bne _0804261C
- movs r1, 0
- str r1, [sp, 0x10]
-_0804261C:
- ldrb r1, [r5]
- movs r0, 0xF
- ands r0, r1
- cmp r0, 0
- bne _08042628
- b _08042BCA
-_08042628:
- ldr r2, _08042644 @ =gBattleMons
- ldr r0, _08042648 @ =gActiveBattler
- ldrb r1, [r0]
- movs r0, 0x58
- muls r0, r1
- adds r0, r2
- ldrb r0, [r0, 0x19]
- lsls r0, 24
- asrs r0, 24
- b _080426F2
- .align 2, 0
-_0804263C: .4byte gMain
-_08042640: .4byte 0x00000439
-_08042644: .4byte gBattleMons
-_08042648: .4byte gActiveBattler
-_0804264C:
- ldr r0, [sp, 0x14]
- ldr r1, [sp, 0xC]
- adds r2, r0, r1
- ldrb r1, [r2]
- movs r0, 0xF0
- ands r0, r1
- adds r5, r2, 0
- cmp r0, 0
- beq _08042678
- ldr r2, _080426A0 @ =gBattleMons
- ldr r0, _080426A4 @ =gActiveBattler
- ldrb r1, [r0]
- movs r0, 0x58
- muls r0, r1
- adds r0, r2
- ldrb r0, [r0, 0x1A]
- lsls r0, 24
- asrs r0, 24
- cmp r0, 0xB
- bgt _08042678
- movs r2, 0
- str r2, [sp, 0x10]
-_08042678:
- ldrb r1, [r5]
- movs r0, 0xF
- ands r0, r1
- cmp r0, 0
- bne _08042684
- b _08042BCA
-_08042684:
- ldr r2, _080426A0 @ =gBattleMons
- ldr r0, _080426A4 @ =gActiveBattler
- ldrb r1, [r0]
- movs r0, 0x58
- muls r0, r1
- adds r0, r2
- ldrb r0, [r0, 0x1B]
- lsls r0, 24
- asrs r0, 24
- cmp r0, 0xB
- ble _0804269C
- b _08042BCA
-_0804269C:
- b _08042832
- .align 2, 0
-_080426A0: .4byte gBattleMons
-_080426A4: .4byte gActiveBattler
-_080426A8:
- ldr r1, [sp, 0x14]
- ldr r0, [sp, 0xC]
- adds r2, r1, r0
- ldrb r1, [r2]
- movs r0, 0xF0
- ands r0, r1
- adds r5, r2, 0
- cmp r0, 0
- beq _080426D4
- ldr r2, _08042700 @ =gBattleMons
- ldr r0, _08042704 @ =gActiveBattler
- ldrb r1, [r0]
- movs r0, 0x58
- muls r0, r1
- adds r0, r2
- ldrb r0, [r0, 0x1E]
- lsls r0, 24
- asrs r0, 24
- cmp r0, 0xB
- bgt _080426D4
- movs r1, 0
- str r1, [sp, 0x10]
-_080426D4:
- ldrb r1, [r5]
- movs r0, 0xF
- ands r0, r1
- cmp r0, 0
- bne _080426E0
- b _08042BCA
-_080426E0:
- ldr r2, _08042700 @ =gBattleMons
- ldr r0, _08042704 @ =gActiveBattler
- ldrb r1, [r0]
- movs r0, 0x58
- muls r0, r1
- adds r0, r2
- ldrb r0, [r0, 0x1C]
- lsls r0, 24
- asrs r0, 24
-_080426F2:
- cmp r0, 0xB
- ble _080426F8
- b _08042BCA
-_080426F8:
- movs r2, 0
- str r2, [sp, 0x10]
- b _08042BCA
- .align 2, 0
-_08042700: .4byte gBattleMons
-_08042704: .4byte gActiveBattler
-_08042708:
- ldr r0, [sp, 0x14]
- ldr r1, [sp, 0xC]
- adds r2, r0, r1
- ldrb r1, [r2]
- movs r0, 0x80
- ands r0, r1
- adds r5, r2, 0
- cmp r0, 0
- beq _0804273A
- ldr r4, _08042838 @ =gUnknown_2023DE4
- ldr r0, _0804283C @ =gActiveBattler
- ldrb r0, [r0]
- bl GetBankSide
- lsls r0, 24
- lsrs r0, 24
- lsls r1, r0, 1
- adds r1, r0
- lsls r1, 2
- adds r1, r4
- ldrb r0, [r1, 0x4]
- cmp r0, 0
- bne _0804273A
- movs r2, 0
- str r2, [sp, 0x10]
-_0804273A:
- ldrb r1, [r5]
- movs r0, 0x40
- ands r0, r1
- cmp r0, 0
- beq _08042756
- mov r0, r8
- movs r1, 0x38
- movs r2, 0
- bl GetMonData
- cmp r0, 0x64
- beq _08042756
- movs r0, 0
- str r0, [sp, 0x10]
-_08042756:
- ldrb r1, [r5]
- movs r0, 0x20
- ands r0, r1
- cmp r0, 0
- beq _08042776
- mov r0, r8
- ldr r1, [sp, 0x4]
- movs r2, 0x7
- ldr r3, [sp, 0x1C]
- bl sub_8042BE8
- lsls r0, 24
- cmp r0, 0
- beq _08042776
- movs r1, 0
- str r1, [sp, 0x10]
-_08042776:
- ldrb r1, [r5]
- movs r0, 0x10
- ands r0, r1
- cmp r0, 0
- beq _08042796
- ldr r2, _08042840 @ =0x00000f88
- mov r0, r8
- ldr r1, [sp, 0x4]
- ldr r3, [sp, 0x1C]
- bl sub_8042BE8
- lsls r0, 24
- cmp r0, 0
- beq _08042796
- movs r2, 0
- str r2, [sp, 0x10]
-_08042796:
- ldrb r1, [r5]
- movs r0, 0x8
- ands r0, r1
- cmp r0, 0
- beq _080427B6
- mov r0, r8
- ldr r1, [sp, 0x4]
- movs r2, 0x10
- ldr r3, [sp, 0x1C]
- bl sub_8042BE8
- lsls r0, 24
- cmp r0, 0
- beq _080427B6
- movs r0, 0
- str r0, [sp, 0x10]
-_080427B6:
- ldrb r1, [r5]
- movs r0, 0x4
- ands r0, r1
- cmp r0, 0
- beq _080427D6
- mov r0, r8
- ldr r1, [sp, 0x4]
- movs r2, 0x20
- ldr r3, [sp, 0x1C]
- bl sub_8042BE8
- lsls r0, 24
- cmp r0, 0
- beq _080427D6
- movs r1, 0
- str r1, [sp, 0x10]
-_080427D6:
- ldrb r1, [r5]
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- beq _080427F6
- mov r0, r8
- ldr r1, [sp, 0x4]
- movs r2, 0x40
- ldr r3, [sp, 0x1C]
- bl sub_8042BE8
- lsls r0, 24
- cmp r0, 0
- beq _080427F6
- movs r2, 0
- str r2, [sp, 0x10]
-_080427F6:
- ldrb r1, [r5]
- movs r0, 0x1
- ands r0, r1
- cmp r0, 0
- bne _08042802
- b _08042BCA
-_08042802:
- ldr r0, _08042844 @ =gMain
- ldr r1, _08042848 @ =0x00000439
- adds r0, r1
- ldrb r1, [r0]
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- bne _08042814
- b _08042BCA
-_08042814:
- ldr r2, [sp, 0x1C]
- cmp r2, 0x4
- bne _0804281C
- b _08042BCA
-_0804281C:
- ldr r1, _0804284C @ =gBattleMons
- movs r0, 0x58
- muls r0, r2
- adds r1, 0x50
- adds r0, r1
- ldr r0, [r0]
- movs r1, 0x7
- ands r0, r1
- cmp r0, 0
- bne _08042832
- b _08042BCA
-_08042832:
- movs r0, 0
- str r0, [sp, 0x10]
- b _08042BCA
- .align 2, 0
-_08042838: .4byte gUnknown_2023DE4
-_0804283C: .4byte gActiveBattler
-_08042840: .4byte 0x00000f88
-_08042844: .4byte gMain
-_08042848: .4byte 0x00000439
-_0804284C: .4byte gBattleMons
-_08042850:
- ldr r1, [sp, 0x14]
- ldr r2, [sp, 0xC]
- adds r0, r1, r2
- ldrb r7, [r0]
- movs r0, 0x20
- ands r0, r7
- cmp r0, 0
- beq _080428B6
- movs r0, 0xDF
- ands r7, r0
- mov r0, r8
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- adds r5, r0, 0
- ldr r0, _080428DC @ =gUnknown_825DEA1
- ldr r1, [sp, 0x8]
- adds r0, r1, r0
- ldrb r0, [r0]
- ands r5, r0
- lsls r0, r1, 1
- lsrs r5, r0
- adds r1, 0xD
- mov r0, r8
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- lsls r4, 16
- lsrs r4, 16
- mov r0, r8
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- adds r1, r0, 0
- lsls r1, 24
- lsrs r1, 24
- adds r0, r4, 0
- ldr r2, [sp, 0x8]
- bl CalculatePPWithBonus
- lsls r0, 24
- lsrs r0, 24
- cmp r5, 0x2
- bhi _080428B6
- cmp r0, 0x4
- bls _080428B6
- movs r2, 0
- str r2, [sp, 0x10]
-_080428B6:
- movs r0, 0
- mov r9, r0
- cmp r7, 0
- bne _080428C0
- b _08042BCA
-_080428C0:
- movs r0, 0x1
- ands r0, r7
- cmp r0, 0
- bne _080428CA
- b _08042A5C
-_080428CA:
- mov r1, r9
- cmp r1, 0x7
- bls _080428D2
- b _08042A5C
-_080428D2:
- lsls r0, r1, 2
- ldr r1, _080428E0 @ =_080428E4
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .align 2, 0
-_080428DC: .4byte gUnknown_825DEA1
-_080428E0: .4byte _080428E4
- .align 2, 0
-_080428E4:
- .4byte _08042904
- .4byte _08042904
- .4byte _08042934
- .4byte _08042996
- .4byte _08042A5C
- .4byte _08042A5C
- .4byte _08042A5C
- .4byte _08042A4A
-_08042904:
- mov r0, r8
- bl GetMonEVCount
- lsls r0, 16
- ldr r1, _0804292C @ =0x01fd0000
- cmp r0, r1
- bls _08042914
- b _08042578
-_08042914:
- ldr r0, _08042930 @ =gUnknown_825DFEA
- add r0, r9
- ldrb r1, [r0]
- mov r0, r8
- movs r2, 0
- bl GetMonData
- adds r5, r0, 0
- cmp r5, 0x63
- bls _0804292A
- b _08042A5C
-_0804292A:
- b _08042A3A
- .align 2, 0
-_0804292C: .4byte 0x01fd0000
-_08042930: .4byte gUnknown_825DFEA
-_08042934:
- movs r0, 0x10
- ands r0, r7
- cmp r0, 0
- beq _08042952
- mov r0, r8
- movs r1, 0x39
- movs r2, 0
- bl GetMonData
- cmp r0, 0
- beq _08042968
- mov r0, r10
- adds r0, 0x1
- lsls r0, 24
- b _080429F4
-_08042952:
- mov r0, r8
- movs r1, 0x39
- movs r2, 0
- bl GetMonData
- cmp r0, 0
- bne _08042968
- mov r0, r10
- adds r0, 0x1
- lsls r0, 24
- b _080429F4
-_08042968:
- mov r0, r8
- movs r1, 0x3A
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- mov r0, r8
- movs r1, 0x39
- movs r2, 0
- bl GetMonData
- cmp r4, r0
- beq _08042986
- movs r0, 0
- str r0, [sp, 0x10]
-_08042986:
- mov r0, r10
- adds r0, 0x1
- lsls r0, 24
- lsrs r0, 24
- mov r10, r0
- movs r0, 0xEF
- ands r7, r0
- b _08042A5C
-_08042996:
- movs r0, 0x2
- ands r0, r7
- cmp r0, 0
- bne _080429FA
- movs r6, 0
- movs r1, 0x1
- add r10, r1
-_080429A4:
- adds r1, r6, 0
- adds r1, 0x11
- mov r0, r8
- movs r2, 0
- bl GetMonData
- adds r5, r0, 0
- adds r1, r6, 0
- adds r1, 0xD
- mov r0, r8
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- lsls r4, 16
- lsrs r4, 16
- mov r0, r8
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- adds r1, r0, 0
- lsls r1, 24
- lsrs r1, 24
- lsls r2, r6, 24
- lsrs r2, 24
- adds r0, r4, 0
- bl CalculatePPWithBonus
- lsls r0, 24
- lsrs r0, 24
- cmp r5, r0
- beq _080429EA
- movs r2, 0
- str r2, [sp, 0x10]
-_080429EA:
- adds r6, 0x1
- cmp r6, 0x3
- ble _080429A4
- mov r1, r10
- lsls r0, r1, 24
-_080429F4:
- lsrs r0, 24
- mov r10, r0
- b _08042A5C
-_080429FA:
- ldr r1, [sp, 0x8]
- adds r1, 0x11
- mov r0, r8
- movs r2, 0
- bl GetMonData
- adds r5, r0, 0
- ldr r1, [sp, 0x8]
- adds r1, 0xD
- mov r0, r8
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- lsls r4, 16
- lsrs r4, 16
- mov r0, r8
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- adds r1, r0, 0
- lsls r1, 24
- lsrs r1, 24
- adds r0, r4, 0
- ldr r2, [sp, 0x8]
- bl CalculatePPWithBonus
- lsls r0, 24
- lsrs r0, 24
- cmp r5, r0
- beq _08042A5C
-_08042A3A:
- mov r0, r10
- adds r0, 0x1
- lsls r0, 24
- lsrs r0, 24
- mov r10, r0
- movs r2, 0
- str r2, [sp, 0x10]
- b _08042A5C
-_08042A4A:
- mov r0, r8
- movs r1, 0x2
- ldr r2, [sp]
- bl sub_8042EC4
- lsls r0, 16
- cmp r0, 0
- beq _08042A5C
- b _08042574
-_08042A5C:
- movs r0, 0x1
- add r9, r0
- lsrs r7, 1
- cmp r7, 0
- beq _08042A68
- b _080428C0
-_08042A68:
- b _08042BCA
-_08042A6A:
- ldr r1, [sp, 0x14]
- ldr r2, [sp, 0xC]
- adds r0, r1, r2
- ldrb r7, [r0]
- movs r0, 0
- mov r9, r0
- cmp r7, 0
- bne _08042A7C
- b _08042BCA
-_08042A7C:
- movs r0, 0x1
- ands r0, r7
- cmp r0, 0
- bne _08042A86
- b _08042BBE
-_08042A86:
- mov r1, r9
- cmp r1, 0x7
- bls _08042A8E
- b _08042BBE
-_08042A8E:
- lsls r0, r1, 2
- ldr r1, _08042A98 @ =_08042A9C
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .align 2, 0
-_08042A98: .4byte _08042A9C
- .align 2, 0
-_08042A9C:
- .4byte _08042ABC
- .4byte _08042ABC
- .4byte _08042ABC
- .4byte _08042ABC
- .4byte _08042AF4
- .4byte _08042B4C
- .4byte _08042B68
- .4byte _08042B92
-_08042ABC:
- mov r0, r8
- bl GetMonEVCount
- lsls r0, 16
- ldr r1, _08042AEC @ =0x01fd0000
- cmp r0, r1
- bls _08042ACC
- b _08042578
-_08042ACC:
- ldr r0, _08042AF0 @ =gUnknown_825DFEA
- mov r1, r9
- adds r1, 0x2
- adds r1, r0
- ldrb r1, [r1]
- mov r0, r8
- movs r2, 0
- bl GetMonData
- adds r5, r0, 0
- cmp r5, 0x63
- bhi _08042BBE
- movs r2, 0
- str r2, [sp, 0x10]
- b _08042BB4
- .align 2, 0
-_08042AEC: .4byte 0x01fd0000
-_08042AF0: .4byte gUnknown_825DFEA
-_08042AF4:
- mov r0, r8
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- adds r5, r0, 0
- ldr r0, _08042B48 @ =gUnknown_825DEA1
- ldr r1, [sp, 0x8]
- adds r0, r1, r0
- ldrb r0, [r0]
- ands r5, r0
- lsls r0, r1, 1
- lsrs r5, r0
- adds r1, 0xD
- mov r0, r8
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- lsls r4, 16
- lsrs r4, 16
- mov r0, r8
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- adds r1, r0, 0
- lsls r1, 24
- lsrs r1, 24
- adds r0, r4, 0
- ldr r2, [sp, 0x8]
- bl CalculatePPWithBonus
- lsls r0, 24
- lsrs r6, r0, 24
- cmp r5, 0x2
- bhi _08042BBE
- cmp r6, 0x4
- ble _08042BBE
- movs r2, 0
- str r2, [sp, 0x10]
- b _08042BBE
- .align 2, 0
-_08042B48: .4byte gUnknown_825DEA1
-_08042B4C:
- mov r0, r8
- movs r1, 0x20
- movs r2, 0
- bl GetMonData
- cmp r0, 0x63
- bhi _08042BB4
- ldr r0, [sp, 0x10]
- cmp r0, 0
- bne _08042BB4
- ldr r1, [sp, 0x18]
- cmp r1, 0
- bne _08042BB4
- b _08042BAC
-_08042B68:
- mov r0, r8
- movs r1, 0x20
- movs r2, 0
- bl GetMonData
- cmp r0, 0x63
- bls _08042BB4
- mov r0, r8
- movs r1, 0x20
- movs r2, 0
- bl GetMonData
- cmp r0, 0xC7
- bhi _08042BB4
- ldr r2, [sp, 0x10]
- cmp r2, 0
- bne _08042BB4
- ldr r0, [sp, 0x18]
- cmp r0, 0
- bne _08042BB4
- b _08042BAC
-_08042B92:
- mov r0, r8
- movs r1, 0x20
- movs r2, 0
- bl GetMonData
- cmp r0, 0xC7
- bls _08042BB4
- ldr r1, [sp, 0x10]
- cmp r1, 0
- bne _08042BB4
- ldr r2, [sp, 0x18]
- cmp r2, 0
- bne _08042BB4
-_08042BAC:
- ldr r0, [sp, 0x14]
- add r0, r10
- ldrb r0, [r0]
- str r0, [sp, 0x18]
-_08042BB4:
- mov r0, r10
- adds r0, 0x1
- lsls r0, 24
- lsrs r0, 24
- mov r10, r0
-_08042BBE:
- movs r0, 0x1
- add r9, r0
- lsrs r7, 1
- cmp r7, 0
- beq _08042BCA
- b _08042A7C
-_08042BCA:
- ldr r1, [sp, 0xC]
- adds r1, 0x1
- str r1, [sp, 0xC]
- cmp r1, 0x5
- bgt _08042BD6
- b _08042582
-_08042BD6:
- ldr r0, [sp, 0x10]
-_08042BD8:
- add sp, 0x20
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end sub_8042414
-
- thumb_func_start sub_8042BE8
-sub_8042BE8: @ 8042BE8
- push {r4,lr}
- adds r4, r2, 0
- movs r1, 0x37
- movs r2, 0
- bl GetMonData
- ands r0, r4
- cmp r0, 0
- bne _08042BFE
- movs r0, 0
- b _08042C00
-_08042BFE:
- movs r0, 0x1
-_08042C00:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end sub_8042BE8
-
- thumb_func_start GetItemEffectParamOffset
-GetItemEffectParamOffset: @ 8042C08
- push {r4-r7,lr}
- lsls r0, 16
- lsrs r3, r0, 16
- lsls r1, 24
- lsrs r4, r1, 24
- lsls r2, 24
- lsrs r5, r2, 24
- movs r7, 0x6
- ldr r1, _08042C30 @ =gUnknown_82528BC
- adds r0, r3, 0
- subs r0, 0xD
- lsls r0, 2
- adds r0, r1
- ldr r0, [r0]
- cmp r0, 0
- bne _08042C34
- cmp r3, 0xAF
- beq _08042C38
-_08042C2C:
- movs r0, 0
- b _08042D48
- .align 2, 0
-_08042C30: .4byte gUnknown_82528BC
-_08042C34:
- cmp r3, 0xAF
- bne _08042C46
-_08042C38:
- ldr r0, _08042C58 @ =gActiveBattler
- ldrb r1, [r0]
- lsls r0, r1, 3
- subs r0, r1
- lsls r0, 2
- ldr r1, _08042C5C @ =gUnknown_2023F5C
- adds r0, r1
-_08042C46:
- mov r12, r0
- movs r2, 0
-_08042C4A:
- cmp r2, 0x4
- beq _08042C6A
- cmp r2, 0x4
- ble _08042C60
- cmp r2, 0x5
- beq _08042CF4
- b _08042D3E
- .align 2, 0
-_08042C58: .4byte gActiveBattler
-_08042C5C: .4byte gUnknown_2023F5C
-_08042C60:
- cmp r2, 0
- blt _08042D3E
- cmp r2, r4
- bne _08042D3E
- b _08042C2C
-_08042C6A:
- mov r0, r12
- ldrb r3, [r0, 0x4]
- movs r0, 0x20
- ands r0, r3
- cmp r0, 0
- beq _08042C7A
- movs r0, 0xDF
- ands r3, r0
-_08042C7A:
- movs r6, 0
- cmp r3, 0
- beq _08042D3E
-_08042C80:
- movs r0, 0x1
- ands r0, r3
- cmp r0, 0
- beq _08042CE0
- cmp r6, 0x7
- bhi _08042CE0
- lsls r0, r6, 2
- ldr r1, _08042C98 @ =_08042C9C
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .align 2, 0
-_08042C98: .4byte _08042C9C
- .align 2, 0
-_08042C9C:
- .4byte _08042CC8
- .4byte _08042CC8
- .4byte _08042CBC
- .4byte _08042CC8
- .4byte _08042CE0
- .4byte _08042CE0
- .4byte _08042CE0
- .4byte _08042CDC
-_08042CBC:
- movs r0, 0x10
- ands r0, r3
- cmp r0, 0
- beq _08042CC8
- movs r0, 0xEF
- ands r3, r0
-_08042CC8:
- cmp r2, r4
- bne _08042CD4
- adds r0, r3, 0
- ands r0, r5
- cmp r0, 0
- bne _08042D46
-_08042CD4:
- adds r0, r7, 0x1
- lsls r0, 24
- lsrs r7, r0, 24
- b _08042CE0
-_08042CDC:
- cmp r2, r4
- beq _08042C2C
-_08042CE0:
- adds r0, r6, 0x1
- lsls r0, 24
- lsrs r6, r0, 24
- lsrs r3, 1
- cmp r2, r4
- bne _08042CEE
- lsrs r5, 1
-_08042CEE:
- cmp r3, 0
- bne _08042C80
- b _08042D3E
-_08042CF4:
- mov r0, r12
- ldrb r3, [r0, 0x5]
- movs r6, 0
-_08042CFA:
- cmp r3, 0
- beq _08042D3E
- movs r0, 0x1
- ands r0, r3
- cmp r0, 0
- beq _08042D2E
- cmp r6, 0
- blt _08042D2E
- cmp r6, 0x6
- ble _08042D14
- cmp r6, 0x7
- beq _08042D28
- b _08042D2E
-_08042D14:
- cmp r2, r4
- bne _08042D20
- adds r0, r3, 0
- ands r0, r5
- cmp r0, 0
- bne _08042D46
-_08042D20:
- adds r0, r7, 0x1
- lsls r0, 24
- lsrs r7, r0, 24
- b _08042D2E
-_08042D28:
- cmp r2, r4
- bne _08042D2E
- b _08042C2C
-_08042D2E:
- adds r0, r6, 0x1
- lsls r0, 24
- lsrs r6, r0, 24
- lsrs r3, 1
- cmp r2, r4
- bne _08042CFA
- lsrs r5, 1
- b _08042CFA
-_08042D3E:
- adds r2, 0x1
- cmp r2, 0x5
- bgt _08042D46
- b _08042C4A
-_08042D46:
- adds r0, r7, 0
-_08042D48:
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end GetItemEffectParamOffset
-
- thumb_func_start sub_8042D50
-sub_8042D50: @ 8042D50
- push {lr}
- ldr r2, _08042D84 @ =gBattlerTarget
- ldr r1, _08042D88 @ =gUnknown_2024004
- ldrb r1, [r1]
- strb r1, [r2]
- ldr r3, _08042D8C @ =gUnknown_2022AB8
- ldr r2, _08042D90 @ =gUnknown_83FD5D0
- ldr r1, _08042D94 @ =gUnknown_825DFF0
- adds r0, r1
- ldrb r0, [r0]
- lsls r0, 2
- adds r0, r2
- ldr r1, [r0]
- adds r0, r3, 0
- bl StringCopy
- ldr r0, _08042D98 @ =gUnknown_2022AC8
- ldr r1, _08042D9C @ =gUnknown_83FCB4A
- bl StringCopy
- ldr r0, _08042DA0 @ =gUnknown_83FCB6A
- bl BattleStringExpandPlaceholdersToDisplayedString
- pop {r0}
- bx r0
- .align 2, 0
-_08042D84: .4byte gBattlerTarget
-_08042D88: .4byte gUnknown_2024004
-_08042D8C: .4byte gUnknown_2022AB8
-_08042D90: .4byte gUnknown_83FD5D0
-_08042D94: .4byte gUnknown_825DFF0
-_08042D98: .4byte gUnknown_2022AC8
-_08042D9C: .4byte gUnknown_83FCB4A
-_08042DA0: .4byte gUnknown_83FCB6A
- thumb_func_end sub_8042D50
-
- thumb_func_start sub_8042DA4
-sub_8042DA4: @ 8042DA4
- push {r4-r7,lr}
- mov r7, r8
- push {r7}
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0xAF
- bne _08042DF8
- ldr r0, _08042DD4 @ =gMain
- ldr r1, _08042DD8 @ =0x00000439
- adds r0, r1
- ldrb r1, [r0]
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- beq _08042DE4
- ldr r2, _08042DDC @ =gUnknown_2024004
- ldrb r1, [r2]
- lsls r0, r1, 3
- subs r0, r1
- lsls r0, 2
- ldr r1, _08042DE0 @ =gUnknown_2023F5C
- adds r7, r0, r1
- b _08042E04
- .align 2, 0
-_08042DD4: .4byte gMain
-_08042DD8: .4byte 0x00000439
-_08042DDC: .4byte gUnknown_2024004
-_08042DE0: .4byte gUnknown_2023F5C
-_08042DE4:
- ldr r0, _08042DF0 @ =gSaveBlock1Ptr
- ldr r0, [r0]
- ldr r1, _08042DF4 @ =0x00003108
- adds r7, r0, r1
- b _08042E02
- .align 2, 0
-_08042DF0: .4byte gSaveBlock1Ptr
-_08042DF4: .4byte 0x00003108
-_08042DF8:
- ldr r1, _08042E3C @ =gUnknown_82528BC
- subs r0, 0xD
- lsls r0, 2
- adds r0, r1
- ldr r7, [r0]
-_08042E02:
- ldr r2, _08042E40 @ =gUnknown_2024004
-_08042E04:
- ldr r1, _08042E44 @ =gUnknown_2023D6F
- ldrb r0, [r2]
- strb r0, [r1]
- movs r5, 0
- ldr r0, _08042E48 @ =sBattler_AI
- mov r8, r0
- movs r6, 0
-_08042E12:
- adds r4, r7, r5
- ldrb r1, [r4]
- movs r0, 0xF
- ands r0, r1
- cmp r0, 0
- beq _08042E24
- adds r0, r6, 0
- bl sub_8042D50
-_08042E24:
- ldrb r1, [r4]
- movs r0, 0xF0
- ands r0, r1
- cmp r0, 0
- beq _08042E5A
- cmp r5, 0
- beq _08042E4C
- adds r0, r6, 0x1
- bl sub_8042D50
- b _08042E5A
- .align 2, 0
-_08042E3C: .4byte gUnknown_82528BC
-_08042E40: .4byte gUnknown_2024004
-_08042E44: .4byte gUnknown_2023D6F
-_08042E48: .4byte sBattler_AI
-_08042E4C:
- ldr r0, _08042E88 @ =gUnknown_2024004
- ldrb r0, [r0]
- mov r1, r8
- strb r0, [r1]
- ldr r0, _08042E8C @ =gUnknown_83FBBE9
- bl BattleStringExpandPlaceholdersToDisplayedString
-_08042E5A:
- adds r6, 0x2
- adds r5, 0x1
- cmp r5, 0x2
- ble _08042E12
- ldrb r1, [r7, 0x3]
- movs r0, 0x80
- ands r0, r1
- cmp r0, 0
- beq _08042E7A
- ldr r1, _08042E90 @ =sBattler_AI
- ldr r0, _08042E88 @ =gUnknown_2024004
- ldrb r0, [r0]
- strb r0, [r1]
- ldr r0, _08042E94 @ =gUnknown_83FBBB4
- bl BattleStringExpandPlaceholdersToDisplayedString
-_08042E7A:
- ldr r0, _08042E98 @ =gUnknown_202298C
- pop {r3}
- mov r8, r3
- pop {r4-r7}
- pop {r1}
- bx r1
- .align 2, 0
-_08042E88: .4byte gUnknown_2024004
-_08042E8C: .4byte gUnknown_83FBBE9
-_08042E90: .4byte sBattler_AI
-_08042E94: .4byte gUnknown_83FBBB4
-_08042E98: .4byte gUnknown_202298C
- thumb_func_end sub_8042DA4
-
- thumb_func_start GetNature
-GetNature: @ 8042E9C
- push {lr}
- movs r1, 0
- movs r2, 0
- bl GetMonData
- movs r1, 0x19
- bl __umodsi3
- lsls r0, 24
- lsrs r0, 24
- pop {r1}
- bx r1
- thumb_func_end GetNature
-
- thumb_func_start GetNatureFromPersonality
-GetNatureFromPersonality: @ 8042EB4
- push {lr}
- movs r1, 0x19
- bl __umodsi3
- lsls r0, 24
- lsrs r0, 24
- pop {r1}
- bx r1
- thumb_func_end GetNatureFromPersonality
-
- thumb_func_start sub_8042EC4
-sub_8042EC4: @ 8042EC4
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x14
- mov r8, r0
- lsls r1, 24
- lsrs r5, r1, 24
- lsls r2, 16
- lsrs r2, 16
- mov r9, r2
- movs r0, 0
- mov r10, r0
- mov r0, r8
- movs r1, 0xB
- movs r2, 0
- bl GetMonData
- lsls r0, 16
- lsrs r7, r0, 16
- mov r0, r8
- movs r1, 0xC
- movs r2, 0
- bl GetMonData
- mov r1, sp
- strh r0, [r1]
- mov r0, r8
- movs r1, 0
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- mov r0, r8
- movs r1, 0x17
- movs r2, 0
- bl GetMonData
- lsls r0, 24
- lsrs r0, 24
- str r0, [sp, 0xC]
- lsrs r4, 16
- str r4, [sp, 0x10]
- mov r0, sp
- ldrh r0, [r0]
- cmp r0, 0xAF
- bne _08042F38
- ldr r0, _08042F30 @ =gSaveBlock1Ptr
- ldr r0, [r0]
- ldr r1, _08042F34 @ =0x0000311a
- adds r0, r1
- ldrb r0, [r0]
- b _08042F40
- .align 2, 0
-_08042F30: .4byte gSaveBlock1Ptr
-_08042F34: .4byte 0x0000311a
-_08042F38:
- bl ItemId_GetHoldEffect
- lsls r0, 24
- lsrs r0, 24
-_08042F40:
- cmp r0, 0x26
- bne _08042F4C
- cmp r5, 0x3
- beq _08042F4C
- movs r0, 0
- b _080431A4
-_08042F4C:
- cmp r5, 0x1
- bne _08042F52
- b _0804311E
-_08042F52:
- cmp r5, 0x1
- bgt _08042F5C
- cmp r5, 0
- beq _08042F70
- b _080431A2
-_08042F5C:
- cmp r5, 0x3
- ble _08042F62
- b _080431A2
-_08042F62:
- movs r2, 0
- str r2, [sp, 0x4]
- ldr r3, _08042F6C @ =gUnknown_8259754
- lsls r6, r7, 2
- b _08043182
- .align 2, 0
-_08042F6C: .4byte gUnknown_8259754
-_08042F70:
- mov r0, r8
- movs r1, 0x38
- movs r2, 0
- bl GetMonData
- lsls r0, 24
- lsrs r0, 24
- mov r9, r0
- mov r0, r8
- movs r1, 0x20
- movs r2, 0
- bl GetMonData
- lsls r0, 16
- lsrs r0, 16
- str r0, [sp, 0x8]
- movs r0, 0
- str r0, [sp, 0x4]
- lsls r6, r7, 2
-_08042F96:
- ldr r1, _08042FBC @ =gUnknown_8259754
- ldr r0, [sp, 0x4]
- lsls r2, r0, 3
- adds r0, r6, r7
- lsls r0, 3
- adds r0, r2, r0
- adds r0, r1
- ldrh r0, [r0]
- subs r0, 0x1
- adds r3, r1, 0
- cmp r0, 0xE
- bls _08042FB0
- b _08043110
-_08042FB0:
- lsls r0, 2
- ldr r1, _08042FC0 @ =_08042FC4
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .align 2, 0
-_08042FBC: .4byte gUnknown_8259754
-_08042FC0: .4byte _08042FC4
- .align 2, 0
-_08042FC4:
- .4byte _08043000
- .4byte _08043110
- .4byte _08043110
- .4byte _08043016
- .4byte _08043110
- .4byte _08043110
- .4byte _08043110
- .4byte _08043026
- .4byte _08043050
- .4byte _0804307A
- .4byte _080430A8
- .4byte _080430C8
- .4byte _080430EC
- .4byte _08043110
- .4byte _080430FC
-_08043000:
- ldr r1, [sp, 0x8]
- cmp r1, 0xDB
- bhi _08043008
- b _08043110
-_08043008:
- adds r0, r6, r7
- lsls r0, 3
- adds r0, r2, r0
- adds r0, r3
- ldrh r0, [r0, 0x4]
- mov r10, r0
- b _08043110
-_08043016:
- adds r0, r6, r7
- lsls r0, 3
- adds r0, r2, r0
- adds r1, r0, r3
- ldrh r0, [r1, 0x2]
- cmp r0, r9
- bhi _08043110
- b _0804310C
-_08043026:
- adds r0, r6, r7
- lsls r0, 3
- adds r0, r2, r0
- adds r5, r0, r3
- ldrh r0, [r5, 0x2]
- cmp r0, r9
- bhi _08043110
- mov r0, r8
- movs r1, 0x3B
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- mov r0, r8
- movs r1, 0x3C
- movs r2, 0
- bl GetMonData
- cmp r4, r0
- bls _08043110
- b _080430A2
-_08043050:
- adds r0, r6, r7
- lsls r0, 3
- adds r0, r2, r0
- adds r5, r0, r3
- ldrh r0, [r5, 0x2]
- cmp r0, r9
- bhi _08043110
- mov r0, r8
- movs r1, 0x3B
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- mov r0, r8
- movs r1, 0x3C
- movs r2, 0
- bl GetMonData
- cmp r4, r0
- bne _08043110
- b _080430A2
-_0804307A:
- adds r0, r6, r7
- lsls r0, 3
- adds r0, r2, r0
- adds r5, r0, r3
- ldrh r0, [r5, 0x2]
- cmp r0, r9
- bhi _08043110
- mov r0, r8
- movs r1, 0x3B
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- mov r0, r8
- movs r1, 0x3C
- movs r2, 0
- bl GetMonData
- cmp r4, r0
- bcs _08043110
-_080430A2:
- ldrh r5, [r5, 0x4]
- mov r10, r5
- b _08043110
-_080430A8:
- adds r0, r6, r7
- lsls r0, 3
- adds r0, r2, r0
- adds r4, r0, r3
- ldrh r0, [r4, 0x2]
- cmp r0, r9
- bhi _08043110
- ldr r0, [sp, 0x10]
- movs r1, 0xA
- bl __umodsi3
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0x4
- bhi _08043110
- b _080430E6
-_080430C8:
- adds r0, r6, r7
- lsls r0, 3
- adds r0, r2, r0
- adds r4, r0, r3
- ldrh r0, [r4, 0x2]
- cmp r0, r9
- bhi _08043110
- ldr r0, [sp, 0x10]
- movs r1, 0xA
- bl __umodsi3
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0x4
- bls _08043110
-_080430E6:
- ldrh r4, [r4, 0x4]
- mov r10, r4
- b _08043110
-_080430EC:
- adds r0, r6, r7
- lsls r0, 3
- adds r0, r2, r0
- adds r1, r0, r3
- ldrh r0, [r1, 0x2]
- cmp r0, r9
- bhi _08043110
- b _0804310C
-_080430FC:
- adds r0, r6, r7
- lsls r0, 3
- adds r0, r2, r0
- adds r1, r0, r3
- ldrh r0, [r1, 0x2]
- ldr r2, [sp, 0xC]
- cmp r0, r2
- bhi _08043110
-_0804310C:
- ldrh r1, [r1, 0x4]
- mov r10, r1
-_08043110:
- ldr r0, [sp, 0x4]
- adds r0, 0x1
- str r0, [sp, 0x4]
- cmp r0, 0x4
- bgt _0804311C
- b _08042F96
-_0804311C:
- b _080431A2
-_0804311E:
- movs r1, 0
- str r1, [sp, 0x4]
- lsls r6, r7, 2
- ldr r1, _08043138 @ =gUnknown_8259754
- adds r0, r6, r7
- lsls r0, 3
- adds r4, r0, r1
-_0804312C:
- ldrh r0, [r4]
- cmp r0, 0x5
- beq _0804313C
- cmp r0, 0x6
- beq _08043142
- b _0804316E
- .align 2, 0
-_08043138: .4byte gUnknown_8259754
-_0804313C:
- ldrh r2, [r4, 0x4]
- mov r10, r2
- b _0804316E
-_08043142:
- ldrh r1, [r4, 0x2]
- mov r0, sp
- ldrh r0, [r0]
- cmp r1, r0
- bne _0804316E
- ldrh r0, [r4, 0x4]
- mov r10, r0
- bl sub_806E25C
- cmp r0, 0
- bne _0804315E
- mov r1, r10
- cmp r1, 0x97
- bhi _0804316E
-_0804315E:
- movs r1, 0
- mov r0, sp
- strh r1, [r0]
- mov r0, r8
- movs r1, 0xC
- mov r2, sp
- bl sub_804037C
-_0804316E:
- adds r4, 0x8
- ldr r2, [sp, 0x4]
- adds r2, 0x1
- str r2, [sp, 0x4]
- cmp r2, 0x4
- ble _0804312C
- b _080431A2
-_0804317C:
- ldrh r1, [r1, 0x4]
- mov r10, r1
- b _080431A2
-_08043182:
- adds r0, r6, r7
- ldr r1, [sp, 0x4]
- adds r0, r1
- lsls r0, 3
- adds r1, r0, r3
- ldrh r0, [r1]
- cmp r0, 0x7
- bne _08043198
- ldrh r0, [r1, 0x2]
- cmp r0, r9
- beq _0804317C
-_08043198:
- ldr r2, [sp, 0x4]
- adds r2, 0x1
- str r2, [sp, 0x4]
- cmp r2, 0x4
- ble _08043182
-_080431A2:
- mov r0, r10
-_080431A4:
- add sp, 0x14
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end sub_8042EC4
-
- thumb_func_start sub_80431B4
-sub_80431B4: @ 80431B4
- push {r4,lr}
- lsls r0, 16
- lsrs r2, r0, 16
- cmp r2, 0
- beq _080431F8
- movs r1, 0
- ldr r3, _080431F0 @ =gUnknown_8251CB8
- ldrh r0, [r3]
- cmp r0, r2
- beq _080431E0
- movs r4, 0xCD
- lsls r4, 1
-_080431CC:
- adds r0, r1, 0x1
- lsls r0, 16
- lsrs r1, r0, 16
- cmp r1, r4
- bhi _080431E0
- lsls r0, r1, 1
- adds r0, r3
- ldrh r0, [r0]
- cmp r0, r2
- bne _080431CC
-_080431E0:
- ldr r0, _080431F4 @ =0x0000019b
- cmp r1, r0
- beq _080431F8
- adds r0, r1, 0x1
- lsls r0, 16
- lsrs r0, 16
- b _080431FA
- .align 2, 0
-_080431F0: .4byte gUnknown_8251CB8
-_080431F4: .4byte 0x0000019b
-_080431F8:
- movs r0, 0
-_080431FA:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end sub_80431B4
-
- thumb_func_start NationalPokedexNumToSpecies
-NationalPokedexNumToSpecies: @ 8043200
- push {r4,lr}
- lsls r0, 16
- lsrs r2, r0, 16
- cmp r2, 0
- beq _08043244
- movs r1, 0
- ldr r3, _0804323C @ =gUnknown_8251FEE
- ldrh r0, [r3]
- cmp r0, r2
- beq _0804322C
- movs r4, 0xCD
- lsls r4, 1
-_08043218:
- adds r0, r1, 0x1
- lsls r0, 16
- lsrs r1, r0, 16
- cmp r1, r4
- bhi _0804322C
- lsls r0, r1, 1
- adds r0, r3
- ldrh r0, [r0]
- cmp r0, r2
- bne _08043218
-_0804322C:
- ldr r0, _08043240 @ =0x0000019b
- cmp r1, r0
- beq _08043244
- adds r0, r1, 0x1
- lsls r0, 16
- lsrs r0, 16
- b _08043246
- .align 2, 0
-_0804323C: .4byte gUnknown_8251FEE
-_08043240: .4byte 0x0000019b
-_08043244:
- movs r0, 0
-_08043246:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end NationalPokedexNumToSpecies
-
- thumb_func_start sub_804324C
-sub_804324C: @ 804324C
- push {r4,lr}
- lsls r0, 16
- lsrs r2, r0, 16
- cmp r2, 0
- beq _08043290
- movs r1, 0
- ldr r3, _08043288 @ =gUnknown_8252324
- ldrh r0, [r3]
- cmp r0, r2
- beq _08043278
- movs r4, 0xCD
- lsls r4, 1
-_08043264:
- adds r0, r1, 0x1
- lsls r0, 16
- lsrs r1, r0, 16
- cmp r1, r4
- bhi _08043278
- lsls r0, r1, 1
- adds r0, r3
- ldrh r0, [r0]
- cmp r0, r2
- bne _08043264
-_08043278:
- ldr r0, _0804328C @ =0x0000019b
- cmp r1, r0
- beq _08043290
- adds r0, r1, 0x1
- lsls r0, 16
- lsrs r0, 16
- b _08043292
- .align 2, 0
-_08043288: .4byte gUnknown_8252324
-_0804328C: .4byte 0x0000019b
-_08043290:
- movs r0, 0
-_08043292:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end sub_804324C
-
- thumb_func_start SpeciesToNationalPokedexNum
-SpeciesToNationalPokedexNum: @ 8043298
- push {lr}
- lsls r0, 16
- lsrs r1, r0, 16
- cmp r1, 0
- beq _080432B4
- ldr r0, _080432B0 @ =gUnknown_8251FEE
- subs r1, 0x1
- lsls r1, 1
- adds r1, r0
- ldrh r0, [r1]
- b _080432B6
- .align 2, 0
-_080432B0: .4byte gUnknown_8251FEE
-_080432B4:
- movs r0, 0
-_080432B6:
- pop {r1}
- bx r1
- thumb_func_end SpeciesToNationalPokedexNum
-
- thumb_func_start SpeciesToHoennPokedexNum
-SpeciesToHoennPokedexNum: @ 80432BC
- push {lr}
- lsls r0, 16
- lsrs r1, r0, 16
- cmp r1, 0
- beq _080432D8
- ldr r0, _080432D4 @ =gUnknown_8251CB8
- subs r1, 0x1
- lsls r1, 1
- adds r1, r0
- ldrh r0, [r1]
- b _080432DA
- .align 2, 0
-_080432D4: .4byte gUnknown_8251CB8
-_080432D8:
- movs r0, 0
-_080432DA:
- pop {r1}
- bx r1
- thumb_func_end SpeciesToHoennPokedexNum
-
- thumb_func_start HoennToNationalOrder
-HoennToNationalOrder: @ 80432E0
- push {lr}
- lsls r0, 16
- lsrs r1, r0, 16
- cmp r1, 0
- beq _080432FC
- ldr r0, _080432F8 @ =gUnknown_8252324
- subs r1, 0x1
- lsls r1, 1
- adds r1, r0
- ldrh r0, [r1]
- b _080432FE
- .align 2, 0
-_080432F8: .4byte gUnknown_8252324
-_080432FC:
- movs r0, 0
-_080432FE:
- pop {r1}
- bx r1
- thumb_func_end HoennToNationalOrder
-
- thumb_func_start SpeciesToCryId
-SpeciesToCryId: @ 8043304
- push {lr}
- lsls r0, 16
- lsrs r0, 16
- adds r1, r0, 0
- cmp r0, 0xFA
- bls _08043332
- ldr r0, _08043324 @ =0x00000113
- cmp r1, r0
- bls _08043330
- ldr r0, _08043328 @ =gUnknown_82539D4
- ldr r2, _0804332C @ =0xfffffeec
- adds r1, r2
- lsls r1, 1
- adds r1, r0
- ldrh r0, [r1]
- b _08043332
- .align 2, 0
-_08043324: .4byte 0x00000113
-_08043328: .4byte gUnknown_82539D4
-_0804332C: .4byte 0xfffffeec
-_08043330:
- movs r0, 0xC8
-_08043332:
- pop {r1}
- bx r1
- thumb_func_end SpeciesToCryId
-
- thumb_func_start sub_8043338
-sub_8043338: @ 8043338
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x8
- adds r6, r1, 0
- mov r10, r2
- lsls r0, 16
- movs r1, 0x9A
- lsls r1, 17
- cmp r0, r1
- bne _08043446
- ldr r0, _08043408 @ =gUnknown_202401C
- ldr r1, [r0]
- ldr r0, [r1, 0x4]
- cmp r10, r0
- beq _08043446
- ldr r0, [r1, 0xC]
- cmp r10, r0
- beq _08043446
- movs r5, 0
-_08043364:
- lsls r3, r5, 3
- adds r3, r5
- lsls r3, 2
- ldr r0, _0804340C @ =gUnknown_825265C
- adds r4, r3, r0
- ldrb r1, [r4]
- adds r1, 0xF8
- movs r2, 0xF
- adds r0, r6, 0
- ands r0, r2
- adds r1, r0
- lsls r1, 24
- lsrs r1, 24
- mov r12, r1
- ldrb r1, [r4, 0x1]
- adds r1, 0xF8
- movs r0, 0xF0
- ands r0, r6
- lsrs r0, 4
- adds r1, r0
- lsls r1, 24
- lsrs r1, 24
- movs r2, 0
- lsrs r6, 8
- str r6, [sp, 0x4]
- adds r5, 0x1
- str r5, [sp]
- mov r9, r3
-_0804339C:
- lsls r0, r2, 1
- add r0, r9
- ldr r3, _08043410 @ =gUnknown_825265E
- adds r0, r3
- ldrh r3, [r0]
- mov r4, r12
- adds r0, r4, 0
- adds r0, 0x10
- adds r7, r1, 0x1
- adds r2, 0x1
- mov r8, r2
- cmp r4, r0
- bge _08043434
- lsrs r0, r1, 3
- lsls r6, r0, 8
- movs r0, 0x7
- ands r1, r0
- lsls r5, r1, 2
-_080433C0:
- adds r0, r4, 0
- cmp r4, 0
- bge _080433C8
- adds r0, r4, 0x7
-_080433C8:
- asrs r0, 3
- lsls r2, r0, 5
- add r2, r10
- lsls r0, 3
- subs r0, r4, r0
- lsrs r1, r0, 31
- adds r0, r1
- asrs r0, 1
- adds r2, r0
- adds r2, r6
- adds r2, r5
- movs r1, 0x1
- adds r0, r3, 0
- ands r0, r1
- cmp r0, 0
- beq _08043428
- adds r0, r4, 0
- ands r0, r1
- cmp r0, 0
- beq _08043414
- ldrb r1, [r2]
- movs r0, 0xF0
- ands r0, r1
- subs r0, 0x10
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x20
- bhi _08043428
- adds r0, r1, 0
- adds r0, 0x40
- b _08043426
- .align 2, 0
-_08043408: .4byte gUnknown_202401C
-_0804340C: .4byte gUnknown_825265C
-_08043410: .4byte gUnknown_825265E
-_08043414:
- ldrb r1, [r2]
- movs r0, 0xF
- ands r0, r1
- subs r0, 0x1
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x2
- bhi _08043428
- adds r0, r1, 0x4
-_08043426:
- strb r0, [r2]
-_08043428:
- asrs r3, 1
- adds r4, 0x1
- mov r0, r12
- adds r0, 0x10
- cmp r4, r0
- blt _080433C0
-_08043434:
- lsls r0, r7, 24
- lsrs r1, r0, 24
- mov r2, r8
- cmp r2, 0xF
- ble _0804339C
- ldr r6, [sp, 0x4]
- ldr r5, [sp]
- cmp r5, 0x3
- ble _08043364
-_08043446:
- add sp, 0x8
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- thumb_func_end sub_8043338
-
- thumb_func_start DrawSpindaSpots
-DrawSpindaSpots: @ 8043458
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x8
- adds r5, r1, 0
- str r2, [sp]
- lsls r0, 16
- lsls r3, 24
- lsrs r3, 24
- movs r1, 0x9A
- lsls r1, 17
- cmp r0, r1
- bne _0804355A
- cmp r3, 0
- beq _0804355A
- movs r6, 0
-_0804347C:
- lsls r3, r6, 3
- adds r3, r6
- lsls r3, 2
- ldr r0, _08043520 @ =gUnknown_825265C
- adds r4, r3, r0
- ldrb r1, [r4]
- adds r1, 0xF8
- movs r2, 0xF
- adds r0, r5, 0
- ands r0, r2
- adds r1, r0
- lsls r1, 24
- lsrs r1, 24
- mov r12, r1
- ldrb r1, [r4, 0x1]
- adds r1, 0xF8
- movs r0, 0xF0
- ands r0, r5
- lsrs r0, 4
- adds r1, r0
- lsls r1, 24
- lsrs r1, 24
- movs r2, 0
- lsrs r5, 8
- str r5, [sp, 0x4]
- adds r6, 0x1
- mov r10, r6
- mov r9, r3
-_080434B4:
- lsls r0, r2, 1
- add r0, r9
- ldr r3, _08043524 @ =gUnknown_825265E
- adds r0, r3
- ldrh r3, [r0]
- mov r4, r12
- adds r0, r4, 0
- adds r0, 0x10
- adds r7, r1, 0x1
- adds r2, 0x1
- mov r8, r2
- cmp r4, r0
- bge _08043548
- lsrs r0, r1, 3
- lsls r6, r0, 8
- movs r0, 0x7
- ands r1, r0
- lsls r5, r1, 2
-_080434D8:
- adds r0, r4, 0
- cmp r4, 0
- bge _080434E0
- adds r0, r4, 0x7
-_080434E0:
- asrs r0, 3
- lsls r2, r0, 5
- ldr r1, [sp]
- adds r2, r1, r2
- lsls r0, 3
- subs r0, r4, r0
- lsrs r1, r0, 31
- adds r0, r1
- asrs r0, 1
- adds r2, r0
- adds r2, r6
- adds r2, r5
- movs r1, 0x1
- adds r0, r3, 0
- ands r0, r1
- cmp r0, 0
- beq _0804353C
- adds r0, r4, 0
- ands r0, r1
- cmp r0, 0
- beq _08043528
- ldrb r1, [r2]
- movs r0, 0xF0
- ands r0, r1
- subs r0, 0x10
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x20
- bhi _0804353C
- adds r0, r1, 0
- adds r0, 0x40
- b _0804353A
- .align 2, 0
-_08043520: .4byte gUnknown_825265C
-_08043524: .4byte gUnknown_825265E
-_08043528:
- ldrb r1, [r2]
- movs r0, 0xF
- ands r0, r1
- subs r0, 0x1
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x2
- bhi _0804353C
- adds r0, r1, 0x4
-_0804353A:
- strb r0, [r2]
-_0804353C:
- asrs r3, 1
- adds r4, 0x1
- mov r0, r12
- adds r0, 0x10
- cmp r4, r0
- blt _080434D8
-_08043548:
- lsls r0, r7, 24
- lsrs r1, r0, 24
- mov r2, r8
- cmp r2, 0xF
- ble _080434B4
- ldr r5, [sp, 0x4]
- mov r6, r10
- cmp r6, 0x3
- ble _0804347C
-_0804355A:
- add sp, 0x8
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- thumb_func_end DrawSpindaSpots
-
- thumb_func_start EvolutionRenameMon
-EvolutionRenameMon: @ 804356C
- push {r4-r7,lr}
- mov r7, r9
- mov r6, r8
- push {r6,r7}
- sub sp, 0x4
- adds r5, r0, 0
- lsls r1, 16
- lsrs r7, r1, 16
- lsls r2, 16
- lsrs r2, 16
- mov r8, r2
- ldr r0, _080435D8 @ =gStringVar1
- mov r9, r0
- adds r0, r5, 0
- movs r1, 0x2
- mov r2, r9
- bl GetMonData
- mov r4, sp
- adds r0, r5, 0
- movs r1, 0x3
- mov r2, sp
- bl GetMonData
- strb r0, [r4]
- lsls r0, 24
- lsrs r0, 24
- cmp r0, 0x2
- bne _080435C8
- movs r6, 0xB
- adds r0, r7, 0
- muls r0, r6
- ldr r4, _080435DC @ =gUnknown_8245EE0
- adds r0, r4
- mov r1, r9
- bl StringCompare
- cmp r0, 0
- bne _080435C8
- mov r2, r8
- muls r2, r6
- adds r2, r4
- adds r0, r5, 0
- movs r1, 0x2
- bl sub_804037C
-_080435C8:
- add sp, 0x4
- pop {r3,r4}
- mov r8, r3
- mov r9, r4
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_080435D8: .4byte gStringVar1
-_080435DC: .4byte gUnknown_8245EE0
- thumb_func_end EvolutionRenameMon
-
- thumb_func_start sub_80435E0
-sub_80435E0: @ 80435E0
- push {r4,r5,lr}
- movs r5, 0
- ldr r4, _08043608 @ =gUnknown_202273C
- bl GetMultiplayerId
- lsls r0, 24
- lsrs r0, 24
- lsls r1, r0, 3
- subs r1, r0
- lsls r1, 2
- adds r1, r4
- ldrh r0, [r1, 0x18]
- cmp r0, 0x2
- bgt _0804360C
- cmp r0, 0x1
- bge _08043614
- cmp r0, 0
- beq _08043610
- b _08043616
- .align 2, 0
-_08043608: .4byte gUnknown_202273C
-_0804360C:
- cmp r0, 0x3
- bne _08043616
-_08043610:
- movs r5, 0
- b _08043616
-_08043614:
- movs r5, 0x1
-_08043616:
- adds r0, r5, 0
- pop {r4,r5}
- pop {r1}
- bx r1
- thumb_func_end sub_80435E0
-
- thumb_func_start sub_8043620
-sub_8043620: @ 8043620
- push {lr}
- lsls r0, 24
- lsrs r0, 24
- movs r3, 0
- ldr r2, _08043644 @ =gUnknown_202273C
- lsls r1, r0, 3
- subs r1, r0
- lsls r1, 2
- adds r1, r2
- ldrh r0, [r1, 0x18]
- cmp r0, 0x2
- bgt _08043648
- cmp r0, 0x1
- bge _08043650
- cmp r0, 0
- beq _0804364C
- b _08043652
- .align 2, 0
-_08043644: .4byte gUnknown_202273C
-_08043648:
- cmp r0, 0x3
- bne _08043652
-_0804364C:
- movs r3, 0
- b _08043652
-_08043650:
- movs r3, 0x1
-_08043652:
- adds r0, r3, 0
- pop {r1}
- bx r1
- thumb_func_end sub_8043620
-
- thumb_func_start GetBankMultiplayerId
-GetBankMultiplayerId: @ 8043658
- push {lr}
- lsls r0, 16
- lsrs r3, r0, 16
- movs r2, 0
- ldr r1, _08043664 @ =gUnknown_202273C
- b _08043670
- .align 2, 0
-_08043664: .4byte gUnknown_202273C
-_08043668:
- adds r1, 0x1C
- adds r2, 0x1
- cmp r2, 0x3
- bgt _08043676
-_08043670:
- ldrh r0, [r1, 0x18]
- cmp r0, r3
- bne _08043668
-_08043676:
- adds r0, r2, 0
- pop {r1}
- bx r1
- thumb_func_end GetBankMultiplayerId
-
- thumb_func_start sub_804367C
-sub_804367C: @ 804367C
- lsls r0, 16
- lsrs r0, 16
- ldr r2, _08043694 @ =gTrainers
- lsls r1, r0, 2
- adds r1, r0
- lsls r1, 3
- adds r1, r2
- ldrb r1, [r1, 0x2]
- movs r0, 0x7F
- ands r0, r1
- bx lr
- .align 2, 0
-_08043694: .4byte gTrainers
- thumb_func_end sub_804367C
-
- thumb_func_start nature_stat_mod
-nature_stat_mod: @ 8043698
- push {r4,r5,lr}
- lsls r0, 24
- lsrs r4, r0, 24
- lsls r1, 16
- lsrs r3, r1, 16
- lsls r2, 24
- lsrs r5, r2, 24
- movs r0, 0xFF
- lsls r0, 24
- adds r2, r0
- lsrs r2, 24
- cmp r2, 0x4
- bls _080436B6
- adds r0, r3, 0
- b _080436F2
-_080436B6:
- ldr r0, _080436D8 @ =gUnknown_8252B48
- lsls r1, r4, 2
- adds r1, r4
- subs r1, 0x1
- adds r1, r5, r1
- adds r1, r0
- ldrb r1, [r1]
- lsls r1, 24
- asrs r1, 24
- movs r0, 0x1
- negs r0, r0
- cmp r1, r0
- beq _080436DC
- cmp r1, 0x1
- bne _080436F0
- movs r0, 0x6E
- b _080436DE
- .align 2, 0
-_080436D8: .4byte gUnknown_8252B48
-_080436DC:
- movs r0, 0x5A
-_080436DE:
- muls r0, r3
- lsls r0, 16
- lsrs r0, 16
- movs r1, 0x64
- bl __udivsi3
- lsls r0, 16
- lsrs r0, 16
- b _080436F2
-_080436F0:
- adds r0, r3, 0
-_080436F2:
- pop {r4,r5}
- pop {r1}
- bx r1
- thumb_func_end nature_stat_mod
-
- thumb_func_start sub_80436F8
-sub_80436F8: @ 80436F8
- push {r4-r7,lr}
- sub sp, 0x4
- adds r7, r0, 0
- lsls r1, 24
- lsrs r5, r1, 24
- movs r1, 0x41
- movs r2, 0
- bl GetMonData
- lsls r0, 16
- lsrs r6, r0, 16
- adds r0, r7, 0
- movs r1, 0xC
- movs r2, 0
- bl GetMonData
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0xAF
- bne _08043758
- ldr r0, _08043738 @ =gMain
- ldr r1, _0804373C @ =0x00000439
- adds r0, r1
- ldrb r1, [r0]
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- beq _08043744
- ldr r0, _08043740 @ =gUnknown_2023F54
- ldrb r4, [r0, 0x7]
- b _08043760
- .align 2, 0
-_08043738: .4byte gMain
-_0804373C: .4byte 0x00000439
-_08043740: .4byte gUnknown_2023F54
-_08043744:
- ldr r0, _08043750 @ =gSaveBlock1Ptr
- ldr r0, [r0]
- ldr r1, _08043754 @ =0x0000311a
- adds r0, r1
- ldrb r4, [r0]
- b _08043760
- .align 2, 0
-_08043750: .4byte gSaveBlock1Ptr
-_08043754: .4byte 0x0000311a
-_08043758:
- bl ItemId_GetHoldEffect
- lsls r0, 24
- lsrs r4, r0, 24
-_08043760:
- cmp r6, 0
- bne _08043766
- b _08043876
-_08043766:
- movs r0, 0xCE
- lsls r0, 1
- cmp r6, r0
- bne _08043770
- b _08043876
-_08043770:
- movs r6, 0
- adds r0, r7, 0
- movs r1, 0x20
- movs r2, 0
- bl GetMonData
- lsls r0, 16
- lsrs r0, 16
- mov r1, sp
- strh r0, [r1]
- lsls r0, 16
- asrs r0, 16
- cmp r0, 0x63
- ble _0804378E
- movs r6, 0x1
-_0804378E:
- cmp r0, 0xC7
- ble _08043798
- adds r0, r6, 0x1
- lsls r0, 24
- lsrs r6, r0, 24
-_08043798:
- cmp r5, 0x5
- bne _080437A8
- bl Random
- movs r1, 0x1
- ands r1, r0
- cmp r1, 0
- bne _08043876
-_080437A8:
- cmp r5, 0x3
- bne _080437D4
- ldr r0, _08043880 @ =gBattleTypeFlags
- ldr r0, [r0]
- movs r1, 0x8
- ands r0, r1
- cmp r0, 0
- beq _08043876
- ldr r2, _08043884 @ =gTrainers
- ldr r0, _08043888 @ =gTrainerBattleOpponent_A
- ldrh r1, [r0]
- lsls r0, r1, 2
- adds r0, r1
- lsls r0, 3
- adds r0, r2
- ldrb r0, [r0, 0x1]
- cmp r0, 0x54
- beq _080437D4
- cmp r0, 0x57
- beq _080437D4
- cmp r0, 0x5A
- bne _08043876
-_080437D4:
- ldr r1, _0804388C @ =gUnknown_825DFF6
- lsls r0, r5, 1
- adds r0, r5
- adds r0, r6, r0
- adds r0, r1
- ldrb r2, [r0]
- movs r1, 0
- ldrsb r1, [r0, r1]
- cmp r1, 0
- ble _080437FA
- cmp r4, 0x1B
- bne _080437FA
- movs r0, 0x96
- muls r0, r1
- movs r1, 0x64
- bl __divsi3
- lsls r0, 24
- lsrs r2, r0, 24
-_080437FA:
- lsls r2, 24
- asrs r2, 24
- mov r0, sp
- movs r1, 0
- ldrsh r0, [r0, r1]
- adds r0, r2
- mov r1, sp
- strh r0, [r1]
- cmp r2, 0
- ble _0804384C
- adds r0, r7, 0
- movs r1, 0x26
- movs r2, 0
- bl GetMonData
- cmp r0, 0xB
- bne _08043828
- mov r0, sp
- movs r1, 0
- ldrsh r0, [r0, r1]
- adds r0, 0x1
- mov r1, sp
- strh r0, [r1]
-_08043828:
- adds r0, r7, 0
- movs r1, 0x23
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- bl sav1_map_get_name
- lsls r0, 24
- lsrs r0, 24
- cmp r4, r0
- bne _0804384C
- mov r0, sp
- movs r1, 0
- ldrsh r0, [r0, r1]
- adds r0, 0x1
- mov r1, sp
- strh r0, [r1]
-_0804384C:
- mov r0, sp
- movs r1, 0
- ldrsh r0, [r0, r1]
- cmp r0, 0
- bge _0804385C
- movs r1, 0
- mov r0, sp
- strh r1, [r0]
-_0804385C:
- mov r0, sp
- movs r1, 0
- ldrsh r0, [r0, r1]
- cmp r0, 0xFF
- ble _0804386C
- movs r1, 0xFF
- mov r0, sp
- strh r1, [r0]
-_0804386C:
- adds r0, r7, 0
- movs r1, 0x20
- mov r2, sp
- bl sub_804037C
-_08043876:
- add sp, 0x4
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_08043880: .4byte gBattleTypeFlags
-_08043884: .4byte gTrainers
-_08043888: .4byte gTrainerBattleOpponent_A
-_0804388C: .4byte gUnknown_825DFF6
- thumb_func_end sub_80436F8
-
- thumb_func_start MonGainEVs
-MonGainEVs: @ 8043890
- push {r4-r7,lr}
- mov r7, r8
- push {r7}
- sub sp, 0x8
- mov r8, r0
- lsls r1, 16
- lsrs r5, r1, 16
- movs r4, 0
- movs r7, 0
- movs r6, 0
-_080438A4:
- adds r1, r6, 0
- adds r1, 0x1A
- mov r0, r8
- movs r2, 0
- bl GetMonData
- mov r2, sp
- adds r1, r2, r6
- strb r0, [r1]
- ldrb r0, [r1]
- adds r0, r7, r0
- lsls r0, 16
- lsrs r7, r0, 16
- adds r6, 0x1
- cmp r6, 0x5
- ble _080438A4
- movs r6, 0
- b _08043A26
-_080438C8:
- mov r0, r8
- movs r1, 0
- bl CheckPartyHasHadPokerus
- lsls r0, 24
- movs r2, 0x1
- cmp r0, 0
- beq _080438DA
- movs r2, 0x2
-_080438DA:
- cmp r6, 0x5
- bhi _0804397C
- lsls r0, r6, 2
- ldr r1, _080438E8 @ =_080438EC
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .align 2, 0
-_080438E8: .4byte _080438EC
- .align 2, 0
-_080438EC:
- .4byte _08043904
- .4byte _08043918
- .4byte _0804392C
- .4byte _08043940
- .4byte _08043954
- .4byte _08043968
-_08043904:
- ldr r0, _08043914 @ =gBaseStats
- lsls r1, r5, 3
- subs r1, r5
- lsls r1, 2
- adds r1, r0
- ldrb r0, [r1, 0xA]
- lsls r0, 30
- b _08043976
- .align 2, 0
-_08043914: .4byte gBaseStats
-_08043918:
- ldr r0, _08043928 @ =gBaseStats
- lsls r1, r5, 3
- subs r1, r5
- lsls r1, 2
- adds r1, r0
- ldrb r0, [r1, 0xA]
- b _08043974
- .align 2, 0
-_08043928: .4byte gBaseStats
-_0804392C:
- ldr r0, _0804393C @ =gBaseStats
- lsls r1, r5, 3
- subs r1, r5
- lsls r1, 2
- adds r1, r0
- ldrb r0, [r1, 0xA]
- lsls r0, 26
- b _08043976
- .align 2, 0
-_0804393C: .4byte gBaseStats
-_08043940:
- ldr r0, _08043950 @ =gBaseStats
- lsls r1, r5, 3
- subs r1, r5
- lsls r1, 2
- adds r1, r0
- ldrb r0, [r1, 0xA]
- lsrs r0, 6
- b _08043978
- .align 2, 0
-_08043950: .4byte gBaseStats
-_08043954:
- ldr r0, _08043964 @ =gBaseStats
- lsls r1, r5, 3
- subs r1, r5
- lsls r1, 2
- adds r1, r0
- ldrb r0, [r1, 0xB]
- lsls r0, 30
- b _08043976
- .align 2, 0
-_08043964: .4byte gBaseStats
-_08043968:
- ldr r0, _080439A4 @ =gBaseStats
- lsls r1, r5, 3
- subs r1, r5
- lsls r1, 2
- adds r1, r0
- ldrb r0, [r1, 0xB]
-_08043974:
- lsls r0, 28
-_08043976:
- lsrs r0, 30
-_08043978:
- adds r4, r0, 0
- muls r4, r2
-_0804397C:
- mov r0, r8
- movs r1, 0xC
- movs r2, 0
- bl GetMonData
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0xAF
- bne _080439C8
- ldr r0, _080439A8 @ =gMain
- ldr r1, _080439AC @ =0x00000439
- adds r0, r1
- ldrb r1, [r0]
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- beq _080439B4
- ldr r0, _080439B0 @ =gUnknown_2023F54
- ldrb r0, [r0, 0x7]
- b _080439D0
- .align 2, 0
-_080439A4: .4byte gBaseStats
-_080439A8: .4byte gMain
-_080439AC: .4byte 0x00000439
-_080439B0: .4byte gUnknown_2023F54
-_080439B4:
- ldr r0, _080439C0 @ =gSaveBlock1Ptr
- ldr r0, [r0]
- ldr r2, _080439C4 @ =0x0000311a
- adds r0, r2
- ldrb r0, [r0]
- b _080439D0
- .align 2, 0
-_080439C0: .4byte gSaveBlock1Ptr
-_080439C4: .4byte 0x0000311a
-_080439C8:
- bl ItemId_GetHoldEffect
- lsls r0, 24
- lsrs r0, 24
-_080439D0:
- cmp r0, 0x18
- bne _080439D8
- lsls r0, r4, 17
- lsrs r4, r0, 16
-_080439D8:
- lsls r0, r4, 16
- asrs r2, r0, 16
- adds r1, r7, r2
- movs r0, 0xFF
- lsls r0, 1
- cmp r1, r0
- ble _080439F0
- adds r0, r2, r0
- adds r1, r7, r4
- subs r0, r1
- lsls r0, 16
- lsrs r4, r0, 16
-_080439F0:
- mov r0, sp
- adds r2, r0, r6
- ldrb r3, [r2]
- lsls r0, r4, 16
- asrs r1, r0, 16
- adds r0, r3, r1
- cmp r0, 0xFF
- ble _08043A0C
- adds r0, r1, 0
- adds r0, 0xFF
- adds r1, r3, r4
- subs r0, r1
- lsls r0, 16
- lsrs r4, r0, 16
-_08043A0C:
- adds r0, r3, r4
- strb r0, [r2]
- adds r0, r7, r4
- lsls r0, 16
- lsrs r7, r0, 16
- adds r1, r6, 0
- adds r1, 0x1A
- mov r0, r8
- bl sub_804037C
- adds r6, 0x1
- cmp r6, 0x5
- bgt _08043A2E
-_08043A26:
- ldr r0, _08043A3C @ =0x000001fd
- cmp r7, r0
- bhi _08043A2E
- b _080438C8
-_08043A2E:
- add sp, 0x8
- pop {r3}
- mov r8, r3
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
-_08043A3C: .4byte 0x000001fd
- thumb_func_end MonGainEVs
-
- thumb_func_start GetMonEVCount
-GetMonEVCount: @ 8043A40
- push {r4-r6,lr}
- adds r6, r0, 0
- movs r5, 0
- movs r4, 0
-_08043A48:
- adds r1, r4, 0
- adds r1, 0x1A
- adds r0, r6, 0
- movs r2, 0
- bl GetMonData
- adds r0, r5, r0
- lsls r0, 16
- lsrs r5, r0, 16
- adds r4, 0x1
- cmp r4, 0x5
- ble _08043A48
- adds r0, r5, 0
- pop {r4-r6}
- pop {r1}
- bx r1
- thumb_func_end GetMonEVCount
-
- thumb_func_start sub_8043A68
-sub_8043A68: @ 8043A68
- sub sp, 0x4
- add sp, 0x4
- bx lr
- thumb_func_end sub_8043A68
-
- thumb_func_start CheckPartyPokerus
-CheckPartyPokerus: @ 8043A70
- push {r4-r7,lr}
- sub sp, 0x4
- adds r7, r0, 0
- lsls r1, 24
- lsrs r4, r1, 24
- movs r3, 0
- movs r6, 0x1
- movs r5, 0
- cmp r4, 0
- beq _08043AB8
-_08043A84:
- movs r0, 0x1
- ands r0, r4
- cmp r0, 0
- beq _08043AAC
- movs r0, 0x64
- muls r0, r3
- adds r0, r7, r0
- movs r1, 0x22
- movs r2, 0
- str r3, [sp]
- bl GetMonData
- movs r1, 0xF
- ands r1, r0
- ldr r3, [sp]
- cmp r1, 0
- beq _08043AAC
- orrs r5, r6
- lsls r0, r5, 24
- lsrs r5, r0, 24
-_08043AAC:
- adds r3, 0x1
- lsls r6, 1
- lsrs r4, 1
- cmp r4, 0
- bne _08043A84
- b _08043ACC
-_08043AB8:
- adds r0, r7, 0
- movs r1, 0x22
- movs r2, 0
- bl GetMonData
- movs r1, 0xF
- ands r1, r0
- cmp r1, 0
- beq _08043ACC
- movs r5, 0x1
-_08043ACC:
- adds r0, r5, 0
- add sp, 0x4
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end CheckPartyPokerus
-
- thumb_func_start CheckPartyHasHadPokerus
-CheckPartyHasHadPokerus: @ 8043AD8
- push {r4-r7,lr}
- sub sp, 0x4
- adds r7, r0, 0
- lsls r1, 24
- lsrs r4, r1, 24
- movs r3, 0
- movs r6, 0x1
- movs r5, 0
- cmp r4, 0
- beq _08043B1C
-_08043AEC:
- movs r0, 0x1
- ands r0, r4
- cmp r0, 0
- beq _08043B10
- movs r0, 0x64
- muls r0, r3
- adds r0, r7, r0
- movs r1, 0x22
- movs r2, 0
- str r3, [sp]
- bl GetMonData
- ldr r3, [sp]
- cmp r0, 0
- beq _08043B10
- orrs r5, r6
- lsls r0, r5, 24
- lsrs r5, r0, 24
-_08043B10:
- adds r3, 0x1
- lsls r6, 1
- lsrs r4, 1
- cmp r4, 0
- bne _08043AEC
- b _08043B2C
-_08043B1C:
- adds r0, r7, 0
- movs r1, 0x22
- movs r2, 0
- bl GetMonData
- cmp r0, 0
- beq _08043B2C
- movs r5, 0x1
-_08043B2C:
- adds r0, r5, 0
- add sp, 0x4
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end CheckPartyHasHadPokerus
-
- thumb_func_start sub_8043B38
-sub_8043B38: @ 8043B38
- sub sp, 0x4
- add sp, 0x4
- bx lr
- thumb_func_end sub_8043B38
-
- thumb_func_start sub_8043B40
-sub_8043B40: @ 8043B40
- sub sp, 0x4
- add sp, 0x4
- bx lr
- thumb_func_end sub_8043B40
-
- thumb_func_start sub_8043B48
-sub_8043B48: @ 8043B48
- push {r4,lr}
- sub sp, 0x4
- adds r4, r0, 0
- str r3, [sp]
- ldr r2, _08043B88 @ =gUnknown_8253AE4
- ldr r3, _08043B8C @ =gBaseStats
- lsls r0, r1, 3
- subs r0, r1
- lsls r0, 2
- adds r0, r3
- ldrb r1, [r0, 0x13]
- movs r0, 0xCA
- lsls r0, 1
- muls r0, r1
- movs r1, 0xC8
- lsls r1, 1
- adds r2, r1
- adds r0, r2
- ldr r1, [r0]
- ldr r0, [sp]
- cmp r0, r1
- bls _08043B80
- str r1, [sp]
- adds r0, r4, 0
- movs r1, 0x19
- mov r2, sp
- bl sub_804037C
-_08043B80:
- add sp, 0x4
- pop {r4}
- pop {r0}
- bx r0
- .align 2, 0
-_08043B88: .4byte gUnknown_8253AE4
-_08043B8C: .4byte gBaseStats
- thumb_func_end sub_8043B48
-
- thumb_func_start sub_8043B90
-sub_8043B90: @ 8043B90
- push {r4-r7,lr}
- sub sp, 0x4
- adds r4, r0, 0
- movs r1, 0xB
- movs r2, 0
- bl GetMonData
- lsls r0, 16
- lsrs r6, r0, 16
- adds r0, r4, 0
- movs r1, 0x38
- movs r2, 0
- bl GetMonData
- lsls r0, 24
- lsrs r7, r0, 24
- movs r1, 0x80
- lsls r1, 17
- adds r0, r1
- lsrs r0, 24
- mov r1, sp
- strb r0, [r1]
- adds r0, r4, 0
- movs r1, 0x19
- movs r2, 0
- bl GetMonData
- adds r5, r0, 0
- cmp r7, 0x63
- bhi _08043C14
- ldr r3, _08043C0C @ =gUnknown_8253AE4
- mov r0, sp
- ldrb r1, [r0]
- lsls r1, 2
- ldr r2, _08043C10 @ =gBaseStats
- lsls r0, r6, 3
- subs r0, r6
- lsls r0, 2
- adds r0, r2
- ldrb r2, [r0, 0x13]
- movs r0, 0xCA
- lsls r0, 1
- muls r0, r2
- adds r1, r0
- adds r1, r3
- ldr r0, [r1]
- cmp r5, r0
- bls _08043C20
- adds r0, r4, 0
- movs r1, 0x38
- mov r2, sp
- bl sub_804037C
- mov r0, sp
- ldrb r2, [r0]
- adds r0, r4, 0
- adds r1, r6, 0
- adds r3, r5, 0
- bl sub_8043B48
- movs r0, 0x1
- b _08043C22
- .align 2, 0
-_08043C0C: .4byte gUnknown_8253AE4
-_08043C10: .4byte gBaseStats
-_08043C14:
- adds r0, r4, 0
- adds r1, r6, 0
- adds r2, r7, 0
- adds r3, r5, 0
- bl sub_8043B48
-_08043C20:
- movs r0, 0
-_08043C22:
- add sp, 0x4
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end sub_8043B90
-
- thumb_func_start CanMonLearnTMHM
-CanMonLearnTMHM: @ 8043C2C
- push {r4,r5,lr}
- lsls r1, 24
- lsrs r4, r1, 24
- adds r5, r4, 0
- movs r1, 0x41
- movs r2, 0
- bl GetMonData
- lsls r0, 16
- lsrs r1, r0, 16
- adds r3, r1, 0
- movs r0, 0xCE
- lsls r0, 1
- cmp r1, r0
- bne _08043C4E
- movs r0, 0
- b _08043C7A
-_08043C4E:
- cmp r4, 0x1F
- bls _08043C6C
- adds r0, r4, 0
- subs r0, 0x20
- movs r2, 0x1
- lsls r2, r0
- ldr r0, _08043C68 @ =gUnknown_8252BC8
- lsls r1, 3
- adds r0, 0x4
- adds r1, r0
- ldr r0, [r1]
- ands r0, r2
- b _08043C7A
- .align 2, 0
-_08043C68: .4byte gUnknown_8252BC8
-_08043C6C:
- movs r1, 0x1
- lsls r1, r5
- ldr r2, _08043C80 @ =gUnknown_8252BC8
- lsls r0, r3, 3
- adds r0, r2
- ldr r0, [r0]
- ands r0, r1
-_08043C7A:
- pop {r4,r5}
- pop {r1}
- bx r1
- .align 2, 0
-_08043C80: .4byte gUnknown_8252BC8
- thumb_func_end CanMonLearnTMHM
-
- thumb_func_start GetMoveRelearnerMoves
-GetMoveRelearnerMoves: @ 8043C84
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x18
- adds r6, r0, 0
- str r1, [sp, 0x8]
- movs r0, 0
- mov r10, r0
- adds r0, r6, 0
- movs r1, 0xB
- movs r2, 0
- bl GetMonData
- lsls r0, 16
- lsrs r7, r0, 16
- adds r0, r6, 0
- movs r1, 0x38
- movs r2, 0
- bl GetMonData
- lsls r0, 24
- lsrs r0, 24
- str r0, [sp, 0xC]
- movs r5, 0
- mov r4, sp
-_08043CBA:
- adds r1, r5, 0
- adds r1, 0xD
- adds r0, r6, 0
- movs r2, 0
- bl GetMonData
- strh r0, [r4]
- adds r4, 0x2
- adds r5, 0x1
- cmp r5, 0x3
- ble _08043CBA
- movs r5, 0
- ldr r6, _08043DC8 @ =gUnknown_825D7B4
- lsls r1, r7, 2
- adds r2, r1, r6
- ldr r3, [r2]
- ldrh r0, [r3]
- ldr r4, _08043DCC @ =0x0000ffff
- str r1, [sp, 0x14]
- cmp r0, r4
- beq _08043DB4
- mov r9, r2
- str r3, [sp, 0x10]
-_08043CE8:
- lsls r2, r5, 1
- ldr r1, [sp, 0x10]
- adds r0, r2, r1
- ldrh r3, [r0]
- movs r0, 0xFE
- lsls r0, 8
- ands r0, r3
- ldr r4, [sp, 0xC]
- lsls r1, r4, 9
- adds r7, r2, 0
- adds r5, 0x1
- mov r12, r5
- cmp r0, r1
- bgt _08043D9E
- movs r4, 0
- mov r0, sp
- ldrh r1, [r0]
- ldr r0, _08043DD0 @ =0x000001ff
- ands r0, r3
- cmp r1, r0
- beq _08043D38
- ldr r0, [sp, 0x14]
- ldr r1, _08043DC8 @ =gUnknown_825D7B4
- adds r6, r0, r1
- ldr r2, _08043DD0 @ =0x000001ff
- mov r8, r2
- mov r3, sp
- adds r5, r7, 0
-_08043D20:
- adds r3, 0x2
- adds r4, 0x1
- cmp r4, 0x3
- bgt _08043D38
- ldr r0, [r6]
- adds r0, r5, r0
- ldrh r1, [r0]
- ldrh r2, [r3]
- mov r0, r8
- ands r0, r1
- cmp r2, r0
- bne _08043D20
-_08043D38:
- cmp r4, 0x4
- bne _08043D9E
- movs r4, 0
- cmp r4, r10
- bge _08043D7C
- mov r1, r9
- ldr r0, [r1]
- adds r0, r7, r0
- ldrh r1, [r0]
- ldr r0, [sp, 0x8]
- ldrh r2, [r0]
- ldr r0, _08043DD0 @ =0x000001ff
- ands r0, r1
- cmp r2, r0
- beq _08043D7C
- ldr r1, [sp, 0x14]
- ldr r2, _08043DC8 @ =gUnknown_825D7B4
- adds r6, r1, r2
- ldr r0, _08043DD0 @ =0x000001ff
- mov r8, r0
- ldr r3, [sp, 0x8]
- adds r5, r7, 0
-_08043D64:
- adds r3, 0x2
- adds r4, 0x1
- cmp r4, r10
- bge _08043D7C
- ldr r0, [r6]
- adds r0, r5, r0
- ldrh r1, [r0]
- ldrh r2, [r3]
- mov r0, r8
- ands r0, r1
- cmp r2, r0
- bne _08043D64
-_08043D7C:
- cmp r4, r10
- bne _08043D9E
- mov r0, r10
- adds r0, 0x1
- lsls r0, 24
- lsrs r0, 24
- mov r10, r0
- lsls r2, r4, 1
- ldr r1, [sp, 0x8]
- adds r2, r1
- mov r4, r9
- ldr r0, [r4]
- adds r0, r7, r0
- ldrh r1, [r0]
- ldr r0, _08043DD0 @ =0x000001ff
- ands r0, r1
- strh r0, [r2]
-_08043D9E:
- mov r5, r12
- cmp r5, 0x13
- bgt _08043DB4
- mov r1, r9
- ldr r0, [r1]
- lsls r1, r5, 1
- adds r1, r0
- ldrh r0, [r1]
- ldr r2, _08043DCC @ =0x0000ffff
- cmp r0, r2
- bne _08043CE8
-_08043DB4:
- mov r0, r10
- add sp, 0x18
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r1}
- bx r1
- .align 2, 0
-_08043DC8: .4byte gUnknown_825D7B4
-_08043DCC: .4byte 0x0000ffff
-_08043DD0: .4byte 0x000001ff
- thumb_func_end GetMoveRelearnerMoves
-
- thumb_func_start GetLevelUpMovesBySpecies
-GetLevelUpMovesBySpecies: @ 8043DD4
- push {r4-r7,lr}
- adds r6, r1, 0
- lsls r0, 16
- movs r5, 0
- movs r4, 0
- ldr r1, _08043E20 @ =gUnknown_825D7B4
- lsrs r0, 14
- adds r0, r1
- ldr r2, [r0]
- ldrh r0, [r2]
- ldr r1, _08043E24 @ =0x0000ffff
- cmp r0, r1
- beq _08043E18
- ldr r0, _08043E28 @ =0x000001ff
- mov r12, r0
- adds r7, r1, 0
- adds r3, r2, 0
-_08043DF6:
- adds r1, r5, 0
- adds r0, r1, 0x1
- lsls r0, 24
- lsrs r5, r0, 24
- lsls r1, 1
- adds r1, r6
- ldrh r2, [r3]
- mov r0, r12
- ands r0, r2
- strh r0, [r1]
- adds r3, 0x2
- adds r4, 0x1
- cmp r4, 0x13
- bgt _08043E18
- ldrh r0, [r3]
- cmp r0, r7
- bne _08043DF6
-_08043E18:
- adds r0, r5, 0
- pop {r4-r7}
- pop {r1}
- bx r1
- .align 2, 0
-_08043E20: .4byte gUnknown_825D7B4
-_08043E24: .4byte 0x0000ffff
-_08043E28: .4byte 0x000001ff
- thumb_func_end GetLevelUpMovesBySpecies
-
- thumb_func_start GetNumberOfRelearnableMoves
-GetNumberOfRelearnableMoves: @ 8043E2C
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x3C
- adds r6, r0, 0
- movs r0, 0
- mov r10, r0
- adds r0, r6, 0
- movs r1, 0x41
- movs r2, 0
- bl GetMonData
- lsls r0, 16
- lsrs r4, r0, 16
- adds r0, r6, 0
- movs r1, 0x38
- movs r2, 0
- bl GetMonData
- lsls r0, 24
- lsrs r0, 24
- str r0, [sp, 0x30]
- movs r0, 0xCE
- lsls r0, 1
- cmp r4, r0
- bne _08043E68
- movs r0, 0
- b _08043F72
-_08043E68:
- movs r5, 0
- lsls r4, 2
- str r4, [sp, 0x38]
- mov r4, sp
-_08043E70:
- adds r1, r5, 0
- adds r1, 0xD
- adds r0, r6, 0
- movs r2, 0
- bl GetMonData
- strh r0, [r4]
- adds r4, 0x2
- adds r5, 0x1
- cmp r5, 0x3
- ble _08043E70
- movs r5, 0
- ldr r3, _08043F84 @ =gUnknown_825D7B4
- ldr r2, [sp, 0x38]
- adds r1, r2, r3
- ldr r0, [r1]
- ldrh r0, [r0]
- ldr r2, _08043F88 @ =0x0000ffff
- cmp r0, r2
- beq _08043F70
- mov r9, r1
- mov r4, sp
- adds r4, 0x8
- str r4, [sp, 0x34]
-_08043EA0:
- mov r1, r9
- ldr r0, [r1]
- lsls r2, r5, 1
- adds r0, r2, r0
- ldrh r3, [r0]
- movs r0, 0xFE
- lsls r0, 8
- ands r0, r3
- ldr r4, [sp, 0x30]
- lsls r1, r4, 9
- adds r7, r2, 0
- adds r5, 0x1
- mov r12, r5
- cmp r0, r1
- bgt _08043F5A
- movs r4, 0
- mov r0, sp
- ldrh r1, [r0]
- ldr r0, _08043F8C @ =0x000001ff
- ands r0, r3
- cmp r1, r0
- beq _08043EF2
- ldr r0, [sp, 0x38]
- ldr r1, _08043F84 @ =gUnknown_825D7B4
- adds r6, r0, r1
- ldr r2, _08043F8C @ =0x000001ff
- mov r8, r2
- mov r3, sp
- adds r5, r7, 0
-_08043EDA:
- adds r3, 0x2
- adds r4, 0x1
- cmp r4, 0x3
- bgt _08043EF2
- ldr r0, [r6]
- adds r0, r5, r0
- ldrh r1, [r0]
- ldrh r2, [r3]
- mov r0, r8
- ands r0, r1
- cmp r2, r0
- bne _08043EDA
-_08043EF2:
- cmp r4, 0x4
- bne _08043F5A
- movs r4, 0
- cmp r4, r10
- bge _08043F38
- mov r1, r9
- ldr r0, [r1]
- adds r0, r7, r0
- ldrh r1, [r0]
- ldr r0, [sp, 0x34]
- ldrh r2, [r0]
- ldr r0, _08043F8C @ =0x000001ff
- ands r0, r1
- add r1, sp, 0x8
- cmp r2, r0
- beq _08043F38
- ldr r2, [sp, 0x38]
- ldr r0, _08043F84 @ =gUnknown_825D7B4
- adds r6, r2, r0
- ldr r2, _08043F8C @ =0x000001ff
- mov r8, r2
- adds r3, r1, 0
- adds r5, r7, 0
-_08043F20:
- adds r3, 0x2
- adds r4, 0x1
- cmp r4, r10
- bge _08043F38
- ldr r0, [r6]
- adds r0, r5, r0
- ldrh r1, [r0]
- ldrh r2, [r3]
- mov r0, r8
- ands r0, r1
- cmp r2, r0
- bne _08043F20
-_08043F38:
- cmp r4, r10
- bne _08043F5A
- mov r0, r10
- adds r0, 0x1
- lsls r0, 24
- lsrs r0, 24
- mov r10, r0
- lsls r2, r4, 1
- ldr r4, [sp, 0x34]
- adds r2, r4, r2
- mov r1, r9
- ldr r0, [r1]
- adds r0, r7, r0
- ldrh r1, [r0]
- ldr r0, _08043F8C @ =0x000001ff
- ands r0, r1
- strh r0, [r2]
-_08043F5A:
- mov r5, r12
- cmp r5, 0x13
- bgt _08043F70
- mov r2, r9
- ldr r0, [r2]
- lsls r1, r5, 1
- adds r1, r0
- ldrh r0, [r1]
- ldr r4, _08043F88 @ =0x0000ffff
- cmp r0, r4
- bne _08043EA0
-_08043F70:
- mov r0, r10
-_08043F72:
- add sp, 0x3C
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r1}
- bx r1
- .align 2, 0
-_08043F84: .4byte gUnknown_825D7B4
-_08043F88: .4byte 0x0000ffff
-_08043F8C: .4byte 0x000001ff
- thumb_func_end GetNumberOfRelearnableMoves
-
- thumb_func_start sub_8043F90
-sub_8043F90: @ 8043F90
- push {r4,lr}
- lsls r0, 16
- lsrs r4, r0, 16
- adds r0, r4, 0
- bl SpeciesToNationalPokedexNum
- adds r4, r0, 0
- bl sub_806E25C
- cmp r0, 0
- bne _08043FB4
- cmp r4, 0x97
- bls _08043FB4
- ldr r0, _08043FB0 @ =0x0000ffff
- b _08043FB6
- .align 2, 0
-_08043FB0: .4byte 0x0000ffff
-_08043FB4:
- adds r0, r4, 0
-_08043FB6:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end sub_8043F90
-
- thumb_func_start sub_8043FBC
-sub_8043FBC: @ 8043FBC
- push {lr}
- ldr r1, _08043FD0 @ =gUnknown_2024024
- movs r2, 0
- adds r0, r1, 0x3
-_08043FC4:
- strb r2, [r0]
- subs r0, 0x1
- cmp r0, r1
- bge _08043FC4
- pop {r0}
- bx r0
- .align 2, 0
-_08043FD0: .4byte gUnknown_2024024
- thumb_func_end sub_8043FBC
-
- thumb_func_start sub_8043FD4
-sub_8043FD4: @ 8043FD4
- push {lr}
- ldr r0, _08043FFC @ =gBattleTypeFlags
- ldr r1, [r0]
- movs r0, 0x80
- lsls r0, 5
- ands r0, r1
- cmp r0, 0
- bne _0804406C
- movs r0, 0x80
- lsls r0, 7
- ands r0, r1
- cmp r0, 0
- bne _08043FF6
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- beq _08044000
-_08043FF6:
- movs r0, 0x85
- lsls r0, 1
- b _08044070
- .align 2, 0
-_08043FFC: .4byte gBattleTypeFlags
-_08044000:
- movs r0, 0x8
- ands r1, r0
- cmp r1, 0
- beq _0804406C
- ldr r2, _08044028 @ =gTrainers
- ldr r0, _0804402C @ =gTrainerBattleOpponent_A
- ldrh r1, [r0]
- lsls r0, r1, 2
- adds r0, r1
- lsls r0, 3
- adds r0, r2
- ldrb r0, [r0, 0x1]
- subs r0, 0x53
- cmp r0, 0x7
- bhi _08044062
- lsls r0, 2
- ldr r1, _08044030 @ =_08044034
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .align 2, 0
-_08044028: .4byte gTrainers
-_0804402C: .4byte gTrainerBattleOpponent_A
-_08044030: .4byte _08044034
- .align 2, 0
-_08044034:
- .4byte _08044062
- .4byte _0804405C
- .4byte _08044062
- .4byte _08044062
- .4byte _0804405C
- .4byte _08044062
- .4byte _08044062
- .4byte _08044054
-_08044054:
- ldr r0, _08044058 @ =0x0000012b
- b _08044070
- .align 2, 0
-_08044058: .4byte 0x0000012b
-_0804405C:
- movs r0, 0x94
- lsls r0, 1
- b _08044070
-_08044062:
- ldr r0, _08044068 @ =0x00000129
- b _08044070
- .align 2, 0
-_08044068: .4byte 0x00000129
-_0804406C:
- movs r0, 0x95
- lsls r0, 1
-_08044070:
- pop {r1}
- bx r1
- thumb_func_end sub_8043FD4
-
- thumb_func_start PlayBattleBGM
-PlayBattleBGM: @ 8044074
- push {lr}
- bl ResetMapMusic
- bl m4aMPlayAllStop
- bl sub_8043FD4
- lsls r0, 16
- lsrs r0, 16
- bl PlayBGM
- pop {r0}
- bx r0
- thumb_func_end PlayBattleBGM
-
- thumb_func_start PlayMapChosenOrBattleBGM
-PlayMapChosenOrBattleBGM: @ 8044090
- push {r4,lr}
- lsls r0, 16
- lsrs r4, r0, 16
- bl ResetMapMusic
- bl m4aMPlayAllStop
- cmp r4, 0
- beq _080440AA
- adds r0, r4, 0
- bl PlayNewMapMusic
- b _080440B6
-_080440AA:
- bl sub_8043FD4
- lsls r0, 16
- lsrs r0, 16
- bl PlayNewMapMusic
-_080440B6:
- pop {r4}
- pop {r0}
- bx r0
- thumb_func_end PlayMapChosenOrBattleBGM
-
- thumb_func_start GetMonFrontSpritePal
-GetMonFrontSpritePal: @ 80440BC
- push {r4-r6,lr}
- adds r5, r0, 0
- movs r1, 0x41
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- lsls r4, 16
- lsrs r4, 16
- adds r0, r5, 0
- movs r1, 0x1
- movs r2, 0
- bl GetMonData
- adds r6, r0, 0
- adds r0, r5, 0
- movs r1, 0
- movs r2, 0
- bl GetMonData
- adds r2, r0, 0
- adds r0, r4, 0
- adds r1, r6, 0
- bl GetFrontSpritePalFromSpeciesAndPersonality
- pop {r4-r6}
- pop {r1}
- bx r1
- thumb_func_end GetMonFrontSpritePal
-
- thumb_func_start GetFrontSpritePalFromSpeciesAndPersonality
-GetFrontSpritePalFromSpeciesAndPersonality: @ 80440F4
- push {r4,r5,lr}
- adds r3, r2, 0
- lsls r0, 16
- lsrs r4, r0, 16
- adds r5, r4, 0
- movs r0, 0xCE
- lsls r0, 1
- cmp r4, r0
- bls _08044110
- ldr r0, _0804410C @ =gUnknown_823730C
- ldr r0, [r0]
- b _0804413C
- .align 2, 0
-_0804410C: .4byte gUnknown_823730C
-_08044110:
- lsrs r0, r1, 16
- ldr r2, _0804412C @ =0x0000ffff
- ands r1, r2
- eors r0, r1
- lsrs r1, r3, 16
- eors r0, r1
- ands r3, r2
- eors r0, r3
- cmp r0, 0x7
- bls _08044134
- ldr r0, _08044130 @ =gUnknown_823730C
- lsls r1, r4, 3
- b _08044138
- .align 2, 0
-_0804412C: .4byte 0x0000ffff
-_08044130: .4byte gUnknown_823730C
-_08044134:
- ldr r0, _08044144 @ =gUnknown_82380CC
- lsls r1, r5, 3
-_08044138:
- adds r1, r0
- ldr r0, [r1]
-_0804413C:
- pop {r4,r5}
- pop {r1}
- bx r1
- .align 2, 0
-_08044144: .4byte gUnknown_82380CC
- thumb_func_end GetFrontSpritePalFromSpeciesAndPersonality
-
- thumb_func_start GetMonSpritePalStruct
-GetMonSpritePalStruct: @ 8044148
- push {r4-r6,lr}
- adds r5, r0, 0
- movs r1, 0x41
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- lsls r4, 16
- lsrs r4, 16
- adds r0, r5, 0
- movs r1, 0x1
- movs r2, 0
- bl GetMonData
- adds r6, r0, 0
- adds r0, r5, 0
- movs r1, 0
- movs r2, 0
- bl GetMonData
- adds r2, r0, 0
- adds r0, r4, 0
- adds r1, r6, 0
- bl GetMonSpritePalStructFromOtIdPersonality
- pop {r4-r6}
- pop {r1}
- bx r1
- thumb_func_end GetMonSpritePalStruct
-
- thumb_func_start GetMonSpritePalStructFromOtIdPersonality
-GetMonSpritePalStructFromOtIdPersonality: @ 8044180
- push {r4,lr}
- lsls r0, 16
- lsrs r4, r0, 16
- lsrs r0, r1, 16
- ldr r3, _080441A0 @ =0x0000ffff
- ands r1, r3
- eors r0, r1
- lsrs r1, r2, 16
- eors r0, r1
- ands r2, r3
- eors r0, r2
- cmp r0, 0x7
- bls _080441A8
- lsls r0, r4, 3
- ldr r1, _080441A4 @ =gUnknown_823730C
- b _080441AC
- .align 2, 0
-_080441A0: .4byte 0x0000ffff
-_080441A4: .4byte gUnknown_823730C
-_080441A8:
- lsls r0, r4, 3
- ldr r1, _080441B4 @ =gUnknown_82380CC
-_080441AC:
- adds r0, r1
- pop {r4}
- pop {r1}
- bx r1
- .align 2, 0
-_080441B4: .4byte gUnknown_82380CC
- thumb_func_end GetMonSpritePalStructFromOtIdPersonality
-
- thumb_func_start IsHMMove2
-IsHMMove2: @ 80441B8
- push {r4,lr}
- lsls r0, 16
- lsrs r3, r0, 16
- ldr r2, _080441DC @ =gUnknown_825E014
- ldrh r0, [r2]
- ldr r1, _080441E0 @ =0x0000ffff
- cmp r0, r1
- beq _080441EA
- adds r4, r1, 0
- adds r1, r2, 0
-_080441CC:
- ldrh r0, [r2]
- adds r1, 0x2
- adds r2, 0x2
- cmp r0, r3
- bne _080441E4
- movs r0, 0x1
- b _080441EC
- .align 2, 0
-_080441DC: .4byte gUnknown_825E014
-_080441E0: .4byte 0x0000ffff
-_080441E4:
- ldrh r0, [r1]
- cmp r0, r4
- bne _080441CC
-_080441EA:
- movs r0, 0
-_080441EC:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end IsHMMove2
-
- thumb_func_start IsPokeSpriteNotFlipped
-IsPokeSpriteNotFlipped: @ 80441F4
- lsls r0, 16
- lsrs r0, 16
- ldr r2, _08044208 @ =gBaseStats
- lsls r1, r0, 3
- subs r1, r0
- lsls r1, 2
- adds r1, r2
- ldrb r0, [r1, 0x19]
- lsrs r0, 7
- bx lr
- .align 2, 0
-_08044208: .4byte gBaseStats
- thumb_func_end IsPokeSpriteNotFlipped
-
- thumb_func_start GetMonFlavorRelation
-GetMonFlavorRelation: @ 804420C
- push {r4,lr}
- lsls r4, r1, 24
- lsrs r4, 24
- bl GetNature
- lsls r0, 24
- lsrs r0, 24
- ldr r2, _08044230 @ =gUnknown_825DE24
- lsls r1, r0, 2
- adds r1, r0
- adds r1, r4
- adds r1, r2
- movs r0, 0
- ldrsb r0, [r1, r0]
- pop {r4}
- pop {r1}
- bx r1
- .align 2, 0
-_08044230: .4byte gUnknown_825DE24
- thumb_func_end GetMonFlavorRelation
-
- thumb_func_start GetFlavorRelationByPersonality
-GetFlavorRelationByPersonality: @ 8044234
- push {r4,lr}
- lsls r4, r1, 24
- lsrs r4, 24
- bl GetNatureFromPersonality
- lsls r0, 24
- lsrs r0, 24
- ldr r2, _08044258 @ =gUnknown_825DE24
- lsls r1, r0, 2
- adds r1, r0
- adds r1, r4
- adds r1, r2
- movs r0, 0
- ldrsb r0, [r1, r0]
- pop {r4}
- pop {r1}
- bx r1
- .align 2, 0
-_08044258: .4byte gUnknown_825DE24
- thumb_func_end GetFlavorRelationByPersonality
-
- thumb_func_start IsTradedMon
-IsTradedMon: @ 804425C
- push {r4,lr}
- sub sp, 0x8
- adds r4, r0, 0
- movs r1, 0x7
- mov r2, sp
- bl GetMonData
- adds r0, r4, 0
- movs r1, 0x1
- movs r2, 0
- bl GetMonData
- mov r1, sp
- bl IsOtherTrainer
- lsls r0, 24
- lsrs r0, 24
- add sp, 0x8
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end IsTradedMon
-
- thumb_func_start IsOtherTrainer
-IsOtherTrainer: @ 8044288
- push {r4,r5,lr}
- adds r5, r1, 0
- ldr r1, _080442CC @ =gSaveBlock2Ptr
- ldr r3, [r1]
- ldrb r2, [r3, 0xA]
- ldrb r1, [r3, 0xB]
- lsls r1, 8
- orrs r2, r1
- ldrb r1, [r3, 0xC]
- lsls r1, 16
- orrs r2, r1
- ldrb r1, [r3, 0xD]
- lsls r1, 24
- orrs r2, r1
- cmp r0, r2
- bne _080442D0
- movs r4, 0
- ldrb r0, [r5]
- cmp r0, 0xFF
- beq _080442C6
- adds r2, r5, 0
-_080442B2:
- adds r1, r3, r4
- ldrb r0, [r2]
- ldrb r1, [r1]
- cmp r0, r1
- bne _080442D0
- adds r2, 0x1
- adds r4, 0x1
- ldrb r0, [r2]
- cmp r0, 0xFF
- bne _080442B2
-_080442C6:
- movs r0, 0
- b _080442D2
- .align 2, 0
-_080442CC: .4byte gSaveBlock2Ptr
-_080442D0:
- movs r0, 0x1
-_080442D2:
- pop {r4,r5}
- pop {r1}
- bx r1
- thumb_func_end IsOtherTrainer
-
- thumb_func_start MonRestorePP
-MonRestorePP: @ 80442D8
- push {lr}
- bl BoxMonRestorePP
- pop {r0}
- bx r0
- thumb_func_end MonRestorePP
-
- thumb_func_start BoxMonRestorePP
-BoxMonRestorePP: @ 80442E4
- push {r4-r6,lr}
- sub sp, 0x4
- adds r5, r0, 0
- movs r6, 0
-_080442EC:
- adds r4, r6, 0
- adds r4, 0xD
- adds r0, r5, 0
- adds r1, r4, 0
- movs r2, 0
- bl GetBoxMonData
- cmp r0, 0
- beq _08044338
- adds r0, r5, 0
- adds r1, r4, 0
- movs r2, 0
- bl GetBoxMonData
- adds r4, r0, 0
- lsls r4, 16
- lsrs r4, 16
- adds r0, r5, 0
- movs r1, 0x15
- movs r2, 0
- bl GetBoxMonData
- adds r1, r0, 0
- lsls r1, 24
- lsrs r1, 24
- lsls r2, r6, 24
- lsrs r2, 24
- adds r0, r4, 0
- bl CalculatePPWithBonus
- mov r1, sp
- strb r0, [r1]
- adds r1, r6, 0
- adds r1, 0x11
- adds r0, r5, 0
- mov r2, sp
- bl sub_80404D0
-_08044338:
- adds r6, 0x1
- cmp r6, 0x3
- ble _080442EC
- add sp, 0x4
- pop {r4-r6}
- pop {r0}
- bx r0
- thumb_func_end BoxMonRestorePP
-
- thumb_func_start sub_8044348
-sub_8044348: @ 8044348
- push {r4,r5,lr}
- ldr r2, _0804438C @ =gUnknown_2023D6A
- ldr r5, _08044390 @ =gBattleStruct
- ldr r1, [r5]
- adds r0, r1, 0
- adds r0, 0xAC
- ldrb r0, [r0]
- strb r0, [r2]
- ldr r4, _08044394 @ =gUnknown_2022AB8
- movs r0, 0xFD
- strb r0, [r4]
- movs r0, 0x4
- strb r0, [r4, 0x1]
- adds r1, 0x49
- ldrb r0, [r1]
- strb r0, [r4, 0x2]
- movs r0, 0xFF
- strb r0, [r4, 0x4]
- ldrb r0, [r1]
- bl GetBankSide
- lsls r0, 24
- cmp r0, 0
- bne _0804439C
- ldr r1, _08044398 @ =gBattlerPartyIndexes
- ldr r0, [r5]
- adds r0, 0x49
- ldrb r0, [r0]
- lsls r0, 1
- adds r0, r1
- ldrb r0, [r0]
- bl pokemon_order_func
- b _080443AA
- .align 2, 0
-_0804438C: .4byte gUnknown_2023D6A
-_08044390: .4byte gBattleStruct
-_08044394: .4byte gUnknown_2022AB8
-_08044398: .4byte gBattlerPartyIndexes
-_0804439C:
- ldr r1, _080443E0 @ =gBattlerPartyIndexes
- ldr r0, [r5]
- adds r0, 0x49
- ldrb r0, [r0]
- lsls r0, 1
- adds r0, r1
- ldrh r0, [r0]
-_080443AA:
- strb r0, [r4, 0x3]
- ldr r4, _080443E4 @ =gUnknown_2022AC8
- movs r0, 0xFD
- strb r0, [r4]
- movs r0, 0x4
- strb r0, [r4, 0x1]
- ldr r1, _080443E8 @ =gUnknown_2024004
- ldrb r0, [r1]
- strb r0, [r4, 0x2]
- ldr r2, _080443E0 @ =gBattlerPartyIndexes
- ldrb r0, [r1]
- lsls r0, 1
- adds r0, r2
- ldrb r0, [r0]
- bl pokemon_order_func
- strb r0, [r4, 0x3]
- movs r0, 0xFF
- strb r0, [r4, 0x4]
- ldr r0, _080443EC @ =gUnknown_83FCA2C
- ldr r1, _080443F0 @ =gStringVar4
- bl sub_80D7868
- pop {r4,r5}
- pop {r0}
- bx r0
- .align 2, 0
-_080443E0: .4byte gBattlerPartyIndexes
-_080443E4: .4byte gUnknown_2022AC8
-_080443E8: .4byte gUnknown_2024004
-_080443EC: .4byte gUnknown_83FCA2C
-_080443F0: .4byte gStringVar4
- thumb_func_end sub_8044348
-
- thumb_func_start SetWildMonHeldItem
-SetWildMonHeldItem: @ 80443F4
- push {r4,r5,lr}
- ldr r0, _0804444C @ =gBattleTypeFlags
- ldr r0, [r0]
- ldr r1, _08044450 @ =0x00012008
- ands r0, r1
- cmp r0, 0
- bne _08044468
- bl Random
- lsls r0, 16
- lsrs r0, 16
- movs r1, 0x64
- bl __umodsi3
- lsls r0, 16
- lsrs r5, r0, 16
- ldr r4, _08044454 @ =gEnemyParty
- adds r0, r4, 0
- movs r1, 0xB
- movs r2, 0
- bl GetMonData
- lsls r0, 16
- lsrs r0, 16
- ldr r2, _08044458 @ =gBaseStats
- lsls r1, r0, 3
- subs r1, r0
- lsls r3, r1, 2
- adds r1, r3, r2
- ldrh r0, [r1, 0xC]
- ldrh r1, [r1, 0xE]
- cmp r0, r1
- beq _0804443E
- cmp r5, 0x2C
- bls _08044468
- cmp r5, 0x5E
- bhi _0804445C
-_0804443E:
- adds r2, 0xC
- adds r2, r3, r2
- adds r0, r4, 0
- movs r1, 0xC
- bl sub_804037C
- b _08044468
- .align 2, 0
-_0804444C: .4byte gBattleTypeFlags
-_08044450: .4byte 0x00012008
-_08044454: .4byte gEnemyParty
-_08044458: .4byte gBaseStats
-_0804445C:
- adds r2, 0xE
- adds r2, r3, r2
- adds r0, r4, 0
- movs r1, 0xC
- bl sub_804037C
-_08044468:
- pop {r4,r5}
- pop {r0}
- bx r0
- thumb_func_end SetWildMonHeldItem
-
- thumb_func_start IsMonShiny
-IsMonShiny: @ 8044470
- push {r4,r5,lr}
- adds r4, r0, 0
- movs r1, 0x1
- movs r2, 0
- bl GetMonData
- adds r5, r0, 0
- adds r0, r4, 0
- movs r1, 0
- movs r2, 0
- bl GetMonData
- adds r1, r0, 0
- adds r0, r5, 0
- bl IsShinyOtIdPersonality
- lsls r0, 24
- lsrs r0, 24
- pop {r4,r5}
- pop {r1}
- bx r1
- thumb_func_end IsMonShiny
-
- thumb_func_start IsShinyOtIdPersonality
-IsShinyOtIdPersonality: @ 804449C
- push {r4,lr}
- movs r4, 0
- lsrs r2, r0, 16
- ldr r3, _080444C0 @ =0x0000ffff
- ands r0, r3
- eors r2, r0
- lsrs r0, r1, 16
- eors r2, r0
- ands r1, r3
- eors r2, r1
- cmp r2, 0x7
- bhi _080444B6
- movs r4, 0x1
-_080444B6:
- adds r0, r4, 0
- pop {r4}
- pop {r1}
- bx r1
- .align 2, 0
-_080444C0: .4byte 0x0000ffff
- thumb_func_end IsShinyOtIdPersonality
-
- thumb_func_start sub_80444C4
-sub_80444C4: @ 80444C4
- push {r4,lr}
- bl GetMultiplayerId
- lsls r0, 24
- lsrs r0, 24
- ldr r4, _080444F4 @ =gUnknown_202273C
- lsls r1, r0, 3
- subs r1, r0
- lsls r1, 2
- adds r1, r4
- ldrh r1, [r1, 0x18]
- movs r0, 0x2
- eors r0, r1
- bl GetBankMultiplayerId
- adds r1, r0, 0
- lsls r0, r1, 3
- subs r0, r1
- lsls r0, 2
- adds r4, 0x8
- adds r0, r4
- pop {r4}
- pop {r1}
- bx r1
- .align 2, 0
-_080444F4: .4byte gUnknown_202273C
- thumb_func_end sub_80444C4
-
thumb_func_start sub_80444F8
sub_80444F8: @ 80444F8
push {r4-r6,lr}
@@ -4518,12 +53,12 @@ _08044548: .4byte gPlayerParty
sub_804454C: @ 804454C
lsls r0, 16
lsrs r0, 16
- ldr r1, _08044558 @ =gUnknown_82538A8
+ ldr r1, _08044558 @ =gFacilityClassToPicIndex
adds r0, r1
ldrb r0, [r0]
bx lr
.align 2, 0
-_08044558: .4byte gUnknown_82538A8
+_08044558: .4byte gFacilityClassToPicIndex
thumb_func_end sub_804454C
thumb_func_start sub_804455C
@@ -4617,7 +152,7 @@ _080445F4:
cmp r2, 0
beq _08044658
_0804461A:
- ldr r4, _08044644 @ =gUnknown_202273C
+ ldr r4, _08044644 @ =gLinkPlayers
bl GetMultiplayerId
lsls r0, 24
lsrs r0, 24
@@ -4635,7 +170,7 @@ _08044632:
_08044638: .4byte gBattleTypeFlags
_0804463C: .4byte gMain
_08044640: .4byte 0x00000439
-_08044644: .4byte gUnknown_202273C
+_08044644: .4byte gLinkPlayers
_08044648:
ldr r0, _0804466C @ =gMain
ldr r1, _08044670 @ =0x00000439
@@ -4647,7 +182,7 @@ _08044648:
beq _08044632
_08044658:
adds r0, r5, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08044632
@@ -4765,7 +300,7 @@ _0804470E:
adds r0, r4, 0
movs r1, 0x3B
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3C
movs r2, 0
@@ -4774,7 +309,7 @@ _0804470E:
adds r0, r4, 0
movs r1, 0x3C
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3D
movs r2, 0
@@ -4783,7 +318,7 @@ _0804470E:
adds r0, r4, 0
movs r1, 0x3D
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3E
movs r2, 0
@@ -4792,7 +327,7 @@ _0804470E:
adds r0, r4, 0
movs r1, 0x3E
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x3F
movs r2, 0
@@ -4801,7 +336,7 @@ _0804470E:
adds r0, r4, 0
movs r1, 0x3F
mov r2, sp
- bl sub_804037C
+ bl SetMonData
_08044798:
adds r5, 0x1
cmp r5, 0x5
@@ -4822,7 +357,7 @@ sub_80447AC: @ 80447AC
eors r0, r1
lsls r0, 24
lsrs r0, 24
- ldr r3, _080447E8 @ =gUnknown_202273C
+ ldr r3, _080447E8 @ =gLinkPlayers
lsls r1, r0, 3
subs r1, r0
lsls r1, 2
@@ -4845,7 +380,7 @@ sub_80447AC: @ 80447AC
pop {r1}
bx r1
.align 2, 0
-_080447E8: .4byte gUnknown_202273C
+_080447E8: .4byte gLinkPlayers
_080447EC: .4byte gUnknown_825E032
thumb_func_end sub_80447AC
@@ -4857,7 +392,7 @@ sub_80447F0: @ 80447F0
eors r0, r1
lsls r0, 24
lsrs r0, 24
- ldr r3, _0804482C @ =gUnknown_202273C
+ ldr r3, _0804482C @ =gLinkPlayers
lsls r1, r0, 3
subs r1, r0
lsls r1, 2
@@ -4870,7 +405,7 @@ sub_80447F0: @ 80447F0
ldrb r0, [r1, 0x13]
lsls r0, 3
orrs r2, r0
- ldr r1, _08044830 @ =gUnknown_825393E
+ ldr r1, _08044830 @ =gFacilityClassToTrainerClass
ldr r0, _08044834 @ =gUnknown_825E032
lsls r2, 1
adds r2, r0
@@ -4880,8 +415,8 @@ sub_80447F0: @ 80447F0
pop {r1}
bx r1
.align 2, 0
-_0804482C: .4byte gUnknown_202273C
-_08044830: .4byte gUnknown_825393E
+_0804482C: .4byte gLinkPlayers
+_08044830: .4byte gFacilityClassToTrainerClass
_08044834: .4byte gUnknown_825E032
thumb_func_end sub_80447F0
@@ -4908,7 +443,7 @@ sub_8044838: @ 8044838
adds r1, r5, 0
adds r2, r4, 0
movs r3, 0x20
- bl sub_803E1EC
+ bl CreateObedientMon
cmp r6, 0
beq _08044880
add r0, sp, 0x10
@@ -4919,7 +454,7 @@ sub_8044838: @ 8044838
adds r0, r7, 0
movs r1, 0xC
add r2, sp, 0x10
- bl sub_804037C
+ bl SetMonData
_08044880:
add sp, 0x14
pop {r4-r7}
@@ -4997,7 +532,7 @@ sub_80448F8: @ 80448F8
cmp r0, 0
beq _08044944
adds r0, r2, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08044944
diff --git a/asm/pokemon_item_effect.s b/asm/pokemon_item_effect.s
deleted file mode 100644
index 09be52894..000000000
--- a/asm/pokemon_item_effect.s
+++ /dev/null
@@ -1,1972 +0,0 @@
- .include "asm/macros.inc"
- .include "constants/constants.inc"
-
- .syntax unified
-
- .text
-
- thumb_func_start ExecuteTableBasedItemEffect_
-ExecuteTableBasedItemEffect_: @ 80413C0
- push {r4,lr}
- sub sp, 0x4
- lsls r1, 16
- lsrs r1, 16
- lsls r2, 24
- lsrs r2, 24
- lsls r3, 24
- lsrs r3, 24
- movs r4, 0
- str r4, [sp]
- bl sub_80413E4
- lsls r0, 24
- lsrs r0, 24
- add sp, 0x4
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end ExecuteTableBasedItemEffect_
-
- thumb_func_start sub_80413E4
-sub_80413E4: @ 80413E4
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x3C
- mov r8, r0
- ldr r0, [sp, 0x5C]
- lsls r1, 16
- lsrs r1, 16
- str r1, [sp, 0x8]
- lsls r2, 24
- lsrs r2, 24
- str r2, [sp, 0xC]
- lsls r3, 24
- lsrs r3, 24
- str r3, [sp, 0x10]
- lsls r0, 24
- lsrs r0, 24
- str r0, [sp, 0x14]
- movs r0, 0x1
- str r0, [sp, 0x1C]
- movs r1, 0x6
- str r1, [sp, 0x24]
- movs r2, 0
- str r2, [sp, 0x2C]
- movs r3, 0x4
- str r3, [sp, 0x34]
- mov r0, r8
- movs r1, 0xC
- bl GetMonData
- lsls r0, 16
- lsrs r0, 16
- cmp r0, 0xAF
- bne _08041474
- ldr r0, _08041450 @ =gMain
- ldr r4, _08041454 @ =0x00000439
- adds r0, r4
- ldrb r1, [r0]
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- beq _08041460
- ldr r2, _08041458 @ =gUnknown_2023F54
- ldr r0, _0804145C @ =gUnknown_2024004
- ldrb r1, [r0]
- lsls r0, r1, 3
- subs r0, r1
- lsls r0, 2
- adds r0, r2
- ldrb r0, [r0, 0x7]
- b _0804147C
- .align 2, 0
-_08041450: .4byte gMain
-_08041454: .4byte 0x00000439
-_08041458: .4byte gUnknown_2023F54
-_0804145C: .4byte gUnknown_2024004
-_08041460:
- ldr r0, _0804146C @ =gSaveBlock1Ptr
- ldr r0, [r0]
- ldr r5, _08041470 @ =0x0000311a
- adds r0, r5
- ldrb r0, [r0]
- b _0804147C
- .align 2, 0
-_0804146C: .4byte gSaveBlock1Ptr
-_08041470: .4byte 0x0000311a
-_08041474:
- bl ItemId_GetHoldEffect
- lsls r0, 24
- lsrs r0, 24
-_0804147C:
- str r0, [sp, 0x30]
- ldr r1, _080414D8 @ =gUnknown_2023D6F
- ldr r0, _080414DC @ =gUnknown_2024004
- ldrb r2, [r0]
- strb r2, [r1]
- ldr r0, _080414E0 @ =gMain
- ldr r1, _080414E4 @ =0x00000439
- adds r0, r1
- ldrb r1, [r0]
- movs r0, 0x2
- ands r0, r1
- lsls r0, 24
- lsrs r1, r0, 24
- cmp r1, 0
- beq _0804151C
- ldr r0, _080414E8 @ =gActiveBattler
- strb r2, [r0]
- ldrb r0, [r0]
- bl GetBankSide
- lsls r0, 24
- lsrs r0, 24
- negs r1, r0
- orrs r1, r0
- lsrs r1, 31
- str r1, [sp, 0x18]
- ldr r0, _080414EC @ =gUnknown_2023BCC
- ldr r4, [sp, 0x8]
- subs r4, 0xD
- ldrb r0, [r0]
- cmp r1, r0
- bge _08041528
- ldr r2, _080414F0 @ =gBattlerPartyIndexes
- lsls r0, r1, 1
- adds r0, r2
- ldrh r3, [r0]
- ldr r5, [sp, 0xC]
- lsls r0, r5, 16
- lsrs r1, r0, 16
- adds r5, r0, 0
- cmp r3, r1
- bne _080414F4
- ldr r0, [sp, 0x18]
- str r0, [sp, 0x34]
- b _08041528
- .align 2, 0
-_080414D8: .4byte gUnknown_2023D6F
-_080414DC: .4byte gUnknown_2024004
-_080414E0: .4byte gMain
-_080414E4: .4byte 0x00000439
-_080414E8: .4byte gActiveBattler
-_080414EC: .4byte gUnknown_2023BCC
-_080414F0: .4byte gBattlerPartyIndexes
-_080414F4:
- ldr r1, [sp, 0x18]
- adds r1, 0x2
- str r1, [sp, 0x18]
- ldr r0, _08041518 @ =gUnknown_2023BCC
- ldrb r0, [r0]
- cmp r1, r0
- bge _08041528
- lsls r0, r1, 1
- adds r0, r2
- ldrh r1, [r0]
- lsrs r0, r5, 16
- cmp r1, r0
- bne _080414F4
- ldr r2, [sp, 0x18]
- lsls r0, r2, 24
- lsrs r0, 24
- str r0, [sp, 0x34]
- b _08041528
- .align 2, 0
-_08041518: .4byte gUnknown_2023BCC
-_0804151C:
- ldr r0, _08041544 @ =gActiveBattler
- strb r1, [r0]
- movs r3, 0x4
- str r3, [sp, 0x34]
- ldr r4, [sp, 0x8]
- subs r4, 0xD
-_08041528:
- lsls r0, r4, 16
- lsrs r0, 16
- cmp r0, 0xA5
- bhi _080415A8
- ldr r1, _08041548 @ =gUnknown_82528BC
- lsls r0, r4, 2
- adds r0, r1
- ldr r0, [r0]
- cmp r0, 0
- bne _0804154C
- ldr r4, [sp, 0x8]
- cmp r4, 0xAF
- beq _08041552
- b _080415A8
- .align 2, 0
-_08041544: .4byte gActiveBattler
-_08041548: .4byte gUnknown_82528BC
-_0804154C:
- ldr r5, [sp, 0x8]
- cmp r5, 0xAF
- bne _080415AE
-_08041552:
- ldr r0, _08041574 @ =gMain
- ldr r1, _08041578 @ =0x00000439
- adds r0, r1
- ldrb r1, [r0]
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- beq _08041584
- ldr r0, _0804157C @ =gActiveBattler
- ldrb r1, [r0]
- lsls r0, r1, 3
- subs r0, r1
- lsls r0, 2
- ldr r1, _08041580 @ =gUnknown_2023F5C
- adds r0, r1
- b _080415AE
- .align 2, 0
-_08041574: .4byte gMain
-_08041578: .4byte 0x00000439
-_0804157C: .4byte gActiveBattler
-_08041580: .4byte gUnknown_2023F5C
-_08041584:
- ldr r0, _08041590 @ =gSaveBlock1Ptr
- ldr r0, [r0]
- ldr r2, _08041594 @ =0x00003108
- adds r2, r0, r2
- str r2, [sp, 0x20]
- b _080415B0
- .align 2, 0
-_08041590: .4byte gSaveBlock1Ptr
-_08041594: .4byte 0x00003108
-_08041598:
- mov r0, r8
- movs r2, 0
- ldr r3, [sp, 0xC]
- bl BeginEvolutionScene
- movs r0, 0
- bl _08042394
-_080415A8:
- movs r0, 0x1
- bl _08042394
-_080415AE:
- str r0, [sp, 0x20]
-_080415B0:
- movs r3, 0
- str r3, [sp, 0x18]
-_080415B4:
- ldr r4, [sp, 0x18]
- cmp r4, 0x5
- bls _080415BE
- bl _08042384
-_080415BE:
- lsls r0, r4, 2
- ldr r1, _080415C8 @ =_080415CC
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .align 2, 0
-_080415C8: .4byte _080415CC
- .align 2, 0
-_080415CC:
- .4byte _080415E4
- .4byte _080416B0
- .4byte _08041744
- .4byte _080417D8
- .4byte _080419B8
- .4byte _08042056
-_080415E4:
- ldr r5, [sp, 0x20]
- ldr r0, [sp, 0x18]
- adds r2, r5, r0
- ldrb r1, [r2]
- movs r0, 0x80
- ands r0, r1
- adds r6, r2, 0
- cmp r0, 0
- beq _0804162C
- ldr r0, _0804169C @ =gMain
- ldr r1, _080416A0 @ =0x00000439
- adds r0, r1
- ldrb r1, [r0]
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- beq _0804162C
- ldr r2, [sp, 0x34]
- cmp r2, 0x4
- beq _0804162C
- ldr r1, _080416A4 @ =gBattleMons
- movs r0, 0x58
- muls r0, r2
- adds r1, 0x50
- adds r2, r0, r1
- ldr r1, [r2]
- movs r0, 0xF0
- lsls r0, 12
- ands r0, r1
- cmp r0, 0
- beq _0804162C
- ldr r0, _080416A8 @ =0xfff0ffff
- ands r1, r0
- str r1, [r2]
- movs r3, 0
- str r3, [sp, 0x1C]
-_0804162C:
- ldrb r1, [r6]
- movs r0, 0x30
- ands r0, r1
- cmp r0, 0
- beq _0804165A
- ldr r1, _080416A4 @ =gBattleMons
- ldr r0, _080416AC @ =gActiveBattler
- ldrb r2, [r0]
- movs r0, 0x58
- muls r0, r2
- adds r1, 0x50
- adds r2, r0, r1
- ldr r1, [r2]
- movs r3, 0x80
- lsls r3, 13
- adds r0, r1, 0
- ands r0, r3
- cmp r0, 0
- bne _0804165A
- orrs r1, r3
- str r1, [r2]
- movs r4, 0
- str r4, [sp, 0x1C]
-_0804165A:
- ldrb r0, [r6]
- movs r3, 0xF
- ands r3, r0
- cmp r3, 0
- bne _08041668
- bl _08042384
-_08041668:
- ldr r6, _080416A4 @ =gBattleMons
- ldr r5, _080416AC @ =gActiveBattler
- ldrb r0, [r5]
- movs r4, 0x58
- muls r0, r4
- adds r1, r0, r6
- ldrb r2, [r1, 0x19]
- movs r0, 0x19
- ldrsb r0, [r1, r0]
- cmp r0, 0xB
- ble _08041682
- bl _08042384
-_08041682:
- adds r0, r2, r3
- strb r0, [r1, 0x19]
- ldrb r0, [r5]
- muls r0, r4
- adds r1, r0, r6
- movs r0, 0x19
- ldrsb r0, [r1, r0]
- cmp r0, 0xC
- bgt _08041696
- b _0804198A
-_08041696:
- movs r0, 0xC
- strb r0, [r1, 0x19]
- b _0804198A
- .align 2, 0
-_0804169C: .4byte gMain
-_080416A0: .4byte 0x00000439
-_080416A4: .4byte gBattleMons
-_080416A8: .4byte 0xfff0ffff
-_080416AC: .4byte gActiveBattler
-_080416B0:
- ldr r0, [sp, 0x20]
- ldr r1, [sp, 0x18]
- adds r2, r0, r1
- ldrb r1, [r2]
- movs r0, 0xF0
- ands r0, r1
- lsls r3, r0, 24
- adds r6, r2, 0
- cmp r3, 0
- beq _080416F6
- ldr r7, _0804173C @ =gBattleMons
- ldr r5, _08041740 @ =gActiveBattler
- ldrb r0, [r5]
- movs r4, 0x58
- muls r0, r4
- adds r1, r0, r7
- ldrb r2, [r1, 0x1A]
- movs r0, 0x1A
- ldrsb r0, [r1, r0]
- cmp r0, 0xB
- bgt _080416F6
- lsrs r0, r3, 28
- adds r0, r2, r0
- strb r0, [r1, 0x1A]
- ldrb r0, [r5]
- muls r0, r4
- adds r1, r0, r7
- movs r0, 0x1A
- ldrsb r0, [r1, r0]
- cmp r0, 0xC
- ble _080416F2
- movs r0, 0xC
- strb r0, [r1, 0x1A]
-_080416F2:
- movs r2, 0
- str r2, [sp, 0x1C]
-_080416F6:
- ldrb r0, [r6]
- movs r3, 0xF
- ands r3, r0
- cmp r3, 0
- bne _08041704
- bl _08042384
-_08041704:
- ldr r6, _0804173C @ =gBattleMons
- ldr r5, _08041740 @ =gActiveBattler
- ldrb r0, [r5]
- movs r4, 0x58
- muls r0, r4
- adds r1, r0, r6
- ldrb r2, [r1, 0x1B]
- movs r0, 0x1B
- ldrsb r0, [r1, r0]
- cmp r0, 0xB
- ble _0804171E
- bl _08042384
-_0804171E:
- adds r0, r2, r3
- strb r0, [r1, 0x1B]
- ldrb r0, [r5]
- muls r0, r4
- adds r1, r0, r6
- movs r0, 0x1B
- ldrsb r0, [r1, r0]
- cmp r0, 0xC
- ble _08041734
- movs r0, 0xC
- strb r0, [r1, 0x1B]
-_08041734:
- movs r3, 0
- str r3, [sp, 0x1C]
- bl _08042384
- .align 2, 0
-_0804173C: .4byte gBattleMons
-_08041740: .4byte gActiveBattler
-_08041744:
- ldr r4, [sp, 0x20]
- ldr r5, [sp, 0x18]
- adds r2, r4, r5
- ldrb r1, [r2]
- movs r0, 0xF0
- ands r0, r1
- lsls r3, r0, 24
- adds r6, r2, 0
- cmp r3, 0
- beq _0804178A
- ldr r7, _080417D0 @ =gBattleMons
- ldr r5, _080417D4 @ =gActiveBattler
- ldrb r0, [r5]
- movs r4, 0x58
- muls r0, r4
- adds r1, r0, r7
- ldrb r2, [r1, 0x1E]
- movs r0, 0x1E
- ldrsb r0, [r1, r0]
- cmp r0, 0xB
- bgt _0804178A
- lsrs r0, r3, 28
- adds r0, r2, r0
- strb r0, [r1, 0x1E]
- ldrb r0, [r5]
- muls r0, r4
- adds r1, r0, r7
- movs r0, 0x1E
- ldrsb r0, [r1, r0]
- cmp r0, 0xC
- ble _08041786
- movs r0, 0xC
- strb r0, [r1, 0x1E]
-_08041786:
- movs r0, 0
- str r0, [sp, 0x1C]
-_0804178A:
- ldrb r0, [r6]
- movs r3, 0xF
- ands r3, r0
- cmp r3, 0
- bne _08041798
- bl _08042384
-_08041798:
- ldr r6, _080417D0 @ =gBattleMons
- ldr r5, _080417D4 @ =gActiveBattler
- ldrb r0, [r5]
- movs r4, 0x58
- muls r0, r4
- adds r1, r0, r6
- ldrb r2, [r1, 0x1C]
- movs r0, 0x1C
- ldrsb r0, [r1, r0]
- cmp r0, 0xB
- ble _080417B2
- bl _08042384
-_080417B2:
- adds r0, r2, r3
- strb r0, [r1, 0x1C]
- ldrb r0, [r5]
- muls r0, r4
- adds r1, r0, r6
- movs r0, 0x1C
- ldrsb r0, [r1, r0]
- cmp r0, 0xC
- ble _080417C8
- movs r0, 0xC
- strb r0, [r1, 0x1C]
-_080417C8:
- movs r1, 0
- str r1, [sp, 0x1C]
- bl _08042384
- .align 2, 0
-_080417D0: .4byte gBattleMons
-_080417D4: .4byte gActiveBattler
-_080417D8:
- ldr r3, [sp, 0x20]
- ldr r4, [sp, 0x18]
- adds r2, r3, r4
- ldrb r1, [r2]
- movs r0, 0x80
- ands r0, r1
- adds r6, r2, 0
- cmp r0, 0
- beq _08041820
- ldr r5, _08041994 @ =gUnknown_2023DE4
- ldr r4, _08041998 @ =gActiveBattler
- ldrb r0, [r4]
- bl GetBankSide
- lsls r0, 24
- lsrs r0, 24
- lsls r1, r0, 1
- adds r1, r0
- lsls r1, 2
- adds r1, r5
- ldrb r0, [r1, 0x4]
- cmp r0, 0
- bne _08041820
- ldrb r0, [r4]
- bl GetBankSide
- lsls r0, 24
- lsrs r0, 24
- lsls r1, r0, 1
- adds r1, r0
- lsls r1, 2
- adds r1, r5
- movs r0, 0x5
- strb r0, [r1, 0x4]
- movs r5, 0
- str r5, [sp, 0x1C]
-_08041820:
- ldrb r1, [r6]
- movs r0, 0x40
- ands r0, r1
- cmp r0, 0
- beq _08041882
- mov r0, r8
- movs r1, 0x38
- movs r2, 0
- bl GetMonData
- cmp r0, 0x64
- beq _08041882
- ldr r5, _0804199C @ =gUnknown_8253AE4
- mov r0, r8
- movs r1, 0x38
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- mov r0, r8
- movs r1, 0xB
- movs r2, 0
- bl GetMonData
- adds r4, 0x1
- lsls r4, 2
- ldr r2, _080419A0 @ =gBaseStats
- lsls r1, r0, 3
- subs r1, r0
- lsls r1, 2
- adds r1, r2
- ldrb r1, [r1, 0x13]
- movs r0, 0xCA
- lsls r0, 1
- muls r0, r1
- adds r4, r0
- adds r4, r5
- ldr r0, [r4]
- str r0, [sp]
- mov r0, r8
- movs r1, 0x19
- mov r2, sp
- bl sub_804037C
- mov r0, r8
- bl CalculateMonStats
- movs r0, 0
- str r0, [sp, 0x1C]
-_08041882:
- ldrb r1, [r6]
- movs r0, 0x20
- ands r0, r1
- cmp r0, 0
- beq _080418BE
- mov r0, r8
- ldr r1, [sp, 0xC]
- movs r2, 0x7
- ldr r3, [sp, 0x34]
- bl sub_80423A4
- lsls r0, 24
- cmp r0, 0
- bne _080418BE
- ldr r1, [sp, 0x34]
- cmp r1, 0x4
- beq _080418BA
- ldr r1, _080419A4 @ =gBattleMons
- movs r0, 0x58
- ldr r3, [sp, 0x34]
- adds r2, r3, 0
- muls r2, r0
- adds r1, 0x50
- adds r2, r1
- ldr r0, [r2]
- ldr r1, _080419A8 @ =0xf7ffffff
- ands r0, r1
- str r0, [r2]
-_080418BA:
- movs r4, 0
- str r4, [sp, 0x1C]
-_080418BE:
- ldrb r1, [r6]
- movs r0, 0x10
- ands r0, r1
- cmp r0, 0
- beq _080418DE
- ldr r2, _080419AC @ =0x00000f88
- mov r0, r8
- ldr r1, [sp, 0xC]
- ldr r3, [sp, 0x34]
- bl sub_80423A4
- lsls r0, 24
- cmp r0, 0
- bne _080418DE
- movs r5, 0
- str r5, [sp, 0x1C]
-_080418DE:
- ldrb r1, [r6]
- movs r0, 0x8
- ands r0, r1
- cmp r0, 0
- beq _080418FE
- mov r0, r8
- ldr r1, [sp, 0xC]
- movs r2, 0x10
- ldr r3, [sp, 0x34]
- bl sub_80423A4
- lsls r0, 24
- cmp r0, 0
- bne _080418FE
- movs r0, 0
- str r0, [sp, 0x1C]
-_080418FE:
- ldrb r1, [r6]
- movs r0, 0x4
- ands r0, r1
- cmp r0, 0
- beq _0804191E
- mov r0, r8
- ldr r1, [sp, 0xC]
- movs r2, 0x20
- ldr r3, [sp, 0x34]
- bl sub_80423A4
- lsls r0, 24
- cmp r0, 0
- bne _0804191E
- movs r1, 0
- str r1, [sp, 0x1C]
-_0804191E:
- ldrb r1, [r6]
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- beq _0804193E
- mov r0, r8
- ldr r1, [sp, 0xC]
- movs r2, 0x40
- ldr r3, [sp, 0x34]
- bl sub_80423A4
- lsls r0, 24
- cmp r0, 0
- bne _0804193E
- movs r2, 0
- str r2, [sp, 0x1C]
-_0804193E:
- ldrb r1, [r6]
- movs r0, 0x1
- ands r0, r1
- cmp r0, 0
- bne _0804194C
- bl _08042384
-_0804194C:
- ldr r0, _080419B0 @ =gMain
- ldr r3, _080419B4 @ =0x00000439
- adds r0, r3
- ldrb r1, [r0]
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- bne _08041960
- bl _08042384
-_08041960:
- ldr r4, [sp, 0x34]
- cmp r4, 0x4
- bne _0804196A
- bl _08042384
-_0804196A:
- ldr r1, _080419A4 @ =gBattleMons
- movs r0, 0x58
- muls r0, r4
- adds r1, 0x50
- adds r2, r0, r1
- ldr r1, [r2]
- movs r0, 0x7
- ands r0, r1
- cmp r0, 0
- bne _08041982
- bl _08042384
-_08041982:
- movs r0, 0x8
- negs r0, r0
- ands r1, r0
- str r1, [r2]
-_0804198A:
- movs r5, 0
- str r5, [sp, 0x1C]
- bl _08042384
- .align 2, 0
-_08041994: .4byte gUnknown_2023DE4
-_08041998: .4byte gActiveBattler
-_0804199C: .4byte gUnknown_8253AE4
-_080419A0: .4byte gBaseStats
-_080419A4: .4byte gBattleMons
-_080419A8: .4byte 0xf7ffffff
-_080419AC: .4byte 0x00000f88
-_080419B0: .4byte gMain
-_080419B4: .4byte 0x00000439
-_080419B8:
- ldr r1, [sp, 0x20]
- ldr r2, [sp, 0x18]
- adds r0, r1, r2
- ldrb r0, [r0]
- mov r10, r0
- movs r0, 0x20
- mov r3, r10
- ands r0, r3
- cmp r0, 0
- beq _08041A90
- movs r0, 0xDF
- ands r3, r0
- mov r10, r3
- mov r0, r8
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- ldr r1, _08041ABC @ =gUnknown_825DEA1
- ldr r4, [sp, 0x10]
- adds r1, r4, r1
- ldrb r1, [r1]
- ands r0, r1
- lsls r1, r4, 1
- lsrs r0, r1
- str r0, [sp]
- adds r5, r4, 0
- adds r5, 0xD
- mov r0, r8
- adds r1, r5, 0
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- lsls r4, 16
- lsrs r4, 16
- mov r0, r8
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- adds r1, r0, 0
- lsls r1, 24
- lsrs r1, 24
- adds r0, r4, 0
- ldr r2, [sp, 0x10]
- bl CalculatePPWithBonus
- lsls r0, 24
- lsrs r0, 24
- str r0, [sp, 0x28]
- ldr r0, [sp]
- cmp r0, 0x2
- bhi _08041A90
- ldr r0, [sp, 0x28]
- cmp r0, 0x4
- bls _08041A90
- mov r0, r8
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- ldr r1, _08041AC0 @ =gUnknown_825DEA9
- ldr r2, [sp, 0x10]
- adds r1, r2, r1
- ldrb r1, [r1]
- adds r0, r1
- str r0, [sp]
- mov r0, r8
- movs r1, 0x15
- mov r2, sp
- bl sub_804037C
- mov r0, r8
- adds r1, r5, 0
- movs r2, 0
- bl GetMonData
- lsls r0, 16
- lsrs r0, 16
- ldr r1, [sp]
- lsls r1, 24
- lsrs r1, 24
- ldr r2, [sp, 0x10]
- bl CalculatePPWithBonus
- lsls r0, 24
- lsrs r0, 24
- ldr r3, [sp, 0x28]
- subs r0, r3
- str r0, [sp]
- ldr r4, [sp, 0x10]
- adds r4, 0x11
- mov r0, r8
- adds r1, r4, 0
- movs r2, 0
- bl GetMonData
- ldr r1, [sp]
- adds r0, r1
- str r0, [sp]
- mov r0, r8
- adds r1, r4, 0
- mov r2, sp
- bl sub_804037C
- movs r4, 0
- str r4, [sp, 0x1C]
-_08041A90:
- movs r5, 0
- str r5, [sp, 0x28]
- mov r0, r10
- cmp r0, 0
- bne _08041A9E
- bl _08042384
-_08041A9E:
- movs r0, 0x1
- mov r1, r10
- ands r0, r1
- cmp r0, 0
- bne _08041AAA
- b _08042042
-_08041AAA:
- ldr r2, [sp, 0x28]
- cmp r2, 0x7
- bls _08041AB2
- b _08042042
-_08041AB2:
- lsls r0, r2, 2
- ldr r1, _08041AC4 @ =_08041AC8
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .align 2, 0
-_08041ABC: .4byte gUnknown_825DEA1
-_08041AC0: .4byte gUnknown_825DEA9
-_08041AC4: .4byte _08041AC8
- .align 2, 0
-_08041AC8:
- .4byte _08041AE8
- .4byte _08041AE8
- .4byte _08041B70
- .4byte _08041D94
- .4byte _08042042
- .4byte _08042042
- .4byte _08042042
- .4byte _0804202C
-_08041AE8:
- mov r0, r8
- bl GetMonEVCount
- lsls r0, 16
- lsrs r5, r0, 16
- ldr r0, _08041B28 @ =0x000001fd
- cmp r5, r0
- bls _08041AFA
- b _080415A8
-_08041AFA:
- ldr r0, _08041B2C @ =gUnknown_825DFEA
- ldr r3, [sp, 0x28]
- adds r0, r3, r0
- ldrb r1, [r0]
- mov r0, r8
- movs r2, 0
- bl GetMonData
- adds r1, r0, 0
- str r1, [sp]
- cmp r1, 0x63
- bls _08041B14
- b _08042042
-_08041B14:
- ldr r4, [sp, 0x20]
- ldr r2, [sp, 0x24]
- adds r0, r4, r2
- ldrb r0, [r0]
- adds r1, r0
- cmp r1, 0x64
- bls _08041B30
- adds r0, 0x64
- subs r4, r0, r1
- b _08041B32
- .align 2, 0
-_08041B28: .4byte 0x000001fd
-_08041B2C: .4byte gUnknown_825DFEA
-_08041B30:
- adds r4, r0, 0
-_08041B32:
- adds r1, r5, r4
- movs r0, 0xFF
- lsls r0, 1
- cmp r1, r0
- bls _08041B40
- adds r0, r4, r0
- subs r4, r0, r1
-_08041B40:
- ldr r0, [sp]
- adds r0, r4
- str r0, [sp]
- ldr r0, _08041B6C @ =gUnknown_825DFEA
- ldr r3, [sp, 0x28]
- adds r0, r3, r0
- ldrb r1, [r0]
- mov r0, r8
- mov r2, sp
- bl sub_804037C
- mov r0, r8
- bl CalculateMonStats
- ldr r0, [sp, 0x24]
- adds r0, 0x1
- lsls r0, 24
- lsrs r0, 24
- str r0, [sp, 0x24]
- movs r4, 0
- str r4, [sp, 0x1C]
- b _08042042
- .align 2, 0
-_08041B6C: .4byte gUnknown_825DFEA
-_08041B70:
- movs r0, 0x10
- mov r5, r10
- ands r0, r5
- cmp r0, 0
- beq _08041C30
- mov r0, r8
- movs r1, 0x39
- movs r2, 0
- bl GetMonData
- cmp r0, 0
- beq _08041B90
- ldr r0, [sp, 0x24]
- adds r0, 0x1
- lsls r0, 24
- b _08041ED6
-_08041B90:
- ldr r0, _08041BD8 @ =gMain
- ldr r1, _08041BDC @ =0x00000439
- adds r0, r1
- ldrb r1, [r0]
- movs r4, 0x2
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- beq _08041C46
- ldr r2, [sp, 0x34]
- cmp r2, 0x4
- beq _08041BF0
- ldr r2, _08041BE0 @ =gAbsentBattlerFlags
- ldr r1, _08041BE4 @ =gBitTable
- ldr r3, [sp, 0x34]
- lsls r0, r3, 2
- adds r0, r1
- ldr r1, [r0]
- ldrb r0, [r2]
- bics r0, r1
- strb r0, [r2]
- ldr r1, _08041BE8 @ =gBattlerPartyIndexes
- lsls r0, r3, 1
- adds r0, r1
- ldrb r0, [r0]
- bl pokemon_order_func
- adds r1, r0, 0
- lsls r1, 24
- lsrs r1, 24
- ldr r0, [sp, 0x34]
- bl CopyPlayerPartyMonToBattleData
- ldr r0, _08041BEC @ =gActiveBattler
- ldrb r0, [r0]
- b _08041C08
- .align 2, 0
-_08041BD8: .4byte gMain
-_08041BDC: .4byte 0x00000439
-_08041BE0: .4byte gAbsentBattlerFlags
-_08041BE4: .4byte gBitTable
-_08041BE8: .4byte gBattlerPartyIndexes
-_08041BEC: .4byte gActiveBattler
-_08041BF0:
- ldr r3, _08041C20 @ =gAbsentBattlerFlags
- ldr r1, _08041C24 @ =gBitTable
- ldr r2, _08041C28 @ =gActiveBattler
- ldrb r0, [r2]
- eors r0, r4
- lsls r0, 2
- adds r0, r1
- ldr r1, [r0]
- ldrb r0, [r3]
- bics r0, r1
- strb r0, [r3]
- ldrb r0, [r2]
-_08041C08:
- bl GetBankSide
- lsls r0, 24
- cmp r0, 0
- bne _08041C46
- ldr r1, _08041C2C @ =gBattleResults
- ldrb r0, [r1, 0x4]
- cmp r0, 0xFE
- bhi _08041C46
- adds r0, 0x1
- strb r0, [r1, 0x4]
- b _08041C46
- .align 2, 0
-_08041C20: .4byte gAbsentBattlerFlags
-_08041C24: .4byte gBitTable
-_08041C28: .4byte gActiveBattler
-_08041C2C: .4byte gBattleResults
-_08041C30:
- mov r0, r8
- movs r1, 0x39
- movs r2, 0
- bl GetMonData
- cmp r0, 0
- bne _08041C46
- ldr r0, [sp, 0x24]
- adds r0, 0x1
- lsls r0, 24
- b _08041ED6
-_08041C46:
- ldr r1, [sp, 0x24]
- adds r0, r1, 0x1
- lsls r0, 24
- lsrs r0, 24
- str r0, [sp, 0x24]
- ldr r4, [sp, 0x20]
- adds r1, r4, r1
- ldrb r1, [r1]
- str r1, [sp]
- adds r0, r1, 0
- cmp r0, 0xFE
- beq _08041C88
- cmp r0, 0xFE
- bhi _08041C68
- cmp r0, 0xFD
- beq _08041C9E
- b _08041CA6
-_08041C68:
- cmp r1, 0xFF
- bne _08041CA6
- mov r0, r8
- movs r1, 0x3A
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- mov r0, r8
- movs r1, 0x39
- movs r2, 0
- bl GetMonData
- subs r4, r0
- str r4, [sp]
- b _08041CA6
-_08041C88:
- mov r0, r8
- movs r1, 0x3A
- movs r2, 0
- bl GetMonData
- lsrs r0, 1
- str r0, [sp]
- cmp r0, 0
- bne _08041CA6
- movs r0, 0x1
- b _08041CA4
-_08041C9E:
- ldr r0, _08041D60 @ =gBattleScripting
- adds r0, 0x23
- ldrb r0, [r0]
-_08041CA4:
- str r0, [sp]
-_08041CA6:
- mov r0, r8
- movs r1, 0x3A
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- mov r0, r8
- movs r1, 0x39
- movs r2, 0
- bl GetMonData
- cmp r4, r0
- beq _08041D84
- ldr r5, [sp, 0x14]
- cmp r5, 0
- bne _08041D78
- mov r0, r8
- movs r1, 0x39
- movs r2, 0
- bl GetMonData
- ldr r1, [sp]
- adds r0, r1
- str r0, [sp]
- mov r0, r8
- movs r1, 0x3A
- movs r2, 0
- bl GetMonData
- ldr r1, [sp]
- cmp r1, r0
- bls _08041CF2
- mov r0, r8
- movs r1, 0x3A
- movs r2, 0
- bl GetMonData
- str r0, [sp]
-_08041CF2:
- mov r0, r8
- movs r1, 0x39
- mov r2, sp
- bl sub_804037C
- ldr r0, _08041D64 @ =gMain
- ldr r1, _08041D68 @ =0x00000439
- adds r0, r1
- ldrb r1, [r0]
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- beq _08041D80
- ldr r2, [sp, 0x34]
- cmp r2, 0x4
- beq _08041D80
- ldr r1, _08041D6C @ =gBattleMons
- movs r0, 0x58
- muls r0, r2
- adds r0, r1
- ldr r1, [sp]
- strh r1, [r0, 0x28]
- movs r0, 0x10
- mov r3, r10
- ands r0, r3
- cmp r0, 0
- bne _08041D80
- ldr r4, _08041D70 @ =gActiveBattler
- ldrb r0, [r4]
- bl GetBankSide
- lsls r0, 24
- cmp r0, 0
- bne _08041D80
- ldr r1, _08041D74 @ =gBattleResults
- ldrb r0, [r1, 0x3]
- cmp r0, 0xFE
- bhi _08041D42
- adds r0, 0x1
- strb r0, [r1, 0x3]
-_08041D42:
- ldrb r5, [r4]
- add r0, sp, 0x34
- ldrb r0, [r0]
- strb r0, [r4]
- movs r0, 0
- movs r1, 0
- movs r2, 0
- bl EmitGetMonData
- ldrb r0, [r4]
- bl MarkBufferBankForExecution
- strb r5, [r4]
- b _08041D80
- .align 2, 0
-_08041D60: .4byte gBattleScripting
-_08041D64: .4byte gMain
-_08041D68: .4byte 0x00000439
-_08041D6C: .4byte gBattleMons
-_08041D70: .4byte gActiveBattler
-_08041D74: .4byte gBattleResults
-_08041D78:
- ldr r1, _08041D90 @ =gBattleMoveDamage
- ldr r0, [sp]
- negs r0, r0
- str r0, [r1]
-_08041D80:
- movs r1, 0
- str r1, [sp, 0x1C]
-_08041D84:
- movs r0, 0xEF
- mov r2, r10
- ands r2, r0
- mov r10, r2
- b _08042042
- .align 2, 0
-_08041D90: .4byte gBattleMoveDamage
-_08041D94:
- movs r7, 0x2
- mov r0, r10
- ands r0, r7
- cmp r0, 0
- beq _08041DA0
- b _08041EF0
-_08041DA0:
- movs r5, 0
- ldr r3, [sp, 0x24]
- adds r3, 0x1
- str r3, [sp, 0x38]
-_08041DA8:
- movs r4, 0x11
- adds r4, r5
- mov r9, r4
- mov r0, r8
- mov r1, r9
- movs r2, 0
- bl GetMonData
- str r0, [sp]
- adds r7, r5, 0
- adds r7, 0xD
- mov r0, r8
- adds r1, r7, 0
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- lsls r4, 16
- lsrs r4, 16
- mov r0, r8
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- adds r1, r0, 0
- lsls r1, 24
- lsrs r1, 24
- lsls r0, r5, 24
- lsrs r6, r0, 24
- adds r0, r4, 0
- adds r2, r6, 0
- bl CalculatePPWithBonus
- lsls r0, 24
- lsrs r0, 24
- ldr r1, [sp]
- cmp r1, r0
- beq _08041ECA
- ldr r2, [sp, 0x20]
- ldr r3, [sp, 0x24]
- adds r0, r2, r3
- ldrb r0, [r0]
- adds r0, r1, r0
- str r0, [sp]
- mov r0, r8
- adds r1, r7, 0
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- lsls r4, 16
- lsrs r4, 16
- mov r0, r8
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- adds r1, r0, 0
- lsls r1, 24
- lsrs r1, 24
- adds r0, r4, 0
- adds r2, r6, 0
- bl CalculatePPWithBonus
- lsls r0, 24
- lsrs r0, 24
- ldr r1, [sp]
- cmp r1, r0
- bls _08041E60
- mov r0, r8
- adds r1, r7, 0
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- lsls r4, 16
- lsrs r4, 16
- mov r0, r8
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- adds r1, r0, 0
- lsls r1, 24
- lsrs r1, 24
- adds r0, r4, 0
- adds r2, r6, 0
- bl CalculatePPWithBonus
- lsls r0, 24
- lsrs r0, 24
- str r0, [sp]
-_08041E60:
- mov r0, r8
- mov r1, r9
- mov r2, sp
- bl sub_804037C
- ldr r0, _08041EDC @ =gMain
- ldr r4, _08041EE0 @ =0x00000439
- adds r0, r4
- ldrb r1, [r0]
- movs r0, 0x2
- ands r0, r1
- cmp r0, 0
- beq _08041EC6
- ldr r0, [sp, 0x34]
- cmp r0, 0x4
- beq _08041EC6
- ldr r4, _08041EE4 @ =gBattleMons
- movs r0, 0x58
- ldr r1, [sp, 0x34]
- adds r3, r1, 0
- muls r3, r0
- adds r0, r4, 0
- adds r0, 0x50
- adds r0, r3, r0
- ldr r1, [r0]
- movs r0, 0x80
- lsls r0, 14
- ands r1, r0
- cmp r1, 0
- bne _08041EC6
- ldr r1, _08041EE8 @ =gDisableStructs
- ldr r2, [sp, 0x34]
- lsls r0, r2, 3
- subs r0, r2
- lsls r0, 2
- adds r0, r1
- ldrb r1, [r0, 0x18]
- lsrs r1, 4
- ldr r2, _08041EEC @ =gBitTable
- lsls r0, r5, 2
- adds r0, r2
- ldr r0, [r0]
- ands r1, r0
- cmp r1, 0
- bne _08041EC6
- adds r0, r5, r3
- adds r1, r4, 0
- adds r1, 0x24
- adds r0, r1
- ldr r1, [sp]
- strb r1, [r0]
-_08041EC6:
- movs r3, 0
- str r3, [sp, 0x1C]
-_08041ECA:
- adds r5, 0x1
- cmp r5, 0x3
- bgt _08041ED2
- b _08041DA8
-_08041ED2:
- ldr r4, [sp, 0x38]
- lsls r0, r4, 24
-_08041ED6:
- lsrs r0, 24
- str r0, [sp, 0x24]
- b _08042042
- .align 2, 0
-_08041EDC: .4byte gMain
-_08041EE0: .4byte 0x00000439
-_08041EE4: .4byte gBattleMons
-_08041EE8: .4byte gDisableStructs
-_08041EEC: .4byte gBitTable
-_08041EF0:
- ldr r6, [sp, 0x10]
- adds r6, 0x11
- mov r0, r8
- adds r1, r6, 0
- movs r2, 0
- bl GetMonData
- str r0, [sp]
- ldr r5, [sp, 0x10]
- adds r5, 0xD
- mov r0, r8
- adds r1, r5, 0
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- lsls r4, 16
- lsrs r4, 16
- mov r0, r8
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- adds r1, r0, 0
- lsls r1, 24
- lsrs r1, 24
- adds r0, r4, 0
- ldr r2, [sp, 0x10]
- bl CalculatePPWithBonus
- lsls r0, 24
- lsrs r0, 24
- ldr r2, [sp]
- cmp r2, r0
- bne _08041F38
- b _08042042
-_08041F38:
- ldr r1, [sp, 0x24]
- adds r0, r1, 0x1
- lsls r0, 24
- lsrs r0, 24
- str r0, [sp, 0x24]
- ldr r0, [sp, 0x20]
- adds r1, r0, r1
- ldrb r0, [r1]
- adds r0, r2, r0
- str r0, [sp]
- mov r0, r8
- adds r1, r5, 0
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- lsls r4, 16
- lsrs r4, 16
- mov r0, r8
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- adds r1, r0, 0
- lsls r1, 24
- lsrs r1, 24
- adds r0, r4, 0
- ldr r2, [sp, 0x10]
- bl CalculatePPWithBonus
- lsls r0, 24
- lsrs r0, 24
- ldr r1, [sp]
- cmp r1, r0
- bls _08041FAC
- mov r0, r8
- adds r1, r5, 0
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- lsls r4, 16
- lsrs r4, 16
- mov r0, r8
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- adds r1, r0, 0
- lsls r1, 24
- lsrs r1, 24
- adds r0, r4, 0
- ldr r2, [sp, 0x10]
- bl CalculatePPWithBonus
- lsls r0, 24
- lsrs r0, 24
- str r0, [sp]
-_08041FAC:
- mov r0, r8
- adds r1, r6, 0
- mov r2, sp
- bl sub_804037C
- ldr r0, _08042018 @ =gMain
- ldr r1, _0804201C @ =0x00000439
- adds r0, r1
- ldrb r1, [r0]
- adds r0, r7, 0
- ands r0, r1
- cmp r0, 0
- beq _08042010
- ldr r2, [sp, 0x34]
- cmp r2, 0x4
- beq _08042010
- ldr r4, _08042020 @ =gBattleMons
- movs r0, 0x58
- adds r3, r2, 0
- muls r3, r0
- adds r0, r4, 0
- adds r0, 0x50
- adds r0, r3, r0
- ldr r0, [r0]
- movs r1, 0x80
- lsls r1, 14
- ands r0, r1
- cmp r0, 0
- bne _08042010
- ldr r1, _08042024 @ =gDisableStructs
- lsls r0, r2, 3
- subs r0, r2
- lsls r0, 2
- adds r0, r1
- ldrb r1, [r0, 0x18]
- lsrs r1, 4
- ldr r2, _08042028 @ =gBitTable
- ldr r5, [sp, 0x10]
- lsls r0, r5, 2
- adds r0, r2
- ldr r0, [r0]
- ands r1, r0
- cmp r1, 0
- bne _08042010
- adds r0, r5, r3
- adds r1, r4, 0
- adds r1, 0x24
- adds r0, r1
- ldr r1, [sp]
- strb r1, [r0]
-_08042010:
- movs r0, 0
- str r0, [sp, 0x1C]
- b _08042042
- .align 2, 0
-_08042018: .4byte gMain
-_0804201C: .4byte 0x00000439
-_08042020: .4byte gBattleMons
-_08042024: .4byte gDisableStructs
-_08042028: .4byte gBitTable
-_0804202C:
- mov r0, r8
- movs r1, 0x2
- ldr r2, [sp, 0x8]
- bl sub_8042EC4
- lsls r0, 16
- lsrs r1, r0, 16
- cmp r1, 0
- beq _08042042
- bl _08041598
-_08042042:
- ldr r1, [sp, 0x28]
- adds r1, 0x1
- str r1, [sp, 0x28]
- mov r2, r10
- lsrs r2, 1
- mov r10, r2
- cmp r2, 0
- beq _08042054
- b _08041A9E
-_08042054:
- b _08042384
-_08042056:
- ldr r3, [sp, 0x20]
- ldr r4, [sp, 0x18]
- adds r0, r3, r4
- ldrb r0, [r0]
- mov r10, r0
- movs r5, 0
- str r5, [sp, 0x28]
- cmp r0, 0
- bne _0804206A
- b _08042384
-_0804206A:
- movs r0, 0x1
- mov r1, r10
- ands r0, r1
- cmp r0, 0
- bne _08042076
- b _08042372
-_08042076:
- ldr r2, [sp, 0x28]
- cmp r2, 0x7
- bls _0804207E
- b _08042372
-_0804207E:
- lsls r0, r2, 2
- ldr r1, _08042088 @ =_0804208C
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .align 2, 0
-_08042088: .4byte _0804208C
- .align 2, 0
-_0804208C:
- .4byte _080420AC
- .4byte _080420AC
- .4byte _080420AC
- .4byte _080420AC
- .4byte _08042130
- .4byte _08042204
- .4byte _0804225E
- .4byte _080422B4
-_080420AC:
- mov r0, r8
- bl GetMonEVCount
- lsls r0, 16
- lsrs r5, r0, 16
- ldr r0, _080420F4 @ =0x000001fd
- cmp r5, r0
- bls _080420C0
- bl _080415A8
-_080420C0:
- ldr r0, _080420F8 @ =gUnknown_825DFEA
- ldr r4, [sp, 0x28]
- adds r4, 0x2
- adds r0, r4, r0
- ldrb r1, [r0]
- mov r0, r8
- movs r2, 0
- bl GetMonData
- adds r1, r0, 0
- str r1, [sp]
- adds r2, r4, 0
- cmp r1, 0x63
- bls _080420DE
- b _08042372
-_080420DE:
- ldr r3, [sp, 0x20]
- ldr r4, [sp, 0x24]
- adds r0, r3, r4
- ldrb r0, [r0]
- adds r1, r0
- cmp r1, 0x64
- bls _080420FC
- adds r0, 0x64
- subs r4, r0, r1
- b _080420FE
- .align 2, 0
-_080420F4: .4byte 0x000001fd
-_080420F8: .4byte gUnknown_825DFEA
-_080420FC:
- adds r4, r0, 0
-_080420FE:
- adds r1, r5, r4
- movs r0, 0xFF
- lsls r0, 1
- cmp r1, r0
- bls _0804210C
- adds r0, r4, r0
- subs r4, r0, r1
-_0804210C:
- ldr r0, [sp]
- adds r0, r4
- str r0, [sp]
- ldr r0, _0804212C @ =gUnknown_825DFEA
- adds r0, r2, r0
- ldrb r1, [r0]
- mov r0, r8
- mov r2, sp
- bl sub_804037C
- mov r0, r8
- bl CalculateMonStats
- movs r5, 0
- str r5, [sp, 0x1C]
- b _08042368
- .align 2, 0
-_0804212C: .4byte gUnknown_825DFEA
-_08042130:
- mov r0, r8
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- ldr r1, _080421F8 @ =gUnknown_825DEA1
- ldr r2, [sp, 0x10]
- adds r1, r2, r1
- ldrb r1, [r1]
- ands r0, r1
- lsls r1, r2, 1
- lsrs r0, r1
- str r0, [sp]
- cmp r0, 0x2
- bls _08042150
- b _08042372
-_08042150:
- adds r5, r2, 0
- adds r5, 0xD
- mov r0, r8
- adds r1, r5, 0
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- lsls r4, 16
- lsrs r4, 16
- mov r0, r8
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- adds r1, r0, 0
- lsls r1, 24
- lsrs r1, 24
- adds r0, r4, 0
- ldr r2, [sp, 0x10]
- bl CalculatePPWithBonus
- lsls r0, 24
- lsrs r4, r0, 24
- mov r0, r8
- movs r1, 0x15
- movs r2, 0
- bl GetMonData
- str r0, [sp]
- ldr r1, _080421FC @ =gUnknown_825DEA5
- ldr r3, [sp, 0x10]
- adds r1, r3, r1
- ldrb r2, [r1]
- ands r2, r0
- str r2, [sp]
- ldr r0, _08042200 @ =gUnknown_825DEA9
- adds r0, r3, r0
- ldrb r1, [r0]
- lsls r0, r1, 1
- adds r0, r1
- adds r2, r0
- str r2, [sp]
- mov r0, r8
- movs r1, 0x15
- mov r2, sp
- bl sub_804037C
- mov r0, r8
- adds r1, r5, 0
- movs r2, 0
- bl GetMonData
- lsls r0, 16
- lsrs r0, 16
- ldr r1, [sp]
- lsls r1, 24
- lsrs r1, 24
- ldr r2, [sp, 0x10]
- bl CalculatePPWithBonus
- lsls r0, 24
- lsrs r0, 24
- subs r0, r4
- str r0, [sp]
- ldr r4, [sp, 0x10]
- adds r4, 0x11
- mov r0, r8
- adds r1, r4, 0
- movs r2, 0
- bl GetMonData
- ldr r1, [sp]
- adds r0, r1
- str r0, [sp]
- mov r0, r8
- adds r1, r4, 0
- mov r2, sp
- bl sub_804037C
- movs r4, 0
- str r4, [sp, 0x1C]
- b _08042372
- .align 2, 0
-_080421F8: .4byte gUnknown_825DEA1
-_080421FC: .4byte gUnknown_825DEA5
-_08042200: .4byte gUnknown_825DEA9
-_08042204:
- mov r0, r8
- movs r1, 0x20
- movs r2, 0
- bl GetMonData
- cmp r0, 0x63
- bls _08042214
- b _08042368
-_08042214:
- ldr r5, [sp, 0x1C]
- cmp r5, 0
- beq _0804221C
- b _08042368
-_0804221C:
- ldr r0, [sp, 0x2C]
- cmp r0, 0
- beq _08042224
- b _08042368
-_08042224:
- ldr r1, [sp, 0x20]
- ldr r2, [sp, 0x24]
- adds r0, r1, r2
- ldrb r0, [r0]
- str r0, [sp, 0x2C]
- mov r0, r8
- movs r1, 0x20
- movs r2, 0
- bl GetMonData
- adds r5, r0, 0
- str r5, [sp, 0x4]
- ldr r3, [sp, 0x2C]
- lsls r4, r3, 24
- asrs r1, r4, 24
- cmp r1, 0
- ble _08042308
- ldr r0, [sp, 0x30]
- cmp r0, 0x1B
- bne _08042308
- movs r0, 0x96
- muls r0, r1
- movs r1, 0x64
- bl __divsi3
- adds r0, r5, r0
- str r0, [sp, 0x4]
- adds r2, r4, 0
- b _08042314
-_0804225E:
- mov r0, r8
- movs r1, 0x20
- movs r2, 0
- bl GetMonData
- cmp r0, 0x63
- bls _08042368
- mov r0, r8
- movs r1, 0x20
- movs r2, 0
- bl GetMonData
- cmp r0, 0xC7
- bhi _08042368
- ldr r2, [sp, 0x1C]
- cmp r2, 0
- bne _08042368
- ldr r3, [sp, 0x2C]
- cmp r3, 0
- bne _08042368
- ldr r4, [sp, 0x20]
- ldr r5, [sp, 0x24]
- adds r0, r4, r5
- ldrb r0, [r0]
- str r0, [sp, 0x2C]
- mov r0, r8
- movs r1, 0x20
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- str r4, [sp, 0x4]
- ldr r0, [sp, 0x2C]
- lsls r5, r0, 24
- asrs r1, r5, 24
- cmp r1, 0
- ble _080422AE
- ldr r2, [sp, 0x30]
- cmp r2, 0x1B
- beq _080422F6
-_080422AE:
- ldr r3, [sp, 0x2C]
- lsls r2, r3, 24
- b _0804230C
-_080422B4:
- mov r0, r8
- movs r1, 0x20
- movs r2, 0
- bl GetMonData
- cmp r0, 0xC7
- bls _08042368
- ldr r4, [sp, 0x1C]
- cmp r4, 0
- bne _08042368
- ldr r5, [sp, 0x2C]
- cmp r5, 0
- bne _08042368
- ldr r1, [sp, 0x20]
- ldr r2, [sp, 0x24]
- adds r0, r1, r2
- ldrb r0, [r0]
- str r0, [sp, 0x2C]
- mov r0, r8
- movs r1, 0x20
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- str r4, [sp, 0x4]
- ldr r3, [sp, 0x2C]
- lsls r5, r3, 24
- asrs r1, r5, 24
- cmp r1, 0
- ble _08042308
- ldr r0, [sp, 0x30]
- cmp r0, 0x1B
- bne _08042308
-_080422F6:
- movs r0, 0x96
- muls r0, r1
- movs r1, 0x64
- bl __divsi3
- adds r0, r4, r0
- str r0, [sp, 0x4]
- adds r2, r5, 0
- b _08042314
-_08042308:
- ldr r1, [sp, 0x2C]
- lsls r2, r1, 24
-_0804230C:
- asrs r1, r2, 24
- ldr r0, [sp, 0x4]
- adds r0, r1
- str r0, [sp, 0x4]
-_08042314:
- cmp r2, 0
- ble _0804234A
- mov r0, r8
- movs r1, 0x26
- movs r2, 0
- bl GetMonData
- cmp r0, 0xB
- bne _0804232C
- ldr r0, [sp, 0x4]
- adds r0, 0x1
- str r0, [sp, 0x4]
-_0804232C:
- mov r0, r8
- movs r1, 0x23
- movs r2, 0
- bl GetMonData
- adds r4, r0, 0
- bl sav1_map_get_name
- lsls r0, 24
- lsrs r0, 24
- cmp r4, r0
- bne _0804234A
- ldr r0, [sp, 0x4]
- adds r0, 0x1
- str r0, [sp, 0x4]
-_0804234A:
- ldr r0, [sp, 0x4]
- cmp r0, 0
- bge _08042354
- movs r0, 0
- str r0, [sp, 0x4]
-_08042354:
- ldr r0, [sp, 0x4]
- cmp r0, 0xFF
- ble _0804235E
- movs r0, 0xFF
- str r0, [sp, 0x4]
-_0804235E:
- add r2, sp, 0x4
- mov r0, r8
- movs r1, 0x20
- bl sub_804037C
-_08042368:
- ldr r0, [sp, 0x24]
- adds r0, 0x1
- lsls r0, 24
- lsrs r0, 24
- str r0, [sp, 0x24]
-_08042372:
- ldr r2, [sp, 0x28]
- adds r2, 0x1
- str r2, [sp, 0x28]
- mov r3, r10
- lsrs r3, 1
- mov r10, r3
- cmp r3, 0
- beq _08042384
- b _0804206A
-_08042384:
- ldr r4, [sp, 0x18]
- adds r4, 0x1
- str r4, [sp, 0x18]
- cmp r4, 0x5
- bgt _08042392
- bl _080415B4
-_08042392:
- ldr r0, [sp, 0x1C]
-_08042394:
- add sp, 0x3C
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end sub_80413E4
-
- .align 2, 0 @ Don't pad with nop.
diff --git a/asm/pokemon_size_record.s b/asm/pokemon_size_record.s
index be196e54e..50ddd41a4 100644
--- a/asm/pokemon_size_record.s
+++ b/asm/pokemon_size_record.s
@@ -299,7 +299,7 @@ sub_80A08CC: @ 80A08CC
ldr r0, _080A08FC @ =gStringVar1
movs r1, 0xB
muls r1, r4
- ldr r2, _080A0900 @ =gUnknown_8245EE0
+ ldr r2, _080A0900 @ =gSpeciesNames
adds r1, r2
bl StringCopy
pop {r4}
@@ -308,7 +308,7 @@ sub_80A08CC: @ 80A08CC
.align 2, 0
_080A08F8: .4byte gStringVar3
_080A08FC: .4byte gStringVar1
-_080A0900: .4byte gUnknown_8245EE0
+_080A0900: .4byte gSpeciesNames
thumb_func_end sub_80A08CC
thumb_func_start sub_80A0904
@@ -454,7 +454,7 @@ _080A09E6:
ldrb r1, [r0]
adds r0, r4, 0
mov r2, r8
- bl sub_804037C
+ bl SetMonData
movs r7, 0x1
_080A0A18:
adds r5, 0x1
diff --git a/asm/pokemon_storage_system.s b/asm/pokemon_storage_system.s
index 67dea9b9e..37a1eb75a 100644
--- a/asm/pokemon_storage_system.s
+++ b/asm/pokemon_storage_system.s
@@ -8,14 +8,14 @@
thumb_func_start sub_808B9C0
sub_808B9C0: @ 808B9C0
push {lr}
- ldr r1, _0808B9D0 @ =gUnknown_3005010
+ ldr r1, _0808B9D0 @ =gPokemonStoragePtr
ldr r1, [r1]
ldr r2, _0808B9D4 @ =0x000083d0
bl memcpy
pop {r0}
bx r0
.align 2, 0
-_0808B9D0: .4byte gUnknown_3005010
+_0808B9D0: .4byte gPokemonStoragePtr
_0808B9D4: .4byte 0x000083d0
thumb_func_end sub_808B9C0
@@ -23,25 +23,25 @@ _0808B9D4: .4byte 0x000083d0
sub_808B9D8: @ 808B9D8
push {lr}
adds r1, r0, 0
- ldr r0, _0808B9EC @ =gUnknown_3005010
+ ldr r0, _0808B9EC @ =gPokemonStoragePtr
ldr r0, [r0]
ldr r2, _0808B9F0 @ =0x000083d0
bl memcpy
pop {r0}
bx r0
.align 2, 0
-_0808B9EC: .4byte gUnknown_3005010
+_0808B9EC: .4byte gPokemonStoragePtr
_0808B9F0: .4byte 0x000083d0
thumb_func_end sub_808B9D8
thumb_func_start StorageGetCurrentBox
StorageGetCurrentBox: @ 808B9F4
- ldr r0, _0808B9FC @ =gUnknown_3005010
+ ldr r0, _0808B9FC @ =gPokemonStoragePtr
ldr r0, [r0]
ldrb r0, [r0]
bx lr
.align 2, 0
-_0808B9FC: .4byte gUnknown_3005010
+_0808B9FC: .4byte gPokemonStoragePtr
thumb_func_end StorageGetCurrentBox
thumb_func_start sub_808BA00
@@ -51,14 +51,14 @@ sub_808BA00: @ 808BA00
lsrs r1, r0, 24
cmp r1, 0xD
bhi _0808BA10
- ldr r0, _0808BA14 @ =gUnknown_3005010
+ ldr r0, _0808BA14 @ =gPokemonStoragePtr
ldr r0, [r0]
strb r1, [r0]
_0808BA10:
pop {r0}
bx r0
.align 2, 0
-_0808BA14: .4byte gUnknown_3005010
+_0808BA14: .4byte gPokemonStoragePtr
thumb_func_end sub_808BA00
thumb_func_start GetBoxMonDataFromAnyBox
@@ -73,7 +73,7 @@ GetBoxMonDataFromAnyBox: @ 808BA18
bhi _0808BA54
cmp r4, 0x1D
bhi _0808BA54
- ldr r2, _0808BA50 @ =gUnknown_3005010
+ ldr r2, _0808BA50 @ =gPokemonStoragePtr
lsls r0, r3, 2
adds r0, r3
lsls r1, r0, 4
@@ -90,7 +90,7 @@ GetBoxMonDataFromAnyBox: @ 808BA18
bl GetBoxMonData
b _0808BA56
.align 2, 0
-_0808BA50: .4byte gUnknown_3005010
+_0808BA50: .4byte gPokemonStoragePtr
_0808BA54:
movs r0, 0
_0808BA56:
@@ -112,7 +112,7 @@ SetBoxMonDataFromAnyBox: @ 808BA5C
bhi _0808BA94
cmp r4, 0x1D
bhi _0808BA94
- ldr r2, _0808BA9C @ =gUnknown_3005010
+ ldr r2, _0808BA9C @ =gPokemonStoragePtr
lsls r0, r3, 2
adds r0, r3
lsls r1, r0, 4
@@ -127,13 +127,13 @@ SetBoxMonDataFromAnyBox: @ 808BA5C
adds r0, r1
adds r1, r5, 0
adds r2, r6, 0
- bl sub_80404D0
+ bl SetBoxMonData
_0808BA94:
pop {r4-r6}
pop {r0}
bx r0
.align 2, 0
-_0808BA9C: .4byte gUnknown_3005010
+_0808BA9C: .4byte gPokemonStoragePtr
thumb_func_end SetBoxMonDataFromAnyBox
thumb_func_start GetBoxMonDataFromSelectedBox
@@ -143,7 +143,7 @@ GetBoxMonDataFromSelectedBox: @ 808BAA0
adds r2, r1, 0
lsls r3, 24
lsrs r3, 24
- ldr r0, _0808BABC @ =gUnknown_3005010
+ ldr r0, _0808BABC @ =gPokemonStoragePtr
ldr r0, [r0]
ldrb r0, [r0]
adds r1, r3, 0
@@ -151,7 +151,7 @@ GetBoxMonDataFromSelectedBox: @ 808BAA0
pop {r1}
bx r1
.align 2, 0
-_0808BABC: .4byte gUnknown_3005010
+_0808BABC: .4byte gPokemonStoragePtr
thumb_func_end GetBoxMonDataFromSelectedBox
thumb_func_start SetBoxMonDataFromSelectedBox
@@ -162,7 +162,7 @@ SetBoxMonDataFromSelectedBox: @ 808BAC0
adds r3, r2, 0
lsls r4, 24
lsrs r4, 24
- ldr r0, _0808BAE0 @ =gUnknown_3005010
+ ldr r0, _0808BAE0 @ =gPokemonStoragePtr
ldr r0, [r0]
ldrb r0, [r0]
adds r1, r4, 0
@@ -172,7 +172,7 @@ SetBoxMonDataFromSelectedBox: @ 808BAC0
pop {r0}
bx r0
.align 2, 0
-_0808BAE0: .4byte gUnknown_3005010
+_0808BAE0: .4byte gPokemonStoragePtr
thumb_func_end SetBoxMonDataFromSelectedBox
thumb_func_start GetBoxMonNickFromAnyBox
@@ -187,7 +187,7 @@ GetBoxMonNickFromAnyBox: @ 808BAE4
bhi _0808BB20
cmp r4, 0x1D
bhi _0808BB20
- ldr r2, _0808BB1C @ =gUnknown_3005010
+ ldr r2, _0808BB1C @ =gPokemonStoragePtr
lsls r0, r3, 2
adds r0, r3
lsls r1, r0, 4
@@ -205,7 +205,7 @@ GetBoxMonNickFromAnyBox: @ 808BAE4
bl GetBoxMonData
b _0808BB24
.align 2, 0
-_0808BB1C: .4byte gUnknown_3005010
+_0808BB1C: .4byte gPokemonStoragePtr
_0808BB20:
movs r0, 0xFF
strb r0, [r5]
@@ -227,7 +227,7 @@ SetBoxMonNickFromAnyBox: @ 808BB2C
bhi _0808BB62
cmp r4, 0x1D
bhi _0808BB62
- ldr r2, _0808BB68 @ =gUnknown_3005010
+ ldr r2, _0808BB68 @ =gPokemonStoragePtr
lsls r0, r3, 2
adds r0, r3
lsls r1, r0, 4
@@ -242,13 +242,13 @@ SetBoxMonNickFromAnyBox: @ 808BB2C
adds r0, r1
movs r1, 0x2
adds r2, r5, 0
- bl sub_80404D0
+ bl SetBoxMonData
_0808BB62:
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
-_0808BB68: .4byte gUnknown_3005010
+_0808BB68: .4byte gPokemonStoragePtr
thumb_func_end SetBoxMonNickFromAnyBox
thumb_func_start GetAndCopyBoxMonDataFromAnyBox
@@ -264,7 +264,7 @@ GetAndCopyBoxMonDataFromAnyBox: @ 808BB6C
bhi _0808BBAC
cmp r4, 0x1D
bhi _0808BBAC
- ldr r2, _0808BBA8 @ =gUnknown_3005010
+ ldr r2, _0808BBA8 @ =gPokemonStoragePtr
lsls r0, r3, 2
adds r0, r3
lsls r1, r0, 4
@@ -282,7 +282,7 @@ GetAndCopyBoxMonDataFromAnyBox: @ 808BB6C
bl GetBoxMonData
b _0808BBAE
.align 2, 0
-_0808BBA8: .4byte gUnknown_3005010
+_0808BBA8: .4byte gPokemonStoragePtr
_0808BBAC:
movs r0, 0
_0808BBAE:
@@ -303,7 +303,7 @@ CopyBoxMonFromAnyBox: @ 808BBB4
bhi _0808BBEA
cmp r1, 0x1D
bhi _0808BBEA
- ldr r0, _0808BBF0 @ =gUnknown_3005010
+ ldr r0, _0808BBF0 @ =gPokemonStoragePtr
ldr r0, [r0]
lsls r3, r1, 2
adds r3, r1
@@ -324,7 +324,7 @@ _0808BBEA:
pop {r0}
bx r0
.align 2, 0
-_0808BBF0: .4byte gUnknown_3005010
+_0808BBF0: .4byte gPokemonStoragePtr
thumb_func_end CopyBoxMonFromAnyBox
thumb_func_start sub_808BBF4
@@ -339,7 +339,7 @@ sub_808BBF4: @ 808BBF4
bhi _0808BC2A
cmp r2, 0x1D
bhi _0808BC2A
- ldr r0, _0808BC30 @ =gUnknown_3005010
+ ldr r0, _0808BC30 @ =gPokemonStoragePtr
ldr r1, [r0]
lsls r3, r2, 2
adds r3, r2
@@ -360,7 +360,7 @@ _0808BC2A:
pop {r0}
bx r0
.align 2, 0
-_0808BC30: .4byte gUnknown_3005010
+_0808BC30: .4byte gPokemonStoragePtr
thumb_func_end sub_808BBF4
thumb_func_start sub_808BC34
@@ -395,7 +395,7 @@ sub_808BC34: @ 808BC34
bhi _0808BCA0
cmp r6, 0x1D
bhi _0808BCA0
- ldr r2, _0808BCB0 @ =gUnknown_3005010
+ ldr r2, _0808BCB0 @ =gPokemonStoragePtr
lsls r0, r7, 2
adds r0, r7
lsls r1, r0, 4
@@ -427,7 +427,7 @@ _0808BCA0:
pop {r0}
bx r0
.align 2, 0
-_0808BCB0: .4byte gUnknown_3005010
+_0808BCB0: .4byte gPokemonStoragePtr
thumb_func_end sub_808BC34
thumb_func_start sub_808BCB4
@@ -441,7 +441,7 @@ sub_808BCB4: @ 808BCB4
bhi _0808BCE4
cmp r4, 0x1D
bhi _0808BCE4
- ldr r2, _0808BCEC @ =gUnknown_3005010
+ ldr r2, _0808BCEC @ =gPokemonStoragePtr
lsls r0, r3, 2
adds r0, r3
lsls r1, r0, 4
@@ -460,7 +460,7 @@ _0808BCE4:
pop {r0}
bx r0
.align 2, 0
-_0808BCEC: .4byte gUnknown_3005010
+_0808BCEC: .4byte gPokemonStoragePtr
thumb_func_end sub_808BCB4
thumb_func_start sub_808BCF0
@@ -475,7 +475,7 @@ sub_808BCF0: @ 808BCF0
bhi _0808BD24
cmp r4, 0x1D
bhi _0808BD24
- ldr r2, _0808BD2C @ =gUnknown_3005010
+ ldr r2, _0808BD2C @ =gPokemonStoragePtr
lsls r0, r3, 2
adds r0, r3
lsls r1, r0, 4
@@ -495,7 +495,7 @@ _0808BD24:
pop {r0}
bx r0
.align 2, 0
-_0808BD2C: .4byte gUnknown_3005010
+_0808BD2C: .4byte gPokemonStoragePtr
thumb_func_end sub_808BCF0
thumb_func_start GetBoxedMonPtr
@@ -509,7 +509,7 @@ GetBoxedMonPtr: @ 808BD30
bhi _0808BD64
cmp r4, 0x1D
bhi _0808BD64
- ldr r2, _0808BD60 @ =gUnknown_3005010
+ ldr r2, _0808BD60 @ =gPokemonStoragePtr
lsls r0, r3, 2
adds r0, r3
lsls r1, r0, 4
@@ -524,7 +524,7 @@ GetBoxedMonPtr: @ 808BD30
adds r0, r1
b _0808BD66
.align 2, 0
-_0808BD60: .4byte gUnknown_3005010
+_0808BD60: .4byte gPokemonStoragePtr
_0808BD64:
movs r0, 0
_0808BD66:
@@ -543,7 +543,7 @@ GetBoxNamePtr: @ 808BD6C
movs r0, 0
b _0808BD88
_0808BD7A:
- ldr r0, _0808BD8C @ =gUnknown_3005010
+ ldr r0, _0808BD8C @ =gPokemonStoragePtr
lsls r1, r2, 3
adds r1, r2
ldr r2, _0808BD90 @ =0x00008344
@@ -554,7 +554,7 @@ _0808BD88:
pop {r1}
bx r1
.align 2, 0
-_0808BD8C: .4byte gUnknown_3005010
+_0808BD8C: .4byte gPokemonStoragePtr
_0808BD90: .4byte 0x00008344
thumb_func_end GetBoxNamePtr
@@ -568,7 +568,7 @@ sub_808BD94: @ 808BD94
movs r0, 0
b _0808BDAE
_0808BDA2:
- ldr r0, _0808BDB4 @ =gUnknown_3005010
+ ldr r0, _0808BDB4 @ =gPokemonStoragePtr
ldr r0, [r0]
ldr r2, _0808BDB8 @ =0x000083c2
adds r0, r2
@@ -578,7 +578,7 @@ _0808BDAE:
pop {r1}
bx r1
.align 2, 0
-_0808BDB4: .4byte gUnknown_3005010
+_0808BDB4: .4byte gPokemonStoragePtr
_0808BDB8: .4byte 0x000083c2
thumb_func_end sub_808BD94
@@ -593,7 +593,7 @@ sub_808BDBC: @ 808BDBC
bhi _0808BDDA
cmp r1, 0xF
bhi _0808BDDA
- ldr r0, _0808BDE0 @ =gUnknown_3005010
+ ldr r0, _0808BDE0 @ =gPokemonStoragePtr
ldr r0, [r0]
ldr r3, _0808BDE4 @ =0x000083c2
adds r0, r3
@@ -603,7 +603,7 @@ _0808BDDA:
pop {r0}
bx r0
.align 2, 0
-_0808BDE0: .4byte gUnknown_3005010
+_0808BDE0: .4byte gPokemonStoragePtr
_0808BDE4: .4byte 0x000083c2
thumb_func_end sub_808BDBC
@@ -6333,7 +6333,7 @@ _0808ECAC:
bne _0808ECD0
bl sub_808FF70
bl CalculatePlayerPartyCount
- ldr r1, _0808ECD8 @ =gUnknown_2024029
+ ldr r1, _0808ECD8 @ =gPlayerPartyCount
strb r0, [r1]
ldr r0, _0808ECDC @ =gUnknown_20397B0
ldr r0, [r0]
@@ -6345,7 +6345,7 @@ _0808ECD0:
pop {r0}
bx r0
.align 2, 0
-_0808ECD8: .4byte gUnknown_2024029
+_0808ECD8: .4byte gPlayerPartyCount
_0808ECDC: .4byte gUnknown_20397B0
_0808ECE0: .4byte sub_808EE18
thumb_func_end sub_808EBB0
@@ -6476,7 +6476,7 @@ _0808EDE0:
bne _0808EE04
bl sub_808FF70
bl CalculatePlayerPartyCount
- ldr r1, _0808EE0C @ =gUnknown_2024029
+ ldr r1, _0808EE0C @ =gPlayerPartyCount
strb r0, [r1]
ldr r0, _0808EE10 @ =gUnknown_20397B0
ldr r0, [r0]
@@ -6488,7 +6488,7 @@ _0808EE04:
pop {r0}
bx r0
.align 2, 0
-_0808EE0C: .4byte gUnknown_2024029
+_0808EE0C: .4byte gPlayerPartyCount
_0808EE10: .4byte gUnknown_20397B0
_0808EE14: .4byte sub_808EE18
thumb_func_end sub_808ECE4
@@ -6628,7 +6628,7 @@ sub_808EF0C: @ 808EF0C
adds r0, r1
movs r1, 0xC
mov r2, sp
- bl sub_804037C
+ bl SetMonData
b _0808EF56
.align 2, 0
_0808EF40: .4byte gUnknown_203AD30
@@ -16062,7 +16062,7 @@ sub_8093878: @ 8093878
adds r0, r1
movs r1, 0x8
mov r2, sp
- bl sub_804037C
+ bl SetMonData
b _080938EC
.align 2, 0
_080938A8: .4byte gUnknown_20397B0
@@ -16084,7 +16084,7 @@ _080938B8:
adds r0, r1
movs r1, 0x8
mov r2, sp
- bl sub_804037C
+ bl SetMonData
_080938D8:
movs r0, 0
ldrsb r0, [r4, r0]
@@ -16674,7 +16674,7 @@ _08093D90: .4byte 0x00000cf5
_08093D94:
ldr r2, _08093DD0 @ =0x00000cf5
adds r0, r1, r2
- ldr r1, _08093DD4 @ =gUnknown_8415A62
+ ldr r1, _08093DD4 @ =gText_EggNickname
movs r2, 0
movs r3, 0x8
bl StringCopyPadded
@@ -16702,7 +16702,7 @@ _08093DC6:
b _08093F84
.align 2, 0
_08093DD0: .4byte 0x00000cf5
-_08093DD4: .4byte gUnknown_8415A62
+_08093DD4: .4byte gText_EggNickname
_08093DD8: .4byte gUnknown_20397B0
_08093DDC: .4byte 0x00000d19
_08093DE0: .4byte 0x00000d3d
@@ -16739,7 +16739,7 @@ _08093DF4:
ldrh r1, [r0]
movs r0, 0xB
muls r1, r0
- ldr r0, _08093E8C @ =gUnknown_8245EE0
+ ldr r0, _08093E8C @ =gSpeciesNames
adds r1, r0
adds r0, r2, 0
movs r2, 0
@@ -16785,7 +16785,7 @@ _08093E7C: .4byte 0x00000cf5
_08093E80: .4byte 0x00000cea
_08093E84: .4byte 0x00000d19
_08093E88: .4byte 0x00000d1a
-_08093E8C: .4byte gUnknown_8245EE0
+_08093E8C: .4byte gSpeciesNames
_08093E90: .4byte 0x00000d3d
_08093E94: .4byte 0x00000d3e
_08093E98: .4byte 0x00000d3f
@@ -20886,7 +20886,7 @@ _08095DEC:
adds r0, r1
movs r1, 0xC
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r7, 0
movs r1, 0x1
bl sub_8090C84
@@ -21032,7 +21032,7 @@ _08095F10:
adds r2, r5
adds r0, r4, 0
movs r1, 0xC
- bl sub_804037C
+ bl SetMonData
mov r1, r8
ldr r0, [r1]
adds r0, r5
@@ -21118,7 +21118,7 @@ _08095FD4:
ldr r1, _08096004 @ =0x00002224
adds r2, r1
movs r1, 0xC
- bl sub_804037C
+ bl SetMonData
mov r0, r8
movs r1, 0
bl sub_8090C84
@@ -21183,7 +21183,7 @@ _08096064:
adds r0, r1
movs r1, 0xC
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r7, 0
movs r1, 0x1
bl sub_8090C84
diff --git a/asm/pokemon_summary_screen.s b/asm/pokemon_summary_screen.s
index ead0c8a01..03ede3f37 100644
--- a/asm/pokemon_summary_screen.s
+++ b/asm/pokemon_summary_screen.s
@@ -3490,7 +3490,7 @@ _08136240:
adds r0, r3
movs r1, 0xB
muls r1, r4
- ldr r2, _08136318 @ =gUnknown_8245EE0
+ ldr r2, _08136318 @ =gSpeciesNames
adds r1, r2
bl StringCompare
cmp r0, 0
@@ -3575,7 +3575,7 @@ _08136308: .4byte 0x00003084
_0813630C: .4byte gUnknown_84161CD
_08136310: .4byte gUnknown_203B140
_08136314: .4byte 0x00003034
-_08136318: .4byte gUnknown_8245EE0
+_08136318: .4byte gSpeciesNames
_0813631C: .4byte 0x00003290
_08136320: .4byte 0x0000ffff
_08136324: .4byte 0x0000306c
@@ -3973,7 +3973,7 @@ _08136630:
bl GetMonData
lsls r0, 16
lsrs r0, 16
- ldr r4, _08136790 @ =gUnknown_8253AE4
+ ldr r4, _08136790 @ =gExperienceTables
adds r2, r5, 0x1
lsls r2, 2
ldr r3, _08136794 @ =gBaseStats
@@ -4084,7 +4084,7 @@ _08136780: .4byte 0x00003290
_08136784: .4byte 0x0000309c
_08136788: .4byte gUnknown_203B144
_0813678C: .4byte 0x000031a4
-_08136790: .4byte gUnknown_8253AE4
+_08136790: .4byte gExperienceTables
_08136794: .4byte gBaseStats
_08136798: .4byte 0x000031b0
_0813679C: .4byte 0x000031bc
@@ -7631,7 +7631,7 @@ sub_813847C: @ 813847C
eors r0, r1
lsls r0, 24
lsrs r0, 24
- ldr r2, _081384C8 @ =gUnknown_202273C
+ ldr r2, _081384C8 @ =gLinkPlayers
lsls r1, r0, 3
subs r1, r0
lsls r1, 2
@@ -7649,7 +7649,7 @@ sub_813847C: @ 813847C
_081384BC: .4byte gUnknown_203B140
_081384C0: .4byte 0x000032f4
_081384C4: .4byte gEnemyParty
-_081384C8: .4byte gUnknown_202273C
+_081384C8: .4byte gLinkPlayers
_081384CC: .4byte 0x0000304c
_081384D0:
bl sub_80CC1E4
@@ -9242,29 +9242,29 @@ sub_81390B0: @ 81390B0
adds r1, 0xD
adds r0, r6, 0
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r0, r8
ldrb r1, [r0]
adds r1, 0xD
adds r0, r6, 0
ldr r2, [sp, 0x8]
- bl sub_804037C
+ bl SetMonData
ldr r3, _081391E0 @ =gUnknown_203B16D
ldrb r1, [r3]
adds r1, 0x11
adds r0, r6, 0
adds r2, r7, 0
- bl sub_804037C
+ bl SetMonData
mov r0, r8
ldrb r1, [r0]
adds r1, 0x11
adds r0, r6, 0
mov r2, r10
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
movs r1, 0x15
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
add sp, 0xC
pop {r3-r5}
mov r8, r3
@@ -9389,29 +9389,29 @@ sub_81391EC: @ 81391EC
adds r1, 0xD
adds r0, r6, 0
mov r2, sp
- bl sub_80404D0
+ bl SetBoxMonData
mov r0, r8
ldrb r1, [r0]
adds r1, 0xD
adds r0, r6, 0
ldr r2, [sp, 0x8]
- bl sub_80404D0
+ bl SetBoxMonData
ldr r3, _0813931C @ =gUnknown_203B16D
ldrb r1, [r3]
adds r1, 0x11
adds r0, r6, 0
adds r2, r7, 0
- bl sub_80404D0
+ bl SetBoxMonData
mov r0, r8
ldrb r1, [r0]
adds r1, 0x11
adds r0, r6, 0
mov r2, r10
- bl sub_80404D0
+ bl SetBoxMonData
adds r0, r6, 0
movs r1, 0x15
adds r2, r4, 0
- bl sub_80404D0
+ bl SetBoxMonData
add sp, 0xC
pop {r3-r5}
mov r8, r3
@@ -12270,7 +12270,7 @@ _0813A9B4:
bls _0813A9E2
b _0813AAE8
_0813A9E2:
- ldr r3, _0813AADC @ =gUnknown_8253AE4
+ ldr r3, _0813AADC @ =gExperienceTables
adds r1, r5, 0x1
lsls r1, 2
ldr r2, _0813AAE0 @ =gBaseStats
@@ -12395,7 +12395,7 @@ _0813AAB8:
.align 2, 0
_0813AAD4: .4byte gUnknown_203B140
_0813AAD8: .4byte 0x00003290
-_0813AADC: .4byte gUnknown_8253AE4
+_0813AADC: .4byte gExperienceTables
_0813AAE0: .4byte gBaseStats
_0813AAE4: .4byte gUnknown_203B160
_0813AAE8:
diff --git a/asm/post_battle_event_funcs.s b/asm/post_battle_event_funcs.s
index c3a732184..14703e26e 100644
--- a/asm/post_battle_event_funcs.s
+++ b/asm/post_battle_event_funcs.s
@@ -78,7 +78,7 @@ _080CA34A:
adds r0, r4, 0
movs r1, 0x43
mov r2, sp
- bl sub_804037C
+ bl SetMonData
movs r6, 0x1
_080CA388:
adds r5, 0x1
diff --git a/asm/quest_log.s b/asm/quest_log.s
index 9b7c29ccc..485e6377b 100644
--- a/asm/quest_log.s
+++ b/asm/quest_log.s
@@ -2194,9 +2194,9 @@ _08111980: .4byte gUnknown_3005E88
sub_8111984: @ 8111984
push {lr}
bl sub_806E6FC
- bl ResetSaveCounters
+ bl Save_ResetSaveCounters
movs r0, 0
- bl sub_80DA4FC
+ bl Save_LoadGameData
ldr r0, _081119B4 @ =sub_8057430
bl SetMainCallback2
ldr r1, _081119B8 @ =gUnknown_3005024
@@ -3591,7 +3591,7 @@ sub_811246C: @ 811246C
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _081124B0 @ =gUnknown_2036E38
+ ldr r1, _081124B0 @ =gMapObjects
adds r4, r0, r1
ldrb r0, [r4, 0x8]
cmp r0, 0xFF
@@ -3618,7 +3618,7 @@ _081124A6:
bl sub_8063E28
b _081124E0
.align 2, 0
-_081124B0: .4byte gUnknown_2036E38
+_081124B0: .4byte gMapObjects
_081124B4: .4byte gUnknown_203AF9A
_081124B8:
ldr r5, _081124E8 @ =gUnknown_203AF9A
@@ -7157,12 +7157,12 @@ sub_8113EAC: @ 8113EAC
bl GetSpeciesName
b _08113F08
_08113ED0:
- ldr r1, _08113EDC @ =gUnknown_8415A62
+ ldr r1, _08113EDC @ =gText_EggNickname
adds r0, r3, 0
bl StringCopy
b _08113F08
.align 2, 0
-_08113EDC: .4byte gUnknown_8415A62
+_08113EDC: .4byte gText_EggNickname
_08113EE0:
movs r0, 0xCE
lsls r0, 1
@@ -7171,15 +7171,15 @@ _08113EE0:
movs r0, 0xB
adds r1, r4, 0
muls r1, r0
- ldr r0, _08113EFC @ =gUnknown_8245EE0
+ ldr r0, _08113EFC @ =gSpeciesNames
adds r1, r0
adds r0, r2, 0
bl UnkTextUtil_SetPtrI
b _08113F08
.align 2, 0
-_08113EFC: .4byte gUnknown_8245EE0
+_08113EFC: .4byte gSpeciesNames
_08113F00:
- ldr r1, _08113F10 @ =gUnknown_8415A62
+ ldr r1, _08113F10 @ =gText_EggNickname
adds r0, r5, 0
bl UnkTextUtil_SetPtrI
_08113F08:
@@ -7187,7 +7187,7 @@ _08113F08:
pop {r0}
bx r0
.align 2, 0
-_08113F10: .4byte gUnknown_8415A62
+_08113F10: .4byte gText_EggNickname
thumb_func_end sub_8113EAC
thumb_func_start sub_8113F14
diff --git a/asm/quest_log_8150454.s b/asm/quest_log_8150454.s
index 1fe631d20..76dadd6e0 100644
--- a/asm/quest_log_8150454.s
+++ b/asm/quest_log_8150454.s
@@ -64,7 +64,7 @@ sub_81504A8: @ 81504A8
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _081504E4 @ =gUnknown_2036E38
+ ldr r0, _081504E4 @ =gMapObjects
adds r4, r0
movs r0, 0
bl sub_805C808
@@ -84,7 +84,7 @@ sub_81504A8: @ 81504A8
bx r0
.align 2, 0
_081504E0: .4byte gUnknown_2037078
-_081504E4: .4byte gUnknown_2036E38
+_081504E4: .4byte gMapObjects
thumb_func_end sub_81504A8
thumb_func_start sub_81504E8
@@ -95,7 +95,7 @@ sub_81504E8: @ 81504E8
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _0815052C @ =gUnknown_2036E38
+ ldr r0, _0815052C @ =gMapObjects
adds r4, r0
movs r0, 0x1
bl sub_805C808
@@ -118,7 +118,7 @@ sub_81504E8: @ 81504E8
bx r0
.align 2, 0
_08150528: .4byte gUnknown_2037078
-_0815052C: .4byte gUnknown_2036E38
+_0815052C: .4byte gMapObjects
thumb_func_end sub_81504E8
thumb_func_start sub_8150530
@@ -129,7 +129,7 @@ sub_8150530: @ 8150530
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08150580 @ =gUnknown_2036E38
+ ldr r1, _08150580 @ =gMapObjects
adds r4, r0, r1
ldrb r1, [r4, 0x4]
lsls r0, r1, 4
@@ -162,7 +162,7 @@ _08150558:
b _081505BC
.align 2, 0
_0815057C: .4byte gUnknown_2037078
-_08150580: .4byte gUnknown_2036E38
+_08150580: .4byte gMapObjects
_08150584: .4byte gSprites
_08150588: .4byte gUnknown_3005E88
_0815058C: .4byte sub_81505C4
@@ -205,7 +205,7 @@ sub_81505C4: @ 81505C4
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08150610 @ =gUnknown_2036E38
+ ldr r1, _08150610 @ =gMapObjects
adds r5, r0, r1
ldrb r1, [r5, 0x4]
lsls r0, r1, 4
@@ -230,7 +230,7 @@ sub_81505C4: @ 81505C4
b _081506FC
.align 2, 0
_0815060C: .4byte gUnknown_2037078
-_08150610: .4byte gUnknown_2036E38
+_08150610: .4byte gMapObjects
_08150614: .4byte gSprites
_08150618: .4byte gTasks
_0815061C:
@@ -353,7 +353,7 @@ sub_8150708: @ 8150708
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _08150774 @ =gUnknown_2036E38
+ ldr r1, _08150774 @ =gMapObjects
adds r4, r0, r1
ldrb r1, [r5]
movs r0, 0x8
@@ -395,7 +395,7 @@ _08150768:
bx r0
.align 2, 0
_08150770: .4byte gUnknown_2037078
-_08150774: .4byte gUnknown_2036E38
+_08150774: .4byte gMapObjects
_08150778: .4byte gUnknown_20386E0
thumb_func_end sub_8150708
diff --git a/asm/quest_log_battle.s b/asm/quest_log_battle.s
index 19703e014..1870395e9 100644
--- a/asm/quest_log_battle.s
+++ b/asm/quest_log_battle.s
@@ -99,7 +99,7 @@ _0812C06A:
lsls r1, 1
adds r0, r1
ldrb r0, [r0]
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _0812C0BC
@@ -121,7 +121,7 @@ _0812C0B8: .4byte gBattleMons
_0812C0BC:
ldr r5, _0812C0D8 @ =gBattleMons
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
movs r4, 0x58
@@ -137,7 +137,7 @@ _0812C0D8: .4byte gBattleMons
_0812C0DC:
movs r0, 0x2
_0812C0DE:
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
muls r0, r4
@@ -146,10 +146,10 @@ _0812C0EA:
ldrh r0, [r0]
strh r0, [r7, 0x4]
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r4, r0, 0
movs r0, 0x2
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r6, _0812C14C @ =gBattleMons
lsls r4, 24
lsrs r4, 24
@@ -168,10 +168,10 @@ _0812C0EA:
lsrs r0, 16
mov r8, r0
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r4, r0, 0
movs r0, 0x2
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r4, 24
lsrs r4, 24
adds r1, r4, 0
@@ -194,7 +194,7 @@ _0812C150:
ldrh r0, [r0, 0x20]
strh r0, [r7, 0x2]
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
ldr r5, _0812C1C8 @ =gBattleMons
lsls r0, 24
lsrs r0, 24
@@ -204,7 +204,7 @@ _0812C150:
ldrh r0, [r0]
strh r0, [r7, 0x4]
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
muls r0, r4
@@ -212,7 +212,7 @@ _0812C150:
ldrh r0, [r0, 0x28]
mov r8, r0
movs r0, 0
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
lsls r0, 24
lsrs r0, 24
muls r0, r4
@@ -432,7 +432,7 @@ _0812C330: .4byte gBattleStruct
sub_812C334: @ 812C334
push {r4-r6,lr}
adds r6, r0, 0
- ldr r3, _0812C35C @ =gUnknown_202273C
+ ldr r3, _0812C35C @ =gLinkPlayers
ldr r4, _0812C360 @ =gBattleStruct
ldr r0, [r4]
adds r0, 0xB5
@@ -452,7 +452,7 @@ _0812C352:
str r5, [r6]
b _0812C370
.align 2, 0
-_0812C35C: .4byte gUnknown_202273C
+_0812C35C: .4byte gLinkPlayers
_0812C360: .4byte gBattleStruct
_0812C364:
ldr r0, [r4]
diff --git a/asm/reset_save_heap.s b/asm/reset_save_heap.s
index ef96d8e6d..fb46afb94 100644
--- a/asm/reset_save_heap.s
+++ b/asm/reset_save_heap.s
@@ -28,10 +28,10 @@ sub_8079B7C: @ 8079B7C
strb r0, [r1]
bl SetSaveBlocksPointers
bl sub_8054A28
- bl ResetSaveCounters
+ bl Save_ResetSaveCounters
movs r0, 0
- bl sub_80DA4FC
- ldr r0, _08079BF8 @ =gUnknown_30053A0
+ bl Save_LoadGameData
+ ldr r0, _08079BF8 @ =gSaveFileStatus
ldrh r0, [r0]
cmp r0, 0
beq _08079BC4
@@ -59,7 +59,7 @@ _08079BC8:
_08079BEC: .4byte 0x04000208
_08079BF0: .4byte gMain
_08079BF4: .4byte 0x00000439
-_08079BF8: .4byte gUnknown_30053A0
+_08079BF8: .4byte gSaveFileStatus
_08079BFC: .4byte gSaveBlock2Ptr
_08079C00: .4byte gHeap
_08079C04: .4byte sub_8056938
diff --git a/asm/reshow_battle_screen.s b/asm/reshow_battle_screen.s
index 5538afcff..a30d8e833 100644
--- a/asm/reshow_battle_screen.s
+++ b/asm/reshow_battle_screen.s
@@ -276,7 +276,7 @@ _080779A8:
_080779B0:
bl LoadAndCreateEnemyShadowSprites
movs r0, 0x1
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
@@ -300,7 +300,7 @@ _080779B0:
cmp r0, 0
beq _08077A14
movs r0, 0x3
- bl GetBankByIdentity
+ bl GetBattlerAtPosition
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
@@ -318,7 +318,7 @@ _080779B0:
bl SetBankEnemyShadowSpriteCallback
_08077A14:
ldr r1, _08077A4C @ =gUnknown_2023FF8
- ldr r0, _08077A50 @ =gUnknown_2024004
+ ldr r0, _08077A50 @ =gBattlerInMenuId
ldrb r0, [r0]
adds r0, r1
ldrb r0, [r0]
@@ -341,7 +341,7 @@ _08077A14:
_08077A44: .4byte gBattlerPartyIndexes
_08077A48: .4byte gEnemyParty
_08077A4C: .4byte gUnknown_2023FF8
-_08077A50: .4byte gUnknown_2024004
+_08077A50: .4byte gBattlerInMenuId
_08077A54: .4byte gUnknown_3003F3C
_08077A58: .4byte gUnknown_3003F64
_08077A5C:
@@ -426,14 +426,14 @@ sub_8077B0C: @ 8077B0C
push {r4,lr}
lsls r0, 24
lsrs r4, r0, 24
- ldr r0, _08077B54 @ =gUnknown_2023BCC
+ ldr r0, _08077B54 @ =gBattlersCount
ldrb r0, [r0]
cmp r4, r0
bcc _08077B1C
b _08077C2C
_08077B1C:
adds r0, r4, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08077BA6
@@ -458,7 +458,7 @@ _08077B1C:
bl sub_8034658
b _08077C24
.align 2, 0
-_08077B54: .4byte gUnknown_2023BCC
+_08077B54: .4byte gBattlersCount
_08077B58: .4byte gBattleTypeFlags
_08077B5C: .4byte gBattlerPartyIndexes
_08077B60: .4byte gEnemyParty
@@ -576,7 +576,7 @@ sub_8077C38: @ 8077C38
push {r5-r7}
lsls r0, 24
lsrs r7, r0, 24
- ldr r0, _08077C6C @ =gUnknown_2023BCC
+ ldr r0, _08077C6C @ =gBattlersCount
ldrb r0, [r0]
cmp r7, r0
bcc _08077C50
@@ -595,7 +595,7 @@ _08077C50:
bl sub_8074900
b _08077C9A
.align 2, 0
-_08077C6C: .4byte gUnknown_2023BCC
+_08077C6C: .4byte gBattlersCount
_08077C70: .4byte gBattleTypeFlags
_08077C74:
ldr r0, _08077C90 @ =gUnknown_2024018
@@ -621,7 +621,7 @@ _08077C9A:
lsrs r0, 24
mov r8, r0
adds r0, r7, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
bne _08077CAE
@@ -656,13 +656,13 @@ _08077CD2:
lsls r4, 16
lsrs r4, 16
adds r0, r7, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
adds r0, r4, 0
bl sub_803F7D4
- ldr r5, _08077D98 @ =gUnknown_20244DC
+ ldr r5, _08077D98 @ =gMultiuseSpriteTemplate
adds r0, r7, 0
movs r1, 0x2
bl sub_8074480
@@ -726,7 +726,7 @@ _08077CD2:
adds r0, r1
lsls r0, 2
adds r0, r5
- ldr r1, _08077DA8 @ =gUnknown_2024024
+ ldr r1, _08077DA8 @ =gBattleMonForms
adds r1, r7, r1
ldrb r1, [r1]
bl StartSpriteAnim
@@ -734,11 +734,11 @@ _08077CD2:
.align 2, 0
_08077D90: .4byte gBattlerPartyIndexes
_08077D94: .4byte gEnemyParty
-_08077D98: .4byte gUnknown_20244DC
+_08077D98: .4byte gMultiuseSpriteTemplate
_08077D9C: .4byte gUnknown_2023D44
_08077DA0: .4byte gSprites
_08077DA4: .4byte SpriteCallbackDummy
-_08077DA8: .4byte gUnknown_2024024
+_08077DA8: .4byte gBattleMonForms
_08077DAC:
ldr r0, _08077E00 @ =gBattleTypeFlags
ldr r1, [r0]
@@ -752,13 +752,13 @@ _08077DAC:
ldr r0, [r5]
ldrb r4, [r0, 0x8]
movs r0, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
adds r0, r4, 0
- bl sub_803F864
- ldr r6, _08077E08 @ =gUnknown_20244DC
+ bl SetMultiuseSpriteTemplateToTrainerBack
+ ldr r6, _08077E08 @ =gMultiuseSpriteTemplate
ldr r1, _08077E0C @ =gUnknown_8239F8C
ldr r0, [r5]
ldrb r0, [r0, 0x8]
@@ -782,7 +782,7 @@ _08077DAC:
.align 2, 0
_08077E00: .4byte gBattleTypeFlags
_08077E04: .4byte gSaveBlock2Ptr
-_08077E08: .4byte gUnknown_20244DC
+_08077E08: .4byte gMultiuseSpriteTemplate
_08077E0C: .4byte gUnknown_8239F8C
_08077E10:
ldr r0, [r0]
@@ -794,13 +794,13 @@ _08077E10:
cmp r7, 0
bne _08077EA8
movs r0, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
movs r0, 0x5
- bl sub_803F864
- ldr r5, _08077E94 @ =gUnknown_20244DC
+ bl SetMultiuseSpriteTemplateToTrainerBack
+ ldr r5, _08077E94 @ =gMultiuseSpriteTemplate
ldr r0, _08077E98 @ =gUnknown_8239F8C
ldrb r0, [r0, 0x14]
movs r4, 0x8
@@ -849,7 +849,7 @@ _08077E54:
strh r7, [r0, 0x2E]
b _08077F84
.align 2, 0
-_08077E94: .4byte gUnknown_20244DC
+_08077E94: .4byte gMultiuseSpriteTemplate
_08077E98: .4byte gUnknown_8239F8C
_08077E9C: .4byte gUnknown_2023D44
_08077EA0: .4byte gSprites
@@ -882,13 +882,13 @@ _08077EA8:
lsls r4, 16
lsrs r4, 16
adds r0, r7, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
adds r0, r4, 0
bl sub_803F7D4
- ldr r5, _08077FCC @ =gUnknown_20244DC
+ ldr r5, _08077FCC @ =gMultiuseSpriteTemplate
adds r0, r7, 0
movs r1, 0x2
bl sub_8074480
@@ -952,7 +952,7 @@ _08077EA8:
adds r0, r1
lsls r0, 2
adds r0, r5
- ldr r1, _08077FDC @ =gUnknown_2024024
+ ldr r1, _08077FDC @ =gBattleMonForms
adds r1, r7, r1
ldrb r1, [r1]
bl StartSpriteAnim
@@ -992,11 +992,11 @@ _08077FB4:
.align 2, 0
_08077FC4: .4byte gBattlerPartyIndexes
_08077FC8: .4byte gPlayerParty
-_08077FCC: .4byte gUnknown_20244DC
+_08077FCC: .4byte gMultiuseSpriteTemplate
_08077FD0: .4byte gUnknown_2023D44
_08077FD4: .4byte gSprites
_08077FD8: .4byte SpriteCallbackDummy
-_08077FDC: .4byte gUnknown_2024024
+_08077FDC: .4byte gBattleMonForms
_08077FE0: .4byte gUnknown_2024018
thumb_func_end sub_8077C38
@@ -1005,7 +1005,7 @@ CreateHealthboxSprite: @ 8077FE4
push {r4-r6,lr}
lsls r0, 24
lsrs r5, r0, 24
- ldr r0, _0807800C @ =gUnknown_2023BCC
+ ldr r0, _0807800C @ =gBattlersCount
ldrb r0, [r0]
cmp r5, r0
bcc _08077FF4
@@ -1022,7 +1022,7 @@ _08077FF4:
bl CreateSafariPlayerHealthboxSprites
b _0807802C
.align 2, 0
-_0807800C: .4byte gUnknown_2023BCC
+_0807800C: .4byte gBattlersCount
_08078010: .4byte gBattleTypeFlags
_08078014:
ldr r0, [r0]
@@ -1048,7 +1048,7 @@ _0807802C:
adds r0, r6, 0
bl SetHealthboxSpriteVisible
adds r0, r5, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _08078074
@@ -1105,13 +1105,13 @@ _080780A8:
bl UpdateHealthboxAttribute
_080780C0:
adds r0, r5, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
beq _080780DC
adds r0, r5, 0
- bl GetBankIdentity
+ bl GetBattlerPosition
lsls r0, 24
lsrs r0, 24
cmp r0, 0x2
@@ -1135,7 +1135,7 @@ _080780F8:
bl nullsub_21
_08078104:
adds r0, r5, 0
- bl GetBankSide
+ bl GetBattlerSide
lsls r0, 24
cmp r0, 0
beq _0807813C
diff --git a/asm/roamer.s b/asm/roamer.s
index d44c91a55..d42b34293 100644
--- a/asm/roamer.s
+++ b/asm/roamer.s
@@ -364,43 +364,43 @@ CreateRoamerMonInstance: @ 8141EF8
adds r2, r0
adds r0, r5, 0
movs r1, 0x37
- bl sub_804037C
+ bl SetMonData
ldr r2, [r4]
ldr r1, _08141F94 @ =0x000030da
adds r2, r1
adds r0, r5, 0
movs r1, 0x39
- bl sub_804037C
+ bl SetMonData
ldr r2, [r4]
ldr r0, _08141F98 @ =0x000030de
adds r2, r0
adds r0, r5, 0
movs r1, 0x16
- bl sub_804037C
+ bl SetMonData
ldr r2, [r4]
ldr r1, _08141F9C @ =0x000030df
adds r2, r1
adds r0, r5, 0
movs r1, 0x17
- bl sub_804037C
+ bl SetMonData
ldr r2, [r4]
ldr r0, _08141FA0 @ =0x000030e0
adds r2, r0
adds r0, r5, 0
movs r1, 0x18
- bl sub_804037C
+ bl SetMonData
ldr r2, [r4]
ldr r1, _08141FA4 @ =0x000030e1
adds r2, r1
adds r0, r5, 0
movs r1, 0x21
- bl sub_804037C
+ bl SetMonData
ldr r2, [r4]
ldr r0, _08141FA8 @ =0x000030e2
adds r2, r0
adds r0, r5, 0
movs r1, 0x2F
- bl sub_804037C
+ bl SetMonData
add sp, 0x4
pop {r4,r5}
pop {r0}
diff --git a/asm/rom6.s b/asm/rom6.s
index a438b9276..76da35ac8 100644
--- a/asm/rom6.s
+++ b/asm/rom6.s
@@ -23,7 +23,7 @@ npc_before_player_of_type: @ 80C97A8
bl GetFieldObjectIdByXYZ
lsls r0, 24
lsrs r0, 24
- ldr r2, _080C97EC @ =gUnknown_2036E38
+ ldr r2, _080C97EC @ =gMapObjects
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
@@ -38,7 +38,7 @@ npc_before_player_of_type: @ 80C97A8
b _080C97F6
.align 2, 0
_080C97E8: .4byte gUnknown_2039A04
-_080C97EC: .4byte gUnknown_2036E38
+_080C97EC: .4byte gMapObjects
_080C97F0: .4byte gUnknown_20370D2
_080C97F4:
movs r0, 0
@@ -80,7 +80,7 @@ task08_080C9820: @ 80C9820
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _080C9878 @ =gUnknown_2036E38
+ ldr r1, _080C9878 @ =gMapObjects
adds r4, r0, r1
adds r0, r4, 0
bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive
@@ -108,7 +108,7 @@ _080C9856:
b _080C98A0
.align 2, 0
_080C9874: .4byte gUnknown_2037078
-_080C9878: .4byte gUnknown_2036E38
+_080C9878: .4byte gMapObjects
_080C987C: .4byte gMapHeader
_080C9880: .4byte gTasks
_080C9884: .4byte sub_80C98FC
@@ -144,7 +144,7 @@ sub_80C98B0: @ 80C98B0
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _080C98F0 @ =gUnknown_2036E38
+ ldr r1, _080C98F0 @ =gMapObjects
adds r0, r1
bl FieldObjectCheckIfSpecialAnimFinishedOrInactive
lsls r0, 24
@@ -166,7 +166,7 @@ _080C98E4:
bx r0
.align 2, 0
_080C98EC: .4byte gUnknown_2037078
-_080C98F0: .4byte gUnknown_2036E38
+_080C98F0: .4byte gMapObjects
_080C98F4: .4byte gTasks
_080C98F8: .4byte sub_80C98FC
thumb_func_end sub_80C98B0
@@ -212,7 +212,7 @@ _080C993C:
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _080C9990 @ =gUnknown_2036E38
+ ldr r0, _080C9990 @ =gMapObjects
adds r4, r0
bl GetPlayerAvatarGraphicsIdByCurrentState
adds r1, r0, 0
@@ -244,7 +244,7 @@ _080C9980:
.align 2, 0
_080C9988: .4byte gUnknown_20386E0
_080C998C: .4byte gUnknown_2037078
-_080C9990: .4byte gUnknown_2036E38
+_080C9990: .4byte gMapObjects
_080C9994: .4byte gSprites
_080C9998: .4byte gTasks
_080C999C: .4byte sub_80C99A0
diff --git a/asm/save.s b/asm/save.s
deleted file mode 100644
index 1d8d61769..000000000
--- a/asm/save.s
+++ /dev/null
@@ -1,2156 +0,0 @@
- .include "asm/macros.inc"
- .include "constants/constants.inc"
-
- .syntax unified
-
- .text
-
- thumb_func_start ClearSaveData
-ClearSaveData: @ 80D972C
- push {r4,r5,lr}
- movs r4, 0
- ldr r5, _080D974C @ =EraseFlashSector
-_080D9732:
- ldr r1, [r5]
- adds r0, r4, 0
- bl _call_via_r1
- adds r0, r4, 0x1
- lsls r0, 16
- lsrs r4, r0, 16
- cmp r4, 0x1F
- bls _080D9732
- pop {r4,r5}
- pop {r0}
- bx r0
- .align 2, 0
-_080D974C: .4byte EraseFlashSector
- thumb_func_end ClearSaveData
-
- thumb_func_start ResetSaveCounters
-ResetSaveCounters: @ 80D9750
- ldr r0, _080D9760 @ =gUnknown_3005390
- movs r1, 0
- str r1, [r0]
- ldr r0, _080D9764 @ =gUnknown_3005380
- strh r1, [r0]
- ldr r0, _080D9768 @ =gUnknown_300538C
- str r1, [r0]
- bx lr
- .align 2, 0
-_080D9760: .4byte gUnknown_3005390
-_080D9764: .4byte gUnknown_3005380
-_080D9768: .4byte gUnknown_300538C
- thumb_func_end ResetSaveCounters
-
- thumb_func_start SetDamagedSectorBits
-SetDamagedSectorBits: @ 80D976C
- push {r4,lr}
- lsls r0, 24
- lsrs r0, 24
- lsls r1, 24
- lsrs r3, r1, 24
- movs r4, 0
- cmp r0, 0x1
- beq _080D97A0
- cmp r0, 0x1
- bgt _080D9786
- cmp r0, 0
- beq _080D978C
- b _080D97C4
-_080D9786:
- cmp r0, 0x2
- beq _080D97B4
- b _080D97C4
-_080D978C:
- ldr r2, _080D979C @ =gUnknown_300538C
- movs r1, 0x1
- lsls r1, r3
- ldr r0, [r2]
- orrs r0, r1
- str r0, [r2]
- b _080D97C4
- .align 2, 0
-_080D979C: .4byte gUnknown_300538C
-_080D97A0:
- ldr r2, _080D97B0 @ =gUnknown_300538C
- adds r1, r0, 0
- lsls r1, r3
- ldr r0, [r2]
- bics r0, r1
- str r0, [r2]
- b _080D97C4
- .align 2, 0
-_080D97B0: .4byte gUnknown_300538C
-_080D97B4:
- ldr r0, _080D97CC @ =gUnknown_300538C
- movs r1, 0x1
- lsls r1, r3
- ldr r0, [r0]
- ands r0, r1
- cmp r0, 0
- beq _080D97C4
- movs r4, 0x1
-_080D97C4:
- adds r0, r4, 0
- pop {r4}
- pop {r1}
- bx r1
- .align 2, 0
-_080D97CC: .4byte gUnknown_300538C
- thumb_func_end SetDamagedSectorBits
-
- thumb_func_start save_write_to_flash
-save_write_to_flash: @ 80D97D0
- push {r4-r7,lr}
- adds r7, r1, 0
- lsls r0, 16
- lsrs r2, r0, 16
- ldr r1, _080D97F4 @ =gUnknown_3005394
- ldr r0, _080D97F8 @ =gUnknown_2039A38
- str r0, [r1]
- ldr r0, _080D97FC @ =0x0000ffff
- cmp r2, r0
- beq _080D9800
- adds r0, r2, 0
- adds r1, r7, 0
- bl HandleWriteSector
- lsls r0, 24
- lsrs r5, r0, 24
- b _080D9852
- .align 2, 0
-_080D97F4: .4byte gUnknown_3005394
-_080D97F8: .4byte gUnknown_2039A38
-_080D97FC: .4byte 0x0000ffff
-_080D9800:
- ldr r1, _080D985C @ =gUnknown_3005388
- ldr r5, _080D9860 @ =gUnknown_3005380
- ldrh r0, [r5]
- strh r0, [r1]
- ldr r1, _080D9864 @ =gUnknown_3005384
- ldr r6, _080D9868 @ =gUnknown_3005390
- ldr r4, [r6]
- str r4, [r1]
- adds r0, 0x1
- strh r0, [r5]
- ldrh r0, [r5]
- movs r1, 0xE
- bl __umodsi3
- strh r0, [r5]
- adds r4, 0x1
- str r4, [r6]
- movs r5, 0x1
- movs r4, 0
-_080D9826:
- adds r0, r4, 0
- adds r1, r7, 0
- bl HandleWriteSector
- adds r0, r4, 0x1
- lsls r0, 16
- lsrs r4, r0, 16
- cmp r4, 0xD
- bls _080D9826
- ldr r0, _080D986C @ =gUnknown_300538C
- ldr r0, [r0]
- cmp r0, 0
- beq _080D9852
- movs r5, 0xFF
- ldr r1, _080D9860 @ =gUnknown_3005380
- ldr r0, _080D985C @ =gUnknown_3005388
- ldrh r0, [r0]
- strh r0, [r1]
- ldr r1, _080D9868 @ =gUnknown_3005390
- ldr r0, _080D9864 @ =gUnknown_3005384
- ldr r0, [r0]
- str r0, [r1]
-_080D9852:
- adds r0, r5, 0
- pop {r4-r7}
- pop {r1}
- bx r1
- .align 2, 0
-_080D985C: .4byte gUnknown_3005388
-_080D9860: .4byte gUnknown_3005380
-_080D9864: .4byte gUnknown_3005384
-_080D9868: .4byte gUnknown_3005390
-_080D986C: .4byte gUnknown_300538C
- thumb_func_end save_write_to_flash
-
- thumb_func_start HandleWriteSector
-HandleWriteSector: @ 80D9870
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- adds r4, r1, 0
- lsls r0, 16
- lsrs r6, r0, 16
- ldr r0, _080D993C @ =gUnknown_3005380
- ldrh r0, [r0]
- adds r0, r6, r0
- lsls r0, 16
- lsrs r5, r0, 16
- adds r0, r5, 0
- movs r1, 0xE
- bl __umodsi3
- lsls r0, 16
- lsrs r5, r0, 16
- ldr r2, _080D9940 @ =gUnknown_3005390
- ldr r1, [r2]
- movs r0, 0x1
- ands r1, r0
- lsls r0, r1, 3
- subs r0, r1
- lsls r0, 1
- adds r0, r5, r0
- lsls r0, 16
- lsrs r5, r0, 16
- lsls r0, r6, 3
- adds r0, r4
- ldr r1, [r0]
- mov r10, r1
- ldrh r4, [r0, 0x4]
- movs r3, 0
- mov r9, r2
- ldr r2, _080D9944 @ =gUnknown_3005394
- mov r12, r2
- mov r8, r12
- movs r2, 0
- ldr r1, _080D9948 @ =0x00000fff
-_080D98C2:
- mov r7, r8
- ldr r0, [r7]
- adds r0, r3
- strb r2, [r0]
- adds r0, r3, 0x1
- lsls r0, 16
- lsrs r3, r0, 16
- cmp r3, r1
- bls _080D98C2
- mov r0, r12
- ldr r1, [r0]
- ldr r2, _080D994C @ =0x00000ff4
- adds r0, r1, r2
- strh r6, [r0]
- ldr r3, _080D9950 @ =0x00000ff8
- adds r2, r1, r3
- ldr r0, _080D9954 @ =0x08012025
- str r0, [r2]
- ldr r6, _080D9958 @ =0x00000ffc
- adds r1, r6
- mov r7, r9
- ldr r0, [r7]
- str r0, [r1]
- movs r3, 0
- lsls r5, 24
- cmp r3, r4
- bcs _080D9910
- mov r2, r12
-_080D98FA:
- ldr r1, [r2]
- adds r1, r3
- mov r6, r10
- adds r0, r6, r3
- ldrb r0, [r0]
- strb r0, [r1]
- adds r0, r3, 0x1
- lsls r0, 16
- lsrs r3, r0, 16
- cmp r3, r4
- bcc _080D98FA
-_080D9910:
- mov r0, r10
- adds r1, r4, 0
- bl CalculateChecksum
- ldr r1, _080D9944 @ =gUnknown_3005394
- ldr r1, [r1]
- ldr r7, _080D995C @ =0x00000ff6
- adds r2, r1, r7
- strh r0, [r2]
- lsrs r0, r5, 24
- bl TryWriteSector
- lsls r0, 24
- lsrs r0, 24
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r1}
- bx r1
- .align 2, 0
-_080D993C: .4byte gUnknown_3005380
-_080D9940: .4byte gUnknown_3005390
-_080D9944: .4byte gUnknown_3005394
-_080D9948: .4byte 0x00000fff
-_080D994C: .4byte 0x00000ff4
-_080D9950: .4byte 0x00000ff8
-_080D9954: .4byte 0x08012025
-_080D9958: .4byte 0x00000ffc
-_080D995C: .4byte 0x00000ff6
- thumb_func_end HandleWriteSector
-
- thumb_func_start HandleWriteSectorNBytes
-HandleWriteSectorNBytes: @ 80D9960
- push {r4-r7,lr}
- adds r5, r1, 0
- lsls r0, 24
- lsrs r7, r0, 24
- lsls r2, 16
- lsrs r2, 16
- ldr r4, _080D99C4 @ =gUnknown_2039A38
- movs r3, 0
- movs r6, 0
- ldr r1, _080D99C8 @ =0x00000fff
-_080D9974:
- adds r0, r4, r3
- strb r6, [r0]
- adds r0, r3, 0x1
- lsls r0, 16
- lsrs r3, r0, 16
- cmp r3, r1
- bls _080D9974
- ldr r0, _080D99CC @ =0x00000ff8
- adds r1, r4, r0
- ldr r0, _080D99D0 @ =0x08012025
- str r0, [r1]
- movs r3, 0
- cmp r3, r2
- bcs _080D99A2
-_080D9990:
- adds r1, r4, r3
- adds r0, r5, r3
- ldrb r0, [r0]
- strb r0, [r1]
- adds r0, r3, 0x1
- lsls r0, 16
- lsrs r3, r0, 16
- cmp r3, r2
- bcc _080D9990
-_080D99A2:
- adds r0, r5, 0
- adds r1, r2, 0
- bl CalculateChecksum
- ldr r2, _080D99D4 @ =0x00000ff4
- adds r1, r4, r2
- strh r0, [r1]
- adds r0, r7, 0
- adds r1, r4, 0
- bl TryWriteSector
- lsls r0, 24
- lsrs r0, 24
- pop {r4-r7}
- pop {r1}
- bx r1
- .align 2, 0
-_080D99C4: .4byte gUnknown_2039A38
-_080D99C8: .4byte 0x00000fff
-_080D99CC: .4byte 0x00000ff8
-_080D99D0: .4byte 0x08012025
-_080D99D4: .4byte 0x00000ff4
- thumb_func_end HandleWriteSectorNBytes
-
- thumb_func_start TryWriteSector
-TryWriteSector: @ 80D99D8
- push {r4,lr}
- lsls r0, 24
- lsrs r4, r0, 24
- adds r0, r4, 0
- bl ProgramFlashSectorAndVerify
- cmp r0, 0
- bne _080D99F4
- movs r0, 0x1
- adds r1, r4, 0
- bl SetDamagedSectorBits
- movs r0, 0x1
- b _080D99FE
-_080D99F4:
- movs r0, 0
- adds r1, r4, 0
- bl SetDamagedSectorBits
- movs r0, 0xFF
-_080D99FE:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end TryWriteSector
-
- thumb_func_start RestoreSaveBackupVarsAndIncrement
-RestoreSaveBackupVarsAndIncrement: @ 80D9A04
- push {r4-r6,lr}
- ldr r1, _080D9A40 @ =gUnknown_3005394
- ldr r0, _080D9A44 @ =gUnknown_2039A38
- str r0, [r1]
- ldr r1, _080D9A48 @ =gUnknown_3005388
- ldr r5, _080D9A4C @ =gUnknown_3005380
- ldrh r0, [r5]
- strh r0, [r1]
- ldr r1, _080D9A50 @ =gUnknown_3005384
- ldr r6, _080D9A54 @ =gUnknown_3005390
- ldr r4, [r6]
- str r4, [r1]
- adds r0, 0x1
- strh r0, [r5]
- ldrh r0, [r5]
- movs r1, 0xE
- bl __umodsi3
- strh r0, [r5]
- adds r4, 0x1
- str r4, [r6]
- ldr r1, _080D9A58 @ =gUnknown_3005398
- movs r0, 0
- strh r0, [r1]
- ldr r1, _080D9A5C @ =gUnknown_300538C
- movs r0, 0
- str r0, [r1]
- pop {r4-r6}
- pop {r1}
- bx r1
- .align 2, 0
-_080D9A40: .4byte gUnknown_3005394
-_080D9A44: .4byte gUnknown_2039A38
-_080D9A48: .4byte gUnknown_3005388
-_080D9A4C: .4byte gUnknown_3005380
-_080D9A50: .4byte gUnknown_3005384
-_080D9A54: .4byte gUnknown_3005390
-_080D9A58: .4byte gUnknown_3005398
-_080D9A5C: .4byte gUnknown_300538C
- thumb_func_end RestoreSaveBackupVarsAndIncrement
-
- thumb_func_start RestoreSaveBackupVars
-RestoreSaveBackupVars: @ 80D9A60
- ldr r1, _080D9A84 @ =gUnknown_3005394
- ldr r0, _080D9A88 @ =gUnknown_2039A38
- str r0, [r1]
- ldr r1, _080D9A8C @ =gUnknown_3005388
- ldr r0, _080D9A90 @ =gUnknown_3005380
- ldrh r0, [r0]
- strh r0, [r1]
- ldr r1, _080D9A94 @ =gUnknown_3005384
- ldr r0, _080D9A98 @ =gUnknown_3005390
- ldr r0, [r0]
- str r0, [r1]
- ldr r1, _080D9A9C @ =gUnknown_3005398
- movs r0, 0
- strh r0, [r1]
- ldr r1, _080D9AA0 @ =gUnknown_300538C
- movs r0, 0
- str r0, [r1]
- bx lr
- .align 2, 0
-_080D9A84: .4byte gUnknown_3005394
-_080D9A88: .4byte gUnknown_2039A38
-_080D9A8C: .4byte gUnknown_3005388
-_080D9A90: .4byte gUnknown_3005380
-_080D9A94: .4byte gUnknown_3005384
-_080D9A98: .4byte gUnknown_3005390
-_080D9A9C: .4byte gUnknown_3005398
-_080D9AA0: .4byte gUnknown_300538C
- thumb_func_end RestoreSaveBackupVars
-
- thumb_func_start sub_80D9AA4
-sub_80D9AA4: @ 80D9AA4
- push {r4,r5,lr}
- lsls r0, 16
- lsrs r0, 16
- ldr r4, _080D9AE0 @ =gUnknown_3005398
- ldrh r2, [r4]
- subs r0, 0x1
- cmp r2, r0
- bge _080D9AF8
- movs r5, 0x1
- adds r0, r2, 0
- bl HandleWriteSector
- ldrh r0, [r4]
- adds r0, 0x1
- strh r0, [r4]
- ldr r0, _080D9AE4 @ =gUnknown_300538C
- ldr r0, [r0]
- cmp r0, 0
- beq _080D9AFA
- movs r5, 0xFF
- ldr r1, _080D9AE8 @ =gUnknown_3005380
- ldr r0, _080D9AEC @ =gUnknown_3005388
- ldrh r0, [r0]
- strh r0, [r1]
- ldr r1, _080D9AF0 @ =gUnknown_3005390
- ldr r0, _080D9AF4 @ =gUnknown_3005384
- ldr r0, [r0]
- str r0, [r1]
- b _080D9AFA
- .align 2, 0
-_080D9AE0: .4byte gUnknown_3005398
-_080D9AE4: .4byte gUnknown_300538C
-_080D9AE8: .4byte gUnknown_3005380
-_080D9AEC: .4byte gUnknown_3005388
-_080D9AF0: .4byte gUnknown_3005390
-_080D9AF4: .4byte gUnknown_3005384
-_080D9AF8:
- movs r5, 0xFF
-_080D9AFA:
- adds r0, r5, 0
- pop {r4,r5}
- pop {r1}
- bx r1
- thumb_func_end sub_80D9AA4
-
- thumb_func_start sub_80D9B04
-sub_80D9B04: @ 80D9B04
- push {r4,lr}
- lsls r0, 16
- movs r4, 0x1
- ldr r2, _080D9B38 @ =0xffff0000
- adds r0, r2
- lsrs r0, 16
- bl ClearSaveData_2
- ldr r0, _080D9B3C @ =gUnknown_300538C
- ldr r0, [r0]
- cmp r0, 0
- beq _080D9B2E
- movs r4, 0xFF
- ldr r1, _080D9B40 @ =gUnknown_3005380
- ldr r0, _080D9B44 @ =gUnknown_3005388
- ldrh r0, [r0]
- strh r0, [r1]
- ldr r1, _080D9B48 @ =gUnknown_3005390
- ldr r0, _080D9B4C @ =gUnknown_3005384
- ldr r0, [r0]
- str r0, [r1]
-_080D9B2E:
- adds r0, r4, 0
- pop {r4}
- pop {r1}
- bx r1
- .align 2, 0
-_080D9B38: .4byte 0xffff0000
-_080D9B3C: .4byte gUnknown_300538C
-_080D9B40: .4byte gUnknown_3005380
-_080D9B44: .4byte gUnknown_3005388
-_080D9B48: .4byte gUnknown_3005390
-_080D9B4C: .4byte gUnknown_3005384
- thumb_func_end sub_80D9B04
-
- thumb_func_start ClearSaveData_2
-ClearSaveData_2: @ 80D9B50
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- adds r4, r1, 0
- lsls r0, 16
- lsrs r6, r0, 16
- ldr r0, _080D9C1C @ =gUnknown_3005380
- ldrh r0, [r0]
- adds r0, r6, r0
- lsls r0, 16
- lsrs r5, r0, 16
- adds r0, r5, 0
- movs r1, 0xE
- bl __umodsi3
- lsls r0, 16
- lsrs r5, r0, 16
- ldr r2, _080D9C20 @ =gUnknown_3005390
- ldr r1, [r2]
- movs r0, 0x1
- ands r1, r0
- lsls r0, r1, 3
- subs r0, r1
- lsls r0, 1
- adds r0, r5, r0
- lsls r0, 16
- lsrs r5, r0, 16
- lsls r0, r6, 3
- adds r0, r4
- ldr r1, [r0]
- mov r10, r1
- ldrh r3, [r0, 0x4]
- movs r4, 0
- mov r9, r2
- ldr r2, _080D9C24 @ =gUnknown_3005394
- mov r12, r2
- mov r8, r12
- movs r2, 0
- ldr r1, _080D9C28 @ =0x00000fff
-_080D9BA2:
- mov r7, r8
- ldr r0, [r7]
- adds r0, r4
- strb r2, [r0]
- adds r0, r4, 0x1
- lsls r0, 16
- lsrs r4, r0, 16
- cmp r4, r1
- bls _080D9BA2
- mov r0, r12
- ldr r1, [r0]
- ldr r2, _080D9C2C @ =0x00000ff4
- adds r0, r1, r2
- strh r6, [r0]
- ldr r6, _080D9C30 @ =0x00000ff8
- adds r2, r1, r6
- ldr r0, _080D9C34 @ =0x08012025
- str r0, [r2]
- ldr r7, _080D9C38 @ =0x00000ffc
- adds r1, r7
- mov r2, r9
- ldr r0, [r2]
- str r0, [r1]
- movs r4, 0
- lsls r6, r5, 24
- mov r8, r6
- cmp r4, r3
- bcs _080D9BF2
- mov r2, r12
-_080D9BDC:
- ldr r1, [r2]
- adds r1, r4
- mov r7, r10
- adds r0, r7, r4
- ldrb r0, [r0]
- strb r0, [r1]
- adds r0, r4, 0x1
- lsls r0, 16
- lsrs r4, r0, 16
- cmp r4, r3
- bcc _080D9BDC
-_080D9BF2:
- mov r0, r10
- adds r1, r3, 0
- bl CalculateChecksum
- ldr r1, _080D9C24 @ =gUnknown_3005394
- ldr r1, [r1]
- ldr r2, _080D9C3C @ =0x00000ff6
- adds r1, r2
- strh r0, [r1]
- ldr r0, _080D9C40 @ =EraseFlashSector
- ldr r1, [r0]
- adds r0, r5, 0
- bl _call_via_r1
- movs r6, 0x1
- movs r4, 0
- ldr r7, _080D9C44 @ =0x00000ff7
- mov r9, r7
- ldr r7, _080D9C48 @ =ProgramFlashByte
- b _080D9C52
- .align 2, 0
-_080D9C1C: .4byte gUnknown_3005380
-_080D9C20: .4byte gUnknown_3005390
-_080D9C24: .4byte gUnknown_3005394
-_080D9C28: .4byte 0x00000fff
-_080D9C2C: .4byte 0x00000ff4
-_080D9C30: .4byte 0x00000ff8
-_080D9C34: .4byte 0x08012025
-_080D9C38: .4byte 0x00000ffc
-_080D9C3C: .4byte 0x00000ff6
-_080D9C40: .4byte EraseFlashSector
-_080D9C44: .4byte 0x00000ff7
-_080D9C48: .4byte ProgramFlashByte
-_080D9C4C:
- adds r0, r4, 0x1
- lsls r0, 16
- lsrs r4, r0, 16
-_080D9C52:
- cmp r4, r9
- bhi _080D9C70
- ldr r0, _080D9C7C @ =gUnknown_3005394
- ldr r0, [r0]
- adds r0, r4
- ldrb r2, [r0]
- ldr r3, [r7]
- adds r0, r5, 0
- adds r1, r4, 0
- bl _call_via_r3
- lsls r0, 16
- cmp r0, 0
- beq _080D9C4C
- movs r6, 0xFF
-_080D9C70:
- cmp r6, 0xFF
- bne _080D9C80
- mov r0, r8
- lsrs r1, r0, 24
- b _080D9CD8
- .align 2, 0
-_080D9C7C: .4byte gUnknown_3005394
-_080D9C80:
- movs r6, 0x1
- movs r4, 0
- ldr r1, _080D9C8C @ =ProgramFlashByte
- mov r9, r1
- ldr r7, _080D9C90 @ =0x00000ff9
- b _080D9C9A
- .align 2, 0
-_080D9C8C: .4byte ProgramFlashByte
-_080D9C90: .4byte 0x00000ff9
-_080D9C94:
- adds r0, r4, 0x1
- lsls r0, 16
- lsrs r4, r0, 16
-_080D9C9A:
- cmp r4, 0x6
- bhi _080D9CBC
- adds r1, r4, r7
- ldr r0, _080D9CD0 @ =gUnknown_3005394
- ldr r0, [r0]
- adds r0, r4, r0
- adds r0, r7
- ldrb r2, [r0]
- mov r0, r9
- ldr r3, [r0]
- adds r0, r5, 0
- bl _call_via_r3
- lsls r0, 16
- cmp r0, 0
- beq _080D9C94
- movs r6, 0xFF
-_080D9CBC:
- cmp r6, 0xFF
- beq _080D9CD4
- mov r2, r8
- lsrs r1, r2, 24
- movs r0, 0x1
- bl SetDamagedSectorBits
- movs r0, 0x1
- b _080D9CE0
- .align 2, 0
-_080D9CD0: .4byte gUnknown_3005394
-_080D9CD4:
- mov r6, r8
- lsrs r1, r6, 24
-_080D9CD8:
- movs r0, 0
- bl SetDamagedSectorBits
- movs r0, 0xFF
-_080D9CE0:
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end ClearSaveData_2
-
- thumb_func_start sub_80D9CF0
-sub_80D9CF0: @ 80D9CF0
- push {r4-r6,lr}
- lsls r0, 16
- ldr r6, _080D9D4C @ =gUnknown_3005380
- lsrs r0, 16
- ldrh r1, [r6]
- adds r0, r1
- subs r0, 0x1
- lsls r0, 16
- lsrs r4, r0, 16
- adds r0, r4, 0
- movs r1, 0xE
- bl __umodsi3
- lsls r0, 16
- lsrs r4, r0, 16
- ldr r5, _080D9D50 @ =gUnknown_3005390
- ldr r1, [r5]
- movs r0, 0x1
- ands r1, r0
- lsls r0, r1, 3
- subs r0, r1
- lsls r0, 1
- adds r0, r4, r0
- lsls r0, 16
- lsrs r4, r0, 16
- ldr r3, _080D9D54 @ =ProgramFlashByte
- ldr r1, _080D9D58 @ =0x00000ff8
- ldr r0, _080D9D5C @ =gUnknown_3005394
- ldr r0, [r0]
- adds r0, r1
- ldrb r2, [r0]
- ldr r3, [r3]
- adds r0, r4, 0
- bl _call_via_r3
- lsls r0, 16
- cmp r0, 0
- bne _080D9D60
- lsls r1, r4, 24
- lsrs r1, 24
- movs r0, 0x1
- bl SetDamagedSectorBits
- movs r0, 0x1
- b _080D9D78
- .align 2, 0
-_080D9D4C: .4byte gUnknown_3005380
-_080D9D50: .4byte gUnknown_3005390
-_080D9D54: .4byte ProgramFlashByte
-_080D9D58: .4byte 0x00000ff8
-_080D9D5C: .4byte gUnknown_3005394
-_080D9D60:
- lsls r1, r4, 24
- lsrs r1, 24
- movs r0, 0
- bl SetDamagedSectorBits
- ldr r0, _080D9D80 @ =gUnknown_3005388
- ldrh r0, [r0]
- strh r0, [r6]
- ldr r0, _080D9D84 @ =gUnknown_3005384
- ldr r0, [r0]
- str r0, [r5]
- movs r0, 0xFF
-_080D9D78:
- pop {r4-r6}
- pop {r1}
- bx r1
- .align 2, 0
-_080D9D80: .4byte gUnknown_3005388
-_080D9D84: .4byte gUnknown_3005384
- thumb_func_end sub_80D9CF0
-
- thumb_func_start sub_80D9D88
-sub_80D9D88: @ 80D9D88
- push {r4-r6,lr}
- lsls r0, 16
- ldr r6, _080D9DDC @ =gUnknown_3005380
- lsrs r0, 16
- ldrh r1, [r6]
- adds r0, r1
- subs r0, 0x1
- lsls r0, 16
- lsrs r4, r0, 16
- adds r0, r4, 0
- movs r1, 0xE
- bl __umodsi3
- lsls r0, 16
- lsrs r4, r0, 16
- ldr r5, _080D9DE0 @ =gUnknown_3005390
- ldr r1, [r5]
- movs r0, 0x1
- ands r1, r0
- lsls r0, r1, 3
- subs r0, r1
- lsls r0, 1
- adds r0, r4, r0
- lsls r0, 16
- lsrs r4, r0, 16
- ldr r0, _080D9DE4 @ =ProgramFlashByte
- ldr r1, _080D9DE8 @ =0x00000ff8
- ldr r3, [r0]
- adds r0, r4, 0
- movs r2, 0x25
- bl _call_via_r3
- lsls r0, 16
- cmp r0, 0
- bne _080D9DEC
- lsls r1, r4, 24
- lsrs r1, 24
- movs r0, 0x1
- bl SetDamagedSectorBits
- movs r0, 0x1
- b _080D9E04
- .align 2, 0
-_080D9DDC: .4byte gUnknown_3005380
-_080D9DE0: .4byte gUnknown_3005390
-_080D9DE4: .4byte ProgramFlashByte
-_080D9DE8: .4byte 0x00000ff8
-_080D9DEC:
- lsls r1, r4, 24
- lsrs r1, 24
- movs r0, 0
- bl SetDamagedSectorBits
- ldr r0, _080D9E0C @ =gUnknown_3005388
- ldrh r0, [r0]
- strh r0, [r6]
- ldr r0, _080D9E10 @ =gUnknown_3005384
- ldr r0, [r0]
- str r0, [r5]
- movs r0, 0xFF
-_080D9E04:
- pop {r4-r6}
- pop {r1}
- bx r1
- .align 2, 0
-_080D9E0C: .4byte gUnknown_3005388
-_080D9E10: .4byte gUnknown_3005384
- thumb_func_end sub_80D9D88
-
- thumb_func_start sub_80D9E14
-sub_80D9E14: @ 80D9E14
- push {r4-r6,lr}
- adds r6, r1, 0
- lsls r0, 16
- lsrs r4, r0, 16
- ldr r1, _080D9E2C @ =gUnknown_3005394
- ldr r0, _080D9E30 @ =gUnknown_2039A38
- str r0, [r1]
- ldr r0, _080D9E34 @ =0x0000ffff
- cmp r4, r0
- beq _080D9E38
- movs r5, 0xFF
- b _080D9E4A
- .align 2, 0
-_080D9E2C: .4byte gUnknown_3005394
-_080D9E30: .4byte gUnknown_2039A38
-_080D9E34: .4byte 0x0000ffff
-_080D9E38:
- adds r0, r6, 0
- bl GetSaveValidStatus
- lsls r0, 24
- lsrs r5, r0, 24
- adds r0, r4, 0
- adds r1, r6, 0
- bl sub_80D9E54
-_080D9E4A:
- adds r0, r5, 0
- pop {r4-r6}
- pop {r1}
- bx r1
- thumb_func_end sub_80D9E14
-
- thumb_func_start sub_80D9E54
-sub_80D9E54: @ 80D9E54
- push {r4-r7,lr}
- mov r7, r8
- push {r7}
- mov r8, r1
- ldr r0, _080D9EF0 @ =gUnknown_3005390
- ldr r1, [r0]
- movs r0, 0x1
- ands r1, r0
- lsls r0, r1, 3
- subs r0, r1
- lsls r0, 17
- lsrs r7, r0, 16
- movs r5, 0
- ldr r6, _080D9EF4 @ =gUnknown_3005394
-_080D9E70:
- adds r0, r5, r7
- lsls r0, 24
- lsrs r0, 24
- ldr r1, [r6]
- bl DoReadFlashWholeSection
- ldr r0, [r6]
- ldr r1, _080D9EF8 @ =0x00000ff4
- adds r0, r1
- ldrh r1, [r0]
- cmp r1, 0
- bne _080D9E8C
- ldr r0, _080D9EFC @ =gUnknown_3005380
- strh r5, [r0]
-_080D9E8C:
- ldr r0, [r6]
- lsls r1, 3
- mov r2, r8
- adds r4, r1, r2
- ldrh r1, [r4, 0x4]
- bl CalculateChecksum
- lsls r0, 16
- lsrs r3, r0, 16
- ldr r2, [r6]
- ldr r1, _080D9F00 @ =0x00000ff8
- adds r0, r2, r1
- ldr r1, [r0]
- ldr r0, _080D9F04 @ =0x08012025
- adds r5, 0x1
- cmp r1, r0
- bne _080D9EDC
- ldr r1, _080D9F08 @ =0x00000ff6
- adds r0, r2, r1
- ldrh r0, [r0]
- cmp r0, r3
- bne _080D9EDC
- movs r2, 0
- ldrh r0, [r4, 0x4]
- cmp r2, r0
- bcs _080D9EDC
- adds r3, r4, 0
- ldr r4, _080D9EF4 @ =gUnknown_3005394
-_080D9EC4:
- ldr r1, [r3]
- adds r1, r2
- ldr r0, [r4]
- adds r0, r2
- ldrb r0, [r0]
- strb r0, [r1]
- adds r0, r2, 0x1
- lsls r0, 16
- lsrs r2, r0, 16
- ldrh r1, [r3, 0x4]
- cmp r2, r1
- bcc _080D9EC4
-_080D9EDC:
- lsls r0, r5, 16
- lsrs r5, r0, 16
- cmp r5, 0xD
- bls _080D9E70
- movs r0, 0x1
- pop {r3}
- mov r8, r3
- pop {r4-r7}
- pop {r1}
- bx r1
- .align 2, 0
-_080D9EF0: .4byte gUnknown_3005390
-_080D9EF4: .4byte gUnknown_3005394
-_080D9EF8: .4byte 0x00000ff4
-_080D9EFC: .4byte gUnknown_3005380
-_080D9F00: .4byte 0x00000ff8
-_080D9F04: .4byte 0x08012025
-_080D9F08: .4byte 0x00000ff6
- thumb_func_end sub_80D9E54
-
- thumb_func_start GetSaveValidStatus
-GetSaveValidStatus: @ 80D9F0C
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x4
- mov r10, r0
- movs r0, 0
- mov r8, r0
- mov r9, r0
- movs r6, 0
- movs r5, 0
- movs r4, 0
- ldr r7, _080D9F98 @ =gUnknown_3005394
-_080D9F28:
- lsls r0, r4, 24
- lsrs r0, 24
- ldr r1, [r7]
- bl DoReadFlashWholeSection
- ldr r2, [r7]
- ldr r1, _080D9F9C @ =0x00000ff8
- adds r0, r2, r1
- ldr r1, [r0]
- ldr r0, _080D9FA0 @ =0x08012025
- cmp r1, r0
- bne _080D9F78
- movs r5, 0x1
- ldr r3, _080D9FA4 @ =0x00000ff4
- adds r0, r2, r3
- ldrh r0, [r0]
- lsls r0, 3
- add r0, r10
- ldrh r1, [r0, 0x4]
- adds r0, r2, 0
- bl CalculateChecksum
- lsls r0, 16
- lsrs r2, r0, 16
- ldr r1, [r7]
- ldr r3, _080D9FA8 @ =0x00000ff6
- adds r0, r1, r3
- ldrh r0, [r0]
- cmp r0, r2
- bne _080D9F78
- ldr r2, _080D9FAC @ =0x00000ffc
- adds r0, r1, r2
- ldr r0, [r0]
- mov r8, r0
- subs r3, 0x2
- adds r1, r3
- adds r0, r5, 0
- ldrh r1, [r1]
- lsls r0, r1
- orrs r6, r0
-_080D9F78:
- adds r0, r4, 0x1
- lsls r0, 16
- lsrs r4, r0, 16
- cmp r4, 0xD
- bls _080D9F28
- cmp r5, 0
- beq _080D9FB4
- ldr r0, _080D9FB0 @ =0x00003fff
- movs r1, 0xFF
- str r1, [sp]
- cmp r6, r0
- bne _080D9FB8
- movs r2, 0x1
- str r2, [sp]
- b _080D9FB8
- .align 2, 0
-_080D9F98: .4byte gUnknown_3005394
-_080D9F9C: .4byte 0x00000ff8
-_080D9FA0: .4byte 0x08012025
-_080D9FA4: .4byte 0x00000ff4
-_080D9FA8: .4byte 0x00000ff6
-_080D9FAC: .4byte 0x00000ffc
-_080D9FB0: .4byte 0x00003fff
-_080D9FB4:
- movs r3, 0
- str r3, [sp]
-_080D9FB8:
- movs r6, 0
- movs r5, 0
- movs r4, 0
- ldr r7, _080DA030 @ =gUnknown_3005394
-_080D9FC0:
- adds r0, r4, 0
- adds r0, 0xE
- lsls r0, 24
- lsrs r0, 24
- ldr r1, [r7]
- bl DoReadFlashWholeSection
- ldr r2, [r7]
- ldr r1, _080DA034 @ =0x00000ff8
- adds r0, r2, r1
- ldr r1, [r0]
- ldr r0, _080DA038 @ =0x08012025
- cmp r1, r0
- bne _080DA014
- movs r5, 0x1
- ldr r3, _080DA03C @ =0x00000ff4
- adds r0, r2, r3
- ldrh r0, [r0]
- lsls r0, 3
- add r0, r10
- ldrh r1, [r0, 0x4]
- adds r0, r2, 0
- bl CalculateChecksum
- lsls r0, 16
- lsrs r2, r0, 16
- ldr r1, [r7]
- ldr r3, _080DA040 @ =0x00000ff6
- adds r0, r1, r3
- ldrh r0, [r0]
- cmp r0, r2
- bne _080DA014
- ldr r2, _080DA044 @ =0x00000ffc
- adds r0, r1, r2
- ldr r0, [r0]
- mov r9, r0
- subs r3, 0x2
- adds r1, r3
- adds r0, r5, 0
- ldrh r1, [r1]
- lsls r0, r1
- orrs r6, r0
-_080DA014:
- adds r0, r4, 0x1
- lsls r0, 16
- lsrs r4, r0, 16
- cmp r4, 0xD
- bls _080D9FC0
- cmp r5, 0
- beq _080DA04C
- ldr r0, _080DA048 @ =0x00003fff
- movs r1, 0xFF
- cmp r6, r0
- bne _080DA04E
- movs r1, 0x1
- b _080DA04E
- .align 2, 0
-_080DA030: .4byte gUnknown_3005394
-_080DA034: .4byte 0x00000ff8
-_080DA038: .4byte 0x08012025
-_080DA03C: .4byte 0x00000ff4
-_080DA040: .4byte 0x00000ff6
-_080DA044: .4byte 0x00000ffc
-_080DA048: .4byte 0x00003fff
-_080DA04C:
- movs r1, 0
-_080DA04E:
- ldr r0, [sp]
- cmp r0, 0x1
- bne _080DA0C0
- cmp r1, 0x1
- bne _080DA0B0
- movs r0, 0x1
- negs r0, r0
- cmp r8, r0
- bne _080DA066
- mov r1, r9
- cmp r1, 0
- beq _080DA070
-_080DA066:
- mov r2, r8
- cmp r2, 0
- bne _080DA094
- cmp r9, r0
- bne _080DA094
-_080DA070:
- mov r1, r8
- adds r1, 0x1
- mov r0, r9
- adds r0, 0x1
- cmp r1, r0
- bcs _080DA088
- ldr r0, _080DA084 @ =gUnknown_3005390
- mov r3, r9
- b _080DA0A8
- .align 2, 0
-_080DA084: .4byte gUnknown_3005390
-_080DA088:
- ldr r0, _080DA090 @ =gUnknown_3005390
- mov r1, r8
- str r1, [r0]
- b _080DA0D8
- .align 2, 0
-_080DA090: .4byte gUnknown_3005390
-_080DA094:
- cmp r8, r9
- bcs _080DA0A4
- ldr r0, _080DA0A0 @ =gUnknown_3005390
- mov r2, r9
- str r2, [r0]
- b _080DA0D8
- .align 2, 0
-_080DA0A0: .4byte gUnknown_3005390
-_080DA0A4:
- ldr r0, _080DA0AC @ =gUnknown_3005390
- mov r3, r8
-_080DA0A8:
- str r3, [r0]
- b _080DA0D8
- .align 2, 0
-_080DA0AC: .4byte gUnknown_3005390
-_080DA0B0:
- ldr r0, _080DA0BC @ =gUnknown_3005390
- mov r2, r8
- str r2, [r0]
- cmp r1, 0xFF
- beq _080DA0D0
- b _080DA0D8
- .align 2, 0
-_080DA0BC: .4byte gUnknown_3005390
-_080DA0C0:
- cmp r1, 0x1
- bne _080DA0DC
- ldr r0, _080DA0D4 @ =gUnknown_3005390
- mov r3, r9
- str r3, [r0]
- ldr r0, [sp]
- cmp r0, 0xFF
- bne _080DA0D8
-_080DA0D0:
- movs r0, 0xFF
- b _080DA108
- .align 2, 0
-_080DA0D4: .4byte gUnknown_3005390
-_080DA0D8:
- movs r0, 0x1
- b _080DA108
-_080DA0DC:
- ldr r2, [sp]
- cmp r2, 0
- bne _080DA0FC
- cmp r1, 0
- bne _080DA0FC
- ldr r0, _080DA0F4 @ =gUnknown_3005390
- str r1, [r0]
- ldr r0, _080DA0F8 @ =gUnknown_3005380
- strh r1, [r0]
- movs r0, 0
- b _080DA108
- .align 2, 0
-_080DA0F4: .4byte gUnknown_3005390
-_080DA0F8: .4byte gUnknown_3005380
-_080DA0FC:
- ldr r0, _080DA118 @ =gUnknown_3005390
- movs r1, 0
- str r1, [r0]
- ldr r0, _080DA11C @ =gUnknown_3005380
- strh r1, [r0]
- movs r0, 0x2
-_080DA108:
- add sp, 0x4
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r1}
- bx r1
- .align 2, 0
-_080DA118: .4byte gUnknown_3005390
-_080DA11C: .4byte gUnknown_3005380
- thumb_func_end GetSaveValidStatus
-
- thumb_func_start sub_80DA120
-sub_80DA120: @ 80DA120
- push {r4-r6,lr}
- adds r6, r1, 0
- lsls r0, 24
- lsrs r0, 24
- lsls r2, 16
- lsrs r4, r2, 16
- ldr r5, _080DA174 @ =gUnknown_2039A38
- adds r1, r5, 0
- bl DoReadFlashWholeSection
- ldr r1, _080DA178 @ =0x00000ff8
- adds r0, r5, r1
- ldr r1, [r0]
- ldr r0, _080DA17C @ =0x08012025
- cmp r1, r0
- bne _080DA188
- adds r0, r5, 0
- adds r1, r4, 0
- bl CalculateChecksum
- lsls r0, 16
- lsrs r0, 16
- ldr r2, _080DA180 @ =0x00000ff4
- adds r1, r5, r2
- ldrh r1, [r1]
- cmp r1, r0
- bne _080DA184
- movs r2, 0
- cmp r2, r4
- bcs _080DA16E
-_080DA15C:
- adds r1, r6, r2
- adds r0, r5, r2
- ldrb r0, [r0]
- strb r0, [r1]
- adds r0, r2, 0x1
- lsls r0, 16
- lsrs r2, r0, 16
- cmp r2, r4
- bcc _080DA15C
-_080DA16E:
- movs r0, 0x1
- b _080DA18A
- .align 2, 0
-_080DA174: .4byte gUnknown_2039A38
-_080DA178: .4byte 0x00000ff8
-_080DA17C: .4byte 0x08012025
-_080DA180: .4byte 0x00000ff4
-_080DA184:
- movs r0, 0x2
- b _080DA18A
-_080DA188:
- movs r0, 0
-_080DA18A:
- pop {r4-r6}
- pop {r1}
- bx r1
- thumb_func_end sub_80DA120
-
- thumb_func_start DoReadFlashWholeSection
-DoReadFlashWholeSection: @ 80DA190
- push {lr}
- adds r2, r1, 0
- lsls r0, 24
- lsrs r0, 24
- movs r3, 0x80
- lsls r3, 5
- movs r1, 0
- bl ReadFlash
- movs r0, 0x1
- pop {r1}
- bx r1
- thumb_func_end DoReadFlashWholeSection
-
- thumb_func_start CalculateChecksum
-CalculateChecksum: @ 80DA1A8
- push {r4,lr}
- adds r4, r0, 0
- lsls r1, 16
- movs r2, 0
- movs r3, 0
- lsrs r1, 18
- cmp r2, r1
- bcs _080DA1C6
-_080DA1B8:
- ldm r4!, {r0}
- adds r2, r0
- adds r0, r3, 0x1
- lsls r0, 16
- lsrs r3, r0, 16
- cmp r3, r1
- bcc _080DA1B8
-_080DA1C6:
- lsrs r0, r2, 16
- adds r0, r2
- lsls r0, 16
- lsrs r0, 16
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end CalculateChecksum
-
- thumb_func_start UpdateSaveAddresses
-UpdateSaveAddresses: @ 80DA1D4
- push {r4,r5,lr}
- ldr r3, _080DA234 @ =gUnknown_30053B0
- ldr r0, _080DA238 @ =gSaveBlock2Ptr
- ldr r2, _080DA23C @ =gUnknown_83FEC94
- ldrh r1, [r2]
- ldr r0, [r0]
- adds r0, r1
- str r0, [r3]
- ldrh r0, [r2, 0x2]
- strh r0, [r3, 0x4]
- ldr r5, _080DA240 @ =gSaveBlock1Ptr
- adds r3, 0x8
- adds r2, 0x4
- movs r4, 0x3
-_080DA1F0:
- ldrh r0, [r2]
- ldr r1, [r5]
- adds r1, r0
- str r1, [r3]
- ldrh r0, [r2, 0x2]
- strh r0, [r3, 0x4]
- adds r3, 0x8
- adds r2, 0x4
- subs r4, 0x1
- cmp r4, 0
- bge _080DA1F0
- movs r4, 0x5
- ldr r1, _080DA234 @ =gUnknown_30053B0
- ldr r5, _080DA244 @ =gUnknown_3005010
- ldr r0, _080DA23C @ =gUnknown_83FEC94
- adds r3, r1, 0
- adds r3, 0x28
- adds r2, r0, 0
- adds r2, 0x14
-_080DA216:
- ldrh r0, [r2]
- ldr r1, [r5]
- adds r1, r0
- str r1, [r3]
- ldrh r0, [r2, 0x2]
- strh r0, [r3, 0x4]
- adds r3, 0x8
- adds r2, 0x4
- adds r4, 0x1
- cmp r4, 0xD
- ble _080DA216
- pop {r4,r5}
- pop {r0}
- bx r0
- .align 2, 0
-_080DA234: .4byte gUnknown_30053B0
-_080DA238: .4byte gSaveBlock2Ptr
-_080DA23C: .4byte gUnknown_83FEC94
-_080DA240: .4byte gSaveBlock1Ptr
-_080DA244: .4byte gUnknown_3005010
- thumb_func_end UpdateSaveAddresses
-
- thumb_func_start sub_80DA248
-sub_80DA248: @ 80DA248
- push {r4-r6,lr}
- lsls r0, 24
- lsrs r4, r0, 24
- ldr r1, _080DA268 @ =gMain
- ldr r6, [r1, 0x20]
- movs r0, 0
- str r0, [r1, 0x20]
- bl UpdateSaveAddresses
- cmp r4, 0x5
- bhi _080DA2CC
- lsls r0, r4, 2
- ldr r1, _080DA26C @ =_080DA270
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .align 2, 0
-_080DA268: .4byte gMain
-_080DA26C: .4byte _080DA270
- .align 2, 0
-_080DA270:
- .4byte _080DA2CC
- .4byte _080DA2F0
- .4byte _080DA310
- .4byte _080DA29E
- .4byte _080DA324
- .4byte _080DA288
-_080DA288:
- movs r4, 0x1C
- ldr r5, _080DA2DC @ =EraseFlashSector
-_080DA28C:
- ldr r1, [r5]
- adds r0, r4, 0
- bl _call_via_r1
- adds r0, r4, 0x1
- lsls r0, 24
- lsrs r4, r0, 24
- cmp r4, 0x1F
- bls _080DA28C
-_080DA29E:
- movs r0, 0xA
- bl GetGameStat
- ldr r1, _080DA2E0 @ =0x000003e6
- cmp r0, r1
- bhi _080DA2B0
- movs r0, 0xA
- bl IncrementGameStat
-_080DA2B0:
- ldr r4, _080DA2E4 @ =gUnknown_201C000
- movs r5, 0xF8
- lsls r5, 4
- movs r0, 0x1C
- adds r1, r4, 0
- adds r2, r5, 0
- bl HandleWriteSectorNBytes
- adds r4, r5
- movs r0, 0x1D
- adds r1, r4, 0
- adds r2, r5, 0
- bl HandleWriteSectorNBytes
-_080DA2CC:
- bl SaveSerializedGame
- ldr r0, _080DA2E8 @ =0x0000ffff
- ldr r1, _080DA2EC @ =gUnknown_30053B0
- bl save_write_to_flash
- b _080DA346
- .align 2, 0
-_080DA2DC: .4byte EraseFlashSector
-_080DA2E0: .4byte 0x000003e6
-_080DA2E4: .4byte gUnknown_201C000
-_080DA2E8: .4byte 0x0000ffff
-_080DA2EC: .4byte gUnknown_30053B0
-_080DA2F0:
- bl SaveSerializedGame
- movs r4, 0
-_080DA2F6:
- adds r0, r4, 0
- ldr r1, _080DA30C @ =gUnknown_30053B0
- bl save_write_to_flash
- adds r0, r4, 0x1
- lsls r0, 24
- lsrs r4, r0, 24
- cmp r4, 0x4
- bls _080DA2F6
- b _080DA346
- .align 2, 0
-_080DA30C: .4byte gUnknown_30053B0
-_080DA310:
- bl SaveSerializedGame
- ldr r1, _080DA320 @ =gUnknown_30053B0
- movs r0, 0
- bl save_write_to_flash
- b _080DA346
- .align 2, 0
-_080DA320: .4byte gUnknown_30053B0
-_080DA324:
- movs r4, 0x1C
- ldr r5, _080DA354 @ =EraseFlashSector
-_080DA328:
- ldr r1, [r5]
- adds r0, r4, 0
- bl _call_via_r1
- adds r0, r4, 0x1
- lsls r0, 24
- lsrs r4, r0, 24
- cmp r4, 0x1F
- bls _080DA328
- bl SaveSerializedGame
- ldr r0, _080DA358 @ =0x0000ffff
- ldr r1, _080DA35C @ =gUnknown_30053B0
- bl save_write_to_flash
-_080DA346:
- ldr r0, _080DA360 @ =gMain
- str r6, [r0, 0x20]
- movs r0, 0
- pop {r4-r6}
- pop {r1}
- bx r1
- .align 2, 0
-_080DA354: .4byte EraseFlashSector
-_080DA358: .4byte 0x0000ffff
-_080DA35C: .4byte gUnknown_30053B0
-_080DA360: .4byte gMain
- thumb_func_end sub_80DA248
-
- thumb_func_start TrySavingData
-TrySavingData: @ 80DA364
- push {r4,r5,lr}
- lsls r0, 24
- lsrs r5, r0, 24
- ldr r0, _080DA390 @ =gUnknown_3005004
- ldr r4, [r0]
- cmp r4, 0x1
- bne _080DA386
- adds r0, r5, 0
- bl sub_80DA248
- ldr r0, _080DA394 @ =gUnknown_300538C
- ldr r0, [r0]
- cmp r0, 0
- beq _080DA39C
- adds r0, r5, 0
- bl sub_80F5100
-_080DA386:
- ldr r1, _080DA398 @ =gUnknown_3005420
- movs r0, 0xFF
- strh r0, [r1]
- movs r0, 0xFF
- b _080DA3A2
- .align 2, 0
-_080DA390: .4byte gUnknown_3005004
-_080DA394: .4byte gUnknown_300538C
-_080DA398: .4byte gUnknown_3005420
-_080DA39C:
- ldr r0, _080DA3A8 @ =gUnknown_3005420
- strh r4, [r0]
- movs r0, 0x1
-_080DA3A2:
- pop {r4,r5}
- pop {r1}
- bx r1
- .align 2, 0
-_080DA3A8: .4byte gUnknown_3005420
- thumb_func_end TrySavingData
-
- thumb_func_start sub_80DA3AC
-sub_80DA3AC: @ 80DA3AC
- push {lr}
- ldr r0, _080DA3C8 @ =gUnknown_3005004
- ldr r0, [r0]
- cmp r0, 0x1
- bne _080DA3D0
- bl UpdateSaveAddresses
- bl SaveSerializedGame
- ldr r0, _080DA3CC @ =gUnknown_30053B0
- bl RestoreSaveBackupVarsAndIncrement
- movs r0, 0
- b _080DA3D2
- .align 2, 0
-_080DA3C8: .4byte gUnknown_3005004
-_080DA3CC: .4byte gUnknown_30053B0
-_080DA3D0:
- movs r0, 0x1
-_080DA3D2:
- pop {r1}
- bx r1
- thumb_func_end sub_80DA3AC
-
- thumb_func_start sub_80DA3D8
-sub_80DA3D8: @ 80DA3D8
- push {r4,lr}
- ldr r1, _080DA3FC @ =gUnknown_30053B0
- movs r0, 0xE
- bl sub_80D9AA4
- lsls r0, 24
- lsrs r4, r0, 24
- ldr r0, _080DA400 @ =gUnknown_300538C
- ldr r0, [r0]
- cmp r0, 0
- beq _080DA3F4
- movs r0, 0
- bl sub_80F5100
-_080DA3F4:
- cmp r4, 0xFF
- beq _080DA404
- movs r0, 0
- b _080DA406
- .align 2, 0
-_080DA3FC: .4byte gUnknown_30053B0
-_080DA400: .4byte gUnknown_300538C
-_080DA404:
- movs r0, 0x1
-_080DA406:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end sub_80DA3D8
-
- thumb_func_start sub_80DA40C
-sub_80DA40C: @ 80DA40C
- push {lr}
- ldr r1, _080DA42C @ =gUnknown_30053B0
- movs r0, 0xE
- bl sub_80D9B04
- ldr r0, _080DA430 @ =gUnknown_300538C
- ldr r0, [r0]
- cmp r0, 0
- beq _080DA424
- movs r0, 0
- bl sub_80F5100
-_080DA424:
- movs r0, 0
- pop {r1}
- bx r1
- .align 2, 0
-_080DA42C: .4byte gUnknown_30053B0
-_080DA430: .4byte gUnknown_300538C
- thumb_func_end sub_80DA40C
-
- thumb_func_start sub_80DA434
-sub_80DA434: @ 80DA434
- push {lr}
- ldr r1, _080DA454 @ =gUnknown_30053B0
- movs r0, 0xE
- bl sub_80D9CF0
- ldr r0, _080DA458 @ =gUnknown_300538C
- ldr r0, [r0]
- cmp r0, 0
- beq _080DA44C
- movs r0, 0
- bl sub_80F5100
-_080DA44C:
- movs r0, 0
- pop {r1}
- bx r1
- .align 2, 0
-_080DA454: .4byte gUnknown_30053B0
-_080DA458: .4byte gUnknown_300538C
- thumb_func_end sub_80DA434
-
- thumb_func_start sub_80DA45C
-sub_80DA45C: @ 80DA45C
- push {r4,lr}
- ldr r0, _080DA48C @ =gUnknown_3005004
- ldr r0, [r0]
- cmp r0, 0x1
- bne _080DA498
- bl UpdateSaveAddresses
- bl SaveSerializedGame
- ldr r4, _080DA490 @ =gUnknown_30053B0
- adds r0, r4, 0
- bl RestoreSaveBackupVars
- ldr r0, _080DA494 @ =gUnknown_3005398
- ldrh r0, [r0]
- adds r0, 0x1
- lsls r0, 16
- lsrs r0, 16
- adds r1, r4, 0
- bl sub_80D9B04
- movs r0, 0
- b _080DA49A
- .align 2, 0
-_080DA48C: .4byte gUnknown_3005004
-_080DA490: .4byte gUnknown_30053B0
-_080DA494: .4byte gUnknown_3005398
-_080DA498:
- movs r0, 0x1
-_080DA49A:
- pop {r4}
- pop {r1}
- bx r1
- thumb_func_end sub_80DA45C
-
- thumb_func_start sub_80DA4A0
-sub_80DA4A0: @ 80DA4A0
- push {r4-r6,lr}
- movs r6, 0
- ldr r0, _080DA4CC @ =gUnknown_3005398
- ldrh r1, [r0]
- adds r1, 0x1
- strh r1, [r0]
- lsls r0, r1, 16
- lsrs r5, r0, 16
- cmp r5, 0x4
- bhi _080DA4D4
- adds r0, r1, 0x1
- lsls r0, 16
- lsrs r0, 16
- ldr r4, _080DA4D0 @ =gUnknown_30053B0
- adds r1, r4, 0
- bl sub_80D9B04
- adds r0, r5, 0
- adds r1, r4, 0
- bl sub_80D9D88
- b _080DA4DE
- .align 2, 0
-_080DA4CC: .4byte gUnknown_3005398
-_080DA4D0: .4byte gUnknown_30053B0
-_080DA4D4:
- ldr r1, _080DA4F4 @ =gUnknown_30053B0
- adds r0, r5, 0
- bl sub_80D9D88
- movs r6, 0x1
-_080DA4DE:
- ldr r0, _080DA4F8 @ =gUnknown_300538C
- ldr r0, [r0]
- cmp r0, 0
- beq _080DA4EC
- movs r0, 0x1
- bl sub_80F5100
-_080DA4EC:
- adds r0, r6, 0
- pop {r4-r6}
- pop {r1}
- bx r1
- .align 2, 0
-_080DA4F4: .4byte gUnknown_30053B0
-_080DA4F8: .4byte gUnknown_300538C
- thumb_func_end sub_80DA4A0
-
- thumb_func_start sub_80DA4FC
-sub_80DA4FC: @ 80DA4FC
- push {r4-r6,lr}
- lsls r0, 24
- lsrs r4, r0, 24
- ldr r0, _080DA514 @ =gUnknown_3005004
- ldr r0, [r0]
- cmp r0, 0x1
- beq _080DA51C
- ldr r1, _080DA518 @ =gUnknown_30053A0
- movs r0, 0x4
- strh r0, [r1]
- movs r0, 0xFF
- b _080DA57C
- .align 2, 0
-_080DA514: .4byte gUnknown_3005004
-_080DA518: .4byte gUnknown_30053A0
-_080DA51C:
- bl UpdateSaveAddresses
- cmp r4, 0
- beq _080DA528
- cmp r4, 0x3
- beq _080DA554
-_080DA528:
- ldr r0, _080DA544 @ =0x0000ffff
- ldr r1, _080DA548 @ =gUnknown_30053B0
- bl sub_80D9E14
- lsls r0, 24
- lsrs r4, r0, 24
- bl LoadSerializedGame
- ldr r0, _080DA54C @ =gUnknown_30053A0
- strh r4, [r0]
- ldr r1, _080DA550 @ =gUnknown_30053A4
- movs r0, 0
- str r0, [r1]
- b _080DA57A
- .align 2, 0
-_080DA544: .4byte 0x0000ffff
-_080DA548: .4byte gUnknown_30053B0
-_080DA54C: .4byte gUnknown_30053A0
-_080DA550: .4byte gUnknown_30053A4
-_080DA554:
- ldr r5, _080DA584 @ =gUnknown_201C000
- movs r6, 0xF8
- lsls r6, 4
- movs r0, 0x1C
- adds r1, r5, 0
- adds r2, r6, 0
- bl sub_80DA120
- lsls r0, 24
- lsrs r4, r0, 24
- cmp r4, 0x1
- bne _080DA57A
- adds r1, r5, r6
- movs r0, 0x1D
- adds r2, r6, 0
- bl sub_80DA120
- lsls r0, 24
- lsrs r4, r0, 24
-_080DA57A:
- adds r0, r4, 0
-_080DA57C:
- pop {r4-r6}
- pop {r1}
- bx r1
- .align 2, 0
-_080DA584: .4byte gUnknown_201C000
- thumb_func_end sub_80DA4FC
-
- thumb_func_start TryCopySpecialSaveSection
-TryCopySpecialSaveSection: @ 80DA588
- push {r4-r6,lr}
- adds r6, r1, 0
- lsls r0, 24
- lsrs r1, r0, 24
- movs r2, 0xE2
- lsls r2, 24
- adds r0, r2
- lsrs r0, 24
- cmp r0, 0x1
- bhi _080DA5B4
- ldr r4, _080DA5B8 @ =gUnknown_2039A38
- movs r3, 0x80
- lsls r3, 5
- adds r0, r1, 0
- movs r1, 0
- adds r2, r4, 0
- bl ReadFlash
- ldr r1, [r4]
- ldr r0, _080DA5BC @ =0x0000b39d
- cmp r1, r0
- beq _080DA5C0
-_080DA5B4:
- movs r0, 0xFF
- b _080DA5D6
- .align 2, 0
-_080DA5B8: .4byte gUnknown_2039A38
-_080DA5BC: .4byte 0x0000b39d
-_080DA5C0:
- movs r3, 0
- ldr r5, _080DA5DC @ =0x00000ffb
- adds r2, r4, 0x4
-_080DA5C6:
- adds r0, r6, r3
- adds r1, r2, r3
- ldrb r1, [r1]
- strb r1, [r0]
- adds r3, 0x1
- cmp r3, r5
- ble _080DA5C6
- movs r0, 0x1
-_080DA5D6:
- pop {r4-r6}
- pop {r1}
- bx r1
- .align 2, 0
-_080DA5DC: .4byte 0x00000ffb
- thumb_func_end TryCopySpecialSaveSection
-
- thumb_func_start sub_80DA5E0
-sub_80DA5E0: @ 80DA5E0
- push {r4-r7,lr}
- adds r5, r1, 0
- lsls r0, 24
- lsrs r6, r0, 24
- movs r1, 0xE2
- lsls r1, 24
- adds r0, r1
- lsrs r0, 24
- cmp r0, 0x1
- bhi _080DA62C
- ldr r7, _080DA620 @ =gUnknown_2039A38
- ldr r0, _080DA624 @ =0x0000b39d
- adds r3, r7, 0
- stm r3!, {r0}
- movs r2, 0
- ldr r4, _080DA628 @ =0x00000ffb
-_080DA600:
- adds r0, r3, r2
- adds r1, r5, r2
- ldrb r1, [r1]
- strb r1, [r0]
- adds r2, 0x1
- cmp r2, r4
- ble _080DA600
- adds r0, r6, 0
- adds r1, r7, 0
- bl ProgramFlashSectorAndVerify
- cmp r0, 0
- bne _080DA62C
- movs r0, 0x1
- b _080DA62E
- .align 2, 0
-_080DA620: .4byte gUnknown_2039A38
-_080DA624: .4byte 0x0000b39d
-_080DA628: .4byte 0x00000ffb
-_080DA62C:
- movs r0, 0xFF
-_080DA62E:
- pop {r4-r7}
- pop {r1}
- bx r1
- thumb_func_end sub_80DA5E0
-
- thumb_func_start sub_80DA634
-sub_80DA634: @ 80DA634
- push {r4,lr}
- lsls r0, 24
- lsrs r4, r0, 24
- ldr r1, _080DA65C @ =gTasks
- lsls r0, r4, 2
- adds r0, r4
- lsls r0, 3
- adds r0, r1
- movs r2, 0x8
- ldrsh r0, [r0, r2]
- adds r2, r1, 0
- cmp r0, 0xB
- bls _080DA650
- b _080DA7F6
-_080DA650:
- lsls r0, 2
- ldr r1, _080DA660 @ =_080DA664
- adds r0, r1
- ldr r0, [r0]
- mov pc, r0
- .align 2, 0
-_080DA65C: .4byte gTasks
-_080DA660: .4byte _080DA664
- .align 2, 0
-_080DA664:
- .4byte _080DA694
- .4byte _080DA6AC
- .4byte _080DA6C4
- .4byte _080DA6E8
- .4byte _080DA6F2
- .4byte _080DA712
- .4byte _080DA744
- .4byte _080DA75C
- .4byte _080DA778
- .4byte _080DA79C
- .4byte _080DA7B4
- .4byte _080DA7D4
-_080DA694:
- ldr r1, _080DA6A8 @ =gSoftResetDisabled
- movs r0, 0x1
- strb r0, [r1]
- lsls r0, r4, 2
- adds r0, r4
- lsls r0, 3
- adds r0, r2
- movs r1, 0x1
- strh r1, [r0, 0x8]
- b _080DA7F6
- .align 2, 0
-_080DA6A8: .4byte gSoftResetDisabled
-_080DA6AC:
- bl sub_800AB9C
- ldr r0, _080DA6C0 @ =gTasks
- lsls r1, r4, 2
- adds r1, r4
- lsls r1, 3
- adds r1, r0
- movs r0, 0x2
- strh r0, [r1, 0x8]
- b _080DA7F6
- .align 2, 0
-_080DA6C0: .4byte gTasks
-_080DA6C4:
- bl sub_800A4BC
- lsls r0, 24
- cmp r0, 0
- bne _080DA6D0
- b _080DA7F6
-_080DA6D0:
- bl sub_80590D8
- ldr r0, _080DA6E4 @ =gTasks
- lsls r1, r4, 2
- adds r1, r4
- lsls r1, 3
- adds r1, r0
- movs r0, 0x3
- strh r0, [r1, 0x8]
- b _080DA7F6
- .align 2, 0
-_080DA6E4: .4byte gTasks
-_080DA6E8:
- bl sub_804C1C0
- bl sub_80DA3AC
- b _080DA730
-_080DA6F2:
- lsls r0, r4, 2
- adds r0, r4
- lsls r0, 3
- adds r1, r0, r2
- ldrh r0, [r1, 0xA]
- adds r0, 0x1
- strh r0, [r1, 0xA]
- lsls r0, 16
- asrs r2, r0, 16
- cmp r2, 0x5
- beq _080DA70A
- b _080DA7F6
-_080DA70A:
- movs r0, 0
- strh r0, [r1, 0xA]
- strh r2, [r1, 0x8]
- b _080DA7F6
-_080DA712:
- bl sub_80DA3D8
- lsls r0, 24
- cmp r0, 0
- beq _080DA730
- ldr r0, _080DA72C @ =gTasks
- lsls r1, r4, 2
- adds r1, r4
- lsls r1, 3
- adds r1, r0
- movs r0, 0x6
- strh r0, [r1, 0x8]
- b _080DA7F6
- .align 2, 0
-_080DA72C: .4byte gTasks
-_080DA730:
- ldr r0, _080DA740 @ =gTasks
- lsls r1, r4, 2
- adds r1, r4
- lsls r1, 3
- adds r1, r0
- movs r0, 0x4
- strh r0, [r1, 0x8]
- b _080DA7F6
- .align 2, 0
-_080DA740: .4byte gTasks
-_080DA744:
- bl sub_80DA40C
- ldr r0, _080DA758 @ =gTasks
- lsls r1, r4, 2
- adds r1, r4
- lsls r1, 3
- adds r1, r0
- movs r0, 0x7
- strh r0, [r1, 0x8]
- b _080DA7F6
- .align 2, 0
-_080DA758: .4byte gTasks
-_080DA75C:
- bl sav2_gender2_inplace_and_xFE
- bl sub_800AB9C
- ldr r0, _080DA774 @ =gTasks
- lsls r1, r4, 2
- adds r1, r4
- lsls r1, 3
- adds r1, r0
- movs r0, 0x8
- strh r0, [r1, 0x8]
- b _080DA7F6
- .align 2, 0
-_080DA774: .4byte gTasks
-_080DA778:
- bl sub_800A4BC
- lsls r0, 24
- cmp r0, 0
- beq _080DA7F6
- bl sub_80DA434
- ldr r0, _080DA798 @ =gTasks
- lsls r1, r4, 2
- adds r1, r4
- lsls r1, 3
- adds r1, r0
- movs r0, 0x9
- strh r0, [r1, 0x8]
- b _080DA7F6
- .align 2, 0
-_080DA798: .4byte gTasks
-_080DA79C:
- bl sub_800AB9C
- ldr r0, _080DA7B0 @ =gTasks
- lsls r1, r4, 2
- adds r1, r4
- lsls r1, 3
- adds r1, r0
- movs r0, 0xA
- strh r0, [r1, 0x8]
- b _080DA7F6
- .align 2, 0
-_080DA7B0: .4byte gTasks
-_080DA7B4:
- bl sub_800A4BC
- lsls r0, 24
- cmp r0, 0
- beq _080DA7F6
- ldr r0, _080DA7D0 @ =gTasks
- lsls r1, r4, 2
- adds r1, r4
- lsls r1, 3
- adds r1, r0
- ldrh r0, [r1, 0x8]
- adds r0, 0x1
- strh r0, [r1, 0x8]
- b _080DA7F6
- .align 2, 0
-_080DA7D0: .4byte gTasks
-_080DA7D4:
- lsls r1, r4, 2
- adds r1, r4
- lsls r1, 3
- adds r1, r2
- ldrh r0, [r1, 0xA]
- adds r0, 0x1
- strh r0, [r1, 0xA]
- lsls r0, 16
- asrs r0, 16
- cmp r0, 0x5
- ble _080DA7F6
- ldr r1, _080DA7FC @ =gSoftResetDisabled
- movs r0, 0
- strb r0, [r1]
- adds r0, r4, 0
- bl DestroyTask
-_080DA7F6:
- pop {r4}
- pop {r0}
- bx r0
- .align 2, 0
-_080DA7FC: .4byte gSoftResetDisabled
- thumb_func_end sub_80DA634
-
- .align 2, 0 @ Don't pad with nop.
diff --git a/asm/save_failed_screen.s b/asm/save_failed_screen.s
index ade020812..cbb07e4c7 100644
--- a/asm/save_failed_screen.s
+++ b/asm/save_failed_screen.s
@@ -15,8 +15,8 @@ sub_80F50F4: @ 80F50F4
_080F50FC: .4byte gUnknown_3005430
thumb_func_end sub_80F50F4
- thumb_func_start sub_80F5100
-sub_80F5100: @ 80F5100
+ thumb_func_start DoSaveFailedScreen
+DoSaveFailedScreen: @ 80F5100
lsls r0, 24
lsrs r0, 24
ldr r1, _080F5110 @ =gUnknown_203AB4C
@@ -28,7 +28,7 @@ sub_80F5100: @ 80F5100
.align 2, 0
_080F5110: .4byte gUnknown_203AB4C
_080F5114: .4byte gUnknown_3005430
- thumb_func_end sub_80F5100
+ thumb_func_end DoSaveFailedScreen
thumb_func_start sub_80F5118
sub_80F5118: @ 80F5118
@@ -435,7 +435,7 @@ _080F5454: .4byte 0x01001180
sub_80F5458: @ 80F5458
push {r4,r5,lr}
movs r5, 0
- ldr r0, _080F5490 @ =gUnknown_300538C
+ ldr r0, _080F5490 @ =gDamagedSaveSectors
ldr r1, [r0]
adds r4, r0, 0
cmp r1, 0
@@ -447,12 +447,12 @@ _080F5466:
bne _080F5498
ldr r0, _080F5494 @ =gUnknown_203AB4C
ldrb r0, [r0]
- bl sub_80DA248
+ bl HandleSavingData
adds r5, 0x1
ldr r0, [r4]
cmp r0, 0
beq _080F548C
- ldr r4, _080F5490 @ =gUnknown_300538C
+ ldr r4, _080F5490 @ =gDamagedSaveSectors
cmp r5, 0x2
ble _080F5466
ldr r0, [r4]
@@ -462,7 +462,7 @@ _080F548C:
movs r0, 0x1
b _080F549A
.align 2, 0
-_080F5490: .4byte gUnknown_300538C
+_080F5490: .4byte gDamagedSaveSectors
_080F5494: .4byte gUnknown_203AB4C
_080F5498:
movs r0, 0
@@ -477,7 +477,7 @@ VerifySectorWipe: @ 80F54A0
push {r4,lr}
lsls r0, 16
lsrs r0, 16
- ldr r4, _080F54C4 @ =gUnknown_2039A38
+ ldr r4, _080F54C4 @ =gSaveDataBuffer
movs r3, 0x80
lsls r3, 5
movs r1, 0
@@ -492,7 +492,7 @@ _080F54B8:
movs r0, 0x1
b _080F54DA
.align 2, 0
-_080F54C4: .4byte gUnknown_2039A38
+_080F54C4: .4byte gSaveDataBuffer
_080F54C8: .4byte 0x000003ff
_080F54CC:
adds r0, r1, 0x1
diff --git a/asm/scrcmd.s b/asm/scrcmd.s
index ec78da1d5..0bff9395c 100644
--- a/asm/scrcmd.s
+++ b/asm/scrcmd.s
@@ -3065,7 +3065,7 @@ ScrCmd_resetobjectpriority: @ 806B58C
thumb_func_start ScrCmd_faceplayer
ScrCmd_faceplayer: @ 806B5BC
push {r4,lr}
- ldr r2, _0806B5EC @ =gUnknown_2036E38
+ ldr r2, _0806B5EC @ =gMapObjects
ldr r0, _0806B5F0 @ =gUnknown_3005074
ldrb r1, [r0]
lsls r0, r1, 3
@@ -3088,7 +3088,7 @@ _0806B5E4:
pop {r1}
bx r1
.align 2, 0
-_0806B5EC: .4byte gUnknown_2036E38
+_0806B5EC: .4byte gMapObjects
_0806B5F0: .4byte gUnknown_3005074
thumb_func_end ScrCmd_faceplayer
@@ -3245,7 +3245,7 @@ ScrCmd_lock: @ 806B704
movs r0, 0
b _0806B752
_0806B714:
- ldr r2, _0806B738 @ =gUnknown_2036E38
+ ldr r2, _0806B738 @ =gMapObjects
ldr r0, _0806B73C @ =gUnknown_3005074
ldrb r1, [r0]
lsls r0, r1, 3
@@ -3262,7 +3262,7 @@ _0806B714:
bl SetupNativeScript
b _0806B750
.align 2, 0
-_0806B738: .4byte gUnknown_2036E38
+_0806B738: .4byte gMapObjects
_0806B73C: .4byte gUnknown_3005074
_0806B740: .4byte sub_8069648
_0806B744:
@@ -3294,7 +3294,7 @@ ScrCmd_releaseall: @ 806B75C
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0806B790 @ =gUnknown_2036E38
+ ldr r1, _0806B790 @ =gMapObjects
adds r0, r1
bl FieldObjectClearAnimIfSpecialAnimFinished
bl sub_80974D8
@@ -3303,14 +3303,14 @@ ScrCmd_releaseall: @ 806B75C
pop {r1}
bx r1
.align 2, 0
-_0806B790: .4byte gUnknown_2036E38
+_0806B790: .4byte gMapObjects
thumb_func_end ScrCmd_releaseall
thumb_func_start ScrCmd_release
ScrCmd_release: @ 806B794
push {r4,lr}
bl HideFieldMessageBox
- ldr r4, _0806B7E4 @ =gUnknown_2036E38
+ ldr r4, _0806B7E4 @ =gMapObjects
ldr r0, _0806B7E8 @ =gUnknown_3005074
ldrb r1, [r0]
lsls r0, r1, 3
@@ -3343,7 +3343,7 @@ _0806B7B6:
pop {r1}
bx r1
.align 2, 0
-_0806B7E4: .4byte gUnknown_2036E38
+_0806B7E4: .4byte gMapObjects
_0806B7E8: .4byte gUnknown_3005074
thumb_func_end ScrCmd_release
@@ -4022,7 +4022,7 @@ ScrCmd_bufferspeciesname: @ 806BC88
ldr r2, [r4]
movs r1, 0xB
muls r1, r0
- ldr r0, _0806BCC4 @ =gUnknown_8245EE0
+ ldr r0, _0806BCC4 @ =gSpeciesNames
adds r1, r0
adds r0, r2, 0
bl StringCopy
@@ -4032,7 +4032,7 @@ ScrCmd_bufferspeciesname: @ 806BC88
bx r1
.align 2, 0
_0806BCC0: .4byte gUnknown_83A7294
-_0806BCC4: .4byte gUnknown_8245EE0
+_0806BCC4: .4byte gSpeciesNames
thumb_func_end ScrCmd_bufferspeciesname
thumb_func_start ScrCmd_bufferleadmonspeciesname
@@ -4058,7 +4058,7 @@ ScrCmd_bufferleadmonspeciesname: @ 806BCC8
bl GetMonData
movs r1, 0xB
muls r1, r0
- ldr r0, _0806BD10 @ =gUnknown_8245EE0
+ ldr r0, _0806BD10 @ =gSpeciesNames
adds r1, r0
adds r0, r4, 0
bl StringCopy
@@ -4069,7 +4069,7 @@ ScrCmd_bufferleadmonspeciesname: @ 806BCC8
.align 2, 0
_0806BD08: .4byte gUnknown_83A7294
_0806BD0C: .4byte gPlayerParty
-_0806BD10: .4byte gUnknown_8245EE0
+_0806BD10: .4byte gSpeciesNames
thumb_func_end ScrCmd_bufferleadmonspeciesname
thumb_func_start ScrCmd_bufferpartymonnick
@@ -5537,7 +5537,7 @@ ScrCmd_setmonobedient: @ 806C7D4
adds r0, r1
movs r1, 0x50
mov r2, sp
- bl sub_804037C
+ bl SetMonData
movs r0, 0
add sp, 0x4
pop {r1}
@@ -5598,7 +5598,7 @@ sub_806C844: @ 806C844
adds r0, r1
movs r1, 0x23
mov r2, sp
- bl sub_804037C
+ bl SetMonData
_0806C87A:
movs r0, 0
add sp, 0x4
diff --git a/asm/script_movement.s b/asm/script_movement.s
index 58becc75a..826d6d6bd 100644
--- a/asm/script_movement.s
+++ b/asm/script_movement.s
@@ -480,7 +480,7 @@ _0809777C:
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _080977A8 @ =gUnknown_2036E38
+ ldr r1, _080977A8 @ =gMapObjects
adds r0, r1
bl npc_sync_anim_pause_bits
_08097792:
@@ -495,7 +495,7 @@ _08097792:
bx r0
.align 2, 0
_080977A4: .4byte gTasks+0x8
-_080977A8: .4byte gUnknown_2036E38
+_080977A8: .4byte gMapObjects
thumb_func_end UnfreezeObjects
thumb_func_start Task_80A244C
@@ -557,7 +557,7 @@ sub_80977F0: @ 80977F0
lsls r0, r4, 3
adds r0, r4
lsls r0, 2
- ldr r1, _08097850 @ =gUnknown_2036E38
+ ldr r1, _08097850 @ =gMapObjects
adds r4, r0, r1
adds r0, r4, 0
bl FieldObjectIsSpecialAnimActive
@@ -580,7 +580,7 @@ _08097838:
bl FreezeMapObject
b _0809786A
.align 2, 0
-_08097850: .4byte gUnknown_2036E38
+_08097850: .4byte gMapObjects
_08097854:
adds r0, r4, 0
bl sub_8063CA4
diff --git a/asm/script_pokemon_util_80A0058.s b/asm/script_pokemon_util_80A0058.s
index 2c8a3af2a..18c2d7ecb 100644
--- a/asm/script_pokemon_util_80A0058.s
+++ b/asm/script_pokemon_util_80A0058.s
@@ -15,7 +15,7 @@ sp000_heal_pokemon: @ 80A0058
sub sp, 0x4
movs r0, 0
mov r8, r0
- ldr r0, _080A0114 @ =gUnknown_2024029
+ ldr r0, _080A0114 @ =gPlayerPartyCount
ldrb r0, [r0]
cmp r8, r0
bcs _080A0104
@@ -37,7 +37,7 @@ _080A0076:
adds r0, r4, 0
movs r1, 0x39
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r4, 0
movs r1, 0x15
bl GetMonData
@@ -62,7 +62,7 @@ _080A00AC:
adds r1, 0x11
adds r0, r4, 0
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r5, 0x1
lsls r0, 24
lsrs r5, r0, 24
@@ -79,12 +79,12 @@ _080A00AC:
add r0, r10
movs r1, 0x37
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r1, r9
lsls r0, r1, 24
lsrs r0, 24
mov r8, r0
- ldr r0, _080A0114 @ =gUnknown_2024029
+ ldr r0, _080A0114 @ =gPlayerPartyCount
ldrb r0, [r0]
cmp r8, r0
bcc _080A0076
@@ -98,7 +98,7 @@ _080A0104:
pop {r0}
bx r0
.align 2, 0
-_080A0114: .4byte gUnknown_2024029
+_080A0114: .4byte gPlayerPartyCount
_080A0118: .4byte gPlayerParty
thumb_func_end sp000_heal_pokemon
@@ -139,7 +139,7 @@ ScriptGiveMon: @ 80A011C
adds r0, r7, 0
movs r1, 0xC
add r2, sp, 0x10
- bl sub_804037C
+ bl SetMonData
adds r0, r7, 0
bl GiveMonToPlayer
lsls r0, 24
@@ -189,7 +189,7 @@ sub_80A01AC: @ 80A01AC
adds r0, r5, 0
movs r1, 0x2D
mov r2, sp
- bl sub_804037C
+ bl SetMonData
adds r0, r5, 0
bl GiveMonToPlayer
adds r4, r0, 0
@@ -335,7 +335,7 @@ CreateScriptedWildMon: @ 80A029C
mov r0, r8
movs r1, 0xC
add r2, sp, 0x10
- bl sub_804037C
+ bl SetMonData
_080A02EA:
add sp, 0x14
pop {r3}
@@ -358,7 +358,7 @@ ScriptSetMonMoveSlot: @ 80A02FC
lsrs r2, 24
cmp r3, 0x6
bls _080A0318
- ldr r0, _080A032C @ =gUnknown_2024029
+ ldr r0, _080A032C @ =gPlayerPartyCount
ldrb r0, [r0]
subs r0, 0x1
lsls r0, 24
@@ -374,7 +374,7 @@ _080A0318:
pop {r0}
bx r0
.align 2, 0
-_080A032C: .4byte gUnknown_2024029
+_080A032C: .4byte gPlayerPartyCount
_080A0330: .4byte gPlayerParty
thumb_func_end ScriptSetMonMoveSlot
@@ -442,7 +442,7 @@ sub_80A039C: @ 80A039C
ldrb r4, [r0]
cmp r4, 0
bne _080A03B8
- bl sub_804C230
+ bl LoadPlayerParty
ldr r0, _080A03B4 @ =gUnknown_20370D0
strh r4, [r0]
b _080A03C2
diff --git a/asm/script_pokemon_util_80BF8FC.s b/asm/script_pokemon_util_80BF8FC.s
index 81b861413..c2184904c 100644
--- a/asm/script_pokemon_util_80BF8FC.s
+++ b/asm/script_pokemon_util_80BF8FC.s
@@ -107,7 +107,7 @@ sub_80BF9BC: @ 80BF9BC
ldr r0, _080BF9F0 @ =gPlayerParty
ldr r1, _080BF9F4 @ =gUnknown_20370C0
ldrb r1, [r1]
- ldr r2, _080BF9F8 @ =gUnknown_2024029
+ ldr r2, _080BF9F8 @ =gPlayerPartyCount
ldrb r2, [r2]
subs r2, 0x1
lsls r2, 24
@@ -128,7 +128,7 @@ sub_80BF9BC: @ 80BF9BC
.align 2, 0
_080BF9F0: .4byte gPlayerParty
_080BF9F4: .4byte gUnknown_20370C0
-_080BF9F8: .4byte gUnknown_2024029
+_080BF9F8: .4byte gPlayerPartyCount
_080BF9FC: .4byte c2_exit_to_overworld_2_switch
_080BFA00: .4byte gUnknown_3005020
_080BFA04: .4byte sub_807DD24
@@ -304,23 +304,23 @@ sub_80BFAA8: @ 80BFAA8
mov r0, r8
ldr r1, [sp, 0x8]
mov r2, sp
- bl sub_804037C
+ bl SetMonData
mov r0, r8
ldr r1, [sp, 0xC]
ldr r2, [sp, 0x14]
- bl sub_804037C
+ bl SetMonData
mov r0, r8
ldr r1, [sp, 0x10]
mov r2, r10
- bl sub_804037C
+ bl SetMonData
mov r0, r8
ldr r1, [sp, 0x1C]
ldr r2, [sp, 0x18]
- bl sub_804037C
+ bl SetMonData
mov r0, r8
movs r1, 0x15
adds r2, r6, 0
- bl sub_804037C
+ bl SetMonData
add sp, 0x20
pop {r3-r5}
mov r8, r3
diff --git a/asm/shop.s b/asm/shop.s
index 8c39c795f..e9401913d 100644
--- a/asm/shop.s
+++ b/asm/shop.s
@@ -1889,7 +1889,7 @@ _0809B976:
ldr r1, _0809B9EC @ =gUnknown_20398B8
adds r0, r2, r1
strh r5, [r0]
- ldr r1, _0809B9F0 @ =gUnknown_2036E38
+ ldr r1, _0809B9F0 @ =gMapObjects
lsls r0, r3, 3
adds r0, r3
lsls r0, 2
@@ -1910,7 +1910,7 @@ _0809B9E0: .4byte gUnknown_20398BA
_0809B9E4: .4byte 0x0000fffd
_0809B9E8: .4byte 0x0000fffe
_0809B9EC: .4byte gUnknown_20398B8
-_0809B9F0: .4byte gUnknown_2036E38
+_0809B9F0: .4byte gMapObjects
_0809B9F4:
cmp r0, 0x3
beq _0809BA06
@@ -1968,7 +1968,7 @@ sub_809BA40: @ 809BA40
sub sp, 0x4
movs r6, 0
ldr r7, _0809BAE8 @ =gUnknown_20398B4
- ldr r0, _0809BAEC @ =gUnknown_2036E38
+ ldr r0, _0809BAEC @ =gMapObjects
mov r8, r0
adds r1, r7, 0x6
mov r9, r1
@@ -2045,7 +2045,7 @@ _0809BACE:
bx r0
.align 2, 0
_0809BAE8: .4byte gUnknown_20398B4
-_0809BAEC: .4byte gUnknown_2036E38
+_0809BAEC: .4byte gMapObjects
_0809BAF0: .4byte 0xfff80000
_0809BAF4: .4byte SpriteCallbackDummy
_0809BAF8: .4byte gSprites
diff --git a/asm/ss_anne.s b/asm/ss_anne.s
index 5ba63dea3..429645f3e 100644
--- a/asm/ss_anne.s
+++ b/asm/ss_anne.s
@@ -100,7 +100,7 @@ _0815D3D6:
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0815D42C @ =gUnknown_2036E38
+ ldr r1, _0815D42C @ =gMapObjects
adds r0, r1
ldr r2, _0815D430 @ =gSprites
ldrb r1, [r0, 0x4]
@@ -128,7 +128,7 @@ _0815D3D6:
.align 2, 0
_0815D424: .4byte gTasks+0x8
_0815D428: .4byte gSaveBlock1Ptr
-_0815D42C: .4byte gUnknown_2036E38
+_0815D42C: .4byte gMapObjects
_0815D430: .4byte gSprites
_0815D434: .4byte sub_815D454
_0815D438:
@@ -197,7 +197,7 @@ sub_815D498: @ 815D498
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0815D50C @ =gUnknown_2036E38
+ ldr r1, _0815D50C @ =gMapObjects
adds r0, r1
ldr r4, _0815D510 @ =gSprites
ldrb r1, [r0, 0x4]
@@ -238,7 +238,7 @@ sub_815D498: @ 815D498
bx r0
.align 2, 0
_0815D508: .4byte gSaveBlock1Ptr
-_0815D50C: .4byte gUnknown_2036E38
+_0815D50C: .4byte gMapObjects
_0815D510: .4byte gSprites
_0815D514: .4byte gUnknown_8479C88
thumb_func_end sub_815D498
@@ -260,7 +260,7 @@ sub_815D518: @ 815D518
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0815D59C @ =gUnknown_2036E38
+ ldr r1, _0815D59C @ =gMapObjects
adds r0, r1
ldr r2, _0815D5A0 @ =gSprites
ldrb r1, [r0, 0x4]
@@ -308,7 +308,7 @@ _0815D58E:
bx r0
.align 2, 0
_0815D598: .4byte gSaveBlock1Ptr
-_0815D59C: .4byte gUnknown_2036E38
+_0815D59C: .4byte gMapObjects
_0815D5A0: .4byte gSprites
thumb_func_end sub_815D518
@@ -328,7 +328,7 @@ sub_815D5A4: @ 815D5A4
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _0815D618 @ =gUnknown_2036E38
+ ldr r1, _0815D618 @ =gMapObjects
adds r0, r1
ldr r4, _0815D61C @ =gSprites
ldrb r0, [r0, 0x4]
@@ -371,7 +371,7 @@ _0815D60C:
bx r0
.align 2, 0
_0815D614: .4byte gSaveBlock1Ptr
-_0815D618: .4byte gUnknown_2036E38
+_0815D618: .4byte gMapObjects
_0815D61C: .4byte gSprites
_0815D620: .4byte gUnknown_8479CC0
thumb_func_end sub_815D5A4
diff --git a/asm/start_menu.s b/asm/start_menu.s
index 263e27504..a776442d5 100644
--- a/asm/start_menu.s
+++ b/asm/start_menu.s
@@ -1379,7 +1379,7 @@ _0806F814:
beq _0806F858
b _0806F864
_0806F81A:
- ldr r0, _0806F838 @ =gUnknown_30053A0
+ ldr r0, _0806F838 @ =gSaveFileStatus
ldrh r0, [r0]
cmp r0, 0
beq _0806F826
@@ -1396,7 +1396,7 @@ _0806F82E:
str r0, [r1]
b _0806F864
.align 2, 0
-_0806F838: .4byte gUnknown_30053A0
+_0806F838: .4byte gSaveFileStatus
_0806F83C: .4byte gUnknown_2031DB0
_0806F840: .4byte gUnknown_3000FA4
_0806F844: .4byte sub_806F86C
diff --git a/asm/teachy_tv.s b/asm/teachy_tv.s
index 70b02bbd5..523fb786e 100644
--- a/asm/teachy_tv.s
+++ b/asm/teachy_tv.s
@@ -2161,7 +2161,7 @@ sub_815BC90: @ 815BC90
ldr r1, _0815BCD8 @ =gMain
ldr r0, _0815BCDC @ =sub_815BD58
str r0, [r1, 0x8]
- bl copy_player_party_to_sav1
+ bl SavePlayerParty
bl sub_8159F40
movs r0, 0
bl PlayMapChosenOrBattleBGM
@@ -2243,7 +2243,7 @@ _0815BD54: .4byte sub_800FD9C
thumb_func_start sub_815BD58
sub_815BD58: @ 815BD58
push {lr}
- bl sub_804C230
+ bl LoadPlayerParty
ldr r0, _0815BD6C @ =gUnknown_2023E8A
ldrb r0, [r0]
cmp r0, 0x3
diff --git a/asm/title_screen.s b/asm/title_screen.s
index 33c7d7386..3ff269d8f 100644
--- a/asm/title_screen.s
+++ b/asm/title_screen.s
@@ -1107,10 +1107,10 @@ _08079248:
bl SeedRngAndSetTrainerId
bl SetSaveBlocksPointers
bl sub_8054A28
- bl ResetSaveCounters
+ bl Save_ResetSaveCounters
movs r0, 0
- bl sub_80DA4FC
- ldr r0, _080792B4 @ =gUnknown_30053A0
+ bl Save_LoadGameData
+ ldr r0, _080792B4 @ =gSaveFileStatus
ldrh r0, [r0]
cmp r0, 0
beq _08079276
@@ -1143,7 +1143,7 @@ _080792A6:
bx r0
.align 2, 0
_080792B0: .4byte gUnknown_2037AB8
-_080792B4: .4byte gUnknown_30053A0
+_080792B4: .4byte gSaveFileStatus
_080792B8: .4byte gSaveBlock2Ptr
_080792BC: .4byte gHeap
_080792C0: .4byte sub_800C300
diff --git a/asm/trade.s b/asm/trade.s
index 8351a9a73..dafec1351 100644
--- a/asm/trade.s
+++ b/asm/trade.s
@@ -473,12 +473,12 @@ _0804CA10:
bl SetGpuReg
ldr r2, _0804CB2C @ =gUnknown_2031DA8
ldr r0, [r2]
- ldr r1, _0804CB30 @ =gUnknown_2024029
+ ldr r1, _0804CB30 @ =gPlayerPartyCount
ldrb r1, [r1]
adds r0, 0x36
strb r1, [r0]
ldr r0, [r2]
- ldr r1, _0804CB34 @ =gUnknown_202402A
+ ldr r1, _0804CB34 @ =gEnemyPartyCount
ldrb r1, [r1]
adds r0, 0x37
strb r1, [r0]
@@ -602,8 +602,8 @@ _0804CB20:
b _0804CEC2
.align 2, 0
_0804CB2C: .4byte gUnknown_2031DA8
-_0804CB30: .4byte gUnknown_2024029
-_0804CB34: .4byte gUnknown_202402A
+_0804CB30: .4byte gPlayerPartyCount
+_0804CB34: .4byte gEnemyPartyCount
_0804CB38: .4byte gUnknown_8261E40
_0804CB3C: .4byte gPlayerParty
_0804CB40: .4byte 0xfff40000
@@ -648,7 +648,7 @@ _0804CB9C:
ldr r0, [r0]
ldr r6, _0804CC18 @ =gUnknown_2031C94
ldr r1, [r6]
- ldr r5, _0804CC1C @ =gUnknown_201C000
+ ldr r5, _0804CC1C @ =gDecompressionBuffer
str r5, [sp]
movs r4, 0x3
str r4, [sp, 0x4]
@@ -701,7 +701,7 @@ _0804CB9C:
.align 2, 0
_0804CC14: .4byte gSaveBlock2Ptr
_0804CC18: .4byte gUnknown_2031C94
-_0804CC1C: .4byte gUnknown_201C000
+_0804CC1C: .4byte gDecompressionBuffer
_0804CC20: .4byte gUnknown_2022744
_0804CC24: .4byte gUnknown_8261ECC
_0804CC28: .4byte gMain
@@ -1156,12 +1156,12 @@ _0804D00C:
bl CalculateEnemyPartyCount
ldr r4, _0804D12C @ =gUnknown_2031DA8
ldr r0, [r4]
- ldr r1, _0804D130 @ =gUnknown_2024029
+ ldr r1, _0804D130 @ =gPlayerPartyCount
ldrb r1, [r1]
adds r0, 0x36
strb r1, [r0]
ldr r0, [r4]
- ldr r1, _0804D134 @ =gUnknown_202402A
+ ldr r1, _0804D134 @ =gEnemyPartyCount
ldrb r1, [r1]
adds r0, 0x37
strb r1, [r0]
@@ -1292,8 +1292,8 @@ _0804D120:
b _0804D4B4
.align 2, 0
_0804D12C: .4byte gUnknown_2031DA8
-_0804D130: .4byte gUnknown_2024029
-_0804D134: .4byte gUnknown_202402A
+_0804D130: .4byte gPlayerPartyCount
+_0804D134: .4byte gEnemyPartyCount
_0804D138: .4byte gUnknown_8261E40
_0804D13C: .4byte gPlayerParty
_0804D140: .4byte 0xfff40000
@@ -1338,7 +1338,7 @@ _0804D19C:
ldr r0, [r0]
ldr r6, _0804D218 @ =gUnknown_2031C94
ldr r1, [r6]
- ldr r5, _0804D21C @ =gUnknown_201C000
+ ldr r5, _0804D21C @ =gDecompressionBuffer
str r5, [sp]
movs r4, 0x3
str r4, [sp, 0x4]
@@ -1392,7 +1392,7 @@ _0804D200:
.align 2, 0
_0804D214: .4byte gSaveBlock2Ptr
_0804D218: .4byte gUnknown_2031C94
-_0804D21C: .4byte gUnknown_201C000
+_0804D21C: .4byte gDecompressionBuffer
_0804D220: .4byte gUnknown_2022744
_0804D224: .4byte gUnknown_8261ECC
_0804D228: .4byte gMain
@@ -2488,7 +2488,7 @@ _0804DB1A:
adds r0, r4, 0
movs r1, 0x2
ldr r2, _0804DB74 @ =gUnknown_8246BE5
- bl sub_804037C
+ bl SetMonData
_0804DB5A:
adds r4, 0x64
subs r5, 0x1
@@ -3568,7 +3568,7 @@ _0804E3B6:
_0804E3D0: .4byte gUnknown_2031DA8
_0804E3D4:
ldr r0, _0804E3F4 @ =gPlayerParty
- ldr r1, _0804E3F8 @ =gUnknown_2024029
+ ldr r1, _0804E3F8 @ =gPlayerPartyCount
ldrb r1, [r1]
ldr r2, _0804E3FC @ =gUnknown_2031DA8
ldr r2, [r2]
@@ -3584,7 +3584,7 @@ _0804E3D4:
mov pc, r0
.align 2, 0
_0804E3F4: .4byte gPlayerParty
-_0804E3F8: .4byte gUnknown_2024029
+_0804E3F8: .4byte gPlayerPartyCount
_0804E3FC: .4byte gUnknown_2031DA8
_0804E400: .4byte _0804E404
.align 2, 0
@@ -6024,7 +6024,7 @@ _0804F71E:
sub_804F728: @ 804F728
push {lr}
sub sp, 0x8
- ldr r2, _0804F744 @ =gUnknown_201C000
+ ldr r2, _0804F744 @ =gDecompressionBuffer
str r2, [sp]
movs r2, 0x6
str r2, [sp, 0x4]
@@ -6035,7 +6035,7 @@ sub_804F728: @ 804F728
pop {r0}
bx r0
.align 2, 0
-_0804F744: .4byte gUnknown_201C000
+_0804F744: .4byte gDecompressionBuffer
thumb_func_end sub_804F728
thumb_func_start sub_804F748
@@ -6469,7 +6469,7 @@ _0804FA70:
lsls r1, r0, 3
subs r1, r0
lsls r1, 2
- ldr r0, _0804FAB0 @ =gUnknown_202273C
+ ldr r0, _0804FAB0 @ =gLinkPlayers
adds r1, r0
ldrb r0, [r1]
subs r0, 0x1
@@ -6492,7 +6492,7 @@ _0804FA70:
movs r0, 0x5
b _0804FB24
.align 2, 0
-_0804FAB0: .4byte gUnknown_202273C
+_0804FAB0: .4byte gLinkPlayers
_0804FAB4:
cmp r1, 0x97
bgt _0804FADE
@@ -6578,7 +6578,7 @@ sub_804FB34: @ 804FB34
cmp r0, 0
beq _0804FBC0
bl GetMultiplayerId
- ldr r6, _0804FBB8 @ =gUnknown_202273C
+ ldr r6, _0804FBB8 @ =gLinkPlayers
movs r7, 0x1
eors r0, r7
lsls r0, 24
@@ -6635,7 +6635,7 @@ _0804FB6E:
b _0804FBC2
.align 2, 0
_0804FBB4: .4byte gUnknown_3003F64
-_0804FBB8: .4byte gUnknown_202273C
+_0804FBB8: .4byte gLinkPlayers
_0804FBBC:
movs r0, 0x1
b _0804FBC2
@@ -7287,7 +7287,7 @@ _08050040:
lsls r0, r5, 3
ldr r1, _08050074 @ =gUnknown_82350AC
adds r0, r1
- ldr r1, _08050078 @ =gUnknown_202401C
+ ldr r1, _08050078 @ =gMonSpritesGfxPtr
ldr r1, [r1]
ldr r1, [r1, 0x8]
adds r2, r5, 0
@@ -7297,12 +7297,12 @@ _08050040:
b _0805009A
.align 2, 0
_08050074: .4byte gUnknown_82350AC
-_08050078: .4byte gUnknown_202401C
+_08050078: .4byte gMonSpritesGfxPtr
_0805007C:
lsls r0, r5, 3
ldr r1, _080500BC @ =gUnknown_82350AC
adds r0, r1
- ldr r1, _080500C0 @ =gUnknown_202401C
+ ldr r1, _080500C0 @ =gMonSpritesGfxPtr
ldr r2, [r1]
lsls r4, r6, 1
adds r1, r4, 0x1
@@ -7330,7 +7330,7 @@ _0805009A:
b _0805011E
.align 2, 0
_080500BC: .4byte gUnknown_82350AC
-_080500C0: .4byte gUnknown_202401C
+_080500C0: .4byte gMonSpritesGfxPtr
_080500C4: .4byte gUnknown_2031DAC
_080500C8:
mov r0, r8
@@ -7338,7 +7338,7 @@ _080500C8:
ldrh r0, [r0, 0x4]
adds r1, r4, 0
bl sub_803F7D4
- ldr r0, _08050128 @ =gUnknown_20244DC
+ ldr r0, _08050128 @ =gMultiuseSpriteTemplate
movs r1, 0x78
movs r2, 0x3C
movs r3, 0x6
@@ -7380,7 +7380,7 @@ _0805011E:
pop {r0}
bx r0
.align 2, 0
-_08050128: .4byte gUnknown_20244DC
+_08050128: .4byte gMultiuseSpriteTemplate
_0805012C: .4byte gUnknown_2031DAC
_08050130: .4byte gSprites
_08050134: .4byte SpriteCallbackDummy
@@ -7852,7 +7852,7 @@ sub_80504CC: @ 80504CC
bl sub_80F696C
ldr r0, _080505BC @ =gUnknown_8D0051C
mov r8, r0
- ldr r4, _080505C0 @ =gUnknown_201C000
+ ldr r4, _080505C0 @ =gDecompressionBuffer
adds r1, r4, 0
bl LZDecompressWram
movs r0, 0
@@ -7898,7 +7898,7 @@ sub_80504CC: @ 80504CC
_080505B4: .4byte gUnknown_826D1D4
_080505B8: .4byte gUnknown_8D00000
_080505BC: .4byte gUnknown_8D0051C
-_080505C0: .4byte gUnknown_201C000
+_080505C0: .4byte gDecompressionBuffer
_080505C4: .4byte gUnknown_8D004D8
_080505C8: .4byte gUnknown_826D1BC
thumb_func_end sub_80504CC
@@ -8221,7 +8221,7 @@ _08050866:
adds r0, r7, 0
movs r1, 0x20
mov r2, sp
- bl sub_804037C
+ bl SetMonData
_080508A2:
mov r0, r8
cmp r0, 0xFF
@@ -10809,7 +10809,7 @@ _08052042:
lsls r0, r2, 3
ldr r1, _08052068 @ =gUnknown_82350AC
adds r0, r1
- ldr r1, _0805206C @ =gUnknown_202401C
+ ldr r1, _0805206C @ =gMonSpritesGfxPtr
ldr r1, [r1]
ldr r1, [r1, 0x10]
ldr r3, [r3, 0x6C]
@@ -10820,7 +10820,7 @@ _08052042:
_08052060: .4byte gSprites
_08052064: .4byte SpriteCallbackDummy
_08052068: .4byte gUnknown_82350AC
-_0805206C: .4byte gUnknown_202401C
+_0805206C: .4byte gMonSpritesGfxPtr
_08052070:
ldr r4, _0805211C @ =gSprites
ldr r2, [r7]
@@ -11063,7 +11063,7 @@ _0805223C:
adds r0, r5
movs r1, 0x1
movs r2, 0
- bl sub_8042EC4
+ bl GetEvolutionTargetSpecies
lsls r0, 16
lsrs r4, r0, 16
cmp r4, 0
@@ -13034,7 +13034,7 @@ _0805349E:
lsls r0, r2, 3
ldr r1, _080534C4 @ =gUnknown_82350AC
adds r0, r1
- ldr r1, _080534C8 @ =gUnknown_202401C
+ ldr r1, _080534C8 @ =gMonSpritesGfxPtr
ldr r1, [r1]
ldr r1, [r1, 0x10]
ldr r3, [r3, 0x6C]
@@ -13045,7 +13045,7 @@ _0805349E:
_080534BC: .4byte gSprites
_080534C0: .4byte SpriteCallbackDummy
_080534C4: .4byte gUnknown_82350AC
-_080534C8: .4byte gUnknown_202401C
+_080534C8: .4byte gMonSpritesGfxPtr
_080534CC:
ldr r4, _08053578 @ =gSprites
ldr r2, [r7]
@@ -13288,7 +13288,7 @@ _08053698:
adds r0, r5
movs r1, 0x1
movs r2, 0
- bl sub_8042EC4
+ bl GetEvolutionTargetSpecies
lsls r0, 16
lsrs r4, r0, 16
cmp r4, 0
@@ -13416,7 +13416,7 @@ _080537B8:
adds r0, r5
movs r1, 0x1
movs r2, 0
- bl sub_8042EC4
+ bl GetEvolutionTargetSpecies
lsls r0, 16
lsrs r4, r0, 16
cmp r4, 0
@@ -13793,7 +13793,7 @@ sub_8053A9C: @ 8053A9C
ldrh r1, [r4, 0x38]
movs r6, 0xB
muls r1, r6
- ldr r5, _08053ADC @ =gUnknown_8245EE0
+ ldr r5, _08053ADC @ =gSpeciesNames
adds r1, r5
bl StringCopy
ldr r0, _08053AE0 @ =gStringVar2
@@ -13809,7 +13809,7 @@ sub_8053A9C: @ 8053A9C
_08053AD0: .4byte gUnknown_20370C0
_08053AD4: .4byte gUnknown_826CF8C
_08053AD8: .4byte gStringVar1
-_08053ADC: .4byte gUnknown_8245EE0
+_08053ADC: .4byte gSpeciesNames
_08053AE0: .4byte gStringVar2
thumb_func_end sub_8053A9C
@@ -13840,7 +13840,7 @@ sub_8053AE4: @ 8053AE4
ldrh r2, [r4, 0xC]
movs r1, 0xB
muls r1, r2
- ldr r2, _08053B44 @ =gUnknown_8245EE0
+ ldr r2, _08053B44 @ =gSpeciesNames
adds r1, r2
bl StringCopy
add sp, 0x20
@@ -13854,7 +13854,7 @@ _08053B34: .4byte gUnknown_20370C2
_08053B38: .4byte gPlayerParty
_08053B3C: .4byte gStringVar1
_08053B40: .4byte gStringVar2
-_08053B44: .4byte gUnknown_8245EE0
+_08053B44: .4byte gSpeciesNames
thumb_func_end sub_8053AE4
thumb_func_start sub_8053B48
@@ -13898,85 +13898,85 @@ sub_8053B48: @ 8053B48
adds r2, 0xE
adds r0, r6, 0
movs r1, 0x27
- bl sub_804037C
+ bl SetMonData
adds r2, r5, 0
adds r2, 0xF
adds r0, r6, 0
movs r1, 0x28
- bl sub_804037C
+ bl SetMonData
adds r2, r5, 0
adds r2, 0x10
adds r0, r6, 0
movs r1, 0x29
- bl sub_804037C
+ bl SetMonData
adds r2, r5, 0
adds r2, 0x11
adds r0, r6, 0
movs r1, 0x2A
- bl sub_804037C
+ bl SetMonData
adds r2, r5, 0
adds r2, 0x12
adds r0, r6, 0
movs r1, 0x2B
- bl sub_804037C
+ bl SetMonData
adds r2, r5, 0
adds r2, 0x13
adds r0, r6, 0
movs r1, 0x2C
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
movs r1, 0x2
adds r2, r5, 0
- bl sub_804037C
+ bl SetMonData
adds r2, r5, 0
adds r2, 0x2B
adds r0, r6, 0
movs r1, 0x7
- bl sub_804037C
+ bl SetMonData
adds r2, r5, 0
adds r2, 0x36
adds r0, r6, 0
movs r1, 0x31
- bl sub_804037C
+ bl SetMonData
adds r2, r5, 0
adds r2, 0x14
adds r0, r6, 0
movs r1, 0x2E
- bl sub_804037C
+ bl SetMonData
adds r2, r5, 0
adds r2, 0x1D
adds r0, r6, 0
movs r1, 0x17
- bl sub_804037C
+ bl SetMonData
adds r2, r5, 0
adds r2, 0x1E
adds r0, r6, 0
movs r1, 0x18
- bl sub_804037C
+ bl SetMonData
adds r2, r5, 0
adds r2, 0x1C
adds r0, r6, 0
movs r1, 0x16
- bl sub_804037C
+ bl SetMonData
adds r2, r5, 0
adds r2, 0x1F
adds r0, r6, 0
movs r1, 0x21
- bl sub_804037C
+ bl SetMonData
adds r2, r5, 0
adds r2, 0x20
adds r0, r6, 0
movs r1, 0x2F
- bl sub_804037C
+ bl SetMonData
adds r2, r5, 0
adds r2, 0x37
adds r0, r6, 0
movs r1, 0x30
- bl sub_804037C
+ bl SetMonData
adds r0, r6, 0
movs r1, 0x23
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
mov r4, sp
adds r4, 0x35
movs r0, 0
@@ -14002,12 +14002,12 @@ sub_8053B48: @ 8053B48
adds r0, r6, 0
movs r1, 0x40
adds r2, r4, 0
- bl sub_804037C
+ bl SetMonData
adds r2, r5, 0
adds r2, 0x28
adds r0, r6, 0
movs r1, 0xC
- bl sub_804037C
+ bl SetMonData
b _08053CC0
.align 2, 0
_08053CA4: .4byte gUnknown_826CF8C
@@ -14019,7 +14019,7 @@ _08053CB4:
adds r2, 0x28
adds r0, r6, 0
movs r1, 0xC
- bl sub_804037C
+ bl SetMonData
_08053CC0:
ldr r0, _08053CD0 @ =gEnemyParty
bl CalculateMonStats
@@ -14480,7 +14480,7 @@ _08054132:
ldrb r0, [r0]
cmp r0, 0
beq _0805415A
- ldr r4, _0805417C @ =gUnknown_202273C
+ ldr r4, _0805417C @ =gLinkPlayers
bl GetMultiplayerId
movs r1, 0x1
eors r0, r1
@@ -14509,7 +14509,7 @@ _0805415A:
.align 2, 0
_08054174: .4byte gUnknown_2031DAC
_08054178: .4byte gUnknown_3003F3C
-_0805417C: .4byte gUnknown_202273C
+_0805417C: .4byte gLinkPlayers
_08054180: .4byte gMain
_08054184:
ldr r0, _0805419C @ =gUnknown_2031DAC
diff --git a/asm/trainer_card.s b/asm/trainer_card.s
index 5d0cab90e..5896ce98d 100644
--- a/asm/trainer_card.s
+++ b/asm/trainer_card.s
@@ -4800,7 +4800,7 @@ sub_808B700: @ 808B700
movs r2, 0x60
bl memcpy
ldr r1, [r5]
- ldr r2, _0808B768 @ =gUnknown_202273C
+ ldr r2, _0808B768 @ =gLinkPlayers
lsls r0, r4, 3
subs r0, r4
lsls r0, 2
@@ -4819,7 +4819,7 @@ _0808B758: .4byte gUnknown_20397A4
_0808B75C: .4byte 0x00007bd0
_0808B760: .4byte 0x0000045c
_0808B764: .4byte gUnknown_2039624
-_0808B768: .4byte gUnknown_202273C
+_0808B768: .4byte gLinkPlayers
_0808B76C: .4byte 0x00007bcf
_0808B770: .4byte sub_80895B8
thumb_func_end sub_808B700
diff --git a/asm/trainer_see.s b/asm/trainer_see.s
index 29c9b1983..cfdd02906 100644
--- a/asm/trainer_see.s
+++ b/asm/trainer_see.s
@@ -19,7 +19,7 @@ _08081B40:
b _08081B7A
_08081B44:
movs r4, 0
- ldr r5, _08081B80 @ =gUnknown_2036E38
+ ldr r5, _08081B80 @ =gMapObjects
_08081B48:
lsls r0, r4, 3
adds r0, r4
@@ -53,7 +53,7 @@ _08081B7A:
pop {r1}
bx r1
.align 2, 0
-_08081B80: .4byte gUnknown_2036E38
+_08081B80: .4byte gMapObjects
thumb_func_end sub_8081B30
thumb_func_start sub_8081B84
@@ -70,7 +70,7 @@ sub_8081B84: @ 8081B84
lsls r4, r5, 3
adds r0, r4, r5
lsls r0, 2
- ldr r1, _08081BE0 @ =gUnknown_2036E38
+ ldr r1, _08081BE0 @ =gMapObjects
adds r0, r1
bl sub_8081BEC
lsls r0, 24
@@ -90,7 +90,7 @@ _08081BC0:
bl TrainerWantsBattle
adds r0, r4, r5
lsls r0, 2
- ldr r1, _08081BE0 @ =gUnknown_2036E38
+ ldr r1, _08081BE0 @ =gMapObjects
adds r0, r1
subs r1, r7, 0x1
lsls r1, 24
@@ -99,7 +99,7 @@ _08081BC0:
movs r0, 0x1
b _08081BE6
.align 2, 0
-_08081BE0: .4byte gUnknown_2036E38
+_08081BE0: .4byte gMapObjects
_08081BE4:
movs r0, 0
_08081BE6:
@@ -740,7 +740,7 @@ _0808204A:
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _080820B8 @ =gUnknown_2036E38
+ ldr r1, _080820B8 @ =gMapObjects
adds r4, r0, r1
adds r0, r4, 0
bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive
@@ -764,7 +764,7 @@ _080820AC:
bx r1
.align 2, 0
_080820B4: .4byte gUnknown_2037078
-_080820B8: .4byte gUnknown_2036E38
+_080820B8: .4byte gMapObjects
thumb_func_end sub_808202C
thumb_func_start sub_80820BC
@@ -777,7 +777,7 @@ sub_80820BC: @ 80820BC
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r1, _080820FC @ =gUnknown_2036E38
+ ldr r1, _080820FC @ =gMapObjects
adds r4, r0, r1
adds r0, r4, 0
bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive
@@ -799,7 +799,7 @@ _080820EE:
bx r1
.align 2, 0
_080820F8: .4byte gUnknown_2037078
-_080820FC: .4byte gUnknown_2036E38
+_080820FC: .4byte gMapObjects
thumb_func_end sub_80820BC
thumb_func_start sub_8082100
@@ -1025,7 +1025,7 @@ sub_808226C: @ 808226C
movs r1, 0x7
movs r2, 0x7F
bl SpawnSpecialFieldObjectParametrized
- ldr r2, _080822C8 @ =gUnknown_2036E38
+ ldr r2, _080822C8 @ =gMapObjects
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
@@ -1046,7 +1046,7 @@ sub_808226C: @ 808226C
bx r1
.align 2, 0
_080822C4: .4byte gSaveBlock1Ptr
-_080822C8: .4byte gUnknown_2036E38
+_080822C8: .4byte gMapObjects
thumb_func_end sub_808226C
thumb_func_start sub_80822CC
@@ -1067,7 +1067,7 @@ sub_80822CC: @ 80822CC
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r4, _0808234C @ =gUnknown_2036E38
+ ldr r4, _0808234C @ =gMapObjects
adds r0, r4
bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive
lsls r0, 24
@@ -1096,7 +1096,7 @@ _08082312:
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _0808234C @ =gUnknown_2036E38
+ ldr r0, _0808234C @ =gMapObjects
adds r4, r0
movs r0, 0x2
bl sub_8063FB0
@@ -1111,7 +1111,7 @@ _08082312:
b _0808236E
.align 2, 0
_08082348: .4byte gSaveBlock1Ptr
-_0808234C: .4byte gUnknown_2036E38
+_0808234C: .4byte gMapObjects
_08082350:
ldr r1, _08082378 @ =gUnknown_20386E0
adds r2, r1, 0x4
@@ -1158,7 +1158,7 @@ sub_808237C: @ 808237C
lsls r0, r1, 3
adds r0, r1
lsls r0, 2
- ldr r4, _08082408 @ =gUnknown_2036E38
+ ldr r4, _08082408 @ =gMapObjects
adds r0, r4
bl FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive
lsls r0, 24
@@ -1187,7 +1187,7 @@ _080823CC:
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _08082408 @ =gUnknown_2036E38
+ ldr r0, _08082408 @ =gMapObjects
adds r4, r0
movs r0, 0x1
bl sub_8063FB0
@@ -1202,7 +1202,7 @@ _080823CC:
b _0808242E
.align 2, 0
_08082404: .4byte gSaveBlock1Ptr
-_08082408: .4byte gUnknown_2036E38
+_08082408: .4byte gMapObjects
_0808240C:
bl GetPlayerAvatarObjectId
lsls r0, 24
@@ -1579,7 +1579,7 @@ _080826DA:
bl FieldEffectStop
b _08082736
_080826E8:
- ldr r2, _0808272C @ =gUnknown_2036E38
+ ldr r2, _0808272C @ =gMapObjects
mov r0, sp
ldrb r1, [r0]
lsls r0, r1, 3
@@ -1614,7 +1614,7 @@ _080826E8:
strh r0, [r4, 0x34]
b _08082736
.align 2, 0
-_0808272C: .4byte gUnknown_2036E38
+_0808272C: .4byte gMapObjects
_08082730: .4byte gSprites
_08082734:
strh r2, [r4, 0x34]
diff --git a/asm/trainer_tower.s b/asm/trainer_tower.s
index e9071a0dd..36b5085b3 100644
--- a/asm/trainer_tower.s
+++ b/asm/trainer_tower.s
@@ -319,7 +319,7 @@ _0815DA0C: .4byte gUnknown_20370C0
thumb_func_start sub_815DA10
sub_815DA10: @ 815DA10
- ldr r1, _0815DA20 @ =gUnknown_825393E
+ ldr r1, _0815DA20 @ =gFacilityClassToTrainerClass
ldr r0, _0815DA24 @ =gUnknown_203F45C
ldr r0, [r0]
adds r0, 0x3D
@@ -328,7 +328,7 @@ sub_815DA10: @ 815DA10
ldrb r0, [r0]
bx lr
.align 2, 0
-_0815DA20: .4byte gUnknown_825393E
+_0815DA20: .4byte gFacilityClassToTrainerClass
_0815DA24: .4byte gUnknown_203F45C
thumb_func_end sub_815DA10
@@ -347,7 +347,7 @@ _0815DA38: .4byte gUnknown_203F45C
thumb_func_start sub_815DA3C
sub_815DA3C: @ 815DA3C
- ldr r1, _0815DA4C @ =gUnknown_82538A8
+ ldr r1, _0815DA4C @ =gFacilityClassToPicIndex
ldr r0, _0815DA50 @ =gUnknown_203F45C
ldr r0, [r0]
adds r0, 0x3D
@@ -356,7 +356,7 @@ sub_815DA3C: @ 815DA3C
ldrb r0, [r0]
bx lr
.align 2, 0
-_0815DA4C: .4byte gUnknown_82538A8
+_0815DA4C: .4byte gFacilityClassToPicIndex
_0815DA50: .4byte gUnknown_203F45C
thumb_func_end sub_815DA3C
@@ -2287,14 +2287,14 @@ sub_815E948: @ 815E948
ldrb r1, [r3, 0x1B]
movs r3, 0
ldr r2, _0815E984 @ =gUnknown_847A074
- ldr r0, _0815E988 @ =gUnknown_825393E
+ ldr r0, _0815E988 @ =gFacilityClassToTrainerClass
adds r1, r0
b _0815E994
.align 2, 0
_0815E97C: .4byte 0x00004001
_0815E980: .4byte gUnknown_203F458
_0815E984: .4byte gUnknown_847A074
-_0815E988: .4byte gUnknown_825393E
+_0815E988: .4byte gFacilityClassToTrainerClass
_0815E98C:
adds r2, 0x4
adds r3, 0x1
diff --git a/asm/unk_810C3A4.s b/asm/unk_810C3A4.s
index a202dc769..e7e825483 100644
--- a/asm/unk_810C3A4.s
+++ b/asm/unk_810C3A4.s
@@ -44,7 +44,7 @@ _0810C3E2:
cmp r0, 0
bne _0810C41C
movs r4, 0
- ldr r7, _0810C440 @ =gUnknown_2036E38
+ ldr r7, _0810C440 @ =gMapObjects
_0810C3EE:
adds r0, r4, 0
bl sub_810CF04
@@ -85,7 +85,7 @@ _0810C436:
bx r0
.align 2, 0
_0810C43C: .4byte gTasks
-_0810C440: .4byte gUnknown_2036E38
+_0810C440: .4byte gMapObjects
thumb_func_end sub_810C3B8
thumb_func_start sub_810C444
@@ -140,7 +140,7 @@ _0810C47A:
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
- ldr r2, _0810C4E8 @ =gUnknown_2036E38
+ ldr r2, _0810C4E8 @ =gMapObjects
adds r4, r1, r2
bl sub_810CF04
lsls r0, 24
@@ -171,7 +171,7 @@ _0810C4D2:
.align 2, 0
_0810C4E0: .4byte gSaveBlock1Ptr
_0810C4E4: .4byte gMapHeader
-_0810C4E8: .4byte gUnknown_2036E38
+_0810C4E8: .4byte gMapObjects
thumb_func_end sub_810C444
thumb_func_start sub_810C4EC
@@ -269,7 +269,7 @@ _0810C59A:
lsls r0, r5, 3
adds r0, r5
lsls r0, 2
- ldr r1, _0810C5FC @ =gUnknown_2036E38
+ ldr r1, _0810C5FC @ =gMapObjects
adds r4, r0, r1
ldrb r0, [r4, 0x6]
subs r0, 0x4D
@@ -314,7 +314,7 @@ _0810C5EA:
pop {r0}
bx r0
.align 2, 0
-_0810C5FC: .4byte gUnknown_2036E38
+_0810C5FC: .4byte gMapObjects
_0810C600: .4byte gSprites
thumb_func_end sub_810C594
diff --git a/asm/unk_814D5C8.s b/asm/unk_814D5C8.s
index 313bf9f78..b3094ca40 100644
--- a/asm/unk_814D5C8.s
+++ b/asm/unk_814D5C8.s
@@ -2787,13 +2787,13 @@ sub_814EC80: @ 814EC80
adds r6, r0, 0
movs r5, 0
ldr r0, _0814EC94 @ =gUnknown_8EB0ADC
- ldr r4, _0814EC98 @ =gUnknown_201C000
+ ldr r4, _0814EC98 @ =gDecompressionBuffer
adds r1, r4, 0
bl LZ77UnCompWram
b _0814ECCA
.align 2, 0
_0814EC94: .4byte gUnknown_8EB0ADC
-_0814EC98: .4byte gUnknown_201C000
+_0814EC98: .4byte gDecompressionBuffer
_0814EC9C:
lsls r1, r5, 2
movs r2, 0xA2
diff --git a/asm/unk_8159F40.s b/asm/unk_8159F40.s
index d84290a08..a4fb6518c 100644
--- a/asm/unk_8159F40.s
+++ b/asm/unk_8159F40.s
@@ -127,7 +127,7 @@ sub_815A008: @ 815A008
movs r1, 0x7F
mov r9, r1
_0815A02E:
- ldr r2, _0815A1F4 @ =gUnknown_2036E38
+ ldr r2, _0815A1F4 @ =gMapObjects
adds r3, r7, r2
ldrb r0, [r3]
lsls r0, 31
@@ -355,7 +355,7 @@ _0815A1E4:
pop {r0}
bx r0
.align 2, 0
-_0815A1F4: .4byte gUnknown_2036E38
+_0815A1F4: .4byte gMapObjects
thumb_func_end sub_815A008
thumb_func_start sub_815A1F8
@@ -372,7 +372,7 @@ sub_815A1F8: @ 815A1F8
mov r1, sp
movs r0, 0
strh r0, [r1]
- ldr r4, _0815A480 @ =gUnknown_2036E38
+ ldr r4, _0815A480 @ =gMapObjects
ldr r2, _0815A484 @ =0x01000120
mov r0, sp
adds r1, r4, 0
@@ -386,7 +386,7 @@ _0815A224:
lsls r7, r2, 3
adds r5, r7, r2
lsls r5, 2
- ldr r0, _0815A480 @ =gUnknown_2036E38
+ ldr r0, _0815A480 @ =gMapObjects
adds r5, r0
lsls r6, r2, 2
add r6, r12
@@ -663,7 +663,7 @@ _0815A444:
mov r0, r8
add r0, r12
lsls r0, 2
- ldr r1, _0815A480 @ =gUnknown_2036E38
+ ldr r1, _0815A480 @ =gMapObjects
adds r6, r0, r1
movs r2, 0x10
ldrsh r0, [r6, r2]
@@ -684,7 +684,7 @@ _0815A444:
ldrh r0, [r6, 0x12]
b _0815A506
.align 2, 0
-_0815A480: .4byte gUnknown_2036E38
+_0815A480: .4byte gMapObjects
_0815A484: .4byte 0x01000120
_0815A488:
ldrb r4, [r6, 0x1F]
@@ -758,7 +758,7 @@ _0815A508:
bhi _0815A512
b _0815A224
_0815A512:
- ldr r0, _0815A538 @ =gUnknown_2036E38
+ ldr r0, _0815A538 @ =gMapObjects
ldr r1, _0815A53C @ =gSaveBlock1Ptr
ldr r1, [r1]
movs r2, 0xD4
@@ -776,7 +776,7 @@ _0815A512:
pop {r0}
bx r0
.align 2, 0
-_0815A538: .4byte gUnknown_2036E38
+_0815A538: .4byte gMapObjects
_0815A53C: .4byte gSaveBlock1Ptr
thumb_func_end sub_815A1F8
@@ -815,7 +815,7 @@ sub_815A540: @ 815A540
lsls r4, r0, 3
adds r4, r0
lsls r4, 2
- ldr r0, _0815A5B4 @ =gUnknown_2036E38
+ ldr r0, _0815A5B4 @ =gMapObjects
adds r4, r0
movs r0, 0x1
bl SetPlayerAvatarTransitionFlags
@@ -834,7 +834,7 @@ _0815A5A4:
.align 2, 0
_0815A5AC: .4byte gUnknown_203ADFA
_0815A5B0: .4byte gUnknown_2037078
-_0815A5B4: .4byte gUnknown_2036E38
+_0815A5B4: .4byte gMapObjects
_0815A5B8: .4byte gSprites
thumb_func_end sub_815A540
diff --git a/asm/unk_815EDDC.s b/asm/unk_815EDDC.s
index 1f56f8820..07e772bb8 100644
--- a/asm/unk_815EDDC.s
+++ b/asm/unk_815EDDC.s
@@ -98,7 +98,7 @@ sub_815EE6C: @ 815EE6C
ldr r0, [r0]
ldr r2, _0815EE84 @ =0x00000af8
adds r0, r2
- bl sub_804C588
+ bl ApplyNewEncryptionKeyToWord
pop {r0}
bx r0
.align 2, 0
diff --git a/common_syms/load_save.txt b/common_syms/load_save.txt
new file mode 100644
index 000000000..2d3d9b802
--- /dev/null
+++ b/common_syms/load_save.txt
@@ -0,0 +1,4 @@
+gFlashMemoryPresent
+gSaveBlock1Ptr
+gSaveBlock2Ptr
+gPokemonStoragePtr
diff --git a/common_syms/save.txt b/common_syms/save.txt
new file mode 100644
index 000000000..9b77840e0
--- /dev/null
+++ b/common_syms/save.txt
@@ -0,0 +1,12 @@
+gFirstSaveSector
+gPrevSaveCounter
+gLastKnownGoodSector
+gDamagedSaveSectors
+gSaveCounter
+gFastSaveSection
+gUnknown_3005398
+gSaveUnusedVar
+gSaveFileStatus
+gGameContinueCallback
+gRamSaveSectionLocations
+gUnknown_3005420
diff --git a/data/data.s b/data/data.s
index 7f2b474aa..5c81abcac 100644
--- a/data/data.s
+++ b/data/data.s
@@ -79,16 +79,16 @@ gUnknown_8235E6C:: @ 8235E6C
gUnknown_823654C:: @ 823654C
.incbin "baserom.gba", 0x23654C, 0xDC0
-gUnknown_823730C:: @ 823730C
+gMonPaletteTable:: @ 823730C
.incbin "baserom.gba", 0x23730C, 0xE8
gUnknown_82373F4:: @ 82373F4
.incbin "baserom.gba", 0x2373F4, 0xCD8
-gUnknown_82380CC:: @ 82380CC
+gMonShinyPaletteTable:: @ 82380CC
.incbin "baserom.gba", 0x2380CC, 0x1010
-gUnknown_82390DC:: @ 82390DC
+gTrainerFrontAnimsPtrTable:: @ 82390DC
.incbin "baserom.gba", 0x2390DC, 0x250
gUnknown_823932C:: @ 823932C
@@ -100,7 +100,7 @@ gUnknown_823957C:: @ 823957C
gUnknown_8239A1C:: @ 8239A1C
.incbin "baserom.gba", 0x239A1C, 0x558
-gUnknown_8239F74:: @ 8239F74
+gTrainerBackAnimsPtrTable:: @ 8239F74
.incbin "baserom.gba", 0x239F74, 0x18
gUnknown_8239F8C:: @ 8239F8C
@@ -115,13 +115,14 @@ gUnknown_8239FD4:: @ 8239FD4
gUnknown_823A004:: @ 823A004
.incbin "baserom.gba", 0x23A004, 0x4554
-gUnknown_823E558:: @ 823E558
- .incbin "baserom.gba", 0x23E558, 0x570
+gTrainerClassNames:: @ 823E558
+ .include "data/text/trainer_class_names.inc"
+ .align 2, 0
gTrainers:: @ 823EAD8
.incbin "baserom.gba", 0x23EAC8, 0x7418
-gUnknown_8245EE0:: @ 8245EE0
+gSpeciesNames:: @ 8245EE0
.incbin "baserom.gba", 0x245EE0, 0xD05
gUnknown_8246BE5:: @ 8246BE5
@@ -296,10 +297,7 @@ gUnknown_8250B20:: @ 8250B20
.incbin "baserom.gba", 0x250B20, 0xE4
gBattleMoves:: @ 8250C04
- .incbin "baserom.gba", 0x250C04, 0x4
-
-gUnknown_8250C08:: @ 8250C08
- .incbin "baserom.gba", 0x250C08, 0x10B0
+ .incbin "baserom.gba", 0x250C04, 0x10B4
gUnknown_8251CB8:: @ 8251CB8
.incbin "baserom.gba", 0x251CB8, 0x336
@@ -310,31 +308,28 @@ gUnknown_8251FEE:: @ 8251FEE
gUnknown_8252324:: @ 8252324
.incbin "baserom.gba", 0x252324, 0x338
-gUnknown_825265C:: @ 825265C
- .incbin "baserom.gba", 0x25265C, 0x2
-
-gUnknown_825265E:: @ 825265E
- .incbin "baserom.gba", 0x25265E, 0x25E
+gSpindaSpotGraphics:: @ 825265C
+ .incbin "baserom.gba", 0x25265C, 0x260
-gUnknown_82528BC:: @ 82528BC
+gItemEffectTable:: @ 82528BC
.incbin "baserom.gba", 0x2528BC, 0x28C
-gUnknown_8252B48:: @ 8252B48
+gNatureStatTable:: @ 8252B48
.incbin "baserom.gba", 0x252B48, 0x80
-gUnknown_8252BC8:: @ 8252BC8
+gTMHMLearnsets:: @ 8252BC8
.incbin "baserom.gba", 0x252BC8, 0xCE0
-gUnknown_82538A8:: @ 82538A8
+gFacilityClassToPicIndex:: @ 82538A8
.incbin "baserom.gba", 0x2538A8, 0x96
-gUnknown_825393E:: @ 825393E
+gFacilityClassToTrainerClass:: @ 825393E
.incbin "baserom.gba", 0x25393E, 0x96
gUnknown_82539D4:: @ 82539D4
.incbin "baserom.gba", 0x2539D4, 0x110
-gUnknown_8253AE4:: @ 8253AE4
+gExperienceTables:: @ 8253AE4
.incbin "baserom.gba", 0x253AE4, 0xCA0
gBaseStats:: @ 8254784
@@ -343,28 +338,28 @@ gBaseStats:: @ 8254784
gUnknown_8254795:: @ 8254795
.incbin "baserom.gba", 0x254795, 0x4FBF
-gUnknown_8259754:: @ 8259754
+gEvolutionTable:: @ 8259754
.incbin "baserom.gba", 0x259754, 0x4060
-gUnknown_825D7B4:: @ 825D7B4
+gLevelUpLearnsets:: @ 825D7B4
.incbin "baserom.gba", 0x25D7B4, 0x670
-gUnknown_825DE24:: @ 825DE24
+gPokeblockFlavorCompatibilityTable:: @ 825DE24
.incbin "baserom.gba", 0x25DE24, 0x7D
gUnknown_825DEA1:: @ 825DEA1
.incbin "baserom.gba", 0x25DEA1, 0x4
-gUnknown_825DEA5:: @ 825DEA5
+gPPUpWriteMasks:: @ 825DEA5
.incbin "baserom.gba", 0x25DEA5, 0x4
gUnknown_825DEA9:: @ 825DEA9
.incbin "baserom.gba", 0x25DEA9, 0x4
-gUnknown_825DEAD:: @ 825DEAD
+gStatStageRatios:: @ 825DEAD
.incbin "baserom.gba", 0x25DEAD, 0x1F
-gUnknown_825DECC:: @ 825DECC
+sHoldEffectToType:: @ 825DECC
.incbin "baserom.gba", 0x25DECC, 0x24
gUnknown_825DEF0:: @ 825DEF0
@@ -373,19 +368,19 @@ gUnknown_825DEF0:: @ 825DEF0
gUnknown_825DF50:: @ 825DF50
.incbin "baserom.gba", 0x25DF50, 0x90
-gUnknown_825DFE0:: @ 825DFE0
+sSecretBaseFacilityClasses:: @ 825DFE0
.incbin "baserom.gba", 0x25DFE0, 0xA
-gUnknown_825DFEA:: @ 825DFEA
+sGetMonDataEVConstants:: @ 825DFEA
.incbin "baserom.gba", 0x25DFEA, 0x6
gUnknown_825DFF0:: @ 825DFF0
.incbin "baserom.gba", 0x25DFF0, 0x6
-gUnknown_825DFF6:: @ 825DFF6
+sFriendshipEventDeltas:: @ 825DFF6
.incbin "baserom.gba", 0x25DFF6, 0x1E
-gUnknown_825E014:: @ 825E014
+sHMMoves:: @ 825E014
.incbin "baserom.gba", 0x25E014, 0x12
gUnknown_825E026:: @ 825E026
diff --git a/data/data_83F5738.s b/data/data_83F5738.s
new file mode 100644
index 000000000..e6f026d0e
--- /dev/null
+++ b/data/data_83F5738.s
@@ -0,0 +1,631 @@
+ .section .rodata
+
+ .align 2
+gUnknown_83F5738:: @ 83F5738
+ .incbin "baserom.gba", 0x3F5738, 0xCC
+
+gUnknown_83F5804:: @ 83F5804
+ .incbin "baserom.gba", 0x3F5804, 0x20
+
+gUnknown_83F5824:: @ 83F5824
+ .incbin "baserom.gba", 0x3F5824, 0x20
+
+gUnknown_83F5844:: @ 83F5844
+ .incbin "baserom.gba", 0x3F5844, 0x10
+
+gUnknown_83F5854:: @ 83F5854
+ .incbin "baserom.gba", 0x3F5854, 0x10
+
+gUnknown_83F5864:: @ 83F5864
+ .incbin "baserom.gba", 0x3F5864, 0x1E0
+
+gUnknown_83F5A44:: @ 83F5A44
+ .incbin "baserom.gba", 0x3F5A44, 0xB4
+
+gUnknown_83F5AF8:: @ 83F5AF8
+ .incbin "baserom.gba", 0x3F5AF8, 0x22
+
+gUnknown_83F5B1A:: @ 83F5B1A
+ .incbin "baserom.gba", 0x3F5B1A, 0x16
+
+gUnknown_83F5B30:: @ 83F5B30
+ .incbin "baserom.gba", 0x3F5B30, 0xC
+
+gUnknown_83F5B3C:: @ 83F5B3C
+ .incbin "baserom.gba", 0x3F5B3C, 0x8
+
+gUnknown_83F5B44:: @ 83F5B44
+ .incbin "baserom.gba", 0x3F5B44, 0x50
+
+gUnknown_83F5B94:: @ 83F5B94
+ .incbin "baserom.gba", 0x3F5B94, 0x12
+
+gUnknown_83F5BA6:: @ 83F5BA6
+ .incbin "baserom.gba", 0x3F5BA6, 0x12
+
+gUnknown_83F5BB8:: @ 83F5BB8
+ .incbin "baserom.gba", 0x3F5BB8, 0x9
+
+gUnknown_83F5BC1:: @ 83F5BC1
+ .incbin "baserom.gba", 0x3F5BC1, 0xB
+
+gUnknown_83F5BCC:: @ 83F5BCC
+ .incbin "baserom.gba", 0x3F5BCC, 0x150
+
+gUnknown_83F5D1C:: @ 83F5D1C
+ .incbin "baserom.gba", 0x3F5D1C, 0x10
+
+gUnknown_83F5D2C:: @ 83F5D2C
+ .incbin "baserom.gba", 0x3F5D2C, 0x6
+
+gUnknown_83F5D32:: @ 83F5D32
+ .incbin "baserom.gba", 0x3F5D32, 0x26
+
+gUnknown_83F5D58:: @ 83F5D58
+ .incbin "baserom.gba", 0x3F5D58, 0x198
+
+ .align 2
+gUnknown_83F5EF0:: @ 83F5EF0
+ .asciz "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/scr_tool.c"
+
+ .align 2
+gUnknown_83F5F24:: @ 83F5F24
+ .asciz "0"
+
+gUnknown_83F5F26:: @ 83F5F26
+ .incbin "baserom.gba", 0x3F5F26, 0x2A
+
+gUnknown_83F5F50:: @ 83F5F50
+ .incbin "baserom.gba", 0x3F5F50, 0x160
+
+gUnknown_83F60B0:: @ 83F60B0
+ .incbin "baserom.gba", 0x3F60B0, 0x20
+
+gUnknown_83F60D0:: @ 83F60D0
+ .incbin "baserom.gba", 0x3F60D0, 0x100
+
+gUnknown_83F61D0:: @ 83F61D0
+ .incbin "baserom.gba", 0x3F61D0, 0x20
+
+gUnknown_83F61F0:: @ 83F61F0
+ .incbin "baserom.gba", 0x3F61F0, 0xB
+
+gUnknown_83F61FB:: @ 83F61FB
+ .incbin "baserom.gba", 0x3F61FB, 0x8
+
+gUnknown_83F6203:: @ 83F6203
+ .incbin "baserom.gba", 0x3F6203, 0x3
+
+gUnknown_83F6206:: @ 83F6206
+ .incbin "baserom.gba", 0x3F6206, 0x160
+
+gUnknown_83F6366:: @ 83F6366
+ .incbin "baserom.gba", 0x3F6366, 0x16
+
+gUnknown_83F637C:: @ 83F637C
+ .incbin "baserom.gba", 0x3F637C, 0xC
+
+gUnknown_83F6388:: @ 83F6388
+ .incbin "baserom.gba", 0x3F6388, 0xC0
+
+gUnknown_83F6448:: @ 83F6448
+ .incbin "baserom.gba", 0x3F6448, 0x20
+
+gUnknown_83F6468:: @ 83F6468
+ .incbin "baserom.gba", 0x3F6468, 0x800
+
+gUnknown_83F6C68:: @ 83F6C68
+ .incbin "baserom.gba", 0x3F6C68, 0x10
+
+gUnknown_83F6C78:: @ 83F6C78
+ .incbin "baserom.gba", 0x3F6C78, 0x4
+
+gUnknown_83F6C7C:: @ 83F6C7C
+ .incbin "baserom.gba", 0x3F6C7C, 0x8
+
+gUnknown_83F6C84:: @ 83F6C84
+ .incbin "baserom.gba", 0x3F6C84, 0x2C
+
+gUnknown_83F6CB0:: @ 83F6CB0
+ .incbin "baserom.gba", 0x3F6CB0, 0x6F8
+
+gUnknown_83F73A8:: @ 83F73A8
+ .incbin "baserom.gba", 0x3F73A8, 0x4E4
+
+gUnknown_83F788C:: @ 83F788C
+ .incbin "baserom.gba", 0x3F788C, 0x4D4
+
+gUnknown_83F7D60:: @ 83F7D60
+ .incbin "baserom.gba", 0x3F7D60, 0x6A0
+
+gUnknown_83F8400:: @ 83F8400
+ .incbin "baserom.gba", 0x3F8400, 0x40
+
+gUnknown_83F8440:: @ 83F8440
+ .incbin "baserom.gba", 0x3F8440, 0x2D
+
+gUnknown_83F846D:: @ 83F846D
+ .incbin "baserom.gba", 0x3F846D, 0x10
+
+gUnknown_83F847D:: @ 83F847D
+ .incbin "baserom.gba", 0x3F847D, 0x323
+
+gUnknown_83F87A0:: @ 83F87A0
+ .incbin "baserom.gba", 0x3F87A0, 0x580
+
+gUnknown_83F8D20:: @ 83F8D20
+ .incbin "baserom.gba", 0x3F8D20, 0x240
+
+gUnknown_83F8F60:: @ 83F8F60
+ .incbin "baserom.gba", 0x3F8F60, 0x11E0
+
+gUnknown_83FA140:: @ 83FA140
+ .incbin "baserom.gba", 0x3FA140, 0x1E0
+
+gUnknown_83FA320:: @ 83FA320
+ .incbin "baserom.gba", 0x3FA320, 0x48
+
+gUnknown_83FA368:: @ 83FA368
+ .incbin "baserom.gba", 0x3FA368, 0x48
+
+gUnknown_83FA3B0:: @ 83FA3B0
+ .incbin "baserom.gba", 0x3FA3B0, 0x10
+
+gUnknown_83FA3C0:: @ 83FA3C0
+ .incbin "baserom.gba", 0x3FA3C0, 0xC
+
+gUnknown_83FA3CC:: @ 83FA3CC
+ .incbin "baserom.gba", 0x3FA3CC, 0x8
+
+gUnknown_83FA3D4:: @ 83FA3D4
+ .incbin "baserom.gba", 0x3FA3D4, 0x8
+
+gUnknown_83FA3DC:: @ 83FA3DC
+ .incbin "baserom.gba", 0x3FA3DC, 0x18
+
+gUnknown_83FA3F4:: @ 83FA3F4
+ .incbin "baserom.gba", 0x3FA3F4, 0xC
+
+gUnknown_83FA400:: @ 83FA400
+ .incbin "baserom.gba", 0x3FA400, 0x4
+
+gUnknown_83FA404:: @ 83FA404
+ .incbin "baserom.gba", 0x3FA404, 0xA
+
+gUnknown_83FA40E:: @ 83FA40E
+ .incbin "baserom.gba", 0x3FA40E, 0x6
+
+gUnknown_83FA414:: @ 83FA414
+ .incbin "baserom.gba", 0x3FA414, 0x1C
+
+gUnknown_83FA430:: @ 83FA430
+ .incbin "baserom.gba", 0x3FA430, 0x8
+
+gUnknown_83FA438:: @ 83FA438
+ .incbin "baserom.gba", 0x3FA438, 0xC
+
+gUnknown_83FA444:: @ 83FA444
+ .incbin "baserom.gba", 0x3FA444, 0x20
+
+gUnknown_83FA464:: @ 83FA464
+ .incbin "baserom.gba", 0x3FA464, 0x8
+
+gUnknown_83FA46C:: @ 83FA46C
+ .incbin "baserom.gba", 0x3FA46C, 0x28
+
+gUnknown_83FA494:: @ 83FA494
+ .incbin "baserom.gba", 0x3FA494, 0x6
+
+gUnknown_83FA49A:: @ 83FA49A
+ .incbin "baserom.gba", 0x3FA49A, 0x14
+
+gUnknown_83FA4AE:: @ 83FA4AE
+ .incbin "baserom.gba", 0x3FA4AE, 0x16
+
+gUnknown_83FA4C4:: @ 83FA4C4
+ .incbin "baserom.gba", 0x3FA4C4, 0x1C
+
+gUnknown_83FA4E0:: @ 83FA4E0
+ .incbin "baserom.gba", 0x3FA4E0, 0x4
+
+gUnknown_83FA4E4:: @ 83FA4E4
+ .incbin "baserom.gba", 0x3FA4E4, 0x4
+
+gUnknown_83FA4E8:: @ 83FA4E8
+ .incbin "baserom.gba", 0x3FA4E8, 0xC
+
+gUnknown_83FA4F4:: @ 83FA4F4
+ .incbin "baserom.gba", 0x3FA4F4, 0x14
+
+gUnknown_83FA508:: @ 83FA508
+ .incbin "baserom.gba", 0x3FA508, 0xC
+
+gUnknown_83FA514:: @ 83FA514
+ .incbin "baserom.gba", 0x3FA514, 0xC
+
+gUnknown_83FA520:: @ 83FA520
+ .incbin "baserom.gba", 0x3FA520, 0x14
+
+gUnknown_83FA534:: @ 83FA534
+ .incbin "baserom.gba", 0x3FA534, 0x46
+
+gUnknown_83FA57A:: @ 83FA57A
+ .incbin "baserom.gba", 0x3FA57A, 0xE
+
+gUnknown_83FA588:: @ 83FA588
+ .incbin "baserom.gba", 0x3FA588, 0x44
+
+gUnknown_83FA5CC:: @ 83FA5CC
+ .incbin "baserom.gba", 0x3FA5CC, 0x6C
+
+gUnknown_83FA638:: @ 83FA638
+ .incbin "baserom.gba", 0x3FA638, 0x108
+
+gUnknown_83FA740:: @ 83FA740
+ .incbin "baserom.gba", 0x3FA740, 0x14
+
+gUnknown_83FA754:: @ 83FA754
+ .incbin "baserom.gba", 0x3FA754, 0x30
+
+gUnknown_83FA784:: @ 83FA784
+ .incbin "baserom.gba", 0x3FA784, 0x4B0
+
+gUnknown_83FAC34:: @ 83FAC34
+ .incbin "baserom.gba", 0x3FAC34, 0x500
+
+gUnknown_83FB134:: @ 83FB134
+ .incbin "baserom.gba", 0x3FB134, 0xA80
+
+BattleText_MistShroud:: @ 83FBBB4
+ .incbin "baserom.gba", 0x3FBBB4, 0x35
+
+BattleText_GetPumped:: @ 83FBBE9
+ .incbin "baserom.gba", 0x3FBBE9, 0xE43
+
+gText_PkmnsXPreventsSwitching:: @ 83FCA2C
+ .incbin "baserom.gba", 0x3FCA2C, 0x11E
+
+BattleText_Rose:: @ 83FCB4A
+ .incbin "baserom.gba", 0x3FCB4A, 0x20
+
+BattleText_UnknownString3:: @ 83FCB6A
+ .incbin "baserom.gba", 0x3FCB6A, 0x120
+
+gUnknown_83FCC8A:: @ 83FCC8A
+ .incbin "baserom.gba", 0x3FCC8A, 0x5A
+
+gUnknown_83FCCE4:: @ 83FCCE4
+ .incbin "baserom.gba", 0x3FCCE4, 0x14
+
+gUnknown_83FCCF8:: @ 83FCCF8
+ .incbin "baserom.gba", 0x3FCCF8, 0x17
+
+gUnknown_83FCD0F:: @ 83FCD0F
+ .incbin "baserom.gba", 0x3FCD0F, 0x18
+
+gUnknown_83FCD27:: @ 83FCD27
+ .incbin "baserom.gba", 0x3FCD27, 0x1A
+
+gUnknown_83FCD41:: @ 83FCD41
+ .incbin "baserom.gba", 0x3FCD41, 0x25
+
+gUnknown_83FCD66:: @ 83FCD66
+ .incbin "baserom.gba", 0x3FCD66, 0x2C
+
+gUnknown_83FCD92:: @ 83FCD92
+ .incbin "baserom.gba", 0x3FCD92, 0xD
+
+gUnknown_83FCD9F:: @ 83FCD9F
+ .incbin "baserom.gba", 0x3FCD9F, 0x428
+
+gUnknown_83FD1C7:: @ 83FD1C7
+ .incbin "baserom.gba", 0x3FD1C7, 0xBD
+
+gUnknown_83FD284:: @ 83FD284
+ .incbin "baserom.gba", 0x3FD284, 0x13
+
+gUnknown_83FD297:: @ 83FD297
+ .incbin "baserom.gba", 0x3FD297, 0x13
+
+gUnknown_83FD2AA:: @ 83FD2AA
+ .incbin "baserom.gba", 0x3FD2AA, 0x15
+
+gUnknown_83FD2BF:: @ 83FD2BF
+ .incbin "baserom.gba", 0x3FD2BF, 0x1A
+
+gUnknown_83FD2D9:: @ 83FD2D9
+ .incbin "baserom.gba", 0x3FD2D9, 0x34
+
+gUnknown_83FD30D:: @ 83FD30D
+ .incbin "baserom.gba", 0x3FD30D, 0x59
+
+gUnknown_83FD366:: @ 83FD366
+ .incbin "baserom.gba", 0x3FD366, 0x1D
+
+gUnknown_83FD383:: @ 83FD383
+ .incbin "baserom.gba", 0x3FD383, 0x14
+
+gUnknown_83FD397:: @ 83FD397
+ .incbin "baserom.gba", 0x3FD397, 0x1A
+
+gUnknown_83FD3B1:: @ 83FD3B1
+ .incbin "baserom.gba", 0x3FD3B1, 0x16
+
+gUnknown_83FD3C7:: @ 83FD3C7
+ .incbin "baserom.gba", 0x3FD3C7, 0x1D
+
+gUnknown_83FD3E4:: @ 83FD3E4
+ .incbin "baserom.gba", 0x3FD3E4, 0x13
+
+gUnknown_83FD3F7:: @ 83FD3F7
+ .incbin "baserom.gba", 0x3FD3F7, 0x10
+
+gUnknown_83FD407:: @ 83FD407
+ .incbin "baserom.gba", 0x3FD407, 0x17
+
+gUnknown_83FD41E:: @ 83FD41E
+ .incbin "baserom.gba", 0x3FD41E, 0x20
+
+gUnknown_83FD43E:: @ 83FD43E
+ .incbin "baserom.gba", 0x3FD43E, 0x10
+
+gUnknown_83FD44E:: @ 83FD44E
+ .incbin "baserom.gba", 0x3FD44E, 0x10
+
+gUnknown_83FD45E:: @ 83FD45E
+ .incbin "baserom.gba", 0x3FD45E, 0x8
+
+gUnknown_83FD466:: @ 83FD466
+ .incbin "baserom.gba", 0x3FD466, 0xF
+
+gUnknown_83FD475:: @ 83FD475
+ .incbin "baserom.gba", 0x3FD475, 0x8
+
+gUnknown_83FD47D:: @ 83FD47D
+ .incbin "baserom.gba", 0x3FD47D, 0xB
+
+gUnknown_83FD488:: @ 83FD488
+ .incbin "baserom.gba", 0x3FD488, 0xF
+
+gUnknown_83FD497:: @ 83FD497
+ .incbin "baserom.gba", 0x3FD497, 0x1E
+
+gUnknown_83FD4B5:: @ 83FD4B5
+ .incbin "baserom.gba", 0x3FD4B5, 0x18
+
+gUnknown_83FD4CD:: @ 83FD4CD
+ .incbin "baserom.gba", 0x3FD4CD, 0x1E
+
+gUnknown_83FD4EB:: @ 83FD4EB
+ .incbin "baserom.gba", 0x3FD4EB, 0xF
+
+gUnknown_83FD4FA:: @ 83FD4FA
+ .incbin "baserom.gba", 0x3FD4FA, 0x13
+
+gUnknown_83FD50D:: @ 83FD50D
+ .incbin "baserom.gba", 0x3FD50D, 0x15
+
+gUnknown_83FD522:: @ 83FD522
+ .incbin "baserom.gba", 0x3FD522, 0x13
+
+gUnknown_83FD535:: @ 83FD535
+ .incbin "baserom.gba", 0x3FD535, 0x10
+
+gUnknown_83FD545:: @ 83FD545
+ .incbin "baserom.gba", 0x3FD545, 0x10
+
+gUnknown_83FD555:: @ 83FD555
+ .incbin "baserom.gba", 0x3FD555, 0x6
+
+gUnknown_83FD55B:: @ 83FD55B
+ .incbin "baserom.gba", 0x3FD55B, 0x5
+
+gUnknown_83FD560:: @ 83FD560
+ .incbin "baserom.gba", 0x3FD560, 0x4
+
+gUnknown_83FD564:: @ 83FD564
+ .incbin "baserom.gba", 0x3FD564, 0x5
+
+gUnknown_83FD569:: @ 83FD569
+ .incbin "baserom.gba", 0x3FD569, 0x4
+
+gUnknown_83FD56D:: @ 83FD56D
+ .incbin "baserom.gba", 0x3FD56D, 0x5
+
+gUnknown_83FD572:: @ 83FD572
+ .incbin "baserom.gba", 0x3FD572, 0x4
+
+gUnknown_83FD576:: @ 83FD576
+ .incbin "baserom.gba", 0x3FD576, 0x5
+
+gUnknown_83FD57B:: @ 83FD57B
+ .incbin "baserom.gba", 0x3FD57B, 0xB
+
+gUnknown_83FD586:: @ 83FD586
+ .incbin "baserom.gba", 0x3FD586, 0x2
+
+gUnknown_83FD588:: @ 83FD588
+ .incbin "baserom.gba", 0x3FD588, 0x2
+
+gUnknown_83FD58A:: @ 83FD58A
+ .incbin "baserom.gba", 0x3FD58A, 0x2
+
+gUnknown_83FD58C:: @ 83FD58C
+ .incbin "baserom.gba", 0x3FD58C, 0x2
+
+gUnknown_83FD58E:: @ 83FD58E
+ .incbin "baserom.gba", 0x3FD58E, 0x42
+
+gUnknown_83FD5D0:: @ 83FD5D0
+ .incbin "baserom.gba", 0x3FD5D0, 0x6C
+
+gUnknown_83FD63C:: @ 83FD63C
+ .incbin "baserom.gba", 0x3FD63C, 0x1DE
+
+gUnknown_83FD81A:: @ 83FD81A
+ .incbin "baserom.gba", 0x3FD81A, 0xA
+
+gUnknown_83FD824:: @ 83FD824
+ .incbin "baserom.gba", 0x3FD824, 0x7E
+
+gUnknown_83FD8A2:: @ 83FD8A2
+ .incbin "baserom.gba", 0x3FD8A2, 0xD
+
+gUnknown_83FD8AF:: @ 83FD8AF
+ .incbin "baserom.gba", 0x3FD8AF, 0x19D
+
+gUnknown_83FDA4C:: @ 83FDA4C
+ .incbin "baserom.gba", 0x3FDA4C, 0x96
+
+gUnknown_83FDAE2:: @ 83FDAE2
+ .incbin "baserom.gba", 0x3FDAE2, 0xB0
+
+gUnknown_83FDB92:: @ 83FDB92
+ .incbin "baserom.gba", 0x3FDB92, 0x5D
+
+gUnknown_83FDBEF:: @ 83FDBEF
+ .incbin "baserom.gba", 0x3FDBEF, 0x69
+
+gUnknown_83FDC58:: @ 83FDC58
+ .incbin "baserom.gba", 0x3FDC58, 0x3D
+
+gUnknown_83FDC95:: @ 83FDC95
+ .incbin "baserom.gba", 0x3FDC95, 0x3D
+
+gUnknown_83FDCD2:: @ 83FDCD2
+ .incbin "baserom.gba", 0x3FDCD2, 0x51
+
+gUnknown_83FDD23:: @ 83FDD23
+ .incbin "baserom.gba", 0x3FDD23, 0x41
+
+gUnknown_83FDD64:: @ 83FDD64
+ .incbin "baserom.gba", 0x3FDD64, 0x87
+
+gUnknown_83FDDEB:: @ 83FDDEB
+ .incbin "baserom.gba", 0x3FDDEB, 0x151
+
+gUnknown_83FDF3C:: @ 83FDF3C
+ .incbin "baserom.gba", 0x3FDF3C, 0x5D8
+
+gUnknown_83FE514:: @ 83FE514
+ .incbin "baserom.gba", 0x3FE514, 0x150
+
+gUnknown_83FE664:: @ 83FE664
+ .incbin "baserom.gba", 0x3FE664, 0xE
+
+gUnknown_83FE672:: @ 83FE672
+ .incbin "baserom.gba", 0x3FE672, 0x16
+
+gUnknown_83FE688:: @ 83FE688
+ .incbin "baserom.gba", 0x3FE688, 0x2D
+
+gUnknown_83FE6B5:: @ 83FE6B5
+ .incbin "baserom.gba", 0x3FE6B5, 0x1B
+
+gUnknown_83FE6D0:: @ 83FE6D0
+ .incbin "baserom.gba", 0x3FE6D0, 0x5
+
+gUnknown_83FE6D5:: @ 83FE6D5
+ .incbin "baserom.gba", 0x3FE6D5, 0x11
+
+gUnknown_83FE6E6:: @ 83FE6E6
+ .incbin "baserom.gba", 0x3FE6E6, 0x14
+
+gUnknown_83FE6FA:: @ 83FE6FA
+ .incbin "baserom.gba", 0x3FE6FA, 0x1A
+
+gUnknown_83FE714:: @ 83FE714
+ .incbin "baserom.gba", 0x3FE714, 0x11
+
+gUnknown_83FE725:: @ 83FE725
+ .incbin "baserom.gba", 0x3FE725, 0x22
+
+gUnknown_83FE747:: @ 83FE747
+ .incbin "baserom.gba", 0x3FE747, 0x1F
+
+gUnknown_83FE766:: @ 83FE766
+ .incbin "baserom.gba", 0x3FE766, 0x4
+
+gUnknown_83FE76A:: @ 83FE76A
+ .incbin "baserom.gba", 0x3FE76A, 0x6
+
+gUnknown_83FE770:: @ 83FE770
+ .incbin "baserom.gba", 0x3FE770, 0x21
+
+gUnknown_83FE791:: @ 83FE791
+ .incbin "baserom.gba", 0x3FE791, 0xF
+
+gUnknown_83FE7A0:: @ 83FE7A0
+ .incbin "baserom.gba", 0x3FE7A0, 0x6C
+
+gUnknown_83FE80C:: @ 83FE80C
+ .incbin "baserom.gba", 0x3FE80C, 0x10
+
+gUnknown_83FE81C:: @ 83FE81C
+ .incbin "baserom.gba", 0x3FE81C, 0x3D
+
+gUnknown_83FE859:: @ 83FE859
+ .incbin "baserom.gba", 0x3FE859, 0x3
+
+gUnknown_83FE85C:: @ 83FE85C
+ .incbin "baserom.gba", 0x3FE85C, 0x2
+
+gUnknown_83FE85E:: @ 83FE85E
+ .incbin "baserom.gba", 0x3FE85E, 0x2
+
+gUnknown_83FE860:: @ 83FE860
+ .incbin "baserom.gba", 0x3FE860, 0x4
+
+gUnknown_83FE864:: @ 83FE864
+ .incbin "baserom.gba", 0x3FE864, 0x4
+
+gText_BadEgg:: @ 83FE868
+ .incbin "baserom.gba", 0x3FE868, 0xC
+
+gUnknown_83FE874:: @ 83FE874
+ .incbin "baserom.gba", 0x3FE874, 0x7
+
+gUnknown_83FE87B:: @ 83FE87B
+ .incbin "baserom.gba", 0x3FE87B, 0x8
+
+gUnknown_83FE883:: @ 83FE883
+ .incbin "baserom.gba", 0x3FE883, 0x8
+
+gUnknown_83FE88B:: @ 83FE88B
+ .incbin "baserom.gba", 0x3FE88B, 0x4
+
+gUnknown_83FE88F:: @ 83FE88F
+ .incbin "baserom.gba", 0x3FE88F, 0xF3
+
+gUnknown_83FE982:: @ 83FE982
+ .incbin "baserom.gba", 0x3FE982, 0x16
+
+gUnknown_83FE998:: @ 83FE998
+ .incbin "baserom.gba", 0x3FE998, 0x2C
+
+gUnknown_83FE9C4:: @ 83FE9C4
+ .incbin "baserom.gba", 0x3FE9C4, 0x10
+
+gUnknown_83FE9D4:: @ 83FE9D4
+ .incbin "baserom.gba", 0x3FE9D4, 0x10
+
+gUnknown_83FE9E4:: @ 83FE9E4
+ .incbin "baserom.gba", 0x3FE9E4, 0x1B
+
+gUnknown_83FE9FF:: @ 83FE9FF
+ .incbin "baserom.gba", 0x3FE9FF, 0x29
+
+gUnknown_83FEA28:: @ 83FEA28
+ .incbin "baserom.gba", 0x3FEA28, 0x48
+
+gUnknown_83FEA70:: @ 83FEA70
+ .incbin "baserom.gba", 0x3FEA70, 0xEC
+
+gUnknown_83FEB5C:: @ 83FEB5C
+ .incbin "baserom.gba", 0x3FEB5C, 0x8
+
+gUnknown_83FEB64:: @ 83FEB64
+ .incbin "baserom.gba", 0x3FEB64, 0x12C
+
+gUnknown_83FEC90:: @ 83FEC90
+ .incbin "baserom.gba", 0x3FEC90, 0x4
diff --git a/data/data_84827AC.s b/data/data_83FECCC.s
index 4f794c658..9f2779061 100644
--- a/data/data_84827AC.s
+++ b/data/data_83FECCC.s
@@ -1,638 +1,6 @@
.section .rodata
.align 2
-gUnknown_83F5738:: @ 83F5738
- .incbin "baserom.gba", 0x3F5738, 0xCC
-
-gUnknown_83F5804:: @ 83F5804
- .incbin "baserom.gba", 0x3F5804, 0x20
-
-gUnknown_83F5824:: @ 83F5824
- .incbin "baserom.gba", 0x3F5824, 0x20
-
-gUnknown_83F5844:: @ 83F5844
- .incbin "baserom.gba", 0x3F5844, 0x10
-
-gUnknown_83F5854:: @ 83F5854
- .incbin "baserom.gba", 0x3F5854, 0x10
-
-gUnknown_83F5864:: @ 83F5864
- .incbin "baserom.gba", 0x3F5864, 0x1E0
-
-gUnknown_83F5A44:: @ 83F5A44
- .incbin "baserom.gba", 0x3F5A44, 0xB4
-
-gUnknown_83F5AF8:: @ 83F5AF8
- .incbin "baserom.gba", 0x3F5AF8, 0x22
-
-gUnknown_83F5B1A:: @ 83F5B1A
- .incbin "baserom.gba", 0x3F5B1A, 0x16
-
-gUnknown_83F5B30:: @ 83F5B30
- .incbin "baserom.gba", 0x3F5B30, 0xC
-
-gUnknown_83F5B3C:: @ 83F5B3C
- .incbin "baserom.gba", 0x3F5B3C, 0x8
-
-gUnknown_83F5B44:: @ 83F5B44
- .incbin "baserom.gba", 0x3F5B44, 0x50
-
-gUnknown_83F5B94:: @ 83F5B94
- .incbin "baserom.gba", 0x3F5B94, 0x12
-
-gUnknown_83F5BA6:: @ 83F5BA6
- .incbin "baserom.gba", 0x3F5BA6, 0x12
-
-gUnknown_83F5BB8:: @ 83F5BB8
- .incbin "baserom.gba", 0x3F5BB8, 0x9
-
-gUnknown_83F5BC1:: @ 83F5BC1
- .incbin "baserom.gba", 0x3F5BC1, 0xB
-
-gUnknown_83F5BCC:: @ 83F5BCC
- .incbin "baserom.gba", 0x3F5BCC, 0x150
-
-gUnknown_83F5D1C:: @ 83F5D1C
- .incbin "baserom.gba", 0x3F5D1C, 0x10
-
-gUnknown_83F5D2C:: @ 83F5D2C
- .incbin "baserom.gba", 0x3F5D2C, 0x6
-
-gUnknown_83F5D32:: @ 83F5D32
- .incbin "baserom.gba", 0x3F5D32, 0x26
-
-gUnknown_83F5D58:: @ 83F5D58
- .incbin "baserom.gba", 0x3F5D58, 0x198
-
- .align 2
-gUnknown_83F5EF0:: @ 83F5EF0
- .asciz "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/scr_tool.c"
-
- .align 2
-gUnknown_83F5F24:: @ 83F5F24
- .asciz "0"
-
-gUnknown_83F5F26:: @ 83F5F26
- .incbin "baserom.gba", 0x3F5F26, 0x2A
-
-gUnknown_83F5F50:: @ 83F5F50
- .incbin "baserom.gba", 0x3F5F50, 0x160
-
-gUnknown_83F60B0:: @ 83F60B0
- .incbin "baserom.gba", 0x3F60B0, 0x20
-
-gUnknown_83F60D0:: @ 83F60D0
- .incbin "baserom.gba", 0x3F60D0, 0x100
-
-gUnknown_83F61D0:: @ 83F61D0
- .incbin "baserom.gba", 0x3F61D0, 0x20
-
-gUnknown_83F61F0:: @ 83F61F0
- .incbin "baserom.gba", 0x3F61F0, 0xB
-
-gUnknown_83F61FB:: @ 83F61FB
- .incbin "baserom.gba", 0x3F61FB, 0x8
-
-gUnknown_83F6203:: @ 83F6203
- .incbin "baserom.gba", 0x3F6203, 0x3
-
-gUnknown_83F6206:: @ 83F6206
- .incbin "baserom.gba", 0x3F6206, 0x160
-
-gUnknown_83F6366:: @ 83F6366
- .incbin "baserom.gba", 0x3F6366, 0x16
-
-gUnknown_83F637C:: @ 83F637C
- .incbin "baserom.gba", 0x3F637C, 0xC
-
-gUnknown_83F6388:: @ 83F6388
- .incbin "baserom.gba", 0x3F6388, 0xC0
-
-gUnknown_83F6448:: @ 83F6448
- .incbin "baserom.gba", 0x3F6448, 0x20
-
-gUnknown_83F6468:: @ 83F6468
- .incbin "baserom.gba", 0x3F6468, 0x800
-
-gUnknown_83F6C68:: @ 83F6C68
- .incbin "baserom.gba", 0x3F6C68, 0x10
-
-gUnknown_83F6C78:: @ 83F6C78
- .incbin "baserom.gba", 0x3F6C78, 0x4
-
-gUnknown_83F6C7C:: @ 83F6C7C
- .incbin "baserom.gba", 0x3F6C7C, 0x8
-
-gUnknown_83F6C84:: @ 83F6C84
- .incbin "baserom.gba", 0x3F6C84, 0x2C
-
-gUnknown_83F6CB0:: @ 83F6CB0
- .incbin "baserom.gba", 0x3F6CB0, 0x6F8
-
-gUnknown_83F73A8:: @ 83F73A8
- .incbin "baserom.gba", 0x3F73A8, 0x4E4
-
-gUnknown_83F788C:: @ 83F788C
- .incbin "baserom.gba", 0x3F788C, 0x4D4
-
-gUnknown_83F7D60:: @ 83F7D60
- .incbin "baserom.gba", 0x3F7D60, 0x6A0
-
-gUnknown_83F8400:: @ 83F8400
- .incbin "baserom.gba", 0x3F8400, 0x40
-
-gUnknown_83F8440:: @ 83F8440
- .incbin "baserom.gba", 0x3F8440, 0x2D
-
-gUnknown_83F846D:: @ 83F846D
- .incbin "baserom.gba", 0x3F846D, 0x10
-
-gUnknown_83F847D:: @ 83F847D
- .incbin "baserom.gba", 0x3F847D, 0x323
-
-gUnknown_83F87A0:: @ 83F87A0
- .incbin "baserom.gba", 0x3F87A0, 0x580
-
-gUnknown_83F8D20:: @ 83F8D20
- .incbin "baserom.gba", 0x3F8D20, 0x240
-
-gUnknown_83F8F60:: @ 83F8F60
- .incbin "baserom.gba", 0x3F8F60, 0x11E0
-
-gUnknown_83FA140:: @ 83FA140
- .incbin "baserom.gba", 0x3FA140, 0x1E0
-
-gUnknown_83FA320:: @ 83FA320
- .incbin "baserom.gba", 0x3FA320, 0x48
-
-gUnknown_83FA368:: @ 83FA368
- .incbin "baserom.gba", 0x3FA368, 0x48
-
-gUnknown_83FA3B0:: @ 83FA3B0
- .incbin "baserom.gba", 0x3FA3B0, 0x10
-
-gUnknown_83FA3C0:: @ 83FA3C0
- .incbin "baserom.gba", 0x3FA3C0, 0xC
-
-gUnknown_83FA3CC:: @ 83FA3CC
- .incbin "baserom.gba", 0x3FA3CC, 0x8
-
-gUnknown_83FA3D4:: @ 83FA3D4
- .incbin "baserom.gba", 0x3FA3D4, 0x8
-
-gUnknown_83FA3DC:: @ 83FA3DC
- .incbin "baserom.gba", 0x3FA3DC, 0x18
-
-gUnknown_83FA3F4:: @ 83FA3F4
- .incbin "baserom.gba", 0x3FA3F4, 0xC
-
-gUnknown_83FA400:: @ 83FA400
- .incbin "baserom.gba", 0x3FA400, 0x4
-
-gUnknown_83FA404:: @ 83FA404
- .incbin "baserom.gba", 0x3FA404, 0xA
-
-gUnknown_83FA40E:: @ 83FA40E
- .incbin "baserom.gba", 0x3FA40E, 0x6
-
-gUnknown_83FA414:: @ 83FA414
- .incbin "baserom.gba", 0x3FA414, 0x1C
-
-gUnknown_83FA430:: @ 83FA430
- .incbin "baserom.gba", 0x3FA430, 0x8
-
-gUnknown_83FA438:: @ 83FA438
- .incbin "baserom.gba", 0x3FA438, 0xC
-
-gUnknown_83FA444:: @ 83FA444
- .incbin "baserom.gba", 0x3FA444, 0x20
-
-gUnknown_83FA464:: @ 83FA464
- .incbin "baserom.gba", 0x3FA464, 0x8
-
-gUnknown_83FA46C:: @ 83FA46C
- .incbin "baserom.gba", 0x3FA46C, 0x28
-
-gUnknown_83FA494:: @ 83FA494
- .incbin "baserom.gba", 0x3FA494, 0x6
-
-gUnknown_83FA49A:: @ 83FA49A
- .incbin "baserom.gba", 0x3FA49A, 0x14
-
-gUnknown_83FA4AE:: @ 83FA4AE
- .incbin "baserom.gba", 0x3FA4AE, 0x16
-
-gUnknown_83FA4C4:: @ 83FA4C4
- .incbin "baserom.gba", 0x3FA4C4, 0x1C
-
-gUnknown_83FA4E0:: @ 83FA4E0
- .incbin "baserom.gba", 0x3FA4E0, 0x4
-
-gUnknown_83FA4E4:: @ 83FA4E4
- .incbin "baserom.gba", 0x3FA4E4, 0x4
-
-gUnknown_83FA4E8:: @ 83FA4E8
- .incbin "baserom.gba", 0x3FA4E8, 0xC
-
-gUnknown_83FA4F4:: @ 83FA4F4
- .incbin "baserom.gba", 0x3FA4F4, 0x14
-
-gUnknown_83FA508:: @ 83FA508
- .incbin "baserom.gba", 0x3FA508, 0xC
-
-gUnknown_83FA514:: @ 83FA514
- .incbin "baserom.gba", 0x3FA514, 0xC
-
-gUnknown_83FA520:: @ 83FA520
- .incbin "baserom.gba", 0x3FA520, 0x14
-
-gUnknown_83FA534:: @ 83FA534
- .incbin "baserom.gba", 0x3FA534, 0x46
-
-gUnknown_83FA57A:: @ 83FA57A
- .incbin "baserom.gba", 0x3FA57A, 0xE
-
-gUnknown_83FA588:: @ 83FA588
- .incbin "baserom.gba", 0x3FA588, 0x44
-
-gUnknown_83FA5CC:: @ 83FA5CC
- .incbin "baserom.gba", 0x3FA5CC, 0x6C
-
-gUnknown_83FA638:: @ 83FA638
- .incbin "baserom.gba", 0x3FA638, 0x108
-
-gUnknown_83FA740:: @ 83FA740
- .incbin "baserom.gba", 0x3FA740, 0x14
-
-gUnknown_83FA754:: @ 83FA754
- .incbin "baserom.gba", 0x3FA754, 0x30
-
-gUnknown_83FA784:: @ 83FA784
- .incbin "baserom.gba", 0x3FA784, 0x4B0
-
-gUnknown_83FAC34:: @ 83FAC34
- .incbin "baserom.gba", 0x3FAC34, 0x500
-
-gUnknown_83FB134:: @ 83FB134
- .incbin "baserom.gba", 0x3FB134, 0xA80
-
-gUnknown_83FBBB4:: @ 83FBBB4
- .incbin "baserom.gba", 0x3FBBB4, 0x35
-
-gUnknown_83FBBE9:: @ 83FBBE9
- .incbin "baserom.gba", 0x3FBBE9, 0xE43
-
-gUnknown_83FCA2C:: @ 83FCA2C
- .incbin "baserom.gba", 0x3FCA2C, 0x11E
-
-gUnknown_83FCB4A:: @ 83FCB4A
- .incbin "baserom.gba", 0x3FCB4A, 0x20
-
-gUnknown_83FCB6A:: @ 83FCB6A
- .incbin "baserom.gba", 0x3FCB6A, 0x120
-
-gUnknown_83FCC8A:: @ 83FCC8A
- .incbin "baserom.gba", 0x3FCC8A, 0x5A
-
-gUnknown_83FCCE4:: @ 83FCCE4
- .incbin "baserom.gba", 0x3FCCE4, 0x14
-
-gUnknown_83FCCF8:: @ 83FCCF8
- .incbin "baserom.gba", 0x3FCCF8, 0x17
-
-gUnknown_83FCD0F:: @ 83FCD0F
- .incbin "baserom.gba", 0x3FCD0F, 0x18
-
-gUnknown_83FCD27:: @ 83FCD27
- .incbin "baserom.gba", 0x3FCD27, 0x1A
-
-gUnknown_83FCD41:: @ 83FCD41
- .incbin "baserom.gba", 0x3FCD41, 0x25
-
-gUnknown_83FCD66:: @ 83FCD66
- .incbin "baserom.gba", 0x3FCD66, 0x2C
-
-gUnknown_83FCD92:: @ 83FCD92
- .incbin "baserom.gba", 0x3FCD92, 0xD
-
-gUnknown_83FCD9F:: @ 83FCD9F
- .incbin "baserom.gba", 0x3FCD9F, 0x428
-
-gUnknown_83FD1C7:: @ 83FD1C7
- .incbin "baserom.gba", 0x3FD1C7, 0xBD
-
-gUnknown_83FD284:: @ 83FD284
- .incbin "baserom.gba", 0x3FD284, 0x13
-
-gUnknown_83FD297:: @ 83FD297
- .incbin "baserom.gba", 0x3FD297, 0x13
-
-gUnknown_83FD2AA:: @ 83FD2AA
- .incbin "baserom.gba", 0x3FD2AA, 0x15
-
-gUnknown_83FD2BF:: @ 83FD2BF
- .incbin "baserom.gba", 0x3FD2BF, 0x1A
-
-gUnknown_83FD2D9:: @ 83FD2D9
- .incbin "baserom.gba", 0x3FD2D9, 0x34
-
-gUnknown_83FD30D:: @ 83FD30D
- .incbin "baserom.gba", 0x3FD30D, 0x59
-
-gUnknown_83FD366:: @ 83FD366
- .incbin "baserom.gba", 0x3FD366, 0x1D
-
-gUnknown_83FD383:: @ 83FD383
- .incbin "baserom.gba", 0x3FD383, 0x14
-
-gUnknown_83FD397:: @ 83FD397
- .incbin "baserom.gba", 0x3FD397, 0x1A
-
-gUnknown_83FD3B1:: @ 83FD3B1
- .incbin "baserom.gba", 0x3FD3B1, 0x16
-
-gUnknown_83FD3C7:: @ 83FD3C7
- .incbin "baserom.gba", 0x3FD3C7, 0x1D
-
-gUnknown_83FD3E4:: @ 83FD3E4
- .incbin "baserom.gba", 0x3FD3E4, 0x13
-
-gUnknown_83FD3F7:: @ 83FD3F7
- .incbin "baserom.gba", 0x3FD3F7, 0x10
-
-gUnknown_83FD407:: @ 83FD407
- .incbin "baserom.gba", 0x3FD407, 0x17
-
-gUnknown_83FD41E:: @ 83FD41E
- .incbin "baserom.gba", 0x3FD41E, 0x20
-
-gUnknown_83FD43E:: @ 83FD43E
- .incbin "baserom.gba", 0x3FD43E, 0x10
-
-gUnknown_83FD44E:: @ 83FD44E
- .incbin "baserom.gba", 0x3FD44E, 0x10
-
-gUnknown_83FD45E:: @ 83FD45E
- .incbin "baserom.gba", 0x3FD45E, 0x8
-
-gUnknown_83FD466:: @ 83FD466
- .incbin "baserom.gba", 0x3FD466, 0xF
-
-gUnknown_83FD475:: @ 83FD475
- .incbin "baserom.gba", 0x3FD475, 0x8
-
-gUnknown_83FD47D:: @ 83FD47D
- .incbin "baserom.gba", 0x3FD47D, 0xB
-
-gUnknown_83FD488:: @ 83FD488
- .incbin "baserom.gba", 0x3FD488, 0xF
-
-gUnknown_83FD497:: @ 83FD497
- .incbin "baserom.gba", 0x3FD497, 0x1E
-
-gUnknown_83FD4B5:: @ 83FD4B5
- .incbin "baserom.gba", 0x3FD4B5, 0x18
-
-gUnknown_83FD4CD:: @ 83FD4CD
- .incbin "baserom.gba", 0x3FD4CD, 0x1E
-
-gUnknown_83FD4EB:: @ 83FD4EB
- .incbin "baserom.gba", 0x3FD4EB, 0xF
-
-gUnknown_83FD4FA:: @ 83FD4FA
- .incbin "baserom.gba", 0x3FD4FA, 0x13
-
-gUnknown_83FD50D:: @ 83FD50D
- .incbin "baserom.gba", 0x3FD50D, 0x15
-
-gUnknown_83FD522:: @ 83FD522
- .incbin "baserom.gba", 0x3FD522, 0x13
-
-gUnknown_83FD535:: @ 83FD535
- .incbin "baserom.gba", 0x3FD535, 0x10
-
-gUnknown_83FD545:: @ 83FD545
- .incbin "baserom.gba", 0x3FD545, 0x10
-
-gUnknown_83FD555:: @ 83FD555
- .incbin "baserom.gba", 0x3FD555, 0x6
-
-gUnknown_83FD55B:: @ 83FD55B
- .incbin "baserom.gba", 0x3FD55B, 0x5
-
-gUnknown_83FD560:: @ 83FD560
- .incbin "baserom.gba", 0x3FD560, 0x4
-
-gUnknown_83FD564:: @ 83FD564
- .incbin "baserom.gba", 0x3FD564, 0x5
-
-gUnknown_83FD569:: @ 83FD569
- .incbin "baserom.gba", 0x3FD569, 0x4
-
-gUnknown_83FD56D:: @ 83FD56D
- .incbin "baserom.gba", 0x3FD56D, 0x5
-
-gUnknown_83FD572:: @ 83FD572
- .incbin "baserom.gba", 0x3FD572, 0x4
-
-gUnknown_83FD576:: @ 83FD576
- .incbin "baserom.gba", 0x3FD576, 0x5
-
-gUnknown_83FD57B:: @ 83FD57B
- .incbin "baserom.gba", 0x3FD57B, 0xB
-
-gUnknown_83FD586:: @ 83FD586
- .incbin "baserom.gba", 0x3FD586, 0x2
-
-gUnknown_83FD588:: @ 83FD588
- .incbin "baserom.gba", 0x3FD588, 0x2
-
-gUnknown_83FD58A:: @ 83FD58A
- .incbin "baserom.gba", 0x3FD58A, 0x2
-
-gUnknown_83FD58C:: @ 83FD58C
- .incbin "baserom.gba", 0x3FD58C, 0x2
-
-gUnknown_83FD58E:: @ 83FD58E
- .incbin "baserom.gba", 0x3FD58E, 0x42
-
-gUnknown_83FD5D0:: @ 83FD5D0
- .incbin "baserom.gba", 0x3FD5D0, 0x6C
-
-gUnknown_83FD63C:: @ 83FD63C
- .incbin "baserom.gba", 0x3FD63C, 0x1DE
-
-gUnknown_83FD81A:: @ 83FD81A
- .incbin "baserom.gba", 0x3FD81A, 0xA
-
-gUnknown_83FD824:: @ 83FD824
- .incbin "baserom.gba", 0x3FD824, 0x7E
-
-gUnknown_83FD8A2:: @ 83FD8A2
- .incbin "baserom.gba", 0x3FD8A2, 0xD
-
-gUnknown_83FD8AF:: @ 83FD8AF
- .incbin "baserom.gba", 0x3FD8AF, 0x19D
-
-gUnknown_83FDA4C:: @ 83FDA4C
- .incbin "baserom.gba", 0x3FDA4C, 0x96
-
-gUnknown_83FDAE2:: @ 83FDAE2
- .incbin "baserom.gba", 0x3FDAE2, 0xB0
-
-gUnknown_83FDB92:: @ 83FDB92
- .incbin "baserom.gba", 0x3FDB92, 0x5D
-
-gUnknown_83FDBEF:: @ 83FDBEF
- .incbin "baserom.gba", 0x3FDBEF, 0x69
-
-gUnknown_83FDC58:: @ 83FDC58
- .incbin "baserom.gba", 0x3FDC58, 0x3D
-
-gUnknown_83FDC95:: @ 83FDC95
- .incbin "baserom.gba", 0x3FDC95, 0x3D
-
-gUnknown_83FDCD2:: @ 83FDCD2
- .incbin "baserom.gba", 0x3FDCD2, 0x51
-
-gUnknown_83FDD23:: @ 83FDD23
- .incbin "baserom.gba", 0x3FDD23, 0x41
-
-gUnknown_83FDD64:: @ 83FDD64
- .incbin "baserom.gba", 0x3FDD64, 0x87
-
-gUnknown_83FDDEB:: @ 83FDDEB
- .incbin "baserom.gba", 0x3FDDEB, 0x151
-
-gUnknown_83FDF3C:: @ 83FDF3C
- .incbin "baserom.gba", 0x3FDF3C, 0x5D8
-
-gUnknown_83FE514:: @ 83FE514
- .incbin "baserom.gba", 0x3FE514, 0x150
-
-gUnknown_83FE664:: @ 83FE664
- .incbin "baserom.gba", 0x3FE664, 0xE
-
-gUnknown_83FE672:: @ 83FE672
- .incbin "baserom.gba", 0x3FE672, 0x16
-
-gUnknown_83FE688:: @ 83FE688
- .incbin "baserom.gba", 0x3FE688, 0x2D
-
-gUnknown_83FE6B5:: @ 83FE6B5
- .incbin "baserom.gba", 0x3FE6B5, 0x1B
-
-gUnknown_83FE6D0:: @ 83FE6D0
- .incbin "baserom.gba", 0x3FE6D0, 0x5
-
-gUnknown_83FE6D5:: @ 83FE6D5
- .incbin "baserom.gba", 0x3FE6D5, 0x11
-
-gUnknown_83FE6E6:: @ 83FE6E6
- .incbin "baserom.gba", 0x3FE6E6, 0x14
-
-gUnknown_83FE6FA:: @ 83FE6FA
- .incbin "baserom.gba", 0x3FE6FA, 0x1A
-
-gUnknown_83FE714:: @ 83FE714
- .incbin "baserom.gba", 0x3FE714, 0x11
-
-gUnknown_83FE725:: @ 83FE725
- .incbin "baserom.gba", 0x3FE725, 0x22
-
-gUnknown_83FE747:: @ 83FE747
- .incbin "baserom.gba", 0x3FE747, 0x1F
-
-gUnknown_83FE766:: @ 83FE766
- .incbin "baserom.gba", 0x3FE766, 0x4
-
-gUnknown_83FE76A:: @ 83FE76A
- .incbin "baserom.gba", 0x3FE76A, 0x6
-
-gUnknown_83FE770:: @ 83FE770
- .incbin "baserom.gba", 0x3FE770, 0x21
-
-gUnknown_83FE791:: @ 83FE791
- .incbin "baserom.gba", 0x3FE791, 0xF
-
-gUnknown_83FE7A0:: @ 83FE7A0
- .incbin "baserom.gba", 0x3FE7A0, 0x6C
-
-gUnknown_83FE80C:: @ 83FE80C
- .incbin "baserom.gba", 0x3FE80C, 0x10
-
-gUnknown_83FE81C:: @ 83FE81C
- .incbin "baserom.gba", 0x3FE81C, 0x3D
-
-gUnknown_83FE859:: @ 83FE859
- .incbin "baserom.gba", 0x3FE859, 0x3
-
-gUnknown_83FE85C:: @ 83FE85C
- .incbin "baserom.gba", 0x3FE85C, 0x2
-
-gUnknown_83FE85E:: @ 83FE85E
- .incbin "baserom.gba", 0x3FE85E, 0x2
-
-gUnknown_83FE860:: @ 83FE860
- .incbin "baserom.gba", 0x3FE860, 0x4
-
-gUnknown_83FE864:: @ 83FE864
- .incbin "baserom.gba", 0x3FE864, 0x4
-
-gUnknown_83FE868:: @ 83FE868
- .incbin "baserom.gba", 0x3FE868, 0xC
-
-gUnknown_83FE874:: @ 83FE874
- .incbin "baserom.gba", 0x3FE874, 0x7
-
-gUnknown_83FE87B:: @ 83FE87B
- .incbin "baserom.gba", 0x3FE87B, 0x8
-
-gUnknown_83FE883:: @ 83FE883
- .incbin "baserom.gba", 0x3FE883, 0x8
-
-gUnknown_83FE88B:: @ 83FE88B
- .incbin "baserom.gba", 0x3FE88B, 0x4
-
-gUnknown_83FE88F:: @ 83FE88F
- .incbin "baserom.gba", 0x3FE88F, 0xF3
-
-gUnknown_83FE982:: @ 83FE982
- .incbin "baserom.gba", 0x3FE982, 0x16
-
-gUnknown_83FE998:: @ 83FE998
- .incbin "baserom.gba", 0x3FE998, 0x2C
-
-gUnknown_83FE9C4:: @ 83FE9C4
- .incbin "baserom.gba", 0x3FE9C4, 0x10
-
-gUnknown_83FE9D4:: @ 83FE9D4
- .incbin "baserom.gba", 0x3FE9D4, 0x10
-
-gUnknown_83FE9E4:: @ 83FE9E4
- .incbin "baserom.gba", 0x3FE9E4, 0x1B
-
-gUnknown_83FE9FF:: @ 83FE9FF
- .incbin "baserom.gba", 0x3FE9FF, 0x29
-
-gUnknown_83FEA28:: @ 83FEA28
- .incbin "baserom.gba", 0x3FEA28, 0x48
-
-gUnknown_83FEA70:: @ 83FEA70
- .incbin "baserom.gba", 0x3FEA70, 0xEC
-
-gUnknown_83FEB5C:: @ 83FEB5C
- .incbin "baserom.gba", 0x3FEB5C, 0x8
-
-gUnknown_83FEB64:: @ 83FEB64
- .incbin "baserom.gba", 0x3FEB64, 0x12C
-
-gUnknown_83FEC90:: @ 83FEC90
- .incbin "baserom.gba", 0x3FEC90, 0x4
-
-gUnknown_83FEC94:: @ 83FEC94
- .incbin "baserom.gba", 0x3FEC94, 0x38
-
gUnknown_83FECCC:: @ 83FECCC
.incbin "baserom.gba", 0x3FECCC, 0x6
@@ -1185,7 +553,7 @@ gExpandedPlaceholder_Red:: @ 8415A58
gExpandedPlaceholder_Green:: @ 8415A5C
.incbin "baserom.gba", 0x415A5C, 0x6
-gUnknown_8415A62:: @ 8415A62
+gText_EggNickname:: @ 8415A62
.incbin "baserom.gba", 0x415A62, 0x4
gUnknown_8415A66:: @ 8415A66
@@ -4998,694 +4366,3 @@ gUnknown_8468B6C:: @ 8468B6C
gUnknown_8468BCC:: @ 8468BCC
.incbin "baserom.gba", 0x468BCC, 0x90
-
- .section .rodata.8468C98
-
-// seagallop.o
- .align 2
-gUnknown_8468C98:: @ 8468C98
- .incbin "baserom.gba", 0x468C98, 0x520
-
-gUnknown_84691B8:: @ 84691B8
- .incbin "baserom.gba", 0x4691B8, 0x20
-
-gUnknown_84691D8:: @ 84691D8
- .incbin "baserom.gba", 0x4691D8, 0x800
-
-gUnknown_84699D8:: @ 84699D8
- .incbin "baserom.gba", 0x4699D8, 0x1520
-
-gUnknown_846AEF8:: @ 846AEF8
- .incbin "baserom.gba", 0x46AEF8, 0x4
-
-gUnknown_846AEFC:: @ 846AEFC
- .incbin "baserom.gba", 0x46AEFC, 0x2C
-
-gUnknown_846AF28:: @ 846AF28
- .incbin "baserom.gba", 0x46AF28, 0x38
-
-gUnknown_846AF60:: @ 846AF60
- .incbin "baserom.gba", 0x46AF60, 0x18
-
-gUnknown_846AF78:: @ 846AF78
- .incbin "baserom.gba", 0x46AF78, 0x18
-
-gUnknown_846AF90:: @ 846AF90
- .incbin "baserom.gba", 0x46AF90, 0x40
-
-gUnknown_846AFD0:: @ 846AFD0
- .incbin "baserom.gba", 0x46AFD0, 0x45C
-
-gUnknown_846B42C:: @ 846B42C
- .incbin "baserom.gba", 0x46B42C, 0x10
-
-gUnknown_846B43C:: @ 846B43C
- .incbin "baserom.gba", 0x46B43C, 0x58
-
-gUnknown_846B494:: @ 846B494
- .incbin "baserom.gba", 0x46B494, 0x18
-
-gUnknown_846B4AC:: @ 846B4AC
- .incbin "baserom.gba", 0x46B4AC, 0x10
-
-gUnknown_846B4BC:: @ 846B4BC
- .incbin "baserom.gba", 0x46B4BC, 0x190
-
-gUnknown_846B64C:: @ 846B64C
- .incbin "baserom.gba", 0x46B64C, 0x24
-
-gUnknown_846B670:: @ 846B670
- .incbin "baserom.gba", 0x46B670, 0x24
-
-gUnknown_846B694:: @ 846B694
- .incbin "baserom.gba", 0x46B694, 0x10
-
-gUnknown_846B6A4:: @ 846B6A4
- .incbin "baserom.gba", 0x46B6A4, 0x8
-
-gUnknown_846B6AC:: @ 846B6AC
- .incbin "baserom.gba", 0x46B6AC, 0x8
-
-gUnknown_846B6B4:: @ 846B6B4
- .incbin "baserom.gba", 0x46B6B4, 0x90
-
-gUnknown_846B744:: @ 846B744
- .incbin "baserom.gba", 0x46B744, 0x18
-
-gUnknown_846B75C:: @ 846B75C
- .incbin "baserom.gba", 0x46B75C, 0x10
-
-gUnknown_846B76C:: @ 846B76C
- .incbin "baserom.gba", 0x46B76C, 0x28
-
-gUnknown_846B794:: @ 846B794
- .incbin "baserom.gba", 0x46B794, 0x20
-
-gUnknown_846B7B4:: @ 846B7B4
- .incbin "baserom.gba", 0x46B7B4, 0x20
-
-gUnknown_846B7D4:: @ 846B7D4
- .incbin "baserom.gba", 0x46B7D4, 0x22C
-
-gUnknown_846BA00:: @ 846BA00
- .incbin "baserom.gba", 0x46BA00, 0x1B0
-
-gUnknown_846BBB0:: @ 846BBB0
- .incbin "baserom.gba", 0x46BBB0, 0x20
-
-gUnknown_846BBD0:: @ 846BBD0
- .incbin "baserom.gba", 0x46BBD0, 0x950
-
-gUnknown_846C520:: @ 846C520
- .incbin "baserom.gba", 0x46C520, 0x3B8
-
-gUnknown_846C8D8:: @ 846C8D8
- .incbin "baserom.gba", 0x46C8D8, 0x20
-
-gUnknown_846C8F8:: @ 846C8F8
- .incbin "baserom.gba", 0x46C8F8, 0xAB0
-
-gUnknown_846D3A8:: @ 846D3A8
- .incbin "baserom.gba", 0x46D3A8, 0x52C
-
-gUnknown_846D8D4:: @ 846D8D4
- .incbin "baserom.gba", 0x46D8D4, 0x10
-
-gUnknown_846D8E4:: @ 846D8E4
- .incbin "baserom.gba", 0x46D8E4, 0x18
-
-gUnknown_846D8FC:: @ 846D8FC
- .incbin "baserom.gba", 0x46D8FC, 0x50
-
-gUnknown_846D94C:: @ 846D94C
- .incbin "baserom.gba", 0x46D94C, 0x4
-
-gUnknown_846D950:: @ 846D950
- .incbin "baserom.gba", 0x46D950, 0x3
-
-gUnknown_846D953:: @ 846D953
- .incbin "baserom.gba", 0x46D953, 0xD
-
-gUnknown_846D960:: @ 846D960
- .incbin "baserom.gba", 0x46D960, 0x8
-
-gUnknown_846D968:: @ 846D968
- .incbin "baserom.gba", 0x46D968, 0x40
-
-gUnknown_846D9A8:: @ 846D9A8
- .incbin "baserom.gba", 0x46D9A8, 0x2C
-
-gUnknown_846D9D4:: @ 846D9D4
- .incbin "baserom.gba", 0x46D9D4, 0x6DC
-
-gUnknown_846E0B0:: @ 846E0B0
- .incbin "baserom.gba", 0x46E0B0, 0x28
-
-gUnknown_846E0D8:: @ 846E0D8
- .incbin "baserom.gba", 0x46E0D8, 0x10
-
-gUnknown_846E0E8:: @ 846E0E8
- .incbin "baserom.gba", 0x46E0E8, 0x18
-
-gUnknown_846E100:: @ 846E100
- .incbin "baserom.gba", 0x46E100, 0x50
-
-gUnknown_846E150:: @ 846E150
- .incbin "baserom.gba", 0x46E150, 0x10
-
-gUnknown_846E160:: @ 846E160
- .incbin "baserom.gba", 0x46E160, 0x154
-
-gUnknown_846E2B4:: @ 846E2B4
- .incbin "baserom.gba", 0x46E2B4, 0x18
-
-gUnknown_846E2CC:: @ 846E2CC
- .incbin "baserom.gba", 0x46E2CC, 0x8
-
-gUnknown_846E2D4:: @ 846E2D4
- .incbin "baserom.gba", 0x46E2D4, 0xC
-
-gUnknown_846E2E0:: @ 846E2E0
- .incbin "baserom.gba", 0x46E2E0, 0x8
-
-gUnknown_846E2E8:: @ 846E2E8
- .incbin "baserom.gba", 0x46E2E8, 0x8
-
-gUnknown_846E2F0:: @ 846E2F0
- .incbin "baserom.gba", 0x46E2F0, 0x24
-
-gUnknown_846E314:: @ 846E314
- .incbin "baserom.gba", 0x46E314, 0x14
-
-gUnknown_846E328:: @ 846E328
- .incbin "baserom.gba", 0x46E328, 0x24
-
-gUnknown_846E34C:: @ 846E34C
- .incbin "baserom.gba", 0x46E34C, 0x68
-
-gUnknown_846E3B4:: @ 846E3B4
- .incbin "baserom.gba", 0x46E3B4, 0x10
-
-gUnknown_846E3C4:: @ 846E3C4
- .incbin "baserom.gba", 0x46E3C4, 0x4
-
-gUnknown_846E3C8:: @ 846E3C8
- .incbin "baserom.gba", 0x46E3C8, 0x4
-
-gUnknown_846E3CC:: @ 846E3CC
- .incbin "baserom.gba", 0x46E3CC, 0x4
-
-gUnknown_846E3D0:: @ 846E3D0
- .incbin "baserom.gba", 0x46E3D0, 0xC
-
-gUnknown_846E3DC:: @ 846E3DC
- .incbin "baserom.gba", 0x46E3DC, 0x3
-
-gUnknown_846E3DF:: @ 846E3DF
- .incbin "baserom.gba", 0x46E3DF, 0x3
-
-gUnknown_846E3E2:: @ 846E3E2
- .incbin "baserom.gba", 0x46E3E2, 0x3
-
-gUnknown_846E3E5:: @ 846E3E5
- .incbin "baserom.gba", 0x46E3E5, 0x6
-
-gUnknown_846E3EB:: @ 846E3EB
- .incbin "baserom.gba", 0x46E3EB, 0x5
-
-gUnknown_846E3F0:: @ 846E3F0
- .incbin "baserom.gba", 0x46E3F0, 0x8
-
-gUnknown_846E3F8:: @ 846E3F8
- .incbin "baserom.gba", 0x46E3F8, 0x50
-
-gUnknown_846E448:: @ 846E448
- .incbin "baserom.gba", 0x46E448, 0x8
-
-gUnknown_846E450:: @ 846E450
- .incbin "baserom.gba", 0x46E450, 0x940
-
-gUnknown_846ED90:: @ 846ED90
- .incbin "baserom.gba", 0x46ED90, 0x130
-
-gUnknown_846EEC0:: @ 846EEC0
- .incbin "baserom.gba", 0x46EEC0, 0x198
-
-gUnknown_846F058:: @ 846F058
- .incbin "baserom.gba", 0x46F058, 0x228
-
-gUnknown_846F280:: @ 846F280
- .incbin "baserom.gba", 0x46F280, 0x14
-
-gUnknown_846F294:: @ 846F294
- .incbin "baserom.gba", 0x46F294, 0x3C
-
-gUnknown_846F2D0:: @ 846F2D0
- .incbin "baserom.gba", 0x46F2D0, 0x1
-
-gUnknown_846F2D1:: @ 846F2D1
- .incbin "baserom.gba", 0x46F2D1, 0x5
-
-gUnknown_846F2D6:: @ 846F2D6
- .incbin "baserom.gba", 0x46F2D6, 0x1
-
-gUnknown_846F2D7:: @ 846F2D7
- .incbin "baserom.gba", 0x46F2D7, 0x15
-
-gUnknown_846F2EC:: @ 846F2EC
- .incbin "baserom.gba", 0x46F2EC, 0xC
-
-gUnknown_846F2F8:: @ 846F2F8
- .incbin "baserom.gba", 0x46F2F8, 0x28
-
-gUnknown_846F320:: @ 846F320
- .incbin "baserom.gba", 0x46F320, 0xF0
-
-gUnknown_846F410:: @ 846F410
- .incbin "baserom.gba", 0x46F410, 0x18
-
-gUnknown_846F428:: @ 846F428
- .incbin "baserom.gba", 0x46F428, 0x18
-
-gUnknown_846F440:: @ 846F440
- .incbin "baserom.gba", 0x46F440, 0x18
-
-gUnknown_846F458:: @ 846F458
- .incbin "baserom.gba", 0x46F458, 0x18
-
-gUnknown_846F470:: @ 846F470
- .incbin "baserom.gba", 0x46F470, 0x18
-
-gUnknown_846F488:: @ 846F488
- .incbin "baserom.gba", 0x46F488, 0x30
-
-gUnknown_846F4B8:: @ 846F4B8
- .incbin "baserom.gba", 0x46F4B8, 0x18
-
-gUnknown_846F4D0:: @ 846F4D0
- .incbin "baserom.gba", 0x46F4D0, 0x200
-
-gUnknown_846F6D0:: @ 846F6D0
- .incbin "baserom.gba", 0x46F6D0, 0x210
-
-gUnknown_846F8E0:: @ 846F8E0
- .incbin "baserom.gba", 0x46F8E0, 0x194
-
-gUnknown_846FA74:: @ 846FA74
- .incbin "baserom.gba", 0x46FA74, 0x8
-
-gUnknown_846FA7C:: @ 846FA7C
- .incbin "baserom.gba", 0x46FA7C, 0x30
-
-gUnknown_846FAAC:: @ 846FAAC
- .incbin "baserom.gba", 0x46FAAC, 0x14
-
-gUnknown_846FAC0:: @ 846FAC0
- .incbin "baserom.gba", 0x46FAC0, 0x48
-
-gUnknown_846FB08:: @ 846FB08
- .incbin "baserom.gba", 0x46FB08, 0x4
-
-gUnknown_846FB0C:: @ 846FB0C
- .incbin "baserom.gba", 0x46FB0C, 0x1000
-
-gUnknown_8470B0C:: @ 8470B0C
- .incbin "baserom.gba", 0x470B0C, 0xF40
-
-gUnknown_8471A4C:: @ 8471A4C
- .incbin "baserom.gba", 0x471A4C, 0x120
-
-gUnknown_8471B6C:: @ 8471B6C
- .incbin "baserom.gba", 0x471B6C, 0x280
-
-gUnknown_8471DEC:: @ 8471DEC
- .incbin "baserom.gba", 0x471DEC, 0xA0
-
-gUnknown_8471E8C:: @ 8471E8C
- .incbin "baserom.gba", 0x471E8C, 0x50
-
-gUnknown_8471EDC:: @ 8471EDC
- .incbin "baserom.gba", 0x471EDC, 0x74
-
-gUnknown_8471F50:: @ 8471F50
- .incbin "baserom.gba", 0x471F50, 0x113
-
-gUnknown_8472063:: @ 8472063
- .incbin "baserom.gba", 0x472063, 0x4B
-
-gUnknown_84720AE:: @ 84720AE
- .incbin "baserom.gba", 0x4720AE, 0x4E
-
-gUnknown_84720FC:: @ 84720FC
- .incbin "baserom.gba", 0x4720FC, 0x37
-
-gUnknown_8472133:: @ 8472133
- .incbin "baserom.gba", 0x472133, 0x3409
-
-gUnknown_847553C:: @ 847553C
- .incbin "baserom.gba", 0x47553C, 0xC
-
-gUnknown_8475548:: @ 8475548
- .incbin "baserom.gba", 0x475548, 0x8
-
-gUnknown_8475550:: @ 8475550
- .incbin "baserom.gba", 0x475550, 0x8
-
-gUnknown_8475558:: @ 8475558
- .incbin "baserom.gba", 0x475558, 0x20
-
-gUnknown_8475578:: @ 8475578
- .incbin "baserom.gba", 0x475578, 0x30
-
-gUnknown_84755A8:: @ 84755A8
- .incbin "baserom.gba", 0x4755A8, 0x30
-
-gUnknown_84755D8:: @ 84755D8
- .incbin "baserom.gba", 0x4755D8, 0x8
-
-gUnknown_84755E0:: @ 84755E0
- .incbin "baserom.gba", 0x4755E0, 0x8
-
-gUnknown_84755E8:: @ 84755E8
- .incbin "baserom.gba", 0x4755E8, 0x10
-
-gUnknown_84755F8:: @ 84755F8
- .incbin "baserom.gba", 0x4755F8, 0x4
-
-gUnknown_84755FC:: @ 84755FC
- .incbin "baserom.gba", 0x4755FC, 0x6
-
-gUnknown_8475602:: @ 8475602
- .incbin "baserom.gba", 0x475602, 0x6
-
-gUnknown_8475608:: @ 8475608
- .incbin "baserom.gba", 0x475608, 0x40
-
-gUnknown_8475648:: @ 8475648
- .incbin "baserom.gba", 0x475648, 0x14
-
-gUnknown_847565C:: @ 847565C
- .incbin "baserom.gba", 0x47565C, 0x18
-
-gUnknown_8475674:: @ 8475674
- .incbin "baserom.gba", 0x475674, 0x10
-
-gUnknown_8475684:: @ 8475684
- .incbin "baserom.gba", 0x475684, 0x8
-
-gUnknown_847568C:: @ 847568C
- .incbin "baserom.gba", 0x47568C, 0x10
-
-gUnknown_847569C:: @ 847569C
- .incbin "baserom.gba", 0x47569C, 0x8
-
-gUnknown_84756A4:: @ 84756A4
- .incbin "baserom.gba", 0x4756A4, 0x204
-
-gUnknown_84758A8:: @ 84758A8
- .incbin "baserom.gba", 0x4758A8, 0xC0
-
-gUnknown_8475968:: @ 8475968
- .incbin "baserom.gba", 0x475968, 0x1D4
-
-gUnknown_8475B3C:: @ 8475B3C
- .incbin "baserom.gba", 0x475B3C, 0x890
-
-gUnknown_84763CC:: @ 84763CC
- .incbin "baserom.gba", 0x4763CC, 0xDCC
-
-gUnknown_8477198:: @ 8477198
- .incbin "baserom.gba", 0x477198, 0x94
-
-gUnknown_847722C:: @ 847722C
- .incbin "baserom.gba", 0x47722C, 0x148
-
-gUnknown_8477374:: @ 8477374
- .incbin "baserom.gba", 0x477374, 0x121C
-
-gUnknown_8478590:: @ 8478590
- .incbin "baserom.gba", 0x478590, 0x26C
-
-gUnknown_84787FC:: @ 84787FC
- .incbin "baserom.gba", 0x4787FC, 0x250
-
-gUnknown_8478A4C:: @ 8478A4C
- .incbin "baserom.gba", 0x478A4C, 0x24C
-
-gUnknown_8478C98:: @ 8478C98
- .incbin "baserom.gba", 0x478C98, 0x48
-
-gUnknown_8478CE0:: @ 8478CE0
- .incbin "baserom.gba", 0x478CE0, 0xB0
-
-gUnknown_8478D90:: @ 8478D90
- .incbin "baserom.gba", 0x478D90, 0x8
-
-gUnknown_8478D98:: @ 8478D98
- .incbin "baserom.gba", 0x478D98, 0x8
-
-gUnknown_8478DA0:: @ 8478DA0
- .incbin "baserom.gba", 0x478DA0, 0x8
-
-gUnknown_8478DA8:: @ 8478DA8
- .incbin "baserom.gba", 0x478DA8, 0x24
-
-gUnknown_8478DCC:: @ 8478DCC
- .incbin "baserom.gba", 0x478DCC, 0x8
-
-gUnknown_8478DD4:: @ 8478DD4
- .incbin "baserom.gba", 0x478DD4, 0x8
-
-gUnknown_8478DDC:: @ 8478DDC
- .incbin "baserom.gba", 0x478DDC, 0x18
-
-gUnknown_8478DF4:: @ 8478DF4
- .incbin "baserom.gba", 0x478DF4, 0x18
-
-gUnknown_8478E0C:: @ 8478E0C
- .incbin "baserom.gba", 0x478E0C, 0x2
-
-gUnknown_8478E0E:: @ 8478E0E
- .incbin "baserom.gba", 0x478E0E, 0xA
-
-gUnknown_8478E18:: @ 8478E18
- .incbin "baserom.gba", 0x478E18, 0x8
-
-gUnknown_8478E20:: @ 8478E20
- .incbin "baserom.gba", 0x478E20, 0x18
-
-gUnknown_8478E38:: @ 8478E38
- .incbin "baserom.gba", 0x478E38, 0x3
-
-gUnknown_8478E3B:: @ 8478E3B
- .incbin "baserom.gba", 0x478E3B, 0x45
-
-gUnknown_8478E80:: @ 8478E80
- .incbin "baserom.gba", 0x478E80, 0x14
-
-gUnknown_8478E94:: @ 8478E94
- .incbin "baserom.gba", 0x478E94, 0x14
-
-gUnknown_8478EA8:: @ 8478EA8
- .incbin "baserom.gba", 0x478EA8, 0x8
-
-gUnknown_8478EB0:: @ 8478EB0
- .incbin "baserom.gba", 0x478EB0, 0xA
-
-gUnknown_8478EBA:: @ 8478EBA
- .incbin "baserom.gba", 0x478EBA, 0xA
-
-gUnknown_8478EC4:: @ 8478EC4
- .incbin "baserom.gba", 0x478EC4, 0x50
-
-gUnknown_8478F14:: @ 8478F14
- .incbin "baserom.gba", 0x478F14, 0x8
-
-gUnknown_8478F1C:: @ 8478F1C
- .incbin "baserom.gba", 0x478F1C, 0x144
-
-gUnknown_8479060:: @ 8479060
- .incbin "baserom.gba", 0x479060, 0x78
-
-gUnknown_84790D8:: @ 84790D8
- .incbin "baserom.gba", 0x4790D8, 0xC0
-
-gUnknown_8479198:: @ 8479198
- .incbin "baserom.gba", 0x479198, 0x10
-
-gUnknown_84791A8:: @ 84791A8
- .incbin "baserom.gba", 0x4791A8, 0x10
-
-gUnknown_84791B8:: @ 84791B8
- .incbin "baserom.gba", 0x4791B8, 0x14
-
-gUnknown_84791CC:: @ 84791CC
- .incbin "baserom.gba", 0x4791CC, 0x1C
-
-gUnknown_84791E8:: @ 84791E8
- .incbin "baserom.gba", 0x4791E8, 0xE8
-
-gUnknown_84792D0:: @ 84792D0
- .incbin "baserom.gba", 0x4792D0, 0x10
-
-gUnknown_84792E0:: @ 84792E0
- .incbin "baserom.gba", 0x4792E0, 0x10
-
-gUnknown_84792F0:: @ 84792F0
- .incbin "baserom.gba", 0x4792F0, 0x50
-
-gUnknown_8479340:: @ 8479340
- .incbin "baserom.gba", 0x479340, 0x28
-
-gUnknown_8479368:: @ 8479368
- .incbin "baserom.gba", 0x479368, 0x18
-
-gUnknown_8479380:: @ 8479380
- .incbin "baserom.gba", 0x479380, 0x10
-
-gUnknown_8479390:: @ 8479390
- .incbin "baserom.gba", 0x479390, 0x1B8
-
-gUnknown_8479548:: @ 8479548
- .incbin "baserom.gba", 0x479548, 0x18
-
-gUnknown_8479560:: @ 8479560
- .incbin "baserom.gba", 0x479560, 0x18
-
-gUnknown_8479578:: @ 8479578
- .incbin "baserom.gba", 0x479578, 0x18
-
-gUnknown_8479590:: @ 8479590
- .incbin "baserom.gba", 0x479590, 0x28
-
-gUnknown_84795B8:: @ 84795B8
- .incbin "baserom.gba", 0x4795B8, 0x10
-
-gUnknown_84795C8:: @ 84795C8
- .incbin "baserom.gba", 0x4795C8, 0x90
-
-gUnknown_8479658:: @ 8479658
- .incbin "baserom.gba", 0x479658, 0x600
-
-gUnknown_8479C58:: @ 8479C58
- .incbin "baserom.gba", 0x479C58, 0x30
-
-gUnknown_8479C88:: @ 8479C88
- .incbin "baserom.gba", 0x479C88, 0x38
-
-gUnknown_8479CC0:: @ 8479CC0
- .incbin "baserom.gba", 0x479CC0, 0x18
-
- .align 2
-gUnknown_8479CD8:: @ 8479CD8
- .asciz "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/cereader_tool.c"
-
- .align 2
-gUnknown_8479D10:: @ 8479D10
- .asciz "ttdata->dummy == 0"
-
- .align 2
-gUnknown_8479D24:: @ 8479D24
- .asciz "ttdata->id == 0"
-
-gUnknown_8479D34:: @ 8479D34
- .incbin "baserom.gba", 0x479D34, 0x4
-
-gUnknown_8479D38:: @ 8479D38
- .incbin "baserom.gba", 0x479D38, 0x8
-
-gUnknown_8479D40:: @ 8479D40
- .incbin "baserom.gba", 0x479D40, 0x8
-
-gUnknown_8479D48:: @ 8479D48
- .incbin "baserom.gba", 0x479D48, 0x190
-
-gUnknown_8479ED8:: @ 8479ED8
- .incbin "baserom.gba", 0x479ED8, 0x14C
-
-gUnknown_847A024:: @ 847A024
- .incbin "baserom.gba", 0x47A024, 0x50
-
-gUnknown_847A074:: @ 847A074
- .incbin "baserom.gba", 0x47A074, 0x1A4
-
-gUnknown_847A218:: @ 847A218
- .incbin "baserom.gba", 0x47A218, 0x14
-
-gUnknown_847A22C:: @ 847A22C
- .incbin "baserom.gba", 0x47A22C, 0x4
-
-gUnknown_847A230:: @ 847A230
- .incbin "baserom.gba", 0x47A230, 0x54
-
-gUnknown_847A284:: @ 847A284
- .incbin "baserom.gba", 0x47A284, 0x30
-
-gUnknown_847A2B4:: @ 847A2B4
- .incbin "baserom.gba", 0x47A2B4, 0x1E
-
-gUnknown_847A2D2:: @ 847A2D2
- .incbin "baserom.gba", 0x47A2D2, 0x1C
-
-gUnknown_847A2EE:: @ 847A2EE
- .incbin "baserom.gba", 0x47A2EE, 0x10
-
-gUnknown_847A2FE:: @ 847A2FE
- .incbin "baserom.gba", 0x47A2FE, 0x10
-
-gUnknown_847A30E:: @ 847A30E
- .incbin "baserom.gba", 0x47A30E, 0x48E
-
-gUnknown_847A79C:: @ 847A79C
- .incbin "baserom.gba", 0x47A79C, 0x8
-
-gUnknown_847A7A4:: @ 847A7A4
- .incbin "baserom.gba", 0x47A7A4, 0xBC
-
-gUnknown_847A860:: @ 847A860
- .incbin "baserom.gba", 0x47A860, 0x18
-
-gUnknown_847A878:: @ 847A878
- .incbin "baserom.gba", 0x47A878, 0x18
-
-gUnknown_847A890:: @ 847A890
- .incbin "baserom.gba", 0x47A890, 0x7F1C
-
-gUnknown_84827AC:: @ 84827AC
- .incbin "baserom.gba", 0x4827AC, 0x8
-
-gUnknown_84827B4:: @ 84827B4
- .incbin "baserom.gba", 0x4827B4, 0x5F34
-
-gUnknown_84886E8:: @ 84886E8
- .incbin "baserom.gba", 0x4886E8, 0x588
-
-gUnknown_8488C70:: @ 8488C70
- .incbin "baserom.gba", 0x488C70, 0x32
-
-gUnknown_8488CA2:: @ 8488CA2
- .incbin "baserom.gba", 0x488CA2, 0x2C
-
-gUnknown_8488CCE:: @ 8488CCE
- .incbin "baserom.gba", 0x488CCE, 0x28
-
-gUnknown_8488CF6:: @ 8488CF6
- .incbin "baserom.gba", 0x488CF6, 0x34
-
-gUnknown_8488D2A:: @ 8488D2A
- .incbin "baserom.gba", 0x488D2A, 0x36
-
-gUnknown_8488D60:: @ 8488D60
- .incbin "baserom.gba", 0x488D60, 0x1C
-
-gUnknown_8488D7C:: @ 8488D7C
- .incbin "baserom.gba", 0x488D7C, 0x12
-
-gUnknown_8488D8E:: @ 8488D8E
- .incbin "baserom.gba", 0x488D8E, 0x2F
-
-gUnknown_8488DBD:: @ 8488DBD
- .incbin "baserom.gba", 0x488DBD, 0x40
-
-gUnknown_8488DFD:: @ 8488DFD
- .incbin "baserom.gba", 0x488DFD, 0xB6B
diff --git a/data/data_8468C98.s b/data/data_8468C98.s
new file mode 100644
index 000000000..26a638f61
--- /dev/null
+++ b/data/data_8468C98.s
@@ -0,0 +1,689 @@
+ .section .rodata
+
+ .align 2
+gUnknown_8468C98:: @ 8468C98
+ .incbin "baserom.gba", 0x468C98, 0x520
+
+gUnknown_84691B8:: @ 84691B8
+ .incbin "baserom.gba", 0x4691B8, 0x20
+
+gUnknown_84691D8:: @ 84691D8
+ .incbin "baserom.gba", 0x4691D8, 0x800
+
+gUnknown_84699D8:: @ 84699D8
+ .incbin "baserom.gba", 0x4699D8, 0x1520
+
+gUnknown_846AEF8:: @ 846AEF8
+ .incbin "baserom.gba", 0x46AEF8, 0x4
+
+gUnknown_846AEFC:: @ 846AEFC
+ .incbin "baserom.gba", 0x46AEFC, 0x2C
+
+gUnknown_846AF28:: @ 846AF28
+ .incbin "baserom.gba", 0x46AF28, 0x38
+
+gUnknown_846AF60:: @ 846AF60
+ .incbin "baserom.gba", 0x46AF60, 0x18
+
+gUnknown_846AF78:: @ 846AF78
+ .incbin "baserom.gba", 0x46AF78, 0x18
+
+gUnknown_846AF90:: @ 846AF90
+ .incbin "baserom.gba", 0x46AF90, 0x40
+
+gUnknown_846AFD0:: @ 846AFD0
+ .incbin "baserom.gba", 0x46AFD0, 0x45C
+
+gUnknown_846B42C:: @ 846B42C
+ .incbin "baserom.gba", 0x46B42C, 0x10
+
+gUnknown_846B43C:: @ 846B43C
+ .incbin "baserom.gba", 0x46B43C, 0x58
+
+gUnknown_846B494:: @ 846B494
+ .incbin "baserom.gba", 0x46B494, 0x18
+
+gUnknown_846B4AC:: @ 846B4AC
+ .incbin "baserom.gba", 0x46B4AC, 0x10
+
+gUnknown_846B4BC:: @ 846B4BC
+ .incbin "baserom.gba", 0x46B4BC, 0x190
+
+gUnknown_846B64C:: @ 846B64C
+ .incbin "baserom.gba", 0x46B64C, 0x24
+
+gUnknown_846B670:: @ 846B670
+ .incbin "baserom.gba", 0x46B670, 0x24
+
+gUnknown_846B694:: @ 846B694
+ .incbin "baserom.gba", 0x46B694, 0x10
+
+gUnknown_846B6A4:: @ 846B6A4
+ .incbin "baserom.gba", 0x46B6A4, 0x8
+
+gUnknown_846B6AC:: @ 846B6AC
+ .incbin "baserom.gba", 0x46B6AC, 0x8
+
+gUnknown_846B6B4:: @ 846B6B4
+ .incbin "baserom.gba", 0x46B6B4, 0x90
+
+gUnknown_846B744:: @ 846B744
+ .incbin "baserom.gba", 0x46B744, 0x18
+
+gUnknown_846B75C:: @ 846B75C
+ .incbin "baserom.gba", 0x46B75C, 0x10
+
+gUnknown_846B76C:: @ 846B76C
+ .incbin "baserom.gba", 0x46B76C, 0x28
+
+gUnknown_846B794:: @ 846B794
+ .incbin "baserom.gba", 0x46B794, 0x20
+
+gUnknown_846B7B4:: @ 846B7B4
+ .incbin "baserom.gba", 0x46B7B4, 0x20
+
+gUnknown_846B7D4:: @ 846B7D4
+ .incbin "baserom.gba", 0x46B7D4, 0x22C
+
+gUnknown_846BA00:: @ 846BA00
+ .incbin "baserom.gba", 0x46BA00, 0x1B0
+
+gUnknown_846BBB0:: @ 846BBB0
+ .incbin "baserom.gba", 0x46BBB0, 0x20
+
+gUnknown_846BBD0:: @ 846BBD0
+ .incbin "baserom.gba", 0x46BBD0, 0x950
+
+gUnknown_846C520:: @ 846C520
+ .incbin "baserom.gba", 0x46C520, 0x3B8
+
+gUnknown_846C8D8:: @ 846C8D8
+ .incbin "baserom.gba", 0x46C8D8, 0x20
+
+gUnknown_846C8F8:: @ 846C8F8
+ .incbin "baserom.gba", 0x46C8F8, 0xAB0
+
+gUnknown_846D3A8:: @ 846D3A8
+ .incbin "baserom.gba", 0x46D3A8, 0x52C
+
+gUnknown_846D8D4:: @ 846D8D4
+ .incbin "baserom.gba", 0x46D8D4, 0x10
+
+gUnknown_846D8E4:: @ 846D8E4
+ .incbin "baserom.gba", 0x46D8E4, 0x18
+
+gUnknown_846D8FC:: @ 846D8FC
+ .incbin "baserom.gba", 0x46D8FC, 0x50
+
+gUnknown_846D94C:: @ 846D94C
+ .incbin "baserom.gba", 0x46D94C, 0x4
+
+gUnknown_846D950:: @ 846D950
+ .incbin "baserom.gba", 0x46D950, 0x3
+
+gUnknown_846D953:: @ 846D953
+ .incbin "baserom.gba", 0x46D953, 0xD
+
+gUnknown_846D960:: @ 846D960
+ .incbin "baserom.gba", 0x46D960, 0x8
+
+gUnknown_846D968:: @ 846D968
+ .incbin "baserom.gba", 0x46D968, 0x40
+
+gUnknown_846D9A8:: @ 846D9A8
+ .incbin "baserom.gba", 0x46D9A8, 0x2C
+
+gUnknown_846D9D4:: @ 846D9D4
+ .incbin "baserom.gba", 0x46D9D4, 0x6DC
+
+gUnknown_846E0B0:: @ 846E0B0
+ .incbin "baserom.gba", 0x46E0B0, 0x28
+
+gUnknown_846E0D8:: @ 846E0D8
+ .incbin "baserom.gba", 0x46E0D8, 0x10
+
+gUnknown_846E0E8:: @ 846E0E8
+ .incbin "baserom.gba", 0x46E0E8, 0x18
+
+gUnknown_846E100:: @ 846E100
+ .incbin "baserom.gba", 0x46E100, 0x50
+
+gUnknown_846E150:: @ 846E150
+ .incbin "baserom.gba", 0x46E150, 0x10
+
+gUnknown_846E160:: @ 846E160
+ .incbin "baserom.gba", 0x46E160, 0x154
+
+gUnknown_846E2B4:: @ 846E2B4
+ .incbin "baserom.gba", 0x46E2B4, 0x18
+
+gUnknown_846E2CC:: @ 846E2CC
+ .incbin "baserom.gba", 0x46E2CC, 0x8
+
+gUnknown_846E2D4:: @ 846E2D4
+ .incbin "baserom.gba", 0x46E2D4, 0xC
+
+gUnknown_846E2E0:: @ 846E2E0
+ .incbin "baserom.gba", 0x46E2E0, 0x8
+
+gUnknown_846E2E8:: @ 846E2E8
+ .incbin "baserom.gba", 0x46E2E8, 0x8
+
+gUnknown_846E2F0:: @ 846E2F0
+ .incbin "baserom.gba", 0x46E2F0, 0x24
+
+gUnknown_846E314:: @ 846E314
+ .incbin "baserom.gba", 0x46E314, 0x14
+
+gUnknown_846E328:: @ 846E328
+ .incbin "baserom.gba", 0x46E328, 0x24
+
+gUnknown_846E34C:: @ 846E34C
+ .incbin "baserom.gba", 0x46E34C, 0x68
+
+gUnknown_846E3B4:: @ 846E3B4
+ .incbin "baserom.gba", 0x46E3B4, 0x10
+
+gUnknown_846E3C4:: @ 846E3C4
+ .incbin "baserom.gba", 0x46E3C4, 0x4
+
+gUnknown_846E3C8:: @ 846E3C8
+ .incbin "baserom.gba", 0x46E3C8, 0x4
+
+gUnknown_846E3CC:: @ 846E3CC
+ .incbin "baserom.gba", 0x46E3CC, 0x4
+
+gUnknown_846E3D0:: @ 846E3D0
+ .incbin "baserom.gba", 0x46E3D0, 0xC
+
+gUnknown_846E3DC:: @ 846E3DC
+ .incbin "baserom.gba", 0x46E3DC, 0x3
+
+gUnknown_846E3DF:: @ 846E3DF
+ .incbin "baserom.gba", 0x46E3DF, 0x3
+
+gUnknown_846E3E2:: @ 846E3E2
+ .incbin "baserom.gba", 0x46E3E2, 0x3
+
+gUnknown_846E3E5:: @ 846E3E5
+ .incbin "baserom.gba", 0x46E3E5, 0x6
+
+gUnknown_846E3EB:: @ 846E3EB
+ .incbin "baserom.gba", 0x46E3EB, 0x5
+
+gUnknown_846E3F0:: @ 846E3F0
+ .incbin "baserom.gba", 0x46E3F0, 0x8
+
+gUnknown_846E3F8:: @ 846E3F8
+ .incbin "baserom.gba", 0x46E3F8, 0x50
+
+gUnknown_846E448:: @ 846E448
+ .incbin "baserom.gba", 0x46E448, 0x8
+
+gUnknown_846E450:: @ 846E450
+ .incbin "baserom.gba", 0x46E450, 0x940
+
+gUnknown_846ED90:: @ 846ED90
+ .incbin "baserom.gba", 0x46ED90, 0x130
+
+gUnknown_846EEC0:: @ 846EEC0
+ .incbin "baserom.gba", 0x46EEC0, 0x198
+
+gUnknown_846F058:: @ 846F058
+ .incbin "baserom.gba", 0x46F058, 0x228
+
+gUnknown_846F280:: @ 846F280
+ .incbin "baserom.gba", 0x46F280, 0x14
+
+gUnknown_846F294:: @ 846F294
+ .incbin "baserom.gba", 0x46F294, 0x3C
+
+gUnknown_846F2D0:: @ 846F2D0
+ .incbin "baserom.gba", 0x46F2D0, 0x1
+
+gUnknown_846F2D1:: @ 846F2D1
+ .incbin "baserom.gba", 0x46F2D1, 0x5
+
+gUnknown_846F2D6:: @ 846F2D6
+ .incbin "baserom.gba", 0x46F2D6, 0x1
+
+gUnknown_846F2D7:: @ 846F2D7
+ .incbin "baserom.gba", 0x46F2D7, 0x15
+
+gUnknown_846F2EC:: @ 846F2EC
+ .incbin "baserom.gba", 0x46F2EC, 0xC
+
+gUnknown_846F2F8:: @ 846F2F8
+ .incbin "baserom.gba", 0x46F2F8, 0x28
+
+gUnknown_846F320:: @ 846F320
+ .incbin "baserom.gba", 0x46F320, 0xF0
+
+gUnknown_846F410:: @ 846F410
+ .incbin "baserom.gba", 0x46F410, 0x18
+
+gUnknown_846F428:: @ 846F428
+ .incbin "baserom.gba", 0x46F428, 0x18
+
+gUnknown_846F440:: @ 846F440
+ .incbin "baserom.gba", 0x46F440, 0x18
+
+gUnknown_846F458:: @ 846F458
+ .incbin "baserom.gba", 0x46F458, 0x18
+
+gUnknown_846F470:: @ 846F470
+ .incbin "baserom.gba", 0x46F470, 0x18
+
+gUnknown_846F488:: @ 846F488
+ .incbin "baserom.gba", 0x46F488, 0x30
+
+gUnknown_846F4B8:: @ 846F4B8
+ .incbin "baserom.gba", 0x46F4B8, 0x18
+
+gUnknown_846F4D0:: @ 846F4D0
+ .incbin "baserom.gba", 0x46F4D0, 0x200
+
+gUnknown_846F6D0:: @ 846F6D0
+ .incbin "baserom.gba", 0x46F6D0, 0x210
+
+gUnknown_846F8E0:: @ 846F8E0
+ .incbin "baserom.gba", 0x46F8E0, 0x194
+
+gUnknown_846FA74:: @ 846FA74
+ .incbin "baserom.gba", 0x46FA74, 0x8
+
+gUnknown_846FA7C:: @ 846FA7C
+ .incbin "baserom.gba", 0x46FA7C, 0x30
+
+gUnknown_846FAAC:: @ 846FAAC
+ .incbin "baserom.gba", 0x46FAAC, 0x14
+
+gUnknown_846FAC0:: @ 846FAC0
+ .incbin "baserom.gba", 0x46FAC0, 0x48
+
+gUnknown_846FB08:: @ 846FB08
+ .incbin "baserom.gba", 0x46FB08, 0x4
+
+gUnknown_846FB0C:: @ 846FB0C
+ .incbin "baserom.gba", 0x46FB0C, 0x1000
+
+gUnknown_8470B0C:: @ 8470B0C
+ .incbin "baserom.gba", 0x470B0C, 0xF40
+
+gUnknown_8471A4C:: @ 8471A4C
+ .incbin "baserom.gba", 0x471A4C, 0x120
+
+gUnknown_8471B6C:: @ 8471B6C
+ .incbin "baserom.gba", 0x471B6C, 0x280
+
+gUnknown_8471DEC:: @ 8471DEC
+ .incbin "baserom.gba", 0x471DEC, 0xA0
+
+gUnknown_8471E8C:: @ 8471E8C
+ .incbin "baserom.gba", 0x471E8C, 0x50
+
+gUnknown_8471EDC:: @ 8471EDC
+ .incbin "baserom.gba", 0x471EDC, 0x74
+
+gUnknown_8471F50:: @ 8471F50
+ .incbin "baserom.gba", 0x471F50, 0x113
+
+gUnknown_8472063:: @ 8472063
+ .incbin "baserom.gba", 0x472063, 0x4B
+
+gUnknown_84720AE:: @ 84720AE
+ .incbin "baserom.gba", 0x4720AE, 0x4E
+
+gUnknown_84720FC:: @ 84720FC
+ .incbin "baserom.gba", 0x4720FC, 0x37
+
+gUnknown_8472133:: @ 8472133
+ .incbin "baserom.gba", 0x472133, 0x3409
+
+gUnknown_847553C:: @ 847553C
+ .incbin "baserom.gba", 0x47553C, 0xC
+
+gUnknown_8475548:: @ 8475548
+ .incbin "baserom.gba", 0x475548, 0x8
+
+gUnknown_8475550:: @ 8475550
+ .incbin "baserom.gba", 0x475550, 0x8
+
+gUnknown_8475558:: @ 8475558
+ .incbin "baserom.gba", 0x475558, 0x20
+
+gUnknown_8475578:: @ 8475578
+ .incbin "baserom.gba", 0x475578, 0x30
+
+gUnknown_84755A8:: @ 84755A8
+ .incbin "baserom.gba", 0x4755A8, 0x30
+
+gUnknown_84755D8:: @ 84755D8
+ .incbin "baserom.gba", 0x4755D8, 0x8
+
+gUnknown_84755E0:: @ 84755E0
+ .incbin "baserom.gba", 0x4755E0, 0x8
+
+gUnknown_84755E8:: @ 84755E8
+ .incbin "baserom.gba", 0x4755E8, 0x10
+
+gUnknown_84755F8:: @ 84755F8
+ .incbin "baserom.gba", 0x4755F8, 0x4
+
+gUnknown_84755FC:: @ 84755FC
+ .incbin "baserom.gba", 0x4755FC, 0x6
+
+gUnknown_8475602:: @ 8475602
+ .incbin "baserom.gba", 0x475602, 0x6
+
+gUnknown_8475608:: @ 8475608
+ .incbin "baserom.gba", 0x475608, 0x40
+
+gUnknown_8475648:: @ 8475648
+ .incbin "baserom.gba", 0x475648, 0x14
+
+gUnknown_847565C:: @ 847565C
+ .incbin "baserom.gba", 0x47565C, 0x18
+
+gUnknown_8475674:: @ 8475674
+ .incbin "baserom.gba", 0x475674, 0x10
+
+gUnknown_8475684:: @ 8475684
+ .incbin "baserom.gba", 0x475684, 0x8
+
+gUnknown_847568C:: @ 847568C
+ .incbin "baserom.gba", 0x47568C, 0x10
+
+gUnknown_847569C:: @ 847569C
+ .incbin "baserom.gba", 0x47569C, 0x8
+
+gUnknown_84756A4:: @ 84756A4
+ .incbin "baserom.gba", 0x4756A4, 0x204
+
+gUnknown_84758A8:: @ 84758A8
+ .incbin "baserom.gba", 0x4758A8, 0xC0
+
+gUnknown_8475968:: @ 8475968
+ .incbin "baserom.gba", 0x475968, 0x1D4
+
+gUnknown_8475B3C:: @ 8475B3C
+ .incbin "baserom.gba", 0x475B3C, 0x890
+
+gUnknown_84763CC:: @ 84763CC
+ .incbin "baserom.gba", 0x4763CC, 0xDCC
+
+gUnknown_8477198:: @ 8477198
+ .incbin "baserom.gba", 0x477198, 0x94
+
+gUnknown_847722C:: @ 847722C
+ .incbin "baserom.gba", 0x47722C, 0x148
+
+gUnknown_8477374:: @ 8477374
+ .incbin "baserom.gba", 0x477374, 0x121C
+
+gUnknown_8478590:: @ 8478590
+ .incbin "baserom.gba", 0x478590, 0x26C
+
+gUnknown_84787FC:: @ 84787FC
+ .incbin "baserom.gba", 0x4787FC, 0x250
+
+gUnknown_8478A4C:: @ 8478A4C
+ .incbin "baserom.gba", 0x478A4C, 0x24C
+
+gUnknown_8478C98:: @ 8478C98
+ .incbin "baserom.gba", 0x478C98, 0x48
+
+gUnknown_8478CE0:: @ 8478CE0
+ .incbin "baserom.gba", 0x478CE0, 0xB0
+
+gUnknown_8478D90:: @ 8478D90
+ .incbin "baserom.gba", 0x478D90, 0x8
+
+gUnknown_8478D98:: @ 8478D98
+ .incbin "baserom.gba", 0x478D98, 0x8
+
+gUnknown_8478DA0:: @ 8478DA0
+ .incbin "baserom.gba", 0x478DA0, 0x8
+
+gUnknown_8478DA8:: @ 8478DA8
+ .incbin "baserom.gba", 0x478DA8, 0x24
+
+gUnknown_8478DCC:: @ 8478DCC
+ .incbin "baserom.gba", 0x478DCC, 0x8
+
+gUnknown_8478DD4:: @ 8478DD4
+ .incbin "baserom.gba", 0x478DD4, 0x8
+
+gUnknown_8478DDC:: @ 8478DDC
+ .incbin "baserom.gba", 0x478DDC, 0x18
+
+gUnknown_8478DF4:: @ 8478DF4
+ .incbin "baserom.gba", 0x478DF4, 0x18
+
+gUnknown_8478E0C:: @ 8478E0C
+ .incbin "baserom.gba", 0x478E0C, 0x2
+
+gUnknown_8478E0E:: @ 8478E0E
+ .incbin "baserom.gba", 0x478E0E, 0xA
+
+gUnknown_8478E18:: @ 8478E18
+ .incbin "baserom.gba", 0x478E18, 0x8
+
+gUnknown_8478E20:: @ 8478E20
+ .incbin "baserom.gba", 0x478E20, 0x18
+
+gUnknown_8478E38:: @ 8478E38
+ .incbin "baserom.gba", 0x478E38, 0x3
+
+gUnknown_8478E3B:: @ 8478E3B
+ .incbin "baserom.gba", 0x478E3B, 0x45
+
+gUnknown_8478E80:: @ 8478E80
+ .incbin "baserom.gba", 0x478E80, 0x14
+
+gUnknown_8478E94:: @ 8478E94
+ .incbin "baserom.gba", 0x478E94, 0x14
+
+gUnknown_8478EA8:: @ 8478EA8
+ .incbin "baserom.gba", 0x478EA8, 0x8
+
+gUnknown_8478EB0:: @ 8478EB0
+ .incbin "baserom.gba", 0x478EB0, 0xA
+
+gUnknown_8478EBA:: @ 8478EBA
+ .incbin "baserom.gba", 0x478EBA, 0xA
+
+gUnknown_8478EC4:: @ 8478EC4
+ .incbin "baserom.gba", 0x478EC4, 0x50
+
+gUnknown_8478F14:: @ 8478F14
+ .incbin "baserom.gba", 0x478F14, 0x8
+
+gUnknown_8478F1C:: @ 8478F1C
+ .incbin "baserom.gba", 0x478F1C, 0x144
+
+gUnknown_8479060:: @ 8479060
+ .incbin "baserom.gba", 0x479060, 0x78
+
+gUnknown_84790D8:: @ 84790D8
+ .incbin "baserom.gba", 0x4790D8, 0xC0
+
+gUnknown_8479198:: @ 8479198
+ .incbin "baserom.gba", 0x479198, 0x10
+
+gUnknown_84791A8:: @ 84791A8
+ .incbin "baserom.gba", 0x4791A8, 0x10
+
+gUnknown_84791B8:: @ 84791B8
+ .incbin "baserom.gba", 0x4791B8, 0x14
+
+gUnknown_84791CC:: @ 84791CC
+ .incbin "baserom.gba", 0x4791CC, 0x1C
+
+gUnknown_84791E8:: @ 84791E8
+ .incbin "baserom.gba", 0x4791E8, 0xE8
+
+gUnknown_84792D0:: @ 84792D0
+ .incbin "baserom.gba", 0x4792D0, 0x10
+
+gUnknown_84792E0:: @ 84792E0
+ .incbin "baserom.gba", 0x4792E0, 0x10
+
+gUnknown_84792F0:: @ 84792F0
+ .incbin "baserom.gba", 0x4792F0, 0x50
+
+gUnknown_8479340:: @ 8479340
+ .incbin "baserom.gba", 0x479340, 0x28
+
+gUnknown_8479368:: @ 8479368
+ .incbin "baserom.gba", 0x479368, 0x18
+
+gUnknown_8479380:: @ 8479380
+ .incbin "baserom.gba", 0x479380, 0x10
+
+gUnknown_8479390:: @ 8479390
+ .incbin "baserom.gba", 0x479390, 0x1B8
+
+gUnknown_8479548:: @ 8479548
+ .incbin "baserom.gba", 0x479548, 0x18
+
+gUnknown_8479560:: @ 8479560
+ .incbin "baserom.gba", 0x479560, 0x18
+
+gUnknown_8479578:: @ 8479578
+ .incbin "baserom.gba", 0x479578, 0x18
+
+gUnknown_8479590:: @ 8479590
+ .incbin "baserom.gba", 0x479590, 0x28
+
+gUnknown_84795B8:: @ 84795B8
+ .incbin "baserom.gba", 0x4795B8, 0x10
+
+gUnknown_84795C8:: @ 84795C8
+ .incbin "baserom.gba", 0x4795C8, 0x90
+
+gUnknown_8479658:: @ 8479658
+ .incbin "baserom.gba", 0x479658, 0x600
+
+gUnknown_8479C58:: @ 8479C58
+ .incbin "baserom.gba", 0x479C58, 0x30
+
+gUnknown_8479C88:: @ 8479C88
+ .incbin "baserom.gba", 0x479C88, 0x38
+
+gUnknown_8479CC0:: @ 8479CC0
+ .incbin "baserom.gba", 0x479CC0, 0x18
+
+ .align 2
+gUnknown_8479CD8:: @ 8479CD8
+ .asciz "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/cereader_tool.c"
+
+ .align 2
+gUnknown_8479D10:: @ 8479D10
+ .asciz "ttdata->dummy == 0"
+
+ .align 2
+gUnknown_8479D24:: @ 8479D24
+ .asciz "ttdata->id == 0"
+
+gUnknown_8479D34:: @ 8479D34
+ .incbin "baserom.gba", 0x479D34, 0x4
+
+gUnknown_8479D38:: @ 8479D38
+ .incbin "baserom.gba", 0x479D38, 0x8
+
+gUnknown_8479D40:: @ 8479D40
+ .incbin "baserom.gba", 0x479D40, 0x8
+
+gUnknown_8479D48:: @ 8479D48
+ .incbin "baserom.gba", 0x479D48, 0x190
+
+gUnknown_8479ED8:: @ 8479ED8
+ .incbin "baserom.gba", 0x479ED8, 0x14C
+
+gUnknown_847A024:: @ 847A024
+ .incbin "baserom.gba", 0x47A024, 0x50
+
+gUnknown_847A074:: @ 847A074
+ .incbin "baserom.gba", 0x47A074, 0x1A4
+
+gUnknown_847A218:: @ 847A218
+ .incbin "baserom.gba", 0x47A218, 0x14
+
+gUnknown_847A22C:: @ 847A22C
+ .incbin "baserom.gba", 0x47A22C, 0x4
+
+gUnknown_847A230:: @ 847A230
+ .incbin "baserom.gba", 0x47A230, 0x54
+
+gUnknown_847A284:: @ 847A284
+ .incbin "baserom.gba", 0x47A284, 0x30
+
+gUnknown_847A2B4:: @ 847A2B4
+ .incbin "baserom.gba", 0x47A2B4, 0x1E
+
+gUnknown_847A2D2:: @ 847A2D2
+ .incbin "baserom.gba", 0x47A2D2, 0x1C
+
+gUnknown_847A2EE:: @ 847A2EE
+ .incbin "baserom.gba", 0x47A2EE, 0x10
+
+gUnknown_847A2FE:: @ 847A2FE
+ .incbin "baserom.gba", 0x47A2FE, 0x10
+
+gUnknown_847A30E:: @ 847A30E
+ .incbin "baserom.gba", 0x47A30E, 0x48E
+
+gUnknown_847A79C:: @ 847A79C
+ .incbin "baserom.gba", 0x47A79C, 0x8
+
+gUnknown_847A7A4:: @ 847A7A4
+ .incbin "baserom.gba", 0x47A7A4, 0xBC
+
+gUnknown_847A860:: @ 847A860
+ .incbin "baserom.gba", 0x47A860, 0x18
+
+gUnknown_847A878:: @ 847A878
+ .incbin "baserom.gba", 0x47A878, 0x18
+
+gUnknown_847A890:: @ 847A890
+ .incbin "baserom.gba", 0x47A890, 0x7F1C
+
+gUnknown_84827AC:: @ 84827AC
+ .incbin "baserom.gba", 0x4827AC, 0x8
+
+gUnknown_84827B4:: @ 84827B4
+ .incbin "baserom.gba", 0x4827B4, 0x5F34
+
+gUnknown_84886E8:: @ 84886E8
+ .incbin "baserom.gba", 0x4886E8, 0x588
+
+gUnknown_8488C70:: @ 8488C70
+ .incbin "baserom.gba", 0x488C70, 0x32
+
+gUnknown_8488CA2:: @ 8488CA2
+ .incbin "baserom.gba", 0x488CA2, 0x2C
+
+gUnknown_8488CCE:: @ 8488CCE
+ .incbin "baserom.gba", 0x488CCE, 0x28
+
+gUnknown_8488CF6:: @ 8488CF6
+ .incbin "baserom.gba", 0x488CF6, 0x34
+
+gUnknown_8488D2A:: @ 8488D2A
+ .incbin "baserom.gba", 0x488D2A, 0x36
+
+gUnknown_8488D60:: @ 8488D60
+ .incbin "baserom.gba", 0x488D60, 0x1C
+
+gUnknown_8488D7C:: @ 8488D7C
+ .incbin "baserom.gba", 0x488D7C, 0x12
+
+gUnknown_8488D8E:: @ 8488D8E
+ .incbin "baserom.gba", 0x488D8E, 0x2F
+
+gUnknown_8488DBD:: @ 8488DBD
+ .incbin "baserom.gba", 0x488DBD, 0x40
+
+gUnknown_8488DFD:: @ 8488DFD
+ .incbin "baserom.gba", 0x488DFD, 0xB6B
diff --git a/data/text/trainer_class_names.inc b/data/text/trainer_class_names.inc
new file mode 100644
index 000000000..3c4955064
--- /dev/null
+++ b/data/text/trainer_class_names.inc
@@ -0,0 +1,107 @@
+ .string "{PKMN} TRAINER$", 13
+ .string "{PKMN} TRAINER$", 13
+ .string "AQUA LEADER$", 13
+ .string "TEAM AQUA$", 13
+ .string "AROMA LADY$", 13
+ .string "RUIN MANIAC$", 13
+ .string "INTERVIEWER$", 13
+ .string "TUBER$", 13
+ .string "TUBER$", 13
+ .string "COOLTRAINER$", 13
+ .string "HEX MANIAC$", 13
+ .string "LADY$", 13
+ .string "BEAUTY$", 13
+ .string "RICH BOY$", 13
+ .string "POKéMANIAC$", 13
+ .string "SWIMMER♂$", 13
+ .string "BLACK BELT$", 13
+ .string "GUITARIST$", 13
+ .string "KINDLER$", 13
+ .string "CAMPER$", 13
+ .string "BUG MANIAC$", 13
+ .string "PSYCHIC$", 13
+ .string "GENTLEMAN$", 13
+ .string "ELITE FOUR$", 13
+ .string "LEADER$", 13
+ .string "SCHOOL KID$", 13
+ .string "SR. AND JR.$", 13
+ .string "POKéFAN$", 13
+ .string "EXPERT$", 13
+ .string "YOUNGSTER$", 13
+ .string "CHAMPION$", 13
+ .string "FISHERMAN$", 13
+ .string "TRIATHLETE$", 13
+ .string "DRAGON TAMER$", 13
+ .string "BIRD KEEPER$", 13
+ .string "NINJA BOY$", 13
+ .string "BATTLE GIRL$", 13
+ .string "PARASOL LADY$", 13
+ .string "SWIMMER♀$", 13
+ .string "PICNICKER$", 13
+ .string "TWINS$", 13
+ .string "SAILOR$", 13
+ .string "BOARDER$", 13
+ .string "COLLECTOR$", 13
+ .string "{PKMN} TRAINER$", 13
+ .string "{PKMN} BREEDER$", 13
+ .string "{PKMN} RANGER$", 13
+ .string "MAGMA LEADER$", 13
+ .string "TEAM MAGMA$", 13
+ .string "LASS$", 13
+ .string "BUG CATCHER$", 13
+ .string "HIKER$", 13
+ .string "YOUNG COUPLE$", 13
+ .string "OLD COUPLE$", 13
+ .string "SIS AND BRO$", 13
+ .string "AQUA ADMIN$", 13
+ .string "MAGMA ADMIN$", 13
+ .string "YOUNGSTER$", 13
+ .string "BUG CATCHER$", 13
+ .string "LASS$", 13
+ .string "SAILOR$", 13
+ .string "CAMPER$", 13
+ .string "PICNICKER$", 13
+ .string "POKéMANIAC$", 13
+ .string "SUPER NERD$", 13
+ .string "HIKER$", 13
+ .string "BIKER$", 13
+ .string "BURGLAR$", 13
+ .string "ENGINEER$", 13
+ .string "FISHERMAN$", 13
+ .string "SWIMMER♂$", 13
+ .string "CUE BALL$", 13
+ .string "GAMER$", 13
+ .string "BEAUTY$", 13
+ .string "SWIMMER♀$", 13
+ .string "PSYCHIC$", 13
+ .string "ROCKER$", 13
+ .string "JUGGLER$", 13
+ .string "TAMER$", 13
+ .string "BIRD KEEPER$", 13
+ .string "BLACK BELT$", 13
+ .string "RIVAL$", 13
+ .string "SCIENTIST$", 13
+ .string "BOSS$", 13
+ .string "LEADER$", 13
+ .string "TEAM ROCKET$", 13
+ .string "COOLTRAINER$", 13
+ .string "ELITE FOUR$", 13
+ .string "GENTLEMAN$", 13
+ .string "RIVAL$", 13
+ .string "CHAMPION$", 13
+ .string "CHANNELER$", 13
+ .string "TWINS$", 13
+ .string "COOL COUPLE$", 13
+ .string "YOUNG COUPLE$", 13
+ .string "CRUSH KIN$", 13
+ .string "SIS AND BRO$", 13
+ .string "{PKMN} PROF.$", 13
+ .string "PLAYER$", 13
+ .string "CRUSH GIRL$", 13
+ .string "TUBER$", 13
+ .string "{PKMN} BREEDER$", 13
+ .string "{PKMN} RANGER$", 13
+ .string "AROMA LADY$", 13
+ .string "RUIN MANIAC$", 13
+ .string "LADY$", 13
+ .string "PAINTER$", 13
diff --git a/include/battle.h b/include/battle.h
index f98b2231a..ee707f78b 100644
--- a/include/battle.h
+++ b/include/battle.h
@@ -28,7 +28,7 @@
#define SIDE_OPPONENT 0x1
#define GET_BANK_IDENTITY(bank)((gBanksByIdentity[bank]))
-#define GET_BANK_SIDE(bank)((GetBankIdentity(bank) & BIT_SIDE))
+#define GET_BANK_SIDE(bank)((GetBattlerPosition(bank) & BIT_SIDE))
#define GET_BANK_SIDE2(bank)((GET_BANK_IDENTITY(bank) & BIT_SIDE))
#define BATTLE_TYPE_DOUBLE 0x0001
@@ -47,7 +47,7 @@
#define BATTLE_TYPE_LEGENDARY 0x2000
#define BATTLE_TYPE_REGI 0x4000
#define BATTLE_TYPE_TWO_OPPONENTS 0x8000
-#define BATTLE_TYPE_DOME 0x10000
+#define BATTLE_TYPE_DOME 0x10000 // this is used in pokemon.c, but its clearly not the correct name for FR/LG. TODO: Fix these
#define BATTLE_TYPE_PALACE 0x20000
#define BATTLE_TYPE_ARENA 0x40000
#define BATTLE_TYPE_FACTORY 0x80000
@@ -210,7 +210,7 @@ struct TrainerMonNoItemDefaultMoves
};
u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg);
-u8 GetBankSide(u8 bank);
+u8 GetBattlerSide(u8 bank);
struct TrainerMonItemDefaultMoves
{
@@ -545,7 +545,7 @@ struct BattleStruct
u8 field_46;
u8 field_47;
u8 focusPunchBank;
- u8 field_49;
+ u8 battlerPreventingSwitchout;
u8 moneyMultiplier;
u8 savedTurnActionNumber;
u8 switchInAbilitiesCounter;
@@ -598,7 +598,7 @@ struct BattleStruct
u8 field_A7;
u16 hpOnSwitchout[2];
u32 savedBattleTypeFlags;
- u8 field_B0;
+ u8 abilityPreventingSwitchout;
u8 hpScale;
u8 synchronizeMoveEffect;
u8 field_B3;
@@ -646,6 +646,9 @@ extern struct BattleStruct* gBattleStruct;
typeArg = gBattleMoves[move].type; \
}
+#define IS_TYPE_PHYSICAL(moveType)(moveType < TYPE_MYSTERY)
+#define IS_TYPE_SPECIAL(moveType)(moveType > TYPE_MYSTERY)
+
#define MOVE_EFFECT_SLEEP 0x1
#define MOVE_EFFECT_POISON 0x2
#define MOVE_EFFECT_BURN 0x3
@@ -847,9 +850,9 @@ enum
};
// rom_80A5C6C
-u8 GetBankSide(u8 bank);
-u8 GetBankIdentity(u8 bank);
-u8 GetBankByIdentity(u8 bank);
+u8 GetBattlerSide(u8 bank);
+u8 GetBattlerPosition(u8 bank);
+u8 GetBattlerAtPosition(u8 bank);
struct BattleSpriteInfo
{
@@ -961,5 +964,17 @@ extern u16 gLastUsedItem;
extern u32 gBattleTypeFlags;
extern struct MonSpritesGfx* gMonSpritesGfxPtr;
extern u16 gTrainerBattleOpponent_A;
+extern u16 gMoveToLearn;
+extern u16 gBattleMovePower;
+extern struct BattleEnigmaBerry gEnigmaBerries[MAX_BATTLERS_COUNT];
+extern u16 gCurrentMove;
+extern u8 gCritMultiplier;
+extern u16 gBattleWeather;
+extern u8 gLastUsedAbility;
+extern u8 gBattlerInMenuId;
+extern u8 gPotentialItemEffectBattler;
+extern u8 gBattlersCount;
+extern u16 gBattlerPartyIndexes[MAX_BATTLERS_COUNT];
+extern s32 gBattleMoveDamage;
#endif // GUARD_BATTLE_H
diff --git a/include/battle_controllers.h b/include/battle_controllers.h
index c69cb1017..66984b453 100644
--- a/include/battle_controllers.h
+++ b/include/battle_controllers.h
@@ -181,7 +181,7 @@ void sub_8033648(void);
void PrepareBufferDataTransferLink(u8 bufferId, u16 size, u8 *data);
// emitters
-void EmitGetMonData(u8 bufferId, u8 requestId, u8 monToCheck);
+void BtlController_EmitGetMonData(u8 bufferId, u8 requestId, u8 monToCheck);
void EmitGetRawMonData(u8 bufferId, u8 monId, u8 bytes); // unused
void EmitSetMonData(u8 bufferId, u8 requestId, u8 monToCheck, u8 bytes, void *data);
void EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data); // unused
diff --git a/include/battle_util.h b/include/battle_util.h
index 81eb85dc7..25e26719b 100644
--- a/include/battle_util.h
+++ b/include/battle_util.h
@@ -30,6 +30,10 @@
#define ABILITYEFFECT_CHECK_ON_FIELD 0x13
#define ABILITYEFFECT_SWITCH_IN_WEATHER 0xFF
+#define ABILITY_ON_OPPOSING_FIELD(battlerId, abilityId)(AbilityBattleEffects(ABILITYEFFECT_CHECK_OTHER_SIDE, battlerId, abilityId, 0, 0))
+#define ABILITY_ON_FIELD(abilityId)(AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, abilityId, 0, 0))
+#define ABILITY_ON_FIELD2(abilityId)(AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, abilityId, 0, 0))
+
#define ITEMEFFECT_ON_SWITCH_IN 0x0
#define WEATHER_HAS_EFFECT ((!AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_CLOUD_NINE, 0, 0) && !AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_AIR_LOCK, 0, 0)))
@@ -80,5 +84,6 @@ void ClearFuryCutterDestinyBondGrudge(u8 bank);
void HandleAction_RunBattleScript(void);
u8 GetMoveTarget(u16 move, u8 useMoveTarget);
u8 IsMonDisobedient(void);
+void MarkBufferBankForExecution(u8 battlerId);
#endif // GUARD_BATTLE_UTIL_H
diff --git a/include/constants/flags.h b/include/constants/flags.h
index ac9730884..ea2d7d8bc 100644
--- a/include/constants/flags.h
+++ b/include/constants/flags.h
@@ -1288,6 +1288,13 @@
#define TRAINERS_FLAG_NO 0x356
#define CODE_FLAGS (FLAG_TRAINER_FLAG_START + TRAINERS_FLAG_NO + 0xA) // 0x860
+// TODO: Find what these are
+#define FLAG_UNK820 0x820
+#define FLAG_UNK824 0x824
+#define FLAG_UNK826 0x826
+
+#define FLAG_UNK843 0x843
+
// SYSTEM FLAGS
// 0x860
diff --git a/include/constants/items.h b/include/constants/items.h
index 6135b8d6f..dd2b4c4ed 100644
--- a/include/constants/items.h
+++ b/include/constants/items.h
@@ -390,4 +390,7 @@
#define NUM_TECHNICAL_MACHINES 50
#define NUM_HIDDEN_MACHINES 8
+// Check if the item is one that can be used on a Pokemon.
+#define IS_POKEMON_ITEM(item) ((item) >= ITEM_POTION && (item) <= ITEM_0B2)
+
#endif // GUARD_CONSTANTS_ITEMS_H
diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h
new file mode 100644
index 000000000..78c1583b4
--- /dev/null
+++ b/include/constants/pokemon.h
@@ -0,0 +1,80 @@
+#ifndef GUARD_CONSTANTS_POKEMON_H
+#define GUARD_CONSTANTS_POKEMON_H
+
+// Pokemon types
+#define TYPE_NORMAL 0x00
+#define TYPE_FIGHTING 0x01
+#define TYPE_FLYING 0x02
+#define TYPE_POISON 0x03
+#define TYPE_GROUND 0x04
+#define TYPE_ROCK 0x05
+#define TYPE_BUG 0x06
+#define TYPE_GHOST 0x07
+#define TYPE_STEEL 0x08
+#define TYPE_MYSTERY 0x09
+#define TYPE_FIRE 0x0a
+#define TYPE_WATER 0x0b
+#define TYPE_GRASS 0x0c
+#define TYPE_ELECTRIC 0x0d
+#define TYPE_PSYCHIC 0x0e
+#define TYPE_ICE 0x0f
+#define TYPE_DRAGON 0x10
+#define TYPE_DARK 0x11
+#define NUMBER_OF_MON_TYPES 0x12
+
+// Pokemon egg groups
+#define EGG_GROUP_NONE 0
+#define EGG_GROUP_MONSTER 1
+#define EGG_GROUP_WATER_1 2
+#define EGG_GROUP_BUG 3
+#define EGG_GROUP_FLYING 4
+#define EGG_GROUP_FIELD 5
+#define EGG_GROUP_FAIRY 6
+#define EGG_GROUP_GRASS 7
+#define EGG_GROUP_HUMAN_LIKE 8
+#define EGG_GROUP_WATER_3 9
+#define EGG_GROUP_MINERAL 10
+#define EGG_GROUP_AMORPHOUS 11
+#define EGG_GROUP_WATER_2 12
+#define EGG_GROUP_DITTO 13
+#define EGG_GROUP_DRAGON 14
+#define EGG_GROUP_UNDISCOVERED 15
+
+// Pokemon natures
+#define NATURE_HARDY 0
+#define NATURE_LONELY 1
+#define NATURE_BRAVE 2
+#define NATURE_ADAMANT 3
+#define NATURE_NAUGHTY 4
+#define NATURE_BOLD 5
+#define NATURE_DOCILE 6
+#define NATURE_RELAXED 7
+#define NATURE_IMPISH 8
+#define NATURE_LAX 9
+#define NATURE_TIMID 10
+#define NATURE_HASTY 11
+#define NATURE_SERIOUS 12
+#define NATURE_JOLLY 13
+#define NATURE_NAIVE 14
+#define NATURE_MODEST 15
+#define NATURE_MILD 16
+#define NATURE_QUIET 17
+#define NATURE_BASHFUL 18
+#define NATURE_RASH 19
+#define NATURE_CALM 20
+#define NATURE_GENTLE 21
+#define NATURE_SASSY 22
+#define NATURE_CAREFUL 23
+#define NATURE_QUIRKY 24
+
+// Pokemon Stats
+#define STAT_HP 0
+#define STAT_ATK 1
+#define STAT_DEF 2
+#define STAT_SPEED 3
+#define STAT_SPATK 4
+#define STAT_SPDEF 5
+#define STAT_ACC 6 // only in battles
+#define STAT_EVASION 7 // only in battles
+
+#endif // GUARD_CONSTANTS_POKEMON_H
diff --git a/include/global.h b/include/global.h
index 11a79ebe8..b05c87d88 100644
--- a/include/global.h
+++ b/include/global.h
@@ -28,9 +28,13 @@ char* strcpy(char *dst0, const char *src0);
// Converts a number to Q4.12 fixed-point format
#define Q_4_12(n) ((s16)((n) * 4096))
+#define POKEMON_SLOTS_NUMBER 412
#define POKEMON_NAME_LENGTH 10
#define OT_NAME_LENGTH 7
+#define min(a, b) ((a) < (b) ? (a) : (b))
+#define max(a, b) ((a) >= (b) ? (a) : (b))
+
// There are many quirks in the source code which have overarching behavioral differences from
// a number of other files. For example, diploma.c seems to declare rodata before each use while
// other files declare out of order and must be at the beginning. There are also a number of
@@ -75,6 +79,12 @@ enum LanguageId {
#define GAME_LANGUAGE (LANGUAGE_ENGLISH)
+#define BAG_ITEMS_COUNT 42
+#define BAG_KEYITEMS_COUNT 30
+#define BAG_POKEBALLS_COUNT 13
+#define BAG_TMHM_COUNT 58
+#define BAG_BERRIES_COUNT 43
+
enum
{
MALE,
@@ -239,6 +249,18 @@ struct SaveBlock2
extern struct SaveBlock2 *gSaveBlock2Ptr;
+#define PARTY_SIZE 6
+
+struct SecretBaseParty
+{
+ u32 personality[PARTY_SIZE];
+ u16 moves[PARTY_SIZE * 4];
+ u16 species[PARTY_SIZE];
+ u16 heldItems[PARTY_SIZE];
+ u8 levels[PARTY_SIZE];
+ u8 EVs[PARTY_SIZE];
+};
+
struct SecretBaseRecord
{
/*0x1A9C*/ u8 secretBaseId;
@@ -246,7 +268,7 @@ struct SecretBaseRecord
/*0x1A9D*/ u8 gender:1;
/*0x1A9D*/ u8 sbr_field_1_5:1;
/*0x1A9D*/ u8 sbr_field_1_6:2;
- /*0x1A9E*/ u8 trainerName[OT_NAME_LENGTH];
+ /*0x1A9E*/ u8 trainerName[7]; // TODO: Change PLAYER_NAME_LENGTH to 7
/*0x1AA5*/ u8 trainerId[4]; // byte 0 is used for determining trainer class
/*0x1AA9*/ u8 language;
/*0x1AAA*/ u16 sbr_field_e;
@@ -254,12 +276,7 @@ struct SecretBaseRecord
/*0x1AAD*/ u8 sbr_field_11;
/*0x1AAE*/ u8 decorations[16];
/*0x1ABE*/ u8 decorationPos[16];
- /*0x1AD0*/ u32 partyPersonality[6];
- /*0x1AE8*/ u16 partyMoves[6 * 4];
- /*0x1B18*/ u16 partySpecies[6];
- /*0x1B24*/ u16 partyHeldItems[6];
- /*0x1B2E*/ u8 partyLevels[6];
- /*0x1B34*/ u8 partyEVs[6];
+ /*0x1AD0*/ struct SecretBaseParty party;
};
#include "constants/game_stat.h"
@@ -482,24 +499,41 @@ struct MysteryEventStruct
struct SaveBlock1
{
- /*0x0000*/ u8 filler[0x4];
+ /*0x0000*/ struct Coords16 pos;
/*0x0004*/ struct WarpData location;
- /*0x0C*/ struct WarpData warp1;
- /*0x14*/ struct WarpData warp2;
- /*0x1C*/ struct WarpData lastHealLocation;
- /*0x24*/ struct WarpData warp4;
- /*0x002C*/ u8 filler2C[0x60C];
- /*0x638*/ u8 trainerRematchStepCounter;
- u8 filler_639;
- /*0x63a*/ u8 trainerRematches[100];
- /*0x06A0*/ struct MapObject mapObjects[MAP_OBJECTS_COUNT];
- /*0x08E0*/ struct MapObjectTemplate mapObjectTemplates[64];
- /*0x0EE0*/ u8 fillerEE0[0x2580];
+ /*0x000C*/ struct WarpData warp1;
+ /*0x0014*/ struct WarpData warp2;
+ /*0x001C*/ struct WarpData lastHealLocation;
+ /*0x0024*/ struct WarpData warp4;
+ /*0x002C*/ u8 filler2C[0x8];
+ /*0x0034*/ u8 playerPartyCount;
+ /*0x0038*/ struct Pokemon playerParty[PARTY_SIZE];
+ /*0x0290*/ u32 money;
+ /*0x0294*/ u16 coins;
+ /*0x0296*/ u8 filler296[0x7A];
+ /*0x0310*/ struct ItemSlot bagPocket_Items[BAG_ITEMS_COUNT];
+ struct ItemSlot bagPocket_KeyItems[BAG_KEYITEMS_COUNT];
+ struct ItemSlot bagPocket_PokeBalls[BAG_POKEBALLS_COUNT];
+ struct ItemSlot bagPocket_TMHM[BAG_TMHM_COUNT];
+ struct ItemSlot bagPocket_Berries[BAG_BERRIES_COUNT];
+ u8 filler5F8[0x40];
+ /*0x0638*/ u8 trainerRematchStepCounter;
+ u8 filler_639;
+ /*0x063a*/ u8 trainerRematches[100];
+ /*0x06A0*/ struct MapObject mapObjects[MAP_OBJECTS_COUNT];
+ /*0x08E0*/ struct MapObjectTemplate mapObjectTemplates[64];
+ /*0x0EE0*/ u8 fillerEE0[0x1DF0];
+ /*0x2CD0*/ struct MailStruct mail[MAIL_COUNT];
+ u8 filler2F10[0x1DA];
+ /*0x30EA*/ struct EnigmaBerry enigmaBerry;
+ /*0x3120*/ u8 filler3120[0x340];
/*0x3460*/ struct MysteryEventStruct unk_3460;
/*0x3464*/ u8 filler_3464[0x1b8];
/*0x361C*/ struct RamScript ramScript;
/*0x3A08*/ u8 filler3A08[0x44];
/*0x3A4C*/ u8 rivalName[PLAYER_NAME_LENGTH];
+ /*0x3A54*/ u8 filler3A54[0x2E4];
+ u32 unkArray[4][3];
};
extern struct SaveBlock1* gSaveBlock1Ptr;
diff --git a/include/link.h b/include/link.h
index 1f91ebfeb..352386523 100644
--- a/include/link.h
+++ b/include/link.h
@@ -69,7 +69,7 @@ struct LinkPlayer
/* 0x08 */ u8 name[11];
/* 0x13 */ u8 gender;
/* 0x14 */ u32 linkType;
- /* 0x18 */ u16 lp_field_18; // battle bank in battles
+ /* 0x18 */ u16 id; // battle bank in battles
/* 0x1A */ u16 language;
};
diff --git a/include/load_save.h b/include/load_save.h
index 1f406bbad..b3e9fe49c 100644
--- a/include/load_save.h
+++ b/include/load_save.h
@@ -18,7 +18,9 @@ void SaveSerializedGame(void);
void LoadSerializedGame(void);
void LoadPlayerBag(void);
void SavePlayerBag(void);
-void SetSaveBlocksPointers(u16);
+void SetSaveBlocksPointers(void);
void MoveSaveBlocks_ResetHeap(void);
+void ApplyNewEncryptionKeyToAllEncryptedData(u32 encryptionKey);
+void ApplyNewEncryptionKeyToBagItems(u32 encryptionKey);
#endif // GUARD_LOAD_SAVE_H
diff --git a/include/malloc.h b/include/malloc.h
index 003ee1f03..6efa8fbef 100644
--- a/include/malloc.h
+++ b/include/malloc.h
@@ -1,6 +1,7 @@
#ifndef GUARD_MALLOC_H
#define GUARD_MALLOC_H
+#define HEAP_SIZE 0x1C000
#define malloc Alloc
#define calloc(ct, sz) AllocZeroed((ct) * (sz))
#define free Free
diff --git a/include/pokemon.h b/include/pokemon.h
index 480c8d9b9..e15172dd5 100644
--- a/include/pokemon.h
+++ b/include/pokemon.h
@@ -511,23 +511,22 @@ struct Evolution
#define EVOS_PER_MON 5
-struct EvolutionData
-{
- struct Evolution evolutions[EVOS_PER_MON];
-};
-
extern u8 gPlayerPartyCount;
extern struct Pokemon gPlayerParty[PARTY_SIZE];
extern u8 gEnemyPartyCount;
extern struct Pokemon gEnemyParty[PARTY_SIZE];
extern const struct BaseStats gBaseStats[];
extern const u8 *const gItemEffectTable[];
-extern const struct EvolutionData gEvolutionTable[];
+extern const struct Evolution gEvolutionTable[][EVOS_PER_MON];
+extern const u8 gStatStageRatios[][2];
+extern struct SpriteTemplate gMultiuseSpriteTemplate;
extern struct PokemonStorage* gPokemonStoragePtr;
extern const u32 gExperienceTables[][MAX_MON_LEVEL + 1];
extern const u16 *const gLevelUpLearnsets[];
+extern const u8 gFacilityClassToPicIndex[];
+extern const u8 gFacilityClassToTrainerClass[];
-u8 CountAliveMonsInBattle(u8 caseId);
+u8 CountAliveMons(u8 caseId);
#define BATTLE_ALIVE_EXCEPT_ACTIVE 0
#define BATTLE_ALIVE_ATK_SIDE 1
#define BATTLE_ALIVE_DEF_SIDE 2
@@ -558,6 +557,8 @@ void GiveMonInitialMoveset(struct Pokemon *mon);
void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon);
void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move);
void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move);
+bool8 ExecuteTableBasedItemEffect(struct Pokemon *mon, u16 item, u8 partyIndex, u8 moveIndex);
+bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 moveIndex, u8 e);
u8 GetMonGender(struct Pokemon *mon);
u8 GetBoxMonGender(struct BoxPokemon *boxMon);
@@ -653,6 +654,7 @@ u8 GetSecretBaseTrainerPicIndex(void);
bool8 TryIncrementMonLevel(struct Pokemon *mon);
void BoxMonToMon(struct BoxPokemon *srcMon, struct Pokemon *dstMon);
u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves);
+bool8 HealStatusConditions(struct Pokemon *mon, u32 battlePartyId, u32 healMask, u8 battlerId);
#include "sprite.h"
diff --git a/include/save.h b/include/save.h
index 3bd1ff8cf..38ad63170 100644
--- a/include/save.h
+++ b/include/save.h
@@ -1,11 +1,27 @@
#ifndef GUARD_SAVE_H
#define GUARD_SAVE_H
-extern u16 gSaveFileStatus;
+#define NUM_SECTORS 32 // defined in agb_flash but not in a header
+
+#define SAVE_STATUS_EMPTY 0
+#define SAVE_STATUS_OK 1
+#define SAVE_STATUS_INVALID 2
+#define SAVE_STATUS_NO_FLASH 4
+#define SAVE_STATUS_ERROR 0xFF
-struct SaveSectionLocation
+enum
{
- void *data;
+ SAVE_NORMAL,
+ SAVE_LINK,
+ SAVE_EREADER,
+ SAVE_HALL_OF_FAME,
+ SAVE_OVERWRITE_DIFFERENT_FILE,
+ SAVE_HALL_OF_FAME_ERASE_BEFORE, // unused
+};
+
+struct SaveBlockChunk
+{
+ u8 *data;
u16 size;
};
@@ -14,7 +30,7 @@ struct SaveSection
u8 data[0xFF4];
u16 id;
u16 checksum;
- u32 security;
+ u32 signature;
u32 counter;
}; // size is 0x1000
@@ -22,21 +38,21 @@ struct SaveSection
struct UnkSaveSection
{
u8 data[0xFF4];
- u32 security;
+ u32 signature;
}; // size is 0xFF8
struct SaveSectionOffsets
{
- u16 toAdd;
- u16 size;
+ u16 toAdd;
+ u16 size;
};
// Emerald changes this definition to be the sectors per slot.
-#define NUM_SECTORS_PER_SLOT 16 // move to save.h
+#define NUM_SECTORS_PER_SAVE_SLOT 14 // Number of sectors occupied by a save slot
#define UNKNOWN_CHECK_VALUE 0x8012025
-// SetDamagedSectorBits states
+// SetSectorDamagedStatus states
enum
{
ENABLE,
@@ -49,49 +65,59 @@ enum
{
NORMAL_SAVE,
LINK_SAVE,
- //EREADER_SAVE, // depreciated in Emerald
- LINK2_SAVE, // unknown 2nd link save
+ EREADER_SAVE,
HOF_SAVE,
DIFFERENT_FILE_SAVE,
HOF_DELETE_SAVE // unused
};
-#define SECTION_ID_RECORDED_BATTLE 31
+extern u16 gFirstSaveSector;
+extern u32 gPrevSaveCounter;
+extern u16 gLastKnownGoodSector;
+extern u32 gDamagedSaveSectors;
+extern u32 gSaveCounter;
+extern struct SaveSection *gFastSaveSection; // the pointer is in fast IWRAM but may sometimes point to the slower EWRAM.
+extern u16 gUnknown_3005398;
+extern u16 gSaveUnusedVar;
+extern u16 gSaveFileStatus;
+extern void (*gGameContinueCallback)(void);
+extern struct SaveBlockChunk gRamSaveSectionLocations[0xE];
+extern u16 gUnknown_3005420;
+
+extern struct SaveSection gSaveDataBuffer;
void ClearSaveData(void);
-void ResetSaveCounters(void);
-bool32 SetDamagedSectorBits(u8 op, u8 bit);
-u8 save_write_to_flash(u16 a1, const struct SaveSectionLocation *location);
-u8 HandleWriteSector(u16 a1, const struct SaveSectionLocation *location);
+void Save_ResetSaveCounters(void);
+bool32 SetSectorDamagedStatus(u8 op, u8 bit);
+u8 save_write_to_flash(u16 a1, const struct SaveBlockChunk *location);
+u8 HandleWriteSector(u16 a1, const struct SaveBlockChunk *location);
u8 HandleWriteSectorNBytes(u8 sector, u8 *data, u16 size);
u8 TryWriteSector(u8 sector, u8 *data);
-u32 RestoreSaveBackupVarsAndIncrement(const struct SaveSectionLocation *location);
-u32 RestoreSaveBackupVars(const struct SaveSectionLocation *location);
-u8 sub_81529D4(u16 a1, const struct SaveSectionLocation *location);
-u8 sub_8152A34(u16 a1, const struct SaveSectionLocation *location);
-u8 ClearSaveData_2(u16 a1, const struct SaveSectionLocation *location);
-u8 sav12_xor_get(u16 a1, const struct SaveSectionLocation *location);
-u8 sub_8152CAC(u16 a1, const struct SaveSectionLocation *location);
-u8 sub_8152D44(u16 a1, const struct SaveSectionLocation *location);
-u8 sub_8152DD0(u16 a1, const struct SaveSectionLocation *location);
-u8 sub_8152E10(u16 a1, const struct SaveSectionLocation *location);
-u8 GetSaveValidStatus(const struct SaveSectionLocation *location);
-u8 sub_81530DC(u8 a1, u8 *data, u16 size);
+u32 RestoreSaveBackupVarsAndIncrement(const struct SaveBlockChunk *location);
+u32 RestoreSaveBackupVars(const struct SaveBlockChunk *location);
+u8 sub_80D9AA4(u16 a1, const struct SaveBlockChunk *location);
+u8 sub_80D9B04(u16 a1, const struct SaveBlockChunk *location);
+u8 ClearSaveData_2(u16 a1, const struct SaveBlockChunk *location);
+u8 sav12_xor_get(u16 a1, const struct SaveBlockChunk *location);
+u8 sub_80D9D88(u16 a1, const struct SaveBlockChunk *location);
+u8 sub_80D9E14(u16 a1, const struct SaveBlockChunk *location);
+u8 sub_80D9E54(u16 a1, const struct SaveBlockChunk *location);
+u8 GetSaveValidStatus(const struct SaveBlockChunk *location);
+u8 sub_80DA120(u8 a1, u8 *data, u16 size);
u8 DoReadFlashWholeSection(u8 sector, struct SaveSection *section);
u16 CalculateChecksum(void *data, u16 size);
void UpdateSaveAddresses(void);
u8 HandleSavingData(u8 saveType);
u8 TrySavingData(u8 saveType);
-u8 sub_8153380(void);
-bool8 sub_81533AC(void);
-u8 sub_81533E0(void);
-u8 sub_8153408(void);
-u8 sub_8153430(void);
-bool8 sub_8153474(void);
-u8 sub_81534D0(u8 a1);
-u16 sub_815355C(void);
+u8 sub_80DA3AC(void);
+bool8 sub_80DA3D8(void);
+u8 sub_80DA40C(void);
+u8 sub_80DA434(void);
+u8 sub_80DA45C(void);
+bool8 sub_80DA4A0(void);
+u8 Save_LoadGameData(u8 a1);
u32 TryCopySpecialSaveSection(u8 sector, u8* dst);
-u32 sub_8153634(u8 sector, u8* src);
-void sub_8153688(u8 taskId);
+u32 sub_80DA5E0(u8 sector, u8* src);
+void sub_80DA634(u8 taskId);
#endif // GUARD_SAVE_H
diff --git a/ld_script.txt b/ld_script.txt
index 4aa040c1f..e643080d3 100644
--- a/ld_script.txt
+++ b/ld_script.txt
@@ -75,10 +75,7 @@ SECTIONS {
asm/battle_controller_opponent.o(.text);
asm/battle_ai_switch_items.o(.text);
asm/battle_controller_link_opponent.o(.text);
- asm/pokemon_1.o(.text);
- asm/calculate_base_damage.o(.text);
- asm/pokemon_2.o(.text);
- asm/pokemon_item_effect.o(.text);
+ src/pokemon.o(.text);
asm/pokemon_3.o(.text);
asm/trig.o(.text);
src/random.o(.text);
@@ -89,7 +86,7 @@ SECTIONS {
asm/battle_interface.o(.text);
asm/smokescreen.o(.text);
asm/pokeball.o(.text);
- asm/load_save.o(.text);
+ src/load_save.o(.text);
asm/trade.o(.text);
asm/play_time.o(.text);
asm/new_game.o(.text);
@@ -184,7 +181,7 @@ SECTIONS {
asm/math_util.o(.text);
asm/roulette_util.o(.text);
asm/cable_car_util.o(.text);
- asm/save.o(.text);
+ src/save.o(.text);
asm/mystery_event_script.o(.text);
asm/field_effect_helpers.o(.text);
asm/battle_anim_sound_tasks.o(.text);
@@ -368,11 +365,13 @@ SECTIONS {
src/string_util.o(.rodata);
data/data.o(.rodata);
src/battle_ai_script_commands.o(.rodata);
- data/data_84827AC.o(.rodata);
+ data/data_83F5738.o(.rodata);
+ src/save.o(.rodata);
+ data/data_83FECCC.o(.rodata);
src/vs_seeker.o(.rodata);
- data/data_84827AC.o(.rodata.8453F6C);
+ data/data_83FECCC.o(.rodata.8453F6C);
src/menews_jisan.o(.rodata);
- data/data_84827AC.o(.rodata.8468C98);
+ data/data_8468C98.o(.rodata);
src/m4a_tables.o(.rodata);
data/sound_data.o(.rodata);
} =0
diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c
index 22ed95040..6f5577f70 100644
--- a/src/battle_ai_script_commands.c
+++ b/src/battle_ai_script_commands.c
@@ -256,7 +256,6 @@ extern const u32 gBitTable[]; // util.h
extern u32 gStatuses3[]; // battle_2.h
extern u16 gSideAffecting[2];
extern const struct BattleMove gBattleMoves[];
-extern u16 gBattlerPartyIndexes[];
extern u16 gDynamicBasePower;
extern u8 gMoveResultFlags;
extern u8 gCritMultiplier;
@@ -485,14 +484,14 @@ void sub_80C71A8(u8 a)
void sub_80C71D0(u8 a, u8 b)
{
- if (GetBankSide(a) == 0)
- BATTLE_HISTORY->abilities[GetBankIdentity(a) & 1] = b;
+ if (GetBattlerSide(a) == 0)
+ BATTLE_HISTORY->abilities[GetBattlerPosition(a) & 1] = b;
}
void sub_80C7208(u8 a, u8 b)
{
- if (GetBankSide(a) == 0)
- BATTLE_HISTORY->itemEffects[GetBankIdentity(a) & 1] = b;
+ if (GetBattlerSide(a) == 0)
+ BATTLE_HISTORY->itemEffects[GetBattlerPosition(a) & 1] = b;
}
static void BattleAICmd_if_random_less_than(void)
@@ -720,7 +719,7 @@ static void BattleAICmd_if_status4(void)
else
index = gBattlerTarget;
- arg1 = GetBankIdentity(index) & 1;
+ arg1 = GetBattlerPosition(index) & 1;
arg2 = T1_READ_32(gAIScriptPtr + 2);
if ((gSideAffecting[arg1] & arg2) != 0)
@@ -739,7 +738,7 @@ static void BattleAICmd_if_not_status4(void)
else
index = gBattlerTarget;
- arg1 = GetBankIdentity(index) & 1;
+ arg1 = GetBattlerPosition(index) & 1;
arg2 = T1_READ_32(gAIScriptPtr + 2);
if ((gSideAffecting[arg1] & arg2) == 0)
@@ -1361,7 +1360,7 @@ static void BattleAICmd_count_alive_pokemon(void)
else
index = gBattlerTarget;
- if (GetBankSide(index) == 0)
+ if (GetBattlerSide(index) == 0)
party = gPlayerParty;
else
party = gEnemyParty;
@@ -1370,8 +1369,8 @@ static void BattleAICmd_count_alive_pokemon(void)
{
u32 status;
var = gBattlerPartyIndexes[index];
- status = GetBankIdentity(index) ^ 2;
- var2 = gBattlerPartyIndexes[GetBankByIdentity(status)];
+ status = GetBattlerPosition(index) ^ 2;
+ var2 = gBattlerPartyIndexes[GetBattlerAtPosition(status)];
}
else
{
@@ -1414,9 +1413,9 @@ static void BattleAICmd_get_ability(void)
else
index = gBattlerTarget;
- if (GetBankSide(index) == TARGET)
+ if (GetBattlerSide(index) == TARGET)
{
- u16 side = GetBankIdentity(index) & 1;
+ u16 side = GetBattlerPosition(index) & 1;
if (BATTLE_HISTORY->abilities[side] != 0)
{
@@ -2008,9 +2007,9 @@ static void BattleAICmd_get_hold_effect(void)
else
index = gBattlerTarget;
- if (GetBankSide(index) == 0)
+ if (GetBattlerSide(index) == 0)
{
- side = (GetBankIdentity(index) & 1);
+ side = (GetBattlerPosition(index) & 1);
AI_THINKING_STRUCT->funcResult = BATTLE_HISTORY->itemEffects[side];
}
else
diff --git a/src/load_save.c b/src/load_save.c
new file mode 100644
index 000000000..eba01642c
--- /dev/null
+++ b/src/load_save.c
@@ -0,0 +1,297 @@
+#include "global.h"
+#include "gba/flash_internal.h"
+#include "load_save.h"
+#include "main.h"
+#include "pokemon.h"
+#include "random.h"
+#include "malloc.h"
+#include "item.h"
+
+extern void sub_8099E44(void);
+extern void sub_8110840(void *oldSave);
+extern void sub_8055778(int);
+extern void sub_8054F38(u32 newKey);
+extern void ApplyNewEncryptionKeyToBagItems_(u32 newKey);
+extern void sub_815EE6C(u32 newKey);
+
+#define SAVEBLOCK_MOVE_RANGE 128
+
+struct LoadedSaveData
+{
+ /*0x0000*/ struct ItemSlot items[BAG_ITEMS_COUNT];
+ /*0x0078*/ struct ItemSlot keyItems[BAG_KEYITEMS_COUNT];
+ /*0x00F0*/ struct ItemSlot pokeBalls[BAG_POKEBALLS_COUNT];
+ /*0x0130*/ struct ItemSlot TMsHMs[BAG_TMHM_COUNT];
+ /*0x0230*/ struct ItemSlot berries[BAG_BERRIES_COUNT];
+ /*0x02E8*/ struct MailStruct mail[MAIL_COUNT];
+};
+
+// EWRAM DATA
+EWRAM_DATA struct SaveBlock2 gSaveBlock2 = {0};
+EWRAM_DATA u8 gSaveBlock2_DMA[SAVEBLOCK_MOVE_RANGE] = {0};
+
+EWRAM_DATA struct SaveBlock1 gSaveBlock1 = {0};
+EWRAM_DATA u8 gSaveBlock1_DMA[SAVEBLOCK_MOVE_RANGE] = {0};
+
+EWRAM_DATA struct PokemonStorage gPokemonStorage = {0};
+EWRAM_DATA u8 gSaveBlock3_DMA[SAVEBLOCK_MOVE_RANGE] = {0};
+
+EWRAM_DATA struct LoadedSaveData gLoadedSaveData = {0};
+EWRAM_DATA u32 gLastEncryptionKey = 0;
+
+// IWRAM common
+IWRAM_DATA bool32 gFlashMemoryPresent;
+IWRAM_DATA struct SaveBlock1 *gSaveBlock1Ptr;
+IWRAM_DATA struct SaveBlock2 *gSaveBlock2Ptr;
+IWRAM_DATA struct PokemonStorage *gPokemonStoragePtr;
+
+void CheckForFlashMemory(void)
+{
+ if (!IdentifyFlash())
+ {
+ gFlashMemoryPresent = TRUE;
+ InitFlashTimer();
+ }
+ else
+ {
+ gFlashMemoryPresent = FALSE;
+ }
+}
+
+void ClearSav2(void)
+{
+ CpuFill16(0, &gSaveBlock2, sizeof(struct SaveBlock2) + sizeof(gSaveBlock2_DMA));
+}
+
+void ClearSav1(void)
+{
+ CpuFill16(0, &gSaveBlock1, sizeof(struct SaveBlock1) + sizeof(gSaveBlock1_DMA));
+}
+
+void SetSaveBlocksPointers(void)
+{
+ u32 offset;
+ struct SaveBlock1** sav1_LocalVar = &gSaveBlock1Ptr;
+ void *oldSave = (void *)gSaveBlock1Ptr;
+
+ offset = (Random()) & (SAVEBLOCK_MOVE_RANGE - 4);
+
+ gSaveBlock2Ptr = (void*)(&gSaveBlock2) + offset;
+ *sav1_LocalVar = (void*)(&gSaveBlock1) + offset;
+ gPokemonStoragePtr = (void*)(&gPokemonStorage) + offset;
+
+ sub_8099E44();
+ sub_8110840(oldSave);
+}
+
+void MoveSaveBlocks_ResetHeap(void)
+{
+ void *vblankCB, *hblankCB;
+ u32 encryptionKey;
+ struct SaveBlock2 *saveBlock2Copy;
+ struct SaveBlock1 *saveBlock1Copy;
+ struct PokemonStorage *pokemonStorageCopy;
+
+ // save interrupt functions and turn them off
+ vblankCB = gMain.vblankCallback;
+ hblankCB = gMain.hblankCallback;
+ gMain.vblankCallback = NULL;
+ gMain.hblankCallback = NULL;
+ gMain.vblankCounter1 = NULL;
+
+ saveBlock2Copy = (struct SaveBlock2 *)(gHeap);
+ saveBlock1Copy = (struct SaveBlock1 *)(gHeap + sizeof(struct SaveBlock2));
+ pokemonStorageCopy = (struct PokemonStorage *)(gHeap + sizeof(struct SaveBlock2) + sizeof(struct SaveBlock1));
+
+ // backup the saves.
+ *saveBlock2Copy = *gSaveBlock2Ptr;
+ *saveBlock1Copy = *gSaveBlock1Ptr;
+ *pokemonStorageCopy = *gPokemonStoragePtr;
+
+ // change saveblocks' pointers
+ SetSaveBlocksPointers(); // unlike Emerald, this does not use
+ // the trainer ID sum for an offset.
+
+ // restore saveblock data since the pointers changed
+ *gSaveBlock2Ptr = *saveBlock2Copy;
+ *gSaveBlock1Ptr = *saveBlock1Copy;
+ *gPokemonStoragePtr = *pokemonStorageCopy;
+
+ // heap was destroyed in the copying process, so reset it
+ InitHeap(gHeap, HEAP_SIZE);
+
+ // restore interrupt functions
+ gMain.hblankCallback = hblankCB;
+ gMain.vblankCallback = vblankCB;
+
+ // create a new encryption key
+ encryptionKey = (Random() << 0x10) + (Random());
+ ApplyNewEncryptionKeyToAllEncryptedData(encryptionKey);
+ gSaveBlock2Ptr->encryptionKey = encryptionKey;
+}
+
+u32 sav2_x1_query_bit1(void)
+{
+ return gSaveBlock2Ptr->specialSaveWarp & 1;
+}
+
+void sav2_x9_clear_bit1(void)
+{
+ gSaveBlock2Ptr->specialSaveWarp &= ~1;
+}
+
+void sub_804C1AC(void)
+{
+ gSaveBlock2Ptr->specialSaveWarp |= 1;
+}
+
+void sub_804C1C0(void)
+{
+ sub_8055778(0);
+ gSaveBlock2Ptr->specialSaveWarp |= 1;
+}
+
+void sav2_gender2_inplace_and_xFE(void)
+{
+ gSaveBlock2Ptr->specialSaveWarp &= ~1;
+}
+
+void SavePlayerParty(void)
+{
+ int i;
+
+ gSaveBlock1Ptr->playerPartyCount = gPlayerPartyCount;
+
+ for (i = 0; i < PARTY_SIZE; i++)
+ gSaveBlock1Ptr->playerParty[i] = gPlayerParty[i];
+}
+
+void LoadPlayerParty(void)
+{
+ int i;
+
+ gPlayerPartyCount = gSaveBlock1Ptr->playerPartyCount;
+
+ for (i = 0; i < PARTY_SIZE; i++)
+ gPlayerParty[i] = gSaveBlock1Ptr->playerParty[i];
+}
+
+void SaveMapObjects(void)
+{
+ int i;
+
+ for (i = 0; i < NUM_FIELD_OBJECTS; i++)
+ gSaveBlock1Ptr->mapObjects[i] = gMapObjects[i];
+}
+
+void LoadMapObjects(void)
+{
+ int i;
+
+ for (i = 0; i < NUM_FIELD_OBJECTS; i++)
+ gMapObjects[i] = gSaveBlock1Ptr->mapObjects[i];
+}
+
+void SaveSerializedGame(void)
+{
+ SavePlayerParty();
+ SaveMapObjects();
+}
+
+void LoadSerializedGame(void)
+{
+ LoadPlayerParty();
+ LoadMapObjects();
+}
+
+void LoadPlayerBag(void)
+{
+ int i;
+
+ // load player items.
+ for (i = 0; i < BAG_ITEMS_COUNT; i++)
+ gLoadedSaveData.items[i] = gSaveBlock1Ptr->bagPocket_Items[i];
+
+ // load player key items.
+ for (i = 0; i < BAG_KEYITEMS_COUNT; i++)
+ gLoadedSaveData.keyItems[i] = gSaveBlock1Ptr->bagPocket_KeyItems[i];
+
+ // load player pokeballs.
+ for (i = 0; i < BAG_POKEBALLS_COUNT; i++)
+ gLoadedSaveData.pokeBalls[i] = gSaveBlock1Ptr->bagPocket_PokeBalls[i];
+
+ // load player TMs and HMs.
+ for (i = 0; i < BAG_TMHM_COUNT; i++)
+ gLoadedSaveData.TMsHMs[i] = gSaveBlock1Ptr->bagPocket_TMHM[i];
+
+ // load player berries.
+ for (i = 0; i < BAG_BERRIES_COUNT; i++)
+ gLoadedSaveData.berries[i] = gSaveBlock1Ptr->bagPocket_Berries[i];
+
+ // load mail.
+ for (i = 0; i < MAIL_COUNT; i++)
+ gLoadedSaveData.mail[i] = gSaveBlock1Ptr->mail[i];
+
+ gLastEncryptionKey = gSaveBlock2Ptr->encryptionKey;
+}
+
+void SavePlayerBag(void)
+{
+ int i;
+ u32 encryptionKeyBackup;
+
+ // save player items.
+ for (i = 0; i < BAG_ITEMS_COUNT; i++)
+ gSaveBlock1Ptr->bagPocket_Items[i] = gLoadedSaveData.items[i];
+
+ // save player key items.
+ for (i = 0; i < BAG_KEYITEMS_COUNT; i++)
+ gSaveBlock1Ptr->bagPocket_KeyItems[i] = gLoadedSaveData.keyItems[i];
+
+ // save player pokeballs.
+ for (i = 0; i < BAG_POKEBALLS_COUNT; i++)
+ gSaveBlock1Ptr->bagPocket_PokeBalls[i] = gLoadedSaveData.pokeBalls[i];
+
+ // save player TMs and HMs.
+ for (i = 0; i < BAG_TMHM_COUNT; i++)
+ gSaveBlock1Ptr->bagPocket_TMHM[i] = gLoadedSaveData.TMsHMs[i];
+
+ // save player berries.
+ for (i = 0; i < BAG_BERRIES_COUNT; i++)
+ gSaveBlock1Ptr->bagPocket_Berries[i] = gLoadedSaveData.berries[i];
+
+ // save mail.
+ for (i = 0; i < MAIL_COUNT; i++)
+ gSaveBlock1Ptr->mail[i] = gLoadedSaveData.mail[i];
+
+ encryptionKeyBackup = gSaveBlock2Ptr->encryptionKey;
+ gSaveBlock2Ptr->encryptionKey = gLastEncryptionKey;
+ ApplyNewEncryptionKeyToBagItems(encryptionKeyBackup);
+ gSaveBlock2Ptr->encryptionKey = encryptionKeyBackup;
+}
+
+void ApplyNewEncryptionKeyToHword(u16 *hWord, u32 newKey)
+{
+ *hWord ^= gSaveBlock2Ptr->encryptionKey;
+ *hWord ^= newKey;
+}
+
+void ApplyNewEncryptionKeyToWord(u32 *word, u32 newKey)
+{
+ *word ^= gSaveBlock2Ptr->encryptionKey;
+ *word ^= newKey;
+}
+
+void ApplyNewEncryptionKeyToAllEncryptedData(u32 encryptionKey)
+{
+ int i;
+
+ for(i = 0; i < 4; i++)
+ ApplyNewEncryptionKeyToWord(&gSaveBlock1Ptr->unkArray[i][1], encryptionKey);
+
+ sub_8054F38(encryptionKey);
+ ApplyNewEncryptionKeyToBagItems_(encryptionKey);
+ sub_815EE6C(encryptionKey);
+ ApplyNewEncryptionKeyToWord(&gSaveBlock1Ptr->money, encryptionKey);
+ ApplyNewEncryptionKeyToHword(&gSaveBlock1Ptr->coins, encryptionKey);
+}
diff --git a/src/pokemon.c b/src/pokemon.c
new file mode 100644
index 000000000..ff7c907ca
--- /dev/null
+++ b/src/pokemon.c
@@ -0,0 +1,5609 @@
+#include "global.h"
+#include "pokemon.h"
+#include "random.h"
+#include "main.h"
+#include "text.h"
+#include "string_util.h"
+#include "battle.h"
+#include "item.h"
+#include "event_data.h"
+#include "util.h"
+#include "pokemon_storage_system.h"
+#include "data2.h"
+#include "battle_gfx_sfx_util.h"
+#include "battle_controllers.h"
+#include "evolution_scene.h"
+#include "battle_message.h"
+#include "link.h"
+#include "m4a.h"
+#include "sound.h"
+#include "constants/items.h"
+#include "constants/species.h"
+#include "constants/pokemon.h"
+#include "constants/abilities.h"
+#include "constants/flags.h"
+#include "constants/moves.h"
+#include "constants/hold_effects.h"
+#include "constants/battle_move_effects.h"
+
+// Extracts the upper 16 bits of a 32-bit number
+#define HIHALF(n) (((n) & 0xFFFF0000) >> 16)
+
+// Extracts the lower 16 bits of a 32-bit number
+#define LOHALF(n) ((n) & 0xFFFF)
+
+// TODO: what is this
+struct UnkStruct20244F4
+{
+ u8 unk0:4;
+ u8 unk0_2:4;
+ u8 filler1[0xF];
+ struct SpriteTemplate *unk10;
+};
+
+// External symbols
+extern struct UnkStruct20244F4 *gUnknown_20244F4;
+extern struct SpriteTemplate gUnknown_825DEF0[];
+extern struct SpriteTemplate gUnknown_825DF50[];
+extern const union AnimCmd *const *const gTrainerBackAnimsPtrTable[];
+extern struct SpriteTemplate gUnknown_825DEF0[];
+extern const union AnimCmd *const *const gTrainerFrontAnimsPtrTable[];
+extern const union AnimCmd *const gUnknown_82349BC[];
+extern const u8 gUnknown_825DEA1[];
+extern const u8 gPPUpWriteMasks[];
+extern u8 *gUnknown_83FD5D0[];
+extern const u8 gUnknown_825DFF0[];
+extern const u8 gText_EggNickname[];
+extern const u8 gText_BadEgg[];
+extern const u8 BattleText_Rose[];
+extern const u8 BattleText_UnknownString3[];
+extern const u8 BattleText_GetPumped[];
+extern const u8 BattleText_MistShroud[];
+extern const u8 gText_PkmnsXPreventsSwitching[];
+extern const u8 sHoldEffectToType[][2];
+extern u8 sLearningMoveTableID;
+extern const u8 sSecretBaseFacilityClasses[2][5];
+extern u16 gUnknown_8251CB8[];
+extern u16 gUnknown_8251FEE[];
+extern u16 gUnknown_8252324[];
+extern u16 gUnknown_82539D4[];
+extern struct SpindaSpot gSpindaSpotGraphics[];
+extern s8 gNatureStatTable[][5];
+extern const s8 sFriendshipEventDeltas[][3];
+extern u32 gTMHMLearnsets[][2];
+extern u8 gBattleMonForms[4];
+extern const struct CompressedSpritePalette gMonPaletteTable[];
+extern const struct CompressedSpritePalette gMonShinyPaletteTable[];
+extern const u16 sHMMoves[];
+extern s8 gPokeblockFlavorCompatibilityTable[];
+
+// External functions
+extern u8 sav1_map_get_name(void); // overworld
+extern const struct BattleMove gBattleMoves[];
+extern u8 sBattler_AI; // battle_ai
+extern void set_unknown_box_id(u8); // field_specials
+extern u8 pokemon_order_func(u8);
+extern u16 get_unknown_box_id(void); // field_specials
+extern u8 StorageGetCurrentBox(void); // pokemon_storage_system
+extern void sub_80174B8(u8 battlerId);
+
+union PokemonSubstruct *GetSubstruct(struct BoxPokemon *boxMon, u32 personality, u8 substructType);
+s32 GetDeoxysStat(struct Pokemon *mon, s32 statId);
+
+// code
+void ZeroBoxMonData(struct BoxPokemon *boxMon)
+{
+ u8 *raw = (u8 *)boxMon;
+ u32 i;
+ for (i = 0; i < sizeof(struct BoxPokemon); i++)
+ raw[i] = 0;
+}
+
+void ZeroMonData(struct Pokemon *mon)
+{
+ u32 arg;
+ ZeroBoxMonData(&mon->box);
+ arg = 0;
+ SetMonData(mon, MON_DATA_STATUS, &arg);
+ SetMonData(mon, MON_DATA_LEVEL, &arg);
+ SetMonData(mon, MON_DATA_HP, &arg);
+ SetMonData(mon, MON_DATA_MAX_HP, &arg);
+ SetMonData(mon, MON_DATA_ATK, &arg);
+ SetMonData(mon, MON_DATA_DEF, &arg);
+ SetMonData(mon, MON_DATA_SPEED, &arg);
+ SetMonData(mon, MON_DATA_SPATK, &arg);
+ SetMonData(mon, MON_DATA_SPDEF, &arg);
+ arg = 255;
+ SetMonData(mon, MON_DATA_MAIL, &arg);
+}
+
+void ZeroPlayerPartyMons(void)
+{
+ s32 i;
+ for (i = 0; i < PARTY_SIZE; i++)
+ ZeroMonData(&gPlayerParty[i]);
+}
+
+void ZeroEnemyPartyMons(void)
+{
+ s32 i;
+ for (i = 0; i < PARTY_SIZE; i++)
+ ZeroMonData(&gEnemyParty[i]);
+}
+
+void CreateMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId)
+{
+ u32 arg;
+ ZeroMonData(mon);
+ CreateBoxMon(&mon->box, species, level, fixedIV, hasFixedPersonality, fixedPersonality, otIdType, fixedOtId);
+ SetMonData(mon, MON_DATA_LEVEL, &level);
+ arg = 255;
+ SetMonData(mon, MON_DATA_MAIL, &arg);
+ CalculateMonStats(mon);
+}
+
+void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId)
+{
+ u8 speciesName[POKEMON_NAME_LENGTH + 1];
+ u32 personality;
+ u32 value;
+ u16 checksum;
+
+ ZeroBoxMonData(boxMon);
+
+ if (hasFixedPersonality)
+ personality = fixedPersonality;
+ else
+ personality = Random32();
+
+ SetBoxMonData(boxMon, MON_DATA_PERSONALITY, &personality);
+
+ //Determine original trainer ID
+ if (otIdType == OT_ID_RANDOM_NO_SHINY) //Pokemon cannot be shiny
+ {
+ u32 shinyValue;
+ do
+ {
+ value = Random32();
+ shinyValue = HIHALF(value) ^ LOHALF(value) ^ HIHALF(personality) ^ LOHALF(personality);
+ } while (shinyValue < 8);
+ }
+ else if (otIdType == OT_ID_PRESET) //Pokemon has a preset OT ID
+ {
+ value = fixedOtId;
+ }
+ else //Player is the OT
+ {
+ value = gSaveBlock2Ptr->playerTrainerId[0]
+ | (gSaveBlock2Ptr->playerTrainerId[1] << 8)
+ | (gSaveBlock2Ptr->playerTrainerId[2] << 16)
+ | (gSaveBlock2Ptr->playerTrainerId[3] << 24);
+ }
+
+ SetBoxMonData(boxMon, MON_DATA_OT_ID, &value);
+
+ checksum = CalculateBoxMonChecksum(boxMon);
+ SetBoxMonData(boxMon, MON_DATA_CHECKSUM, &checksum);
+ EncryptBoxMon(boxMon);
+ GetSpeciesName(speciesName, species);
+ SetBoxMonData(boxMon, MON_DATA_NICKNAME, speciesName);
+ SetBoxMonData(boxMon, MON_DATA_LANGUAGE, &gGameLanguage);
+ SetBoxMonData(boxMon, MON_DATA_OT_NAME, gSaveBlock2Ptr->playerName);
+ SetBoxMonData(boxMon, MON_DATA_SPECIES, &species);
+ SetBoxMonData(boxMon, MON_DATA_EXP, &gExperienceTables[gBaseStats[species].growthRate][level]);
+ SetBoxMonData(boxMon, MON_DATA_FRIENDSHIP, &gBaseStats[species].friendship);
+ value = sav1_map_get_name();
+ SetBoxMonData(boxMon, MON_DATA_MET_LOCATION, &value);
+ SetBoxMonData(boxMon, MON_DATA_MET_LEVEL, &level);
+ SetBoxMonData(boxMon, MON_DATA_MET_GAME, &gGameVersion);
+ value = ITEM_POKE_BALL;
+ SetBoxMonData(boxMon, MON_DATA_POKEBALL, &value);
+ SetBoxMonData(boxMon, MON_DATA_OT_GENDER, &gSaveBlock2Ptr->playerGender);
+
+ if (fixedIV < 32)
+ {
+ SetBoxMonData(boxMon, MON_DATA_HP_IV, &fixedIV);
+ SetBoxMonData(boxMon, MON_DATA_ATK_IV, &fixedIV);
+ SetBoxMonData(boxMon, MON_DATA_DEF_IV, &fixedIV);
+ SetBoxMonData(boxMon, MON_DATA_SPEED_IV, &fixedIV);
+ SetBoxMonData(boxMon, MON_DATA_SPATK_IV, &fixedIV);
+ SetBoxMonData(boxMon, MON_DATA_SPDEF_IV, &fixedIV);
+ }
+ else
+ {
+ u32 iv;
+ value = Random();
+
+ iv = value & 0x1F;
+ SetBoxMonData(boxMon, MON_DATA_HP_IV, &iv);
+ iv = (value & 0x3E0) >> 5;
+ SetBoxMonData(boxMon, MON_DATA_ATK_IV, &iv);
+ iv = (value & 0x7C00) >> 10;
+ SetBoxMonData(boxMon, MON_DATA_DEF_IV, &iv);
+
+ value = Random();
+
+ iv = value & 0x1F;
+ SetBoxMonData(boxMon, MON_DATA_SPEED_IV, &iv);
+ iv = (value & 0x3E0) >> 5;
+ SetBoxMonData(boxMon, MON_DATA_SPATK_IV, &iv);
+ iv = (value & 0x7C00) >> 10;
+ SetBoxMonData(boxMon, MON_DATA_SPDEF_IV, &iv);
+ }
+
+ if (gBaseStats[species].ability2)
+ {
+ value = personality & 1;
+ SetBoxMonData(boxMon, MON_DATA_ALT_ABILITY, &value);
+ }
+
+ GiveBoxMonInitialMoveset(boxMon);
+}
+
+void CreateMonWithNature(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 nature)
+{
+ u32 personality;
+
+ do
+ {
+ personality = Random32();
+ }
+ while (nature != GetNatureFromPersonality(personality));
+
+ CreateMon(mon, species, level, fixedIV, 1, personality, OT_ID_PLAYER_ID, 0);
+}
+
+void CreateMonWithGenderNatureLetter(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 gender, u8 nature, u8 unownLetter)
+{
+ u32 personality;
+
+ if ((u8)(unownLetter - 1) < 28)
+ {
+ u16 actualLetter;
+
+ do
+ {
+ personality = Random32();
+ actualLetter = ((((personality & 0x3000000) >> 18) | ((personality & 0x30000) >> 12) | ((personality & 0x300) >> 6) | (personality & 0x3)) % 28);
+ }
+ while (nature != GetNatureFromPersonality(personality)
+ || gender != GetGenderFromSpeciesAndPersonality(species, personality)
+ || actualLetter != unownLetter - 1);
+ }
+ else
+ {
+ do
+ {
+ personality = Random32();
+ }
+ while (nature != GetNatureFromPersonality(personality)
+ || gender != GetGenderFromSpeciesAndPersonality(species, personality));
+ }
+
+ CreateMon(mon, species, level, fixedIV, 1, personality, OT_ID_PLAYER_ID, 0);
+}
+
+// Used to create the Old Man's Weedle?
+void CreateMaleMon(struct Pokemon *mon, u16 species, u8 level)
+{
+ u32 personality;
+ u32 otId;
+
+ do
+ {
+ otId = Random32();
+ personality = Random32();
+ }
+ while (GetGenderFromSpeciesAndPersonality(species, personality) != MON_MALE);
+ CreateMon(mon, species, level, 32, 1, personality, OT_ID_PRESET, otId);
+}
+
+void CreateMonWithIVsPersonality(struct Pokemon *mon, u16 species, u8 level, u32 ivs, u32 personality)
+{
+ CreateMon(mon, species, level, 0, 1, personality, OT_ID_PLAYER_ID, 0);
+ SetMonData(mon, MON_DATA_IVS, &ivs);
+ CalculateMonStats(mon);
+}
+
+void CreateMonWithIVsOTID(struct Pokemon *mon, u16 species, u8 level, u8 *ivs, u32 otId)
+{
+ CreateMon(mon, species, level, 0, 0, 0, OT_ID_PRESET, otId);
+ SetMonData(mon, MON_DATA_HP_IV, &ivs[0]);
+ SetMonData(mon, MON_DATA_ATK_IV, &ivs[1]);
+ SetMonData(mon, MON_DATA_DEF_IV, &ivs[2]);
+ SetMonData(mon, MON_DATA_SPEED_IV, &ivs[3]);
+ SetMonData(mon, MON_DATA_SPATK_IV, &ivs[4]);
+ SetMonData(mon, MON_DATA_SPDEF_IV, &ivs[5]);
+ CalculateMonStats(mon);
+}
+
+void CreateMonWithEVSpread(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 evSpread)
+{
+ s32 i;
+ s32 statCount = 0;
+ u16 evAmount;
+ u8 evsBits;
+
+ CreateMon(mon, species, level, fixedIV, 0, 0, 0, 0);
+
+ evsBits = evSpread;
+
+ for (i = 0; i < NUM_STATS; i++)
+ {
+ if (evsBits & 1)
+ statCount++;
+ evsBits >>= 1;
+ }
+
+ evAmount = MAX_TOTAL_EVS / statCount;
+
+ evsBits = 1;
+
+ for (i = 0; i < NUM_STATS; i++)
+ {
+ if (evSpread & evsBits)
+ SetMonData(mon, MON_DATA_HP_EV + i, &evAmount);
+ evsBits <<= 1;
+ }
+
+ CalculateMonStats(mon);
+}
+
+void sub_803E0A4(struct Pokemon *mon, struct UnknownPokemonStruct *src)
+{
+ s32 i;
+ u8 value;
+
+ CreateMon(mon, src->species, src->level, 0, 1, src->personality, 1, src->otId);
+
+ for (i = 0; i < 4; i++)
+ SetMonMoveSlot(mon, src->moves[i], i);
+
+ SetMonData(mon, MON_DATA_PP_BONUSES, &src->ppBonuses);
+ SetMonData(mon, MON_DATA_HELD_ITEM, &src->heldItem);
+
+ // Why is this commented out in FR/LG?
+ /*
+ StringCopy(nickname, src->nickname);
+
+ if (nickname[0] == 0xFC && nickname[1] == 0x15)
+ language = LANGUAGE_JAPANESE;
+ else
+ language = GAME_LANGUAGE;
+
+ SetMonData(mon, MON_DATA_LANGUAGE, &language);
+ Text_StripExtCtrlCodes(nickname);
+ */
+
+ SetMonData(mon, MON_DATA_NICKNAME, &src->nickname);
+ SetMonData(mon, MON_DATA_FRIENDSHIP, &src->friendship);
+ SetMonData(mon, MON_DATA_HP_EV, &src->hpEV);
+ SetMonData(mon, MON_DATA_ATK_EV, &src->attackEV);
+ SetMonData(mon, MON_DATA_DEF_EV, &src->defenseEV);
+ SetMonData(mon, MON_DATA_SPEED_EV, &src->speedEV);
+ SetMonData(mon, MON_DATA_SPATK_EV, &src->spAttackEV);
+ SetMonData(mon, MON_DATA_SPDEF_EV, &src->spDefenseEV);
+ value = src->altAbility;
+ SetMonData(mon, MON_DATA_ALT_ABILITY, &value);
+ value = src->hpIV;
+ SetMonData(mon, MON_DATA_HP_IV, &value);
+ value = src->attackIV;
+ SetMonData(mon, MON_DATA_ATK_IV, &value);
+ value = src->defenseIV;
+ SetMonData(mon, MON_DATA_DEF_IV, &value);
+ value = src->speedIV;
+ SetMonData(mon, MON_DATA_SPEED_IV, &value);
+ value = src->spAttackIV;
+ SetMonData(mon, MON_DATA_SPATK_IV, &value);
+ value = src->spDefenseIV;
+ SetMonData(mon, MON_DATA_SPDEF_IV, &value);
+ CalculateMonStats(mon);
+}
+
+void CreateObedientMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId)
+{
+ bool32 obedient = TRUE;
+
+ CreateMon(mon, species, level, fixedIV, hasFixedPersonality, fixedPersonality, otIdType, fixedOtId);
+ SetMonData(mon, MON_DATA_OBEDIENCE, &obedient);
+}
+
+void sub_803E23C(struct Pokemon *mon, struct UnknownPokemonStruct *dest)
+{
+ s32 i;
+ u16 heldItem;
+
+ dest->species = GetMonData(mon, MON_DATA_SPECIES, NULL);
+ heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, NULL);
+
+ if (heldItem == ITEM_ENIGMA_BERRY)
+ heldItem = 0;
+
+ dest->heldItem = heldItem;
+
+ for (i = 0; i < 4; i++)
+ dest->moves[i] = GetMonData(mon, MON_DATA_MOVE1 + i, NULL);
+
+ dest->level = GetMonData(mon, MON_DATA_LEVEL, NULL);
+ dest->ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES, NULL);
+ dest->otId = GetMonData(mon, MON_DATA_OT_ID, NULL);
+ dest->hpEV = GetMonData(mon, MON_DATA_HP_EV, NULL);
+ dest->attackEV = GetMonData(mon, MON_DATA_ATK_EV, NULL);
+ dest->defenseEV = GetMonData(mon, MON_DATA_DEF_EV, NULL);
+ dest->speedEV = GetMonData(mon, MON_DATA_SPEED_EV, NULL);
+ dest->spAttackEV = GetMonData(mon, MON_DATA_SPATK_EV, NULL);
+ dest->spDefenseEV = GetMonData(mon, MON_DATA_SPDEF_EV, NULL);
+ dest->friendship = GetMonData(mon, MON_DATA_FRIENDSHIP, NULL);
+ dest->hpIV = GetMonData(mon, MON_DATA_HP_IV, NULL);
+ dest->attackIV = GetMonData(mon, MON_DATA_ATK_IV, NULL);
+ dest->defenseIV = GetMonData(mon, MON_DATA_DEF_IV, NULL);
+ dest->speedIV = GetMonData(mon, MON_DATA_SPEED_IV, NULL);
+ dest->spAttackIV = GetMonData(mon, MON_DATA_SPATK_IV, NULL);
+ dest->spDefenseIV = GetMonData(mon, MON_DATA_SPDEF_IV, NULL);
+ dest->altAbility = GetMonData(mon, MON_DATA_ALT_ABILITY, NULL);
+ dest->personality = GetMonData(mon, MON_DATA_PERSONALITY, NULL);
+ GetMonData(mon, MON_DATA_NICKNAME, dest->nickname);
+}
+
+u16 CalculateBoxMonChecksum(struct BoxPokemon *boxMon)
+{
+ u16 checksum = 0;
+ union PokemonSubstruct *substruct0 = GetSubstruct(boxMon, boxMon->personality, 0);
+ union PokemonSubstruct *substruct1 = GetSubstruct(boxMon, boxMon->personality, 1);
+ union PokemonSubstruct *substruct2 = GetSubstruct(boxMon, boxMon->personality, 2);
+ union PokemonSubstruct *substruct3 = GetSubstruct(boxMon, boxMon->personality, 3);
+ s32 i;
+
+ for (i = 0; i < 6; i++)
+ checksum += substruct0->raw[i];
+
+ for (i = 0; i < 6; i++)
+ checksum += substruct1->raw[i];
+
+ for (i = 0; i < 6; i++)
+ checksum += substruct2->raw[i];
+
+ for (i = 0; i < 6; i++)
+ checksum += substruct3->raw[i];
+
+ return checksum;
+}
+
+#define CALC_STAT(base, iv, ev, statIndex, field) \
+{ \
+ u8 baseStat = gBaseStats[species].base; \
+ s32 n = (((2 * baseStat + iv + ev / 4) * level) / 100) + 5; \
+ u8 nature = GetNature(mon); \
+ n = nature_stat_mod(nature, n, statIndex); \
+ SetMonData(mon, field, &n); \
+}
+
+void CalculateMonStats(struct Pokemon *mon)
+{
+ s32 oldMaxHP = GetMonData(mon, MON_DATA_MAX_HP, NULL);
+ s32 currentHP = GetMonData(mon, MON_DATA_HP, NULL);
+ s32 hpIV = GetMonData(mon, MON_DATA_HP_IV, NULL);
+ s32 hpEV = GetMonData(mon, MON_DATA_HP_EV, NULL);
+ s32 attackIV = GetMonData(mon, MON_DATA_ATK_IV, NULL);
+ s32 attackEV = GetMonData(mon, MON_DATA_ATK_EV, NULL);
+ s32 defenseIV = GetMonData(mon, MON_DATA_DEF_IV, NULL);
+ s32 defenseEV = GetMonData(mon, MON_DATA_DEF_EV, NULL);
+ s32 speedIV = GetMonData(mon, MON_DATA_SPEED_IV, NULL);
+ s32 speedEV = GetMonData(mon, MON_DATA_SPEED_EV, NULL);
+ s32 spAttackIV = GetMonData(mon, MON_DATA_SPATK_IV, NULL);
+ s32 spAttackEV = GetMonData(mon, MON_DATA_SPATK_EV, NULL);
+ s32 spDefenseIV = GetMonData(mon, MON_DATA_SPDEF_IV, NULL);
+ s32 spDefenseEV = GetMonData(mon, MON_DATA_SPDEF_EV, NULL);
+ u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL);
+ s32 level = GetLevelFromMonExp(mon);
+ s32 newMaxHP;
+
+ SetMonData(mon, MON_DATA_LEVEL, &level);
+
+ if (species == SPECIES_SHEDINJA)
+ {
+ newMaxHP = 1;
+ }
+ else
+ {
+ s32 n = 2 * gBaseStats[species].baseHP + hpIV;
+ newMaxHP = (((n + hpEV / 4) * level) / 100) + level + 10;
+ }
+
+ gBattleScripting.field_23 = newMaxHP - oldMaxHP;
+ if (gBattleScripting.field_23 == 0)
+ gBattleScripting.field_23 = 1;
+
+ SetMonData(mon, MON_DATA_MAX_HP, &newMaxHP);
+
+ CALC_STAT(baseAttack, attackIV, attackEV, STAT_ATK, MON_DATA_ATK)
+ CALC_STAT(baseDefense, defenseIV, defenseEV, STAT_DEF, MON_DATA_DEF)
+ CALC_STAT(baseSpeed, speedIV, speedEV, STAT_SPEED, MON_DATA_SPEED)
+ CALC_STAT(baseSpAttack, spAttackIV, spAttackEV, STAT_SPATK, MON_DATA_SPATK)
+ CALC_STAT(baseSpDefense, spDefenseIV, spDefenseEV, STAT_SPDEF, MON_DATA_SPDEF)
+
+ if (species == SPECIES_SHEDINJA)
+ {
+ if (currentHP != 0 || oldMaxHP == 0)
+ currentHP = 1;
+ else
+ return;
+ }
+ else
+ {
+ if (currentHP == 0 && oldMaxHP == 0)
+ currentHP = newMaxHP;
+ else if (currentHP != 0)
+ currentHP += newMaxHP - oldMaxHP;
+ else
+ return;
+ }
+
+ SetMonData(mon, MON_DATA_HP, &currentHP);
+}
+
+void BoxMonToMon(struct BoxPokemon *src, struct Pokemon *dest)
+{
+ u32 value = 0;
+ dest->box = *src;
+ SetMonData(dest, MON_DATA_STATUS, &value);
+ SetMonData(dest, MON_DATA_HP, &value);
+ SetMonData(dest, MON_DATA_MAX_HP, &value);
+ value = 255;
+ SetMonData(dest, MON_DATA_MAIL, &value);
+ CalculateMonStats(dest);
+}
+
+u8 GetLevelFromMonExp(struct Pokemon *mon)
+{
+ u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL);
+ u32 exp = GetMonData(mon, MON_DATA_EXP, NULL);
+ s32 level = 1;
+
+ while (level <= MAX_MON_LEVEL && gExperienceTables[gBaseStats[species].growthRate][level] <= exp)
+ level++;
+
+ return level - 1;
+}
+
+u8 GetLevelFromBoxMonExp(struct BoxPokemon *boxMon)
+{
+ u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL);
+ u32 exp = GetBoxMonData(boxMon, MON_DATA_EXP, NULL);
+ s32 level = 1;
+
+ while (level <= MAX_MON_LEVEL && gExperienceTables[gBaseStats[species].growthRate][level] <= exp)
+ level++;
+
+ return level - 1;
+}
+
+u16 GiveMoveToMon(struct Pokemon *mon, u16 move)
+{
+ return GiveMoveToBoxMon(&mon->box, move);
+}
+
+u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move)
+{
+ s32 i;
+ for (i = 0; i < 4; i++)
+ {
+ u16 existingMove = GetBoxMonData(boxMon, MON_DATA_MOVE1 + i, NULL);
+ if (!existingMove)
+ {
+ SetBoxMonData(boxMon, MON_DATA_MOVE1 + i, &move);
+ SetBoxMonData(boxMon, MON_DATA_PP1 + i, &gBattleMoves[move].pp);
+ return move;
+ }
+ if (existingMove == move)
+ return -2;
+ }
+ return -1;
+}
+
+u16 GiveMoveToBattleMon(struct BattlePokemon *mon, u16 move)
+{
+ s32 i;
+
+ for (i = 0; i < 4; i++)
+ {
+ if (!mon->moves[i])
+ {
+ mon->moves[i] = move;
+ mon->pp[i] = gBattleMoves[move].pp;
+ return move;
+ }
+ }
+
+ return -1;
+}
+
+void SetMonMoveSlot(struct Pokemon *mon, u16 move, u8 slot)
+{
+ SetMonData(mon, MON_DATA_MOVE1 + slot, &move);
+ SetMonData(mon, MON_DATA_PP1 + slot, &gBattleMoves[move].pp);
+}
+
+void SetBattleMonMoveSlot(struct BattlePokemon *mon, u16 move, u8 slot)
+{
+ mon->moves[slot] = move;
+ mon->pp[slot] = gBattleMoves[move].pp;
+}
+
+void GiveMonInitialMoveset(struct Pokemon *mon)
+{
+ GiveBoxMonInitialMoveset(&mon->box);
+}
+
+// TODO: make level_up_learnsets.h in src/data and move this to there.
+#define LEVEL_UP_END 0xffff
+
+void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon)
+{
+ u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL);
+ s32 level = GetLevelFromBoxMonExp(boxMon);
+ s32 i;
+
+ for (i = 0; gLevelUpLearnsets[species][i] != LEVEL_UP_END; i++)
+ {
+ u16 moveLevel;
+ u16 move;
+
+ moveLevel = (gLevelUpLearnsets[species][i] & 0xFE00);
+
+ if (moveLevel > (level << 9))
+ break;
+
+ move = (gLevelUpLearnsets[species][i] & 0x1FF);
+
+ if (GiveMoveToBoxMon(boxMon, move) == 0xFFFF)
+ DeleteFirstMoveAndGiveMoveToBoxMon(boxMon, move);
+ }
+}
+
+u16 MonTryLearningNewMove(struct Pokemon *mon, bool8 firstMove)
+{
+ u32 retVal = 0;
+ u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL);
+ u8 level = GetMonData(mon, MON_DATA_LEVEL, NULL);
+
+ // since you can learn more than one move per level
+ // the game needs to know whether you decided to
+ // learn it or keep the old set to avoid asking
+ // you to learn the same move over and over again
+ if (firstMove)
+ {
+ sLearningMoveTableID = 0;
+
+ while ((gLevelUpLearnsets[species][sLearningMoveTableID] & 0xFE00) != (level << 9))
+ {
+ sLearningMoveTableID++;
+ if (gLevelUpLearnsets[species][sLearningMoveTableID] == LEVEL_UP_END)
+ return 0;
+ }
+ }
+
+ if ((gLevelUpLearnsets[species][sLearningMoveTableID] & 0xFE00) == (level << 9))
+ {
+ gMoveToLearn = (gLevelUpLearnsets[species][sLearningMoveTableID] & 0x1FF);
+ sLearningMoveTableID++;
+ retVal = GiveMoveToMon(mon, gMoveToLearn);
+ }
+
+ return retVal;
+}
+
+void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move)
+{
+ s32 i;
+ u16 moves[4];
+ u8 pp[4];
+ u8 ppBonuses;
+
+ for (i = 0; i < 3; i++)
+ {
+ moves[i] = GetMonData(mon, MON_DATA_MOVE2 + i, NULL);
+ pp[i] = GetMonData(mon, MON_DATA_PP2 + i, NULL);
+ }
+
+ ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES, NULL);
+ ppBonuses >>= 2;
+ moves[3] = move;
+ pp[3] = gBattleMoves[move].pp;
+
+ for (i = 0; i < 4; i++)
+ {
+ SetMonData(mon, MON_DATA_MOVE1 + i, &moves[i]);
+ SetMonData(mon, MON_DATA_PP1 + i, &pp[i]);
+ }
+
+ SetMonData(mon, MON_DATA_PP_BONUSES, &ppBonuses);
+}
+
+void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move)
+{
+ s32 i;
+ u16 moves[4];
+ u8 pp[4];
+ u8 ppBonuses;
+
+ for (i = 0; i < 3; i++)
+ {
+ moves[i] = GetBoxMonData(boxMon, MON_DATA_MOVE2 + i, NULL);
+ pp[i] = GetBoxMonData(boxMon, MON_DATA_PP2 + i, NULL);
+ }
+
+ ppBonuses = GetBoxMonData(boxMon, MON_DATA_PP_BONUSES, NULL);
+ ppBonuses >>= 2;
+ moves[3] = move;
+ pp[3] = gBattleMoves[move].pp;
+
+ for (i = 0; i < 4; i++)
+ {
+ SetBoxMonData(boxMon, MON_DATA_MOVE1 + i, &moves[i]);
+ SetBoxMonData(boxMon, MON_DATA_PP1 + i, &pp[i]);
+ }
+
+ SetBoxMonData(boxMon, MON_DATA_PP_BONUSES, &ppBonuses);
+}
+
+#define APPLY_STAT_MOD(var, mon, stat, statIndex) \
+{ \
+ (var) = (stat) * (gStatStageRatios)[(mon)->statStages[(statIndex)]][0]; \
+ (var) /= (gStatStageRatios)[(mon)->statStages[(statIndex)]][1]; \
+}
+
+s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *defender, u32 move, u16 sideStatus, u16 powerOverride, u8 typeOverride, u8 battlerIdAtk, u8 battlerIdDef)
+{
+ u32 i;
+ s32 damage = 0;
+ s32 damageHelper;
+ u8 type;
+ u16 attack, defense;
+ u16 spAttack, spDefense;
+ u8 defenderHoldEffect;
+ u8 defenderHoldEffectParam;
+ u8 attackerHoldEffect;
+ u8 attackerHoldEffectParam;
+
+ if (!powerOverride)
+ gBattleMovePower = gBattleMoves[move].power;
+ else
+ gBattleMovePower = powerOverride;
+
+ if (!typeOverride)
+ type = gBattleMoves[move].type;
+ else
+ type = typeOverride & 0x3F;
+
+ attack = attacker->attack;
+ defense = defender->defense;
+ spAttack = attacker->spAttack;
+ spDefense = defender->spDefense;
+
+ if (attacker->item == ITEM_ENIGMA_BERRY)
+ {
+ attackerHoldEffect = gEnigmaBerries[battlerIdAtk].holdEffect;
+ attackerHoldEffectParam = gEnigmaBerries[battlerIdAtk].holdEffectParam;
+ }
+ else
+ {
+ attackerHoldEffect = ItemId_GetHoldEffect(attacker->item);
+ attackerHoldEffectParam = ItemId_GetHoldEffectParam(attacker->item);
+ }
+
+ if (defender->item == ITEM_ENIGMA_BERRY)
+ {
+ defenderHoldEffect = gEnigmaBerries[battlerIdDef].holdEffect;
+ defenderHoldEffectParam = gEnigmaBerries[battlerIdDef].holdEffectParam;
+ }
+ else
+ {
+ defenderHoldEffect = ItemId_GetHoldEffect(defender->item);
+ defenderHoldEffectParam = ItemId_GetHoldEffectParam(defender->item);
+ }
+
+ if (attacker->ability == ABILITY_HUGE_POWER || attacker->ability == ABILITY_PURE_POWER)
+ attack *= 2;
+
+ // In FRLG, the Battle Tower and opponent checks are stubbed here.
+ if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | /*BATTLE_TYPE_BATTLE_TOWER |*/ BATTLE_TYPE_EREADER_TRAINER)))
+ {
+ if (FlagGet(FLAG_UNK820)
+ && !GetBattlerSide(battlerIdAtk))
+ attack = (110 * attack) / 100;
+ }
+ if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | /*BATTLE_TYPE_BATTLE_TOWER |*/ BATTLE_TYPE_EREADER_TRAINER)))
+ {
+ if (FlagGet(FLAG_UNK824)
+ && !GetBattlerSide(battlerIdDef))
+ defense = (110 * defense) / 100;
+ }
+ if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | /*BATTLE_TYPE_BATTLE_TOWER |*/ BATTLE_TYPE_EREADER_TRAINER)))
+ {
+ if (FlagGet(FLAG_UNK826)
+ && !GetBattlerSide(battlerIdAtk))
+ spAttack = (110 * spAttack) / 100;
+ }
+ if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | /*BATTLE_TYPE_BATTLE_TOWER |*/ BATTLE_TYPE_EREADER_TRAINER)))
+ {
+ if (FlagGet(FLAG_UNK826)
+ && !GetBattlerSide(battlerIdDef))
+ spDefense = (110 * spDefense) / 100;
+ }
+
+ // TODO: Use ARRAY_COUNT(sHoldEffectToType)
+ for (i = 0; i < 17; i++)
+ {
+ if (attackerHoldEffect == sHoldEffectToType[i][0]
+ && type == sHoldEffectToType[i][1])
+ {
+ if (IS_TYPE_PHYSICAL(type))
+ attack = (attack * (attackerHoldEffectParam + 100)) / 100;
+ else
+ spAttack = (spAttack * (attackerHoldEffectParam + 100)) / 100;
+ break;
+ }
+ }
+
+ if (attackerHoldEffect == HOLD_EFFECT_CHOICE_BAND)
+ attack = (150 * attack) / 100;
+ if (attackerHoldEffect == HOLD_EFFECT_SOUL_DEW && !(gBattleTypeFlags & (BATTLE_TYPE_BATTLE_TOWER)) && (attacker->species == SPECIES_LATIAS || attacker->species == SPECIES_LATIOS))
+ spAttack = (150 * spAttack) / 100;
+ if (defenderHoldEffect == HOLD_EFFECT_SOUL_DEW && !(gBattleTypeFlags & (BATTLE_TYPE_BATTLE_TOWER)) && (defender->species == SPECIES_LATIAS || defender->species == SPECIES_LATIOS))
+ spDefense = (150 * spDefense) / 100;
+ if (attackerHoldEffect == HOLD_EFFECT_DEEP_SEA_TOOTH && attacker->species == SPECIES_CLAMPERL)
+ spAttack *= 2;
+ if (defenderHoldEffect == HOLD_EFFECT_DEEP_SEA_SCALE && defender->species == SPECIES_CLAMPERL)
+ spDefense *= 2;
+ if (attackerHoldEffect == HOLD_EFFECT_LIGHT_BALL && attacker->species == SPECIES_PIKACHU)
+ spAttack *= 2;
+ if (defenderHoldEffect == HOLD_EFFECT_METAL_POWDER && defender->species == SPECIES_DITTO)
+ defense *= 2;
+ if (attackerHoldEffect == HOLD_EFFECT_THICK_CLUB && (attacker->species == SPECIES_CUBONE || attacker->species == SPECIES_MAROWAK))
+ attack *= 2;
+ if (defender->ability == ABILITY_THICK_FAT && (type == TYPE_FIRE || type == TYPE_ICE))
+ spAttack /= 2;
+ if (attacker->ability == ABILITY_HUSTLE)
+ attack = (150 * attack) / 100;
+ if (attacker->ability == ABILITY_PLUS && ABILITY_ON_FIELD2(ABILITY_MINUS))
+ spAttack = (150 * spAttack) / 100;
+ if (attacker->ability == ABILITY_MINUS && ABILITY_ON_FIELD2(ABILITY_PLUS))
+ spAttack = (150 * spAttack) / 100;
+ if (attacker->ability == ABILITY_GUTS && attacker->status1)
+ attack = (150 * attack) / 100;
+ if (defender->ability == ABILITY_MARVEL_SCALE && defender->status1)
+ defense = (150 * defense) / 100;
+ if (type == TYPE_ELECTRIC && AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, 0, 0xFD, 0))
+ gBattleMovePower /= 2;
+ if (type == TYPE_FIRE && AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, 0, 0xFE, 0))
+ gBattleMovePower /= 2;
+ if (type == TYPE_GRASS && attacker->ability == ABILITY_OVERGROW && attacker->hp <= (attacker->maxHP / 3))
+ gBattleMovePower = (150 * gBattleMovePower) / 100;
+ if (type == TYPE_FIRE && attacker->ability == ABILITY_BLAZE && attacker->hp <= (attacker->maxHP / 3))
+ gBattleMovePower = (150 * gBattleMovePower) / 100;
+ if (type == TYPE_WATER && attacker->ability == ABILITY_TORRENT && attacker->hp <= (attacker->maxHP / 3))
+ gBattleMovePower = (150 * gBattleMovePower) / 100;
+ if (type == TYPE_BUG && attacker->ability == ABILITY_SWARM && attacker->hp <= (attacker->maxHP / 3))
+ gBattleMovePower = (150 * gBattleMovePower) / 100;
+ if (gBattleMoves[gCurrentMove].effect == EFFECT_EXPLOSION)
+ defense /= 2;
+
+ if (IS_TYPE_PHYSICAL(type))
+ {
+ if (gCritMultiplier == 2)
+ {
+ if (attacker->statStages[STAT_ATK] > 6)
+ APPLY_STAT_MOD(damage, attacker, attack, STAT_ATK)
+ else
+ damage = attack;
+ }
+ else
+ APPLY_STAT_MOD(damage, attacker, attack, STAT_ATK)
+
+ damage = damage * gBattleMovePower;
+ damage *= (2 * attacker->level / 5 + 2);
+
+ if (gCritMultiplier == 2)
+ {
+ if (defender->statStages[STAT_DEF] < 6)
+ APPLY_STAT_MOD(damageHelper, defender, defense, STAT_DEF)
+ else
+ damageHelper = defense;
+ }
+ else
+ APPLY_STAT_MOD(damageHelper, defender, defense, STAT_DEF)
+
+ damage = damage / damageHelper;
+ damage /= 50;
+
+ if ((attacker->status1 & STATUS1_BURN) && attacker->ability != ABILITY_GUTS)
+ damage /= 2;
+
+ if ((sideStatus & SIDE_STATUS_REFLECT) && gCritMultiplier == 1)
+ {
+ if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && CountAliveMons(2) == 2)
+ damage = 2 * (damage / 3);
+ else
+ damage /= 2;
+ }
+
+ if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gBattleMoves[move].target == 8 && CountAliveMons(2) == 2)
+ damage /= 2;
+
+ // moves always do at least 1 damage.
+ if (damage == 0)
+ damage = 1;
+ }
+
+ if (type == TYPE_MYSTERY)
+ damage = 0; // is ??? type. does 0 damage.
+
+ if (IS_TYPE_SPECIAL(type))
+ {
+ if (gCritMultiplier == 2)
+ {
+ if (attacker->statStages[STAT_SPATK] > 6)
+ APPLY_STAT_MOD(damage, attacker, spAttack, STAT_SPATK)
+ else
+ damage = spAttack;
+ }
+ else
+ APPLY_STAT_MOD(damage, attacker, spAttack, STAT_SPATK)
+
+ damage = damage * gBattleMovePower;
+ damage *= (2 * attacker->level / 5 + 2);
+
+ if (gCritMultiplier == 2)
+ {
+ if (defender->statStages[STAT_SPDEF] < 6)
+ APPLY_STAT_MOD(damageHelper, defender, spDefense, STAT_SPDEF)
+ else
+ damageHelper = spDefense;
+ }
+ else
+ APPLY_STAT_MOD(damageHelper, defender, spDefense, STAT_SPDEF)
+
+ damage = (damage / damageHelper);
+ damage /= 50;
+
+ if ((sideStatus & SIDE_STATUS_LIGHTSCREEN) && gCritMultiplier == 1)
+ {
+ if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && CountAliveMons(2) == 2)
+ damage = 2 * (damage / 3);
+ else
+ damage /= 2;
+ }
+
+ if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gBattleMoves[move].target == 8 && CountAliveMons(2) == 2)
+ damage /= 2;
+
+ // are effects of weather negated with cloud nine or air lock
+ if (WEATHER_HAS_EFFECT2)
+ {
+ if (gBattleWeather & WEATHER_RAIN_TEMPORARY)
+ {
+ switch (type)
+ {
+ case TYPE_FIRE:
+ damage /= 2;
+ break;
+ case TYPE_WATER:
+ damage = (15 * damage) / 10;
+ break;
+ }
+ }
+
+ // any weather except sun weakens solar beam
+ if ((gBattleWeather & (WEATHER_RAIN_ANY | WEATHER_SANDSTORM_ANY | WEATHER_HAIL)) && gCurrentMove == MOVE_SOLAR_BEAM)
+ damage /= 2;
+
+ // sunny
+ if (gBattleWeather & WEATHER_SUN_ANY)
+ {
+ switch (type)
+ {
+ case TYPE_FIRE:
+ damage = (15 * damage) / 10;
+ break;
+ case TYPE_WATER:
+ damage /= 2;
+ break;
+ }
+ }
+ }
+
+ // flash fire triggered
+ if ((gBattleResources->flags->flags[battlerIdAtk] & UNKNOWN_FLAG_FLASH_FIRE) && type == TYPE_FIRE)
+ damage = (15 * damage) / 10;
+ }
+
+ return damage + 2;
+}
+
+u8 CountAliveMons(u8 a1)
+{
+ s32 i;
+ u8 retVal = 0;
+
+ switch (a1)
+ {
+ case 0:
+ for (i = 0; i < 4; i++)
+ {
+ if (i != gActiveBattler && !(gAbsentBattlerFlags & gBitTable[i]))
+ retVal++;
+ }
+ break;
+ case 1:
+ for (i = 0; i < 4; i++)
+ {
+ if (GetBattlerSide(i) == GetBattlerSide(sBattler_AI) && !(gAbsentBattlerFlags & gBitTable[i]))
+ retVal++;
+ }
+ break;
+ case 2:
+ for (i = 0; i < 4; i++)
+ {
+ if (GetBattlerSide(i) == GetBattlerSide(gBattlerTarget) && !(gAbsentBattlerFlags & gBitTable[i]))
+ retVal++;
+ }
+ break;
+ }
+
+ return retVal;
+}
+
+u8 GetDefaultMoveTarget(u8 a1)
+{
+ u8 status = GetBattlerPosition(a1) & 1;
+
+ status ^= 1;
+ if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE))
+ return GetBattlerAtPosition(status);
+ if (CountAliveMons(0) > 1)
+ {
+ u8 val;
+
+ if ((Random() & 1) == 0)
+ val = status ^ 2;
+ else
+ val = status;
+ return GetBattlerAtPosition(val);
+ }
+ else
+ {
+ if ((gAbsentBattlerFlags & gBitTable[status]))
+ return GetBattlerAtPosition(status ^ 2);
+ else
+ return GetBattlerAtPosition(status);
+ }
+}
+
+u8 GetMonGender(struct Pokemon *mon)
+{
+ return GetBoxMonGender(&mon->box);
+}
+
+u8 GetBoxMonGender(struct BoxPokemon *boxMon)
+{
+ u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL);
+ u32 personality = GetBoxMonData(boxMon, MON_DATA_PERSONALITY, NULL);
+
+ switch (gBaseStats[species].genderRatio)
+ {
+ case MON_MALE:
+ case MON_FEMALE:
+ case MON_GENDERLESS:
+ return gBaseStats[species].genderRatio;
+ }
+
+ if (gBaseStats[species].genderRatio > (personality & 0xFF))
+ return MON_FEMALE;
+ else
+ return MON_MALE;
+}
+
+u8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality)
+{
+ switch (gBaseStats[species].genderRatio)
+ {
+ case MON_MALE:
+ case MON_FEMALE:
+ case MON_GENDERLESS:
+ return gBaseStats[species].genderRatio;
+ }
+
+ if (gBaseStats[species].genderRatio > (personality & 0xFF))
+ return MON_FEMALE;
+ else
+ return MON_MALE;
+}
+
+void sub_803F7D4(u16 trainerSpriteId, u8 battlerPosition)
+{
+ if(gMonSpritesGfxPtr != NULL)
+ {
+ if(battlerPosition >= 4)
+ battlerPosition = 0;
+
+ gMultiuseSpriteTemplate = gMonSpritesGfxPtr->templates[battlerPosition];
+ }
+ else
+ {
+ if(gUnknown_20244F4)
+ {
+ if(battlerPosition >= (s8)gUnknown_20244F4->unk0_2) // why a cast?!? changing the unk0_2 type to s8 causes extra shifts, but a cast is the correct fix. why, compiler?
+ battlerPosition = 0;
+
+ gMultiuseSpriteTemplate = gUnknown_20244F4->unk10[battlerPosition];
+ }
+ else
+ {
+ if(battlerPosition >= 4)
+ battlerPosition = 0;
+
+ gMultiuseSpriteTemplate = gUnknown_825DEF0[battlerPosition];
+ }
+ }
+ gMultiuseSpriteTemplate.paletteTag = trainerSpriteId;
+ gMultiuseSpriteTemplate.anims = gUnknown_82349BC;
+}
+
+void SetMultiuseSpriteTemplateToTrainerBack(u16 trainerSpriteId, u8 battlerPosition)
+{
+ gMultiuseSpriteTemplate.paletteTag = trainerSpriteId;
+ if(battlerPosition == B_POSITION_PLAYER_LEFT || battlerPosition == B_POSITION_PLAYER_RIGHT)
+ {
+ gMultiuseSpriteTemplate = gUnknown_825DF50[trainerSpriteId];
+ gMultiuseSpriteTemplate.anims = gTrainerBackAnimsPtrTable[trainerSpriteId];
+ }
+ else
+ {
+ if (gMonSpritesGfxPtr != NULL)
+ gMultiuseSpriteTemplate = gMonSpritesGfxPtr->templates[battlerPosition];
+ else
+ gMultiuseSpriteTemplate = gUnknown_825DEF0[battlerPosition];
+ gMultiuseSpriteTemplate.anims = gTrainerFrontAnimsPtrTable[trainerSpriteId];
+ }
+}
+
+void EncryptBoxMon(struct BoxPokemon *boxMon)
+{
+ u32 i;
+ for (i = 0; i < 12; i++)
+ {
+ boxMon->secure.raw[i] ^= boxMon->personality;
+ boxMon->secure.raw[i] ^= boxMon->otId;
+ }
+}
+
+void DecryptBoxMon(struct BoxPokemon *boxMon)
+{
+ u32 i;
+ for (i = 0; i < 12; i++)
+ {
+ boxMon->secure.raw[i] ^= boxMon->otId;
+ boxMon->secure.raw[i] ^= boxMon->personality;
+ }
+}
+
+#define SUBSTRUCT_CASE(n, v1, v2, v3, v4) \
+case n: \
+ { \
+ union PokemonSubstruct *substructs0 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs1 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs2 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs3 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs4 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs5 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs6 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs7 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs8 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs9 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs10 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs11 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs12 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs13 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs14 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs15 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs16 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs17 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs18 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs19 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs20 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs21 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs22 = boxMon->secure.substructs; \
+ union PokemonSubstruct *substructs23 = boxMon->secure.substructs; \
+ \
+ switch (substructType) \
+ { \
+ case 0: \
+ substruct = &substructs ## n [v1]; \
+ break; \
+ case 1: \
+ substruct = &substructs ## n [v2]; \
+ break; \
+ case 2: \
+ substruct = &substructs ## n [v3]; \
+ break; \
+ case 3: \
+ substruct = &substructs ## n [v4]; \
+ break; \
+ } \
+ break; \
+ } \
+
+union PokemonSubstruct *GetSubstruct(struct BoxPokemon *boxMon, u32 personality, u8 substructType)
+{
+ union PokemonSubstruct *substruct = NULL;
+
+ switch (personality % 24)
+ {
+ SUBSTRUCT_CASE( 0,0,1,2,3)
+ SUBSTRUCT_CASE( 1,0,1,3,2)
+ SUBSTRUCT_CASE( 2,0,2,1,3)
+ SUBSTRUCT_CASE( 3,0,3,1,2)
+ SUBSTRUCT_CASE( 4,0,2,3,1)
+ SUBSTRUCT_CASE( 5,0,3,2,1)
+ SUBSTRUCT_CASE( 6,1,0,2,3)
+ SUBSTRUCT_CASE( 7,1,0,3,2)
+ SUBSTRUCT_CASE( 8,2,0,1,3)
+ SUBSTRUCT_CASE( 9,3,0,1,2)
+ SUBSTRUCT_CASE(10,2,0,3,1)
+ SUBSTRUCT_CASE(11,3,0,2,1)
+ SUBSTRUCT_CASE(12,1,2,0,3)
+ SUBSTRUCT_CASE(13,1,3,0,2)
+ SUBSTRUCT_CASE(14,2,1,0,3)
+ SUBSTRUCT_CASE(15,3,1,0,2)
+ SUBSTRUCT_CASE(16,2,3,0,1)
+ SUBSTRUCT_CASE(17,3,2,0,1)
+ SUBSTRUCT_CASE(18,1,2,3,0)
+ SUBSTRUCT_CASE(19,1,3,2,0)
+ SUBSTRUCT_CASE(20,2,1,3,0)
+ SUBSTRUCT_CASE(21,3,1,2,0)
+ SUBSTRUCT_CASE(22,2,3,1,0)
+ SUBSTRUCT_CASE(23,3,2,1,0)
+ }
+
+ return substruct;
+}
+
+u32 GetMonData(struct Pokemon *mon, s32 field, u8* data)
+{
+ u32 ret;
+
+ switch (field)
+ {
+ case MON_DATA_STATUS:
+ ret = mon->status;
+ break;
+ case MON_DATA_LEVEL:
+ ret = mon->level;
+ break;
+ case MON_DATA_HP:
+ ret = mon->hp;
+ break;
+ case MON_DATA_MAX_HP:
+ ret = mon->maxHP;
+ break;
+ case MON_DATA_ATK:
+ ret = (u16)GetDeoxysStat(mon, STAT_ATK);
+ if (!ret)
+ ret = mon->attack;
+ break;
+ case MON_DATA_DEF:
+ ret = (u16)GetDeoxysStat(mon, STAT_DEF);
+ if (!ret)
+ ret = mon->defense;
+ break;
+ case MON_DATA_SPEED:
+ ret = (u16)GetDeoxysStat(mon, STAT_SPEED);
+ if (!ret)
+ ret = mon->speed;
+ break;
+ case MON_DATA_SPATK:
+ ret = (u16)GetDeoxysStat(mon, STAT_SPATK);
+ if (!ret)
+ ret = mon->spAttack;
+ break;
+ case MON_DATA_SPDEF:
+ ret = (u16)GetDeoxysStat(mon, STAT_SPDEF);
+ if (!ret)
+ ret = mon->spDefense;
+ break;
+ case MON_DATA_ATK2:
+ ret = mon->attack;
+ break;
+ case MON_DATA_DEF2:
+ ret = mon->defense;
+ break;
+ case MON_DATA_SPEED2:
+ ret = mon->speed;
+ break;
+ case MON_DATA_SPATK2:
+ ret = mon->spAttack;
+ break;
+ case MON_DATA_SPDEF2:
+ ret = mon->spDefense;
+ break;
+ case MON_DATA_MAIL:
+ ret = mon->mail;
+ break;
+ default:
+ ret = GetBoxMonData(&mon->box, field, data);
+ break;
+ }
+ return ret;
+}
+
+u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data)
+{
+ s32 i;
+ u32 retVal = 0;
+ struct PokemonSubstruct0 *substruct0 = NULL;
+ struct PokemonSubstruct1 *substruct1 = NULL;
+ struct PokemonSubstruct2 *substruct2 = NULL;
+ struct PokemonSubstruct3 *substruct3 = NULL;
+
+ if (field > MON_DATA_10)
+ {
+ substruct0 = &(GetSubstruct(boxMon, boxMon->personality, 0)->type0);
+ substruct1 = &(GetSubstruct(boxMon, boxMon->personality, 1)->type1);
+ substruct2 = &(GetSubstruct(boxMon, boxMon->personality, 2)->type2);
+ substruct3 = &(GetSubstruct(boxMon, boxMon->personality, 3)->type3);
+
+ DecryptBoxMon(boxMon);
+
+ if (CalculateBoxMonChecksum(boxMon) != boxMon->checksum)
+ {
+ boxMon->isBadEgg = 1;
+ boxMon->isEgg = 1;
+ substruct3->isEgg = 1;
+ }
+ }
+
+ switch (field)
+ {
+ case MON_DATA_PERSONALITY:
+ retVal = boxMon->personality;
+ break;
+ case MON_DATA_OT_ID:
+ retVal = boxMon->otId;
+ break;
+ case MON_DATA_NICKNAME:
+ {
+ if (boxMon->isBadEgg)
+ {
+ for (retVal = 0;
+ retVal < POKEMON_NAME_LENGTH && gText_BadEgg[retVal] != EOS;
+ data[retVal] = gText_BadEgg[retVal], retVal++) {}
+
+ data[retVal] = EOS;
+ }
+ else if (boxMon->isEgg)
+ {
+ StringCopy(data, gText_EggNickname);
+ retVal = StringLength(data);
+ }
+ else if (boxMon->language == LANGUAGE_JAPANESE)
+ {
+ data[0] = EXT_CTRL_CODE_BEGIN;
+ data[1] = EXT_CTRL_CODE_JPN;
+
+ // FRLG changed i < 7 to i < 6
+ for (retVal = 2, i = 0;
+ i < 6 && boxMon->nickname[i] != EOS;
+ data[retVal] = boxMon->nickname[i], retVal++, i++) {}
+
+ data[retVal++] = EXT_CTRL_CODE_BEGIN;
+ data[retVal++] = EXT_CTRL_CODE_ENG;
+ data[retVal] = EOS;
+ }
+ else
+ {
+ for (retVal = 0;
+ retVal < POKEMON_NAME_LENGTH;
+ data[retVal] = boxMon->nickname[retVal], retVal++){}
+
+ data[retVal] = EOS;
+ }
+ break;
+ }
+ case MON_DATA_LANGUAGE:
+ retVal = boxMon->language;
+ break;
+ case MON_DATA_SANITY_BIT1:
+ retVal = boxMon->isBadEgg;
+ break;
+ case MON_DATA_SANITY_BIT2:
+ retVal = boxMon->hasSpecies;
+ break;
+ case MON_DATA_SANITY_BIT3:
+ retVal = boxMon->isEgg;
+ break;
+ case MON_DATA_OT_NAME:
+ {
+ retVal = 0;
+
+ // FRLG changed this to 7 which used to be PLAYER_NAME_LENGTH
+ while (retVal < 7)
+ {
+ data[retVal] = boxMon->otName[retVal];
+ retVal++;
+ }
+
+ data[retVal] = EOS;
+ break;
+ }
+ case MON_DATA_MARKINGS:
+ retVal = boxMon->markings;
+ break;
+ case MON_DATA_CHECKSUM:
+ retVal = boxMon->checksum;
+ break;
+ case MON_DATA_10:
+ retVal = boxMon->unknown;
+ break;
+ case MON_DATA_SPECIES:
+ retVal = boxMon->isBadEgg ? SPECIES_EGG : substruct0->species;
+ break;
+ case MON_DATA_HELD_ITEM:
+ retVal = substruct0->heldItem;
+ break;
+ case MON_DATA_EXP:
+ retVal = substruct0->experience;
+ break;
+ case MON_DATA_PP_BONUSES:
+ retVal = substruct0->ppBonuses;
+ break;
+ case MON_DATA_FRIENDSHIP:
+ retVal = substruct0->friendship;
+ break;
+ case MON_DATA_MOVE1:
+ case MON_DATA_MOVE2:
+ case MON_DATA_MOVE3:
+ case MON_DATA_MOVE4:
+ retVal = substruct1->moves[field - MON_DATA_MOVE1];
+ break;
+ case MON_DATA_PP1:
+ case MON_DATA_PP2:
+ case MON_DATA_PP3:
+ case MON_DATA_PP4:
+ retVal = substruct1->pp[field - MON_DATA_PP1];
+ break;
+ case MON_DATA_HP_EV:
+ retVal = substruct2->hpEV;
+ break;
+ case MON_DATA_ATK_EV:
+ retVal = substruct2->attackEV;
+ break;
+ case MON_DATA_DEF_EV:
+ retVal = substruct2->defenseEV;
+ break;
+ case MON_DATA_SPEED_EV:
+ retVal = substruct2->speedEV;
+ break;
+ case MON_DATA_SPATK_EV:
+ retVal = substruct2->spAttackEV;
+ break;
+ case MON_DATA_SPDEF_EV:
+ retVal = substruct2->spDefenseEV;
+ break;
+ case MON_DATA_COOL:
+ retVal = substruct2->cool;
+ break;
+ case MON_DATA_BEAUTY:
+ retVal = substruct2->beauty;
+ break;
+ case MON_DATA_CUTE:
+ retVal = substruct2->cute;
+ break;
+ case MON_DATA_SMART:
+ retVal = substruct2->smart;
+ break;
+ case MON_DATA_TOUGH:
+ retVal = substruct2->tough;
+ break;
+ case MON_DATA_SHEEN:
+ retVal = substruct2->sheen;
+ break;
+ case MON_DATA_POKERUS:
+ retVal = substruct3->pokerus;
+ break;
+ case MON_DATA_MET_LOCATION:
+ retVal = substruct3->metLocation;
+ break;
+ case MON_DATA_MET_LEVEL:
+ retVal = substruct3->metLevel;
+ break;
+ case MON_DATA_MET_GAME:
+ retVal = substruct3->metGame;
+ break;
+ case MON_DATA_POKEBALL:
+ retVal = substruct3->pokeball;
+ break;
+ case MON_DATA_OT_GENDER:
+ retVal = substruct3->otGender;
+ break;
+ case MON_DATA_HP_IV:
+ retVal = substruct3->hpIV;
+ break;
+ case MON_DATA_ATK_IV:
+ retVal = substruct3->attackIV;
+ break;
+ case MON_DATA_DEF_IV:
+ retVal = substruct3->defenseIV;
+ break;
+ case MON_DATA_SPEED_IV:
+ retVal = substruct3->speedIV;
+ break;
+ case MON_DATA_SPATK_IV:
+ retVal = substruct3->spAttackIV;
+ break;
+ case MON_DATA_SPDEF_IV:
+ retVal = substruct3->spDefenseIV;
+ break;
+ case MON_DATA_IS_EGG:
+ retVal = substruct3->isEgg;
+ break;
+ case MON_DATA_ALT_ABILITY:
+ retVal = substruct3->altAbility;
+ break;
+ case MON_DATA_COOL_RIBBON:
+ retVal = substruct3->coolRibbon;
+ break;
+ case MON_DATA_BEAUTY_RIBBON:
+ retVal = substruct3->beautyRibbon;
+ break;
+ case MON_DATA_CUTE_RIBBON:
+ retVal = substruct3->cuteRibbon;
+ break;
+ case MON_DATA_SMART_RIBBON:
+ retVal = substruct3->smartRibbon;
+ break;
+ case MON_DATA_TOUGH_RIBBON:
+ retVal = substruct3->toughRibbon;
+ break;
+ case MON_DATA_CHAMPION_RIBBON:
+ retVal = substruct3->championRibbon;
+ break;
+ case MON_DATA_WINNING_RIBBON:
+ retVal = substruct3->winningRibbon;
+ break;
+ case MON_DATA_VICTORY_RIBBON:
+ retVal = substruct3->victoryRibbon;
+ break;
+ case MON_DATA_ARTIST_RIBBON:
+ retVal = substruct3->artistRibbon;
+ break;
+ case MON_DATA_EFFORT_RIBBON:
+ retVal = substruct3->effortRibbon;
+ break;
+ case MON_DATA_GIFT_RIBBON_1:
+ retVal = substruct3->giftRibbon1;
+ break;
+ case MON_DATA_GIFT_RIBBON_2:
+ retVal = substruct3->giftRibbon2;
+ break;
+ case MON_DATA_GIFT_RIBBON_3:
+ retVal = substruct3->giftRibbon3;
+ break;
+ case MON_DATA_GIFT_RIBBON_4:
+ retVal = substruct3->giftRibbon4;
+ break;
+ case MON_DATA_GIFT_RIBBON_5:
+ retVal = substruct3->giftRibbon5;
+ break;
+ case MON_DATA_GIFT_RIBBON_6:
+ retVal = substruct3->giftRibbon6;
+ break;
+ case MON_DATA_GIFT_RIBBON_7:
+ retVal = substruct3->giftRibbon7;
+ break;
+ case MON_DATA_FATEFUL_ENCOUNTER:
+ retVal = substruct3->fatefulEncounter;
+ break;
+ case MON_DATA_OBEDIENCE:
+ retVal = substruct3->obedient;
+ break;
+ case MON_DATA_SPECIES2:
+ retVal = substruct0->species;
+ if (substruct0->species && (substruct3->isEgg || boxMon->isBadEgg))
+ retVal = SPECIES_EGG;
+ break;
+ case MON_DATA_IVS:
+ retVal = substruct3->hpIV | (substruct3->attackIV << 5) | (substruct3->defenseIV << 10) | (substruct3->speedIV << 15) | (substruct3->spAttackIV << 20) | (substruct3->spDefenseIV << 25);
+ break;
+ case MON_DATA_KNOWN_MOVES:
+ if (substruct0->species && !substruct3->isEgg)
+ {
+ u16 *moves = (u16 *)data;
+ s32 i = 0;
+
+ while (moves[i] != 355)
+ {
+ u16 move = moves[i];
+ if (substruct1->moves[0] == move
+ || substruct1->moves[1] == move
+ || substruct1->moves[2] == move
+ || substruct1->moves[3] == move)
+ retVal |= gBitTable[i];
+ i++;
+ }
+ }
+ break;
+ case MON_DATA_RIBBON_COUNT:
+ retVal = 0;
+ if (substruct0->species && !substruct3->isEgg)
+ {
+ retVal += substruct3->coolRibbon;
+ retVal += substruct3->beautyRibbon;
+ retVal += substruct3->cuteRibbon;
+ retVal += substruct3->smartRibbon;
+ retVal += substruct3->toughRibbon;
+ retVal += substruct3->championRibbon;
+ retVal += substruct3->winningRibbon;
+ retVal += substruct3->victoryRibbon;
+ retVal += substruct3->artistRibbon;
+ retVal += substruct3->effortRibbon;
+ retVal += substruct3->giftRibbon1;
+ retVal += substruct3->giftRibbon2;
+ retVal += substruct3->giftRibbon3;
+ retVal += substruct3->giftRibbon4;
+ retVal += substruct3->giftRibbon5;
+ retVal += substruct3->giftRibbon6;
+ retVal += substruct3->giftRibbon7;
+ }
+ break;
+ case MON_DATA_RIBBONS:
+ retVal = 0;
+ if (substruct0->species && !substruct3->isEgg)
+ {
+ retVal = substruct3->championRibbon
+ | (substruct3->coolRibbon << 1)
+ | (substruct3->beautyRibbon << 4)
+ | (substruct3->cuteRibbon << 7)
+ | (substruct3->smartRibbon << 10)
+ | (substruct3->toughRibbon << 13)
+ | (substruct3->winningRibbon << 16)
+ | (substruct3->victoryRibbon << 17)
+ | (substruct3->artistRibbon << 18)
+ | (substruct3->effortRibbon << 19)
+ | (substruct3->giftRibbon1 << 20)
+ | (substruct3->giftRibbon2 << 21)
+ | (substruct3->giftRibbon3 << 22)
+ | (substruct3->giftRibbon4 << 23)
+ | (substruct3->giftRibbon5 << 24)
+ | (substruct3->giftRibbon6 << 25)
+ | (substruct3->giftRibbon7 << 26);
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (field > MON_DATA_10)
+ EncryptBoxMon(boxMon);
+
+ return retVal;
+}
+
+#define SET8(lhs) (lhs) = *data
+#define SET16(lhs) (lhs) = data[0] + (data[1] << 8)
+#define SET32(lhs) (lhs) = data[0] + (data[1] << 8) + (data[2] << 16) + (data[3] << 24)
+
+void SetMonData(struct Pokemon *mon, s32 field, const void *dataArg)
+{
+ const u8 *data = dataArg;
+
+ switch (field)
+ {
+ case MON_DATA_STATUS:
+ SET32(mon->status);
+ break;
+ case MON_DATA_LEVEL:
+ SET8(mon->level);
+ break;
+ case MON_DATA_HP:
+ SET16(mon->hp);
+ break;
+ case MON_DATA_MAX_HP:
+ SET16(mon->maxHP);
+ break;
+ case MON_DATA_ATK:
+ case MON_DATA_ATK2:
+ SET16(mon->attack);
+ break;
+ case MON_DATA_DEF:
+ case MON_DATA_DEF2:
+ SET16(mon->defense);
+ break;
+ case MON_DATA_SPEED:
+ case MON_DATA_SPEED2:
+ SET16(mon->speed);
+ break;
+ case MON_DATA_SPATK:
+ case MON_DATA_SPATK2:
+ SET16(mon->spAttack);
+ break;
+ case MON_DATA_SPDEF:
+ case MON_DATA_SPDEF2:
+ SET16(mon->spDefense);
+ break;
+ case MON_DATA_MAIL:
+ SET8(mon->mail);
+ break;
+ case MON_DATA_SPECIES2:
+ break;
+ // why did FRLG go out of its way to specify all of these for default?
+ case MON_DATA_IVS:
+ case MON_DATA_CHAMPION_RIBBON:
+ case MON_DATA_WINNING_RIBBON:
+ case MON_DATA_VICTORY_RIBBON:
+ case MON_DATA_ARTIST_RIBBON:
+ case MON_DATA_EFFORT_RIBBON:
+ case MON_DATA_GIFT_RIBBON_1:
+ case MON_DATA_GIFT_RIBBON_2:
+ case MON_DATA_GIFT_RIBBON_3:
+ case MON_DATA_GIFT_RIBBON_4:
+ case MON_DATA_GIFT_RIBBON_5:
+ case MON_DATA_GIFT_RIBBON_6:
+ case MON_DATA_GIFT_RIBBON_7:
+ case MON_DATA_FATEFUL_ENCOUNTER:
+ case MON_DATA_OBEDIENCE:
+ case MON_DATA_KNOWN_MOVES:
+ case MON_DATA_RIBBON_COUNT:
+ case MON_DATA_RIBBONS:
+ default:
+ SetBoxMonData(&mon->box, field, data);
+ break;
+ }
+}
+
+void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg)
+{
+ const u8 *data = dataArg;
+
+ struct PokemonSubstruct0 *substruct0 = NULL;
+ struct PokemonSubstruct1 *substruct1 = NULL;
+ struct PokemonSubstruct2 *substruct2 = NULL;
+ struct PokemonSubstruct3 *substruct3 = NULL;
+
+ if (field > MON_DATA_10)
+ {
+ substruct0 = &(GetSubstruct(boxMon, boxMon->personality, 0)->type0);
+ substruct1 = &(GetSubstruct(boxMon, boxMon->personality, 1)->type1);
+ substruct2 = &(GetSubstruct(boxMon, boxMon->personality, 2)->type2);
+ substruct3 = &(GetSubstruct(boxMon, boxMon->personality, 3)->type3);
+
+ DecryptBoxMon(boxMon);
+
+ if (CalculateBoxMonChecksum(boxMon) != boxMon->checksum)
+ {
+ boxMon->isBadEgg = 1;
+ boxMon->isEgg = 1;
+ substruct3->isEgg = 1;
+ EncryptBoxMon(boxMon);
+ return;
+ }
+ }
+
+ switch (field)
+ {
+ case MON_DATA_PERSONALITY:
+ SET32(boxMon->personality);
+ break;
+ case MON_DATA_OT_ID:
+ SET32(boxMon->otId);
+ break;
+ case MON_DATA_NICKNAME:
+ {
+ s32 i;
+ for (i = 0; i < POKEMON_NAME_LENGTH; i++)
+ boxMon->nickname[i] = data[i];
+ break;
+ }
+ case MON_DATA_LANGUAGE:
+ SET8(boxMon->language);
+ break;
+ case MON_DATA_SANITY_BIT1:
+ SET8(boxMon->isBadEgg);
+ break;
+ case MON_DATA_SANITY_BIT2:
+ SET8(boxMon->hasSpecies);
+ break;
+ case MON_DATA_SANITY_BIT3:
+ SET8(boxMon->isEgg);
+ break;
+ case MON_DATA_OT_NAME:
+ {
+ s32 i;
+ for (i = 0; i < 7; i++)
+ boxMon->otName[i] = data[i];
+ break;
+ }
+ case MON_DATA_MARKINGS:
+ SET8(boxMon->markings);
+ break;
+ case MON_DATA_CHECKSUM:
+ SET16(boxMon->checksum);
+ break;
+ case MON_DATA_10:
+ SET16(boxMon->unknown);
+ break;
+ case MON_DATA_SPECIES:
+ {
+ SET16(substruct0->species);
+ if (substruct0->species)
+ boxMon->hasSpecies = 1;
+ else
+ boxMon->hasSpecies = 0;
+ break;
+ }
+ case MON_DATA_HELD_ITEM:
+ SET16(substruct0->heldItem);
+ break;
+ case MON_DATA_EXP:
+ SET32(substruct0->experience);
+ break;
+ case MON_DATA_PP_BONUSES:
+ SET8(substruct0->ppBonuses);
+ break;
+ case MON_DATA_FRIENDSHIP:
+ SET8(substruct0->friendship);
+ break;
+ case MON_DATA_MOVE1:
+ case MON_DATA_MOVE2:
+ case MON_DATA_MOVE3:
+ case MON_DATA_MOVE4:
+ SET16(substruct1->moves[field - MON_DATA_MOVE1]);
+ break;
+ case MON_DATA_PP1:
+ case MON_DATA_PP2:
+ case MON_DATA_PP3:
+ case MON_DATA_PP4:
+ SET8(substruct1->pp[field - MON_DATA_PP1]);
+ break;
+ case MON_DATA_HP_EV:
+ SET8(substruct2->hpEV);
+ break;
+ case MON_DATA_ATK_EV:
+ SET8(substruct2->attackEV);
+ break;
+ case MON_DATA_DEF_EV:
+ SET8(substruct2->defenseEV);
+ break;
+ case MON_DATA_SPEED_EV:
+ SET8(substruct2->speedEV);
+ break;
+ case MON_DATA_SPATK_EV:
+ SET8(substruct2->spAttackEV);
+ break;
+ case MON_DATA_SPDEF_EV:
+ SET8(substruct2->spDefenseEV);
+ break;
+ case MON_DATA_COOL:
+ SET8(substruct2->cool);
+ break;
+ case MON_DATA_BEAUTY:
+ SET8(substruct2->beauty);
+ break;
+ case MON_DATA_CUTE:
+ SET8(substruct2->cute);
+ break;
+ case MON_DATA_SMART:
+ SET8(substruct2->smart);
+ break;
+ case MON_DATA_TOUGH:
+ SET8(substruct2->tough);
+ break;
+ case MON_DATA_SHEEN:
+ SET8(substruct2->sheen);
+ break;
+ case MON_DATA_POKERUS:
+ SET8(substruct3->pokerus);
+ break;
+ case MON_DATA_MET_LOCATION:
+ SET8(substruct3->metLocation);
+ break;
+ case MON_DATA_MET_LEVEL:
+ {
+ u8 metLevel = *data;
+ substruct3->metLevel = metLevel;
+ break;
+ }
+ case MON_DATA_MET_GAME:
+ SET8(substruct3->metGame);
+ break;
+ case MON_DATA_POKEBALL:
+ {
+ u8 pokeball = *data;
+ substruct3->pokeball = pokeball;
+ break;
+ }
+ case MON_DATA_OT_GENDER:
+ SET8(substruct3->otGender);
+ break;
+ case MON_DATA_HP_IV:
+ SET8(substruct3->hpIV);
+ break;
+ case MON_DATA_ATK_IV:
+ SET8(substruct3->attackIV);
+ break;
+ case MON_DATA_DEF_IV:
+ SET8(substruct3->defenseIV);
+ break;
+ case MON_DATA_SPEED_IV:
+ SET8(substruct3->speedIV);
+ break;
+ case MON_DATA_SPATK_IV:
+ SET8(substruct3->spAttackIV);
+ break;
+ case MON_DATA_SPDEF_IV:
+ SET8(substruct3->spDefenseIV);
+ break;
+ case MON_DATA_IS_EGG:
+ SET8(substruct3->isEgg);
+ if (substruct3->isEgg)
+ boxMon->isEgg = 1;
+ else
+ boxMon->isEgg = 0;
+ break;
+ case MON_DATA_ALT_ABILITY:
+ SET8(substruct3->altAbility);
+ break;
+ case MON_DATA_COOL_RIBBON:
+ SET8(substruct3->coolRibbon);
+ break;
+ case MON_DATA_BEAUTY_RIBBON:
+ SET8(substruct3->beautyRibbon);
+ break;
+ case MON_DATA_CUTE_RIBBON:
+ SET8(substruct3->cuteRibbon);
+ break;
+ case MON_DATA_SMART_RIBBON:
+ SET8(substruct3->smartRibbon);
+ break;
+ case MON_DATA_TOUGH_RIBBON:
+ SET8(substruct3->toughRibbon);
+ break;
+ case MON_DATA_CHAMPION_RIBBON:
+ SET8(substruct3->championRibbon);
+ break;
+ case MON_DATA_WINNING_RIBBON:
+ SET8(substruct3->winningRibbon);
+ break;
+ case MON_DATA_VICTORY_RIBBON:
+ SET8(substruct3->victoryRibbon);
+ break;
+ case MON_DATA_ARTIST_RIBBON:
+ SET8(substruct3->artistRibbon);
+ break;
+ case MON_DATA_EFFORT_RIBBON:
+ SET8(substruct3->effortRibbon);
+ break;
+ case MON_DATA_GIFT_RIBBON_1:
+ SET8(substruct3->giftRibbon1);
+ break;
+ case MON_DATA_GIFT_RIBBON_2:
+ SET8(substruct3->giftRibbon2);
+ break;
+ case MON_DATA_GIFT_RIBBON_3:
+ SET8(substruct3->giftRibbon3);
+ break;
+ case MON_DATA_GIFT_RIBBON_4:
+ SET8(substruct3->giftRibbon4);
+ break;
+ case MON_DATA_GIFT_RIBBON_5:
+ SET8(substruct3->giftRibbon5);
+ break;
+ case MON_DATA_GIFT_RIBBON_6:
+ SET8(substruct3->giftRibbon6);
+ break;
+ case MON_DATA_GIFT_RIBBON_7:
+ SET8(substruct3->giftRibbon7);
+ break;
+ case MON_DATA_FATEFUL_ENCOUNTER:
+ SET8(substruct3->fatefulEncounter);
+ break;
+ case MON_DATA_OBEDIENCE:
+ SET8(substruct3->obedient);
+ break;
+ case MON_DATA_IVS:
+ {
+#ifdef BUGFIX_SETMONIVS
+ u32 ivs = data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24);
+#else
+ u32 ivs = *data; // Bug: Only the HP IV and the lower 3 bits of the Attack IV are read. The rest become 0.
+#endif
+ substruct3->hpIV = ivs & 0x1F;
+ substruct3->attackIV = (ivs >> 5) & 0x1F;
+ substruct3->defenseIV = (ivs >> 10) & 0x1F;
+ substruct3->speedIV = (ivs >> 15) & 0x1F;
+ substruct3->spAttackIV = (ivs >> 20) & 0x1F;
+ substruct3->spDefenseIV = (ivs >> 25) & 0x1F;
+ break;
+ }
+ default:
+ break;
+ }
+
+ if (field > MON_DATA_10)
+ {
+ boxMon->checksum = CalculateBoxMonChecksum(boxMon);
+ EncryptBoxMon(boxMon);
+ }
+}
+
+void CopyMon(void *dest, void *src, size_t size)
+{
+ memcpy(dest, src, size);
+}
+
+u8 GiveMonToPlayer(struct Pokemon *mon)
+{
+ s32 i;
+
+ SetMonData(mon, MON_DATA_OT_NAME, gSaveBlock2Ptr->playerName);
+ SetMonData(mon, MON_DATA_OT_GENDER, &gSaveBlock2Ptr->playerGender);
+ SetMonData(mon, MON_DATA_OT_ID, gSaveBlock2Ptr->playerTrainerId);
+
+ for (i = 0; i < PARTY_SIZE; i++)
+ {
+ if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL) == SPECIES_NONE)
+ break;
+ }
+
+ if (i >= PARTY_SIZE)
+ return SendMonToPC(mon);
+
+ CopyMon(&gPlayerParty[i], mon, sizeof(*mon));
+ gPlayerPartyCount = i + 1;
+ return MON_GIVEN_TO_PARTY;
+}
+
+u8 SendMonToPC(struct Pokemon* mon)
+{
+ s32 boxNo, boxPos;
+
+ set_unknown_box_id(VarGet(VAR_0x4037));
+
+ boxNo = StorageGetCurrentBox();
+
+ do
+ {
+ for (boxPos = 0; boxPos < 30; boxPos++)
+ {
+ struct BoxPokemon* checkingMon = GetBoxedMonPtr(boxNo, boxPos);
+ if (GetBoxMonData(checkingMon, MON_DATA_SPECIES, NULL) == SPECIES_NONE)
+ {
+ MonRestorePP(mon);
+ CopyMon(checkingMon, &mon->box, sizeof(mon->box));
+ gSpecialVar_MonBoxId = boxNo;
+ gSpecialVar_MonBoxPos = boxPos;
+ if (get_unknown_box_id() != boxNo)
+ FlagClear(FLAG_UNK843);
+ VarSet(VAR_0x4037, boxNo);
+ return MON_GIVEN_TO_PC;
+ }
+ }
+
+ boxNo++;
+ if (boxNo == 14)
+ boxNo = 0;
+ } while (boxNo != StorageGetCurrentBox());
+
+ return MON_CANT_GIVE;
+}
+
+u8 CalculatePlayerPartyCount(void)
+{
+ gPlayerPartyCount = 0;
+
+ while (gPlayerPartyCount < 6
+ && GetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_SPECIES, NULL) != SPECIES_NONE)
+ {
+ gPlayerPartyCount++;
+ }
+
+ return gPlayerPartyCount;
+}
+
+
+u8 CalculateEnemyPartyCount(void)
+{
+ gEnemyPartyCount = 0;
+
+ while (gEnemyPartyCount < 6
+ && GetMonData(&gEnemyParty[gEnemyPartyCount], MON_DATA_SPECIES, NULL) != SPECIES_NONE)
+ {
+ gEnemyPartyCount++;
+ }
+
+ return gEnemyPartyCount;
+}
+
+u8 GetMonsStateToDoubles(void)
+{
+ s32 aliveCount = 0;
+ s32 i;
+ CalculatePlayerPartyCount();
+
+ if (gPlayerPartyCount == 1)
+ return gPlayerPartyCount; // PLAYER_HAS_ONE_MON
+
+ for (i = 0; i < gPlayerPartyCount; i++)
+ {
+ // FRLG changed the order of these checks, but there's no point to doing that
+ // because of the requirement of all 3 of these checks.
+ if (GetMonData(&gPlayerParty[i], MON_DATA_HP, NULL) != 0
+ && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) != SPECIES_NONE
+ && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2, NULL) != SPECIES_EGG)
+ aliveCount++;
+ }
+
+ return (aliveCount > 1) ? PLAYER_HAS_TWO_USABLE_MONS : PLAYER_HAS_ONE_USABLE_MON;
+}
+
+u8 GetAbilityBySpecies(u16 species, bool8 altAbility)
+{
+ if (altAbility)
+ gLastUsedAbility = gBaseStats[species].ability2;
+ else
+ gLastUsedAbility = gBaseStats[species].ability1;
+
+ return gLastUsedAbility;
+}
+
+u8 GetMonAbility(struct Pokemon *mon)
+{
+ u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL);
+ u8 altAbility = GetMonData(mon, MON_DATA_ALT_ABILITY, NULL);
+ return GetAbilityBySpecies(species, altAbility);
+}
+
+void CreateSecretBaseEnemyParty(struct SecretBaseRecord *secretBaseRecord)
+{
+ s32 i, j;
+
+ ZeroEnemyPartyMons();
+ *gBattleResources->secretBase = *secretBaseRecord;
+
+ for (i = 0; i < PARTY_SIZE; i++)
+ {
+ if (gBattleResources->secretBase->party.species[i])
+ {
+ CreateMon(&gEnemyParty[i],
+ gBattleResources->secretBase->party.species[i],
+ gBattleResources->secretBase->party.levels[i],
+ 15,
+ 1,
+ gBattleResources->secretBase->party.personality[i],
+ 2,
+ 0);
+
+ SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBattleResources->secretBase->party.heldItems[i]);
+
+ for (j = 0; j < 6; j++)
+ SetMonData(&gEnemyParty[i], MON_DATA_HP_EV + j, &gBattleResources->secretBase->party.EVs[i]);
+
+ for (j = 0; j < 4; j++)
+ {
+ SetMonData(&gEnemyParty[i], MON_DATA_MOVE1 + j, &gBattleResources->secretBase->party.moves[i * 4 + j]);
+ SetMonData(&gEnemyParty[i], MON_DATA_PP1 + j, &gBattleMoves[gBattleResources->secretBase->party.moves[i * 4 + j]].pp);
+ }
+ }
+ }
+ gBattleTypeFlags = 8;
+ gTrainerBattleOpponent_A = 0x400;
+}
+
+u8 GetSecretBaseTrainerPicIndex(void)
+{
+ u8 facilityClass = sSecretBaseFacilityClasses[gBattleResources->secretBase->gender][gBattleResources->secretBase->trainerId[0] % 5];
+ return gFacilityClassToPicIndex[facilityClass];
+}
+
+u8 GetSecretBaseTrainerNameIndex(void)
+{
+ u8 facilityClass = sSecretBaseFacilityClasses[gBattleResources->secretBase->gender][gBattleResources->secretBase->trainerId[0] % 5];
+ return gFacilityClassToTrainerClass[facilityClass];
+}
+
+bool8 IsPlayerPartyAndPokemonStorageFull(void)
+{
+ s32 i;
+
+ for (i = 0; i < PARTY_SIZE; i++)
+ if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL) == SPECIES_NONE)
+ return FALSE;
+
+ return IsPokemonStorageFull();
+}
+
+bool8 IsPokemonStorageFull(void)
+{
+ s32 i, j;
+
+ for (i = 0; i < 14; i++)
+ for (j = 0; j < 30; j++)
+ if (GetBoxMonDataFromAnyBox(i, j, MON_DATA_SPECIES) == SPECIES_NONE)
+ return FALSE;
+
+ return TRUE;
+}
+
+void GetSpeciesName(u8 *name, u16 species)
+{
+ s32 i;
+
+ // Hmm? FRLG has < while Ruby/Emerald has <=
+ for (i = 0; i < POKEMON_NAME_LENGTH; i++)
+ {
+ if (species > NUM_SPECIES)
+ name[i] = gSpeciesNames[0][i];
+ else
+ name[i] = gSpeciesNames[species][i];
+
+ if (name[i] == EOS)
+ break;
+ }
+
+ name[i] = EOS;
+}
+
+u8 CalculatePPWithBonus(u16 move, u8 ppBonuses, u8 moveIndex)
+{
+ u8 basePP = gBattleMoves[move].pp;
+ return basePP + ((basePP * 20 * ((gUnknown_825DEA1[moveIndex] & ppBonuses) >> (2 * moveIndex))) / 100);
+}
+
+void RemoveMonPPBonus(struct Pokemon *mon, u8 moveIndex)
+{
+ u8 ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES, NULL);
+ ppBonuses &= gPPUpWriteMasks[moveIndex];
+ SetMonData(mon, MON_DATA_PP_BONUSES, &ppBonuses);
+}
+
+void RemoveBattleMonPPBonus(struct BattlePokemon *mon, u8 moveIndex)
+{
+ mon->ppBonuses &= gPPUpWriteMasks[moveIndex];
+}
+
+void CopyPlayerPartyMonToBattleData(u8 battlerId, u8 partyIndex)
+{
+ u16* hpSwitchout;
+ s32 i;
+ u8 nickname[POKEMON_NAME_LENGTH * 2]; // Why is the nickname array here longer in FR/LG?
+
+ gBattleMons[battlerId].species = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPECIES, NULL);
+ gBattleMons[battlerId].item = GetMonData(&gPlayerParty[partyIndex], MON_DATA_HELD_ITEM, NULL);
+
+ for (i = 0; i < 4; i++)
+ {
+ gBattleMons[battlerId].moves[i] = GetMonData(&gPlayerParty[partyIndex], MON_DATA_MOVE1 + i, NULL);
+ gBattleMons[battlerId].pp[i] = GetMonData(&gPlayerParty[partyIndex], MON_DATA_PP1 + i, NULL);
+ }
+
+ gBattleMons[battlerId].ppBonuses = GetMonData(&gPlayerParty[partyIndex], MON_DATA_PP_BONUSES, NULL);
+ gBattleMons[battlerId].friendship = GetMonData(&gPlayerParty[partyIndex], MON_DATA_FRIENDSHIP, NULL);
+ gBattleMons[battlerId].experience = GetMonData(&gPlayerParty[partyIndex], MON_DATA_EXP, NULL);
+ gBattleMons[battlerId].hpIV = GetMonData(&gPlayerParty[partyIndex], MON_DATA_HP_IV, NULL);
+ gBattleMons[battlerId].attackIV = GetMonData(&gPlayerParty[partyIndex], MON_DATA_ATK_IV, NULL);
+ gBattleMons[battlerId].defenseIV = GetMonData(&gPlayerParty[partyIndex], MON_DATA_DEF_IV, NULL);
+ gBattleMons[battlerId].speedIV = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPEED_IV, NULL);
+ gBattleMons[battlerId].spAttackIV = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPATK_IV, NULL);
+ gBattleMons[battlerId].spDefenseIV = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPDEF_IV, NULL);
+ gBattleMons[battlerId].personality = GetMonData(&gPlayerParty[partyIndex], MON_DATA_PERSONALITY, NULL);
+ gBattleMons[battlerId].status1 = GetMonData(&gPlayerParty[partyIndex], MON_DATA_STATUS, NULL);
+ gBattleMons[battlerId].level = GetMonData(&gPlayerParty[partyIndex], MON_DATA_LEVEL, NULL);
+ gBattleMons[battlerId].hp = GetMonData(&gPlayerParty[partyIndex], MON_DATA_HP, NULL);
+ gBattleMons[battlerId].maxHP = GetMonData(&gPlayerParty[partyIndex], MON_DATA_MAX_HP, NULL);
+ gBattleMons[battlerId].attack = GetMonData(&gPlayerParty[partyIndex], MON_DATA_ATK, NULL);
+ gBattleMons[battlerId].defense = GetMonData(&gPlayerParty[partyIndex], MON_DATA_DEF, NULL);
+ gBattleMons[battlerId].speed = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPEED, NULL);
+ gBattleMons[battlerId].spAttack = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPATK, NULL);
+ gBattleMons[battlerId].spDefense = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPDEF, NULL);
+ gBattleMons[battlerId].isEgg = GetMonData(&gPlayerParty[partyIndex], MON_DATA_IS_EGG, NULL);
+ gBattleMons[battlerId].altAbility = GetMonData(&gPlayerParty[partyIndex], MON_DATA_ALT_ABILITY, NULL);
+ gBattleMons[battlerId].otId = GetMonData(&gPlayerParty[partyIndex], MON_DATA_OT_ID, NULL);
+ gBattleMons[battlerId].type1 = gBaseStats[gBattleMons[battlerId].species].type1;
+ gBattleMons[battlerId].type2 = gBaseStats[gBattleMons[battlerId].species].type2;
+ gBattleMons[battlerId].ability = GetAbilityBySpecies(gBattleMons[battlerId].species, gBattleMons[battlerId].altAbility);
+ GetMonData(&gPlayerParty[partyIndex], MON_DATA_NICKNAME, nickname);
+ StringCopy10(gBattleMons[battlerId].nickname, nickname);
+ GetMonData(&gPlayerParty[partyIndex], MON_DATA_OT_NAME, gBattleMons[battlerId].otName);
+
+ hpSwitchout = &gBattleStruct->hpOnSwitchout[GetBattlerSide(battlerId)];
+ *hpSwitchout = gBattleMons[battlerId].hp;
+
+ for (i = 0; i < 8; i++)
+ gBattleMons[battlerId].statStages[i] = 6;
+
+ gBattleMons[battlerId].status2 = 0;
+ sub_80174B8(battlerId);
+ ClearTemporarySpeciesSpriteData(battlerId, FALSE);
+}
+
+bool8 ExecuteTableBasedItemEffect(struct Pokemon *mon, u16 item, u8 partyIndex, u8 moveIndex)
+{
+ return PokemonUseItemEffects(mon, item, partyIndex, moveIndex, 0);
+}
+
+extern const u8 gUnknown_825DEA1[];
+extern const u8 gUnknown_825DEA9[];
+extern const u8 sGetMonDataEVConstants[];
+
+bool8 PokemonUseItemEffects(struct Pokemon *pkmn, u16 item, u8 partyIndex, u8 moveIndex, u8 e)
+{
+ u32 data;
+ s32 friendship;
+ s32 cmdIndex;
+ bool8 retVal = TRUE;
+ const u8 *itemEffect;
+ u8 sp24 = 6;
+ u32 sp28;
+ s8 sp2C = 0;
+ u8 holdEffect;
+ u8 sp34 = 4;
+ u16 heldItem;
+ u8 r10;
+ u32 r4;
+
+ heldItem = GetMonData(pkmn, MON_DATA_HELD_ITEM, NULL);
+ if (heldItem == ITEM_ENIGMA_BERRY)
+ {
+ if (gMain.inBattle)
+ holdEffect = gEnigmaBerries[gBattlerInMenuId].holdEffect;
+ else
+ holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect;
+ }
+ else
+ {
+ holdEffect = ItemId_GetHoldEffect(heldItem);
+ }
+
+ gPotentialItemEffectBattler = gBattlerInMenuId;
+ if (gMain.inBattle)
+ {
+ gActiveBattler = gBattlerInMenuId;
+ cmdIndex = (GetBattlerSide(gActiveBattler) != 0);
+ while (cmdIndex < gBattlersCount)
+ {
+ if (gBattlerPartyIndexes[cmdIndex] == partyIndex)
+ {
+ sp34 = cmdIndex;
+ break;
+ }
+ cmdIndex += 2;
+ }
+ }
+ else
+ {
+ gActiveBattler = 0;
+ sp34 = 4;
+ }
+
+ if (!IS_POKEMON_ITEM(item))
+ return TRUE;
+ if (gItemEffectTable[item - 13] == NULL && item != ITEM_ENIGMA_BERRY)
+ return TRUE;
+
+ if (item == ITEM_ENIGMA_BERRY)
+ {
+ if (gMain.inBattle)
+ itemEffect = gEnigmaBerries[gActiveBattler].itemEffect;
+ else
+ itemEffect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
+ }
+ else
+ {
+ itemEffect = gItemEffectTable[item - 13];
+ }
+
+ for (cmdIndex = 0; cmdIndex < 6; cmdIndex++)
+ {
+ switch (cmdIndex)
+ {
+ // status healing effects
+ case 0:
+ if ((itemEffect[cmdIndex] & 0x80)
+ && gMain.inBattle && sp34 != 4 && (gBattleMons[sp34].status2 & STATUS2_INFATUATION))
+ {
+ gBattleMons[sp34].status2 &= ~STATUS2_INFATUATION;
+ retVal = FALSE;
+ }
+ if ((itemEffect[cmdIndex] & 0x30)
+ && !(gBattleMons[gActiveBattler].status2 & STATUS2_FOCUS_ENERGY))
+ {
+ gBattleMons[gActiveBattler].status2 |= STATUS2_FOCUS_ENERGY;
+ retVal = FALSE;
+ }
+ if ((itemEffect[cmdIndex] & 0xF)
+ && gBattleMons[gActiveBattler].statStages[STAT_STAGE_ATK] < 12)
+ {
+ gBattleMons[gActiveBattler].statStages[STAT_STAGE_ATK] += itemEffect[cmdIndex] & 0xF;
+ if (gBattleMons[gActiveBattler].statStages[STAT_STAGE_ATK] > 12)
+ gBattleMons[gActiveBattler].statStages[STAT_STAGE_ATK] = 12;
+ retVal = FALSE;
+ }
+ break;
+ // in-battle stat boosting effects?
+ case 1:
+ if ((itemEffect[cmdIndex] & 0xF0)
+ && gBattleMons[gActiveBattler].statStages[STAT_STAGE_DEF] < 12)
+ {
+ gBattleMons[gActiveBattler].statStages[STAT_STAGE_DEF] += (itemEffect[cmdIndex] & 0xF0) >> 4;
+ if (gBattleMons[gActiveBattler].statStages[STAT_STAGE_DEF] > 12)
+ gBattleMons[gActiveBattler].statStages[STAT_STAGE_DEF] = 12;
+ retVal = FALSE;
+ }
+ if ((itemEffect[cmdIndex] & 0xF)
+ && gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPEED] < 12)
+ {
+ gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPEED] += itemEffect[cmdIndex] & 0xF;
+ if (gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPEED] > 12)
+ gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPEED] = 12;
+ retVal = FALSE;
+ }
+ break;
+ // more stat boosting effects?
+ case 2:
+ if ((itemEffect[cmdIndex] & 0xF0)
+ && gBattleMons[gActiveBattler].statStages[STAT_STAGE_ACC] < 12)
+ {
+ gBattleMons[gActiveBattler].statStages[STAT_STAGE_ACC] += (itemEffect[cmdIndex] & 0xF0) >> 4;
+ if (gBattleMons[gActiveBattler].statStages[STAT_STAGE_ACC] > 12)
+ gBattleMons[gActiveBattler].statStages[STAT_STAGE_ACC] = 12;
+ retVal = FALSE;
+ }
+ if ((itemEffect[cmdIndex] & 0xF)
+ && gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPATK] < 12)
+ {
+ gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPATK] += itemEffect[cmdIndex] & 0xF;
+ if (gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPATK] > 12)
+ gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPATK] = 12;
+ retVal = FALSE;
+ }
+ break;
+ case 3:
+ if ((itemEffect[cmdIndex] & 0x80)
+ && gSideTimers[GetBattlerSide(gActiveBattler)].mistTimer == 0)
+ {
+ gSideTimers[GetBattlerSide(gActiveBattler)].mistTimer = 5;
+ retVal = FALSE;
+ }
+ if ((itemEffect[cmdIndex] & 0x40) // raise level
+ && GetMonData(pkmn, MON_DATA_LEVEL, NULL) != 100)
+ {
+ data = gExperienceTables[gBaseStats[GetMonData(pkmn, MON_DATA_SPECIES, NULL)].growthRate][GetMonData(pkmn, MON_DATA_LEVEL, NULL) + 1];
+ SetMonData(pkmn, MON_DATA_EXP, &data);
+ CalculateMonStats(pkmn);
+ retVal = FALSE;
+ }
+ if ((itemEffect[cmdIndex] & 0x20)
+ && HealStatusConditions(pkmn, partyIndex, 7, sp34) == 0)
+ {
+ if (sp34 != 4)
+ gBattleMons[sp34].status2 &= ~STATUS2_NIGHTMARE;
+ retVal = FALSE;
+ }
+ if ((itemEffect[cmdIndex] & 0x10) && HealStatusConditions(pkmn, partyIndex, 0xF88, sp34) == 0)
+ retVal = FALSE;
+ if ((itemEffect[cmdIndex] & 8) && HealStatusConditions(pkmn, partyIndex, 16, sp34) == 0)
+ retVal = FALSE;
+ if ((itemEffect[cmdIndex] & 4) && HealStatusConditions(pkmn, partyIndex, 32, sp34) == 0)
+ retVal = FALSE;
+ if ((itemEffect[cmdIndex] & 2) && HealStatusConditions(pkmn, partyIndex, 64, sp34) == 0)
+ retVal = FALSE;
+ if ((itemEffect[cmdIndex] & 1) // heal confusion
+ && gMain.inBattle && sp34 != 4 && (gBattleMons[sp34].status2 & STATUS2_CONFUSION))
+ {
+ gBattleMons[sp34].status2 &= ~STATUS2_CONFUSION;
+ retVal = FALSE;
+ }
+ break;
+ // EV, HP, and PP raising effects
+ case 4:
+ r10 = itemEffect[cmdIndex];
+ if (r10 & 0x20)
+ {
+ r10 &= ~0x20;
+ data = (GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL) & gUnknown_825DEA1[moveIndex]) >> (moveIndex * 2);
+ sp28 = CalculatePPWithBonus(GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL), GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), moveIndex);
+ if (data < 3 && sp28 > 4)
+ {
+ data = GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL) + gUnknown_825DEA9[moveIndex];
+ SetMonData(pkmn, MON_DATA_PP_BONUSES, &data);
+
+ data = CalculatePPWithBonus(GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL), data, moveIndex) - sp28;
+ data = GetMonData(pkmn, MON_DATA_PP1 + moveIndex, NULL) + data;
+ SetMonData(pkmn, MON_DATA_PP1 + moveIndex, &data);
+ retVal = FALSE;
+ }
+ }
+ sp28 = 0;
+ while (r10 != 0)
+ {
+ if (r10 & 1)
+ {
+ u16 evCount;
+ s32 r5;
+
+ switch (sp28)
+ {
+ case 0:
+ case 1:
+ evCount = GetMonEVCount(pkmn);
+ if (evCount >= 510)
+ return TRUE;
+ data = GetMonData(pkmn, sGetMonDataEVConstants[sp28], NULL);
+ if (data < 100)
+ {
+ if (data + itemEffect[sp24] > 100)
+ r4 = 100 - (data + itemEffect[sp24]) + itemEffect[sp24];
+ else
+ r4 = itemEffect[sp24];
+ if (evCount + r4 > 510)
+ r4 += 510 - (evCount + r4);
+ data += r4;
+ SetMonData(pkmn, sGetMonDataEVConstants[sp28], &data);
+ CalculateMonStats(pkmn);
+ sp24++;
+ retVal = FALSE;
+ }
+ break;
+ case 2:
+ // revive?
+ if (r10 & 0x10)
+ {
+ if (GetMonData(pkmn, MON_DATA_HP, NULL) != 0)
+ {
+ sp24++;
+ break;
+ }
+ if (gMain.inBattle)
+ {
+ if (sp34 != 4)
+ {
+ gAbsentBattlerFlags &= ~gBitTable[sp34];
+ CopyPlayerPartyMonToBattleData(sp34, pokemon_order_func(gBattlerPartyIndexes[sp34]));
+ if (GetBattlerSide(gActiveBattler) == 0 && gBattleResults.unk4 < 255)
+ gBattleResults.unk4++;
+ }
+ else
+ {
+ gAbsentBattlerFlags &= ~gBitTable[gActiveBattler ^ 2];
+ if (GetBattlerSide(gActiveBattler) == 0 && gBattleResults.unk4 < 255)
+ gBattleResults.unk4++;
+ }
+ }
+ }
+ else
+ {
+ if (GetMonData(pkmn, MON_DATA_HP, NULL) == 0)
+ {
+ sp24++;
+ break;
+ }
+ }
+ data = itemEffect[sp24++];
+ switch (data)
+ {
+ case 0xFF:
+ data = GetMonData(pkmn, MON_DATA_MAX_HP, NULL) - GetMonData(pkmn, MON_DATA_HP, NULL);
+ break;
+ case 0xFE:
+ data = GetMonData(pkmn, MON_DATA_MAX_HP, NULL) / 2;
+ if (data == 0)
+ data = 1;
+ break;
+ case 0xFD:
+ data = gBattleScripting.field_23;
+ break;
+ }
+ if (GetMonData(pkmn, MON_DATA_MAX_HP, NULL) != GetMonData(pkmn, MON_DATA_HP, NULL))
+ {
+ if (e == 0)
+ {
+ data = GetMonData(pkmn, MON_DATA_HP, NULL) + data;
+ if (data > GetMonData(pkmn, MON_DATA_MAX_HP, NULL))
+ data = GetMonData(pkmn, MON_DATA_MAX_HP, NULL);
+ SetMonData(pkmn, MON_DATA_HP, &data);
+ if (gMain.inBattle && sp34 != 4)
+ {
+ gBattleMons[sp34].hp = data;
+ if (!(r10 & 0x10) && GetBattlerSide(gActiveBattler) == 0)
+ {
+ if (gBattleResults.unk3 < 255)
+ gBattleResults.unk3++;
+ // I have to re-use this variable to match.
+ r5 = gActiveBattler;
+ gActiveBattler = sp34;
+ BtlController_EmitGetMonData(0, 0, 0);
+ MarkBufferBankForExecution(gActiveBattler);
+ gActiveBattler = r5;
+ }
+ }
+ }
+ else
+ {
+ gBattleMoveDamage = -data;
+ }
+ retVal = FALSE;
+ }
+ r10 &= 0xEF;
+ break;
+ case 3:
+ if (!(r10 & 2))
+ {
+ for (r5 = 0; r5 < 4; r5++)
+ {
+ u16 r4;
+
+ data = GetMonData(pkmn, MON_DATA_PP1 + r5, NULL);
+ r4 = GetMonData(pkmn, MON_DATA_MOVE1 + r5, NULL);
+ if (data != CalculatePPWithBonus(r4, GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), r5))
+ {
+ data += itemEffect[sp24];
+ r4 = GetMonData(pkmn, MON_DATA_MOVE1 + r5, NULL);
+ if (data > CalculatePPWithBonus(r4, GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), r5))
+ {
+ r4 = GetMonData(pkmn, MON_DATA_MOVE1 + r5, NULL);
+ data = CalculatePPWithBonus(r4, GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), r5);
+ }
+ SetMonData(pkmn, MON_DATA_PP1 + r5, &data);
+ if (gMain.inBattle
+ && sp34 != 4 && !(gBattleMons[sp34].status2 & 0x200000)
+ && !(gDisableStructs[sp34].unk18_b & gBitTable[r5]))
+ gBattleMons[sp34].pp[r5] = data;
+ retVal = FALSE;
+ }
+ }
+ sp24++;
+ }
+ else
+ {
+ u16 r4;
+
+ data = GetMonData(pkmn, MON_DATA_PP1 + moveIndex, NULL);
+ r4 = GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL);
+ if (data != CalculatePPWithBonus(r4, GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), moveIndex))
+ {
+ data += itemEffect[sp24++];
+ r4 = GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL);
+ if (data > CalculatePPWithBonus(r4, GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), moveIndex))
+ {
+ r4 = GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL);
+ data = CalculatePPWithBonus(r4, GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), moveIndex);
+ }
+ SetMonData(pkmn, MON_DATA_PP1 + moveIndex, &data);
+ if (gMain.inBattle
+ && sp34 != 4 && !(gBattleMons[sp34].status2 & 0x200000)
+ && !(gDisableStructs[sp34].unk18_b & gBitTable[moveIndex]))
+ gBattleMons[sp34].pp[moveIndex] = data;
+ retVal = FALSE;
+ }
+ }
+ break;
+ case 7:
+ {
+ u16 targetSpecies = GetEvolutionTargetSpecies(pkmn, 2, item);
+
+ if (targetSpecies != SPECIES_NONE)
+ {
+ BeginEvolutionScene(pkmn, targetSpecies, 0, partyIndex);
+ return FALSE;
+ }
+ }
+ break;
+ }
+ }
+ sp28++;
+ r10 >>= 1;
+ }
+ break;
+ case 5:
+ r10 = itemEffect[cmdIndex];
+ sp28 = 0;
+ while (r10 != 0)
+ {
+ if (r10 & 1)
+ {
+ u16 evCount;
+
+ switch (sp28)
+ {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ evCount = GetMonEVCount(pkmn);
+ if (evCount >= 510)
+ return TRUE;
+ data = GetMonData(pkmn, sGetMonDataEVConstants[sp28 + 2], NULL);
+ if (data < 100)
+ {
+ if (data + itemEffect[sp24] > 100)
+ r4 = 100 - (data + itemEffect[sp24]) + itemEffect[sp24];
+ else
+ r4 = itemEffect[sp24];
+ if (evCount + r4 > 510)
+ r4 += 510 - (evCount + r4);
+ data += r4;
+ SetMonData(pkmn, sGetMonDataEVConstants[sp28 + 2], &data);
+ CalculateMonStats(pkmn);
+ retVal = FALSE;
+ sp24++;
+ }
+ break;
+ case 4:
+ data = (GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL) & gUnknown_825DEA1[moveIndex]) >> (moveIndex * 2);
+ if (data < 3)
+ {
+ r4 = CalculatePPWithBonus(GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL), GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), moveIndex);
+ data = GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL);
+ data &= gPPUpWriteMasks[moveIndex];
+ data += gUnknown_825DEA9[moveIndex] * 3;
+
+ SetMonData(pkmn, MON_DATA_PP_BONUSES, &data);
+ data = CalculatePPWithBonus(GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL), data, moveIndex) - r4;
+ data = GetMonData(pkmn, MON_DATA_PP1 + moveIndex, NULL) + data;
+ SetMonData(pkmn, MON_DATA_PP1 + moveIndex, &data);
+ retVal = FALSE;
+ }
+ break;
+ case 5:
+ if (GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL) < 100 && retVal == 0 && sp2C == 0)
+ {
+ sp2C = itemEffect[sp24];
+ friendship = GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL);
+ if (sp2C > 0 && holdEffect == HOLD_EFFECT_HAPPINESS_UP)
+ friendship += 150 * sp2C / 100;
+ else
+ friendship += sp2C;
+ if (sp2C > 0)
+ {
+ if (GetMonData(pkmn, MON_DATA_POKEBALL, NULL) == 11)
+ friendship++;
+ if (GetMonData(pkmn, MON_DATA_MET_LOCATION, NULL) == sav1_map_get_name())
+ friendship++;
+ }
+ if (friendship < 0)
+ friendship = 0;
+ if (friendship > 255)
+ friendship = 255;
+ SetMonData(pkmn, MON_DATA_FRIENDSHIP, &friendship);
+ }
+ sp24++;
+ break;
+ case 6:
+ if (GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL) >= 100 && GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL) < 200
+ && retVal == 0 && sp2C == 0)
+ {
+ sp2C = itemEffect[sp24];
+ friendship = GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL);
+ if (sp2C > 0 && holdEffect == HOLD_EFFECT_HAPPINESS_UP)
+ friendship += 150 * sp2C / 100;
+ else
+ friendship += sp2C;
+ if (sp2C > 0)
+ {
+ if (GetMonData(pkmn, MON_DATA_POKEBALL, NULL) == 11)
+ friendship++;
+ if (GetMonData(pkmn, MON_DATA_MET_LOCATION, NULL) == sav1_map_get_name())
+ friendship++;
+ }
+ if (friendship < 0)
+ friendship = 0;
+ if (friendship > 255)
+ friendship = 255;
+ SetMonData(pkmn, MON_DATA_FRIENDSHIP, &friendship);
+ }
+ sp24++;
+ break;
+ case 7:
+ if (GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL) >= 200 && retVal == 0 && sp2C == 0)
+ {
+ sp2C = itemEffect[sp24];
+ friendship = GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL);
+ if (sp2C > 0 && holdEffect == HOLD_EFFECT_HAPPINESS_UP)
+ friendship += 150 * sp2C / 100;
+ else
+ friendship += sp2C;
+ if (sp2C > 0)
+ {
+ if (GetMonData(pkmn, MON_DATA_POKEBALL, NULL) == 11)
+ friendship++;
+ if (GetMonData(pkmn, MON_DATA_MET_LOCATION, NULL) == sav1_map_get_name())
+ friendship++;
+ }
+ if (friendship < 0)
+ friendship = 0;
+ if (friendship > 255)
+ friendship = 255;
+ SetMonData(pkmn, MON_DATA_FRIENDSHIP, &friendship);
+ }
+ sp24++;
+ break;
+ }
+ }
+ sp28++;
+ r10 >>= 1;
+ }
+ break;
+ }
+ }
+ return retVal;
+}
+
+bool8 HealStatusConditions(struct Pokemon *mon, u32 unused, u32 healMask, u8 battleId)
+{
+ u32 status = GetMonData(mon, MON_DATA_STATUS, 0);
+
+ if (status & healMask)
+ {
+ status &= ~healMask;
+ SetMonData(mon, MON_DATA_STATUS, &status);
+ if (gMain.inBattle && battleId != 4)
+ gBattleMons[battleId].status1 &= ~healMask;
+ return FALSE;
+ }
+ else
+ {
+ return TRUE;
+ }
+}
+
+extern bool8 sub_8042BE8(struct Pokemon *mon, u32 unused, u32 healMask, u8 battleId);
+
+#ifdef NONMATCHING
+/*
+ * This is nonmatching due to the compiler's insistence on avoiding the u8 cast
+ * when loading gMain.inBattle. If it weren't for this absent cast, differing
+ * the function would be a lot easier.
+ */
+bool8 PokemonUseItemEffects2(struct Pokemon *pkmn, u16 item, u8 partyIndex, u8 moveIndex, u8 e)
+{ // BEGIN
+ u32 data;
+ s32 cmdIndex;
+ bool8 retVal = TRUE;
+ const u8 *itemEffect;
+ u8 sp24 = 6;
+ u32 sp28;
+ s8 sp2C = 0;
+ u8 sp34 = 4;
+ u16 heldItem;
+ u8 r10;
+ s32 r4;
+
+ heldItem = GetMonData(pkmn, MON_DATA_HELD_ITEM, NULL);
+ if (heldItem == ITEM_ENIGMA_BERRY)
+ {
+ if (gMain.inBattle)
+ /*holdEffect = */gEnigmaBerries[gBattlerInMenuId].holdEffect;
+ else
+ /*holdEffect = */gSaveBlock1Ptr->enigmaBerry.holdEffect;
+ }
+ else
+ {
+ /*holdEffect = */ItemId_GetHoldEffect(heldItem);
+ }
+
+ gPotentialItemEffectBattler = gBattlerInMenuId;
+
+ // grr. the original asm also u8 masks after loading the bitmask, despite
+ // the fact that is a useless operation. what's going on here? Something
+ // dumb I bet like dead code.
+ if (gMain.inBattle)
+ {
+ gActiveBattler = gBattlerInMenuId;
+ if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
+ cmdIndex = 0;
+ else
+ cmdIndex = 1;
+ while (cmdIndex < gBattlersCount)
+ {
+ if (gBattlerPartyIndexes[cmdIndex] == partyIndex)
+ {
+ sp34 = cmdIndex;
+ break;
+ }
+ cmdIndex += 2;
+ }
+ }
+ else
+ {
+ gActiveBattler = 0;
+ sp34 = 4;
+ }
+
+ // _08042504
+ if (!IS_POKEMON_ITEM(item))
+ return TRUE;
+ if (gItemEffectTable[item - 13] == NULL && item != ITEM_ENIGMA_BERRY)
+ return TRUE;
+
+ if (item == ITEM_ENIGMA_BERRY)
+ {
+ if (gMain.inBattle)
+ itemEffect = gEnigmaBerries[gActiveBattler].itemEffect;
+ else
+ itemEffect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
+ }
+ else
+ {
+ itemEffect = gItemEffectTable[item - 13];
+ }
+
+ for (cmdIndex = 0; cmdIndex < 6; cmdIndex++)
+ {
+ switch (cmdIndex)
+ {
+ // status healing effects
+ case 0:
+ if ((itemEffect[cmdIndex] & 0x80)
+ && gMain.inBattle && sp34 != 4 && (gBattleMons[sp34].status2 & STATUS2_INFATUATION))
+ {
+ //gBattleMons[sp34].status2 &= ~STATUS2_INFATUATION;
+ retVal = FALSE;
+ }
+ if ((itemEffect[cmdIndex] & 0x30)
+ && !(gBattleMons[gActiveBattler].status2 & STATUS2_FOCUS_ENERGY))
+ {
+ //gBattleMons[gActiveBattler].status2 |= STATUS2_FOCUS_ENERGY;
+ retVal = FALSE;
+ }
+ if ((itemEffect[cmdIndex] & 0xF)
+ && gBattleMons[gActiveBattler].statStages[STAT_STAGE_ATK] < 12)
+ {
+ //gBattleMons[gActiveBattler].statStages[STAT_STAGE_ATK] += itemEffect[cmdIndex] & 0xF;
+ //if (gBattleMons[gActiveBattler].statStages[STAT_STAGE_ATK] > 12)
+ // gBattleMons[gActiveBattler].statStages[STAT_STAGE_ATK] = 12;
+ retVal = FALSE;
+ }
+ break;
+ // in-battle stat boosting effects?
+ case 1:
+ if ((itemEffect[cmdIndex] & 0xF0)
+ && gBattleMons[gActiveBattler].statStages[STAT_STAGE_DEF] < 12)
+ {
+ //gBattleMons[gActiveBattler].statStages[STAT_STAGE_DEF] += (itemEffect[cmdIndex] & 0xF0) >> 4;
+ //if (gBattleMons[gActiveBattler].statStages[STAT_STAGE_DEF] > 12)
+ // gBattleMons[gActiveBattler].statStages[STAT_STAGE_DEF] = 12;
+ retVal = FALSE;
+ }
+ if ((itemEffect[cmdIndex] & 0xF)
+ && gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPEED] < 12)
+ {
+ //gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPEED] += itemEffect[cmdIndex] & 0xF;
+ //if (gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPEED] > 12)
+ // gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPEED] = 12;
+ retVal = FALSE;
+ }
+ break;
+ // more stat boosting effects?
+ case 2:
+ if ((itemEffect[cmdIndex] & 0xF0)
+ && gBattleMons[gActiveBattler].statStages[STAT_STAGE_ACC] < 12)
+ {
+ //gBattleMons[gActiveBattler].statStages[STAT_STAGE_ACC] += (itemEffect[cmdIndex] & 0xF0) >> 4;
+ //if (gBattleMons[gActiveBattler].statStages[STAT_STAGE_ACC] > 12)
+ // gBattleMons[gActiveBattler].statStages[STAT_STAGE_ACC] = 12;
+ retVal = FALSE;
+ }
+ if ((itemEffect[cmdIndex] & 0xF)
+ && gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPATK] < 12)
+ {
+ //gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPATK] += itemEffect[cmdIndex] & 0xF;
+ //if (gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPATK] > 12)
+ // gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPATK] = 12;
+ retVal = FALSE;
+ }
+ break;
+ case 3:
+ if ((itemEffect[cmdIndex] & 0x80)
+ && gSideTimers[GetBattlerSide(gActiveBattler)].mistTimer == 0)
+ {
+ //gSideTimers[GetBattlerSide(gActiveBattler)].mistTimer = 5;
+ retVal = FALSE;
+ }
+ if ((itemEffect[cmdIndex] & 0x40) // raise level
+ && GetMonData(pkmn, MON_DATA_LEVEL, NULL) != 100)
+ {
+ //data = gExperienceTables[gBaseStats[GetMonData(pkmn, MON_DATA_SPECIES, NULL)].growthRate][GetMonData(pkmn, MON_DATA_LEVEL, NULL) + 1];
+ //SetMonData(pkmn, MON_DATA_EXP, &data);
+ //CalculateMonStats(pkmn);
+ retVal = FALSE;
+ }
+ if ((itemEffect[cmdIndex] & 0x20)
+ && sub_8042BE8(pkmn, partyIndex, 7, sp34) == 0)
+ {
+ //if (sp34 != 4)
+ // gBattleMons[sp34].status2 &= ~STATUS2_NIGHTMARE;
+ retVal = FALSE;
+ }
+ if ((itemEffect[cmdIndex] & 0x10) && sub_8042BE8(pkmn, partyIndex, 0xF88, sp34) == 0)
+ retVal = FALSE;
+ if ((itemEffect[cmdIndex] & 8) && sub_8042BE8(pkmn, partyIndex, 16, sp34) == 0)
+ retVal = FALSE;
+ if ((itemEffect[cmdIndex] & 4) && sub_8042BE8(pkmn, partyIndex, 32, sp34) == 0)
+ retVal = FALSE;
+ if ((itemEffect[cmdIndex] & 2) && sub_8042BE8(pkmn, partyIndex, 64, sp34) == 0)
+ retVal = FALSE;
+ if ((itemEffect[cmdIndex] & 1) // heal confusion
+ && gMain.inBattle && sp34 != 4 && (gBattleMons[sp34].status2 & STATUS2_CONFUSION))
+ {
+ //gBattleMons[sp34].status2 &= ~STATUS2_CONFUSION;
+ retVal = FALSE;
+ }
+ break;
+ // EV, HP, and PP raising effects
+ case 4:
+ r10 = itemEffect[cmdIndex];
+ if (r10 & 0x20)
+ {
+ r10 &= ~0x20;
+ data = (GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL) & gUnknown_825DEA1[moveIndex]) >> (moveIndex * 2);
+ sp28 = CalculatePPWithBonus(GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL), GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), moveIndex);
+ if (data < 3 && sp28 > 4)
+ {
+ //data = GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL) + gUnknown_825DEA9[moveIndex];
+ //SetMonData(pkmn, MON_DATA_PP_BONUSES, &data);
+ //
+ //data = CalculatePPWithBonus(GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL), data, moveIndex) - sp28;
+ //data = GetMonData(pkmn, MON_DATA_PP1 + moveIndex, NULL) + data;
+ //SetMonData(pkmn, MON_DATA_PP1 + moveIndex, &data);
+ retVal = FALSE;
+ }
+ }
+ sp28 = 0;
+ while (r10 != 0) // _080428C0
+ {
+ if (r10 & 1)
+ {
+ u16 evCount;
+ u16 targetSpecies;
+ s32 r5;
+
+ switch (sp28)
+ {
+ case 0:
+ case 1:
+ evCount = GetMonEVCount(pkmn);
+ if (evCount >= 510)
+ return TRUE;
+ data = GetMonData(pkmn, sGetMonDataEVConstants[sp28], NULL);
+ if (data < 100)
+ {
+ //if (data + itemEffect[sp24] > 100)
+ // r4 = 100 - (data + itemEffect[sp24]) + itemEffect[sp24];
+ //else
+ // r4 = itemEffect[sp24];
+ //if (evCount + r4 > 510)
+ // r4 += 510 - (evCount + r4);
+ //data += r4;
+ //SetMonData(pkmn, sGetMonDataEVConstants[sp28], &data);
+ //CalculateMonStats(pkmn);
+ sp24++;
+ retVal = FALSE;
+ }
+ break;
+ case 2:
+ // revive?
+ if (r10 & 0x10)
+ {
+ if (GetMonData(pkmn, MON_DATA_HP, NULL) != 0)
+ {
+ sp24++;
+ break;
+ }
+ /*
+ if (gMain.inBattle)
+ {
+ if (sp34 != 4)
+ {
+ gAbsentBattlerFlags &= ~gBitTable[sp34];
+ CopyPlayerPartyMonToBattleData(sp34, pokemon_order_func(gBattlerPartyIndexes[sp34]));
+ if (GetBattlerSide(gActiveBattler) == 0 && gBattleResults.unk4 < 255)
+ gBattleResults.unk4++;
+ }
+ else
+ {
+ gAbsentBattlerFlags &= ~gBitTable[gActiveBattler ^ 2];
+ if (GetBattlerSide(gActiveBattler) == 0 && gBattleResults.unk4 < 255)
+ gBattleResults.unk4++;
+ }
+ }
+ */
+ }
+ else
+ {
+ if (GetMonData(pkmn, MON_DATA_HP, NULL) == 0)
+ {
+ sp24++;
+ break;
+ }
+ }
+ /*
+ data = itemEffect[sp24++];
+ switch (data)
+ {
+ case 0xFF:
+ data = GetMonData(pkmn, MON_DATA_MAX_HP, NULL) - GetMonData(pkmn, MON_DATA_HP, NULL);
+ break;
+ case 0xFE:
+ data = GetMonData(pkmn, MON_DATA_MAX_HP, NULL) / 2;
+ if (data == 0)
+ data = 1;
+ break;
+ case 0xFD:
+ data = gBattleScripting.field_23;
+ break;
+ }
+ */
+ if (GetMonData(pkmn, MON_DATA_MAX_HP, NULL) != GetMonData(pkmn, MON_DATA_HP, NULL))
+ {
+ /*
+ if (e == 0)
+ {
+ data = GetMonData(pkmn, MON_DATA_HP, NULL) + data;
+ if (data > GetMonData(pkmn, MON_DATA_MAX_HP, NULL))
+ data = GetMonData(pkmn, MON_DATA_MAX_HP, NULL);
+ SetMonData(pkmn, MON_DATA_HP, &data);
+ if (gMain.inBattle && sp34 != 4)
+ {
+ gBattleMons[sp34].hp = data;
+ if (!(r10 & 0x10) && GetBattlerSide(gActiveBattler) == 0)
+ {
+ if (gBattleResults.unk3 < 255)
+ gBattleResults.unk3++;
+ // I have to re-use this variable to match.
+ r5 = gActiveBattler;
+ gActiveBattler = sp34;
+ BtlController_EmitGetMonData(0, 0, 0);
+ MarkBufferBankForExecution(gActiveBattler);
+ gActiveBattler = r5;
+ }
+ }
+ }
+ else
+ {
+ gBattleMoveDamage = -data;
+ }
+ */
+ retVal = FALSE;
+ }
+ sp24++;
+ r10 &= 0xEF;
+ break;
+ case 3:
+ if (!(r10 & 2))
+ {
+ for (r5 = 0; r5 < 4; r5++)
+ {
+ data = GetMonData(pkmn, MON_DATA_PP1 + r5, NULL);
+ r4 = GetMonData(pkmn, MON_DATA_MOVE1 + r5, NULL);
+ if (data != CalculatePPWithBonus(r4, GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), r5))
+ {
+ /*
+ data += itemEffect[sp24];
+ r4 = GetMonData(pkmn, MON_DATA_MOVE1 + r5, NULL);
+ if (data > CalculatePPWithBonus(r4, GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), r5))
+ {
+ r4 = GetMonData(pkmn, MON_DATA_MOVE1 + r5, NULL);
+ data = CalculatePPWithBonus(r4, GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), r5);
+ }
+ SetMonData(pkmn, MON_DATA_PP1 + r5, &data);
+ if (gMain.inBattle
+ && sp34 != 4 && !(gBattleMons[sp34].status2 & 0x200000)
+ && !(gDisableStructs[sp34].unk18_b & gBitTable[r5]))
+ gBattleMons[sp34].pp[r5] = data;
+ */
+ retVal = FALSE;
+ }
+ }
+ }
+ else // _080429FA
+ {
+ data = GetMonData(pkmn, MON_DATA_PP1 + moveIndex, NULL);
+ r4 = GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL);
+ if (data != CalculatePPWithBonus(r4, GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), moveIndex))
+ {
+ /*
+ data += itemEffect[sp24++];
+ r4 = GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL);
+ if (data > CalculatePPWithBonus(r4, GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), moveIndex))
+ {
+ r4 = GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL);
+ data = CalculatePPWithBonus(r4, GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), moveIndex);
+ }
+ SetMonData(pkmn, MON_DATA_PP1 + moveIndex, &data);
+ if (gMain.inBattle
+ && sp34 != 4 && !(gBattleMons[sp34].status2 & 0x200000)
+ && !(gDisableStructs[sp34].unk18_b & gBitTable[moveIndex]))
+ gBattleMons[sp34].pp[moveIndex] = data;
+ */
+ sp24++;
+ retVal = FALSE;
+ }
+ }
+ break;
+ case 7:
+ {
+ targetSpecies = GetEvolutionTargetSpecies(pkmn, 2, item);
+
+ if (targetSpecies != SPECIES_NONE)
+ {
+ //BeginEvolutionScene(pkmn, targetSpecies, 0, partyIndex);
+ return FALSE;
+ }
+ }
+ break;
+ }
+ }
+ sp28++;
+ r10 >>= 1;
+ }
+ break;
+ case 5:
+ r10 = itemEffect[cmdIndex];
+ sp28 = 0;
+ while (r10 != 0)
+ {
+ if (r10 & 1)
+ {
+ u16 evCount;
+
+ switch (sp28)
+ {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ evCount = GetMonEVCount(pkmn);
+ if (evCount >= 510)
+ return TRUE;
+ data = GetMonData(pkmn, sGetMonDataEVConstants[sp28 + 2], NULL);
+ if (data < 100)
+ {
+ /*
+ if (data + itemEffect[sp24] > 100)
+ r4 = 100 - (data + itemEffect[sp24]) + itemEffect[sp24];
+ else
+ r4 = itemEffect[sp24];
+ if (evCount + r4 > 510)
+ r4 += 510 - (evCount + r4);
+ data += r4;
+ SetMonData(pkmn, sGetMonDataEVConstants[sp28 + 2], &data);
+ CalculateMonStats(pkmn);
+ */
+ retVal = FALSE;
+ sp24++;
+ }
+ break;
+ case 4:
+ data = (GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL) & gUnknown_825DEA1[moveIndex]) >> (moveIndex * 2);
+ r4 = CalculatePPWithBonus(GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL), GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), moveIndex);
+ if (data < 3)
+ {
+ if(r4 <= 4)
+ break;
+ /*
+
+ data = GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL);
+ data &= gPPUpWriteMasks[moveIndex];
+ data += gUnknown_825DEA9[moveIndex] * 3;
+
+ SetMonData(pkmn, MON_DATA_PP_BONUSES, &data);
+ data = CalculatePPWithBonus(GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL), data, moveIndex) - r4;
+ data = GetMonData(pkmn, MON_DATA_PP1 + moveIndex, NULL) + data;
+ SetMonData(pkmn, MON_DATA_PP1 + moveIndex, &data);
+ */
+ retVal = FALSE;
+ }
+ break;
+ case 5:
+ if (GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL) < 100 && retVal == 0 && sp2C == 0)
+ {
+ sp2C = itemEffect[sp24];
+ /*
+ friendship = GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL);
+ if (sp2C > 0 && holdEffect == HOLD_EFFECT_HAPPINESS_UP)
+ friendship += 150 * sp2C / 100;
+ else
+ friendship += sp2C;
+ if (sp2C > 0)
+ {
+ if (GetMonData(pkmn, MON_DATA_POKEBALL, NULL) == 11)
+ friendship++;
+ if (GetMonData(pkmn, MON_DATA_MET_LOCATION, NULL) == sav1_map_get_name())
+ friendship++;
+ }
+ if (friendship < 0)
+ friendship = 0;
+ if (friendship > 255)
+ friendship = 255;
+ SetMonData(pkmn, MON_DATA_FRIENDSHIP, &friendship);
+ */
+ }
+ sp24++;
+ break;
+ case 6:
+ if (GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL) >= 100 && GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL) < 200
+ && retVal == 0 && sp2C == 0)
+ {
+ sp2C = itemEffect[sp24];
+ /*
+ friendship = GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL);
+ if (sp2C > 0 && holdEffect == HOLD_EFFECT_HAPPINESS_UP)
+ friendship += 150 * sp2C / 100;
+ else
+ friendship += sp2C;
+ if (sp2C > 0)
+ {
+ if (GetMonData(pkmn, MON_DATA_POKEBALL, NULL) == 11)
+ friendship++;
+ if (GetMonData(pkmn, MON_DATA_MET_LOCATION, NULL) == sav1_map_get_name())
+ friendship++;
+ }
+ if (friendship < 0)
+ friendship = 0;
+ if (friendship > 255)
+ friendship = 255;
+ SetMonData(pkmn, MON_DATA_FRIENDSHIP, &friendship);
+ */
+ }
+ sp24++;
+ break;
+ case 7:
+ if (GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL) >= 200 && retVal == 0 && sp2C == 0)
+ {
+ sp2C = itemEffect[sp24];
+ /*
+ friendship = GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL);
+ if (sp2C > 0 && holdEffect == HOLD_EFFECT_HAPPINESS_UP)
+ friendship += 150 * sp2C / 100;
+ else
+ friendship += sp2C;
+ if (sp2C > 0)
+ {
+ if (GetMonData(pkmn, MON_DATA_POKEBALL, NULL) == 11)
+ friendship++;
+ if (GetMonData(pkmn, MON_DATA_MET_LOCATION, NULL) == sav1_map_get_name())
+ friendship++;
+ }
+ if (friendship < 0)
+ friendship = 0;
+ if (friendship > 255)
+ friendship = 255;
+ SetMonData(pkmn, MON_DATA_FRIENDSHIP, &friendship);
+ */
+ }
+ sp24++;
+ break;
+ }
+ }
+ sp28++;
+ r10 >>= 1;
+ }
+ break;
+ }
+ }
+ return retVal;
+}
+#else
+__attribute__((naked))
+bool8 PokemonUseItemEffects2(struct Pokemon *pkmn, u16 item, u8 partyIndex, u8 moveIndex, u8 e)
+{
+ asm(".syntax unified\n\
+ push {r4-r7,lr}\n\
+ mov r7, r10\n\
+ mov r6, r9\n\
+ mov r5, r8\n\
+ push {r5-r7}\n\
+ sub sp, 0x20\n\
+ mov r8, r0\n\
+ lsls r1, 16\n\
+ lsrs r1, 16\n\
+ str r1, [sp]\n\
+ lsls r2, 24\n\
+ lsrs r2, 24\n\
+ str r2, [sp, 0x4]\n\
+ lsls r3, 24\n\
+ lsrs r3, 24\n\
+ str r3, [sp, 0x8]\n\
+ movs r0, 0x1\n\
+ str r0, [sp, 0x10]\n\
+ movs r1, 0x6\n\
+ mov r10, r1\n\
+ movs r2, 0\n\
+ str r2, [sp, 0x18]\n\
+ movs r0, 0x4\n\
+ str r0, [sp, 0x1C]\n\
+ mov r0, r8\n\
+ movs r1, 0xC\n\
+ bl GetMonData\n\
+ lsls r0, 16\n\
+ lsrs r0, 16\n\
+ cmp r0, 0xAF\n\
+ beq _08042458\n\
+ bl ItemId_GetHoldEffect\n\
+_08042458:\n\
+ ldr r1, _080424B0 @ =gPotentialItemEffectBattler\n\
+ ldr r0, _080424B4 @ =gBattlerInMenuId\n\
+ ldrb r2, [r0]\n\
+ strb r2, [r1]\n\
+ ldr r0, _080424B8 @ =gMain\n\
+ ldr r1, _080424BC @ =0x00000439\n\
+ adds r0, r1\n\
+ ldrb r1, [r0]\n\
+ movs r0, 0x2\n\
+ ands r0, r1\n\
+ lsls r0, 24\n\
+ lsrs r1, r0, 24\n\
+ cmp r1, 0\n\
+ beq _080424F8\n\
+ ldr r0, _080424C0 @ =gActiveBattler\n\
+ strb r2, [r0]\n\
+ ldrb r0, [r0]\n\
+ bl GetBattlerSide\n\
+ lsls r0, 24\n\
+ lsrs r0, 24\n\
+ negs r1, r0\n\
+ orrs r1, r0\n\
+ lsrs r1, 31\n\
+ str r1, [sp, 0xC]\n\
+ ldr r0, _080424C4 @ =gBattlersCount\n\
+ ldr r4, [sp]\n\
+ subs r4, 0xD\n\
+ ldrb r0, [r0]\n\
+ cmp r1, r0\n\
+ bge _08042504\n\
+ ldr r2, _080424C8 @ =gBattlerPartyIndexes\n\
+ lsls r0, r1, 1\n\
+ adds r0, r2\n\
+ ldrh r3, [r0]\n\
+ ldr r1, [sp, 0x4]\n\
+ lsls r0, r1, 16\n\
+ lsrs r1, r0, 16\n\
+ adds r5, r0, 0\n\
+ cmp r3, r1\n\
+ bne _080424CC\n\
+ ldr r2, [sp, 0xC]\n\
+ str r2, [sp, 0x1C]\n\
+ b _08042504\n\
+ .align 2, 0\n\
+_080424B0: .4byte gPotentialItemEffectBattler\n\
+_080424B4: .4byte gBattlerInMenuId\n\
+_080424B8: .4byte gMain\n\
+_080424BC: .4byte 0x00000439\n\
+_080424C0: .4byte gActiveBattler\n\
+_080424C4: .4byte gBattlersCount\n\
+_080424C8: .4byte gBattlerPartyIndexes\n\
+_080424CC:\n\
+ ldr r0, [sp, 0xC]\n\
+ adds r0, 0x2\n\
+ str r0, [sp, 0xC]\n\
+ ldr r0, _080424F4 @ =gBattlersCount\n\
+ ldr r1, [sp, 0xC]\n\
+ ldrb r0, [r0]\n\
+ cmp r1, r0\n\
+ bge _08042504\n\
+ lsls r0, r1, 1\n\
+ adds r0, r2\n\
+ ldrh r1, [r0]\n\
+ lsrs r0, r5, 16\n\
+ cmp r1, r0\n\
+ bne _080424CC\n\
+ ldr r2, [sp, 0xC]\n\
+ lsls r0, r2, 24\n\
+ lsrs r0, 24\n\
+ str r0, [sp, 0x1C]\n\
+ b _08042504\n\
+ .align 2, 0\n\
+_080424F4: .4byte gBattlersCount\n\
+_080424F8:\n\
+ ldr r0, _08042520 @ =gActiveBattler\n\
+ strb r1, [r0]\n\
+ movs r0, 0x4\n\
+ str r0, [sp, 0x1C]\n\
+ ldr r4, [sp]\n\
+ subs r4, 0xD\n\
+_08042504:\n\
+ lsls r0, r4, 16\n\
+ lsrs r0, 16\n\
+ cmp r0, 0xA5\n\
+ bhi _08042578\n\
+ ldr r1, _08042524 @ =gItemEffectTable\n\
+ lsls r0, r4, 2\n\
+ adds r0, r1\n\
+ ldr r0, [r0]\n\
+ cmp r0, 0\n\
+ bne _08042528\n\
+ ldr r1, [sp]\n\
+ cmp r1, 0xAF\n\
+ beq _0804252E\n\
+ b _08042578\n\
+ .align 2, 0\n\
+_08042520: .4byte gActiveBattler\n\
+_08042524: .4byte gItemEffectTable\n\
+_08042528:\n\
+ ldr r2, [sp]\n\
+ cmp r2, 0xAF\n\
+ bne _0804257C\n\
+_0804252E:\n\
+ ldr r0, _08042550 @ =gMain\n\
+ ldr r1, _08042554 @ =0x00000439\n\
+ adds r0, r1\n\
+ ldrb r1, [r0]\n\
+ movs r0, 0x2\n\
+ ands r0, r1\n\
+ cmp r0, 0\n\
+ beq _08042560\n\
+ ldr r0, _08042558 @ =gActiveBattler\n\
+ ldrb r1, [r0]\n\
+ lsls r0, r1, 3\n\
+ subs r0, r1\n\
+ lsls r0, 2\n\
+ ldr r1, _0804255C @ =gEnigmaBerries+0x8\n\
+ adds r0, r1\n\
+ b _0804257C\n\
+ .align 2, 0\n\
+_08042550: .4byte gMain\n\
+_08042554: .4byte 0x00000439\n\
+_08042558: .4byte gActiveBattler\n\
+_0804255C: .4byte gEnigmaBerries+0x8\n\
+_08042560:\n\
+ ldr r0, _0804256C @ =gSaveBlock1Ptr\n\
+ ldr r0, [r0]\n\
+ ldr r2, _08042570 @ =0x00003108\n\
+ adds r2, r0, r2\n\
+ str r2, [sp, 0x14]\n\
+ b _0804257E\n\
+ .align 2, 0\n\
+_0804256C: .4byte gSaveBlock1Ptr\n\
+_08042570: .4byte 0x00003108\n\
+_08042574:\n\
+ movs r0, 0\n\
+ b _08042BD8\n\
+_08042578:\n\
+ movs r0, 0x1\n\
+ b _08042BD8\n\
+_0804257C:\n\
+ str r0, [sp, 0x14]\n\
+_0804257E:\n\
+ movs r0, 0\n\
+ str r0, [sp, 0xC]\n\
+_08042582:\n\
+ ldr r1, [sp, 0xC]\n\
+ cmp r1, 0x5\n\
+ bls _0804258A\n\
+ b _08042BCA\n\
+_0804258A:\n\
+ lsls r0, r1, 2\n\
+ ldr r1, _08042594 @ =_08042598\n\
+ adds r0, r1\n\
+ ldr r0, [r0]\n\
+ mov pc, r0\n\
+ .align 2, 0\n\
+_08042594: .4byte _08042598\n\
+ .align 2, 0\n\
+_08042598:\n\
+ .4byte _080425B0\n\
+ .4byte _0804264C\n\
+ .4byte _080426A8\n\
+ .4byte _08042708\n\
+ .4byte _08042850\n\
+ .4byte _08042A6A\n\
+_080425B0:\n\
+ ldr r0, [sp, 0x14]\n\
+ ldr r1, [sp, 0xC]\n\
+ adds r2, r0, r1\n\
+ ldrb r1, [r2]\n\
+ movs r0, 0x80\n\
+ ands r0, r1\n\
+ adds r5, r2, 0\n\
+ cmp r0, 0\n\
+ beq _080425F4\n\
+ ldr r0, _0804263C @ =gMain\n\
+ ldr r2, _08042640 @ =0x00000439\n\
+ adds r0, r2\n\
+ ldrb r1, [r0]\n\
+ movs r0, 0x2\n\
+ ands r0, r1\n\
+ cmp r0, 0\n\
+ beq _080425F4\n\
+ ldr r0, [sp, 0x1C]\n\
+ cmp r0, 0x4\n\
+ beq _080425F4\n\
+ ldr r1, _08042644 @ =gBattleMons\n\
+ movs r0, 0x58\n\
+ ldr r2, [sp, 0x1C]\n\
+ muls r0, r2\n\
+ adds r1, 0x50\n\
+ adds r0, r1\n\
+ ldr r0, [r0]\n\
+ movs r1, 0xF0\n\
+ lsls r1, 12\n\
+ ands r0, r1\n\
+ cmp r0, 0\n\
+ beq _080425F4\n\
+ movs r0, 0\n\
+ str r0, [sp, 0x10]\n\
+_080425F4:\n\
+ ldrb r1, [r5]\n\
+ movs r0, 0x30\n\
+ ands r0, r1\n\
+ cmp r0, 0\n\
+ beq _0804261C\n\
+ ldr r1, _08042644 @ =gBattleMons\n\
+ ldr r0, _08042648 @ =gActiveBattler\n\
+ ldrb r2, [r0]\n\
+ movs r0, 0x58\n\
+ muls r0, r2\n\
+ adds r1, 0x50\n\
+ adds r0, r1\n\
+ ldr r0, [r0]\n\
+ movs r1, 0x80\n\
+ lsls r1, 13\n\
+ ands r0, r1\n\
+ cmp r0, 0\n\
+ bne _0804261C\n\
+ movs r1, 0\n\
+ str r1, [sp, 0x10]\n\
+_0804261C:\n\
+ ldrb r1, [r5]\n\
+ movs r0, 0xF\n\
+ ands r0, r1\n\
+ cmp r0, 0\n\
+ bne _08042628\n\
+ b _08042BCA\n\
+_08042628:\n\
+ ldr r2, _08042644 @ =gBattleMons\n\
+ ldr r0, _08042648 @ =gActiveBattler\n\
+ ldrb r1, [r0]\n\
+ movs r0, 0x58\n\
+ muls r0, r1\n\
+ adds r0, r2\n\
+ ldrb r0, [r0, 0x19]\n\
+ lsls r0, 24\n\
+ asrs r0, 24\n\
+ b _080426F2\n\
+ .align 2, 0\n\
+_0804263C: .4byte gMain\n\
+_08042640: .4byte 0x00000439\n\
+_08042644: .4byte gBattleMons\n\
+_08042648: .4byte gActiveBattler\n\
+_0804264C:\n\
+ ldr r0, [sp, 0x14]\n\
+ ldr r1, [sp, 0xC]\n\
+ adds r2, r0, r1\n\
+ ldrb r1, [r2]\n\
+ movs r0, 0xF0\n\
+ ands r0, r1\n\
+ adds r5, r2, 0\n\
+ cmp r0, 0\n\
+ beq _08042678\n\
+ ldr r2, _080426A0 @ =gBattleMons\n\
+ ldr r0, _080426A4 @ =gActiveBattler\n\
+ ldrb r1, [r0]\n\
+ movs r0, 0x58\n\
+ muls r0, r1\n\
+ adds r0, r2\n\
+ ldrb r0, [r0, 0x1A]\n\
+ lsls r0, 24\n\
+ asrs r0, 24\n\
+ cmp r0, 0xB\n\
+ bgt _08042678\n\
+ movs r2, 0\n\
+ str r2, [sp, 0x10]\n\
+_08042678:\n\
+ ldrb r1, [r5]\n\
+ movs r0, 0xF\n\
+ ands r0, r1\n\
+ cmp r0, 0\n\
+ bne _08042684\n\
+ b _08042BCA\n\
+_08042684:\n\
+ ldr r2, _080426A0 @ =gBattleMons\n\
+ ldr r0, _080426A4 @ =gActiveBattler\n\
+ ldrb r1, [r0]\n\
+ movs r0, 0x58\n\
+ muls r0, r1\n\
+ adds r0, r2\n\
+ ldrb r0, [r0, 0x1B]\n\
+ lsls r0, 24\n\
+ asrs r0, 24\n\
+ cmp r0, 0xB\n\
+ ble _0804269C\n\
+ b _08042BCA\n\
+_0804269C:\n\
+ b _08042832\n\
+ .align 2, 0\n\
+_080426A0: .4byte gBattleMons\n\
+_080426A4: .4byte gActiveBattler\n\
+_080426A8:\n\
+ ldr r1, [sp, 0x14]\n\
+ ldr r0, [sp, 0xC]\n\
+ adds r2, r1, r0\n\
+ ldrb r1, [r2]\n\
+ movs r0, 0xF0\n\
+ ands r0, r1\n\
+ adds r5, r2, 0\n\
+ cmp r0, 0\n\
+ beq _080426D4\n\
+ ldr r2, _08042700 @ =gBattleMons\n\
+ ldr r0, _08042704 @ =gActiveBattler\n\
+ ldrb r1, [r0]\n\
+ movs r0, 0x58\n\
+ muls r0, r1\n\
+ adds r0, r2\n\
+ ldrb r0, [r0, 0x1E]\n\
+ lsls r0, 24\n\
+ asrs r0, 24\n\
+ cmp r0, 0xB\n\
+ bgt _080426D4\n\
+ movs r1, 0\n\
+ str r1, [sp, 0x10]\n\
+_080426D4:\n\
+ ldrb r1, [r5]\n\
+ movs r0, 0xF\n\
+ ands r0, r1\n\
+ cmp r0, 0\n\
+ bne _080426E0\n\
+ b _08042BCA\n\
+_080426E0:\n\
+ ldr r2, _08042700 @ =gBattleMons\n\
+ ldr r0, _08042704 @ =gActiveBattler\n\
+ ldrb r1, [r0]\n\
+ movs r0, 0x58\n\
+ muls r0, r1\n\
+ adds r0, r2\n\
+ ldrb r0, [r0, 0x1C]\n\
+ lsls r0, 24\n\
+ asrs r0, 24\n\
+_080426F2:\n\
+ cmp r0, 0xB\n\
+ ble _080426F8\n\
+ b _08042BCA\n\
+_080426F8:\n\
+ movs r2, 0\n\
+ str r2, [sp, 0x10]\n\
+ b _08042BCA\n\
+ .align 2, 0\n\
+_08042700: .4byte gBattleMons\n\
+_08042704: .4byte gActiveBattler\n\
+_08042708:\n\
+ ldr r0, [sp, 0x14]\n\
+ ldr r1, [sp, 0xC]\n\
+ adds r2, r0, r1\n\
+ ldrb r1, [r2]\n\
+ movs r0, 0x80\n\
+ ands r0, r1\n\
+ adds r5, r2, 0\n\
+ cmp r0, 0\n\
+ beq _0804273A\n\
+ ldr r4, _08042838 @ =gSideTimers\n\
+ ldr r0, _0804283C @ =gActiveBattler\n\
+ ldrb r0, [r0]\n\
+ bl GetBattlerSide\n\
+ lsls r0, 24\n\
+ lsrs r0, 24\n\
+ lsls r1, r0, 1\n\
+ adds r1, r0\n\
+ lsls r1, 2\n\
+ adds r1, r4\n\
+ ldrb r0, [r1, 0x4]\n\
+ cmp r0, 0\n\
+ bne _0804273A\n\
+ movs r2, 0\n\
+ str r2, [sp, 0x10]\n\
+_0804273A:\n\
+ ldrb r1, [r5]\n\
+ movs r0, 0x40\n\
+ ands r0, r1\n\
+ cmp r0, 0\n\
+ beq _08042756\n\
+ mov r0, r8\n\
+ movs r1, 0x38\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ cmp r0, 0x64\n\
+ beq _08042756\n\
+ movs r0, 0\n\
+ str r0, [sp, 0x10]\n\
+_08042756:\n\
+ ldrb r1, [r5]\n\
+ movs r0, 0x20\n\
+ ands r0, r1\n\
+ cmp r0, 0\n\
+ beq _08042776\n\
+ mov r0, r8\n\
+ ldr r1, [sp, 0x4]\n\
+ movs r2, 0x7\n\
+ ldr r3, [sp, 0x1C]\n\
+ bl sub_8042BE8\n\
+ lsls r0, 24\n\
+ cmp r0, 0\n\
+ beq _08042776\n\
+ movs r1, 0\n\
+ str r1, [sp, 0x10]\n\
+_08042776:\n\
+ ldrb r1, [r5]\n\
+ movs r0, 0x10\n\
+ ands r0, r1\n\
+ cmp r0, 0\n\
+ beq _08042796\n\
+ ldr r2, _08042840 @ =0x00000f88\n\
+ mov r0, r8\n\
+ ldr r1, [sp, 0x4]\n\
+ ldr r3, [sp, 0x1C]\n\
+ bl sub_8042BE8\n\
+ lsls r0, 24\n\
+ cmp r0, 0\n\
+ beq _08042796\n\
+ movs r2, 0\n\
+ str r2, [sp, 0x10]\n\
+_08042796:\n\
+ ldrb r1, [r5]\n\
+ movs r0, 0x8\n\
+ ands r0, r1\n\
+ cmp r0, 0\n\
+ beq _080427B6\n\
+ mov r0, r8\n\
+ ldr r1, [sp, 0x4]\n\
+ movs r2, 0x10\n\
+ ldr r3, [sp, 0x1C]\n\
+ bl sub_8042BE8\n\
+ lsls r0, 24\n\
+ cmp r0, 0\n\
+ beq _080427B6\n\
+ movs r0, 0\n\
+ str r0, [sp, 0x10]\n\
+_080427B6:\n\
+ ldrb r1, [r5]\n\
+ movs r0, 0x4\n\
+ ands r0, r1\n\
+ cmp r0, 0\n\
+ beq _080427D6\n\
+ mov r0, r8\n\
+ ldr r1, [sp, 0x4]\n\
+ movs r2, 0x20\n\
+ ldr r3, [sp, 0x1C]\n\
+ bl sub_8042BE8\n\
+ lsls r0, 24\n\
+ cmp r0, 0\n\
+ beq _080427D6\n\
+ movs r1, 0\n\
+ str r1, [sp, 0x10]\n\
+_080427D6:\n\
+ ldrb r1, [r5]\n\
+ movs r0, 0x2\n\
+ ands r0, r1\n\
+ cmp r0, 0\n\
+ beq _080427F6\n\
+ mov r0, r8\n\
+ ldr r1, [sp, 0x4]\n\
+ movs r2, 0x40\n\
+ ldr r3, [sp, 0x1C]\n\
+ bl sub_8042BE8\n\
+ lsls r0, 24\n\
+ cmp r0, 0\n\
+ beq _080427F6\n\
+ movs r2, 0\n\
+ str r2, [sp, 0x10]\n\
+_080427F6:\n\
+ ldrb r1, [r5]\n\
+ movs r0, 0x1\n\
+ ands r0, r1\n\
+ cmp r0, 0\n\
+ bne _08042802\n\
+ b _08042BCA\n\
+_08042802:\n\
+ ldr r0, _08042844 @ =gMain\n\
+ ldr r1, _08042848 @ =0x00000439\n\
+ adds r0, r1\n\
+ ldrb r1, [r0]\n\
+ movs r0, 0x2\n\
+ ands r0, r1\n\
+ cmp r0, 0\n\
+ bne _08042814\n\
+ b _08042BCA\n\
+_08042814:\n\
+ ldr r2, [sp, 0x1C]\n\
+ cmp r2, 0x4\n\
+ bne _0804281C\n\
+ b _08042BCA\n\
+_0804281C:\n\
+ ldr r1, _0804284C @ =gBattleMons\n\
+ movs r0, 0x58\n\
+ muls r0, r2\n\
+ adds r1, 0x50\n\
+ adds r0, r1\n\
+ ldr r0, [r0]\n\
+ movs r1, 0x7\n\
+ ands r0, r1\n\
+ cmp r0, 0\n\
+ bne _08042832\n\
+ b _08042BCA\n\
+_08042832:\n\
+ movs r0, 0\n\
+ str r0, [sp, 0x10]\n\
+ b _08042BCA\n\
+ .align 2, 0\n\
+_08042838: .4byte gSideTimers\n\
+_0804283C: .4byte gActiveBattler\n\
+_08042840: .4byte 0x00000f88\n\
+_08042844: .4byte gMain\n\
+_08042848: .4byte 0x00000439\n\
+_0804284C: .4byte gBattleMons\n\
+_08042850:\n\
+ ldr r1, [sp, 0x14]\n\
+ ldr r2, [sp, 0xC]\n\
+ adds r0, r1, r2\n\
+ ldrb r7, [r0]\n\
+ movs r0, 0x20\n\
+ ands r0, r7\n\
+ cmp r0, 0\n\
+ beq _080428B6\n\
+ movs r0, 0xDF\n\
+ ands r7, r0\n\
+ mov r0, r8\n\
+ movs r1, 0x15\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ adds r5, r0, 0\n\
+ ldr r0, _080428DC @ =gUnknown_825DEA1\n\
+ ldr r1, [sp, 0x8]\n\
+ adds r0, r1, r0\n\
+ ldrb r0, [r0]\n\
+ ands r5, r0\n\
+ lsls r0, r1, 1\n\
+ lsrs r5, r0\n\
+ adds r1, 0xD\n\
+ mov r0, r8\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ adds r4, r0, 0\n\
+ lsls r4, 16\n\
+ lsrs r4, 16\n\
+ mov r0, r8\n\
+ movs r1, 0x15\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ adds r1, r0, 0\n\
+ lsls r1, 24\n\
+ lsrs r1, 24\n\
+ adds r0, r4, 0\n\
+ ldr r2, [sp, 0x8]\n\
+ bl CalculatePPWithBonus\n\
+ lsls r0, 24\n\
+ lsrs r0, 24\n\
+ cmp r5, 0x2\n\
+ bhi _080428B6\n\
+ cmp r0, 0x4\n\
+ bls _080428B6\n\
+ movs r2, 0\n\
+ str r2, [sp, 0x10]\n\
+_080428B6:\n\
+ movs r0, 0\n\
+ mov r9, r0\n\
+ cmp r7, 0\n\
+ bne _080428C0\n\
+ b _08042BCA\n\
+_080428C0:\n\
+ movs r0, 0x1\n\
+ ands r0, r7\n\
+ cmp r0, 0\n\
+ bne _080428CA\n\
+ b _08042A5C\n\
+_080428CA:\n\
+ mov r1, r9\n\
+ cmp r1, 0x7\n\
+ bls _080428D2\n\
+ b _08042A5C\n\
+_080428D2:\n\
+ lsls r0, r1, 2\n\
+ ldr r1, _080428E0 @ =_080428E4\n\
+ adds r0, r1\n\
+ ldr r0, [r0]\n\
+ mov pc, r0\n\
+ .align 2, 0\n\
+_080428DC: .4byte gUnknown_825DEA1\n\
+_080428E0: .4byte _080428E4\n\
+ .align 2, 0\n\
+_080428E4:\n\
+ .4byte _08042904\n\
+ .4byte _08042904\n\
+ .4byte _08042934\n\
+ .4byte _08042996\n\
+ .4byte _08042A5C\n\
+ .4byte _08042A5C\n\
+ .4byte _08042A5C\n\
+ .4byte _08042A4A\n\
+_08042904:\n\
+ mov r0, r8\n\
+ bl GetMonEVCount\n\
+ lsls r0, 16\n\
+ ldr r1, _0804292C @ =0x01fd0000\n\
+ cmp r0, r1\n\
+ bls _08042914\n\
+ b _08042578\n\
+_08042914:\n\
+ ldr r0, _08042930 @ =sGetMonDataEVConstants\n\
+ add r0, r9\n\
+ ldrb r1, [r0]\n\
+ mov r0, r8\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ adds r5, r0, 0\n\
+ cmp r5, 0x63\n\
+ bls _0804292A\n\
+ b _08042A5C\n\
+_0804292A:\n\
+ b _08042A3A\n\
+ .align 2, 0\n\
+_0804292C: .4byte 0x01fd0000\n\
+_08042930: .4byte sGetMonDataEVConstants\n\
+_08042934:\n\
+ movs r0, 0x10\n\
+ ands r0, r7\n\
+ cmp r0, 0\n\
+ beq _08042952\n\
+ mov r0, r8\n\
+ movs r1, 0x39\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ cmp r0, 0\n\
+ beq _08042968\n\
+ mov r0, r10\n\
+ adds r0, 0x1\n\
+ lsls r0, 24\n\
+ b _080429F4\n\
+_08042952:\n\
+ mov r0, r8\n\
+ movs r1, 0x39\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ cmp r0, 0\n\
+ bne _08042968\n\
+ mov r0, r10\n\
+ adds r0, 0x1\n\
+ lsls r0, 24\n\
+ b _080429F4\n\
+_08042968:\n\
+ mov r0, r8\n\
+ movs r1, 0x3A\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ adds r4, r0, 0\n\
+ mov r0, r8\n\
+ movs r1, 0x39\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ cmp r4, r0\n\
+ beq _08042986\n\
+ movs r0, 0\n\
+ str r0, [sp, 0x10]\n\
+_08042986:\n\
+ mov r0, r10\n\
+ adds r0, 0x1\n\
+ lsls r0, 24\n\
+ lsrs r0, 24\n\
+ mov r10, r0\n\
+ movs r0, 0xEF\n\
+ ands r7, r0\n\
+ b _08042A5C\n\
+_08042996:\n\
+ movs r0, 0x2\n\
+ ands r0, r7\n\
+ cmp r0, 0\n\
+ bne _080429FA\n\
+ movs r6, 0\n\
+ movs r1, 0x1\n\
+ add r10, r1\n\
+_080429A4:\n\
+ adds r1, r6, 0\n\
+ adds r1, 0x11\n\
+ mov r0, r8\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ adds r5, r0, 0\n\
+ adds r1, r6, 0\n\
+ adds r1, 0xD\n\
+ mov r0, r8\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ adds r4, r0, 0\n\
+ lsls r4, 16\n\
+ lsrs r4, 16\n\
+ mov r0, r8\n\
+ movs r1, 0x15\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ adds r1, r0, 0\n\
+ lsls r1, 24\n\
+ lsrs r1, 24\n\
+ lsls r2, r6, 24\n\
+ lsrs r2, 24\n\
+ adds r0, r4, 0\n\
+ bl CalculatePPWithBonus\n\
+ lsls r0, 24\n\
+ lsrs r0, 24\n\
+ cmp r5, r0\n\
+ beq _080429EA\n\
+ movs r2, 0\n\
+ str r2, [sp, 0x10]\n\
+_080429EA:\n\
+ adds r6, 0x1\n\
+ cmp r6, 0x3\n\
+ ble _080429A4\n\
+ mov r1, r10\n\
+ lsls r0, r1, 24\n\
+_080429F4:\n\
+ lsrs r0, 24\n\
+ mov r10, r0\n\
+ b _08042A5C\n\
+_080429FA:\n\
+ ldr r1, [sp, 0x8]\n\
+ adds r1, 0x11\n\
+ mov r0, r8\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ adds r5, r0, 0\n\
+ ldr r1, [sp, 0x8]\n\
+ adds r1, 0xD\n\
+ mov r0, r8\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ adds r4, r0, 0\n\
+ lsls r4, 16\n\
+ lsrs r4, 16\n\
+ mov r0, r8\n\
+ movs r1, 0x15\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ adds r1, r0, 0\n\
+ lsls r1, 24\n\
+ lsrs r1, 24\n\
+ adds r0, r4, 0\n\
+ ldr r2, [sp, 0x8]\n\
+ bl CalculatePPWithBonus\n\
+ lsls r0, 24\n\
+ lsrs r0, 24\n\
+ cmp r5, r0\n\
+ beq _08042A5C\n\
+_08042A3A:\n\
+ mov r0, r10\n\
+ adds r0, 0x1\n\
+ lsls r0, 24\n\
+ lsrs r0, 24\n\
+ mov r10, r0\n\
+ movs r2, 0\n\
+ str r2, [sp, 0x10]\n\
+ b _08042A5C\n\
+_08042A4A:\n\
+ mov r0, r8\n\
+ movs r1, 0x2\n\
+ ldr r2, [sp]\n\
+ bl GetEvolutionTargetSpecies\n\
+ lsls r0, 16\n\
+ cmp r0, 0\n\
+ beq _08042A5C\n\
+ b _08042574\n\
+_08042A5C:\n\
+ movs r0, 0x1\n\
+ add r9, r0\n\
+ lsrs r7, 1\n\
+ cmp r7, 0\n\
+ beq _08042A68\n\
+ b _080428C0\n\
+_08042A68:\n\
+ b _08042BCA\n\
+_08042A6A:\n\
+ ldr r1, [sp, 0x14]\n\
+ ldr r2, [sp, 0xC]\n\
+ adds r0, r1, r2\n\
+ ldrb r7, [r0]\n\
+ movs r0, 0\n\
+ mov r9, r0\n\
+ cmp r7, 0\n\
+ bne _08042A7C\n\
+ b _08042BCA\n\
+_08042A7C:\n\
+ movs r0, 0x1\n\
+ ands r0, r7\n\
+ cmp r0, 0\n\
+ bne _08042A86\n\
+ b _08042BBE\n\
+_08042A86:\n\
+ mov r1, r9\n\
+ cmp r1, 0x7\n\
+ bls _08042A8E\n\
+ b _08042BBE\n\
+_08042A8E:\n\
+ lsls r0, r1, 2\n\
+ ldr r1, _08042A98 @ =_08042A9C\n\
+ adds r0, r1\n\
+ ldr r0, [r0]\n\
+ mov pc, r0\n\
+ .align 2, 0\n\
+_08042A98: .4byte _08042A9C\n\
+ .align 2, 0\n\
+_08042A9C:\n\
+ .4byte _08042ABC\n\
+ .4byte _08042ABC\n\
+ .4byte _08042ABC\n\
+ .4byte _08042ABC\n\
+ .4byte _08042AF4\n\
+ .4byte _08042B4C\n\
+ .4byte _08042B68\n\
+ .4byte _08042B92\n\
+_08042ABC:\n\
+ mov r0, r8\n\
+ bl GetMonEVCount\n\
+ lsls r0, 16\n\
+ ldr r1, _08042AEC @ =0x01fd0000\n\
+ cmp r0, r1\n\
+ bls _08042ACC\n\
+ b _08042578\n\
+_08042ACC:\n\
+ ldr r0, _08042AF0 @ =sGetMonDataEVConstants\n\
+ mov r1, r9\n\
+ adds r1, 0x2\n\
+ adds r1, r0\n\
+ ldrb r1, [r1]\n\
+ mov r0, r8\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ adds r5, r0, 0\n\
+ cmp r5, 0x63\n\
+ bhi _08042BBE\n\
+ movs r2, 0\n\
+ str r2, [sp, 0x10]\n\
+ b _08042BB4\n\
+ .align 2, 0\n\
+_08042AEC: .4byte 0x01fd0000\n\
+_08042AF0: .4byte sGetMonDataEVConstants\n\
+_08042AF4:\n\
+ mov r0, r8\n\
+ movs r1, 0x15\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ adds r5, r0, 0\n\
+ ldr r0, _08042B48 @ =gUnknown_825DEA1\n\
+ ldr r1, [sp, 0x8]\n\
+ adds r0, r1, r0\n\
+ ldrb r0, [r0]\n\
+ ands r5, r0\n\
+ lsls r0, r1, 1\n\
+ lsrs r5, r0\n\
+ adds r1, 0xD\n\
+ mov r0, r8\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ adds r4, r0, 0\n\
+ lsls r4, 16\n\
+ lsrs r4, 16\n\
+ mov r0, r8\n\
+ movs r1, 0x15\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ adds r1, r0, 0\n\
+ lsls r1, 24\n\
+ lsrs r1, 24\n\
+ adds r0, r4, 0\n\
+ ldr r2, [sp, 0x8]\n\
+ bl CalculatePPWithBonus\n\
+ lsls r0, 24\n\
+ lsrs r6, r0, 24\n\
+ cmp r5, 0x2\n\
+ bhi _08042BBE\n\
+ cmp r6, 0x4\n\
+ ble _08042BBE\n\
+ movs r2, 0\n\
+ str r2, [sp, 0x10]\n\
+ b _08042BBE\n\
+ .align 2, 0\n\
+_08042B48: .4byte gUnknown_825DEA1\n\
+_08042B4C:\n\
+ mov r0, r8\n\
+ movs r1, 0x20\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ cmp r0, 0x63\n\
+ bhi _08042BB4\n\
+ ldr r0, [sp, 0x10]\n\
+ cmp r0, 0\n\
+ bne _08042BB4\n\
+ ldr r1, [sp, 0x18]\n\
+ cmp r1, 0\n\
+ bne _08042BB4\n\
+ b _08042BAC\n\
+_08042B68:\n\
+ mov r0, r8\n\
+ movs r1, 0x20\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ cmp r0, 0x63\n\
+ bls _08042BB4\n\
+ mov r0, r8\n\
+ movs r1, 0x20\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ cmp r0, 0xC7\n\
+ bhi _08042BB4\n\
+ ldr r2, [sp, 0x10]\n\
+ cmp r2, 0\n\
+ bne _08042BB4\n\
+ ldr r0, [sp, 0x18]\n\
+ cmp r0, 0\n\
+ bne _08042BB4\n\
+ b _08042BAC\n\
+_08042B92:\n\
+ mov r0, r8\n\
+ movs r1, 0x20\n\
+ movs r2, 0\n\
+ bl GetMonData\n\
+ cmp r0, 0xC7\n\
+ bls _08042BB4\n\
+ ldr r1, [sp, 0x10]\n\
+ cmp r1, 0\n\
+ bne _08042BB4\n\
+ ldr r2, [sp, 0x18]\n\
+ cmp r2, 0\n\
+ bne _08042BB4\n\
+_08042BAC:\n\
+ ldr r0, [sp, 0x14]\n\
+ add r0, r10\n\
+ ldrb r0, [r0]\n\
+ str r0, [sp, 0x18]\n\
+_08042BB4:\n\
+ mov r0, r10\n\
+ adds r0, 0x1\n\
+ lsls r0, 24\n\
+ lsrs r0, 24\n\
+ mov r10, r0\n\
+_08042BBE:\n\
+ movs r0, 0x1\n\
+ add r9, r0\n\
+ lsrs r7, 1\n\
+ cmp r7, 0\n\
+ beq _08042BCA\n\
+ b _08042A7C\n\
+_08042BCA:\n\
+ ldr r1, [sp, 0xC]\n\
+ adds r1, 0x1\n\
+ str r1, [sp, 0xC]\n\
+ cmp r1, 0x5\n\
+ bgt _08042BD6\n\
+ b _08042582\n\
+_08042BD6:\n\
+ ldr r0, [sp, 0x10]\n\
+_08042BD8:\n\
+ add sp, 0x20\n\
+ pop {r3-r5}\n\
+ mov r8, r3\n\
+ mov r9, r4\n\
+ mov r10, r5\n\
+ pop {r4-r7}\n\
+ pop {r1}\n\
+ bx r1\n\
+ .syntax divided\n");
+}
+#endif
+
+bool8 sub_8042BE8(struct Pokemon *mon, u32 unused, u32 healMask, u8 battleId)
+{
+ if((GetMonData(mon, MON_DATA_STATUS, NULL) & healMask) != 0)
+ return TRUE;
+ else
+ return FALSE;
+}
+
+u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit)
+{
+ const u8 *temp;
+ const u8 *itemEffect;
+ u8 offset;
+ int i;
+ u8 j;
+ u8 val;
+
+ offset = 6;
+
+ temp = gItemEffectTable[itemId - 13];
+
+ if (!temp && itemId != ITEM_ENIGMA_BERRY)
+ return 0;
+
+ if (itemId == ITEM_ENIGMA_BERRY)
+ {
+ temp = gEnigmaBerries[gActiveBattler].itemEffect;
+ }
+
+ itemEffect = temp;
+
+ for (i = 0; i < 6; i++)
+ {
+ switch (i)
+ {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ if (i == effectByte)
+ return 0;
+ break;
+ case 4:
+ val = itemEffect[4];
+ if (val & 0x20)
+ val &= 0xDF;
+ j = 0;
+ while (val)
+ {
+ if (val & 1)
+ {
+ switch (j)
+ {
+ case 2:
+ if (val & 0x10)
+ val &= 0xEF;
+ case 0:
+ if (i == effectByte && (val & effectBit))
+ return offset;
+ offset++;
+ break;
+ case 1:
+ if (i == effectByte && (val & effectBit))
+ return offset;
+ offset++;
+ break;
+ case 3:
+ if (i == effectByte && (val & effectBit))
+ return offset;
+ offset++;
+ break;
+ case 7:
+ if (i == effectByte)
+ return 0;
+ break;
+ }
+ }
+ j++;
+ val >>= 1;
+ if (i == effectByte)
+ effectBit >>= 1;
+ }
+ break;
+ case 5:
+ val = itemEffect[5];
+ j = 0;
+ while (val)
+ {
+ if (val & 1)
+ {
+ switch (j)
+ {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ if (i == effectByte && (val & effectBit))
+ return offset;
+ offset++;
+ break;
+ case 7:
+ if (i == effectByte)
+ return 0;
+ break;
+ }
+ }
+ j++;
+ val >>= 1;
+ if (i == effectByte)
+ effectBit >>= 1;
+ }
+ break;
+ }
+ }
+
+ return offset;
+}
+
+void sub_8042D50(int stat)
+{
+ gBattlerTarget = gBattlerInMenuId;
+ StringCopy(gBattleTextBuff1, gUnknown_83FD5D0[gUnknown_825DFF0[stat]]);
+ StringCopy(gBattleTextBuff2, BattleText_Rose);
+ BattleStringExpandPlaceholdersToDisplayedString(BattleText_UnknownString3);
+}
+
+u8 *sub_8042DA4(u16 itemId)
+{
+ int i;
+ const u8 *itemEffect;
+
+ if (itemId == ITEM_ENIGMA_BERRY)
+ {
+ if (gMain.inBattle)
+ {
+ itemEffect = gEnigmaBerries[gBattlerInMenuId].itemEffect;
+ }
+ else
+ {
+ itemEffect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
+ }
+ }
+ else
+ {
+ itemEffect = gItemEffectTable[itemId - 13];
+ }
+
+ gPotentialItemEffectBattler = gBattlerInMenuId;
+
+ for (i = 0; i < 3; i++)
+ {
+ if (itemEffect[i] & 0xF)
+ sub_8042D50(i * 2);
+ if (itemEffect[i] & 0xF0)
+ {
+ if (i)
+ {
+ sub_8042D50(i * 2 + 1);
+ }
+ else
+ {
+ sBattler_AI = gBattlerInMenuId;
+ BattleStringExpandPlaceholdersToDisplayedString(BattleText_GetPumped);
+ }
+ }
+ }
+
+ if (itemEffect[3] & 0x80)
+ {
+ sBattler_AI = gBattlerInMenuId;
+ BattleStringExpandPlaceholdersToDisplayedString(BattleText_MistShroud);
+ }
+
+ return gDisplayedStringBattle;
+}
+
+u8 GetNature(struct Pokemon *mon)
+{
+ return GetMonData(mon, MON_DATA_PERSONALITY, 0) % 25;
+}
+
+u8 GetNatureFromPersonality(u32 personality)
+{
+ return personality % 25;
+}
+
+extern bool32 sub_806E25C(void);
+
+u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem)
+{
+ int i;
+ u16 targetSpecies = 0;
+ u16 species = GetMonData(mon, MON_DATA_SPECIES, 0);
+ u16 heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, 0);
+ u32 personality = GetMonData(mon, MON_DATA_PERSONALITY, 0);
+ u8 level;
+ u16 friendship;
+ u8 beauty = GetMonData(mon, MON_DATA_BEAUTY, 0);
+ u16 upperPersonality = personality >> 16;
+ u8 holdEffect;
+
+ if (heldItem == ITEM_ENIGMA_BERRY)
+ holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect;
+ else
+ holdEffect = ItemId_GetHoldEffect(heldItem);
+
+ if (holdEffect == HOLD_EFFECT_PREVENT_EVOLVE && type != 3)
+ return 0;
+
+ switch (type)
+ {
+ case 0:
+ level = GetMonData(mon, MON_DATA_LEVEL, 0);
+ friendship = GetMonData(mon, MON_DATA_FRIENDSHIP, 0);
+
+ for (i = 0; i < 5; i++)
+ {
+ switch (gEvolutionTable[species][i].method)
+ {
+ case EVO_FRIENDSHIP:
+ if (friendship >= 220)
+ targetSpecies = gEvolutionTable[species][i].targetSpecies;
+ break;
+ // FR/LG removed the time of day evolutions due to having no RTC.
+ case EVO_FRIENDSHIP_DAY:
+ /*
+ RtcCalcLocalTime();
+ if (gLocalTime.hours >= 12 && gLocalTime.hours < 24 && friendship >= 220)
+ targetSpecies = gEvolutionTable[species][i].targetSpecies;
+ */
+ break;
+ case EVO_FRIENDSHIP_NIGHT:
+ /*
+ RtcCalcLocalTime();
+ if (gLocalTime.hours >= 0 && gLocalTime.hours < 12 && friendship >= 220)
+ targetSpecies = gEvolutionTable[species][i].targetSpecies;
+ */
+ break;
+ case EVO_LEVEL:
+ if (gEvolutionTable[species][i].param <= level)
+ targetSpecies = gEvolutionTable[species][i].targetSpecies;
+ break;
+ case EVO_LEVEL_ATK_GT_DEF:
+ if (gEvolutionTable[species][i].param <= level)
+ if (GetMonData(mon, MON_DATA_ATK, 0) > GetMonData(mon, MON_DATA_DEF, 0))
+ targetSpecies = gEvolutionTable[species][i].targetSpecies;
+ break;
+ case EVO_LEVEL_ATK_EQ_DEF:
+ if (gEvolutionTable[species][i].param <= level)
+ if (GetMonData(mon, MON_DATA_ATK, 0) == GetMonData(mon, MON_DATA_DEF, 0))
+ targetSpecies = gEvolutionTable[species][i].targetSpecies;
+ break;
+ case EVO_LEVEL_ATK_LT_DEF:
+ if (gEvolutionTable[species][i].param <= level)
+ if (GetMonData(mon, MON_DATA_ATK, 0) < GetMonData(mon, MON_DATA_DEF, 0))
+ targetSpecies = gEvolutionTable[species][i].targetSpecies;
+ break;
+ case EVO_LEVEL_SILCOON:
+ if (gEvolutionTable[species][i].param <= level && (upperPersonality % 10) <= 4)
+ targetSpecies = gEvolutionTable[species][i].targetSpecies;
+ break;
+ case EVO_LEVEL_CASCOON:
+ if (gEvolutionTable[species][i].param <= level && (upperPersonality % 10) > 4)
+ targetSpecies = gEvolutionTable[species][i].targetSpecies;
+ break;
+ case EVO_LEVEL_NINJASK:
+ if (gEvolutionTable[species][i].param <= level)
+ targetSpecies = gEvolutionTable[species][i].targetSpecies;
+ break;
+ case EVO_BEAUTY:
+ if (gEvolutionTable[species][i].param <= beauty)
+ targetSpecies = gEvolutionTable[species][i].targetSpecies;
+ break;
+ }
+ }
+ break;
+ case 1:
+ for (i = 0; i < 5; i++)
+ {
+ switch (gEvolutionTable[species][i].method)
+ {
+ case EVO_TRADE:
+ targetSpecies = gEvolutionTable[species][i].targetSpecies;
+ break;
+ case EVO_TRADE_ITEM:
+ if (gEvolutionTable[species][i].param == heldItem)
+ {
+ targetSpecies = gEvolutionTable[species][i].targetSpecies;
+ if (sub_806E25C() || targetSpecies <= 151)
+ {
+ heldItem = 0;
+ SetMonData(mon, MON_DATA_HELD_ITEM, &heldItem);
+ targetSpecies = gEvolutionTable[species][i].targetSpecies;
+ }
+ }
+ break;
+ }
+ }
+ break;
+ case 2:
+ case 3:
+ for (i = 0; i < 5; i++)
+ {
+ if (gEvolutionTable[species][i].method == EVO_ITEM
+ && gEvolutionTable[species][i].param == evolutionItem)
+ {
+ targetSpecies = gEvolutionTable[species][i].targetSpecies;
+ break;
+ }
+ }
+ break;
+ }
+
+ return targetSpecies;
+}
+
+// HoennPokedexNumToSpecies, but is it really Hoenn or Kanto its checking
+// TODO: Figure this out
+u16 sub_80431B4(u16 var)
+{
+ u16 species;
+
+ if(!var)
+ return 0;
+
+ species = 0;
+
+ while(species < POKEMON_SLOTS_NUMBER - 1 && gUnknown_8251CB8[species] != var)
+ species++;
+
+ if(species == POKEMON_SLOTS_NUMBER - 1)
+ return 0;
+
+ return species + 1;
+}
+
+u16 NationalPokedexNumToSpecies(u16 nationalNum)
+{
+ u16 species;
+
+ if (!nationalNum)
+ return 0;
+
+ species = 0;
+
+ while (species < POKEMON_SLOTS_NUMBER - 1 && gUnknown_8251FEE[species] != nationalNum)
+ species++;
+
+ if (species == POKEMON_SLOTS_NUMBER - 1)
+ return 0;
+
+ return species + 1;
+}
+
+// NationalToKantoOrder?
+u16 sub_804324C(u16 nationalNum)
+{
+ u16 hoennNum;
+
+ if (!nationalNum)
+ return 0;
+
+ hoennNum = 0;
+
+ while (hoennNum < POKEMON_SLOTS_NUMBER - 1 && gUnknown_8252324[hoennNum] != nationalNum)
+ hoennNum++;
+
+ if (hoennNum == POKEMON_SLOTS_NUMBER - 1)
+ return 0;
+
+ return hoennNum + 1;
+}
+
+u16 SpeciesToNationalPokedexNum(u16 species)
+{
+ if (!species)
+ return 0;
+
+ return gUnknown_8251FEE[species - 1];
+}
+
+// these 2 functions are probably kanto and not hoenn
+// TODO: figure this out
+u16 SpeciesToHoennPokedexNum(u16 species)
+{
+ if (!species)
+ return 0;
+
+ return gUnknown_8251CB8[species - 1];
+}
+
+u16 HoennToNationalOrder(u16 hoennNum)
+{
+ if (!hoennNum)
+ return 0;
+
+ return gUnknown_8252324[hoennNum - 1];
+}
+
+u16 SpeciesToCryId(u16 species)
+{
+ if (species < SPECIES_OLD_UNOWN_B - 1)
+ return species;
+
+ if (species <= SPECIES_OLD_UNOWN_Z - 1)
+ return SPECIES_UNOWN - 1;
+
+ return gUnknown_82539D4[species - ((SPECIES_OLD_UNOWN_Z + 1) - 1)];
+}
+
+void sub_8043338(u16 species, u32 personality, u8 *dest)
+{
+ if (species == SPECIES_SPINDA
+ && dest != gMonSpritesGfxPtr->sprites[0]
+ && dest != gMonSpritesGfxPtr->sprites[2])
+ {
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ int j;
+ u8 x = gSpindaSpotGraphics[i].x + ((personality & 0x0F) - 8);
+ u8 y = gSpindaSpotGraphics[i].y + (((personality & 0xF0) >> 4) - 8);
+
+ for (j = 0; j < 16; j++)
+ {
+ int k;
+ s32 row = gSpindaSpotGraphics[i].image[j];
+
+ for (k = x; k < x + 16; k++)
+ {
+ u8 *val = dest + ((k / 8) * 32) + ((k % 8) / 2) + ((y >> 3) << 8) + ((y & 7) << 2);
+
+ if (row & 1)
+ {
+ if (k & 1)
+ {
+ if ((u8)((*val & 0xF0) - 0x10) <= 0x20)
+ *val += 0x40;
+ }
+ else
+ {
+ if ((u8)((*val & 0xF) - 0x01) <= 0x02)
+ *val += 0x04;
+ }
+ }
+
+ row >>= 1;
+ }
+
+ y++;
+ }
+
+ personality >>= 8;
+ }
+ }
+}
+
+void DrawSpindaSpots(u16 species, u32 personality, u8 *dest, u8 a4)
+{
+ if (species == SPECIES_SPINDA && a4)
+ {
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ int j;
+ u8 x = gSpindaSpotGraphics[i].x + ((personality & 0x0F) - 8);
+ u8 y = gSpindaSpotGraphics[i].y + (((personality & 0xF0) >> 4) - 8);
+
+ for (j = 0; j < 16; j++)
+ {
+ int k;
+ s32 row = gSpindaSpotGraphics[i].image[j];
+
+ for (k = x; k < x + 16; k++)
+ {
+ u8 *val = dest + ((k / 8) * 32) + ((k % 8) / 2) + ((y >> 3) << 8) + ((y & 7) << 2);
+
+ if (row & 1)
+ {
+ if (k & 1)
+ {
+ if ((u8)((*val & 0xF0) - 0x10) <= 0x20)
+ *val += 0x40;
+ }
+ else
+ {
+ if ((u8)((*val & 0xF) - 0x01) <= 0x02)
+ *val += 0x04;
+ }
+ }
+
+ row >>= 1;
+ }
+
+ y++;
+ }
+
+ personality >>= 8;
+ }
+ }
+}
+
+void EvolutionRenameMon(struct Pokemon *mon, u16 oldSpecies, u16 newSpecies)
+{
+ u8 language;
+ GetMonData(mon, MON_DATA_NICKNAME, gStringVar1);
+ language = GetMonData(mon, MON_DATA_LANGUAGE, &language);
+ if (language == GAME_LANGUAGE && !StringCompare(gSpeciesNames[oldSpecies], gStringVar1))
+ SetMonData(mon, MON_DATA_NICKNAME, gSpeciesNames[newSpecies]);
+}
+
+bool8 sub_80435E0(void)
+{
+ bool8 retVal = FALSE;
+ switch (gLinkPlayers[GetMultiplayerId()].id)
+ {
+ case 0:
+ case 3:
+ retVal = FALSE;
+ break;
+ case 1:
+ case 2:
+ retVal = TRUE;
+ break;
+ }
+ return retVal;
+}
+
+bool8 sub_8043620(u8 id)
+{
+ bool8 retVal = FALSE;
+ switch (gLinkPlayers[id].id)
+ {
+ case 0:
+ case 3:
+ retVal = FALSE;
+ break;
+ case 1:
+ case 2:
+ retVal = TRUE;
+ break;
+ }
+ return retVal;
+}
+
+s32 GetBankMultiplayerId(u16 a1)
+{
+ s32 id;
+ for (id = 0; id < MAX_LINK_PLAYERS; id++)
+ if (gLinkPlayers[id].id == a1)
+ break;
+ return id;
+}
+
+u8 sub_804367C(u16 trainer)
+{
+ return gTrainers[trainer].encounterMusic_gender & 0x7F;
+}
+
+u16 nature_stat_mod(u8 nature, u16 n, u8 statIndex)
+{
+ if (statIndex < 1 || statIndex > 5)
+ {
+ // should just be "return n", but it wouldn't match without this
+ u16 retVal = n;
+ retVal++;
+ retVal--;
+ return retVal;
+ }
+
+ switch (gNatureStatTable[nature][statIndex - 1])
+ {
+ case 1:
+ return (u16)(n * 110) / 100;
+ case -1:
+ return (u16)(n * 90) / 100;
+ }
+
+ return n;
+}
+
+// TODO: Move these to constants/trainers.h
+#define TRAINER_CLASS_ELITE_FOUR 0x54
+#define TRAINER_CLASS_LEADER 0x57
+#define TRAINER_CLASS_CHAMPION 0x5A
+
+// TODO: Move these too
+#define FRIENDSHIP_EVENT_LEAGUE_BATTLE 0x3
+#define FRIENDSHIP_EVENT_WALKING 0x5
+
+void AdjustFriendship(struct Pokemon *mon, u8 event)
+{
+ u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0);
+ u16 heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, 0);
+ u8 holdEffect;
+
+ if (heldItem == ITEM_ENIGMA_BERRY)
+ {
+ if (gMain.inBattle)
+ holdEffect = gEnigmaBerries[0].holdEffect;
+ else
+ holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect;
+ }
+ else
+ {
+ holdEffect = ItemId_GetHoldEffect(heldItem);
+ }
+
+ if (species && species != SPECIES_EGG)
+ {
+ u8 friendshipLevel = 0;
+ s16 friendship = GetMonData(mon, MON_DATA_FRIENDSHIP, 0);
+ if (friendship > 99)
+ friendshipLevel++;
+ if (friendship > 199)
+ friendshipLevel++;
+
+ if ((event != FRIENDSHIP_EVENT_WALKING || !(Random() & 1))
+ && (event != FRIENDSHIP_EVENT_LEAGUE_BATTLE
+ || ((gBattleTypeFlags & BATTLE_TYPE_TRAINER)
+ && (gTrainers[gTrainerBattleOpponent_A].trainerClass == TRAINER_CLASS_ELITE_FOUR
+ || gTrainers[gTrainerBattleOpponent_A].trainerClass == TRAINER_CLASS_LEADER
+ || gTrainers[gTrainerBattleOpponent_A].trainerClass == TRAINER_CLASS_CHAMPION))))
+ {
+ s8 delta = sFriendshipEventDeltas[event][friendshipLevel];
+ if (delta > 0 && holdEffect == HOLD_EFFECT_HAPPINESS_UP)
+ delta = (150 * delta) / 100;
+
+ friendship += delta;
+ if (delta > 0)
+ {
+ if (GetMonData(mon, MON_DATA_POKEBALL, 0) == ITEM_LUXURY_BALL)
+ friendship++;
+ if (GetMonData(mon, MON_DATA_MET_LOCATION, 0) == sav1_map_get_name())
+ friendship++;
+ }
+
+ if (friendship < 0)
+ friendship = 0;
+ if (friendship > 255)
+ friendship = 255;
+
+ SetMonData(mon, MON_DATA_FRIENDSHIP, &friendship);
+ }
+ }
+}
+
+void MonGainEVs(struct Pokemon *mon, u16 defeatedSpecies)
+{
+ u8 evs[NUM_STATS];
+ u16 evIncrease = 0;
+ u16 totalEVs = 0;
+ u16 heldItem;
+ u8 holdEffect;
+ int i;
+
+ for (i = 0; i < NUM_STATS; i++)
+ {
+ evs[i] = GetMonData(mon, MON_DATA_HP_EV + i, 0);
+ totalEVs += evs[i];
+ }
+
+ for (i = 0; i < NUM_STATS; i++)
+ {
+ u8 hasHadPokerus;
+ int multiplier;
+
+ if (totalEVs >= MAX_TOTAL_EVS)
+ break;
+
+ hasHadPokerus = CheckPartyHasHadPokerus(mon, 0);
+
+ if (hasHadPokerus)
+ multiplier = 2;
+ else
+ multiplier = 1;
+
+ switch (i)
+ {
+ case 0:
+ evIncrease = gBaseStats[defeatedSpecies].evYield_HP * multiplier;
+ break;
+ case 1:
+ evIncrease = gBaseStats[defeatedSpecies].evYield_Attack * multiplier;
+ break;
+ case 2:
+ evIncrease = gBaseStats[defeatedSpecies].evYield_Defense * multiplier;
+ break;
+ case 3:
+ evIncrease = gBaseStats[defeatedSpecies].evYield_Speed * multiplier;
+ break;
+ case 4:
+ evIncrease = gBaseStats[defeatedSpecies].evYield_SpAttack * multiplier;
+ break;
+ case 5:
+ evIncrease = gBaseStats[defeatedSpecies].evYield_SpDefense * multiplier;
+ break;
+ }
+
+ heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, 0);
+
+ if (heldItem == ITEM_ENIGMA_BERRY)
+ {
+ if (gMain.inBattle)
+ holdEffect = gEnigmaBerries[0].holdEffect;
+ else
+ holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect;
+ }
+ else
+ {
+ holdEffect = ItemId_GetHoldEffect(heldItem);
+ }
+
+ if (holdEffect == HOLD_EFFECT_MACHO_BRACE)
+ evIncrease *= 2;
+
+ if (totalEVs + (s16)evIncrease > MAX_TOTAL_EVS)
+ evIncrease = ((s16)evIncrease + MAX_TOTAL_EVS) - (totalEVs + evIncrease);
+
+ if (evs[i] + (s16)evIncrease > 255)
+ {
+ int val1 = (s16)evIncrease + 255;
+ int val2 = evs[i] + evIncrease;
+ evIncrease = val1 - val2;
+ }
+
+ evs[i] += evIncrease;
+ totalEVs += evIncrease;
+ SetMonData(mon, MON_DATA_HP_EV + i, &evs[i]);
+ }
+}
+
+u16 GetMonEVCount(struct Pokemon *mon)
+{
+ int i;
+ u16 count = 0;
+
+ for (i = 0; i < NUM_STATS; i++)
+ count += GetMonData(mon, MON_DATA_HP_EV + i, 0);
+
+ return count;
+}
+
+void sub_8043A68(void)
+{
+ u8 foo[4]; // huh?
+}
+
+u8 CheckPartyPokerus(struct Pokemon *party, u8 selection)
+{
+ u8 retVal;
+
+ int partyIndex = 0;
+ unsigned curBit = 1;
+ retVal = 0;
+
+ if (selection)
+ {
+ do
+ {
+ if ((selection & 1) && (GetMonData(&party[partyIndex], MON_DATA_POKERUS, 0) & 0xF))
+ retVal |= curBit;
+ partyIndex++;
+ curBit <<= 1;
+ selection >>= 1;
+ }
+ while (selection);
+ }
+ else if (GetMonData(&party[0], MON_DATA_POKERUS, 0) & 0xF)
+ {
+ retVal = 1;
+ }
+
+ return retVal;
+}
+
+u8 CheckPartyHasHadPokerus(struct Pokemon *party, u8 selection)
+{
+ u8 retVal;
+
+ int partyIndex = 0;
+ unsigned curBit = 1;
+ retVal = 0;
+
+ if (selection)
+ {
+ do
+ {
+ if ((selection & 1) && GetMonData(&party[partyIndex], MON_DATA_POKERUS, 0))
+ retVal |= curBit;
+ partyIndex++;
+ curBit <<= 1;
+ selection >>= 1;
+ }
+ while (selection);
+ }
+ else if (GetMonData(&party[0], MON_DATA_POKERUS, 0))
+ {
+ retVal = 1;
+ }
+
+ return retVal;
+}
+
+void sub_8043B38(void)
+{
+ u8 foo[4]; // huh?
+}
+
+void sub_8043B40(void)
+{
+ u8 foo[4]; // huh?
+}
+
+void sub_8043B48(struct Pokemon *mon, int species, u8 unused, u32 data)
+{
+ if (data > gExperienceTables[gBaseStats[species].growthRate][100])
+ {
+ data = gExperienceTables[gBaseStats[species].growthRate][100];
+ SetMonData(mon, MON_DATA_EXP, &data);
+ }
+}
+
+bool32 sub_8043B90(struct Pokemon *mon)
+{
+ u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL);
+ u8 level = GetMonData(mon, MON_DATA_LEVEL, NULL);
+ u8 newLevel = level + 1;
+ u32 exp = GetMonData(mon, MON_DATA_EXP, NULL);
+
+ if(level < 100)
+ {
+ if(exp > gExperienceTables[gBaseStats[species].growthRate][newLevel])
+ {
+ SetMonData(mon, MON_DATA_LEVEL, &newLevel);
+ sub_8043B48(mon, species, newLevel, exp);
+ return TRUE;
+ }
+ else
+ return FALSE;
+ }
+ else
+ {
+ sub_8043B48(mon, species, level, exp);
+ return FALSE;
+ }
+}
+
+u32 CanMonLearnTMHM(struct Pokemon *mon, u8 tm)
+{
+ u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0);
+ if (species == SPECIES_EGG)
+ {
+ return 0;
+ }
+ else if (tm < 32)
+ {
+ u32 mask = 1 << tm;
+ return gTMHMLearnsets[species][0] & mask;
+ }
+ else
+ {
+ u32 mask = 1 << (tm - 32);
+ return gTMHMLearnsets[species][1] & mask;
+ }
+}
+
+u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves)
+{
+ u16 learnedMoves[4];
+ u8 numMoves = 0;
+ u16 species = GetMonData(mon, MON_DATA_SPECIES, 0);
+ u8 level = GetMonData(mon, MON_DATA_LEVEL, 0);
+ int i, j, k;
+
+ for (i = 0; i < 4; i++)
+ learnedMoves[i] = GetMonData(mon, MON_DATA_MOVE1 + i, 0);
+
+ for (i = 0; i < 20; i++)
+ {
+ u16 moveLevel;
+
+ if (gLevelUpLearnsets[species][i] == 0xFFFF)
+ break;
+
+ moveLevel = gLevelUpLearnsets[species][i] & 0xFE00;
+
+ if (moveLevel <= (level << 9))
+ {
+ for (j = 0; j < 4 && learnedMoves[j] != (gLevelUpLearnsets[species][i] & 0x1FF); j++)
+ ;
+
+ if (j == 4)
+ {
+ for (k = 0; k < numMoves && moves[k] != (gLevelUpLearnsets[species][i] & 0x1FF); k++)
+ ;
+
+ if (k == numMoves)
+ moves[numMoves++] = gLevelUpLearnsets[species][i] & 0x1FF;
+ }
+ }
+ }
+
+ return numMoves;
+}
+
+u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves)
+{
+ u8 numMoves = 0;
+ int i;
+
+ for (i = 0; i < 20 && gLevelUpLearnsets[species][i] != 0xFFFF; i++)
+ moves[numMoves++] = gLevelUpLearnsets[species][i] & 0x1FF;
+
+ return numMoves;
+}
+
+u8 GetNumberOfRelearnableMoves(struct Pokemon *mon)
+{
+ u16 learnedMoves[4];
+ u16 moves[20];
+ u8 numMoves = 0;
+ u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0);
+ u8 level = GetMonData(mon, MON_DATA_LEVEL, 0);
+ int i, j, k;
+
+ if (species == SPECIES_EGG)
+ return 0;
+
+ for (i = 0; i < 4; i++)
+ learnedMoves[i] = GetMonData(mon, MON_DATA_MOVE1 + i, 0);
+
+ for (i = 0; i < 20; i++)
+ {
+ u16 moveLevel;
+
+ if (gLevelUpLearnsets[species][i] == 0xFFFF)
+ break;
+
+ moveLevel = gLevelUpLearnsets[species][i] & 0xFE00;
+
+ if (moveLevel <= (level << 9))
+ {
+ for (j = 0; j < 4 && learnedMoves[j] != (gLevelUpLearnsets[species][i] & 0x1FF); j++)
+ ;
+
+ if (j == 4)
+ {
+ for (k = 0; k < numMoves && moves[k] != (gLevelUpLearnsets[species][i] & 0x1FF); k++)
+ ;
+
+ if (k == numMoves)
+ moves[numMoves++] = gLevelUpLearnsets[species][i] & 0x1FF;
+ }
+ }
+ }
+
+ return numMoves;
+}
+
+// SpeciesToPokedexNum?
+u16 sub_8043F90(u16 species)
+{
+ species = SpeciesToNationalPokedexNum(species);
+
+ if (!sub_806E25C() && species > 151)
+ return 0xFFFF;
+ return species;
+}
+
+void ClearBattleMonForms(void)
+{
+ int i;
+ for(i = 0; i < 4; i++)
+ gBattleMonForms[i] = 0;
+}
+
+u16 GetMUS_ForBattle(void)
+{
+ if(gBattleTypeFlags & 0x1000)
+ return 0x12A;
+ if(gBattleTypeFlags & 0x4000)
+ return 0x10A;
+ if(gBattleTypeFlags & 0x2)
+ return 0x10A;
+ if(gBattleTypeFlags & 0x8)
+ {
+ switch (gTrainers[gTrainerBattleOpponent_A].trainerClass)
+ {
+ case 0x5A:
+ return 0x12B;
+ case 0x54:
+ case 0x57:
+ return 0x128;
+ case 0x53:
+ case 0x55:
+ case 0x56:
+ case 0x58:
+ case 0x59:
+ default:
+ return 0x129;
+ }
+ }
+ return 0x12A;
+}
+
+void PlayBattleBGM(void)
+{
+ ResetMapMusic();
+ m4aMPlayAllStop();
+ PlayBGM(GetMUS_ForBattle());
+}
+
+void PlayMapChosenOrBattleBGM(u16 songId)
+{
+ ResetMapMusic();
+ m4aMPlayAllStop();
+ if (songId)
+ PlayNewMapMusic(songId);
+ else
+ PlayNewMapMusic(GetMUS_ForBattle());
+}
+
+const u8 *GetMonFrontSpritePal(struct Pokemon *mon)
+{
+ u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0);
+ u32 otId = GetMonData(mon, MON_DATA_OT_ID, 0);
+ u32 personality = GetMonData(mon, MON_DATA_PERSONALITY, 0);
+ return GetFrontSpritePalFromSpeciesAndPersonality(species, otId, personality);
+}
+
+const u8 *GetFrontSpritePalFromSpeciesAndPersonality(u16 species, u32 otId, u32 personality)
+{
+ u32 shinyValue;
+
+ if (species > SPECIES_EGG)
+ return gMonPaletteTable[0].data;
+
+ shinyValue = HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality);
+ if (shinyValue < 8)
+ return gMonShinyPaletteTable[species].data;
+ else
+ return gMonPaletteTable[species].data;
+}
+
+const struct CompressedSpritePalette *GetMonSpritePalStruct(struct Pokemon *mon)
+{
+ u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0);
+ u32 otId = GetMonData(mon, MON_DATA_OT_ID, 0);
+ u32 personality = GetMonData(mon, MON_DATA_PERSONALITY, 0);
+ return GetMonSpritePalStructFromOtIdPersonality(species, otId, personality);
+}
+
+const struct CompressedSpritePalette *GetMonSpritePalStructFromOtIdPersonality(u16 species, u32 otId , u32 personality)
+{
+ u32 shinyValue;
+
+ shinyValue = HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality);
+ if (shinyValue < 8)
+ return &gMonShinyPaletteTable[species];
+ else
+ return &gMonPaletteTable[species];
+}
+
+bool32 IsHMMove2(u16 move)
+{
+ int i = 0;
+ while (sHMMoves[i] != 0xFFFF)
+ {
+ if (sHMMoves[i++] == move)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+bool8 IsPokeSpriteNotFlipped(u16 species)
+{
+ return gBaseStats[species].noFlip;
+}
+
+s8 GetMonFlavorRelation(struct Pokemon *mon, u8 flavor)
+{
+ u8 nature = GetNature(mon);
+ return gPokeblockFlavorCompatibilityTable[nature * 5 + flavor];
+}
+
+s8 GetFlavorRelationByPersonality(u32 personality, u8 flavor)
+{
+ u8 nature = GetNatureFromPersonality(personality);
+ return gPokeblockFlavorCompatibilityTable[nature * 5 + flavor];
+}
+
+bool8 IsTradedMon(struct Pokemon *mon)
+{
+ u8 otName[7 + 1]; // change PLAYER_NAME_LENGTH to 7
+ u32 otId;
+ GetMonData(mon, MON_DATA_OT_NAME, otName);
+ otId = GetMonData(mon, MON_DATA_OT_ID, 0);
+ return IsOtherTrainer(otId, otName);
+}
+
+bool8 IsOtherTrainer(u32 otId, u8 *otName)
+{
+ if (otId ==
+ (gSaveBlock2Ptr->playerTrainerId[0]
+ | (gSaveBlock2Ptr->playerTrainerId[1] << 8)
+ | (gSaveBlock2Ptr->playerTrainerId[2] << 16)
+ | (gSaveBlock2Ptr->playerTrainerId[3] << 24)))
+ {
+ int i;
+
+ for (i = 0; otName[i] != EOS; i++)
+ if (otName[i] != gSaveBlock2Ptr->playerName[i])
+ return TRUE;
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+void MonRestorePP(struct Pokemon *mon)
+{
+ BoxMonRestorePP(&mon->box);
+}
+
+void BoxMonRestorePP(struct BoxPokemon *boxMon)
+{
+ int i;
+
+ for (i = 0; i < 4; i++)
+ {
+ if (GetBoxMonData(boxMon, MON_DATA_MOVE1 + i, 0))
+ {
+ u16 move = GetBoxMonData(boxMon, MON_DATA_MOVE1 + i, 0);
+ u16 bonus = GetBoxMonData(boxMon, MON_DATA_PP_BONUSES, 0);
+ u8 pp = CalculatePPWithBonus(move, bonus, i);
+ SetBoxMonData(boxMon, MON_DATA_PP1 + i, &pp);
+ }
+ }
+}
+
+// SetMonPreventsSwitchingString
+void sub_8044348(void)
+{
+#ifdef NONMATCHING
+ gLastUsedAbility = gBattleStruct -> abilityPreventingSwitchout; // fixed from the original
+#else
+ gLastUsedAbility = ((u8 *) gBattleStruct)[0xac]; // huh? why is this wrong?
+#endif
+
+ gBattleTextBuff1[0] = B_BUFF_PLACEHOLDER_BEGIN;
+ gBattleTextBuff1[1] = B_BUFF_MON_NICK_WITH_PREFIX;
+ gBattleTextBuff1[2] = gBattleStruct->battlerPreventingSwitchout;
+ gBattleTextBuff1[4] = B_BUFF_EOS;
+
+ if (GetBattlerSide(gBattleStruct->battlerPreventingSwitchout) == B_SIDE_PLAYER)
+ gBattleTextBuff1[3] = pokemon_order_func(gBattlerPartyIndexes[gBattleStruct->battlerPreventingSwitchout]);
+ else
+ gBattleTextBuff1[3] = gBattlerPartyIndexes[gBattleStruct->battlerPreventingSwitchout];
+
+ PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff2, gBattlerInMenuId, pokemon_order_func(gBattlerPartyIndexes[gBattlerInMenuId]))
+
+ BattleStringExpandPlaceholders(gText_PkmnsXPreventsSwitching, gStringVar4);
+}
+
+void SetWildMonHeldItem(void)
+{
+ // TODO: Replace 0x00010000 with the right flag that isnt BATTLE_TYPE_DOME
+ if (!(gBattleTypeFlags & (0x00010000 | BATTLE_TYPE_LEGENDARY | BATTLE_TYPE_TRAINER)))
+ {
+ u16 rnd = Random() % 100;
+ u16 species = GetMonData(&gEnemyParty[0], MON_DATA_SPECIES, 0);
+ if (gBaseStats[species].item1 == gBaseStats[species].item2)
+ {
+ SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].item1);
+ return;
+ }
+
+ if (rnd > 44)
+ {
+ if (rnd <= 94)
+ SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].item1);
+ else
+ SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].item2);
+ }
+ }
+}
+
+bool8 IsMonShiny(struct Pokemon *mon)
+{
+ u32 otId = GetMonData(mon, MON_DATA_OT_ID, 0);
+ u32 personality = GetMonData(mon, MON_DATA_PERSONALITY, 0);
+ return IsShinyOtIdPersonality(otId, personality);
+}
+
+bool8 IsShinyOtIdPersonality(u32 otId, u32 personality)
+{
+ bool8 retVal = FALSE;
+ u32 shinyValue = HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality);
+ if (shinyValue < 8)
+ retVal = TRUE;
+ return retVal;
+}
+
+u8 *sub_80444C4(void)
+{
+ u8 id = GetMultiplayerId();
+ return gLinkPlayers[GetBankMultiplayerId(gLinkPlayers[id].id ^ 2)].name;
+}
diff --git a/src/save.c b/src/save.c
new file mode 100644
index 000000000..28f6a2896
--- /dev/null
+++ b/src/save.c
@@ -0,0 +1,919 @@
+#include "global.h"
+#include "save.h"
+#include "decompress.h"
+#include "main.h"
+#include "overworld.h"
+#include "load_save.h"
+#include "task.h"
+#include "link.h"
+#include "gba/flash_internal.h"
+
+#define FILE_SIGNATURE 0x08012025 // signature value to determine if a sector is in use
+
+#define TOTAL_FLASH_SECTORS 32
+
+// Divide save blocks into individual chunks to be written to flash sectors
+
+// Each 4 KiB flash sector contains 3968 bytes of actual data followed by a 128 byte footer
+#define SECTOR_DATA_SIZE 3968
+#define SECTOR_FOOTER_SIZE 128
+
+/*
+ * Sector Layout:
+ *
+ * Sectors 0 - 13: Save Slot 1
+ * Sectors 14 - 27: Save Slot 2
+ * Sectors 28 - 29: Hall of Fame
+ * Sector 30: e-Reader/Mystery Gift Stuff (note: e-Reader is deprecated in Emerald US)
+ * Sector 31: Recorded Battle
+ *
+ * There are two save slots for saving the player's game data. We alternate between
+ * them each time the game is saved, so that if the current save slot is corrupt,
+ * we can load the previous one. We also rotate the sectors in each save slot
+ * so that the same data is not always being written to the same sector. This
+ * might be done to reduce wear on the flash memory, but I'm not sure, since all
+ * 14 sectors get written anyway.
+ */
+
+// (u8 *)structure was removed from the first statement of the macro in Emerald
+// and Fire Red/Leaf Green. This is because malloc is used to allocate addresses
+// so storing the raw addresses should not be done in the offsets information.
+#define SAVEBLOCK_CHUNK(structure, chunkNum) \
+{ \
+ chunkNum * SECTOR_DATA_SIZE, \
+ min(sizeof(structure) - chunkNum * SECTOR_DATA_SIZE, SECTOR_DATA_SIZE) \
+} \
+
+// TODO: use gSaveblock2, gSaveblock1, gPokemonStorage instead of structs
+// Will be done when load_save is decompiled.
+const struct SaveSectionOffsets gSaveSectionOffsets[] =
+{
+ SAVEBLOCK_CHUNK(struct SaveBlock2, 0),
+
+ SAVEBLOCK_CHUNK(struct SaveBlock1, 0),
+ SAVEBLOCK_CHUNK(struct SaveBlock1, 1),
+ SAVEBLOCK_CHUNK(struct SaveBlock1, 2),
+ SAVEBLOCK_CHUNK(struct SaveBlock1, 3),
+
+ SAVEBLOCK_CHUNK(struct PokemonStorage, 0),
+ SAVEBLOCK_CHUNK(struct PokemonStorage, 1),
+ SAVEBLOCK_CHUNK(struct PokemonStorage, 2),
+ SAVEBLOCK_CHUNK(struct PokemonStorage, 3),
+ SAVEBLOCK_CHUNK(struct PokemonStorage, 4),
+ SAVEBLOCK_CHUNK(struct PokemonStorage, 5),
+ SAVEBLOCK_CHUNK(struct PokemonStorage, 6),
+ SAVEBLOCK_CHUNK(struct PokemonStorage, 7),
+ SAVEBLOCK_CHUNK(struct PokemonStorage, 8)
+};
+
+extern void DoSaveFailedScreen(u8 saveType); // save_failed_screen
+extern void sub_800AB9C(void); // link
+extern bool8 sub_800A4BC(void); // link
+extern void sub_80590D8(void); // fieldmap
+extern void sub_804C1C0(void); // load_save
+extern void sav2_gender2_inplace_and_xFE(void); // load_save
+
+// Sector num to begin writing save data. Sectors are rotated each time the game is saved. (possibly to avoid wear on flash memory?)
+u16 gFirstSaveSector;
+u32 gPrevSaveCounter;
+u16 gLastKnownGoodSector;
+u32 gDamagedSaveSectors;
+u32 gSaveCounter;
+struct SaveSection *gFastSaveSection; // the pointer is in fast IWRAM but may sometimes point to the slower EWRAM.
+u16 gUnknown_3005398;
+u16 gSaveUnusedVar;
+u16 gSaveFileStatus;
+void (*gGameContinueCallback)(void);
+struct SaveBlockChunk gRamSaveSectionLocations[0xE];
+u16 gUnknown_3005420;
+
+EWRAM_DATA struct SaveSection gSaveDataBuffer = {0};
+EWRAM_DATA u32 gSaveUnusedVar2 = 0;
+
+void ClearSaveData(void)
+{
+ u16 i;
+
+ for (i = 0; i < NUM_SECTORS; i++)
+ EraseFlashSector(i);
+}
+
+void Save_ResetSaveCounters(void)
+{
+ gSaveCounter = 0;
+ gFirstSaveSector = 0;
+ gDamagedSaveSectors = 0;
+}
+
+bool32 SetSectorDamagedStatus(u8 op, u8 sectorNum)
+{
+ bool32 retVal = FALSE;
+
+ switch (op)
+ {
+ case ENABLE:
+ gDamagedSaveSectors |= (1 << sectorNum);
+ break;
+ case DISABLE:
+ gDamagedSaveSectors &= ~(1 << sectorNum);
+ break;
+ case CHECK: // unused
+ if (gDamagedSaveSectors & (1 << sectorNum))
+ retVal = TRUE;
+ break;
+ }
+
+ return retVal;
+}
+
+// If chunkId is 0xFFFF, this function will write all of the chunks pointed to by 'chunks'.
+// Otherwise, it will write a single chunk with the given 'chunkId'.
+u8 save_write_to_flash(u16 chunkId, const struct SaveBlockChunk *chunks)
+{
+ u32 retVal;
+ u16 i;
+
+ gFastSaveSection = &gSaveDataBuffer;
+
+ if (chunkId != 0xFFFF) // write single chunk
+ {
+ retVal = HandleWriteSector(chunkId, chunks);
+ }
+ else // write all chunks
+ {
+ gLastKnownGoodSector = gFirstSaveSector; // backup the current written sector before attempting to write.
+ gPrevSaveCounter = gSaveCounter;
+ gFirstSaveSector++;
+ gFirstSaveSector %= NUM_SECTORS_PER_SAVE_SLOT; // array count save sector locations
+ gSaveCounter++;
+ retVal = SAVE_STATUS_OK;
+
+ for (i = 0; i < NUM_SECTORS_PER_SAVE_SLOT; i++)
+ HandleWriteSector(i, chunks);
+
+ // Check for any bad sectors
+ if (gDamagedSaveSectors != 0) // skip the damaged sector.
+ {
+ retVal = SAVE_STATUS_ERROR;
+ gFirstSaveSector = gLastKnownGoodSector;
+ gSaveCounter = gPrevSaveCounter;
+ }
+ }
+
+ return retVal;
+}
+
+u8 HandleWriteSector(u16 chunkId, const struct SaveBlockChunk *chunks)
+{
+ u16 i;
+ u16 sectorNum;
+ u8 *chunkData;
+ u16 chunkSize;
+
+ // select sector number
+ sectorNum = chunkId + gFirstSaveSector;
+ sectorNum %= NUM_SECTORS_PER_SAVE_SLOT;
+ // select save slot
+ sectorNum += NUM_SECTORS_PER_SAVE_SLOT * (gSaveCounter % 2);
+
+ chunkData = chunks[chunkId].data;
+ chunkSize = chunks[chunkId].size;
+
+ // clear save section.
+ for (i = 0; i < sizeof(struct SaveSection); i++)
+ ((char *)gFastSaveSection)[i] = 0;
+
+ gFastSaveSection->id = chunkId;
+ gFastSaveSection->signature = FILE_SIGNATURE;
+ gFastSaveSection->counter = gSaveCounter;
+
+ for (i = 0; i < chunkSize; i++)
+ gFastSaveSection->data[i] = chunkData[i];
+
+ gFastSaveSection->checksum = CalculateChecksum(chunkData, chunkSize);
+ return TryWriteSector(sectorNum, gFastSaveSection->data);
+}
+
+u8 HandleWriteSectorNBytes(u8 sector, u8 *data, u16 size)
+{
+ u16 i;
+ struct SaveSection *section = &gSaveDataBuffer;
+
+ for (i = 0; i < sizeof(struct SaveSection); i++)
+ ((char *)section)[i] = 0;
+
+ section->signature = FILE_SIGNATURE;
+
+ for (i = 0; i < size; i++)
+ section->data[i] = data[i];
+
+ section->id = CalculateChecksum(data, size); // though this appears to be incorrect, it might be some sector checksum instead of a whole save checksum and only appears to be relevent to HOF data, if used.
+ return TryWriteSector(sector, section->data);
+}
+
+u8 TryWriteSector(u8 sectorNum, u8 *data)
+{
+ if (ProgramFlashSectorAndVerify(sectorNum, data) != 0) // is damaged?
+ {
+ SetSectorDamagedStatus(ENABLE, sectorNum); // set damaged sector bits.
+ return SAVE_STATUS_ERROR;
+ }
+ else
+ {
+ SetSectorDamagedStatus(DISABLE, sectorNum); // unset damaged sector bits. it's safe now.
+ return SAVE_STATUS_OK;
+ }
+}
+
+u32 RestoreSaveBackupVarsAndIncrement(const struct SaveBlockChunk *chunk) // chunk is unused
+{
+ gFastSaveSection = &gSaveDataBuffer;
+ gLastKnownGoodSector = gFirstSaveSector;
+ gPrevSaveCounter = gSaveCounter;
+ gFirstSaveSector++;
+ gFirstSaveSector %= NUM_SECTORS_PER_SAVE_SLOT;
+ gSaveCounter++;
+ gUnknown_3005398 = 0;
+ gDamagedSaveSectors = 0;
+ return 0;
+}
+
+u32 RestoreSaveBackupVars(const struct SaveBlockChunk *chunk) // chunk is unused
+{
+ gFastSaveSection = &gSaveDataBuffer;
+ gLastKnownGoodSector = gFirstSaveSector;
+ gPrevSaveCounter = gSaveCounter;
+ gUnknown_3005398 = 0;
+ gDamagedSaveSectors = 0;
+ return 0;
+}
+
+u8 sub_80D9AA4(u16 a1, const struct SaveBlockChunk *chunk)
+{
+ u8 retVal;
+
+ if (gUnknown_3005398 < a1 - 1)
+ {
+ retVal = SAVE_STATUS_OK;
+ HandleWriteSector(gUnknown_3005398, chunk);
+ gUnknown_3005398++;
+ if (gDamagedSaveSectors)
+ {
+ retVal = SAVE_STATUS_ERROR;
+ gFirstSaveSector = gLastKnownGoodSector;
+ gSaveCounter = gPrevSaveCounter;
+ }
+ }
+ else
+ {
+ retVal = SAVE_STATUS_ERROR;
+ }
+
+ return retVal;
+}
+
+u8 sub_80D9B04(u16 a1, const struct SaveBlockChunk *chunk)
+{
+ u8 retVal = SAVE_STATUS_OK;
+
+ ClearSaveData_2(a1 - 1, chunk);
+
+ if (gDamagedSaveSectors)
+ {
+ retVal = SAVE_STATUS_ERROR;
+ gFirstSaveSector = gLastKnownGoodSector;
+ gSaveCounter = gPrevSaveCounter;
+ }
+ return retVal;
+}
+
+u8 ClearSaveData_2(u16 chunkId, const struct SaveBlockChunk *chunks)
+{
+ u16 i;
+ u16 sector;
+ u8 *data;
+ u16 size;
+ u8 status;
+
+ // select sector number
+ sector = chunkId + gFirstSaveSector;
+ sector %= NUM_SECTORS_PER_SAVE_SLOT;
+ // select save slot
+ sector += NUM_SECTORS_PER_SAVE_SLOT * (gSaveCounter % 2);
+
+ data = chunks[chunkId].data;
+ size = chunks[chunkId].size;
+
+ // clear temp save section.
+ for (i = 0; i < sizeof(struct SaveSection); i++)
+ ((char *)gFastSaveSection)[i] = 0;
+
+ gFastSaveSection->id = chunkId;
+ gFastSaveSection->signature = FILE_SIGNATURE;
+ gFastSaveSection->counter = gSaveCounter;
+
+ // set temp section's data.
+ for (i = 0; i < size; i++)
+ gFastSaveSection->data[i] = data[i];
+
+ // calculate checksum.
+ gFastSaveSection->checksum = CalculateChecksum(data, size);
+
+ EraseFlashSector(sector);
+
+ status = SAVE_STATUS_OK;
+
+ for (i = 0; i < sizeof(struct UnkSaveSection); i++)
+ {
+ if (ProgramFlashByte(sector, i, gFastSaveSection->data[i]))
+ {
+ status = SAVE_STATUS_ERROR;
+ break;
+ }
+ }
+
+ if (status == SAVE_STATUS_ERROR)
+ {
+ SetSectorDamagedStatus(ENABLE, sector);
+ return SAVE_STATUS_ERROR;
+ }
+ else
+ {
+ status = SAVE_STATUS_OK;
+
+ for (i = 0; i < 7; i++)
+ {
+ if (ProgramFlashByte(sector, 0xFF9 + i, ((u8 *)gFastSaveSection)[0xFF9 + i]))
+ {
+ status = SAVE_STATUS_ERROR;
+ break;
+ }
+ }
+
+ if (status == SAVE_STATUS_ERROR)
+ {
+ SetSectorDamagedStatus(ENABLE, sector);
+ return SAVE_STATUS_ERROR;
+ }
+ else
+ {
+ SetSectorDamagedStatus(DISABLE, sector);
+ return SAVE_STATUS_OK;
+ }
+ }
+}
+
+u8 sav12_xor_get(u16 a1, const struct SaveBlockChunk *chunk)
+{
+ u16 sector;
+
+ // select sector number
+ sector = a1 + gFirstSaveSector - 1;
+ sector %= NUM_SECTORS_PER_SAVE_SLOT;
+ // select save slot
+ sector += NUM_SECTORS_PER_SAVE_SLOT * (gSaveCounter % 2);
+
+ if (ProgramFlashByte(sector, sizeof(struct UnkSaveSection), ((u8 *)gFastSaveSection)[sizeof(struct UnkSaveSection)]))
+ {
+ // sector is damaged, so enable the bit in gDamagedSaveSectors and restore the last written sector and save counter.
+ SetSectorDamagedStatus(ENABLE, sector);
+ gFirstSaveSector = gLastKnownGoodSector;
+ gSaveCounter = gPrevSaveCounter;
+ return SAVE_STATUS_ERROR;
+ }
+ else
+ {
+ SetSectorDamagedStatus(DISABLE, sector);
+ return SAVE_STATUS_OK;
+ }
+}
+
+u8 sub_80D9D88(u16 a1, const struct SaveBlockChunk *chunk)
+{
+ u16 sector;
+
+ sector = a1 + gFirstSaveSector - 1;
+ sector %= NUM_SECTORS_PER_SAVE_SLOT;
+ sector += NUM_SECTORS_PER_SAVE_SLOT * (gSaveCounter % 2);
+
+ if (ProgramFlashByte(sector, sizeof(struct UnkSaveSection), 0x25))
+ {
+ // sector is damaged, so enable the bit in gDamagedSaveSectors and restore the last written sector and save counter.
+ SetSectorDamagedStatus(ENABLE, sector);
+ gFirstSaveSector = gLastKnownGoodSector;
+ gSaveCounter = gPrevSaveCounter;
+ return SAVE_STATUS_ERROR;
+ }
+ else
+ {
+ SetSectorDamagedStatus(DISABLE, sector);
+ return SAVE_STATUS_OK;
+ }
+}
+
+u8 sub_80D9E14(u16 a1, const struct SaveBlockChunk *chunk)
+{
+ u8 retVal;
+ gFastSaveSection = &gSaveDataBuffer;
+ if (a1 != 0xFFFF)
+ {
+ retVal = SAVE_STATUS_ERROR;
+ }
+ else
+ {
+ retVal = GetSaveValidStatus(chunk);
+ sub_80D9E54(0xFFFF, chunk);
+ }
+
+ return retVal;
+}
+
+u8 sub_80D9E54(u16 a1, const struct SaveBlockChunk *chunks)
+{
+ u16 i;
+ u16 checksum;
+ u16 sector = NUM_SECTORS_PER_SAVE_SLOT * (gSaveCounter % 2);
+ u16 id;
+
+ for (i = 0; i < NUM_SECTORS_PER_SAVE_SLOT; i++)
+ {
+ DoReadFlashWholeSection(i + sector, gFastSaveSection);
+ id = gFastSaveSection->id;
+ if (id == 0)
+ gFirstSaveSector = i;
+ checksum = CalculateChecksum(gFastSaveSection->data, chunks[id].size);
+ if (gFastSaveSection->signature == FILE_SIGNATURE
+ && gFastSaveSection->checksum == checksum)
+ {
+ u16 j;
+ for (j = 0; j < chunks[id].size; j++)
+ chunks[id].data[j] = gFastSaveSection->data[j];
+ }
+ }
+
+ return 1;
+}
+
+u8 GetSaveValidStatus(const struct SaveBlockChunk *chunks)
+{
+ u16 sector;
+ bool8 signatureValid;
+ u16 checksum;
+ u32 slot1saveCounter = 0;
+ u32 slot2saveCounter = 0;
+ u8 slot1Status;
+ u8 slot2Status;
+ u32 validSectors;
+ const u32 ALL_SECTORS = (1 << NUM_SECTORS_PER_SAVE_SLOT) - 1; // bitmask of all saveblock sectors
+
+ // check save slot 1.
+ validSectors = 0;
+ signatureValid = FALSE;
+ for (sector = 0; sector < NUM_SECTORS_PER_SAVE_SLOT; sector++)
+ {
+ DoReadFlashWholeSection(sector, gFastSaveSection);
+ if (gFastSaveSection->signature == FILE_SIGNATURE)
+ {
+ signatureValid = TRUE;
+ checksum = CalculateChecksum(gFastSaveSection->data, chunks[gFastSaveSection->id].size);
+ if (gFastSaveSection->checksum == checksum)
+ {
+ slot1saveCounter = gFastSaveSection->counter;
+ validSectors |= 1 << gFastSaveSection->id;
+ }
+ }
+ }
+
+ if (signatureValid)
+ {
+ if (validSectors == ALL_SECTORS)
+ slot1Status = SAVE_STATUS_OK;
+ else
+ slot1Status = SAVE_STATUS_ERROR;
+ }
+ else
+ {
+ slot1Status = SAVE_STATUS_EMPTY;
+ }
+
+ // check save slot 2.
+ validSectors = 0;
+ signatureValid = FALSE;
+ for (sector = 0; sector < NUM_SECTORS_PER_SAVE_SLOT; sector++)
+ {
+ DoReadFlashWholeSection(NUM_SECTORS_PER_SAVE_SLOT + sector, gFastSaveSection);
+ if (gFastSaveSection->signature == FILE_SIGNATURE)
+ {
+ signatureValid = TRUE;
+ checksum = CalculateChecksum(gFastSaveSection->data, chunks[gFastSaveSection->id].size);
+ if (gFastSaveSection->checksum == checksum)
+ {
+ slot2saveCounter = gFastSaveSection->counter;
+ validSectors |= 1 << gFastSaveSection->id;
+ }
+ }
+ }
+
+ if (signatureValid)
+ {
+ if (validSectors == ALL_SECTORS)
+ slot2Status = SAVE_STATUS_OK;
+ else
+ slot2Status = SAVE_STATUS_ERROR;
+ }
+ else
+ {
+ slot2Status = SAVE_STATUS_EMPTY;
+ }
+
+ if (slot1Status == SAVE_STATUS_OK && slot2Status == SAVE_STATUS_OK)
+ {
+ // Choose counter of the most recent save file
+ if ((slot1saveCounter == -1 && slot2saveCounter == 0) || (slot1saveCounter == 0 && slot2saveCounter == -1))
+ {
+ if ((unsigned)(slot1saveCounter + 1) < (unsigned)(slot2saveCounter + 1))
+ gSaveCounter = slot2saveCounter;
+ else
+ gSaveCounter = slot1saveCounter;
+ }
+ else
+ {
+ if (slot1saveCounter < slot2saveCounter)
+ gSaveCounter = slot2saveCounter;
+ else
+ gSaveCounter = slot1saveCounter;
+ }
+ return SAVE_STATUS_OK;
+ }
+
+ if (slot1Status == SAVE_STATUS_OK)
+ {
+ gSaveCounter = slot1saveCounter;
+ if (slot2Status == SAVE_STATUS_ERROR)
+ return SAVE_STATUS_ERROR;
+ else
+ return SAVE_STATUS_OK;
+ }
+
+ if (slot2Status == SAVE_STATUS_OK)
+ {
+ gSaveCounter = slot2saveCounter;
+ if (slot1Status == SAVE_STATUS_ERROR)
+ return SAVE_STATUS_ERROR;
+ else
+ return SAVE_STATUS_OK;
+ }
+
+ if (slot1Status == SAVE_STATUS_EMPTY && slot2Status == SAVE_STATUS_EMPTY)
+ {
+ gSaveCounter = 0;
+ gFirstSaveSector = 0;
+ return SAVE_STATUS_EMPTY;
+ }
+
+ gSaveCounter = 0;
+ gFirstSaveSector = 0;
+ return 2;
+}
+
+u8 sub_80DA120(u8 sector, u8 *data, u16 size)
+{
+ u16 i;
+ struct SaveSection *section = &gSaveDataBuffer;
+
+ DoReadFlashWholeSection(sector, section);
+ if (section->signature == FILE_SIGNATURE)
+ {
+ u16 checksum = CalculateChecksum(section->data, size);
+ if (section->id == checksum)
+ {
+ for (i = 0; i < size; i++)
+ data[i] = section->data[i];
+ return SAVE_STATUS_OK;
+ }
+ else
+ {
+ return SAVE_STATUS_INVALID;
+ }
+ }
+ else
+ {
+ return SAVE_STATUS_EMPTY;
+ }
+}
+
+u8 DoReadFlashWholeSection(u8 sector, struct SaveSection *section)
+{
+ ReadFlash(sector, 0, section->data, sizeof(struct SaveSection));
+ return 1;
+}
+
+u16 CalculateChecksum(void *data, u16 size)
+{
+ u16 i;
+ u32 checksum = 0;
+
+ for (i = 0; i < (size / 4); i++)
+ checksum += *((u32 *)data)++;
+
+ return ((checksum >> 16) + checksum);
+}
+
+void UpdateSaveAddresses(void)
+{
+ int i = 0;
+
+ gRamSaveSectionLocations[i].data = (void*)(gSaveBlock2Ptr) + gSaveSectionOffsets[i].toAdd;
+ gRamSaveSectionLocations[i].size = gSaveSectionOffsets[i].size;
+
+ for (i = 1; i < 5; i++)
+ {
+ gRamSaveSectionLocations[i].data = (void*)(gSaveBlock1Ptr) + gSaveSectionOffsets[i].toAdd;
+ gRamSaveSectionLocations[i].size = gSaveSectionOffsets[i].size;
+ }
+
+ for (i = 5; i < 14; i++)
+ {
+ gRamSaveSectionLocations[i].data = (void*)(gPokemonStoragePtr) + gSaveSectionOffsets[i].toAdd;
+ gRamSaveSectionLocations[i].size = gSaveSectionOffsets[i].size;
+
+ i++;i--; // needed to match
+ }
+}
+
+u8 HandleSavingData(u8 saveType)
+{
+ u8 i;
+ u32 *backupPtr = gMain.vblankCounter1;
+ u8 *tempAddr;
+
+ gMain.vblankCounter1 = NULL;
+ UpdateSaveAddresses();
+ switch (saveType)
+ {
+ case SAVE_HALL_OF_FAME_ERASE_BEFORE: // deletes HOF before overwriting HOF completely. unused
+ for (i = 0xE * 2 + 0; i < 32; i++)
+ EraseFlashSector(i);
+ // fallthrough
+ case SAVE_HALL_OF_FAME: // hall of fame.
+ if (GetGameStat(GAME_STAT_ENTERED_HOF) < 999)
+ IncrementGameStat(GAME_STAT_ENTERED_HOF);
+ tempAddr = gDecompressionBuffer;
+ HandleWriteSectorNBytes(0x1C, tempAddr, 0xF80);
+ HandleWriteSectorNBytes(0x1D, tempAddr + 0xF80, 0xF80);
+ // fallthrough
+ case SAVE_NORMAL: // normal save. also called by overwriting your own save.
+ default:
+ SaveSerializedGame();
+ save_write_to_flash(0xFFFF, gRamSaveSectionLocations);
+ break;
+ case SAVE_LINK: // _081532C4
+ SaveSerializedGame();
+ for(i = 0; i < 5; i++)
+ save_write_to_flash(i, gRamSaveSectionLocations);
+ break;
+ case EREADER_SAVE:
+ SaveSerializedGame();
+ save_write_to_flash(0, gRamSaveSectionLocations);
+ break;
+ case SAVE_OVERWRITE_DIFFERENT_FILE:
+ for (i = (0xE * 2 + 0); i < 32; i++)
+ EraseFlashSector(i); // erase HOF.
+ SaveSerializedGame();
+ save_write_to_flash(0xFFFF, gRamSaveSectionLocations);
+ break;
+ }
+ gMain.vblankCounter1 = backupPtr;
+ return 0;
+}
+
+u8 TrySavingData(u8 saveType)
+{
+ if(gFlashMemoryPresent == TRUE)
+ {
+ HandleSavingData(saveType);
+ if(gDamagedSaveSectors)
+ DoSaveFailedScreen(saveType);
+ else
+ goto OK; // really?
+ }
+ gUnknown_3005420 = 0xFF;
+ return 0xFF;
+
+OK:
+ gUnknown_3005420 = 1;
+ return 1;
+}
+
+u8 sub_80DA3AC(void)
+{
+ if (gFlashMemoryPresent != TRUE)
+ return 1;
+ UpdateSaveAddresses();
+ SaveSerializedGame();
+ RestoreSaveBackupVarsAndIncrement(gRamSaveSectionLocations);
+ return 0;
+}
+
+bool8 sub_80DA3D8(void)
+{
+ u8 retVal = sub_80D9AA4(0xE, gRamSaveSectionLocations);
+ if (gDamagedSaveSectors)
+ DoSaveFailedScreen(0);
+ if (retVal == 0xFF)
+ return 1;
+ else
+ return 0;
+}
+
+u8 sub_80DA40C(void)
+{
+ sub_80D9B04(0xE, gRamSaveSectionLocations);
+ if (gDamagedSaveSectors)
+ DoSaveFailedScreen(0);
+ return 0;
+}
+
+u8 sub_80DA434(void)
+{
+ sav12_xor_get(0xE, gRamSaveSectionLocations);
+ if (gDamagedSaveSectors)
+ DoSaveFailedScreen(0);
+ return 0;
+}
+
+u8 sub_80DA45C(void)
+{
+ if (gFlashMemoryPresent != TRUE)
+ return 1;
+
+ UpdateSaveAddresses();
+ SaveSerializedGame();
+ RestoreSaveBackupVars(gRamSaveSectionLocations);
+ sub_80D9B04(gUnknown_3005398 + 1, gRamSaveSectionLocations);
+ return 0;
+}
+
+bool8 sub_80DA4A0(void)
+{
+ u8 retVal = FALSE;
+ u16 val = ++gUnknown_3005398;
+ if (val <= 4)
+ {
+ sub_80D9B04(gUnknown_3005398 + 1, gRamSaveSectionLocations);
+ sub_80D9D88(val, gRamSaveSectionLocations);
+ }
+ else
+ {
+ sub_80D9D88(val, gRamSaveSectionLocations);
+ retVal = TRUE;
+ }
+ if (gDamagedSaveSectors)
+ DoSaveFailedScreen(1);
+ return retVal;
+}
+
+u8 Save_LoadGameData(u8 a1)
+{
+ u8 result;
+
+ if (gFlashMemoryPresent != TRUE)
+ {
+ gSaveFileStatus = 4;
+ return 0xFF;
+ }
+
+ UpdateSaveAddresses();
+ switch (a1)
+ {
+ case 0:
+ default:
+ result = sub_80D9E14(0xFFFF, gRamSaveSectionLocations);
+ LoadSerializedGame();
+ gSaveFileStatus = result;
+ gGameContinueCallback = 0;
+ break;
+ case 3:
+ result = sub_80DA120(0x1C, gDecompressionBuffer, 0xF80);
+ if(result == 1)
+ result = sub_80DA120(0x1D, gDecompressionBuffer + 0xF80, 0xF80);
+ break;
+ }
+
+ return result;
+}
+
+u32 TryCopySpecialSaveSection(u8 sector, u8* dst)
+{
+ s32 i;
+ s32 size;
+ u8* savData;
+
+ if (sector != 30 && sector != 31)
+ return 0xFF;
+ ReadFlash(sector, 0, (u8 *)&gSaveDataBuffer, sizeof(struct SaveSection));
+ if (*(u32*)(&gSaveDataBuffer.data[0]) != 0xB39D)
+ return 0xFF;
+ // copies whole save section except u32 counter
+ i = 0;
+ size = 0xFFB;
+ savData = &gSaveDataBuffer.data[4];
+ for (; i <= size; i++)
+ dst[i] = savData[i];
+ return 1;
+}
+
+u32 sub_80DA5E0(u8 sector, u8* src)
+{
+ s32 i;
+ s32 size;
+ u8* savData;
+ void* savDataBuffer;
+
+ if (sector != 30 && sector != 31)
+ return 0xFF;
+
+ savDataBuffer = &gSaveDataBuffer;
+ *(u32*)(savDataBuffer) = 0xB39D;
+
+ // copies whole save section except u32 counter
+ i = 0;
+ size = 0xFFB;
+ savData = &gSaveDataBuffer.data[4];
+ for (; i <= size; i++)
+ savData[i] = src[i];
+ if (ProgramFlashSectorAndVerify(sector, savDataBuffer) != 0)
+ return 0xFF;
+ return 1;
+}
+
+void sub_80DA634(u8 taskId)
+{
+ switch (gTasks[taskId].data[0])
+ {
+ case 0:
+ gSoftResetDisabled = TRUE;
+ gTasks[taskId].data[0] = 1;
+ break;
+ case 1:
+ sub_800AB9C();
+ gTasks[taskId].data[0] = 2;
+ break;
+ case 2:
+ if (sub_800A4BC())
+ {
+ sub_80590D8();
+ gTasks[taskId].data[0] = 3;
+ }
+ break;
+ case 3:
+ sub_804C1C0();
+ sub_80DA3AC();
+ gTasks[taskId].data[0] = 4;
+ break;
+ case 4:
+ if (++gTasks[taskId].data[1] == 5)
+ {
+ gTasks[taskId].data[1] = 0;
+ gTasks[taskId].data[0] = 5;
+ }
+ break;
+ case 5:
+ if (sub_80DA3D8())
+ gTasks[taskId].data[0] = 6;
+ else
+ gTasks[taskId].data[0] = 4;
+ break;
+ case 6:
+ sub_80DA40C();
+ gTasks[taskId].data[0] = 7;
+ break;
+ case 7:
+ sav2_gender2_inplace_and_xFE();
+ sub_800AB9C();
+ gTasks[taskId].data[0] = 8;
+ break;
+ case 8:
+ if (sub_800A4BC())
+ {
+ sub_80DA434();
+ gTasks[taskId].data[0] = 9;
+ }
+ break;
+ case 9:
+ sub_800AB9C();
+ gTasks[taskId].data[0] = 10;
+ break;
+ case 10:
+ if (sub_800A4BC())
+ gTasks[taskId].data[0]++;
+ break;
+ case 11:
+ if (++gTasks[taskId].data[1] > 5)
+ {
+ gSoftResetDisabled = FALSE;
+ DestroyTask(taskId);
+ }
+ break;
+ }
+}
diff --git a/src/vs_seeker.c b/src/vs_seeker.c
index 75534d308..17a13ab01 100644
--- a/src/vs_seeker.c
+++ b/src/vs_seeker.c
@@ -64,7 +64,7 @@ struct VsSeekerStruct
};
extern u16 gUnknown_20370D2;
-extern struct MapObject gUnknown_2036E38[MAP_OBJECTS_COUNT];
+extern struct MapObject gMapObjects[MAP_OBJECTS_COUNT];
extern u8 gUnknown_3005074;
// static declarations
@@ -642,8 +642,8 @@ static void GatherNearbyTrainerInfo(void)
sVsSeeker->trainerInfo[vsSeekerObjectIdx].localId = templates[mapObjectIdx].localId;
TryGetFieldObjectIdByLocalIdAndMap(templates[mapObjectIdx].localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &fieldObjectId);
sVsSeeker->trainerInfo[vsSeekerObjectIdx].fieldObjectId = fieldObjectId;
- sVsSeeker->trainerInfo[vsSeekerObjectIdx].xCoord = gUnknown_2036E38[fieldObjectId].coords2.x - 7;
- sVsSeeker->trainerInfo[vsSeekerObjectIdx].yCoord = gUnknown_2036E38[fieldObjectId].coords2.y - 7;
+ sVsSeeker->trainerInfo[vsSeekerObjectIdx].xCoord = gMapObjects[fieldObjectId].coords2.x - 7;
+ sVsSeeker->trainerInfo[vsSeekerObjectIdx].yCoord = gMapObjects[fieldObjectId].coords2.y - 7;
sVsSeeker->trainerInfo[vsSeekerObjectIdx].graphicsId = templates[mapObjectIdx].graphicsId;
vsSeekerObjectIdx++;
}
@@ -731,7 +731,7 @@ static u8 GetVsSeekerResponseInArea(const VsSeekerData * a0)
else
{
gSaveBlock1Ptr->trainerRematches[sVsSeeker->trainerInfo[vsSeekerIdx].localId] = r7;
- npc_coords_shift_still(&gUnknown_2036E38[sVsSeeker->trainerInfo[vsSeekerIdx].fieldObjectId]);
+ npc_coords_shift_still(&gMapObjects[sVsSeeker->trainerInfo[vsSeekerIdx].fieldObjectId]);
StartTrainerObjectMovementScript(&sVsSeeker->trainerInfo[vsSeekerIdx], gUnknown_8453F64);
sVsSeeker->trainerIdxArray[sVsSeeker->numRematchableTrainers] = r8;
sVsSeeker->runningBehaviourEtcArray[sVsSeeker->numRematchableTrainers] = GetRunningBehaviorFromGraphicsId(sVsSeeker->trainerInfo[vsSeekerIdx].graphicsId);
@@ -891,7 +891,7 @@ static u8 GetVsSeekerResponseInArea(const VsSeekerData * a0)
"\tlsls r0, r1, 3\n"
"\tadds r0, r1\n"
"\tlsls r0, 2\n"
- "\tldr r1, _0810CB5C @ =gUnknown_2036E38\n"
+ "\tldr r1, _0810CB5C @ =gMapObjects\n"
"\tadds r0, r1\n"
"\tbl npc_coords_shift_still\n"
"\tldr r0, [r6]\n"
@@ -965,7 +965,7 @@ static u8 GetVsSeekerResponseInArea(const VsSeekerData * a0)
"\t.align 2, 0\n"
"_0810CB54: .4byte gSaveBlock1Ptr\n"
"_0810CB58: .4byte 0x0000063a\n"
- "_0810CB5C: .4byte gUnknown_2036E38\n"
+ "_0810CB5C: .4byte gMapObjects\n"
"_0810CB60: .4byte gUnknown_8453F64\n"
"_0810CB64: .4byte 0x00000431\n"
"_0810CB68: .4byte sVsSeeker\n"
@@ -1008,7 +1008,7 @@ void sub_810CB90(void)
struct MapObject *r4_2;
TryGetFieldObjectIdByLocalIdAndMap(r4[r8].localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &sp0);
- r4_2 = &gUnknown_2036E38[sp0];
+ r4_2 = &gMapObjects[sp0];
sub_810CF54(&r4[r8]); // You are using this function incorrectly. Please consult the manual.
sub_805FE7C(r4_2, gUnknown_8453F67[r4_2->mapobj_unk_18]);
gSaveBlock1Ptr->trainerRematches[r4[r8].localId] = 0;
@@ -1155,7 +1155,7 @@ static bool8 sub_810CED0(const VsSeekerData * a0, u16 a1)
bool8 sub_810CF04(u8 a0)
{
- struct MapObject *r1 = &gUnknown_2036E38[a0];
+ struct MapObject *r1 = &gMapObjects[a0];
if (r1->active && gMapHeader.events->mapObjectCount >= r1->localId && gSprites[r1->spriteId].data[0] == a0)
return TRUE;
@@ -1331,7 +1331,7 @@ static u8 GetRematchableTrainerLocalId(void)
static void StartTrainerObjectMovementScript(struct VsSeekerTrainerInfo * trainerInfo, const u8 * script)
{
- npc_sync_anim_pause_bits(&gUnknown_2036E38[trainerInfo->fieldObjectId]);
+ npc_sync_anim_pause_bits(&gMapObjects[trainerInfo->fieldObjectId]);
ScriptMovement_StartObjectMovementScript(trainerInfo->localId, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, script);
}
@@ -1367,7 +1367,7 @@ static void StartAllRespondantIdleMovements(void)
{
if (sVsSeeker->trainerInfo[j].trainerIdx == sVsSeeker->trainerIdxArray[i])
{
- struct MapObject *r4 = &gUnknown_2036E38[sVsSeeker->trainerInfo[j].fieldObjectId];
+ struct MapObject *r4 = &gMapObjects[sVsSeeker->trainerInfo[j].fieldObjectId];
if (sub_810CF04(sVsSeeker->trainerInfo[j].fieldObjectId) == 1)
npc_set_running_behaviour_etc(r4, sVsSeeker->runningBehaviourEtcArray[i]);
diff --git a/sym_common.txt b/sym_common.txt
index 4049c48f5..04e6982e0 100644
--- a/sym_common.txt
+++ b/sym_common.txt
@@ -133,20 +133,9 @@ gUnknown_3004FFC: @ 3004FFC
.space 0x4
.include "random.o"
-
- .align 2
-gUnknown_3005004: @ 3005004
- .space 0x4
-
-gSaveBlock1Ptr: @ 3005008
- .space 0x4
-
-gSaveBlock2Ptr: @ 300500C
- .space 0x4
-
-gUnknown_3005010: @ 3005010
- .space 0x4
+ .include "load_save.o"
+ .align 2
gUnknown_3005014: @ 3005014
.space 0x4
@@ -240,39 +229,9 @@ gUnknown_3005378: @ 3005378
gUnknown_300537C: @ 300537C
.space 0x4
-gUnknown_3005380: @ 3005380
- .space 0x4
-
-gUnknown_3005384: @ 3005384
- .space 0x4
-
-gUnknown_3005388: @ 3005388
- .space 0x4
-
-gUnknown_300538C: @ 300538C
- .space 0x4
-
-gUnknown_3005390: @ 3005390
- .space 0x4
-
-gUnknown_3005394: @ 3005394
- .space 0x4
-
-gUnknown_3005398: @ 3005398
- .space 0x8
-
-gUnknown_30053A0: @ 30053A0
- .space 0x4
-
-gUnknown_30053A4: @ 30053A4
- .space 0xC
-
-gUnknown_30053B0: @ 30053B0
- .space 0x70
-
-gUnknown_3005420: @ 3005420
- .space 0x4
+ .include "save.o"
+ .align 2
gUnknown_3005424: @ 3005424
.space 0x4
diff --git a/sym_ewram.txt b/sym_ewram.txt
index 92965b743..1b4e518c8 100644
--- a/sym_ewram.txt
+++ b/sym_ewram.txt
@@ -1,4 +1,4 @@
-gUnknown_201C000: @ 201C000
+gDecompressionBuffer: @ 201C000
.space 0x20
gUnknown_201C020: @ 201C020
@@ -80,7 +80,7 @@ gUnknown_202271C: @ 202271C
gUnknown_2022720: @ 2022720
.space 0x1C
-gUnknown_202273C: @ 202273C
+gLinkPlayers: @ 202273C
.space 0x8
gUnknown_2022744: @ 2022744
@@ -152,13 +152,13 @@ gUnknown_2022988: @ 2022988
gUnknown_202298A: @ 202298A
.space 0x2
-gUnknown_202298C: @ 202298C
+gDisplayedStringBattle: @ 202298C
.space 0x12C
-gUnknown_2022AB8: @ 2022AB8
+gBattleTextBuff1: @ 2022AB8
.space 0x10
-gUnknown_2022AC8: @ 2022AC8
+gBattleTextBuff2: @ 2022AC8
.space 0x10
gUnknown_2022AD8: @ 2022AD8
@@ -212,7 +212,7 @@ gActiveBattler: @ 2023BC4
gUnknown_2023BC8: @ 2023BC8
.space 0x4
-gUnknown_2023BCC: @ 2023BCC
+gBattlersCount: @ 2023BCC
.space 0x2
gBattlerPartyIndexes: @ 2023BCE
@@ -284,7 +284,7 @@ gUnknown_2023D58: @ 2023D58
gUnknown_2023D68: @ 2023D68
.space 0x2
-gUnknown_2023D6A: @ 2023D6A
+gLastUsedAbility: @ 2023D6A
.space 0x1
sBattler_AI: @ 2023D6B
@@ -299,7 +299,7 @@ gUnknown_2023D6D: @ 2023D6D
gUnknown_2023D6E: @ 2023D6E
.space 0x1
-gUnknown_2023D6F: @ 2023D6F
+gPotentialItemEffectBattler: @ 2023D6F
.space 0x1
gAbsentBattlerFlags: @ 2023D70
@@ -362,7 +362,7 @@ gUnknown_2023DDC: @ 2023DDC
gSideAffecting: @ 2023DDE
.space 0x6
-gUnknown_2023DE4: @ 2023DE4
+gSideTimers: @ 2023DE4
.space 0x18
gStatuses3: @ 2023DFC
@@ -413,11 +413,8 @@ gDynamicBasePower: @ 2023F50
gUnknown_2023F52: @ 2023F52
.space 0x2
-gUnknown_2023F54: @ 2023F54
- .space 0x8
-
-gUnknown_2023F5C: @ 2023F5C
- .space 0x68
+gEnigmaBerries: @ 2023F54
+ .space 0x70
gBattleScripting: @ 2023FC4
.space 0x4
@@ -446,7 +443,7 @@ gUnknown_2023FFC: @ 2023FFC
gUnknown_2024000: @ 2024000
.space 0x4
-gUnknown_2024004: @ 2024004
+gBattlerInMenuId: @ 2024004
.space 0x1
gUnknown_2024005: @ 2024005
@@ -458,25 +455,25 @@ gUnknown_2024008: @ 2024008
gUnknown_2024018: @ 2024018
.space 0x4
-gUnknown_202401C: @ 202401C
+gMonSpritesGfxPtr: @ 202401C
.space 0x4
-gUnknown_2024020: @ 2024020
+gBattleMovePower: @ 2024020
.space 0x2
-gUnknown_2024022: @ 2024022
+gMoveToLearn: @ 2024022
.space 0x2
-gUnknown_2024024: @ 2024024
+gBattleMonForms: @ 2024024
.space 0x4
-gUnknown_2024028: @ 2024028
+sLearningMoveTableID: @ 2024028
.space 0x1
-gUnknown_2024029: @ 2024029
+gPlayerPartyCount: @ 2024029
.space 0x1
-gUnknown_202402A: @ 202402A
+gEnemyPartyCount: @ 202402A
.space 0x2
gEnemyParty: @ 202402C
@@ -512,7 +509,7 @@ gUnknown_2024414: @ 2024414
gUnknown_2024478: @ 2024478
.space 0x64
-gUnknown_20244DC: @ 20244DC
+gMultiuseSpriteTemplate: @ 20244DC
.space 0x18
gUnknown_20244F4: @ 20244F4
@@ -533,21 +530,9 @@ gUnknown_202456C: @ 202456C
gUnknown_2024580: @ 2024580
.space 0x8
-gSaveBlock2: @ 2024588
- .space 0xFA4
-
-gSaveBlock1: @ 202552C
- .space 0x3DE8
-
-gPokemonStorage: @ 2029314
- .space 0x8450
-
-gUnknown_2031764: @ 2031764
- .space 0x528
-
-gUnknown_2031C8C: @ 2031C8C
- .space 0x4
+ .include "src/load_save.o"
+ .align 2
gUnknown_2031C90: @ 2031C90
.space 0x4
@@ -632,7 +617,7 @@ gUnknown_2036E30: @ 2036E30
gUnknown_2036E34: @ 2036E34
.space 0x4
-gUnknown_2036E38: @ 2036E38
+gMapObjects: @ 2036E38
.space 0x240
gUnknown_2037078: @ 2037078
@@ -716,10 +701,10 @@ gUnknown_20370D2: @ 20370D2
gUnknown_20370D4: @ 20370D4
.space 0x2
-gUnknown_20370D6: @ 20370D6
+gSpecialVar_MonBoxId: @ 20370D6
.space 0x2
-gUnknown_20370D8: @ 20370D8
+gSpecialVar_MonBoxPos: @ 20370D8
.space 0x2
gUnknown_20370DA: @ 20370DA
@@ -1247,9 +1232,9 @@ gUnknown_2039A30: @ 2039A30
gUnknown_2039A34: @ 2039A34
.space 0x4
-gUnknown_2039A38: @ 2039A38
- .space 0x1004
+ .include "src/save.o"
+ .align 2
gUnknown_203AA3C: @ 203AA3C
.space 0x74