diff options
| author | 2020-12-14 16:08:38 -0800 | |
|---|---|---|
| committer | 2020-12-14 16:08:38 -0800 | |
| commit | df6427d30b952e2364ee3912980990199e326105 (patch) | |
| tree | 468b51b5ff8cf3d940061633cc4d0852d8e752ec | |
| parent | Merge pull request #5193 from lat9nq/fix-conan-boost (diff) | |
| parent | IPurchaseEventManager: Implement GetPurchasedEventReadableHandle (diff) | |
| download | yuzu-df6427d30b952e2364ee3912980990199e326105.tar.gz yuzu-df6427d30b952e2364ee3912980990199e326105.tar.xz yuzu-df6427d30b952e2364ee3912980990199e326105.zip | |
Merge pull request #5168 from Morph1984/aoc-PurchaseEventManager
aoc_u: Stub IPurchaseEventManager and its service commands
| -rw-r--r-- | src/core/hle/service/aoc/aoc_u.cpp | 76 | ||||
| -rw-r--r-- | src/core/hle/service/aoc/aoc_u.h | 2 |
2 files changed, 76 insertions, 2 deletions
diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/aoc_u.cpp index 6abac3f78..9c404db96 100644 --- a/src/core/hle/service/aoc/aoc_u.cpp +++ b/src/core/hle/service/aoc/aoc_u.cpp | |||
| @@ -48,6 +48,62 @@ static std::vector<u64> AccumulateAOCTitleIDs(Core::System& system) { | |||
| 48 | return add_on_content; | 48 | return add_on_content; |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | class IPurchaseEventManager final : public ServiceFramework<IPurchaseEventManager> { | ||
| 52 | public: | ||
| 53 | explicit IPurchaseEventManager(Core::System& system_) | ||
| 54 | : ServiceFramework{system_, "IPurchaseEventManager"} { | ||
| 55 | // clang-format off | ||
| 56 | static const FunctionInfo functions[] = { | ||
| 57 | {0, &IPurchaseEventManager::SetDefaultDeliveryTarget, "SetDefaultDeliveryTarget"}, | ||
| 58 | {1, &IPurchaseEventManager::SetDeliveryTarget, "SetDeliveryTarget"}, | ||
| 59 | {2, &IPurchaseEventManager::GetPurchasedEventReadableHandle, "GetPurchasedEventReadableHandle"}, | ||
| 60 | {3, nullptr, "PopPurchasedProductInfo"}, | ||
| 61 | {4, nullptr, "PopPurchasedProductInfoWithUid"}, | ||
| 62 | }; | ||
| 63 | // clang-format on | ||
| 64 | |||
| 65 | RegisterHandlers(functions); | ||
| 66 | |||
| 67 | purchased_event = Kernel::WritableEvent::CreateEventPair( | ||
| 68 | system.Kernel(), "IPurchaseEventManager:PurchasedEvent"); | ||
| 69 | } | ||
| 70 | |||
| 71 | private: | ||
| 72 | void SetDefaultDeliveryTarget(Kernel::HLERequestContext& ctx) { | ||
| 73 | IPC::RequestParser rp{ctx}; | ||
| 74 | |||
| 75 | const auto unknown_1 = rp.Pop<u64>(); | ||
| 76 | [[maybe_unused]] const auto unknown_2 = ctx.ReadBuffer(); | ||
| 77 | |||
| 78 | LOG_WARNING(Service_AOC, "(STUBBED) called, unknown_1={}", unknown_1); | ||
| 79 | |||
| 80 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 81 | rb.Push(RESULT_SUCCESS); | ||
| 82 | } | ||
| 83 | |||
| 84 | void SetDeliveryTarget(Kernel::HLERequestContext& ctx) { | ||
| 85 | IPC::RequestParser rp{ctx}; | ||
| 86 | |||
| 87 | const auto unknown_1 = rp.Pop<u64>(); | ||
| 88 | [[maybe_unused]] const auto unknown_2 = ctx.ReadBuffer(); | ||
| 89 | |||
| 90 | LOG_WARNING(Service_AOC, "(STUBBED) called, unknown_1={}", unknown_1); | ||
| 91 | |||
| 92 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 93 | rb.Push(RESULT_SUCCESS); | ||
| 94 | } | ||
| 95 | |||
| 96 | void GetPurchasedEventReadableHandle(Kernel::HLERequestContext& ctx) { | ||
| 97 | LOG_WARNING(Service_AOC, "called"); | ||
| 98 | |||
| 99 | IPC::ResponseBuilder rb{ctx, 2, 1}; | ||
| 100 | rb.Push(RESULT_SUCCESS); | ||
| 101 | rb.PushCopyObjects(purchased_event.readable); | ||
| 102 | } | ||
| 103 | |||
| 104 | Kernel::EventPair purchased_event; | ||
| 105 | }; | ||
| 106 | |||
| 51 | AOC_U::AOC_U(Core::System& system_) | 107 | AOC_U::AOC_U(Core::System& system_) |
| 52 | : ServiceFramework{system_, "aoc:u"}, add_on_content{AccumulateAOCTitleIDs(system)} { | 108 | : ServiceFramework{system_, "aoc:u"}, add_on_content{AccumulateAOCTitleIDs(system)} { |
| 53 | // clang-format off | 109 | // clang-format off |
| @@ -62,8 +118,8 @@ AOC_U::AOC_U(Core::System& system_) | |||
| 62 | {7, &AOC_U::PrepareAddOnContent, "PrepareAddOnContent"}, | 118 | {7, &AOC_U::PrepareAddOnContent, "PrepareAddOnContent"}, |
| 63 | {8, &AOC_U::GetAddOnContentListChangedEvent, "GetAddOnContentListChangedEvent"}, | 119 | {8, &AOC_U::GetAddOnContentListChangedEvent, "GetAddOnContentListChangedEvent"}, |
| 64 | {9, nullptr, "GetAddOnContentLostErrorCode"}, | 120 | {9, nullptr, "GetAddOnContentLostErrorCode"}, |
| 65 | {100, nullptr, "CreateEcPurchasedEventManager"}, | 121 | {100, &AOC_U::CreateEcPurchasedEventManager, "CreateEcPurchasedEventManager"}, |
| 66 | {101, nullptr, "CreatePermanentEcPurchasedEventManager"}, | 122 | {101, &AOC_U::CreatePermanentEcPurchasedEventManager, "CreatePermanentEcPurchasedEventManager"}, |
| 67 | }; | 123 | }; |
| 68 | // clang-format on | 124 | // clang-format on |
| 69 | 125 | ||
| @@ -201,6 +257,22 @@ void AOC_U::GetAddOnContentListChangedEvent(Kernel::HLERequestContext& ctx) { | |||
| 201 | rb.PushCopyObjects(aoc_change_event.readable); | 257 | rb.PushCopyObjects(aoc_change_event.readable); |
| 202 | } | 258 | } |
| 203 | 259 | ||
| 260 | void AOC_U::CreateEcPurchasedEventManager(Kernel::HLERequestContext& ctx) { | ||
| 261 | LOG_WARNING(Service_AOC, "(STUBBED) called"); | ||
| 262 | |||
| 263 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 264 | rb.Push(RESULT_SUCCESS); | ||
| 265 | rb.PushIpcInterface<IPurchaseEventManager>(system); | ||
| 266 | } | ||
| 267 | |||
| 268 | void AOC_U::CreatePermanentEcPurchasedEventManager(Kernel::HLERequestContext& ctx) { | ||
| 269 | LOG_WARNING(Service_AOC, "(STUBBED) called"); | ||
| 270 | |||
| 271 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 272 | rb.Push(RESULT_SUCCESS); | ||
| 273 | rb.PushIpcInterface<IPurchaseEventManager>(system); | ||
| 274 | } | ||
| 275 | |||
| 204 | void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) { | 276 | void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) { |
| 205 | std::make_shared<AOC_U>(system)->InstallAsService(service_manager); | 277 | std::make_shared<AOC_U>(system)->InstallAsService(service_manager); |
| 206 | } | 278 | } |
diff --git a/src/core/hle/service/aoc/aoc_u.h b/src/core/hle/service/aoc/aoc_u.h index 7628f4568..26ee51be0 100644 --- a/src/core/hle/service/aoc/aoc_u.h +++ b/src/core/hle/service/aoc/aoc_u.h | |||
| @@ -27,6 +27,8 @@ private: | |||
| 27 | void GetAddOnContentBaseId(Kernel::HLERequestContext& ctx); | 27 | void GetAddOnContentBaseId(Kernel::HLERequestContext& ctx); |
| 28 | void PrepareAddOnContent(Kernel::HLERequestContext& ctx); | 28 | void PrepareAddOnContent(Kernel::HLERequestContext& ctx); |
| 29 | void GetAddOnContentListChangedEvent(Kernel::HLERequestContext& ctx); | 29 | void GetAddOnContentListChangedEvent(Kernel::HLERequestContext& ctx); |
| 30 | void CreateEcPurchasedEventManager(Kernel::HLERequestContext& ctx); | ||
| 31 | void CreatePermanentEcPurchasedEventManager(Kernel::HLERequestContext& ctx); | ||
| 30 | 32 | ||
| 31 | std::vector<u64> add_on_content; | 33 | std::vector<u64> add_on_content; |
| 32 | Kernel::EventPair aoc_change_event; | 34 | Kernel::EventPair aoc_change_event; |