diff options
| author | 2018-04-02 23:28:45 -0400 | |
|---|---|---|
| committer | 2018-04-02 23:50:59 -0400 | |
| commit | 9d08a11c1deb80843dd9996a3df17f6da2ec401e (patch) | |
| tree | 5b088949f896b90860743b528d8e0020d6bf0389 /src | |
| parent | shared_memory: Remove incorrect 3ds-specific check. (diff) | |
| download | yuzu-9d08a11c1deb80843dd9996a3df17f6da2ec401e.tar.gz yuzu-9d08a11c1deb80843dd9996a3df17f6da2ec401e.tar.xz yuzu-9d08a11c1deb80843dd9996a3df17f6da2ec401e.zip | |
vi: Implement GetDisplayResolution.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/vi/vi.cpp | 19 | ||||
| -rw-r--r-- | src/core/hle/service/vi/vi.h | 7 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index 06c34e979..42793f155 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include "core/hle/service/vi/vi_m.h" | 17 | #include "core/hle/service/vi/vi_m.h" |
| 18 | #include "core/hle/service/vi/vi_s.h" | 18 | #include "core/hle/service/vi/vi_s.h" |
| 19 | #include "core/hle/service/vi/vi_u.h" | 19 | #include "core/hle/service/vi/vi_u.h" |
| 20 | #include "core/settings.h" | ||
| 20 | #include "video_core/renderer_base.h" | 21 | #include "video_core/renderer_base.h" |
| 21 | #include "video_core/video_core.h" | 22 | #include "video_core/video_core.h" |
| 22 | 23 | ||
| @@ -711,6 +712,23 @@ private: | |||
| 711 | rb.Push(RESULT_SUCCESS); | 712 | rb.Push(RESULT_SUCCESS); |
| 712 | } | 713 | } |
| 713 | 714 | ||
| 715 | void GetDisplayResolution(Kernel::HLERequestContext& ctx) { | ||
| 716 | LOG_WARNING(Service_VI, "(STUBBED) called"); | ||
| 717 | IPC::RequestParser rp{ctx}; | ||
| 718 | u64 display_id = rp.Pop<u64>(); | ||
| 719 | |||
| 720 | IPC::ResponseBuilder rb = rp.MakeBuilder(6, 0, 0); | ||
| 721 | rb.Push(RESULT_SUCCESS); | ||
| 722 | |||
| 723 | if (Settings::values.use_docked_mode) { | ||
| 724 | rb.Push(static_cast<u32>(DisplayResolution::DockedWidth)); | ||
| 725 | rb.Push(static_cast<u32>(DisplayResolution::DockedHeight)); | ||
| 726 | } else { | ||
| 727 | rb.Push(static_cast<u32>(DisplayResolution::UndockedWidth)); | ||
| 728 | rb.Push(static_cast<u32>(DisplayResolution::UndockedHeight)); | ||
| 729 | } | ||
| 730 | } | ||
| 731 | |||
| 714 | void SetLayerScalingMode(Kernel::HLERequestContext& ctx) { | 732 | void SetLayerScalingMode(Kernel::HLERequestContext& ctx) { |
| 715 | LOG_WARNING(Service_VI, "(STUBBED) called"); | 733 | LOG_WARNING(Service_VI, "(STUBBED) called"); |
| 716 | IPC::RequestParser rp{ctx}; | 734 | IPC::RequestParser rp{ctx}; |
| @@ -808,6 +826,7 @@ IApplicationDisplayService::IApplicationDisplayService( | |||
| 808 | {1000, &IApplicationDisplayService::ListDisplays, "ListDisplays"}, | 826 | {1000, &IApplicationDisplayService::ListDisplays, "ListDisplays"}, |
| 809 | {1010, &IApplicationDisplayService::OpenDisplay, "OpenDisplay"}, | 827 | {1010, &IApplicationDisplayService::OpenDisplay, "OpenDisplay"}, |
| 810 | {1020, &IApplicationDisplayService::CloseDisplay, "CloseDisplay"}, | 828 | {1020, &IApplicationDisplayService::CloseDisplay, "CloseDisplay"}, |
| 829 | {1102, &IApplicationDisplayService::GetDisplayResolution, "GetDisplayResolution"}, | ||
| 811 | {2101, &IApplicationDisplayService::SetLayerScalingMode, "SetLayerScalingMode"}, | 830 | {2101, &IApplicationDisplayService::SetLayerScalingMode, "SetLayerScalingMode"}, |
| 812 | {2020, &IApplicationDisplayService::OpenLayer, "OpenLayer"}, | 831 | {2020, &IApplicationDisplayService::OpenLayer, "OpenLayer"}, |
| 813 | {2030, &IApplicationDisplayService::CreateStrayLayer, "CreateStrayLayer"}, | 832 | {2030, &IApplicationDisplayService::CreateStrayLayer, "CreateStrayLayer"}, |
diff --git a/src/core/hle/service/vi/vi.h b/src/core/hle/service/vi/vi.h index 985c9d27c..7f16fad8e 100644 --- a/src/core/hle/service/vi/vi.h +++ b/src/core/hle/service/vi/vi.h | |||
| @@ -14,6 +14,13 @@ struct EventType; | |||
| 14 | namespace Service { | 14 | namespace Service { |
| 15 | namespace VI { | 15 | namespace VI { |
| 16 | 16 | ||
| 17 | enum class DisplayResolution : u32 { | ||
| 18 | DockedWidth = 1920, | ||
| 19 | DockedHeight = 1080, | ||
| 20 | UndockedWidth = 1280, | ||
| 21 | UndockedHeight = 720, | ||
| 22 | }; | ||
| 23 | |||
| 17 | class Module final { | 24 | class Module final { |
| 18 | public: | 25 | public: |
| 19 | class Interface : public ServiceFramework<Interface> { | 26 | class Interface : public ServiceFramework<Interface> { |