aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Ro
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/Ro
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/Ro')
-rw-r--r--Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs16
-rw-r--r--Ryujinx.HLE/HOS/Services/Ro/Types/NrrInfo.cs4
2 files changed, 10 insertions, 10 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs b/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs
index c8277699..8070cf54 100644
--- a/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs
+++ b/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs
@@ -40,7 +40,7 @@ namespace Ryujinx.HLE.HOS.Services.Ro
_owner = null;
}
- private ResultCode ParseNrr(out NrrInfo nrrInfo, ServiceCtx context, long nrrAddress, long nrrSize)
+ private ResultCode ParseNrr(out NrrInfo nrrInfo, ServiceCtx context, ulong nrrAddress, ulong nrrSize)
{
nrrInfo = null;
@@ -71,12 +71,12 @@ namespace Ryujinx.HLE.HOS.Services.Ro
{
byte[] temp = new byte[0x20];
- _owner.CpuMemory.Read((ulong)(nrrAddress + header.HashOffset + (i * 0x20)), temp);
+ _owner.CpuMemory.Read(nrrAddress + header.HashOffset + (uint)(i * 0x20), temp);
hashes.Add(temp);
}
- nrrInfo = new NrrInfo(nrrAddress, header, hashes);
+ nrrInfo = new NrrInfo((ulong)nrrAddress, header, hashes);
return ResultCode.Success;
}
@@ -333,7 +333,7 @@ namespace Ryujinx.HLE.HOS.Services.Ro
process.CpuMemory.Write(roStart, relocatableObject.Ro);
process.CpuMemory.Write(dataStart, relocatableObject.Data);
- MemoryHelper.FillWithZeros(process.CpuMemory, (long)bssStart, (int)(bssEnd - bssStart));
+ MemoryHelper.FillWithZeros(process.CpuMemory, bssStart, (int)(bssEnd - bssStart));
KernelResult result;
@@ -354,7 +354,7 @@ namespace Ryujinx.HLE.HOS.Services.Ro
return process.MemoryManager.SetProcessMemoryPermission(dataStart, bssEnd - dataStart, KMemoryPermission.ReadAndWrite);
}
- private ResultCode RemoveNrrInfo(long nrrAddress)
+ private ResultCode RemoveNrrInfo(ulong nrrAddress)
{
foreach (NrrInfo info in _nrrInfos)
{
@@ -508,8 +508,8 @@ namespace Ryujinx.HLE.HOS.Services.Ro
// pid placeholder, zero
context.RequestData.ReadUInt64();
- long nrrAddress = context.RequestData.ReadInt64();
- long nrrSize = context.RequestData.ReadInt64();
+ ulong nrrAddress = context.RequestData.ReadUInt64();
+ ulong nrrSize = context.RequestData.ReadUInt64();
if (result == ResultCode.Success)
{
@@ -541,7 +541,7 @@ namespace Ryujinx.HLE.HOS.Services.Ro
// pid placeholder, zero
context.RequestData.ReadUInt64();
- long nrrHeapAddress = context.RequestData.ReadInt64();
+ ulong nrrHeapAddress = context.RequestData.ReadUInt64();
if (result == ResultCode.Success)
{
diff --git a/Ryujinx.HLE/HOS/Services/Ro/Types/NrrInfo.cs b/Ryujinx.HLE/HOS/Services/Ro/Types/NrrInfo.cs
index 8e038fcb..45c34f1c 100644
--- a/Ryujinx.HLE/HOS/Services/Ro/Types/NrrInfo.cs
+++ b/Ryujinx.HLE/HOS/Services/Ro/Types/NrrInfo.cs
@@ -6,9 +6,9 @@ namespace Ryujinx.HLE.HOS.Services.Ro
{
public NrrHeader Header { get; private set; }
public List<byte[]> Hashes { get; private set; }
- public long NrrAddress { get; private set; }
+ public ulong NrrAddress { get; private set; }
- public NrrInfo(long nrrAddress, NrrHeader header, List<byte[]> hashes)
+ public NrrInfo(ulong nrrAddress, NrrHeader header, List<byte[]> hashes)
{
NrrAddress = nrrAddress;
Header = header;