aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE/HOS/Services/Arp/ApplicationLaunchProperty.cs
blob: 3e4eca0ac98479075ee25fcd6df2255963b4e836 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using LibHac.Ncm;

namespace Ryujinx.HLE.HOS.Services.Arp
{
    class ApplicationLaunchProperty
    {
        public ulong TitleId;
        public int   Version;
        public byte  BaseGameStorageId;
        public byte  UpdateGameStorageId;
#pragma warning disable CS0649
        public short Padding;
#pragma warning restore CS0649

        public static ApplicationLaunchProperty Default
        {
            get
            {
                return new ApplicationLaunchProperty
                {
                    TitleId             = 0x00,
                    Version             = 0x00,
                    BaseGameStorageId   = (byte)StorageId.BuiltInSystem,
                    UpdateGameStorageId = (byte)StorageId.None
                };
            }
        }

        public static ApplicationLaunchProperty GetByPid(ServiceCtx context)
        {
            // TODO: Handle ApplicationLaunchProperty as array when pid will be supported and return the right item.
            //       For now we can hardcode values, and fix it after GetApplicationLaunchProperty is implemented.

            return new ApplicationLaunchProperty
            {
                TitleId             = context.Device.Processes.ActiveApplication.ProgramId,
                Version             = 0x00,
                BaseGameStorageId   = (byte)StorageId.BuiltInSystem,
                UpdateGameStorageId = (byte)StorageId.None
            };
        }
    }
}