summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Subv2018-01-15 15:43:46 -0500
committerGravatar bunnei2018-01-16 18:58:06 -0500
commitf7dc637a616fd202f213a1a8eac4888167462825 (patch)
tree828f7c6f771efeba02d991448a3764b8349055e4 /src
parentSVC: Correct some return values in svcGetInfo and added TitleId and Privilege... (diff)
downloadyuzu-f7dc637a616fd202f213a1a8eac4888167462825.tar.gz
yuzu-f7dc637a616fd202f213a1a8eac4888167462825.tar.xz
yuzu-f7dc637a616fd202f213a1a8eac4888167462825.zip
AppletOE: Stub a bunch of functions required by libnx homebrew.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/am/applet_oe.cpp66
1 files changed, 62 insertions, 4 deletions
diff --git a/src/core/hle/service/am/applet_oe.cpp b/src/core/hle/service/am/applet_oe.cpp
index b629ac509..ff0390b58 100644
--- a/src/core/hle/service/am/applet_oe.cpp
+++ b/src/core/hle/service/am/applet_oe.cpp
@@ -71,6 +71,15 @@ private:
71 // Takes 3 input u8s with each field located immediately after the previous u8, these are 71 // Takes 3 input u8s with each field located immediately after the previous u8, these are
72 // bool flags. No output. 72 // bool flags. No output.
73 73
74 IPC::RequestParser rp{ctx};
75
76 struct FocusHandlingModeParams {
77 u8 unknown0;
78 u8 unknown1;
79 u8 unknown2;
80 };
81 auto flags = rp.PopRaw<FocusHandlingModeParams>();
82
74 IPC::RequestBuilder rb{ctx, 2}; 83 IPC::RequestBuilder rb{ctx, 2};
75 rb.Push(RESULT_SUCCESS); 84 rb.Push(RESULT_SUCCESS);
76 85
@@ -85,27 +94,38 @@ private:
85 } 94 }
86 95
87 void SetPerformanceModeChangedNotification(Kernel::HLERequestContext& ctx) { 96 void SetPerformanceModeChangedNotification(Kernel::HLERequestContext& ctx) {
97 IPC::RequestParser rp{ctx};
98
99 bool flag = rp.Pop<bool>();
100
88 IPC::RequestBuilder rb{ctx, 2}; 101 IPC::RequestBuilder rb{ctx, 2};
89 rb.Push(RESULT_SUCCESS); 102 rb.Push(RESULT_SUCCESS);
90 103
91 LOG_WARNING(Service, "(STUBBED) called"); 104 LOG_WARNING(Service, "(STUBBED) called flag=%u", static_cast<u32>(flag));
92 } 105 }
93 106
94 void SetOperationModeChangedNotification(Kernel::HLERequestContext& ctx) { 107 void SetOperationModeChangedNotification(Kernel::HLERequestContext& ctx) {
108 IPC::RequestParser rp{ctx};
109
110 bool flag = rp.Pop<bool>();
111
95 IPC::RequestBuilder rb{ctx, 2}; 112 IPC::RequestBuilder rb{ctx, 2};
96 rb.Push(RESULT_SUCCESS); 113 rb.Push(RESULT_SUCCESS);
97 114
98 LOG_WARNING(Service, "(STUBBED) called"); 115 LOG_WARNING(Service, "(STUBBED) called flag=%u", static_cast<u32>(flag));
99 } 116 }
100 117
101 void SetOutOfFocusSuspendingEnabled(Kernel::HLERequestContext& ctx) { 118 void SetOutOfFocusSuspendingEnabled(Kernel::HLERequestContext& ctx) {
102 // Takes 3 input u8s with each field located immediately after the previous u8, these are 119 // Takes 3 input u8s with each field located immediately after the previous u8, these are
103 // bool flags. No output. 120 // bool flags. No output.
121 IPC::RequestParser rp{ctx};
122
123 bool enabled = rp.Pop<bool>();
104 124
105 IPC::RequestBuilder rb{ctx, 2}; 125 IPC::RequestBuilder rb{ctx, 2};
106 rb.Push(RESULT_SUCCESS); 126 rb.Push(RESULT_SUCCESS);
107 127
108 LOG_WARNING(Service, "(STUBBED) called"); 128 LOG_WARNING(Service, "(STUBBED) called enabled=%u", static_cast<u32>(enabled));
109 } 129 }
110}; 130};
111 131
@@ -115,6 +135,8 @@ public:
115 static const FunctionInfo functions[] = { 135 static const FunctionInfo functions[] = {
116 {0, &ICommonStateGetter::GetEventHandle, "GetEventHandle"}, 136 {0, &ICommonStateGetter::GetEventHandle, "GetEventHandle"},
117 {1, &ICommonStateGetter::ReceiveMessage, "ReceiveMessage"}, 137 {1, &ICommonStateGetter::ReceiveMessage, "ReceiveMessage"},
138 {5, &ICommonStateGetter::GetOperationMode, "GetOperationMode"},
139 {6, &ICommonStateGetter::GetPerformanceMode, "GetPerformanceMode"},
118 {9, &ICommonStateGetter::GetCurrentFocusState, "GetCurrentFocusState"}, 140 {9, &ICommonStateGetter::GetCurrentFocusState, "GetCurrentFocusState"},
119 }; 141 };
120 RegisterHandlers(functions); 142 RegisterHandlers(functions);
@@ -123,6 +145,16 @@ public:
123 } 145 }
124 146
125private: 147private:
148 enum class FocusState : u8 {
149 InFocus = 1,
150 NotInFocus = 2,
151 };
152
153 enum class OperationMode : u8 {
154 Handheld = 0,
155 Docked = 1,
156 };
157
126 void GetEventHandle(Kernel::HLERequestContext& ctx) { 158 void GetEventHandle(Kernel::HLERequestContext& ctx) {
127 event->Signal(); 159 event->Signal();
128 160
@@ -144,7 +176,23 @@ private:
144 void GetCurrentFocusState(Kernel::HLERequestContext& ctx) { 176 void GetCurrentFocusState(Kernel::HLERequestContext& ctx) {
145 IPC::RequestBuilder rb{ctx, 3}; 177 IPC::RequestBuilder rb{ctx, 3};
146 rb.Push(RESULT_SUCCESS); 178 rb.Push(RESULT_SUCCESS);
147 rb.Push<u32>(1); // 1: In focus, 2/3: Out of focus(running in "background") 179 rb.Push(static_cast<u8>(FocusState::InFocus));
180
181 LOG_WARNING(Service, "(STUBBED) called");
182 }
183
184 void GetOperationMode(Kernel::HLERequestContext& ctx) {
185 IPC::RequestBuilder rb{ctx, 3};
186 rb.Push(RESULT_SUCCESS);
187 rb.Push(static_cast<u8>(OperationMode::Handheld));
188
189 LOG_WARNING(Service, "(STUBBED) called");
190 }
191
192 void GetPerformanceMode(Kernel::HLERequestContext& ctx) {
193 IPC::RequestBuilder rb{ctx, 3};
194 rb.Push(RESULT_SUCCESS);
195 rb.Push<u32>(0);
148 196
149 LOG_WARNING(Service, "(STUBBED) called"); 197 LOG_WARNING(Service, "(STUBBED) called");
150 } 198 }
@@ -160,6 +208,7 @@ public:
160 {66, &IApplicationFunctions::InitializeGamePlayRecording, 208 {66, &IApplicationFunctions::InitializeGamePlayRecording,
161 "InitializeGamePlayRecording"}, 209 "InitializeGamePlayRecording"},
162 {67, &IApplicationFunctions::SetGamePlayRecordingState, "SetGamePlayRecordingState"}, 210 {67, &IApplicationFunctions::SetGamePlayRecordingState, "SetGamePlayRecordingState"},
211 {40, &IApplicationFunctions::NotifyRunning, "NotifyRunning"},
163 }; 212 };
164 RegisterHandlers(functions); 213 RegisterHandlers(functions);
165 } 214 }
@@ -187,6 +236,15 @@ private:
187 void SetGamePlayRecordingState(Kernel::HLERequestContext& ctx) { 236 void SetGamePlayRecordingState(Kernel::HLERequestContext& ctx) {
188 IPC::RequestBuilder rb{ctx, 2}; 237 IPC::RequestBuilder rb{ctx, 2};
189 rb.Push(RESULT_SUCCESS); 238 rb.Push(RESULT_SUCCESS);
239
240 LOG_WARNING(Service, "(STUBBED) called");
241 }
242
243 void NotifyRunning(Kernel::HLERequestContext& ctx) {
244 IPC::RequestBuilder rb{ctx, 3};
245 rb.Push(RESULT_SUCCESS);
246 rb.Push<u8>(0); // Unknown, seems to be ignored by official processes
247
190 LOG_WARNING(Service, "(STUBBED) called"); 248 LOG_WARNING(Service, "(STUBBED) called");
191 } 249 }
192}; 250};