summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2018-07-27 13:06:11 -0700
committerGravatar GitHub2018-07-27 13:06:11 -0700
commit833ebbb6269c21dbc9cef7f70f6c3bb4e2bc776c (patch)
treed16c8f5777d31ea4f36f421984cacd74584243ef
parentMerge pull request #841 from lioncash/btdrv (diff)
parentservice/lbl: Implement EnableVrMode, DisableVrMode and GetVrMode (diff)
downloadyuzu-833ebbb6269c21dbc9cef7f70f6c3bb4e2bc776c.tar.gz
yuzu-833ebbb6269c21dbc9cef7f70f6c3bb4e2bc776c.tar.xz
yuzu-833ebbb6269c21dbc9cef7f70f6c3bb4e2bc776c.zip
Merge pull request #844 from lioncash/lbl
service: Add the lbl service
-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/lbl/lbl.cpp90
-rw-r--r--src/core/hle/service/lbl/lbl.h15
-rw-r--r--src/core/hle/service/service.cpp2
6 files changed, 111 insertions, 0 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index ad9edbcdf..db3ee0837 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -173,6 +173,7 @@ void FileBackend::Write(const Entry& entry) {
173 SUB(Service, Friend) \ 173 SUB(Service, Friend) \
174 SUB(Service, FS) \ 174 SUB(Service, FS) \
175 SUB(Service, HID) \ 175 SUB(Service, HID) \
176 SUB(Service, LBL) \
176 SUB(Service, LDN) \ 177 SUB(Service, LDN) \
177 SUB(Service, LM) \ 178 SUB(Service, LM) \
178 SUB(Service, MM) \ 179 SUB(Service, MM) \
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index ad3cbf5d1..d22cb2966 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -60,6 +60,7 @@ enum class Class : ClassType {
60 Service_Friend, ///< The friend service 60 Service_Friend, ///< The friend service
61 Service_FS, ///< The FS (Filesystem) service 61 Service_FS, ///< The FS (Filesystem) service
62 Service_HID, ///< The HID (Human interface device) service 62 Service_HID, ///< The HID (Human interface device) service
63 Service_LBL, ///< The LBL (LCD backlight) service
63 Service_LDN, ///< The LDN (Local domain network) service 64 Service_LDN, ///< The LDN (Local domain network) service
64 Service_LM, ///< The LM (Logger) service 65 Service_LM, ///< The LM (Logger) service
65 Service_MM, ///< The MM (Multimedia) service 66 Service_MM, ///< The MM (Multimedia) service
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index e52214ff9..525ba39bc 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -166,6 +166,8 @@ add_library(core STATIC
166 hle/service/hid/irs.h 166 hle/service/hid/irs.h
167 hle/service/hid/xcd.cpp 167 hle/service/hid/xcd.cpp
168 hle/service/hid/xcd.h 168 hle/service/hid/xcd.h
169 hle/service/lbl/lbl.cpp
170 hle/service/lbl/lbl.h
169 hle/service/ldn/ldn.cpp 171 hle/service/ldn/ldn.cpp
170 hle/service/ldn/ldn.h 172 hle/service/ldn/ldn.h
171 hle/service/ldr/ldr.cpp 173 hle/service/ldr/ldr.cpp
diff --git a/src/core/hle/service/lbl/lbl.cpp b/src/core/hle/service/lbl/lbl.cpp
new file mode 100644
index 000000000..8fc8b1057
--- /dev/null
+++ b/src/core/hle/service/lbl/lbl.cpp
@@ -0,0 +1,90 @@
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 "common/logging/log.h"
8#include "core/hle/ipc_helpers.h"
9#include "core/hle/kernel/hle_ipc.h"
10#include "core/hle/service/lbl/lbl.h"
11#include "core/hle/service/service.h"
12#include "core/hle/service/sm/sm.h"
13
14namespace Service::LBL {
15
16class LBL final : public ServiceFramework<LBL> {
17public:
18 explicit LBL() : ServiceFramework{"lbl"} {
19 // clang-format off
20 static const FunctionInfo functions[] = {
21 {0, nullptr, "Unknown1"},
22 {1, nullptr, "Unknown2"},
23 {2, nullptr, "Unknown3"},
24 {3, nullptr, "Unknown4"},
25 {4, nullptr, "Unknown5"},
26 {5, nullptr, "Unknown6"},
27 {6, nullptr, "TurnOffBacklight"},
28 {7, nullptr, "TurnOnBacklight"},
29 {8, nullptr, "GetBacklightStatus"},
30 {9, nullptr, "Unknown7"},
31 {10, nullptr, "Unknown8"},
32 {11, nullptr, "Unknown9"},
33 {12, nullptr, "Unknown10"},
34 {13, nullptr, "Unknown11"},
35 {14, nullptr, "Unknown12"},
36 {15, nullptr, "Unknown13"},
37 {16, nullptr, "ReadRawLightSensor"},
38 {17, nullptr, "Unknown14"},
39 {18, nullptr, "Unknown15"},
40 {19, nullptr, "Unknown16"},
41 {20, nullptr, "Unknown17"},
42 {21, nullptr, "Unknown18"},
43 {22, nullptr, "Unknown19"},
44 {23, nullptr, "Unknown20"},
45 {24, nullptr, "Unknown21"},
46 {25, nullptr, "Unknown22"},
47 {26, &LBL::EnableVrMode, "EnableVrMode"},
48 {27, &LBL::DisableVrMode, "DisableVrMode"},
49 {28, &LBL::GetVrMode, "GetVrMode"},
50 };
51 // clang-format on
52
53 RegisterHandlers(functions);
54 }
55
56private:
57 void EnableVrMode(Kernel::HLERequestContext& ctx) {
58 IPC::ResponseBuilder rb{ctx, 2};
59 rb.Push(RESULT_SUCCESS);
60
61 vr_mode_enabled = true;
62
63 LOG_DEBUG(Service_LBL, "called");
64 }
65
66 void DisableVrMode(Kernel::HLERequestContext& ctx) {
67 IPC::ResponseBuilder rb{ctx, 2};
68 rb.Push(RESULT_SUCCESS);
69
70 vr_mode_enabled = false;
71
72 LOG_DEBUG(Service_LBL, "called");
73 }
74
75 void GetVrMode(Kernel::HLERequestContext& ctx) {
76 IPC::ResponseBuilder rb{ctx, 3};
77 rb.Push(RESULT_SUCCESS);
78 rb.Push(vr_mode_enabled);
79
80 LOG_DEBUG(Service_LBL, "called");
81 }
82
83 bool vr_mode_enabled = false;
84};
85
86void InstallInterfaces(SM::ServiceManager& sm) {
87 std::make_shared<LBL>()->InstallAsService(sm);
88}
89
90} // namespace Service::LBL
diff --git a/src/core/hle/service/lbl/lbl.h b/src/core/hle/service/lbl/lbl.h
new file mode 100644
index 000000000..bf6f400f8
--- /dev/null
+++ b/src/core/hle/service/lbl/lbl.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::LBL {
12
13void InstallInterfaces(SM::ServiceManager& sm);
14
15} // namespace Service::LBL
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 1654db231..d2c05cc92 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -30,6 +30,7 @@
30#include "core/hle/service/friend/friend.h" 30#include "core/hle/service/friend/friend.h"
31#include "core/hle/service/grc/grc.h" 31#include "core/hle/service/grc/grc.h"
32#include "core/hle/service/hid/hid.h" 32#include "core/hle/service/hid/hid.h"
33#include "core/hle/service/lbl/lbl.h"
33#include "core/hle/service/ldn/ldn.h" 34#include "core/hle/service/ldn/ldn.h"
34#include "core/hle/service/ldr/ldr.h" 35#include "core/hle/service/ldr/ldr.h"
35#include "core/hle/service/lm/lm.h" 36#include "core/hle/service/lm/lm.h"
@@ -205,6 +206,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
205 Friend::InstallInterfaces(*sm); 206 Friend::InstallInterfaces(*sm);
206 GRC::InstallInterfaces(*sm); 207 GRC::InstallInterfaces(*sm);
207 HID::InstallInterfaces(*sm); 208 HID::InstallInterfaces(*sm);
209 LBL::InstallInterfaces(*sm);
208 LDN::InstallInterfaces(*sm); 210 LDN::InstallInterfaces(*sm);
209 LDR::InstallInterfaces(*sm); 211 LDR::InstallInterfaces(*sm);
210 LM::InstallInterfaces(*sm); 212 LM::InstallInterfaces(*sm);