Merge pull request #4869 from leoetlino/proper-uid-sys
Always use configured root when installing WAD
This commit is contained in:
commit
549ee8e79c
|
@ -52,7 +52,6 @@ void Init()
|
||||||
if (SConfig::GetInstance().bWii)
|
if (SConfig::GetInstance().bWii)
|
||||||
{
|
{
|
||||||
Core::InitializeWiiRoot(Core::g_want_determinism);
|
Core::InitializeWiiRoot(Core::g_want_determinism);
|
||||||
DiscIO::cUIDsys::AccessInstance().UpdateLocation();
|
|
||||||
DiscIO::CSharedContent::AccessInstance().UpdateLocation();
|
DiscIO::CSharedContent::AccessInstance().UpdateLocation();
|
||||||
IOS::Init();
|
IOS::Init();
|
||||||
IOS::HLE::Init(); // Depends on Memory
|
IOS::HLE::Init(); // Depends on Memory
|
||||||
|
|
|
@ -121,7 +121,8 @@ void ES::OpenInternal()
|
||||||
m_TitleID = contentLoader.GetTitleID();
|
m_TitleID = contentLoader.GetTitleID();
|
||||||
|
|
||||||
m_TitleIDs.clear();
|
m_TitleIDs.clear();
|
||||||
DiscIO::cUIDsys::AccessInstance().GetTitleIDs(m_TitleIDs);
|
DiscIO::cUIDsys uid_sys{Common::FromWhichRoot::FROM_SESSION_ROOT};
|
||||||
|
uid_sys.GetTitleIDs(m_TitleIDs);
|
||||||
// uncomment if ES_GetOwnedTitlesCount / ES_GetOwnedTitles is implemented
|
// uncomment if ES_GetOwnedTitlesCount / ES_GetOwnedTitles is implemented
|
||||||
// m_TitleIDsOwned.clear();
|
// m_TitleIDsOwned.clear();
|
||||||
// DiscIO::cUIDsys::AccessInstance().GetTitleIDs(m_TitleIDsOwned, true);
|
// DiscIO::cUIDsys::AccessInstance().GetTitleIDs(m_TitleIDsOwned, true);
|
||||||
|
@ -1324,7 +1325,8 @@ u32 ES::ES_DIVerify(const std::vector<u8>& tmd)
|
||||||
if (!tmd_file.WriteBytes(tmd.data(), tmd.size()))
|
if (!tmd_file.WriteBytes(tmd.data(), tmd.size()))
|
||||||
ERROR_LOG(IOS_ES, "DIVerify failed to write disc TMD to NAND.");
|
ERROR_LOG(IOS_ES, "DIVerify failed to write disc TMD to NAND.");
|
||||||
}
|
}
|
||||||
DiscIO::cUIDsys::AccessInstance().AddTitle(tmd_title_id);
|
DiscIO::cUIDsys uid_sys{Common::FromWhichRoot::FROM_SESSION_ROOT};
|
||||||
|
uid_sys.AddTitle(tmd_title_id);
|
||||||
// DI_VERIFY writes to title.tmd, which is read and cached inside the NAND Content Manager.
|
// DI_VERIFY writes to title.tmd, which is read and cached inside the NAND Content Manager.
|
||||||
// clear the cache to avoid content access mismatches.
|
// clear the cache to avoid content access mismatches.
|
||||||
DiscIO::CNANDContentManager::Access().ClearCache();
|
DiscIO::CNANDContentManager::Access().ClearCache();
|
||||||
|
|
|
@ -398,16 +398,11 @@ void CNANDContentLoader::RemoveTitle() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cUIDsys::cUIDsys()
|
cUIDsys::cUIDsys(Common::FromWhichRoot root)
|
||||||
{
|
|
||||||
UpdateLocation();
|
|
||||||
}
|
|
||||||
|
|
||||||
void cUIDsys::UpdateLocation()
|
|
||||||
{
|
{
|
||||||
m_Elements.clear();
|
m_Elements.clear();
|
||||||
m_LastUID = 0x00001000;
|
m_LastUID = 0x00001000;
|
||||||
m_UidSys = File::GetUserPath(D_SESSION_WIIROOT_IDX) + "/sys/uid.sys";
|
m_UidSys = Common::RootUserPath(root) + "/sys/uid.sys";
|
||||||
|
|
||||||
File::IOFile pFile(m_UidSys, "rb");
|
File::IOFile pFile(m_UidSys, "rb");
|
||||||
SElement Element;
|
SElement Element;
|
||||||
|
@ -430,10 +425,6 @@ void cUIDsys::UpdateLocation()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cUIDsys::~cUIDsys()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
u32 cUIDsys::GetUIDFromTitle(u64 title_id)
|
u32 cUIDsys::GetUIDFromTitle(u64 title_id)
|
||||||
{
|
{
|
||||||
for (auto& Element : m_Elements)
|
for (auto& Element : m_Elements)
|
||||||
|
@ -541,7 +532,8 @@ u64 CNANDContentManager::Install_WiiWAD(const std::string& filename)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
cUIDsys::AccessInstance().AddTitle(title_id);
|
cUIDsys uid_sys{Common::FromWhichRoot::FROM_CONFIGURED_ROOT};
|
||||||
|
uid_sys.AddTitle(title_id);
|
||||||
|
|
||||||
ClearCache();
|
ClearCache();
|
||||||
|
|
||||||
|
|
|
@ -188,27 +188,16 @@ private:
|
||||||
std::vector<SElement> m_Elements;
|
std::vector<SElement> m_Elements;
|
||||||
};
|
};
|
||||||
|
|
||||||
class cUIDsys
|
class cUIDsys final
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static cUIDsys& AccessInstance()
|
explicit cUIDsys(Common::FromWhichRoot root);
|
||||||
{
|
|
||||||
static cUIDsys instance;
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
u32 GetUIDFromTitle(u64 title_id);
|
u32 GetUIDFromTitle(u64 title_id);
|
||||||
void AddTitle(u64 title_id);
|
void AddTitle(u64 title_id);
|
||||||
void GetTitleIDs(std::vector<u64>& title_ids, bool owned = false);
|
void GetTitleIDs(std::vector<u64>& title_ids, bool owned = false);
|
||||||
void UpdateLocation();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
cUIDsys();
|
|
||||||
virtual ~cUIDsys();
|
|
||||||
|
|
||||||
cUIDsys(cUIDsys const&) = delete;
|
|
||||||
void operator=(cUIDsys const&) = delete;
|
|
||||||
|
|
||||||
#pragma pack(push, 1)
|
#pragma pack(push, 1)
|
||||||
struct SElement
|
struct SElement
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue