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

62 lines
No EOL
1.7 KiB
C#

using ChocolArm64.Memory;
using Ryujinx.Core.Logging;
using Ryujinx.Core.OsHle.Ipc;
using System.Collections.Generic;
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)
{
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);
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;
}
}
}