summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/battle/battle_records.c4
-rw-r--r--src/berry_blender.c5
-rw-r--r--src/cable_club.c2
-rw-r--r--src/credits.c2
-rw-r--r--src/debug/nakamura_debug_menu.c2
-rw-r--r--src/decompress.c22
-rw-r--r--src/field_region_map.c2
-rw-r--r--src/field_specials.c4
-rw-r--r--src/hall_of_fame.c2
-rw-r--r--src/map_name_popup.c2
-rw-r--r--src/menu.c12
-rw-r--r--src/money.c4
-rw-r--r--src/pokeblock.c2
-rw-r--r--src/pokedex.c4
-rw-r--r--src/pokemon_storage_system.c4
-rw-r--r--src/pokemon_summary_screen.c434
-rw-r--r--src/strings.c8
-rw-r--r--src/text.c19
18 files changed, 256 insertions, 278 deletions
diff --git a/src/battle/battle_records.c b/src/battle/battle_records.c
index fed8d6575..d94d88032 100644
--- a/src/battle/battle_records.c
+++ b/src/battle/battle_records.c
@@ -290,7 +290,7 @@ void ShowLinkBattleRecords(void)
{
s32 i;
Menu_DrawStdWindowFrame(1, 0, 28, 18);
- sub_8072BD8(gOtherText_BattleResults, 0, 1, 240);
+ MenuPrint_Centered(gOtherText_BattleResults, 0, 1, 240);
PrintLinkBattleWinsLossesDraws(gSaveBlock1.linkBattleRecords);
#if ENGLISH
@@ -368,7 +368,7 @@ void ShowBattleTowerRecords(void)
{
u16 i;
Menu_DrawStdWindowFrame(3, 1, 27, 17);
- sub_8072BD8(gOtherText_BattleTowerResults, 3, 2, 0xC8);
+ MenuPrint_Centered(gOtherText_BattleTowerResults, 3, 2, 0xC8);
Menu_PrintText(gOtherText_Lv50, 5, 6);
Menu_PrintText(gOtherText_Lv100, 5, 12);
for (i = 5; i < 26; i++)
diff --git a/src/berry_blender.c b/src/berry_blender.c
index 8bf669a92..85c992d8d 100644
--- a/src/berry_blender.c
+++ b/src/berry_blender.c
@@ -1784,6 +1784,7 @@ static void sub_804FE70(void)
{
sub_804FC48(0x2345, var);
sub_804FD30(0x2345);
+ // looks like a bug
if (gBerryBlenderData->field_4.win_field_F > 1000)
gBerryBlenderData->field_13E = 1000;
if (gBerryBlenderData->scores[i][BLENDER_SCORE_MISS] < 999)
@@ -2995,7 +2996,7 @@ bool8 Blender_PrintBlendingResults(void)
u16 secondsPassed, minutes, seconds;
Menu_DrawStdWindowFrame(4, 2, 25, 17);
- sub_8072BD8(gOtherText_ResultsOfBlending, 5, 3, 160);
+ MenuPrint_Centered(gOtherText_ResultsOfBlending, 5, 3, 160);
for (i = 0; i < gBerryBlenderData->playersNo; i++)
{
u8 place = gBerryBlenderData->playerPlaces[i];
@@ -3188,7 +3189,7 @@ static bool8 Blender_PrintBlendingRanking(void)
break;
case 3:
Menu_DrawStdWindowFrame(4, 2, 25, 17);
- sub_8072BD8(gOtherText_Ranking, 5, 3, 160);
+ MenuPrint_Centered(gOtherText_Ranking, 5, 3, 160);
gBerryBlenderData->scoreIconIDs[BLENDER_SCORE_BEST] = CreateSprite(&sSpriteTemplate_821645C, 140, 52, 0);
gSprites[gBerryBlenderData->scoreIconIDs[BLENDER_SCORE_BEST]].callback = SpriteCallbackDummy;
diff --git a/src/cable_club.c b/src/cable_club.c
index 1e1f0af07..39027fc08 100644
--- a/src/cable_club.c
+++ b/src/cable_club.c
@@ -172,7 +172,7 @@ static void sub_8082D18(u32 value)
{
ConvertIntToDecimalStringN(gStringVar1, value, STR_CONV_MODE_LEFT_ALIGN, 1);
Menu_DrawStdWindowFrame(18, 10, 28, 13);
- sub_8072BD8(gOtherText_PLink, 19, 11, 72);
+ MenuPrint_Centered(gOtherText_PLink, 19, 11, 72);
}
static void sub_8082D4C()
diff --git a/src/credits.c b/src/credits.c
index 1a810492b..c0c53505d 100644
--- a/src/credits.c
+++ b/src/credits.c
@@ -810,7 +810,7 @@ static void task_b_81441B8(u8 taskIdB)
if (gTasks[taskIdB].data[TDB_CURRENT_PAGE] < PAGE_COUNT)
{
for (i = 0; i < 5; i++)
- sub_8072BD8(gCreditsEntryPointerTable[gTasks[taskIdB].data[TDB_CURRENT_PAGE]][i]->text, 0, 9 + i * 2, 240);
+ MenuPrint_Centered(gCreditsEntryPointerTable[gTasks[taskIdB].data[TDB_CURRENT_PAGE]][i]->text, 0, 9 + i * 2, 240);
gTasks[taskIdB].data[TDB_CURRENT_PAGE] += 1;
gTasks[taskIdB].data[TDB_0] += 1;
diff --git a/src/debug/nakamura_debug_menu.c b/src/debug/nakamura_debug_menu.c
index 508dc048e..e6af3c58d 100644
--- a/src/debug/nakamura_debug_menu.c
+++ b/src/debug/nakamura_debug_menu.c
@@ -921,7 +921,7 @@ static void NakaGenderTest_PrintSpeciesGender(u8 i)
if (gender == MON_MALE)
Menu_PrintText(gOtherText_MaleSymbol2, 23, 2 * i + 1);
else if (gender == MON_FEMALE)
- Menu_PrintText(gOtherText_FemaleSymbolAndLv, 23, 2 * i + 1);
+ Menu_PrintText(gOtherText_FemaleSymbol2, 23, 2 * i + 1);
else
Menu_PrintText(sp0, 23, 2 * i + 1);
}
diff --git a/src/decompress.c b/src/decompress.c
index 69edf01aa..d6c52439f 100644
--- a/src/decompress.c
+++ b/src/decompress.c
@@ -49,25 +49,25 @@ void LoadCompressedObjectPalette(const struct CompressedSpritePalette *src)
LoadSpritePalette(&dest);
}
-void LoadCompressedObjectPaletteOverrideBuffer(const struct CompressedSpritePalette *a, void *buffer)
+void LoadCompressedObjectPaletteOverrideBuffer(const struct CompressedSpritePalette *src, void *buffer)
{
struct SpritePalette dest;
- LZ77UnCompWram(a->data, buffer);
+ LZ77UnCompWram(src->data, buffer);
dest.data = buffer;
- dest.tag = a->tag;
+ dest.tag = src->tag;
LoadSpritePalette(&dest);
}
-void DecompressPicFromTable_2(const struct CompressedSpriteSheet *src, u8 b, u8 c, void *d, void *buffer, s32 species)
+void DecompressPicFromTable_2(const struct CompressedSpriteSheet *src, u8 coords, u8 y_offset, void *d, void *dest, s32 species)
{
if (species > SPECIES_EGG)
- LZ77UnCompWram(gMonFrontPicTable[0].data, buffer);
+ LZ77UnCompWram(gMonFrontPicTable[0].data, dest);
else
- LZ77UnCompWram(src->data, buffer);
+ LZ77UnCompWram(src->data, dest);
}
-void HandleLoadSpecialPokePic(const struct CompressedSpriteSheet *src, u32 b, u32 c, u32 d, void *dest, s32 species, u32 g)
+void HandleLoadSpecialPokePic(const struct CompressedSpriteSheet *src, u32 coords, u32 y_offset, u32 d, void *dest, s32 species, u32 pid)
{
u32 frontOrBack;
@@ -77,16 +77,16 @@ void HandleLoadSpecialPokePic(const struct CompressedSpriteSheet *src, u32 b, u3
else
frontOrBack = 1; // frontPic
- LoadSpecialPokePic(src, b, c, d, dest, species, g, frontOrBack);
+ LoadSpecialPokePic(src, coords, y_offset, d, dest, species, pid, frontOrBack);
}
-void LoadSpecialPokePic(const struct CompressedSpriteSheet *src, u32 b, u32 c, u32 d, void *dest, s32 species, u32 g, u32 frontOrBack)
+void LoadSpecialPokePic(const struct CompressedSpriteSheet *src, u32 b, u32 c, u32 d, void *dest, s32 species, u32 pid, u32 frontOrBack)
{
u8 frontOrBack8 = frontOrBack;
if (species == SPECIES_UNOWN)
{
- u16 i = (((g & 0x3000000) >> 18) | ((g & 0x30000) >> 12) | ((g & 0x300) >> 6) | (g & 3)) % 0x1C;
+ u16 i = (((pid & 0x3000000) >> 18) | ((pid & 0x30000) >> 12) | ((pid & 0x300) >> 6) | (pid & 3)) % 0x1C;
// The other Unowns are separate from Unown A.
if (i == 0)
@@ -104,7 +104,7 @@ void LoadSpecialPokePic(const struct CompressedSpriteSheet *src, u32 b, u32 c, u
else
LZ77UnCompWram(src->data, dest);
- DrawSpindaSpots(species, g, dest, frontOrBack8);
+ DrawSpindaSpots(species, pid, dest, frontOrBack8);
}
void Unused_LZDecompressWramIndirect(const void **src, void *dest)
diff --git a/src/field_region_map.c b/src/field_region_map.c
index a90b8ed6a..10d5a4a5e 100644
--- a/src/field_region_map.c
+++ b/src/field_region_map.c
@@ -55,7 +55,7 @@ void CB2_FieldInitRegionMap(void)
Menu_EraseScreen();
REG_BG0CNT = BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(31) | BGCNT_16COLOR | BGCNT_TXT256x256;
Menu_DrawStdWindowFrame(21, 0, 29, 3);
- sub_8072BD8(gOtherText_Hoenn, 0x16, 1, 0x38);
+ MenuPrint_Centered(gOtherText_Hoenn, 0x16, 1, 0x38);
Menu_DrawStdWindowFrame(16, 16, 29, 19);
sub_813F0C8();
SetMainCallback2(CB2_FieldRegionMap);
diff --git a/src/field_specials.c b/src/field_specials.c
index f7b14dad8..e8c83b376 100644
--- a/src/field_specials.c
+++ b/src/field_specials.c
@@ -1089,8 +1089,8 @@ static void sub_810E874(void)
void DisplayCurrentElevatorFloor(void)
{
Menu_DrawStdWindowFrame(20, 0, 29, 5);
- sub_8072BD8(gOtherText_NowOn, 21, 1, 64);
- sub_8072BD8(gUnknown_083F8380[gSpecialVar_0x8005], 21, 3, 64);
+ MenuPrint_Centered(gOtherText_NowOn, 21, 1, 64);
+ MenuPrint_Centered(gUnknown_083F8380[gSpecialVar_0x8005], 21, 3, 64);
}
void sub_810E984(u8 taskId)
diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c
index 2536f4898..5ee025eeb 100644
--- a/src/hall_of_fame.c
+++ b/src/hall_of_fame.c
@@ -1047,7 +1047,7 @@ static void sub_814302C(u8 taskID)
static void sub_8143068(u8 a0, u8 a1)
{
- sub_8072BD8(gMenuText_WelcomeToHOFAndDexRating, 0, a1 + 1, 0xF0);
+ MenuPrint_Centered(gMenuText_WelcomeToHOFAndDexRating, 0, a1 + 1, 0xF0);
}
static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 a1, u8 a2)
diff --git a/src/map_name_popup.c b/src/map_name_popup.c
index 49a470cc1..102254f22 100644
--- a/src/map_name_popup.c
+++ b/src/map_name_popup.c
@@ -103,5 +103,5 @@ void DrawMapNamePopup(void)
Menu_LoadStdFrameGraphicsOverrideStyle(0);
GetMapSectionName(name, gMapHeader.regionMapSectionId, 0);
Menu_DrawStdWindowFrame(0, 0, 13, 3);
- sub_8072BD8(name, 1, 1, 0x60);
+ MenuPrint_Centered(name, 1, 1, 0x60);
}
diff --git a/src/menu.c b/src/menu.c
index 891644750..d50fb4f22 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -728,22 +728,22 @@ _08072B3E:\n\
}
#endif
-void MenuPrint_RightAligned(const u8 *str, u8 left, u8 top)
+void MenuPrint_RightAligned(const u8 *str, u8 right, u8 top)
{
- Text_InitWindow8004D38(gMenuWindowPtr, str, gMenuTextTileOffset, left, top);
+ Text_InitWindow_RightAligned(gMenuWindowPtr, str, gMenuTextTileOffset, right, top);
}
-void sub_8072B80(const u8 *src, u8 a2, u8 a3, const u8 *a4)
+void sub_8072B80(const u8 *src, u8 a2, u8 a3, const u8 *text)
{
u8 buffer[64];
- u8 width = GetStringWidth(gMenuWindowPtr, a4);
+ u8 width = GetStringWidth(gMenuWindowPtr, text);
AlignString(gMenuWindowPtr, buffer, src, width, 1);
Text_InitWindowAndPrintText(gMenuWindowPtr, buffer, gMenuTextTileOffset, a2, a3);
}
-void sub_8072BD8(const u8 *a1, u8 a2, u8 a3, u16 a4)
+void MenuPrint_Centered(const u8 *text, u8 left, u8 top, u16 width)
{
- Text_InitWindow8004DB0(gMenuWindowPtr, a1, gMenuTextTileOffset, a2, a3, a4);
+ Text_InitWindow_Centered(gMenuWindowPtr, text, gMenuTextTileOffset, left, top, width);
}
u8 *AlignInt1InMenuWindow(u8 *dest, s32 value, u8 alignAmount, u8 alignType)
diff --git a/src/money.c b/src/money.c
index 12a8b71ff..53800f854 100644
--- a/src/money.c
+++ b/src/money.c
@@ -154,7 +154,7 @@ void PrintMoneyAmount(u32 amount, u8 size, u8 x, u8 y)
}
}
-void sub_80B7AEC(u32 arg0, u8 left, u8 top)
+void sub_80B7AEC(u32 arg0, u8 right, u8 top)
{
u8 buffer[32];
u8 *ptr;
@@ -166,7 +166,7 @@ void sub_80B7AEC(u32 arg0, u8 left, u8 top)
ptr = ConvertIntToDecimalString(ptr, arg0);
- MenuPrint_RightAligned(buffer, left, top);
+ MenuPrint_RightAligned(buffer, right, top);
#ifdef ENGLISH
ptr[0] = 0xFC;
diff --git a/src/pokeblock.c b/src/pokeblock.c
index a24cb32cf..03939556c 100644
--- a/src/pokeblock.c
+++ b/src/pokeblock.c
@@ -462,7 +462,7 @@ void debug_sub_8120F98(void)
static void sub_810BB0C(void)
{
BasicInitMenuWindow(&gWindowTemplate_81E6E34);
- sub_8072BD8(ItemId_GetName(ITEM_POKEBLOCK_CASE), 2, 1, 0x48);
+ MenuPrint_Centered(ItemId_GetName(ITEM_POKEBLOCK_CASE), 2, 1, 0x48);
}
static void sub_810BB30(void)
diff --git a/src/pokedex.c b/src/pokedex.c
index 729f72a7c..eb4d1d918 100644
--- a/src/pokedex.c
+++ b/src/pokedex.c
@@ -3367,7 +3367,7 @@ static void Task_InitSizeScreenMultistep(u8 taskId)
string[0] = EOS;
StringAppend(string, gDexText_SizeComparedTo);
StringAppend(string, gSaveBlock2.playerName);
- sub_8072BD8(string, 3, 15, 0xC0);
+ MenuPrint_Centered(string, 3, 15, 0xC0);
gMain.state++;
}
break;
@@ -3815,7 +3815,7 @@ static void sub_8090750(u8 taskId)
gTasks[taskId].data[0]++;
break;
case 3:
- sub_8072BD8(gDexText_RegisterComplete, 2, 0, 0xD0);
+ MenuPrint_Centered(gDexText_RegisterComplete, 2, 0, 0xD0);
if (!IsNationalPokedexEnabled())
sub_8091154(NationalToHoennOrder(dexNum), 13, 3);
else
diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c
index 770b69813..971d7daf7 100644
--- a/src/pokemon_storage_system.c
+++ b/src/pokemon_storage_system.c
@@ -734,7 +734,7 @@ void sub_809665C(void)
u8 *stringVar = gStringVar1;
stringVar[0] = EXT_CTRL_CODE_BEGIN;
- stringVar[1] = 0x04; // EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW
+ stringVar[1] = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW;
stringVar[2] = 0x0F; // TEXT_COLOR_WHITE2
stringVar[3] = 0x01; // TEXT_COLOR_DARK_GREY
stringVar[4] = 0x0E; // TEXT_COLOR_LIGHT_BLUE
@@ -744,7 +744,7 @@ void sub_809665C(void)
stringVar[0] = CHAR_NEWLINE;
stringVar[1] = EXT_CTRL_CODE_BEGIN;
- stringVar[2] = 0x11; // EXT_CTRL_CODE_CLEAR
+ stringVar[2] = EXT_CTRL_CODE_CLEAR;
if (nPokemonInBox < 10)
stringVar[3] = 0x28;
else
diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c
index aabacbe2f..4c8b3b34b 100644
--- a/src/pokemon_summary_screen.c
+++ b/src/pokemon_summary_screen.c
@@ -32,8 +32,8 @@
#include "scanline_effect.h"
#include "daycare.h"
-static void sub_809FC0C(void);
-static void sub_809FEB8(void);
+static void SummaryScreen_PrintPokemonInfoLabels(void);
+static void SummaryScreen_PrintPokemonSkillsLabels(void);
static void sub_809F63C(struct Pokemon *);
static void sub_809F650(struct Pokemon *);
static void sub_809F664(struct Pokemon *);
@@ -43,7 +43,7 @@ static void sub_80A015C(struct Pokemon *);
static void sub_809DE44(void);
static void sub_809EB40(u8);
static void sub_809EBC4(void);
-static void sub_809E044(void);
+static void SummaryScreen_LoadPalettes(void);
static void sub_80A1D84(struct Pokemon *);
static void sub_80A18C4(void);
static bool8 LoadPokemonSummaryScreenGraphics(void);
@@ -53,29 +53,29 @@ static void sub_80A1DCC(struct Pokemon *);
static void sub_809FE80(void);
static void sub_80A00A4(void);
static void sub_80A0390(void);
-extern u8 sub_80A1808(struct Pokemon *);
-static void sub_80A1F98(s32, u8, u8, u8, u8, u16, s32);
+extern u8 SummaryScreen_CreatePokemonSprite(struct Pokemon *);
+static void SummaryScreen_PrintColoredIntPixelCoords(s32, u8, u8, u8, u8, u16, s32);
static void sub_80A0958(struct Pokemon *);
static void PokemonSummaryScreen_PrintTrainerMemo(struct Pokemon *, u8, u8);
static void PokemonSummaryScreen_PrintEggTrainerMemo(struct Pokemon *, u8, u8);
-static void sub_80A1EF8(const u8 *, u8, u8, u16, s32);
-static void sub_80A1F48(const u8 *, u8, u8, u8, u16);
+static void SummaryScreen_PrintColoredTextPixelCoords(const u8 *, u8, u8, u16, s32);
+static void SummaryScreen_PrintColoredTextCentered(const u8 *, u8, u8, u8, u16);
static void PrintHeldItemName(u16, u8, u8);
static void PrintNumRibbons(struct Pokemon *);
static void DrawExperienceProgressBar(struct Pokemon *, u8, u8);
-static void sub_809E13C(u8 taskId);
+static void SummaryScreen_DestroyTask(u8 taskId);
static void sub_80A1950(void);
static void sub_809DE64(void);
static void SummaryScreenHandleAButton(u8);
static void SummaryScreenHandleUpDownInput(u8, s8);
-static bool8 sub_809F7D0(u8);
+static bool8 SummaryScreen_CanForgetSelectedMove(u8);
static void sub_809F9D0(u8, u8);
-static void sub_809EAC8(u8);
+static void SummaryScreen_MoveSelect_Cancel(u8);
static void sub_809E534(u8);
static void sub_809E83C(u8, s8);
static void sub_80A1B40(u8);
static void sub_80A2078(int);
-static void sub_809E3FC(u8);
+static void SummaryScreen_MoveSelect_HandleInput(u8);
static void SummaryScreenHandleKeyInput(u8);
static void sub_80A1B1C(u8);
static void sub_80A16CC(u8);
@@ -91,7 +91,7 @@ extern s8 sub_809F284(s8);
extern s8 sub_809F3CC(s8);
static bool8 sub_809F5F8(void);
static void sub_80A1DE8(struct Pokemon *);
-static u8 sub_809F6B4(struct Pokemon *, u8 *);
+static u8 SummaryScreen_LoadPokemonSprite(struct Pokemon *, u8 *);
static void DrawPokerusSurvivorDot(struct Pokemon *);
static void sub_80A12D0(s8);
static void sub_809FAC8(struct Pokemon *);
@@ -99,24 +99,25 @@ static void SummaryScreenHandleLeftRightInput(u8, s8);
static void sub_809E8F0();
static void sub_80A1654(s8, u8);
static void sub_80A1488(s8, u8);
-static void sub_809FC34(struct Pokemon *);
-static void sub_809FF64(struct Pokemon *);
+static void SummaryScreen_PrintPokemonInfo(struct Pokemon *);
+static void SummaryScreen_PrintPokemonSkills(struct Pokemon *);
static void sub_80A1918(u8, u8);
-static void sub_80A198C(u8, u8, u8, u8);
+static void SummaryScreen_DrawTypeIcon(u8, u8, u8, u8);
static u16 GetMonMove(struct Pokemon *, u8);
static void sub_80A04CC(u16);
static void sub_80A057C(u16);
static void sub_80A0498(u16);
static void sub_80A046C(u16);
static void sub_80A20A8(u8);
-static void sub_809F678(struct Pokemon *);
+static void SummaryScreen_GetPokemon(struct Pokemon *);
static void sub_80A1BC0(struct Sprite *sprite);
-static void sub_80A1888(struct Sprite *);
+static void SummaryScreen_SpritePlayCry(struct Sprite *);
static void sub_80A0428(struct Pokemon *, u8 *);
static void sub_80A18E4(u8);
-static u8 *sub_80A1E58(u8 *, u8);
+static u8 *SummaryScreen_SetTextColor(u8 *, u8);
+static u8 *SummaryScreen_CopyColoredString(u8 *, const u8 *, u8);
static void sub_80A0A2C(struct Pokemon *, u8, u8);
-static void sub_80A1FF8(const u8 *, u8, u8, u8);
+static void SummaryScreen_PrintColoredText(const u8 *, u8, u8, u8);
extern u8 ball_number_to_ball_processing_index(u16);
extern u8 StorageSystemGetNextMonIndex(struct BoxPokemon *, u8, u8, u8);
@@ -531,8 +532,8 @@ static const u16 sUnknown_083C157C[] = { RGB(26, 26, 23) };
static const u16 sUnknown_083C157E[] = { RGB(30, 30, 27) };
static void (*const sUnknown_083C1580[])(void) = {
- sub_809FC0C,
- sub_809FEB8,
+ SummaryScreen_PrintPokemonInfoLabels,
+ SummaryScreen_PrintPokemonSkillsLabels,
};
static void (*const sUnknown_083C1588[])(struct Pokemon *) = {
@@ -554,16 +555,23 @@ static const u8 sDoubleBattlePartyOrder[] = { 0, 2, 3, 1, 4, 5 };
static const u8 sUnknown_083C15AE[] = _("{STR_VAR_1}{CLEAR_TO 64}");
static const u8 sUnknown_083C15B4[] = _("{STR_VAR_1}{CLEAR_TO 72}");
-asm(".align 2"); // TODO: this array is probably not correctly-typed
-static const u8 sUnknown_083C15BC[] = {
- 9, 1, 0, 2,
- 10, 3, 0, 4,
- 8, 5, 0, 6,
- 11, 7, 0, 8,
- 14, 9, 0, 10,
- 12, 11, 0, 12,
- 13, 13, 0, 14,
- -1, 15, 0, 10,
+struct TextColors {
+ u8 id;
+ u8 color;
+ u8 background;
+ u8 shadow;
+};
+
+// The TEXT_COLOR constants don't apply. Refer to the palette for this screen.
+static const struct TextColors sSummaryScreenTextColors[] = {
+ { 9, 1, 0, 2 }, // blue
+ { 10, 3, 0, 4 }, // pink
+ { 8, 5, 0, 6 }, // yellow
+ { 11, 7, 0, 8 }, // blue2
+ { 14, 9, 0, 10 }, // red
+ { 12, 11, 0, 12 }, // pink2
+ { 13, 13, 0, 14 }, // white
+ { -1, 15, 0, 10 }, // black
};
void sub_809D844(void)
@@ -677,7 +685,7 @@ void sub_809DA1C(void)
break;
case PSS_MODE_MOVES_ONLY:
case PSS_MODE_PC_MOVES_ONLY:
- pssData.inputHandlingTaskId = CreateTask(sub_809E3FC, 0);
+ pssData.inputHandlingTaskId = CreateTask(SummaryScreen_MoveSelect_HandleInput, 0);
break;
}
}
@@ -741,7 +749,7 @@ bool8 sub_809DA84(void)
gMain.state++;
break;
case 12:
- sub_809F678(&pssData.loadedMon);
+ SummaryScreen_GetPokemon(&pssData.loadedMon);
if (!GetMonStatusAndPokerus(&pssData.loadedMon))
sub_80A12D0(0);
else
@@ -760,14 +768,14 @@ bool8 sub_809DA84(void)
gMain.state++;
break;
case 15:
- if ((pssData.monSpriteId = sub_809F6B4(&pssData.loadedMon, &pssData.loadGfxState)) != 0xFF)
+ if ((pssData.monSpriteId = SummaryScreen_LoadPokemonSprite(&pssData.loadedMon, &pssData.loadGfxState)) != 0xFF)
{
pssData.loadGfxState = 0;
gMain.state++;
}
break;
case 16:
- sub_809E044();
+ SummaryScreen_LoadPalettes();
DrawSummaryScreenNavigationDots();
gMain.state++;
break;
@@ -908,7 +916,7 @@ static bool8 LoadPokemonSummaryScreenGraphics(void)
return FALSE;
}
-static void sub_809E044(void)
+static void SummaryScreen_LoadPalettes(void)
{
LoadPalette(gUnknownPalette_81E6692 + 14, 129, 2);
LoadPalette(gUnknownPalette_81E6692 + 15, 136, 2);
@@ -931,10 +939,10 @@ static void SummaryScreenExit(u8 taskId)
{
PlaySE(SE_SELECT);
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB(0, 0, 0));
- gTasks[taskId].func = sub_809E13C;
+ gTasks[taskId].func = SummaryScreen_DestroyTask;
}
-static void sub_809E13C(u8 taskId)
+static void SummaryScreen_DestroyTask(u8 taskId)
{
if (sub_8055870() != TRUE && !gPaletteFade.active)
{
@@ -1015,7 +1023,7 @@ static void sub_809E260(u8 taskId)
}
else if (gMain.newKeys & A_BUTTON)
{
- if (sub_809F7D0(taskId) == TRUE || pssData.selectedMoveIndex == 4)
+ if (SummaryScreen_CanForgetSelectedMove(taskId) == TRUE || pssData.selectedMoveIndex == 4)
{
pssData.switchMoveIndex = pssData.selectedMoveIndex;
gSpecialVar_0x8005 = pssData.switchMoveIndex;
@@ -1030,12 +1038,12 @@ static void sub_809E260(u8 taskId)
else if (gMain.newKeys & B_BUTTON)
{
pssData.switchMoveIndex = 4;
- gSpecialVar_0x8005 = 4;
+ gSpecialVar_0x8005 = pssData.switchMoveIndex;
SummaryScreenExit(taskId);
}
}
-static void sub_809E3FC(u8 taskId)
+static void SummaryScreen_MoveSelect_HandleInput(u8 taskId)
{
if (gPaletteFade.active)
return;
@@ -1072,13 +1080,13 @@ static void sub_809E3FC(u8 taskId)
else
{
PlaySE(SE_SELECT);
- sub_809EAC8(taskId);
+ SummaryScreen_MoveSelect_Cancel(taskId);
}
}
else if (gMain.newKeys & B_BUTTON)
{
PlaySE(SE_SELECT);
- sub_809EAC8(taskId);
+ SummaryScreen_MoveSelect_Cancel(taskId);
}
}
@@ -1118,7 +1126,7 @@ static void sub_809E534(u8 taskId)
}
}
-static void sub_809E5C4(void)
+static void SummaryScreen_SwapMoves_Party(void)
{
struct Pokemon *party = pssData.monList.partyMons;
struct Pokemon *pkmn = &party[pssData.monIndex];
@@ -1131,7 +1139,7 @@ static void sub_809E5C4(void)
u8 move2pp = GetMonData(pkmn, MON_DATA_PP1 + moveIndex2);
u8 ppBonuses = GetMonData(pkmn, MON_DATA_PP_BONUSES);
- // Calculate PP bonuses
+ // Swap PP bonuses
u8 r9 = gUnknown_08208238[moveIndex1];
u8 r2 = (ppBonuses & r9) >> (moveIndex1 * 2);
u8 r3 = gUnknown_08208238[moveIndex2];
@@ -1148,7 +1156,7 @@ static void sub_809E5C4(void)
SetMonData(pkmn, MON_DATA_PP_BONUSES, &ppBonuses);
}
-static void sub_809E6D8(void)
+static void SummaryScreen_SwapMoves_Box(void)
{
struct BoxPokemon *boxMons = pssData.monList.boxMons;
struct BoxPokemon *pkmn = &boxMons[pssData.monIndex];
@@ -1161,7 +1169,7 @@ static void sub_809E6D8(void)
u8 move2pp = GetBoxMonData(pkmn, MON_DATA_PP1 + moveIndex2);
u8 ppBonuses = GetBoxMonData(pkmn, MON_DATA_PP_BONUSES);
- // Calculate PP bonuses
+ // Swap PP bonuses
u8 r9 = gUnknown_08208238[moveIndex1];
u8 r2 = (ppBonuses & r9) >> (moveIndex1 * 2);
u8 r3 = gUnknown_08208238[moveIndex2];
@@ -1184,7 +1192,7 @@ void sub_809E7F0(u8 taskId)
{
pssData.loadGfxState = 0;
sub_80A0428(&pssData.loadedMon, &pssData.selectedMoveIndex);
- gTasks[taskId].func = sub_809E3FC;
+ gTasks[taskId].func = SummaryScreen_MoveSelect_HandleInput;
sub_80A2078(taskId);
}
}
@@ -1201,12 +1209,12 @@ static void sub_809E83C(u8 taskId, s8 b)
if (pssData.selectedMoveIndex != pssData.switchMoveIndex)
{
if (pssData.usingPC == FALSE)
- sub_809E5C4();
+ SummaryScreen_SwapMoves_Party();
else
- sub_809E6D8();
+ SummaryScreen_SwapMoves_Box();
pssData.selectedMoveIndex = pssData.switchMoveIndex;
- sub_809F678(&pssData.loadedMon);
+ SummaryScreen_GetPokemon(&pssData.loadedMon);
pssData.loadGfxState = 1;
gTasks[taskId].func = sub_809E7F0;
@@ -1218,7 +1226,7 @@ static void sub_809E83C(u8 taskId, s8 b)
sub_80A0428(&pssData.loadedMon, &pssData.selectedMoveIndex);
}
- gTasks[taskId].func = sub_809E3FC;
+ gTasks[taskId].func = SummaryScreen_MoveSelect_HandleInput;
sub_80A2078(taskId);
}
@@ -1420,11 +1428,11 @@ static void SummaryScreenHandleAButton(u8 taskId)
sub_80A029C(&pssData.loadedMon);
sub_80A1A30(9);
- gTasks[taskId].func = sub_809E3FC;
+ gTasks[taskId].func = SummaryScreen_MoveSelect_HandleInput;
sub_80A2078(taskId);
}
-static void sub_809EAC8(u8 taskId)
+static void SummaryScreen_MoveSelect_Cancel(u8 taskId)
{
if (pssData.selectedMoveIndex != 4)
{
@@ -2055,14 +2063,14 @@ void sub_809F43C(u8 taskId)
gMain.state++;
break;
case 4:
- sub_809F678(&pssData.loadedMon);
+ SummaryScreen_GetPokemon(&pssData.loadedMon);
if (GetMonStatusAndPokerus(&pssData.loadedMon))
sub_80A12D0(2);
DrawPokerusSurvivorDot(&pssData.loadedMon);
gMain.state++;
break;
case 5:
- if ((pssData.monSpriteId = sub_809F6B4(&pssData.loadedMon, &pssData.loadGfxState)) != 0xFF)
+ if ((pssData.monSpriteId = SummaryScreen_LoadPokemonSprite(&pssData.loadedMon, &pssData.loadGfxState)) != 0xFF)
{
pssData.loadGfxState = 0;
if (GetMonData(&pssData.loadedMon, MON_DATA_IS_EGG))
@@ -2115,13 +2123,13 @@ static bool8 sub_809F5F8(void)
static void sub_809F63C(struct Pokemon *mon)
{
sub_809FE80();
- sub_809FC34(mon);
+ SummaryScreen_PrintPokemonInfo(mon);
}
static void sub_809F650(struct Pokemon *mon)
{
sub_80A00A4();
- sub_809FF64(mon);
+ SummaryScreen_PrintPokemonSkills(mon);
}
static void sub_809F664(struct Pokemon *mon)
@@ -2130,9 +2138,9 @@ static void sub_809F664(struct Pokemon *mon)
sub_80A015C(mon);
}
-static void sub_809F678(struct Pokemon *mon)
+static void SummaryScreen_GetPokemon(struct Pokemon *mon)
{
- if (pssData.usingPC == FALSE)
+ if (!pssData.usingPC)
{
struct Pokemon *mons = pssData.monList.partyMons;
*mon = mons[pssData.monIndex];
@@ -2144,17 +2152,17 @@ static void sub_809F678(struct Pokemon *mon)
}
}
-static u8 sub_809F6B4(struct Pokemon *mon, u8 *b)
+static u8 SummaryScreen_LoadPokemonSprite(struct Pokemon *mon, u8 *state)
{
u16 species;
u32 personality;
u32 otId;
const struct CompressedSpritePalette *palette;
- switch (*b)
+ switch (*state)
{
default:
- return sub_80A1808(mon);
+ return SummaryScreen_CreatePokemonSprite(mon);
case 0:
species = GetMonData(mon, MON_DATA_SPECIES2);
personality = GetMonData(mon, MON_DATA_PERSONALITY);
@@ -2167,7 +2175,7 @@ static u8 sub_809F6B4(struct Pokemon *mon, u8 *b)
gUnknown_081FAF4C[1],
species,
personality);
- *b += 1;
+ *state += 1;
return 0xFF;
case 1:
species = GetMonData(mon, MON_DATA_SPECIES2);
@@ -2177,7 +2185,7 @@ static u8 sub_809F6B4(struct Pokemon *mon, u8 *b)
palette = GetMonSpritePalStructFromOtIdPersonality(species, otId, personality);
LoadCompressedObjectPalette(palette);
GetMonSpriteTemplate_803C56C(palette->tag, 1);
- *b += 1;
+ *state += 1;
return 0xFF;
}
}
@@ -2212,12 +2220,12 @@ static u16 GetMonMovePP(struct Pokemon *mon, u8 moveId)
}
}
-static bool8 sub_809F7D0(u8 taskId)
+static bool8 SummaryScreen_CanForgetSelectedMove(u8 taskId)
{
struct Pokemon mon;
u16 move;
- sub_809F678(&mon);
+ SummaryScreen_GetPokemon(&mon);
move = GetMonMove(&mon, pssData.selectedMoveIndex);
if (IsHMMove(move) == TRUE && pssData.mode != PSS_MODE_UNKNOWN)
return FALSE;
@@ -2285,11 +2293,11 @@ void sub_809F814(u8 taskId)
}
}
-static void sub_809F9D0(u8 taskId, u8 b)
+static void sub_809F9D0(u8 taskId, u8 moveIndex)
{
s16 *taskData = gTasks[taskId].data;
taskData[14] = 0;
- taskData[15] = b;
+ taskData[15] = moveIndex;
sub_80A1488(-2, 4);
sub_80A1654(-2, 4);
@@ -2304,51 +2312,16 @@ u8 sub_809FA30(void)
return pssData.switchMoveIndex;
}
-// void GetStringCenterAlignXOffsetWithLetterSpacing(u8 a, u8 b, u8 c, u8 d)
-// {
-// u16 *vramAddr = (u16 *)(VRAM + 0xF000);
-
-// vramAddr[(d * 32) + c] = (b * 0x1000) + (a * 2) + 0x200 + 0x80;
-// vramAddr[(d * 32) + c + 32] = (b * 0x1000) + (a * 2) + 0x200 + 0x81;
-// }
-NAKED
-void GetStringCenterAlignXOffsetWithLetterSpacing(u8 a, u8 b, u8 c, u8 d)
+static void SummaryScreen_PlaceTextTile(u8 tile, u8 palette, u8 x, u8 y)
{
- asm(".syntax unified\n\
- push {r4,lr}\n\
- lsls r0, 24\n\
- lsls r1, 24\n\
- lsls r2, 24\n\
- lsls r3, 24\n\
- lsrs r2, 23\n\
- lsrs r3, 18\n\
- ldr r4, _0809FA70 @ =0x0600f000\n\
- adds r3, r4\n\
- adds r2, r3\n\
- lsrs r1, 12\n\
- lsrs r0, 23\n\
- movs r4, 0x80\n\
- lsls r4, 2\n\
- adds r3, r4, 0\n\
- adds r0, r3\n\
- adds r1, r0\n\
- adds r0, r1, 0\n\
- adds r0, 0x80\n\
- strh r0, [r2]\n\
- adds r2, 0x40\n\
- adds r1, 0x81\n\
- strh r1, [r2]\n\
- pop {r4}\n\
- pop {r0}\n\
- bx r0\n\
- .align 2, 0\n\
-_0809FA70: .4byte 0x0600f000\n\
- .syntax divided\n");
+ u16 *vramAddr = (u16 *)(VRAM + 0xF000) + x + y * 32;
+ vramAddr[0] = (palette << 12) + 0x200 + tile * 2 + 0x80;
+ vramAddr[32] = (palette << 12) + 0x200 + tile * 2 + 0x81;
}
-void GetStringCenterAlignXOffset(u8 a, u8 b, u8 c)
+static void SummaryScreen_PlaceTextTile_White(u8 tile, u8 x, u8 y)
{
- GetStringCenterAlignXOffsetWithLetterSpacing(a, 15, b, c);
+ SummaryScreen_PlaceTextTile(tile, 15, x, y);
}
bool8 sub_809FA94(struct Pokemon *mon)
@@ -2367,7 +2340,7 @@ bool8 sub_809FA94(struct Pokemon *mon)
static void sub_809FAC8(struct Pokemon *mon)
{
- bool8 shinyDexNum;
+ bool8 shiny;
u16 dexNum;
u8 *buffer;
@@ -2377,24 +2350,24 @@ static void sub_809FAC8(struct Pokemon *mon)
Menu_EraseWindowRect(3, 16, 9, 17);
Menu_EraseWindowRect(0, 12, 11, 15);
GetMonNickname(mon, gStringVar1);
- sub_80A1FF8(gStringVar1, 13, 3, 16);
+ SummaryScreen_PrintColoredText(gStringVar1, 13, 3, 16);
LoadPalette(sUnknown_083C157C, 4, 2);
}
else
{
- shinyDexNum = sub_809FA94(mon);
+ shiny = sub_809FA94(mon);
dexNum = SpeciesToPokedexNum(GetMonData(mon, MON_DATA_SPECIES));
if (dexNum != 0xFFFF)
{
- if (!shinyDexNum)
+ if (!shiny)
{
- GetStringCenterAlignXOffset(2, 1, 2);
- sub_80A1F98(dexNum, 13, 3, 2, 17, 16, 1);
+ SummaryScreen_PlaceTextTile_White(2, 1, 2);
+ SummaryScreen_PrintColoredIntPixelCoords(dexNum, 13, 3, 2, 17, 16, 1);
}
else
{
- GetStringCenterAlignXOffsetWithLetterSpacing(2, 8, 1, 2);
- sub_80A1F98(dexNum, 8, 3, 2, 17, 16, 1);
+ SummaryScreen_PlaceTextTile(2, 8, 1, 2);
+ SummaryScreen_PrintColoredIntPixelCoords(dexNum, 8, 3, 2, 17, 16, 1);
}
}
else
@@ -2403,7 +2376,7 @@ static void sub_809FAC8(struct Pokemon *mon)
}
buffer = gStringVar1;
- buffer = sub_80A1E58(buffer, 13);
+ buffer = SummaryScreen_SetTextColor(buffer, 13);
buffer = GetMonNickname(mon, buffer);
buffer[0] = EXT_CTRL_CODE_BEGIN;
buffer[1] = 0x13;
@@ -2425,14 +2398,14 @@ static void sub_809FBE4(void)
Menu_EraseWindowRect(11, 4, 29, 18);
}
-static void sub_809FC0C(void)
+static void SummaryScreen_PrintPokemonInfoLabels(void)
{
Menu_PrintText(gOtherText_Type2, 11, 6);
- GetStringCenterAlignXOffset(0, 22, 4);
- GetStringCenterAlignXOffset(2, 23, 4);
+ SummaryScreen_PlaceTextTile_White(0, 22, 4);
+ SummaryScreen_PlaceTextTile_White(2, 23, 4);
}
-static void sub_809FC34(struct Pokemon *mon)
+static void SummaryScreen_PrintPokemonInfo(struct Pokemon *mon)
{
u8 i;
u8 *buffer;
@@ -2448,7 +2421,7 @@ static void sub_809FC34(struct Pokemon *mon)
if (GetMonData(mon, MON_DATA_IS_EGG))
{
buffer = gStringVar1;
- buffer = sub_80A1E58(buffer, 13);
+ buffer = SummaryScreen_SetTextColor(buffer, 13);
buffer = StringCopy(buffer, gOtherText_OriginalTrainer);
buffer = StringCopy(buffer, gOtherText_FiveQuestions);
buffer[0] = EXT_CTRL_CODE_BEGIN;
@@ -2457,15 +2430,15 @@ static void sub_809FC34(struct Pokemon *mon)
buffer[3] = EOS;
Menu_PrintText(gStringVar1, 11, 4);
- sub_80A1EF8(gOtherText_FiveQuestions, 13, 193, 32, 1);
- sub_80A198C(9, 120, 48, 0);
+ SummaryScreen_PrintColoredTextPixelCoords(gOtherText_FiveQuestions, 13, 193, 32, 1);
+ SummaryScreen_DrawTypeIcon(TYPE_MYSTERY, 120, 48, 0);
friendship = GetMonData(mon, MON_DATA_FRIENDSHIP);
- if (friendship < 6)
+ if (friendship <= 5)
Menu_PrintText(gOtherText_EggAbout, 11, 9);
- else if (friendship < 11)
+ else if (friendship <= 10)
Menu_PrintText(gOtherText_EggSoon, 11, 9);
- else if (friendship < 41)
+ else if (friendship <= 40)
Menu_PrintText(gOtherText_EggSomeTime, 11, 9);
else
Menu_PrintText(gOtherText_EggLongTime, 11, 9);
@@ -2479,13 +2452,13 @@ static void sub_809FC34(struct Pokemon *mon)
ConvertInternationalString(gStringVar2, language);
buffer = gStringVar1;
- buffer = sub_80A1E58(buffer, 13);
+ buffer = SummaryScreen_SetTextColor(buffer, 13);
buffer = StringCopy(buffer, gOtherText_OriginalTrainer);
if (GetMonData(mon, MON_DATA_OT_GENDER) == MALE)
- buffer = sub_80A1E58(buffer, 9);
+ buffer = SummaryScreen_SetTextColor(buffer, 9);
else
- buffer = sub_80A1E58(buffer, 10);
+ buffer = SummaryScreen_SetTextColor(buffer, 10);
buffer = StringCopy(buffer, gStringVar2);
buffer[0] = EXT_CTRL_CODE_BEGIN;
@@ -2494,15 +2467,15 @@ static void sub_809FC34(struct Pokemon *mon)
buffer[3] = EOS;
Menu_PrintText(gStringVar1, 11, 4);
- sub_80A1F98(GetMonData(mon, MON_DATA_OT_ID) & 0xFFFF, 13, 5, 2, 193, 32, 1);
+ SummaryScreen_PrintColoredIntPixelCoords(GetMonData(mon, MON_DATA_OT_ID) & 0xFFFF, 13, 5, 2, 193, 32, 1);
species = GetMonData(mon, MON_DATA_SPECIES);
- sub_80A198C(gBaseStats[species].type1, 120, 48, 0);
+ SummaryScreen_DrawTypeIcon(gBaseStats[species].type1, 120, 48, 0);
if (gBaseStats[species].type1 != gBaseStats[species].type2)
- sub_80A198C(gBaseStats[species].type2, 160, 48, 1);
+ SummaryScreen_DrawTypeIcon(gBaseStats[species].type2, 160, 48, 1);
ability = GetAbilityBySpecies(GetMonData(mon, MON_DATA_SPECIES), GetMonData(mon, MON_DATA_ALT_ABILITY));
- sub_80A1FF8(gAbilityNames[ability], 13, 11, 9);
+ SummaryScreen_PrintColoredText(gAbilityNames[ability], 13, 11, 9);
Menu_PrintText(gAbilityDescriptions[ability], 11, 11);
PokemonSummaryScreen_PrintTrainerMemo(mon, 11, 14);
@@ -2511,8 +2484,8 @@ static void sub_809FC34(struct Pokemon *mon)
static void sub_809FE6C(struct Pokemon *mon)
{
- sub_809FC0C();
- sub_809FC34(mon);
+ SummaryScreen_PrintPokemonInfoLabels();
+ SummaryScreen_PrintPokemonInfo(mon);
}
static void sub_809FE80(void)
@@ -2523,21 +2496,21 @@ static void sub_809FE80(void)
Menu_EraseWindowRect(11, 14, 28, 17);
}
-static void sub_809FEB8(void)
+static void SummaryScreen_PrintPokemonSkillsLabels(void)
{
- sub_80A1FF8(gOtherText_ExpPoints, 13, 11, 14);
- sub_80A1FF8(gOtherText_NextLv, 13, 11, 16);
+ SummaryScreen_PrintColoredText(gOtherText_ExpPoints, 13, 11, 14);
+ SummaryScreen_PrintColoredText(gOtherText_NextLv, 13, 11, 16);
Menu_PrintText(gOtherText_Terminator18, 21, 16);
- sub_80A1F48(gOtherText_HP, 13, 11, 7, 42);
- sub_80A1F48(gOtherText_Attack, 13, 11, 9, 42);
- sub_80A1F48(gOtherText_Defense, 13, 11, 11, 42);
- sub_80A1F48(gOtherText_SpAtk, 13, 22, 7, 36);
- sub_80A1F48(gOtherText_SpDef, 13, 22, 9, 36);
- sub_80A1F48(gOtherText_Speed, 13, 22, 11, 36);
+ SummaryScreen_PrintColoredTextCentered(gOtherText_HP, 13, 11, 7, 42);
+ SummaryScreen_PrintColoredTextCentered(gOtherText_Attack, 13, 11, 9, 42);
+ SummaryScreen_PrintColoredTextCentered(gOtherText_Defense, 13, 11, 11, 42);
+ SummaryScreen_PrintColoredTextCentered(gOtherText_SpAtk, 13, 22, 7, 36);
+ SummaryScreen_PrintColoredTextCentered(gOtherText_SpDef, 13, 22, 9, 36);
+ SummaryScreen_PrintColoredTextCentered(gOtherText_Speed, 13, 22, 11, 36);
}
-static void sub_809FF64(struct Pokemon *mon)
+static void SummaryScreen_PrintPokemonSkills(struct Pokemon *mon)
{
u8 i;
u16 heldItem;
@@ -2557,19 +2530,19 @@ static void sub_809FF64(struct Pokemon *mon)
DrawExperienceProgressBar(mon, 23, 16);
ConvertIntToDecimalString(buffer, GetMonData(mon, MON_DATA_ATK));
- sub_8072BD8(buffer, 16, 9, 50);
+ MenuPrint_Centered(buffer, 16, 9, 50);
ConvertIntToDecimalString(buffer, GetMonData(mon, MON_DATA_DEF));
- sub_8072BD8(buffer, 16, 11, 50);
+ MenuPrint_Centered(buffer, 16, 11, 50);
ConvertIntToDecimalString(buffer, GetMonData(mon, MON_DATA_SPATK));
- sub_8072BD8(buffer, 27, 7, 18);
+ MenuPrint_Centered(buffer, 27, 7, 18);
ConvertIntToDecimalString(buffer, GetMonData(mon, MON_DATA_SPDEF));
- sub_8072BD8(buffer, 27, 9, 18);
+ MenuPrint_Centered(buffer, 27, 9, 18);
ConvertIntToDecimalString(buffer, GetMonData(mon, MON_DATA_SPEED));
- sub_8072BD8(buffer, 27, 11, 18);
+ MenuPrint_Centered(buffer, 27, 11, 18);
buffer = AlignInt1InMenuWindow(buffer, GetMonData(mon, MON_DATA_HP), 24, 1);
*buffer++ = CHAR_SLASH;
@@ -2580,8 +2553,8 @@ static void sub_809FF64(struct Pokemon *mon)
static void sub_80A0090(struct Pokemon *mon)
{
- sub_809FEB8();
- sub_809FF64(mon);
+ SummaryScreen_PrintPokemonSkillsLabels();
+ SummaryScreen_PrintPokemonSkills(mon);
}
static void sub_80A00A4(void)
@@ -2600,13 +2573,13 @@ static void sub_80A00F4(u8 a)
{
if (pssData.page == PSS_PAGE_BATTLE_MOVES)
{
- sub_80A1FF8(gOtherText_Power2, 13, 1, 15);
- sub_80A1FF8(gOtherText_Accuracy2, 13, 1, 17);
+ SummaryScreen_PrintColoredText(gOtherText_Power2, 13, 1, 15);
+ SummaryScreen_PrintColoredText(gOtherText_Accuracy2, 13, 1, 17);
}
else
{
- sub_80A1FF8(gOtherText_Appeal2, 13, 1, 15);
- sub_80A1FF8(gOtherText_Jam2, 13, 1, 17);
+ SummaryScreen_PrintColoredText(gOtherText_Appeal2, 13, 1, 15);
+ SummaryScreen_PrintColoredText(gOtherText_Jam2, 13, 1, 17);
}
}
}
@@ -2628,18 +2601,18 @@ static void sub_80A015C(struct Pokemon *mon)
if (move == 0)
{
sub_80A1918(i, 1);
- sub_80A1FF8(gOtherText_OneDash, 13, 15, (2 * i) + 4);
+ SummaryScreen_PrintColoredText(gOtherText_OneDash, 13, 15, (2 * i) + 4);
Menu_PrintText(gOtherText_TwoDashes, 26, (2 * i) + 4);
}
else
{
if (pssData.page == PSS_PAGE_BATTLE_MOVES)
- sub_80A198C(gBattleMoves[move].type, 87, ((2 * i) + 4) * 8, i);
+ SummaryScreen_DrawTypeIcon(gBattleMoves[move].type, 87, ((2 * i) + 4) * 8, i);
else
- sub_80A198C(gContestMoves[move].contestCategory + 18, 87, ((2 * i) + 4) * 8, i);
+ SummaryScreen_DrawTypeIcon(gContestMoves[move].contestCategory + 18, 87, ((2 * i) + 4) * 8, i);
- sub_80A1FF8(gMoveNames[move], 13, 15, (2 * i) + 4);
- GetStringCenterAlignXOffset(1, 24, (2 * i) + 4);
+ SummaryScreen_PrintColoredText(gMoveNames[move], 13, 15, (2 * i) + 4);
+ SummaryScreen_PlaceTextTile_White(1, 24, (2 * i) + 4);
ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES);
maxPP = CalculatePPWithBonus(move, ppBonuses, i);
@@ -2661,23 +2634,23 @@ static void sub_80A029C(struct Pokemon *mon)
if (pssData.moveToLearn == 0)
{
- sub_80A1FF8(gOtherText_CancelNoTerminator, 13, 15, 12);
+ SummaryScreen_PrintColoredText(gOtherText_CancelNoTerminator, 13, 15, 12);
return;
}
move = pssData.moveToLearn;
if (pssData.page == PSS_PAGE_BATTLE_MOVES)
- sub_80A198C(gBattleMoves[move].type, 87, 96, 4);
+ SummaryScreen_DrawTypeIcon(gBattleMoves[move].type, 87, 96, 4);
else
- sub_80A198C(gContestMoves[move].contestCategory + 18, 87, 96, 4);
+ SummaryScreen_DrawTypeIcon(gContestMoves[move].contestCategory + 18, 87, 96, 4);
if (pssData.page == PSS_PAGE_BATTLE_MOVES)
- sub_80A1FF8(gMoveNames[move], 10, 15, 12);
+ SummaryScreen_PrintColoredText(gMoveNames[move], 10, 15, 12);
else
- sub_80A1FF8(gMoveNames[move], 9, 15, 12);
+ SummaryScreen_PrintColoredText(gMoveNames[move], 9, 15, 12);
- GetStringCenterAlignXOffset(1, 24, 12);
+ SummaryScreen_PlaceTextTile_White(1, 24, 12);
buffer = gStringVar1;
pp = gBattleMoves[move].pp;
@@ -3031,13 +3004,13 @@ static void PokemonSummaryScreen_PrintTrainerMemo(struct Pokemon *mon, u8 left,
u8 nature = GetNature(mon);
#if ENGLISH
- ptr = sub_80A1E9C(ptr, gNatureNames[nature], 14);
+ ptr = SummaryScreen_CopyColoredString(ptr, gNatureNames[nature], 14);
if (nature != NATURE_BOLD && nature != NATURE_GENTLE)
ptr = StringCopy(ptr, gOtherText_Terminator4);
ptr = StringCopy(ptr, gOtherText_Nature);
#elif GERMAN
ptr = StringCopy(gStringVar4, gOtherText_Nature);
- ptr = sub_80A1E9C(ptr, gNatureNames[nature], 14);
+ ptr = SummaryScreen_CopyColoredString(ptr, gNatureNames[nature], 14);
ptr = StringCopy(ptr, gOtherText_Terminator4);
#endif
@@ -3052,7 +3025,7 @@ static void PokemonSummaryScreen_PrintTrainerMemo(struct Pokemon *mon, u8 left,
ptr++;
CopyLocationName(gStringVar1, locationMet);
- ptr = sub_80A1E9C(ptr, gStringVar1, 14);
+ ptr = SummaryScreen_CopyColoredString(ptr, gStringVar1, 14);
StringCopy(ptr, gOtherText_Egg2);
}
else if (locationMet >= 88)
@@ -3071,7 +3044,7 @@ static void PokemonSummaryScreen_PrintTrainerMemo(struct Pokemon *mon, u8 left,
ptr++;
CopyLocationName(gStringVar1, locationMet);
- ptr = sub_80A1E9C(ptr, gStringVar1, 14);
+ ptr = SummaryScreen_CopyColoredString(ptr, gStringVar1, 14);
StringCopy(ptr, gOtherText_Met);
}
}
@@ -3115,7 +3088,7 @@ static void PokemonSummaryScreen_PrintTrainerMemo(struct Pokemon *mon, u8 left,
ptr++;
CopyLocationName(gStringVar1, locationMet);
- ptr = sub_80A1E9C(ptr, gStringVar1, 14);
+ ptr = SummaryScreen_CopyColoredString(ptr, gStringVar1, 14);
StringCopy(ptr, gOtherText_Met2);
}
}
@@ -3133,7 +3106,7 @@ static void sub_80A0958(struct Pokemon *mon)
species = GetMonData(mon, MON_DATA_SPECIES);
buffer = gStringVar1;
- buffer = sub_80A1E58(buffer, 13);
+ buffer = SummaryScreen_SetTextColor(buffer, 13);
buffer[0] = EXT_CTRL_CODE_BEGIN;
buffer[1] = 0x11;
buffer[2] = 0x7;
@@ -3151,8 +3124,8 @@ static void sub_80A0958(struct Pokemon *mon)
level = GetMonData(mon, MON_DATA_LEVEL);
- buffer = sub_80A1E58(gStringVar1, 13);
- buffer[0] = 0x34;
+ buffer = SummaryScreen_SetTextColor(gStringVar1, 13);
+ buffer[0] = CHAR_LV;
buffer += 1;
buffer = ConvertIntToDecimalString(buffer, level);
@@ -3168,7 +3141,7 @@ static void sub_80A0958(struct Pokemon *mon)
static void sub_80A0A2C(struct Pokemon *mon, u8 left, u8 top)
{
const u8 *genderSymbol;
- u8 var1;
+ u8 color;
u8 bottom;
u16 species = GetMonData(mon, MON_DATA_SPECIES2);
@@ -3183,21 +3156,22 @@ static void sub_80A0A2C(struct Pokemon *mon, u8 left, u8 top)
return;
case MON_MALE:
genderSymbol = gOtherText_MaleSymbol2;
- var1 = 11;
+ color = 11;
break;
case MON_FEMALE:
- genderSymbol = gOtherText_FemaleSymbolAndLv;
- var1 = 12;
+ genderSymbol = gOtherText_FemaleSymbol2;
+ color = 12;
break;
}
- sub_80A1FF8(genderSymbol, var1, left, top);
+ SummaryScreen_PrintColoredText(genderSymbol, color, left, top);
}
}
u8 GetNumRibbons(struct Pokemon *mon)
{
- u8 numRibbons = GetMonData(mon, MON_DATA_COOL_RIBBON);
+ u8 numRibbons = 0;
+ numRibbons += GetMonData(mon, MON_DATA_COOL_RIBBON);
numRibbons += GetMonData(mon, MON_DATA_BEAUTY_RIBBON);
numRibbons += GetMonData(mon, MON_DATA_CUTE_RIBBON);
numRibbons += GetMonData(mon, MON_DATA_SMART_RIBBON);
@@ -3308,12 +3282,11 @@ static void DrawExperienceProgressBar(struct Pokemon *mon, u8 left, u8 top)
for (i = 0; i < 8; i++)
{
u16 tile;
- u16 baseTile = 0x2062;
- if (numExpProgressBarTicks > 7)
- tile = 0x206A; // full exp. bar block
+ if (numExpProgressBarTicks >= 8)
+ tile = 0x2062 + 8; // full exp. bar block
else
- tile = (numExpProgressBarTicks % 8) + baseTile;
+ tile = 0x2062 + (numExpProgressBarTicks % 8);
vramAddr[i] = tile;
@@ -3336,7 +3309,7 @@ static void PrintSummaryWindowHeaderText(void)
buffer[2] = 0x2;
buffer += 3;
- buffer = sub_80A1E58(buffer, 13);
+ buffer = SummaryScreen_SetTextColor(buffer, 13);
buffer = StringCopy(buffer, sPageHeaderTexts[pssData.headerTextId]);
buffer[0] = EXT_CTRL_CODE_BEGIN;
@@ -3348,8 +3321,8 @@ static void PrintSummaryWindowHeaderText(void)
if (pssData.headerActionTextId != 0)
{
- GetStringCenterAlignXOffset(5, 23, 0);
- GetStringCenterAlignXOffset(6, 24, 0);
+ SummaryScreen_PlaceTextTile_White(5, 23, 0);
+ SummaryScreen_PlaceTextTile_White(6, 24, 0);
}
else
{
@@ -3357,7 +3330,7 @@ static void PrintSummaryWindowHeaderText(void)
}
buffer = gStringVar1;
- buffer = sub_80A1E58(buffer, 13);
+ buffer = SummaryScreen_SetTextColor(buffer, 13);
buffer = StringCopy(buffer, sPageHeaderTexts[pssData.headerActionTextId]);
buffer[0] = EXT_CTRL_CODE_BEGIN;
@@ -3935,7 +3908,7 @@ _080A1286:\n\
movs r1, 0xD\n\
movs r2, 0x1\n\
movs r3, 0x12\n\
- bl sub_80A1FF8\n\
+ bl SummaryScreen_PrintColoredText\n\
_080A129A:\n\
bl sub_80A1D18\n\
mov r0, r8\n\
@@ -4026,7 +3999,7 @@ static void sub_80A12D0(s8 a)
// if (GetMonStatusAndPokerus(pssData.loadedMon))
// {
-// sub_80A1FF8(gOtherText_Status, 13, 1, 18);
+// SummaryScreen_PrintColoredText(gOtherText_Status, 13, 1, 18);
// }
// DestroyTask(taskId);
@@ -4179,7 +4152,7 @@ _080A1410:\n\
movs r1, 0xD\n\
movs r2, 0x1\n\
movs r3, 0x12\n\
- bl sub_80A1FF8\n\
+ bl SummaryScreen_PrintColoredText\n\
_080A1444:\n\
mov r0, r10\n\
bl DestroyTask\n\
@@ -4375,7 +4348,7 @@ _080A15DC:\n\
movs r1, 0xD\n\
movs r2, 0x1\n\
movs r3, 0x12\n\
- bl sub_80A1FF8\n\
+ bl SummaryScreen_PrintColoredText\n\
_080A1610:\n\
mov r0, r10\n\
bl DestroyTask\n\
@@ -4652,7 +4625,7 @@ _080A1804: .4byte gUnknown_08E94550\n\
}
#endif // NONMATCHING
-u8 sub_80A1808(struct Pokemon *mon)
+u8 SummaryScreen_CreatePokemonSprite(struct Pokemon *mon)
{
u16 species;
u8 spriteId;
@@ -4663,7 +4636,7 @@ u8 sub_80A1808(struct Pokemon *mon)
FreeSpriteOamMatrix(&gSprites[spriteId]);
gSprites[spriteId].data[0] = species;
- gSprites[spriteId].callback = sub_80A1888;
+ gSprites[spriteId].callback = SummaryScreen_SpritePlayCry;
if (!IsPokeSpriteNotFlipped(species))
gSprites[spriteId].hFlip = TRUE;
@@ -4673,7 +4646,7 @@ u8 sub_80A1808(struct Pokemon *mon)
return spriteId;
}
-static void sub_80A1888(struct Sprite *sprite)
+static void SummaryScreen_SpritePlayCry(struct Sprite *sprite)
{
if (!gPaletteFade.active)
{
@@ -4719,7 +4692,7 @@ static void sub_80A1950(void)
}
}
-static void sub_80A198C(u8 animNum, u8 x, u8 y, u8 d)
+static void SummaryScreen_DrawTypeIcon(u8 animNum, u8 x, u8 y, u8 d)
{
StartSpriteAnim(&gSprites[ewram1A000[d]], animNum);
@@ -4860,7 +4833,7 @@ void sub_80A1D18(void)
u8 statusAndPkrs;
u8 statusAndPkrs2;
- sub_809F678(&mon);
+ SummaryScreen_GetPokemon(&mon);
statusAndPkrs = GetMonStatusAndPokerus(&mon);
if (statusAndPkrs)
@@ -4886,7 +4859,7 @@ void sub_80A1D18(void)
push {r4,r5,lr}\n\
sub sp, 0x64\n\
mov r0, sp\n\
- bl sub_809F678\n\
+ bl SummaryScreen_GetPokemon\n\
mov r0, sp\n\
bl GetMonStatusAndPokerus\n\
lsls r0, 24\n\
@@ -4940,7 +4913,7 @@ static void sub_80A1D84(struct Pokemon *mon)
{
struct Sprite *sprite;
- sprite = sub_80F7920(0x7533, 0x7533, sSummaryScreenMonMarkingsPalette);
+ sprite = sub_80F7920(30003, 30003, sSummaryScreenMonMarkingsPalette);
gUnknown_020384F4 = sprite;
if (sprite != NULL)
@@ -4969,20 +4942,20 @@ static void sub_80A1DE8(struct Pokemon *mon)
gSprites[pssData.ballSpriteId].oam.priority = 3;
}
-static u8 *sub_80A1E58(u8 *text, u8 id)
+static u8 *SummaryScreen_SetTextColor(u8 *text, u8 id)
{
if (id != 0xFF)
{
- const u8 *ptr = sUnknown_083C15BC;
+ const struct TextColors *colors = sSummaryScreenTextColors;
- while (*ptr != 0xFF && *ptr != id)
- ptr += 4;
+ while (colors->id != 0xFF && colors->id != id)
+ colors++;
text[0] = EXT_CTRL_CODE_BEGIN;
- text[1] = 4;
- text[2] = ptr[1];
- text[3] = ptr[2];
- text[4] = ptr[3];
+ text[1] = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW;
+ text[2] = colors->color;
+ text[3] = colors->background;
+ text[4] = colors->shadow;
text += 5;
}
@@ -4990,22 +4963,22 @@ static u8 *sub_80A1E58(u8 *text, u8 id)
return text;
}
-u8 *sub_80A1E9C(u8 *dest, const u8 *src, u8 id)
+static u8 *SummaryScreen_CopyColoredString(u8 *dest, const u8 *src, u8 id)
{
- u8 arr[3];
+ u8 colors[3];
- Menu_GetTextColors(&arr[0], &arr[1], &arr[2]);
+ Menu_GetTextColors(&colors[0], &colors[1], &colors[2]);
- dest = sub_80A1E58(dest, id);
+ dest = SummaryScreen_SetTextColor(dest, id);
dest = StringCopy(dest, src);
if (id != 0xFF)
{
dest[0] = EXT_CTRL_CODE_BEGIN;
- dest[1] = 4;
- dest[2] = arr[0];
- dest[3] = arr[1];
- dest[4] = arr[2];
+ dest[1] = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW;
+ dest[2] = colors[0];
+ dest[3] = colors[1];
+ dest[4] = colors[2];
dest[5] = 0xFF;
dest += 5;
@@ -5014,27 +4987,27 @@ u8 *sub_80A1E9C(u8 *dest, const u8 *src, u8 id)
return dest;
}
-static void sub_80A1EF8(const u8 *text, u8 id, u8 left, u16 top, s32 e)
+static void SummaryScreen_PrintColoredTextPixelCoords(const u8 *text, u8 id, u8 left, u16 top, s32 e)
{
- sub_80A1E9C(gStringVar4, text, id);
+ SummaryScreen_CopyColoredString(gStringVar4, text, id);
Menu_PrintTextPixelCoords(gStringVar4, left, top, (bool8)e);
}
-static void sub_80A1F48(const u8 *text, u8 id, u8 c, u8 d, u16 e)
+static void SummaryScreen_PrintColoredTextCentered(const u8 *text, u8 id, u8 left, u8 top, u16 width)
{
- sub_80A1E9C(gStringVar4, text, id);
- sub_8072BD8(gStringVar4, c, d, e);
+ SummaryScreen_CopyColoredString(gStringVar4, text, id);
+ MenuPrint_Centered(gStringVar4, left, top, width);
}
-static void sub_80A1F98(s32 value, u8 id, u8 n, u8 mode, u8 left, u16 top, s32 e)
+static void SummaryScreen_PrintColoredIntPixelCoords(s32 value, u8 id, u8 n, u8 mode, u8 left, u16 top, s32 e)
{
ConvertIntToDecimalStringN(gStringVar1, value, mode, n);
- sub_80A1EF8(gStringVar1, id, left, top, e);
+ SummaryScreen_PrintColoredTextPixelCoords(gStringVar1, id, left, top, e);
}
-static void sub_80A1FF8(const u8 *text, u8 id, u8 left, u8 top)
+static void SummaryScreen_PrintColoredText(const u8 *text, u8 id, u8 left, u8 top)
{
- sub_80A1E9C(gStringVar4, text, id);
+ SummaryScreen_CopyColoredString(gStringVar4, text, id);
Menu_PrintText(gStringVar4, left, top);
}
@@ -5042,14 +5015,13 @@ u8 *PokemonSummaryScreen_CopyPokemonLevel(u8 *dest, u8 level)
{
u8 buffer[12];
- dest[0] = 0x34;
- dest++;
+ *dest++ = CHAR_LV;
if (level == 0)
level = 5;
ConvertIntToDecimalString(buffer, level);
- dest = sub_80A1E9C(dest, buffer, 14);
+ dest = SummaryScreen_CopyColoredString(dest, buffer, 14);
dest = StringCopy(dest, gOtherText_Comma);
return dest;
diff --git a/src/strings.c b/src/strings.c
index cded04f96..e9d9ea87e 100644
--- a/src/strings.c
+++ b/src/strings.c
@@ -2,6 +2,7 @@
#include "strings.h"
#if ENGLISH
+
// placeholder strings
const u8 gExpandedPlaceholder_Empty[] = _("");
const u8 gExpandedPlaceholder_Kun[] = _("");
@@ -180,7 +181,8 @@ const u8 gOtherText_OneDash[] = _("-");
const u8 gOtherText_TwoDashes[] = _("--");
const u8 gOtherText_ThreeDashes2[] = _("---");
const u8 gOtherText_MaleSymbol2[] = _("♂");
-const u8 gOtherText_FemaleSymbolAndLv[] = _("♀$Lv.");
+const u8 gOtherText_FemaleSymbol2[] = _("♀");
+const u8 gOtherText_Lv[] = _("Lv.");
const u8 gOtherText_TallPlusAndRightArrow[] = _("{TALL_PLUS}${RIGHT_ARROW}");
const u8 gMenuText_GoBackToPrev[] = _("Go back to the\nprevious menu.");
const u8 gOtherText_WhatWillYouDo[] = _("What would you like to do?");
@@ -926,6 +928,7 @@ const u8 gSystemText_SaveFailed[] = _("Save failed...");
const u8 gSystemText_NoSaveFileNoTime[] = _("There is no save file, so the time\ncan’t be set.");
const u8 gSystemText_ClockAdjustmentUsable[] = _("The in-game clock adjustment system\nis now useable.");
const u8 gSystemText_Saving[] = _("SAVING...\nDON’T TURN OFF THE POWER.");
+
#elif GERMAN
// placeholder strings
@@ -1106,7 +1109,8 @@ const u8 gOtherText_OneDash[] = _("-");
const u8 gOtherText_TwoDashes[] = _("--");
const u8 gOtherText_ThreeDashes2[] = _("---");
const u8 gOtherText_MaleSymbol2[] = _("♂");
-const u8 gOtherText_FemaleSymbolAndLv[] = _("♀$Lv.");
+const u8 gOtherText_FemaleSymbol2[] = _("♀");
+const u8 gOtherText_Lv[] = _("Lv.");
const u8 gOtherText_TallPlusAndRightArrow[] = _("{TALL_PLUS}${RIGHT_ARROW}");
const u8 gMenuText_GoBackToPrev[] = _("Kehre zurück zum\nvorherigen Menü.");
const u8 gOtherText_WhatWillYouDo[] = _("Was möchtest du tun?");
diff --git a/src/text.c b/src/text.c
index c2f78276b..dbf74ab61 100644
--- a/src/text.c
+++ b/src/text.c
@@ -2003,7 +2003,7 @@ void Text_InitWindow8002E4C(struct Window *win, const u8 *text, u16 tileDataStar
if (a6)
val = 255;
win->win_field_F = val;
- if (val)
+ if (win->win_field_F)
ClipLeft(win);
}
@@ -3394,7 +3394,7 @@ static u16 GetBlankTileNum(struct Window *win)
return retVal;
}
-static s32 sub_80048D8(struct Window *win, u8 x, u8 y)
+static s32 Window_MoveCursor(struct Window *win, u8 x, u8 y)
{
win->cursorX = x;
win->cursorY = y & 0xF8;
@@ -3672,25 +3672,26 @@ u8 Text_InitWindow8004D04(struct Window *win, const u8 *text, u16 tileDataStartO
return Text_PrintWindow8002F44(win);
}
-u8 Text_InitWindow8004D38(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top)
+u8 Text_InitWindow_RightAligned(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 right, u8 top)
{
u8 width = GetStringWidth(win, text);
- Text_InitWindow(win, text, tileDataStartOffset, left - ((u32)(width + 7) >> 3), top);
+ Text_InitWindow(win, text, tileDataStartOffset, right - ((u32)(width + 7) >> 3), top);
EraseAtCursor(win);
width &= 7;
if (width)
width = 8 - width;
- sub_80048D8(win, width, 0);
+ Window_MoveCursor(win, width, 0);
return Text_PrintWindow8002F44(win);
}
-u8 Text_InitWindow8004DB0(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top, u16 a6)
+u8 Text_InitWindow_Centered(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top, u16 width)
{
- register u32 val asm("r5") = (u8)((a6 >> 1) - (GetStringWidth(win, text) >> 1));
- left += (val >> 3);
+ width = (u8)(width / 2 - GetStringWidth(win, text) / 2);
+ left += (u8)width / 8;
Text_InitWindow(win, text, tileDataStartOffset, left, top);
EraseAtCursor(win);
- sub_80048D8(win, val & 7, 0);
+ width &= 7;
+ Window_MoveCursor(win, width, 0);
return Text_PrintWindow8002F44(win);
}