mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-28 04:36:23 +02:00
feature: Turbo Mode
Adds an elapsed tick multiplier feature which speeds up games which are built upon delta time. More information: https://web.archive.org/web/20240713135029/https://github.com/Ryujinx/Ryujinx/pull/6456
This commit is contained in:
parent
d7754aeee1
commit
8ad5c73f4c
23 changed files with 475 additions and 41 deletions
|
@ -14,12 +14,37 @@ namespace Ryujinx.Cpu
|
|||
|
||||
/// <inheritdoc/>
|
||||
public ulong Counter => (ulong)(ElapsedSeconds * Frequency);
|
||||
|
||||
|
||||
public long TickScalar { get; set; }
|
||||
|
||||
|
||||
private static long _acumElapsedTicks;
|
||||
|
||||
|
||||
private static long _lastElapsedTicks;
|
||||
|
||||
|
||||
private long ElapsedTicks
|
||||
{
|
||||
get
|
||||
{
|
||||
long elapsedTicks = _tickCounter.ElapsedTicks;
|
||||
|
||||
_acumElapsedTicks += (elapsedTicks - _lastElapsedTicks) * TickScalar / 100;
|
||||
|
||||
_lastElapsedTicks = elapsedTicks;
|
||||
|
||||
return _acumElapsedTicks;
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public TimeSpan ElapsedTime => _tickCounter.Elapsed;
|
||||
|
||||
public TimeSpan ElapsedTime => Stopwatch.GetElapsedTime(0, ElapsedTicks);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public double ElapsedSeconds => _tickCounter.ElapsedTicks * _hostTickFreq;
|
||||
public double ElapsedSeconds => ElapsedTicks * _hostTickFreq;
|
||||
|
||||
public TickSource(ulong frequency)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue