2013-04-17 21:09:55 -06:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2009-07-03 16:51:21 -06:00
|
|
|
|
2014-02-20 17:47:53 -07:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2014-09-07 19:06:58 -06:00
|
|
|
#include "Common/CommonTypes.h"
|
2014-09-18 22:17:41 -06:00
|
|
|
#include "Common/Logging/Log.h"
|
2014-02-17 03:18:15 -07:00
|
|
|
#include "DiscIO/Volume.h"
|
2009-07-03 16:51:21 -06:00
|
|
|
|
2014-12-30 18:05:33 -07:00
|
|
|
// Increment CACHE_REVISION if the code below is modified (ISOFile.cpp & GameFile.cpp)
|
2009-07-03 16:51:21 -06:00
|
|
|
namespace DiscIO
|
|
|
|
{
|
2015-02-23 18:43:29 -07:00
|
|
|
IVolume::ECountry CountrySwitch(u8 country_code)
|
2009-07-03 16:51:21 -06:00
|
|
|
{
|
2015-02-23 18:43:29 -07:00
|
|
|
switch (country_code)
|
2009-07-03 16:51:21 -06:00
|
|
|
{
|
2014-10-30 08:35:46 -06:00
|
|
|
// Region free - Uses European flag as placeholder
|
2010-05-30 10:33:01 -06:00
|
|
|
case 'A':
|
2015-02-17 17:17:34 -07:00
|
|
|
return IVolume::COUNTRY_WORLD;
|
2013-10-28 23:23:17 -06:00
|
|
|
|
2010-05-30 11:16:06 -06:00
|
|
|
// PAL
|
2014-10-30 08:35:46 -06:00
|
|
|
case 'D':
|
2013-01-09 21:53:04 -07:00
|
|
|
return IVolume::COUNTRY_GERMANY;
|
|
|
|
|
2010-12-21 17:48:59 -07:00
|
|
|
case 'X': // Used by a couple PAL games
|
2014-10-30 08:35:46 -06:00
|
|
|
case 'Y': // German, French
|
2010-05-30 11:16:06 -06:00
|
|
|
case 'L': // Japanese import to PAL regions
|
|
|
|
case 'M': // Japanese import to PAL regions
|
2009-07-03 16:51:21 -06:00
|
|
|
case 'P':
|
|
|
|
return IVolume::COUNTRY_EUROPE;
|
2013-10-28 23:23:17 -06:00
|
|
|
|
2014-10-30 08:35:46 -06:00
|
|
|
case 'U':
|
2014-10-26 15:47:07 -06:00
|
|
|
return IVolume::COUNTRY_AUSTRALIA;
|
|
|
|
|
2009-07-03 16:51:21 -06:00
|
|
|
case 'F':
|
|
|
|
return IVolume::COUNTRY_FRANCE;
|
2013-10-28 23:23:17 -06:00
|
|
|
|
2009-07-03 16:51:21 -06:00
|
|
|
case 'I':
|
|
|
|
return IVolume::COUNTRY_ITALY;
|
2013-10-28 23:23:17 -06:00
|
|
|
|
2014-10-30 08:35:46 -06:00
|
|
|
case 'H':
|
|
|
|
return IVolume::COUNTRY_NETHERLANDS;
|
|
|
|
|
2010-10-03 00:10:14 -06:00
|
|
|
case 'R':
|
|
|
|
return IVolume::COUNTRY_RUSSIA;
|
2009-07-03 16:51:21 -06:00
|
|
|
|
2014-10-30 08:35:46 -06:00
|
|
|
case 'S':
|
|
|
|
return IVolume::COUNTRY_SPAIN;
|
|
|
|
|
2009-07-03 16:51:21 -06:00
|
|
|
// NTSC
|
|
|
|
case 'E':
|
2010-05-30 11:31:52 -06:00
|
|
|
case 'N': // Japanese import to USA and other NTSC regions
|
2015-01-12 20:28:12 -07:00
|
|
|
case 'Z': // Prince of Persia - The Forgotten Sands (Wii)
|
2014-12-30 17:57:14 -07:00
|
|
|
case 'B': // Ufouria: The Saga (Virtual Console)
|
2009-07-03 16:51:21 -06:00
|
|
|
return IVolume::COUNTRY_USA;
|
|
|
|
|
|
|
|
case 'J':
|
|
|
|
return IVolume::COUNTRY_JAPAN;
|
|
|
|
|
|
|
|
case 'K':
|
2010-05-30 11:16:06 -06:00
|
|
|
case 'Q': // Korea with Japanese language
|
2014-10-30 08:35:46 -06:00
|
|
|
case 'T': // Korea with English language
|
2009-07-03 16:51:21 -06:00
|
|
|
return IVolume::COUNTRY_KOREA;
|
|
|
|
|
|
|
|
case 'W':
|
|
|
|
return IVolume::COUNTRY_TAIWAN;
|
|
|
|
|
|
|
|
default:
|
2015-02-23 18:43:29 -07:00
|
|
|
if (country_code > 'A') // Silently ignore IOS wads
|
|
|
|
WARN_LOG(DISCIO, "Unknown Country Code! %c", country_code);
|
2009-07-03 16:51:21 -06:00
|
|
|
return IVolume::COUNTRY_UNKNOWN;
|
|
|
|
}
|
|
|
|
}
|
2010-12-16 00:36:26 -07:00
|
|
|
|
|
|
|
u8 GetSysMenuRegion(u16 _TitleVersion)
|
|
|
|
{
|
2014-03-10 05:30:55 -06:00
|
|
|
switch (_TitleVersion)
|
2010-12-16 00:36:26 -07:00
|
|
|
{
|
2014-02-16 13:30:18 -07:00
|
|
|
case 128: case 192: case 224: case 256:
|
|
|
|
case 288: case 352: case 384: case 416:
|
|
|
|
case 448: case 480: case 512:
|
2010-12-16 00:36:26 -07:00
|
|
|
return 'J';
|
2014-02-16 13:30:18 -07:00
|
|
|
case 97: case 193: case 225: case 257:
|
|
|
|
case 289: case 353: case 385: case 417:
|
|
|
|
case 449: case 481: case 513:
|
2010-12-16 00:36:26 -07:00
|
|
|
return 'E';
|
2014-02-16 13:30:18 -07:00
|
|
|
case 130: case 162: case 194: case 226:
|
|
|
|
case 258: case 290: case 354: case 386:
|
|
|
|
case 418: case 450: case 482: case 514:
|
2010-12-16 00:36:26 -07:00
|
|
|
return 'P';
|
2014-02-16 13:30:18 -07:00
|
|
|
case 326: case 390: case 454: case 486:
|
2010-12-16 00:36:26 -07:00
|
|
|
case 518:
|
|
|
|
return 'K';
|
|
|
|
default:
|
|
|
|
return 'A';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-02 18:46:55 -07:00
|
|
|
std::string IVolume::GetName() const
|
|
|
|
{
|
|
|
|
auto names = GetNames();
|
|
|
|
if (names.empty())
|
|
|
|
return "";
|
|
|
|
else
|
|
|
|
return names[0];
|
|
|
|
}
|
2009-07-03 16:51:21 -06:00
|
|
|
|
2013-03-02 18:46:55 -07:00
|
|
|
}
|