diff options
| author | Thomas Guillemard <me@thog.eu> | 2019-07-14 22:50:11 +0200 |
|---|---|---|
| committer | Ac_K <Acoustik666@gmail.com> | 2019-07-14 22:50:11 +0200 |
| commit | 97d0c6242368f443c50395b2fa9d99a59f1df1e8 (patch) | |
| tree | 95fe1df8cc70f578f4c595feca6d2c253e4ad366 /Ryujinx.HLE/HOS/Horizon.cs | |
| parent | 4ad3936afd4ca393a05b330e3848958e9598e910 (diff) | |
Accurately implement steady & system clocks (#732)
* Improve SteadyClock implementation accuracy
* Rewrite system clocks to be accurate
* Implement IStaticService 100 & 101
* Add time:* permissions
* Address comments
* Realign TimePermissions definitions
* Address gdk's comments
* Fix after rebase
Diffstat (limited to 'Ryujinx.HLE/HOS/Horizon.cs')
| -rw-r--r-- | Ryujinx.HLE/HOS/Horizon.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Horizon.cs b/Ryujinx.HLE/HOS/Horizon.cs index 496fbdbe..7523d2be 100644 --- a/Ryujinx.HLE/HOS/Horizon.cs +++ b/Ryujinx.HLE/HOS/Horizon.cs @@ -9,6 +9,7 @@ using Ryujinx.HLE.HOS.Kernel.Memory; using Ryujinx.HLE.HOS.Kernel.Process; using Ryujinx.HLE.HOS.Kernel.Threading; using Ryujinx.HLE.HOS.Services.Sm; +using Ryujinx.HLE.HOS.Services.Time.Clock; using Ryujinx.HLE.HOS.SystemState; using Ryujinx.HLE.Loaders.Executables; using Ryujinx.HLE.Loaders.Npdm; @@ -195,6 +196,11 @@ namespace Ryujinx.HLE.HOS LoadKeySet(); ContentManager = new ContentManager(device); + + // NOTE: Now we set the default internal offset of the steady clock like Nintendo does... even if it's strange this is accurate. + // TODO: use bpc:r and set:sys (and set external clock source id from settings) + DateTime UnixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + SteadyClockCore.Instance.SetInternalOffset(new TimeSpanType(((ulong)(DateTime.Now.ToUniversalTime() - UnixEpoch).TotalSeconds) * 1000000000)); } public void LoadCart(string exeFsDir, string romFsFile = null) |
