Don't call Movie::SetTitleId from ES

Movie basically just wants to get the title ID of
the initally booted game, so let's set the title ID in
ConfigManager at boot like we do with the regular game ID.

Aside from being cleaner, this should make the approach to
title IDs compatible with booting non-disc software (WADs).
This commit is contained in:
JosJuice 2017-01-08 16:15:12 +01:00
parent 2e2eabdfcb
commit 88e0a5e418
6 changed files with 10 additions and 10 deletions

View File

@ -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());
}

View File

@ -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())
{

View File

@ -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;

View File

@ -1316,7 +1316,6 @@ u32 ES::ES_DIVerify(const std::vector<u8>& 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())
{

View File

@ -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

View File

@ -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();