summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2019-01-02 18:05:15 -0500
committerGravatar Lioncash2019-01-02 18:16:36 -0500
commitdea1db0414ae1810ef0a050bbd0958310418aad3 (patch)
treea4026d64f91ecc18f802b75325f30c0ad291bc04 /src
parentMerge pull request #1966 from lioncash/backtrace (diff)
downloadyuzu-dea1db0414ae1810ef0a050bbd0958310418aad3.tar.gz
yuzu-dea1db0414ae1810ef0a050bbd0958310418aad3.tar.xz
yuzu-dea1db0414ae1810ef0a050bbd0958310418aad3.zip
service/vi: Implement OpenDefaultDisplay in terms of OpenDisplay
Internally within the vi services, this is essentially all that OpenDefaultDisplay does, so it's trivial to just do the same, and forward the default display string into the function.
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 311b0c765..e7bbcfbac 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -888,10 +888,23 @@ private:
888 LOG_WARNING(Service_VI, "(STUBBED) called"); 888 LOG_WARNING(Service_VI, "(STUBBED) called");
889 889
890 IPC::RequestParser rp{ctx}; 890 IPC::RequestParser rp{ctx};
891 auto name_buf = rp.PopRaw<std::array<u8, 0x40>>(); 891 const auto name_buf = rp.PopRaw<std::array<char, 0x40>>();
892 auto end = std::find(name_buf.begin(), name_buf.end(), '\0'); 892
893 OpenDisplayImpl(ctx, std::string_view{name_buf.data(), name_buf.size()});
894 }
895
896 void OpenDefaultDisplay(Kernel::HLERequestContext& ctx) {
897 LOG_DEBUG(Service_VI, "called");
898
899 OpenDisplayImpl(ctx, "Default");
900 }
893 901
894 std::string name(name_buf.begin(), end); 902 void OpenDisplayImpl(Kernel::HLERequestContext& ctx, std::string_view name) {
903 const auto trim_pos = name.find('\0');
904
905 if (trim_pos != std::string_view::npos) {
906 name.remove_suffix(name.size() - trim_pos);
907 }
895 908
896 ASSERT_MSG(name == "Default", "Non-default displays aren't supported yet"); 909 ASSERT_MSG(name == "Default", "Non-default displays aren't supported yet");
897 910
@@ -1082,7 +1095,7 @@ IApplicationDisplayService::IApplicationDisplayService(
1082 "GetIndirectDisplayTransactionService"}, 1095 "GetIndirectDisplayTransactionService"},
1083 {1000, &IApplicationDisplayService::ListDisplays, "ListDisplays"}, 1096 {1000, &IApplicationDisplayService::ListDisplays, "ListDisplays"},
1084 {1010, &IApplicationDisplayService::OpenDisplay, "OpenDisplay"}, 1097 {1010, &IApplicationDisplayService::OpenDisplay, "OpenDisplay"},
1085 {1011, nullptr, "OpenDefaultDisplay"}, 1098 {1011, &IApplicationDisplayService::OpenDefaultDisplay, "OpenDefaultDisplay"},
1086 {1020, &IApplicationDisplayService::CloseDisplay, "CloseDisplay"}, 1099 {1020, &IApplicationDisplayService::CloseDisplay, "CloseDisplay"},
1087 {1101, nullptr, "SetDisplayEnabled"}, 1100 {1101, nullptr, "SetDisplayEnabled"},
1088 {1102, &IApplicationDisplayService::GetDisplayResolution, "GetDisplayResolution"}, 1101 {1102, &IApplicationDisplayService::GetDisplayResolution, "GetDisplayResolution"},