diff options
| -rw-r--r-- | src/core/hle/service/lbl/lbl.cpp | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/src/core/hle/service/lbl/lbl.cpp b/src/core/hle/service/lbl/lbl.cpp index 98a79365d..c14b24142 100644 --- a/src/core/hle/service/lbl/lbl.cpp +++ b/src/core/hle/service/lbl/lbl.cpp | |||
| @@ -18,8 +18,8 @@ public: | |||
| 18 | explicit LBL(Core::System& system_) : ServiceFramework{system_, "lbl"} { | 18 | explicit LBL(Core::System& system_) : ServiceFramework{system_, "lbl"} { |
| 19 | // clang-format off | 19 | // clang-format off |
| 20 | static const FunctionInfo functions[] = { | 20 | static const FunctionInfo functions[] = { |
| 21 | {0, nullptr, "SaveCurrentSetting"}, | 21 | {0, &LBL::SaveCurrentSetting, "SaveCurrentSetting"}, |
| 22 | {1, nullptr, "LoadCurrentSetting"}, | 22 | {1, &LBL::LoadCurrentSetting, "LoadCurrentSetting"}, |
| 23 | {2, &LBL::SetCurrentBrightnessSetting, "SetCurrentBrightnessSetting"}, | 23 | {2, &LBL::SetCurrentBrightnessSetting, "SetCurrentBrightnessSetting"}, |
| 24 | {3, &LBL::GetCurrentBrightnessSetting, "GetCurrentBrightnessSetting"}, | 24 | {3, &LBL::GetCurrentBrightnessSetting, "GetCurrentBrightnessSetting"}, |
| 25 | {4, nullptr, "ApplyCurrentBrightnessSettingToBacklight"}, | 25 | {4, nullptr, "ApplyCurrentBrightnessSettingToBacklight"}, |
| @@ -47,7 +47,7 @@ public: | |||
| 47 | {26, &LBL::EnableVrMode, "EnableVrMode"}, | 47 | {26, &LBL::EnableVrMode, "EnableVrMode"}, |
| 48 | {27, &LBL::DisableVrMode, "DisableVrMode"}, | 48 | {27, &LBL::DisableVrMode, "DisableVrMode"}, |
| 49 | {28, &LBL::IsVrModeEnabled, "IsVrModeEnabled"}, | 49 | {28, &LBL::IsVrModeEnabled, "IsVrModeEnabled"}, |
| 50 | {29, nullptr, "IsAutoBrightnessControlSupported"}, | 50 | {29, &LBL::IsAutoBrightnessControlSupported, "IsAutoBrightnessControlSupported"}, |
| 51 | }; | 51 | }; |
| 52 | // clang-format on | 52 | // clang-format on |
| 53 | 53 | ||
| @@ -60,6 +60,20 @@ private: | |||
| 60 | On = 1, | 60 | On = 1, |
| 61 | }; | 61 | }; |
| 62 | 62 | ||
| 63 | void SaveCurrentSetting(HLERequestContext& ctx) { | ||
| 64 | LOG_WARNING(Service_LBL, "(STUBBED) called"); | ||
| 65 | |||
| 66 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 67 | rb.Push(ResultSuccess); | ||
| 68 | } | ||
| 69 | |||
| 70 | void LoadCurrentSetting(HLERequestContext& ctx) { | ||
| 71 | LOG_WARNING(Service_LBL, "(STUBBED) called"); | ||
| 72 | |||
| 73 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 74 | rb.Push(ResultSuccess); | ||
| 75 | } | ||
| 76 | |||
| 63 | void SetCurrentBrightnessSetting(HLERequestContext& ctx) { | 77 | void SetCurrentBrightnessSetting(HLERequestContext& ctx) { |
| 64 | IPC::RequestParser rp{ctx}; | 78 | IPC::RequestParser rp{ctx}; |
| 65 | auto brightness = rp.Pop<float>(); | 79 | auto brightness = rp.Pop<float>(); |
| @@ -310,6 +324,14 @@ private: | |||
| 310 | rb.Push(vr_mode_enabled); | 324 | rb.Push(vr_mode_enabled); |
| 311 | } | 325 | } |
| 312 | 326 | ||
| 327 | void IsAutoBrightnessControlSupported(HLERequestContext& ctx) { | ||
| 328 | LOG_DEBUG(Service_LBL, "called"); | ||
| 329 | |||
| 330 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 331 | rb.Push(ResultSuccess); | ||
| 332 | rb.Push<u8>(auto_brightness_supported); | ||
| 333 | } | ||
| 334 | |||
| 313 | bool vr_mode_enabled = false; | 335 | bool vr_mode_enabled = false; |
| 314 | float current_brightness = 1.0f; | 336 | float current_brightness = 1.0f; |
| 315 | float ambient_light_value = 0.0f; | 337 | float ambient_light_value = 0.0f; |
| @@ -317,7 +339,8 @@ private: | |||
| 317 | bool dimming = true; | 339 | bool dimming = true; |
| 318 | bool backlight_enabled = true; | 340 | bool backlight_enabled = true; |
| 319 | bool update_instantly = false; | 341 | bool update_instantly = false; |
| 320 | bool auto_brightness = false; // TODO(ogniK): Move to system settings | 342 | bool auto_brightness = false; |
| 343 | bool auto_brightness_supported = true; // TODO(ogniK): Move to system settings | ||
| 321 | }; | 344 | }; |
| 322 | 345 | ||
| 323 | void LoopProcess(Core::System& system) { | 346 | void LoopProcess(Core::System& system) { |