Move solution and projects to src

This commit is contained in:
TSR Berry
2023-04-27 23:51:14 +02:00
committed by Mary
parent cd124bda58
commit cee7121058
3466 changed files with 55 additions and 55 deletions
@@ -0,0 +1,19 @@
namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService
{
static class AndroidSurfaceComposerClient
{
// NOTE: This is android::SurfaceComposerClient::getDisplayInfo.
public static (ulong, ulong) GetDisplayInfo(ServiceCtx context, ulong displayId = 0)
{
// TODO: This need to be REd, it should returns the driver resolution and more.
if (context.Device.System.State.DockedMode)
{
return (1920, 1080);
}
else
{
return (1280, 720);
}
}
}
}
@@ -0,0 +1,80 @@
using Ryujinx.Common.Logging;
namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService
{
class IManagerDisplayService : IpcService
{
private IApplicationDisplayService _applicationDisplayService;
public IManagerDisplayService(IApplicationDisplayService applicationDisplayService)
{
_applicationDisplayService = applicationDisplayService;
}
[CommandCmif(1102)]
// GetDisplayResolution(u64 display_id) -> (u64 width, u64 height)
public ResultCode GetDisplayResolution(ServiceCtx context)
{
ulong displayId = context.RequestData.ReadUInt64();
(ulong width, ulong height) = AndroidSurfaceComposerClient.GetDisplayInfo(context, displayId);
context.ResponseData.Write(width);
context.ResponseData.Write(height);
return ResultCode.Success;
}
[CommandCmif(2010)]
// CreateManagedLayer(u32, u64, nn::applet::AppletResourceUserId) -> u64
public ResultCode CreateManagedLayer(ServiceCtx context)
{
long layerFlags = context.RequestData.ReadInt64();
long displayId = context.RequestData.ReadInt64();
long appletResourceUserId = context.RequestData.ReadInt64();
ulong pid = context.Device.System.AppletState.AppletResourceUserIds.GetData<ulong>((int)appletResourceUserId);
context.Device.System.SurfaceFlinger.CreateLayer(out long layerId, pid);
context.Device.System.SurfaceFlinger.SetRenderLayer(layerId);
context.ResponseData.Write(layerId);
return ResultCode.Success;
}
[CommandCmif(2011)]
// DestroyManagedLayer(u64)
public ResultCode DestroyManagedLayer(ServiceCtx context)
{
long layerId = context.RequestData.ReadInt64();
return context.Device.System.SurfaceFlinger.DestroyManagedLayer(layerId);
}
[CommandCmif(2012)] // 7.0.0+
// CreateStrayLayer(u32, u64) -> (u64, u64, buffer<bytes, 6>)
public ResultCode CreateStrayLayer(ServiceCtx context)
{
return _applicationDisplayService.CreateStrayLayer(context);
}
[CommandCmif(6000)]
// AddToLayerStack(u32, u64)
public ResultCode AddToLayerStack(ServiceCtx context)
{
Logger.Stub?.PrintStub(LogClass.ServiceVi);
return ResultCode.Success;
}
[CommandCmif(6002)]
// SetLayerVisibility(b8, u64)
public ResultCode SetLayerVisibility(ServiceCtx context)
{
Logger.Stub?.PrintStub(LogClass.ServiceVi);
return ResultCode.Success;
}
}
}
@@ -0,0 +1,59 @@
using Ryujinx.Common.Logging;
namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService
{
class ISystemDisplayService : IpcService
{
private IApplicationDisplayService _applicationDisplayService;
public ISystemDisplayService(IApplicationDisplayService applicationDisplayService)
{
_applicationDisplayService = applicationDisplayService;
}
[CommandCmif(2205)]
// SetLayerZ(u64, u64)
public ResultCode SetLayerZ(ServiceCtx context)
{
Logger.Stub?.PrintStub(LogClass.ServiceVi);
return ResultCode.Success;
}
[CommandCmif(2207)]
// SetLayerVisibility(b8, u64)
public ResultCode SetLayerVisibility(ServiceCtx context)
{
Logger.Stub?.PrintStub(LogClass.ServiceVi);
return ResultCode.Success;
}
[CommandCmif(2312)] // 1.0.0-6.2.0
// CreateStrayLayer(u32, u64) -> (u64, u64, buffer<bytes, 6>)
public ResultCode CreateStrayLayer(ServiceCtx context)
{
Logger.Stub?.PrintStub(LogClass.ServiceVi);
return _applicationDisplayService.CreateStrayLayer(context);
}
[CommandCmif(3200)]
// GetDisplayMode(u64) -> nn::vi::DisplayModeInfo
public ResultCode GetDisplayMode(ServiceCtx context)
{
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;
}
}
}
@@ -0,0 +1,11 @@
namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService
{
enum DestinationScalingMode
{
Freeze,
ScaleToWindow,
ScaleAndCrop,
None,
PreserveAspectRatio
}
}
@@ -0,0 +1,16 @@
using Ryujinx.Common.Memory;
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService.Types
{
[StructLayout(LayoutKind.Sequential, Size = 0x60)]
struct DisplayInfo
{
public Array64<byte> Name;
public bool LayerLimitEnabled;
public Array7<byte> Padding;
public ulong LayerLimitMax;
public ulong Width;
public ulong Height;
}
}
@@ -0,0 +1,11 @@
namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService
{
enum SourceScalingMode
{
None,
Freeze,
ScaleToWindow,
ScaleAndCrop,
PreserveAspectRatio
}
}