mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-07-01 18:10:47 -07:00
Refactoring HOS folder structure (#771)
* Refactoring HOS folder structure Refactoring HOS folder structure: - Added some subfolders when needed (Following structure decided in private). - Added some `Types` folders when needed. - Little cleanup here and there. - Add services placeholders for every HOS services (close #766 and #753). * Remove Types namespaces
This commit is contained in:
34
Ryujinx.HLE/HOS/Services/Pcv/Bpc/IRtcManager.cs
Normal file
34
Ryujinx.HLE/HOS/Services/Pcv/Bpc/IRtcManager.cs
Normal file
@ -0,0 +1,34 @@
|
||||
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) { }
|
||||
|
||||
[Command(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
|
||||
DateTime unixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
|
||||
rtcValue = (ulong)(DateTime.Now.ToUniversalTime() - unixEpoch).TotalSeconds;
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user