summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2017-09-16 21:13:51 +0200
committerGravatar GitHub2017-09-16 21:13:51 +0200
commit255fd8768d48f12cbbb18601f54dbc5c344407fb (patch)
tree830259b0e0ed86bcaf37c63d96fbc8ca44834ef1 /src
parentMerge pull request #2900 from wwylele/clip-2 (diff)
parentServices/NS: Port ns:s to the new service framework. (diff)
downloadyuzu-255fd8768d48f12cbbb18601f54dbc5c344407fb.tar.gz
yuzu-255fd8768d48f12cbbb18601f54dbc5c344407fb.tar.xz
yuzu-255fd8768d48f12cbbb18601f54dbc5c344407fb.zip
Merge pull request #2906 from Subv/ns_new_framework
Services/NS: Port ns:s to the new service framework.
Diffstat (limited to 'src')
-rw-r--r--src/core/CMakeLists.txt6
-rw-r--r--src/core/hle/service/ns/ns.cpp16
-rw-r--r--src/core/hle/service/ns/ns.h16
-rw-r--r--src/core/hle/service/ns/ns_s.cpp34
-rw-r--r--src/core/hle/service/ns/ns_s.h (renamed from src/core/hle/service/ns_s.h)9
-rw-r--r--src/core/hle/service/ns_s.cpp33
-rw-r--r--src/core/hle/service/service.cpp5
7 files changed, 77 insertions, 42 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 78dec8600..cd1a8de2d 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -135,7 +135,8 @@ set(SRCS
135 hle/service/nim/nim_aoc.cpp 135 hle/service/nim/nim_aoc.cpp
136 hle/service/nim/nim_s.cpp 136 hle/service/nim/nim_s.cpp
137 hle/service/nim/nim_u.cpp 137 hle/service/nim/nim_u.cpp
138 hle/service/ns_s.cpp 138 hle/service/ns/ns.cpp
139 hle/service/ns/ns_s.cpp
139 hle/service/nwm/nwm.cpp 140 hle/service/nwm/nwm.cpp
140 hle/service/nwm/nwm_cec.cpp 141 hle/service/nwm/nwm_cec.cpp
141 hle/service/nwm/nwm_ext.cpp 142 hle/service/nwm/nwm_ext.cpp
@@ -335,7 +336,8 @@ set(HEADERS
335 hle/service/nim/nim_aoc.h 336 hle/service/nim/nim_aoc.h
336 hle/service/nim/nim_s.h 337 hle/service/nim/nim_s.h
337 hle/service/nim/nim_u.h 338 hle/service/nim/nim_u.h
338 hle/service/ns_s.h 339 hle/service/ns/ns.h
340 hle/service/ns/ns_s.h
339 hle/service/nwm/nwm.h 341 hle/service/nwm/nwm.h
340 hle/service/nwm/nwm_cec.h 342 hle/service/nwm/nwm_cec.h
341 hle/service/nwm/nwm_ext.h 343 hle/service/nwm/nwm_ext.h
diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp
new file mode 100644
index 000000000..9e19c38bf
--- /dev/null
+++ b/src/core/hle/service/ns/ns.cpp
@@ -0,0 +1,16 @@
1// Copyright 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/service/ns/ns.h"
6#include "core/hle/service/ns/ns_s.h"
7
8namespace Service {
9namespace NS {
10
11void InstallInterfaces(SM::ServiceManager& service_manager) {
12 std::make_shared<NS_S>()->InstallAsService(service_manager);
13}
14
15} // namespace NS
16} // namespace Service
diff --git a/src/core/hle/service/ns/ns.h b/src/core/hle/service/ns/ns.h
new file mode 100644
index 000000000..c3d67d98c
--- /dev/null
+++ b/src/core/hle/service/ns/ns.h
@@ -0,0 +1,16 @@
1// Copyright 2017 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/service.h"
8
9namespace Service {
10namespace NS {
11
12/// Registers all NS services with the specified service manager.
13void InstallInterfaces(SM::ServiceManager& service_manager);
14
15} // namespace NS
16} // namespace Service
diff --git a/src/core/hle/service/ns/ns_s.cpp b/src/core/hle/service/ns/ns_s.cpp
new file mode 100644
index 000000000..d952888dc
--- /dev/null
+++ b/src/core/hle/service/ns/ns_s.cpp
@@ -0,0 +1,34 @@
1// Copyright 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/service/ns/ns_s.h"
6
7namespace Service {
8namespace NS {
9
10NS_S::NS_S() : ServiceFramework("ns:s", 2) {
11 static const FunctionInfo functions[] = {
12 {0x000100C0, nullptr, "LaunchFIRM"},
13 {0x000200C0, nullptr, "LaunchTitle"},
14 {0x00030000, nullptr, "TerminateApplication"},
15 {0x00040040, nullptr, "TerminateProcess"},
16 {0x000500C0, nullptr, "LaunchApplicationFIRM"},
17 {0x00060042, nullptr, "SetFIRMParams4A0"},
18 {0x00070042, nullptr, "CardUpdateInitialize"},
19 {0x00080000, nullptr, "CardUpdateShutdown"},
20 {0x000D0140, nullptr, "SetTWLBannerHMAC"},
21 {0x000E0000, nullptr, "ShutdownAsync"},
22 {0x00100180, nullptr, "RebootSystem"},
23 {0x00110100, nullptr, "TerminateTitle"},
24 {0x001200C0, nullptr, "SetApplicationCpuTimeLimit"},
25 {0x00150140, nullptr, "LaunchApplication"},
26 {0x00160000, nullptr, "RebootSystemClean"},
27 };
28 RegisterHandlers(functions);
29}
30
31NS_S::~NS_S() = default;
32
33} // namespace NS
34} // namespace Service
diff --git a/src/core/hle/service/ns_s.h b/src/core/hle/service/ns/ns_s.h
index 90288a521..660ae453f 100644
--- a/src/core/hle/service/ns_s.h
+++ b/src/core/hle/service/ns/ns_s.h
@@ -4,18 +4,17 @@
4 4
5#pragma once 5#pragma once
6 6
7#include "core/hle/kernel/kernel.h"
7#include "core/hle/service/service.h" 8#include "core/hle/service/service.h"
8 9
9namespace Service { 10namespace Service {
10namespace NS { 11namespace NS {
11 12
12class NS_S final : public Interface { 13/// Interface to "ns:s" service
14class NS_S final : public ServiceFramework<NS_S> {
13public: 15public:
14 NS_S(); 16 NS_S();
15 17 ~NS_S();
16 std::string GetPortName() const override {
17 return "ns:s";
18 }
19}; 18};
20 19
21} // namespace NS 20} // namespace NS
diff --git a/src/core/hle/service/ns_s.cpp b/src/core/hle/service/ns_s.cpp
deleted file mode 100644
index 215c9aacc..000000000
--- a/src/core/hle/service/ns_s.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
1// Copyright 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/service/ns_s.h"
6
7namespace Service {
8namespace NS {
9
10const Interface::FunctionInfo FunctionTable[] = {
11 {0x000100C0, nullptr, "LaunchFIRM"},
12 {0x000200C0, nullptr, "LaunchTitle"},
13 {0x00030000, nullptr, "TerminateApplication"},
14 {0x00040040, nullptr, "TerminateProcess"},
15 {0x000500C0, nullptr, "LaunchApplicationFIRM"},
16 {0x00060042, nullptr, "SetFIRMParams4A0"},
17 {0x00070042, nullptr, "CardUpdateInitialize"},
18 {0x00080000, nullptr, "CardUpdateShutdown"},
19 {0x000D0140, nullptr, "SetTWLBannerHMAC"},
20 {0x000E0000, nullptr, "ShutdownAsync"},
21 {0x00100180, nullptr, "RebootSystem"},
22 {0x00110100, nullptr, "TerminateTitle"},
23 {0x001200C0, nullptr, "SetApplicationCpuTimeLimit"},
24 {0x00150140, nullptr, "LaunchApplication"},
25 {0x00160000, nullptr, "RebootSystemClean"},
26};
27
28NS_S::NS_S() {
29 Register(FunctionTable);
30}
31
32} // namespace NS
33} // namespace Service
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index aad950e50..f267aad74 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -38,7 +38,7 @@
38#include "core/hle/service/news/news.h" 38#include "core/hle/service/news/news.h"
39#include "core/hle/service/nfc/nfc.h" 39#include "core/hle/service/nfc/nfc.h"
40#include "core/hle/service/nim/nim.h" 40#include "core/hle/service/nim/nim.h"
41#include "core/hle/service/ns_s.h" 41#include "core/hle/service/ns/ns.h"
42#include "core/hle/service/nwm/nwm.h" 42#include "core/hle/service/nwm/nwm.h"
43#include "core/hle/service/pm_app.h" 43#include "core/hle/service/pm_app.h"
44#include "core/hle/service/ptm/ptm.h" 44#include "core/hle/service/ptm/ptm.h"
@@ -215,6 +215,8 @@ void Init() {
215 SM::g_service_manager = std::make_shared<SM::ServiceManager>(); 215 SM::g_service_manager = std::make_shared<SM::ServiceManager>();
216 SM::ServiceManager::InstallInterfaces(SM::g_service_manager); 216 SM::ServiceManager::InstallInterfaces(SM::g_service_manager);
217 217
218 NS::InstallInterfaces(*SM::g_service_manager);
219
218 AddNamedPort(new ERR::ERR_F); 220 AddNamedPort(new ERR::ERR_F);
219 221
220 FS::ArchiveInit(); 222 FS::ArchiveInit();
@@ -246,7 +248,6 @@ void Init() {
246 AddService(new HTTP::HTTP_C); 248 AddService(new HTTP::HTTP_C);
247 AddService(new LDR::LDR_RO); 249 AddService(new LDR::LDR_RO);
248 AddService(new MIC::MIC_U); 250 AddService(new MIC::MIC_U);
249 AddService(new NS::NS_S);
250 AddService(new PM::PM_APP); 251 AddService(new PM::PM_APP);
251 AddService(new SOC::SOC_U); 252 AddService(new SOC::SOC_U);
252 AddService(new SSL::SSL_C); 253 AddService(new SSL::SSL_C);