Initial Framerate limit implementation
This commit is contained in:
parent
3227218114
commit
e4292a5cdc
3 changed files with 20 additions and 1 deletions
|
@ -166,6 +166,13 @@ namespace Ryujinx.HLE.HOS.Services.Android
|
||||||
{
|
{
|
||||||
Context.Device.Statistics.RecordGameFrameTime();
|
Context.Device.Statistics.RecordGameFrameTime();
|
||||||
|
|
||||||
|
if (Context.Ns.EnableVsync)
|
||||||
|
{
|
||||||
|
Context.Ns.Os.VsyncEvent.WaitEvent.WaitOne();
|
||||||
|
|
||||||
|
Context.Ns.Os.VsyncEvent.WaitEvent.Reset();
|
||||||
|
}
|
||||||
|
|
||||||
//TODO: Errors.
|
//TODO: Errors.
|
||||||
int Slot = ParcelReader.ReadInt32();
|
int Slot = ParcelReader.ReadInt32();
|
||||||
int Unknown4 = ParcelReader.ReadInt32();
|
int Unknown4 = ParcelReader.ReadInt32();
|
||||||
|
|
|
@ -27,6 +27,12 @@ namespace Ryujinx.HLE
|
||||||
|
|
||||||
public Hid Hid { get; private set; }
|
public Hid Hid { get; private set; }
|
||||||
|
|
||||||
|
public bool LimitSpeed { get; set; }
|
||||||
|
|
||||||
|
public bool EnableVsync { get; set; }
|
||||||
|
|
||||||
|
public event EventHandler Finish;
|
||||||
|
|
||||||
public Switch(IGalRenderer Renderer, IAalOutput AudioOut)
|
public Switch(IGalRenderer Renderer, IAalOutput AudioOut)
|
||||||
{
|
{
|
||||||
if (Renderer == null)
|
if (Renderer == null)
|
||||||
|
|
|
@ -82,6 +82,8 @@ namespace Ryujinx
|
||||||
|
|
||||||
if (Ticks >= TicksPerFrame)
|
if (Ticks >= TicksPerFrame)
|
||||||
{
|
{
|
||||||
|
Ns.Os.SignalVsync();
|
||||||
|
|
||||||
RenderFrame();
|
RenderFrame();
|
||||||
|
|
||||||
//Queue max. 1 vsync
|
//Queue max. 1 vsync
|
||||||
|
@ -258,7 +260,8 @@ namespace Ryujinx
|
||||||
double HostFps = Device.Statistics.GetSystemFrameRate();
|
double HostFps = Device.Statistics.GetSystemFrameRate();
|
||||||
double GameFps = Device.Statistics.GetGameFrameRate();
|
double GameFps = Device.Statistics.GetGameFrameRate();
|
||||||
|
|
||||||
NewTitle = $"Ryujinx | Host FPS: {HostFps:0.0} | Game FPS: {GameFps:0.0}";
|
NewTitle = $"Ryujinx | Host FPS: {HostFps:0.0} | Game FPS: {GameFps:0.0} | Game Vsync: " +
|
||||||
|
(Ns.EnableVsync ? "On" : "Off");
|
||||||
|
|
||||||
TitleEvent = true;
|
TitleEvent = true;
|
||||||
|
|
||||||
|
@ -310,6 +313,9 @@ namespace Ryujinx
|
||||||
protected override void OnKeyUp(KeyboardKeyEventArgs e)
|
protected override void OnKeyUp(KeyboardKeyEventArgs e)
|
||||||
{
|
{
|
||||||
Keyboard = e.Keyboard;
|
Keyboard = e.Keyboard;
|
||||||
|
|
||||||
|
if (e.Key == Key.Tab)
|
||||||
|
Ns.EnableVsync = !Ns.EnableVsync;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnMouseDown(MouseButtonEventArgs e)
|
protected override void OnMouseDown(MouseButtonEventArgs e)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue