Remove unused local variables and functions

This commit is contained in:
GriffinR 2021-01-19 17:50:52 -05:00
parent c2ddb92c9e
commit b65980cd4e
46 changed files with 8 additions and 66 deletions

View File

@ -2,7 +2,7 @@
static void *sHeapStart;
static u32 sHeapSize;
static u32 malloc_c_unused_0300000c; // needed to align dma3_manager.o(.bss)
static u32 sFiller; // needed to align dma3_manager.o(.bss)
#define MALLOC_SYSTEM_ID 0xA3A3

View File

@ -165,7 +165,6 @@ bool16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u8 speed, voi
{
int i;
u16 j;
u8 *ptr;
if (!gFonts)
return FALSE;
@ -1235,7 +1234,6 @@ s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing)
bool8 isJapanese;
int minGlyphWidth;
u32 (*func)(u16 glyphId, bool32 isJapanese);
s32 result;
int localLetterSpacing;
u32 lineWidth;
const u8 *bufferPointer;

View File

@ -4947,7 +4947,6 @@ static void AnimTask_OdorSleuthMovementWaitFinish(u8 taskId)
static void MoveOdorSleuthClone(struct Sprite *sprite)
{
int zero = 0;
if (++sprite->data[1] > 1)
{
sprite->data[1] = 0;

View File

@ -708,7 +708,6 @@ static void sub_810E520(struct Sprite *sprite)
}
}
data->unk0_0d = 0;
data->unk2;
}
data->unk0_1 = 0;
break;

View File

@ -564,8 +564,6 @@ static void AnimTask_BlendColorCycleExcludeLoop(u8 taskId)
// See AnimTask_BlendColorCycle. Same, but selects palette by ANIM_TAG_*
void AnimTask_BlendColorCycleByTag(u8 taskId)
{
u8 paletteIndex;
gTasks[taskId].tPalTag = gBattleAnimArgs[0];
gTasks[taskId].tDelay = gBattleAnimArgs[1];
gTasks[taskId].tNumBlends = gBattleAnimArgs[2];

View File

@ -1551,8 +1551,6 @@ static void SpriteCB_Ball_Block_Step(struct Sprite *sprite)
static void LoadBallParticleGfx(u8 ballId)
{
u8 taskId;
if (GetSpriteTileStartByTag(sBallParticleSpriteSheets[ballId].tag) == 0xFFFF)
{
LoadCompressedSpriteSheetUsingHeap(&sBallParticleSpriteSheets[ballId]);

View File

@ -881,8 +881,6 @@ static void AnimTask_CreateSurfWave_Step1(u8 taskId)
u16 rgbBuffer;
u16 *BGptrX = &gBattle_BG1_X;
u16 *BGptrY = &gBattle_BG1_Y;
u32 palOffset;
u16 palNum;
*BGptrX += gTasks[taskId].data[0];
*BGptrY += gTasks[taskId].data[1];

View File

@ -1693,7 +1693,6 @@ static void LinkOpponentHandleIntroSlide(void)
static void LinkOpponentHandleIntroTrainerBallThrow(void)
{
u8 paletteNum;
u8 taskId;
SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]);

View File

@ -1858,7 +1858,6 @@ static void OpponentHandleIntroSlide(void)
static void OpponentHandleIntroTrainerBallThrow(void)
{
u8 paletteNum;
u8 taskId;
SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]);

View File

@ -1633,7 +1633,6 @@ static void RecordedOpponentHandleIntroSlide(void)
static void RecordedOpponentHandleIntroTrainerBallThrow(void)
{
u8 paletteNum;
u8 taskId;
SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]);

View File

@ -470,8 +470,6 @@ static void SafariHandleChooseMove(void)
static void SafariHandleChooseItem(void)
{
s32 i;
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
gBattlerControllerFuncs[gActiveBattler] = SafariOpenPokeblockCase;
gBattlerInMenuId = gActiveBattler;

View File

@ -1897,7 +1897,6 @@ static void UpdateNickInHealthbox(u8 healthboxSpriteId, struct Pokemon *mon)
{
u8 nickname[POKEMON_NAME_LENGTH + 1];
void *ptr;
const u8 *genderTxt;
u32 windowId, spriteTileNum;
u8 *windowTileData;
u16 species;

View File

@ -2390,7 +2390,7 @@ static s16 Debug_GetGameTimeStage(void)
static void CalculatePokeblock(struct BlenderBerry *berries, struct Pokeblock *pokeblock, u8 numPlayers, u8 *flavors, u16 maxRPM)
{
s32 i, j;
s32 multiuseVar, var2;
s32 multiuseVar;
u8 numNegatives;
for (i = 0; i < FLAVOR_COUNT + 1; i++)

View File

@ -1573,7 +1573,6 @@ static void Task_ShowBerryCrushRankings(u8 taskId)
u8 i = 0, j, xPos, yPos;
u32 score = 0;
s16 *data = gTasks[taskId].data;
u8 *str;
switch (data[0])
{
@ -1714,8 +1713,7 @@ void sub_8022588(struct BerryCrushGame *r5)
void sub_8022600(struct BerryCrushGame *r6)
{
u8 r7, r2;
u8 *r4;
u8 r7;
for (r7 = 0; r7 < r6->unk9; ++r7)
{

View File

@ -128,8 +128,6 @@ static void UpdateLinkPlayerCountDisplay(u8 taskId, u8 numPlayers)
static u32 ExchangeDataAndGetLinkupStatus(u8 minPlayers, u8 maxPlayers)
{
int playerCount;
switch (GetLinkPlayerDataExchangeStatusTimed(minPlayers, maxPlayers))
{
case EXCHANGE_COMPLETE:
@ -511,7 +509,6 @@ static void FinishLinkup(u16 *linkupStatus, u32 taskId)
static void Task_LinkupAwaitTrainerCardData(u8 taskId)
{
u8 index;
struct TrainerCard *trainerCards;
if (CheckLinkErrored(taskId) == TRUE)
return;

View File

@ -4422,7 +4422,6 @@ static void CalculateAppealMoveImpact(u8 contestant)
u16 move;
u8 effect;
u8 rnd;
bool8 canUseTurn;
s32 i;
eContestantStatus[contestant].appeal = 0;

View File

@ -1305,8 +1305,6 @@ static void sub_8175808(u8 taskIdA)
static void c2_080C9BFC(u8 taskIdA)
{
u16 backup;
SetVBlankCallback(NULL);
if (sub_8176AB0(gTasks[taskIdA].data[TDA_7], taskIdA))

View File

@ -113,7 +113,7 @@ EWRAM_DATA static u16 sDecorationsCursorPos = 0;
EWRAM_DATA static u16 sDecorationsScrollOffset = 0;
EWRAM_DATA u8 gCurDecorationIndex = 0;
EWRAM_DATA static u8 sCurDecorationCategory = DECORCAT_DESK;
EWRAM_DATA static u32 filler_0203a174[2] = {};
EWRAM_DATA static u32 sFiller[2] = {};
EWRAM_DATA static struct DecorationPCContext sDecorationContext = {};
EWRAM_DATA static u8 sDecorMenuWindowIds[WINDOW_COUNT] = {};
EWRAM_DATA static struct DecorationItemsMenu *sDecorationItemsMenu = NULL;

View File

@ -4073,7 +4073,6 @@ static void sub_811D864(u8 arg0, u8 arg1)
{
int i, j;
u16 easyChatWord;
u8 *str;
int y;
int var0;

View File

@ -211,7 +211,6 @@ static u32 sub_81D4EE4(u8 *arg0, u16 *arg1)
void task_add_00_ereader(void)
{
int value;
struct Unk81D5014 *data;
u8 taskId = CreateTask(sub_81D5084, 0);
data = (struct Unk81D5014 *)gTasks[taskId].data;

View File

@ -130,7 +130,6 @@ static struct ObjectEventTemplate *FindObjectEventTemplateByLocalId(u8 localId,
static void ClearObjectEventMovement(struct ObjectEvent *, struct Sprite *);
static void ObjectEventSetSingleMovement(struct ObjectEvent *, struct Sprite *, u8);
static void oamt_npc_ministep_reset(struct Sprite *, u8, u8);
static void UpdateObjectEventSpriteSubpriorityAndVisibility(struct Sprite *);
static void InitSpriteForFigure8Anim(struct Sprite *sprite);
static bool8 AnimateSpriteInFigure8(struct Sprite *sprite);
static void UpdateObjectEventSprite(struct Sprite *);

View File

@ -60,7 +60,6 @@ static void CB2_TradeEvolutionSceneUpdate(void);
static void EvoDummyFunc(void);
static void VBlankCB_EvolutionScene(void);
static void VBlankCB_TradeEvolutionScene(void);
static void sub_81150D8(void);
static void sub_8140134(void);
static void EvoScene_DoMonAnimation(u8 monSpriteId, u16 speciesId);
static bool32 EvoScene_IsMonAnimFinished(u8 monSpriteId);

View File

@ -372,7 +372,6 @@ void SetMewAboveGrass(void)
{
s16 x;
s16 y;
u8 spriteId;
struct ObjectEvent *mew = &gObjectEvents[GetMewObjectEventId()];
mew->invisible = FALSE;

View File

@ -28,7 +28,7 @@ EWRAM_DATA static u16 gBackupMapData[MAX_MAP_DATA_SIZE] = {0};
EWRAM_DATA struct MapHeader gMapHeader = {0};
EWRAM_DATA struct Camera gCamera = {0};
EWRAM_DATA static struct ConnectionFlags gMapConnectionFlags = {0};
EWRAM_DATA static u32 sFiller_02037344 = 0; // without this, the next file won't align properly
EWRAM_DATA static u32 sFiller = 0; // without this, the next file won't align properly
struct BackupMapLayout gBackupMapLayout;

View File

@ -62,7 +62,6 @@ static void HandleLongGrassOnHyper(u8, s16, s16);
static u8 sCutSquareSide;
static u8 sTileCountFromPlayer_X;
static u8 sTileCountFromPlayer_Y;
static u32 sUnused;
static bool8 sHyperCutTiles[CUT_HYPER_AREA];
// EWRAM variables

View File

@ -10,8 +10,6 @@ static EWRAM_DATA u8 sEscalatorAnim_TaskId = 0;
static void SetEscalatorMetatile(u8 taskId, const s16 *metatileIds, u16 metatileMasks);
static void Task_DrawEscalator(u8 taskId);
static void Task_DrawTeleporterHousing(u8 taskId);
static void Task_DrawTeleporterCable(u8 taskId);
#define ESCALATOR_STAGES 3
#define LAST_ESCALATOR_STAGE (ESCALATOR_STAGES - 1)

View File

@ -986,8 +986,6 @@ static void SerialCB_CopyrightScreen(void)
static u8 SetUpCopyrightScreen(void)
{
u16 ime;
switch (gMain.state)
{
case 0:
@ -1302,7 +1300,6 @@ static void Task_IntroStartBikeRide(u8 taskId)
static void Task_IntroHandleBikeAndFlygonMovement(u8 taskId)
{
s16 a;
u16 offset;
if (gIntroFrameCounter == 1856)

View File

@ -627,7 +627,6 @@ void CB2_Bag(void)
bool8 SetupBagMenu(void)
{
u32 index;
u8 taskId;
switch (gMain.state)

View File

@ -1724,7 +1724,6 @@ static void rfu_constructSendLLFrame(void)
u32 pakcketSize, currSize;
u8 i;
u8 *llf_p;
struct RfuSlotStatusNI *slotStatusNI;
if (gRfuLinkStatus->parentChild != MODE_NEUTRAL
&& gRfuLinkStatus->sendSlotNIFlag | gRfuLinkStatus->recvSlotNIFlag | gRfuLinkStatus->sendSlotUNIFlag)

View File

@ -1494,7 +1494,6 @@ static const struct MatchCallText *GetGeneralMatchCallText(int matchCallId, u8 *
int count;
u32 topic, id;
u16 rand;
u16 var3;
rand = Random();
if (!(rand & 1))

View File

@ -1324,7 +1324,6 @@ static void PrintStoryList(void)
{
s32 i;
s32 width = GetStringWidth(1, gText_Exit, 0);
u8 tileWidth;
for (i = 0; i < NUM_STORYTELLER_TALES; i++)
{
s32 curWidth;

View File

@ -14,7 +14,6 @@ static void sub_802E83C(u8 taskId);
static void sub_802E8C8(u8 taskId);
static void sub_802EA50(u8 taskId);
static void sub_802EAB0(u8 taskId);
static void sub_802EB98(u8 taskId);
static void Task_MinigameCountdown(u8 taskId);
static bool32 RunMinigameCountdownDigitsAnim(u8 spriteId);
static bool32 IsStartGraphicAnimRunning(u8 spriteId);

View File

@ -174,7 +174,6 @@ static u8 sPlayerTradingStates[MAX_LINK_PLAYERS];
static u16 (*sPlayerKeyInterceptCallback)(u32);
static bool8 sUnknown_03000E18;
static u8 sRfuKeepAliveTimer;
static u32 sUnusedVar;
// IWRAM common
u16 *gBGTilemapBuffers1;

View File

@ -60,7 +60,7 @@ ALIGNED(4) EWRAM_DATA u16 gPlttBufferUnfaded[PLTT_BUFFER_SIZE] = {0};
ALIGNED(4) EWRAM_DATA u16 gPlttBufferFaded[PLTT_BUFFER_SIZE] = {0};
EWRAM_DATA struct PaletteStruct sPaletteStructs[0x10] = {0};
EWRAM_DATA struct PaletteFadeControl gPaletteFade = {0};
static EWRAM_DATA u32 gFiller_2037FE0 = 0;
static EWRAM_DATA u32 sFiller = 0;
static EWRAM_DATA u32 sPlttBufferTransferPending = 0;
EWRAM_DATA u8 gPaletteDecompressionBuffer[PLTT_DECOMP_BUFFER_SIZE] = {0};

View File

@ -151,7 +151,7 @@ static EWRAM_DATA u16 *sSlot1TilemapBuffer = 0; // for switching party slots
static EWRAM_DATA u16 *sSlot2TilemapBuffer = 0; //
EWRAM_DATA u8 gSelectedOrderFromParty[MAX_FRONTIER_PARTY_SIZE] = {0};
static EWRAM_DATA u16 sPartyMenuItemId = 0;
static EWRAM_DATA u16 sUnused_0203CEFE = 0;
static EWRAM_DATA u16 sUnused = 0;
EWRAM_DATA u8 gBattlePartyCurrentOrder[PARTY_SIZE / 2] = {0}; // bits 0-3 are the current pos of Slot 1, 4-7 are Slot 2, and so on
// IWRAM common

View File

@ -1058,7 +1058,6 @@ static void ItemStorage_ProcessWithdrawTossInput(u8 taskId)
s16 *data;
bool32 toss;
u32 i, x;
u8 windowId;
const u8* text;
data = gTasks[taskId].data;

View File

@ -61,7 +61,6 @@ static void HandleInitWindows(void);
static void LaunchPokeblockFeedTask(void);
static void SetPokeblockSpritePal(u8 pokeblockCaseId);
static void sub_817A5CC(void);
static void sub_8148108(u8 spriteId, bool8 a1);
static void DoPokeblockCaseThrowEffect(u8 spriteId, bool8 arg1);
static void PrepareMonToMoveToPokeblock(u8 spriteId);
static void Task_HandleMonAtePokeblock(u8 taskId);

View File

@ -1587,9 +1587,6 @@ static void ResetPokedexView(struct PokedexView *pokedexView)
void CB2_OpenPokedex(void)
{
u8 *addr;
u32 size;
switch (gMain.state)
{
case 0:

View File

@ -489,7 +489,6 @@ static bool8 MonListHasMon(const struct WildPokemonInfo *info, u16 species, u16
static void BuildAreaGlowTilemap(void)
{
u16 i, y, x, j;
u16 val;
for (i = 0; i < ARRAY_COUNT(sPokedexAreaScreen->areaGlowTilemap); i++)
sPokedexAreaScreen->areaGlowTilemap[i] = 0;

View File

@ -4658,7 +4658,6 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
u32 var_28 = 0;
u16 heldItem;
u8 r10;
u32 r4;
u32 r5;
s8 r2;
u16 evCount;

View File

@ -8389,7 +8389,7 @@ static u8 sub_80D0894(void)
static void sub_80D08CC(void)
{
s32 i, j, r8, r9;
s32 i, j;
s32 rowCount, columnCount;
u8 boxId;
u8 monArrayId;

View File

@ -94,7 +94,6 @@ static void *sApprenticesSave;
static void *sBattleTowerSave_Duplicate;
static u32 sRecordStructSize;
static u8 gUnknown_03001160;
static u32 filler_03001164;
static struct PlayerHallRecords *gUnknown_03001168[3];
static EWRAM_DATA struct RecordMixingDayCareMail gUnknown_02039F9C = {0};

View File

@ -11,9 +11,7 @@ extern const u8* gUnknown_020375C0;
// ewram bss
static u8 sScriptContext1Status;
static u32 sUnusedVariable1;
static struct ScriptContext sScriptContext1;
static u32 sUnusedVariable2;
static struct ScriptContext sScriptContext2;
static bool8 sScriptContext2Enabled;

View File

@ -489,7 +489,6 @@ static void BuyMenuFreeMemory(void)
static void BuyMenuBuildListMenuTemplate(void)
{
u16 i;
u16 itemCount;
gUnknown_02039F74 = Alloc((gMartInfo.itemCount + 1) * sizeof(*gUnknown_02039F74));
gUnknown_02039F78 = Alloc((gMartInfo.itemCount + 1) * sizeof(*gUnknown_02039F78));

View File

@ -378,7 +378,6 @@ static void VblankCB_StarterChoose(void)
void CB2_ChooseStarter(void)
{
u16 savedIme;
u8 taskId;
u8 spriteId;

View File

@ -2085,7 +2085,6 @@ static void sub_80EDE98(TVShow *show)
u16 k;
u8 n;
u8 deco;
u8 x;
for (i = 0; i < DECOR_MAX_SECRET_BASE; i ++)
{
@ -4095,7 +4094,6 @@ static void sub_80F0E58(PokeNews *dest[16], PokeNews *src[16])
static bool8 sub_80F0E84(PokeNews *dest, PokeNews *src, s8 slot)
{
u8 i;
u8 kind;
if (src->kind == POKENEWS_NONE)
{
@ -6602,7 +6600,6 @@ static void DoTVShowSpotTheCuties(void)
{
TVShow *show;
u8 state;
u32 playerId;
show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004];
gSpecialVar_Result = FALSE;
@ -6707,7 +6704,6 @@ static void DoTVShowPokemonNewsBattleFrontier(void)
{
TVShow *show;
u8 state;
u32 playerId;
show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004];
gSpecialVar_Result = FALSE;
@ -6856,7 +6852,6 @@ static void DoTVShowWhatsNo1InHoennToday(void)
{
TVShow *show;
u8 state;
u32 playerId;
show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004];
gSpecialVar_Result = FALSE;