summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2017-02-26 17:26:08 +0100
committerLéo Lam <leo@innovatetechnologi.es>2017-03-02 20:28:01 +0100
commit4d776ffa8ff1dcefb3618297e8971eb59122c869 (patch)
tree0358fc4ea7e96bbdcf4406b0c29df9cf16bbb88c /Source/Core/DiscIO
parent78e7f4aae3364d3299763395deee1103b5819dc6 (diff)
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.
Diffstat (limited to 'Source/Core/DiscIO')
-rw-r--r--Source/Core/DiscIO/Volume.h1
-rw-r--r--Source/Core/DiscIO/VolumeWiiCrypted.cpp7
-rw-r--r--Source/Core/DiscIO/VolumeWiiCrypted.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/Source/Core/DiscIO/Volume.h b/Source/Core/DiscIO/Volume.h
index 1190565004..f3f530e5e4 100644
--- a/Source/Core/DiscIO/Volume.h
+++ b/Source/Core/DiscIO/Volume.h
@@ -37,6 +37,7 @@ public:
}
virtual bool GetTitleID(u64*) const { return false; }
+ virtual IOS::ES::TicketReader GetTicket() const { return {}; }
virtual IOS::ES::TMDReader GetTMD() const { return {}; }
virtual u64 PartitionOffsetToRawOffset(u64 offset) const { return offset; }
virtual std::string GetGameID() const = 0;
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<u8> 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;
diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.h b/Source/Core/DiscIO/VolumeWiiCrypted.h
index dfeb74ad66..d7e7c4bddb 100644
--- a/Source/Core/DiscIO/VolumeWiiCrypted.h
+++ b/Source/Core/DiscIO/VolumeWiiCrypted.h
@@ -33,6 +33,7 @@ public:
~CVolumeWiiCrypted();
bool Read(u64 _Offset, u64 _Length, u8* _pBuffer, bool decrypt) const override;
bool GetTitleID(u64* buffer) const override;
+ IOS::ES::TicketReader GetTicket() const override;
IOS::ES::TMDReader GetTMD() const override;
u64 PartitionOffsetToRawOffset(u64 offset) const override;
std::string GetGameID() const override;