summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Config
diff options
context:
space:
mode:
authorcomex <comexk@gmail.com>2015-05-05 16:20:04 -0400
committercomex <comexk@gmail.com>2015-05-05 16:20:04 -0400
commit6414cdabb2ae7762f2d98427b9ff024af07bb959 (patch)
tree5362ae99777fc494d6c2b059b0bd63a6bb296b97 /Source/Core/DolphinWX/Config
parent430e8b7adeb5b3adb12ef50ce7961562463b0fa0 (diff)
parentdf8e768b77b551832ace0d552ec10c1b062c55f3 (diff)
Merge pull request #2286 from JosJuice/wii-opening-bnr
Read opening.bnr to get names from Wii discs
Diffstat (limited to 'Source/Core/DolphinWX/Config')
-rw-r--r--Source/Core/DolphinWX/Config/WiiConfigPane.cpp63
-rw-r--r--Source/Core/DolphinWX/Config/WiiConfigPane.h3
2 files changed, 30 insertions, 36 deletions
diff --git a/Source/Core/DolphinWX/Config/WiiConfigPane.cpp b/Source/Core/DolphinWX/Config/WiiConfigPane.cpp
index 31b957ce89..b2e08b5bee 100644
--- a/Source/Core/DolphinWX/Config/WiiConfigPane.cpp
+++ b/Source/Core/DolphinWX/Config/WiiConfigPane.cpp
@@ -11,6 +11,7 @@
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "Core/IPC_HLE/WII_IPC_HLE.h"
+#include "DiscIO/Volume.h"
#include "DolphinWX/WxUtils.h"
#include "DolphinWX/Config/WiiConfigPane.h"
@@ -125,7 +126,7 @@ void WiiConfigPane::OnConnectKeyboardCheckBoxChanged(wxCommandEvent& event)
void WiiConfigPane::OnSystemLanguageChoiceChanged(wxCommandEvent& event)
{
- int wii_system_lang = m_system_language_choice->GetSelection();
+ IVolume::ELanguage wii_system_lang = (IVolume::ELanguage)m_system_language_choice->GetSelection();
SConfig::GetInstance().m_SYSCONF->SetData("IPL.LNG", wii_system_lang);
u8 country_code = GetSADRCountryCode(wii_system_lang);
@@ -138,41 +139,33 @@ void WiiConfigPane::OnAspectRatioChoiceChanged(wxCommandEvent& event)
SConfig::GetInstance().m_SYSCONF->SetData("IPL.AR", m_aspect_ratio_choice->GetSelection());
}
-// Change from IPL.LNG value to IPL.SADR country code
-u8 WiiConfigPane::GetSADRCountryCode(int language)
+// Change from IPL.LNG value to IPL.SADR country code.
+// http://wiibrew.org/wiki/Country_Codes
+u8 WiiConfigPane::GetSADRCountryCode(IVolume::ELanguage language)
{
- //http://wiibrew.org/wiki/Country_Codes
- u8 country_code = language;
- switch (country_code)
+ switch (language)
{
- case 0: //Japanese
- country_code = 1; //Japan
- break;
- case 1: //English
- country_code = 49; //USA
- break;
- case 2: //German
- country_code = 78; //Germany
- break;
- case 3: //French
- country_code = 77; //France
- break;
- case 4: //Spanish
- country_code = 105; //Spain
- break;
- case 5: //Italian
- country_code = 83; //Italy
- break;
- case 6: //Dutch
- country_code = 94; //Netherlands
- break;
- case 7: //Simplified Chinese
- case 8: //Traditional Chinese
- country_code = 157; //China
- break;
- case 9: //Korean
- country_code = 136; //Korea
- break;
+ case IVolume::LANGUAGE_JAPANESE:
+ return 1; // Japan
+ case IVolume::LANGUAGE_ENGLISH:
+ return 49; // USA
+ case IVolume::LANGUAGE_GERMAN:
+ return 78; // Germany
+ case IVolume::LANGUAGE_FRENCH:
+ return 77; // France
+ case IVolume::LANGUAGE_SPANISH:
+ return 105; // Spain
+ case IVolume::LANGUAGE_ITALIAN:
+ return 83; // Italy
+ case IVolume::LANGUAGE_DUTCH:
+ return 94; // Netherlands
+ case IVolume::LANGUAGE_SIMPLIFIED_CHINESE:
+ case IVolume::LANGUAGE_TRADITIONAL_CHINESE:
+ return 157; // China
+ case IVolume::LANGUAGE_KOREAN:
+ return 136; // Korea
}
- return country_code;
+
+ PanicAlert("Invalid language");
+ return 1;
}
diff --git a/Source/Core/DolphinWX/Config/WiiConfigPane.h b/Source/Core/DolphinWX/Config/WiiConfigPane.h
index 72ea81548a..1fb57887ca 100644
--- a/Source/Core/DolphinWX/Config/WiiConfigPane.h
+++ b/Source/Core/DolphinWX/Config/WiiConfigPane.h
@@ -7,6 +7,7 @@
#include <wx/arrstr.h>
#include <wx/panel.h>
#include "Common/CommonTypes.h"
+#include "DiscIO/Volume.h"
class wxCheckBox;
class wxChoice;
@@ -29,7 +30,7 @@ private:
void OnSystemLanguageChoiceChanged(wxCommandEvent&);
void OnAspectRatioChoiceChanged(wxCommandEvent&);
- static u8 GetSADRCountryCode(int language);
+ static u8 GetSADRCountryCode(IVolume::ELanguage language);
wxArrayString m_system_language_strings;
wxArrayString m_aspect_ratio_strings;