diff options
author | Ac_K <Acoustik666@gmail.com> | 2022-03-22 20:46:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-22 20:46:16 +0100 |
commit | e3b36db71c62a34a26b30683dd5ad5410c97cc9c (patch) | |
tree | 18feea12db46ad2ddcdc207e9fd0e805fd98b7da /Ryujinx.HLE/Switch.cs | |
parent | ba0171d05464201c1513386b7d0b69b5ea956426 (diff) |
hle: Some cleanup (#3210)1.1.83
* hle: Some cleanup
This PR cleaned up a bit the HLE folder and the VirtualFileSystem one, since we use LibHac, we can use some class of it directly instead of duplicate things. The "Content" of VFS folder is removed since it should be handled in the NCM service directly.
A larger cleanup should be done later since there is still be duplicated code here and there.
* Fix Headless.SDL2
* Addresses gdkchan feedback
Diffstat (limited to 'Ryujinx.HLE/Switch.cs')
-rw-r--r-- | Ryujinx.HLE/Switch.cs | 87 |
1 files changed, 28 insertions, 59 deletions
diff --git a/Ryujinx.HLE/Switch.cs b/Ryujinx.HLE/Switch.cs index 0dcbc7ec..366a26f4 100644 --- a/Ryujinx.HLE/Switch.cs +++ b/Ryujinx.HLE/Switch.cs @@ -13,27 +13,17 @@ namespace Ryujinx.HLE { public class Switch : IDisposable { - public HLEConfiguration Configuration { get; } - + public HLEConfiguration Configuration { get; } public IHardwareDeviceDriver AudioDeviceDriver { get; } - - internal MemoryBlock Memory { get; } - - public GpuContext Gpu { get; } - - public VirtualFileSystem FileSystem => Configuration.VirtualFileSystem; - - public Horizon System { get; } - - public ApplicationLoader Application { get; } - - public PerformanceStatistics Statistics { get; } - - public Hid Hid { get; } - - public TamperMachine TamperMachine { get; } - - public IHostUiHandler UiHandler { get; } + public MemoryBlock Memory { get; } + public GpuContext Gpu { get; } + public VirtualFileSystem FileSystem { get; } + public Horizon System { get; } + public ApplicationLoader Application { get; } + public PerformanceStatistics Statistics { get; } + public Hid Hid { get; } + public TamperMachine TamperMachine { get; } + public IHostUiHandler UiHandler { get; } public bool EnableDeviceVsync { get; set; } = true; @@ -55,47 +45,27 @@ namespace Ryujinx.HLE } Configuration = configuration; + FileSystem = Configuration.VirtualFileSystem; + UiHandler = Configuration.HostUiHandler; + + AudioDeviceDriver = new CompatLayerHardwareDeviceDriver(Configuration.AudioDeviceDriver); + Memory = new MemoryBlock(Configuration.MemoryConfiguration.ToDramSize(), MemoryAllocationFlags.Reserve); + Gpu = new GpuContext(Configuration.GpuRenderer); + System = new Horizon(this); + Statistics = new PerformanceStatistics(); + Hid = new Hid(this, System.HidStorage); + Application = new ApplicationLoader(this); + TamperMachine = new TamperMachine(); - UiHandler = configuration.HostUiHandler; - - AudioDeviceDriver = new CompatLayerHardwareDeviceDriver(configuration.AudioDeviceDriver); - - Memory = new MemoryBlock(configuration.MemoryConfiguration.ToDramSize(), MemoryAllocationFlags.Reserve); - - Gpu = new GpuContext(configuration.GpuRenderer); - - System = new Horizon(this); - System.InitializeServices(); - - Statistics = new PerformanceStatistics(); - - Hid = new Hid(this, System.HidStorage); - Hid.InitDevices(); - - Application = new ApplicationLoader(this); - - TamperMachine = new TamperMachine(); - - Initialize(); - } - - private void Initialize() - { System.State.SetLanguage(Configuration.SystemLanguage); - System.State.SetRegion(Configuration.Region); - EnableDeviceVsync = Configuration.EnableVsync; - - System.State.DockedMode = Configuration.EnableDockedMode; - + EnableDeviceVsync = Configuration.EnableVsync; + 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; + System.EnablePtc = Configuration.EnablePtc; + System.FsIntegrityCheckLevel = Configuration.FsIntegrityCheckLevel; + System.GlobalAccessLogMode = Configuration.FsGlobalAccessLogMode; } public void LoadCart(string exeFsDir, string romFsFile = null) @@ -132,7 +102,6 @@ namespace Ryujinx.HLE { Gpu.ProcessShaderCacheQueue(); Gpu.Renderer.PreFrame(); - Gpu.GPFifo.DispatchCalls(); } @@ -182,9 +151,9 @@ namespace Ryujinx.HLE { System.Dispose(); AudioDeviceDriver.Dispose(); - FileSystem.Unload(); + FileSystem.Dispose(); Memory.Dispose(); } } } -} +}
\ No newline at end of file |