diff options
author | Zach Hilman <zachhilman@gmail.com> | 2019-04-10 20:05:12 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2019-07-08 03:38:33 +0200 |
commit | 669a21babb89c670746ed0a3ba89543a70f8e05e (patch) | |
tree | e5756017612c3ea21a62079b0a6d62799641dff0 /src/core/hle/service/es | |
parent | es: Implement ETicket ListCommonTicket (11) (diff) | |
download | yuzu-669a21babb89c670746ed0a3ba89543a70f8e05e.tar yuzu-669a21babb89c670746ed0a3ba89543a70f8e05e.tar.gz yuzu-669a21babb89c670746ed0a3ba89543a70f8e05e.tar.bz2 yuzu-669a21babb89c670746ed0a3ba89543a70f8e05e.tar.lz yuzu-669a21babb89c670746ed0a3ba89543a70f8e05e.tar.xz yuzu-669a21babb89c670746ed0a3ba89543a70f8e05e.tar.zst yuzu-669a21babb89c670746ed0a3ba89543a70f8e05e.zip |
Diffstat (limited to 'src/core/hle/service/es')
-rw-r--r-- | src/core/hle/service/es/es.cpp | 25 |
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 9a481f41f..d136566fc 100644 --- a/src/core/hle/service/es/es.cpp +++ b/src/core/hle/service/es/es.cpp @@ -27,7 +27,7 @@ public: {9, &ETicket::CountCommonTicket, "CountCommonTicket"}, {10, &ETicket::CountPersonalizedTicket, "CountPersonalizedTicket"}, {11, &ETicket::ListCommonTicket, "ListCommonTicket"}, - {12, nullptr, "ListPersonalizedTicket"}, + {12, &ETicket::ListPersonalizedTicket, "ListPersonalizedTicket"}, {13, nullptr, "ListMissingPersonalizedTicket"}, {14, nullptr, "GetCommonTicketSize"}, {15, nullptr, "GetPersonalizedTicketSize"}, @@ -167,6 +167,29 @@ private: rb.Push<u32>(out_entries); } + void ListPersonalizedTicket(Kernel::HLERequestContext& ctx) { + u32 out_entries; + if (keys.GetPersonalizedTickets().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.GetPersonalizedTickets(); + 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) { |