diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2018-06-10 21:46:42 -0300 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-06-10 21:46:42 -0300 |
| commit | 76f3b1b3a4637ec72abfbb8cbc0679f2e0ca838f (patch) | |
| tree | 0411b709de31c1c0517763512df8eeb9f7491bc9 /Ryujinx.Core/OsHle/Services/Time | |
| parent | 518fe799da6dd4f12c58c9e6e174767effb0b868 (diff) | |
Rename Ryujinx.Core to Ryujinx.HLE and add a separate project for a future LLE implementation
Diffstat (limited to 'Ryujinx.Core/OsHle/Services/Time')
| -rw-r--r-- | Ryujinx.Core/OsHle/Services/Time/IStaticService.cs | 60 | ||||
| -rw-r--r-- | Ryujinx.Core/OsHle/Services/Time/ISteadyClock.cs | 20 | ||||
| -rw-r--r-- | Ryujinx.Core/OsHle/Services/Time/ISystemClock.cs | 42 | ||||
| -rw-r--r-- | Ryujinx.Core/OsHle/Services/Time/ITimeZoneService.cs | 76 | ||||
| -rw-r--r-- | Ryujinx.Core/OsHle/Services/Time/SystemClockType.cs | 9 |
5 files changed, 0 insertions, 207 deletions
diff --git a/Ryujinx.Core/OsHle/Services/Time/IStaticService.cs b/Ryujinx.Core/OsHle/Services/Time/IStaticService.cs deleted file mode 100644 index 94d9ae74..00000000 --- a/Ryujinx.Core/OsHle/Services/Time/IStaticService.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Ryujinx.Core.OsHle.Ipc; -using System.Collections.Generic; - -namespace Ryujinx.Core.OsHle.Services.Time -{ - class IStaticService : IpcService - { - private Dictionary<int, ServiceProcessRequest> m_Commands; - - public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands; - - public IStaticService() - { - m_Commands = new Dictionary<int, ServiceProcessRequest>() - { - { 0, GetStandardUserSystemClock }, - { 1, GetStandardNetworkSystemClock }, - { 2, GetStandardSteadyClock }, - { 3, GetTimeZoneService }, - { 4, GetStandardLocalSystemClock } - }; - } - - public long GetStandardUserSystemClock(ServiceCtx Context) - { - MakeObject(Context, new ISystemClock(SystemClockType.User)); - - return 0; - } - - public long GetStandardNetworkSystemClock(ServiceCtx Context) - { - MakeObject(Context, new ISystemClock(SystemClockType.Network)); - - return 0; - } - - public long GetStandardSteadyClock(ServiceCtx Context) - { - MakeObject(Context, new ISteadyClock()); - - return 0; - } - - public long GetTimeZoneService(ServiceCtx Context) - { - MakeObject(Context, new ITimeZoneService()); - - return 0; - } - - public long GetStandardLocalSystemClock(ServiceCtx Context) - { - MakeObject(Context, new ISystemClock(SystemClockType.Local)); - - return 0; - } - - } -}
\ No newline at end of file diff --git a/Ryujinx.Core/OsHle/Services/Time/ISteadyClock.cs b/Ryujinx.Core/OsHle/Services/Time/ISteadyClock.cs deleted file mode 100644 index 187d7a06..00000000 --- a/Ryujinx.Core/OsHle/Services/Time/ISteadyClock.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Ryujinx.Core.OsHle.Ipc; -using System.Collections.Generic; - -namespace Ryujinx.Core.OsHle.Services.Time -{ - class ISteadyClock : IpcService - { - private Dictionary<int, ServiceProcessRequest> m_Commands; - - public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands; - - public ISteadyClock() - { - m_Commands = new Dictionary<int, ServiceProcessRequest>() - { - //... - }; - } - } -}
\ No newline at end of file diff --git a/Ryujinx.Core/OsHle/Services/Time/ISystemClock.cs b/Ryujinx.Core/OsHle/Services/Time/ISystemClock.cs deleted file mode 100644 index 9cfdcc87..00000000 --- a/Ryujinx.Core/OsHle/Services/Time/ISystemClock.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Ryujinx.Core.OsHle.Ipc; -using System; -using System.Collections.Generic; - -namespace Ryujinx.Core.OsHle.Services.Time -{ - class ISystemClock : IpcService - { - private Dictionary<int, ServiceProcessRequest> m_Commands; - - public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands; - - private static readonly DateTime Epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); - - private SystemClockType ClockType; - - public ISystemClock(SystemClockType ClockType) - { - m_Commands = new Dictionary<int, ServiceProcessRequest>() - { - { 0, GetCurrentTime } - }; - - this.ClockType = ClockType; - } - - public long GetCurrentTime(ServiceCtx Context) - { - DateTime CurrentTime = DateTime.Now; - - if (ClockType == SystemClockType.User || - ClockType == SystemClockType.Network) - { - CurrentTime = CurrentTime.ToUniversalTime(); - } - - Context.ResponseData.Write((long)(DateTime.Now - Epoch).TotalSeconds); - - return 0; - } - } -}
\ No newline at end of file diff --git a/Ryujinx.Core/OsHle/Services/Time/ITimeZoneService.cs b/Ryujinx.Core/OsHle/Services/Time/ITimeZoneService.cs deleted file mode 100644 index c9c2c94a..00000000 --- a/Ryujinx.Core/OsHle/Services/Time/ITimeZoneService.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Ryujinx.Core.Logging; -using Ryujinx.Core.OsHle.Ipc; -using System; -using System.Collections.Generic; - -namespace Ryujinx.Core.OsHle.Services.Time -{ - class ITimeZoneService : IpcService - { - private Dictionary<int, ServiceProcessRequest> m_Commands; - - public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands; - - private static readonly DateTime Epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); - - public ITimeZoneService() - { - m_Commands = new Dictionary<int, ServiceProcessRequest>() - { - { 0, GetDeviceLocationName }, - { 101, ToCalendarTimeWithMyRule } - }; - } - - public long GetDeviceLocationName(ServiceCtx Context) - { - Context.Ns.Log.PrintStub(LogClass.ServiceTime, "Stubbed."); - - for (int Index = 0; Index < 0x24; Index++) - { - Context.ResponseData.Write((byte)0); - } - - return 0; - } - - public long ToCalendarTimeWithMyRule(ServiceCtx Context) - { - long PosixTime = Context.RequestData.ReadInt64(); - - DateTime CurrentTime = Epoch.AddSeconds(PosixTime).ToLocalTime(); - - Context.ResponseData.Write((ushort)CurrentTime.Year); - Context.ResponseData.Write((byte)CurrentTime.Month); - Context.ResponseData.Write((byte)CurrentTime.Day); - Context.ResponseData.Write((byte)CurrentTime.Hour); - Context.ResponseData.Write((byte)CurrentTime.Minute); - Context.ResponseData.Write((byte)CurrentTime.Second); - Context.ResponseData.Write((byte)0); - - /* Thanks to TuxSH - struct CalendarAdditionalInfo { - u32 tm_wday; //day of week [0,6] (Sunday = 0) - s32 tm_yday; //day of year [0,365] - struct timezone { - char[8] tz_name; - bool isDaylightSavingTime; - s32 utcOffsetSeconds; - }; - }; - */ - Context.ResponseData.Write((int)CurrentTime.DayOfWeek); - - Context.ResponseData.Write(CurrentTime.DayOfYear - 1); - - //TODO: Find out the names used. - Context.ResponseData.Write(new byte[8]); - - Context.ResponseData.Write((byte)(CurrentTime.IsDaylightSavingTime() ? 1 : 0)); - - Context.ResponseData.Write((int)TimeZoneInfo.Local.GetUtcOffset(CurrentTime).TotalSeconds); - - return 0; - } - } -}
\ No newline at end of file diff --git a/Ryujinx.Core/OsHle/Services/Time/SystemClockType.cs b/Ryujinx.Core/OsHle/Services/Time/SystemClockType.cs deleted file mode 100644 index 7b5074ba..00000000 --- a/Ryujinx.Core/OsHle/Services/Time/SystemClockType.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Ryujinx.Core.OsHle.Services.Time -{ - enum SystemClockType - { - User, - Network, - Local - } -}
\ No newline at end of file |
