From 28275a897696a707e222ee14dce20d4b8f65ed58 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sat, 10 Mar 2018 20:51:55 -0300 Subject: [PATCH] Do not sign-extend timestamps --- ChocolArm64/State/AThreadState.cs | 6 +++--- Ryujinx.Core/Hid/Hid.cs | 4 ++-- Ryujinx.Core/OsHle/Svc/SvcSystem.cs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ChocolArm64/State/AThreadState.cs b/ChocolArm64/State/AThreadState.cs index 2d988a65..d86f5bf9 100644 --- a/ChocolArm64/State/AThreadState.cs +++ b/ChocolArm64/State/AThreadState.cs @@ -38,10 +38,10 @@ namespace ChocolArm64.State public uint CtrEl0 => 0x8444c004; public uint DczidEl0 => 0x00000004; - private const long TicksPerS = 19_200_000; - private const long TicksPerMS = TicksPerS / 1_000; + private const ulong TicksPerS = 19_200_000; + private const ulong TicksPerMS = TicksPerS / 1_000; - public long CntpctEl0 => Environment.TickCount * TicksPerMS; + public ulong CntpctEl0 => (ulong)Environment.TickCount * TicksPerMS; public event EventHandler Break; public event EventHandler SvcCall; diff --git a/Ryujinx.Core/Hid/Hid.cs b/Ryujinx.Core/Hid/Hid.cs index 76ecf5ff..c287564d 100644 --- a/Ryujinx.Core/Hid/Hid.cs +++ b/Ryujinx.Core/Hid/Hid.cs @@ -258,9 +258,9 @@ namespace Ryujinx.Core.Input } } - private long GetTimestamp() + private static long GetTimestamp() { - return Environment.TickCount * 19_200; + return (long)((ulong)Environment.TickCount * 19_200); } } } \ No newline at end of file diff --git a/Ryujinx.Core/OsHle/Svc/SvcSystem.cs b/Ryujinx.Core/OsHle/Svc/SvcSystem.cs index a276fe3c..f7009035 100644 --- a/Ryujinx.Core/OsHle/Svc/SvcSystem.cs +++ b/Ryujinx.Core/OsHle/Svc/SvcSystem.cs @@ -67,7 +67,7 @@ namespace Ryujinx.Core.OsHle.Svc private void SvcGetSystemTick(AThreadState ThreadState) { - ThreadState.X0 = (ulong)ThreadState.CntpctEl0; + ThreadState.X0 = ThreadState.CntpctEl0; } private void SvcConnectToNamedPort(AThreadState ThreadState)