diff options
-rw-r--r-- | asm/party_menu.s | 26 | ||||
-rw-r--r-- | include/party_menu.h | 2 | ||||
-rw-r--r-- | src/battle_party_menu.c | 5 | ||||
-rw-r--r-- | src/party_menu.c | 7 |
4 files changed, 11 insertions, 29 deletions
diff --git a/asm/party_menu.s b/asm/party_menu.s index 9c121ea3d..aa6075723 100644 --- a/asm/party_menu.s +++ b/asm/party_menu.s @@ -4662,7 +4662,7 @@ sub_806D198: @ 806D198 ldrb r1, [r4, 0x6] muls r1, r6 adds r1, r5 - bl sub_806E6F0 + bl SwapPokemon ldrb r0, [r4, 0x5] adds r1, r0, 0 muls r1, r6 @@ -7277,28 +7277,4 @@ _0806E6D0: _0806E6EC: .4byte gPlayerParty thumb_func_end PartyMenuDrawHPBars - thumb_func_start sub_806E6F0 -sub_806E6F0: @ 806E6F0 - push {r4,r5,lr} - sub sp, 0x64 - adds r4, r0, 0 - adds r5, r1, 0 - mov r0, sp - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x64 - bl memcpy - adds r0, r5, 0 - mov r1, sp - movs r2, 0x64 - bl memcpy - add sp, 0x64 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_806E6F0 - .align 2, 0 @ Don't pad with nop. diff --git a/include/party_menu.h b/include/party_menu.h index bc4d938ef..46063831a 100644 --- a/include/party_menu.h +++ b/include/party_menu.h @@ -113,7 +113,7 @@ void PartyMenuDoPrintHP(u8, int, u16, u16); void PartyMenuTryPrintMonsHP(void); void nullsub_13(void); void PartyMenuDrawHPBars(void); -void sub_806E6F0(); +void SwapPokemon(struct Pokemon *a, struct Pokemon *b); void SetPartyPopupMenuOffsets(u8 menuIndex, u8 *left, u8 *top, const struct PartyPopupMenu *menu); void ShowPartyPopupMenu(u8 menuIndex, const struct PartyPopupMenu *menu, const struct MenuAction2 *menuActions, u8 cursorPos); void ClosePartyPopupMenu(u8 index, const struct PartyPopupMenu *menu); diff --git a/src/battle_party_menu.c b/src/battle_party_menu.c index ca883daec..9db9b0dab 100644 --- a/src/battle_party_menu.c +++ b/src/battle_party_menu.c @@ -40,7 +40,6 @@ extern void sub_806AF4C(); extern void sub_806AEDC(void); extern u8 *sub_8040D08(); extern void sub_8040B8C(void); -extern void sub_806E6F0(); extern void nullsub_14(); extern void OpenPartyMenu(); extern u8 sub_803FBBC(void); @@ -338,7 +337,7 @@ void unref_sub_8094DB0(void) { r4 = sub_8094C20(0); sub_8094C98(0, i); - sub_806E6F0(&gPlayerParty[r4], &gPlayerParty[n]); + SwapPokemon(&gPlayerParty[r4], &gPlayerParty[n]); break; } } @@ -732,7 +731,7 @@ static void Task_BattlePartyMenuShift(u8 taskId) gUnknown_0202E8F4 = 1; r4 = pokemon_order_func(gBattlePartyID[gBankInMenu]); sub_8094C98(r4, partySelection); - sub_806E6F0(&gPlayerParty[r4], &gPlayerParty[partySelection]); + SwapPokemon(&gPlayerParty[r4], &gPlayerParty[partySelection]); gTasks[taskId].func = Task_809527C; } diff --git a/src/party_menu.c b/src/party_menu.c index e98af59ee..553ff0ad0 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -112,6 +112,13 @@ void sub_806AEDC(void) #endif +void SwapPokemon(struct Pokemon *a, struct Pokemon *b) +{ + struct Pokemon temp = *a; + *a = *b; + *b = temp; +} + void SetPartyPopupMenuOffsets(u8 menuIndex, u8 *left, u8 *top, const struct PartyPopupMenu *menu) { u8 bottomOffset = (2 * menu[menuIndex].numChoices) + 2; |