mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
Merge pull request #4401 from JosJuice/rename-getuniqueid
DiscIO/SConfig: Rename GetUniqueID to GetGameID
This commit is contained in:
@@ -347,7 +347,7 @@ static std::string GetGameId(std::string filename)
|
||||
if (volume == nullptr)
|
||||
return std::string();
|
||||
|
||||
std::string id = volume->GetUniqueID();
|
||||
std::string id = volume->GetGameID();
|
||||
__android_log_print(ANDROID_LOG_INFO, DOLPHIN_TAG, "Game ID: %s", id.c_str());
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -183,10 +183,10 @@ void DolphinAnalytics::MakePerGameBuilder()
|
||||
Common::AnalyticsReportBuilder builder(m_base_builder);
|
||||
|
||||
// Gameid.
|
||||
builder.AddData("gameid", SConfig::GetInstance().GetUniqueID());
|
||||
builder.AddData("gameid", SConfig::GetInstance().GetGameID());
|
||||
|
||||
// Unique id bound to the gameid.
|
||||
builder.AddData("id", MakeUniqueId(SConfig::GetInstance().GetUniqueID()));
|
||||
builder.AddData("id", MakeUniqueId(SConfig::GetInstance().GetGameID()));
|
||||
|
||||
// Configuration.
|
||||
builder.AddData("cfg-dsp-hle", SConfig::GetInstance().bDSPHLE);
|
||||
|
||||
@@ -121,7 +121,7 @@ bool CBoot::FindMapFile(std::string* existing_map_file, std::string* writable_ma
|
||||
break;
|
||||
|
||||
default:
|
||||
title_id_str = _StartupPara.GetUniqueID();
|
||||
title_id_str = _StartupPara.GetGameID();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -274,9 +274,9 @@ bool CBoot::BootUp()
|
||||
PanicAlertT("Warning - starting ISO in wrong console mode!");
|
||||
}
|
||||
|
||||
std::string unique_id = DVDInterface::GetVolume().GetUniqueID();
|
||||
if (unique_id.size() >= 4)
|
||||
VideoInterface::SetRegionReg(unique_id.at(3));
|
||||
std::string game_id = DVDInterface::GetVolume().GetGameID();
|
||||
if (game_id.size() >= 4)
|
||||
VideoInterface::SetRegionReg(game_id.at(3));
|
||||
|
||||
std::vector<u8> tmd_buffer = pVolume.GetTMD();
|
||||
if (!tmd_buffer.empty())
|
||||
|
||||
@@ -387,7 +387,7 @@ void Stop()
|
||||
void RestoreConfig()
|
||||
{
|
||||
SConfig::GetInstance().LoadSettingsFromSysconf();
|
||||
SConfig::GetInstance().m_strUniqueID = "00000000";
|
||||
SConfig::GetInstance().m_strGameID = "00000000";
|
||||
config_cache.RestoreConfig(&SConfig::GetInstance());
|
||||
}
|
||||
|
||||
|
||||
@@ -788,7 +788,7 @@ void SConfig::LoadDefaults()
|
||||
bJITBranchOff = false;
|
||||
|
||||
m_strName = "NONE";
|
||||
m_strUniqueID = "00000000";
|
||||
m_strGameID = "00000000";
|
||||
m_revision = 0;
|
||||
}
|
||||
|
||||
@@ -861,7 +861,7 @@ bool SConfig::AutoSetup(EBootBS2 _BootBS2)
|
||||
return false;
|
||||
}
|
||||
m_strName = pVolume->GetInternalName();
|
||||
m_strUniqueID = pVolume->GetUniqueID();
|
||||
m_strGameID = pVolume->GetGameID();
|
||||
m_revision = pVolume->GetRevision();
|
||||
|
||||
// Check if we have a Wii disc
|
||||
@@ -939,28 +939,28 @@ bool SConfig::AutoSetup(EBootBS2 _BootBS2)
|
||||
if (pVolume)
|
||||
{
|
||||
m_strName = pVolume->GetInternalName();
|
||||
m_strUniqueID = pVolume->GetUniqueID();
|
||||
m_strGameID = pVolume->GetGameID();
|
||||
}
|
||||
else
|
||||
{
|
||||
// null pVolume means that we are loading from nand folder (Most Likely Wii Menu)
|
||||
// if this is the second boot we would be using the Name and id of the last title
|
||||
m_strName.clear();
|
||||
m_strUniqueID.clear();
|
||||
m_strGameID.clear();
|
||||
}
|
||||
|
||||
// Use the TitleIDhex for name and/or unique ID if launching from nand folder
|
||||
// or if it is not ascii characters (specifically sysmenu could potentially apply to other
|
||||
// things)
|
||||
// Use the TitleIDhex for name and/or game ID if launching
|
||||
// from nand folder or if it is not ascii characters
|
||||
// (specifically sysmenu could potentially apply to other things)
|
||||
std::string titleidstr = StringFromFormat("%016" PRIx64, ContentLoader.GetTitleID());
|
||||
|
||||
if (m_strName.empty())
|
||||
{
|
||||
m_strName = titleidstr;
|
||||
}
|
||||
if (m_strUniqueID.empty())
|
||||
if (m_strGameID.empty())
|
||||
{
|
||||
m_strUniqueID = titleidstr;
|
||||
m_strGameID = titleidstr;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1085,17 +1085,17 @@ DiscIO::Language SConfig::GetCurrentLanguage(bool wii) const
|
||||
|
||||
IniFile SConfig::LoadDefaultGameIni() const
|
||||
{
|
||||
return LoadDefaultGameIni(GetUniqueID(), m_revision);
|
||||
return LoadDefaultGameIni(GetGameID(), m_revision);
|
||||
}
|
||||
|
||||
IniFile SConfig::LoadLocalGameIni() const
|
||||
{
|
||||
return LoadLocalGameIni(GetUniqueID(), m_revision);
|
||||
return LoadLocalGameIni(GetGameID(), m_revision);
|
||||
}
|
||||
|
||||
IniFile SConfig::LoadGameIni() const
|
||||
{
|
||||
return LoadGameIni(GetUniqueID(), m_revision);
|
||||
return LoadGameIni(GetGameID(), m_revision);
|
||||
}
|
||||
|
||||
IniFile SConfig::LoadDefaultGameIni(const std::string& id, u16 revision)
|
||||
|
||||
@@ -198,7 +198,7 @@ struct SConfig : NonCopyable
|
||||
std::string m_strDefaultISO;
|
||||
std::string m_strDVDRoot;
|
||||
std::string m_strApploader;
|
||||
std::string m_strUniqueID;
|
||||
std::string m_strGameID;
|
||||
std::string m_strName;
|
||||
std::string m_strWiiSDCardPath;
|
||||
u16 m_revision;
|
||||
@@ -207,7 +207,7 @@ struct SConfig : NonCopyable
|
||||
|
||||
void LoadDefaults();
|
||||
bool AutoSetup(EBootBS2 _BootBS2);
|
||||
const std::string& GetUniqueID() const { return m_strUniqueID; }
|
||||
const std::string& GetGameID() const { return m_strGameID; }
|
||||
void CheckMemcardPath(std::string& memcardPath, const std::string& gameRegion, bool isSlotA);
|
||||
DiscIO::Language GetCurrentLanguage(bool wii) const;
|
||||
|
||||
|
||||
@@ -731,7 +731,7 @@ EState GetState()
|
||||
|
||||
static std::string GenerateScreenshotFolderPath()
|
||||
{
|
||||
const std::string& gameId = SConfig::GetInstance().GetUniqueID();
|
||||
const std::string& gameId = SConfig::GetInstance().GetGameID();
|
||||
std::string path = File::GetUserPath(D_SCREENSHOTS_IDX) + gameId + DIR_SEP_CHR;
|
||||
|
||||
if (!File::CreateFullPath(path))
|
||||
@@ -748,7 +748,7 @@ static std::string GenerateScreenshotName()
|
||||
std::string path = GenerateScreenshotFolderPath();
|
||||
|
||||
// append gameId, path only contains the folder here.
|
||||
path += SConfig::GetInstance().GetUniqueID();
|
||||
path += SConfig::GetInstance().GetGameID();
|
||||
|
||||
std::string name;
|
||||
for (int i = 1; File::Exists(name = StringFromFormat("%s-%d.png", path.c_str(), i)); ++i)
|
||||
|
||||
@@ -153,10 +153,10 @@ CEXIMemoryCard::CEXIMemoryCard(const int index, bool gciFolder) : card_index(ind
|
||||
void CEXIMemoryCard::SetupGciFolder(u16 sizeMb)
|
||||
{
|
||||
DiscIO::Country country_code = DiscIO::Country::COUNTRY_UNKNOWN;
|
||||
auto strUniqueID = SConfig::GetInstance().m_strUniqueID;
|
||||
std::string game_id = SConfig::GetInstance().m_strGameID;
|
||||
|
||||
u32 CurrentGameId = 0;
|
||||
if (strUniqueID == TITLEID_SYSMENU_STRING)
|
||||
if (game_id == TITLEID_SYSMENU_STRING)
|
||||
{
|
||||
const DiscIO::CNANDContentLoader& SysMenu_Loader =
|
||||
DiscIO::CNANDContentManager::Access().GetNANDLoader(TITLEID_SYSMENU,
|
||||
@@ -166,10 +166,10 @@ void CEXIMemoryCard::SetupGciFolder(u16 sizeMb)
|
||||
country_code = DiscIO::CountrySwitch(SysMenu_Loader.GetCountryChar());
|
||||
}
|
||||
}
|
||||
else if (strUniqueID.length() >= 4)
|
||||
else if (game_id.length() >= 4)
|
||||
{
|
||||
country_code = DiscIO::CountrySwitch(strUniqueID.at(3));
|
||||
CurrentGameId = BE32((u8*)strUniqueID.c_str());
|
||||
country_code = DiscIO::CountrySwitch(game_id.at(3));
|
||||
CurrentGameId = BE32((u8*)game_id.c_str());
|
||||
}
|
||||
bool ascii = true;
|
||||
std::string strDirectoryName = File::GetUserPath(D_GCUSER_IDX);
|
||||
|
||||
@@ -395,7 +395,7 @@ void WiiSocket::Update(bool read, bool write, bool except)
|
||||
if (SConfig::GetInstance().m_SSLDumpWrite && ret > 0)
|
||||
{
|
||||
std::string filename = File::GetUserPath(D_DUMPSSL_IDX) +
|
||||
SConfig::GetInstance().GetUniqueID() + "_write.bin";
|
||||
SConfig::GetInstance().GetGameID() + "_write.bin";
|
||||
File::IOFile(filename, "ab").WriteBytes(Memory::GetPointer(BufferOut2), ret);
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ void WiiSocket::Update(bool read, bool write, bool except)
|
||||
if (SConfig::GetInstance().m_SSLDumpRead && ret > 0)
|
||||
{
|
||||
std::string filename = File::GetUserPath(D_DUMPSSL_IDX) +
|
||||
SConfig::GetInstance().GetUniqueID() + "_read.bin";
|
||||
SConfig::GetInstance().GetGameID() + "_read.bin";
|
||||
File::IOFile(filename, "ab").WriteBytes(Memory::GetPointer(BufferIn2), ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -226,10 +226,10 @@ void Init()
|
||||
ReadHeader();
|
||||
std::thread md5thread(CheckMD5);
|
||||
md5thread.detach();
|
||||
if (strncmp(tmpHeader.gameID, SConfig::GetInstance().GetUniqueID().c_str(), 6))
|
||||
if (strncmp(tmpHeader.gameID, SConfig::GetInstance().GetGameID().c_str(), 6))
|
||||
{
|
||||
PanicAlertT("The recorded game (%s) is not the same as the selected game (%s)",
|
||||
tmpHeader.gameID, SConfig::GetInstance().GetUniqueID().c_str());
|
||||
tmpHeader.gameID, SConfig::GetInstance().GetGameID().c_str());
|
||||
EndPlayInput(false);
|
||||
}
|
||||
}
|
||||
@@ -1375,7 +1375,7 @@ void SaveRecording(const std::string& filename)
|
||||
header.filetype[1] = 'T';
|
||||
header.filetype[2] = 'M';
|
||||
header.filetype[3] = 0x1A;
|
||||
strncpy(header.gameID, SConfig::GetInstance().GetUniqueID().c_str(), 6);
|
||||
strncpy(header.gameID, SConfig::GetInstance().GetGameID().c_str(), 6);
|
||||
header.bWii = SConfig::GetInstance().bWii;
|
||||
header.numControllers = s_numPads & (SConfig::GetInstance().bWii ? 0xFF : 0x0F);
|
||||
|
||||
|
||||
@@ -338,7 +338,7 @@ static void CompressAndDumpState(CompressAndDumpState_args save_args)
|
||||
|
||||
// Setting up the header
|
||||
StateHeader header;
|
||||
strncpy(header.gameID, SConfig::GetInstance().GetUniqueID().c_str(), 6);
|
||||
strncpy(header.gameID, SConfig::GetInstance().GetGameID().c_str(), 6);
|
||||
header.size = g_use_compression ? (u32)buffer_size : 0;
|
||||
header.time = Common::Timer::GetDoubleTime();
|
||||
|
||||
@@ -469,7 +469,7 @@ static void LoadFileStateData(const std::string& filename, std::vector<u8>& ret_
|
||||
StateHeader header;
|
||||
f.ReadArray(&header, 1);
|
||||
|
||||
if (strncmp(SConfig::GetInstance().GetUniqueID().c_str(), header.gameID, 6))
|
||||
if (strncmp(SConfig::GetInstance().GetGameID().c_str(), header.gameID, 6))
|
||||
{
|
||||
Core::DisplayMessage(
|
||||
StringFromFormat("State belongs to a different game (ID %.*s)", 6, header.gameID), 2000);
|
||||
@@ -657,7 +657,7 @@ void Shutdown()
|
||||
static std::string MakeStateFilename(int number)
|
||||
{
|
||||
return StringFromFormat("%s%s.s%02i", File::GetUserPath(D_STATESAVES_IDX).c_str(),
|
||||
SConfig::GetInstance().GetUniqueID().c_str(), number);
|
||||
SConfig::GetInstance().GetGameID().c_str(), number);
|
||||
}
|
||||
|
||||
void Save(int slot, bool wait)
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
|
||||
virtual bool GetTitleID(u64*) const { return false; }
|
||||
virtual std::vector<u8> GetTMD() const { return {}; }
|
||||
virtual std::string GetUniqueID() const = 0;
|
||||
virtual std::string GetGameID() const = 0;
|
||||
virtual std::string GetMakerID() const = 0;
|
||||
virtual u16 GetRevision() const = 0;
|
||||
virtual std::string GetInternalName() const = 0;
|
||||
|
||||
@@ -35,7 +35,7 @@ CVolumeDirectory::CVolumeDirectory(const std::string& _rDirectory, bool _bIsWii,
|
||||
m_rootDirectory = ExtractDirectoryName(_rDirectory);
|
||||
|
||||
// create the default disk header
|
||||
SetUniqueID("AGBJ01");
|
||||
SetGameID("AGBJ01");
|
||||
SetName("Default name");
|
||||
|
||||
if (_bIsWii)
|
||||
@@ -154,12 +154,12 @@ bool CVolumeDirectory::Read(u64 _Offset, u64 _Length, u8* _pBuffer, bool decrypt
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string CVolumeDirectory::GetUniqueID() const
|
||||
std::string CVolumeDirectory::GetGameID() const
|
||||
{
|
||||
return std::string(m_diskHeader.begin(), m_diskHeader.begin() + MAX_ID_LENGTH);
|
||||
}
|
||||
|
||||
void CVolumeDirectory::SetUniqueID(const std::string& id)
|
||||
void CVolumeDirectory::SetGameID(const std::string& id)
|
||||
{
|
||||
memcpy(m_diskHeader.data(), id.c_str(), std::min(id.length(), MAX_ID_LENGTH));
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@ public:
|
||||
|
||||
bool Read(u64 _Offset, u64 _Length, u8* _pBuffer, bool decrypt) const override;
|
||||
|
||||
std::string GetUniqueID() const override;
|
||||
void SetUniqueID(const std::string& _ID);
|
||||
std::string GetGameID() const override;
|
||||
void SetGameID(const std::string& _ID);
|
||||
|
||||
std::string GetMakerID() const override;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ bool CVolumeGC::Read(u64 _Offset, u64 _Length, u8* _pBuffer, bool decrypt) const
|
||||
return m_pReader->Read(_Offset, _Length, _pBuffer);
|
||||
}
|
||||
|
||||
std::string CVolumeGC::GetUniqueID() const
|
||||
std::string CVolumeGC::GetGameID() const
|
||||
{
|
||||
static const std::string NO_UID("NO_UID");
|
||||
if (m_pReader == nullptr)
|
||||
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
CVolumeGC(std::unique_ptr<IBlobReader> reader);
|
||||
~CVolumeGC();
|
||||
bool Read(u64 _Offset, u64 _Length, u8* _pBuffer, bool decrypt = false) const override;
|
||||
std::string GetUniqueID() const override;
|
||||
std::string GetGameID() const override;
|
||||
std::string GetMakerID() const override;
|
||||
u16 GetRevision() const override;
|
||||
std::string GetInternalName() const override;
|
||||
|
||||
@@ -74,7 +74,7 @@ Country CVolumeWAD::GetCountry() const
|
||||
return CountrySwitch(country_code);
|
||||
}
|
||||
|
||||
std::string CVolumeWAD::GetUniqueID() const
|
||||
std::string CVolumeWAD::GetGameID() const
|
||||
{
|
||||
char GameCode[6];
|
||||
if (!Read(m_offset + 0x01E0, 4, (u8*)GameCode))
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
~CVolumeWAD();
|
||||
bool Read(u64 _Offset, u64 _Length, u8* _pBuffer, bool decrypt = false) const override;
|
||||
bool GetTitleID(u64* buffer) const override;
|
||||
std::string GetUniqueID() const override;
|
||||
std::string GetGameID() const override;
|
||||
std::string GetMakerID() const override;
|
||||
u16 GetRevision() const override;
|
||||
std::string GetInternalName() const override { return ""; }
|
||||
|
||||
@@ -140,7 +140,7 @@ std::vector<u8> CVolumeWiiCrypted::GetTMD() const
|
||||
return buffer;
|
||||
}
|
||||
|
||||
std::string CVolumeWiiCrypted::GetUniqueID() const
|
||||
std::string CVolumeWiiCrypted::GetGameID() const
|
||||
{
|
||||
if (m_pReader == nullptr)
|
||||
return std::string();
|
||||
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
bool Read(u64 _Offset, u64 _Length, u8* _pBuffer, bool decrypt) const override;
|
||||
bool GetTitleID(u64* buffer) const override;
|
||||
std::vector<u8> GetTMD() const override;
|
||||
std::string GetUniqueID() const override;
|
||||
std::string GetGameID() const override;
|
||||
std::string GetMakerID() const override;
|
||||
u16 GetRevision() const override;
|
||||
std::string GetInternalName() const override;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user