summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/battle/battle_2.c6
-rw-r--r--src/battle/battle_4.c8
-rw-r--r--src/battle/battle_controller_player.c24
-rw-r--r--src/battle/battle_controller_safari.c6
-rw-r--r--src/battle/battle_controller_wally.c6
-rw-r--r--src/battle/battle_party_menu.c2
-rw-r--r--src/battle/battle_records.c2
-rw-r--r--src/battle/reshow_battle_screen.c2
-rw-r--r--src/contest.c32
-rw-r--r--src/debug/matsuda_debug_menu.c10
-rw-r--r--src/debug/mori_debug_menu.c2
-rw-r--r--src/debug/sound_check_menu.c4
-rw-r--r--src/debug/unknown_debug_menu.c2
-rw-r--r--src/easy_chat_1.c14
-rw-r--r--src/engine/clear_save_data_menu.c6
-rw-r--r--src/engine/link.c6
-rw-r--r--src/engine/main_menu.c32
-rw-r--r--src/engine/menu.c114
-rw-r--r--src/engine/menu_cursor.c62
-rw-r--r--src/engine/mystery_event_menu.c2
-rw-r--r--src/engine/name_string_util.c4
-rw-r--r--src/engine/naming_screen.c2
-rw-r--r--src/engine/option_menu.c4
-rw-r--r--src/engine/reset_rtc_screen.c2
-rw-r--r--src/engine/save_failed_screen.c2
-rw-r--r--src/engine/text.c58
-rw-r--r--src/engine/trade.c44
-rw-r--r--src/engine/trainer_card.c16
-rw-r--r--src/field/berry_tag_screen.c2
-rw-r--r--src/field/choose_party.c8
-rw-r--r--src/field/daycare.c6
-rw-r--r--src/field/decoration.c24
-rw-r--r--src/field/diploma.c2
-rw-r--r--src/field/field_effect.c4
-rw-r--r--src/field/field_region_map.c2
-rw-r--r--src/field/field_specials.c4
-rw-r--r--src/field/item_menu.c16
-rw-r--r--src/field/mauville_man.c2
-rw-r--r--src/field/menu_helpers.c2
-rw-r--r--src/field/money.c2
-rw-r--r--src/field/overworld.c8
-rw-r--r--src/field/party_menu.c38
-rw-r--r--src/field/player_pc.c28
-rw-r--r--src/field/pokeblock.c10
-rw-r--r--src/field/region_map.c4
-rw-r--r--src/field/script_menu.c10
-rw-r--r--src/field/secret_base.c10
-rw-r--r--src/field/shop.c14
-rw-r--r--src/field/slot_machine.c6
-rw-r--r--src/field/start_menu.c8
-rw-r--r--src/field/starter_choose.c4
-rw-r--r--src/field/trader.c6
-rw-r--r--src/field/tv.c8
-rw-r--r--src/field/use_pokeblock.c2
-rw-r--r--src/field/wallclock.c8
-rw-r--r--src/pokemon/learn_move.c18
-rw-r--r--src/pokemon/mail.c2
-rw-r--r--src/pokemon/mon_markings.c4
-rw-r--r--src/pokemon/pokeblock_feed.c2
-rw-r--r--src/pokemon/pokedex.c30
-rw-r--r--src/pokemon/pokemon_1.c2
-rw-r--r--src/pokemon/pokemon_menu.c18
-rw-r--r--src/pokemon/pokemon_summary_screen.c8
-rw-r--r--src/pokenav_before.c10
-rw-r--r--src/roulette.c2
-rw-r--r--src/scene/berry_blender.c20
-rw-r--r--src/scene/contest_painting.c4
-rw-r--r--src/scene/credits.c2
-rw-r--r--src/scene/egg_hatch.c4
-rw-r--r--src/scene/evolution_scene.c14
-rw-r--r--src/scene/hall_of_fame.c8
71 files changed, 439 insertions, 421 deletions
diff --git a/src/battle/battle_2.c b/src/battle/battle_2.c
index 42cc0b538..249b67e0d 100644
--- a/src/battle/battle_2.c
+++ b/src/battle/battle_2.c
@@ -234,7 +234,7 @@ void InitBattle(void)
}
//sub_80895F8(gUnknown_081F9674.unk0, gUnknown_081F9674.unk4, gUnknown_081F9674.unk8);
sub_80895F8(gUnknown_081F9674);
- SetUpWindowConfig(&gWindowTemplate_81E6C58);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C58);
ResetPaletteFade();
gBattle_BG0_X = 0;
gBattle_BG0_Y = 0;
@@ -553,7 +553,7 @@ void sub_800F02C(void)
gUnknown_02023A00[i].status = GetMonData(&gPlayerParty[i], MON_DATA_STATUS);
gUnknown_02023A00[i].personality = GetMonData(&gPlayerParty[i], MON_DATA_PERSONALITY);
gUnknown_02023A00[i].gender = GetMonGender(&gPlayerParty[i]);
- StripExtCtrlCodes(nickname);
+ Text_StripExtCtrlCodes(nickname);
gUnknown_02023A00[i].language = GetMonData(&gPlayerParty[i], MON_DATA_LANGUAGE);
if (gUnknown_02023A00[i].language != 1)
PadNameString(nickname, 0);
@@ -1210,7 +1210,7 @@ void c2_8011A1C(void)
gUnknown_03004DE0[0][i] = 0xFF10;
gUnknown_03004DE0[1][i] = 0xFF10;
}
- SetUpWindowConfig(&gWindowTemplate_81E6C58);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C58);
ResetPaletteFade();
gBattle_BG0_X = 0;
gBattle_BG0_Y = 0;
diff --git a/src/battle/battle_4.c b/src/battle/battle_4.c
index 4be9b7d1c..164329c1b 100644
--- a/src/battle/battle_4.c
+++ b/src/battle/battle_4.c
@@ -136,7 +136,7 @@ u16 GiveMoveToBattleMon(struct BattlePokemon *mon, u16 move);
void IncrementGameStat(u8 index);
u8 GetScaledHPFraction(s16 hp, s16 maxhp, u8 scale);
u16 GetPokedexHeightWeight(u16 national_num, u8 heightweight);
-u8 sub_814A5C0(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5);
+u8 MenuCursor_Create814A5C0(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5);
void DestroyMenuCursor(void);
void sub_802BC6C(void);
u8 sub_809FA30(void);
@@ -155,7 +155,7 @@ u8 Overworld_GetMapTypeOfSaveblockLocation(void);
u8 CalculatePlayerPartyCount(void);
u16 Sqrt(u32 num);
u8 sub_809070C(u16 nationalNum, u32 TiD, u32 PiD); //task prepare poke dex display
-void sub_814A880(u8 a1, u8 a2);
+void MenuCursor_SetPos814A880(u8 a1, u8 a2);
u8 CheckMoveLimitations(u8 bank, u8 unusable_moves, u8 flags);
bool8 IsLinkDoubleBattle(void);
void sub_8094B6C(u8 bank, u8 partyID, u8 r2);
@@ -10769,7 +10769,7 @@ void sub_8023A80(void)
sub_802BBD4(0x18, 8, 0x1D, 0xD, 0);
Text_InitWindow(&gUnknown_03004210, BattleText_YesNo, 0x100, 0x19, 0x9);
Text_PrintWindow8002F44(&gUnknown_03004210);
- sub_814A5C0(0, 0xFFFF, 0xC, 0x2D9F, 0x20);
+ MenuCursor_Create814A5C0(0, 0xFFFF, 0xC, 0x2D9F, 0x20);
}
void sub_8023AD8(void)
@@ -17333,7 +17333,7 @@ _0802BC68: .4byte 0x00001025\n\
void sub_802BC6C(void)
{
- sub_814A880(0xC8, ((gBattleCommunication[1] << 28) + 1207959552) >> 24); //what could that be?
+ MenuCursor_SetPos814A880(0xC8, ((gBattleCommunication[1] << 28) + 1207959552) >> 24); //what could that be?
}
void nullsub_6(void)
diff --git a/src/battle/battle_controller_player.c b/src/battle/battle_controller_player.c
index 4bbda2afd..489581132 100644
--- a/src/battle/battle_controller_player.c
+++ b/src/battle/battle_controller_player.c
@@ -744,7 +744,7 @@ void sub_802C68C(void)
else
gUnknown_03004344 = gMoveSelectionCursor[gActiveBank] + 1;
sub_802E3B4(gUnknown_03004344, 27);
- FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x37, 0x1C, 0x3A);
+ Text_FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x37, 0x1C, 0x3A);
Text_InitWindow(&gUnknown_03004210, BattleText_SwitchWhich, 0x290, 0x17, 0x37);
Text_PrintWindow8002F44(&gUnknown_03004210);
gBattleBankFunc[gActiveBank] = sub_802CA60;
@@ -853,7 +853,7 @@ void sub_802CA60(void)
gBattleBankFunc[gActiveBank] = sub_802C68C;
gMoveSelectionCursor[gActiveBank] = gUnknown_03004344;
sub_802E3B4(gMoveSelectionCursor[gActiveBank], 0);
- FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x37, 0x1C, 0x3A);
+ Text_FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x37, 0x1C, 0x3A);
Text_InitWindow(&gUnknown_03004210, BattleText_PP, 0x290, 0x17, 0x37);
Text_PrintWindow8002F44(&gUnknown_03004210);
sub_802E220();
@@ -866,7 +866,7 @@ void sub_802CA60(void)
sub_802E3B4(gMoveSelectionCursor[gActiveBank], 0);
sub_802E12C(gMoveSelectionCursor[gActiveBank], BattleText_Format);
gBattleBankFunc[gActiveBank] = sub_802C68C;
- FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x37, 0x1C, 0x3A);
+ Text_FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x37, 0x1C, 0x3A);
Text_InitWindow(&gUnknown_03004210, BattleText_PP, 0x290, 0x17, 0x37);
Text_PrintWindow8002F44(&gUnknown_03004210);
sub_802E220();
@@ -1572,7 +1572,7 @@ void sub_802E1B0(void)
s32 i;
gUnknown_03004348 = 0;
- FillWindowRect(&gUnknown_03004210, 0x1016, 1, 0x37, 0x14, 0x3A);
+ Text_FillWindowRect(&gUnknown_03004210, 0x1016, 1, 0x37, 0x14, 0x3A);
for (i = 0; i < 4; i++)
{
nullsub_7(i);
@@ -1613,7 +1613,7 @@ void sub_802E2D4(void)
{
if (gBattleBufferA[gActiveBank][2] == 1)
{
- FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x37, 0x1C, 0x3A);
+ Text_FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x37, 0x1C, 0x3A);
Text_InitWindow(&gUnknown_03004210, BattleText_ForgetMove, 0x290, 0x13, 0x37);
}
else
@@ -1623,7 +1623,7 @@ void sub_802E2D4(void)
str = StringCopy(str, BattleText_Format);
StringCopy(str, gTypeNames[gBattleMoves[r4->moves[gMoveSelectionCursor[gActiveBank]]].type]);
- FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x39, 0x1C, 0x3A);
+ Text_FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x39, 0x1C, 0x3A);
Text_InitWindow(&gUnknown_03004210, gDisplayedStringBattle, 0x2C0, 0x17, 0x39);
}
Text_PrintWindow8002F44(&gUnknown_03004210);
@@ -1652,7 +1652,7 @@ const u8 gUnknown_081FAE91[][2] =
void sub_802E3B4(u8 a, int unused)
{
sub_814A958(0x48);
- sub_814A880(gUnknown_081FAE89[a][0], gUnknown_081FAE89[a][1]);
+ MenuCursor_SetPos814A880(gUnknown_081FAE89[a][0], gUnknown_081FAE89[a][1]);
}
void nullsub_7(u8 a)
@@ -1662,7 +1662,7 @@ void nullsub_7(u8 a)
void sub_802E3E4(u8 a, int unused)
{
sub_814A958(0x2A);
- sub_814A880(gUnknown_081FAE91[a][0], gUnknown_081FAE91[a][1]);
+ MenuCursor_SetPos814A880(gUnknown_081FAE91[a][0], gUnknown_081FAE91[a][1]);
}
void nullsub_8(u8 a)
@@ -2580,14 +2580,14 @@ void PlayerHandlecmd18(void)
gBattle_BG0_X = 0;
gBattle_BG0_Y = 160;
- FillWindowRect(&gUnknown_03004210, 10, 2, 15, 27, 18);
- FillWindowRect(&gUnknown_03004210, 10, 2, 35, 16, 38);
+ Text_FillWindowRect(&gUnknown_03004210, 10, 2, 15, 27, 18);
+ Text_FillWindowRect(&gUnknown_03004210, 10, 2, 35, 16, 38);
gBattleBankFunc[gActiveBank] = sub_802C098;
Text_InitWindow(&gUnknown_03004210, BattleText_MenuOptions, 400, 18, 35);
Text_PrintWindow8002F44(&gUnknown_03004210);
- sub_814A5C0(0, 0xFFFF, 12, 11679, 0);
+ MenuCursor_Create814A5C0(0, 0xFFFF, 12, 11679, 0);
for (r4 = 0; r4 < 4; r4++)
nullsub_8(r4);
@@ -2605,7 +2605,7 @@ void PlayerHandlecmd19()
void PlayerHandlecmd20(void)
{
- sub_814A5C0(0, 0xFFFF, 12, 0x2D9F, 0);
+ MenuCursor_Create814A5C0(0, 0xFFFF, 12, 0x2D9F, 0);
sub_80304A8();
gBattleBankFunc[gActiveBank] = sub_802C68C;
}
diff --git a/src/battle/battle_controller_safari.c b/src/battle/battle_controller_safari.c
index 72a0cc32c..a4b610752 100644
--- a/src/battle/battle_controller_safari.c
+++ b/src/battle/battle_controller_safari.c
@@ -472,13 +472,13 @@ void SafariHandlecmd18(void)
gBattle_BG0_X = 0;
gBattle_BG0_Y = 160;
gUnknown_03004210.paletteNum = 0;
- FillWindowRect_DefaultPalette(&gUnknown_03004210, 10, 2, 15, 27, 18);
- FillWindowRect_DefaultPalette(&gUnknown_03004210, 10, 2, 35, 16, 36);
+ Text_FillWindowRectDefPalette(&gUnknown_03004210, 10, 2, 15, 27, 18);
+ Text_FillWindowRectDefPalette(&gUnknown_03004210, 10, 2, 35, 16, 36);
gBattleBankFunc[gActiveBank] = bx_battle_menu_t6_2;
Text_InitWindow(&gUnknown_03004210, BattleText_MenuOptionsSafari, 400, 18, 35);
Text_PrintWindow8002F44(&gUnknown_03004210);
- sub_814A5C0(0, 0xFFFF, 12, 11679, 0);
+ MenuCursor_Create814A5C0(0, 0xFFFF, 12, 11679, 0);
for (i = 0; i < 4; i++)
nullsub_8(i);
diff --git a/src/battle/battle_controller_wally.c b/src/battle/battle_controller_wally.c
index 6a9e8071e..6266d955c 100644
--- a/src/battle/battle_controller_wally.c
+++ b/src/battle/battle_controller_wally.c
@@ -1265,12 +1265,12 @@ void WallyHandlecmd18(void)
gBattle_BG0_X = 0;
gBattle_BG0_Y = 160;
gUnknown_03004210.paletteNum = 0;
- FillWindowRect_DefaultPalette(&gUnknown_03004210, 10, 2, 15, 27, 18);
- FillWindowRect_DefaultPalette(&gUnknown_03004210, 10, 2, 35, 16, 36);
+ Text_FillWindowRectDefPalette(&gUnknown_03004210, 10, 2, 15, 27, 18);
+ Text_FillWindowRectDefPalette(&gUnknown_03004210, 10, 2, 35, 16, 36);
gBattleBankFunc[gActiveBank] = sub_81372BC;
Text_InitWindow(&gUnknown_03004210, BattleText_MenuOptions, 400, 18, 35);
Text_PrintWindow8002F44(&gUnknown_03004210);
- sub_814A5C0(0, 0xFFFF, 12, 0x2D9F, 0);
+ MenuCursor_Create814A5C0(0, 0xFFFF, 12, 0x2D9F, 0);
for (i = 0; i < 4; i++)
nullsub_8(i);
sub_802E3E4(0, 0);
diff --git a/src/battle/battle_party_menu.c b/src/battle/battle_party_menu.c
index 67f6e24ef..68a97c536 100644
--- a/src/battle/battle_party_menu.c
+++ b/src/battle/battle_party_menu.c
@@ -723,7 +723,7 @@ static void Task_BattlePartyMenuShift(u8 taskId)
static void Task_BattlePartyMenuCancel(u8 taskId)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
ClosePartyPopupMenu(gTasks[taskId].data[4], sBattlePartyPopupMenus);
gTasks[taskId].data[4] = gTasks[taskId].data[5];
PrintPartyMenuPromptText(0, 0);
diff --git a/src/battle/battle_records.c b/src/battle/battle_records.c
index fb7392f33..4979760d7 100644
--- a/src/battle/battle_records.c
+++ b/src/battle/battle_records.c
@@ -249,7 +249,7 @@ void ShowLinkBattleRecords(void) {
#if ENGLISH
Menu_PrintText(gOtherText_WinLoseDraw, 12, 6);
#elif GERMAN
- MenuPrint_PixelCoords(gOtherText_WinLoseDraw, 88, 48, 1);
+ Menu_PrintTextPixelCoords(gOtherText_WinLoseDraw, 88, 48, 1);
#endif
for (i = 0; i < 5; i++)
diff --git a/src/battle/reshow_battle_screen.c b/src/battle/reshow_battle_screen.c
index bf77e5c07..42bb3ba7f 100644
--- a/src/battle/reshow_battle_screen.c
+++ b/src/battle/reshow_battle_screen.c
@@ -78,7 +78,7 @@ static void CB2_ReshowBattleScreenAfterMenu(void)
{
case 0:
dp12_8087EA4();
- SetUpWindowConfig(&gWindowTemplate_81E6C58);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C58);
ResetPaletteFade();
Text_InitWindowWithTemplate(&gUnknown_03004210, &gWindowTemplate_81E6C58);
gBattle_BG0_X = 0;
diff --git a/src/contest.c b/src/contest.c
index 3677a1d25..8985d6490 100644
--- a/src/contest.c
+++ b/src/contest.c
@@ -357,7 +357,7 @@ void LoadContestBgAfterMoveAnim(void)
void SetUpContestWindow(void)
{
- SetUpWindowConfig(&gWindowTemplate_81E6FD8);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6FD8);
Text_InitWindowWithTemplate(&gUnknown_03004210, &gWindowTemplate_81E6FD8);
Text_InitWindowWithTemplate(&gMenuWindow, &gWindowTemplate_81E6FF4);
}
@@ -686,7 +686,7 @@ void sub_80ABCDC(u8 taskId)
gBattle_BG0_Y = 0xA0;
gBattle_BG2_Y = 0xA0;
- FillWindowRect_DefaultPalette(
+ Text_FillWindowRectDefPalette(
&gUnknown_03004210,
0,
gUnknown_083CA340[0][0],
@@ -725,7 +725,7 @@ void sub_80ABCDC(u8 taskId)
Text_PrintWindow8002F44(&gUnknown_03004210);
}
- sub_814A5C0(0, 0xFFFF, 12, 0x2D9F, 72);
+ MenuCursor_Create814A5C0(0, 0xFFFF, 12, 0x2D9F, 72);
sub_80AC0AC(sContest.playerMoveChoice);
sub_80AEBEC(gContestMons[gContestPlayerMonIndex].moves[sContest.playerMoveChoice]);
gTasks[taskId].func = sub_80ABEA0;
@@ -757,7 +757,7 @@ void sub_80ABEA0(u8 taskId)
sub_814A904();
PlaySE(SE_SELECT);
sub_80AFFE0(FALSE);
- FillWindowRect_DefaultPalette(
+ Text_FillWindowRectDefPalette(
&gUnknown_03004210,
0,
gUnknown_083CA340[0][0],
@@ -809,7 +809,7 @@ void sub_80ABEA0(u8 taskId)
void sub_80AC0AC(s8 a)
{
- sub_814A880(4, 88 + a * 16);
+ MenuCursor_SetPos814A880(4, 88 + a * 16);
}
void nullsub_17(s8 a)
@@ -1940,7 +1940,7 @@ void Contest_CreatePlayerMon(u8 partyIndex)
s16 tough;
StringCopy(name, gSaveBlock2.playerName);
- StripExtCtrlCodes(name);
+ Text_StripExtCtrlCodes(name);
if (gIsLinkContest & 1)
{
u8 temp = name[5];
@@ -1960,7 +1960,7 @@ void Contest_CreatePlayerMon(u8 partyIndex)
StringGetEnd10(name);
if (gIsLinkContest & 1)
{
- StripExtCtrlCodes(name);
+ Text_StripExtCtrlCodes(name);
if (GetMonData(&gPlayerParty[partyIndex], MON_DATA_LANGUAGE) == LANGUAGE_JAPANESE)
{
name[5] = EOS;
@@ -2121,7 +2121,7 @@ void sub_80AE514(void)
for (i = 0; i < 4; i++)
{
- FillWindowRect_DefaultPalette(
+ Text_FillWindowRectDefPalette(
&gUnknown_03004210,
0,
gUnknown_083CA308[gUnknown_02038696[i]][0],
@@ -2161,7 +2161,7 @@ void sub_80AE5D4(u8 p, u8 b)
if ((gIsLinkContest & 1) && gLinkPlayers[p].language == LANGUAGE_JAPANESE)
{
StringCopy(str, gLinkPlayers[p].name);
- sub_8004D04(
+ Text_InitWindow8004D04(
&gUnknown_03004210,
gDisplayedStringBattle,
592 + gUnknown_02038696[p] * 22,
@@ -2198,7 +2198,7 @@ void sub_80AE6E4(u8 a, u8 b)
str = sub_80AE598(str, gContestMons[a].nickname, b);
*str = EOS;
- sub_8004D04(
+ Text_InitWindow8004D04(
&gUnknown_03004210,
gDisplayedStringBattle,
512 + gUnknown_02038696[a] * 20,
@@ -2383,7 +2383,7 @@ void sub_80AEBEC(u16 a)
s32 i;
u8 numHearts;
- FillWindowRect_DefaultPalette(&gUnknown_03004210, 0, 11, 31, 16, 34);
+ Text_FillWindowRectDefPalette(&gUnknown_03004210, 0, 11, 31, 16, 34);
category = gContestMoves[a].contestCategory;
if (category == CONTEST_CATEGORY_COOL)
@@ -2438,7 +2438,7 @@ void sub_80AEBEC(u16 a)
void sub_80AED58(void)
{
- FillWindowRect_DefaultPalette(&gUnknown_03004210, 0, 11, 35, 28, 40);
+ Text_FillWindowRectDefPalette(&gUnknown_03004210, 0, 11, 35, 28, 40);
}
// unused
@@ -2614,7 +2614,7 @@ void sub_80AF120(void)
void sub_80AF138(void)
{
- FillWindowRect_DefaultPalette(&gUnknown_03004210, 0, 1, 15, 17, 18);
+ Text_FillWindowRectDefPalette(&gUnknown_03004210, 0, 1, 15, 17, 18);
}
u16 GetChosenMove(u8 a)
@@ -2674,7 +2674,7 @@ void unref_sub_80AF280(u8 a)
void sub_80AF2A0(u8 a)
{
- FillWindowRect_DefaultPalette(
+ Text_FillWindowRectDefPalette(
&gUnknown_03004210,
0,
gUnknown_083CA318[a][0],
@@ -4146,7 +4146,7 @@ void unref_sub_80B0CF4(void)
for (i = 0; i < 4; i++)
{
- FillWindowRect_DefaultPalette(
+ Text_FillWindowRectDefPalette(
&gUnknown_03004210,
0,
gUnknown_083CA308[i][0],
@@ -4175,7 +4175,7 @@ void sub_80B0D7C(void)
for (i = 0; i < 4; i++)
{
- FillWindowRect_DefaultPalette(
+ Text_FillWindowRectDefPalette(
&gUnknown_03004210,
0,
gUnknown_083CA308[i][0],
diff --git a/src/debug/matsuda_debug_menu.c b/src/debug/matsuda_debug_menu.c
index 52b83d4b1..0585c4e00 100644
--- a/src/debug/matsuda_debug_menu.c
+++ b/src/debug/matsuda_debug_menu.c
@@ -249,7 +249,7 @@ u8 unref_sub_80A9B28(void)
{
Menu_EraseScreen();
Menu_DrawStdWindowFrame(0, 0, 17, 18);
- PrintMenuItems(1, 1, 7, gMatsudaDebugMenuActions);
+ Menu_PrintItems(1, 1, 7, gMatsudaDebugMenuActions);
InitMenu(0, 1, 1, 7, 0, 16);
gCallback_03004AE8 = sub_80A9B78;
return 0;
@@ -449,7 +449,7 @@ static void sub_80A9F50(void)
{
REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP;
REG_DISPCNT |= DISPCNT_OBJ_ON | DISPCNT_BG0_ON;
- SetUpWindowConfig(&gWindowTemplate_81E6C3C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C);
Text_InitWindowWithTemplate(&gMenuWindow, &gWindowTemplate_81E6C3C);
REG_MOSAIC = 0;
REG_BLDCNT = 0;
@@ -573,7 +573,7 @@ void sub_80AA280(u8 var) // no?
{
u8 i;
- FillWindowRect_DefaultPalette(&gMenuWindow, 0, 0, 0, 0x1E, 3);
+ Text_FillWindowRectDefPalette(&gMenuWindow, 0, 0, 0, 0x1E, 3);
StringCopy(gSharedMem, gMatsudaDebugMenu_StartText);
StringAppend(gSharedMem, gContestMons[var].trainerName);
@@ -624,7 +624,7 @@ static void sub_80AA4A8(u8 var)
static void sub_80AA4F0(u8 var1, u8 var2)
{
- FillWindowRect_DefaultPalette(&gMenuWindow, 0, gUnknown_083C928E[var2][0], gUnknown_083C928E[var2][1], gUnknown_083C928E[var2][0] + 7, gUnknown_083C928E[var2][1] + 1);
+ Text_FillWindowRectDefPalette(&gMenuWindow, 0, gUnknown_083C928E[var2][0], gUnknown_083C928E[var2][1], gUnknown_083C928E[var2][0] + 7, gUnknown_083C928E[var2][1] + 1);
Text_InitWindowAndPrintText(&gMenuWindow, gMoveNames[gContestMons[var1].moves[var2]], 0x8A + var2 * 14, gUnknown_083C928E[var2][0], gUnknown_083C928E[var2][1]);
ConvertIntToDecimalStringN(gStringVar1, gContestMons[var1].moves[var2], STR_CONV_MODE_LEADING_ZEROS, 3);
Text_InitWindowAndPrintText(&gMenuWindow, gStringVar1, 0xFA + var2 * 6, gUnknown_083C928E[var2][0] + 7, gUnknown_083C928E[var2][1]);
@@ -1075,7 +1075,7 @@ void unref_sub_80AB084(u8 *text)
break;
}
}
- SetUpWindowConfig(&gWindowTemplate_81E6FD8);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6FD8);
Text_InitWindowWithTemplate(&gUnknown_03004210, &gWindowTemplate_81E6FD8);
LoadFontDefaultPalette(&gWindowTemplate_81E6FD8);
Text_InitWindowAndPrintText(&gUnknown_03004210, text, 1, 9, 7);
diff --git a/src/debug/mori_debug_menu.c b/src/debug/mori_debug_menu.c
index 31f232d82..7b9a579a7 100644
--- a/src/debug/mori_debug_menu.c
+++ b/src/debug/mori_debug_menu.c
@@ -198,7 +198,7 @@ s8 InitMoriDebugMenu(void)
{
Menu_EraseScreen();
Menu_DrawStdWindowFrame(0, 0, 10, 19);
- PrintMenuItems(1, 1, 9, gMoriDebugMenuActions);
+ Menu_PrintItems(1, 1, 9, gMoriDebugMenuActions);
InitMenu(0, 1, 1, 9, 0, 9);
gCallback_03004AE8 = MoriDebugMenuProcessInput;
return 0;
diff --git a/src/debug/sound_check_menu.c b/src/debug/sound_check_menu.c
index 411ff6f54..05cbfc8f7 100644
--- a/src/debug/sound_check_menu.c
+++ b/src/debug/sound_check_menu.c
@@ -132,7 +132,7 @@ void CB2_StartSoundCheckMenu(void)
ResetPaletteFade();
ResetTasks();
ResetSpriteData();
- SetUpWindowConfig(&gWindowTemplate_81E6C3C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C);
InitMenuWindow(&gWindowTemplate_81E6CE4);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
REG_WIN0H = WIN_RANGE(0, 0);
@@ -1217,7 +1217,7 @@ void Task_InitCryTest(u8 taskId)
struct CryRelatedStruct cryStruct, cryStruct2;
u8 zero;
- SetUpWindowConfig(&gWindowTemplate_81E6C3C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C);
InitMenuWindow(&gWindowTemplate_81E6CE4);
gSoundTestCryNum = 1;
ResetSpriteData();
diff --git a/src/debug/unknown_debug_menu.c b/src/debug/unknown_debug_menu.c
index e95806c74..9cece924d 100644
--- a/src/debug/unknown_debug_menu.c
+++ b/src/debug/unknown_debug_menu.c
@@ -34,7 +34,7 @@ int unref_sub_814A414(void)
{
Menu_EraseScreen();
Menu_DrawStdWindowFrame(0, 0, 16, 18);
- PrintMenuItems(2, 1, 8, gUnknown_0842C29C);
+ Menu_PrintItems(2, 1, 8, gUnknown_0842C29C);
InitMenu(0, 1, 1, 8, 0, 15);
gCallback_03004AE8 = sub_814A464;
return 0;
diff --git a/src/easy_chat_1.c b/src/easy_chat_1.c
index 8d68adfe9..cb0e98b71 100644
--- a/src/easy_chat_1.c
+++ b/src/easy_chat_1.c
@@ -305,7 +305,7 @@ void sub_80E62F8(void)
FreeAllSpritePalettes();
break;
case 1:
- SetUpWindowConfig(&gWindowTemplate_81E6DA8);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6DA8);
break;
case 2:
InitMenuWindow(&gWindowTemplate_81E6D54);
@@ -737,7 +737,7 @@ void sub_80E6BC0(void)
}
break;
case 1:
- switch (ProcessMenuInputNoWrap_())
+ switch (Menu_ProcessInputNoWrap_())
{
case 0:
sub_80E7D6C();
@@ -785,7 +785,7 @@ void sub_80E6C84(void)
gEasyChatStruct->unk24++;
break;
case 1:
- switch (ProcessMenuInputNoWrap_())
+ switch (Menu_ProcessInputNoWrap_())
{
case 0:
sub_80E91D4(4);
@@ -800,7 +800,7 @@ void sub_80E6C84(void)
}
break;
case 2:
- switch (ProcessMenuInputNoWrap_())
+ switch (Menu_ProcessInputNoWrap_())
{
case 0:
gSpecialVar_Result = 0;
@@ -813,7 +813,7 @@ void sub_80E6C84(void)
}
break;
case 0xFF:
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
sub_80E81FC();
sub_80E682C(sub_80E6AC4);
break;
@@ -861,7 +861,7 @@ void sub_80E6D7C(void)
}
break;
case 1:
- switch (ProcessMenuInputNoWrap_())
+ switch (Menu_ProcessInputNoWrap_())
{
case 0:
gSpecialVar_Result = (sub_80E7FA8() != 0);
@@ -883,7 +883,7 @@ void sub_80E6D7C(void)
break;
case -1:
case 1:
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
sub_80E81FC();
if (gEasyChatStruct->unk8 == 6 && sub_80E7FA8() != 0)
{
diff --git a/src/engine/clear_save_data_menu.c b/src/engine/clear_save_data_menu.c
index 6a597690a..08fd5cd18 100644
--- a/src/engine/clear_save_data_menu.c
+++ b/src/engine/clear_save_data_menu.c
@@ -45,7 +45,7 @@ static void Task_InitMenu(u8 taskId)
Menu_PrintText(gSystemText_ClearAllSaveDataPrompt, 3, 15);
Menu_DrawStdWindowFrame(2, 1, 8, 6);
- PrintMenuItems(3, 2, 2, gMenuYesNoItems);
+ Menu_PrintItems(3, 2, 2, gMenuYesNoItems);
InitMenu(0, 3, 2, 2, 1, 5);
gTasks[taskId].func = Task_ProcessMenuInput;
@@ -53,7 +53,7 @@ static void Task_InitMenu(u8 taskId)
static void Task_ProcessMenuInput(u8 taskId)
{
- switch (ProcessMenuInputNoWrap_())
+ switch (Menu_ProcessInputNoWrap_())
{
case 0:
PlaySE(SE_SELECT);
@@ -133,7 +133,7 @@ static u8 InitClearSaveDataScreen(void)
ResetTasks();
ResetSpriteData();
- SetUpWindowConfig(&gWindowTemplate_81E6C3C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C);
InitMenuWindow(&gWindowTemplate_81E6CE4);
BeginNormalPaletteFade(-1, 0, 0x10, 0, 0xffff);
diff --git a/src/engine/link.c b/src/engine/link.c
index d52d0bb7a..34016d607 100644
--- a/src/engine/link.c
+++ b/src/engine/link.c
@@ -238,7 +238,7 @@ void LinkTestScreen(void)
FreeAllSpritePalettes();
ResetTasks();
SetVBlankCallback(VBlankCB_LinkTest);
- SetUpWindowConfig(&gWindowTemplate_81E6CE4);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6CE4);
InitMenuWindow((struct WindowTemplate *)&gWindowTemplate_81E6CE4);
ResetBlockSend();
gLinkType = 0x1111;
@@ -1236,7 +1236,7 @@ void CB2_LinkError(void)
FillPalette(0, 0, 2);
ResetTasks();
SetVBlankCallback(VBlankCB_LinkTest);
- SetUpWindowConfig(&gWindowTemplate_81E7198);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E7198);
InitMenuWindow((struct WindowTemplate *)&gWindowTemplate_81E7198);
Menu_EraseScreen();
REG_BLDALPHA = 0;
@@ -1260,7 +1260,7 @@ static void CB2_PrintErrorMessage(void)
switch (gMain.state)
{
case 0:
- MenuPrint_PixelCoords(gMultiText_LinkError, 20, 56, 1);
+ Menu_PrintTextPixelCoords(gMultiText_LinkError, 20, 56, 1);
break;
case 30:
case 60:
diff --git a/src/engine/main_menu.c b/src/engine/main_menu.c
index 723886664..715570fe0 100644
--- a/src/engine/main_menu.c
+++ b/src/engine/main_menu.c
@@ -24,7 +24,7 @@
#include "unknown_task.h"
#include "ewram.h"
-#define BirchSpeechUpdateWindowText() ((u8)MenuUpdateWindowText_OverrideLineLength(24))
+#define BirchSpeechUpdateWindowText() ((u8)Menu_UpdateWindowTextOverrideLineLength(24))
extern struct PaletteFadeControl gPaletteFade;
@@ -233,7 +233,7 @@ u32 InitMainMenu(u8 a1)
ResetTasks();
ResetSpriteData();
FreeAllSpritePalettes();
- SetUpWindowConfig(&gWindowTemplate_81E6C3C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C);
InitMenuWindow((struct WindowTemplate *)&gWindowTemplate_81E6CE4);
if (a1)
@@ -709,7 +709,7 @@ void PrintPlayTime(void)
sub_8072C74(alignedPlayTime, playTime, 48, 1);
Menu_PrintText(alignedPlayTime, 22, 3);
#elif defined(GERMAN)
- MenuPrint_PixelCoords(gMainMenuString_Time, 124, 24, TRUE);
+ Menu_PrintTextPixelCoords(gMainMenuString_Time, 124, 24, TRUE);
FormatPlayTime(playTime, gSaveBlock2.playTimeHours, gSaveBlock2.playTimeMinutes, 1);
sub_8072C74(alignedPlayTime, playTime, 40, 1);
Menu_PrintText(alignedPlayTime, 23, 3);
@@ -732,10 +732,10 @@ void PrintBadgeCount(void)
#if defined(ENGLISH)
Menu_PrintText(gMainMenuString_Badges, 16, 5);
#elif defined(GERMAN)
- MenuPrint_PixelCoords(gMainMenuString_Badges, 124, 40, TRUE);
+ Menu_PrintTextPixelCoords(gMainMenuString_Badges, 124, 40, TRUE);
#endif
ConvertIntToDecimalString(buffer, GetBadgeCount());
- MenuPrint_PixelCoords(buffer, 205, 40, 1);
+ Menu_PrintTextPixelCoords(buffer, 205, 40, 1);
}
#define tTrainerSpriteId data[2]
@@ -750,7 +750,7 @@ void PrintBadgeCount(void)
static void Task_NewGameSpeech1(u8 taskId)
{
- SetUpWindowConfig(&gWindowTemplate_81E6C3C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C);
InitMenuWindow((struct WindowTemplate *)&gWindowTemplate_81E6CE4);
REG_WIN0H = 0;
REG_WIN0V = 0;
@@ -857,7 +857,7 @@ static void Task_NewGameSpeech7(u8 taskId)
//Go on to next sentence after frame 95
if (gTasks[taskId].tFrameCounter > 95)
{
- MenuSetText(gSystemText_NewPara);
+ Menu_SetText(gSystemText_NewPara);
gTasks[taskId].func = Task_NewGameSpeech8;
}
}
@@ -985,14 +985,14 @@ static void Task_NewGameSpeech16(u8 taskId)
switch (GenderMenuProcessInput())
{
case MALE:
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
PlaySE(SE_SELECT);
gSaveBlock2.playerGender = MALE;
Menu_EraseWindowRect(2, 4, 8, 9);
gTasks[taskId].func = Task_NewGameSpeech19;
break;
case FEMALE:
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
PlaySE(SE_SELECT);
gSaveBlock2.playerGender = FEMALE;
Menu_EraseWindowRect(2, 4, 8, 9);
@@ -1088,7 +1088,7 @@ static void Task_NewGameSpeech21(u8 taskId)
case 2:
case 3:
case 4:
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
PlaySE(SE_SELECT);
Menu_EraseWindowRect(2, 1, 22, 12);
SetPresetPlayerName(selection);
@@ -1100,7 +1100,7 @@ static void Task_NewGameSpeech21(u8 taskId)
gTasks[taskId].func = Task_NewGameSpeech22;
break;
case -1: //B button
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
PlaySE(SE_SELECT);
Menu_EraseWindowRect(2, 1, 22, 12);
gTasks[taskId].func = Task_NewGameSpeech14; //Go back to gender menu
@@ -1139,7 +1139,7 @@ static void Task_NewGameSpeech24(u8 taskId)
//Handle yes/no menu selection
static void Task_NewGameSpeech25(u8 taskId)
{
- switch (ProcessMenuInputNoWrap_())
+ switch (Menu_ProcessInputNoWrap_())
{
case 0: //YES
PlaySE(SE_SELECT);
@@ -1373,7 +1373,7 @@ void CB_ContinueNewGameSpeechPart2()
FreeAllSpritePalettes();
AddBirchSpeechObjects(taskId);
- SetUpWindowConfig(&gWindowTemplate_81E6C3C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C);
InitMenuWindow((struct WindowTemplate *)&gWindowTemplate_81E6CE4);
if (gSaveBlock2.playerGender != MALE)
@@ -1664,7 +1664,7 @@ static void CreateGenderMenu(u8 left, u8 top)
Menu_DrawStdWindowFrame(left, top, left + 6, top + 5);
menuLeft = left + 1;
menuTop = top + 1;
- PrintMenuItems(menuLeft, menuTop, 2, gUnknown_081E79B0);
+ Menu_PrintItems(menuLeft, menuTop, 2, gUnknown_081E79B0);
InitMenu(0, menuLeft, menuTop, 2, 0, 5);
}
@@ -1678,9 +1678,9 @@ static void CreateNameMenu(u8 left, u8 top)
Menu_DrawStdWindowFrame(left, top, left + 10, top + 11);
if (gSaveBlock2.playerGender == MALE)
- PrintMenuItems(left + 1, top + 1, 5, gMalePresetNames);
+ Menu_PrintItems(left + 1, top + 1, 5, gMalePresetNames);
else
- PrintMenuItems(left + 1, top + 1, 5, gFemalePresetNames);
+ Menu_PrintItems(left + 1, top + 1, 5, gFemalePresetNames);
InitMenu(0, left + 1, top + 1, 5, 0, 9);
}
diff --git a/src/engine/menu.c b/src/engine/menu.c
index fe88bf4e4..86e20d0eb 100644
--- a/src/engine/menu.c
+++ b/src/engine/menu.c
@@ -26,11 +26,12 @@ struct Menu
static void MultistepInitMenuWindowInternal(const struct WindowTemplate *, u16);
static void InitMenuWindowInternal(const struct WindowTemplate *, u16);
-static bool8 sub_80723D4(void);
+static bool8 IsGridCursorMovementClamped(void);
static u8 sub_8072484(u8, u8, u8, u8, u8, u8, u32);
static u8 sub_80724F4(u8, u8, u8, const struct MenuAction[], u8);
static void sub_8072620(u8, u8, u8, const struct MenuAction[], u8);
static void sub_8072D18(u8, u8);
+static void RedrawMenuCursor(u8, u8);
static struct Menu gMenu;
@@ -55,7 +56,7 @@ void CloseMenu(void)
Menu_EraseScreen();
sub_8064E2C();
ScriptContext2_Disable();
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
}
void AppendToList(u8 *list, u8 *pindex, u32 value)
@@ -149,6 +150,7 @@ void BasicInitMenuWindow(const struct WindowTemplate *winTemplate)
gMenuWindowPtr->tileDataStartOffset = gMenuTextTileOffset;
}
+// Prints
void Menu_PrintText(const u8 *str, u8 left, u8 top)
{
Text_InitWindowAndPrintText(gMenuWindowPtr, str, gMenuTextTileOffset, left, top);
@@ -156,7 +158,7 @@ void Menu_PrintText(const u8 *str, u8 left, u8 top)
void Menu_EraseWindowRect(u8 left, u8 top, u8 right, u8 bottom)
{
- ZeroFillWindowRect(gMenuWindowPtr, left, top, right, bottom);
+ Text_EraseWindowRect(gMenuWindowPtr, left, top, right, bottom);
}
void Menu_BlankWindowRect(u8 left, u8 top, u8 right, u8 bottom)
@@ -210,9 +212,9 @@ void MenuPrintMessageDefaultCoords(const u8 *str)
Text_InitWindow8002EB0(gMenuWindowPtr, str, gMenuTextTileOffset, 2, 15);
}
-void MenuSetText(const u8 *str)
+void Menu_SetText(const u8 *str)
{
- sub_8002E90(gMenuWindowPtr, str);
+ Text_SetWindowText(gMenuWindowPtr, str);
}
u8 Menu_UpdateWindowText(void)
@@ -271,14 +273,14 @@ s8 Menu_ProcessInput(void)
{
PlaySE(SE_SELECT);
if (gMenu.menu_field_7)
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
return gMenu.cursorPos;
}
if (gMain.newKeys & B_BUTTON)
{
if (gMenu.menu_field_7)
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
return -1;
}
@@ -306,14 +308,14 @@ s8 Menu_ProcessInputNoWrap(void)
{
PlaySE(SE_SELECT);
if (gMenu.menu_field_7)
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
return gMenu.cursorPos;
}
if (gMain.newKeys & B_BUTTON)
{
if (gMenu.menu_field_7)
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
return -1;
}
@@ -353,11 +355,12 @@ u8 MoveMenuCursor3(s8 delta)
return gMenu.cursorPos;
}
-u8 MoveMenuCursor4(s8 delta)
+static u8 MoveMenuCursorGridLayout(s8 delta)
{
+ // Don't move cursor if it is clamped
if (gMenu.cursorPos + delta <= gMenu.maxCursorPos)
{
- if (sub_80723D4() == TRUE)
+ if (IsGridCursorMovementClamped() == TRUE)
return gMenu.cursorPos;
}
else
@@ -379,22 +382,35 @@ u8 MoveMenuCursor4(s8 delta)
return gMenu.cursorPos;
}
-static bool8 sub_80723D4(void)
+// Returns TRUE if the cursor is on an edge and cannot move in the pressed direction
+static bool8 IsGridCursorMovementClamped(void)
{
- if ((gMain.newKeys & DPAD_UP) && gMenu.cursorPos < gMenu.width)
- return TRUE;
-
- if ((gMain.newKeys & DPAD_DOWN) && gMenu.cursorPos >= (gMenu.maxCursorPos + 1) - gMenu.width)
- return TRUE;
-
- if ((gMain.newKeys & DPAD_LEFT)
- && ((gMenu.cursorPos - (gMenu.cursorPos % gMenu.width)) % gMenu.width == 1 // always false
- || gMenu.cursorPos == 0
- || gMenu.cursorPos % gMenu.width == 0))
- return TRUE;
-
- if ((gMain.newKeys & DPAD_RIGHT) && gMenu.cursorPos % gMenu.width == gMenu.width - 1)
- return TRUE;
+ if (gMain.newKeys & DPAD_UP)
+ {
+ // is cursor on first row?
+ if (gMenu.cursorPos < gMenu.width)
+ return TRUE;
+ }
+ if (gMain.newKeys & DPAD_DOWN)
+ {
+ // is cursor on last row?
+ if (gMenu.cursorPos >= gMenu.maxCursorPos + 1 - gMenu.width)
+ return TRUE;
+ }
+ if (gMain.newKeys & DPAD_LEFT)
+ {
+ // is cursor on first column?
+ if ((gMenu.cursorPos - gMenu.cursorPos % gMenu.width) % gMenu.width == 1 // always false
+ || gMenu.cursorPos == 0 // redundant
+ || gMenu.cursorPos % gMenu.width == 0)
+ return TRUE;
+ }
+ if (gMain.newKeys & DPAD_RIGHT)
+ {
+ // is cursor on last column?
+ if (gMenu.cursorPos % gMenu.width == gMenu.width - 1)
+ return TRUE;
+ }
return FALSE;
}
@@ -518,7 +534,7 @@ s8 Menu_ProcessInputGridLayout(void)
if (gMain.newKeys & A_BUTTON)
{
if (gMenu.menu_field_7)
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
PlaySE(SE_SELECT);
return Menu_GetCursorPos();
}
@@ -526,44 +542,46 @@ s8 Menu_ProcessInputGridLayout(void)
if (gMain.newKeys & B_BUTTON)
{
if (gMenu.menu_field_7)
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
return -1;
}
if (gMain.newKeys & DPAD_UP)
{
PlaySE(SE_SELECT);
- MoveMenuCursor4(-gMenu.width);
+ // Move up one whole row
+ MoveMenuCursorGridLayout(-gMenu.width);
return -2;
}
else if (gMain.newKeys & DPAD_DOWN)
{
PlaySE(SE_SELECT);
- MoveMenuCursor4(gMenu.width);
+ // Move down one whole column
+ MoveMenuCursorGridLayout(gMenu.width);
return -2;
}
else if (gMain.newKeys & DPAD_LEFT)
{
PlaySE(SE_SELECT);
- MoveMenuCursor4(-1);
+ MoveMenuCursorGridLayout(-1);
return -2;
}
else if (gMain.newKeys & DPAD_RIGHT)
{
PlaySE(SE_SELECT);
- MoveMenuCursor4(1);
+ MoveMenuCursorGridLayout(1);
return -2;
}
return -2;
}
-u8 sub_807288C(u8 column)
+u8 Menu_GetColumnXCoord(u8 column)
{
return gMenu.columnXCoords[column];
}
-void PrintMenuItems(u8 left, u8 top, u8 menuItemCount, const struct MenuAction menuItems[])
+void Menu_PrintItems(u8 left, u8 top, u8 menuItemCount, const struct MenuAction menuItems[])
{
u8 i;
@@ -571,7 +589,7 @@ void PrintMenuItems(u8 left, u8 top, u8 menuItemCount, const struct MenuAction m
Menu_PrintText(menuItems[i].text, left, top + 2 * i);
}
-void PrintMenuItemsReordered(u8 left, u8 top, u8 menuItemCount, const struct MenuAction2 menuItems[], const u8 *order)
+void Menu_PrintItemsReordered(u8 left, u8 top, u8 menuItemCount, const struct MenuAction2 menuItems[], const u8 *order)
{
u8 i;
@@ -581,7 +599,7 @@ void PrintMenuItemsReordered(u8 left, u8 top, u8 menuItemCount, const struct Men
void InitYesNoMenu(u8 left, u8 top, u8 a3)
{
- PrintMenuItems(left + 1, top + 1, 2, gMenuYesNoItems);
+ Menu_PrintItems(left + 1, top + 1, 2, gMenuYesNoItems);
InitMenu(0, left + 1, top + 1, 2, 0, a3);
}
@@ -592,14 +610,14 @@ void DisplayYesNoMenu(u8 left, u8 top, u32 a3)
gMenu.menu_field_7 = a3 ? -1 : 0;
}
-s8 ProcessMenuInputNoWrap_(void)
+s8 Menu_ProcessInputNoWrap_(void)
{
return Menu_ProcessInputNoWrap();
}
-u8 MenuPrint_PixelCoords(const u8 *text, u8 left, u16 top, u8 a4)
+u8 Menu_PrintTextPixelCoords(const u8 *text, u8 left, u16 top, u8 a4)
{
- return sub_8004D04(gMenuWindowPtr, text, gMenuTextTileOffset, left, top, a4);
+ return Text_InitWindow8004D04(gMenuWindowPtr, text, gMenuTextTileOffset, left, top, a4);
}
u8 sub_8072A18(const u8 *text, u8 left, u16 top, u8 width, u32 a5)
@@ -712,7 +730,7 @@ _08072B3E:\n\
void MenuPrint_RightAligned(const u8 *str, u8 left, u8 top)
{
- sub_8004D38(gMenuWindowPtr, str, gMenuTextTileOffset, left, top);
+ Text_InitWindow8004D38(gMenuWindowPtr, str, gMenuTextTileOffset, left, top);
}
void sub_8072B80(const u8 *a1, u8 a2, u8 a3, const u8 *a4)
@@ -725,7 +743,7 @@ void sub_8072B80(const u8 *a1, u8 a2, u8 a3, const u8 *a4)
void sub_8072BD8(const u8 *a1, u8 a2, u8 a3, u16 a4)
{
- sub_8004DB0(gMenuWindowPtr, a1, gMenuTextTileOffset, a2, a3, a4);
+ Text_InitWindow8004DB0(gMenuWindowPtr, a1, gMenuTextTileOffset, a2, a3, a4);
}
u8 *sub_8072C14(u8 *a1, s32 a2, u8 a3, u8 a4)
@@ -748,9 +766,9 @@ u8 sub_8072CA4(const u8 *str)
return GetStringWidth(gMenuWindowPtr, str);
}
-u8 sub_8072CBC()
+u8 Menu_GetTextWindowPaletteNum(void)
{
- return sub_8004E24(gMenuWindowPtr);
+ return Text_GetWindowPaletteNum(gMenuWindowPtr);
}
void Menu_GetTextColors(u8 *a1, u8 *a2, u8 *a3)
@@ -758,7 +776,7 @@ void Menu_GetTextColors(u8 *a1, u8 *a2, u8 *a3)
Text_GetTextColors(gMenuWindowPtr, a1, a2, a3);
}
-u32 MenuUpdateWindowText_OverrideLineLength(u8 lineLength)
+u32 Menu_UpdateWindowTextOverrideLineLength(u8 lineLength)
{
return Text_UpdateWindowOverrideLineLength(gMenuWindowPtr, lineLength);
}
@@ -770,7 +788,7 @@ struct Window *unref_sub_8072D0C(void)
static void sub_8072D18(u8 a1, u8 a2)
{
- sub_814A5C0(a1, 0xFFFF, 12, 11679, 8 * a2);
+ MenuCursor_Create814A5C0(a1, 0xFFFF, 12, 11679, 8 * a2);
}
u8 InitMenu(u8 cursorSubpriority, u8 left, u8 top, u8 numChoices, u8 cursorPos, u8 cursorWidth)
@@ -797,9 +815,9 @@ u8 InitMenu(u8 cursorSubpriority, u8 left, u8 top, u8 numChoices, u8 cursorPos,
return pos;
}
-void RedrawMenuCursor(u8 a1, u8 a2)
+static void RedrawMenuCursor(u8 x, u8 y)
{
- sub_814A880((a1 + 1) * 8, 8 * a2);
+ MenuCursor_SetPos814A880((x + 1) * 8, 8 * y);
}
void unref_sub_8072DC0()
@@ -817,7 +835,7 @@ void sub_8072DDC(u8 a1)
sub_8072DCC(8 * a1);
}
-void HandleDestroyMenuCursors(void)
+void Menu_DestroyCursor(void)
{
DestroyMenuCursor();
}
diff --git a/src/engine/menu_cursor.c b/src/engine/menu_cursor.c
index 960d3cc87..35116d40b 100644
--- a/src/engine/menu_cursor.c
+++ b/src/engine/menu_cursor.c
@@ -3,13 +3,13 @@
#include "palette.h"
#include "sprite.h"
-EWRAM_DATA u16 gUnknown_0203A360[0x10] = {};
-EWRAM_DATA struct Subsprite gMenuCursorSubsprites[10] = {0};
-EWRAM_DATA u8 gUnknown_0203A3D0 = 0;
-EWRAM_DATA u8 gUnknown_0203A3D1 = 0;
-EWRAM_DATA u8 gUnknown_0203A3D2 = 0;
-EWRAM_DATA u8 gUnknown_0203A3D3 = 0;
-EWRAM_DATA u8 gUnknown_0203A3D4 = 0;
+EWRAM_DATA static u16 gUnknown_0203A360[0x10] = {};
+EWRAM_DATA static struct Subsprite gMenuCursorSubsprites[10] = {0};
+EWRAM_DATA static u8 gUnknown_0203A3D0 = 0;
+EWRAM_DATA static u8 gUnknown_0203A3D1 = 0;
+EWRAM_DATA static u8 gUnknown_0203A3D2 = 0;
+EWRAM_DATA static u8 gUnknown_0203A3D3 = 0;
+EWRAM_DATA static u8 gUnknown_0203A3D4 = 0;
#if ENGLISH
#include "../src/data/menu_cursor_en.h"
@@ -26,7 +26,7 @@ void sub_814A590(void)
gUnknown_0203A3D4 = 0;
}
-u8 sub_814A5C0(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5)
+u8 MenuCursor_Create814A5C0(u8 subpriority, u16 paletteTag, u8 a3, u16 a4, u8 a5)
{
int v9;
struct Sprite *v10;
@@ -35,34 +35,34 @@ u8 sub_814A5C0(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5)
DestroyMenuCursor();
v9 = 1;
- if (a2 == 0xFFFF)
+ if (paletteTag == 0xFFFF)
{
gUnknown_0203A360[a3 & 0xF] = a4;
if (LoadSpritePalette(&gUnknown_0842F240) != 0xFF)
{
- a2 = 0xFFF0;
+ paletteTag = 0xFFF0;
v9 = 0;
}
}
LoadSpriteSheetDeferred(&gUnknown_0842F140[a3 & 0xF]);
- gUnknown_0203A3D0 = CreateSprite(&gSpriteTemplate_842F250[v9], 0, 0xA0, a1);
- gUnknown_0203A3D1 = CreateSprite(&gSpriteTemplate_842F250[2], 0, 0xA0, a1);
+ gUnknown_0203A3D0 = CreateSprite(&gSpriteTemplate_842F250[v9], 0, 160, subpriority);
+ gUnknown_0203A3D1 = CreateSprite(&gSpriteTemplate_842F250[2], 0, 160, subpriority);
if (gUnknown_0203A3D0 != 0x40)
{
v10 = &gSprites[gUnknown_0203A3D0];
- if (a2 == 0xFFFF)
+ if (paletteTag == 0xFFFF)
v10->oam.paletteNum = 0;
else
- v10->oam.paletteNum = IndexOfSpritePaletteTag(a2);
+ v10->oam.paletteNum = IndexOfSpritePaletteTag(paletteTag);
}
if (gUnknown_0203A3D1 != 0x40)
{
v10 = &gSprites[gUnknown_0203A3D1];
- if (a2 == 0xFFFF)
+ if (paletteTag == 0xFFFF)
v10->oam.paletteNum = 0;
else
- v10->oam.paletteNum = IndexOfSpritePaletteTag(a2);
+ v10->oam.paletteNum = IndexOfSpritePaletteTag(paletteTag);
if (!(REG_DISPCNT & (DISPCNT_WIN0_ON | DISPCNT_WIN1_ON)))
*(u8 *)(REG_ADDR_WINOUT) |= 0x1F;
@@ -75,12 +75,13 @@ u8 sub_814A5C0(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5)
return gUnknown_0203A3D0;
}
-u8 sub_814A758(u8 a1, u8 a2, u8 a3, u8 a4)
+// unused
+u8 sub_814A758(u8 subpriority, u8 a2, u8 a3, u8 a4)
{
u8 result;
struct Sprite *spr;
- result = sub_814A5C0(a1, 0, a3, 0, a4);
+ result = MenuCursor_Create814A5C0(subpriority, 0, a3, 0, a4);
if (result != 0x40)
{
spr = &gSprites[gUnknown_0203A3D0];
@@ -128,7 +129,7 @@ void DestroyMenuCursor(void)
return;
}
-void sub_814A880(u8 a1, u8 a2)
+void MenuCursor_SetPos814A880(u8 a1, u8 a2)
{
struct Sprite *spr;
@@ -685,49 +686,48 @@ void unref_sub_814ABE4(int a1)
return;
}
-u8 CreateBlendedOutlineCursor(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5)
+u8 CreateBlendedOutlineCursor(u8 subpriority, u16 paletteTag, u8 a3, u16 a4, u8 a5)
{
int v8;
struct Sprite *spr;
- u8 var1 = gUnknown_0203A3D2;
- if (var1 != 0x40)
- sub_814AD44();
+ if (gUnknown_0203A3D2 != 0x40)
+ MenuCursor_Destroy814AD44();
v8 = 1;
- if (a2 == 0xFFFF)
+ if (paletteTag == 0xFFFF)
{
gUnknown_0203A360[a3 & 0xF] = a4;
if (LoadSpritePalette(&gUnknown_0842F248) != 0xFF )
{
- a2 = 0xFFF1;
+ paletteTag = 0xFFF1;
v8 = 0;
}
}
LoadSpriteSheetDeferred(&gUnknown_0842F1C0[a3 & 0xF]);
#if ENGLISH
- gUnknown_0203A3D2 = CreateSprite(&gSpriteTemplate_842F298[v8], 0, 160, a1);
+ gUnknown_0203A3D2 = CreateSprite(&gSpriteTemplate_842F298[v8], 0, 160, subpriority);
#elif GERMAN
- gUnknown_0203A3D2 = CreateSprite(&gSpriteTemplate_842F298[v8], 0, 161, a1);
+ gUnknown_0203A3D2 = CreateSprite(&gSpriteTemplate_842F298[v8], 0, 161, subpriority);
#endif
if (gUnknown_0203A3D2 != 0x40)
{
spr = &gSprites[gUnknown_0203A3D2];
- if (a2 == 0xFFFF)
+ if (paletteTag == 0xFFFF)
spr->oam.paletteNum = 0;
else
- spr->oam.paletteNum = IndexOfSpritePaletteTag(a2);
+ spr->oam.paletteNum = IndexOfSpritePaletteTag(paletteTag);
}
sub_814ADF4(a5);
return gUnknown_0203A3D2;
}
-void sub_814AD44(void)
+void MenuCursor_Destroy814AD44(void)
{
if (gUnknown_0203A3D2 != 0x40)
{
@@ -738,7 +738,7 @@ void sub_814AD44(void)
return;
}
-void sub_814AD7C(u8 a1, u8 a2)
+void MenuCursor_SetPos814AD7C(u8 a1, u8 a2)
{
struct Sprite *spr;
if (gUnknown_0203A3D2 != 0x40)
diff --git a/src/engine/mystery_event_menu.c b/src/engine/mystery_event_menu.c
index 278760233..b7b7c047e 100644
--- a/src/engine/mystery_event_menu.c
+++ b/src/engine/mystery_event_menu.c
@@ -45,7 +45,7 @@ void CB2_InitMysteryEventMenu(void)
FreeAllSpritePalettes();
ResetTasks();
SetVBlankCallback(VBlankCB);
- SetUpWindowConfig(&gWindowTemplate_81E6CE4);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6CE4);
InitMenuWindow(&gWindowTemplate_81E6CE4);
Menu_EraseScreen();
REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON;
diff --git a/src/engine/name_string_util.c b/src/engine/name_string_util.c
index f1a935453..32e9358e1 100644
--- a/src/engine/name_string_util.c
+++ b/src/engine/name_string_util.c
@@ -7,7 +7,7 @@ void PadNameString(u8 *a1, u8 a2)
{
u8 i;
- StripExtCtrlCodes(a1);
+ Text_StripExtCtrlCodes(a1);
i = StringLength(a1);
if (a2 == 0xFC)
@@ -36,5 +36,5 @@ void SanitizeNameString(u8 *a1)
if (StringLength(a1) < 6)
ConvertInternationalString(a1, 1);
else
- StripExtCtrlCodes(a1);
+ Text_StripExtCtrlCodes(a1);
}
diff --git a/src/engine/naming_screen.c b/src/engine/naming_screen.c
index 880187dc0..eddfdeda5 100644
--- a/src/engine/naming_screen.c
+++ b/src/engine/naming_screen.c
@@ -325,7 +325,7 @@ static void NamingScreen_Init(void)
static void NamingScreen_SetUpWindow(void)
{
- SetUpWindowConfig(&gWindowTemplate_81E6E88);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6E88);
InitMenuWindow(&gWindowTemplate_81E6E88);
}
diff --git a/src/engine/option_menu.c b/src/engine/option_menu.c
index 2b9412e45..868830880 100644
--- a/src/engine/option_menu.c
+++ b/src/engine/option_menu.c
@@ -116,7 +116,7 @@ void CB2_InitOptionMenu(void)
gMain.state++;
break;
case 2:
- SetUpWindowConfig(&gWindowTemplate_81E71B4);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E71B4);
gMain.state++;
break;
case 3:
@@ -313,7 +313,7 @@ static void DrawOptionMenuChoice(const u8 *text, u8 x, u8 y, u8 style)
dst[2] = style;
dst[i] = EOS;
- MenuPrint_PixelCoords(dst, x, y, 1);
+ Menu_PrintTextPixelCoords(dst, x, y, 1);
}
static u8 TextSpeed_ProcessInput(u8 selection)
diff --git a/src/engine/reset_rtc_screen.c b/src/engine/reset_rtc_screen.c
index 37b1c767e..6e9efd342 100644
--- a/src/engine/reset_rtc_screen.c
+++ b/src/engine/reset_rtc_screen.c
@@ -443,7 +443,7 @@ void CB2_InitResetRtcScreen(void)
ResetSpriteData();
ResetTasks();
ResetPaletteFade();
- SetUpWindowConfig(&gWindowTemplate_81E6CE4);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6CE4);
InitMenuWindow(&gWindowTemplate_81E6CE4);
REG_DISPCNT = 4352;
SetVBlankCallback(VBlankCB_ResetRtcScreen);
diff --git a/src/engine/save_failed_screen.c b/src/engine/save_failed_screen.c
index 4609f3fd8..64b84a2f7 100644
--- a/src/engine/save_failed_screen.c
+++ b/src/engine/save_failed_screen.c
@@ -120,7 +120,7 @@ static void CB2_SaveFailedScreen(void)
ResetPaletteFade();
LoadPalette(&gBirchBagGrassPal, 0, sizeof(gBirchBagGrassPal));
LoadPalette(&gSaveFailedClockPal, 0x100, sizeof(gSaveFailedClockPal));
- SetUpWindowConfig(&gWindowTemplate_81E6C3C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C);
InitMenuWindow(&gWindowTemplate_81E6CE4);
Menu_DrawStdWindowFrame(13, CLOCK_WIN_TOP, 16, CLOCK_WIN_TOP + 3); // clock window
Menu_DrawStdWindowFrame(1, MSG_WIN_TOP, 28, 19); // message window
diff --git a/src/engine/text.c b/src/engine/text.c
index 15a535ff0..fe18a6d79 100644
--- a/src/engine/text.c
+++ b/src/engine/text.c
@@ -97,7 +97,7 @@ static void AddToCursorX(struct Window *, u8);
static void AddToCursorY(struct Window *, u8);
static void ClipLeft(struct Window *);
static void ClipRight(struct Window *);
-static void InitColors(struct Window *);
+static void SetWindowDefaultColors(struct Window *);
static void SetWindowBackgroundColor(struct Window *, u8);
static void SetWindowShadowColor(struct Window *, u8);
static void SetWindowForegroundColor(struct Window *, u8);
@@ -786,7 +786,7 @@ const struct WindowTemplate gWindowTemplate_81E6DA8 =
BG_SCREEN_ADDR(11), // tilemap
};
-const struct WindowTemplate WindowConfig_TrainerCard_Back_Values =
+const struct WindowTemplate gWindowTemplate_TrainerCard_Back_Values =
{
0, // BG number
2, // BG character base block
@@ -807,7 +807,7 @@ const struct WindowTemplate WindowConfig_TrainerCard_Back_Values =
BG_SCREEN_ADDR(30), // tilemap
};
-const struct WindowTemplate WindowConfig_TrainerCard_Back_Labels =
+const struct WindowTemplate gWindowTemplate_TrainerCard_Back_Labels =
{
0, // BG number
2, // BG character base block
@@ -1752,7 +1752,7 @@ void LoadFontDefaultPalette(const struct WindowTemplate *winTemplate)
LoadPalette(gFontDefaultPalette, 16 * winTemplate->paletteNum, 32);
}
-void SetUpWindowConfig(const struct WindowTemplate *winTemplate)
+void Text_LoadWindowTemplate(const struct WindowTemplate *winTemplate)
{
UpdateBGRegs(winTemplate);
ClearBGMem(winTemplate);
@@ -1952,7 +1952,7 @@ void Text_InitWindowWithTemplate(struct Window *win, const struct WindowTemplate
win->height = winTemplate->height;
win->tileData = winTemplate->tileData;
win->tilemap = winTemplate->tilemap;
- InitColors(win);
+ SetWindowDefaultColors(win);
SetWindowBackgroundColor(win, winTemplate->backgroundColor);
SetWindowShadowColor(win, winTemplate->shadowColor);
SetWindowForegroundColor(win, winTemplate->foregroundColor);
@@ -1986,7 +1986,7 @@ void Text_InitWindow(struct Window *win, const u8 *text, u16 tileDataStartOffset
win->downArrowCounter = 0;
win->tileData = winTemplate->tileData;
win->tilemap = winTemplate->tilemap;
- InitColors(win);
+ SetWindowDefaultColors(win);
SetWindowBackgroundColor(win, winTemplate->backgroundColor);
SetWindowShadowColor(win, winTemplate->shadowColor);
SetWindowForegroundColor(win, winTemplate->foregroundColor);
@@ -2007,7 +2007,7 @@ void Text_InitWindow8002E4C(struct Window *win, const u8 *text, u16 tileDataStar
ClipLeft(win);
}
-void sub_8002E90(struct Window *win, const u8 *text)
+void Text_SetWindowText(struct Window *win, const u8 *text)
{
win->state = WIN_STATE_NORMAL;
win->text = text;
@@ -2364,7 +2364,7 @@ u8 sub_8003490(struct Window *win, u8 c, u16 tileDataStartOffset, u8 left, u8 to
void sub_80034D4(u8 *tileData, const u8 *text)
{
- sub_8004E3C(&gWindowTemplate_81E6C74, tileData, text);
+ Text_InitWindow8004E3C(&gWindowTemplate_81E6C74, tileData, text);
}
u8 sub_80034EC(u8 *str)
@@ -2905,7 +2905,7 @@ static void ClipRight(struct Window *win)
}
}
-static void InitColors(struct Window *win)
+static void SetWindowDefaultColors(struct Window *win)
{
u32 i;
@@ -3334,7 +3334,7 @@ void DrawWindowRect_DefaultPalette(struct Window *win, u16 tileNum, u8 left, u8
}
// Fills the whole window area with tilemapEntry
-void FillWindowRect(struct Window *win, u16 tilemapEntry, u8 left, u8 top, u8 right, u8 bottom)
+void Text_FillWindowRect(struct Window *win, u16 tilemapEntry, u8 left, u8 top, u8 right, u8 bottom)
{
u16 *buffer = &win->tilemap[top * 32];
while (top++ <= bottom)
@@ -3346,20 +3346,20 @@ void FillWindowRect(struct Window *win, u16 tilemapEntry, u8 left, u8 top, u8 ri
}
}
-void FillWindowRect_DefaultPalette(struct Window *win, u16 tileNum, u8 left, u8 top, u8 right, u8 bottom)
+void Text_FillWindowRectDefPalette(struct Window *win, u16 tileNum, u8 left, u8 top, u8 right, u8 bottom)
{
- FillWindowRect(win, (win->paletteNum << 12) | tileNum, left, top, right, bottom);
+ Text_FillWindowRect(win, (win->paletteNum << 12) | tileNum, left, top, right, bottom);
}
-void ZeroFillWindowRect(struct Window *win, u8 left, u8 top, u8 right, u8 bottom)
+void Text_EraseWindowRect(struct Window *win, u8 left, u8 top, u8 right, u8 bottom)
{
- FillWindowRect_DefaultPalette(win, 0, left, top, right, bottom);
+ Text_FillWindowRectDefPalette(win, 0, left, top, right, bottom);
}
void Text_BlankWindowRect(struct Window *win, u8 left, u8 top, u8 right, u8 bottom)
{
u16 tileNum = GetBlankTileNum(win);
- FillWindowRect_DefaultPalette(win, tileNum, left, top, right, bottom);
+ Text_FillWindowRectDefPalette(win, tileNum, left, top, right, bottom);
}
static u16 GetBlankTileNum(struct Window *win)
@@ -3666,13 +3666,13 @@ u8 GetStringWidth(struct Window *win, const u8 *s)
return width;
}
-u8 sub_8004D04(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u16 top, u32 a6)
+u8 Text_InitWindow8004D04(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u16 top, u32 a6)
{
Text_InitWindow8002E4C(win, text, tileDataStartOffset, left, top, a6);
return Text_PrintWindow8002F44(win);
}
-u8 sub_8004D38(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top)
+u8 Text_InitWindow8004D38(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top)
{
u8 width = GetStringWidth(win, text);
Text_InitWindow(win, text, tileDataStartOffset, left - ((u32)(width + 7) >> 3), top);
@@ -3684,7 +3684,7 @@ u8 sub_8004D38(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 l
return Text_PrintWindow8002F44(win);
}
-u8 sub_8004DB0(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top, u16 a6)
+u8 Text_InitWindow8004DB0(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top, u16 a6)
{
register u32 val asm("r5") = (u8)((a6 >> 1) - (GetStringWidth(win, text) >> 1));
left += (val >> 3);
@@ -3694,7 +3694,7 @@ u8 sub_8004DB0(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 l
return Text_PrintWindow8002F44(win);
}
-u8 sub_8004E24(struct Window *win)
+u8 Text_GetWindowPaletteNum(struct Window *win)
{
return win->paletteNum;
}
@@ -3706,7 +3706,7 @@ void Text_GetTextColors(struct Window *win, u8 *foreground, u8 *background, u8 *
*shadow = win->shadowColor;
}
-void sub_8004E3C(const struct WindowTemplate *winTemplate, u8 *tileData, const u8 *text)
+void Text_InitWindow8004E3C(const struct WindowTemplate *winTemplate, u8 *tileData, const u8 *text)
{
sTempWindow.template = winTemplate;
Text_InitWindow(&sTempWindow, text, 0, 0, 0);
@@ -3727,11 +3727,11 @@ void ConvertInternationalString(u8 *s, u8 language)
{
u8 i;
- StripExtCtrlCodes(s);
+ Text_StripExtCtrlCodes(s);
i = StringLength(s);
- s[i++] = 0xFC;
+ s[i++] = EXT_CTRL_CODE_BEGIN;
s[i++] = 22;
- s[i++] = 0xFF;
+ s[i++] = EOS;
i--;
@@ -3741,18 +3741,18 @@ void ConvertInternationalString(u8 *s, u8 language)
i--;
}
- s[0] = 0xFC;
+ s[0] = EXT_CTRL_CODE_BEGIN;
s[1] = 21;
}
}
-void StripExtCtrlCodes(u8 *str)
+void Text_StripExtCtrlCodes(u8 *str)
{
u16 srcIndex = 0;
u16 destIndex = 0;
- while (str[srcIndex] != 0xFF)
+ while (str[srcIndex] != EOS)
{
- if (str[srcIndex] == 0xFC)
+ if (str[srcIndex] == EXT_CTRL_CODE_BEGIN)
{
srcIndex++;
srcIndex += GetExtCtrlCodeLength(str[srcIndex]);
@@ -3762,12 +3762,12 @@ void StripExtCtrlCodes(u8 *str)
str[destIndex++] = str[srcIndex++];
}
}
- str[destIndex] = 0xFF;
+ str[destIndex] = EOS;
}
static const u8 *SkipExtCtrlCode(const u8 *s)
{
- while (*s == 0xFC)
+ while (*s == EXT_CTRL_CODE_BEGIN)
{
s++;
s += GetExtCtrlCodeLength(*s);
diff --git a/src/engine/trade.c b/src/engine/trade.c
index 30e22b8d5..3a14adaca 100644
--- a/src/engine/trade.c
+++ b/src/engine/trade.c
@@ -1088,7 +1088,7 @@ static void sub_8047EC0(void)
sub_804A964(&gUnknown_03004824->unk_00c8, BG_SCREEN_ADDR(5));
SetVBlankCallback(sub_80489F4);
InitMenuWindow(&gWindowTemplate_81E6CE4);
- SetUpWindowConfig(&gWindowTemplate_81E6F84);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6F84);
Text_InitWindowWithTemplate(&gUnknown_03004824->window, &gWindowTemplate_81E6F84);
gUnknown_03004824->unk_007a = TextWindow_SetBaseTileNum(20);
TextWindow_LoadStdFrameGraphics(&gUnknown_03004824->window);
@@ -1157,7 +1157,7 @@ static void sub_8047EC0(void)
break;
case 6:
CalculateEnemyPartyCount();
- FillWindowRect_DefaultPalette(&gUnknown_03004824->window, 0, 0, 0, 29, 19);
+ Text_FillWindowRectDefPalette(&gUnknown_03004824->window, 0, 0, 0, 29, 19);
REG_DISPCNT = 0;
gUnknown_03004824->partyCounts[0] = gPlayerPartyCount;
gUnknown_03004824->partyCounts[1] = gEnemyPartyCount;
@@ -1268,7 +1268,7 @@ static void sub_80484F4(void)
sub_804A964(&gUnknown_03004824->unk_00c8, BG_SCREEN_ADDR(5));
SetVBlankCallback(sub_80489F4);
InitMenuWindow(&gWindowTemplate_81E6CE4);
- SetUpWindowConfig(&gWindowTemplate_81E6F84);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6F84);
Text_InitWindowWithTemplate(&gUnknown_03004824->window, &gWindowTemplate_81E6F84);
gUnknown_03004824->unk_007a = TextWindow_SetBaseTileNum(20);
TextWindow_LoadStdFrameGraphics(&gUnknown_03004824->window);
@@ -2097,7 +2097,7 @@ static void sub_8049680(void)
if (gUnknown_03004824->tradeMenuCursorPosition < PARTY_SIZE)
{
TextWindow_DrawStdFrame(&gUnknown_03004824->window, 18, 14, 28, 19);
- PrintMenuItems(19, 15, 2, (const struct MenuAction *)gUnknown_0820C320);
+ Menu_PrintItems(19, 15, 2, (const struct MenuAction *)gUnknown_0820C320);
InitMenu(0, 19, 15, 2, 0, 9);
gUnknown_03004824->unk_007b = 1;
}
@@ -2126,7 +2126,7 @@ static void sub_8049680(void)
static void sub_8049804(void)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
sub_804A80C();
gUnknown_03004824->unk_007b = 0;
gSprites[gUnknown_03004824->tradeMenuCursorSpriteIdx].invisible = FALSE;
@@ -2464,8 +2464,8 @@ static void sub_8049ED4(u8 a0)
StoreSpriteCallbackInData(&gSprites[gUnknown_03004824->partyIcons[whichParty][whichPokemon]], sub_809D62C);
gUnknown_03004824->unk_0080[a0] ++;
sub_8078A34(&gSprites[gUnknown_03004824->partyIcons[whichParty][whichPokemon]]);
- HandleDestroyMenuCursors();
- FillWindowRect_DefaultPalette(&gUnknown_03004824->window, 0, gUnknown_0820C330[whichParty][0], 0, gUnknown_0820C330[whichParty][1], 19);
+ Menu_DestroyCursor();
+ Text_FillWindowRectDefPalette(&gUnknown_03004824->window, 0, gUnknown_0820C330[whichParty][0], 0, gUnknown_0820C330[whichParty][1], 19);
sub_804A96C_alt(&gUnknown_03004824->unk_00c8, 15 * a0, 0, gTradePartyBoxTilemap, 15, 17, 0);
if (whichParty == 0)
{
@@ -2692,7 +2692,7 @@ static void sub_8049ED4(u8 a0)
"\tlsls r0, 2\n"
"\tadds r0, r7\n"
"\tbl sub_8078A34\n"
- "\tbl HandleDestroyMenuCursors\n"
+ "\tbl Menu_DestroyCursor\n"
"\tldr r3, _0804A09C @ =gUnknown_03004824\n"
"\tldr r0, [r3]\n"
"\tadds r0, 0x4\n"
@@ -2708,7 +2708,7 @@ static void sub_8049ED4(u8 a0)
"\tstr r1, [sp, 0x4]\n"
"\tmovs r1, 0\n"
"\tmovs r3, 0\n"
- "\tbl FillWindowRect_DefaultPalette\n"
+ "\tbl Text_FillWindowRectDefPalette\n"
"\tldr r1, _0804A09C @ =gUnknown_03004824\n"
"\tldr r0, [r1]\n"
"\tadds r0, 0xC8\n"
@@ -3337,7 +3337,7 @@ static void sub_804A740(u8 whichParty)
static void sub_804A80C(void)
{
- FillWindowRect_DefaultPalette(&gUnknown_03004824->window, 0, gUnknown_0820C330[1][0], 0, gUnknown_0820C330[1][1], 19);
+ Text_FillWindowRectDefPalette(&gUnknown_03004824->window, 0, gUnknown_0820C330[1][0], 0, gUnknown_0820C330[1][1], 19);
sub_804A41C(1);
}
@@ -3345,7 +3345,7 @@ static void sub_804A840(u8 whichParty)
{
if (whichParty == 0)
{
- FillWindowRect_DefaultPalette(&gUnknown_03004824->window, 0, gUnknown_0820C330[0][0], 0, gUnknown_0820C330[0][1], 19);
+ Text_FillWindowRectDefPalette(&gUnknown_03004824->window, 0, gUnknown_0820C330[0][0], 0, gUnknown_0820C330[0][1], 19);
sub_804A96C_alt(&gUnknown_03004824->unk_00c8, 0, 0, gTradePartyBoxTilemap, 15, 17, 0);
sub_804A6DC(0);
sub_804A41C(0);
@@ -3354,8 +3354,8 @@ static void sub_804A840(u8 whichParty)
}
else
{
- HandleDestroyMenuCursors();
- FillWindowRect_DefaultPalette(&gUnknown_03004824->window, 0, gUnknown_0820C330[1][0], 0, gUnknown_0820C330[1][1], 19);
+ Menu_DestroyCursor();
+ Text_FillWindowRectDefPalette(&gUnknown_03004824->window, 0, gUnknown_0820C330[1][0], 0, gUnknown_0820C330[1][1], 19);
sub_804A96C_alt(&gUnknown_03004824->unk_00c8, 15, 0, gTradePartyBoxTilemap, 15, 17, 0);
sub_804A6DC(1);
sub_804A41C(1);
@@ -3806,7 +3806,7 @@ static void sub_804AFB8(const struct WindowTemplate *windowConfig, u8 *dest, con
tileBuffer = gTileBuffer;
CpuFill16(0, tileBuffer, size * 0x80);
CpuFill16(0, tileBuffer + windowConfig->width * 0x20, size * 0x80);
- sub_8004E3C(windowConfig, tileBuffer, src);
+ Text_InitWindow8004E3C(windowConfig, tileBuffer, src);
for (i = 0; i < size; i ++)
{
CpuCopy16(&tileBuffer[32 * (i * 4)], &dest[32 * (i * 8)], 0x80);
@@ -4028,7 +4028,7 @@ static void sub_804B41C(void)
FreeAllSpritePalettes();
SetVBlankCallback(sub_804B210);
sub_804B228();
- SetUpWindowConfig(&gWindowTemplate_81E6F84);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6F84);
Text_InitWindowWithTemplate(&gUnknown_03004828->window, &gWindowTemplate_81E6F84);
gUnknown_03004828->textWindowBaseTileNum = TextWindow_SetBaseTileNum(2);
TextWindow_LoadStdFrameGraphics(&gUnknown_03004828->window);
@@ -4184,7 +4184,7 @@ static __attribute__((naked)) void sub_804B41C(void)
"\tbl sub_804B228\n"
"\tldr r4, _0804B57C @ =gWindowTemplate_81E6F84\n"
"\tadds r0, r4, 0\n"
- "\tbl SetUpWindowConfig\n"
+ "\tbl Text_LoadWindowTemplate\n"
"\tldr r0, [r6]\n"
"\tadds r0, 0x4\n"
"\tadds r1, r4, 0\n"
@@ -4531,7 +4531,7 @@ static void sub_804B790(void)
FreeAllSpritePalettes();
SetVBlankCallback(sub_804B210);
sub_804B228();
- SetUpWindowConfig(&gWindowTemplate_81E717C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E717C);
Text_InitWindowWithTemplate(&gUnknown_03004828->window, &gWindowTemplate_81E717C);
gUnknown_03004828->textWindowBaseTileNum = TextWindow_SetBaseTileNum(2);
TextWindow_LoadStdFrameGraphics(&gUnknown_03004828->window);
@@ -4852,7 +4852,7 @@ static bool8 sub_804C29C(void)
{
gUnknown_03004828->unk_0102 = sub_8047580(gUnknown_03004828->pokePicSpriteIdxs[0], gSprites[gUnknown_03004828->pokePicSpriteIdxs[0]].oam.paletteNum, 0x78, 0x20, 0x2, 0x1, 0x14, 0xfffff);
gUnknown_03004828->unk_00c4 ++;
- ZeroFillWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19);
+ Text_EraseWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19);
StringExpandPlaceholders(gStringVar4, gTradeText_ByeBye);
Text_InitWindowAndPrintText(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
}
@@ -5199,7 +5199,7 @@ static bool8 sub_804C29C(void)
break;
case 67:
REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | DISPCNT_BG1_ON | DISPCNT_BG2_ON | DISPCNT_OBJ_ON;
- ZeroFillWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19);
+ Text_EraseWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19);
StringExpandPlaceholders(gStringVar4, gTradeText_SentOverPoke);
Text_InitWindowAndPrintText(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
gUnknown_03004828->unk_00c4 ++;
@@ -5213,7 +5213,7 @@ static bool8 sub_804C29C(void)
if (gUnknown_03004828->unk_00c0 == 0xf0)
{
gUnknown_03004828->unk_00c4 ++;
- ZeroFillWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19);
+ Text_EraseWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19);
StringExpandPlaceholders(gStringVar4, gTradeText_TakeGoodCare);
Text_InitWindowAndPrintText(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
gUnknown_03004828->unk_00c0 = 0;
@@ -5536,7 +5536,7 @@ static void sub_804DC88(void)
case 0:
gUnknown_03004828 = &ewram_2010000.unk_0f000;
gMain.state ++;
- ZeroFillWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19);
+ Text_EraseWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19);
StringExpandPlaceholders(gStringVar4, gOtherText_LinkStandby2);
Text_InitWindowAndPrintText(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
break;
@@ -5564,7 +5564,7 @@ static void sub_804DC88(void)
break;
case 2:
gMain.state = 50;
- ZeroFillWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19);
+ Text_EraseWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19);
Text_InitWindowAndPrintText(&gUnknown_03004828->window, gSystemText_Saving, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
break;
case 50:
diff --git a/src/engine/trainer_card.c b/src/engine/trainer_card.c
index da9dd7179..70942fc29 100644
--- a/src/engine/trainer_card.c
+++ b/src/engine/trainer_card.c
@@ -565,8 +565,8 @@ void sub_80937A4()
void sub_80937BC()
{
- SetUpWindowConfig(&WindowConfig_TrainerCard_Back_Values);
- MultistepInitMenuWindowBegin(&WindowConfig_TrainerCard_Back_Values);
+ Text_LoadWindowTemplate(&gWindowTemplate_TrainerCard_Back_Values);
+ MultistepInitMenuWindowBegin(&gWindowTemplate_TrainerCard_Back_Values);
}
static void sub_80937D8()
@@ -678,7 +678,7 @@ bool8 sub_8093980(struct Task *task)
static void sub_80939A4(void)
{
CreateTask(sub_80939DC, 0);
- BasicInitMenuWindow(&WindowConfig_TrainerCard_Back_Values);
+ BasicInitMenuWindow(&gWindowTemplate_TrainerCard_Back_Values);
}
static void sub_80939C0(void)
@@ -1317,7 +1317,7 @@ static void sub_8094140(void)
{
u8 *buffer;
- BasicInitMenuWindow(&WindowConfig_TrainerCard_Back_Values);
+ BasicInitMenuWindow(&gWindowTemplate_TrainerCard_Back_Values);
buffer = gStringVar1;
StringCopy(buffer, ewram0_2.var_64.playerName);
@@ -1332,7 +1332,7 @@ static void sub_8094140(void)
static void sub_8094188(void)
{
- BasicInitMenuWindow(&WindowConfig_TrainerCard_Back_Values);
+ BasicInitMenuWindow(&gWindowTemplate_TrainerCard_Back_Values);
TrainerCard_Back_PrintName();
TrainerCard_Back_PrintHallOfFameTime_Label();
TrainerCard_Back_PrintLinkBattlesLabel();
@@ -1341,7 +1341,7 @@ static void sub_8094188(void)
TrainerCard_Back_PrintLinkPokeblocks_Label();
TrainerCard_Back_PrintPokemonTrades_Label();
- BasicInitMenuWindow(&WindowConfig_TrainerCard_Back_Labels);
+ BasicInitMenuWindow(&gWindowTemplate_TrainerCard_Back_Labels);
TrainerCard_Back_PrintHallOfFameTime();
TrainerCard_Back_PrintLinkBattles();
TrainerCard_Back_PrintBattleTower();
@@ -1489,10 +1489,10 @@ static void TrainerCard_Back_PrintBattleTower(void)
if (ewram0_2.var_a != 0)
{
sub_8072C44(buffer, ewram0_2.var_64.battleTowerWins, 24, 1);
- MenuPrint_PixelCoords(buffer, 112, 120, 0);
+ Menu_PrintTextPixelCoords(buffer, 112, 120, 0);
sub_8072C44(buffer, ewram0_2.var_64.battleTowerLosses, 24, 1);
- MenuPrint_PixelCoords(buffer, 149, 120, 0);
+ Menu_PrintTextPixelCoords(buffer, 149, 120, 0);
}
}
diff --git a/src/field/berry_tag_screen.c b/src/field/berry_tag_screen.c
index 75e481f84..a05d9bf87 100644
--- a/src/field/berry_tag_screen.c
+++ b/src/field/berry_tag_screen.c
@@ -109,7 +109,7 @@ static bool8 sub_8146058(void)
gMain.state += 1;
break;
case 3:
- SetUpWindowConfig(&gWindowTemplate_81E6E18);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6E18);
gMain.state += 1;
break;
case 4:
diff --git a/src/field/choose_party.c b/src/field/choose_party.c
index 6a9c23c66..3ba04e489 100644
--- a/src/field/choose_party.c
+++ b/src/field/choose_party.c
@@ -462,7 +462,7 @@ static void BattleTowerEntryMenuCallback_Enter(u8 taskId)
}
PlaySE(SE_HAZURE);
Menu_EraseWindowRect(20, 10, 29, 19);
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
sub_806D5A4();
sub_806E834(gOtherText_NoMoreThreePoke, 1);
gTasks[taskId].func = sub_8122728;
@@ -476,7 +476,7 @@ static void sub_8122728(u8 taskId)
if ((gMain.newKeys & A_BUTTON) || (gMain.newKeys & B_BUTTON))
{
Menu_EraseWindowRect(0, 14, 29, 19);
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
BattleTowerEntryMenuCallback_Exit(taskId);
}
}
@@ -516,7 +516,7 @@ static void BattleTowerEntryMenuCallback_NoEntry(u8 taskId)
static void sub_81227FC(u8 taskId)
{
Menu_EraseWindowRect(20, 10, 29, 19);
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
PrintPartyMenuPromptText(0, 0);
gTasks[taskId].func = HandleBattleTowerPartyMenu;
}
@@ -897,7 +897,7 @@ static void DaycareStorageMenuCallback_Exit(u8 taskId)
{
PlaySE(SE_SELECT);
Menu_EraseWindowRect(20, 10, 29, 19);
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
PrintPartyMenuPromptText(15, 0);
gTasks[taskId].func = HandleDaycarePartyMenu;
}
diff --git a/src/field/daycare.c b/src/field/daycare.c
index 7814a3b24..5811461ae 100644
--- a/src/field/daycare.c
+++ b/src/field/daycare.c
@@ -1756,7 +1756,7 @@ static void HandleDaycareLevelMenuInput(u8 taskId)
}
else if (gMain.newKeys & A_BUTTON)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
PlaySE(SE_SELECT);
gLastFieldPokeMenuOpened = gSpecialVar_Result = gTasks[taskId].data[0];
DestroyTask(taskId);
@@ -1765,7 +1765,7 @@ static void HandleDaycareLevelMenuInput(u8 taskId)
}
else if (gMain.newKeys & B_BUTTON)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
gLastFieldPokeMenuOpened = gSpecialVar_Result = 2;
DestroyTask(taskId);
Menu_EraseWindowRect(15, 6, 29, 13);
@@ -1780,7 +1780,7 @@ void ShowDaycareLevelMenu(void)
GetDaycareLevelMenuText(&gSaveBlock1.daycare, buffer);
Menu_PrintText(buffer, 16, 7);
GetDaycareLevelMenuLevelText(&gSaveBlock1.daycare, buffer);
- MenuPrint_PixelCoords(buffer, 0xce, 0x38, TRUE);
+ Menu_PrintTextPixelCoords(buffer, 0xce, 0x38, TRUE);
InitMenu(0, 16, 7, 3, 0, 13);
CreateTask(HandleDaycareLevelMenuInput, 3);
}
diff --git a/src/field/decoration.c b/src/field/decoration.c
index a91b2e37b..a6c0bd21f 100644
--- a/src/field/decoration.c
+++ b/src/field/decoration.c
@@ -1434,7 +1434,7 @@ void sub_80FE1DC(void)
{
sub_80FE2B4();
Menu_DrawStdWindowFrame(0, 0, 10, 9);
- PrintMenuItems(1, 1, 4, (const struct MenuAction *)gUnknown_083EC604);
+ Menu_PrintItems(1, 1, 4, (const struct MenuAction *)gUnknown_083EC604);
InitMenu(0, 1, 1, 4, gUnknown_020388D4, 9);
}
@@ -1516,7 +1516,7 @@ void sub_80FE394(void)
void gpu_pal_decompress_alloc_tag_and_upload(u8 taskId)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(0, 0, 10, 9);
Menu_BlankWindowRect(2, 15, 27, 18);
FreeSpritePaletteByTag(6);
@@ -1546,7 +1546,7 @@ void sub_80FE470(u8 decoCat, u8 left, u8 top, u8 palIdx) // PrintDecorationCateg
{
u8 *strptr;
u8 v0;
- v0 = sub_8072CBC();
+ v0 = Menu_GetTextWindowPaletteNum();
// PALETTE {palIdx}
strptr = gStringVar4;
strptr[0] = EXT_CTRL_CODE_BEGIN;
@@ -1583,7 +1583,7 @@ void sub_80FE528(u8 taskId) // PrintDecorationCategorySelectionMenuStrings
void sub_80FE5AC(u8 taskId)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(0, 0, 29, 19);
sub_80FE528(taskId);
InitMenu(0, 1, 1, 9, gUnknown_020388F6, 13);
@@ -1620,7 +1620,7 @@ void sub_80FE604(u8 taskId)
gTasks[taskId].func = sub_80FE868;
} else
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(0, 0, 14, 19);
DisplayItemMessageOnField(taskId, gSecretBaseText_NoDecors, sub_80FE418, 0);
}
@@ -1649,7 +1649,7 @@ void sub_80FE728(u8 taskId)
void sub_80FE758(u8 taskId)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(0, 0, 14, 19);
if (gTasks[taskId].data[11] != 2)
{
@@ -1677,7 +1677,7 @@ void sub_80FE7D4(u8 *dest, u8 decClass)
void sub_80FE7EC(u8 taskId)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(0, 0, 29, 19);
sub_80FEC94(taskId);
@@ -1757,7 +1757,7 @@ void sub_80FE948(u8 taskId)
}
if (gMain.newKeys & A_BUTTON)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
PlaySE(SE_SELECT);
gUnknown_020388F5 = gUnknown_020388F2 + gUnknown_020388F4;
if (gUnknown_020388F5 == gUnknown_020388D5)
@@ -1769,7 +1769,7 @@ void sub_80FE948(u8 taskId)
}
} else if (gMain.newKeys & B_BUTTON)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
PlaySE(SE_SELECT);
gUnknown_083EC634[gTasks[taskId].data[11]].noFunc(taskId);
}
@@ -2005,7 +2005,7 @@ void sub_80FEF74(void)
sub_80F9520(gUnknown_020388F7, 8);
DestroyVerticalScrollIndicator(0);
DestroyVerticalScrollIndicator(1);
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(0, 0, 14, 19);
}
@@ -2035,7 +2035,7 @@ void sub_80FEFF4(u8 taskId)
void sub_80FF034(u8 taskId)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(0, 0, 14, 19);
sub_80FE5AC(taskId);
}
@@ -3790,7 +3790,7 @@ void sub_8100E70(u8 taskId)
data[2] = 1;
data[6] = 1;
data[5] = 1;
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
}
break;
case 1:
diff --git a/src/field/diploma.c b/src/field/diploma.c
index 8481589cb..7028eec02 100644
--- a/src/field/diploma.c
+++ b/src/field/diploma.c
@@ -68,7 +68,7 @@ void CB2_ShowDiploma(void)
ResetPaletteFade();
FreeAllSpritePalettes();
LoadPalette(gDiplomaPalettes, 0, 64);
- SetUpWindowConfig(&gWindowTemplate_81E6C3C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C);
InitMenuWindow(&gWindowTemplate_81E6CE4);
DisplayDiplomaText();
BeginNormalPaletteFade(-1, 0, 0x10, 0, 0);
diff --git a/src/field/field_effect.c b/src/field/field_effect.c
index 57d9072b1..5ff89574b 100644
--- a/src/field/field_effect.c
+++ b/src/field/field_effect.c
@@ -2434,7 +2434,7 @@ void sub_8088380(struct Task *task)
IntrCallback callback;
LoadWordFromTwoHalfwords((u16 *)&task->data[13], (u32 *)&callback);
SetVBlankCallback(callback);
- SetUpWindowConfig(&gWindowTemplate_81E6CE4);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6CE4);
InitMenuWindow(&gWindowTemplate_81E6CE4);
FreeResourcesAndDestroySprite(&gSprites[task->data[15]]);
FieldEffectActiveListRemove(FLDEFF_FIELD_MOVE_SHOW_MON);
@@ -2557,7 +2557,7 @@ void sub_808862C(struct Task *task)
CpuFill32(0, (void *)VRAM + bg0cnt, 0x800);
LoadWordFromTwoHalfwords((u16 *)&task->data[13], (u32 *)&intrCallback);
SetVBlankCallback(intrCallback);
- SetUpWindowConfig(&gWindowTemplate_81E6CE4);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6CE4);
InitMenuWindow(&gWindowTemplate_81E6CE4);
FreeResourcesAndDestroySprite(&gSprites[task->data[15]]);
FieldEffectActiveListRemove(FLDEFF_FIELD_MOVE_SHOW_MON);
diff --git a/src/field/field_region_map.c b/src/field/field_region_map.c
index afbc25226..54091459f 100644
--- a/src/field/field_region_map.c
+++ b/src/field/field_region_map.c
@@ -50,7 +50,7 @@ void CB2_FieldInitRegionMap(void)
InitRegionMap((void *)&ewram0_5.unk8, 0);
CreateRegionMapPlayerIcon(0, 0);
CreateRegionMapCursor(1, 1);
- SetUpWindowConfig(&gWindowTemplate_81E709C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E709C);
InitMenuWindow(&gWindowTemplate_81E709C);
Menu_EraseScreen();
REG_BG0CNT = BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(31) | BGCNT_16COLOR | BGCNT_TXT256x256;
diff --git a/src/field/field_specials.c b/src/field/field_specials.c
index 589f96844..aade7cffd 100644
--- a/src/field/field_specials.c
+++ b/src/field/field_specials.c
@@ -1573,7 +1573,7 @@ void sub_810F118(u8 taskId)
}
if (gMain.newKeys & A_BUTTON)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
gSpecialVar_Result = gUnknown_0203925B;
PlaySE(SE_SELECT);
sub_810EEDC();
@@ -1582,7 +1582,7 @@ void sub_810F118(u8 taskId)
}
if (gMain.newKeys & B_BUTTON)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
gSpecialVar_Result = 0x7f;
PlaySE(SE_SELECT);
sub_810EEDC();
diff --git a/src/field/item_menu.c b/src/field/item_menu.c
index f58f42fb9..2be5f1e1d 100644
--- a/src/field/item_menu.c
+++ b/src/field/item_menu.c
@@ -424,7 +424,7 @@ static bool8 SetupBagMultistep(void)
gMain.state++;
break;
case 7:
- SetUpWindowConfig(&gWindowTemplate_81E6DFC);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6DFC);
gMain.state++;
break;
case 8:
@@ -1552,11 +1552,11 @@ static void ItemListMenu_ChangeDescription(s16 itemId, int b)
if (b == 0)
{
Menu_EraseWindowRect(0, 13, 13, 20);
- MenuPrint_PixelCoords(gOtherText_ReturnTo, 4, 0x68, 0);
+ Menu_PrintTextPixelCoords(gOtherText_ReturnTo, 4, 0x68, 0);
}
else if (b == 1)
{
- MenuPrint_PixelCoords(gUnknown_0840E740[sReturnLocation], 4, 0x78, 0);
+ Menu_PrintTextPixelCoords(gUnknown_0840E740[sReturnLocation], 4, 0x78, 0);
}
}
else
@@ -1564,7 +1564,7 @@ static void ItemListMenu_ChangeDescription(s16 itemId, int b)
if (b == 0)
Menu_EraseWindowRect(0, 13, 13, 20);
if (ItemId_CopyDescription(description, itemId, b))
- MenuPrint_PixelCoords(description, 4, 104 + b * 16, 0);
+ Menu_PrintTextPixelCoords(description, 4, 104 + b * 16, 0);
}
}
@@ -1604,7 +1604,7 @@ static void sub_80A4A98(const u8 *text, u32 line)
if (line == 0)
Menu_EraseWindowRect(0, 13, 13, 20);
if (CopyTextLine(buffer, text, line))
- MenuPrint_PixelCoords(buffer, 4, 104 + line * 16, 0);
+ Menu_PrintTextPixelCoords(buffer, 4, 104 + line * 16, 0);
}
static void sub_80A4ADC(u8 taskId)
@@ -3559,7 +3559,7 @@ static void ItemListMenu_InitMenu(void)
static void sub_80A73C0(void)
{
- sub_814AD7C(0x70, gBagPocketScrollStates[sCurrentBagPocket].cursorPos * 16 + 16);
+ MenuCursor_SetPos814AD7C(0x70, gBagPocketScrollStates[sCurrentBagPocket].cursorPos * 16 + 16);
}
static void sub_80A73F0(void)
@@ -3569,8 +3569,8 @@ static void sub_80A73F0(void)
static void sub_80A73FC(void)
{
- HandleDestroyMenuCursors();
- sub_814AD44();
+ Menu_DestroyCursor();
+ MenuCursor_Destroy814AD44();
}
static void sub_80A740C(void)
diff --git a/src/field/mauville_man.c b/src/field/mauville_man.c
index c3a73e18b..0a841eed1 100644
--- a/src/field/mauville_man.c
+++ b/src/field/mauville_man.c
@@ -1259,7 +1259,7 @@ static void Task_StoryListMenu(u8 taskId)
gSpecialVar_Result = 1;
gUnknown_03000748 = selection;
}
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(0, 0, 25, 12);
DestroyTask(taskId);
EnableBothScriptContexts();
diff --git a/src/field/menu_helpers.c b/src/field/menu_helpers.c
index 44b24eed6..76f0d367e 100644
--- a/src/field/menu_helpers.c
+++ b/src/field/menu_helpers.c
@@ -160,7 +160,7 @@ void DisplayItemMessageOnField(u8 taskId, const u8 *str, TaskFunc callback, u16
static void Task_CallYesOrNoCallback(u8 taskId)
{
- switch (ProcessMenuInputNoWrap_())
+ switch (Menu_ProcessInputNoWrap_())
{
case 0:
PlaySE(SE_SELECT);
diff --git a/src/field/money.c b/src/field/money.c
index 4ab4de51c..b85ed8009 100644
--- a/src/field/money.c
+++ b/src/field/money.c
@@ -148,7 +148,7 @@ void PrintMoneyAmount(u32 amount, u8 size, u8 x, u8 y)
else
{
int xPlusOne = x + 1;
- MenuPrint_PixelCoords(buffer, (xPlusOne + size) * 8 - stringWidth, y * 8, 1);
+ Menu_PrintTextPixelCoords(buffer, (xPlusOne + size) * 8 - stringWidth, y * 8, 1);
}
}
diff --git a/src/field/overworld.c b/src/field/overworld.c
index e91c8ae56..9fab20876 100644
--- a/src/field/overworld.c
+++ b/src/field/overworld.c
@@ -1456,7 +1456,7 @@ bool32 sub_805483C(u8 *a1)
case 4:
sub_8054814();
sub_8054C54();
- SetUpWindowConfig(&gWindowTemplate_81E6C3C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C);
InitMenuWindow(&gWindowTemplate_81E6CE4);
(*a1)++;
break;
@@ -1522,7 +1522,7 @@ bool32 sub_805493C(u8 *a1, u32 a2)
case 4:
sub_8054814();
sub_8054C54();
- SetUpWindowConfig(&gWindowTemplate_81E6C3C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C);
InitMenuWindow(&gWindowTemplate_81E6CE4);
(*a1)++;
break;
@@ -1612,7 +1612,7 @@ bool32 sub_8054A9C(u8 *a1)
case 3:
sub_8054814();
sub_8054C54();
- SetUpWindowConfig(&gWindowTemplate_81E6C3C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C);
InitMenuWindow(&gWindowTemplate_81E6CE4);
(*a1)++;
break;
@@ -1695,7 +1695,7 @@ void sub_8054C2C(void)
{
sub_8054814();
sub_8054C54();
- SetUpWindowConfig(&gWindowTemplate_81E6C3C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C);
InitMenuWindow(&gWindowTemplate_81E6CE4);
mapdata_load_assets_to_gpu_and_full_redraw();
}
diff --git a/src/field/party_menu.c b/src/field/party_menu.c
index 73a32d070..9cad5bd73 100644
--- a/src/field/party_menu.c
+++ b/src/field/party_menu.c
@@ -679,7 +679,7 @@ bool8 InitPartyMenu(void)
gMain.state++;
break;
case 7:
- SetUpWindowConfig(&gWindowTemplate_81E6C90);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C90);
gMain.state++;
break;
case 8:
@@ -2706,7 +2706,7 @@ void sub_806D5B8(u8 monIndex)
u8 right = gUnknown_08376948[IsDoubleBattle()][monIndex].right;
u8 bottom = gUnknown_08376948[IsDoubleBattle()][monIndex].bottom;
- ZeroFillWindowRect(&gUnknown_03004210, left, top, right, bottom);
+ Text_EraseWindowRect(&gUnknown_03004210, left, top, right, bottom);
var1 = 0;
CpuFastSet(&var1, OBJ_VRAM1 + monIndex * 0x400, 0x1000100);
@@ -2720,7 +2720,7 @@ void sub_806D668(u8 monIndex)
u8 right = gUnknown_08376978[IsDoubleBattle()][monIndex].right;
u8 bottom = gUnknown_08376978[IsDoubleBattle()][monIndex].bottom;
- ZeroFillWindowRect(&gUnknown_03004210, left, top, right, bottom);
+ Text_EraseWindowRect(&gUnknown_03004210, left, top, right, bottom);
var1 = 0;
CpuFastSet(&var1, OBJ_VRAM1 + 0x300 + monIndex * 0x400, 0x1000040);
@@ -3313,7 +3313,7 @@ void PartyMenuDoPrintMonNickname(u8 monIndex, int b, const u8 *nameBuffer)
{
u32 var1 = 0;
CpuFastSet(&var1, gTileBuffer, 0x1000100);
- sub_8004E3C((struct WindowTemplate *)&gWindowTemplate_81E6CAC, gTileBuffer, nameBuffer);
+ Text_InitWindow8004E3C((struct WindowTemplate *)&gWindowTemplate_81E6CAC, gTileBuffer, nameBuffer);
CpuFastSet(gTileBuffer, OBJ_VRAM1 + (monIndex * 0x400), 128);
}
@@ -3423,7 +3423,7 @@ void PartyMenuDoPrintLevel(u8 monIndex, u8 menuLayout, u8 level)
var1 = 0;
CpuFastSet(&var1, gUnknown_02039460, 0x1000020);
- sub_8004E3C((struct WindowTemplate *)&gWindowTemplate_81E6CAC, gUnknown_02039460 - 0x100 /*gTileBuffer*/, gStringVar1);
+ Text_InitWindow8004E3C((struct WindowTemplate *)&gWindowTemplate_81E6CAC, gUnknown_02039460 - 0x100 /*gTileBuffer*/, gStringVar1);
CpuFastSet(gUnknown_02039460, OBJ_VRAM1 + 0x200 + (monIndex * 0x400), 32);
}
@@ -3517,7 +3517,7 @@ void PartyMenuDoPrintHP(u8 monIndex, u8 b, u16 currentHP, u16 maxHP)
var = 0;
CpuFastSet(&var, gUnknown_02039460, 0x1000040);
- sub_8004E3C((struct WindowTemplate *)&gWindowTemplate_81E6CAC, gUnknown_02039460 - 0x100 /*gTileBuffer*/, gStringVar1);
+ Text_InitWindow8004E3C((struct WindowTemplate *)&gWindowTemplate_81E6CAC, gUnknown_02039460 - 0x100 /*gTileBuffer*/, gStringVar1);
CpuFastSet(gUnknown_02039460, OBJ_VRAM1 + 0x300 + (monIndex * 0x400), 64);
}
@@ -3668,7 +3668,7 @@ void ClosePartyPopupMenu(u8 index, const struct PartyPopupMenu *menu)
SetPartyPopupMenuOffsets(index, &left, &top, menu);
Menu_EraseWindowRect(left, top, left + menu[index].width, menu[index].numChoices * 2 + top + 1);
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
}
TaskFunc PartyMenuGetPopupMenuFunc(u8 menuIndex, const struct PartyPopupMenu *menus, const struct MenuAction2 *menuActions, u8 itemIndex)
@@ -3788,7 +3788,7 @@ void party_menu_link_mon_held_item_object(u8 taskId)
void PartyMenuTryGiveMonHeldItem_806EACC(u8 taskId)
{
- s8 selection = ProcessMenuInputNoWrap_();
+ s8 selection = Menu_ProcessInputNoWrap_();
if (selection == 0)
{
@@ -3925,7 +3925,7 @@ void DoTakeMail(u8 taskId, TaskFunc func)
void Task_LoseMailMessage(u8 taskId)
{
- s8 selection = ProcessMenuInputNoWrap_();
+ s8 selection = Menu_ProcessInputNoWrap_();
if (selection == 0)
{
@@ -3964,7 +3964,7 @@ void Task_ConfirmLoseMailMessage(u8 taskId)
void Task_TakeHeldMail(u8 taskId)
{
- s8 selection = ProcessMenuInputNoWrap_();
+ s8 selection = Menu_ProcessInputNoWrap_();
if (selection == 0)
{
@@ -4126,7 +4126,7 @@ void sub_806F358(u8 taskId)
void sub_806F390(u8 taskId)
{
- s8 selection = ProcessMenuInputNoWrap_();
+ s8 selection = Menu_ProcessInputNoWrap_();
if (selection == 0)
{
@@ -4224,7 +4224,7 @@ void StopTryingToTeachMove_806F67C(u8 taskId)
void StopTryingToTeachMove_806F6B4(u8 taskId)
{
- s8 selection = ProcessMenuInputNoWrap_();
+ s8 selection = Menu_ProcessInputNoWrap_();
if (selection == 0)
{
@@ -4713,7 +4713,7 @@ void DoPPRecoveryItemEffect(u8 taskId, u16 item, TaskFunc c)
void ItemUseMoveMenu_HandleMoveSelection(u8 taskId)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(19, 10, 29, 19);
sub_806D5A4();
gTasks[taskId].data[11] = Menu_GetCursorPos();
@@ -4722,7 +4722,7 @@ void ItemUseMoveMenu_HandleMoveSelection(u8 taskId)
void ItemUseMoveMenu_HandleCancel(u8 taskId)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(19, 10, 29, 19);
if (gMain.inBattle)
gTasks[ewram1C000.unk4].func = HandleBattlePartyMenu;
@@ -4868,12 +4868,12 @@ void PrintStatGrowthsInLevelUpWindow(u8 taskId)
x = (i / 3) * 9 + 11;
y = ((i % 3) << 1) + 1;
- MenuPrint_PixelCoords(StatNames[i], (x + 1) * 8, y * 8, 1);
+ Menu_PrintTextPixelCoords(StatNames[i], (x + 1) * 8, y * 8, 1);
if (i == 2)
- MenuPrint_PixelCoords(gOtherText_TallPlusAndRightArrow, (x + 6) * 8 + 6, y * 8, 0);
+ Menu_PrintTextPixelCoords(gOtherText_TallPlusAndRightArrow, (x + 6) * 8 + 6, y * 8, 0);
else
- MenuPrint_PixelCoords(gOtherText_TallPlusAndRightArrow, (x + 6) * 8 + 6, y * 8, 1);
+ Menu_PrintTextPixelCoords(gOtherText_TallPlusAndRightArrow, (x + 6) * 8 + 6, y * 8, 1);
gStringVar1[0] = EXT_CTRL_CODE_BEGIN;
gStringVar1[1] = 0x14;
@@ -4881,7 +4881,7 @@ void PrintStatGrowthsInLevelUpWindow(u8 taskId)
ConvertIntToDecimalStringN(gStringVar1 + 3, ewram1B000.statGrowths[i], 1, 2);
- MenuPrint_PixelCoords(gStringVar1, (x + 6) * 8 + 12, y * 8, 0);
+ Menu_PrintTextPixelCoords(gStringVar1, (x + 6) * 8 + 12, y * 8, 0);
}
}
#elif GERMAN
@@ -5028,7 +5028,7 @@ void PrintNewStatsInLevelUpWindow(u8 taskId)
gStringVar1[2] = 0x06;
ConvertIntToDecimalStringN(gStringVar1 + 3, ewram1B000.statGrowths[newStatIndex], 1, 3);
- MenuPrint_PixelCoords(gStringVar1, (x + 6) * 8 + 6, y * 8, 0);
+ Menu_PrintTextPixelCoords(gStringVar1, (x + 6) * 8 + 6, y * 8, 0);
}
}
diff --git a/src/field/player_pc.c b/src/field/player_pc.c
index 7cbb20bad..0d5c5234b 100644
--- a/src/field/player_pc.c
+++ b/src/field/player_pc.c
@@ -218,7 +218,7 @@ void PlayerPC(void)
static void InitPlayerPCMenu(u8 taskId)
{
Menu_DrawStdWindowFrame(0, 0, 10, gPcItemMenuOptionsNum * 2 + 1);
- PrintMenuItemsReordered(1, 1, gPcItemMenuOptionsNum, sPlayerPCMenuActions, gPcItemMenuOptionOrder);
+ Menu_PrintItemsReordered(1, 1, gPcItemMenuOptionsNum, sPlayerPCMenuActions, gPcItemMenuOptionOrder);
InitMenu(0, 1, 1, gPcItemMenuOptionsNum, 0, 9);
TASK.FUNC = PlayerPCProcessMenuInput;
}
@@ -237,13 +237,13 @@ static void PlayerPCProcessMenuInput(u8 taskId)
}
else if (gMain.newKeys & A_BUTTON)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
PlaySE(SE_SELECT);
sPlayerPCMenuActions[gPcItemMenuOptionOrder[Menu_GetCursorPos()]].func(taskId);
}
else if (gMain.newKeys & B_BUTTON)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
PlaySE(SE_SELECT);
sPlayerPCMenuActions[gPcItemMenuOptionsNum[gPcItemMenuOptionOrder - 1]].func(taskId); // run EXIT.
}
@@ -307,7 +307,7 @@ static void InitItemStorageMenu(u8 var)
{
Menu_EraseWindowRect(0, 0, 10, 9);
Menu_DrawStdWindowFrame(0, 0, 11, 9);
- PrintMenuItems(1, 1, 4, (struct MenuAction *)gPCText_ItemPCOptionsText);
+ Menu_PrintItems(1, 1, 4, (struct MenuAction *)gPCText_ItemPCOptionsText);
InitMenu(0, 1, 1, 4, var, 10);
ItemStorageMenuPrint(gPCText_OptionDescList[var]);
}
@@ -339,7 +339,7 @@ static void ItemStorageMenuProcessInput(u8 var)
}
else if (gMain.newKeys & B_BUTTON)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
PlaySE(SE_SELECT);
gPCText_ItemPCOptionsText[ITEMPC_MENU_EXIT].func(var);
}
@@ -378,7 +378,7 @@ static void ItemStorage_Withdraw(u8 taskId)
{
s16 *data = TASK.data;
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(0, 0, 11, 9);
NUM_ITEMS = CountUsedPCItemSlots();
@@ -400,7 +400,7 @@ static void ItemStorage_Toss(u8 taskId)
{
s16 *data = TASK.data;
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(0, 0, 11, 9);
NUM_ITEMS = CountUsedPCItemSlots();
@@ -420,7 +420,7 @@ static void ItemStorage_Toss(u8 taskId)
static void ItemStorage_Exit(u8 var)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(0, 0, 11, 9);
ReshowPlayerPC(var);
}
@@ -549,7 +549,7 @@ static void ItemStorage_ProcessInput(u8 taskId)
PlaySE(SE_SELECT);
if(SWITCH_MODE_ACTIVE == FALSE)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
ItemStorage_GoBackToPlayerPCMenu(taskId);
}
else
@@ -1112,7 +1112,7 @@ static void Mailbox_ProcessInput(u8 taskId)
}
else if(gMain.newKeys & A_BUTTON)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
PlaySE(SE_SELECT);
if(eMailboxInfo.itemsAbove + eMailboxInfo.cursorPos == eMailboxInfo.count)
@@ -1127,7 +1127,7 @@ static void Mailbox_ProcessInput(u8 taskId)
}
else if(gMain.newKeys & B_BUTTON)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
PlaySE(SE_SELECT);
Mailbox_TurnOff(taskId);
}
@@ -1165,7 +1165,7 @@ static void Mailbox_TurnOff(u8 taskId)
static void Mailbox_PrintMailOptions(u8 taskId) // Mailbox_PrintMailOptions
{
Menu_DrawStdWindowFrame(0, 0, 0xC, 0x9);
- PrintMenuItems(1, 1, 4, (struct MenuAction *)gMailboxMailOptions);
+ Menu_PrintItems(1, 1, 4, (struct MenuAction *)gMailboxMailOptions);
InitMenu(0, 1, 1, 4, 0, 0xB);
TASK.FUNC = Mailbox_MailOptionsProcessInput;
}
@@ -1231,7 +1231,7 @@ static const u8 gHighlightedMoveToBagFormatText[] = _("{COLOR RED}{STR_VAR_1}");
static void Mailbox_MoveToBag(u8 taskId)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
StringCopy(gStringVar1, gOtherText_MoveToBag);
Menu_PrintText(gHighlightedMoveToBagFormatText, 1, 3); // gHighlightedMoveToBagFormatText
DisplayItemMessageOnField(taskId, gOtherText_MessageWillBeLost, Mailbox_DrawYesNoBeforeMove, 0);
@@ -1325,7 +1325,7 @@ static void Mailbox_NoPokemonForMail(u8 taskId)
static void Mailbox_Cancel(u8 taskId)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(0, 0, 0xC, 0x9);
Mailbox_DrawMailMenuAndDoProcessInput(taskId);
}
diff --git a/src/field/pokeblock.c b/src/field/pokeblock.c
index b238857fa..dd94e1755 100644
--- a/src/field/pokeblock.c
+++ b/src/field/pokeblock.c
@@ -275,11 +275,11 @@ static bool8 sub_810B6C0(void)
gMain.state++;
break;
case 5:
- SetUpWindowConfig(&gWindowTemplate_81E6E34);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6E34);
gMain.state++;
break;
case 6:
- SetUpWindowConfig(&gWindowTemplate_81E6E50);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6E50);
gMain.state++;
break;
case 7:
@@ -814,7 +814,7 @@ static void sub_810C368(u8 taskId)
sub_80F98A4(1);
BasicInitMenuWindow(&gWindowTemplate_81E6E50);
Menu_DrawStdWindowFrame(7, v0 + 4, 13, 11);
- PrintMenuItemsReordered(8, v0 + 5, gUnknown_0203924C, gUnknown_083F7EF4, gUnknown_03000758);
+ Menu_PrintItemsReordered(8, v0 + 5, gUnknown_0203924C, gUnknown_083F7EF4, gUnknown_03000758);
InitMenu(0, 8, v0 + 5, gUnknown_0203924C, 0, 5);
gSpecialVar_ItemId = gUnknown_02039248.unk0 + gUnknown_02039248.unk1;
gTasks[taskId].func = sub_810C40C;
@@ -869,7 +869,7 @@ static void sub_810C508(u8 taskId)
static void sub_810C540(u8 taskId)
{
BasicInitMenuWindow(&gWindowTemplate_81E6E50);
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(7, 4, 13, 11);
StringCopy(gStringVar1, gPokeblockNames[gSaveBlock1.pokeblocks[gUnknown_02039248.unk0 + gUnknown_02039248.unk1].color]);
StringExpandPlaceholders(gStringVar4, gContestStatsText_ThrowAwayPrompt);
@@ -932,7 +932,7 @@ static void sub_810C748(u8 taskId)
{
StartVerticalScrollIndicators(0);
StartVerticalScrollIndicators(1);
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(7, 4, 13, 11);
gTasks[taskId].func = sub_810BF7C;
}
diff --git a/src/field/region_map.c b/src/field/region_map.c
index f7db0a61e..a098eb73d 100644
--- a/src/field/region_map.c
+++ b/src/field/region_map.c
@@ -1540,7 +1540,7 @@ void CB2_InitFlyRegionMap(void)
FreeAllSpritePalettes();
break;
case 1:
- SetUpWindowConfig(&gWindowTemplate_81E7224);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E7224);
break;
case 2:
InitMenuWindow(&gWindowTemplate_81E7224);
@@ -1562,7 +1562,7 @@ void CB2_InitFlyRegionMap(void)
break;
case 6:
LoadPalette(sFlyRegionMapFrame_Pal, 16, 32);
- MenuPrint_PixelCoords(gOtherText_FlyToWhere, 1, 0x90, 1);
+ Menu_PrintTextPixelCoords(gOtherText_FlyToWhere, 1, 0x90, 1);
break;
case 7:
CreateFlyTargetGraphics();
diff --git a/src/field/script_menu.c b/src/field/script_menu.c
index ee5843049..9d901a03c 100644
--- a/src/field/script_menu.c
+++ b/src/field/script_menu.c
@@ -652,7 +652,7 @@ static void DrawMultichoiceMenu(u8 left, u8 top, u8 count, const struct MenuActi
bottom = top + (2 * count + 1);
Menu_DrawStdWindowFrame(left, top, right, bottom);
- PrintMenuItems(left + 1, top + 1, count, list);
+ Menu_PrintItems(left + 1, top + 1, count, list);
InitMenu(0, left + 1, top + 1, count, cursorPos, right - left - 1);
StartScriptMenuTask(left, top, right, bottom, ignoreBPress, count);
}
@@ -704,7 +704,7 @@ static void Task_HandleMultichoiceInput(u8 taskId)
{
gSpecialVar_Result = selection;
}
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(gTasks[taskId].tLeft, gTasks[taskId].tTop, gTasks[taskId].tRight, gTasks[taskId].tBottom);
DestroyTask(taskId);
EnableBothScriptContexts();
@@ -745,7 +745,7 @@ static void sub_80B53B4(u8 left, u8 top, u8 count, const struct MenuAction *list
right = (right + left) + 2;
bottom = top + (2 * count + 1);
- PrintMenuItems(left, top, count, list);
+ Menu_PrintItems(left, top, count, list);
InitMenu(0, left, top, count, 0, right - left - 1);
StartScriptMenuTask(left, top, right, bottom, ignoreBPress, count);
}
@@ -839,7 +839,7 @@ bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, u8 ignoreBPr
bottom = (2 * (gMultichoiceLists[multichoiceId].count / columnCount)) + 3 + top;
}
- width = sub_807288C(columnCount);
+ width = Menu_GetColumnXCoord(columnCount);
gTasks[taskId].tLeft = left;
gTasks[taskId].tTop = top;
gTasks[taskId].tRight = width + left + 2;
@@ -866,7 +866,7 @@ static void Task_HandleMultichoiceGridInput(u8 taskId)
{
gSpecialVar_Result = selection;
}
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(gTasks[taskId].tLeft, gTasks[taskId].tTop, gTasks[taskId].tRight, gTasks[taskId].tBottom);
DestroyTask(taskId);
EnableBothScriptContexts();
diff --git a/src/field/secret_base.c b/src/field/secret_base.c
index 16c2f57c2..203b57867 100644
--- a/src/field/secret_base.c
+++ b/src/field/secret_base.c
@@ -1021,13 +1021,13 @@ void sub_80BC824(u8 taskId)
PlaySE(5);
if (taskData[1] + taskData[2] == taskData[0])
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(0, 0, 29, 19);
sub_80BCC54(taskId);
}
else
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
taskData[4] = sub_80BC948(taskData[1] + taskData[2]);
sub_80BC980(taskId);
}
@@ -1035,7 +1035,7 @@ void sub_80BC824(u8 taskId)
else if (gMain.newKeys & B_BUTTON)
{
PlaySE(5);
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(0, 0, 29, 19);
sub_80BCC54(taskId);
}
@@ -1067,7 +1067,7 @@ void sub_80BC980(u8 taskId)
PauseVerticalScrollIndicator(0);
PauseVerticalScrollIndicator(1);
Menu_DrawStdWindowFrame(1, 0, 12, 5);
- PrintMenuItems(2, 1, 2, (const struct MenuAction *)gUnknown_083D13D4);
+ Menu_PrintItems(2, 1, 2, (const struct MenuAction *)gUnknown_083D13D4);
InitMenu(0, 2, 1, 2, 0, 10);
gTasks[taskId].func = sub_80BC9E4;
}
@@ -1108,7 +1108,7 @@ void sub_80BCA84(u8 taskId)
DestroyVerticalScrollIndicator(0);
DestroyVerticalScrollIndicator(1);
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(0, 0, 29, 19);
sub_80BC190(gStringVar1, taskData[4]);
diff --git a/src/field/shop.c b/src/field/shop.c
index cfd4818dc..d56d65c3f 100644
--- a/src/field/shop.c
+++ b/src/field/shop.c
@@ -85,13 +85,13 @@ u8 CreateShopMenu(u8 martType)
{
gMartInfo.numChoices = 2;
Menu_DrawStdWindowFrame(0, 0, 10, 7);
- PrintMenuItemsReordered(1, 1, 3, sBuySellQuitMenuActions, gUnknown_083CC6E8);
+ Menu_PrintItemsReordered(1, 1, 3, sBuySellQuitMenuActions, gUnknown_083CC6E8);
}
else
{
gMartInfo.numChoices = 1;
Menu_DrawStdWindowFrame(0, 0, 10, 5);
- PrintMenuItemsReordered(1, 1, 2, sBuySellQuitMenuActions, gUnknown_083CC6EB);
+ Menu_PrintItemsReordered(1, 1, 2, sBuySellQuitMenuActions, gUnknown_083CC6EB);
}
InitMenu(0, 1, 1, gMartInfo.numChoices + 1, 0, 9); // add 1 for cancel
@@ -174,7 +174,7 @@ void sub_80B2F30(u8 taskId)
void HandleShopMenuQuit(u8 taskId)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(0, 0, 11, 8);
sub_80BE3BC();
ScriptContext2_Disable();
@@ -285,7 +285,7 @@ void BuyMenuDrawGraphics(void)
ResetPaletteFade();
ResetSpriteData();
ResetTasks();
- SetUpWindowConfig(&gWindowTemplate_81E6DFC);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6DFC);
InitMenuWindow(&gWindowTemplate_81E6DFC);
BuyMenuDrawMapGraphics();
gMartInfo.cursor = zero;
@@ -557,7 +557,7 @@ void sub_80B389C(u16 itemId, u8 var2, bool32 hasControlCode)
stringPtr = &gStringVar1[3];
GetMoneyAmountText(stringPtr, (ItemId_GetPrice(itemId) >> GetPriceReduction(1)), 0x4);
- MenuPrint_PixelCoords(&gStringVar1[0], 0xCA, var2 << 3, 1);
+ Menu_PrintTextPixelCoords(&gStringVar1[0], 0xCA, var2 << 3, 1);
}
void sub_80B3930(u16 itemId, u8 var2, bool32 hasControlCode)
@@ -586,7 +586,7 @@ void sub_80B3930(u16 itemId, u8 var2, bool32 hasControlCode)
else
{
GetMoneyAmountText(stringPtr, gDecorations[itemId].price, 0x4);
- MenuPrint_PixelCoords(&gStringVar1[0], 0xCA, var2 << 3, 0x1);
+ Menu_PrintTextPixelCoords(&gStringVar1[0], 0xCA, var2 << 3, 0x1);
}
}
@@ -1084,7 +1084,7 @@ void sub_80B40E8(u8 taskId) // Mart_DoCursorAction
PauseVerticalScrollIndicator(1);
sub_80F979C(1, 1);
sub_80B39D0(gMartInfo.cursor, gMartInfo.cursor, 1);
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(0, 0xC, 0xD, 0x13);
if (gMartInfo.martType == MART_TYPE_0)
diff --git a/src/field/slot_machine.c b/src/field/slot_machine.c
index abf837daa..9ff3a037c 100644
--- a/src/field/slot_machine.c
+++ b/src/field/slot_machine.c
@@ -400,7 +400,7 @@ static void SlotMachineSetup_0_1(void)
static void SlotMachineSetup_3_0(void)
{
- SetUpWindowConfig(&gWindowTemplate_81E7128);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E7128);
InitMenuWindow(&gWindowTemplate_81E7128);
}
@@ -850,7 +850,7 @@ static bool8 sub_8102318(struct Task *task)
static bool8 sub_8102344(struct Task *task)
{
- s8 input = ProcessMenuInputNoWrap_();
+ s8 input = Menu_ProcessInputNoWrap_();
if (input == 0)
{
Menu_EraseScreen();
@@ -2808,7 +2808,7 @@ static void sub_8104B80(struct Task *task)
sub_8104DA4();
sub_81065DC();
BasicInitMenuWindow(&gWindowTemplate_81E7144);
- MenuPrint_PixelCoords(gOtherText_ReelTime, 10, 32, 1);
+ Menu_PrintTextPixelCoords(gOtherText_ReelTime, 10, 32, 1);
BeginNormalPaletteFade(-1, 0, 16, 0, 0);
task->data[0]++;
}
diff --git a/src/field/start_menu.c b/src/field/start_menu.c
index 8131e2511..5b2276d1b 100644
--- a/src/field/start_menu.c
+++ b/src/field/start_menu.c
@@ -404,7 +404,7 @@ static u8 StartMenu_PlayerCallback(void)
//When player selects SAVE
static u8 StartMenu_SaveCallback(void)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
gCallback_03004AE8 = SaveCallback1;
return 0;
}
@@ -594,7 +594,7 @@ static u8 SaveDialogCB_DisplayConfirmYesNoMenu(void)
static u8 SaveDialogCB_ProcessConfirmYesNoMenu(void)
{
- switch (ProcessMenuInputNoWrap_())
+ switch (Menu_ProcessInputNoWrap_())
{
case 0: //YES
HideSaveDialog();
@@ -640,7 +640,7 @@ static u8 SaveDialogCB_DisplayOverwriteYesNoMenu(void)
static u8 SaveDialogCB_ProcessOverwriteYesNoMenu(void)
{
- switch (ProcessMenuInputNoWrap_())
+ switch (Menu_ProcessInputNoWrap_())
{
case 0: //YES
HideSaveDialog();
@@ -774,7 +774,7 @@ static bool32 sub_80719FC(u8 *step)
dp12_8087EA4();
break;
case 2:
- SetUpWindowConfig(&gWindowTemplate_81E6CE4);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6CE4);
InitMenuWindow(&gWindowTemplate_81E6CE4);
REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_BG0_ON;
break;
diff --git a/src/field/starter_choose.c b/src/field/starter_choose.c
index 9b644c6cb..91b706e78 100644
--- a/src/field/starter_choose.c
+++ b/src/field/starter_choose.c
@@ -294,7 +294,7 @@ void CB2_ChooseStarter(void)
LoadCompressedObjectPic(&gUnknown_083F7794[0]);
LoadCompressedObjectPic(&gUnknown_083F77A4[0]);
LoadSpritePalettes(gUnknown_083F77B4);
- SetUpWindowConfig(&gWindowTemplate_81E6C3C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C);
InitMenuWindow(&gWindowTemplate_81E6CE4);
BeginNormalPaletteFade(-1, 0, 0x10, 0, 0);
@@ -435,7 +435,7 @@ static void Task_StarterChoose5(u8 taskId)
{
u8 spriteId;
- switch (ProcessMenuInputNoWrap_())
+ switch (Menu_ProcessInputNoWrap_())
{
case 0: // YES
//Return the starter choice and exit.
diff --git a/src/field/trader.c b/src/field/trader.c
index eb0c8a934..b4732ab15 100644
--- a/src/field/trader.c
+++ b/src/field/trader.c
@@ -135,7 +135,7 @@ void sub_8109B34(u8 taskId, u8 decorationId)
gSpecialVar_0x8004 = decorationId;
}
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(0, 1, 12, 12);
DestroyTask(taskId);
EnableBothScriptContexts();
@@ -215,7 +215,7 @@ void ScrSpecial_TraderMenuGiveDecoration(void)
void sub_8109D04(u8 taskId)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(0, 0, 29, 19);
DestroyVerticalScrollIndicator(0);
DestroyVerticalScrollIndicator(1);
@@ -237,7 +237,7 @@ void sub_8109D04(u8 taskId)
void sub_8109DAC(u8 taskId)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(0, 0, 29, 19);
gSpecialVar_0x8006 = 0;
DestroyTask(taskId);
diff --git a/src/field/tv.c b/src/field/tv.c
index e88e3c72b..e1eade130 100644
--- a/src/field/tv.c
+++ b/src/field/tv.c
@@ -864,7 +864,7 @@ void PutPokemonTodayCaughtOnAir(void)
sub_80BE138((TVShow *)pokemonToday);
pokemonToday->language = GAME_LANGUAGE;
pokemonToday->language2 = sub_80BDEAC(pokemonToday->nickname);
- StripExtCtrlCodes(pokemonToday->nickname);
+ Text_StripExtCtrlCodes(pokemonToday->nickname);
}
}
}
@@ -966,7 +966,7 @@ void InterviewAfter_BravoTrainerPokemonProfile(void)
sub_80BE160((TVShow *)bravoTrainerNew);
bravoTrainerNew->language = GAME_LANGUAGE;
bravoTrainerNew->var1f = sub_80BDEAC(bravoTrainerNew->pokemonNickname);
- StripExtCtrlCodes(bravoTrainerNew->pokemonNickname);
+ Text_StripExtCtrlCodes(bravoTrainerNew->pokemonNickname);
}
}
@@ -1075,7 +1075,7 @@ void sub_80BE478(void)
sub_80BE160((TVShow *)nameRaterShow);
nameRaterShow->language = GAME_LANGUAGE;
nameRaterShow->pokemonNameLanguage = sub_80BDEAC(nameRaterShow->pokemonName);
- StripExtCtrlCodes(nameRaterShow->pokemonName);
+ Text_StripExtCtrlCodes(nameRaterShow->pokemonName);
}
}
@@ -1138,7 +1138,7 @@ void InterviewAfter_PkmnFanClubOpinions(void)
sub_80BE160((TVShow *)fanclubOpinions);
fanclubOpinions->language = GAME_LANGUAGE;
fanclubOpinions->var0E = sub_80BDEAC(fanclubOpinions->var10);
- StripExtCtrlCodes(fanclubOpinions->var10);
+ Text_StripExtCtrlCodes(fanclubOpinions->var10);
}
void InterviewAfter_DummyShow4(void)
diff --git a/src/field/use_pokeblock.c b/src/field/use_pokeblock.c
index a4a36e40a..9363498ba 100644
--- a/src/field/use_pokeblock.c
+++ b/src/field/use_pokeblock.c
@@ -228,7 +228,7 @@ static void sub_8136294(void)
gUnknown_02039304->unk50++;
break;
case 3:
- SetUpWindowConfig(&gWindowTemplate_81E7080);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E7080);
gUnknown_02039304->unk50++;
break;
case 4:
diff --git a/src/field/wallclock.c b/src/field/wallclock.c
index 8620ad9f0..4f2a6dccd 100644
--- a/src/field/wallclock.c
+++ b/src/field/wallclock.c
@@ -236,7 +236,7 @@ static void LoadWallClockGraphics(void)
FreeAllSpritePalettes();
LoadCompressedObjectPic(&gUnknown_083F7A90[0]);
LoadSpritePalettes(gUnknown_083F7AA0);
- SetUpWindowConfig(&gWindowTemplate_81E6C3C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C);
InitMenuWindow(&gWindowTemplate_81E6CE4);
}
@@ -417,7 +417,7 @@ static void Task_SetClock3(u8 taskId)
Menu_DrawStdWindowFrame(2, 16, 27, 19);
Menu_PrintText(gOtherText_CorrectTimePrompt, 3, 17);
Menu_DrawStdWindowFrame(23, 8, 29, 13);
- PrintMenuItems(24, 9, 2, gMenuYesNoItems);
+ Menu_PrintItems(24, 9, 2, gMenuYesNoItems);
InitMenu(0, 24, 9, 2, 1, 5);
gTasks[taskId].func = Task_SetClock4;
}
@@ -425,7 +425,7 @@ static void Task_SetClock3(u8 taskId)
//Get menu selection
static void Task_SetClock4(u8 taskId)
{
- switch (ProcessMenuInputNoWrap_())
+ switch (Menu_ProcessInputNoWrap_())
{
case 0: //YES
PlaySE(SE_SELECT);
@@ -433,7 +433,7 @@ static void Task_SetClock4(u8 taskId)
return;
case -1: //B button
case 1: //NO
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
PlaySE(SE_SELECT);
Menu_EraseWindowRect(23, 8, 29, 13);
Menu_EraseWindowRect(2, 16, 27, 19);
diff --git a/src/pokemon/learn_move.c b/src/pokemon/learn_move.c
index eae1c0b4e..356a31b00 100644
--- a/src/pokemon/learn_move.c
+++ b/src/pokemon/learn_move.c
@@ -268,11 +268,11 @@ void CB2_InitLearnMove(void)
sub_8133558();
SetVBlankCallback(VBlankCB_LearnMove);
- SetUpWindowConfig(&gWindowTemplate_81E7240);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E7240);
InitMenuWindow(&gWindowTemplate_81E7240);
Menu_EraseScreen();
- SetUpWindowConfig(&gWindowTemplate_81E6CE4);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6CE4);
InitMenuWindow(&gWindowTemplate_81E6CE4);
Menu_EraseScreen();
@@ -302,11 +302,11 @@ void sub_81327A4(void)
sLearnMoveStruct->unk2C6 = gSpecialVar_0x8005;
SetVBlankCallback(VBlankCB_LearnMove);
- SetUpWindowConfig(&gWindowTemplate_81E7240);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E7240);
InitMenuWindow(&gWindowTemplate_81E7240);
Menu_EraseScreen();
- SetUpWindowConfig(&gWindowTemplate_81E6CE4);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6CE4);
InitMenuWindow(&gWindowTemplate_81E6CE4);
Menu_EraseScreen();
@@ -333,7 +333,7 @@ void CB2_LearnMove(void)
if (sLearnMoveStruct->unk1D)
{
sLearnMoveStruct->unk1D = FALSE;
- sub_814AD7C(0x58, (sLearnMoveStruct->unk18 * 2 + 1) * 8);
+ MenuCursor_SetPos814AD7C(0x58, (sLearnMoveStruct->unk18 * 2 + 1) * 8);
}
if (sLearnMoveStruct->unk1E != 0)
{
@@ -409,7 +409,7 @@ void LearnMoveMain(void)
break;
case 9:
{
- s8 selection = ProcessMenuInputNoWrap_();
+ s8 selection = Menu_ProcessInputNoWrap_();
if (selection == 0)
{
@@ -444,7 +444,7 @@ void LearnMoveMain(void)
break;
case 13:
{
- s8 selection = ProcessMenuInputNoWrap_();
+ s8 selection = Menu_ProcessInputNoWrap_();
if (selection == 0)
{
@@ -475,7 +475,7 @@ void LearnMoveMain(void)
break;
case 18:
{
- s8 var = ProcessMenuInputNoWrap_();
+ s8 var = Menu_ProcessInputNoWrap_();
if (var == 0)
{
@@ -503,7 +503,7 @@ void LearnMoveMain(void)
break;
case 26:
{
- s8 var = ProcessMenuInputNoWrap_();
+ s8 var = Menu_ProcessInputNoWrap_();
if (var == 0)
{
diff --git a/src/pokemon/mail.c b/src/pokemon/mail.c
index cd1083790..ab43c033a 100644
--- a/src/pokemon/mail.c
+++ b/src/pokemon/mail.c
@@ -354,7 +354,7 @@ static u8 sub_80F8A28(void)
RETURN_UP_STATE;
case 6:
- SetUpWindowConfig(&gWindowTemplate_81E6DFC);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6DFC);
RETURN_UP_STATE;
case 7:
diff --git a/src/pokemon/mon_markings.c b/src/pokemon/mon_markings.c
index eeefa8431..3734856b8 100644
--- a/src/pokemon/mon_markings.c
+++ b/src/pokemon/mon_markings.c
@@ -566,8 +566,8 @@ void sub_80F761C(s16 x, s16 y, u16 baseTileTag, u16 basePaletteTag)
}
sMenu->cursorBaseY = y + 8;
- sub_814A5C0(0, basePaletteTag + 1, 15, 0, 0x30);
- sub_814A880(x + 8, sMenu->cursorBaseY);
+ MenuCursor_Create814A5C0(0, basePaletteTag + 1, 15, 0, 0x30);
+ MenuCursor_SetPos814A880(x + 8, sMenu->cursorBaseY);
sub_814AABC(sub_80F7908);
}
diff --git a/src/pokemon/pokeblock_feed.c b/src/pokemon/pokeblock_feed.c
index 2ed404327..194636e4d 100644
--- a/src/pokemon/pokeblock_feed.c
+++ b/src/pokemon/pokeblock_feed.c
@@ -530,7 +530,7 @@ static bool8 TransitionToPokeblockFeedScene(void)
gMain.state++;
break;
case 4:
- SetUpWindowConfig(&gWindowTemplate_81E6E50);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6E50);
gMain.state++;
break;
case 5:
diff --git a/src/pokemon/pokedex.c b/src/pokemon/pokedex.c
index b7081f35d..48ce26bb8 100644
--- a/src/pokemon/pokedex.c
+++ b/src/pokemon/pokedex.c
@@ -1425,7 +1425,7 @@ void CB2_InitPokedex(void)
ResetPaletteFade();
FreeAllSpritePalettes();
gReservedSpritePaletteCount = 8;
- SetUpWindowConfig(&gWindowTemplate_81E7048);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E7048);
InitMenuWindow(&gWindowTemplate_81E7048);
gMain.state++;
break;
@@ -1937,7 +1937,7 @@ static bool8 sub_808D344(u8 a)
gMain.state++;
break;
case 2:
- SetUpWindowConfig(&gWindowTemplate_81E7048);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E7048);
InitMenuWindow(&gWindowTemplate_81E7048);
LZ77UnCompVram(gUnknown_0839FA7C, (void *)(VRAM + 0xFF80));
gMain.state++;
@@ -2283,7 +2283,7 @@ static u8 sub_808DFE4(u16 num, u8 b, u8 c)
text[i] = CHAR_HYPHEN;
break;
}
- MenuPrint_PixelCoords(text, (b - 0x11) * 8 + 0xFC, c * 8, 0);
+ Menu_PrintTextPixelCoords(text, (b - 0x11) * 8 + 0xFC, c * 8, 0);
return i;
}
@@ -2951,7 +2951,7 @@ static void Task_InitPageScreenMultistep(u8 taskId)
gMain.state++;
break;
case 3:
- SetUpWindowConfig(&gWindowTemplate_81E7064);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E7064);
InitMenuWindow(&gWindowTemplate_81E7064);
gMain.state++;
break;
@@ -3205,7 +3205,7 @@ static void Task_InitCryScreenMultistep(u8 taskId)
gMain.state++;
break;
case 3:
- SetUpWindowConfig(&gWindowTemplate_81E702C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E702C);
InitMenuWindow(&gWindowTemplate_81E702C);
ResetPaletteFade();
gMain.state++;
@@ -3394,7 +3394,7 @@ static void Task_InitSizeScreenMultistep(u8 taskId)
{
u8 string[40]; //I hope this is the correct size
- SetUpWindowConfig(&gWindowTemplate_81E702C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E702C);
InitMenuWindow(&gWindowTemplate_81E702C);
string[0] = EOS;
StringAppend(string, gDexText_SizeComparedTo);
@@ -3841,7 +3841,7 @@ static void sub_8090750(u8 taskId)
gTasks[taskId].data[0]++;
break;
case 2:
- SetUpWindowConfig(&gWindowTemplate_81E7064);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E7064);
InitMenuWindow(&gWindowTemplate_81E7064);
DmaClear16(3, (void *)(VRAM + 0xC000), 0x200);
gTasks[taskId].data[0]++;
@@ -4770,7 +4770,7 @@ static void sub_8091E54(u8 taskId)
}
break;
case 1:
- SetUpWindowConfig(&gWindowTemplate_81E7064);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E7064);
InitMenuWindow(&gWindowTemplate_81E7064);
LoadCompressedObjectPic(&gUnknown_083A05CC[0]);
LoadSpritePalettes(gUnknown_083A05DC);
@@ -4997,7 +4997,7 @@ static void sub_8092508(u8 taskId)
static void sub_80925B4(u16 a, int unused)
{
- sub_814AD7C(0x90, (a * 2 + 1) * 8);
+ MenuCursor_SetPos814AD7C(0x90, (a * 2 + 1) * 8);
}
static void sub_80925CC(u8 taskId)
@@ -5305,29 +5305,29 @@ static void sub_8092B68(u8 taskId)
var = gTasks[taskId].data[6] + gTasks[taskId].data[7];
StringCopy(gStringVar1, gUnknown_083B5910[var].text2);
- MenuPrint_PixelCoords(gUnknown_083B5AB2, 45, 16, 1);
+ Menu_PrintTextPixelCoords(gUnknown_083B5AB2, 45, 16, 1);
var = gTasks[taskId].data[8] + gTasks[taskId].data[9];
StringCopy(gStringVar1, gUnknown_083B5968[var].text2);
- MenuPrint_PixelCoords(gUnknown_083B5AB2, 45, 32, 1);
+ Menu_PrintTextPixelCoords(gUnknown_083B5AB2, 45, 32, 1);
var = gTasks[taskId].data[10] + gTasks[taskId].data[11];
StringCopy(gStringVar1, gUnknown_083B59C8[var].text2);
- MenuPrint_PixelCoords(gUnknown_083B5AAC, 45, 48, 1);
+ Menu_PrintTextPixelCoords(gUnknown_083B5AAC, 45, 48, 1);
var = gTasks[taskId].data[12] + gTasks[taskId].data[13];
StringCopy(gStringVar1, gUnknown_083B59C8[var].text2);
- MenuPrint_PixelCoords(gUnknown_083B5AAC, 93, 48, 1);
+ Menu_PrintTextPixelCoords(gUnknown_083B5AAC, 93, 48, 1);
var = gTasks[taskId].data[4] + gTasks[taskId].data[5];
StringCopy(gStringVar1, gUnknown_083B58D8[var].text2);
- MenuPrint_PixelCoords(gUnknown_083B5AB2, 45, 64, 1);
+ Menu_PrintTextPixelCoords(gUnknown_083B5AB2, 45, 64, 1);
if (IsNationalPokedexEnabled())
{
var = gTasks[taskId].data[2] + gTasks[taskId].data[3];
StringCopy(gStringVar1, gUnknown_083B58C0[var].text2);
- MenuPrint_PixelCoords(gUnknown_083B5AB2, 45, 80, 1);
+ Menu_PrintTextPixelCoords(gUnknown_083B5AB2, 45, 80, 1);
}
}
diff --git a/src/pokemon/pokemon_1.c b/src/pokemon/pokemon_1.c
index f4d227f7f..bfd0bc972 100644
--- a/src/pokemon/pokemon_1.c
+++ b/src/pokemon/pokemon_1.c
@@ -308,7 +308,7 @@ void sub_803ADE8(struct Pokemon *mon, struct UnknownPokemonStruct *src)
language = GAME_LANGUAGE;
SetMonData(mon, MON_DATA_LANGUAGE, &language);
- StripExtCtrlCodes(nickname);
+ Text_StripExtCtrlCodes(nickname);
SetMonData(mon, MON_DATA_NICKNAME, nickname);
SetMonData(mon, MON_DATA_FRIENDSHIP, &src->friendship);
SetMonData(mon, MON_DATA_HP_EV, &src->hpEV);
diff --git a/src/pokemon/pokemon_menu.c b/src/pokemon/pokemon_menu.c
index da9a18148..70234ac48 100644
--- a/src/pokemon/pokemon_menu.c
+++ b/src/pokemon/pokemon_menu.c
@@ -230,7 +230,7 @@ static void sub_8089BDC(u8 arg0, u8 arg1, u8 arg2, u8 noOfOptions, const struct
{
PrintPartyMenuPromptText(5, arg6);
Menu_DrawStdWindowFrame(arg0, arg1, arg0 + arg2, (noOfOptions * 2) + arg1 + 1);
- PrintMenuItemsReordered(arg0 + 1, arg1 + 1, noOfOptions, menuActions, order);
+ Menu_PrintItemsReordered(arg0 + 1, arg1 + 1, noOfOptions, menuActions, order);
}
void sub_8089C50(u8 arg0, u8 arg1, u8 arg2, u8 noOfOptions, const struct MenuAction2 *menuActions, const u8 *order)
@@ -368,7 +368,7 @@ void DoPokemonMenu_Switch(u8 taskID)
static void PokemonMenu_Switch(u8 taskID)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
ewram01000.unkC = sub_806CD5C;
ewram01000.array[53553] = 1;
DoPokemonMenu_Switch(taskID);
@@ -407,7 +407,7 @@ static void sub_808A100(u8 taskID)
static void PokemonMenu_Item(u8 taskID)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
sPokeMenuCursorPos = 0;
Menu_EraseWindowRect(19, 0, 29, 19);
gTasks[taskID].func = sub_808A100;
@@ -600,7 +600,7 @@ static void sub_808A678(u8 taskID)
static void PokemonMenu_TakeItem(u8 taskID)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(19, 0, 29, 19);
sub_806D5A4();
PartyMenuTryGiveMonHeldItem_806ECE8(taskID, sub_808A678);
@@ -608,7 +608,7 @@ static void PokemonMenu_TakeItem(u8 taskID)
static void PokemonMenu_TakeMail(u8 taskID)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
Menu_EraseWindowRect(19, 0, 29, 19);
sub_806D5A4();
DoTakeMail(taskID, sub_808A678);
@@ -616,7 +616,7 @@ static void PokemonMenu_TakeMail(u8 taskID)
static void PokemonMenu_Mail(u8 taskID)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
sPokeMenuCursorPos = 0;
Menu_EraseWindowRect(19, 0, 29, 19);
ShowPartyPopupMenu(0, &sUnknown_0839F584, (void*) sPokemonMenuActions, 0);
@@ -686,14 +686,14 @@ static void sub_808A8D4(u8 taskID)
static void PokemonMenu_Cancel(u8 taskID)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
PlaySE(SE_SELECT);
sub_808A8D4(taskID);
}
static void PokemonMenu_CancelSubmenu(u8 taskID)
{
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
PlaySE(SE_SELECT);
Menu_EraseWindowRect(19, 0, 29, 19);
sub_806D5A4();
@@ -711,7 +711,7 @@ static void PokemonMenu_FieldMove(u8 taskID)
{
s16* data = gTasks[taskID].data;
- HandleDestroyMenuCursors();
+ Menu_DestroyCursor();
tFieldMoveId = sPokeMenuOptionsOrder[sPokeMenuCursorPos] - POKEMENU_FIRST_FIELD_MOVE_ID;
if (sub_80F9344() == TRUE)
{
diff --git a/src/pokemon/pokemon_summary_screen.c b/src/pokemon/pokemon_summary_screen.c
index e448c9ed3..d98383c6d 100644
--- a/src/pokemon/pokemon_summary_screen.c
+++ b/src/pokemon/pokemon_summary_screen.c
@@ -718,7 +718,7 @@ bool8 sub_809DA84(void)
gMain.state++;
break;
case 5:
- SetUpWindowConfig(&gWindowTemplate_81E6E6C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6E6C);
gMain.state++;
break;
case 6:
@@ -2716,7 +2716,7 @@ static void sub_809FF64(struct Pokemon *mon)
*buffer++ = CHAR_SLASH;
buffer = sub_8072C14(buffer, GetMonData(mon, MON_DATA_MAX_HP), 48, 1);
- MenuPrint_PixelCoords(gStringVar1, 126, 56, 1);
+ Menu_PrintTextPixelCoords(gStringVar1, 126, 56, 1);
}
static void sub_80A0090(struct Pokemon *mon)
@@ -3127,7 +3127,7 @@ bool8 PokemonSummaryScreen_CheckOT(struct Pokemon *mon)
u8 enemyId = GetMultiplayerId() ^ 1;
trainerId = gLinkPlayers[enemyId].trainerId & 0xFFFF;
StringCopy(gStringVar1, gLinkPlayers[enemyId].name);
- StripExtCtrlCodes(gStringVar1);
+ Text_StripExtCtrlCodes(gStringVar1);
}
else
{
@@ -5295,7 +5295,7 @@ u8 *sub_80A1E9C(u8 *dest, const u8 *src, u8 id)
static void sub_80A1EF8(const u8 *text, u8 id, u8 left, u16 top, s32 e)
{
sub_80A1E9C(gStringVar4, text, id);
- MenuPrint_PixelCoords(gStringVar4, left, top, (bool8)e);
+ Menu_PrintTextPixelCoords(gStringVar4, left, top, (bool8)e);
}
static void sub_80A1F48(const u8 *text, u8 id, u8 c, u8 d, u16 e)
diff --git a/src/pokenav_before.c b/src/pokenav_before.c
index 43c9475ca..3b534c96c 100644
--- a/src/pokenav_before.c
+++ b/src/pokenav_before.c
@@ -3268,7 +3268,7 @@ bool8 sub_80EF284(u8 a)
sub_80EEDE8();
break;
case 1:
- SetUpWindowConfig(&gWindowTemplate_81E7224);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E7224);
break;
case 2:
MultistepInitMenuWindowBegin(&gWindowTemplate_81E7224);
@@ -3660,7 +3660,7 @@ bool8 sub_80EF874(void)
sub_80EEDE8();
break;
case 1:
- SetUpWindowConfig(&gWindowTemplate_81E7224);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E7224);
break;
case 2:
MultistepInitMenuWindowBegin(&gWindowTemplate_81E7224);
@@ -3972,7 +3972,7 @@ bool8 sub_80EFF68(void)
gUnknown_083DFEC4->unkD162[0] = 11;
break;
case 1:
- SetUpWindowConfig(&gWindowTemplate_81E7080);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E7080);
break;
case 2:
MultistepInitMenuWindowBegin(&gWindowTemplate_81E7080);
@@ -4086,7 +4086,7 @@ bool8 sub_80F02A0(void)
gUnknown_083DFEC4->unkD162[0] = 11;
break;
case 1:
- SetUpWindowConfig(&gWindowTemplate_81E70D4);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E70D4);
break;
case 2:
MultistepInitMenuWindowBegin(&gWindowTemplate_81E70D4);
@@ -4269,7 +4269,7 @@ _080F033C: .4byte 0x000087c8\n\
_080F0340: .4byte 0x0000d162\n\
_080F0344:\n\
ldr r0, _080F034C @ =gWindowTemplate_81E70D4\n\
- bl SetUpWindowConfig\n\
+ bl Text_LoadWindowTemplate\n\
b _080F0618\n\
.align 2, 0\n\
_080F034C: .4byte gWindowTemplate_81E70D4\n\
diff --git a/src/roulette.c b/src/roulette.c
index 950cbdbb1..e88c36c01 100644
--- a/src/roulette.c
+++ b/src/roulette.c
@@ -596,7 +596,7 @@ void sub_8115384(void)
gMain.state++;
break;
case 0x2:
- SetUpWindowConfig(&gWindowTemplate_81E6C3C);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C);
InitMenuWindow(&gWindowTemplate_81E6CE4);
LoadPalette(&gUnknown_083F86BC, 0x0, 0x1C0);
gMain.state++;
diff --git a/src/scene/berry_blender.c b/src/scene/berry_blender.c
index 32a48fd36..b59d02939 100644
--- a/src/scene/berry_blender.c
+++ b/src/scene/berry_blender.c
@@ -198,8 +198,8 @@ void m4aMPlayTempoControl(struct MusicPlayerInfo *mplayInfo, u16 tempo);
void m4aMPlayStop(struct MusicPlayerInfo *mplayInfo);
void sub_80A6978(void);
u8 sub_80A7DEC(u8 berryId, u8 x, u8 y, bool8 animate);
-void sub_814A880(u8 a1, u8 a2);
-u8 sub_814A5C0(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5);
+void MenuCursor_SetPos814A880(u8 a1, u8 a2);
+u8 MenuCursor_Create814A5C0(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5);
s8 GetFirstFreePokeblockSlot(void);
bool8 sub_810CA34(struct Pokeblock *pokeblock);
#ifdef GERMAN
@@ -957,7 +957,7 @@ static void sub_804E56C(void)
ResetSpriteData();
FreeAllSpritePalettes();
SetVBlankCallback(NULL);
- SetUpWindowConfig(&gWindowTemplate_81E6F68);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6F68);
InitMenuWindow(&gWindowTemplate_81E6F68);
gBerryBlenderData->field_0++;
gBerryBlenderData->field_140 = 0;
@@ -1135,7 +1135,7 @@ static void sub_804E9F8(void)
FreeAllSpritePalettes();
ResetTasks();
SetVBlankCallback(VBlankCB0_BerryBlender);
- SetUpWindowConfig(&gWindowTemplate_81E6F68);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6F68);
InitMenuWindow(&gWindowTemplate_81E6F68);
gLinkType = 0x4422;
gBerryBlenderData->field_0++;
@@ -1338,7 +1338,7 @@ static void sub_804F0F4(void)
SetVBlankCallback(VBlankCB0_BerryBlender);
- SetUpWindowConfig(&gWindowTemplate_81E6F68);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6F68);
InitMenuWindow(&gWindowTemplate_81E6F68);
gLinkType = 0x4422;
@@ -1426,7 +1426,7 @@ static void sub_804F2A8(void)
if (GetMultiplayerId() == gBerryBlenderData->field_9A[i])
stringPtr = StringCopy(stringPtr, sRedColorString);
StringCopy(stringPtr, gLinkPlayers[gBerryBlenderData->field_9A[i]].name);
- MenuPrint_PixelCoords(gStringVar1, gUnknown_082162D4[i][0] * 8 + 1, gUnknown_082162D4[i][1] * 8, 1);
+ Menu_PrintTextPixelCoords(gStringVar1, gUnknown_082162D4[i][0] * 8 + 1, gUnknown_082162D4[i][1] * 8, 1);
}
}
}
@@ -2494,14 +2494,14 @@ static void sub_8050760(void)
static void sub_80508D4(u8 value)
{
gBerryBlenderData->field_AA = value;
- sub_814A880(192, (gBerryBlenderData->field_AA * 16) + 72);
+ MenuCursor_SetPos814A880(192, (gBerryBlenderData->field_AA * 16) + 72);
}
static void sub_80508FC(void)
{
gBerryBlenderData->field_AA = 0;
Menu_DrawStdWindowFrame(23, 8, 28, 13);
- sub_814A5C0(0, -1, 12, 0x2D9F, 32);
+ MenuCursor_Create814A5C0(0, -1, 12, 0x2D9F, 32);
Menu_PrintText(gOtherText_YesNoTerminating, 24, 9);
sub_80508D4(gBerryBlenderData->field_AA);
}
@@ -3080,7 +3080,7 @@ void unref_sub_80516F8(u8 taskID)
task->data[0] = 0;
if (task->data[0] == 100)
{
- ZeroFillWindowRect(&gBerryBlenderData->field_4, 0, 0, 16, 20);
+ Text_EraseWindowRect(&gBerryBlenderData->field_4, 0, 0, 16, 20);
Menu_DrawStdWindowFrame(4, 4, 10, 12);
for (i = 0; i < 3; i++)
{
@@ -3606,7 +3606,7 @@ void unref_sub_80524BC(void)
FreeAllSpritePalettes();
ResetTasks();
SetVBlankCallback(VBlankCB1_BerryBlender);
- SetUpWindowConfig(&gWindowTemplate_81E6CE4);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6CE4);
InitMenuWindow(&gWindowTemplate_81E6CE4);
SeedRng(gMain.vblankCounter1);
REG_DISPCNT = 0x1540;
diff --git a/src/scene/contest_painting.c b/src/scene/contest_painting.c
index de9063823..401872644 100644
--- a/src/scene/contest_painting.c
+++ b/src/scene/contest_painting.c
@@ -244,7 +244,7 @@ static void HoldContestPainting(void)
static void ContestPaintingInitWindow(u8 arg0)
{
InitMenuWindow(&gWindowTemplate_81E7160);
- SetUpWindowConfig(&gWindowTemplate_81E7160);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E7160);
}
static void ContestPaintingPrintCaption(u8 contestType, u8 arg1)
@@ -291,7 +291,7 @@ static void ContestPaintingPrintCaption(u8 contestType, u8 arg1)
xPos = 3;
yPos = 14;
}
- MenuPrint_PixelCoords(gUnknown_03005E40, xPos * 8 + 1, yPos * 8, 1);
+ Menu_PrintTextPixelCoords(gUnknown_03005E40, xPos * 8 + 1, yPos * 8, 1);
}
static void ContestPaintingInitBG(void)
diff --git a/src/scene/credits.c b/src/scene/credits.c
index f113fe965..e31e2c797 100644
--- a/src/scene/credits.c
+++ b/src/scene/credits.c
@@ -474,7 +474,7 @@ void sub_81439D0(void)
taskIdC = gTasks[taskIdA].data[TDA_TASK_C_ID];
gTasks[taskIdC].data[TDC_0] = 40;
- SetUpWindowConfig(&gWindowTemplate_81E7208);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E7208);
InitMenuWindow(&gWindowTemplate_81E7208);
LoadPalette(&gUnknown_0840B7BC, 0x80, sizeof(gUnknown_0840B7BC));
diff --git a/src/scene/egg_hatch.c b/src/scene/egg_hatch.c
index e76f5b47c..e0b798aea 100644
--- a/src/scene/egg_hatch.c
+++ b/src/scene/egg_hatch.c
@@ -471,7 +471,7 @@ static void CB2_EggHatch_0(void)
gSpecialVar_0x8005 = GetCurrentMapMusic();
break;
case 1:
- SetUpWindowConfig(&gWindowTemplate_81E6F84);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6F84);
Text_InitWindowWithTemplate(&gEggHatchData->window, &gWindowTemplate_81E6F84);
gEggHatchData->tileDataStartOffset = TextWindow_SetBaseTileNum(20);
TextWindow_LoadStdFrameGraphics(&gEggHatchData->window);
@@ -633,7 +633,7 @@ static void CB2_EggHatch_1(void)
case 9:
{
s8 menuInput;
- if ((menuInput = ProcessMenuInputNoWrap_()) != -2)
+ if ((menuInput = Menu_ProcessInputNoWrap_()) != -2)
{
if (menuInput != -1 && menuInput != 1)
{
diff --git a/src/scene/evolution_scene.c b/src/scene/evolution_scene.c
index 571b8ab8d..167130aa5 100644
--- a/src/scene/evolution_scene.c
+++ b/src/scene/evolution_scene.c
@@ -197,7 +197,7 @@ void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo,
REG_WININ = 0;
REG_WINOUT = 0;
- SetUpWindowConfig(&gWindowTemplate_81E6C58);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C58);
ResetPaletteFade();
gBattle_BG0_X = 0;
@@ -306,7 +306,7 @@ static void CB2_EvolutionSceneLoadGraphics(void)
REG_WIN1V = 0;
REG_WININ = 0;
REG_WINOUT = 0;
- SetUpWindowConfig(&gWindowTemplate_81E6C58);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6C58);
ResetPaletteFade();
gBattle_BG0_X = 0;
gBattle_BG0_Y = 0;
@@ -373,7 +373,7 @@ static void CB2_TradeEvolutionSceneLoadGraphics(void)
gMain.state++;
break;
case 1:
- SetUpWindowConfig(&gWindowTemplate_81E6F84);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6F84);
Text_InitWindowWithTemplate(&gUnknown_03004828->window, &gWindowTemplate_81E6F84);
gMain.state++;
break;
@@ -1087,7 +1087,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
sEvoCursorPos = 0;
Text_InitWindow(&gUnknown_03004828->window, gOtherText_YesNoAndPlayer, gUnknown_03004828->textWindowBaseTileNum + 128, 25, 9);
Text_PrintWindow8002F44(&gUnknown_03004828->window);
- sub_814A5C0(0, 0xFFFF, 0xC, 0x2D9F, 0x20);
+ MenuCursor_Create814A5C0(0, 0xFFFF, 0xC, 0x2D9F, 0x20);
sub_81150D8();
gTasks[taskID].tLearnMoveState++;
sEvoCursorPos = 0;
@@ -1110,7 +1110,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
}
if (gMain.newKeys & A_BUTTON)
{
- ZeroFillWindowRect(&gUnknown_03004828->window, 0x18, 8, 0x1D, 0xD);
+ Text_EraseWindowRect(&gUnknown_03004828->window, 0x18, 8, 0x1D, 0xD);
DestroyMenuCursor();
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[292]);
Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
@@ -1126,7 +1126,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
}
if (gMain.newKeys & B_BUTTON)
{
- ZeroFillWindowRect(&gUnknown_03004828->window, 0x18, 8, 0x1D, 0xD);
+ Text_EraseWindowRect(&gUnknown_03004828->window, 0x18, 8, 0x1D, 0xD);
DestroyMenuCursor();
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[292]);
Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
@@ -3955,7 +3955,7 @@ static void VBlankCB_TradeEvolutionScene(void)
static void sub_81150D8(void)
{
- sub_814A880(200, 72 + (sEvoCursorPos * 16));
+ MenuCursor_SetPos814A880(200, 72 + (sEvoCursorPos * 16));
}
static void EvoDummyFunc2(void)
diff --git a/src/scene/hall_of_fame.c b/src/scene/hall_of_fame.c
index 4f8124ace..948c288ff 100644
--- a/src/scene/hall_of_fame.c
+++ b/src/scene/hall_of_fame.c
@@ -582,7 +582,7 @@ static void sub_81422B8(u8 taskID)
static void sub_81422E8(u8 taskID)
{
- SetUpWindowConfig(&gWindowTemplate_81E7198);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E7198);
InitMenuWindow(&gWindowTemplate_81E7198);
gTasks[taskID].func = sub_8142320;
}
@@ -714,7 +714,7 @@ static void sub_81426F8(u8 taskID)
static void sub_8142738(u8 taskID)
{
REG_DISPCNT = 0x1940;
- SetUpWindowConfig(&gWindowTemplate_81E71B4);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E71B4);
InitMenuWindow(&gWindowTemplate_81E71B4);
gTasks[taskID].tPlayerSpriteID = HallOfFame_LoadTrainerPic(gSaveBlock2.playerGender, 120, 72, 6);
@@ -864,7 +864,7 @@ static void sub_8142A28(u8 taskID)
*(vram1 + i) = i + 3;
*(vram2 + i) = i + 20;
}
- SetUpWindowConfig(&gWindowTemplate_81E7198);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E7198);
InitMenuWindow(&gWindowTemplate_81E7198);
gTasks[taskID].func = sub_8142B04;
}
@@ -1285,7 +1285,7 @@ static void sub_8143570(void)
gReservedSpritePaletteCount = 8;
LoadCompressedObjectPic(&sHallOfFame_ConfettiSpriteSheet);
LoadCompressedObjectPalette(&sHallOfFame_ConfettiSpritePalette);
- SetUpWindowConfig(&gWindowTemplate_81E71B4);
+ Text_LoadWindowTemplate(&gWindowTemplate_81E71B4);
InitMenuWindow(&gWindowTemplate_81E71B4);
}