diff --git a/Source/Core/Core/BootManager.cpp b/Source/Core/Core/BootManager.cpp index 0a028e90f3..385491b981 100644 --- a/Source/Core/Core/BootManager.cpp +++ b/Source/Core/Core/BootManager.cpp @@ -405,6 +405,7 @@ void RestoreConfig() { SConfig::GetInstance().LoadSettingsFromSysconf(); SConfig::GetInstance().m_strGameID = "00000000"; + SConfig::GetInstance().m_title_id = 0; config_cache.RestoreConfig(&SConfig::GetInstance()); } diff --git a/Source/Core/Core/ConfigManager.cpp b/Source/Core/Core/ConfigManager.cpp index edb2386bd4..aa0820ad34 100644 --- a/Source/Core/Core/ConfigManager.cpp +++ b/Source/Core/Core/ConfigManager.cpp @@ -761,6 +761,7 @@ void SConfig::LoadDefaults() m_strName = "NONE"; m_strGameID = "00000000"; + m_title_id = 0; m_revision = 0; } @@ -843,6 +844,7 @@ bool SConfig::AutoSetup(EBootBS2 _BootBS2) } m_strName = pVolume->GetInternalName(); m_strGameID = pVolume->GetGameID(); + pVolume->GetTitleID(&m_title_id); m_revision = pVolume->GetRevision(); // Check if we have a Wii disc @@ -909,6 +911,7 @@ bool SConfig::AutoSetup(EBootBS2 _BootBS2) { m_strName = pVolume->GetInternalName(); m_strGameID = pVolume->GetGameID(); + pVolume->GetTitleID(&m_title_id); } else { @@ -916,12 +919,13 @@ bool SConfig::AutoSetup(EBootBS2 _BootBS2) // if this is the second boot we would be using the Name and id of the last title m_strName.clear(); m_strGameID.clear(); + m_title_id = 0; } // 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()); + std::string titleidstr = StringFromFormat("%016" PRIx64, m_title_id); if (m_strName.empty()) { diff --git a/Source/Core/Core/ConfigManager.h b/Source/Core/Core/ConfigManager.h index e91bb9b1ff..8aeb3ed5da 100644 --- a/Source/Core/Core/ConfigManager.h +++ b/Source/Core/Core/ConfigManager.h @@ -202,6 +202,7 @@ struct SConfig : NonCopyable std::string m_strDVDRoot; std::string m_strApploader; std::string m_strGameID; + u64 m_title_id; std::string m_strName; std::string m_strWiiSDCardPath; u16 m_revision; diff --git a/Source/Core/Core/IOS/ES/ES.cpp b/Source/Core/Core/IOS/ES/ES.cpp index de7d6aadc9..6602649441 100644 --- a/Source/Core/Core/IOS/ES/ES.cpp +++ b/Source/Core/Core/IOS/ES/ES.cpp @@ -1316,7 +1316,6 @@ u32 ES::ES_DIVerify(const std::vector& tmd) File::CreateFullPath(tmd_path); File::CreateFullPath(Common::GetTitleDataPath(tmd_title_id, Common::FROM_SESSION_ROOT)); - Movie::SetTitleId(tmd_title_id); std::string save_path = Common::GetTitleDataPath(tmd_title_id, Common::FROM_SESSION_ROOT); if (Movie::IsRecordingInput()) { diff --git a/Source/Core/Core/Movie.cpp b/Source/Core/Core/Movie.cpp index d8851c44c9..c1f45302b1 100644 --- a/Source/Core/Core/Movie.cpp +++ b/Source/Core/Core/Movie.cpp @@ -77,7 +77,6 @@ static bool s_bDiscChange = false; static bool s_bReset = false; static std::string s_author = ""; static std::string s_discChange = ""; -static u64 s_titleID = 0; static u8 s_MD5[16]; static u8 s_bongos, s_memcards; static u8 s_revision[20]; @@ -403,11 +402,6 @@ void SetReset(bool reset) s_bReset = reset; } -void SetTitleId(u64 title_id) -{ - s_titleID = title_id; -} - bool IsUsingPad(int controller) { return ((s_controllers & (1 << controller)) != 0); @@ -582,9 +576,11 @@ bool BeginRecordingInput(int controllers) // This is only done here if starting from save state because otherwise we won't have the // titleid. Otherwise it's set in IOS::HLE::Device::ES. // TODO: find a way to GetTitleDataPath() from Movie::Init() + // TODO: This comment is out of date. The title ID is no longer set in IOS::HLE::Device::ES if (SConfig::GetInstance().bWii) { - if (File::Exists(Common::GetTitleDataPath(s_titleID, Common::FROM_SESSION_ROOT) + + if (File::Exists(Common::GetTitleDataPath(SConfig::GetInstance().m_title_id, + Common::FROM_SESSION_ROOT) + "banner.bin")) Movie::s_bClearSave = false; else diff --git a/Source/Core/Core/Movie.h b/Source/Core/Core/Movie.h index a9254baa08..e7da22d12e 100644 --- a/Source/Core/Core/Movie.h +++ b/Source/Core/Core/Movie.h @@ -132,7 +132,6 @@ u64 GetTotalLagCount(); void SetClearSave(bool enabled); void SignalDiscChange(const std::string& new_path); void SetReset(bool reset); -void SetTitleId(u64 title_id); bool IsConfigSaved(); bool IsDualCore();