0
0
Fork 0
This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ryujinx-final/Ryujinx.Core/OsHle/Services/Nv/NvChNvMap.cs

31 lines
No EOL
890 B
C#

using System.Collections.Concurrent;
namespace Ryujinx.Core.OsHle.Services.Nv
{
class NvChNvMap
{
private static ConcurrentDictionary<Process, IdDictionary> NvMaps;
public void Create(ServiceCtx Context)
{
long InputPosition = Context.Request.GetBufferType0x21Position();
long OutputPosition = Context.Request.GetBufferType0x22Position();
int Size = Context.Memory.ReadInt32(InputPosition);
int Handle = AddNvMap(Context, new NvMap(Size));
Context.Memory.WriteInt32(OutputPosition, Handle);
}
private int AddNvMap(ServiceCtx Context, NvMap Map)
{
return NvMaps[Context.Process].Add(Map);
}
public NvMap GetNvMap(ServiceCtx Context, int Handle)
{
return NvMaps[Context.Process].GetData<NvMap>(Handle);
}
}
}