aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs
diff options
context:
space:
mode:
authorMary <me@thog.eu>2021-04-24 12:16:01 +0200
committerGitHub <noreply@github.com>2021-04-24 12:16:01 +0200
commit305f06eb71a7832e6b0081a67015b66ced8a23cd (patch)
tree98bcb3ed465332a04af449cb5c74bdca7855a141 /Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs
parentc46f6879ff9171a1e024965618242e8bad373b6b (diff)
HLE: Fix integer sign inconcistency accross the codebase (#2222)
* Make all title id instances unsigned * Replace address and size with ulong instead of signed types Long overdue change. Also change some logics here and there to optimize with the new memory manager. * Address Ac_K's comments * Remove uneeded cast all around * Fixes some others misalignment
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs')
-rw-r--r--Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs30
1 files changed, 15 insertions, 15 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs b/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs
index 37e603dc..5f161bee 100644
--- a/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs
+++ b/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs
@@ -61,16 +61,16 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService
// ListDisplays() -> (u64, buffer<nn::vi::DisplayInfo, 6>)
public ResultCode ListDisplays(ServiceCtx context)
{
- long recBuffPtr = context.Request.ReceiveBuff[0].Position;
+ ulong recBuffPtr = context.Request.ReceiveBuff[0].Position;
MemoryHelper.FillWithZeros(context.Memory, recBuffPtr, 0x60);
// Add only the default display to buffer
- context.Memory.Write((ulong)recBuffPtr, Encoding.ASCII.GetBytes("Default"));
- context.Memory.Write((ulong)recBuffPtr + 0x40, 0x1L);
- context.Memory.Write((ulong)recBuffPtr + 0x48, 0x1L);
- context.Memory.Write((ulong)recBuffPtr + 0x50, 1280L);
- context.Memory.Write((ulong)recBuffPtr + 0x58, 720L);
+ context.Memory.Write(recBuffPtr, Encoding.ASCII.GetBytes("Default"));
+ context.Memory.Write(recBuffPtr + 0x40, 0x1UL);
+ context.Memory.Write(recBuffPtr + 0x48, 0x1UL);
+ context.Memory.Write(recBuffPtr + 0x50, 1280UL);
+ context.Memory.Write(recBuffPtr + 0x58, 720UL);
context.ResponseData.Write(1L);
@@ -120,9 +120,9 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService
// TODO: support multi display.
byte[] displayName = context.RequestData.ReadBytes(0x40);
- long layerId = context.RequestData.ReadInt64();
- long userId = context.RequestData.ReadInt64();
- long parcelPtr = context.Request.ReceiveBuff[0].Position;
+ long layerId = context.RequestData.ReadInt64();
+ long userId = context.RequestData.ReadInt64();
+ ulong parcelPtr = context.Request.ReceiveBuff[0].Position;
IBinder producer = context.Device.System.SurfaceFlinger.OpenLayer(context.Request.HandleDesc.PId, layerId);
@@ -134,7 +134,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService
ReadOnlySpan<byte> parcelData = parcel.Finish();
- context.Memory.Write((ulong)parcelPtr, parcelData);
+ context.Memory.Write(parcelPtr, parcelData);
context.ResponseData.Write((long)parcelData.Length);
@@ -159,7 +159,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService
long layerFlags = context.RequestData.ReadInt64();
long displayId = context.RequestData.ReadInt64();
- long parcelPtr = context.Request.ReceiveBuff[0].Position;
+ ulong parcelPtr = context.Request.ReceiveBuff[0].Position;
// TODO: support multi display.
Display disp = _displays.GetData<Display>((int)displayId);
@@ -174,7 +174,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService
ReadOnlySpan<byte> parcelData = parcel.Finish();
- context.Memory.Write((ulong)parcelPtr, parcelData);
+ context.Memory.Write(parcelPtr, parcelData);
context.ResponseData.Write(layerId);
context.ResponseData.Write((long)parcelData.Length);
@@ -250,11 +250,11 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService
// The size of the layer buffer should be an aligned multiple of width * height
// because it was created using GetIndirectLayerImageRequiredMemoryInfo as a guide.
- long layerBuffPosition = context.Request.ReceiveBuff[0].Position;
- long layerBuffSize = context.Request.ReceiveBuff[0].Size;
+ ulong layerBuffPosition = context.Request.ReceiveBuff[0].Position;
+ ulong layerBuffSize = context.Request.ReceiveBuff[0].Size;
// Fill the layer with zeros.
- context.Memory.Fill((ulong)layerBuffPosition, (ulong)layerBuffSize, 0x00);
+ context.Memory.Fill(layerBuffPosition, layerBuffSize, 0x00);
Logger.Stub?.PrintStub(LogClass.ServiceVi);