From 305f06eb71a7832e6b0081a67015b66ced8a23cd Mon Sep 17 00:00:00 2001 From: Mary Date: Sat, 24 Apr 2021 12:16:01 +0200 Subject: 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 --- .../Services/Caps/IScreenShotApplicationService.cs | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'Ryujinx.HLE/HOS/Services/Caps/IScreenShotApplicationService.cs') diff --git a/Ryujinx.HLE/HOS/Services/Caps/IScreenShotApplicationService.cs b/Ryujinx.HLE/HOS/Services/Caps/IScreenShotApplicationService.cs index b907ff35..1789122e 100644 --- a/Ryujinx.HLE/HOS/Services/Caps/IScreenShotApplicationService.cs +++ b/Ryujinx.HLE/HOS/Services/Caps/IScreenShotApplicationService.cs @@ -26,10 +26,10 @@ namespace Ryujinx.HLE.HOS.Services.Caps ulong appletResourceUserId = context.RequestData.ReadUInt64(); ulong pidPlaceholder = context.RequestData.ReadUInt64(); - long screenshotDataPosition = context.Request.SendBuff[0].Position; - long screenshotDataSize = context.Request.SendBuff[0].Size; + ulong screenshotDataPosition = context.Request.SendBuff[0].Position; + ulong screenshotDataSize = context.Request.SendBuff[0].Size; - byte[] screenshotData = context.Memory.GetSpan((ulong)screenshotDataPosition, (int)screenshotDataSize, true).ToArray(); + byte[] screenshotData = context.Memory.GetSpan(screenshotDataPosition, (int)screenshotDataSize, true).ToArray(); ResultCode resultCode = context.Device.System.CaptureManager.SaveScreenShot(screenshotData, appletResourceUserId, context.Device.Application.TitleId, out ApplicationAlbumEntry applicationAlbumEntry); @@ -49,16 +49,16 @@ namespace Ryujinx.HLE.HOS.Services.Caps ulong appletResourceUserId = context.RequestData.ReadUInt64(); ulong pidPlaceholder = context.RequestData.ReadUInt64(); - long applicationDataPosition = context.Request.SendBuff[0].Position; - long applicationDataSize = context.Request.SendBuff[0].Size; + ulong applicationDataPosition = context.Request.SendBuff[0].Position; + ulong applicationDataSize = context.Request.SendBuff[0].Size; - long screenshotDataPosition = context.Request.SendBuff[1].Position; - long screenshotDataSize = context.Request.SendBuff[1].Size; + ulong screenshotDataPosition = context.Request.SendBuff[1].Position; + ulong screenshotDataSize = context.Request.SendBuff[1].Size; // TODO: Parse the application data: At 0x00 it's UserData (Size of 0x400), at 0x404 it's a uint UserDataSize (Always empty for now). - byte[] applicationData = context.Memory.GetSpan((ulong)applicationDataPosition, (int)applicationDataSize).ToArray(); + byte[] applicationData = context.Memory.GetSpan(applicationDataPosition, (int)applicationDataSize).ToArray(); - byte[] screenshotData = context.Memory.GetSpan((ulong)screenshotDataPosition, (int)screenshotDataSize, true).ToArray(); + byte[] screenshotData = context.Memory.GetSpan(screenshotDataPosition, (int)screenshotDataSize, true).ToArray(); ResultCode resultCode = context.Device.System.CaptureManager.SaveScreenShot(screenshotData, appletResourceUserId, context.Device.Application.TitleId, out ApplicationAlbumEntry applicationAlbumEntry); @@ -77,16 +77,16 @@ namespace Ryujinx.HLE.HOS.Services.Caps uint unknown = context.RequestData.ReadUInt32(); ulong appletResourceUserId = context.RequestData.ReadUInt64(); - long userIdListPosition = context.Request.SendBuff[0].Position; - long userIdListSize = context.Request.SendBuff[0].Size; + ulong userIdListPosition = context.Request.SendBuff[0].Position; + ulong userIdListSize = context.Request.SendBuff[0].Size; - long screenshotDataPosition = context.Request.SendBuff[1].Position; - long screenshotDataSize = context.Request.SendBuff[1].Size; + ulong screenshotDataPosition = context.Request.SendBuff[1].Position; + ulong screenshotDataSize = context.Request.SendBuff[1].Size; // TODO: Parse the UserIdList. - byte[] userIdList = context.Memory.GetSpan((ulong)userIdListPosition, (int)userIdListSize).ToArray(); + byte[] userIdList = context.Memory.GetSpan(userIdListPosition, (int)userIdListSize).ToArray(); - byte[] screenshotData = context.Memory.GetSpan((ulong)screenshotDataPosition, (int)screenshotDataSize, true).ToArray(); + byte[] screenshotData = context.Memory.GetSpan(screenshotDataPosition, (int)screenshotDataSize, true).ToArray(); ResultCode resultCode = context.Device.System.CaptureManager.SaveScreenShot(screenshotData, appletResourceUserId, context.Device.Application.TitleId, out ApplicationAlbumEntry applicationAlbumEntry); -- cgit v1.2.3