Update StaticService to 9.0.0

This commit is contained in:
Thog 2019-09-29 14:43:21 +02:00
parent f0faf9bfe7
commit b4e5311902
No known key found for this signature in database
GPG key ID: 0CD291558FAFDBC6
2 changed files with 63 additions and 2 deletions

View file

@ -92,6 +92,15 @@ namespace Ryujinx.HLE.HOS.Services.Time.Clock
public void SetAutomaticCorrectionUpdatedTime(SteadyClockTimePoint steadyClockTimePoint)
{
_autoCorrectionTime = steadyClockTimePoint;
}
public SteadyClockTimePoint GetAutomaticCorrectionUpdatedTime()
{
return _autoCorrectionTime;
}
public void SignalAutomaticCorrectionEvent()
{
_autoCorrectionEvent.WritableEvent.Signal();
}
}

View file

@ -102,6 +102,22 @@ namespace Ryujinx.HLE.HOS.Services.Time
return ResultCode.Success;
}
[Command(50)] // 4.0.0+
// SetStandardSteadyClockInternalOffset(nn::TimeSpanType internal_offset)
public ResultCode SetStandardSteadyClockInternalOffset(ServiceCtx context)
{
// This is only implemented in glue's StaticService.
return ResultCode.NotImplemented;
}
[Command(51)] // 9.0.0+
// GetStandardSteadyClockRtcValue() -> u64
public ResultCode GetStandardSteadyClockRtcValue(ServiceCtx context)
{
// This is only implemented in glue's StaticService.
return ResultCode.NotImplemented;
}
[Command(100)]
// IsStandardUserSystemClockAutomaticCorrectionEnabled() -> bool
public ResultCode IsStandardUserSystemClockAutomaticCorrectionEnabled(ServiceCtx context)
@ -137,7 +153,27 @@ namespace Ryujinx.HLE.HOS.Services.Time
bool autoCorrectionEnabled = context.RequestData.ReadBoolean();
return userClock.SetAutomaticCorrectionEnabled(context.Thread, autoCorrectionEnabled);
ResultCode result = userClock.SetAutomaticCorrectionEnabled(context.Thread, autoCorrectionEnabled);
if (result == ResultCode.Success)
{
_timeManager.SharedMemory.SetAutomaticCorrectionEnabled(autoCorrectionEnabled);
SteadyClockTimePoint currentTimePoint = userClock.GetSteadyClockCore().GetCurrentTimePoint(context.Thread);
userClock.SetAutomaticCorrectionUpdatedTime(currentTimePoint);
userClock.SignalAutomaticCorrectionEvent();
}
return result;
}
[Command(102)] // 5.0.0+
// GetStandardUserSystemClockInitialYear() -> u32
public ResultCode GetStandardUserSystemClockInitialYear(ServiceCtx context)
{
// This is only implemented in glue's StaticService.
return ResultCode.NotImplemented;
}
[Command(200)] // 3.0.0+
@ -149,6 +185,22 @@ namespace Ryujinx.HLE.HOS.Services.Time
return ResultCode.Success;
}
[Command(201)] // 6.0.0+
// GetStandardUserSystemClockAutomaticCorrectionUpdatedTime() -> nn::time::SteadyClockTimePoint
public ResultCode GetStandardUserSystemClockAutomaticCorrectionUpdatedTime(ServiceCtx context)
{
StandardUserSystemClockCore userClock = _timeManager.StandardUserSystemClock;
if (!userClock.IsInitialized())
{
return ResultCode.UninitializedClock;
}
context.ResponseData.WriteStruct(userClock.GetAutomaticCorrectionUpdatedTime());
return ResultCode.Success;
}
[Command(300)] // 4.0.0+
// CalculateMonotonicSystemClockBaseTimePoint(nn::time::SystemClockContext) -> s64
public ResultCode CalculateMonotonicSystemClockBaseTimePoint(ServiceCtx context)
@ -172,7 +224,7 @@ namespace Ryujinx.HLE.HOS.Services.Time
context.ResponseData.Write(baseTimePoint);
result = 0;
result = ResultCode.Success;
}
return result;