De-capitalized CountryCode
This commit is contained in:
parent
df2f6d137e
commit
06cb85991e
|
@ -307,10 +307,10 @@ bool CBoot::EmulatedBS2_Wii()
|
||||||
INFO_LOG(BOOT, "Faking Wii BS2...");
|
INFO_LOG(BOOT, "Faking Wii BS2...");
|
||||||
|
|
||||||
// setup Wii memory
|
// setup Wii memory
|
||||||
DiscIO::IVolume::ECountry CountryCode = DiscIO::IVolume::COUNTRY_UNKNOWN;
|
DiscIO::IVolume::ECountry country_code = DiscIO::IVolume::COUNTRY_UNKNOWN;
|
||||||
if (VolumeHandler::IsValid())
|
if (VolumeHandler::IsValid())
|
||||||
CountryCode = VolumeHandler::GetVolume()->GetCountry();
|
country_code = VolumeHandler::GetVolume()->GetCountry();
|
||||||
if (SetupWiiMemory(CountryCode) == false)
|
if (SetupWiiMemory(country_code) == false)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// This is some kind of consistency check that is compared to the 0x00
|
// This is some kind of consistency check that is compared to the 0x00
|
||||||
|
|
|
@ -136,7 +136,7 @@ CEXIMemoryCard::CEXIMemoryCard(const int index, bool gciFolder)
|
||||||
|
|
||||||
void CEXIMemoryCard::SetupGciFolder(u16 sizeMb)
|
void CEXIMemoryCard::SetupGciFolder(u16 sizeMb)
|
||||||
{
|
{
|
||||||
DiscIO::IVolume::ECountry CountryCode = DiscIO::IVolume::COUNTRY_UNKNOWN;
|
DiscIO::IVolume::ECountry country_code = DiscIO::IVolume::COUNTRY_UNKNOWN;
|
||||||
auto strUniqueID = SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID;
|
auto strUniqueID = SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID;
|
||||||
|
|
||||||
u32 CurrentGameId = 0;
|
u32 CurrentGameId = 0;
|
||||||
|
@ -145,17 +145,17 @@ void CEXIMemoryCard::SetupGciFolder(u16 sizeMb)
|
||||||
const DiscIO::INANDContentLoader & SysMenu_Loader = DiscIO::CNANDContentManager::Access().GetNANDLoader(TITLEID_SYSMENU, false);
|
const DiscIO::INANDContentLoader & SysMenu_Loader = DiscIO::CNANDContentManager::Access().GetNANDLoader(TITLEID_SYSMENU, false);
|
||||||
if (SysMenu_Loader.IsValid())
|
if (SysMenu_Loader.IsValid())
|
||||||
{
|
{
|
||||||
CountryCode = DiscIO::CountrySwitch(SysMenu_Loader.GetCountryChar());
|
country_code = DiscIO::CountrySwitch(SysMenu_Loader.GetCountryChar());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (strUniqueID.length() >= 4)
|
else if (strUniqueID.length() >= 4)
|
||||||
{
|
{
|
||||||
CountryCode = DiscIO::CountrySwitch(strUniqueID.at(3));
|
country_code = DiscIO::CountrySwitch(strUniqueID.at(3));
|
||||||
CurrentGameId = BE32((u8*)strUniqueID.c_str());
|
CurrentGameId = BE32((u8*)strUniqueID.c_str());
|
||||||
}
|
}
|
||||||
bool ascii = true;
|
bool ascii = true;
|
||||||
std::string strDirectoryName = File::GetUserPath(D_GCUSER_IDX);
|
std::string strDirectoryName = File::GetUserPath(D_GCUSER_IDX);
|
||||||
switch (CountryCode)
|
switch (country_code)
|
||||||
{
|
{
|
||||||
case DiscIO::IVolume::COUNTRY_JAPAN:
|
case DiscIO::IVolume::COUNTRY_JAPAN:
|
||||||
ascii = false;
|
ascii = false;
|
||||||
|
@ -182,20 +182,20 @@ void CEXIMemoryCard::SetupGciFolder(u16 sizeMb)
|
||||||
std::string region = memcardFilename.substr(memcardFilename.size() - 7, 3);
|
std::string region = memcardFilename.substr(memcardFilename.size() - 7, 3);
|
||||||
if (region == JAP_DIR)
|
if (region == JAP_DIR)
|
||||||
{
|
{
|
||||||
CountryCode = DiscIO::IVolume::COUNTRY_JAPAN;
|
country_code = DiscIO::IVolume::COUNTRY_JAPAN;
|
||||||
ascii = false;
|
ascii = false;
|
||||||
strDirectoryName += JAP_DIR DIR_SEP;
|
strDirectoryName += JAP_DIR DIR_SEP;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (region == USA_DIR)
|
else if (region == USA_DIR)
|
||||||
{
|
{
|
||||||
CountryCode = DiscIO::IVolume::COUNTRY_USA;
|
country_code = DiscIO::IVolume::COUNTRY_USA;
|
||||||
strDirectoryName += USA_DIR DIR_SEP;
|
strDirectoryName += USA_DIR DIR_SEP;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
CountryCode = DiscIO::IVolume::COUNTRY_EUROPE;
|
country_code = DiscIO::IVolume::COUNTRY_EUROPE;
|
||||||
strDirectoryName += EUR_DIR DIR_SEP;
|
strDirectoryName += EUR_DIR DIR_SEP;
|
||||||
}
|
}
|
||||||
strDirectoryName += StringFromFormat("Card %c", 'A' + card_index);
|
strDirectoryName += StringFromFormat("Card %c", 'A' + card_index);
|
||||||
|
@ -222,7 +222,7 @@ void CEXIMemoryCard::SetupGciFolder(u16 sizeMb)
|
||||||
}
|
}
|
||||||
|
|
||||||
memorycard = std::make_unique<GCMemcardDirectory>(strDirectoryName + DIR_SEP, card_index, sizeMb, ascii,
|
memorycard = std::make_unique<GCMemcardDirectory>(strDirectoryName + DIR_SEP, card_index, sizeMb, ascii,
|
||||||
CountryCode, CurrentGameId);
|
country_code, CurrentGameId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEXIMemoryCard::SetupRawMemcard(u16 sizeMb)
|
void CEXIMemoryCard::SetupRawMemcard(u16 sizeMb)
|
||||||
|
|
|
@ -71,7 +71,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
// Generic Switch function for all volumes
|
// Generic Switch function for all volumes
|
||||||
IVolume::ECountry CountrySwitch(u8 CountryCode);
|
IVolume::ECountry CountrySwitch(u8 country_code);
|
||||||
u8 GetSysMenuRegion(u16 _TitleVersion);
|
u8 GetSysMenuRegion(u16 _TitleVersion);
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -12,9 +12,9 @@
|
||||||
// Increment CACHE_REVISION if the code below is modified (ISOFile.cpp & GameFile.cpp)
|
// Increment CACHE_REVISION if the code below is modified (ISOFile.cpp & GameFile.cpp)
|
||||||
namespace DiscIO
|
namespace DiscIO
|
||||||
{
|
{
|
||||||
IVolume::ECountry CountrySwitch(u8 CountryCode)
|
IVolume::ECountry CountrySwitch(u8 country_code)
|
||||||
{
|
{
|
||||||
switch (CountryCode)
|
switch (country_code)
|
||||||
{
|
{
|
||||||
// Region free - Uses European flag as placeholder
|
// Region free - Uses European flag as placeholder
|
||||||
case 'A':
|
case 'A':
|
||||||
|
@ -68,8 +68,8 @@ IVolume::ECountry CountrySwitch(u8 CountryCode)
|
||||||
return IVolume::COUNTRY_TAIWAN;
|
return IVolume::COUNTRY_TAIWAN;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (CountryCode > 'A') // Silently ignore IOS wads
|
if (country_code > 'A') // Silently ignore IOS wads
|
||||||
WARN_LOG(DISCIO, "Unknown Country Code! %c", CountryCode);
|
WARN_LOG(DISCIO, "Unknown Country Code! %c", country_code);
|
||||||
return IVolume::COUNTRY_UNKNOWN;
|
return IVolume::COUNTRY_UNKNOWN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,9 +174,9 @@ void CVolumeDirectory::SetUniqueID(const std::string& id)
|
||||||
|
|
||||||
IVolume::ECountry CVolumeDirectory::GetCountry() const
|
IVolume::ECountry CVolumeDirectory::GetCountry() const
|
||||||
{
|
{
|
||||||
u8 CountryCode = m_diskHeader[3];
|
u8 country_code = m_diskHeader[3];
|
||||||
|
|
||||||
return CountrySwitch(CountryCode);
|
return CountrySwitch(country_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CVolumeDirectory::GetMakerID() const
|
std::string CVolumeDirectory::GetMakerID() const
|
||||||
|
|
|
@ -108,7 +108,7 @@ private:
|
||||||
u32 debug_flag;
|
u32 debug_flag;
|
||||||
u32 track_location;
|
u32 track_location;
|
||||||
u32 track_size;
|
u32 track_size;
|
||||||
u32 countrycode;
|
u32 country_code;
|
||||||
u32 unknown;
|
u32 unknown;
|
||||||
u32 unknown2;
|
u32 unknown2;
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ private:
|
||||||
debug_flag = 0;
|
debug_flag = 0;
|
||||||
track_location = 0;
|
track_location = 0;
|
||||||
track_size = 0;
|
track_size = 0;
|
||||||
countrycode = 0;
|
country_code = 0;
|
||||||
unknown = 0;
|
unknown = 0;
|
||||||
unknown2 = 0;
|
unknown2 = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,10 +61,10 @@ IVolume::ECountry CVolumeGC::GetCountry() const
|
||||||
if (!m_pReader)
|
if (!m_pReader)
|
||||||
return COUNTRY_UNKNOWN;
|
return COUNTRY_UNKNOWN;
|
||||||
|
|
||||||
u8 CountryCode;
|
u8 country_code;
|
||||||
m_pReader->Read(3, 1, &CountryCode);
|
m_pReader->Read(3, 1, &country_code);
|
||||||
|
|
||||||
return CountrySwitch(CountryCode);
|
return CountrySwitch(country_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CVolumeGC::GetMakerID() const
|
std::string CVolumeGC::GetMakerID() const
|
||||||
|
|
|
@ -54,17 +54,17 @@ IVolume::ECountry CVolumeWAD::GetCountry() const
|
||||||
return COUNTRY_UNKNOWN;
|
return COUNTRY_UNKNOWN;
|
||||||
|
|
||||||
// read the last digit of the titleID in the ticket
|
// read the last digit of the titleID in the ticket
|
||||||
u8 CountryCode;
|
u8 country_code;
|
||||||
Read(m_tmd_offset + 0x0193, 1, &CountryCode);
|
Read(m_tmd_offset + 0x0193, 1, &country_code);
|
||||||
|
|
||||||
if (CountryCode == 2) // SYSMENU
|
if (country_code == 2) // SYSMENU
|
||||||
{
|
{
|
||||||
u16 titlever = 0;
|
u16 titlever = 0;
|
||||||
Read(m_tmd_offset + 0x01dc, 2, (u8*)&titlever);
|
Read(m_tmd_offset + 0x01dc, 2, (u8*)&titlever);
|
||||||
CountryCode = GetSysMenuRegion(Common::swap16(titlever));
|
country_code = GetSysMenuRegion(Common::swap16(titlever));
|
||||||
}
|
}
|
||||||
|
|
||||||
return CountrySwitch(CountryCode);
|
return CountrySwitch(country_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CVolumeWAD::GetUniqueID() const
|
std::string CVolumeWAD::GetUniqueID() const
|
||||||
|
|
|
@ -158,10 +158,10 @@ IVolume::ECountry CVolumeWiiCrypted::GetCountry() const
|
||||||
if (!m_pReader)
|
if (!m_pReader)
|
||||||
return COUNTRY_UNKNOWN;
|
return COUNTRY_UNKNOWN;
|
||||||
|
|
||||||
u8 CountryCode;
|
u8 country_code;
|
||||||
m_pReader->Read(3, 1, &CountryCode);
|
m_pReader->Read(3, 1, &country_code);
|
||||||
|
|
||||||
return CountrySwitch(CountryCode);
|
return CountrySwitch(country_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CVolumeWiiCrypted::GetMakerID() const
|
std::string CVolumeWiiCrypted::GetMakerID() const
|
||||||
|
|
|
@ -1333,37 +1333,37 @@ void CConfigMain::OnConfig(wxCommandEvent&)
|
||||||
inline u8 CConfigMain::GetSADRCountryCode(int language)
|
inline u8 CConfigMain::GetSADRCountryCode(int language)
|
||||||
{
|
{
|
||||||
//http://wiibrew.org/wiki/Country_Codes
|
//http://wiibrew.org/wiki/Country_Codes
|
||||||
u8 countrycode = language;
|
u8 country_code = language;
|
||||||
switch (countrycode)
|
switch (country_code)
|
||||||
{
|
{
|
||||||
case 0: //Japanese
|
case 0: //Japanese
|
||||||
countrycode = 1; //Japan
|
country_code = 1; //Japan
|
||||||
break;
|
break;
|
||||||
case 1: //English
|
case 1: //English
|
||||||
countrycode = 49; //USA
|
country_code = 49; //USA
|
||||||
break;
|
break;
|
||||||
case 2: //German
|
case 2: //German
|
||||||
countrycode = 78; //Germany
|
country_code = 78; //Germany
|
||||||
break;
|
break;
|
||||||
case 3: //French
|
case 3: //French
|
||||||
countrycode = 77; //France
|
country_code = 77; //France
|
||||||
break;
|
break;
|
||||||
case 4: //Spanish
|
case 4: //Spanish
|
||||||
countrycode = 105; //Spain
|
country_code = 105; //Spain
|
||||||
break;
|
break;
|
||||||
case 5: //Italian
|
case 5: //Italian
|
||||||
countrycode = 83; //Italy
|
country_code = 83; //Italy
|
||||||
break;
|
break;
|
||||||
case 6: //Dutch
|
case 6: //Dutch
|
||||||
countrycode = 94; //Netherlands
|
country_code = 94; //Netherlands
|
||||||
break;
|
break;
|
||||||
case 7: //Simplified Chinese
|
case 7: //Simplified Chinese
|
||||||
case 8: //Traditional Chinese
|
case 8: //Traditional Chinese
|
||||||
countrycode = 157; //China
|
country_code = 157; //China
|
||||||
break;
|
break;
|
||||||
case 9: //Korean
|
case 9: //Korean
|
||||||
countrycode = 136; //Korea
|
country_code = 136; //Korea
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return countrycode;
|
return country_code;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue