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 --- .../Friend/ServiceCreator/IFriendService.cs | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'Ryujinx.HLE/HOS/Services/Friend/ServiceCreator') diff --git a/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs b/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs index 83b81e00..a2865e9c 100644 --- a/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs +++ b/Ryujinx.HLE/HOS/Services/Friend/ServiceCreator/IFriendService.cs @@ -184,12 +184,12 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator // Pid placeholder context.RequestData.ReadInt64(); - long position = context.Request.PtrBuff[0].Position; - long size = context.Request.PtrBuff[0].Size; + ulong position = context.Request.PtrBuff[0].Position; + ulong size = context.Request.PtrBuff[0].Size; byte[] bufferContent = new byte[size]; - context.Memory.Read((ulong)position, bufferContent); + context.Memory.Read(position, bufferContent); if (uuid.IsNull) { @@ -215,9 +215,9 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator bool unknownBool = context.RequestData.ReadBoolean(); UserId userId = context.RequestData.ReadStruct(); - context.Response.PtrBuff[0] = context.Response.PtrBuff[0].WithSize(0x40L); + context.Response.PtrBuff[0] = context.Response.PtrBuff[0].WithSize(0x40UL); - long bufferPosition = context.Request.RecvListBuff[0].Position; + ulong bufferPosition = context.Request.RecvListBuff[0].Position; if (userId.IsNull) { @@ -265,8 +265,8 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator */ - context.Memory.Write((ulong)bufferPosition, playHistoryRegistrationKeyBuffer); - context.Memory.Write((ulong)bufferPosition + 0x20, new byte[0x20]); // HmacHash + context.Memory.Write(bufferPosition, playHistoryRegistrationKeyBuffer); + context.Memory.Write(bufferPosition + 0x20, new byte[0x20]); // HmacHash return ResultCode.Success; } @@ -281,14 +281,14 @@ namespace Ryujinx.HLE.HOS.Services.Friend.ServiceCreator context.RequestData.ReadInt64(); long pid = context.Process.Pid; - long playHistoryRegistrationKeyPosition = context.Request.PtrBuff[0].Position; - long PlayHistoryRegistrationKeySize = context.Request.PtrBuff[0].Size; + ulong playHistoryRegistrationKeyPosition = context.Request.PtrBuff[0].Position; + ulong PlayHistoryRegistrationKeySize = context.Request.PtrBuff[0].Size; - long inAppScreenName1Position = context.Request.PtrBuff[1].Position; - long inAppScreenName1Size = context.Request.PtrBuff[1].Size; + ulong inAppScreenName1Position = context.Request.PtrBuff[1].Position; + ulong inAppScreenName1Size = context.Request.PtrBuff[1].Size; - long inAppScreenName2Position = context.Request.PtrBuff[2].Position; - long inAppScreenName2Size = context.Request.PtrBuff[2].Size; + ulong inAppScreenName2Position = context.Request.PtrBuff[2].Position; + ulong inAppScreenName2Size = context.Request.PtrBuff[2].Size; if (userId.IsNull || inAppScreenName1Size > 0x48 || inAppScreenName2Size > 0x48) { -- cgit v1.2.3