0
0
Fork 0
This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ryujinx-final/Ryujinx.HLE/HOS/Services/Pcv/Bpc/IRtcManager.cs
Berkan Diler 37d27c4c99
Some minor cleanups and optimizations (#4174)
* Replace Array.Clear(x, 0, x.Length) with Array.Clear(x)

* Use DateTime.UnixEpoch field

* Replace SHA256.ComputeHash calls with static SHA256.HashData call

More performant and avoids the need to initialize a SHA256 instance.
2022-12-24 14:30:39 -03:00

32 lines
851 B
C#

using System;
namespace Ryujinx.HLE.HOS.Services.Pcv.Bpc
{
[Service("bpc:r")] // 1.0.0 - 8.1.0
class IRtcManager : IpcService
{
public IRtcManager(ServiceCtx context) { }
[CommandHipc(0)]
// GetRtcTime() -> u64
public ResultCode GetRtcTime(ServiceCtx context)
{
ResultCode result = GetExternalRtcValue(out ulong rtcValue);
if (result == ResultCode.Success)
{
context.ResponseData.Write(rtcValue);
}
return result;
}
public static ResultCode GetExternalRtcValue(out ulong rtcValue)
{
// TODO: emulate MAX77620/MAX77812 RTC
rtcValue = (ulong)(DateTime.Now.ToUniversalTime() - DateTime.UnixEpoch).TotalSeconds;
return ResultCode.Success;
}
}
}