aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Horizon/Lbl/Ipc/LblController.cs
blob: 0a27d5efacd78c0d215a860f659e72ac308aaef0 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
using Ryujinx.Horizon.Common;
using Ryujinx.Horizon.Sdk.Lbl;
using Ryujinx.Horizon.Sdk.Sf;

namespace Ryujinx.Horizon.Lbl.Ipc
{
    partial class LblController : ILblController
    {
        private bool _vrModeEnabled;
        private float _currentBrightnessSettingForVrMode;

        [CmifCommand(17)]
        public Result SetBrightnessReflectionDelayLevel(float unknown0, float unknown1)
        {
            // NOTE: Stubbed in system module.

            return Result.Success;
        }

        [CmifCommand(18)]
        public Result GetBrightnessReflectionDelayLevel(out float unknown1, float unknown0)
        {
            // NOTE: Stubbed in system module.

            unknown1 = 0.0f;

            return Result.Success;
        }

        [CmifCommand(19)]
        public Result SetCurrentBrightnessMapping(float unknown0, float unknown1, float unknown2)
        {
            // NOTE: Stubbed in system module.

            return Result.Success;
        }

        [CmifCommand(20)]
        public Result GetCurrentBrightnessMapping(out float unknown0, out float unknown1, out float unknown2)
        {
            // NOTE: Stubbed in system module.

            unknown0 = 0.0f;
            unknown1 = 0.0f;
            unknown2 = 0.0f;

            return Result.Success;
        }

        [CmifCommand(21)]
        public Result SetCurrentAmbientLightSensorMapping(float unknown0, float unknown1, float unknown2)
        {
            // NOTE: Stubbed in system module.

            return Result.Success;
        }

        [CmifCommand(22)]
        public Result GetCurrentAmbientLightSensorMapping(out float unknown0, out float unknown1, out float unknown2)
        {
            // NOTE: Stubbed in system module.

            unknown0 = 0.0f;
            unknown1 = 0.0f;
            unknown2 = 0.0f;

            return Result.Success;
        }

        [CmifCommand(24)]
        public Result SetCurrentBrightnessSettingForVrMode(float currentBrightnessSettingForVrMode)
        {
            if (float.IsNaN(currentBrightnessSettingForVrMode) || float.IsInfinity(currentBrightnessSettingForVrMode))
            {
                _currentBrightnessSettingForVrMode = 0.0f;
            }
            else
            {
                _currentBrightnessSettingForVrMode = currentBrightnessSettingForVrMode;
            }

            return Result.Success;
        }

        [CmifCommand(25)]
        public Result GetCurrentBrightnessSettingForVrMode(out float currentBrightnessSettingForVrMode)
        {
            if (float.IsNaN(_currentBrightnessSettingForVrMode) || float.IsInfinity(_currentBrightnessSettingForVrMode))
            {
                currentBrightnessSettingForVrMode = 0.0f;
            }
            else
            {
                currentBrightnessSettingForVrMode = _currentBrightnessSettingForVrMode;
            }

            return Result.Success;
        }

        [CmifCommand(26)]
        public Result EnableVrMode()
        {
            _vrModeEnabled = true;

            // NOTE: The service checks _vrModeEnabled field value in a thread and then changes the screen brightness.
            //       Since we don't support that, it's fine to do nothing.

            return Result.Success;
        }

        [CmifCommand(27)]
        public Result DisableVrMode()
        {
            _vrModeEnabled = false;

            // NOTE: The service checks _vrModeEnabled field value in a thread and then changes the screen brightness.
            //       Since we don't support that, it's fine to do nothing.

            return Result.Success;
        }

        [CmifCommand(28)]
        public Result IsVrModeEnabled(out bool vrModeEnabled)
        {
            vrModeEnabled = _vrModeEnabled;

            return Result.Success;
        }
    }
}