aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Memory/IVirtualMemoryManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Memory/IVirtualMemoryManager.cs')
-rw-r--r--Ryujinx.Memory/IVirtualMemoryManager.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/Ryujinx.Memory/IVirtualMemoryManager.cs b/Ryujinx.Memory/IVirtualMemoryManager.cs
index e1851d48..edbfc885 100644
--- a/Ryujinx.Memory/IVirtualMemoryManager.cs
+++ b/Ryujinx.Memory/IVirtualMemoryManager.cs
@@ -1,5 +1,6 @@
using Ryujinx.Memory.Range;
using System;
+using System.Buffers;
using System.Collections.Generic;
namespace Ryujinx.Memory
@@ -78,6 +79,21 @@ namespace Ryujinx.Memory
void Write(ulong va, ReadOnlySpan<byte> data);
/// <summary>
+ /// Writes data to CPU mapped memory, with write tracking.
+ /// </summary>
+ /// <param name="va">Virtual address to write the data into</param>
+ /// <param name="data">Data to be written</param>
+ /// <exception cref="InvalidMemoryRegionException">Throw for unhandled invalid or unmapped memory accesses</exception>
+ public void Write(ulong va, ReadOnlySequence<byte> data)
+ {
+ foreach (ReadOnlyMemory<byte> segment in data)
+ {
+ Write(va, segment.Span);
+ va += (ulong)segment.Length;
+ }
+ }
+
+ /// <summary>
/// Writes data to the application process, returning false if the data was not changed.
/// This triggers read memory tracking, as a redundancy check would be useless if the data is not up to date.
/// </summary>