1
0
Fork 0
forked from suyu/suyu

service/lbl: Implement EnableVrMode, DisableVrMode and GetVrMode

Implements these functions according to the information available on
Switch Brew.
This commit is contained in:
Lioncash 2018-07-27 14:01:17 -04:00
parent c2c543e8f7
commit ea8dd8b650
3 changed files with 37 additions and 3 deletions

View file

@ -173,6 +173,7 @@ void FileBackend::Write(const Entry& entry) {
SUB(Service, Friend) \ SUB(Service, Friend) \
SUB(Service, FS) \ SUB(Service, FS) \
SUB(Service, HID) \ SUB(Service, HID) \
SUB(Service, LBL) \
SUB(Service, LDN) \ SUB(Service, LDN) \
SUB(Service, LM) \ SUB(Service, LM) \
SUB(Service, MM) \ SUB(Service, MM) \

View file

@ -60,6 +60,7 @@ enum class Class : ClassType {
Service_Friend, ///< The friend service Service_Friend, ///< The friend service
Service_FS, ///< The FS (Filesystem) service Service_FS, ///< The FS (Filesystem) service
Service_HID, ///< The HID (Human interface device) service Service_HID, ///< The HID (Human interface device) service
Service_LBL, ///< The LBL (LCD backlight) service
Service_LDN, ///< The LDN (Local domain network) service Service_LDN, ///< The LDN (Local domain network) service
Service_LM, ///< The LM (Logger) service Service_LM, ///< The LM (Logger) service
Service_MM, ///< The MM (Multimedia) service Service_MM, ///< The MM (Multimedia) service

View file

@ -4,6 +4,9 @@
#include <memory> #include <memory>
#include "common/logging/log.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/service/lbl/lbl.h" #include "core/hle/service/lbl/lbl.h"
#include "core/hle/service/service.h" #include "core/hle/service/service.h"
#include "core/hle/service/sm/sm.h" #include "core/hle/service/sm/sm.h"
@ -41,14 +44,43 @@ public:
{23, nullptr, "Unknown20"}, {23, nullptr, "Unknown20"},
{24, nullptr, "Unknown21"}, {24, nullptr, "Unknown21"},
{25, nullptr, "Unknown22"}, {25, nullptr, "Unknown22"},
{26, nullptr, "EnableVrMode"}, {26, &LBL::EnableVrMode, "EnableVrMode"},
{27, nullptr, "DisableVrMode"}, {27, &LBL::DisableVrMode, "DisableVrMode"},
{28, nullptr, "GetVrMode"}, {28, &LBL::GetVrMode, "GetVrMode"},
}; };
// clang-format on // clang-format on
RegisterHandlers(functions); RegisterHandlers(functions);
} }
private:
void EnableVrMode(Kernel::HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
vr_mode_enabled = true;
LOG_DEBUG(Service_LBL, "called");
}
void DisableVrMode(Kernel::HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
vr_mode_enabled = false;
LOG_DEBUG(Service_LBL, "called");
}
void GetVrMode(Kernel::HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(RESULT_SUCCESS);
rb.Push(vr_mode_enabled);
LOG_DEBUG(Service_LBL, "called");
}
bool vr_mode_enabled = false;
}; };
void InstallInterfaces(SM::ServiceManager& sm) { void InstallInterfaces(SM::ServiceManager& sm) {