summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/battle/battle_2.c14
-rw-r--r--src/battle/battle_4.c12
-rw-r--r--src/battle/battle_controller_linkopponent.c2
-rw-r--r--src/battle/battle_controller_linkpartner.c2
-rw-r--r--src/battle/battle_controller_opponent.c2
-rw-r--r--src/battle/battle_controller_player.c42
-rw-r--r--src/battle/battle_controller_safari.c10
-rw-r--r--src/battle/battle_controller_wally.c12
-rw-r--r--src/battle/battle_party_menu.c6
-rw-r--r--src/battle/battle_records.c32
-rw-r--r--src/battle/reshow_battle_screen.c2
-rw-r--r--src/contest.c88
-rw-r--r--src/debug/matsuda_debug_menu.c44
-rw-r--r--src/debug/mori_debug_menu.c12
-rw-r--r--src/debug/sound_check_menu.c80
-rw-r--r--src/debug/unknown_debug_menu.c6
-rw-r--r--src/easy_chat_1.c16
-rw-r--r--src/easy_chat_2.c24
-rw-r--r--src/engine/cable_club.c6
-rw-r--r--src/engine/clear_save_data_menu.c6
-rw-r--r--src/engine/link.c6
-rw-r--r--src/engine/main_menu.c94
-rw-r--r--src/engine/menu.c150
-rw-r--r--src/engine/mystery_event_menu.c32
-rw-r--r--src/engine/naming_screen.c14
-rw-r--r--src/engine/option_menu.c34
-rw-r--r--src/engine/record_mixing.c10
-rw-r--r--src/engine/reset_rtc_screen.c22
-rw-r--r--src/engine/save_failed_screen.c32
-rw-r--r--src/engine/save_menu_util.c18
-rw-r--r--src/engine/text.c707
-rw-r--r--src/engine/text_window.c157
-rw-r--r--src/engine/trade.c118
-rw-r--r--src/engine/trainer_card.c28
-rw-r--r--src/field/berry_tag_screen.c24
-rw-r--r--src/field/braille_puzzles.c4
-rw-r--r--src/field/choose_party.c28
-rw-r--r--src/field/coins.c6
-rw-r--r--src/field/daycare.c12
-rw-r--r--src/field/decoration.c76
-rw-r--r--src/field/diploma.c2
-rw-r--r--src/field/field_message_box.c20
-rw-r--r--src/field/field_player_avatar.c18
-rw-r--r--src/field/field_region_map.c10
-rw-r--r--src/field/field_screen_effect.c4
-rw-r--r--src/field/field_specials.c54
-rw-r--r--src/field/fldeff_softboiled.c4
-rw-r--r--src/field/item_menu.c96
-rw-r--r--src/field/item_use.c18
-rw-r--r--src/field/map_name_popup.c8
-rw-r--r--src/field/mauville_man.c22
-rw-r--r--src/field/menu_helpers.c8
-rw-r--r--src/field/money.c6
-rw-r--r--src/field/party_menu.c74
-rw-r--r--src/field/player_pc.c130
-rw-r--r--src/field/pokeblock.c42
-rw-r--r--src/field/region_map.c18
-rw-r--r--src/field/scrcmd.c8
-rw-r--r--src/field/script_menu.c58
-rw-r--r--src/field/secret_base.c44
-rw-r--r--src/field/shop.c36
-rw-r--r--src/field/slot_machine.c16
-rw-r--r--src/field/start_menu.c32
-rw-r--r--src/field/starter_choose.c24
-rw-r--r--src/field/trader.c20
-rw-r--r--src/field/use_pokeblock.c22
-rw-r--r--src/field/wallclock.c10
-rw-r--r--src/pokemon/learn_move.c62
-rw-r--r--src/pokemon/mail.c6
-rw-r--r--src/pokemon/mon_markings.c2
-rw-r--r--src/pokemon/pokeblock_feed.c4
-rw-r--r--src/pokemon/pokedex.c56
-rw-r--r--src/pokemon/pokemon_menu.c44
-rw-r--r--src/pokemon/pokemon_storage_system.c4
-rw-r--r--src/pokemon/pokemon_summary_screen.c142
-rw-r--r--src/pokenav_before.c24
-rw-r--r--src/rom_800D42C.c4
-rw-r--r--src/roulette.c68
-rw-r--r--src/scene/berry_blender.c92
-rw-r--r--src/scene/credits.c2
-rw-r--r--src/scene/egg_hatch.c14
-rw-r--r--src/scene/evolution_scene.c84
-rw-r--r--src/scene/hall_of_fame.c40
-rw-r--r--src/script_pokemon_util_80C4BF0.c4
84 files changed, 1762 insertions, 1684 deletions
diff --git a/src/battle/battle_2.c b/src/battle/battle_2.c
index ae84e5585..dccf73fa8 100644
--- a/src/battle/battle_2.c
+++ b/src/battle/battle_2.c
@@ -245,9 +245,9 @@ void InitBattle(void)
gUnknown_030041B0 = 0;
gUnknown_030041B8 = 0;
gBattleTerrain = BattleSetup_GetTerrain();
- InitWindowFromConfig(&gUnknown_03004210, &gWindowConfig_81E6C58);
- InitWindowFromConfig(&gUnknown_030041D0, &gWindowConfig_81E71D0);
- InitWindowFromConfig(&gUnknown_03004250, &gWindowConfig_81E71EC);
+ Text_InitWindowWithTemplate(&gUnknown_03004210, &gWindowConfig_81E6C58);
+ Text_InitWindowWithTemplate(&gUnknown_030041D0, &gWindowConfig_81E71D0);
+ Text_InitWindowWithTemplate(&gUnknown_03004250, &gWindowConfig_81E71EC);
sub_800D6D4();
sub_800DAB8();
ResetSpriteData();
@@ -898,7 +898,7 @@ void BattleMainCB2(void)
{
AnimateSprites();
BuildOamBuffer();
- sub_800374C(&gUnknown_03004210);
+ Text_UpdateWindowInBattle(&gUnknown_03004210);
UpdatePaletteFade();
RunTasks();
}
@@ -1221,9 +1221,9 @@ void c2_8011A1C(void)
gUnknown_030041B0 = 0;
gUnknown_030041B8 = 0;
- InitWindowFromConfig(&gUnknown_03004210, &gWindowConfig_81E6C58);
- InitWindowFromConfig(&gUnknown_030041D0, &gWindowConfig_81E71D0);
- InitWindowFromConfig(&gUnknown_03004250, &gWindowConfig_81E71EC);
+ Text_InitWindowWithTemplate(&gUnknown_03004210, &gWindowConfig_81E6C58);
+ Text_InitWindowWithTemplate(&gUnknown_030041D0, &gWindowConfig_81E71D0);
+ Text_InitWindowWithTemplate(&gUnknown_03004250, &gWindowConfig_81E71EC);
sub_800D6D4();
LoadCompressedPalette(gUnknown_08D004E0, 0, 64);
sub_800D74C();
diff --git a/src/battle/battle_4.c b/src/battle/battle_4.c
index 5a20a8324..4be9b7d1c 100644
--- a/src/battle/battle_4.c
+++ b/src/battle/battle_4.c
@@ -10767,8 +10767,8 @@ void atk59_handlelearnnewmove(void)
void sub_8023A80(void)
{
sub_802BBD4(0x18, 8, 0x1D, 0xD, 0);
- InitWindow(&gUnknown_03004210, BattleText_YesNo, 0x100, 0x19, 0x9);
- sub_8002F44(&gUnknown_03004210);
+ Text_InitWindow(&gUnknown_03004210, BattleText_YesNo, 0x100, 0x19, 0x9);
+ Text_PrintWindow8002F44(&gUnknown_03004210);
sub_814A5C0(0, 0xFFFF, 0xC, 0x2D9F, 0x20);
}
@@ -11714,9 +11714,9 @@ _08024AC4:\n\
str r0, [sp]\n\
adds r0, r4, 0\n\
movs r3, 0xC\n\
- bl InitWindow\n\
+ bl Text_InitWindow\n\
adds r0, r4, 0\n\
- bl sub_8002F44\n\
+ bl Text_PrintWindow8002F44\n\
ldr r1, _08024AEC @ =gSharedMem\n\
ldr r2, _08024AF0 @ =0x0001609c\n\
adds r1, r2\n\
@@ -11835,9 +11835,9 @@ _08024BC0:\n\
str r0, [sp]\n\
adds r0, r4, 0\n\
movs r3, 0xC\n\
- bl InitWindow\n\
+ bl Text_InitWindow\n\
adds r0, r4, 0\n\
- bl sub_8002F44\n\
+ bl Text_PrintWindow8002F44\n\
ldr r1, _08024BFC @ =gSharedMem\n\
ldr r0, _08024C00 @ =0x0001609c\n\
adds r1, r0\n\
diff --git a/src/battle/battle_controller_linkopponent.c b/src/battle/battle_controller_linkopponent.c
index 54181bc21..69306b725 100644
--- a/src/battle/battle_controller_linkopponent.c
+++ b/src/battle/battle_controller_linkopponent.c
@@ -1413,7 +1413,7 @@ void LinkOpponentHandlePrintString(void)
gBattle_BG0_X = 0;
gBattle_BG0_Y = 0;
BufferStringBattle(*(u16 *)&gBattleBufferA[gActiveBank][2]);
- sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
gBattleBankFunc[gActiveBank] = sub_8037C2C;
}
diff --git a/src/battle/battle_controller_linkpartner.c b/src/battle/battle_controller_linkpartner.c
index 2c78d4a82..c86c337d9 100644
--- a/src/battle/battle_controller_linkpartner.c
+++ b/src/battle/battle_controller_linkpartner.c
@@ -1358,7 +1358,7 @@ void LinkPartnerHandlePrintString(void)
gBattle_BG0_X = 0;
gBattle_BG0_Y = 0;
BufferStringBattle(*(u16 *)&gBattleBufferA[gActiveBank][2]);
- sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
gBattleBankFunc[gActiveBank] = sub_811DFA0;
}
diff --git a/src/battle/battle_controller_opponent.c b/src/battle/battle_controller_opponent.c
index ab7b6944b..622e3e9f9 100644
--- a/src/battle/battle_controller_opponent.c
+++ b/src/battle/battle_controller_opponent.c
@@ -1407,7 +1407,7 @@ void OpponentHandlePrintString(void)
gBattle_BG0_X = 0;
gBattle_BG0_Y = 0;
BufferStringBattle(*(u16 *)&gBattleBufferA[gActiveBank][2]);
- sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
gBattleBankFunc[gActiveBank] = sub_80331D0;
}
diff --git a/src/battle/battle_controller_player.c b/src/battle/battle_controller_player.c
index f992e3e51..4bbda2afd 100644
--- a/src/battle/battle_controller_player.c
+++ b/src/battle/battle_controller_player.c
@@ -745,8 +745,8 @@ void sub_802C68C(void)
gUnknown_03004344 = gMoveSelectionCursor[gActiveBank] + 1;
sub_802E3B4(gUnknown_03004344, 27);
FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x37, 0x1C, 0x3A);
- InitWindow(&gUnknown_03004210, BattleText_SwitchWhich, 0x290, 0x17, 0x37);
- sub_8002F44(&gUnknown_03004210);
+ Text_InitWindow(&gUnknown_03004210, BattleText_SwitchWhich, 0x290, 0x17, 0x37);
+ Text_PrintWindow8002F44(&gUnknown_03004210);
gBattleBankFunc[gActiveBank] = sub_802CA60;
}
}
@@ -854,8 +854,8 @@ void sub_802CA60(void)
gMoveSelectionCursor[gActiveBank] = gUnknown_03004344;
sub_802E3B4(gMoveSelectionCursor[gActiveBank], 0);
FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x37, 0x1C, 0x3A);
- InitWindow(&gUnknown_03004210, BattleText_PP, 0x290, 0x17, 0x37);
- sub_8002F44(&gUnknown_03004210);
+ Text_InitWindow(&gUnknown_03004210, BattleText_PP, 0x290, 0x17, 0x37);
+ Text_PrintWindow8002F44(&gUnknown_03004210);
sub_802E220();
sub_802E2D4();
}
@@ -867,8 +867,8 @@ void sub_802CA60(void)
sub_802E12C(gMoveSelectionCursor[gActiveBank], BattleText_Format);
gBattleBankFunc[gActiveBank] = sub_802C68C;
FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x37, 0x1C, 0x3A);
- InitWindow(&gUnknown_03004210, BattleText_PP, 0x290, 0x17, 0x37);
- sub_8002F44(&gUnknown_03004210);
+ Text_InitWindow(&gUnknown_03004210, BattleText_PP, 0x290, 0x17, 0x37);
+ Text_PrintWindow8002F44(&gUnknown_03004210);
sub_802E220();
sub_802E2D4();
}
@@ -1557,13 +1557,13 @@ void sub_802E12C(s32 a, const u8 *b)
StringCopy(gDisplayedStringBattle, b);
StringAppend(gDisplayedStringBattle, gMoveNames[r4->moves[a]]);
- InitWindow(
+ Text_InitWindow(
&gUnknown_03004210,
gDisplayedStringBattle,
0x300 + a * 20,
(a & 1) ? 11 : 1,
(a < 2) ? 0x37 : 0x39);
- sub_8002F44(&gUnknown_03004210);
+ Text_PrintWindow8002F44(&gUnknown_03004210);
}
void sub_802E1B0(void)
@@ -1601,8 +1601,8 @@ void sub_802E220(void)
str = ConvertIntToDecimalStringN(str, r4->pp[gMoveSelectionCursor[gActiveBank]], 1, 2);
*str++ = CHAR_SLASH;
ConvertIntToDecimalStringN(str, r4->unkC[gMoveSelectionCursor[gActiveBank]], 1, 2);
- InitWindow(&gUnknown_03004210, gDisplayedStringBattle, 0x2A2, 0x19, 0x37);
- sub_8002F44(&gUnknown_03004210);
+ Text_InitWindow(&gUnknown_03004210, gDisplayedStringBattle, 0x2A2, 0x19, 0x37);
+ Text_PrintWindow8002F44(&gUnknown_03004210);
}
}
@@ -1614,7 +1614,7 @@ void sub_802E2D4(void)
if (gBattleBufferA[gActiveBank][2] == 1)
{
FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x37, 0x1C, 0x3A);
- InitWindow(&gUnknown_03004210, BattleText_ForgetMove, 0x290, 0x13, 0x37);
+ Text_InitWindow(&gUnknown_03004210, BattleText_ForgetMove, 0x290, 0x13, 0x37);
}
else
{
@@ -1624,9 +1624,9 @@ 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);
- InitWindow(&gUnknown_03004210, gDisplayedStringBattle, 0x2C0, 0x17, 0x39);
+ Text_InitWindow(&gUnknown_03004210, gDisplayedStringBattle, 0x2C0, 0x17, 0x39);
}
- sub_8002F44(&gUnknown_03004210);
+ Text_PrintWindow8002F44(&gUnknown_03004210);
}
const u8 gUnknown_081FAE89[][2] =
@@ -1697,7 +1697,7 @@ void b_link_standby_message(void)
{
gBattle_BG0_X = 0;
gBattle_BG0_Y = 0;
- sub_8002EB0(&gUnknown_03004210, BattleText_LinkStandby, 0x90, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, BattleText_LinkStandby, 0x90, 2, 15);
}
}
@@ -2562,7 +2562,7 @@ void PlayerHandlePrintString(void)
gBattle_BG0_X = 0;
gBattle_BG0_Y = 0;
BufferStringBattle(*(u16 *)&gBattleBufferA[gActiveBank][2]);
- sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 0x90, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 0x90, 2, 15);
gBattleBankFunc[gActiveBank] = sub_802DF18;
}
@@ -2585,8 +2585,8 @@ void PlayerHandlecmd18(void)
gBattleBankFunc[gActiveBank] = sub_802C098;
- InitWindow(&gUnknown_03004210, BattleText_MenuOptions, 400, 18, 35);
- sub_8002F44(&gUnknown_03004210);
+ Text_InitWindow(&gUnknown_03004210, BattleText_MenuOptions, 400, 18, 35);
+ Text_PrintWindow8002F44(&gUnknown_03004210);
sub_814A5C0(0, 0xFFFF, 12, 11679, 0);
for (r4 = 0; r4 < 4; r4++)
@@ -2595,8 +2595,8 @@ void PlayerHandlecmd18(void)
sub_802E3E4(gActionSelectionCursor[gActiveBank], 0);
StrCpyDecodeToDisplayedStringBattle(BattleText_OtherMenu);
- InitWindow(&gUnknown_03004210, gDisplayedStringBattle, SUB_803037C_TILE_DATA_OFFSET, 2, 35);
- sub_8002F44(&gUnknown_03004210);
+ Text_InitWindow(&gUnknown_03004210, gDisplayedStringBattle, SUB_803037C_TILE_DATA_OFFSET, 2, 35);
+ Text_PrintWindow8002F44(&gUnknown_03004210);
}
void PlayerHandlecmd19()
@@ -2619,8 +2619,8 @@ void sub_80304A8(void)
sub_802E3B4(gMoveSelectionCursor[gActiveBank], 0);
if (gBattleBufferA[gActiveBank][2] != 1)
{
- InitWindow(&gUnknown_03004210, BattleText_PP, 656, 23, 55);
- sub_8002F44(&gUnknown_03004210);
+ Text_InitWindow(&gUnknown_03004210, BattleText_PP, 656, 23, 55);
+ Text_PrintWindow8002F44(&gUnknown_03004210);
}
sub_802E220();
sub_802E2D4();
diff --git a/src/battle/battle_controller_safari.c b/src/battle/battle_controller_safari.c
index 0a629ba4d..72a0cc32c 100644
--- a/src/battle/battle_controller_safari.c
+++ b/src/battle/battle_controller_safari.c
@@ -453,7 +453,7 @@ void SafariHandlePrintString(void)
gBattle_BG0_X = 0;
gBattle_BG0_Y = 0;
BufferStringBattle(*(u16 *)&gBattleBufferA[gActiveBank][2]);
- sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
gBattleBankFunc[gActiveBank] = sub_812B694;
}
@@ -476,8 +476,8 @@ void SafariHandlecmd18(void)
FillWindowRect_DefaultPalette(&gUnknown_03004210, 10, 2, 35, 16, 36);
gBattleBankFunc[gActiveBank] = bx_battle_menu_t6_2;
- InitWindow(&gUnknown_03004210, BattleText_MenuOptionsSafari, 400, 18, 35);
- sub_8002F44(&gUnknown_03004210);
+ Text_InitWindow(&gUnknown_03004210, BattleText_MenuOptionsSafari, 400, 18, 35);
+ Text_PrintWindow8002F44(&gUnknown_03004210);
sub_814A5C0(0, 0xFFFF, 12, 11679, 0);
for (i = 0; i < 4; i++)
@@ -486,8 +486,8 @@ void SafariHandlecmd18(void)
sub_802E3E4(gActionSelectionCursor[gActiveBank], 0);
StrCpyDecodeToDisplayedStringBattle(BattleText_PlayerMenu);
- InitWindow(&gUnknown_03004210, gDisplayedStringBattle, SUB_812BB10_TILE_DATA_OFFSET, 2, 35);
- sub_8002F44(&gUnknown_03004210);
+ Text_InitWindow(&gUnknown_03004210, gDisplayedStringBattle, SUB_812BB10_TILE_DATA_OFFSET, 2, 35);
+ Text_PrintWindow8002F44(&gUnknown_03004210);
}
void SafariHandlecmd19(void)
diff --git a/src/battle/battle_controller_wally.c b/src/battle/battle_controller_wally.c
index bd2b4a45b..6a9e8071e 100644
--- a/src/battle/battle_controller_wally.c
+++ b/src/battle/battle_controller_wally.c
@@ -1246,7 +1246,7 @@ void WallyHandlePrintString(void)
if (*ptr == 2)
DestroyMenuCursor();
BufferStringBattle(*ptr);
- sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 0x90, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 0x90, 2, 15);
gBattleBankFunc[gActiveBank] = sub_8137454;
}
@@ -1268,19 +1268,19 @@ void WallyHandlecmd18(void)
FillWindowRect_DefaultPalette(&gUnknown_03004210, 10, 2, 15, 27, 18);
FillWindowRect_DefaultPalette(&gUnknown_03004210, 10, 2, 35, 16, 36);
gBattleBankFunc[gActiveBank] = sub_81372BC;
- InitWindow(&gUnknown_03004210, BattleText_MenuOptions, 400, 18, 35);
- sub_8002F44(&gUnknown_03004210);
+ Text_InitWindow(&gUnknown_03004210, BattleText_MenuOptions, 400, 18, 35);
+ Text_PrintWindow8002F44(&gUnknown_03004210);
sub_814A5C0(0, 0xFFFF, 12, 0x2D9F, 0);
for (i = 0; i < 4; i++)
nullsub_8(i);
sub_802E3E4(0, 0);
StrCpyDecodeToDisplayedStringBattle(BattleText_WallyMenu);
#ifdef ENGLISH
- InitWindow(&gUnknown_03004210, gDisplayedStringBattle, 440, 2, 35);
+ Text_InitWindow(&gUnknown_03004210, gDisplayedStringBattle, 440, 2, 35);
#else
- InitWindow(&gUnknown_03004210, gDisplayedStringBattle, 444, 2, 35);
+ Text_InitWindow(&gUnknown_03004210, gDisplayedStringBattle, 444, 2, 35);
#endif
- sub_8002F44(&gUnknown_03004210);
+ Text_PrintWindow8002F44(&gUnknown_03004210);
}
void WallyHandlecmd19(void)
diff --git a/src/battle/battle_party_menu.c b/src/battle/battle_party_menu.c
index 7bce00d82..67f6e24ef 100644
--- a/src/battle/battle_party_menu.c
+++ b/src/battle/battle_party_menu.c
@@ -583,13 +583,13 @@ static void Task_HandlePopupMenuInput(u8 taskId)
if (gMain.newAndRepeatedKeys & DPAD_UP)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(-1);
+ Menu_MoveCursor(-1);
return;
}
if (gMain.newAndRepeatedKeys & DPAD_DOWN)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(1);
+ Menu_MoveCursor(1);
return;
}
if (gMain.newKeys & A_BUTTON)
@@ -598,7 +598,7 @@ static void Task_HandlePopupMenuInput(u8 taskId)
func = PartyMenuGetPopupMenuFunc(gTasks[taskId].data[4],
sBattlePartyPopupMenus,
sBattlePartyMenuActions,
- GetMenuCursorPos());
+ Menu_GetCursorPos());
func(taskId);
return;
}
diff --git a/src/battle/battle_records.c b/src/battle/battle_records.c
index 97740e3da..fb7392f33 100644
--- a/src/battle/battle_records.c
+++ b/src/battle/battle_records.c
@@ -202,7 +202,7 @@ static void PrintLinkBattleWinsLossesDraws(struct LinkBattleRecord *records)
ConvertIntToDecimalStringN_DigitWidth6(gStringVar1, GetGameStat(GAME_STAT_LINK_BATTLE_WINS), STR_CONV_MODE_RIGHT_ALIGN, 4);
ConvertIntToDecimalStringN_DigitWidth6(gStringVar2, GetGameStat(GAME_STAT_LINK_BATTLE_LOSSES), STR_CONV_MODE_RIGHT_ALIGN, 4);
ConvertIntToDecimalStringN_DigitWidth6(gStringVar3, GetGameStat(GAME_STAT_LINK_BATTLE_DRAWS), STR_CONV_MODE_RIGHT_ALIGN, 4);
- MenuPrint(gOtherText_WinRecord, 3, 3);
+ Menu_PrintText(gOtherText_WinRecord, 3, 3);
}
static void PrintLinkBattleRecord(struct LinkBattleRecord *record, u8 y)
@@ -217,37 +217,37 @@ static void PrintLinkBattleRecord(struct LinkBattleRecord *record, u8 y)
buffer[4] = 0x11;
buffer[5] = 1;
StringCopy(buffer + 6, gOtherText_SevenDashes);
- MenuPrint(buffer, 3, y);
+ Menu_PrintText(buffer, 3, y);
StringCopy(buffer + 6, gOtherText_FourDashes);
- MenuPrint(buffer, 11, y);
- MenuPrint(buffer, 17, y);
- MenuPrint(buffer, 23, y);
+ Menu_PrintText(buffer, 11, y);
+ Menu_PrintText(buffer, 17, y);
+ Menu_PrintText(buffer, 23, y);
}
else
{
StringFillWithTerminator(gStringVar1, 8);
StringCopyN(gStringVar1, record->name, 7);
- MenuPrint(gStringVar1, 3, y);
+ Menu_PrintText(gStringVar1, 3, y);
gStringVar1[0] = EXT_CTRL_CODE_BEGIN;
gStringVar1[1] = 0x14;
gStringVar1[2] = 6;
ConvertIntToDecimalStringN(gStringVar1 + 3, record->wins, STR_CONV_MODE_RIGHT_ALIGN, 4);
- MenuPrint(gStringVar1, 11, y);
+ Menu_PrintText(gStringVar1, 11, y);
ConvertIntToDecimalStringN(gStringVar1 + 3, record->losses, STR_CONV_MODE_RIGHT_ALIGN, 4);
- MenuPrint(gStringVar1, 17, y);
+ Menu_PrintText(gStringVar1, 17, y);
ConvertIntToDecimalStringN(gStringVar1 + 3, record->draws, STR_CONV_MODE_RIGHT_ALIGN, 4);
- MenuPrint(gStringVar1, 23, y);
+ Menu_PrintText(gStringVar1, 23, y);
}
}
void ShowLinkBattleRecords(void) {
s32 i;
- MenuDrawTextWindow(1, 0, 28, 18);
+ Menu_DrawStdWindowFrame(1, 0, 28, 18);
sub_8072BD8(gOtherText_BattleResults, 0, 1, 240);
PrintLinkBattleWinsLossesDraws(gSaveBlock1.linkBattleRecords);
#if ENGLISH
- MenuPrint(gOtherText_WinLoseDraw, 12, 6);
+ Menu_PrintText(gOtherText_WinLoseDraw, 12, 6);
#elif GERMAN
MenuPrint_PixelCoords(gOtherText_WinLoseDraw, 88, 48, 1);
#endif
@@ -285,11 +285,11 @@ static bool32 sub_8110494(u8 level)
static void PrintWinStreak(const u8 *str, u16 streak, u8 left, u8 top)
{
- MenuPrint(str, left, top);
+ Menu_PrintText(str, left, top);
if (streak > 9999)
streak = 9999;
sub_8072C14(gStringVar1, streak, 24, 1);
- MenuPrint(gOtherText_WinStreak, left + 7, top);
+ Menu_PrintText(gOtherText_WinStreak, left + 7, top);
}
static void PrintRecordWinStreak(u8 level, u8 left, u8 top)
@@ -320,10 +320,10 @@ static void PrintLastWinStreak(u8 level, u8 left, u8 top)
void ShowBattleTowerRecords(void)
{
u16 i;
- MenuDrawTextWindow(3, 1, 27, 17);
+ Menu_DrawStdWindowFrame(3, 1, 27, 17);
sub_8072BD8(gOtherText_BattleTowerResults, 3, 2, 0xC8);
- MenuPrint(gOtherText_Lv50, 5, 6);
- MenuPrint(gOtherText_Lv100, 5, 12);
+ Menu_PrintText(gOtherText_Lv50, 5, 6);
+ Menu_PrintText(gOtherText_Lv100, 5, 12);
for (i = 5; i < 26; i++)
{
sub_8071F60(CHAR_HYPHEN, i, 10);
diff --git a/src/battle/reshow_battle_screen.c b/src/battle/reshow_battle_screen.c
index 6a6d7a137..fded87090 100644
--- a/src/battle/reshow_battle_screen.c
+++ b/src/battle/reshow_battle_screen.c
@@ -80,7 +80,7 @@ static void CB2_ReshowBattleScreenAfterMenu(void)
dp12_8087EA4();
SetUpWindowConfig(&gWindowConfig_81E6C58);
ResetPaletteFade();
- InitWindowFromConfig(&gUnknown_03004210, &gWindowConfig_81E6C58);
+ Text_InitWindowWithTemplate(&gUnknown_03004210, &gWindowConfig_81E6C58);
gBattle_BG0_X = 0;
gBattle_BG0_Y = 0;
gBattle_BG1_X = 0;
diff --git a/src/contest.c b/src/contest.c
index c32719648..c935f0ecb 100644
--- a/src/contest.c
+++ b/src/contest.c
@@ -358,8 +358,8 @@ void LoadContestBgAfterMoveAnim(void)
void SetUpContestWindow(void)
{
SetUpWindowConfig(&gWindowConfig_81E6FD8);
- InitWindowFromConfig(&gUnknown_03004210, &gWindowConfig_81E6FD8);
- InitWindowFromConfig(&gMenuWindow, &gWindowConfig_81E6FF4);
+ Text_InitWindowWithTemplate(&gUnknown_03004210, &gWindowConfig_81E6FD8);
+ Text_InitWindowWithTemplate(&gMenuWindow, &gWindowConfig_81E6FF4);
}
void sub_80AB350(void)
@@ -651,13 +651,13 @@ void sub_80ABB70(u8 taskId)
InsertStringDigit(gDisplayedStringBattle, sContest.turnNumber + 1);
sub_80AF138();
StringExpandPlaceholders(gStringVar4, gDisplayedStringBattle);
- sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
+ Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
gTasks[taskId].func = sub_80ABC3C;
}
void sub_80ABC3C(u8 taskId)
{
- if (sub_80037A0(&gMenuWindow) == 1)
+ if (Text_UpdateWindowInContest(&gMenuWindow) == 1)
gTasks[taskId].func = sub_80ABC70;
}
@@ -715,14 +715,14 @@ void sub_80ABCDC(u8 taskId)
}
r5 = StringCopy(r5, gMoveNames[move]);
- sub_8002E4C(
+ Text_InitWindow8002E4C(
&gUnknown_03004210,
sp8,
776 + i * 20,
gUnknown_083CA340[i][0] * 8 + 4,
gUnknown_083CA340[i][1] * 8,
1);
- sub_8002F44(&gUnknown_03004210);
+ Text_PrintWindow8002F44(&gUnknown_03004210);
}
sub_814A5C0(0, 0xFFFF, 12, 0x2D9F, 72);
@@ -771,7 +771,7 @@ void sub_80ABEA0(u8 taskId)
InsertStringDigit(gDisplayedStringBattle, sContest.turnNumber + 1);
sub_80AF138();
StringExpandPlaceholders(gStringVar4, gDisplayedStringBattle);
- sub_8003460(&gMenuWindow, gStringVar4, 776, 1, 15);
+ Text_InitWindowAndPrintText(&gMenuWindow, gStringVar4, 776, 1, 15);
gBattle_BG0_Y = 0;
gBattle_BG2_Y = 0;
gTasks[taskId].func = sub_80ABC70;
@@ -976,12 +976,12 @@ void sub_80AC2CC(u8 taskId)
else
StringCopy(gStringVar2, gUnknown_083CC330[sContestantStatus[r7].moveCategory]);
StringExpandPlaceholders(gStringVar4, gUnknown_083CAFD7);
- sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
+ Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
gTasks[taskId].data[0] = 6;
}
return;
case 6:
- if (sub_80037A0(&gMenuWindow) != 0)
+ if (Text_UpdateWindowInContest(&gMenuWindow) != 0)
{
sContest.unk1925E = 0;
gTasks[taskId].data[0] = 7;
@@ -1059,7 +1059,7 @@ void sub_80AC2CC(u8 taskId)
}
return;
case 24:
- if (sub_80037A0(&gMenuWindow) != 0)
+ if (Text_UpdateWindowInContest(&gMenuWindow) != 0)
gTasks[taskId].data[0] = 23;
return;
case 48:
@@ -1171,7 +1171,7 @@ void sub_80AC2CC(u8 taskId)
}
return;
case 27:
- if (sub_80037A0(&gMenuWindow) != 0)
+ if (Text_UpdateWindowInContest(&gMenuWindow) != 0)
gTasks[taskId].data[0] = 28;
return;
case 28:
@@ -1234,13 +1234,13 @@ void sub_80AC2CC(u8 taskId)
sub_80AF138();
StringCopy(gStringVar1, gContestMons[r7].nickname);
StringExpandPlaceholders(gStringVar4, ContestString_CantAppealNextTurn);
- sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
+ Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
}
gTasks[taskId].data[0] = 52;
}
return;
case 52:
- if (sub_80037A0(&gMenuWindow) != 0)
+ if (Text_UpdateWindowInContest(&gMenuWindow) != 0)
{
if (!sContestantStatus[r7].unk15_6)
gTasks[taskId].data[0] = 17;
@@ -1254,11 +1254,11 @@ void sub_80AC2CC(u8 taskId)
{
sub_80AF138();
if (r4 == 1)
- sub_8002EB0(&gMenuWindow, ContestString_WentOverWell, 776, 1, 15);
+ Text_InitWindow8002EB0(&gMenuWindow, ContestString_WentOverWell, 776, 1, 15);
else if (r4 == 2)
- sub_8002EB0(&gMenuWindow, ContestString_WentOverVeryWell, 776, 1, 15);
+ Text_InitWindow8002EB0(&gMenuWindow, ContestString_WentOverVeryWell, 776, 1, 15);
else
- sub_8002EB0(&gMenuWindow, ContestString_AppealComboExcellently, 776, 1, 15);
+ Text_InitWindow8002EB0(&gMenuWindow, ContestString_AppealComboExcellently, 776, 1, 15);
sub_80B1710(3);
gTasks[taskId].data[10] = 0;
gTasks[taskId].data[0] = 45;
@@ -1268,7 +1268,7 @@ void sub_80AC2CC(u8 taskId)
sub_80AF138();
StringCopy(gStringVar1, gContestMons[r7].nickname);
StringExpandPlaceholders(gStringVar4, ContestString_JudgeExpectantly2);
- sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
+ Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
sub_80B1710(2);
gTasks[taskId].data[10] = 0;
gTasks[taskId].data[0] = 45;
@@ -1282,7 +1282,7 @@ void sub_80AC2CC(u8 taskId)
}
return;
case 15:
- if (sub_80037A0(&gMenuWindow) != 0)
+ if (Text_UpdateWindowInContest(&gMenuWindow) != 0)
{
if (++gTasks[taskId].data[10] > 50)
{
@@ -1311,7 +1311,7 @@ void sub_80AC2CC(u8 taskId)
sub_80AF138();
StringCopy(gStringVar1, gContestMons[r7].nickname);
StringExpandPlaceholders(gStringVar4, ContestString_DissapointedRepeat);
- sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
+ Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
gTasks[taskId].data[10] = 0;
sub_80B1710(0);
gTasks[taskId].data[0] = 46;
@@ -1326,7 +1326,7 @@ void sub_80AC2CC(u8 taskId)
gTasks[taskId].data[0] = 19;
return;
case 19:
- if (sub_80037A0(&gMenuWindow) != 0)
+ if (Text_UpdateWindowInContest(&gMenuWindow) != 0)
{
sub_80AFBA0(sContestantStatus[r7].appeal2, -sContestantStatus[r7].unk18, r7);
sContestantStatus[r7].appeal2 -= sContestantStatus[r7].unk18;
@@ -1381,7 +1381,7 @@ void sub_80AC2CC(u8 taskId)
StringExpandPlaceholders(gStringVar4, ContestString_WentOverGreat);
else
StringExpandPlaceholders(gStringVar4, ContestString_GotCrowdGoing);
- sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
+ Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
gTasks[taskId].data[10] = 0;
gTasks[taskId].data[11] = 0;
if (r4 < 0)
@@ -1400,7 +1400,7 @@ void sub_80AC2CC(u8 taskId)
gTasks[taskId].data[10]++;
break;
case 1:
- if (!sContest.unk1920B_0 && sub_80037A0(&gMenuWindow) != 0)
+ if (!sContest.unk1920B_0 && Text_UpdateWindowInContest(&gMenuWindow) != 0)
{
sub_80B1CBC(-1);
gTasks[taskId].data[10]++;
@@ -1431,7 +1431,7 @@ void sub_80AC2CC(u8 taskId)
switch (gTasks[taskId].data[10])
{
case 0:
- if (sub_80037A0(&gMenuWindow) != 0)
+ if (Text_UpdateWindowInContest(&gMenuWindow) != 0)
{
sub_80B1EA8(1, 1);
gTasks[taskId].data[10]++;
@@ -1491,20 +1491,20 @@ void sub_80AC2CC(u8 taskId)
StringCopy(gStringVar1, gContestMons[r7].nickname);
StringCopy(gStringVar2, gMoveNames[sContestantStatus[r7].currMove]);
StringExpandPlaceholders(gStringVar4, ContestString_CrowdWatches);
- sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
+ Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
gTasks[taskId].data[0] = 58;
return;
case 58:
- if (sub_80037A0(&gMenuWindow) != 0)
+ if (Text_UpdateWindowInContest(&gMenuWindow) != 0)
{
sub_80AF138();
StringExpandPlaceholders(gStringVar4, ContestString_Ignored2);
- sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
+ Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
gTasks[taskId].data[0] = 59;
}
return;
case 59:
- if (sub_80037A0(&gMenuWindow) != 0)
+ if (Text_UpdateWindowInContest(&gMenuWindow) != 0)
{
sub_80AF138();
gTasks[taskId].data[0] = 55;
@@ -1517,11 +1517,11 @@ void sub_80AC2CC(u8 taskId)
StringCopy(gStringVar1, gContestMons[r7].nickname);
StringCopy(gStringVar2, gMoveNames[sContestantStatus[r7].currMove]);
StringExpandPlaceholders(gStringVar4, gUnknown_083CBF60);
- sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
+ Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
gTasks[taskId].data[0] = 34;
return;
case 34:
- if (sub_80037A0(&gMenuWindow) != 0)
+ if (Text_UpdateWindowInContest(&gMenuWindow) != 0)
gTasks[taskId].data[0] = 55;
return;
case 55:
@@ -1563,11 +1563,11 @@ void sub_80AC2CC(u8 taskId)
sub_80AF138();
StringCopy(gStringVar1, gContestMons[r7].nickname);
StringExpandPlaceholders(gStringVar4, gUnknown_083CB00D);
- sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
+ Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
gTasks[taskId].data[0] = 32;
return;
case 32:
- if (sub_80037A0(&gMenuWindow) != 0)
+ if (Text_UpdateWindowInContest(&gMenuWindow) != 0)
gTasks[taskId].data[0] = 21;
return;
case 21:
@@ -1734,13 +1734,13 @@ void sub_80ADB88(u8 taskId)
sub_80AF138();
StringCopy(gStringVar1, gContestMons[gContestPlayerMonIndex].nickname);
StringExpandPlaceholders(gStringVar4, gContestStandOutStrings[r4]);
- sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
+ Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
gTasks[taskId].func = sub_80ADC10;
}
void sub_80ADC10(u8 taskId)
{
- if (sub_80037A0(&gMenuWindow) == 1)
+ if (Text_UpdateWindowInContest(&gMenuWindow) == 1)
{
gTasks[taskId].data[0] = 0;
gTasks[taskId].func = sub_80ADC4C;
@@ -1813,14 +1813,14 @@ void sub_80ADDA4(u8 taskId)
sub_80BE23C(sContestantStatus[gContestPlayerMonIndex].prevMove);
gUnknown_03005D28 = gRngValue;
StringExpandPlaceholders(gStringVar4, gUnknown_083CB02C);
- sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
+ Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
gTasks[taskId].data[2] = 0;
gTasks[taskId].func = sub_80ADE54;
}
void sub_80ADE54(u8 taskId)
{
- if (sub_80037A0(&gMenuWindow) == 1)
+ if (Text_UpdateWindowInContest(&gMenuWindow) == 1)
{
sub_80B2184();
gBattle_BG1_X = 0;
@@ -2172,7 +2172,7 @@ void sub_80AE5D4(u8 p, u8 b)
else
{
StringCopy(str, gContestMons[p].trainerName);
- sub_8003460(
+ Text_InitWindowAndPrintText(
&gUnknown_03004210,
gDisplayedStringBattle,
592 + gUnknown_02038696[p] * 22,
@@ -2432,8 +2432,8 @@ void sub_80AEBEC(u16 a)
*(u16 *)(VRAM + 0xC82A + i * 2) = 0x5036;
}
- sub_8003460(&gUnknown_03004210, gContestEffectStrings[gContestMoves[a].effect], 868, 11, 35);
- sub_8003460(&gUnknown_03004210, gUnknown_083CC5A2, 866, 16, 31);
+ Text_InitWindowAndPrintText(&gUnknown_03004210, gContestEffectStrings[gContestMoves[a].effect], 868, 11, 35);
+ Text_InitWindowAndPrintText(&gUnknown_03004210, gUnknown_083CC5A2, 866, 16, 31);
}
void sub_80AED58(void)
@@ -2656,7 +2656,7 @@ void sub_80AF1E4(u8 a, u8 b)
else
sub_80AE598(gDisplayedStringBattle, gMoveNames[sContestantStatus[a].currMove], r3);
sub_80AF2A0(a);
- sub_8003460(
+ Text_InitWindowAndPrintText(
&gUnknown_03004210,
gDisplayedStringBattle,
696 + a * 20,
@@ -2953,7 +2953,7 @@ void sub_80AF860(void)
gBattle_BG0_Y = 0;
gBattle_BG2_Y = 0;
sub_80AF138();
- sub_8003460(&gMenuWindow, gUnknownText_LinkStandbyAndWinner, 776, 1, 15);
+ Text_InitWindowAndPrintText(&gMenuWindow, gUnknownText_LinkStandbyAndWinner, 776, 1, 15);
}
u8 unref_sub_80AF89C(s16 a, s16 b, u8 c, u8 d)
@@ -4193,7 +4193,7 @@ void sub_80B0D7C(void)
r5++;
}
ConvertIntToDecimalStringN(sp8 + r5, r2, 0, 4);
- sub_8003460(
+ Text_InitWindowAndPrintText(
&gUnknown_03004210,
sp8,
592 + gUnknown_02038696[i] * 22,
@@ -4211,7 +4211,7 @@ void sub_80B0D7C(void)
r5++;
}
ConvertIntToDecimalStringN(sp8 + r5, r2, 0, 4);
- sub_8003460(
+ Text_InitWindowAndPrintText(
&gUnknown_03004210,
sp8,
512 + gUnknown_02038696[i] * 20,
@@ -4484,7 +4484,7 @@ void sub_80B146C(u8 a, u8 b)
StringCopy(gStringVar3, gText_Contest_Fear);
StringExpandPlaceholders(gStringVar4, gUnknown_083CC188[b]);
sub_80AF138();
- sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
+ Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15);
}
void sub_80B157C(u8 p)
@@ -4631,7 +4631,7 @@ void unref_sub_80B19D0(void)
{
u8 str[20];
StringCopy(str, gUnknown_083CC2EC);
- sub_8003460(&gUnknown_03004210, str, 680, 0, 0);
+ Text_InitWindowAndPrintText(&gUnknown_03004210, str, 680, 0, 0);
}
s8 Contest_GetMoveExcitement(u16 move)
diff --git a/src/debug/matsuda_debug_menu.c b/src/debug/matsuda_debug_menu.c
index 49fe6864b..2c20ba72b 100644
--- a/src/debug/matsuda_debug_menu.c
+++ b/src/debug/matsuda_debug_menu.c
@@ -247,8 +247,8 @@ static const struct OamData gUnknown_083C9400 =
u8 unref_sub_80A9B28(void)
{
- MenuZeroFillScreen();
- MenuDrawTextWindow(0, 0, 17, 18);
+ Menu_EraseScreen();
+ Menu_DrawStdWindowFrame(0, 0, 17, 18);
PrintMenuItems(1, 1, 7, gMatsudaDebugMenuActions);
InitMenu(0, 1, 1, 7, 0, 16);
gCallback_03004AE8 = sub_80A9B78;
@@ -257,7 +257,7 @@ u8 unref_sub_80A9B28(void)
static bool8 sub_80A9B78(void)
{
- s8 choice = ProcessMenuInput();
+ s8 choice = Menu_ProcessInput();
switch (choice)
{
@@ -450,7 +450,7 @@ static void sub_80A9F50(void)
REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP;
REG_DISPCNT |= DISPCNT_OBJ_ON | DISPCNT_BG0_ON;
SetUpWindowConfig(&gWindowConfig_81E6C3C);
- InitWindowFromConfig(&gMenuWindow, &gWindowConfig_81E6C3C);
+ Text_InitWindowWithTemplate(&gMenuWindow, &gWindowConfig_81E6C3C);
REG_MOSAIC = 0;
REG_BLDCNT = 0;
REG_BLDALPHA = 0;
@@ -546,7 +546,7 @@ static void sub_80AA10C(void)
for (i = 0; i < 6; i++)
{
- sub_8003460(&gMenuWindow, gMatsudaDebugMenuTextList1[i],
+ Text_InitWindowAndPrintText(&gMenuWindow, gMatsudaDebugMenuTextList1[i],
(0xA * i + 0x2A), gMatsudaDebugMenuContestTopLeft[i][0],
gMatsudaDebugMenuContestTopLeft[i][1]);
}
@@ -555,8 +555,8 @@ static void sub_80AA10C(void)
zero = 0; // it's possible this was some assignment that matsuda used to quickly edit and test things without changing whats passed to the later functions.
sub_80AA5BC(zero);
sub_80AA5E8(gSpecialVar_ContestRank);
- sub_8003460(&gMenuWindow, gMatsudaDebugMenu_GoBackText, 0xD6, 0x12, 0x12);
- sub_8003460(&gMenuWindow, gMatsudaDebugMenu_BattlePointsText, 0xDC, zero, 0xC);
+ Text_InitWindowAndPrintText(&gMenuWindow, gMatsudaDebugMenu_GoBackText, 0xD6, 0x12, 0x12);
+ Text_InitWindowAndPrintText(&gMenuWindow, gMatsudaDebugMenu_BattlePointsText, 0xDC, zero, 0xC);
LoadSpriteSheet(gUnknown_083C92B4);
LoadSpritePalette(gUnknown_083C92BC);
sub_80AA280(3);
@@ -580,64 +580,64 @@ void sub_80AA280(u8 var) // no?
for (i = 0; i < 4; i++)
{
if (var == i)
- sub_8003460(&gMenuWindow, gSharedMem, 10 * i + 2, gUnknown_083C926E[i][0], gUnknown_083C926E[i][1]);
+ Text_InitWindowAndPrintText(&gMenuWindow, gSharedMem, 10 * i + 2, gUnknown_083C926E[i][0], gUnknown_083C926E[i][1]);
else
- sub_8003460(&gMenuWindow, gContestMons[i].trainerName, 10 * i + 2, gUnknown_083C926E[i][0], gUnknown_083C926E[i][1]);
+ Text_InitWindowAndPrintText(&gMenuWindow, gContestMons[i].trainerName, 10 * i + 2, gUnknown_083C926E[i][0], gUnknown_083C926E[i][1]);
}
}
static void sub_80AA340(u8 var)
{
ConvertIntToDecimalStringN(gSharedMem, gContestMons[var].cool, STR_CONV_MODE_RIGHT_ALIGN, 3);
- sub_8003460(&gMenuWindow, gSharedMem, 0x66, gUnknown_083C9282[0], gUnknown_083C9282[1]);
+ Text_InitWindowAndPrintText(&gMenuWindow, gSharedMem, 0x66, gUnknown_083C9282[0], gUnknown_083C9282[1]);
}
static void sub_80AA388(u8 var)
{
ConvertIntToDecimalStringN(gSharedMem, gContestMons[var].cute, STR_CONV_MODE_RIGHT_ALIGN, 3);
- sub_8003460(&gMenuWindow, gSharedMem, 0x6C, gUnknown_083C9282[2], gUnknown_083C9282[3]);
+ Text_InitWindowAndPrintText(&gMenuWindow, gSharedMem, 0x6C, gUnknown_083C9282[2], gUnknown_083C9282[3]);
}
static void sub_80AA3D0(u8 var)
{
ConvertIntToDecimalStringN(gSharedMem, gContestMons[var].beauty, STR_CONV_MODE_RIGHT_ALIGN, 3);
- sub_8003460(&gMenuWindow, gSharedMem, 0x72, gUnknown_083C9282[4], gUnknown_083C9282[5]);
+ Text_InitWindowAndPrintText(&gMenuWindow, gSharedMem, 0x72, gUnknown_083C9282[4], gUnknown_083C9282[5]);
}
static void sub_80AA418(u8 var)
{
ConvertIntToDecimalStringN(gSharedMem, gContestMons[var].smart, STR_CONV_MODE_RIGHT_ALIGN, 3);
- sub_8003460(&gMenuWindow, gSharedMem, 0x78, gUnknown_083C9282[6], gUnknown_083C9282[7]);
+ Text_InitWindowAndPrintText(&gMenuWindow, gSharedMem, 0x78, gUnknown_083C9282[6], gUnknown_083C9282[7]);
}
static void sub_80AA460(u8 var)
{
ConvertIntToDecimalStringN(gSharedMem, gContestMons[var].tough, STR_CONV_MODE_RIGHT_ALIGN, 3);
- sub_8003460(&gMenuWindow, gSharedMem, 0x7E, gUnknown_083C9282[8], gUnknown_083C9282[9]);
+ Text_InitWindowAndPrintText(&gMenuWindow, gSharedMem, 0x7E, gUnknown_083C9282[8], gUnknown_083C9282[9]);
}
static void sub_80AA4A8(u8 var)
{
ConvertIntToDecimalStringN(gSharedMem, gContestMons[var].sheen, STR_CONV_MODE_RIGHT_ALIGN, 3);
- sub_8003460(&gMenuWindow, gSharedMem, 0x84, gUnknown_083C9282[10], gUnknown_083C9282[11]);
+ Text_InitWindowAndPrintText(&gMenuWindow, gSharedMem, 0x84, gUnknown_083C9282[10], gUnknown_083C9282[11]);
}
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);
- sub_8003460(&gMenuWindow, gMoveNames[gContestMons[var1].moves[var2]], 0x8A + var2 * 14, gUnknown_083C928E[var2][0], gUnknown_083C928E[var2][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);
- sub_8003460(&gMenuWindow, gStringVar1, 0xFA + var2 * 6, gUnknown_083C928E[var2][0] + 7, gUnknown_083C928E[var2][1]);
+ Text_InitWindowAndPrintText(&gMenuWindow, gStringVar1, 0xFA + var2 * 6, gUnknown_083C928E[var2][0] + 7, gUnknown_083C928E[var2][1]);
}
static void sub_80AA5BC(u8 var)
{
- sub_8003460(&gMenuWindow, gMatsudaDebugMenuTextList2[var], 0xC2, 3, 0x12);
+ Text_InitWindowAndPrintText(&gMenuWindow, gMatsudaDebugMenuTextList2[var], 0xC2, 3, 0x12);
}
void sub_80AA5E8(u8 var)
{
- sub_8003460(&gMenuWindow, gMatsudaDebugMenuTextList3[var], 0xE8, 3, 4);
+ Text_InitWindowAndPrintText(&gMenuWindow, gMatsudaDebugMenuTextList3[var], 0xE8, 3, 4);
}
static void sub_80AA614(u8 var1, u8 var2)
@@ -645,7 +645,7 @@ static void sub_80AA614(u8 var1, u8 var2)
u16 var = sub_80AE770(var1, var2);
ConvertIntToDecimalStringN(gSharedMem, var, STR_CONV_MODE_RIGHT_ALIGN, 3);
- sub_8003460(&gMenuWindow, gSharedMem, 0xE2, 3, 0xC);
+ Text_InitWindowAndPrintText(&gMenuWindow, gSharedMem, 0xE2, 3, 0xC);
}
void sub_80AA658(u8 var)
@@ -1076,9 +1076,9 @@ void unref_sub_80AB084(u8 *text)
}
}
SetUpWindowConfig(&gWindowConfig_81E6FD8);
- InitWindowFromConfig(&gUnknown_03004210, &gWindowConfig_81E6FD8);
+ Text_InitWindowWithTemplate(&gUnknown_03004210, &gWindowConfig_81E6FD8);
LoadFontDefaultPalette(&gWindowConfig_81E6FD8);
- sub_8003460(&gUnknown_03004210, text, 1, 9, 7);
+ Text_InitWindowAndPrintText(&gUnknown_03004210, text, 1, 9, 7);
}
void sub_80AB184(void)
diff --git a/src/debug/mori_debug_menu.c b/src/debug/mori_debug_menu.c
index 83dba8b73..31f232d82 100644
--- a/src/debug/mori_debug_menu.c
+++ b/src/debug/mori_debug_menu.c
@@ -95,9 +95,9 @@ u8 MoriDebugMenu_SearchChild(u8 a1, u8 a2, u8 *ptr)
StringAppend(localPtr, gUnknown_0839B24D);
StringAppend(localPtr, gSpeciesNames[eggSpecies]);
StringAppend(localPtr, gUnknown_0839B255);
- MenuZeroFillScreen();
- MenuDrawTextWindow(0, 14, 30, 19);
- MenuPrint(localPtr, 1, 15);
+ Menu_EraseScreen();
+ Menu_DrawStdWindowFrame(0, 14, 30, 19);
+ Menu_PrintText(localPtr, 1, 15);
gCallback_03004AE8 = sub_8083D4C;
return 0;
}
@@ -179,7 +179,7 @@ u8 MoriDebugMenu_PokeblockCase(void)
bool8 MoriDebugMenuProcessInput(void)
{
- s8 choice = ProcessMenuInput();
+ s8 choice = Menu_ProcessInput();
switch (choice)
{
@@ -196,8 +196,8 @@ bool8 MoriDebugMenuProcessInput(void)
s8 InitMoriDebugMenu(void)
{
- MenuZeroFillScreen();
- MenuDrawTextWindow(0, 0, 10, 19);
+ Menu_EraseScreen();
+ Menu_DrawStdWindowFrame(0, 0, 10, 19);
PrintMenuItems(1, 1, 9, gMoriDebugMenuActions);
InitMenu(0, 1, 1, 9, 0, 9);
gCallback_03004AE8 = MoriDebugMenuProcessInput;
diff --git a/src/debug/sound_check_menu.c b/src/debug/sound_check_menu.c
index 968b047d9..4f4a7bd06 100644
--- a/src/debug/sound_check_menu.c
+++ b/src/debug/sound_check_menu.c
@@ -171,16 +171,16 @@ void Task_InitSoundCheckMenu(u8 taskId)
if (!gPaletteFade.active)
{
- MenuDrawTextWindow(2, 0, 27, 3);
- MenuDrawTextWindow(2, 5, 27, 10);
- MenuDrawTextWindow(2, 12, 27, 17);
- MenuPrint(soundcheckStr, 4, 1);
- MenuPrint(abDescStr, 14, 1);
- MenuPrint(bgmStr, 4, 6);
- MenuPrint(upDownStr, 14, 6);
- MenuPrint(seStr, 4, 13);
- MenuPrint(upDownStr, 14, 13);
- MenuPrint(driverStr, 14, 18);
+ Menu_DrawStdWindowFrame(2, 0, 27, 3);
+ Menu_DrawStdWindowFrame(2, 5, 27, 10);
+ Menu_DrawStdWindowFrame(2, 12, 27, 17);
+ Menu_PrintText(soundcheckStr, 4, 1);
+ Menu_PrintText(abDescStr, 14, 1);
+ Menu_PrintText(bgmStr, 4, 6);
+ Menu_PrintText(upDownStr, 14, 6);
+ Menu_PrintText(seStr, 4, 13);
+ Menu_PrintText(upDownStr, 14, 13);
+ Menu_PrintText(driverStr, 14, 18);
gTasks[taskId].func = sub_80BA384;
REG_WIN0H = WIN_RANGE(17, 223);
REG_WIN0V = WIN_RANGE(1, 31);
@@ -384,7 +384,7 @@ void PrintSoundNumber(u16 soundIndex, u16 x, u16 y) // PrintSoundNumber ?
str[1] = divisorValue + CHAR_0;
str[2] = ((soundIndex % 100) % 10) + CHAR_0;
- MenuPrint(str, x, y);
+ Menu_PrintText(str, x, y);
}
void sub_80BA79C(const u8 *const string, u16 x, u16 y)
@@ -400,7 +400,7 @@ void sub_80BA79C(const u8 *const string, u16 x, u16 y)
for (i = 0; string[i] != EOS && i < 10; i++)
str[i] = string[i];
- MenuPrint(str, x, y);
+ Menu_PrintText(str, x, y);
}
void Task_DrawDriverTestMenu(u8 taskId) // Task_DrawDriverTestMenu
@@ -421,21 +421,21 @@ void Task_DrawDriverTestMenu(u8 taskId) // Task_DrawDriverTestMenu
u8 stereoStr[] = _("すてれお‥‥‥‥"); // stereo
REG_DISPCNT = 0x3140;
- MenuDrawTextWindow(0, 0, 29, 19);
- MenuPrint(bbackStr, 19, 4);
- MenuPrint(aplayStr, 19, 2);
- MenuPrint(voiceStr, 2, 1);
- MenuPrint(volumeStr, 2, 3);
- MenuPrint(panpotStr, 2, 5);
- MenuPrint(pitchStr, 2, 7);
- MenuPrint(lengthStr, 2, 9);
- MenuPrint(releaseStr, 2, 11);
- MenuPrint(progressStr, 2, 13);
- MenuPrint(chorusStr, 2, 15);
- MenuPrint(priorityStr, 2, 17);
- MenuPrint(playingStr, 19, 16);
- MenuPrint(reverseStr, 19, 14);
- MenuPrint(stereoStr, 19, 12);
+ Menu_DrawStdWindowFrame(0, 0, 29, 19);
+ Menu_PrintText(bbackStr, 19, 4);
+ Menu_PrintText(aplayStr, 19, 2);
+ Menu_PrintText(voiceStr, 2, 1);
+ Menu_PrintText(volumeStr, 2, 3);
+ Menu_PrintText(panpotStr, 2, 5);
+ Menu_PrintText(pitchStr, 2, 7);
+ Menu_PrintText(lengthStr, 2, 9);
+ Menu_PrintText(releaseStr, 2, 11);
+ Menu_PrintText(progressStr, 2, 13);
+ Menu_PrintText(chorusStr, 2, 15);
+ Menu_PrintText(priorityStr, 2, 17);
+ Menu_PrintText(playingStr, 19, 16);
+ Menu_PrintText(reverseStr, 19, 14);
+ Menu_PrintText(stereoStr, 19, 12);
REG_WIN0H = WIN_RANGE(0, DISPLAY_WIDTH);
REG_WIN0V = WIN_RANGE(0, DISPLAY_HEIGHT);
sDriverTestSelection = 0;
@@ -465,7 +465,7 @@ void Task_ProcessDriverTestInput(u8 taskId)
REG_DISPCNT = 0x7140;
REG_WIN0H = WIN_RANGE(17, 223);
REG_WIN0V = WIN_RANGE(1, 31);
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
gTasks[taskId].func = Task_InitSoundCheckMenu;
return;
}
@@ -627,8 +627,8 @@ void sub_80BAE10(u8 var1, u8 var2)
u8 str1[] = _("▶");
u8 str2[] = _(" ");
- MenuPrint(str2, gUnknown_083D0300[MULTI_DIM_ARR(var1, B_16, 0)], gUnknown_083D0300[MULTI_DIM_ARR(var1, B_16, 1)]);
- MenuPrint(str1, gUnknown_083D0300[MULTI_DIM_ARR(var2, B_16, 0)], gUnknown_083D0300[MULTI_DIM_ARR(var2, B_16, 1)]);
+ Menu_PrintText(str2, gUnknown_083D0300[MULTI_DIM_ARR(var1, B_16, 0)], gUnknown_083D0300[MULTI_DIM_ARR(var1, B_16, 1)]);
+ Menu_PrintText(str1, gUnknown_083D0300[MULTI_DIM_ARR(var2, B_16, 0)], gUnknown_083D0300[MULTI_DIM_ARR(var2, B_16, 1)]);
}
void PrintSignedNumber(int n, u16 x, u16 y, u8 digits)
@@ -677,7 +677,7 @@ void PrintSignedNumber(int n, u16 x, u16 y, u8 digits)
n %= powersOfTen[i];
}
- MenuPrint(str, x, y);
+ Menu_PrintText(str, x, y);
}
static const s8 gUnknown_083D03F8[5] = { 0x3F, 0x00, 0xC0, 0x7F, 0x80 };
@@ -689,10 +689,10 @@ void sub_80BAF84(u8 taskId)
u8 playingStr[] = _("さいせいちゆう‥");
REG_DISPCNT = 0x3140;
- MenuDrawTextWindow(0, 0, 29, 19);
- MenuPrint(seStr, 3, 2);
- MenuPrint(panStr, 3, 4);
- MenuPrint(playingStr, 3, 8);
+ Menu_DrawStdWindowFrame(0, 0, 29, 19);
+ Menu_PrintText(seStr, 3, 2);
+ Menu_PrintText(panStr, 3, 4);
+ Menu_PrintText(playingStr, 3, 8);
REG_WIN0H = WIN_RANGE(0, DISPLAY_WIDTH);
REG_WIN0V = WIN_RANGE(0, DISPLAY_HEIGHT);
sSoundTestParams[CRY_TEST_VOICE] = 1;
@@ -739,7 +739,7 @@ void sub_80BB038(u8 taskId)
REG_DISPCNT = 0x7140;
REG_WIN0H = WIN_RANGE(17, 223);
REG_WIN0V = WIN_RANGE(1, 31);
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
gTasks[taskId].func = Task_InitSoundCheckMenu;
return;
}
@@ -806,10 +806,10 @@ void sub_80BB1D4(void)
switch (gUnknown_083D03F8[sSoundTestParams[CRY_TEST_PANPOT]])
{
case 127:
- MenuPrint(lrStr, 7, 4);
+ Menu_PrintText(lrStr, 7, 4);
break;
case -128:
- MenuPrint(rlStr, 7, 4);
+ Menu_PrintText(rlStr, 7, 4);
break;
default:
PrintSignedNumber(gUnknown_083D03F8[sSoundTestParams[CRY_TEST_PANPOT]], 7, 4, 3);
@@ -1247,7 +1247,7 @@ void Task_InitCryTest(u8 taskId)
while (ShowPokedexCryScreen(&cryStruct2, 2) == FALSE)
;
- MenuDrawTextWindow(0, 16, 5, 19);
+ Menu_DrawStdWindowFrame(0, 16, 5, 19);
PrintCryNumber();
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
REG_BG2HOFS = 0;
@@ -1288,7 +1288,7 @@ void Task_ProcessCryTestInput(u8 taskId)
REG_DISPCNT = 0x7140;
REG_WIN0H = WIN_RANGE(17, 223);
REG_WIN0V = WIN_RANGE(1, 31);
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
gTasks[taskId].func = Task_InitSoundCheckMenu;
DestroyCryMeterNeedleSprite();
}
diff --git a/src/debug/unknown_debug_menu.c b/src/debug/unknown_debug_menu.c
index a8c3ad16b..e95806c74 100644
--- a/src/debug/unknown_debug_menu.c
+++ b/src/debug/unknown_debug_menu.c
@@ -32,8 +32,8 @@ const struct MenuAction gUnknown_0842C29C[] = {
int unref_sub_814A414(void)
{
- MenuZeroFillScreen();
- MenuDrawTextWindow(0, 0, 16, 18);
+ Menu_EraseScreen();
+ Menu_DrawStdWindowFrame(0, 0, 16, 18);
PrintMenuItems(2, 1, 8, gUnknown_0842C29C);
InitMenu(0, 1, 1, 8, 0, 15);
gCallback_03004AE8 = sub_814A464;
@@ -42,7 +42,7 @@ int unref_sub_814A414(void)
static u8 sub_814A464(void)
{
- s8 result = ProcessMenuInput();
+ s8 result = Menu_ProcessInput();
if (result == -2)
{
return 0;
diff --git a/src/easy_chat_1.c b/src/easy_chat_1.c
index e5b6cf7c3..908e4b9d6 100644
--- a/src/easy_chat_1.c
+++ b/src/easy_chat_1.c
@@ -16,8 +16,8 @@
#include "strings.h"
#include "unknown_task.h"
-extern const struct WindowConfig gWindowConfig_81E6D54;
-extern const struct WindowConfig gWindowConfig_81E6DA8;
+extern const struct WindowTemplate gWindowConfig_81E6D54;
+extern const struct WindowTemplate gWindowConfig_81E6DA8;
extern void sub_80546B8(void);
@@ -310,7 +310,7 @@ void sub_80E62F8(void)
case 2:
InitMenuWindow(&gWindowConfig_81E6D54);
InitMenuWindow(&gWindowConfig_81E6DA8);
- MenuZeroFillScreen();
+ Menu_EraseScreen();
break;
case 3:
sub_80E6424();
@@ -732,7 +732,7 @@ void sub_80E6BC0(void)
{
sub_80E91D4(2);
DisplayYesNoMenu(23, 8, 1);
- MoveMenuCursor(1);
+ Menu_MoveCursor(1);
gEasyChatStruct->unk24++;
}
break;
@@ -770,7 +770,7 @@ void sub_80E6C84(void)
sub_80E8398(2);
sub_80E91D4(3);
DisplayYesNoMenu(23, 8, 0);
- MoveMenuCursor(1);
+ Menu_MoveCursor(1);
if (gEasyChatStruct->unk8 == 9
|| gEasyChatStruct->unk8 == 4
|| gEasyChatStruct->unk8 == 7
@@ -790,7 +790,7 @@ void sub_80E6C84(void)
case 0:
sub_80E91D4(4);
DisplayYesNoMenu(23, 8, 0);
- MoveMenuCursor(1);
+ Menu_MoveCursor(1);
gEasyChatStruct->unk24++;
break;
case -1:
@@ -856,7 +856,7 @@ void sub_80E6D7C(void)
sub_80E91D4(1);
sub_80E9744();
DisplayYesNoMenu(23, 8, 0);
- MoveMenuCursor(0);
+ Menu_MoveCursor(0);
gEasyChatStruct->unk24++;
}
break;
@@ -1738,5 +1738,5 @@ void sub_80E81FC(void)
{
PlaySE(SE_SELECT);
sub_80E95A4();
- MenuZeroFillWindowRect(0, 0, 29, 13);
+ Menu_EraseWindowRect(0, 0, 29, 13);
}
diff --git a/src/easy_chat_2.c b/src/easy_chat_2.c
index fe3aa7cc9..5acdba04e 100644
--- a/src/easy_chat_2.c
+++ b/src/easy_chat_2.c
@@ -1068,13 +1068,13 @@ void sub_80E91D4(u8 a)
if (a == 10)
{
- MenuZeroFillWindowRect(3, 14, 26, 19);
+ Menu_EraseWindowRect(3, 14, 26, 19);
sub_80E9198(10);
return;
}
if (sub_80E91A4() == 10)
- MenuDrawTextWindow(3, 14, 26, 19);
+ Menu_DrawStdWindowFrame(3, 14, 26, 19);
sub_80E9198(a);
switch (a)
@@ -1175,7 +1175,7 @@ void sub_80E9368(u8 a)
if (r4 != NULL)
{
sub_8072C74(gEasyChatStruct->unk9F8E + 3, r4, 240, 2);
- MenuPrint(gEasyChatStruct->unk9F8E, 0, 0);
+ Menu_PrintText(gEasyChatStruct->unk9F8E, 0, 0);
}
else
{
@@ -1186,8 +1186,8 @@ void sub_80E9368(u8 a)
str[2] = 0x10;
str[3] = EOS;
- MenuPrint(gEasyChatStruct->unk9F8E, 0, 0);
- MenuPrint(gEasyChatStruct->unk9F8E, 28, 0);
+ Menu_PrintText(gEasyChatStruct->unk9F8E, 0, 0);
+ Menu_PrintText(gEasyChatStruct->unk9F8E, 28, 0);
}
BasicInitMenuWindow(&gWindowConfig_81E6DA8);
}
@@ -1259,7 +1259,7 @@ void sub_80E9620(u16 a, u16 b)
{
if (r10 >= gEasyChatStruct->unkA)
{
- MenuPrint(gUnknown_083DBEA8, r6, r7);
+ Menu_PrintText(gUnknown_083DBEA8, r6, r7);
break;
}
if (gEasyChatStruct->unkC[r10] == 0xFFFF)
@@ -1270,7 +1270,7 @@ void sub_80E9620(u16 a, u16 b)
else
{
sub_80EB218(gEasyChatStruct->unk9E14, gEasyChatStruct->unkC[r10], 11);
- MenuPrint(gEasyChatStruct->unk9E14, r6, r7);
+ Menu_PrintText(gEasyChatStruct->unk9E14, r6, r7);
r6 += gEasyChatStruct->unk8C[i][j] + 11;
}
r10++;
@@ -1337,7 +1337,7 @@ void sub_80E97C0(u16 a, u16 b)
r2[2] = r1 * 8;
r2[3] = EOS;
- MenuPrint(gEasyChatStruct->unk9E6E, b, a);
+ Menu_PrintText(gEasyChatStruct->unk9E6E, b, a);
a += 2;
}
@@ -1378,7 +1378,7 @@ void sub_80E98C4(void)
default:
return;
}
- MenuFillWindowRectWithBlankTile(2, r1, 27, r3 * 2 + r1 - 1);
+ Menu_BlankWindowRect(2, r1, 27, r3 * 2 + r1 - 1);
BasicInitMenuWindow(&gWindowConfig_81E6DA8);
}
@@ -1386,7 +1386,7 @@ void sub_80E9940(u8 *a, u8 b)
{
u8 r4 = (b & 7);
- MenuFillWindowRectWithBlankTile(2, r4 * 2, 31, r4 * 2 + 1);
+ Menu_BlankWindowRect(2, r4 * 2, 31, r4 * 2 + 1);
sub_80E9A7C(a, b);
sub_80E9A60(a, 2, r4 * 2);
}
@@ -1453,7 +1453,7 @@ void sub_80E9A4C(void)
void sub_80E9A60(const u8 *a, u16 b, u16 c)
{
c &= 0xF;
- MenuPrint(a, b, c);
+ Menu_PrintText(a, b, c);
}
void sub_80E9A7C(u8 *dest, u16 b)
@@ -1523,7 +1523,7 @@ void sub_80E9AF8(u16 a)
void sub_80E9C74(u16 a)
{
a &= 7;
- MenuFillWindowRectWithBlankTile(0, a * 2, 29, a * 2 + 1);
+ Menu_BlankWindowRect(0, a * 2, 29, a * 2 + 1);
}
void sub_80E9C94(void)
diff --git a/src/engine/cable_club.c b/src/engine/cable_club.c
index 3187de7ed..b12ee38ce 100644
--- a/src/engine/cable_club.c
+++ b/src/engine/cable_club.c
@@ -109,13 +109,13 @@ static void sub_8082CD4(u8 arg0, u8 arg1)
static void sub_8082D18(u32 value)
{
ConvertIntToDecimalStringN(gStringVar1, value, STR_CONV_MODE_LEFT_ALIGN, 1);
- MenuDrawTextWindow(18, 10, 28, 13);
+ Menu_DrawStdWindowFrame(18, 10, 28, 13);
sub_8072BD8(gOtherText_PLink, 19, 11, 72);
}
static void sub_8082D4C()
{
- MenuZeroFillWindowRect(18, 10, 28, 13);
+ Menu_EraseWindowRect(18, 10, 28, 13);
}
static void sub_8082D60(u8 taskId, u8 arg1)
@@ -790,7 +790,7 @@ static void sub_80839DC(u8 taskId)
case 3:
sub_8055588();
HideFieldMessageBox();
- MenuZeroFillScreen();
+ Menu_EraseScreen();
DestroyTask(taskId);
EnableBothScriptContexts();
break;
diff --git a/src/engine/clear_save_data_menu.c b/src/engine/clear_save_data_menu.c
index 12cde22a7..ae6c85180 100644
--- a/src/engine/clear_save_data_menu.c
+++ b/src/engine/clear_save_data_menu.c
@@ -41,10 +41,10 @@ static void Task_InitMenu(u8 taskId)
REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | DISPCNT_BG3_ON | DISPCNT_OBJ_ON;
SetVBlankCallback(VBlankCB_ClearSaveDataScreen);
- MenuDrawTextWindow(2, 14, 27, 19);
- MenuPrint(gSystemText_ClearAllSaveDataPrompt, 3, 15);
+ Menu_DrawStdWindowFrame(2, 14, 27, 19);
+ Menu_PrintText(gSystemText_ClearAllSaveDataPrompt, 3, 15);
- MenuDrawTextWindow(2, 1, 8, 6);
+ Menu_DrawStdWindowFrame(2, 1, 8, 6);
PrintMenuItems(3, 2, 2, gMenuYesNoItems);
InitMenu(0, 3, 2, 2, 1, 5);
diff --git a/src/engine/link.c b/src/engine/link.c
index 28323207c..a2df02b5f 100644
--- a/src/engine/link.c
+++ b/src/engine/link.c
@@ -239,7 +239,7 @@ void LinkTestScreen(void)
ResetTasks();
SetVBlankCallback(VBlankCB_LinkTest);
SetUpWindowConfig(&gWindowConfig_81E6CE4);
- InitMenuWindow((struct WindowConfig *)&gWindowConfig_81E6CE4);
+ InitMenuWindow((struct WindowTemplate *)&gWindowConfig_81E6CE4);
ResetBlockSend();
gLinkType = 0x1111;
OpenLink();
@@ -1237,8 +1237,8 @@ void CB2_LinkError(void)
ResetTasks();
SetVBlankCallback(VBlankCB_LinkTest);
SetUpWindowConfig(&gWindowConfig_81E7198);
- InitMenuWindow((struct WindowConfig *)&gWindowConfig_81E7198);
- MenuZeroFillScreen();
+ InitMenuWindow((struct WindowTemplate *)&gWindowConfig_81E7198);
+ Menu_EraseScreen();
REG_BLDALPHA = 0;
REG_BG0VOFS = 0;
REG_BG0HOFS = 0;
diff --git a/src/engine/main_menu.c b/src/engine/main_menu.c
index 909b5676b..623969802 100644
--- a/src/engine/main_menu.c
+++ b/src/engine/main_menu.c
@@ -234,7 +234,7 @@ u32 InitMainMenu(u8 a1)
ResetSpriteData();
FreeAllSpritePalettes();
SetUpWindowConfig(&gWindowConfig_81E6C3C);
- InitMenuWindow((struct WindowConfig *)&gWindowConfig_81E6CE4);
+ InitMenuWindow((struct WindowTemplate *)&gWindowConfig_81E6CE4);
if (a1)
BeginNormalPaletteFade(-1, 0, 0x10, 0, 0x0000); // fade to black
@@ -293,7 +293,7 @@ void Task_MainMenuCheckSave(u8 taskId)
gTasks[taskId].func = Task_MainMenuCheckRtc;
break;
case 2:
- MenuDrawTextWindow(2, 14, 27, 19);
+ Menu_DrawStdWindowFrame(2, 14, 27, 19);
MenuPrintMessage(gSaveFileDeletedMessage, 3, 15);
REG_WIN0H = WIN_RANGE(17, 223);
REG_WIN0V = WIN_RANGE(113, 159);
@@ -301,7 +301,7 @@ void Task_MainMenuCheckSave(u8 taskId)
gTasks[taskId].func = Task_MainMenuWaitForSaveErrorAck;
break;
case 255:
- MenuDrawTextWindow(2, 14, 27, 19);
+ Menu_DrawStdWindowFrame(2, 14, 27, 19);
MenuPrintMessage(gSaveFileCorruptMessage, 3, 15);
REG_WIN0H = WIN_RANGE(17, 223);
REG_WIN0V = WIN_RANGE(113, 159);
@@ -319,7 +319,7 @@ void Task_MainMenuCheckSave(u8 taskId)
gTasks[taskId].func = Task_MainMenuCheckRtc;
break;
case 4:
- MenuDrawTextWindow(2, 14, 27, 19);
+ Menu_DrawStdWindowFrame(2, 14, 27, 19);
MenuPrintMessage(gBoardNotInstalledMessage, 3, 15);
REG_WIN0H = WIN_RANGE(17, 223);
REG_WIN0V = WIN_RANGE(113, 159);
@@ -331,11 +331,11 @@ void Task_MainMenuCheckSave(u8 taskId)
void Task_MainMenuWaitForSaveErrorAck(u8 taskId)
{
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
{
if (gMain.newKeys & A_BUTTON)
{
- MenuZeroFillWindowRect(2, 14, 27, 19);
+ Menu_EraseWindowRect(2, 14, 27, 19);
gTasks[taskId].func = Task_MainMenuCheckRtc;
}
}
@@ -359,7 +359,7 @@ void Task_MainMenuCheckRtc(u8 taskId)
}
else
{
- MenuDrawTextWindow(2, 14, 27, 19);
+ Menu_DrawStdWindowFrame(2, 14, 27, 19);
MenuPrintMessage(gBatteryDryMessage, 3, 15);
REG_WIN0H = WIN_RANGE(17, 223);
REG_WIN0V = WIN_RANGE(113, 159);
@@ -370,11 +370,11 @@ void Task_MainMenuCheckRtc(u8 taskId)
void Task_MainMenuWaitForRtcErrorAck(u8 taskId)
{
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
{
if ( gMain.newKeys & 1 )
{
- MenuZeroFillWindowRect(2, 14, 27, 19);
+ Menu_EraseWindowRect(2, 14, 27, 19);
gTasks[taskId].func = Task_MainMenuDraw;
}
}
@@ -412,28 +412,28 @@ void Task_MainMenuDraw(u8 taskId)
{
case HAS_NO_SAVED_GAME:
default:
- MenuDrawTextWindow(1, 0, 28, 3);
+ Menu_DrawStdWindowFrame(1, 0, 28, 3);
PrintMainMenuItem(gMainMenuString_NewGame, 2, 1);
- MenuDrawTextWindow(1, 4, 28, 7);
+ Menu_DrawStdWindowFrame(1, 4, 28, 7);
PrintMainMenuItem(gMainMenuString_Option, 2, 5);
break;
case HAS_SAVED_GAME:
- MenuDrawTextWindow(1, 0, 28, 7);
+ Menu_DrawStdWindowFrame(1, 0, 28, 7);
PrintMainMenuItem(gMainMenuString_Continue, 2, 1);
- MenuDrawTextWindow(1, 8, 28, 11);
+ Menu_DrawStdWindowFrame(1, 8, 28, 11);
PrintMainMenuItem(gMainMenuString_NewGame, 2, 9);
- MenuDrawTextWindow(1, 12, 28, 15);
+ Menu_DrawStdWindowFrame(1, 12, 28, 15);
PrintMainMenuItem(gMainMenuString_Option, 2, 13);
PrintSaveFileInfo();
break;
case HAS_MYSTERY_GIFT:
- MenuDrawTextWindow(1, 0, 28, 7);
+ Menu_DrawStdWindowFrame(1, 0, 28, 7);
PrintMainMenuItem(gMainMenuString_Continue, 2, 1);
- MenuDrawTextWindow(1, 8, 28, 11);
+ Menu_DrawStdWindowFrame(1, 8, 28, 11);
PrintMainMenuItem(gMainMenuString_NewGame, 2, 9);
- MenuDrawTextWindow(1, 12, 28, 15);
+ Menu_DrawStdWindowFrame(1, 12, 28, 15);
PrintMainMenuItem(gMainMenuString_MysteryEvents, 2, 13);
- MenuDrawTextWindow(1, 16, 28, 19);
+ Menu_DrawStdWindowFrame(1, 16, 28, 19);
PrintMainMenuItem(gMainMenuString_Option, 2, 0x11);
PrintSaveFileInfo();
break;
@@ -681,7 +681,7 @@ void PrintMainMenuItem(const u8 *text, u8 left, u8 top)
buffer[29] = EOS;
- MenuPrint(buffer, left, top);
+ Menu_PrintText(buffer, left, top);
}
void PrintSaveFileInfo(void)
@@ -694,8 +694,8 @@ void PrintSaveFileInfo(void)
void PrintPlayerName(void)
{
- MenuPrint(gMainMenuString_Player, 2, 3);
- MenuPrint(gSaveBlock2.playerName, 9, 3);
+ Menu_PrintText(gMainMenuString_Player, 2, 3);
+ Menu_PrintText(gSaveBlock2.playerName, 9, 3);
}
void PrintPlayTime(void)
@@ -704,15 +704,15 @@ void PrintPlayTime(void)
u8 alignedPlayTime[32];
#if defined(ENGLISH)
- MenuPrint(gMainMenuString_Time, 16, 3);
+ Menu_PrintText(gMainMenuString_Time, 16, 3);
FormatPlayTime(playTime, gSaveBlock2.playTimeHours, gSaveBlock2.playTimeMinutes, 1);
sub_8072C74(alignedPlayTime, playTime, 48, 1);
- MenuPrint(alignedPlayTime, 22, 3);
+ Menu_PrintText(alignedPlayTime, 22, 3);
#elif defined(GERMAN)
MenuPrint_PixelCoords(gMainMenuString_Time, 124, 24, TRUE);
FormatPlayTime(playTime, gSaveBlock2.playTimeHours, gSaveBlock2.playTimeMinutes, 1);
sub_8072C74(alignedPlayTime, playTime, 40, 1);
- MenuPrint(alignedPlayTime, 23, 3);
+ Menu_PrintText(alignedPlayTime, 23, 3);
#endif
}
@@ -720,9 +720,9 @@ void PrintPokedexCount(void)
{
u8 buffer[16];
- MenuPrint(gMainMenuString_Pokedex, 2, 5);
+ Menu_PrintText(gMainMenuString_Pokedex, 2, 5);
sub_8072C14(buffer, GetPokedexSeenCount(), 18, 0);
- MenuPrint(buffer, 9, 5);
+ Menu_PrintText(buffer, 9, 5);
}
void PrintBadgeCount(void)
@@ -730,7 +730,7 @@ void PrintBadgeCount(void)
u8 buffer[16];
#if defined(ENGLISH)
- MenuPrint(gMainMenuString_Badges, 16, 5);
+ Menu_PrintText(gMainMenuString_Badges, 16, 5);
#elif defined(GERMAN)
MenuPrint_PixelCoords(gMainMenuString_Badges, 124, 40, TRUE);
#endif
@@ -751,7 +751,7 @@ void PrintBadgeCount(void)
static void Task_NewGameSpeech1(u8 taskId)
{
SetUpWindowConfig(&gWindowConfig_81E6C3C);
- InitMenuWindow((struct WindowConfig *)&gWindowConfig_81E6CE4);
+ InitMenuWindow((struct WindowTemplate *)&gWindowConfig_81E6CE4);
REG_WIN0H = 0;
REG_WIN0V = 0;
REG_WININ = 0;
@@ -812,7 +812,7 @@ static void Task_NewGameSpeech3(u8 taskId)
}
else
{
- MenuDrawTextWindow(2, 13, 27, 18);
+ Menu_DrawStdWindowFrame(2, 13, 27, 18);
//"Hi! Sorry to keep you waiting...
//...But everyone calls me the POKEMON PROFESSOR."
MenuPrintMessage(gBirchSpeech_Welcome, 3, 14);
@@ -886,7 +886,7 @@ static void Task_NewGameSpeech9(u8 taskId)
{
if (BirchSpeechUpdateWindowText())
{
- MenuDrawTextWindow(2, 13, 27, 18);
+ Menu_DrawStdWindowFrame(2, 13, 27, 18);
//"And you are?"
MenuPrintMessage(gBirchSpeech_AndYouAre, 3, 14);
gTasks[taskId].func = Task_NewGameSpeech10;
@@ -962,7 +962,7 @@ static void Task_NewGameSpeech13(u8 taskId)
static void Task_NewGameSpeech14(u8 taskId)
{
- MenuDrawTextWindow(2, 13, 27, 18);
+ Menu_DrawStdWindowFrame(2, 13, 27, 18);
//"Are you a boy? Or are you a girl?"
MenuPrintMessage(gBirchSpeech_AreYouBoyOrGirl, 3, 14);
gTasks[taskId].func = Task_NewGameSpeech15;
@@ -988,19 +988,19 @@ static void Task_NewGameSpeech16(u8 taskId)
HandleDestroyMenuCursors();
PlaySE(SE_SELECT);
gSaveBlock2.playerGender = MALE;
- MenuZeroFillWindowRect(2, 4, 8, 9);
+ Menu_EraseWindowRect(2, 4, 8, 9);
gTasks[taskId].func = Task_NewGameSpeech19;
break;
case FEMALE:
HandleDestroyMenuCursors();
PlaySE(SE_SELECT);
gSaveBlock2.playerGender = FEMALE;
- MenuZeroFillWindowRect(2, 4, 8, 9);
+ Menu_EraseWindowRect(2, 4, 8, 9);
gTasks[taskId].func = Task_NewGameSpeech19;
break;
}
- cursorPos = GetMenuCursorPos();
+ cursorPos = Menu_GetCursorPos();
if (cursorPos != gTasks[taskId].tGenderSelection)
{
@@ -1062,7 +1062,7 @@ static void Task_NewGameSpeech18(u8 taskId)
static void Task_NewGameSpeech19(u8 taskId)
{
- MenuDrawTextWindow(2, 13, 27, 18);
+ Menu_DrawStdWindowFrame(2, 13, 27, 18);
//"All right. What's your name?"
MenuPrintMessage(gBirchSpeech_WhatsYourName, 3, 14);
gTasks[taskId].func = Task_NewGameSpeech20;
@@ -1090,7 +1090,7 @@ static void Task_NewGameSpeech21(u8 taskId)
case 4:
HandleDestroyMenuCursors();
PlaySE(SE_SELECT);
- MenuZeroFillWindowRect(2, 1, 22, 12);
+ Menu_EraseWindowRect(2, 1, 22, 12);
SetPresetPlayerName(selection);
gTasks[taskId].func = Task_NewGameSpeech23;
break;
@@ -1102,7 +1102,7 @@ static void Task_NewGameSpeech21(u8 taskId)
case -1: //B button
HandleDestroyMenuCursors();
PlaySE(SE_SELECT);
- MenuZeroFillWindowRect(2, 1, 22, 12);
+ Menu_EraseWindowRect(2, 1, 22, 12);
gTasks[taskId].func = Task_NewGameSpeech14; //Go back to gender menu
break;
}
@@ -1120,7 +1120,7 @@ static void Task_NewGameSpeech22(u8 taskId)
static void Task_NewGameSpeech23(u8 taskId)
{
- MenuDrawTextWindow(2, 13, 27, 18);
+ Menu_DrawStdWindowFrame(2, 13, 27, 18);
//"So it's (PLAYER)?"
StringExpandPlaceholders(gStringVar4, gBirchSpeech_SoItsPlayer);
MenuPrintMessage(gStringVar4, 3, 14);
@@ -1143,7 +1143,7 @@ static void Task_NewGameSpeech25(u8 taskId)
{
case 0: //YES
PlaySE(SE_SELECT);
- MenuZeroFillWindowRect(2, 1, 8, 7);
+ Menu_EraseWindowRect(2, 1, 8, 7);
gSprites[gTasks[taskId].tTrainerSpriteId].oam.objMode = ST_OAM_OBJ_BLEND;
StartSpriteFadeOut(taskId, 2);
StartBackgroundFadeOut(taskId, 1);
@@ -1152,7 +1152,7 @@ static void Task_NewGameSpeech25(u8 taskId)
case -1: //B button
case 1: //NO
PlaySE(SE_SELECT);
- MenuZeroFillWindowRect(2, 1, 8, 7);
+ Menu_EraseWindowRect(2, 1, 8, 7);
gTasks[taskId].func = Task_NewGameSpeech14; //Go back to gender menu
break;
}
@@ -1197,7 +1197,7 @@ static void Task_NewGameSpeech27(u8 taskId)
StartSpriteFadeIn(taskId, 2);
StartBackgroundFadeIn(taskId, 1);
- MenuDrawTextWindow(2, 13, 27, 18);
+ Menu_DrawStdWindowFrame(2, 13, 27, 18);
StringExpandPlaceholders(gStringVar4, gBirchSpeech_AhOkayYouArePlayer);
//"Ah, okay! You're (PLAYER) who's moving...
//...I get it now!"
@@ -1267,7 +1267,7 @@ static void Task_NewGameSpeech29(u8 taskId)
StartSpriteFadeIn(taskId, 2);
StartBackgroundFadeIn(taskId, 1);
- MenuDrawTextWindow(2, 13, 27, 18);
+ Menu_DrawStdWindowFrame(2, 13, 27, 18);
MenuPrintMessage(gBirchSpeech_AreYouReady, 3, 14);
gTasks[taskId].func = Task_NewGameSpeech30;
}
@@ -1374,7 +1374,7 @@ void CB_ContinueNewGameSpeechPart2()
AddBirchSpeechObjects(taskId);
SetUpWindowConfig(&gWindowConfig_81E6C3C);
- InitMenuWindow((struct WindowConfig *)&gWindowConfig_81E6CE4);
+ InitMenuWindow((struct WindowTemplate *)&gWindowConfig_81E6CE4);
if (gSaveBlock2.playerGender != MALE)
{
@@ -1661,7 +1661,7 @@ static void StartBackgroundFadeIn(u8 taskId, u8 interval)
static void CreateGenderMenu(u8 left, u8 top)
{
u8 menuLeft, menuTop;
- MenuDrawTextWindow(left, top, left + 6, top + 5);
+ Menu_DrawStdWindowFrame(left, top, left + 6, top + 5);
menuLeft = left + 1;
menuTop = top + 1;
PrintMenuItems(menuLeft, menuTop, 2, gUnknown_081E79B0);
@@ -1670,12 +1670,12 @@ static void CreateGenderMenu(u8 left, u8 top)
static s8 GenderMenuProcessInput(void)
{
- return ProcessMenuInputNoWrap();
+ return Menu_ProcessInputNoWrap();
}
static void CreateNameMenu(u8 left, u8 top)
{
- MenuDrawTextWindow(left, top, left + 10, top + 11);
+ Menu_DrawStdWindowFrame(left, top, left + 10, top + 11);
if (gSaveBlock2.playerGender == MALE)
PrintMenuItems(left + 1, top + 1, 5, gMalePresetNames);
@@ -1687,7 +1687,7 @@ static void CreateNameMenu(u8 left, u8 top)
static s8 NameMenuProcessInput(void)
{
- return ProcessMenuInput();
+ return Menu_ProcessInput();
}
static void SetPresetPlayerName(u8 index)
diff --git a/src/engine/menu.c b/src/engine/menu.c
index 10988c1d7..fe88bf4e4 100644
--- a/src/engine/menu.c
+++ b/src/engine/menu.c
@@ -24,8 +24,8 @@ struct Menu
u8 columnXCoords[8];
};
-static void MultistepInitMenuWindowInternal(const struct WindowConfig *, u16);
-static void InitMenuWindowInternal(const struct WindowConfig *, u16);
+static void MultistepInitMenuWindowInternal(const struct WindowTemplate *, u16);
+static void InitMenuWindowInternal(const struct WindowTemplate *, u16);
static bool8 sub_80723D4(void);
static u8 sub_8072484(u8, u8, u8, u8, u8, u8, u32);
static u8 sub_80724F4(u8, u8, u8, const struct MenuAction[], u8);
@@ -52,7 +52,7 @@ const struct MenuAction gMenuYesNoItems[] =
void CloseMenu(void)
{
PlaySE(SE_SELECT);
- MenuZeroFillScreen();
+ Menu_EraseScreen();
sub_8064E2C();
ScriptContext2_Disable();
HandleDestroyMenuCursors();
@@ -64,22 +64,22 @@ void AppendToList(u8 *list, u8 *pindex, u32 value)
(*pindex)++;
}
-void InitMenuWindow(const struct WindowConfig *winConfig)
+void InitMenuWindow(const struct WindowTemplate *winTemplate)
{
- InitMenuWindowInternal(winConfig, 1);
+ InitMenuWindowInternal(winTemplate, 1);
}
-void MultistepInitMenuWindowBegin(const struct WindowConfig *winConfig)
+void MultistepInitMenuWindowBegin(const struct WindowTemplate *winTemplate)
{
- MultistepInitMenuWindowInternal(winConfig, 1);
+ MultistepInitMenuWindowInternal(winTemplate, 1);
}
-static void MultistepInitMenuWindowInternal(const struct WindowConfig *winConfig, u16 tileOffset)
+static void MultistepInitMenuWindowInternal(const struct WindowTemplate *winTemplate, u16 tileOffset)
{
gMenuMultistepInitState = 0;
gMenuTextTileOffset = tileOffset;
gMenuWindowPtr = &gMenuWindow;
- InitWindowFromConfig(&gMenuWindow, winConfig);
+ Text_InitWindowWithTemplate(&gMenuWindow, winTemplate);
}
bool32 MultistepInitMenuWindowContinue(void)
@@ -97,13 +97,13 @@ bool32 MultistepInitMenuWindowContinue(void)
goto fail;
goto next;
case 3:
- gMenuTextWindowContentTileOffset = SetTextWindowBaseTileNum(gMenuTextWindowTileOffset);
+ gMenuTextWindowContentTileOffset = TextWindow_SetBaseTileNum(gMenuTextWindowTileOffset);
next:
gMenuMultistepInitState++;
return 0;
case 4:
- LoadTextWindowGraphics(gMenuWindowPtr);
- gMenuMessageBoxContentTileOffset = SetMessageBoxBaseTileNum(gMenuTextWindowContentTileOffset);
+ TextWindow_LoadStdFrameGraphics(gMenuWindowPtr);
+ gMenuMessageBoxContentTileOffset = TextWindow_SetDlgFrameBaseTileNum(gMenuTextWindowContentTileOffset);
return 1;
default:
fail:
@@ -111,73 +111,73 @@ bool32 MultistepInitMenuWindowContinue(void)
}
}
-static void InitMenuWindowInternal(const struct WindowConfig *winConfig, u16 tileOffset)
+static void InitMenuWindowInternal(const struct WindowTemplate *winTemplate, u16 tileOffset)
{
gMenuWindowPtr = &gMenuWindow;
- InitWindowFromConfig(&gMenuWindow, winConfig);
+ Text_InitWindowWithTemplate(&gMenuWindow, winTemplate);
gMenuTextTileOffset = tileOffset;
gMenuTextWindowTileOffset = InitWindowTileData(gMenuWindowPtr, gMenuTextTileOffset);
- gMenuTextWindowContentTileOffset = SetTextWindowBaseTileNum(gMenuTextWindowTileOffset);
- LoadTextWindowGraphics(gMenuWindowPtr);
- gMenuMessageBoxContentTileOffset = SetMessageBoxBaseTileNum(gMenuTextWindowContentTileOffset);
+ gMenuTextWindowContentTileOffset = TextWindow_SetBaseTileNum(gMenuTextWindowTileOffset);
+ TextWindow_LoadStdFrameGraphics(gMenuWindowPtr);
+ gMenuMessageBoxContentTileOffset = TextWindow_SetDlgFrameBaseTileNum(gMenuTextWindowContentTileOffset);
}
-void unref_sub_8071DA4(struct WindowConfig *winConfig, u16 tileOffset)
+void unref_sub_8071DA4(struct WindowTemplate *winTemplate, u16 tileOffset)
{
gMenuWindowPtr = &gMenuWindow;
- InitWindowFromConfig(&gMenuWindow, winConfig);
+ Text_InitWindowWithTemplate(&gMenuWindow, winTemplate);
gMenuTextWindowTileOffset = tileOffset;
- gMenuTextWindowContentTileOffset = SetTextWindowBaseTileNum(gMenuTextWindowTileOffset);
- LoadTextWindowGraphics(gMenuWindowPtr);
- gMenuTextTileOffset = SetMessageBoxBaseTileNum(gMenuTextWindowContentTileOffset);
+ gMenuTextWindowContentTileOffset = TextWindow_SetBaseTileNum(gMenuTextWindowTileOffset);
+ TextWindow_LoadStdFrameGraphics(gMenuWindowPtr);
+ gMenuTextTileOffset = TextWindow_SetDlgFrameBaseTileNum(gMenuTextWindowContentTileOffset);
gMenuMessageBoxContentTileOffset = InitWindowTileData(gMenuWindowPtr, gMenuTextTileOffset);
}
-void MenuLoadTextWindowGraphics_OverrideFrameType(u8 frameType)
+void Menu_LoadStdFrameGraphicsOverrideStyle(u8 frameType)
{
- LoadTextWindowGraphics_OverrideFrameType(gMenuWindowPtr, frameType);
+ TextWindow_LoadStdFrameGraphicsOverrideStyle(gMenuWindowPtr, frameType);
}
-void MenuLoadTextWindowGraphics(void)
+void Menu_LoadStdFrameGraphics(void)
{
- LoadTextWindowGraphics(gMenuWindowPtr);
+ TextWindow_LoadStdFrameGraphics(gMenuWindowPtr);
}
-void BasicInitMenuWindow(const struct WindowConfig *winConfig)
+void BasicInitMenuWindow(const struct WindowTemplate *winTemplate)
{
- InitWindowFromConfig(gMenuWindowPtr, winConfig);
+ Text_InitWindowWithTemplate(gMenuWindowPtr, winTemplate);
gMenuWindowPtr->tileDataStartOffset = gMenuTextTileOffset;
}
-void MenuPrint(const u8 *str, u8 left, u8 top)
+void Menu_PrintText(const u8 *str, u8 left, u8 top)
{
- sub_8003460(gMenuWindowPtr, str, gMenuTextTileOffset, left, top);
+ Text_InitWindowAndPrintText(gMenuWindowPtr, str, gMenuTextTileOffset, left, top);
}
-void MenuZeroFillWindowRect(u8 left, u8 top, u8 right, u8 bottom)
+void Menu_EraseWindowRect(u8 left, u8 top, u8 right, u8 bottom)
{
ZeroFillWindowRect(gMenuWindowPtr, left, top, right, bottom);
}
-void MenuFillWindowRectWithBlankTile(u8 left, u8 top, u8 right, u8 bottom)
+void Menu_BlankWindowRect(u8 left, u8 top, u8 right, u8 bottom)
{
- FillWindowRectWithBlankTile(gMenuWindowPtr, left, top, right, bottom);
+ Text_BlankWindowRect(gMenuWindowPtr, left, top, right, bottom);
}
-void MenuZeroFillScreen(void)
+void Menu_EraseScreen(void)
{
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
}
-void MenuDrawTextWindow(u8 left, u8 top, u8 right, u8 bottom)
+void Menu_DrawStdWindowFrame(u8 left, u8 top, u8 right, u8 bottom)
{
- DrawTextWindow(gMenuWindowPtr, left, top, right, bottom);
+ TextWindow_DrawStdFrame(gMenuWindowPtr, left, top, right, bottom);
}
void sub_8071F40(const u8 *str)
{
- MenuDrawTextWindow(2, 14, 28, 19);
- MenuPrint(str, 3, 15);
+ Menu_DrawStdWindowFrame(2, 14, 28, 19);
+ Menu_PrintText(str, 3, 15);
}
void sub_8071F60(u8 a1, u8 a2, u8 a3)
@@ -187,27 +187,27 @@ void sub_8071F60(u8 a1, u8 a2, u8 a3)
u16 unref_sub_8071F98(u8 x, u8 y)
{
- return GetWindowTilemapEntry(gMenuWindowPtr, x, y);
+ return Text_GetWindowTilemapEntry(gMenuWindowPtr, x, y);
}
void unref_sub_8071FBC(u16 a1, u8 a2, u8 a3, u8 a4, u8 a5)
{
- DrawWindowRect(gMenuWindowPtr, a1, a2, a3, a4, a5);
+ Text_FillWindowBorder(gMenuWindowPtr, a1, a2, a3, a4, a5);
}
-void MenuDisplayMessageBox(void)
+void Menu_DisplayDialogueFrame(void)
{
- DisplayMessageBox(gMenuWindowPtr);
+ TextWindow_DisplayDialogueFrame(gMenuWindowPtr);
}
void MenuPrintMessage(const u8 *str, u8 left, u8 top)
{
- sub_8002EB0(gMenuWindowPtr, str, gMenuTextTileOffset, left, top);
+ Text_InitWindow8002EB0(gMenuWindowPtr, str, gMenuTextTileOffset, left, top);
}
void MenuPrintMessageDefaultCoords(const u8 *str)
{
- sub_8002EB0(gMenuWindowPtr, str, gMenuTextTileOffset, 2, 15);
+ Text_InitWindow8002EB0(gMenuWindowPtr, str, gMenuTextTileOffset, 2, 15);
}
void MenuSetText(const u8 *str)
@@ -215,22 +215,22 @@ void MenuSetText(const u8 *str)
sub_8002E90(gMenuWindowPtr, str);
}
-u8 MenuUpdateWindowText(void)
+u8 Menu_UpdateWindowText(void)
{
- return sub_80035AC(gMenuWindowPtr);
+ return Text_UpdateWindow(gMenuWindowPtr);
}
u8 unref_sub_8072098(void)
{
- return sub_8003418(gMenuWindowPtr);
+ return Text_PrintWindowSimple(gMenuWindowPtr);
}
-void sub_80720B0(void)
+void Menu_ClearWindowText(void)
{
- ClearWindowTextLines(gMenuWindowPtr);
+ Text_ClearWindow(gMenuWindowPtr);
}
-u8 MoveMenuCursor(s8 delta)
+u8 Menu_MoveCursor(s8 delta)
{
s32 newPos = gMenu.cursorPos + delta;
@@ -245,7 +245,7 @@ u8 MoveMenuCursor(s8 delta)
return gMenu.cursorPos;
}
-u8 MoveMenuCursorNoWrap(s8 delta)
+u8 Menu_MoveCursorNoWrap(s8 delta)
{
s32 newPos = gMenu.cursorPos + delta;
@@ -260,12 +260,12 @@ u8 MoveMenuCursorNoWrap(s8 delta)
return gMenu.cursorPos;
}
-u8 GetMenuCursorPos(void)
+u8 Menu_GetCursorPos(void)
{
return gMenu.cursorPos;
}
-s8 ProcessMenuInput(void)
+s8 Menu_ProcessInput(void)
{
if (gMain.newKeys & A_BUTTON)
{
@@ -285,20 +285,20 @@ s8 ProcessMenuInput(void)
if (gMain.newKeys & DPAD_UP)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(-1);
+ Menu_MoveCursor(-1);
return -2;
}
else if (gMain.newKeys & DPAD_DOWN)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(1);
+ Menu_MoveCursor(1);
return -2;
}
return -2;
}
-s8 ProcessMenuInputNoWrap(void)
+s8 Menu_ProcessInputNoWrap(void)
{
u8 cursorPos = gMenu.cursorPos;
@@ -319,18 +319,18 @@ s8 ProcessMenuInputNoWrap(void)
if (gMain.newKeys & DPAD_UP)
{
- if (cursorPos != MoveMenuCursorNoWrap(-1))
+ if (cursorPos != Menu_MoveCursorNoWrap(-1))
PlaySE(SE_SELECT);
return -2;
}
else if (gMain.newKeys & DPAD_DOWN)
{
- if (cursorPos != MoveMenuCursorNoWrap(1))
+ if (cursorPos != Menu_MoveCursorNoWrap(1))
PlaySE(SE_SELECT);
return -2;
}
- MoveMenuCursorNoWrap(0);
+ Menu_MoveCursorNoWrap(0);
return -2;
}
@@ -465,7 +465,7 @@ static u8 sub_80724F4(u8 left, u8 top, u8 menuItemCount, const struct MenuAction
totalWidth = (gMenu.columnXCoords[columnCount] + 1);
right = left + totalWidth;
- MenuDrawTextWindow(left, top, right, bottom);
+ Menu_DrawStdWindowFrame(left, top, right, bottom);
}
return maxWidth;
@@ -501,7 +501,7 @@ static void sub_8072620(u8 left, u8 top, u8 menuItemCount, const struct MenuActi
u8 row = 0;
u8 j;
for (j = 0; i + j < menuItemCount; j += columnCount, row++)
- MenuPrint(menuItems[i + j].text, left + gMenu.columnXCoords[i % columnCount], top + 2 * row);
+ Menu_PrintText(menuItems[i + j].text, left + gMenu.columnXCoords[i % columnCount], top + 2 * row);
}
}
@@ -513,14 +513,14 @@ void sub_807274C(u8 left, u8 top, u8 menuItemCount, u8 a4, const struct MenuActi
sub_8072620(left + 1, top + 1, menuItemCount, menuItems, columnCount);
}
-s8 sub_80727CC(void)
+s8 Menu_ProcessInputGridLayout(void)
{
if (gMain.newKeys & A_BUTTON)
{
if (gMenu.menu_field_7)
HandleDestroyMenuCursors();
PlaySE(SE_SELECT);
- return GetMenuCursorPos();
+ return Menu_GetCursorPos();
}
if (gMain.newKeys & B_BUTTON)
@@ -568,7 +568,7 @@ void PrintMenuItems(u8 left, u8 top, u8 menuItemCount, const struct MenuAction m
u8 i;
for (i = 0; i < menuItemCount; i++)
- MenuPrint(menuItems[i].text, left, top + 2 * i);
+ Menu_PrintText(menuItems[i].text, left, top + 2 * i);
}
void PrintMenuItemsReordered(u8 left, u8 top, u8 menuItemCount, const struct MenuAction2 menuItems[], const u8 *order)
@@ -576,7 +576,7 @@ void PrintMenuItemsReordered(u8 left, u8 top, u8 menuItemCount, const struct Men
u8 i;
for (i = 0; i < menuItemCount; i++)
- MenuPrint(menuItems[order[i]].text, left, top + 2 * i);
+ Menu_PrintText(menuItems[order[i]].text, left, top + 2 * i);
}
void InitYesNoMenu(u8 left, u8 top, u8 a3)
@@ -587,14 +587,14 @@ void InitYesNoMenu(u8 left, u8 top, u8 a3)
void DisplayYesNoMenu(u8 left, u8 top, u32 a3)
{
- MenuDrawTextWindow(left, top, left + 6, top + 5);
+ Menu_DrawStdWindowFrame(left, top, left + 6, top + 5);
InitYesNoMenu(left, top, 5);
gMenu.menu_field_7 = a3 ? -1 : 0;
}
s8 ProcessMenuInputNoWrap_(void)
{
- return ProcessMenuInputNoWrap();
+ return Menu_ProcessInputNoWrap();
}
u8 MenuPrint_PixelCoords(const u8 *text, u8 left, u16 top, u8 a4)
@@ -623,7 +623,7 @@ int sub_8072AB0(const u8 *str, u8 left, u16 top, u8 width, u8 height, u32 a6)
height = (height + 7) / 8;
if (newlineCount < height)
- MenuFillWindowRectWithBlankTile(left, top + 2 * newlineCount, left + width - 1, height + top - 1);
+ Menu_BlankWindowRect(left, top + 2 * newlineCount, left + width - 1, height + top - 1);
}
#elif GERMAN
__attribute__((naked))
@@ -700,7 +700,7 @@ _08072B0C:\n\
lsls r3, 24\n\
lsrs r3, 24\n\
adds r0, r5, 0\n\
- bl MenuFillWindowRectWithBlankTile\n\
+ bl Menu_BlankWindowRect\n\
_08072B3E:\n\
add sp, 0x10\n\
pop {r4-r7}\n\
@@ -720,7 +720,7 @@ void sub_8072B80(const u8 *a1, u8 a2, u8 a3, const u8 *a4)
u8 buffer[64];
u8 width = GetStringWidth(gMenuWindowPtr, a4);
AlignString(gMenuWindowPtr, buffer, a1, width, 1);
- sub_8003460(gMenuWindowPtr, buffer, gMenuTextTileOffset, a2, a3);
+ Text_InitWindowAndPrintText(gMenuWindowPtr, buffer, gMenuTextTileOffset, a2, a3);
}
void sub_8072BD8(const u8 *a1, u8 a2, u8 a3, u16 a4)
@@ -753,14 +753,14 @@ u8 sub_8072CBC()
return sub_8004E24(gMenuWindowPtr);
}
-void sub_8072CD4(u8 *a1, u8 *a2, u8 *a3)
+void Menu_GetTextColors(u8 *a1, u8 *a2, u8 *a3)
{
- sub_8004E28(gMenuWindowPtr, a1, a2, a3);
+ Text_GetTextColors(gMenuWindowPtr, a1, a2, a3);
}
u32 MenuUpdateWindowText_OverrideLineLength(u8 lineLength)
{
- return sub_80037C8(gMenuWindowPtr, lineLength);
+ return Text_UpdateWindowOverrideLineLength(gMenuWindowPtr, lineLength);
}
struct Window *unref_sub_8072D0C(void)
@@ -792,7 +792,7 @@ u8 InitMenu(u8 cursorSubpriority, u8 left, u8 top, u8 numChoices, u8 cursorPos,
pos = 0;
gMenu.cursorPos = pos;
- MoveMenuCursor(0);
+ Menu_MoveCursor(0);
return pos;
}
diff --git a/src/engine/mystery_event_menu.c b/src/engine/mystery_event_menu.c
index b9c3d5ad8..abb912938 100644
--- a/src/engine/mystery_event_menu.c
+++ b/src/engine/mystery_event_menu.c
@@ -47,7 +47,7 @@ void CB2_InitMysteryEventMenu(void)
SetVBlankCallback(VBlankCB);
SetUpWindowConfig(&gWindowConfig_81E6CE4);
InitMenuWindow(&gWindowConfig_81E6CE4);
- MenuZeroFillScreen();
+ Menu_EraseScreen();
REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON;
REG_BLDCNT = 0;
CreateTask(Task_DestroySelf, 0);
@@ -86,7 +86,7 @@ static void CB2_MysteryEventMenu(void)
switch (gMain.state)
{
case 0:
- MenuDrawTextWindow(0, 14, 29, 19);
+ Menu_DrawStdWindowFrame(0, 14, 29, 19);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
gMain.state++;
break;
@@ -97,7 +97,7 @@ static void CB2_MysteryEventMenu(void)
gMain.state++;
break;
case 2:
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
{
gMain.state++;
gLinkType = 21761;
@@ -119,7 +119,7 @@ static void CB2_MysteryEventMenu(void)
}
break;
case 4:
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
gMain.state++;
break;
#ifdef NONMATCHING
@@ -135,8 +135,8 @@ static void CB2_MysteryEventMenu(void)
{
PlaySE(SE_SELECT);
sub_8007F4C();
- MenuDrawTextWindow(6, 5, 23, 8);
- MenuPrint(gSystemText_LoadingEvent, 7, 6);
+ Menu_DrawStdWindowFrame(6, 5, 23, 8);
+ Menu_PrintText(gSystemText_LoadingEvent, 7, 6);
gMain.state++;
}
else if (gMain.newKeys & B_BUTTON)
@@ -155,7 +155,7 @@ static void CB2_MysteryEventMenu(void)
if (GetLinkPlayerDataExchangeStatusTimed() == 3)
{
sub_800832C();
- MenuZeroFillWindowRect(6, 5, 23, 8);
+ Menu_EraseWindowRect(6, 5, 23, 8);
GetEventLoadMessage(gStringVar4, 1);
MenuPrintMessageDefaultCoords(gStringVar4);
gMain.state = 13;
@@ -170,7 +170,7 @@ static void CB2_MysteryEventMenu(void)
else
{
CloseLink();
- MenuZeroFillWindowRect(6, 5, 23, 8);
+ Menu_EraseWindowRect(6, 5, 23, 8);
GetEventLoadMessage(gStringVar4, 1);
MenuPrintMessageDefaultCoords(gStringVar4);
gMain.state = 13;
@@ -195,8 +195,8 @@ static void CB2_MysteryEventMenu(void)
{
PlaySE(SE_SELECT);
sub_8007F4C();
- MenuDrawTextWindow(6, 5, 23, 8);
- MenuPrint(gSystemText_LoadingEvent, 7, 6);
+ Menu_DrawStdWindowFrame(6, 5, 23, 8);
+ Menu_PrintText(gSystemText_LoadingEvent, 7, 6);
gMain.state++;
}
else if (gMain.newKeys & B_BUTTON)
@@ -219,7 +219,7 @@ static void CB2_MysteryEventMenu(void)
if (GetLinkPlayerDataExchangeStatusTimed() == 3)
{
sub_800832C();
- MenuZeroFillWindowRect(6, 5, 23, 8);
+ Menu_EraseWindowRect(6, 5, 23, 8);
GetEventLoadMessage(gStringVar4, 1);
MenuPrintMessageDefaultCoords(gStringVar4);
ptr = (u8 *)&gMain;
@@ -245,7 +245,7 @@ static void CB2_MysteryEventMenu(void)
else
{
CloseLink();
- MenuZeroFillWindowRect(6, 5, 23, 8);
+ Menu_EraseWindowRect(6, 5, 23, 8);
label:
GetEventLoadMessage(gStringVar4, 1);
MenuPrintMessageDefaultCoords(gStringVar4);
@@ -266,7 +266,7 @@ static void CB2_MysteryEventMenu(void)
break;
#endif
case 7:
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
gMain.state++;
break;
case 8:
@@ -297,8 +297,8 @@ static void CB2_MysteryEventMenu(void)
gMain.state++;
break;
case 13:
- MenuZeroFillWindowRect(6, 5, 23, 8);
- if (MenuUpdateWindowText())
+ Menu_EraseWindowRect(6, 5, 23, 8);
+ if (Menu_UpdateWindowText())
{
gMain.state++;
gUnknown_02039338 = 0;
@@ -326,7 +326,7 @@ static void CB2_MysteryEventMenu(void)
if (!IsLinkMaster())
{
CloseLink();
- MenuZeroFillWindowRect(6, 5, 23, 8);
+ Menu_EraseWindowRect(6, 5, 23, 8);
GetEventLoadMessage(gStringVar4, 1);
MenuPrintMessageDefaultCoords(gStringVar4);
gMain.state = 13;
diff --git a/src/engine/naming_screen.c b/src/engine/naming_screen.c
index 440504d5a..5685584f5 100644
--- a/src/engine/naming_screen.c
+++ b/src/engine/naming_screen.c
@@ -503,7 +503,7 @@ static bool8 MainState_6(struct Task *task)
static bool8 MainState_UpdateSentToPCMessage(struct Task *task)
{
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
namingScreenDataPtr->state++;
return FALSE;
}
@@ -1611,7 +1611,7 @@ static void DisplaySentToPCMessage(void)
StringCopy(gStringVar1, namingScreenDataPtr->destBuffer);
StringExpandPlaceholders(gStringVar4, gOtherText_SentToPC);
BasicInitMenuWindow(&gWindowConfig_81E6E88);
- MenuDisplayMessageBox();
+ Menu_DisplayDialogueFrame();
MenuPrintMessageDefaultCoords(gStringVar4);
}
@@ -1757,7 +1757,7 @@ static void (*const gUnknown_083CE310[][2])(void) =
sub_80B7844,
};
-static const struct WindowConfig *const gUnknown_083CE328[][2][2] =
+static const struct WindowTemplate *const gUnknown_083CE328[][2][2] =
{
{
{&gWindowConfig_81E6EDC, &gWindowConfig_81E6EF8},
@@ -1838,7 +1838,7 @@ static void PrintKeyboardCharacters(u8 page) //print letters on page
s16 r5;
for (i = 0, r5 = 9; i < 4; i++, r5 += 2)
- MenuPrint(sKeyboardCharacters[page][i], 3, r5);
+ Menu_PrintText(sKeyboardCharacters[page][i], 3, r5);
}
static void sub_80B78A8(void)
@@ -1846,7 +1846,7 @@ static void sub_80B78A8(void)
BasicInitMenuWindow(&gWindowConfig_81E6F4C);
gUnknown_083CE358[namingScreenDataPtr->templateNum]();
gUnknown_083CE368[namingScreenDataPtr->template->unk3]();
- MenuPrint(namingScreenDataPtr->template->title, 9, 2);
+ Menu_PrintText(namingScreenDataPtr->template->title, 9, 2);
}
static void nullsub_61(void)
@@ -1870,7 +1870,7 @@ static void sub_80B7924(void)
{
if ((s16)namingScreenDataPtr->unk40 == MON_FEMALE)
genderSymbol[0] = 0xB6; //female symbol
- MenuPrint(genderSymbol, 0x14, 4);
+ Menu_PrintText(genderSymbol, 0x14, 4);
}
}
@@ -1887,7 +1887,7 @@ static void sub_80B7960(void)
string += 6;
StringCopy(string, namingScreenDataPtr->textBuffer);
BasicInitMenuWindow(&gWindowConfig_81E6F4C);
- MenuPrint(gStringVar1, namingScreenDataPtr->unk2, 4);
+ Menu_PrintText(gStringVar1, namingScreenDataPtr->unk2, 4);
}
//--------------------------------------------------
diff --git a/src/engine/option_menu.c b/src/engine/option_menu.c
index dfc49b035..f35ed5b5a 100644
--- a/src/engine/option_menu.c
+++ b/src/engine/option_menu.c
@@ -173,17 +173,17 @@ void CB2_InitOptionMenu(void)
gTasks[taskId].data[TD_BUTTONMODE] = gSaveBlock2.optionsButtonMode;
gTasks[taskId].data[TD_FRAMETYPE] = gSaveBlock2.optionsWindowFrameType;
- MenuDrawTextWindow(2, 0, 27, 3);
- MenuDrawTextWindow(2, 4, 27, 19);
-
- MenuPrint(gSystemText_OptionMenu, 4, 1);
- MenuPrint(gSystemText_TextSpeed, 4, 5);
- MenuPrint(gSystemText_BattleScene, 4, 7);
- MenuPrint(gSystemText_BattleStyle, 4, 9);
- MenuPrint(gSystemText_Sound, 4, 11);
- MenuPrint(gSystemText_ButtonMode, 4, 13);
- MenuPrint(gSystemText_Frame, 4, 15);
- MenuPrint(gSystemText_Cancel, 4, 17);
+ Menu_DrawStdWindowFrame(2, 0, 27, 3);
+ Menu_DrawStdWindowFrame(2, 4, 27, 19);
+
+ Menu_PrintText(gSystemText_OptionMenu, 4, 1);
+ Menu_PrintText(gSystemText_TextSpeed, 4, 5);
+ Menu_PrintText(gSystemText_BattleScene, 4, 7);
+ Menu_PrintText(gSystemText_BattleStyle, 4, 9);
+ Menu_PrintText(gSystemText_Sound, 4, 11);
+ Menu_PrintText(gSystemText_ButtonMode, 4, 13);
+ Menu_PrintText(gSystemText_Frame, 4, 15);
+ Menu_PrintText(gSystemText_Cancel, 4, 17);
TextSpeed_DrawChoices(gTasks[taskId].data[TD_TEXTSPEED]);
BattleScene_DrawChoices(gTasks[taskId].data[TD_BATTLESCENE]);
@@ -432,11 +432,11 @@ static u8 FrameType_ProcessInput(u8 selection)
{
if (gMain.newKeys & DPAD_RIGHT)
{
- if (selection <= 18)
+ if (selection < 19)
selection++;
else
selection = 0;
- MenuLoadTextWindowGraphics_OverrideFrameType(selection);
+ Menu_LoadStdFrameGraphicsOverrideStyle(selection);
}
if (gMain.newKeys & DPAD_LEFT)
{
@@ -444,7 +444,7 @@ static u8 FrameType_ProcessInput(u8 selection)
selection--;
else
selection = 19;
- MenuLoadTextWindowGraphics_OverrideFrameType(selection);
+ Menu_LoadStdFrameGraphicsOverrideStyle(selection);
}
return selection;
}
@@ -478,8 +478,8 @@ static void FrameType_DrawChoices(u8 selection)
}
text[i] = EOS;
- MenuPrint(gSystemText_Type, 15, 15);
- MenuPrint(text, 18, 15);
+ Menu_PrintText(gSystemText_Type, 15, 15);
+ Menu_PrintText(text, 18, 15);
}
#elif GERMAN
__attribute__((naked))
@@ -536,7 +536,7 @@ _0808C380:\n\
mov r0, sp\n\
movs r1, 0xF\n\
movs r2, 0xF\n\
- bl MenuPrint\n\
+ bl Menu_PrintText\n\
add sp, 0x10\n\
pop {r4-r6}\n\
pop {r0}\n\
diff --git a/src/engine/record_mixing.c b/src/engine/record_mixing.c
index c8e2e34d5..75ca92e6a 100644
--- a/src/engine/record_mixing.c
+++ b/src/engine/record_mixing.c
@@ -146,8 +146,8 @@ void Task_RecordMixing_Main(u8 taskId)
{
tState = 4;
data[10] = sub_8083664();
- sub_80720B0();
- MenuPrint(gOtherText_MixingComplete, 2, 15);
+ Menu_ClearWindowText();
+ Menu_PrintText(gOtherText_MixingComplete, 2, 15);
data[8] = 0;
}
break;
@@ -160,7 +160,7 @@ void Task_RecordMixing_Main(u8 taskId)
if (!gTasks[data[10]].isActive)
{
sub_8055588();
- MenuZeroFillScreen();
+ Menu_EraseScreen();
DestroyTask(taskId);
EnableBothScriptContexts();
}
@@ -176,8 +176,8 @@ void sub_80B95F0(u8 taskId)
{
case 0:
sub_80B9A78();
- MenuDisplayMessageBox();
- MenuPrint(gOtherText_MixingRecordsWithFriend, 2, 15);
+ Menu_DisplayDialogueFrame();
+ Menu_PrintText(gOtherText_MixingRecordsWithFriend, 2, 15);
task->data[8] = 0x708;
task->tState = 400;
ClearLinkCallback_2();
diff --git a/src/engine/reset_rtc_screen.c b/src/engine/reset_rtc_screen.c
index 67e146899..eb823b84b 100644
--- a/src/engine/reset_rtc_screen.c
+++ b/src/engine/reset_rtc_screen.c
@@ -267,7 +267,7 @@ void ResetRtcScreen_FreeCursorPalette(void)
void ResetRtcScreen_HideChooseTimeWindow(void)
{
- MenuZeroFillWindowRect(3, 8, 25, 11);
+ Menu_EraseWindowRect(3, 8, 25, 11);
}
void ResetRtcScreen_PrintTime(u8 x, u8 y, u16 days, u8 hours, u8 minutes, u8 seconds)
@@ -286,13 +286,13 @@ void ResetRtcScreen_PrintTime(u8 x, u8 y, u16 days, u8 hours, u8 minutes, u8 sec
dest = ConvertIntToDecimalStringN(dest, minutes, STR_CONV_MODE_LEADING_ZEROS, 2);
dest = StringCopy(dest, gUnknown_08376500);
ConvertIntToDecimalStringN(dest, seconds, STR_CONV_MODE_LEADING_ZEROS, 2);
- MenuPrint(gStringVar4, x, y);
+ Menu_PrintText(gStringVar4, x, y);
}
void ResetRtcScreen_ShowChooseTimeWindow(u16 days, u8 hours, u8 minutes, u8 seconds)
{
- MenuDrawTextWindow(3, 8, 25, 11);
- MenuPrint(gOtherText_OK, 20, 9);
+ Menu_DrawStdWindowFrame(3, 8, 25, 11);
+ Menu_PrintText(gOtherText_OK, 20, 9);
ResetRtcScreen_PrintTime(4, 9, days, hours, minutes, seconds);
}
@@ -468,8 +468,8 @@ void VBlankCB_ResetRtcScreen(void)
void ResetRtcScreen_ShowMessage(const u8 *str)
{
- MenuDisplayMessageBox();
- MenuPrint(str, 2, 15);
+ Menu_DisplayDialogueFrame();
+ Menu_PrintText(str, 2, 15);
}
void Task_ShowResetRtcPrompt(u8 taskId)
@@ -479,9 +479,9 @@ void Task_ShowResetRtcPrompt(u8 taskId)
switch (data[0])
{
case 0:
- MenuZeroFillScreen();
- MenuDrawTextWindow(0, 0, 20, 10);
- MenuPrint(gSystemText_PresentTime, 1, 1);
+ Menu_EraseScreen();
+ Menu_DrawStdWindowFrame(0, 0, 20, 10);
+ Menu_PrintText(gSystemText_PresentTime, 1, 1);
ResetRtcScreen_PrintTime(
1,
3,
@@ -489,7 +489,7 @@ void Task_ShowResetRtcPrompt(u8 taskId)
gLocalTime.hours,
gLocalTime.minutes,
gLocalTime.seconds);
- MenuPrint(gSystemText_PreviousTime, 1, 5);
+ Menu_PrintText(gSystemText_PreviousTime, 1, 5);
ResetRtcScreen_PrintTime(
1,
7,
@@ -543,7 +543,7 @@ void Task_ResetRtcScreen(u8 taskId)
case 2:
if (gTasks[data[1]].isActive != TRUE)
{
- MenuZeroFillScreen();
+ Menu_EraseScreen();
ResetRtcScreen_ShowMessage(gSystemText_PleaseResetTime);
gLocalTime = gSaveBlock2.lastBerryTreeUpdate;
data[1] = CreateTask(Task_ResetRtc_0, 80);
diff --git a/src/engine/save_failed_screen.c b/src/engine/save_failed_screen.c
index ba2d46546..a4642d241 100644
--- a/src/engine/save_failed_screen.c
+++ b/src/engine/save_failed_screen.c
@@ -122,9 +122,9 @@ static void CB2_SaveFailedScreen(void)
LoadPalette(&gSaveFailedClockPal, 0x100, sizeof(gSaveFailedClockPal));
SetUpWindowConfig(&gWindowConfig_81E6C3C);
InitMenuWindow(&gWindowConfig_81E6CE4);
- MenuDrawTextWindow(13, CLOCK_WIN_TOP, 16, CLOCK_WIN_TOP + 3); // clock window
- MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); // message window
- MenuPrint(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1);
+ Menu_DrawStdWindowFrame(13, CLOCK_WIN_TOP, 16, CLOCK_WIN_TOP + 3); // clock window
+ Menu_DrawStdWindowFrame(1, MSG_WIN_TOP, 28, 19); // message window
+ Menu_PrintText(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0);
ime = REG_IME;
REG_IME = 0;
@@ -158,22 +158,22 @@ static void CB2_WipeSave(void)
{
if (WipeSectors(gDamagedSaveSectors) != FALSE)
{
- MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19);
- MenuPrint(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1);
+ Menu_DrawStdWindowFrame(1, MSG_WIN_TOP, 28, 19);
+ Menu_PrintText(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1);
SetMainCallback2(CB2_GameplayCannotBeContinued);
return;
}
- MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19);
- MenuPrint(gSystemText_CheckCompleteSaveAttempt, 2, MSG_WIN_TOP + 1);
+ Menu_DrawStdWindowFrame(1, MSG_WIN_TOP, 28, 19);
+ Menu_PrintText(gSystemText_CheckCompleteSaveAttempt, 2, MSG_WIN_TOP + 1);
HandleSavingData(gSaveFailedType);
if (gDamagedSaveSectors != 0)
{
#ifdef BUGFIX_SAVEFAILEDSCREEN2
- MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19);
+ Menu_DrawStdWindowFrame(1, MSG_WIN_TOP, 28, 19);
#endif
- MenuPrint(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1);
+ Menu_PrintText(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1);
}
wipeTries++;
@@ -181,19 +181,19 @@ static void CB2_WipeSave(void)
if (wipeTries == 3)
{
- MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19);
- MenuPrint(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1);
+ Menu_DrawStdWindowFrame(1, MSG_WIN_TOP, 28, 19);
+ Menu_PrintText(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1);
SetMainCallback2(CB2_FadeAndReturnToTitleScreen); // called again below
}
else
{
- MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19);
+ Menu_DrawStdWindowFrame(1, MSG_WIN_TOP, 28, 19);
// no callback exists, so the game cannot continue.
if (gGameContinueCallback == 0)
- MenuPrint(gSystemText_SaveCompletedGameEnd, 2, MSG_WIN_TOP + 1);
+ Menu_PrintText(gSystemText_SaveCompletedGameEnd, 2, MSG_WIN_TOP + 1);
else // callback exists, so continue
- MenuPrint(gSystemText_SaveCompletedPressA, 2, MSG_WIN_TOP + 1);
+ Menu_PrintText(gSystemText_SaveCompletedPressA, 2, MSG_WIN_TOP + 1);
}
SetMainCallback2(CB2_FadeAndReturnToTitleScreen);
@@ -205,8 +205,8 @@ static void CB2_GameplayCannotBeContinued(void)
if (gMain.newKeys & A_BUTTON)
{
- MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19);
- MenuPrint(gSystemText_GameplayEnded, 2, MSG_WIN_TOP + 1);
+ Menu_DrawStdWindowFrame(1, MSG_WIN_TOP, 28, 19);
+ Menu_PrintText(gSystemText_GameplayEnded, 2, MSG_WIN_TOP + 1);
SetVBlankCallback(VBlankCB);
SetMainCallback2(CB2_FadeAndReturnToTitleScreen);
}
diff --git a/src/engine/save_menu_util.c b/src/engine/save_menu_util.c
index 771cb72c7..2c5eb6afe 100644
--- a/src/engine/save_menu_util.c
+++ b/src/engine/save_menu_util.c
@@ -18,7 +18,7 @@ void HandleDrawSaveWindowInfo(s16 left, s16 top)
if (FlagGet(FLAG_SYS_POKEDEX_GET))
{
// print info + dex information.
- MenuDrawTextWindow(left, top, left + width, top + 11);
+ Menu_DrawStdWindowFrame(left, top, left + width, top + 11);
PrintSaveMapName(++left, ++top); // MAP NAME
PrintSavePlayerName(left, top + 2); // PLAYER
PrintSaveBadges(left, top + 4); // BADGES
@@ -28,7 +28,7 @@ void HandleDrawSaveWindowInfo(s16 left, s16 top)
else
{
// print everything besides dex.
- MenuDrawTextWindow(left, top, left + width, top + 9);
+ Menu_DrawStdWindowFrame(left, top, left + width, top + 9);
PrintSaveMapName(++left, ++top); // MAP NAME
PrintSavePlayerName(left, top + 2); // PLAYER
PrintSaveBadges(left, top + 4); // BADGES
@@ -45,9 +45,9 @@ void HandleCloseSaveWindow(u16 left, u16 top)
width = 13;
if (FlagGet(FLAG_SYS_POKEDEX_GET))
- MenuZeroFillWindowRect(left, top, left + width, top + 11);
+ Menu_EraseWindowRect(left, top, left + width, top + 11);
else
- MenuZeroFillWindowRect(left, top, left + width, top + 9);
+ Menu_EraseWindowRect(left, top, left + width, top + 9);
}
/*
@@ -62,7 +62,7 @@ u8 IsResizeSaveWindowEnabled(void) // i don't know what else to name it..
void PrintSavePlayerName(s16 x, s16 y)
{
- MenuPrint(gOtherText_Player, x, y);
+ Menu_PrintText(gOtherText_Player, x, y);
MenuPrint_RightAligned(gSaveBlock2.playerName, x + 12, y);
}
@@ -71,14 +71,14 @@ void PrintSaveMapName(s16 x, s16 y)
char name[32];
CopyMapName(name, gMapHeader.regionMapSectionId);
- MenuPrint(name, x, y);
+ Menu_PrintText(name, x, y);
}
void PrintSaveBadges(s16 x, s16 y)
{
char badges[16];
- MenuPrint(gOtherText_Badges, x, y);
+ Menu_PrintText(gOtherText_Badges, x, y);
ConvertIntToDecimalString(badges, GetBadgeCount());
MenuPrint_RightAligned(badges, x + 12, y);
}
@@ -87,7 +87,7 @@ void PrintSavePokedexCount(s16 x, s16 y)
{
char pokedex[16];
- MenuPrint(gOtherText_Pokedex, x, y);
+ Menu_PrintText(gOtherText_Pokedex, x, y);
ConvertIntToDecimalStringN(pokedex, GetPokedexSeenCount(), 1, 3);
MenuPrint_RightAligned(pokedex, x + 12, y);
}
@@ -96,7 +96,7 @@ void PrintSavePlayTime(s16 x, s16 y)
{
char playtime[16];
- MenuPrint(gOtherText_PlayTime, x, y);
+ Menu_PrintText(gOtherText_PlayTime, x, y);
FormatPlayTime(playtime, gSaveBlock2.playTimeHours, gSaveBlock2.playTimeMinutes, 1);
MenuPrint_RightAligned(playtime, x + 12, y);
}
diff --git a/src/engine/text.c b/src/engine/text.c
index 1b158d979..2d6d95877 100644
--- a/src/engine/text.c
+++ b/src/engine/text.c
@@ -12,16 +12,31 @@ enum
WIN_STATE_END,
WIN_STATE_BEGIN,
WIN_STATE_NORMAL,
- WIN_STATE_INTERRUPTIBLE_PAUSE,
+ WIN_STATE_CHAR_DELAY,
WIN_STATE_PAUSE,
WIN_STATE_WAIT_BUTTON,
WIN_STATE_NEWLINE,
WIN_STATE_PLACEHOLDER,
- WIN_STATE_PARAGRAPH,
- WIN_STATE_NEWLINE_WAIT,
+ WIN_STATE_WAIT_CLEAR,
+ WIN_STATE_WAIT_SCROLL,
WIN_STATE_WAIT_SOUND,
};
+enum
+{
+ TEXT_MODE_UNKNOWN0,
+ TEXT_MODE_MONOSPACE,
+ TEXT_MODE_UNKNOWN2, // variable width?
+};
+
+enum
+{
+ WAIT_TYPE_NORMAL, // allows the player to interrupt the text delay with A or B
+ WAIT_TYPE_BATTLE, // disables interrupting the text delay if in a link battle
+ WAIT_TYPE_AUTOSCROLL, // disables interrupting the text delay
+ WAIT_TYPE_CONTEST, // disables interrupting the text delay if in a link contest
+};
+
struct Font
{
u32 type;
@@ -66,7 +81,7 @@ static u16 LoadFixedWidthFont_Font4Latin(struct Window *, u16);
static u16 LoadFixedWidthFont_Braille(struct Window *, u16);
static void MultistepLoadFont_LoadGlyph(struct Window *, u16, u8);
static u8 sub_8002FA0(struct Window *, const u8 *);
-static u8 InterpretText(struct Window *);
+static u8 PrintNextChar(struct Window *);
static u8 HandleExtCtrlCode(struct Window *);
static u8 UpdateWindowText(struct Window *);
static u8 DrawGlyph_TextMode0(struct Window *, u32);
@@ -83,26 +98,26 @@ static void AddToCursorY(struct Window *, u8);
static void ClipLeft(struct Window *);
static void ClipRight(struct Window *);
static void InitColors(struct Window *);
-static void SetBackgroundColor(struct Window *, u8);
-static void SetShadowColor(struct Window *, u8);
-static void SetForegroundColor(struct Window *, u8);
+static void SetWindowBackgroundColor(struct Window *, u8);
+static void SetWindowShadowColor(struct Window *, u8);
+static void SetWindowForegroundColor(struct Window *, u8);
static u8 GetTextDelay(struct Window *);
-static bool8 PlayerCanInterruptWait(struct Window *);
+static bool8 PlayerCanInterruptDelay(struct Window *);
static void ScrollWindowTextLines(struct Window *);
static void ScrollWindowTextLines_TextMode0(struct Window *);
static void DoScroll_TextMode0(struct Window *, u16);
-static void ScrollWindowTextLines_TextMode1(struct Window *);
-static void DoScroll_TextMode1(struct Window *, u16);
+static void ScrollWindowTextLines_TextModeMonospace(struct Window *);
+static void DoScroll_TextModeMonospace(struct Window *, u16);
static void ScrollWindowTextLines_TextMode2(struct Window *);
static void DoScroll_TextMode2(struct Window *, u8);
-void ClearWindowTextLines(struct Window *);
+void Text_ClearWindow(struct Window *);
static void ClearWindowTextLines_TextMode0_TextMode1(struct Window *, u8);
static void ClearWindowTextLines_TextMode2(struct Window *, u8);
static void TryEraseDownArrow(struct Window *);
static u16 GetBlankTileNum(struct Window *);
static u8 WaitWithDownArrow(struct Window *);
static void DrawInitialDownArrow(struct Window *);
-static void DrawMovingDownArrow(struct Window *);
+static void UpdateDownArrowAnimation(struct Window *);
static u16 GetCursorTileNum(struct Window *, u32, u32);
static s32 DrawGlyphTiles(struct Window *, u32, u32);
static void UpdateTilemap(struct Window *, u32);
@@ -477,7 +492,7 @@ static const ShiftGlyphTileShadowedFunc sShiftGlyphTileShadowedFuncs[] =
ShiftGlyphTile_ShadowedFont_Width8,
};
-const struct WindowConfig gWindowConfig_81E6C3C =
+const struct WindowTemplate gWindowConfig_81E6C3C =
{
0, // BG number
2, // BG character base block
@@ -498,7 +513,7 @@ const struct WindowConfig gWindowConfig_81E6C3C =
BG_SCREEN_ADDR(31), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6C58 =
+const struct WindowTemplate gWindowConfig_81E6C58 =
{
0, // BG number
0, // BG character base block
@@ -519,7 +534,7 @@ const struct WindowConfig gWindowConfig_81E6C58 =
BG_SCREEN_ADDR(24), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6C74 =
+const struct WindowTemplate gWindowConfig_81E6C74 =
{
0, // BG number
0, // BG character base block
@@ -540,7 +555,7 @@ const struct WindowConfig gWindowConfig_81E6C74 =
NULL, // tilemap
};
-const struct WindowConfig gWindowConfig_81E6C90 =
+const struct WindowTemplate gWindowConfig_81E6C90 =
{
0, // BG number
1, // BG character base block
@@ -561,7 +576,7 @@ const struct WindowConfig gWindowConfig_81E6C90 =
BG_SCREEN_ADDR(30), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6CAC =
+const struct WindowTemplate gWindowConfig_81E6CAC =
{
0, // BG number
0, // BG character base block
@@ -582,7 +597,7 @@ const struct WindowConfig gWindowConfig_81E6CAC =
NULL, // tilemap
};
-const struct WindowConfig gWindowConfig_81E6CC8 =
+const struct WindowTemplate gWindowConfig_81E6CC8 =
{
2, // BG number
2, // BG character base block
@@ -603,7 +618,7 @@ const struct WindowConfig gWindowConfig_81E6CC8 =
BG_SCREEN_ADDR(15), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6CE4 =
+const struct WindowTemplate gWindowConfig_81E6CE4 =
{
0, // BG number
2, // BG character base block
@@ -624,7 +639,7 @@ const struct WindowConfig gWindowConfig_81E6CE4 =
BG_SCREEN_ADDR(31), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6D00 =
+const struct WindowTemplate gWindowConfig_81E6D00 =
{
0, // BG number
0, // BG character base block
@@ -645,7 +660,7 @@ const struct WindowConfig gWindowConfig_81E6D00 =
BG_SCREEN_ADDR(31), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6D1C =
+const struct WindowTemplate gWindowConfig_81E6D1C =
{
1, // BG number
0, // BG character base block
@@ -666,7 +681,7 @@ const struct WindowConfig gWindowConfig_81E6D1C =
BG_SCREEN_ADDR(31), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6D38 =
+const struct WindowTemplate gWindowConfig_81E6D38 =
{
0, // BG number
0, // BG character base block
@@ -687,7 +702,7 @@ const struct WindowConfig gWindowConfig_81E6D38 =
NULL, // tilemap
};
-const struct WindowConfig gWindowConfig_81E6D54 =
+const struct WindowTemplate gWindowConfig_81E6D54 =
{
3, // BG number
3, // BG character base block
@@ -708,7 +723,7 @@ const struct WindowConfig gWindowConfig_81E6D54 =
BG_SCREEN_ADDR(15), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6D70 =
+const struct WindowTemplate gWindowConfig_81E6D70 =
{
3, // BG number
3, // BG character base block
@@ -729,7 +744,7 @@ const struct WindowConfig gWindowConfig_81E6D70 =
BG_SCREEN_ADDR(15), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6D8C =
+const struct WindowTemplate gWindowConfig_81E6D8C =
{
1, // BG number
0, // BG character base block
@@ -750,7 +765,7 @@ const struct WindowConfig gWindowConfig_81E6D8C =
BG_SCREEN_ADDR(14), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6DA8 =
+const struct WindowTemplate gWindowConfig_81E6DA8 =
{
0, // BG number
0, // BG character base block
@@ -771,7 +786,7 @@ const struct WindowConfig gWindowConfig_81E6DA8 =
BG_SCREEN_ADDR(11), // tilemap
};
-const struct WindowConfig WindowConfig_TrainerCard_Back_Values =
+const struct WindowTemplate WindowConfig_TrainerCard_Back_Values =
{
0, // BG number
2, // BG character base block
@@ -792,7 +807,7 @@ const struct WindowConfig WindowConfig_TrainerCard_Back_Values =
BG_SCREEN_ADDR(30), // tilemap
};
-const struct WindowConfig WindowConfig_TrainerCard_Back_Labels =
+const struct WindowTemplate WindowConfig_TrainerCard_Back_Labels =
{
0, // BG number
2, // BG character base block
@@ -813,7 +828,7 @@ const struct WindowConfig WindowConfig_TrainerCard_Back_Labels =
BG_SCREEN_ADDR(30), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6DFC =
+const struct WindowTemplate gWindowConfig_81E6DFC =
{
0, // BG number
2, // BG character base block
@@ -834,7 +849,7 @@ const struct WindowConfig gWindowConfig_81E6DFC =
BG_SCREEN_ADDR(31), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6E18 =
+const struct WindowTemplate gWindowConfig_81E6E18 =
{
0, // BG number
2, // BG character base block
@@ -855,7 +870,7 @@ const struct WindowConfig gWindowConfig_81E6E18 =
BG_SCREEN_ADDR(31), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6E34 =
+const struct WindowTemplate gWindowConfig_81E6E34 =
{
1, // BG number
0, // BG character base block
@@ -876,7 +891,7 @@ const struct WindowConfig gWindowConfig_81E6E34 =
BG_SCREEN_ADDR(31), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6E50 =
+const struct WindowTemplate gWindowConfig_81E6E50 =
{
0, // BG number
2, // BG character base block
@@ -897,7 +912,7 @@ const struct WindowConfig gWindowConfig_81E6E50 =
BG_SCREEN_ADDR(28), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6E6C =
+const struct WindowTemplate gWindowConfig_81E6E6C =
{
0, // BG number
2, // BG character base block
@@ -918,7 +933,7 @@ const struct WindowConfig gWindowConfig_81E6E6C =
BG_SCREEN_ADDR(30), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6E88 =
+const struct WindowTemplate gWindowConfig_81E6E88 =
{
0, // BG number
0, // BG character base block
@@ -939,7 +954,7 @@ const struct WindowConfig gWindowConfig_81E6E88 =
BG_SCREEN_ADDR(31), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6EA4 =
+const struct WindowTemplate gWindowConfig_81E6EA4 =
{
1, // BG number
0, // BG character base block
@@ -960,7 +975,7 @@ const struct WindowConfig gWindowConfig_81E6EA4 =
BG_SCREEN_ADDR(28), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6EC0 =
+const struct WindowTemplate gWindowConfig_81E6EC0 =
{
2, // BG number
2, // BG character base block
@@ -981,7 +996,7 @@ const struct WindowConfig gWindowConfig_81E6EC0 =
BG_SCREEN_ADDR(29), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6EDC =
+const struct WindowTemplate gWindowConfig_81E6EDC =
{
1, // BG number
0, // BG character base block
@@ -1002,7 +1017,7 @@ const struct WindowConfig gWindowConfig_81E6EDC =
BG_SCREEN_ADDR(28), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6EF8 =
+const struct WindowTemplate gWindowConfig_81E6EF8 =
{
2, // BG number
2, // BG character base block
@@ -1023,7 +1038,7 @@ const struct WindowConfig gWindowConfig_81E6EF8 =
BG_SCREEN_ADDR(29), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6F14 =
+const struct WindowTemplate gWindowConfig_81E6F14 =
{
1, // BG number
0, // BG character base block
@@ -1044,7 +1059,7 @@ const struct WindowConfig gWindowConfig_81E6F14 =
BG_SCREEN_ADDR(28), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6F30 =
+const struct WindowTemplate gWindowConfig_81E6F30 =
{
2, // BG number
2, // BG character base block
@@ -1065,7 +1080,7 @@ const struct WindowConfig gWindowConfig_81E6F30 =
BG_SCREEN_ADDR(29), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6F4C =
+const struct WindowTemplate gWindowConfig_81E6F4C =
{
3, // BG number
0, // BG character base block
@@ -1086,7 +1101,7 @@ const struct WindowConfig gWindowConfig_81E6F4C =
BG_SCREEN_ADDR(30), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6F68 =
+const struct WindowTemplate gWindowConfig_81E6F68 =
{
0, // BG number
2, // BG character base block
@@ -1107,7 +1122,7 @@ const struct WindowConfig gWindowConfig_81E6F68 =
BG_SCREEN_ADDR(13), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6F84 =
+const struct WindowTemplate gWindowConfig_81E6F84 =
{
0, // BG number
2, // BG character base block
@@ -1128,7 +1143,7 @@ const struct WindowConfig gWindowConfig_81E6F84 =
BG_SCREEN_ADDR(31), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6FA0 =
+const struct WindowTemplate gWindowConfig_81E6FA0 =
{
1, // BG number
0, // BG character base block
@@ -1149,7 +1164,7 @@ const struct WindowConfig gWindowConfig_81E6FA0 =
BG_SCREEN_ADDR(24), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6FBC =
+const struct WindowTemplate gWindowConfig_81E6FBC =
{
0, // BG number
0, // BG character base block
@@ -1170,7 +1185,7 @@ const struct WindowConfig gWindowConfig_81E6FBC =
BG_SCREEN_ADDR(30), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6FD8 =
+const struct WindowTemplate gWindowConfig_81E6FD8 =
{
0, // BG number
0, // BG character base block
@@ -1191,7 +1206,7 @@ const struct WindowConfig gWindowConfig_81E6FD8 =
BG_SCREEN_ADDR(24), // tilemap
};
-const struct WindowConfig gWindowConfig_81E6FF4 =
+const struct WindowTemplate gWindowConfig_81E6FF4 =
{
0, // BG number
0, // BG character base block
@@ -1212,7 +1227,7 @@ const struct WindowConfig gWindowConfig_81E6FF4 =
BG_SCREEN_ADDR(24), // tilemap
};
-const struct WindowConfig gWindowConfig_81E7010 =
+const struct WindowTemplate gWindowConfig_81E7010 =
{
0, // BG number
0, // BG character base block
@@ -1233,7 +1248,7 @@ const struct WindowConfig gWindowConfig_81E7010 =
BG_SCREEN_ADDR(30), // tilemap
};
-const struct WindowConfig gWindowConfig_81E702C =
+const struct WindowTemplate gWindowConfig_81E702C =
{
3, // BG number
2, // BG character base block
@@ -1254,7 +1269,7 @@ const struct WindowConfig gWindowConfig_81E702C =
BG_SCREEN_ADDR(15), // tilemap
};
-const struct WindowConfig gWindowConfig_81E7048 =
+const struct WindowTemplate gWindowConfig_81E7048 =
{
2, // BG number
2, // BG character base block
@@ -1275,7 +1290,7 @@ const struct WindowConfig gWindowConfig_81E7048 =
BG_SCREEN_ADDR(14), // tilemap
};
-const struct WindowConfig gWindowConfig_81E7064 =
+const struct WindowTemplate gWindowConfig_81E7064 =
{
2, // BG number
2, // BG character base block
@@ -1296,7 +1311,7 @@ const struct WindowConfig gWindowConfig_81E7064 =
BG_SCREEN_ADDR(14), // tilemap
};
-const struct WindowConfig gWindowConfig_81E7080 =
+const struct WindowTemplate gWindowConfig_81E7080 =
{
3, // BG number
0, // BG character base block
@@ -1317,7 +1332,7 @@ const struct WindowConfig gWindowConfig_81E7080 =
BG_SCREEN_ADDR(30), // tilemap
};
-const struct WindowConfig gWindowConfig_81E709C =
+const struct WindowTemplate gWindowConfig_81E709C =
{
0, // BG number
0, // BG character base block
@@ -1338,7 +1353,7 @@ const struct WindowConfig gWindowConfig_81E709C =
BG_SCREEN_ADDR(31), // tilemap
};
-const struct WindowConfig gWindowConfig_81E70B8 =
+const struct WindowTemplate gWindowConfig_81E70B8 =
{
2, // BG number
0, // BG character base block
@@ -1359,7 +1374,7 @@ const struct WindowConfig gWindowConfig_81E70B8 =
BG_SCREEN_ADDR(30), // tilemap
};
-const struct WindowConfig gWindowConfig_81E70D4 =
+const struct WindowTemplate gWindowConfig_81E70D4 =
{
3, // BG number
0, // BG character base block
@@ -1380,7 +1395,7 @@ const struct WindowConfig gWindowConfig_81E70D4 =
BG_SCREEN_ADDR(30), // tilemap
};
-const struct WindowConfig gWindowConfig_81E70F0 =
+const struct WindowTemplate gWindowConfig_81E70F0 =
{
0, // BG number
0, // BG character base block
@@ -1401,7 +1416,7 @@ const struct WindowConfig gWindowConfig_81E70F0 =
NULL, // tilemap
};
-const struct WindowConfig gWindowConfig_81E710C =
+const struct WindowTemplate gWindowConfig_81E710C =
{
0, // BG number
0, // BG character base block
@@ -1422,7 +1437,7 @@ const struct WindowConfig gWindowConfig_81E710C =
BG_SCREEN_ADDR(31), // tilemap
};
-const struct WindowConfig gWindowConfig_81E7128 =
+const struct WindowTemplate gWindowConfig_81E7128 =
{
0, // BG number
2, // BG character base block
@@ -1443,7 +1458,7 @@ const struct WindowConfig gWindowConfig_81E7128 =
BG_SCREEN_ADDR(31), // tilemap
};
-const struct WindowConfig gWindowConfig_81E7144 =
+const struct WindowTemplate gWindowConfig_81E7144 =
{
0, // BG number
2, // BG character base block
@@ -1464,7 +1479,7 @@ const struct WindowConfig gWindowConfig_81E7144 =
BG_SCREEN_ADDR(31), // tilemap
};
-const struct WindowConfig gWindowConfig_81E7160 =
+const struct WindowTemplate gWindowConfig_81E7160 =
{
1, // BG number
1, // BG character base block
@@ -1485,7 +1500,7 @@ const struct WindowConfig gWindowConfig_81E7160 =
BG_SCREEN_ADDR(10), // tilemap
};
-const struct WindowConfig gWindowConfig_81E717C =
+const struct WindowTemplate gWindowConfig_81E717C =
{
0, // BG number
3, // BG character base block
@@ -1506,7 +1521,7 @@ const struct WindowConfig gWindowConfig_81E717C =
BG_SCREEN_ADDR(31), // tilemap
};
-const struct WindowConfig gWindowConfig_81E7198 =
+const struct WindowTemplate gWindowConfig_81E7198 =
{
0, // BG number
2, // BG character base block
@@ -1527,7 +1542,7 @@ const struct WindowConfig gWindowConfig_81E7198 =
BG_SCREEN_ADDR(15), // tilemap
};
-const struct WindowConfig gWindowConfig_81E71B4 =
+const struct WindowTemplate gWindowConfig_81E71B4 =
{
0, // BG number
2, // BG character base block
@@ -1548,7 +1563,7 @@ const struct WindowConfig gWindowConfig_81E71B4 =
BG_SCREEN_ADDR(15), // tilemap
};
-const struct WindowConfig gWindowConfig_81E71D0 =
+const struct WindowTemplate gWindowConfig_81E71D0 =
{
1, // BG number
1, // BG character base block
@@ -1569,7 +1584,7 @@ const struct WindowConfig gWindowConfig_81E71D0 =
BG_SCREEN_ADDR(28), // tilemap
};
-const struct WindowConfig gWindowConfig_81E71EC =
+const struct WindowTemplate gWindowConfig_81E71EC =
{
2, // BG number
1, // BG character base block
@@ -1590,7 +1605,7 @@ const struct WindowConfig gWindowConfig_81E71EC =
BG_SCREEN_ADDR(30), // tilemap
};
-const struct WindowConfig gWindowConfig_81E7208 =
+const struct WindowTemplate gWindowConfig_81E7208 =
{
0, // BG number
2, // BG character base block
@@ -1611,7 +1626,7 @@ const struct WindowConfig gWindowConfig_81E7208 =
BG_SCREEN_ADDR(28), // tilemap
};
-const struct WindowConfig gWindowConfig_81E7224 =
+const struct WindowTemplate gWindowConfig_81E7224 =
{
0, // BG number
0, // BG character base block
@@ -1632,7 +1647,7 @@ const struct WindowConfig gWindowConfig_81E7224 =
BG_SCREEN_ADDR(31), // tilemap
};
-const struct WindowConfig gWindowConfig_81E7240 =
+const struct WindowTemplate gWindowConfig_81E7240 =
{
1, // BG number
2, // BG character base block
@@ -1653,7 +1668,7 @@ const struct WindowConfig gWindowConfig_81E7240 =
BG_SCREEN_ADDR(30), // tilemap
};
-const struct WindowConfig gWindowConfig_81E725C =
+const struct WindowTemplate gWindowConfig_81E725C =
{
0, // BG number
0, // BG character base block
@@ -1674,7 +1689,7 @@ const struct WindowConfig gWindowConfig_81E725C =
NULL, // tilemap
};
-const struct WindowConfig gWindowConfig_81E7278 =
+const struct WindowTemplate gWindowConfig_81E7278 =
{
0, // BG number
0, // BG character base block
@@ -1695,7 +1710,7 @@ const struct WindowConfig gWindowConfig_81E7278 =
NULL, // tilemap
};
-const struct WindowConfig gWindowConfig_81E7294 =
+const struct WindowTemplate gWindowConfig_81E7294 =
{
0, // BG number
0, // BG character base block
@@ -1716,32 +1731,32 @@ const struct WindowConfig gWindowConfig_81E7294 =
NULL, // tilemap
};
-static void UpdateBGRegs(const struct WindowConfig *winConfig)
+static void UpdateBGRegs(const struct WindowTemplate *winTemplate)
{
- u8 bgNum = winConfig->bgNum;
+ u8 bgNum = winTemplate->bgNum;
*gBGHOffsetRegs[bgNum] = 0;
*gBGVOffsetRegs[bgNum] = 0;
- *gBGControlRegs[bgNum] = winConfig->priority | (winConfig->screenBaseBlock << 8) | (winConfig->charBaseBlock << 2);
+ *gBGControlRegs[bgNum] = winTemplate->priority | (winTemplate->screenBaseBlock << 8) | (winTemplate->charBaseBlock << 2);
}
-static void ClearBGMem(const struct WindowConfig *winConfig)
+static void ClearBGMem(const struct WindowTemplate *winTemplate)
{
- CpuFastFill(0, winConfig->tileData, 32);
+ CpuFastFill(0, winTemplate->tileData, 32);
- if (winConfig->tilemap)
- CpuFastFill(0, winConfig->tilemap, 0x800);
+ if (winTemplate->tilemap)
+ CpuFastFill(0, winTemplate->tilemap, 0x800);
}
-void LoadFontDefaultPalette(const struct WindowConfig *winConfig)
+void LoadFontDefaultPalette(const struct WindowTemplate *winTemplate)
{
- LoadPalette(gFontDefaultPalette, 16 * winConfig->paletteNum, 32);
+ LoadPalette(gFontDefaultPalette, 16 * winTemplate->paletteNum, 32);
}
-void SetUpWindowConfig(const struct WindowConfig *winConfig)
+void SetUpWindowConfig(const struct WindowTemplate *winTemplate)
{
- UpdateBGRegs(winConfig);
- ClearBGMem(winConfig);
- LoadFontDefaultPalette(winConfig);
+ UpdateBGRegs(winTemplate);
+ ClearBGMem(winTemplate);
+ LoadFontDefaultPalette(winTemplate);
}
u16 InitWindowTileData(struct Window *win, u16 startOffset)
@@ -1751,13 +1766,13 @@ u16 InitWindowTileData(struct Window *win, u16 startOffset)
win->tileDataStartOffset = startOffset;
retVal = 0;
- switch (win->config->textMode)
+ switch (win->template->textMode)
{
- case 2:
+ case TEXT_MODE_UNKNOWN2:
retVal = InitVariableWidthFontTileData(win, startOffset);
break;
- case 1:
- switch (win->config->fontNum)
+ case TEXT_MODE_MONOSPACE:
+ switch (win->template->fontNum)
{
case 0:
case 3:
@@ -1789,7 +1804,7 @@ static u16 InitVariableWidthFontTileData(struct Window *win, u16 startOffset)
win->tileDataOffset = 2;
buffer = win->tileData + 32 * win->tileDataStartOffset;
CpuFastFill(0, buffer, 32);
- ApplyColors_UnshadowedFont(sBlankTile, (u32 *)(buffer + 32), win->config->foregroundColor, win->config->backgroundColor);
+ ApplyColors_UnshadowedFont(sBlankTile, (u32 *)(buffer + 32), win->template->foregroundColor, win->template->backgroundColor);
return win->tileDataStartOffset + win->tileDataOffset + win->width * win->height;
}
@@ -1850,15 +1865,15 @@ u32 MultistepInitWindowTileData(struct Window *win, u16 startOffset)
win->tileDataStartOffset = startOffset;
retVal = 0;
- switch (win->config->textMode)
+ switch (win->template->textMode)
{
- case 2:
+ case TEXT_MODE_UNKNOWN2:
retVal = InitVariableWidthFontTileData(win, startOffset);
break;
- case 1:
+ case TEXT_MODE_MONOSPACE:
retVal = 256;
- if (win->config->fontNum == 0
- || win->config->fontNum == 3)
+ if (win->template->fontNum == 0
+ || win->template->fontNum == 3)
retVal *= 2;
break;
}
@@ -1870,7 +1885,7 @@ bool32 MultistepLoadFont(void)
{
bool32 retVal = TRUE;
- if (sMultistepLoadFont_Window->config->textMode == 1)
+ if (sMultistepLoadFont_Window->template->textMode == TEXT_MODE_MONOSPACE)
{
s32 i;
@@ -1890,7 +1905,7 @@ static void MultistepLoadFont_LoadGlyph(struct Window *win, u16 startOffset, u8
{
u8 *buffer;
- switch (win->config->fontNum)
+ switch (win->template->fontNum)
{
case 0:
case 3:
@@ -1923,42 +1938,42 @@ void EmptyFunc(void)
{
}
-void InitWindowFromConfig(struct Window *win, const struct WindowConfig *winConfig)
+void Text_InitWindowWithTemplate(struct Window *win, const struct WindowTemplate *winTemplate)
{
*win = sDefaultWindow;
- win->config = (struct WindowConfig *)winConfig;
- win->textMode = winConfig->textMode;
- win->spacing = winConfig->spacing;
- win->fontNum = winConfig->fontNum;
- win->paletteNum = winConfig->paletteNum;
- win->tilemapLeft = winConfig->tilemapLeft;
- win->tilemapTop = winConfig->tilemapTop;
- win->width = winConfig->width;
- win->height = winConfig->height;
- win->tileData = winConfig->tileData;
- win->tilemap = winConfig->tilemap;
+ win->template = (struct WindowTemplate *)winTemplate;
+ win->textMode = winTemplate->textMode;
+ win->spacing = winTemplate->spacing;
+ win->fontNum = winTemplate->fontNum;
+ win->paletteNum = winTemplate->paletteNum;
+ win->tilemapLeft = winTemplate->tilemapLeft;
+ win->tilemapTop = winTemplate->tilemapTop;
+ win->width = winTemplate->width;
+ win->height = winTemplate->height;
+ win->tileData = winTemplate->tileData;
+ win->tilemap = winTemplate->tilemap;
InitColors(win);
- SetBackgroundColor(win, winConfig->backgroundColor);
- SetShadowColor(win, winConfig->shadowColor);
- SetForegroundColor(win, winConfig->foregroundColor);
+ SetWindowBackgroundColor(win, winTemplate->backgroundColor);
+ SetWindowShadowColor(win, winTemplate->shadowColor);
+ SetWindowForegroundColor(win, winTemplate->foregroundColor);
}
-void InitWindow(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top)
+void Text_InitWindow(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top)
{
- const struct WindowConfig *winConfig = win->config;
- win->textMode = winConfig->textMode;
- win->fontNum = winConfig->fontNum;
+ const struct WindowTemplate *winTemplate = win->template;
+ win->textMode = winTemplate->textMode;
+ win->fontNum = winTemplate->fontNum;
win->language = GAME_LANGUAGE;
- win->paletteNum = winConfig->paletteNum;
+ win->paletteNum = winTemplate->paletteNum;
win->win_field_B = 0;
win->win_field_C = 0;
win->delayCounter = 0;
- win->spacing = winConfig->spacing;
+ win->spacing = winTemplate->spacing;
win->win_field_F = 0;
- win->tilemapLeft = winConfig->tilemapLeft;
- win->tilemapTop = winConfig->tilemapTop;
- win->width = winConfig->width;
- win->height = winConfig->height;
+ win->tilemapLeft = winTemplate->tilemapLeft;
+ win->tilemapTop = winTemplate->tilemapTop;
+ win->width = winTemplate->width;
+ win->height = winTemplate->height;
win->text = text;
win->textIndex = 0;
win->tileDataStartOffset = tileDataStartOffset;
@@ -1969,19 +1984,19 @@ void InitWindow(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8
win->cursorY = 0;
win->state = WIN_STATE_BEGIN;
win->downArrowCounter = 0;
- win->tileData = winConfig->tileData;
- win->tilemap = winConfig->tilemap;
+ win->tileData = winTemplate->tileData;
+ win->tilemap = winTemplate->tilemap;
InitColors(win);
- SetBackgroundColor(win, winConfig->backgroundColor);
- SetShadowColor(win, winConfig->shadowColor);
- SetForegroundColor(win, winConfig->foregroundColor);
+ SetWindowBackgroundColor(win, winTemplate->backgroundColor);
+ SetWindowShadowColor(win, winTemplate->shadowColor);
+ SetWindowForegroundColor(win, winTemplate->foregroundColor);
}
-void sub_8002E4C(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u16 top, u32 a6)
+void Text_InitWindow8002E4C(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u16 top, u32 a6)
{
u8 val;
- InitWindow(win, text, tileDataStartOffset, 0, 0);
+ Text_InitWindow(win, text, tileDataStartOffset, 0, 0);
win->left = left;
win->top = top;
val = 0;
@@ -2003,15 +2018,15 @@ void sub_8002E90(struct Window *win, const u8 *text)
win->delayCounter = 0;
}
-void sub_8002EB0(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top)
+void Text_InitWindow8002EB0(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top)
{
gMain.watchedKeysMask = A_BUTTON | B_BUTTON;
gMain.watchedKeysPressed = 0;
- sWaitType = 0;
+ sWaitType = WAIT_TYPE_NORMAL;
sLineLength = 26;
- InitWindow(win, text, tileDataStartOffset, left, top);
+ Text_InitWindow(win, text, tileDataStartOffset, left, top);
win->win_field_B = -1;
- if (win->textMode == 0)
+ if (win->textMode == TEXT_MODE_UNKNOWN0)
{
u16 val = GetCursorTileNum(win, 0, 0);
u8 *buffer = win->tileData + 32 * val;
@@ -2021,9 +2036,9 @@ void sub_8002EB0(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8
}
}
-u8 sub_8002F44(struct Window *win)
+u8 Text_PrintWindow8002F44(struct Window *win)
{
- while (win->state)
+ while (win->state != WIN_STATE_END)
{
if (win->state == WIN_STATE_NEWLINE)
{
@@ -2038,7 +2053,7 @@ u8 sub_8002F44(struct Window *win)
sub_8002FA0(win, GetExpandedPlaceholder(win->text[win->textIndex++]));
}
- InterpretText(win);
+ PrintNextChar(win);
}
return 1;
}
@@ -2048,11 +2063,12 @@ static u8 sub_8002FA0(struct Window *win, const u8 *text)
u8 retVal;
u8 savedLanguage = win->language;
const u8 *savedText = win->text;
+
u16 savedTextIndex = win->textIndex;
win->text = text;
win->textIndex = 0;
win->state = WIN_STATE_NORMAL;
- retVal = sub_8002F44(win);
+ retVal = Text_PrintWindow8002F44(win);
win->text = savedText;
win->textIndex = savedTextIndex;
win->state = WIN_STATE_NORMAL;
@@ -2060,32 +2076,33 @@ static u8 sub_8002FA0(struct Window *win, const u8 *text)
return retVal;
}
-static u8 InterpretText(struct Window *win)
+static u8 PrintNextChar(struct Window *win)
{
u8 c = win->text[win->textIndex++];
+ // Handle special control characters
switch (c)
{
- case 0xFF:
+ case EOS:
ClipRight(win);
win->state = WIN_STATE_END;
return 0;
- case 0xFD:
+ case PLACEHOLDER_BEGIN:
win->state = WIN_STATE_PLACEHOLDER;
return 2;
- case 0xFE:
+ case CHAR_NEWLINE:
ClipRight(win);
win->state = WIN_STATE_NEWLINE;
return 2;
- case 0xFB:
+ case CHAR_PROMPT_CLEAR:
DrawInitialDownArrow(win);
- win->state = WIN_STATE_PARAGRAPH;
+ win->state = WIN_STATE_WAIT_CLEAR;
return 2;
- case 0xFA:
+ case CHAR_PROMPT_SCROLL:
DrawInitialDownArrow(win);
- win->state = WIN_STATE_NEWLINE_WAIT;
+ win->state = WIN_STATE_WAIT_SCROLL;
return 2;
- case 0xFC:
+ case EXT_CTRL_CODE_BEGIN:
return HandleExtCtrlCode(win);
}
@@ -2093,6 +2110,8 @@ static u8 InterpretText(struct Window *win)
return 1;
}
+// Extended 0xFC control functions
+
static u8 HandleExtCtrlCode(struct Window *win)
{
return sExtCtrlCodeFuncs[win->text[win->textIndex++]](win);
@@ -2105,27 +2124,27 @@ static u8 ExtCtrlCode_Nop(struct Window *win)
static u8 ExtCtrlCode_ForegroundColor(struct Window *win)
{
- SetForegroundColor(win, win->text[win->textIndex++]);
+ SetWindowForegroundColor(win, win->text[win->textIndex++]);
return 2;
}
static u8 ExtCtrlCode_BackgroundColor(struct Window *win)
{
- SetBackgroundColor(win, win->text[win->textIndex++]);
+ SetWindowBackgroundColor(win, win->text[win->textIndex++]);
return 2;
}
static u8 ExtCtrlCode_ShadowColor(struct Window *win)
{
- SetShadowColor(win, win->text[win->textIndex++]);
+ SetWindowShadowColor(win, win->text[win->textIndex++]);
return 2;
}
static u8 ExtCtrlCode_AllColors(struct Window *win)
{
- SetForegroundColor(win, win->text[win->textIndex++]);
- SetBackgroundColor(win, win->text[win->textIndex++]);
- SetShadowColor(win, win->text[win->textIndex++]);
+ SetWindowForegroundColor(win, win->text[win->textIndex++]);
+ SetWindowBackgroundColor(win, win->text[win->textIndex++]);
+ SetWindowShadowColor(win, win->text[win->textIndex++]);
return 2;
}
@@ -2143,7 +2162,7 @@ static u8 ExtCtrlCode_Font(struct Window *win)
static u8 ExtCtrlCode_DefaultFont(struct Window *win)
{
- win->fontNum = win->config->fontNum;
+ win->fontNum = win->template->fontNum;
return 2;
}
@@ -2197,7 +2216,7 @@ static u8 ExtCtrlCode_SetCursorY(struct Window *win)
static u8 ExtCtrlCode_ClearWindowTextLines(struct Window *win)
{
- ClearWindowTextLines(win);
+ Text_ClearWindow(win);
return 2;
}
@@ -2211,7 +2230,7 @@ static u8 ExtCtrlCode_PlaySE(struct Window *win)
static void DrawSpace(struct Window *win)
{
- if (win->textMode == 1 || (win->left + win->cursorX) & 7 || win->spacing <= 7)
+ if (win->textMode == TEXT_MODE_MONOSPACE || (win->left + win->cursorX) & 7 || win->spacing <= 7)
{
sPrintGlyphFuncs[win->textMode](win, 0);
}
@@ -2302,10 +2321,11 @@ static u8 ExtCtrlCode_Latin(struct Window *win)
return 2;
}
-u8 sub_8003418(struct Window *win)
+// Prints the window text without expanding any placeholders
+u8 Text_PrintWindowSimple(struct Window *win)
{
u8 retVal = 1;
- while (win->state)
+ while (win->state != WIN_STATE_END)
{
if (win->state == WIN_STATE_NEWLINE)
{
@@ -2315,7 +2335,7 @@ u8 sub_8003418(struct Window *win)
ClipLeft(win);
win->state = WIN_STATE_NORMAL;
}
- if (InterpretText(win) == 1)
+ if (PrintNextChar(win) == 1)
{
retVal = 0;
break;
@@ -2324,10 +2344,10 @@ u8 sub_8003418(struct Window *win)
return retVal;
}
-u8 sub_8003460(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top)
+u8 Text_InitWindowAndPrintText(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top)
{
- InitWindow(win, text, tileDataStartOffset, left, top);
- return sub_8002F44(win);
+ Text_InitWindow(win, text, tileDataStartOffset, left, top);
+ return Text_PrintWindow8002F44(win);
}
u8 sub_8003490(struct Window *win, u8 c, u16 tileDataStartOffset, u8 left, u8 top)
@@ -2336,8 +2356,8 @@ u8 sub_8003490(struct Window *win, u8 c, u16 tileDataStartOffset, u8 left, u8 to
u8 text[2];
text[0] = c;
text[1] = EOS;
- InitWindow(win, text, tileDataStartOffset, left, top);
- retVal = InterpretText(win);
+ Text_InitWindow(win, text, tileDataStartOffset, left, top);
+ retVal = PrintNextChar(win);
ClipRight(win);
return retVal;
}
@@ -2349,35 +2369,38 @@ void sub_80034D4(u8 *tileData, const u8 *text)
u8 sub_80034EC(u8 *str)
{
- return GetStringWidthGivenWindowConfig((struct WindowConfig *)&gWindowConfig_81E6C74, str);
+ return Text_GetStringWidthFromWindowTemplate((struct WindowTemplate *)&gWindowConfig_81E6C74, str);
}
u8 *sub_8003504(u8 *dest, s32 value, u8 alignAmount, u8 alignType)
{
- sTempWindow.config = (struct WindowConfig *)&gWindowConfig_81E6C74;
- InitWindow(&sTempWindow, 0, 0, 0, 0);
+ sTempWindow.template = (struct WindowTemplate *)&gWindowConfig_81E6C74;
+ Text_InitWindow(&sTempWindow, 0, 0, 0, 0);
return AlignInt2(&sTempWindow, dest, value, alignAmount, alignType);
}
u8 *sub_8003558(u8 *dest, const u8 *src, u8 alignAmount, u8 alignType)
{
- sTempWindow.config = (struct WindowConfig *)&gWindowConfig_81E6C74;
- InitWindow(&sTempWindow, src, 0, 0, 0);
+ sTempWindow.template = (struct WindowTemplate *)&gWindowConfig_81E6C74;
+ Text_InitWindow(&sTempWindow, src, 0, 0, 0);
return AlignString(&sTempWindow, dest, src, alignAmount, alignType);
}
-u8 sub_80035AC(struct Window *win)
+// Updates the window text
+// The text delay can be accelerated by holding the A button
+u8 Text_UpdateWindow(struct Window *win)
{
- sWaitType = 0;
+ sWaitType = WAIT_TYPE_NORMAL;
return UpdateWindowText(win);
}
+// Returns TRUE when all of the text has been printed.
static u8 UpdateWindowText(struct Window *win)
{
switch (win->state)
{
case WIN_STATE_WAIT_BUTTON:
- if (PlayerCanInterruptWait(win))
+ if (PlayerCanInterruptDelay(win))
{
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
{
@@ -2385,48 +2408,56 @@ static u8 UpdateWindowText(struct Window *win)
}
else
{
- return 0;
+ return FALSE;
}
}
else
{
win->delayCounter--;
if (win->delayCounter)
- return 0;
+ return FALSE;
}
win->state = WIN_STATE_NORMAL;
- return 0;
- case WIN_STATE_INTERRUPTIBLE_PAUSE:
- if (PlayerCanInterruptWait(win) && (gMain.heldKeys & (A_BUTTON | B_BUTTON)) && gMain.watchedKeysPressed == TRUE)
+ return FALSE;
+ case WIN_STATE_CHAR_DELAY:
+ // Allow the player to speed up text by holding a button
+ if (PlayerCanInterruptDelay(win)
+ && (gMain.heldKeys & (A_BUTTON | B_BUTTON))
+ && gMain.watchedKeysPressed == TRUE)
{
win->delayCounter = 0;
win->state = WIN_STATE_NORMAL;
break;
}
+ // fall through
case WIN_STATE_PAUSE:
+ // Wait for timer to expire, then continue printing
if (win->delayCounter)
{
win->delayCounter--;
if (win->delayCounter)
- return 0;
+ return FALSE;
}
-
win->state = WIN_STATE_NORMAL;
break;
- case WIN_STATE_PARAGRAPH:
- if (!WaitWithDownArrow(win))
- return 0;
- ClearWindowTextLines(win);
- win->state = WIN_STATE_NORMAL;
- BLOCK_CROSS_JUMP
- return 0;
- case WIN_STATE_NEWLINE_WAIT:
- if (!WaitWithDownArrow(win))
- return 0;
- ScrollWindowTextLines(win);
- win->state = WIN_STATE_NORMAL;
- BLOCK_CROSS_JUMP
- return 0;
+ case WIN_STATE_WAIT_CLEAR:
+ // Erase the text once a button is pressed
+ if (WaitWithDownArrow(win))
+ {
+ Text_ClearWindow(win);
+ win->state = WIN_STATE_NORMAL;
+ asm("");
+ }
+ return FALSE;
+ case WIN_STATE_WAIT_SCROLL:
+ // Scroll the text once a button is pressed
+ if (WaitWithDownArrow(win))
+ {
+ ScrollWindowTextLines(win);
+ win->state = WIN_STATE_NORMAL;
+ asm("");
+ }
+ return FALSE;
case WIN_STATE_PLACEHOLDER:
win->textIndex++;
win->state = WIN_STATE_NORMAL;
@@ -2434,35 +2465,35 @@ static u8 UpdateWindowText(struct Window *win)
case WIN_STATE_NEWLINE:
ScrollWindowTextLines(win);
win->state = WIN_STATE_NORMAL;
- BLOCK_CROSS_JUMP
- return 0;
+ asm("");
+ return FALSE;
case WIN_STATE_BEGIN:
- ClearWindowTextLines(win);
+ Text_ClearWindow(win);
break;
case WIN_STATE_WAIT_SOUND:
if (IsSEPlaying())
- return 0;
+ return FALSE;
win->state = WIN_STATE_NORMAL;
break;
case WIN_STATE_END:
- return 1;
+ return TRUE; // done printing text
case WIN_STATE_NORMAL:
break;
default:
win->state = WIN_STATE_END;
- return 1;
+ return TRUE;
}
- InterpretText(win);
+ PrintNextChar(win);
switch (win->state)
{
case WIN_STATE_END:
- return 1;
+ return TRUE; // done printing text
case WIN_STATE_WAIT_BUTTON:
- case WIN_STATE_PARAGRAPH:
- case WIN_STATE_NEWLINE_WAIT:
- if (PlayerCanInterruptWait(win))
+ case WIN_STATE_WAIT_CLEAR:
+ case WIN_STATE_WAIT_SCROLL:
+ if (PlayerCanInterruptDelay(win))
return 0;
win->delayCounter = 60;
break;
@@ -2471,8 +2502,9 @@ static u8 UpdateWindowText(struct Window *win)
case WIN_STATE_WAIT_SOUND:
break;
default:
- win->state = WIN_STATE_INTERRUPTIBLE_PAUSE;
+ win->state = WIN_STATE_CHAR_DELAY;
win->delayCounter = GetTextDelay(win);
+ break;
}
return 0;
@@ -2484,45 +2516,45 @@ static u8 UpdateWindowText(struct Window *win)
#define SUB_800374C_LINE_LENGTH 27
#endif
-u8 sub_800374C(struct Window *win)
+u8 Text_UpdateWindowInBattle(struct Window *win)
{
u8 retVal;
- sWaitType = 1;
+ sWaitType = WAIT_TYPE_BATTLE;
sLineLength = SUB_800374C_LINE_LENGTH;
retVal = UpdateWindowText(win);
sLineLength = 26;
- sWaitType = 0;
+ sWaitType = WAIT_TYPE_NORMAL;
return retVal;
}
-u8 sub_8003778(struct Window *win)
+u8 Text_UpdateWindowAutoscroll(struct Window *win)
{
u8 retVal;
- sWaitType = 2;
+ sWaitType = WAIT_TYPE_AUTOSCROLL;
sLineLength = 26;
retVal = UpdateWindowText(win);
- sWaitType = 0;
+ sWaitType = WAIT_TYPE_NORMAL;
return retVal;
}
-u8 sub_80037A0(struct Window *win)
+u8 Text_UpdateWindowInContest(struct Window *win)
{
u8 retVal;
- sWaitType = 3;
+ sWaitType = WAIT_TYPE_CONTEST;
sLineLength = 17;
retVal = UpdateWindowText(win);
sLineLength = 26;
return retVal;
}
-u32 sub_80037C8(struct Window *win, u8 lineLength)
+u32 Text_UpdateWindowOverrideLineLength(struct Window *win, u8 lineLength)
{
u8 retVal;
- sWaitType = 0;
+ sWaitType = WAIT_TYPE_NORMAL;
sLineLength = lineLength;
retVal = UpdateWindowText(win);
sLineLength = 26;
@@ -2757,14 +2789,14 @@ static void ApplyColors_ShadowedFont(const void *src, void *dest, u8 foreground,
static void SetCursorX(struct Window *win, u8 x)
{
- if (win->textMode == 0 && ((win->left + win->cursorX) & 7))
+ if (win->textMode == TEXT_MODE_UNKNOWN0 && ((win->left + win->cursorX) & 7))
win->tileDataOffset += 2;
win->cursorX = x;
}
static void AddToCursorX(struct Window *win, u8 deltaX)
{
- if (win->textMode == 0)
+ if (win->textMode == TEXT_MODE_UNKNOWN0)
{
u8 x = win->cursorX;
win->cursorX += deltaX;
@@ -2779,7 +2811,7 @@ static void AddToCursorX(struct Window *win, u8 deltaX)
static void AddToCursorY(struct Window *win, u8 deltaY)
{
- if (win->textMode == 0 && ((win->left + win->cursorX) & 7))
+ if (win->textMode == TEXT_MODE_UNKNOWN0 && ((win->left + win->cursorX) & 7))
win->tileDataOffset += 2;
win->cursorY += deltaY;
}
@@ -2788,11 +2820,11 @@ static void EraseAtCursor(struct Window *win)
{
switch (win->textMode)
{
- case 0:
- case 2:
+ case TEXT_MODE_UNKNOWN0:
+ case TEXT_MODE_UNKNOWN2:
DrawGlyphTiles(win, 0, 8);
break;
- case 1:
+ case TEXT_MODE_MONOSPACE:
sWriteGlyphTilemapFuncs[win->fontNum](win, 0);
break;
}
@@ -2801,7 +2833,8 @@ static void EraseAtCursor(struct Window *win)
static void ClipLeft(struct Window *win)
{
u32 pixel = win->left & 7;
- if (win->textMode != 1 && pixel)
+
+ if (win->textMode != TEXT_MODE_MONOSPACE && pixel)
{
const u32 *masks = sGlyphMasks[8][pixel];
u32 outsideMask = masks[0];
@@ -2834,32 +2867,40 @@ static void ClipRight(struct Window *win)
{
register u8 cursorX asm("r0") = win->cursorX;
u8 left = win->left;
- u32 pixel = (cursorX + left) & 7;
- if (win->textMode != 1 && pixel)
+ u32 pixelX = (cursorX + left) & 7;
+
+ if (win->textMode != TEXT_MODE_MONOSPACE && pixelX != 0)
{
- const u32 *masks = sGlyphMasks[8 - pixel][pixel];
+ const u32 *masks = sGlyphMasks[8 - pixelX][pixelX];
u32 insideMask = masks[0];
u32 outside = (sGlyphBuffer.background & ~insideMask);
- u16 tileNum = GetCursorTileNum(win, 0, 0);
- u32 *buffer = (u32 *)(win->tileData + 32 * tileNum);
- buffer[0] = (buffer[0] & insideMask) | outside;
- buffer[1] = (buffer[1] & insideMask) | outside;
- buffer[2] = (buffer[2] & insideMask) | outside;
- buffer[3] = (buffer[3] & insideMask) | outside;
- buffer[4] = (buffer[4] & insideMask) | outside;
- buffer[5] = (buffer[5] & insideMask) | outside;
- buffer[6] = (buffer[6] & insideMask) | outside;
- buffer[7] = (buffer[7] & insideMask) | outside;
+ u16 tileNum;
+ u32 *tileData;
+
+ tileNum = GetCursorTileNum(win, 0, 0);
+ tileData = (u32 *)(win->tileData + 32 * tileNum);
+
+ tileData[0] = (tileData[0] & insideMask) | outside;
+ tileData[1] = (tileData[1] & insideMask) | outside;
+ tileData[2] = (tileData[2] & insideMask) | outside;
+ tileData[3] = (tileData[3] & insideMask) | outside;
+ tileData[4] = (tileData[4] & insideMask) | outside;
+ tileData[5] = (tileData[5] & insideMask) | outside;
+ tileData[6] = (tileData[6] & insideMask) | outside;
+ tileData[7] = (tileData[7] & insideMask) | outside;
+
tileNum = GetCursorTileNum(win, 0, 1);
- buffer = (u32 *)(win->tileData + 32 * tileNum);
- buffer[0] = (buffer[0] & insideMask) | outside;
- buffer[1] = (buffer[1] & insideMask) | outside;
- buffer[2] = (buffer[2] & insideMask) | outside;
- buffer[3] = (buffer[3] & insideMask) | outside;
- buffer[4] = (buffer[4] & insideMask) | outside;
- buffer[5] = (buffer[5] & insideMask) | outside;
- buffer[6] = (buffer[6] & insideMask) | outside;
- buffer[7] = (buffer[7] & insideMask) | outside;
+ tileData = (u32 *)(win->tileData + 32 * tileNum);
+
+ tileData[0] = (tileData[0] & insideMask) | outside;
+ tileData[1] = (tileData[1] & insideMask) | outside;
+ tileData[2] = (tileData[2] & insideMask) | outside;
+ tileData[3] = (tileData[3] & insideMask) | outside;
+ tileData[4] = (tileData[4] & insideMask) | outside;
+ tileData[5] = (tileData[5] & insideMask) | outside;
+ tileData[6] = (tileData[6] & insideMask) | outside;
+ tileData[7] = (tileData[7] & insideMask) | outside;
+
UpdateTilemap(win, 1);
}
}
@@ -2876,7 +2917,7 @@ static void InitColors(struct Window *win)
sGlyphBuffer.colors[i] = i;
}
-static void SetBackgroundColor(struct Window *win, u8 color)
+static void SetWindowBackgroundColor(struct Window *win, u8 color)
{
u32 val1;
u32 val2;
@@ -2889,13 +2930,13 @@ static void SetBackgroundColor(struct Window *win, u8 color)
sGlyphBuffer.background = val3;
}
-static void SetShadowColor(struct Window *win, u8 color)
+static void SetWindowShadowColor(struct Window *win, u8 color)
{
win->shadowColor = color;
sGlyphBuffer.colors[14] = color;
}
-static void SetForegroundColor(struct Window *win, u8 color)
+static void SetWindowForegroundColor(struct Window *win, u8 color)
{
win->foregroundColor = color;
sGlyphBuffer.colors[15] = color;
@@ -2903,25 +2944,25 @@ static void SetForegroundColor(struct Window *win, u8 color)
static u8 GetTextDelay(struct Window *win)
{
- if (!PlayerCanInterruptWait(win))
+ if (!PlayerCanInterruptDelay(win))
return 3;
return sTextSpeedDelays[gSaveBlock2.optionsTextSpeed];
}
-static bool8 PlayerCanInterruptWait(struct Window *win)
+static bool8 PlayerCanInterruptDelay(struct Window *win)
{
bool8 retVal = TRUE;
switch (sWaitType)
{
- case 2:
+ case WAIT_TYPE_AUTOSCROLL:
retVal = FALSE;
break;
- case 3:
+ case WAIT_TYPE_CONTEST:
retVal = gIsLinkContest ? FALSE : TRUE;
break;
- case 1:
+ case WAIT_TYPE_BATTLE:
retVal = (gBattleTypeFlags & BATTLE_TYPE_LINK) ? FALSE : TRUE;
break;
}
@@ -2933,13 +2974,13 @@ static void ScrollWindowTextLines(struct Window *win)
{
switch (win->textMode)
{
- case 0:
+ case TEXT_MODE_UNKNOWN0:
ScrollWindowTextLines_TextMode0(win);
break;
- case 1:
- ScrollWindowTextLines_TextMode1(win);
+ case TEXT_MODE_MONOSPACE:
+ ScrollWindowTextLines_TextModeMonospace(win);
break;
- case 2:
+ case TEXT_MODE_UNKNOWN2:
ScrollWindowTextLines_TextMode2(win);
break;
}
@@ -2949,6 +2990,7 @@ static void ScrollWindowTextLines_TextMode0(struct Window *win)
{
if (win->cursorY == 0)
{
+ // Advance to the next line
win->tileDataOffset = 2 * sLineLength + 2;
win->cursorX = 0;
win->cursorY += 16;
@@ -2959,7 +3001,7 @@ static void ScrollWindowTextLines_TextMode0(struct Window *win)
win->tileDataOffset = 2 * sLineLength + 2;
else
win->tileDataOffset = 2;
- win->win_field_C = win->win_field_C ^ 2;
+ win->win_field_C ^= 2;
win->cursorX = 0;
DoScroll_TextMode0(win, sLineLength);
}
@@ -2973,16 +3015,21 @@ static void DoScroll_TextMode0(struct Window *win, u16 lineLength)
u16 fill;
buffer += val1 + val2;
fill = (win->paletteNum << 12) | GetBlankTileNum(win);
+
+ // Move the bottom line up
CpuCopy16(buffer + 64, buffer, lineLength * 2);
CpuCopy16(buffer + 96, buffer + 32, lineLength * 2);
+
+ // Clear the bottom line
CpuFill16(fill, buffer + 64, lineLength * 2);
CpuFill16(fill, buffer + 96, lineLength * 2);
}
-static void ScrollWindowTextLines_TextMode1(struct Window *win)
+static void ScrollWindowTextLines_TextModeMonospace(struct Window *win)
{
if (win->cursorY == 0)
{
+ // Advance to the next line
win->cursorX = 0;
win->cursorY += 16;
}
@@ -2990,17 +3037,21 @@ static void ScrollWindowTextLines_TextMode1(struct Window *win)
{
win->win_field_C ^= 2;
win->cursorX = 0;
- DoScroll_TextMode1(win, sLineLength);
+ DoScroll_TextModeMonospace(win, sLineLength);
}
}
-static void DoScroll_TextMode1(struct Window *win, u16 lineLength)
+static void DoScroll_TextModeMonospace(struct Window *win, u16 lineLength)
{
u16 *buffer = GetCursorTilemapPointer(win);
u16 *dest = buffer - 32;
u16 fill = (win->paletteNum << 12) | GetBlankTileNum(win);
+
+ // Move the bottom line up
CpuCopy16(buffer + 32, dest, lineLength * 2);
CpuCopy16(buffer + 64, buffer, lineLength * 2);
+
+ // Clear the bottom line
CpuFill16(fill, buffer + 32, lineLength * 2);
CpuFill16(fill, buffer + 64, lineLength * 2);
}
@@ -3009,6 +3060,7 @@ static void ScrollWindowTextLines_TextMode2(struct Window *win)
{
if (win->cursorY == 0)
{
+ // Advance to the next line
win->cursorX = 0;
win->cursorY += 16;
}
@@ -3055,18 +3107,18 @@ static void DoScroll_TextMode2(struct Window *win, u8 lineLength)
}
}
-void ClearWindowTextLines(struct Window *win)
+void Text_ClearWindow(struct Window *win)
{
switch (win->textMode)
{
- case 0:
+ case TEXT_MODE_UNKNOWN0:
ClearWindowTextLines_TextMode0_TextMode1(win, sLineLength);
win->tileDataOffset = 2;
break;
- case 1:
+ case TEXT_MODE_MONOSPACE:
ClearWindowTextLines_TextMode0_TextMode1(win, sLineLength);
break;
- case 2:
+ case TEXT_MODE_UNKNOWN2:
ClearWindowTextLines_TextMode2(win, sLineLength);
break;
}
@@ -3074,7 +3126,7 @@ void ClearWindowTextLines(struct Window *win)
static void ClearWindowTextLines_TextMode0_TextMode1(struct Window *win, u8 lineLength)
{
- u8 i;
+ u8 x, y;
u16 *buffer;
u16 fill;
@@ -3085,11 +3137,10 @@ static void ClearWindowTextLines_TextMode0_TextMode1(struct Window *win, u8 line
buffer = GetCursorTilemapPointer(win);
fill = GetBlankTileNum(win) | (win->paletteNum << 12);
- for (i = 0; i < 4; i++)
+ for (y = 0; y < 4; y++)
{
- u8 j;
- for (j = 0; j < lineLength; j++)
- buffer[j] = fill;
+ for (x = 0; x < lineLength; x++)
+ buffer[x] = fill;
buffer += 32;
}
}
@@ -3114,13 +3165,13 @@ static void ClearWindowTextLines_TextMode2(struct Window *win, u8 lineLength)
static void DrawDownArrow(struct Window *win)
{
- if (PlayerCanInterruptWait(win))
+ if (PlayerCanInterruptDelay(win))
{
const u32 *downArrowTiles = &sDownArrowTiles[((win->downArrowCounter & 0x0F00) >> 8) * 16];
switch (win->textMode)
{
- case 1:
+ case TEXT_MODE_MONOSPACE:
{
u8 *buffer;
u16 tileNum = win->tileDataStartOffset + 254;
@@ -3132,8 +3183,8 @@ static void DrawDownArrow(struct Window *win)
WriteGlyphTilemap(win, tileNum, tileNum + 1);
break;
}
- case 0:
- case 2:
+ case TEXT_MODE_UNKNOWN0:
+ case TEXT_MODE_UNKNOWN2:
{
struct GlyphTileInfo glyphTileInfo;
glyphTileInfo.textMode = win->textMode;
@@ -3172,9 +3223,9 @@ static void DrawDownArrow(struct Window *win)
static u8 WaitWithDownArrow(struct Window *win)
{
- u8 retVal = 1;
+ u8 retVal = TRUE;
- if (!PlayerCanInterruptWait(win))
+ if (!PlayerCanInterruptDelay(win))
{
win->delayCounter--;
if (!win->delayCounter)
@@ -3183,8 +3234,8 @@ static u8 WaitWithDownArrow(struct Window *win)
}
else
{
- DrawMovingDownArrow(win);
- retVal = 0;
+ UpdateDownArrowAnimation(win);
+ retVal = FALSE;
}
}
else
@@ -3196,8 +3247,8 @@ static u8 WaitWithDownArrow(struct Window *win)
}
else
{
- DrawMovingDownArrow(win);
- retVal = 0;
+ UpdateDownArrowAnimation(win);
+ retVal = FALSE;
}
}
@@ -3210,7 +3261,7 @@ static void DrawInitialDownArrow(struct Window *win)
DrawDownArrow(win);
}
-static void DrawMovingDownArrow(struct Window *win)
+static void UpdateDownArrowAnimation(struct Window *win)
{
u16 downArrowPos = (win->downArrowCounter & 0x0F00) >> 8;
u16 wait = win->downArrowCounter & 0x000F;
@@ -3237,31 +3288,37 @@ static void DrawMovingDownArrow(struct Window *win)
static void TryEraseDownArrow(struct Window *win)
{
win->downArrowCounter = 0;
- if (PlayerCanInterruptWait(win) == TRUE)
+ if (PlayerCanInterruptDelay(win) == TRUE)
EraseAtCursor(win);
}
-u16 GetWindowTilemapEntry(struct Window *win, u8 x, u8 y)
+// unused
+u16 Text_GetWindowTilemapEntry(struct Window *win, u8 x, u8 y)
{
u16 *tilemap = win->tilemap;
return tilemap[32 * y + x];
}
-void DrawWindowRect(struct Window *win, u16 tilemapEntry, u8 left, u8 top, u8 right, u8 bottom)
+// unused
+void Text_FillWindowBorder(struct Window *win, u16 tilemapEntry, u8 left, u8 top, u8 right, u8 bottom)
{
u8 i;
u16 *buffer = &win->tilemap[top * 32];
+ // Fill top border
for (i = left; i <= right; i++)
buffer[i] = tilemapEntry;
for (i = top + 1; i < bottom - 1; i++)
{
buffer += 32;
+ // left border
buffer[left] = tilemapEntry;
+ // right border
buffer[right] = tilemapEntry;
}
+ // Fill bottom border
if (top != bottom)
{
buffer += 32;
@@ -3270,19 +3327,21 @@ void DrawWindowRect(struct Window *win, u16 tilemapEntry, u8 left, u8 top, u8 ri
}
}
+// unused
void DrawWindowRect_DefaultPalette(struct Window *win, u16 tileNum, u8 left, u8 top, u8 right, u8 bottom)
{
- DrawWindowRect(win, (win->paletteNum << 12) | tileNum, left, top, right, bottom);
+ Text_FillWindowBorder(win, (win->paletteNum << 12) | tileNum, left, top, right, bottom);
}
+// Fills the whole window area with tilemapEntry
void FillWindowRect(struct Window *win, u16 tilemapEntry, u8 left, u8 top, u8 right, u8 bottom)
{
u16 *buffer = &win->tilemap[top * 32];
while (top++ <= bottom)
{
- u8 j;
- for (j = left; j <= right; j++)
- buffer[j] = tilemapEntry;
+ u8 x;
+ for (x = left; x <= right; x++)
+ buffer[x] = tilemapEntry;
buffer += 32;
}
}
@@ -3297,7 +3356,7 @@ void ZeroFillWindowRect(struct Window *win, u8 left, u8 top, u8 right, u8 bottom
FillWindowRect_DefaultPalette(win, 0, left, top, right, bottom);
}
-void FillWindowRectWithBlankTile(struct Window *win, u8 left, u8 top, u8 right, u8 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);
@@ -3309,12 +3368,12 @@ static u16 GetBlankTileNum(struct Window *win)
switch (win->textMode)
{
- case 0:
+ case TEXT_MODE_UNKNOWN0:
break;
- case 2:
+ case TEXT_MODE_UNKNOWN2:
retVal++;
break;
- case 1:
+ case TEXT_MODE_MONOSPACE:
switch (win->fontNum)
{
case 1:
@@ -3451,7 +3510,7 @@ u8 *AlignInt2(struct Window *win, u8 *dest, s32 value, u8 alignAmount, u8 alignT
ConvertIntToDecimalString(temp, value);
width = GetStringWidth(win, temp);
dest = StringCopy(dest, temp);
- dest[0] = 0xFC;
+ dest[0] = EXT_CTRL_CODE_BEGIN;
dest[1] = 17;
dest[2] = alignAmount - width;
dest += 3;
@@ -3462,7 +3521,7 @@ u8 *AlignInt2(struct Window *win, u8 *dest, s32 value, u8 alignAmount, u8 alignT
width = GetStringWidth(win, temp);
if (alignAmount > width)
{
- dest[0] = 0xFC;
+ dest[0] = EXT_CTRL_CODE_BEGIN;
dest[1] = 17;
dest[2] = alignAmount - width;
dest += 3;
@@ -3474,7 +3533,7 @@ u8 *AlignInt2(struct Window *win, u8 *dest, s32 value, u8 alignAmount, u8 alignT
width = GetStringWidth(win, temp);
if (alignAmount > width)
{
- dest[0] = 0xFC;
+ dest[0] = EXT_CTRL_CODE_BEGIN;
dest[1] = 17;
dest[2] = (alignAmount - width) / 2;
dest += 3;
@@ -3482,7 +3541,7 @@ u8 *AlignInt2(struct Window *win, u8 *dest, s32 value, u8 alignAmount, u8 alignT
dest = StringCopy(dest, temp);
if (alignAmount > width)
{
- dest[0] = 0xFC;
+ dest[0] = EXT_CTRL_CODE_BEGIN;
dest[1] = 17;
dest[2] = (alignAmount - width) / 2;
dest += 3;
@@ -3500,7 +3559,7 @@ u8 *AlignString(struct Window *win, u8 *dest, const u8 *src, u8 alignAmount, u8
{
case 0:
dest = StringCopy(dest, src);
- dest[0] = 0xFC;
+ dest[0] = EXT_CTRL_CODE_BEGIN;
dest[1] = 19;
dest[2] = alignAmount;
dest += 3;
@@ -3510,7 +3569,7 @@ u8 *AlignString(struct Window *win, u8 *dest, const u8 *src, u8 alignAmount, u8
width = GetStringWidth(win, src);
if (alignAmount > width)
{
- dest[0] = 0xFC;
+ dest[0] = EXT_CTRL_CODE_BEGIN;
dest[1] = 19;
dest[2] = alignAmount - width;
dest += 3;
@@ -3521,7 +3580,7 @@ u8 *AlignString(struct Window *win, u8 *dest, const u8 *src, u8 alignAmount, u8
width = GetStringWidth(win, src);
if (alignAmount > width)
{
- dest[0] = 0xFC;
+ dest[0] = EXT_CTRL_CODE_BEGIN;
dest[1] = 19;
dest[2] = (alignAmount - width) / 2;
dest += 3;
@@ -3529,7 +3588,7 @@ u8 *AlignString(struct Window *win, u8 *dest, const u8 *src, u8 alignAmount, u8
dest = StringCopy(dest, src);
if (alignAmount > width)
{
- dest[0] = 0xFC;
+ dest[0] = EXT_CTRL_CODE_BEGIN;
dest[1] = 19;
dest[2] = alignAmount;
dest += 3;
@@ -3544,16 +3603,16 @@ u8 GetStringWidth(struct Window *win, const u8 *s)
{
u8 width = 0;
u8 savedFontNum = win->fontNum;
- u8 savedCharset = win->language;
+ u8 savedLanguage = win->language;
u8 savedSpacing = win->spacing;
s32 i = 0;
- while (s[i] != 0xFF)
+ while (s[i] != EOS)
{
u8 c = s[i];
switch (c)
{
- case 0xFD:
+ case PLACEHOLDER_BEGIN:
{
u8 temp;
i++;
@@ -3563,7 +3622,7 @@ u8 GetStringWidth(struct Window *win, const u8 *s)
i++;
break;
}
- case 0xFC:
+ case EXT_CTRL_CODE_BEGIN:
i++;
switch (s[i])
{
@@ -3571,7 +3630,7 @@ u8 GetStringWidth(struct Window *win, const u8 *s)
win->fontNum = s[i + 1];
break;
case 7:
- win->fontNum = win->config->fontNum;
+ win->fontNum = win->template->fontNum;
break;
case 0x11:
width += s[i + 1];
@@ -3601,7 +3660,7 @@ u8 GetStringWidth(struct Window *win, const u8 *s)
}
win->spacing = savedSpacing;
- win->language = savedCharset;
+ win->language = savedLanguage;
win->fontNum = savedFontNum;
return width;
@@ -3609,30 +3668,30 @@ u8 GetStringWidth(struct Window *win, const u8 *s)
u8 sub_8004D04(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u16 top, u32 a6)
{
- sub_8002E4C(win, text, tileDataStartOffset, left, top, a6);
- return sub_8002F44(win);
+ 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 width = GetStringWidth(win, text);
- InitWindow(win, text, tileDataStartOffset, left - ((u32)(width + 7) >> 3), top);
+ Text_InitWindow(win, text, tileDataStartOffset, left - ((u32)(width + 7) >> 3), top);
EraseAtCursor(win);
width &= 7;
if (width)
width = 8 - width;
sub_80048D8(win, width, 0);
- return sub_8002F44(win);
+ return Text_PrintWindow8002F44(win);
}
u8 sub_8004DB0(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);
- InitWindow(win, text, tileDataStartOffset, left, top);
+ Text_InitWindow(win, text, tileDataStartOffset, left, top);
EraseAtCursor(win);
sub_80048D8(win, val & 7, 0);
- return sub_8002F44(win);
+ return Text_PrintWindow8002F44(win);
}
u8 sub_8004E24(struct Window *win)
@@ -3640,25 +3699,25 @@ u8 sub_8004E24(struct Window *win)
return win->paletteNum;
}
-void sub_8004E28(struct Window *win, u8 *foreground, u8 *background, u8 *shadow)
+void Text_GetTextColors(struct Window *win, u8 *foreground, u8 *background, u8 *shadow)
{
*foreground = win->foregroundColor;
*background = win->backgroundColor;
*shadow = win->shadowColor;
}
-void sub_8004E3C(const struct WindowConfig *winConfig, u8 *tileData, const u8 *text)
+void sub_8004E3C(const struct WindowTemplate *winTemplate, u8 *tileData, const u8 *text)
{
- sTempWindow.config = winConfig;
- InitWindow(&sTempWindow, text, 0, 0, 0);
+ sTempWindow.template = winTemplate;
+ Text_InitWindow(&sTempWindow, text, 0, 0, 0);
sTempWindow.tileData = tileData;
- sub_8002F44(&sTempWindow);
+ Text_PrintWindow8002F44(&sTempWindow);
}
-u8 GetStringWidthGivenWindowConfig(const struct WindowConfig *winConfig, const u8 *s)
+u8 Text_GetStringWidthFromWindowTemplate(const struct WindowTemplate *winTemplate, const u8 *s)
{
- sTempWindow.config = winConfig;
- InitWindow(&sTempWindow, s, 0, 0, 0);
+ sTempWindow.template = winTemplate;
+ Text_InitWindow(&sTempWindow, s, 0, 0, 0);
return GetStringWidth(&sTempWindow, s);
}
@@ -3801,8 +3860,8 @@ u8 sub_8004FD0(struct Window *win, u8 *dest, const u8 *src, u16 tileDataStartOff
if (endsWithoutNewline)
newlineCount++;
- sub_8002E4C(win, start, tileDataStartOffset, left, top, a8);
- sub_8002F44(win);
+ Text_InitWindow8002E4C(win, start, tileDataStartOffset, left, top, a8);
+ Text_PrintWindow8002F44(win);
return newlineCount;
}
@@ -3827,7 +3886,7 @@ static s32 DrawGlyphTile_UnshadowedFont(struct GlyphTileInfo *glyphTileInfo)
if (glyphTileInfo->startPixel + glyphTileInfo->width > 8)
{
u32 mask2 = masks[1];
- if (glyphTileInfo->textMode == 2)
+ if (glyphTileInfo->textMode == TEXT_MODE_UNKNOWN2)
{
glyphBuffer->pixelRows[8] = buffer[8] & mask2;
glyphBuffer->pixelRows[9] = buffer[9] & mask2;
@@ -3867,7 +3926,7 @@ static s32 DrawGlyphTile_UnshadowedFont(struct GlyphTileInfo *glyphTileInfo)
if (glyphTileInfo->startPixel + glyphTileInfo->width > 8)
{
- if (glyphTileInfo->textMode != 2)
+ if (glyphTileInfo->textMode != TEXT_MODE_UNKNOWN2)
buffer += 8;
buffer[8] = glyphBuffer->pixelRows[8];
buffer[9] = glyphBuffer->pixelRows[9];
@@ -4039,7 +4098,7 @@ static s32 DrawGlyphTile_ShadowedFont(struct GlyphTileInfo *glyphTileInfo)
if (glyphTileInfo->startPixel + glyphTileInfo->width > 8)
{
u32 mask2 = masks[1];
- if (glyphTileInfo->textMode == 2)
+ if (glyphTileInfo->textMode == TEXT_MODE_UNKNOWN2)
{
glyphBuffer->pixelRows[8] = buffer[8] & mask2;
glyphBuffer->pixelRows[9] = buffer[9] & mask2;
@@ -4076,7 +4135,7 @@ static s32 DrawGlyphTile_ShadowedFont(struct GlyphTileInfo *glyphTileInfo)
if (glyphTileInfo->startPixel + glyphTileInfo->width > 8)
{
- if (glyphTileInfo->textMode != 2)
+ if (glyphTileInfo->textMode != TEXT_MODE_UNKNOWN2)
buffer += 8;
buffer[8] = glyphBuffer->pixelRows[8];
buffer[9] = glyphBuffer->pixelRows[9];
@@ -4314,7 +4373,7 @@ static u16 GetCursorTileNum(struct Window *win, u32 xOffset, u32 yOffset)
{
u16 index;
- if (win->textMode == 2)
+ if (win->textMode == TEXT_MODE_UNKNOWN2)
index = win->tileDataStartOffset
+ win->tileDataOffset
+ (((win->top + win->cursorY) >> 3) + yOffset) * win->width
diff --git a/src/engine/text_window.c b/src/engine/text_window.c
index c001ddefc..ade349f4e 100644
--- a/src/engine/text_window.c
+++ b/src/engine/text_window.c
@@ -4,19 +4,22 @@
#include "palette.h"
#include "text.h"
-#define STD_MSG_BOX_LEFT 0
-#define STD_MSG_BOX_TOP 14
-#define STD_MSG_BOX_WIDTH 26
-#define STD_MSG_BOX_HEIGHT 4
+#define STD_WINDOW_PALETTE_NUM 14
+
+// Dimensions (in tiles) of a field dialogue frame
+#define STD_DLG_FRAME_LEFT 0
+#define STD_DLG_FRAME_TOP 14
+#define STD_DLG_FRAME_WIDTH 26
+#define STD_DLG_FRAME_HEIGHT 4
static void LoadTextWindowTiles(u8, void *);
static void LoadTextWindowPalette(u8, u8);
-static void DrawTextWindowInternal(u16 *dest, u16 baseTileNum, u8 left, u8 top, u8 right, u8 bottom);
-static u16 GetMessageBoxTilemapEntry(u16 tilemapEntry, u8 x, u8 y, u8 width, u8 height);
-static void DrawMessageBox(struct Window *win, u8 left, u8 top, u8 width, u8 height);
+static void DrawStandardFrame(u16 *dest, u16 baseTileNum, u8 left, u8 top, u8 right, u8 bottom);
+static u16 GetDialogueFrameTilemapEntry(u16 tilemapEntry, u8 x, u8 y, u8 width, u8 height);
+static void DrawDialogueFrame(struct Window *win, u8 left, u8 top, u8 width, u8 height);
static u16 sTextWindowBaseTileNum;
-static u16 sMessageBoxBaseTileNum;
+static u16 sDialogueFrameBaseTileNum;
extern const u8 gTextWindowFrame1_Gfx[];
extern const u8 gTextWindowFrame2_Gfx[];
@@ -60,9 +63,9 @@ extern const u16 gTextWindowFrame18_Pal[];
extern const u16 gTextWindowFrame19_Pal[];
extern const u16 gTextWindowFrame20_Pal[];
-extern const u8 gMessageBox_Gfx[];
+extern const u8 gDialogueFrame_Gfx[];
-static const struct FrameGraphics gUnknown_083761F0[20] =
+static const struct FrameGraphics sTextWindowFrameGraphics[20] =
{
{gTextWindowFrame1_Gfx, gTextWindowFrame1_Pal},
{gTextWindowFrame2_Gfx, gTextWindowFrame2_Pal},
@@ -86,7 +89,7 @@ static const struct FrameGraphics gUnknown_083761F0[20] =
{gTextWindowFrame20_Gfx, gTextWindowFrame20_Pal},
};
-static const u16 gMessageBoxTilemap[5][7] =
+static const u16 sDialogueFrameTilemap[5][7] =
{
{1, 3, 4, 4, 5, 6, 9},
{11, 9, 9, 9, 9, 0x040B, 9},
@@ -95,113 +98,124 @@ static const u16 gMessageBoxTilemap[5][7] =
{0x0801, 0x0803, 0x0804, 0x0804, 0x0805, 0x0806, 9},
};
-u16 SetTextWindowBaseTileNum(u16 baseTileNum)
+u16 TextWindow_SetBaseTileNum(u16 baseTileNum)
{
sTextWindowBaseTileNum = baseTileNum;
return baseTileNum + 9;
}
-void LoadTextWindowGraphics(struct Window *win)
+// Loads the tiles and palette of the window frame into VRAM using the selected frame type
+void TextWindow_LoadStdFrameGraphics(struct Window *win)
{
- u8 *tileData = win->config->tileData + TILE_SIZE_4BPP * sTextWindowBaseTileNum;
+ u8 *tileData = win->template->tileData + TILE_SIZE_4BPP * sTextWindowBaseTileNum;
LoadTextWindowTiles(gSaveBlock2.optionsWindowFrameType, tileData);
- LoadTextWindowPalette(gSaveBlock2.optionsWindowFrameType, 0xE);
+ LoadTextWindowPalette(gSaveBlock2.optionsWindowFrameType, STD_WINDOW_PALETTE_NUM);
}
-void LoadTextWindowGraphics_OverridePalSlot(struct Window *win, u8 palSlot)
+// Loads the tiles and palette of the window frame into VRAM with an alternate palette
+void TextWindow_LoadStdFrameGraphicsOverridePal(struct Window *win, u8 palSlot)
{
- u8 *tileData = win->config->tileData + TILE_SIZE_4BPP * sTextWindowBaseTileNum;
+ u8 *tileData = win->template->tileData + TILE_SIZE_4BPP * sTextWindowBaseTileNum;
LoadTextWindowTiles(gSaveBlock2.optionsWindowFrameType, tileData);
LoadTextWindowPalette(gSaveBlock2.optionsWindowFrameType, palSlot);
}
-void LoadTextWindowGraphics_OverrideFrameType(struct Window *win, u8 frameType)
+// Loads the tiles and palette of the window frame into VRAM with an alternate frame type
+void TextWindow_LoadStdFrameGraphicsOverrideStyle(struct Window *win, u8 frameType)
{
- u8 *tileData = win->config->tileData + TILE_SIZE_4BPP * sTextWindowBaseTileNum;
+ u8 *tileData = win->template->tileData + TILE_SIZE_4BPP * sTextWindowBaseTileNum;
LoadTextWindowTiles(frameType, tileData);
- LoadTextWindowPalette(frameType, 0xE);
+ LoadTextWindowPalette(frameType, STD_WINDOW_PALETTE_NUM);
}
-void DrawTextWindow(struct Window *win, u8 left, u8 top, u8 right, u8 bottom)
+void TextWindow_DrawStdFrame(struct Window *win, u8 left, u8 top, u8 right, u8 bottom)
{
- DrawTextWindowInternal(win->config->tilemap, sTextWindowBaseTileNum, left, top, right, bottom);
+ DrawStandardFrame(win->template->tilemap, sTextWindowBaseTileNum, left, top, right, bottom);
}
-const struct FrameGraphics *GetTextWindowFrameGraphics(u8 frameType)
+// Returns the tile data and palette for the specified frame type
+const struct FrameGraphics *TextWindow_GetFrameGraphics(u8 frameType)
{
if (frameType > 19)
- return &gUnknown_083761F0[0];
+ return &sTextWindowFrameGraphics[0];
else
- return &gUnknown_083761F0[frameType];
+ return &sTextWindowFrameGraphics[frameType];
}
static void LoadTextWindowTiles(u8 frameType, void *dest)
{
- const struct FrameGraphics *frameGraphics = GetTextWindowFrameGraphics(frameType);
+ const struct FrameGraphics *frameGraphics = TextWindow_GetFrameGraphics(frameType);
CpuFastCopy(frameGraphics->tiles, dest, 9 * TILE_SIZE_4BPP);
}
static void LoadTextWindowPalette(u8 frameType, u8 palSlot)
{
- const struct FrameGraphics *frameGraphics = GetTextWindowFrameGraphics(frameType);
+ const struct FrameGraphics *frameGraphics = TextWindow_GetFrameGraphics(frameType);
LoadPalette(frameGraphics->palette, 16 * palSlot, 0x20);
}
-static void DrawTextWindowInternal(u16 *dest, u16 baseTileNum, u8 left, u8 top, u8 right, u8 bottom)
+// Draws a standard window frame
+static void DrawStandardFrame(u16 *tilemap, u16 baseTileNum, u8 left, u8 top, u8 right, u8 bottom)
{
+ u8 startX = min(left, right);
+ u8 endX = max(left, right);
+ u8 startY = min(top, bottom);
+ u8 endY = max(top, bottom);
u8 x, y;
- u8 startX, endX;
- u8 startY, endY;
-
- startX = (left < right) ? left : right;
- endX = (right > left) ? right : left;
-
- startY = (top < bottom) ? top : bottom;
- endY = (bottom > top) ? bottom : top;
- dest[32 * startY + startX] = baseTileNum | 0xE000;
+ // top left corner
+ tilemap[32 * startY + startX] = baseTileNum | (STD_WINDOW_PALETTE_NUM << 12);
+ // top border
for (x = startX + 1; x < endX; x++)
- dest[32 * startY + x] = (baseTileNum + 1) | 0xE000;
+ tilemap[32 * startY + x] = (baseTileNum + 1) | (STD_WINDOW_PALETTE_NUM << 12);
- dest[32 * startY + endX] = (baseTileNum + 2) | 0xE000;
+ // top right corner
+ tilemap[32 * startY + endX] = (baseTileNum + 2) | (STD_WINDOW_PALETTE_NUM << 12);
for (y = startY + 1; y < endY; y++)
{
- dest[32 * y + startX] = (baseTileNum + 3) | 0xE000;
+ // left border
+ tilemap[32 * y + startX] = (baseTileNum + 3) | (STD_WINDOW_PALETTE_NUM << 12);
+ // middle
for (x = startX + 1; x < endX; x++)
- dest[32 * y + x] = (baseTileNum + 4) | 0xE000;
+ tilemap[32 * y + x] = (baseTileNum + 4) | (STD_WINDOW_PALETTE_NUM << 12);
- dest[32 * y + endX] = (baseTileNum + 5) | 0xE000;
+ // right border
+ tilemap[32 * y + endX] = (baseTileNum + 5) | (STD_WINDOW_PALETTE_NUM << 12);
}
- dest[32 * endY + startX] = (baseTileNum + 6) | 0xE000;
+ // bottom left corner
+ tilemap[32 * endY + startX] = (baseTileNum + 6) | (STD_WINDOW_PALETTE_NUM << 12);
+ // bottom border
for (x = startX + 1; x < endX; x++)
- dest[32 * endY + x] = (baseTileNum + 7) | 0xE000;
+ tilemap[32 * endY + x] = (baseTileNum + 7) | (STD_WINDOW_PALETTE_NUM << 12);
- dest[32 * endY + endX] = (baseTileNum + 8) | 0xE000;
+ // bottom right corner
+ tilemap[32 * endY + endX] = (baseTileNum + 8) | (STD_WINDOW_PALETTE_NUM << 12);
}
-u16 SetMessageBoxBaseTileNum(u16 baseTileNum)
+u16 TextWindow_SetDlgFrameBaseTileNum(u16 baseTileNum)
{
- sMessageBoxBaseTileNum = baseTileNum;
+ sDialogueFrameBaseTileNum = baseTileNum;
return baseTileNum + 14;
}
void unref_sub_80651DC(struct Window *win, u8 *text)
{
- sub_8002EB0(win, text, sMessageBoxBaseTileNum + 14, 2, 15);
+ Text_InitWindow8002EB0(win, text, sDialogueFrameBaseTileNum + 14, 2, 15);
}
-void DisplayMessageBox(struct Window *win)
+// Loads and draws a dialogue window frame
+void TextWindow_DisplayDialogueFrame(struct Window *win)
{
- LoadMessageBoxTiles(win);
- DrawStandardMessageBox(win);
+ TextWindow_LoadDialogueFrameTiles(win);
+ TextWindow_DrawDialogueFrame(win);
}
-static u16 GetMessageBoxTilemapEntry(u16 baseTilemapEntry, u8 x, u8 y, u8 width, u8 height)
+static u16 GetDialogueFrameTilemapEntry(u16 baseTilemapEntry, u8 x, u8 y, u8 width, u8 height)
{
u16 tilemapEntry = 9;
@@ -215,42 +229,47 @@ static u16 GetMessageBoxTilemapEntry(u16 baseTilemapEntry, u8 x, u8 y, u8 width,
else if (x > 2)
x = 3;
- if (x <= 6 && y <= 4)
- tilemapEntry = gMessageBoxTilemap[y][x];
+ if (x < 7 && y < 5)
+ tilemapEntry = sDialogueFrameTilemap[y][x];
tilemapEntry += baseTilemapEntry;
return tilemapEntry;
}
-static void DrawMessageBox(struct Window *win, u8 left, u8 top, u8 width, u8 height)
+static void DrawDialogueFrame(struct Window *win, u8 left, u8 top, u8 width, u8 height)
{
- u8 i, j;
- u16 tilemapEntry = (win->paletteNum << 12) | sMessageBoxBaseTileNum;
- u16 *tilemap = win->config->tilemap;
+ u8 x, y;
+ u16 baseTilemapEntry = (win->paletteNum << 12) | sDialogueFrameBaseTileNum;
+ u16 *tilemap = win->template->tilemap;
- for (i = 0; i < height + 2; i++)
- for (j = 0; j < width + 6; j++)
- tilemap[(left + j) + 32 * (top + i)] = (win->paletteNum << 12) | GetMessageBoxTilemapEntry(tilemapEntry, j, i, width, height);
+ for (y = 0; y < height + 2; y++)
+ {
+ for (x = 0; x < width + 6; x++)
+ tilemap[(left + x) + 32 * (top + y)] = (win->paletteNum << 12) | GetDialogueFrameTilemapEntry(baseTilemapEntry, x, y, width, height);
+ }
}
-void DrawStandardMessageBox(struct Window *win)
+// Draws an alternate styled frame used for dialogue windows that appear on the overworld
+void TextWindow_DrawDialogueFrame(struct Window *win)
{
- DrawMessageBox(win, STD_MSG_BOX_LEFT, STD_MSG_BOX_TOP, STD_MSG_BOX_WIDTH, STD_MSG_BOX_HEIGHT);
+ DrawDialogueFrame(win, STD_DLG_FRAME_LEFT, STD_DLG_FRAME_TOP, STD_DLG_FRAME_WIDTH, STD_DLG_FRAME_HEIGHT);
}
-void LoadMessageBoxTiles(struct Window *win)
+// Loads the dialogue window frame tiles into VRAM
+void TextWindow_LoadDialogueFrameTiles(struct Window *win)
{
- u8 *tileData = win->config->tileData;
- CpuFastCopy(gMessageBox_Gfx, tileData + 32 * sMessageBoxBaseTileNum, 14 * TILE_SIZE_4BPP);
+ u8 *tileData = win->template->tileData;
+ CpuFastCopy(gDialogueFrame_Gfx, tileData + 32 * sDialogueFrameBaseTileNum, 14 * TILE_SIZE_4BPP);
}
-void ClearStandardMessageBox(struct Window *win)
+// Erases a dialogue window frame
+void TextWindow_EraseDialogueFrame(struct Window *win)
{
u8 i;
- u16 *tilemap = win->config->tilemap + (STD_MSG_BOX_TOP * 32);
+ u16 *tilemap = win->template->tilemap + (STD_DLG_FRAME_TOP * 32);
u16 tilemapEntry = win->paletteNum << 12;
- for (i = 0; i < ((STD_MSG_BOX_HEIGHT + 2) * 32); i++)
+ for (i = 0; i < ((STD_DLG_FRAME_HEIGHT + 2) * 32); i++)
tilemap[i] = tilemapEntry;
}
diff --git a/src/engine/trade.c b/src/engine/trade.c
index 0bc589ff4..d37b36f72 100644
--- a/src/engine/trade.c
+++ b/src/engine/trade.c
@@ -141,7 +141,7 @@ struct TradeEwramStruct {
};
static void sub_8047EC0(void);
-static void sub_804AFB8(const struct WindowConfig *, u8 *, const u8 *, u8);
+static void sub_804AFB8(const struct WindowTemplate *, u8 *, const u8 *, u8);
static void sub_804ACD8(const u8 *, u8 *, u8);
static void nullsub_5(u8, u8);
static void sub_804AA88(void);
@@ -1089,10 +1089,10 @@ static void sub_8047EC0(void)
SetVBlankCallback(sub_80489F4);
InitMenuWindow(&gWindowConfig_81E6CE4);
SetUpWindowConfig(&gWindowConfig_81E6F84);
- InitWindowFromConfig(&gUnknown_03004824->window, &gWindowConfig_81E6F84);
- gUnknown_03004824->unk_007a = SetTextWindowBaseTileNum(20);
- LoadTextWindowGraphics(&gUnknown_03004824->window);
- MenuZeroFillScreen();
+ Text_InitWindowWithTemplate(&gUnknown_03004824->window, &gWindowConfig_81E6F84);
+ gUnknown_03004824->unk_007a = TextWindow_SetBaseTileNum(20);
+ TextWindow_LoadStdFrameGraphics(&gUnknown_03004824->window);
+ Menu_EraseScreen();
sub_809D51C();
gUnknown_03004824->unk_0075 = 0;
gUnknown_03004824->unk_007b = 0;
@@ -1269,10 +1269,10 @@ static void sub_80484F4(void)
SetVBlankCallback(sub_80489F4);
InitMenuWindow(&gWindowConfig_81E6CE4);
SetUpWindowConfig(&gWindowConfig_81E6F84);
- InitWindowFromConfig(&gUnknown_03004824->window, &gWindowConfig_81E6F84);
- gUnknown_03004824->unk_007a = SetTextWindowBaseTileNum(20);
- LoadTextWindowGraphics(&gUnknown_03004824->window);
- MenuZeroFillScreen();
+ Text_InitWindowWithTemplate(&gUnknown_03004824->window, &gWindowConfig_81E6F84);
+ gUnknown_03004824->unk_007a = TextWindow_SetBaseTileNum(20);
+ TextWindow_LoadStdFrameGraphics(&gUnknown_03004824->window);
+ Menu_EraseScreen();
sub_809D51C();
gUnknown_03004824->unk_0075 = 0;
gUnknown_03004824->unk_007b = 0;
@@ -2096,7 +2096,7 @@ static void sub_8049680(void)
PlaySE(SE_SELECT);
if (gUnknown_03004824->tradeMenuCursorPosition < PARTY_SIZE)
{
- DrawTextWindow(&gUnknown_03004824->window, 18, 14, 28, 19);
+ TextWindow_DrawStdFrame(&gUnknown_03004824->window, 18, 14, 28, 19);
PrintMenuItems(19, 15, 2, (const struct MenuAction *)gUnknown_0820C320);
InitMenu(0, 19, 15, 2, 0, 9);
gUnknown_03004824->unk_007b = 1;
@@ -2108,7 +2108,7 @@ static void sub_8049680(void)
}
else if (gUnknown_03004824->tradeMenuCursorPosition == 2 * PARTY_SIZE)
{
- DrawTextWindow(&gUnknown_03004824->window, 24, 14, 29, 19);
+ TextWindow_DrawStdFrame(&gUnknown_03004824->window, 24, 14, 29, 19);
InitYesNoMenu(24, 14, 4);
gUnknown_03004824->unk_007b = 4;
sub_804ACD8(gUnknown_0820C14C[4], BG_CHAR_ADDR(4) + 32 * gUnknown_03004824->unk_007e, 20);
@@ -2138,17 +2138,17 @@ static void sub_8049860(void)
if (gMain.newAndRepeatedKeys & DPAD_UP)
{
PlaySE(SE_SELECT);
- gUnknown_03004824->unk_007c = MoveMenuCursor(-1);
+ gUnknown_03004824->unk_007c = Menu_MoveCursor(-1);
}
else if (gMain.newAndRepeatedKeys & DPAD_DOWN)
{
PlaySE(SE_SELECT);
- gUnknown_03004824->unk_007c = MoveMenuCursor(+1);
+ gUnknown_03004824->unk_007c = Menu_MoveCursor(+1);
}
if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
- if (GetMenuCursorPos() == 0)
+ if (Menu_GetCursorPos() == 0)
{
BeginNormalPaletteFade(-1, 0, 0, 16, 0);
gUnknown_03004824->unk_007b = 2;
@@ -2239,17 +2239,17 @@ static void sub_8049AC0(void)
if (gMain.newAndRepeatedKeys & DPAD_UP)
{
PlaySE(SE_SELECT);
- gUnknown_03004824->unk_007c = MoveMenuCursor(-1);
+ gUnknown_03004824->unk_007c = Menu_MoveCursor(-1);
}
else if (gMain.newAndRepeatedKeys & DPAD_DOWN)
{
PlaySE(SE_SELECT);
- gUnknown_03004824->unk_007c = MoveMenuCursor(+1);
+ gUnknown_03004824->unk_007c = Menu_MoveCursor(+1);
}
if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
- if (GetMenuCursorPos() == 0)
+ if (Menu_GetCursorPos() == 0)
{
sub_8049A20();
}
@@ -2267,9 +2267,9 @@ static void sub_8049AC0(void)
else if (gMain.newKeys & B_BUTTON)
{
sub_804AADC(3, 1);
- if (GetMenuCursorPos() == 0)
+ if (Menu_GetCursorPos() == 0)
{
- gUnknown_03004824->unk_007c = MoveMenuCursor(+1);
+ gUnknown_03004824->unk_007c = Menu_MoveCursor(+1);
}
gUnknown_03004824->linkData[0] = 0xbbcc;
Trade_SendData(gUnknown_03004824);
@@ -2282,17 +2282,17 @@ static void sub_8049BC0(void)
if (gMain.newAndRepeatedKeys & DPAD_UP)
{
PlaySE(SE_SELECT);
- gUnknown_03004824->unk_007c = MoveMenuCursor(-1);
+ gUnknown_03004824->unk_007c = Menu_MoveCursor(-1);
}
else if (gMain.newAndRepeatedKeys & DPAD_DOWN)
{
PlaySE(SE_SELECT);
- gUnknown_03004824->unk_007c = MoveMenuCursor(+1);
+ gUnknown_03004824->unk_007c = Menu_MoveCursor(+1);
}
if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
- if (GetMenuCursorPos() == 0)
+ if (Menu_GetCursorPos() == 0)
{
sub_804AA0C(4);
gUnknown_03004824->linkData[0] = 0xeeaa;
@@ -2337,7 +2337,7 @@ static void DisplayMessageAndContinueTask(void)
gUnknown_03004824->unk_00b4++;
if (gUnknown_03004824->unk_00b4 > 120)
{
- DrawTextWindow(&gUnknown_03004824->window, 24, 14, 29, 19);
+ TextWindow_DrawStdFrame(&gUnknown_03004824->window, 24, 14, 29, 19);
InitYesNoMenu(24, 14, 4);
gUnknown_03004824->unk_00b4 = 0;
gUnknown_03004824->unk_007b = 3;
@@ -2491,10 +2491,10 @@ static void sub_8049ED4(u8 a0)
string1[3] = 0xFC;
string1[4] = 0x11;
string1[5] = (64 - stringLength) / 2;
- sub_8003460(&gUnknown_03004824->window, string1, gUnknown_03004824->unk_007a + whichParty * 6 * 32, gUnknown_0820C334[whichParty][0], gUnknown_0820C334[whichParty][1]);
+ Text_InitWindowAndPrintText(&gUnknown_03004824->window, string1, gUnknown_03004824->unk_007a + whichParty * 6 * 32, gUnknown_0820C334[whichParty][0], gUnknown_0820C334[whichParty][1]);
sub_804A33C(string2, whichParty, whichPokemon);
- sub_8003460(&gUnknown_03004824->window, gOtherText_Terminator2, gUnknown_03004824->unk_007a + whichParty * 6 * 32 + 32, gUnknown_0820C334[whichParty + 1][0], gUnknown_0820C334[whichParty + 1][1] + 1);
- sub_8003460(&gUnknown_03004824->window, string2, gUnknown_03004824->unk_007a + whichParty * 6 * 32 + 38, gUnknown_0820C334[whichParty + 1][0], gUnknown_0820C334[whichParty + 1][1] + 1);
+ Text_InitWindowAndPrintText(&gUnknown_03004824->window, gOtherText_Terminator2, gUnknown_03004824->unk_007a + whichParty * 6 * 32 + 32, gUnknown_0820C334[whichParty + 1][0], gUnknown_0820C334[whichParty + 1][1] + 1);
+ Text_InitWindowAndPrintText(&gUnknown_03004824->window, string2, gUnknown_03004824->unk_007a + whichParty * 6 * 32 + 38, gUnknown_0820C334[whichParty + 1][0], gUnknown_0820C334[whichParty + 1][1] + 1);
gUnknown_03004824->unk_0080[a0] ++;
break;
case 4:
@@ -2884,7 +2884,7 @@ static void sub_8049ED4(u8 a0)
"\tldrb r1, [r1]\n"
"\tstr r1, [sp]\n"
"\tadd r1, sp, 0xC\n"
- "\tbl sub_8003460\n"
+ "\tbl Text_InitWindowAndPrintText\n"
"\tadd r7, sp, 0x34\n"
"\tadds r0, r7, 0\n"
"\tldr r1, [sp, 0x6C]\n"
@@ -2910,7 +2910,7 @@ static void sub_8049ED4(u8 a0)
"\tlsrs r4, 24\n"
"\tstr r4, [sp]\n"
"\tadds r3, r5, 0\n"
- "\tbl sub_8003460\n"
+ "\tbl Text_InitWindowAndPrintText\n"
"\tldr r0, _0804A22C @ =gUnknown_03004824\n"
"\tldr r1, [r0]\n"
"\tadds r0, r1, 0x4\n"
@@ -2921,7 +2921,7 @@ static void sub_8049ED4(u8 a0)
"\tstr r4, [sp]\n"
"\tadds r1, r7, 0\n"
"\tadds r3, r5, 0\n"
- "\tbl sub_8003460\n"
+ "\tbl Text_InitWindowAndPrintText\n"
"\tldr r2, _0804A22C @ =gUnknown_03004824\n"
"\tldr r1, [r2]\n"
"\tb _0804A28A\n"
@@ -3010,7 +3010,7 @@ u8 sub_804A2B4(u8 *a0, u8 whichParty, u8 whichPokemon)
GetMonGender(&gEnemyParty[whichPokemon]);
GetMonData(&gEnemyParty[whichPokemon], MON_DATA_LEVEL);
}
- return GetStringWidthGivenWindowConfig(&gWindowConfig_81E7294, a0);
+ return Text_GetStringWidthFromWindowTemplate(&gWindowConfig_81E7294, a0);
}
#ifdef NONMATCHING
@@ -3067,8 +3067,8 @@ static void sub_804A41C(u8 whichParty)
GetMonData(pokemon, MON_DATA_NICKNAME, nickname);
StringCopy10(string + 6, nickname);
GetMonGender(pokemon);
- string[5] = (50 - GetStringWidthGivenWindowConfig(&gWindowConfig_81E7294, string + 6)) / 2;
- sub_8003460(&gUnknown_03004824->window, string, gUnknown_03004824->unk_007a + 22 * 6 * whichParty + 22 * i, gTradeMonSpriteCoords[i + 6 * whichParty][0], gTradeMonSpriteCoords[i + 6 * whichParty][1]);
+ string[5] = (50 - Text_GetStringWidthFromWindowTemplate(&gWindowConfig_81E7294, string + 6)) / 2;
+ Text_InitWindowAndPrintText(&gUnknown_03004824->window, string, gUnknown_03004824->unk_007a + 22 * 6 * whichParty + 22 * i, gTradeMonSpriteCoords[i + 6 * whichParty][0], gTradeMonSpriteCoords[i + 6 * whichParty][1]);
}
}
#else
@@ -3142,7 +3142,7 @@ static void sub_804A41C(u8 whichParty)
"\tmov r1, sp\n"
"\tadds r1, 0x22\n"
"\tldr r0, _0804A518 @ =gWindowConfig_81E7294\n"
- "\tbl GetStringWidthGivenWindowConfig\n"
+ "\tbl Text_GetStringWidthFromWindowTemplate\n"
"\tlsls r0, 24\n"
"\tlsrs r0, 24\n"
"\tmovs r1, 0x32\n"
@@ -3177,7 +3177,7 @@ static void sub_804A41C(u8 whichParty)
"\tldrb r1, [r1]\n"
"\tstr r1, [sp]\n"
"\tmov r1, r8\n"
- "\tbl sub_8003460\n"
+ "\tbl Text_InitWindowAndPrintText\n"
"\tadds r0, r6, 0x1\n"
"\tlsls r0, 24\n"
"\tlsrs r6, r0, 24\n"
@@ -3413,18 +3413,18 @@ static void sub_804A96C_alt(struct UnkStructD *arg0, u8 left, u8 top, const u16
static void sub_804A9F4(u8 unused)
{
- MenuZeroFillScreen();
+ Menu_EraseScreen();
}
static void sub_804AA00(u8 unused)
{
- MenuZeroFillScreen();
+ Menu_EraseScreen();
}
static void sub_804AA0C(u8 a0)
{
- DrawTextWindow(&gUnknown_03004824->window, gTradeMessageWindowRects[a0][0], gTradeMessageWindowRects[a0][1], gTradeMessageWindowRects[a0][2], gTradeMessageWindowRects[a0][3]);
- sub_8003460(&gUnknown_03004824->window, gUnknown_0820C2F0[a0], 0x180 + gUnknown_03004824->unk_007a, gTradeMessageWindowRects[a0][0] + 1, gTradeMessageWindowRects[a0][1] + 1);
+ TextWindow_DrawStdFrame(&gUnknown_03004824->window, gTradeMessageWindowRects[a0][0], gTradeMessageWindowRects[a0][1], gTradeMessageWindowRects[a0][2], gTradeMessageWindowRects[a0][3]);
+ Text_InitWindowAndPrintText(&gUnknown_03004824->window, gUnknown_0820C2F0[a0], 0x180 + gUnknown_03004824->unk_007a, gTradeMessageWindowRects[a0][0] + 1, gTradeMessageWindowRects[a0][1] + 1);
}
static void sub_804AA88(void)
@@ -3798,7 +3798,7 @@ static void sub_804AF84(void)
gSaveBlock1.giftRibbons[i] = gUnknown_03004824->unk_00b5[i];
}
-static void sub_804AFB8(const struct WindowConfig *windowConfig, u8 *dest, const u8 *src, u8 size)
+static void sub_804AFB8(const struct WindowTemplate *windowConfig, u8 *dest, const u8 *src, u8 size)
{
u8 i;
u8 *tileBuffer;
@@ -4029,10 +4029,10 @@ static void sub_804B41C(void)
SetVBlankCallback(sub_804B210);
sub_804B228();
SetUpWindowConfig(&gWindowConfig_81E6F84);
- InitWindowFromConfig(&gUnknown_03004828->window, &gWindowConfig_81E6F84);
- gUnknown_03004828->textWindowBaseTileNum = SetTextWindowBaseTileNum(2);
- LoadTextWindowGraphics(&gUnknown_03004828->window);
- MenuZeroFillScreen();
+ Text_InitWindowWithTemplate(&gUnknown_03004828->window, &gWindowConfig_81E6F84);
+ gUnknown_03004828->textWindowBaseTileNum = TextWindow_SetBaseTileNum(2);
+ TextWindow_LoadStdFrameGraphics(&gUnknown_03004828->window);
+ Menu_EraseScreen();
gLinkType = 0x1144;
gMain.state ++;
LZDecompressVram(gUnknown_08D00000, (void *)VRAM);
@@ -4188,16 +4188,16 @@ static __attribute__((naked)) void sub_804B41C(void)
"\tldr r0, [r6]\n"
"\tadds r0, 0x4\n"
"\tadds r1, r4, 0\n"
- "\tbl InitWindowFromConfig\n"
+ "\tbl Text_InitWindowWithTemplate\n"
"\tmovs r0, 0x2\n"
- "\tbl SetTextWindowBaseTileNum\n"
+ "\tbl TextWindow_SetBaseTileNum\n"
"\tldr r1, [r6]\n"
"\tadds r1, 0x34\n"
"\tstrb r0, [r1]\n"
"\tldr r0, [r6]\n"
"\tadds r0, 0x4\n"
- "\tbl LoadTextWindowGraphics\n"
- "\tbl MenuZeroFillScreen\n"
+ "\tbl TextWindow_LoadStdFrameGraphics\n"
+ "\tbl Menu_EraseScreen\n"
"\tldr r1, _0804B580 @ =gLinkType\n"
"\tldr r4, _0804B584 @ =0x00001144\n"
"\tadds r0, r4, 0\n"
@@ -4532,10 +4532,10 @@ static void sub_804B790(void)
SetVBlankCallback(sub_804B210);
sub_804B228();
SetUpWindowConfig(&gWindowConfig_81E717C);
- InitWindowFromConfig(&gUnknown_03004828->window, &gWindowConfig_81E717C);
- gUnknown_03004828->textWindowBaseTileNum = SetTextWindowBaseTileNum(2);
- LoadTextWindowGraphics(&gUnknown_03004828->window);
- MenuZeroFillScreen();
+ Text_InitWindowWithTemplate(&gUnknown_03004828->window, &gWindowConfig_81E717C);
+ gUnknown_03004828->textWindowBaseTileNum = TextWindow_SetBaseTileNum(2);
+ TextWindow_LoadStdFrameGraphics(&gUnknown_03004828->window);
+ Menu_EraseScreen();
gLinkType = 0x1144;
gUnknown_03004828->isLinkTrade = FALSE;
gUnknown_03004828->unk_00b6 = 0;
@@ -4733,7 +4733,7 @@ static void sub_804BBE8(u8 a0)
for (i = 0; i < 0x280; i ++)
buffer[i] |= 0x7000;
DmaCopy16Defvars(3, gSharedMem, BG_SCREEN_ADDR(5), 0x500);
- MenuZeroFillWindowRect(2, 15, 27, 18);
+ Menu_EraseWindowRect(2, 15, 27, 18);
break;
case 6:
REG_DISPCNT = DISPCNT_MODE_1 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG2_ON | DISPCNT_OBJ_ON;
@@ -4843,7 +4843,7 @@ static bool8 sub_804C29C(void)
case 10:
StringExpandPlaceholders(gStringVar4, gTradeText_WillBeSent);
- sub_8003460(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindowAndPrintText(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
gUnknown_03004828->unk_00c4 = 11;
gUnknown_03004828->unk_00c0 = 0;
break;
@@ -4854,11 +4854,11 @@ static bool8 sub_804C29C(void)
gUnknown_03004828->unk_00c4 ++;
ZeroFillWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19);
StringExpandPlaceholders(gStringVar4, gTradeText_ByeBye);
- sub_8003460(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindowAndPrintText(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
}
break;
case 12:
- if (gSprites[gUnknown_03004828->unk_0102].callback == SpriteCallbackDummy && sub_80035AC(&gUnknown_03004828->window) == TRUE)
+ if (gSprites[gUnknown_03004828->unk_0102].callback == SpriteCallbackDummy && Text_UpdateWindow(&gUnknown_03004828->window) == TRUE)
{
gUnknown_03004828->unk_0103 = CreateSprite(&gSpriteTemplate_821595C, 0x78, 0x20, 0);
gSprites[gUnknown_03004828->unk_0103].callback = sub_804D738;
@@ -5201,7 +5201,7 @@ static bool8 sub_804C29C(void)
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);
StringExpandPlaceholders(gStringVar4, gTradeText_SentOverPoke);
- sub_8003460(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindowAndPrintText(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
gUnknown_03004828->unk_00c4 ++;
gUnknown_03004828->unk_00c0 = 0;
break;
@@ -5215,7 +5215,7 @@ static bool8 sub_804C29C(void)
gUnknown_03004828->unk_00c4 ++;
ZeroFillWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19);
StringExpandPlaceholders(gStringVar4, gTradeText_TakeGoodCare);
- sub_8003460(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindowAndPrintText(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
gUnknown_03004828->unk_00c0 = 0;
}
break;
@@ -5538,7 +5538,7 @@ static void sub_804DC88(void)
gMain.state ++;
ZeroFillWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19);
StringExpandPlaceholders(gStringVar4, gOtherText_LinkStandby2);
- sub_8003460(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindowAndPrintText(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
break;
case 1:
sub_80084A4();
@@ -5565,7 +5565,7 @@ static void sub_804DC88(void)
case 2:
gMain.state = 50;
ZeroFillWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19);
- sub_8003460(&gUnknown_03004828->window, gSystemText_Saving, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindowAndPrintText(&gUnknown_03004828->window, gSystemText_Saving, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
break;
case 50:
SetSecretBase2Field_9_AndHideBG();
diff --git a/src/engine/trainer_card.c b/src/engine/trainer_card.c
index ffa4cbd08..da9dd7179 100644
--- a/src/engine/trainer_card.c
+++ b/src/engine/trainer_card.c
@@ -700,7 +700,7 @@ static void sub_80939DC(u8 taskId)
task->data[TD_0] ^= TRUE;
}
TrainerCard_Front_PrintPlayTime(buffer, task->data[TD_0]);
- MenuPrint(buffer, 10, 12);
+ Menu_PrintText(buffer, 10, 12);
}
static void sub_8093A28(void)
@@ -1130,7 +1130,7 @@ static void sub_8093DAC(void)
static void sub_8093DC8(void)
{
- MenuZeroFillScreen();
+ Menu_EraseScreen();
sub_80940E4();
sub_8093F14();
sub_8093F80();
@@ -1141,7 +1141,7 @@ static void sub_8093DC8(void)
static void sub_8093DEC(void)
{
- MenuZeroFillScreen();
+ Menu_EraseScreen();
sub_80940E4();
sub_8093F48();
sub_8094188();
@@ -1322,7 +1322,7 @@ static void sub_8094140(void)
buffer = gStringVar1;
StringCopy(buffer, ewram0_2.var_64.playerName);
ConvertInternationalString(buffer, ewram0_2.language);
- MenuPrint(buffer, 7, 5);
+ Menu_PrintText(buffer, 7, 5);
TrainerCard_Front_PrintTrainerID();
TrainerCard_Front_PrintMoney();
@@ -1355,7 +1355,7 @@ static void TrainerCard_Front_PrintTrainerID(void)
u8 buffer[8];
ConvertIntToDecimalStringN(buffer, ewram0_2.var_64.trainerId, STR_CONV_MODE_LEADING_ZEROS, 5);
- MenuPrint(buffer, 20, 2);
+ Menu_PrintText(buffer, 20, 2);
}
static void TrainerCard_Front_PrintMoney(void)
@@ -1406,14 +1406,14 @@ static void sub_809429C(void)
str[0] = 00;
str++;
str = StringCopy(str, ewram0_2.var_20[1]);
- MenuPrint(gStringVar1, 2, 14);
+ Menu_PrintText(gStringVar1, 2, 14);
str = gStringVar1;
str = StringCopy(str, ewram0_2.var_20[2]);
str[0] = 00;
str++;
str = StringCopy(str, ewram0_2.var_20[3]);
- MenuPrint(gStringVar1, 2, 16);
+ Menu_PrintText(gStringVar1, 2, 16);
}
}
@@ -1437,7 +1437,7 @@ static void TrainerCard_Back_PrintName(void)
static void TrainerCard_Back_PrintHallOfFameTime_Label(void)
{
if (ewram0_2.var_8 != 0)
- MenuPrint(gOtherText_FirstHOF, 3, 5);
+ Menu_PrintText(gOtherText_FirstHOF, 3, 5);
}
static void TrainerCard_Back_PrintHallOfFameTime(void)
@@ -1459,7 +1459,7 @@ static void TrainerCard_Back_PrintHallOfFameTime(void)
static void TrainerCard_Back_PrintLinkBattlesLabel(void)
{
if (ewram0_2.var_9 != 0)
- MenuPrint(gOtherText_LinkCableBattles, 3, 7);
+ Menu_PrintText(gOtherText_LinkCableBattles, 3, 7);
}
static void TrainerCard_Back_PrintLinkBattles(void)
@@ -1479,7 +1479,7 @@ static void TrainerCard_Back_PrintLinkBattles(void)
static void TrainerCard_Back_PrintBattleTower_Label(void)
{
if (ewram0_2.var_a != 0)
- MenuPrint(gOtherText_BattleTowerWinRecord, 3, 15);
+ Menu_PrintText(gOtherText_BattleTowerWinRecord, 3, 15);
}
static void TrainerCard_Back_PrintBattleTower(void)
@@ -1499,7 +1499,7 @@ static void TrainerCard_Back_PrintBattleTower(void)
static void TrainerCard_Back_PrintLinkContests_Label(void)
{
if (ewram0_2.var_b != 0)
- MenuPrint(gOtherText_ContestRecord, 3, 13);
+ Menu_PrintText(gOtherText_ContestRecord, 3, 13);
}
static void TrainerCard_Back_PrintLinkContests(void)
@@ -1516,7 +1516,7 @@ static void TrainerCard_Back_PrintLinkContests(void)
static void TrainerCard_Back_PrintLinkPokeblocks_Label(void)
{
if (ewram0_2.var_c != 0)
- MenuPrint(gOtherText_MixingRecord, 3, 11);
+ Menu_PrintText(gOtherText_MixingRecord, 3, 11);
}
static void TrainerCard_Back_PrintLinkPokeblocks(void)
@@ -1533,7 +1533,7 @@ static void TrainerCard_Back_PrintLinkPokeblocks(void)
static void TrainerCard_Back_PrintPokemonTrades_Label(void)
{
if (ewram0_2.var_d != 0)
- MenuPrint(gOtherText_TradeRecord, 3, 9);
+ Menu_PrintText(gOtherText_TradeRecord, 3, 9);
}
static void TrainerCard_Back_PrintPokemonTrades(void)
@@ -1553,5 +1553,5 @@ void unref_sub_8094588(u16 left, u16 top)
if (gSaveBlock2.playerGender == FEMALE)
text = gOtherText_Girl;
- MenuPrint(text, left, top);
+ Menu_PrintText(text, left, top);
}
diff --git a/src/field/berry_tag_screen.c b/src/field/berry_tag_screen.c
index 960a163c1..f57face11 100644
--- a/src/field/berry_tag_screen.c
+++ b/src/field/berry_tag_screen.c
@@ -280,18 +280,18 @@ static void sub_81464E4(void)
berryInfo = GetBerryInfo(gSpecialVar_ItemId + OFFSET_7B + 1);
ConvertIntToDecimalStringN(gStringVar1, gSpecialVar_ItemId - FIRST_BERRY + 1, STR_CONV_MODE_LEADING_ZEROS, 2);
- MenuPrint(gStringVar1, 12, 4);
+ Menu_PrintText(gStringVar1, 12, 4);
#if ENGLISH
- MenuPrint(berryInfo->name, 14, 4);
+ Menu_PrintText(berryInfo->name, 14, 4);
#elif GERMAN
StringCopy(buffer, berryInfo->name);
StringAppend(buffer, gOtherText_Berry2);
- MenuPrint(buffer, 14, 4);
+ Menu_PrintText(buffer, 14, 4);
#endif
- MenuPrint(berryInfo->description1, 4, 14);
- MenuPrint(berryInfo->description2, 4, 16);
+ Menu_PrintText(berryInfo->description1, 4, 14);
+ Menu_PrintText(berryInfo->description2, 4, 16);
#ifdef UNITS_IMPERIAL
size = (berryInfo->size * 1000) / 254;
@@ -301,7 +301,7 @@ static void sub_81464E4(void)
sizeMajor = size / 100;
#endif
- MenuPrint(gOtherText_Size, 11, 7);
+ Menu_PrintText(gOtherText_Size, 11, 7);
if (berryInfo->size != 0)
{
#ifdef UNITS_IMPERIAL
@@ -311,18 +311,18 @@ static void sub_81464E4(void)
ConvertIntToDecimalStringN(gStringVar1, berryInfo->size / 10, STR_CONV_MODE_LEFT_ALIGN, 2);
ConvertIntToDecimalStringN(gStringVar2, berryInfo->size % 10, STR_CONV_MODE_LEFT_ALIGN, 2);
#endif
- MenuPrint(gContestStatsText_Unknown1, 16, 7);
+ Menu_PrintText(gContestStatsText_Unknown1, 16, 7);
}
else
{
- MenuPrint(gOtherText_ThreeQuestions2, 16, 7);
+ Menu_PrintText(gOtherText_ThreeQuestions2, 16, 7);
}
- MenuPrint(gOtherText_Firm, 11, 9);
+ Menu_PrintText(gOtherText_Firm, 11, 9);
if (berryInfo->firmness != 0)
- MenuPrint(gUnknown_0841192C[berryInfo->firmness - 1], 16, 9);
+ Menu_PrintText(gUnknown_0841192C[berryInfo->firmness - 1], 16, 9);
else
- MenuPrint(gOtherText_ThreeQuestions2, 16, 9);
+ Menu_PrintText(gOtherText_ThreeQuestions2, 16, 9);
}
static void sub_8146600(u8 berry)
@@ -445,7 +445,7 @@ static void sub_8146810(s8 berry)
static void sub_81468BC(void)
{
- MenuZeroFillWindowRect(0, 4, 29, 19);
+ Menu_EraseWindowRect(0, 4, 29, 19);
sub_81464E4();
// center of berry sprite
diff --git a/src/field/braille_puzzles.c b/src/field/braille_puzzles.c
index 0d304714d..f11fb5fb3 100644
--- a/src/field/braille_puzzles.c
+++ b/src/field/braille_puzzles.c
@@ -161,7 +161,7 @@ void Task_BrailleWait(u8 taskId)
case 1:
if (BrailleWait_CheckButtonPress() != FALSE)
{
- MenuZeroFillScreen();
+ Menu_EraseScreen();
PlaySE(SE_SELECT);
data[0] = 2;
}
@@ -170,7 +170,7 @@ void Task_BrailleWait(u8 taskId)
data[1] = data[1] - 1;
if (data[1] == 0)
{
- MenuZeroFillScreen();
+ Menu_EraseScreen();
data[0] = 3;
data[1] = 30;
}
diff --git a/src/field/choose_party.c b/src/field/choose_party.c
index d278eda4a..6a9c23c66 100644
--- a/src/field/choose_party.c
+++ b/src/field/choose_party.c
@@ -318,19 +318,19 @@ static void sub_812238C(u8 taskId)
{
if (gMain.newAndRepeatedKeys & 0x40)
{
- if (GetMenuCursorPos() != 0)
+ if (Menu_GetCursorPos() != 0)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(-1);
+ Menu_MoveCursor(-1);
}
return;
}
if (gMain.newAndRepeatedKeys & 0x80)
{
- if (GetMenuCursorPos() != 3)
+ if (Menu_GetCursorPos() != 3)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(1);
+ Menu_MoveCursor(1);
}
return;
}
@@ -343,7 +343,7 @@ static void sub_812238C(u8 taskId)
gTasks[taskId].data[4],
sBattleTowerEntryMenu,
sBattleTowerEntryMenuItems,
- GetMenuCursorPos());
+ Menu_GetCursorPos());
popupMenuFunc(taskId);
return;
}
@@ -461,7 +461,7 @@ static void BattleTowerEntryMenuCallback_Enter(u8 taskId)
}
}
PlaySE(SE_HAZURE);
- MenuZeroFillWindowRect(20, 10, 29, 19);
+ Menu_EraseWindowRect(20, 10, 29, 19);
HandleDestroyMenuCursors();
sub_806D5A4();
sub_806E834(gOtherText_NoMoreThreePoke, 1);
@@ -475,7 +475,7 @@ static void sub_8122728(u8 taskId)
if ((gMain.newKeys & A_BUTTON) || (gMain.newKeys & B_BUTTON))
{
- MenuZeroFillWindowRect(0, 14, 29, 19);
+ Menu_EraseWindowRect(0, 14, 29, 19);
HandleDestroyMenuCursors();
BattleTowerEntryMenuCallback_Exit(taskId);
}
@@ -515,7 +515,7 @@ static void BattleTowerEntryMenuCallback_NoEntry(u8 taskId)
static void sub_81227FC(u8 taskId)
{
- MenuZeroFillWindowRect(20, 10, 29, 19);
+ Menu_EraseWindowRect(20, 10, 29, 19);
HandleDestroyMenuCursors();
PrintPartyMenuPromptText(0, 0);
gTasks[taskId].func = HandleBattleTowerPartyMenu;
@@ -806,19 +806,19 @@ static void Task_DaycareStorageMenu8122EAC(u8 taskId)
{
if (gMain.newAndRepeatedKeys & 0x40)
{
- if (GetMenuCursorPos() != 0)
+ if (Menu_GetCursorPos() != 0)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(-1);
+ Menu_MoveCursor(-1);
}
return;
}
if (gMain.newAndRepeatedKeys & 0x80)
{
- if (GetMenuCursorPos() != 3)
+ if (Menu_GetCursorPos() != 3)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(1);
+ Menu_MoveCursor(1);
}
return;
}
@@ -831,7 +831,7 @@ static void Task_DaycareStorageMenu8122EAC(u8 taskId)
gTasks[taskId].data[4],
sDaycareStorageMenus,
sDaycareStorageMenuItems,
- GetMenuCursorPos());
+ Menu_GetCursorPos());
popupMenuFunc(taskId);
return;
}
@@ -896,7 +896,7 @@ static void DaycareStorageMenuCallback_Summary(u8 taskId)
static void DaycareStorageMenuCallback_Exit(u8 taskId)
{
PlaySE(SE_SELECT);
- MenuZeroFillWindowRect(20, 10, 29, 19);
+ Menu_EraseWindowRect(20, 10, 29, 19);
HandleDestroyMenuCursors();
PrintPartyMenuPromptText(15, 0);
gTasks[taskId].func = HandleDaycarePartyMenu;
diff --git a/src/field/coins.c b/src/field/coins.c
index 91a4b508d..2c217e635 100644
--- a/src/field/coins.c
+++ b/src/field/coins.c
@@ -13,13 +13,13 @@ void UpdateCoinsWindow(s32 coins, u8 x, u8 y)
void ShowCoinsWindow(u32 coins, u8 x, u8 y)
{
- MenuDrawTextWindow(x, y, x + 9, y + 3);
+ Menu_DrawStdWindowFrame(x, y, x + 9, y + 3);
UpdateCoinsWindow(coins, x, y);
}
void HideCoinsWindow(u8 x, u8 y)
{
- MenuZeroFillWindowRect(x, y, x + 9, y + 3);
+ Menu_EraseWindowRect(x, y, x + 9, y + 3);
}
void PrintCoins(s32 coins, u8 b, u8 x, u8 y)
@@ -46,7 +46,7 @@ void PrintCoins(s32 coins, u8 b, u8 x, u8 y)
ptr[2] = (b - StringLength(string)) * 6;
ptr += 3;
StringCopy(ptr, string);
- MenuPrint(gOtherText_Coins2, x, y);
+ Menu_PrintText(gOtherText_Coins2, x, y);
}
u16 GetCoins(void)
diff --git a/src/field/daycare.c b/src/field/daycare.c
index c28bc65ca..7814a3b24 100644
--- a/src/field/daycare.c
+++ b/src/field/daycare.c
@@ -1741,7 +1741,7 @@ static void HandleDaycareLevelMenuInput(u8 taskId)
if (gTasks[taskId].data[0] != 0)
{
gTasks[taskId].data[0] --;
- MoveMenuCursor(-1);
+ Menu_MoveCursor(-1);
PlaySE(SE_SELECT);
}
}
@@ -1750,7 +1750,7 @@ static void HandleDaycareLevelMenuInput(u8 taskId)
if (gTasks[taskId].data[0] != 2)
{
gTasks[taskId].data[0]++;
- MoveMenuCursor(+1);
+ Menu_MoveCursor(+1);
PlaySE(SE_SELECT);
}
}
@@ -1760,7 +1760,7 @@ static void HandleDaycareLevelMenuInput(u8 taskId)
PlaySE(SE_SELECT);
gLastFieldPokeMenuOpened = gSpecialVar_Result = gTasks[taskId].data[0];
DestroyTask(taskId);
- MenuZeroFillWindowRect(15, 6, 29, 13);
+ Menu_EraseWindowRect(15, 6, 29, 13);
EnableBothScriptContexts();
}
else if (gMain.newKeys & B_BUTTON)
@@ -1768,7 +1768,7 @@ static void HandleDaycareLevelMenuInput(u8 taskId)
HandleDestroyMenuCursors();
gLastFieldPokeMenuOpened = gSpecialVar_Result = 2;
DestroyTask(taskId);
- MenuZeroFillWindowRect(15, 6, 29, 13);
+ Menu_EraseWindowRect(15, 6, 29, 13);
EnableBothScriptContexts();
}
}
@@ -1776,9 +1776,9 @@ static void HandleDaycareLevelMenuInput(u8 taskId)
void ShowDaycareLevelMenu(void)
{
u8 buffer[100];
- MenuDrawTextWindow(15, 6, 29, 13);
+ Menu_DrawStdWindowFrame(15, 6, 29, 13);
GetDaycareLevelMenuText(&gSaveBlock1.daycare, buffer);
- MenuPrint(buffer, 16, 7);
+ Menu_PrintText(buffer, 16, 7);
GetDaycareLevelMenuLevelText(&gSaveBlock1.daycare, buffer);
MenuPrint_PixelCoords(buffer, 0xce, 0x38, TRUE);
InitMenu(0, 16, 7, 3, 0, 13);
diff --git a/src/field/decoration.c b/src/field/decoration.c
index 87a9d8028..a91b2e37b 100644
--- a/src/field/decoration.c
+++ b/src/field/decoration.c
@@ -1433,7 +1433,7 @@ extern u8 gUnknown_0815F399[];
void sub_80FE1DC(void)
{
sub_80FE2B4();
- MenuDrawTextWindow(0, 0, 10, 9);
+ Menu_DrawStdWindowFrame(0, 0, 10, 9);
PrintMenuItems(1, 1, 4, (const struct MenuAction *)gUnknown_083EC604);
InitMenu(0, 1, 1, 4, gUnknown_020388D4, 9);
}
@@ -1487,13 +1487,13 @@ void Task_DecorationPCProcessMenuInput(u8 taskId)
if (gMain.newKeys & DPAD_UP)
{
PlaySE(SE_SELECT);
- gUnknown_020388D4 = MoveMenuCursor(-1);
+ gUnknown_020388D4 = Menu_MoveCursor(-1);
sub_80FE394();
}
if (gMain.newKeys & DPAD_DOWN)
{
PlaySE(SE_SELECT);
- gUnknown_020388D4 = MoveMenuCursor(1);
+ gUnknown_020388D4 = Menu_MoveCursor(1);
sub_80FE394();
}
if (gMain.newKeys & A_BUTTON)
@@ -1510,15 +1510,15 @@ void Task_DecorationPCProcessMenuInput(u8 taskId)
void sub_80FE394(void)
{
- MenuFillWindowRectWithBlankTile(2, 15, 27, 18);
- MenuPrint(gUnknown_083EC624[gUnknown_020388D4], 2, 15);
+ Menu_BlankWindowRect(2, 15, 27, 18);
+ Menu_PrintText(gUnknown_083EC624[gUnknown_020388D4], 2, 15);
}
void gpu_pal_decompress_alloc_tag_and_upload(u8 taskId)
{
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(0, 0, 10, 9);
- MenuFillWindowRectWithBlankTile(2, 15, 27, 18);
+ Menu_EraseWindowRect(0, 0, 10, 9);
+ Menu_BlankWindowRect(2, 15, 27, 18);
FreeSpritePaletteByTag(6);
if (ewram_1f000.isPlayerRoom == 0)
{
@@ -1561,13 +1561,13 @@ void sub_80FE470(u8 decoCat, u8 left, u8 top, u8 palIdx) // PrintDecorationCateg
strptr[1] = 5;
strptr[2] = v0;
strptr[3] = EOS;
- MenuPrint(gStringVar4, left, top);
+ Menu_PrintText(gStringVar4, left, top);
}
void sub_80FE528(u8 taskId) // PrintDecorationCategorySelectionMenuStrings
{
u8 decoCat;
- MenuDrawTextWindow(0, 0, 14, 19);
+ Menu_DrawStdWindowFrame(0, 0, 14, 19);
for (decoCat=0; decoCat<8; decoCat++)
{
if (ewram_1f000.isPlayerRoom == 1 && gTasks[taskId].data[11] == 0 && decoCat != DECORCAT_DOLL && decoCat != DECORCAT_CUSHION)
@@ -1578,13 +1578,13 @@ void sub_80FE528(u8 taskId) // PrintDecorationCategorySelectionMenuStrings
sub_80FE470(decoCat, 1, 2 * decoCat + 1, 255); // Unselectable
}
}
- MenuPrint(gUnknownText_Exit, 1, 17);
+ Menu_PrintText(gUnknownText_Exit, 1, 17);
}
void sub_80FE5AC(u8 taskId)
{
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
sub_80FE528(taskId);
InitMenu(0, 1, 1, 9, gUnknown_020388F6, 13);
gTasks[taskId].func = sub_80FE604;
@@ -1597,15 +1597,15 @@ void sub_80FE604(u8 taskId)
if (gMain.newAndRepeatedKeys & DPAD_UP)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(-1);
+ Menu_MoveCursor(-1);
} else if (gMain.newAndRepeatedKeys & DPAD_DOWN)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(1);
+ Menu_MoveCursor(1);
} else if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
- gUnknown_020388F6 = GetMenuCursorPos();
+ gUnknown_020388F6 = Menu_GetCursorPos();
if (gUnknown_020388F6 != 8)
{
gUnknown_020388D5 = sub_8134194(gUnknown_020388F6);
@@ -1621,7 +1621,7 @@ void sub_80FE604(u8 taskId)
} else
{
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(0, 0, 14, 19);
+ Menu_EraseWindowRect(0, 0, 14, 19);
DisplayItemMessageOnField(taskId, gSecretBaseText_NoDecors, sub_80FE418, 0);
}
} else
@@ -1650,11 +1650,11 @@ void sub_80FE728(u8 taskId)
void sub_80FE758(u8 taskId)
{
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(0, 0, 14, 19);
+ Menu_EraseWindowRect(0, 0, 14, 19);
if (gTasks[taskId].data[11] != 2)
{
sub_80FE1DC();
- MenuDisplayMessageBox();
+ Menu_DisplayDialogueFrame();
sub_80FE394();
gTasks[taskId].func = Task_DecorationPCProcessMenuInput;
} else
@@ -1678,17 +1678,17 @@ void sub_80FE7D4(u8 *dest, u8 decClass)
void sub_80FE7EC(u8 taskId)
{
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
sub_80FEC94(taskId);
sub_80FECB8(gUnknown_020388F6);
#if ENGLISH
- MenuDrawTextWindow(15, 12, 29, 19);
+ Menu_DrawStdWindowFrame(15, 12, 29, 19);
#elif GERMAN
if ((gUnknown_020388F2 + gUnknown_020388F4) != gUnknown_020388D5)
{
- MenuDrawTextWindow(15, 12, 29, 19);
+ Menu_DrawStdWindowFrame(15, 12, 29, 19);
}
#endif
@@ -1710,7 +1710,7 @@ void sub_80FE894(u8 taskId /*r8*/, s8 cursorVector /*r5*/, s8 bgVector /*r7*/)
PlaySE(SE_SELECT);
if (cursorVector != 0)
{
- gUnknown_020388F2 = MoveMenuCursor(cursorVector);
+ gUnknown_020388F2 = Menu_MoveCursor(cursorVector);
}
if (bgVector != 0)
{
@@ -1722,12 +1722,12 @@ void sub_80FE894(u8 taskId /*r8*/, s8 cursorVector /*r5*/, s8 bgVector /*r7*/)
{
if (v0)
{
- MenuDrawTextWindow(15, 12, 29, 19);
+ Menu_DrawStdWindowFrame(15, 12, 29, 19);
}
sub_80FECE0(gUnknown_020388F2 + gUnknown_020388F4);
} else
{
- MenuZeroFillWindowRect(15, 12, 29, 19);
+ Menu_EraseWindowRect(15, 12, 29, 19);
}
}
@@ -1839,13 +1839,13 @@ void sub_80FEABC(u8 taskId, u8 dummy1)
void sub_80FEC94(u8 taskId)
{
- MenuDrawTextWindow(0, 0, 14, 19);
+ Menu_DrawStdWindowFrame(0, 0, 14, 19);
sub_80FEABC(taskId, 0);
}
void sub_80FECB8(u8 decoCat)
{
- MenuDrawTextWindow(15, 0, 29, 3);
+ Menu_DrawStdWindowFrame(15, 0, 29, 3);
sub_80FE470(decoCat, 16, 1, 0xff);
}
@@ -1902,8 +1902,8 @@ _080FED26:\n\
void sub_80FED1C(void)
{
- MenuZeroFillWindowRect(15, 0, 29, 3);
- MenuZeroFillWindowRect(15, 12, 29, 19);
+ Menu_EraseWindowRect(15, 0, 29, 3);
+ Menu_EraseWindowRect(15, 12, 29, 19);
}
void sub_80FED3C(u8 taskId)
@@ -2006,7 +2006,7 @@ void sub_80FEF74(void)
DestroyVerticalScrollIndicator(0);
DestroyVerticalScrollIndicator(1);
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(0, 0, 14, 19);
+ Menu_EraseWindowRect(0, 0, 14, 19);
}
bool8 sub_80FEFA4(void)
@@ -2036,7 +2036,7 @@ void sub_80FEFF4(u8 taskId)
void sub_80FF034(u8 taskId)
{
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(0, 0, 14, 19);
+ Menu_EraseWindowRect(0, 0, 14, 19);
sub_80FE5AC(taskId);
}
@@ -3128,7 +3128,7 @@ void sub_81000A0(u8 taskId)
void sub_81000C4(u8 taskId)
{
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
sub_8100174(taskId);
if (gDecorations[gUnknown_020388D0[gUnknown_020388F5]].permission != DECORPERM_SOLID_MAT)
{
@@ -3186,7 +3186,7 @@ void sub_8100248(u8 taskId)
void sub_810026C(u8 taskId)
{
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
sub_810028C(taskId);
}
@@ -3341,7 +3341,7 @@ void sub_8100494(u8 taskId)
void sub_810065C(u8 taskId)
{
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
gSprites[gUnknown_020391A8].data[7] = 0;
gTasks[taskId].data[10] = 0;
gTasks[taskId].func = sub_8100494;
@@ -3723,7 +3723,7 @@ void sub_8100C88(u8 taskId)
{
DrawWholeMapView();
ScriptContext1_SetupScript(gUnknown_081A2F8A);
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
gTasks[taskId].data[2] = 2;
}
break;
@@ -3760,7 +3760,7 @@ bool8 sub_8100D38(u8 taskId)
void SetUpPuttingAwayDecorationPlayerAvatar(void)
{
player_get_direction_lower_nybble();
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
gUnknown_020391A8 = gSprites[gUnknown_03004880.unk4].data[0];
sub_81016C8();
gUnknown_03004880.unk4 = CreateSprite(&gSpriteTemplate_83ECA88, 0x78, 0x50, 0);
@@ -3810,7 +3810,7 @@ void sub_8100E70(u8 taskId)
void sub_8100EEC(u8 taskId)
{
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
gSprites[gUnknown_020391A8].data[7] = 0;
gSprites[gUnknown_020391A8].invisible = 0;
gSprites[gUnknown_020391A8].callback = sub_8101698;
@@ -4150,7 +4150,7 @@ void sub_810156C(u8 taskId)
void sub_8101590(u8 taskId)
{
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
sub_81015B0(taskId);
}
@@ -4192,7 +4192,7 @@ void sub_8101648(u8 taskId)
void sub_8101678(void)
{
pal_fill_black();
- MenuDisplayMessageBox();
+ Menu_DisplayDialogueFrame();
sub_80FE220();
CreateTask(sub_8101648, 8);
}
@@ -4274,7 +4274,7 @@ void sub_8101824(u8 taskId)
void sub_8101848(u8 taskId)
{
- MenuZeroFillWindowRect(20, 8, 26, 14);
+ Menu_EraseWindowRect(20, 8, 26, 14);
sub_8109A30(gUnknown_020388D0[gUnknown_020388F5]);
gUnknown_020388D0[gUnknown_020388F5] = DECOR_NONE;
sub_80FF098(taskId);
diff --git a/src/field/diploma.c b/src/field/diploma.c
index 27601404c..b9cdb65df 100644
--- a/src/field/diploma.c
+++ b/src/field/diploma.c
@@ -135,5 +135,5 @@ static void DisplayDiplomaText(void)
REG_BG3HOFS = 0;
StringCopy(gStringVar1, gOtherText_HoennDex);
}
- MenuPrint(gOtherText_DiplomaCertificationGameFreak, 6, 2);
+ Menu_PrintText(gOtherText_DiplomaCertificationGameFreak, 6, 2);
} \ No newline at end of file
diff --git a/src/field/field_message_box.c b/src/field/field_message_box.c
index 35aac7ac9..284fdb3f0 100644
--- a/src/field/field_message_box.c
+++ b/src/field/field_message_box.c
@@ -19,8 +19,8 @@ static void PrintFieldMessageFromStringVar4(void);
void InitFieldMessageBox(void)
{
sMessageBoxMode = FIELD_MESSAGE_BOX_HIDDEN;
- SetMessageBoxBaseTileNum(gMenuTextWindowContentTileOffset);
- InitWindowFromConfig(&gFieldMessageBoxWindow, &gWindowConfig_81E6CE4);
+ TextWindow_SetDlgFrameBaseTileNum(gMenuTextWindowContentTileOffset);
+ Text_InitWindowWithTemplate(&gFieldMessageBoxWindow, &gWindowConfig_81E6CE4);
}
static void Task_FieldMessageBox(u8 taskId)
@@ -29,22 +29,22 @@ static void Task_FieldMessageBox(u8 taskId)
switch (task->data[0])
{
case 0:
- LoadMessageBoxTiles(&gFieldMessageBoxWindow);
+ TextWindow_LoadDialogueFrameTiles(&gFieldMessageBoxWindow);
task->data[0]++;
break;
case 1:
- DrawStandardMessageBox(&gFieldMessageBoxWindow);
+ TextWindow_DrawDialogueFrame(&gFieldMessageBoxWindow);
task->data[0]++;
break;
case 2:
switch (sMessageBoxMode)
{
case FIELD_MESSAGE_BOX_NORMAL:
- if (!sub_80035AC(&gFieldMessageBoxWindow))
+ if (!Text_UpdateWindow(&gFieldMessageBoxWindow))
return;
break;
case FIELD_MESSAGE_BOX_AUTO_SCROLL:
- if (!sub_8003778(&gFieldMessageBoxWindow))
+ if (!Text_UpdateWindowAutoscroll(&gFieldMessageBoxWindow))
return;
break;
}
@@ -117,20 +117,20 @@ bool8 unref_sub_8064BD0(const u8 *message)
static void PrintFieldMessage(const u8 *message)
{
StringExpandPlaceholders(gStringVar4, message);
- sub_8002EB0(&gFieldMessageBoxWindow, gStringVar4, gMenuTextTileOffset, 2, 15);
+ Text_InitWindow8002EB0(&gFieldMessageBoxWindow, gStringVar4, gMenuTextTileOffset, 2, 15);
CreateFieldMessageBoxTask();
}
static void PrintFieldMessageFromStringVar4(void)
{
- sub_8002EB0(&gFieldMessageBoxWindow, gStringVar4, gMenuTextTileOffset, 2, 15);
+ Text_InitWindow8002EB0(&gFieldMessageBoxWindow, gStringVar4, gMenuTextTileOffset, 2, 15);
CreateFieldMessageBoxTask();
}
void HideFieldMessageBox(void)
{
DestroyFieldMessageBoxTask();
- ClearStandardMessageBox(&gFieldMessageBoxWindow);
+ TextWindow_EraseDialogueFrame(&gFieldMessageBoxWindow);
sMessageBoxMode = FIELD_MESSAGE_BOX_HIDDEN;
}
@@ -150,6 +150,6 @@ bool8 IsFieldMessageBoxHidden(void)
void unref_sub_8064CA0(void)
{
DestroyFieldMessageBoxTask();
- DrawStandardMessageBox(&gFieldMessageBoxWindow);
+ TextWindow_DrawDialogueFrame(&gFieldMessageBoxWindow);
sMessageBoxMode = FIELD_MESSAGE_BOX_HIDDEN;
}
diff --git a/src/field/field_player_avatar.c b/src/field/field_player_avatar.c
index d80076be4..9a29e2e92 100644
--- a/src/field/field_player_avatar.c
+++ b/src/field/field_player_avatar.c
@@ -1507,7 +1507,7 @@ u8 Fishing4(struct Task *task)
{
u32 randVal;
- MenuDisplayMessageBox();
+ Menu_DisplayDialogueFrame();
task->tStep++;
task->tFrameCounter = 0;
task->tNumDots = 0;
@@ -1549,7 +1549,7 @@ u8 Fishing5(struct Task *task)
}
else
{
- MenuPrint(dot, task->tNumDots + 4, 15);
+ Menu_PrintText(dot, task->tNumDots + 4, 15);
task->tNumDots++;
}
}
@@ -1573,7 +1573,7 @@ u8 Fishing6(struct Task *task)
u8 Fishing7(struct Task *task)
{
sub_805A954();
- MenuPrint(gOtherText_OhABite, 4, 17);
+ Menu_PrintText(gOtherText_OhABite, 4, 17);
task->tStep++;
task->tFrameCounter = 0;
return 0;
@@ -1624,7 +1624,7 @@ u8 Fishing10(struct Task *task)
{
sub_805A954();
MenuPrintMessageDefaultCoords(gOtherText_PokeOnHook);
- MenuDisplayMessageBox();
+ Menu_DisplayDialogueFrame();
task->tStep++;
task->tFrameCounter = 0;
return 0;
@@ -1637,7 +1637,7 @@ u8 Fishing11(struct Task *task)
if (task->tFrameCounter == 0)
{
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
{
struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId];
@@ -1647,7 +1647,7 @@ u8 Fishing11(struct Task *task)
sub_8127F28(gMapObjects[gPlayerAvatar.mapObjectId].mapobj_unk_1A, 0, 0);
gSprites[gPlayerAvatar.spriteId].pos2.x = 0;
gSprites[gPlayerAvatar.spriteId].pos2.y = 0;
- MenuZeroFillScreen();
+ Menu_EraseScreen();
task->tFrameCounter++;
return 0;
}
@@ -1688,7 +1688,7 @@ u8 Fishing13(struct Task *task)
u8 Fishing14(struct Task *task)
{
sub_805A954();
- MenuDisplayMessageBox();
+ Menu_DisplayDialogueFrame();
task->tStep++;
return 0;
}
@@ -1713,12 +1713,12 @@ u8 Fishing15(struct Task *task)
u8 Fishing16(struct Task *task)
{
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
{
gPlayerAvatar.preventStep = FALSE;
ScriptContext2_Disable();
UnfreezeMapObjects();
- MenuZeroFillScreen();
+ Menu_EraseScreen();
sub_80BE97C(0);
DestroyTask(FindTaskIdByFunc(Task_Fishing));
}
diff --git a/src/field/field_region_map.c b/src/field/field_region_map.c
index 73e101d8f..af8e4ec8a 100644
--- a/src/field/field_region_map.c
+++ b/src/field/field_region_map.c
@@ -52,11 +52,11 @@ void CB2_FieldInitRegionMap(void)
CreateRegionMapCursor(1, 1);
SetUpWindowConfig(&gWindowConfig_81E709C);
InitMenuWindow(&gWindowConfig_81E709C);
- MenuZeroFillScreen();
+ Menu_EraseScreen();
REG_BG0CNT = BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(31) | BGCNT_16COLOR | BGCNT_TXT256x256;
- MenuDrawTextWindow(21, 0, 29, 3);
+ Menu_DrawStdWindowFrame(21, 0, 29, 3);
sub_8072BD8(gOtherText_Hoenn, 0x16, 1, 0x38);
- MenuDrawTextWindow(16, 16, 29, 19);
+ Menu_DrawStdWindowFrame(16, 16, 29, 19);
sub_813F0C8();
SetMainCallback2(CB2_FieldRegionMap);
SetVBlankCallback(VBlankCB_FieldRegionMap);
@@ -117,7 +117,7 @@ void sub_813EFDC(void)
void sub_813F0C8(void)
{
- MenuFillWindowRectWithBlankTile(17, 17, 28, 18);
+ Menu_BlankWindowRect(17, 17, 28, 18);
if (ewram0_5.unk8.unk16)
- MenuPrint(ewram0_5.unk8.str, 17, 17);
+ Menu_PrintText(ewram0_5.unk8.str, 17, 17);
}
diff --git a/src/field/field_screen_effect.c b/src/field/field_screen_effect.c
index a472d5a9c..f123768e5 100644
--- a/src/field/field_screen_effect.c
+++ b/src/field/field_screen_effect.c
@@ -215,7 +215,7 @@ static void sub_80816A8(u8 taskId)
data[0] = 1;
break;
case 1:
- MenuFillWindowRectWithBlankTile(0, 0, 29, 19);
+ Menu_BlankWindowRect(0, 0, 29, 19);
sub_808161C(data[1]);
sub_8081534(data[2], data[3], 1, 160, 1, 2);
data[0] = 2;
@@ -264,7 +264,7 @@ static void sub_80816A8(u8 taskId)
}
break;
case 5:
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
LoadFontDefaultPalette(&gWindowConfig_81E6CE4);
REG_WIN0H = 255;
REG_DISPCNT = data[6];
diff --git a/src/field/field_specials.c b/src/field/field_specials.c
index fc6f690a3..589f96844 100644
--- a/src/field/field_specials.c
+++ b/src/field/field_specials.c
@@ -1058,7 +1058,7 @@ static void sub_810E874(void)
ScriptContext2_Enable();
if (gUnknown_0203925A > 5)
{
- MenuDrawTextWindow(0, 0, 8, 11);
+ Menu_DrawStdWindowFrame(0, 0, 8, 11);
InitMenu(0, 1, 1, 5, 0, 7);
gUnknown_0203925C = 0;
sub_80F944C();
@@ -1067,12 +1067,12 @@ static void sub_810E874(void)
}
else
{
- MenuDrawTextWindow(0, 0, 8, 2 * gUnknown_0203925A + 1);
+ Menu_DrawStdWindowFrame(0, 0, 8, 2 * gUnknown_0203925A + 1);
InitMenu(0, 1, 1, gUnknown_0203925A, 0, 7);
}
for (i = 0; i < 5 && gUnknown_03000760[i].var0 != 16; i ++)
{
- MenuPrint(gUnknown_083F8380[gUnknown_03000760[i].var0], 1, 2 * i + 1);
+ Menu_PrintText(gUnknown_083F8380[gUnknown_03000760[i].var0], 1, 2 * i + 1);
}
DisplayCurrentElevatorFloor();
CreateTask(sub_810E984, 8);
@@ -1080,7 +1080,7 @@ static void sub_810E874(void)
void DisplayCurrentElevatorFloor(void)
{
- MenuDrawTextWindow(20, 0, 29, 5);
+ Menu_DrawStdWindowFrame(20, 0, 29, 5);
sub_8072BD8(gOtherText_NowOn, 21, 1, 64);
sub_8072BD8(gUnknown_083F8380[gSpecialVar_0x8005], 21, 3, 64);
}
@@ -1091,15 +1091,15 @@ void sub_810E984(u8 taskId)
if (gMain.newKeys == DPAD_UP && gUnknown_0203925B != 0)
{
gUnknown_0203925B--;
- curMenuPos = GetMenuCursorPos();
- MoveMenuCursorNoWrap(-1);
+ curMenuPos = Menu_GetCursorPos();
+ Menu_MoveCursorNoWrap(-1);
sub_810EAC8(curMenuPos, DPAD_UP);
}
if (gMain.newKeys == DPAD_DOWN && gUnknown_0203925B != gUnknown_0203925A - 1)
{
gUnknown_0203925B++;
- curMenuPos = GetMenuCursorPos();
- MoveMenuCursorNoWrap(+1);
+ curMenuPos = Menu_GetCursorPos();
+ Menu_MoveCursorNoWrap(+1);
sub_810EAC8(curMenuPos, DPAD_DOWN);
}
if (gMain.newKeys & A_BUTTON)
@@ -1109,7 +1109,7 @@ void sub_810E984(u8 taskId)
{
gSpecialVar_Result = 0;
PlaySE(SE_SELECT);
- MenuZeroFillWindowRect(0, 0, 29, 12);
+ Menu_EraseWindowRect(0, 0, 29, 12);
sub_810EC9C(taskId);
}
else
@@ -1119,7 +1119,7 @@ void sub_810E984(u8 taskId)
ShakeScreenInElevator();
FieldObjectTurnByLocalIdAndMap(gSpecialVar_LastTalked, gSaveBlock1.location.mapNum, gSaveBlock1.location.mapGroup, DIR_SOUTH);
sub_810EEDC();
- MenuZeroFillScreen();
+ Menu_EraseScreen();
DestroyTask(taskId);
}
}
@@ -1128,7 +1128,7 @@ void sub_810E984(u8 taskId)
gSpecialVar_Result = 0;
PlaySE(SE_SELECT);
sub_810EEDC();
- MenuZeroFillWindowRect(0, 0, 29, 12);
+ Menu_EraseWindowRect(0, 0, 29, 12);
sub_810EC9C(taskId);
}
}
@@ -1163,10 +1163,10 @@ bool8 sub_810EAC8(u8 prevMenuPos, u8 dpadInput)
if (flag)
{
sub_810EB90(newPos, 5);
- MenuFillWindowRectWithBlankTile(2, 1, 7, 10);
+ Menu_BlankWindowRect(2, 1, 7, 10);
for (i=0; i<5 && gUnknown_03000760[newPos].var0 != 16; newPos++, i++)
{
- MenuPrint(gUnknown_083F8380[gUnknown_03000760[newPos].var0], 1, i * 2 + 1);
+ Menu_PrintText(gUnknown_083F8380[gUnknown_03000760[newPos].var0], 1, i * 2 + 1);
}
}
return flag;
@@ -1227,7 +1227,7 @@ bool8 sub_810EAC8(u8 prevMenuPos, u8 dpadInput)
"\tmovs r1, 0x1\n"
"\tmovs r2, 0x7\n"
"\tmovs r3, 0xA\n"
- "\tbl MenuFillWindowRectWithBlankTile\n"
+ "\tbl Menu_BlankWindowRect\n"
"\tmovs r5, 0\n"
"\tldr r2, _0810EB88 @ =gUnknown_03000760\n"
"\tlsls r1, r4, 2\n"
@@ -1249,7 +1249,7 @@ bool8 sub_810EAC8(u8 prevMenuPos, u8 dpadInput)
"\tlsls r2, 24\n"
"\tlsrs r2, 24\n"
"\tmovs r1, 0x1\n"
- "\tbl MenuPrint\n"
+ "\tbl Menu_PrintText\n"
"\tadds r0, r4, 0x1\n"
"\tlsls r0, 24\n"
"\tlsrs r4, r0, 24\n"
@@ -1539,7 +1539,7 @@ void ShowGlassWorkshopMenu(void)
{
u8 i;
ScriptContext2_Enable();
- MenuDrawTextWindow(0, 0, 10, 11);
+ Menu_DrawStdWindowFrame(0, 0, 10, 11);
InitMenu(0, 1, 1, 5, 0, 9);
gUnknown_0203925C = 0;
sub_80F944C();
@@ -1547,7 +1547,7 @@ void ShowGlassWorkshopMenu(void)
sub_810F2B4();
for (i=0; i<5; i++)
{
- MenuPrint(gUnknown_083F83C0[i], 1, 2 * i + 1);
+ Menu_PrintText(gUnknown_083F83C0[i], 1, 2 * i + 1);
}
gUnknown_0203925B = 0;
gUnknown_0203925A = ARRAY_COUNT(gUnknown_083F83C0);
@@ -1560,15 +1560,15 @@ void sub_810F118(u8 taskId)
if (gMain.newKeys == DPAD_UP && gUnknown_0203925B != 0)
{
gUnknown_0203925B--;
- prevCursorPos = GetMenuCursorPos();
- MoveMenuCursorNoWrap(-1);
+ prevCursorPos = Menu_GetCursorPos();
+ Menu_MoveCursorNoWrap(-1);
sub_810F1F4(prevCursorPos, DPAD_UP);
}
if (gMain.newKeys == DPAD_DOWN && gUnknown_0203925B != gUnknown_0203925A - 1)
{
gUnknown_0203925B++;
- prevCursorPos = GetMenuCursorPos();
- MoveMenuCursorNoWrap(1);
+ prevCursorPos = Menu_GetCursorPos();
+ Menu_MoveCursorNoWrap(1);
sub_810F1F4(prevCursorPos, DPAD_DOWN);
}
if (gMain.newKeys & A_BUTTON)
@@ -1577,7 +1577,7 @@ void sub_810F118(u8 taskId)
gSpecialVar_Result = gUnknown_0203925B;
PlaySE(SE_SELECT);
sub_810EEDC();
- MenuZeroFillWindowRect(0, 0, 29, 12);
+ Menu_EraseWindowRect(0, 0, 29, 12);
sub_810EC9C(taskId);
}
if (gMain.newKeys & B_BUTTON)
@@ -1586,7 +1586,7 @@ void sub_810F118(u8 taskId)
gSpecialVar_Result = 0x7f;
PlaySE(SE_SELECT);
sub_810EEDC();
- MenuZeroFillWindowRect(0, 0, 29, 12);
+ Menu_EraseWindowRect(0, 0, 29, 12);
sub_810EC9C(taskId);
}
}
@@ -1621,10 +1621,10 @@ bool8 sub_810F1F4(u8 prevCursorPos, u8 dpadInput)
if (flag)
{
GlassWorkshopUpdateScrollIndicators(newPos, 5);
- MenuFillWindowRectWithBlankTile(2, 1, 9, 10);
+ Menu_BlankWindowRect(2, 1, 9, 10);
for (i=0; i<5; newPos++, i++)
{
- MenuPrint(gUnknown_083F83C0[newPos], 1, 2 * i + 1);
+ Menu_PrintText(gUnknown_083F83C0[newPos], 1, 2 * i + 1);
}
}
return flag;
@@ -1683,7 +1683,7 @@ bool8 sub_810F1F4(u8 prevCursorPos, u8 dpadInput)
"\tmovs r1, 0x1\n"
"\tmovs r2, 0x9\n"
"\tmovs r3, 0xA\n"
- "\tbl MenuFillWindowRectWithBlankTile\n"
+ "\tbl Menu_BlankWindowRect\n"
"\tmovs r5, 0\n"
"\tldr r7, _0810F28C @ =gUnknown_083F83C0\n"
"_0810F25C:\n"
@@ -1695,7 +1695,7 @@ bool8 sub_810F1F4(u8 prevCursorPos, u8 dpadInput)
"\tlsls r2, 24\n"
"\tlsrs r2, 24\n"
"\tmovs r1, 0x1\n"
- "\tbl MenuPrint\n"
+ "\tbl Menu_PrintText\n"
"\tadds r0, r4, 0x1\n"
"\tlsls r0, 24\n"
"\tlsrs r4, r0, 24\n"
diff --git a/src/field/fldeff_softboiled.c b/src/field/fldeff_softboiled.c
index a574232a8..3c64ec520 100644
--- a/src/field/fldeff_softboiled.c
+++ b/src/field/fldeff_softboiled.c
@@ -126,7 +126,7 @@ static void sub_8133E74(u8 taskId) {
return;
}
- MenuZeroFillWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19);
+ Menu_EraseWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19);
PrintPartyMenuPromptText(3, 0);
gTasks[taskId].func = HandlePartyMenuSwitchPokemonInput;
}
@@ -142,7 +142,7 @@ static void sub_8133EF8(void) {
sub_806CCE4();
EWRAM_1B000_2.unk261 = 2;
DestroySprite(&gSprites[EWRAM_1000.unk1]);
- MenuZeroFillWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19);
+ Menu_EraseWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19);
PrintPartyMenuPromptText(0, 0);
SwitchTaskToFollowupFunc(EWRAM_1000.unk0);
}
diff --git a/src/field/item_menu.c b/src/field/item_menu.c
index e9b8b24d3..0db48f55d 100644
--- a/src/field/item_menu.c
+++ b/src/field/item_menu.c
@@ -1062,7 +1062,7 @@ void sub_80A4164(u8 *dest, u16 value, enum StringConvertMode mode, u8 digits)
void sub_80A418C(u16 value, enum StringConvertMode mode, u8 c, u8 d, u8 digits)
{
sub_80A4164(gStringVar1, value, mode, digits);
- MenuPrint(gStringVar1, c, d);
+ Menu_PrintText(gStringVar1, c, d);
}
static void sub_80A41D4(u8 taskId)
@@ -1112,7 +1112,7 @@ static bool8 sub_80A42B0(u8 itemPos, int b)
return TRUE;
r5 = itemPos * 2 + 2;
sub_8072C74(gStringVar1, gOtherText_CloseBag, 0x78, 0);
- MenuPrint(gStringVar1, 14, r5);
+ Menu_PrintText(gStringVar1, 14, r5);
ptr = gBGTilemapBuffers[2] + 14 + r5 * 32;
ptr[0] = 0x4F;
ptr[1] = 0x4F;
@@ -1121,9 +1121,9 @@ static bool8 sub_80A42B0(u8 itemPos, int b)
if (itemPos == 7)
return TRUE;
if ((b == 1 && r8->unk2 != 0) || b == 2)
- MenuFillWindowRectWithBlankTile(14, r5 + 2, 29, 13);
+ Menu_BlankWindowRect(14, r5 + 2, 29, 13);
else
- MenuFillWindowRectWithBlankTile(14, r5 + 2, 29, 17);
+ Menu_BlankWindowRect(14, r5 + 2, 29, 17);
return TRUE;
}
return FALSE;
@@ -1148,7 +1148,7 @@ static void sub_80A4380(u16 a, int b, int c, int d)
text = sub_8072C74(text, ItemId_GetItem(gCurrentBagPocketItemSlots[r4].itemId)->name, 0x66, 0);
*text++ = CHAR_MULT_SIGN;
sub_8072C14(text, gCurrentBagPocketItemSlots[r4].quantity, 0x78, 1);
- MenuPrint(gStringVar1, 14, r5);
+ Menu_PrintText(gStringVar1, 14, r5);
}
}
@@ -1173,7 +1173,7 @@ static void sub_80A444C(u16 a, int b, int c, int d)
#else
sub_8072C74(text, ItemId_GetItem(gCurrentBagPocketItemSlots[r4].itemId)->name, 0x63, 0);
#endif
- MenuPrint(gStringVar1, 14, r5);
+ Menu_PrintText(gStringVar1, 14, r5);
if (gUnknown_02038558 != 0)
{
if (gCurrentBagPocketItemSlots[r4].itemId == gSaveBlock1.registeredItem)
@@ -1240,7 +1240,7 @@ static void sub_80A4548(u16 a, int b, int c, int d)
moveName = gMoveNames[ItemIdToBattleMoveId(gCurrentBagPocketItemSlots[r4].itemId)];
sub_8072C74(text, moveName, 0x78, 0);
}
- MenuPrint(gStringVar1, 14, sp10);
+ Menu_PrintText(gStringVar1, 14, sp10);
}
}
#else
@@ -1421,7 +1421,7 @@ _080A46AE:\n\
ldr r0, _080A46F8 @ =gStringVar1\n\
movs r1, 0xE\n\
ldr r2, [sp, 0x10]\n\
- bl MenuPrint\n\
+ bl Menu_PrintText\n\
mov r0, r8\n\
adds r0, 0x1\n\
lsls r0, 24\n\
@@ -1482,7 +1482,7 @@ static void sub_80A46FC(u16 a, int b, int c, int d)
text = sub_80A425C(a, text, i);
CopyItemName(gCurrentBagPocketItemSlots[r4].itemId, gStringVar2);
sub_80A41E0(text, gCurrentBagPocketItemSlots[r4].itemId - 0x84, gStringVar2, gCurrentBagPocketItemSlots[r4].quantity, 3);
- MenuPrint(gStringVar1, 14, r5);
+ Menu_PrintText(gStringVar1, 14, r5);
}
}
@@ -1540,7 +1540,7 @@ static void ItemListMenu_InitDescription(s16 itemId)
}
if (r5 < 3)
- MenuZeroFillWindowRect(0, 13 + r5 * 2, 13, 20);
+ Menu_EraseWindowRect(0, 13 + r5 * 2, 13, 20);
}
static void ItemListMenu_ChangeDescription(s16 itemId, int b)
@@ -1551,7 +1551,7 @@ static void ItemListMenu_ChangeDescription(s16 itemId, int b)
{
if (b == 0)
{
- MenuZeroFillWindowRect(0, 13, 13, 20);
+ Menu_EraseWindowRect(0, 13, 13, 20);
MenuPrint_PixelCoords(gOtherText_ReturnTo, 4, 0x68, 0);
}
else if (b == 1)
@@ -1562,7 +1562,7 @@ static void ItemListMenu_ChangeDescription(s16 itemId, int b)
else
{
if (b == 0)
- MenuZeroFillWindowRect(0, 13, 13, 20);
+ Menu_EraseWindowRect(0, 13, 13, 20);
if (ItemId_CopyDescription(description, itemId, b))
MenuPrint_PixelCoords(description, 4, 104 + b * 16, 0);
}
@@ -1602,7 +1602,7 @@ static void sub_80A4A98(const u8 *text, u32 line)
u8 buffer[100];
if (line == 0)
- MenuZeroFillWindowRect(0, 13, 13, 20);
+ Menu_EraseWindowRect(0, 13, 13, 20);
if (CopyTextLine(buffer, text, line))
MenuPrint_PixelCoords(buffer, 4, 104 + line * 16, 0);
}
@@ -1618,7 +1618,7 @@ static void sub_80A4ADC(u8 taskId)
static void sub_80A4B14(s8 a, u8 b)
{
gBagPocketScrollStates[sCurrentBagPocket].scrollTop += a;
- MoveMenuCursor(0);
+ Menu_MoveCursor(0);
sub_80A73C0();
sub_80A763C();
sub_80A4ADC(b);
@@ -1626,7 +1626,7 @@ static void sub_80A4B14(s8 a, u8 b)
static void sub_80A4B58(s8 delta, u8 b)
{
- gBagPocketScrollStates[sCurrentBagPocket].cursorPos = MoveMenuCursor(delta);
+ gBagPocketScrollStates[sCurrentBagPocket].cursorPos = Menu_MoveCursor(delta);
sub_80A73C0();
sub_80A4ADC(b);
}
@@ -1649,7 +1649,7 @@ static void sub_80A4BF0(u16 *a)
if (gUnknown_02038564 == 4)
{
- MenuDrawTextWindow(0, 7, 13, 12);
+ Menu_DrawStdWindowFrame(0, 7, 13, 12);
sub_80A4008(a, 1, 8, 12, 4);
if (sub_80F9344() == TRUE && sReturnLocation == RETURN_TO_FIELD_5)
{
@@ -1665,7 +1665,7 @@ static void sub_80A4BF0(u16 *a)
text = sub_80A4B90(gSpecialVar_ItemId);
else
text = sItemPopupMenuActions[sPopupMenuActionList[i]].text;
- MenuPrint(text, 1 + (i / 2) * 6, 8 + (i % 2) * 2);
+ Menu_PrintText(text, 1 + (i / 2) * 6, 8 + (i % 2) * 2);
}
}
if (sReturnLocation == RETURN_TO_FIELD_5)
@@ -1676,10 +1676,10 @@ static void sub_80A4BF0(u16 *a)
}
else
{
- MenuDrawTextWindow(0, 5, 13, 12);
+ Menu_DrawStdWindowFrame(0, 5, 13, 12);
sub_80A4008(a, 1, 6, 12, 6);
for (i = 0; i < gUnknown_02038564; i++)
- MenuPrint(sItemPopupMenuActions[sPopupMenuActionList[i]].text, 1 + (i / 3) * 6, 6 + (i % 3) * 2);
+ Menu_PrintText(sItemPopupMenuActions[sPopupMenuActionList[i]].text, 1 + (i / 3) * 6, 6 + (i % 3) * 2);
InitMenu(0, 1, 6, gUnknown_02038564, 0, 1);
sub_8072DCC(0x2F);
}
@@ -1690,7 +1690,7 @@ static void sub_80A4DA4(u16 *a)
{
sub_80A73FC();
sub_80A36B8(a, 0, 6, 13, 6);
- MenuZeroFillWindowRect(0, 5, 13, 12);
+ Menu_EraseWindowRect(0, 5, 13, 12);
sub_80A7590();
}
@@ -1699,7 +1699,7 @@ static void sub_80A4DD8(u8 taskId, u8 b, u8 c, u8 d, u8 e, u8 digits)
gTasks[taskId].data[1] = 1;
gTasks[taskId].data[2] = b + 2;
gTasks[taskId].data[3] = c + 1;
- MenuDrawTextWindow(b, c, b + d, c + e);
+ Menu_DrawStdWindowFrame(b, c, b + d, c + e);
sub_80A4008(gBGTilemapBuffers[1], b + 1, c + 1, d - 1, e - 1);
sub_80A418C(1, 1, b + 2, c + 1, digits);
}
@@ -2539,7 +2539,7 @@ static void sub_80A57C4(void)
r5 = 7;
}
sub_80A4008(gBGTilemapBuffers[1], 7, r5 + 1, 6, gUnknown_02038564 * 2);
- MenuDrawTextWindow(6, r5, 13, gUnknown_02038564 * 2 + 1 + r5);
+ Menu_DrawStdWindowFrame(6, r5, 13, gUnknown_02038564 * 2 + 1 + r5);
sub_80A7834(0, r5);
InitMenu(0, 7, r5 + 1, gUnknown_02038564, 0, 6);
}
@@ -2553,7 +2553,7 @@ static void sub_80A5888(u8 taskId)
if (sPopupMenuSelection != 0)
{
PlaySE(SE_SELECT);
- sPopupMenuSelection = MoveMenuCursor(-1);
+ sPopupMenuSelection = Menu_MoveCursor(-1);
}
}
else if (gMain.newAndRepeatedKeys & DPAD_DOWN)
@@ -2561,7 +2561,7 @@ static void sub_80A5888(u8 taskId)
if (sPopupMenuSelection != gUnknown_02038564 - 1)
{
PlaySE(SE_SELECT);
- sPopupMenuSelection = MoveMenuCursor(1);
+ sPopupMenuSelection = Menu_MoveCursor(1);
}
}
else if (gMain.newKeys & A_BUTTON)
@@ -2690,14 +2690,14 @@ static void sub_80A5C24(u8 taskId)
void CleanUpItemMenuMessage(u8 taskId)
{
sub_80A36B8(gBGTilemapBuffers[1], 0, 0, 31, 31);
- MenuZeroFillWindowRect(7, 7, 13, 12);
- MenuZeroFillWindowRect(0, 14, 29, 19);
+ Menu_EraseWindowRect(7, 7, 13, 12);
+ Menu_EraseWindowRect(0, 14, 29, 19);
gTasks[taskId].func = sub_80A5C24;
}
void CleanUpOverworldMessage(u8 taskId)
{
- MenuZeroFillWindowRect(0, 13, 29, 19);
+ Menu_EraseWindowRect(0, 13, 29, 19);
DestroyTask(taskId);
sub_8064E2C();
ScriptContext2_Disable();
@@ -2760,7 +2760,7 @@ static void sub_80A5DA0(u16 itemId, u16 quantity)
static void sub_80A5DF8(void)
{
sub_80A4DA4(gBGTilemapBuffers[1]);
- MenuZeroFillWindowRect(7, 6, 11, 13);
+ Menu_EraseWindowRect(7, 6, 11, 13);
sub_80A7528(4);
}
@@ -2857,7 +2857,7 @@ static void sub_80A6024(u8 taskId)
if (gMain.newKeys & A_BUTTON)
{
sub_80A36B8(gBGTilemapBuffers[1], 0, 0, 31, 31);
- MenuZeroFillWindowRect(0, 14, 29, 19);
+ Menu_EraseWindowRect(0, 14, 29, 19);
gTasks[taskId].func = sub_80A6000;
}
}
@@ -3008,7 +3008,7 @@ static void sub_80A640C(u8 taskId)
static void sub_80A6444(u8 taskId)
{
sub_80A36B8(gBGTilemapBuffers[1], 0, 0, 31, 31);
- MenuZeroFillWindowRect(0, 14, 29, 19);
+ Menu_EraseWindowRect(0, 14, 29, 19);
gTasks[taskId].func = sub_80A640C;
}
@@ -3016,7 +3016,7 @@ static void sub_80A648C(u8 taskId)
{
gTasks[taskId].func = Task_BuyHowManyDialogueHandleInput;
sub_80A4008(gBGTilemapBuffers[1], 1, 11, 12, 2);
- MenuDrawTextWindow(0, 10, 13, 13);
+ Menu_DrawStdWindowFrame(0, 10, 13, 13);
gTasks[taskId].data[1] = 1;
gTasks[taskId].data[2] = 1;
gTasks[taskId].data[3] = 11;
@@ -3053,7 +3053,7 @@ static void sub_80A6574(u8 taskId)
static void sub_80A65AC(u8 taskId)
{
- MenuZeroFillWindowRect(7, 6, 13, 12);
+ Menu_EraseWindowRect(7, 6, 13, 12);
sub_80A36B8(gBGTilemapBuffers[1], 7, 6, 6, 6);
CopyItemName(gSpecialVar_ItemId, gStringVar2);
StringExpandPlaceholders(gStringVar4, gOtherText_SoldItem);
@@ -3063,7 +3063,7 @@ static void sub_80A65AC(u8 taskId)
static void sub_80A6618(u8 taskId)
{
- MenuZeroFillWindowRect(7, 6, 13, 12);
+ Menu_EraseWindowRect(7, 6, 13, 12);
sub_80A36B8(gBGTilemapBuffers[1], 7, 6, 6, 6);
BuyMenuPrintItemQuantityAndPrice(taskId);
}
@@ -3078,13 +3078,13 @@ static void Task_BuyHowManyDialogueHandleInput(u8 taskId)
{
if (sub_80A5350(taskId) == TRUE)
{
- MenuZeroFillWindowRect(6, 11, 12, 11);
+ Menu_EraseWindowRect(6, 11, 12, 11);
BuyMenuDisplayMessage(gSpecialVar_ItemId, gTasks[taskId].data[1]);
}
else if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
- MenuZeroFillWindowRect(0, 10, 13, 13);
+ Menu_EraseWindowRect(0, 10, 13, 13);
sub_80A36B8(gBGTilemapBuffers[1], 0, 10, 13, 3);
ConvertIntToDecimalStringN(gStringVar1, ItemId_GetPrice(gSpecialVar_ItemId) / 2 * gTasks[taskId].data[1], STR_CONV_MODE_LEFT_ALIGN, 6);
StringExpandPlaceholders(gStringVar4, gOtherText_CanPay);
@@ -3110,8 +3110,8 @@ static void BuyMenuPrintItemQuantityAndPrice(u8 taskId)
{
sub_80A36B8(gBGTilemapBuffers[1], 0, 0, 31, 31);
CloseMoneyWindow(0, 0);
- MenuZeroFillWindowRect(0, 4, 13, 13);
- MenuZeroFillWindowRect(0, 14, 29, 19);
+ Menu_EraseWindowRect(0, 4, 13, 13);
+ Menu_EraseWindowRect(0, 14, 29, 19);
gTasks[taskId].func = sub_80A6760;
}
@@ -3229,7 +3229,7 @@ static void sub_80A6A84(u8 taskId)
sub_80A4DA4(gBGTilemapBuffers[1]);
CopyItemName(gSpecialVar_ItemId, gStringVar1);
ConvertIntToDecimalStringN(gStringVar2, taskData[1], STR_CONV_MODE_LEFT_ALIGN, 3);
- MenuZeroFillWindowRect(7, 6, 11, 13);
+ Menu_EraseWindowRect(7, 6, 11, 13);
sub_80A7528(7);
sub_80A3D5C(taskId);
gTasks[taskId].func = sub_80A5E1C;
@@ -3361,16 +3361,16 @@ static void sub_80A6DF0(u16 *a)
{
u8 r6 = (gUnknown_02038564 - 1) * 2;
- MenuDrawTextWindow(7, 9 - r6, 13, 12);
+ Menu_DrawStdWindowFrame(7, 9 - r6, 13, 12);
sub_80A4008(a, 8, 10 - r6, 5, r6 + 2);
if (gUnknown_02038564 == 1)
{
- MenuPrint(sItemPopupMenuActions[sPopupMenuActionList[0]].text, 8, 10);
+ Menu_PrintText(sItemPopupMenuActions[sPopupMenuActionList[0]].text, 8, 10);
}
else
{
- MenuPrint(sItemPopupMenuActions[sPopupMenuActionList[0]].text, 8, 8);
- MenuPrint(sItemPopupMenuActions[sPopupMenuActionList[1]].text, 8, 10);
+ Menu_PrintText(sItemPopupMenuActions[sPopupMenuActionList[0]].text, 8, 8);
+ Menu_PrintText(sItemPopupMenuActions[sPopupMenuActionList[1]].text, 8, 10);
}
InitMenu(0, 8, 10 - r6, gUnknown_02038564, 0, 5);
sub_80A7528(2);
@@ -3383,7 +3383,7 @@ static void sub_80A6EB8(u8 taskId)
if (sPopupMenuSelection == 1)
{
PlaySE(SE_SELECT);
- sPopupMenuSelection = MoveMenuCursor(-1);
+ sPopupMenuSelection = Menu_MoveCursor(-1);
}
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN)
@@ -3391,7 +3391,7 @@ static void sub_80A6EB8(u8 taskId)
if (sPopupMenuSelection + 1 < gUnknown_02038564)
{
PlaySE(SE_SELECT);
- sPopupMenuSelection = MoveMenuCursor(1);
+ sPopupMenuSelection = Menu_MoveCursor(1);
}
}
else if (gMain.newKeys & A_BUTTON)
@@ -3669,7 +3669,7 @@ static void sub_80A756C(void)
static void sub_80A7590(void)
{
- MenuZeroFillWindowRect(0, 13, 13, 20);
+ Menu_EraseWindowRect(0, 13, 13, 20);
sub_80A756C();
}
@@ -3748,7 +3748,7 @@ static void sub_80A7694(void)
static void sub_80A76A0(void)
{
- MenuZeroFillWindowRect(14, 2, 29, 18);
+ Menu_EraseWindowRect(14, 2, 29, 18);
sub_80A7678();
}
@@ -3816,7 +3816,7 @@ static void sub_80A7768(void)
const u8 *text = sItemPopupMenuActions[sPopupMenuActionList[r4->unk1 - 1]].text;
int var = r4->unk1 - 1;
- MenuPrint(text, 7, var * 2 + 1 + r4->unk3);
+ Menu_PrintText(text, 7, var * 2 + 1 + r4->unk3);
}
else
{
@@ -3828,7 +3828,7 @@ static void sub_80A7768(void)
else
text = sItemPopupMenuActions[sPopupMenuActionList[r4->unk1 - 1]].text;
var = r4->unk1 - 1;
- MenuPrint(text, (var >> 1) * 6 + 1, (var & 1) * 2 + 8);
+ Menu_PrintText(text, (var >> 1) * 6 + 1, (var & 1) * 2 + 8);
}
if (r4->unk1 == gUnknown_02038564)
{
diff --git a/src/field/item_use.c b/src/field/item_use.c
index e1fdddce0..bd76db77e 100644
--- a/src/field/item_use.c
+++ b/src/field/item_use.c
@@ -123,7 +123,7 @@ void HandleDeniedItemUseMessage(u8 var1, u8 playerMenuStatus, const u8 *text)
switch (playerMenuStatus)
{
case 0: // Item Menu
- MenuZeroFillWindowRect(0, 13, 13, 20);
+ Menu_EraseWindowRect(0, 13, 13, 20);
DisplayItemMessageOnField(var1, gStringVar4, CleanUpItemMenuMessage, 1);
break;
default: // Field
@@ -312,7 +312,7 @@ void RunItemfinderResults(u8 taskId)
void ExitItemfinder(u8 taskId)
{
- MenuZeroFillWindowRect(0, 14, 29, 19);
+ Menu_EraseWindowRect(0, 14, 29, 19);
sub_8064E2C();
ScriptContext2_Disable();
DestroyTask(taskId);
@@ -744,7 +744,7 @@ void ItemUseOutOfBattle_CoinCase(u8 taskId)
if (!gTasks[taskId].data[2])
{
- MenuZeroFillWindowRect(0, 0xD, 0xD, 0x14);
+ Menu_EraseWindowRect(0, 0xD, 0xD, 0x14);
DisplayItemMessageOnField(taskId, gStringVar4, CleanUpItemMenuMessage, 1);
}
else
@@ -770,7 +770,7 @@ void ItemUseOutOfBattle_SSTicket(u8 taskId)
{
if (gTasks[taskId].data[2] == 0)
{
- MenuZeroFillWindowRect(0, 0xD, 0xD, 0x14);
+ Menu_EraseWindowRect(0, 0xD, 0xD, 0x14);
DisplayItemMessageOnField(taskId, gUnknown_083D61DC[ItemId_GetSecondaryId(gSpecialVar_ItemId)], sub_80C9BB8, 1);
}
else
@@ -875,7 +875,7 @@ void ItemUseOutOfBattle_RareCandy(u8 taskId)
void ItemUseOutOfBattle_TMHM(u8 taskId)
{
- MenuZeroFillWindowRect(0, 0xD, 0xD, 0x14);
+ Menu_EraseWindowRect(0, 0xD, 0xD, 0x14);
if (gSpecialVar_ItemId >= ITEM_HM01)
DisplayItemMessageOnField(taskId, gOtherText_BootedHM, sub_80C9EE4, 1); // HM
@@ -1022,7 +1022,7 @@ void ItemUseInBattle_PokeBall(u8 var)
}
else
{
- MenuZeroFillWindowRect(0, 0xD, 0xD, 0x14);
+ Menu_EraseWindowRect(0, 0xD, 0xD, 0x14);
DisplayItemMessageOnField(var, gOtherText_BoxIsFull, CleanUpItemMenuMessage, 1);
}
}
@@ -1047,7 +1047,7 @@ void ItemUseInBattle_StatIncrease(u8 taskId)
{
u16 partyId = gBattlePartyID[gBankInMenu];
- MenuZeroFillWindowRect(0, 0xD, 0xD, 0x14);
+ Menu_EraseWindowRect(0, 0xD, 0xD, 0x14);
if (ExecuteTableBasedItemEffect_(&gPlayerParty[partyId], gSpecialVar_ItemId, partyId, 0) != FALSE)
{
@@ -1096,7 +1096,7 @@ void ItemUseInBattle_PPRecovery(u8 var)
void unref_sub_80CA448(u8 var)
{
- MenuZeroFillWindowRect(0, 0xD, 0xD, 0x14);
+ Menu_EraseWindowRect(0, 0xD, 0xD, 0x14);
if (ExecuteTableBasedItemEffect__(0, gSpecialVar_ItemId, 0) == FALSE)
{
@@ -1113,7 +1113,7 @@ void unref_sub_80CA448(u8 var)
void ItemUseInBattle_Escape(u8 taskId)
{
- MenuZeroFillWindowRect(0, 0xD, 0xD, 0x14);
+ Menu_EraseWindowRect(0, 0xD, 0xD, 0x14);
if((gBattleTypeFlags & BATTLE_TYPE_TRAINER) == FALSE)
{
diff --git a/src/field/map_name_popup.c b/src/field/map_name_popup.c
index 2e2dfc72e..49a470cc1 100644
--- a/src/field/map_name_popup.c
+++ b/src/field/map_name_popup.c
@@ -89,8 +89,8 @@ void HideMapNamePopup(void)
{
if (FuncIsActiveTask(Task_MapNamePopup))
{
- MenuLoadTextWindowGraphics();
- MenuZeroFillWindowRect(0, 0, 13, 3);
+ Menu_LoadStdFrameGraphics();
+ Menu_EraseWindowRect(0, 0, 13, 3);
REG_BG0VOFS = 0;
DestroyTask(sTaskId);
}
@@ -100,8 +100,8 @@ void DrawMapNamePopup(void)
{
u8 name[20];
- MenuLoadTextWindowGraphics_OverrideFrameType(0);
+ Menu_LoadStdFrameGraphicsOverrideStyle(0);
GetMapSectionName(name, gMapHeader.regionMapSectionId, 0);
- MenuDrawTextWindow(0, 0, 13, 3);
+ Menu_DrawStdWindowFrame(0, 0, 13, 3);
sub_8072BD8(name, 1, 1, 0x60);
}
diff --git a/src/field/mauville_man.c b/src/field/mauville_man.c
index 4db513f65..82c6dffe3 100644
--- a/src/field/mauville_man.c
+++ b/src/field/mauville_man.c
@@ -345,7 +345,7 @@ void PrepareSongText(void)
void ScrSpecial_PlayBardSong(void)
{
StartBardSong(gSpecialVar_0x8004);
- MenuDisplayMessageBox();
+ Menu_DisplayDialogueFrame();
ScriptContext1_Stop();
}
@@ -858,8 +858,8 @@ static void Task_BardSong(u8 taskId)
{
case 0: // Initialize song
PrepareSongText();
- InitWindowFromConfig(gMenuWindowPtr, &gWindowConfig_81E6CE4);
- sub_8002EB0(gMenuWindowPtr, gStringVar4, 2, 4, 15);
+ Text_InitWindowWithTemplate(gMenuWindowPtr, &gWindowConfig_81E6CE4);
+ Text_InitWindow8002EB0(gMenuWindowPtr, gStringVar4, 2, 4, 15);
task->data[1] = 0;
task->data[2] = 0;
task->tCharIndex = 0;
@@ -921,7 +921,7 @@ static void Task_BardSong(u8 taskId)
}
else if (gStringVar4[task->tCharIndex] == CHAR_SPACE)
{
- sub_8003418(gMenuWindowPtr);
+ Text_PrintWindowSimple(gMenuWindowPtr);
task->tCharIndex++;
task->tState = 2;
task->data[2] = 0;
@@ -941,7 +941,7 @@ static void Task_BardSong(u8 taskId)
else if (gStringVar4[task->tCharIndex] == CHAR_SONG_WORD_SEPARATOR)
{
gStringVar4[task->tCharIndex] = CHAR_SPACE; // restore it back to a space
- sub_8003418(gMenuWindowPtr);
+ Text_PrintWindowSimple(gMenuWindowPtr);
task->tCharIndex++;
task->data[2] = 0;
}
@@ -950,7 +950,7 @@ static void Task_BardSong(u8 taskId)
switch (task->data[1])
{
case 0:
- sub_8003418(gMenuWindowPtr);
+ Text_PrintWindowSimple(gMenuWindowPtr);
task->data[1]++;
break;
case 1:
@@ -1219,7 +1219,7 @@ static void PrintStoryList(void)
{
s32 i;
- MenuDrawTextWindow(0, 0, 25, 4 + GetFreeStorySlot() * 2);
+ Menu_DrawStdWindowFrame(0, 0, 25, 4 + GetFreeStorySlot() * 2);
for (i = 0; i < 4; i++)
{
struct MauvilleManStoryteller *storyteller = &gSaveBlock1.mauvilleMan.storyteller;
@@ -1227,9 +1227,9 @@ static void PrintStoryList(void)
if (stat == 0)
break;
- MenuPrint(GetStoryTitleByStat(stat), 1, 2 + i * 2);
+ Menu_PrintText(GetStoryTitleByStat(stat), 1, 2 + i * 2);
}
- MenuPrint(gPCText_Cancel, 1, 2 + i * 2);
+ Menu_PrintText(gPCText_Cancel, 1, 2 + i * 2);
}
static u8 gUnknown_03000748;
@@ -1247,7 +1247,7 @@ static void Task_StoryListMenu(u8 taskId)
task->data[0]++;
break;
case 1:
- selection = ProcessMenuInput();
+ selection = Menu_ProcessInput();
if (selection == -2)
break;
if (selection == -1 || selection == GetFreeStorySlot())
@@ -1260,7 +1260,7 @@ static void Task_StoryListMenu(u8 taskId)
gUnknown_03000748 = selection;
}
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(0, 0, 25, 12);
+ Menu_EraseWindowRect(0, 0, 25, 12);
DestroyTask(taskId);
EnableBothScriptContexts();
break;
diff --git a/src/field/menu_helpers.c b/src/field/menu_helpers.c
index e3ef0c790..44b24eed6 100644
--- a/src/field/menu_helpers.c
+++ b/src/field/menu_helpers.c
@@ -135,7 +135,7 @@ void sub_80F9020(void)
// display message box, fill box with tile if tile is not zero, print string
static void PrintMessage(const u8 *str, u16 tile)
{
- MenuDisplayMessageBox();
+ Menu_DisplayDialogueFrame();
if (tile)
{
sub_80A3FA0(&gBGTilemapBuffers[1][0], 2, 15, 26, 4, tile);
@@ -145,7 +145,7 @@ static void PrintMessage(const u8 *str, u16 tile)
static void sub_80F9090(u8 taskId)
{
- if (MenuUpdateWindowText() == TRUE)
+ if (Menu_UpdateWindowText() == TRUE)
{
gUnknown_0300074C(taskId);
}
@@ -196,7 +196,7 @@ static void PrintStringWithPalette(const u8 *str, u8 paletteNum, u8 left, u8 top
StringCopy(gStringVar4, str);
}
- MenuPrint(gStringVar4, left, top);
+ Menu_PrintText(gStringVar4, left, top);
}
// unused
@@ -209,7 +209,7 @@ void PrintNumberWithPalette(s32 value, u8 paletteNum, u8 n, u8 mode, u8 left, u8
}
else
{
- MenuPrint(gStringVar1, left, top);
+ Menu_PrintText(gStringVar1, left, top);
}
}
diff --git a/src/field/money.c b/src/field/money.c
index d0f0ab1f6..4ab4de51c 100644
--- a/src/field/money.c
+++ b/src/field/money.c
@@ -143,7 +143,7 @@ void PrintMoneyAmount(u32 amount, u8 size, u8 x, u8 y)
if (stringWidth >= (size + 1) * 8)
{
- MenuPrint(buffer, x, y);
+ Menu_PrintText(buffer, x, y);
}
else
{
@@ -275,7 +275,7 @@ void UpdateMoneyWindow(u32 amount, u8 x, u8 y)
void OpenMoneyWindow(u32 amount, u8 x, u8 y)
{
- MenuDrawTextWindow(x, y, x + 13, y + 3);
+ Menu_DrawStdWindowFrame(x, y, x + 13, y + 3);
UpdateMoneyWindow(amount, x, y);
LoadCompressedObjectPic(gUnknown_083CF584);
@@ -288,7 +288,7 @@ void CloseMoneyWindow(u8 x, u8 y)
{
DestroySpriteAndFreeResources(&gSprites[gUnknown_02038734]);
FreeSpritePaletteByTag(SPRITE_TAG_MONEY);
- MenuZeroFillWindowRect(x, y, x + 13, y + 3);
+ Menu_EraseWindowRect(x, y, x + 13, y + 3);
}
bool8 HasEnoughMoneyFor(void)
diff --git a/src/field/party_menu.c b/src/field/party_menu.c
index 790aede60..f589494f4 100644
--- a/src/field/party_menu.c
+++ b/src/field/party_menu.c
@@ -683,7 +683,7 @@ bool8 InitPartyMenu(void)
gMain.state++;
break;
case 8:
- InitWindowFromConfig(&gUnknown_03004210, &gWindowConfig_81E6C90);
+ Text_InitWindowWithTemplate(&gUnknown_03004210, &gWindowConfig_81E6C90);
MultistepInitWindowTileData(&gUnknown_03004210, 1);
gMain.state++;
break;
@@ -2676,26 +2676,26 @@ void PrintPartyMenuPromptText(u8 textId, u8 b)
switch (b)
{
case 0:
- MenuDrawTextWindow(0, 16, 23, 19);
+ Menu_DrawStdWindowFrame(0, 16, 23, 19);
break;
case 1:
- MenuDrawTextWindow(0, 16, 19, 19);
+ Menu_DrawStdWindowFrame(0, 16, 19, 19);
break;
case 2:
- MenuDrawTextWindow(0, 16, 22, 19);
+ Menu_DrawStdWindowFrame(0, 16, 22, 19);
break;
case 3:
- MenuDrawTextWindow(0, 16, 18, 19);
+ Menu_DrawStdWindowFrame(0, 16, 18, 19);
break;
}
- MenuPrint(PartyMenuPromptTexts[textId], 1, 17);
+ Menu_PrintText(PartyMenuPromptTexts[textId], 1, 17);
}
}
void sub_806D5A4(void)
{
- MenuZeroFillWindowRect(0, 16, 29, 19);
+ Menu_EraseWindowRect(0, 16, 29, 19);
}
void sub_806D5B8(u8 monIndex)
@@ -3313,7 +3313,7 @@ void PartyMenuDoPrintMonNickname(u8 monIndex, int b, const u8 *nameBuffer)
{
u32 var1 = 0;
CpuFastSet(&var1, gTileBuffer, 0x1000100);
- sub_8004E3C((struct WindowConfig *)&gWindowConfig_81E6CAC, gTileBuffer, nameBuffer);
+ sub_8004E3C((struct WindowTemplate *)&gWindowConfig_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 WindowConfig *)&gWindowConfig_81E6CAC, gUnknown_02039460 - 0x100 /*gTileBuffer*/, gStringVar1);
+ sub_8004E3C((struct WindowTemplate *)&gWindowConfig_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 WindowConfig *)&gWindowConfig_81E6CAC, gUnknown_02039460 - 0x100 /*gTileBuffer*/, gStringVar1);
+ sub_8004E3C((struct WindowTemplate *)&gWindowConfig_81E6CAC, gUnknown_02039460 - 0x100 /*gTileBuffer*/, gStringVar1);
CpuFastSet(gUnknown_02039460, OBJ_VRAM1 + 0x300 + (monIndex * 0x400), 64);
}
@@ -3667,7 +3667,7 @@ void ClosePartyPopupMenu(u8 index, const struct PartyPopupMenu *menu)
SetPartyPopupMenuOffsets(index, &left, &top, menu);
- MenuZeroFillWindowRect(left, top, left + menu[index].width, menu[index].numChoices * 2 + top + 1);
+ Menu_EraseWindowRect(left, top, left + menu[index].width, menu[index].numChoices * 2 + top + 1);
HandleDestroyMenuCursors();
}
@@ -3683,7 +3683,7 @@ u8 sub_806E834(const u8 *message, u8 arg1)
gUnknown_0202E8F6 = 1;
- MenuDrawTextWindow(WINDOW_LEFT, 14, WINDOW_RIGHT, 19);
+ Menu_DrawStdWindowFrame(WINDOW_LEFT, 14, WINDOW_RIGHT, 19);
MenuPrintMessage(message, WINDOW_LEFT + 1, 15);
taskId = CreateTask(sub_806E884, 1);
@@ -3694,11 +3694,11 @@ u8 sub_806E834(const u8 *message, u8 arg1)
static void sub_806E884(u8 taskId)
{
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
{
gUnknown_0202E8F6 = 0;
if (gTasks[taskId].data[0] == 0)
- MenuZeroFillWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19);
+ Menu_EraseWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19);
DestroyTask(taskId);
}
}
@@ -3794,7 +3794,7 @@ void PartyMenuTryGiveMonHeldItem_806EACC(u8 taskId)
{
u16 currentItem;
- MenuZeroFillWindowRect(23, 8, 29, 13);
+ Menu_EraseWindowRect(23, 8, 29, 13);
currentItem = GetMonData(ewram1C000.pokemon, MON_DATA_HELD_ITEM);
RemoveBagItem(ewram1C000.unk6, 1);
if (AddBagItem(currentItem, 1) == TRUE)
@@ -3823,7 +3823,7 @@ void PartyMenuTryGiveMonHeldItem_806EACC(u8 taskId)
return;
if (selection == -1)
PlaySE(SE_SELECT);
- MenuZeroFillWindowRect(23, 8, 29, 13);
+ Menu_EraseWindowRect(23, 8, 29, 13);
}
gTasks[taskId].func = party_menu_link_mon_held_item_object;
}
@@ -3938,7 +3938,7 @@ void Task_LoseMailMessage(u8 taskId)
{
sub_806E834(gOtherText_BagFullCannotRemoveItem, 0);
}
- MenuZeroFillWindowRect(23, 8, 29, 13);
+ Menu_EraseWindowRect(23, 8, 29, 13);
gTasks[taskId].func = party_menu_link_mon_held_item_object;
}
else
@@ -3947,8 +3947,8 @@ void Task_LoseMailMessage(u8 taskId)
return;
if (selection == -1)
PlaySE(SE_SELECT);
- MenuZeroFillWindowRect(23, 8, 29, 13);
- MenuZeroFillWindowRect(0, 14, 29, 19);
+ Menu_EraseWindowRect(23, 8, 29, 13);
+ Menu_EraseWindowRect(0, 14, 29, 19);
gTasks[taskId].func = party_menu_link_mon_held_item_object;
}
}
@@ -3968,7 +3968,7 @@ void Task_TakeHeldMail(u8 taskId)
if (selection == 0)
{
- MenuZeroFillWindowRect(23, 8, 29, 13);
+ Menu_EraseWindowRect(23, 8, 29, 13);
if (TakeMailFromMon2(ewram1C000.pokemon) != 0xFF)
sub_806E834(gOtherText_MailWasSent, 0);
else
@@ -3981,7 +3981,7 @@ void Task_TakeHeldMail(u8 taskId)
return;
if (selection == -1)
PlaySE(SE_SELECT);
- MenuZeroFillWindowRect(23, 8, 29, 13);
+ Menu_EraseWindowRect(23, 8, 29, 13);
sub_806E834(gOtherText_MailRemovedMessageLost, 1);
gTasks[taskId].func = Task_ConfirmLoseMailMessage;
}
@@ -4130,7 +4130,7 @@ void sub_806F390(u8 taskId)
if (selection == 0)
{
- MenuZeroFillWindowRect(23, 8, 29, 13);
+ Menu_EraseWindowRect(23, 8, 29, 13);
sub_806E834(gOtherText_WhichMoveToForget2, 1);
gTasks[taskId].func = sub_806F44C;
}
@@ -4206,7 +4206,7 @@ void StopTryingToTeachMove_806F588(u8 taskId)
void StopTryingToTeachMove_806F614(u8 taskId)
{
- MenuZeroFillWindowRect(23, 8, 29, 13);
+ Menu_EraseWindowRect(23, 8, 29, 13);
StringCopy(gStringVar2, gMoveNames[ewram1C000.unk8]);
StringExpandPlaceholders(gStringVar4, gOtherText_StopTryingTo);
sub_806E834(gStringVar4, 1);
@@ -4228,7 +4228,7 @@ void StopTryingToTeachMove_806F6B4(u8 taskId)
if (selection == 0)
{
- MenuZeroFillWindowRect(23, 8, 29, 13);
+ Menu_EraseWindowRect(23, 8, 29, 13);
GetMonNickname(ewram1C000.pokemon, gStringVar1);
StringCopy(gStringVar2, gMoveNames[ewram1C000.unk8]);
StringExpandPlaceholders(gStringVar4, gOtherText_DidNotLearnMove2);
@@ -4241,7 +4241,7 @@ void StopTryingToTeachMove_806F6B4(u8 taskId)
return;
if (selection == -1)
PlaySE(SE_SELECT);
- MenuZeroFillWindowRect(23, 8, 29, 13);
+ Menu_EraseWindowRect(23, 8, 29, 13);
GetMonNickname(ewram1C000.pokemon, gStringVar1);
StringCopy(gStringVar2, gMoveNames[ewram1C000.unk8]);
StringExpandPlaceholders(gStringVar4, gOtherText_WantsToLearn);
@@ -4592,7 +4592,7 @@ void sub_8070088(u8 taskId)
else
{
gUnknown_0202E8F4 = 1;
- MenuZeroFillWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19);
+ Menu_EraseWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19);
PlaySE(SE_KAIFUKU);
PartyMenuUpdateLevelOrStatus(ewram1C000.pokemon, ewram1C000.unk5);
task_pc_turn_off(&gUnknown_083769A8[IsDoubleBattle() * 12 + ewram1C000.unk5 * 2], 9);
@@ -4649,12 +4649,12 @@ void CreateItemUseMoveMenu(u8 partyMonIndex)
u8 i;
r6 = 0;
- MenuDrawTextWindow(19, 10, 29, 19);
+ Menu_DrawStdWindowFrame(19, 10, 29, 19);
for (i = 0; i < 4; i++)
{
u16 move = GetMonData(&gPlayerParty[partyMonIndex], MON_DATA_MOVE1 + i);
- MenuPrint(gMoveNames[move], 20, i * 2 + 11);
+ Menu_PrintText(gMoveNames[move], 20, i * 2 + 11);
if (move != 0)
r6++;
}
@@ -4666,12 +4666,12 @@ void Task_HandleItemUseMoveMenuInput(u8 taskId)
if (gMain.newKeys & DPAD_UP)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(-1);
+ Menu_MoveCursor(-1);
}
else if (gMain.newKeys & DPAD_DOWN)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(1);
+ Menu_MoveCursor(1);
}
else if (gMain.newKeys & A_BUTTON)
{
@@ -4714,16 +4714,16 @@ void DoPPRecoveryItemEffect(u8 taskId, u16 item, TaskFunc c)
void ItemUseMoveMenu_HandleMoveSelection(u8 taskId)
{
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(19, 10, 29, 19);
+ Menu_EraseWindowRect(19, 10, 29, 19);
sub_806D5A4();
- gTasks[taskId].data[11] = GetMenuCursorPos();
+ gTasks[taskId].data[11] = Menu_GetCursorPos();
DoRecoverPP(taskId);
}
void ItemUseMoveMenu_HandleCancel(u8 taskId)
{
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(19, 10, 29, 19);
+ Menu_EraseWindowRect(19, 10, 29, 19);
if (gMain.inBattle)
gTasks[ewram1C000.unk4].func = HandleBattlePartyMenu;
else
@@ -4852,7 +4852,7 @@ void PrintStatGrowthsInLevelUpWindow(u8 taskId)
{
u8 i;
- MenuDrawTextWindow(11, 0, 29, 7);
+ Menu_DrawStdWindowFrame(11, 0, 29, 7);
for (i = 0; i < NUM_STATS; i++)
{
@@ -4897,7 +4897,7 @@ void PrintStatGrowthsInLevelUpWindow(u8 taskId) {
movs r1, 0\n\
movs r2, 0x1D\n\
movs r3, 0x7\n\
- bl MenuDrawTextWindow\n\
+ bl Menu_DrawStdWindowFrame\n\
movs r7, 0\n\
ldr r0, _0807092C @ =gStringVar1\n\
mov r10, r0\n\
@@ -4981,7 +4981,7 @@ _0807086C:\n\
mov r0, r10\n\
adds r1, r4, 0\n\
adds r2, r5, 0\n\
- bl MenuPrint\n\
+ bl Menu_PrintText\n\
adds r0, r7, 0x1\n\
lsls r0, 24\n\
lsrs r7, r0, 24\n\
@@ -5070,7 +5070,7 @@ void Task_RareCandy3(u8 taskId)
u16 learnedMove;
u16 evolutionSpecies;
- MenuZeroFillWindowRect(11, 0, 29, 7);
+ Menu_EraseWindowRect(11, 0, 29, 7);
learnedMove = MonTryLearningNewMove(ewram1C000.pokemon, TRUE);
ewram1B000.unk282 = 1;
diff --git a/src/field/player_pc.c b/src/field/player_pc.c
index 928cb9689..7cbb20bad 100644
--- a/src/field/player_pc.c
+++ b/src/field/player_pc.c
@@ -217,7 +217,7 @@ void PlayerPC(void)
static void InitPlayerPCMenu(u8 taskId)
{
- MenuDrawTextWindow(0, 0, 10, gPcItemMenuOptionsNum * 2 + 1);
+ Menu_DrawStdWindowFrame(0, 0, 10, gPcItemMenuOptionsNum * 2 + 1);
PrintMenuItemsReordered(1, 1, gPcItemMenuOptionsNum, sPlayerPCMenuActions, gPcItemMenuOptionOrder);
InitMenu(0, 1, 1, gPcItemMenuOptionsNum, 0, 9);
TASK.FUNC = PlayerPCProcessMenuInput;
@@ -228,18 +228,18 @@ static void PlayerPCProcessMenuInput(u8 taskId)
if (gMain.newAndRepeatedKeys & DPAD_UP)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(-1);
+ Menu_MoveCursor(-1);
}
else if (gMain.newAndRepeatedKeys & DPAD_DOWN)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(1);
+ Menu_MoveCursor(1);
}
else if (gMain.newKeys & A_BUTTON)
{
HandleDestroyMenuCursors();
PlaySE(SE_SELECT);
- sPlayerPCMenuActions[gPcItemMenuOptionOrder[GetMenuCursorPos()]].func(taskId);
+ sPlayerPCMenuActions[gPcItemMenuOptionOrder[Menu_GetCursorPos()]].func(taskId);
}
else if (gMain.newKeys & B_BUTTON)
{
@@ -262,7 +262,7 @@ static void PlayerPC_ItemStorage(u8 taskId)
static void PlayerPC_Mailbox(u8 taskId)
{
- MenuZeroFillWindowRect(0, 0, 10, 9);
+ Menu_EraseWindowRect(0, 0, 10, 9);
eMailboxInfo.count = GetMailboxMailCount();
if (eMailboxInfo.count == 0)
@@ -280,7 +280,7 @@ static void PlayerPC_Mailbox(u8 taskId)
static void PlayerPC_Decoration(u8 var)
{
- MenuZeroFillWindowRect(0, 0, 10, 9);
+ Menu_EraseWindowRect(0, 0, 10, 9);
DoPlayerPCDecoration(var);
}
@@ -288,7 +288,7 @@ static void PlayerPC_TurnOff(u8 taskId)
{
if (gPcItemMenuOptionsNum == 4) // if the option count is 4, we are at the bedroom PC and not player PC, so do gender specific handling.
{
- MenuZeroFillWindowRect(0, 0, 0x1D, 0x13);
+ Menu_EraseWindowRect(0, 0, 0x1D, 0x13);
if (gSaveBlock2.playerGender == MALE)
ScriptContext1_SetupScript(gBrendanHouse_TurnPCOff);
@@ -297,7 +297,7 @@ static void PlayerPC_TurnOff(u8 taskId)
}
else
{
- MenuZeroFillWindowRect(0, 0, 10, 9);
+ Menu_EraseWindowRect(0, 0, 10, 9);
EnableBothScriptContexts();
}
DestroyTask(taskId);
@@ -305,8 +305,8 @@ static void PlayerPC_TurnOff(u8 taskId)
static void InitItemStorageMenu(u8 var)
{
- MenuZeroFillWindowRect(0, 0, 10, 9);
- MenuDrawTextWindow(0, 0, 11, 9);
+ Menu_EraseWindowRect(0, 0, 10, 9);
+ Menu_DrawStdWindowFrame(0, 0, 11, 9);
PrintMenuItems(1, 1, 4, (struct MenuAction *)gPCText_ItemPCOptionsText);
InitMenu(0, 1, 1, 4, var, 10);
ItemStorageMenuPrint(gPCText_OptionDescList[var]);
@@ -314,8 +314,8 @@ static void InitItemStorageMenu(u8 var)
static void ItemStorageMenuPrint(const u8 *textPtr)
{
- MenuFillWindowRectWithBlankTile(2, 15, 27, 18);
- MenuPrint(textPtr, 2, 15);
+ Menu_BlankWindowRect(2, 15, 27, 18);
+ Menu_PrintText(textPtr, 2, 15);
}
static void ItemStorageMenuProcessInput(u8 var)
@@ -323,19 +323,19 @@ static void ItemStorageMenuProcessInput(u8 var)
if (gMain.newAndRepeatedKeys & DPAD_UP)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(-1);
- ItemStorageMenuPrint(gPCText_OptionDescList[GetMenuCursorPos()]);
+ Menu_MoveCursor(-1);
+ ItemStorageMenuPrint(gPCText_OptionDescList[Menu_GetCursorPos()]);
}
else if (gMain.newAndRepeatedKeys & DPAD_DOWN)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(1);
- ItemStorageMenuPrint(gPCText_OptionDescList[GetMenuCursorPos()]);
+ Menu_MoveCursor(1);
+ ItemStorageMenuPrint(gPCText_OptionDescList[Menu_GetCursorPos()]);
}
else if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
- gPCText_ItemPCOptionsText[GetMenuCursorPos()].func(var);
+ gPCText_ItemPCOptionsText[Menu_GetCursorPos()].func(var);
}
else if (gMain.newKeys & B_BUTTON)
{
@@ -368,7 +368,7 @@ static void ItemStorage_HandleReturnToProcessInput(u8 taskId)
void ItemStorage_ReturnToMenuAfterDeposit(void)
{
- MenuDisplayMessageBox();
+ Menu_DisplayDialogueFrame();
InitItemStorageMenu(ITEMPC_MENU_DEPOSIT);
CreateTask(ItemStorage_HandleReturnToProcessInput, 0);
pal_fill_black();
@@ -379,12 +379,12 @@ static void ItemStorage_Withdraw(u8 taskId)
s16 *data = TASK.data;
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(0, 0, 11, 9);
+ Menu_EraseWindowRect(0, 0, 11, 9);
NUM_ITEMS = CountUsedPCItemSlots();
if (NUM_ITEMS != 0)
{
- MenuZeroFillWindowRect(0, 14, 29, 19);
+ Menu_EraseWindowRect(0, 14, 29, 19);
CURRENT_ITEM_STORAGE_MENU = ITEMPC_MENU_WITHDRAW;
PAGE_INDEX = 0;
ITEMS_ABOVE_TOP = 0;
@@ -401,12 +401,12 @@ static void ItemStorage_Toss(u8 taskId)
s16 *data = TASK.data;
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(0, 0, 11, 9);
+ Menu_EraseWindowRect(0, 0, 11, 9);
NUM_ITEMS = CountUsedPCItemSlots();
if (NUM_ITEMS)
{
- MenuZeroFillWindowRect(0, 14, 29, 19);
+ Menu_EraseWindowRect(0, 14, 29, 19);
CURRENT_ITEM_STORAGE_MENU = ITEMPC_MENU_TOSS;
PAGE_INDEX = 0;
ITEMS_ABOVE_TOP = 0;
@@ -421,7 +421,7 @@ static void ItemStorage_Toss(u8 taskId)
static void ItemStorage_Exit(u8 var)
{
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(0, 0, 11, 9);
+ Menu_EraseWindowRect(0, 0, 11, 9);
ReshowPlayerPC(var);
}
@@ -450,7 +450,7 @@ static void ItemStorage_ProcessInput(u8 taskId)
if(PAGE_INDEX != 0) // did the cursor move physically upwards?
{
PlaySE(SE_SELECT);
- PAGE_INDEX = MoveMenuCursor(-1);
+ PAGE_INDEX = Menu_MoveCursor(-1);
trueIndex = ITEMS_ABOVE_TOP + PAGE_INDEX;
if (SWITCH_MODE_ACTIVE == FALSE) // are we not currently switching items?
{
@@ -474,7 +474,7 @@ static void ItemStorage_ProcessInput(u8 taskId)
ItemStorage_DrawBothListAndDescription(taskId);
if (SWITCH_MODE_ACTIVE != FALSE)
- MoveMenuCursor(0); // don't move the cursor. it's at the top of the page index, but not the true index.
+ Menu_MoveCursor(0); // don't move the cursor. it's at the top of the page index, but not the true index.
}
}
else if(gMain.newAndRepeatedKeys & DPAD_DOWN) // _0813A306
@@ -482,7 +482,7 @@ static void ItemStorage_ProcessInput(u8 taskId)
if(PAGE_INDEX != NUM_PAGE_ITEMS - 1)
{
PlaySE(SE_SELECT);
- PAGE_INDEX = MoveMenuCursor(1);
+ PAGE_INDEX = Menu_MoveCursor(1);
trueIndex = ITEMS_ABOVE_TOP + PAGE_INDEX;
if(SWITCH_MODE_ACTIVE != FALSE)
@@ -500,7 +500,7 @@ static void ItemStorage_ProcessInput(u8 taskId)
ItemStorage_DrawBothListAndDescription(taskId);
if (SWITCH_MODE_ACTIVE != FALSE)
- MoveMenuCursor(0);
+ Menu_MoveCursor(0);
}
}
else if(gMain.newKeys & SELECT_BUTTON) // _0813A3A0
@@ -565,8 +565,8 @@ static void ItemStorage_GoBackToPlayerPCMenu(u8 taskId)
BuyMenuFreeMemory();
DestroyVerticalScrollIndicator(0);
DestroyVerticalScrollIndicator(1);
- MenuZeroFillWindowRect(0, 0, 29, 19);
- MenuDisplayMessageBox();
+ Menu_EraseWindowRect(0, 0, 29, 19);
+ Menu_DisplayDialogueFrame();
InitItemStorageMenu(TASK.CURRENT_ITEM_STORAGE_MENU);
TASK.FUNC = ItemStorageMenuProcessInput;
}
@@ -603,7 +603,7 @@ static void ItemStorage_DoItemAction(u8 taskId)
ItemStorage_PrintItemPcResponse(ITEMPC_HOW_MANY_TO_TOSS);
}
NUM_QUANTITY_ROLLER = 1;
- MenuDrawTextWindow(6, 8, 13, 11);
+ Menu_DrawStdWindowFrame(6, 8, 13, 11);
sub_80A418C(NUM_QUANTITY_ROLLER, STR_CONV_MODE_RIGHT_ALIGN, 8, 9, 3);
TASK.FUNC = ItemStorage_HandleQuantityRolling;
}
@@ -652,7 +652,7 @@ static void ItemStorage_HandleQuantityRolling(u8 taskId)
else if(gMain.newKeys & A_BUTTON) // confirm quantity.
{
PlaySE(SE_SELECT);
- MenuZeroFillWindowRect(6, 6, 0xD, 0xB);
+ Menu_EraseWindowRect(6, 6, 0xD, 0xB);
if(CURRENT_ITEM_STORAGE_MENU == ITEMPC_MENU_WITHDRAW)
ItemStorage_DoItemWithdraw(taskId);
@@ -662,7 +662,7 @@ static void ItemStorage_HandleQuantityRolling(u8 taskId)
else if(gMain.newKeys & B_BUTTON) // cancel quantity.
{
PlaySE(SE_SELECT);
- MenuZeroFillWindowRect(6, 6, 0xD, 0xB);
+ Menu_EraseWindowRect(6, 6, 0xD, 0xB);
StartVerticalScrollIndicators(0);
StartVerticalScrollIndicators(1);
ItemStorage_PrintItemPcResponse(gSaveBlock1.pcItems[ITEMS_ABOVE_TOP + PAGE_INDEX].itemId); // why not use trueIndex?
@@ -713,7 +713,7 @@ static void ItemStorage_DoItemToss(u8 taskId)
static void ItemStorage_ResumeInputFromYesToss(u8 taskId)
{
- MenuZeroFillWindowRect(0x6, 0x6, 0xD, 0xB);
+ Menu_EraseWindowRect(0x6, 0x6, 0xD, 0xB);
ItemStorage_PrintItemPcResponse(ITEMPC_THREW_AWAY_ITEM);
TASK.FUNC = ItemStorage_HandleRemoveItem;
}
@@ -722,7 +722,7 @@ static void ItemStorage_ResumeInputFromNoToss(u8 taskId)
{
s16 *data = TASK.data;
- MenuZeroFillWindowRect(0x6, 0x6, 0xD, 0xB);
+ Menu_EraseWindowRect(0x6, 0x6, 0xD, 0xB);
InitMenu(0, 16, 2, NUM_PAGE_ITEMS, PAGE_INDEX, 0xD);
StartVerticalScrollIndicators(0);
StartVerticalScrollIndicators(1);
@@ -765,7 +765,7 @@ static void ItemStorage_WaitPressHandleResumeProcessInput(u8 taskId)
static void ItemStorage_HandleResumeProcessInput(u8 taskId)
{
- MenuZeroFillWindowRect(0x6, 0x6, 0xD, 0xB);
+ Menu_EraseWindowRect(0x6, 0x6, 0xD, 0xB);
StartVerticalScrollIndicators(0);
StartVerticalScrollIndicators(1);
ItemStorage_DrawBothListAndDescription(taskId);
@@ -817,14 +817,14 @@ static void ItemStorage_DrawItemQuantity(u16 arg1, enum StringConvertMode arg2,
sub_80A4164(gStringVar1, arg1, arg2, arg4);
if(isSwapSelected != FALSE)
- MenuPrint(gSelectedItemQuantityFormatText, 0x1A, arg3);
+ Menu_PrintText(gSelectedItemQuantityFormatText, 0x1A, arg3);
else
- MenuPrint(gNonSelectedItemQuantityFormatText, 0x1A, arg3);
+ Menu_PrintText(gNonSelectedItemQuantityFormatText, 0x1A, arg3);
}
static void ItemStorage_DrawItemVoidQuantity(u8 var)
{
- MenuPrint(gUnknown_08406330, 0x19, var);
+ Menu_PrintText(gUnknown_08406330, 0x19, var);
}
static void ItemStorage_DrawItemName(struct ItemSlot *itemSlot, u8 var, int isSwapSelected)
@@ -832,9 +832,9 @@ static void ItemStorage_DrawItemName(struct ItemSlot *itemSlot, u8 var, int isSw
CopyItemName(itemSlot->itemId, gStringVar1);
if(isSwapSelected != FALSE)
- MenuPrint(gSelectedItemFormattedText, 16, var);
+ Menu_PrintText(gSelectedItemFormattedText, 16, var);
else
- MenuPrint(gNonSelectedItemFormattedText, 16, var);
+ Menu_PrintText(gNonSelectedItemFormattedText, 16, var);
}
static void ItemStorage_DrawNormalItemEntry(struct ItemSlot *itemSlot, u8 var, int var2)
@@ -900,7 +900,7 @@ static void ItemStorage_DrawItemList(u8 taskId)
}
if (i - ITEMS_ABOVE_TOP < 8)
- MenuFillWindowRectWithBlankTile(16, yCoord + 4, 0x1C, 0x12);
+ Menu_BlankWindowRect(16, yCoord + 4, 0x1C, 0x12);
if (ITEMS_ABOVE_TOP != 0)
CreateVerticalScrollIndicators(0, 0xB8, 8);
@@ -977,11 +977,11 @@ static void ItemStorage_GoBackToItemPCMenu(u8 taskId, u8 var)
sub_80F944C();
LoadScrollIndicatorPalette();
ItemStorage_LoadPalette();
- MenuDrawTextWindow(0xF, 0, 0x1D, 0x13);
- MenuDrawTextWindow(0, 0xC, 0xE, 0x13);
- MenuDrawTextWindow(0, 0, 0xB, 3);
+ Menu_DrawStdWindowFrame(0xF, 0, 0x1D, 0x13);
+ Menu_DrawStdWindowFrame(0, 0xC, 0xE, 0x13);
+ Menu_DrawStdWindowFrame(0, 0, 0xB, 3);
ItemStorage_PrintItemPcResponse(gSaveBlock1.pcItems[0].itemId);
- MenuPrint(gPCText_ItemPCOptionsText[var].text, 1, 1);
+ Menu_PrintText(gPCText_ItemPCOptionsText[var].text, 1, 1);
ItemStorage_DrawItemList(taskId);
InitMenu(0, 0x10, 2, NUM_PAGE_ITEMS, PAGE_INDEX, 0xD);
}
@@ -1037,22 +1037,22 @@ static void Mailbox_DrawMailList(u8 taskId) // taskId is unused
for (i = eMailboxInfo.itemsAbove; i < eMailboxInfo.itemsAbove + eMailboxInfo.pageItems; i++)
{
yCoord = (i - eMailboxInfo.itemsAbove) * 2;
- MenuFillWindowRectWithBlankTile(0x15, yCoord + 2, 0x1C, yCoord + 3);
+ Menu_BlankWindowRect(0x15, yCoord + 2, 0x1C, yCoord + 3);
if (i == eMailboxInfo.count)
{
- MenuPrint(gOtherText_CancelNoTerminator, 0x15, yCoord + 2);
+ Menu_PrintText(gOtherText_CancelNoTerminator, 0x15, yCoord + 2);
break;
}
else
{
StringCopy(gStringVar1, gSaveBlock1.mail[i + 6].playerName);
SanitizeNameString(gStringVar1);
- MenuPrint(gStringVar1, 0x15, yCoord + 2);
+ Menu_PrintText(gStringVar1, 0x15, yCoord + 2);
}
}
if (i - eMailboxInfo.itemsAbove != 8)
- MenuFillWindowRectWithBlankTile(0x15, yCoord + 4, 0x1C, 0x12);
+ Menu_BlankWindowRect(0x15, yCoord + 4, 0x1C, 0x12);
if (eMailboxInfo.itemsAbove != 0)
CreateVerticalScrollIndicators(0, 0xC8, 8);
@@ -1069,10 +1069,10 @@ static void Mailbox_DrawMailboxMenu(u8 taskId)
{
sub_80F944C();
LoadScrollIndicatorPalette();
- MenuZeroFillWindowRect(0, 0, 0x1D, 0x13);
- MenuDrawTextWindow(0, 0, 0x8, 0x3);
- MenuPrint(gPCText_Mailbox, 1, 1);
- MenuDrawTextWindow(0x14, 0, 0x1D, 0x13);
+ Menu_EraseWindowRect(0, 0, 0x1D, 0x13);
+ Menu_DrawStdWindowFrame(0, 0, 0x8, 0x3);
+ Menu_PrintText(gPCText_Mailbox, 1, 1);
+ Menu_DrawStdWindowFrame(0x14, 0, 0x1D, 0x13);
Mailbox_DrawMailList(taskId);
InitMenu(0, 0x15, 2, eMailboxInfo.pageItems, eMailboxInfo.cursorPos, 8);
}
@@ -1087,7 +1087,7 @@ static void Mailbox_ProcessInput(u8 taskId)
if(eMailboxInfo.cursorPos != 0)
{
PlaySE(SE_SELECT);
- eMailboxInfo.cursorPos = MoveMenuCursor(-1);
+ eMailboxInfo.cursorPos = Menu_MoveCursor(-1);
}
else if(eMailboxInfo.itemsAbove != 0)
{
@@ -1101,7 +1101,7 @@ static void Mailbox_ProcessInput(u8 taskId)
if(eMailboxInfo.cursorPos != eMailboxInfo.pageItems - 1)
{
PlaySE(SE_SELECT);
- eMailboxInfo.cursorPos = MoveMenuCursor(1);
+ eMailboxInfo.cursorPos = Menu_MoveCursor(1);
}
else if(eMailboxInfo.itemsAbove + eMailboxInfo.cursorPos != eMailboxInfo.count)
{
@@ -1143,7 +1143,7 @@ static void Mailbox_CloseScrollIndicators(void)
static void Mailbox_PrintWhatToDoWithPlayerMailText(u8 taskId)
{
- MenuZeroFillWindowRect(0, 0, 0x1D, 0x13);
+ Menu_EraseWindowRect(0, 0, 0x1D, 0x13);
StringCopy(gStringVar1, gSaveBlock1.mail[eMailboxInfo.itemsAbove + 6 + eMailboxInfo.cursorPos].playerName);
SanitizeNameString(gStringVar1);
StringExpandPlaceholders(gStringVar4, gOtherText_WhatWillYouDoMail);
@@ -1152,7 +1152,7 @@ static void Mailbox_PrintWhatToDoWithPlayerMailText(u8 taskId)
static void Mailbox_ReturnToPlayerPC(u8 taskId)
{
- MenuZeroFillWindowRect(0, 0, 0x1D, 0x13);
+ Menu_EraseWindowRect(0, 0, 0x1D, 0x13);
ReshowPlayerPC(taskId);
}
@@ -1164,7 +1164,7 @@ static void Mailbox_TurnOff(u8 taskId)
static void Mailbox_PrintMailOptions(u8 taskId) // Mailbox_PrintMailOptions
{
- MenuDrawTextWindow(0, 0, 0xC, 0x9);
+ Menu_DrawStdWindowFrame(0, 0, 0xC, 0x9);
PrintMenuItems(1, 1, 4, (struct MenuAction *)gMailboxMailOptions);
InitMenu(0, 1, 1, 4, 0, 0xB);
TASK.FUNC = Mailbox_MailOptionsProcessInput;
@@ -1175,17 +1175,17 @@ static void Mailbox_MailOptionsProcessInput(u8 taskId)
if(gMain.newAndRepeatedKeys & DPAD_UP)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(-1);
+ Menu_MoveCursor(-1);
}
else if(gMain.newAndRepeatedKeys & DPAD_DOWN)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(1);
+ Menu_MoveCursor(1);
}
else if(gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
- gMailboxMailOptions[GetMenuCursorPos()].func(taskId);
+ gMailboxMailOptions[Menu_GetCursorPos()].func(taskId);
}
else if(gMain.newKeys & B_BUTTON)
{
@@ -1233,7 +1233,7 @@ static void Mailbox_MoveToBag(u8 taskId)
{
HandleDestroyMenuCursors();
StringCopy(gStringVar1, gOtherText_MoveToBag);
- MenuPrint(gHighlightedMoveToBagFormatText, 1, 3); // gHighlightedMoveToBagFormatText
+ Menu_PrintText(gHighlightedMoveToBagFormatText, 1, 3); // gHighlightedMoveToBagFormatText
DisplayItemMessageOnField(taskId, gOtherText_MessageWillBeLost, Mailbox_DrawYesNoBeforeMove, 0);
}
@@ -1247,7 +1247,7 @@ static void Mailbox_DoMailMoveToBag(u8 taskId)
{
struct MailStruct *mail = &gSaveBlock1.mail[eMailboxInfo.itemsAbove + 6 + eMailboxInfo.cursorPos];
- MenuZeroFillWindowRect(0x14, 8, 0x1A, 0xD);
+ Menu_EraseWindowRect(0x14, 8, 0x1A, 0xD);
if(AddBagItem(mail->itemId, 1) == FALSE)
{
@@ -1270,7 +1270,7 @@ static void Mailbox_DoMailMoveToBag(u8 taskId)
static void Mailbox_ReturnToInputAfterNo(u8 taskId) // Mailbox_ReturnToInputAfterNo
{
- MenuZeroFillWindowRect(0x14, 0x8, 0x1A, 0xD);
+ Menu_EraseWindowRect(0x14, 0x8, 0x1A, 0xD);
Mailbox_DrawMailMenuAndDoProcessInput(taskId);
}
@@ -1326,7 +1326,7 @@ static void Mailbox_NoPokemonForMail(u8 taskId)
static void Mailbox_Cancel(u8 taskId)
{
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(0, 0, 0xC, 0x9);
+ Menu_EraseWindowRect(0, 0, 0xC, 0x9);
Mailbox_DrawMailMenuAndDoProcessInput(taskId);
}
diff --git a/src/field/pokeblock.c b/src/field/pokeblock.c
index 640d4731f..3ca359ef7 100644
--- a/src/field/pokeblock.c
+++ b/src/field/pokeblock.c
@@ -452,11 +452,11 @@ static void sub_810BB0C(void)
static void sub_810BB30(void)
{
BasicInitMenuWindow(&gWindowConfig_81E6E34);
- MenuPrint(gContestStatsText_Spicy, 2, 13);
- MenuPrint(gContestStatsText_Dry, 2, 15);
- MenuPrint(gContestStatsText_Sweet, 2, 17);
- MenuPrint(gContestStatsText_Bitter, 8, 13);
- MenuPrint(gContestStatsText_Sour, 8, 15);
+ Menu_PrintText(gContestStatsText_Spicy, 2, 13);
+ Menu_PrintText(gContestStatsText_Dry, 2, 15);
+ Menu_PrintText(gContestStatsText_Sweet, 2, 17);
+ Menu_PrintText(gContestStatsText_Bitter, 8, 13);
+ Menu_PrintText(gContestStatsText_Sour, 8, 15);
}
static void sub_810BB88(u8 a0)
@@ -471,10 +471,10 @@ static void sub_810BB88(u8 a0)
if (i == gUnknown_02039248.unk2)
{
buf = sub_8072C74(gStringVar1, gContestStatsText_StowCase, 0x78, 0);
- MenuPrint(gStringVar1, 15, y + 1);
+ Menu_PrintText(gStringVar1, 15, y + 1);
if (i != a0 + 8)
{
- MenuZeroFillWindowRect(15, y + 3, 29, 18);
+ Menu_EraseWindowRect(15, y + 3, 29, 18);
}
break;
}
@@ -484,7 +484,7 @@ static void sub_810BB88(u8 a0)
buf[2] = 0x06;
buf += 3;
ConvertIntToDecimalStringN(buf, sub_810C9B0(&gSaveBlock1.pokeblocks[i]), STR_CONV_MODE_RIGHT_ALIGN, 3);
- MenuPrint(gStringVar1, 15, y + 1);
+ Menu_PrintText(gStringVar1, 15, y + 1);
}
}
@@ -600,11 +600,11 @@ static void sub_810BDAC(bool8 flag)
if (gUnknown_02039248.unk0 + gUnknown_02039248.unk1 != gUnknown_02039248.unk2)
{
sub_8072C14(gStringVar1, sub_810C9E8(&gSaveBlock1.pokeblocks[gUnknown_02039248.unk0 + gUnknown_02039248.unk1]), 16, 1);
- MenuPrint(gStringVar1, 11, 17);
+ Menu_PrintText(gStringVar1, 11, 17);
}
else
{
- MenuZeroFillWindowRect(11, 17, 12, 18);
+ Menu_EraseWindowRect(11, 17, 12, 18);
}
}
@@ -813,7 +813,7 @@ static void sub_810C368(u8 taskId)
sub_80F98A4(0);
sub_80F98A4(1);
BasicInitMenuWindow(&gWindowConfig_81E6E50);
- MenuDrawTextWindow(7, v0 + 4, 13, 11);
+ Menu_DrawStdWindowFrame(7, v0 + 4, 13, 11);
PrintMenuItemsReordered(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;
@@ -824,24 +824,24 @@ static void sub_810C40C(u8 taskId)
{
if (gMain.newAndRepeatedKeys & DPAD_UP)
{
- if (GetMenuCursorPos())
+ if (Menu_GetCursorPos())
{
PlaySE(SE_SELECT);
- MoveMenuCursor(-1);
+ Menu_MoveCursor(-1);
}
}
else if (gMain.newAndRepeatedKeys & DPAD_DOWN)
{
- if (GetMenuCursorPos() != gUnknown_0203924C - 1)
+ if (Menu_GetCursorPos() != gUnknown_0203924C - 1)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(+1);
+ Menu_MoveCursor(+1);
}
}
else if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
- gUnknown_083F7EF4[gUnknown_03000758[GetMenuCursorPos()]].func(taskId);
+ gUnknown_083F7EF4[gUnknown_03000758[Menu_GetCursorPos()]].func(taskId);
}
else if (gMain.newKeys & B_BUTTON)
{
@@ -870,7 +870,7 @@ static void sub_810C540(u8 taskId)
{
BasicInitMenuWindow(&gWindowConfig_81E6E50);
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(7, 4, 13, 11);
+ Menu_EraseWindowRect(7, 4, 13, 11);
StringCopy(gStringVar1, gPokeblockNames[gSaveBlock1.pokeblocks[gUnknown_02039248.unk0 + gUnknown_02039248.unk1].color]);
StringExpandPlaceholders(gStringVar4, gContestStatsText_ThrowAwayPrompt);
DisplayItemMessageOnField(taskId, gStringVar4, sub_810C5EC, 0);
@@ -890,7 +890,7 @@ static void sub_810C5EC(u8 taskId)
static void sub_810C610(u8 taskId)
{
- MenuZeroFillWindowRect(7, 6, 13, 11);
+ Menu_EraseWindowRect(7, 6, 13, 11);
PokeblockClearIfExists((gUnknown_02039248.unk0 + gUnknown_02039248.unk1));
StringExpandPlaceholders(gStringVar4, gContestStatsText_WasThrownAway);
DisplayItemMessageOnField(taskId, gStringVar4, sub_810C704, 0);
@@ -907,8 +907,8 @@ static void sub_810C668(u8 taskId)
sub_80F979C(1, 0);
}
BasicInitMenuWindow(&gWindowConfig_81E6E50);
- MenuZeroFillWindowRect(7, 6, 13, 11);
- MenuZeroFillWindowRect(0, 14, 29, 19);
+ Menu_EraseWindowRect(7, 6, 13, 11);
+ Menu_EraseWindowRect(0, 14, 29, 19);
gTasks[taskId].func = sub_810BF7C;
}
@@ -933,7 +933,7 @@ static void sub_810C748(u8 taskId)
StartVerticalScrollIndicators(0);
StartVerticalScrollIndicators(1);
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(7, 4, 13, 11);
+ 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 07e77e389..1eb57b803 100644
--- a/src/field/region_map.c
+++ b/src/field/region_map.c
@@ -1544,7 +1544,7 @@ void CB2_InitFlyRegionMap(void)
break;
case 2:
InitMenuWindow(&gWindowConfig_81E7224);
- MenuZeroFillScreen();
+ Menu_EraseScreen();
break;
case 3:
InitRegionMap(&ewram0_3.regionMap, 0);
@@ -1619,8 +1619,8 @@ static void PrintFlyTargetName(void)
{
if (FlagGet(r4->flag))
{
- MenuDrawTextWindow(16, 14, 29, 19);
- MenuPrint(ewram0_3.regionMap.mapSectionName, 17, 15);
+ Menu_DrawStdWindowFrame(16, 14, 29, 19);
+ Menu_PrintText(ewram0_3.regionMap.mapSectionName, 17, 15);
MenuPrint_RightAligned(r4->unk0[ewram0_3.regionMap.everGrandeCityArea], 29, 17);
return;
}
@@ -1631,16 +1631,16 @@ static void PrintFlyTargetName(void)
asm("mov %0, #0\n":"=r"(zero)); // zero = 0
if (zero == 0)
{
- MenuDrawTextWindow(16, 16, 29, 19);
- MenuPrint(ewram0_3.regionMap.mapSectionName, 17, 17);
- MenuZeroFillWindowRect(16, 14, 29, 15);
+ Menu_DrawStdWindowFrame(16, 16, 29, 19);
+ Menu_PrintText(ewram0_3.regionMap.mapSectionName, 17, 17);
+ Menu_EraseWindowRect(16, 14, 29, 15);
}
}
else
{
- MenuDrawTextWindow(16, 16, 29, 19);
- MenuPrint(ewramBlankMapName, 17, 17);
- MenuZeroFillWindowRect(16, 14, 29, 15);
+ Menu_DrawStdWindowFrame(16, 16, 29, 19);
+ Menu_PrintText(ewramBlankMapName, 17, 17);
+ Menu_EraseWindowRect(16, 14, 29, 15);
}
}
diff --git a/src/field/scrcmd.c b/src/field/scrcmd.c
index 05a909e81..e795fd8ed 100644
--- a/src/field/scrcmd.c
+++ b/src/field/scrcmd.c
@@ -1333,7 +1333,7 @@ bool8 ScrCmd_drawbox(struct ScriptContext *ctx)
u8 right = ScriptReadByte(ctx);
u8 bottom = ScriptReadByte(ctx);
- MenuDrawTextWindow(left, top, right, bottom);
+ Menu_DrawStdWindowFrame(left, top, right, bottom);
return FALSE;
}
@@ -1363,7 +1363,7 @@ bool8 ScrCmd_erasebox(struct ScriptContext *ctx)
u8 right = ScriptReadByte(ctx);
u8 bottom = ScriptReadByte(ctx);
- MenuZeroFillWindowRect(left, top, right, bottom);
+ Menu_EraseWindowRect(left, top, right, bottom);
return FALSE;
}
@@ -1428,8 +1428,8 @@ bool8 ScrCmd_braillemessage(struct ScriptContext *ctx)
u8 v6 = ptr[4];
u8 v7 = ptr[5];
StringBraille(gStringVar4, ptr + 6);
- MenuDrawTextWindow(v2, v3, v4, v5);
- MenuPrint(gStringVar4, v6, v7);
+ Menu_DrawStdWindowFrame(v2, v3, v4, v5);
+ Menu_PrintText(gStringVar4, v6, v7);
return FALSE;
}
diff --git a/src/field/script_menu.c b/src/field/script_menu.c
index 9f3ab75cc..bf6e93e41 100644
--- a/src/field/script_menu.c
+++ b/src/field/script_menu.c
@@ -622,7 +622,7 @@ bool8 ScriptMenu_MultichoiceWithDefault(u8 left, u8 top, u8 multichoiceId, u8 ig
static u16 GetStringWidthInTilesForScriptMenu(const u8 *str)
{
// each tile on screen is 8x8, so it needs the number of tiles and not pixels, hence the division by 8.
- return (GetStringWidthGivenWindowConfig((struct WindowConfig *)&gWindowConfig_81E6CE4, str) + 7) / 8;
+ return (Text_GetStringWidthFromWindowTemplate((struct WindowTemplate *)&gWindowConfig_81E6CE4, str) + 7) / 8;
}
static void DrawMultichoiceMenu(u8 left, u8 top, u8 count, const struct MenuAction *list, u8 ignoreBPress, u8 cursorPos)
@@ -651,7 +651,7 @@ static void DrawMultichoiceMenu(u8 left, u8 top, u8 count, const struct MenuActi
bottom = top + (2 * count + 1);
- MenuDrawTextWindow(left, top, right, bottom);
+ Menu_DrawStdWindowFrame(left, top, right, bottom);
PrintMenuItems(left + 1, top + 1, count, list);
InitMenu(0, left + 1, top + 1, count, cursorPos, right - left - 1);
StartScriptMenuTask(left, top, right, bottom, ignoreBPress, count);
@@ -687,9 +687,9 @@ static void Task_HandleMultichoiceInput(u8 taskId)
if (!gPaletteFade.active)
{
if (!gTasks[taskId].tDoWrap)
- selection = ProcessMenuInputNoWrap();
+ selection = Menu_ProcessInputNoWrap();
else
- selection = ProcessMenuInput();
+ selection = Menu_ProcessInput();
if (selection != -2)
{
@@ -705,7 +705,7 @@ static void Task_HandleMultichoiceInput(u8 taskId)
gSpecialVar_Result = selection;
}
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(gTasks[taskId].tLeft, gTasks[taskId].tTop, gTasks[taskId].tRight, gTasks[taskId].tBottom);
+ Menu_EraseWindowRect(gTasks[taskId].tLeft, gTasks[taskId].tTop, gTasks[taskId].tRight, gTasks[taskId].tBottom);
DestroyTask(taskId);
EnableBothScriptContexts();
}
@@ -788,7 +788,7 @@ static void Task_HandleYesNoInput(u8 taskId)
return;
}
- switch (ProcessMenuInputNoWrap())
+ switch (Menu_ProcessInputNoWrap())
{
case -2:
return;
@@ -805,7 +805,7 @@ static void Task_HandleYesNoInput(u8 taskId)
left = gTasks[taskId].tLeft;
top = gTasks[taskId].tTop;
- MenuZeroFillWindowRect(left, top, left + 6, top + 5);
+ Menu_EraseWindowRect(left, top, left + 6, top + 5);
DestroyTask(taskId);
EnableBothScriptContexts();
}
@@ -851,7 +851,7 @@ bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, u8 ignoreBPr
static void Task_HandleMultichoiceGridInput(u8 taskId)
{
- s8 selection = sub_80727CC();
+ s8 selection = Menu_ProcessInputGridLayout();
if (selection != -2)
{
@@ -867,7 +867,7 @@ static void Task_HandleMultichoiceGridInput(u8 taskId)
gSpecialVar_Result = selection;
}
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(gTasks[taskId].tLeft, gTasks[taskId].tTop, gTasks[taskId].tRight, gTasks[taskId].tBottom);
+ Menu_EraseWindowRect(gTasks[taskId].tLeft, gTasks[taskId].tTop, gTasks[taskId].tRight, gTasks[taskId].tBottom);
DestroyTask(taskId);
EnableBothScriptContexts();
}
@@ -909,23 +909,23 @@ void ScriptMenu_CreatePCMenu(void)
if (FlagGet(FLAG_SYS_GAME_CLEAR)) // player has cleared game?
{
numChoices = 4;
- MenuDrawTextWindow(0, 0, width + 2, 9);
- MenuPrint(gPCText_HallOfFame, 1, 5);
- MenuPrint(gPCText_LogOff, 1, 7);
+ Menu_DrawStdWindowFrame(0, 0, width + 2, 9);
+ Menu_PrintText(gPCText_HallOfFame, 1, 5);
+ Menu_PrintText(gPCText_LogOff, 1, 7);
}
else
{
numChoices = 3;
- MenuDrawTextWindow(0, 0, width + 2, 7);
- MenuPrint(gPCText_LogOff, 1, 5);
+ Menu_DrawStdWindowFrame(0, 0, width + 2, 7);
+ Menu_PrintText(gPCText_LogOff, 1, 5);
}
if (FlagGet(FLAG_SYS_PC_LANETTE)) // player met lanette?
- MenuPrint(gPCText_LanettesPC, 1, 1);
+ Menu_PrintText(gPCText_LanettesPC, 1, 1);
else
- MenuPrint(gPCText_SomeonesPC, 1, 1);
+ Menu_PrintText(gPCText_SomeonesPC, 1, 1);
- MenuPrint(gPCText_PlayersPC, 1, 3);
+ Menu_PrintText(gPCText_PlayersPC, 1, 3);
InitMenu(0, 1, 1, numChoices, 0, width + 1);
StartScriptMenuTask(0, 0, width + 2, 2 * numChoices + 1, 0, numChoices);
}
@@ -1008,15 +1008,15 @@ _080B57B4:\n\
movs r0, 0\n\
movs r1, 0\n\
movs r3, 0x9\n\
- bl MenuDrawTextWindow\n\
+ bl Menu_DrawStdWindowFrame\n\
ldr r0, _080B57F8 @ =gPCText_HallOfFame\n\
movs r1, 0x1\n\
movs r2, 0x5\n\
- bl MenuPrint\n\
+ bl Menu_PrintText\n\
ldr r0, _080B57F0 @ =gPCText_LogOff\n\
movs r1, 0x1\n\
movs r2, 0x7\n\
- bl MenuPrint\n\
+ bl Menu_PrintText\n\
b _080B5818\n\
.align 2, 0\n\
_080B57E8: .4byte gPCText_SomeonesPC\n\
@@ -1032,11 +1032,11 @@ _080B57FC:\n\
movs r0, 0\n\
movs r1, 0\n\
movs r3, 0x7\n\
- bl MenuDrawTextWindow\n\
+ bl Menu_DrawStdWindowFrame\n\
ldr r0, _080B5834 @ =gPCText_LogOff\n\
movs r1, 0x1\n\
movs r2, 0x5\n\
- bl MenuPrint\n\
+ bl Menu_PrintText\n\
_080B5818:\n\
adds r6, r4, 0\n\
ldr r0, _080B5838 @ =0x0000084b\n\
@@ -1047,7 +1047,7 @@ _080B5818:\n\
ldr r0, _080B583C @ =gPCText_LanettesPC\n\
movs r1, 0x1\n\
movs r2, 0x1\n\
- bl MenuPrint\n\
+ bl Menu_PrintText\n\
b _080B584A\n\
.align 2, 0\n\
_080B5834: .4byte gPCText_LogOff\n\
@@ -1057,12 +1057,12 @@ _080B5840:\n\
ldr r0, _080B5888 @ =gPCText_SomeonesPC\n\
movs r1, 0x1\n\
movs r2, 0x1\n\
- bl MenuPrint\n\
+ bl Menu_PrintText\n\
_080B584A:\n\
ldr r0, _080B588C @ =gPCText_PlayersPC\n\
movs r1, 0x1\n\
movs r2, 0x3\n\
- bl MenuPrint\n\
+ bl Menu_PrintText\n\
movs r4, 0\n\
str r4, [sp]\n\
adds r0, r5, 0x1\n\
@@ -1096,8 +1096,8 @@ _080B588C: .4byte gPCText_PlayersPC\n\
void ScriptMenu_DisplayPCStartupPrompt(void)
{
- MenuDisplayMessageBox();
- MenuPrint(gPCText_WhichPCShouldBeAccessed, 2, 15);
+ Menu_DisplayDialogueFrame();
+ Menu_PrintText(gPCText_WhichPCShouldBeAccessed, 2, 15);
}
#define tState data[0]
@@ -1122,7 +1122,7 @@ static void Task_PokemonPicWindow(u8 taskId)
task->tState++;
break;
case 3:
- MenuZeroFillWindowRect(task->tWindowX, task->tWindowY, task->tWindowX + 9, task->tWindowY + 10);
+ Menu_EraseWindowRect(task->tWindowX, task->tWindowY, task->tWindowX + 9, task->tWindowY + 10);
DestroyTask(taskId);
break;
}
@@ -1139,7 +1139,7 @@ bool8 ScriptMenu_ShowPokemonPic(u16 species, u8 x, u8 y)
}
else
{
- MenuDrawTextWindow(x, y, x + 9, y + 10);
+ Menu_DrawStdWindowFrame(x, y, x + 9, y + 10);
taskId = CreateTask(Task_PokemonPicWindow, 0x50);
gTasks[taskId].tState = 0;
gTasks[taskId].tMonSpecies = species;
diff --git a/src/field/secret_base.c b/src/field/secret_base.c
index 2e4138a3b..16c2f57c2 100644
--- a/src/field/secret_base.c
+++ b/src/field/secret_base.c
@@ -913,7 +913,7 @@ void Task_SecretBasePC_Registry(u8 taskId)
taskData[1] = 0;
taskData[2] = 0;
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
sub_80BC7D8(taskId);
gTasks[taskId].func = sub_80BC824;
@@ -948,8 +948,8 @@ void sub_80BC6B0(u8 taskId)
if (sub_80BC268(i) == TRUE)
{
sub_80BC190(gStringVar1, i);
- MenuFillWindowRectWithBlankTile(18, 2 * n + 2, 28, 2 * n + 3);
- MenuPrint(gStringVar1, 18, 2 * n + 2);
+ Menu_BlankWindowRect(18, 2 * n + 2, 28, 2 * n + 3);
+ Menu_PrintText(gStringVar1, 18, 2 * n + 2);
if (++n == 8)
break;
}
@@ -957,11 +957,11 @@ void sub_80BC6B0(u8 taskId)
if (n < 8)
{
- MenuFillWindowRectWithBlankTile(18, 2 * n + 2, 28, 2 * n + 3);
- MenuPrint(gUnknownText_Exit, 18, 2 * n + 2);
+ Menu_BlankWindowRect(18, 2 * n + 2, 28, 2 * n + 3);
+ Menu_PrintText(gUnknownText_Exit, 18, 2 * n + 2);
DestroyVerticalScrollIndicator(1);
if (n != 7)
- MenuFillWindowRectWithBlankTile(18, ((n << 25) + (1 << 26)) >> 24, 28, 18); // the shifts are needed to match
+ Menu_BlankWindowRect(18, ((n << 25) + (1 << 26)) >> 24, 28, 18); // the shifts are needed to match
}
else
CreateVerticalScrollIndicators(1, 0xbc, 0x98);
@@ -975,7 +975,7 @@ void sub_80BC6B0(u8 taskId)
void sub_80BC7D8(u8 taskId)
{
u16 *taskData = gTasks[taskId].data;
- MenuDrawTextWindow(17, 0, 29, 19);
+ Menu_DrawStdWindowFrame(17, 0, 29, 19);
InitMenu(0, 18, 2, taskData[3] + 1, taskData[1], 11);
sub_80BC6B0(taskId);
@@ -990,7 +990,7 @@ void sub_80BC824(u8 taskId)
if (taskData[1])
{
PlaySE(5);
- taskData[1] = MoveMenuCursor(-1);
+ taskData[1] = Menu_MoveCursor(-1);
}
else if (taskData[2])
{
@@ -1013,7 +1013,7 @@ void sub_80BC824(u8 taskId)
else
{
PlaySE(5);
- taskData[1] = MoveMenuCursor(1);
+ taskData[1] = Menu_MoveCursor(1);
}
}
else if (gMain.newKeys & A_BUTTON)
@@ -1022,7 +1022,7 @@ void sub_80BC824(u8 taskId)
if (taskData[1] + taskData[2] == taskData[0])
{
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
sub_80BCC54(taskId);
}
else
@@ -1036,7 +1036,7 @@ void sub_80BC824(u8 taskId)
{
PlaySE(5);
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
sub_80BCC54(taskId);
}
}
@@ -1066,7 +1066,7 @@ void sub_80BC980(u8 taskId)
{
PauseVerticalScrollIndicator(0);
PauseVerticalScrollIndicator(1);
- MenuDrawTextWindow(1, 0, 12, 5);
+ Menu_DrawStdWindowFrame(1, 0, 12, 5);
PrintMenuItems(2, 1, 2, (const struct MenuAction *)gUnknown_083D13D4);
InitMenu(0, 2, 1, 2, 0, 10);
gTasks[taskId].func = sub_80BC9E4;
@@ -1076,24 +1076,24 @@ void sub_80BC9E4(u8 taskId)
{
if (gMain.newAndRepeatedKeys & DPAD_UP)
{
- if (GetMenuCursorPos())
+ if (Menu_GetCursorPos())
{
PlaySE(5);
- MoveMenuCursor(-1);
+ Menu_MoveCursor(-1);
}
}
else if (gMain.newAndRepeatedKeys & DPAD_DOWN)
{
- if (GetMenuCursorPos() != 1)
+ if (Menu_GetCursorPos() != 1)
{
PlaySE(5);
- MoveMenuCursor(1);
+ Menu_MoveCursor(1);
}
}
else if (gMain.newKeys & A_BUTTON)
{
PlaySE(5);
- gUnknown_083D13D4[GetMenuCursorPos()].func(taskId);
+ gUnknown_083D13D4[Menu_GetCursorPos()].func(taskId);
}
else if (gMain.newKeys & B_BUTTON)
{
@@ -1109,7 +1109,7 @@ void sub_80BCA84(u8 taskId)
DestroyVerticalScrollIndicator(0);
DestroyVerticalScrollIndicator(1);
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
sub_80BC190(gStringVar1, taskData[4]);
StringExpandPlaceholders(gStringVar4, gOtherText_OkayToDeleteFromRegistry);
@@ -1126,7 +1126,7 @@ void sub_80BCB10(u8 taskId)
{
s16 *taskData = gTasks[taskId].data;
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
gSaveBlock1.secretBases[taskData[4]].sbr_field_1_6 = 0;
taskData[0]--;
@@ -1147,13 +1147,13 @@ void sub_80BCB10(u8 taskId)
void sub_80BCB90(u8 taskId)
{
- MenuZeroFillWindowRect(20, 8, 26, 13);
+ Menu_EraseWindowRect(20, 8, 26, 13);
DisplayItemMessageOnField(taskId, gOtherText_RegisteredDataDeleted, sub_80BCB10, 0);
}
void sub_80BCBC0(u8 taskId)
{
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
sub_80BC7D8(taskId);
gTasks[taskId].func = sub_80BC824;
@@ -1164,7 +1164,7 @@ void sub_80BCBF8(u8 taskId)
s16 *taskData = gTasks[taskId].data;
InitMenu(0, 18, 2, taskData[3] + 1, taskData[1], 11);
- MenuZeroFillWindowRect(1, 0, 12, 5);
+ Menu_EraseWindowRect(1, 0, 12, 5);
StartVerticalScrollIndicators(0);
StartVerticalScrollIndicators(1);
diff --git a/src/field/shop.c b/src/field/shop.c
index 23d668fc7..0d8bc83d1 100644
--- a/src/field/shop.c
+++ b/src/field/shop.c
@@ -84,13 +84,13 @@ u8 CreateShopMenu(u8 martType)
if (martType == MART_TYPE_0)
{
gMartInfo.numChoices = 2;
- MenuDrawTextWindow(0, 0, 10, 7);
+ Menu_DrawStdWindowFrame(0, 0, 10, 7);
PrintMenuItemsReordered(1, 1, 3, sBuySellQuitMenuActions, gUnknown_083CC6E8);
}
else
{
gMartInfo.numChoices = 1;
- MenuDrawTextWindow(0, 0, 10, 5);
+ Menu_DrawStdWindowFrame(0, 0, 10, 5);
PrintMenuItemsReordered(1, 1, 2, sBuySellQuitMenuActions, gUnknown_083CC6EB);
}
InitMenu(0, 1, 1, gMartInfo.numChoices + 1, 0, 9); // add 1 for cancel
@@ -126,7 +126,7 @@ void sub_80B2E38(u8 var)
if (gMartInfo.cursor) // can move cursor up?
{
PlaySE(SE_SELECT);
- gMartInfo.cursor = MoveMenuCursor(-1);
+ gMartInfo.cursor = Menu_MoveCursor(-1);
}
}
else if (gMain.newAndRepeatedKeys & DPAD_DOWN)
@@ -134,7 +134,7 @@ void sub_80B2E38(u8 var)
if (gMartInfo.cursor != gMartInfo.numChoices) // can move cursor down?
{
PlaySE(SE_SELECT);
- gMartInfo.cursor = MoveMenuCursor(1);
+ gMartInfo.cursor = Menu_MoveCursor(1);
}
}
else if (gMain.newKeys & A_BUTTON)
@@ -175,7 +175,7 @@ void sub_80B2F30(u8 taskId)
void HandleShopMenuQuit(u8 taskId)
{
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(0, 0, 11, 8);
+ Menu_EraseWindowRect(0, 0, 11, 8);
sub_80BE3BC();
ScriptContext2_Disable();
DestroyTask(taskId);
@@ -290,7 +290,7 @@ void BuyMenuDrawGraphics(void)
BuyMenuDrawMapGraphics();
gMartInfo.cursor = zero;
gMartInfo.choicesAbove = zero2;
- MenuZeroFillWindowRect(0, 0, 0x20, 0x20);
+ Menu_EraseWindowRect(0, 0, 0x20, 0x20);
OpenMoneyWindow(gSaveBlock1.money, 0, 0);
sub_80B3764(0, 7);
sub_80B37EC();
@@ -532,7 +532,7 @@ void sub_80B37F8(u8 taskId)
gStringVar1[1] = 0x14;
gStringVar1[2] = 0x6;
ConvertIntToDecimalStringN(&gStringVar1[3], gTasks[taskId].data[1], 1, 2);
- MenuPrint(gOtherText_xString1, 1, 11);
+ Menu_PrintText(gOtherText_xString1, 1, 11);
sub_80A3FA0(gBGTilemapBuffers[1], 1, 11, 12, 2, 0xC3E1);
}
@@ -604,8 +604,8 @@ void sub_80B39D0(int var1, int var2, bool32 hasControlCode)
if (i != 8 && gMartInfo.choicesAbove + i == gMartInfo.itemCount)
{
- MenuFillWindowRectWithBlankTile(0xE, (i << 1) + 2, 0x1C, (i << 1) + 3);
- MenuPrint(gOtherText_CancelNoTerminator, 0xE, (i << 1) + 2);
+ Menu_BlankWindowRect(0xE, (i << 1) + 2, 0x1C, (i << 1) + 3);
+ Menu_PrintText(gOtherText_CancelNoTerminator, 0xE, (i << 1) + 2);
}
}
@@ -659,7 +659,7 @@ void sub_80B3BD0(u8 taskId)
void sub_80B3BF4(u8 taskId)
{
- MenuZeroFillWindowRect(0x7, 0x8, 0xD, 0xD);
+ Menu_EraseWindowRect(0x7, 0x8, 0xD, 0xD);
sub_80A3FA0(gBGTilemapBuffers[1], 8, 9, 4, 4, 0);
sub_80B379C();
sub_80B3420();
@@ -706,7 +706,7 @@ void sub_80B3D38(u8 taskId)
void sub_80B3D7C(u8 taskId)
{
sub_80B39D0(gMartInfo.cursor, gMartInfo.cursor, 0);
- MenuZeroFillWindowRect(0x7, 0x8, 0xD, 0xD);
+ Menu_EraseWindowRect(0x7, 0x8, 0xD, 0xD);
sub_80A3FA0(gBGTilemapBuffers[1], 0x8, 0x9, 0x4, 0x4, 0);
sub_80B4378(taskId);
}
@@ -719,7 +719,7 @@ void sub_80B3DC8(u8 taskId)
if (gMain.newKeys & A_BUTTON)
{
gMartTotalCost = (ItemId_GetPrice(gMartInfo.itemList[gMartInfo.choicesAbove + gMartInfo.cursor]) >> GetPriceReduction(1)) * gTasks[taskId].data[1]; // set total cost of your purchase.
- MenuZeroFillWindowRect(0, 0xA, 0xD, 0xD);
+ Menu_EraseWindowRect(0, 0xA, 0xD, 0xD);
sub_80A3FA0(gBGTilemapBuffers[1], 0x1, 0xB, 0xC, 0x2, 0);
sub_80B379C();
sub_80B3420();
@@ -741,7 +741,7 @@ void sub_80B3EFC(u8 taskId)
u16 var;
gTasks[taskId].data[1] = 1;
- MenuDrawTextWindow(0, 0xA, 0xD, 0xD);
+ Menu_DrawStdWindowFrame(0, 0xA, 0xD, 0xD);
sub_80B37F8(taskId);
var = gSaveBlock1.money / (ItemId_GetPrice(gMartInfo.itemList[gMartInfo.choicesAbove + gMartInfo.cursor]) >> GetPriceReduction(1));
@@ -1049,7 +1049,7 @@ void sub_80B40E8(u8 taskId) // Mart_DoCursorAction
else // if the cursor is not 0, choicesAbove cannot be updated yet since the cursor is at the top of the menu, so update cursor.
{
PlaySE(SE_SELECT);
- gMartInfo.cursor = MoveMenuCursor(-1); // move cursor up
+ gMartInfo.cursor = Menu_MoveCursor(-1); // move cursor up
sub_80B3A70();
}
}
@@ -1070,7 +1070,7 @@ void sub_80B40E8(u8 taskId) // Mart_DoCursorAction
else if (gMartInfo.cursor != gMartInfo.itemCount)
{
PlaySE(SE_SELECT);
- gMartInfo.cursor = MoveMenuCursor(1);
+ gMartInfo.cursor = Menu_MoveCursor(1);
sub_80B3A70();
}
}
@@ -1085,7 +1085,7 @@ void sub_80B40E8(u8 taskId) // Mart_DoCursorAction
sub_80F979C(1, 1);
sub_80B39D0(gMartInfo.cursor, gMartInfo.cursor, 1);
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(0, 0xC, 0xD, 0x13);
+ Menu_EraseWindowRect(0, 0xC, 0xD, 0x13);
if (gMartInfo.martType == MART_TYPE_0)
{
@@ -1139,8 +1139,8 @@ void sub_80B40E8(u8 taskId) // Mart_DoCursorAction
void sub_80B4378(u8 taskId)
{
- MenuZeroFillWindowRect(0, 0xE, 0x1D, 0x13);
- MenuZeroFillWindowRect(0, 0xA, 0xD, 0xD);
+ Menu_EraseWindowRect(0, 0xE, 0x1D, 0x13);
+ Menu_EraseWindowRect(0, 0xA, 0xD, 0xD);
sub_80A3FA0(gBGTilemapBuffers[1], 0x1, 0xB, 0xC, 0x2, 0);
sub_80B3420();
sub_80B3764(6, 7);
diff --git a/src/field/slot_machine.c b/src/field/slot_machine.c
index a524790b4..3c13e004c 100644
--- a/src/field/slot_machine.c
+++ b/src/field/slot_machine.c
@@ -584,8 +584,8 @@ static bool8 sub_8101E3C(struct Task *task)
static void sub_8101F2C(const u8 *str)
{
- MenuDisplayMessageBox();
- MenuPrint(str, 2, 15);
+ Menu_DisplayDialogueFrame();
+ Menu_PrintText(str, 2, 15);
}
static bool8 sub_8101F44(struct Task *task)
@@ -599,7 +599,7 @@ static bool8 sub_8101F60(struct Task *task)
{
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
{
- MenuZeroFillScreen();
+ Menu_EraseScreen();
eSlotMachine->state = 5;
}
return FALSE;
@@ -853,7 +853,7 @@ static bool8 sub_8102344(struct Task *task)
s8 input = ProcessMenuInputNoWrap_();
if (input == 0)
{
- MenuZeroFillScreen();
+ Menu_EraseScreen();
sub_8103D8C(0);
sub_8103D8C(1);
sub_8103D8C(2);
@@ -862,7 +862,7 @@ static bool8 sub_8102344(struct Task *task)
}
else if (input == 1 || input == -1)
{
- MenuZeroFillScreen();
+ Menu_EraseScreen();
eSlotMachine->state = 5;
}
return FALSE;
@@ -879,7 +879,7 @@ static bool8 sub_81023B8(struct Task *task)
{
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
{
- MenuZeroFillScreen();
+ Menu_EraseScreen();
eSlotMachine->state = 5;
}
return FALSE;
@@ -896,7 +896,7 @@ static bool8 sub_81023FC(struct Task *task)
{
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
{
- MenuZeroFillScreen();
+ Menu_EraseScreen();
eSlotMachine->state = 27;
}
return FALSE;
@@ -2824,7 +2824,7 @@ static void sub_8104BC8(struct Task *task)
static void sub_8104BFC(struct Task *task)
{
- MenuZeroFillScreen();
+ Menu_EraseScreen();
BasicInitMenuWindow(&gWindowConfig_81E7128);
sub_81064B8();
sub_8104CAC(task->data[1]);
diff --git a/src/field/start_menu.c b/src/field/start_menu.c
index dccf1714e..6c2812039 100644
--- a/src/field/start_menu.c
+++ b/src/field/start_menu.c
@@ -193,8 +193,8 @@ static void BuildStartMenuActions_Link(void)
static void DisplaySafariBallsWindow(void)
{
sub_8072C44(gStringVar1, gNumSafariBalls, 12, 1);
- MenuDrawTextWindow(0, 0, 10, 5);
- MenuPrint(gOtherText_SafariStock, 1, 1);
+ Menu_DrawStdWindowFrame(0, 0, 10, 5);
+ Menu_PrintText(gOtherText_SafariStock, 1, 1);
}
//Prints n menu items starting at *index
@@ -204,7 +204,7 @@ static bool32 PrintStartMenuItemsMultistep(s16 *index, u32 n)
do
{
- MenuPrint(sStartMenuItems[sCurrentStartMenuActions[_index]].text, 23, 2 + _index * 2);
+ Menu_PrintText(sStartMenuItems[sCurrentStartMenuActions[_index]].text, 23, 2 + _index * 2);
_index++;
if (_index >= sNumStartMenuActions)
{
@@ -226,7 +226,7 @@ static bool32 InitStartMenuMultistep(s16 *step, s16 *index)
(*step)++;
break;
case 2:
- MenuDrawTextWindow(22, 0, 29, sNumStartMenuActions * 2 + 3);
+ Menu_DrawStdWindowFrame(22, 0, 29, sNumStartMenuActions * 2 + 3);
*index = 0;
(*step)++;
break;
@@ -310,12 +310,12 @@ static u8 StartMenu_InputProcessCallback(void)
if (gMain.newKeys & DPAD_UP)
{
PlaySE(SE_SELECT);
- sStartMenuCursorPos = MoveMenuCursor(-1);
+ sStartMenuCursorPos = Menu_MoveCursor(-1);
}
if (gMain.newKeys & DPAD_DOWN)
{
PlaySE(SE_SELECT);
- sStartMenuCursorPos = MoveMenuCursor(1);
+ sStartMenuCursorPos = Menu_MoveCursor(1);
}
if (gMain.newKeys & A_BUTTON)
{
@@ -473,13 +473,13 @@ static u8 SaveCallback2(void)
return FALSE;
case SAVE_CANCELED:
//Go back to start menu
- MenuZeroFillScreen();
+ Menu_EraseScreen();
InitStartMenu();
gCallback_03004AE8 = StartMenu_InputProcessCallback;
return FALSE;
case SAVE_SUCCESS:
case SAVE_ERROR:
- MenuZeroFillScreen();
+ Menu_EraseScreen();
sub_8064E2C();
ScriptContext2_Disable();
return TRUE;
@@ -498,7 +498,7 @@ static u8 RunSaveDialogCallback(void)
{
if (savingComplete)
{
- if (!MenuUpdateWindowText())
+ if (!Menu_UpdateWindowText())
return 0;
}
savingComplete = FALSE;
@@ -514,7 +514,7 @@ void ScrSpecial_DoSaveDialog(void)
static void DisplaySaveMessageWithCallback(const u8 *ptr, u8 (*func)(void))
{
StringExpandPlaceholders(gStringVar4, ptr);
- MenuDisplayMessageBox();
+ Menu_DisplayDialogueFrame();
MenuPrintMessageDefaultCoords(gStringVar4);
savingComplete = TRUE;
saveDialogCallback = func;
@@ -547,7 +547,7 @@ static void sub_8071700(void)
static void HideSaveDialog(void)
{
- MenuZeroFillWindowRect(20, 8, 26, 13);
+ Menu_EraseWindowRect(20, 8, 26, 13);
}
static void SaveDialogStartTimeout(void)
@@ -579,7 +579,7 @@ static bool8 SaveDialogCheckForTimeoutAndKeypress(void)
static u8 SaveDialogCB_DisplayConfirmMessage(void)
{
- MenuZeroFillScreen();
+ Menu_EraseScreen();
HandleDrawSaveWindowInfo(0, 0);
DisplaySaveMessageWithCallback(gSaveText_WouldYouLikeToSave, SaveDialogCB_DisplayConfirmYesNoMenu);
return SAVE_IN_PROGRESS;
@@ -694,7 +694,7 @@ static u8 SaveDialogCB_DoSave(void)
static u8 SaveDialogCB_SaveSuccess(void)
{
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
{
PlaySE(SE_SAVE);
saveDialogCallback = SaveDialogCB_ReturnSuccess;
@@ -715,7 +715,7 @@ static u8 SaveDialogCB_ReturnSuccess(void)
static u8 SaveDialogCB_SaveError(void)
{
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
{
PlaySE(SE_BOO);
saveDialogCallback = SaveDialogCB_ReturnError;
@@ -821,8 +821,8 @@ static void Task_8071B64(u8 taskId)
switch (*step)
{
case 0:
- MenuDisplayMessageBox();
- MenuPrint(gSystemText_Saving, 2, 15);
+ Menu_DisplayDialogueFrame();
+ Menu_PrintText(gSystemText_Saving, 2, 15);
BeginNormalPaletteFade(-1, 0, 0x10, 0, 0);
(*step)++;
break;
diff --git a/src/field/starter_choose.c b/src/field/starter_choose.c
index 701d4087a..d4994d701 100644
--- a/src/field/starter_choose.c
+++ b/src/field/starter_choose.c
@@ -355,8 +355,8 @@ static void MainCallback2(void)
static void Task_StarterChoose1(u8 taskId)
{
CreateStarterPokemonLabel(0xFF, gTasks[taskId].tStarterSelection);
- MenuDrawTextWindow(2, 14, 27, 19);
- MenuPrint(gOtherText_BirchInTrouble, 3, 15);
+ Menu_DrawStdWindowFrame(2, 14, 27, 19);
+ Menu_PrintText(gOtherText_BirchInTrouble, 3, 15);
gTasks[taskId].func = Task_StarterChoose2;
}
@@ -368,7 +368,7 @@ static void Task_StarterChoose2(u8 taskId)
{
u8 spriteId;
- MenuZeroFillWindowRect(
+ Menu_EraseWindowRect(
gStarterChoose_LabelCoords[selection][0],
gStarterChoose_LabelCoords[selection][1],
gStarterChoose_LabelCoords[selection][0] + 13,
@@ -424,9 +424,9 @@ static void Task_StarterChoose3(u8 taskId)
static void Task_StarterChoose4(u8 taskId)
{
PlayCry1(GetStarterPokemon(gTasks[taskId].tStarterSelection), 0);
- MenuDrawTextWindow(2, 14, 27, 19);
+ Menu_DrawStdWindowFrame(2, 14, 27, 19);
//"Do you choose this POKEMON?"
- MenuPrint(gOtherText_DoYouChoosePoke, 3, 15);
+ Menu_PrintText(gOtherText_DoYouChoosePoke, 3, 15);
DisplayYesNoMenu(21, 7, 1);
gTasks[taskId].func = Task_StarterChoose5;
}
@@ -445,7 +445,7 @@ static void Task_StarterChoose5(u8 taskId)
case 1: // NO
case -1: // B button
PlaySE(SE_SELECT);
- MenuZeroFillWindowRect(21, 7, 27, 12);
+ Menu_EraseWindowRect(21, 7, 27, 12);
spriteId = gTasks[taskId].tPkmnSpriteId;
FreeSpritePaletteByTag(GetSpritePaletteTagByPaletteNum(gSprites[spriteId].oam.paletteNum));
@@ -498,7 +498,7 @@ static void CreateStarterPokemonLabel(u8 prevSelection, u8 selection)
if (prevSelection != 0xFF)
{
//Remove the old Pokemon label
- MenuZeroFillWindowRect(
+ Menu_EraseWindowRect(
gStarterChoose_LabelCoords[prevSelection][0],
gStarterChoose_LabelCoords[prevSelection][1],
gStarterChoose_LabelCoords[prevSelection][0] + 13,
@@ -527,7 +527,7 @@ static void CreateStarterPokemonLabel(u8 prevSelection, u8 selection)
//Copy POKEMON string to label
StringCopy(labelText + dstIndex, gOtherText_Poke);
- MenuPrint(
+ Menu_PrintText(
labelText,
gStarterChoose_LabelCoords[selection][0],
gStarterChoose_LabelCoords[selection][1]);
@@ -535,7 +535,7 @@ static void CreateStarterPokemonLabel(u8 prevSelection, u8 selection)
//Copy Pokemon name to label
sub_8072C74(labelText + 5, gSpeciesNames[species], 0x6B, 1);
- MenuPrint(
+ Menu_PrintText(
labelText,
gStarterChoose_LabelCoords[selection][0],
gStarterChoose_LabelCoords[selection][1] + 2);
@@ -574,7 +574,7 @@ static void CreateStarterPokemonLabel(u8 prevSelection, u8 selection)
adds r3, r1, 0x3\n\
lsls r3, 24\n\
lsrs r3, 24\n\
- bl MenuZeroFillWindowRect\n\
+ bl Menu_EraseWindowRect\n\
ldr r0, _0810A964 @ =0x04000040\n\
movs r1, 0\n\
strh r1, [r0]\n\
@@ -649,7 +649,7 @@ _0810A8CA:\n\
mov r0, sp\n\
adds r1, r4, 0\n\
adds r2, r5, 0\n\
- bl MenuPrint\n\
+ bl Menu_PrintText\n\
mov r0, sp\n\
movs r1, 0\n\
movs r2, 0xF\n\
@@ -669,7 +669,7 @@ _0810A8CA:\n\
lsrs r2, 24\n\
mov r0, sp\n\
adds r1, r4, 0\n\
- bl MenuPrint\n\
+ bl Menu_PrintText\n\
lsls r0, r4, 3\n\
adds r0, 0x4\n\
lsls r0, 24\n\
diff --git a/src/field/trader.c b/src/field/trader.c
index 61cb0b4a2..eb0c8a934 100644
--- a/src/field/trader.c
+++ b/src/field/trader.c
@@ -100,7 +100,7 @@ void CreateAvailableDecorationsMenu(u8 taskId)
}
}
- MenuDrawTextWindow(0, 1, 12, numChoices * 2 + 2);
+ Menu_DrawStdWindowFrame(0, 1, 12, numChoices * 2 + 2);
for (i = 0; i < 4; i++)
{
@@ -108,18 +108,18 @@ void CreateAvailableDecorationsMenu(u8 taskId)
{
if (trader->unk1[i] > DECOR_REGISTEEL_DOLL)
{
- MenuPrint(gOtherText_FiveQuestionsAndSlash, 1, numDecorations * 2 + 2);
+ Menu_PrintText(gOtherText_FiveQuestionsAndSlash, 1, numDecorations * 2 + 2);
}
else
{
- MenuPrint(gDecorations[trader->unk1[i]].name, 1, numDecorations * 2 + 2);
+ Menu_PrintText(gDecorations[trader->unk1[i]].name, 1, numDecorations * 2 + 2);
}
numDecorations++;
}
}
- MenuPrint(gOtherText_CancelNoTerminator, 1, numDecorations * 2 + 2);
+ Menu_PrintText(gOtherText_CancelNoTerminator, 1, numDecorations * 2 + 2);
InitMenu(0, 1, 2, numChoices, 0, 11);
gTasks[taskId].data[1] = numDecorations;
}
@@ -136,7 +136,7 @@ void sub_8109B34(u8 taskId, u8 decorationId)
}
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(0, 1, 12, 12);
+ Menu_EraseWindowRect(0, 1, 12, 12);
DestroyTask(taskId);
EnableBothScriptContexts();
}
@@ -148,17 +148,17 @@ void Task_HandleGetDecorationMenuInput(u8 taskId)
if (gMain.newKeys & DPAD_UP)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(-1);
+ Menu_MoveCursor(-1);
}
else if (gMain.newKeys & DPAD_DOWN)
{
PlaySE(SE_SELECT);
- MoveMenuCursor(1);
+ Menu_MoveCursor(1);
}
else if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
- gSpecialVar_0x8005 = GetMenuCursorPos();
+ gSpecialVar_0x8005 = Menu_GetCursorPos();
if (gTasks[taskId].data[1] == gSpecialVar_0x8005)
{
sub_8109B34(taskId, 0);
@@ -216,7 +216,7 @@ void ScrSpecial_TraderMenuGiveDecoration(void)
void sub_8109D04(u8 taskId)
{
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
DestroyVerticalScrollIndicator(0);
DestroyVerticalScrollIndicator(1);
sub_80F9520(gUnknown_020388F7, 8);
@@ -238,7 +238,7 @@ void sub_8109D04(u8 taskId)
void sub_8109DAC(u8 taskId)
{
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
gSpecialVar_0x8006 = 0;
DestroyTask(taskId);
EnableBothScriptContexts();
diff --git a/src/field/use_pokeblock.c b/src/field/use_pokeblock.c
index 7253ac901..6e71011b9 100644
--- a/src/field/use_pokeblock.c
+++ b/src/field/use_pokeblock.c
@@ -611,18 +611,18 @@ static void sub_8136BB8(void)
StringGetEnd10(gUnknown_02039304->stringBuffer);
StringAppend(gUnknown_02039304->stringBuffer, gOtherText_GetsAPokeBlock);
BasicInitMenuWindow(&gWindowConfig_81E709C);
- MenuDrawTextWindow(0, 16, 29, 19);
- MenuPrint(gUnknown_02039304->stringBuffer, 1, 17);
+ Menu_DrawStdWindowFrame(0, 16, 29, 19);
+ Menu_PrintText(gUnknown_02039304->stringBuffer, 1, 17);
DisplayYesNoMenu(23, 10, 1);
- MoveMenuCursor(0);
+ Menu_MoveCursor(0);
}
static s8 sub_8136C40(void)
{
- s8 retval = ProcessMenuInputNoWrap();
+ s8 retval = Menu_ProcessInputNoWrap();
if ((u8)(retval + 1) < 3)
{
- MenuZeroFillScreen();
+ Menu_EraseScreen();
BasicInitMenuWindow(&gWindowConfig_81E7080);
}
return retval;
@@ -631,7 +631,7 @@ static s8 sub_8136C40(void)
static void sub_8136C6C(void)
{
BasicInitMenuWindow(&gWindowConfig_81E709C);
- MenuDrawTextWindow(0, 16, 29, 19);
+ Menu_DrawStdWindowFrame(0, 16, 29, 19);
for (gUnknown_02039304->unk53 = 0; gUnknown_02039304->unk53 < 5 && gUnknown_02039304->unk61[gUnknown_02039304->unk53] == 0; gUnknown_02039304->unk53++);
if (gUnknown_02039304->unk53 < 5)
{
@@ -668,20 +668,20 @@ static bool8 sub_8136D00(void)
static void sub_8136D60(void)
{
BasicInitMenuWindow(&gWindowConfig_81E709C);
- MenuDrawTextWindow(0, 16, 29, 19);
- MenuPrint(gOtherText_WontEat, 1, 17);
+ Menu_DrawStdWindowFrame(0, 16, 29, 19);
+ Menu_PrintText(gOtherText_WontEat, 1, 17);
}
static void sub_8136D8C(void)
{
- MenuZeroFillScreen();
+ Menu_EraseScreen();
BasicInitMenuWindow(&gWindowConfig_81E7080);
}
static void Pokeblock_MenuWindowTextPrint(const u8 *message)
{
- MenuDrawTextWindow(0, 16, 29, 19);
- MenuPrint(message, 1, 17);
+ Menu_DrawStdWindowFrame(0, 16, 29, 19);
+ Menu_PrintText(message, 1, 17);
}
#ifdef NONMATCHING
diff --git a/src/field/wallclock.c b/src/field/wallclock.c
index 2892d09f9..6d102715a 100644
--- a/src/field/wallclock.c
+++ b/src/field/wallclock.c
@@ -414,9 +414,9 @@ static void Task_SetClock2(u8 taskId)
//Ask player "Is this the correct time?"
static void Task_SetClock3(u8 taskId)
{
- MenuDrawTextWindow(2, 16, 27, 19);
- MenuPrint(gOtherText_CorrectTimePrompt, 3, 17);
- MenuDrawTextWindow(23, 8, 29, 13);
+ Menu_DrawStdWindowFrame(2, 16, 27, 19);
+ Menu_PrintText(gOtherText_CorrectTimePrompt, 3, 17);
+ Menu_DrawStdWindowFrame(23, 8, 29, 13);
PrintMenuItems(24, 9, 2, gMenuYesNoItems);
InitMenu(0, 24, 9, 2, 1, 5);
gTasks[taskId].func = Task_SetClock4;
@@ -435,8 +435,8 @@ static void Task_SetClock4(u8 taskId)
case 1: //NO
HandleDestroyMenuCursors();
PlaySE(SE_SELECT);
- MenuZeroFillWindowRect(23, 8, 29, 13);
- MenuZeroFillWindowRect(2, 16, 27, 19);
+ Menu_EraseWindowRect(23, 8, 29, 13);
+ Menu_EraseWindowRect(2, 16, 27, 19);
gTasks[taskId].func = Task_SetClock2; //Go back and let player adjust clock
}
}
diff --git a/src/pokemon/learn_move.c b/src/pokemon/learn_move.c
index ef1d66349..83953186b 100644
--- a/src/pokemon/learn_move.c
+++ b/src/pokemon/learn_move.c
@@ -25,8 +25,8 @@ extern u16 gSpecialVar_0x8004;
extern u16 gSpecialVar_0x8005;
extern u8 gTileBuffer[];
-extern const struct WindowConfig gWindowConfig_81E6CE4;
-extern const struct WindowConfig gWindowConfig_81E7240;
+extern const struct WindowTemplate gWindowConfig_81E6CE4;
+extern const struct WindowTemplate gWindowConfig_81E7240;
extern const u8 *const gContestEffectStrings[];
extern const u8 *const gMoveDescriptions[];
extern const u8 gTypeNames[][7];
@@ -270,11 +270,11 @@ void CB2_InitLearnMove(void)
SetUpWindowConfig(&gWindowConfig_81E7240);
InitMenuWindow(&gWindowConfig_81E7240);
- MenuZeroFillScreen();
+ Menu_EraseScreen();
SetUpWindowConfig(&gWindowConfig_81E6CE4);
InitMenuWindow(&gWindowConfig_81E6CE4);
- MenuZeroFillScreen();
+ Menu_EraseScreen();
REG_BG0VOFS = 0;
REG_BG0VOFS = 0; // huh?
@@ -304,11 +304,11 @@ void sub_81327A4(void)
SetUpWindowConfig(&gWindowConfig_81E7240);
InitMenuWindow(&gWindowConfig_81E7240);
- MenuZeroFillScreen();
+ Menu_EraseScreen();
SetUpWindowConfig(&gWindowConfig_81E6CE4);
InitMenuWindow(&gWindowConfig_81E6CE4);
- MenuZeroFillScreen();
+ Menu_EraseScreen();
REG_DISPCNT = 0x1340;
REG_BG0VOFS = 0;
@@ -401,7 +401,7 @@ void LearnMoveMain(void)
sub_813362C();
break;
case 8:
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
{
DisplayYesNoMenu(21, 7, 1);
sLearnMoveStruct->state++;
@@ -436,7 +436,7 @@ void LearnMoveMain(void)
}
break;
case 12:
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
{
DisplayYesNoMenu(21, 7, 1);
sLearnMoveStruct->state++;
@@ -467,7 +467,7 @@ void LearnMoveMain(void)
sLearnMoveStruct->state++;
break;
case 17:
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
{
DisplayYesNoMenu(21, 7, 1);
sLearnMoveStruct->state = 18;
@@ -495,7 +495,7 @@ void LearnMoveMain(void)
sLearnMoveStruct->state++;
break;
case 25:
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
{
sLearnMoveStruct->state = 26;
DisplayYesNoMenu(21, 7, 1);
@@ -524,7 +524,7 @@ void LearnMoveMain(void)
}
break;
case 27:
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
{
if (sLearnMoveStruct->showContestInfo == FALSE)
sLearnMoveStruct->state = 3;
@@ -533,7 +533,7 @@ void LearnMoveMain(void)
}
break;
case 19:
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
{
sLearnMoveStruct->state = 20;
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
@@ -547,7 +547,7 @@ void LearnMoveMain(void)
}
break;
case 21:
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
sLearnMoveStruct->state = 14;
break;
case 22:
@@ -597,7 +597,7 @@ void LearnMoveMain(void)
}
break;
case 30:
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
{
#ifdef ENGLISH
sub_81328E8(gOtherText_ForgotOrDidNotLearnMove);
@@ -609,7 +609,7 @@ void LearnMoveMain(void)
}
break;
case 31:
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
{
PlayFanfare(BGM_FANFA1);
sLearnMoveStruct->state = 32;
@@ -636,7 +636,7 @@ void DrawLearnMoveMenuWindow(void)
BasicInitMenuWindow(&gWindowConfig_81E7240);
for (i = 0; i < 4; i++)
{
- MenuDrawTextWindow(
+ Menu_DrawStdWindowFrame(
gUnknown_08402CF8[i][0],
gUnknown_08402CF8[i][1],
gUnknown_08402CF8[i][2],
@@ -658,7 +658,7 @@ void sub_8133030(bool8 a)
for (i = 0; gUnknown_08402D08[0][i].unk0 != NULL; i++)
{
sub_8072C74(gTileBuffer, gUnknown_08402D08[0][i].unk0, 64, 2);
- MenuPrint(gTileBuffer, gUnknown_08402D08[0][i].unk4, gUnknown_08402D08[0][i].unk5);
+ Menu_PrintText(gTileBuffer, gUnknown_08402D08[0][i].unk4, gUnknown_08402D08[0][i].unk5);
}
if (!a)
@@ -696,10 +696,10 @@ void sub_8133140(bool8 a)
for (i = 0; gUnknown_08402D08[0][i].unk0 != NULL; i++)
{
sub_8072C74(gTileBuffer, gUnknown_08402D08[1][i].unk0, 64, 2);
- MenuPrint(gTileBuffer, gUnknown_08402D08[1][i].unk4, gUnknown_08402D08[1][i].unk5);
+ Menu_PrintText(gTileBuffer, gUnknown_08402D08[1][i].unk4, gUnknown_08402D08[1][i].unk5);
if (i != 0)
{
- MenuZeroFillWindowRect(
+ Menu_EraseWindowRect(
gUnknown_08402D08[1][i].unk4,
gUnknown_08402D08[1][i].unk5 + 2,
gUnknown_08402D08[1][i].unk4 + 7,
@@ -938,7 +938,7 @@ void sub_8133800(void)
r6++;
}
*str = EOS;
- MenuPrint(gTileBuffer, 11, 1);
+ Menu_PrintText(gTileBuffer, 11, 1);
sub_813360C(0);
}
@@ -972,17 +972,17 @@ void PrintMoveInfo(u16 moveId, const u8 *b)
sub_8072C74(str, gOtherText_ThreeDashes2, 32, 2);
else
sub_8072C14(str, gBattleMoves[moveId].power, 32, 2);
- MenuPrint(str, b[0], b[1]);
+ Menu_PrintText(str, b[0], b[1]);
break;
case 4:
if (gBattleMoves[moveId].accuracy == 0)
sub_8072C74(str, gOtherText_ThreeDashes2, 32, 2);
else
sub_8072C14(str, gBattleMoves[moveId].accuracy, 32, 2);
- MenuPrint(str, b[0], b[1]);
+ Menu_PrintText(str, b[0], b[1]);
break;
case 6:
- MenuZeroFillWindowRect(b[0], b[1], b[0], b[1] + 1);
+ Menu_EraseWindowRect(b[0], b[1], b[0], b[1] + 1);
numHearts = gContestEffects[gContestMoves[moveId].effect].appeal / 10;
if (numHearts == 255)
numHearts = 0;
@@ -995,7 +995,7 @@ void PrintMoveInfo(u16 moveId, const u8 *b)
}
break;
case 7:
- MenuZeroFillWindowRect(b[0], b[1], b[0], b[1] + 1);
+ Menu_EraseWindowRect(b[0], b[1], b[0], b[1] + 1);
numHearts = gContestEffects[gContestMoves[moveId].effect].jam / 10;
if (numHearts == 255)
numHearts = 0;
@@ -1037,7 +1037,7 @@ void sub_8133AEC(bool8 contestInfo, int unused)
{
u8 r1 = var * 2 + 9;
- MenuFillWindowRectWithBlankTile(11, r1, 28, 12);
+ Menu_BlankWindowRect(11, r1, 28, 12);
}
}
}
@@ -1045,22 +1045,22 @@ void sub_8133AEC(bool8 contestInfo, int unused)
{
if (contestInfo)
{
- MenuZeroFillWindowRect(gUnknown_08402E24[5][0], gUnknown_08402E24[5][1], gUnknown_08402E24[5][0], gUnknown_08402E24[5][1] + 1);
- MenuZeroFillWindowRect(gUnknown_08402E24[6][0], gUnknown_08402E24[6][1], gUnknown_08402E24[6][0], gUnknown_08402E24[6][1] + 1);
+ Menu_EraseWindowRect(gUnknown_08402E24[5][0], gUnknown_08402E24[5][1], gUnknown_08402E24[5][0], gUnknown_08402E24[5][1] + 1);
+ Menu_EraseWindowRect(gUnknown_08402E24[6][0], gUnknown_08402E24[6][1], gUnknown_08402E24[6][0], gUnknown_08402E24[6][1] + 1);
for (i = 0; i < 16; i++)
gSprites[sLearnMoveStruct->spriteIDs[i + 4]].invisible = TRUE;
}
else
{
- MenuZeroFillWindowRect(gUnknown_08402E24[1][0], gUnknown_08402E24[1][1], gUnknown_08402E24[1][0] + 3, gUnknown_08402E24[1][1] + 1);
- MenuZeroFillWindowRect(gUnknown_08402E24[3][0], gUnknown_08402E24[3][1], gUnknown_08402E24[3][0] + 3, gUnknown_08402E24[3][1] + 1);
+ Menu_EraseWindowRect(gUnknown_08402E24[1][0], gUnknown_08402E24[1][1], gUnknown_08402E24[1][0] + 3, gUnknown_08402E24[1][1] + 1);
+ Menu_EraseWindowRect(gUnknown_08402E24[3][0], gUnknown_08402E24[3][1], gUnknown_08402E24[3][0] + 3, gUnknown_08402E24[3][1] + 1);
}
- MenuZeroFillWindowRect(11, 9, 28, 12);
+ Menu_EraseWindowRect(11, 9, 28, 12);
}
}
void sub_8133CA4(void)
{
- MenuZeroFillWindowRect(21, 7, 27, 12);
+ Menu_EraseWindowRect(21, 7, 27, 12);
sub_8133AEC(sLearnMoveStruct->showContestInfo, 0);
}
diff --git a/src/pokemon/mail.c b/src/pokemon/mail.c
index 2ab05ca2b..c49c6d350 100644
--- a/src/pokemon/mail.c
+++ b/src/pokemon/mail.c
@@ -369,7 +369,7 @@ static u8 sub_80F8A28(void)
RETURN_UP_STATE;
case 9:
- MenuZeroFillScreen();
+ Menu_EraseScreen();
RETURN_UP_STATE;
case 10: CpuFill16(1, (void *)(VRAM + 0x4800), 0x800);
@@ -528,11 +528,11 @@ static void sub_80F8E80(void)
x = ewram0_4.var10C->var4[pos].unk_0_4;
y += ewram0_4.var10C->var4[pos].unk_0_0;
- MenuPrint(ewram0_4.words[pos], ewram0_4.var10C->var3_4 + x, ewram0_4.var10C->var3_0 + y);
+ Menu_PrintText(ewram0_4.words[pos], ewram0_4.var10C->var3_4 + x, ewram0_4.var10C->var3_0 + y);
y += 2;
}
- MenuPrint(ewram0_4.varD8, ewram0_4.varF9, ewram0_4.var10C->var1);
+ Menu_PrintText(ewram0_4.varD8, ewram0_4.varF9, ewram0_4.var10C->var1);
}
static void sub_80F8F18(void)
diff --git a/src/pokemon/mon_markings.c b/src/pokemon/mon_markings.c
index b4144ea34..eeefa8431 100644
--- a/src/pokemon/mon_markings.c
+++ b/src/pokemon/mon_markings.c
@@ -312,7 +312,7 @@ void sub_80F727C(struct PokemonMarkMenu *ptr)
void sub_80F728C(void)
{
- const struct FrameGraphics *frame = GetTextWindowFrameGraphics(gSaveBlock2.optionsWindowFrameType);
+ const struct FrameGraphics *frame = TextWindow_GetFrameGraphics(gSaveBlock2.optionsWindowFrameType);
sMenu->frameTiles = frame->tiles;
sMenu->framePalette = frame->palette;
sMenu->tileLoadState = 0;
diff --git a/src/pokemon/pokeblock_feed.c b/src/pokemon/pokeblock_feed.c
index 8e3adda12..028ae71a0 100644
--- a/src/pokemon/pokeblock_feed.c
+++ b/src/pokemon/pokeblock_feed.c
@@ -559,7 +559,7 @@ static bool8 TransitionToPokeblockFeedScene(void)
gMain.state++;
break;
case 10:
- MenuDrawTextWindow(0, 14, 29, 19);
+ Menu_DrawStdWindowFrame(0, 14, 29, 19);
gMain.state++;
break;
case 11:
@@ -715,7 +715,7 @@ static void LaunchPokeblockFeedTask(u8 a0)
static void Task_WaitForAtePokeblockText(u8 taskID)
{
- if (MenuUpdateWindowText() == 1)
+ if (Menu_UpdateWindowText() == 1)
gTasks[taskID].func = Task_PaletteFadeToReturn;
}
diff --git a/src/pokemon/pokedex.c b/src/pokemon/pokedex.c
index 1c1c71454..83820f4cc 100644
--- a/src/pokemon/pokedex.c
+++ b/src/pokemon/pokedex.c
@@ -2241,7 +2241,7 @@ static void sub_808DEB0(u16 a, u8 b, u8 c, u16 d)
text[3] = EOS;
*(u16 *)(VRAM + d * 0x800 + c * 0x40 + b * 2) = unk[0];
*(u16 *)(VRAM + d * 0x800 + (c + 1) * 0x40 + b * 2) = unk[1];
- MenuPrint(text, b - 15, c);
+ Menu_PrintText(text, b - 15, c);
}
static void sub_808DF88(u16 a, u8 b, u8 c, u16 d)
@@ -2961,20 +2961,20 @@ static void Task_InitPageScreenMultistep(u8 taskId)
else
sub_8091154(gUnknown_0202FFBC->dexNum, 0xD, 3);
sub_80911C8(gUnknown_0202FFBC->dexNum, 0x10, 3);
- MenuPrint(gDexText_UnknownPoke, CATEGORY_LEFT, 5);
- MenuPrint(gDexText_UnknownHeight, 16, 7);
- MenuPrint(gDexText_UnknownWeight, 16, 9);
+ Menu_PrintText(gDexText_UnknownPoke, CATEGORY_LEFT, 5);
+ Menu_PrintText(gDexText_UnknownHeight, 16, 7);
+ Menu_PrintText(gDexText_UnknownWeight, 16, 9);
if (gUnknown_0202FFBC->owned)
{
sub_8091304(gPokedexEntries[gUnknown_0202FFBC->dexNum].categoryName, CATEGORY_LEFT, 5);
sub_8091458(gPokedexEntries[gUnknown_0202FFBC->dexNum].height, 16, 7);
sub_8091564(gPokedexEntries[gUnknown_0202FFBC->dexNum].weight, 16, 9);
- MenuPrint(gPokedexEntries[gUnknown_0202FFBC->dexNum].descriptionPage1, 2, 13);
+ Menu_PrintText(gPokedexEntries[gUnknown_0202FFBC->dexNum].descriptionPage1, 2, 13);
sub_80917CC(14, 0x3FC);
}
else
{
- MenuPrint(gUnknown_083A05F8, 2, 13);
+ Menu_PrintText(gUnknown_083A05F8, 2, 13);
LoadPalette(gPlttBufferUnfaded + 1, 0x31, 0x1E);
}
gMain.state++;
@@ -3211,7 +3211,7 @@ static void Task_InitCryScreenMultistep(u8 taskId)
gMain.state++;
break;
case 4:
- MenuPrint(gDexText_CryOf, 10, 4);
+ Menu_PrintText(gDexText_CryOf, 10, 4);
sub_8091260(gUnknown_0202FFBC->dexNum, 10, 6, 2);
gMain.state++;
break;
@@ -3853,13 +3853,13 @@ static void sub_8090750(u8 taskId)
else
sub_8091154(dexNum, 13, 3);
sub_80911C8(dexNum, 16, 3);
- MenuPrint(gDexText_UnknownPoke, CATEGORY_LEFT, 5);
- MenuPrint(gDexText_UnknownHeight, 16, 7);
- MenuPrint(gDexText_UnknownWeight, 16, 9);
+ Menu_PrintText(gDexText_UnknownPoke, CATEGORY_LEFT, 5);
+ Menu_PrintText(gDexText_UnknownHeight, 16, 7);
+ Menu_PrintText(gDexText_UnknownWeight, 16, 9);
sub_8091304(gPokedexEntries[dexNum].categoryName, CATEGORY_LEFT, 5);
sub_8091458(gPokedexEntries[dexNum].height, 16, 7);
sub_8091564(gPokedexEntries[dexNum].weight, 16, 9);
- MenuPrint(gPokedexEntries[dexNum].descriptionPage1, 2, 13);
+ Menu_PrintText(gPokedexEntries[dexNum].descriptionPage1, 2, 13);
sub_80917CC(14, 0x3FC);
gTasks[taskId].data[0]++;
break;
@@ -3906,8 +3906,8 @@ static void sub_8090A3C(u8 taskId)
{
u16 r4 = gTasks[taskId].data[1];
- MenuZeroFillWindowRect(2, 13, 27, 19);
- MenuPrint(gPokedexEntries[r4].descriptionPage2, 2, 13);
+ Menu_EraseWindowRect(2, 13, 27, 19);
+ Menu_PrintText(gPokedexEntries[r4].descriptionPage2, 2, 13);
(*(u16 *)(VRAM + 0x7ACA))++;
(*(u16 *)(VRAM + 0x7B0A))++;
gTasks[taskId].data[4] = 1;
@@ -3970,8 +3970,8 @@ static void sub_8090C68(void)
{
if (gPokedexView->descriptionPageNum == 0)
{
- MenuZeroFillWindowRect(2, 13, 27, 19);
- MenuPrint(gPokedexEntries[gUnknown_0202FFBC->dexNum].descriptionPage2, 2, 13);
+ Menu_EraseWindowRect(2, 13, 27, 19);
+ Menu_PrintText(gPokedexEntries[gUnknown_0202FFBC->dexNum].descriptionPage2, 2, 13);
gPokedexView->descriptionPageNum = 1;
(*(u16 *)(VRAM + 0x7ACA))++;
(*(u16 *)(VRAM + 0x7B0A))++;
@@ -3979,8 +3979,8 @@ static void sub_8090C68(void)
}
else
{
- MenuZeroFillWindowRect(2, 13, 27, 19);
- MenuPrint(gPokedexEntries[gUnknown_0202FFBC->dexNum].descriptionPage1, 2, 13);
+ Menu_EraseWindowRect(2, 13, 27, 19);
+ Menu_PrintText(gPokedexEntries[gUnknown_0202FFBC->dexNum].descriptionPage1, 2, 13);
gPokedexView->descriptionPageNum = 0;
(*(u16 *)(VRAM + 0x7ACA))--;
(*(u16 *)(VRAM + 0x7B0A))--;
@@ -4190,7 +4190,7 @@ static void sub_8091154(u16 order, u8 b, u8 c)
str[1] = CHAR_0 + (order % 100) / 10;
str[2] = CHAR_0 + (order % 100) % 10;
str[3] = EOS;
- MenuPrint(str, b, c);
+ Menu_PrintText(str, b, c);
}
static u8 sub_80911C8(u16 num, u8 b, u8 c)
@@ -4212,7 +4212,7 @@ static u8 sub_80911C8(u16 num, u8 b, u8 c)
str[i] = 0xAE;
break;
}
- MenuPrint(str, b, c);
+ Menu_PrintText(str, b, c);
return i;
}
@@ -4237,7 +4237,7 @@ static u8 sub_8091260(u16 num, u8 b, u8 c, u8 d)
break;
}
end[i] = EOS;
- MenuPrint(str, b, c);
+ Menu_PrintText(str, b, c);
return i;
}
@@ -4297,7 +4297,7 @@ void unref_sub_80913A4(u16 a, u8 left, u8 top)
str[3] = CHAR_PERIOD;
str[4] = CHAR_0 + ((a % 1000) % 100) % 10;
str[5] = EOS;
- MenuPrint(str, left, top);
+ Menu_PrintText(str, left, top);
}
#elif GERMAN
void unref_sub_80913A4(u16 arg0, u8 left, u8 top) {
@@ -4341,7 +4341,7 @@ void unref_sub_80913A4(u16 arg0, u8 left, u8 top) {
buffer[r6++] = EOS;
buffer[2] = offset;
- MenuPrint(buffer, left, top);
+ Menu_PrintText(buffer, left, top);
}
#endif
@@ -4378,7 +4378,7 @@ static void sub_8091458(u16 height, u8 left, u8 top)
buffer[i++] = (inches % 10) + CHAR_0;
buffer[i++] = CHAR_DOUBLE_PRIME;
buffer[i++] = EOS;
- MenuPrint(buffer, left, top);
+ Menu_PrintText(buffer, left, top);
}
#else
static void sub_8091458(u16 height, u8 left, u8 top)
@@ -4448,7 +4448,7 @@ static void sub_8091564(u16 weight, u8 left, u8 top)
buffer[i++] = CHAR_s;
buffer[i++] = CHAR_PERIOD;
buffer[i++] = EOS;
- MenuPrint(buffer, left, top);
+ Menu_PrintText(buffer, left, top);
}
#else
static void sub_8091564(u16 arg0, u8 left, u8 top)
@@ -5036,7 +5036,7 @@ static void sub_8092644(u8 taskId)
{
sub_814ADC8();
PlaySE(SE_PIN);
- MenuZeroFillWindowRect(18, 1, 28, 12);
+ Menu_EraseWindowRect(18, 1, 28, 12);
sub_8092C8C(1);
gTasks[taskId].func = sub_809217C;
return;
@@ -5045,7 +5045,7 @@ static void sub_8092644(u8 taskId)
{
sub_814ADC8();
PlaySE(SE_BOWA);
- MenuZeroFillWindowRect(18, 1, 28, 12);
+ Menu_EraseWindowRect(18, 1, 28, 12);
sub_8092C8C(1);
*p1 = gTasks[taskId].data[14];
*p2 = gTasks[taskId].data[15];
@@ -5374,13 +5374,13 @@ static void sub_8092D78(u8 taskId)
u16 i;
u16 j;
- MenuZeroFillWindowRect(18, 1, 28, 12);
+ Menu_EraseWindowRect(18, 1, 28, 12);
for (i = 0, j = *r7; i < 6 && r6[j].text2 != NULL; i++, j++)
{
#ifndef NONMATCHING
j += 0; // Useless statement needed to match
#endif
- MenuPrint(r6[j].text2, 18, i * 2 + 1);
+ Menu_PrintText(r6[j].text2, 18, i * 2 + 1);
}
sub_8091E20(r6[*r8 + *r7].text1);
}
diff --git a/src/pokemon/pokemon_menu.c b/src/pokemon/pokemon_menu.c
index 6c3c6c2b8..da9a18148 100644
--- a/src/pokemon/pokemon_menu.c
+++ b/src/pokemon/pokemon_menu.c
@@ -229,7 +229,7 @@ static void sub_8089A8C(void)
static void sub_8089BDC(u8 arg0, u8 arg1, u8 arg2, u8 noOfOptions, const struct MenuAction2 *menuActions, const u8 *order, u8 arg6)
{
PrintPartyMenuPromptText(5, arg6);
- MenuDrawTextWindow(arg0, arg1, arg0 + arg2, (noOfOptions * 2) + arg1 + 1);
+ Menu_DrawStdWindowFrame(arg0, arg1, arg0 + arg2, (noOfOptions * 2) + arg1 + 1);
PrintMenuItemsReordered(arg0 + 1, arg1 + 1, noOfOptions, menuActions, order);
}
@@ -279,13 +279,13 @@ static void sub_8089D94(u8 taskID)
if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_UP)
{
PlaySE(SE_SELECT);
- sPokeMenuCursorPos = MoveMenuCursor(-1);
+ sPokeMenuCursorPos = Menu_MoveCursor(-1);
sub_808B5B4(taskID);
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN)
{
PlaySE(SE_SELECT);
- sPokeMenuCursorPos = MoveMenuCursor(1);
+ sPokeMenuCursorPos = Menu_MoveCursor(1);
sub_808B5B4(taskID);
}
else if (gMain.newKeys & A_BUTTON)
@@ -363,7 +363,7 @@ static void PokemonMenu_Summary(u8 taskID)
void DoPokemonMenu_Switch(u8 taskID)
{
SetTaskFuncWithFollowupFunc(taskID, SetupDefaultPartyMenuSwitchPokemon, HandleDefaultPartyMenu);
- MenuZeroFillWindowRect(19, 0, 29, 19);
+ Menu_EraseWindowRect(19, 0, 29, 19);
}
static void PokemonMenu_Switch(u8 taskID)
@@ -378,12 +378,12 @@ static void sub_808A060(u8 taskID)
{
if (gMain.newKeys == DPAD_UP && sPokeMenuCursorPos != 0)
{
- sPokeMenuCursorPos = MoveMenuCursor(-1);
+ sPokeMenuCursorPos = Menu_MoveCursor(-1);
PlaySE(SE_SELECT);
}
if (gMain.newKeys == DPAD_DOWN && sPokeMenuCursorPos != 2)
{
- sPokeMenuCursorPos = MoveMenuCursor(1);
+ sPokeMenuCursorPos = Menu_MoveCursor(1);
PlaySE(SE_SELECT);
}
if (gMain.newKeys & A_BUTTON)
@@ -409,7 +409,7 @@ static void PokemonMenu_Item(u8 taskID)
{
HandleDestroyMenuCursors();
sPokeMenuCursorPos = 0;
- MenuZeroFillWindowRect(19, 0, 29, 19);
+ Menu_EraseWindowRect(19, 0, 29, 19);
gTasks[taskID].func = sub_808A100;
}
@@ -442,7 +442,7 @@ static void sub_808A228(u8 taskID)
}
else
{
- MenuZeroFillWindowRect(0, 0, 29, 19);
+ Menu_EraseWindowRect(0, 0, 29, 19);
PrintPartyMenuPromptText(0, 0);
gTasks[taskID].func = HandleDefaultPartyMenu;
}
@@ -601,7 +601,7 @@ static void sub_808A678(u8 taskID)
static void PokemonMenu_TakeItem(u8 taskID)
{
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(19, 0, 29, 19);
+ Menu_EraseWindowRect(19, 0, 29, 19);
sub_806D5A4();
PartyMenuTryGiveMonHeldItem_806ECE8(taskID, sub_808A678);
}
@@ -609,7 +609,7 @@ static void PokemonMenu_TakeItem(u8 taskID)
static void PokemonMenu_TakeMail(u8 taskID)
{
HandleDestroyMenuCursors();
- MenuZeroFillWindowRect(19, 0, 29, 19);
+ Menu_EraseWindowRect(19, 0, 29, 19);
sub_806D5A4();
DoTakeMail(taskID, sub_808A678);
}
@@ -618,7 +618,7 @@ static void PokemonMenu_Mail(u8 taskID)
{
HandleDestroyMenuCursors();
sPokeMenuCursorPos = 0;
- MenuZeroFillWindowRect(19, 0, 29, 19);
+ Menu_EraseWindowRect(19, 0, 29, 19);
ShowPartyPopupMenu(0, &sUnknown_0839F584, (void*) sPokemonMenuActions, 0);
gTasks[taskID].func = sub_808A73C;
}
@@ -629,17 +629,17 @@ static void sub_808A73C(u8 taskID)
{
PlaySE(SE_SELECT);
if (sPokeMenuCursorPos == 0)
- sPokeMenuCursorPos = MoveMenuCursor(sUnknown_0839F584.numChoices - 1);
+ sPokeMenuCursorPos = Menu_MoveCursor(sUnknown_0839F584.numChoices - 1);
else
- sPokeMenuCursorPos = MoveMenuCursor(-1);
+ sPokeMenuCursorPos = Menu_MoveCursor(-1);
}
if (gMain.newAndRepeatedKeys == DPAD_DOWN)
{
PlaySE(SE_SELECT);
if (sPokeMenuCursorPos == sUnknown_0839F584.numChoices - 1)
- sPokeMenuCursorPos = MoveMenuCursor(1 - sUnknown_0839F584.numChoices);
+ sPokeMenuCursorPos = Menu_MoveCursor(1 - sUnknown_0839F584.numChoices);
else
- sPokeMenuCursorPos = MoveMenuCursor(1);
+ sPokeMenuCursorPos = Menu_MoveCursor(1);
}
if (gMain.newKeys & A_BUTTON)
{
@@ -679,7 +679,7 @@ static void sub_808A8A8(void)
static void sub_808A8D4(u8 taskID)
{
sPokeMenuCursorPos = 0;
- MenuZeroFillWindowRect(19, 0, 29, 19);
+ Menu_EraseWindowRect(19, 0, 29, 19);
PrintPartyMenuPromptText(0, 0);
gTasks[taskID].func = HandleDefaultPartyMenu;
}
@@ -695,7 +695,7 @@ static void PokemonMenu_CancelSubmenu(u8 taskID)
{
HandleDestroyMenuCursors();
PlaySE(SE_SELECT);
- MenuZeroFillWindowRect(19, 0, 29, 19);
+ Menu_EraseWindowRect(19, 0, 29, 19);
sub_806D5A4();
sub_8089C7C(sPokeMenuCursorPos);
gTasks[taskID].func = sub_8089D94;
@@ -715,7 +715,7 @@ static void PokemonMenu_FieldMove(u8 taskID)
tFieldMoveId = sPokeMenuOptionsOrder[sPokeMenuCursorPos] - POKEMENU_FIRST_FIELD_MOVE_ID;
if (sub_80F9344() == TRUE)
{
- MenuZeroFillWindowRect(19, 0, 29, 19);
+ Menu_EraseWindowRect(19, 0, 29, 19);
if (IS_SOFTBOILED_MILKDRINK(tFieldMoveId))
PrintPartyMenuPromptText(9, 0);
else
@@ -725,7 +725,7 @@ static void PokemonMenu_FieldMove(u8 taskID)
else if (tFieldMoveId <= 7 && FlagGet(FLAG_BADGE01_GET + tFieldMoveId) != TRUE)
{
// can't use a field HM move without a proper badge
- MenuZeroFillWindowRect(19, 0, 29, 19);
+ Menu_EraseWindowRect(19, 0, 29, 19);
sub_806D5A4();
sub_806E834(gOtherText_CantBeUsedBadge, 1);
gTasks[taskID].func = sub_808AAF0;
@@ -745,7 +745,7 @@ static void PokemonMenu_FieldMove(u8 taskID)
}
else
{
- MenuZeroFillWindowRect(19, 0, 29, 19);
+ Menu_EraseWindowRect(19, 0, 29, 19);
if (IS_SURF(tFieldMoveId) && TestPlayerAvatarFlags(8))
PrintPartyMenuPromptText(8, 0);
else
@@ -759,7 +759,7 @@ static void sub_808AAF0(u8 taskID)
{
if (gUnknown_0202E8F6 != 1 && (gMain.newKeys & A_BUTTON || gMain.newKeys & B_BUTTON))
{
- MenuZeroFillWindowRect(0, 14, 29, 19);
+ Menu_EraseWindowRect(0, 14, 29, 19);
PokemonMenu_Cancel(taskID);
}
}
@@ -798,7 +798,7 @@ static void sub_808ABF4(u8 taskID)
{
if (gMain.newKeys & A_BUTTON || gMain.newKeys & B_BUTTON)
{
- MenuZeroFillWindowRect(1, 17, 28, 18);
+ Menu_EraseWindowRect(1, 17, 28, 18);
PokemonMenu_Cancel(taskID);
}
}
diff --git a/src/pokemon/pokemon_storage_system.c b/src/pokemon/pokemon_storage_system.c
index 4a68b846a..001cebe45 100644
--- a/src/pokemon/pokemon_storage_system.c
+++ b/src/pokemon/pokemon_storage_system.c
@@ -16,7 +16,7 @@ EWRAM_DATA struct PokemonStorage gPokemonStorage = {0};
void sub_8098898(u8 index) {
u8 *ptr;
- MenuDrawTextWindow(10, 16, 29, 19);
+ Menu_DrawStdWindowFrame(10, 16, 29, 19);
switch (gUnknown_083B6DF4[index].format)
{
@@ -89,5 +89,5 @@ void sub_8098898(u8 index) {
}
ptr[0] = EOS;
- MenuPrint(gUnk2002694, 11, 17);
+ Menu_PrintText(gUnk2002694, 11, 17);
}
diff --git a/src/pokemon/pokemon_summary_screen.c b/src/pokemon/pokemon_summary_screen.c
index 9563bc08f..0887c6648 100644
--- a/src/pokemon/pokemon_summary_screen.c
+++ b/src/pokemon/pokemon_summary_screen.c
@@ -1037,7 +1037,7 @@ static void sub_809E260(u8 taskId)
{
if (pssData.page == PSS_PAGE_CONTEST_MOVES && (pssData.selectedMoveIndex != 4 || pssData.moveToLearn != 0))
{
- MenuZeroFillWindowRect(0, 14, 9, 18);
+ Menu_EraseWindowRect(0, 14, 9, 18);
}
SummaryScreenHandleLeftRightInput(taskId, -1);
@@ -1048,7 +1048,7 @@ static void sub_809E260(u8 taskId)
{
if (pssData.page == PSS_PAGE_BATTLE_MOVES && (pssData.selectedMoveIndex != 4 || pssData.moveToLearn != 0))
{
- MenuZeroFillWindowRect(0, 14, 9, 18);
+ Menu_EraseWindowRect(0, 14, 9, 18);
}
SummaryScreenHandleLeftRightInput(taskId, 1);
@@ -1482,8 +1482,8 @@ static void sub_809EAC8(u8 taskId)
sub_80A1B1C(9);
sub_80A16CC(1);
- MenuZeroFillWindowRect(15, 12, 28, 13);
- MenuZeroFillWindowRect(11, 15, 28, 18);
+ Menu_EraseWindowRect(15, 12, 28, 13);
+ Menu_EraseWindowRect(11, 15, 28, 18);
pssData.headerActionTextId = 6;
PrintSummaryWindowHeaderText();
@@ -2371,7 +2371,7 @@ void sub_809F814(u8 taskId)
{
if (pssData.page == PSS_PAGE_CONTEST_MOVES && (pssData.selectedMoveIndex != 4 || pssData.moveToLearn != 0))
{
- MenuZeroFillWindowRect(0, 14, 9, 18);
+ Menu_EraseWindowRect(0, 14, 9, 18);
}
gTasks[taskId].func = sub_809E260;
@@ -2387,7 +2387,7 @@ void sub_809F814(u8 taskId)
{
if (pssData.page == PSS_PAGE_BATTLE_MOVES && (pssData.selectedMoveIndex != 4 || pssData.moveToLearn != 0))
{
- MenuZeroFillWindowRect(0, 14, 9, 18);
+ Menu_EraseWindowRect(0, 14, 9, 18);
}
gTasks[taskId].func = sub_809E260;
@@ -2414,8 +2414,8 @@ static void sub_809F9D0(u8 taskId, u8 b)
sub_80A1488(-2, 4);
sub_80A1654(-2, 4);
- MenuZeroFillWindowRect(11, 15, 28, 18);
- MenuPrint(gOtherText_CantForgetHMs, 11, 15);
+ Menu_EraseWindowRect(11, 15, 28, 18);
+ Menu_PrintText(gOtherText_CantForgetHMs, 11, 15);
gTasks[taskId].func = sub_809F814;
}
@@ -2494,9 +2494,9 @@ static void sub_809FAC8(struct Pokemon *mon)
if (GetMonData(mon, MON_DATA_IS_EGG))
{
- MenuZeroFillWindowRect(1, 2, 4, 3);
- MenuZeroFillWindowRect(3, 16, 9, 17);
- MenuZeroFillWindowRect(0, 12, 11, 15);
+ Menu_EraseWindowRect(1, 2, 4, 3);
+ Menu_EraseWindowRect(3, 16, 9, 17);
+ Menu_EraseWindowRect(0, 12, 11, 15);
GetMonNickname(mon, gStringVar1);
sub_80A1FF8(gStringVar1, 13, 3, 16);
LoadPalette(sUnknown_083C157C, 4, 2);
@@ -2520,7 +2520,7 @@ static void sub_809FAC8(struct Pokemon *mon)
}
else
{
- MenuZeroFillWindowRect(1, 2, 4, 3);
+ Menu_EraseWindowRect(1, 2, 4, 3);
}
buffer = gStringVar1;
@@ -2530,7 +2530,7 @@ static void sub_809FAC8(struct Pokemon *mon)
buffer[1] = 0x13;
buffer[2] = 0x3C;
buffer[3] = EOS;
- MenuPrint(gStringVar1, 1, 12);
+ Menu_PrintText(gStringVar1, 1, 12);
sub_80A0958(mon);
}
@@ -2545,12 +2545,12 @@ static void sub_809FBE4(void)
sub_80A1918(i, 1);
}
- MenuZeroFillWindowRect(11, 4, 29, 18);
+ Menu_EraseWindowRect(11, 4, 29, 18);
}
static void sub_809FC0C(void)
{
- MenuPrint(gOtherText_Type2, 11, 6);
+ Menu_PrintText(gOtherText_Type2, 11, 6);
GetStringCenterAlignXOffset(0, 22, 4);
GetStringCenterAlignXOffset(2, 23, 4);
}
@@ -2569,7 +2569,7 @@ static void sub_809FC34(struct Pokemon *mon)
sub_80A1918(i, 1);
}
- MenuZeroFillWindowRect(11, 9, 28, 12);
+ Menu_EraseWindowRect(11, 9, 28, 12);
if (GetMonData(mon, MON_DATA_IS_EGG))
{
buffer = gStringVar1;
@@ -2580,7 +2580,7 @@ static void sub_809FC34(struct Pokemon *mon)
buffer[1] = 0x13;
buffer[2] = 0x4E;
buffer[3] = EOS;
- MenuPrint(gStringVar1, 11, 4);
+ Menu_PrintText(gStringVar1, 11, 4);
sub_80A1EF8(gOtherText_FiveQuestionsAndSlash, 13, 193, 32, 1);
sub_80A198C(9, 120, 48, 0);
@@ -2588,19 +2588,19 @@ static void sub_809FC34(struct Pokemon *mon)
friendship = GetMonData(mon, MON_DATA_FRIENDSHIP);
if (friendship < 6)
{
- MenuPrint(gOtherText_EggAbout, 11, 9);
+ Menu_PrintText(gOtherText_EggAbout, 11, 9);
}
else if (friendship < 11)
{
- MenuPrint(gOtherText_EggSoon, 11, 9);
+ Menu_PrintText(gOtherText_EggSoon, 11, 9);
}
else if (friendship < 41)
{
- MenuPrint(gOtherText_EggSomeTime, 11, 9);
+ Menu_PrintText(gOtherText_EggSomeTime, 11, 9);
}
else
{
- MenuPrint(gOtherText_EggLongTime, 11, 9);
+ Menu_PrintText(gOtherText_EggLongTime, 11, 9);
}
PokemonSummaryScreen_PrintEggTrainerMemo(mon, 11, 14);
@@ -2629,7 +2629,7 @@ static void sub_809FC34(struct Pokemon *mon)
buffer[1] = 0x13;
buffer[2] = 0x4E;
buffer[3] = EOS;
- MenuPrint(gStringVar1, 11, 4);
+ Menu_PrintText(gStringVar1, 11, 4);
sub_80A1F98(GetMonData(mon, MON_DATA_OT_ID) & 0xFFFF, 13, 5, 2, 193, 32, 1);
@@ -2642,7 +2642,7 @@ static void sub_809FC34(struct Pokemon *mon)
ability = GetAbilityBySpecies(GetMonData(mon, MON_DATA_SPECIES), GetMonData(mon, MON_DATA_ALT_ABILITY));
sub_80A1FF8(gAbilityNames[ability], 13, 11, 9);
- MenuPrint(gAbilityDescriptions[ability], 11, 11);
+ Menu_PrintText(gAbilityDescriptions[ability], 11, 11);
PokemonSummaryScreen_PrintTrainerMemo(mon, 11, 14);
}
@@ -2656,17 +2656,17 @@ static void sub_809FE6C(struct Pokemon *mon)
static void sub_809FE80(void)
{
- MenuZeroFillWindowRect(14, 4, 18, 5);
- MenuZeroFillWindowRect(25, 4, 30, 5);
- MenuZeroFillWindowRect(11, 9, 28, 12);
- MenuZeroFillWindowRect(11, 14, 28, 17);
+ Menu_EraseWindowRect(14, 4, 18, 5);
+ Menu_EraseWindowRect(25, 4, 30, 5);
+ Menu_EraseWindowRect(11, 9, 28, 12);
+ Menu_EraseWindowRect(11, 14, 28, 17);
}
static void sub_809FEB8(void)
{
sub_80A1FF8(gOtherText_ExpPoints, 13, 11, 14);
sub_80A1FF8(gOtherText_NextLv, 13, 11, 16);
- MenuPrint(gOtherText_Terminator18, 21, 16);
+ Menu_PrintText(gOtherText_Terminator18, 21, 16);
sub_80A1F48(gOtherText_HP, 13, 11, 7, 42);
sub_80A1F48(gOtherText_Attack, 13, 11, 9, 42);
@@ -2727,12 +2727,12 @@ static void sub_80A0090(struct Pokemon *mon)
static void sub_80A00A4(void)
{
- MenuZeroFillWindowRect(11, 4, 19, 5);
- MenuZeroFillWindowRect(16, 7, 21, 8);
- MenuZeroFillWindowRect(17, 9, 21, 12);
- MenuZeroFillWindowRect(27, 7, 29, 12);
- MenuZeroFillWindowRect(22, 14, 28, 15);
- MenuZeroFillWindowRect(23, 16, 28, 17);
+ Menu_EraseWindowRect(11, 4, 19, 5);
+ Menu_EraseWindowRect(16, 7, 21, 8);
+ Menu_EraseWindowRect(17, 9, 21, 12);
+ Menu_EraseWindowRect(27, 7, 29, 12);
+ Menu_EraseWindowRect(22, 14, 28, 15);
+ Menu_EraseWindowRect(23, 16, 28, 17);
}
static void sub_80A00F4(u8 a)
@@ -2770,7 +2770,7 @@ static void sub_80A015C(struct Pokemon *mon)
{
sub_80A1918(i, 1);
sub_80A1FF8(gOtherText_OneDash, 13, 15, (2 * i) + 4);
- MenuPrint(gOtherText_TwoDashes, 26, (2 * i) + 4);
+ Menu_PrintText(gOtherText_TwoDashes, 26, (2 * i) + 4);
}
else
{
@@ -2793,7 +2793,7 @@ static void sub_80A015C(struct Pokemon *mon)
buffer = sub_8072C14(buffer, curPP, 14, 1);
*buffer++ = CHAR_SLASH;
sub_8072C14(buffer, maxPP, 32, 1);
- MenuPrint(gStringVar1, 25, (2 * i) + 4);
+ Menu_PrintText(gStringVar1, 25, (2 * i) + 4);
}
}
}
@@ -2829,7 +2829,7 @@ static void sub_80A029C(struct Pokemon *mon)
buffer = sub_8072C14(buffer, pp, 14, 1);
*buffer++ = CHAR_SLASH;
buffer = sub_8072C14(buffer, pp, 32, 1);
- MenuPrint(gStringVar1, 25, 12);
+ Menu_PrintText(gStringVar1, 25, 12);
}
static void sub_80A0390(void)
@@ -2838,7 +2838,7 @@ static void sub_80A0390(void)
for (i = 0; i < MAX_MON_MOVES; i++)
{
- MenuZeroFillWindowRect(15, (i * 2) + 4, 28, (i * 2) + 5);
+ Menu_EraseWindowRect(15, (i * 2) + 4, 28, (i * 2) + 5);
}
}
@@ -2883,7 +2883,7 @@ void sub_80A03F0(struct Pokemon *mon, u8 *selectedMoveIndex)
static void sub_80A0428(struct Pokemon *mon, u8 *selectedMoveIndex)
{
u16 move = sub_80A03BC(mon, *selectedMoveIndex);
- MenuZeroFillWindowRect(11, 15, 28, 18);
+ Menu_EraseWindowRect(11, 15, 28, 18);
if (pssData.page == PSS_PAGE_BATTLE_MOVES)
{
@@ -2901,14 +2901,14 @@ static void sub_80A046C(u16 move)
{
if (move == 0xFFFF) return;
- MenuPrint(gMoveDescriptions[move - 1], 11, 15);
+ Menu_PrintText(gMoveDescriptions[move - 1], 11, 15);
}
static void sub_80A0498(u16 move)
{
if (move == 0xFFFF) return;
- MenuPrint(gContestEffectStrings[gContestMoves[move].effect], 11, 15);
+ Menu_PrintText(gContestEffectStrings[gContestMoves[move].effect], 11, 15);
}
static void sub_80A04CC(u16 move)
@@ -2921,26 +2921,26 @@ static void sub_80A04CC(u16 move)
{
buffer = gStringVar1;
buffer = sub_8072C74(buffer, gOtherText_ThreeDashes2, 21, 1);
- MenuPrint(gStringVar1, 7, 15);
+ Menu_PrintText(gStringVar1, 7, 15);
}
else
{
buffer = gStringVar1;
buffer = sub_8072C14(buffer, gBattleMoves[move].power, 21, 1);
- MenuPrint(gStringVar1, 7, 15);
+ Menu_PrintText(gStringVar1, 7, 15);
}
if (gBattleMoves[move].accuracy == 0)
{
buffer = gStringVar1;
buffer = sub_8072C74(buffer, gOtherText_ThreeDashes2, 21, 1);
- MenuPrint(gStringVar1, 7, 17);
+ Menu_PrintText(gStringVar1, 7, 17);
}
else
{
buffer = gStringVar1;
buffer = sub_8072C14(buffer, gBattleMoves[move].accuracy, 21, 1);
- MenuPrint(gStringVar1, 7, 17);
+ Menu_PrintText(gStringVar1, 7, 17);
}
}
@@ -3153,7 +3153,7 @@ static void PokemonSummaryScreen_PrintEggTrainerMemo(struct Pokemon *mon, u8 lef
if (!(gameMet == VERSION_RUBY || gameMet == VERSION_SAPPHIRE || gameMet == VERSION_EMERALD))
{
- MenuPrint(gOtherText_EggObtainedInTrade, left, top);
+ Menu_PrintText(gOtherText_EggObtainedInTrade, left, top);
return;
}
@@ -3162,13 +3162,13 @@ static void PokemonSummaryScreen_PrintEggTrainerMemo(struct Pokemon *mon, u8 lef
if (locationMet == 255)
{
// Eggs received from Pokemon Box.
- MenuPrint(gOtherText_EggNicePlace, left, top);
+ Menu_PrintText(gOtherText_EggNicePlace, left, top);
return;
}
if (!PokemonSummaryScreen_CheckOT(mon))
{
- MenuPrint(gOtherText_EggObtainedInTrade, left, top);
+ Menu_PrintText(gOtherText_EggObtainedInTrade, left, top);
return;
}
@@ -3176,11 +3176,11 @@ static void PokemonSummaryScreen_PrintEggTrainerMemo(struct Pokemon *mon, u8 lef
if (locationMet == 253)
{
- MenuPrint(gOtherText_EggHotSprings, left, top);
+ Menu_PrintText(gOtherText_EggHotSprings, left, top);
return;
}
- MenuPrint(gOtherText_EggDayCare, left, top);
+ Menu_PrintText(gOtherText_EggDayCare, left, top);
}
static void PokemonSummaryScreen_PrintTrainerMemo(struct Pokemon *mon, u8 left, u8 top)
@@ -3285,7 +3285,7 @@ static void PokemonSummaryScreen_PrintTrainerMemo(struct Pokemon *mon, u8 left,
}
}
- MenuPrint(gStringVar4, left++, top++);
+ Menu_PrintText(gStringVar4, left++, top++);
}
static void sub_80A0958(struct Pokemon *mon)
@@ -3310,8 +3310,8 @@ static void sub_80A0958(struct Pokemon *mon)
buffer[2] = 0x50;
buffer[3] = EOS;
- MenuPrint(gStringVar1, 0, 14);
- MenuZeroFillWindowRect(3, 16, 9, 17);
+ Menu_PrintText(gStringVar1, 0, 14);
+ Menu_EraseWindowRect(3, 16, 9, 17);
level = GetMonData(mon, MON_DATA_LEVEL);
@@ -3325,7 +3325,7 @@ static void sub_80A0958(struct Pokemon *mon)
buffer[2] = 0x20;
buffer[3] = EOS;
- MenuPrint(gStringVar1, 3, 16);
+ Menu_PrintText(gStringVar1, 3, 16);
sub_80A0A2C(mon, 7, 16);
}
@@ -3343,7 +3343,7 @@ static void sub_80A0A2C(struct Pokemon *mon, u8 left, u8 top)
{
default:
bottom = top + 1;
- MenuZeroFillWindowRect(left, top, left, bottom);
+ Menu_EraseWindowRect(left, top, left, bottom);
return;
case MON_MALE:
genderSymbol = gOtherText_MaleSymbol2;
@@ -3406,7 +3406,7 @@ static void PrintNumRibbons(struct Pokemon *mon)
ConvertIntToDecimalStringN(&text[3], numRibbons, 1, 2);
}
- MenuPrint(sUnknown_083C15AE, 21, 4);
+ Menu_PrintText(sUnknown_083C15AE, 21, 4);
}
static void PrintHeldItemName(u16 itemId, u8 left, u8 top)
@@ -3427,7 +3427,7 @@ static void PrintHeldItemName(u16 itemId, u8 left, u8 top)
CopyItemName(itemId, gStringVar1);
}
- MenuPrint(sUnknown_083C15B4, left, top);
+ Menu_PrintText(sUnknown_083C15B4, left, top);
}
static void DrawExperienceProgressBar(struct Pokemon *mon, u8 left, u8 top)
@@ -3518,7 +3518,7 @@ static void PrintSummaryWindowHeaderText(void)
buffer[2] = 0x58;
buffer[3] = EOS;
- MenuPrint(gStringVar1, 0, 0);
+ Menu_PrintText(gStringVar1, 0, 0);
if (pssData.headerActionTextId != 0)
{
@@ -3527,7 +3527,7 @@ static void PrintSummaryWindowHeaderText(void)
}
else
{
- MenuZeroFillWindowRect(23, 0, 24, 1);
+ Menu_EraseWindowRect(23, 0, 24, 1);
}
buffer = gStringVar1;
@@ -3539,7 +3539,7 @@ static void PrintSummaryWindowHeaderText(void)
buffer[2] = 0x28;
buffer[3] = EOS;
- MenuPrint(gStringVar1, 25, 0);
+ Menu_PrintText(gStringVar1, 25, 0);
}
// If the given pokemon previously had the pokerus virus, a small
@@ -4138,7 +4138,7 @@ static void sub_80A12D0(s8 a)
{
u8 newTaskId;
- MenuZeroFillWindowRect(1, 18, 5, 19);
+ Menu_EraseWindowRect(1, 18, 5, 19);
sub_80A18E4(29);
newTaskId = CreateTask(sub_80A1048, 0);
@@ -4194,14 +4194,14 @@ static void sub_80A12D0(s8 a)
// }
// else
// {
-// MenuZeroFillWindowRect(0, 19, 9, 19);
+// Menu_EraseWindowRect(0, 19, 9, 19);
// }
// if (gTasks[taskId].data[0] == 0 || gTasks[taskId].data[1] < 0)
// {
// if (pssData.page == PSS_PAGE_BATTLE_MOVES)
// {
-// MenuZeroFillWindowRect(0, 14, 9, 18);
+// Menu_EraseWindowRect(0, 14, 9, 18);
// sub_80A0958(pssData.loadedMon);
// if (GetMonStatusAndPokerus(pssData.loadedMon))
@@ -4327,7 +4327,7 @@ _080A13F4:\n\
movs r1, 0x13\n\
movs r2, 0x9\n\
movs r3, 0x13\n\
- bl MenuZeroFillWindowRect\n\
+ bl Menu_EraseWindowRect\n\
_080A1400:\n\
movs r1, 0\n\
ldrsh r0, [r7, r1]\n\
@@ -4346,7 +4346,7 @@ _080A1410:\n\
movs r1, 0xE\n\
movs r2, 0x9\n\
movs r3, 0x12\n\
- bl MenuZeroFillWindowRect\n\
+ bl Menu_EraseWindowRect\n\
adds r4, 0x10\n\
adds r0, r4, 0\n\
bl sub_80A0958\n\
@@ -4404,7 +4404,7 @@ static void sub_80A1488(s8 a, u8 b)
if (pssData.page == PSS_PAGE_BATTLE_MOVES)
{
- MenuZeroFillWindowRect(0, 14, 9, 19);
+ Menu_EraseWindowRect(0, 14, 9, 19);
}
taskId = FindTaskIdByFunc(sub_80A1334);
@@ -4531,7 +4531,7 @@ _080A15C0:\n\
movs r1, 0x13\n\
movs r2, 0x9\n\
movs r3, 0x13\n\
- bl MenuZeroFillWindowRect\n\
+ bl Menu_EraseWindowRect\n\
_080A15CC:\n\
movs r1, 0\n\
ldrsh r0, [r7, r1]\n\
@@ -4550,7 +4550,7 @@ _080A15DC:\n\
movs r1, 0xE\n\
movs r2, 0x9\n\
movs r3, 0x12\n\
- bl MenuZeroFillWindowRect\n\
+ bl Menu_EraseWindowRect\n\
adds r4, 0x10\n\
adds r0, r4, 0\n\
bl sub_80A0958\n\
@@ -4606,7 +4606,7 @@ static void sub_80A1654(s8 a, u8 b)
if (pssData.page == PSS_PAGE_CONTEST_MOVES)
{
- MenuZeroFillWindowRect(0, 14, 9, 19);
+ Menu_EraseWindowRect(0, 14, 9, 19);
}
taskId = FindTaskIdByFunc(sub_80A1500);
@@ -5272,7 +5272,7 @@ u8 *sub_80A1E9C(u8 *dest, const u8 *src, u8 id)
{
u8 arr[3];
- sub_8072CD4(&arr[0], &arr[1], &arr[2]);
+ Menu_GetTextColors(&arr[0], &arr[1], &arr[2]);
dest = sub_80A1E58(dest, id);
dest = StringCopy(dest, src);
@@ -5313,7 +5313,7 @@ static void sub_80A1F98(s32 value, u8 id, u8 n, u8 mode, u8 left, u16 top, s32 e
static void sub_80A1FF8(const u8 *text, u8 id, u8 left, u8 top)
{
sub_80A1E9C(gStringVar4, text, id);
- MenuPrint(gStringVar4, left, top);
+ Menu_PrintText(gStringVar4, left, top);
}
u8 *PokemonSummaryScreen_CopyPokemonLevel(u8 *dest, u8 level)
diff --git a/src/pokenav_before.c b/src/pokenav_before.c
index 8a67390ad..411a20f79 100644
--- a/src/pokenav_before.c
+++ b/src/pokenav_before.c
@@ -3337,7 +3337,7 @@ void sub_80EF428(u8 a, u8 b)
tileBuffer = gUnknown_083DFEC8;
sub_8072C74(&tileBuffer[0x800], pcText, 0xC0, 2);
- MenuPrint(&tileBuffer[0x800], 3, 17);
+ Menu_PrintText(&tileBuffer[0x800], 3, 17);
}
void sub_80EF490(u8 a)
@@ -3670,7 +3670,7 @@ bool8 sub_80EF874(void)
return TRUE;
break;
case 4:
- MenuZeroFillScreen();
+ Menu_EraseScreen();
break;
case 5:
sub_80FA904(&gUnknown_083DFEC4->regionMap, gSaveBlock2.regionMapZoom ? TRUE : FALSE);
@@ -3691,7 +3691,7 @@ bool8 sub_80EF874(void)
return TRUE;
break;
case 10:
- MenuDrawTextWindow(13, 3, 29, 17);
+ Menu_DrawStdWindowFrame(13, 3, 29, 17);
sub_80EF9F8();
break;
case 11:
@@ -3765,8 +3765,8 @@ void sub_80EF9F8(void)
b = gUnknown_083DFEC4->regionMap.everGrandeCityArea;
if (gUnknown_083DFEC4->unkCDCC[mapSectionId][b] != NULL)
{
- MenuFillWindowRectWithBlankTile(14, top, 15, 15);
- MenuFillWindowRectWithBlankTile(26, top, 28, 15);
+ Menu_BlankWindowRect(14, top, 15, 15);
+ Menu_BlankWindowRect(26, top, 28, 15);
sub_8095C8C((void *)(VRAM + 0xF800), 16, 6, gUnknown_083DFEC4->unkCDCC[mapSectionId][b], 0, 0, 10, 10, 10);
top += 11;
}
@@ -3779,7 +3779,7 @@ void sub_80EF9F8(void)
// Epic fail by the compiler at optimizing this.
if (!someBool && top < 16)
- MenuFillWindowRectWithBlankTile(14, top, 28, 15);
+ Menu_BlankWindowRect(14, top, 28, 15);
if (gUnknown_083DFEC4->regionMap.unk16 == 2)
sub_80EFD74();
@@ -3982,7 +3982,7 @@ bool8 sub_80EFF68(void)
return TRUE;
break;
case 4:
- MenuZeroFillScreen();
+ Menu_EraseScreen();
break;
case 5:
sub_80F1614();
@@ -4050,13 +4050,13 @@ void sub_80F01A4(void)
void sub_80F01E0(u16 a)
{
- MenuPrint(gUnknown_083DFEC4->unk8829[a], 13, 1);
+ Menu_PrintText(gUnknown_083DFEC4->unk8829[a], 13, 1);
if (gUnknown_083DFEC4->unk76AA == 1)
{
- MenuPrint(gUnknown_083DFEC4->unk88E9[a], 13, 3);
+ Menu_PrintText(gUnknown_083DFEC4->unk88E9[a], 13, 3);
sub_80F443C(gUnknown_083DFEC4->unk8788, gUnknown_083DFEC4->unk893c[gUnknown_083DFEC4->unk87DC].unk2);
- MenuPrint(gUnknown_083DFEC4->unk8788, 1, 6);
+ Menu_PrintText(gUnknown_083DFEC4->unk8788, 1, 6);
}
}
@@ -4098,7 +4098,7 @@ bool8 sub_80F02A0(void)
}
break;
case 4:
- MenuZeroFillScreen();
+ Menu_EraseScreen();
break;
case 5:
LZ77UnCompVram(gUnknown_08E9FC64, (void *)VRAM + 0xE800);
@@ -4287,7 +4287,7 @@ _080F035C:\n\
_080F0366:\n\
b _080F0626\n\
_080F0368:\n\
- bl MenuZeroFillScreen\n\
+ bl Menu_EraseScreen\n\
b _080F0618\n\
_080F036E:\n\
ldr r0, _080F0378 @ =gUnknown_08E9FC64\n\
diff --git a/src/rom_800D42C.c b/src/rom_800D42C.c
index bf6d03fb7..9449ca0d1 100644
--- a/src/rom_800D42C.c
+++ b/src/rom_800D42C.c
@@ -28,8 +28,8 @@ extern u8 BattleText_Tie[];
#define PRINT_MESSAGE(text, tileDataStartOffset, x) \
{ \
- InitWindow(&gUnknown_03004210, text, tileDataStartOffset, x, MESSAGE_Y); \
- sub_8002F44(&gUnknown_03004210); \
+ Text_InitWindow(&gUnknown_03004210, text, tileDataStartOffset, x, MESSAGE_Y); \
+ Text_PrintWindow8002F44(&gUnknown_03004210); \
}
#define PRINT_MESSAGE_LEFT(text, tileDataStartOffset) PRINT_MESSAGE(text, tileDataStartOffset, LEFT_MESSAGE_X)
diff --git a/src/roulette.c b/src/roulette.c
index 1d612d071..0253a6bb8 100644
--- a/src/roulette.c
+++ b/src/roulette.c
@@ -625,8 +625,8 @@ void sub_8115384(void)
sub_81182F8(0x6);
sub_811829C(0x0);
sub_8117158(0x0);
- MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13);
- MenuPrint(&gUnknown_081C4157[0], 0x1, 0xF);
+ Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13);
+ Menu_PrintText(&gUnknown_081C4157[0], 0x1, 0xF);
gSpriteCoordOffsetX = -0x3C;
gSpriteCoordOffsetY = 0x0;
gMain.state++;
@@ -693,14 +693,14 @@ void sub_8115734(u8 taskid)
{
DisplayYesNoMenu(0x14, 0x8, 0x1);
sub_814AAF8(0x2D9E);
- MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13);
- MenuPrint(&gUnknown_081C41E3, 0x1, 0xF);
+ Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13);
+ Menu_PrintText(&gUnknown_081C41E3, 0x1, 0xF);
DoYesNoFuncWithChoice(taskid, &gUnknown_083F8EBC);
}
void sub_811577C(u8 taskid)
{
- MenuZeroFillWindowRect(0x14, 0x8, 0x1A, 0xD);
+ Menu_EraseWindowRect(0x14, 0x8, 0x1A, 0xD);
gTasks[taskid].func = &sub_81159BC;
}
@@ -1446,21 +1446,21 @@ void sub_8116638(u8 taskid)
if (gTasks[taskid].data[0x2] == 0xC)
{
PlayFanfare(BGM_ME_B_BIG);
- MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13);
- MenuPrint(&gUnknown_081C41A5, 0x1, 0xF);
+ Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13);
+ Menu_PrintText(&gUnknown_081C41A5, 0x1, 0xF);
}
else
{
PlayFanfare(BGM_ME_B_SMALL);
- MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13);
- MenuPrint(&gUnknown_081C4199, 0x1, 0xF);
+ Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13);
+ Menu_PrintText(&gUnknown_081C4199, 0x1, 0xF);
}
break;
case 0:
default:
m4aSongNumStart(SE_HAZURE);
- MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13);
- MenuPrint(&gUnknown_081C41AE, 0x1, 0xF);
+ Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13);
+ Menu_PrintText(&gUnknown_081C41AE, 0x1, 0xF);
}
gTasks[taskid].data[0x1] = 0x0;
gTasks[taskid].func = &sub_811659C;
@@ -1500,8 +1500,8 @@ void sub_811677C(u8 taskid)
{
ConvertIntToDecimalStringN((u8 *)&gStringVar1, (eRoulette->var19 * gTasks[taskid].data[0x2]), STR_CONV_MODE_LEFT_ALIGN, 0x2);
StringExpandPlaceholders((u8 *)&gStringVar4, &gUnknown_081C41BD);
- MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13);
- MenuPrint((u8 *)&gStringVar4, 0x1, 0xF);
+ Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13);
+ Menu_PrintText((u8 *)&gStringVar4, 0x1, 0xF);
gTasks[taskid].data[0x1] = (eRoulette->var19 * gTasks[taskid].data[0x2]);
gTasks[taskid].data[0x7] = 0x0;
gTasks[taskid].func = &sub_81166E8;
@@ -1534,14 +1534,14 @@ void sub_8116880(u8 taskid)
{
if (gTasks[taskid].data[0x6] == 0x6)
{
- MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13);
- MenuPrint(&gUnknown_081C41F1, 0x1, 0xF);
+ Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13);
+ Menu_PrintText(&gUnknown_081C41F1, 0x1, 0xF);
sub_8116C34(taskid, &dp01t_12_3_battle_menu, 0xFFFF, 0x3);
}
else if (gTasks[taskid].data[0xD] == 0x270F)
{
- MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13);
- MenuPrint(&gUnknown_081C4231, 0x1, 0xF);
+ Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13);
+ Menu_PrintText(&gUnknown_081C4231, 0x1, 0xF);
sub_8116C34(taskid, &sub_8115734, 0xFFFF, 0x3);
}
else
@@ -1551,8 +1551,8 @@ void sub_8116880(u8 taskid)
}
else
{
- MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13);
- MenuPrint(&gUnknown_081C41D2, 0x1, 0xF);
+ Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13);
+ Menu_PrintText(&gUnknown_081C41D2, 0x1, 0xF);
sub_8116C34(taskid, &sub_81157AC, 0x3C, 0x3);
}
}
@@ -1570,8 +1570,8 @@ void dp01t_12_3_battle_menu(u8 taskid)
gSprites[eRoulette->var3C[i + 0x7]].invisible = FALSE;
if (gTasks[taskid].data[0xD] == 0x270F)
{
- MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13);
- MenuPrint(&gUnknown_081C4231, 0x1, 0xF);
+ Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13);
+ Menu_PrintText(&gUnknown_081C4231, 0x1, 0xF);
sub_8116C34(taskid, &sub_8115734, 0xFFFF, 0x3);
}
else
@@ -2619,8 +2619,8 @@ void sub_8117528(u8 taskid)
void sub_811755C(u8 taskid)
{
- MenuZeroFillWindowRect(0x14, 0x8, 0x1A, 0xD);
- MenuZeroFillScreen();
+ Menu_EraseWindowRect(0x14, 0x8, 0x1A, 0xD);
+ Menu_EraseScreen();
BeginNormalPaletteFade(-0x1, 0x0, 0x0, 0x10, 0x0);
gPaletteFade.delayCounter = gPaletteFade.multipurpose2;
UpdatePaletteFade();
@@ -2629,7 +2629,7 @@ void sub_811755C(u8 taskid)
void sub_81175C0(u8 taskid)
{
- MenuZeroFillScreen();
+ Menu_EraseScreen();
ScriptContext2_Disable();
DestroyTask(taskid);
}
@@ -2640,7 +2640,7 @@ void sub_81175DC(u8 taskid)
if (!(gMain.newKeys & (A_BUTTON | B_BUTTON)) && gTasks[taskid].data[0] < 0x3D)
return;
gSpecialVar_0x8004 = 0x1;
- MenuZeroFillScreen();
+ Menu_EraseScreen();
ScriptContext2_Disable();
DestroyTask(taskid);
}
@@ -2650,8 +2650,8 @@ void sub_8117630(u8 taskid)
u32 temp = gUnknown_083F8DF0[(gSpecialVar_0x8004 & 0x1) + (gSpecialVar_0x8004 >> 0x7 << 0x1)];
ConvertIntToDecimalStringN(gStringVar1, temp, 0x2, 0x1);
StringExpandPlaceholders(gStringVar4, &gUnknown_081C40DF);
- MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13);
- MenuPrint(gStringVar4, 0x1, 0xF);
+ Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13);
+ Menu_PrintText(gStringVar4, 0x1, 0xF);
gTasks[taskid].func = &sub_81174F8;
}
@@ -2660,7 +2660,7 @@ void Task_Roulette_0(u8 taskid)
s32 temp;
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskid].data[0xD], 0x1, 0x4);
StringExpandPlaceholders(gStringVar4, gOtherText_Coins);
- MenuDrawTextWindow(0x0, 0x0, 0x9, 0x3);
+ Menu_DrawStdWindowFrame(0x0, 0x0, 0x9, 0x3);
MenuPrint_RightAligned(gStringVar4, 0x9, 0x1);
temp = gUnknown_083F8DF0[(gSpecialVar_0x8004 & 0x1) + (gSpecialVar_0x8004 >> 0x7 << 0x1)];
ConvertIntToDecimalStringN(gStringVar1, temp, 0x2, 0x1);
@@ -2668,23 +2668,23 @@ void Task_Roulette_0(u8 taskid)
{
if ((gSpecialVar_0x8004 & 0x80) && (gSpecialVar_0x8004 & 0x1))
{
- MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13);
- MenuPrint(&gUnknown_081C4139, 0x1, 0xF);
+ Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13);
+ Menu_PrintText(&gUnknown_081C4139, 0x1, 0xF);
sub_8116C34(taskid , &sub_8117630, 0xFFFF, 0x3);
}
else
{
StringExpandPlaceholders(gStringVar4, &gUnknown_081C40DF);
- MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13);
- MenuPrint(gStringVar4, 0x1, 0xF);
+ Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13);
+ Menu_PrintText(gStringVar4, 0x1, 0xF);
gTasks[taskid].func = &sub_81174F8;
}
}
else
{
StringExpandPlaceholders(gStringVar4, &gUnknown_081C411C);
- MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13);
- MenuPrint(gStringVar4, 0x1, 0xF);
+ Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13);
+ Menu_PrintText(gStringVar4, 0x1, 0xF);
gTasks[taskid].func = &sub_81175DC;
gTasks[taskid].data[0xD] = 0x0;
gTasks[taskid].data[0x0] = 0x0;
diff --git a/src/scene/berry_blender.c b/src/scene/berry_blender.c
index 53308e856..d1ab2d512 100644
--- a/src/scene/berry_blender.c
+++ b/src/scene/berry_blender.c
@@ -215,7 +215,7 @@ extern u8 byte_3002A68;
extern const u8 gUnknown_08E6C100[];
extern const u8 gUnknown_08E6C920[];
extern const u8 gUnknown_08E6D354[];
-extern const struct WindowConfig gWindowConfig_81E6F68;
+extern const struct WindowTemplate gWindowConfig_81E6F68;
extern const u8 *const gPokeblockNames[];
extern const struct Berry gBerries[];
@@ -993,12 +993,12 @@ static void sub_804E56C(void)
}
break;
case 4:
- MenuDrawTextWindow(0, 14, 29, 19);
+ Menu_DrawStdWindowFrame(0, 14, 29, 19);
MenuPrintMessage(gOtherText_BlenderChooseBerry, 1, 15);
gBerryBlenderData->field_0++;
break;
case 5:
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
{
gBerryBlenderData->field_0++;
BeginNormalPaletteFade(-1, 0, 0, 0x10, 0);
@@ -1184,8 +1184,8 @@ static void sub_804E9F8(void)
}
break;
case 5:
- MenuDrawTextWindow(0, 13, 29, 19);
- MenuPrint(gOtherText_LinkStandby3, 1, 14);
+ Menu_DrawStdWindowFrame(0, 13, 29, 19);
+ Menu_PrintText(gOtherText_LinkStandby3, 1, 14);
gBerryBlenderData->field_0 = 8;
gBerryBlenderData->framesToWait = 0;
break;
@@ -1209,7 +1209,7 @@ static void sub_804E9F8(void)
case 10:
if (++gBerryBlenderData->framesToWait > 20)
{
- MenuZeroFillScreen();
+ Menu_EraseScreen();
if (GetBlockReceivedStatus() == sub_8008198())
{
for (i = 0; i < GetLinkPlayerCount(); i++)
@@ -1309,12 +1309,12 @@ static void sub_804E9F8(void)
PlayBGM(BGM_CYCLING);
break;
case 100:
- MenuDrawTextWindow(0, 13, 29, 19);
+ Menu_DrawStdWindowFrame(0, 13, 29, 19);
MenuPrintMessage(gOtherText_LinkNotFound, 1, 15);
gBerryBlenderData->field_0++;
break;
case 101:
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
gBerryBlenderData->field_0++;
break;
case 102:
@@ -2500,9 +2500,9 @@ static void sub_80508D4(u8 value)
static void sub_80508FC(void)
{
gBerryBlenderData->field_AA = 0;
- MenuDrawTextWindow(23, 8, 28, 13);
+ Menu_DrawStdWindowFrame(23, 8, 28, 13);
sub_814A5C0(0, -1, 12, 0x2D9F, 32);
- MenuPrint(gOtherText_YesNoTerminating, 24, 9);
+ Menu_PrintText(gOtherText_YesNoTerminating, 24, 9);
sub_80508D4(gBerryBlenderData->field_AA);
}
@@ -2575,11 +2575,11 @@ static void sub_8050954(void)
break;
case 7:
gBerryBlenderData->field_6F++;
- MenuDrawTextWindow(0, 14, 29, 19);
+ Menu_DrawStdWindowFrame(0, 14, 29, 19);
MenuPrintMessage(gOtherText_BlendAnotherBerryPrompt, 1, 15);
break;
case 8:
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
gBerryBlenderData->field_6F++;
break;
case 9:
@@ -2654,7 +2654,7 @@ static void sub_8050954(void)
}
break;
case 13:
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
{
SetMainCallback2(sub_8050E30);
gBerryBlenderData->field_6F = 0;
@@ -2746,7 +2746,7 @@ static void sub_8050E30(void)
case 1:
gBerryBlenderData->field_6F = 3;
DestroyMenuCursor();
- MenuZeroFillWindowRect(23, 8, 28, 13);
+ Menu_EraseWindowRect(23, 8, 28, 13);
#ifdef ENGLISH
StringCopy(gStringVar4, gLinkPlayers[gBerryBlenderData->field_7A].name);
StringAppend(gStringVar4, gOtherText_OtherCaseIsFull);
@@ -2759,7 +2759,7 @@ static void sub_8050E30(void)
case 2:
gBerryBlenderData->field_6F++;
DestroyMenuCursor();
- MenuZeroFillWindowRect(23, 8, 28, 13);
+ Menu_EraseWindowRect(23, 8, 28, 13);
#ifdef ENGLISH
StringCopy(gStringVar4, gLinkPlayers[gBerryBlenderData->field_7A].name);
StringAppend(gStringVar4, gOtherText_NoBerriesForBlend);
@@ -2770,7 +2770,7 @@ static void sub_8050E30(void)
MenuPrintMessage(gStringVar4, 1, 15);
break;
case 3:
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
{
gBerryBlenderData->framesToWait = 0;
gBerryBlenderData->field_6F++;
@@ -2781,8 +2781,8 @@ static void sub_8050E30(void)
gBerryBlenderData->field_6F = 5;
break;
case 5:
- MenuDrawTextWindow(0, 14, 29, 19);
- MenuPrint(gMultiText_Saving, 2, 15);
+ Menu_DrawStdWindowFrame(0, 14, 29, 19);
+ Menu_PrintText(gMultiText_Saving, 2, 15);
sub_80084A4();
gBerryBlenderData->field_6F++;
break;
@@ -2859,17 +2859,17 @@ static void sub_80510E8(void)
case 1:
gBerryBlenderData->field_6F = 3;
DestroyMenuCursor();
- MenuZeroFillWindowRect(23, 8, 28, 13);
+ Menu_EraseWindowRect(23, 8, 28, 13);
MenuPrintMessage(gOtherText_CaseIsFull, 1, 15);
break;
case 2:
gBerryBlenderData->field_6F++;
DestroyMenuCursor();
- MenuZeroFillWindowRect(23, 8, 28, 13);
+ Menu_EraseWindowRect(23, 8, 28, 13);
MenuPrintMessage(gOtherText_OutOfBerries, 1, 15);
break;
case 3:
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
gBerryBlenderData->field_6F = 9;
break;
case 9:
@@ -3081,13 +3081,13 @@ void unref_sub_80516F8(u8 taskID)
if (task->data[0] == 100)
{
ZeroFillWindowRect(&gBerryBlenderData->field_4, 0, 0, 16, 20);
- MenuDrawTextWindow(4, 4, 10, 12);
+ Menu_DrawStdWindowFrame(4, 4, 10, 12);
for (i = 0; i < 3; i++)
{
if (gLinkPlayers[i + 1].trainerId != 0)
- MenuPrint(gUnknown_08216284[i], 5, (2 * i) + 5);
- MenuDrawTextWindow(0, 13, 29, 19);
- MenuPrint(gOtherText_PressAToStart, 1, 15);
+ Menu_PrintText(gUnknown_08216284[i], 5, (2 * i) + 5);
+ Menu_DrawStdWindowFrame(0, 13, 29, 19);
+ Menu_PrintText(gOtherText_PressAToStart, 1, 15);
}
}
if (gMain.newKeys & A_BUTTON)
@@ -3099,7 +3099,7 @@ void unref_sub_80516F8(u8 taskID)
else
{
if (task->data[0] == 10)
- MenuPrint(gOtherText_PleaseWait, 3, 10);
+ Menu_PrintText(gOtherText_PleaseWait, 3, 10);
if (++task->data[0] > 120)
task->data[0] = 0;
if (byte_3002A68 > 4 && gReceivedRemoteLinkPlayers == 1)
@@ -3348,7 +3348,7 @@ static bool8 Blender_PrintBlendingResults(void)
u8* textPtr;
u16 secondsPassed, minutes, seconds;
- MenuDrawTextWindow(4, 2, 25, 17);
+ Menu_DrawStdWindowFrame(4, 2, 25, 17);
sub_8072BD8(gOtherText_ResultsOfBlending, 5, 3, 160);
for (i = 0; i < gBerryBlenderData->playersNo; i++)
{
@@ -3370,7 +3370,7 @@ static bool8 Blender_PrintBlendingResults(void)
textPtr += 3;
textPtr = sub_8072C74(textPtr, gLinkPlayers[place].name, 88, 0);
sub_8072C74(textPtr, text[0], 157, 0);
- MenuPrint(gBerryBlenderData->stringVar, 5, gUnknown_082165E9[gBerryBlenderData->playersNo] + (i * gUnknown_082165EE[gBerryBlenderData->playersNo]));
+ Menu_PrintText(gBerryBlenderData->stringVar, 5, gUnknown_082165E9[gBerryBlenderData->playersNo] + (i * gUnknown_082165EE[gBerryBlenderData->playersNo]));
}
ConvertIntToDecimalStringN(text[0], gBerryBlenderData->max_RPM % 100, 2, 2);
textPtr = gBerryBlenderData->stringVar;
@@ -3388,7 +3388,7 @@ static bool8 Blender_PrintBlendingResults(void)
textPtr = sub_8072C74(textPtr, text[0], 136, 1);
#endif
StringCopy(textPtr, gOtherText_RPM);
- MenuPrint(gBerryBlenderData->stringVar, 5, 13);
+ Menu_PrintText(gBerryBlenderData->stringVar, 5, 13);
secondsPassed = gBerryBlenderData->gameFrameTime / 60;
seconds = secondsPassed % 60;
@@ -3408,7 +3408,7 @@ static bool8 Blender_PrintBlendingResults(void)
textPtr = sub_8072C74(textPtr, text[1], 136, 1);
StringCopy(textPtr, gOtherText_Sec);
- MenuPrint(gBerryBlenderData->stringVar, 5, 15);
+ Menu_PrintText(gBerryBlenderData->stringVar, 5, 15);
gBerryBlenderData->framesToWait = 0;
gBerryBlenderData->field_0++;
@@ -3419,8 +3419,8 @@ static bool8 Blender_PrintBlendingResults(void)
gBerryBlenderData->field_0++;
break;
case 5:
- MenuZeroFillScreen();
- MenuDrawTextWindow(0, 14, 29, 19);
+ Menu_EraseScreen();
+ Menu_DrawStdWindowFrame(0, 14, 29, 19);
for (i = 0; i < BLENDER_MAX_PLAYERS; i++)
{
if (gBerryBlenderData->chosenItemID[i] != 0)
@@ -3436,7 +3436,7 @@ static bool8 Blender_PrintBlendingResults(void)
gBerryBlenderData->field_0++;
break;
case 6:
- if (MenuUpdateWindowText())
+ if (Menu_UpdateWindowText())
{
Blender_TrySettingRecord();
return TRUE;
@@ -3536,7 +3536,7 @@ static bool8 Blender_PrintBlendingRanking(void)
}
break;
case 3:
- MenuDrawTextWindow(4, 2, 25, 17);
+ Menu_DrawStdWindowFrame(4, 2, 25, 17);
sub_8072BD8(gOtherText_Ranking, 5, 3, 160);
gBerryBlenderData->scoreIconIDs[BLENDER_SCORE_BEST] = CreateSprite(&sSpriteTemplate_821645C, 140, 52, 0);
@@ -3575,7 +3575,7 @@ static bool8 Blender_PrintBlendingRanking(void)
txtPtr = sub_8072C14(txtPtr, gBerryBlenderData->scores[place][BLENDER_SCORE_GOOD], 132, 1);
txtPtr = sub_8072C14(txtPtr, gBerryBlenderData->scores[place][BLENDER_SCORE_MISS], 156, 1);
- MenuPrint(gBerryBlenderData->stringVar, 5, i * gUnknown_082165F3[gBerryBlenderData->playersNo] + 8);
+ Menu_PrintText(gBerryBlenderData->stringVar, 5, i * gUnknown_082165F3[gBerryBlenderData->playersNo] + 8);
}
gBerryBlenderData->framesToWait = 0;
gBerryBlenderData->field_0++;
@@ -3625,10 +3625,10 @@ static void BlenderDebug_PrintBerryData(void)
u8 i;
StringCopy(text, sText_BPM);
- MenuPrint(text, 2, 0);
+ Menu_PrintText(text, 2, 0);
ConvertIntToDecimalStringN(text, sBlenderDebug.BPM / 100, 2, 3);
- MenuPrint(text, 6, 0);
+ Menu_PrintText(text, 6, 0);
for (i = 0; i < 4; i++)
{
@@ -3646,7 +3646,7 @@ static void BlenderDebug_PrintBerryData(void)
text[7] = EOS;
}
var = (i * 3) + 3;
- MenuPrint(text, 2, var);
+ Menu_PrintText(text, 2, var);
ConvertIntToDecimalStringN(&text[0], gBerries[sBlenderDebug.berries[i]].spicy, 2, 2);
StringAppend(text, sText_Space);
@@ -3666,12 +3666,12 @@ static void BlenderDebug_PrintBerryData(void)
ConvertIntToDecimalStringN(&text[15], gBerries[sBlenderDebug.berries[i]].smoothness, 2, 2);
text[17] = EOS;
- MenuPrint(text, 7, var);
+ Menu_PrintText(text, 7, var);
}
if (sBlenderDebug.pokeblock.color != 0)
{
StringCopy(text, gPokeblockNames[sBlenderDebug.pokeblock.color]);
- MenuPrint(text, 2, 15);
+ Menu_PrintText(text, 2, 15);
ConvertIntToHexStringN(&text[0], sBlenderDebug.spicy, 2, 2);
StringAppend(text, sText_Space);
@@ -3691,7 +3691,7 @@ static void BlenderDebug_PrintBerryData(void)
ConvertIntToHexStringN(&text[15], sBlenderDebug.feel, 2, 2);
text[17] = EOS;
- MenuPrint(text, 7, 17);
+ Menu_PrintText(text, 7, 17);
}
}
@@ -3743,7 +3743,7 @@ static void sub_80527BC(void)
gUnknown_020297DC = 0;
}
- MenuPrint(text, 2, 15);
+ Menu_PrintText(text, 2, 15);
}
static void sub_8052918(void)
@@ -3845,9 +3845,9 @@ void ShowBerryBlenderRecordWindow(void)
u8 text[30];
s32 i;
- MenuDrawTextWindow(6, 3, 23, 16);
- MenuPrint(gMultiText_BerryBlenderMaxSpeedRecord, 8, 4);
- MenuPrint(gMultiText_2P3P4P, 8, 9);
+ Menu_DrawStdWindowFrame(6, 3, 23, 16);
+ Menu_PrintText(gMultiText_BerryBlenderMaxSpeedRecord, 8, 4);
+ Menu_PrintText(gMultiText_2P3P4P, 8, 9);
for (i = 0; i < 3; i++)
{
@@ -3865,7 +3865,7 @@ void ShowBerryBlenderRecordWindow(void)
txtPtr = ConvertIntToDecimalStringN(txtPtr, record % 100, 2, 2);
StringAppend(txtPtr, gOtherText_RPM);
- MenuPrint(text, 15, i * 2 + 9);
+ Menu_PrintText(text, 15, i * 2 + 9);
}
}
diff --git a/src/scene/credits.c b/src/scene/credits.c
index 17c1bf263..54b517a91 100644
--- a/src/scene/credits.c
+++ b/src/scene/credits.c
@@ -857,7 +857,7 @@ static void task_b_81441B8(u8 taskIdB)
case 5:
if (!gPaletteFade.active)
{
- MenuZeroFillWindowRect(0, 9, 29, 19);
+ Menu_EraseWindowRect(0, 9, 29, 19);
gTasks[taskIdB].data[TDB_0] = 2;
}
return;
diff --git a/src/scene/egg_hatch.c b/src/scene/egg_hatch.c
index c0111de7d..8d961ad1f 100644
--- a/src/scene/egg_hatch.c
+++ b/src/scene/egg_hatch.c
@@ -472,9 +472,9 @@ static void CB2_EggHatch_0(void)
break;
case 1:
SetUpWindowConfig(&gWindowConfig_81E6F84);
- InitWindowFromConfig(&gEggHatchData->window, &gWindowConfig_81E6F84);
- gEggHatchData->tileDataStartOffset = SetTextWindowBaseTileNum(20);
- LoadTextWindowGraphics(&gEggHatchData->window);
+ Text_InitWindowWithTemplate(&gEggHatchData->window, &gWindowConfig_81E6F84);
+ gEggHatchData->tileDataStartOffset = TextWindow_SetBaseTileNum(20);
+ TextWindow_LoadStdFrameGraphics(&gEggHatchData->window);
gMain.state++;
break;
case 2:
@@ -625,7 +625,7 @@ static void CB2_EggHatch_1(void)
case 8:
if (EggHatchUpdateWindowText())
{
- MenuDrawTextWindow(22, 8, 27, 13);
+ Menu_DrawStdWindowFrame(22, 8, 27, 13);
InitYesNoMenu(22, 8, 4);
gEggHatchData->CB2_state++;
}
@@ -848,15 +848,15 @@ static void CreateEggShardSprite(u8 x, u8 y, s16 data1, s16 data2, s16 data3, u8
static void EggHatchPrintMessage1(u8* src)
{
- sub_8002EB0(&gEggHatchData->window, src, gEggHatchData->tileDataStartOffset, 3, 15);
+ Text_InitWindow8002EB0(&gEggHatchData->window, src, gEggHatchData->tileDataStartOffset, 3, 15);
}
static void EggHatchPrintMessage2(u8* src)
{
- sub_8003460(&gEggHatchData->window, src, gEggHatchData->tileDataStartOffset, 3, 15);
+ Text_InitWindowAndPrintText(&gEggHatchData->window, src, gEggHatchData->tileDataStartOffset, 3, 15);
}
static bool8 EggHatchUpdateWindowText(void)
{
- return sub_80035AC(&gEggHatchData->window);
+ return Text_UpdateWindow(&gEggHatchData->window);
}
diff --git a/src/scene/evolution_scene.c b/src/scene/evolution_scene.c
index 4ee601360..323313fc2 100644
--- a/src/scene/evolution_scene.c
+++ b/src/scene/evolution_scene.c
@@ -209,7 +209,7 @@ void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo,
gUnknown_030041B0 = 256;
gUnknown_030041B8 = 0;
- InitWindowFromConfig(&gUnknown_03004210, &gWindowConfig_81E6C58);
+ Text_InitWindowWithTemplate(&gUnknown_03004210, &gWindowConfig_81E6C58);
gBattleTerrain = BATTLE_TERRAIN_PLAIN;
sub_800D6D4();
@@ -317,7 +317,7 @@ static void CB2_EvolutionSceneLoadGraphics(void)
gUnknown_030041B0 = 256;
gUnknown_030041B8 = 0;
- InitWindowFromConfig(&gUnknown_03004210, &gWindowConfig_81E6C58);
+ Text_InitWindowWithTemplate(&gUnknown_03004210, &gWindowConfig_81E6C58);
gBattleTerrain = BATTLE_TERRAIN_PLAIN;
sub_800D6D4();
@@ -374,14 +374,14 @@ static void CB2_TradeEvolutionSceneLoadGraphics(void)
break;
case 1:
SetUpWindowConfig(&gWindowConfig_81E6F84);
- InitWindowFromConfig(&gUnknown_03004828->window, &gWindowConfig_81E6F84);
+ Text_InitWindowWithTemplate(&gUnknown_03004828->window, &gWindowConfig_81E6F84);
gMain.state++;
break;
case 2:
- LoadTextWindowGraphics(&gUnknown_03004828->window);
- gUnknown_03004828->textWindowBaseTileNum = SetTextWindowBaseTileNum(2);
- LoadTextWindowGraphics(&gUnknown_03004828->window);
- MenuZeroFillScreen();
+ TextWindow_LoadStdFrameGraphics(&gUnknown_03004828->window);
+ gUnknown_03004828->textWindowBaseTileNum = TextWindow_SetBaseTileNum(2);
+ TextWindow_LoadStdFrameGraphics(&gUnknown_03004828->window);
+ Menu_EraseScreen();
ResetPaletteFade();
gMain.state++;
SetHBlankCallback(EvoDummyFunc);
@@ -481,7 +481,7 @@ static void CB2_EvolutionSceneUpdate(void)
{
AnimateSprites();
BuildOamBuffer();
- sub_800374C(&gUnknown_03004210);
+ Text_UpdateWindowInBattle(&gUnknown_03004210);
UpdatePaletteFade();
RunTasks();
}
@@ -490,7 +490,7 @@ static void CB2_TradeEvolutionSceneUpdate(void)
{
AnimateSprites();
BuildOamBuffer();
- sub_80035AC(&gUnknown_03004828->window);
+ Text_UpdateWindow(&gUnknown_03004828->window);
UpdatePaletteFade();
RunTasks();
}
@@ -558,7 +558,7 @@ static void Task_EvolutionScene(u8 taskID)
if (!gPaletteFade.active)
{
StringExpandPlaceholders(gStringVar4, BattleText_StartEvo);
- sub_8002EB0(&gUnknown_03004210, gStringVar4, 144, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gStringVar4, 144, 2, 15);
gTasks[taskID].tState++;
}
break;
@@ -646,7 +646,7 @@ static void Task_EvolutionScene(u8 taskID)
if (IsCryFinished() && !gPaletteFade.active)
{
StringExpandPlaceholders(gStringVar4, BattleText_FinishEvo);
- sub_8002EB0(&gUnknown_03004210, gStringVar4, 144, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gStringVar4, 144, 2, 15);
PlayBGM(BGM_FANFA5);
gTasks[taskID].tState++;
SetMonData(mon, MON_DATA_SPECIES, (void*)(&gTasks[taskID].tPostEvoSpecies));
@@ -715,7 +715,7 @@ static void Task_EvolutionScene(u8 taskID)
if (IsCryFinished())
{
StringExpandPlaceholders(gStringVar4, BattleText_StopEvo);
- sub_8002EB0(&gUnknown_03004210, gStringVar4, 144, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gStringVar4, 144, 2, 15);
gTasks[taskID].tEvoWasStopped = TRUE;
gTasks[taskID].tState = 14;
}
@@ -726,7 +726,7 @@ static void Task_EvolutionScene(u8 taskID)
sub_8024CEC();
PlayFanfare(BGM_FANFA1);
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[3]);
- sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
gTasks[taskID].tLearnsFirstMove = 0x40; // re-used as a counter
gTasks[taskID].tState++;
}
@@ -743,7 +743,7 @@ static void Task_EvolutionScene(u8 taskID)
{
sub_8024CEC();
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[4]);
- sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
gTasks[taskID].tLearnMoveState++;
}
break;
@@ -751,7 +751,7 @@ static void Task_EvolutionScene(u8 taskID)
if (gUnknown_03004210.state == 0 && !IsSEPlaying())
{
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[5]);
- sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
gTasks[taskID].tLearnMoveState++;
}
break;
@@ -761,7 +761,7 @@ static void Task_EvolutionScene(u8 taskID)
if (!IsSEPlaying())
{
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[6]);
- sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
gTasks[taskID].tData9 = 5;
gTasks[taskID].tdata10 = 9;
gTasks[taskID].tLearnMoveState++;
@@ -794,7 +794,7 @@ static void Task_EvolutionScene(u8 taskID)
{
sub_8023AD8();
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[292]);
- sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
PlaySE(SE_SELECT);
if (sEvoCursorPos != 0)
gTasks[taskID].tLearnMoveState = gTasks[taskID].tdata10;
@@ -809,7 +809,7 @@ static void Task_EvolutionScene(u8 taskID)
{
sub_8023AD8();
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[292]);
- sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
PlaySE(SE_SELECT);
gTasks[taskID].tLearnMoveState = gTasks[taskID].tdata10;
}
@@ -835,7 +835,7 @@ static void Task_EvolutionScene(u8 taskID)
if (IsHMMove2(move))
{
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[307]);
- sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
gTasks[taskID].tLearnMoveState = 11;
}
else
@@ -848,7 +848,7 @@ static void Task_EvolutionScene(u8 taskID)
RemoveMonPPBonus(mon, var);
SetMonMoveSlot(mon, gMoveToLearn, var);
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[207]);
- sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
gTasks[taskID].tLearnMoveState++;
}
}
@@ -858,7 +858,7 @@ static void Task_EvolutionScene(u8 taskID)
if (gUnknown_03004210.state == 0 && !IsSEPlaying())
{
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[7]);
- sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
gTasks[taskID].tLearnMoveState++;
}
break;
@@ -866,20 +866,20 @@ static void Task_EvolutionScene(u8 taskID)
if (gUnknown_03004210.state == 0 && !IsSEPlaying())
{
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[208]);
- sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
gTasks[taskID].tState = 19;
}
break;
case 9:
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[8]);
- sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
gTasks[taskID].tData9 = 10;
gTasks[taskID].tdata10 = 0;
gTasks[taskID].tLearnMoveState = 3;
break;
case 10:
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[9]);
- sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15);
gTasks[taskID].tState = 14;
break;
case 11:
@@ -900,7 +900,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
{
case 0:
StringExpandPlaceholders(gStringVar4, BattleText_StartEvo);
- sub_8002EB0(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
gTasks[taskID].tState++;
break;
case 1:
@@ -988,7 +988,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
if (IsCryFinished() && !gPaletteFade.active)
{
StringExpandPlaceholders(gStringVar4, BattleText_FinishEvo);
- sub_8002EB0(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
PlayFanfare(BGM_FANFA5);
gTasks[taskID].tState++;
SetMonData(mon, MON_DATA_SPECIES, (void*)(&gTasks[taskID].tPostEvoSpecies));
@@ -1022,7 +1022,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
else
{
PlayBGM(BGM_SHINKA);
- sub_8002EB0(&gUnknown_03004828->window, gOtherText_LinkStandby2, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004828->window, gOtherText_LinkStandby2, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
gTasks[taskID].tState++;
}
}
@@ -1040,7 +1040,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
sub_8024CEC();
PlayFanfare(BGM_FANFA1);
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[3]);
- sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
gTasks[taskID].tLearnsFirstMove = 0x40; // re-used as a counter
gTasks[taskID].tState++;
}
@@ -1057,7 +1057,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
{
sub_8024CEC();
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[4]);
- sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
gTasks[taskID].tLearnMoveState++;
}
break;
@@ -1065,7 +1065,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
if (gUnknown_03004828->window.state == 0 && !IsSEPlaying())
{
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[5]);
- sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
gTasks[taskID].tLearnMoveState++;
}
break;
@@ -1075,7 +1075,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
if (!IsSEPlaying())
{
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[6]);
- sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
gTasks[taskID].tData9 = 5;
gTasks[taskID].tdata10 = 9;
gTasks[taskID].tLearnMoveState++;
@@ -1083,10 +1083,10 @@ static void Task_TradeEvolutionScene(u8 taskID)
case 3:
if (gUnknown_03004828->window.state == 0 && !IsSEPlaying())
{
- DrawTextWindow(&gUnknown_03004828->window, 24, 8, 29, 13);
+ TextWindow_DrawStdFrame(&gUnknown_03004828->window, 24, 8, 29, 13);
sEvoCursorPos = 0;
- InitWindow(&gUnknown_03004828->window, gOtherText_YesNoAndPlayer, gUnknown_03004828->textWindowBaseTileNum + 128, 25, 9);
- sub_8002F44(&gUnknown_03004828->window);
+ 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);
sub_81150D8();
gTasks[taskID].tLearnMoveState++;
@@ -1113,7 +1113,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
ZeroFillWindowRect(&gUnknown_03004828->window, 0x18, 8, 0x1D, 0xD);
DestroyMenuCursor();
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[292]);
- sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
PlaySE(SE_SELECT);
if (sEvoCursorPos != 0)
gTasks[taskID].tLearnMoveState = gTasks[taskID].tdata10;
@@ -1129,7 +1129,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
ZeroFillWindowRect(&gUnknown_03004828->window, 0x18, 8, 0x1D, 0xD);
DestroyMenuCursor();
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[292]);
- sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
PlaySE(SE_SELECT);
gTasks[taskID].tLearnMoveState = gTasks[taskID].tdata10;
}
@@ -1155,7 +1155,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
if (IsHMMove2(move))
{
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[307]);
- sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
gTasks[taskID].tLearnMoveState = 11;
}
else
@@ -1168,7 +1168,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
RemoveMonPPBonus(mon, var);
SetMonMoveSlot(mon, gMoveToLearn, var);
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[207]);
- sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
gTasks[taskID].tLearnMoveState++;
}
}
@@ -1178,7 +1178,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
if (gUnknown_03004828->window.state == 0 && !IsSEPlaying())
{
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[7]);
- sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
gTasks[taskID].tLearnMoveState++;
}
break;
@@ -1186,20 +1186,20 @@ static void Task_TradeEvolutionScene(u8 taskID)
if (gUnknown_03004828->window.state == 0 && !IsSEPlaying())
{
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[208]);
- sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
gTasks[taskID].tState = 15;
}
break;
case 9:
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[8]);
- sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
gTasks[taskID].tData9 = 10;
gTasks[taskID].tdata10 = 0;
gTasks[taskID].tLearnMoveState = 3;
break;
case 10:
StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[9]);
- sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
+ Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15);
gTasks[taskID].tState = 13;
break;
case 11:
diff --git a/src/scene/hall_of_fame.c b/src/scene/hall_of_fame.c
index 1751ee99c..ae2ff5f87 100644
--- a/src/scene/hall_of_fame.c
+++ b/src/scene/hall_of_fame.c
@@ -558,8 +558,8 @@ static void sub_814217C(u8 taskID)
lastSavedTeam--;
}
*lastSavedTeam = *fameMons;
- MenuDrawTextWindow(2, 14, 27, 19);
- MenuPrint(gMenuText_HOFSaving, 3, 15);
+ Menu_DrawStdWindowFrame(2, 14, 27, 19);
+ Menu_PrintText(gMenuText_HOFSaving, 3, 15);
gTasks[taskID].func = sub_8142274;
}
@@ -617,7 +617,7 @@ static void sub_8142320(u8 taskID)
gSprites[spriteID].data[0] = 0;
gSprites[spriteID].callback = sub_81435DC;
gTasks[taskID].tMonSpriteID(currPokeID) = spriteID;
- MenuZeroFillWindowRect(0, 14, 29, 19);
+ Menu_EraseWindowRect(0, 14, 29, 19);
gTasks[taskID].func = sub_8142404;
}
@@ -670,7 +670,7 @@ static void sub_8142570(u8 taskID)
if (gTasks[taskID].tMonSpriteID(i) != 0xFF)
gSprites[gTasks[taskID].tMonSpriteID(i)].oam.priority = 0;
}
- MenuZeroFillWindowRect(0, 14, 29, 19);
+ Menu_EraseWindowRect(0, 14, 29, 19);
sub_8143068(0, 15);
PlaySE(SE_DENDOU);
gTasks[taskID].tFrameCount = 400;
@@ -694,7 +694,7 @@ static void sub_8142618(u8 taskID)
gSprites[gTasks[taskID].tMonSpriteID(i)].oam.priority = 1;
}
BeginNormalPaletteFade(sUnknown_0203931C, 0, 12, 12, 0x735F);
- MenuZeroFillWindowRect(0, 14, 29, 19);
+ Menu_EraseWindowRect(0, 14, 29, 19);
gTasks[taskID].tFrameCount = 7;
gTasks[taskID].func = sub_81426F8;
}
@@ -732,10 +732,10 @@ static void sub_8142794(u8 taskID)
gSprites[gTasks[taskID].tPlayerSpriteID].pos1.x++;
else
{
- MenuDrawTextWindow(1, 2, 15, 9);
+ Menu_DrawStdWindowFrame(1, 2, 15, 9);
HallOfFame_PrintPlayerInfo(1, 2);
- MenuDrawTextWindow(2, 14, 27, 19);
- MenuPrint(gMenuText_HOFCongratulations, 4, 15);
+ Menu_DrawStdWindowFrame(2, 14, 27, 19);
+ Menu_PrintText(gMenuText_HOFCongratulations, 4, 15);
gTasks[taskID].func = sub_8142818;
}
}
@@ -930,7 +930,7 @@ static void sub_8142B04(u8 taskID)
stringPtr[1] = 0x13;
stringPtr[2] = 0xF0;
stringPtr[3] = EOS;
- MenuPrint(gStringVar1, 0, 0);
+ Menu_PrintText(gStringVar1, 0, 0);
gTasks[taskID].func = sub_8142CC8;
}
@@ -1042,14 +1042,14 @@ static void sub_8142FCC(u8 taskID)
static void sub_8142FEC(u8 taskID)
{
- MenuDrawTextWindow(2, 14, 27, 19);
+ Menu_DrawStdWindowFrame(2, 14, 27, 19);
MenuPrintMessage(gMenuText_HOFCorrupt, 3, 15);
gTasks[taskID].func = sub_814302C;
}
static void sub_814302C(u8 taskID)
{
- if (MenuUpdateWindowText() && gMain.newKeys & A_BUTTON)
+ if (Menu_UpdateWindowText() && gMain.newKeys & A_BUTTON)
gTasks[taskID].func = sub_8142F78;
}
@@ -1086,7 +1086,7 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 a1, u8 a2)
}
}
- MenuPrint(gStringVar1, a1 + 4, a2 + 1);
+ Menu_PrintText(gStringVar1, a1 + 4, a2 + 1);
stringPtr = gStringVar1;
for (i = 0; i < 10 && currMon->nick[i] != EOS; stringPtr[i] = currMon->nick[i], i++) {}
@@ -1099,8 +1099,8 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 a1, u8 a2)
stringPtr[1] = 0x13;
stringPtr[2] = 0xA0;
stringPtr[3] = EOS;
- MenuPrint(gStringVar1, a1 + 9, a2 + 1);
- MenuZeroFillWindowRect(0, a2 + 3, 29, a2 + 4);
+ Menu_PrintText(gStringVar1, a1 + 9, a2 + 1);
+ Menu_EraseWindowRect(0, a2 + 3, 29, a2 + 4);
}
else
{
@@ -1139,7 +1139,7 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 a1, u8 a2)
stringPtr[2] = 0xA0;
stringPtr[3] = EOS;
- MenuPrint(gStringVar1, a1 + 9, a2 + 1);
+ Menu_PrintText(gStringVar1, a1 + 9, a2 + 1);
monData = currMon->lvl;
@@ -1157,14 +1157,14 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 a1, u8 a2)
stringPtr[2] = 0x30;
stringPtr[3] = EOS;
- MenuPrint(gStringVar1, a1 + 7, a2 + 3);
+ Menu_PrintText(gStringVar1, a1 + 7, a2 + 3);
monData = currMon->tid;
stringPtr = StringCopy(gStringVar1, gOtherText_IDNumber);
ConvertIntToDecimalStringN(stringPtr, monData, 2, 5);
- MenuPrint(gStringVar1, a1 + 13, a2 + 3);
+ Menu_PrintText(gStringVar1, a1 + 13, a2 + 3);
}
}
@@ -1175,15 +1175,15 @@ static void HallOfFame_PrintPlayerInfo(u8 a0, u8 a1)
u8* stringPtr;
u16 visibleTid;
- MenuPrint(gOtherText_Name, a0 + 1, a1 + 1);
+ Menu_PrintText(gOtherText_Name, a0 + 1, a1 + 1);
MenuPrint_RightAligned(gSaveBlock2.playerName, a0 + 14, a1 + 1);
- MenuPrint(gOtherText_IDNumber2, a0 + 1, a1 + 3);
+ Menu_PrintText(gOtherText_IDNumber2, a0 + 1, a1 + 3);
visibleTid = ByteRead16(gSaveBlock2.playerTrainerId);
ConvertIntToDecimalStringN(gStringVar1, visibleTid, 2, 5);
MenuPrint_RightAligned(gStringVar1, a0 + 14, a1 + 3);
- MenuPrint(gMainMenuString_Time, a0 + 1, a1 + 5);
+ Menu_PrintText(gMainMenuString_Time, a0 + 1, a1 + 5);
stringPtr = ConvertIntToDecimalString(gStringVar1, gSaveBlock2.playTimeHours);
stringPtr[0] = CHAR_SPACE;
diff --git a/src/script_pokemon_util_80C4BF0.c b/src/script_pokemon_util_80C4BF0.c
index f397e5ebb..b13006c13 100644
--- a/src/script_pokemon_util_80C4BF0.c
+++ b/src/script_pokemon_util_80C4BF0.c
@@ -292,7 +292,7 @@ void ShowContestEntryMonPic(void)
u8 left = CONTEST_ENTRY_PIC_LEFT;
u8 top = CONTEST_ENTRY_PIC_TOP;
- MenuDrawTextWindow(left, top, 19, 13);
+ Menu_DrawStdWindowFrame(left, top, 19, 13);
species = gContestMons[gSpecialVar_0x8006].species;
var1 = gContestMons[gSpecialVar_0x8006].personality;
var2 = gContestMons[gSpecialVar_0x8006].otId;
@@ -349,7 +349,7 @@ void sub_80C5190(u8 taskId)
task->data[0]++;
break;
case 3:
- MenuZeroFillWindowRect(task->data[3], task->data[4], task->data[3] + 9, task->data[4] + 10);
+ Menu_EraseWindowRect(task->data[3], task->data[4], task->data[3] + 9, task->data[4] + 10);
DestroyTask(taskId);
break;
case 1: