diff options
Diffstat (limited to 'Ryujinx.HLE/HOS/Kernel/Memory/KPageTable.cs')
-rw-r--r-- | Ryujinx.HLE/HOS/Kernel/Memory/KPageTable.cs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Ryujinx.HLE/HOS/Kernel/Memory/KPageTable.cs b/Ryujinx.HLE/HOS/Kernel/Memory/KPageTable.cs index 20a13f57..d7ee04e3 100644 --- a/Ryujinx.HLE/HOS/Kernel/Memory/KPageTable.cs +++ b/Ryujinx.HLE/HOS/Kernel/Memory/KPageTable.cs @@ -86,7 +86,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory } /// <inheritdoc/> - protected override KernelResult MapPages(ulong dstVa, ulong pagesCount, ulong srcPa, KMemoryPermission permission) + protected override KernelResult MapPages(ulong dstVa, ulong pagesCount, ulong srcPa, KMemoryPermission permission, bool shouldFillPages, byte fillValue) { ulong size = pagesCount * PageSize; @@ -99,11 +99,16 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory Context.MemoryManager.IncrementPagesReferenceCount(srcPa, pagesCount); } + if (shouldFillPages) + { + _cpuMemory.Fill(dstVa, size, fillValue); + } + return KernelResult.Success; } /// <inheritdoc/> - protected override KernelResult MapPages(ulong address, KPageList pageList, KMemoryPermission permission) + protected override KernelResult MapPages(ulong address, KPageList pageList, KMemoryPermission permission, bool shouldFillPages, byte fillValue) { using var scopedPageList = new KScopedPageList(Context.MemoryManager, pageList); @@ -118,6 +123,11 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory _cpuMemory.Map(currentVa, Context.Memory.GetPointer(addr, size), size); + if (shouldFillPages) + { + _cpuMemory.Fill(currentVa, size, fillValue); + } + currentVa += size; } |