forked from Mirror/Ryujinx
Fix GetAvailableLanguageCodes, stub ListAddOnContent and NvGpuAsIoctlRemap (0x4114)
This commit is contained in:
parent
2d33756878
commit
9754836c1b
5 changed files with 96 additions and 27 deletions
|
@ -13,7 +13,8 @@ namespace Ryujinx.Core.OsHle.Services.Ns
|
||||||
{
|
{
|
||||||
m_Commands = new Dictionary<int, ServiceProcessRequest>()
|
m_Commands = new Dictionary<int, ServiceProcessRequest>()
|
||||||
{
|
{
|
||||||
{ 2, CountAddOnContent }
|
{ 2, CountAddOnContent },
|
||||||
|
{ 3, ListAddOnContent }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,5 +24,14 @@ namespace Ryujinx.Core.OsHle.Services.Ns
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static long ListAddOnContent(ServiceCtx Context)
|
||||||
|
{
|
||||||
|
//TODO: This is supposed to write a u32 array aswell.
|
||||||
|
//It's unknown what it contains.
|
||||||
|
Context.ResponseData.Write(0);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,6 +5,7 @@ using Ryujinx.Core.OsHle.Utilities;
|
||||||
using Ryujinx.Graphics.Gpu;
|
using Ryujinx.Graphics.Gpu;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace Ryujinx.Core.OsHle.Services.Nv
|
namespace Ryujinx.Core.OsHle.Services.Nv
|
||||||
{
|
{
|
||||||
|
@ -45,6 +46,7 @@ namespace Ryujinx.Core.OsHle.Services.Nv
|
||||||
{ ("/dev/nvhost-as-gpu", 0x4106), NvGpuAsIoctlMapBufferEx },
|
{ ("/dev/nvhost-as-gpu", 0x4106), NvGpuAsIoctlMapBufferEx },
|
||||||
{ ("/dev/nvhost-as-gpu", 0x4108), NvGpuAsIoctlGetVaRegions },
|
{ ("/dev/nvhost-as-gpu", 0x4108), NvGpuAsIoctlGetVaRegions },
|
||||||
{ ("/dev/nvhost-as-gpu", 0x4109), NvGpuAsIoctlInitializeEx },
|
{ ("/dev/nvhost-as-gpu", 0x4109), NvGpuAsIoctlInitializeEx },
|
||||||
|
{ ("/dev/nvhost-as-gpu", 0x4114), NvGpuAsIoctlRemap },
|
||||||
{ ("/dev/nvhost-ctrl", 0x001b), NvHostIoctlCtrlGetConfig },
|
{ ("/dev/nvhost-ctrl", 0x001b), NvHostIoctlCtrlGetConfig },
|
||||||
{ ("/dev/nvhost-ctrl", 0x001d), NvHostIoctlCtrlEventWait },
|
{ ("/dev/nvhost-ctrl", 0x001d), NvHostIoctlCtrlEventWait },
|
||||||
{ ("/dev/nvhost-ctrl-gpu", 0x4701), NvGpuIoctlZcullGetCtxSize },
|
{ ("/dev/nvhost-ctrl-gpu", 0x4701), NvGpuIoctlZcullGetCtxSize },
|
||||||
|
@ -291,6 +293,35 @@ namespace Ryujinx.Core.OsHle.Services.Nv
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private long NvGpuAsIoctlRemap(ServiceCtx Context)
|
||||||
|
{
|
||||||
|
Context.RequestData.BaseStream.Seek(-4, SeekOrigin.Current);
|
||||||
|
|
||||||
|
int Cmd = Context.RequestData.ReadInt32();
|
||||||
|
|
||||||
|
int Size = (Cmd >> 16) & 0xff;
|
||||||
|
|
||||||
|
int Count = Size / 0x18;
|
||||||
|
|
||||||
|
long Position = Context.Request.GetSendBuffPtr();
|
||||||
|
|
||||||
|
MemReader Reader = new MemReader(Context.Memory, Position);
|
||||||
|
|
||||||
|
for (int Index = 0; Index < Count; Index++)
|
||||||
|
{
|
||||||
|
int Flags = Reader.ReadInt32();
|
||||||
|
int Kind = Reader.ReadInt32();
|
||||||
|
int Handle = Reader.ReadInt32();
|
||||||
|
int Padding = Reader.ReadInt32();
|
||||||
|
int Offset = Reader.ReadInt32();
|
||||||
|
int Pages = Reader.ReadInt32();
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
private long NvHostIoctlCtrlGetConfig(ServiceCtx Context)
|
private long NvHostIoctlCtrlGetConfig(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
long Position = Context.Request.GetSendBuffPtr();
|
long Position = Context.Request.GetSendBuffPtr();
|
||||||
|
|
|
@ -1,12 +1,31 @@
|
||||||
using ChocolArm64.Memory;
|
|
||||||
using Ryujinx.Core.OsHle.Ipc;
|
using Ryujinx.Core.OsHle.Ipc;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Ryujinx.Core.OsHle.Services.Set
|
namespace Ryujinx.Core.OsHle.Services.Set
|
||||||
{
|
{
|
||||||
class ServiceSet : IpcService
|
class ServiceSet : IpcService
|
||||||
{
|
{
|
||||||
|
private static string[] LanguageCodes = new string[]
|
||||||
|
{
|
||||||
|
"ja",
|
||||||
|
"en-US",
|
||||||
|
"fr",
|
||||||
|
"de",
|
||||||
|
"it",
|
||||||
|
"es",
|
||||||
|
"zh-CN",
|
||||||
|
"ko",
|
||||||
|
"nl",
|
||||||
|
"pt",
|
||||||
|
"ru",
|
||||||
|
"zh-TW",
|
||||||
|
"en-GB",
|
||||||
|
"fr-CA",
|
||||||
|
"es-419",
|
||||||
|
"zh-Hans",
|
||||||
|
"zh-Hant"
|
||||||
|
};
|
||||||
|
|
||||||
private Dictionary<int, ServiceProcessRequest> m_Commands;
|
private Dictionary<int, ServiceProcessRequest> m_Commands;
|
||||||
|
|
||||||
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
|
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
|
||||||
|
@ -20,32 +39,41 @@ namespace Ryujinx.Core.OsHle.Services.Set
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private const int LangCodesCount = 13;
|
|
||||||
|
|
||||||
public static long GetAvailableLanguageCodes(ServiceCtx Context)
|
public static long GetAvailableLanguageCodes(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
int PtrBuffSize = Context.RequestData.ReadInt32();
|
long Position = Context.Request.RecvListBuff[0].Position;
|
||||||
|
short Size = Context.Request.RecvListBuff[0].Size;
|
||||||
|
|
||||||
if (Context.Request.RecvListBuff.Count > 0)
|
int Count = (int)((uint)Size / 8);
|
||||||
|
|
||||||
|
if (Count > LanguageCodes.Length)
|
||||||
{
|
{
|
||||||
long Position = Context.Request.RecvListBuff[0].Position;
|
Count = LanguageCodes.Length;
|
||||||
short Size = Context.Request.RecvListBuff[0].Size;
|
}
|
||||||
|
|
||||||
//This should return an array of ints with values matching the LanguageCode enum.
|
for (int Index = 0; Index < Count; Index++)
|
||||||
foreach (long value in new long[] { 0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L })
|
{
|
||||||
|
string LanguageCode = LanguageCodes[Index];
|
||||||
|
|
||||||
|
foreach (char Chr in LanguageCode)
|
||||||
{
|
{
|
||||||
AMemoryHelper.WriteBytes(Context.Memory, Position += 8, BitConverter.GetBytes(value));
|
Context.Memory.WriteByte(Position++, (byte)Chr);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int Offs = 0; Offs < (8 - LanguageCode.Length); Offs++)
|
||||||
|
{
|
||||||
|
Context.Memory.WriteByte(Position++, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Context.ResponseData.Write(LangCodesCount);
|
Context.ResponseData.Write(Count);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long GetAvailableLanguageCodeCount(ServiceCtx Context)
|
public static long GetAvailableLanguageCodeCount(ServiceCtx Context)
|
||||||
{
|
{
|
||||||
Context.ResponseData.Write(LangCodesCount);
|
Context.ResponseData.Write(LanguageCodes.Length);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue