mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
DiscIO: Move the Korean GC mess out of VolumeGC
This commit is contained in:
@ -97,12 +97,14 @@ static bool IsWiiTitle(const std::string& game_id)
|
|||||||
|
|
||||||
static bool IsJapaneseGCTitle(const std::string& game_id)
|
static bool IsJapaneseGCTitle(const std::string& game_id)
|
||||||
{
|
{
|
||||||
return IsGCTitle(game_id) && DiscIO::CountrySwitch(game_id[3]) == DiscIO::Country::Japan;
|
return IsGCTitle(game_id) && DiscIO::CountrySwitch(game_id[3], DiscIO::Platform::GameCubeDisc) ==
|
||||||
|
DiscIO::Country::Japan;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool IsNonJapaneseGCTitle(const std::string& game_id)
|
static bool IsNonJapaneseGCTitle(const std::string& game_id)
|
||||||
{
|
{
|
||||||
return IsGCTitle(game_id) && DiscIO::CountrySwitch(game_id[3]) != DiscIO::Country::Japan;
|
return IsGCTitle(game_id) && DiscIO::CountrySwitch(game_id[3], DiscIO::Platform::GameCubeDisc) !=
|
||||||
|
DiscIO::Country::Japan;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note that this function will not overwrite entries that already are in the maps
|
// Note that this function will not overwrite entries that already are in the maps
|
||||||
|
@ -145,7 +145,7 @@ Country TypicalCountryForRegion(Region region)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Region RegionSwitch(u8 country_code, Platform platform)
|
Region RegionSwitch(u8 country_code, Platform platform, Region expected_region)
|
||||||
{
|
{
|
||||||
switch (country_code)
|
switch (country_code)
|
||||||
{
|
{
|
||||||
@ -153,8 +153,10 @@ Region RegionSwitch(u8 country_code, Platform platform)
|
|||||||
case 'W':
|
case 'W':
|
||||||
return Region::NTSC_J;
|
return Region::NTSC_J;
|
||||||
|
|
||||||
case 'B':
|
|
||||||
case 'E':
|
case 'E':
|
||||||
|
return expected_region == Region::NTSC_J ? Region::NTSC_J : Region::NTSC_U;
|
||||||
|
|
||||||
|
case 'B':
|
||||||
case 'N':
|
case 'N':
|
||||||
case 'Z':
|
case 'Z':
|
||||||
return Region::NTSC_U;
|
return Region::NTSC_U;
|
||||||
@ -183,7 +185,7 @@ Region RegionSwitch(u8 country_code, Platform platform)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Country CountrySwitch(u8 country_code)
|
Country CountrySwitch(u8 country_code, Platform platform, Region region)
|
||||||
{
|
{
|
||||||
switch (country_code)
|
switch (country_code)
|
||||||
{
|
{
|
||||||
@ -222,6 +224,8 @@ Country CountrySwitch(u8 country_code)
|
|||||||
|
|
||||||
// NTSC
|
// NTSC
|
||||||
case 'E':
|
case 'E':
|
||||||
|
return region == Region::NTSC_J ? Country::Korea : Country::USA;
|
||||||
|
|
||||||
case 'N': // Japanese import to USA and other NTSC regions
|
case 'N': // Japanese import to USA and other NTSC regions
|
||||||
case 'Z': // Prince of Persia - The Forgotten Sands (Wii)
|
case 'Z': // Prince of Persia - The Forgotten Sands (Wii)
|
||||||
case 'B': // Ufouria: The Saga (Virtual Console)
|
case 'B': // Ufouria: The Saga (Virtual Console)
|
||||||
@ -236,7 +240,7 @@ Country CountrySwitch(u8 country_code)
|
|||||||
return Country::Korea;
|
return Country::Korea;
|
||||||
|
|
||||||
case 'W':
|
case 'W':
|
||||||
return Country::Taiwan;
|
return platform == Platform::GameCubeDisc ? Country::Korea : Country::Taiwan;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (country_code > 'A') // Silently ignore IOS wads
|
if (country_code > 'A') // Silently ignore IOS wads
|
||||||
|
@ -77,8 +77,8 @@ bool IsNTSC(Region region);
|
|||||||
|
|
||||||
Country TypicalCountryForRegion(Region region);
|
Country TypicalCountryForRegion(Region region);
|
||||||
// Avoid using this function if you can. Country codes aren't always reliable region indicators.
|
// Avoid using this function if you can. Country codes aren't always reliable region indicators.
|
||||||
Region RegionSwitch(u8 country_code, Platform platform);
|
Region RegionSwitch(u8 country_code, Platform platform, Region expected_region = Region::Unknown);
|
||||||
Country CountrySwitch(u8 country_code);
|
Country CountrySwitch(u8 country_code, Platform platform, Region region = Region::Unknown);
|
||||||
|
|
||||||
Region GetSysMenuRegion(u16 title_version);
|
Region GetSysMenuRegion(u16 title_version);
|
||||||
std::string GetSysMenuVersionString(u16 title_version);
|
std::string GetSysMenuVersionString(u16 title_version);
|
||||||
|
@ -87,18 +87,10 @@ Country VolumeGC::GetCountry(const Partition& partition) const
|
|||||||
const u8 country = ReadSwapped<u8>(3, partition).value_or(0);
|
const u8 country = ReadSwapped<u8>(3, partition).value_or(0);
|
||||||
const Region region = GetRegion();
|
const Region region = GetRegion();
|
||||||
|
|
||||||
// Korean GC releases use NTSC-J.
|
if (RegionSwitch(country, Platform::GameCubeDisc, region) != region)
|
||||||
// E is normally used for America, but it's also used for English-language Korean GC releases.
|
|
||||||
// K is used by games that are in the Korean language.
|
|
||||||
// W means Taiwan for Wii games, but on the GC, it's used for English-language Korean releases.
|
|
||||||
// (There doesn't seem to be any pattern to which of E and W is used for Korean GC releases.)
|
|
||||||
if (region == Region::NTSC_J && (country == 'E' || country == 'K' || country == 'W'))
|
|
||||||
return Country::Korea;
|
|
||||||
|
|
||||||
if (RegionSwitch(country, Platform::GameCubeDisc) != region)
|
|
||||||
return TypicalCountryForRegion(region);
|
return TypicalCountryForRegion(region);
|
||||||
|
|
||||||
return CountrySwitch(country);
|
return CountrySwitch(country, Platform::GameCubeDisc, region);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string VolumeGC::GetMakerID(const Partition& partition) const
|
std::string VolumeGC::GetMakerID(const Partition& partition) const
|
||||||
|
@ -88,7 +88,7 @@ Country VolumeWAD::GetCountry(const Partition& partition) const
|
|||||||
if (country_code == 2) // SYSMENU
|
if (country_code == 2) // SYSMENU
|
||||||
return TypicalCountryForRegion(GetSysMenuRegion(m_tmd.GetTitleVersion()));
|
return TypicalCountryForRegion(GetSysMenuRegion(m_tmd.GetTitleVersion()));
|
||||||
|
|
||||||
return CountrySwitch(country_code);
|
return CountrySwitch(country_code, Platform::WiiWAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
const IOS::ES::TMDReader& VolumeWAD::GetTMD(const Partition& partition) const
|
const IOS::ES::TMDReader& VolumeWAD::GetTMD(const Partition& partition) const
|
||||||
|
@ -293,10 +293,10 @@ Country VolumeWii::GetCountry(const Partition& partition) const
|
|||||||
const u8 country_byte = ReadSwapped<u8>(3, partition).value_or(0);
|
const u8 country_byte = ReadSwapped<u8>(3, partition).value_or(0);
|
||||||
const Region region = GetRegion();
|
const Region region = GetRegion();
|
||||||
|
|
||||||
if (RegionSwitch(country_byte, Platform::WiiDisc) != region)
|
if (RegionSwitch(country_byte, Platform::WiiDisc, region) != region)
|
||||||
return TypicalCountryForRegion(region);
|
return TypicalCountryForRegion(region);
|
||||||
|
|
||||||
return CountrySwitch(country_byte);
|
return CountrySwitch(country_byte, Platform::WiiDisc, region);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string VolumeWii::GetMakerID(const Partition& partition) const
|
std::string VolumeWii::GetMakerID(const Partition& partition) const
|
||||||
|
Reference in New Issue
Block a user