summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/battle_pyramid_bag.c10
-rw-r--r--src/field_player_avatar.c2
-rw-r--r--src/field_screen_effect.c4
-rwxr-xr-xsrc/item_menu.c10
-rw-r--r--src/menu.c121
-rw-r--r--src/player_pc.c2
-rw-r--r--src/pokeblock.c2
-rw-r--r--src/pokenav_conditions_2.c4
-rwxr-xr-xsrc/pokenav_match_call_2.c2
-rw-r--r--src/pokenav_match_call_ui.c4
-rwxr-xr-xsrc/pokenav_region_map.c4
-rw-r--r--src/pokenav_ribbons_2.c2
-rw-r--r--src/script_menu.c4
-rw-r--r--src/start_menu.c2
14 files changed, 82 insertions, 91 deletions
diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c
index e18a29295..9e17817e0 100644
--- a/src/battle_pyramid_bag.c
+++ b/src/battle_pyramid_bag.c
@@ -978,7 +978,7 @@ static void OpenContextMenu(u8 taskId)
static void PrintMenuActionText_SingleRow(u8 windowId)
{
- AddItemMenuActionTextPrinters(windowId, FONT_NARROW, 8, 1, 0, 0x10, gPyramidBagMenu->menuActionsCount, sMenuActions, gPyramidBagMenu->menuActionIds);
+ PrintMenuActionTexts(windowId, FONT_NARROW, 8, 1, 0, 0x10, gPyramidBagMenu->menuActionsCount, sMenuActions, gPyramidBagMenu->menuActionIds);
InitMenuInUpperLeftCornerNormal(windowId, gPyramidBagMenu->menuActionsCount, 0);
}
@@ -1020,7 +1020,7 @@ static void HandleMenuActionInput_2x2(u8 taskId)
if (id > 0 && IsValidMenuAction(id - 2))
{
PlaySE(SE_SELECT);
- ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_UP);
+ ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_UP);
}
}
else if (JOY_NEW(DPAD_DOWN))
@@ -1028,7 +1028,7 @@ static void HandleMenuActionInput_2x2(u8 taskId)
if (id < gPyramidBagMenu->menuActionsCount - 2 && IsValidMenuAction(id + 2))
{
PlaySE(SE_SELECT);
- ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_DOWN);
+ ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_DOWN);
}
}
else if (JOY_NEW(DPAD_LEFT) || GetLRKeysPressed() == MENU_L_PRESSED)
@@ -1036,7 +1036,7 @@ static void HandleMenuActionInput_2x2(u8 taskId)
if (id & 1 && IsValidMenuAction(id - 1))
{
PlaySE(SE_SELECT);
- ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_LEFT, MENU_CURSOR_DELTA_NONE);
+ ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_LEFT, MENU_CURSOR_DELTA_NONE);
}
}
else if (JOY_NEW(DPAD_RIGHT) || GetLRKeysPressed() == MENU_R_PRESSED)
@@ -1044,7 +1044,7 @@ static void HandleMenuActionInput_2x2(u8 taskId)
if (!(id & 1) && IsValidMenuAction(id + 1))
{
PlaySE(SE_SELECT);
- ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_RIGHT, MENU_CURSOR_DELTA_NONE);
+ ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_RIGHT, MENU_CURSOR_DELTA_NONE);
}
}
else if (JOY_NEW(A_BUTTON))
diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c
index 06b582756..f694628ff 100644
--- a/src/field_player_avatar.c
+++ b/src/field_player_avatar.c
@@ -1763,7 +1763,7 @@ static bool8 Fishing_InitDots(struct Task *task)
{
u32 randVal;
- sub_819786C(0, TRUE);
+ LoadMessageBoxAndFrameGfx(0, TRUE);
task->tStep++;
task->tFrameCounter = 0;
task->tNumDots = 0;
diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c
index e573fe5ab..c27ec6c4c 100644
--- a/src/field_screen_effect.c
+++ b/src/field_screen_effect.c
@@ -1145,7 +1145,7 @@ static void Task_OrbEffect(u8 taskId)
tState = 1;
break;
case 1:
- sub_8199DF0(0, PIXEL_FILL(1), 0, 1);
+ BgDmaFill(0, PIXEL_FILL(1), 0, 1);
LoadOrbEffectPalette(tBlueOrb);
StartUpdateOrbFlashEffect(tCenterX, tCenterY, 1, 160, 1, 2);
tState = 2;
@@ -1190,7 +1190,7 @@ static void Task_OrbEffect(u8 taskId)
if (UpdateOrbEffectBlend(tShakeDir) == TRUE)
{
tState = 5;
- sub_8199DF0(0, PIXEL_FILL(0), 0, 1);
+ BgDmaFill(0, PIXEL_FILL(0), 0, 1);
}
}
break;
diff --git a/src/item_menu.c b/src/item_menu.c
index 037567daa..4a21c0790 100755
--- a/src/item_menu.c
+++ b/src/item_menu.c
@@ -1667,7 +1667,7 @@ static void OpenContextMenu(u8 taskId)
static void PrintContextMenuItems(u8 windowId)
{
- AddItemMenuActionTextPrinters(windowId, FONT_NARROW, 8, 1, 0, 16, gBagMenu->contextMenuNumItems, sItemMenuActions, gBagMenu->contextMenuItemsPtr);
+ PrintMenuActionTexts(windowId, FONT_NARROW, 8, 1, 0, 16, gBagMenu->contextMenuNumItems, sItemMenuActions, gBagMenu->contextMenuItemsPtr);
InitMenuInUpperLeftCornerNormal(windowId, gBagMenu->contextMenuNumItems, 0);
}
@@ -1720,7 +1720,7 @@ static void Task_ItemContext_MultipleRows(u8 taskId)
if (cursorPos > 0 && IsValidContextMenuPos(cursorPos - 2))
{
PlaySE(SE_SELECT);
- ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_UP);
+ ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_UP);
}
}
else if (JOY_NEW(DPAD_DOWN))
@@ -1728,7 +1728,7 @@ static void Task_ItemContext_MultipleRows(u8 taskId)
if (cursorPos < (gBagMenu->contextMenuNumItems - 2) && IsValidContextMenuPos(cursorPos + 2))
{
PlaySE(SE_SELECT);
- ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_DOWN);
+ ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_DOWN);
}
}
else if (JOY_NEW(DPAD_LEFT) || GetLRKeysPressed() == MENU_L_PRESSED)
@@ -1736,7 +1736,7 @@ static void Task_ItemContext_MultipleRows(u8 taskId)
if ((cursorPos & 1) && IsValidContextMenuPos(cursorPos - 1))
{
PlaySE(SE_SELECT);
- ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_LEFT, MENU_CURSOR_DELTA_NONE);
+ ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_LEFT, MENU_CURSOR_DELTA_NONE);
}
}
else if (JOY_NEW(DPAD_RIGHT) || GetLRKeysPressed() == MENU_R_PRESSED)
@@ -1744,7 +1744,7 @@ static void Task_ItemContext_MultipleRows(u8 taskId)
if (!(cursorPos & 1) && IsValidContextMenuPos(cursorPos + 1))
{
PlaySE(SE_SELECT);
- ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_RIGHT, MENU_CURSOR_DELTA_NONE);
+ ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_RIGHT, MENU_CURSOR_DELTA_NONE);
}
}
else if (JOY_NEW(A_BUTTON))
diff --git a/src/menu.c b/src/menu.c
index ddbc82686..6b915f9ce 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -71,7 +71,7 @@ static EWRAM_DATA bool8 sScheduledBgCopiesToVram[4] = {FALSE};
static EWRAM_DATA u16 sTempTileDataBufferIdx = 0;
static EWRAM_DATA void *sTempTileDataBuffer[0x20] = {NULL};
-const u16 gStandardMenuPalette[] = INCBIN_U16("graphics/interface/860F074.gbapal");
+const u16 gStandardMenuPalette[] = INCBIN_U16("graphics/interface/std_menu.gbapal");
static const u8 sTextSpeedFrameDelays[] =
{
@@ -425,7 +425,7 @@ void SetStandardWindowBorderStyle(u8 windowId, bool8 copyToVram)
DrawStdFrameWithCustomTileAndPalette(windowId, copyToVram, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM);
}
-void sub_819786C(u8 windowId, bool8 copyToVram)
+void LoadMessageBoxAndFrameGfx(u8 windowId, bool8 copyToVram)
{
LoadMessageBoxGfx(windowId, DLG_WINDOW_BASE_TILE_NUM, DLG_WINDOW_PALETTE_NUM * 0x10);
DrawDialogFrameWithCustomTileAndPalette(windowId, copyToVram, DLG_WINDOW_BASE_TILE_NUM, 0xF);
@@ -1128,7 +1128,7 @@ static void PrintMenuActionTextsAtTop(u8 windowId, u8 fontId, u8 lineHeight, u8
PrintMenuActionTextsAtPos(windowId, fontId, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH), 1, lineHeight, itemCount, menuActions);
}
-void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions, const u8 *actionIds)
+void PrintMenuActionTexts(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions, const u8 *actionIds)
{
u8 i;
struct TextPrinterTemplate printer;
@@ -1156,9 +1156,9 @@ void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 l
}
// Unused
-static void AddItemMenuActionTextPrintersAtTop(u8 windowId, u8 fontId, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions, const u8 *actionIds)
+static void PrintMenuActionTextsAtTopById(u8 windowId, u8 fontId, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions, const u8 *actionIds)
{
- AddItemMenuActionTextPrinters(windowId, fontId, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH), 1, GetFontAttribute(fontId, FONTATTR_LETTER_SPACING), lineHeight, itemCount, menuActions, actionIds);
+ PrintMenuActionTexts(windowId, fontId, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH), 1, GetFontAttribute(fontId, FONTATTR_LETTER_SPACING), lineHeight, itemCount, menuActions, actionIds);
}
void SetWindowTemplateFields(struct WindowTemplate *template, u8 bg, u8 left, u8 top, u8 width, u8 height, u8 paletteNum, u16 baseBlock)
@@ -1232,22 +1232,22 @@ void EraseYesNoWindow(void)
RemoveWindow(sYesNoWindowId);
}
-static void sub_8198C94(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 a5, u8 a6, u8 a7, const struct MenuAction *menuActions)
+static void PrintMenuActionGridText(u8 windowId, u8 fontId, u8 left, u8 top, u8 width, u8 height, u8 columns, u8 rows, const struct MenuAction *menuActions)
{
u8 i;
u8 j;
- for (i = 0; i < a7; i++)
+ for (i = 0; i < rows; i++)
{
- for (j = 0; j < a6; j++)
- AddTextPrinterParameterized(windowId, fontId, menuActions[(i * a6) + j].text, (a4 * j) + left, (a5 * i) + top, TEXT_SKIP_DRAW, NULL);
+ for (j = 0; j < columns; j++)
+ AddTextPrinterParameterized(windowId, fontId, menuActions[(i * columns) + j].text, (width * j) + left, (height * i) + top, TEXT_SKIP_DRAW, NULL);
}
CopyWindowToVram(windowId, COPYWIN_GFX);
}
// Unused
-static void sub_8198D54(u8 windowId, u8 fontId, u8 a2, u8 a3, u8 a4, u8 a5, const struct MenuAction *menuActions)
+static void PrintMenuActionGridTextAtTop(u8 windowId, u8 fontId, u8 a2, u8 a3, u8 a4, u8 a5, const struct MenuAction *menuActions)
{
- sub_8198C94(windowId, fontId, GetFontAttribute(fontId, 0), 0, a2, a3, a4, a5, menuActions);
+ PrintMenuActionGridText(windowId, fontId, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH), 0, a2, a3, a4, a5, menuActions);
}
void PrintMenuActionGrid(u8 windowId, u8 fontId, u8 left, u8 top, u8 optionWidth, u8 horizontalCount, u8 verticalCount, const struct MenuAction *menuActions, const u8 *actionIds)
@@ -1287,7 +1287,7 @@ static void PrintMenuActionGrid_TopLeft(u8 windowId, u8 fontId, u8 optionWidth,
PrintMenuActionGrid(windowId, fontId, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH), 0, optionWidth, horizontalCount, verticalCount, menuActions, actionIds);
}
-static u8 sub_8198F58(u8 windowId, u8 fontId, u8 left, u8 top, u8 optionWidth, u8 optionHeight, u8 columns, u8 rows, u8 numChoices, u8 cursorPos)
+static u8 InitMenuGrid(u8 windowId, u8 fontId, u8 left, u8 top, u8 optionWidth, u8 optionHeight, u8 columns, u8 rows, u8 numChoices, u8 cursorPos)
{
s32 pos;
@@ -1310,42 +1310,34 @@ static u8 sub_8198F58(u8 windowId, u8 fontId, u8 left, u8 top, u8 optionWidth, u
sMenu.cursorPos = pos;
// Why call this when it's not gonna move?
- ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_NONE);
+ ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_NONE);
return sMenu.cursorPos;
}
// Unused
-static u8 sub_8198FD4(u8 windowId, u8 fontId, u8 left, u8 top, u8 width, u8 columns, u8 rows, u8 cursorPos)
+static u8 InitMenuGridDefaultCursorHeight(u8 windowId, u8 fontId, u8 left, u8 top, u8 width, u8 columns, u8 rows, u8 cursorPos)
{
u8 cursorHeight = GetMenuCursorDimensionByFont(fontId, 1);
u8 numChoices = columns * rows;
- return sub_8198F58(windowId, fontId, left, top, width, cursorHeight, columns, rows, numChoices, cursorPos);
+ return InitMenuGrid(windowId, fontId, left, top, width, cursorHeight, columns, rows, numChoices, cursorPos);
}
-static void sub_8199060(u8 oldCursorPos, u8 newCursorPos)
+// Erase cursor at old position, draw cursor at new position.
+static void MoveMenuGridCursor(u8 oldCursorPos, u8 newCursorPos)
{
u8 cursorWidth = GetMenuCursorDimensionByFont(sMenu.fontId, 0);
u8 cursorHeight = GetMenuCursorDimensionByFont(sMenu.fontId, 1);
+
u8 xPos = (oldCursorPos % sMenu.columns) * sMenu.optionWidth + sMenu.left;
u8 yPos = (oldCursorPos / sMenu.columns) * sMenu.optionHeight + sMenu.top;
- FillWindowPixelRect(sMenu.windowId,
- PIXEL_FILL(1),
- xPos,
- yPos,
- cursorWidth,
- cursorHeight);
+ FillWindowPixelRect(sMenu.windowId, PIXEL_FILL(1), xPos, yPos, cursorWidth, cursorHeight);
+
xPos = (newCursorPos % sMenu.columns) * sMenu.optionWidth + sMenu.left;
yPos = (newCursorPos / sMenu.columns) * sMenu.optionHeight + sMenu.top;
- AddTextPrinterParameterized(sMenu.windowId,
- sMenu.fontId,
- gText_SelectorArrow3,
- xPos,
- yPos,
- 0,
- 0);
+ AddTextPrinterParameterized(sMenu.windowId, sMenu.fontId, gText_SelectorArrow3, xPos, yPos, 0, 0);
}
-u8 ChangeListMenuCursorPosition(s8 deltaX, s8 deltaY)
+u8 ChangeMenuGridCursorPosition(s8 deltaX, s8 deltaY)
{
u8 oldPos = sMenu.cursorPos;
@@ -1376,7 +1368,7 @@ u8 ChangeListMenuCursorPosition(s8 deltaX, s8 deltaY)
}
else
{
- sub_8199060(oldPos, sMenu.cursorPos);
+ MoveMenuGridCursor(oldPos, sMenu.cursorPos);
return sMenu.cursorPos;
}
}
@@ -1410,13 +1402,13 @@ u8 ChangeGridMenuCursorPosition(s8 deltaX, s8 deltaY)
}
else
{
- sub_8199060(oldPos, sMenu.cursorPos);
+ MoveMenuGridCursor(oldPos, sMenu.cursorPos);
return sMenu.cursorPos;
}
}
// Unused
-static s8 sub_8199284(void)
+static s8 Menu_ProcessGridInput_NoSoundLimit(void)
{
if (JOY_NEW(A_BUTTON))
{
@@ -1430,32 +1422,32 @@ static s8 sub_8199284(void)
else if (JOY_NEW(DPAD_UP))
{
PlaySE(SE_SELECT);
- ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_UP);
+ ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_UP);
return MENU_NOTHING_CHOSEN;
}
else if (JOY_NEW(DPAD_DOWN))
{
PlaySE(SE_SELECT);
- ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_DOWN);
+ ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_DOWN);
return MENU_NOTHING_CHOSEN;
}
else if (JOY_NEW(DPAD_LEFT) || GetLRKeysPressed() == MENU_L_PRESSED)
{
PlaySE(SE_SELECT);
- ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_LEFT, MENU_CURSOR_DELTA_NONE);
+ ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_LEFT, MENU_CURSOR_DELTA_NONE);
return MENU_NOTHING_CHOSEN;
}
else if (JOY_NEW(DPAD_RIGHT) || GetLRKeysPressed() == MENU_R_PRESSED)
{
PlaySE(SE_SELECT);
- ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_RIGHT, MENU_CURSOR_DELTA_NONE);
+ ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_RIGHT, MENU_CURSOR_DELTA_NONE);
return MENU_NOTHING_CHOSEN;
}
return MENU_NOTHING_CHOSEN;
}
-s8 Menu_ProcessInputGridLayout(void)
+s8 Menu_ProcessGridInput(void)
{
u8 oldPos = sMenu.cursorPos;
@@ -1497,7 +1489,7 @@ s8 Menu_ProcessInputGridLayout(void)
}
// Unused
-static s8 sub_81993D8(void)
+static s8 Menu_ProcessGridInputRepeat_NoSoundLimit(void)
{
if (JOY_NEW(A_BUTTON))
{
@@ -1511,25 +1503,25 @@ static s8 sub_81993D8(void)
else if (JOY_REPEAT(DPAD_ANY) == DPAD_UP)
{
PlaySE(SE_SELECT);
- ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_UP);
+ ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_UP);
return MENU_NOTHING_CHOSEN;
}
else if (JOY_REPEAT(DPAD_ANY) == DPAD_DOWN)
{
PlaySE(SE_SELECT);
- ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_DOWN);
+ ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_DOWN);
return MENU_NOTHING_CHOSEN;
}
else if (JOY_REPEAT(DPAD_ANY) == DPAD_LEFT || GetLRKeysPressedAndHeld() == MENU_L_PRESSED)
{
PlaySE(SE_SELECT);
- ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_LEFT, MENU_CURSOR_DELTA_NONE);
+ ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_LEFT, MENU_CURSOR_DELTA_NONE);
return MENU_NOTHING_CHOSEN;
}
else if (JOY_REPEAT(DPAD_ANY) == DPAD_RIGHT || GetLRKeysPressedAndHeld() == MENU_R_PRESSED)
{
PlaySE(SE_SELECT);
- ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_RIGHT, MENU_CURSOR_DELTA_NONE);
+ ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_RIGHT, MENU_CURSOR_DELTA_NONE);
return MENU_NOTHING_CHOSEN;
}
@@ -1537,7 +1529,7 @@ static s8 sub_81993D8(void)
}
// Unused
-static s8 sub_8199484(void)
+static s8 Menu_ProcessGridInputRepeat(void)
{
u8 oldPos = sMenu.cursorPos;
@@ -1617,7 +1609,7 @@ void PrintMenuTable(u8 windowId, u8 itemCount, const struct MenuAction *menuActi
CopyWindowToVram(windowId, COPYWIN_GFX);
}
-void sub_81995E4(u8 windowId, u8 itemCount, const struct MenuAction *menuActions, const u8 *actionIds)
+void PrintMenuActionTextsInUpperLeftCorner(u8 windowId, u8 itemCount, const struct MenuAction *menuActions, const u8 *actionIds)
{
u8 i;
struct TextPrinterTemplate printer;
@@ -1682,7 +1674,7 @@ void PrintMenuGridTable(u8 windowId, u8 optionWidth, u8 columns, u8 rows, const
}
// Unused
-static void sub_819983C(u8 windowId, u8 a4, u8 itemCount, u8 itemCount2, const struct MenuAction *menuActions, const u8 *actionIds)
+static void PrintMenuActionGridTextNoSpacing(u8 windowId, u8 optionWidth, u8 columns, u8 rows, const struct MenuAction *menuActions, const u8 *actionIds)
{
u8 i;
u8 j;
@@ -1697,12 +1689,12 @@ static void sub_819983C(u8 windowId, u8 a4, u8 itemCount, u8 itemCount2, const s
printer.letterSpacing = 0;
printer.lineSpacing = 0;
- for (i = 0; i < itemCount2; i++)
+ for (i = 0; i < rows; i++)
{
- for (j = 0; j < itemCount; j++)
+ for (j = 0; j < columns; j++)
{
- printer.currentChar = menuActions[actionIds[(itemCount * i) + j]].text;
- printer.x = (a4 * j) + 8;
+ printer.currentChar = menuActions[actionIds[(columns * i) + j]].text;
+ printer.x = (optionWidth * j) + 8;
printer.y = (16 * i) + 1;
printer.currentX = printer.x;
printer.currentY = printer.y;
@@ -1736,7 +1728,7 @@ u8 InitMenuActionGrid(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initi
sMenu.cursorPos = pos;
// Why call this when it's not gonna move?
- ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_NONE);
+ ChangeMenuGridCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_NONE);
return sMenu.cursorPos;
}
@@ -1932,11 +1924,11 @@ void ResetBgPositions(void)
ChangeBgY(3, 0, BG_COORD_SET);
}
-void sub_8199DF0(u32 bg, u8 a1, int a2, int a3)
+void BgDmaFill(u32 bg, u8 value, int offset, int size)
{
- int temp = (!GetBgAttribute(bg, BG_ATTR_PALETTEMODE)) ? 0x20 : 0x40;
- void *addr = (void *)((GetBgAttribute(bg, BG_ATTR_CHARBASEINDEX) * 0x4000) + (GetBgAttribute(bg, BG_ATTR_BASETILE) + a2) * temp);
- RequestDma3Fill(a1 << 24 | a1 << 16 | a1 << 8 | a1, addr + VRAM, a3 * temp, 1);
+ int temp = (!GetBgAttribute(bg, BG_ATTR_PALETTEMODE)) ? 32 : 64;
+ void *addr = (void *)((GetBgAttribute(bg, BG_ATTR_CHARBASEINDEX) * 0x4000) + (GetBgAttribute(bg, BG_ATTR_BASETILE) + offset) * temp);
+ RequestDma3Fill(value << 24 | value << 16 | value << 8 | value, VRAM + addr, size * temp, 1);
}
void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str)
@@ -2014,8 +2006,7 @@ void PrintPlayerNameOnWindow(u8 windowId, const u8 *src, u16 x, u16 y)
AddTextPrinterParameterized(windowId, 1, gStringVar4, x, y, TEXT_SKIP_DRAW, 0);
}
-// Unused. Similar to BlitBitmapRect4Bit.
-static void sub_819A080(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height)
+static void UnusedBlitBitmapRect(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height)
{
int loopSrcY, loopDstY, loopSrcX, loopDstX, xEnd, yEnd, multiplierSrcY, multiplierDstY;
const u8 *pixelsSrc;
@@ -2032,8 +2023,8 @@ static void sub_819A080(const struct Bitmap *src, struct Bitmap *dst, u16 srcX,
else
yEnd = srcY + height;
- multiplierSrcY = (src->width + (src->width & 7)) >> 3;
- multiplierDstY = (dst->width + (dst->width & 7)) >> 3;
+ multiplierSrcY = (src->width + (src->width % 8)) >> 3;
+ multiplierDstY = (dst->width + (dst->width % 8)) >> 3;
for (loopSrcY = srcY, loopDstY = dstY; loopSrcY < yEnd; loopSrcY++, loopDstY++)
{
@@ -2042,14 +2033,14 @@ static void sub_819A080(const struct Bitmap *src, struct Bitmap *dst, u16 srcX,
pixelsSrc = src->pixels + ((loopSrcX >> 1) & 3) + ((loopSrcX >> 3) << 5) + (((loopSrcY >> 3) * multiplierSrcY) << 5) + ((u32)(loopSrcY << 29) >> 27);
pixelsDst = (void*) dst->pixels + ((loopDstX >> 1) & 3) + ((loopDstX >> 3) << 5) + ((( loopDstY >> 3) * multiplierDstY) << 5) + ((u32)(loopDstY << 29) >> 27);
- if ((uintptr_t)pixelsDst & 0x1)
+ if ((uintptr_t)pixelsDst & 1)
{
pixelsDst--;
- if (loopDstX & 0x1)
+ if (loopDstX & 1)
{
toOrr = *(vu16*)pixelsDst;
toOrr &= 0x0fff;
- if (loopSrcX & 0x1)
+ if (loopSrcX & 1)
toOrr |= ((*pixelsSrc & 0xf0) << 8);
else
toOrr |= ((*pixelsSrc & 0x0f) << 12);
@@ -2058,7 +2049,7 @@ static void sub_819A080(const struct Bitmap *src, struct Bitmap *dst, u16 srcX,
{
toOrr = *(vu16*)pixelsDst;
toOrr &= 0xf0ff;
- if (loopSrcX & 0x1)
+ if (loopSrcX & 1)
toOrr |= ((*pixelsSrc & 0xf0) << 4);
else
toOrr |= ((*pixelsSrc & 0x0f) << 8);
@@ -2091,13 +2082,13 @@ static void sub_819A080(const struct Bitmap *src, struct Bitmap *dst, u16 srcX,
}
// Unused
-static void sub_819A25C(u8 palOffset, u16 speciesId)
+static void LoadMonIconPalAtOffset(u8 palOffset, u16 speciesId)
{
LoadPalette(GetValidMonIconPalettePtr(speciesId), palOffset, 0x20);
}
// Unused
-static void sub_819A27C(u8 windowId, u16 speciesId, u32 personality, u16 x, u16 y)
+static void DrawMonIconAtPos(u8 windowId, u16 speciesId, u32 personality, u16 x, u16 y)
{
BlitBitmapToWindow(windowId, GetMonIconPtr(speciesId, personality, 1), x, y, 32, 32);
}
diff --git a/src/player_pc.c b/src/player_pc.c
index 622c30ec0..06f58fdeb 100644
--- a/src/player_pc.c
+++ b/src/player_pc.c
@@ -399,7 +399,7 @@ static void InitPlayerPCMenu(u8 taskId)
windowTemplate.width = GetMaxWidthInSubsetOfMenuTable(sPlayerPCMenuActions, sTopMenuOptionOrder, sTopMenuNumOptions);
tWindowId = AddWindow(&windowTemplate);
SetStandardWindowBorderStyle(tWindowId, 0);
- sub_81995E4(tWindowId, sTopMenuNumOptions, sPlayerPCMenuActions, sTopMenuOptionOrder);
+ PrintMenuActionTextsInUpperLeftCorner(tWindowId, sTopMenuNumOptions, sPlayerPCMenuActions, sTopMenuOptionOrder);
InitMenuInUpperLeftCornerNormal(tWindowId, sTopMenuNumOptions, 0);
ScheduleBgCopyTilemapToVram(0);
gTasks[taskId].func = PlayerPCProcessMenuInput;
diff --git a/src/pokeblock.c b/src/pokeblock.c
index e07ad018e..3ea593841 100644
--- a/src/pokeblock.c
+++ b/src/pokeblock.c
@@ -1149,7 +1149,7 @@ static void ShowPokeblockActionsWindow(u8 taskId)
DestroyScrollArrows();
DrawStdFrameWithCustomTileAndPalette(tWindowId, 0, 1, 0xE);
- sub_81995E4(tWindowId, sPokeblockMenu->numActions, sPokeblockMenuActions, sPokeblockMenu->pokeblockActionIds);
+ PrintMenuActionTextsInUpperLeftCorner(tWindowId, sPokeblockMenu->numActions, sPokeblockMenuActions, sPokeblockMenu->pokeblockActionIds);
InitMenuInUpperLeftCornerNormal(tWindowId, sPokeblockMenu->numActions, 0);
PutWindowTilemap(tWindowId);
ScheduleBgCopyTilemapToVram(1);
diff --git a/src/pokenav_conditions_2.c b/src/pokenav_conditions_2.c
index 9fc7d33a1..4799b163c 100644
--- a/src/pokenav_conditions_2.c
+++ b/src/pokenav_conditions_2.c
@@ -240,8 +240,8 @@ u32 LoopedTask_OpenPartyConditionGraph(s32 state)
SetConditionGraphIOWindows(2);
return LT_INC_AND_PAUSE;
case 5:
- sub_8199DF0(1, 0, 0, 1);
- sub_8199DF0(1, 17, 1, 1);
+ BgDmaFill(1, 0, 0, 1);
+ BgDmaFill(1, 17, 1, 1);
CpuFill32(0, structPtr->tilemapBuffers[1], BG_SCREEN_SIZE);
SetBgTilemapBuffer(1, structPtr->tilemapBuffers[1]);
return LT_INC_AND_PAUSE;
diff --git a/src/pokenav_match_call_2.c b/src/pokenav_match_call_2.c
index 3bfacfede..8f2220957 100755
--- a/src/pokenav_match_call_2.c
+++ b/src/pokenav_match_call_2.c
@@ -335,7 +335,7 @@ static u32 LoopedTask_OpenMatchCall(s32 taskState)
if (FreeTempTileDataBuffersIfPossible())
return LT_PAUSE;
- sub_8199DF0(1, 0, 0, 1);
+ BgDmaFill(1, 0, 0, 1);
SetBgTilemapBuffer(1, state->unk24);
FillBgTilemapBufferRect_Palette0(1, 0x1000, 0, 0, 32, 20);
CopyPaletteIntoBufferUnfaded(gUnknown_086226E0, 0x10, 0x20);
diff --git a/src/pokenav_match_call_ui.c b/src/pokenav_match_call_ui.c
index 5f95f2493..fd0af90e0 100644
--- a/src/pokenav_match_call_ui.c
+++ b/src/pokenav_match_call_ui.c
@@ -170,8 +170,8 @@ u32 LoopedTask_sub_81C8254(s32 state)
void sub_81C82E4(struct PokenavSub17 *matchCall)
{
u16 tileNum = (matchCall->list.listWindow.unk1 << 12) | matchCall->list.listWindow.unk6;
- sub_8199DF0(matchCall->list.listWindow.bg, PIXEL_FILL(1), matchCall->list.listWindow.unk6, 1);
- sub_8199DF0(matchCall->list.listWindow.bg, PIXEL_FILL(4), matchCall->list.listWindow.unk6 + 1, 1);
+ BgDmaFill(matchCall->list.listWindow.bg, PIXEL_FILL(1), matchCall->list.listWindow.unk6, 1);
+ BgDmaFill(matchCall->list.listWindow.bg, PIXEL_FILL(4), matchCall->list.listWindow.unk6 + 1, 1);
SetBgTilemapBuffer(matchCall->list.listWindow.bg, matchCall->tilemapBuffer);
FillBgTilemapBufferRect_Palette0(matchCall->list.listWindow.bg, tileNum, 0, 0, 32, 32);
ChangeBgY(matchCall->list.listWindow.bg, 0, BG_COORD_SET);
diff --git a/src/pokenav_region_map.c b/src/pokenav_region_map.c
index c117dce3b..89bd2f7c7 100755
--- a/src/pokenav_region_map.c
+++ b/src/pokenav_region_map.c
@@ -501,8 +501,8 @@ static void FreeCityZoomViewGfx(void)
static void LoadPokenavRegionMapGfx(struct Pokenav5Struct_2 *state)
{
- sub_8199DF0(1, PIXEL_FILL(0), 0x40, 1);
- sub_8199DF0(1, PIXEL_FILL(1), 0x41, 1);
+ BgDmaFill(1, PIXEL_FILL(0), 0x40, 1);
+ BgDmaFill(1, PIXEL_FILL(1), 0x41, 1);
CpuFill16(0x1040, state->tilemapBuffer, 0x800);
SetBgTilemapBuffer(1, state->tilemapBuffer);
state->infoWindowId = AddWindow(&sMapSecInfoWindowTemplate);
diff --git a/src/pokenav_ribbons_2.c b/src/pokenav_ribbons_2.c
index 361ec950d..ef08ba392 100644
--- a/src/pokenav_ribbons_2.c
+++ b/src/pokenav_ribbons_2.c
@@ -578,7 +578,7 @@ static u32 LoopedTask_OpenRibbonsSummaryMenu(s32 state)
case 1:
if (!FreeTempTileDataBuffersIfPossible())
{
- sub_8199DF0(1, 0, 0, 1);
+ BgDmaFill(1, 0, 0, 1);
DecompressAndCopyTileDataToVram(1, sRibbonIconsSmall_Gfx, 0, 1, 0);
SetBgTilemapBuffer(1, structPtr->tilemapBuffers[1]);
FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, 32, 20);
diff --git a/src/script_menu.c b/src/script_menu.c
index c82440b79..ae0fe91e6 100644
--- a/src/script_menu.c
+++ b/src/script_menu.c
@@ -288,7 +288,7 @@ bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, bool8 ignore
static void Task_HandleMultichoiceGridInput(u8 taskId)
{
s16 *data = gTasks[taskId].data;
- s8 selection = Menu_ProcessInputGridLayout();
+ s8 selection = Menu_ProcessGridInput();
switch (selection)
{
@@ -379,7 +379,7 @@ static void CreatePCMultichoice(void)
void ScriptMenu_DisplayPCStartupPrompt(void)
{
- sub_819786C(0, TRUE);
+ LoadMessageBoxAndFrameGfx(0, TRUE);
AddTextPrinterParameterized2(0, FONT_NORMAL, gText_WhichPCShouldBeAccessed, 0, NULL, 2, 1, 3);
}
diff --git a/src/start_menu.c b/src/start_menu.c
index 05ceb1119..540073b7f 100644
--- a/src/start_menu.c
+++ b/src/start_menu.c
@@ -876,7 +876,7 @@ void SaveGame(void)
static void ShowSaveMessage(const u8 *message, u8 (*saveCallback)(void))
{
StringExpandPlaceholders(gStringVar4, message);
- sub_819786C(0, TRUE);
+ LoadMessageBoxAndFrameGfx(0, TRUE);
AddTextPrinterForMessage_2(TRUE);
sSavingComplete = TRUE;
sSaveDialogCallback = saveCallback;