mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-27 04:04:17 +01:00
Cleanup from https://github.com/pret/pokefirered/pull/532
This commit is contained in:
parent
aa9ccbf194
commit
4b08a511c3
@ -301,7 +301,7 @@ bool16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u8 speed, voi
|
|||||||
sTempTextPrinter.textSpeed = 0;
|
sTempTextPrinter.textSpeed = 0;
|
||||||
|
|
||||||
// Render all text (up to limit) at once
|
// Render all text (up to limit) at once
|
||||||
for (j = 0; j < 0x400; ++j)
|
for (j = 0; j < 0x400; j++)
|
||||||
{
|
{
|
||||||
if (RenderFont(&sTempTextPrinter) == RENDER_FINISH)
|
if (RenderFont(&sTempTextPrinter) == RENDER_FINISH)
|
||||||
break;
|
break;
|
||||||
@ -322,7 +322,7 @@ void RunTextPrinters(void)
|
|||||||
|
|
||||||
if (!gDisableTextPrinters)
|
if (!gDisableTextPrinters)
|
||||||
{
|
{
|
||||||
for (i = 0; i < NUM_TEXT_PRINTERS; ++i)
|
for (i = 0; i < NUM_TEXT_PRINTERS; i++)
|
||||||
{
|
{
|
||||||
if (sTextPrinters[i].active)
|
if (sTextPrinters[i].active)
|
||||||
{
|
{
|
||||||
@ -1318,7 +1318,7 @@ static u32 (*GetFontWidthFunc(u8 fontId))(u16, bool32)
|
|||||||
{
|
{
|
||||||
u32 i;
|
u32 i;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_COUNT(sGlyphWidthFuncs); ++i)
|
for (i = 0; i < ARRAY_COUNT(sGlyphWidthFuncs); i++)
|
||||||
{
|
{
|
||||||
if (fontId == sGlyphWidthFuncs[i].fontId)
|
if (fontId == sGlyphWidthFuncs[i].fontId)
|
||||||
return sGlyphWidthFuncs[i].func;
|
return sGlyphWidthFuncs[i].func;
|
||||||
|
@ -38,7 +38,7 @@ bool16 InitWindows(const struct WindowTemplate *templates)
|
|||||||
u8 *allocatedTilemapBuffer;
|
u8 *allocatedTilemapBuffer;
|
||||||
int allocatedBaseBlock;
|
int allocatedBaseBlock;
|
||||||
|
|
||||||
for (i = 0; i < NUM_BACKGROUNDS; ++i)
|
for (i = 0; i < NUM_BACKGROUNDS; i++)
|
||||||
{
|
{
|
||||||
bgTilemapBuffer = GetBgTilemapBuffer(i);
|
bgTilemapBuffer = GetBgTilemapBuffer(i);
|
||||||
if (bgTilemapBuffer != NULL)
|
if (bgTilemapBuffer != NULL)
|
||||||
@ -47,7 +47,7 @@ bool16 InitWindows(const struct WindowTemplate *templates)
|
|||||||
gWindowBgTilemapBuffers[i] = bgTilemapBuffer;
|
gWindowBgTilemapBuffers[i] = bgTilemapBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < WINDOWS_MAX; ++i)
|
for (i = 0; i < WINDOWS_MAX; i++)
|
||||||
{
|
{
|
||||||
gWindows[i].window = sDummyWindowTemplate;
|
gWindows[i].window = sDummyWindowTemplate;
|
||||||
gWindows[i].tileData = NULL;
|
gWindows[i].tileData = NULL;
|
||||||
@ -76,7 +76,7 @@ bool16 InitWindows(const struct WindowTemplate *templates)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (j = 0; j < attrib; ++j)
|
for (j = 0; j < attrib; j++)
|
||||||
allocatedTilemapBuffer[j] = 0;
|
allocatedTilemapBuffer[j] = 0;
|
||||||
|
|
||||||
gWindowBgTilemapBuffers[bgLayer] = allocatedTilemapBuffer;
|
gWindowBgTilemapBuffers[bgLayer] = allocatedTilemapBuffer;
|
||||||
@ -151,7 +151,7 @@ u16 AddWindow(const struct WindowTemplate *template)
|
|||||||
if (allocatedTilemapBuffer == NULL)
|
if (allocatedTilemapBuffer == NULL)
|
||||||
return WINDOW_NONE;
|
return WINDOW_NONE;
|
||||||
|
|
||||||
for (i = 0; i < attrib; ++i)
|
for (i = 0; i < attrib; i++)
|
||||||
allocatedTilemapBuffer[i] = 0;
|
allocatedTilemapBuffer[i] = 0;
|
||||||
|
|
||||||
gWindowBgTilemapBuffers[bgLayer] = allocatedTilemapBuffer;
|
gWindowBgTilemapBuffers[bgLayer] = allocatedTilemapBuffer;
|
||||||
@ -249,7 +249,7 @@ void FreeAllWindowBuffers(void)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < NUM_BACKGROUNDS; ++i)
|
for (i = 0; i < NUM_BACKGROUNDS; i++)
|
||||||
{
|
{
|
||||||
if (gWindowBgTilemapBuffers[i] != NULL && gWindowBgTilemapBuffers[i] != DummyWindowBgTilemap)
|
if (gWindowBgTilemapBuffers[i] != NULL && gWindowBgTilemapBuffers[i] != DummyWindowBgTilemap)
|
||||||
{
|
{
|
||||||
@ -258,7 +258,7 @@ void FreeAllWindowBuffers(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < WINDOWS_MAX; ++i)
|
for (i = 0; i < WINDOWS_MAX; i++)
|
||||||
{
|
{
|
||||||
if (gWindows[i].tileData != NULL)
|
if (gWindows[i].tileData != NULL)
|
||||||
{
|
{
|
||||||
@ -342,7 +342,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);
|
u16 currentRow = windowLocal.window.baseBlock + (y * windowLocal.window.width) + x + GetBgAttribute(windowLocal.window.bg, BG_ATTR_BASETILE);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < height; ++i)
|
for (i = 0; i < height; i++)
|
||||||
{
|
{
|
||||||
WriteSequenceToBgTilemapBuffer(
|
WriteSequenceToBgTilemapBuffer(
|
||||||
windowLocal.window.bg,
|
windowLocal.window.bg,
|
||||||
@ -379,7 +379,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);
|
u16 currentRow = windowLocal.window.baseBlock + (y * windowLocal.window.width) + x + GetBgAttribute(windowLocal.window.bg, BG_ATTR_BASETILE);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < height; ++i)
|
for (i = 0; i < height; i++)
|
||||||
{
|
{
|
||||||
WriteSequenceToBgTilemapBuffer(
|
WriteSequenceToBgTilemapBuffer(
|
||||||
windowLocal.window.bg,
|
windowLocal.window.bg,
|
||||||
|
@ -50,11 +50,11 @@ void SpriteCB_VsLetterInit(struct Sprite *sprite);
|
|||||||
void CB2_InitEndLinkBattle(void);
|
void CB2_InitEndLinkBattle(void);
|
||||||
u32 GetBattleBgTemplateData(u8 arrayId, u8 caseId);
|
u32 GetBattleBgTemplateData(u8 arrayId, u8 caseId);
|
||||||
u32 GetBattleWindowTemplatePixelWidth(u32 setId, u32 tableId);
|
u32 GetBattleWindowTemplatePixelWidth(u32 setId, u32 tableId);
|
||||||
void SpriteCb_WildMon(struct Sprite *sprite);
|
void SpriteCB_WildMon(struct Sprite *sprite);
|
||||||
void SpriteCallbackDummy_2(struct Sprite *sprite);
|
void SpriteCallbackDummy_2(struct Sprite *sprite);
|
||||||
void SpriteCB_FaintOpponentMon(struct Sprite *sprite);
|
void SpriteCB_FaintOpponentMon(struct Sprite *sprite);
|
||||||
void SpriteCb_ShowAsMoveTarget(struct Sprite *sprite);
|
void SpriteCB_ShowAsMoveTarget(struct Sprite *sprite);
|
||||||
void SpriteCb_HideAsMoveTarget(struct Sprite *sprite);
|
void SpriteCB_HideAsMoveTarget(struct Sprite *sprite);
|
||||||
void SpriteCB_OpponentMonFromBall(struct Sprite *sprite);
|
void SpriteCB_OpponentMonFromBall(struct Sprite *sprite);
|
||||||
void SpriteCB_BattleSpriteStartSlideLeft(struct Sprite *sprite);
|
void SpriteCB_BattleSpriteStartSlideLeft(struct Sprite *sprite);
|
||||||
void SpriteCB_FaintSlideAnim(struct Sprite *sprite);
|
void SpriteCB_FaintSlideAnim(struct Sprite *sprite);
|
||||||
|
@ -64,7 +64,6 @@ u8 GetBattlerForBattleScript(u8 caseId);
|
|||||||
void PressurePPLose(u8 target, u8 attacker, u16 move);
|
void PressurePPLose(u8 target, u8 attacker, u16 move);
|
||||||
void PressurePPLoseOnUsingPerishSong(u8 attacker);
|
void PressurePPLoseOnUsingPerishSong(u8 attacker);
|
||||||
void PressurePPLoseOnUsingImprison(u8 attacker);
|
void PressurePPLoseOnUsingImprison(u8 attacker);
|
||||||
void MarkAllBattlersForControllerExec(void); // unused
|
|
||||||
void MarkBattlerForControllerExec(u8 battlerId);
|
void MarkBattlerForControllerExec(u8 battlerId);
|
||||||
void MarkBattlerReceivedLinkData(u8 battlerId);
|
void MarkBattlerReceivedLinkData(u8 battlerId);
|
||||||
void CancelMultiTurnMoves(u8 battlerId);
|
void CancelMultiTurnMoves(u8 battlerId);
|
||||||
|
@ -316,6 +316,11 @@
|
|||||||
#define FLEE_ITEM 1
|
#define FLEE_ITEM 1
|
||||||
#define FLEE_ABILITY 2
|
#define FLEE_ABILITY 2
|
||||||
|
|
||||||
|
// Return value for IsRunningFromBattleImpossible.
|
||||||
|
#define BATTLE_RUN_SUCCESS 0
|
||||||
|
#define BATTLE_RUN_FORBIDDEN 1
|
||||||
|
#define BATTLE_RUN_FAILURE 2
|
||||||
|
|
||||||
#define B_WIN_TYPE_NORMAL 0
|
#define B_WIN_TYPE_NORMAL 0
|
||||||
#define B_WIN_TYPE_ARENA 1
|
#define B_WIN_TYPE_ARENA 1
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ static void SaveArenaChallenge(void);
|
|||||||
static void SetArenaPrize(void);
|
static void SetArenaPrize(void);
|
||||||
static void GiveArenaPrize(void);
|
static void GiveArenaPrize(void);
|
||||||
static void BufferArenaOpponentName(void);
|
static void BufferArenaOpponentName(void);
|
||||||
static void SpriteCb_JudgmentIcon(struct Sprite *sprite);
|
static void SpriteCB_JudgmentIcon(struct Sprite *sprite);
|
||||||
static void ShowJudgmentSprite(u8 x, u8 y, u8 category, u8 battler);
|
static void ShowJudgmentSprite(u8 x, u8 y, u8 category, u8 battler);
|
||||||
|
|
||||||
static const s8 sMindRatings[] =
|
static const s8 sMindRatings[] =
|
||||||
@ -456,7 +456,7 @@ static const struct SpriteTemplate sSpriteTemplate_JudgmentIcon =
|
|||||||
.anims = sJudgementIconAnimCmds,
|
.anims = sJudgementIconAnimCmds,
|
||||||
.images = NULL,
|
.images = NULL,
|
||||||
.affineAnims = gDummySpriteAffineAnimTable,
|
.affineAnims = gDummySpriteAffineAnimTable,
|
||||||
.callback = SpriteCb_JudgmentIcon,
|
.callback = SpriteCB_JudgmentIcon,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct CompressedSpriteSheet sBattleArenaJudgementSymbolsSpriteSheet[] =
|
static const struct CompressedSpriteSheet sBattleArenaJudgementSymbolsSpriteSheet[] =
|
||||||
@ -679,7 +679,7 @@ static void ShowJudgmentSprite(u8 x, u8 y, u8 category, u8 battler)
|
|||||||
StartSpriteAnim(&gSprites[pointsPlayer], animNum);
|
StartSpriteAnim(&gSprites[pointsPlayer], animNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpriteCb_JudgmentIcon(struct Sprite *sprite)
|
static void SpriteCB_JudgmentIcon(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
if (gBattleCommunication[0] > 8)
|
if (gBattleCommunication[0] > 8)
|
||||||
DestroySprite(sprite);
|
DestroySprite(sprite);
|
||||||
|
@ -364,7 +364,7 @@ static void HandleInputChooseTarget(void)
|
|||||||
if (JOY_NEW(A_BUTTON))
|
if (JOY_NEW(A_BUTTON))
|
||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
|
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
|
||||||
BtlController_EmitTwoReturnValues(BUFFER_B, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8));
|
BtlController_EmitTwoReturnValues(BUFFER_B, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8));
|
||||||
EndBounceEffect(gMultiUsePlayerCursor, BOUNCE_HEALTHBOX);
|
EndBounceEffect(gMultiUsePlayerCursor, BOUNCE_HEALTHBOX);
|
||||||
PlayerBufferExecCompleted();
|
PlayerBufferExecCompleted();
|
||||||
@ -372,7 +372,7 @@ static void HandleInputChooseTarget(void)
|
|||||||
else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59)
|
else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59)
|
||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
|
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
|
||||||
gBattlerControllerFuncs[gActiveBattler] = HandleInputChooseMove;
|
gBattlerControllerFuncs[gActiveBattler] = HandleInputChooseMove;
|
||||||
DoBounceEffect(gActiveBattler, BOUNCE_HEALTHBOX, 7, 1);
|
DoBounceEffect(gActiveBattler, BOUNCE_HEALTHBOX, 7, 1);
|
||||||
DoBounceEffect(gActiveBattler, BOUNCE_MON, 7, 1);
|
DoBounceEffect(gActiveBattler, BOUNCE_MON, 7, 1);
|
||||||
@ -381,7 +381,7 @@ static void HandleInputChooseTarget(void)
|
|||||||
else if (JOY_NEW(DPAD_LEFT | DPAD_UP))
|
else if (JOY_NEW(DPAD_LEFT | DPAD_UP))
|
||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
|
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@ -422,12 +422,12 @@ static void HandleInputChooseTarget(void)
|
|||||||
if (gAbsentBattlerFlags & gBitTable[gMultiUsePlayerCursor])
|
if (gAbsentBattlerFlags & gBitTable[gMultiUsePlayerCursor])
|
||||||
i = 0;
|
i = 0;
|
||||||
} while (i == 0);
|
} while (i == 0);
|
||||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_ShowAsMoveTarget;
|
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_ShowAsMoveTarget;
|
||||||
}
|
}
|
||||||
else if (JOY_NEW(DPAD_RIGHT | DPAD_DOWN))
|
else if (JOY_NEW(DPAD_RIGHT | DPAD_DOWN))
|
||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
|
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@ -464,7 +464,7 @@ static void HandleInputChooseTarget(void)
|
|||||||
if (gAbsentBattlerFlags & gBitTable[gMultiUsePlayerCursor])
|
if (gAbsentBattlerFlags & gBitTable[gMultiUsePlayerCursor])
|
||||||
i = 0;
|
i = 0;
|
||||||
} while (i == 0);
|
} while (i == 0);
|
||||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_ShowAsMoveTarget;
|
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_ShowAsMoveTarget;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -537,7 +537,7 @@ static void HandleInputChooseMove(void)
|
|||||||
else
|
else
|
||||||
gMultiUsePlayerCursor = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
|
gMultiUsePlayerCursor = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
|
||||||
|
|
||||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_ShowAsMoveTarget;
|
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_ShowAsMoveTarget;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59)
|
else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59)
|
||||||
|
@ -108,8 +108,8 @@ static u8 UpdateTourneyTreeCursor(u8);
|
|||||||
static void DecideRoundWinners(u8);
|
static void DecideRoundWinners(u8);
|
||||||
static u8 GetOpposingNPCTournamentIdByRound(u8, u8);
|
static u8 GetOpposingNPCTournamentIdByRound(u8, u8);
|
||||||
static void DrawTourneyAdvancementLine(u8, u8);
|
static void DrawTourneyAdvancementLine(u8, u8);
|
||||||
static void SpriteCb_HorizontalScrollArrow(struct Sprite *);
|
static void SpriteCB_HorizontalScrollArrow(struct Sprite *);
|
||||||
static void SpriteCb_VerticalScrollArrow(struct Sprite *);
|
static void SpriteCB_VerticalScrollArrow(struct Sprite *);
|
||||||
static void InitDomeChallenge(void);
|
static void InitDomeChallenge(void);
|
||||||
static void GetDomeData(void);
|
static void GetDomeData(void);
|
||||||
static void SetDomeData(void);
|
static void SetDomeData(void);
|
||||||
@ -1089,7 +1089,7 @@ static const struct SpriteTemplate sHorizontalScrollArrowSpriteTemplate =
|
|||||||
.anims = sSpriteAnimTable_HorizontalScrollArrow,
|
.anims = sSpriteAnimTable_HorizontalScrollArrow,
|
||||||
.images = NULL,
|
.images = NULL,
|
||||||
.affineAnims = gDummySpriteAffineAnimTable,
|
.affineAnims = gDummySpriteAffineAnimTable,
|
||||||
.callback = SpriteCb_HorizontalScrollArrow
|
.callback = SpriteCB_HorizontalScrollArrow
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct SpriteTemplate sVerticalScrollArrowSpriteTemplate =
|
static const struct SpriteTemplate sVerticalScrollArrowSpriteTemplate =
|
||||||
@ -1100,7 +1100,7 @@ static const struct SpriteTemplate sVerticalScrollArrowSpriteTemplate =
|
|||||||
.anims = sSpriteAnimTable_VerticalScrollArrow,
|
.anims = sSpriteAnimTable_VerticalScrollArrow,
|
||||||
.images = NULL,
|
.images = NULL,
|
||||||
.affineAnims = gDummySpriteAffineAnimTable,
|
.affineAnims = gDummySpriteAffineAnimTable,
|
||||||
.callback = SpriteCb_VerticalScrollArrow
|
.callback = SpriteCB_VerticalScrollArrow
|
||||||
};
|
};
|
||||||
|
|
||||||
// Organized by seed starting position, i.e. seed 0 battles seed 8 first
|
// Organized by seed starting position, i.e. seed 0 battles seed 8 first
|
||||||
@ -3115,7 +3115,7 @@ static void Task_ShowTourneyInfoCard(u8 taskId)
|
|||||||
// Note: Card scrolling up means the current card goes down and another one appears from top.
|
// Note: Card scrolling up means the current card goes down and another one appears from top.
|
||||||
// The same is true for scrolling left.
|
// The same is true for scrolling left.
|
||||||
// That means that the sprite needs to move with the moving card in the opposite scrolling direction.
|
// That means that the sprite needs to move with the moving card in the opposite scrolling direction.
|
||||||
static void SpriteCb_TrainerIconCardScrollUp(struct Sprite *sprite)
|
static void SpriteCB_TrainerIconCardScrollUp(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
sprite->y += 4;
|
sprite->y += 4;
|
||||||
if (sprite->data[0] != 0)
|
if (sprite->data[0] != 0)
|
||||||
@ -3135,7 +3135,7 @@ static void SpriteCb_TrainerIconCardScrollUp(struct Sprite *sprite)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpriteCb_TrainerIconCardScrollDown(struct Sprite *sprite)
|
static void SpriteCB_TrainerIconCardScrollDown(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
sprite->y -= 4;
|
sprite->y -= 4;
|
||||||
if (sprite->data[0] != 0)
|
if (sprite->data[0] != 0)
|
||||||
@ -3155,7 +3155,7 @@ static void SpriteCb_TrainerIconCardScrollDown(struct Sprite *sprite)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpriteCb_TrainerIconCardScrollLeft(struct Sprite *sprite)
|
static void SpriteCB_TrainerIconCardScrollLeft(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
sprite->x += 4;
|
sprite->x += 4;
|
||||||
if (sprite->data[0] != 0)
|
if (sprite->data[0] != 0)
|
||||||
@ -3175,7 +3175,7 @@ static void SpriteCb_TrainerIconCardScrollLeft(struct Sprite *sprite)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpriteCb_TrainerIconCardScrollRight(struct Sprite *sprite)
|
static void SpriteCB_TrainerIconCardScrollRight(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
sprite->x -= 4;
|
sprite->x -= 4;
|
||||||
if (sprite->data[0] != 0)
|
if (sprite->data[0] != 0)
|
||||||
@ -3197,13 +3197,13 @@ static void SpriteCb_TrainerIconCardScrollRight(struct Sprite *sprite)
|
|||||||
|
|
||||||
#define sMonIconStill data[3]
|
#define sMonIconStill data[3]
|
||||||
|
|
||||||
static void SpriteCb_MonIcon(struct Sprite *sprite)
|
static void SpriteCB_MonIconDomeInfo(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
if (!sprite->sMonIconStill)
|
if (!sprite->sMonIconStill)
|
||||||
UpdateMonIconFrame(sprite);
|
UpdateMonIconFrame(sprite);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpriteCb_MonIconCardScrollUp(struct Sprite *sprite)
|
static void SpriteCB_MonIconCardScrollUp(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
if (!sprite->sMonIconStill)
|
if (!sprite->sMonIconStill)
|
||||||
UpdateMonIconFrame(sprite);
|
UpdateMonIconFrame(sprite);
|
||||||
@ -3213,7 +3213,7 @@ static void SpriteCb_MonIconCardScrollUp(struct Sprite *sprite)
|
|||||||
if (sprite->y >= -16)
|
if (sprite->y >= -16)
|
||||||
sprite->invisible = FALSE;
|
sprite->invisible = FALSE;
|
||||||
if (++sprite->data[1] == 40)
|
if (++sprite->data[1] == 40)
|
||||||
sprite->callback = SpriteCb_MonIcon;
|
sprite->callback = SpriteCB_MonIconDomeInfo;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -3225,7 +3225,7 @@ static void SpriteCb_MonIconCardScrollUp(struct Sprite *sprite)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpriteCb_MonIconCardScrollDown(struct Sprite *sprite)
|
static void SpriteCB_MonIconCardScrollDown(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
if (!sprite->sMonIconStill)
|
if (!sprite->sMonIconStill)
|
||||||
UpdateMonIconFrame(sprite);
|
UpdateMonIconFrame(sprite);
|
||||||
@ -3235,7 +3235,7 @@ static void SpriteCb_MonIconCardScrollDown(struct Sprite *sprite)
|
|||||||
if (sprite->y <= 176)
|
if (sprite->y <= 176)
|
||||||
sprite->invisible = FALSE;
|
sprite->invisible = FALSE;
|
||||||
if (++sprite->data[1] == 40)
|
if (++sprite->data[1] == 40)
|
||||||
sprite->callback = SpriteCb_MonIcon;
|
sprite->callback = SpriteCB_MonIconDomeInfo;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -3247,7 +3247,7 @@ static void SpriteCb_MonIconCardScrollDown(struct Sprite *sprite)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpriteCb_MonIconCardScrollLeft(struct Sprite *sprite)
|
static void SpriteCB_MonIconCardScrollLeft(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
if (!sprite->sMonIconStill)
|
if (!sprite->sMonIconStill)
|
||||||
UpdateMonIconFrame(sprite);
|
UpdateMonIconFrame(sprite);
|
||||||
@ -3257,7 +3257,7 @@ static void SpriteCb_MonIconCardScrollLeft(struct Sprite *sprite)
|
|||||||
if (sprite->x >= -16)
|
if (sprite->x >= -16)
|
||||||
sprite->invisible = FALSE;
|
sprite->invisible = FALSE;
|
||||||
if (++sprite->data[1] == 64)
|
if (++sprite->data[1] == 64)
|
||||||
sprite->callback = SpriteCb_MonIcon;
|
sprite->callback = SpriteCB_MonIconDomeInfo;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -3269,7 +3269,7 @@ static void SpriteCb_MonIconCardScrollLeft(struct Sprite *sprite)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpriteCb_MonIconCardScrollRight(struct Sprite *sprite)
|
static void SpriteCB_MonIconCardScrollRight(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
if (!sprite->sMonIconStill)
|
if (!sprite->sMonIconStill)
|
||||||
UpdateMonIconFrame(sprite);
|
UpdateMonIconFrame(sprite);
|
||||||
@ -3279,7 +3279,7 @@ static void SpriteCb_MonIconCardScrollRight(struct Sprite *sprite)
|
|||||||
if (sprite->x <= DISPLAY_WIDTH + 16)
|
if (sprite->x <= DISPLAY_WIDTH + 16)
|
||||||
sprite->invisible = FALSE;
|
sprite->invisible = FALSE;
|
||||||
if (++sprite->data[1] == 64)
|
if (++sprite->data[1] == 64)
|
||||||
sprite->callback = SpriteCb_MonIcon;
|
sprite->callback = SpriteCB_MonIconDomeInfo;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -3291,7 +3291,7 @@ static void SpriteCb_MonIconCardScrollRight(struct Sprite *sprite)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpriteCb_HorizontalScrollArrow(struct Sprite *sprite)
|
static void SpriteCB_HorizontalScrollArrow(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
int taskId1 = sprite->data[0];
|
int taskId1 = sprite->data[0];
|
||||||
int arrId = gTasks[gTasks[taskId1].data[4]].data[1];
|
int arrId = gTasks[gTasks[taskId1].data[4]].data[1];
|
||||||
@ -3360,7 +3360,7 @@ static void SpriteCb_HorizontalScrollArrow(struct Sprite *sprite)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpriteCb_VerticalScrollArrow(struct Sprite *sprite)
|
static void SpriteCB_VerticalScrollArrow(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
int taskId1 = sprite->data[0];
|
int taskId1 = sprite->data[0];
|
||||||
|
|
||||||
@ -3526,7 +3526,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollUp;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollUp;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3537,7 +3537,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollUp;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollUp;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3550,7 +3550,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollUp;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollUp;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3561,7 +3561,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollUp;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollUp;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3642,7 +3642,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollDown;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollDown;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3653,7 +3653,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollDown;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollDown;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3666,7 +3666,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollDown;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollDown;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3677,7 +3677,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollDown;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollDown;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3725,7 +3725,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollLeft;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3736,7 +3736,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollLeft;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3749,7 +3749,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollLeft;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3760,7 +3760,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollLeft;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3808,7 +3808,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollLeft;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3819,7 +3819,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollLeft;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3832,7 +3832,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollLeft;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3843,7 +3843,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollLeft;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3889,7 +3889,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollRight;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3900,7 +3900,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollRight;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3913,7 +3913,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollRight;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3924,7 +3924,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollRight;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3972,7 +3972,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollRight;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3983,7 +3983,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollRight;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -3996,7 +3996,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollRight;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -4007,7 +4007,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
|||||||
{
|
{
|
||||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||||
{
|
{
|
||||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight;
|
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollRight;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||||
@ -4297,7 +4297,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
|
|||||||
if (trainerId == TRAINER_PLAYER)
|
if (trainerId == TRAINER_PLAYER)
|
||||||
{
|
{
|
||||||
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(DOME_MONS[trainerTourneyId][i],
|
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(DOME_MONS[trainerTourneyId][i],
|
||||||
SpriteCb_MonIcon,
|
SpriteCB_MonIconDomeInfo,
|
||||||
x | sInfoTrainerMonX[i],
|
x | sInfoTrainerMonX[i],
|
||||||
y + sInfoTrainerMonY[i],
|
y + sInfoTrainerMonY[i],
|
||||||
0, 0, TRUE);
|
0, 0, TRUE);
|
||||||
@ -4306,7 +4306,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
|
|||||||
else if (trainerId == TRAINER_FRONTIER_BRAIN)
|
else if (trainerId == TRAINER_FRONTIER_BRAIN)
|
||||||
{
|
{
|
||||||
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(DOME_MONS[trainerTourneyId][i],
|
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(DOME_MONS[trainerTourneyId][i],
|
||||||
SpriteCb_MonIcon,
|
SpriteCB_MonIconDomeInfo,
|
||||||
x | sInfoTrainerMonX[i],
|
x | sInfoTrainerMonX[i],
|
||||||
y + sInfoTrainerMonY[i],
|
y + sInfoTrainerMonY[i],
|
||||||
0, 0, TRUE);
|
0, 0, TRUE);
|
||||||
@ -4315,7 +4315,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[DOME_MONS[trainerTourneyId][i]].species,
|
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[DOME_MONS[trainerTourneyId][i]].species,
|
||||||
SpriteCb_MonIcon,
|
SpriteCB_MonIconDomeInfo,
|
||||||
x | sInfoTrainerMonX[i],
|
x | sInfoTrainerMonX[i],
|
||||||
y + sInfoTrainerMonY[i],
|
y + sInfoTrainerMonY[i],
|
||||||
0, 0, TRUE);
|
0, 0, TRUE);
|
||||||
@ -4786,7 +4786,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
|||||||
if (trainerIds[0] == TRAINER_PLAYER)
|
if (trainerIds[0] == TRAINER_PLAYER)
|
||||||
{
|
{
|
||||||
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(DOME_MONS[tournamentIds[0]][i],
|
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(DOME_MONS[tournamentIds[0]][i],
|
||||||
SpriteCb_MonIcon,
|
SpriteCB_MonIconDomeInfo,
|
||||||
x | sLeftTrainerMonX[i],
|
x | sLeftTrainerMonX[i],
|
||||||
y + sLeftTrainerMonY[i],
|
y + sLeftTrainerMonY[i],
|
||||||
0, 0, TRUE);
|
0, 0, TRUE);
|
||||||
@ -4795,7 +4795,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
|||||||
else if (trainerIds[0] == TRAINER_FRONTIER_BRAIN)
|
else if (trainerIds[0] == TRAINER_FRONTIER_BRAIN)
|
||||||
{
|
{
|
||||||
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(DOME_MONS[tournamentIds[0]][i],
|
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(DOME_MONS[tournamentIds[0]][i],
|
||||||
SpriteCb_MonIcon,
|
SpriteCB_MonIconDomeInfo,
|
||||||
x | sLeftTrainerMonX[i],
|
x | sLeftTrainerMonX[i],
|
||||||
y + sLeftTrainerMonY[i],
|
y + sLeftTrainerMonY[i],
|
||||||
0, 0, TRUE);
|
0, 0, TRUE);
|
||||||
@ -4804,7 +4804,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[DOME_MONS[tournamentIds[0]][i]].species,
|
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[DOME_MONS[tournamentIds[0]][i]].species,
|
||||||
SpriteCb_MonIcon,
|
SpriteCB_MonIconDomeInfo,
|
||||||
x | sLeftTrainerMonX[i],
|
x | sLeftTrainerMonX[i],
|
||||||
y + sLeftTrainerMonY[i],
|
y + sLeftTrainerMonY[i],
|
||||||
0, 0, TRUE);
|
0, 0, TRUE);
|
||||||
@ -4826,7 +4826,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
|||||||
if (trainerIds[1] == TRAINER_PLAYER)
|
if (trainerIds[1] == TRAINER_PLAYER)
|
||||||
{
|
{
|
||||||
sInfoCard->spriteIds[5 + i + arrId] = CreateMonIcon(DOME_MONS[tournamentIds[1]][i],
|
sInfoCard->spriteIds[5 + i + arrId] = CreateMonIcon(DOME_MONS[tournamentIds[1]][i],
|
||||||
SpriteCb_MonIcon,
|
SpriteCB_MonIconDomeInfo,
|
||||||
x | sRightTrainerMonX[i],
|
x | sRightTrainerMonX[i],
|
||||||
y + sRightTrainerMonY[i],
|
y + sRightTrainerMonY[i],
|
||||||
0, 0, TRUE);
|
0, 0, TRUE);
|
||||||
@ -4835,7 +4835,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
|||||||
else if (trainerIds[1] == TRAINER_FRONTIER_BRAIN)
|
else if (trainerIds[1] == TRAINER_FRONTIER_BRAIN)
|
||||||
{
|
{
|
||||||
sInfoCard->spriteIds[5 + i + arrId] = CreateMonIcon(DOME_MONS[tournamentIds[1]][i],
|
sInfoCard->spriteIds[5 + i + arrId] = CreateMonIcon(DOME_MONS[tournamentIds[1]][i],
|
||||||
SpriteCb_MonIcon,
|
SpriteCB_MonIconDomeInfo,
|
||||||
x | sRightTrainerMonX[i],
|
x | sRightTrainerMonX[i],
|
||||||
y + sRightTrainerMonY[i],
|
y + sRightTrainerMonY[i],
|
||||||
0, 0, TRUE);
|
0, 0, TRUE);
|
||||||
@ -4844,7 +4844,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
sInfoCard->spriteIds[5 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[DOME_MONS[tournamentIds[1]][i]].species,
|
sInfoCard->spriteIds[5 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[DOME_MONS[tournamentIds[1]][i]].species,
|
||||||
SpriteCb_MonIcon,
|
SpriteCB_MonIconDomeInfo,
|
||||||
x | sRightTrainerMonX[i],
|
x | sRightTrainerMonX[i],
|
||||||
y + sRightTrainerMonY[i],
|
y + sRightTrainerMonY[i],
|
||||||
0, 0, TRUE);
|
0, 0, TRUE);
|
||||||
|
@ -78,12 +78,12 @@ static void EndLinkBattleInSteps(void);
|
|||||||
static void CB2_InitAskRecordBattle(void);
|
static void CB2_InitAskRecordBattle(void);
|
||||||
static void CB2_AskRecordBattle(void);
|
static void CB2_AskRecordBattle(void);
|
||||||
static void AskRecordBattle(void);
|
static void AskRecordBattle(void);
|
||||||
static void SpriteCb_MoveWildMonToRight(struct Sprite *sprite);
|
static void SpriteCB_MoveWildMonToRight(struct Sprite *sprite);
|
||||||
static void SpriteCb_WildMonShowHealthbox(struct Sprite *sprite);
|
static void SpriteCB_WildMonShowHealthbox(struct Sprite *sprite);
|
||||||
static void SpriteCb_WildMonAnimate(struct Sprite *sprite);
|
static void SpriteCB_WildMonAnimate(struct Sprite *sprite);
|
||||||
static void SpriteCB_Flicker(struct Sprite *sprite);
|
static void SpriteCB_Flicker(struct Sprite *sprite);
|
||||||
static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite);
|
static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite);
|
||||||
static void SpriteCb_BlinkVisible(struct Sprite *sprite);
|
static void SpriteCB_BlinkVisible(struct Sprite *sprite);
|
||||||
static void SpriteCB_Idle(struct Sprite *sprite);
|
static void SpriteCB_Idle(struct Sprite *sprite);
|
||||||
static void SpriteCB_BattleSpriteSlideLeft(struct Sprite *sprite);
|
static void SpriteCB_BattleSpriteSlideLeft(struct Sprite *sprite);
|
||||||
static void TurnValuesCleanUp(bool8 var0);
|
static void TurnValuesCleanUp(bool8 var0);
|
||||||
@ -816,8 +816,8 @@ static void SetAllPlayersBerryData(void)
|
|||||||
gEnigmaBerries[2].itemEffect[i] = 0;
|
gEnigmaBerries[2].itemEffect[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
gEnigmaBerries[0].holdEffect = 0;
|
gEnigmaBerries[0].holdEffect = HOLD_EFFECT_NONE;
|
||||||
gEnigmaBerries[2].holdEffect = 0;
|
gEnigmaBerries[2].holdEffect = HOLD_EFFECT_NONE;
|
||||||
gEnigmaBerries[0].holdEffectParam = 0;
|
gEnigmaBerries[0].holdEffectParam = 0;
|
||||||
gEnigmaBerries[2].holdEffectParam = 0;
|
gEnigmaBerries[2].holdEffectParam = 0;
|
||||||
}
|
}
|
||||||
@ -2650,38 +2650,38 @@ u32 GetBattleWindowTemplatePixelWidth(u32 windowsType, u32 tableId)
|
|||||||
#define sBattler data[0]
|
#define sBattler data[0]
|
||||||
#define sSpeciesId data[2]
|
#define sSpeciesId data[2]
|
||||||
|
|
||||||
void SpriteCb_WildMon(struct Sprite *sprite)
|
void SpriteCB_WildMon(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
sprite->callback = SpriteCb_MoveWildMonToRight;
|
sprite->callback = SpriteCB_MoveWildMonToRight;
|
||||||
StartSpriteAnimIfDifferent(sprite, 0);
|
StartSpriteAnimIfDifferent(sprite, 0);
|
||||||
BeginNormalPaletteFade(0x20000, 0, 10, 10, RGB(8, 8, 8));
|
BeginNormalPaletteFade(0x20000, 0, 10, 10, RGB(8, 8, 8));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpriteCb_MoveWildMonToRight(struct Sprite *sprite)
|
static void SpriteCB_MoveWildMonToRight(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
if ((gIntroSlideFlags & 1) == 0)
|
if ((gIntroSlideFlags & 1) == 0)
|
||||||
{
|
{
|
||||||
sprite->x2 += 2;
|
sprite->x2 += 2;
|
||||||
if (sprite->x2 == 0)
|
if (sprite->x2 == 0)
|
||||||
{
|
{
|
||||||
sprite->callback = SpriteCb_WildMonShowHealthbox;
|
sprite->callback = SpriteCB_WildMonShowHealthbox;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpriteCb_WildMonShowHealthbox(struct Sprite *sprite)
|
static void SpriteCB_WildMonShowHealthbox(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
if (sprite->animEnded)
|
if (sprite->animEnded)
|
||||||
{
|
{
|
||||||
StartHealthboxSlideIn(sprite->sBattler);
|
StartHealthboxSlideIn(sprite->sBattler);
|
||||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[sprite->sBattler]);
|
SetHealthboxSpriteVisible(gHealthboxSpriteIds[sprite->sBattler]);
|
||||||
sprite->callback = SpriteCb_WildMonAnimate;
|
sprite->callback = SpriteCB_WildMonAnimate;
|
||||||
StartSpriteAnimIfDifferent(sprite, 0);
|
StartSpriteAnimIfDifferent(sprite, 0);
|
||||||
BeginNormalPaletteFade(0x20000, 0, 10, 0, RGB(8, 8, 8));
|
BeginNormalPaletteFade(0x20000, 0, 10, 0, RGB(8, 8, 8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpriteCb_WildMonAnimate(struct Sprite *sprite)
|
static void SpriteCB_WildMonAnimate(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
if (!gPaletteFade.active)
|
if (!gPaletteFade.active)
|
||||||
{
|
{
|
||||||
@ -2798,14 +2798,14 @@ static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Used when selecting a move, which can hit multiple targets, in double battles.
|
// Used when selecting a move, which can hit multiple targets, in double battles.
|
||||||
void SpriteCb_ShowAsMoveTarget(struct Sprite *sprite)
|
void SpriteCB_ShowAsMoveTarget(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
sprite->data[3] = 8;
|
sprite->data[3] = 8;
|
||||||
sprite->data[4] = sprite->invisible;
|
sprite->data[4] = sprite->invisible;
|
||||||
sprite->callback = SpriteCb_BlinkVisible;
|
sprite->callback = SpriteCB_BlinkVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpriteCb_BlinkVisible(struct Sprite *sprite)
|
static void SpriteCB_BlinkVisible(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
if (--sprite->data[3] == 0)
|
if (--sprite->data[3] == 0)
|
||||||
{
|
{
|
||||||
@ -2814,7 +2814,7 @@ static void SpriteCb_BlinkVisible(struct Sprite *sprite)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpriteCb_HideAsMoveTarget(struct Sprite *sprite)
|
void SpriteCB_HideAsMoveTarget(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
sprite->invisible = sprite->data[4];
|
sprite->invisible = sprite->data[4];
|
||||||
sprite->data[4] = FALSE;
|
sprite->data[4] = FALSE;
|
||||||
@ -3038,13 +3038,13 @@ static void BattleStartClearSetData(void)
|
|||||||
|
|
||||||
gDisableStructs[i].isFirstTurn = 2;
|
gDisableStructs[i].isFirstTurn = 2;
|
||||||
sUnusedBattlersArray[i] = 0;
|
sUnusedBattlersArray[i] = 0;
|
||||||
gLastMoves[i] = 0;
|
gLastMoves[i] = MOVE_NONE;
|
||||||
gLastLandedMoves[i] = 0;
|
gLastLandedMoves[i] = MOVE_NONE;
|
||||||
gLastHitByType[i] = 0;
|
gLastHitByType[i] = 0;
|
||||||
gLastResultingMoves[i] = 0;
|
gLastResultingMoves[i] = MOVE_NONE;
|
||||||
gLastHitBy[i] = 0xFF;
|
gLastHitBy[i] = 0xFF;
|
||||||
gLockedMoves[i] = 0;
|
gLockedMoves[i] = MOVE_NONE;
|
||||||
gLastPrintedMoves[i] = 0;
|
gLastPrintedMoves[i] = MOVE_NONE;
|
||||||
gBattleResources->flags->flags[i] = 0;
|
gBattleResources->flags->flags[i] = 0;
|
||||||
gPalaceSelectionBattleScripts[i] = 0;
|
gPalaceSelectionBattleScripts[i] = 0;
|
||||||
}
|
}
|
||||||
@ -3105,10 +3105,10 @@ static void BattleStartClearSetData(void)
|
|||||||
|
|
||||||
for (i = 0; i < 8; i++)
|
for (i = 0; i < 8; i++)
|
||||||
{
|
{
|
||||||
*((u8 *)gBattleStruct->lastTakenMove + i) = 0;
|
*((u8 *)gBattleStruct->lastTakenMove + i) = MOVE_NONE;
|
||||||
*((u8 *)gBattleStruct->usedHeldItems + i) = 0;
|
*((u8 *)gBattleStruct->usedHeldItems + i) = ITEM_NONE;
|
||||||
*((u8 *)gBattleStruct->choicedMove + i) = 0;
|
*((u8 *)gBattleStruct->choicedMove + i) = MOVE_NONE;
|
||||||
*((u8 *)gBattleStruct->changedItems + i) = 0;
|
*((u8 *)gBattleStruct->changedItems + i) = ITEM_NONE;
|
||||||
*(i + 0 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
*(i + 0 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||||
*(i + 1 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
*(i + 1 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||||
*(i + 2 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
*(i + 2 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||||
@ -3205,15 +3205,15 @@ void SwitchInClearSetData(void)
|
|||||||
gMoveResultFlags = 0;
|
gMoveResultFlags = 0;
|
||||||
gDisableStructs[gActiveBattler].isFirstTurn = 2;
|
gDisableStructs[gActiveBattler].isFirstTurn = 2;
|
||||||
gDisableStructs[gActiveBattler].truantSwitchInHack = disableStructCopy.truantSwitchInHack;
|
gDisableStructs[gActiveBattler].truantSwitchInHack = disableStructCopy.truantSwitchInHack;
|
||||||
gLastMoves[gActiveBattler] = 0;
|
gLastMoves[gActiveBattler] = MOVE_NONE;
|
||||||
gLastLandedMoves[gActiveBattler] = 0;
|
gLastLandedMoves[gActiveBattler] = MOVE_NONE;
|
||||||
gLastHitByType[gActiveBattler] = 0;
|
gLastHitByType[gActiveBattler] = 0;
|
||||||
gLastResultingMoves[gActiveBattler] = 0;
|
gLastResultingMoves[gActiveBattler] = MOVE_NONE;
|
||||||
gLastPrintedMoves[gActiveBattler] = 0;
|
gLastPrintedMoves[gActiveBattler] = MOVE_NONE;
|
||||||
gLastHitBy[gActiveBattler] = 0xFF;
|
gLastHitBy[gActiveBattler] = 0xFF;
|
||||||
|
|
||||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = 0;
|
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = MOVE_NONE;
|
||||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = 0;
|
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = MOVE_NONE;
|
||||||
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||||
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||||
*(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
*(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||||
@ -3229,18 +3229,18 @@ void SwitchInClearSetData(void)
|
|||||||
{
|
{
|
||||||
if (i != gActiveBattler && GetBattlerSide(i) != GetBattlerSide(gActiveBattler))
|
if (i != gActiveBattler && GetBattlerSide(i) != GetBattlerSide(gActiveBattler))
|
||||||
{
|
{
|
||||||
*(gBattleStruct->lastTakenMove + i * 2 + 0) = 0;
|
*(gBattleStruct->lastTakenMove + i * 2 + 0) = MOVE_NONE;
|
||||||
*(gBattleStruct->lastTakenMove + i * 2 + 1) = 0;
|
*(gBattleStruct->lastTakenMove + i * 2 + 1) = MOVE_NONE;
|
||||||
}
|
}
|
||||||
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||||
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = 0;
|
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = MOVE_NONE;
|
||||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = 0;
|
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = MOVE_NONE;
|
||||||
|
|
||||||
gBattleResources->flags->flags[gActiveBattler] = 0;
|
gBattleResources->flags->flags[gActiveBattler] = 0;
|
||||||
gCurrentMove = 0;
|
gCurrentMove = MOVE_NONE;
|
||||||
gBattleStruct->arenaTurnCounter = 0xFF;
|
gBattleStruct->arenaTurnCounter = 0xFF;
|
||||||
|
|
||||||
ClearBattlerMoveHistory(gActiveBattler);
|
ClearBattlerMoveHistory(gActiveBattler);
|
||||||
@ -3297,18 +3297,18 @@ void FaintClearSetData(void)
|
|||||||
|
|
||||||
gDisableStructs[gActiveBattler].isFirstTurn = 2;
|
gDisableStructs[gActiveBattler].isFirstTurn = 2;
|
||||||
|
|
||||||
gLastMoves[gActiveBattler] = 0;
|
gLastMoves[gActiveBattler] = MOVE_NONE;
|
||||||
gLastLandedMoves[gActiveBattler] = 0;
|
gLastLandedMoves[gActiveBattler] = MOVE_NONE;
|
||||||
gLastHitByType[gActiveBattler] = 0;
|
gLastHitByType[gActiveBattler] = 0;
|
||||||
gLastResultingMoves[gActiveBattler] = 0;
|
gLastResultingMoves[gActiveBattler] = MOVE_NONE;
|
||||||
gLastPrintedMoves[gActiveBattler] = 0;
|
gLastPrintedMoves[gActiveBattler] = MOVE_NONE;
|
||||||
gLastHitBy[gActiveBattler] = 0xFF;
|
gLastHitBy[gActiveBattler] = 0xFF;
|
||||||
|
|
||||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = 0;
|
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = MOVE_NONE;
|
||||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = 0;
|
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = MOVE_NONE;
|
||||||
|
|
||||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = 0;
|
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = MOVE_NONE;
|
||||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = 0;
|
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = MOVE_NONE;
|
||||||
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||||
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||||
*(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
*(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||||
@ -3324,8 +3324,8 @@ void FaintClearSetData(void)
|
|||||||
{
|
{
|
||||||
if (i != gActiveBattler && GetBattlerSide(i) != GetBattlerSide(gActiveBattler))
|
if (i != gActiveBattler && GetBattlerSide(i) != GetBattlerSide(gActiveBattler))
|
||||||
{
|
{
|
||||||
*(gBattleStruct->lastTakenMove + i * 2 + 0) = 0;
|
*(gBattleStruct->lastTakenMove + i * 2 + 0) = MOVE_NONE;
|
||||||
*(gBattleStruct->lastTakenMove + i * 2 + 1) = 0;
|
*(gBattleStruct->lastTakenMove + i * 2 + 1) = MOVE_NONE;
|
||||||
}
|
}
|
||||||
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||||
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||||
@ -3371,8 +3371,8 @@ static void BattleIntroPrepareBackgroundSlide(void)
|
|||||||
BtlController_EmitIntroSlide(BUFFER_A, gBattleTerrain);
|
BtlController_EmitIntroSlide(BUFFER_A, gBattleTerrain);
|
||||||
MarkBattlerForControllerExec(gActiveBattler);
|
MarkBattlerForControllerExec(gActiveBattler);
|
||||||
gBattleMainFunc = BattleIntroDrawTrainersOrMonsSprites;
|
gBattleMainFunc = BattleIntroDrawTrainersOrMonsSprites;
|
||||||
gBattleCommunication[0] = 0;
|
gBattleCommunication[MULTIUSE_STATE] = 0;
|
||||||
gBattleCommunication[1] = 0;
|
gBattleCommunication[SPRITES_INIT_STATE1] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3545,7 +3545,6 @@ static void BattleIntroDrawPartySummaryScreens(void)
|
|||||||
|
|
||||||
gBattleMainFunc = BattleIntroPrintWildMonAttacked;
|
gBattleMainFunc = BattleIntroPrintWildMonAttacked;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void BattleIntroPrintTrainerWantsToBattle(void)
|
static void BattleIntroPrintTrainerWantsToBattle(void)
|
||||||
@ -3839,7 +3838,7 @@ static void TryDoEventsBeforeFirstTurn(void)
|
|||||||
|
|
||||||
gBattleStruct->switchInAbilitiesCounter++;
|
gBattleStruct->switchInAbilitiesCounter++;
|
||||||
|
|
||||||
if (effect)
|
if (effect != 0)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (AbilityBattleEffects(ABILITYEFFECT_INTIMIDATE1, 0, 0, 0, 0) != 0)
|
if (AbilityBattleEffects(ABILITYEFFECT_INTIMIDATE1, 0, 0, 0, 0) != 0)
|
||||||
@ -3854,7 +3853,7 @@ static void TryDoEventsBeforeFirstTurn(void)
|
|||||||
|
|
||||||
gBattleStruct->switchInItemsCounter++;
|
gBattleStruct->switchInItemsCounter++;
|
||||||
|
|
||||||
if (effect)
|
if (effect != 0)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
||||||
@ -3997,11 +3996,11 @@ u8 IsRunningFromBattleImpossible(void)
|
|||||||
gPotentialItemEffectBattler = gActiveBattler;
|
gPotentialItemEffectBattler = gActiveBattler;
|
||||||
|
|
||||||
if (holdEffect == HOLD_EFFECT_CAN_ALWAYS_RUN)
|
if (holdEffect == HOLD_EFFECT_CAN_ALWAYS_RUN)
|
||||||
return 0;
|
return BATTLE_RUN_SUCCESS;
|
||||||
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
|
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
|
||||||
return 0;
|
return BATTLE_RUN_SUCCESS;
|
||||||
if (gBattleMons[gActiveBattler].ability == ABILITY_RUN_AWAY)
|
if (gBattleMons[gActiveBattler].ability == ABILITY_RUN_AWAY)
|
||||||
return 0;
|
return BATTLE_RUN_SUCCESS;
|
||||||
|
|
||||||
side = GetBattlerSide(gActiveBattler);
|
side = GetBattlerSide(gActiveBattler);
|
||||||
|
|
||||||
@ -4013,7 +4012,7 @@ u8 IsRunningFromBattleImpossible(void)
|
|||||||
gBattleScripting.battler = i;
|
gBattleScripting.battler = i;
|
||||||
gLastUsedAbility = gBattleMons[i].ability;
|
gLastUsedAbility = gBattleMons[i].ability;
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
|
||||||
return 2;
|
return BATTLE_RUN_FAILURE;
|
||||||
}
|
}
|
||||||
if (side != GetBattlerSide(i)
|
if (side != GetBattlerSide(i)
|
||||||
&& gBattleMons[gActiveBattler].ability != ABILITY_LEVITATE
|
&& gBattleMons[gActiveBattler].ability != ABILITY_LEVITATE
|
||||||
@ -4023,7 +4022,7 @@ u8 IsRunningFromBattleImpossible(void)
|
|||||||
gBattleScripting.battler = i;
|
gBattleScripting.battler = i;
|
||||||
gLastUsedAbility = gBattleMons[i].ability;
|
gLastUsedAbility = gBattleMons[i].ability;
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
|
||||||
return 2;
|
return BATTLE_RUN_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i = AbilityBattleEffects(ABILITYEFFECT_CHECK_FIELD_EXCEPT_BATTLER, gActiveBattler, ABILITY_MAGNET_PULL, 0, 0);
|
i = AbilityBattleEffects(ABILITYEFFECT_CHECK_FIELD_EXCEPT_BATTLER, gActiveBattler, ABILITY_MAGNET_PULL, 0, 0);
|
||||||
@ -4032,20 +4031,20 @@ u8 IsRunningFromBattleImpossible(void)
|
|||||||
gBattleScripting.battler = i - 1;
|
gBattleScripting.battler = i - 1;
|
||||||
gLastUsedAbility = gBattleMons[i - 1].ability;
|
gLastUsedAbility = gBattleMons[i - 1].ability;
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
|
||||||
return 2;
|
return BATTLE_RUN_FAILURE;
|
||||||
}
|
}
|
||||||
if ((gBattleMons[gActiveBattler].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED))
|
if ((gBattleMons[gActiveBattler].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED))
|
||||||
|| (gStatuses3[gActiveBattler] & STATUS3_ROOTED))
|
|| (gStatuses3[gActiveBattler] & STATUS3_ROOTED))
|
||||||
{
|
{
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_ESCAPE;
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_ESCAPE;
|
||||||
return 1;
|
return BATTLE_RUN_FORBIDDEN;
|
||||||
}
|
}
|
||||||
if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE)
|
if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE)
|
||||||
{
|
{
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DONT_LEAVE_BIRCH;
|
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DONT_LEAVE_BIRCH;
|
||||||
return 1;
|
return BATTLE_RUN_FORBIDDEN;
|
||||||
}
|
}
|
||||||
return 0;
|
return BATTLE_RUN_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SwitchPartyOrder(u8 battler)
|
void SwitchPartyOrder(u8 battler)
|
||||||
@ -4301,7 +4300,7 @@ static void HandleTurnActionSelectionState(void)
|
|||||||
BattleScriptExecute(BattleScript_PrintCantRunFromTrainer);
|
BattleScriptExecute(BattleScript_PrintCantRunFromTrainer);
|
||||||
gBattleCommunication[gActiveBattler] = STATE_BEFORE_ACTION_CHOSEN;
|
gBattleCommunication[gActiveBattler] = STATE_BEFORE_ACTION_CHOSEN;
|
||||||
}
|
}
|
||||||
else if (IsRunningFromBattleImpossible()
|
else if (IsRunningFromBattleImpossible() != BATTLE_RUN_SUCCESS
|
||||||
&& gBattleBufferB[gActiveBattler][1] == B_ACTION_RUN)
|
&& gBattleBufferB[gActiveBattler][1] == B_ACTION_RUN)
|
||||||
{
|
{
|
||||||
gSelectionBattleScripts[gActiveBattler] = BattleScript_PrintCantEscapeFromBattle;
|
gSelectionBattleScripts[gActiveBattler] = BattleScript_PrintCantEscapeFromBattle;
|
||||||
|
@ -471,7 +471,7 @@ bool8 TryRunFromBattle(u8 battler)
|
|||||||
gBattleStruct->runTries++;
|
gBattleStruct->runTries++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (effect)
|
if (effect != 0)
|
||||||
{
|
{
|
||||||
gCurrentTurnActionNumber = gBattlersCount;
|
gCurrentTurnActionNumber = gBattlersCount;
|
||||||
gBattleOutcome = B_OUTCOME_RAN;
|
gBattleOutcome = B_OUTCOME_RAN;
|
||||||
@ -823,7 +823,8 @@ void PressurePPLoseOnUsingPerishSong(u8 attacker)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MarkAllBattlersForControllerExec(void) // unused
|
// Unused
|
||||||
|
static void MarkAllBattlersForControllerExec(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -1220,7 +1221,7 @@ u8 DoFieldEndTurnEffects(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
gBattleStruct->turnSideTracker++;
|
gBattleStruct->turnSideTracker++;
|
||||||
if (effect)
|
if (effect != 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!effect)
|
if (!effect)
|
||||||
@ -1246,7 +1247,7 @@ u8 DoFieldEndTurnEffects(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
gBattleStruct->turnSideTracker++;
|
gBattleStruct->turnSideTracker++;
|
||||||
if (effect)
|
if (effect != 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!effect)
|
if (!effect)
|
||||||
@ -1270,7 +1271,7 @@ u8 DoFieldEndTurnEffects(void)
|
|||||||
effect++;
|
effect++;
|
||||||
}
|
}
|
||||||
gBattleStruct->turnSideTracker++;
|
gBattleStruct->turnSideTracker++;
|
||||||
if (effect)
|
if (effect != 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!effect)
|
if (!effect)
|
||||||
@ -1294,7 +1295,7 @@ u8 DoFieldEndTurnEffects(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
gBattleStruct->turnSideTracker++;
|
gBattleStruct->turnSideTracker++;
|
||||||
if (effect)
|
if (effect != 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!effect)
|
if (!effect)
|
||||||
@ -1316,7 +1317,7 @@ u8 DoFieldEndTurnEffects(void)
|
|||||||
effect++;
|
effect++;
|
||||||
}
|
}
|
||||||
gBattleStruct->turnSideTracker++;
|
gBattleStruct->turnSideTracker++;
|
||||||
if (effect)
|
if (effect != 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!effect)
|
if (!effect)
|
||||||
@ -1687,12 +1688,12 @@ u8 DoBattlerEndTurnEffects(void)
|
|||||||
}
|
}
|
||||||
if (i == MAX_MON_MOVES) // pokemon does not have the disabled move anymore
|
if (i == MAX_MON_MOVES) // pokemon does not have the disabled move anymore
|
||||||
{
|
{
|
||||||
gDisableStructs[gActiveBattler].disabledMove = 0;
|
gDisableStructs[gActiveBattler].disabledMove = MOVE_NONE;
|
||||||
gDisableStructs[gActiveBattler].disableTimer = 0;
|
gDisableStructs[gActiveBattler].disableTimer = 0;
|
||||||
}
|
}
|
||||||
else if (--gDisableStructs[gActiveBattler].disableTimer == 0) // disable ends
|
else if (--gDisableStructs[gActiveBattler].disableTimer == 0) // disable ends
|
||||||
{
|
{
|
||||||
gDisableStructs[gActiveBattler].disabledMove = 0;
|
gDisableStructs[gActiveBattler].disabledMove = MOVE_NONE;
|
||||||
BattleScriptExecute(BattleScript_DisabledNoMore);
|
BattleScriptExecute(BattleScript_DisabledNoMore);
|
||||||
effect++;
|
effect++;
|
||||||
}
|
}
|
||||||
@ -1704,13 +1705,13 @@ u8 DoBattlerEndTurnEffects(void)
|
|||||||
{
|
{
|
||||||
if (gBattleMons[gActiveBattler].moves[gDisableStructs[gActiveBattler].encoredMovePos] != gDisableStructs[gActiveBattler].encoredMove) // pokemon does not have the encored move anymore
|
if (gBattleMons[gActiveBattler].moves[gDisableStructs[gActiveBattler].encoredMovePos] != gDisableStructs[gActiveBattler].encoredMove) // pokemon does not have the encored move anymore
|
||||||
{
|
{
|
||||||
gDisableStructs[gActiveBattler].encoredMove = 0;
|
gDisableStructs[gActiveBattler].encoredMove = MOVE_NONE;
|
||||||
gDisableStructs[gActiveBattler].encoreTimer = 0;
|
gDisableStructs[gActiveBattler].encoreTimer = 0;
|
||||||
}
|
}
|
||||||
else if (--gDisableStructs[gActiveBattler].encoreTimer == 0
|
else if (--gDisableStructs[gActiveBattler].encoreTimer == 0
|
||||||
|| gBattleMons[gActiveBattler].pp[gDisableStructs[gActiveBattler].encoredMovePos] == 0)
|
|| gBattleMons[gActiveBattler].pp[gDisableStructs[gActiveBattler].encoredMovePos] == 0)
|
||||||
{
|
{
|
||||||
gDisableStructs[gActiveBattler].encoredMove = 0;
|
gDisableStructs[gActiveBattler].encoredMove = MOVE_NONE;
|
||||||
gDisableStructs[gActiveBattler].encoreTimer = 0;
|
gDisableStructs[gActiveBattler].encoreTimer = 0;
|
||||||
BattleScriptExecute(BattleScript_EncoredNoMore);
|
BattleScriptExecute(BattleScript_EncoredNoMore);
|
||||||
effect++;
|
effect++;
|
||||||
@ -2103,7 +2104,7 @@ u8 AtkCanceller_UnableToUseMove(void)
|
|||||||
gBattleStruct->atkCancellerTracker++;
|
gBattleStruct->atkCancellerTracker++;
|
||||||
break;
|
break;
|
||||||
case CANCELLER_DISABLED: // disabled move
|
case CANCELLER_DISABLED: // disabled move
|
||||||
if (gDisableStructs[gBattlerAttacker].disabledMove == gCurrentMove && gDisableStructs[gBattlerAttacker].disabledMove != 0)
|
if (gDisableStructs[gBattlerAttacker].disabledMove == gCurrentMove && gDisableStructs[gBattlerAttacker].disabledMove != MOVE_NONE)
|
||||||
{
|
{
|
||||||
gProtectStructs[gBattlerAttacker].usedDisabledMove = 1;
|
gProtectStructs[gBattlerAttacker].usedDisabledMove = 1;
|
||||||
gBattleScripting.battler = gBattlerAttacker;
|
gBattleScripting.battler = gBattlerAttacker;
|
||||||
@ -2172,7 +2173,7 @@ u8 AtkCanceller_UnableToUseMove(void)
|
|||||||
if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_PARALYSIS) && (Random() % 4) == 0)
|
if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_PARALYSIS) && (Random() % 4) == 0)
|
||||||
{
|
{
|
||||||
gProtectStructs[gBattlerAttacker].prlzImmobility = 1;
|
gProtectStructs[gBattlerAttacker].prlzImmobility = 1;
|
||||||
// This is removed in Emerald for some reason
|
// This is removed in FRLG and Emerald for some reason
|
||||||
//CancelMultiTurnMoves(gBattlerAttacker);
|
//CancelMultiTurnMoves(gBattlerAttacker);
|
||||||
gBattlescriptCurrInstr = BattleScript_MoveUsedIsParalyzed;
|
gBattlescriptCurrInstr = BattleScript_MoveUsedIsParalyzed;
|
||||||
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
|
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
|
||||||
@ -2210,7 +2211,7 @@ u8 AtkCanceller_UnableToUseMove(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// This is removed in Emerald for some reason
|
// This is removed in FRLG and Emerald for some reason
|
||||||
//gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_MULTIPLETURNS;
|
//gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_MULTIPLETURNS;
|
||||||
if (gTakenDmg[gBattlerAttacker])
|
if (gTakenDmg[gBattlerAttacker])
|
||||||
{
|
{
|
||||||
@ -2506,7 +2507,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (effect)
|
if (effect != 0)
|
||||||
{
|
{
|
||||||
gBattleCommunication[MULTISTRING_CHOOSER] = GetCurrentWeather();
|
gBattleCommunication[MULTISTRING_CHOOSER] = GetCurrentWeather();
|
||||||
BattleScriptPushCursorAndCallback(BattleScript_OverworldWeatherStarts);
|
BattleScriptPushCursorAndCallback(BattleScript_OverworldWeatherStarts);
|
||||||
@ -2548,7 +2549,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
|||||||
break;
|
break;
|
||||||
case ABILITY_FORECAST:
|
case ABILITY_FORECAST:
|
||||||
effect = CastformDataTypeChange(battler);
|
effect = CastformDataTypeChange(battler);
|
||||||
if (effect)
|
if (effect != 0)
|
||||||
{
|
{
|
||||||
BattleScriptPushCursorAndCallback(BattleScript_CastformChange);
|
BattleScriptPushCursorAndCallback(BattleScript_CastformChange);
|
||||||
gBattleScripting.battler = battler;
|
gBattleScripting.battler = battler;
|
||||||
@ -2569,7 +2570,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
|||||||
for (target1 = 0; target1 < gBattlersCount; target1++)
|
for (target1 = 0; target1 < gBattlersCount; target1++)
|
||||||
{
|
{
|
||||||
effect = CastformDataTypeChange(target1);
|
effect = CastformDataTypeChange(target1);
|
||||||
if (effect)
|
if (effect != 0)
|
||||||
{
|
{
|
||||||
BattleScriptPushCursorAndCallback(BattleScript_CastformChange);
|
BattleScriptPushCursorAndCallback(BattleScript_CastformChange);
|
||||||
gBattleScripting.battler = target1;
|
gBattleScripting.battler = target1;
|
||||||
@ -2909,7 +2910,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (effect)
|
if (effect != 0)
|
||||||
{
|
{
|
||||||
switch (effect)
|
switch (effect)
|
||||||
{
|
{
|
||||||
@ -2940,7 +2941,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
|||||||
if (gBattleMons[battler].ability == ABILITY_FORECAST)
|
if (gBattleMons[battler].ability == ABILITY_FORECAST)
|
||||||
{
|
{
|
||||||
effect = CastformDataTypeChange(battler);
|
effect = CastformDataTypeChange(battler);
|
||||||
if (effect)
|
if (effect != 0)
|
||||||
{
|
{
|
||||||
BattleScriptPushCursorAndCallback(BattleScript_CastformChange);
|
BattleScriptPushCursorAndCallback(BattleScript_CastformChange);
|
||||||
gBattleScripting.battler = battler;
|
gBattleScripting.battler = battler;
|
||||||
@ -3040,7 +3041,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
|||||||
effect++;
|
effect++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (effect)
|
if (effect != 0)
|
||||||
{
|
{
|
||||||
BattleScriptPushCursorAndCallback(BattleScript_TraceActivates);
|
BattleScriptPushCursorAndCallback(BattleScript_TraceActivates);
|
||||||
gStatuses3[i] &= ~STATUS3_TRACE;
|
gStatuses3[i] &= ~STATUS3_TRACE;
|
||||||
@ -3300,7 +3301,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
|||||||
effect = ITEM_STATS_CHANGE;
|
effect = ITEM_STATS_CHANGE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (effect)
|
if (effect != 0)
|
||||||
{
|
{
|
||||||
gBattleScripting.battler = battlerId;
|
gBattleScripting.battler = battlerId;
|
||||||
gPotentialItemEffectBattler = battlerId;
|
gPotentialItemEffectBattler = battlerId;
|
||||||
@ -3371,7 +3372,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
|||||||
effect = ITEM_STATS_CHANGE;
|
effect = ITEM_STATS_CHANGE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (effect)
|
if (effect != 0)
|
||||||
{
|
{
|
||||||
gBattleScripting.battler = battlerId;
|
gBattleScripting.battler = battlerId;
|
||||||
gPotentialItemEffectBattler = battlerId;
|
gPotentialItemEffectBattler = battlerId;
|
||||||
@ -3583,7 +3584,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (effect)
|
if (effect != 0)
|
||||||
{
|
{
|
||||||
gBattleScripting.battler = battlerId;
|
gBattleScripting.battler = battlerId;
|
||||||
gPotentialItemEffectBattler = battlerId;
|
gPotentialItemEffectBattler = battlerId;
|
||||||
@ -3727,7 +3728,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
|||||||
effect = ITEM_STATS_CHANGE;
|
effect = ITEM_STATS_CHANGE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (effect)
|
if (effect != 0)
|
||||||
{
|
{
|
||||||
gBattleScripting.battler = battlerId;
|
gBattleScripting.battler = battlerId;
|
||||||
gPotentialItemEffectBattler = battlerId;
|
gPotentialItemEffectBattler = battlerId;
|
||||||
@ -3737,7 +3738,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (effect)
|
if (effect != 0)
|
||||||
{
|
{
|
||||||
gBattleScripting.battler = battlerId;
|
gBattleScripting.battler = battlerId;
|
||||||
gPotentialItemEffectBattler = battlerId;
|
gPotentialItemEffectBattler = battlerId;
|
||||||
|
@ -226,7 +226,7 @@ bool8 SetUpFieldMove_Cut(void)
|
|||||||
y = gPlayerFacingPosition.y + sHyperCutStruct[i].y;
|
y = gPlayerFacingPosition.y + sHyperCutStruct[i].y;
|
||||||
tileCuttable = TRUE;
|
tileCuttable = TRUE;
|
||||||
|
|
||||||
for (j = 0; j < 2; ++j)
|
for (j = 0; j < 2; j++)
|
||||||
{
|
{
|
||||||
if (sHyperCutStruct[i].unk2[j] == 0) break; // one line required to match -g
|
if (sHyperCutStruct[i].unk2[j] == 0) break; // one line required to match -g
|
||||||
if (cutTiles[(u8)(sHyperCutStruct[i].unk2[j] - 1)] == FALSE)
|
if (cutTiles[(u8)(sHyperCutStruct[i].unk2[j] - 1)] == FALSE)
|
||||||
|
@ -164,7 +164,7 @@ u16 rfu_initializeAPI(u32 *APIBuffer, u16 buffByteSize, IntrFunc *sioIntrTable_p
|
|||||||
gRfuFixed = (void *)APIBuffer + 0xdc; // + sizeof(*gRfuStatic)
|
gRfuFixed = (void *)APIBuffer + 0xdc; // + sizeof(*gRfuStatic)
|
||||||
gRfuSlotStatusNI[0] = (void *)APIBuffer + 0x1bc; // + sizeof(*gRfuFixed)
|
gRfuSlotStatusNI[0] = (void *)APIBuffer + 0x1bc; // + sizeof(*gRfuFixed)
|
||||||
gRfuSlotStatusUNI[0] = (void *)APIBuffer + 0x37c; // + sizeof(*gRfuSlotStatusNI[0]) * RFU_CHILD_MAX
|
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];
|
gRfuSlotStatusNI[i] = &gRfuSlotStatusNI[i - 1][1];
|
||||||
gRfuSlotStatusUNI[i] = &gRfuSlotStatusUNI[i - 1][1];
|
gRfuSlotStatusUNI[i] = &gRfuSlotStatusUNI[i - 1][1];
|
||||||
@ -173,7 +173,7 @@ u16 rfu_initializeAPI(u32 *APIBuffer, u16 buffByteSize, IntrFunc *sioIntrTable_p
|
|||||||
gRfuFixed->STWIBuffer = (struct RfuIntrStruct *)&gRfuSlotStatusUNI[3][1];
|
gRfuFixed->STWIBuffer = (struct RfuIntrStruct *)&gRfuSlotStatusUNI[3][1];
|
||||||
STWI_init_all((struct RfuIntrStruct *)&gRfuSlotStatusUNI[3][1], sioIntrTable_p, copyInterruptToRam);
|
STWI_init_all((struct RfuIntrStruct *)&gRfuSlotStatusUNI[3][1], sioIntrTable_p, copyInterruptToRam);
|
||||||
rfu_STC_clearAPIVariables();
|
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]->recvBuffer = NULL;
|
||||||
gRfuSlotStatusNI[i]->recvBufferSize = 0;
|
gRfuSlotStatusNI[i]->recvBufferSize = 0;
|
||||||
@ -214,7 +214,7 @@ static void rfu_STC_clearAPIVariables(void)
|
|||||||
gRfuLinkStatus->parentChild = MODE_NEUTRAL;
|
gRfuLinkStatus->parentChild = MODE_NEUTRAL;
|
||||||
rfu_clearAllSlot();
|
rfu_clearAllSlot();
|
||||||
gRfuStatic->SCStartFlag = 0;
|
gRfuStatic->SCStartFlag = 0;
|
||||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||||
gRfuStatic->cidBak[i] = 0;
|
gRfuStatic->cidBak[i] = 0;
|
||||||
REG_IME = IMEBackup;
|
REG_IME = IMEBackup;
|
||||||
}
|
}
|
||||||
@ -294,7 +294,7 @@ static void rfu_CB_defaultCallback(u8 reqCommand, u16 reqResult)
|
|||||||
if (gRfuStatic->flags & 8)
|
if (gRfuStatic->flags & 8)
|
||||||
gRfuFixed->reqCallback(reqCommand, reqResult);
|
gRfuFixed->reqCallback(reqCommand, reqResult);
|
||||||
bmSlotFlags = gRfuLinkStatus->connSlotFlag | gRfuLinkStatus->linkLossSlotFlag;
|
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)
|
if ((bmSlotFlags >> i) & 1)
|
||||||
rfu_STC_removeLinkData(i, 1);
|
rfu_STC_removeLinkData(i, 1);
|
||||||
gRfuLinkStatus->parentChild = MODE_NEUTRAL;
|
gRfuLinkStatus->parentChild = MODE_NEUTRAL;
|
||||||
@ -351,7 +351,7 @@ u16 rfu_MBOOT_CHILD_inheritanceLinkStatus(void)
|
|||||||
|
|
||||||
// The size of struct RfuLinkStatus is 180
|
// The size of struct RfuLinkStatus is 180
|
||||||
checksum = 0;
|
checksum = 0;
|
||||||
for (i = 0; i < 180/2; ++i)
|
for (i = 0; i < 180/2; i++)
|
||||||
checksum += *mb_buff_iwram_p++;
|
checksum += *mb_buff_iwram_p++;
|
||||||
if (checksum != *(u16 *)0x30000FA)
|
if (checksum != *(u16 *)0x30000FA)
|
||||||
return 1;
|
return 1;
|
||||||
@ -455,11 +455,11 @@ void rfu_REQ_configGameData(u8 mbootFlag, u16 serialNo, const u8 *gname, const u
|
|||||||
packet[1] = serialNo >> 8;
|
packet[1] = serialNo >> 8;
|
||||||
if (mbootFlag != 0)
|
if (mbootFlag != 0)
|
||||||
packet[1] = (serialNo >> 8) | 0x80;
|
packet[1] = (serialNo >> 8) | 0x80;
|
||||||
for (i = 2; i < 15; ++i)
|
for (i = 2; i < 15; i++)
|
||||||
packet[i] = *gname++;
|
packet[i] = *gname++;
|
||||||
check_sum = 0;
|
check_sum = 0;
|
||||||
unameBackup = uname;
|
unameBackup = uname;
|
||||||
for (i = 0; i < 8; ++i)
|
for (i = 0; i < 8; i++)
|
||||||
{
|
{
|
||||||
check_sum += *unameBackup++;
|
check_sum += *unameBackup++;
|
||||||
check_sum += *gnameBackup++;
|
check_sum += *gnameBackup++;
|
||||||
@ -493,10 +493,10 @@ static void rfu_CB_configGameData(u8 reqCommand, u16 reqResult)
|
|||||||
{
|
{
|
||||||
gRfuLinkStatus->my.mbootFlag = 0;
|
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++;
|
gRfuLinkStatus->my.gname[i] = *gname_uname_p++;
|
||||||
++gname_uname_p;
|
++gname_uname_p;
|
||||||
for (i = 0; i < PLAYER_NAME_LENGTH + 1; ++i)
|
for (i = 0; i < PLAYER_NAME_LENGTH + 1; i++)
|
||||||
gRfuLinkStatus->my.uname[i] = *gname_uname_p++;
|
gRfuLinkStatus->my.uname[i] = *gname_uname_p++;
|
||||||
}
|
}
|
||||||
rfu_STC_REQ_callback(reqCommand, reqResult);
|
rfu_STC_REQ_callback(reqCommand, reqResult);
|
||||||
@ -546,7 +546,7 @@ static void rfu_STC_clearLinkStatus(u8 parentChild)
|
|||||||
CpuFill16(0, gRfuLinkStatus->partner, sizeof(gRfuLinkStatus->partner));
|
CpuFill16(0, gRfuLinkStatus->partner, sizeof(gRfuLinkStatus->partner));
|
||||||
gRfuLinkStatus->findParentCount = 0;
|
gRfuLinkStatus->findParentCount = 0;
|
||||||
}
|
}
|
||||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||||
gRfuLinkStatus->strength[i] = 0;
|
gRfuLinkStatus->strength[i] = 0;
|
||||||
gRfuLinkStatus->connCount = 0;
|
gRfuLinkStatus->connCount = 0;
|
||||||
gRfuLinkStatus->connSlotFlag = 0;
|
gRfuLinkStatus->connSlotFlag = 0;
|
||||||
@ -609,7 +609,7 @@ static void rfu_STC_readChildList(void)
|
|||||||
if (STWI_poll_CommandEnd() == 0)
|
if (STWI_poll_CommandEnd() == 0)
|
||||||
{
|
{
|
||||||
data_p = &gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[4];
|
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++;
|
true_slots[i] = *data_p++;
|
||||||
}
|
}
|
||||||
gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket32.data[0] = stwiParam;
|
gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket32.data[0] = stwiParam;
|
||||||
@ -696,7 +696,7 @@ static void rfu_STC_readParentCandidateList(void)
|
|||||||
numSlots = packet_p[1];
|
numSlots = packet_p[1];
|
||||||
packet_p += 4;
|
packet_p += 4;
|
||||||
gRfuLinkStatus->findParentCount = 0;
|
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;
|
numSlots -= 7;
|
||||||
uname_p = packet_p + 6;
|
uname_p = packet_p + 6;
|
||||||
@ -704,7 +704,7 @@ static void rfu_STC_readParentCandidateList(void)
|
|||||||
check_sum = ~*packet_p;
|
check_sum = ~*packet_p;
|
||||||
++packet_p;
|
++packet_p;
|
||||||
my_check_sum = 0;
|
my_check_sum = 0;
|
||||||
for (j = 0; j < 8; ++j)
|
for (j = 0; j < 8; j++)
|
||||||
{
|
{
|
||||||
my_check_sum += *packet_p++;
|
my_check_sum += *packet_p++;
|
||||||
my_check_sum += *uname_p++;
|
my_check_sum += *uname_p++;
|
||||||
@ -723,10 +723,10 @@ static void rfu_STC_readParentCandidateList(void)
|
|||||||
else
|
else
|
||||||
target->mbootFlag = 0;
|
target->mbootFlag = 0;
|
||||||
packet_p += 2;
|
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++;
|
target->gname[j] = *packet_p++;
|
||||||
++packet_p;
|
++packet_p;
|
||||||
for (j = 0; j < PLAYER_NAME_LENGTH + 1; ++j)
|
for (j = 0; j < PLAYER_NAME_LENGTH + 1; j++)
|
||||||
target->uname[j] = *packet_p++;
|
target->uname[j] = *packet_p++;
|
||||||
++gRfuLinkStatus->findParentCount;
|
++gRfuLinkStatus->findParentCount;
|
||||||
}
|
}
|
||||||
@ -737,7 +737,7 @@ void rfu_REQ_startConnectParent(u16 pid)
|
|||||||
{
|
{
|
||||||
u16 result = 0;
|
u16 result = 0;
|
||||||
u8 i;
|
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)
|
if (i == RFU_CHILD_MAX)
|
||||||
result = ERR_PID_NOT_FOUND;
|
result = ERR_PID_NOT_FOUND;
|
||||||
@ -782,7 +782,7 @@ static void rfu_CB_pollConnectParent(u8 reqCommand, u16 reqResult)
|
|||||||
++gRfuLinkStatus->connCount;
|
++gRfuLinkStatus->connCount;
|
||||||
gRfuLinkStatus->parentChild = MODE_CHILD;
|
gRfuLinkStatus->parentChild = MODE_CHILD;
|
||||||
gRfuStatic->flags |= 0x80;
|
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)
|
if (gRfuLinkStatus->partner[i].id == gRfuStatic->tryPid)
|
||||||
{
|
{
|
||||||
@ -868,7 +868,7 @@ u16 rfu_syncVBlank(void)
|
|||||||
{
|
{
|
||||||
gRfuStatic->flags &= 0xFB;
|
gRfuStatic->flags &= 0xFB;
|
||||||
bmSlotFlag = gRfuLinkStatus->connSlotFlag | gRfuLinkStatus->linkLossSlotFlag;
|
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)
|
if ((bmSlotFlag >> i) & 1)
|
||||||
rfu_STC_removeLinkData(i, 1);
|
rfu_STC_removeLinkData(i, 1);
|
||||||
gRfuLinkStatus->parentChild = MODE_NEUTRAL;
|
gRfuLinkStatus->parentChild = MODE_NEUTRAL;
|
||||||
@ -921,7 +921,7 @@ u16 rfu_REQBN_watchLink(u16 reqCommandId, u8 *bmLinkLossSlot, u8 *linkLossReason
|
|||||||
newLinkLossFlag ^= gRfuLinkStatus->connSlotFlag;
|
newLinkLossFlag ^= gRfuLinkStatus->connSlotFlag;
|
||||||
*bmLinkLossSlot = newLinkLossFlag & gRfuLinkStatus->connSlotFlag;
|
*bmLinkLossSlot = newLinkLossFlag & gRfuLinkStatus->connSlotFlag;
|
||||||
*linkLossReason = REASON_LINK_LOSS;
|
*linkLossReason = REASON_LINK_LOSS;
|
||||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||||
{
|
{
|
||||||
if ((*bmLinkLossSlot >> i) & 1)
|
if ((*bmLinkLossSlot >> i) & 1)
|
||||||
{
|
{
|
||||||
@ -941,7 +941,7 @@ u16 rfu_REQBN_watchLink(u16 reqCommandId, u8 *bmLinkLossSlot, u8 *linkLossReason
|
|||||||
if (reqResult == 0)
|
if (reqResult == 0)
|
||||||
{
|
{
|
||||||
packet_p = &gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[4];
|
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++;
|
gRfuLinkStatus->strength[i] = *packet_p++;
|
||||||
to_req_disconnect = 0;
|
to_req_disconnect = 0;
|
||||||
i = 0;
|
i = 0;
|
||||||
@ -951,7 +951,7 @@ u16 rfu_REQBN_watchLink(u16 reqCommandId, u8 *bmLinkLossSlot, u8 *linkLossReason
|
|||||||
rfu_STC_REQ_callback(ID_LINK_STATUS_REQ, reqResult);
|
rfu_STC_REQ_callback(ID_LINK_STATUS_REQ, reqResult);
|
||||||
return reqResult;
|
return reqResult;
|
||||||
}
|
}
|
||||||
for (; i < RFU_CHILD_MAX; ++i)
|
for (; i < RFU_CHILD_MAX; i++)
|
||||||
{
|
{
|
||||||
#if LIBRFU_VERSION >= 1026
|
#if LIBRFU_VERSION >= 1026
|
||||||
if (gRfuStatic->lsFixedCount[i] != 0)
|
if (gRfuStatic->lsFixedCount[i] != 0)
|
||||||
@ -1128,7 +1128,7 @@ static void rfu_CB_disconnect(u8 reqCommand, u16 reqResult)
|
|||||||
gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[8] = gRfuStatic->recoveryBmSlot;
|
gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[8] = gRfuStatic->recoveryBmSlot;
|
||||||
if (reqResult == 0)
|
if (reqResult == 0)
|
||||||
{
|
{
|
||||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||||
{
|
{
|
||||||
bm_slot_flag = 1 << i;
|
bm_slot_flag = 1 << i;
|
||||||
if (bm_slot_flag & gRfuStatic->recoveryBmSlot)
|
if (bm_slot_flag & gRfuStatic->recoveryBmSlot)
|
||||||
@ -1153,7 +1153,7 @@ void rfu_REQ_CHILD_startConnectRecovery(u8 bmRecoverySlot)
|
|||||||
u8 i;
|
u8 i;
|
||||||
|
|
||||||
gRfuStatic->recoveryBmSlot = bmRecoverySlot;
|
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);
|
STWI_set_Callback_M(rfu_STC_REQ_callback);
|
||||||
// if i == 4, gRfuLinkStatus->partner[i].id becomes gRfuLinkStatus->my.id
|
// if i == 4, gRfuLinkStatus->partner[i].id becomes gRfuLinkStatus->my.id
|
||||||
@ -1174,7 +1174,7 @@ static void rfu_CB_CHILD_pollConnectRecovery(u8 reqCommand, u16 reqResult)
|
|||||||
if (reqResult == 0 && gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[4] == 0 && gRfuStatic->recoveryBmSlot)
|
if (reqResult == 0 && gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[4] == 0 && gRfuStatic->recoveryBmSlot)
|
||||||
{
|
{
|
||||||
gRfuLinkStatus->parentChild = MODE_CHILD;
|
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;
|
bm_slot_flag = 1 << i;
|
||||||
rfuLinkStatus = gRfuLinkStatus; // ???
|
rfuLinkStatus = gRfuLinkStatus; // ???
|
||||||
@ -1256,7 +1256,7 @@ void rfu_clearAllSlot(void)
|
|||||||
u16 IMEBackup = REG_IME;
|
u16 IMEBackup = REG_IME;
|
||||||
|
|
||||||
REG_IME = 0;
|
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, gRfuSlotStatusNI[i], 2 * sizeof(struct NIComm));
|
||||||
CpuFill16(0, gRfuSlotStatusUNI[i], sizeof(struct UNISend) + sizeof(struct UNIRecv));
|
CpuFill16(0, gRfuSlotStatusUNI[i], sizeof(struct UNISend) + sizeof(struct UNIRecv));
|
||||||
@ -1324,7 +1324,7 @@ u16 rfu_clearSlot(u8 connTypeFlag, u8 slotStatusIndex)
|
|||||||
if (NI_comm->state & SLOT_BUSY_FLAG)
|
if (NI_comm->state & SLOT_BUSY_FLAG)
|
||||||
{
|
{
|
||||||
rfu_STC_releaseFrame(slotStatusIndex, send_recv, NI_comm);
|
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)
|
if ((NI_comm->bmSlotOrg >> i) & 1)
|
||||||
NI_comm->failCounter = 0;
|
NI_comm->failCounter = 0;
|
||||||
}
|
}
|
||||||
@ -1450,7 +1450,7 @@ static u16 rfu_STC_setSendData_org(u8 ni_or_uni, u8 bmSendSlot, u8 subFrameSize,
|
|||||||
slotStatus_NI->send.src = src;
|
slotStatus_NI->send.src = src;
|
||||||
slotStatus_NI->send.ack = 0;
|
slotStatus_NI->send.ack = 0;
|
||||||
slotStatus_NI->send.phase = 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.recvAckFlag[i] = 0;
|
||||||
slotStatus_NI->send.n[i] = 1;
|
slotStatus_NI->send.n[i] = 1;
|
||||||
@ -1503,7 +1503,7 @@ u16 rfu_changeSendTarget(u8 connType, u8 slotStatusIndex, u8 bmNewTgtSlot)
|
|||||||
{
|
{
|
||||||
imeBak = REG_IME;
|
imeBak = REG_IME;
|
||||||
REG_IME = 0;
|
REG_IME = 0;
|
||||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||||
{
|
{
|
||||||
if ((connType >> i) & 1)
|
if ((connType >> i) & 1)
|
||||||
gRfuSlotStatusNI[i]->send.failCounter = 0;
|
gRfuSlotStatusNI[i]->send.failCounter = 0;
|
||||||
@ -1536,7 +1536,7 @@ u16 rfu_changeSendTarget(u8 connType, u8 slotStatusIndex, u8 bmNewTgtSlot)
|
|||||||
|
|
||||||
if (gRfuSlotStatusUNI[slotStatusIndex]->send.state != SLOT_STATE_SEND_UNI)
|
if (gRfuSlotStatusUNI[slotStatusIndex]->send.state != SLOT_STATE_SEND_UNI)
|
||||||
return ERR_SLOT_NOT_SENDING;
|
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)
|
if (i != slotStatusIndex)
|
||||||
bmSlot |= gRfuSlotStatusUNI[i]->send.bmSlot;
|
bmSlot |= gRfuSlotStatusUNI[i]->send.bmSlot;
|
||||||
if (bmNewTgtSlot & bmSlot)
|
if (bmNewTgtSlot & bmSlot)
|
||||||
@ -1695,7 +1695,7 @@ static void rfu_CB_sendData(UNUSED u8 reqCommand, u16 reqResult)
|
|||||||
|
|
||||||
if (reqResult == 0)
|
if (reqResult == 0)
|
||||||
{
|
{
|
||||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||||
{
|
{
|
||||||
if (gRfuSlotStatusUNI[i]->send.dataReadyFlag)
|
if (gRfuSlotStatusUNI[i]->send.dataReadyFlag)
|
||||||
gRfuSlotStatusUNI[i]->send.dataReadyFlag = 0;
|
gRfuSlotStatusUNI[i]->send.dataReadyFlag = 0;
|
||||||
@ -1739,7 +1739,7 @@ static void rfu_constructSendLLFrame(void)
|
|||||||
gRfuLinkStatus->LLFReadyFlag = 0;
|
gRfuLinkStatus->LLFReadyFlag = 0;
|
||||||
pakcketSize = 0;
|
pakcketSize = 0;
|
||||||
llf_p = (u8 *)&gRfuFixed->LLFBuffer[1];
|
llf_p = (u8 *)&gRfuFixed->LLFBuffer[1];
|
||||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||||
{
|
{
|
||||||
currSize = 0;
|
currSize = 0;
|
||||||
if (gRfuSlotStatusNI[i]->send.state & SLOT_BUSY_FLAG)
|
if (gRfuSlotStatusNI[i]->send.state & SLOT_BUSY_FLAG)
|
||||||
@ -1815,7 +1815,7 @@ static u16 rfu_STC_NI_constructLLSF(u8 bm_slot_id, u8 **dest_pp, struct NIComm *
|
|||||||
if (gRfuLinkStatus->parentChild == MODE_PARENT)
|
if (gRfuLinkStatus->parentChild == MODE_PARENT)
|
||||||
frame |= NI_comm->bmSlot << 18;
|
frame |= NI_comm->bmSlot << 18;
|
||||||
frame8_p = (u8 *)&frame;
|
frame8_p = (u8 *)&frame;
|
||||||
for (i = 0; i < llsf->frameSize; ++i)
|
for (i = 0; i < llsf->frameSize; i++)
|
||||||
*(*dest_pp)++ = *frame8_p++;
|
*(*dest_pp)++ = *frame8_p++;
|
||||||
if (size != 0)
|
if (size != 0)
|
||||||
{
|
{
|
||||||
@ -1853,7 +1853,7 @@ static u16 rfu_STC_UNI_constructLLSF(u8 bm_slot_id, u8 **dest_p)
|
|||||||
if (gRfuLinkStatus->parentChild == MODE_PARENT)
|
if (gRfuLinkStatus->parentChild == MODE_PARENT)
|
||||||
frame |= UNI_send->bmSlot << 18;
|
frame |= UNI_send->bmSlot << 18;
|
||||||
frame8_p = (u8 *)&frame;
|
frame8_p = (u8 *)&frame;
|
||||||
for (i = 0; i < llsf->frameSize; ++i)
|
for (i = 0; i < llsf->frameSize; i++)
|
||||||
*(*dest_p)++ = *frame8_p++;
|
*(*dest_p)++ = *frame8_p++;
|
||||||
src_p = UNI_send->src;
|
src_p = UNI_send->src;
|
||||||
gRfuFixed->fastCopyPtr(&src_p, dest_p, UNI_send->payloadSize);
|
gRfuFixed->fastCopyPtr(&src_p, dest_p, UNI_send->payloadSize);
|
||||||
@ -1888,7 +1888,7 @@ static void rfu_CB_recvData(u8 reqCommand, u16 reqResult)
|
|||||||
rfu_STC_PARENT_analyzeRecvPacket();
|
rfu_STC_PARENT_analyzeRecvPacket();
|
||||||
else
|
else
|
||||||
rfu_STC_CHILD_analyzeRecvPacket();
|
rfu_STC_CHILD_analyzeRecvPacket();
|
||||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||||
{
|
{
|
||||||
slotStatusNI = gRfuSlotStatusNI[i];
|
slotStatusNI = gRfuSlotStatusNI[i];
|
||||||
if (slotStatusNI->recv.state == SLOT_STATE_RECV_LAST && !((gRfuStatic->NIEndRecvFlag >> i) & 1))
|
if (slotStatusNI->recv.state == SLOT_STATE_RECV_LAST && !((gRfuStatic->NIEndRecvFlag >> i) & 1))
|
||||||
@ -1972,7 +1972,7 @@ static u16 rfu_STC_analyzeLLSF(u8 slot_id, const u8 *src, u16 last_frame)
|
|||||||
if (last_frame < llsf_p->frameSize)
|
if (last_frame < llsf_p->frameSize)
|
||||||
return last_frame;
|
return last_frame;
|
||||||
frames = 0;
|
frames = 0;
|
||||||
for (i = 0; i < llsf_p->frameSize; ++i)
|
for (i = 0; i < llsf_p->frameSize; i++)
|
||||||
frames |= *src++ << 8 * i;
|
frames |= *src++ << 8 * i;
|
||||||
llsf_NI.recvFirst = (frames >> llsf_p->recvFirstShift) & llsf_p->recvFirstMask;
|
llsf_NI.recvFirst = (frames >> llsf_p->recvFirstShift) & llsf_p->recvFirstMask;
|
||||||
llsf_NI.connSlotFlag = (frames >> llsf_p->connSlotFlagShift) & llsf_p->connSlotFlagMask;
|
llsf_NI.connSlotFlag = (frames >> llsf_p->connSlotFlagShift) & llsf_p->connSlotFlagMask;
|
||||||
@ -1998,7 +1998,7 @@ static u16 rfu_STC_analyzeLLSF(u8 slot_id, const u8 *src, u16 last_frame)
|
|||||||
}
|
}
|
||||||
else
|
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)
|
if (((gRfuSlotStatusNI[i]->send.bmSlot >> slot_id) & 1)
|
||||||
&& ((gRfuLinkStatus->sendSlotNIFlag >> slot_id) & 1))
|
&& ((gRfuLinkStatus->sendSlotNIFlag >> slot_id) & 1))
|
||||||
break;
|
break;
|
||||||
@ -2013,7 +2013,7 @@ static u16 rfu_STC_analyzeLLSF(u8 slot_id, const u8 *src, u16 last_frame)
|
|||||||
|
|
||||||
if (conSlots)
|
if (conSlots)
|
||||||
{
|
{
|
||||||
for (i = 0; i < RFU_CHILD_MAX; ++i)
|
for (i = 0; i < RFU_CHILD_MAX; i++)
|
||||||
{
|
{
|
||||||
if ((conSlots >> i) & 1)
|
if ((conSlots >> i) & 1)
|
||||||
{
|
{
|
||||||
@ -2104,7 +2104,7 @@ static void rfu_STC_NI_receive_Sender(u8 NI_slot, u8 bm_flag, const struct RfuLo
|
|||||||
NI_comm->phase = 0;
|
NI_comm->phase = 0;
|
||||||
if (NI_comm->state == SLOT_STATE_SEND_START)
|
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->n[i] = 1;
|
||||||
NI_comm->now_p[i] = NI_comm->src + NI_comm->payloadSize * i;
|
NI_comm->now_p[i] = NI_comm->src + NI_comm->payloadSize * i;
|
||||||
|
@ -208,13 +208,13 @@ void STWI_send_GameConfigREQ(const u8 *serial_gname, const u8 *uname)
|
|||||||
*(u16 *)packetBytes = *(u16 *)serial_gname;
|
*(u16 *)packetBytes = *(u16 *)serial_gname;
|
||||||
packetBytes += sizeof(u16);
|
packetBytes += sizeof(u16);
|
||||||
serial_gname += sizeof(u16);
|
serial_gname += sizeof(u16);
|
||||||
for (i = 0; i < 14; ++i)
|
for (i = 0; i < 14; i++)
|
||||||
{
|
{
|
||||||
*packetBytes = *serial_gname;
|
*packetBytes = *serial_gname;
|
||||||
++packetBytes;
|
++packetBytes;
|
||||||
++serial_gname;
|
++serial_gname;
|
||||||
}
|
}
|
||||||
for (i = 0; i < 8; ++i)
|
for (i = 0; i < 8; i++)
|
||||||
{
|
{
|
||||||
*packetBytes = *uname;
|
*packetBytes = *uname;
|
||||||
++packetBytes;
|
++packetBytes;
|
||||||
|
@ -1945,7 +1945,7 @@ const struct SpriteTemplate gBattlerSpriteTemplates[MAX_BATTLERS_COUNT] =
|
|||||||
.anims = NULL,
|
.anims = NULL,
|
||||||
.images = gBattlerPicTable_OpponentLeft,
|
.images = gBattlerPicTable_OpponentLeft,
|
||||||
.affineAnims = gAffineAnims_BattleSpriteOpponentSide,
|
.affineAnims = gAffineAnims_BattleSpriteOpponentSide,
|
||||||
.callback = SpriteCb_WildMon,
|
.callback = SpriteCB_WildMon,
|
||||||
},
|
},
|
||||||
[B_POSITION_PLAYER_RIGHT] = {
|
[B_POSITION_PLAYER_RIGHT] = {
|
||||||
.tileTag = TAG_NONE,
|
.tileTag = TAG_NONE,
|
||||||
@ -1963,7 +1963,7 @@ const struct SpriteTemplate gBattlerSpriteTemplates[MAX_BATTLERS_COUNT] =
|
|||||||
.anims = NULL,
|
.anims = NULL,
|
||||||
.images = gBattlerPicTable_OpponentRight,
|
.images = gBattlerPicTable_OpponentRight,
|
||||||
.affineAnims = gAffineAnims_BattleSpriteOpponentSide,
|
.affineAnims = gAffineAnims_BattleSpriteOpponentSide,
|
||||||
.callback = SpriteCb_WildMon
|
.callback = SpriteCB_WildMon
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -305,7 +305,7 @@ static void RemoveAndCreateMonMarkingsSprite(struct Pokemon *);
|
|||||||
static void CreateCaughtBallSprite(struct Pokemon *);
|
static void CreateCaughtBallSprite(struct Pokemon *);
|
||||||
static void CreateSetStatusSprite(void);
|
static void CreateSetStatusSprite(void);
|
||||||
static void CreateMoveSelectorSprites(u8);
|
static void CreateMoveSelectorSprites(u8);
|
||||||
static void SpriteCb_MoveSelector(struct Sprite *);
|
static void SpriteCB_MoveSelector(struct Sprite *);
|
||||||
static void DestroyMoveSelectorSprites(u8);
|
static void DestroyMoveSelectorSprites(u8);
|
||||||
static void SetMainMoveSelectorColor(u8);
|
static void SetMainMoveSelectorColor(u8);
|
||||||
static void KeepMoveSelectorVisible(u8);
|
static void KeepMoveSelectorVisible(u8);
|
||||||
@ -4082,14 +4082,14 @@ static void CreateMoveSelectorSprites(u8 idArrayStart)
|
|||||||
else
|
else
|
||||||
StartSpriteAnim(&gSprites[spriteIds[i]], 6); // middle
|
StartSpriteAnim(&gSprites[spriteIds[i]], 6); // middle
|
||||||
|
|
||||||
gSprites[spriteIds[i]].callback = SpriteCb_MoveSelector;
|
gSprites[spriteIds[i]].callback = SpriteCB_MoveSelector;
|
||||||
gSprites[spriteIds[i]].data[0] = idArrayStart;
|
gSprites[spriteIds[i]].data[0] = idArrayStart;
|
||||||
gSprites[spriteIds[i]].data[1] = 0;
|
gSprites[spriteIds[i]].data[1] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SpriteCb_MoveSelector(struct Sprite *sprite)
|
static void SpriteCB_MoveSelector(struct Sprite *sprite)
|
||||||
{
|
{
|
||||||
if (sprite->animNum > 3 && sprite->animNum < 7)
|
if (sprite->animNum > 3 && sprite->animNum < 7)
|
||||||
{
|
{
|
||||||
|
@ -2811,7 +2811,7 @@ class Renderer {
|
|||||||
if ((bc.flags & Bytecode::Flag::ValueMask) != Bytecode::Flag::ValuePop) {
|
if ((bc.flags & Bytecode::Flag::ValueMask) != Bytecode::Flag::ValuePop) {
|
||||||
popArgs -= 1;
|
popArgs -= 1;
|
||||||
}
|
}
|
||||||
for (unsigned int i = 0; i < popArgs; ++i) {
|
for (unsigned int i = 0; i < popArgs; i++) {
|
||||||
m_stack.pop_back();
|
m_stack.pop_back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2925,7 +2925,7 @@ class Renderer {
|
|||||||
void render_to(std::ostream& os, const Template& tmpl, const json& data) {
|
void render_to(std::ostream& os, const Template& tmpl, const json& data) {
|
||||||
m_data = &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];
|
const auto& bc = tmpl.bytecodes[i];
|
||||||
|
|
||||||
switch (bc.op) {
|
switch (bc.op) {
|
||||||
|
@ -1438,7 +1438,7 @@ auto from_json_array_impl(const BasicJsonType& j, std::array<T, N>& arr,
|
|||||||
priority_tag<2> /*unused*/)
|
priority_tag<2> /*unused*/)
|
||||||
-> decltype(j.template get<T>(), void())
|
-> 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>();
|
arr[i] = j.at(i).template get<T>();
|
||||||
}
|
}
|
||||||
@ -4301,7 +4301,7 @@ class binary_reader
|
|||||||
|
|
||||||
if (len != std::size_t(-1))
|
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()))
|
if (JSON_UNLIKELY(not parse_cbor_internal()))
|
||||||
{
|
{
|
||||||
@ -4338,7 +4338,7 @@ class binary_reader
|
|||||||
string_t key;
|
string_t key;
|
||||||
if (len != std::size_t(-1))
|
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();
|
get();
|
||||||
if (JSON_UNLIKELY(not get_cbor_string(key) or not sax->key(key)))
|
if (JSON_UNLIKELY(not get_cbor_string(key) or not sax->key(key)))
|
||||||
@ -4832,7 +4832,7 @@ class binary_reader
|
|||||||
return false;
|
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()))
|
if (JSON_UNLIKELY(not parse_msgpack_internal()))
|
||||||
{
|
{
|
||||||
@ -4855,7 +4855,7 @@ class binary_reader
|
|||||||
}
|
}
|
||||||
|
|
||||||
string_t key;
|
string_t key;
|
||||||
for (std::size_t i = 0; i < len; ++i)
|
for (std::size_t i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
get();
|
get();
|
||||||
if (JSON_UNLIKELY(not get_msgpack_string(key) or not sax->key(key)))
|
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')
|
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)))
|
if (JSON_UNLIKELY(not get_ubjson_value(size_and_type.second)))
|
||||||
{
|
{
|
||||||
@ -5201,7 +5201,7 @@ class binary_reader
|
|||||||
}
|
}
|
||||||
else
|
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()))
|
if (JSON_UNLIKELY(not parse_ubjson_internal()))
|
||||||
{
|
{
|
||||||
@ -5251,7 +5251,7 @@ class binary_reader
|
|||||||
|
|
||||||
if (size_and_type.second != 0)
|
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)))
|
if (JSON_UNLIKELY(not get_ubjson_string(key) or not sax->key(key)))
|
||||||
{
|
{
|
||||||
@ -5266,7 +5266,7 @@ class binary_reader
|
|||||||
}
|
}
|
||||||
else
|
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)))
|
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
|
// step 1: read input into array with system's byte order
|
||||||
std::array<std::uint8_t, sizeof(NumberType)> vec;
|
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();
|
get();
|
||||||
if (JSON_UNLIKELY(not unexpect_eof(format, "number")))
|
if (JSON_UNLIKELY(not unexpect_eof(format, "number")))
|
||||||
@ -6705,7 +6705,7 @@ scan_number_done:
|
|||||||
token_type return_type)
|
token_type return_type)
|
||||||
{
|
{
|
||||||
assert(current == literal_text[0]);
|
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]))
|
if (JSON_UNLIKELY(get() != literal_text[i]))
|
||||||
{
|
{
|
||||||
@ -9235,7 +9235,7 @@ class json_pointer
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// iterate array and use index as reference string
|
// 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),
|
flatten(reference_string + "/" + std::to_string(i),
|
||||||
value.m_value.array->operator[](i), result);
|
value.m_value.array->operator[](i), result);
|
||||||
@ -12183,7 +12183,7 @@ class serializer
|
|||||||
|
|
||||||
// first n-1 elements
|
// first n-1 elements
|
||||||
for (auto i = val.m_value.array->cbegin();
|
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);
|
o->write_characters(indent_string.c_str(), new_indent);
|
||||||
dump(*i, true, ensure_ascii, indent_step, new_indent);
|
dump(*i, true, ensure_ascii, indent_step, new_indent);
|
||||||
@ -12205,7 +12205,7 @@ class serializer
|
|||||||
|
|
||||||
// first n-1 elements
|
// first n-1 elements
|
||||||
for (auto i = val.m_value.array->cbegin();
|
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);
|
dump(*i, false, ensure_ascii, indent_step, current_indent);
|
||||||
o->write_character(',');
|
o->write_character(',');
|
||||||
@ -12302,7 +12302,7 @@ class serializer
|
|||||||
std::size_t bytes_after_last_accept = 0;
|
std::size_t bytes_after_last_accept = 0;
|
||||||
std::size_t undumped_chars = 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]);
|
const auto byte = static_cast<uint8_t>(s[i]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user