summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2019-04-10 20:04:17 +0200
committerZach Hilman <zachhilman@gmail.com>2019-07-08 03:38:33 +0200
commit5d6bf75296984eb2d4c7e1486daeb306a5fefa32 (patch)
tree57ac5a24e12212a09ef06ee367d380629b350e62
parentes: Implement ETicket CountPersonalizedTicket (10) (diff)
downloadyuzu-5d6bf75296984eb2d4c7e1486daeb306a5fefa32.tar
yuzu-5d6bf75296984eb2d4c7e1486daeb306a5fefa32.tar.gz
yuzu-5d6bf75296984eb2d4c7e1486daeb306a5fefa32.tar.bz2
yuzu-5d6bf75296984eb2d4c7e1486daeb306a5fefa32.tar.lz
yuzu-5d6bf75296984eb2d4c7e1486daeb306a5fefa32.tar.xz
yuzu-5d6bf75296984eb2d4c7e1486daeb306a5fefa32.tar.zst
yuzu-5d6bf75296984eb2d4c7e1486daeb306a5fefa32.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/es/es.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/core/hle/service/es/es.cpp b/src/core/hle/service/es/es.cpp
index 9adb39ac3..9a481f41f 100644
--- a/src/core/hle/service/es/es.cpp
+++ b/src/core/hle/service/es/es.cpp
@@ -26,7 +26,7 @@ public:
{8, &ETicket::GetTitleKey, "GetTitleKey"},
{9, &ETicket::CountCommonTicket, "CountCommonTicket"},
{10, &ETicket::CountPersonalizedTicket, "CountPersonalizedTicket"},
- {11, nullptr, "ListCommonTicket"},
+ {11, &ETicket::ListCommonTicket, "ListCommonTicket"},
{12, nullptr, "ListPersonalizedTicket"},
{13, nullptr, "ListMissingPersonalizedTicket"},
{14, nullptr, "GetCommonTicketSize"},
@@ -144,6 +144,29 @@ private:
rb.Push<u32>(count);
}
+ void ListCommonTicket(Kernel::HLERequestContext& ctx) {
+ u32 out_entries;
+ if (keys.GetCommonTickets().empty())
+ out_entries = 0;
+ else
+ out_entries = ctx.GetWriteBufferSize() / sizeof(u128);
+
+ LOG_DEBUG(Service_ETicket, "called, entries={:016X}", out_entries);
+
+ keys.PopulateTickets();
+ const auto tickets = keys.GetCommonTickets();
+ std::vector<u128> ids;
+ std::transform(tickets.begin(), tickets.end(), std::back_inserter(ids),
+ [](const auto& pair) { return pair.first; });
+
+ out_entries = std::min<u32>(ids.size(), out_entries);
+ ctx.WriteBuffer(ids.data(), out_entries * sizeof(u128));
+
+ IPC::ResponseBuilder rb{ctx, 3};
+ rb.Push(RESULT_SUCCESS);
+ rb.Push<u32>(out_entries);
+ }
+
};
void InstallInterfaces(SM::ServiceManager& service_manager) {