From 40d1acd1982705224413bc882f6ae25d4bf8ee1a Mon Sep 17 00:00:00 2001 From: Ac_K Date: Sun, 19 Sep 2021 12:57:39 +0200 Subject: vi: Unify resolutions values and accurate implementation of them. (#2640) * vi: Unify resolutions values and accurate implementation of them. To continue what was made in #2618, I've REd `vi` service a bit. Now values and checks related to displays are more accurate. - `am` GetDefaultDisplayResolution / GetDefaultDisplayResolutionChangeEvent have more informations on what the service does. - `vi:u/vi:m/vi:s` GetDisplayService are now accurate. - `IApplicationDisplay` GetRelayService, GetSystemDisplayService, GetManagerDisplayService, GetIndirectDisplayTransactionService, ListDisplays, OpenDisplay, OpenDefaultDisplay, CloseDisplay, GetDisplayResolution are now properly implemented. - Some other calls are cleaned or have extra checks accordingly to RE. Additionnaly, `IFriendService` have some wrong aligned things, and `pm:info` service placeholder was missing. * just use _openedDisplayInfo.Remove() * use context.Memory.Fill() * fix some casting * remove unneeded comment * cleanup * uses TryAdd * displayId > ulong * GetDisplayResolution > ulong * UL --- .../ApplicationDisplayService/ISystemDisplayService.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/ISystemDisplayService.cs') diff --git a/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/ISystemDisplayService.cs b/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/ISystemDisplayService.cs index e82099b1..82dd6af6 100644 --- a/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/ISystemDisplayService.cs +++ b/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/ISystemDisplayService.cs @@ -42,12 +42,17 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService // GetDisplayMode(u64) -> nn::vi::DisplayModeInfo public ResultCode GetDisplayMode(ServiceCtx context) { - // TODO: De-hardcode resolution. - context.ResponseData.Write(1280); - context.ResponseData.Write(720); + ulong displayId = context.RequestData.ReadUInt64(); + + (ulong width, ulong height) = AndroidSurfaceComposerClient.GetDisplayInfo(context, displayId); + + context.ResponseData.Write((uint)width); + context.ResponseData.Write((uint)height); context.ResponseData.Write(60.0f); context.ResponseData.Write(0); + Logger.Stub?.PrintStub(LogClass.ServiceVi); + return ResultCode.Success; } } -- cgit v1.2.3