2018-02-05 00:08:20 +01:00
|
|
|
using ChocolArm64.Memory;
|
2018-02-25 05:34:16 +01:00
|
|
|
using Ryujinx.Core.OsHle.Ipc;
|
|
|
|
using System.Collections.Generic;
|
2018-02-05 00:08:20 +01:00
|
|
|
|
2018-02-25 05:34:16 +01:00
|
|
|
namespace Ryujinx.Core.OsHle.IpcServices.Set
|
2018-02-05 00:08:20 +01:00
|
|
|
{
|
2018-02-25 05:34:16 +01:00
|
|
|
class ServiceSet : IIpcService
|
2018-02-05 00:08:20 +01:00
|
|
|
{
|
2018-02-25 05:34:16 +01:00
|
|
|
private Dictionary<int, ServiceProcessRequest> m_Commands;
|
|
|
|
|
|
|
|
public IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
|
|
|
|
|
|
|
|
public ServiceSet()
|
|
|
|
{
|
|
|
|
m_Commands = new Dictionary<int, ServiceProcessRequest>()
|
|
|
|
{
|
|
|
|
{ 1, GetAvailableLanguageCodes }
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-02-05 00:08:20 +01:00
|
|
|
private const int LangCodesCount = 13;
|
|
|
|
|
2018-02-25 05:34:16 +01:00
|
|
|
public static long GetAvailableLanguageCodes(ServiceCtx Context)
|
2018-02-05 00:08:20 +01:00
|
|
|
{
|
|
|
|
int PtrBuffSize = Context.RequestData.ReadInt32();
|
|
|
|
|
|
|
|
if (Context.Request.RecvListBuff.Count > 0)
|
|
|
|
{
|
|
|
|
long Position = Context.Request.RecvListBuff[0].Position;
|
|
|
|
short Size = Context.Request.RecvListBuff[0].Size;
|
|
|
|
|
|
|
|
//This should return an array of ints with values matching the LanguageCode enum.
|
|
|
|
byte[] Data = new byte[Size];
|
|
|
|
|
|
|
|
Data[0] = 0;
|
|
|
|
Data[1] = 1;
|
|
|
|
|
|
|
|
AMemoryHelper.WriteBytes(Context.Memory, Position, Data);
|
|
|
|
}
|
|
|
|
|
|
|
|
Context.ResponseData.Write(LangCodesCount);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|