mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-11-08 16:28:49 +00:00
7f0bee2ff8
Services Bsd, Nifm & SSL stubs implementations Objects IGeneralService, IRequest stubs implementations. Fake-Fix GetAvailableLanguageCodes stub too ^^!
45 lines
1.4 KiB
C#
45 lines
1.4 KiB
C#
using ChocolArm64.Memory;
|
|
using Ryujinx.Core.OsHle.Ipc;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Ryujinx.Core.OsHle.IpcServices.Set
|
|
{
|
|
class ServiceSet : IIpcService
|
|
{
|
|
private Dictionary<int, ServiceProcessRequest> m_Commands;
|
|
|
|
public IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
|
|
|
|
public ServiceSet()
|
|
{
|
|
m_Commands = new Dictionary<int, ServiceProcessRequest>()
|
|
{
|
|
{ 1, GetAvailableLanguageCodes }
|
|
};
|
|
}
|
|
|
|
private const int LangCodesCount = 13;
|
|
|
|
public static long GetAvailableLanguageCodes(ServiceCtx Context)
|
|
{
|
|
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.
|
|
foreach (long value in new long[] { 0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L })
|
|
{
|
|
AMemoryHelper.WriteBytes(Context.Memory, Position += 8, BitConverter.GetBytes(value));
|
|
}
|
|
}
|
|
|
|
Context.ResponseData.Write(LangCodesCount);
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
} |