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/Account/Acc/AccountService | |
| 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/Account/Acc/AccountService')
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ManagerServer.cs | 4 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ProfileServer.cs | 36 |
2 files changed, 20 insertions, 20 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ManagerServer.cs b/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ManagerServer.cs index c7efe778..471942f1 100644 --- a/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ManagerServer.cs +++ b/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ManagerServer.cs @@ -73,8 +73,8 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService public ResultCode LoadIdTokenCache(ServiceCtx context) { - long bufferPosition = context.Request.ReceiveBuff[0].Position; - long bufferSize = context.Request.ReceiveBuff[0].Size; + ulong bufferPosition = context.Request.ReceiveBuff[0].Position; + ulong bufferSize = context.Request.ReceiveBuff[0].Size; // NOTE: This opens the file at "su/cache/USERID_IN_UUID_STRING.dat" (where USERID_IN_UUID_STRING is formatted as "%08x-%04x-%04x-%02x%02x-%08x%04x") // in the "account:/" savedata and writes some data in the buffer. diff --git a/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ProfileServer.cs b/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ProfileServer.cs index 18534393..8e29f94b 100644 --- a/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ProfileServer.cs +++ b/Ryujinx.HLE/HOS/Services/Account/Acc/AccountService/ProfileServer.cs @@ -16,16 +16,16 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService public ResultCode Get(ServiceCtx context) { - context.Response.PtrBuff[0] = context.Response.PtrBuff[0].WithSize(0x80L); + context.Response.PtrBuff[0] = context.Response.PtrBuff[0].WithSize(0x80UL); - long bufferPosition = context.Request.RecvListBuff[0].Position; + ulong bufferPosition = context.Request.RecvListBuff[0].Position; MemoryHelper.FillWithZeros(context.Memory, bufferPosition, 0x80); // TODO: Determine the struct. - context.Memory.Write((ulong)bufferPosition, 0); // Unknown - context.Memory.Write((ulong)bufferPosition + 4, 1); // Icon ID. 0 = Mii, the rest are character icon IDs. - context.Memory.Write((ulong)bufferPosition + 8, (byte)1); // Profile icon background color ID + context.Memory.Write(bufferPosition, 0); // Unknown + context.Memory.Write(bufferPosition + 4, 1); // Icon ID. 0 = Mii, the rest are character icon IDs. + context.Memory.Write(bufferPosition + 8, (byte)1); // Profile icon background color ID // 0x07 bytes - Unknown // 0x10 bytes - Some ID related to the Mii? All zeros when a character icon is used. // 0x60 bytes - Usually zeros? @@ -57,15 +57,15 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService public ResultCode LoadImage(ServiceCtx context) { - long bufferPosition = context.Request.ReceiveBuff[0].Position; - long bufferLen = context.Request.ReceiveBuff[0].Size; + ulong bufferPosition = context.Request.ReceiveBuff[0].Position; + ulong bufferLen = context.Request.ReceiveBuff[0].Size; - if (_profile.Image.Length > bufferLen) + if ((ulong)_profile.Image.Length > bufferLen) { return ResultCode.InvalidBufferSize; } - context.Memory.Write((ulong)bufferPosition, _profile.Image); + context.Memory.Write(bufferPosition, _profile.Image); context.ResponseData.Write(_profile.Image.Length); @@ -74,12 +74,12 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService public ResultCode Store(ServiceCtx context) { - long userDataPosition = context.Request.PtrBuff[0].Position; - long userDataSize = context.Request.PtrBuff[0].Size; + ulong userDataPosition = context.Request.PtrBuff[0].Position; + ulong userDataSize = context.Request.PtrBuff[0].Size; byte[] userData = new byte[userDataSize]; - context.Memory.Read((ulong)userDataPosition, userData); + context.Memory.Read(userDataPosition, userData); // TODO: Read the nn::account::profile::ProfileBase and store everything in the savedata. @@ -90,19 +90,19 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc.AccountService public ResultCode StoreWithImage(ServiceCtx context) { - long userDataPosition = context.Request.PtrBuff[0].Position; - long userDataSize = context.Request.PtrBuff[0].Size; + ulong userDataPosition = context.Request.PtrBuff[0].Position; + ulong userDataSize = context.Request.PtrBuff[0].Size; byte[] userData = new byte[userDataSize]; - context.Memory.Read((ulong)userDataPosition, userData); + context.Memory.Read(userDataPosition, userData); - long profileImagePosition = context.Request.SendBuff[0].Position; - long profileImageSize = context.Request.SendBuff[0].Size; + ulong profileImagePosition = context.Request.SendBuff[0].Position; + ulong profileImageSize = context.Request.SendBuff[0].Size; byte[] profileImageData = new byte[profileImageSize]; - context.Memory.Read((ulong)profileImagePosition, profileImageData); + context.Memory.Read(profileImagePosition, profileImageData); // TODO: Read the nn::account::profile::ProfileBase and store everything in the savedata. |
