mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-28 06:46:24 +02:00
Add custom refresh rate mode to VSync option (#238)
Rebased @jcm93's refreshinterval branch: https://github.com/jcm93/Ryujinx/tree/refreshinterval The option is placed under System/Hacks. Disabled, it's the default Ryujinx behavior. Enabled, the behavior is shown in the attached screenshots. If a framerate is too high or low, you can adjust the value where you normally toggle VSync on and off. It will also cycle through the default on/off toggles. Also, in order to reduce clutter, I made an adjustment to remove the target FPS and only show the percentage. --------- Co-authored-by: jcm <6864788+jcm93@users.noreply.github.com>
This commit is contained in:
parent
7e16fccfc1
commit
2e6794e69b
34 changed files with 678 additions and 110 deletions
|
@ -27,7 +27,11 @@ namespace Ryujinx.HLE
|
|||
public TamperMachine TamperMachine { get; }
|
||||
public IHostUIHandler UIHandler { get; }
|
||||
|
||||
public bool EnableDeviceVsync { get; set; }
|
||||
public VSyncMode VSyncMode { get; set; } = VSyncMode.Switch;
|
||||
public bool CustomVSyncIntervalEnabled { get; set; } = false;
|
||||
public int CustomVSyncInterval { get; set; }
|
||||
|
||||
public long TargetVSyncInterval { get; set; } = 60;
|
||||
|
||||
public bool IsFrameAvailable => Gpu.Window.IsFrameAvailable;
|
||||
|
||||
|
@ -59,12 +63,14 @@ namespace Ryujinx.HLE
|
|||
System.State.SetLanguage(Configuration.SystemLanguage);
|
||||
System.State.SetRegion(Configuration.Region);
|
||||
|
||||
EnableDeviceVsync = Configuration.EnableVsync;
|
||||
VSyncMode = Configuration.VSyncMode;
|
||||
CustomVSyncInterval = Configuration.CustomVSyncInterval;
|
||||
System.State.DockedMode = Configuration.EnableDockedMode;
|
||||
System.PerformanceState.PerformanceMode = System.State.DockedMode ? PerformanceMode.Boost : PerformanceMode.Default;
|
||||
System.EnablePtc = Configuration.EnablePtc;
|
||||
System.FsIntegrityCheckLevel = Configuration.FsIntegrityCheckLevel;
|
||||
System.GlobalAccessLogMode = Configuration.FsGlobalAccessLogMode;
|
||||
UpdateVSyncInterval();
|
||||
#pragma warning restore IDE0055
|
||||
}
|
||||
|
||||
|
@ -75,6 +81,34 @@ namespace Ryujinx.HLE
|
|||
Gpu.GPFifo.DispatchCalls();
|
||||
}
|
||||
|
||||
public void IncrementCustomVSyncInterval()
|
||||
{
|
||||
CustomVSyncInterval += 1;
|
||||
UpdateVSyncInterval();
|
||||
}
|
||||
|
||||
public void DecrementCustomVSyncInterval()
|
||||
{
|
||||
CustomVSyncInterval -= 1;
|
||||
UpdateVSyncInterval();
|
||||
}
|
||||
|
||||
public void UpdateVSyncInterval()
|
||||
{
|
||||
switch (VSyncMode)
|
||||
{
|
||||
case VSyncMode.Custom:
|
||||
TargetVSyncInterval = CustomVSyncInterval;
|
||||
break;
|
||||
case VSyncMode.Switch:
|
||||
TargetVSyncInterval = 60;
|
||||
break;
|
||||
case VSyncMode.Unbounded:
|
||||
TargetVSyncInterval = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public bool LoadCart(string exeFsDir, string romFsFile = null) => Processes.LoadUnpackedNca(exeFsDir, romFsFile);
|
||||
public bool LoadXci(string xciFile, ulong applicationId = 0) => Processes.LoadXci(xciFile, applicationId);
|
||||
public bool LoadNca(string ncaFile) => Processes.LoadNca(ncaFile);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue