summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-02-07 07:51:35 -0800
committerGravatar GitHub2018-02-07 07:51:35 -0800
commit869d65e923ced3c71c771c2da97a07ba78ff7d9d (patch)
tree9bb1128673a0e925389bc84f39a6a934c3e1b5dd /src
parentMerge pull request #166 from mailwl/hid-SetNpadHandhelpActivationMode (diff)
parentService: stub some functions in am, audio, time, vi services (diff)
downloadyuzu-869d65e923ced3c71c771c2da97a07ba78ff7d9d.tar.gz
yuzu-869d65e923ced3c71c771c2da97a07ba78ff7d9d.tar.xz
yuzu-869d65e923ced3c71c771c2da97a07ba78ff7d9d.zip
Merge pull request #168 from mailwl/new-stubs
Service: stub some functions in am, audio, time, vi services
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/am/am.cpp78
-rw-r--r--src/core/hle/service/am/am.h5
-rw-r--r--src/core/hle/service/audio/audren_u.cpp51
-rw-r--r--src/core/hle/service/audio/audren_u.h4
-rw-r--r--src/core/hle/service/filesystem/fsp_srv.cpp1
-rw-r--r--src/core/hle/service/hid/hid.cpp22
-rw-r--r--src/core/hle/service/time/time.cpp13
-rw-r--r--src/core/hle/service/vi/vi.cpp22
-rw-r--r--src/core/hle/service/vi/vi.h1
9 files changed, 191 insertions, 6 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index b3341d9ad..07cea8717 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -45,6 +45,7 @@ ISelfController::ISelfController(std::shared_ptr<NVFlinger::NVFlinger> nvflinger
45 static const FunctionInfo functions[] = { 45 static const FunctionInfo functions[] = {
46 {1, &ISelfController::LockExit, "LockExit"}, 46 {1, &ISelfController::LockExit, "LockExit"},
47 {2, &ISelfController::UnlockExit, "UnlockExit"}, 47 {2, &ISelfController::UnlockExit, "UnlockExit"},
48 {9, &ISelfController::GetLibraryAppletLaunchableEvent, "GetLibraryAppletLaunchableEvent"},
48 {11, &ISelfController::SetOperationModeChangedNotification, 49 {11, &ISelfController::SetOperationModeChangedNotification,
49 "SetOperationModeChangedNotification"}, 50 "SetOperationModeChangedNotification"},
50 {12, &ISelfController::SetPerformanceModeChangedNotification, 51 {12, &ISelfController::SetPerformanceModeChangedNotification,
@@ -55,6 +56,9 @@ ISelfController::ISelfController(std::shared_ptr<NVFlinger::NVFlinger> nvflinger
55 {40, &ISelfController::CreateManagedDisplayLayer, "CreateManagedDisplayLayer"}, 56 {40, &ISelfController::CreateManagedDisplayLayer, "CreateManagedDisplayLayer"},
56 }; 57 };
57 RegisterHandlers(functions); 58 RegisterHandlers(functions);
59
60 launchable_event =
61 Kernel::Event::Create(Kernel::ResetType::OneShot, "ISelfController:LaunchableEvent");
58} 62}
59 63
60void ISelfController::SetFocusHandlingMode(Kernel::HLERequestContext& ctx) { 64void ISelfController::SetFocusHandlingMode(Kernel::HLERequestContext& ctx) {
@@ -132,6 +136,16 @@ void ISelfController::UnlockExit(Kernel::HLERequestContext& ctx) {
132 LOG_WARNING(Service_AM, "(STUBBED) called"); 136 LOG_WARNING(Service_AM, "(STUBBED) called");
133} 137}
134 138
139void ISelfController::GetLibraryAppletLaunchableEvent(Kernel::HLERequestContext& ctx) {
140 launchable_event->Signal();
141
142 IPC::ResponseBuilder rb{ctx, 2, 1};
143 rb.Push(RESULT_SUCCESS);
144 rb.PushCopyObjects(launchable_event);
145
146 LOG_WARNING(Service_AM, "(STUBBED) called");
147}
148
135void ISelfController::CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx) { 149void ISelfController::CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx) {
136 // TODO(Subv): Find out how AM determines the display to use, for now just create the layer 150 // TODO(Subv): Find out how AM determines the display to use, for now just create the layer
137 // in the Default display. 151 // in the Default display.
@@ -200,7 +214,69 @@ void ICommonStateGetter::GetPerformanceMode(Kernel::HLERequestContext& ctx) {
200 LOG_WARNING(Service_AM, "(STUBBED) called"); 214 LOG_WARNING(Service_AM, "(STUBBED) called");
201} 215}
202 216
203ILibraryAppletCreator::ILibraryAppletCreator() : ServiceFramework("ILibraryAppletCreator") {} 217class ILibraryAppletAccessor final : public ServiceFramework<ILibraryAppletAccessor> {
218public:
219 explicit ILibraryAppletAccessor() : ServiceFramework("ILibraryAppletAccessor") {
220 static const FunctionInfo functions[] = {
221 {0, &ILibraryAppletAccessor::GetAppletStateChangedEvent, "GetAppletStateChangedEvent"},
222 {1, nullptr, "IsCompleted"},
223 {10, nullptr, "Start"},
224 {20, nullptr, "RequestExit"},
225 {25, nullptr, "Terminate"},
226 {30, nullptr, "GetResult"},
227 {50, nullptr, "SetOutOfFocusApplicationSuspendingEnabled"},
228 {100, nullptr, "PushInData"},
229 {101, nullptr, "PopOutData"},
230 {102, nullptr, "PushExtraStorage"},
231 {103, nullptr, "PushInteractiveInData"},
232 {104, nullptr, "PopInteractiveOutData"},
233 {105, nullptr, "GetPopOutDataEvent"},
234 {106, nullptr, "GetPopInteractiveOutDataEvent"},
235 {120, nullptr, "NeedsToExitProcess"},
236 {120, nullptr, "GetLibraryAppletInfo"},
237 {150, nullptr, "RequestForAppletToGetForeground"},
238 {160, nullptr, "GetIndirectLayerConsumerHandle"},
239 };
240 RegisterHandlers(functions);
241
242 state_changed_event = Kernel::Event::Create(Kernel::ResetType::OneShot,
243 "ILibraryAppletAccessor:StateChangedEvent");
244 }
245
246private:
247 void GetAppletStateChangedEvent(Kernel::HLERequestContext& ctx) {
248 state_changed_event->Signal();
249
250 IPC::ResponseBuilder rb{ctx, 2, 1};
251 rb.Push(RESULT_SUCCESS);
252 rb.PushCopyObjects(state_changed_event);
253
254 LOG_WARNING(Service_AM, "(STUBBED) called");
255 }
256
257 Kernel::SharedPtr<Kernel::Event> state_changed_event;
258};
259
260ILibraryAppletCreator::ILibraryAppletCreator() : ServiceFramework("ILibraryAppletCreator") {
261 static const FunctionInfo functions[] = {
262 {0, &ILibraryAppletCreator::CreateLibraryApplet, "CreateLibraryApplet"},
263 {1, nullptr, "TerminateAllLibraryApplets"},
264 {2, nullptr, "AreAnyLibraryAppletsLeft"},
265 {10, nullptr, "CreateStorage"},
266 {11, nullptr, "CreateTransferMemoryStorage"},
267 {12, nullptr, "CreateHandleStorage"},
268 };
269 RegisterHandlers(functions);
270}
271
272void ILibraryAppletCreator::CreateLibraryApplet(Kernel::HLERequestContext& ctx) {
273 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
274
275 rb.Push(RESULT_SUCCESS);
276 rb.PushIpcInterface<AM::ILibraryAppletAccessor>();
277
278 LOG_DEBUG(Service_AM, "called");
279}
204 280
205class IStorageAccessor final : public ServiceFramework<IStorageAccessor> { 281class IStorageAccessor final : public ServiceFramework<IStorageAccessor> {
206public: 282public:
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h
index 0f17f8377..793ac6555 100644
--- a/src/core/hle/service/am/am.h
+++ b/src/core/hle/service/am/am.h
@@ -60,9 +60,11 @@ private:
60 void SetOutOfFocusSuspendingEnabled(Kernel::HLERequestContext& ctx); 60 void SetOutOfFocusSuspendingEnabled(Kernel::HLERequestContext& ctx);
61 void LockExit(Kernel::HLERequestContext& ctx); 61 void LockExit(Kernel::HLERequestContext& ctx);
62 void UnlockExit(Kernel::HLERequestContext& ctx); 62 void UnlockExit(Kernel::HLERequestContext& ctx);
63 void GetLibraryAppletLaunchableEvent(Kernel::HLERequestContext& ctx);
63 void CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx); 64 void CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx);
64 65
65 std::shared_ptr<NVFlinger::NVFlinger> nvflinger; 66 std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
67 Kernel::SharedPtr<Kernel::Event> launchable_event;
66}; 68};
67 69
68class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> { 70class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> {
@@ -92,6 +94,9 @@ private:
92class ILibraryAppletCreator final : public ServiceFramework<ILibraryAppletCreator> { 94class ILibraryAppletCreator final : public ServiceFramework<ILibraryAppletCreator> {
93public: 95public:
94 ILibraryAppletCreator(); 96 ILibraryAppletCreator();
97
98private:
99 void CreateLibraryApplet(Kernel::HLERequestContext& ctx);
95}; 100};
96 101
97class IApplicationFunctions final : public ServiceFramework<IApplicationFunctions> { 102class IApplicationFunctions final : public ServiceFramework<IApplicationFunctions> {
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp
index 4bafdfac3..4c3a685e9 100644
--- a/src/core/hle/service/audio/audren_u.cpp
+++ b/src/core/hle/service/audio/audren_u.cpp
@@ -4,6 +4,7 @@
4 4
5#include "common/logging/log.h" 5#include "common/logging/log.h"
6#include "core/hle/ipc_helpers.h" 6#include "core/hle/ipc_helpers.h"
7#include "core/hle/kernel/event.h"
7#include "core/hle/kernel/hle_ipc.h" 8#include "core/hle/kernel/hle_ipc.h"
8#include "core/hle/service/audio/audren_u.h" 9#include "core/hle/service/audio/audren_u.h"
9 10
@@ -18,27 +19,69 @@ public:
18 {0x1, nullptr, "GetAudioRendererSampleCount"}, 19 {0x1, nullptr, "GetAudioRendererSampleCount"},
19 {0x2, nullptr, "GetAudioRendererMixBufferCount"}, 20 {0x2, nullptr, "GetAudioRendererMixBufferCount"},
20 {0x3, nullptr, "GetAudioRendererState"}, 21 {0x3, nullptr, "GetAudioRendererState"},
21 {0x4, nullptr, "RequestUpdateAudioRenderer"}, 22 {0x4, &IAudioRenderer::RequestUpdateAudioRenderer, "RequestUpdateAudioRenderer"},
22 {0x5, nullptr, "StartAudioRenderer"}, 23 {0x5, nullptr, "StartAudioRenderer"},
23 {0x6, nullptr, "StopAudioRenderer"}, 24 {0x6, nullptr, "StopAudioRenderer"},
24 {0x7, nullptr, "QuerySystemEvent"}, 25 {0x7, &IAudioRenderer::QuerySystemEvent, "QuerySystemEvent"},
25 {0x8, nullptr, "SetAudioRendererRenderingTimeLimit"}, 26 {0x8, nullptr, "SetAudioRendererRenderingTimeLimit"},
26 {0x9, nullptr, "GetAudioRendererRenderingTimeLimit"}, 27 {0x9, nullptr, "GetAudioRendererRenderingTimeLimit"},
27 }; 28 };
28 RegisterHandlers(functions); 29 RegisterHandlers(functions);
30
31 system_event =
32 Kernel::Event::Create(Kernel::ResetType::OneShot, "IAudioRenderer:SystemEvent");
29 } 33 }
30 ~IAudioRenderer() = default; 34 ~IAudioRenderer() = default;
35
36private:
37 void RequestUpdateAudioRenderer(Kernel::HLERequestContext& ctx) {
38 IPC::ResponseBuilder rb{ctx, 2};
39
40 rb.Push(RESULT_SUCCESS);
41
42 LOG_WARNING(Service_Audio, "(STUBBED) called");
43 }
44
45 void QuerySystemEvent(Kernel::HLERequestContext& ctx) {
46 // system_event->Signal();
47
48 IPC::ResponseBuilder rb{ctx, 2, 1};
49 rb.Push(RESULT_SUCCESS);
50 rb.PushCopyObjects(system_event);
51
52 LOG_WARNING(Service_Audio, "(STUBBED) called");
53 }
54
55 Kernel::SharedPtr<Kernel::Event> system_event;
31}; 56};
32 57
33AudRenU::AudRenU() : ServiceFramework("audren:u") { 58AudRenU::AudRenU() : ServiceFramework("audren:u") {
34 static const FunctionInfo functions[] = { 59 static const FunctionInfo functions[] = {
35 {0x00000000, nullptr, "OpenAudioRenderer"}, 60 {0x00000000, &AudRenU::OpenAudioRenderer, "OpenAudioRenderer"},
36 {0x00000001, nullptr, "GetAudioRendererWorkBufferSize"}, 61 {0x00000001, &AudRenU::GetAudioRendererWorkBufferSize, "GetAudioRendererWorkBufferSize"},
37 {0x00000002, nullptr, "GetAudioRenderersProcessMasterVolume"}, 62 {0x00000002, nullptr, "GetAudioRenderersProcessMasterVolume"},
38 {0x00000003, nullptr, "SetAudioRenderersProcessMasterVolume"}, 63 {0x00000003, nullptr, "SetAudioRenderersProcessMasterVolume"},
39 }; 64 };
40 RegisterHandlers(functions); 65 RegisterHandlers(functions);
41} 66}
42 67
68void AudRenU::OpenAudioRenderer(Kernel::HLERequestContext& ctx) {
69 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
70
71 rb.Push(RESULT_SUCCESS);
72 rb.PushIpcInterface<Audio::IAudioRenderer>();
73
74 LOG_DEBUG(Service_Audio, "called");
75}
76
77void AudRenU::GetAudioRendererWorkBufferSize(Kernel::HLERequestContext& ctx) {
78 IPC::ResponseBuilder rb{ctx, 4};
79
80 rb.Push(RESULT_SUCCESS);
81 rb.Push<u64>(0x1000);
82
83 LOG_WARNING(Service_Audio, "called");
84}
85
43} // namespace Audio 86} // namespace Audio
44} // namespace Service 87} // namespace Service
diff --git a/src/core/hle/service/audio/audren_u.h b/src/core/hle/service/audio/audren_u.h
index 1d9264c72..e97543742 100644
--- a/src/core/hle/service/audio/audren_u.h
+++ b/src/core/hle/service/audio/audren_u.h
@@ -17,6 +17,10 @@ class AudRenU final : public ServiceFramework<AudRenU> {
17public: 17public:
18 explicit AudRenU(); 18 explicit AudRenU();
19 ~AudRenU() = default; 19 ~AudRenU() = default;
20
21private:
22 void OpenAudioRenderer(Kernel::HLERequestContext& ctx);
23 void GetAudioRendererWorkBufferSize(Kernel::HLERequestContext& ctx);
20}; 24};
21 25
22} // namespace Audio 26} // namespace Audio
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp
index 71b82393e..aa5a3d631 100644
--- a/src/core/hle/service/filesystem/fsp_srv.cpp
+++ b/src/core/hle/service/filesystem/fsp_srv.cpp
@@ -71,6 +71,7 @@ FSP_SRV::FSP_SRV() : ServiceFramework("fsp-srv") {
71 static const FunctionInfo functions[] = { 71 static const FunctionInfo functions[] = {
72 {1, &FSP_SRV::Initalize, "Initalize"}, 72 {1, &FSP_SRV::Initalize, "Initalize"},
73 {200, &FSP_SRV::OpenDataStorageByCurrentProcess, "OpenDataStorageByCurrentProcess"}, 73 {200, &FSP_SRV::OpenDataStorageByCurrentProcess, "OpenDataStorageByCurrentProcess"},
74 {202, nullptr, "OpenDataStorageByDataId"},
74 {203, &FSP_SRV::OpenRomStorage, "OpenRomStorage"}, 75 {203, &FSP_SRV::OpenRomStorage, "OpenRomStorage"},
75 {1005, &FSP_SRV::GetGlobalAccessLogMode, "GetGlobalAccessLogMode"}, 76 {1005, &FSP_SRV::GetGlobalAccessLogMode, "GetGlobalAccessLogMode"},
76 }; 77 };
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index 3e35f5999..d757d2eae 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -9,6 +9,7 @@
9#include "core/hle/ipc_helpers.h" 9#include "core/hle/ipc_helpers.h"
10#include "core/hle/kernel/client_port.h" 10#include "core/hle/kernel/client_port.h"
11#include "core/hle/kernel/client_session.h" 11#include "core/hle/kernel/client_session.h"
12#include "core/hle/kernel/event.h"
12#include "core/hle/kernel/shared_memory.h" 13#include "core/hle/kernel/shared_memory.h"
13#include "core/hle/service/hid/hid.h" 14#include "core/hle/service/hid/hid.h"
14#include "core/hle/service/service.h" 15#include "core/hle/service/service.h"
@@ -179,17 +180,24 @@ public:
179 {100, &Hid::SetSupportedNpadStyleSet, "SetSupportedNpadStyleSet"}, 180 {100, &Hid::SetSupportedNpadStyleSet, "SetSupportedNpadStyleSet"},
180 {102, &Hid::SetSupportedNpadIdType, "SetSupportedNpadIdType"}, 181 {102, &Hid::SetSupportedNpadIdType, "SetSupportedNpadIdType"},
181 {103, &Hid::ActivateNpad, "ActivateNpad"}, 182 {103, &Hid::ActivateNpad, "ActivateNpad"},
183 {106, &Hid::AcquireNpadStyleSetUpdateEventHandle,
184 "AcquireNpadStyleSetUpdateEventHandle"},
182 {120, &Hid::SetNpadJoyHoldType, "SetNpadJoyHoldType"}, 185 {120, &Hid::SetNpadJoyHoldType, "SetNpadJoyHoldType"},
186 {121, &Hid::GetNpadJoyHoldType, "GetNpadJoyHoldType"},
183 {124, nullptr, "SetNpadJoyAssignmentModeDual"}, 187 {124, nullptr, "SetNpadJoyAssignmentModeDual"},
184 {128, &Hid::SetNpadHandheldActivationMode, "SetNpadHandheldActivationMode"}, 188 {128, &Hid::SetNpadHandheldActivationMode, "SetNpadHandheldActivationMode"},
185 {203, &Hid::CreateActiveVibrationDeviceList, "CreateActiveVibrationDeviceList"}, 189 {203, &Hid::CreateActiveVibrationDeviceList, "CreateActiveVibrationDeviceList"},
186 }; 190 };
187 RegisterHandlers(functions); 191 RegisterHandlers(functions);
192
193 event = Kernel::Event::Create(Kernel::ResetType::OneShot, "hid:EventHandle");
188 } 194 }
189 ~Hid() = default; 195 ~Hid() = default;
190 196
191private: 197private:
192 std::shared_ptr<IAppletResource> applet_resource; 198 std::shared_ptr<IAppletResource> applet_resource;
199 u32 joy_hold_type{0};
200 Kernel::SharedPtr<Kernel::Event> event;
193 201
194 void CreateAppletResource(Kernel::HLERequestContext& ctx) { 202 void CreateAppletResource(Kernel::HLERequestContext& ctx) {
195 if (applet_resource == nullptr) { 203 if (applet_resource == nullptr) {
@@ -238,12 +246,26 @@ private:
238 LOG_WARNING(Service_HID, "(STUBBED) called"); 246 LOG_WARNING(Service_HID, "(STUBBED) called");
239 } 247 }
240 248
249 void AcquireNpadStyleSetUpdateEventHandle(Kernel::HLERequestContext& ctx) {
250 IPC::ResponseBuilder rb{ctx, 2, 1};
251 rb.Push(RESULT_SUCCESS);
252 rb.PushCopyObjects(event);
253 LOG_WARNING(Service_HID, "(STUBBED) called");
254 }
255
241 void SetNpadJoyHoldType(Kernel::HLERequestContext& ctx) { 256 void SetNpadJoyHoldType(Kernel::HLERequestContext& ctx) {
242 IPC::ResponseBuilder rb{ctx, 2}; 257 IPC::ResponseBuilder rb{ctx, 2};
243 rb.Push(RESULT_SUCCESS); 258 rb.Push(RESULT_SUCCESS);
244 LOG_WARNING(Service_HID, "(STUBBED) called"); 259 LOG_WARNING(Service_HID, "(STUBBED) called");
245 } 260 }
246 261
262 void GetNpadJoyHoldType(Kernel::HLERequestContext& ctx) {
263 IPC::ResponseBuilder rb{ctx, 3};
264 rb.Push(RESULT_SUCCESS);
265 rb.Push(joy_hold_type);
266 LOG_WARNING(Service_HID, "(STUBBED) called");
267 }
268
247 void SetNpadHandheldActivationMode(Kernel::HLERequestContext& ctx) { 269 void SetNpadHandheldActivationMode(Kernel::HLERequestContext& ctx) {
248 IPC::ResponseBuilder rb{ctx, 2}; 270 IPC::ResponseBuilder rb{ctx, 2};
249 rb.Push(RESULT_SUCCESS); 271 rb.Push(RESULT_SUCCESS);
diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp
index 532b9c1c5..364ddcea2 100644
--- a/src/core/hle/service/time/time.cpp
+++ b/src/core/hle/service/time/time.cpp
@@ -68,8 +68,15 @@ public:
68 ITimeZoneService() : ServiceFramework("ITimeZoneService") { 68 ITimeZoneService() : ServiceFramework("ITimeZoneService") {
69 static const FunctionInfo functions[] = { 69 static const FunctionInfo functions[] = {
70 {0, &ITimeZoneService::GetDeviceLocationName, "GetDeviceLocationName"}, 70 {0, &ITimeZoneService::GetDeviceLocationName, "GetDeviceLocationName"},
71 {1, nullptr, "SetDeviceLocationName"},
71 {2, &ITimeZoneService::GetTotalLocationNameCount, "GetTotalLocationNameCount"}, 72 {2, &ITimeZoneService::GetTotalLocationNameCount, "GetTotalLocationNameCount"},
73 {3, nullptr, "LoadLocationNameList"},
74 {4, &ITimeZoneService::LoadTimeZoneRule, "LoadTimeZoneRule"},
75 {5, nullptr, "GetTimeZoneRuleVersion"},
76 {100, nullptr, "ToCalendarTime"},
72 {101, &ITimeZoneService::ToCalendarTimeWithMyRule, "ToCalendarTimeWithMyRule"}, 77 {101, &ITimeZoneService::ToCalendarTimeWithMyRule, "ToCalendarTimeWithMyRule"},
78 {200, nullptr, "ToPosixTime"},
79 {201, nullptr, "ToPosixTimeWithMyRule"},
73 }; 80 };
74 RegisterHandlers(functions); 81 RegisterHandlers(functions);
75 } 82 }
@@ -90,6 +97,12 @@ private:
90 rb.Push<u32>(0); 97 rb.Push<u32>(0);
91 } 98 }
92 99
100 void LoadTimeZoneRule(Kernel::HLERequestContext& ctx) {
101 LOG_WARNING(Service_Time, "(STUBBED) called");
102 IPC::ResponseBuilder rb{ctx, 2};
103 rb.Push(RESULT_SUCCESS);
104 }
105
93 void ToCalendarTimeWithMyRule(Kernel::HLERequestContext& ctx) { 106 void ToCalendarTimeWithMyRule(Kernel::HLERequestContext& ctx) {
94 IPC::RequestParser rp{ctx}; 107 IPC::RequestParser rp{ctx};
95 u64 posix_time = rp.Pop<u64>(); 108 u64 posix_time = rp.Pop<u64>();
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp
index adefba2b7..cfddd7c41 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -19,6 +19,15 @@
19namespace Service { 19namespace Service {
20namespace VI { 20namespace VI {
21 21
22struct DisplayInfo {
23 char display_name[0x40]{"Default"};
24 u64 unknown_1{1};
25 u64 unknown_2{1};
26 u64 width{1920};
27 u64 height{1080};
28};
29static_assert(sizeof(DisplayInfo) == 0x60, "DisplayInfo has wrong size");
30
22class Parcel { 31class Parcel {
23public: 32public:
24 // This default size was chosen arbitrarily. 33 // This default size was chosen arbitrarily.
@@ -722,6 +731,17 @@ void IApplicationDisplayService::SetLayerScalingMode(Kernel::HLERequestContext&
722 rb.Push(RESULT_SUCCESS); 731 rb.Push(RESULT_SUCCESS);
723} 732}
724 733
734void IApplicationDisplayService::ListDisplays(Kernel::HLERequestContext& ctx) {
735 IPC::RequestParser rp{ctx};
736 DisplayInfo display_info;
737 auto& buffer = ctx.BufferDescriptorB()[0];
738 Memory::WriteBlock(buffer.Address(), &display_info, sizeof(DisplayInfo));
739 IPC::ResponseBuilder rb = rp.MakeBuilder(4, 0, 0);
740 rb.Push(RESULT_SUCCESS);
741 rb.Push<u64>(1);
742 LOG_WARNING(Service_VI, "(STUBBED) called");
743}
744
725void IApplicationDisplayService::GetDisplayVsyncEvent(Kernel::HLERequestContext& ctx) { 745void IApplicationDisplayService::GetDisplayVsyncEvent(Kernel::HLERequestContext& ctx) {
726 LOG_WARNING(Service_VI, "(STUBBED) called"); 746 LOG_WARNING(Service_VI, "(STUBBED) called");
727 IPC::RequestParser rp{ctx}; 747 IPC::RequestParser rp{ctx};
@@ -743,7 +763,7 @@ IApplicationDisplayService::IApplicationDisplayService(
743 {102, &IApplicationDisplayService::GetManagerDisplayService, "GetManagerDisplayService"}, 763 {102, &IApplicationDisplayService::GetManagerDisplayService, "GetManagerDisplayService"},
744 {103, &IApplicationDisplayService::GetIndirectDisplayTransactionService, 764 {103, &IApplicationDisplayService::GetIndirectDisplayTransactionService,
745 "GetIndirectDisplayTransactionService"}, 765 "GetIndirectDisplayTransactionService"},
746 {1000, nullptr, "ListDisplays"}, 766 {1000, &IApplicationDisplayService::ListDisplays, "ListDisplays"},
747 {1010, &IApplicationDisplayService::OpenDisplay, "OpenDisplay"}, 767 {1010, &IApplicationDisplayService::OpenDisplay, "OpenDisplay"},
748 {1020, &IApplicationDisplayService::CloseDisplay, "CloseDisplay"}, 768 {1020, &IApplicationDisplayService::CloseDisplay, "CloseDisplay"},
749 {2101, &IApplicationDisplayService::SetLayerScalingMode, "SetLayerScalingMode"}, 769 {2101, &IApplicationDisplayService::SetLayerScalingMode, "SetLayerScalingMode"},
diff --git a/src/core/hle/service/vi/vi.h b/src/core/hle/service/vi/vi.h
index a6e084f87..f6be7d1e6 100644
--- a/src/core/hle/service/vi/vi.h
+++ b/src/core/hle/service/vi/vi.h
@@ -30,6 +30,7 @@ private:
30 void OpenDisplay(Kernel::HLERequestContext& ctx); 30 void OpenDisplay(Kernel::HLERequestContext& ctx);
31 void CloseDisplay(Kernel::HLERequestContext& ctx); 31 void CloseDisplay(Kernel::HLERequestContext& ctx);
32 void SetLayerScalingMode(Kernel::HLERequestContext& ctx); 32 void SetLayerScalingMode(Kernel::HLERequestContext& ctx);
33 void ListDisplays(Kernel::HLERequestContext& ctx);
33 void OpenLayer(Kernel::HLERequestContext& ctx); 34 void OpenLayer(Kernel::HLERequestContext& ctx);
34 void CreateStrayLayer(Kernel::HLERequestContext& ctx); 35 void CreateStrayLayer(Kernel::HLERequestContext& ctx);
35 void DestroyStrayLayer(Kernel::HLERequestContext& ctx); 36 void DestroyStrayLayer(Kernel::HLERequestContext& ctx);