diff --git a/Source/Core/DiscIO/Enums.cpp b/Source/Core/DiscIO/Enums.cpp index 2ef5b0e344..a124362266 100644 --- a/Source/Core/DiscIO/Enums.cpp +++ b/Source/Core/DiscIO/Enums.cpp @@ -141,6 +141,62 @@ u8 GetSysMenuRegion(u16 title_version) } } +std::string GetSysMenuVersionString(u16 title_version) +{ + if (title_version == 33) + return "1.0"; // 1.0 uses 33 as the version number in all regions + + std::string region_letter; + + switch (GetSysMenuRegion(title_version)) + { + case 'J': + region_letter = "J"; + break; + case 'E': + region_letter = "U"; + break; + case 'P': + region_letter = "E"; + break; + case 'K': + region_letter = "K"; + break; + } + + switch (title_version & ~0xf) + { + case 96: + case 128: + return "2.0" + region_letter; + case 160: + return "2.1" + region_letter; + case 192: + return "2.2" + region_letter; + case 224: + return "3.0" + region_letter; + case 256: + return "3.1" + region_letter; + case 288: + return "3.2" + region_letter; + case 320: + case 352: + return "3.3" + region_letter; + case 384: + return (region_letter != "K" ? "3.4" : "3.5") + region_letter; + case 416: + return "4.0" + region_letter; + case 448: + return "4.1" + region_letter; + case 480: + return "4.2" + region_letter; + case 512: + return "4.3" + region_letter; + default: + return "?.?" + region_letter; + } +} + std::string GetCompanyFromID(const std::string& company_id) { static const std::map companies = { diff --git a/Source/Core/DiscIO/Enums.h b/Source/Core/DiscIO/Enums.h index 8e7ee5259b..0d95e263f0 100644 --- a/Source/Core/DiscIO/Enums.h +++ b/Source/Core/DiscIO/Enums.h @@ -4,6 +4,8 @@ #pragma once +#include + #include "Common/CommonTypes.h" namespace DiscIO @@ -71,5 +73,6 @@ Region RegionSwitchGC(u8 country_code); Region RegionSwitchWii(u8 country_code); Country CountrySwitch(u8 country_code); u8 GetSysMenuRegion(u16 title_version); +std::string GetSysMenuVersionString(u16 title_version); std::string GetCompanyFromID(const std::string& company_id); } diff --git a/Source/Core/DolphinWX/MainMenuBar.cpp b/Source/Core/DolphinWX/MainMenuBar.cpp index fe5a14c5cf..55cf2d378e 100644 --- a/Source/Core/DolphinWX/MainMenuBar.cpp +++ b/Source/Core/DolphinWX/MainMenuBar.cpp @@ -545,11 +545,10 @@ void MainMenuBar::RefreshWiiSystemMenuLabel() const if (sys_menu_loader.IsValid()) { - const u16 sys_menu_version = sys_menu_loader.GetTMD().GetTitleVersion(); - const char sys_menu_region = DiscIO::GetSysMenuRegion(sys_menu_version); + const u16 version_number = sys_menu_loader.GetTMD().GetTitleVersion(); + const wxString version_string = StrToWxStr(DiscIO::GetSysMenuVersionString(version_number)); item->Enable(); - item->SetItemLabel( - wxString::Format(_("Load Wii System Menu %u%c"), sys_menu_version, sys_menu_region)); + item->SetItemLabel(wxString::Format(_("Load Wii System Menu %s"), version_string)); } else {