summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-01-03 00:05:15 +0100
committerLioncash <mathew1800@gmail.com>2019-01-03 00:16:36 +0100
commitdea1db0414ae1810ef0a050bbd0958310418aad3 (patch)
treea4026d64f91ecc18f802b75325f30c0ad291bc04 /src/core/hle/service
parentMerge pull request #1966 from lioncash/backtrace (diff)
downloadyuzu-dea1db0414ae1810ef0a050bbd0958310418aad3.tar
yuzu-dea1db0414ae1810ef0a050bbd0958310418aad3.tar.gz
yuzu-dea1db0414ae1810ef0a050bbd0958310418aad3.tar.bz2
yuzu-dea1db0414ae1810ef0a050bbd0958310418aad3.tar.lz
yuzu-dea1db0414ae1810ef0a050bbd0958310418aad3.tar.xz
yuzu-dea1db0414ae1810ef0a050bbd0958310418aad3.tar.zst
yuzu-dea1db0414ae1810ef0a050bbd0958310418aad3.zip
Diffstat (limited to 'src/core/hle/service')
-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:
LOG_WARNING(Service_VI, "(STUBBED) called");
IPC::RequestParser rp{ctx};
- auto name_buf = rp.PopRaw<std::array<u8, 0x40>>();
- auto end = std::find(name_buf.begin(), name_buf.end(), '\0');
+ const auto name_buf = rp.PopRaw<std::array<char, 0x40>>();
+
+ OpenDisplayImpl(ctx, std::string_view{name_buf.data(), name_buf.size()});
+ }
+
+ void OpenDefaultDisplay(Kernel::HLERequestContext& ctx) {
+ LOG_DEBUG(Service_VI, "called");
+
+ OpenDisplayImpl(ctx, "Default");
+ }
- std::string name(name_buf.begin(), end);
+ void OpenDisplayImpl(Kernel::HLERequestContext& ctx, std::string_view name) {
+ const auto trim_pos = name.find('\0');
+
+ if (trim_pos != std::string_view::npos) {
+ name.remove_suffix(name.size() - trim_pos);
+ }
ASSERT_MSG(name == "Default", "Non-default displays aren't supported yet");
@@ -1082,7 +1095,7 @@ IApplicationDisplayService::IApplicationDisplayService(
"GetIndirectDisplayTransactionService"},
{1000, &IApplicationDisplayService::ListDisplays, "ListDisplays"},
{1010, &IApplicationDisplayService::OpenDisplay, "OpenDisplay"},
- {1011, nullptr, "OpenDefaultDisplay"},
+ {1011, &IApplicationDisplayService::OpenDefaultDisplay, "OpenDefaultDisplay"},
{1020, &IApplicationDisplayService::CloseDisplay, "CloseDisplay"},
{1101, nullptr, "SetDisplayEnabled"},
{1102, &IApplicationDisplayService::GetDisplayResolution, "GetDisplayResolution"},