aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Am/AppletAE
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/Am/AppletAE
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/Am/AppletAE')
-rw-r--r--Ryujinx.HLE/HOS/Services/Am/AppletAE/IStorageAccessor.cs22
1 files changed, 11 insertions, 11 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/IStorageAccessor.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/IStorageAccessor.cs
index cdc59678..33f5393f 100644
--- a/Ryujinx.HLE/HOS/Services/Am/AppletAE/IStorageAccessor.cs
+++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/IStorageAccessor.cs
@@ -29,20 +29,20 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE
return ResultCode.ObjectInvalid;
}
- long writePosition = context.RequestData.ReadInt64();
+ ulong writePosition = context.RequestData.ReadUInt64();
- if (writePosition > _storage.Data.Length)
+ if (writePosition > (ulong)_storage.Data.Length)
{
return ResultCode.OutOfBounds;
}
- (long position, long size) = context.Request.GetBufferType0x21();
+ (ulong position, ulong size) = context.Request.GetBufferType0x21();
- size = Math.Min(size, _storage.Data.Length - writePosition);
+ size = Math.Min(size, (ulong)_storage.Data.Length - writePosition);
if (size > 0)
{
- long maxSize = _storage.Data.Length - writePosition;
+ ulong maxSize = (ulong)_storage.Data.Length - writePosition;
if (size > maxSize)
{
@@ -51,7 +51,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE
byte[] data = new byte[size];
- context.Memory.Read((ulong)position, data);
+ context.Memory.Read(position, data);
Buffer.BlockCopy(data, 0, _storage.Data, (int)writePosition, (int)size);
}
@@ -63,22 +63,22 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE
// Read(u64) -> buffer<bytes, 0x22>
public ResultCode Read(ServiceCtx context)
{
- long readPosition = context.RequestData.ReadInt64();
+ ulong readPosition = context.RequestData.ReadUInt64();
- if (readPosition > _storage.Data.Length)
+ if (readPosition > (ulong)_storage.Data.Length)
{
return ResultCode.OutOfBounds;
}
- (long position, long size) = context.Request.GetBufferType0x22();
+ (ulong position, ulong size) = context.Request.GetBufferType0x22();
- size = Math.Min(size, _storage.Data.Length - readPosition);
+ size = Math.Min(size, (ulong)_storage.Data.Length - readPosition);
byte[] data = new byte[size];
Buffer.BlockCopy(_storage.Data, (int)readPosition, data, 0, (int)size);
- context.Memory.Write((ulong)position, data);
+ context.Memory.Write(position, data);
return ResultCode.Success;
}