From 51d1f519afdd42d23de88f28ab88a3034042e9c6 Mon Sep 17 00:00:00 2001 From: Dima Date: Sun, 27 Nov 2022 14:03:20 +0300 Subject: [PATCH] Stub ListDisplays --- .../services/visrv/IApplicationDisplayService.cpp | 15 +++++++++++++++ .../services/visrv/IApplicationDisplayService.h | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/app/src/main/cpp/skyline/services/visrv/IApplicationDisplayService.cpp b/app/src/main/cpp/skyline/services/visrv/IApplicationDisplayService.cpp index 665b1bcf..8e1c68b8 100644 --- a/app/src/main/cpp/skyline/services/visrv/IApplicationDisplayService.cpp +++ b/app/src/main/cpp/skyline/services/visrv/IApplicationDisplayService.cpp @@ -40,6 +40,21 @@ namespace skyline::service::visrv { return {}; } + Result IApplicationDisplayService::ListDisplays(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { + struct DisplayInfo { + std::array displayName{"Default"}; + u8 hasLimitedLayers{1}; + u8 pad[7]; + u64 maxLayers{1}; + u64 width{1920}; + u64 height{1080}; + } displayInfo; + + request.outputBuf.at(0).as() = displayInfo; + response.Push(1); + return {}; + } + Result IApplicationDisplayService::OpenDisplay(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) { auto displayName(request.PopString()); Logger::Debug("Opening display: {}", displayName); diff --git a/app/src/main/cpp/skyline/services/visrv/IApplicationDisplayService.h b/app/src/main/cpp/skyline/services/visrv/IApplicationDisplayService.h index 090a7e99..cba171b7 100644 --- a/app/src/main/cpp/skyline/services/visrv/IApplicationDisplayService.h +++ b/app/src/main/cpp/skyline/services/visrv/IApplicationDisplayService.h @@ -53,6 +53,11 @@ namespace skyline::service::visrv { */ Result GetManagerDisplayService(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + /** + * @url https://switchbrew.org/wiki/Display_services#ListDisplays + */ + Result ListDisplays(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response); + /** * @brief Opens up a display using its name as the input * @url https://switchbrew.org/wiki/Display_services#OpenDisplay @@ -99,6 +104,7 @@ namespace skyline::service::visrv { SFUNC(0x65, IApplicationDisplayService, GetSystemDisplayService), SFUNC(0x66, IApplicationDisplayService, GetManagerDisplayService), SFUNC(0x67, IApplicationDisplayService, GetIndirectDisplayTransactionService), + SFUNC(0x3E8, IApplicationDisplayService, ListDisplays), SFUNC(0x3F2, IApplicationDisplayService, OpenDisplay), SFUNC(0x3FC, IApplicationDisplayService, CloseDisplay), SFUNC(0x7E4, IApplicationDisplayService, OpenLayer),