diff --git a/src/Ryujinx.Cpu/ITickSource.cs b/src/Ryujinx.Cpu/ITickSource.cs
index e65e99e26..d598719ca 100644
--- a/src/Ryujinx.Cpu/ITickSource.cs
+++ b/src/Ryujinx.Cpu/ITickSource.cs
@@ -13,6 +13,11 @@ namespace Ryujinx.Cpu
///
TimeSpan ElapsedTime { get; }
+ ///
+ /// Clock tick multiplier, in percent points (100 = 1.0).
+ ///
+ long TickMultiplier { get; set; }
+
///
/// Time elapsed since the counter was created, in seconds.
///
diff --git a/src/Ryujinx.Cpu/TickSource.cs b/src/Ryujinx.Cpu/TickSource.cs
index d06644e56..7467a080c 100644
--- a/src/Ryujinx.Cpu/TickSource.cs
+++ b/src/Ryujinx.Cpu/TickSource.cs
@@ -15,7 +15,7 @@ namespace Ryujinx.Cpu
///
public ulong Counter => (ulong)(ElapsedSeconds * Frequency);
- public static long s_tickMultiplier = 100;
+ public long TickMultiplier { get; set; } = 100;
private static long AcumElapsedTicks = 0;
private static long LastElapsedTicks = 0;
private long Elapsedticks
@@ -23,7 +23,7 @@ namespace Ryujinx.Cpu
get
{
long elapsedTicks = _tickCounter.ElapsedTicks;
- AcumElapsedTicks += (elapsedTicks - LastElapsedTicks) * s_tickMultiplier / 100;
+ AcumElapsedTicks += (elapsedTicks - LastElapsedTicks) * TickMultiplier / 100;
LastElapsedTicks = elapsedTicks;
return AcumElapsedTicks;
}
diff --git a/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs b/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs
index 475494c6a..c4c53acaa 100644
--- a/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs
+++ b/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs
@@ -89,7 +89,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
}
else
{
- _ticksPerFrame = (Stopwatch.Frequency / TargetFps * 100) / TickSource.s_tickMultiplier;
+ _ticksPerFrame = (Stopwatch.Frequency / TargetFps * 100) / (_device.System?.TickSource?.TickMultiplier ?? 100);
}
}
diff --git a/src/Ryujinx.HLE/Switch.cs b/src/Ryujinx.HLE/Switch.cs
index 413447533..fc707e714 100644
--- a/src/Ryujinx.HLE/Switch.cs
+++ b/src/Ryujinx.HLE/Switch.cs
@@ -126,6 +126,11 @@ namespace Ryujinx.HLE
return AudioDeviceDriver.Volume;
}
+ public void SetTickSourceMultiplier(long tickMultiplier)
+ {
+ System.TickSource.TickMultiplier = tickMultiplier;
+ }
+
public void EnableCheats()
{
ModLoader.EnableCheats(Processes.ActiveApplication.ProgramId, TamperMachine);
diff --git a/src/Ryujinx/AppHost.cs b/src/Ryujinx/AppHost.cs
index 57d87ff6e..6fe0a4288 100644
--- a/src/Ryujinx/AppHost.cs
+++ b/src/Ryujinx/AppHost.cs
@@ -1072,7 +1072,7 @@ namespace Ryujinx.Ava
{
Device.TurboMode = !Device.TurboMode;
long turboMultiplier = Device.TurboMode ? Device.Configuration.TurboMultiplier : 100;
- TickSource.s_tickMultiplier = turboMultiplier;
+ Device.SetTickSourceMultiplier(turboMultiplier);
}
switch (currentHotkeyState)
{