2020-02-02 04:24:17 +01:00
|
|
|
|
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
|
|
|
|
using System.IO;
|
2018-06-02 18:46:09 -04:00
|
|
|
|
|
2019-09-19 02:45:11 +02:00
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.Storage
|
2018-06-02 18:46:09 -04:00
|
|
|
|
{
|
|
|
|
|
class StorageHelper
|
|
|
|
|
{
|
|
|
|
|
private const uint LaunchParamsMagic = 0xc79497ca;
|
|
|
|
|
|
2020-02-02 04:24:17 +01:00
|
|
|
|
public static byte[] MakeLaunchParams(UserProfile userProfile)
|
2018-06-02 18:46:09 -04:00
|
|
|
|
{
|
2019-07-01 21:39:22 -05:00
|
|
|
|
// Size needs to be at least 0x88 bytes otherwise application errors.
|
2018-12-06 05:16:24 -06:00
|
|
|
|
using (MemoryStream ms = new MemoryStream())
|
2018-06-02 18:46:09 -04:00
|
|
|
|
{
|
2018-12-06 05:16:24 -06:00
|
|
|
|
BinaryWriter writer = new BinaryWriter(ms);
|
2018-06-02 18:46:09 -04:00
|
|
|
|
|
2018-12-06 05:16:24 -06:00
|
|
|
|
ms.SetLength(0x88);
|
2018-06-02 18:46:09 -04:00
|
|
|
|
|
2018-12-06 05:16:24 -06:00
|
|
|
|
writer.Write(LaunchParamsMagic);
|
2019-09-19 02:45:11 +02:00
|
|
|
|
writer.Write(1); // IsAccountSelected? Only lower 8 bits actually used.
|
2020-02-02 04:24:17 +01:00
|
|
|
|
userProfile.UserId.Write(writer);
|
2018-06-02 18:46:09 -04:00
|
|
|
|
|
2018-12-06 05:16:24 -06:00
|
|
|
|
return ms.ToArray();
|
2018-06-02 18:46:09 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|