diff options
| author | 2020-04-29 21:48:58 +1000 | |
|---|---|---|
| committer | 2020-04-29 21:48:58 +1000 | |
| commit | 8bddc750e283b13da19f719be4671ee2c8230b8a (patch) | |
| tree | 9f2fad37b1fd8caae7fbb50eb61a126287cf63eb | |
| parent | Merge pull request #3771 from benru/dump-romfs-with-updates (diff) | |
| download | yuzu-8bddc750e283b13da19f719be4671ee2c8230b8a.tar.gz yuzu-8bddc750e283b13da19f719be4671ee2c8230b8a.tar.xz yuzu-8bddc750e283b13da19f719be4671ee2c8230b8a.zip | |
am: IsVrModeEnabled & SetVrModeEnabled fixes
Return the proper state of vr mode for IsVrModeEnabled
We should not return an error for SetVrModeEnabled. When VR Mode is turned on, it signals to lbl to turn vr mode on, not return an error code
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 21 | ||||
| -rw-r--r-- | src/core/hle/service/am/am.h | 1 |
2 files changed, 6 insertions, 16 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 5695d2521..1eb990f8b 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -52,11 +52,6 @@ enum class LaunchParameterKind : u32 { | |||
| 52 | AccountPreselectedUser = 2, | 52 | AccountPreselectedUser = 2, |
| 53 | }; | 53 | }; |
| 54 | 54 | ||
| 55 | enum class VrMode : u8 { | ||
| 56 | Disabled = 0, | ||
| 57 | Enabled = 1, | ||
| 58 | }; | ||
| 59 | |||
| 60 | constexpr u32 LAUNCH_PARAMETER_ACCOUNT_PRESELECTED_USER_MAGIC = 0xC79497CA; | 55 | constexpr u32 LAUNCH_PARAMETER_ACCOUNT_PRESELECTED_USER_MAGIC = 0xC79497CA; |
| 61 | 56 | ||
| 62 | struct LaunchParameterAccountPreselectedUser { | 57 | struct LaunchParameterAccountPreselectedUser { |
| @@ -685,27 +680,21 @@ void ICommonStateGetter::GetCurrentFocusState(Kernel::HLERequestContext& ctx) { | |||
| 685 | } | 680 | } |
| 686 | 681 | ||
| 687 | void ICommonStateGetter::IsVrModeEnabled(Kernel::HLERequestContext& ctx) { | 682 | void ICommonStateGetter::IsVrModeEnabled(Kernel::HLERequestContext& ctx) { |
| 688 | LOG_WARNING(Service_AM, "(STUBBED) called"); | 683 | LOG_DEBUG(Service_AM, "called"); |
| 689 | 684 | ||
| 690 | IPC::ResponseBuilder rb{ctx, 3}; | 685 | IPC::ResponseBuilder rb{ctx, 3}; |
| 691 | rb.Push(RESULT_SUCCESS); | 686 | rb.Push(RESULT_SUCCESS); |
| 692 | rb.PushEnum(VrMode::Disabled); | 687 | rb.Push(vr_mode_state); |
| 693 | } | 688 | } |
| 694 | 689 | ||
| 695 | void ICommonStateGetter::SetVrModeEnabled(Kernel::HLERequestContext& ctx) { | 690 | void ICommonStateGetter::SetVrModeEnabled(Kernel::HLERequestContext& ctx) { |
| 696 | IPC::RequestParser rp{ctx}; | 691 | IPC::RequestParser rp{ctx}; |
| 697 | const auto is_vr_mode_enabled = rp.Pop<bool>(); | 692 | vr_mode_state = rp.Pop<bool>(); |
| 698 | 693 | ||
| 699 | LOG_WARNING(Service_AM, "(STUBBED) called. is_vr_mode_enabled={}", is_vr_mode_enabled); | 694 | LOG_WARNING(Service_AM, "VR Mode is {}", vr_mode_state ? "on" : "off"); |
| 700 | 695 | ||
| 701 | IPC::ResponseBuilder rb{ctx, 2}; | 696 | IPC::ResponseBuilder rb{ctx, 2}; |
| 702 | if (!is_vr_mode_enabled) { | 697 | rb.Push(RESULT_SUCCESS); |
| 703 | rb.Push(RESULT_SUCCESS); | ||
| 704 | } else { | ||
| 705 | // TODO: Find better error code for this | ||
| 706 | UNIMPLEMENTED_MSG("is_vr_mode_enabled={}", is_vr_mode_enabled); | ||
| 707 | rb.Push(RESULT_UNKNOWN); | ||
| 708 | } | ||
| 709 | } | 698 | } |
| 710 | 699 | ||
| 711 | void ICommonStateGetter::SetLcdBacklighOffEnabled(Kernel::HLERequestContext& ctx) { | 700 | void ICommonStateGetter::SetLcdBacklighOffEnabled(Kernel::HLERequestContext& ctx) { |
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index 53cfce10f..25eb13ce0 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h | |||
| @@ -191,6 +191,7 @@ private: | |||
| 191 | 191 | ||
| 192 | Core::System& system; | 192 | Core::System& system; |
| 193 | std::shared_ptr<AppletMessageQueue> msg_queue; | 193 | std::shared_ptr<AppletMessageQueue> msg_queue; |
| 194 | bool vr_mode_state{}; | ||
| 194 | }; | 195 | }; |
| 195 | 196 | ||
| 196 | class IStorageImpl { | 197 | class IStorageImpl { |