|
|
@@ -3,7 +3,10 @@ using Ryujinx.HLE.HOS.Ipc;
|
|
|
using Ryujinx.HLE.HOS.SystemState;
|
|
|
using Ryujinx.HLE.Logging;
|
|
|
using Ryujinx.HLE.Utilities;
|
|
|
+using System;
|
|
|
using System.Collections.Generic;
|
|
|
+using System.IO;
|
|
|
+using System.Reflection;
|
|
|
using System.Text;
|
|
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.Acc
|
|
|
@@ -16,15 +19,21 @@ namespace Ryujinx.HLE.HOS.Services.Acc
|
|
|
|
|
|
private UserProfile Profile;
|
|
|
|
|
|
+ private Stream ProfilePictureStream;
|
|
|
+
|
|
|
public IProfile(UserProfile Profile)
|
|
|
{
|
|
|
m_Commands = new Dictionary<int, ServiceProcessRequest>()
|
|
|
{
|
|
|
- { 0, Get },
|
|
|
- { 1, GetBase }
|
|
|
+ { 0, Get },
|
|
|
+ { 1, GetBase },
|
|
|
+ { 10, GetImageSize },
|
|
|
+ { 11, LoadImage },
|
|
|
};
|
|
|
|
|
|
this.Profile = Profile;
|
|
|
+
|
|
|
+ ProfilePictureStream = Assembly.GetCallingAssembly().GetManifestResourceStream("Ryujinx.HLE.RyujinxProfileImage.jpg");
|
|
|
}
|
|
|
|
|
|
public long Get(ServiceCtx Context)
|
|
|
@@ -54,5 +63,28 @@ namespace Ryujinx.HLE.HOS.Services.Acc
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
+
|
|
|
+ private long LoadImage(ServiceCtx Context)
|
|
|
+ {
|
|
|
+ long BufferPosition = Context.Request.ReceiveBuff[0].Position;
|
|
|
+ long BufferLen = Context.Request.ReceiveBuff[0].Size;
|
|
|
+
|
|
|
+ byte[] ProfilePictureData = new byte[BufferLen];
|
|
|
+
|
|
|
+ ProfilePictureStream.Read(ProfilePictureData, 0, ProfilePictureData.Length);
|
|
|
+
|
|
|
+ Context.Memory.WriteBytes(BufferPosition, ProfilePictureData);
|
|
|
+
|
|
|
+ Context.ResponseData.Write(ProfilePictureStream.Length);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ private long GetImageSize(ServiceCtx Context)
|
|
|
+ {
|
|
|
+ Context.ResponseData.Write(ProfilePictureStream.Length);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
}
|
|
|
}
|