Fixed find-and-replace mistake

Functions were using the wrong constant.
This commit is contained in:
DavidJCobb
2025-04-26 10:54:22 -04:00
parent 8f5c1a452d
commit d8721b668e
9 changed files with 65 additions and 65 deletions
+1 -1
View File
@@ -548,7 +548,7 @@ static void LinkOpponentHandleGetMonData(void)
monToCheck >>= 1; monToCheck >>= 1;
} }
} }
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, size, monData); BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, size, monData);
LinkOpponentBufferExecCompleted(); LinkOpponentBufferExecCompleted();
} }
+1 -1
View File
@@ -442,7 +442,7 @@ static void LinkPartnerHandleGetMonData(void)
monToCheck >>= 1; monToCheck >>= 1;
} }
} }
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, size, monData); BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, size, monData);
LinkPartnerBufferExecCompleted(); LinkPartnerBufferExecCompleted();
} }
+12 -12
View File
@@ -561,7 +561,7 @@ static void OpponentHandleGetMonData(void)
monToCheck >>= 1; monToCheck >>= 1;
} }
} }
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, size, monData); BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, size, monData);
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
} }
@@ -881,7 +881,7 @@ static void OpponentHandleGetRawMonData(void)
for (i = 0; i < gBattleBufferA[gActiveBattler][2]; i++) for (i = 0; i < gBattleBufferA[gActiveBattler][2]; i++)
dst[i] = src[i]; dst[i] = src[i];
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gBattleBufferA[gActiveBattler][2], dst); BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, gBattleBufferA[gActiveBattler][2], dst);
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
} }
@@ -1552,7 +1552,7 @@ static void OpponentHandleChooseMove(void)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_PALACE) if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{ {
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 10, ChooseMoveAndTargetInBattlePalace()); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, ChooseMoveAndTargetInBattlePalace());
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
} }
else else
@@ -1569,13 +1569,13 @@ static void OpponentHandleChooseMove(void)
switch (chosenMoveId) switch (chosenMoveId)
{ {
case AI_CHOICE_WATCH: case AI_CHOICE_WATCH:
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, B_ACTION_SAFARI_WATCH_CAREFULLY, 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SAFARI_WATCH_CAREFULLY, 0);
break; break;
case AI_CHOICE_FLEE: case AI_CHOICE_FLEE:
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, B_ACTION_RUN, 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_RUN, 0);
break; break;
case 6: case 6:
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 15, gBattlerTarget); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 15, gBattlerTarget);
break; break;
default: default:
if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER))
@@ -1586,7 +1586,7 @@ static void OpponentHandleChooseMove(void)
if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) if (gAbsentBattlerFlags & gBitTable[gBattlerTarget])
gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT);
} }
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 10, (chosenMoveId) | (gBattlerTarget << 8)); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, (chosenMoveId) | (gBattlerTarget << 8));
break; break;
} }
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
@@ -1601,11 +1601,11 @@ static void OpponentHandleChooseMove(void)
} while (move == MOVE_NONE); } while (move == MOVE_NONE);
if (gBattleMoves[move].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) if (gBattleMoves[move].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER))
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 10, (chosenMoveId) | (gActiveBattler << 8)); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, (chosenMoveId) | (gActiveBattler << 8));
else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 10, (chosenMoveId) | (GetBattlerAtPosition(Random() & 2) << 8)); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, (chosenMoveId) | (GetBattlerAtPosition(Random() & 2) << 8));
else else
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 10, (chosenMoveId) | (GetBattlerAtPosition(B_POSITION_PLAYER_LEFT) << 8)); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, (chosenMoveId) | (GetBattlerAtPosition(B_POSITION_PLAYER_LEFT) << 8));
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
} }
@@ -1614,7 +1614,7 @@ static void OpponentHandleChooseMove(void)
static void OpponentHandleChooseItem(void) static void OpponentHandleChooseItem(void)
{ {
BtlController_EmitOneReturnValue(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, *(gBattleStruct->chosenItem + (gActiveBattler / 2) * 2)); BtlController_EmitOneReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, *(gBattleStruct->chosenItem + (gActiveBattler / 2) * 2));
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
} }
@@ -1671,7 +1671,7 @@ static void OpponentHandleChoosePokemon(void)
*(gBattleStruct->monToSwitchIntoId + gActiveBattler) = chosenMonId; *(gBattleStruct->monToSwitchIntoId + gActiveBattler) = chosenMonId;
BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, chosenMonId, NULL); BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, chosenMonId, NULL);
OpponentBufferExecCompleted(); OpponentBufferExecCompleted();
} }
+23 -23
View File
@@ -249,16 +249,16 @@ static void HandleInputChooseAction(void)
switch (gActionSelectionCursor[gActiveBattler]) switch (gActionSelectionCursor[gActiveBattler])
{ {
case 0: // Top left case 0: // Top left
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, B_ACTION_USE_MOVE, 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_USE_MOVE, 0);
break; break;
case 1: // Top right case 1: // Top right
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, B_ACTION_USE_ITEM, 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_USE_ITEM, 0);
break; break;
case 2: // Bottom left case 2: // Bottom left
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, B_ACTION_SWITCH, 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SWITCH, 0);
break; break;
case 3: // Bottom right case 3: // Bottom right
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, B_ACTION_RUN, 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_RUN, 0);
break; break;
} }
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
@@ -319,7 +319,7 @@ static void HandleInputChooseAction(void)
return; return;
} }
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, B_ACTION_CANCEL_PARTNER, 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_CANCEL_PARTNER, 0);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
} }
@@ -365,7 +365,7 @@ static void HandleInputChooseTarget(void)
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget; gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8)); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8));
EndBounceEffect(gMultiUsePlayerCursor, BOUNCE_HEALTHBOX); EndBounceEffect(gMultiUsePlayerCursor, BOUNCE_HEALTHBOX);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
@@ -523,7 +523,7 @@ static void HandleInputChooseMove(void)
if (!canSelectTarget) if (!canSelectTarget)
{ {
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8)); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8));
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
else else
@@ -543,7 +543,7 @@ static void HandleInputChooseMove(void)
else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59) else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59)
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 10, 0xFFFF); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, 0xFFFF);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
else if (JOY_NEW(DPAD_LEFT)) else if (JOY_NEW(DPAD_LEFT))
@@ -1174,7 +1174,7 @@ static void Task_GiveExpToMon(u8 taskId)
gainedExp -= nextLvlExp - currExp; gainedExp -= nextLvlExp - currExp;
savedActiveBattler = gActiveBattler; savedActiveBattler = gActiveBattler;
gActiveBattler = battlerId; gActiveBattler = battlerId;
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, RET_VALUE_LEVELED_UP, gainedExp); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, RET_VALUE_LEVELED_UP, gainedExp);
gActiveBattler = savedActiveBattler; gActiveBattler = savedActiveBattler;
if (IsDoubleBattle() == TRUE if (IsDoubleBattle() == TRUE
@@ -1253,7 +1253,7 @@ static void Task_GiveExpWithExpBar(u8 taskId)
gainedExp -= expOnNextLvl - currExp; gainedExp -= expOnNextLvl - currExp;
savedActiveBattler = gActiveBattler; savedActiveBattler = gActiveBattler;
gActiveBattler = battlerId; gActiveBattler = battlerId;
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, RET_VALUE_LEVELED_UP, gainedExp); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, RET_VALUE_LEVELED_UP, gainedExp);
gActiveBattler = savedActiveBattler; gActiveBattler = savedActiveBattler;
gTasks[taskId].func = Task_LaunchLvlUpAnim; gTasks[taskId].func = Task_LaunchLvlUpAnim;
} }
@@ -1361,9 +1361,9 @@ static void WaitForMonSelection(void)
if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active) if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active)
{ {
if (gPartyMenuUseExitCallback == TRUE) if (gPartyMenuUseExitCallback == TRUE)
BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gSelectedMonPartyId, gBattlePartyCurrentOrder); BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, gSelectedMonPartyId, gBattlePartyCurrentOrder);
else else
BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, PARTY_SIZE, NULL); BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, PARTY_SIZE, NULL);
if ((gBattleBufferA[gActiveBattler][1] & 0xF) == 1) if ((gBattleBufferA[gActiveBattler][1] & 0xF) == 1)
PrintLinkStandbyMsg(); PrintLinkStandbyMsg();
@@ -1387,7 +1387,7 @@ static void CompleteWhenChoseItem(void)
{ {
if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active) if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active)
{ {
BtlController_EmitOneReturnValue(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gSpecialVar_ItemId); BtlController_EmitOneReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, gSpecialVar_ItemId);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
} }
@@ -1439,9 +1439,9 @@ static void PlayerHandleYesNoInput(void)
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
if (gMultiUsePlayerCursor != 0) if (gMultiUsePlayerCursor != 0)
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 0xE, 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 0xE, 0);
else else
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 0xD, 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 0xD, 0);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
@@ -1600,7 +1600,7 @@ static void PlayerHandleGetMonData(void)
monToCheck >>= 1; monToCheck >>= 1;
} }
} }
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, size, monData); BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, size, monData);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
@@ -1920,7 +1920,7 @@ void PlayerHandleGetRawMonData(void)
for (i = 0; i < gBattleBufferA[gActiveBattler][2]; i++) for (i = 0; i < gBattleBufferA[gActiveBattler][2]; i++)
dst[i] = src[i]; dst[i] = src[i];
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gBattleBufferA[gActiveBattler][2], dst); BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, gBattleBufferA[gActiveBattler][2], dst);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
@@ -2621,7 +2621,7 @@ static void PlayerChooseMoveInBattlePalace(void)
if (--*(gBattleStruct->arenaMindPoints + gActiveBattler) == 0) if (--*(gBattleStruct->arenaMindPoints + gActiveBattler) == 0)
{ {
gBattlePalaceMoveSelectionRngValue = gRngValue; gBattlePalaceMoveSelectionRngValue = gRngValue;
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 10, ChooseMoveAndTargetInBattlePalace()); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, ChooseMoveAndTargetInBattlePalace());
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
} }
@@ -2671,7 +2671,7 @@ static void PlayerHandleChoosePokemon(void)
if (gBattleTypeFlags & BATTLE_TYPE_ARENA && (gBattleBufferA[gActiveBattler][1] & 0xF) != PARTY_ACTION_CANT_SWITCH) if (gBattleTypeFlags & BATTLE_TYPE_ARENA && (gBattleBufferA[gActiveBattler][1] & 0xF) != PARTY_ACTION_CANT_SWITCH)
{ {
BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gBattlerPartyIndexes[gActiveBattler] + 1, gBattlePartyCurrentOrder); BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, gBattlerPartyIndexes[gActiveBattler] + 1, gBattlePartyCurrentOrder);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
else else
@@ -2828,25 +2828,25 @@ static void PlayerHandleCmd32(void)
static void PlayerHandleTwoReturnValues(void) static void PlayerHandleTwoReturnValues(void)
{ {
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 0, 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 0, 0);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
static void PlayerHandleChosenMonReturnValue(void) static void PlayerHandleChosenMonReturnValue(void)
{ {
BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 0, NULL); BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 0, NULL);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
static void PlayerHandleOneReturnValue(void) static void PlayerHandleOneReturnValue(void)
{ {
BtlController_EmitOneReturnValue(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 0); BtlController_EmitOneReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 0);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
static void PlayerHandleOneReturnValue_Duplicate(void) static void PlayerHandleOneReturnValue_Duplicate(void)
{ {
BtlController_EmitOneReturnValue_Duplicate(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 0); BtlController_EmitOneReturnValue_Duplicate(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 0);
PlayerBufferExecCompleted(); PlayerBufferExecCompleted();
} }
+5 -5
View File
@@ -332,7 +332,7 @@ static void Task_GiveExpToMon(u8 taskId)
gainedExp -= nextLvlExp - currExp; gainedExp -= nextLvlExp - currExp;
savedActiveBank = gActiveBattler; savedActiveBank = gActiveBattler;
gActiveBattler = battlerId; gActiveBattler = battlerId;
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, RET_VALUE_LEVELED_UP, gainedExp); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, RET_VALUE_LEVELED_UP, gainedExp);
gActiveBattler = savedActiveBank; gActiveBattler = savedActiveBank;
if (IsDoubleBattle() == TRUE if (IsDoubleBattle() == TRUE
@@ -411,7 +411,7 @@ static void Task_GiveExpWithExpBar(u8 taskId)
gainedExp -= expOnNextLvl - currExp; gainedExp -= expOnNextLvl - currExp;
savedActiveBank = gActiveBattler; savedActiveBank = gActiveBattler;
gActiveBattler = battlerId; gActiveBattler = battlerId;
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, RET_VALUE_LEVELED_UP, gainedExp); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, RET_VALUE_LEVELED_UP, gainedExp);
gActiveBattler = savedActiveBank; gActiveBattler = savedActiveBank;
gTasks[taskId].func = Task_LaunchLvlUpAnim; gTasks[taskId].func = Task_LaunchLvlUpAnim;
} }
@@ -626,7 +626,7 @@ static void PlayerPartnerHandleGetMonData(void)
monToCheck >>= 1; monToCheck >>= 1;
} }
} }
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, size, monData); BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, size, monData);
PlayerPartnerBufferExecCompleted(); PlayerPartnerBufferExecCompleted();
} }
@@ -1527,7 +1527,7 @@ static void PlayerPartnerHandleChooseMove(void)
gBattlerTarget = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT); gBattlerTarget = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT);
} }
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 10, chosenMoveId | (gBattlerTarget << 8)); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, chosenMoveId | (gBattlerTarget << 8));
PlayerPartnerBufferExecCompleted(); PlayerPartnerBufferExecCompleted();
} }
@@ -1557,7 +1557,7 @@ static void PlayerPartnerHandleChoosePokemon(void)
} }
*(gBattleStruct->monToSwitchIntoId + gActiveBattler) = chosenMonId; *(gBattleStruct->monToSwitchIntoId + gActiveBattler) = chosenMonId;
BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, chosenMonId, NULL); BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, chosenMonId, NULL);
PlayerPartnerBufferExecCompleted(); PlayerPartnerBufferExecCompleted();
} }
+5 -5
View File
@@ -534,7 +534,7 @@ static void RecordedOpponentHandleGetMonData(void)
monToCheck >>= 1; monToCheck >>= 1;
} }
} }
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, size, monData); BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, size, monData);
RecordedOpponentBufferExecCompleted(); RecordedOpponentBufferExecCompleted();
} }
@@ -1402,7 +1402,7 @@ static void RecordedOpponentHandlePrintSelectionString(void)
static void RecordedOpponentHandleChooseAction(void) static void RecordedOpponentHandleChooseAction(void)
{ {
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, RecordedBattle_GetBattlerAction(gActiveBattler), 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, RecordedBattle_GetBattlerAction(gActiveBattler), 0);
RecordedOpponentBufferExecCompleted(); RecordedOpponentBufferExecCompleted();
} }
@@ -1415,13 +1415,13 @@ static void RecordedOpponentHandleChooseMove(void)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_PALACE) if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{ {
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 10, ChooseMoveAndTargetInBattlePalace()); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, ChooseMoveAndTargetInBattlePalace());
} }
else else
{ {
u8 moveId = RecordedBattle_GetBattlerAction(gActiveBattler); u8 moveId = RecordedBattle_GetBattlerAction(gActiveBattler);
u8 target = RecordedBattle_GetBattlerAction(gActiveBattler); u8 target = RecordedBattle_GetBattlerAction(gActiveBattler);
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 10, moveId | (target << 8)); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, moveId | (target << 8));
} }
RecordedOpponentBufferExecCompleted(); RecordedOpponentBufferExecCompleted();
@@ -1435,7 +1435,7 @@ static void RecordedOpponentHandleChooseItem(void)
static void RecordedOpponentHandleChoosePokemon(void) static void RecordedOpponentHandleChoosePokemon(void)
{ {
*(gBattleStruct->monToSwitchIntoId + gActiveBattler) = RecordedBattle_GetBattlerAction(gActiveBattler); *(gBattleStruct->monToSwitchIntoId + gActiveBattler) = RecordedBattle_GetBattlerAction(gActiveBattler);
BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, *(gBattleStruct->monToSwitchIntoId + gActiveBattler), NULL); BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, *(gBattleStruct->monToSwitchIntoId + gActiveBattler), NULL);
RecordedOpponentBufferExecCompleted(); RecordedOpponentBufferExecCompleted();
} }
+6 -6
View File
@@ -517,7 +517,7 @@ static void RecordedPlayerHandleGetMonData(void)
monToCheck >>= 1; monToCheck >>= 1;
} }
} }
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, size, monData); BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, size, monData);
RecordedPlayerBufferExecCompleted(); RecordedPlayerBufferExecCompleted();
} }
@@ -1414,7 +1414,7 @@ static void ChooseActionInBattlePalace(void)
{ {
if (gBattleCommunication[4] >= gBattlersCount / 2) if (gBattleCommunication[4] >= gBattlersCount / 2)
{ {
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, RecordedBattle_GetBattlerAction(gActiveBattler), 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, RecordedBattle_GetBattlerAction(gActiveBattler), 0);
RecordedPlayerBufferExecCompleted(); RecordedPlayerBufferExecCompleted();
} }
} }
@@ -1427,7 +1427,7 @@ static void RecordedPlayerHandleChooseAction(void)
} }
else else
{ {
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, RecordedBattle_GetBattlerAction(gActiveBattler), 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, RecordedBattle_GetBattlerAction(gActiveBattler), 0);
RecordedPlayerBufferExecCompleted(); RecordedPlayerBufferExecCompleted();
} }
} }
@@ -1441,13 +1441,13 @@ static void RecordedPlayerHandleChooseMove(void)
{ {
if (gBattleTypeFlags & BATTLE_TYPE_PALACE) if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
{ {
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 10, ChooseMoveAndTargetInBattlePalace()); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, ChooseMoveAndTargetInBattlePalace());
} }
else else
{ {
u8 moveId = RecordedBattle_GetBattlerAction(gActiveBattler); u8 moveId = RecordedBattle_GetBattlerAction(gActiveBattler);
u8 target = RecordedBattle_GetBattlerAction(gActiveBattler); u8 target = RecordedBattle_GetBattlerAction(gActiveBattler);
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 10, moveId | (target << 8)); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, moveId | (target << 8));
} }
RecordedPlayerBufferExecCompleted(); RecordedPlayerBufferExecCompleted();
@@ -1461,7 +1461,7 @@ static void RecordedPlayerHandleChooseItem(void)
static void RecordedPlayerHandleChoosePokemon(void) static void RecordedPlayerHandleChoosePokemon(void)
{ {
*(gBattleStruct->monToSwitchIntoId + gActiveBattler) = RecordedBattle_GetBattlerAction(gActiveBattler); *(gBattleStruct->monToSwitchIntoId + gActiveBattler) = RecordedBattle_GetBattlerAction(gActiveBattler);
BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, *(gBattleStruct->monToSwitchIntoId + gActiveBattler), NULL); BtlController_EmitChosenMonReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, *(gBattleStruct->monToSwitchIntoId + gActiveBattler), NULL);
RecordedPlayerBufferExecCompleted(); RecordedPlayerBufferExecCompleted();
} }
+5 -5
View File
@@ -176,16 +176,16 @@ static void HandleInputChooseAction(void)
switch (gActionSelectionCursor[gActiveBattler]) switch (gActionSelectionCursor[gActiveBattler])
{ {
case 0: case 0:
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, B_ACTION_SAFARI_BALL, 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SAFARI_BALL, 0);
break; break;
case 1: case 1:
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, B_ACTION_SAFARI_POKEBLOCK, 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SAFARI_POKEBLOCK, 0);
break; break;
case 2: case 2:
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, B_ACTION_SAFARI_GO_NEAR, 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SAFARI_GO_NEAR, 0);
break; break;
case 3: case 3:
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, B_ACTION_SAFARI_RUN, 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_SAFARI_RUN, 0);
break; break;
} }
SafariBufferExecCompleted(); SafariBufferExecCompleted();
@@ -280,7 +280,7 @@ static void CompleteWhenChosePokeblock(void)
{ {
if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active) if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active)
{ {
BtlController_EmitOneReturnValue(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gSpecialVar_ItemId); BtlController_EmitOneReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, gSpecialVar_ItemId);
SafariBufferExecCompleted(); SafariBufferExecCompleted();
} }
} }
+7 -7
View File
@@ -196,7 +196,7 @@ static void WallyHandleActions(void)
if (--gBattleStruct->wallyWaitFrames == 0) if (--gBattleStruct->wallyWaitFrames == 0)
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, B_ACTION_USE_MOVE, 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_USE_MOVE, 0);
WallyBufferExecCompleted(); WallyBufferExecCompleted();
gBattleStruct->wallyBattleState++; gBattleStruct->wallyBattleState++;
gBattleStruct->wallyMovesState = 0; gBattleStruct->wallyMovesState = 0;
@@ -207,7 +207,7 @@ static void WallyHandleActions(void)
if (--gBattleStruct->wallyWaitFrames == 0) if (--gBattleStruct->wallyWaitFrames == 0)
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, B_ACTION_USE_MOVE, 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_USE_MOVE, 0);
WallyBufferExecCompleted(); WallyBufferExecCompleted();
gBattleStruct->wallyBattleState++; gBattleStruct->wallyBattleState++;
gBattleStruct->wallyMovesState = 0; gBattleStruct->wallyMovesState = 0;
@@ -217,7 +217,7 @@ static void WallyHandleActions(void)
case 3: case 3:
if (--gBattleStruct->wallyWaitFrames == 0) if (--gBattleStruct->wallyWaitFrames == 0)
{ {
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, B_ACTION_WALLY_THROW, 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_WALLY_THROW, 0);
WallyBufferExecCompleted(); WallyBufferExecCompleted();
gBattleStruct->wallyBattleState++; gBattleStruct->wallyBattleState++;
gBattleStruct->wallyMovesState = 0; gBattleStruct->wallyMovesState = 0;
@@ -238,7 +238,7 @@ static void WallyHandleActions(void)
if (--gBattleStruct->wallyWaitFrames == 0) if (--gBattleStruct->wallyWaitFrames == 0)
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, B_ACTION_USE_ITEM, 0); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, B_ACTION_USE_ITEM, 0);
WallyBufferExecCompleted(); WallyBufferExecCompleted();
} }
break; break;
@@ -278,7 +278,7 @@ static void CompleteOnChosenItem(void)
{ {
if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active) if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active)
{ {
BtlController_EmitOneReturnValue(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, gSpecialVar_ItemId); BtlController_EmitOneReturnValue(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, gSpecialVar_ItemId);
WallyBufferExecCompleted(); WallyBufferExecCompleted();
} }
} }
@@ -444,7 +444,7 @@ static void WallyHandleGetMonData(void)
monToCheck >>= 1; monToCheck >>= 1;
} }
} }
BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, size, monData); BtlController_EmitDataTransfer(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, size, monData);
WallyBufferExecCompleted(); WallyBufferExecCompleted();
} }
@@ -1241,7 +1241,7 @@ static void WallyHandleChooseMove(void)
if (--gBattleStruct->wallyMoveFrames == 0) if (--gBattleStruct->wallyMoveFrames == 0)
{ {
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_ENGINE_TO_CONTROLLER, 10, 0x100); BtlController_EmitTwoReturnValues(BATTLELINKMSGTYPE_CONTROLLER_TO_ENGINE, 10, 0x100);
WallyBufferExecCompleted(); WallyBufferExecCompleted();
} }
break; break;