aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Core/Switch.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Core/Switch.cs')
-rw-r--r--Ryujinx.Core/Switch.cs11
1 files changed, 5 insertions, 6 deletions
diff --git a/Ryujinx.Core/Switch.cs b/Ryujinx.Core/Switch.cs
index 1acd87f0..dff7802b 100644
--- a/Ryujinx.Core/Switch.cs
+++ b/Ryujinx.Core/Switch.cs
@@ -5,13 +5,12 @@ using Ryujinx.Core.Settings;
using Ryujinx.Graphics.Gal;
using Ryujinx.Graphics.Gpu;
using System;
-using System.Runtime.InteropServices;
namespace Ryujinx.Core
{
public class Switch : IDisposable
{
- public IntPtr Ram {get; private set; }
+ internal AMemory Memory { get; private set; }
internal NsGpu Gpu { get; private set; }
internal Horizon Os { get; private set; }
@@ -25,13 +24,13 @@ namespace Ryujinx.Core
public Switch(IGalRenderer Renderer)
{
- Ram = Marshal.AllocHGlobal((IntPtr)AMemoryMgr.RamSize);
+ Memory = new AMemory();
Gpu = new NsGpu(Renderer);
VFs = new VirtualFs();
- Hid = new Hid(Ram);
+ Hid = new Hid(this);
Statistics = new PerformanceStatistics();
@@ -72,10 +71,10 @@ namespace Ryujinx.Core
{
if (disposing)
{
+ Memory.Dispose();
+
VFs.Dispose();
}
-
- Marshal.FreeHGlobal(Ram);
}
}
} \ No newline at end of file