diff options
| author | 2024-02-19 18:58:57 +0100 | |
|---|---|---|
| committer | 2024-02-23 01:19:18 +0100 | |
| commit | 2786d34dd7c03f493b0cdc220189446f63646dfe (patch) | |
| tree | c00f057e3de999be51cc9d9e781dcb4b49cbb381 /src/core/hle/service/aoc | |
| parent | aoc: Migrate to use cmif serialization (diff) | |
| download | yuzu-2786d34dd7c03f493b0cdc220189446f63646dfe.tar.gz yuzu-2786d34dd7c03f493b0cdc220189446f63646dfe.tar.xz yuzu-2786d34dd7c03f493b0cdc220189446f63646dfe.zip | |
aoc: Rename AOC_U to IAddOnContentManager
Diffstat (limited to 'src/core/hle/service/aoc')
| -rw-r--r-- | src/core/hle/service/aoc/addon_content_manager.cpp (renamed from src/core/hle/service/aoc/aoc_u.cpp) | 60 | ||||
| -rw-r--r-- | src/core/hle/service/aoc/addon_content_manager.h (renamed from src/core/hle/service/aoc/aoc_u.h) | 6 | ||||
| -rw-r--r-- | src/core/hle/service/aoc/purchase_event_manager.cpp | 4 |
3 files changed, 37 insertions, 33 deletions
diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/addon_content_manager.cpp index 82b95b704..d47f57d64 100644 --- a/src/core/hle/service/aoc/aoc_u.cpp +++ b/src/core/hle/service/aoc/addon_content_manager.cpp | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | #include "core/file_sys/patch_manager.h" | 15 | #include "core/file_sys/patch_manager.h" |
| 16 | #include "core/file_sys/registered_cache.h" | 16 | #include "core/file_sys/registered_cache.h" |
| 17 | #include "core/hle/kernel/k_event.h" | 17 | #include "core/hle/kernel/k_event.h" |
| 18 | #include "core/hle/service/aoc/aoc_u.h" | 18 | #include "core/hle/service/aoc/addon_content_manager.h" |
| 19 | #include "core/hle/service/aoc/purchase_event_manager.h" | 19 | #include "core/hle/service/aoc/purchase_event_manager.h" |
| 20 | #include "core/hle/service/cmif_serialization.h" | 20 | #include "core/hle/service/cmif_serialization.h" |
| 21 | #include "core/hle/service/ipc_helpers.h" | 21 | #include "core/hle/service/ipc_helpers.h" |
| @@ -46,28 +46,28 @@ static std::vector<u64> AccumulateAOCTitleIDs(Core::System& system) { | |||
| 46 | return add_on_content; | 46 | return add_on_content; |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | AOC_U::AOC_U(Core::System& system_) | 49 | IAddOnContentManager::IAddOnContentManager(Core::System& system_) |
| 50 | : ServiceFramework{system_, "aoc:u"}, add_on_content{AccumulateAOCTitleIDs(system)}, | 50 | : ServiceFramework{system_, "aoc:u"}, add_on_content{AccumulateAOCTitleIDs(system)}, |
| 51 | service_context{system_, "aoc:u"} { | 51 | service_context{system_, "aoc:u"} { |
| 52 | // clang-format off | 52 | // clang-format off |
| 53 | static const FunctionInfo functions[] = { | 53 | static const FunctionInfo functions[] = { |
| 54 | {0, nullptr, "CountAddOnContentByApplicationId"}, | 54 | {0, nullptr, "CountAddOnContentByApplicationId"}, |
| 55 | {1, nullptr, "ListAddOnContentByApplicationId"}, | 55 | {1, nullptr, "ListAddOnContentByApplicationId"}, |
| 56 | {2, D<&AOC_U::CountAddOnContent>, "CountAddOnContent"}, | 56 | {2, D<&IAddOnContentManager::CountAddOnContent>, "CountAddOnContent"}, |
| 57 | {3, D<&AOC_U::ListAddOnContent>, "ListAddOnContent"}, | 57 | {3, D<&IAddOnContentManager::ListAddOnContent>, "ListAddOnContent"}, |
| 58 | {4, nullptr, "GetAddOnContentBaseIdByApplicationId"}, | 58 | {4, nullptr, "GetAddOnContentBaseIdByApplicationId"}, |
| 59 | {5, D<&AOC_U::GetAddOnContentBaseId>, "GetAddOnContentBaseId"}, | 59 | {5, D<&IAddOnContentManager::GetAddOnContentBaseId>, "GetAddOnContentBaseId"}, |
| 60 | {6, nullptr, "PrepareAddOnContentByApplicationId"}, | 60 | {6, nullptr, "PrepareAddOnContentByApplicationId"}, |
| 61 | {7, D<&AOC_U::PrepareAddOnContent>, "PrepareAddOnContent"}, | 61 | {7, D<&IAddOnContentManager::PrepareAddOnContent>, "PrepareAddOnContent"}, |
| 62 | {8, D<&AOC_U::GetAddOnContentListChangedEvent>, "GetAddOnContentListChangedEvent"}, | 62 | {8, D<&IAddOnContentManager::GetAddOnContentListChangedEvent>, "GetAddOnContentListChangedEvent"}, |
| 63 | {9, nullptr, "GetAddOnContentLostErrorCode"}, | 63 | {9, nullptr, "GetAddOnContentLostErrorCode"}, |
| 64 | {10, D<&AOC_U::GetAddOnContentListChangedEventWithProcessId>, "GetAddOnContentListChangedEventWithProcessId"}, | 64 | {10, D<&IAddOnContentManager::GetAddOnContentListChangedEventWithProcessId>, "GetAddOnContentListChangedEventWithProcessId"}, |
| 65 | {11, D<&AOC_U::NotifyMountAddOnContent>, "NotifyMountAddOnContent"}, | 65 | {11, D<&IAddOnContentManager::NotifyMountAddOnContent>, "NotifyMountAddOnContent"}, |
| 66 | {12, D<&AOC_U::NotifyUnmountAddOnContent>, "NotifyUnmountAddOnContent"}, | 66 | {12, D<&IAddOnContentManager::NotifyUnmountAddOnContent>, "NotifyUnmountAddOnContent"}, |
| 67 | {13, nullptr, "IsAddOnContentMountedForDebug"}, | 67 | {13, nullptr, "IsAddOnContentMountedForDebug"}, |
| 68 | {50, D<&AOC_U::CheckAddOnContentMountStatus>, "CheckAddOnContentMountStatus"}, | 68 | {50, D<&IAddOnContentManager::CheckAddOnContentMountStatus>, "CheckAddOnContentMountStatus"}, |
| 69 | {100, D<&AOC_U::CreateEcPurchasedEventManager>, "CreateEcPurchasedEventManager"}, | 69 | {100, D<&IAddOnContentManager::CreateEcPurchasedEventManager>, "CreateEcPurchasedEventManager"}, |
| 70 | {101, D<&AOC_U::CreatePermanentEcPurchasedEventManager>, "CreatePermanentEcPurchasedEventManager"}, | 70 | {101, D<&IAddOnContentManager::CreatePermanentEcPurchasedEventManager>, "CreatePermanentEcPurchasedEventManager"}, |
| 71 | {110, nullptr, "CreateContentsServiceManager"}, | 71 | {110, nullptr, "CreateContentsServiceManager"}, |
| 72 | {200, nullptr, "SetRequiredAddOnContentsOnContentsAvailabilityTransition"}, | 72 | {200, nullptr, "SetRequiredAddOnContentsOnContentsAvailabilityTransition"}, |
| 73 | {300, nullptr, "SetupHostAddOnContent"}, | 73 | {300, nullptr, "SetupHostAddOnContent"}, |
| @@ -81,11 +81,11 @@ AOC_U::AOC_U(Core::System& system_) | |||
| 81 | aoc_change_event = service_context.CreateEvent("GetAddOnContentListChanged:Event"); | 81 | aoc_change_event = service_context.CreateEvent("GetAddOnContentListChanged:Event"); |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | AOC_U::~AOC_U() { | 84 | IAddOnContentManager::~IAddOnContentManager() { |
| 85 | service_context.CloseEvent(aoc_change_event); | 85 | service_context.CloseEvent(aoc_change_event); |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | Result AOC_U::CountAddOnContent(Out<u32> out_count, ClientProcessId process_id) { | 88 | Result IAddOnContentManager::CountAddOnContent(Out<u32> out_count, ClientProcessId process_id) { |
| 89 | LOG_DEBUG(Service_AOC, "called. process_id={}", process_id.pid); | 89 | LOG_DEBUG(Service_AOC, "called. process_id={}", process_id.pid); |
| 90 | 90 | ||
| 91 | const auto current = system.GetApplicationProcessProgramID(); | 91 | const auto current = system.GetApplicationProcessProgramID(); |
| @@ -103,8 +103,9 @@ Result AOC_U::CountAddOnContent(Out<u32> out_count, ClientProcessId process_id) | |||
| 103 | R_SUCCEED(); | 103 | R_SUCCEED(); |
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | Result AOC_U::ListAddOnContent(Out<u32> out_count, OutBuffer<BufferAttr_HipcMapAlias> out_addons, | 106 | Result IAddOnContentManager::ListAddOnContent(Out<u32> out_count, |
| 107 | u32 offset, u32 count, ClientProcessId process_id) { | 107 | OutBuffer<BufferAttr_HipcMapAlias> out_addons, |
| 108 | u32 offset, u32 count, ClientProcessId process_id) { | ||
| 108 | LOG_DEBUG(Service_AOC, "called with offset={}, count={}, process_id={}", offset, count, | 109 | LOG_DEBUG(Service_AOC, "called with offset={}, count={}, process_id={}", offset, count, |
| 109 | process_id.pid); | 110 | process_id.pid); |
| 110 | 111 | ||
| @@ -128,12 +129,13 @@ Result AOC_U::ListAddOnContent(Out<u32> out_count, OutBuffer<BufferAttr_HipcMapA | |||
| 128 | *out_count = static_cast<u32>(std::min<size_t>(out.size() - offset, count)); | 129 | *out_count = static_cast<u32>(std::min<size_t>(out.size() - offset, count)); |
| 129 | std::rotate(out.begin(), out.begin() + offset, out.end()); | 130 | std::rotate(out.begin(), out.begin() + offset, out.end()); |
| 130 | 131 | ||
| 131 | std::memcpy(out_addons.data(), out.data(), *out_count); | 132 | std::memcpy(out_addons.data(), out.data(), *out_count * sizeof(u32)); |
| 132 | 133 | ||
| 133 | R_SUCCEED(); | 134 | R_SUCCEED(); |
| 134 | } | 135 | } |
| 135 | 136 | ||
| 136 | Result AOC_U::GetAddOnContentBaseId(Out<u64> out_title_id, ClientProcessId process_id) { | 137 | Result IAddOnContentManager::GetAddOnContentBaseId(Out<u64> out_title_id, |
| 138 | ClientProcessId process_id) { | ||
| 137 | LOG_DEBUG(Service_AOC, "called. process_id={}", process_id.pid); | 139 | LOG_DEBUG(Service_AOC, "called. process_id={}", process_id.pid); |
| 138 | 140 | ||
| 139 | const auto title_id = system.GetApplicationProcessProgramID(); | 141 | const auto title_id = system.GetApplicationProcessProgramID(); |
| @@ -151,14 +153,15 @@ Result AOC_U::GetAddOnContentBaseId(Out<u64> out_title_id, ClientProcessId proce | |||
| 151 | R_SUCCEED(); | 153 | R_SUCCEED(); |
| 152 | } | 154 | } |
| 153 | 155 | ||
| 154 | Result AOC_U::PrepareAddOnContent(s32 addon_index, ClientProcessId process_id) { | 156 | Result IAddOnContentManager::PrepareAddOnContent(s32 addon_index, ClientProcessId process_id) { |
| 155 | LOG_WARNING(Service_AOC, "(STUBBED) called with addon_index={}, process_id={}", addon_index, | 157 | LOG_WARNING(Service_AOC, "(STUBBED) called with addon_index={}, process_id={}", addon_index, |
| 156 | process_id.pid); | 158 | process_id.pid); |
| 157 | 159 | ||
| 158 | R_SUCCEED(); | 160 | R_SUCCEED(); |
| 159 | } | 161 | } |
| 160 | 162 | ||
| 161 | Result AOC_U::GetAddOnContentListChangedEvent(OutCopyHandle<Kernel::KReadableEvent> out_event) { | 163 | Result IAddOnContentManager::GetAddOnContentListChangedEvent( |
| 164 | OutCopyHandle<Kernel::KReadableEvent> out_event) { | ||
| 162 | LOG_WARNING(Service_AOC, "(STUBBED) called"); | 165 | LOG_WARNING(Service_AOC, "(STUBBED) called"); |
| 163 | 166 | ||
| 164 | *out_event = &aoc_change_event->GetReadableEvent(); | 167 | *out_event = &aoc_change_event->GetReadableEvent(); |
| @@ -166,7 +169,7 @@ Result AOC_U::GetAddOnContentListChangedEvent(OutCopyHandle<Kernel::KReadableEve | |||
| 166 | R_SUCCEED(); | 169 | R_SUCCEED(); |
| 167 | } | 170 | } |
| 168 | 171 | ||
| 169 | Result AOC_U::GetAddOnContentListChangedEventWithProcessId( | 172 | Result IAddOnContentManager::GetAddOnContentListChangedEventWithProcessId( |
| 170 | OutCopyHandle<Kernel::KReadableEvent> out_event, ClientProcessId process_id) { | 173 | OutCopyHandle<Kernel::KReadableEvent> out_event, ClientProcessId process_id) { |
| 171 | LOG_WARNING(Service_AOC, "(STUBBED) called"); | 174 | LOG_WARNING(Service_AOC, "(STUBBED) called"); |
| 172 | 175 | ||
| @@ -175,25 +178,26 @@ Result AOC_U::GetAddOnContentListChangedEventWithProcessId( | |||
| 175 | R_SUCCEED(); | 178 | R_SUCCEED(); |
| 176 | } | 179 | } |
| 177 | 180 | ||
| 178 | Result AOC_U::NotifyMountAddOnContent() { | 181 | Result IAddOnContentManager::NotifyMountAddOnContent() { |
| 179 | LOG_WARNING(Service_AOC, "(STUBBED) called"); | 182 | LOG_WARNING(Service_AOC, "(STUBBED) called"); |
| 180 | 183 | ||
| 181 | R_SUCCEED(); | 184 | R_SUCCEED(); |
| 182 | } | 185 | } |
| 183 | 186 | ||
| 184 | Result AOC_U::NotifyUnmountAddOnContent() { | 187 | Result IAddOnContentManager::NotifyUnmountAddOnContent() { |
| 185 | LOG_WARNING(Service_AOC, "(STUBBED) called"); | 188 | LOG_WARNING(Service_AOC, "(STUBBED) called"); |
| 186 | 189 | ||
| 187 | R_SUCCEED(); | 190 | R_SUCCEED(); |
| 188 | } | 191 | } |
| 189 | 192 | ||
| 190 | Result AOC_U::CheckAddOnContentMountStatus() { | 193 | Result IAddOnContentManager::CheckAddOnContentMountStatus() { |
| 191 | LOG_WARNING(Service_AOC, "(STUBBED) called"); | 194 | LOG_WARNING(Service_AOC, "(STUBBED) called"); |
| 192 | 195 | ||
| 193 | R_SUCCEED(); | 196 | R_SUCCEED(); |
| 194 | } | 197 | } |
| 195 | 198 | ||
| 196 | Result AOC_U::CreateEcPurchasedEventManager(OutInterface<IPurchaseEventManager> out_interface) { | 199 | Result IAddOnContentManager::CreateEcPurchasedEventManager( |
| 200 | OutInterface<IPurchaseEventManager> out_interface) { | ||
| 197 | LOG_WARNING(Service_AOC, "(STUBBED) called"); | 201 | LOG_WARNING(Service_AOC, "(STUBBED) called"); |
| 198 | 202 | ||
| 199 | *out_interface = std::make_shared<IPurchaseEventManager>(system); | 203 | *out_interface = std::make_shared<IPurchaseEventManager>(system); |
| @@ -201,7 +205,7 @@ Result AOC_U::CreateEcPurchasedEventManager(OutInterface<IPurchaseEventManager> | |||
| 201 | R_SUCCEED(); | 205 | R_SUCCEED(); |
| 202 | } | 206 | } |
| 203 | 207 | ||
| 204 | Result AOC_U::CreatePermanentEcPurchasedEventManager( | 208 | Result IAddOnContentManager::CreatePermanentEcPurchasedEventManager( |
| 205 | OutInterface<IPurchaseEventManager> out_interface) { | 209 | OutInterface<IPurchaseEventManager> out_interface) { |
| 206 | LOG_WARNING(Service_AOC, "(STUBBED) called"); | 210 | LOG_WARNING(Service_AOC, "(STUBBED) called"); |
| 207 | 211 | ||
| @@ -212,7 +216,7 @@ Result AOC_U::CreatePermanentEcPurchasedEventManager( | |||
| 212 | 216 | ||
| 213 | void LoopProcess(Core::System& system) { | 217 | void LoopProcess(Core::System& system) { |
| 214 | auto server_manager = std::make_unique<ServerManager>(system); | 218 | auto server_manager = std::make_unique<ServerManager>(system); |
| 215 | server_manager->RegisterNamedService("aoc:u", std::make_shared<AOC_U>(system)); | 219 | server_manager->RegisterNamedService("aoc:u", std::make_shared<IAddOnContentManager>(system)); |
| 216 | ServerManager::RunServer(std::move(server_manager)); | 220 | ServerManager::RunServer(std::move(server_manager)); |
| 217 | } | 221 | } |
| 218 | 222 | ||
diff --git a/src/core/hle/service/aoc/aoc_u.h b/src/core/hle/service/aoc/addon_content_manager.h index c7b94a933..91857df4c 100644 --- a/src/core/hle/service/aoc/aoc_u.h +++ b/src/core/hle/service/aoc/addon_content_manager.h | |||
| @@ -19,10 +19,10 @@ namespace Service::AOC { | |||
| 19 | 19 | ||
| 20 | class IPurchaseEventManager; | 20 | class IPurchaseEventManager; |
| 21 | 21 | ||
| 22 | class AOC_U final : public ServiceFramework<AOC_U> { | 22 | class IAddOnContentManager final : public ServiceFramework<IAddOnContentManager> { |
| 23 | public: | 23 | public: |
| 24 | explicit AOC_U(Core::System& system); | 24 | explicit IAddOnContentManager(Core::System& system); |
| 25 | ~AOC_U() override; | 25 | ~IAddOnContentManager() override; |
| 26 | 26 | ||
| 27 | Result CountAddOnContent(Out<u32> out_count, ClientProcessId process_id); | 27 | Result CountAddOnContent(Out<u32> out_count, ClientProcessId process_id); |
| 28 | Result ListAddOnContent(Out<u32> out_count, OutBuffer<BufferAttr_HipcMapAlias> out_addons, | 28 | Result ListAddOnContent(Out<u32> out_count, OutBuffer<BufferAttr_HipcMapAlias> out_addons, |
diff --git a/src/core/hle/service/aoc/purchase_event_manager.cpp b/src/core/hle/service/aoc/purchase_event_manager.cpp index 1192263f8..9e718510b 100644 --- a/src/core/hle/service/aoc/purchase_event_manager.cpp +++ b/src/core/hle/service/aoc/purchase_event_manager.cpp | |||
| @@ -9,8 +9,8 @@ namespace Service::AOC { | |||
| 9 | constexpr Result ResultNoPurchasedProductInfoAvailable{ErrorModule::NIMShop, 400}; | 9 | constexpr Result ResultNoPurchasedProductInfoAvailable{ErrorModule::NIMShop, 400}; |
| 10 | 10 | ||
| 11 | IPurchaseEventManager::IPurchaseEventManager(Core::System& system_) | 11 | IPurchaseEventManager::IPurchaseEventManager(Core::System& system_) |
| 12 | : ServiceFramework{system_, "IPurchaseEventManager"}, | 12 | : ServiceFramework{system_, "IPurchaseEventManager"}, service_context{system, |
| 13 | service_context{system, "IPurchaseEventManager"} { | 13 | "IPurchaseEventManager"} { |
| 14 | // clang-format off | 14 | // clang-format off |
| 15 | static const FunctionInfo functions[] = { | 15 | static const FunctionInfo functions[] = { |
| 16 | {0, D<&IPurchaseEventManager::SetDefaultDeliveryTarget>, "SetDefaultDeliveryTarget"}, | 16 | {0, D<&IPurchaseEventManager::SetDefaultDeliveryTarget>, "SetDefaultDeliveryTarget"}, |