mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-11-28 10:00:50 +01:00
31 lines
810 B
C#
31 lines
810 B
C#
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);
|
|
}
|
|
}
|
|
} |