aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Fs/IDeviceOperator.cs
blob: 7551d6274bda49c4d47f5e91296f8a40865fc392 (plain)
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
44
45
46
47
48
using LibHac;
using LibHac.FsSrv;

namespace Ryujinx.HLE.HOS.Services.Fs
{
    class IDeviceOperator : IpcService
    {
        private LibHac.FsSrv.IDeviceOperator _baseOperator;

        public IDeviceOperator(LibHac.FsSrv.IDeviceOperator baseOperator)
        {
            _baseOperator = baseOperator;
        }

        [Command(0)]
        // IsSdCardInserted() -> b8 is_inserted
        public ResultCode IsSdCardInserted(ServiceCtx context)
        {
            Result result = _baseOperator.IsSdCardInserted(out bool isInserted);

            context.ResponseData.Write(isInserted);

            return (ResultCode)result.Value;
        }

        [Command(200)]
        // IsGameCardInserted() -> b8 is_inserted
        public ResultCode IsGameCardInserted(ServiceCtx context)
        {
            Result result = _baseOperator.IsGameCardInserted(out bool isInserted);

            context.ResponseData.Write(isInserted);

            return (ResultCode)result.Value;
        }

        [Command(202)]
        // GetGameCardHandle() -> u32 gamecard_handle
        public ResultCode GetGameCardHandle(ServiceCtx context)
        {
            Result result = _baseOperator.GetGameCardHandle(out GameCardHandle handle);

            context.ResponseData.Write(handle.Value);

            return (ResultCode)result.Value;
        }
    }
}