Vi: Correct mapping order
This commit is contained in:
parent
86ec7b98b7
commit
11db719960
2 changed files with 48 additions and 5 deletions
|
@ -6,6 +6,7 @@ using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
|
using static Ryujinx.HLE.HOS.ErrorCode;
|
||||||
using static Ryujinx.HLE.HOS.Services.Android.Parcel;
|
using static Ryujinx.HLE.HOS.Services.Android.Parcel;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Vi
|
namespace Ryujinx.HLE.HOS.Services.Vi
|
||||||
|
@ -177,17 +178,35 @@ namespace Ryujinx.HLE.HOS.Services.Vi
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private long ConvertScalingMode(ServiceCtx context)
|
public long ConvertScalingMode(ServiceCtx context)
|
||||||
{
|
{
|
||||||
int scalingMode = context.RequestData.ReadInt32();
|
SrcScalingMode scalingMode = (SrcScalingMode)context.RequestData.ReadInt32();
|
||||||
|
DstScalingMode? destScalingMode = ConvetScalingModeImpl(scalingMode);
|
||||||
|
|
||||||
// Currently, the "source" scaling mode is mapped 1:1
|
if (!destScalingMode.HasValue)
|
||||||
// to the "target" scaling mode.
|
{
|
||||||
context.ResponseData.Write((ulong)scalingMode);
|
return MakeError(ErrorModule.Vi, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
context.ResponseData.Write((ulong)destScalingMode);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private DstScalingMode? ConvetScalingModeImpl(SrcScalingMode srcScalingMode)
|
||||||
|
{
|
||||||
|
switch (srcScalingMode)
|
||||||
|
{
|
||||||
|
case SrcScalingMode.None: return DstScalingMode.None;
|
||||||
|
case SrcScalingMode.Freeze: return DstScalingMode.Freeze;
|
||||||
|
case SrcScalingMode.ScaleAndCrop: return DstScalingMode.ScaleAndCrop;
|
||||||
|
case SrcScalingMode.ScaleToWindow: return DstScalingMode.ScaleToWindow;
|
||||||
|
case SrcScalingMode.PreserveAspectRatio: return DstScalingMode.PreserveAspectRatio;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public long GetDisplayVSyncEvent(ServiceCtx context)
|
public long GetDisplayVSyncEvent(ServiceCtx context)
|
||||||
{
|
{
|
||||||
string name = GetDisplayName(context);
|
string name = GetDisplayName(context);
|
||||||
|
|
24
Ryujinx.HLE/HOS/Services/Vi/ScalingMode.cs
Normal file
24
Ryujinx.HLE/HOS/Services/Vi/ScalingMode.cs
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Ryujinx.HLE.HOS.Services.Vi
|
||||||
|
{
|
||||||
|
enum SrcScalingMode
|
||||||
|
{
|
||||||
|
Freeze = 0,
|
||||||
|
ScaleToWindow = 1,
|
||||||
|
ScaleAndCrop = 2,
|
||||||
|
None = 3,
|
||||||
|
PreserveAspectRatio = 4
|
||||||
|
}
|
||||||
|
|
||||||
|
enum DstScalingMode
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
Freeze = 1,
|
||||||
|
ScaleToWindow = 2,
|
||||||
|
ScaleAndCrop = 3,
|
||||||
|
PreserveAspectRatio = 4
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue