mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-12-16 15:56:38 +00:00
Change TickSource TickMultiplier from static to an instance variable
This commit is contained in:
parent
7815fd5746
commit
9731aedf4e
@ -13,6 +13,11 @@ namespace Ryujinx.Cpu
|
||||
/// </summary>
|
||||
TimeSpan ElapsedTime { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Clock tick multiplier, in percent points (100 = 1.0).
|
||||
/// </summary>
|
||||
long TickMultiplier { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Time elapsed since the counter was created, in seconds.
|
||||
/// </summary>
|
||||
|
@ -15,7 +15,7 @@ namespace Ryujinx.Cpu
|
||||
/// <inheritdoc/>
|
||||
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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user