aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Memory
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Memory')
-rw-r--r--Ryujinx.Graphics.Gpu/Memory/IPhysicalMemory.cs15
-rw-r--r--Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs31
2 files changed, 31 insertions, 15 deletions
diff --git a/Ryujinx.Graphics.Gpu/Memory/IPhysicalMemory.cs b/Ryujinx.Graphics.Gpu/Memory/IPhysicalMemory.cs
deleted file mode 100644
index 73b3a9e1..00000000
--- a/Ryujinx.Graphics.Gpu/Memory/IPhysicalMemory.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-
-namespace Ryujinx.Graphics.Gpu.Memory
-{
- public interface IPhysicalMemory
- {
- int GetPageSize();
-
- Span<byte> Read(ulong address, ulong size);
-
- void Write(ulong address, Span<byte> data);
-
- (ulong, ulong)[] GetModifiedRanges(ulong address, ulong size, ResourceName name);
- }
-} \ No newline at end of file
diff --git a/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs b/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs
new file mode 100644
index 00000000..8f585b0f
--- /dev/null
+++ b/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs
@@ -0,0 +1,31 @@
+using System;
+
+namespace Ryujinx.Graphics.Gpu.Memory
+{
+ using CpuMemoryManager = ARMeilleure.Memory.MemoryManager;
+
+ class PhysicalMemory
+ {
+ private readonly CpuMemoryManager _cpuMemory;
+
+ public PhysicalMemory(CpuMemoryManager cpuMemory)
+ {
+ _cpuMemory = cpuMemory;
+ }
+
+ public Span<byte> Read(ulong address, ulong size)
+ {
+ return _cpuMemory.ReadBytes((long)address, (long)size);
+ }
+
+ public void Write(ulong address, Span<byte> data)
+ {
+ _cpuMemory.WriteBytes((long)address, data.ToArray());
+ }
+
+ public (ulong, ulong)[] GetModifiedRanges(ulong address, ulong size, ResourceName name)
+ {
+ return _cpuMemory.GetModifiedRanges(address, size, (int)name);
+ }
+ }
+} \ No newline at end of file