summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/am/am.cpp42
-rw-r--r--src/core/hle/service/am/am.h3
2 files changed, 42 insertions, 3 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index d1bf13c89..557608e76 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -52,6 +52,11 @@ enum class LaunchParameterKind : u32 {
52 AccountPreselectedUser = 2, 52 AccountPreselectedUser = 2,
53}; 53};
54 54
55enum class VrMode : u8 {
56 Disabled = 0,
57 Enabled = 1,
58};
59
55constexpr u32 LAUNCH_PARAMETER_ACCOUNT_PRESELECTED_USER_MAGIC = 0xC79497CA; 60constexpr u32 LAUNCH_PARAMETER_ACCOUNT_PRESELECTED_USER_MAGIC = 0xC79497CA;
56 61
57struct LaunchParameterAccountPreselectedUser { 62struct LaunchParameterAccountPreselectedUser {
@@ -605,11 +610,11 @@ ICommonStateGetter::ICommonStateGetter(Core::System& system,
605 {30, nullptr, "GetHomeButtonReaderLockAccessor"}, 610 {30, nullptr, "GetHomeButtonReaderLockAccessor"},
606 {31, nullptr, "GetReaderLockAccessorEx"}, 611 {31, nullptr, "GetReaderLockAccessorEx"},
607 {40, nullptr, "GetCradleFwVersion"}, 612 {40, nullptr, "GetCradleFwVersion"},
608 {50, nullptr, "IsVrModeEnabled"}, 613 {50, &ICommonStateGetter::IsVrModeEnabled, "IsVrModeEnabled"},
609 {51, nullptr, "SetVrModeEnabled"}, 614 {51, &ICommonStateGetter::SetVrModeEnabled, "SetVrModeEnabled"},
610 {52, &ICommonStateGetter::SetLcdBacklighOffEnabled, "SetLcdBacklighOffEnabled"}, 615 {52, &ICommonStateGetter::SetLcdBacklighOffEnabled, "SetLcdBacklighOffEnabled"},
611 {53, nullptr, "BeginVrModeEx"}, 616 {53, nullptr, "BeginVrModeEx"},
612 {54, nullptr, "EndVrModeEx"}, 617 {54, &ICommonStateGetter::EndVrModeEx, "EndVrModeEx"},
613 {55, nullptr, "IsInControllerFirmwareUpdateSection"}, 618 {55, nullptr, "IsInControllerFirmwareUpdateSection"},
614 {60, &ICommonStateGetter::GetDefaultDisplayResolution, "GetDefaultDisplayResolution"}, 619 {60, &ICommonStateGetter::GetDefaultDisplayResolution, "GetDefaultDisplayResolution"},
615 {61, &ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent, "GetDefaultDisplayResolutionChangeEvent"}, 620 {61, &ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent, "GetDefaultDisplayResolutionChangeEvent"},
@@ -672,6 +677,30 @@ void ICommonStateGetter::GetCurrentFocusState(Kernel::HLERequestContext& ctx) {
672 rb.Push(static_cast<u8>(FocusState::InFocus)); 677 rb.Push(static_cast<u8>(FocusState::InFocus));
673} 678}
674 679
680void ICommonStateGetter::IsVrModeEnabled(Kernel::HLERequestContext& ctx) {
681 LOG_WARNING(Service_AM, "(STUBBED) called");
682
683 IPC::ResponseBuilder rb{ctx, 3};
684 rb.Push(RESULT_SUCCESS);
685 rb.PushEnum(VrMode::Disabled);
686}
687
688void ICommonStateGetter::SetVrModeEnabled(Kernel::HLERequestContext& ctx) {
689 IPC::RequestParser rp{ctx};
690 const auto is_vr_mode_enabled = rp.Pop<bool>();
691
692 LOG_WARNING(Service_AM, "(STUBBED) called. is_vr_mode_enabled={}", is_vr_mode_enabled);
693
694 IPC::ResponseBuilder rb{ctx, 2};
695 if (!is_vr_mode_enabled) {
696 rb.Push(RESULT_SUCCESS);
697 } else {
698 // TODO: Find better error code for this
699 UNIMPLEMENTED_MSG("is_vr_mode_enabled={}", is_vr_mode_enabled);
700 rb.Push(RESULT_UNKNOWN);
701 }
702}
703
675void ICommonStateGetter::SetLcdBacklighOffEnabled(Kernel::HLERequestContext& ctx) { 704void ICommonStateGetter::SetLcdBacklighOffEnabled(Kernel::HLERequestContext& ctx) {
676 IPC::RequestParser rp{ctx}; 705 IPC::RequestParser rp{ctx};
677 const auto is_lcd_backlight_off_enabled = rp.Pop<bool>(); 706 const auto is_lcd_backlight_off_enabled = rp.Pop<bool>();
@@ -683,6 +712,13 @@ void ICommonStateGetter::SetLcdBacklighOffEnabled(Kernel::HLERequestContext& ctx
683 rb.Push(RESULT_SUCCESS); 712 rb.Push(RESULT_SUCCESS);
684} 713}
685 714
715void ICommonStateGetter::EndVrModeEx(Kernel::HLERequestContext& ctx) {
716 LOG_WARNING(Service_AM, "(STUBBED) called");
717
718 IPC::ResponseBuilder rb{ctx, 2};
719 rb.Push(RESULT_SUCCESS);
720}
721
686void ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent(Kernel::HLERequestContext& ctx) { 722void ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent(Kernel::HLERequestContext& ctx) {
687 LOG_DEBUG(Service_AM, "called"); 723 LOG_DEBUG(Service_AM, "called");
688 724
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h
index 0843de781..53cfce10f 100644
--- a/src/core/hle/service/am/am.h
+++ b/src/core/hle/service/am/am.h
@@ -182,7 +182,10 @@ private:
182 void GetOperationMode(Kernel::HLERequestContext& ctx); 182 void GetOperationMode(Kernel::HLERequestContext& ctx);
183 void GetPerformanceMode(Kernel::HLERequestContext& ctx); 183 void GetPerformanceMode(Kernel::HLERequestContext& ctx);
184 void GetBootMode(Kernel::HLERequestContext& ctx); 184 void GetBootMode(Kernel::HLERequestContext& ctx);
185 void IsVrModeEnabled(Kernel::HLERequestContext& ctx);
186 void SetVrModeEnabled(Kernel::HLERequestContext& ctx);
185 void SetLcdBacklighOffEnabled(Kernel::HLERequestContext& ctx); 187 void SetLcdBacklighOffEnabled(Kernel::HLERequestContext& ctx);
188 void EndVrModeEx(Kernel::HLERequestContext& ctx);
186 void GetDefaultDisplayResolution(Kernel::HLERequestContext& ctx); 189 void GetDefaultDisplayResolution(Kernel::HLERequestContext& ctx);
187 void SetCpuBoostMode(Kernel::HLERequestContext& ctx); 190 void SetCpuBoostMode(Kernel::HLERequestContext& ctx);
188 191