From 23d6b596b2f7cce00e6f08411e7b7fd87558ff8d Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sat, 4 Jul 2020 20:58:16 +0100 Subject: [PATCH] Add an empty aoc:u implementation This is required by Puyo Puyo Tetris, it will be extended in the future to allow using real DLC with the emulator. --- app/CMakeLists.txt | 1 + .../services/aocsrv/IAddOnContentManager.cpp | 9 +++++++++ .../services/aocsrv/IAddOnContentManager.h | 17 +++++++++++++++++ .../main/cpp/skyline/services/base_service.h | 2 ++ .../main/cpp/skyline/services/serviceman.cpp | 4 ++++ 5 files changed, 33 insertions(+) create mode 100644 app/src/main/cpp/skyline/services/aocsrv/IAddOnContentManager.cpp create mode 100644 app/src/main/cpp/skyline/services/aocsrv/IAddOnContentManager.h diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 44a9c575..53fce962 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -104,6 +104,7 @@ add_library(skyline SHARED ${source_DIR}/skyline/services/visrv/IManagerRootService.cpp ${source_DIR}/skyline/services/visrv/ISystemDisplayService.cpp ${source_DIR}/skyline/services/pl/IPlatformServiceManager.cpp + ${source_DIR}/skyline/services/aocsrv/IAddOnContentManager.cpp ${source_DIR}/skyline/vfs/partition_filesystem.cpp ${source_DIR}/skyline/vfs/rom_filesystem.cpp ${source_DIR}/skyline/vfs/os_backing.cpp diff --git a/app/src/main/cpp/skyline/services/aocsrv/IAddOnContentManager.cpp b/app/src/main/cpp/skyline/services/aocsrv/IAddOnContentManager.cpp new file mode 100644 index 00000000..1b59712e --- /dev/null +++ b/app/src/main/cpp/skyline/services/aocsrv/IAddOnContentManager.cpp @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: MPL-2.0 +// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/) + +#include "IAddOnContentManager.h" + +namespace skyline::service::aocsrv { + IAddOnContentManager::IAddOnContentManager(const DeviceState &state, ServiceManager &manager) : BaseService(state, manager, Service::aocsrv_IAddOnContentManager, "aocsrv:IAddOnContentManager", { + }) {} +} diff --git a/app/src/main/cpp/skyline/services/aocsrv/IAddOnContentManager.h b/app/src/main/cpp/skyline/services/aocsrv/IAddOnContentManager.h new file mode 100644 index 00000000..b90b03d8 --- /dev/null +++ b/app/src/main/cpp/skyline/services/aocsrv/IAddOnContentManager.h @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: MPL-2.0 +// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/) + +#pragma once + +#include +#include + +namespace skyline::service::aocsrv { + /** + * @brief IAddOnContentManager or aoc:u is used by applications to access add-on content information (https://switchbrew.org/wiki/NS_Services#aoc:u) + */ + class IAddOnContentManager : public BaseService { + public: + IAddOnContentManager(const DeviceState &state, ServiceManager &manager); + }; +} diff --git a/app/src/main/cpp/skyline/services/base_service.h b/app/src/main/cpp/skyline/services/base_service.h index 2d63f610..53613b4f 100644 --- a/app/src/main/cpp/skyline/services/base_service.h +++ b/app/src/main/cpp/skyline/services/base_service.h @@ -61,6 +61,7 @@ namespace skyline::service { visrv_IManagerDisplayService, hosbinder_IHOSBinderDriver, pl_IPlatformServiceManager + aocsrv_IAddOnContentManager, }; /** @@ -86,6 +87,7 @@ namespace skyline::service { {"nvdrv:t", Service::nvdrv_INvDrvServices}, {"vi:m", Service::visrv_IManagerRootService}, {"pl:u", Service::pl_IPlatformServiceManager} + {"aoc:u", Service::aocsrv_IAddOnContentManager} }; class ServiceManager; diff --git a/app/src/main/cpp/skyline/services/serviceman.cpp b/app/src/main/cpp/skyline/services/serviceman.cpp index ef942007..f99027e6 100644 --- a/app/src/main/cpp/skyline/services/serviceman.cpp +++ b/app/src/main/cpp/skyline/services/serviceman.cpp @@ -17,6 +17,7 @@ #include "services/nvdrv/INvDrvServices.h" #include "visrv/IManagerRootService.h" #include "pl/IPlatformServiceManager.h" +#include "aocsrv/IAddOnContentManager.h" #include "serviceman.h" namespace skyline::service { @@ -74,6 +75,9 @@ namespace skyline::service { case Service::pl_IPlatformServiceManager: serviceObj = std::make_shared(state, *this); break; + case Service::aocsrv_IAddOnContentManager: + serviceObj = std::make_shared(state, *this); + break; default: throw exception("CreateService called on missing object, type: {}", serviceType); }