De-capitalized CountryCode

This commit is contained in:
Stevoisiak 2015-02-23 20:43:29 -05:00
parent df2f6d137e
commit 06cb85991e
10 changed files with 43 additions and 43 deletions

View File

@ -307,10 +307,10 @@ bool CBoot::EmulatedBS2_Wii()
INFO_LOG(BOOT, "Faking Wii BS2...");
// setup Wii memory
DiscIO::IVolume::ECountry CountryCode = DiscIO::IVolume::COUNTRY_UNKNOWN;
DiscIO::IVolume::ECountry country_code = DiscIO::IVolume::COUNTRY_UNKNOWN;
if (VolumeHandler::IsValid())
CountryCode = VolumeHandler::GetVolume()->GetCountry();
if (SetupWiiMemory(CountryCode) == false)
country_code = VolumeHandler::GetVolume()->GetCountry();
if (SetupWiiMemory(country_code) == false)
return false;
// This is some kind of consistency check that is compared to the 0x00

View File

@ -136,7 +136,7 @@ CEXIMemoryCard::CEXIMemoryCard(const int index, bool gciFolder)
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;
u32 CurrentGameId = 0;
@ -145,17 +145,17 @@ void CEXIMemoryCard::SetupGciFolder(u16 sizeMb)
const DiscIO::INANDContentLoader & SysMenu_Loader = DiscIO::CNANDContentManager::Access().GetNANDLoader(TITLEID_SYSMENU, false);
if (SysMenu_Loader.IsValid())
{
CountryCode = DiscIO::CountrySwitch(SysMenu_Loader.GetCountryChar());
country_code = DiscIO::CountrySwitch(SysMenu_Loader.GetCountryChar());
}
}
else if (strUniqueID.length() >= 4)
{
CountryCode = DiscIO::CountrySwitch(strUniqueID.at(3));
country_code = DiscIO::CountrySwitch(strUniqueID.at(3));
CurrentGameId = BE32((u8*)strUniqueID.c_str());
}
bool ascii = true;
std::string strDirectoryName = File::GetUserPath(D_GCUSER_IDX);
switch (CountryCode)
switch (country_code)
{
case DiscIO::IVolume::COUNTRY_JAPAN:
ascii = false;
@ -182,20 +182,20 @@ void CEXIMemoryCard::SetupGciFolder(u16 sizeMb)
std::string region = memcardFilename.substr(memcardFilename.size() - 7, 3);
if (region == JAP_DIR)
{
CountryCode = DiscIO::IVolume::COUNTRY_JAPAN;
country_code = DiscIO::IVolume::COUNTRY_JAPAN;
ascii = false;
strDirectoryName += JAP_DIR DIR_SEP;
break;
}
else if (region == USA_DIR)
{
CountryCode = DiscIO::IVolume::COUNTRY_USA;
country_code = DiscIO::IVolume::COUNTRY_USA;
strDirectoryName += USA_DIR DIR_SEP;
break;
}
}
default:
CountryCode = DiscIO::IVolume::COUNTRY_EUROPE;
country_code = DiscIO::IVolume::COUNTRY_EUROPE;
strDirectoryName += EUR_DIR DIR_SEP;
}
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,
CountryCode, CurrentGameId);
country_code, CurrentGameId);
}
void CEXIMemoryCard::SetupRawMemcard(u16 sizeMb)

View File

@ -71,7 +71,7 @@ public:
};
// Generic Switch function for all volumes
IVolume::ECountry CountrySwitch(u8 CountryCode);
IVolume::ECountry CountrySwitch(u8 country_code);
u8 GetSysMenuRegion(u16 _TitleVersion);
} // namespace

View File

@ -12,9 +12,9 @@
// Increment CACHE_REVISION if the code below is modified (ISOFile.cpp & GameFile.cpp)
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
case 'A':
@ -68,8 +68,8 @@ IVolume::ECountry CountrySwitch(u8 CountryCode)
return IVolume::COUNTRY_TAIWAN;
default:
if (CountryCode > 'A') // Silently ignore IOS wads
WARN_LOG(DISCIO, "Unknown Country Code! %c", CountryCode);
if (country_code > 'A') // Silently ignore IOS wads
WARN_LOG(DISCIO, "Unknown Country Code! %c", country_code);
return IVolume::COUNTRY_UNKNOWN;
}
}

View File

@ -174,9 +174,9 @@ void CVolumeDirectory::SetUniqueID(const std::string& id)
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

View File

@ -108,7 +108,7 @@ private:
u32 debug_flag;
u32 track_location;
u32 track_size;
u32 countrycode;
u32 country_code;
u32 unknown;
u32 unknown2;
@ -121,7 +121,7 @@ private:
debug_flag = 0;
track_location = 0;
track_size = 0;
countrycode = 0;
country_code = 0;
unknown = 0;
unknown2 = 0;
}

View File

@ -61,10 +61,10 @@ IVolume::ECountry CVolumeGC::GetCountry() const
if (!m_pReader)
return COUNTRY_UNKNOWN;
u8 CountryCode;
m_pReader->Read(3, 1, &CountryCode);
u8 country_code;
m_pReader->Read(3, 1, &country_code);
return CountrySwitch(CountryCode);
return CountrySwitch(country_code);
}
std::string CVolumeGC::GetMakerID() const

View File

@ -54,17 +54,17 @@ IVolume::ECountry CVolumeWAD::GetCountry() const
return COUNTRY_UNKNOWN;
// read the last digit of the titleID in the ticket
u8 CountryCode;
Read(m_tmd_offset + 0x0193, 1, &CountryCode);
u8 country_code;
Read(m_tmd_offset + 0x0193, 1, &country_code);
if (CountryCode == 2) // SYSMENU
if (country_code == 2) // SYSMENU
{
u16 titlever = 0;
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

View File

@ -158,10 +158,10 @@ IVolume::ECountry CVolumeWiiCrypted::GetCountry() const
if (!m_pReader)
return COUNTRY_UNKNOWN;
u8 CountryCode;
m_pReader->Read(3, 1, &CountryCode);
u8 country_code;
m_pReader->Read(3, 1, &country_code);
return CountrySwitch(CountryCode);
return CountrySwitch(country_code);
}
std::string CVolumeWiiCrypted::GetMakerID() const

View File

@ -1333,37 +1333,37 @@ void CConfigMain::OnConfig(wxCommandEvent&)
inline u8 CConfigMain::GetSADRCountryCode(int language)
{
//http://wiibrew.org/wiki/Country_Codes
u8 countrycode = language;
switch (countrycode)
u8 country_code = language;
switch (country_code)
{
case 0: //Japanese
countrycode = 1; //Japan
country_code = 1; //Japan
break;
case 1: //English
countrycode = 49; //USA
country_code = 49; //USA
break;
case 2: //German
countrycode = 78; //Germany
country_code = 78; //Germany
break;
case 3: //French
countrycode = 77; //France
country_code = 77; //France
break;
case 4: //Spanish
countrycode = 105; //Spain
country_code = 105; //Spain
break;
case 5: //Italian
countrycode = 83; //Italy
country_code = 83; //Italy
break;
case 6: //Dutch
countrycode = 94; //Netherlands
country_code = 94; //Netherlands
break;
case 7: //Simplified Chinese
case 8: //Traditional Chinese
countrycode = 157; //China
country_code = 157; //China
break;
case 9: //Korean
countrycode = 136; //Korea
country_code = 136; //Korea
break;
}
return countrycode;
return country_code;
}