diff --git a/include/battle_controllers.h b/include/battle_controllers.h index 32918fefb..5b1ada11a 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -85,8 +85,8 @@ enum struct UnusedControllerStruct { - u8 field_0:7; - u8 flag_x80:1; + u8 unk:7; + u8 flag:1; }; struct HpAndStatus @@ -145,19 +145,19 @@ enum CONTROLLER_STATUSXOR, CONTROLLER_DATATRANSFER, CONTROLLER_DMA3TRANSFER, - CONTROLLER_31, + CONTROLLER_PLAYBGM, CONTROLLER_32, CONTROLLER_TWORETURNVALUES, CONTROLLER_CHOSENMONRETURNVALUE, CONTROLLER_ONERETURNVALUE, CONTROLLER_ONERETURNVALUE_DUPLICATE, - CONTROLLER_37, - CONTROLLER_38, - CONTROLLER_39, - CONTROLLER_40, + CONTROLLER_CLEARUNKVAR, + CONTROLLER_SETUNKVAR, + CONTROLLER_CLEARUNKFLAG, + CONTROLLER_TOGGLEUNKFLAG, CONTROLLER_HITANIMATION, CONTROLLER_42, - CONTROLLER_EFFECTIVENESSSOUND, + CONTROLLER_PLAYSE, CONTROLLER_PLAYFANFAREORBGM, CONTROLLER_FAINTINGCRY, CONTROLLER_INTROSLIDE, @@ -175,7 +175,7 @@ enum CONTROLLER_CMDS_COUNT }; -extern struct UnusedControllerStruct gUnknown_02022D0C; +extern struct UnusedControllerStruct gUnusedControllerStruct; // general functions void HandleLinkBattleSetup(void); @@ -222,10 +222,10 @@ void BtlController_EmitTwoReturnValues(u8 bufferId, u8 arg1, u16 arg2); void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 b, u8 *c); void BtlController_EmitOneReturnValue(u8 bufferId, u16 arg1); void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 b); -void BtlController_EmitCmd37(u8 bufferId); // unused -void BtlController_EmitCmd38(u8 bufferId, u8 b); // unused -void BtlController_EmitCmd39(u8 bufferId); // unused -void BtlController_EmitCmd40(u8 bufferId); // unused +void BtlController_EmitClearUnkVar(u8 bufferId); // unused +void BtlController_EmitSetUnkVar(u8 bufferId, u8 b); // unused +void BtlController_EmitClearUnkFlag(u8 bufferId); // unused +void BtlController_EmitToggleUnkFlag(u8 bufferId); // unused void BtlController_EmitHitAnimation(u8 bufferId); void BtlController_EmitCmd42(u8 bufferId); void BtlController_EmitPlaySE(u8 bufferId, u16 songId); diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index 1041f6fda..269b4c1b4 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -69,10 +69,10 @@ static void LinkOpponentHandleTwoReturnValues(void); static void LinkOpponentHandleChosenMonReturnValue(void); static void LinkOpponentHandleOneReturnValue(void); static void LinkOpponentHandleOneReturnValue_Duplicate(void); -static void LinkOpponentHandleCmd37(void); -static void LinkOpponentHandleCmd38(void); -static void LinkOpponentHandleCmd39(void); -static void LinkOpponentHandleCmd40(void); +static void LinkOpponentHandleClearUnkVar(void); +static void LinkOpponentHandleSetUnkVar(void); +static void LinkOpponentHandleClearUnkFlag(void); +static void LinkOpponentHandleToggleUnkFlag(void); static void LinkOpponentHandleHitAnimation(void); static void LinkOpponentHandleCmd42(void); static void LinkOpponentHandlePlaySE(void); @@ -104,63 +104,63 @@ static void sub_806782C(void); static void (*const sLinkOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) = { - LinkOpponentHandleGetMonData, - LinkOpponentHandleGetRawMonData, - LinkOpponentHandleSetMonData, - LinkOpponentHandleSetRawMonData, - LinkOpponentHandleLoadMonSprite, - LinkOpponentHandleSwitchInAnim, - LinkOpponentHandleReturnMonToBall, - LinkOpponentHandleDrawTrainerPic, - LinkOpponentHandleTrainerSlide, - LinkOpponentHandleTrainerSlideBack, - LinkOpponentHandleFaintAnimation, - LinkOpponentHandlePaletteFade, - LinkOpponentHandleSuccessBallThrowAnim, - LinkOpponentHandleBallThrowAnim, - LinkOpponentHandlePause, - LinkOpponentHandleMoveAnimation, - LinkOpponentHandlePrintString, - LinkOpponentHandlePrintSelectionString, - LinkOpponentHandleChooseAction, - LinkOpponentHandleUnknownYesNoBox, - LinkOpponentHandleChooseMove, - LinkOpponentHandleChooseItem, - LinkOpponentHandleChoosePokemon, - LinkOpponentHandleCmd23, - LinkOpponentHandleHealthBarUpdate, - LinkOpponentHandleExpUpdate, - LinkOpponentHandleStatusIconUpdate, - LinkOpponentHandleStatusAnimation, - LinkOpponentHandleStatusXor, - LinkOpponentHandleDataTransfer, - LinkOpponentHandleDMA3Transfer, - LinkOpponentHandlePlayBGM, - LinkOpponentHandleCmd32, - LinkOpponentHandleTwoReturnValues, - LinkOpponentHandleChosenMonReturnValue, - LinkOpponentHandleOneReturnValue, - LinkOpponentHandleOneReturnValue_Duplicate, - LinkOpponentHandleCmd37, - LinkOpponentHandleCmd38, - LinkOpponentHandleCmd39, - LinkOpponentHandleCmd40, - LinkOpponentHandleHitAnimation, - LinkOpponentHandleCmd42, - LinkOpponentHandlePlaySE, - LinkOpponentHandlePlayFanfareOrBGM, - LinkOpponentHandleFaintingCry, - LinkOpponentHandleIntroSlide, - LinkOpponentHandleIntroTrainerBallThrow, - LinkOpponentHandleDrawPartyStatusSummary, - LinkOpponentHandleHidePartyStatusSummary, - LinkOpponentHandleEndBounceEffect, - LinkOpponentHandleSpriteInvisibility, - LinkOpponentHandleBattleAnimation, - LinkOpponentHandleLinkStandbyMsg, - LinkOpponentHandleResetActionMoveSelection, - LinkOpponentHandleCmd55, - LinkOpponentCmdEnd + [CONTROLLER_GETMONDATA] = LinkOpponentHandleGetMonData, + [CONTROLLER_GETRAWMONDATA] = LinkOpponentHandleGetRawMonData, + [CONTROLLER_SETMONDATA] = LinkOpponentHandleSetMonData, + [CONTROLLER_SETRAWMONDATA] = LinkOpponentHandleSetRawMonData, + [CONTROLLER_LOADMONSPRITE] = LinkOpponentHandleLoadMonSprite, + [CONTROLLER_SWITCHINANIM] = LinkOpponentHandleSwitchInAnim, + [CONTROLLER_RETURNMONTOBALL] = LinkOpponentHandleReturnMonToBall, + [CONTROLLER_DRAWTRAINERPIC] = LinkOpponentHandleDrawTrainerPic, + [CONTROLLER_TRAINERSLIDE] = LinkOpponentHandleTrainerSlide, + [CONTROLLER_TRAINERSLIDEBACK] = LinkOpponentHandleTrainerSlideBack, + [CONTROLLER_FAINTANIMATION] = LinkOpponentHandleFaintAnimation, + [CONTROLLER_PALETTEFADE] = LinkOpponentHandlePaletteFade, + [CONTROLLER_SUCCESSBALLTHROWANIM] = LinkOpponentHandleSuccessBallThrowAnim, + [CONTROLLER_BALLTHROWANIM] = LinkOpponentHandleBallThrowAnim, + [CONTROLLER_PAUSE] = LinkOpponentHandlePause, + [CONTROLLER_MOVEANIMATION] = LinkOpponentHandleMoveAnimation, + [CONTROLLER_PRINTSTRING] = LinkOpponentHandlePrintString, + [CONTROLLER_PRINTSTRINGPLAYERONLY] = LinkOpponentHandlePrintSelectionString, + [CONTROLLER_CHOOSEACTION] = LinkOpponentHandleChooseAction, + [CONTROLLER_UNKNOWNYESNOBOX] = LinkOpponentHandleUnknownYesNoBox, + [CONTROLLER_CHOOSEMOVE] = LinkOpponentHandleChooseMove, + [CONTROLLER_OPENBAG] = LinkOpponentHandleChooseItem, + [CONTROLLER_CHOOSEPOKEMON] = LinkOpponentHandleChoosePokemon, + [CONTROLLER_23] = LinkOpponentHandleCmd23, + [CONTROLLER_HEALTHBARUPDATE] = LinkOpponentHandleHealthBarUpdate, + [CONTROLLER_EXPUPDATE] = LinkOpponentHandleExpUpdate, + [CONTROLLER_STATUSICONUPDATE] = LinkOpponentHandleStatusIconUpdate, + [CONTROLLER_STATUSANIMATION] = LinkOpponentHandleStatusAnimation, + [CONTROLLER_STATUSXOR] = LinkOpponentHandleStatusXor, + [CONTROLLER_DATATRANSFER] = LinkOpponentHandleDataTransfer, + [CONTROLLER_DMA3TRANSFER] = LinkOpponentHandleDMA3Transfer, + [CONTROLLER_PLAYBGM] = LinkOpponentHandlePlayBGM, + [CONTROLLER_32] = LinkOpponentHandleCmd32, + [CONTROLLER_TWORETURNVALUES] = LinkOpponentHandleTwoReturnValues, + [CONTROLLER_CHOSENMONRETURNVALUE] = LinkOpponentHandleChosenMonReturnValue, + [CONTROLLER_ONERETURNVALUE] = LinkOpponentHandleOneReturnValue, + [CONTROLLER_ONERETURNVALUE_DUPLICATE] = LinkOpponentHandleOneReturnValue_Duplicate, + [CONTROLLER_CLEARUNKVAR] = LinkOpponentHandleClearUnkVar, + [CONTROLLER_SETUNKVAR] = LinkOpponentHandleSetUnkVar, + [CONTROLLER_CLEARUNKFLAG] = LinkOpponentHandleClearUnkFlag, + [CONTROLLER_TOGGLEUNKFLAG] = LinkOpponentHandleToggleUnkFlag, + [CONTROLLER_HITANIMATION] = LinkOpponentHandleHitAnimation, + [CONTROLLER_42] = LinkOpponentHandleCmd42, + [CONTROLLER_PLAYSE] = LinkOpponentHandlePlaySE, + [CONTROLLER_PLAYFANFAREORBGM] = LinkOpponentHandlePlayFanfareOrBGM, + [CONTROLLER_FAINTINGCRY] = LinkOpponentHandleFaintingCry, + [CONTROLLER_INTROSLIDE] = LinkOpponentHandleIntroSlide, + [CONTROLLER_INTROTRAINERBALLTHROW] = LinkOpponentHandleIntroTrainerBallThrow, + [CONTROLLER_DRAWPARTYSTATUSSUMMARY] = LinkOpponentHandleDrawPartyStatusSummary, + [CONTROLLER_HIDEPARTYSTATUSSUMMARY] = LinkOpponentHandleHidePartyStatusSummary, + [CONTROLLER_ENDBOUNCE] = LinkOpponentHandleEndBounceEffect, + [CONTROLLER_SPRITEINVISIBILITY] = LinkOpponentHandleSpriteInvisibility, + [CONTROLLER_BATTLEANIMATION] = LinkOpponentHandleBattleAnimation, + [CONTROLLER_LINKSTANDBYMSG] = LinkOpponentHandleLinkStandbyMsg, + [CONTROLLER_RESETACTIONMOVESELECTION] = LinkOpponentHandleResetActionMoveSelection, + [CONTROLLER_55] = LinkOpponentHandleCmd55, + [CONTROLLER_TERMINATOR_NOP] = LinkOpponentCmdEnd }; static void nullsub_28(void) @@ -1604,27 +1604,27 @@ static void LinkOpponentHandleOneReturnValue_Duplicate(void) LinkOpponentBufferExecCompleted(); } -static void LinkOpponentHandleCmd37(void) +static void LinkOpponentHandleClearUnkVar(void) { - gUnknown_02022D0C.field_0 = 0; + gUnusedControllerStruct.unk = 0; LinkOpponentBufferExecCompleted(); } -static void LinkOpponentHandleCmd38(void) +static void LinkOpponentHandleSetUnkVar(void) { - gUnknown_02022D0C.field_0 = gBattleBufferA[gActiveBattler][1]; + gUnusedControllerStruct.unk = gBattleBufferA[gActiveBattler][1]; LinkOpponentBufferExecCompleted(); } -static void LinkOpponentHandleCmd39(void) +static void LinkOpponentHandleClearUnkFlag(void) { - gUnknown_02022D0C.flag_x80 = 0; + gUnusedControllerStruct.flag = 0; LinkOpponentBufferExecCompleted(); } -static void LinkOpponentHandleCmd40(void) +static void LinkOpponentHandleToggleUnkFlag(void) { - gUnknown_02022D0C.flag_x80 ^= 1; + gUnusedControllerStruct.flag ^= 1; LinkOpponentBufferExecCompleted(); } diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index af81b06d5..d3037bb90 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -67,10 +67,10 @@ static void LinkPartnerHandleTwoReturnValues(void); static void LinkPartnerHandleChosenMonReturnValue(void); static void LinkPartnerHandleOneReturnValue(void); static void LinkPartnerHandleOneReturnValue_Duplicate(void); -static void LinkPartnerHandleCmd37(void); -static void LinkPartnerHandleCmd38(void); -static void LinkPartnerHandleCmd39(void); -static void LinkPartnerHandleCmd40(void); +static void LinkPartnerHandleClearUnkVar(void); +static void LinkPartnerHandleSetUnkVar(void); +static void LinkPartnerHandleClearUnkFlag(void); +static void LinkPartnerHandleToggleUnkFlag(void); static void LinkPartnerHandleHitAnimation(void); static void LinkPartnerHandleCmd42(void); static void LinkPartnerHandlePlaySE(void); @@ -101,63 +101,63 @@ static void sub_814DE9C(void); static void (*const sLinkPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = { - LinkPartnerHandleGetMonData, - LinkPartnerHandleGetRawMonData, - LinkPartnerHandleSetMonData, - LinkPartnerHandleSetRawMonData, - LinkPartnerHandleLoadMonSprite, - LinkPartnerHandleSwitchInAnim, - LinkPartnerHandleReturnMonToBall, - LinkPartnerHandleDrawTrainerPic, - LinkPartnerHandleTrainerSlide, - LinkPartnerHandleTrainerSlideBack, - LinkPartnerHandleFaintAnimation, - LinkPartnerHandlePaletteFade, - LinkPartnerHandleSuccessBallThrowAnim, - LinkPartnerHandleBallThrowAnim, - LinkPartnerHandlePause, - LinkPartnerHandleMoveAnimation, - LinkPartnerHandlePrintString, - LinkPartnerHandlePrintSelectionString, - LinkPartnerHandleChooseAction, - LinkPartnerHandleUnknownYesNoBox, - LinkPartnerHandleChooseMove, - LinkPartnerHandleChooseItem, - LinkPartnerHandleChoosePokemon, - LinkPartnerHandleCmd23, - LinkPartnerHandleHealthBarUpdate, - LinkPartnerHandleExpUpdate, - LinkPartnerHandleStatusIconUpdate, - LinkPartnerHandleStatusAnimation, - LinkPartnerHandleStatusXor, - LinkPartnerHandleDataTransfer, - LinkPartnerHandleDMA3Transfer, - LinkPartnerHandlePlayBGM, - LinkPartnerHandleCmd32, - LinkPartnerHandleTwoReturnValues, - LinkPartnerHandleChosenMonReturnValue, - LinkPartnerHandleOneReturnValue, - LinkPartnerHandleOneReturnValue_Duplicate, - LinkPartnerHandleCmd37, - LinkPartnerHandleCmd38, - LinkPartnerHandleCmd39, - LinkPartnerHandleCmd40, - LinkPartnerHandleHitAnimation, - LinkPartnerHandleCmd42, - LinkPartnerHandlePlaySE, - LinkPartnerHandlePlayFanfareOrBGM, - LinkPartnerHandleFaintingCry, - LinkPartnerHandleIntroSlide, - LinkPartnerHandleIntroTrainerBallThrow, - LinkPartnerHandleDrawPartyStatusSummary, - LinkPartnerHandleHidePartyStatusSummary, - LinkPartnerHandleEndBounceEffect, - LinkPartnerHandleSpriteInvisibility, - LinkPartnerHandleBattleAnimation, - LinkPartnerHandleLinkStandbyMsg, - LinkPartnerHandleResetActionMoveSelection, - LinkPartnerHandleCmd55, - LinkPartnerCmdEnd + [CONTROLLER_GETMONDATA] = LinkPartnerHandleGetMonData, + [CONTROLLER_GETRAWMONDATA] = LinkPartnerHandleGetRawMonData, + [CONTROLLER_SETMONDATA] = LinkPartnerHandleSetMonData, + [CONTROLLER_SETRAWMONDATA] = LinkPartnerHandleSetRawMonData, + [CONTROLLER_LOADMONSPRITE] = LinkPartnerHandleLoadMonSprite, + [CONTROLLER_SWITCHINANIM] = LinkPartnerHandleSwitchInAnim, + [CONTROLLER_RETURNMONTOBALL] = LinkPartnerHandleReturnMonToBall, + [CONTROLLER_DRAWTRAINERPIC] = LinkPartnerHandleDrawTrainerPic, + [CONTROLLER_TRAINERSLIDE] = LinkPartnerHandleTrainerSlide, + [CONTROLLER_TRAINERSLIDEBACK] = LinkPartnerHandleTrainerSlideBack, + [CONTROLLER_FAINTANIMATION] = LinkPartnerHandleFaintAnimation, + [CONTROLLER_PALETTEFADE] = LinkPartnerHandlePaletteFade, + [CONTROLLER_SUCCESSBALLTHROWANIM] = LinkPartnerHandleSuccessBallThrowAnim, + [CONTROLLER_BALLTHROWANIM] = LinkPartnerHandleBallThrowAnim, + [CONTROLLER_PAUSE] = LinkPartnerHandlePause, + [CONTROLLER_MOVEANIMATION] = LinkPartnerHandleMoveAnimation, + [CONTROLLER_PRINTSTRING] = LinkPartnerHandlePrintString, + [CONTROLLER_PRINTSTRINGPLAYERONLY] = LinkPartnerHandlePrintSelectionString, + [CONTROLLER_CHOOSEACTION] = LinkPartnerHandleChooseAction, + [CONTROLLER_UNKNOWNYESNOBOX] = LinkPartnerHandleUnknownYesNoBox, + [CONTROLLER_CHOOSEMOVE] = LinkPartnerHandleChooseMove, + [CONTROLLER_OPENBAG] = LinkPartnerHandleChooseItem, + [CONTROLLER_CHOOSEPOKEMON] = LinkPartnerHandleChoosePokemon, + [CONTROLLER_23] = LinkPartnerHandleCmd23, + [CONTROLLER_HEALTHBARUPDATE] = LinkPartnerHandleHealthBarUpdate, + [CONTROLLER_EXPUPDATE] = LinkPartnerHandleExpUpdate, + [CONTROLLER_STATUSICONUPDATE] = LinkPartnerHandleStatusIconUpdate, + [CONTROLLER_STATUSANIMATION] = LinkPartnerHandleStatusAnimation, + [CONTROLLER_STATUSXOR] = LinkPartnerHandleStatusXor, + [CONTROLLER_DATATRANSFER] = LinkPartnerHandleDataTransfer, + [CONTROLLER_DMA3TRANSFER] = LinkPartnerHandleDMA3Transfer, + [CONTROLLER_PLAYBGM] = LinkPartnerHandlePlayBGM, + [CONTROLLER_32] = LinkPartnerHandleCmd32, + [CONTROLLER_TWORETURNVALUES] = LinkPartnerHandleTwoReturnValues, + [CONTROLLER_CHOSENMONRETURNVALUE] = LinkPartnerHandleChosenMonReturnValue, + [CONTROLLER_ONERETURNVALUE] = LinkPartnerHandleOneReturnValue, + [CONTROLLER_ONERETURNVALUE_DUPLICATE] = LinkPartnerHandleOneReturnValue_Duplicate, + [CONTROLLER_CLEARUNKVAR] = LinkPartnerHandleClearUnkVar, + [CONTROLLER_SETUNKVAR] = LinkPartnerHandleSetUnkVar, + [CONTROLLER_CLEARUNKFLAG] = LinkPartnerHandleClearUnkFlag, + [CONTROLLER_TOGGLEUNKFLAG] = LinkPartnerHandleToggleUnkFlag, + [CONTROLLER_HITANIMATION] = LinkPartnerHandleHitAnimation, + [CONTROLLER_42] = LinkPartnerHandleCmd42, + [CONTROLLER_PLAYSE] = LinkPartnerHandlePlaySE, + [CONTROLLER_PLAYFANFAREORBGM] = LinkPartnerHandlePlayFanfareOrBGM, + [CONTROLLER_FAINTINGCRY] = LinkPartnerHandleFaintingCry, + [CONTROLLER_INTROSLIDE] = LinkPartnerHandleIntroSlide, + [CONTROLLER_INTROTRAINERBALLTHROW] = LinkPartnerHandleIntroTrainerBallThrow, + [CONTROLLER_DRAWPARTYSTATUSSUMMARY] = LinkPartnerHandleDrawPartyStatusSummary, + [CONTROLLER_HIDEPARTYSTATUSSUMMARY] = LinkPartnerHandleHidePartyStatusSummary, + [CONTROLLER_ENDBOUNCE] = LinkPartnerHandleEndBounceEffect, + [CONTROLLER_SPRITEINVISIBILITY] = LinkPartnerHandleSpriteInvisibility, + [CONTROLLER_BATTLEANIMATION] = LinkPartnerHandleBattleAnimation, + [CONTROLLER_LINKSTANDBYMSG] = LinkPartnerHandleLinkStandbyMsg, + [CONTROLLER_RESETACTIONMOVESELECTION] = LinkPartnerHandleResetActionMoveSelection, + [CONTROLLER_55] = LinkPartnerHandleCmd55, + [CONTROLLER_TERMINATOR_NOP] = LinkPartnerCmdEnd }; static void SpriteCB_Null2(void) @@ -1428,27 +1428,27 @@ static void LinkPartnerHandleOneReturnValue_Duplicate(void) LinkPartnerBufferExecCompleted(); } -static void LinkPartnerHandleCmd37(void) +static void LinkPartnerHandleClearUnkVar(void) { - gUnknown_02022D0C.field_0 = 0; + gUnusedControllerStruct.unk = 0; LinkPartnerBufferExecCompleted(); } -static void LinkPartnerHandleCmd38(void) +static void LinkPartnerHandleSetUnkVar(void) { - gUnknown_02022D0C.field_0 = gBattleBufferA[gActiveBattler][1]; + gUnusedControllerStruct.unk = gBattleBufferA[gActiveBattler][1]; LinkPartnerBufferExecCompleted(); } -static void LinkPartnerHandleCmd39(void) +static void LinkPartnerHandleClearUnkFlag(void) { - gUnknown_02022D0C.flag_x80 = 0; + gUnusedControllerStruct.flag = 0; LinkPartnerBufferExecCompleted(); } -static void LinkPartnerHandleCmd40(void) +static void LinkPartnerHandleToggleUnkFlag(void) { - gUnknown_02022D0C.flag_x80 ^= 1; + gUnusedControllerStruct.flag ^= 1; LinkPartnerBufferExecCompleted(); } diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index f186bf3ff..9fe8caf63 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -74,10 +74,10 @@ static void OpponentHandleTwoReturnValues(void); static void OpponentHandleChosenMonReturnValue(void); static void OpponentHandleOneReturnValue(void); static void OpponentHandleOneReturnValue_Duplicate(void); -static void OpponentHandleCmd37(void); -static void OpponentHandleCmd38(void); -static void OpponentHandleCmd39(void); -static void OpponentHandleCmd40(void); +static void OpponentHandleClearUnkVar(void); +static void OpponentHandleSetUnkVar(void); +static void OpponentHandleClearUnkFlag(void); +static void OpponentHandleToggleUnkFlag(void); static void OpponentHandleHitAnimation(void); static void OpponentHandleCmd42(void); static void OpponentHandlePlaySE(void); @@ -109,67 +109,67 @@ static void sub_8062A2C(void); static void (*const sOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) = { - OpponentHandleGetMonData, - OpponentHandleGetRawMonData, - OpponentHandleSetMonData, - OpponentHandleSetRawMonData, - OpponentHandleLoadMonSprite, - OpponentHandleSwitchInAnim, - OpponentHandleReturnMonToBall, - OpponentHandleDrawTrainerPic, - OpponentHandleTrainerSlide, - OpponentHandleTrainerSlideBack, - OpponentHandleFaintAnimation, - OpponentHandlePaletteFade, - OpponentHandleSuccessBallThrowAnim, - OpponentHandleBallThrow, - OpponentHandlePause, - OpponentHandleMoveAnimation, - OpponentHandlePrintString, - OpponentHandlePrintSelectionString, - OpponentHandleChooseAction, - OpponentHandleUnknownYesNoBox, - OpponentHandleChooseMove, - OpponentHandleChooseItem, - OpponentHandleChoosePokemon, - OpponentHandleCmd23, - OpponentHandleHealthBarUpdate, - OpponentHandleExpUpdate, - OpponentHandleStatusIconUpdate, - OpponentHandleStatusAnimation, - OpponentHandleStatusXor, - OpponentHandleDataTransfer, - OpponentHandleDMA3Transfer, - OpponentHandlePlayBGM, - OpponentHandleCmd32, - OpponentHandleTwoReturnValues, - OpponentHandleChosenMonReturnValue, - OpponentHandleOneReturnValue, - OpponentHandleOneReturnValue_Duplicate, - OpponentHandleCmd37, - OpponentHandleCmd38, - OpponentHandleCmd39, - OpponentHandleCmd40, - OpponentHandleHitAnimation, - OpponentHandleCmd42, - OpponentHandlePlaySE, - OpponentHandlePlayFanfareOrBGM, - OpponentHandleFaintingCry, - OpponentHandleIntroSlide, - OpponentHandleIntroTrainerBallThrow, - OpponentHandleDrawPartyStatusSummary, - OpponentHandleHidePartyStatusSummary, - OpponentHandleEndBounceEffect, - OpponentHandleSpriteInvisibility, - OpponentHandleBattleAnimation, - OpponentHandleLinkStandbyMsg, - OpponentHandleResetActionMoveSelection, - OpponentHandleCmd55, - OpponentCmdEnd + [CONTROLLER_GETMONDATA] = OpponentHandleGetMonData, + [CONTROLLER_GETRAWMONDATA] = OpponentHandleGetRawMonData, + [CONTROLLER_SETMONDATA] = OpponentHandleSetMonData, + [CONTROLLER_SETRAWMONDATA] = OpponentHandleSetRawMonData, + [CONTROLLER_LOADMONSPRITE] = OpponentHandleLoadMonSprite, + [CONTROLLER_SWITCHINANIM] = OpponentHandleSwitchInAnim, + [CONTROLLER_RETURNMONTOBALL] = OpponentHandleReturnMonToBall, + [CONTROLLER_DRAWTRAINERPIC] = OpponentHandleDrawTrainerPic, + [CONTROLLER_TRAINERSLIDE] = OpponentHandleTrainerSlide, + [CONTROLLER_TRAINERSLIDEBACK] = OpponentHandleTrainerSlideBack, + [CONTROLLER_FAINTANIMATION] = OpponentHandleFaintAnimation, + [CONTROLLER_PALETTEFADE] = OpponentHandlePaletteFade, + [CONTROLLER_SUCCESSBALLTHROWANIM] = OpponentHandleSuccessBallThrowAnim, + [CONTROLLER_BALLTHROWANIM] = OpponentHandleBallThrow, + [CONTROLLER_PAUSE] = OpponentHandlePause, + [CONTROLLER_MOVEANIMATION] = OpponentHandleMoveAnimation, + [CONTROLLER_PRINTSTRING] = OpponentHandlePrintString, + [CONTROLLER_PRINTSTRINGPLAYERONLY] = OpponentHandlePrintSelectionString, + [CONTROLLER_CHOOSEACTION] = OpponentHandleChooseAction, + [CONTROLLER_UNKNOWNYESNOBOX] = OpponentHandleUnknownYesNoBox, + [CONTROLLER_CHOOSEMOVE] = OpponentHandleChooseMove, + [CONTROLLER_OPENBAG] = OpponentHandleChooseItem, + [CONTROLLER_CHOOSEPOKEMON] = OpponentHandleChoosePokemon, + [CONTROLLER_23] = OpponentHandleCmd23, + [CONTROLLER_HEALTHBARUPDATE] = OpponentHandleHealthBarUpdate, + [CONTROLLER_EXPUPDATE] = OpponentHandleExpUpdate, + [CONTROLLER_STATUSICONUPDATE] = OpponentHandleStatusIconUpdate, + [CONTROLLER_STATUSANIMATION] = OpponentHandleStatusAnimation, + [CONTROLLER_STATUSXOR] = OpponentHandleStatusXor, + [CONTROLLER_DATATRANSFER] = OpponentHandleDataTransfer, + [CONTROLLER_DMA3TRANSFER] = OpponentHandleDMA3Transfer, + [CONTROLLER_PLAYBGM] = OpponentHandlePlayBGM, + [CONTROLLER_32] = OpponentHandleCmd32, + [CONTROLLER_TWORETURNVALUES] = OpponentHandleTwoReturnValues, + [CONTROLLER_CHOSENMONRETURNVALUE] = OpponentHandleChosenMonReturnValue, + [CONTROLLER_ONERETURNVALUE] = OpponentHandleOneReturnValue, + [CONTROLLER_ONERETURNVALUE_DUPLICATE] = OpponentHandleOneReturnValue_Duplicate, + [CONTROLLER_CLEARUNKVAR] = OpponentHandleClearUnkVar, + [CONTROLLER_SETUNKVAR] = OpponentHandleSetUnkVar, + [CONTROLLER_CLEARUNKFLAG] = OpponentHandleClearUnkFlag, + [CONTROLLER_TOGGLEUNKFLAG] = OpponentHandleToggleUnkFlag, + [CONTROLLER_HITANIMATION] = OpponentHandleHitAnimation, + [CONTROLLER_42] = OpponentHandleCmd42, + [CONTROLLER_PLAYSE] = OpponentHandlePlaySE, + [CONTROLLER_PLAYFANFAREORBGM] = OpponentHandlePlayFanfareOrBGM, + [CONTROLLER_FAINTINGCRY] = OpponentHandleFaintingCry, + [CONTROLLER_INTROSLIDE] = OpponentHandleIntroSlide, + [CONTROLLER_INTROTRAINERBALLTHROW] = OpponentHandleIntroTrainerBallThrow, + [CONTROLLER_DRAWPARTYSTATUSSUMMARY] = OpponentHandleDrawPartyStatusSummary, + [CONTROLLER_HIDEPARTYSTATUSSUMMARY] = OpponentHandleHidePartyStatusSummary, + [CONTROLLER_ENDBOUNCE] = OpponentHandleEndBounceEffect, + [CONTROLLER_SPRITEINVISIBILITY] = OpponentHandleSpriteInvisibility, + [CONTROLLER_BATTLEANIMATION] = OpponentHandleBattleAnimation, + [CONTROLLER_LINKSTANDBYMSG] = OpponentHandleLinkStandbyMsg, + [CONTROLLER_RESETACTIONMOVESELECTION] = OpponentHandleResetActionMoveSelection, + [CONTROLLER_55] = OpponentHandleCmd55, + [CONTROLLER_TERMINATOR_NOP] = OpponentCmdEnd }; // unknown unused data -static const u8 sUnknown_0831C7AC[] = {0xB0, 0xB0, 0xC8, 0x98, 0x28, 0x28, 0x28, 0x20}; +static const u8 sUnused[] = {0xB0, 0xB0, 0xC8, 0x98, 0x28, 0x28, 0x28, 0x20}; static void nullsub_26(void) { @@ -1769,27 +1769,27 @@ static void OpponentHandleOneReturnValue_Duplicate(void) OpponentBufferExecCompleted(); } -static void OpponentHandleCmd37(void) +static void OpponentHandleClearUnkVar(void) { - gUnknown_02022D0C.field_0 = 0; + gUnusedControllerStruct.unk = 0; OpponentBufferExecCompleted(); } -static void OpponentHandleCmd38(void) +static void OpponentHandleSetUnkVar(void) { - gUnknown_02022D0C.field_0 = gBattleBufferA[gActiveBattler][1]; + gUnusedControllerStruct.unk = gBattleBufferA[gActiveBattler][1]; OpponentBufferExecCompleted(); } -static void OpponentHandleCmd39(void) +static void OpponentHandleClearUnkFlag(void) { - gUnknown_02022D0C.flag_x80 = 0; + gUnusedControllerStruct.flag = 0; OpponentBufferExecCompleted(); } -static void OpponentHandleCmd40(void) +static void OpponentHandleToggleUnkFlag(void) { - gUnknown_02022D0C.flag_x80 ^= 1; + gUnusedControllerStruct.flag ^= 1; OpponentBufferExecCompleted(); } diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 7c34efd44..c1d7fc2a4 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -75,10 +75,10 @@ static void PlayerHandleTwoReturnValues(void); static void PlayerHandleChosenMonReturnValue(void); static void PlayerHandleOneReturnValue(void); static void PlayerHandleOneReturnValue_Duplicate(void); -static void PlayerHandleCmd37(void); -static void PlayerHandleCmd38(void); -static void PlayerHandleCmd39(void); -static void PlayerHandleCmd40(void); +static void PlayerHandleClearUnkVar(void); +static void PlayerHandleSetUnkVar(void); +static void PlayerHandleClearUnkFlag(void); +static void PlayerHandleToggleUnkFlag(void); static void PlayerHandleHitAnimation(void); static void PlayerHandleCmd42(void); static void PlayerHandlePlaySE(void); @@ -125,69 +125,69 @@ static void sub_805CE38(void); static void (*const sPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = { - PlayerHandleGetMonData, - PlayerHandleGetRawMonData, - PlayerHandleSetMonData, - PlayerHandleSetRawMonData, - PlayerHandleLoadMonSprite, - PlayerHandleSwitchInAnim, - PlayerHandleReturnMonToBall, - PlayerHandleDrawTrainerPic, - PlayerHandleTrainerSlide, - PlayerHandleTrainerSlideBack, - PlayerHandleFaintAnimation, - PlayerHandlePaletteFade, - PlayerHandleSuccessBallThrowAnim, - PlayerHandleBallThrowAnim, - PlayerHandlePause, - PlayerHandleMoveAnimation, - PlayerHandlePrintString, - PlayerHandlePrintSelectionString, - PlayerHandleChooseAction, - PlayerHandleUnknownYesNoBox, - PlayerHandleChooseMove, - PlayerHandleChooseItem, - PlayerHandleChoosePokemon, - PlayerHandleCmd23, - PlayerHandleHealthBarUpdate, - PlayerHandleExpUpdate, - PlayerHandleStatusIconUpdate, - PlayerHandleStatusAnimation, - PlayerHandleStatusXor, - PlayerHandleDataTransfer, - PlayerHandleDMA3Transfer, - PlayerHandlePlayBGM, - PlayerHandleCmd32, - PlayerHandleTwoReturnValues, - PlayerHandleChosenMonReturnValue, - PlayerHandleOneReturnValue, - PlayerHandleOneReturnValue_Duplicate, - PlayerHandleCmd37, - PlayerHandleCmd38, - PlayerHandleCmd39, - PlayerHandleCmd40, - PlayerHandleHitAnimation, - PlayerHandleCmd42, - PlayerHandlePlaySE, - PlayerHandlePlayFanfareOrBGM, - PlayerHandleFaintingCry, - PlayerHandleIntroSlide, - PlayerHandleIntroTrainerBallThrow, - PlayerHandleDrawPartyStatusSummary, - PlayerHandleHidePartyStatusSummary, - PlayerHandleEndBounceEffect, - PlayerHandleSpriteInvisibility, - PlayerHandleBattleAnimation, - PlayerHandleLinkStandbyMsg, - PlayerHandleResetActionMoveSelection, - PlayerHandleCmd55, - PlayerCmdEnd + [CONTROLLER_GETMONDATA] = PlayerHandleGetMonData, + [CONTROLLER_GETRAWMONDATA] = PlayerHandleGetRawMonData, + [CONTROLLER_SETMONDATA] = PlayerHandleSetMonData, + [CONTROLLER_SETRAWMONDATA] = PlayerHandleSetRawMonData, + [CONTROLLER_LOADMONSPRITE] = PlayerHandleLoadMonSprite, + [CONTROLLER_SWITCHINANIM] = PlayerHandleSwitchInAnim, + [CONTROLLER_RETURNMONTOBALL] = PlayerHandleReturnMonToBall, + [CONTROLLER_DRAWTRAINERPIC] = PlayerHandleDrawTrainerPic, + [CONTROLLER_TRAINERSLIDE] = PlayerHandleTrainerSlide, + [CONTROLLER_TRAINERSLIDEBACK] = PlayerHandleTrainerSlideBack, + [CONTROLLER_FAINTANIMATION] = PlayerHandleFaintAnimation, + [CONTROLLER_PALETTEFADE] = PlayerHandlePaletteFade, + [CONTROLLER_SUCCESSBALLTHROWANIM] = PlayerHandleSuccessBallThrowAnim, + [CONTROLLER_BALLTHROWANIM] = PlayerHandleBallThrowAnim, + [CONTROLLER_PAUSE] = PlayerHandlePause, + [CONTROLLER_MOVEANIMATION] = PlayerHandleMoveAnimation, + [CONTROLLER_PRINTSTRING] = PlayerHandlePrintString, + [CONTROLLER_PRINTSTRINGPLAYERONLY] = PlayerHandlePrintSelectionString, + [CONTROLLER_CHOOSEACTION] = PlayerHandleChooseAction, + [CONTROLLER_UNKNOWNYESNOBOX] = PlayerHandleUnknownYesNoBox, + [CONTROLLER_CHOOSEMOVE] = PlayerHandleChooseMove, + [CONTROLLER_OPENBAG] = PlayerHandleChooseItem, + [CONTROLLER_CHOOSEPOKEMON] = PlayerHandleChoosePokemon, + [CONTROLLER_23] = PlayerHandleCmd23, + [CONTROLLER_HEALTHBARUPDATE] = PlayerHandleHealthBarUpdate, + [CONTROLLER_EXPUPDATE] = PlayerHandleExpUpdate, + [CONTROLLER_STATUSICONUPDATE] = PlayerHandleStatusIconUpdate, + [CONTROLLER_STATUSANIMATION] = PlayerHandleStatusAnimation, + [CONTROLLER_STATUSXOR] = PlayerHandleStatusXor, + [CONTROLLER_DATATRANSFER] = PlayerHandleDataTransfer, + [CONTROLLER_DMA3TRANSFER] = PlayerHandleDMA3Transfer, + [CONTROLLER_PLAYBGM] = PlayerHandlePlayBGM, + [CONTROLLER_32] = PlayerHandleCmd32, + [CONTROLLER_TWORETURNVALUES] = PlayerHandleTwoReturnValues, + [CONTROLLER_CHOSENMONRETURNVALUE] = PlayerHandleChosenMonReturnValue, + [CONTROLLER_ONERETURNVALUE] = PlayerHandleOneReturnValue, + [CONTROLLER_ONERETURNVALUE_DUPLICATE] = PlayerHandleOneReturnValue_Duplicate, + [CONTROLLER_CLEARUNKVAR] = PlayerHandleClearUnkVar, + [CONTROLLER_SETUNKVAR] = PlayerHandleSetUnkVar, + [CONTROLLER_CLEARUNKFLAG] = PlayerHandleClearUnkFlag, + [CONTROLLER_TOGGLEUNKFLAG] = PlayerHandleToggleUnkFlag, + [CONTROLLER_HITANIMATION] = PlayerHandleHitAnimation, + [CONTROLLER_42] = PlayerHandleCmd42, + [CONTROLLER_PLAYSE] = PlayerHandlePlaySE, + [CONTROLLER_PLAYFANFAREORBGM] = PlayerHandlePlayFanfareOrBGM, + [CONTROLLER_FAINTINGCRY] = PlayerHandleFaintingCry, + [CONTROLLER_INTROSLIDE] = PlayerHandleIntroSlide, + [CONTROLLER_INTROTRAINERBALLTHROW] = PlayerHandleIntroTrainerBallThrow, + [CONTROLLER_DRAWPARTYSTATUSSUMMARY] = PlayerHandleDrawPartyStatusSummary, + [CONTROLLER_HIDEPARTYSTATUSSUMMARY] = PlayerHandleHidePartyStatusSummary, + [CONTROLLER_ENDBOUNCE] = PlayerHandleEndBounceEffect, + [CONTROLLER_SPRITEINVISIBILITY] = PlayerHandleSpriteInvisibility, + [CONTROLLER_BATTLEANIMATION] = PlayerHandleBattleAnimation, + [CONTROLLER_LINKSTANDBYMSG] = PlayerHandleLinkStandbyMsg, + [CONTROLLER_RESETACTIONMOVESELECTION] = PlayerHandleResetActionMoveSelection, + [CONTROLLER_55] = PlayerHandleCmd55, + [CONTROLLER_TERMINATOR_NOP] = PlayerCmdEnd }; 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}; +static const u8 sUnused[] = {0x48, 0x48, 0x20, 0x5a, 0x50, 0x50, 0x50, 0x58}; void nullsub_21(void) { @@ -2822,27 +2822,27 @@ static void PlayerHandleOneReturnValue_Duplicate(void) PlayerBufferExecCompleted(); } -static void PlayerHandleCmd37(void) +static void PlayerHandleClearUnkVar(void) { - gUnknown_02022D0C.field_0 = 0; + gUnusedControllerStruct.unk = 0; PlayerBufferExecCompleted(); } -static void PlayerHandleCmd38(void) +static void PlayerHandleSetUnkVar(void) { - gUnknown_02022D0C.field_0 = gBattleBufferA[gActiveBattler][1]; + gUnusedControllerStruct.unk = gBattleBufferA[gActiveBattler][1]; PlayerBufferExecCompleted(); } -static void PlayerHandleCmd39(void) +static void PlayerHandleClearUnkFlag(void) { - gUnknown_02022D0C.flag_x80 = 0; + gUnusedControllerStruct.flag = 0; PlayerBufferExecCompleted(); } -static void PlayerHandleCmd40(void) +static void PlayerHandleToggleUnkFlag(void) { - gUnknown_02022D0C.flag_x80 ^= 1; + gUnusedControllerStruct.flag ^= 1; PlayerBufferExecCompleted(); } diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index af6b739cc..d826d2183 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -65,10 +65,10 @@ static void PlayerPartnerHandleTwoReturnValues(void); static void PlayerPartnerHandleChosenMonReturnValue(void); static void PlayerPartnerHandleOneReturnValue(void); static void PlayerPartnerHandleOneReturnValue_Duplicate(void); -static void PlayerPartnerHandleCmd37(void); -static void PlayerPartnerHandleCmd38(void); -static void PlayerPartnerHandleCmd39(void); -static void PlayerPartnerHandleCmd40(void); +static void PlayerPartnerHandleClearUnkVar(void); +static void PlayerPartnerHandleSetUnkVar(void); +static void PlayerPartnerHandleClearUnkFlag(void); +static void PlayerPartnerHandleToggleUnkFlag(void); static void PlayerPartnerHandleHitAnimation(void); static void PlayerPartnerHandleCmd42(void); static void PlayerPartnerHandlePlaySE(void); @@ -105,67 +105,67 @@ static void sub_81BE498(void); static void (*const sPlayerPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = { - PlayerPartnerHandleGetMonData, - PlayerPartnerHandleGetRawMonData, - PlayerPartnerHandleSetMonData, - PlayerPartnerHandleSetRawMonData, - PlayerPartnerHandleLoadMonSprite, - PlayerPartnerHandleSwitchInAnim, - PlayerPartnerHandleReturnMonToBall, - PlayerPartnerHandleDrawTrainerPic, - PlayerPartnerHandleTrainerSlide, - PlayerPartnerHandleTrainerSlideBack, - PlayerPartnerHandleFaintAnimation, - PlayerPartnerHandlePaletteFade, - PlayerPartnerHandleSuccessBallThrowAnim, - PlayerPartnerHandleBallThrowAnim, - PlayerPartnerHandlePause, - PlayerPartnerHandleMoveAnimation, - PlayerPartnerHandlePrintString, - PlayerPartnerHandlePrintSelectionString, - PlayerPartnerHandleChooseAction, - PlayerPartnerHandleUnknownYesNoBox, - PlayerPartnerHandleChooseMove, - PlayerPartnerHandleChooseItem, - PlayerPartnerHandleChoosePokemon, - PlayerPartnerHandleCmd23, - PlayerPartnerHandleHealthBarUpdate, - PlayerPartnerHandleExpUpdate, - PlayerPartnerHandleStatusIconUpdate, - PlayerPartnerHandleStatusAnimation, - PlayerPartnerHandleStatusXor, - PlayerPartnerHandleDataTransfer, - PlayerPartnerHandleDMA3Transfer, - PlayerPartnerHandlePlayBGM, - PlayerPartnerHandleCmd32, - PlayerPartnerHandleTwoReturnValues, - PlayerPartnerHandleChosenMonReturnValue, - PlayerPartnerHandleOneReturnValue, - PlayerPartnerHandleOneReturnValue_Duplicate, - PlayerPartnerHandleCmd37, - PlayerPartnerHandleCmd38, - PlayerPartnerHandleCmd39, - PlayerPartnerHandleCmd40, - PlayerPartnerHandleHitAnimation, - PlayerPartnerHandleCmd42, - PlayerPartnerHandlePlaySE, - PlayerPartnerHandlePlayFanfareOrBGM, - PlayerPartnerHandleFaintingCry, - PlayerPartnerHandleIntroSlide, - PlayerPartnerHandleIntroTrainerBallThrow, - PlayerPartnerHandleDrawPartyStatusSummary, - PlayerPartnerHandleHidePartyStatusSummary, - PlayerPartnerHandleEndBounceEffect, - PlayerPartnerHandleSpriteInvisibility, - PlayerPartnerHandleBattleAnimation, - PlayerPartnerHandleLinkStandbyMsg, - PlayerPartnerHandleResetActionMoveSelection, - PlayerPartnerHandleCmd55, - PlayerPartnerCmdEnd + [CONTROLLER_GETMONDATA] = PlayerPartnerHandleGetMonData, + [CONTROLLER_GETRAWMONDATA] = PlayerPartnerHandleGetRawMonData, + [CONTROLLER_SETMONDATA] = PlayerPartnerHandleSetMonData, + [CONTROLLER_SETRAWMONDATA] = PlayerPartnerHandleSetRawMonData, + [CONTROLLER_LOADMONSPRITE] = PlayerPartnerHandleLoadMonSprite, + [CONTROLLER_SWITCHINANIM] = PlayerPartnerHandleSwitchInAnim, + [CONTROLLER_RETURNMONTOBALL] = PlayerPartnerHandleReturnMonToBall, + [CONTROLLER_DRAWTRAINERPIC] = PlayerPartnerHandleDrawTrainerPic, + [CONTROLLER_TRAINERSLIDE] = PlayerPartnerHandleTrainerSlide, + [CONTROLLER_TRAINERSLIDEBACK] = PlayerPartnerHandleTrainerSlideBack, + [CONTROLLER_FAINTANIMATION] = PlayerPartnerHandleFaintAnimation, + [CONTROLLER_PALETTEFADE] = PlayerPartnerHandlePaletteFade, + [CONTROLLER_SUCCESSBALLTHROWANIM] = PlayerPartnerHandleSuccessBallThrowAnim, + [CONTROLLER_BALLTHROWANIM] = PlayerPartnerHandleBallThrowAnim, + [CONTROLLER_PAUSE] = PlayerPartnerHandlePause, + [CONTROLLER_MOVEANIMATION] = PlayerPartnerHandleMoveAnimation, + [CONTROLLER_PRINTSTRING] = PlayerPartnerHandlePrintString, + [CONTROLLER_PRINTSTRINGPLAYERONLY] = PlayerPartnerHandlePrintSelectionString, + [CONTROLLER_CHOOSEACTION] = PlayerPartnerHandleChooseAction, + [CONTROLLER_UNKNOWNYESNOBOX] = PlayerPartnerHandleUnknownYesNoBox, + [CONTROLLER_CHOOSEMOVE] = PlayerPartnerHandleChooseMove, + [CONTROLLER_OPENBAG] = PlayerPartnerHandleChooseItem, + [CONTROLLER_CHOOSEPOKEMON] = PlayerPartnerHandleChoosePokemon, + [CONTROLLER_23] = PlayerPartnerHandleCmd23, + [CONTROLLER_HEALTHBARUPDATE] = PlayerPartnerHandleHealthBarUpdate, + [CONTROLLER_EXPUPDATE] = PlayerPartnerHandleExpUpdate, + [CONTROLLER_STATUSICONUPDATE] = PlayerPartnerHandleStatusIconUpdate, + [CONTROLLER_STATUSANIMATION] = PlayerPartnerHandleStatusAnimation, + [CONTROLLER_STATUSXOR] = PlayerPartnerHandleStatusXor, + [CONTROLLER_DATATRANSFER] = PlayerPartnerHandleDataTransfer, + [CONTROLLER_DMA3TRANSFER] = PlayerPartnerHandleDMA3Transfer, + [CONTROLLER_PLAYBGM] = PlayerPartnerHandlePlayBGM, + [CONTROLLER_32] = PlayerPartnerHandleCmd32, + [CONTROLLER_TWORETURNVALUES] = PlayerPartnerHandleTwoReturnValues, + [CONTROLLER_CHOSENMONRETURNVALUE] = PlayerPartnerHandleChosenMonReturnValue, + [CONTROLLER_ONERETURNVALUE] = PlayerPartnerHandleOneReturnValue, + [CONTROLLER_ONERETURNVALUE_DUPLICATE] = PlayerPartnerHandleOneReturnValue_Duplicate, + [CONTROLLER_CLEARUNKVAR] = PlayerPartnerHandleClearUnkVar, + [CONTROLLER_SETUNKVAR] = PlayerPartnerHandleSetUnkVar, + [CONTROLLER_CLEARUNKFLAG] = PlayerPartnerHandleClearUnkFlag, + [CONTROLLER_TOGGLEUNKFLAG] = PlayerPartnerHandleToggleUnkFlag, + [CONTROLLER_HITANIMATION] = PlayerPartnerHandleHitAnimation, + [CONTROLLER_42] = PlayerPartnerHandleCmd42, + [CONTROLLER_PLAYSE] = PlayerPartnerHandlePlaySE, + [CONTROLLER_PLAYFANFAREORBGM] = PlayerPartnerHandlePlayFanfareOrBGM, + [CONTROLLER_FAINTINGCRY] = PlayerPartnerHandleFaintingCry, + [CONTROLLER_INTROSLIDE] = PlayerPartnerHandleIntroSlide, + [CONTROLLER_INTROTRAINERBALLTHROW] = PlayerPartnerHandleIntroTrainerBallThrow, + [CONTROLLER_DRAWPARTYSTATUSSUMMARY] = PlayerPartnerHandleDrawPartyStatusSummary, + [CONTROLLER_HIDEPARTYSTATUSSUMMARY] = PlayerPartnerHandleHidePartyStatusSummary, + [CONTROLLER_ENDBOUNCE] = PlayerPartnerHandleEndBounceEffect, + [CONTROLLER_SPRITEINVISIBILITY] = PlayerPartnerHandleSpriteInvisibility, + [CONTROLLER_BATTLEANIMATION] = PlayerPartnerHandleBattleAnimation, + [CONTROLLER_LINKSTANDBYMSG] = PlayerPartnerHandleLinkStandbyMsg, + [CONTROLLER_RESETACTIONMOVESELECTION] = PlayerPartnerHandleResetActionMoveSelection, + [CONTROLLER_55] = PlayerPartnerHandleCmd55, + [CONTROLLER_TERMINATOR_NOP] = PlayerPartnerCmdEnd }; // unknown unused data -static const u8 sUnknown_08617254[] = +static const u8 sUnused[] = { 0x83, 0x4d, 0xf3, 0x5f, 0x6f, 0x4f, 0xeb, 0x3e, 0x67, 0x2e, 0x10, 0x46, 0x8c, 0x3d, 0x28, 0x35, @@ -1679,27 +1679,27 @@ static void PlayerPartnerHandleOneReturnValue_Duplicate(void) PlayerPartnerBufferExecCompleted(); } -static void PlayerPartnerHandleCmd37(void) +static void PlayerPartnerHandleClearUnkVar(void) { - gUnknown_02022D0C.field_0 = 0; + gUnusedControllerStruct.unk = 0; PlayerPartnerBufferExecCompleted(); } -static void PlayerPartnerHandleCmd38(void) +static void PlayerPartnerHandleSetUnkVar(void) { - gUnknown_02022D0C.field_0 = gBattleBufferA[gActiveBattler][1]; + gUnusedControllerStruct.unk = gBattleBufferA[gActiveBattler][1]; PlayerPartnerBufferExecCompleted(); } -static void PlayerPartnerHandleCmd39(void) +static void PlayerPartnerHandleClearUnkFlag(void) { - gUnknown_02022D0C.flag_x80 = 0; + gUnusedControllerStruct.flag = 0; PlayerPartnerBufferExecCompleted(); } -static void PlayerPartnerHandleCmd40(void) +static void PlayerPartnerHandleToggleUnkFlag(void) { - gUnknown_02022D0C.flag_x80 ^= 1; + gUnusedControllerStruct.flag ^= 1; PlayerPartnerBufferExecCompleted(); } diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index ca7cd4adc..63e1ff7a0 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -69,10 +69,10 @@ static void RecordedOpponentHandleTwoReturnValues(void); static void RecordedOpponentHandleChosenMonReturnValue(void); static void RecordedOpponentHandleOneReturnValue(void); static void RecordedOpponentHandleOneReturnValue_Duplicate(void); -static void RecordedOpponentHandleCmd37(void); -static void RecordedOpponentHandleCmd38(void); -static void RecordedOpponentHandleCmd39(void); -static void RecordedOpponentHandleCmd40(void); +static void RecordedOpponentHandleClearUnkVar(void); +static void RecordedOpponentHandleSetUnkVar(void); +static void RecordedOpponentHandleClearUnkFlag(void); +static void RecordedOpponentHandleToggleUnkFlag(void); static void RecordedOpponentHandleHitAnimation(void); static void RecordedOpponentHandleCmd42(void); static void RecordedOpponentHandlePlaySE(void); @@ -104,63 +104,63 @@ static void sub_818975C(void); static void (*const sRecordedOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) = { - RecordedOpponentHandleGetMonData, - RecordedOpponentHandleGetRawMonData, - RecordedOpponentHandleSetMonData, - RecordedOpponentHandleSetRawMonData, - RecordedOpponentHandleLoadMonSprite, - RecordedOpponentHandleSwitchInAnim, - RecordedOpponentHandleReturnMonToBall, - RecordedOpponentHandleDrawTrainerPic, - RecordedOpponentHandleTrainerSlide, - RecordedOpponentHandleTrainerSlideBack, - RecordedOpponentHandleFaintAnimation, - RecordedOpponentHandlePaletteFade, - RecordedOpponentHandleSuccessBallThrowAnim, - RecordedOpponentHandleBallThrowAnim, - RecordedOpponentHandlePause, - RecordedOpponentHandleMoveAnimation, - RecordedOpponentHandlePrintString, - RecordedOpponentHandlePrintSelectionString, - RecordedOpponentHandleChooseAction, - RecordedOpponentHandleUnknownYesNoBox, - RecordedOpponentHandleChooseMove, - RecordedOpponentHandleChooseItem, - RecordedOpponentHandleChoosePokemon, - RecordedOpponentHandleCmd23, - RecordedOpponentHandleHealthBarUpdate, - RecordedOpponentHandleExpUpdate, - RecordedOpponentHandleStatusIconUpdate, - RecordedOpponentHandleStatusAnimation, - RecordedOpponentHandleStatusXor, - RecordedOpponentHandleDataTransfer, - RecordedOpponentHandleDMA3Transfer, - RecordedOpponentHandlePlayBGM, - RecordedOpponentHandleCmd32, - RecordedOpponentHandleTwoReturnValues, - RecordedOpponentHandleChosenMonReturnValue, - RecordedOpponentHandleOneReturnValue, - RecordedOpponentHandleOneReturnValue_Duplicate, - RecordedOpponentHandleCmd37, - RecordedOpponentHandleCmd38, - RecordedOpponentHandleCmd39, - RecordedOpponentHandleCmd40, - RecordedOpponentHandleHitAnimation, - RecordedOpponentHandleCmd42, - RecordedOpponentHandlePlaySE, - RecordedOpponentHandlePlayFanfareOrBGM, - RecordedOpponentHandleFaintingCry, - RecordedOpponentHandleIntroSlide, - RecordedOpponentHandleIntroTrainerBallThrow, - RecordedOpponentHandleDrawPartyStatusSummary, - RecordedOpponentHandleHidePartyStatusSummary, - RecordedOpponentHandleEndBounceEffect, - RecordedOpponentHandleSpriteInvisibility, - RecordedOpponentHandleBattleAnimation, - RecordedOpponentHandleLinkStandbyMsg, - RecordedOpponentHandleResetActionMoveSelection, - RecordedOpponentHandleCmd55, - RecordedOpponentCmdEnd + [CONTROLLER_GETMONDATA] = RecordedOpponentHandleGetMonData, + [CONTROLLER_GETRAWMONDATA] = RecordedOpponentHandleGetRawMonData, + [CONTROLLER_SETMONDATA] = RecordedOpponentHandleSetMonData, + [CONTROLLER_SETRAWMONDATA] = RecordedOpponentHandleSetRawMonData, + [CONTROLLER_LOADMONSPRITE] = RecordedOpponentHandleLoadMonSprite, + [CONTROLLER_SWITCHINANIM] = RecordedOpponentHandleSwitchInAnim, + [CONTROLLER_RETURNMONTOBALL] = RecordedOpponentHandleReturnMonToBall, + [CONTROLLER_DRAWTRAINERPIC] = RecordedOpponentHandleDrawTrainerPic, + [CONTROLLER_TRAINERSLIDE] = RecordedOpponentHandleTrainerSlide, + [CONTROLLER_TRAINERSLIDEBACK] = RecordedOpponentHandleTrainerSlideBack, + [CONTROLLER_FAINTANIMATION] = RecordedOpponentHandleFaintAnimation, + [CONTROLLER_PALETTEFADE] = RecordedOpponentHandlePaletteFade, + [CONTROLLER_SUCCESSBALLTHROWANIM] = RecordedOpponentHandleSuccessBallThrowAnim, + [CONTROLLER_BALLTHROWANIM] = RecordedOpponentHandleBallThrowAnim, + [CONTROLLER_PAUSE] = RecordedOpponentHandlePause, + [CONTROLLER_MOVEANIMATION] = RecordedOpponentHandleMoveAnimation, + [CONTROLLER_PRINTSTRING] = RecordedOpponentHandlePrintString, + [CONTROLLER_PRINTSTRINGPLAYERONLY] = RecordedOpponentHandlePrintSelectionString, + [CONTROLLER_CHOOSEACTION] = RecordedOpponentHandleChooseAction, + [CONTROLLER_UNKNOWNYESNOBOX] = RecordedOpponentHandleUnknownYesNoBox, + [CONTROLLER_CHOOSEMOVE] = RecordedOpponentHandleChooseMove, + [CONTROLLER_OPENBAG] = RecordedOpponentHandleChooseItem, + [CONTROLLER_CHOOSEPOKEMON] = RecordedOpponentHandleChoosePokemon, + [CONTROLLER_23] = RecordedOpponentHandleCmd23, + [CONTROLLER_HEALTHBARUPDATE] = RecordedOpponentHandleHealthBarUpdate, + [CONTROLLER_EXPUPDATE] = RecordedOpponentHandleExpUpdate, + [CONTROLLER_STATUSICONUPDATE] = RecordedOpponentHandleStatusIconUpdate, + [CONTROLLER_STATUSANIMATION] = RecordedOpponentHandleStatusAnimation, + [CONTROLLER_STATUSXOR] = RecordedOpponentHandleStatusXor, + [CONTROLLER_DATATRANSFER] = RecordedOpponentHandleDataTransfer, + [CONTROLLER_DMA3TRANSFER] = RecordedOpponentHandleDMA3Transfer, + [CONTROLLER_PLAYBGM] = RecordedOpponentHandlePlayBGM, + [CONTROLLER_32] = RecordedOpponentHandleCmd32, + [CONTROLLER_TWORETURNVALUES] = RecordedOpponentHandleTwoReturnValues, + [CONTROLLER_CHOSENMONRETURNVALUE] = RecordedOpponentHandleChosenMonReturnValue, + [CONTROLLER_ONERETURNVALUE] = RecordedOpponentHandleOneReturnValue, + [CONTROLLER_ONERETURNVALUE_DUPLICATE] = RecordedOpponentHandleOneReturnValue_Duplicate, + [CONTROLLER_CLEARUNKVAR] = RecordedOpponentHandleClearUnkVar, + [CONTROLLER_SETUNKVAR] = RecordedOpponentHandleSetUnkVar, + [CONTROLLER_CLEARUNKFLAG] = RecordedOpponentHandleClearUnkFlag, + [CONTROLLER_TOGGLEUNKFLAG] = RecordedOpponentHandleToggleUnkFlag, + [CONTROLLER_HITANIMATION] = RecordedOpponentHandleHitAnimation, + [CONTROLLER_42] = RecordedOpponentHandleCmd42, + [CONTROLLER_PLAYSE] = RecordedOpponentHandlePlaySE, + [CONTROLLER_PLAYFANFAREORBGM] = RecordedOpponentHandlePlayFanfareOrBGM, + [CONTROLLER_FAINTINGCRY] = RecordedOpponentHandleFaintingCry, + [CONTROLLER_INTROSLIDE] = RecordedOpponentHandleIntroSlide, + [CONTROLLER_INTROTRAINERBALLTHROW] = RecordedOpponentHandleIntroTrainerBallThrow, + [CONTROLLER_DRAWPARTYSTATUSSUMMARY] = RecordedOpponentHandleDrawPartyStatusSummary, + [CONTROLLER_HIDEPARTYSTATUSSUMMARY] = RecordedOpponentHandleHidePartyStatusSummary, + [CONTROLLER_ENDBOUNCE] = RecordedOpponentHandleEndBounceEffect, + [CONTROLLER_SPRITEINVISIBILITY] = RecordedOpponentHandleSpriteInvisibility, + [CONTROLLER_BATTLEANIMATION] = RecordedOpponentHandleBattleAnimation, + [CONTROLLER_LINKSTANDBYMSG] = RecordedOpponentHandleLinkStandbyMsg, + [CONTROLLER_RESETACTIONMOVESELECTION] = RecordedOpponentHandleResetActionMoveSelection, + [CONTROLLER_55] = RecordedOpponentHandleCmd55, + [CONTROLLER_TERMINATOR_NOP] = RecordedOpponentCmdEnd }; static void nullsub_70(void) @@ -1544,27 +1544,27 @@ static void RecordedOpponentHandleOneReturnValue_Duplicate(void) RecordedOpponentBufferExecCompleted(); } -static void RecordedOpponentHandleCmd37(void) +static void RecordedOpponentHandleClearUnkVar(void) { - gUnknown_02022D0C.field_0 = 0; + gUnusedControllerStruct.unk = 0; RecordedOpponentBufferExecCompleted(); } -static void RecordedOpponentHandleCmd38(void) +static void RecordedOpponentHandleSetUnkVar(void) { - gUnknown_02022D0C.field_0 = gBattleBufferA[gActiveBattler][1]; + gUnusedControllerStruct.unk = gBattleBufferA[gActiveBattler][1]; RecordedOpponentBufferExecCompleted(); } -static void RecordedOpponentHandleCmd39(void) +static void RecordedOpponentHandleClearUnkFlag(void) { - gUnknown_02022D0C.flag_x80 = 0; + gUnusedControllerStruct.flag = 0; RecordedOpponentBufferExecCompleted(); } -static void RecordedOpponentHandleCmd40(void) +static void RecordedOpponentHandleToggleUnkFlag(void) { - gUnknown_02022D0C.flag_x80 ^= 1; + gUnusedControllerStruct.flag ^= 1; RecordedOpponentBufferExecCompleted(); } diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index 72af27d5e..3d4faf0cd 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -65,10 +65,10 @@ static void RecordedPlayerHandleTwoReturnValues(void); static void RecordedPlayerHandleChosenMonReturnValue(void); static void RecordedPlayerHandleOneReturnValue(void); static void RecordedPlayerHandleOneReturnValue_Duplicate(void); -static void RecordedPlayerHandleCmd37(void); -static void RecordedPlayerHandleCmd38(void); -static void RecordedPlayerHandleCmd39(void); -static void RecordedPlayerHandleCmd40(void); +static void RecordedPlayerHandleClearUnkVar(void); +static void RecordedPlayerHandleSetUnkVar(void); +static void RecordedPlayerHandleClearUnkFlag(void); +static void RecordedPlayerHandleToggleUnkFlag(void); static void RecordedPlayerHandleHitAnimation(void); static void RecordedPlayerHandleCmd42(void); static void RecordedPlayerHandlePlaySE(void); @@ -99,63 +99,63 @@ static void sub_818CDF4(void); static void (*const sRecordedPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = { - RecordedPlayerHandleGetMonData, - RecordedPlayerHandleGetRawMonData, - RecordedPlayerHandleSetMonData, - RecordedPlayerHandleSetRawMonData, - RecordedPlayerHandleLoadMonSprite, - RecordedPlayerHandleSwitchInAnim, - RecordedPlayerHandleReturnMonToBall, - RecordedPlayerHandleDrawTrainerPic, - RecordedPlayerHandleTrainerSlide, - RecordedPlayerHandleTrainerSlideBack, - RecordedPlayerHandleFaintAnimation, - RecordedPlayerHandlePaletteFade, - RecordedPlayerHandleSuccessBallThrowAnim, - RecordedPlayerHandleBallThrowAnim, - RecordedPlayerHandlePause, - RecordedPlayerHandleMoveAnimation, - RecordedPlayerHandlePrintString, - RecordedPlayerHandlePrintSelectionString, - RecordedPlayerHandleChooseAction, - RecordedPlayerHandleUnknownYesNoBox, - RecordedPlayerHandleChooseMove, - RecordedPlayerHandleChooseItem, - RecordedPlayerHandleChoosePokemon, - RecordedPlayerHandleCmd23, - RecordedPlayerHandleHealthBarUpdate, - RecordedPlayerHandleExpUpdate, - RecordedPlayerHandleStatusIconUpdate, - RecordedPlayerHandleStatusAnimation, - RecordedPlayerHandleStatusXor, - RecordedPlayerHandleDataTransfer, - RecordedPlayerHandleDMA3Transfer, - RecordedPlayerHandlePlayBGM, - RecordedPlayerHandleCmd32, - RecordedPlayerHandleTwoReturnValues, - RecordedPlayerHandleChosenMonReturnValue, - RecordedPlayerHandleOneReturnValue, - RecordedPlayerHandleOneReturnValue_Duplicate, - RecordedPlayerHandleCmd37, - RecordedPlayerHandleCmd38, - RecordedPlayerHandleCmd39, - RecordedPlayerHandleCmd40, - RecordedPlayerHandleHitAnimation, - RecordedPlayerHandleCmd42, - RecordedPlayerHandlePlaySE, - RecordedPlayerHandlePlayFanfareOrBGM, - RecordedPlayerHandleFaintingCry, - RecordedPlayerHandleIntroSlide, - RecordedPlayerHandleIntroTrainerBallThrow, - RecordedPlayerHandleDrawPartyStatusSummary, - RecordedPlayerHandleHidePartyStatusSummary, - RecordedPlayerHandleEndBounceEffect, - RecordedPlayerHandleSpriteInvisibility, - RecordedPlayerHandleBattleAnimation, - RecordedPlayerHandleLinkStandbyMsg, - RecordedPlayerHandleResetActionMoveSelection, - RecordedPlayerHandleCmd55, - RecordedPlayerCmdEnd + [CONTROLLER_GETMONDATA] = RecordedPlayerHandleGetMonData, + [CONTROLLER_GETRAWMONDATA] = RecordedPlayerHandleGetRawMonData, + [CONTROLLER_SETMONDATA] = RecordedPlayerHandleSetMonData, + [CONTROLLER_SETRAWMONDATA] = RecordedPlayerHandleSetRawMonData, + [CONTROLLER_LOADMONSPRITE] = RecordedPlayerHandleLoadMonSprite, + [CONTROLLER_SWITCHINANIM] = RecordedPlayerHandleSwitchInAnim, + [CONTROLLER_RETURNMONTOBALL] = RecordedPlayerHandleReturnMonToBall, + [CONTROLLER_DRAWTRAINERPIC] = RecordedPlayerHandleDrawTrainerPic, + [CONTROLLER_TRAINERSLIDE] = RecordedPlayerHandleTrainerSlide, + [CONTROLLER_TRAINERSLIDEBACK] = RecordedPlayerHandleTrainerSlideBack, + [CONTROLLER_FAINTANIMATION] = RecordedPlayerHandleFaintAnimation, + [CONTROLLER_PALETTEFADE] = RecordedPlayerHandlePaletteFade, + [CONTROLLER_SUCCESSBALLTHROWANIM] = RecordedPlayerHandleSuccessBallThrowAnim, + [CONTROLLER_BALLTHROWANIM] = RecordedPlayerHandleBallThrowAnim, + [CONTROLLER_PAUSE] = RecordedPlayerHandlePause, + [CONTROLLER_MOVEANIMATION] = RecordedPlayerHandleMoveAnimation, + [CONTROLLER_PRINTSTRING] = RecordedPlayerHandlePrintString, + [CONTROLLER_PRINTSTRINGPLAYERONLY] = RecordedPlayerHandlePrintSelectionString, + [CONTROLLER_CHOOSEACTION] = RecordedPlayerHandleChooseAction, + [CONTROLLER_UNKNOWNYESNOBOX] = RecordedPlayerHandleUnknownYesNoBox, + [CONTROLLER_CHOOSEMOVE] = RecordedPlayerHandleChooseMove, + [CONTROLLER_OPENBAG] = RecordedPlayerHandleChooseItem, + [CONTROLLER_CHOOSEPOKEMON] = RecordedPlayerHandleChoosePokemon, + [CONTROLLER_23] = RecordedPlayerHandleCmd23, + [CONTROLLER_HEALTHBARUPDATE] = RecordedPlayerHandleHealthBarUpdate, + [CONTROLLER_EXPUPDATE] = RecordedPlayerHandleExpUpdate, + [CONTROLLER_STATUSICONUPDATE] = RecordedPlayerHandleStatusIconUpdate, + [CONTROLLER_STATUSANIMATION] = RecordedPlayerHandleStatusAnimation, + [CONTROLLER_STATUSXOR] = RecordedPlayerHandleStatusXor, + [CONTROLLER_DATATRANSFER] = RecordedPlayerHandleDataTransfer, + [CONTROLLER_DMA3TRANSFER] = RecordedPlayerHandleDMA3Transfer, + [CONTROLLER_PLAYBGM] = RecordedPlayerHandlePlayBGM, + [CONTROLLER_32] = RecordedPlayerHandleCmd32, + [CONTROLLER_TWORETURNVALUES] = RecordedPlayerHandleTwoReturnValues, + [CONTROLLER_CHOSENMONRETURNVALUE] = RecordedPlayerHandleChosenMonReturnValue, + [CONTROLLER_ONERETURNVALUE] = RecordedPlayerHandleOneReturnValue, + [CONTROLLER_ONERETURNVALUE_DUPLICATE] = RecordedPlayerHandleOneReturnValue_Duplicate, + [CONTROLLER_CLEARUNKVAR] = RecordedPlayerHandleClearUnkVar, + [CONTROLLER_SETUNKVAR] = RecordedPlayerHandleSetUnkVar, + [CONTROLLER_CLEARUNKFLAG] = RecordedPlayerHandleClearUnkFlag, + [CONTROLLER_TOGGLEUNKFLAG] = RecordedPlayerHandleToggleUnkFlag, + [CONTROLLER_HITANIMATION] = RecordedPlayerHandleHitAnimation, + [CONTROLLER_42] = RecordedPlayerHandleCmd42, + [CONTROLLER_PLAYSE] = RecordedPlayerHandlePlaySE, + [CONTROLLER_PLAYFANFAREORBGM] = RecordedPlayerHandlePlayFanfareOrBGM, + [CONTROLLER_FAINTINGCRY] = RecordedPlayerHandleFaintingCry, + [CONTROLLER_INTROSLIDE] = RecordedPlayerHandleIntroSlide, + [CONTROLLER_INTROTRAINERBALLTHROW] = RecordedPlayerHandleIntroTrainerBallThrow, + [CONTROLLER_DRAWPARTYSTATUSSUMMARY] = RecordedPlayerHandleDrawPartyStatusSummary, + [CONTROLLER_HIDEPARTYSTATUSSUMMARY] = RecordedPlayerHandleHidePartyStatusSummary, + [CONTROLLER_ENDBOUNCE] = RecordedPlayerHandleEndBounceEffect, + [CONTROLLER_SPRITEINVISIBILITY] = RecordedPlayerHandleSpriteInvisibility, + [CONTROLLER_BATTLEANIMATION] = RecordedPlayerHandleBattleAnimation, + [CONTROLLER_LINKSTANDBYMSG] = RecordedPlayerHandleLinkStandbyMsg, + [CONTROLLER_RESETACTIONMOVESELECTION] = RecordedPlayerHandleResetActionMoveSelection, + [CONTROLLER_55] = RecordedPlayerHandleCmd55, + [CONTROLLER_TERMINATOR_NOP] = RecordedPlayerCmdEnd }; static void nullsub_120(void) @@ -1561,27 +1561,27 @@ static void RecordedPlayerHandleOneReturnValue_Duplicate(void) RecordedPlayerBufferExecCompleted(); } -static void RecordedPlayerHandleCmd37(void) +static void RecordedPlayerHandleClearUnkVar(void) { - gUnknown_02022D0C.field_0 = 0; + gUnusedControllerStruct.unk = 0; RecordedPlayerBufferExecCompleted(); } -static void RecordedPlayerHandleCmd38(void) +static void RecordedPlayerHandleSetUnkVar(void) { - gUnknown_02022D0C.field_0 = gBattleBufferA[gActiveBattler][1]; + gUnusedControllerStruct.unk = gBattleBufferA[gActiveBattler][1]; RecordedPlayerBufferExecCompleted(); } -static void RecordedPlayerHandleCmd39(void) +static void RecordedPlayerHandleClearUnkFlag(void) { - gUnknown_02022D0C.flag_x80 = 0; + gUnusedControllerStruct.flag = 0; RecordedPlayerBufferExecCompleted(); } -static void RecordedPlayerHandleCmd40(void) +static void RecordedPlayerHandleToggleUnkFlag(void) { - gUnknown_02022D0C.flag_x80 ^= 1; + gUnusedControllerStruct.flag ^= 1; RecordedPlayerBufferExecCompleted(); } diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c index 9cb427e12..b5a8b1bb6 100644 --- a/src/battle_controller_safari.c +++ b/src/battle_controller_safari.c @@ -62,10 +62,10 @@ static void SafariHandleTwoReturnValues(void); static void SafariHandleChosenMonReturnValue(void); static void SafariHandleOneReturnValue(void); static void SafariHandleOneReturnValue_Duplicate(void); -static void SafariHandleCmd37(void); -static void SafariHandleCmd38(void); -static void SafariHandleCmd39(void); -static void SafariHandleCmd40(void); +static void SafariHandleClearUnkVar(void); +static void SafariHandleSetUnkVar(void); +static void SafariHandleClearUnkFlag(void); +static void SafariHandleToggleUnkFlag(void); static void SafariHandleHitAnimation(void); static void SafariHandleCmd42(void); static void SafariHandlePlaySE(void); @@ -89,63 +89,63 @@ static void CompleteWhenChosePokeblock(void); static void (*const sSafariBufferCommands[CONTROLLER_CMDS_COUNT])(void) = { - SafariHandleGetMonData, - SafariHandleGetRawMonData, - SafariHandleSetMonData, - SafariHandleSetRawMonData, - SafariHandleLoadMonSprite, - SafariHandleSwitchInAnim, - SafariHandleReturnMonToBall, - SafariHandleDrawTrainerPic, - SafariHandleTrainerSlide, - SafariHandleTrainerSlideBack, - SafariHandleFaintAnimation, - SafariHandlePaletteFade, - SafariHandleSuccessBallThrowAnim, - SafariHandleBallThrowAnim, - SafariHandlePause, - SafariHandleMoveAnimation, - SafariHandlePrintString, - SafariHandlePrintSelectionString, - SafariHandleChooseAction, - SafariHandleUnknownYesNoBox, - SafariHandleChooseMove, - SafariHandleChooseItem, - SafariHandleChoosePokemon, - SafariHandleCmd23, - SafariHandleHealthBarUpdate, - SafariHandleExpUpdate, - SafariHandleStatusIconUpdate, - SafariHandleStatusAnimation, - SafariHandleStatusXor, - SafariHandleDataTransfer, - SafariHandleDMA3Transfer, - SafariHandlePlayBGM, - SafariHandleCmd32, - SafariHandleTwoReturnValues, - SafariHandleChosenMonReturnValue, - SafariHandleOneReturnValue, - SafariHandleOneReturnValue_Duplicate, - SafariHandleCmd37, - SafariHandleCmd38, - SafariHandleCmd39, - SafariHandleCmd40, - SafariHandleHitAnimation, - SafariHandleCmd42, - SafariHandlePlaySE, - SafariHandlePlayFanfareOrBGM, - SafariHandleFaintingCry, - SafariHandleIntroSlide, - SafariHandleIntroTrainerBallThrow, - SafariHandleDrawPartyStatusSummary, - SafariHandleHidePartyStatusSummary, - SafariHandleEndBounceEffect, - SafariHandleSpriteInvisibility, - SafariHandleBattleAnimation, - SafariHandleLinkStandbyMsg, - SafariHandleResetActionMoveSelection, - SafariHandleCmd55, - SafariCmdEnd + [CONTROLLER_GETMONDATA] = SafariHandleGetMonData, + [CONTROLLER_GETRAWMONDATA] = SafariHandleGetRawMonData, + [CONTROLLER_SETMONDATA] = SafariHandleSetMonData, + [CONTROLLER_SETRAWMONDATA] = SafariHandleSetRawMonData, + [CONTROLLER_LOADMONSPRITE] = SafariHandleLoadMonSprite, + [CONTROLLER_SWITCHINANIM] = SafariHandleSwitchInAnim, + [CONTROLLER_RETURNMONTOBALL] = SafariHandleReturnMonToBall, + [CONTROLLER_DRAWTRAINERPIC] = SafariHandleDrawTrainerPic, + [CONTROLLER_TRAINERSLIDE] = SafariHandleTrainerSlide, + [CONTROLLER_TRAINERSLIDEBACK] = SafariHandleTrainerSlideBack, + [CONTROLLER_FAINTANIMATION] = SafariHandleFaintAnimation, + [CONTROLLER_PALETTEFADE] = SafariHandlePaletteFade, + [CONTROLLER_SUCCESSBALLTHROWANIM] = SafariHandleSuccessBallThrowAnim, + [CONTROLLER_BALLTHROWANIM] = SafariHandleBallThrowAnim, + [CONTROLLER_PAUSE] = SafariHandlePause, + [CONTROLLER_MOVEANIMATION] = SafariHandleMoveAnimation, + [CONTROLLER_PRINTSTRING] = SafariHandlePrintString, + [CONTROLLER_PRINTSTRINGPLAYERONLY] = SafariHandlePrintSelectionString, + [CONTROLLER_CHOOSEACTION] = SafariHandleChooseAction, + [CONTROLLER_UNKNOWNYESNOBOX] = SafariHandleUnknownYesNoBox, + [CONTROLLER_CHOOSEMOVE] = SafariHandleChooseMove, + [CONTROLLER_OPENBAG] = SafariHandleChooseItem, + [CONTROLLER_CHOOSEPOKEMON] = SafariHandleChoosePokemon, + [CONTROLLER_23] = SafariHandleCmd23, + [CONTROLLER_HEALTHBARUPDATE] = SafariHandleHealthBarUpdate, + [CONTROLLER_EXPUPDATE] = SafariHandleExpUpdate, + [CONTROLLER_STATUSICONUPDATE] = SafariHandleStatusIconUpdate, + [CONTROLLER_STATUSANIMATION] = SafariHandleStatusAnimation, + [CONTROLLER_STATUSXOR] = SafariHandleStatusXor, + [CONTROLLER_DATATRANSFER] = SafariHandleDataTransfer, + [CONTROLLER_DMA3TRANSFER] = SafariHandleDMA3Transfer, + [CONTROLLER_PLAYBGM] = SafariHandlePlayBGM, + [CONTROLLER_32] = SafariHandleCmd32, + [CONTROLLER_TWORETURNVALUES] = SafariHandleTwoReturnValues, + [CONTROLLER_CHOSENMONRETURNVALUE] = SafariHandleChosenMonReturnValue, + [CONTROLLER_ONERETURNVALUE] = SafariHandleOneReturnValue, + [CONTROLLER_ONERETURNVALUE_DUPLICATE] = SafariHandleOneReturnValue_Duplicate, + [CONTROLLER_CLEARUNKVAR] = SafariHandleClearUnkVar, + [CONTROLLER_SETUNKVAR] = SafariHandleSetUnkVar, + [CONTROLLER_CLEARUNKFLAG] = SafariHandleClearUnkFlag, + [CONTROLLER_TOGGLEUNKFLAG] = SafariHandleToggleUnkFlag, + [CONTROLLER_HITANIMATION] = SafariHandleHitAnimation, + [CONTROLLER_42] = SafariHandleCmd42, + [CONTROLLER_PLAYSE] = SafariHandlePlaySE, + [CONTROLLER_PLAYFANFAREORBGM] = SafariHandlePlayFanfareOrBGM, + [CONTROLLER_FAINTINGCRY] = SafariHandleFaintingCry, + [CONTROLLER_INTROSLIDE] = SafariHandleIntroSlide, + [CONTROLLER_INTROTRAINERBALLTHROW] = SafariHandleIntroTrainerBallThrow, + [CONTROLLER_DRAWPARTYSTATUSSUMMARY] = SafariHandleDrawPartyStatusSummary, + [CONTROLLER_HIDEPARTYSTATUSSUMMARY] = SafariHandleHidePartyStatusSummary, + [CONTROLLER_ENDBOUNCE] = SafariHandleEndBounceEffect, + [CONTROLLER_SPRITEINVISIBILITY] = SafariHandleSpriteInvisibility, + [CONTROLLER_BATTLEANIMATION] = SafariHandleBattleAnimation, + [CONTROLLER_LINKSTANDBYMSG] = SafariHandleLinkStandbyMsg, + [CONTROLLER_RESETACTIONMOVESELECTION] = SafariHandleResetActionMoveSelection, + [CONTROLLER_55] = SafariHandleCmd55, + [CONTROLLER_TERMINATOR_NOP] = SafariCmdEnd }; static void SpriteCB_Null4(void) @@ -553,22 +553,22 @@ static void SafariHandleOneReturnValue_Duplicate(void) SafariBufferExecCompleted(); } -static void SafariHandleCmd37(void) +static void SafariHandleClearUnkVar(void) { SafariBufferExecCompleted(); } -static void SafariHandleCmd38(void) +static void SafariHandleSetUnkVar(void) { SafariBufferExecCompleted(); } -static void SafariHandleCmd39(void) +static void SafariHandleClearUnkFlag(void) { SafariBufferExecCompleted(); } -static void SafariHandleCmd40(void) +static void SafariHandleToggleUnkFlag(void) { SafariBufferExecCompleted(); } diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index aa50bc159..83a977073 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -70,10 +70,10 @@ static void WallyHandleTwoReturnValues(void); static void WallyHandleChosenMonReturnValue(void); static void WallyHandleOneReturnValue(void); static void WallyHandleOneReturnValue_Duplicate(void); -static void WallyHandleCmd37(void); -static void WallyHandleCmd38(void); -static void WallyHandleCmd39(void); -static void WallyHandleCmd40(void); +static void WallyHandleClearUnkVar(void); +static void WallyHandleSetUnkVar(void); +static void WallyHandleClearUnkFlag(void); +static void WallyHandleToggleUnkFlag(void); static void WallyHandleHitAnimation(void); static void WallyHandleCmd42(void); static void WallyHandlePlaySE(void); @@ -102,63 +102,63 @@ static void sub_816AC04(u8 taskId); static void (*const sWallyBufferCommands[CONTROLLER_CMDS_COUNT])(void) = { - WallyHandleGetMonData, - WallyHandleGetRawMonData, - WallyHandleSetMonData, - WallyHandleSetRawMonData, - WallyHandleLoadMonSprite, - WallyHandleSwitchInAnim, - WallyHandleReturnMonToBall, - WallyHandleDrawTrainerPic, - WallyHandleTrainerSlide, - WallyHandleTrainerSlideBack, - WallyHandleFaintAnimation, - WallyHandlePaletteFade, - WallyHandleSuccessBallThrowAnim, - WallyHandleBallThrowAnim, - WallyHandlePause, - WallyHandleMoveAnimation, - WallyHandlePrintString, - WallyHandlePrintSelectionString, - WallyHandleChooseAction, - WallyHandleUnknownYesNoBox, - WallyHandleChooseMove, - WallyHandleChooseItem, - WallyHandleChoosePokemon, - WallyHandleCmd23, - WallyHandleHealthBarUpdate, - WallyHandleExpUpdate, - WallyHandleStatusIconUpdate, - WallyHandleStatusAnimation, - WallyHandleStatusXor, - WallyHandleDataTransfer, - WallyHandleDMA3Transfer, - WallyHandlePlayBGM, - WallyHandleCmd32, - WallyHandleTwoReturnValues, - WallyHandleChosenMonReturnValue, - WallyHandleOneReturnValue, - WallyHandleOneReturnValue_Duplicate, - WallyHandleCmd37, - WallyHandleCmd38, - WallyHandleCmd39, - WallyHandleCmd40, - WallyHandleHitAnimation, - WallyHandleCmd42, - WallyHandlePlaySE, - WallyHandlePlayFanfareOrBGM, - WallyHandleFaintingCry, - WallyHandleIntroSlide, - WallyHandleIntroTrainerBallThrow, - WallyHandleDrawPartyStatusSummary, - WallyHandleHidePartyStatusSummary, - WallyHandleEndBounceEffect, - WallyHandleSpriteInvisibility, - WallyHandleBattleAnimation, - WallyHandleLinkStandbyMsg, - WallyHandleResetActionMoveSelection, - WallyHandleCmd55, - WallyCmdEnd + [CONTROLLER_GETMONDATA] = WallyHandleGetMonData, + [CONTROLLER_GETRAWMONDATA] = WallyHandleGetRawMonData, + [CONTROLLER_SETMONDATA] = WallyHandleSetMonData, + [CONTROLLER_SETRAWMONDATA] = WallyHandleSetRawMonData, + [CONTROLLER_LOADMONSPRITE] = WallyHandleLoadMonSprite, + [CONTROLLER_SWITCHINANIM] = WallyHandleSwitchInAnim, + [CONTROLLER_RETURNMONTOBALL] = WallyHandleReturnMonToBall, + [CONTROLLER_DRAWTRAINERPIC] = WallyHandleDrawTrainerPic, + [CONTROLLER_TRAINERSLIDE] = WallyHandleTrainerSlide, + [CONTROLLER_TRAINERSLIDEBACK] = WallyHandleTrainerSlideBack, + [CONTROLLER_FAINTANIMATION] = WallyHandleFaintAnimation, + [CONTROLLER_PALETTEFADE] = WallyHandlePaletteFade, + [CONTROLLER_SUCCESSBALLTHROWANIM] = WallyHandleSuccessBallThrowAnim, + [CONTROLLER_BALLTHROWANIM] = WallyHandleBallThrowAnim, + [CONTROLLER_PAUSE] = WallyHandlePause, + [CONTROLLER_MOVEANIMATION] = WallyHandleMoveAnimation, + [CONTROLLER_PRINTSTRING] = WallyHandlePrintString, + [CONTROLLER_PRINTSTRINGPLAYERONLY] = WallyHandlePrintSelectionString, + [CONTROLLER_CHOOSEACTION] = WallyHandleChooseAction, + [CONTROLLER_UNKNOWNYESNOBOX] = WallyHandleUnknownYesNoBox, + [CONTROLLER_CHOOSEMOVE] = WallyHandleChooseMove, + [CONTROLLER_OPENBAG] = WallyHandleChooseItem, + [CONTROLLER_CHOOSEPOKEMON] = WallyHandleChoosePokemon, + [CONTROLLER_23] = WallyHandleCmd23, + [CONTROLLER_HEALTHBARUPDATE] = WallyHandleHealthBarUpdate, + [CONTROLLER_EXPUPDATE] = WallyHandleExpUpdate, + [CONTROLLER_STATUSICONUPDATE] = WallyHandleStatusIconUpdate, + [CONTROLLER_STATUSANIMATION] = WallyHandleStatusAnimation, + [CONTROLLER_STATUSXOR] = WallyHandleStatusXor, + [CONTROLLER_DATATRANSFER] = WallyHandleDataTransfer, + [CONTROLLER_DMA3TRANSFER] = WallyHandleDMA3Transfer, + [CONTROLLER_PLAYBGM] = WallyHandlePlayBGM, + [CONTROLLER_32] = WallyHandleCmd32, + [CONTROLLER_TWORETURNVALUES] = WallyHandleTwoReturnValues, + [CONTROLLER_CHOSENMONRETURNVALUE] = WallyHandleChosenMonReturnValue, + [CONTROLLER_ONERETURNVALUE] = WallyHandleOneReturnValue, + [CONTROLLER_ONERETURNVALUE_DUPLICATE] = WallyHandleOneReturnValue_Duplicate, + [CONTROLLER_CLEARUNKVAR] = WallyHandleClearUnkVar, + [CONTROLLER_SETUNKVAR] = WallyHandleSetUnkVar, + [CONTROLLER_CLEARUNKFLAG] = WallyHandleClearUnkFlag, + [CONTROLLER_TOGGLEUNKFLAG] = WallyHandleToggleUnkFlag, + [CONTROLLER_HITANIMATION] = WallyHandleHitAnimation, + [CONTROLLER_42] = WallyHandleCmd42, + [CONTROLLER_PLAYSE] = WallyHandlePlaySE, + [CONTROLLER_PLAYFANFAREORBGM] = WallyHandlePlayFanfareOrBGM, + [CONTROLLER_FAINTINGCRY] = WallyHandleFaintingCry, + [CONTROLLER_INTROSLIDE] = WallyHandleIntroSlide, + [CONTROLLER_INTROTRAINERBALLTHROW] = WallyHandleIntroTrainerBallThrow, + [CONTROLLER_DRAWPARTYSTATUSSUMMARY] = WallyHandleDrawPartyStatusSummary, + [CONTROLLER_HIDEPARTYSTATUSSUMMARY] = WallyHandleHidePartyStatusSummary, + [CONTROLLER_ENDBOUNCE] = WallyHandleEndBounceEffect, + [CONTROLLER_SPRITEINVISIBILITY] = WallyHandleSpriteInvisibility, + [CONTROLLER_BATTLEANIMATION] = WallyHandleBattleAnimation, + [CONTROLLER_LINKSTANDBYMSG] = WallyHandleLinkStandbyMsg, + [CONTROLLER_RESETACTIONMOVESELECTION] = WallyHandleResetActionMoveSelection, + [CONTROLLER_55] = WallyHandleCmd55, + [CONTROLLER_TERMINATOR_NOP] = WallyCmdEnd }; static void SpriteCB_Null7(void) @@ -1346,22 +1346,22 @@ static void WallyHandleOneReturnValue_Duplicate(void) WallyBufferExecCompleted(); } -static void WallyHandleCmd37(void) +static void WallyHandleClearUnkVar(void) { WallyBufferExecCompleted(); } -static void WallyHandleCmd38(void) +static void WallyHandleSetUnkVar(void) { WallyBufferExecCompleted(); } -static void WallyHandleCmd39(void) +static void WallyHandleClearUnkFlag(void) { WallyBufferExecCompleted(); } -static void WallyHandleCmd40(void) +static void WallyHandleToggleUnkFlag(void) { WallyBufferExecCompleted(); } diff --git a/src/battle_controllers.c b/src/battle_controllers.c index 3ebc5d3bd..a95bb2f6a 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -17,7 +17,7 @@ static EWRAM_DATA u8 sLinkSendTaskId = 0; static EWRAM_DATA u8 sLinkReceiveTaskId = 0; static EWRAM_DATA u8 sUnknown_02022D0A = 0; -EWRAM_DATA struct UnusedControllerStruct gUnknown_02022D0C = {}; +EWRAM_DATA struct UnusedControllerStruct gUnusedControllerStruct = {}; // Debug? Unused code that writes to it, never read static EWRAM_DATA u8 sBattleBuffersTransferData[0x100] = {}; // this file's funcionts @@ -1282,7 +1282,7 @@ void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *unusedDumbDataPara { s32 i; - sBattleBuffersTransferData[0] = CONTROLLER_31; + sBattleBuffersTransferData[0] = CONTROLLER_PLAYBGM; sBattleBuffersTransferData[1] = songId; sBattleBuffersTransferData[2] = (songId & 0xFF00) >> 8; for (i = 0; i < songId; i++) // ???? @@ -1340,37 +1340,37 @@ void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 b) PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } -void BtlController_EmitCmd37(u8 bufferId) +void BtlController_EmitClearUnkVar(u8 bufferId) { - sBattleBuffersTransferData[0] = CONTROLLER_37; - sBattleBuffersTransferData[1] = CONTROLLER_37; - sBattleBuffersTransferData[2] = CONTROLLER_37; - sBattleBuffersTransferData[3] = CONTROLLER_37; + sBattleBuffersTransferData[0] = CONTROLLER_CLEARUNKVAR; + sBattleBuffersTransferData[1] = CONTROLLER_CLEARUNKVAR; + sBattleBuffersTransferData[2] = CONTROLLER_CLEARUNKVAR; + sBattleBuffersTransferData[3] = CONTROLLER_CLEARUNKVAR; PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } -void BtlController_EmitCmd38(u8 bufferId, u8 b) +void BtlController_EmitSetUnkVar(u8 bufferId, u8 b) { - sBattleBuffersTransferData[0] = CONTROLLER_38; + sBattleBuffersTransferData[0] = CONTROLLER_SETUNKVAR; sBattleBuffersTransferData[1] = b; PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 2); } -void BtlController_EmitCmd39(u8 bufferId) +void BtlController_EmitClearUnkFlag(u8 bufferId) { - sBattleBuffersTransferData[0] = CONTROLLER_39; - sBattleBuffersTransferData[1] = CONTROLLER_39; - sBattleBuffersTransferData[2] = CONTROLLER_39; - sBattleBuffersTransferData[3] = CONTROLLER_39; + sBattleBuffersTransferData[0] = CONTROLLER_CLEARUNKFLAG; + sBattleBuffersTransferData[1] = CONTROLLER_CLEARUNKFLAG; + sBattleBuffersTransferData[2] = CONTROLLER_CLEARUNKFLAG; + sBattleBuffersTransferData[3] = CONTROLLER_CLEARUNKFLAG; PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } -void BtlController_EmitCmd40(u8 bufferId) +void BtlController_EmitToggleUnkFlag(u8 bufferId) { - sBattleBuffersTransferData[0] = CONTROLLER_40; - sBattleBuffersTransferData[1] = CONTROLLER_40; - sBattleBuffersTransferData[2] = CONTROLLER_40; - sBattleBuffersTransferData[3] = CONTROLLER_40; + sBattleBuffersTransferData[0] = CONTROLLER_TOGGLEUNKFLAG; + sBattleBuffersTransferData[1] = CONTROLLER_TOGGLEUNKFLAG; + sBattleBuffersTransferData[2] = CONTROLLER_TOGGLEUNKFLAG; + sBattleBuffersTransferData[3] = CONTROLLER_TOGGLEUNKFLAG; PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } @@ -1394,7 +1394,7 @@ void BtlController_EmitCmd42(u8 bufferId) void BtlController_EmitPlaySE(u8 bufferId, u16 songId) { - sBattleBuffersTransferData[0] = CONTROLLER_EFFECTIVENESSSOUND; + sBattleBuffersTransferData[0] = CONTROLLER_PLAYSE; sBattleBuffersTransferData[1] = songId; sBattleBuffersTransferData[2] = (songId & 0xFF00) >> 8; sBattleBuffersTransferData[3] = 0;