diff --git a/Ryujinx.Core/OsHle/Kernel/SvcHandler.cs b/Ryujinx.Core/OsHle/Kernel/SvcHandler.cs index 9771bc1e55..3a9166e4e8 100644 --- a/Ryujinx.Core/OsHle/Kernel/SvcHandler.cs +++ b/Ryujinx.Core/OsHle/Kernel/SvcHandler.cs @@ -69,6 +69,8 @@ namespace Ryujinx.Core.OsHle.Kernel { 0x26, SvcBreak }, { 0x27, SvcOutputDebugString }, { 0x29, SvcGetInfo }, + { 0x2c, SvcMapPhysicalMemory }, + { 0x2d, SvcUnmapPhysicalMemory }, { 0x32, SvcSetThreadActivity } }; diff --git a/Ryujinx.Core/OsHle/Kernel/SvcMemory.cs b/Ryujinx.Core/OsHle/Kernel/SvcMemory.cs index 6609d14aad..f77cc8ca50 100644 --- a/Ryujinx.Core/OsHle/Kernel/SvcMemory.cs +++ b/Ryujinx.Core/OsHle/Kernel/SvcMemory.cs @@ -250,6 +250,26 @@ namespace Ryujinx.Core.OsHle.Kernel ThreadState.X1 = Handle; } + private void SvcMapPhysicalMemory(AThreadState ThreadState) + { + long Position = (long)ThreadState.X0; + uint Size = (uint)ThreadState.X1; + + Memory.Manager.Map(Position, Size, (int)MemoryType.Heap, AMemoryPerm.RW); + + ThreadState.X0 = 0; + } + + private void SvcUnmapPhysicalMemory(AThreadState ThreadState) + { + long Position = (long)ThreadState.X0; + uint Size = (uint)ThreadState.X1; + + Memory.Manager.Unmap(Position, Size); + + ThreadState.X0 = 0; + } + private static bool IsValidPosition(long Position) { return Position >= MemoryRegions.AddrSpaceStart &&