mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-10-21 01:41:40 +00:00
a0720b5681
* 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
41 lines
No EOL
1.4 KiB
C#
41 lines
No EOL
1.4 KiB
C#
using Ryujinx.HLE.HOS.Services.Time.TimeZone;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.Time.Clock
|
|
{
|
|
[StructLayout(LayoutKind.Sequential, Size = 0xD0)]
|
|
struct ClockSnapshot
|
|
{
|
|
public SystemClockContext UserContext;
|
|
public SystemClockContext NetworkContext;
|
|
public long UserTime;
|
|
public long NetworkTime;
|
|
public CalendarTime UserCalendarTime;
|
|
public CalendarTime NetworkCalendarTime;
|
|
public CalendarAdditionalInfo UserCalendarAdditionalTime;
|
|
public CalendarAdditionalInfo NetworkCalendarAdditionalTime;
|
|
public SteadyClockTimePoint SteadyClockTimePoint;
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x24)]
|
|
public char[] LocationName;
|
|
|
|
[MarshalAs(UnmanagedType.I1)]
|
|
public bool IsAutomaticCorrectionEnabled;
|
|
public byte Type;
|
|
public ushort Unknown;
|
|
|
|
public static ResultCode GetCurrentTime(out long currentTime, SteadyClockTimePoint steadyClockTimePoint, SystemClockContext context)
|
|
{
|
|
currentTime = 0;
|
|
|
|
if (steadyClockTimePoint.ClockSourceId == context.SteadyTimePoint.ClockSourceId)
|
|
{
|
|
currentTime = steadyClockTimePoint.TimePoint + context.Offset;
|
|
|
|
return ResultCode.Success;
|
|
}
|
|
|
|
return ResultCode.TimeMismatch;
|
|
}
|
|
}
|
|
} |