Reverted ++ operators not related to battle_util.c, battle_util2.c, or battle_main.c

This commit is contained in:
Eduardo Quezada
2022-08-08 16:05:16 -04:00
parent ac973aa38d
commit 2cda0b61ce
43 changed files with 341 additions and 341 deletions
+16 -16
View File
@@ -41,7 +41,7 @@ static bool8 ShouldSwitchIfWonderGuard(void)
if (gBattleMons[GetBattlerAtPosition(B_POSITION_PLAYER_LEFT)].ability == ABILITY_WONDER_GUARD)
{
// Check if Pokemon has a super effective move.
for (opposingBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT), i = 0; i < MAX_MON_MOVES; i++)
for (opposingBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT), i = 0; i < MAX_MON_MOVES; ++i)
{
move = gBattleMons[gActiveBattler].moves[i];
if (move == MOVE_NONE)
@@ -51,7 +51,7 @@ static bool8 ShouldSwitchIfWonderGuard(void)
return FALSE;
}
// Find a Pokemon in the party that has a super effective move.
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (GetMonData(&gEnemyParty[i], MON_DATA_HP) == 0
|| GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_NONE
@@ -60,7 +60,7 @@ static bool8 ShouldSwitchIfWonderGuard(void)
continue;
GetMonData(&gEnemyParty[i], MON_DATA_SPECIES); // Unused return value.
GetMonData(&gEnemyParty[i], MON_DATA_ABILITY_NUM); // Unused return value.
for (opposingBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT), j = 0; j < MAX_MON_MOVES; j++)
for (opposingBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT), j = 0; j < MAX_MON_MOVES; ++j)
{
move = GetMonData(&gEnemyParty[i], MON_DATA_MOVE1 + j);
if (move == MOVE_NONE)
@@ -114,7 +114,7 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void)
return FALSE;
if (gBattleMons[gActiveBattler].ability == absorbingTypeAbility)
return FALSE;
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
u16 species;
u8 monAbility;
@@ -183,7 +183,7 @@ static bool8 HasSuperEffectiveMoveAgainstOpponents(bool8 noRng)
opposingBattler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
if (!(gAbsentBattlerFlags & gBitTable[opposingBattler]))
{
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
move = gBattleMons[gActiveBattler].moves[i];
if (move == MOVE_NONE)
@@ -202,7 +202,7 @@ static bool8 HasSuperEffectiveMoveAgainstOpponents(bool8 noRng)
opposingBattler = GetBattlerAtPosition(BATTLE_PARTNER(B_POSITION_PLAYER_LEFT));
if (!(gAbsentBattlerFlags & gBitTable[opposingBattler]))
{
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
move = gBattleMons[gActiveBattler].moves[i];
if (move == MOVE_NONE)
@@ -225,7 +225,7 @@ static bool8 AreStatsRaised(void)
u8 buffedStatsValue = 0;
s32 i;
for (i = 0; i < NUM_BATTLE_STATS; i++)
for (i = 0; i < NUM_BATTLE_STATS; ++i)
{
if (gBattleMons[gActiveBattler].statStages[i] > 6)
buffedStatsValue += gBattleMons[gActiveBattler].statStages[i] - 6;
@@ -259,7 +259,7 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent)
battlerIn1 = gActiveBattler;
battlerIn2 = gActiveBattler;
}
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
u16 species;
u8 monAbility;
@@ -281,7 +281,7 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent)
if (moveFlags & flags)
{
battlerIn1 = gLastHitBy[gActiveBattler];
for (j = 0; j < MAX_MON_MOVES; j++)
for (j = 0; j < MAX_MON_MOVES; ++j)
{
move = GetMonData(&gEnemyParty[i], MON_DATA_MOVE1 + j);
if (move == MOVE_NONE)
@@ -327,7 +327,7 @@ static bool8 ShouldSwitch(void)
battlerIn2 = gActiveBattler;
battlerIn1 = gActiveBattler;
}
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if ((GetMonData(&gEnemyParty[i], MON_DATA_HP) == 0)
|| (GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) == SPECIES_NONE)
@@ -461,7 +461,7 @@ u8 GetMostSuitableMonToSwitchInto(void)
bestDmg = 0;
bestMonId = 6;
// Find the mon whose type is the most suitable offensively.
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
u16 species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES);
if (species != SPECIES_NONE
@@ -491,7 +491,7 @@ u8 GetMostSuitableMonToSwitchInto(void)
// Ok, we know the mon has the right typing but does it have at least one super effective move?
if (bestMonId != PARTY_SIZE)
{
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
move = GetMonData(&gEnemyParty[bestMonId], MON_DATA_MOVE1 + i);
if (move != MOVE_NONE && TypeCalc(move, gActiveBattler, opposingBattler) & MOVE_RESULT_SUPER_EFFECTIVE)
@@ -515,7 +515,7 @@ u8 GetMostSuitableMonToSwitchInto(void)
bestDmg = 0;
bestMonId = 6;
// If we couldn't find the best mon in terms of typing, find the one that deals most damage.
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (((u16)(GetMonData(&gEnemyParty[i], MON_DATA_SPECIES)) == SPECIES_NONE)
|| (GetMonData(&gEnemyParty[i], MON_DATA_HP) == 0)
@@ -524,7 +524,7 @@ u8 GetMostSuitableMonToSwitchInto(void)
|| (i == *(gBattleStruct->monToSwitchIntoId + battlerIn1))
|| (i == *(gBattleStruct->monToSwitchIntoId + battlerIn2)))
continue;
for (j = 0; j < MAX_MON_MOVES; j++)
for (j = 0; j < MAX_MON_MOVES; ++j)
{
move = GetMonData(&gEnemyParty[i], MON_DATA_MOVE1 + j);
gBattleMoveDamage = 0;
@@ -565,12 +565,12 @@ static bool8 ShouldUseItem(void)
u8 validMons = 0;
bool8 shouldUse = FALSE;
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
if (GetMonData(&gEnemyParty[i], MON_DATA_HP) != 0
&& GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) != SPECIES_NONE
&& GetMonData(&gEnemyParty[i], MON_DATA_SPECIES2) != SPECIES_EGG)
++validMons;
for (i = 0; i < MAX_TRAINER_ITEMS; i++)
for (i = 0; i < MAX_TRAINER_ITEMS; ++i)
{
u16 item;
const u8 *itemEffects;
+5 -5
View File
@@ -772,7 +772,7 @@ u8 GetBattlerAtPosition(u8 position)
{
u8 i;
for (i = 0; i < gBattlersCount; i++)
for (i = 0; i < gBattlersCount; ++i)
if (gBattlerPositions[i] == position)
break;
return i;
@@ -1218,7 +1218,7 @@ void SetGreyscaleOrOriginalPalette(u16 paletteNum, bool8 restoreOriginalColor)
if (!restoreOriginalColor)
{
for (i = 0; i < 16; i++)
for (i = 0; i < 16; ++i)
{
originalColor = (struct PlttData *)&gPlttBufferUnfaded[paletteNum + i];
average = originalColor->r + originalColor->g + originalColor->b;
@@ -1446,7 +1446,7 @@ s16 CloneBattlerSpriteWithBlend(u8 animBattler)
if (spriteId != 0xFF)
{
for (i = 0; i < MAX_SPRITES; i++)
for (i = 0; i < MAX_SPRITES; ++i)
{
if (!gSprites[i].inUse)
{
@@ -1713,7 +1713,7 @@ static u16 GetBattlerYDeltaFromSpriteId(u8 spriteId)
u16 species;
u16 i;
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
for (i = 0; i < MAX_BATTLERS_COUNT; ++i)
{
if (gBattlerSpriteIds[i] == spriteId)
{
@@ -1818,7 +1818,7 @@ void ResetSpritePriorityOfAllVisibleBattlers(void)
{
s32 i;
for (i = 0; i < gBattlersCount; i++)
for (i = 0; i < gBattlersCount; ++i)
{
if (IsBattlerSpriteVisible(i))
{
+5 -5
View File
@@ -110,7 +110,7 @@ void AnimTask_BlendExcept(u8 taskId)
animBattlers[0] = BATTLE_PARTNER(gBattleAnimTarget);
break;
}
for (battler = 0; battler < MAX_BATTLERS_COUNT; battler++)
for (battler = 0; battler < MAX_BATTLERS_COUNT; ++battler)
{
if (battler != animBattlers[0]
&& battler != animBattlers[1]
@@ -392,7 +392,7 @@ void InitStatsChangeAnimation(u8 taskId)
u8 i;
sAnimStatsChangeData = AllocZeroed(sizeof(struct AnimStatsChangeData));
for (i = 0; i < 8; i++)
for (i = 0; i < 8; ++i)
sAnimStatsChangeData->data[i] = gBattleAnimArgs[i];
gTasks[taskId].func = StatsChangeAnimation_Step1;
}
@@ -612,7 +612,7 @@ static void sub_80BB6CC(u8 taskId)
{
task->data[1] = 0;
--task->data[2];
for (i = 0; i < 16; i++)
for (i = 0; i < 16; ++i)
{
if ((task->data[15] >> i) & 1)
{
@@ -652,7 +652,7 @@ void AnimTask_BlendNonAttackerPalettes(u8 taskId)
s32 j;
u32 battler, selectedPalettes = 0;
for (battler = 0; battler < MAX_BATTLERS_COUNT; battler++)
for (battler = 0; battler < MAX_BATTLERS_COUNT; ++battler)
if (gBattleAnimAttacker != battler)
selectedPalettes |= 1 << (battler + 16);
for (j = 5; j != 0; --j)
@@ -717,7 +717,7 @@ void AnimTask_SetAllNonAttackersInvisiblity(u8 taskId)
{
u16 battler;
for (battler = 0; battler < MAX_BATTLERS_COUNT; battler++)
for (battler = 0; battler < MAX_BATTLERS_COUNT; ++battler)
if (battler != gBattleAnimAttacker && IsBattlerSpriteVisible(battler))
gSprites[gBattlerSpriteIds[battler]].invisible = gBattleAnimArgs[0];
DestroyAnimVisualTask(taskId);
+5 -5
View File
@@ -446,7 +446,7 @@ static void LinkOpponentHandleGetMonData(void)
else
{
monToCheck = gBattleBufferA[gActiveBattler][2];
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (monToCheck & 1)
size += CopyLinkOpponentMonData(i, monData + size);
@@ -779,7 +779,7 @@ static void LinkOpponentHandleSetMonData(void)
else
{
monToCheck = gBattleBufferA[gActiveBattler][2];
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (monToCheck & 1)
SetLinkOpponentMonData(i);
@@ -803,7 +803,7 @@ static void SetLinkOpponentMonData(u8 monId)
SetMonData(&gEnemyParty[monId], MON_DATA_SPECIES, &battlePokemon->species);
SetMonData(&gEnemyParty[monId], MON_DATA_HELD_ITEM, &battlePokemon->item);
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
SetMonData(&gEnemyParty[monId], MON_DATA_MOVE1 + i, &battlePokemon->moves[i]);
SetMonData(&gEnemyParty[monId], MON_DATA_PP1 + i, &battlePokemon->pp[i]);
@@ -842,7 +842,7 @@ static void SetLinkOpponentMonData(u8 monId)
SetMonData(&gEnemyParty[monId], MON_DATA_HELD_ITEM, &gBattleBufferA[gActiveBattler][3]);
break;
case REQUEST_MOVES_PP_BATTLE:
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
SetMonData(&gEnemyParty[monId], MON_DATA_MOVE1 + i, &moveData->moves[i]);
SetMonData(&gEnemyParty[monId], MON_DATA_PP1 + i, &moveData->pp[i]);
@@ -1010,7 +1010,7 @@ static void LinkOpponentHandleSetRawMonData(void)
u8 *dst = (u8 *)&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]] + gBattleBufferA[gActiveBattler][1];
u8 i;
for (i = 0; i < gBattleBufferA[gActiveBattler][2]; i++)
for (i = 0; i < gBattleBufferA[gActiveBattler][2]; ++i)
dst[i] = gBattleBufferA[gActiveBattler][3 + i];
LinkOpponentBufferExecCompleted();
}
+5 -5
View File
@@ -401,7 +401,7 @@ static void LinkPartnerHandleGetMonData(void)
else
{
monToCheck = gBattleBufferA[gActiveBattler][2];
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (monToCheck & 1)
size += CopyLinkPartnerMonData(i, monData + size);
@@ -734,7 +734,7 @@ static void LinkPartnerHandleSetMonData(void)
else
{
monToCheck = gBattleBufferA[gActiveBattler][2];
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (monToCheck & 1)
SetLinkPartnerMonData(i);
@@ -758,7 +758,7 @@ static void SetLinkPartnerMonData(u8 monId)
SetMonData(&gPlayerParty[monId], MON_DATA_SPECIES, &battlePokemon->species);
SetMonData(&gPlayerParty[monId], MON_DATA_HELD_ITEM, &battlePokemon->item);
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
SetMonData(&gPlayerParty[monId], MON_DATA_MOVE1 + i, &battlePokemon->moves[i]);
SetMonData(&gPlayerParty[monId], MON_DATA_PP1 + i, &battlePokemon->pp[i]);
@@ -797,7 +797,7 @@ static void SetLinkPartnerMonData(u8 monId)
SetMonData(&gPlayerParty[monId], MON_DATA_HELD_ITEM, &gBattleBufferA[gActiveBattler][3]);
break;
case REQUEST_MOVES_PP_BATTLE:
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
SetMonData(&gPlayerParty[monId], MON_DATA_MOVE1 + i, &moveData->moves[i]);
SetMonData(&gPlayerParty[monId], MON_DATA_PP1 + i, &moveData->pp[i]);
@@ -966,7 +966,7 @@ static void LinkPartnerHandleSetRawMonData(void)
u8 *dst = (u8 *)&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]] + gBattleBufferA[gActiveBattler][1];
u8 i;
for (i = 0; i < gBattleBufferA[gActiveBattler][2]; i++)
for (i = 0; i < gBattleBufferA[gActiveBattler][2]; ++i)
dst[i] = gBattleBufferA[gActiveBattler][3 + i];
LinkPartnerBufferExecCompleted();
}
+7 -7
View File
@@ -980,7 +980,7 @@ static void OakOldManHandleGetMonData(void)
else
{
monToCheck = gBattleBufferA[gActiveBattler][2];
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (monToCheck & 1)
size += CopyOakOldManMonData(i, monData + size);
@@ -1313,7 +1313,7 @@ static void OakOldManHandleSetMonData(void)
else
{
monToCheck = gBattleBufferA[gActiveBattler][2];
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (monToCheck & 1)
SetOakOldManMonData(i);
@@ -1337,7 +1337,7 @@ static void SetOakOldManMonData(u8 monId)
SetMonData(&gPlayerParty[monId], MON_DATA_SPECIES, &battlePokemon->species);
SetMonData(&gPlayerParty[monId], MON_DATA_HELD_ITEM, &battlePokemon->item);
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
SetMonData(&gPlayerParty[monId], MON_DATA_MOVE1 + i, &battlePokemon->moves[i]);
SetMonData(&gPlayerParty[monId], MON_DATA_PP1 + i, &battlePokemon->pp[i]);
@@ -1376,7 +1376,7 @@ static void SetOakOldManMonData(u8 monId)
SetMonData(&gPlayerParty[monId], MON_DATA_HELD_ITEM, &gBattleBufferA[gActiveBattler][3]);
break;
case REQUEST_MOVES_PP_BATTLE:
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
SetMonData(&gPlayerParty[monId], MON_DATA_MOVE1 + i, &moveData->moves[i]);
SetMonData(&gPlayerParty[monId], MON_DATA_PP1 + i, &moveData->pp[i]);
@@ -1817,7 +1817,7 @@ static void OakOldManHandleChooseAction(void)
gBattlerControllerFuncs[gActiveBattler] = HandleChooseActionAfterDma3;
BattlePutTextOnWindow(gText_EmptyString3, B_WIN_MSG);
BattlePutTextOnWindow(gText_BattleMenu, B_WIN_ACTION_MENU);
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
ActionSelectionDestroyCursorAt((u8)i);
ActionSelectionCreateCursorAt(gActionSelectionCursor[gActiveBattler], 0);
if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE)
@@ -1877,7 +1877,7 @@ static void OakOldManHandleChooseItem(void)
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gBattlerControllerFuncs[gActiveBattler] = OpenBagAndChooseItem;
gBattlerInMenuId = gActiveBattler;
for (i = 0; i < 3; i++)
for (i = 0; i < 3; ++i)
gBattlePartyCurrentOrder[i] = gBattleBufferA[gActiveBattler][i + 1];
}
@@ -1890,7 +1890,7 @@ static void OakOldManHandleChoosePokemon(void)
*(&gBattleStruct->battlerPreventingSwitchout) = gBattleBufferA[gActiveBattler][1] >> 4;
*(&gBattleStruct->playerPartyIdx) = gBattleBufferA[gActiveBattler][2];
*(&gBattleStruct->abilityPreventingSwitchout) = gBattleBufferA[gActiveBattler][3];
for (i = 0; i < 3; i++)
for (i = 0; i < 3; ++i)
gBattlePartyCurrentOrder[i] = gBattleBufferA[gActiveBattler][4 + i];
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gBattlerControllerFuncs[gActiveBattler] = OpenPartyMenuToChooseMon;
+6 -6
View File
@@ -440,7 +440,7 @@ static void OpponentHandleGetMonData(void)
else
{
monToCheck = gBattleBufferA[gActiveBattler][2];
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (monToCheck & 1)
size += GetOpponentMonData(i, monData + size);
@@ -763,7 +763,7 @@ static void OpponentHandleGetRawMonData(void)
u8 *dst = (u8 *)&battleMon + gBattleBufferA[gActiveBattler][1];
u8 i;
for (i = 0; i < gBattleBufferA[gActiveBattler][2]; i++)
for (i = 0; i < gBattleBufferA[gActiveBattler][2]; ++i)
dst[i] = src[i];
BtlController_EmitDataTransfer(1, gBattleBufferA[gActiveBattler][2], dst);
OpponentBufferExecCompleted();
@@ -781,7 +781,7 @@ static void OpponentHandleSetMonData(void)
else
{
monToCheck = gBattleBufferA[gActiveBattler][2];
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (monToCheck & 1)
SetOpponentMonData(i);
@@ -805,7 +805,7 @@ static void SetOpponentMonData(u8 monId)
SetMonData(&gEnemyParty[monId], MON_DATA_SPECIES, &battlePokemon->species);
SetMonData(&gEnemyParty[monId], MON_DATA_HELD_ITEM, &battlePokemon->item);
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
SetMonData(&gEnemyParty[monId], MON_DATA_MOVE1 + i, &battlePokemon->moves[i]);
SetMonData(&gEnemyParty[monId], MON_DATA_PP1 + i, &battlePokemon->pp[i]);
@@ -844,7 +844,7 @@ static void SetOpponentMonData(u8 monId)
SetMonData(&gEnemyParty[monId], MON_DATA_HELD_ITEM, &gBattleBufferA[gActiveBattler][3]);
break;
case REQUEST_MOVES_PP_BATTLE:
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
SetMonData(&gEnemyParty[monId], MON_DATA_MOVE1 + i, &moveData->moves[i]);
SetMonData(&gEnemyParty[monId], MON_DATA_PP1 + i, &moveData->pp[i]);
@@ -1012,7 +1012,7 @@ static void OpponentHandleSetRawMonData(void)
u8 *dst = (u8 *)&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]] + gBattleBufferA[gActiveBattler][1];
u8 i;
for (i = 0; i < gBattleBufferA[gActiveBattler][2]; i++)
for (i = 0; i < gBattleBufferA[gActiveBattler][2]; ++i)
dst[i] = gBattleBufferA[gActiveBattler][3 + i];
OpponentBufferExecCompleted();
}
+19 -19
View File
@@ -360,7 +360,7 @@ static void HandleInputChooseTarget(void)
{
u8 currSelIdentity = GetBattlerPosition(gMultiUsePlayerCursor);
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
for (i = 0; i < MAX_BATTLERS_COUNT; ++i)
if (currSelIdentity == identities[i])
break;
do
@@ -400,7 +400,7 @@ static void HandleInputChooseTarget(void)
{
u8 currSelIdentity = GetBattlerPosition(gMultiUsePlayerCursor);
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
for (i = 0; i < MAX_BATTLERS_COUNT; ++i)
if (currSelIdentity == identities[i])
break;
do
@@ -658,31 +658,31 @@ static void HandleMoveSwitching(void)
gDisableStructs[gActiveBattler].mimickedMoves |= gBitTable[gMultiUsePlayerCursor];
}
MoveSelectionDisplayMoveNames();
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
perMovePPBonuses[i] = (gBattleMons[gActiveBattler].ppBonuses & (3 << (i * 2))) >> (i * 2);
totalPPBonuses = perMovePPBonuses[gMoveSelectionCursor[gActiveBattler]];
perMovePPBonuses[gMoveSelectionCursor[gActiveBattler]] = perMovePPBonuses[gMultiUsePlayerCursor];
perMovePPBonuses[gMultiUsePlayerCursor] = totalPPBonuses;
totalPPBonuses = 0;
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
totalPPBonuses |= perMovePPBonuses[i] << (i * 2);
gBattleMons[gActiveBattler].ppBonuses = totalPPBonuses;
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
gBattleMons[gActiveBattler].moves[i] = moveInfo->moves[i];
gBattleMons[gActiveBattler].pp[i] = moveInfo->currentPp[i];
}
if (!(gBattleMons[gActiveBattler].status2 & STATUS2_TRANSFORMED))
{
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
moveStruct.moves[i] = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MOVE1 + i);
moveStruct.currentPp[i] = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_PP1 + i);
}
totalPPBonuses = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_PP_BONUSES);
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
perMovePPBonuses[i] = (totalPPBonuses & (3 << (i * 2))) >> (i * 2);
i = moveStruct.moves[gMoveSelectionCursor[gActiveBattler]];
moveStruct.moves[gMoveSelectionCursor[gActiveBattler]] = moveStruct.moves[gMultiUsePlayerCursor];
@@ -694,9 +694,9 @@ static void HandleMoveSwitching(void)
perMovePPBonuses[gMoveSelectionCursor[gActiveBattler]] = perMovePPBonuses[gMultiUsePlayerCursor];
perMovePPBonuses[gMultiUsePlayerCursor] = totalPPBonuses;
totalPPBonuses = 0;
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
totalPPBonuses |= perMovePPBonuses[i] << (i * 2);
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
SetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MOVE1 + i, &moveStruct.moves[i]);
SetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_PP1 + i, &moveStruct.currentPp[i]);
@@ -1366,7 +1366,7 @@ static void MoveSelectionDisplayMoveNames(void)
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleBufferA[gActiveBattler][4]);
gNumberOfMovesToChoose = 0;
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
MoveSelectionDestroyCursorAt(i);
StringCopy(gDisplayedStringBattle, gUnknown_83FE770);
@@ -1498,7 +1498,7 @@ static void PlayerHandleGetMonData(void)
else
{
monToCheck = gBattleBufferA[gActiveBattler][2];
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (monToCheck & 1)
size += CopyPlayerMonData(i, monData + size);
@@ -1821,7 +1821,7 @@ void PlayerHandleGetRawMonData(void)
u8 *dst = (u8 *)&battleMon + gBattleBufferA[gActiveBattler][1];
u8 i;
for (i = 0; i < gBattleBufferA[gActiveBattler][2]; i++)
for (i = 0; i < gBattleBufferA[gActiveBattler][2]; ++i)
dst[i] = src[i];
BtlController_EmitDataTransfer(1, gBattleBufferA[gActiveBattler][2], dst);
@@ -1840,7 +1840,7 @@ static void PlayerHandleSetMonData(void)
else
{
monToCheck = gBattleBufferA[gActiveBattler][2];
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (monToCheck & 1)
SetPlayerMonData(i);
@@ -1864,7 +1864,7 @@ static void SetPlayerMonData(u8 monId)
SetMonData(&gPlayerParty[monId], MON_DATA_SPECIES, &battlePokemon->species);
SetMonData(&gPlayerParty[monId], MON_DATA_HELD_ITEM, &battlePokemon->item);
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
SetMonData(&gPlayerParty[monId], MON_DATA_MOVE1 + i, &battlePokemon->moves[i]);
SetMonData(&gPlayerParty[monId], MON_DATA_PP1 + i, &battlePokemon->pp[i]);
@@ -1903,7 +1903,7 @@ static void SetPlayerMonData(u8 monId)
SetMonData(&gPlayerParty[monId], MON_DATA_HELD_ITEM, &gBattleBufferA[gActiveBattler][3]);
break;
case REQUEST_MOVES_PP_BATTLE:
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
SetMonData(&gPlayerParty[monId], MON_DATA_MOVE1 + i, &moveData->moves[i]);
SetMonData(&gPlayerParty[monId], MON_DATA_PP1 + i, &moveData->pp[i]);
@@ -2072,7 +2072,7 @@ static void PlayerHandleSetRawMonData(void)
u8 *dst = (u8 *)&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]] + gBattleBufferA[gActiveBattler][1];
u8 i;
for (i = 0; i < gBattleBufferA[gActiveBattler][2]; i++)
for (i = 0; i < gBattleBufferA[gActiveBattler][2]; ++i)
dst[i] = gBattleBufferA[gActiveBattler][3 + i];
PlayerBufferExecCompleted();
}
@@ -2409,7 +2409,7 @@ static void PlayerHandleChooseAction(void)
gBattlerControllerFuncs[gActiveBattler] = HandleChooseActionAfterDma3;
BattlePutTextOnWindow(gText_EmptyString3, B_WIN_MSG);
BattlePutTextOnWindow(gText_BattleMenu, B_WIN_ACTION_MENU);
for (i = 0; i < 4; i++)
for (i = 0; i < 4; ++i)
ActionSelectionDestroyCursorAt(i);
ActionSelectionCreateCursorAt(gActionSelectionCursor[gActiveBattler], 0);
BattleStringExpandPlaceholdersToDisplayedString(gText_WhatWillPkmnDo);
@@ -2453,7 +2453,7 @@ static void PlayerHandleChooseItem(void)
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gBattlerControllerFuncs[gActiveBattler] = OpenBagAndChooseItem;
gBattlerInMenuId = gActiveBattler;
for (i = 0; i < 3; i++)
for (i = 0; i < 3; ++i)
gBattlePartyCurrentOrder[i] = gBattleBufferA[gActiveBattler][1 + i];
}
@@ -2466,7 +2466,7 @@ static void PlayerHandleChoosePokemon(void)
*(&gBattleStruct->battlerPreventingSwitchout) = gBattleBufferA[gActiveBattler][1] >> 4;
*(&gBattleStruct->playerPartyIdx) = gBattleBufferA[gActiveBattler][2];
*(&gBattleStruct->abilityPreventingSwitchout) = gBattleBufferA[gActiveBattler][3];
for (i = 0; i < 3; i++)
for (i = 0; i < 3; ++i)
gBattlePartyCurrentOrder[i] = gBattleBufferA[gActiveBattler][4 + i];
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gBattlerControllerFuncs[gActiveBattler] = OpenPartyMenuToChooseMon;
+8 -8
View File
@@ -723,7 +723,7 @@ static void PokedudeHandleGetMonData(void)
else
{
monToCheck = gBattleBufferA[gActiveBattler][2];
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (monToCheck & 1)
size += CopyPokedudeMonData(i, monData + size);
@@ -1061,7 +1061,7 @@ static void PokedudeHandleSetMonData(void)
else
{
monToCheck = gBattleBufferA[gActiveBattler][2];
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (monToCheck & 1)
SetPokedudeMonData(i);
@@ -1090,7 +1090,7 @@ static void SetPokedudeMonData(u8 monId)
SetMonData(mon, MON_DATA_SPECIES, &battlePokemon->species);
SetMonData(mon, MON_DATA_HELD_ITEM, &battlePokemon->item);
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
SetMonData(mon, MON_DATA_MOVE1 + i, &battlePokemon->moves[i]);
SetMonData(mon, MON_DATA_PP1 + i, &battlePokemon->pp[i]);
@@ -1129,7 +1129,7 @@ static void SetPokedudeMonData(u8 monId)
SetMonData(mon, MON_DATA_HELD_ITEM, &gBattleBufferA[gActiveBattler][3]);
break;
case REQUEST_MOVES_PP_BATTLE:
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
SetMonData(mon, MON_DATA_MOVE1 + i, &moveData->moves[i]);
SetMonData(mon, MON_DATA_PP1 + i, &moveData->pp[i]);
@@ -1566,7 +1566,7 @@ static void PokedudeHandleChooseAction(void)
gBattlerControllerFuncs[gActiveBattler] = HandleChooseActionAfterDma3;
BattlePutTextOnWindow(gText_EmptyString3, B_WIN_MSG);
BattlePutTextOnWindow(gText_BattleMenu, B_WIN_ACTION_MENU);
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
ActionSelectionDestroyCursorAt((u8)i);
ActionSelectionCreateCursorAt(gActionSelectionCursor[gActiveBattler], 0);
BattleStringExpandPlaceholdersToDisplayedString(gText_WhatWillPkmnDo);
@@ -1613,7 +1613,7 @@ static void PokedudeHandleChooseItem(void)
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gBattlerControllerFuncs[gActiveBattler] = OpenBagAndChooseItem;
gBattlerInMenuId = gActiveBattler;
for (i = 0; i < 3; i++)
for (i = 0; i < 3; ++i)
gBattlePartyCurrentOrder[i] = gBattleBufferA[gActiveBattler][i + 1];
}
@@ -1626,7 +1626,7 @@ static void PokedudeHandleChoosePokemon(void)
*(&gBattleStruct->battlerPreventingSwitchout) = gBattleBufferA[gActiveBattler][1] >> 4;
*(&gBattleStruct->playerPartyIdx) = gBattleBufferA[gActiveBattler][2];
*(&gBattleStruct->abilityPreventingSwitchout) = gBattleBufferA[gActiveBattler][3];
for (i = 0; i < 3; i++)
for (i = 0; i < 3; ++i)
gBattlePartyCurrentOrder[i] = gBattleBufferA[gActiveBattler][4 + i];
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
gBattlerControllerFuncs[gActiveBattler] = OpenPartyMenuToChooseMon;
@@ -2693,7 +2693,7 @@ void InitPokedudePartyAndOpponent(void)
else
mon = &gEnemyParty[opIdx++];
CreateMonWithGenderNatureLetter(mon, data[i].species, data[i].level, 0, data[i].gender, data[i].nature, 0);
for (j = 0; j < 4; j++)
for (j = 0; j < 4; ++j)
SetMonMoveSlot(mon, data[i].moves[j], j);
} while (data[++i].side != 0xFF);
}
+1 -1
View File
@@ -440,7 +440,7 @@ static void SafariHandleChooseAction(void)
gBattlerControllerFuncs[gActiveBattler] = HandleChooseActionAfterDma3;
BattlePutTextOnWindow(gText_EmptyString3, B_WIN_MSG);
BattlePutTextOnWindow(gUnknown_83FE747, B_WIN_ACTION_MENU);
for (i = 0; i < 4; i++)
for (i = 0; i < 4; ++i)
ActionSelectionDestroyCursorAt(i);
ActionSelectionCreateCursorAt(gActionSelectionCursor[gActiveBattler], 0);
BattleStringExpandPlaceholdersToDisplayedString(gText_WhatWillPlayerThrow);
+24 -24
View File
@@ -46,7 +46,7 @@ void SetUpBattleVars(void)
s32 i;
gBattleMainFunc = BattleDummy;
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
for (i = 0; i < MAX_BATTLERS_COUNT; ++i)
{
gBattlerControllerFuncs[i] = PlayerDummy;
gBattlerPositions[i] = 0xFF;
@@ -72,7 +72,7 @@ void InitBtlControllers(void)
InitSinglePlayerBtlControllers();
SetBattlePartyIds();
if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI))
for (i = 0; i < gBattlersCount; i++)
for (i = 0; i < gBattlersCount; ++i)
BufferBattlePartyCurrentOrderBySide(i, 0);
}
@@ -191,7 +191,7 @@ static void InitLinkBtlControllers(void)
multiplayerId = GetMultiplayerId();
if (gBattleTypeFlags & BATTLE_TYPE_IS_MASTER)
gBattleMainFunc = BeginBattleIntro;
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
for (i = 0; i < MAX_BATTLERS_COUNT; ++i)
{
switch (gLinkPlayers[i].id)
{
@@ -269,9 +269,9 @@ static void SetBattlePartyIds(void)
if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI))
{
for (i = 0; i < gBattlersCount; i++)
for (i = 0; i < gBattlersCount; ++i)
{
for (j = 0; j < PARTY_SIZE; j++)
for (j = 0; j < PARTY_SIZE; ++j)
{
if (i < 2)
{
@@ -401,7 +401,7 @@ void PrepareBufferDataTransferLink(u8 bufferId, u16 size, u8 *data)
gLinkBattleSendBuffer[gTasks[sLinkSendTaskId].data[14] + LINK_BUFF_SIZE_HI] = (alignedSize & 0x0000FF00) >> 8;
gLinkBattleSendBuffer[gTasks[sLinkSendTaskId].data[14] + LINK_BUFF_ABSENT_BATTLER_FLAGS] = gAbsentBattlerFlags;
gLinkBattleSendBuffer[gTasks[sLinkSendTaskId].data[14] + LINK_BUFF_EFFECT_BATTLER] = gEffectBattler;
for (i = 0; i < size; i++)
for (i = 0; i < size; ++i)
gLinkBattleSendBuffer[gTasks[sLinkSendTaskId].data[14] + LINK_BUFF_DATA + i] = data[i];
gTasks[sLinkSendTaskId].data[14] = gTasks[sLinkSendTaskId].data[14] + alignedSize + LINK_BUFF_DATA;
}
@@ -490,7 +490,7 @@ void TryReceiveLinkBattleData(void)
if (gReceivedRemoteLinkPlayers && (gBattleTypeFlags & BATTLE_TYPE_LINK_IN_BATTLE) && (gLinkPlayers[0].linkType == 0x2211))
{
LinkRfu_DestroyIdleTask();
for (i = 0; i < GetLinkPlayerCount(); i++)
for (i = 0; i < GetLinkPlayerCount(); ++i)
{
if (GetBlockReceivedStatus() & gBitTable[i])
{
@@ -507,7 +507,7 @@ void TryReceiveLinkBattleData(void)
}
dest = &gLinkBattleRecvBuffer[gTasks[sLinkReceiveTaskId].data[14]];
src = recvBuffer;
for (j = 0; j < r6 + 8; j++)
for (j = 0; j < r6 + 8; ++j)
dest[j] = src[j];
gTasks[sLinkReceiveTaskId].data[14] = gTasks[sLinkReceiveTaskId].data[14] + r6 + 8;
}
@@ -585,7 +585,7 @@ void BtlController_EmitSetMonData(u8 bufferId, u8 requestId, u8 monToCheck, u8 b
sBattleBuffersTransferData[0] = CONTROLLER_SETMONDATA;
sBattleBuffersTransferData[1] = requestId;
sBattleBuffersTransferData[2] = monToCheck;
for (i = 0; i < bytes; i++)
for (i = 0; i < bytes; ++i)
sBattleBuffersTransferData[3 + i] = *(u8 *)(data++);
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 3 + bytes);
}
@@ -598,7 +598,7 @@ static void BtlController_EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, voi
sBattleBuffersTransferData[0] = CONTROLLER_SETRAWMONDATA;
sBattleBuffersTransferData[1] = monId;
sBattleBuffersTransferData[2] = bytes;
for (i = 0; i < bytes; i++)
for (i = 0; i < bytes; ++i)
sBattleBuffersTransferData[3 + i] = *(u8 *)(data++);
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, bytes + 3);
}
@@ -698,7 +698,7 @@ static void BtlController_EmitPause(u8 bufferId, u8 toWait, void *data)
sBattleBuffersTransferData[0] = CONTROLLER_PAUSE;
sBattleBuffersTransferData[1] = toWait;
for (i = 0; i < toWait * 3; i++)
for (i = 0; i < toWait * 3; ++i)
sBattleBuffersTransferData[2 + i] = *(u8 *)(data++);
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, toWait * 3 + 2);
}
@@ -752,9 +752,9 @@ void BtlController_EmitPrintString(u8 bufferId, u16 stringID)
stringInfo->hpScale = gBattleStruct->hpScale;
stringInfo->itemEffectBattler = gPotentialItemEffectBattler;
stringInfo->moveType = gBattleMoves[gCurrentMove].type;
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
for (i = 0; i < MAX_BATTLERS_COUNT; ++i)
stringInfo->abilities[i] = gBattleMons[i].ability;
for (i = 0; i < TEXT_BUFF_ARRAY_COUNT; i++)
for (i = 0; i < TEXT_BUFF_ARRAY_COUNT; ++i)
{
stringInfo->textBuffs[0][i] = gBattleTextBuff1[i];
stringInfo->textBuffs[1][i] = gBattleTextBuff2[i];
@@ -779,9 +779,9 @@ void BtlController_EmitPrintSelectionString(u8 bufferId, u16 stringID)
stringInfo->lastAbility = gLastUsedAbility;
stringInfo->scrActive = gBattleScripting.battler;
stringInfo->bakScriptPartyIdx = gBattleStruct->scriptPartyIdx;
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
for (i = 0; i < MAX_BATTLERS_COUNT; ++i)
stringInfo->abilities[i] = gBattleMons[i].ability;
for (i = 0; i < TEXT_BUFF_ARRAY_COUNT; i++)
for (i = 0; i < TEXT_BUFF_ARRAY_COUNT; ++i)
{
stringInfo->textBuffs[0][i] = gBattleTextBuff1[i];
stringInfo->textBuffs[1][i] = gBattleTextBuff2[i];
@@ -815,7 +815,7 @@ void BtlController_EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpN
sBattleBuffersTransferData[1] = isDoubleBattle;
sBattleBuffersTransferData[2] = NoPpNumber;
sBattleBuffersTransferData[3] = 0;
for (i = 0; i < sizeof(*movePpData); i++)
for (i = 0; i < sizeof(*movePpData); ++i)
sBattleBuffersTransferData[4 + i] = *((u8 *)(movePpData) + i);
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, sizeof(*movePpData) + 4);
}
@@ -825,7 +825,7 @@ void BtlController_EmitChooseItem(u8 bufferId, u8 *arg1)
s32 i;
sBattleBuffersTransferData[0] = CONTROLLER_OPENBAG;
for (i = 0; i < 3; i++)
for (i = 0; i < 3; ++i)
sBattleBuffersTransferData[1 + i] = arg1[i];
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
}
@@ -838,7 +838,7 @@ void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 arg2, u8 ability
sBattleBuffersTransferData[1] = caseId;
sBattleBuffersTransferData[2] = arg2;
sBattleBuffersTransferData[3] = abilityId;
for (i = 0; i < 3; i++)
for (i = 0; i < 3; ++i)
sBattleBuffersTransferData[4 + i] = arg4[i];
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 8); // Only 7 bytes were written.
}
@@ -912,7 +912,7 @@ void BtlController_EmitDataTransfer(u8 bufferId, u16 size, void *data)
sBattleBuffersTransferData[1] = CONTROLLER_DATATRANSFER;
sBattleBuffersTransferData[2] = size;
sBattleBuffersTransferData[3] = (size & 0xFF00) >> 8;
for (i = 0; i < size; i++)
for (i = 0; i < size; ++i)
sBattleBuffersTransferData[4 + i] = *(u8 *)(data++);
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 4);
}
@@ -929,7 +929,7 @@ static void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, voi
sBattleBuffersTransferData[4] = ((u32)(dst) & 0xFF000000) >> 24;
sBattleBuffersTransferData[5] = size;
sBattleBuffersTransferData[6] = (size & 0xFF00) >> 8;
for (i = 0; i < size; i++)
for (i = 0; i < size; ++i)
sBattleBuffersTransferData[7 + i] = *(u8 *)(data++);
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 7);
}
@@ -945,7 +945,7 @@ static void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data)
// Nonsense loop using songId as a size
// Would go out of bounds for any song id after SE_DEOXYS_MOVE (253)
for (i = 0; i < songId; i++)
for (i = 0; i < songId; ++i)
sBattleBuffersTransferData[3 + i] = *(u8 *)(data++);
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, songId + 3);
}
@@ -958,7 +958,7 @@ static void BtlController_EmitCmd32(u8 bufferId, u16 size, void *data)
sBattleBuffersTransferData[0] = CONTROLLER_32;
sBattleBuffersTransferData[1] = size;
sBattleBuffersTransferData[2] = (size & 0xFF00) >> 8;
for (i = 0; i < size; i++)
for (i = 0; i < size; ++i)
sBattleBuffersTransferData[3 + i] = *(u8 *)(data++);
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 3);
}
@@ -978,7 +978,7 @@ void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 b, u8 *c)
sBattleBuffersTransferData[0] = CONTROLLER_CHOSENMONRETURNVALUE;
sBattleBuffersTransferData[1] = b;
for (i = 0; i < 3; i++)
for (i = 0; i < 3; ++i)
sBattleBuffersTransferData[2 + i] = c[i];
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 5);
}
@@ -1108,7 +1108,7 @@ void BtlController_EmitDrawPartyStatusSummary(u8 bufferId, struct HpAndStatus* h
sBattleBuffersTransferData[1] = flags & ~PARTY_SUMM_SKIP_DRAW_DELAY; // If true, skip player side
sBattleBuffersTransferData[2] = (flags & PARTY_SUMM_SKIP_DRAW_DELAY) >> 7; // If true, skip delay after drawing. True during intro
sBattleBuffersTransferData[3] = CONTROLLER_DRAWPARTYSTATUSSUMMARY;
for (i = 0; i < (s32)(sizeof(struct HpAndStatus) * PARTY_SIZE); i++)
for (i = 0; i < (s32)(sizeof(struct HpAndStatus) * PARTY_SIZE); ++i)
sBattleBuffersTransferData[4 + i] = *(i + (u8 *)(hpAndStatus));
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, sizeof(struct HpAndStatus) * PARTY_SIZE + 4);
}
+8 -8
View File
@@ -484,7 +484,7 @@ static void BattleLoadAllHealthBoxesGfxAtOnce(void)
LoadCompressedSpriteSheetUsingHeap(&sSpriteSheets_DoublesOpponentHealthbox[1]);
numberOfBattlers = MAX_BATTLERS_COUNT;
}
for (i = 0; i < numberOfBattlers; i++)
for (i = 0; i < numberOfBattlers; ++i)
LoadCompressedSpriteSheetUsingHeap(&sSpriteSheets_HealthBar[gBattlerPositions[i]]);
}
@@ -641,7 +641,7 @@ void CopyAllBattleSpritesInvisibilities(void)
{
s32 i;
for (i = 0; i < gBattlersCount; i++)
for (i = 0; i < gBattlersCount; ++i)
gBattleSpritesDataPtr->battlerData[i].invisible = gSprites[gBattlerSpriteIds[i]].invisible;
}
@@ -766,7 +766,7 @@ void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite)
LZDecompressVram(gSubstituteDollGfx, gMonSpritesGfxPtr->sprites[position]);
else
LZDecompressVram(gSubstituteDollTilemap, gMonSpritesGfxPtr->sprites[position]);
for (i = 1; i < 4; i++)
for (i = 1; i < 4; ++i)
{
u8 (*ptr)[4][0x800] = gMonSpritesGfxPtr->sprites[position];
@@ -870,7 +870,7 @@ void SetBattlerSpriteAffineMode(u8 affineMode)
{
s32 i;
for (i = 0; i < gBattlersCount; i++)
for (i = 0; i < gBattlersCount; ++i)
{
if (IsBattlerSpritePresent(i))
{
@@ -961,7 +961,7 @@ void BattleInterfaceSetWindowPals(void)
s32 i;
s32 j;
for (i = 0; i < 9; i++)
for (i = 0; i < 9; ++i)
{
for (j = 0; j < 16; ++vramPtr, ++j)
{
@@ -978,7 +978,7 @@ void BattleInterfaceSetWindowPals(void)
// 18 tiles at 0x06000600
vramPtr = (u16 *)(BG_VRAM + 0x600);
for (i = 0; i < 18; i++)
for (i = 0; i < 18; ++i)
{
for (j = 0; j < 16; ++vramPtr, ++j)
{
@@ -1009,12 +1009,12 @@ void AllocateMonSpritesGfx(void)
gMonSpritesGfxPtr = NULL;
gMonSpritesGfxPtr = AllocZeroed(sizeof(*gMonSpritesGfxPtr));
gMonSpritesGfxPtr->firstDecompressed = AllocZeroed(0x8000);
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
for (i = 0; i < MAX_BATTLERS_COUNT; ++i)
{
gMonSpritesGfxPtr->sprites[i] = gMonSpritesGfxPtr->firstDecompressed + (i * 0x2000);
*(gMonSpritesGfxPtr->templates + i) = gSpriteTemplates_Battlers[i];
for (j = 0; j < 4; j++)
for (j = 0; j < 4; ++j)
{
gMonSpritesGfxPtr->images[i][j].data = gMonSpritesGfxPtr->sprites[i] + (j * 0x800);
gMonSpritesGfxPtr->images[i][j].size = 0x800;
+8 -8
View File
@@ -190,7 +190,7 @@ static void BattleIntroSlide1(u8 taskId)
if (gTasks[taskId].data[2])
gTasks[taskId].data[2] -= 2;
// Scanline settings have already been set in CB2_InitBattleInternal
for (i = 0; i < 80; i++)
for (i = 0; i < 80; ++i)
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = gTasks[taskId].data[2];
while (i < 160)
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i++] = -gTasks[taskId].data[2];
@@ -289,7 +289,7 @@ static void BattleIntroSlide2(u8 taskId)
if (gTasks[taskId].data[2])
gTasks[taskId].data[2] -= 2;
// Scanline settings have already been set in CB2_InitBattleInternal()
for (i = 0; i < 80; i++)
for (i = 0; i < 80; ++i)
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = gTasks[taskId].data[2];
while (i < 160)
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i++] = -gTasks[taskId].data[2];
@@ -368,7 +368,7 @@ static void BattleIntroSlide3(u8 taskId)
if (gTasks[taskId].data[2])
gTasks[taskId].data[2] -= 2;
// Scanline settings have already been set in CB2_InitBattleInternal()
for (i = 0; i < 80; i++)
for (i = 0; i < 80; ++i)
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = gTasks[taskId].data[2];
while (i < 160)
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i++] = -gTasks[taskId].data[2];
@@ -445,7 +445,7 @@ static void BattleIntroSlideLink(u8 taskId)
if (gTasks[taskId].data[2])
gTasks[taskId].data[2] -= 2;
// Scanline settings have already been set in CB2_InitBattleInternal()
for (i = 0; i < 80; i++)
for (i = 0; i < 80; ++i)
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = gTasks[taskId].data[2];
while (i < 160)
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i++] = -gTasks[taskId].data[2];
@@ -473,8 +473,8 @@ void CopyBattlerSpriteToBg(s32 bgId, u8 x, u8 y, u8 battlerPosition, u8 palno, u
CpuCopy16(gMonSpritesGfxPtr->sprites[battlerPosition] + BG_SCREEN_SIZE * gBattleMonForms[battler], tilesDest, BG_SCREEN_SIZE);
LoadBgTiles(bgId, tilesDest, 0x1000, tilesOffset);
for (i = y; i < y + 8; i++)
for (j = x; j < x + 8; j++)
for (i = y; i < y + 8; ++i)
for (j = x; j < x + 8; ++j)
tilemapDest[i * 32 + j] = offset++ | (palno << 12);
LoadBgTilemap(bgId, tilemapDest, BG_SCREEN_SIZE, 0);
}
@@ -486,7 +486,7 @@ static void sub_80BCFCC(u8 arg0, u8 arg1, u8 battlerPosition, u8 arg3, u8 arg4,
DmaCopy16(3, gMonSpritesGfxPtr->sprites[battlerPosition] + BG_SCREEN_SIZE * arg3, (void *)BG_SCREEN_ADDR(0) + arg5, BG_SCREEN_SIZE);
offset = (arg5 >> 5) - (arg7 << 9);
for (i = arg1; i < arg1 + 8; i++)
for (j = arg0; j < arg0 + 8; j++)
for (i = arg1; i < arg1 + 8; ++i)
for (j = arg0; j < arg0 + 8; ++j)
*((u16 *)(BG_VRAM) + (i * 32) + (j + (arg6 << 10))) = offset++ | (arg4 << 12);
}
+3 -3
View File
@@ -669,12 +669,12 @@ static void CB2_InitBattleInternal(void)
gBattle_WIN0V = WIN_RANGE(DISPLAY_HEIGHT / 2, DISPLAY_HEIGHT / 2 + 1);
ScanlineEffect_Clear();
for (i = 0; i < 80; i++)
for (i = 0; i < 80; ++i)
{
gScanlineEffectRegBuffers[0][i] = 0xF0;
gScanlineEffectRegBuffers[1][i] = 0xF0;
}
for (; i < 160; i++)
for (; i < 160; ++i)
{
gScanlineEffectRegBuffers[0][i] = 0xFF10;
gScanlineEffectRegBuffers[1][i] = 0xFF10;
@@ -2314,7 +2314,7 @@ static void BattleStartClearSetData(void)
gBattleResults.playerMon1Species = SPECIES_NONE;
gBattleResults.playerMon2Species = SPECIES_NONE;
gBattleResults.caughtMonSpecies = SPECIES_NONE;
for (i = 0; i < POKEMON_NAME_LENGTH; i++)
for (i = 0; i < POKEMON_NAME_LENGTH; ++i)
{
gBattleResults.playerMon1Name[i] = 0;
gBattleResults.playerMon2Name[i] = 0;
+1 -1
View File
@@ -9278,7 +9278,7 @@ static void Cmd_pickup(void)
{
s32 random = Random() % 100;
for (j = 0; j < 15; j++)
for (j = 0; j < 15; ++j)
if (sPickupItems[j].chance > random)
break;
SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &sPickupItems[j]);
+5 -5
View File
@@ -533,7 +533,7 @@ static u16 GetSumOfPlayerPartyLevel(u8 numMons)
u8 sum = 0;
s32 i;
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
u32 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2);
@@ -563,7 +563,7 @@ static u8 GetSumOfEnemyPartyLevel(u16 opponentId, u8 numMons)
const struct TrainerMonNoItemDefaultMoves *party;
party = gTrainers[opponentId].party.NoItemDefaultMoves;
for (i = 0; i < count; i++)
for (i = 0; i < count; ++i)
sum += party[i].lvl;
}
break;
@@ -572,7 +572,7 @@ static u8 GetSumOfEnemyPartyLevel(u16 opponentId, u8 numMons)
const struct TrainerMonNoItemCustomMoves *party;
party = gTrainers[opponentId].party.NoItemCustomMoves;
for (i = 0; i < count; i++)
for (i = 0; i < count; ++i)
sum += party[i].lvl;
}
break;
@@ -581,7 +581,7 @@ static u8 GetSumOfEnemyPartyLevel(u16 opponentId, u8 numMons)
const struct TrainerMonItemDefaultMoves *party;
party = gTrainers[opponentId].party.ItemDefaultMoves;
for (i = 0; i < count; i++)
for (i = 0; i < count; ++i)
sum += party[i].lvl;
}
break;
@@ -590,7 +590,7 @@ static u8 GetSumOfEnemyPartyLevel(u16 opponentId, u8 numMons)
const struct TrainerMonItemCustomMoves *party;
party = gTrainers[opponentId].party.ItemCustomMoves;
for (i = 0; i < count; i++)
for (i = 0; i < count; ++i)
sum += party[i].lvl;
}
break;
+16 -16
View File
@@ -861,7 +861,7 @@ static bool8 BT_Phase2BigPokeball_Init(struct Task *task)
sTransitionStructPtr->win0V = WIN_RANGE(0, 0xA0);
sTransitionStructPtr->bldCnt = BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG0 | BLDCNT_TGT2_BG1 | BLDCNT_TGT2_BG2 | BLDCNT_TGT2_BG3 | BLDCNT_TGT2_OBJ | BLDCNT_TGT2_BD;
sTransitionStructPtr->bldAlpha = (task->tEvb << 8) | task->tEva;
for (i = 0; i < 160; i++)
for (i = 0; i < 160; ++i)
gScanlineEffectRegBuffers[1][i] = 0xF0;
SetVBlankCallback(VBCB_BT_Phase2BigPokeball1);
BT_GetBg0TilemapAndTilesetBase(&tilemapAddr, &tilesetAddr);
@@ -879,7 +879,7 @@ static bool8 BT_Phase2BigPokeball_LoadTilemapAndWave(struct Task *task)
const u16 *BigPokeballMap = sBigPokeballTilemap;
BT_GetBg0TilemapAndTilesetBase(&tilemapAddr, &tilesetAddr);
for (i = 0; i < 20; i++)
for (i = 0; i < 20; ++i)
for (j = 0; j < 30; ++j, ++BigPokeballMap)
tilemapAddr[i * 32 + j] = *BigPokeballMap | 0xF000; // use palette #15
BT_LoadWaveIntoBuffer(gScanlineEffectRegBuffers[0], 0, task->tTheta, 132, task->tAmplitude, 160);
@@ -1147,7 +1147,7 @@ static bool8 BT_Phase2ClockwiseBlackFade_Init(struct Task *task)
sTransitionStructPtr->winOut = WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR;
sTransitionStructPtr->win0H = WIN_RANGE(0xF0, 0xF1);
sTransitionStructPtr->win0V = WIN_RANGE(0, 0xA0);
for (i = 0; i < 160; i++)
for (i = 0; i < 160; ++i)
gScanlineEffectRegBuffers[1][i] = WIN_RANGE(0xF3, 0xF4);
SetVBlankCallback(VBCB_BT_Phase2ClockwiseBlackFade);
sTransitionStructPtr->trEndPtX = 120;
@@ -1349,7 +1349,7 @@ static bool8 BT_Phase2FullScreenWave_Init(struct Task *task)
BT_InitCtrlBlk();
ScanlineEffect_Clear();
for (i = 0; i < 160; i++)
for (i = 0; i < 160; ++i)
gScanlineEffectRegBuffers[1][i] = sTransitionStructPtr->bg123VOfs;
SetVBlankCallback(VBCB_BT_Phase2FullScreenWave);
SetHBlankCallback(HBCB_BT_Phase2FullScreenWave);
@@ -1429,7 +1429,7 @@ static bool8 BT_Phase2BlackWaveToRight_Init(struct Task *task)
sTransitionStructPtr->winOut = 0;
sTransitionStructPtr->win0H = WIN_RANGE(0, 0xF0);
sTransitionStructPtr->win0V = WIN_RANGE(0, 0xA0);
for (i = 0; i < 160; i++)
for (i = 0; i < 160; ++i)
gScanlineEffectRegBuffers[1][i] = WIN_RANGE(0, 0xF2);
SetVBlankCallback(VBCB_BT_Phase2BlackWaveToRight);
++task->tState;
@@ -1500,7 +1500,7 @@ static void BT_AntiClockwiseSpiral_DoUpdateFrame(s16 initRadius, s16 deltaAngleM
s16 i, amplitude1, amplitude2;
s16 y1, x1, y2, x2;
for (i = 320; i < 960; i++)
for (i = 320; i < 960; ++i)
gScanlineEffectRegBuffers[1][i] = 120;
for (i = 0; i < (deltaAngleMax * 16); ++i, ++theta)
@@ -1813,7 +1813,7 @@ static bool8 BT_Phase2Mugshot_Init(struct Task *task)
sTransitionStructPtr->winIn = WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR;
sTransitionStructPtr->winOut = WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR;
sTransitionStructPtr->win0V = WIN_RANGE(0, 0xA0);
for (i = 0; i < 160; i++)
for (i = 0; i < 160; ++i)
gScanlineEffectRegBuffers[1][i] = WIN_RANGE(0xF0, 0xF1);
SetVBlankCallback(VBCB_BT_Phase2Mugshot1_Slide);
++task->tState;
@@ -1830,7 +1830,7 @@ static bool8 BT_Phase2Mugshot_LoadGfx(struct Task *task)
CpuCopy16(sVsBarTileset, tilesetAddr, 0x1E0);
LoadPalette(sVsBarOpponentPalettes[task->tWhichMugshot], 0xF0, 0x20);
LoadPalette(sVsBarPlayerPalettes[gSaveBlock2Ptr->playerGender], 0xFA, 0xC);
for (i = 0; i < 20; i++)
for (i = 0; i < 20; ++i)
for (j = 0; j < 32; ++j, ++mugshotsMap)
tilemapAddr[i * 32 + j] = *mugshotsMap | 0xF000; // use palette #15
EnableInterrupts(INTR_FLAG_HBLANK);
@@ -1956,7 +1956,7 @@ static bool8 BT_Phase2Mugshot_ExpandWhiteBand(struct Task *task)
{
s16 i;
for (i = 0, nextFunc = FALSE; i <= task->tHalfBandwidth; i++)
for (i = 0, nextFunc = FALSE; i <= task->tHalfBandwidth; ++i)
{
s16 y1 = 80 - i;
s16 y2 = 80 + i;
@@ -2174,7 +2174,7 @@ static bool8 BT_Phase2SlicedScreen_Init(struct Task *task)
sTransitionStructPtr->winIn = WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR;
sTransitionStructPtr->winOut = 0;
sTransitionStructPtr->win0V = WIN_RANGE(0, 0xA0);
for (i = 0; i < 160; i++)
for (i = 0; i < 160; ++i)
{
gScanlineEffectRegBuffers[1][i] = sTransitionStructPtr->bg123HOfs;
gScanlineEffectRegBuffers[1][160 + i] = 0xF0;
@@ -2198,7 +2198,7 @@ static bool8 BT_Phase2SlicedScreen_UpdateOffsets(struct Task *task)
task->tAcc += task->tJerk;
if (task->tJerk < 128)
task->tJerk <<= 1;
for (i = 0; i < 160; i++)
for (i = 0; i < 160; ++i)
{
u16 *ofsBuffer = &gScanlineEffectRegBuffers[0][i];
u16 *win0HBuffer = &gScanlineEffectRegBuffers[0][i + 160];
@@ -2274,7 +2274,7 @@ static bool8 BT_Phase2WhiteFadeInStripes_Init(struct Task *task)
sTransitionStructPtr->winIn = WINOUT_WIN01_BG1 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG3 | WINOUT_WIN01_OBJ;
sTransitionStructPtr->winOut = WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WININ_WIN0_CLR;
sTransitionStructPtr->win0V = WIN_RANGE(0, 0xA0);
for (i = 0; i < 160; i++)
for (i = 0; i < 160; ++i)
{
gScanlineEffectRegBuffers[1][i] = 0;
gScanlineEffectRegBuffers[1][i + 160] = 0xF0;
@@ -2393,7 +2393,7 @@ static void SpriteCB_BT_Phase2WhiteFadeInStripes(struct Sprite *sprite)
u16 *win0H = &gScanlineEffectRegBuffers[0][sprite->y + 160];
u32 stripeWidth = sprite->spLastSprite ? 0x19 : 0x1B;
for (i = 0; i < stripeWidth; i++)
for (i = 0; i < stripeWidth; ++i)
{
bldY[i] = sprite->spBldyCounter >> 8;
win0H[i] = (u8)(sprite->x);
@@ -2499,7 +2499,7 @@ static bool8 BT_Phase2BlackDoodles_Init(struct Task *task)
sTransitionStructPtr->winIn = WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR;
sTransitionStructPtr->winOut = 0;
sTransitionStructPtr->win0V = WIN_RANGE(0, 0xA0);
for (i = 0; i < 160; i++)
for (i = 0; i < 160; ++i)
gScanlineEffectRegBuffers[0][i] = WIN_RANGE(0, 0xF0);
CpuCopy16(gScanlineEffectRegBuffers[0], gScanlineEffectRegBuffers[1], 0x140);
SetVBlankCallback(VBCB_BT_Phase2BlackDoodles);
@@ -2521,7 +2521,7 @@ static bool8 BT_Phase2BlackDoodles_DrawSingleBrush(struct Task *task)
bool8 nextFunc;
sTransitionStructPtr->vblankDma = FALSE;
for (i = 0, nextFunc = FALSE; i < 16; i++)
for (i = 0, nextFunc = FALSE; i < 16; ++i)
{
s16 left = gScanlineEffectRegBuffers[0][sTransitionStructPtr->trCurrentPtY] >> 8;
s16 right = gScanlineEffectRegBuffers[0][sTransitionStructPtr->trCurrentPtY] & 0xFF;
@@ -2736,7 +2736,7 @@ static void BT_GenerateCircle(s16 *buffer, s16 x, s16 y, s16 radius)
memset(buffer, 0xA, 320);
// 64 iterations because we only want to cover [0, π/2) discretely.
for (i = 0; i < 64; i++)
for (i = 0; i < 64; ++i)
{
s16 sinResult, cosResult, leftX, topY, bottomY, nextTopY, nextBottomY, winVal;
+23 -23
View File
@@ -1392,7 +1392,7 @@ static u32 Cmd_WaitForOthersToPickBerries(struct BerryCrushGame * game, u8 *args
case 4:
if (GetBlockReceivedStatus() != sReceivedPlayerBitmasks[game->playerCount - 2])
return 0;
for (i = 0; i < game->playerCount; i++)
for (i = 0; i < game->playerCount; ++i)
{
game->players[i].berryId = gBlockRecvBuffer[i][0];
if (game->players[i].berryId > LAST_BERRY_INDEX + 1)
@@ -1562,7 +1562,7 @@ static void HandlePartnerInput(struct BerryCrushGame * game)
s32 temp = 0;
struct BerryCrushGame_LinkState *linkState;
for (i = 0; i < game->playerCount; i++)
for (i = 0; i < game->playerCount; ++i)
{
linkState = (struct BerryCrushGame_LinkState *)gRecvCmds[i];
@@ -1611,7 +1611,7 @@ static void HandlePartnerInput(struct BerryCrushGame * game)
{
// For each player that pressed A, flag their input as synchronous
// This is used to change their impact sprite to a big impact
for (i = 0; i < game->playerCount; i++)
for (i = 0; i < game->playerCount; ++i)
{
if (game->players[i].inputState == INPUT_STATE_NONE)
continue;
@@ -1647,7 +1647,7 @@ static void BerryCrush_BuildLocalState(struct BerryCrushGame * game)
u16 r1 = 0;
u8 i = 0;
for (i = 0; i < game->playerCount; i++)
for (i = 0; i < game->playerCount; ++i)
{
if (game->players[i].inputState != 0)
{
@@ -1796,7 +1796,7 @@ static void RecvLinkData(struct BerryCrushGame * game)
u8 i = 0;
struct BerryCrushGame_LinkState * linkState = NULL;
for (i = 0; i < game->playerCount; i++)
for (i = 0; i < game->playerCount; ++i)
game->players[i].inputState = INPUT_STATE_NONE;
if ((gRecvCmds[0][0] & 0xFF00) != RFUCMD_SEND_PACKET)
@@ -2006,7 +2006,7 @@ static u32 Cmd_TabulateResults(struct BerryCrushGame * game, UNUSED u8 *args)
case 2:
if (GetBlockReceivedStatus() != sReceivedPlayerBitmasks[game->playerCount - 2])
return 0;
for (i = 0; i < game->playerCount; i++)
for (i = 0; i < game->playerCount; ++i)
game->players[i].timePressingA = gBlockRecvBuffer[i][0];
game->cmdTimer = 0;
game->sendCmd[0] = 0;
@@ -2044,7 +2044,7 @@ static u32 Cmd_TabulateResults(struct BerryCrushGame * game, UNUSED u8 *args)
// Choose random second results page
game->results.randomPageId = Random() % NUM_RANDOM_RESULTS_PAGES;
for (i = 0; i < game->playerCount; i++)
for (i = 0; i < game->playerCount; ++i)
{
game->results.playerIdsRanked[0][i] = i;
game->results.playerIdsRanked[1][i] = i;
@@ -2116,7 +2116,7 @@ static u32 Cmd_TabulateResults(struct BerryCrushGame * game, UNUSED u8 *args)
}
break;
case 4:
for (i = 0; i < game->playerCount - 1; i++)
for (i = 0; i < game->playerCount - 1; ++i)
{
for (j = game->playerCount - 1; j > i; --j)
{
@@ -2312,7 +2312,7 @@ static u32 Cmd_CommunicatePlayAgainResponses(struct BerryCrushGame * game, UNUSE
return 0;
// Read partners responses
for (i = 0; i < game->playerCount; i++)
for (i = 0; i < game->playerCount; ++i)
game->recvCmd[0] += gBlockRecvBuffer[i][0];
if (game->recvCmd[0] != PLAY_AGAIN_YES)
@@ -2447,7 +2447,7 @@ static void ResetGame(struct BerryCrushGame * game)
game->numBigSparkleChecks = -1;
game->numBigSparkles = 0;
game->sparkleCounter = 0;
for (i = 0; i < MAX_RFU_PLAYERS; i++)
for (i = 0; i < MAX_RFU_PLAYERS; ++i)
{
game->players[i].berryId = -1;
game->players[i].inputTime = 0;
@@ -3002,7 +3002,7 @@ static void printCrushingResults(struct BerryCrushGame * game)
x = 190 - (u8)GetStringWidth(FONT_2, gText_TimesPerSec, 0);
AddTextPrinterParameterized3(game->gfx.resultsWindowId, FONT_3, x, y, sBerryCrushTextColorTable[COLORID_GRAY], 0, gText_TimesPerSec);
for (i = 0; i < 8; i++)
for (i = 0; i < 8; ++i)
if (((u8)game->pressingSpeed >> (7 - i)) & 1)
score += *(i + sPressingSpeedConversionTable); // It's accessed in a different way here for unknown reason
ConvertIntToDecimalStringN(gStringVar1, game->pressingSpeed >> 8, STR_CONV_MODE_RIGHT_ALIGN, 3);
@@ -3130,7 +3130,7 @@ static void Task_ShowBerryCrushRankings(u8 taskId)
gText_PressingSpeedRankings
);
yPos = 42;
for (i = 0; i < 4; i++)
for (i = 0; i < 4; ++i)
{
ConvertIntToDecimalStringN(gStringVar1, i + 2, STR_CONV_MODE_LEFT_ALIGN, 1);
StringExpandPlaceholders(gStringVar4, gText_Var1Players);
@@ -3143,7 +3143,7 @@ static void Task_ShowBerryCrushRankings(u8 taskId)
0,
gStringVar4
);
for (j = 0; j < 8; j++)
for (j = 0; j < 8; ++j)
{
if (((tPressingSpeeds(i) & 0xFF) >> (7 - j)) & 1)
score += sPressingSpeedConversionTable[j];
@@ -3219,7 +3219,7 @@ static void CreatePlayerNameWindows(struct BerryCrushGame * game)
{
u8 i;
for (i = 0; i < game->playerCount; i++)
for (i = 0; i < game->playerCount; ++i)
{
game->gfx.playerCoords[i] = &sPlayerCoords[gUnknown_846F280[game->playerCount - 2][i]];
game->gfx.nameWindowIds[i] = AddWindow(&sWindowTemplates_PlayerNames[game->gfx.playerCoords[i]->playerId]);
@@ -3232,7 +3232,7 @@ static void DrawPlayerNameWindows(struct BerryCrushGame * game)
{
u8 i;
for (i = 0; i < game->playerCount; i++)
for (i = 0; i < game->playerCount; ++i)
{
PutWindowTilemap(game->gfx.nameWindowIds[i]);
if (i == game->localId)
@@ -3275,7 +3275,7 @@ static void CopyPlayerNameWindowGfxToBg(struct BerryCrushGame * game)
u8 *crusherGfx;
LZ77UnCompWram(gBerryCrush_Crusher_Tilemap, gDecompressionBuffer);
for (crusherGfx = gDecompressionBuffer; i < game->playerCount; i++)
for (crusherGfx = gDecompressionBuffer; i < game->playerCount; ++i)
{
CopyToBgTilemapBufferRect(
3,
@@ -3298,7 +3298,7 @@ static void CreateGameSprites(struct BerryCrushGame * game)
game->vibration = 0;
gSpriteCoordOffsetX = 0;
gSpriteCoordOffsetY = CRUSHER_START_Y;
for (i = 0; i < NELEMS(sSpriteSheets) - 1; i++)
for (i = 0; i < NELEMS(sSpriteSheets) - 1; ++i)
LoadCompressedSpriteSheet(&sSpriteSheets[i]);
LoadSpritePalettes(sSpritePals);
@@ -3310,7 +3310,7 @@ static void CreateGameSprites(struct BerryCrushGame * game)
game->gfx.coreSprite->animPaused = TRUE;
// Create sprites for the impact effect
for (i = 0; i < game->playerCount; i++)
for (i = 0; i < game->playerCount; ++i)
{
spriteId = CreateSprite(
&sSpriteTemplate_BerryCrushImpact,
@@ -3326,7 +3326,7 @@ static void CreateGameSprites(struct BerryCrushGame * game)
}
// Create sprites for sparkle effect
for (i = 0; i < NELEMS(game->gfx.sparkleSprites); i++)
for (i = 0; i < NELEMS(game->gfx.sparkleSprites); ++i)
{
spriteId = CreateSprite(
&sSpriteTemplate_BerryCrushPowderSparkles,
@@ -3342,7 +3342,7 @@ static void CreateGameSprites(struct BerryCrushGame * game)
}
// Create sprites for timer
for (i = 0; i < NELEMS(game->gfx.timerSprites); i++)
for (i = 0; i < NELEMS(game->gfx.timerSprites); ++i)
{
spriteId = CreateSprite(
&sSpriteTemplate_BerryCrushTimer,
@@ -3374,14 +3374,14 @@ static void DestroyGameSprites(struct BerryCrushGame * game)
FreeSpritePaletteByTag(TAG_TIMER_DIGITS);
FreeSpritePaletteByTag(PALTAG_EFFECT);
FreeSpritePaletteByTag(TAG_CRUSHER_BASE);
for (; i < NELEMS(game->gfx.timerSprites); i++)
for (; i < NELEMS(game->gfx.timerSprites); ++i)
DestroySprite(game->gfx.timerSprites[i]);
DigitObjUtil_DeletePrinter(2);
DigitObjUtil_DeletePrinter(1);
DigitObjUtil_DeletePrinter(0);
for (i = 0; i < NELEMS(game->gfx.sparkleSprites); i++)
for (i = 0; i < NELEMS(game->gfx.sparkleSprites); ++i)
DestroySprite(game->gfx.sparkleSprites[i]);
for (i = 0; i < game->playerCount; i++)
for (i = 0; i < game->playerCount; ++i)
DestroySprite(game->gfx.impactSprites[i]);
if (game->gfx.coreSprite->inUse)
DestroySprite(game->gfx.coreSprite);
+1 -1
View File
@@ -342,7 +342,7 @@ void BikeClearState(u32 directionHistory, u32 abStartSelectHistory)
gPlayerAvatar.directionHistory = directionHistory;
gPlayerAvatar.abStartSelectHistory = abStartSelectHistory;
gPlayerAvatar.lastSpinTile = 0;
for (i = 0; i < NELEMS(gPlayerAvatar.dirTimerHistory); i++)
for (i = 0; i < NELEMS(gPlayerAvatar.dirTimerHistory); ++i)
gPlayerAvatar.dirTimerHistory[i] = 0;
}
+2 -2
View File
@@ -428,7 +428,7 @@ static void AnimMissileArcStep(struct Sprite *sprite)
s16 y2 = sprite->y2;
s32 i;
for (i = 0; i < 8; i++)
for (i = 0; i < 8; ++i)
tempData[i] = data[i];
x2 += x1;
y2 += y1;
@@ -439,7 +439,7 @@ static void AnimMissileArcStep(struct Sprite *sprite)
rotation += 0xC000;
TrySetSpriteRotScale(sprite, FALSE, 0x100, 0x100, rotation);
for (i = 0; i < 8; i++)
for (i = 0; i < 8; ++i)
data[i] = tempData[i];
}
}
+7 -7
View File
@@ -437,7 +437,7 @@ void AnimTask_MoveAttackerMementoShadow(u8 taskId)
task->data[1] = 0;
task->data[2] = 0;
sub_80B856C(3);
for (i = 0; i < 112; i++)
for (i = 0; i < 112; ++i)
{
gScanlineEffectRegBuffers[0][i] = task->data[10];
gScanlineEffectRegBuffers[1][i] = task->data[10];
@@ -574,7 +574,7 @@ void AnimTask_MoveTargetMementoShadow(u8 taskId)
scanlineParams.dmaDest = &REG_BG1VOFS;
else
scanlineParams.dmaDest = &REG_BG2VOFS;
for (i = 0; i < 112; i++)
for (i = 0; i < 112; ++i)
{
gScanlineEffectRegBuffers[0][i] = task->data[10] + (159 - i);
gScanlineEffectRegBuffers[1][i] = task->data[10] + (159 - i);
@@ -682,9 +682,9 @@ static void sub_80B843C(struct Task *task)
{
var0 = task->data[13] / var2;
var1 = task->data[6] << 8;
for (i = 0; i < task->data[4]; i++)
for (i = 0; i < task->data[4]; ++i)
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = task->data[10] - (i - 159);
for (i = task->data[4]; i <= task->data[5]; i++)
for (i = task->data[4]; i <= task->data[5]; ++i)
{
if (i >= 0)
{
@@ -695,14 +695,14 @@ static void sub_80B843C(struct Task *task)
var1 += var0;
}
var4 = task->data[10] - (i - 159);
for (; i < task->data[7]; i++)
for (; i < task->data[7]; ++i)
if (i >= 0)
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = var4--;
}
else
{
var4 = task->data[10] + 159;
for (i = 0; i < 112; i++)
for (i = 0; i < 112; ++i)
{
gScanlineEffectRegBuffers[0][i] = var4;
gScanlineEffectRegBuffers[1][i] = var4;
@@ -715,7 +715,7 @@ static void sub_80B856C(u8 priority)
{
u16 i;
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
for (i = 0; i < MAX_BATTLERS_COUNT; ++i)
{
u8 spriteId = GetAnimBattlerSpriteId(i);
+3 -3
View File
@@ -344,7 +344,7 @@ void AnimTask_DragonDanceWaver(u8 taskId)
task->data[4] = r1 + 32;
if (task->data[3] < 0)
task->data[3] = 0;
for (i = task->data[3]; i <= task->data[4]; i++)
for (i = task->data[3]; i <= task->data[4]; ++i)
{
gScanlineEffectRegBuffers[0][i] = task->data[2];
gScanlineEffectRegBuffers[1][i] = task->data[2];
@@ -396,7 +396,7 @@ static void sub_80B776C(struct Task *task)
{
u16 i, r3 = task->data[5];
for (i = task->data[3]; i <= task->data[4]; i++)
for (i = task->data[3]; i <= task->data[4]; ++i)
{
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = ((gSineTable[r3] * task->data[6]) >> 7) + task->data[2];
r3 = (r3 + 8) & 0xFF;
@@ -416,7 +416,7 @@ static void AnimOverheatFlame(struct Sprite *sprite)
sprite->y += sprite->data[2] * gBattleAnimArgs[0];
sprite->data[3] = gBattleAnimArgs[3];
sprite->callback = sub_80B7894;
for (i = 0; i < 7; i++)
for (i = 0; i < 7; ++i)
gUnknown_20399A4[i] = sprite->data[i];
}
+2 -2
View File
@@ -126,7 +126,7 @@ static void DummyPerStepCallback(u8 taskId)
static void MarkIcefallCaveCoordVisited(s16 x, s16 y)
{
u8 i = 0;
for (; i < NELEMS(sIcefallCaveIceTileCoords); i++)
for (; i < NELEMS(sIcefallCaveIceTileCoords); ++i)
{
if (sIcefallCaveIceTileCoords[i][0] + 7 == x && sIcefallCaveIceTileCoords[i][1] + 7 == y)
{
@@ -139,7 +139,7 @@ static void MarkIcefallCaveCoordVisited(s16 x, s16 y)
void SetIcefallCaveCrackedIceMetatiles(void)
{
u8 i = 0;
for (; i < NELEMS(sIcefallCaveIceTileCoords); i++)
for (; i < NELEMS(sIcefallCaveIceTileCoords); ++i)
{
if (FlagGet(i + 1) == TRUE)
{
+1 -1
View File
@@ -858,7 +858,7 @@ static void sub_80AD1F8(u8 spriteId, u8 taskId, u8 a3)
x += 0x10;
sign = -1;
}
for (i = 0, j = 0; i <= 6; i++)
for (i = 0, j = 0; i <= 6; ++i)
{
u8 spriteId = CreateSprite(&gEruptionLaunchRockSpriteTemplate, x, y, 2);
+3 -3
View File
@@ -802,7 +802,7 @@ void AnimTask_DestinyBondWhiteShadow(u8 taskId)
baseY = GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_BOTTOM);
if (!IsContest())
{
for (battler = 0; battler < 4; battler++)
for (battler = 0; battler < 4; ++battler)
{
if (battler != gBattleAnimAttacker
&& battler != (gBattleAnimAttacker ^ 2)
@@ -903,7 +903,7 @@ static void sub_80B623C(u8 taskId)
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(task->data[8], task->data[9]));
if (task->data[8] == 0 && task->data[9] == 16)
{
for (i = 0; i < task->data[12]; i++)
for (i = 0; i < task->data[12]; ++i)
DestroySprite(&gSprites[task->data[i + 13]]);
++task->data[0];
}
@@ -1166,7 +1166,7 @@ static void sub_80B696C(u8 taskId)
switch (task->data[0])
{
case 0:
for (i = 0; i < 6; i++)
for (i = 0; i < 6; ++i)
{
spriteId = CreateSprite(&gGrudgeFlameSpriteTemplate, task->data[9], task->data[10], task->data[6]);
if (spriteId != MAX_SPRITES)
+3 -3
View File
@@ -557,7 +557,7 @@ void AnimTask_HorizontalShake(u8 taskId)
break;
case 4:
task->data[13] = 0;
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
for (i = 0; i < MAX_BATTLERS_COUNT; ++i)
{
if (IsBattlerSpriteVisible(i))
{
@@ -664,7 +664,7 @@ static void sub_80B967C(u8 taskId)
}
break;
case 2:
for (i = 0; i < task->data[13]; i++)
for (i = 0; i < task->data[13]; ++i)
gSprites[task->data[9 + i]].x2 = 0;
DestroyAnimVisualTask(taskId);
break;
@@ -679,7 +679,7 @@ static void sub_80B9760(struct Task *task)
xOffset = (task->data[14] / 2) + (task->data[14] & 1);
else
xOffset = -(task->data[14] / 2);
for (i = 0; i < task->data[13]; i++)
for (i = 0; i < task->data[13]; ++i)
gSprites[task->data[9 + i]].x2 = xOffset;
}
+4 -4
View File
@@ -667,7 +667,7 @@ static void AnimSwirlingSnowball_Step1(struct Sprite *sprite)
sprite->data[2] -= gBattleAnimArgs[2];
else
sprite->data[2] += gBattleAnimArgs[2];
for (i = 0; i < 8; i++)
for (i = 0; i < 8; ++i)
tempDataHolder[i] = sprite->data[i];
InitAnimFastLinearTranslationWithSpeed(sprite);
sprite->data[1] ^= 1;
@@ -684,7 +684,7 @@ static void AnimSwirlingSnowball_Step1(struct Sprite *sprite)
sprite->x += sprite->x2;
sprite->y += sprite->y2;
sprite->x2 = sprite->y2 = 0;
for (i = 0; i < 8; i++)
for (i = 0; i < 8; ++i)
sprite->data[i] = tempDataHolder[i];
sprite->callback = InitAndStartAnimFastLinearTranslationWithSpeed;
StoreSpriteCallbackInData6(sprite, AnimSwirlingSnowball_Step2);
@@ -772,7 +772,7 @@ static void AnimMoveParticleBeyondTarget(struct Sprite *sprite)
sprite->data[2] += gBattleAnimArgs[2];
sprite->data[4] += gBattleAnimArgs[3];
InitAnimFastLinearTranslationWithSpeed(sprite);
for (i = 0; i < 8; i++)
for (i = 0; i < 8; ++i)
tempDataHolder[i] = sprite->data[i];
sprite->data[1] ^= 1;
sprite->data[2] ^= 1;
@@ -789,7 +789,7 @@ static void AnimMoveParticleBeyondTarget(struct Sprite *sprite)
sprite->y += sprite->y2;
sprite->y2 = 0;
sprite->x2 = 0;
for (i = 0; i < 8; i++)
for (i = 0; i < 8; ++i)
sprite->data[i] = tempDataHolder[i];
sprite->data[5] = gBattleAnimArgs[5];
sprite->data[6] = gBattleAnimArgs[6];
+38 -38
View File
@@ -156,7 +156,7 @@ u16 rfu_initializeAPI(u32 *APIBuffer, u16 buffByteSize, IntrFunc *sioIntrTable_p
gRfuFixed = (void *)APIBuffer + 0xdc; // + sizeof(*gRfuStatic)
gRfuSlotStatusNI[0] = (void *)APIBuffer + 0x1bc; // + sizeof(*gRfuFixed)
gRfuSlotStatusUNI[0] = (void *)APIBuffer + 0x37c; // + sizeof(*gRfuSlotStatusNI[0]) * RFU_CHILD_MAX
for (i = 1; i < RFU_CHILD_MAX; i++)
for (i = 1; i < RFU_CHILD_MAX; ++i)
{
gRfuSlotStatusNI[i] = &gRfuSlotStatusNI[i - 1][1];
gRfuSlotStatusUNI[i] = &gRfuSlotStatusUNI[i - 1][1];
@@ -165,7 +165,7 @@ u16 rfu_initializeAPI(u32 *APIBuffer, u16 buffByteSize, IntrFunc *sioIntrTable_p
gRfuFixed->STWIBuffer = (struct RfuIntrStruct *)&gRfuSlotStatusUNI[3][1];
STWI_init_all((struct RfuIntrStruct *)&gRfuSlotStatusUNI[3][1], sioIntrTable_p, copyInterruptToRam);
rfu_STC_clearAPIVariables();
for (i = 0; i < RFU_CHILD_MAX; i++)
for (i = 0; i < RFU_CHILD_MAX; ++i)
{
gRfuSlotStatusNI[i]->recvBuffer = NULL;
gRfuSlotStatusNI[i]->recvBufferSize = 0;
@@ -206,7 +206,7 @@ static void rfu_STC_clearAPIVariables(void)
gRfuLinkStatus->parentChild = MODE_NEUTRAL;
rfu_clearAllSlot();
gRfuStatic->SCStartFlag = 0;
for (i = 0; i < RFU_CHILD_MAX; i++)
for (i = 0; i < RFU_CHILD_MAX; ++i)
gRfuStatic->cidBak[i] = 0;
REG_IME = IMEBackup;
}
@@ -286,7 +286,7 @@ static void rfu_CB_defaultCallback(u8 reqCommand, u16 reqResult)
if (gRfuStatic->flags & 8)
gRfuFixed->reqCallback(reqCommand, reqResult);
bmSlotFlags = gRfuLinkStatus->connSlotFlag | gRfuLinkStatus->linkLossSlotFlag;
for (i = 0; i < RFU_CHILD_MAX; i++)
for (i = 0; i < RFU_CHILD_MAX; ++i)
if ((bmSlotFlags >> i) & 1)
rfu_STC_removeLinkData(i, 1);
gRfuLinkStatus->parentChild = MODE_NEUTRAL;
@@ -343,7 +343,7 @@ u16 rfu_MBOOT_CHILD_inheritanceLinkStatus(void)
// The size of struct RfuLinkStatus is 180
checksum = 0;
for (i = 0; i < 180/2; i++)
for (i = 0; i < 180/2; ++i)
checksum += *mb_buff_iwram_p++;
if (checksum != *(u16 *)0x30000FA)
return 1;
@@ -447,11 +447,11 @@ void rfu_REQ_configGameData(u8 mbootFlag, u16 serialNo, const u8 *gname, const u
packet[1] = serialNo >> 8;
if (mbootFlag != 0)
packet[1] = (serialNo >> 8) | 0x80;
for (i = 2; i < 15; i++)
for (i = 2; i < 15; ++i)
packet[i] = *gname++;
check_sum = 0;
unameBackup = uname;
for (i = 0; i < 8; i++)
for (i = 0; i < 8; ++i)
{
check_sum += *unameBackup++;
check_sum += *gnameBackup++;
@@ -485,10 +485,10 @@ static void rfu_CB_configGameData(u8 reqCommand, u16 reqResult)
{
gRfuLinkStatus->my.mbootFlag = 0;
}
for (i = 0; i < RFU_GAME_NAME_LENGTH; i++)
for (i = 0; i < RFU_GAME_NAME_LENGTH; ++i)
gRfuLinkStatus->my.gname[i] = *gname_uname_p++;
++gname_uname_p;
for (i = 0; i < RFU_USER_NAME_LENGTH; i++)
for (i = 0; i < RFU_USER_NAME_LENGTH; ++i)
gRfuLinkStatus->my.uname[i] = *gname_uname_p++;
}
rfu_STC_REQ_callback(reqCommand, reqResult);
@@ -538,7 +538,7 @@ static void rfu_STC_clearLinkStatus(u8 parentChild)
CpuFill16(0, gRfuLinkStatus->partner, sizeof(gRfuLinkStatus->partner));
gRfuLinkStatus->findParentCount = 0;
}
for (i = 0; i < RFU_CHILD_MAX; i++)
for (i = 0; i < RFU_CHILD_MAX; ++i)
gRfuLinkStatus->strength[i] = 0;
gRfuLinkStatus->connCount = 0;
gRfuLinkStatus->connSlotFlag = 0;
@@ -601,7 +601,7 @@ static void rfu_STC_readChildList(void)
if (STWI_poll_CommandEnd() == 0)
{
data_p = &gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[4];
for (i = 0; i < RFU_CHILD_MAX; i++)
for (i = 0; i < RFU_CHILD_MAX; ++i)
true_slots[i] = *data_p++;
}
gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket32.data[0] = stwiParam;
@@ -688,7 +688,7 @@ static void rfu_STC_readParentCandidateList(void)
numSlots = packet_p[1];
packet_p += 4;
gRfuLinkStatus->findParentCount = 0;
for (i = 0; i < RFU_CHILD_MAX && numSlots != 0; i++)
for (i = 0; i < RFU_CHILD_MAX && numSlots != 0; ++i)
{
numSlots -= 7;
uname_p = packet_p + 6;
@@ -696,7 +696,7 @@ static void rfu_STC_readParentCandidateList(void)
check_sum = ~*packet_p;
++packet_p;
my_check_sum = 0;
for (j = 0; j < 8; j++)
for (j = 0; j < 8; ++j)
{
my_check_sum += *packet_p++;
my_check_sum += *uname_p++;
@@ -715,10 +715,10 @@ static void rfu_STC_readParentCandidateList(void)
else
target->mbootFlag = 0;
packet_p += 2;
for (j = 0; j < RFU_GAME_NAME_LENGTH; j++)
for (j = 0; j < RFU_GAME_NAME_LENGTH; ++j)
target->gname[j] = *packet_p++;
++packet_p;
for (j = 0; j < RFU_USER_NAME_LENGTH; j++)
for (j = 0; j < RFU_USER_NAME_LENGTH; ++j)
target->uname[j] = *packet_p++;
++gRfuLinkStatus->findParentCount;
}
@@ -729,7 +729,7 @@ void rfu_REQ_startConnectParent(u16 pid)
{
u16 result = 0;
u8 i;
for (i = 0; i < RFU_CHILD_MAX && gRfuLinkStatus->partner[i].id != pid; i++)
for (i = 0; i < RFU_CHILD_MAX && gRfuLinkStatus->partner[i].id != pid; ++i)
;
if (i == RFU_CHILD_MAX)
result = ERR_PID_NOT_FOUND;
@@ -774,7 +774,7 @@ static void rfu_CB_pollConnectParent(u8 reqCommand, u16 reqResult)
++gRfuLinkStatus->connCount;
gRfuLinkStatus->parentChild = MODE_CHILD;
gRfuStatic->flags |= 0x80;
for (i = 0; i < RFU_CHILD_MAX; i++)
for (i = 0; i < RFU_CHILD_MAX; ++i)
{
if (gRfuLinkStatus->partner[i].id == gRfuStatic->tryPid)
{
@@ -860,7 +860,7 @@ u16 rfu_syncVBlank(void)
{
gRfuStatic->flags &= 0xFB;
bmSlotFlag = gRfuLinkStatus->connSlotFlag | gRfuLinkStatus->linkLossSlotFlag;
for (i = 0; i < RFU_CHILD_MAX; i++)
for (i = 0; i < RFU_CHILD_MAX; ++i)
if ((bmSlotFlag >> i) & 1)
rfu_STC_removeLinkData(i, 1);
gRfuLinkStatus->parentChild = MODE_NEUTRAL;
@@ -913,7 +913,7 @@ u16 rfu_REQBN_watchLink(u16 reqCommandId, u8 *bmLinkLossSlot, u8 *linkLossReason
newLinkLossFlag ^= gRfuLinkStatus->connSlotFlag;
*bmLinkLossSlot = newLinkLossFlag & gRfuLinkStatus->connSlotFlag;
*linkLossReason = REASON_LINK_LOSS;
for (i = 0; i < RFU_CHILD_MAX; i++)
for (i = 0; i < RFU_CHILD_MAX; ++i)
{
if ((*bmLinkLossSlot >> i) & 1)
{
@@ -933,7 +933,7 @@ u16 rfu_REQBN_watchLink(u16 reqCommandId, u8 *bmLinkLossSlot, u8 *linkLossReason
if (reqResult == 0)
{
packet_p = &gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[4];
for (i = 0; i < RFU_CHILD_MAX; i++)
for (i = 0; i < RFU_CHILD_MAX; ++i)
gRfuLinkStatus->strength[i] = *packet_p++;
to_req_disconnect = 0;
i = 0;
@@ -943,7 +943,7 @@ u16 rfu_REQBN_watchLink(u16 reqCommandId, u8 *bmLinkLossSlot, u8 *linkLossReason
rfu_STC_REQ_callback(ID_LINK_STATUS_REQ, reqResult);
return reqResult;
}
for (; i < RFU_CHILD_MAX; i++)
for (; i < RFU_CHILD_MAX; ++i)
{
#if LIBRFU_VERSION >= 1026
if (gRfuStatic->lsFixedCount[i] != 0)
@@ -1120,7 +1120,7 @@ static void rfu_CB_disconnect(u8 reqCommand, u16 reqResult)
gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[8] = gRfuStatic->recoveryBmSlot;
if (reqResult == 0)
{
for (i = 0; i < RFU_CHILD_MAX; i++)
for (i = 0; i < RFU_CHILD_MAX; ++i)
{
bm_slot_flag = 1 << i;
if (bm_slot_flag & gRfuStatic->recoveryBmSlot)
@@ -1145,7 +1145,7 @@ void rfu_REQ_CHILD_startConnectRecovery(u8 bmRecoverySlot)
u8 i;
gRfuStatic->recoveryBmSlot = bmRecoverySlot;
for (i = 0; i < RFU_CHILD_MAX && !((bmRecoverySlot >> i) & 1); i++)
for (i = 0; i < RFU_CHILD_MAX && !((bmRecoverySlot >> i) & 1); ++i)
;
STWI_set_Callback_M(rfu_STC_REQ_callback);
// if i == 4, gRfuLinkStatus->partner[i].id becomes gRfuLinkStatus->my.id
@@ -1166,7 +1166,7 @@ static void rfu_CB_CHILD_pollConnectRecovery(u8 reqCommand, u16 reqResult)
if (reqResult == 0 && gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[4] == 0 && gRfuStatic->recoveryBmSlot)
{
gRfuLinkStatus->parentChild = MODE_CHILD;
for (i = 0; i < RFU_CHILD_MAX; i++)
for (i = 0; i < RFU_CHILD_MAX; ++i)
{
bm_slot_flag = 1 << i;
rfuLinkStatus = gRfuLinkStatus; // ???
@@ -1248,7 +1248,7 @@ void rfu_clearAllSlot(void)
u16 IMEBackup = REG_IME;
REG_IME = 0;
for (i = 0; i < RFU_CHILD_MAX; i++)
for (i = 0; i < RFU_CHILD_MAX; ++i)
{
CpuFill16(0, gRfuSlotStatusNI[i], 2 * sizeof(struct NIComm));
CpuFill16(0, gRfuSlotStatusUNI[i], sizeof(struct UNISend) + sizeof(struct UNIRecv));
@@ -1316,7 +1316,7 @@ u16 rfu_clearSlot(u8 connTypeFlag, u8 slotStatusIndex)
if (NI_comm->state & SLOT_BUSY_FLAG)
{
rfu_STC_releaseFrame(slotStatusIndex, send_recv, NI_comm);
for (i = 0; i < RFU_CHILD_MAX; i++)
for (i = 0; i < RFU_CHILD_MAX; ++i)
if ((NI_comm->bmSlotOrg >> i) & 1)
NI_comm->failCounter = 0;
}
@@ -1441,7 +1441,7 @@ static u16 rfu_STC_setSendData_org(u8 ni_or_uni, u8 bmSendSlot, u8 subFrameSize,
slotStatus_NI->send.src = src;
slotStatus_NI->send.ack = 0;
slotStatus_NI->send.phase = 0;
for (i = 0; i < WINDOW_COUNT; i++)
for (i = 0; i < WINDOW_COUNT; ++i)
{
slotStatus_NI->send.recvAckFlag[i] = 0;
slotStatus_NI->send.n[i] = 1;
@@ -1494,7 +1494,7 @@ u16 rfu_changeSendTarget(u8 connType, u8 slotStatusIndex, u8 bmNewTgtSlot)
{
imeBak = REG_IME;
REG_IME = 0;
for (i = 0; i < RFU_CHILD_MAX; i++)
for (i = 0; i < RFU_CHILD_MAX; ++i)
{
if ((connType >> i) & 1)
gRfuSlotStatusNI[i]->send.failCounter = 0;
@@ -1527,7 +1527,7 @@ u16 rfu_changeSendTarget(u8 connType, u8 slotStatusIndex, u8 bmNewTgtSlot)
if (gRfuSlotStatusUNI[slotStatusIndex]->send.state != SLOT_STATE_SEND_UNI)
return ERR_SLOT_NOT_SENDING;
for (bmSlot = 0, i = 0; i < RFU_CHILD_MAX; i++)
for (bmSlot = 0, i = 0; i < RFU_CHILD_MAX; ++i)
if (i != slotStatusIndex)
bmSlot |= gRfuSlotStatusUNI[i]->send.bmSlot;
if (bmNewTgtSlot & bmSlot)
@@ -1687,7 +1687,7 @@ static void rfu_CB_sendData(UNUSED u8 reqCommand, u16 reqResult)
if (reqResult == 0)
{
for (i = 0; i < RFU_CHILD_MAX; i++)
for (i = 0; i < RFU_CHILD_MAX; ++i)
{
if (gRfuSlotStatusUNI[i]->send.dataReadyFlag)
gRfuSlotStatusUNI[i]->send.dataReadyFlag = 0;
@@ -1732,7 +1732,7 @@ static void rfu_constructSendLLFrame(void)
gRfuLinkStatus->LLFReadyFlag = 0;
pakcketSize = 0;
llf_p = (u8 *)&gRfuFixed->LLFBuffer[1];
for (i = 0; i < RFU_CHILD_MAX; i++)
for (i = 0; i < RFU_CHILD_MAX; ++i)
{
currSize = 0;
if (gRfuSlotStatusNI[i]->send.state & SLOT_BUSY_FLAG)
@@ -1808,7 +1808,7 @@ static u16 rfu_STC_NI_constructLLSF(u8 bm_slot_id, u8 **dest_pp, struct NIComm *
if (gRfuLinkStatus->parentChild == MODE_PARENT)
frame |= NI_comm->bmSlot << 18;
frame8_p = (u8 *)&frame;
for (i = 0; i < llsf->frameSize; i++)
for (i = 0; i < llsf->frameSize; ++i)
*(*dest_pp)++ = *frame8_p++;
if (size != 0)
{
@@ -1846,7 +1846,7 @@ static u16 rfu_STC_UNI_constructLLSF(u8 bm_slot_id, u8 **dest_p)
if (gRfuLinkStatus->parentChild == MODE_PARENT)
frame |= UNI_send->bmSlot << 18;
frame8_p = (u8 *)&frame;
for (i = 0; i < llsf->frameSize; i++)
for (i = 0; i < llsf->frameSize; ++i)
*(*dest_p)++ = *frame8_p++;
src_p = UNI_send->src;
gRfuFixed->fastCopyPtr(&src_p, dest_p, UNI_send->payloadSize);
@@ -1881,7 +1881,7 @@ static void rfu_CB_recvData(u8 reqCommand, u16 reqResult)
rfu_STC_PARENT_analyzeRecvPacket();
else
rfu_STC_CHILD_analyzeRecvPacket();
for (i = 0; i < RFU_CHILD_MAX; i++)
for (i = 0; i < RFU_CHILD_MAX; ++i)
{
slotStatusNI = gRfuSlotStatusNI[i];
if (slotStatusNI->recv.state == SLOT_STATE_RECV_LAST && !((gRfuStatic->NIEndRecvFlag >> i) & 1))
@@ -1965,7 +1965,7 @@ static u16 rfu_STC_analyzeLLSF(u8 slot_id, const u8 *src, u16 last_frame)
if (last_frame < llsf_p->frameSize)
return last_frame;
frames = 0;
for (i = 0; i < llsf_p->frameSize; i++)
for (i = 0; i < llsf_p->frameSize; ++i)
frames |= *src++ << 8 * i;
llsf_NI.recvFirst = (frames >> llsf_p->recvFirstShift) & llsf_p->recvFirstMask;
llsf_NI.connSlotFlag = (frames >> llsf_p->connSlotFlagShift) & llsf_p->connSlotFlagMask;
@@ -1991,7 +1991,7 @@ static u16 rfu_STC_analyzeLLSF(u8 slot_id, const u8 *src, u16 last_frame)
}
else
{
for (i = 0; i < RFU_CHILD_MAX; i++)
for (i = 0; i < RFU_CHILD_MAX; ++i)
if (((gRfuSlotStatusNI[i]->send.bmSlot >> slot_id) & 1)
&& ((gRfuLinkStatus->sendSlotNIFlag >> slot_id) & 1))
break;
@@ -2006,7 +2006,7 @@ static u16 rfu_STC_analyzeLLSF(u8 slot_id, const u8 *src, u16 last_frame)
if (conSlots)
{
for (i = 0; i < RFU_CHILD_MAX; i++)
for (i = 0; i < RFU_CHILD_MAX; ++i)
{
if ((conSlots >> i) & 1)
{
@@ -2097,7 +2097,7 @@ static void rfu_STC_NI_receive_Sender(u8 NI_slot, u8 bm_flag, const struct RfuLo
NI_comm->phase = 0;
if (NI_comm->state == SLOT_STATE_SEND_START)
{
for (i = 0; i < WINDOW_COUNT; i++)
for (i = 0; i < WINDOW_COUNT; ++i)
{
NI_comm->n[i] = 1;
NI_comm->now_p[i] = NI_comm->src + NI_comm->payloadSize * i;
+2 -2
View File
@@ -208,13 +208,13 @@ void STWI_send_GameConfigREQ(const u8 *serial_gname, const u8 *uname)
*(u16 *)packetBytes = *(u16 *)serial_gname;
packetBytes += sizeof(u16);
serial_gname += sizeof(u16);
for (i = 0; i < 14; i++)
for (i = 0; i < 14; ++i)
{
*packetBytes = *serial_gname;
++packetBytes;
++serial_gname;
}
for (i = 0; i < 8; i++)
for (i = 0; i < 8; ++i)
{
*packetBytes = *uname;
++packetBytes;
+4 -4
View File
@@ -580,8 +580,8 @@ void MultichoiceGrid_PrintItems(u8 windowId, u8 fontId, u8 itemWidth, u8 itemHei
itemHeight = itemHeight;
width = GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH);
yOffset = (16 - GetFontAttribute(fontId, FONTATTR_MAX_LETTER_HEIGHT)) / 2;
for (i = 0; i < rows; i++)
for (j = 0; j < cols; j++)
for (i = 0; i < rows; ++i)
for (j = 0; j < cols; ++j)
AddTextPrinterParameterized(windowId, fontId, strs[i * cols + j].text, itemWidth * j + width, yOffset + itemHeight * i, 0xFF, 0);
CopyWindowToVram(windowId, COPYWIN_GFX);
}
@@ -595,8 +595,8 @@ static void MultichoiceGrid_PrintItemsCustomOrder(u8 windowId, u8 fontId, u8 ite
itemWidth = itemWidth;
itemHeight = itemHeight;
width = GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH);
for (i = 0; i < rows; i++)
for (j = 0; j < cols; j++)
for (i = 0; i < rows; ++i)
for (j = 0; j < cols; ++j)
AddTextPrinterParameterized(windowId, fontId, strs[orderArray[i * cols + j]].text, itemWidth * j + width, itemHeight * i, 0xFF, 0);
CopyWindowToVram(windowId, COPYWIN_GFX);
}
+2 -2
View File
@@ -299,7 +299,7 @@ static void sub_8146980(void)
u8 i = 0;
memcpy(sWork->title, sWork->wonderNews.titleText, 40);
sWork->title[40] = EOS;
for (; i < 10; i++)
for (; i < 10; ++i)
{
memcpy(sWork->messages[i], sWork->wonderNews.bodyText[i], 40);
sWork->messages[i][40] = EOS;
@@ -322,7 +322,7 @@ static void sub_8146A30(void)
if (x < 0)
x = 0;
AddTextPrinterParameterized3(sWork->windowIds[0], FONT_3, x, 6, sTextPals[sWork->bgSpec->textPal1], 0, sWork->title);
for (; i < 10; i++)
for (; i < 10; ++i)
{
AddTextPrinterParameterized3(sWork->windowIds[1], FONT_3, 0, 16 * i + 2, sTextPals[sWork->bgSpec->textPal2], 0, sWork->messages[i]);
}
+2 -2
View File
@@ -473,7 +473,7 @@ void AnimTask_BlendColorCycleExclude(u8 taskId)
gTasks[taskId].data[4] = gBattleAnimArgs[4];
gTasks[taskId].data[5] = gBattleAnimArgs[5];
gTasks[taskId].data[8] = 0;
for (battler = 0; battler < gBattlersCount; battler++)
for (battler = 0; battler < gBattlersCount; ++battler)
if (battler != gBattleAnimAttacker && battler != gBattleAnimTarget)
selectedPalettes |= 1 << (battler + 16);
if (gBattleAnimArgs[0] == 1)
@@ -765,7 +765,7 @@ static void sub_80BA320(struct Sprite *sprite)
*(u16 *)(sprite->data[6] | (sprite->data[7] << 16)) = sprite->data[4];
var0 = sprite->data[5] - 2;
if (var0 < 2)
for (i = 0; i < gBattlersCount; i++)
for (i = 0; i < gBattlersCount; ++i)
gSprites[gBattlerSpriteIds[i]].coordOffsetEnabled = 0;
DestroyAnimSprite(sprite);
}
+18 -18
View File
@@ -129,7 +129,7 @@ void ResetPaletteFade(void)
{
u8 i;
for (i = 0; i < 16; i++)
for (i = 0; i < 16; ++i)
ResetPaletteStruct(i);
ResetPaletteFadeControl();
}
@@ -139,7 +139,7 @@ void ReadPlttIntoBuffers(void)
u16 i;
u16 *pltt = (u16 *)PLTT;
for (i = 0; i < PLTT_SIZE / 2; i++)
for (i = 0; i < PLTT_SIZE / 2; ++i)
{
gPlttBufferUnfaded[i] = pltt[i];
gPlttBufferFaded[i] = pltt[i];
@@ -199,7 +199,7 @@ static void sub_8070718(u8 a1, u32 *a2)
{
u8 i;
for (i = 0; i < NUM_PALETTE_STRUCTS; i++)
for (i = 0; i < NUM_PALETTE_STRUCTS; ++i)
{
struct PaletteStruct *palstruct = &sPaletteStructs[i];
@@ -291,7 +291,7 @@ static void sub_80708F4(struct PaletteStruct *a1, u32 *a2)
u32 srcOffset = a1->srcIndex * a1->base->size;
u8 i;
for (i = 0; i < a1->base->size; i++)
for (i = 0; i < a1->base->size; ++i)
gPlttBufferFaded[a1->baseDestOffset + i] = a1->base->src[srcOffset + i];
}
}
@@ -388,7 +388,7 @@ static u8 GetPaletteNumByUid(u16 uid)
{
u8 i;
for (i = 0; i < NUM_PALETTE_STRUCTS; i++)
for (i = 0; i < NUM_PALETTE_STRUCTS; ++i)
if (sPaletteStructs[i].base->uid == uid)
return i;
return 16;
@@ -482,7 +482,7 @@ void InvertPlttBuffer(u32 selectedPalettes)
{
u8 i;
for (i = 0; i < 16; i++)
for (i = 0; i < 16; ++i)
gPlttBufferFaded[paletteOffset + i] = ~gPlttBufferFaded[paletteOffset + i];
}
selectedPalettes >>= 1;
@@ -500,7 +500,7 @@ void TintPlttBuffer(u32 selectedPalettes, s8 r, s8 g, s8 b)
{
u8 i;
for (i = 0; i < 16; i++)
for (i = 0; i < 16; ++i)
{
struct PlttData *data = (struct PlttData *)&gPlttBufferFaded[paletteOffset + i];
@@ -524,7 +524,7 @@ void UnfadePlttBuffer(u32 selectedPalettes)
{
u8 i;
for (i = 0; i < 16; i++)
for (i = 0; i < 16; ++i)
gPlttBufferFaded[paletteOffset + i] = gPlttBufferUnfaded[paletteOffset + i];
}
selectedPalettes >>= 1;
@@ -574,7 +574,7 @@ static u8 UpdateFastPaletteFade(void)
switch (gPaletteFade_submode)
{
case FAST_FADE_IN_FROM_WHITE:
for (i = paletteOffsetStart; i < paletteOffsetEnd; i++)
for (i = paletteOffsetStart; i < paletteOffsetEnd; ++i)
{
struct PlttData *unfaded;
struct PlttData *faded;
@@ -597,7 +597,7 @@ static u8 UpdateFastPaletteFade(void)
}
break;
case FAST_FADE_OUT_TO_WHITE:
for (i = paletteOffsetStart; i < paletteOffsetEnd; i++)
for (i = paletteOffsetStart; i < paletteOffsetEnd; ++i)
{
struct PlttData *data = (struct PlttData *)&gPlttBufferFaded[i];
@@ -614,7 +614,7 @@ static u8 UpdateFastPaletteFade(void)
}
break;
case FAST_FADE_IN_FROM_BLACK:
for (i = paletteOffsetStart; i < paletteOffsetEnd; i++)
for (i = paletteOffsetStart; i < paletteOffsetEnd; ++i)
{
struct PlttData *unfaded;
struct PlttData *faded;
@@ -637,7 +637,7 @@ static u8 UpdateFastPaletteFade(void)
}
break;
case FAST_FADE_OUT_TO_BLACK:
for (i = paletteOffsetStart; i < paletteOffsetEnd; i++)
for (i = paletteOffsetStart; i < paletteOffsetEnd; ++i)
{
struct PlttData *data = (struct PlttData *)&gPlttBufferFaded[i];
@@ -804,7 +804,7 @@ void TintPalette_GrayScale(u16 *palette, u16 count)
s32 r, g, b, i;
u32 gray;
for (i = 0; i < count; i++)
for (i = 0; i < count; ++i)
{
r = (*palette >> 0) & 0x1F;
g = (*palette >> 5) & 0x1F;
@@ -819,7 +819,7 @@ void TintPalette_GrayScale2(u16 *palette, u16 count)
s32 r, g, b, i;
u32 gray;
for (i = 0; i < count; i++)
for (i = 0; i < count; ++i)
{
r = (*palette >> 0) & 0x1F;
g = (*palette >> 5) & 0x1F;
@@ -838,7 +838,7 @@ void TintPalette_SepiaTone(u16 *palette, u16 count)
s32 r, g, b, i;
u32 gray;
for (i = 0; i < count; i++)
for (i = 0; i < count; ++i)
{
r = (*palette >> 0) & 0x1F;
g = (*palette >> 5) & 0x1F;
@@ -858,7 +858,7 @@ void TintPalette_CustomTone(u16 *palette, u16 count, u16 rTone, u16 gTone, u16 b
s32 r, g, b, i;
u32 gray;
for (i = 0; i < count; i++)
for (i = 0; i < count; ++i)
{
r = (*palette >> 0) & 0x1F;
g = (*palette >> 5) & 0x1F;
@@ -884,7 +884,7 @@ void sub_80716F8(const u16 *src, u16 *dst, u16 count, u8 a4)
if (!a4)
{
for (i = 0; i < count; i++)
for (i = 0; i < count; ++i)
*dst++ = *src++;
}
else
@@ -932,7 +932,7 @@ bool32 sub_807185C(u8 var)
{
s32 i;
for (i = 0; i < NUM_TASKS; i++)
for (i = 0; i < NUM_TASKS; ++i)
if (gTasks[i].isActive == TRUE
&& gTasks[i].func == sub_80718B8
&& gTasks[i].data[8] == var)
+39 -39
View File
@@ -427,9 +427,9 @@ void InitPartyMenu(u8 menuType, u8 layout, u8 partyAction, bool8 keepCursorPos,
sPartyMenuInternal->chooseHalf = FALSE;
if (layout != KEEP_PARTY_LAYOUT)
gPartyMenu.layout = layout;
for (i = 0; i < NELEMS(sPartyMenuInternal->data); i++)
for (i = 0; i < NELEMS(sPartyMenuInternal->data); ++i)
sPartyMenuInternal->data[i] = 0;
for (i = 0; i < NELEMS(sPartyMenuInternal->windowId); i++)
for (i = 0; i < NELEMS(sPartyMenuInternal->windowId); ++i)
sPartyMenuInternal->windowId[i] = 0xFF;
if (!keepCursorPos)
gPartyMenu.slotId = 0;
@@ -710,7 +710,7 @@ static void InitPartyMenuBoxes(u8 layout)
u8 i;
sPartyMenuBoxes = Alloc(sizeof(struct PartyMenuBox[PARTY_SIZE]));
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
sPartyMenuBoxes[i].infoRects = &sPartyBoxInfoRects[PARTY_BOX_RIGHT_COLUMN];
sPartyMenuBoxes[i].spriteCoords = sPartyMenuSpriteCoords[layout][i];
@@ -811,7 +811,7 @@ static void DisplayPartyPokemonDataForChooseHalf(u8 slot)
maxBattlers = 2;
else
maxBattlers = 3;
for (i = 0; i < maxBattlers; i++)
for (i = 0; i < maxBattlers; ++i)
{
if (order[i] != 0 && (order[i] - 1) == slot)
{
@@ -1800,12 +1800,12 @@ static void SetPartyMonsAllowedInMinigame(void)
gPartyMenu.data1 = 0;
if (gSpecialVar_0x8005 == 0)
{
for (i = 0; i < gPlayerPartyCount; i++)
for (i = 0; i < gPlayerPartyCount; ++i)
*ptr += IsMonAllowedInPokemonJump(&gPlayerParty[i]) << i;
}
else
{
for (i = 0; i < gPlayerPartyCount; i++)
for (i = 0; i < gPlayerPartyCount; ++i)
*ptr += IsMonAllowedInDodrioBerryPicking(&gPlayerParty[i]) << i;
}
}
@@ -2140,7 +2140,7 @@ static void InitPartyMenuWindows(u8 layout)
break;
}
DeactivateAllTextPrinters();
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
FillWindowPixelBuffer(i, PIXEL_FILL(0));
TextWindow_SetUserSelectedFrame(0, 0x4F, 0xD0);
TextWindow_SetStdFrame0_WithPal(0, 0x58, 0xF0);
@@ -2201,8 +2201,8 @@ static void BlitBitmapToPartyWindow(u8 windowId, const u8 *b, u8 c, u8 x, u8 y,
if (pixels != NULL)
{
for (i = 0; i < height; i++)
for (j = 0; j < width; j++)
for (i = 0; i < height; ++i)
for (j = 0; j < width; ++j)
CpuCopy16(GetPartyMenuBgTile(b[x + j + ((y + i) * c)]), &pixels[(i * width + j) * 32], 32);
BlitBitmapToWindow(windowId, pixels, x * 8, y * 8, width * 8, height * 8);
Free(pixels);
@@ -2543,7 +2543,7 @@ static bool8 ShouldUseChooseMonText(void)
if (gPartyMenu.action == PARTY_ACTION_SEND_OUT)
return TRUE;
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (GetMonData(&party[i], MON_DATA_SPECIES) != SPECIES_NONE && (GetMonData(&party[i], MON_DATA_HP) != 0 || GetMonData(&party[i], MON_DATA_IS_EGG)))
++numAliveMons;
@@ -2581,7 +2581,7 @@ static u8 DisplaySelectionWindow(u8 windowType)
return sPartyMenuInternal->windowId[0];
cursorDimension = GetMenuCursorDimensionByFont(FONT_2, 0);
fontAttribute = GetFontAttribute(FONT_2, FONTATTR_LETTER_SPACING);
for (i = 0; i < sPartyMenuInternal->numActions; i++)
for (i = 0; i < sPartyMenuInternal->numActions; ++i)
{
u8 fontColorsId = (sPartyMenuInternal->actions[i] >= MENU_FIELD_MOVES) ? 4 : 3;
@@ -2815,7 +2815,7 @@ void DrawHeldItemIconsForTrade(u8 *partyCounts, u8 *partySpriteIds, u8 whichPart
switch (whichParty)
{
case TRADE_PLAYER:
for (i = 0; i < partyCounts[TRADE_PLAYER]; i++)
for (i = 0; i < partyCounts[TRADE_PLAYER]; ++i)
{
item = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM);
if (item != ITEM_NONE)
@@ -2823,7 +2823,7 @@ void DrawHeldItemIconsForTrade(u8 *partyCounts, u8 *partySpriteIds, u8 whichPart
}
break;
case TRADE_PARTNER:
for (i = 0; i < partyCounts[TRADE_PARTNER]; i++)
for (i = 0; i < partyCounts[TRADE_PARTNER]; ++i)
{
item = GetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM);
if (item != ITEM_NONE)
@@ -2980,7 +2980,7 @@ static void SetPartyMonSelectionActions(struct Pokemon *mons, u8 slotId, u8 acti
else
{
sPartyMenuInternal->numActions = sPartyMenuActionCounts[action];
for (i = 0; i < sPartyMenuInternal->numActions; i++)
for (i = 0; i < sPartyMenuInternal->numActions; ++i)
sPartyMenuInternal->actions[i] = sPartyMenuActions[action][i];
}
}
@@ -2992,9 +2992,9 @@ static void SetPartyMonFieldSelectionActions(struct Pokemon *mons, u8 slotId)
sPartyMenuInternal->numActions = 0;
AppendToList(sPartyMenuInternal->actions, &sPartyMenuInternal->numActions, MENU_SUMMARY);
// Add field moves to action list
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
for (j = 0; sFieldMoves[j] != FIELD_MOVE_END; j++)
for (j = 0; sFieldMoves[j] != FIELD_MOVE_END; ++j)
{
if (GetMonData(&mons[slotId], i + MON_DATA_MOVE1) == sFieldMoves[j])
{
@@ -3798,7 +3798,7 @@ static void CursorCB_Enter(u8 taskId)
}
PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[0]);
PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[1]);
for (i = 0; i < maxBattlers; i++)
for (i = 0; i < maxBattlers; ++i)
{
if (gSelectedOrderFromParty[i] == 0)
{
@@ -3831,7 +3831,7 @@ static void CursorCB_NoEntry(u8 taskId)
PlaySE(SE_SELECT);
PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[0]);
PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[1]);
for (i = 0; i < 3; i++)
for (i = 0; i < 3; ++i)
{
if (gSelectedOrderFromParty[i] == gPartyMenu.slotId + 1)
{
@@ -4240,7 +4240,7 @@ void CB2_ShowPartyMenuForItemUse(void)
if (GetItemEffectType(gSpecialVar_ItemId) == ITEM_EFFECT_SACRED_ASH)
{
gPartyMenu.slotId = 0;
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) != SPECIES_NONE && GetMonData(&gPlayerParty[i], MON_DATA_HP) == 0)
{
@@ -4588,7 +4588,7 @@ static void ShowMoveSelectWindow(u8 slot)
u8 windowId = DisplaySelectionWindow(SELECTWINDOW_MOVES);
u16 move;
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
move = GetMonData(&gPlayerParty[slot], MON_DATA_MOVE1 + i);
AddTextPrinterParameterized(windowId,
@@ -4758,7 +4758,7 @@ bool8 IsMoveHm(u16 move)
{
u8 i;
for (i = 0; i < NUM_HIDDEN_MACHINES - 1; i++) // no dive
for (i = 0; i < NUM_HIDDEN_MACHINES - 1; ++i) // no dive
if (sTMHMMoves[i + NUM_TECHNICAL_MACHINES] == move)
return TRUE;
return FALSE;
@@ -4768,7 +4768,7 @@ bool8 MonKnowsMove(struct Pokemon *mon, u16 move)
{
u8 i;
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
{
if (GetMonData(mon, MON_DATA_MOVE1 + i) == move)
return TRUE;
@@ -5725,7 +5725,7 @@ static bool8 GetBattleEntryEligibility(struct Pokemon *mon)
&& GetMonData(mon, MON_DATA_LEVEL) > 50)
return FALSE;
species = GetMonData(mon, MON_DATA_SPECIES);
for (; gBattleTowerBannedSpecies[i] != 0xFFFF; i++)
for (; gBattleTowerBannedSpecies[i] != 0xFFFF; ++i)
if (gBattleTowerBannedSpecies[i] == species)
return FALSE;
break;
@@ -5744,11 +5744,11 @@ static u8 CheckBattleEntriesAndGetMessage(void)
case 1:
if (order[2] == 0)
return PARTY_MSG_THREE_MONS_ARE_NEEDED;
for (i = 0; i < 2; i++)
for (i = 0; i < 2; ++i)
{
sPartyMenuInternal->data[15] = GetMonData(&party[order[i] - 1], MON_DATA_SPECIES);
sPartyMenuInternal->data[14] = GetMonData(&party[order[i] - 1], MON_DATA_HELD_ITEM);
for (j = i + 1; j < 3; j++)
for (j = i + 1; j < 3; ++j)
{
if (sPartyMenuInternal->data[15] == GetMonData(&party[order[j] - 1], MON_DATA_SPECIES))
return PARTY_MSG_MONS_CANT_BE_SAME;
@@ -5769,7 +5769,7 @@ static bool8 HasPartySlotAlreadyBeenSelected(u8 slot)
{
u8 i;
for (i = 0; i < NELEMS(gSelectedOrderFromParty); i++)
for (i = 0; i < NELEMS(gSelectedOrderFromParty); ++i)
if (gSelectedOrderFromParty[i] == slot)
return TRUE;
return FALSE;
@@ -5964,7 +5964,7 @@ static bool8 TrySwitchInPokemon(void)
StringExpandPlaceholders(gStringVar4, gText_PkmnHasNoEnergy);
return FALSE;
}
for (i = 0; i < gBattlersCount; i++)
for (i = 0; i < gBattlersCount; ++i)
{
if (GetBattlerSide(i) == B_SIDE_PLAYER && GetPartyIdFromBattleSlot(slot) == gBattlerPartyIndexes[i])
{
@@ -6037,7 +6037,7 @@ static void BufferBattlePartyOrder(u8 *partyBattleOrder, u8 flankId)
{
j = 1;
partyIds[0] = gBattlerPartyIndexes[GetBattlerAtPosition(B_POSITION_PLAYER_LEFT)];
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (i != partyIds[0])
{
@@ -6051,7 +6051,7 @@ static void BufferBattlePartyOrder(u8 *partyBattleOrder, u8 flankId)
j = 2;
partyIds[0] = gBattlerPartyIndexes[GetBattlerAtPosition(B_POSITION_PLAYER_LEFT)];
partyIds[1] = gBattlerPartyIndexes[GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT)];
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (i != partyIds[0] && i != partyIds[1])
{
@@ -6060,7 +6060,7 @@ static void BufferBattlePartyOrder(u8 *partyBattleOrder, u8 flankId)
}
}
}
for (i = 0; i < (s32)NELEMS(gBattlePartyCurrentOrder); i++)
for (i = 0; i < (s32)NELEMS(gBattlePartyCurrentOrder); ++i)
partyBattleOrder[i] = (partyIds[0 + (i * 2)] << 4) | partyIds[1 + (i * 2)];
}
@@ -6107,7 +6107,7 @@ static void BufferBattlePartyOrderBySide(u8 *partyBattleOrder, u8 flankId, u8 ba
{
j = 1;
partyIndexes[0] = gBattlerPartyIndexes[leftBattler];
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (i != partyIndexes[0])
{
@@ -6121,7 +6121,7 @@ static void BufferBattlePartyOrderBySide(u8 *partyBattleOrder, u8 flankId, u8 ba
j = 2;
partyIndexes[0] = gBattlerPartyIndexes[leftBattler];
partyIndexes[1] = gBattlerPartyIndexes[rightBattler];
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (i != partyIndexes[0] && i != partyIndexes[1])
{
@@ -6130,7 +6130,7 @@ static void BufferBattlePartyOrderBySide(u8 *partyBattleOrder, u8 flankId, u8 ba
}
}
}
for (i = 0; i < 3; i++)
for (i = 0; i < 3; ++i)
partyBattleOrder[i] = (partyIndexes[0 + (i * 2)] << 4) | partyIndexes[1 + (i * 2)];
}
@@ -6152,7 +6152,7 @@ void SwitchPartyOrderLinkMulti(u8 battlerId, u8 slot, u8 slot2)
partyIds[j] = partyBattleOrder[i] & 0xF;
}
partyIdBuffer = partyIds[slot2];
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
{
if (partyIds[i] == slot)
{
@@ -6229,7 +6229,7 @@ static void UpdatePartyToBattleOrder(void)
u8 i;
memcpy(partyBuffer, gPlayerParty, sizeof(gPlayerParty));
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
memcpy(&gPlayerParty[GetPartyIdFromBattlePartyId(i)], &partyBuffer[i], sizeof(struct Pokemon));
Free(partyBuffer);
}
@@ -6240,7 +6240,7 @@ static void UpdatePartyToFieldOrder(void)
u8 i;
memcpy(partyBuffer, gPlayerParty, sizeof(gPlayerParty));
for (i = 0; i < PARTY_SIZE; i++)
for (i = 0; i < PARTY_SIZE; ++i)
memcpy(&gPlayerParty[GetPartyIdFromBattleSlot(i)], &partyBuffer[i], sizeof(struct Pokemon));
Free(partyBuffer);
}
@@ -6252,7 +6252,7 @@ static void SwitchAliveMonIntoLeadSlot(void)
struct Pokemon *mon;
u8 partyId;
for (i = 1; i < PARTY_SIZE; i++)
for (i = 1; i < PARTY_SIZE; ++i)
{
mon = &gPlayerParty[GetPartyIdFromBattleSlot(i)];
if (GetMonData(mon, MON_DATA_SPECIES) != SPECIES_NONE && GetMonData(mon, MON_DATA_HP) != 0)
@@ -6298,7 +6298,7 @@ static void Task_MultiPartnerPartySlideIn(u8 taskId)
SlideMultiPartyMenuBoxSpritesOneStep(taskId);
if (tXPos == 0)
{
for (i = 3; i < PARTY_SIZE; i++)
for (i = 3; i < PARTY_SIZE; ++i)
{
if (gMultiPartnerParty[i - MULTI_PARTY_SIZE].species != SPECIES_NONE)
AnimateSelectedPartyIcon(sPartyMenuBoxes[i].monSpriteId, 0);
@@ -6329,7 +6329,7 @@ static void SlideMultiPartyMenuBoxSpritesOneStep(u8 taskId)
s16 *data = gTasks[taskId].data;
u8 i;
for (i = 3; i < PARTY_SIZE; i++)
for (i = 3; i < PARTY_SIZE; ++i)
{
if (gMultiPartnerParty[i - MULTI_PARTY_SIZE].species != SPECIES_NONE)
{
+2 -2
View File
@@ -53,7 +53,7 @@ void GetNumMovesSelectedMonHas(void)
u8 i;
gSpecialVar_Result = 0;
for (i = 0; i < MAX_MON_MOVES; i++)
for (i = 0; i < MAX_MON_MOVES; ++i)
if (GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_MOVE1 + i) != MOVE_NONE)
++gSpecialVar_Result;
}
@@ -95,7 +95,7 @@ void MoveDeleterForgetMove(void)
SetMonMoveSlot(&gPlayerParty[gSpecialVar_0x8004], MOVE_NONE, gSpecialVar_0x8005);
RemoveMonPPBonus(&gPlayerParty[gSpecialVar_0x8004], gSpecialVar_0x8005);
for (i = gSpecialVar_0x8005; i < MAX_MON_MOVES - 1; i++)
for (i = gSpecialVar_0x8005; i < MAX_MON_MOVES - 1; ++i)
ShiftMoveSlot(&gPlayerParty[gSpecialVar_0x8004], i, i + 1);
}
+7 -7
View File
@@ -6095,10 +6095,10 @@ static void OakSpeechNidoranFSetupTemplate(struct OakSpeechNidoranFStruct *struc
if (battlePosition > 3)
{
for (i = 0; i < (s8)structPtr->spriteCount; i++)
for (i = 0; i < (s8)structPtr->spriteCount; ++i)
{
structPtr->templates[i] = gSpriteTemplates_Battlers[i];
for (j = 0; j < structPtr->frameCount; j++)
for (j = 0; j < structPtr->frameCount; ++j)
structPtr->frameImages[i * structPtr->frameCount + j].data = &structPtr->bufferPtrs[i][j * 0x800];
structPtr->templates[i].images = &structPtr->frameImages[i * structPtr->frameCount];
}
@@ -6108,7 +6108,7 @@ static void OakSpeechNidoranFSetupTemplate(struct OakSpeechNidoranFStruct *struc
const struct SpriteTemplate *template = &gSpriteTemplates_Battlers[battlePosition];
structPtr->templates[0] = *template;
for (j = 0; j < structPtr->frameCount; j++)
for (j = 0; j < structPtr->frameCount; ++j)
structPtr->frameImages[j].data = &structPtr->bufferPtrs[0][j * 0x800];
structPtr->templates[0].images = structPtr->frameImages;
}
@@ -6119,10 +6119,10 @@ static void OakSpeechNidoranFSetupTemplateDummy(struct OakSpeechNidoranFStruct *
{
u16 i, j;
for (i = 0; i < (s8)structPtr->spriteCount; i++)
for (i = 0; i < (s8)structPtr->spriteCount; ++i)
{
structPtr->templates[i] = sOakSpeechNidoranFDummyTemplate;
for (j = 0; j < structPtr->frameCount; j++)
for (j = 0; j < structPtr->frameCount; ++j)
structPtr->frameImages[i * structPtr->spriteCount + j].data = &structPtr->bufferPtrs[i][j * 0x800];
structPtr->templates[i].images = &structPtr->frameImages[i * structPtr->spriteCount]; // should be frameCount logically
structPtr->templates[i].anims = gSpriteAnimTable_82349BC;
@@ -6187,7 +6187,7 @@ struct OakSpeechNidoranFStruct *OakSpeechNidoranFSetup(u8 battlePosition, bool8
{
do
{
for (i = 0; i < (s8)sOakSpeechNidoranResources->spriteCount; i++)
for (i = 0; i < (s8)sOakSpeechNidoranResources->spriteCount; ++i)
sOakSpeechNidoranResources->bufferPtrs[i] = &sOakSpeechNidoranResources->dataBuffer[sOakSpeechNidoranResources->sizePerSprite * i];
} while (0);
}
@@ -6199,7 +6199,7 @@ struct OakSpeechNidoranFStruct *OakSpeechNidoranFSetup(u8 battlePosition, bool8
}
else
{
for (i = 0; i < sOakSpeechNidoranResources->frameCount * sOakSpeechNidoranResources->spriteCount; i++)
for (i = 0; i < sOakSpeechNidoranResources->frameCount * sOakSpeechNidoranResources->spriteCount; ++i)
sOakSpeechNidoranResources->frameImages[i].size = 0x800;
switch (sOakSpeechNidoranResources->enable2)
{
+3 -3
View File
@@ -756,7 +756,7 @@ static void sub_80B3618(u8 taskId)
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(task->data[3], task->data[4]));
if (++task->data[1] == 32)
{
for (i = 8; i < 13; i++)
for (i = 8; i < 13; ++i)
if (task->data[i] != 64)
DestroySprite(&gSprites[task->data[i]]);
++task->data[0];
@@ -923,7 +923,7 @@ void AnimTask_ExtrasensoryDistortion(u8 taskId)
task->data[10] = gBattle_BG2_X;
scanlineParams.dmaDest = &REG_BG2HOFS;
}
for (i = task->data[14]; i <= task->data[14] + 64; i++)
for (i = task->data[14]; i <= task->data[14] + 64; ++i)
{
gScanlineEffectRegBuffers[0][i] = task->data[10];
gScanlineEffectRegBuffers[1][i] = task->data[10];
@@ -944,7 +944,7 @@ static void sub_80B3B78(u8 taskId)
{
case 0:
sineIndex = task->data[13];
for (i = task->data[14]; i <= task->data[15]; i++)
for (i = task->data[14]; i <= task->data[15]; ++i)
{
s16 var2 = (gSineTable[sineIndex] >> task->data[12]);
+4 -4
View File
@@ -1320,9 +1320,9 @@ static void TeachyTvComputeSingleMapTileBlockFromTilesetAndMetaTiles(u8 *blockBu
CpuFastCopy(tileset, buffer, 0x20);
if (metaTile & 1)
{
for (i = 0; i < 8; i++)
for (i = 0; i < 8; ++i)
{
for (j = 0; j < 4; j++)
for (j = 0; j < 4; ++j)
{
u32 offset = j - 3;
u8 value = buffer[(i << 2) - offset];
@@ -1333,11 +1333,11 @@ static void TeachyTvComputeSingleMapTileBlockFromTilesetAndMetaTiles(u8 *blockBu
}
if (metaTile & 2)
{
for (i = 0; i < 8; i++)
for (i = 0; i < 8; ++i)
memcpy(&src[4 * i], &buffer[4 * (7 - i)], 4);
CpuFastCopy(src, buffer, 0x20);
}
for (i = 0; i < 32; i++)
for (i = 0; i < 32; ++i)
{
if (buffer[i] & 0xF0)
blockBuf[i] = (blockBuf[i] & 0xF) + (buffer[i] & 0xF0);
+1 -1
View File
@@ -993,7 +993,7 @@ s32 (*GetFontWidthFunc(u8 glyphId))(u16 _glyphId, bool32 _isJapanese)
{
u32 i;
for (i = 0; i < 7; i++)
for (i = 0; i < 7; ++i)
{
if (glyphId == sGlyphWidthFuncs[i].fontId)
return *sGlyphWidthFuncs[i].func;
+3 -3
View File
@@ -79,7 +79,7 @@ bool16 AddTextPrinter(struct TextPrinterTemplate *textSubPrinter, u8 speed, void
sTempTextPrinter.delayCounter = 0;
sTempTextPrinter.scrollDistance = 0;
for (i = 0; i < 7; i++)
for (i = 0; i < 7; ++i)
{
sTempTextPrinter.subUnion.fields[i] = 0;
}
@@ -98,7 +98,7 @@ bool16 AddTextPrinter(struct TextPrinterTemplate *textSubPrinter, u8 speed, void
else
{
sTempTextPrinter.textSpeed = 0;
for (j = 0; j < 0x400; j++)
for (j = 0; j < 0x400; ++j)
{
if ((u32)RenderFont(&sTempTextPrinter) == 1)
break;
@@ -116,7 +116,7 @@ void RunTextPrinters(void)
int i;
u16 temp;
for (i = 0; i < 0x20; i++)
for (i = 0; i < 0x20; ++i)
{
if (sTextPrinters[i].active != 0)
{
+8 -8
View File
@@ -25,7 +25,7 @@ bool16 InitWindows(const struct WindowTemplate *templates)
u8 *allocatedTilemapBuffer;
int allocatedBaseBlock;
for (i = 0; i < 4; i++)
for (i = 0; i < 4; ++i)
{
bgTilemapBuffer = GetBgTilemapBuffer(i);
if (bgTilemapBuffer != NULL)
@@ -34,7 +34,7 @@ bool16 InitWindows(const struct WindowTemplate *templates)
gWindowBgTilemapBuffers[i] = bgTilemapBuffer;
}
for (i = 0; i < WINDOWS_MAX; i++)
for (i = 0; i < WINDOWS_MAX; ++i)
{
gWindows[i].window = sDummyWindowTemplate;
gWindows[i].tileData = NULL;
@@ -63,7 +63,7 @@ bool16 InitWindows(const struct WindowTemplate *templates)
return FALSE;
}
for (j = 0; j < bgSize; j++)
for (j = 0; j < bgSize; ++j)
allocatedTilemapBuffer[j] = 0;
gWindowBgTilemapBuffers[bgLayer] = allocatedTilemapBuffer;
@@ -138,7 +138,7 @@ u16 AddWindow(const struct WindowTemplate *template)
if (allocatedTilemapBuffer == NULL)
return 0xFF;
for (i = 0; i < bgSize; i++)
for (i = 0; i < bgSize; ++i)
allocatedTilemapBuffer[i] = 0;
gWindowBgTilemapBuffers[bgLayer] = allocatedTilemapBuffer;
@@ -201,7 +201,7 @@ void FreeAllWindowBuffers(void)
{
int i;
for (i = 0; i < 4; i++)
for (i = 0; i < 4; ++i)
{
if (gWindowBgTilemapBuffers[i] != NULL && gWindowBgTilemapBuffers[i] != nullsub_8)
{
@@ -210,7 +210,7 @@ void FreeAllWindowBuffers(void)
}
}
for (i = 0; i < WINDOWS_MAX; i++)
for (i = 0; i < WINDOWS_MAX; ++i)
{
if (gWindows[i].tileData != NULL)
{
@@ -261,7 +261,7 @@ void PutWindowRectTilemapOverridePalette(u8 windowId, u8 x, u8 y, u8 width, u8 h
u16 currentRow = windowLocal.window.baseBlock + (y * windowLocal.window.width) + x + GetBgAttribute(windowLocal.window.bg, BG_ATTR_BASETILE);
int i;
for (i = 0; i < height; i++)
for (i = 0; i < height; ++i)
{
WriteSequenceToBgTilemapBuffer(
windowLocal.window.bg,
@@ -297,7 +297,7 @@ void PutWindowRectTilemap(u8 windowId, u8 x, u8 y, u8 width, u8 height)
u16 currentRow = windowLocal.window.baseBlock + (y * windowLocal.window.width) + x + GetBgAttribute(windowLocal.window.bg, BG_ATTR_BASETILE);
int i;
for (i = 0; i < height; i++)
for (i = 0; i < height; ++i)
{
WriteSequenceToBgTilemapBuffer(
windowLocal.window.bg,
+2 -2
View File
@@ -2811,7 +2811,7 @@ class Renderer {
if ((bc.flags & Bytecode::Flag::ValueMask) != Bytecode::Flag::ValuePop) {
popArgs -= 1;
}
for (unsigned int i = 0; i < popArgs; i++) {
for (unsigned int i = 0; i < popArgs; ++i) {
m_stack.pop_back();
}
}
@@ -2925,7 +2925,7 @@ class Renderer {
void render_to(std::ostream& os, const Template& tmpl, const json& data) {
m_data = &data;
for (size_t i = 0; i < tmpl.bytecodes.size(); i++) {
for (size_t i = 0; i < tmpl.bytecodes.size(); ++i) {
const auto& bc = tmpl.bytecodes[i];
switch (bc.op) {
+15 -15
View File
@@ -1438,7 +1438,7 @@ auto from_json_array_impl(const BasicJsonType& j, std::array<T, N>& arr,
priority_tag<2> /*unused*/)
-> decltype(j.template get<T>(), void())
{
for (std::size_t i = 0; i < N; i++)
for (std::size_t i = 0; i < N; ++i)
{
arr[i] = j.at(i).template get<T>();
}
@@ -4301,7 +4301,7 @@ class binary_reader
if (len != std::size_t(-1))
{
for (std::size_t i = 0; i < len; i++)
for (std::size_t i = 0; i < len; ++i)
{
if (JSON_UNLIKELY(not parse_cbor_internal()))
{
@@ -4338,7 +4338,7 @@ class binary_reader
string_t key;
if (len != std::size_t(-1))
{
for (std::size_t i = 0; i < len; i++)
for (std::size_t i = 0; i < len; ++i)
{
get();
if (JSON_UNLIKELY(not get_cbor_string(key) or not sax->key(key)))
@@ -4832,7 +4832,7 @@ class binary_reader
return false;
}
for (std::size_t i = 0; i < len; i++)
for (std::size_t i = 0; i < len; ++i)
{
if (JSON_UNLIKELY(not parse_msgpack_internal()))
{
@@ -4855,7 +4855,7 @@ class binary_reader
}
string_t key;
for (std::size_t i = 0; i < len; i++)
for (std::size_t i = 0; i < len; ++i)
{
get();
if (JSON_UNLIKELY(not get_msgpack_string(key) or not sax->key(key)))
@@ -5190,7 +5190,7 @@ class binary_reader
{
if (size_and_type.second != 'N')
{
for (std::size_t i = 0; i < size_and_type.first; i++)
for (std::size_t i = 0; i < size_and_type.first; ++i)
{
if (JSON_UNLIKELY(not get_ubjson_value(size_and_type.second)))
{
@@ -5201,7 +5201,7 @@ class binary_reader
}
else
{
for (std::size_t i = 0; i < size_and_type.first; i++)
for (std::size_t i = 0; i < size_and_type.first; ++i)
{
if (JSON_UNLIKELY(not parse_ubjson_internal()))
{
@@ -5251,7 +5251,7 @@ class binary_reader
if (size_and_type.second != 0)
{
for (std::size_t i = 0; i < size_and_type.first; i++)
for (std::size_t i = 0; i < size_and_type.first; ++i)
{
if (JSON_UNLIKELY(not get_ubjson_string(key) or not sax->key(key)))
{
@@ -5266,7 +5266,7 @@ class binary_reader
}
else
{
for (std::size_t i = 0; i < size_and_type.first; i++)
for (std::size_t i = 0; i < size_and_type.first; ++i)
{
if (JSON_UNLIKELY(not get_ubjson_string(key) or not sax->key(key)))
{
@@ -5356,7 +5356,7 @@ class binary_reader
{
// step 1: read input into array with system's byte order
std::array<std::uint8_t, sizeof(NumberType)> vec;
for (std::size_t i = 0; i < sizeof(NumberType); i++)
for (std::size_t i = 0; i < sizeof(NumberType); ++i)
{
get();
if (JSON_UNLIKELY(not unexpect_eof(format, "number")))
@@ -6705,7 +6705,7 @@ scan_number_done:
token_type return_type)
{
assert(current == literal_text[0]);
for (std::size_t i = 1; i < length; i++)
for (std::size_t i = 1; i < length; ++i)
{
if (JSON_UNLIKELY(get() != literal_text[i]))
{
@@ -9235,7 +9235,7 @@ class json_pointer
else
{
// iterate array and use index as reference string
for (std::size_t i = 0; i < value.m_value.array->size(); i++)
for (std::size_t i = 0; i < value.m_value.array->size(); ++i)
{
flatten(reference_string + "/" + std::to_string(i),
value.m_value.array->operator[](i), result);
@@ -12183,7 +12183,7 @@ class serializer
// first n-1 elements
for (auto i = val.m_value.array->cbegin();
i != val.m_value.array->cend() - 1; i++)
i != val.m_value.array->cend() - 1; ++i)
{
o->write_characters(indent_string.c_str(), new_indent);
dump(*i, true, ensure_ascii, indent_step, new_indent);
@@ -12205,7 +12205,7 @@ class serializer
// first n-1 elements
for (auto i = val.m_value.array->cbegin();
i != val.m_value.array->cend() - 1; i++)
i != val.m_value.array->cend() - 1; ++i)
{
dump(*i, false, ensure_ascii, indent_step, current_indent);
o->write_character(',');
@@ -12302,7 +12302,7 @@ class serializer
std::size_t bytes_after_last_accept = 0;
std::size_t undumped_chars = 0;
for (std::size_t i = 0; i < s.size(); i++)
for (std::size_t i = 0; i < s.size(); ++i)
{
const auto byte = static_cast<uint8_t>(s[i]);