From 91a127893478273f4c1641bb1cb86dffbdbf8956 Mon Sep 17 00:00:00 2001 From: FosterProgramming Date: Wed, 25 Feb 2026 15:19:09 +0100 Subject: [PATCH] Fix region text when looking at map in frlg (#9347) --- charmap.txt | 1 + data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc | 2 +- include/constants/characters.h | 1 + include/strings.h | 1 + src/field_region_map.c | 9 +++++++-- src/string_util.c | 9 +++++++++ src/strings.c | 1 + 7 files changed, 21 insertions(+), 3 deletions(-) diff --git a/charmap.txt b/charmap.txt index d209d0dd26..f7591c29d3 100644 --- a/charmap.txt +++ b/charmap.txt @@ -350,6 +350,7 @@ ARCHIE = FD 0A MAXIE = FD 0B KYOGRE = FD 0C GROUDON = FD 0D +REGION = FD 0E @ battle string placeholders diff --git a/data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc b/data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc index 2832e9d794..3cd958330b 100644 --- a/data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc +++ b/data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc @@ -294,7 +294,7 @@ PlayersHouse_2F_Text_Notebook: Common_Text_LookCloserAtMap: .string "{PLAYER} took a closer look at the\n" - .string "HOENN region map.$" + .string "{REGION} region map.$" PlayersHouse_2F_Text_ItsAGameCube: .string "It's a Nintendo GameCube.\p" diff --git a/include/constants/characters.h b/include/constants/characters.h index cdd31299bc..8050c6de38 100644 --- a/include/constants/characters.h +++ b/include/constants/characters.h @@ -268,6 +268,7 @@ #define PLACEHOLDER_ID_MAXIE 0xB #define PLACEHOLDER_ID_KYOGRE 0xC #define PLACEHOLDER_ID_GROUDON 0xD +#define PLACEHOLDER_ID_REGION 0xE // battle placeholders are located in battle_message.h diff --git a/include/strings.h b/include/strings.h index 715656709b..3fe3b01ca8 100644 --- a/include/strings.h +++ b/include/strings.h @@ -111,6 +111,7 @@ extern const u8 gText_Decorate[]; extern const u8 gText_PutAway[]; extern const u8 gText_Toss2[]; extern const u8 gText_Hoenn[]; +extern const u8 gText_Kanto[]; extern const u8 gText_Ferry[]; extern const u8 gText_SecretBase[]; extern const u8 gText_Hideout[]; diff --git a/src/field_region_map.c b/src/field_region_map.c index f12422cc01..f7a8632ca7 100644 --- a/src/field_region_map.c +++ b/src/field_region_map.c @@ -231,7 +231,12 @@ static void PrintRegionMapSecName(void) static void PrintTitleWindowText(void) { static const u8 FlyPromptText[] = _("{R_BUTTON} FLY"); - u32 hoennOffset = GetStringCenterAlignXOffset(FONT_NORMAL, gText_Hoenn, 0x38); + const u8 *region; + if (IS_FRLG) + region = gText_Kanto; + else + region = gText_Hoenn; + u32 hoennOffset = GetStringCenterAlignXOffset(FONT_NORMAL, region, 0x38); u32 flyOffset = GetStringCenterAlignXOffset(FONT_NORMAL, FlyPromptText, 0x38); FillWindowPixelBuffer(WIN_TITLE, PIXEL_FILL(1)); @@ -244,7 +249,7 @@ static void PrintTitleWindowText(void) } else { - AddTextPrinterParameterized(WIN_TITLE, FONT_NORMAL, gText_Hoenn, hoennOffset, 1, 0, NULL); + AddTextPrinterParameterized(WIN_TITLE, FONT_NORMAL, region, hoennOffset, 1, 0, NULL); CopyWindowToVram(WIN_TITLE, COPYWIN_FULL); } } diff --git a/src/string_util.c b/src/string_util.c index 7ab2631787..30a480b876 100644 --- a/src/string_util.c +++ b/src/string_util.c @@ -525,6 +525,14 @@ static const u8 *ExpandPlaceholder_Groudon(void) return gText_ExpandedPlaceholder_Groudon; } +static const u8 *ExpandPlaceholder_Region(void) +{ + if (IS_FRLG) + return gText_Kanto; + else + return gText_Hoenn; +} + const u8 *GetExpandedPlaceholder(u32 id) { typedef const u8 *(*ExpandPlaceholderFunc)(void); @@ -545,6 +553,7 @@ const u8 *GetExpandedPlaceholder(u32 id) [PLACEHOLDER_ID_MAXIE] = ExpandPlaceholder_Maxie, [PLACEHOLDER_ID_KYOGRE] = ExpandPlaceholder_Kyogre, [PLACEHOLDER_ID_GROUDON] = ExpandPlaceholder_Groudon, + [PLACEHOLDER_ID_REGION] = ExpandPlaceholder_Region, }; if (id >= ARRAY_COUNT(funcs)) diff --git a/src/strings.c b/src/strings.c index 587197076d..f2b76132d8 100644 --- a/src/strings.c +++ b/src/strings.c @@ -1007,6 +1007,7 @@ const u8 gText_PokedexDiploma[] = _("PLAYER: {CLEAR 0x10}{COLOR RED}{SHADOW LIGH const u8 gJPText_GameFreak[] = _("{COLOR RED}{SHADOW LIGHT_RED}ゲ-ムフリ-ク"); // Unused const u8 gText_DiplomaEmpty[] = _("{COLOR RED}{SHADOW LIGHT_RED}"); // Unused const u8 gText_Hoenn[] = _("HOENN"); +const u8 gText_Kanto[] = _("KANTO"); const u8 gText_XWillBeSentToY[] = _("{STR_VAR_2} will be\nsent to {STR_VAR_1}."); const u8 gText_ByeByeVar1[] = _("Bye-bye, {STR_VAR_2}!"); const u8 gText_XSentOverY[] = _("{STR_VAR_1} sent over {STR_VAR_3}.");