Ryujinx/Ryujinx.Core/OsHle/Services/Acc/IProfile.cs

62 lines
1.7 KiB
C#
Raw Normal View History

using ChocolArm64.Memory;
2018-04-24 20:57:39 +02:00
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic;
2018-03-20 21:00:00 +01:00
namespace Ryujinx.Core.OsHle.Services.Acc
{
class IProfile : IpcService
{
private Dictionary<int, ServiceProcessRequest> m_Commands;
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
private byte[] profile_image = { };
public IProfile()
{
m_Commands = new Dictionary<int, ServiceProcessRequest>()
{
{ 1, GetBase },
{ 10, GetImageSize },
{ 11, LoadImage }
};
}
public long GetBase(ServiceCtx Context)
{
2018-04-24 20:57:39 +02:00
Context.Ns.Log.PrintStub(LogClass.ServiceAcc, "Stubbed.");
Context.ResponseData.Write(0L);
Context.ResponseData.Write(0L);
Context.ResponseData.Write(0L);
Context.ResponseData.Write(0L);
Context.ResponseData.Write(0L);
Context.ResponseData.Write(0L);
Context.ResponseData.Write(0L);
2018-04-24 20:57:39 +02:00
return 0;
}
public long GetImageSize(ServiceCtx Context)
{
Context.Ns.Log.PrintStub(LogClass.ServiceAcc, "Stubbed.");
Context.ResponseData.Write(profile_image.Length);
return 0;
}
public long LoadImage(ServiceCtx Context)
{
Context.Ns.Log.PrintStub(LogClass.ServiceAcc, "Stubbed.");
(long Position, long Size) = Context.Request.GetBufferType0x22();
Context.ResponseData.Write(profile_image.Length);
Context.Memory.WriteBytes(Position, profile_image);
return 0;
}
}
}