Document some generic argument names

This commit is contained in:
GriffinR 2022-05-21 15:21:50 -04:00
parent ef4d99c87e
commit 5e6d8a77e4
35 changed files with 445 additions and 359 deletions

View File

@ -109,7 +109,7 @@ void *LoadPointerFromVars(s16 bottom, s16 top);
void StorePointerInVars(s16 *bottom, s16 *top, const void *ptr);
void InitPrioritiesForVisibleBattlers(void);
void GetBattleAnimBg1Data(struct BattleAnimBgData*);
void GetBattleAnimBgData(struct BattleAnimBgData*, u32 arg1);
void GetBattleAnimBgData(struct BattleAnimBgData*, u32 bgId);
u8 GetBattlerSpriteSubpriority(u8 battlerId);
bool8 TranslateAnimHorizontalArc(struct Sprite *sprite);
void TranslateSpriteLinearByIdFixedPoint(struct Sprite *sprite);
@ -181,7 +181,7 @@ enum
u8 GetBattlerSpriteCoord(u8 battlerId, u8 attributeId);
bool8 IsBattlerSpritePresent(u8 battlerId);
void ClearBattleAnimBg(u32 arg0);
void ClearBattleAnimBg(u32 bgId);
u8 GetAnimBattlerSpriteId(u8 wantedBattler);
bool8 IsDoubleBattle(void);
u8 GetBattleBgPaletteNum(void);
@ -213,7 +213,7 @@ u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 battlerId, u32 selectedPalettes,
// battle_anim_utility_funcs.c
void InitStatsChangeAnimation(u8);
void StartMonScrollingBgMask(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5, u8 arg6, u8 arg7, const u32 *arg8, const u32 *arg9, const u32 *palette);
void StartMonScrollingBgMask(u8 taskId, int unused, u16 scrollSpeed, u8 battler, bool8 includePartner, u8 numFadeSteps, u8 fadeStepDelay, u8 duration, const u32 *gfx, const u32 *tilemap, const u32 *palette);
// battle_anim_effects_1.c
void SetSpriteNextToMonHead(u8 battler, struct Sprite* sprite);

View File

@ -222,7 +222,7 @@ void BtlController_EmitPrintSelectionString(u8 bufferId, u16 stringId);
void BtlController_EmitChooseAction(u8 bufferId, u8 action, u16 itemId);
void BtlController_EmitYesNoBox(u8 bufferId);
void BtlController_EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpNumber, struct ChooseMoveStruct *movePpData);
void BtlController_EmitChooseItem(u8 bufferId, u8* arg1);
void BtlController_EmitChooseItem(u8 bufferId, u8* battlePartyOrder);
void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 slotId, u8 abilityId, u8* data);
void BtlController_EmitCmd23(u8 bufferId); // unused
void BtlController_EmitHealthBarUpdate(u8 bufferId, u16 hpValue);
@ -233,11 +233,11 @@ void BtlController_EmitStatusXor(u8 bufferId, u8 b); // unused
void BtlController_EmitDataTransfer(u8 bufferId, u16 size, void *data);
void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data); // unused
void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data); // unused
void BtlController_EmitCmd32(u8 bufferId, u16 size, void *c); // unused
void BtlController_EmitTwoReturnValues(u8 bufferId, u8 arg1, u16 arg2);
void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 b, u8 *c);
void BtlController_EmitOneReturnValue(u8 bufferId, u16 arg1);
void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 b);
void BtlController_EmitCmd32(u8 bufferId, u16 size, void *data); // unused
void BtlController_EmitTwoReturnValues(u8 bufferId, u8 ret8, u16 ret16);
void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 partyId, u8 *battlePartyOrder);
void BtlController_EmitOneReturnValue(u8 bufferId, u16 ret);
void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 ret);
void BtlController_EmitClearUnkVar(u8 bufferId); // unused
void BtlController_EmitSetUnkVar(u8 bufferId, u8 b); // unused
void BtlController_EmitClearUnkFlag(u8 bufferId); // unused
@ -254,7 +254,7 @@ void BtlController_EmitHidePartyStatusSummary(u8 bufferId);
void BtlController_EmitEndBounceEffect(u8 bufferId);
void BtlController_EmitSpriteInvisibility(u8 bufferId, bool8 isInvisible);
void BtlController_EmitBattleAnimation(u8 bufferId, u8 animationId, u16 argument);
void BtlController_EmitLinkStandbyMsg(u8 bufferId, u8 arg1, bool32 record);
void BtlController_EmitLinkStandbyMsg(u8 bufferId, u8 mode, bool32 record);
void BtlController_EmitResetActionMoveSelection(u8 bufferId, u8 caseId);
void BtlController_EmitEndLinkBattle(u8 bufferId, u8 battleOutcome);

View File

@ -19,7 +19,7 @@ void DecompressTrainerBackPic(u16 backPicId, u8 battlerId);
void BattleGfxSfxDummy3(u8 gender);
void FreeTrainerFrontPicPalette(u16 frontPicId);
bool8 BattleLoadAllHealthBoxesGfx(u8 state);
void LoadBattleBarGfx(u8 arg0);
void LoadBattleBarGfx(u8 unused);
bool8 BattleInitAllSprites(u8 *state1, u8 *battlerId);
void ClearSpritesHealthboxAnimData(void);
void CopyAllBattleSpritesInvisibilities(void);

View File

@ -74,7 +74,7 @@ void SwapHpBarsWithHpText(void);
u8 CreatePartyStatusSummarySprites(u8 battler, struct HpAndStatus *partyInfo, u8 arg2, bool8 isBattleStart);
void Task_HidePartyStatusSummary(u8 taskId);
void UpdateHealthboxAttribute(u8 healthboxSpriteId, struct Pokemon *mon, u8 elementId);
s32 MoveBattleBar(u8 battler, u8 healthboxSpriteId, u8 whichBar, u8 arg3);
s32 MoveBattleBar(u8 battler, u8 healthboxSpriteId, u8 whichBar, u8 unused);
u8 GetScaledHPFraction(s16 hp, s16 maxhp, u8 scale);
u8 GetHPBarLevel(s16 hp, s16 maxhp);

View File

@ -28,7 +28,7 @@ void BattleSetup_StartLegendaryBattle(void);
void StartGroudonKyogreBattle(void);
void StartRegiBattle(void);
u8 BattleSetup_GetTerrainId(void);
u8 GetSpecialBattleTransition(s32 arg0);
u8 GetSpecialBattleTransition(s32 id);
void ChooseStarter(void);
void ResetTrainerOpponentIds(void);
void SetMapVarsToTrainer(void);

View File

@ -66,7 +66,7 @@ void PressurePPLoseOnUsingPerishSong(u8 attacker);
void PressurePPLoseOnUsingImprison(u8 attacker);
void MarkAllBattlersForControllerExec(void); // unused
void MarkBattlerForControllerExec(u8 battlerId);
void MarkBattlerReceivedLinkData(u8 arg0);
void MarkBattlerReceivedLinkData(u8 battlerId);
void CancelMultiTurnMoves(u8 battlerId);
bool8 WasUnableToUseMove(u8 battlerId);
void PrepareStringBattle(u16 stringId, u8 battlerId);

View File

@ -18,9 +18,9 @@ struct DigitObjUtilTemplate
bool32 DigitObjUtil_Init(u32 count);
void DigitObjUtil_Free(void);
bool32 DigitObjUtil_CreatePrinter(u32 id, s32 num, const struct DigitObjUtilTemplate *template);
void DigitObjUtil_PrintNumOn(u32 id, s32 arg1);
void DigitObjUtil_PrintNumOn(u32 id, s32 num);
void DigitObjUtil_DeletePrinter(u32 id);
void DigitObjUtil_HideOrShow(u32 id, bool32 arg1);
void DigitObjUtil_HideOrShow(u32 id, bool32 hide);
u8 GetTilesPerImage(u32 shape, u32 size);
#endif // GUARD_DIGIT_OBJ_UTIL_H

View File

@ -3,7 +3,7 @@
void LoadEvoSparkleSpriteAndPal(void);
u8 EvolutionSparkles_SpiralUpward(u16 arg0);
u8 EvolutionSparkles_SpiralUpward(u16 palNum);
u8 EvolutionSparkles_ArcDown(void);
u8 EvolutionSparkles_CircleInward(void);
u8 EvolutionSparkles_SprayAndFlash(u16 species);

View File

@ -22,7 +22,7 @@ void PlaySecretBaseMusicNoteMatSound(s16 metatileId);
void DoSecretBaseGlitterMatSparkle(void);
bool8 FldEff_SandPillar(void);
void InteractWithShieldOrTVDecoration(void);
bool8 IsLargeBreakableDecoration(u16 arg0, u8 arg1);
bool8 IsLargeBreakableDecoration(u16 metatileId, bool8 checkBase);
void FldEffPoison_Start(void);
bool32 FldEffPoison_IsActive(void);
void DoWateringBerryTreeAnim(void);

View File

@ -98,9 +98,9 @@ struct CursorStruct
extern struct ScrollArrowsTemplate gTempScrollArrowTemplate;
extern struct ListMenuTemplate gMultiuseListMenuTemplate;
s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum);
s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 drawMode, u16 tileNum, u16 palNum);
u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow);
u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenuWindowRect *arg1, u16 scrollOffset, u16 selectedRow);
u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenuWindowRect *rect, u16 scrollOffset, u16 selectedRow);
s32 ListMenu_ProcessInput(u8 listTaskId);
void DestroyListMenuTask(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow);
void RedrawListMenu(u8 listTaskId);
@ -111,10 +111,10 @@ void ListMenuGetCurrentItemArrayId(u8 listTaskId, u16 *arrayId);
void ListMenuGetScrollAndRow(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow);
u16 ListMenuGetYCoordForPrintingArrowCursor(u8 listTaskId);
void ListMenuOverrideSetColors(u8 cursorPal, u8 fillValue, u8 cursorShadowPal);
void ListMenuDefaultCursorMoveFunc(s32 arg0, u8 arg1, struct ListMenu *list);
void ListMenuDefaultCursorMoveFunc(s32 itemIndex, u8 onInit, struct ListMenu *list);
s32 ListMenuGetUnkIndicatorsStructFields(u8 taskId, u8 field);
void ListMenuSetUnkIndicatorsStructField(u8 taskId, u8 field, s32 value);
u8 AddScrollIndicatorArrowPair(const struct ScrollArrowsTemplate *arrowInfo, u16 *arg1);
u8 AddScrollIndicatorArrowPair(const struct ScrollArrowsTemplate *arrowInfo, u16 *scrollOffset);
u8 AddScrollIndicatorArrowPairParameterized(u32 arrowType, s32 commonPos, s32 firstPos, s32 secondPos, s32 fullyDownThreshold, s32 tileTag, s32 palTag, u16 *currItemPtr);
void RemoveScrollIndicatorArrowPair(u8 taskId);
void Task_ScrollIndicatorArrowPairOnMainMenu(u8 taskId);

View File

@ -56,7 +56,7 @@ void SetStandardWindowBorderStyle(u8 windowId, bool8 copyToVram);
void DisplayYesNoMenuDefaultYes(void);
u32 GetPlayerTextSpeed(void);
u8 GetPlayerTextSpeedDelay(void);
void Menu_LoadStdPalAt(u16 arg0);
void Menu_LoadStdPalAt(u16 offset);
void AddTextPrinterWithCallbackForMessage(bool8 a1, void (*callback)(struct TextPrinterTemplate *, u16));
void BgDmaFill(u32 bg, u8 a1, int a2, int a3);
void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str);

View File

@ -18,11 +18,11 @@ struct YesNoFuncTable
void ResetVramOamAndBgCntRegs(void);
void ResetAllBgsCoordinates(void);
void SetVBlankHBlankCallbacksToNull(void);
void DisplayMessageAndContinueTask(u8 taskId, u8 windowId, u16 arg2, u8 arg3, u8 fontId, u8 textSpeed, const u8 *string, void *taskFunc);
void DisplayMessageAndContinueTask(u8 taskId, u8 windowId, u16 tileNum, u8 paletteNum, u8 fontId, u8 textSpeed, const u8 *string, void *taskFunc);
bool16 RunTextPrintersRetIsActive(u8 textPrinterId);
void DoYesNoFuncWithChoice(u8 taskId, const struct YesNoFuncTable *data);
void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *template, u8 arg2, u8 arg3, u8 arg4, u16 tileStart, u8 palette, const struct YesNoFuncTable *yesNo);
bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1);
void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *template, u8 unused1, u8 unused2, u8 unused3, u16 tileStart, u8 palette, const struct YesNoFuncTable *yesNo);
bool8 AdjustQuantityAccordingToDPadInput(s16 *quantity, u16 max);
u8 GetLRKeysPressed(void);
u8 GetLRKeysPressedAndHeld(void);
bool8 IsHoldingItemAllowed(u16 itemId);

View File

@ -95,7 +95,7 @@ void ConditionGraph_Draw(struct ConditionGraph *graph);
bool8 ConditionGraph_TryUpdate(struct ConditionGraph *graph);
void ConditionGraph_Update(struct ConditionGraph *graph);
void ConditionGraph_CalcPositions(u8 *conditions, struct UCoords16 *positions);
void ConditionGraph_SetNewPositions(struct ConditionGraph *graph, struct UCoords16 *arg1, struct UCoords16 *arg2);
void ConditionGraph_SetNewPositions(struct ConditionGraph *graph, struct UCoords16 *old, struct UCoords16 *new);
// Condition menu
bool8 ConditionMenu_UpdateMonEnter(struct ConditionGraph *graph, s16 *x);

View File

@ -337,7 +337,7 @@ u8 GetBoxMonGender(struct BoxPokemon *boxMon);
u8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality);
void SetMultiuseSpriteTemplateToPokemon(u16 speciesTag, u8 battlerPosition);
void SetMultiuseSpriteTemplateToTrainerBack(u16 trainerSpriteId, u8 battlerPosition);
void SetMultiuseSpriteTemplateToTrainerFront(u16 arg0, u8 battlerPosition);
void SetMultiuseSpriteTemplateToTrainerFront(u16 trainerPicId, u8 battlerPosition);
// These are full type signatures for GetMonData() and GetBoxMonData(),
// but they are not used since some code erroneously omits the third arg.
@ -426,8 +426,8 @@ void SetWildMonHeldItem(void);
bool8 IsMonShiny(struct Pokemon *mon);
bool8 IsShinyOtIdPersonality(u32 otId, u32 personality);
const u8 *GetTrainerPartnerName(void);
void BattleAnimateFrontSprite(struct Sprite* sprite, u16 species, bool8 noCry, u8 arg3);
void DoMonFrontSpriteAnimation(struct Sprite* sprite, u16 species, bool8 noCry, u8 arg3);
void BattleAnimateFrontSprite(struct Sprite* sprite, u16 species, bool8 noCry, u8 panMode);
void DoMonFrontSpriteAnimation(struct Sprite* sprite, u16 species, bool8 noCry, u8 panModeAnimFlag);
void PokemonSummaryDoMonAnimation(struct Sprite* sprite, u16 species, bool8 oneFrame);
void StopPokemonAnimationDelayTask(void);
void BattleAnimateBackSprite(struct Sprite* sprite, u16 species);

View File

@ -26,7 +26,7 @@ struct PokemonStorage
extern struct PokemonStorage *gPokemonStoragePtr;
void DrawTextWindowAndBufferTiles(const u8 *string, void *dst, u8 arg2, u8 arg3, s32 bytesToBuffer);
void DrawTextWindowAndBufferTiles(const u8 *string, void *dst, u8 zero1, u8 zero2, s32 bytesToBuffer);
u8 CountMonsInBox(u8 boxId);
s16 GetFirstFreeBoxSpot(u8 boxId);
u8 CountPartyAliveNonEggMonsExcept(u8 slotToIgnore);
@ -52,7 +52,7 @@ void ZeroBoxMonAt(u8 boxId, u8 boxPosition);
void BoxMonAtToMon(u8 boxId, u8 boxPosition, struct Pokemon *dst);
struct BoxPokemon *GetBoxedMonPtr(u8 boxId, u8 boxPosition);
u8 *GetBoxNamePtr(u8 boxId);
s16 AdvanceStorageMonIndex(struct BoxPokemon *boxMons, u8 currIndex, u8 maxIndex, u8 arg3);
s16 AdvanceStorageMonIndex(struct BoxPokemon *boxMons, u8 currIndex, u8 maxIndex, u8 mode);
bool8 CheckFreePokemonStorageSpace(void);
bool32 CheckBoxMonSanityAt(u32 boxId, u32 boxPosition);
u32 CountStorageNonEggMons(void);

View File

@ -356,10 +356,10 @@ void MatchCall_GetNameAndDesc(u32 idx, const u8 **desc, const u8 **name);
// pokenav_main_menu.c
bool32 InitPokenavMainMenu(void);
void CopyPaletteIntoBufferUnfaded(const u16 *palette, u32 bufferOffset, u32 size);
void RunMainMenuLoopedTask(u32 a0);
void RunMainMenuLoopedTask(u32 state);
u32 IsActiveMenuLoopTaskActive(void);
void LoadLeftHeaderGfxForIndex(u32 arg0);
void ShowLeftHeaderGfx(u32 menugfxId, bool32 arg1, bool32 isOnRightSide);
void LoadLeftHeaderGfxForIndex(u32 menuGfxId);
void ShowLeftHeaderGfx(u32 menugfxId, bool32 isMain, bool32 isOnRightSide);
void PokenavFadeScreen(s32 fadeType);
bool32 AreLeftHeaderSpritesMoving(void);
void InitBgTemplates(const struct BgTemplate *templates, int count);
@ -373,7 +373,7 @@ void PokenavCopyPalette(const u16 *a0, const u16 *a1, int a2, int a3, int a4, u1
void FadeToBlackExceptPrimary(void);
struct Sprite *GetSpinningPokenavSprite(void);
void HideSpinningPokenavSprite(void);
void UpdateRegionMapRightHeaderTiles(u32 arg0);
void UpdateRegionMapRightHeaderTiles(u32 menuGfxId);
void HideMainOrSubMenuLeftHeader(u32 id, bool32 onRightSide);
void SlideMenuHeaderUp(void);
void PokenavFillPalette(u32 palIndex, u16 fillValue);
@ -417,8 +417,8 @@ int GetMatchCallTrainerPic(int index);
const u8 *GetMatchCallFlavorText(int index, int textType);
const u8 *GetMatchCallMessageText(int index, bool8 *newRematchRequest);
u16 GetMatchCallOptionCursorPos(void);
u16 GetMatchCallOptionId(int arg0);
void BufferMatchCallNameAndDesc(struct PokenavMatchCallEntry * arg0, u8 *str);
u16 GetMatchCallOptionId(int optionId);
void BufferMatchCallNameAndDesc(struct PokenavMatchCallEntry *matchCallEntry, u8 *str);
u8 GetMatchTableMapSectionId(int rematchIndex);
int GetIndexDeltaOfNextCheckPageDown(int index);
int GetIndexDeltaOfNextCheckPageUp(int index);

View File

@ -69,7 +69,7 @@ u32 CountPlayerTrainerStars(void);
u8 GetTrainerCardStars(u8 cardId);
void CopyTrainerCardData(struct TrainerCard *dst, struct TrainerCard *src, u8 gameVersion);
void ShowPlayerTrainerCard(void (*callback)(void));
void ShowTrainerCardInLink(u8 arg0, void (*callback)(void));
void ShowTrainerCardInLink(u8 cardId, void (*callback)(void));
void TrainerCard_GenerateCardForLinkPlayer(struct TrainerCard *);
#endif // GUARD_TRAINER_CARD_H

View File

@ -7,9 +7,9 @@
#include "data/bard_music/default_sound.h"
#include "data/bard_music/length_table.h"
static s16 CalcWordPitch(int arg0, int songPos)
static s16 CalcWordPitch(int pitchIdx, int songPos)
{
return sBardSoundPitchTables[arg0][songPos];
return sBardSoundPitchTables[pitchIdx][songPos];
}
const struct BardSound *GetWordSounds(u16 word)

View File

@ -3717,6 +3717,26 @@ void AnimTask_SlideMonForFocusBand(u8 taskId)
gTasks[taskId].func = AnimTask_SlideMonForFocusBand_Step1;
}
#define IDX_ACTIVE_SPRITES 2 // Used by the sprite callback to modify the number of active sprites
// Task data for AnimTask_SquishAndSweatDroplets
#define tState data[0]
#define tTimer data[1]
#define tActiveSprites data[IDX_ACTIVE_SPRITES]
#define tNumSquishes data[3]
#define tBaseX data[4]
#define tBaseY data[5]
#define tSubpriority data[6]
// data[7]-data[15] used by PrepareAffineAnimInTaskData
#define tBattlerSpriteId data[15]
// Sprite data for AnimFacadeSweatDrop
#define sTimer data[0]
#define sVelocX data[1]
#define sVelocY data[2]
#define sTaskId data[3]
#define sActiveSpritesIdx data[4]
// Squishes the mon vertically and emits sweat droplets a few times.
// arg 0: battler
// arg 1: num squishes
@ -3728,20 +3748,20 @@ void AnimTask_SquishAndSweatDroplets(u8 taskId)
if (!gBattleAnimArgs[1])
DestroyAnimVisualTask(taskId);
task->data[0] = 0;
task->data[1] = 0;
task->data[2] = 0;
task->data[3] = gBattleAnimArgs[1];
task->tState = 0;
task->tTimer = 0;
task->tActiveSprites = 0;
task->tNumSquishes = gBattleAnimArgs[1];
if (gBattleAnimArgs[0] == ANIM_ATTACKER)
battler = gBattleAnimAttacker;
else
battler = gBattleAnimTarget;
task->data[4] = GetBattlerSpriteCoord(battler, BATTLER_COORD_X);
task->data[5] = GetBattlerSpriteCoord(battler, BATTLER_COORD_Y);
task->data[6] = GetBattlerSpriteSubpriority(battler);
task->data[15] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
PrepareAffineAnimInTaskData(task, task->data[15], gFacadeSquishAffineAnimCmds);
task->tBaseX = GetBattlerSpriteCoord(battler, BATTLER_COORD_X);
task->tBaseY = GetBattlerSpriteCoord(battler, BATTLER_COORD_Y);
task->tSubpriority = GetBattlerSpriteSubpriority(battler);
task->tBattlerSpriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
PrepareAffineAnimInTaskData(task, task->tBattlerSpriteId, gFacadeSquishAffineAnimCmds);
task->func = AnimTask_SquishAndSweatDroplets_Step;
}
@ -3749,37 +3769,40 @@ static void AnimTask_SquishAndSweatDroplets_Step(u8 taskId)
{
struct Task *task = &gTasks[taskId];
switch (task->data[0])
switch (task->tState)
{
case 0:
task->data[1]++;
if (task->data[1] == 6)
task->tTimer++;
if (task->tTimer == 6)
CreateSweatDroplets(taskId, TRUE);
if (task->data[1] == 18)
if (task->tTimer == 18)
CreateSweatDroplets(taskId, FALSE);
if (!RunAffineAnimFromTaskData(task))
{
if (--task->data[3] == 0)
if (--task->tNumSquishes == 0)
{
task->data[0]++;
// Animation is finished
task->tState++;
}
else
{
task->data[1] = 0;
PrepareAffineAnimInTaskData(task, task->data[15], gFacadeSquishAffineAnimCmds);
// Animation continues, more droplet sprites to create
task->tTimer = 0;
PrepareAffineAnimInTaskData(task, task->tBattlerSpriteId, gFacadeSquishAffineAnimCmds);
}
}
break;
case 1:
if (task->data[2] == 0)
// Wait for sprites to be destroyed before ending task
if (task->tActiveSprites == 0)
DestroyAnimVisualTask(taskId);
break;
}
}
static void CreateSweatDroplets(u8 taskId, bool8 arg1)
static void CreateSweatDroplets(u8 taskId, bool8 lowerDroplets)
{
u8 i;
s8 xOffset, yOffset;
@ -3788,7 +3811,7 @@ static void CreateSweatDroplets(u8 taskId, bool8 arg1)
s16 yCoords[2];
task = &gTasks[taskId];
if (!arg1)
if (!lowerDroplets)
{
xOffset = 18;
yOffset = -20;
@ -3799,39 +3822,54 @@ static void CreateSweatDroplets(u8 taskId, bool8 arg1)
yOffset = 20;
}
xCoords[0] = task->data[4] - xOffset;
xCoords[1] = task->data[4] - xOffset - 4;
xCoords[2] = task->data[4] + xOffset;
xCoords[3] = task->data[4] + xOffset + 4;
yCoords[0] = task->data[5] + yOffset;
yCoords[1] = task->data[5] + yOffset + 6;
xCoords[0] = task->tBaseX - xOffset;
xCoords[1] = task->tBaseX - xOffset - 4;
xCoords[2] = task->tBaseX + xOffset;
xCoords[3] = task->tBaseX + xOffset + 4;
yCoords[0] = task->tBaseY + yOffset;
yCoords[1] = task->tBaseY + yOffset + 6;
for (i = 0; i < 4; i++)
{
u8 spriteId = CreateSprite(&gFacadeSweatDropSpriteTemplate, xCoords[i], yCoords[i & 1], task->data[6] - 5);
u8 spriteId = CreateSprite(&gFacadeSweatDropSpriteTemplate, xCoords[i], yCoords[i & 1], task->tSubpriority - 5);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].data[0] = 0;
gSprites[spriteId].data[1] = i < 2 ? -2 : 2;
gSprites[spriteId].data[2] = -1;
gSprites[spriteId].data[3] = taskId;
gSprites[spriteId].data[4] = 2;
task->data[2]++;
gSprites[spriteId].sTimer = 0;
gSprites[spriteId].sVelocX = i < 2 ? -2 : 2; // First two travel left, remaining travel right
gSprites[spriteId].sVelocY = -1;
gSprites[spriteId].sTaskId = taskId;
gSprites[spriteId].sActiveSpritesIdx = IDX_ACTIVE_SPRITES;
task->tActiveSprites++;
}
}
}
static void AnimFacadeSweatDrop(struct Sprite *sprite)
{
sprite->x += sprite->data[1];
sprite->y += sprite->data[2];
if (++sprite->data[0] > 6)
sprite->x += sprite->sVelocX;
sprite->y += sprite->sVelocY;
if (++sprite->sTimer > 6)
{
gTasks[sprite->data[3]].data[sprite->data[4]]--;
gTasks[sprite->sTaskId].data[sprite->sActiveSpritesIdx]--;
DestroySprite(sprite);
}
}
#undef IDX_ACTIVE_SPRITES
#undef tState
#undef tTimer
#undef tActiveSprites
#undef tNumSquishes
#undef tBaseX
#undef tBaseY
#undef tSubpriority
#undef tBattlerSpriteId
#undef sTimer
#undef sVelocX
#undef sVelocY
#undef sTaskId
#undef sActiveSpritesIdx
// Blends the mon sprite's color with a rotating set of colors.
// arg 0: battler
// arg 1: duration
@ -3927,6 +3965,26 @@ static void AnimRoarNoiseLine_Step(struct Sprite *sprite)
DestroyAnimSprite(sprite);
}
#define IDX_ACTIVE_SPRITES 10 // Used by the sprite callback to modify the number of active sprites
// Task data for AnimTask_GlareEyeDots
#define tState data[0]
#define tTimer data[1]
#define tPairNum data[2]
#define tPairMax data[5]
#define tDotOffset data[6]
#define tIsContest data[7]
#define tActiveSprites data[IDX_ACTIVE_SPRITES]
#define tStartX data[11]
#define tStartY data[12]
#define tEndX data[13]
#define tEndY data[14]
// Sprite data for AnimGlareEyeDot
#define sTimer data[0]
#define sTaskId data[1]
#define sActiveSpritesIdx data[2]
// Makes a series of dots in a trail from the attacker to the target.
// arg 0: unused
void AnimTask_GlareEyeDots(u8 taskId)
@ -3935,25 +3993,25 @@ void AnimTask_GlareEyeDots(u8 taskId)
if (IsContest())
{
task->data[5] = 8;
task->data[6] = 3;
task->data[7] = 1;
task->tPairMax = 8;
task->tDotOffset = 3;
task->tIsContest = TRUE;
}
else
{
task->data[5] = 12;
task->data[6] = 3;
task->data[7] = 0;
task->tPairMax = 12;
task->tDotOffset = 3;
task->tIsContest = FALSE;
}
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
task->data[11] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) + GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4;
task->tStartX = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) + GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4;
else
task->data[11] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) - GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4;
task->tStartX = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) - GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4;
task->data[12] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET) - GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4;
task->data[13] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
task->data[14] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
task->tStartY = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET) - GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4;
task->tEndX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
task->tEndY = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
task->func = AnimTask_GlareEyeDots_Step;
}
@ -3963,103 +4021,122 @@ static void AnimTask_GlareEyeDots_Step(u8 taskId)
s16 x, y;
struct Task *task = &gTasks[taskId];
switch (task->data[0])
switch (task->tState)
{
case 0:
if (++task->data[1] > 3)
// Wait to create next pair of dots
if (++task->tTimer > 3)
{
task->data[1] = 0;
task->tTimer = 0;
GetGlareEyeDotCoords(
task->data[11],
task->data[12],
task->data[13],
task->data[14],
task->data[5],
task->data[2],
task->tStartX,
task->tStartY,
task->tEndX,
task->tEndY,
task->tPairMax,
task->tPairNum,
&x,
&y);
// Create dot pair
for (i = 0; i < 2; i++)
{
u8 spriteId = CreateSprite(&gGlareEyeDotSpriteTemplate, x, y, 35);
if (spriteId != MAX_SPRITES)
{
if (task->data[7] == 0)
if (!task->tIsContest)
{
if (i == 0)
gSprites[spriteId].x2 = gSprites[spriteId].y2 = -task->data[6];
gSprites[spriteId].x2 = gSprites[spriteId].y2 = -task->tDotOffset;
else
gSprites[spriteId].x2 = gSprites[spriteId].y2 = task->data[6];
gSprites[spriteId].x2 = gSprites[spriteId].y2 = task->tDotOffset;
}
else
{
if (i == 0)
{
gSprites[spriteId].x2 = -task->data[6];
gSprites[spriteId].y2 = task->data[6];
gSprites[spriteId].x2 = -task->tDotOffset;
gSprites[spriteId].y2 = task->tDotOffset;
}
else
{
gSprites[spriteId].x2 = task->data[6];
gSprites[spriteId].y2 = -task->data[6];
gSprites[spriteId].x2 = task->tDotOffset;
gSprites[spriteId].y2 = -task->tDotOffset;
}
}
gSprites[spriteId].data[0] = 0;
gSprites[spriteId].data[1] = taskId;
gSprites[spriteId].data[2] = 10;
task->data[10]++;
gSprites[spriteId].sTimer = 0;
gSprites[spriteId].sTaskId = taskId;
gSprites[spriteId].sActiveSpritesIdx = IDX_ACTIVE_SPRITES;
task->tActiveSprites++;
}
}
if (task->data[2] == task->data[5])
task->data[0]++;
if (task->tPairNum == task->tPairMax)
task->tState++;
task->data[2]++;
task->tPairNum++;
}
break;
case 1:
if (task->data[10] == 0)
// Wait for sprites to be destroyed before ending task
if (task->tActiveSprites == 0)
DestroyAnimVisualTask(taskId);
break;
}
}
static void GetGlareEyeDotCoords(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8 arg4, u8 arg5, s16 *x, s16 *y)
static void GetGlareEyeDotCoords(s16 startX, s16 startY, s16 endX, s16 endY, u8 pairMax, u8 pairNum, s16 *x, s16 *y)
{
int x2;
int y2;
if (arg5 == 0)
if (pairNum == 0)
{
*x = arg0;
*y = arg1;
*x = startX;
*y = startY;
return;
}
if (arg5 >= arg4)
if (pairNum >= pairMax)
{
*x = arg2;
*y = arg3;
*x = endX;
*y = endY;
return;
}
arg4--;
x2 = (arg0 << 8) + arg5 * (((arg2 - arg0) << 8) / arg4);
y2 = (arg1 << 8) + arg5 * (((arg3 - arg1) << 8) / arg4);
pairMax--;
x2 = (startX << 8) + pairNum * (((endX - startX) << 8) / pairMax);
y2 = (startY << 8) + pairNum * (((endY - startY) << 8) / pairMax);
*x = x2 >> 8;
*y = y2 >> 8;
}
static void AnimGlareEyeDot(struct Sprite *sprite)
{
if (++sprite->data[0] > 36)
if (++sprite->sTimer > 36)
{
gTasks[sprite->data[1]].data[sprite->data[2]]--;
gTasks[sprite->sTaskId].data[sprite->sActiveSpritesIdx]--;
DestroySprite(sprite);
}
}
#undef IDX_ACTIVE_SPRITES
#undef tState
#undef tTimer
#undef tPairNum
#undef tPairMax
#undef tDotOffset
#undef tIsContest
#undef tActiveSprites
#undef tStartX
#undef tStartY
#undef tEndX
#undef tEndY
#undef sTimer
#undef sTaskId
#undef sActiveSpritesIdx
// Moves a pawprint in a straight line.
// arg 0: initial x position
// arg 1: initial y position

View File

@ -96,8 +96,8 @@ static void PlayerCmdEnd(void);
static void PlayerBufferRunCommand(void);
static void HandleInputChooseTarget(void);
static void HandleInputChooseMove(void);
static void MoveSelectionCreateCursorAt(u8 cursorPos, u8 arg1);
static void MoveSelectionDestroyCursorAt(u8 cursorPos);
static void MoveSelectionCreateCursorAt(u8, u8);
static void MoveSelectionDestroyCursorAt(u8);
static void MoveSelectionDisplayPpNumber(void);
static void MoveSelectionDisplayPpString(void);
static void MoveSelectionDisplayMoveType(void);
@ -106,18 +106,18 @@ static void HandleMoveSwitching(void);
static void SwitchIn_HandleSoundAndEnd(void);
static void WaitForMonSelection(void);
static void CompleteWhenChoseItem(void);
static void Task_LaunchLvlUpAnim(u8 taskId);
static void Task_PrepareToGiveExpWithExpBar(u8 taskId);
static void DestroyExpTaskAndCompleteOnInactiveTextPrinter(u8 taskId);
static void Task_GiveExpWithExpBar(u8 taskId);
static void Task_UpdateLvlInHealthbox(u8 taskId);
static void Task_LaunchLvlUpAnim(u8);
static void Task_PrepareToGiveExpWithExpBar(u8);
static void DestroyExpTaskAndCompleteOnInactiveTextPrinter(u8);
static void Task_GiveExpWithExpBar(u8);
static void Task_UpdateLvlInHealthbox(u8);
static void PrintLinkStandbyMsg(void);
static u32 CopyPlayerMonData(u8 monId, u8 *dst);
static void SetPlayerMonData(u8 monId);
static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit);
static u32 CopyPlayerMonData(u8, u8 *);
static void SetPlayerMonData(u8);
static void StartSendOutAnim(u8, bool8);
static void DoSwitchOutAnimation(void);
static void PlayerDoMoveAnimation(void);
static void Task_StartSendOutAnim(u8 taskId);
static void Task_StartSendOutAnim(u8);
static void EndDrawPartyStatusSummary(void);
static void (*const sPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
@ -1507,11 +1507,11 @@ static void MoveSelectionDisplayMoveType(void)
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MOVE_TYPE);
}
static void MoveSelectionCreateCursorAt(u8 cursorPosition, u8 arg1)
static void MoveSelectionCreateCursorAt(u8 cursorPosition, u8 baseTileNum)
{
u16 src[2];
src[0] = arg1 + 1;
src[1] = arg1 + 2;
src[0] = baseTileNum + 1;
src[1] = baseTileNum + 2;
CopyToBgTilemapBufferRect_ChangePalette(0, src, 9 * (cursorPosition & 1) + 1, 55 + (cursorPosition & 2), 1, 2, 0x11);
CopyBgTilemapBufferToVram(0);
@ -1527,7 +1527,7 @@ static void MoveSelectionDestroyCursorAt(u8 cursorPosition)
CopyBgTilemapBufferToVram(0);
}
void ActionSelectionCreateCursorAt(u8 cursorPosition, u8 arg1)
void ActionSelectionCreateCursorAt(u8 cursorPosition, u8 baseTileNum)
{
u16 src[2];
src[0] = 1;

View File

@ -1168,13 +1168,13 @@ void BtlController_EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpN
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, sizeof(*movePpData) + 4);
}
void BtlController_EmitChooseItem(u8 bufferId, u8 *arg1)
void BtlController_EmitChooseItem(u8 bufferId, u8 *battlePartyOrder)
{
s32 i;
sBattleBuffersTransferData[0] = CONTROLLER_OPENBAG;
for (i = 0; i < 3; i++)
sBattleBuffersTransferData[1 + i] = arg1[i];
for (i = 0; i < PARTY_SIZE / 2; i++)
sBattleBuffersTransferData[1 + i] = battlePartyOrder[i];
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
}
@ -1309,12 +1309,12 @@ void BtlController_EmitCmd32(u8 bufferId, u16 size, void *data)
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 3);
}
void BtlController_EmitTwoReturnValues(u8 bufferId, u8 arg1, u16 arg2)
void BtlController_EmitTwoReturnValues(u8 bufferId, u8 ret8, u16 ret16)
{
sBattleBuffersTransferData[0] = CONTROLLER_TWORETURNVALUES;
sBattleBuffersTransferData[1] = arg1;
sBattleBuffersTransferData[2] = arg2;
sBattleBuffersTransferData[3] = (arg2 & 0xFF00) >> 8;
sBattleBuffersTransferData[1] = ret8;
sBattleBuffersTransferData[2] = ret16;
sBattleBuffersTransferData[3] = (ret16 & 0xFF00) >> 8;
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
}
@ -1329,20 +1329,20 @@ void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 partyId, u8 *battleP
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 5);
}
void BtlController_EmitOneReturnValue(u8 bufferId, u16 arg1)
void BtlController_EmitOneReturnValue(u8 bufferId, u16 ret)
{
sBattleBuffersTransferData[0] = CONTROLLER_ONERETURNVALUE;
sBattleBuffersTransferData[1] = arg1;
sBattleBuffersTransferData[2] = (arg1 & 0xFF00) >> 8;
sBattleBuffersTransferData[1] = ret;
sBattleBuffersTransferData[2] = (ret & 0xFF00) >> 8;
sBattleBuffersTransferData[3] = 0;
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
}
void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 b)
void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 ret)
{
sBattleBuffersTransferData[0] = CONTROLLER_ONERETURNVALUE_DUPLICATE;
sBattleBuffersTransferData[1] = b;
sBattleBuffersTransferData[2] = (b & 0xFF00) >> 8;
sBattleBuffersTransferData[1] = ret;
sBattleBuffersTransferData[2] = (ret & 0xFF00) >> 8;
sBattleBuffersTransferData[3] = 0;
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
}

View File

@ -73,40 +73,39 @@ struct TourneyTreeLineSection
#define tMode data[2]
#define tPrevTaskId data[3]
// This file's functions.
static u8 GetDomeTrainerMonIvs(u16 trainerId);
static void SwapDomeTrainers(int id1, int id2, u16 *statsArray);
static void CalcDomeMonStats(u16 species, int level, int ivs, u8 evBits, u8 nature, int *stats);
static void CreateDomeOpponentMons(u16 tournamentTrainerId);
static int SelectOpponentMonsUsingPersonality(u16 tournamentTrainerId, bool8 arg1);
static int SelectOpponentMonsUsingOtId(u16 tournamentTrainerId, bool8 arg1);
static int GetTypeEffectivenessPoints(int move, int species, int arg2);
static int SelectOpponentMonsFromParty(int *arr, bool8 arg1);
static void Task_ShowTourneyInfoCard(u8 taskId);
static void Task_HandleInfoCardInput(u8 taskId);
static u8 Task_GetInfoCardInput(u8 taskId);
static u8 GetDomeTrainerMonIvs(u16);
static void SwapDomeTrainers(int, int, u16 *);
static void CalcDomeMonStats(u16, int, int, u8, u8, int *);
static void CreateDomeOpponentMons(u16);
static int SelectOpponentMonsUsingPersonality(u16, bool8);
static int SelectOpponentMonsUsingOtId(u16, bool8);
static int GetTypeEffectivenessPoints(int, int, int);
static int SelectOpponentMonsFromParty(int *, bool8);
static void Task_ShowTourneyInfoCard(u8);
static void Task_HandleInfoCardInput(u8);
static u8 Task_GetInfoCardInput(u8);
static void SetFacilityTrainerAndMonPtrs(void);
static int TrainerIdToTournamentId(u16 trainerId);
static int TrainerIdToTournamentId(u16);
static u16 TrainerIdOfPlayerOpponent(void);
static void Task_ShowTourneyTree(u8 taskId);
static void Task_HandleStaticTourneyTreeInput(u8 taskId);
static void Task_ShowTourneyTree(u8);
static void Task_HandleStaticTourneyTreeInput(u8);
static void CB2_TourneyTree(void);
static void VblankCb_TourneyInfoCard(void);
static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo);
static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId);
static void DisplayMatchInfoOnCard(u8, u8);
static void DisplayTrainerInfoOnCard(u8, u8);
static int BufferDomeWinString(u8, u8*);
static u8 GetDomeBrainTrainerPicId(void);
static u8 GetDomeBrainTrainerClass(void);
static void CopyDomeBrainTrainerName(u8 *str);
static void CopyDomeTrainerName(u8 *str, u16 trainerId);
static void CopyDomeBrainTrainerName(u8 *);
static void CopyDomeTrainerName(u8 *, u16);
static void HblankCb_TourneyTree(void);
static void VblankCb_TourneyTree(void);
static u8 UpdateTourneyTreeCursor(u8 taskId);
static void DecideRoundWinners(u8 roundId);
static u8 GetOpposingNPCTournamentIdByRound(u8 tournamentId, u8);
static u8 UpdateTourneyTreeCursor(u8);
static void DecideRoundWinners(u8);
static u8 GetOpposingNPCTournamentIdByRound(u8, u8);
static void DrawTourneyAdvancementLine(u8, u8);
static void SpriteCb_HorizontalScrollArrow(struct Sprite *sprite);
static void SpriteCb_VerticalScrollArrow(struct Sprite *sprite);
static void SpriteCb_HorizontalScrollArrow(struct Sprite *);
static void SpriteCb_VerticalScrollArrow(struct Sprite *);
static void InitDomeChallenge(void);
static void GetDomeData(void);
static void SetDomeData(void);
@ -130,7 +129,6 @@ static void BufferLastDomeWinnerName(void);
static void InitRandomTourneyTreeResults(void);
static void InitDomeTrainers(void);
// EWRAM variables.
EWRAM_DATA u32 gPlayerPartyLostHP = 0; // never read
static EWRAM_DATA u32 sPlayerPartyMaxHP = 0; // never read
static EWRAM_DATA struct TourneyTreeInfoCard *sInfoCard = {0};
@ -2080,7 +2078,6 @@ static const u8 sTourneyTreeLineSectionArrayCounts[DOME_TOURNAMENT_TRAINERS_COUN
{ARRAY_COUNT(sLineSectionTrainer16Round1), ARRAY_COUNT(sLineSectionTrainer16Round2), ARRAY_COUNT(sLineSectionTrainer16Semifinal), ARRAY_COUNT(sLineSectionTrainer16Final)},
};
// code
void CallBattleDomeFunction(void)
{
sBattleDomeFunctions[gSpecialVar_0x8004]();

View File

@ -353,12 +353,12 @@ void SpriteCB_WaitForBattlerBallReleaseAnim(struct Sprite *sprite)
}
}
static void UnusedDoBattleSpriteAffineAnim(struct Sprite *sprite, bool8 arg1)
static void UnusedDoBattleSpriteAffineAnim(struct Sprite *sprite, bool8 pointless)
{
sprite->animPaused = TRUE;
sprite->callback = SpriteCallbackDummy;
if (!arg1)
if (!pointless)
StartSpriteAffineAnim(sprite, 1);
else
StartSpriteAffineAnim(sprite, 1);
@ -783,7 +783,7 @@ bool8 BattleLoadAllHealthBoxesGfx(u8 state)
return retVal;
}
void LoadBattleBarGfx(u8 arg0)
void LoadBattleBarGfx(u8 unused)
{
LZDecompressWram(gBattleInterfaceGfx_BattleBar, gMonSpritesGfxPtr->barFontGfx);
}

View File

@ -158,36 +158,36 @@ enum
HEALTHBOX_GFX_FRAME_END_BAR,
};
static const u8 *GetHealthboxElementGfxPtr(u8 elementId);
static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *str, u32 x, u32 y, u32 bgColor, u32 *windowId);
static const u8 *GetHealthboxElementGfxPtr(u8);
static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *, u32, u32, u32, u32 *);
static void RemoveWindowOnHealthbox(u32 windowId);
static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent);
static void UpdateStatusIconInHealthbox(u8 healthboxSpriteId);
static void UpdateHpTextInHealthboxInDoubles(u8, s16, u8);
static void UpdateStatusIconInHealthbox(u8);
static void TextIntoHealthboxObject(void *dest, u8 *windowTileData, s32 windowWidth);
static void SafariTextIntoHealthboxObject(void *dest, u8 *windowTileData, u32 windowWidth);
static void HpTextIntoHealthboxObject(void *dest, u8 *windowTileData, u32 windowWidth);
static void FillHealthboxObject(void *dest, u32 arg1, u32 arg2);
static void TextIntoHealthboxObject(void *, u8 *, s32);
static void SafariTextIntoHealthboxObject(void *, u8 *, u32);
static void HpTextIntoHealthboxObject(void *, u8 *, u32);
static void FillHealthboxObject(void *, u32, u32);
static void Task_HidePartyStatusSummary_BattleStart_1(u8 taskId);
static void Task_HidePartyStatusSummary_BattleStart_2(u8 taskId);
static void Task_HidePartyStatusSummary_DuringBattle(u8 taskId);
static void Task_HidePartyStatusSummary_BattleStart_1(u8);
static void Task_HidePartyStatusSummary_BattleStart_2(u8);
static void Task_HidePartyStatusSummary_DuringBattle(u8);
static void SpriteCB_HealthBoxOther(struct Sprite *sprite);
static void SpriteCB_HealthBar(struct Sprite *sprite);
static void SpriteCB_StatusSummaryBar_Enter(struct Sprite *sprite);
static void SpriteCB_StatusSummaryBar_Exit(struct Sprite *sprite);
static void SpriteCB_StatusSummaryBalls_Enter(struct Sprite *sprite);
static void SpriteCB_StatusSummaryBalls_Exit(struct Sprite *sprite);
static void SpriteCB_StatusSummaryBalls_OnSwitchout(struct Sprite *sprite);
static void SpriteCB_HealthBoxOther(struct Sprite *);
static void SpriteCB_HealthBar(struct Sprite *);
static void SpriteCB_StatusSummaryBar_Enter(struct Sprite *);
static void SpriteCB_StatusSummaryBar_Exit(struct Sprite *);
static void SpriteCB_StatusSummaryBalls_Enter(struct Sprite *);
static void SpriteCB_StatusSummaryBalls_Exit(struct Sprite *);
static void SpriteCB_StatusSummaryBalls_OnSwitchout(struct Sprite *);
static u8 GetStatusIconForBattlerId(u8 statusElementId, u8 battlerId);
static s32 CalcNewBarValue(s32 maxValue, s32 currValue, s32 receivedValue, s32 *arg3, u8 arg4, u16 arg5);
static u8 GetScaledExpFraction(s32 currValue, s32 receivedValue, s32 maxValue, u8 scale);
static void MoveBattleBarGraphically(u8 battlerId, u8 whichBar);
static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32 *currValue, u8 *arg4, u8 scale);
static void Debug_TestHealthBar_Helper(struct TestingBar *barInfo, s32 *arg1, u16 *arg2);
static u8 GetStatusIconForBattlerId(u8, u8);
static s32 CalcNewBarValue(s32, s32, s32, s32 *, u8, u16);
static u8 GetScaledExpFraction(s32, s32, s32, u8);
static void MoveBattleBarGraphically(u8, u8);
static u8 CalcBarFilledPixels(s32, s32, s32, s32 *, u8 *, u8);
static void Debug_TestHealthBar_Helper(struct TestingBar *, s32 *, u16 *);
static const struct OamData sOamData_64x32 =
{
@ -814,11 +814,11 @@ static void Debug_DrawNumber(s16 number, u16 *dest, bool8 unk)
}
// Unused
static void Debug_DrawNumberPair(s16 number1, s16 number2, u16 *arg2)
static void Debug_DrawNumberPair(s16 number1, s16 number2, u16 *dest)
{
arg2[4] = 0x1E;
Debug_DrawNumber(number2, arg2, 0);
Debug_DrawNumber(number1, arg2 + 5, 1);
dest[4] = 0x1E;
Debug_DrawNumber(number2, dest, 0);
Debug_DrawNumber(number1, dest + 5, 1);
}
// Because the healthbox is too large to fit into one sprite, it is divided into two sprites.
@ -2453,19 +2453,19 @@ static s16 Debug_TestHealthBar(struct TestingBar *barInfo, s32 *currValue, u16 *
return ret;
}
static void Debug_TestHealthBar_Helper(struct TestingBar *barInfo, s32 *currValue, u16 *arg2)
static void Debug_TestHealthBar_Helper(struct TestingBar *barInfo, s32 *currValue, u16 *dest)
{
u8 sp8[6];
u16 sp10[6];
u16 src[6];
u8 i;
CalcBarFilledPixels(barInfo->maxValue, barInfo->oldValue,
barInfo->receivedValue, currValue, sp8, B_HEALTHBAR_PIXELS / 8);
for (i = 0; i < 6; i++)
sp10[i] = (barInfo->unkC_0 << 12) | (barInfo->unk10 + sp8[i]);
src[i] = (barInfo->unkC_0 << 12) | (barInfo->unk10 + sp8[i]);
CpuCopy16(sp10, arg2, sizeof(sp10));
CpuCopy16(src, dest, sizeof(src));
}
static u8 GetScaledExpFraction(s32 oldValue, s32 receivedValue, s32 maxValue, u8 scale)

View File

@ -83,18 +83,18 @@ static void ClearPyramidPartyHeldItems(void);
static void SetPyramidFloorPalette(void);
static void BattlePyramidStartMenu(void);
static void RestorePyramidPlayerParty(void);
static void InitPyramidBagItems(u8 lvlMode);
static void InitPyramidBagItems(u8);
static u8 GetPyramidFloorTemplateId(void);
static u8 GetPostBattleDirectionHintTextIndex(int *, u8, u8);
static void Task_SetPyramidFloorPalette(u8 taskId);
static void MarkPyramidTrainerAsBattled(u16 trainerId);
static void GetPyramidFloorLayoutOffsets(u8 *layoutOffsets);
static void Task_SetPyramidFloorPalette(u8);
static void MarkPyramidTrainerAsBattled(u16);
static void GetPyramidFloorLayoutOffsets(u8 *);
static void GetPyramidEntranceAndExitSquareIds(u8 *, u8 *);
static void SetPyramidObjectPositionsUniformly(u8);
static bool8 SetPyramidObjectPositionsInAndNearSquare(u8, u8);
static bool8 SetPyramidObjectPositionsNearSquare(u8, u8);
static bool8 TrySetPyramidObjectEventPositionInSquare(u8 arg0, u8 *floorLayoutOffsets, u8 squareId, u8 objectEventId);
static bool8 TrySetPyramidObjectEventPositionAtCoords(bool8 objType, u8 x, u8 y, u8 *floorLayoutOffsets, u8 squareId, u8 objectEventId);
static bool8 TrySetPyramidObjectEventPositionInSquare(u8, u8 *, u8, u8);
static bool8 TrySetPyramidObjectEventPositionAtCoords(bool8, u8, u8, u8 *, u8, u8);
// Const rom data.
#define ABILITY_RANDOM 2 // For wild mons data.

View File

@ -92,11 +92,22 @@ static const struct SpriteTemplate sEvoSparkleSpriteTemplate =
.callback = SpriteCB_Sparkle_Dummy
};
static const s16 sEvoSparkleMatrices[] =
static const u16 sEvoSparkleMatrices[] =
{
0x3C0, 0x380, 0x340, 0x300, 0x2C0, 0x280, 0x240, 0x200, 0x1C0,
0x180, 0x140, 0x100, -4, 0x10, -3, 0x30, -2, 0x50,
-1, 0x70, 0x1, 0x70, 0x2, 0x50, 0x3, 0x30, 0x4, 0x10
0x3C0, 0x380, 0x340, 0x300, 0x2C0, 0x280,
0x240, 0x200, 0x1C0, 0x180, 0x140, 0x100
};
static const s16 sUnused[] =
{
-4, 0x10,
-3, 0x30,
-2, 0x50,
-1, 0x70,
1, 0x70,
2, 0x50,
3, 0x30,
4, 0x10
};
static void SpriteCB_Sparkle_Dummy(struct Sprite *sprite)
@ -107,11 +118,14 @@ static void SpriteCB_Sparkle_Dummy(struct Sprite *sprite)
static void SetEvoSparklesMatrices(void)
{
u16 i;
for (i = 0; i < 12; i++)
{
for (i = 0; i < ARRAY_COUNT(sEvoSparkleMatrices); i++)
SetOamMatrix(20 + i, sEvoSparkleMatrices[i], 0, 0, sEvoSparkleMatrices[i]);
}
}
#define sSpeed data[3]
#define sAmplitude data[5]
#define sTrigIdx data[6]
#define sTimer data[7]
static void SpriteCB_Sparkle_SpiralUpward(struct Sprite* sprite)
{
@ -119,18 +133,18 @@ static void SpriteCB_Sparkle_SpiralUpward(struct Sprite* sprite)
{
u8 matrixNum;
sprite->y = 88 - (sprite->data[7] * sprite->data[7]) / 80;
sprite->y2 = Sin((u8)(sprite->data[6]), sprite->data[5]) / 4;
sprite->x2 = Cos((u8)(sprite->data[6]), sprite->data[5]);
sprite->data[6] += 4;
if (sprite->data[7] & 1)
sprite->data[5]--;
sprite->data[7]++;
sprite->y = 88 - (sprite->sTimer * sprite->sTimer) / 80;
sprite->y2 = Sin((u8)sprite->sTrigIdx, sprite->sAmplitude) / 4;
sprite->x2 = Cos((u8)sprite->sTrigIdx, sprite->sAmplitude);
sprite->sTrigIdx += 4;
if (sprite->sTimer & 1)
sprite->sAmplitude--;
sprite->sTimer++;
if (sprite->y2 > 0)
sprite->subpriority = 1;
else
sprite->subpriority = 20;
matrixNum = sprite->data[5] / 4 + 20;
matrixNum = sprite->sAmplitude / 4 + 20;
if (matrixNum > 31)
matrixNum = 31;
sprite->oam.matrixNum = matrixNum;
@ -139,17 +153,17 @@ static void SpriteCB_Sparkle_SpiralUpward(struct Sprite* sprite)
DestroySprite(sprite);
}
static void CreateSparkle_SpiralUpward(u8 arg0)
static void CreateSparkle_SpiralUpward(u8 trigIdx)
{
u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 88, 0);
if (spriteID != MAX_SPRITES)
u8 spriteId = CreateSprite(&sEvoSparkleSpriteTemplate, DISPLAY_WIDTH / 2, 88, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteID].data[5] = 48;
gSprites[spriteID].data[6] = arg0;
gSprites[spriteID].data[7] = 0;
gSprites[spriteID].oam.affineMode = ST_OAM_AFFINE_NORMAL;
gSprites[spriteID].oam.matrixNum = 31;
gSprites[spriteID].callback = SpriteCB_Sparkle_SpiralUpward;
gSprites[spriteId].sAmplitude = 48;
gSprites[spriteId].sTrigIdx = trigIdx;
gSprites[spriteId].sTimer = 0;
gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL;
gSprites[spriteId].oam.matrixNum = 31;
gSprites[spriteId].callback = SpriteCB_Sparkle_SpiralUpward;
}
}
@ -157,85 +171,85 @@ static void SpriteCB_Sparkle_ArcDown(struct Sprite* sprite)
{
if (sprite->y < 88)
{
sprite->y = 8 + (sprite->data[7] * sprite->data[7]) / 5;
sprite->y2 = Sin((u8)(sprite->data[6]), sprite->data[5]) / 4;
sprite->x2 = Cos((u8)(sprite->data[6]), sprite->data[5]);
sprite->data[5] = 8 + Sin((u8)(sprite->data[7] * 4), 40);
sprite->data[7]++;
sprite->y = 8 + (sprite->sTimer * sprite->sTimer) / 5;
sprite->y2 = Sin((u8)sprite->sTrigIdx, sprite->sAmplitude) / 4;
sprite->x2 = Cos((u8)sprite->sTrigIdx, sprite->sAmplitude);
sprite->sAmplitude = 8 + Sin((u8)(sprite->sTimer * 4), 40);
sprite->sTimer++;
}
else
DestroySprite(sprite);
}
static void CreateSparkle_ArcDown(u8 arg0)
static void CreateSparkle_ArcDown(u8 trigIdx)
{
u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 8, 0);
if (spriteID != MAX_SPRITES)
u8 spriteId = CreateSprite(&sEvoSparkleSpriteTemplate, DISPLAY_WIDTH / 2, 8, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteID].data[5] = 8;
gSprites[spriteID].data[6] = arg0;
gSprites[spriteID].data[7] = 0;
gSprites[spriteID].oam.affineMode = ST_OAM_AFFINE_NORMAL;
gSprites[spriteID].oam.matrixNum = 25;
gSprites[spriteID].subpriority = 1;
gSprites[spriteID].callback = SpriteCB_Sparkle_ArcDown;
gSprites[spriteId].sAmplitude = 8;
gSprites[spriteId].sTrigIdx = trigIdx;
gSprites[spriteId].sTimer = 0;
gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL;
gSprites[spriteId].oam.matrixNum = 25;
gSprites[spriteId].subpriority = 1;
gSprites[spriteId].callback = SpriteCB_Sparkle_ArcDown;
}
}
static void SpriteCB_Sparkle_CircleInward(struct Sprite* sprite)
{
if (sprite->data[5] > 8)
if (sprite->sAmplitude > 8)
{
sprite->y2 = Sin((u8)(sprite->data[6]), sprite->data[5]);
sprite->x2 = Cos((u8)(sprite->data[6]), sprite->data[5]);
sprite->data[5] -= sprite->data[3];
sprite->data[6] += 4;
sprite->y2 = Sin((u8)sprite->sTrigIdx, sprite->sAmplitude);
sprite->x2 = Cos((u8)sprite->sTrigIdx, sprite->sAmplitude);
sprite->sAmplitude -= sprite->sSpeed;
sprite->sTrigIdx += 4;
}
else
DestroySprite(sprite);
}
static void CreateSparkle_CircleInward(u8 arg0, u8 arg1)
static void CreateSparkle_CircleInward(u8 trigIdx, u8 speed)
{
u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 56, 0);
if (spriteID != MAX_SPRITES)
u8 spriteId = CreateSprite(&sEvoSparkleSpriteTemplate, DISPLAY_WIDTH / 2, 56, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteID].data[3] = arg1;
gSprites[spriteID].data[5] = 120;
gSprites[spriteID].data[6] = arg0;
gSprites[spriteID].data[7] = 0;
gSprites[spriteID].oam.affineMode = ST_OAM_AFFINE_NORMAL;
gSprites[spriteID].oam.matrixNum = 31;
gSprites[spriteID].subpriority = 1;
gSprites[spriteID].callback = SpriteCB_Sparkle_CircleInward;
gSprites[spriteId].sSpeed = speed;
gSprites[spriteId].sAmplitude = 120;
gSprites[spriteId].sTrigIdx = trigIdx;
gSprites[spriteId].sTimer = 0;
gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL;
gSprites[spriteId].oam.matrixNum = 31;
gSprites[spriteId].subpriority = 1;
gSprites[spriteId].callback = SpriteCB_Sparkle_CircleInward;
}
}
static void SpriteCB_Sparkle_Spray(struct Sprite* sprite)
{
if (!(sprite->data[7] & 3))
if (!(sprite->sTimer & 3))
sprite->y++;
if (sprite->data[6] < 128)
if (sprite->sTrigIdx < 128)
{
u8 matrixNum;
sprite->y2 = -Sin((u8)(sprite->data[6]), sprite->data[5]);
sprite->x = 120 + (sprite->data[3] * sprite->data[7]) / 3;
sprite->data[6]++;
matrixNum = 31 - (sprite->data[6] * 12 / 128);
if (sprite->data[6] > 64)
sprite->y2 = -Sin((u8)sprite->sTrigIdx, sprite->sAmplitude);
sprite->x = (DISPLAY_WIDTH / 2) + (sprite->sSpeed * sprite->sTimer) / 3;
sprite->sTrigIdx++;
matrixNum = 31 - (sprite->sTrigIdx * 12 / 128);
if (sprite->sTrigIdx > 64)
sprite->subpriority = 1;
else
{
sprite->invisible = FALSE;
sprite->subpriority = 20;
if (sprite->data[6] > 112 && sprite->data[6] & 1)
if (sprite->sTrigIdx > 112 && sprite->sTrigIdx & 1)
sprite->invisible = TRUE;
}
if (matrixNum < 20)
matrixNum = 20;
sprite->oam.matrixNum = matrixNum;
sprite->data[7]++;
sprite->sTimer++;
}
else
DestroySprite(sprite);
@ -243,16 +257,16 @@ static void SpriteCB_Sparkle_Spray(struct Sprite* sprite)
static void CreateSparkle_Spray(u8 id)
{
u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 56, 0);
if (spriteID != MAX_SPRITES)
u8 spriteId = CreateSprite(&sEvoSparkleSpriteTemplate, DISPLAY_WIDTH / 2, 56, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteID].data[3] = 3 - (Random() % 7);
gSprites[spriteID].data[5] = 48 + (Random() & 0x3F);
gSprites[spriteID].data[7] = 0;
gSprites[spriteID].oam.affineMode = ST_OAM_AFFINE_NORMAL;
gSprites[spriteID].oam.matrixNum = 31;
gSprites[spriteID].subpriority = 20;
gSprites[spriteID].callback = SpriteCB_Sparkle_Spray;
gSprites[spriteId].sSpeed = 3 - (Random() % 7);
gSprites[spriteId].sAmplitude = 48 + (Random() & 0x3F);
gSprites[spriteId].sTimer = 0;
gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL;
gSprites[spriteId].oam.matrixNum = 31;
gSprites[spriteId].subpriority = 20;
gSprites[spriteId].callback = SpriteCB_Sparkle_Spray;
}
}
@ -289,7 +303,7 @@ static void Task_Sparkles_SpiralUpward(u8 taskId)
{
u8 i;
for (i = 0; i < 4; i++)
CreateSparkle_SpiralUpward((0x78 & gTasks[taskId].tTimer) * 2 + i * 64);
CreateSparkle_SpiralUpward((gTasks[taskId].tTimer & 120) * 2 + i * 64);
}
gTasks[taskId].tTimer++;
}

View File

@ -312,14 +312,14 @@ static void ListMenuDummyTask(u8 taskId)
}
s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum)
s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 drawMode, u16 tileNum, u16 palNum)
{
switch (sMysteryGiftLinkMenu.state)
{
case 0:
default:
sMysteryGiftLinkMenu.windowId = AddWindow(windowTemplate);
switch (arg2)
switch (drawMode)
{
case 2:
LoadUserWindowBorderGfx(sMysteryGiftLinkMenu.windowId, tileNum, palNum);
@ -346,13 +346,13 @@ s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const str
}
if (sMysteryGiftLinkMenu.state == 2)
{
if (arg2 == 0)
if (drawMode == 0)
{
ClearWindowTilemap(sMysteryGiftLinkMenu.windowId);
}
else
{
switch (arg2)
switch (drawMode)
{
case 0: // can never be reached, because of the if statement above
ClearStdWindowAndFrame(sMysteryGiftLinkMenu.windowId, FALSE);

View File

@ -153,7 +153,7 @@ void DoYesNoFuncWithChoice(u8 taskId, const struct YesNoFuncTable *data)
gTasks[taskId].func = Task_CallYesOrNoCallback;
}
void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *template, u8 arg2, u8 arg3, u8 arg4, u16 tileStart, u8 palette, const struct YesNoFuncTable *yesNo)
void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *template, u8 unused1, u8 unused2, u8 unused3, u16 tileStart, u8 palette, const struct YesNoFuncTable *yesNo)
{
CreateYesNoMenu(template, tileStart, palette, 0);
sYesNo = *yesNo;
@ -176,17 +176,18 @@ static void Task_CallYesOrNoCallback(u8 taskId)
}
}
bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1)
// Returns TRUE if the quantity was changed, FALSE if it remained the same
bool8 AdjustQuantityAccordingToDPadInput(s16 *quantity, u16 max)
{
s16 valBefore = (*arg0);
s16 valBefore = *quantity;
if ((JOY_REPEAT(DPAD_ANY)) == DPAD_UP)
if (JOY_REPEAT(DPAD_ANY) == DPAD_UP)
{
(*arg0)++;
if ((*arg0) > arg1)
(*arg0) = 1;
(*quantity)++;
if (*quantity > max)
*quantity = 1;
if ((*arg0) == valBefore)
if (*quantity == valBefore)
{
return FALSE;
}
@ -196,13 +197,13 @@ bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1)
return TRUE;
}
}
else if ((JOY_REPEAT(DPAD_ANY)) == DPAD_DOWN)
else if (JOY_REPEAT(DPAD_ANY) == DPAD_DOWN)
{
(*arg0)--;
if ((*arg0) <= 0)
(*arg0) = arg1;
(*quantity)--;
if (*quantity <= 0)
*quantity = max;
if ((*arg0) == valBefore)
if (*quantity == valBefore)
{
return FALSE;
}
@ -212,13 +213,13 @@ bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1)
return TRUE;
}
}
else if ((JOY_REPEAT(DPAD_ANY)) == DPAD_RIGHT)
else if (JOY_REPEAT(DPAD_ANY) == DPAD_RIGHT)
{
(*arg0) += 10;
if ((*arg0) > arg1)
(*arg0) = arg1;
*quantity += 10;
if (*quantity > max)
*quantity = max;
if ((*arg0) == valBefore)
if (*quantity == valBefore)
{
return FALSE;
}
@ -228,13 +229,13 @@ bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1)
return TRUE;
}
}
else if ((JOY_REPEAT(DPAD_ANY)) == DPAD_LEFT)
else if (JOY_REPEAT(DPAD_ANY) == DPAD_LEFT)
{
(*arg0) -= 10;
if ((*arg0) <= 0)
(*arg0) = 1;
*quantity -= 10;
if (*quantity <= 0)
*quantity = 1;
if ((*arg0) == valBefore)
if (*quantity == valBefore)
{
return FALSE;
}

View File

@ -230,7 +230,7 @@ static u32 Client_Run(struct MysteryGiftClient * client)
MysteryGift_TrySaveStamp(client->recvBuffer);
break;
case CLI_SAVE_RAM_SCRIPT:
InitRamScript_NoObjectEvent(client->recvBuffer, 1000);
InitRamScript_NoObjectEvent(client->recvBuffer, sizeof(struct RamScriptData));
break;
case CLI_RECV_EREADER_TRAINER:
memcpy(&gSaveBlock2Ptr->frontier.ereaderTrainer, client->recvBuffer, sizeof(gSaveBlock2Ptr->frontier.ereaderTrainer));

View File

@ -438,7 +438,7 @@ static void SpriteCB_BallThrow(struct Sprite *sprite)
sprite->y2 = 0;
sprite->data[5] = 0;
ballId = ItemIdToBallId(GetBattlerPokeballItemId(opponentBattler));
AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 0x1C, ballId);
AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 28, ballId);
sprite->data[0] = LaunchBallFadeMonTask(FALSE, opponentBattler, 14, ballId);
sprite->sBattler = opponentBattler;
sprite->data[7] = noOfShakes;
@ -752,7 +752,7 @@ static void SpriteCB_ReleaseMonFromBall(struct Sprite *sprite)
StartSpriteAnim(sprite, 1);
ballId = ItemIdToBallId(GetBattlerPokeballItemId(battlerId));
AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 0x1C, ballId);
AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 28, ballId);
sprite->data[0] = LaunchBallFadeMonTask(TRUE, sprite->sBattler, 14, ballId);
sprite->callback = HandleBallAnimEnd;
@ -1000,14 +1000,14 @@ static void SpriteCB_OpponentMonSendOut(struct Sprite *sprite)
#undef sBattler
static u8 AnimateBallOpenParticlesForPokeball(u8 x, u8 y, u8 kindOfStars, u8 d)
static u8 AnimateBallOpenParticlesForPokeball(u8 x, u8 y, u8 kindOfStars, u8 subpriority)
{
return AnimateBallOpenParticles(x, y, kindOfStars, d, BALL_POKE);
return AnimateBallOpenParticles(x, y, kindOfStars, subpriority, BALL_POKE);
}
static u8 LaunchBallFadeMonTaskForPokeball(bool8 unFadeLater, u8 battlerId, u32 arg2)
static u8 LaunchBallFadeMonTaskForPokeball(bool8 unFadeLater, u8 battlerId, u32 selectedPalettes)
{
return LaunchBallFadeMonTask(unFadeLater, battlerId, arg2, BALL_POKE);
return LaunchBallFadeMonTask(unFadeLater, battlerId, selectedPalettes, BALL_POKE);
}
// Pokeball in Birch intro, and when receiving via trade
@ -1041,24 +1041,24 @@ static void SpriteCB_PokeballReleaseMon(struct Sprite *sprite)
{
if (sprite->data[1] == 0)
{
u8 r5;
u8 r7 = sprite->data[0];
u8 subpriority;
u8 spriteId = sprite->data[0];
u8 battlerId = sprite->data[2];
u32 r4 = (u16)sprite->data[3] | ((u16)sprite->data[4] << 16);
u32 selectedPalettes = (u16)sprite->data[3] | ((u16)sprite->data[4] << 16);
if (sprite->subpriority != 0)
r5 = sprite->subpriority - 1;
subpriority = sprite->subpriority - 1;
else
r5 = 0;
subpriority = 0;
StartSpriteAnim(sprite, 1);
AnimateBallOpenParticlesForPokeball(sprite->x, sprite->y - 5, sprite->oam.priority, r5);
sprite->data[1] = LaunchBallFadeMonTaskForPokeball(1, battlerId, r4);
AnimateBallOpenParticlesForPokeball(sprite->x, sprite->y - 5, sprite->oam.priority, subpriority);
sprite->data[1] = LaunchBallFadeMonTaskForPokeball(1, battlerId, selectedPalettes);
sprite->callback = SpriteCB_ReleasedMonFlyOut;
gSprites[r7].invisible = FALSE;
StartSpriteAffineAnim(&gSprites[r7], BATTLER_AFFINE_EMERGE);
AnimateSprite(&gSprites[r7]);
gSprites[r7].data[1] = 0x1000;
gSprites[spriteId].invisible = FALSE;
StartSpriteAffineAnim(&gSprites[spriteId], BATTLER_AFFINE_EMERGE);
AnimateSprite(&gSprites[spriteId]);
gSprites[spriteId].data[1] = 0x1000;
sprite->data[7] = 0;
}
else
@ -1134,19 +1134,19 @@ static void SpriteCB_TradePokeball(struct Sprite *sprite)
{
if (sprite->data[1] == 0)
{
u8 r6;
u8 subpriority;
u8 monSpriteId = sprite->data[0];
u8 r8 = sprite->data[2];
u32 r5 = (u16)sprite->data[3] | ((u16)sprite->data[4] << 16);
u8 battlerId = sprite->data[2];
u32 selectedPalettes = (u16)sprite->data[3] | ((u16)sprite->data[4] << 16);
if (sprite->subpriority != 0)
r6 = sprite->subpriority - 1;
subpriority = sprite->subpriority - 1;
else
r6 = 0;
subpriority = 0;
StartSpriteAnim(sprite, 1);
AnimateBallOpenParticlesForPokeball(sprite->x, sprite->y - 5, sprite->oam.priority, r6);
sprite->data[1] = LaunchBallFadeMonTaskForPokeball(1, r8, r5);
AnimateBallOpenParticlesForPokeball(sprite->x, sprite->y - 5, sprite->oam.priority, subpriority);
sprite->data[1] = LaunchBallFadeMonTaskForPokeball(1, battlerId, selectedPalettes);
sprite->callback = SpriteCB_TradePokeballSendOff;
#ifdef BUGFIX
// FIX: If this is used on a sprite that has previously had an affine animation, it will not

View File

@ -5379,10 +5379,10 @@ u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit)
return offset;
}
static void BufferStatRoseMessage(s32 arg0)
static void BufferStatRoseMessage(s32 statIdx)
{
gBattlerTarget = gBattlerInMenuId;
StringCopy(gBattleTextBuff1, gStatNamesTable[sStatsToRaise[arg0]]);
StringCopy(gBattleTextBuff1, gStatNamesTable[sStatsToRaise[statIdx]]);
StringCopy(gBattleTextBuff2, gText_StatRose);
BattleStringExpandPlaceholdersToDisplayedString(gText_DefendersStatRose);
}

View File

@ -2205,7 +2205,7 @@ static bool32 AreLinkQueuesEmpty(void)
return !gRfu.recvQueue.count && !gRfu.sendQueue.count;
}
static int GetNumPlayersForBonus(u8 *arg0)
static int GetNumPlayersForBonus(u8 *atJumpPeak)
{
int i = 0;
int flags = 0;
@ -2213,7 +2213,7 @@ static int GetNumPlayersForBonus(u8 *arg0)
for (; i < MAX_RFU_PLAYERS; i++)
{
if (arg0[i])
if (atJumpPeak[i])
{
flags |= 1 << i;
count++;

View File

@ -8476,11 +8476,11 @@ static void MultiMove_ClearIconFromBg(u8 x, u8 y)
}
}
static void MultiMove_InitMove(u16 x, u16 y, u16 arg2)
static void MultiMove_InitMove(u16 x, u16 y, u16 moveSteps)
{
sMultiMove->bgX = x;
sMultiMove->bgY = y;
sMultiMove->bgMoveSteps = arg2;
sMultiMove->bgMoveSteps = moveSteps;
}
static u8 MultiMove_UpdateMove(void)

View File

@ -332,7 +332,7 @@ u8 *CopyStringLeftAlignedToConditionData(u8 *dst, const u8 *src, s16 n)
return dst;
}
static u8 *CopyConditionMonNameGender(u8 *str, u16 listId, bool8 arg3)
static u8 *CopyConditionMonNameGender(u8 *str, u16 listId, bool8 skipPadding)
{
u16 boxId, monId, gender, species, level, lvlDigits;
struct BoxPokemon *boxMon;
@ -412,7 +412,7 @@ static u8 *CopyConditionMonNameGender(u8 *str, u16 listId, bool8 arg3)
str_ = ConvertIntToDecimalStringN(str_, level, STR_CONV_MODE_LEFT_ALIGN, 3);
lvlDigits = str_ - txtPtr;
*(str_++) = CHAR_SPACE;
if (!arg3)
if (!skipPadding)
{
lvlDigits = 3 - lvlDigits;
while (lvlDigits-- != 0)

View File

@ -81,14 +81,11 @@ static const u8 sMovement_FaceUp[] =
MOVEMENT_ACTION_STEP_END
};
// This file's functions.
static void SaveRotatingTileObject(u8 eventTemplateId, u8 arg1);
static void TurnUnsavedRotatingTileObject(u8 eventTemplateId, u8 arg1);
static void SaveRotatingTileObject(u8, u8);
static void TurnUnsavedRotatingTileObject(u8, u8);
// EWRAM vars
EWRAM_DATA static struct RotatingTilePuzzle *sRotatingTilePuzzle = NULL;
// code
void InitRotatingTilePuzzle(bool8 isTrickHouse)
{
if (sRotatingTilePuzzle == NULL)