From 157b88b6dbfa7816cac9c6cf2ef20bd70a573b10 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Tue, 16 Jan 2018 14:01:31 -0600 Subject: [PATCH] identity -> position --- asm/battle_anim_80A5C6C.s | 92 +-- asm/battle_anim_80A9C70.s | 4 +- asm/battle_anim_80FE840.s | 706 +++++++++++----------- asm/battle_anim_815A0D4.s | 116 ++-- asm/battle_anim_8170478.s | 20 +- asm/battle_link_817C95C.s | 12 +- asm/contest.s | 6 +- constants/battle_constants.inc | 8 +- data/battle_scripts_1.s | 10 +- include/battle.h | 46 +- include/battle_anim.h | 2 +- src/battle_2.c | 140 ++--- src/battle_ai_script_commands.c | 2 +- src/battle_ai_switch_items.c | 26 +- src/battle_anim.c | 38 +- src/battle_controller_link_opponent.c | 20 +- src/battle_controller_link_partner.c | 12 +- src/battle_controller_opponent.c | 30 +- src/battle_controller_player.c | 54 +- src/battle_controller_player_partner.c | 20 +- src/battle_controller_recorded_opponent.c | 16 +- src/battle_controller_recorded_player.c | 20 +- src/battle_controller_safari.c | 6 +- src/battle_controller_wally.c | 12 +- src/battle_controllers.c | 140 ++--- src/battle_gfx_sfx_util.c | 54 +- src/battle_interface.c | 26 +- src/battle_message.c | 8 +- src/battle_script_commands.c | 42 +- src/battle_util.c | 32 +- src/battle_util2.c | 6 +- src/pokeball.c | 24 +- src/pokemon_2.c | 4 +- src/reshow_battle_screen.c | 20 +- sym_ewram.txt | 2 +- 35 files changed, 895 insertions(+), 881 deletions(-) diff --git a/asm/battle_anim_80A5C6C.s b/asm/battle_anim_80A5C6C.s index 08baa4595..1c19805a0 100644 --- a/asm/battle_anim_80A5C6C.s +++ b/asm/battle_anim_80A5C6C.s @@ -5,8 +5,8 @@ .text - thumb_func_start GetBankPosition -GetBankPosition: @ 80A5C6C + thumb_func_start GetBankCoord +GetBankCoord: @ 80A5C6C push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 @@ -40,7 +40,7 @@ _080A5C9C: _080A5CB0: ldr r4, =gUnknown_08525F58 adds r0, r5, 0 - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 lsrs r0, 22 ldr r1, =gBattleTypeFlags @@ -56,7 +56,7 @@ _080A5CB0: _080A5CD8: ldr r4, =gUnknown_08525F58 adds r0, r5, 0 - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 lsrs r0, 22 ldr r1, =gBattleTypeFlags @@ -154,7 +154,7 @@ _080A5DB0: pop {r4,r5} pop {r1} bx r1 - thumb_func_end GetBankPosition + thumb_func_end GetBankCoord thumb_func_start sub_80A5DB8 sub_80A5DB8: @ 80A5DB8 @@ -476,7 +476,7 @@ _080A603E: lsrs r4, r0, 16 _080A605C: adds r0, r6, 0 - bl GetBankIdentity + bl GetBankPosition ldr r3, =gUnknown_08525F58 lsls r0, 24 lsrs r0, 22 @@ -577,7 +577,7 @@ _080A611C: _080A6126: adds r0, r4, 0 adds r1, r5, 0 - bl GetBankPosition + bl GetBankCoord _080A612E: lsls r0, 24 lsrs r0, 24 @@ -592,7 +592,7 @@ GetBankSpriteDefault_Y: @ 80A6138 lsls r0, 24 lsrs r0, 24 movs r1, 0x4 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 pop {r1} @@ -611,7 +611,7 @@ GetSubstituteSpriteDefault_Y: @ 80A614C beq _080A6170 adds r0, r4, 0 movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 8 movs r1, 0x80 @@ -620,7 +620,7 @@ GetSubstituteSpriteDefault_Y: @ 80A614C _080A6170: adds r0, r4, 0 movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 8 movs r1, 0x88 @@ -642,7 +642,7 @@ sub_80A6190: @ 80A6190 lsrs r5, r0, 24 adds r0, r5, 0 movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r6, r0, 24 bl IsContest @@ -1245,13 +1245,13 @@ sub_80A65EC: @ 80A65EC ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] @@ -1442,13 +1442,13 @@ sub_80A6760: @ 80A6760 ldr r5, =gAnimBankAttacker ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] @@ -1550,13 +1550,13 @@ sub_80A6838: @ 80A6838 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -1578,13 +1578,13 @@ sub_80A6864: @ 80A6864 ldr r7, =gAnimBankAttacker ldrb r0, [r7] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r6, r0, 24 ldr r0, =gAnimBankTarget ldrb r0, [r0] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 cmp r6, r0 @@ -1810,7 +1810,7 @@ _080A6A04: GetBankSide: @ 80A6A30 lsls r0, 24 lsrs r0, 24 - ldr r1, =gBanksByIdentity + ldr r1, =gBankPositions adds r0, r1 ldrb r1, [r0] movs r0, 0x1 @@ -1819,16 +1819,16 @@ GetBankSide: @ 80A6A30 .pool thumb_func_end GetBankSide - thumb_func_start GetBankIdentity -GetBankIdentity: @ 80A6A44 + thumb_func_start GetBankPosition +GetBankPosition: @ 80A6A44 lsls r0, 24 lsrs r0, 24 - ldr r1, =gBanksByIdentity + ldr r1, =gBankPositions adds r0, r1 ldrb r0, [r0] bx lr .pool - thumb_func_end GetBankIdentity + thumb_func_end GetBankPosition thumb_func_start GetBankByIdentity GetBankByIdentity: @ 80A6A54 @@ -1840,7 +1840,7 @@ GetBankByIdentity: @ 80A6A54 ldrb r2, [r0] cmp r1, r2 bcs _080A6A7E - ldr r4, =gBanksByIdentity + ldr r4, =gBankPositions ldrb r0, [r4] cmp r0, r3 beq _080A6A7E @@ -1883,7 +1883,7 @@ IsBankSpritePresent: @ 80A6A90 b _080A6B18 .pool _080A6ABC: - ldr r0, =gBanksByIdentity + ldr r0, =gBankPositions adds r0, r4, r0 ldrb r0, [r0] cmp r0, 0xFF @@ -3685,7 +3685,7 @@ _080A785C: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r6, 0x4] @@ -3693,7 +3693,7 @@ _080A785C: strh r0, [r5, 0x32] ldrb r0, [r4] adds r1, r7, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r6, [r6, 0x6] @@ -3733,7 +3733,7 @@ _080A78CC: ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x4] @@ -3741,7 +3741,7 @@ _080A78CC: strh r0, [r6, 0x32] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x6] @@ -3828,7 +3828,7 @@ _080A798E: strh r0, [r5, 0x2E] adds r0, r6, 0 movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r2, [r4, 0x4] @@ -3836,7 +3836,7 @@ _080A798E: strh r0, [r5, 0x32] adds r0, r6, 0 adds r1, r7, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r4, [r4, 0x6] @@ -5027,7 +5027,7 @@ _080A82FC: b _080A8320 _080A8300: adds r0, r4, 0 - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 lsrs r0, 24 movs r1, 0x1E @@ -5053,7 +5053,7 @@ sub_80A8328: @ 80A8328 push {r4,lr} lsls r0, 24 lsrs r0, 24 - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 lsrs r4, r0, 24 bl IsContest @@ -5093,7 +5093,7 @@ sub_80A8364: @ 80A8364 cmp r0, 0 bne _080A838A adds r0, r4, 0 - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 lsrs r0, 24 cmp r0, 0 @@ -5713,7 +5713,7 @@ _080A88A6: _080A88AE: mov r0, r8 movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrb r1, [r4] @@ -5722,7 +5722,7 @@ _080A88AE: _080A88C0: mov r0, r8 movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrb r1, [r4] @@ -5731,7 +5731,7 @@ _080A88C0: _080A88D2: mov r0, r8 movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrb r2, [r4] @@ -5744,7 +5744,7 @@ _080A88E4: _080A88EA: mov r0, r8 movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrb r2, [r4] @@ -5757,7 +5757,7 @@ _080A88FC: _080A8902: mov r0, r8 movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, 0x1F @@ -5798,13 +5798,13 @@ _080A8942: _080A8946: adds r0, r4, 0 adds r1, r5, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 mov r8, r0 adds r0, r4, 0 adds r1, r6, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r7, r0, 24 bl IsDoubleBattle @@ -5819,12 +5819,12 @@ _080A8946: eors r4, r0 adds r0, r4, 0 adds r1, r5, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r5, r0, 24 adds r0, r4, 0 adds r1, r6, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r3, r0, 24 mov r0, r8 @@ -6392,13 +6392,13 @@ sub_80A8E30: @ 80A8E30 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] diff --git a/asm/battle_anim_80A9C70.s b/asm/battle_anim_80A9C70.s index c471cc729..82981ff21 100644 --- a/asm/battle_anim_80A9C70.s +++ b/asm/battle_anim_80A9C70.s @@ -334,7 +334,7 @@ sub_80A9EF4: @ 80A9EF4 ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 8 ldr r1, =0xffe00000 @@ -342,7 +342,7 @@ sub_80A9EF4: @ 80A9EF4 lsrs r5, r0, 16 ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 8 ldr r1, =0xffdc0000 diff --git a/asm/battle_anim_80FE840.s b/asm/battle_anim_80FE840.s index e51dcedb7..c94826f40 100644 --- a/asm/battle_anim_80FE840.s +++ b/asm/battle_anim_80FE840.s @@ -99,13 +99,13 @@ sub_80FE8E0: @ 80FE8E0 ldr r5, =gAnimBankAttacker ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] @@ -135,13 +135,13 @@ sub_80FE930: @ 80FE930 ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] @@ -170,7 +170,7 @@ sub_80FE988: @ 80FE988 ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] @@ -178,7 +178,7 @@ sub_80FE988: @ 80FE988 strh r0, [r4, 0x34] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] @@ -324,13 +324,13 @@ sub_80FEAD8: @ 80FEAD8 ldr r5, =gAnimBankAttacker ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] @@ -377,13 +377,13 @@ sub_80FEB44: @ 80FEB44 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -413,7 +413,7 @@ _080FEB94: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x32] @@ -421,7 +421,7 @@ _080FEB94: strh r0, [r5, 0x34] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x36] @@ -511,7 +511,7 @@ _080FEC68: ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x4] @@ -519,7 +519,7 @@ _080FEC68: strh r0, [r6, 0x32] ldrb r0, [r5] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x6] @@ -774,7 +774,7 @@ sub_80FEE78: @ 80FEE78 ldr r0, =gAnimBankAttacker ldrb r0, [r0] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r5, [r5, 0x4] @@ -871,7 +871,7 @@ sub_80FEF44: @ 80FEF44 ldr r0, =gAnimBankAttacker ldrb r0, [r0] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r5, [r5, 0x4] @@ -953,13 +953,13 @@ sub_80FEFFC: @ 80FEFFC ldr r5, =gAnimBankAttacker ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x20] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x22] @@ -1101,7 +1101,7 @@ _080FF114: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r6, 0x4] @@ -1109,7 +1109,7 @@ _080FF114: strh r0, [r5, 0x32] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r6, [r6, 0x6] @@ -1799,7 +1799,7 @@ _080FF6AA: _080FF6C2: ldrb r0, [r6] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldr r4, =gBattleAnimArgs lsrs r0, 24 @@ -1808,7 +1808,7 @@ _080FF6C2: strh r0, [r5, 0x20] ldrb r0, [r6] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r4, [r4, 0x2] @@ -1848,13 +1848,13 @@ _080FF704: ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x32] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x36] @@ -1881,13 +1881,13 @@ sub_80FF768: @ 80FF768 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -1944,13 +1944,13 @@ sub_80FF7EC: @ 80FF7EC ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord mov r8, r0 mov r0, r8 lsls r0, 24 @@ -1959,13 +1959,13 @@ sub_80FF7EC: @ 80FF7EC ldr r6, =gAnimBankTarget ldrb r0, [r6] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldrb r0, [r6] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord adds r2, r0, 0 lsls r2, 24 subs r4, r5 @@ -2098,7 +2098,7 @@ sub_80FF934: @ 80FF934 ldr r5, =gAnimBankAttacker ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldr r4, =gBattleAnimArgs lsrs r0, 24 @@ -2107,7 +2107,7 @@ sub_80FF934: @ 80FF934 strh r0, [r6, 0x20] ldrb r0, [r5] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x2] @@ -2352,12 +2352,12 @@ sub_80FFB18: @ 80FFB18 ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r6, r0, 24 ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r2, r0, 24 ldr r0, =gAnimBankAttacker @@ -2456,7 +2456,7 @@ sub_80FFBF4: @ 80FFBF4 ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r6, r0, 24 ldrb r0, [r4] @@ -2554,12 +2554,12 @@ sub_80FFCB4: @ 80FFCB4 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r6, r0, 24 ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r2, r0, 24 ldr r0, =gAnimBankTarget @@ -2963,13 +2963,13 @@ sub_80FFFC0: @ 80FFFC0 strh r0, [r5, 0x10] ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x14] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x16] @@ -3837,7 +3837,7 @@ _081006CE: _081006D4: adds r0, r6, 0 movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r5, [r5] @@ -3860,7 +3860,7 @@ _08100700: ldr r0, =gAnimBankTarget ldrb r0, [r0] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r7, [r7] @@ -4082,12 +4082,12 @@ _081008C4: _081008C6: ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r5, r0, 24 ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r2, r0, 24 ldr r0, =gBattleAnimArgs @@ -4346,13 +4346,13 @@ sub_8100AE0: @ 8100AE0 ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -4444,7 +4444,7 @@ _08100BA8: movs r4, 0x2 eors r0, r4 movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r7, r0, 24 ldrb r0, [r5] @@ -4456,12 +4456,12 @@ _08100BC8: ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r7, r0, 24 ldrb r0, [r5] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r4, r0, 24 ldrb r0, [r5] @@ -4477,7 +4477,7 @@ _08100BC8: mov r2, r8 eors r0, r2 movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, r7 @@ -4486,7 +4486,7 @@ _08100BC8: mov r1, r8 eors r0, r1 movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, r4 @@ -4497,13 +4497,13 @@ _08100C24: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r7, r0, 24 ldrb r0, [r4] _08100C34: movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r4, r0, 24 _08100C3E: @@ -5093,14 +5093,14 @@ sub_81010CC: @ 81010CC ldr r6, =gAnimBankTarget ldrb r0, [r6] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 movs r5, 0 strh r0, [r4, 0x20] ldrb r0, [r6] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldr r1, =0x0000ffe8 @@ -5470,7 +5470,7 @@ _081013C4: bne _081013E8 adds r0, r6, 0 movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] @@ -5481,14 +5481,14 @@ _081013C4: _081013E8: adds r0, r6, 0 movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] adds r0, r6, 0 movs r1, 0x3 _081013FA: - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r4, [r4, 0x2] @@ -5888,14 +5888,14 @@ _08101718: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, r7 strh r0, [r5, 0x32] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, r6 @@ -6930,7 +6930,7 @@ _08101F5C: _08101F5E: ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r6, 0x2] @@ -6938,7 +6938,7 @@ _08101F5E: strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r6, [r6, 0x4] @@ -6965,7 +6965,7 @@ sub_8101FA8: @ 8101FA8 ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldr r1, =0x0000ffd0 @@ -6973,7 +6973,7 @@ sub_8101FA8: @ 8101FA8 strh r0, [r4, 0x20] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x22] @@ -6995,7 +6995,7 @@ sub_8101FF0: @ 8101FF0 ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldr r1, =gBattleAnimArgs @@ -7007,7 +7007,7 @@ sub_8101FF0: @ 8101FF0 strh r0, [r4, 0x20] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x22] @@ -7123,7 +7123,7 @@ _081020F4: _081020F6: ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r6, 0x2] @@ -7131,7 +7131,7 @@ _081020F6: strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r6, [r6, 0x4] @@ -7194,14 +7194,14 @@ sub_810217C: @ 810217C ldr r6, =gAnimBankAttacker ldrb r0, [r6] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 movs r5, 0 strh r0, [r4, 0x20] ldrb r0, [r6] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 subs r0, 0xC @@ -7319,7 +7319,7 @@ sub_8102268: @ 8102268 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldr r5, =gBattleAnimArgs lsrs r0, 24 @@ -7328,7 +7328,7 @@ sub_8102268: @ 8102268 strh r0, [r6, 0x20] ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r5, [r5, 0x2] @@ -7468,13 +7468,13 @@ _08102390: ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x32] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x36] @@ -7676,7 +7676,7 @@ sub_8102540: @ 8102540 ldr r0, =gAnimBankAttacker ldrb r0, [r0] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldr r2, =gBattleAnimArgs lsrs r0, 24 @@ -8071,7 +8071,7 @@ _08102862: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r6] @@ -8079,7 +8079,7 @@ _08102862: strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r6, [r6, 0x2] @@ -8660,12 +8660,12 @@ _08102D34: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r6, r0, 24 ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r3, r0, 24 _08102D4E: @@ -8870,7 +8870,7 @@ sub_8102EB0: @ 8102EB0 _08102ECE: ldrb r0, [r7] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldr r4, =gBattleAnimArgs lsrs r0, 24 @@ -8880,7 +8880,7 @@ _08102ECE: strh r0, [r6, 0x20] ldrb r0, [r7] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r2, [r4, 0x4] @@ -9005,14 +9005,14 @@ _08102FDE: ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, r6 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, 0x8 @@ -9167,7 +9167,7 @@ _08103136: strh r0, [r6, 0x20] adds r0, r5, 0 movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord adds r4, r0, 0 adds r0, r5, 0 movs r1, 0 @@ -9334,7 +9334,7 @@ _081032A2: ldrb r5, [r0] adds r0, r5, 0 movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 movs r6, 0 @@ -9719,13 +9719,13 @@ sub_810358C: @ 810358C ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -10140,7 +10140,7 @@ _0810390E: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldr r6, =gBattleAnimArgs lsrs r0, 24 @@ -10151,7 +10151,7 @@ _0810390E: mov r8, r0 ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r2, [r6, 0x6] @@ -10676,7 +10676,7 @@ _08103D54: strh r0, [r3, 0x4] b _08103DB6 _08103D5C: - ldr r1, =gBanksByIdentity + ldr r1, =gBankPositions ldr r0, =gAnimBankTarget ldrb r0, [r0] adds r0, r1 @@ -10719,7 +10719,7 @@ _08103DB6: ldr r5, =gAnimBankAttacker ldrb r0, [r5] movs r1, 0 - bl GetBankPosition + bl GetBankCoord ldr r1, =gTasks mov r3, r8 adds r4, r3, r7 @@ -10731,7 +10731,7 @@ _08103DB6: adds r6, r0, 0 ldrb r0, [r5] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x1C] @@ -10762,13 +10762,13 @@ _08103E20: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5] ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 mov r1, r10 @@ -11053,12 +11053,12 @@ sub_8104088: @ 8104088 ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r6, r0, 24 ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldr r4, =gBattleAnimArgs lsrs r0, 24 @@ -11203,13 +11203,13 @@ sub_81041C4: @ 81041C4 ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] @@ -11426,14 +11426,14 @@ _08104390: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 add r0, r8 strh r0, [r5, 0x32] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, r6 @@ -11513,7 +11513,7 @@ _08104448: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 add r0, r9 @@ -11522,7 +11522,7 @@ _08104448: strh r0, [r5, 0x34] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, r6 @@ -12356,7 +12356,7 @@ sub_8104B1C: @ 8104B1C bl StartSpriteAnim ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, 0x20 @@ -12370,7 +12370,7 @@ _08104B50: bl StartSpriteAnim ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 subs r0, 0x20 @@ -12381,7 +12381,7 @@ _08104B6A: ldr r0, =gAnimBankAttacker ldrb r0, [r0] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 movs r1, 0 @@ -12432,7 +12432,7 @@ _08104BCA: _08104BE4: adds r0, r5, 0 movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldr r4, =gBattleAnimArgs lsrs r0, 24 @@ -12441,7 +12441,7 @@ _08104BE4: strh r0, [r6, 0x20] adds r0, r5, 0 movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r4, [r4, 0x4] @@ -12962,7 +12962,7 @@ sub_810501C: @ 810501C ldr r6, =gAnimBankTarget ldrb r0, [r6] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 subs r0, 0x10 @@ -13231,7 +13231,7 @@ _08105230: adds r0, r5, 0 movs r1, 0x2 _08105234: - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r4, r0, 24 adds r0, r5, 0 @@ -13341,7 +13341,7 @@ _08105310: beq _0810536C adds r0, r7, 0 mov r1, r10 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldr r1, =gBattleAnimArgs lsrs r0, 24 @@ -13372,7 +13372,7 @@ _0810535C: _0810536C: adds r0, r7, 0 mov r1, r10 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldr r1, =gBattleAnimArgs @@ -13442,7 +13442,7 @@ _081053FA: strb r0, [r1] adds r0, r7, 0 ldr r1, [sp, 0x4] - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldr r4, =gBattleAnimArgs lsrs r0, 24 @@ -13473,13 +13473,13 @@ _0810544C: mov r4, sp mov r0, r8 mov r1, r10 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4] mov r0, r8 ldr r1, [sp, 0x4] - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 mov r2, sp @@ -14295,13 +14295,13 @@ sub_8105AAC: @ 8105AAC ldr r5, =gAnimBankAttacker ldrb r0, [r5] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x24] ldrb r0, [r5] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x26] @@ -14700,7 +14700,7 @@ _08105E08: strh r0, [r5, 0x2E] ldrb r0, [r6] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x4] @@ -14708,7 +14708,7 @@ _08105E08: strh r0, [r5, 0x32] ldrb r0, [r6] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x6] @@ -15075,7 +15075,7 @@ sub_8106140: @ 8106140 ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] @@ -15083,7 +15083,7 @@ sub_8106140: @ 8106140 strh r0, [r4, 0x34] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] @@ -15776,13 +15776,13 @@ sub_810673C: @ 810673C ldr r5, =gAnimBankAttacker ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x20] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x22] @@ -15927,13 +15927,13 @@ sub_8106878: @ 8106878 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -16032,13 +16032,13 @@ sub_8106944: @ 8106944 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -16513,13 +16513,13 @@ _08106CFC: _08106CFE: ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -16666,7 +16666,7 @@ _08106E1E: _08106E38: adds r0, r6, 0 movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldr r7, =gBattleAnimArgs lsrs r0, 24 @@ -16676,7 +16676,7 @@ _08106E38: strh r0, [r5, 0x20] adds r0, r6, 0 movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r7, 0x4] @@ -17019,13 +17019,13 @@ _081070F8: ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, 0x28 @@ -17204,7 +17204,7 @@ sub_8107260: @ 8107260 beq _08107290 ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldr r4, =gBattleAnimArgs @@ -17215,7 +17215,7 @@ sub_8107260: @ 8107260 _08107290: ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldr r4, =gBattleAnimArgs lsrs r0, 24 @@ -17225,7 +17225,7 @@ _081072A2: strh r0, [r6, 0x20] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r4, [r4, 0x2] @@ -17256,7 +17256,7 @@ _081072D8: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r6, 0x32] @@ -17264,7 +17264,7 @@ _081072D8: strh r0, [r6, 0x34] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r6, 0x36] @@ -17448,7 +17448,7 @@ _08107482: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, r6 @@ -17457,7 +17457,7 @@ _08107482: strh r0, [r5, 0x34] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r7, [r7, 0x6] @@ -17624,7 +17624,7 @@ sub_81075EC: @ 81075EC ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x32] @@ -17632,7 +17632,7 @@ sub_81075EC: @ 81075EC strh r0, [r5, 0x34] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x36] @@ -17776,13 +17776,13 @@ sub_8107730: @ 8107730 ldr r7, =gAnimBankAttacker ldrb r0, [r7] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x20] ldrb r0, [r7] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x22] @@ -17863,12 +17863,12 @@ sub_81077C0: @ 81077C0 negs r0, r0 strh r0, [r4] ldrb r0, [r5] - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 cmp r0, 0 beq _08107802 ldrb r0, [r5] - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -17913,7 +17913,7 @@ _08107842: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r5, 0x4] @@ -17921,7 +17921,7 @@ _08107842: strh r0, [r6, 0x32] ldrb r0, [r4] adds r1, r7, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r5, [r5, 0x6] @@ -19353,13 +19353,13 @@ sub_8108408: @ 8108408 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 mov r8, r0 ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r6, r0, 24 movs r5, 0xAC @@ -19959,14 +19959,14 @@ sub_81088E4: @ 81088E4 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 movs r6, 0 strh r0, [r5, 0xE] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x10] @@ -20421,13 +20421,13 @@ sub_8108C94: @ 8108C94 ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x30] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] @@ -21131,7 +21131,7 @@ sub_8109244: @ 8109244 ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x32] @@ -21139,7 +21139,7 @@ sub_8109244: @ 8109244 strh r0, [r5, 0x34] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x36] @@ -21167,13 +21167,13 @@ sub_810929C: @ 810929C ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r6, 0x20] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r6, 0x22] @@ -22359,7 +22359,7 @@ _08109BCE: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x32] @@ -22367,7 +22367,7 @@ _08109BCE: strh r0, [r5, 0x34] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x36] @@ -23181,13 +23181,13 @@ sub_810A274: @ 810A274 ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -23307,7 +23307,7 @@ _0810A384: bne _0810A3AC adds r0, r4, 0 movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] @@ -23318,14 +23318,14 @@ _0810A384: _0810A3AC: adds r0, r4, 0 movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] adds r0, r4, 0 movs r1, 0x3 _0810A3BE: - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -23420,7 +23420,7 @@ sub_810A46C: @ 810A46C ldr r6, =gAnimBankTarget ldrb r0, [r6] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] @@ -23428,7 +23428,7 @@ sub_810A46C: @ 810A46C strh r0, [r4, 0x34] ldrb r0, [r6] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] @@ -23591,7 +23591,7 @@ _0810A5E0: ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldr r4, =gBattleAnimArgs lsrs r0, 24 @@ -23600,7 +23600,7 @@ _0810A5E0: strh r0, [r6, 0x20] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x4] @@ -23657,7 +23657,7 @@ _0810A666: _0810A66E: adds r0, r6, 0 movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldr r4, =gBattleAnimArgs lsrs r0, 24 @@ -23666,7 +23666,7 @@ _0810A66E: strh r0, [r5, 0x20] adds r0, r6, 0 movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x2] @@ -23830,7 +23830,7 @@ sub_810A7DC: @ 810A7DC ldr r6, =gAnimBankTarget ldrb r0, [r6] movs r1, 0 - bl GetBankPosition + bl GetBankCoord ldr r1, =gTasks lsls r4, r5, 2 adds r4, r5 @@ -23844,7 +23844,7 @@ sub_810A7DC: @ 810A7DC strh r0, [r4, 0x8] ldrb r0, [r6] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r5, 0x2] @@ -24228,13 +24228,13 @@ _0810AB28: _0810AB2A: ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x24] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x26] @@ -24448,13 +24448,13 @@ _0810ACF4: _0810ACF6: ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -24486,13 +24486,13 @@ _0810AD4C: _0810AD4E: ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -24521,13 +24521,13 @@ sub_810AD98: @ 810AD98 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -24649,7 +24649,7 @@ _0810AE90: ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x24] @@ -24855,13 +24855,13 @@ _0810B012: _0810B048: ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0xE] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x12] @@ -24881,13 +24881,13 @@ _0810B070: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x12] ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 movs r2, 0xA @@ -25127,13 +25127,13 @@ _0810B24E: ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -25194,13 +25194,13 @@ _0810B2DC: ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x14] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x16] @@ -25209,7 +25209,7 @@ _0810B2DC: ldr r0, =gAnimBankTarget ldrb r0, [r0] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x1C] @@ -25542,7 +25542,7 @@ _0810B58A: ldr r0, =gAnimBankTarget ldrb r0, [r0] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, 0x20 @@ -25564,7 +25564,7 @@ _0810B5B4: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -25724,26 +25724,26 @@ sub_810B6C4: @ 810B6C4 ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 mov r9, r0 ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r3, r0, 24 ldrb r0, [r4] movs r1, 0x3 str r3, [sp] - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r6, r0, 24 ldr r1, =gBattleAnimArgs @@ -25979,7 +25979,7 @@ sub_810B8EC: @ 810B8EC ldr r0, =gAnimBankTarget ldrb r0, [r0] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] @@ -26006,7 +26006,7 @@ _0810B936: ldr r0, =gAnimBankTarget ldrb r0, [r0] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldr r1, =gBattleAnimArgs lsrs r0, 24 @@ -26133,13 +26133,13 @@ sub_810BA24: @ 810BA24 ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x32] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r6, [r6, 0x6] @@ -26434,13 +26434,13 @@ sub_810BC94: @ 810BC94 ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x32] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x36] @@ -27182,13 +27182,13 @@ sub_810C2F0: @ 810C2F0 ldr r5, =gAnimBankAttacker ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x20] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x22] @@ -27460,12 +27460,12 @@ sub_810C560: @ 810C560 mov r8, r0 ldrb r0, [r0] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord adds r4, r0, 0 ldr r7, =gAnimBankTarget ldrb r0, [r7] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r4, 24 lsls r0, 24 cmp r4, r0 @@ -27474,7 +27474,7 @@ sub_810C560: @ 810C560 lsls r0, 8 strh r0, [r5, 0x3C] _0810C594: - ldr r3, =gBanksByIdentity + ldr r3, =gBankPositions ldrb r0, [r7] adds r0, r3 ldrb r1, [r0] @@ -27526,13 +27526,13 @@ _0810C5F4: ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -27548,7 +27548,7 @@ _0810C5F4: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r6, 0x6] @@ -27570,7 +27570,7 @@ _0810C65C: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r6, 0x6] @@ -27583,7 +27583,7 @@ _0810C65C: ldrb r0, [r4] movs r1, 0x1 _0810C684: - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r6, [r6, 0x8] @@ -27679,7 +27679,7 @@ _0810C736: ldr r6, =gAnimBankTarget ldrb r0, [r6] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x20] @@ -27699,7 +27699,7 @@ _0810C736: lsls r0, 24 cmp r0, 0 bne _0810C78C - ldr r1, =gBanksByIdentity + ldr r1, =gBankPositions ldrb r0, [r6] adds r0, r1 ldrb r1, [r0] @@ -27843,7 +27843,7 @@ _0810C85A: lsls r0, 24 cmp r0, 0 bne _0810C8B4 - ldr r1, =gBanksByIdentity + ldr r1, =gBankPositions ldr r0, =gAnimBankTarget ldrb r0, [r0] adds r0, r1 @@ -28062,12 +28062,12 @@ sub_810C9E4: @ 810C9E4 str r0, [sp, 0x4] adds r0, r5, 0 movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r7, r0, 24 adds r0, r5, 0 movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r6, r0, 24 mov r1, r8 @@ -28384,7 +28384,7 @@ _0810CCCE: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r6, 0x4] @@ -28392,7 +28392,7 @@ _0810CCCE: strh r0, [r5, 0x32] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r6, 0x6] @@ -28705,13 +28705,13 @@ _0810CF74: bl StartSpriteAnim mov r0, r8 movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] mov r0, r8 movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -28771,7 +28771,7 @@ _0810D000: negs r0, r0 lsrs r4, r0, 16 _0810D012: - ldr r0, =gBanksByIdentity + ldr r0, =gBankPositions add r0, r8 ldrb r1, [r0] adds r0, r7, 0 @@ -28983,7 +28983,7 @@ sub_810D1B4: @ 810D1B4 cmp r0, r1 bne _0810D1E0 ldrb r0, [r2] - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -29149,13 +29149,13 @@ sub_810D308: @ 810D308 ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x32] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x36] @@ -29275,13 +29275,13 @@ _0810D428: _0810D42A: ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -29389,7 +29389,7 @@ sub_810D4F4: @ 810D4F4 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r2, [r6, 0x4] @@ -29400,7 +29400,7 @@ _0810D520: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r6, 0x4] @@ -29409,7 +29409,7 @@ _0810D532: strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r6, [r6, 0x6] @@ -29523,13 +29523,13 @@ sub_810D608: @ 810D608 ldr r4, =gBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -29601,7 +29601,7 @@ sub_810D6A8: @ 810D6A8 lsls r0, 24 lsrs r0, 24 movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] @@ -29611,7 +29611,7 @@ sub_810D6A8: @ 810D6A8 lsls r0, 24 lsrs r0, 24 movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] @@ -29715,13 +29715,13 @@ _0810D7C2: ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord adds r6, r0, 0 lsls r6, 24 lsrs r6, 24 ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 @@ -29729,14 +29729,14 @@ _0810D7C2: mov r8, r2 ldrb r0, [r2] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 mov r1, r8 ldrb r0, [r1] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 subs r4, r6 strh r4, [r7, 0x2E] @@ -29811,13 +29811,13 @@ sub_810D874: @ 810D874 ldr r4, =gBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -29879,7 +29879,7 @@ _0810D918: strh r0, [r5, 0x30] adds r0, r4, 0 movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x32] @@ -29887,7 +29887,7 @@ _0810D918: strh r0, [r5, 0x34] adds r0, r4, 0 movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x36] @@ -29932,13 +29932,13 @@ sub_810D984: @ 810D984 ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -30208,13 +30208,13 @@ _0810DBC2: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x32] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x36] @@ -30699,7 +30699,7 @@ _0810DFC8: ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x4] @@ -30709,7 +30709,7 @@ _0810DFC8: strh r0, [r6, 0x34] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r4, [r4, 0x6] @@ -30782,13 +30782,13 @@ _0810E070: _0810E088: ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldr r2, =gBattleAnimArgs ldrh r1, [r2] @@ -30808,13 +30808,13 @@ _0810E088: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x32] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x36] @@ -30958,7 +30958,7 @@ _0810E1FE: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x32] @@ -30966,7 +30966,7 @@ _0810E1FE: strh r0, [r5, 0x34] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x36] @@ -31118,7 +31118,7 @@ _0810E33E: _0810E354: adds r0, r6, 0 movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldr r4, =gBattleAnimArgs lsrs r0, 24 @@ -31127,7 +31127,7 @@ _0810E354: strh r0, [r7, 0x20] adds r0, r6, 0 movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldrh r1, [r4, 0x2] lsrs r0, 24 @@ -32064,13 +32064,13 @@ sub_810EA4C: @ 810EA4C ldr r5, =gAnimBankAttacker ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x20] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x22] @@ -32240,13 +32240,13 @@ sub_810EB88: @ 810EB88 ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 @@ -32344,7 +32344,7 @@ _0810ECB0: ldr r0, =gAnimBankTarget ldrb r0, [r0] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x22] @@ -32553,13 +32553,13 @@ _0810EE40: _0810EE42: ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -32708,13 +32708,13 @@ _0810EF74: _0810EF76: ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, 0x20 @@ -32864,14 +32864,14 @@ sub_810F084: @ 810F084 ldr r6, =gAnimBankAttacker ldrb r0, [r6] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 mov r1, r8 strh r0, [r1, 0x20] ldrb r0, [r6] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord adds r6, r0, 0 lsls r6, 24 lsrs r6, 24 @@ -33139,7 +33139,7 @@ _0810F2B8: _0810F2CE: ldrb r0, [r6] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldr r4, =gBattleAnimArgs lsrs r0, 24 @@ -33148,7 +33148,7 @@ _0810F2CE: strh r0, [r5, 0x20] ldrb r0, [r6] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r4, [r4, 0x2] @@ -33571,13 +33571,13 @@ sub_810F634: @ 810F634 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -33656,14 +33656,14 @@ sub_810F6B0: @ 810F6B0 _0810F6F6: ldrb r0, [r6] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, r4 strh r0, [r5, 0x20] ldrb r0, [r6] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, r7 @@ -33955,13 +33955,13 @@ sub_810F940: @ 810F940 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x24] @@ -34263,13 +34263,13 @@ sub_810FBA8: @ 810FBA8 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -35065,13 +35065,13 @@ _08110260: ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -35254,7 +35254,7 @@ _081103C4: strh r0, [r6, 0x2E] ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x4] @@ -35262,7 +35262,7 @@ _081103C4: strh r0, [r6, 0x32] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r4, [r4, 0x6] @@ -35333,13 +35333,13 @@ _08110478: strh r0, [r6, 0x2E] ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r6, 0x32] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r6, 0x36] @@ -35387,13 +35387,13 @@ _08110500: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x32] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x36] @@ -35688,12 +35688,12 @@ _08110762: cmp r4, r0 bne _081107B2 ldrb r0, [r5] - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 cmp r0, 0 beq _081107A0 ldrb r0, [r5] - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 @@ -35715,7 +35715,7 @@ _081107B2: ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord adds r4, r0, 0 lsls r4, 24 ldr r6, =gBattleAnimArgs @@ -35726,7 +35726,7 @@ _081107B2: lsrs r4, 16 ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -35797,7 +35797,7 @@ _08110870: ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x4] @@ -35805,7 +35805,7 @@ _08110870: strh r0, [r6, 0x32] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x6] @@ -35949,13 +35949,13 @@ _081109B0: _081109B2: ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, 0x12 @@ -36623,13 +36623,13 @@ sub_8110F74: @ 8110F74 ldr r5, =gAnimBankAttacker ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 mov r9, r0 ldrb r0, [r5] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 8 movs r1, 0xC0 @@ -36639,13 +36639,13 @@ sub_8110F74: @ 8110F74 ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 mov r10, r0 ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 8 movs r2, 0xC0 @@ -37219,13 +37219,13 @@ sub_8111444: @ 8111444 ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x20] ldrb r0, [r5] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldr r2, =gBattleAnimArgs @@ -37446,7 +37446,7 @@ sub_811160C: @ 811160C ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] @@ -37454,7 +37454,7 @@ sub_811160C: @ 811160C strh r0, [r4, 0x34] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] @@ -37929,7 +37929,7 @@ sub_81119E0: @ 81119E0 mov r8, r0 ldrb r0, [r0] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 movs r1, 0 @@ -37938,7 +37938,7 @@ sub_81119E0: @ 81119E0 mov r1, r8 ldrb r0, [r1] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x22] @@ -38045,13 +38045,13 @@ _08111AD2: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x30] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x32] @@ -38107,13 +38107,13 @@ _08111B3C: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -38982,12 +38982,12 @@ sub_8112264: @ 8112264 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r6, r0, 24 ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 8 movs r2, 0xE0 @@ -39001,12 +39001,12 @@ _081122AC: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r6, r0, 24 ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 8 movs r2, 0xE0 @@ -39017,13 +39017,13 @@ _081122AC: _081122D0: ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 mov r10, r0 ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 8 movs r1, 0xE0 @@ -39169,7 +39169,7 @@ sub_81123C4: @ 81123C4 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x4] @@ -39221,7 +39221,7 @@ _08112436: beq _08112502 adds r0, r4, 0 movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 mov r10, r0 @@ -40198,7 +40198,7 @@ sub_8112C6C: @ 8112C6C ldr r5, =gAnimBankAttacker ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x1A] @@ -40682,13 +40682,13 @@ sub_8113064: @ 8113064 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -40755,13 +40755,13 @@ sub_8113100: @ 8113100 ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x32] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x36] @@ -40842,13 +40842,13 @@ _081131D0: _081131D2: ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -40901,14 +40901,14 @@ sub_8113250: @ 8113250 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 movs r5, 0 strh r0, [r6, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r6, 0x22] @@ -41358,14 +41358,14 @@ sub_81135EC: @ 81135EC mov r8, r1 ldrb r0, [r1] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x20] mov r2, r8 ldrb r0, [r2] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r3, [r5, 0x8] @@ -41693,26 +41693,26 @@ sub_81138D4: @ 81138D4 ldr r6, =gAnimBankTarget ldrb r0, [r6] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x30] ldr r5, =gAnimBankAttacker ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] ldrb r0, [r6] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x34] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] @@ -42057,7 +42057,7 @@ sub_8113BAC: @ 8113BAC ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, 0x1F @@ -42076,7 +42076,7 @@ sub_8113BAC: @ 8113BAC strh r1, [r5, 0x22] ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r1, r0, 0 @@ -42475,7 +42475,7 @@ _08113F84: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, 0x1F @@ -42492,7 +42492,7 @@ _08113F84: strh r1, [r5, 0x22] ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 subs r1, r0, 0x4 @@ -43204,13 +43204,13 @@ _0811455C: bne _081145D6 ldr r4, =gAnimBankAttacker ldrb r0, [r4] - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 beq _0811458C ldrb r0, [r4] - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 cmp r0, 0 bne _081145D6 @@ -43658,13 +43658,13 @@ sub_8114994: @ 8114994 ldr r5, =gAnimBankAttacker ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x20] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x22] @@ -43673,13 +43673,13 @@ sub_8114994: @ 8114994 ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] @@ -43719,13 +43719,13 @@ sub_81149FC: @ 81149FC ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x32] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x36] @@ -43781,7 +43781,7 @@ _08114A9C: ldr r5, =gAnimBankTarget ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x4] @@ -43789,7 +43789,7 @@ _08114A9C: strh r0, [r6, 0x32] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r4, [r4, 0x6] @@ -43893,7 +43893,7 @@ sub_8114B80: @ 8114B80 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r2, [r6, 0x2] @@ -43901,7 +43901,7 @@ sub_8114B80: @ 8114B80 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r3, [r6, 0x4] @@ -44657,7 +44657,7 @@ _081151BE: _081151DA: adds r0, r4, 0 movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, r6 @@ -44723,7 +44723,7 @@ _08115262: ldrb r5, [r0] adds r0, r5, 0 movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldr r2, =0x0000fff0 @@ -45244,7 +45244,7 @@ _0811565A: adds r4, r0 adds r0, r5, 0 movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 movs r1, 0x20 @@ -45255,7 +45255,7 @@ _0811565A: strh r1, [r4, 0xA] adds r0, r5, 0 movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 movs r1, 0x40 @@ -47869,13 +47869,13 @@ _08116BA2: bne _08116C26 ldr r5, =gAnimBankAttacker ldrb r0, [r5] - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 beq _08116BD2 ldrb r0, [r5] - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 cmp r0, 0 bne _08116C26 @@ -48306,14 +48306,14 @@ _08116FBA: cmp r0, 0 bne _08117036 ldrb r0, [r1] - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 beq _08116FEC ldr r0, [r4] ldrb r0, [r0] - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 cmp r0, 0 bne _08117036 diff --git a/asm/battle_anim_815A0D4.s b/asm/battle_anim_815A0D4.s index d583f1e85..111dfb1b2 100755 --- a/asm/battle_anim_815A0D4.s +++ b/asm/battle_anim_815A0D4.s @@ -90,7 +90,7 @@ sub_815A160: @ 815A160 ldr r6, =gAnimBankTarget ldrb r0, [r6] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord adds r4, r0, 0 lsls r4, 24 lsrs r4, 8 @@ -100,7 +100,7 @@ sub_815A160: @ 815A160 asrs r4, 16 ldrb r0, [r6] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord adds r1, r0, 0 lsls r1, 24 lsrs r1, 8 @@ -210,13 +210,13 @@ sub_815A254: @ 815A254 ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r7, r0, 0 ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r6, r0, 0 @@ -1254,13 +1254,13 @@ sub_815AAA4: @ 815AAA4 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -1510,7 +1510,7 @@ _0815ACEC: _0815ACEE: ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r6, [r6, 0x2] @@ -1518,7 +1518,7 @@ _0815ACEE: strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -1906,13 +1906,13 @@ sub_815AFF0: @ 815AFF0 ldr r6, =gAnimBankAttacker ldrb r0, [r6] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0xC] ldrb r0, [r6] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0xE] @@ -2281,13 +2281,13 @@ _0815B2D8: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x32] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x36] @@ -2373,13 +2373,13 @@ _0815B3BE: ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -2817,7 +2817,7 @@ _0815B71E: ldr r0, =gAnimBankAttacker ldrb r0, [r0] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] @@ -3020,7 +3020,7 @@ _0815B8A8: .pool _0815B8E0: ldrb r0, [r5] - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 lsrs r1, r0, 24 _0815B8EA: @@ -3624,14 +3624,14 @@ _0815BE2E: ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, r5 strh r0, [r7, 0x20] ldrb r0, [r4] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, 0x20 @@ -3998,7 +3998,7 @@ _0815C124: _0815C15C: ldr r0, =gAnimBankTarget ldrb r0, [r0] - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 lsrs r4, r0, 24 bl IsDoubleBattle @@ -4994,13 +4994,13 @@ sub_815C95C: @ 815C95C ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -5531,13 +5531,13 @@ sub_815CDB4: @ 815CDB4 ldr r5, =gAnimBankAttacker ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x20] ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x22] @@ -5842,13 +5842,13 @@ _0815D05A: ldr r5, =gAnimBankAttacker ldrb r0, [r5] movs r1, 0 - bl GetBankPosition + bl GetBankCoord adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldrb r0, [r5] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 mov r2, r10 lsls r1, r2, 16 @@ -6840,7 +6840,7 @@ _0815D896: ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r6, 0x2] @@ -6848,7 +6848,7 @@ _0815D896: strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r6, [r6, 0x4] @@ -7382,13 +7382,13 @@ _0815DCEA: ldrb r4, [r0] adds r0, r4, 0 movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x10] adds r0, r4, 0 movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x12] @@ -7789,7 +7789,7 @@ sub_815E01C: @ 815E01C _0815E038: ldrb r0, [r6] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldr r4, =gBattleAnimArgs lsrs r0, 24 @@ -7798,7 +7798,7 @@ _0815E038: strh r0, [r5, 0x20] ldrb r0, [r6] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x2] @@ -7931,7 +7931,7 @@ _0815E14E: bne _0815E188 ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord adds r4, r0, 0 ldrb r0, [r5] movs r1, 0 @@ -7951,7 +7951,7 @@ _0815E17C: _0815E188: ldrb r0, [r5] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord adds r4, r0, 0 ldrb r0, [r5] movs r1, 0 @@ -7971,7 +7971,7 @@ _0815E1AC: ldr r5, =gAnimBankAttacker ldrb r0, [r5] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord adds r4, r0, 0 ldrb r0, [r5] movs r1, 0 @@ -7990,13 +7990,13 @@ _0815E1D0: ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r6, 0x22] ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r6, 0x24] @@ -8349,14 +8349,14 @@ sub_815E47C: @ 815E47C mov r10, r0 ldrb r0, [r0] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r7, 0x1E] mov r1, r10 ldrb r0, [r1] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r7, 0x20] @@ -8364,14 +8364,14 @@ sub_815E47C: @ 815E47C mov r8, r0 ldrb r0, [r0] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r7, 0x22] mov r1, r8 ldrb r0, [r1] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord adds r4, r0, 0 mov r1, r8 ldrb r0, [r1] @@ -8659,7 +8659,7 @@ _0815E724: strh r1, [r4, 0x3C] adds r0, r5, 0 movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x22] @@ -8950,7 +8950,7 @@ _0815E970: _0815E972: ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] @@ -9342,7 +9342,7 @@ sub_815EC48: @ 815EC48 ldr r5, =gAnimBankAttacker ldrb r0, [r5] movs r1, 0 - bl GetBankPosition + bl GetBankCoord adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 @@ -9350,7 +9350,7 @@ sub_815EC48: @ 815EC48 movs r0, 0x2 eors r0, r1 movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 cmp r4, r0 @@ -9771,14 +9771,14 @@ _0815EFEC: lsls r0, 24 lsrs r0, 24 movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r5, r0, 24 ldrh r0, [r4, 0x3C] lsls r0, 24 lsrs r0, 24 movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r1, r0, 24 _0815F00C: @@ -9994,10 +9994,10 @@ sub_815F18C: @ 815F18C ldr r4, =gAnimBankTarget ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord ldrb r0, [r4] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord ldrb r0, [r4] bl GetBankSide lsls r0, 24 @@ -10387,7 +10387,7 @@ _0815F4C8: ldr r0, =gAnimBankTarget ldrb r0, [r0] movs r1, 0x3 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @@ -11180,7 +11180,7 @@ _0815FB50: ldr r0, =gAnimBankTarget ldrb r0, [r0] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 lsls r3, r5, 16 @@ -11318,7 +11318,7 @@ _0815FC56: ldr r0, =gAnimBankTarget ldrb r0, [r0] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 cmp r4, r0 @@ -11331,7 +11331,7 @@ _0815FCB4: ldr r0, =gAnimBankTarget ldrb r0, [r0] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 cmp r4, r0 @@ -11469,7 +11469,7 @@ _0815FD8C: mov r1, r10 ldrb r0, [r1] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r3, r5, 0 @@ -11499,7 +11499,7 @@ _0815FE0C: mov r2, r10 ldrb r0, [r2] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r3, r5, 0 @@ -11566,7 +11566,7 @@ _0815FE92: ldr r0, =gAnimBankTarget ldrb r0, [r0] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r0, 0x10 @@ -11724,14 +11724,14 @@ _08160008: ldr r0, =gAnimBankAttacker ldrb r0, [r0] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r5, r0, 0 ldr r0, =gAnimBankTarget ldrb r0, [r0] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 adds r2, r0, 0 @@ -12169,7 +12169,7 @@ sub_81603A8: @ 81603A8 ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0x2 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] diff --git a/asm/battle_anim_8170478.s b/asm/battle_anim_8170478.s index 635c02e03..a7893ee94 100644 --- a/asm/battle_anim_8170478.s +++ b/asm/battle_anim_8170478.s @@ -907,13 +907,13 @@ _08170C44: ldr r5, =gAnimBankAttacker ldrb r0, [r5] movs r1, 0 - bl GetBankPosition + bl GetBankCoord adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldrb r0, [r5] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord adds r1, r0, 0 lsls r1, 24 ldr r2, =gSprites @@ -1166,14 +1166,14 @@ sub_8170E04: @ 8170E04 mov r8, r2 ldrb r0, [r2] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r6, 0x30] mov r1, r8 ldrb r0, [r1] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 subs r0, 0x10 @@ -1317,14 +1317,14 @@ _08170F54: mov r8, r1 ldrb r0, [r1] movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r6, 0x30] mov r1, r8 ldrb r0, [r1] movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 subs r0, 0x10 @@ -5234,12 +5234,12 @@ _0817303A: ldrb r0, [r4, 0x8] mov r8, r0 movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r5, r0, 24 mov r0, r8 movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r2, r0, 24 movs r1, 0x1E @@ -5579,7 +5579,7 @@ sub_817330C: @ 817330C lsls r0, 24 lsrs r0, 24 movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 ldr r5, =gBattleAnimArgs lsrs r0, 24 @@ -5591,7 +5591,7 @@ sub_817330C: @ 817330C lsls r0, 24 lsrs r0, 24 movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 ldrh r5, [r5, 0x6] diff --git a/asm/battle_link_817C95C.s b/asm/battle_link_817C95C.s index fedb50c45..d656946b4 100644 --- a/asm/battle_link_817C95C.s +++ b/asm/battle_link_817C95C.s @@ -136,18 +136,18 @@ _0817CA4C: _0817CA9C: ldr r0, =gBankAttacker ldrb r0, [r0] - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 lsrs r0, 25 mov r8, r0 ldr r0, =gBankTarget ldrb r0, [r0] - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 lsrs r5, r0, 25 ldr r0, =gEffectBank ldrb r0, [r0] - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 lsrs r3, r0, 25 ldr r1, [sp] @@ -2593,7 +2593,7 @@ _0817E122: _0817E184: mov r2, r10 ldrb r0, [r2] - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 lsrs r0, 25 lsls r0, 3 @@ -2617,7 +2617,7 @@ _0817E184: strb r1, [r0] mov r1, r10 ldrb r0, [r1] - bl GetBankIdentity + bl GetBankPosition lsls r0, 24 lsrs r0, 25 lsls r0, 3 @@ -4414,7 +4414,7 @@ _0817EFC2: ldr r4, =gSideAffecting mov r1, r9 ldrb r0, [r1] - bl GetBankIdentity + bl GetBankPosition movs r1, 0x1 ands r1, r0 lsls r1, 1 diff --git a/asm/contest.s b/asm/contest.s index 3c34965ad..c35a29733 100644 --- a/asm/contest.s +++ b/asm/contest.s @@ -1048,7 +1048,7 @@ _080D8004: bl sub_80DC594 bl sub_80DC5E8 bl sub_80DC7EC - ldr r1, =gBanksByIdentity + ldr r1, =gBankPositions strb r4, [r1] movs r0, 0x1 strb r0, [r1, 0x1] @@ -13829,13 +13829,13 @@ sub_80DEA5C: @ 80DEA5C strh r0, [r4, 0x26] movs r0, 0x3 movs r1, 0 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x20] movs r0, 0x3 movs r1, 0x1 - bl GetBankPosition + bl GetBankCoord lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x22] diff --git a/constants/battle_constants.inc b/constants/battle_constants.inc index 7309d68cd..c48ff0203 100644 --- a/constants/battle_constants.inc +++ b/constants/battle_constants.inc @@ -45,10 +45,10 @@ .set OPPONENT_TELEPORTED, 0xA @ identities - .set IDENTITY_PLAYER_MON1, 0 - .set IDENTITY_OPPONENT_MON1, 1 - .set IDENTITY_PLAYER_MON2, 2 - .set IDENTITY_OPPONENT_MON2, 3 + .set B_POSITION_PLAYER_LEFT, 0 + .set B_POSITION_OPPONENT_LEFT, 1 + .set B_POSITION_PLAYER_RIGHT, 2 + .set B_POSITION_OPPONENT_RIGHT, 3 @ status 1 .set STATUS_SLEEP, 0x7 diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 27aff5f19..c3750bd88 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -2950,7 +2950,7 @@ BattleScript_LocalBattleWonLoseTexts:: waitstate printstring STRINGID_TRAINER1LOSETEXT jumpifnotbattletype BATTLE_TYPE_TWO_OPPONENTS, BattleScript_LocalBattleWonReward - trainerslideout IDENTITY_OPPONENT_MON1 + trainerslideout B_POSITION_OPPONENT_LEFT waitstate trainerslidein GBANK_1 waitstate @@ -2991,7 +2991,7 @@ BattleScript_LocalBattleLostPrintTrainersWinText:: jumpifbattletype BATTLE_TYPE_x800000, BattleScript_LocalBattleLostDoTrainer2WinText jumpifnotbattletype BATTLE_TYPE_TWO_OPPONENTS, BattleScript_LocalBattleLostEnd_ BattleScript_LocalBattleLostDoTrainer2WinText:: - trainerslideout IDENTITY_OPPONENT_MON1 + trainerslideout B_POSITION_OPPONENT_LEFT waitstate trainerslidein GBANK_1 waitstate @@ -3007,7 +3007,7 @@ BattleScript_82DAA0B:: trainerslidein ATTACKER waitstate printstring STRINGID_TRAINER1WINTEXT - trainerslideout IDENTITY_OPPONENT_MON1 + trainerslideout B_POSITION_OPPONENT_LEFT waitstate trainerslidein GBANK_1 waitstate @@ -3035,7 +3035,7 @@ BattleScript_82DAA5C:: trainerslidein ATTACKER waitstate printstring STRINGID_TRAINER1LOSETEXT - trainerslideout IDENTITY_OPPONENT_MON1 + trainerslideout B_POSITION_OPPONENT_LEFT waitstate trainerslidein GBANK_1 waitstate @@ -3058,7 +3058,7 @@ BattleScript_82DAAAE:: waitstate printstring STRINGID_TRAINER1LOSETEXT jumpifnotbattletype BATTLE_TYPE_TWO_OPPONENTS, BattleScript_82DAACB - trainerslideout IDENTITY_OPPONENT_MON1 + trainerslideout B_POSITION_OPPONENT_LEFT waitstate trainerslidein GBANK_1 waitstate diff --git a/include/battle.h b/include/battle.h index 4fd252676..7b9d8b461 100644 --- a/include/battle.h +++ b/include/battle.h @@ -11,18 +11,33 @@ #include "battle_bg.h" /* - Banks are a name given to what could be called a 'battlerId' or 'monControllerId'. - Each bank has a value consisting of two bits. - 0x1 bit is responsible for the side, 0 = player's side, 1 = opponent's side. - 0x2 bit is responsible for the id of sent out pokemon. 0 means it's the first sent out pokemon, 1 it's the second one. (Triple battle didn't exist at the time yet.) -*/ + * Banks are a name given to what could be called a 'battlerId' or 'monControllerId'. + * A battler may be in one of four positions on the field. The first bit determines + * what side the battler is on, either the player's side or the opponent's side. + * The second bit determines whether the pokemon is on the left or right of the + * given side. Note that the opponent's mons are drawn opposite because the position + * numbers correspond to their perspective. The bank number is usually the same + * as the position, except in the case of link battles. + * + * +---------------------- + + * | Opponent's side:| + * | 3 1 | + * | | + * | | + * |Player's side: | + * | 0 2 | + * ------------------------+ + * | | + * | | + * +-----------------------+ + */ #define BATTLE_BANKS_COUNT 4 -#define IDENTITY_PLAYER_MON1 0 -#define IDENTITY_OPPONENT_MON1 1 -#define IDENTITY_PLAYER_MON2 2 -#define IDENTITY_OPPONENT_MON2 3 +#define B_POSITION_PLAYER_LEFT 0 +#define B_POSITION_OPPONENT_LEFT 1 +#define B_POSITION_PLAYER_RIGHT 2 +#define B_POSITION_OPPONENT_RIGHT 3 #define SIDE_PLAYER 0x0 #define SIDE_OPPONENT 0x1 @@ -30,9 +45,9 @@ #define BIT_SIDE 0x1 #define BIT_MON 0x2 -#define GET_BANK_IDENTITY(bank)((gBanksByIdentity[bank])) -#define GET_BANK_SIDE(bank)((GetBankIdentity(bank) & BIT_SIDE)) -#define GET_BANK_SIDE2(bank)((GET_BANK_IDENTITY(bank) & BIT_SIDE)) +#define GET_BANK_POSITION(bank)((gBankPositions[bank])) +#define GET_BANK_SIDE(bank)((GetBankPosition(bank) & BIT_SIDE)) +#define GET_BANK_SIDE2(bank)((GET_BANK_POSITION(bank) & BIT_SIDE)) #define BATTLE_TYPE_DOUBLE 0x0001 #define BATTLE_TYPE_LINK 0x0002 @@ -66,6 +81,8 @@ #define BATTLE_TYPE_KYOGRE 0x20000000 #define BATTLE_TYPE_RAYQUAZA 0x40000000 #define BATTLE_TYPE_x80000000 0x80000000 +#define BATTLE_TYPE_FRONTIER (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_PIKE | BATTLE_TYPE_PYRAMID) +#define BATTLE_TYPE_FRONTIER_NO_PYRAMID (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_PIKE) #define TRAINER_OPPONENT_3FE 0x3FE #define TRAINER_OPPONENT_C00 0xC00 @@ -73,9 +90,6 @@ #define STEVEN_PARTNER_ID 0xC03 #define SECRET_BASE_OPPONENT 0x400 -#define BATTLE_TYPE_FRONTIER (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_PIKE | BATTLE_TYPE_PYRAMID) -#define BATTLE_TYPE_FRONTIER_NO_PYRAMID (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_PIKE) - #define BATTLE_WON 0x1 #define BATTLE_LOST 0x2 #define BATTLE_DREW 0x3 @@ -832,7 +846,7 @@ enum // rom_80A5C6C u8 GetBankSide(u8 bank); -u8 GetBankIdentity(u8 bank); +u8 GetBankPosition(u8 bank); u8 GetBankByIdentity(u8 bank); struct BattleSpriteInfo diff --git a/include/battle_anim.h b/include/battle_anim.h index 4046f7051..c208ee1a7 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -85,7 +85,7 @@ enum BANK_Y_POS, }; -u8 GetBankPosition(u8 bank, u8 attributeId); +u8 GetBankCoord(u8 bank, u8 attributeId); bool8 IsBankSpritePresent(u8 bank); void sub_80A6C68(u8 arg0); diff --git a/src/battle_2.c b/src/battle_2.c index 61e39b39f..78f577fda 100644 --- a/src/battle_2.c +++ b/src/battle_2.c @@ -2517,7 +2517,7 @@ static void sub_8039A48(struct Sprite *sprite) } else { - u8 *dst = (u8 *)gMonSpritesGfxPtr->sprites[GetBankIdentity(sprite->tBank)] + (gBattleMonForms[sprite->tBank] << 11) + (sprite->data[3] << 8); + u8 *dst = (u8 *)gMonSpritesGfxPtr->sprites[GetBankPosition(sprite->tBank)] + (gBattleMonForms[sprite->tBank] << 11) + (sprite->data[3] << 8); for (i = 0; i < 0x100; i++) *(dst++) = 0; @@ -3116,7 +3116,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void) gBattleMons[gActiveBank].status2 = 0; } - if (GetBankIdentity(gActiveBank) == IDENTITY_PLAYER_MON1) + if (GetBankPosition(gActiveBank) == B_POSITION_PLAYER_LEFT) { EmitDrawTrainerPic(0); MarkBufferBankForExecution(gActiveBank); @@ -3124,7 +3124,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void) if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) { - if (GetBankIdentity(gActiveBank) == IDENTITY_OPPONENT_MON1) + if (GetBankPosition(gActiveBank) == B_POSITION_OPPONENT_LEFT) { EmitDrawTrainerPic(0); MarkBufferBankForExecution(gActiveBank); @@ -3159,15 +3159,15 @@ static void BattleIntroDrawTrainersOrMonsSprites(void) if (gBattleTypeFlags & BATTLE_TYPE_MULTI) { - if (GetBankIdentity(gActiveBank) == IDENTITY_PLAYER_MON2 - || GetBankIdentity(gActiveBank) == IDENTITY_OPPONENT_MON2) + if (GetBankPosition(gActiveBank) == B_POSITION_PLAYER_RIGHT + || GetBankPosition(gActiveBank) == B_POSITION_OPPONENT_RIGHT) { EmitDrawTrainerPic(0); MarkBufferBankForExecution(gActiveBank); } } - if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS && GetBankIdentity(gActiveBank) == IDENTITY_OPPONENT_MON2) + if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS && GetBankPosition(gActiveBank) == B_POSITION_OPPONENT_RIGHT) { EmitDrawTrainerPic(0); MarkBufferBankForExecution(gActiveBank); @@ -3203,7 +3203,7 @@ static void BattleIntroDrawPartySummaryScreens(void) hpStatus[i].status = GetMonData(&gEnemyParty[i], MON_DATA_STATUS); } } - gActiveBank = GetBankByIdentity(IDENTITY_OPPONENT_MON1); + gActiveBank = GetBankByIdentity(B_POSITION_OPPONENT_LEFT); EmitDrawPartyStatusSummary(0, hpStatus, 0x80); MarkBufferBankForExecution(gActiveBank); @@ -3221,7 +3221,7 @@ static void BattleIntroDrawPartySummaryScreens(void) hpStatus[i].status = GetMonData(&gPlayerParty[i], MON_DATA_STATUS); } } - gActiveBank = GetBankByIdentity(IDENTITY_PLAYER_MON1); + gActiveBank = GetBankByIdentity(B_POSITION_PLAYER_LEFT); EmitDrawPartyStatusSummary(0, hpStatus, 0x80); MarkBufferBankForExecution(gActiveBank); @@ -3257,7 +3257,7 @@ static void BattleIntroPrintTrainerWantsToBattle(void) { if (gBattleExecBuffer == 0) { - gActiveBank = GetBankByIdentity(IDENTITY_OPPONENT_MON1); + gActiveBank = GetBankByIdentity(B_POSITION_OPPONENT_LEFT); PrepareStringBattle(STRINGID_INTROMSG, gActiveBank); gBattleMainFunc = BattleIntroPrintOpponentSendsOut; } @@ -3280,16 +3280,16 @@ static void BattleIntroPrintOpponentSendsOut(void) return; if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) - identity = IDENTITY_OPPONENT_MON1; + identity = B_POSITION_OPPONENT_LEFT; else if (gBattleTypeFlags & BATTLE_TYPE_x2000000) { if (gBattleTypeFlags & BATTLE_TYPE_x80000000) - identity = IDENTITY_OPPONENT_MON1; + identity = B_POSITION_OPPONENT_LEFT; else - identity = IDENTITY_PLAYER_MON1; + identity = B_POSITION_PLAYER_LEFT; } else - identity = IDENTITY_OPPONENT_MON1; + identity = B_POSITION_OPPONENT_LEFT; PrepareStringBattle(STRINGID_INTROSENDOUT, GetBankByIdentity(identity)); gBattleMainFunc = BattleIntroOpponent1SendsOutMonAnimation; @@ -3300,20 +3300,20 @@ static void BattleIntroOpponent2SendsOutMonAnimation(void) u32 identity; if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) - identity = IDENTITY_OPPONENT_MON2; + identity = B_POSITION_OPPONENT_RIGHT; else if (gBattleTypeFlags & BATTLE_TYPE_x2000000) { if (gBattleTypeFlags & BATTLE_TYPE_x80000000) - identity = IDENTITY_OPPONENT_MON2; + identity = B_POSITION_OPPONENT_RIGHT; else - identity = IDENTITY_PLAYER_MON2; + identity = B_POSITION_PLAYER_RIGHT; } else - identity = IDENTITY_OPPONENT_MON2; + identity = B_POSITION_OPPONENT_RIGHT; for (gActiveBank = 0; gActiveBank < gNoOfAllBanks; gActiveBank++) { - if (GetBankIdentity(gActiveBank) == identity) + if (GetBankPosition(gActiveBank) == identity) { EmitIntroTrainerBallThrow(0); MarkBufferBankForExecution(gActiveBank); @@ -3329,23 +3329,23 @@ static void BattleIntroOpponent1SendsOutMonAnimation(void) u32 identity; if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) - identity = IDENTITY_OPPONENT_MON1; + identity = B_POSITION_OPPONENT_LEFT; else if (gBattleTypeFlags & BATTLE_TYPE_x2000000) { if (gBattleTypeFlags & BATTLE_TYPE_x80000000) - identity = IDENTITY_OPPONENT_MON1; + identity = B_POSITION_OPPONENT_LEFT; else - identity = IDENTITY_PLAYER_MON1; + identity = B_POSITION_PLAYER_LEFT; } else - identity = IDENTITY_OPPONENT_MON1; + identity = B_POSITION_OPPONENT_LEFT; if (gBattleExecBuffer) return; for (gActiveBank = 0; gActiveBank < gNoOfAllBanks; gActiveBank++) { - if (GetBankIdentity(gActiveBank) == identity) + if (GetBankPosition(gActiveBank) == identity) { EmitIntroTrainerBallThrow(0); MarkBufferBankForExecution(gActiveBank); @@ -3408,7 +3408,7 @@ _0803B29A:\n\ adds r6, r4, 0\n\ _0803B2B2:\n\ ldrb r0, [r4]\n\ - bl GetBankIdentity\n\ + bl GetBankPosition\n\ lsls r0, 24\n\ lsrs r0, 24\n\ cmp r0, r5\n\ @@ -3482,16 +3482,16 @@ static void BattleIntroPrintPlayerSendsOut(void) u8 identity; if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) - identity = IDENTITY_PLAYER_MON1; + identity = B_POSITION_PLAYER_LEFT; else if (gBattleTypeFlags & BATTLE_TYPE_x2000000) { if (gBattleTypeFlags & BATTLE_TYPE_x80000000) - identity = IDENTITY_PLAYER_MON1; + identity = B_POSITION_PLAYER_LEFT; else - identity = IDENTITY_OPPONENT_MON1; + identity = B_POSITION_OPPONENT_LEFT; } else - identity = IDENTITY_PLAYER_MON1; + identity = B_POSITION_PLAYER_LEFT; if (!(gBattleTypeFlags & BATTLE_TYPE_SAFARI)) PrepareStringBattle(STRINGID_INTROSENDOUT, GetBankByIdentity(identity)); @@ -3505,20 +3505,20 @@ static void BattleIntroPlayer2SendsOutMonAnimation(void) u32 identity; if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) - identity = IDENTITY_PLAYER_MON2; + identity = B_POSITION_PLAYER_RIGHT; else if (gBattleTypeFlags & BATTLE_TYPE_x2000000) { if (gBattleTypeFlags & BATTLE_TYPE_x80000000) - identity = IDENTITY_PLAYER_MON2; + identity = B_POSITION_PLAYER_RIGHT; else - identity = IDENTITY_OPPONENT_MON2; + identity = B_POSITION_OPPONENT_RIGHT; } else - identity = IDENTITY_PLAYER_MON2; + identity = B_POSITION_PLAYER_RIGHT; for (gActiveBank = 0; gActiveBank < gNoOfAllBanks; gActiveBank++) { - if (GetBankIdentity(gActiveBank) == identity) + if (GetBankPosition(gActiveBank) == identity) { EmitIntroTrainerBallThrow(0); MarkBufferBankForExecution(gActiveBank); @@ -3537,23 +3537,23 @@ static void BattleIntroPlayer1SendsOutMonAnimation(void) u32 identity; if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) - identity = IDENTITY_PLAYER_MON1; + identity = B_POSITION_PLAYER_LEFT; else if (gBattleTypeFlags & BATTLE_TYPE_x2000000) { if (gBattleTypeFlags & BATTLE_TYPE_x80000000) - identity = IDENTITY_PLAYER_MON1; + identity = B_POSITION_PLAYER_LEFT; else - identity = IDENTITY_OPPONENT_MON1; + identity = B_POSITION_OPPONENT_LEFT; } else - identity = IDENTITY_PLAYER_MON1; + identity = B_POSITION_PLAYER_LEFT; if (gBattleExecBuffer) return; for (gActiveBank = 0; gActiveBank < gNoOfAllBanks; gActiveBank++) { - if (GetBankIdentity(gActiveBank) == identity) + if (GetBankPosition(gActiveBank) == identity) { EmitIntroTrainerBallThrow(0); MarkBufferBankForExecution(gActiveBank); @@ -3891,7 +3891,7 @@ static void HandleTurnActionSelectionState(void) gBattleCommunication[ACTIONS_CONFIRMED_COUNT] = 0; for (gActiveBank = 0; gActiveBank < gNoOfAllBanks; gActiveBank++) { - u8 identity = GetBankIdentity(gActiveBank); + u8 identity = GetBankPosition(gActiveBank); switch (gBattleCommunication[gActiveBank]) { case STATE_TURN_START_RECORD: // recorded battle related on start of every turn @@ -4041,38 +4041,38 @@ static void HandleTurnActionSelectionState(void) break; case ACTION_CANCEL_PARTNER: gBattleCommunication[gActiveBank] = 7; - gBattleCommunication[GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON)] = 1; + gBattleCommunication[GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_MON)] = 1; RecordedBattle_ClearBankAction(gActiveBank, 1); - if (gBattleMons[GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON)].status2 & STATUS2_MULTIPLETURNS - || gBattleMons[GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON)].status2 & STATUS2_RECHARGE) + if (gBattleMons[GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_MON)].status2 & STATUS2_MULTIPLETURNS + || gBattleMons[GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_MON)].status2 & STATUS2_RECHARGE) { EmitCmd50(0); MarkBufferBankForExecution(gActiveBank); return; } - else if (gActionForBanks[GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON)] == ACTION_SWITCH) + else if (gActionForBanks[GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_MON)] == ACTION_SWITCH) { - RecordedBattle_ClearBankAction(GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON), 2); + RecordedBattle_ClearBankAction(GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_MON), 2); } - else if (gActionForBanks[GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON)] == ACTION_RUN) + else if (gActionForBanks[GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_MON)] == ACTION_RUN) { - RecordedBattle_ClearBankAction(GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON), 1); + RecordedBattle_ClearBankAction(GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_MON), 1); } - else if (gActionForBanks[GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON)] == ACTION_USE_MOVE - && (gProtectStructs[GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON)].onlyStruggle - || gDisableStructs[GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON)].encoredMove)) + else if (gActionForBanks[GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_MON)] == ACTION_USE_MOVE + && (gProtectStructs[GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_MON)].onlyStruggle + || gDisableStructs[GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_MON)].encoredMove)) { - RecordedBattle_ClearBankAction(GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON), 1); + RecordedBattle_ClearBankAction(GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_MON), 1); } else if (gBattleTypeFlags & BATTLE_TYPE_PALACE - && gActionForBanks[GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON)] == ACTION_USE_MOVE) + && gActionForBanks[GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_MON)] == ACTION_USE_MOVE) { gRngValue = gBattlePalaceMoveSelectionRngValue; - RecordedBattle_ClearBankAction(GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON), 1); + RecordedBattle_ClearBankAction(GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_MON), 1); } else { - RecordedBattle_ClearBankAction(GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON), 3); + RecordedBattle_ClearBankAction(GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_MON), 3); } EmitCmd50(0); MarkBufferBankForExecution(gActiveBank); @@ -4727,7 +4727,7 @@ static void HandleEndTurn_BattleWon(void) { gSpecialVar_Result = gBattleOutcome; gBattleTextBuff1[0] = gBattleOutcome; - gBankAttacker = GetBankByIdentity(IDENTITY_PLAYER_MON1); + gBankAttacker = GetBankByIdentity(B_POSITION_PLAYER_LEFT); gBattlescriptCurrInstr = BattleScript_LinkBattleWonOrLost; gBattleOutcome &= ~(OUTCOME_LINK_BATTLE_RUN); } @@ -4800,7 +4800,7 @@ static void HandleEndTurn_BattleLost(void) else { gBattleTextBuff1[0] = gBattleOutcome; - gBankAttacker = GetBankByIdentity(IDENTITY_PLAYER_MON1); + gBankAttacker = GetBankByIdentity(B_POSITION_PLAYER_LEFT); gBattlescriptCurrInstr = BattleScript_LinkBattleWonOrLost; gBattleOutcome &= ~(OUTCOME_LINK_BATTLE_RUN); } @@ -5127,16 +5127,16 @@ static void HandleAction_UseMove(void) if (GetBankSide(gBankAttacker) == SIDE_PLAYER) { if (Random() & 1) - gBankTarget = GetBankByIdentity(IDENTITY_OPPONENT_MON1); + gBankTarget = GetBankByIdentity(B_POSITION_OPPONENT_LEFT); else - gBankTarget = GetBankByIdentity(IDENTITY_OPPONENT_MON2); + gBankTarget = GetBankByIdentity(B_POSITION_OPPONENT_RIGHT); } else { if (Random() & 1) - gBankTarget = GetBankByIdentity(IDENTITY_PLAYER_MON1); + gBankTarget = GetBankByIdentity(B_POSITION_PLAYER_LEFT); else - gBankTarget = GetBankByIdentity(IDENTITY_PLAYER_MON2); + gBankTarget = GetBankByIdentity(B_POSITION_PLAYER_RIGHT); } } else @@ -5148,13 +5148,13 @@ static void HandleAction_UseMove(void) { if (GetBankSide(gBankAttacker) != GetBankSide(gBankTarget)) { - gBankTarget = GetBankByIdentity(GetBankIdentity(gBankTarget) ^ BIT_MON); + gBankTarget = GetBankByIdentity(GetBankPosition(gBankTarget) ^ BIT_MON); } else { - gBankTarget = GetBankByIdentity(GetBankIdentity(gBankAttacker) ^ BIT_SIDE); + gBankTarget = GetBankByIdentity(GetBankPosition(gBankAttacker) ^ BIT_SIDE); if (gAbsentBankFlags & gBitTable[gBankTarget]) - gBankTarget = GetBankByIdentity(GetBankIdentity(gBankTarget) ^ BIT_MON); + gBankTarget = GetBankByIdentity(GetBankPosition(gBankTarget) ^ BIT_MON); } } } @@ -5172,22 +5172,22 @@ static void HandleAction_UseMove(void) if (GetBankSide(gBankAttacker) == SIDE_PLAYER) { if (Random() & 1) - gBankTarget = GetBankByIdentity(IDENTITY_OPPONENT_MON1); + gBankTarget = GetBankByIdentity(B_POSITION_OPPONENT_LEFT); else - gBankTarget = GetBankByIdentity(IDENTITY_OPPONENT_MON2); + gBankTarget = GetBankByIdentity(B_POSITION_OPPONENT_RIGHT); } else { if (Random() & 1) - gBankTarget = GetBankByIdentity(IDENTITY_PLAYER_MON1); + gBankTarget = GetBankByIdentity(B_POSITION_PLAYER_LEFT); else - gBankTarget = GetBankByIdentity(IDENTITY_PLAYER_MON2); + gBankTarget = GetBankByIdentity(B_POSITION_PLAYER_RIGHT); } if (gAbsentBankFlags & gBitTable[gBankTarget] && GetBankSide(gBankAttacker) != GetBankSide(gBankTarget)) { - gBankTarget = GetBankByIdentity(GetBankIdentity(gBankTarget) ^ BIT_MON); + gBankTarget = GetBankByIdentity(GetBankPosition(gBankTarget) ^ BIT_MON); } } else @@ -5197,13 +5197,13 @@ static void HandleAction_UseMove(void) { if (GetBankSide(gBankAttacker) != GetBankSide(gBankTarget)) { - gBankTarget = GetBankByIdentity(GetBankIdentity(gBankTarget) ^ BIT_MON); + gBankTarget = GetBankByIdentity(GetBankPosition(gBankTarget) ^ BIT_MON); } else { - gBankTarget = GetBankByIdentity(GetBankIdentity(gBankAttacker) ^ BIT_SIDE); + gBankTarget = GetBankByIdentity(GetBankPosition(gBankAttacker) ^ BIT_SIDE); if (gAbsentBankFlags & gBitTable[gBankTarget]) - gBankTarget = GetBankByIdentity(GetBankIdentity(gBankTarget) ^ BIT_MON); + gBankTarget = GetBankByIdentity(GetBankPosition(gBankTarget) ^ BIT_MON); } } } diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c index 42cf0595f..a10dab976 100644 --- a/src/battle_ai_script_commands.c +++ b/src/battle_ai_script_commands.c @@ -1316,7 +1316,7 @@ static void BattleAICmd_count_usable_party_mons(void) { u32 identity; bankOnField1 = gBattlePartyID[bank]; - identity = GetBankIdentity(bank) ^ BIT_MON; + identity = GetBankPosition(bank) ^ BIT_MON; bankOnField2 = gBattlePartyID[GetBankByIdentity(identity)]; } else // in singles there's only one bank by side diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index b3fccb17f..092d4a7c7 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -60,7 +60,7 @@ static bool8 ShouldSwitchIfWonderGuard(void) if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) return FALSE; - opposingIdentity = GetBankIdentity(gActiveBank) ^ BIT_SIDE; + opposingIdentity = GetBankPosition(gActiveBank) ^ BIT_SIDE; if (gBattleMons[GetBankByIdentity(opposingIdentity)].ability != ABILITY_WONDER_GUARD) return FALSE; @@ -151,10 +151,10 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { bankIn1 = gActiveBank; - if (gAbsentBankFlags & gBitTable[GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON)]) + if (gAbsentBankFlags & gBitTable[GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_MON)]) bankIn2 = gActiveBank; else - bankIn2 = GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON); + bankIn2 = GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_MON); } else { @@ -273,7 +273,7 @@ static bool8 HasSuperEffectiveMoveAgainstOpponents(bool8 noRng) u8 moveFlags; u16 move; - opposingIdentity = GetBankIdentity(gActiveBank) ^ BIT_SIDE; + opposingIdentity = GetBankPosition(gActiveBank) ^ BIT_SIDE; opposingBank = GetBankByIdentity(opposingIdentity); if (!(gAbsentBankFlags & gBitTable[opposingBank])) @@ -357,10 +357,10 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent) if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { bankIn1 = gActiveBank; - if (gAbsentBankFlags & gBitTable[GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON)]) + if (gAbsentBankFlags & gBitTable[GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_MON)]) bankIn2 = gActiveBank; else - bankIn2 = GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON); + bankIn2 = GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_MON); } else { @@ -468,10 +468,10 @@ static bool8 ShouldSwitch(void) if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { bankIn1 = *activeBankPtr; - if (gAbsentBankFlags & gBitTable[GetBankByIdentity(GetBankIdentity(*activeBankPtr) ^ BIT_MON)]) + if (gAbsentBankFlags & gBitTable[GetBankByIdentity(GetBankPosition(*activeBankPtr) ^ BIT_MON)]) bankIn2 = *activeBankPtr; else - bankIn2 = GetBankByIdentity(GetBankIdentity(*activeBankPtr) ^ BIT_MON); + bankIn2 = GetBankByIdentity(GetBankPosition(*activeBankPtr) ^ BIT_MON); } else { @@ -543,7 +543,7 @@ void AI_TrySwitchOrUseItem(void) u8 bankIn1, bankIn2; s32 firstId; s32 lastId; // + 1 - u8 bankIdentity = GetBankIdentity(gActiveBank); + u8 bankIdentity = GetBankPosition(gActiveBank); if (GetBankSide(gActiveBank) == SIDE_PLAYER) party = gPlayerParty; @@ -659,10 +659,10 @@ u8 GetMostSuitableMonToSwitchInto(void) if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { bankIn1 = gActiveBank; - if (gAbsentBankFlags & gBitTable[GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON)]) + if (gAbsentBankFlags & gBitTable[GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_MON)]) bankIn2 = gActiveBank; else - bankIn2 = GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_MON); + bankIn2 = GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_MON); // UB: It considers the opponent only player's side even though it can battle alongside player; opposingBank = Random() & BIT_MON; @@ -671,7 +671,7 @@ u8 GetMostSuitableMonToSwitchInto(void) } else { - opposingBank = GetBankByIdentity(GetBankIdentity(gActiveBank) ^ BIT_SIDE); + opposingBank = GetBankByIdentity(GetBankPosition(gActiveBank) ^ BIT_SIDE); bankIn1 = gActiveBank; bankIn2 = gActiveBank; } @@ -817,7 +817,7 @@ static bool8 ShouldUseItem(void) u8 validMons = 0; bool8 shouldUse = FALSE; - if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && GetBankIdentity(gActiveBank) == IDENTITY_PLAYER_MON2) + if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && GetBankPosition(gActiveBank) == B_POSITION_PLAYER_RIGHT) return FALSE; if (GetBankSide(gActiveBank) == SIDE_PLAYER) diff --git a/src/battle_anim.c b/src/battle_anim.c index d991a702d..ecaff67a8 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -424,7 +424,7 @@ static void ScriptCmd_createsprite(void) if (subpriority < 3) subpriority = 3; - CreateSpriteAndAnimate(template, GetBankPosition(gAnimBankTarget, 2), GetBankPosition(gAnimBankTarget, 3), subpriority); + CreateSpriteAndAnimate(template, GetBankCoord(gAnimBankTarget, 2), GetBankCoord(gAnimBankTarget, 3), subpriority); gAnimVisualTaskCount++; } @@ -613,8 +613,8 @@ static void ScriptCmd_monbg(void) if (IsAnimBankSpriteVisible(bank)) { - u8 identity = GetBankIdentity(bank); - if (identity == IDENTITY_OPPONENT_MON1 || identity == IDENTITY_PLAYER_MON2 || IsContest()) + u8 identity = GetBankPosition(bank); + if (identity == B_POSITION_OPPONENT_LEFT || identity == B_POSITION_PLAYER_RIGHT || IsContest()) toBG_2 = FALSE; else toBG_2 = TRUE; @@ -632,8 +632,8 @@ static void ScriptCmd_monbg(void) bank ^= BIT_MON; if (IsAnimBankSpriteVisible(bank)) { - u8 identity = GetBankIdentity(bank); - if (identity == IDENTITY_OPPONENT_MON1 || identity == IDENTITY_PLAYER_MON2 || IsContest()) + u8 identity = GetBankPosition(bank); + if (identity == B_POSITION_OPPONENT_LEFT || identity == B_POSITION_PLAYER_RIGHT || IsContest()) toBG_2 = FALSE; else toBG_2 = TRUE; @@ -718,7 +718,7 @@ void sub_80A438C(u8 bank, bool8 toBG_2, bool8 setSpriteInvisible) if (IsContest()) bankIdentity = 0; else - bankIdentity = GetBankIdentity(bank); + bankIdentity = GetBankPosition(bank); sub_8118FBC(1, 0, 0, bankIdentity, unknownStruct.unk8, unknownStruct.unk0, unknownStruct.unk4, unknownStruct.unkA); @@ -750,7 +750,7 @@ void sub_80A438C(u8 bank, bool8 toBG_2, bool8 setSpriteInvisible) LoadPalette(&gPlttBufferUnfaded[0x100 + bank * 16], 0x90, 0x20); CpuCopy32(&gPlttBufferUnfaded[0x100 + bank * 16], (void*)(BG_PLTT + 0x120), 0x20); - sub_8118FBC(2, 0, 0, GetBankIdentity(bank), unknownStruct.unk8, unknownStruct.unk0 + 0x1000, unknownStruct.unk4 + 0x400, unknownStruct.unkA); + sub_8118FBC(2, 0, 0, GetBankPosition(bank), unknownStruct.unk8, unknownStruct.unk0 + 0x1000, unknownStruct.unk4 + 0x400, unknownStruct.unkA); } } @@ -893,8 +893,8 @@ static void sub_80A4980(u8 taskId) if (gTasks[taskId].data[1] != 1) { u8 to_BG2; - u8 identity = GetBankIdentity(gTasks[taskId].data[2]); - if (identity == IDENTITY_OPPONENT_MON1 || identity == IDENTITY_PLAYER_MON2 || IsContest()) + u8 identity = GetBankPosition(gTasks[taskId].data[2]); + if (identity == B_POSITION_OPPONENT_LEFT || identity == B_POSITION_PLAYER_RIGHT || IsContest()) to_BG2 = FALSE; else to_BG2 = TRUE; @@ -937,8 +937,8 @@ static void ScriptCmd_monbg_22(void) if (IsAnimBankSpriteVisible(bank)) { - u8 identity = GetBankIdentity(bank); - if (identity == IDENTITY_OPPONENT_MON1 || identity == IDENTITY_PLAYER_MON2 || IsContest()) + u8 identity = GetBankPosition(bank); + if (identity == B_POSITION_OPPONENT_LEFT || identity == B_POSITION_PLAYER_RIGHT || IsContest()) toBG_2 = FALSE; else toBG_2 = TRUE; @@ -949,8 +949,8 @@ static void ScriptCmd_monbg_22(void) bank ^= BIT_MON; if (animBankId > 1 && IsAnimBankSpriteVisible(bank)) { - u8 identity = GetBankIdentity(bank); - if (identity == IDENTITY_OPPONENT_MON1 || identity == IDENTITY_PLAYER_MON2 || IsContest()) + u8 identity = GetBankPosition(bank); + if (identity == B_POSITION_OPPONENT_LEFT || identity == B_POSITION_PLAYER_RIGHT || IsContest()) toBG_2 = FALSE; else toBG_2 = TRUE; @@ -1001,8 +1001,8 @@ static void sub_80A4BB0(u8 taskId) { bool8 toBG_2; u8 bank = gTasks[taskId].data[2]; - u8 identity = GetBankIdentity(bank); - if (identity == IDENTITY_OPPONENT_MON1 || identity == IDENTITY_PLAYER_MON2 || IsContest()) + u8 identity = GetBankPosition(bank); + if (identity == B_POSITION_OPPONENT_LEFT || identity == B_POSITION_PLAYER_RIGHT || IsContest()) toBG_2 = FALSE; else toBG_2 = TRUE; @@ -1705,8 +1705,8 @@ static void ScriptCmd_monbgprio_28(void) else bank = gAnimBankAttacker; - bankIdentity = GetBankIdentity(bank); - if (!IsContest() && (bankIdentity == IDENTITY_PLAYER_MON1 || bankIdentity == IDENTITY_OPPONENT_MON2)) + bankIdentity = GetBankPosition(bank); + if (!IsContest() && (bankIdentity == B_POSITION_PLAYER_LEFT || bankIdentity == B_POSITION_OPPONENT_RIGHT)) { SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); SetAnimBgAttribute(2, BG_ANIM_PRIORITY, 2); @@ -1738,8 +1738,8 @@ static void ScriptCmd_monbgprio_2A(void) else bank = gAnimBankAttacker; - bankIdentity = GetBankIdentity(bank); - if (!IsContest() && (bankIdentity == IDENTITY_PLAYER_MON1 || bankIdentity == IDENTITY_OPPONENT_MON2)) + bankIdentity = GetBankPosition(bank); + if (!IsContest() && (bankIdentity == B_POSITION_PLAYER_LEFT || bankIdentity == B_POSITION_OPPONENT_RIGHT)) { SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); SetAnimBgAttribute(2, BG_ANIM_PRIORITY, 2); diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index cb510bb5b..a72650537 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -295,7 +295,7 @@ static void sub_8064520(void) gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x80 = 0; gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x1 = 0; - if (GetBankIdentity(gActiveBank) == IDENTITY_OPPONENT_MON2) + if (GetBankPosition(gActiveBank) == B_POSITION_OPPONENT_RIGHT) { FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); @@ -352,7 +352,7 @@ static void sub_8064734(void) { if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) { - if (GetBankIdentity(gActiveBank) == IDENTITY_OPPONENT_MON1) + if (GetBankPosition(gActiveBank) == B_POSITION_OPPONENT_LEFT) m4aMPlayContinue(&gMPlayInfo_BGM); } else @@ -370,7 +370,7 @@ static void sub_8064734(void) if (gSprites[gUnknown_03005D7C[gActiveBank]].callback == SpriteCallbackDummy && gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy) { - if (gBattleTypeFlags & BATTLE_TYPE_MULTI && GetBankIdentity(gActiveBank) == IDENTITY_OPPONENT_MON2) + if (gBattleTypeFlags & BATTLE_TYPE_MULTI && GetBankPosition(gActiveBank) == B_POSITION_OPPONENT_RIGHT) { if (++gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_9 == 1) return; @@ -1161,10 +1161,10 @@ static void LinkOpponentHandleLoadMonSprite(void) u16 species = GetMonData(&gEnemyParty[gBattlePartyID[gActiveBank]], MON_DATA_SPECIES); BattleLoadOpponentMonSpriteGfx(&gEnemyParty[gBattlePartyID[gActiveBank]], gActiveBank); - sub_806A068(species, GetBankIdentity(gActiveBank)); + sub_806A068(species, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, - GetBankPosition(gActiveBank, 2), + GetBankCoord(gActiveBank, 2), GetBankSpriteDefault_Y(gActiveBank), sub_80A82E4(gActiveBank)); @@ -1194,11 +1194,11 @@ static void sub_8066494(u8 bank, bool8 dontClearSubstituteBit) species = GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_SPECIES); gUnknown_03005D7C[bank] = CreateInvisibleSpriteWithCallback(sub_805D714); BattleLoadOpponentMonSpriteGfx(&gEnemyParty[gBattlePartyID[bank]], bank); - sub_806A068(species, GetBankIdentity(bank)); + sub_806A068(species, GetBankPosition(bank)); gBankSpriteIds[bank] = CreateSprite( &gUnknown_0202499C, - GetBankPosition(bank, 2), + GetBankCoord(bank, 2), GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); @@ -1262,7 +1262,7 @@ static void LinkOpponentHandleDrawTrainerPic(void) if (gBattleTypeFlags & BATTLE_TYPE_MULTI) { - if ((GetBankIdentity(gActiveBank) & BIT_MON) != 0) // second mon + if ((GetBankPosition(gActiveBank) & BIT_MON) != 0) // second mon xPos = 152; else // first mon xPos = 200; @@ -1328,7 +1328,7 @@ static void LinkOpponentHandleDrawTrainerPic(void) } DecompressTrainerFrontPic(trainerPicId, gActiveBank); - sub_806A12C(trainerPicId, GetBankIdentity(gActiveBank)); + sub_806A12C(trainerPicId, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, xPos, (8 - gTrainerFrontPicCoords[trainerPicId].coords) * 4 + 40, @@ -1353,7 +1353,7 @@ static void LinkOpponentHandleTrainerSlide(void) trainerPicId = GetFrontierTrainerFrontSpriteId(gTrainerBattleOpponent_B); DecompressTrainerFrontPic(trainerPicId, gActiveBank); - sub_806A12C(trainerPicId, GetBankIdentity(gActiveBank)); + sub_806A12C(trainerPicId, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, 176, (8 - gTrainerFrontPicCoords[trainerPicId].coords) * 4 + 40, 0x1E); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 96; diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index 082b134b4..14061b3a9 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -1047,10 +1047,10 @@ static void LinkPartnerHandleLoadMonSprite(void) BattleLoadPlayerMonSpriteGfx(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); species = GetMonData(&gPlayerParty[gBattlePartyID[gActiveBank]], MON_DATA_SPECIES); - sub_806A068(species, GetBankIdentity(gActiveBank)); + sub_806A068(species, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, - GetBankPosition(gActiveBank, 2), + GetBankCoord(gActiveBank, 2), GetBankSpriteDefault_Y(gActiveBank), sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240; @@ -1077,11 +1077,11 @@ static void sub_814CC98(u8 bank, bool8 dontClearSubstituteBit) gBattlePartyID[bank] = gBattleBufferA[bank][1]; species = GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_SPECIES); gUnknown_03005D7C[bank] = CreateInvisibleSpriteWithCallback(sub_805D714); - sub_806A068(species, GetBankIdentity(bank)); + sub_806A068(species, GetBankPosition(bank)); gBankSpriteIds[bank] = CreateSprite( &gUnknown_0202499C, - GetBankPosition(bank, 2), + GetBankCoord(bank, 2), GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); @@ -1144,7 +1144,7 @@ static void LinkPartnerHandleDrawTrainerPic(void) if (gBattleTypeFlags & BATTLE_TYPE_MULTI) { - if ((GetBankIdentity(gActiveBank) & BIT_MON) != 0) // second mon + if ((GetBankPosition(gActiveBank) & BIT_MON) != 0) // second mon xPos = 90; else // first mon xPos = 32; @@ -1170,7 +1170,7 @@ static void LinkPartnerHandleDrawTrainerPic(void) } DecompressTrainerBackPic(trainerPicId, gActiveBank); - sub_806A12C(trainerPicId, GetBankIdentity(gActiveBank)); + sub_806A12C(trainerPicId, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, xPos, (8 - gTrainerBackPicCoords[trainerPicId].coords) * 4 + 80, sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank; diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 30414d53a..d3e72c0ad 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -293,7 +293,7 @@ static void sub_805F2F0(void) } else if (gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x1) { - if (GetBankIdentity(gActiveBank) == 3) + if (GetBankPosition(gActiveBank) == 3) { if (gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].flag_x80 == 0 && gBattleSpritesDataPtr->healthBoxesData[gActiveBank ^ BIT_MON].field_1_x1 == 0) { @@ -349,7 +349,7 @@ static void sub_805F560(void) { if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) { - if (GetBankIdentity(gActiveBank) == 1) + if (GetBankPosition(gActiveBank) == 1) m4aMPlayContinue(&gMPlayInfo_BGM); } else @@ -1149,10 +1149,10 @@ static void OpponentHandleLoadMonSprite(void) u16 species = GetMonData(&gEnemyParty[gBattlePartyID[gActiveBank]], MON_DATA_SPECIES); BattleLoadOpponentMonSpriteGfx(&gEnemyParty[gBattlePartyID[gActiveBank]], gActiveBank); - sub_806A068(species, GetBankIdentity(gActiveBank)); + sub_806A068(species, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, - GetBankPosition(gActiveBank, 2), + GetBankCoord(gActiveBank, 2), GetBankSpriteDefault_Y(gActiveBank), sub_80A82E4(gActiveBank)); @@ -1184,10 +1184,10 @@ static void sub_80613DC(u8 bank, bool8 dontClearSubstituteBit) species = GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_SPECIES); gUnknown_03005D7C[bank] = CreateInvisibleSpriteWithCallback(sub_805D714); BattleLoadOpponentMonSpriteGfx(&gEnemyParty[gBattlePartyID[bank]], bank); - sub_806A068(species, GetBankIdentity(bank)); + sub_806A068(species, GetBankPosition(bank)); gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, - GetBankPosition(bank, 2), + GetBankCoord(bank, 2), GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); @@ -1304,7 +1304,7 @@ static void OpponentHandleDrawTrainerPic(void) if (gBattleTypeFlags & (BATTLE_TYPE_MULTI | BATTLE_TYPE_TWO_OPPONENTS)) { - if ((GetBankIdentity(gActiveBank) & BIT_MON) != 0) // second mon + if ((GetBankPosition(gActiveBank) & BIT_MON) != 0) // second mon xPos = 152; else // first mon xPos = 200; @@ -1315,7 +1315,7 @@ static void OpponentHandleDrawTrainerPic(void) } DecompressTrainerFrontPic(trainerPicId, gActiveBank); - sub_806A12C(trainerPicId, GetBankIdentity(gActiveBank)); + sub_806A12C(trainerPicId, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, xPos, (8 - gTrainerFrontPicCoords[trainerPicId].coords) * 4 + 40, @@ -1387,7 +1387,7 @@ static void OpponentHandleTrainerSlide(void) } DecompressTrainerFrontPic(trainerPicId, gActiveBank); - sub_806A12C(trainerPicId, GetBankIdentity(gActiveBank)); + sub_806A12C(trainerPicId, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, 176, (8 - gTrainerFrontPicCoords[trainerPicId].coords) * 4 + 40, 0x1E); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 96; @@ -1588,9 +1588,9 @@ static void OpponentHandleChooseMove(void) gBankTarget = gActiveBank; if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & MOVE_TARGET_BOTH) { - gBankTarget = GetBankByIdentity(IDENTITY_PLAYER_MON1); + gBankTarget = GetBankByIdentity(B_POSITION_PLAYER_LEFT); if (gAbsentBankFlags & gBitTable[gBankTarget]) - gBankTarget = GetBankByIdentity(IDENTITY_PLAYER_MON2); + gBankTarget = GetBankByIdentity(B_POSITION_PLAYER_RIGHT); } EmitTwoReturnValues(1, 10, (chosenMoveId) | (gBankTarget << 8)); break; @@ -1611,7 +1611,7 @@ static void OpponentHandleChooseMove(void) else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) EmitTwoReturnValues(1, 10, (chosenMoveId) | (GetBankByIdentity(Random() & 2) << 8)); else - EmitTwoReturnValues(1, 10, (chosenMoveId) | (GetBankByIdentity(IDENTITY_PLAYER_MON1) << 8)); + EmitTwoReturnValues(1, 10, (chosenMoveId) | (GetBankByIdentity(B_POSITION_PLAYER_LEFT) << 8)); OpponentBufferExecCompleted(); } @@ -1638,12 +1638,12 @@ static void OpponentHandleChoosePokemon(void) if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) { - bank2 = bank1 = GetBankByIdentity(IDENTITY_OPPONENT_MON1); + bank2 = bank1 = GetBankByIdentity(B_POSITION_OPPONENT_LEFT); } else { - bank1 = GetBankByIdentity(IDENTITY_OPPONENT_MON1); - bank2 = GetBankByIdentity(IDENTITY_OPPONENT_MON2); + bank1 = GetBankByIdentity(B_POSITION_OPPONENT_LEFT); + bank2 = GetBankByIdentity(B_POSITION_OPPONENT_RIGHT); } if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_x800000)) diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index a9d5b70eb..dfbf9df94 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -232,7 +232,7 @@ static void (*const sPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = nullsub_22 }; -static const u8 sTargetIdentities[] = {IDENTITY_PLAYER_MON1, IDENTITY_PLAYER_MON2, IDENTITY_OPPONENT_MON2, IDENTITY_OPPONENT_MON1}; +static const u8 sTargetIdentities[] = {B_POSITION_PLAYER_LEFT, B_POSITION_PLAYER_RIGHT, B_POSITION_OPPONENT_RIGHT, B_POSITION_OPPONENT_LEFT}; // unknown unused data static const u8 sUnknown_0831C5FC[] = {0x48, 0x48, 0x20, 0x5a, 0x50, 0x50, 0x50, 0x58}; @@ -357,8 +357,8 @@ static void HandleInputChooseAction(void) else if (gMain.newKeys & B_BUTTON || gPlayerDpadHoldFrames > 59) { if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) - && GetBankIdentity(gActiveBank) == IDENTITY_PLAYER_MON2 - && !(gAbsentBankFlags & gBitTable[GetBankByIdentity(IDENTITY_PLAYER_MON1)]) + && GetBankPosition(gActiveBank) == B_POSITION_PLAYER_RIGHT + && !(gAbsentBankFlags & gBitTable[GetBankByIdentity(B_POSITION_PLAYER_LEFT)]) && !(gBattleTypeFlags & BATTLE_TYPE_MULTI)) { if (gBattleBufferA[gActiveBank][1] == ACTION_USE_ITEM) @@ -436,7 +436,7 @@ static void HandleInputChooseTarget(void) do { - u8 currSelIdentity = GetBankIdentity(gMultiUsePlayerCursor); + u8 currSelIdentity = GetBankPosition(gMultiUsePlayerCursor); for (i = 0; i < BATTLE_BANKS_COUNT; i++) { @@ -451,17 +451,17 @@ static void HandleInputChooseTarget(void) } while (gMultiUsePlayerCursor == gNoOfAllBanks); i = 0; - switch (GetBankIdentity(gMultiUsePlayerCursor)) + switch (GetBankPosition(gMultiUsePlayerCursor)) { - case IDENTITY_PLAYER_MON1: - case IDENTITY_PLAYER_MON2: + case B_POSITION_PLAYER_LEFT: + case B_POSITION_PLAYER_RIGHT: if (gActiveBank != gMultiUsePlayerCursor) i++; else if (gBattleMoves[GetMonData(&gPlayerParty[gBattlePartyID[gActiveBank]], MON_DATA_MOVE1 + gMoveSelectionCursor[gActiveBank])].target & MOVE_TARGET_USER) i++; break; - case IDENTITY_OPPONENT_MON1: - case IDENTITY_OPPONENT_MON2: + case B_POSITION_OPPONENT_LEFT: + case B_POSITION_OPPONENT_RIGHT: i++; break; } @@ -478,7 +478,7 @@ static void HandleInputChooseTarget(void) do { - u8 currSelIdentity = GetBankIdentity(gMultiUsePlayerCursor); + u8 currSelIdentity = GetBankPosition(gMultiUsePlayerCursor); for (i = 0; i < BATTLE_BANKS_COUNT; i++) { @@ -493,17 +493,17 @@ static void HandleInputChooseTarget(void) } while (gMultiUsePlayerCursor == gNoOfAllBanks); i = 0; - switch (GetBankIdentity(gMultiUsePlayerCursor)) + switch (GetBankPosition(gMultiUsePlayerCursor)) { - case IDENTITY_PLAYER_MON1: - case IDENTITY_PLAYER_MON2: + case B_POSITION_PLAYER_LEFT: + case B_POSITION_PLAYER_RIGHT: if (gActiveBank != gMultiUsePlayerCursor) i++; else if (gBattleMoves[GetMonData(&gPlayerParty[gBattlePartyID[gActiveBank]], MON_DATA_MOVE1 + gMoveSelectionCursor[gActiveBank])].target & MOVE_TARGET_USER) i++; break; - case IDENTITY_OPPONENT_MON1: - case IDENTITY_OPPONENT_MON2: + case B_POSITION_OPPONENT_LEFT: + case B_POSITION_OPPONENT_RIGHT: i++; break; } @@ -545,7 +545,7 @@ static void HandleInputChooseMove(void) if (moveTarget & MOVE_TARGET_x10) gMultiUsePlayerCursor = gActiveBank; else - gMultiUsePlayerCursor = GetBankByIdentity((GetBankIdentity(gActiveBank) & BIT_SIDE) ^ BIT_SIDE); + gMultiUsePlayerCursor = GetBankByIdentity((GetBankPosition(gActiveBank) & BIT_SIDE) ^ BIT_SIDE); if (!gBattleBufferA[gActiveBank][1]) // not a double battle { @@ -579,10 +579,10 @@ static void HandleInputChooseMove(void) if (moveTarget & (MOVE_TARGET_x10 | MOVE_TARGET_USER)) gMultiUsePlayerCursor = gActiveBank; - else if (gAbsentBankFlags & gBitTable[GetBankByIdentity(IDENTITY_OPPONENT_MON1)]) - gMultiUsePlayerCursor = GetBankByIdentity(IDENTITY_OPPONENT_MON2); + else if (gAbsentBankFlags & gBitTable[GetBankByIdentity(B_POSITION_OPPONENT_LEFT)]) + gMultiUsePlayerCursor = GetBankByIdentity(B_POSITION_OPPONENT_RIGHT); else - gMultiUsePlayerCursor = GetBankByIdentity(IDENTITY_OPPONENT_MON1); + gMultiUsePlayerCursor = GetBankByIdentity(B_POSITION_OPPONENT_LEFT); gSprites[gBankSpriteIds[gMultiUsePlayerCursor]].callback = sub_8039AD8; } @@ -2234,11 +2234,11 @@ static void sub_805B258(u8 bank, bool8 dontClearSubstituteBit) gBattlePartyID[bank] = gBattleBufferA[bank][1]; species = GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_SPECIES); gUnknown_03005D7C[bank] = CreateInvisibleSpriteWithCallback(sub_805D714); - sub_806A068(species, GetBankIdentity(bank)); + sub_806A068(species, GetBankPosition(bank)); gBankSpriteIds[bank] = CreateSprite( &gUnknown_0202499C, - GetBankPosition(bank, 2), + GetBankCoord(bank, 2), GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); @@ -2326,7 +2326,7 @@ static void PlayerHandleDrawTrainerPic(void) if (gBattleTypeFlags & BATTLE_TYPE_MULTI) { - if ((GetBankIdentity(gActiveBank) & BIT_MON) != 0) // second mon + if ((GetBankPosition(gActiveBank) & BIT_MON) != 0) // second mon xPos = 90; else // first mon xPos = 32; @@ -2353,7 +2353,7 @@ static void PlayerHandleDrawTrainerPic(void) { trainerPicId = PlayerGenderToFrontTrainerPicId(gSaveBlock2Ptr->playerGender); DecompressTrainerFrontPic(trainerPicId, gActiveBank); - sub_806A1C0(trainerPicId, GetBankIdentity(gActiveBank)); + sub_806A1C0(trainerPicId, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, xPos, yPos, sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); @@ -2368,7 +2368,7 @@ static void PlayerHandleDrawTrainerPic(void) else { DecompressTrainerBackPic(trainerPicId, gActiveBank); - sub_806A12C(trainerPicId, GetBankIdentity(gActiveBank)); + sub_806A12C(trainerPicId, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, xPos, yPos, sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank; @@ -2407,7 +2407,7 @@ static void PlayerHandleTrainerSlide(void) } DecompressTrainerBackPic(trainerPicId, gActiveBank); - sub_806A12C(trainerPicId, GetBankIdentity(gActiveBank)); + sub_806A12C(trainerPicId, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, 80, (8 - gTrainerBackPicCoords[trainerPicId].coords) * 4 + 80, 30); gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank; @@ -2463,7 +2463,7 @@ static void PlayerHandleSuccessBallThrowAnim(void) { gBattleSpritesDataPtr->animationData->ballThrowCaseId = BALL_3_SHAKES_SUCCESS; gDoingBattleAnim = TRUE; - InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, GetBankByIdentity(IDENTITY_OPPONENT_MON1), B_ANIM_BALL_THROW); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, GetBankByIdentity(B_POSITION_OPPONENT_LEFT), B_ANIM_BALL_THROW); gBattleBankFunc[gActiveBank] = CompleteOnSpecialAnimDone; } @@ -2473,7 +2473,7 @@ static void PlayerHandleBallThrowAnim(void) gBattleSpritesDataPtr->animationData->ballThrowCaseId = ballThrowCaseId; gDoingBattleAnim = TRUE; - InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, GetBankByIdentity(IDENTITY_OPPONENT_MON1), B_ANIM_BALL_THROW); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, GetBankByIdentity(B_POSITION_OPPONENT_LEFT), B_ANIM_BALL_THROW); gBattleBankFunc[gActiveBank] = CompleteOnSpecialAnimDone; } diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index 6b5211ceb..5d6f07a48 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -1234,10 +1234,10 @@ static void PlayerPartnerHandleLoadMonSprite(void) BattleLoadPlayerMonSpriteGfx(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); species = GetMonData(&gPlayerParty[gBattlePartyID[gActiveBank]], MON_DATA_SPECIES); - sub_806A068(species, GetBankIdentity(gActiveBank)); + sub_806A068(species, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, - GetBankPosition(gActiveBank, 2), + GetBankCoord(gActiveBank, 2), GetBankSpriteDefault_Y(gActiveBank), sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240; @@ -1264,11 +1264,11 @@ static void sub_81BD0E4(u8 bank, bool8 dontClearSubstituteBit) gBattlePartyID[bank] = gBattleBufferA[bank][1]; species = GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_SPECIES); gUnknown_03005D7C[bank] = CreateInvisibleSpriteWithCallback(sub_805D714); - sub_806A068(species, GetBankIdentity(bank)); + sub_806A068(species, GetBankPosition(bank)); gBankSpriteIds[bank] = CreateSprite( &gUnknown_0202499C, - GetBankPosition(bank, 2), + GetBankCoord(bank, 2), GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); @@ -1349,7 +1349,7 @@ static void PlayerPartnerHandleDrawTrainerPic(void) if (gPartnerTrainerId == STEVEN_PARTNER_ID) { DecompressTrainerBackPic(trainerPicId, gActiveBank); - sub_806A12C(trainerPicId, GetBankIdentity(gActiveBank)); + sub_806A12C(trainerPicId, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, xPos, yPos, sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank; @@ -1360,7 +1360,7 @@ static void PlayerPartnerHandleDrawTrainerPic(void) else // otherwise use front sprite { DecompressTrainerFrontPic(trainerPicId, gActiveBank); - sub_806A1C0(trainerPicId, GetBankIdentity(gActiveBank)); + sub_806A1C0(trainerPicId, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, xPos, yPos, sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); @@ -1548,9 +1548,9 @@ static void PlayerPartnerHandleChooseMove(void) gBankTarget = gActiveBank; if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & MOVE_TARGET_BOTH) { - gBankTarget = GetBankByIdentity(IDENTITY_OPPONENT_MON1); + gBankTarget = GetBankByIdentity(B_POSITION_OPPONENT_LEFT); if (gAbsentBankFlags & gBitTable[gBankTarget]) - gBankTarget = GetBankByIdentity(IDENTITY_OPPONENT_MON2); + gBankTarget = GetBankByIdentity(B_POSITION_OPPONENT_RIGHT); } EmitTwoReturnValues(1, 10, chosenMoveId | (gBankTarget << 8)); @@ -1568,8 +1568,8 @@ static void PlayerPartnerHandleChoosePokemon(void) if (chosenMonId == 6) // just switch to the next mon { - u8 playerMonIdentity = GetBankByIdentity(IDENTITY_PLAYER_MON1); - u8 selfIdentity = GetBankByIdentity(IDENTITY_PLAYER_MON2); + u8 playerMonIdentity = GetBankByIdentity(B_POSITION_PLAYER_LEFT); + u8 selfIdentity = GetBankByIdentity(B_POSITION_PLAYER_RIGHT); for (chosenMonId = 3; chosenMonId < 6; chosenMonId++) { diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index 6e29fa951..e5e0bef84 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -274,7 +274,7 @@ static void sub_8186678(void) if (var) { - if (GetBankIdentity(gActiveBank) == IDENTITY_OPPONENT_MON1) + if (GetBankPosition(gActiveBank) == B_POSITION_OPPONENT_LEFT) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_1_x1) return; @@ -330,7 +330,7 @@ static void sub_818686C(void) { if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) { - if (GetBankIdentity(gActiveBank) == IDENTITY_OPPONENT_MON1) + if (GetBankPosition(gActiveBank) == B_POSITION_OPPONENT_LEFT) m4aMPlayContinue(&gMPlayInfo_BGM); } else @@ -1146,10 +1146,10 @@ static void RecordedOpponentHandleLoadMonSprite(void) u16 species = GetMonData(&gEnemyParty[gBattlePartyID[gActiveBank]], MON_DATA_SPECIES); BattleLoadOpponentMonSpriteGfx(&gEnemyParty[gBattlePartyID[gActiveBank]], gActiveBank); - sub_806A068(species, GetBankIdentity(gActiveBank)); + sub_806A068(species, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, - GetBankPosition(gActiveBank, 2), + GetBankCoord(gActiveBank, 2), GetBankSpriteDefault_Y(gActiveBank), sub_80A82E4(gActiveBank)); @@ -1181,10 +1181,10 @@ static void sub_81885D8(u8 bank, bool8 dontClearSubstituteBit) species = GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_SPECIES); gUnknown_03005D7C[bank] = CreateInvisibleSpriteWithCallback(sub_805D714); BattleLoadOpponentMonSpriteGfx(&gEnemyParty[gBattlePartyID[bank]], bank); - sub_806A068(species, GetBankIdentity(bank)); + sub_806A068(species, GetBankPosition(bank)); gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, - GetBankPosition(bank, 2), + GetBankCoord(bank, 2), GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); @@ -1248,7 +1248,7 @@ static void RecordedOpponentHandleDrawTrainerPic(void) if (gBattleTypeFlags & BATTLE_TYPE_MULTI) { - if ((GetBankIdentity(gActiveBank) & BIT_MON) != 0) // second mon + if ((GetBankPosition(gActiveBank) & BIT_MON) != 0) // second mon xPos = 152; else // first mon xPos = 200; @@ -1279,7 +1279,7 @@ static void RecordedOpponentHandleDrawTrainerPic(void) } DecompressTrainerFrontPic(trainerPicId, gActiveBank); - sub_806A12C(trainerPicId, GetBankIdentity(gActiveBank)); + sub_806A12C(trainerPicId, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, xPos, (8 - gTrainerFrontPicCoords[trainerPicId].coords) * 4 + 40, diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index f101d811f..183da6bfd 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -245,7 +245,7 @@ static void sub_8189AA0(void) { bool32 r6 = FALSE; - if (GetBankIdentity(gActiveBank) == IDENTITY_PLAYER_MON1) + if (GetBankPosition(gActiveBank) == B_POSITION_PLAYER_LEFT) { if (!IsDoubleBattle() || (IsDoubleBattle() && (gBattleTypeFlags & BATTLE_TYPE_MULTI))) { @@ -312,7 +312,7 @@ static void sub_8189D40(void) { bool32 r10 = FALSE; - if (GetBankIdentity(gActiveBank) == IDENTITY_PLAYER_MON1) + if (GetBankPosition(gActiveBank) == B_POSITION_PLAYER_LEFT) { if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].flag_x80 && !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].ballAnimActive) @@ -353,7 +353,7 @@ static void sub_8189D40(void) { if ((gBattleTypeFlags & BATTLE_TYPE_LINK) && (gBattleTypeFlags & BATTLE_TYPE_MULTI)) { - if (GetBankIdentity(gActiveBank) == IDENTITY_PLAYER_MON1) + if (GetBankPosition(gActiveBank) == B_POSITION_PLAYER_LEFT) m4aMPlayContinue(&gMPlayInfo_BGM); } else @@ -1132,10 +1132,10 @@ static void RecordedPlayerHandleLoadMonSprite(void) BattleLoadPlayerMonSpriteGfx(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); species = GetMonData(&gPlayerParty[gBattlePartyID[gActiveBank]], MON_DATA_SPECIES); - sub_806A068(species, GetBankIdentity(gActiveBank)); + sub_806A068(species, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, - GetBankPosition(gActiveBank, 2), + GetBankCoord(gActiveBank, 2), GetBankSpriteDefault_Y(gActiveBank), sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240; @@ -1162,11 +1162,11 @@ static void sub_818BA6C(u8 bank, bool8 dontClearSubstituteBit) gBattlePartyID[bank] = gBattleBufferA[bank][1]; species = GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_SPECIES); gUnknown_03005D7C[bank] = CreateInvisibleSpriteWithCallback(sub_805D714); - sub_806A068(species, GetBankIdentity(bank)); + sub_806A068(species, GetBankPosition(bank)); gBankSpriteIds[bank] = CreateSprite( &gUnknown_0202499C, - GetBankPosition(bank, 2), + GetBankCoord(bank, 2), GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); @@ -1241,7 +1241,7 @@ static void RecordedPlayerHandleDrawTrainerPic(void) if (gBattleTypeFlags & BATTLE_TYPE_MULTI) { - if ((GetBankIdentity(gActiveBank) & BIT_MON) != 0) // second mon + if ((GetBankPosition(gActiveBank) & BIT_MON) != 0) // second mon xPos = 90; else // first mon xPos = 32; @@ -1267,7 +1267,7 @@ static void RecordedPlayerHandleDrawTrainerPic(void) { trainerPicId = PlayerGenderToFrontTrainerPicId(gSaveBlock2Ptr->playerGender); DecompressTrainerFrontPic(trainerPicId, gActiveBank); - sub_806A1C0(trainerPicId, GetBankIdentity(gActiveBank)); + sub_806A1C0(trainerPicId, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, xPos, yPos, sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); @@ -1281,7 +1281,7 @@ static void RecordedPlayerHandleDrawTrainerPic(void) else { DecompressTrainerBackPic(trainerPicId, gActiveBank); - sub_806A12C(trainerPicId, GetBankIdentity(gActiveBank)); + sub_806A12C(trainerPicId, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, xPos, yPos, sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank; diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c index 682e8333d..a04f06d8c 100644 --- a/src/battle_controller_safari.c +++ b/src/battle_controller_safari.c @@ -378,7 +378,7 @@ static void SafariHandleReturnMonToBall(void) static void SafariHandleDrawTrainerPic(void) { DecompressTrainerBackPic(gSaveBlock2Ptr->playerGender, gActiveBank); - sub_806A12C(gSaveBlock2Ptr->playerGender, GetBankIdentity(gActiveBank)); + sub_806A12C(gSaveBlock2Ptr->playerGender, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite( &gUnknown_0202499C, 80, @@ -415,7 +415,7 @@ static void SafariHandleSuccessBallThrowAnim(void) { gBattleSpritesDataPtr->animationData->ballThrowCaseId = BALL_3_SHAKES_SUCCESS; gDoingBattleAnim = TRUE; - InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, GetBankByIdentity(IDENTITY_OPPONENT_MON1), B_ANIM_SAFARI_BALL_THROW); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, GetBankByIdentity(B_POSITION_OPPONENT_LEFT), B_ANIM_SAFARI_BALL_THROW); gBattleBankFunc[gActiveBank] = CompleteOnSpecialAnimDone; } @@ -425,7 +425,7 @@ static void SafariHandleBallThrowAnim(void) gBattleSpritesDataPtr->animationData->ballThrowCaseId = ballThrowCaseId; gDoingBattleAnim = TRUE; - InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, GetBankByIdentity(IDENTITY_OPPONENT_MON1), B_ANIM_SAFARI_BALL_THROW); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, GetBankByIdentity(B_POSITION_OPPONENT_LEFT), B_ANIM_SAFARI_BALL_THROW); gBattleBankFunc[gActiveBank] = CompleteOnSpecialAnimDone; } diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index b0e1e1480..8a34763f6 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -1067,7 +1067,7 @@ static void WallyHandleReturnMonToBall(void) static void WallyHandleDrawTrainerPic(void) { DecompressTrainerBackPic(BACK_PIC_WALLY, gActiveBank); - sub_806A12C(BACK_PIC_WALLY, GetBankIdentity(gActiveBank)); + sub_806A12C(BACK_PIC_WALLY, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, 80, 80 + 4 * (8 - gTrainerBackPicCoords[BACK_PIC_WALLY].coords), @@ -1082,7 +1082,7 @@ static void WallyHandleDrawTrainerPic(void) static void WallyHandleTrainerSlide(void) { DecompressTrainerBackPic(BACK_PIC_WALLY, gActiveBank); - sub_806A12C(BACK_PIC_WALLY, GetBankIdentity(gActiveBank)); + sub_806A12C(BACK_PIC_WALLY, GetBankPosition(gActiveBank)); gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, 80, 80 + 4 * (8 - gTrainerBackPicCoords[BACK_PIC_WALLY].coords), @@ -1113,7 +1113,7 @@ static void WallyHandleSuccessBallThrowAnim(void) { gBattleSpritesDataPtr->animationData->ballThrowCaseId = BALL_3_SHAKES_SUCCESS; gDoingBattleAnim = TRUE; - InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, GetBankByIdentity(IDENTITY_OPPONENT_MON1), B_ANIM_SAFARI_BALL_THROW); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, GetBankByIdentity(B_POSITION_OPPONENT_LEFT), B_ANIM_SAFARI_BALL_THROW); gBattleBankFunc[gActiveBank] = CompleteOnFinishedAnimation; } @@ -1123,7 +1123,7 @@ static void WallyHandleBallThrowAnim(void) gBattleSpritesDataPtr->animationData->ballThrowCaseId = ballThrowCaseId; gDoingBattleAnim = TRUE; - InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, GetBankByIdentity(IDENTITY_OPPONENT_MON1), B_ANIM_SAFARI_BALL_THROW); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, GetBankByIdentity(B_POSITION_OPPONENT_LEFT), B_ANIM_SAFARI_BALL_THROW); gBattleBankFunc[gActiveBank] = CompleteOnFinishedAnimation; } @@ -1494,9 +1494,9 @@ static void sub_816AA80(u8 bank) gBattlePartyID[bank] = gBattleBufferA[bank][1]; species = GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_SPECIES); gUnknown_03005D7C[bank] = CreateInvisibleSpriteWithCallback(sub_805D714); - sub_806A068(species, GetBankIdentity(bank)); + sub_806A068(species, GetBankPosition(bank)); gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, - GetBankPosition(bank, 2), + GetBankCoord(bank, 2), GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); diff --git a/src/battle_controllers.c b/src/battle_controllers.c index c6d47e71e..467ce3640 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -16,7 +16,7 @@ extern u32 gBattleTypeFlags; extern u32 gBattleExecBuffer; extern void (*gBattleMainFunc)(void); extern void (*gBattleBankFunc[BATTLE_BANKS_COUNT])(void); -extern u8 gBanksByIdentity[BATTLE_BANKS_COUNT]; +extern u8 gBankPositions[BATTLE_BANKS_COUNT]; extern u8 gActionSelectionCursor[BATTLE_BANKS_COUNT]; extern u8 gMoveSelectionCursor[BATTLE_BANKS_COUNT]; extern u8 gNoOfAllBanks; @@ -79,7 +79,7 @@ void SetUpBattleVarsAndBirchZigzagoon(void) for (i = 0; i < BATTLE_BANKS_COUNT; i++) { gBattleBankFunc[i] = nullsub_21; - gBanksByIdentity[i] = 0xFF; + gBankPositions[i] = 0xFF; gActionSelectionCursor[i] = 0; gMoveSelectionCursor[i] = 0; } @@ -146,30 +146,30 @@ static void SetControllersVariables(void) if (gBattleTypeFlags & BATTLE_TYPE_RECORDED) { gBattleBankFunc[0] = SetControllerToRecordedPlayer; - gBanksByIdentity[0] = IDENTITY_PLAYER_MON1; + gBankPositions[0] = B_POSITION_PLAYER_LEFT; gBattleBankFunc[1] = SetControllerToOpponent; - gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1; + gBankPositions[1] = B_POSITION_OPPONENT_LEFT; gBattleBankFunc[2] = SetControllerToPlayerPartner; - gBanksByIdentity[2] = IDENTITY_PLAYER_MON2; + gBankPositions[2] = B_POSITION_PLAYER_RIGHT; gBattleBankFunc[3] = SetControllerToOpponent; - gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2; + gBankPositions[3] = B_POSITION_OPPONENT_RIGHT; } else { gBattleBankFunc[0] = SetControllerToPlayer; - gBanksByIdentity[0] = IDENTITY_PLAYER_MON1; + gBankPositions[0] = B_POSITION_PLAYER_LEFT; gBattleBankFunc[1] = SetControllerToOpponent; - gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1; + gBankPositions[1] = B_POSITION_OPPONENT_LEFT; gBattleBankFunc[2] = SetControllerToPlayerPartner; - gBanksByIdentity[2] = IDENTITY_PLAYER_MON2; + gBankPositions[2] = B_POSITION_PLAYER_RIGHT; gBattleBankFunc[3] = SetControllerToOpponent; - gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2; + gBankPositions[3] = B_POSITION_OPPONENT_RIGHT; } gNoOfAllBanks = 4; @@ -195,10 +195,10 @@ static void SetControllersVariables(void) else gBattleBankFunc[0] = SetControllerToPlayer; - gBanksByIdentity[0] = IDENTITY_PLAYER_MON1; + gBankPositions[0] = B_POSITION_PLAYER_LEFT; gBattleBankFunc[1] = SetControllerToOpponent; - gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1; + gBankPositions[1] = B_POSITION_OPPONENT_LEFT; gNoOfAllBanks = 2; @@ -211,20 +211,20 @@ static void SetControllersVariables(void) gBattleMainFunc = BeginBattleIntro; gBattleBankFunc[0] = SetControllerToRecordedPlayer; - gBanksByIdentity[0] = IDENTITY_PLAYER_MON1; + gBankPositions[0] = B_POSITION_PLAYER_LEFT; gBattleBankFunc[1] = SetControllerToRecordedOpponent; - gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1; + gBankPositions[1] = B_POSITION_OPPONENT_LEFT; gNoOfAllBanks = 2; } else // see how the banks are switched { gBattleBankFunc[1] = SetControllerToRecordedPlayer; - gBanksByIdentity[1] = IDENTITY_PLAYER_MON1; + gBankPositions[1] = B_POSITION_PLAYER_LEFT; gBattleBankFunc[0] = SetControllerToRecordedOpponent; - gBanksByIdentity[0] = IDENTITY_OPPONENT_MON1; + gBankPositions[0] = B_POSITION_OPPONENT_LEFT; gNoOfAllBanks = 2; } @@ -232,10 +232,10 @@ static void SetControllersVariables(void) else { gBattleBankFunc[0] = SetControllerToRecordedPlayer; - gBanksByIdentity[0] = IDENTITY_PLAYER_MON1; + gBankPositions[0] = B_POSITION_PLAYER_LEFT; gBattleBankFunc[1] = SetControllerToOpponent; - gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1; + gBankPositions[1] = B_POSITION_OPPONENT_LEFT; } } } @@ -244,16 +244,16 @@ static void SetControllersVariables(void) gBattleMainFunc = BeginBattleIntro; gBattleBankFunc[0] = SetControllerToPlayer; - gBanksByIdentity[0] = IDENTITY_PLAYER_MON1; + gBankPositions[0] = B_POSITION_PLAYER_LEFT; gBattleBankFunc[1] = SetControllerToOpponent; - gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1; + gBankPositions[1] = B_POSITION_OPPONENT_LEFT; gBattleBankFunc[2] = SetControllerToPlayer; - gBanksByIdentity[2] = IDENTITY_PLAYER_MON2; + gBankPositions[2] = B_POSITION_PLAYER_RIGHT; gBattleBankFunc[3] = SetControllerToOpponent; - gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2; + gBankPositions[3] = B_POSITION_OPPONENT_RIGHT; gNoOfAllBanks = 4; @@ -264,16 +264,16 @@ static void SetControllersVariables(void) gBattleMainFunc = BeginBattleIntro; gBattleBankFunc[0] = SetControllerToRecordedPlayer; - gBanksByIdentity[0] = 0; + gBankPositions[0] = 0; gBattleBankFunc[1] = SetControllerToOpponent; - gBanksByIdentity[1] = 1; + gBankPositions[1] = 1; gBattleBankFunc[2] = SetControllerToRecordedPlayer; - gBanksByIdentity[2] = 2; + gBankPositions[2] = 2; gBattleBankFunc[3] = SetControllerToOpponent; - gBanksByIdentity[3] = 3; + gBankPositions[3] = 3; gNoOfAllBanks = 4; @@ -312,12 +312,12 @@ static void SetControllersVariables(void) { case 0: case 3: - gBanksByIdentity[gLinkPlayers[i].lp_field_18] = IDENTITY_PLAYER_MON1; + gBankPositions[gLinkPlayers[i].lp_field_18] = B_POSITION_PLAYER_LEFT; gBattlePartyID[gLinkPlayers[i].lp_field_18] = 0; break; case 1: case 2: - gBanksByIdentity[gLinkPlayers[i].lp_field_18] = IDENTITY_PLAYER_MON2; + gBankPositions[gLinkPlayers[i].lp_field_18] = B_POSITION_PLAYER_RIGHT; gBattlePartyID[gLinkPlayers[i].lp_field_18] = 3; break; } @@ -330,12 +330,12 @@ static void SetControllersVariables(void) { case 0: case 3: - gBanksByIdentity[gLinkPlayers[i].lp_field_18] = IDENTITY_PLAYER_MON1; + gBankPositions[gLinkPlayers[i].lp_field_18] = B_POSITION_PLAYER_LEFT; gBattlePartyID[gLinkPlayers[i].lp_field_18] = 0; break; case 1: case 2: - gBanksByIdentity[gLinkPlayers[i].lp_field_18] = IDENTITY_PLAYER_MON2; + gBankPositions[gLinkPlayers[i].lp_field_18] = B_POSITION_PLAYER_RIGHT; gBattlePartyID[gLinkPlayers[i].lp_field_18] = 3; break; } @@ -347,12 +347,12 @@ static void SetControllersVariables(void) { case 0: case 3: - gBanksByIdentity[gLinkPlayers[i].lp_field_18] = IDENTITY_OPPONENT_MON1; + gBankPositions[gLinkPlayers[i].lp_field_18] = B_POSITION_OPPONENT_LEFT; gBattlePartyID[gLinkPlayers[i].lp_field_18] = 0; break; case 1: case 2: - gBanksByIdentity[gLinkPlayers[i].lp_field_18] = IDENTITY_OPPONENT_MON2; + gBankPositions[gLinkPlayers[i].lp_field_18] = B_POSITION_OPPONENT_RIGHT; gBattlePartyID[gLinkPlayers[i].lp_field_18] = 3; break; } @@ -362,51 +362,51 @@ static void SetControllersVariables(void) else if (gBattleTypeFlags & BATTLE_TYPE_WILD) { gBattleBankFunc[0] = SetControllerToRecordedPlayer; - gBanksByIdentity[0] = IDENTITY_PLAYER_MON1; + gBankPositions[0] = B_POSITION_PLAYER_LEFT; gBattleBankFunc[2] = SetControllerToRecordedPlayer; - gBanksByIdentity[2] = IDENTITY_PLAYER_MON2; + gBankPositions[2] = B_POSITION_PLAYER_RIGHT; if (gBattleTypeFlags & BATTLE_TYPE_x2000000) { gBattleBankFunc[1] = SetControllerToRecordedOpponent; - gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1; + gBankPositions[1] = B_POSITION_OPPONENT_LEFT; gBattleBankFunc[3] = SetControllerToRecordedOpponent; - gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2; + gBankPositions[3] = B_POSITION_OPPONENT_RIGHT; } else { gBattleBankFunc[1] = SetControllerToOpponent; - gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1; + gBankPositions[1] = B_POSITION_OPPONENT_LEFT; gBattleBankFunc[3] = SetControllerToOpponent; - gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2; + gBankPositions[3] = B_POSITION_OPPONENT_RIGHT; } } else { gBattleBankFunc[1] = SetControllerToRecordedPlayer; - gBanksByIdentity[1] = IDENTITY_PLAYER_MON1; + gBankPositions[1] = B_POSITION_PLAYER_LEFT; gBattleBankFunc[3] = SetControllerToRecordedPlayer; - gBanksByIdentity[3] = IDENTITY_PLAYER_MON2; + gBankPositions[3] = B_POSITION_PLAYER_RIGHT; if (gBattleTypeFlags & BATTLE_TYPE_x2000000) { gBattleBankFunc[0] = SetControllerToRecordedOpponent; - gBanksByIdentity[0] = IDENTITY_OPPONENT_MON1; + gBankPositions[0] = B_POSITION_OPPONENT_LEFT; gBattleBankFunc[2] = SetControllerToRecordedOpponent; - gBanksByIdentity[2] = IDENTITY_OPPONENT_MON2; + gBankPositions[2] = B_POSITION_OPPONENT_RIGHT; } else { gBattleBankFunc[0] = SetControllerToOpponent; - gBanksByIdentity[0] = IDENTITY_OPPONENT_MON1; + gBankPositions[0] = B_POSITION_OPPONENT_LEFT; gBattleBankFunc[2] = SetControllerToOpponent; - gBanksByIdentity[2] = IDENTITY_OPPONENT_MON2; + gBankPositions[2] = B_POSITION_OPPONENT_RIGHT; } } } @@ -425,20 +425,20 @@ static void SetControllersVariablesInLinkBattle(void) gBattleMainFunc = BeginBattleIntro; gBattleBankFunc[0] = SetControllerToPlayer; - gBanksByIdentity[0] = IDENTITY_PLAYER_MON1; + gBankPositions[0] = B_POSITION_PLAYER_LEFT; gBattleBankFunc[1] = SetControllerToLinkOpponent; - gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1; + gBankPositions[1] = B_POSITION_OPPONENT_LEFT; gNoOfAllBanks = 2; } else { gBattleBankFunc[1] = SetControllerToPlayer; - gBanksByIdentity[1] = IDENTITY_PLAYER_MON1; + gBankPositions[1] = B_POSITION_PLAYER_LEFT; gBattleBankFunc[0] = SetControllerToLinkOpponent; - gBanksByIdentity[0] = IDENTITY_OPPONENT_MON1; + gBankPositions[0] = B_POSITION_OPPONENT_LEFT; gNoOfAllBanks = 2; } @@ -450,32 +450,32 @@ static void SetControllersVariablesInLinkBattle(void) gBattleMainFunc = BeginBattleIntro; gBattleBankFunc[0] = SetControllerToPlayer; - gBanksByIdentity[0] = IDENTITY_PLAYER_MON1; + gBankPositions[0] = B_POSITION_PLAYER_LEFT; gBattleBankFunc[1] = SetControllerToLinkOpponent; - gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1; + gBankPositions[1] = B_POSITION_OPPONENT_LEFT; gBattleBankFunc[2] = SetControllerToPlayer; - gBanksByIdentity[2] = IDENTITY_PLAYER_MON2; + gBankPositions[2] = B_POSITION_PLAYER_RIGHT; gBattleBankFunc[3] = SetControllerToLinkOpponent; - gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2; + gBankPositions[3] = B_POSITION_OPPONENT_RIGHT; gNoOfAllBanks = 4; } else { gBattleBankFunc[1] = SetControllerToPlayer; - gBanksByIdentity[1] = IDENTITY_PLAYER_MON1; + gBankPositions[1] = B_POSITION_PLAYER_LEFT; gBattleBankFunc[0] = SetControllerToLinkOpponent; - gBanksByIdentity[0] = IDENTITY_OPPONENT_MON1; + gBankPositions[0] = B_POSITION_OPPONENT_LEFT; gBattleBankFunc[3] = SetControllerToPlayer; - gBanksByIdentity[3] = IDENTITY_PLAYER_MON2; + gBankPositions[3] = B_POSITION_PLAYER_RIGHT; gBattleBankFunc[2] = SetControllerToLinkOpponent; - gBanksByIdentity[2] = IDENTITY_OPPONENT_MON2; + gBankPositions[2] = B_POSITION_OPPONENT_RIGHT; gNoOfAllBanks = 4; } @@ -487,32 +487,32 @@ static void SetControllersVariablesInLinkBattle(void) gBattleMainFunc = BeginBattleIntro; gBattleBankFunc[0] = SetControllerToPlayer; - gBanksByIdentity[0] = IDENTITY_PLAYER_MON1; + gBankPositions[0] = B_POSITION_PLAYER_LEFT; gBattleBankFunc[1] = SetControllerToOpponent; - gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1; + gBankPositions[1] = B_POSITION_OPPONENT_LEFT; gBattleBankFunc[2] = SetControllerToLinkPartner; - gBanksByIdentity[2] = IDENTITY_PLAYER_MON2; + gBankPositions[2] = B_POSITION_PLAYER_RIGHT; gBattleBankFunc[3] = SetControllerToOpponent; - gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2; + gBankPositions[3] = B_POSITION_OPPONENT_RIGHT; gNoOfAllBanks = 4; } else { gBattleBankFunc[0] = SetControllerToLinkPartner; - gBanksByIdentity[0] = IDENTITY_PLAYER_MON1; + gBankPositions[0] = B_POSITION_PLAYER_LEFT; gBattleBankFunc[1] = SetControllerToLinkOpponent; - gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1; + gBankPositions[1] = B_POSITION_OPPONENT_LEFT; gBattleBankFunc[2] = SetControllerToPlayer; - gBanksByIdentity[2] = IDENTITY_PLAYER_MON2; + gBankPositions[2] = B_POSITION_PLAYER_RIGHT; gBattleBankFunc[3] = SetControllerToLinkOpponent; - gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2; + gBankPositions[3] = B_POSITION_OPPONENT_RIGHT; gNoOfAllBanks = 4; } @@ -554,12 +554,12 @@ static void SetControllersVariablesInLinkBattle(void) { case 0: case 3: - gBanksByIdentity[gLinkPlayers[i].lp_field_18] = 0; + gBankPositions[gLinkPlayers[i].lp_field_18] = 0; gBattlePartyID[gLinkPlayers[i].lp_field_18] = 0; break; case 1: case 2: - gBanksByIdentity[gLinkPlayers[i].lp_field_18] = 2; + gBankPositions[gLinkPlayers[i].lp_field_18] = 2; gBattlePartyID[gLinkPlayers[i].lp_field_18] = 3; break; } @@ -574,12 +574,12 @@ static void SetControllersVariablesInLinkBattle(void) { case 0: case 3: - gBanksByIdentity[gLinkPlayers[i].lp_field_18] = 0; + gBankPositions[gLinkPlayers[i].lp_field_18] = 0; gBattlePartyID[gLinkPlayers[i].lp_field_18] = 0; break; case 1: case 2: - gBanksByIdentity[gLinkPlayers[i].lp_field_18] = 2; + gBankPositions[gLinkPlayers[i].lp_field_18] = 2; gBattlePartyID[gLinkPlayers[i].lp_field_18] = 3; break; } @@ -591,12 +591,12 @@ static void SetControllersVariablesInLinkBattle(void) { case 0: case 3: - gBanksByIdentity[gLinkPlayers[i].lp_field_18] = 1; + gBankPositions[gLinkPlayers[i].lp_field_18] = 1; gBattlePartyID[gLinkPlayers[i].lp_field_18] = 0; break; case 1: case 2: - gBanksByIdentity[gLinkPlayers[i].lp_field_18] = 3; + gBankPositions[gLinkPlayers[i].lp_field_18] = 3; gBattlePartyID[gLinkPlayers[i].lp_field_18] = 3; break; } diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 775578ca2..5ded24863 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -29,7 +29,7 @@ extern u8 gNoOfAllBanks; extern u16 gUnknown_020243FC; extern u16 gBattlePartyID[BATTLE_BANKS_COUNT]; extern struct BattlePokemon gBattleMons[BATTLE_BANKS_COUNT]; -extern u8 gBanksByIdentity[BATTLE_BANKS_COUNT]; +extern u8 gBankPositions[BATTLE_BANKS_COUNT]; extern u8 gBankSpriteIds[BATTLE_BANKS_COUNT]; extern u8 gHealthBoxesIds[BATTLE_BANKS_COUNT]; extern u8 gBattleMonForms[BATTLE_BANKS_COUNT]; @@ -262,7 +262,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void) else if (var1 == MOVE_TARGET_SELECTED) chosenMoveId |= (BattlePalaceGetTargetRetValue()); else - chosenMoveId |= (GetBankByIdentity((GetBankIdentity(gActiveBank) & BIT_SIDE) ^ BIT_SIDE) << 8); + chosenMoveId |= (GetBankByIdentity((GetBankPosition(gActiveBank) & BIT_SIDE) ^ BIT_SIDE) << 8); return chosenMoveId; } @@ -299,13 +299,13 @@ static u16 BattlePalaceGetTargetRetValue(void) if (GetBankSide(gActiveBank) == SIDE_PLAYER) { - opposing1 = GetBankByIdentity(IDENTITY_OPPONENT_MON1); - opposing2 = GetBankByIdentity(IDENTITY_OPPONENT_MON2); + opposing1 = GetBankByIdentity(B_POSITION_OPPONENT_LEFT); + opposing2 = GetBankByIdentity(B_POSITION_OPPONENT_RIGHT); } else { - opposing1 = GetBankByIdentity(IDENTITY_PLAYER_MON1); - opposing2 = GetBankByIdentity(IDENTITY_PLAYER_MON2); + opposing1 = GetBankByIdentity(B_POSITION_PLAYER_LEFT); + opposing2 = GetBankByIdentity(B_POSITION_PLAYER_RIGHT); } if (gBattleMons[opposing1].hp == gBattleMons[opposing2].hp) @@ -561,7 +561,7 @@ void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 bank) } otId = GetMonData(mon, MON_DATA_OT_ID); - identity = GetBankIdentity(bank); + identity = GetBankPosition(bank); HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites[identity], species, currentPersonality); @@ -614,7 +614,7 @@ void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 bank) } otId = GetMonData(mon, MON_DATA_OT_ID); - identity = GetBankIdentity(bank); + identity = GetBankPosition(bank); if (sub_80688F8(1, bank) == 1 || gBattleSpritesDataPtr->bankData[bank].transformSpecies != SPECIES_NONE) { @@ -665,7 +665,7 @@ void nullsub_24(u16 species) void DecompressTrainerFrontPic(u16 frontPicId, u8 bank) { - u8 identity = GetBankIdentity(bank); + u8 identity = GetBankPosition(bank); DecompressPicFromTable_2(&gTrainerFrontPicTable[frontPicId], gMonSpritesGfxPtr->sprites[identity], SPECIES_NONE); @@ -674,7 +674,7 @@ void DecompressTrainerFrontPic(u16 frontPicId, u8 bank) void DecompressTrainerBackPic(u16 backPicId, u8 bank) { - u8 identity = GetBankIdentity(bank); + u8 identity = GetBankPosition(bank); DecompressPicFromTable_2(&gTrainerBackPicTable[backPicId], gMonSpritesGfxPtr->sprites[identity], SPECIES_NONE); @@ -713,7 +713,7 @@ void sub_805DFFC(void) numberOfBanks = 4; } for (i = 0; i < numberOfBanks; i++) - LoadCompressedObjectPic(&gUnknown_0832C108[gBanksByIdentity[i]]); + LoadCompressedObjectPic(&gUnknown_0832C108[gBankPositions[i]]); } bool8 BattleLoadAllHealthBoxesGfx(u8 state) @@ -739,9 +739,9 @@ bool8 BattleLoadAllHealthBoxesGfx(u8 state) else if (state == 3) LoadCompressedObjectPic(&gUnknown_0832C0D8); else if (state == 4) - LoadCompressedObjectPic(&gUnknown_0832C108[gBanksByIdentity[0]]); + LoadCompressedObjectPic(&gUnknown_0832C108[gBankPositions[0]]); else if (state == 5) - LoadCompressedObjectPic(&gUnknown_0832C108[gBanksByIdentity[1]]); + LoadCompressedObjectPic(&gUnknown_0832C108[gBankPositions[1]]); else retVal = TRUE; } @@ -756,13 +756,13 @@ bool8 BattleLoadAllHealthBoxesGfx(u8 state) else if (state == 5) LoadCompressedObjectPic(&gUnknown_0832C0F0[1]); else if (state == 6) - LoadCompressedObjectPic(&gUnknown_0832C108[gBanksByIdentity[0]]); + LoadCompressedObjectPic(&gUnknown_0832C108[gBankPositions[0]]); else if (state == 7) - LoadCompressedObjectPic(&gUnknown_0832C108[gBanksByIdentity[1]]); + LoadCompressedObjectPic(&gUnknown_0832C108[gBankPositions[1]]); else if (state == 8) - LoadCompressedObjectPic(&gUnknown_0832C108[gBanksByIdentity[2]]); + LoadCompressedObjectPic(&gUnknown_0832C108[gBankPositions[2]]); else if (state == 9) - LoadCompressedObjectPic(&gUnknown_0832C108[gBanksByIdentity[3]]); + LoadCompressedObjectPic(&gUnknown_0832C108[gBankPositions[3]]); else retVal = TRUE; } @@ -815,7 +815,7 @@ bool8 BattleInitAllSprites(u8 *state1, u8 *bank) break; case 4: SetBankHealthboxSpritePos(*bank); - if (gBanksByIdentity[*bank] <= 1) + if (gBankPositions[*bank] <= 1) DummyBattleInterfaceFunc(gHealthBoxesIds[*bank], FALSE); else DummyBattleInterfaceFunc(gHealthBoxesIds[*bank], TRUE); @@ -921,7 +921,7 @@ void HandleSpeciesGfxDataChange(u8 bankAtk, u8 bankDef, bool8 notTransform) } else { - identity = GetBankIdentity(bankAtk); + identity = GetBankPosition(bankAtk); if (GetBankSide(bankDef) == SIDE_OPPONENT) targetSpecies = GetMonData(&gEnemyParty[gBattlePartyID[bankDef]], MON_DATA_SPECIES); @@ -991,7 +991,7 @@ void BattleLoadSubstituteOrMonSpriteGfx(u8 bank, bool8 loadMonSprite) if (IsContest()) identity = 0; else - identity = GetBankIdentity(bank); + identity = GetBankPosition(bank); if (IsContest()) LZDecompressVram(gSubstituteDollTilemap, gMonSpritesGfxPtr->sprites[identity]); @@ -1080,7 +1080,7 @@ void HandleLowHpMusicChange(struct Pokemon *mon, u8 bank) void BattleStopLowHpSound(void) { - u8 playerBank = GetBankByIdentity(IDENTITY_PLAYER_MON1); + u8 playerBank = GetBankByIdentity(B_POSITION_PLAYER_LEFT); gBattleSpritesDataPtr->bankData[playerBank].lowHpSong = 0; if (IsDoubleBattle()) @@ -1101,8 +1101,8 @@ void sub_805EAE8(void) { if (gMain.inBattle) { - u8 playerBank1 = GetBankByIdentity(IDENTITY_PLAYER_MON1); - u8 playerBank2 = GetBankByIdentity(IDENTITY_PLAYER_MON2); + u8 playerBank1 = GetBankByIdentity(B_POSITION_PLAYER_LEFT); + u8 playerBank2 = GetBankByIdentity(B_POSITION_PLAYER_RIGHT); u8 bank1PartyId = pokemon_order_func(gBattlePartyID[playerBank1]); u8 bank2PartyId = pokemon_order_func(gBattlePartyID[playerBank2]); @@ -1143,14 +1143,14 @@ void LoadAndCreateEnemyShadowSprites(void) LoadCompressedObjectPic(&gSpriteSheet_EnemyShadow); - bank = GetBankByIdentity(IDENTITY_OPPONENT_MON1); - gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId = CreateSprite(&gSpriteTemplate_EnemyShadow, GetBankPosition(bank, 0), GetBankPosition(bank, 1) + 29, 0xC8); + bank = GetBankByIdentity(B_POSITION_OPPONENT_LEFT); + gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId = CreateSprite(&gSpriteTemplate_EnemyShadow, GetBankCoord(bank, 0), GetBankCoord(bank, 1) + 29, 0xC8); gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId].data[0] = bank; if (IsDoubleBattle()) { - bank = GetBankByIdentity(IDENTITY_OPPONENT_MON2); - gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId = CreateSprite(&gSpriteTemplate_EnemyShadow, GetBankPosition(bank, 0), GetBankPosition(bank, 1) + 29, 0xC8); + bank = GetBankByIdentity(B_POSITION_OPPONENT_RIGHT); + gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId = CreateSprite(&gSpriteTemplate_EnemyShadow, GetBankCoord(bank, 0), GetBankCoord(bank, 1) + 29, 0xC8); gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId].data[0] = bank; } } diff --git a/src/battle_interface.c b/src/battle_interface.c index 6a6bf00a2..05f500860 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -152,7 +152,7 @@ enum HEALTHBOX_GFX_117, }; -extern u8 gBanksByIdentity[BATTLE_BANKS_COUNT]; +extern u8 gBankPositions[BATTLE_BANKS_COUNT]; extern u16 gBattlePartyID[BATTLE_BANKS_COUNT]; extern u8 gNoOfAllBanks; extern u8 gHealthBoxesIds[BATTLE_BANKS_COUNT]; @@ -933,8 +933,8 @@ u8 CreateBankHealthboxSprites(u8 bank) { if (GetBankSide(bank) == SIDE_PLAYER) { - healthboxSpriteId_1 = CreateSprite(&sHealthboxPlayerSpriteTemplates[GetBankIdentity(bank) / 2], 240, 160, 1); - healthboxSpriteId_2 = CreateSpriteAtEnd(&sHealthboxPlayerSpriteTemplates[GetBankIdentity(bank) / 2], 240, 160, 1); + healthboxSpriteId_1 = CreateSprite(&sHealthboxPlayerSpriteTemplates[GetBankPosition(bank) / 2], 240, 160, 1); + healthboxSpriteId_2 = CreateSpriteAtEnd(&sHealthboxPlayerSpriteTemplates[GetBankPosition(bank) / 2], 240, 160, 1); gSprites[healthboxSpriteId_1].oam.affineParam = healthboxSpriteId_2; @@ -946,8 +946,8 @@ u8 CreateBankHealthboxSprites(u8 bank) } else { - healthboxSpriteId_1 = CreateSprite(&sHealthboxOpponentSpriteTemplates[GetBankIdentity(bank) / 2], 240, 160, 1); - healthboxSpriteId_2 = CreateSpriteAtEnd(&sHealthboxOpponentSpriteTemplates[GetBankIdentity(bank) / 2], 240, 160, 1); + healthboxSpriteId_1 = CreateSprite(&sHealthboxOpponentSpriteTemplates[GetBankPosition(bank) / 2], 240, 160, 1); + healthboxSpriteId_2 = CreateSpriteAtEnd(&sHealthboxOpponentSpriteTemplates[GetBankPosition(bank) / 2], 240, 160, 1); gSprites[healthboxSpriteId_1].oam.affineParam = healthboxSpriteId_2; @@ -959,7 +959,7 @@ u8 CreateBankHealthboxSprites(u8 bank) } } - unkSpriteId = CreateSpriteAtEnd(&sUnknown_0832C1C0[gBanksByIdentity[bank]], 140, 60, 0); + unkSpriteId = CreateSpriteAtEnd(&sUnknown_0832C1C0[gBankPositions[bank]], 140, 60, 0); unkSpritePtr = &gSprites[unkSpriteId]; SetSubspriteTables(unkSpritePtr, &sUnknown_0832C28C[GetBankSide(bank)]); unkSpritePtr->subspriteMode = 2; @@ -1111,18 +1111,18 @@ void SetBankHealthboxSpritePos(u8 bank) } else { - switch (GetBankIdentity(bank)) + switch (GetBankPosition(bank)) { - case IDENTITY_PLAYER_MON1: + case B_POSITION_PLAYER_LEFT: x = 159, y = 76; break; - case IDENTITY_PLAYER_MON2: + case B_POSITION_PLAYER_RIGHT: x = 171, y = 101; break; - case IDENTITY_OPPONENT_MON1: + case B_POSITION_OPPONENT_LEFT: x = 44, y = 19; break; - case IDENTITY_OPPONENT_MON2: + case B_POSITION_OPPONENT_RIGHT: x = 32, y = 44; break; } @@ -1353,7 +1353,7 @@ static void sub_80730D4(u8 healthboxSpriteId, struct Pokemon *mon) u8 i, var, nature, healthboxSpriteId_2; memcpy(text, sUnknown_0832C3C4, sizeof(sUnknown_0832C3C4)); - barFontGfx = &gMonSpritesGfxPtr->barFontGfx[0x520 + (GetBankIdentity(gSprites[healthboxSpriteId].data[6]) * 384)]; + barFontGfx = &gMonSpritesGfxPtr->barFontGfx[0x520 + (GetBankPosition(gSprites[healthboxSpriteId].data[6]) * 384)]; var = 5; nature = GetNature(mon); StringCopy(text + 6, gNatureNamePointers[nature]); @@ -1485,7 +1485,7 @@ u8 CreatePartyStatusSummarySprites(u8 bank, struct HpAndStatus *partyInfo, u8 ar u8 ballIconSpritesIds[6]; u8 taskId; - if (!arg2 || GetBankIdentity(bank) != IDENTITY_OPPONENT_MON2) + if (!arg2 || GetBankPosition(bank) != B_POSITION_OPPONENT_RIGHT) { if (GetBankSide(bank) == SIDE_PLAYER) { diff --git a/src/battle_message.c b/src/battle_message.c index e37a4c30c..80aa5e3f9 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1834,25 +1834,25 @@ u32 BattleStringExpandPlaceholders(const u8* src, u8* dst) toCpy = gStringVar3; break; case B_TXT_PLAYER_MON1_NAME: // first player poke name - GetMonData(&gPlayerParty[gBattlePartyID[GetBankByIdentity(IDENTITY_PLAYER_MON1)]], + GetMonData(&gPlayerParty[gBattlePartyID[GetBankByIdentity(B_POSITION_PLAYER_LEFT)]], MON_DATA_NICKNAME, text); StringGetEnd10(text); toCpy = text; break; case B_TXT_OPPONENT_MON1_NAME: // first enemy poke name - GetMonData(&gEnemyParty[gBattlePartyID[GetBankByIdentity(IDENTITY_OPPONENT_MON1)]], + GetMonData(&gEnemyParty[gBattlePartyID[GetBankByIdentity(B_POSITION_OPPONENT_LEFT)]], MON_DATA_NICKNAME, text); StringGetEnd10(text); toCpy = text; break; case B_TXT_PLAYER_MON2_NAME: // second player poke name - GetMonData(&gPlayerParty[gBattlePartyID[GetBankByIdentity(IDENTITY_PLAYER_MON2)]], + GetMonData(&gPlayerParty[gBattlePartyID[GetBankByIdentity(B_POSITION_PLAYER_RIGHT)]], MON_DATA_NICKNAME, text); StringGetEnd10(text); toCpy = text; break; case B_TXT_OPPONENT_MON2_NAME: // second enemy poke name - GetMonData(&gEnemyParty[gBattlePartyID[GetBankByIdentity(IDENTITY_OPPONENT_MON2)]], + GetMonData(&gEnemyParty[gBattlePartyID[GetBankByIdentity(B_POSITION_OPPONENT_RIGHT)]], MON_DATA_NICKNAME, text); StringGetEnd10(text); toCpy = text; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index c7976fc2a..18c094571 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -4661,7 +4661,7 @@ _0804BA58:\n\ ldr r6, =gActiveBank\n\ ldrb r0, [r6]\n\ str r3, [sp]\n\ - bl GetBankIdentity\n\ + bl GetBankPosition\n\ mov r1, r10\n\ ands r1, r0\n\ lsls r0, r1, 1\n\ @@ -5103,7 +5103,7 @@ static void atk49_moveend(void) && !gProtectStructs[gBankAttacker].chargingTurn && gBattleMoves[gCurrentMove].target == MOVE_TARGET_BOTH && !(gHitMarker & HITMARKER_NO_ATTACKSTRING)) { - u8 bank = GetBankByIdentity(GetBankIdentity(gBankTarget) ^ BIT_MON); + u8 bank = GetBankByIdentity(GetBankPosition(gBankTarget) ^ BIT_MON); if (gBattleMons[bank].hp != 0) { gBankTarget = bank; @@ -5454,10 +5454,10 @@ static void atk4F_jumpifcantswitch(void) { if (GetBankSide(gActiveBank) == SIDE_OPPONENT) { - r7 = GetBankByIdentity(IDENTITY_OPPONENT_MON1); + r7 = GetBankByIdentity(B_POSITION_OPPONENT_LEFT); if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) - compareVar = GetBankByIdentity(IDENTITY_OPPONENT_MON2); + compareVar = GetBankByIdentity(B_POSITION_OPPONENT_RIGHT); else compareVar = r7; @@ -5465,10 +5465,10 @@ static void atk4F_jumpifcantswitch(void) } else { - r7 = GetBankByIdentity(IDENTITY_PLAYER_MON1); + r7 = GetBankByIdentity(B_POSITION_PLAYER_LEFT); if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) - compareVar = GetBankByIdentity(IDENTITY_PLAYER_MON2); + compareVar = GetBankByIdentity(B_POSITION_PLAYER_RIGHT); else compareVar = r7; @@ -5763,7 +5763,7 @@ static void atk50_openpartyscreen(void) gBattlescriptCurrInstr += 6; - if (GetBankIdentity(gActiveBank) == 0 && gBattleResults.playerSwitchesCounter < 0xFF) + if (GetBankPosition(gActiveBank) == 0 && gBattleResults.playerSwitchesCounter < 0xFF) gBattleResults.playerSwitchesCounter++; if (gBattleTypeFlags & BATTLE_TYPE_MULTI) @@ -5779,7 +5779,7 @@ static void atk50_openpartyscreen(void) } else { - gActiveBank = GetBankByIdentity(GetBankIdentity(bank) ^ BIT_SIDE); + gActiveBank = GetBankByIdentity(GetBankPosition(bank) ^ BIT_SIDE); if (gAbsentBankFlags & gBitTable[gActiveBank]) gActiveBank ^= BIT_MON; @@ -5976,7 +5976,7 @@ static void atk56_playfaintcry(void) static void atk57(void) { - gActiveBank = GetBankByIdentity(IDENTITY_PLAYER_MON1); + gActiveBank = GetBankByIdentity(B_POSITION_PLAYER_LEFT); EmitCmd55(0, gBattleOutcome); MarkBufferBankForExecution(gActiveBank); @@ -6011,7 +6011,7 @@ static void atk59_handlelearnnewmove(void) } else { - gActiveBank = GetBankByIdentity(IDENTITY_PLAYER_MON1); + gActiveBank = GetBankByIdentity(B_POSITION_PLAYER_LEFT); if (gBattlePartyID[gActiveBank] == gBattleStruct->expGetterId && !(gBattleMons[gActiveBank].status2 & STATUS2_TRANSFORMED)) @@ -6020,7 +6020,7 @@ static void atk59_handlelearnnewmove(void) } if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { - gActiveBank = GetBankByIdentity(IDENTITY_PLAYER_MON2); + gActiveBank = GetBankByIdentity(B_POSITION_PLAYER_RIGHT); if (gBattlePartyID[gActiveBank] == gBattleStruct->expGetterId && !(gBattleMons[gActiveBank].status2 & STATUS2_TRANSFORMED)) { @@ -6851,7 +6851,7 @@ static void atk6D_resetsentmonsvalue(void) static void atk6E_setatktoplayer0(void) { - gBankAttacker = GetBankByIdentity(IDENTITY_PLAYER_MON1); + gBankAttacker = GetBankByIdentity(B_POSITION_PLAYER_LEFT); gBattlescriptCurrInstr++; } @@ -8309,7 +8309,7 @@ static void atk98_updatestatusicon(void) } if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) { - gActiveBank = GetBankByIdentity(GetBankIdentity(gBankAttacker) ^ BIT_MON); + gActiveBank = GetBankByIdentity(GetBankPosition(gBankAttacker) ^ BIT_MON); if (!(gAbsentBankFlags & gBitTable[gActiveBank])) { EmitStatusIconUpdate(0, gBattleMons[gActiveBank].status1, gBattleMons[gActiveBank].status2); @@ -8978,7 +8978,7 @@ static void atkAE_healpartystatus(void) gBattleCommunication[MULTISTRING_CHOOSER] |= 1; } - gActiveBank = gBattleScripting.bank = GetBankByIdentity(GetBankIdentity(gBankAttacker) ^ BIT_MON); + gActiveBank = gBattleScripting.bank = GetBankByIdentity(GetBankPosition(gBankAttacker) ^ BIT_MON); if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && !(gAbsentBankFlags & gBitTable[gActiveBank])) @@ -9026,7 +9026,7 @@ static void atkAE_healpartystatus(void) gBattleMons[gBankAttacker].status1 = 0; gBattleMons[gBankAttacker].status2 &= ~(STATUS2_NIGHTMARE); - gActiveBank = GetBankByIdentity(GetBankIdentity(gBankAttacker) ^ BIT_MON); + gActiveBank = GetBankByIdentity(GetBankPosition(gBankAttacker) ^ BIT_MON); if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && !(gAbsentBankFlags & gBitTable[gActiveBank])) { @@ -9296,16 +9296,16 @@ static void atkBA_jumpifnopursuitswitchdmg(void) if (gMultiHitCounter == 1) { if (GetBankSide(gBankAttacker) == SIDE_PLAYER) - gBankTarget = GetBankByIdentity(IDENTITY_OPPONENT_MON1); + gBankTarget = GetBankByIdentity(B_POSITION_OPPONENT_LEFT); else - gBankTarget = GetBankByIdentity(IDENTITY_PLAYER_MON1); + gBankTarget = GetBankByIdentity(B_POSITION_PLAYER_LEFT); } else { if (GetBankSide(gBankAttacker) == SIDE_PLAYER) - gBankTarget = GetBankByIdentity(IDENTITY_OPPONENT_MON2); + gBankTarget = GetBankByIdentity(B_POSITION_OPPONENT_RIGHT); else - gBankTarget = GetBankByIdentity(IDENTITY_PLAYER_MON2); + gBankTarget = GetBankByIdentity(B_POSITION_PLAYER_RIGHT); } if (gActionForBanks[gBankTarget] == ACTION_USE_MOVE @@ -9875,7 +9875,7 @@ static void atkD0_settaunt(void) static void atkD1_trysethelpinghand(void) { - gBankTarget = GetBankByIdentity(GetBankIdentity(gBankAttacker) ^ BIT_MON); + gBankTarget = GetBankByIdentity(GetBankPosition(gBankAttacker) ^ BIT_MON); if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && !(gAbsentBankFlags & gBitTable[gBankTarget]) @@ -10544,7 +10544,7 @@ static void atkEB_settypetoterrain(void) static void atkEC_pursuitrelated(void) { - gActiveBank = GetBankByIdentity(GetBankIdentity(gBankAttacker) ^ BIT_MON); + gActiveBank = GetBankByIdentity(GetBankPosition(gBankAttacker) ^ BIT_MON); if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && !(gAbsentBankFlags & gBitTable[gActiveBank]) diff --git a/src/battle_util.c b/src/battle_util.c index 2ce37cfbd..2a1b421f5 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -104,16 +104,16 @@ u8 GetBattleBank(u8 caseId) case 8: case 9: case BS_GET_PLAYER1: - ret = GetBankByIdentity(IDENTITY_PLAYER_MON1); + ret = GetBankByIdentity(B_POSITION_PLAYER_LEFT); break; case BS_GET_OPPONENT1: - ret = GetBankByIdentity(IDENTITY_OPPONENT_MON1); + ret = GetBankByIdentity(B_POSITION_OPPONENT_LEFT); break; case BS_GET_PLAYER2: - ret = GetBankByIdentity(IDENTITY_PLAYER_MON2); + ret = GetBankByIdentity(B_POSITION_PLAYER_RIGHT); break; case BS_GET_OPPONENT2: - ret = GetBankByIdentity(IDENTITY_OPPONENT_MON2); + ret = GetBankByIdentity(B_POSITION_OPPONENT_RIGHT); break; } return ret; @@ -1667,14 +1667,14 @@ bool8 sub_80423F4(u8 bank, u8 r1, u8 r2) { if (GetBankSide(bank) == SIDE_OPPONENT) { - r7 = GetBankByIdentity(IDENTITY_OPPONENT_MON1); - r6 = GetBankByIdentity(IDENTITY_OPPONENT_MON2); + r7 = GetBankByIdentity(B_POSITION_OPPONENT_LEFT); + r6 = GetBankByIdentity(B_POSITION_OPPONENT_RIGHT); party = gEnemyParty; } else { - r7 = GetBankByIdentity(IDENTITY_PLAYER_MON1); - r6 = GetBankByIdentity(IDENTITY_PLAYER_MON2); + r7 = GetBankByIdentity(B_POSITION_PLAYER_LEFT); + r6 = GetBankByIdentity(B_POSITION_PLAYER_RIGHT); party = gPlayerParty; } if (r1 == 6) @@ -2335,7 +2335,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg) if (gBattleMons[i].ability == ABILITY_TRACE && (gStatuses3[i] & STATUS3_TRACE)) { u8 target2; - side = (GetBankIdentity(i) ^ BIT_SIDE) & BIT_SIDE; // side of the opposing pokemon + side = (GetBankPosition(i) ^ BIT_SIDE) & BIT_SIDE; // side of the opposing pokemon target1 = GetBankByIdentity(side); target2 = GetBankByIdentity(side + BIT_MON); if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) @@ -3268,7 +3268,7 @@ u8 GetMoveTarget(u16 move, u8 useMoveTarget) case MOVE_TARGET_BOTH: case MOVE_TARGET_FOES_AND_ALLY: case MOVE_TARGET_OPPONENTS_FIELD: - targetBank = GetBankByIdentity((GetBankIdentity(gBankAttacker) & BIT_SIDE) ^ BIT_SIDE); + targetBank = GetBankByIdentity((GetBankPosition(gBankAttacker) & BIT_SIDE) ^ BIT_SIDE); if (gAbsentBankFlags & gBitTable[targetBank]) targetBank ^= BIT_MON; break; @@ -3281,22 +3281,22 @@ u8 GetMoveTarget(u16 move, u8 useMoveTarget) if (GetBankSide(gBankAttacker) == SIDE_PLAYER) { if (Random() & 1) - targetBank = GetBankByIdentity(IDENTITY_OPPONENT_MON1); + targetBank = GetBankByIdentity(B_POSITION_OPPONENT_LEFT); else - targetBank = GetBankByIdentity(IDENTITY_OPPONENT_MON2); + targetBank = GetBankByIdentity(B_POSITION_OPPONENT_RIGHT); } else { if (Random() & 1) - targetBank = GetBankByIdentity(IDENTITY_PLAYER_MON1); + targetBank = GetBankByIdentity(B_POSITION_PLAYER_LEFT); else - targetBank = GetBankByIdentity(IDENTITY_PLAYER_MON2); + targetBank = GetBankByIdentity(B_POSITION_PLAYER_RIGHT); } if (gAbsentBankFlags & gBitTable[targetBank]) targetBank ^= BIT_MON; } else - targetBank = GetBankByIdentity((GetBankIdentity(gBankAttacker) & BIT_SIDE) ^ BIT_SIDE); + targetBank = GetBankByIdentity((GetBankPosition(gBankAttacker) & BIT_SIDE) ^ BIT_SIDE); break; case MOVE_TARGET_USER: case MOVE_TARGET_x10: @@ -3332,7 +3332,7 @@ u8 IsMonDisobedient(void) if (HasObedientBitSet(gBankAttacker)) // only if species is Mew or Deoxys { - if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && GetBankIdentity(gBankAttacker) == 2) + if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && GetBankPosition(gBankAttacker) == 2) return 0; if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER) return 0; diff --git a/src/battle_util2.c b/src/battle_util2.c index 538c1c641..d242ab6c9 100644 --- a/src/battle_util2.c +++ b/src/battle_util2.c @@ -87,15 +87,15 @@ void AdjustFriendshipOnBattleFaint(u8 bank) { u8 opposingBank2; - opposingBank = GetBankByIdentity(IDENTITY_OPPONENT_MON1); - opposingBank2 = GetBankByIdentity(IDENTITY_OPPONENT_MON2); + opposingBank = GetBankByIdentity(B_POSITION_OPPONENT_LEFT); + opposingBank2 = GetBankByIdentity(B_POSITION_OPPONENT_RIGHT); if (gBattleMons[opposingBank2].level > gBattleMons[opposingBank].level) opposingBank = opposingBank2; } else { - opposingBank = GetBankByIdentity(IDENTITY_OPPONENT_MON1); + opposingBank = GetBankByIdentity(B_POSITION_OPPONENT_LEFT); } if (gBattleMons[opposingBank].level > gBattleMons[bank].level) diff --git a/src/pokeball.c b/src/pokeball.c index b48e55135..86ab85b6a 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -384,14 +384,14 @@ static void Task_DoPokeballSendOutAnim(u8 taskId) gSprites[ballSpriteId].callback = SpriteCB_PlayerMonSendOut_1; break; case POKEBALL_OPPONENT_SENDOUT: - gSprites[ballSpriteId].pos1.x = GetBankPosition(bank, BANK_X_POS); - gSprites[ballSpriteId].pos1.y = GetBankPosition(bank, BANK_Y_POS) + 24; + gSprites[ballSpriteId].pos1.x = GetBankCoord(bank, BANK_X_POS); + gSprites[ballSpriteId].pos1.y = GetBankCoord(bank, BANK_Y_POS) + 24; gBankTarget = bank; gSprites[ballSpriteId].data[0] = 0; gSprites[ballSpriteId].callback = SpriteCB_OpponentMonSendOut; break; default: - gBankTarget = GetBankByIdentity(IDENTITY_OPPONENT_MON1); + gBankTarget = GetBankByIdentity(B_POSITION_OPPONENT_LEFT); notSendOut = TRUE; break; } @@ -405,8 +405,8 @@ static void Task_DoPokeballSendOutAnim(u8 taskId) // this will perform an unused ball throw animation gSprites[ballSpriteId].data[0] = 0x22; - gSprites[ballSpriteId].data[2] = GetBankPosition(gBankTarget, BANK_X_POS); - gSprites[ballSpriteId].data[4] = GetBankPosition(gBankTarget, BANK_Y_POS) - 16; + gSprites[ballSpriteId].data[2] = GetBankCoord(gBankTarget, BANK_X_POS); + gSprites[ballSpriteId].data[4] = GetBankCoord(gBankTarget, BANK_Y_POS) - 16; gSprites[ballSpriteId].data[5] = -40; sub_80A68D4(&gSprites[ballSpriteId]); gSprites[ballSpriteId].oam.affineParam = taskId; @@ -767,7 +767,7 @@ static void SpriteCB_ReleaseMonFromBall(struct Sprite *sprite) } species = GetMonData(mon, MON_DATA_SPECIES); - if ((bank == GetBankByIdentity(IDENTITY_PLAYER_MON1) || bank == GetBankByIdentity(IDENTITY_OPPONENT_MON1)) + if ((bank == GetBankByIdentity(B_POSITION_PLAYER_LEFT) || bank == GetBankByIdentity(B_POSITION_OPPONENT_LEFT)) && IsDoubleBattle() && gBattleSpritesDataPtr->animationData->field_9_x1) { if (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) @@ -783,7 +783,7 @@ static void SpriteCB_ReleaseMonFromBall(struct Sprite *sprite) if (!IsDoubleBattle() || !gBattleSpritesDataPtr->animationData->field_9_x1) wantedCryCase = 0; - else if (bank == GetBankByIdentity(IDENTITY_PLAYER_MON1) || bank == GetBankByIdentity(IDENTITY_OPPONENT_MON1)) + else if (bank == GetBankByIdentity(B_POSITION_PLAYER_LEFT) || bank == GetBankByIdentity(B_POSITION_OPPONENT_LEFT)) wantedCryCase = 1; else wantedCryCase = 2; @@ -900,8 +900,8 @@ static void sub_80760F8(struct Sprite *sprite) static void SpriteCB_PlayerMonSendOut_1(struct Sprite *sprite) { sprite->data[0] = 25; - sprite->data[2] = GetBankPosition(sprite->sBank, 2); - sprite->data[4] = GetBankPosition(sprite->sBank, 3) + 24; + sprite->data[2] = GetBankCoord(sprite->sBank, 2); + sprite->data[4] = GetBankCoord(sprite->sBank, 3) + 24; sprite->data[5] = -30; sprite->oam.affineParam = sprite->sBank; sub_80A68D4(sprite); @@ -956,7 +956,7 @@ static void SpriteCB_PlayerMonSendOut_2(struct Sprite *sprite) sprite->data[0] = 0; if (IsDoubleBattle() && gBattleSpritesDataPtr->animationData->field_9_x1 - && sprite->sBank == GetBankByIdentity(IDENTITY_PLAYER_MON2)) + && sprite->sBank == GetBankByIdentity(B_POSITION_PLAYER_RIGHT)) sprite->callback = SpriteCB_ReleaseMon2FromBall; else sprite->callback = SpriteCB_ReleaseMonFromBall; @@ -982,7 +982,7 @@ static void SpriteCB_OpponentMonSendOut(struct Sprite *sprite) { sprite->data[0] = 0; if (IsDoubleBattle() && gBattleSpritesDataPtr->animationData->field_9_x1 - && sprite->sBank == GetBankByIdentity(IDENTITY_OPPONENT_MON2)) + && sprite->sBank == GetBankByIdentity(B_POSITION_OPPONENT_RIGHT)) sprite->callback = SpriteCB_ReleaseMon2FromBall; else sprite->callback = SpriteCB_ReleaseMonFromBall; @@ -1198,7 +1198,7 @@ void sub_8076918(u8 bank) healthboxSprite->pos2.y = -healthboxSprite->pos2.y; } gSprites[healthboxSprite->data[5]].callback(&gSprites[healthboxSprite->data[5]]); - if (GetBankIdentity(bank) == IDENTITY_PLAYER_MON2) + if (GetBankPosition(bank) == B_POSITION_PLAYER_RIGHT) healthboxSprite->callback = sub_80769A8; } diff --git a/src/pokemon_2.c b/src/pokemon_2.c index db176e025..8640eacde 100644 --- a/src/pokemon_2.c +++ b/src/pokemon_2.c @@ -36,7 +36,7 @@ extern const u8 gText_EggNickname[]; extern u8 GetBankSide(u8 bank); extern u8 GetBankByIdentity(u8 bank); -extern u8 GetBankIdentity(u8 bank); +extern u8 GetBankPosition(u8 bank); u8 CountAliveMonsInBattle(u8 caseId) { @@ -86,7 +86,7 @@ bool8 ShouldGetStatBadgeBoost(u16 badgeFlag, u8 bank) u8 GetDefaultMoveTarget(u8 bank) { - u8 status = GetBankIdentity(bank) & 1; + u8 status = GetBankPosition(bank) & 1; status ^= 1; if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) diff --git a/src/reshow_battle_screen.c b/src/reshow_battle_screen.c index 3df2ff151..16d902aaa 100644 --- a/src/reshow_battle_screen.c +++ b/src/reshow_battle_screen.c @@ -42,7 +42,7 @@ extern u8 GetBankSpriteDefault_Y(u8 bank); extern u8 sub_80A82E4(u8 bank); extern void sub_806A068(u16 species, u8 bankIdentity); extern void sub_806A12C(u16 backPicId, u8 bankIdentity); -extern u8 GetBankPosition(u8 bank, u8 caseId); +extern u8 GetBankCoord(u8 bank, u8 caseId); // this file's functions static void CB2_ReshowBattleScreenAfterMenu(void); @@ -164,13 +164,13 @@ static void CB2_ReshowBattleScreenAfterMenu(void) LoadAndCreateEnemyShadowSprites(); - opponentBank = GetBankByIdentity(IDENTITY_OPPONENT_MON1); + opponentBank = GetBankByIdentity(B_POSITION_OPPONENT_LEFT); species = GetMonData(&gEnemyParty[gBattlePartyID[opponentBank]], MON_DATA_SPECIES); SetBankEnemyShadowSpriteCallback(opponentBank, species); if (IsDoubleBattle()) { - opponentBank = GetBankByIdentity(IDENTITY_OPPONENT_MON2); + opponentBank = GetBankByIdentity(B_POSITION_OPPONENT_RIGHT); species = GetMonData(&gEnemyParty[gBattlePartyID[opponentBank]], MON_DATA_SPECIES); SetBankEnemyShadowSpriteCallback(opponentBank, species); } @@ -259,8 +259,8 @@ static void CreateBankSprite(u8 bank) if (GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_HP) == 0) return; - sub_806A068(GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_SPECIES), GetBankIdentity(bank)); - gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, GetBankPosition(bank, 2), posY, sub_80A82E4(bank)); + sub_806A068(GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_SPECIES), GetBankPosition(bank)); + gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, GetBankCoord(bank, 2), posY, sub_80A82E4(bank)); gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank; gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy; gSprites[gBankSpriteIds[bank]].data[0] = bank; @@ -272,7 +272,7 @@ static void CreateBankSprite(u8 bank) } else if (gBattleTypeFlags & BATTLE_TYPE_SAFARI && bank == 0) { - sub_806A12C(gSaveBlock2Ptr->playerGender, GetBankIdentity(IDENTITY_PLAYER_MON1)); + sub_806A12C(gSaveBlock2Ptr->playerGender, GetBankPosition(B_POSITION_PLAYER_LEFT)); gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, 0x50, (8 - gTrainerBackPicCoords[gSaveBlock2Ptr->playerGender].coords) * 4 + 80, sub_80A82E4(0)); @@ -282,7 +282,7 @@ static void CreateBankSprite(u8 bank) } else if (gBattleTypeFlags & BATTLE_TYPE_WALLY_TUTORIAL && bank == 0) { - sub_806A12C(BACK_PIC_WALLY, GetBankIdentity(0)); + sub_806A12C(BACK_PIC_WALLY, GetBankPosition(0)); gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, 0x50, (8 - gTrainerBackPicCoords[BACK_PIC_WALLY].coords) * 4 + 80, sub_80A82E4(0)); @@ -295,8 +295,8 @@ static void CreateBankSprite(u8 bank) if (GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_HP) == 0) return; - sub_806A068(GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_SPECIES), GetBankIdentity(bank)); - gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, GetBankPosition(bank, 2), posY, sub_80A82E4(bank)); + sub_806A068(GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_SPECIES), GetBankPosition(bank)); + gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, GetBankCoord(bank, 2), posY, sub_80A82E4(bank)); gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank; gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy; gSprites[gBankSpriteIds[bank]].data[0] = bank; @@ -335,7 +335,7 @@ static void CreateHealthboxSprite(u8 bank) else UpdateHealthboxAttribute(gHealthBoxesIds[bank], &gPlayerParty[gBattlePartyID[bank]], HEALTHBOX_ALL); - if (GetBankIdentity(bank) == IDENTITY_OPPONENT_MON2 || GetBankIdentity(bank) == IDENTITY_PLAYER_MON2) + if (GetBankPosition(bank) == B_POSITION_OPPONENT_RIGHT || GetBankPosition(bank) == B_POSITION_PLAYER_RIGHT) DummyBattleInterfaceFunc(gHealthBoxesIds[bank], TRUE); else DummyBattleInterfaceFunc(gHealthBoxesIds[bank], FALSE); diff --git a/sym_ewram.txt b/sym_ewram.txt index 4af63595e..092b30ccd 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -282,7 +282,7 @@ gNoOfAllBanks: @ 202406C gBattlePartyID: @ 202406E .space 0x8 -gBanksByIdentity: @ 2024076 +gBankPositions: @ 2024076 .space 0x4 gActionsByTurnOrder: @ 202407A