mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-14 10:52:45 +01:00
Merge pull request #1976 from lioncash/display
service/vi: Implement OpenDefaultDisplay in terms of OpenDisplay
This commit is contained in:
commit
2c0f831468
1 changed files with 17 additions and 4 deletions
|
@ -899,10 +899,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>>();
|
||||
|
||||
std::string name(name_buf.begin(), end);
|
||||
OpenDisplayImpl(ctx, std::string_view{name_buf.data(), name_buf.size()});
|
||||
}
|
||||
|
||||
void OpenDefaultDisplay(Kernel::HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_VI, "called");
|
||||
|
||||
OpenDisplayImpl(ctx, "Default");
|
||||
}
|
||||
|
||||
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");
|
||||
|
||||
|
@ -1103,7 +1116,7 @@ IApplicationDisplayService::IApplicationDisplayService(
|
|||
"GetIndirectDisplayTransactionService"},
|
||||
{1000, &IApplicationDisplayService::ListDisplays, "ListDisplays"},
|
||||
{1010, &IApplicationDisplayService::OpenDisplay, "OpenDisplay"},
|
||||
{1011, nullptr, "OpenDefaultDisplay"},
|
||||
{1011, &IApplicationDisplayService::OpenDefaultDisplay, "OpenDefaultDisplay"},
|
||||
{1020, &IApplicationDisplayService::CloseDisplay, "CloseDisplay"},
|
||||
{1101, &IApplicationDisplayService::SetDisplayEnabled, "SetDisplayEnabled"},
|
||||
{1102, &IApplicationDisplayService::GetDisplayResolution, "GetDisplayResolution"},
|
||||
|
|
Loading…
Reference in a new issue