diff options
| author | Mary <me@thog.eu> | 2021-04-24 12:16:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-24 12:16:01 +0200 |
| commit | 305f06eb71a7832e6b0081a67015b66ced8a23cd (patch) | |
| tree | 98bcb3ed465332a04af449cb5c74bdca7855a141 /Ryujinx.HLE/HOS/Services/Ngct | |
| parent | c46f6879ff9171a1e024965618242e8bad373b6b (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/Ngct')
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Ngct/NgctServer.cs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Ngct/NgctServer.cs b/Ryujinx.HLE/HOS/Services/Ngct/NgctServer.cs index a1907d4f..8d99721e 100644 --- a/Ryujinx.HLE/HOS/Services/Ngct/NgctServer.cs +++ b/Ryujinx.HLE/HOS/Services/Ngct/NgctServer.cs @@ -11,8 +11,8 @@ namespace Ryujinx.HLE.HOS.Services.Ngct // Then it checks if ngc.t!functionality_override_enabled is enabled and if sys:set GetT is == 2. // If both conditions are true, it does this following code. Since we currently stub it, it's fine to don't check settings service values. - long bufferPosition = context.Request.PtrBuff[0].Position; - long bufferSize = context.Request.PtrBuff[0].Size; + ulong bufferPosition = context.Request.PtrBuff[0].Position; + ulong bufferSize = context.Request.PtrBuff[0].Size; bool isMatch = false; string text = ""; @@ -27,7 +27,7 @@ namespace Ryujinx.HLE.HOS.Services.Ngct { byte[] buffer = new byte[bufferSize]; - context.Memory.Read((ulong)bufferPosition, buffer); + context.Memory.Read(bufferPosition, buffer); text = Encoding.ASCII.GetString(buffer); @@ -52,10 +52,10 @@ namespace Ryujinx.HLE.HOS.Services.Ngct // Then it checks if ngc.t!functionality_override_enabled is enabled and if sys:set GetT is == 2. // If both conditions are true, it does this following code. Since we currently stub it, it's fine to don't check settings service values. - long bufferPosition = context.Request.PtrBuff[0].Position; - long bufferSize = context.Request.PtrBuff[0].Size; + ulong bufferPosition = context.Request.PtrBuff[0].Position; + ulong bufferSize = context.Request.PtrBuff[0].Size; - long bufferFilteredPosition = context.Request.RecvListBuff[0].Position; + ulong bufferFilteredPosition = context.Request.RecvListBuff[0].Position; string text = ""; string textFiltered = ""; @@ -66,13 +66,13 @@ namespace Ryujinx.HLE.HOS.Services.Ngct { textFiltered = new string('*', text.Length); - context.Memory.Write((ulong)bufferFilteredPosition, Encoding.ASCII.GetBytes(textFiltered)); + context.Memory.Write(bufferFilteredPosition, Encoding.ASCII.GetBytes(textFiltered)); } else { byte[] buffer = new byte[bufferSize]; - context.Memory.Read((ulong)bufferPosition, buffer); + context.Memory.Read(bufferPosition, buffer); // NOTE: Ngct use the archive 0100000000001034 which contains a words table. This is pushed on Chinese Switchs using Bcat service. // This call check if the string contains words which are in the table then returns the same string with each matched words replaced by '*'. @@ -80,7 +80,7 @@ namespace Ryujinx.HLE.HOS.Services.Ngct textFiltered = text = Encoding.ASCII.GetString(buffer); - context.Memory.Write((ulong)bufferFilteredPosition, buffer); + context.Memory.Write(bufferFilteredPosition, buffer); } } |
