Merge pull request #1777 from AsparagusEduardo/pret/pr/trailingWhitespace

Cleaned trailing whitespace
This commit is contained in:
GriffinR
2022-09-13 14:00:11 -04:00
committed by GitHub
51 changed files with 204 additions and 204 deletions

View File

@@ -495,7 +495,7 @@ static void TranslateSpriteInLissajousCurve(struct Sprite *sprite)
sprite->y2 = Cos(sprite->sCirclePosY, sprite->sAmplitude);
sprite->sCirclePosX += sprite->sCircleSpeedX;
sprite->sCirclePosY += sprite->sCircleSpeedY;
if (sprite->sCirclePosX >= 0x100)
sprite->sCirclePosX -= 0x100;
else if (sprite->sCirclePosX < 0)
@@ -2429,7 +2429,7 @@ void AnimTask_AttackerPunchWithTrace(u8 taskId)
dest = (task->tPaletteNum + 16) * 16;
src = (gSprites[task->tBattlerSpriteId].oam.paletteNum + 0x10) * 0x10;
// Set trace's priority based on battler's subpriority
task->tPriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker);
if (task->tPriority == 20 || task->tPriority == 40)

View File

@@ -6368,7 +6368,7 @@ static void Cmd_various(void)
break;
case VARIOUS_ARENA_JUDGMENT_WINDOW:
i = BattleArena_ShowJudgmentWindow(&gBattleCommunication[0]);
// BattleArena_ShowJudgmentWindow's last state was an intermediate step.
// Return without advancing the current instruction so that it will be called again.
if (i == ARENA_RESULT_RUNNING)

View File

@@ -390,7 +390,7 @@ static void GenerateOpponentMons(void)
while (i != FRONTIER_PARTY_SIZE)
{
sRandMonId = monSet[Random() % numMons];
// Ensure none of the opponent's pokemon are the same as the potential rental pokemon for the player
for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++)
{

View File

@@ -2434,7 +2434,7 @@ static bool8 Mugshot_WaitStartPlayerSlide(struct Task *task)
{
sTransitionData->BG0HOFS_Lower -= 8;
sTransitionData->BG0HOFS_Upper += 8;
// Start player's slide in once the opponent is finished
if (IsTrainerPicSlideDone(task->tOpponentSpriteId))
{
@@ -2770,7 +2770,7 @@ static bool8 Slice_Main(struct Task *task)
{
u16 *storeLoc1 = &gScanlineEffectRegBuffers[0][i];
u16 *storeLoc2 = &gScanlineEffectRegBuffers[0][i + DISPLAY_HEIGHT];
// Alternate rows
if (i % 2)
{
@@ -3251,7 +3251,7 @@ static bool8 RectangularSpiral_Main(struct Task *task)
// The line moved to a new position, draw the tile.
done = FALSE;
position = sRectangularSpiralLines[j].position;
// Invert position for the two lines that start at the bottom.
if ((j % 2) == 1)
position = 637 - position;
@@ -3281,7 +3281,7 @@ static bool8 RectangularSpiral_End(struct Task *task)
static bool16 UpdateRectangularSpiralLine(const s16 * const *moveDataTable, struct RectangularSpiralLine *line)
{
const s16 *moveData = moveDataTable[line->state];
// Has spiral finished?
// Note that most move data arrays endsin SPIRAL_END but it is
// only ever reached on the final array of spiraling outward.
@@ -3294,9 +3294,9 @@ static bool16 UpdateRectangularSpiralLine(const s16 * const *moveDataTable, stru
sDebug_RectangularSpiralData = moveData[2];
sDebug_RectangularSpiralData = moveData[3];
// Note that for the two lines originating at the bottom the
// Note that for the two lines originating at the bottom the
// position is inverted, so the directions are flipped.
// i.e. position += 1 is right for the top lines and left
// i.e. position += 1 is right for the top lines and left
// for their inverted partners on the bottom.
switch (moveData[0])
{
@@ -4170,13 +4170,13 @@ static void InitBlackWipe(s16 *data, s16 startX, s16 startY, s16 endX, s16 endY,
static bool8 UpdateBlackWipe(s16 *data, bool8 xExact, bool8 yExact)
{
u8 numFinished;
if (tWipeXDist > tWipeYDist)
{
// X has further to move, move it first
tWipeCurrX += tWipeXMove;
// If it has been far enough since Y's
// If it has been far enough since Y's
// last move then move it too
tWipeTemp += tWipeYDist;
if (tWipeTemp > tWipeXDist)
@@ -4190,7 +4190,7 @@ static bool8 UpdateBlackWipe(s16 *data, bool8 xExact, bool8 yExact)
// Y has further to move, move it first
tWipeCurrY += tWipeYMove;
// If it has been far enough since X's
// If it has been far enough since X's
// last move then move it too
tWipeTemp += tWipeXDist;
if (tWipeTemp > tWipeYDist)
@@ -4201,9 +4201,9 @@ static bool8 UpdateBlackWipe(s16 *data, bool8 xExact, bool8 yExact)
}
numFinished = 0;
// Has X coord reached end?
if ((tWipeXMove > 0 && tWipeCurrX >= tWipeEndX)
if ((tWipeXMove > 0 && tWipeCurrX >= tWipeEndX)
|| (tWipeXMove < 0 && tWipeCurrX <= tWipeEndX))
{
numFinished++;
@@ -4212,7 +4212,7 @@ static bool8 UpdateBlackWipe(s16 *data, bool8 xExact, bool8 yExact)
}
// Has Y coord reached end?
if ((tWipeYMove > 0 && tWipeCurrY >= tWipeEndY)
if ((tWipeYMove > 0 && tWipeCurrY >= tWipeEndY)
|| (tWipeYMove < 0 && tWipeCurrY <= tWipeEndY))
{
numFinished++;

View File

@@ -1147,7 +1147,7 @@ static const union AnimCmd *const sAnimTable_AshPuff[] =
sAnim_AshPuff,
};
const struct SpriteTemplate gFieldEffectObjectTemplate_AshPuff =
const struct SpriteTemplate gFieldEffectObjectTemplate_AshPuff =
{
.tileTag = TAG_NONE,
.paletteTag = FLDEFF_PAL_TAG_ASH,

View File

@@ -1211,7 +1211,7 @@ static void ShowDecorationOnMap_(u16 mapX, u16 mapY, u8 decWidth, u8 decHeight,
{
x = mapX + i;
attributes = GetMetatileAttributesById(NUM_TILES_IN_PRIMARY + gDecorations[decoration].tiles[j * decWidth + i]);
if (MetatileBehavior_IsSecretBaseImpassable(attributes & METATILE_ATTR_BEHAVIOR_MASK) == TRUE
if (MetatileBehavior_IsSecretBaseImpassable(attributes & METATILE_ATTR_BEHAVIOR_MASK) == TRUE
|| (gDecorations[decoration].permission != DECORPERM_PASS_FLOOR && (attributes >> METATILE_ATTR_LAYER_SHIFT) != METATILE_LAYER_TYPE_NORMAL))
impassableFlag = MAPGRID_COLLISION_MASK;
else
@@ -1482,7 +1482,7 @@ static bool8 IsSecretBaseTrainerSpot(u8 behaviorAt, u16 layerType)
// Can't place decoration where the player was standing when they interacted with the PC
static bool8 IsntInitialPosition(u8 taskId, s16 x, s16 y, u16 layerType)
{
if (x == gTasks[taskId].tInitialX + MAP_OFFSET
if (x == gTasks[taskId].tInitialX + MAP_OFFSET
&& y == gTasks[taskId].tInitialY + MAP_OFFSET
&& layerType != METATILE_LAYER_TYPE_NORMAL)
return FALSE;

View File

@@ -112,7 +112,7 @@ static bool32 ValidateEReaderConnection(void)
REG_IME = 0;
*(u64 *)handshakes = *(u64 *)gLink.handshakeBuffer;
REG_IME = backupIME;
// Validate that we are player 1, the EReader is player 2,
// and that players 3 and 4 are empty.
if (handshakes[0] == SLAVE_HANDSHAKE && handshakes[1] == EREADER_HANDSHAKE
@@ -154,8 +154,8 @@ enum {
static u32 TryReceiveCard(u8 *state, u16 *timer)
{
if (*state >= RECV_STATE_EXCHANGE
&& *state <= RECV_STATE_WAIT_DISCONNECT
if (*state >= RECV_STATE_EXCHANGE
&& *state <= RECV_STATE_WAIT_DISCONNECT
&& HasLinkErrorOccurred())
{
// Return error status if an error occurs

View File

@@ -2623,7 +2623,7 @@ bool8 ObjectEventIsTrainerAndCloseToPlayer(struct ObjectEvent *objectEvent)
minY = objY - objectEvent->trainerRange_berryTreeId;
maxX = objX + objectEvent->trainerRange_berryTreeId;
maxY = objY + objectEvent->trainerRange_berryTreeId;
if (minX > playerX || maxX < playerX
if (minX > playerX || maxX < playerX
|| minY > playerY || maxY < playerY)
return FALSE;

View File

@@ -251,7 +251,7 @@ static const struct PacifidlogMetatileOffsets *GetPacifidlogBridgeMetatileOffset
static void TrySetPacifidlogBridgeMetatiles(const struct PacifidlogMetatileOffsets *offsets, s16 x, s16 y, bool32 redrawMap)
{
offsets = GetPacifidlogBridgeMetatileOffsets(offsets, MapGridGetMetatileBehaviorAt(x, y));
// If offsets is NULL, position is not a log (don't set it)
if (offsets)
{
@@ -301,7 +301,7 @@ static bool32 ShouldRaisePacifidlogLogs(s16 newX, s16 newY, s16 oldX, s16 oldY)
}
else if (MetatileBehavior_IsPacifidlogHorizontalLogLeft(oldBehavior))
{
// Still on same one if moved from left to right
// Still on same one if moved from left to right
if (newX > oldX)
return FALSE;
}
@@ -340,13 +340,13 @@ static bool32 ShouldSinkPacifidlogLogs(s16 newX, s16 newY, s16 oldX, s16 oldY)
}
else if (MetatileBehavior_IsPacifidlogHorizontalLogLeft(newBehavior))
{
// Still on same one if moved from right to left
// Still on same one if moved from right to left
if (newX < oldX)
return FALSE;
}
else if (MetatileBehavior_IsPacifidlogHorizontalLogRight(newBehavior))
{
// Still on same one if moved from left to right
// Still on same one if moved from left to right
if (newX > oldX)
return FALSE;
}
@@ -371,7 +371,7 @@ static void PacifidlogBridgePerStepCallback(u8 taskId)
case 0:
tPrevX = x;
tPrevY = y;
// If player is already standing on a log when the callback
// is set then immediately set it to submerged
TrySetLogBridgeFullySubmerged(x, y, TRUE);
@@ -424,7 +424,7 @@ static void PacifidlogBridgePerStepCallback(u8 taskId)
{
// If player's current position is a log submerge it fully.
TrySetLogBridgeFullySubmerged(x, y, TRUE);
// Player's previous position is not the other end of a log
// they're standing on, try to raise their previous position.
if (tToRaiseX != -1 && tToRaiseY != -1)
@@ -499,7 +499,7 @@ static void FortreeBridgePerStepCallback(u8 taskId)
case 0:
tPrevX = x;
tPrevY = y;
// If player is already on bridge when callback is set then lower it immediately.
if (MetatileBehavior_IsFortreeBridge(MapGridGetMetatileBehaviorAt(x, y)))
{
@@ -518,7 +518,7 @@ static void FortreeBridgePerStepCallback(u8 taskId)
isFortreeBridgeCur = MetatileBehavior_IsFortreeBridge(MapGridGetMetatileBehaviorAt(x, y));
isFortreeBridgePrev = MetatileBehavior_IsFortreeBridge(MapGridGetMetatileBehaviorAt(prevX, prevY));
// Make sure player isn't below bridge
elevation = PlayerGetElevation();
onBridgeElevation = FALSE;
@@ -672,7 +672,7 @@ static void SootopolisGymIcePerStepCallback(u8 taskId)
// End if player hasn't moved
if (x == tPrevX && y == tPrevY)
return;
tPrevX = x;
tPrevY = y;
tileBehavior = MapGridGetMetatileBehaviorAt(x, y);

View File

@@ -61,7 +61,7 @@ struct SioInfo
u8 filler[92];
};
// Struct is mostly empty, presumably because usage of
// Struct is mostly empty, presumably because usage of
// its fields was largely removed before release
struct RfuDebug
{
@@ -1643,7 +1643,7 @@ bool32 RfuTryDisconnectLeavingChildren(void)
{
u8 childrenLeaving = 0;
s32 i;
// Check all children, get those waiting to be disconnected
for (i = 0; i < RFU_CHILD_MAX; i++)
{
@@ -2123,7 +2123,7 @@ void SetUnionRoomChatPlayerData(u32 numPlayers)
// Only trainerId is shifted by the number of children, so the active flag and gender
// are only ever set for the first child
partnerInfo |= ((PINFO_ACTIVE_FLAG
| ((gLinkPlayers[gRfu.linkPlayerIdx[i]].gender & 1) << PINFO_GENDER_SHIFT)
| ((gLinkPlayers[gRfu.linkPlayerIdx[i]].gender & 1) << PINFO_GENDER_SHIFT)
| (gLinkPlayers[gRfu.linkPlayerIdx[i]].trainerId & PINFO_TID_MASK)) << (numConnectedChildren * 8));
numConnectedChildren++;
if (numConnectedChildren == numPlayers - 1)
@@ -2477,7 +2477,7 @@ static void LinkManagerCB_UnionRoom(u8 msg, u8 paramCount)
rfu_LMAN_stopManager(FALSE);
}
if (gRfuLinkStatus->parentChild == MODE_NEUTRAL
if (gRfuLinkStatus->parentChild == MODE_NEUTRAL
&& !lman.pcswitch_flag
&& FuncIsActiveTask(Task_UnionRoomListen) == TRUE)
gRfu.state = RFUSTATE_UR_CONNECT;
@@ -2816,7 +2816,7 @@ static bool32 IsPartnerActivityIncompatible(s16 activity, struct RfuGameData *pa
}
else if (activity == (ACTIVITY_TRADE | IN_UNION_ROOM))
{
// Verify that the trade offered hasn't changed
// Verify that the trade offered hasn't changed
struct RfuGameData *original = &gRfu.parent;
if (original->tradeSpecies == SPECIES_EGG)
{

View File

@@ -824,7 +824,7 @@ void UpdateWirelessStatusIndicatorSprite(void)
struct Sprite *sprite = &gSprites[gWirelessStatusIndicatorSpriteId];
u8 signalStrength = RFU_LINK_ICON_LEVEL4_MAX;
u8 i = 0;
// Get weakest signal strength
if (gRfuLinkStatus->parentChild == MODE_PARENT)
{

View File

@@ -795,7 +795,7 @@ u8 MetatileBehavior_GetBridgeType(u8 metatileBehavior)
&& metatileBehavior <= MB_BRIDGE_OVER_POND_HIGH)
return metatileBehavior - MB_BRIDGE_OVER_OCEAN;
if (metatileBehavior >= MB_BRIDGE_OVER_POND_MED_EDGE_1
if (metatileBehavior >= MB_BRIDGE_OVER_POND_MED_EDGE_1
&& metatileBehavior <= MB_BRIDGE_OVER_POND_MED_EDGE_2)
return BRIDGE_TYPE_POND_MED;

View File

@@ -171,8 +171,8 @@ static bool32 ValidateWonderCard(const struct WonderCard *card)
return FALSE;
if (card->type >= CARD_TYPE_COUNT)
return FALSE;
if (!(card->sendType == SEND_TYPE_DISALLOWED
|| card->sendType == SEND_TYPE_ALLOWED
if (!(card->sendType == SEND_TYPE_DISALLOWED
|| card->sendType == SEND_TYPE_ALLOWED
|| card->sendType == SEND_TYPE_ALLOWED_ALWAYS))
return FALSE;
if (card->bgType >= NUM_WONDER_BGS)
@@ -429,7 +429,7 @@ u32 MysteryGift_CompareCardFlags(const u16 *flagId, const struct MysteryGiftLink
u32 MysteryGift_CheckStamps(const u16 *stamp, const struct MysteryGiftLinkGameData *data, const void *unused)
{
int stampsMissing = data->maxStamps - GetNumStampsInMetadata(&data->cardMetadata, data->maxStamps);
// Has full stamp card?
if (stampsMissing == 0)
return 1;
@@ -598,7 +598,7 @@ void MysteryGift_TryIncrementStat(u32 stat, u32 trainerId)
switch (stat)
{
case CARD_STAT_NUM_TRADES:
IncrementCardStatForNewTrainer(CARD_STAT_NUM_TRADES,
IncrementCardStatForNewTrainer(CARD_STAT_NUM_TRADES,
trainerId,
gSaveBlock1Ptr->mysteryGift.trainerIds[1],
ARRAY_COUNT(gSaveBlock1Ptr->mysteryGift.trainerIds[1]));

View File

@@ -1240,7 +1240,7 @@ static void Task_MysteryGift(u8 taskId)
}
else if (gSpecialVar_Result == LINKUP_FAILED)
{
// Link failed, return to link start menu
// Link failed, return to link start menu
ClearScreenInBg0(TRUE);
data->state = MG_STATE_SOURCE_PROMPT;
}

View File

@@ -340,7 +340,7 @@ static void BufferCardText(void)
if (sWonderCardData->card.idNumber > 999999)
sWonderCardData->card.idNumber = 999999;
ConvertIntToDecimalStringN(sWonderCardData->idNumberText, sWonderCardData->card.idNumber, STR_CONV_MODE_LEFT_ALIGN, 6);
// Copy body text
for (i = 0; i < WONDER_CARD_BODY_TEXT_LINES; i++)
{
@@ -364,12 +364,12 @@ static void BufferCardText(void)
break;
case CARD_TYPE_LINK_STAT:
sWonderCardData->giftText[0] = EOS;
// Load stats
stats[0] = sWonderCardData->cardMetadata.battlesWon < MAX_WONDER_CARD_STAT ? sWonderCardData->cardMetadata.battlesWon : MAX_WONDER_CARD_STAT;
stats[1] = sWonderCardData->cardMetadata.battlesLost < MAX_WONDER_CARD_STAT ? sWonderCardData->cardMetadata.battlesLost : MAX_WONDER_CARD_STAT;
stats[2] = sWonderCardData->cardMetadata.numTrades < MAX_WONDER_CARD_STAT ? sWonderCardData->cardMetadata.numTrades : MAX_WONDER_CARD_STAT;
// Init stat text arrays
for (i = 0; i < ARRAY_COUNT(sWonderCardData->statTextData); i++)
{
@@ -446,7 +446,7 @@ static void DrawCardWindow(u8 whichWindow)
sCard_FooterTextOffsets[sWonderCardData->card.type],
sCard_TextColorTable[sWonderCardData->gfx->footerTextPal],
0, sWonderCardData->footerLine1Text);
// Print footer line 2
if (sWonderCardData->card.type != CARD_TYPE_LINK_STAT)
{
@@ -486,7 +486,7 @@ static void CreateCardSprites(void)
{
u8 i = 0;
sWonderCardData->monIconSpriteId = SPRITE_NONE;
// Create icon sprite
if (sWonderCardData->cardMetadata.iconSpecies != SPECIES_NONE)
{
@@ -505,7 +505,7 @@ static void CreateCardSprites(void)
sWonderCardData->stampSpriteIds[i][1] = SPRITE_NONE;
sWonderCardData->stampSpriteIds[i][0] = CreateSprite(&sSpriteTemplate_StampShadow, 216 - 32 * i, 144, 8);
if (sWonderCardData->cardMetadata.stampData[STAMP_SPECIES][i] != SPECIES_NONE)
sWonderCardData->stampSpriteIds[i][1] = CreateMonIconNoPersonality(GetIconSpeciesNoPersonality(sWonderCardData->cardMetadata.stampData[STAMP_SPECIES][i]),
sWonderCardData->stampSpriteIds[i][1] = CreateMonIconNoPersonality(GetIconSpeciesNoPersonality(sWonderCardData->cardMetadata.stampData[STAMP_SPECIES][i]),
SpriteCallbackDummy,
216 - 32 * i,
136, 0, 0);
@@ -520,7 +520,7 @@ static void DestroyCardSprites(void)
// Destroy icon sprite
if (sWonderCardData->monIconSpriteId != SPRITE_NONE)
FreeAndDestroyMonIconSprite(&gSprites[sWonderCardData->monIconSpriteId]);
// Destroy stamp sprites
if (sWonderCardData->card.maxStamps != 0 && sWonderCardData->card.type == CARD_TYPE_STAMP)
{
@@ -865,7 +865,7 @@ u32 WonderNews_GetInput(u16 input)
static void BufferNewsText(void)
{
u8 i = 0;
// Copy title text
memcpy(sWonderNewsData->titleText, sWonderNewsData->news.titleText, WONDER_NEWS_TEXT_LENGTH);
sWonderNewsData->titleText[WONDER_NEWS_TEXT_LENGTH] = EOS;
@@ -896,7 +896,7 @@ static void DrawNewsWindows(void)
if (x < 0)
x = 0;
AddTextPrinterParameterized3(sWonderNewsData->windowIds[NEWS_WIN_TITLE], FONT_SHORT_COPY_1, x, 6, sNews_TextColorTable[sWonderNewsData->gfx->titleTextPal], 0, sWonderNewsData->titleText);
// Print body text
for (; i < WONDER_NEWS_BODY_TEXT_LINES; i++)
AddTextPrinterParameterized3(sWonderNewsData->windowIds[NEWS_WIN_BODY], FONT_SHORT_COPY_1, 0,

View File

@@ -560,7 +560,7 @@ static void DoAreaGlow(void)
if (sPokedexAreaScreen->markerTimer > 12)
{
sPokedexAreaScreen->markerTimer = 0;
// Flash the marker
// With a max of 4, the marker will disappear twice
sPokedexAreaScreen->markerFlashCounter++;
@@ -737,7 +737,7 @@ static void CreateAreaMarkerSprites(void)
static void DestroyAreaScreenSprites(void)
{
u16 i;
// Destroy area marker sprites
FreeSpriteTilesByTag(TAG_AREA_MARKER);
FreeSpritePaletteByTag(TAG_AREA_MARKER);
@@ -772,7 +772,7 @@ static void CreateAreaUnknownSprites(void)
if (sPokedexAreaScreen->numOverworldAreas || sPokedexAreaScreen->numSpecialAreas)
{
// The current species is present on the map, don't create any "Area Unknown" sprites
// The current species is present on the map, don't create any "Area Unknown" sprites
for (i = 0; i < ARRAY_COUNT(sPokedexAreaScreen->areaUnknownSprites); i++)
sPokedexAreaScreen->areaUnknownSprites[i] = NULL;
}

View File

@@ -1848,7 +1848,7 @@ static const u8 sMonAnimationDelayTable[NUM_SPECIES - 1] =
#define PP_UP_SHIFTS_INV(val) (u8)~(val), (u8)~((val) << 2), (u8)~((val) << 4), (u8)~((val) << 6)
// PP Up bonuses are stored for a Pokémon as a single byte.
// There are 2 bits (a value 0-3) for each move slot that
// There are 2 bits (a value 0-3) for each move slot that
// represent how many PP Ups have been applied.
// The following arrays take a move slot id and return:
// gPPUpGetMask - A mask to get the number of PP Ups applied to that move slot
@@ -3119,7 +3119,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
spAttack = attacker->spAttack;
spDefense = defender->spDefense;
// Get attacker hold item info
// Get attacker hold item info
if (attacker->item == ITEM_ENIGMA_BERRY)
{
attackerHoldEffect = gEnigmaBerries[battlerIdAtk].holdEffect;
@@ -5204,7 +5204,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
case 4: // ITEM5_PP_MAX
dataUnsigned = (GetMonData(mon, MON_DATA_PP_BONUSES, NULL) & gPPUpGetMask[moveIndex]) >> (moveIndex * 2);
temp2 = CalculatePPWithBonus(GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL), GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex);
// Check if 3 PP Ups have been applied already, and that the move has a total PP of at least 5 (excludes Sketch)
if (dataUnsigned < 3 && temp2 >= 5)
{
@@ -6918,7 +6918,7 @@ static bool8 ShouldSkipFriendshipChange(void)
// Only the 'default' mode (MON_SPR_GFX_MODE_NORMAL) is used, which is set
// up to allocate 4 sprites using the battler sprite templates (gBattlerSpriteTemplates).
// MON_SPR_GFX_MODE_BATTLE is identical but never used.
// MON_SPR_GFX_MODE_FULL_PARTY is set up to allocate 7 sprites (party + trainer?)
// MON_SPR_GFX_MODE_FULL_PARTY is set up to allocate 7 sprites (party + trainer?)
// using a generic 64x64 template, and is also never used.
// Between the unnecessarily large sizes below, a mistake allocating the spritePointers
@@ -6980,7 +6980,7 @@ struct MonSpritesGfxManager *CreateMonSpritesGfxManager(u8 managerId, u8 mode)
gfx->dataSize = 1;
gfx->mode = MON_SPR_GFX_MODE_FULL_PARTY;
break;
// case MON_SPR_GFX_MODE_BATTLE:
// case MON_SPR_GFX_MODE_BATTLE:
case MON_SPR_GFX_MODE_NORMAL:
default:
gfx->numSprites = MAX_BATTLERS_COUNT;

View File

@@ -3879,7 +3879,7 @@ static u8 LoadMonGfxAndSprite(struct Pokemon *mon, s16 *state)
summary->species2,
summary->pid);
else
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2],
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2],
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
summary->species2,
summary->pid);
@@ -3891,7 +3891,7 @@ static u8 LoadMonGfxAndSprite(struct Pokemon *mon, s16 *state)
if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == SUMMARY_MODE_BOX || sMonSummaryScreen->unk40EF == TRUE)
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2],
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
summary->species2,
summary->species2,
summary->pid);
else
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2],

View File

@@ -904,7 +904,7 @@ static void StartOptionAnimations_Enter(void)
// Not selected, set default position
x = OPTION_DEFAULT_X;
}
// Slide new options in
StartOptionSlide(gfx->iconSprites[i], OPTION_EXIT_X, x, 12);
SetOptionInvisibility(gfx->iconSprites[i], FALSE);

View File

@@ -879,7 +879,7 @@ static void ReceiveDaycareMailData(struct RecordMixingDaycareMail *records, size
for (i = 0; i < linkPlayerCount; i++)
{
mixMail = (void *)records + i * recordSize;
// Count number of players that have at least
// one daycare Pokémon with no held item
if (canHoldItem[i][0] == TRUE || canHoldItem[i][1] == TRUE)
@@ -945,7 +945,7 @@ static void ReceiveDaycareMailData(struct RecordMixingDaycareMail *records, size
case 4:
// 4 players can swap, select which 2 pairings will swap
ptr = idxs;
// Swap pair 1
playerSlot1 = sDaycareMailSwapIds_4Player[tableId][0];
playerSlot2 = sDaycareMailSwapIds_4Player[tableId][1];

View File

@@ -127,7 +127,7 @@ void UpdateLocationHistoryForRoamer(void)
void RoamerMoveToOtherLocationSet(void)
{
u8 mapNum = 0;
if (!ROAMER->active)
return;
@@ -170,8 +170,8 @@ void RoamerMove(void)
// Choose a new map (excluding the first) within this set
// Also exclude a map if the roamer was there 2 moves ago
mapNum = sRoamerLocations[locSet][(Random() % (NUM_LOCATIONS_PER_SET - 1)) + 1];
if (!(sLocationHistory[2][MAP_GRP] == ROAMER_MAP_GROUP
&& sLocationHistory[2][MAP_NUM] == mapNum)
if (!(sLocationHistory[2][MAP_GRP] == ROAMER_MAP_GROUP
&& sLocationHistory[2][MAP_NUM] == mapNum)
&& mapNum != MAP_NUM(UNDEFINED))
break;
}

View File

@@ -1,5 +1,5 @@
@ Note: ROM header data is empty space here.
@ It's populated by gbafix using data provided in the Makefile.
@ It's populated by gbafix using data provided in the Makefile.
.global Start
Start:

View File

@@ -913,7 +913,7 @@ u16 GetSaveBlocksPointersBaseOffset(void)
for (i = 0; i < NUM_SECTORS_PER_SLOT; i++)
{
ReadFlashSector(i + slotOffset, gReadWriteSector);
// Base offset for SaveBlock2 is calculated using the trainer id
if (gReadWriteSector->id == SECTOR_ID_SAVEBLOCK2)
return sector->data[offsetof(struct SaveBlock2, playerTrainerId[0])] +

View File

@@ -213,9 +213,9 @@ void ScriptContext_Init(void)
sGlobalScriptContextStatus = CONTEXT_SHUTDOWN;
}
// Runs the script until the script makes a wait* call, then returns true if
// there's more script to run, or false if the script has hit the end.
// This function also returns false if the context is finished
// Runs the script until the script makes a wait* call, then returns true if
// there's more script to run, or false if the script has hit the end.
// This function also returns false if the context is finished
// or waiting (after a call to _Stop)
bool8 ScriptContext_RunScript(void)
{

View File

@@ -1880,7 +1880,7 @@ static u8 TrySelectBias_Regular(void)
{
s16 rval = Random() & 0xff;
s16 value = sBiasProbabilities_Regular[whichBias][sSlotMachine->machineId];
// Boost odds of BIAS_POWER if it's a lucky game.
if (whichBias == 0 && sSlotMachine->luckyGame == TRUE)
{
@@ -3668,7 +3668,7 @@ static void ReelTime_CheckExplode(struct Task *task)
if (sSlotMachine->reelTimeDraw)
{
if (sSlotMachine->reelTimeSpinsLeft <= task->tExplodeChecks)
task->tState++; // RT_TASK_LAND
task->tState++; // RT_TASK_LAND
}
else if (task->tExplodeChecks > 3)
{
@@ -5309,7 +5309,7 @@ static const u8 sSpecialDrawOdds[NUM_SLOT_MACHINE_IDS][MAX_BET] = {
};
static const u8 sBiasProbabilities_Special[][NUM_SLOT_MACHINE_IDS] = {
{
{
// Probabilities for BIAS_STRAIGHT_7
[SLOT_MACHINE_UNLUCKIEST] = 25,
[SLOT_MACHINE_UNLUCKIER] = 25,
@@ -5318,7 +5318,7 @@ static const u8 sBiasProbabilities_Special[][NUM_SLOT_MACHINE_IDS] = {
[SLOT_MACHINE_LUCKIER] = 40,
[SLOT_MACHINE_LUCKIEST] = 50
},
{
{
// Probabilities for BIAS_REELTIME
[SLOT_MACHINE_UNLUCKIEST] = 25,
[SLOT_MACHINE_UNLUCKIER] = 25,
@@ -5327,7 +5327,7 @@ static const u8 sBiasProbabilities_Special[][NUM_SLOT_MACHINE_IDS] = {
[SLOT_MACHINE_LUCKIER] = 35,
[SLOT_MACHINE_LUCKIEST] = 35
},
{
{
// Probabilities for BIAS_MIXED_7
[SLOT_MACHINE_UNLUCKIEST] = 25,
[SLOT_MACHINE_UNLUCKIER] = 25,
@@ -5339,7 +5339,7 @@ static const u8 sBiasProbabilities_Special[][NUM_SLOT_MACHINE_IDS] = {
};
static const u8 sBiasProbabilities_Regular[][NUM_SLOT_MACHINE_IDS] = {
{
{
// Probabilities for BIAS_POWER
[SLOT_MACHINE_UNLUCKIEST] = 20,
[SLOT_MACHINE_UNLUCKIER] = 25,
@@ -5348,7 +5348,7 @@ static const u8 sBiasProbabilities_Regular[][NUM_SLOT_MACHINE_IDS] = {
[SLOT_MACHINE_LUCKIER] = 25,
[SLOT_MACHINE_LUCKIEST] = 25
},
{
{
// Probabilities for BIAS_AZURILL
[SLOT_MACHINE_UNLUCKIEST] = 12,
[SLOT_MACHINE_UNLUCKIER] = 15,
@@ -5357,7 +5357,7 @@ static const u8 sBiasProbabilities_Regular[][NUM_SLOT_MACHINE_IDS] = {
[SLOT_MACHINE_LUCKIER] = 19,
[SLOT_MACHINE_LUCKIEST] = 22
},
{
{
// Probabilities for BIAS_LOTAD
[SLOT_MACHINE_UNLUCKIEST] = 25,
[SLOT_MACHINE_UNLUCKIER] = 25,
@@ -5366,7 +5366,7 @@ static const u8 sBiasProbabilities_Regular[][NUM_SLOT_MACHINE_IDS] = {
[SLOT_MACHINE_LUCKIER] = 30,
[SLOT_MACHINE_LUCKIEST] = 40
},
{
{
// Probabilities for BIAS_CHERRY
[SLOT_MACHINE_UNLUCKIEST] = 25,
[SLOT_MACHINE_UNLUCKIER] = 25,
@@ -5375,7 +5375,7 @@ static const u8 sBiasProbabilities_Regular[][NUM_SLOT_MACHINE_IDS] = {
[SLOT_MACHINE_LUCKIER] = 15,
[SLOT_MACHINE_LUCKIEST] = 15
},
{
{
// Probabilities for BIAS_REPLAY
[SLOT_MACHINE_UNLUCKIEST] = 40,
[SLOT_MACHINE_UNLUCKIER] = 40,

View File

@@ -377,7 +377,7 @@ void PlayCryInternal(u16 species, s8 pan, s8 volume, u8 priority, u8 mode)
u8 table;
species--;
// Set default values
// May be overridden depending on mode.
length = 140;

View File

@@ -2465,7 +2465,7 @@ int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct Rf
else
{
// Player's Pokémon must be of the type the partner requested
if (gBaseStats[playerSpecies2].type1 != requestedType
if (gBaseStats[playerSpecies2].type1 != requestedType
&& gBaseStats[playerSpecies2].type2 != requestedType)
return UR_TRADE_MSG_NOT_MON_PARTNER_WANTS;
}

View File

@@ -2058,7 +2058,7 @@ static void SecretBaseVisit_CalculatePartyData(TVShow *show)
{
sTV_SecretBaseVisitMonsTemp[numPokemon].level = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL);
sTV_SecretBaseVisitMonsTemp[numPokemon].species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES);
// Check all the Pokémon's moves, then randomly select one to save
numMoves = 0;
move = GetMonData(&gPlayerParty[i], MON_DATA_MOVE1);
@@ -2093,7 +2093,7 @@ static void SecretBaseVisit_CalculatePartyData(TVShow *show)
for (i = 0, sum = 0; i < numPokemon; i++)
sum += sTV_SecretBaseVisitMonsTemp[i].level;
// Using the data calculated above, save the data to talk about on the show
// Using the data calculated above, save the data to talk about on the show
// (average level, and one randomly selected species / move)
show->secretBaseVisit.avgLevel = sum / numPokemon;
j = Random() % numPokemon;
@@ -2643,7 +2643,7 @@ void DoPokeNews(void)
// News event is upcoming, make comment about countdown to event
u16 dayCountdown = gSaveBlock1Ptr->pokeNews[i].dayCountdown;
ConvertIntToDecimalStringN(gStringVar1, dayCountdown, STR_CONV_MODE_LEFT_ALIGN, 1);
// Mark as inactive so the countdown TV airing doesn't repeat
// Will be flagged as "upcoming" again by UpdatePokeNewsCountdown
gSaveBlock1Ptr->pokeNews[i].state = POKENEWS_STATE_INACTIVE;
@@ -2848,7 +2848,7 @@ static bool8 IsRecordMixShowAlreadySpawned(u8 kind, bool8 delete)
static void SortPurchasesByQuantity(void)
{
u8 i, j;
for (i = 0; i < SMARTSHOPPER_NUM_ITEMS - 1; i++)
{
for (j = i + 1; j < SMARTSHOPPER_NUM_ITEMS; j++)

View File

@@ -569,7 +569,7 @@ bool32 TryInteractWithUnionRoomMember(struct RfuPlayerList *list, s16 *memberIdP
for (memberId = 0; memberId < MAX_RFU_PLAYERS; memberId++)
{
s32 id = UR_PLAYER_SPRITE_ID(i, memberId);
// Is the player in front of a group member position?
if (x != sUnionRoomPlayerCoords[i][0] + sUnionRoomGroupOffsets[memberId][0] + 7)
continue;

View File

@@ -174,7 +174,7 @@ static bool32 TryCalculateWallpaper(u16 *backgroundClr, u16 *foregroundClr, u8 *
if (GetWallpaperDataBits(data, 0, 3) != GetWallpaperDataBits(charsByTableId, TO_BIT_OFFSET(WALDA_PHRASE_LENGTH - 1) + 2, 3))
return FALSE;
// Perform some relatively arbitrary changes to the wallpaper data using the last byte (KEY)
// Perform some relatively arbitrary changes to the wallpaper data using the last byte (KEY)
RotateWallpaperDataLeft(data, NUM_WALLPAPER_DATA_BYTES, 21);
RotateWallpaperDataLeft(data, NUM_WALLPAPER_DATA_BYTES - 1, KEY & 0xF);
MaskWallpaperData(data, NUM_WALLPAPER_DATA_BYTES - 1, KEY >> 4);

View File

@@ -64,7 +64,7 @@ static const struct WildPokemon sWildFeebas = {20, 25, SPECIES_FEEBAS};
static const u16 sRoute119WaterTileData[] =
{
//yMin, yMax, numSpots in previous sections
//yMin, yMax, numSpots in previous sections
0, 45, 0,
46, 91, NUM_FISHING_SPOTS_1,
92, 139, NUM_FISHING_SPOTS_1 + NUM_FISHING_SPOTS_2,
@@ -142,7 +142,7 @@ static bool8 CheckFeebas(void)
feebasSpots[i] = FeebasRandom() % NUM_FISHING_SPOTS;
if (feebasSpots[i] == 0)
feebasSpots[i] = NUM_FISHING_SPOTS;
// < 1 below is a pointless check, it will never be TRUE.
// >= 4 to skip fishing spots 1-3, because these are inaccessible
// spots at the top of the map, at (9,7), (7,13), and (15,16).

View File

@@ -76,7 +76,7 @@ u16 RetrieveWonderNewsVal(void)
struct WonderNewsMetadata *data = GetSavedWonderNewsMetadata();
u16 newsVal;
// Checks if Mystery Event is enabled, not Mystery Gift?
// Checks if Mystery Event is enabled, not Mystery Gift?
if (!IsMysteryEventEnabled() || !ValidateSavedWonderNews())
return 0;