Allow multiple hid shared memory locations
This commit is contained in:
@ -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)
|
||||
public long[] GetVirtualPositions()
|
||||
{
|
||||
lock (Positions)
|
||||
{
|
||||
if (Index < 0 || Index >= Positions.Count)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(Index));
|
||||
}
|
||||
|
||||
return Positions[Index];
|
||||
}
|
||||
}
|
||||
|
||||
public bool TryGetLastVirtualPosition(out long Position)
|
||||
{
|
||||
lock (Positions)
|
||||
{
|
||||
if (Positions.Count > 0)
|
||||
{
|
||||
Position = Positions[Positions.Count - 1];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Position = 0;
|
||||
|
||||
return false;
|
||||
}
|
||||
return Positions.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user