Archived
1
0
Fork 0
forked from Mirror/Ryujinx
This repository has been archived on 2024-10-11. You can view files and clone it, but cannot push or open issues or pull requests.
jinx/Ryujinx.HLE/HOS/Services/Time/ISteadyClock.cs
Ac_K 560ccbeb2d Refactoring commands handling (#728)
* Refactoring commands handling

- Use Reflection to handle commands ID.
- Add all symbols (from SwIPC so not all time accurate).
- Re-sort some services commands methods.
- Some cleanup.
- Keep some empty constructor for consistency.

* Fix order in IProfile
2019-07-11 22:13:43 -03:00

46 lines
No EOL
1.1 KiB
C#

using System;
namespace Ryujinx.HLE.HOS.Services.Time
{
class ISteadyClock : IpcService
{
private ulong _testOffset;
public ISteadyClock()
{
_testOffset = 0;
}
[Command(0)]
// GetCurrentTimePoint() -> nn::time::SteadyClockTimePoint
public long GetCurrentTimePoint(ServiceCtx context)
{
context.ResponseData.Write((long)(System.Diagnostics.Process.GetCurrentProcess().StartTime - DateTime.Now).TotalSeconds);
for (int i = 0; i < 0x10; i++)
{
context.ResponseData.Write((byte)0);
}
return 0;
}
[Command(1)]
// GetTestOffset() -> nn::TimeSpanType
public long GetTestOffset(ServiceCtx context)
{
context.ResponseData.Write(_testOffset);
return 0;
}
[Command(2)]
// SetTestOffset(nn::TimeSpanType)
public long SetTestOffset(ServiceCtx context)
{
_testOffset = context.RequestData.ReadUInt64();
return 0;
}
}
}