summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Lioncash2018-08-01 16:24:03 -0400
committerGravatar Lioncash2018-08-01 16:45:51 -0400
commite39294c2678af19003b692e66f32956f7f546279 (patch)
treee3c7e8dc5e5303a3439227f11d7f64cf88e72329
parentMerge pull request #885 from greggameplayer/R32-Float (diff)
downloadyuzu-e39294c2678af19003b692e66f32956f7f546279.tar.gz
yuzu-e39294c2678af19003b692e66f32956f7f546279.tar.xz
yuzu-e39294c2678af19003b692e66f32956f7f546279.zip
service: Add capture services
Adds the basic skeleton for the capture services based off information provided by Switch Brew.
Diffstat (limited to '')
-rw-r--r--src/common/logging/backend.cpp1
-rw-r--r--src/common/logging/log.h1
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/hle/service/caps/caps.cpp152
-rw-r--r--src/core/hle/service/caps/caps.h15
-rw-r--r--src/core/hle/service/service.cpp2
6 files changed, 173 insertions, 0 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index d86c40d26..8f9cb4d7b 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -170,6 +170,7 @@ void FileBackend::Write(const Entry& entry) {
170 SUB(Service, APM) \ 170 SUB(Service, APM) \
171 SUB(Service, BCAT) \ 171 SUB(Service, BCAT) \
172 SUB(Service, BTM) \ 172 SUB(Service, BTM) \
173 SUB(Service, Capture) \
173 SUB(Service, Fatal) \ 174 SUB(Service, Fatal) \
174 SUB(Service, FGM) \ 175 SUB(Service, FGM) \
175 SUB(Service, Friend) \ 176 SUB(Service, Friend) \
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index 140cd8e47..57552d49e 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -57,6 +57,7 @@ enum class Class : ClassType {
57 Service_Audio, ///< The Audio (Audio control) service 57 Service_Audio, ///< The Audio (Audio control) service
58 Service_BCAT, ///< The BCAT service 58 Service_BCAT, ///< The BCAT service
59 Service_BTM, ///< The BTM service 59 Service_BTM, ///< The BTM service
60 Service_Capture, ///< The capture service
60 Service_Fatal, ///< The Fatal service 61 Service_Fatal, ///< The Fatal service
61 Service_FGM, ///< The FGM service 62 Service_FGM, ///< The FGM service
62 Service_Friend, ///< The friend service 63 Service_Friend, ///< The friend service
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index ccb0695e4..26626553e 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -158,6 +158,8 @@ add_library(core STATIC
158 hle/service/btdrv/btdrv.h 158 hle/service/btdrv/btdrv.h
159 hle/service/btm/btm.cpp 159 hle/service/btm/btm.cpp
160 hle/service/btm/btm.h 160 hle/service/btm/btm.h
161 hle/service/caps/caps.cpp
162 hle/service/caps/caps.h
161 hle/service/erpt/erpt.cpp 163 hle/service/erpt/erpt.cpp
162 hle/service/erpt/erpt.h 164 hle/service/erpt/erpt.h
163 hle/service/es/es.cpp 165 hle/service/es/es.cpp
diff --git a/src/core/hle/service/caps/caps.cpp b/src/core/hle/service/caps/caps.cpp
new file mode 100644
index 000000000..ae7b0720b
--- /dev/null
+++ b/src/core/hle/service/caps/caps.cpp
@@ -0,0 +1,152 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include <memory>
6
7#include "core/hle/service/caps/caps.h"
8#include "core/hle/service/service.h"
9#include "core/hle/service/sm/sm.h"
10
11namespace Service::Capture {
12
13class CAPS_A final : public ServiceFramework<CAPS_A> {
14public:
15 explicit CAPS_A() : ServiceFramework{"caps:a"} {
16 // clang-format off
17 static const FunctionInfo functions[] = {
18 {0, nullptr, "Unknown1"},
19 {1, nullptr, "Unknown2"},
20 {2, nullptr, "Unknown3"},
21 {3, nullptr, "Unknown4"},
22 {4, nullptr, "Unknown5"},
23 {5, nullptr, "Unknown6"},
24 {6, nullptr, "Unknown7"},
25 {7, nullptr, "Unknown8"},
26 {8, nullptr, "Unknown9"},
27 {9, nullptr, "Unknown10"},
28 {10, nullptr, "Unknown11"},
29 {11, nullptr, "Unknown12"},
30 {12, nullptr, "Unknown13"},
31 {13, nullptr, "Unknown14"},
32 {14, nullptr, "Unknown15"},
33 {301, nullptr, "Unknown16"},
34 {401, nullptr, "Unknown17"},
35 {501, nullptr, "Unknown18"},
36 {1001, nullptr, "Unknown19"},
37 {1002, nullptr, "Unknown20"},
38 {8001, nullptr, "Unknown21"},
39 {8002, nullptr, "Unknown22"},
40 {8011, nullptr, "Unknown23"},
41 {8012, nullptr, "Unknown24"},
42 {8021, nullptr, "Unknown25"},
43 {10011, nullptr, "Unknown26"},
44 };
45 // clang-format on
46
47 RegisterHandlers(functions);
48 }
49};
50
51class CAPS_C final : public ServiceFramework<CAPS_C> {
52public:
53 explicit CAPS_C() : ServiceFramework{"caps:c"} {
54 // clang-format off
55 static const FunctionInfo functions[] = {
56 {2001, nullptr, "Unknown1"},
57 {2002, nullptr, "Unknown2"},
58 {2011, nullptr, "Unknown3"},
59 {2012, nullptr, "Unknown4"},
60 {2013, nullptr, "Unknown5"},
61 {2014, nullptr, "Unknown6"},
62 {2101, nullptr, "Unknown7"},
63 {2102, nullptr, "Unknown8"},
64 {2201, nullptr, "Unknown9"},
65 {2301, nullptr, "Unknown10"},
66 };
67 // clang-format on
68
69 RegisterHandlers(functions);
70 }
71};
72
73class CAPS_SC final : public ServiceFramework<CAPS_SC> {
74public:
75 explicit CAPS_SC() : ServiceFramework{"caps:sc"} {
76 // clang-format off
77 static const FunctionInfo functions[] = {
78 {1, nullptr, "Unknown1"},
79 {2, nullptr, "Unknown2"},
80 {1001, nullptr, "Unknown3"},
81 {1002, nullptr, "Unknown4"},
82 {1003, nullptr, "Unknown5"},
83 {1011, nullptr, "Unknown6"},
84 {1012, nullptr, "Unknown7"},
85 {1201, nullptr, "Unknown8"},
86 {1202, nullptr, "Unknown9"},
87 {1203, nullptr, "Unknown10"},
88 };
89 // clang-format on
90
91 RegisterHandlers(functions);
92 }
93};
94
95class CAPS_SS final : public ServiceFramework<CAPS_SS> {
96public:
97 explicit CAPS_SS() : ServiceFramework{"caps:ss"} {
98 // clang-format off
99 static const FunctionInfo functions[] = {
100 {201, nullptr, "Unknown1"},
101 {202, nullptr, "Unknown2"},
102 {203, nullptr, "Unknown3"},
103 {204, nullptr, "Unknown4"},
104 };
105 // clang-format on
106
107 RegisterHandlers(functions);
108 }
109};
110
111class CAPS_SU final : public ServiceFramework<CAPS_SU> {
112public:
113 explicit CAPS_SU() : ServiceFramework{"caps:su"} {
114 // clang-format off
115 static const FunctionInfo functions[] = {
116 {201, nullptr, "SaveScreenShot"},
117 {203, nullptr, "SaveScreenShotEx0"},
118 };
119 // clang-format on
120
121 RegisterHandlers(functions);
122 }
123};
124
125class CAPS_U final : public ServiceFramework<CAPS_U> {
126public:
127 explicit CAPS_U() : ServiceFramework{"caps:u"} {
128 // clang-format off
129 static const FunctionInfo functions[] = {
130 {102, nullptr, "GetAlbumFileListByAruid"},
131 {103, nullptr, "DeleteAlbumFileByAruid"},
132 {104, nullptr, "GetAlbumFileSizeByAruid"},
133 {110, nullptr, "LoadAlbumScreenShotImageByAruid"},
134 {120, nullptr, "LoadAlbumScreenShotThumbnailImageByAruid"},
135 {60002, nullptr, "OpenAccessorSessionForApplication"},
136 };
137 // clang-format on
138
139 RegisterHandlers(functions);
140 }
141};
142
143void InstallInterfaces(SM::ServiceManager& sm) {
144 std::make_shared<CAPS_A>()->InstallAsService(sm);
145 std::make_shared<CAPS_C>()->InstallAsService(sm);
146 std::make_shared<CAPS_SC>()->InstallAsService(sm);
147 std::make_shared<CAPS_SS>()->InstallAsService(sm);
148 std::make_shared<CAPS_SU>()->InstallAsService(sm);
149 std::make_shared<CAPS_U>()->InstallAsService(sm);
150}
151
152} // namespace Service::Capture
diff --git a/src/core/hle/service/caps/caps.h b/src/core/hle/service/caps/caps.h
new file mode 100644
index 000000000..471185dfa
--- /dev/null
+++ b/src/core/hle/service/caps/caps.h
@@ -0,0 +1,15 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::Capture {
12
13void InstallInterfaces(SM::ServiceManager& sm);
14
15} // namespace Service::Capture
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index fccc4c461..4f3a8d96b 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -23,6 +23,7 @@
23#include "core/hle/service/bcat/bcat.h" 23#include "core/hle/service/bcat/bcat.h"
24#include "core/hle/service/btdrv/btdrv.h" 24#include "core/hle/service/btdrv/btdrv.h"
25#include "core/hle/service/btm/btm.h" 25#include "core/hle/service/btm/btm.h"
26#include "core/hle/service/caps/caps.h"
26#include "core/hle/service/erpt/erpt.h" 27#include "core/hle/service/erpt/erpt.h"
27#include "core/hle/service/es/es.h" 28#include "core/hle/service/es/es.h"
28#include "core/hle/service/eupld/eupld.h" 29#include "core/hle/service/eupld/eupld.h"
@@ -206,6 +207,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
206 BCAT::InstallInterfaces(*sm); 207 BCAT::InstallInterfaces(*sm);
207 BtDrv::InstallInterfaces(*sm); 208 BtDrv::InstallInterfaces(*sm);
208 BTM::InstallInterfaces(*sm); 209 BTM::InstallInterfaces(*sm);
210 Capture::InstallInterfaces(*sm);
209 ERPT::InstallInterfaces(*sm); 211 ERPT::InstallInterfaces(*sm);
210 ES::InstallInterfaces(*sm); 212 ES::InstallInterfaces(*sm);
211 EUPLD::InstallInterfaces(*sm); 213 EUPLD::InstallInterfaces(*sm);