1
1
mirror of https://github.com/ryujinx-mirror/ryujinx.git synced 2025-09-21 19:32:01 -05:00
This commit is contained in:
gdkchan
2018-02-04 20:08:20 -03:00
commit b7e1d9930d
230 changed files with 17548 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
using Ryujinx.OsHle.Utilities;
using System;
using System.Collections.Generic;
namespace Ryujinx.OsHle.Handles
{
class HDomain : HSession
{
private Dictionary<int, object> Objects;
private IdPool ObjIds;
public HDomain(HSession Session) : base(Session)
{
Objects = new Dictionary<int, object>();
ObjIds = new IdPool();
}
public int GenertateObjectId(object Obj)
{
int Id = ObjIds.GenerateId();
if (Id == -1)
{
throw new InvalidOperationException();
}
Objects.Add(Id, Obj);
return Id;
}
public void DeleteObject(int Id)
{
if (Objects.TryGetValue(Id, out object Obj))
{
if (Obj is IDisposable DisposableObj)
{
DisposableObj.Dispose();
}
ObjIds.DeleteId(Id);
Objects.Remove(Id);
}
}
public object GetObject(int Id)
{
if (Objects.TryGetValue(Id, out object Obj))
{
return Obj;
}
return null;
}
}
}

View File

@@ -0,0 +1,7 @@
namespace Ryujinx.OsHle.Handles
{
class HEvent
{
}
}

View File

@@ -0,0 +1,18 @@
namespace Ryujinx.OsHle.Handles
{
class HNvMap
{
public int Id { get; private set; }
public int Size { get; private set; }
public int Align { get; set; }
public int Kind { get; set; }
public long Address { get; set; }
public HNvMap(int Id, int Size)
{
this.Id = Id;
this.Size = Size;
}
}
}

View File

@@ -0,0 +1,27 @@
namespace Ryujinx.OsHle.Handles
{
class HSession
{
public string ServiceName { get; private set; }
public bool IsInitialized { get; private set; }
public int State { get; set; }
public HSession(string ServiceName)
{
this.ServiceName = ServiceName;
}
public HSession(HSession Session)
{
ServiceName = Session.ServiceName;
IsInitialized = Session.IsInitialized;
}
public void Initialize()
{
IsInitialized = true;
}
}
}

View File

@@ -0,0 +1,12 @@
namespace Ryujinx.OsHle.Handles
{
class HSessionObj : HSession
{
public object Obj { get; private set; }
public HSessionObj(HSession Session, object Obj) : base(Session)
{
this.Obj = Obj;
}
}
}

View File

@@ -0,0 +1,12 @@
namespace Ryujinx.OsHle.Handles
{
class HSharedMem
{
public long PhysPos { get; private set; }
public HSharedMem(long PhysPos)
{
this.PhysPos = PhysPos;
}
}
}

View File

@@ -0,0 +1,14 @@
using ChocolArm64;
namespace Ryujinx.OsHle.Handles
{
class HThread
{
public AThread Thread { get; private set; }
public HThread(AThread Thread)
{
this.Thread = Thread;
}
}
}

View File

@@ -0,0 +1,23 @@
using ChocolArm64.Memory;
namespace Ryujinx.OsHle.Handles
{
class HTransferMem
{
public AMemory Memory { get; private set; }
public AMemoryPerm Perm { get; private set; }
public long Position { get; private set; }
public long Size { get; private set; }
public long PhysPos { get; private set; }
public HTransferMem(AMemory Memory, AMemoryPerm Perm, long Position, long Size, long PhysPos)
{
this.Memory = Memory;
this.Perm = Perm;
this.Position = Position;
this.Size = Size;
this.PhysPos = PhysPos;
}
}
}