More Vi/NvFlinger/NvDrv stubs, allow paths starting with //, do not allow paths that don't start with at least a /, increase map region size

This commit is contained in:
gdkchan 2018-03-06 17:27:50 -03:00
parent 4038e63de1
commit 4f177c9ee7
6 changed files with 50 additions and 4 deletions

View File

@ -7,7 +7,7 @@ namespace Ryujinx.Core.OsHle
public const long AddrSpaceStart = 0x08000000;
public const long MapRegionAddress = 0x10000000;
public const long MapRegionSize = 0x10000000;
public const long MapRegionSize = 0x20000000;
public const long MainStackSize = 0x100000;

View File

@ -38,6 +38,7 @@ namespace Ryujinx.Core.OsHle.IpcServices.NvServices
{ ("/dev/nvmap", 0x0101), NvMapIocCreate },
{ ("/dev/nvmap", 0x0103), NvMapIocFromId },
{ ("/dev/nvmap", 0x0104), NvMapIocAlloc },
{ ("/dev/nvmap", 0x0105), NvMapIocFree },
{ ("/dev/nvmap", 0x0109), NvMapIocParam },
{ ("/dev/nvmap", 0x010e), NvMapIocGetId },
};
@ -585,6 +586,25 @@ namespace Ryujinx.Core.OsHle.IpcServices.NvServices
return 0;
}
private static long NvMapIocFree(ServiceCtx Context)
{
long Position = Context.Request.GetSendBuffPtr();
MemReader Reader = new MemReader(Context.Memory, Position);
MemWriter Writer = new MemWriter(Context.Memory, Position + 8);
int Handle = Reader.ReadInt32();
int Padding = Reader.ReadInt32();
HNvMap NvMap = Context.Ns.Os.Handles.GetData<HNvMap>(Handle);
Writer.WriteInt64(0);
Writer.WriteInt32(NvMap.Size);
Writer.WriteInt32(0);
return 0;
}
private static long NvMapIocParam(ServiceCtx Context)
{
long Position = Context.Request.GetSendBuffPtr();

View File

@ -26,6 +26,7 @@ namespace Ryujinx.Core.OsHle.IpcServices.Vi
{ 1010, OpenDisplay },
{ 1020, CloseDisplay },
{ 2020, OpenLayer },
{ 2021, CloseLayer },
{ 2030, CreateStrayLayer },
{ 2101, SetLayerScalingMode },
{ 5202, GetDisplayVSyncEvent }
@ -96,6 +97,11 @@ namespace Ryujinx.Core.OsHle.IpcServices.Vi
return 0;
}
public long CloseLayer(ServiceCtx Context)
{
return 0;
}
public long CreateStrayLayer(ServiceCtx Context)
{
long LayerFlags = Context.RequestData.ReadInt64();

View File

@ -14,6 +14,7 @@ namespace Ryujinx.Core.OsHle.IpcServices.Vi
m_Commands = new Dictionary<int, ServiceProcessRequest>()
{
{ 2010, CreateManagedLayer },
{ 2011, DestroyManagedLayer },
{ 6000, AddToLayerStack }
};
}
@ -25,6 +26,11 @@ namespace Ryujinx.Core.OsHle.IpcServices.Vi
return 0;
}
public long DestroyManagedLayer(ServiceCtx Context)
{
return 0;
}
public static long AddToLayerStack(ServiceCtx Context)
{
return 0;

View File

@ -70,6 +70,7 @@ namespace Ryujinx.Core.OsHle.IpcServices.Android
{ ("android.gui.IGraphicBufferProducer", 0x8), GbpCancelBuffer },
{ ("android.gui.IGraphicBufferProducer", 0x9), GbpQuery },
{ ("android.gui.IGraphicBufferProducer", 0xa), GbpConnect },
{ ("android.gui.IGraphicBufferProducer", 0xb), GbpDisconnect },
{ ("android.gui.IGraphicBufferProducer", 0xe), GbpPreallocBuffer }
};
@ -212,6 +213,11 @@ namespace Ryujinx.Core.OsHle.IpcServices.Android
return MakeReplyParcel(Context, 1280, 720, 0, 0, 0);
}
private long GbpDisconnect(ServiceCtx Context, BinaryReader ParcelReader)
{
return MakeReplyParcel(Context, 0);
}
private long GbpPreallocBuffer(ServiceCtx Context, BinaryReader ParcelReader)
{
int Slot = ParcelReader.ReadInt32();

View File

@ -18,10 +18,18 @@ namespace Ryujinx.Core
public string GetFullPath(string BasePath, string FileName)
{
if (FileName.StartsWith('/'))
if (FileName.StartsWith("//"))
{
FileName = FileName.Substring(2);
}
else if (FileName.StartsWith('/'))
{
FileName = FileName.Substring(1);
}
else
{
return null;
}
string FullPath = Path.GetFullPath(Path.Combine(BasePath, FileName));