fixed more warnings

This commit is contained in:
cawtds
2024-06-14 20:29:48 +02:00
parent 2779c4b9d1
commit 2a4a23d5fc
6 changed files with 2 additions and 390 deletions

View File

@@ -47,18 +47,6 @@ void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16
CopyWindowToVram(windowId, COPYWIN_FULL);
}
// not used
static void DrawDialogFrameWithCustomTile(u8 windowId, bool8 copyToVram, u16 tileNum)
{
sTileNum = tileNum;
sPaletteNum = GetWindowAttribute(windowId, WINDOW_PALETTE_NUM);
CallWindowFunction(windowId, WindowFunc_DrawDialogFrameWithCustomTileAndPalette);
FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
PutWindowTilemap(windowId);
if (copyToVram == TRUE)
CopyWindowToVram(windowId, COPYWIN_FULL);
}
static void WindowFunc_DrawDialogFrameWithCustomTileAndPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
{
FillBgTilemapBufferRect(bg, sTileNum, tilemapLeft - 2, tilemapTop - 1, 1, 1, sPaletteNum);
@@ -115,18 +103,6 @@ void DrawStdFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 bas
CopyWindowToVram(windowId, COPYWIN_FULL);
}
// not used
static void DrawStdFrameWithCustomTile(u8 windowId, bool8 copyToVram, u16 baseTileNum)
{
sTileNum = baseTileNum;
sPaletteNum = GetWindowAttribute(windowId, WINDOW_PALETTE_NUM);
CallWindowFunction(windowId, WindowFunc_DrawStdFrameWithCustomTileAndPalette);
FillWindowPixelBuffer(windowId, PIXEL_FILL(1));
PutWindowTilemap(windowId);
if (copyToVram == TRUE)
CopyWindowToVram(windowId, COPYWIN_FULL);
}
static void WindowFunc_DrawStdFrameWithCustomTileAndPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum)
{
FillBgTilemapBufferRect(bg, sTileNum, tilemapLeft - 1, tilemapTop - 1, 1, 1, sPaletteNum);
@@ -202,7 +178,7 @@ void TopBarWindowPrintString(const u8 *string, u8 unused, bool8 copyToVram)
void TopBarWindowPrintTwoStrings(const u8 *string, const u8 *string2, bool8 fgColorChooser, u8 unused, bool8 copyToVram)
{
u8 color[3];
s32 fgColor, width;
s32 width;
if ( sTopBarWindowId != 0xFF )
{
@@ -232,13 +208,6 @@ void TopBarWindowPrintTwoStrings(const u8 *string, const u8 *string2, bool8 fgCo
}
}
// not used
static void CopyTopBarWindowToVram(void)
{
if (sTopBarWindowId != 0xFF)
CopyWindowToVram(sTopBarWindowId, COPYWIN_FULL);
}
void ClearTopBarWindow(void)
{
if (sTopBarWindowId != 0xFF)
@@ -287,12 +256,6 @@ u8 Menu_InitCursor(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8
return Menu_InitCursorInternal(windowId, fontId, left, top, cursorHeight, numChoices, initialCursorPos, 0);
}
// Unused
static u8 InitMenuDefaultCursorHeight(u8 windowId, u8 fontId, u8 left, u8 top, u8 numChoices, u8 initialCursorPos)
{
return Menu_InitCursor(windowId, fontId, left, top, GetMenuCursorDimensionByFont(fontId, 1), numChoices, initialCursorPos);
}
static void Menu_RedrawCursor(u8 oldPos, u8 newPos)
{
u8 width, height;
@@ -501,12 +464,6 @@ void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 l
CopyWindowToVram(windowId, COPYWIN_GFX);
}
// Unused
static void PrintMenuActionTextsAtTopById(u8 windowId, u8 fontId, u8 lineHeight, u8 itemCount, const struct MenuAction *strs, const u8 *orderArray)
{
AddItemMenuActionTextPrinters(windowId, fontId, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH), 0, GetFontAttribute(fontId, FONTATTR_LETTER_SPACING), lineHeight, itemCount, strs, orderArray);
}
struct WindowTemplate SetWindowTemplateFields(u8 bg, u8 left, u8 top, u8 width, u8 height, u8 paletteNum, u16 baseBlock)
{
struct WindowTemplate template;
@@ -521,13 +478,6 @@ struct WindowTemplate SetWindowTemplateFields(u8 bg, u8 left, u8 top, u8 width,
return template;
}
// not used
static u16 CreateWindowTemplate(u8 bg, u8 left, u8 top, u8 width, u8 height, u8 paletteNum, u16 baseBlock)
{
struct WindowTemplate template = SetWindowTemplateFields(bg, left, top, width, height, paletteNum, baseBlock);
return AddWindow(&template);
}
void CreateYesNoMenu(const struct WindowTemplate *window, u8 fontId, u8 left, u8 top, u16 baseTileNum, u8 paletteNum, u8 initialCursorPos)
{
struct TextPrinterTemplate textSubPrinter;
@@ -551,12 +501,6 @@ void CreateYesNoMenu(const struct WindowTemplate *window, u8 fontId, u8 left, u8
Menu_InitCursor(sYesNoWindowId, fontId, left, top, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_HEIGHT) + textSubPrinter.lineSpacing, 2, initialCursorPos);
}
// not used
static void CreateYesNoMenu2(const struct WindowTemplate *window, u8 fontId, u16 baseTileNum, u8 initialCursorPos)
{
CreateYesNoMenu(window, fontId, 0, 0, baseTileNum, initialCursorPos, 0);
}
s8 Menu_ProcessInputNoWrapClearOnChoose(void)
{
s8 result = Menu_ProcessInputNoWrapAround();
@@ -586,21 +530,6 @@ void MultichoiceGrid_PrintItems(u8 windowId, u8 fontId, u8 itemWidth, u8 itemHei
CopyWindowToVram(windowId, COPYWIN_GFX);
}
//not used
static void MultichoiceGrid_PrintItemsCustomOrder(u8 windowId, u8 fontId, u8 itemWidth, u8 itemHeight, u8 cols, u8 rows, const struct MenuAction *strs, const u8 *orderArray)
{
u8 width, i, j;
fontId = fontId;
itemWidth = itemWidth;
itemHeight = itemHeight;
width = GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH);
for (i = 0; i < rows; ++i)
for (j = 0; j < cols; ++j)
AddTextPrinterParameterized(windowId, fontId, strs[orderArray[i * cols + j]].text, itemWidth * j + width, itemHeight * i, 0xFF, 0);
CopyWindowToVram(windowId, COPYWIN_GFX);
}
static u8 MultichoiceGrid_InitCursorInternal(u8 windowId, u8 fontId, u8 left, u8 top, u8 optionWidth, u8 cursorHeight, u8 cols, u8 rows, u8 numChoices, u8 cursorPos)
{
s32 pos;
@@ -705,45 +634,6 @@ static u8 MultichoiceGrid_MoveCursorIfValid(s8 deltaX, s8 deltaY)
}
}
// Unused
static s8 Menu_ProcessGridInput_NoSoundLimit(void)
{
if (JOY_NEW(A_BUTTON))
{
PlaySE(SE_SELECT);
return sMenu.cursorPos;
}
else if (JOY_NEW(B_BUTTON))
{
return MENU_B_PRESSED;
}
else if (JOY_NEW(DPAD_UP))
{
PlaySE(SE_SELECT);
MultichoiceGrid_MoveCursor(0, -1);
return MENU_NOTHING_CHOSEN;
}
else if (JOY_NEW(DPAD_DOWN))
{
PlaySE(SE_SELECT);
MultichoiceGrid_MoveCursor(0, 1);
return MENU_NOTHING_CHOSEN;
}
else if (JOY_NEW(DPAD_LEFT) || GetLRKeysPressed() == MENU_L_PRESSED)
{
PlaySE(SE_SELECT);
MultichoiceGrid_MoveCursor(-1, 0);
return MENU_NOTHING_CHOSEN;
}
else if (JOY_NEW(DPAD_RIGHT) || GetLRKeysPressed() == MENU_R_PRESSED)
{
PlaySE(SE_SELECT);
MultichoiceGrid_MoveCursor(1, 0);
return MENU_NOTHING_CHOSEN;
}
return MENU_NOTHING_CHOSEN;
}
s8 Menu_ProcessInputGridLayout(void)
{
u8 oldPos = sMenu.cursorPos;
@@ -783,84 +673,3 @@ s8 Menu_ProcessInputGridLayout(void)
}
return MENU_NOTHING_CHOSEN;
}
// Unused
static s8 Menu_ProcessGridInputRepeat_NoSoundLimit(void)
{
if (JOY_NEW(A_BUTTON))
{
PlaySE(SE_SELECT);
return sMenu.cursorPos;
}
else if (JOY_NEW(B_BUTTON))
{
return MENU_B_PRESSED;
}
else if (JOY_REPT(DPAD_ANY) == DPAD_UP)
{
PlaySE(SE_SELECT);
MultichoiceGrid_MoveCursor(0, -1);
return MENU_NOTHING_CHOSEN;
}
else if (JOY_REPT(DPAD_ANY) == DPAD_DOWN)
{
PlaySE(SE_SELECT);
MultichoiceGrid_MoveCursor(0, 1);
return MENU_NOTHING_CHOSEN;
}
else if (JOY_REPT(DPAD_ANY) == DPAD_LEFT || GetLRKeysPressedAndHeld() == MENU_L_PRESSED)
{
PlaySE(SE_SELECT);
MultichoiceGrid_MoveCursor(-1, 0);
return MENU_NOTHING_CHOSEN;
}
else if (JOY_REPT(DPAD_ANY) == DPAD_RIGHT || GetLRKeysPressedAndHeld() == MENU_R_PRESSED)
{
PlaySE(SE_SELECT);
MultichoiceGrid_MoveCursor(1, 0);
return MENU_NOTHING_CHOSEN;
}
return MENU_NOTHING_CHOSEN;
}
// Unused
static s8 Menu_ProcessGridInputRepeat(void)
{
u8 oldPos = sMenu.cursorPos;
if (JOY_NEW(A_BUTTON))
{
PlaySE(SE_SELECT);
return sMenu.cursorPos;
}
else if (JOY_NEW(B_BUTTON))
{
return MENU_B_PRESSED;
}
else if (JOY_REPT(DPAD_ANY) == DPAD_UP)
{
if (oldPos != MultichoiceGrid_MoveCursorIfValid(0, -1))
PlaySE(SE_SELECT);
return MENU_NOTHING_CHOSEN;
}
else if (JOY_REPT(DPAD_ANY) == DPAD_DOWN)
{
if (oldPos != MultichoiceGrid_MoveCursorIfValid(0, 1))
PlaySE(SE_SELECT);
return MENU_NOTHING_CHOSEN;
}
else if (JOY_REPT(DPAD_ANY) == DPAD_LEFT || GetLRKeysPressedAndHeld() == MENU_L_PRESSED)
{
if (oldPos != MultichoiceGrid_MoveCursorIfValid(-1, 0))
PlaySE(SE_SELECT);
return MENU_NOTHING_CHOSEN;
}
else if (JOY_REPT(DPAD_ANY) == DPAD_RIGHT || GetLRKeysPressedAndHeld() == MENU_R_PRESSED)
{
if (oldPos != MultichoiceGrid_MoveCursorIfValid(1, 0))
PlaySE(SE_SELECT);
return MENU_NOTHING_CHOSEN;
}
return MENU_NOTHING_CHOSEN;
}

View File

@@ -568,34 +568,6 @@ bool32 PrintMysteryGiftMenuMessage(u8 *textState, const u8 *str)
return FALSE;
}
static void HideDownArrow(void)
{
DrawDownArrow(1, DOWN_ARROW_X, DOWN_ARROW_Y, 1, FALSE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]);
}
static void ShowDownArrow(void)
{
DrawDownArrow(1, DOWN_ARROW_X, DOWN_ARROW_Y, 1, TRUE, &sDownArrowCounterAndYCoordIdx[0], &sDownArrowCounterAndYCoordIdx[1]);
}
// Unused
static bool32 HideDownArrowAndWaitButton(u8 * textState)
{
switch (*textState)
{
case 0:
HideDownArrow();
if (JOY_NEW(A_BUTTON | B_BUTTON))
(*textState)++;
break;
case 1:
ShowDownArrow();
*textState = 0;
return TRUE;
}
return FALSE;
}
static bool32 PrintStringAndWait2Seconds(u8 * counter, const u8 * str)
{
if (*counter == 0)
@@ -705,7 +677,7 @@ s8 DoMysteryGiftYesNo(u8 * textState, u16 * windowId, bool8 yesNoBoxPlacement, c
// Handle the "Receive/Send/Toss" menu that appears when selecting Wonder Card/News
static s32 HandleMysteryGiftListMenu(u8 * textState, u16 * windowId, bool32 cannotToss, bool32 cannotSend)
{
struct WindowTemplate windowTemplate;
struct WindowTemplate UNUSED windowTemplate;
s32 input;
switch (*textState)

View File

@@ -265,7 +265,6 @@ struct PokemonJump
struct PokemonJump_Player *player;
};
static void Task_StaticCountdown(u8 taskId);
static void Task_StaticCountdown_Init(u8 taskId);
static void Task_StaticCountdown_Free(u8 taskId);
static void Task_StaticCountdown_Start(u8 taskId);
@@ -551,56 +550,6 @@ static const TaskFunc sStaticCountdownFuncs[][4] =
#define sId data[4] // Never read
#define sNumberSpriteId data[5] // Never read
// Unused
static u8 CreateStaticCountdownTask(u8 funcSetId, u8 taskPriority)
{
u8 taskId = CreateTask(Task_StaticCountdown, taskPriority);
struct Task *task = &gTasks[taskId];
task->tState = STATE_IDLE;
task->tFuncSetId = funcSetId;
sStaticCountdownFuncs[funcSetId][FUNC_INIT](taskId);
return taskId;
}
// Unused
static bool32 StartStaticCountdown(void)
{
u8 taskId = FindTaskIdByFunc(Task_StaticCountdown);
if (taskId == TASK_NONE)
return FALSE;
gTasks[taskId].tState = STATE_START;
return TRUE;
}
// Unused
static bool32 IsStaticCountdownRunning(void)
{
return FuncIsActiveTask(Task_StaticCountdown);
}
static void Task_StaticCountdown(u8 taskId)
{
s16 *data = gTasks[taskId].data;
switch (tState)
{
// STATE_IDLE does nothing; wait until started
case STATE_START:
sStaticCountdownFuncs[tFuncSetId][FUNC_START](taskId);
tState = STATE_RUN;
break;
case STATE_RUN:
sStaticCountdownFuncs[tFuncSetId][FUNC_RUN](taskId);
break;
case STATE_END:
sStaticCountdownFuncs[tFuncSetId][FUNC_FREE](taskId);
DestroyTask(taskId);
break;
}
}
static void StaticCountdown_CreateSprites(u8 taskId, s16 *data)
{
u8 i;
@@ -2746,23 +2695,6 @@ static bool32 RecvPacket_MonInfo(int multiplayerId, struct PokemonJump_MonInfo *
return FALSE;
}
struct UnusedPacket
{
u8 id;
u32 data;
u32 filler;
};
// Data packet that's never sent
// No function to read it either
static void SendPacket_Unused(u32 data)
{
struct UnusedPacket packet;
packet.id = PACKET_UNUSED;
packet.data = data;
Rfu_SendPacket(&packet);
}
struct LeaderStatePacket
{
u8 id;

View File

@@ -1641,7 +1641,6 @@ static u8 HandleInput_OnButtons(void)
u8 input;
s8 cursorArea;
s8 cursorPosition;
s8 prevPos;
do
{

View File

@@ -186,44 +186,6 @@ u8 CountPartyMons(void)
return count;
}
static u8 *StringCopyAndFillWithSpaces(u8 *dst, const u8 *src, u16 n)
{
u8 *str;
for (str = StringCopy(dst, src); str < dst + n; str++)
*str = CHAR_SPACE;
*str = EOS;
return str;
}
// Unused
static void UnusedWriteRectCpu(u16 *dest, u16 dest_left, u16 dest_top, const u16 *src, u16 src_left, u16 src_top, u16 dest_width, u16 dest_height, u16 src_width)
{
u16 i;
dest_width *= 2;
dest += dest_top * 0x20 + dest_left;
src += src_top * src_width + src_left;
for (i = 0; i < dest_height; i++)
{
CpuCopy16(src, dest, dest_width);
dest += 0x20;
src += src_width;
}
}
// Unused
static void UnusedWriteRectDma(u16 *dest, u16 dest_left, u16 dest_top, u16 width, u16 height)
{
u16 i;
dest += dest_top * 0x20 + dest_left;
width *= 2;
for (i = 0; i < height; dest += 0x20, i++)
Dma3FillLarge16_(0, dest, width);
}
enum {
STATE_LOAD,
STATE_FADE_IN,

View File

@@ -1345,9 +1345,6 @@ static void SpriteCB_ItemIcon_HideParty(struct Sprite *sprite)
static EWRAM_DATA struct UnkUtil *sUnkUtil = NULL;
static void UnkUtil_CpuRun(struct UnkUtilData *unkStruct);
static void UnkUtil_DmaRun(struct UnkUtilData *unkStruct);
void UnkUtil_Init(struct UnkUtil *util, struct UnkUtilData *data, u32 max)
{
sUnkUtil = util;
@@ -1369,62 +1366,3 @@ void UnkUtil_Run(void)
sUnkUtil->numActive = 0;
}
}
// Unused
static bool8 UnkUtil_CpuAdd(u8 *dest, u16 dLeft, u16 dTop, const u8 *src, u16 sLeft, u16 sTop, u16 width, u16 height, u16 unkArg)
{
struct UnkUtilData *data;
if (sUnkUtil->numActive >= sUnkUtil->max)
return FALSE;
data = &sUnkUtil->data[sUnkUtil->numActive++];
data->size = width * 2;
data->dest = dest + 2 * (dTop * 32 + dLeft);
data->src = src + 2 * (sTop * unkArg + sLeft);
data->height = height;
data->unk = unkArg;
data->func = UnkUtil_CpuRun;
return TRUE;
}
// Functionally unused
static void UnkUtil_CpuRun(struct UnkUtilData *data)
{
u16 i;
for (i = 0; i < data->height; i++)
{
CpuCopy16(data->src, data->dest, data->size);
data->dest += 64;
data->src += (data->unk * 2);
}
}
// Unused
static bool8 UnkUtil_DmaAdd(void *dest, u16 dLeft, u16 dTop, u16 width, u16 height)
{
struct UnkUtilData *data;
if (sUnkUtil->numActive >= sUnkUtil->max)
return FALSE;
data = &sUnkUtil->data[sUnkUtil->numActive++];
data->size = width * 2;
data->dest = dest + ((dTop * 32) + dLeft) * 2;
data->height = height;
data->func = UnkUtil_DmaRun;
return TRUE;
}
// Functionally unused
static void UnkUtil_DmaRun(struct UnkUtilData *data)
{
u16 i;
for (i = 0; i < data->height; i++)
{
Dma3FillLarge_(0, data->dest, data->size, 16);
data->dest += 64;
}
}