summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2019-01-02 21:51:20 -0500
committerGravatar GitHub2019-01-02 21:51:20 -0500
commit2c0f831468961826f5264c8fc4b4a21ffb1de87c (patch)
tree466edda0ba6c33390b4becfd20ff9a42a60aaa88 /src
parentMerge pull request #1978 from lioncash/enabled (diff)
parentservice/vi: Implement OpenDefaultDisplay in terms of OpenDisplay (diff)
downloadyuzu-2c0f831468961826f5264c8fc4b4a21ffb1de87c.tar.gz
yuzu-2c0f831468961826f5264c8fc4b4a21ffb1de87c.tar.xz
yuzu-2c0f831468961826f5264c8fc4b4a21ffb1de87c.zip
Merge pull request #1976 from lioncash/display
service/vi: Implement OpenDefaultDisplay in terms of OpenDisplay
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/vi/vi.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp
index ecfec9995..a3b8cec72 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -899,10 +899,23 @@ private:
899 LOG_WARNING(Service_VI, "(STUBBED) called"); 899 LOG_WARNING(Service_VI, "(STUBBED) called");
900 900
901 IPC::RequestParser rp{ctx}; 901 IPC::RequestParser rp{ctx};
902 auto name_buf = rp.PopRaw<std::array<u8, 0x40>>(); 902 const auto name_buf = rp.PopRaw<std::array<char, 0x40>>();
903 auto end = std::find(name_buf.begin(), name_buf.end(), '\0');
904 903
905 std::string name(name_buf.begin(), end); 904 OpenDisplayImpl(ctx, std::string_view{name_buf.data(), name_buf.size()});
905 }
906
907 void OpenDefaultDisplay(Kernel::HLERequestContext& ctx) {
908 LOG_DEBUG(Service_VI, "called");
909
910 OpenDisplayImpl(ctx, "Default");
911 }
912
913 void OpenDisplayImpl(Kernel::HLERequestContext& ctx, std::string_view name) {
914 const auto trim_pos = name.find('\0');
915
916 if (trim_pos != std::string_view::npos) {
917 name.remove_suffix(name.size() - trim_pos);
918 }
906 919
907 ASSERT_MSG(name == "Default", "Non-default displays aren't supported yet"); 920 ASSERT_MSG(name == "Default", "Non-default displays aren't supported yet");
908 921
@@ -1103,7 +1116,7 @@ IApplicationDisplayService::IApplicationDisplayService(
1103 "GetIndirectDisplayTransactionService"}, 1116 "GetIndirectDisplayTransactionService"},
1104 {1000, &IApplicationDisplayService::ListDisplays, "ListDisplays"}, 1117 {1000, &IApplicationDisplayService::ListDisplays, "ListDisplays"},
1105 {1010, &IApplicationDisplayService::OpenDisplay, "OpenDisplay"}, 1118 {1010, &IApplicationDisplayService::OpenDisplay, "OpenDisplay"},
1106 {1011, nullptr, "OpenDefaultDisplay"}, 1119 {1011, &IApplicationDisplayService::OpenDefaultDisplay, "OpenDefaultDisplay"},
1107 {1020, &IApplicationDisplayService::CloseDisplay, "CloseDisplay"}, 1120 {1020, &IApplicationDisplayService::CloseDisplay, "CloseDisplay"},
1108 {1101, &IApplicationDisplayService::SetDisplayEnabled, "SetDisplayEnabled"}, 1121 {1101, &IApplicationDisplayService::SetDisplayEnabled, "SetDisplayEnabled"},
1109 {1102, &IApplicationDisplayService::GetDisplayResolution, "GetDisplayResolution"}, 1122 {1102, &IApplicationDisplayService::GetDisplayResolution, "GetDisplayResolution"},