aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/Switch.cs
diff options
context:
space:
mode:
authorThog <me@thog.eu>2020-01-21 23:23:11 +0100
committerAc_K <Acoustik666@gmail.com>2020-01-21 23:23:11 +0100
commitd6b9babe1d73a78e963455a5a6ea3e7431a44ece (patch)
tree625db9119d8ecc2a9a1858f357b597fb216dfef7 /Ryujinx.HLE/Switch.cs
parentb4b2b8b162cd942d399f3420ea064bee14f5411e (diff)
Keep the GUI alive when closing a game (#888)
* Keep the GUI alive when closing a game Make HLE.Switch init when starting a game and dispose it when closing the GlScreen. This also make HLE in charge of disposing the audio and gpu backend. * Address Ac_k's comments * Make sure to dispose the Discord module and use GTK quit method Also update Discord Precense when closing a game. * Make sure to dispose MainWindow * Address gdk's comments
Diffstat (limited to 'Ryujinx.HLE/Switch.cs')
-rw-r--r--Ryujinx.HLE/Switch.cs25
1 files changed, 16 insertions, 9 deletions
diff --git a/Ryujinx.HLE/Switch.cs b/Ryujinx.HLE/Switch.cs
index 90723c4c..b7db5c62 100644
--- a/Ryujinx.HLE/Switch.cs
+++ b/Ryujinx.HLE/Switch.cs
@@ -4,6 +4,7 @@ using Ryujinx.Configuration;
using Ryujinx.Graphics.GAL;
using Ryujinx.Graphics.Gpu;
using Ryujinx.HLE.FileSystem;
+using Ryujinx.HLE.FileSystem.Content;
using Ryujinx.HLE.HOS;
using Ryujinx.HLE.HOS.Services;
using Ryujinx.HLE.HOS.SystemState;
@@ -15,11 +16,11 @@ namespace Ryujinx.HLE
{
public class Switch : IDisposable
{
- internal IAalOutput AudioOut { get; private set; }
+ public IAalOutput AudioOut { get; private set; }
internal DeviceMemory Memory { get; private set; }
- internal GpuContext Gpu { get; private set; }
+ public GpuContext Gpu { get; private set; }
public VirtualFileSystem FileSystem { get; private set; }
@@ -35,7 +36,7 @@ namespace Ryujinx.HLE
public event EventHandler Finish;
- public Switch(IRenderer renderer, IAalOutput audioOut)
+ public Switch(VirtualFileSystem fileSystem, ContentManager contentManager, IRenderer renderer, IAalOutput audioOut)
{
if (renderer == null)
{
@@ -53,9 +54,9 @@ namespace Ryujinx.HLE
Gpu = new GpuContext(renderer);
- FileSystem = new VirtualFileSystem();
+ FileSystem = fileSystem;
- System = new Horizon(this);
+ System = new Horizon(this, contentManager);
Statistics = new PerformanceStatistics();
@@ -78,15 +79,20 @@ namespace Ryujinx.HLE
System.EnableMultiCoreScheduling();
}
- System.FsIntegrityCheckLevel = ConfigurationState.Instance.System.EnableFsIntegrityChecks
- ? IntegrityCheckLevel.ErrorOnInvalid
- : IntegrityCheckLevel.None;
+ System.FsIntegrityCheckLevel = GetIntigrityCheckLevel();
System.GlobalAccessLogMode = ConfigurationState.Instance.System.FsGlobalAccessLogMode;
ServiceConfiguration.IgnoreMissingServices = ConfigurationState.Instance.System.IgnoreMissingServices;
}
+ public static IntegrityCheckLevel GetIntigrityCheckLevel()
+ {
+ return ConfigurationState.Instance.System.EnableFsIntegrityChecks
+ ? IntegrityCheckLevel.ErrorOnInvalid
+ : IntegrityCheckLevel.None;
+ }
+
public void LoadCart(string exeFsDir, string romFsFile = null)
{
System.LoadCart(exeFsDir, romFsFile);
@@ -129,7 +135,7 @@ namespace Ryujinx.HLE
internal void Unload()
{
- FileSystem.Dispose();
+ FileSystem.Unload();
Memory.Dispose();
}
@@ -150,6 +156,7 @@ namespace Ryujinx.HLE
{
System.Dispose();
VsyncEvent.Dispose();
+ AudioOut.Dispose();
}
}
}