aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Time/StaticService/ITimeZoneServiceForPsc.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Time/StaticService/ITimeZoneServiceForPsc.cs')
-rw-r--r--Ryujinx.HLE/HOS/Services/Time/StaticService/ITimeZoneServiceForPsc.cs40
1 files changed, 20 insertions, 20 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Time/StaticService/ITimeZoneServiceForPsc.cs b/Ryujinx.HLE/HOS/Services/Time/StaticService/ITimeZoneServiceForPsc.cs
index 659e1331..d0ed9379 100644
--- a/Ryujinx.HLE/HOS/Services/Time/StaticService/ITimeZoneServiceForPsc.cs
+++ b/Ryujinx.HLE/HOS/Services/Time/StaticService/ITimeZoneServiceForPsc.cs
@@ -123,7 +123,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
return ResultCode.PermissionDenied;
}
- (long bufferPosition, long bufferSize) = context.Request.GetBufferType0x21();
+ (ulong bufferPosition, ulong bufferSize) = context.Request.GetBufferType0x21();
string locationName = Encoding.ASCII.GetString(context.RequestData.ReadBytes(0x24)).TrimEnd('\0');
@@ -131,7 +131,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
byte[] temp = new byte[bufferSize];
- context.Memory.Read((ulong)bufferPosition, temp);
+ context.Memory.Read(bufferPosition, temp);
using (MemoryStream timeZoneBinaryStream = new MemoryStream(temp))
{
@@ -145,10 +145,10 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
// ParseTimeZoneBinary(buffer<nn::time::TimeZoneBinary, 0x21> timeZoneBinary) -> buffer<nn::time::TimeZoneRule, 0x16>
public ResultCode ParseTimeZoneBinary(ServiceCtx context)
{
- (long bufferPosition, long bufferSize) = context.Request.GetBufferType0x21();
+ (ulong bufferPosition, ulong bufferSize) = context.Request.GetBufferType0x21();
- long timeZoneRuleBufferPosition = context.Request.ReceiveBuff[0].Position;
- long timeZoneRuleBufferSize = context.Request.ReceiveBuff[0].Size;
+ ulong timeZoneRuleBufferPosition = context.Request.ReceiveBuff[0].Position;
+ ulong timeZoneRuleBufferSize = context.Request.ReceiveBuff[0].Size;
if (timeZoneRuleBufferSize != 0x4000)
{
@@ -162,7 +162,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
byte[] temp = new byte[bufferSize];
- context.Memory.Read((ulong)bufferPosition, temp);
+ context.Memory.Read(bufferPosition, temp);
using (MemoryStream timeZoneBinaryStream = new MemoryStream(temp))
{
@@ -188,9 +188,9 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
// ToCalendarTime(nn::time::PosixTime time, buffer<nn::time::TimeZoneRule, 0x15> rules) -> (nn::time::CalendarTime, nn::time::sf::CalendarAdditionalInfo)
public ResultCode ToCalendarTime(ServiceCtx context)
{
- long posixTime = context.RequestData.ReadInt64();
- long bufferPosition = context.Request.SendBuff[0].Position;
- long bufferSize = context.Request.SendBuff[0].Size;
+ long posixTime = context.RequestData.ReadInt64();
+ ulong bufferPosition = context.Request.SendBuff[0].Position;
+ ulong bufferSize = context.Request.SendBuff[0].Size;
if (bufferSize != 0x4000)
{
@@ -220,7 +220,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
ResultCode resultCode = _timeZoneManager.ToCalendarTimeWithMyRules(posixTime, out CalendarInfo calendar);
- if (resultCode == 0)
+ if (resultCode == ResultCode.Success)
{
context.ResponseData.WriteStruct(calendar);
}
@@ -232,8 +232,8 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
// ToPosixTime(nn::time::CalendarTime calendarTime, buffer<nn::time::TimeZoneRule, 0x15> rules) -> (u32 outCount, buffer<nn::time::PosixTime, 0xa>)
public ResultCode ToPosixTime(ServiceCtx context)
{
- long inBufferPosition = context.Request.SendBuff[0].Position;
- long inBufferSize = context.Request.SendBuff[0].Size;
+ ulong inBufferPosition = context.Request.SendBuff[0].Position;
+ ulong inBufferSize = context.Request.SendBuff[0].Size;
CalendarTime calendarTime = context.RequestData.ReadStruct<CalendarTime>();
@@ -249,12 +249,12 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
ResultCode resultCode = _timeZoneManager.ToPosixTime(rules, calendarTime, out long posixTime);
- if (resultCode == 0)
+ if (resultCode == ResultCode.Success)
{
- long outBufferPosition = context.Request.RecvListBuff[0].Position;
- long outBufferSize = context.Request.RecvListBuff[0].Size;
+ ulong outBufferPosition = context.Request.RecvListBuff[0].Position;
+ ulong outBufferSize = context.Request.RecvListBuff[0].Size;
- context.Memory.Write((ulong)outBufferPosition, posixTime);
+ context.Memory.Write(outBufferPosition, posixTime);
context.ResponseData.Write(1);
}
@@ -269,12 +269,12 @@ namespace Ryujinx.HLE.HOS.Services.Time.StaticService
ResultCode resultCode = _timeZoneManager.ToPosixTimeWithMyRules(calendarTime, out long posixTime);
- if (resultCode == 0)
+ if (resultCode == ResultCode.Success)
{
- long outBufferPosition = context.Request.RecvListBuff[0].Position;
- long outBufferSize = context.Request.RecvListBuff[0].Size;
+ ulong outBufferPosition = context.Request.RecvListBuff[0].Position;
+ ulong outBufferSize = context.Request.RecvListBuff[0].Size;
- context.Memory.Write((ulong)outBufferPosition, posixTime);
+ context.Memory.Write(outBufferPosition, posixTime);
// There could be only one result on one calendar as leap seconds aren't supported.
context.ResponseData.Write(1);