From 6c5f9941ad63b826c7e84fc22ec2187721528f5e Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sat, 9 Apr 2022 13:04:55 +0100 Subject: [PATCH] Stub additional IAddOnContentManager functions Used mainly by UE4 games --- .../services/aocsrv/IAddOnContentManager.cpp | 18 +++++++++++++++++- .../services/aocsrv/IAddOnContentManager.h | 12 +++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/app/src/main/cpp/skyline/services/aocsrv/IAddOnContentManager.cpp b/app/src/main/cpp/skyline/services/aocsrv/IAddOnContentManager.cpp index 99fe1a97..8fa9519f 100644 --- a/app/src/main/cpp/skyline/services/aocsrv/IAddOnContentManager.cpp +++ b/app/src/main/cpp/skyline/services/aocsrv/IAddOnContentManager.cpp @@ -1,13 +1,29 @@ // SPDX-License-Identifier: MPL-2.0 // Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/) +#include #include "IAddOnContentManager.h" namespace skyline::service::aocsrv { - IAddOnContentManager::IAddOnContentManager(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager) {} + IAddOnContentManager::IAddOnContentManager(const DeviceState &state, ServiceManager &manager) + : BaseService(state, manager), + addOnContentListChangedEvent(std::make_shared(state, false)) {} + + Result IAddOnContentManager::CountAddOnContent(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + response.Push(0); + return {}; + } Result IAddOnContentManager::ListAddOnContent(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { response.Push(0); return {}; } + + Result IAddOnContentManager::GetAddOnContentListChangedEvent(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + KHandle handle{state.process->InsertItem(addOnContentListChangedEvent)}; + Logger::Debug("Add On Content List Changed Event Handle: 0x{:X}", handle); + + response.copyHandles.push_back(handle); + return {}; + } } diff --git a/app/src/main/cpp/skyline/services/aocsrv/IAddOnContentManager.h b/app/src/main/cpp/skyline/services/aocsrv/IAddOnContentManager.h index 232976b4..d332eaa0 100644 --- a/app/src/main/cpp/skyline/services/aocsrv/IAddOnContentManager.h +++ b/app/src/main/cpp/skyline/services/aocsrv/IAddOnContentManager.h @@ -3,6 +3,7 @@ #pragma once +#include #include namespace skyline::service::aocsrv { @@ -11,13 +12,22 @@ namespace skyline::service::aocsrv { * @url https://switchbrew.org/wiki/NS_Services#aoc:u */ class IAddOnContentManager : public BaseService { + private: + std::shared_ptr addOnContentListChangedEvent; //!< This KEvent is triggered when the add-on content list changes + public: IAddOnContentManager(const DeviceState &state, ServiceManager &manager); + Result CountAddOnContent(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + Result ListAddOnContent(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + Result GetAddOnContentListChangedEvent(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + SERVICE_DECL( - SFUNC(0x3, IAddOnContentManager, ListAddOnContent) + SFUNC(0x2, IAddOnContentManager, CountAddOnContent), + SFUNC(0x3, IAddOnContentManager, ListAddOnContent), + SFUNC(0x8, IAddOnContentManager, GetAddOnContentListChangedEvent) ) }; }