From 4d776ffa8ff1dcefb3618297e8971eb59122c869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sun, 26 Feb 2017 17:26:08 +0100 Subject: IOS/ES: Keep track of the active title properly This changes ES to keep track of the active title properly, just like IOS: * It is NOT changed on resource manager open/close. * It is reset on IOS reload. * It is changed by ES_DIVerify and ES_Launch. IOS stores the active title in a structure like this: struct ESTitleContext { Ticket* ticket; TMD* tmd; u32 active; }; With this commit, we also do keep the Ticket and TMD around. This makes some of the DI ioctlvs (which return data about the current active title) trivial to implement in the future. This fixes the System Menu not being able to see update partitions and also allows us to change Dolphin's active game info in the future. --- Source/Core/DiscIO/VolumeWiiCrypted.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Source/Core/DiscIO/VolumeWiiCrypted.cpp') diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.cpp b/Source/Core/DiscIO/VolumeWiiCrypted.cpp index ef291fa237..71e50252db 100644 --- a/Source/Core/DiscIO/VolumeWiiCrypted.cpp +++ b/Source/Core/DiscIO/VolumeWiiCrypted.cpp @@ -114,6 +114,13 @@ bool CVolumeWiiCrypted::GetTitleID(u64* buffer) const return true; } +IOS::ES::TicketReader CVolumeWiiCrypted::GetTicket() const +{ + std::vector buffer(0x2a4); + Read(m_VolumeOffset, buffer.size(), buffer.data(), false); + return IOS::ES::TicketReader{std::move(buffer)}; +} + IOS::ES::TMDReader CVolumeWiiCrypted::GetTMD() const { u32 tmd_size; -- cgit v1.2.3