aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.HLE')
-rw-r--r--Ryujinx.HLE/HOS/Services/Vi/NvFlinger.cs5
-rw-r--r--Ryujinx.HLE/Switch.cs11
2 files changed, 16 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Vi/NvFlinger.cs b/Ryujinx.HLE/HOS/Services/Vi/NvFlinger.cs
index 8f541fbf..2a6918c4 100644
--- a/Ryujinx.HLE/HOS/Services/Vi/NvFlinger.cs
+++ b/Ryujinx.HLE/HOS/Services/Vi/NvFlinger.cs
@@ -199,6 +199,11 @@ namespace Ryujinx.HLE.HOS.Services.Android
SendFrameBuffer(Context, Slot);
+ if (Context.Device.EnableDeviceVsync)
+ {
+ Context.Device.VsyncEvent.WaitOne();
+ }
+
return MakeReplyParcel(Context, 1280, 720, 0, 0, 0);
}
diff --git a/Ryujinx.HLE/Switch.cs b/Ryujinx.HLE/Switch.cs
index 70bd7060..a3f874ee 100644
--- a/Ryujinx.HLE/Switch.cs
+++ b/Ryujinx.HLE/Switch.cs
@@ -7,6 +7,7 @@ using Ryujinx.HLE.Input;
using Ryujinx.HLE.Logging;
using Ryujinx.HLE.Memory;
using System;
+using System.Threading;
namespace Ryujinx.HLE
{
@@ -28,6 +29,12 @@ namespace Ryujinx.HLE
public Hid Hid { get; private set; }
+ public bool EnableDeviceVsync { get; set; } = true;
+
+ public AutoResetEvent VsyncEvent { get; private set; }
+
+ public event EventHandler Finish;
+
public Switch(IGalRenderer Renderer, IAalOutput AudioOut)
{
if (Renderer == null)
@@ -55,6 +62,8 @@ namespace Ryujinx.HLE
Statistics = new PerformanceStatistics();
Hid = new Hid(this, System.HidSharedMem.PA);
+
+ VsyncEvent = new AutoResetEvent(true);
}
public void LoadCart(string ExeFsDir, string RomFsFile = null)
@@ -109,6 +118,8 @@ namespace Ryujinx.HLE
if (Disposing)
{
System.Dispose();
+
+ VsyncEvent.Dispose();
}
}
}