diff options
Diffstat (limited to 'src/battle_controller_player_partner.c')
-rw-r--r-- | src/battle_controller_player_partner.c | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index e40ba8a69..df35e54c4 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -20,6 +20,7 @@ #include "bg.h" #include "reshow_battle_screen.h" #include "pokeball.h" +#include "data2.h" extern u32 gBattleExecBuffer; extern u8 gActiveBank; @@ -135,7 +136,7 @@ static void PlayerPartnerDoMoveAnimation(void); static void sub_81BE2C8(u8 taskId); static void sub_81BE498(void); -static void (*const sPlayerPartnerBufferCommands[CONTOLLER_CMDS_COUNT])(void) = +static void (*const sPlayerPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = { PlayerPartnerHandleGetMonData, PlayerPartnerHandleGetRawMonData, @@ -557,7 +558,7 @@ static void sub_81BB92C(void) { if (gSprites[gHealthBoxesIds[gActiveBank]].callback == SpriteCallbackDummy) { - SetBattleSpriteInvisibilityBitToSpriteInvisibility(gActiveBank); + CopyBattleSpriteInvisibility(gActiveBank); if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); @@ -619,7 +620,7 @@ static void PlayerPartnerBufferExecCompleted(void) u8 playerId = GetMultiplayerId(); PrepareBufferDataTransferLink(2, 4, &playerId); - gBattleBufferA[gActiveBank][0] = CONTOLLER_CMDS_COUNT - 1; + gBattleBufferA[gActiveBank][0] = CONTROLLER_CMDS_COUNT - 1; } else { @@ -643,7 +644,7 @@ static void PlayerPartnerHandleGetMonData(void) { u8 monData[sizeof(struct Pokemon) * 2 + 56]; // this allows to get full data of two pokemon, trying to get more will result in overwriting data u32 size = 0; - u8 monsToCheck; + u8 monToCheck; s32 i; if (gBattleBufferA[gActiveBank][2] == 0) @@ -652,12 +653,12 @@ static void PlayerPartnerHandleGetMonData(void) } else { - monsToCheck = gBattleBufferA[gActiveBank][2]; + monToCheck = gBattleBufferA[gActiveBank][2]; for (i = 0; i < 6; i++) { - if (monsToCheck & 1) + if (monToCheck & 1) size += CopyPlayerPartnerMonData(i, monData + size); - monsToCheck >>= 1; + monToCheck >>= 1; } } EmitDataTransfer(1, size, monData); @@ -977,7 +978,7 @@ static void PlayerPartnerHandleGetRawMonData(void) static void PlayerPartnerHandleSetMonData(void) { - u8 monsToCheck; + u8 monToCheck; u8 i; if (gBattleBufferA[gActiveBank][2] == 0) @@ -986,12 +987,12 @@ static void PlayerPartnerHandleSetMonData(void) } else { - monsToCheck = gBattleBufferA[gActiveBank][2]; + monToCheck = gBattleBufferA[gActiveBank][2]; for (i = 0; i < 6; i++) { - if (monsToCheck & 1) + if (monToCheck & 1) SetPlayerPartnerMonData(i); - monsToCheck >>= 1; + monToCheck >>= 1; } } PlayerPartnerBufferExecCompleted(); @@ -1322,17 +1323,6 @@ static void DoSwitchOutAnimation(void) } } -// todo: get rid of it once the struct is declared in a header -struct MonCoords -{ - // This would use a bitfield, but sub_8079F44 - // uses it as a u8 and casting won't match. - u8 coords; // u8 x:4, y:4; - u8 y_offset; -}; -extern const struct MonCoords gTrainerBackPicCoords[]; -extern const struct MonCoords gTrainerFrontPicCoords[]; - // some explanation here // in emerald it's possible to have a tag battle in the battle frontier facilities with AI // which use the front sprite for both the player and the partner as opposed to any other battles (including the one with Steven) that use the back pic as well as animate it @@ -1927,7 +1917,7 @@ static void PlayerPartnerHandleSpriteInvisibility(void) if (IsBankSpritePresent(gActiveBank)) { gSprites[gBankSpriteIds[gActiveBank]].invisible = gBattleBufferA[gActiveBank][1]; - SetBattleSpriteInvisibilityBitToSpriteInvisibility(gActiveBank); + CopyBattleSpriteInvisibility(gActiveBank); } PlayerPartnerBufferExecCompleted(); } |