BUFFER_A/B -> BATTLELINKMSGTYPE; link send/recv. task data names
Replaced the BUFFER_A and BUFFER_B constants with the BATTLELINKMSGTYPE enum, which also identifies the "controller becoming idle" message type. Named the task data for the link send task and the link receive task. Added macros to functions related to those tasks, for legibility.
This commit is contained in:
@@ -475,7 +475,7 @@ static void RecordedPlayerBufferExecCompleted(void)
|
||||
{
|
||||
u8 playerId = GetMultiplayerId();
|
||||
|
||||
PrepareBufferDataTransferLink(2, 4, &playerId);
|
||||
PrepareBufferDataTransferLink(BATTLELINKMSGTYPE_CONTROLLER_BECOMING_IDLE, 4, &playerId);
|
||||
gBattleBufferA[gActiveBattler][0] = CONTROLLER_TERMINATOR_NOP;
|
||||
}
|
||||
else
|
||||
@@ -517,7 +517,7 @@ static void RecordedPlayerHandleGetMonData(void)
|
||||
monToCheck >>= 1;
|
||||
}
|
||||
}
|
||||
BtlController_EmitDataTransfer(BUFFER_B, size, monData);
|
||||
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, size, monData);
|
||||
RecordedPlayerBufferExecCompleted();
|
||||
}
|
||||
|
||||
@@ -1414,7 +1414,7 @@ static void ChooseActionInBattlePalace(void)
|
||||
{
|
||||
if (gBattleCommunication[4] >= gBattlersCount / 2)
|
||||
{
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, RecordedBattle_GetBattlerAction(gActiveBattler), 0);
|
||||
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, RecordedBattle_GetBattlerAction(gActiveBattler), 0);
|
||||
RecordedPlayerBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
@@ -1427,7 +1427,7 @@ static void RecordedPlayerHandleChooseAction(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, RecordedBattle_GetBattlerAction(gActiveBattler), 0);
|
||||
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, RecordedBattle_GetBattlerAction(gActiveBattler), 0);
|
||||
RecordedPlayerBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
@@ -1441,13 +1441,13 @@ static void RecordedPlayerHandleChooseMove(void)
|
||||
{
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
|
||||
{
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, 10, ChooseMoveAndTargetInBattlePalace());
|
||||
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 10, ChooseMoveAndTargetInBattlePalace());
|
||||
}
|
||||
else
|
||||
{
|
||||
u8 moveId = RecordedBattle_GetBattlerAction(gActiveBattler);
|
||||
u8 target = RecordedBattle_GetBattlerAction(gActiveBattler);
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, 10, moveId | (target << 8));
|
||||
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 10, moveId | (target << 8));
|
||||
}
|
||||
|
||||
RecordedPlayerBufferExecCompleted();
|
||||
@@ -1461,7 +1461,7 @@ static void RecordedPlayerHandleChooseItem(void)
|
||||
static void RecordedPlayerHandleChoosePokemon(void)
|
||||
{
|
||||
*(gBattleStruct->monToSwitchIntoId + gActiveBattler) = RecordedBattle_GetBattlerAction(gActiveBattler);
|
||||
BtlController_EmitChosenMonReturnValue(BUFFER_B, *(gBattleStruct->monToSwitchIntoId + gActiveBattler), NULL);
|
||||
BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, *(gBattleStruct->monToSwitchIntoId + gActiveBattler), NULL);
|
||||
RecordedPlayerBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user