From 024700769a5deec98c0eb0231b6e3f61f5043a89 Mon Sep 17 00:00:00 2001 From: Deokishisu Date: Sat, 6 Oct 2018 01:45:36 -0400 Subject: [PATCH 1/5] Document all possible VERSION_ numbers and add them to the enum --- include/global.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/global.h b/include/global.h index b35008550..842cec257 100644 --- a/include/global.h +++ b/include/global.h @@ -86,13 +86,28 @@ extern u8 gStringVar4[]; #define T2_READ_32(ptr) ((ptr)[0] + ((ptr)[1] << 8) + ((ptr)[2] << 16) + ((ptr)[3] << 24)) #define T2_READ_PTR(ptr) (void*) T2_READ_32(ptr) +/*Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen. + *In Gen 4 only, migrated Pokemon with Diamond, Pearl, or Platinum's ID show as "----------". + *Gen 5 and up read Diamond, Pearl, or Platinum's ID as "Sinnoh". + *In Gen 4, migrated Pokemon with Heartgold or Soulsilver's ID show the unused "Johto" string.*/ enum { + VERSION_INVALID_0 = 0, VERSION_SAPPHIRE = 1, VERSION_RUBY = 2, VERSION_EMERALD = 3, VERSION_FIRE_RED = 4, VERSION_LEAF_GREEN = 5, + VERSION_INVALID_6 = 6, + VERSION_HEARTGOLD = 7, + VERSION_SOULSILVER = 8, + VERSION_INVALID_9 = 9, + VERSION_DIAMOND = 10, + VERSION_PEARL = 11, + VERSION_PLATINUM = 12, + VERSION_INVALID_13 = 13, + VERSION_INVALID_14 = 14, + VERSION_GAMECUBE = 15, }; enum LanguageId From cc0d2288d5a450591093749eb23381b1b86ccc49 Mon Sep 17 00:00:00 2001 From: Deokishisu Date: Sat, 6 Oct 2018 01:46:17 -0400 Subject: [PATCH 2/5] Match comment formatting --- include/global.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/global.h b/include/global.h index 842cec257..cb029cb07 100644 --- a/include/global.h +++ b/include/global.h @@ -86,10 +86,10 @@ extern u8 gStringVar4[]; #define T2_READ_32(ptr) ((ptr)[0] + ((ptr)[1] << 8) + ((ptr)[2] << 16) + ((ptr)[3] << 24)) #define T2_READ_PTR(ptr) (void*) T2_READ_32(ptr) -/*Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen. - *In Gen 4 only, migrated Pokemon with Diamond, Pearl, or Platinum's ID show as "----------". - *Gen 5 and up read Diamond, Pearl, or Platinum's ID as "Sinnoh". - *In Gen 4, migrated Pokemon with Heartgold or Soulsilver's ID show the unused "Johto" string.*/ +// Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen. +// In Gen 4 only, migrated Pokemon with Diamond, Pearl, or Platinum's ID show as "----------". +// Gen 5 and up read Diamond, Pearl, or Platinum's ID as "Sinnoh". +// In Gen 4, migrated Pokemon with Heartgold or Soulsilver's ID show the unused "Johto" string. enum { VERSION_INVALID_0 = 0, From 76a9cf0d54ff8163fbe5598d04b131407377df87 Mon Sep 17 00:00:00 2001 From: Deokishisu Date: Sat, 6 Oct 2018 01:56:03 -0400 Subject: [PATCH 3/5] Fix captitalization of HGSS in comment and match FRLG formatting in enum --- include/global.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/global.h b/include/global.h index cb029cb07..1faaf4860 100644 --- a/include/global.h +++ b/include/global.h @@ -89,7 +89,7 @@ extern u8 gStringVar4[]; // Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen. // In Gen 4 only, migrated Pokemon with Diamond, Pearl, or Platinum's ID show as "----------". // Gen 5 and up read Diamond, Pearl, or Platinum's ID as "Sinnoh". -// In Gen 4, migrated Pokemon with Heartgold or Soulsilver's ID show the unused "Johto" string. +// In Gen 4, migrated Pokemon with HeartGold or SoulSilver's ID show the unused "Johto" string. enum { VERSION_INVALID_0 = 0, @@ -99,8 +99,8 @@ enum VERSION_FIRE_RED = 4, VERSION_LEAF_GREEN = 5, VERSION_INVALID_6 = 6, - VERSION_HEARTGOLD = 7, - VERSION_SOULSILVER = 8, + VERSION_HEART_GOLD = 7, + VERSION_SOUL_SILVER = 8, VERSION_INVALID_9 = 9, VERSION_DIAMOND = 10, VERSION_PEARL = 11, From 9f69ea1931168cddfe5dd1c1d38facfcaa179184 Mon Sep 17 00:00:00 2001 From: Deokishisu Date: Sat, 6 Oct 2018 01:57:39 -0400 Subject: [PATCH 4/5] Update gGameVersion to use GAME_VERSION --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index f04f9b61b..4c71ed1f9 100644 --- a/src/main.c +++ b/src/main.c @@ -33,7 +33,7 @@ static void VCountIntr(void); static void SerialIntr(void); static void IntrDummy(void); -const u8 gGameVersion = VERSION_EMERALD; +const u8 gGameVersion = GAME_VERSION; const u8 gGameLanguage = GAME_LANGUAGE; // English From 2070c246f97058d45bcec238f5263becc354e2e9 Mon Sep 17 00:00:00 2001 From: Deokishisu Date: Sat, 6 Oct 2018 07:40:56 -0400 Subject: [PATCH 5/5] Added new findings about invalid version IDs. After transferring Pokemon up to Gen 6 and then to Gen 7, I discovered that invalid version IDs display the "a distant land" string that is used for the Gamecube games, so that information was added in a comment. Also clarified that it's not just Gen 4 that displays the Johto string, it's Gen 4 and up. --- include/global.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/global.h b/include/global.h index 1faaf4860..889ddd8f8 100644 --- a/include/global.h +++ b/include/global.h @@ -87,9 +87,10 @@ extern u8 gStringVar4[]; #define T2_READ_PTR(ptr) (void*) T2_READ_32(ptr) // Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen. +// In Gens 6 and 7, invalid versions instead show "a distant land" in the summary screen. // In Gen 4 only, migrated Pokemon with Diamond, Pearl, or Platinum's ID show as "----------". // Gen 5 and up read Diamond, Pearl, or Platinum's ID as "Sinnoh". -// In Gen 4, migrated Pokemon with HeartGold or SoulSilver's ID show the unused "Johto" string. +// In Gen 4 and up, migrated Pokemon with HeartGold or SoulSilver's ID show the unused "Johto" string. enum { VERSION_INVALID_0 = 0,