From 5f90c9816d3e4b2755bbc2445bd4fb304a9219a6 Mon Sep 17 00:00:00 2001 From: Steveice10 <1269164+Steveice10@users.noreply.github.com> Date: Tue, 4 Apr 2023 10:01:37 -0700 Subject: [PATCH] apt: Add stub for ns:c service. (#6409) --- src/core/CMakeLists.txt | 2 ++ src/core/hle/service/apt/apt.cpp | 2 ++ src/core/hle/service/apt/ns_c.cpp | 21 +++++++++++++++++++++ src/core/hle/service/apt/ns_c.h | 25 +++++++++++++++++++++++++ src/core/hle/service/apt/ns_s.cpp | 2 +- 5 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 src/core/hle/service/apt/ns_c.cpp create mode 100644 src/core/hle/service/apt/ns_c.h diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 8aadcad81..0a2d7f307 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -220,6 +220,8 @@ add_library(core STATIC hle/service/apt/apt_u.h hle/service/apt/ns.cpp hle/service/apt/ns.h + hle/service/apt/ns_c.cpp + hle/service/apt/ns_c.h hle/service/apt/ns_s.cpp hle/service/apt/ns_s.h hle/service/apt/bcfnt/bcfnt.cpp diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index 45051963e..027c81ec2 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -22,6 +22,7 @@ #include "core/hle/service/apt/apt_s.h" #include "core/hle/service/apt/apt_u.h" #include "core/hle/service/apt/bcfnt/bcfnt.h" +#include "core/hle/service/apt/ns_c.h" #include "core/hle/service/apt/ns_s.h" #include "core/hle/service/cfg/cfg.h" #include "core/hle/service/fs/archive.h" @@ -1240,6 +1241,7 @@ void InstallInterfaces(Core::System& system) { std::make_shared(apt)->InstallAsService(service_manager); std::make_shared(apt)->InstallAsService(service_manager); std::make_shared(apt)->InstallAsService(service_manager); + std::make_shared(apt)->InstallAsService(service_manager); } } // namespace Service::APT diff --git a/src/core/hle/service/apt/ns_c.cpp b/src/core/hle/service/apt/ns_c.cpp new file mode 100644 index 000000000..35ac4f3eb --- /dev/null +++ b/src/core/hle/service/apt/ns_c.cpp @@ -0,0 +1,21 @@ +// Copyright 2023 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "common/archives.h" +#include "core/hle/service/apt/ns_c.h" + +namespace Service::NS { + +NS_C::NS_C(std::shared_ptr apt) + : Service::APT::Module::NSInterface(std::move(apt), "ns:c", 1) { + static const FunctionInfo functions[] = { + {0x00010100, nullptr, "LockSpecialContent"}, + {0x00020100, nullptr, "UnlockSpecialContent"}, + }; + RegisterHandlers(functions); +} + +} // namespace Service::NS + +SERIALIZE_EXPORT_IMPL(Service::NS::NS_C) diff --git a/src/core/hle/service/apt/ns_c.h b/src/core/hle/service/apt/ns_c.h new file mode 100644 index 000000000..1fe91fad4 --- /dev/null +++ b/src/core/hle/service/apt/ns_c.h @@ -0,0 +1,25 @@ +// Copyright 2023 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include "core/hle/kernel/kernel.h" +#include "core/hle/service/apt/apt.h" +#include "core/hle/service/service.h" + +namespace Service::NS { + +/// Interface to "ns:c" service +class NS_C final : public Service::APT::Module::NSInterface { +public: + explicit NS_C(std::shared_ptr apt); + +private: + SERVICE_SERIALIZATION(NS_C, apt, Service::APT::Module) +}; + +} // namespace Service::NS + +BOOST_CLASS_EXPORT_KEY(Service::NS::NS_C) +BOOST_SERIALIZATION_CONSTRUCT(Service::NS::NS_C) diff --git a/src/core/hle/service/apt/ns_s.cpp b/src/core/hle/service/apt/ns_s.cpp index 63666dcae..470913c1e 100644 --- a/src/core/hle/service/apt/ns_s.cpp +++ b/src/core/hle/service/apt/ns_s.cpp @@ -8,7 +8,7 @@ namespace Service::NS { NS_S::NS_S(std::shared_ptr apt) - : Service::APT::Module::NSInterface(std::move(apt), "ns:s", 2) { + : Service::APT::Module::NSInterface(std::move(apt), "ns:s", 3) { static const FunctionInfo functions[] = { {0x000100C0, nullptr, "LaunchFIRM"}, {0x000200C0, nullptr, "LaunchTitle"},