diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2018-03-05 02:09:52 -0300 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-03-05 02:09:52 -0300 |
| commit | 73cc30cc8015685cdb2b8630492703e16f8b4bd9 (patch) | |
| tree | ce2f84b881e95c948b5ed37e3331c1e9d4224f45 /Ryujinx.Core/OsHle | |
| parent | 344fc8a55de471121d3f600cca9e95315d0e502f (diff) | |
Allow multiple hid shared memory locations
Diffstat (limited to 'Ryujinx.Core/OsHle')
| -rw-r--r-- | Ryujinx.Core/OsHle/Handles/HSharedMem.cs | 31 | ||||
| -rw-r--r-- | Ryujinx.Core/OsHle/Horizon.cs | 16 |
2 files changed, 3 insertions, 44 deletions
diff --git a/Ryujinx.Core/OsHle/Handles/HSharedMem.cs b/Ryujinx.Core/OsHle/Handles/HSharedMem.cs index 9cd0a0d4..eb173e96 100644 --- a/Ryujinx.Core/OsHle/Handles/HSharedMem.cs +++ b/Ryujinx.Core/OsHle/Handles/HSharedMem.cs @@ -7,8 +7,6 @@ namespace Ryujinx.Core.OsHle.Handles { private List<long> Positions; - public int PositionsCount => Positions.Count; - public EventHandler<EventArgs> MemoryMapped; public EventHandler<EventArgs> MemoryUnmapped; @@ -37,34 +35,9 @@ namespace Ryujinx.Core.OsHle.Handles } } - public long GetVirtualPosition(int Index) - { - lock (Positions) - { - if (Index < 0 || Index >= Positions.Count) - { - throw new ArgumentOutOfRangeException(nameof(Index)); - } - - return Positions[Index]; - } - } - - public bool TryGetLastVirtualPosition(out long Position) + public long[] GetVirtualPositions() { - lock (Positions) - { - if (Positions.Count > 0) - { - Position = Positions[Positions.Count - 1]; - - return true; - } - - Position = 0; - - return false; - } + return Positions.ToArray(); } } }
\ No newline at end of file diff --git a/Ryujinx.Core/OsHle/Horizon.cs b/Ryujinx.Core/OsHle/Horizon.cs index c2389143..a8f5df7c 100644 --- a/Ryujinx.Core/OsHle/Horizon.cs +++ b/Ryujinx.Core/OsHle/Horizon.cs @@ -27,7 +27,7 @@ namespace Ryujinx.Core.OsHle private ConcurrentDictionary<int, Process> Processes; - private HSharedMem HidSharedMem; + internal HSharedMem HidSharedMem; private Switch Ns; @@ -49,8 +49,6 @@ namespace Ryujinx.Core.OsHle HidSharedMem = new HSharedMem(); - HidSharedMem.MemoryMapped += HidInit; - HidHandle = Handles.GenerateId(HidSharedMem); FontHandle = Handles.GenerateId(new HSharedMem()); @@ -166,17 +164,5 @@ namespace Ryujinx.Core.OsHle Handles.Delete(Handle); } - - private void HidInit(object sender, EventArgs e) - { - HSharedMem SharedMem = (HSharedMem)sender; - - if (SharedMem.TryGetLastVirtualPosition(out long Position)) - { - Logging.Info($"HID shared memory successfully mapped to 0x{Position:x16}!"); - - Ns.Hid.Init(Position); - } - } } }
\ No newline at end of file |
