Skip to content

Commit

Permalink
pret merge 2023-10-02 (#3372)
Browse files Browse the repository at this point in the history
  • Loading branch information
AsparagusEduardo authored Oct 2, 2023
2 parents 20e3b43 + 4febd2c commit 966f89e
Show file tree
Hide file tree
Showing 116 changed files with 931 additions and 1,029 deletions.
4 changes: 2 additions & 2 deletions gflib/string_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ u8 *ConvertIntToHexStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8

if (state == WRITING_DIGITS)
{
char *out = dest++;
u8 *out = dest++;

if (digit <= 0xF)
c = sDigits[digit];
Expand All @@ -310,7 +310,7 @@ u8 *ConvertIntToHexStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8
}
else if (digit != 0 || powerOfSixteen == 1)
{
char *out;
u8 *out;
state = WRITING_DIGITS;
out = dest++;

Expand Down
6 changes: 2 additions & 4 deletions gflib/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,7 @@ void DecompressGlyphTile(const void *src_, void *dest_)
*(dest++) = ((sFontHalfRowLookupTable[sFontHalfRowOffsets[temp & 0xFF]]) << 16) | (sFontHalfRowLookupTable[sFontHalfRowOffsets[temp >> 8]]);
}

// Unused
static u8 GetLastTextColor(u8 colorType)
static u8 UNUSED GetLastTextColor(u8 colorType)
{
switch (colorType)
{
Expand Down Expand Up @@ -1224,8 +1223,7 @@ static u16 RenderText(struct TextPrinter *textPrinter)
return RENDER_FINISH;
}

// Unused
static u32 GetStringWidthFixedWidthFont(const u8 *str, u8 fontId, u8 letterSpacing)
static u32 UNUSED GetStringWidthFixedWidthFont(const u8 *str, u8 fontId, u8 letterSpacing)
{
int i;
u8 width;
Expand Down
2 changes: 1 addition & 1 deletion gflib/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ void BlitBitmapRectToWindow(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u
BlitBitmapRect4Bit(&sourceRect, &destRect, srcX, srcY, destX, destY, rectWidth, rectHeight, 0);
}

static void BlitBitmapRectToWindowWithColorKey(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 colorKey)
static void UNUSED BlitBitmapRectToWindowWithColorKey(u8 windowId, const u8 *pixels, u16 srcX, u16 srcY, u16 srcWidth, int srcHeight, u16 destX, u16 destY, u16 rectWidth, u16 rectHeight, u8 colorKey)
{
struct Bitmap sourceRect;
struct Bitmap destRect;
Expand Down
7 changes: 6 additions & 1 deletion include/siirtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#define SIIRTCINFO_24HOUR 0x40 // 0: 12-hour mode, 1: 24-hour mode
#define SIIRTCINFO_POWER 0x80 // power on or power failure occurred

#define HOURS_PER_DAY 24
#define MINUTES_PER_HOUR 60
#define SECONDS_PER_MINUTE 60

enum
{
MONTH_JAN = 1,
Expand All @@ -22,7 +26,8 @@ enum
MONTH_SEP,
MONTH_OCT,
MONTH_NOV,
MONTH_DEC
MONTH_DEC,
MONTH_COUNT = MONTH_DEC
};

struct SiiRtcInfo
Expand Down
8 changes: 4 additions & 4 deletions src/AgbRfu_LinkManager.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ u8 rfu_LMAN_CHILD_connectParent(u16 parentId, u16 connect_period)
return 0;
}

static void rfu_LMAN_PARENT_stopWaitLinkRecoveryAndDisconnect(u8 bm_targetSlot)
static void UNUSED rfu_LMAN_PARENT_stopWaitLinkRecoveryAndDisconnect(u8 bm_targetSlot)
{
u8 i;

Expand Down Expand Up @@ -1295,7 +1295,7 @@ void rfu_LMAN_setMSCCallback(void (*MSC_callback_p)(u16))
rfu_setMSCCallback(rfu_LMAN_MSC_callback);
}

static void rfu_LMAN_setLMANCallback(void (*func)(u8, u8))
static void UNUSED rfu_LMAN_setLMANCallback(void (*func)(u8, u8))
{
lman.LMAN_callback = func;
}
Expand All @@ -1315,7 +1315,7 @@ u8 rfu_LMAN_setLinkRecovery(u8 enable_flag, u16 recovery_period)
return 0;
}

static u8 rfu_LMAN_setNIFailCounterLimit(u16 NI_failCounter_limit)
static u8 UNUSED rfu_LMAN_setNIFailCounterLimit(u16 NI_failCounter_limit)
{
if (gRfuLinkStatus->sendSlotNIFlag | gRfuLinkStatus->recvSlotNIFlag)
{
Expand All @@ -1327,7 +1327,7 @@ static u8 rfu_LMAN_setNIFailCounterLimit(u16 NI_failCounter_limit)
return 0;
}

static u8 rfu_LMAN_setFastSearchParent(u8 enable_flag)
static u8 UNUSED rfu_LMAN_setFastSearchParent(u8 enable_flag)
{
if (lman.state == LMAN_STATE_START_SEARCH_PARENT || lman.state == LMAN_STATE_POLL_SEARCH_PARENT || lman.state == LMAN_STATE_END_SEARCH_PARENT)
{
Expand Down
9 changes: 5 additions & 4 deletions src/apprentice.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,9 @@ static void CreateApprenticeMenu(u8 menu)
default:
left = 0;
top = 0;
#ifdef UBFIX
return;
#endif
break;
}

Expand Down Expand Up @@ -1278,8 +1281,7 @@ const u8 *GetApprenticeNameInLanguage(u32 apprenticeId, s32 language)
}
}

// Functionally unused
static void Task_SwitchToFollowupFuncAfterButtonPress(u8 taskId)
static void UNUSED Task_SwitchToFollowupFuncAfterButtonPress(u8 taskId)
{
if (JOY_NEW(A_BUTTON) || JOY_NEW(B_BUTTON))
SwitchTaskToFollowupFunc(taskId);
Expand All @@ -1302,8 +1304,7 @@ static void ExecuteFuncAfterButtonPress(void (*func)(void))
gTasks[taskId].data[1] = (u32)(func) >> 16;
}

// Unused
static void ExecuteFollowupFuncAfterButtonPress(TaskFunc task)
static void UNUSED ExecuteFollowupFuncAfterButtonPress(TaskFunc task)
{
u8 taskId = CreateTask(Task_SwitchToFollowupFuncAfterButtonPress, 1);
SetTaskFuncWithFollowupFunc(taskId, Task_SwitchToFollowupFuncAfterButtonPress, task);
Expand Down
2 changes: 1 addition & 1 deletion src/battle_anim_bug.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ void AnimMissileArc_Step(struct Sprite *sprite)
else
{
s16 tempData[8];
u16 *data = sprite->data;
s16 *data = sprite->data;
u16 x1 = sprite->x;
s16 x2 = sprite->x2;
u16 y1 = sprite->y;
Expand Down
14 changes: 6 additions & 8 deletions src/battle_anim_effects_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -4019,7 +4019,7 @@ static void AnimConstrictBinding(struct Sprite *sprite)

static void AnimConstrictBinding_Step1(struct Sprite *sprite)
{
u8 spriteId;
u8 UNUSED spriteId;

if ((u16)gBattleAnimArgs[7] == 0xFFFF)
{
Expand All @@ -4032,7 +4032,7 @@ static void AnimConstrictBinding_Step1(struct Sprite *sprite)

static void AnimConstrictBinding_Step2(struct Sprite *sprite)
{
u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET);
u8 UNUSED spriteId = GetAnimBattlerSpriteId(ANIM_TARGET);
if (!sprite->data[2])
sprite->data[0] += 11;
else
Expand Down Expand Up @@ -5152,7 +5152,7 @@ static void AnimSlice_Step(struct Sprite *sprite)
}
}

static void UnusedFlickerAnim(struct Sprite *sprite)
static void UNUSED UnusedFlickerAnim(struct Sprite *sprite)
{
if (sprite->data[2] > 1)
{
Expand Down Expand Up @@ -6002,7 +6002,7 @@ static void AnimFalseSwipeSlice(struct Sprite *sprite)

static void AnimFalseSwipePositionedSlice(struct Sprite *sprite)
{
sprite->x = sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + 0xFFD0 + gBattleAnimArgs[0];
sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) - 48 + gBattleAnimArgs[0];
sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
StartSpriteAnim(sprite, 1);
sprite->data[0] = 0;
Expand Down Expand Up @@ -6185,8 +6185,7 @@ void AnimTask_Conversion2AlphaBlend(u8 taskId)
}
}

// Unused
static void AnimTask_HideBattlersHealthbox(u8 taskId)
static void UNUSED AnimTask_HideBattlersHealthbox(u8 taskId)
{
u8 i;
for (i = 0; i < gBattlersCount; i++)
Expand All @@ -6201,8 +6200,7 @@ static void AnimTask_HideBattlersHealthbox(u8 taskId)
DestroyAnimVisualTask(taskId);
}

// Unused
static void AnimTask_ShowBattlersHealthbox(u8 taskId)
static void UNUSED AnimTask_ShowBattlersHealthbox(u8 taskId)
{
u8 i;
for (i = 0; i < gBattlersCount; i++)
Expand Down
10 changes: 5 additions & 5 deletions src/battle_anim_effects_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2588,8 +2588,8 @@ static void AnimPencil_Step(struct Sprite *sprite)
static void AnimBlendThinRing(struct Sprite *sprite)
{
u8 battler = 0;
u16 sp0 = 0;
u16 sp1 = 0;
s16 x = 0;
s16 y = 0;
u8 r4;

if (gBattleAnimArgs[2] == 0)
Expand All @@ -2600,16 +2600,16 @@ static void AnimBlendThinRing(struct Sprite *sprite)
r4 = gBattleAnimArgs[3] ^ 1;
if (IsDoubleBattle() && IsBattlerSpriteVisible(BATTLE_PARTNER(battler)))
{
SetAverageBattlerPositions(battler, r4, &sp0, &sp1);
SetAverageBattlerPositions(battler, r4, &x, &y);
if (r4 == 0)
r4 = GetBattlerSpriteCoord(battler, BATTLER_COORD_X);
else
r4 = GetBattlerSpriteCoord(battler, BATTLER_COORD_X_2);

if (GetBattlerSide(battler) != B_SIDE_PLAYER)
gBattleAnimArgs[0] -= (sp0 - r4) - gBattleAnimArgs[0]; // This is weird.
gBattleAnimArgs[0] -= (x - r4) - gBattleAnimArgs[0]; // This is weird.
else
gBattleAnimArgs[0] = sp0 - r4;
gBattleAnimArgs[0] = x - r4;
}

sprite->callback = AnimSpriteOnMonPos;
Expand Down
7 changes: 3 additions & 4 deletions src/battle_anim_effects_3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1508,8 +1508,7 @@ static void FadeScreenToWhite_Step(u8 taskId)

static void AnimSpikes(struct Sprite *sprite)
{
u16 x;
u16 y;
s16 x, y;

InitSpritePosToAnimAttacker(sprite, TRUE);
SetAverageBattlerPositions(gBattleAnimTarget, FALSE, &x, &y);
Expand Down Expand Up @@ -4844,8 +4843,8 @@ static void AnimMeteorMashStar_Step(struct Sprite *sprite)
// arg 4: duration
static void AnimMeteorMashStar(struct Sprite *sprite)
{
s16 y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); // unused local variable
s16 x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); // unused local variable
s16 UNUSED y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
s16 UNUSED x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);

if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER || IsContest())
{
Expand Down
3 changes: 1 addition & 2 deletions src/battle_anim_flying.c
Original file line number Diff line number Diff line change
Expand Up @@ -1216,8 +1216,7 @@ void AnimSkyAttackBird_Step(struct Sprite *sprite)
DestroySpriteAndMatrix(sprite);
}

// Unused
static void AnimTask_SetAttackerVisibility(u8 taskId)
static void UNUSED AnimTask_SetAttackerVisibility(u8 taskId)
{
if (gBattleAnimArgs[0] == 0)
{
Expand Down
21 changes: 7 additions & 14 deletions src/battle_anim_mons.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,8 @@ void TranslateSpriteInGrowingCircle(struct Sprite *sprite)
}
}

// Unused
// Exact shape depends on arguments. Can move in a figure-8-like pattern, or circular, etc.
static void TranslateSpriteInLissajousCurve(struct Sprite *sprite)
static void UNUSED TranslateSpriteInLissajousCurve(struct Sprite *sprite)
{
if (sprite->sDuration)
{
Expand Down Expand Up @@ -594,8 +593,7 @@ static void TranslateSpriteLinearFixedPointIconFrame(struct Sprite *sprite)
UpdateMonIconFrame(sprite);
}

// Unused
static void TranslateSpriteToBattleTargetPos(struct Sprite *sprite)
static void UNUSED TranslateSpriteToBattleTargetPos(struct Sprite *sprite)
{
sprite->sStartX = sprite->x + sprite->x2;
sprite->sStartY = sprite->y + sprite->y2;
Expand Down Expand Up @@ -662,8 +660,7 @@ void DestroySpriteAndMatrix(struct Sprite *sprite)
DestroyAnimSprite(sprite);
}

// Unused
static void TranslateSpriteToBattleAttackerPos(struct Sprite *sprite)
static void UNUSED TranslateSpriteToBattleAttackerPos(struct Sprite *sprite)
{
sprite->sStartX = sprite->x + sprite->x2;
sprite->sStartY = sprite->y + sprite->y2;
Expand All @@ -678,8 +675,7 @@ static void TranslateSpriteToBattleAttackerPos(struct Sprite *sprite)
#undef sStartY
#undef sTargetY

// Unused
static void EndUnkPaletteAnim(struct Sprite *sprite)
static void UNUSED EndUnkPaletteAnim(struct Sprite *sprite)
{
PaletteStruct_ResetById(sprite->data[5]);
DestroySpriteAndMatrix(sprite);
Expand Down Expand Up @@ -1090,8 +1086,7 @@ void StartAnimLinearTranslation(struct Sprite *sprite)
sprite->callback(sprite);
}

// Unused
static void StartAnimLinearTranslation_SetCornerVecX(struct Sprite *sprite)
static void UNUSED StartAnimLinearTranslation_SetCornerVecX(struct Sprite *sprite)
{
sprite->data[1] = sprite->x;
sprite->data[3] = sprite->y;
Expand Down Expand Up @@ -1499,8 +1494,7 @@ u8 GetSpritePalIdxByBattler(u8 battler)
return battler;
}

// Unused
static u8 GetSpritePalIdxByPosition(u8 position)
static u8 UNUSED GetSpritePalIdxByPosition(u8 position)
{
return GetBattlerAtPosition(position);
}
Expand Down Expand Up @@ -1997,8 +1991,7 @@ void AnimTask_GetFrustrationPowerLevel(u8 taskId)
DestroyAnimVisualTask(taskId);
}

// Unused
static void SetPriorityForVisibleBattlers(u8 priority)
static void UNUSED SetPriorityForVisibleBattlers(u8 priority)
{
if (IsBattlerSpriteVisible(gBattleAnimTarget))
gSprites[gBattlerSpriteIds[gBattleAnimTarget]].oam.priority = priority;
Expand Down
3 changes: 1 addition & 2 deletions src/battle_anim_status_effects.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,7 @@ static const struct SpriteTemplate sFlashingCircleImpactSpriteTemplate =
.callback = AnimFlashingCircleImpact,
};

// Unused
static u8 Task_FlashingCircleImpacts(u8 battlerId, bool8 red)
static u8 UNUSED Task_FlashingCircleImpacts(u8 battlerId, bool8 red)
{
u8 battlerSpriteId = gBattlerSpriteIds[battlerId];
u8 taskId = CreateTask(Task_UpdateFlashingCircleImpacts, 10);
Expand Down
4 changes: 2 additions & 2 deletions src/battle_anim_throw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2656,11 +2656,11 @@ static void SpriteCB_ShinyStars_Diagonal(struct Sprite *sprite)

void AnimTask_LoadPokeblockGfx(u8 taskId)
{
u8 paletteIndex;
u8 UNUSED paletteIndex;

LoadCompressedSpriteSheetUsingHeap(&gBattleAnimPicTable[ANIM_TAG_POKEBLOCK - ANIM_SPRITES_START]);
LoadCompressedSpritePaletteUsingHeap(&gBattleAnimPaletteTable[ANIM_TAG_POKEBLOCK - ANIM_SPRITES_START]);
paletteIndex = IndexOfSpritePaletteTag(ANIM_TAG_POKEBLOCK); // unused
paletteIndex = IndexOfSpritePaletteTag(ANIM_TAG_POKEBLOCK);
DestroyAnimVisualTask(taskId);
}

Expand Down
5 changes: 4 additions & 1 deletion src/battle_anim_utility_funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ void AnimTask_BlendBattleAnimPalExclude(u8 taskId)
selectedPalettes = 0;
// fall through
case ANIM_ATTACKER:
#ifdef UBFIX
default:
#endif
animBattlers[0] = gBattleAnimAttacker;
break;
case 3:
Expand Down Expand Up @@ -807,7 +810,7 @@ void AnimTask_SetAllNonAttackersInvisiblity(u8 taskId)
DestroyAnimVisualTask(taskId);
}

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)
void StartMonScrollingBgMask(u8 taskId, int UNUSED unused, u16 scrollSpeed, u8 battler, bool8 includePartner, u8 numFadeSteps, u8 fadeStepDelay, u8 duration, const u32 *gfx, const u32 *tilemap, const u32 *palette)
{
u16 species;
u8 spriteId, spriteId2;
Expand Down
3 changes: 1 addition & 2 deletions src/battle_arena.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,7 @@ void BattleArena_DeductSkillPoints(u8 battler, u16 stringId)
}
}

// Unused
static void UpdateHPAtStart(u8 battler)
static void UNUSED UpdateHPAtStart(u8 battler)
{
u16 *hpAtStart = gBattleStruct->arenaStartHp;

Expand Down
Loading

0 comments on commit 966f89e

Please sign in to comment.