summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/hle/kernel/svc.cpp101
-rw-r--r--src/core/hle/service/acc/acc.cpp5
-rw-r--r--src/core/hle/service/am/am.cpp209
-rw-r--r--src/core/hle/service/am/applet_ae.cpp66
-rw-r--r--src/core/hle/service/am/applet_oe.cpp27
-rw-r--r--src/core/hle/service/aoc/aoc_u.cpp6
-rw-r--r--src/core/hle/service/apm/interface.cpp16
-rw-r--r--src/core/hle/service/arp/arp.cpp4
-rw-r--r--src/core/hle/service/audio/audout_u.cpp5
-rw-r--r--src/core/hle/service/audio/audren_u.cpp53
-rw-r--r--src/core/hle/service/audio/hwopus.cpp32
-rw-r--r--src/core/hle/service/bcat/module.cpp3
-rw-r--r--src/core/hle/service/btdrv/btdrv.cpp3
-rw-r--r--src/core/hle/service/btm/btm.cpp19
-rw-r--r--src/core/hle/service/fgm/fgm.cpp4
-rw-r--r--src/core/hle/service/filesystem/fsp_srv.cpp15
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp3
-rw-r--r--src/core/hle/service/hid/hid.cpp116
-rw-r--r--src/core/hle/service/hid/irs.cpp54
-rw-r--r--src/core/hle/service/lbl/lbl.cpp12
-rw-r--r--src/core/hle/service/ldn/ldn.cpp12
-rw-r--r--src/core/hle/service/ldr/ldr.cpp12
-rw-r--r--src/core/hle/service/lm/lm.cpp4
-rw-r--r--src/core/hle/service/mm/mm_u.cpp14
-rw-r--r--src/core/hle/service/nfc/nfc.cpp24
-rw-r--r--src/core/hle/service/nfp/nfp.cpp16
-rw-r--r--src/core/hle/service/nifm/nifm.cpp29
-rw-r--r--src/core/hle/service/nim/nim.cpp27
-rw-r--r--src/core/hle/service/ns/ns.cpp8
-rw-r--r--src/core/hle/service/ns/pl_u.cpp10
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp2
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp7
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp10
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp1
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_nvjpg.cpp1
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_vic.cpp1
-rw-r--r--src/core/hle/service/nvdrv/devices/nvmap.cpp14
-rw-r--r--src/core/hle/service/nvdrv/interface.cpp6
-rw-r--r--src/core/hle/service/nvflinger/buffer_queue.cpp5
-rw-r--r--src/core/hle/service/pctl/module.cpp8
-rw-r--r--src/core/hle/service/pm/pm.cpp4
-rw-r--r--src/core/hle/service/psc/psc.cpp4
-rw-r--r--src/core/hle/service/set/set.cpp33
-rw-r--r--src/core/hle/service/set/set_sys.cpp8
-rw-r--r--src/core/hle/service/sm/controller.cpp11
-rw-r--r--src/core/hle/service/sm/sm.cpp4
-rw-r--r--src/core/hle/service/spl/module.cpp3
-rw-r--r--src/core/hle/service/ssl/ssl.cpp2
-rw-r--r--src/core/hle/service/time/time.cpp25
-rw-r--r--src/core/hle/service/usb/usb.cpp4
-rw-r--r--src/core/hle/service/vi/vi.cpp38
51 files changed, 726 insertions, 374 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index f287f7c97..775afccf6 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -69,37 +69,45 @@ bool IsInsideNewMapRegion(const VMManager& vm, VAddr address, u64 size) {
69ResultCode MapUnmapMemorySanityChecks(const VMManager& vm_manager, VAddr dst_addr, VAddr src_addr, 69ResultCode MapUnmapMemorySanityChecks(const VMManager& vm_manager, VAddr dst_addr, VAddr src_addr,
70 u64 size) { 70 u64 size) {
71 if (!Common::Is4KBAligned(dst_addr) || !Common::Is4KBAligned(src_addr)) { 71 if (!Common::Is4KBAligned(dst_addr) || !Common::Is4KBAligned(src_addr)) {
72 LOG_ERROR(Kernel_SVC, "Invalid address");
72 return ERR_INVALID_ADDRESS; 73 return ERR_INVALID_ADDRESS;
73 } 74 }
74 75
75 if (size == 0 || !Common::Is4KBAligned(size)) { 76 if (size == 0 || !Common::Is4KBAligned(size)) {
77 LOG_ERROR(Kernel_SVC, "Invalid size");
76 return ERR_INVALID_SIZE; 78 return ERR_INVALID_SIZE;
77 } 79 }
78 80
79 if (!IsValidAddressRange(dst_addr, size)) { 81 if (!IsValidAddressRange(dst_addr, size)) {
82 LOG_ERROR(Kernel_SVC, "size is out of range");
80 return ERR_INVALID_ADDRESS_STATE; 83 return ERR_INVALID_ADDRESS_STATE;
81 } 84 }
82 85
83 if (!IsValidAddressRange(src_addr, size)) { 86 if (!IsValidAddressRange(src_addr, size)) {
87 LOG_ERROR(Kernel_SVC, "size is out of range");
84 return ERR_INVALID_ADDRESS_STATE; 88 return ERR_INVALID_ADDRESS_STATE;
85 } 89 }
86 90
87 if (!IsInsideAddressSpace(vm_manager, src_addr, size)) { 91 if (!IsInsideAddressSpace(vm_manager, src_addr, size)) {
92 LOG_ERROR(Kernel_SVC, "Region is out of the address space");
88 return ERR_INVALID_ADDRESS_STATE; 93 return ERR_INVALID_ADDRESS_STATE;
89 } 94 }
90 95
91 if (!IsInsideNewMapRegion(vm_manager, dst_addr, size)) { 96 if (!IsInsideNewMapRegion(vm_manager, dst_addr, size)) {
97 LOG_ERROR(Kernel_SVC, "Region is out of the address space");
92 return ERR_INVALID_MEMORY_RANGE; 98 return ERR_INVALID_MEMORY_RANGE;
93 } 99 }
94 100
95 const VAddr dst_end_address = dst_addr + size; 101 const VAddr dst_end_address = dst_addr + size;
96 if (dst_end_address > vm_manager.GetHeapRegionBaseAddress() && 102 if (dst_end_address > vm_manager.GetHeapRegionBaseAddress() &&
97 vm_manager.GetHeapRegionEndAddress() > dst_addr) { 103 vm_manager.GetHeapRegionEndAddress() > dst_addr) {
104 LOG_ERROR(Kernel_SVC, "Region is not in the correct address space");
98 return ERR_INVALID_MEMORY_RANGE; 105 return ERR_INVALID_MEMORY_RANGE;
99 } 106 }
100 107
101 if (dst_end_address > vm_manager.GetMapRegionBaseAddress() && 108 if (dst_end_address > vm_manager.GetMapRegionBaseAddress() &&
102 vm_manager.GetMapRegionEndAddress() > dst_addr) { 109 vm_manager.GetMapRegionEndAddress() > dst_addr) {
110 LOG_ERROR(Kernel_SVC, "Region is not in the correct address space");
103 return ERR_INVALID_MEMORY_RANGE; 111 return ERR_INVALID_MEMORY_RANGE;
104 } 112 }
105 113
@@ -113,6 +121,7 @@ static ResultCode SetHeapSize(VAddr* heap_addr, u64 heap_size) {
113 121
114 // Size must be a multiple of 0x200000 (2MB) and be equal to or less than 4GB. 122 // Size must be a multiple of 0x200000 (2MB) and be equal to or less than 4GB.
115 if ((heap_size & 0xFFFFFFFE001FFFFF) != 0) { 123 if ((heap_size & 0xFFFFFFFE001FFFFF) != 0) {
124 LOG_ERROR(Kernel_SVC, "Invalid heap size");
116 return ERR_INVALID_SIZE; 125 return ERR_INVALID_SIZE;
117 } 126 }
118 127
@@ -127,20 +136,24 @@ static ResultCode SetMemoryPermission(VAddr addr, u64 size, u32 prot) {
127 LOG_TRACE(Kernel_SVC, "called, addr=0x{:X}, size=0x{:X}, prot=0x{:X}", addr, size, prot); 136 LOG_TRACE(Kernel_SVC, "called, addr=0x{:X}, size=0x{:X}, prot=0x{:X}", addr, size, prot);
128 137
129 if (!Common::Is4KBAligned(addr)) { 138 if (!Common::Is4KBAligned(addr)) {
139 LOG_ERROR(Kernel_SVC, "Address is not aligned");
130 return ERR_INVALID_ADDRESS; 140 return ERR_INVALID_ADDRESS;
131 } 141 }
132 142
133 if (size == 0 || !Common::Is4KBAligned(size)) { 143 if (size == 0 || !Common::Is4KBAligned(size)) {
144 LOG_ERROR(Kernel_SVC, "Invalid size");
134 return ERR_INVALID_SIZE; 145 return ERR_INVALID_SIZE;
135 } 146 }
136 147
137 if (!IsValidAddressRange(addr, size)) { 148 if (!IsValidAddressRange(addr, size)) {
149 LOG_ERROR(Kernel_SVC, "Region is out of the address space");
138 return ERR_INVALID_ADDRESS_STATE; 150 return ERR_INVALID_ADDRESS_STATE;
139 } 151 }
140 152
141 const auto permission = static_cast<MemoryPermission>(prot); 153 const auto permission = static_cast<MemoryPermission>(prot);
142 if (permission != MemoryPermission::None && permission != MemoryPermission::Read && 154 if (permission != MemoryPermission::None && permission != MemoryPermission::Read &&
143 permission != MemoryPermission::ReadWrite) { 155 permission != MemoryPermission::ReadWrite) {
156 LOG_ERROR(Kernel_SVC, "Incorrect memory permissions");
144 return ERR_INVALID_MEMORY_PERMISSIONS; 157 return ERR_INVALID_MEMORY_PERMISSIONS;
145 } 158 }
146 159
@@ -148,11 +161,13 @@ static ResultCode SetMemoryPermission(VAddr addr, u64 size, u32 prot) {
148 auto& vm_manager = current_process->VMManager(); 161 auto& vm_manager = current_process->VMManager();
149 162
150 if (!IsInsideAddressSpace(vm_manager, addr, size)) { 163 if (!IsInsideAddressSpace(vm_manager, addr, size)) {
164 LOG_ERROR(Kernel_SVC, "Region is not inside the address space");
151 return ERR_INVALID_ADDRESS_STATE; 165 return ERR_INVALID_ADDRESS_STATE;
152 } 166 }
153 167
154 const VMManager::VMAHandle iter = vm_manager.FindVMA(addr); 168 const VMManager::VMAHandle iter = vm_manager.FindVMA(addr);
155 if (iter == vm_manager.vma_map.end()) { 169 if (iter == vm_manager.vma_map.end()) {
170 LOG_ERROR(Kernel_SVC, "Unable to find VMA");
156 return ERR_INVALID_ADDRESS_STATE; 171 return ERR_INVALID_ADDRESS_STATE;
157 } 172 }
158 173
@@ -182,6 +197,7 @@ static ResultCode MapMemory(VAddr dst_addr, VAddr src_addr, u64 size) {
182 197
183 const auto result = MapUnmapMemorySanityChecks(vm_manager, dst_addr, src_addr, size); 198 const auto result = MapUnmapMemorySanityChecks(vm_manager, dst_addr, src_addr, size);
184 if (result != RESULT_SUCCESS) { 199 if (result != RESULT_SUCCESS) {
200 LOG_ERROR(Kernel_SVC, "Map Memory failed");
185 return result; 201 return result;
186 } 202 }
187 203
@@ -198,6 +214,7 @@ static ResultCode UnmapMemory(VAddr dst_addr, VAddr src_addr, u64 size) {
198 214
199 const auto result = MapUnmapMemorySanityChecks(vm_manager, dst_addr, src_addr, size); 215 const auto result = MapUnmapMemorySanityChecks(vm_manager, dst_addr, src_addr, size);
200 if (result != RESULT_SUCCESS) { 216 if (result != RESULT_SUCCESS) {
217 LOG_ERROR(Kernel_SVC, "UnmapMemory failed");
201 return result; 218 return result;
202 } 219 }
203 220
@@ -207,6 +224,7 @@ static ResultCode UnmapMemory(VAddr dst_addr, VAddr src_addr, u64 size) {
207/// Connect to an OS service given the port name, returns the handle to the port to out 224/// Connect to an OS service given the port name, returns the handle to the port to out
208static ResultCode ConnectToNamedPort(Handle* out_handle, VAddr port_name_address) { 225static ResultCode ConnectToNamedPort(Handle* out_handle, VAddr port_name_address) {
209 if (!Memory::IsValidVirtualAddress(port_name_address)) { 226 if (!Memory::IsValidVirtualAddress(port_name_address)) {
227 LOG_ERROR(Kernel_SVC, "Invalid port name address");
210 return ERR_NOT_FOUND; 228 return ERR_NOT_FOUND;
211 } 229 }
212 230
@@ -214,6 +232,7 @@ static ResultCode ConnectToNamedPort(Handle* out_handle, VAddr port_name_address
214 // Read 1 char beyond the max allowed port name to detect names that are too long. 232 // Read 1 char beyond the max allowed port name to detect names that are too long.
215 std::string port_name = Memory::ReadCString(port_name_address, PortNameMaxLength + 1); 233 std::string port_name = Memory::ReadCString(port_name_address, PortNameMaxLength + 1);
216 if (port_name.size() > PortNameMaxLength) { 234 if (port_name.size() > PortNameMaxLength) {
235 LOG_ERROR(Kernel_SVC, "Port name is too long");
217 return ERR_OUT_OF_RANGE; 236 return ERR_OUT_OF_RANGE;
218 } 237 }
219 238
@@ -262,6 +281,7 @@ static ResultCode GetThreadId(u32* thread_id, Handle thread_handle) {
262 const auto& handle_table = Core::CurrentProcess()->GetHandleTable(); 281 const auto& handle_table = Core::CurrentProcess()->GetHandleTable();
263 const SharedPtr<Thread> thread = handle_table.Get<Thread>(thread_handle); 282 const SharedPtr<Thread> thread = handle_table.Get<Thread>(thread_handle);
264 if (!thread) { 283 if (!thread) {
284 LOG_ERROR(Kernel_SVC, "Invalid thread handle");
265 return ERR_INVALID_HANDLE; 285 return ERR_INVALID_HANDLE;
266 } 286 }
267 287
@@ -276,6 +296,7 @@ static ResultCode GetProcessId(u32* process_id, Handle process_handle) {
276 const auto& handle_table = Core::CurrentProcess()->GetHandleTable(); 296 const auto& handle_table = Core::CurrentProcess()->GetHandleTable();
277 const SharedPtr<Process> process = handle_table.Get<Process>(process_handle); 297 const SharedPtr<Process> process = handle_table.Get<Process>(process_handle);
278 if (!process) { 298 if (!process) {
299 LOG_ERROR(Kernel_SVC, "Invalid process");
279 return ERR_INVALID_HANDLE; 300 return ERR_INVALID_HANDLE;
280 } 301 }
281 302
@@ -305,12 +326,15 @@ static ResultCode WaitSynchronization(Handle* index, VAddr handles_address, u64
305 LOG_TRACE(Kernel_SVC, "called handles_address=0x{:X}, handle_count={}, nano_seconds={}", 326 LOG_TRACE(Kernel_SVC, "called handles_address=0x{:X}, handle_count={}, nano_seconds={}",
306 handles_address, handle_count, nano_seconds); 327 handles_address, handle_count, nano_seconds);
307 328
308 if (!Memory::IsValidVirtualAddress(handles_address)) 329 if (!Memory::IsValidVirtualAddress(handles_address)) {
330 LOG_ERROR(Kernel_SVC, "Invalid handle address");
309 return ERR_INVALID_POINTER; 331 return ERR_INVALID_POINTER;
332 }
310 333
311 static constexpr u64 MaxHandles = 0x40; 334 static constexpr u64 MaxHandles = 0x40;
312 335
313 if (handle_count > MaxHandles) { 336 if (handle_count > MaxHandles) {
337 LOG_ERROR(Kernel_SVC, "Handle count is too big");
314 return ERR_OUT_OF_RANGE; 338 return ERR_OUT_OF_RANGE;
315 } 339 }
316 340
@@ -325,6 +349,7 @@ static ResultCode WaitSynchronization(Handle* index, VAddr handles_address, u64
325 const auto object = handle_table.Get<WaitObject>(handle); 349 const auto object = handle_table.Get<WaitObject>(handle);
326 350
327 if (object == nullptr) { 351 if (object == nullptr) {
352 LOG_ERROR(Kernel_SVC, "Object is a nullptr");
328 return ERR_INVALID_HANDLE; 353 return ERR_INVALID_HANDLE;
329 } 354 }
330 355
@@ -348,11 +373,13 @@ static ResultCode WaitSynchronization(Handle* index, VAddr handles_address, u64
348 373
349 // If a timeout value of 0 was provided, just return the Timeout error code instead of 374 // If a timeout value of 0 was provided, just return the Timeout error code instead of
350 // suspending the thread. 375 // suspending the thread.
351 if (nano_seconds == 0) 376 if (nano_seconds == 0) {
352 return RESULT_TIMEOUT; 377 return RESULT_TIMEOUT;
378 }
353 379
354 for (auto& object : objects) 380 for (auto& object : objects) {
355 object->AddWaitingThread(thread); 381 object->AddWaitingThread(thread);
382 }
356 383
357 thread->SetWaitObjects(std::move(objects)); 384 thread->SetWaitObjects(std::move(objects));
358 thread->SetStatus(ThreadStatus::WaitSynchAny); 385 thread->SetStatus(ThreadStatus::WaitSynchAny);
@@ -373,6 +400,7 @@ static ResultCode CancelSynchronization(Handle thread_handle) {
373 const auto& handle_table = Core::CurrentProcess()->GetHandleTable(); 400 const auto& handle_table = Core::CurrentProcess()->GetHandleTable();
374 const SharedPtr<Thread> thread = handle_table.Get<Thread>(thread_handle); 401 const SharedPtr<Thread> thread = handle_table.Get<Thread>(thread_handle);
375 if (!thread) { 402 if (!thread) {
403 LOG_ERROR(Kernel_SVC, "Invalid thread handle");
376 return ERR_INVALID_HANDLE; 404 return ERR_INVALID_HANDLE;
377 } 405 }
378 406
@@ -391,10 +419,12 @@ static ResultCode ArbitrateLock(Handle holding_thread_handle, VAddr mutex_addr,
391 holding_thread_handle, mutex_addr, requesting_thread_handle); 419 holding_thread_handle, mutex_addr, requesting_thread_handle);
392 420
393 if (Memory::IsKernelVirtualAddress(mutex_addr)) { 421 if (Memory::IsKernelVirtualAddress(mutex_addr)) {
422 LOG_ERROR(Kernel_SVC, "Invalid mutex address");
394 return ERR_INVALID_ADDRESS_STATE; 423 return ERR_INVALID_ADDRESS_STATE;
395 } 424 }
396 425
397 if (!Common::IsWordAligned(mutex_addr)) { 426 if (!Common::IsWordAligned(mutex_addr)) {
427 LOG_ERROR(Kernel_SVC, "Mutex address is not aligned");
398 return ERR_INVALID_ADDRESS; 428 return ERR_INVALID_ADDRESS;
399 } 429 }
400 430
@@ -408,10 +438,12 @@ static ResultCode ArbitrateUnlock(VAddr mutex_addr) {
408 LOG_TRACE(Kernel_SVC, "called mutex_addr=0x{:X}", mutex_addr); 438 LOG_TRACE(Kernel_SVC, "called mutex_addr=0x{:X}", mutex_addr);
409 439
410 if (Memory::IsKernelVirtualAddress(mutex_addr)) { 440 if (Memory::IsKernelVirtualAddress(mutex_addr)) {
441 LOG_ERROR(Kernel_SVC, "Invalid size");
411 return ERR_INVALID_ADDRESS_STATE; 442 return ERR_INVALID_ADDRESS_STATE;
412 } 443 }
413 444
414 if (!Common::IsWordAligned(mutex_addr)) { 445 if (!Common::IsWordAligned(mutex_addr)) {
446 LOG_ERROR(Kernel_SVC, "Mutex address is not aligned");
415 return ERR_INVALID_ADDRESS; 447 return ERR_INVALID_ADDRESS;
416 } 448 }
417 449
@@ -602,10 +634,12 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id)
602 break; 634 break;
603 case GetInfoType::RandomEntropy: 635 case GetInfoType::RandomEntropy:
604 if (handle != 0) { 636 if (handle != 0) {
637 LOG_ERROR(Kernel_SVC, "Non zero handle specified");
605 return ERR_INVALID_HANDLE; 638 return ERR_INVALID_HANDLE;
606 } 639 }
607 640
608 if (info_sub_id >= Process::RANDOM_ENTROPY_SIZE) { 641 if (info_sub_id >= Process::RANDOM_ENTROPY_SIZE) {
642 LOG_ERROR(Kernel_SVC, "Entropy size is too big");
609 return ERR_INVALID_COMBINATION; 643 return ERR_INVALID_COMBINATION;
610 } 644 }
611 645
@@ -643,12 +677,14 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id)
643 case GetInfoType::ThreadTickCount: { 677 case GetInfoType::ThreadTickCount: {
644 constexpr u64 num_cpus = 4; 678 constexpr u64 num_cpus = 4;
645 if (info_sub_id != 0xFFFFFFFFFFFFFFFF && info_sub_id >= num_cpus) { 679 if (info_sub_id != 0xFFFFFFFFFFFFFFFF && info_sub_id >= num_cpus) {
680 LOG_ERROR(Kernel_SVC, "Incorrect info_sub_id");
646 return ERR_INVALID_COMBINATION; 681 return ERR_INVALID_COMBINATION;
647 } 682 }
648 683
649 const auto thread = 684 const auto thread =
650 current_process->GetHandleTable().Get<Thread>(static_cast<Handle>(handle)); 685 current_process->GetHandleTable().Get<Thread>(static_cast<Handle>(handle));
651 if (!thread) { 686 if (!thread) {
687 LOG_ERROR(Kernel_SVC, "Thread is not a valid handle");
652 return ERR_INVALID_HANDLE; 688 return ERR_INVALID_HANDLE;
653 } 689 }
654 690
@@ -691,14 +727,17 @@ static ResultCode GetThreadContext(VAddr thread_context, Handle handle) {
691 const auto* current_process = Core::CurrentProcess(); 727 const auto* current_process = Core::CurrentProcess();
692 const SharedPtr<Thread> thread = current_process->GetHandleTable().Get<Thread>(handle); 728 const SharedPtr<Thread> thread = current_process->GetHandleTable().Get<Thread>(handle);
693 if (!thread) { 729 if (!thread) {
730 LOG_ERROR(Kernel_SVC, "Thread is not a valid handle");
694 return ERR_INVALID_HANDLE; 731 return ERR_INVALID_HANDLE;
695 } 732 }
696 733
697 if (thread->GetOwnerProcess() != current_process) { 734 if (thread->GetOwnerProcess() != current_process) {
735 LOG_ERROR(Kernel_SVC, "Thread owner process is not the current process");
698 return ERR_INVALID_HANDLE; 736 return ERR_INVALID_HANDLE;
699 } 737 }
700 738
701 if (thread == GetCurrentThread()) { 739 if (thread == GetCurrentThread()) {
740 LOG_ERROR(Kernel_SVC, "Thread is already registered");
702 return ERR_ALREADY_REGISTERED; 741 return ERR_ALREADY_REGISTERED;
703 } 742 }
704 743
@@ -719,9 +758,12 @@ static ResultCode GetThreadContext(VAddr thread_context, Handle handle) {
719 758
720/// Gets the priority for the specified thread 759/// Gets the priority for the specified thread
721static ResultCode GetThreadPriority(u32* priority, Handle handle) { 760static ResultCode GetThreadPriority(u32* priority, Handle handle) {
761 LOG_TRACE(Kernel_SVC, "called");
762
722 const auto& handle_table = Core::CurrentProcess()->GetHandleTable(); 763 const auto& handle_table = Core::CurrentProcess()->GetHandleTable();
723 const SharedPtr<Thread> thread = handle_table.Get<Thread>(handle); 764 const SharedPtr<Thread> thread = handle_table.Get<Thread>(handle);
724 if (!thread) { 765 if (!thread) {
766 LOG_ERROR(Kernel_SVC, "Invalid thread handle");
725 return ERR_INVALID_HANDLE; 767 return ERR_INVALID_HANDLE;
726 } 768 }
727 769
@@ -731,7 +773,10 @@ static ResultCode GetThreadPriority(u32* priority, Handle handle) {
731 773
732/// Sets the priority for the specified thread 774/// Sets the priority for the specified thread
733static ResultCode SetThreadPriority(Handle handle, u32 priority) { 775static ResultCode SetThreadPriority(Handle handle, u32 priority) {
776 LOG_TRACE(Kernel_SVC, "called");
777
734 if (priority > THREADPRIO_LOWEST) { 778 if (priority > THREADPRIO_LOWEST) {
779 LOG_ERROR(Kernel_SVC, "Priority is out of range");
735 return ERR_INVALID_THREAD_PRIORITY; 780 return ERR_INVALID_THREAD_PRIORITY;
736 } 781 }
737 782
@@ -739,6 +784,7 @@ static ResultCode SetThreadPriority(Handle handle, u32 priority) {
739 784
740 SharedPtr<Thread> thread = current_process->GetHandleTable().Get<Thread>(handle); 785 SharedPtr<Thread> thread = current_process->GetHandleTable().Get<Thread>(handle);
741 if (!thread) { 786 if (!thread) {
787 LOG_ERROR(Kernel_SVC, "Invalid thread handle");
742 return ERR_INVALID_HANDLE; 788 return ERR_INVALID_HANDLE;
743 } 789 }
744 790
@@ -761,14 +807,17 @@ static ResultCode MapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 s
761 shared_memory_handle, addr, size, permissions); 807 shared_memory_handle, addr, size, permissions);
762 808
763 if (!Common::Is4KBAligned(addr)) { 809 if (!Common::Is4KBAligned(addr)) {
810 LOG_ERROR(Kernel_SVC, "Address is not aligned");
764 return ERR_INVALID_ADDRESS; 811 return ERR_INVALID_ADDRESS;
765 } 812 }
766 813
767 if (size == 0 || !Common::Is4KBAligned(size)) { 814 if (size == 0 || !Common::Is4KBAligned(size)) {
815 LOG_ERROR(Kernel_SVC, "Invalid size");
768 return ERR_INVALID_SIZE; 816 return ERR_INVALID_SIZE;
769 } 817 }
770 818
771 if (!IsValidAddressRange(addr, size)) { 819 if (!IsValidAddressRange(addr, size)) {
820 LOG_ERROR(Kernel_SVC, "Region is not in the address space");
772 return ERR_INVALID_ADDRESS_STATE; 821 return ERR_INVALID_ADDRESS_STATE;
773 } 822 }
774 823
@@ -782,11 +831,13 @@ static ResultCode MapSharedMemory(Handle shared_memory_handle, VAddr addr, u64 s
782 auto* const current_process = Core::CurrentProcess(); 831 auto* const current_process = Core::CurrentProcess();
783 auto shared_memory = current_process->GetHandleTable().Get<SharedMemory>(shared_memory_handle); 832 auto shared_memory = current_process->GetHandleTable().Get<SharedMemory>(shared_memory_handle);
784 if (!shared_memory) { 833 if (!shared_memory) {
834 LOG_ERROR(Kernel_SVC, "Invalid shared memory handle");
785 return ERR_INVALID_HANDLE; 835 return ERR_INVALID_HANDLE;
786 } 836 }
787 837
788 const auto& vm_manager = current_process->VMManager(); 838 const auto& vm_manager = current_process->VMManager();
789 if (!vm_manager.IsWithinASLRRegion(addr, size)) { 839 if (!vm_manager.IsWithinASLRRegion(addr, size)) {
840 LOG_ERROR(Kernel_SVC, "Region is not within the ASLR region");
790 return ERR_INVALID_MEMORY_RANGE; 841 return ERR_INVALID_MEMORY_RANGE;
791 } 842 }
792 843
@@ -798,25 +849,30 @@ static ResultCode UnmapSharedMemory(Handle shared_memory_handle, VAddr addr, u64
798 shared_memory_handle, addr, size); 849 shared_memory_handle, addr, size);
799 850
800 if (!Common::Is4KBAligned(addr)) { 851 if (!Common::Is4KBAligned(addr)) {
852 LOG_ERROR(Kernel_SVC, "Address is not aligned");
801 return ERR_INVALID_ADDRESS; 853 return ERR_INVALID_ADDRESS;
802 } 854 }
803 855
804 if (size == 0 || !Common::Is4KBAligned(size)) { 856 if (size == 0 || !Common::Is4KBAligned(size)) {
857 LOG_ERROR(Kernel_SVC, "Size is invalid");
805 return ERR_INVALID_SIZE; 858 return ERR_INVALID_SIZE;
806 } 859 }
807 860
808 if (!IsValidAddressRange(addr, size)) { 861 if (!IsValidAddressRange(addr, size)) {
862 LOG_ERROR(Kernel_SVC, "Region is not in the valid address range");
809 return ERR_INVALID_ADDRESS_STATE; 863 return ERR_INVALID_ADDRESS_STATE;
810 } 864 }
811 865
812 auto* const current_process = Core::CurrentProcess(); 866 auto* const current_process = Core::CurrentProcess();
813 auto shared_memory = current_process->GetHandleTable().Get<SharedMemory>(shared_memory_handle); 867 auto shared_memory = current_process->GetHandleTable().Get<SharedMemory>(shared_memory_handle);
814 if (!shared_memory) { 868 if (!shared_memory) {
869 LOG_ERROR(Kernel_SVC, "Shared memory is an invalid handle");
815 return ERR_INVALID_HANDLE; 870 return ERR_INVALID_HANDLE;
816 } 871 }
817 872
818 const auto& vm_manager = current_process->VMManager(); 873 const auto& vm_manager = current_process->VMManager();
819 if (!vm_manager.IsWithinASLRRegion(addr, size)) { 874 if (!vm_manager.IsWithinASLRRegion(addr, size)) {
875 LOG_ERROR(Kernel_SVC, "Region is not within the ASLR region");
820 return ERR_INVALID_MEMORY_RANGE; 876 return ERR_INVALID_MEMORY_RANGE;
821 } 877 }
822 878
@@ -826,9 +882,11 @@ static ResultCode UnmapSharedMemory(Handle shared_memory_handle, VAddr addr, u64
826/// Query process memory 882/// Query process memory
827static ResultCode QueryProcessMemory(MemoryInfo* memory_info, PageInfo* /*page_info*/, 883static ResultCode QueryProcessMemory(MemoryInfo* memory_info, PageInfo* /*page_info*/,
828 Handle process_handle, u64 addr) { 884 Handle process_handle, u64 addr) {
885 LOG_TRACE(Kernel_SVC, "called process=0x{:08X} addr={:X}", process_handle, addr);
829 const auto& handle_table = Core::CurrentProcess()->GetHandleTable(); 886 const auto& handle_table = Core::CurrentProcess()->GetHandleTable();
830 SharedPtr<Process> process = handle_table.Get<Process>(process_handle); 887 SharedPtr<Process> process = handle_table.Get<Process>(process_handle);
831 if (!process) { 888 if (!process) {
889 LOG_ERROR(Kernel_SVC, "Invalid process handle");
832 return ERR_INVALID_HANDLE; 890 return ERR_INVALID_HANDLE;
833 } 891 }
834 auto vma = process->VMManager().FindVMA(addr); 892 auto vma = process->VMManager().FindVMA(addr);
@@ -844,8 +902,6 @@ static ResultCode QueryProcessMemory(MemoryInfo* memory_info, PageInfo* /*page_i
844 memory_info->size = vma->second.size; 902 memory_info->size = vma->second.size;
845 memory_info->type = static_cast<u32>(vma->second.meminfo_state); 903 memory_info->type = static_cast<u32>(vma->second.meminfo_state);
846 } 904 }
847
848 LOG_TRACE(Kernel_SVC, "called process=0x{:08X} addr={:X}", process_handle, addr);
849 return RESULT_SUCCESS; 905 return RESULT_SUCCESS;
850} 906}
851 907
@@ -874,7 +930,13 @@ static void ExitProcess() {
874/// Creates a new thread 930/// Creates a new thread
875static ResultCode CreateThread(Handle* out_handle, VAddr entry_point, u64 arg, VAddr stack_top, 931static ResultCode CreateThread(Handle* out_handle, VAddr entry_point, u64 arg, VAddr stack_top,
876 u32 priority, s32 processor_id) { 932 u32 priority, s32 processor_id) {
933 LOG_TRACE(Kernel_SVC,
934 "called entrypoint=0x{:08X} ({}), arg=0x{:08X}, stacktop=0x{:08X}, "
935 "threadpriority=0x{:08X}, processorid=0x{:08X} : created handle=0x{:08X}",
936 entry_point, name, arg, stack_top, priority, processor_id, *out_handle);
937
877 if (priority > THREADPRIO_LOWEST) { 938 if (priority > THREADPRIO_LOWEST) {
939 LOG_ERROR(Kernel_SVC, "Invalid thread priority");
878 return ERR_INVALID_THREAD_PRIORITY; 940 return ERR_INVALID_THREAD_PRIORITY;
879 } 941 }
880 942
@@ -905,6 +967,8 @@ static ResultCode CreateThread(Handle* out_handle, VAddr entry_point, u64 arg, V
905 967
906 const auto new_guest_handle = current_process->GetHandleTable().Create(thread); 968 const auto new_guest_handle = current_process->GetHandleTable().Create(thread);
907 if (new_guest_handle.Failed()) { 969 if (new_guest_handle.Failed()) {
970 LOG_ERROR(Kernel_SVC, "Failed to create handle with error=0x{:X}",
971 new_guest_handle.Code().raw);
908 return new_guest_handle.Code(); 972 return new_guest_handle.Code();
909 } 973 }
910 thread->SetGuestHandle(*new_guest_handle); 974 thread->SetGuestHandle(*new_guest_handle);
@@ -912,11 +976,6 @@ static ResultCode CreateThread(Handle* out_handle, VAddr entry_point, u64 arg, V
912 976
913 Core::System::GetInstance().CpuCore(thread->GetProcessorID()).PrepareReschedule(); 977 Core::System::GetInstance().CpuCore(thread->GetProcessorID()).PrepareReschedule();
914 978
915 LOG_TRACE(Kernel_SVC,
916 "called entrypoint=0x{:08X} ({}), arg=0x{:08X}, stacktop=0x{:08X}, "
917 "threadpriority=0x{:08X}, processorid=0x{:08X} : created handle=0x{:08X}",
918 entry_point, name, arg, stack_top, priority, processor_id, *out_handle);
919
920 return RESULT_SUCCESS; 979 return RESULT_SUCCESS;
921} 980}
922 981
@@ -927,6 +986,7 @@ static ResultCode StartThread(Handle thread_handle) {
927 const auto& handle_table = Core::CurrentProcess()->GetHandleTable(); 986 const auto& handle_table = Core::CurrentProcess()->GetHandleTable();
928 const SharedPtr<Thread> thread = handle_table.Get<Thread>(thread_handle); 987 const SharedPtr<Thread> thread = handle_table.Get<Thread>(thread_handle);
929 if (!thread) { 988 if (!thread) {
989 LOG_ERROR(Kernel_SVC, "Thread is an invalid handle");
930 return ERR_INVALID_HANDLE; 990 return ERR_INVALID_HANDLE;
931 } 991 }
932 992
@@ -1106,10 +1166,12 @@ static ResultCode WaitForAddress(VAddr address, u32 type, s32 value, s64 timeout
1106 address, type, value, timeout); 1166 address, type, value, timeout);
1107 // If the passed address is a kernel virtual address, return invalid memory state. 1167 // If the passed address is a kernel virtual address, return invalid memory state.
1108 if (Memory::IsKernelVirtualAddress(address)) { 1168 if (Memory::IsKernelVirtualAddress(address)) {
1169 LOG_ERROR(Kernel_SVC, "Address is a kernel virtual address");
1109 return ERR_INVALID_ADDRESS_STATE; 1170 return ERR_INVALID_ADDRESS_STATE;
1110 } 1171 }
1111 // If the address is not properly aligned to 4 bytes, return invalid address. 1172 // If the address is not properly aligned to 4 bytes, return invalid address.
1112 if (address % sizeof(u32) != 0) { 1173 if (address % sizeof(u32) != 0) {
1174 LOG_ERROR(Kernel_SVC, "Address is not aligned");
1113 return ERR_INVALID_ADDRESS; 1175 return ERR_INVALID_ADDRESS;
1114 } 1176 }
1115 1177
@@ -1121,6 +1183,7 @@ static ResultCode WaitForAddress(VAddr address, u32 type, s32 value, s64 timeout
1121 case AddressArbiter::ArbitrationType::WaitIfEqual: 1183 case AddressArbiter::ArbitrationType::WaitIfEqual:
1122 return AddressArbiter::WaitForAddressIfEqual(address, value, timeout); 1184 return AddressArbiter::WaitForAddressIfEqual(address, value, timeout);
1123 default: 1185 default:
1186 LOG_ERROR(Kernel_SVC, "Invalid arbitration type");
1124 return ERR_INVALID_ENUM_VALUE; 1187 return ERR_INVALID_ENUM_VALUE;
1125 } 1188 }
1126} 1189}
@@ -1131,10 +1194,12 @@ static ResultCode SignalToAddress(VAddr address, u32 type, s32 value, s32 num_to
1131 address, type, value, num_to_wake); 1194 address, type, value, num_to_wake);
1132 // If the passed address is a kernel virtual address, return invalid memory state. 1195 // If the passed address is a kernel virtual address, return invalid memory state.
1133 if (Memory::IsKernelVirtualAddress(address)) { 1196 if (Memory::IsKernelVirtualAddress(address)) {
1197 LOG_ERROR(Kernel_SVC, "Address is a kernel virtual address");
1134 return ERR_INVALID_ADDRESS_STATE; 1198 return ERR_INVALID_ADDRESS_STATE;
1135 } 1199 }
1136 // If the address is not properly aligned to 4 bytes, return invalid address. 1200 // If the address is not properly aligned to 4 bytes, return invalid address.
1137 if (address % sizeof(u32) != 0) { 1201 if (address % sizeof(u32) != 0) {
1202 LOG_ERROR(Kernel_SVC, "Address is not aligned");
1138 return ERR_INVALID_ADDRESS; 1203 return ERR_INVALID_ADDRESS;
1139 } 1204 }
1140 1205
@@ -1147,12 +1212,15 @@ static ResultCode SignalToAddress(VAddr address, u32 type, s32 value, s32 num_to
1147 return AddressArbiter::ModifyByWaitingCountAndSignalToAddressIfEqual(address, value, 1212 return AddressArbiter::ModifyByWaitingCountAndSignalToAddressIfEqual(address, value,
1148 num_to_wake); 1213 num_to_wake);
1149 default: 1214 default:
1215 LOG_ERROR(Kernel_SVC, "Invalid arbitration type");
1150 return ERR_INVALID_ENUM_VALUE; 1216 return ERR_INVALID_ENUM_VALUE;
1151 } 1217 }
1152} 1218}
1153 1219
1154/// This returns the total CPU ticks elapsed since the CPU was powered-on 1220/// This returns the total CPU ticks elapsed since the CPU was powered-on
1155static u64 GetSystemTick() { 1221static u64 GetSystemTick() {
1222 LOG_TRACE(Kernel_SVC, "called");
1223
1156 const u64 result{CoreTiming::GetTicks()}; 1224 const u64 result{CoreTiming::GetTicks()};
1157 1225
1158 // Advance time to defeat dumb games that busy-wait for the frame to end. 1226 // Advance time to defeat dumb games that busy-wait for the frame to end.
@@ -1226,6 +1294,7 @@ static ResultCode GetThreadCoreMask(Handle thread_handle, u32* core, u64* mask)
1226 const auto& handle_table = Core::CurrentProcess()->GetHandleTable(); 1294 const auto& handle_table = Core::CurrentProcess()->GetHandleTable();
1227 const SharedPtr<Thread> thread = handle_table.Get<Thread>(thread_handle); 1295 const SharedPtr<Thread> thread = handle_table.Get<Thread>(thread_handle);
1228 if (!thread) { 1296 if (!thread) {
1297 LOG_ERROR(Kernel_SVC, "Thread is an invalid handle");
1229 return ERR_INVALID_HANDLE; 1298 return ERR_INVALID_HANDLE;
1230 } 1299 }
1231 1300
@@ -1236,12 +1305,13 @@ static ResultCode GetThreadCoreMask(Handle thread_handle, u32* core, u64* mask)
1236} 1305}
1237 1306
1238static ResultCode SetThreadCoreMask(Handle thread_handle, u32 core, u64 mask) { 1307static ResultCode SetThreadCoreMask(Handle thread_handle, u32 core, u64 mask) {
1239 LOG_DEBUG(Kernel_SVC, "called, handle=0x{:08X}, mask=0x{:16X}, core=0x{:X}", thread_handle, 1308 LOG_DEBUG(Kernel_SVC, "called, handle=0x{:08X}, mask=0x{:016X}, core=0x{:X}", thread_handle,
1240 mask, core); 1309 mask, core);
1241 1310
1242 const auto& handle_table = Core::CurrentProcess()->GetHandleTable(); 1311 const auto& handle_table = Core::CurrentProcess()->GetHandleTable();
1243 const SharedPtr<Thread> thread = handle_table.Get<Thread>(thread_handle); 1312 const SharedPtr<Thread> thread = handle_table.Get<Thread>(thread_handle);
1244 if (!thread) { 1313 if (!thread) {
1314 LOG_ERROR(Kernel_SVC, "Thread is an invalid handle");
1245 return ERR_INVALID_HANDLE; 1315 return ERR_INVALID_HANDLE;
1246 } 1316 }
1247 1317
@@ -1256,6 +1326,7 @@ static ResultCode SetThreadCoreMask(Handle thread_handle, u32 core, u64 mask) {
1256 } 1326 }
1257 1327
1258 if (mask == 0) { 1328 if (mask == 0) {
1329 LOG_ERROR(Kernel_SVC, "Mask is 0");
1259 return ERR_INVALID_COMBINATION; 1330 return ERR_INVALID_COMBINATION;
1260 } 1331 }
1261 1332
@@ -1265,11 +1336,13 @@ static ResultCode SetThreadCoreMask(Handle thread_handle, u32 core, u64 mask) {
1265 if (core == OnlyChangeMask) { 1336 if (core == OnlyChangeMask) {
1266 core = thread->GetIdealCore(); 1337 core = thread->GetIdealCore();
1267 } else if (core >= Core::NUM_CPU_CORES && core != static_cast<u32>(-1)) { 1338 } else if (core >= Core::NUM_CPU_CORES && core != static_cast<u32>(-1)) {
1339 LOG_ERROR(Kernel_SVC, "Invalid processor ID specified");
1268 return ERR_INVALID_PROCESSOR_ID; 1340 return ERR_INVALID_PROCESSOR_ID;
1269 } 1341 }
1270 1342
1271 // Error out if the input core isn't enabled in the input mask. 1343 // Error out if the input core isn't enabled in the input mask.
1272 if (core < Core::NUM_CPU_CORES && (mask & (1ull << core)) == 0) { 1344 if (core < Core::NUM_CPU_CORES && (mask & (1ull << core)) == 0) {
1345 LOG_ERROR(Kernel_SVC, "Invalid core and mask");
1273 return ERR_INVALID_COMBINATION; 1346 return ERR_INVALID_COMBINATION;
1274 } 1347 }
1275 1348
@@ -1286,17 +1359,20 @@ static ResultCode CreateSharedMemory(Handle* handle, u64 size, u32 local_permiss
1286 // Size must be a multiple of 4KB and be less than or equal to 1359 // Size must be a multiple of 4KB and be less than or equal to
1287 // approx. 8 GB (actually (1GB - 512B) * 8) 1360 // approx. 8 GB (actually (1GB - 512B) * 8)
1288 if (size == 0 || (size & 0xFFFFFFFE00000FFF) != 0) { 1361 if (size == 0 || (size & 0xFFFFFFFE00000FFF) != 0) {
1362 LOG_ERROR(Kernel_SVC, "Invalid size");
1289 return ERR_INVALID_SIZE; 1363 return ERR_INVALID_SIZE;
1290 } 1364 }
1291 1365
1292 const auto local_perms = static_cast<MemoryPermission>(local_permissions); 1366 const auto local_perms = static_cast<MemoryPermission>(local_permissions);
1293 if (local_perms != MemoryPermission::Read && local_perms != MemoryPermission::ReadWrite) { 1367 if (local_perms != MemoryPermission::Read && local_perms != MemoryPermission::ReadWrite) {
1368 LOG_ERROR(Kernel_SVC, "Invalid memory permissions");
1294 return ERR_INVALID_MEMORY_PERMISSIONS; 1369 return ERR_INVALID_MEMORY_PERMISSIONS;
1295 } 1370 }
1296 1371
1297 const auto remote_perms = static_cast<MemoryPermission>(remote_permissions); 1372 const auto remote_perms = static_cast<MemoryPermission>(remote_permissions);
1298 if (remote_perms != MemoryPermission::Read && remote_perms != MemoryPermission::ReadWrite && 1373 if (remote_perms != MemoryPermission::Read && remote_perms != MemoryPermission::ReadWrite &&
1299 remote_perms != MemoryPermission::DontCare) { 1374 remote_perms != MemoryPermission::DontCare) {
1375 LOG_ERROR(Kernel_SVC, "Invalid memory permissions");
1300 return ERR_INVALID_MEMORY_PERMISSIONS; 1376 return ERR_INVALID_MEMORY_PERMISSIONS;
1301 } 1377 }
1302 1378
@@ -1316,6 +1392,7 @@ static ResultCode ClearEvent(Handle handle) {
1316 const auto& handle_table = Core::CurrentProcess()->GetHandleTable(); 1392 const auto& handle_table = Core::CurrentProcess()->GetHandleTable();
1317 SharedPtr<Event> evt = handle_table.Get<Event>(handle); 1393 SharedPtr<Event> evt = handle_table.Get<Event>(handle);
1318 if (evt == nullptr) { 1394 if (evt == nullptr) {
1395 LOG_ERROR(Kernel_SVC, "Invalid event handle");
1319 return ERR_INVALID_HANDLE; 1396 return ERR_INVALID_HANDLE;
1320 } 1397 }
1321 1398
@@ -1334,11 +1411,13 @@ static ResultCode GetProcessInfo(u64* out, Handle process_handle, u32 type) {
1334 const auto& handle_table = Core::CurrentProcess()->GetHandleTable(); 1411 const auto& handle_table = Core::CurrentProcess()->GetHandleTable();
1335 const auto process = handle_table.Get<Process>(process_handle); 1412 const auto process = handle_table.Get<Process>(process_handle);
1336 if (!process) { 1413 if (!process) {
1414 LOG_ERROR(Kernel_SVC, "Invalid process handle");
1337 return ERR_INVALID_HANDLE; 1415 return ERR_INVALID_HANDLE;
1338 } 1416 }
1339 1417
1340 const auto info_type = static_cast<InfoType>(type); 1418 const auto info_type = static_cast<InfoType>(type);
1341 if (info_type != InfoType::Status) { 1419 if (info_type != InfoType::Status) {
1420 LOG_ERROR(Kernel_SVC, "Info type is not status");
1342 return ERR_INVALID_ENUM_VALUE; 1421 return ERR_INVALID_ENUM_VALUE;
1343 } 1422 }
1344 1423
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp
index c629f9357..caabe5849 100644
--- a/src/core/hle/service/acc/acc.cpp
+++ b/src/core/hle/service/acc/acc.cpp
@@ -216,10 +216,11 @@ void Module::Interface::GetLastOpenedUser(Kernel::HLERequestContext& ctx) {
216void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) { 216void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) {
217 IPC::RequestParser rp{ctx}; 217 IPC::RequestParser rp{ctx};
218 UUID user_id = rp.PopRaw<UUID>(); 218 UUID user_id = rp.PopRaw<UUID>();
219 LOG_DEBUG(Service_ACC, "called user_id={}", user_id.Format());
220
219 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 221 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
220 rb.Push(RESULT_SUCCESS); 222 rb.Push(RESULT_SUCCESS);
221 rb.PushIpcInterface<IProfile>(user_id, *profile_manager); 223 rb.PushIpcInterface<IProfile>(user_id, *profile_manager);
222 LOG_DEBUG(Service_ACC, "called user_id={}", user_id.Format());
223} 224}
224 225
225void Module::Interface::IsUserRegistrationRequestPermitted(Kernel::HLERequestContext& ctx) { 226void Module::Interface::IsUserRegistrationRequestPermitted(Kernel::HLERequestContext& ctx) {
@@ -236,10 +237,10 @@ void Module::Interface::InitializeApplicationInfo(Kernel::HLERequestContext& ctx
236} 237}
237 238
238void Module::Interface::GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx) { 239void Module::Interface::GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx) {
240 LOG_DEBUG(Service_ACC, "called");
239 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 241 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
240 rb.Push(RESULT_SUCCESS); 242 rb.Push(RESULT_SUCCESS);
241 rb.PushIpcInterface<IManagerForApplication>(); 243 rb.PushIpcInterface<IManagerForApplication>();
242 LOG_DEBUG(Service_ACC, "called");
243} 244}
244 245
245void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContext& ctx) { 246void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContext& ctx) {
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 4f17b52f9..0bd52b602 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -217,6 +217,7 @@ ISelfController::~ISelfController() = default;
217void ISelfController::SetFocusHandlingMode(Kernel::HLERequestContext& ctx) { 217void ISelfController::SetFocusHandlingMode(Kernel::HLERequestContext& ctx) {
218 // Takes 3 input u8s with each field located immediately after the previous 218 // Takes 3 input u8s with each field located immediately after the previous
219 // u8, these are bool flags. No output. 219 // u8, these are bool flags. No output.
220 LOG_WARNING(Service_AM, "(STUBBED) called");
220 221
221 IPC::RequestParser rp{ctx}; 222 IPC::RequestParser rp{ctx};
222 223
@@ -229,44 +230,40 @@ void ISelfController::SetFocusHandlingMode(Kernel::HLERequestContext& ctx) {
229 230
230 IPC::ResponseBuilder rb{ctx, 2}; 231 IPC::ResponseBuilder rb{ctx, 2};
231 rb.Push(RESULT_SUCCESS); 232 rb.Push(RESULT_SUCCESS);
232
233 LOG_WARNING(Service_AM, "(STUBBED) called");
234} 233}
235 234
236void ISelfController::SetRestartMessageEnabled(Kernel::HLERequestContext& ctx) { 235void ISelfController::SetRestartMessageEnabled(Kernel::HLERequestContext& ctx) {
236 LOG_WARNING(Service_AM, "(STUBBED) called");
237
237 IPC::ResponseBuilder rb{ctx, 2}; 238 IPC::ResponseBuilder rb{ctx, 2};
238 rb.Push(RESULT_SUCCESS); 239 rb.Push(RESULT_SUCCESS);
239
240 LOG_WARNING(Service_AM, "(STUBBED) called");
241} 240}
242 241
243void ISelfController::SetPerformanceModeChangedNotification(Kernel::HLERequestContext& ctx) { 242void ISelfController::SetPerformanceModeChangedNotification(Kernel::HLERequestContext& ctx) {
244 IPC::RequestParser rp{ctx}; 243 IPC::RequestParser rp{ctx};
245 244
246 bool flag = rp.Pop<bool>(); 245 bool flag = rp.Pop<bool>();
246 LOG_WARNING(Service_AM, "(STUBBED) called flag={}", flag);
247 247
248 IPC::ResponseBuilder rb{ctx, 2}; 248 IPC::ResponseBuilder rb{ctx, 2};
249 rb.Push(RESULT_SUCCESS); 249 rb.Push(RESULT_SUCCESS);
250
251 LOG_WARNING(Service_AM, "(STUBBED) called flag={}", flag);
252} 250}
253 251
254void ISelfController::SetScreenShotPermission(Kernel::HLERequestContext& ctx) { 252void ISelfController::SetScreenShotPermission(Kernel::HLERequestContext& ctx) {
253 LOG_WARNING(Service_AM, "(STUBBED) called");
254
255 IPC::ResponseBuilder rb{ctx, 2}; 255 IPC::ResponseBuilder rb{ctx, 2};
256 rb.Push(RESULT_SUCCESS); 256 rb.Push(RESULT_SUCCESS);
257
258 LOG_WARNING(Service_AM, "(STUBBED) called");
259} 257}
260 258
261void ISelfController::SetOperationModeChangedNotification(Kernel::HLERequestContext& ctx) { 259void ISelfController::SetOperationModeChangedNotification(Kernel::HLERequestContext& ctx) {
262 IPC::RequestParser rp{ctx}; 260 IPC::RequestParser rp{ctx};
263 261
264 bool flag = rp.Pop<bool>(); 262 bool flag = rp.Pop<bool>();
263 LOG_WARNING(Service_AM, "(STUBBED) called flag={}", flag);
265 264
266 IPC::ResponseBuilder rb{ctx, 2}; 265 IPC::ResponseBuilder rb{ctx, 2};
267 rb.Push(RESULT_SUCCESS); 266 rb.Push(RESULT_SUCCESS);
268
269 LOG_WARNING(Service_AM, "(STUBBED) called flag={}", flag);
270} 267}
271 268
272void ISelfController::SetOutOfFocusSuspendingEnabled(Kernel::HLERequestContext& ctx) { 269void ISelfController::SetOutOfFocusSuspendingEnabled(Kernel::HLERequestContext& ctx) {
@@ -275,45 +272,45 @@ void ISelfController::SetOutOfFocusSuspendingEnabled(Kernel::HLERequestContext&
275 IPC::RequestParser rp{ctx}; 272 IPC::RequestParser rp{ctx};
276 273
277 bool enabled = rp.Pop<bool>(); 274 bool enabled = rp.Pop<bool>();
275 LOG_WARNING(Service_AM, "(STUBBED) called enabled={}", enabled);
278 276
279 IPC::ResponseBuilder rb{ctx, 2}; 277 IPC::ResponseBuilder rb{ctx, 2};
280 rb.Push(RESULT_SUCCESS); 278 rb.Push(RESULT_SUCCESS);
281
282 LOG_WARNING(Service_AM, "(STUBBED) called enabled={}", enabled);
283} 279}
284 280
285void ISelfController::LockExit(Kernel::HLERequestContext& ctx) { 281void ISelfController::LockExit(Kernel::HLERequestContext& ctx) {
282 LOG_WARNING(Service_AM, "(STUBBED) called");
283
286 IPC::ResponseBuilder rb{ctx, 2}; 284 IPC::ResponseBuilder rb{ctx, 2};
287 rb.Push(RESULT_SUCCESS); 285 rb.Push(RESULT_SUCCESS);
288
289 LOG_WARNING(Service_AM, "(STUBBED) called");
290} 286}
291 287
292void ISelfController::UnlockExit(Kernel::HLERequestContext& ctx) { 288void ISelfController::UnlockExit(Kernel::HLERequestContext& ctx) {
289 LOG_WARNING(Service_AM, "(STUBBED) called");
290
293 IPC::ResponseBuilder rb{ctx, 2}; 291 IPC::ResponseBuilder rb{ctx, 2};
294 rb.Push(RESULT_SUCCESS); 292 rb.Push(RESULT_SUCCESS);
295
296 LOG_WARNING(Service_AM, "(STUBBED) called");
297} 293}
298 294
299void ISelfController::GetLibraryAppletLaunchableEvent(Kernel::HLERequestContext& ctx) { 295void ISelfController::GetLibraryAppletLaunchableEvent(Kernel::HLERequestContext& ctx) {
296 LOG_WARNING(Service_AM, "(STUBBED) called");
297
300 launchable_event->Signal(); 298 launchable_event->Signal();
301 299
302 IPC::ResponseBuilder rb{ctx, 2, 1}; 300 IPC::ResponseBuilder rb{ctx, 2, 1};
303 rb.Push(RESULT_SUCCESS); 301 rb.Push(RESULT_SUCCESS);
304 rb.PushCopyObjects(launchable_event); 302 rb.PushCopyObjects(launchable_event);
305
306 LOG_WARNING(Service_AM, "(STUBBED) called");
307} 303}
308 304
309void ISelfController::SetScreenShotImageOrientation(Kernel::HLERequestContext& ctx) { 305void ISelfController::SetScreenShotImageOrientation(Kernel::HLERequestContext& ctx) {
306 LOG_WARNING(Service_AM, "(STUBBED) called");
307
310 IPC::ResponseBuilder rb{ctx, 2}; 308 IPC::ResponseBuilder rb{ctx, 2};
311 rb.Push(RESULT_SUCCESS); 309 rb.Push(RESULT_SUCCESS);
312
313 LOG_WARNING(Service_AM, "(STUBBED) called");
314} 310}
315 311
316void ISelfController::CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx) { 312void ISelfController::CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx) {
313 LOG_WARNING(Service_AM, "(STUBBED) called");
317 // TODO(Subv): Find out how AM determines the display to use, for now just 314 // TODO(Subv): Find out how AM determines the display to use, for now just
318 // create the layer in the Default display. 315 // create the layer in the Default display.
319 u64 display_id = nvflinger->OpenDisplay("Default"); 316 u64 display_id = nvflinger->OpenDisplay("Default");
@@ -322,32 +319,31 @@ void ISelfController::CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx)
322 IPC::ResponseBuilder rb{ctx, 4}; 319 IPC::ResponseBuilder rb{ctx, 4};
323 rb.Push(RESULT_SUCCESS); 320 rb.Push(RESULT_SUCCESS);
324 rb.Push(layer_id); 321 rb.Push(layer_id);
325
326 LOG_WARNING(Service_AM, "(STUBBED) called");
327} 322}
328 323
329void ISelfController::SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx) { 324void ISelfController::SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx) {
325 LOG_WARNING(Service_AM, "(STUBBED) called");
326
330 IPC::ResponseBuilder rb{ctx, 2}; 327 IPC::ResponseBuilder rb{ctx, 2};
331 rb.Push(RESULT_SUCCESS); 328 rb.Push(RESULT_SUCCESS);
332
333 LOG_WARNING(Service_AM, "(STUBBED) called");
334} 329}
335 330
336void ISelfController::SetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx) { 331void ISelfController::SetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx) {
337 IPC::RequestParser rp{ctx}; 332 IPC::RequestParser rp{ctx};
338 idle_time_detection_extension = rp.Pop<u32>(); 333 idle_time_detection_extension = rp.Pop<u32>();
334 LOG_WARNING(Service_AM, "(STUBBED) called idle_time_detection_extension={}",
335 idle_time_detection_extension);
336
339 IPC::ResponseBuilder rb{ctx, 2}; 337 IPC::ResponseBuilder rb{ctx, 2};
340 rb.Push(RESULT_SUCCESS); 338 rb.Push(RESULT_SUCCESS);
341
342 LOG_WARNING(Service_AM, "(STUBBED) called");
343} 339}
344 340
345void ISelfController::GetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx) { 341void ISelfController::GetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx) {
342 LOG_WARNING(Service_AM, "(STUBBED) called");
343
346 IPC::ResponseBuilder rb{ctx, 3}; 344 IPC::ResponseBuilder rb{ctx, 3};
347 rb.Push(RESULT_SUCCESS); 345 rb.Push(RESULT_SUCCESS);
348 rb.Push<u32>(idle_time_detection_extension); 346 rb.Push<u32>(idle_time_detection_extension);
349
350 LOG_WARNING(Service_AM, "(STUBBED) called");
351} 347}
352 348
353AppletMessageQueue::AppletMessageQueue() { 349AppletMessageQueue::AppletMessageQueue() {
@@ -438,47 +434,49 @@ ICommonStateGetter::ICommonStateGetter(std::shared_ptr<AppletMessageQueue> msg_q
438ICommonStateGetter::~ICommonStateGetter() = default; 434ICommonStateGetter::~ICommonStateGetter() = default;
439 435
440void ICommonStateGetter::GetBootMode(Kernel::HLERequestContext& ctx) { 436void ICommonStateGetter::GetBootMode(Kernel::HLERequestContext& ctx) {
437 LOG_DEBUG(Service_AM, "called");
438
441 IPC::ResponseBuilder rb{ctx, 3}; 439 IPC::ResponseBuilder rb{ctx, 3};
442 rb.Push(RESULT_SUCCESS); 440 rb.Push(RESULT_SUCCESS);
443 441
444 rb.Push<u8>(static_cast<u8>(Service::PM::SystemBootMode::Normal)); // Normal boot mode 442 rb.Push<u8>(static_cast<u8>(Service::PM::SystemBootMode::Normal)); // Normal boot mode
445
446 LOG_DEBUG(Service_AM, "called");
447} 443}
448 444
449void ICommonStateGetter::GetEventHandle(Kernel::HLERequestContext& ctx) { 445void ICommonStateGetter::GetEventHandle(Kernel::HLERequestContext& ctx) {
446 LOG_DEBUG(Service_AM, "called");
447
450 IPC::ResponseBuilder rb{ctx, 2, 1}; 448 IPC::ResponseBuilder rb{ctx, 2, 1};
451 rb.Push(RESULT_SUCCESS); 449 rb.Push(RESULT_SUCCESS);
452 rb.PushCopyObjects(msg_queue->GetMesssageRecieveEvent()); 450 rb.PushCopyObjects(msg_queue->GetMesssageRecieveEvent());
453
454 LOG_DEBUG(Service_AM, "called");
455} 451}
456 452
457void ICommonStateGetter::ReceiveMessage(Kernel::HLERequestContext& ctx) { 453void ICommonStateGetter::ReceiveMessage(Kernel::HLERequestContext& ctx) {
454 LOG_DEBUG(Service_AM, "called");
455
458 IPC::ResponseBuilder rb{ctx, 3}; 456 IPC::ResponseBuilder rb{ctx, 3};
459 rb.Push(RESULT_SUCCESS); 457 rb.Push(RESULT_SUCCESS);
460 rb.PushEnum<AppletMessageQueue::AppletMessage>(msg_queue->PopMessage()); 458 rb.PushEnum<AppletMessageQueue::AppletMessage>(msg_queue->PopMessage());
461
462 LOG_DEBUG(Service_AM, "called");
463} 459}
464 460
465void ICommonStateGetter::GetCurrentFocusState(Kernel::HLERequestContext& ctx) { 461void ICommonStateGetter::GetCurrentFocusState(Kernel::HLERequestContext& ctx) {
462 LOG_WARNING(Service_AM, "(STUBBED) called");
463
466 IPC::ResponseBuilder rb{ctx, 3}; 464 IPC::ResponseBuilder rb{ctx, 3};
467 rb.Push(RESULT_SUCCESS); 465 rb.Push(RESULT_SUCCESS);
468 rb.Push(static_cast<u8>(FocusState::InFocus)); 466 rb.Push(static_cast<u8>(FocusState::InFocus));
469
470 LOG_WARNING(Service_AM, "(STUBBED) called");
471} 467}
472 468
473void ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent(Kernel::HLERequestContext& ctx) { 469void ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent(Kernel::HLERequestContext& ctx) {
470 LOG_DEBUG(Service_AM, "called");
471
474 IPC::ResponseBuilder rb{ctx, 2, 1}; 472 IPC::ResponseBuilder rb{ctx, 2, 1};
475 rb.Push(RESULT_SUCCESS); 473 rb.Push(RESULT_SUCCESS);
476 rb.PushCopyObjects(msg_queue->GetOperationModeChangedEvent()); 474 rb.PushCopyObjects(msg_queue->GetOperationModeChangedEvent());
477
478 LOG_DEBUG(Service_AM, "called");
479} 475}
480 476
481void ICommonStateGetter::GetDefaultDisplayResolution(Kernel::HLERequestContext& ctx) { 477void ICommonStateGetter::GetDefaultDisplayResolution(Kernel::HLERequestContext& ctx) {
478 LOG_DEBUG(Service_AM, "called");
479
482 IPC::ResponseBuilder rb{ctx, 4}; 480 IPC::ResponseBuilder rb{ctx, 4};
483 rb.Push(RESULT_SUCCESS); 481 rb.Push(RESULT_SUCCESS);
484 482
@@ -493,8 +491,6 @@ void ICommonStateGetter::GetDefaultDisplayResolution(Kernel::HLERequestContext&
493 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedHeight) * 491 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedHeight) *
494 static_cast<u32>(Settings::values.resolution_factor)); 492 static_cast<u32>(Settings::values.resolution_factor));
495 } 493 }
496
497 LOG_DEBUG(Service_AM, "called");
498} 494}
499 495
500IStorage::IStorage(std::vector<u8> buffer) 496IStorage::IStorage(std::vector<u8> buffer)
@@ -517,21 +513,21 @@ const std::vector<u8>& IStorage::GetData() const {
517 513
518void ICommonStateGetter::GetOperationMode(Kernel::HLERequestContext& ctx) { 514void ICommonStateGetter::GetOperationMode(Kernel::HLERequestContext& ctx) {
519 const bool use_docked_mode{Settings::values.use_docked_mode}; 515 const bool use_docked_mode{Settings::values.use_docked_mode};
516 LOG_DEBUG(Service_AM, "called, use_docked_mode={}", use_docked_mode);
517
520 IPC::ResponseBuilder rb{ctx, 3}; 518 IPC::ResponseBuilder rb{ctx, 3};
521 rb.Push(RESULT_SUCCESS); 519 rb.Push(RESULT_SUCCESS);
522 rb.Push(static_cast<u8>(use_docked_mode ? OperationMode::Docked : OperationMode::Handheld)); 520 rb.Push(static_cast<u8>(use_docked_mode ? OperationMode::Docked : OperationMode::Handheld));
523
524 LOG_DEBUG(Service_AM, "called");
525} 521}
526 522
527void ICommonStateGetter::GetPerformanceMode(Kernel::HLERequestContext& ctx) { 523void ICommonStateGetter::GetPerformanceMode(Kernel::HLERequestContext& ctx) {
528 const bool use_docked_mode{Settings::values.use_docked_mode}; 524 const bool use_docked_mode{Settings::values.use_docked_mode};
525 LOG_DEBUG(Service_AM, "called, use_docked_mode={}", use_docked_mode);
526
529 IPC::ResponseBuilder rb{ctx, 3}; 527 IPC::ResponseBuilder rb{ctx, 3};
530 rb.Push(RESULT_SUCCESS); 528 rb.Push(RESULT_SUCCESS);
531 rb.Push(static_cast<u32>(use_docked_mode ? APM::PerformanceMode::Docked 529 rb.Push(static_cast<u32>(use_docked_mode ? APM::PerformanceMode::Docked
532 : APM::PerformanceMode::Handheld)); 530 : APM::PerformanceMode::Handheld));
533
534 LOG_DEBUG(Service_AM, "called");
535} 531}
536 532
537class ILibraryAppletAccessor final : public ServiceFramework<ILibraryAppletAccessor> { 533class ILibraryAppletAccessor final : public ServiceFramework<ILibraryAppletAccessor> {
@@ -566,32 +562,34 @@ public:
566 562
567private: 563private:
568 void GetAppletStateChangedEvent(Kernel::HLERequestContext& ctx) { 564 void GetAppletStateChangedEvent(Kernel::HLERequestContext& ctx) {
565 LOG_DEBUG(Service_AM, "called");
566
569 const auto event = applet->GetBroker().GetStateChangedEvent(); 567 const auto event = applet->GetBroker().GetStateChangedEvent();
570 event->Signal(); 568 event->Signal();
571 569
572 IPC::ResponseBuilder rb{ctx, 2, 1}; 570 IPC::ResponseBuilder rb{ctx, 2, 1};
573 rb.Push(RESULT_SUCCESS); 571 rb.Push(RESULT_SUCCESS);
574 rb.PushCopyObjects(event); 572 rb.PushCopyObjects(event);
575
576 LOG_DEBUG(Service_AM, "called");
577 } 573 }
578 574
579 void IsCompleted(Kernel::HLERequestContext& ctx) { 575 void IsCompleted(Kernel::HLERequestContext& ctx) {
576 LOG_DEBUG(Service_AM, "called");
577
580 IPC::ResponseBuilder rb{ctx, 3}; 578 IPC::ResponseBuilder rb{ctx, 3};
581 rb.Push(RESULT_SUCCESS); 579 rb.Push(RESULT_SUCCESS);
582 rb.Push<u32>(applet->TransactionComplete()); 580 rb.Push<u32>(applet->TransactionComplete());
583
584 LOG_DEBUG(Service_AM, "called");
585 } 581 }
586 582
587 void GetResult(Kernel::HLERequestContext& ctx) { 583 void GetResult(Kernel::HLERequestContext& ctx) {
584 LOG_DEBUG(Service_AM, "called");
585
588 IPC::ResponseBuilder rb{ctx, 2}; 586 IPC::ResponseBuilder rb{ctx, 2};
589 rb.Push(applet->GetStatus()); 587 rb.Push(applet->GetStatus());
590
591 LOG_DEBUG(Service_AM, "called");
592 } 588 }
593 589
594 void Start(Kernel::HLERequestContext& ctx) { 590 void Start(Kernel::HLERequestContext& ctx) {
591 LOG_DEBUG(Service_AM, "called");
592
595 ASSERT(applet != nullptr); 593 ASSERT(applet != nullptr);
596 594
597 applet->Initialize(); 595 applet->Initialize();
@@ -599,36 +597,38 @@ private:
599 597
600 IPC::ResponseBuilder rb{ctx, 2}; 598 IPC::ResponseBuilder rb{ctx, 2};
601 rb.Push(RESULT_SUCCESS); 599 rb.Push(RESULT_SUCCESS);
602
603 LOG_DEBUG(Service_AM, "called");
604 } 600 }
605 601
606 void PushInData(Kernel::HLERequestContext& ctx) { 602 void PushInData(Kernel::HLERequestContext& ctx) {
603 LOG_DEBUG(Service_AM, "called");
604
607 IPC::RequestParser rp{ctx}; 605 IPC::RequestParser rp{ctx};
608 applet->GetBroker().PushNormalDataFromGame(*rp.PopIpcInterface<IStorage>()); 606 applet->GetBroker().PushNormalDataFromGame(*rp.PopIpcInterface<IStorage>());
609 607
610 IPC::ResponseBuilder rb{ctx, 2}; 608 IPC::ResponseBuilder rb{ctx, 2};
611 rb.Push(RESULT_SUCCESS); 609 rb.Push(RESULT_SUCCESS);
612
613 LOG_DEBUG(Service_AM, "called");
614 } 610 }
615 611
616 void PopOutData(Kernel::HLERequestContext& ctx) { 612 void PopOutData(Kernel::HLERequestContext& ctx) {
613 LOG_DEBUG(Service_AM, "called");
614
617 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 615 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
618 616
619 const auto storage = applet->GetBroker().PopNormalDataToGame(); 617 const auto storage = applet->GetBroker().PopNormalDataToGame();
620 if (storage == nullptr) { 618 if (storage == nullptr) {
619 LOG_ERROR(Service_AM, "storage is a nullptr");
620
621 rb.Push(ERR_NO_DATA_IN_CHANNEL); 621 rb.Push(ERR_NO_DATA_IN_CHANNEL);
622 return; 622 return;
623 } 623 }
624 624
625 rb.Push(RESULT_SUCCESS); 625 rb.Push(RESULT_SUCCESS);
626 rb.PushIpcInterface<IStorage>(std::move(*storage)); 626 rb.PushIpcInterface<IStorage>(std::move(*storage));
627
628 LOG_DEBUG(Service_AM, "called");
629 } 627 }
630 628
631 void PushInteractiveInData(Kernel::HLERequestContext& ctx) { 629 void PushInteractiveInData(Kernel::HLERequestContext& ctx) {
630 LOG_DEBUG(Service_AM, "called");
631
632 IPC::RequestParser rp{ctx}; 632 IPC::RequestParser rp{ctx};
633 applet->GetBroker().PushInteractiveDataFromGame(*rp.PopIpcInterface<IStorage>()); 633 applet->GetBroker().PushInteractiveDataFromGame(*rp.PopIpcInterface<IStorage>());
634 634
@@ -638,51 +638,51 @@ private:
638 638
639 IPC::ResponseBuilder rb{ctx, 2}; 639 IPC::ResponseBuilder rb{ctx, 2};
640 rb.Push(RESULT_SUCCESS); 640 rb.Push(RESULT_SUCCESS);
641
642 LOG_DEBUG(Service_AM, "called");
643 } 641 }
644 642
645 void PopInteractiveOutData(Kernel::HLERequestContext& ctx) { 643 void PopInteractiveOutData(Kernel::HLERequestContext& ctx) {
644 LOG_DEBUG(Service_AM, "called");
645
646 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 646 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
647 647
648 const auto storage = applet->GetBroker().PopInteractiveDataToGame(); 648 const auto storage = applet->GetBroker().PopInteractiveDataToGame();
649 if (storage == nullptr) { 649 if (storage == nullptr) {
650 LOG_ERROR(Service_AM, "storage is a nullptr");
651
650 rb.Push(ERR_NO_DATA_IN_CHANNEL); 652 rb.Push(ERR_NO_DATA_IN_CHANNEL);
651 return; 653 return;
652 } 654 }
653 655
654 rb.Push(RESULT_SUCCESS); 656 rb.Push(RESULT_SUCCESS);
655 rb.PushIpcInterface<IStorage>(std::move(*storage)); 657 rb.PushIpcInterface<IStorage>(std::move(*storage));
656
657 LOG_DEBUG(Service_AM, "called");
658 } 658 }
659 659
660 void GetPopOutDataEvent(Kernel::HLERequestContext& ctx) { 660 void GetPopOutDataEvent(Kernel::HLERequestContext& ctx) {
661 LOG_DEBUG(Service_AM, "called");
662
661 IPC::ResponseBuilder rb{ctx, 2, 1}; 663 IPC::ResponseBuilder rb{ctx, 2, 1};
662 rb.Push(RESULT_SUCCESS); 664 rb.Push(RESULT_SUCCESS);
663 rb.PushCopyObjects(applet->GetBroker().GetNormalDataEvent()); 665 rb.PushCopyObjects(applet->GetBroker().GetNormalDataEvent());
664
665 LOG_DEBUG(Service_AM, "called");
666 } 666 }
667 667
668 void GetPopInteractiveOutDataEvent(Kernel::HLERequestContext& ctx) { 668 void GetPopInteractiveOutDataEvent(Kernel::HLERequestContext& ctx) {
669 LOG_DEBUG(Service_AM, "called");
670
669 IPC::ResponseBuilder rb{ctx, 2, 1}; 671 IPC::ResponseBuilder rb{ctx, 2, 1};
670 rb.Push(RESULT_SUCCESS); 672 rb.Push(RESULT_SUCCESS);
671 rb.PushCopyObjects(applet->GetBroker().GetInteractiveDataEvent()); 673 rb.PushCopyObjects(applet->GetBroker().GetInteractiveDataEvent());
672
673 LOG_DEBUG(Service_AM, "called");
674 } 674 }
675 675
676 std::shared_ptr<Applets::Applet> applet; 676 std::shared_ptr<Applets::Applet> applet;
677}; 677};
678 678
679void IStorage::Open(Kernel::HLERequestContext& ctx) { 679void IStorage::Open(Kernel::HLERequestContext& ctx) {
680 LOG_DEBUG(Service_AM, "called");
681
680 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 682 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
681 683
682 rb.Push(RESULT_SUCCESS); 684 rb.Push(RESULT_SUCCESS);
683 rb.PushIpcInterface<IStorageAccessor>(*this); 685 rb.PushIpcInterface<IStorageAccessor>(*this);
684
685 LOG_DEBUG(Service_AM, "called");
686} 686}
687 687
688IStorageAccessor::IStorageAccessor(IStorage& storage) 688IStorageAccessor::IStorageAccessor(IStorage& storage)
@@ -701,21 +701,25 @@ IStorageAccessor::IStorageAccessor(IStorage& storage)
701IStorageAccessor::~IStorageAccessor() = default; 701IStorageAccessor::~IStorageAccessor() = default;
702 702
703void IStorageAccessor::GetSize(Kernel::HLERequestContext& ctx) { 703void IStorageAccessor::GetSize(Kernel::HLERequestContext& ctx) {
704 LOG_DEBUG(Service_AM, "called");
705
704 IPC::ResponseBuilder rb{ctx, 4}; 706 IPC::ResponseBuilder rb{ctx, 4};
705 707
706 rb.Push(RESULT_SUCCESS); 708 rb.Push(RESULT_SUCCESS);
707 rb.Push(static_cast<u64>(backing.buffer.size())); 709 rb.Push(static_cast<u64>(backing.buffer.size()));
708
709 LOG_DEBUG(Service_AM, "called");
710} 710}
711 711
712void IStorageAccessor::Write(Kernel::HLERequestContext& ctx) { 712void IStorageAccessor::Write(Kernel::HLERequestContext& ctx) {
713 IPC::RequestParser rp{ctx}; 713 IPC::RequestParser rp{ctx};
714 714
715 const u64 offset{rp.Pop<u64>()}; 715 const u64 offset{rp.Pop<u64>()};
716 LOG_DEBUG(Service_AM, "called, offset={}", offset);
717
716 const std::vector<u8> data{ctx.ReadBuffer()}; 718 const std::vector<u8> data{ctx.ReadBuffer()};
717 719
718 if (data.size() > backing.buffer.size() - offset) { 720 if (data.size() > backing.buffer.size() - offset) {
721 LOG_ERROR(Service_AM, "offset is out of bounds");
722
719 IPC::ResponseBuilder rb{ctx, 2}; 723 IPC::ResponseBuilder rb{ctx, 2};
720 rb.Push(ERR_SIZE_OUT_OF_BOUNDS); 724 rb.Push(ERR_SIZE_OUT_OF_BOUNDS);
721 } 725 }
@@ -724,17 +728,19 @@ void IStorageAccessor::Write(Kernel::HLERequestContext& ctx) {
724 728
725 IPC::ResponseBuilder rb{ctx, 2}; 729 IPC::ResponseBuilder rb{ctx, 2};
726 rb.Push(RESULT_SUCCESS); 730 rb.Push(RESULT_SUCCESS);
727
728 LOG_DEBUG(Service_AM, "called, offset={}", offset);
729} 731}
730 732
731void IStorageAccessor::Read(Kernel::HLERequestContext& ctx) { 733void IStorageAccessor::Read(Kernel::HLERequestContext& ctx) {
732 IPC::RequestParser rp{ctx}; 734 IPC::RequestParser rp{ctx};
733 735
734 const u64 offset{rp.Pop<u64>()}; 736 const u64 offset{rp.Pop<u64>()};
737 LOG_DEBUG(Service_AM, "called, offset={}", offset);
738
735 const std::size_t size{ctx.GetWriteBufferSize()}; 739 const std::size_t size{ctx.GetWriteBufferSize()};
736 740
737 if (size > backing.buffer.size() - offset) { 741 if (size > backing.buffer.size() - offset) {
742 LOG_ERROR(Service_AM, "offset is out of bounds");
743
738 IPC::ResponseBuilder rb{ctx, 2}; 744 IPC::ResponseBuilder rb{ctx, 2};
739 rb.Push(ERR_SIZE_OUT_OF_BOUNDS); 745 rb.Push(ERR_SIZE_OUT_OF_BOUNDS);
740 } 746 }
@@ -743,8 +749,6 @@ void IStorageAccessor::Read(Kernel::HLERequestContext& ctx) {
743 749
744 IPC::ResponseBuilder rb{ctx, 2}; 750 IPC::ResponseBuilder rb{ctx, 2};
745 rb.Push(RESULT_SUCCESS); 751 rb.Push(RESULT_SUCCESS);
746
747 LOG_DEBUG(Service_AM, "called, offset={}", offset);
748} 752}
749 753
750ILibraryAppletCreator::ILibraryAppletCreator() : ServiceFramework("ILibraryAppletCreator") { 754ILibraryAppletCreator::ILibraryAppletCreator() : ServiceFramework("ILibraryAppletCreator") {
@@ -783,6 +787,8 @@ void ILibraryAppletCreator::CreateLibraryApplet(Kernel::HLERequestContext& ctx)
783 const auto applet = GetAppletFromId(applet_id); 787 const auto applet = GetAppletFromId(applet_id);
784 788
785 if (applet == nullptr) { 789 if (applet == nullptr) {
790 LOG_ERROR(Service_AM, "Applet doesn't exist!");
791
786 IPC::ResponseBuilder rb{ctx, 2}; 792 IPC::ResponseBuilder rb{ctx, 2};
787 rb.Push(ResultCode(-1)); 793 rb.Push(ResultCode(-1));
788 return; 794 return;
@@ -792,23 +798,23 @@ void ILibraryAppletCreator::CreateLibraryApplet(Kernel::HLERequestContext& ctx)
792 798
793 rb.Push(RESULT_SUCCESS); 799 rb.Push(RESULT_SUCCESS);
794 rb.PushIpcInterface<AM::ILibraryAppletAccessor>(applet); 800 rb.PushIpcInterface<AM::ILibraryAppletAccessor>(applet);
795
796 LOG_DEBUG(Service_AM, "called");
797} 801}
798 802
799void ILibraryAppletCreator::CreateStorage(Kernel::HLERequestContext& ctx) { 803void ILibraryAppletCreator::CreateStorage(Kernel::HLERequestContext& ctx) {
800 IPC::RequestParser rp{ctx}; 804 IPC::RequestParser rp{ctx};
801 const u64 size{rp.Pop<u64>()}; 805 const u64 size{rp.Pop<u64>()};
806 LOG_DEBUG(Service_AM, "called, size={}", size);
807
802 std::vector<u8> buffer(size); 808 std::vector<u8> buffer(size);
803 809
804 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 810 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
805 rb.Push(RESULT_SUCCESS); 811 rb.Push(RESULT_SUCCESS);
806 rb.PushIpcInterface<AM::IStorage>(std::move(buffer)); 812 rb.PushIpcInterface<AM::IStorage>(std::move(buffer));
807
808 LOG_DEBUG(Service_AM, "called, size={}", size);
809} 813}
810 814
811void ILibraryAppletCreator::CreateTransferMemoryStorage(Kernel::HLERequestContext& ctx) { 815void ILibraryAppletCreator::CreateTransferMemoryStorage(Kernel::HLERequestContext& ctx) {
816 LOG_DEBUG(Service_AM, "called");
817
812 IPC::RequestParser rp{ctx}; 818 IPC::RequestParser rp{ctx};
813 819
814 rp.SetCurrentOffset(3); 820 rp.SetCurrentOffset(3);
@@ -819,6 +825,7 @@ void ILibraryAppletCreator::CreateTransferMemoryStorage(Kernel::HLERequestContex
819 handle); 825 handle);
820 826
821 if (shared_mem == nullptr) { 827 if (shared_mem == nullptr) {
828 LOG_ERROR(Service_AM, "shared_mem is a nullpr");
822 IPC::ResponseBuilder rb{ctx, 2}; 829 IPC::ResponseBuilder rb{ctx, 2};
823 rb.Push(ResultCode(-1)); 830 rb.Push(ResultCode(-1));
824 return; 831 return;
@@ -882,38 +889,45 @@ IApplicationFunctions::IApplicationFunctions() : ServiceFramework("IApplicationF
882IApplicationFunctions::~IApplicationFunctions() = default; 889IApplicationFunctions::~IApplicationFunctions() = default;
883 890
884void IApplicationFunctions::EnableApplicationCrashReport(Kernel::HLERequestContext& ctx) { 891void IApplicationFunctions::EnableApplicationCrashReport(Kernel::HLERequestContext& ctx) {
892 LOG_WARNING(Service_AM, "(STUBBED) called");
893
885 IPC::ResponseBuilder rb{ctx, 2}; 894 IPC::ResponseBuilder rb{ctx, 2};
886 rb.Push(RESULT_SUCCESS); 895 rb.Push(RESULT_SUCCESS);
887 LOG_WARNING(Service_AM, "(STUBBED) called");
888} 896}
889 897
890void IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed( 898void IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed(
891 Kernel::HLERequestContext& ctx) { 899 Kernel::HLERequestContext& ctx) {
900 LOG_WARNING(Service_AM, "(STUBBED) called");
901
892 IPC::ResponseBuilder rb{ctx, 2}; 902 IPC::ResponseBuilder rb{ctx, 2};
893 rb.Push(RESULT_SUCCESS); 903 rb.Push(RESULT_SUCCESS);
894 LOG_WARNING(Service_AM, "(STUBBED) called");
895} 904}
896 905
897void IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed( 906void IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed(
898 Kernel::HLERequestContext& ctx) { 907 Kernel::HLERequestContext& ctx) {
908 LOG_WARNING(Service_AM, "(STUBBED) called");
909
899 IPC::ResponseBuilder rb{ctx, 2}; 910 IPC::ResponseBuilder rb{ctx, 2};
900 rb.Push(RESULT_SUCCESS); 911 rb.Push(RESULT_SUCCESS);
901 LOG_WARNING(Service_AM, "(STUBBED) called");
902} 912}
903 913
904void IApplicationFunctions::BeginBlockingHomeButton(Kernel::HLERequestContext& ctx) { 914void IApplicationFunctions::BeginBlockingHomeButton(Kernel::HLERequestContext& ctx) {
915 LOG_WARNING(Service_AM, "(STUBBED) called");
916
905 IPC::ResponseBuilder rb{ctx, 2}; 917 IPC::ResponseBuilder rb{ctx, 2};
906 rb.Push(RESULT_SUCCESS); 918 rb.Push(RESULT_SUCCESS);
907 LOG_WARNING(Service_AM, "(STUBBED) called");
908} 919}
909 920
910void IApplicationFunctions::EndBlockingHomeButton(Kernel::HLERequestContext& ctx) { 921void IApplicationFunctions::EndBlockingHomeButton(Kernel::HLERequestContext& ctx) {
922 LOG_WARNING(Service_AM, "(STUBBED) called");
923
911 IPC::ResponseBuilder rb{ctx, 2}; 924 IPC::ResponseBuilder rb{ctx, 2};
912 rb.Push(RESULT_SUCCESS); 925 rb.Push(RESULT_SUCCESS);
913 LOG_WARNING(Service_AM, "(STUBBED) called");
914} 926}
915 927
916void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) { 928void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) {
929 LOG_DEBUG(Service_AM, "called");
930
917 LaunchParameters params{}; 931 LaunchParameters params{};
918 932
919 params.magic = POP_LAUNCH_PARAMETER_MAGIC; 933 params.magic = POP_LAUNCH_PARAMETER_MAGIC;
@@ -932,21 +946,19 @@ void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) {
932 std::memcpy(buffer.data(), &params, buffer.size()); 946 std::memcpy(buffer.data(), &params, buffer.size());
933 947
934 rb.PushIpcInterface<AM::IStorage>(buffer); 948 rb.PushIpcInterface<AM::IStorage>(buffer);
935
936 LOG_DEBUG(Service_AM, "called");
937} 949}
938 950
939void IApplicationFunctions::CreateApplicationAndRequestToStartForQuest( 951void IApplicationFunctions::CreateApplicationAndRequestToStartForQuest(
940 Kernel::HLERequestContext& ctx) { 952 Kernel::HLERequestContext& ctx) {
953 LOG_WARNING(Service_AM, "(STUBBED) called");
954
941 IPC::ResponseBuilder rb{ctx, 2}; 955 IPC::ResponseBuilder rb{ctx, 2};
942 rb.Push(RESULT_SUCCESS); 956 rb.Push(RESULT_SUCCESS);
943 LOG_WARNING(Service_AM, "(STUBBED) called");
944} 957}
945 958
946void IApplicationFunctions::EnsureSaveData(Kernel::HLERequestContext& ctx) { 959void IApplicationFunctions::EnsureSaveData(Kernel::HLERequestContext& ctx) {
947 IPC::RequestParser rp{ctx}; 960 IPC::RequestParser rp{ctx};
948 u128 uid = rp.PopRaw<u128>(); // What does this do? 961 u128 uid = rp.PopRaw<u128>(); // What does this do?
949
950 LOG_WARNING(Service, "(STUBBED) called uid = {:016X}{:016X}", uid[1], uid[0]); 962 LOG_WARNING(Service, "(STUBBED) called uid = {:016X}{:016X}", uid[1], uid[0]);
951 963
952 IPC::ResponseBuilder rb{ctx, 4}; 964 IPC::ResponseBuilder rb{ctx, 4};
@@ -961,60 +973,62 @@ void IApplicationFunctions::SetTerminateResult(Kernel::HLERequestContext& ctx) {
961 973
962 IPC::RequestParser rp{ctx}; 974 IPC::RequestParser rp{ctx};
963 u32 result = rp.Pop<u32>(); 975 u32 result = rp.Pop<u32>();
976 LOG_WARNING(Service_AM, "(STUBBED) called, result=0x{:08X}", result);
964 977
965 IPC::ResponseBuilder rb{ctx, 2}; 978 IPC::ResponseBuilder rb{ctx, 2};
966 rb.Push(RESULT_SUCCESS); 979 rb.Push(RESULT_SUCCESS);
967
968 LOG_WARNING(Service_AM, "(STUBBED) called, result=0x{:08X}", result);
969} 980}
970 981
971void IApplicationFunctions::GetDisplayVersion(Kernel::HLERequestContext& ctx) { 982void IApplicationFunctions::GetDisplayVersion(Kernel::HLERequestContext& ctx) {
983 LOG_WARNING(Service_AM, "(STUBBED) called");
984
972 IPC::ResponseBuilder rb{ctx, 6}; 985 IPC::ResponseBuilder rb{ctx, 6};
973 rb.Push(RESULT_SUCCESS); 986 rb.Push(RESULT_SUCCESS);
974 rb.Push<u64>(1); 987 rb.Push<u64>(1);
975 rb.Push<u64>(0); 988 rb.Push<u64>(0);
976 LOG_WARNING(Service_AM, "(STUBBED) called");
977} 989}
978 990
979void IApplicationFunctions::GetDesiredLanguage(Kernel::HLERequestContext& ctx) { 991void IApplicationFunctions::GetDesiredLanguage(Kernel::HLERequestContext& ctx) {
980 // TODO(bunnei): This should be configurable 992 // TODO(bunnei): This should be configurable
993 LOG_DEBUG(Service_AM, "called");
994
981 IPC::ResponseBuilder rb{ctx, 4}; 995 IPC::ResponseBuilder rb{ctx, 4};
982 rb.Push(RESULT_SUCCESS); 996 rb.Push(RESULT_SUCCESS);
983 rb.Push( 997 rb.Push(
984 static_cast<u64>(Service::Set::GetLanguageCodeFromIndex(Settings::values.language_index))); 998 static_cast<u64>(Service::Set::GetLanguageCodeFromIndex(Settings::values.language_index)));
985 LOG_DEBUG(Service_AM, "called");
986} 999}
987 1000
988void IApplicationFunctions::InitializeGamePlayRecording(Kernel::HLERequestContext& ctx) { 1001void IApplicationFunctions::InitializeGamePlayRecording(Kernel::HLERequestContext& ctx) {
1002 LOG_WARNING(Service_AM, "(STUBBED) called");
1003
989 IPC::ResponseBuilder rb{ctx, 2}; 1004 IPC::ResponseBuilder rb{ctx, 2};
990 rb.Push(RESULT_SUCCESS); 1005 rb.Push(RESULT_SUCCESS);
991 LOG_WARNING(Service_AM, "(STUBBED) called");
992} 1006}
993 1007
994void IApplicationFunctions::SetGamePlayRecordingState(Kernel::HLERequestContext& ctx) { 1008void IApplicationFunctions::SetGamePlayRecordingState(Kernel::HLERequestContext& ctx) {
1009 LOG_WARNING(Service_AM, "(STUBBED) called");
1010
995 IPC::ResponseBuilder rb{ctx, 2}; 1011 IPC::ResponseBuilder rb{ctx, 2};
996 rb.Push(RESULT_SUCCESS); 1012 rb.Push(RESULT_SUCCESS);
997
998 LOG_WARNING(Service_AM, "(STUBBED) called");
999} 1013}
1000 1014
1001void IApplicationFunctions::NotifyRunning(Kernel::HLERequestContext& ctx) { 1015void IApplicationFunctions::NotifyRunning(Kernel::HLERequestContext& ctx) {
1016 LOG_WARNING(Service_AM, "(STUBBED) called");
1017
1002 IPC::ResponseBuilder rb{ctx, 3}; 1018 IPC::ResponseBuilder rb{ctx, 3};
1003 rb.Push(RESULT_SUCCESS); 1019 rb.Push(RESULT_SUCCESS);
1004 rb.Push<u8>(0); // Unknown, seems to be ignored by official processes 1020 rb.Push<u8>(0); // Unknown, seems to be ignored by official processes
1005
1006 LOG_WARNING(Service_AM, "(STUBBED) called");
1007} 1021}
1008 1022
1009void IApplicationFunctions::GetPseudoDeviceId(Kernel::HLERequestContext& ctx) { 1023void IApplicationFunctions::GetPseudoDeviceId(Kernel::HLERequestContext& ctx) {
1024 LOG_WARNING(Service_AM, "(STUBBED) called");
1025
1010 IPC::ResponseBuilder rb{ctx, 6}; 1026 IPC::ResponseBuilder rb{ctx, 6};
1011 rb.Push(RESULT_SUCCESS); 1027 rb.Push(RESULT_SUCCESS);
1012 1028
1013 // Returns a 128-bit UUID 1029 // Returns a 128-bit UUID
1014 rb.Push<u64>(0); 1030 rb.Push<u64>(0);
1015 rb.Push<u64>(0); 1031 rb.Push<u64>(0);
1016
1017 LOG_WARNING(Service_AM, "(STUBBED) called");
1018} 1032}
1019 1033
1020void InstallInterfaces(SM::ServiceManager& service_manager, 1034void InstallInterfaces(SM::ServiceManager& service_manager,
@@ -1051,9 +1065,10 @@ IHomeMenuFunctions::IHomeMenuFunctions() : ServiceFramework("IHomeMenuFunctions"
1051IHomeMenuFunctions::~IHomeMenuFunctions() = default; 1065IHomeMenuFunctions::~IHomeMenuFunctions() = default;
1052 1066
1053void IHomeMenuFunctions::RequestToGetForeground(Kernel::HLERequestContext& ctx) { 1067void IHomeMenuFunctions::RequestToGetForeground(Kernel::HLERequestContext& ctx) {
1068 LOG_WARNING(Service_AM, "(STUBBED) called");
1069
1054 IPC::ResponseBuilder rb{ctx, 2}; 1070 IPC::ResponseBuilder rb{ctx, 2};
1055 rb.Push(RESULT_SUCCESS); 1071 rb.Push(RESULT_SUCCESS);
1056 LOG_WARNING(Service_AM, "(STUBBED) called");
1057} 1072}
1058 1073
1059IGlobalStateController::IGlobalStateController() : ServiceFramework("IGlobalStateController") { 1074IGlobalStateController::IGlobalStateController() : ServiceFramework("IGlobalStateController") {
diff --git a/src/core/hle/service/am/applet_ae.cpp b/src/core/hle/service/am/applet_ae.cpp
index ec93e3529..41a573a91 100644
--- a/src/core/hle/service/am/applet_ae.cpp
+++ b/src/core/hle/service/am/applet_ae.cpp
@@ -32,66 +32,75 @@ public:
32 32
33private: 33private:
34 void GetCommonStateGetter(Kernel::HLERequestContext& ctx) { 34 void GetCommonStateGetter(Kernel::HLERequestContext& ctx) {
35 LOG_DEBUG(Service_AM, "called");
36
35 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 37 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
36 rb.Push(RESULT_SUCCESS); 38 rb.Push(RESULT_SUCCESS);
37 rb.PushIpcInterface<ICommonStateGetter>(msg_queue); 39 rb.PushIpcInterface<ICommonStateGetter>(msg_queue);
38 LOG_DEBUG(Service_AM, "called");
39 } 40 }
40 41
41 void GetSelfController(Kernel::HLERequestContext& ctx) { 42 void GetSelfController(Kernel::HLERequestContext& ctx) {
43 LOG_DEBUG(Service_AM, "called");
44
42 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 45 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
43 rb.Push(RESULT_SUCCESS); 46 rb.Push(RESULT_SUCCESS);
44 rb.PushIpcInterface<ISelfController>(nvflinger); 47 rb.PushIpcInterface<ISelfController>(nvflinger);
45 LOG_DEBUG(Service_AM, "called");
46 } 48 }
47 49
48 void GetWindowController(Kernel::HLERequestContext& ctx) { 50 void GetWindowController(Kernel::HLERequestContext& ctx) {
51 LOG_DEBUG(Service_AM, "called");
52
49 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 53 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
50 rb.Push(RESULT_SUCCESS); 54 rb.Push(RESULT_SUCCESS);
51 rb.PushIpcInterface<IWindowController>(); 55 rb.PushIpcInterface<IWindowController>();
52 LOG_DEBUG(Service_AM, "called");
53 } 56 }
54 57
55 void GetAudioController(Kernel::HLERequestContext& ctx) { 58 void GetAudioController(Kernel::HLERequestContext& ctx) {
59 LOG_DEBUG(Service_AM, "called");
60
56 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 61 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
57 rb.Push(RESULT_SUCCESS); 62 rb.Push(RESULT_SUCCESS);
58 rb.PushIpcInterface<IAudioController>(); 63 rb.PushIpcInterface<IAudioController>();
59 LOG_DEBUG(Service_AM, "called");
60 } 64 }
61 65
62 void GetDisplayController(Kernel::HLERequestContext& ctx) { 66 void GetDisplayController(Kernel::HLERequestContext& ctx) {
67 LOG_DEBUG(Service_AM, "called");
68
63 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 69 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
64 rb.Push(RESULT_SUCCESS); 70 rb.Push(RESULT_SUCCESS);
65 rb.PushIpcInterface<IDisplayController>(); 71 rb.PushIpcInterface<IDisplayController>();
66 LOG_DEBUG(Service_AM, "called");
67 } 72 }
68 73
69 void GetProcessWindingController(Kernel::HLERequestContext& ctx) { 74 void GetProcessWindingController(Kernel::HLERequestContext& ctx) {
75 LOG_DEBUG(Service_AM, "called");
76
70 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 77 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
71 rb.Push(RESULT_SUCCESS); 78 rb.Push(RESULT_SUCCESS);
72 rb.PushIpcInterface<IProcessWindingController>(); 79 rb.PushIpcInterface<IProcessWindingController>();
73 LOG_DEBUG(Service_AM, "called");
74 } 80 }
75 81
76 void GetDebugFunctions(Kernel::HLERequestContext& ctx) { 82 void GetDebugFunctions(Kernel::HLERequestContext& ctx) {
83 LOG_DEBUG(Service_AM, "called");
84
77 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 85 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
78 rb.Push(RESULT_SUCCESS); 86 rb.Push(RESULT_SUCCESS);
79 rb.PushIpcInterface<IDebugFunctions>(); 87 rb.PushIpcInterface<IDebugFunctions>();
80 LOG_DEBUG(Service_AM, "called");
81 } 88 }
82 89
83 void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) { 90 void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) {
91 LOG_DEBUG(Service_AM, "called");
92
84 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 93 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
85 rb.Push(RESULT_SUCCESS); 94 rb.Push(RESULT_SUCCESS);
86 rb.PushIpcInterface<ILibraryAppletCreator>(); 95 rb.PushIpcInterface<ILibraryAppletCreator>();
87 LOG_DEBUG(Service_AM, "called");
88 } 96 }
89 97
90 void GetApplicationFunctions(Kernel::HLERequestContext& ctx) { 98 void GetApplicationFunctions(Kernel::HLERequestContext& ctx) {
99 LOG_DEBUG(Service_AM, "called");
100
91 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 101 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
92 rb.Push(RESULT_SUCCESS); 102 rb.Push(RESULT_SUCCESS);
93 rb.PushIpcInterface<IApplicationFunctions>(); 103 rb.PushIpcInterface<IApplicationFunctions>();
94 LOG_DEBUG(Service_AM, "called");
95 } 104 }
96 105
97 std::shared_ptr<NVFlinger::NVFlinger> nvflinger; 106 std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
@@ -122,97 +131,110 @@ public:
122 131
123private: 132private:
124 void GetCommonStateGetter(Kernel::HLERequestContext& ctx) { 133 void GetCommonStateGetter(Kernel::HLERequestContext& ctx) {
134 LOG_DEBUG(Service_AM, "called");
135
125 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 136 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
126 rb.Push(RESULT_SUCCESS); 137 rb.Push(RESULT_SUCCESS);
127 rb.PushIpcInterface<ICommonStateGetter>(msg_queue); 138 rb.PushIpcInterface<ICommonStateGetter>(msg_queue);
128 LOG_DEBUG(Service_AM, "called");
129 } 139 }
130 140
131 void GetSelfController(Kernel::HLERequestContext& ctx) { 141 void GetSelfController(Kernel::HLERequestContext& ctx) {
142 LOG_DEBUG(Service_AM, "called");
143
132 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 144 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
133 rb.Push(RESULT_SUCCESS); 145 rb.Push(RESULT_SUCCESS);
134 rb.PushIpcInterface<ISelfController>(nvflinger); 146 rb.PushIpcInterface<ISelfController>(nvflinger);
135 LOG_DEBUG(Service_AM, "called");
136 } 147 }
137 148
138 void GetWindowController(Kernel::HLERequestContext& ctx) { 149 void GetWindowController(Kernel::HLERequestContext& ctx) {
150 LOG_DEBUG(Service_AM, "called");
151
139 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 152 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
140 rb.Push(RESULT_SUCCESS); 153 rb.Push(RESULT_SUCCESS);
141 rb.PushIpcInterface<IWindowController>(); 154 rb.PushIpcInterface<IWindowController>();
142 LOG_DEBUG(Service_AM, "called");
143 } 155 }
144 156
145 void GetAudioController(Kernel::HLERequestContext& ctx) { 157 void GetAudioController(Kernel::HLERequestContext& ctx) {
158 LOG_DEBUG(Service_AM, "called");
159
146 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 160 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
147 rb.Push(RESULT_SUCCESS); 161 rb.Push(RESULT_SUCCESS);
148 rb.PushIpcInterface<IAudioController>(); 162 rb.PushIpcInterface<IAudioController>();
149 LOG_DEBUG(Service_AM, "called");
150 } 163 }
151 164
152 void GetDisplayController(Kernel::HLERequestContext& ctx) { 165 void GetDisplayController(Kernel::HLERequestContext& ctx) {
166 LOG_DEBUG(Service_AM, "called");
167
153 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 168 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
154 rb.Push(RESULT_SUCCESS); 169 rb.Push(RESULT_SUCCESS);
155 rb.PushIpcInterface<IDisplayController>(); 170 rb.PushIpcInterface<IDisplayController>();
156 LOG_DEBUG(Service_AM, "called");
157 } 171 }
158 172
159 void GetDebugFunctions(Kernel::HLERequestContext& ctx) { 173 void GetDebugFunctions(Kernel::HLERequestContext& ctx) {
174 LOG_DEBUG(Service_AM, "called");
175
160 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 176 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
161 rb.Push(RESULT_SUCCESS); 177 rb.Push(RESULT_SUCCESS);
162 rb.PushIpcInterface<IDebugFunctions>(); 178 rb.PushIpcInterface<IDebugFunctions>();
163 LOG_DEBUG(Service_AM, "called");
164 } 179 }
165 180
166 void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) { 181 void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) {
182 LOG_DEBUG(Service_AM, "called");
183
167 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 184 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
168 rb.Push(RESULT_SUCCESS); 185 rb.Push(RESULT_SUCCESS);
169 rb.PushIpcInterface<ILibraryAppletCreator>(); 186 rb.PushIpcInterface<ILibraryAppletCreator>();
170 LOG_DEBUG(Service_AM, "called");
171 } 187 }
172 188
173 void GetHomeMenuFunctions(Kernel::HLERequestContext& ctx) { 189 void GetHomeMenuFunctions(Kernel::HLERequestContext& ctx) {
190 LOG_DEBUG(Service_AM, "called");
191
174 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 192 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
175 rb.Push(RESULT_SUCCESS); 193 rb.Push(RESULT_SUCCESS);
176 rb.PushIpcInterface<IHomeMenuFunctions>(); 194 rb.PushIpcInterface<IHomeMenuFunctions>();
177 LOG_DEBUG(Service_AM, "called");
178 } 195 }
179 196
180 void GetGlobalStateController(Kernel::HLERequestContext& ctx) { 197 void GetGlobalStateController(Kernel::HLERequestContext& ctx) {
198 LOG_DEBUG(Service_AM, "called");
199
181 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 200 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
182 rb.Push(RESULT_SUCCESS); 201 rb.Push(RESULT_SUCCESS);
183 rb.PushIpcInterface<IGlobalStateController>(); 202 rb.PushIpcInterface<IGlobalStateController>();
184 LOG_DEBUG(Service_AM, "called");
185 } 203 }
186 204
187 void GetApplicationCreator(Kernel::HLERequestContext& ctx) { 205 void GetApplicationCreator(Kernel::HLERequestContext& ctx) {
206 LOG_DEBUG(Service_AM, "called");
207
188 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 208 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
189 rb.Push(RESULT_SUCCESS); 209 rb.Push(RESULT_SUCCESS);
190 rb.PushIpcInterface<IApplicationCreator>(); 210 rb.PushIpcInterface<IApplicationCreator>();
191 LOG_DEBUG(Service_AM, "called");
192 } 211 }
193 std::shared_ptr<NVFlinger::NVFlinger> nvflinger; 212 std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
194 std::shared_ptr<AppletMessageQueue> msg_queue; 213 std::shared_ptr<AppletMessageQueue> msg_queue;
195}; 214};
196 215
197void AppletAE::OpenSystemAppletProxy(Kernel::HLERequestContext& ctx) { 216void AppletAE::OpenSystemAppletProxy(Kernel::HLERequestContext& ctx) {
217 LOG_DEBUG(Service_AM, "called");
218
198 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 219 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
199 rb.Push(RESULT_SUCCESS); 220 rb.Push(RESULT_SUCCESS);
200 rb.PushIpcInterface<ISystemAppletProxy>(nvflinger, msg_queue); 221 rb.PushIpcInterface<ISystemAppletProxy>(nvflinger, msg_queue);
201 LOG_DEBUG(Service_AM, "called");
202} 222}
203 223
204void AppletAE::OpenLibraryAppletProxy(Kernel::HLERequestContext& ctx) { 224void AppletAE::OpenLibraryAppletProxy(Kernel::HLERequestContext& ctx) {
225 LOG_DEBUG(Service_AM, "called");
226
205 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 227 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
206 rb.Push(RESULT_SUCCESS); 228 rb.Push(RESULT_SUCCESS);
207 rb.PushIpcInterface<ILibraryAppletProxy>(nvflinger, msg_queue); 229 rb.PushIpcInterface<ILibraryAppletProxy>(nvflinger, msg_queue);
208 LOG_DEBUG(Service_AM, "called");
209} 230}
210 231
211void AppletAE::OpenLibraryAppletProxyOld(Kernel::HLERequestContext& ctx) { 232void AppletAE::OpenLibraryAppletProxyOld(Kernel::HLERequestContext& ctx) {
233 LOG_DEBUG(Service_AM, "called");
234
212 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 235 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
213 rb.Push(RESULT_SUCCESS); 236 rb.Push(RESULT_SUCCESS);
214 rb.PushIpcInterface<ILibraryAppletProxy>(nvflinger, msg_queue); 237 rb.PushIpcInterface<ILibraryAppletProxy>(nvflinger, msg_queue);
215 LOG_DEBUG(Service_AM, "called");
216} 238}
217 239
218AppletAE::AppletAE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger, 240AppletAE::AppletAE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger,
diff --git a/src/core/hle/service/am/applet_oe.cpp b/src/core/hle/service/am/applet_oe.cpp
index 20c8d5fff..d3a0a1568 100644
--- a/src/core/hle/service/am/applet_oe.cpp
+++ b/src/core/hle/service/am/applet_oe.cpp
@@ -35,59 +35,67 @@ public:
35 35
36private: 36private:
37 void GetAudioController(Kernel::HLERequestContext& ctx) { 37 void GetAudioController(Kernel::HLERequestContext& ctx) {
38 LOG_DEBUG(Service_AM, "called");
39
38 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 40 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
39 rb.Push(RESULT_SUCCESS); 41 rb.Push(RESULT_SUCCESS);
40 rb.PushIpcInterface<IAudioController>(); 42 rb.PushIpcInterface<IAudioController>();
41 LOG_DEBUG(Service_AM, "called");
42 } 43 }
43 44
44 void GetDisplayController(Kernel::HLERequestContext& ctx) { 45 void GetDisplayController(Kernel::HLERequestContext& ctx) {
46 LOG_DEBUG(Service_AM, "called");
47
45 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 48 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
46 rb.Push(RESULT_SUCCESS); 49 rb.Push(RESULT_SUCCESS);
47 rb.PushIpcInterface<IDisplayController>(); 50 rb.PushIpcInterface<IDisplayController>();
48 LOG_DEBUG(Service_AM, "called");
49 } 51 }
50 52
51 void GetDebugFunctions(Kernel::HLERequestContext& ctx) { 53 void GetDebugFunctions(Kernel::HLERequestContext& ctx) {
54 LOG_DEBUG(Service_AM, "called");
55
52 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 56 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
53 rb.Push(RESULT_SUCCESS); 57 rb.Push(RESULT_SUCCESS);
54 rb.PushIpcInterface<IDebugFunctions>(); 58 rb.PushIpcInterface<IDebugFunctions>();
55 LOG_DEBUG(Service_AM, "called");
56 } 59 }
57 60
58 void GetWindowController(Kernel::HLERequestContext& ctx) { 61 void GetWindowController(Kernel::HLERequestContext& ctx) {
62 LOG_DEBUG(Service_AM, "called");
63
59 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 64 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
60 rb.Push(RESULT_SUCCESS); 65 rb.Push(RESULT_SUCCESS);
61 rb.PushIpcInterface<IWindowController>(); 66 rb.PushIpcInterface<IWindowController>();
62 LOG_DEBUG(Service_AM, "called");
63 } 67 }
64 68
65 void GetSelfController(Kernel::HLERequestContext& ctx) { 69 void GetSelfController(Kernel::HLERequestContext& ctx) {
70 LOG_DEBUG(Service_AM, "called");
71
66 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 72 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
67 rb.Push(RESULT_SUCCESS); 73 rb.Push(RESULT_SUCCESS);
68 rb.PushIpcInterface<ISelfController>(nvflinger); 74 rb.PushIpcInterface<ISelfController>(nvflinger);
69 LOG_DEBUG(Service_AM, "called");
70 } 75 }
71 76
72 void GetCommonStateGetter(Kernel::HLERequestContext& ctx) { 77 void GetCommonStateGetter(Kernel::HLERequestContext& ctx) {
78 LOG_DEBUG(Service_AM, "called");
79
73 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 80 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
74 rb.Push(RESULT_SUCCESS); 81 rb.Push(RESULT_SUCCESS);
75 rb.PushIpcInterface<ICommonStateGetter>(msg_queue); 82 rb.PushIpcInterface<ICommonStateGetter>(msg_queue);
76 LOG_DEBUG(Service_AM, "called");
77 } 83 }
78 84
79 void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) { 85 void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) {
86 LOG_DEBUG(Service_AM, "called");
87
80 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 88 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
81 rb.Push(RESULT_SUCCESS); 89 rb.Push(RESULT_SUCCESS);
82 rb.PushIpcInterface<ILibraryAppletCreator>(); 90 rb.PushIpcInterface<ILibraryAppletCreator>();
83 LOG_DEBUG(Service_AM, "called");
84 } 91 }
85 92
86 void GetApplicationFunctions(Kernel::HLERequestContext& ctx) { 93 void GetApplicationFunctions(Kernel::HLERequestContext& ctx) {
94 LOG_DEBUG(Service_AM, "called");
95
87 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 96 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
88 rb.Push(RESULT_SUCCESS); 97 rb.Push(RESULT_SUCCESS);
89 rb.PushIpcInterface<IApplicationFunctions>(); 98 rb.PushIpcInterface<IApplicationFunctions>();
90 LOG_DEBUG(Service_AM, "called");
91 } 99 }
92 100
93 std::shared_ptr<NVFlinger::NVFlinger> nvflinger; 101 std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
@@ -95,10 +103,11 @@ private:
95}; 103};
96 104
97void AppletOE::OpenApplicationProxy(Kernel::HLERequestContext& ctx) { 105void AppletOE::OpenApplicationProxy(Kernel::HLERequestContext& ctx) {
106 LOG_DEBUG(Service_AM, "called");
107
98 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 108 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
99 rb.Push(RESULT_SUCCESS); 109 rb.Push(RESULT_SUCCESS);
100 rb.PushIpcInterface<IApplicationProxy>(nvflinger, msg_queue); 110 rb.PushIpcInterface<IApplicationProxy>(nvflinger, msg_queue);
101 LOG_DEBUG(Service_AM, "called");
102} 111}
103 112
104AppletOE::AppletOE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger, 113AppletOE::AppletOE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger,
diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/aoc_u.cpp
index 54305cf05..bacf19de2 100644
--- a/src/core/hle/service/aoc/aoc_u.cpp
+++ b/src/core/hle/service/aoc/aoc_u.cpp
@@ -68,6 +68,8 @@ AOC_U::AOC_U() : ServiceFramework("aoc:u"), add_on_content(AccumulateAOCTitleIDs
68AOC_U::~AOC_U() = default; 68AOC_U::~AOC_U() = default;
69 69
70void AOC_U::CountAddOnContent(Kernel::HLERequestContext& ctx) { 70void AOC_U::CountAddOnContent(Kernel::HLERequestContext& ctx) {
71 LOG_DEBUG(Service_AOC, "called");
72
71 IPC::ResponseBuilder rb{ctx, 3}; 73 IPC::ResponseBuilder rb{ctx, 3};
72 rb.Push(RESULT_SUCCESS); 74 rb.Push(RESULT_SUCCESS);
73 75
@@ -82,6 +84,7 @@ void AOC_U::ListAddOnContent(Kernel::HLERequestContext& ctx) {
82 84
83 const auto offset = rp.PopRaw<u32>(); 85 const auto offset = rp.PopRaw<u32>();
84 auto count = rp.PopRaw<u32>(); 86 auto count = rp.PopRaw<u32>();
87 LOG_DEBUG(Service_AOC, "called with offset={}, count={}", offset, count);
85 88
86 const auto current = Core::System::GetInstance().CurrentProcess()->GetTitleID(); 89 const auto current = Core::System::GetInstance().CurrentProcess()->GetTitleID();
87 90
@@ -110,6 +113,8 @@ void AOC_U::ListAddOnContent(Kernel::HLERequestContext& ctx) {
110} 113}
111 114
112void AOC_U::GetAddOnContentBaseId(Kernel::HLERequestContext& ctx) { 115void AOC_U::GetAddOnContentBaseId(Kernel::HLERequestContext& ctx) {
116 LOG_DEBUG(Service_AOC, "called");
117
113 IPC::ResponseBuilder rb{ctx, 4}; 118 IPC::ResponseBuilder rb{ctx, 4};
114 rb.Push(RESULT_SUCCESS); 119 rb.Push(RESULT_SUCCESS);
115 const auto title_id = Core::System::GetInstance().CurrentProcess()->GetTitleID(); 120 const auto title_id = Core::System::GetInstance().CurrentProcess()->GetTitleID();
@@ -128,7 +133,6 @@ void AOC_U::PrepareAddOnContent(Kernel::HLERequestContext& ctx) {
128 IPC::RequestParser rp{ctx}; 133 IPC::RequestParser rp{ctx};
129 134
130 const auto aoc_id = rp.PopRaw<u32>(); 135 const auto aoc_id = rp.PopRaw<u32>();
131
132 LOG_WARNING(Service_AOC, "(STUBBED) called with aoc_id={:08X}", aoc_id); 136 LOG_WARNING(Service_AOC, "(STUBBED) called with aoc_id={:08X}", aoc_id);
133 137
134 IPC::ResponseBuilder rb{ctx, 2}; 138 IPC::ResponseBuilder rb{ctx, 2};
diff --git a/src/core/hle/service/apm/interface.cpp b/src/core/hle/service/apm/interface.cpp
index c22bd3859..fcacbab72 100644
--- a/src/core/hle/service/apm/interface.cpp
+++ b/src/core/hle/service/apm/interface.cpp
@@ -40,24 +40,22 @@ private:
40 40
41 auto mode = static_cast<PerformanceMode>(rp.Pop<u32>()); 41 auto mode = static_cast<PerformanceMode>(rp.Pop<u32>());
42 u32 config = rp.Pop<u32>(); 42 u32 config = rp.Pop<u32>();
43 LOG_WARNING(Service_APM, "(STUBBED) called mode={} config={}", static_cast<u32>(mode),
44 config);
43 45
44 IPC::ResponseBuilder rb{ctx, 2}; 46 IPC::ResponseBuilder rb{ctx, 2};
45 rb.Push(RESULT_SUCCESS); 47 rb.Push(RESULT_SUCCESS);
46
47 LOG_WARNING(Service_APM, "(STUBBED) called mode={} config={}", static_cast<u32>(mode),
48 config);
49 } 48 }
50 49
51 void GetPerformanceConfiguration(Kernel::HLERequestContext& ctx) { 50 void GetPerformanceConfiguration(Kernel::HLERequestContext& ctx) {
52 IPC::RequestParser rp{ctx}; 51 IPC::RequestParser rp{ctx};
53 52
54 auto mode = static_cast<PerformanceMode>(rp.Pop<u32>()); 53 auto mode = static_cast<PerformanceMode>(rp.Pop<u32>());
54 LOG_WARNING(Service_APM, "(STUBBED) called mode={}", static_cast<u32>(mode));
55 55
56 IPC::ResponseBuilder rb{ctx, 3}; 56 IPC::ResponseBuilder rb{ctx, 3};
57 rb.Push(RESULT_SUCCESS); 57 rb.Push(RESULT_SUCCESS);
58 rb.Push<u32>(static_cast<u32>(PerformanceConfiguration::Config1)); 58 rb.Push<u32>(static_cast<u32>(PerformanceConfiguration::Config1));
59
60 LOG_WARNING(Service_APM, "(STUBBED) called mode={}", static_cast<u32>(mode));
61 } 59 }
62}; 60};
63 61
@@ -73,11 +71,11 @@ APM::APM(std::shared_ptr<Module> apm, const char* name)
73APM::~APM() = default; 71APM::~APM() = default;
74 72
75void APM::OpenSession(Kernel::HLERequestContext& ctx) { 73void APM::OpenSession(Kernel::HLERequestContext& ctx) {
74 LOG_DEBUG(Service_APM, "called");
75
76 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 76 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
77 rb.Push(RESULT_SUCCESS); 77 rb.Push(RESULT_SUCCESS);
78 rb.PushIpcInterface<ISession>(); 78 rb.PushIpcInterface<ISession>();
79
80 LOG_DEBUG(Service_APM, "called");
81} 79}
82 80
83APM_Sys::APM_Sys() : ServiceFramework{"apm:sys"} { 81APM_Sys::APM_Sys() : ServiceFramework{"apm:sys"} {
@@ -98,11 +96,11 @@ APM_Sys::APM_Sys() : ServiceFramework{"apm:sys"} {
98APM_Sys::~APM_Sys() = default; 96APM_Sys::~APM_Sys() = default;
99 97
100void APM_Sys::GetPerformanceEvent(Kernel::HLERequestContext& ctx) { 98void APM_Sys::GetPerformanceEvent(Kernel::HLERequestContext& ctx) {
99 LOG_DEBUG(Service_APM, "called");
100
101 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 101 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
102 rb.Push(RESULT_SUCCESS); 102 rb.Push(RESULT_SUCCESS);
103 rb.PushIpcInterface<ISession>(); 103 rb.PushIpcInterface<ISession>();
104
105 LOG_DEBUG(Service_APM, "called");
106} 104}
107 105
108} // namespace Service::APM 106} // namespace Service::APM
diff --git a/src/core/hle/service/arp/arp.cpp b/src/core/hle/service/arp/arp.cpp
index 358ef2576..e675b0188 100644
--- a/src/core/hle/service/arp/arp.cpp
+++ b/src/core/hle/service/arp/arp.cpp
@@ -59,11 +59,11 @@ public:
59 59
60private: 60private:
61 void AcquireRegistrar(Kernel::HLERequestContext& ctx) { 61 void AcquireRegistrar(Kernel::HLERequestContext& ctx) {
62 LOG_DEBUG(Service_ARP, "called");
63
62 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 64 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
63 rb.Push(RESULT_SUCCESS); 65 rb.Push(RESULT_SUCCESS);
64 rb.PushIpcInterface<IRegistrar>(); 66 rb.PushIpcInterface<IRegistrar>();
65
66 LOG_DEBUG(Service_ARP, "called");
67 } 67 }
68}; 68};
69 69
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp
index 23e1f1165..2ee9bc273 100644
--- a/src/core/hle/service/audio/audout_u.cpp
+++ b/src/core/hle/service/audio/audout_u.cpp
@@ -86,6 +86,7 @@ private:
86 86
87 void GetAudioOutState(Kernel::HLERequestContext& ctx) { 87 void GetAudioOutState(Kernel::HLERequestContext& ctx) {
88 LOG_DEBUG(Service_Audio, "called"); 88 LOG_DEBUG(Service_Audio, "called");
89
89 IPC::ResponseBuilder rb{ctx, 3}; 90 IPC::ResponseBuilder rb{ctx, 3};
90 rb.Push(RESULT_SUCCESS); 91 rb.Push(RESULT_SUCCESS);
91 rb.Push(static_cast<u32>(stream->IsPlaying() ? AudioState::Started : AudioState::Stopped)); 92 rb.Push(static_cast<u32>(stream->IsPlaying() ? AudioState::Started : AudioState::Stopped));
@@ -148,6 +149,7 @@ private:
148 149
149 void GetReleasedAudioOutBufferImpl(Kernel::HLERequestContext& ctx) { 150 void GetReleasedAudioOutBufferImpl(Kernel::HLERequestContext& ctx) {
150 LOG_DEBUG(Service_Audio, "called {}", ctx.Description()); 151 LOG_DEBUG(Service_Audio, "called {}", ctx.Description());
152
151 IPC::RequestParser rp{ctx}; 153 IPC::RequestParser rp{ctx};
152 const u64 max_count{ctx.GetWriteBufferSize() / sizeof(u64)}; 154 const u64 max_count{ctx.GetWriteBufferSize() / sizeof(u64)};
153 const auto released_buffers{audio_core.GetTagsAndReleaseBuffers(stream, max_count)}; 155 const auto released_buffers{audio_core.GetTagsAndReleaseBuffers(stream, max_count)};
@@ -163,6 +165,7 @@ private:
163 165
164 void ContainsAudioOutBuffer(Kernel::HLERequestContext& ctx) { 166 void ContainsAudioOutBuffer(Kernel::HLERequestContext& ctx) {
165 LOG_DEBUG(Service_Audio, "called"); 167 LOG_DEBUG(Service_Audio, "called");
168
166 IPC::RequestParser rp{ctx}; 169 IPC::RequestParser rp{ctx};
167 const u64 tag{rp.Pop<u64>()}; 170 const u64 tag{rp.Pop<u64>()};
168 IPC::ResponseBuilder rb{ctx, 3}; 171 IPC::ResponseBuilder rb{ctx, 3};
@@ -172,6 +175,7 @@ private:
172 175
173 void GetAudioOutBufferCount(Kernel::HLERequestContext& ctx) { 176 void GetAudioOutBufferCount(Kernel::HLERequestContext& ctx) {
174 LOG_DEBUG(Service_Audio, "called"); 177 LOG_DEBUG(Service_Audio, "called");
178
175 IPC::ResponseBuilder rb{ctx, 3}; 179 IPC::ResponseBuilder rb{ctx, 3};
176 rb.Push(RESULT_SUCCESS); 180 rb.Push(RESULT_SUCCESS);
177 rb.Push(static_cast<u32>(stream->GetQueueSize())); 181 rb.Push(static_cast<u32>(stream->GetQueueSize()));
@@ -189,6 +193,7 @@ private:
189 193
190void AudOutU::ListAudioOutsImpl(Kernel::HLERequestContext& ctx) { 194void AudOutU::ListAudioOutsImpl(Kernel::HLERequestContext& ctx) {
191 LOG_DEBUG(Service_Audio, "called"); 195 LOG_DEBUG(Service_Audio, "called");
196
192 IPC::RequestParser rp{ctx}; 197 IPC::RequestParser rp{ctx};
193 198
194 ctx.WriteBuffer(DefaultDevice); 199 ctx.WriteBuffer(DefaultDevice);
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp
index d3ea57ea7..1c418a9bb 100644
--- a/src/core/hle/service/audio/audren_u.cpp
+++ b/src/core/hle/service/audio/audren_u.cpp
@@ -52,74 +52,79 @@ private:
52 } 52 }
53 53
54 void GetSampleRate(Kernel::HLERequestContext& ctx) { 54 void GetSampleRate(Kernel::HLERequestContext& ctx) {
55 LOG_DEBUG(Service_Audio, "called");
56
55 IPC::ResponseBuilder rb{ctx, 3}; 57 IPC::ResponseBuilder rb{ctx, 3};
56 rb.Push(RESULT_SUCCESS); 58 rb.Push(RESULT_SUCCESS);
57 rb.Push<u32>(renderer->GetSampleRate()); 59 rb.Push<u32>(renderer->GetSampleRate());
58 LOG_DEBUG(Service_Audio, "called");
59 } 60 }
60 61
61 void GetSampleCount(Kernel::HLERequestContext& ctx) { 62 void GetSampleCount(Kernel::HLERequestContext& ctx) {
63 LOG_DEBUG(Service_Audio, "called");
64
62 IPC::ResponseBuilder rb{ctx, 3}; 65 IPC::ResponseBuilder rb{ctx, 3};
63 rb.Push(RESULT_SUCCESS); 66 rb.Push(RESULT_SUCCESS);
64 rb.Push<u32>(renderer->GetSampleCount()); 67 rb.Push<u32>(renderer->GetSampleCount());
65 LOG_DEBUG(Service_Audio, "called");
66 } 68 }
67 69
68 void GetState(Kernel::HLERequestContext& ctx) { 70 void GetState(Kernel::HLERequestContext& ctx) {
71 LOG_DEBUG(Service_Audio, "called");
72
69 IPC::ResponseBuilder rb{ctx, 3}; 73 IPC::ResponseBuilder rb{ctx, 3};
70 rb.Push(RESULT_SUCCESS); 74 rb.Push(RESULT_SUCCESS);
71 rb.Push<u32>(static_cast<u32>(renderer->GetStreamState())); 75 rb.Push<u32>(static_cast<u32>(renderer->GetStreamState()));
72 LOG_DEBUG(Service_Audio, "called");
73 } 76 }
74 77
75 void GetMixBufferCount(Kernel::HLERequestContext& ctx) { 78 void GetMixBufferCount(Kernel::HLERequestContext& ctx) {
79 LOG_DEBUG(Service_Audio, "called");
80
76 IPC::ResponseBuilder rb{ctx, 3}; 81 IPC::ResponseBuilder rb{ctx, 3};
77 rb.Push(RESULT_SUCCESS); 82 rb.Push(RESULT_SUCCESS);
78 rb.Push<u32>(renderer->GetMixBufferCount()); 83 rb.Push<u32>(renderer->GetMixBufferCount());
79 LOG_DEBUG(Service_Audio, "called");
80 } 84 }
81 85
82 void RequestUpdateImpl(Kernel::HLERequestContext& ctx) { 86 void RequestUpdateImpl(Kernel::HLERequestContext& ctx) {
87 LOG_WARNING(Service_Audio, "(STUBBED) called");
88
83 ctx.WriteBuffer(renderer->UpdateAudioRenderer(ctx.ReadBuffer())); 89 ctx.WriteBuffer(renderer->UpdateAudioRenderer(ctx.ReadBuffer()));
84 IPC::ResponseBuilder rb{ctx, 2}; 90 IPC::ResponseBuilder rb{ctx, 2};
85 rb.Push(RESULT_SUCCESS); 91 rb.Push(RESULT_SUCCESS);
86 LOG_WARNING(Service_Audio, "(STUBBED) called");
87 } 92 }
88 93
89 void Start(Kernel::HLERequestContext& ctx) { 94 void Start(Kernel::HLERequestContext& ctx) {
95 LOG_WARNING(Service_Audio, "(STUBBED) called");
96
90 IPC::ResponseBuilder rb{ctx, 2}; 97 IPC::ResponseBuilder rb{ctx, 2};
91 98
92 rb.Push(RESULT_SUCCESS); 99 rb.Push(RESULT_SUCCESS);
93
94 LOG_WARNING(Service_Audio, "(STUBBED) called");
95 } 100 }
96 101
97 void Stop(Kernel::HLERequestContext& ctx) { 102 void Stop(Kernel::HLERequestContext& ctx) {
103 LOG_WARNING(Service_Audio, "(STUBBED) called");
104
98 IPC::ResponseBuilder rb{ctx, 2}; 105 IPC::ResponseBuilder rb{ctx, 2};
99 106
100 rb.Push(RESULT_SUCCESS); 107 rb.Push(RESULT_SUCCESS);
101
102 LOG_WARNING(Service_Audio, "(STUBBED) called");
103 } 108 }
104 109
105 void QuerySystemEvent(Kernel::HLERequestContext& ctx) { 110 void QuerySystemEvent(Kernel::HLERequestContext& ctx) {
111 LOG_WARNING(Service_Audio, "(STUBBED) called");
112
106 IPC::ResponseBuilder rb{ctx, 2, 1}; 113 IPC::ResponseBuilder rb{ctx, 2, 1};
107 rb.Push(RESULT_SUCCESS); 114 rb.Push(RESULT_SUCCESS);
108 rb.PushCopyObjects(system_event); 115 rb.PushCopyObjects(system_event);
109
110 LOG_WARNING(Service_Audio, "(STUBBED) called");
111 } 116 }
112 117
113 void SetRenderingTimeLimit(Kernel::HLERequestContext& ctx) { 118 void SetRenderingTimeLimit(Kernel::HLERequestContext& ctx) {
114 IPC::RequestParser rp{ctx}; 119 IPC::RequestParser rp{ctx};
115 rendering_time_limit_percent = rp.Pop<u32>(); 120 rendering_time_limit_percent = rp.Pop<u32>();
121 LOG_DEBUG(Service_Audio, "called. rendering_time_limit_percent={}",
122 rendering_time_limit_percent);
123
116 ASSERT(rendering_time_limit_percent >= 0 && rendering_time_limit_percent <= 100); 124 ASSERT(rendering_time_limit_percent >= 0 && rendering_time_limit_percent <= 100);
117 125
118 IPC::ResponseBuilder rb{ctx, 2}; 126 IPC::ResponseBuilder rb{ctx, 2};
119 rb.Push(RESULT_SUCCESS); 127 rb.Push(RESULT_SUCCESS);
120
121 LOG_DEBUG(Service_Audio, "called. rendering_time_limit_percent={}",
122 rendering_time_limit_percent);
123 } 128 }
124 129
125 void GetRenderingTimeLimit(Kernel::HLERequestContext& ctx) { 130 void GetRenderingTimeLimit(Kernel::HLERequestContext& ctx) {
@@ -211,6 +216,7 @@ private:
211 216
212 void GetActiveChannelCount(Kernel::HLERequestContext& ctx) { 217 void GetActiveChannelCount(Kernel::HLERequestContext& ctx) {
213 LOG_WARNING(Service_Audio, "(STUBBED) called"); 218 LOG_WARNING(Service_Audio, "(STUBBED) called");
219
214 IPC::ResponseBuilder rb{ctx, 3}; 220 IPC::ResponseBuilder rb{ctx, 3};
215 rb.Push(RESULT_SUCCESS); 221 rb.Push(RESULT_SUCCESS);
216 rb.Push<u32>(1); 222 rb.Push<u32>(1);
@@ -235,19 +241,20 @@ AudRenU::AudRenU() : ServiceFramework("audren:u") {
235AudRenU::~AudRenU() = default; 241AudRenU::~AudRenU() = default;
236 242
237void AudRenU::OpenAudioRenderer(Kernel::HLERequestContext& ctx) { 243void AudRenU::OpenAudioRenderer(Kernel::HLERequestContext& ctx) {
244 LOG_DEBUG(Service_Audio, "called");
245
238 IPC::RequestParser rp{ctx}; 246 IPC::RequestParser rp{ctx};
239 auto params = rp.PopRaw<AudioCore::AudioRendererParameter>(); 247 auto params = rp.PopRaw<AudioCore::AudioRendererParameter>();
240 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 248 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
241 249
242 rb.Push(RESULT_SUCCESS); 250 rb.Push(RESULT_SUCCESS);
243 rb.PushIpcInterface<Audio::IAudioRenderer>(std::move(params)); 251 rb.PushIpcInterface<Audio::IAudioRenderer>(std::move(params));
244
245 LOG_DEBUG(Service_Audio, "called");
246} 252}
247 253
248void AudRenU::GetAudioRendererWorkBufferSize(Kernel::HLERequestContext& ctx) { 254void AudRenU::GetAudioRendererWorkBufferSize(Kernel::HLERequestContext& ctx) {
249 IPC::RequestParser rp{ctx}; 255 IPC::RequestParser rp{ctx};
250 auto params = rp.PopRaw<AudioCore::AudioRendererParameter>(); 256 auto params = rp.PopRaw<AudioCore::AudioRendererParameter>();
257 LOG_DEBUG(Service_Audio, "called");
251 258
252 u64 buffer_sz = Common::AlignUp(4 * params.mix_buffer_count, 0x40); 259 u64 buffer_sz = Common::AlignUp(4 * params.mix_buffer_count, 0x40);
253 buffer_sz += params.unknown_c * 1024; 260 buffer_sz += params.unknown_c * 1024;
@@ -301,26 +308,26 @@ void AudRenU::GetAudioRendererWorkBufferSize(Kernel::HLERequestContext& ctx) {
301 rb.Push(RESULT_SUCCESS); 308 rb.Push(RESULT_SUCCESS);
302 rb.Push<u64>(output_sz); 309 rb.Push<u64>(output_sz);
303 310
304 LOG_DEBUG(Service_Audio, "called, buffer_size=0x{:X}", output_sz); 311 LOG_DEBUG(Service_Audio, "buffer_size=0x{:X}", output_sz);
305} 312}
306 313
307void AudRenU::GetAudioDevice(Kernel::HLERequestContext& ctx) { 314void AudRenU::GetAudioDevice(Kernel::HLERequestContext& ctx) {
315 LOG_DEBUG(Service_Audio, "called");
316
308 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 317 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
309 318
310 rb.Push(RESULT_SUCCESS); 319 rb.Push(RESULT_SUCCESS);
311 rb.PushIpcInterface<Audio::IAudioDevice>(); 320 rb.PushIpcInterface<Audio::IAudioDevice>();
312
313 LOG_DEBUG(Service_Audio, "called");
314} 321}
315 322
316void AudRenU::GetAudioDeviceServiceWithRevisionInfo(Kernel::HLERequestContext& ctx) { 323void AudRenU::GetAudioDeviceServiceWithRevisionInfo(Kernel::HLERequestContext& ctx) {
324 LOG_WARNING(Service_Audio, "(STUBBED) called");
325
317 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 326 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
318 327
319 rb.Push(RESULT_SUCCESS); 328 rb.Push(RESULT_SUCCESS);
320 rb.PushIpcInterface<Audio::IAudioDevice>(); 329 rb.PushIpcInterface<Audio::IAudioDevice>(); // TODO(ogniK): Figure out what is different
321 330 // based on the current revision
322 LOG_WARNING(Service_Audio, "(STUBBED) called"); // TODO(ogniK): Figure out what is different
323 // based on the current revision
324} 331}
325 332
326bool AudRenU::IsFeatureSupported(AudioFeatures feature, u32_le revision) const { 333bool AudRenU::IsFeatureSupported(AudioFeatures feature, u32_le revision) const {
diff --git a/src/core/hle/service/audio/hwopus.cpp b/src/core/hle/service/audio/hwopus.cpp
index 763e619a4..832159394 100644
--- a/src/core/hle/service/audio/hwopus.cpp
+++ b/src/core/hle/service/audio/hwopus.cpp
@@ -46,10 +46,13 @@ public:
46 46
47private: 47private:
48 void DecodeInterleaved(Kernel::HLERequestContext& ctx) { 48 void DecodeInterleaved(Kernel::HLERequestContext& ctx) {
49 LOG_DEBUG(Audio, "called");
50
49 u32 consumed = 0; 51 u32 consumed = 0;
50 u32 sample_count = 0; 52 u32 sample_count = 0;
51 std::vector<opus_int16> samples(ctx.GetWriteBufferSize() / sizeof(opus_int16)); 53 std::vector<opus_int16> samples(ctx.GetWriteBufferSize() / sizeof(opus_int16));
52 if (!Decoder_DecodeInterleaved(consumed, sample_count, ctx.ReadBuffer(), samples)) { 54 if (!Decoder_DecodeInterleaved(consumed, sample_count, ctx.ReadBuffer(), samples)) {
55 LOG_ERROR(Audio, "Failed to decode opus data");
53 IPC::ResponseBuilder rb{ctx, 2}; 56 IPC::ResponseBuilder rb{ctx, 2};
54 // TODO(ogniK): Use correct error code 57 // TODO(ogniK): Use correct error code
55 rb.Push(ResultCode(-1)); 58 rb.Push(ResultCode(-1));
@@ -63,12 +66,15 @@ private:
63 } 66 }
64 67
65 void DecodeInterleavedWithPerformance(Kernel::HLERequestContext& ctx) { 68 void DecodeInterleavedWithPerformance(Kernel::HLERequestContext& ctx) {
69 LOG_DEBUG(Audio, "called");
70
66 u32 consumed = 0; 71 u32 consumed = 0;
67 u32 sample_count = 0; 72 u32 sample_count = 0;
68 u64 performance = 0; 73 u64 performance = 0;
69 std::vector<opus_int16> samples(ctx.GetWriteBufferSize() / sizeof(opus_int16)); 74 std::vector<opus_int16> samples(ctx.GetWriteBufferSize() / sizeof(opus_int16));
70 if (!Decoder_DecodeInterleaved(consumed, sample_count, ctx.ReadBuffer(), samples, 75 if (!Decoder_DecodeInterleaved(consumed, sample_count, ctx.ReadBuffer(), samples,
71 performance)) { 76 performance)) {
77 LOG_ERROR(Audio, "Failed to decode opus data");
72 IPC::ResponseBuilder rb{ctx, 2}; 78 IPC::ResponseBuilder rb{ctx, 2};
73 // TODO(ogniK): Use correct error code 79 // TODO(ogniK): Use correct error code
74 rb.Push(ResultCode(-1)); 80 rb.Push(ResultCode(-1));
@@ -88,24 +94,31 @@ private:
88 std::optional<std::reference_wrapper<u64>> performance_time = std::nullopt) { 94 std::optional<std::reference_wrapper<u64>> performance_time = std::nullopt) {
89 const auto start_time = std::chrono::high_resolution_clock::now(); 95 const auto start_time = std::chrono::high_resolution_clock::now();
90 std::size_t raw_output_sz = output.size() * sizeof(opus_int16); 96 std::size_t raw_output_sz = output.size() * sizeof(opus_int16);
91 if (sizeof(OpusHeader) > input.size()) 97 if (sizeof(OpusHeader) > input.size()) {
98 LOG_ERROR(Audio, "Input is smaller than the header size");
92 return false; 99 return false;
100 }
93 OpusHeader hdr{}; 101 OpusHeader hdr{};
94 std::memcpy(&hdr, input.data(), sizeof(OpusHeader)); 102 std::memcpy(&hdr, input.data(), sizeof(OpusHeader));
95 if (sizeof(OpusHeader) + static_cast<u32>(hdr.sz) > input.size()) { 103 if (sizeof(OpusHeader) + static_cast<u32>(hdr.sz) > input.size()) {
104 LOG_ERROR(Audio, "Input does not fit in the opus header size");
96 return false; 105 return false;
97 } 106 }
98 auto frame = input.data() + sizeof(OpusHeader); 107 auto frame = input.data() + sizeof(OpusHeader);
99 auto decoded_sample_count = opus_packet_get_nb_samples( 108 auto decoded_sample_count = opus_packet_get_nb_samples(
100 frame, static_cast<opus_int32>(input.size() - sizeof(OpusHeader)), 109 frame, static_cast<opus_int32>(input.size() - sizeof(OpusHeader)),
101 static_cast<opus_int32>(sample_rate)); 110 static_cast<opus_int32>(sample_rate));
102 if (decoded_sample_count * channel_count * sizeof(u16) > raw_output_sz) 111 if (decoded_sample_count * channel_count * sizeof(u16) > raw_output_sz) {
112 LOG_ERROR(Audio, "Decoded data does not fit into the output data");
103 return false; 113 return false;
114 }
104 auto out_sample_count = 115 auto out_sample_count =
105 opus_decode(decoder.get(), frame, hdr.sz, output.data(), 116 opus_decode(decoder.get(), frame, hdr.sz, output.data(),
106 (static_cast<int>(raw_output_sz / sizeof(s16) / channel_count)), 0); 117 (static_cast<int>(raw_output_sz / sizeof(s16) / channel_count)), 0);
107 if (out_sample_count < 0) 118 if (out_sample_count < 0) {
119 LOG_ERROR(Audio, "Incorrect sample count received from opus_decode");
108 return false; 120 return false;
121 }
109 const auto end_time = std::chrono::high_resolution_clock::now() - start_time; 122 const auto end_time = std::chrono::high_resolution_clock::now() - start_time;
110 sample_count = out_sample_count; 123 sample_count = out_sample_count;
111 consumed = static_cast<u32>(sizeof(OpusHeader) + hdr.sz); 124 consumed = static_cast<u32>(sizeof(OpusHeader) + hdr.sz);
@@ -134,14 +147,17 @@ static std::size_t WorkerBufferSize(u32 channel_count) {
134 147
135void HwOpus::GetWorkBufferSize(Kernel::HLERequestContext& ctx) { 148void HwOpus::GetWorkBufferSize(Kernel::HLERequestContext& ctx) {
136 IPC::RequestParser rp{ctx}; 149 IPC::RequestParser rp{ctx};
137 auto sample_rate = rp.Pop<u32>(); 150 const auto sample_rate = rp.Pop<u32>();
138 auto channel_count = rp.Pop<u32>(); 151 const auto channel_count = rp.Pop<u32>();
152 LOG_DEBUG(Audio, "called with sample_rate={}, channel_count={}", sample_rate, channel_count);
153
139 ASSERT_MSG(sample_rate == 48000 || sample_rate == 24000 || sample_rate == 16000 || 154 ASSERT_MSG(sample_rate == 48000 || sample_rate == 24000 || sample_rate == 16000 ||
140 sample_rate == 12000 || sample_rate == 8000, 155 sample_rate == 12000 || sample_rate == 8000,
141 "Invalid sample rate"); 156 "Invalid sample rate");
142 ASSERT_MSG(channel_count == 1 || channel_count == 2, "Invalid channel count"); 157 ASSERT_MSG(channel_count == 1 || channel_count == 2, "Invalid channel count");
143 u32 worker_buffer_sz = static_cast<u32>(WorkerBufferSize(channel_count)); 158
144 LOG_DEBUG(Audio, "called worker_buffer_sz={}", worker_buffer_sz); 159 const u32 worker_buffer_sz = static_cast<u32>(WorkerBufferSize(channel_count));
160 LOG_DEBUG(Audio, "worker_buffer_sz={}", worker_buffer_sz);
145 161
146 IPC::ResponseBuilder rb{ctx, 3}; 162 IPC::ResponseBuilder rb{ctx, 3};
147 rb.Push(RESULT_SUCCESS); 163 rb.Push(RESULT_SUCCESS);
@@ -155,6 +171,7 @@ void HwOpus::OpenOpusDecoder(Kernel::HLERequestContext& ctx) {
155 auto buffer_sz = rp.Pop<u32>(); 171 auto buffer_sz = rp.Pop<u32>();
156 LOG_DEBUG(Audio, "called sample_rate={}, channel_count={}, buffer_size={}", sample_rate, 172 LOG_DEBUG(Audio, "called sample_rate={}, channel_count={}, buffer_size={}", sample_rate,
157 channel_count, buffer_sz); 173 channel_count, buffer_sz);
174
158 ASSERT_MSG(sample_rate == 48000 || sample_rate == 24000 || sample_rate == 16000 || 175 ASSERT_MSG(sample_rate == 48000 || sample_rate == 24000 || sample_rate == 16000 ||
159 sample_rate == 12000 || sample_rate == 8000, 176 sample_rate == 12000 || sample_rate == 8000,
160 "Invalid sample rate"); 177 "Invalid sample rate");
@@ -165,6 +182,7 @@ void HwOpus::OpenOpusDecoder(Kernel::HLERequestContext& ctx) {
165 std::unique_ptr<OpusDecoder, OpusDeleter> decoder{ 182 std::unique_ptr<OpusDecoder, OpusDeleter> decoder{
166 static_cast<OpusDecoder*>(operator new(worker_sz))}; 183 static_cast<OpusDecoder*>(operator new(worker_sz))};
167 if (opus_decoder_init(decoder.get(), sample_rate, channel_count)) { 184 if (opus_decoder_init(decoder.get(), sample_rate, channel_count)) {
185 LOG_ERROR(Audio, "Failed to init opus decoder");
168 IPC::ResponseBuilder rb{ctx, 2}; 186 IPC::ResponseBuilder rb{ctx, 2};
169 // TODO(ogniK): Use correct error code 187 // TODO(ogniK): Use correct error code
170 rb.Push(ResultCode(-1)); 188 rb.Push(ResultCode(-1));
diff --git a/src/core/hle/service/bcat/module.cpp b/src/core/hle/service/bcat/module.cpp
index 6e7b795fb..b7bd738fc 100644
--- a/src/core/hle/service/bcat/module.cpp
+++ b/src/core/hle/service/bcat/module.cpp
@@ -33,10 +33,11 @@ public:
33}; 33};
34 34
35void Module::Interface::CreateBcatService(Kernel::HLERequestContext& ctx) { 35void Module::Interface::CreateBcatService(Kernel::HLERequestContext& ctx) {
36 LOG_DEBUG(Service_BCAT, "called");
37
36 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 38 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
37 rb.Push(RESULT_SUCCESS); 39 rb.Push(RESULT_SUCCESS);
38 rb.PushIpcInterface<IBcatService>(); 40 rb.PushIpcInterface<IBcatService>();
39 LOG_DEBUG(Service_BCAT, "called");
40} 41}
41 42
42Module::Interface::Interface(std::shared_ptr<Module> module, const char* name) 43Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
diff --git a/src/core/hle/service/btdrv/btdrv.cpp b/src/core/hle/service/btdrv/btdrv.cpp
index f3bde6d0d..2eadcdd05 100644
--- a/src/core/hle/service/btdrv/btdrv.cpp
+++ b/src/core/hle/service/btdrv/btdrv.cpp
@@ -34,13 +34,14 @@ public:
34 34
35private: 35private:
36 void RegisterEvent(Kernel::HLERequestContext& ctx) { 36 void RegisterEvent(Kernel::HLERequestContext& ctx) {
37 LOG_WARNING(Service_BTM, "(STUBBED) called");
38
37 auto& kernel = Core::System::GetInstance().Kernel(); 39 auto& kernel = Core::System::GetInstance().Kernel();
38 register_event = 40 register_event =
39 Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, "BT:RegisterEvent"); 41 Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, "BT:RegisterEvent");
40 IPC::ResponseBuilder rb{ctx, 2, 1}; 42 IPC::ResponseBuilder rb{ctx, 2, 1};
41 rb.Push(RESULT_SUCCESS); 43 rb.Push(RESULT_SUCCESS);
42 rb.PushCopyObjects(register_event); 44 rb.PushCopyObjects(register_event);
43 LOG_WARNING(Service_BTM, "(STUBBED) called");
44 } 45 }
45 Kernel::SharedPtr<Kernel::Event> register_event; 46 Kernel::SharedPtr<Kernel::Event> register_event;
46}; 47};
diff --git a/src/core/hle/service/btm/btm.cpp b/src/core/hle/service/btm/btm.cpp
index a02f6b53a..463a79351 100644
--- a/src/core/hle/service/btm/btm.cpp
+++ b/src/core/hle/service/btm/btm.cpp
@@ -57,40 +57,44 @@ public:
57 57
58private: 58private:
59 void GetScanEvent(Kernel::HLERequestContext& ctx) { 59 void GetScanEvent(Kernel::HLERequestContext& ctx) {
60 LOG_WARNING(Service_BTM, "(STUBBED) called");
61
60 auto& kernel = Core::System::GetInstance().Kernel(); 62 auto& kernel = Core::System::GetInstance().Kernel();
61 scan_event = 63 scan_event =
62 Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, "IBtmUserCore:ScanEvent"); 64 Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, "IBtmUserCore:ScanEvent");
63 IPC::ResponseBuilder rb{ctx, 2, 1}; 65 IPC::ResponseBuilder rb{ctx, 2, 1};
64 rb.Push(RESULT_SUCCESS); 66 rb.Push(RESULT_SUCCESS);
65 rb.PushCopyObjects(scan_event); 67 rb.PushCopyObjects(scan_event);
66 LOG_WARNING(Service_BTM, "(STUBBED) called");
67 } 68 }
68 void GetConnectionEvent(Kernel::HLERequestContext& ctx) { 69 void GetConnectionEvent(Kernel::HLERequestContext& ctx) {
70 LOG_WARNING(Service_BTM, "(STUBBED) called");
71
69 auto& kernel = Core::System::GetInstance().Kernel(); 72 auto& kernel = Core::System::GetInstance().Kernel();
70 connection_event = Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, 73 connection_event = Kernel::Event::Create(kernel, Kernel::ResetType::OneShot,
71 "IBtmUserCore:ConnectionEvent"); 74 "IBtmUserCore:ConnectionEvent");
72 IPC::ResponseBuilder rb{ctx, 2, 1}; 75 IPC::ResponseBuilder rb{ctx, 2, 1};
73 rb.Push(RESULT_SUCCESS); 76 rb.Push(RESULT_SUCCESS);
74 rb.PushCopyObjects(connection_event); 77 rb.PushCopyObjects(connection_event);
75 LOG_WARNING(Service_BTM, "(STUBBED) called");
76 } 78 }
77 void GetDiscoveryEvent(Kernel::HLERequestContext& ctx) { 79 void GetDiscoveryEvent(Kernel::HLERequestContext& ctx) {
80 LOG_WARNING(Service_BTM, "(STUBBED) called");
81
78 auto& kernel = Core::System::GetInstance().Kernel(); 82 auto& kernel = Core::System::GetInstance().Kernel();
79 service_discovery = 83 service_discovery =
80 Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, "IBtmUserCore:Discovery"); 84 Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, "IBtmUserCore:Discovery");
81 IPC::ResponseBuilder rb{ctx, 2, 1}; 85 IPC::ResponseBuilder rb{ctx, 2, 1};
82 rb.Push(RESULT_SUCCESS); 86 rb.Push(RESULT_SUCCESS);
83 rb.PushCopyObjects(service_discovery); 87 rb.PushCopyObjects(service_discovery);
84 LOG_WARNING(Service_BTM, "(STUBBED) called");
85 } 88 }
86 void GetConfigEvent(Kernel::HLERequestContext& ctx) { 89 void GetConfigEvent(Kernel::HLERequestContext& ctx) {
90 LOG_WARNING(Service_BTM, "(STUBBED) called");
91
87 auto& kernel = Core::System::GetInstance().Kernel(); 92 auto& kernel = Core::System::GetInstance().Kernel();
88 config_event = 93 config_event =
89 Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, "IBtmUserCore:ConfigEvent"); 94 Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, "IBtmUserCore:ConfigEvent");
90 IPC::ResponseBuilder rb{ctx, 2, 1}; 95 IPC::ResponseBuilder rb{ctx, 2, 1};
91 rb.Push(RESULT_SUCCESS); 96 rb.Push(RESULT_SUCCESS);
92 rb.PushCopyObjects(config_event); 97 rb.PushCopyObjects(config_event);
93 LOG_WARNING(Service_BTM, "(STUBBED) called");
94 } 98 }
95 Kernel::SharedPtr<Kernel::Event> scan_event; 99 Kernel::SharedPtr<Kernel::Event> scan_event;
96 Kernel::SharedPtr<Kernel::Event> connection_event; 100 Kernel::SharedPtr<Kernel::Event> connection_event;
@@ -111,10 +115,11 @@ public:
111 115
112private: 116private:
113 void GetCoreImpl(Kernel::HLERequestContext& ctx) { 117 void GetCoreImpl(Kernel::HLERequestContext& ctx) {
118 LOG_DEBUG(Service_BTM, "called");
119
114 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 120 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
115 rb.Push(RESULT_SUCCESS); 121 rb.Push(RESULT_SUCCESS);
116 rb.PushIpcInterface<IBtmUserCore>(); 122 rb.PushIpcInterface<IBtmUserCore>();
117 LOG_DEBUG(Service_BTM, "called");
118 } 123 }
119}; 124};
120 125
@@ -209,11 +214,11 @@ public:
209 214
210private: 215private:
211 void GetCoreImpl(Kernel::HLERequestContext& ctx) { 216 void GetCoreImpl(Kernel::HLERequestContext& ctx) {
217 LOG_DEBUG(Service_BTM, "called");
218
212 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 219 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
213 rb.Push(RESULT_SUCCESS); 220 rb.Push(RESULT_SUCCESS);
214 rb.PushIpcInterface<IBtmSystemCore>(); 221 rb.PushIpcInterface<IBtmSystemCore>();
215
216 LOG_DEBUG(Service_BTM, "called");
217 } 222 }
218}; 223};
219 224
diff --git a/src/core/hle/service/fgm/fgm.cpp b/src/core/hle/service/fgm/fgm.cpp
index 566fbf924..e461274c1 100644
--- a/src/core/hle/service/fgm/fgm.cpp
+++ b/src/core/hle/service/fgm/fgm.cpp
@@ -42,11 +42,11 @@ public:
42 42
43private: 43private:
44 void Initialize(Kernel::HLERequestContext& ctx) { 44 void Initialize(Kernel::HLERequestContext& ctx) {
45 LOG_DEBUG(Service_FGM, "called");
46
45 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 47 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
46 rb.Push(RESULT_SUCCESS); 48 rb.Push(RESULT_SUCCESS);
47 rb.PushIpcInterface<IRequest>(); 49 rb.PushIpcInterface<IRequest>();
48
49 LOG_DEBUG(Service_FGM, "called");
50 } 50 }
51}; 51};
52 52
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp
index 038dc80b1..233cb302f 100644
--- a/src/core/hle/service/filesystem/fsp_srv.cpp
+++ b/src/core/hle/service/filesystem/fsp_srv.cpp
@@ -62,11 +62,13 @@ private:
62 62
63 // Error checking 63 // Error checking
64 if (length < 0) { 64 if (length < 0) {
65 LOG_ERROR(Service_FS, "Invalid length provided");
65 IPC::ResponseBuilder rb{ctx, 2}; 66 IPC::ResponseBuilder rb{ctx, 2};
66 rb.Push(FileSys::ERROR_INVALID_SIZE); 67 rb.Push(FileSys::ERROR_INVALID_SIZE);
67 return; 68 return;
68 } 69 }
69 if (offset < 0) { 70 if (offset < 0) {
71 LOG_ERROR(Service_FS, "Invalid offset provided");
70 IPC::ResponseBuilder rb{ctx, 2}; 72 IPC::ResponseBuilder rb{ctx, 2};
71 rb.Push(FileSys::ERROR_INVALID_OFFSET); 73 rb.Push(FileSys::ERROR_INVALID_OFFSET);
72 return; 74 return;
@@ -107,11 +109,13 @@ private:
107 109
108 // Error checking 110 // Error checking
109 if (length < 0) { 111 if (length < 0) {
112 LOG_ERROR(Service_FS, "Invalid length provided");
110 IPC::ResponseBuilder rb{ctx, 2}; 113 IPC::ResponseBuilder rb{ctx, 2};
111 rb.Push(FileSys::ERROR_INVALID_SIZE); 114 rb.Push(FileSys::ERROR_INVALID_SIZE);
112 return; 115 return;
113 } 116 }
114 if (offset < 0) { 117 if (offset < 0) {
118 LOG_ERROR(Service_FS, "Invalid offset provided");
115 IPC::ResponseBuilder rb{ctx, 2}; 119 IPC::ResponseBuilder rb{ctx, 2};
116 rb.Push(FileSys::ERROR_INVALID_OFFSET); 120 rb.Push(FileSys::ERROR_INVALID_OFFSET);
117 return; 121 return;
@@ -138,11 +142,13 @@ private:
138 142
139 // Error checking 143 // Error checking
140 if (length < 0) { 144 if (length < 0) {
145 LOG_ERROR(Service_FS, "Invalid length provided");
141 IPC::ResponseBuilder rb{ctx, 2}; 146 IPC::ResponseBuilder rb{ctx, 2};
142 rb.Push(FileSys::ERROR_INVALID_SIZE); 147 rb.Push(FileSys::ERROR_INVALID_SIZE);
143 return; 148 return;
144 } 149 }
145 if (offset < 0) { 150 if (offset < 0) {
151 LOG_ERROR(Service_FS, "Invalid offset provided");
146 IPC::ResponseBuilder rb{ctx, 2}; 152 IPC::ResponseBuilder rb{ctx, 2};
147 rb.Push(FileSys::ERROR_INVALID_OFFSET); 153 rb.Push(FileSys::ERROR_INVALID_OFFSET);
148 return; 154 return;
@@ -180,9 +186,10 @@ private:
180 void SetSize(Kernel::HLERequestContext& ctx) { 186 void SetSize(Kernel::HLERequestContext& ctx) {
181 IPC::RequestParser rp{ctx}; 187 IPC::RequestParser rp{ctx};
182 const u64 size = rp.Pop<u64>(); 188 const u64 size = rp.Pop<u64>();
183 backend->Resize(size);
184 LOG_DEBUG(Service_FS, "called, size={}", size); 189 LOG_DEBUG(Service_FS, "called, size={}", size);
185 190
191 backend->Resize(size);
192
186 IPC::ResponseBuilder rb{ctx, 2}; 193 IPC::ResponseBuilder rb{ctx, 2};
187 rb.Push(RESULT_SUCCESS); 194 rb.Push(RESULT_SUCCESS);
188 } 195 }
@@ -465,6 +472,8 @@ public:
465 } 472 }
466 473
467 void ReadSaveDataInfo(Kernel::HLERequestContext& ctx) { 474 void ReadSaveDataInfo(Kernel::HLERequestContext& ctx) {
475 LOG_DEBUG(Service_FS, "called");
476
468 // Calculate how many entries we can fit in the output buffer 477 // Calculate how many entries we can fit in the output buffer
469 const u64 count_entries = ctx.GetWriteBufferSize() / sizeof(SaveDataInfo); 478 const u64 count_entries = ctx.GetWriteBufferSize() / sizeof(SaveDataInfo);
470 479
@@ -703,6 +712,8 @@ void FSP_SRV::OpenFileSystemWithPatch(Kernel::HLERequestContext& ctx) {
703 712
704 const auto type = rp.PopRaw<FileSystemType>(); 713 const auto type = rp.PopRaw<FileSystemType>();
705 const auto title_id = rp.PopRaw<u64>(); 714 const auto title_id = rp.PopRaw<u64>();
715 LOG_WARNING(Service_FS, "(STUBBED) called with type={}, title_id={:016X}",
716 static_cast<u8>(type), title_id);
706 717
707 IPC::ResponseBuilder rb{ctx, 2, 0, 0}; 718 IPC::ResponseBuilder rb{ctx, 2, 0, 0};
708 rb.Push(ResultCode(-1)); 719 rb.Push(ResultCode(-1));
@@ -738,6 +749,7 @@ void FSP_SRV::MountSaveData(Kernel::HLERequestContext& ctx) {
738 auto space_id = rp.PopRaw<FileSys::SaveDataSpaceId>(); 749 auto space_id = rp.PopRaw<FileSys::SaveDataSpaceId>();
739 auto unk = rp.Pop<u32>(); 750 auto unk = rp.Pop<u32>();
740 LOG_INFO(Service_FS, "called with unknown={:08X}", unk); 751 LOG_INFO(Service_FS, "called with unknown={:08X}", unk);
752
741 auto save_struct = rp.PopRaw<FileSys::SaveDataDescriptor>(); 753 auto save_struct = rp.PopRaw<FileSys::SaveDataDescriptor>();
742 754
743 auto dir = OpenSaveData(space_id, save_struct); 755 auto dir = OpenSaveData(space_id, save_struct);
@@ -763,6 +775,7 @@ void FSP_SRV::OpenReadOnlySaveDataFileSystem(Kernel::HLERequestContext& ctx) {
763void FSP_SRV::OpenSaveDataInfoReaderBySaveDataSpaceId(Kernel::HLERequestContext& ctx) { 775void FSP_SRV::OpenSaveDataInfoReaderBySaveDataSpaceId(Kernel::HLERequestContext& ctx) {
764 IPC::RequestParser rp{ctx}; 776 IPC::RequestParser rp{ctx};
765 const auto space = rp.PopRaw<FileSys::SaveDataSpaceId>(); 777 const auto space = rp.PopRaw<FileSys::SaveDataSpaceId>();
778 LOG_INFO(Service_FS, "called, space={}", static_cast<u8>(space));
766 779
767 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 780 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
768 rb.Push(RESULT_SUCCESS); 781 rb.Push(RESULT_SUCCESS);
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index 46604887c..3b624a162 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -524,6 +524,8 @@ void Controller_NPad::SetNpadMode(u32 npad_id, NPadAssignments assignment_mode)
524 524
525void Controller_NPad::VibrateController(const std::vector<u32>& controller_ids, 525void Controller_NPad::VibrateController(const std::vector<u32>& controller_ids,
526 const std::vector<Vibration>& vibrations) { 526 const std::vector<Vibration>& vibrations) {
527 LOG_WARNING(Service_HID, "(STUBBED) called");
528
527 if (!can_controllers_vibrate) { 529 if (!can_controllers_vibrate) {
528 return; 530 return;
529 } 531 }
@@ -533,7 +535,6 @@ void Controller_NPad::VibrateController(const std::vector<u32>& controller_ids,
533 // TODO(ogniK): Vibrate the physical controller 535 // TODO(ogniK): Vibrate the physical controller
534 } 536 }
535 } 537 }
536 LOG_WARNING(Service_HID, "(STUBBED) called");
537 last_processed_vibration = vibrations.back(); 538 last_processed_vibration = vibrations.back();
538} 539}
539 540
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index 7c0dac5dc..46496e9bb 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -124,10 +124,11 @@ public:
124 124
125private: 125private:
126 void GetSharedMemoryHandle(Kernel::HLERequestContext& ctx) { 126 void GetSharedMemoryHandle(Kernel::HLERequestContext& ctx) {
127 LOG_DEBUG(Service_HID, "called");
128
127 IPC::ResponseBuilder rb{ctx, 2, 1}; 129 IPC::ResponseBuilder rb{ctx, 2, 1};
128 rb.Push(RESULT_SUCCESS); 130 rb.Push(RESULT_SUCCESS);
129 rb.PushCopyObjects(shared_mem); 131 rb.PushCopyObjects(shared_mem);
130 LOG_DEBUG(Service_HID, "called");
131 } 132 }
132 133
133 void UpdateControllers(u64 userdata, int cycles_late) { 134 void UpdateControllers(u64 userdata, int cycles_late) {
@@ -163,9 +164,10 @@ public:
163 164
164private: 165private:
165 void ActivateVibrationDevice(Kernel::HLERequestContext& ctx) { 166 void ActivateVibrationDevice(Kernel::HLERequestContext& ctx) {
167 LOG_WARNING(Service_HID, "(STUBBED) called");
168
166 IPC::ResponseBuilder rb{ctx, 2}; 169 IPC::ResponseBuilder rb{ctx, 2};
167 rb.Push(RESULT_SUCCESS); 170 rb.Push(RESULT_SUCCESS);
168 LOG_WARNING(Service_HID, "(STUBBED) called");
169 } 171 }
170}; 172};
171 173
@@ -303,6 +305,8 @@ private:
303 std::shared_ptr<IAppletResource> applet_resource; 305 std::shared_ptr<IAppletResource> applet_resource;
304 306
305 void CreateAppletResource(Kernel::HLERequestContext& ctx) { 307 void CreateAppletResource(Kernel::HLERequestContext& ctx) {
308 LOG_DEBUG(Service_HID, "called");
309
306 if (applet_resource == nullptr) { 310 if (applet_resource == nullptr) {
307 applet_resource = std::make_shared<IAppletResource>(); 311 applet_resource = std::make_shared<IAppletResource>();
308 } 312 }
@@ -310,206 +314,228 @@ private:
310 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 314 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
311 rb.Push(RESULT_SUCCESS); 315 rb.Push(RESULT_SUCCESS);
312 rb.PushIpcInterface<IAppletResource>(applet_resource); 316 rb.PushIpcInterface<IAppletResource>(applet_resource);
313 LOG_DEBUG(Service_HID, "called");
314 } 317 }
315 318
316 void ActivateXpad(Kernel::HLERequestContext& ctx) { 319 void ActivateXpad(Kernel::HLERequestContext& ctx) {
320 LOG_DEBUG(Service_HID, "called");
321
317 applet_resource->ActivateController(HidController::XPad); 322 applet_resource->ActivateController(HidController::XPad);
318 IPC::ResponseBuilder rb{ctx, 2}; 323 IPC::ResponseBuilder rb{ctx, 2};
319 rb.Push(RESULT_SUCCESS); 324 rb.Push(RESULT_SUCCESS);
320 LOG_DEBUG(Service_HID, "called");
321 } 325 }
322 326
323 void ActivateDebugPad(Kernel::HLERequestContext& ctx) { 327 void ActivateDebugPad(Kernel::HLERequestContext& ctx) {
328 LOG_DEBUG(Service_HID, "called");
329
324 applet_resource->ActivateController(HidController::DebugPad); 330 applet_resource->ActivateController(HidController::DebugPad);
325 IPC::ResponseBuilder rb{ctx, 2}; 331 IPC::ResponseBuilder rb{ctx, 2};
326 rb.Push(RESULT_SUCCESS); 332 rb.Push(RESULT_SUCCESS);
327 LOG_DEBUG(Service_HID, "called");
328 } 333 }
329 334
330 void ActivateTouchScreen(Kernel::HLERequestContext& ctx) { 335 void ActivateTouchScreen(Kernel::HLERequestContext& ctx) {
336 LOG_DEBUG(Service_HID, "called");
337
331 applet_resource->ActivateController(HidController::Touchscreen); 338 applet_resource->ActivateController(HidController::Touchscreen);
332 IPC::ResponseBuilder rb{ctx, 2}; 339 IPC::ResponseBuilder rb{ctx, 2};
333 rb.Push(RESULT_SUCCESS); 340 rb.Push(RESULT_SUCCESS);
334 LOG_DEBUG(Service_HID, "called");
335 } 341 }
336 342
337 void ActivateMouse(Kernel::HLERequestContext& ctx) { 343 void ActivateMouse(Kernel::HLERequestContext& ctx) {
344 LOG_DEBUG(Service_HID, "called");
345
338 applet_resource->ActivateController(HidController::Mouse); 346 applet_resource->ActivateController(HidController::Mouse);
339 IPC::ResponseBuilder rb{ctx, 2}; 347 IPC::ResponseBuilder rb{ctx, 2};
340 rb.Push(RESULT_SUCCESS); 348 rb.Push(RESULT_SUCCESS);
341 LOG_DEBUG(Service_HID, "called");
342 } 349 }
343 350
344 void ActivateKeyboard(Kernel::HLERequestContext& ctx) { 351 void ActivateKeyboard(Kernel::HLERequestContext& ctx) {
352 LOG_DEBUG(Service_HID, "called");
353
345 applet_resource->ActivateController(HidController::Keyboard); 354 applet_resource->ActivateController(HidController::Keyboard);
346 IPC::ResponseBuilder rb{ctx, 2}; 355 IPC::ResponseBuilder rb{ctx, 2};
347 rb.Push(RESULT_SUCCESS); 356 rb.Push(RESULT_SUCCESS);
348 LOG_DEBUG(Service_HID, "called");
349 } 357 }
350 358
351 void ActivateGesture(Kernel::HLERequestContext& ctx) { 359 void ActivateGesture(Kernel::HLERequestContext& ctx) {
360 LOG_DEBUG(Service_HID, "called");
361
352 applet_resource->ActivateController(HidController::Gesture); 362 applet_resource->ActivateController(HidController::Gesture);
353 IPC::ResponseBuilder rb{ctx, 2}; 363 IPC::ResponseBuilder rb{ctx, 2};
354 rb.Push(RESULT_SUCCESS); 364 rb.Push(RESULT_SUCCESS);
355 LOG_DEBUG(Service_HID, "called");
356 } 365 }
357 366
358 void ActivateNpadWithRevision(Kernel::HLERequestContext& ctx) { 367 void ActivateNpadWithRevision(Kernel::HLERequestContext& ctx) {
359 // Should have no effect with how our npad sets up the data 368 // Should have no effect with how our npad sets up the data
369 LOG_DEBUG(Service_HID, "called");
370
360 applet_resource->ActivateController(HidController::NPad); 371 applet_resource->ActivateController(HidController::NPad);
361 IPC::ResponseBuilder rb{ctx, 2}; 372 IPC::ResponseBuilder rb{ctx, 2};
362 rb.Push(RESULT_SUCCESS); 373 rb.Push(RESULT_SUCCESS);
363 LOG_DEBUG(Service_HID, "called");
364 } 374 }
365 375
366 void StartSixAxisSensor(Kernel::HLERequestContext& ctx) { 376 void StartSixAxisSensor(Kernel::HLERequestContext& ctx) {
367 IPC::RequestParser rp{ctx}; 377 IPC::RequestParser rp{ctx};
368 auto handle = rp.PopRaw<u32>(); 378 auto handle = rp.PopRaw<u32>();
379 LOG_WARNING(Service_HID, "(STUBBED) called with handle={}", handle);
380
369 IPC::ResponseBuilder rb{ctx, 2}; 381 IPC::ResponseBuilder rb{ctx, 2};
370 rb.Push(RESULT_SUCCESS); 382 rb.Push(RESULT_SUCCESS);
371 LOG_WARNING(Service_HID, "(STUBBED) called");
372 } 383 }
373 384
374 void SetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) { 385 void SetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
386 LOG_WARNING(Service_HID, "(STUBBED) called");
387
375 IPC::ResponseBuilder rb{ctx, 2}; 388 IPC::ResponseBuilder rb{ctx, 2};
376 rb.Push(RESULT_SUCCESS); 389 rb.Push(RESULT_SUCCESS);
377 LOG_WARNING(Service_HID, "(STUBBED) called");
378 } 390 }
379 391
380 void IsSixAxisSensorAtRest(Kernel::HLERequestContext& ctx) { 392 void IsSixAxisSensorAtRest(Kernel::HLERequestContext& ctx) {
393 LOG_WARNING(Service_HID, "(STUBBED) called");
394
381 IPC::ResponseBuilder rb{ctx, 3}; 395 IPC::ResponseBuilder rb{ctx, 3};
382 rb.Push(RESULT_SUCCESS); 396 rb.Push(RESULT_SUCCESS);
383 // TODO (Hexagon12): Properly implement reading gyroscope values from controllers. 397 // TODO (Hexagon12): Properly implement reading gyroscope values from controllers.
384 rb.Push(true); 398 rb.Push(true);
385 LOG_WARNING(Service_HID, "(STUBBED) called");
386 } 399 }
387 400
388 void SetSupportedNpadStyleSet(Kernel::HLERequestContext& ctx) { 401 void SetSupportedNpadStyleSet(Kernel::HLERequestContext& ctx) {
389 IPC::RequestParser rp{ctx}; 402 IPC::RequestParser rp{ctx};
390 auto supported_styleset = rp.PopRaw<u32>(); 403 auto supported_styleset = rp.PopRaw<u32>();
404 LOG_DEBUG(Service_HID, "called with supported_styleset={}", supported_styleset);
405
391 applet_resource->GetController<Controller_NPad>(HidController::NPad) 406 applet_resource->GetController<Controller_NPad>(HidController::NPad)
392 .SetSupportedStyleSet({supported_styleset}); 407 .SetSupportedStyleSet({supported_styleset});
393 408
394 IPC::ResponseBuilder rb{ctx, 2}; 409 IPC::ResponseBuilder rb{ctx, 2};
395 rb.Push(RESULT_SUCCESS); 410 rb.Push(RESULT_SUCCESS);
396
397 LOG_DEBUG(Service_HID, "called");
398 } 411 }
399 412
400 void GetSupportedNpadStyleSet(Kernel::HLERequestContext& ctx) { 413 void GetSupportedNpadStyleSet(Kernel::HLERequestContext& ctx) {
414 LOG_DEBUG(Service_HID, "called");
415
401 auto& controller = applet_resource->GetController<Controller_NPad>(HidController::NPad); 416 auto& controller = applet_resource->GetController<Controller_NPad>(HidController::NPad);
402 417
403 IPC::ResponseBuilder rb{ctx, 3}; 418 IPC::ResponseBuilder rb{ctx, 3};
404 rb.Push(RESULT_SUCCESS); 419 rb.Push(RESULT_SUCCESS);
405 rb.Push<u32>(controller.GetSupportedStyleSet().raw); 420 rb.Push<u32>(controller.GetSupportedStyleSet().raw);
406 LOG_DEBUG(Service_HID, "called");
407 } 421 }
408 422
409 void SetSupportedNpadIdType(Kernel::HLERequestContext& ctx) { 423 void SetSupportedNpadIdType(Kernel::HLERequestContext& ctx) {
424 LOG_DEBUG(Service_HID, "called");
425
410 applet_resource->GetController<Controller_NPad>(HidController::NPad) 426 applet_resource->GetController<Controller_NPad>(HidController::NPad)
411 .SetSupportedNPadIdTypes(ctx.ReadBuffer().data(), ctx.GetReadBufferSize()); 427 .SetSupportedNPadIdTypes(ctx.ReadBuffer().data(), ctx.GetReadBufferSize());
412 IPC::ResponseBuilder rb{ctx, 2}; 428 IPC::ResponseBuilder rb{ctx, 2};
413 rb.Push(RESULT_SUCCESS); 429 rb.Push(RESULT_SUCCESS);
414 LOG_DEBUG(Service_HID, "called");
415 } 430 }
416 431
417 void ActivateNpad(Kernel::HLERequestContext& ctx) { 432 void ActivateNpad(Kernel::HLERequestContext& ctx) {
433 LOG_DEBUG(Service_HID, "called");
434
418 IPC::ResponseBuilder rb{ctx, 2}; 435 IPC::ResponseBuilder rb{ctx, 2};
419 rb.Push(RESULT_SUCCESS); 436 rb.Push(RESULT_SUCCESS);
420 applet_resource->ActivateController(HidController::NPad); 437 applet_resource->ActivateController(HidController::NPad);
421 LOG_DEBUG(Service_HID, "called");
422 } 438 }
423 439
424 void AcquireNpadStyleSetUpdateEventHandle(Kernel::HLERequestContext& ctx) { 440 void AcquireNpadStyleSetUpdateEventHandle(Kernel::HLERequestContext& ctx) {
425 IPC::RequestParser rp{ctx}; 441 IPC::RequestParser rp{ctx};
426 auto npad_id = rp.PopRaw<u32>(); 442 auto npad_id = rp.PopRaw<u32>();
443 LOG_DEBUG(Service_HID, "called with npad_id={}", npad_id);
444
427 IPC::ResponseBuilder rb{ctx, 2, 1}; 445 IPC::ResponseBuilder rb{ctx, 2, 1};
428 rb.Push(RESULT_SUCCESS); 446 rb.Push(RESULT_SUCCESS);
429 rb.PushCopyObjects(applet_resource->GetController<Controller_NPad>(HidController::NPad) 447 rb.PushCopyObjects(applet_resource->GetController<Controller_NPad>(HidController::NPad)
430 .GetStyleSetChangedEvent()); 448 .GetStyleSetChangedEvent());
431 LOG_DEBUG(Service_HID, "called");
432 } 449 }
433 450
434 void DisconnectNpad(Kernel::HLERequestContext& ctx) { 451 void DisconnectNpad(Kernel::HLERequestContext& ctx) {
435 IPC::RequestParser rp{ctx}; 452 IPC::RequestParser rp{ctx};
436 auto npad_id = rp.PopRaw<u32>(); 453 auto npad_id = rp.PopRaw<u32>();
454 LOG_DEBUG(Service_HID, "called with npad_id={}", npad_id);
455
437 applet_resource->GetController<Controller_NPad>(HidController::NPad) 456 applet_resource->GetController<Controller_NPad>(HidController::NPad)
438 .DisconnectNPad(npad_id); 457 .DisconnectNPad(npad_id);
439 IPC::ResponseBuilder rb{ctx, 2}; 458 IPC::ResponseBuilder rb{ctx, 2};
440 rb.Push(RESULT_SUCCESS); 459 rb.Push(RESULT_SUCCESS);
441 LOG_DEBUG(Service_HID, "called");
442 } 460 }
443 461
444 void GetPlayerLedPattern(Kernel::HLERequestContext& ctx) { 462 void GetPlayerLedPattern(Kernel::HLERequestContext& ctx) {
445 IPC::RequestParser rp{ctx}; 463 IPC::RequestParser rp{ctx};
446 auto npad_id = rp.PopRaw<u32>(); 464 auto npad_id = rp.PopRaw<u32>();
465 LOG_DEBUG(Service_HID, "called with npad_id={}", npad_id);
466
447 IPC::ResponseBuilder rb{ctx, 4}; 467 IPC::ResponseBuilder rb{ctx, 4};
448 rb.Push(RESULT_SUCCESS); 468 rb.Push(RESULT_SUCCESS);
449 rb.PushRaw<u64>(applet_resource->GetController<Controller_NPad>(HidController::NPad) 469 rb.PushRaw<u64>(applet_resource->GetController<Controller_NPad>(HidController::NPad)
450 .GetLedPattern(npad_id) 470 .GetLedPattern(npad_id)
451 .raw); 471 .raw);
452 LOG_DEBUG(Service_HID, "called");
453 } 472 }
454 473
455 void SetNpadJoyHoldType(Kernel::HLERequestContext& ctx) { 474 void SetNpadJoyHoldType(Kernel::HLERequestContext& ctx) {
456 auto& controller = applet_resource->GetController<Controller_NPad>(HidController::NPad);
457 IPC::RequestParser rp{ctx}; 475 IPC::RequestParser rp{ctx};
458 const auto hold_type = rp.PopRaw<u64>(); 476 const auto hold_type = rp.PopRaw<u64>();
477 LOG_DEBUG(Service_HID, "called with hold_type={}", hold_type);
478
479 auto& controller = applet_resource->GetController<Controller_NPad>(HidController::NPad);
459 controller.SetHoldType(Controller_NPad::NpadHoldType{hold_type}); 480 controller.SetHoldType(Controller_NPad::NpadHoldType{hold_type});
460 481
461 IPC::ResponseBuilder rb{ctx, 2}; 482 IPC::ResponseBuilder rb{ctx, 2};
462 rb.Push(RESULT_SUCCESS); 483 rb.Push(RESULT_SUCCESS);
463 LOG_DEBUG(Service_HID, "called");
464 } 484 }
465 485
466 void GetNpadJoyHoldType(Kernel::HLERequestContext& ctx) { 486 void GetNpadJoyHoldType(Kernel::HLERequestContext& ctx) {
487 LOG_DEBUG(Service_HID, "called");
488
467 const auto& controller = 489 const auto& controller =
468 applet_resource->GetController<Controller_NPad>(HidController::NPad); 490 applet_resource->GetController<Controller_NPad>(HidController::NPad);
469 IPC::ResponseBuilder rb{ctx, 4}; 491 IPC::ResponseBuilder rb{ctx, 4};
470 rb.Push(RESULT_SUCCESS); 492 rb.Push(RESULT_SUCCESS);
471 rb.Push<u64>(static_cast<u64>(controller.GetHoldType())); 493 rb.Push<u64>(static_cast<u64>(controller.GetHoldType()));
472 LOG_DEBUG(Service_HID, "called");
473 } 494 }
474 495
475 void SetNpadJoyAssignmentModeSingleByDefault(Kernel::HLERequestContext& ctx) { 496 void SetNpadJoyAssignmentModeSingleByDefault(Kernel::HLERequestContext& ctx) {
476 IPC::RequestParser rp{ctx}; 497 IPC::RequestParser rp{ctx};
477 auto npad_id = rp.PopRaw<u32>(); 498 auto npad_id = rp.PopRaw<u32>();
499 LOG_WARNING(Service_HID, "(STUBBED) called with npad_id={}", npad_id);
500
478 IPC::ResponseBuilder rb{ctx, 2}; 501 IPC::ResponseBuilder rb{ctx, 2};
479 rb.Push(RESULT_SUCCESS); 502 rb.Push(RESULT_SUCCESS);
480 LOG_WARNING(Service_HID, "(STUBBED) called");
481 } 503 }
482 504
483 void BeginPermitVibrationSession(Kernel::HLERequestContext& ctx) { 505 void BeginPermitVibrationSession(Kernel::HLERequestContext& ctx) {
506 LOG_DEBUG(Service_HID, "called");
507
484 applet_resource->GetController<Controller_NPad>(HidController::NPad) 508 applet_resource->GetController<Controller_NPad>(HidController::NPad)
485 .SetVibrationEnabled(true); 509 .SetVibrationEnabled(true);
486 IPC::ResponseBuilder rb{ctx, 2}; 510 IPC::ResponseBuilder rb{ctx, 2};
487 rb.Push(RESULT_SUCCESS); 511 rb.Push(RESULT_SUCCESS);
488 LOG_DEBUG(Service_HID, "called");
489 } 512 }
490 513
491 void EndPermitVibrationSession(Kernel::HLERequestContext& ctx) { 514 void EndPermitVibrationSession(Kernel::HLERequestContext& ctx) {
515 LOG_DEBUG(Service_HID, "called");
516
492 applet_resource->GetController<Controller_NPad>(HidController::NPad) 517 applet_resource->GetController<Controller_NPad>(HidController::NPad)
493 .SetVibrationEnabled(false); 518 .SetVibrationEnabled(false);
494 IPC::ResponseBuilder rb{ctx, 2}; 519 IPC::ResponseBuilder rb{ctx, 2};
495 rb.Push(RESULT_SUCCESS); 520 rb.Push(RESULT_SUCCESS);
496 LOG_DEBUG(Service_HID, "called");
497 } 521 }
498 522
499 void SendVibrationValue(Kernel::HLERequestContext& ctx) { 523 void SendVibrationValue(Kernel::HLERequestContext& ctx) {
500 IPC::RequestParser rp{ctx}; 524 IPC::RequestParser rp{ctx};
501 const auto controller_id = rp.PopRaw<u32>(); 525 const auto controller_id = rp.PopRaw<u32>();
502 const auto vibration_values = rp.PopRaw<Controller_NPad::Vibration>(); 526 const auto vibration_values = rp.PopRaw<Controller_NPad::Vibration>();
527 LOG_DEBUG(Service_HID, "called with controller_id={}", controller_id);
503 528
504 IPC::ResponseBuilder rb{ctx, 2}; 529 IPC::ResponseBuilder rb{ctx, 2};
505 rb.Push(RESULT_SUCCESS); 530 rb.Push(RESULT_SUCCESS);
506 531
507 applet_resource->GetController<Controller_NPad>(HidController::NPad) 532 applet_resource->GetController<Controller_NPad>(HidController::NPad)
508 .VibrateController({controller_id}, {vibration_values}); 533 .VibrateController({controller_id}, {vibration_values});
509 LOG_DEBUG(Service_HID, "called");
510 } 534 }
511 535
512 void SendVibrationValues(Kernel::HLERequestContext& ctx) { 536 void SendVibrationValues(Kernel::HLERequestContext& ctx) {
537 LOG_DEBUG(Service_HID, "called");
538
513 const auto controllers = ctx.ReadBuffer(0); 539 const auto controllers = ctx.ReadBuffer(0);
514 const auto vibrations = ctx.ReadBuffer(1); 540 const auto vibrations = ctx.ReadBuffer(1);
515 541
@@ -527,86 +553,96 @@ private:
527 553
528 IPC::ResponseBuilder rb{ctx, 2}; 554 IPC::ResponseBuilder rb{ctx, 2};
529 rb.Push(RESULT_SUCCESS); 555 rb.Push(RESULT_SUCCESS);
530 LOG_DEBUG(Service_HID, "called");
531 } 556 }
532 557
533 void GetActualVibrationValue(Kernel::HLERequestContext& ctx) { 558 void GetActualVibrationValue(Kernel::HLERequestContext& ctx) {
559 LOG_DEBUG(Service_HID, "called");
560
534 IPC::ResponseBuilder rb{ctx, 6}; 561 IPC::ResponseBuilder rb{ctx, 6};
535 rb.Push(RESULT_SUCCESS); 562 rb.Push(RESULT_SUCCESS);
536 rb.PushRaw<Controller_NPad::Vibration>( 563 rb.PushRaw<Controller_NPad::Vibration>(
537 applet_resource->GetController<Controller_NPad>(HidController::NPad) 564 applet_resource->GetController<Controller_NPad>(HidController::NPad)
538 .GetLastVibration()); 565 .GetLastVibration());
539 LOG_DEBUG(Service_HID, "called");
540 } 566 }
541 567
542 void SetNpadJoyAssignmentModeDual(Kernel::HLERequestContext& ctx) { 568 void SetNpadJoyAssignmentModeDual(Kernel::HLERequestContext& ctx) {
543 IPC::RequestParser rp{ctx}; 569 IPC::RequestParser rp{ctx};
544 const auto npad_id = rp.PopRaw<u32>(); 570 const auto npad_id = rp.PopRaw<u32>();
571 LOG_DEBUG(Service_HID, "called with npad_id={}", npad_id);
572
545 auto& controller = applet_resource->GetController<Controller_NPad>(HidController::NPad); 573 auto& controller = applet_resource->GetController<Controller_NPad>(HidController::NPad);
546 controller.SetNpadMode(npad_id, Controller_NPad::NPadAssignments::Dual); 574 controller.SetNpadMode(npad_id, Controller_NPad::NPadAssignments::Dual);
547 575
548 IPC::ResponseBuilder rb{ctx, 2}; 576 IPC::ResponseBuilder rb{ctx, 2};
549 rb.Push(RESULT_SUCCESS); 577 rb.Push(RESULT_SUCCESS);
550 LOG_DEBUG(Service_HID, "called");
551 } 578 }
552 579
553 void MergeSingleJoyAsDualJoy(Kernel::HLERequestContext& ctx) { 580 void MergeSingleJoyAsDualJoy(Kernel::HLERequestContext& ctx) {
581 LOG_WARNING(Service_HID, "(STUBBED) called");
582
554 IPC::ResponseBuilder rb{ctx, 2}; 583 IPC::ResponseBuilder rb{ctx, 2};
555 rb.Push(RESULT_SUCCESS); 584 rb.Push(RESULT_SUCCESS);
556 LOG_WARNING(Service_HID, "(STUBBED) called");
557 } 585 }
558 586
559 void SetNpadHandheldActivationMode(Kernel::HLERequestContext& ctx) { 587 void SetNpadHandheldActivationMode(Kernel::HLERequestContext& ctx) {
560 IPC::RequestParser rp{ctx}; 588 IPC::RequestParser rp{ctx};
561 auto mode = rp.PopRaw<u32>(); 589 auto mode = rp.PopRaw<u32>();
590 LOG_WARNING(Service_HID, "(STUBBED) called with mode={}", mode);
591
562 IPC::ResponseBuilder rb{ctx, 2}; 592 IPC::ResponseBuilder rb{ctx, 2};
563 rb.Push(RESULT_SUCCESS); 593 rb.Push(RESULT_SUCCESS);
564 LOG_WARNING(Service_HID, "(STUBBED) called");
565 } 594 }
566 595
567 void GetVibrationDeviceInfo(Kernel::HLERequestContext& ctx) { 596 void GetVibrationDeviceInfo(Kernel::HLERequestContext& ctx) {
597 LOG_DEBUG(Service_HID, "called");
598
568 IPC::ResponseBuilder rb{ctx, 4}; 599 IPC::ResponseBuilder rb{ctx, 4};
569 rb.Push(RESULT_SUCCESS); 600 rb.Push(RESULT_SUCCESS);
570 rb.Push<u32>(1); 601 rb.Push<u32>(1);
571 rb.Push<u32>(0); 602 rb.Push<u32>(0);
572 LOG_DEBUG(Service_HID, "called");
573 } 603 }
574 604
575 void CreateActiveVibrationDeviceList(Kernel::HLERequestContext& ctx) { 605 void CreateActiveVibrationDeviceList(Kernel::HLERequestContext& ctx) {
606 LOG_DEBUG(Service_HID, "called");
607
576 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 608 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
577 rb.Push(RESULT_SUCCESS); 609 rb.Push(RESULT_SUCCESS);
578 rb.PushIpcInterface<IActiveVibrationDeviceList>(); 610 rb.PushIpcInterface<IActiveVibrationDeviceList>();
579 LOG_DEBUG(Service_HID, "called");
580 } 611 }
581 612
582 void ActivateConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) { 613 void ActivateConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) {
614 LOG_WARNING(Service_HID, "(STUBBED) called");
615
583 IPC::ResponseBuilder rb{ctx, 2}; 616 IPC::ResponseBuilder rb{ctx, 2};
584 rb.Push(RESULT_SUCCESS); 617 rb.Push(RESULT_SUCCESS);
585 LOG_WARNING(Service_HID, "(STUBBED) called");
586 } 618 }
587 619
588 void StartConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) { 620 void StartConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) {
621 LOG_WARNING(Service_HID, "(STUBBED) called");
622
589 IPC::ResponseBuilder rb{ctx, 2}; 623 IPC::ResponseBuilder rb{ctx, 2};
590 rb.Push(RESULT_SUCCESS); 624 rb.Push(RESULT_SUCCESS);
591 LOG_WARNING(Service_HID, "(STUBBED) called");
592 } 625 }
593 626
594 void StopSixAxisSensor(Kernel::HLERequestContext& ctx) { 627 void StopSixAxisSensor(Kernel::HLERequestContext& ctx) {
628 LOG_WARNING(Service_HID, "(STUBBED) called");
629
595 IPC::ResponseBuilder rb{ctx, 2}; 630 IPC::ResponseBuilder rb{ctx, 2};
596 rb.Push(RESULT_SUCCESS); 631 rb.Push(RESULT_SUCCESS);
597 LOG_WARNING(Service_HID, "(STUBBED) called");
598 } 632 }
599 633
600 void SetIsPalmaAllConnectable(Kernel::HLERequestContext& ctx) { 634 void SetIsPalmaAllConnectable(Kernel::HLERequestContext& ctx) {
635 LOG_WARNING(Service_HID, "(STUBBED) called");
636
601 IPC::ResponseBuilder rb{ctx, 2}; 637 IPC::ResponseBuilder rb{ctx, 2};
602 rb.Push(RESULT_SUCCESS); 638 rb.Push(RESULT_SUCCESS);
603 LOG_WARNING(Service_HID, "(STUBBED) called");
604 } 639 }
605 640
606 void SetPalmaBoostMode(Kernel::HLERequestContext& ctx) { 641 void SetPalmaBoostMode(Kernel::HLERequestContext& ctx) {
642 LOG_WARNING(Service_HID, "(STUBBED) called");
643
607 IPC::ResponseBuilder rb{ctx, 2}; 644 IPC::ResponseBuilder rb{ctx, 2};
608 rb.Push(RESULT_SUCCESS); 645 rb.Push(RESULT_SUCCESS);
609 LOG_WARNING(Service_HID, "(STUBBED) called");
610 } 646 }
611}; 647};
612 648
diff --git a/src/core/hle/service/hid/irs.cpp b/src/core/hle/service/hid/irs.cpp
index 872e3c344..3c7f8b1ee 100644
--- a/src/core/hle/service/hid/irs.cpp
+++ b/src/core/hle/service/hid/irs.cpp
@@ -44,115 +44,133 @@ IRS::IRS() : ServiceFramework{"irs"} {
44} 44}
45 45
46void IRS::ActivateIrsensor(Kernel::HLERequestContext& ctx) { 46void IRS::ActivateIrsensor(Kernel::HLERequestContext& ctx) {
47 LOG_WARNING(Service_IRS, "(STUBBED) called");
48
47 IPC::ResponseBuilder rb{ctx, 2}; 49 IPC::ResponseBuilder rb{ctx, 2};
48 rb.Push(RESULT_SUCCESS); 50 rb.Push(RESULT_SUCCESS);
49 LOG_WARNING(Service_IRS, "(STUBBED) called");
50} 51}
51 52
52void IRS::DeactivateIrsensor(Kernel::HLERequestContext& ctx) { 53void IRS::DeactivateIrsensor(Kernel::HLERequestContext& ctx) {
54 LOG_WARNING(Service_IRS, "(STUBBED) called");
55
53 IPC::ResponseBuilder rb{ctx, 2}; 56 IPC::ResponseBuilder rb{ctx, 2};
54 rb.Push(RESULT_SUCCESS); 57 rb.Push(RESULT_SUCCESS);
55 LOG_WARNING(Service_IRS, "(STUBBED) called");
56} 58}
57 59
58void IRS::GetIrsensorSharedMemoryHandle(Kernel::HLERequestContext& ctx) { 60void IRS::GetIrsensorSharedMemoryHandle(Kernel::HLERequestContext& ctx) {
61 LOG_DEBUG(Service_IRS, "called");
62
59 IPC::ResponseBuilder rb{ctx, 2, 1}; 63 IPC::ResponseBuilder rb{ctx, 2, 1};
60 rb.Push(RESULT_SUCCESS); 64 rb.Push(RESULT_SUCCESS);
61 rb.PushCopyObjects(shared_mem); 65 rb.PushCopyObjects(shared_mem);
62 LOG_DEBUG(Service_IRS, "called");
63} 66}
64 67
65void IRS::StopImageProcessor(Kernel::HLERequestContext& ctx) { 68void IRS::StopImageProcessor(Kernel::HLERequestContext& ctx) {
69 LOG_WARNING(Service_IRS, "(STUBBED) called");
70
66 IPC::ResponseBuilder rb{ctx, 2}; 71 IPC::ResponseBuilder rb{ctx, 2};
67 rb.Push(RESULT_SUCCESS); 72 rb.Push(RESULT_SUCCESS);
68 LOG_WARNING(Service_IRS, "(STUBBED) called");
69} 73}
70 74
71void IRS::RunMomentProcessor(Kernel::HLERequestContext& ctx) { 75void IRS::RunMomentProcessor(Kernel::HLERequestContext& ctx) {
76 LOG_WARNING(Service_IRS, "(STUBBED) called");
77
72 IPC::ResponseBuilder rb{ctx, 2}; 78 IPC::ResponseBuilder rb{ctx, 2};
73 rb.Push(RESULT_SUCCESS); 79 rb.Push(RESULT_SUCCESS);
74 LOG_WARNING(Service_IRS, "(STUBBED) called");
75} 80}
76 81
77void IRS::RunClusteringProcessor(Kernel::HLERequestContext& ctx) { 82void IRS::RunClusteringProcessor(Kernel::HLERequestContext& ctx) {
83 LOG_WARNING(Service_IRS, "(STUBBED) called");
84
78 IPC::ResponseBuilder rb{ctx, 2}; 85 IPC::ResponseBuilder rb{ctx, 2};
79 rb.Push(RESULT_SUCCESS); 86 rb.Push(RESULT_SUCCESS);
80 LOG_WARNING(Service_IRS, "(STUBBED) called");
81} 87}
82 88
83void IRS::RunImageTransferProcessor(Kernel::HLERequestContext& ctx) { 89void IRS::RunImageTransferProcessor(Kernel::HLERequestContext& ctx) {
90 LOG_WARNING(Service_IRS, "(STUBBED) called");
91
84 IPC::ResponseBuilder rb{ctx, 2}; 92 IPC::ResponseBuilder rb{ctx, 2};
85 rb.Push(RESULT_SUCCESS); 93 rb.Push(RESULT_SUCCESS);
86 LOG_WARNING(Service_IRS, "(STUBBED) called");
87} 94}
88 95
89void IRS::GetImageTransferProcessorState(Kernel::HLERequestContext& ctx) { 96void IRS::GetImageTransferProcessorState(Kernel::HLERequestContext& ctx) {
97 LOG_WARNING(Service_IRS, "(STUBBED) called");
98
90 IPC::ResponseBuilder rb{ctx, 5}; 99 IPC::ResponseBuilder rb{ctx, 5};
91 rb.Push(RESULT_SUCCESS); 100 rb.Push(RESULT_SUCCESS);
92 rb.PushRaw<u64>(CoreTiming::GetTicks()); 101 rb.PushRaw<u64>(CoreTiming::GetTicks());
93 rb.PushRaw<u32>(0); 102 rb.PushRaw<u32>(0);
94 LOG_WARNING(Service_IRS, "(STUBBED) called");
95} 103}
96 104
97void IRS::RunTeraPluginProcessor(Kernel::HLERequestContext& ctx) { 105void IRS::RunTeraPluginProcessor(Kernel::HLERequestContext& ctx) {
106 LOG_WARNING(Service_IRS, "(STUBBED) called");
107
98 IPC::ResponseBuilder rb{ctx, 2}; 108 IPC::ResponseBuilder rb{ctx, 2};
99 rb.Push(RESULT_SUCCESS); 109 rb.Push(RESULT_SUCCESS);
100 LOG_WARNING(Service_IRS, "(STUBBED) called");
101} 110}
102 111
103void IRS::GetNpadIrCameraHandle(Kernel::HLERequestContext& ctx) { 112void IRS::GetNpadIrCameraHandle(Kernel::HLERequestContext& ctx) {
113 LOG_WARNING(Service_IRS, "(STUBBED) called");
114
104 IPC::ResponseBuilder rb{ctx, 3}; 115 IPC::ResponseBuilder rb{ctx, 3};
105 rb.Push(RESULT_SUCCESS); 116 rb.Push(RESULT_SUCCESS);
106 rb.PushRaw<u32>(device_handle); 117 rb.PushRaw<u32>(device_handle);
107 LOG_WARNING(Service_IRS, "(STUBBED) called");
108} 118}
109 119
110void IRS::RunPointingProcessor(Kernel::HLERequestContext& ctx) { 120void IRS::RunPointingProcessor(Kernel::HLERequestContext& ctx) {
121 LOG_WARNING(Service_IRS, "(STUBBED) called");
122
111 IPC::ResponseBuilder rb{ctx, 2}; 123 IPC::ResponseBuilder rb{ctx, 2};
112 rb.Push(RESULT_SUCCESS); 124 rb.Push(RESULT_SUCCESS);
113 LOG_WARNING(Service_IRS, "(STUBBED) called");
114} 125}
115 126
116void IRS::SuspendImageProcessor(Kernel::HLERequestContext& ctx) { 127void IRS::SuspendImageProcessor(Kernel::HLERequestContext& ctx) {
128 LOG_WARNING(Service_IRS, "(STUBBED) called");
129
117 IPC::ResponseBuilder rb{ctx, 2}; 130 IPC::ResponseBuilder rb{ctx, 2};
118 rb.Push(RESULT_SUCCESS); 131 rb.Push(RESULT_SUCCESS);
119 LOG_WARNING(Service_IRS, "(STUBBED) called");
120} 132}
121 133
122void IRS::CheckFirmwareVersion(Kernel::HLERequestContext& ctx) { 134void IRS::CheckFirmwareVersion(Kernel::HLERequestContext& ctx) {
135 LOG_WARNING(Service_IRS, "(STUBBED) called");
136
123 IPC::ResponseBuilder rb{ctx, 2}; 137 IPC::ResponseBuilder rb{ctx, 2};
124 rb.Push(RESULT_SUCCESS); 138 rb.Push(RESULT_SUCCESS);
125 LOG_WARNING(Service_IRS, "(STUBBED) called");
126} 139}
127 140
128void IRS::SetFunctionLevel(Kernel::HLERequestContext& ctx) { 141void IRS::SetFunctionLevel(Kernel::HLERequestContext& ctx) {
142 LOG_WARNING(Service_IRS, "(STUBBED) called");
143
129 IPC::ResponseBuilder rb{ctx, 2}; 144 IPC::ResponseBuilder rb{ctx, 2};
130 rb.Push(RESULT_SUCCESS); 145 rb.Push(RESULT_SUCCESS);
131 LOG_WARNING(Service_IRS, "(STUBBED) called");
132} 146}
133 147
134void IRS::RunImageTransferExProcessor(Kernel::HLERequestContext& ctx) { 148void IRS::RunImageTransferExProcessor(Kernel::HLERequestContext& ctx) {
149 LOG_WARNING(Service_IRS, "(STUBBED) called");
150
135 IPC::ResponseBuilder rb{ctx, 2}; 151 IPC::ResponseBuilder rb{ctx, 2};
136 rb.Push(RESULT_SUCCESS); 152 rb.Push(RESULT_SUCCESS);
137 LOG_WARNING(Service_IRS, "(STUBBED) called");
138} 153}
139 154
140void IRS::RunIrLedProcessor(Kernel::HLERequestContext& ctx) { 155void IRS::RunIrLedProcessor(Kernel::HLERequestContext& ctx) {
156 LOG_WARNING(Service_IRS, "(STUBBED) called");
157
141 IPC::ResponseBuilder rb{ctx, 2}; 158 IPC::ResponseBuilder rb{ctx, 2};
142 rb.Push(RESULT_SUCCESS); 159 rb.Push(RESULT_SUCCESS);
143 LOG_WARNING(Service_IRS, "(STUBBED) called");
144} 160}
145 161
146void IRS::StopImageProcessorAsync(Kernel::HLERequestContext& ctx) { 162void IRS::StopImageProcessorAsync(Kernel::HLERequestContext& ctx) {
163 LOG_WARNING(Service_IRS, "(STUBBED) called");
164
147 IPC::ResponseBuilder rb{ctx, 2}; 165 IPC::ResponseBuilder rb{ctx, 2};
148 rb.Push(RESULT_SUCCESS); 166 rb.Push(RESULT_SUCCESS);
149 LOG_WARNING(Service_IRS, "(STUBBED) called");
150} 167}
151 168
152void IRS::ActivateIrsensorWithFunctionLevel(Kernel::HLERequestContext& ctx) { 169void IRS::ActivateIrsensorWithFunctionLevel(Kernel::HLERequestContext& ctx) {
170 LOG_WARNING(Service_IRS, "(STUBBED) called");
171
153 IPC::ResponseBuilder rb{ctx, 2}; 172 IPC::ResponseBuilder rb{ctx, 2};
154 rb.Push(RESULT_SUCCESS); 173 rb.Push(RESULT_SUCCESS);
155 LOG_WARNING(Service_IRS, "(STUBBED) called");
156} 174}
157 175
158IRS::~IRS() = default; 176IRS::~IRS() = default;
diff --git a/src/core/hle/service/lbl/lbl.cpp b/src/core/hle/service/lbl/lbl.cpp
index 164c57e18..e8f9f2d29 100644
--- a/src/core/hle/service/lbl/lbl.cpp
+++ b/src/core/hle/service/lbl/lbl.cpp
@@ -55,29 +55,29 @@ public:
55 55
56private: 56private:
57 void EnableVrMode(Kernel::HLERequestContext& ctx) { 57 void EnableVrMode(Kernel::HLERequestContext& ctx) {
58 LOG_DEBUG(Service_LBL, "called");
59
58 IPC::ResponseBuilder rb{ctx, 2}; 60 IPC::ResponseBuilder rb{ctx, 2};
59 rb.Push(RESULT_SUCCESS); 61 rb.Push(RESULT_SUCCESS);
60 62
61 vr_mode_enabled = true; 63 vr_mode_enabled = true;
62
63 LOG_DEBUG(Service_LBL, "called");
64 } 64 }
65 65
66 void DisableVrMode(Kernel::HLERequestContext& ctx) { 66 void DisableVrMode(Kernel::HLERequestContext& ctx) {
67 LOG_DEBUG(Service_LBL, "called");
68
67 IPC::ResponseBuilder rb{ctx, 2}; 69 IPC::ResponseBuilder rb{ctx, 2};
68 rb.Push(RESULT_SUCCESS); 70 rb.Push(RESULT_SUCCESS);
69 71
70 vr_mode_enabled = false; 72 vr_mode_enabled = false;
71
72 LOG_DEBUG(Service_LBL, "called");
73 } 73 }
74 74
75 void IsVrModeEnabled(Kernel::HLERequestContext& ctx) { 75 void IsVrModeEnabled(Kernel::HLERequestContext& ctx) {
76 LOG_DEBUG(Service_LBL, "called");
77
76 IPC::ResponseBuilder rb{ctx, 3}; 78 IPC::ResponseBuilder rb{ctx, 3};
77 rb.Push(RESULT_SUCCESS); 79 rb.Push(RESULT_SUCCESS);
78 rb.Push(vr_mode_enabled); 80 rb.Push(vr_mode_enabled);
79
80 LOG_DEBUG(Service_LBL, "called");
81 } 81 }
82 82
83 bool vr_mode_enabled = false; 83 bool vr_mode_enabled = false;
diff --git a/src/core/hle/service/ldn/ldn.cpp b/src/core/hle/service/ldn/ldn.cpp
index 167f2c66a..e250595e3 100644
--- a/src/core/hle/service/ldn/ldn.cpp
+++ b/src/core/hle/service/ldn/ldn.cpp
@@ -44,11 +44,11 @@ public:
44 } 44 }
45 45
46 void CreateMonitorService(Kernel::HLERequestContext& ctx) { 46 void CreateMonitorService(Kernel::HLERequestContext& ctx) {
47 LOG_DEBUG(Service_LDN, "called");
48
47 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 49 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
48 rb.Push(RESULT_SUCCESS); 50 rb.Push(RESULT_SUCCESS);
49 rb.PushIpcInterface<IMonitorService>(); 51 rb.PushIpcInterface<IMonitorService>();
50
51 LOG_DEBUG(Service_LDN, "called");
52 } 52 }
53}; 53};
54 54
@@ -104,11 +104,11 @@ public:
104 } 104 }
105 105
106 void CreateSystemLocalCommunicationService(Kernel::HLERequestContext& ctx) { 106 void CreateSystemLocalCommunicationService(Kernel::HLERequestContext& ctx) {
107 LOG_DEBUG(Service_LDN, "called");
108
107 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 109 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
108 rb.Push(RESULT_SUCCESS); 110 rb.Push(RESULT_SUCCESS);
109 rb.PushIpcInterface<ILocalCommunicationService>("ISystemLocalCommunicationService"); 111 rb.PushIpcInterface<ILocalCommunicationService>("ISystemLocalCommunicationService");
110
111 LOG_DEBUG(Service_LDN, "called");
112 } 112 }
113}; 113};
114 114
@@ -125,11 +125,11 @@ public:
125 } 125 }
126 126
127 void CreateUserLocalCommunicationService(Kernel::HLERequestContext& ctx) { 127 void CreateUserLocalCommunicationService(Kernel::HLERequestContext& ctx) {
128 LOG_DEBUG(Service_LDN, "called");
129
128 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 130 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
129 rb.Push(RESULT_SUCCESS); 131 rb.Push(RESULT_SUCCESS);
130 rb.PushIpcInterface<ILocalCommunicationService>("IUserLocalCommunicationService"); 132 rb.PushIpcInterface<ILocalCommunicationService>("IUserLocalCommunicationService");
131
132 LOG_DEBUG(Service_LDN, "called");
133 } 133 }
134}; 134};
135 135
diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp
index 7a9d0d0dd..ca119dd3a 100644
--- a/src/core/hle/service/ldr/ldr.cpp
+++ b/src/core/hle/service/ldr/ldr.cpp
@@ -97,6 +97,8 @@ public:
97 rp.Skip(2, false); 97 rp.Skip(2, false);
98 const VAddr nrr_addr{rp.Pop<VAddr>()}; 98 const VAddr nrr_addr{rp.Pop<VAddr>()};
99 const u64 nrr_size{rp.Pop<u64>()}; 99 const u64 nrr_size{rp.Pop<u64>()};
100 LOG_DEBUG(Service_LDR, "called with nrr_addr={:016X}, nrr_size={:016X}", nrr_addr,
101 nrr_size);
100 102
101 if (!initialized) { 103 if (!initialized) {
102 LOG_ERROR(Service_LDR, "LDR:RO not initialized before use!"); 104 LOG_ERROR(Service_LDR, "LDR:RO not initialized before use!");
@@ -189,6 +191,7 @@ public:
189 IPC::RequestParser rp{ctx}; 191 IPC::RequestParser rp{ctx};
190 rp.Skip(2, false); 192 rp.Skip(2, false);
191 const auto nrr_addr{rp.Pop<VAddr>()}; 193 const auto nrr_addr{rp.Pop<VAddr>()};
194 LOG_DEBUG(Service_LDR, "called with nrr_addr={:016X}", nrr_addr);
192 195
193 if (!Common::Is4KBAligned(nrr_addr)) { 196 if (!Common::Is4KBAligned(nrr_addr)) {
194 LOG_ERROR(Service_LDR, "NRR Address has invalid alignment (actual {:016X})!", nrr_addr); 197 LOG_ERROR(Service_LDR, "NRR Address has invalid alignment (actual {:016X})!", nrr_addr);
@@ -219,6 +222,10 @@ public:
219 const u64 nro_size{rp.Pop<u64>()}; 222 const u64 nro_size{rp.Pop<u64>()};
220 const VAddr bss_addr{rp.Pop<VAddr>()}; 223 const VAddr bss_addr{rp.Pop<VAddr>()};
221 const u64 bss_size{rp.Pop<u64>()}; 224 const u64 bss_size{rp.Pop<u64>()};
225 LOG_DEBUG(
226 Service_LDR,
227 "called with nro_addr={:016X}, nro_size={:016X}, bss_addr={:016X}, bss_size={:016X}",
228 nro_addr, nro_size, bss_addr, bss_size);
222 229
223 if (!initialized) { 230 if (!initialized) {
224 LOG_ERROR(Service_LDR, "LDR:RO not initialized before use!"); 231 LOG_ERROR(Service_LDR, "LDR:RO not initialized before use!");
@@ -345,6 +352,8 @@ public:
345 rp.Skip(2, false); 352 rp.Skip(2, false);
346 const VAddr mapped_addr{rp.PopRaw<VAddr>()}; 353 const VAddr mapped_addr{rp.PopRaw<VAddr>()};
347 const VAddr heap_addr{rp.PopRaw<VAddr>()}; 354 const VAddr heap_addr{rp.PopRaw<VAddr>()};
355 LOG_DEBUG(Service_LDR, "called with mapped_addr={:016X}, heap_addr={:016X}", mapped_addr,
356 heap_addr);
348 357
349 if (!initialized) { 358 if (!initialized) {
350 LOG_ERROR(Service_LDR, "LDR:RO not initialized before use!"); 359 LOG_ERROR(Service_LDR, "LDR:RO not initialized before use!");
@@ -393,11 +402,12 @@ public:
393 } 402 }
394 403
395 void Initialize(Kernel::HLERequestContext& ctx) { 404 void Initialize(Kernel::HLERequestContext& ctx) {
405 LOG_WARNING(Service_LDR, "(STUBBED) called");
406
396 initialized = true; 407 initialized = true;
397 408
398 IPC::ResponseBuilder rb{ctx, 2}; 409 IPC::ResponseBuilder rb{ctx, 2};
399 rb.Push(RESULT_SUCCESS); 410 rb.Push(RESULT_SUCCESS);
400 LOG_WARNING(Service_LDR, "(STUBBED) called");
401 } 411 }
402 412
403private: 413private:
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp
index 4e5fdb16e..1f462e087 100644
--- a/src/core/hle/service/lm/lm.cpp
+++ b/src/core/hle/service/lm/lm.cpp
@@ -209,11 +209,11 @@ public:
209 * 0: ResultCode 209 * 0: ResultCode
210 */ 210 */
211 void OpenLogger(Kernel::HLERequestContext& ctx) { 211 void OpenLogger(Kernel::HLERequestContext& ctx) {
212 LOG_DEBUG(Service_LM, "called");
213
212 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 214 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
213 rb.Push(RESULT_SUCCESS); 215 rb.Push(RESULT_SUCCESS);
214 rb.PushIpcInterface<ILogger>(); 216 rb.PushIpcInterface<ILogger>();
215
216 LOG_DEBUG(Service_LM, "called");
217 } 217 }
218}; 218};
219 219
diff --git a/src/core/hle/service/mm/mm_u.cpp b/src/core/hle/service/mm/mm_u.cpp
index e1f17a926..def63dc8a 100644
--- a/src/core/hle/service/mm/mm_u.cpp
+++ b/src/core/hle/service/mm/mm_u.cpp
@@ -31,12 +31,14 @@ public:
31private: 31private:
32 void Initialize(Kernel::HLERequestContext& ctx) { 32 void Initialize(Kernel::HLERequestContext& ctx) {
33 LOG_WARNING(Service_MM, "(STUBBED) called"); 33 LOG_WARNING(Service_MM, "(STUBBED) called");
34
34 IPC::ResponseBuilder rb{ctx, 2}; 35 IPC::ResponseBuilder rb{ctx, 2};
35 rb.Push(RESULT_SUCCESS); 36 rb.Push(RESULT_SUCCESS);
36 } 37 }
37 38
38 void Finalize(Kernel::HLERequestContext& ctx) { 39 void Finalize(Kernel::HLERequestContext& ctx) {
39 LOG_WARNING(Service_MM, "(STUBBED) called"); 40 LOG_WARNING(Service_MM, "(STUBBED) called");
41
40 IPC::ResponseBuilder rb{ctx, 2}; 42 IPC::ResponseBuilder rb{ctx, 2};
41 rb.Push(RESULT_SUCCESS); 43 rb.Push(RESULT_SUCCESS);
42 } 44 }
@@ -45,15 +47,16 @@ private:
45 IPC::RequestParser rp{ctx}; 47 IPC::RequestParser rp{ctx};
46 min = rp.Pop<u32>(); 48 min = rp.Pop<u32>();
47 max = rp.Pop<u32>(); 49 max = rp.Pop<u32>();
48 current = min;
49
50 LOG_WARNING(Service_MM, "(STUBBED) called, min=0x{:X}, max=0x{:X}", min, max); 50 LOG_WARNING(Service_MM, "(STUBBED) called, min=0x{:X}, max=0x{:X}", min, max);
51
52 current = min;
51 IPC::ResponseBuilder rb{ctx, 2}; 53 IPC::ResponseBuilder rb{ctx, 2};
52 rb.Push(RESULT_SUCCESS); 54 rb.Push(RESULT_SUCCESS);
53 } 55 }
54 56
55 void Get(Kernel::HLERequestContext& ctx) { 57 void Get(Kernel::HLERequestContext& ctx) {
56 LOG_WARNING(Service_MM, "(STUBBED) called"); 58 LOG_WARNING(Service_MM, "(STUBBED) called");
59
57 IPC::ResponseBuilder rb{ctx, 3}; 60 IPC::ResponseBuilder rb{ctx, 3};
58 rb.Push(RESULT_SUCCESS); 61 rb.Push(RESULT_SUCCESS);
59 rb.Push(current); 62 rb.Push(current);
@@ -61,6 +64,7 @@ private:
61 64
62 void InitializeWithId(Kernel::HLERequestContext& ctx) { 65 void InitializeWithId(Kernel::HLERequestContext& ctx) {
63 LOG_WARNING(Service_MM, "(STUBBED) called"); 66 LOG_WARNING(Service_MM, "(STUBBED) called");
67
64 IPC::ResponseBuilder rb{ctx, 3}; 68 IPC::ResponseBuilder rb{ctx, 3};
65 rb.Push(RESULT_SUCCESS); 69 rb.Push(RESULT_SUCCESS);
66 rb.Push<u32>(id); // Any non zero value 70 rb.Push<u32>(id); // Any non zero value
@@ -68,6 +72,7 @@ private:
68 72
69 void FinalizeWithId(Kernel::HLERequestContext& ctx) { 73 void FinalizeWithId(Kernel::HLERequestContext& ctx) {
70 LOG_WARNING(Service_MM, "(STUBBED) called"); 74 LOG_WARNING(Service_MM, "(STUBBED) called");
75
71 IPC::ResponseBuilder rb{ctx, 2}; 76 IPC::ResponseBuilder rb{ctx, 2};
72 rb.Push(RESULT_SUCCESS); 77 rb.Push(RESULT_SUCCESS);
73 } 78 }
@@ -77,16 +82,17 @@ private:
77 u32 input_id = rp.Pop<u32>(); 82 u32 input_id = rp.Pop<u32>();
78 min = rp.Pop<u32>(); 83 min = rp.Pop<u32>();
79 max = rp.Pop<u32>(); 84 max = rp.Pop<u32>();
80 current = min;
81
82 LOG_WARNING(Service_MM, "(STUBBED) called, input_id=0x{:X}, min=0x{:X}, max=0x{:X}", 85 LOG_WARNING(Service_MM, "(STUBBED) called, input_id=0x{:X}, min=0x{:X}, max=0x{:X}",
83 input_id, min, max); 86 input_id, min, max);
87
88 current = min;
84 IPC::ResponseBuilder rb{ctx, 2}; 89 IPC::ResponseBuilder rb{ctx, 2};
85 rb.Push(RESULT_SUCCESS); 90 rb.Push(RESULT_SUCCESS);
86 } 91 }
87 92
88 void GetWithId(Kernel::HLERequestContext& ctx) { 93 void GetWithId(Kernel::HLERequestContext& ctx) {
89 LOG_WARNING(Service_MM, "(STUBBED) called"); 94 LOG_WARNING(Service_MM, "(STUBBED) called");
95
90 IPC::ResponseBuilder rb{ctx, 3}; 96 IPC::ResponseBuilder rb{ctx, 3};
91 rb.Push(RESULT_SUCCESS); 97 rb.Push(RESULT_SUCCESS);
92 rb.Push(current); 98 rb.Push(current);
diff --git a/src/core/hle/service/nfc/nfc.cpp b/src/core/hle/service/nfc/nfc.cpp
index 30e542542..5c62d42ba 100644
--- a/src/core/hle/service/nfc/nfc.cpp
+++ b/src/core/hle/service/nfc/nfc.cpp
@@ -43,11 +43,11 @@ public:
43 43
44private: 44private:
45 void CreateAmInterface(Kernel::HLERequestContext& ctx) { 45 void CreateAmInterface(Kernel::HLERequestContext& ctx) {
46 LOG_DEBUG(Service_NFC, "called");
47
46 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 48 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
47 rb.Push(RESULT_SUCCESS); 49 rb.Push(RESULT_SUCCESS);
48 rb.PushIpcInterface<IAm>(); 50 rb.PushIpcInterface<IAm>();
49
50 LOG_DEBUG(Service_NFC, "called");
51 } 51 }
52}; 52};
53 53
@@ -91,11 +91,11 @@ public:
91 91
92private: 92private:
93 void CreateUserInterface(Kernel::HLERequestContext& ctx) { 93 void CreateUserInterface(Kernel::HLERequestContext& ctx) {
94 LOG_DEBUG(Service_NFC, "called");
95
94 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 96 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
95 rb.Push(RESULT_SUCCESS); 97 rb.Push(RESULT_SUCCESS);
96 rb.PushIpcInterface<MFIUser>(); 98 rb.PushIpcInterface<MFIUser>();
97
98 LOG_DEBUG(Service_NFC, "called");
99 } 99 }
100}; 100};
101 101
@@ -138,19 +138,19 @@ private:
138 }; 138 };
139 139
140 void InitializeOld(Kernel::HLERequestContext& ctx) { 140 void InitializeOld(Kernel::HLERequestContext& ctx) {
141 LOG_DEBUG(Service_NFC, "called");
142
141 IPC::ResponseBuilder rb{ctx, 2, 0}; 143 IPC::ResponseBuilder rb{ctx, 2, 0};
142 rb.Push(RESULT_SUCCESS); 144 rb.Push(RESULT_SUCCESS);
143
144 // We don't deal with hardware initialization so we can just stub this. 145 // We don't deal with hardware initialization so we can just stub this.
145 LOG_DEBUG(Service_NFC, "called");
146 } 146 }
147 147
148 void IsNfcEnabledOld(Kernel::HLERequestContext& ctx) { 148 void IsNfcEnabledOld(Kernel::HLERequestContext& ctx) {
149 LOG_DEBUG(Service_NFC, "IsNfcEnabledOld");
150
149 IPC::ResponseBuilder rb{ctx, 3}; 151 IPC::ResponseBuilder rb{ctx, 3};
150 rb.Push(RESULT_SUCCESS); 152 rb.Push(RESULT_SUCCESS);
151 rb.PushRaw<u8>(Settings::values.enable_nfc); 153 rb.PushRaw<u8>(Settings::values.enable_nfc);
152
153 LOG_DEBUG(Service_NFC, "IsNfcEnabledOld");
154 } 154 }
155 155
156 void GetStateOld(Kernel::HLERequestContext& ctx) { 156 void GetStateOld(Kernel::HLERequestContext& ctx) {
@@ -183,11 +183,11 @@ public:
183 183
184private: 184private:
185 void CreateUserInterface(Kernel::HLERequestContext& ctx) { 185 void CreateUserInterface(Kernel::HLERequestContext& ctx) {
186 LOG_DEBUG(Service_NFC, "called");
187
186 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 188 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
187 rb.Push(RESULT_SUCCESS); 189 rb.Push(RESULT_SUCCESS);
188 rb.PushIpcInterface<IUser>(); 190 rb.PushIpcInterface<IUser>();
189
190 LOG_DEBUG(Service_NFC, "called");
191 } 191 }
192}; 192};
193 193
@@ -241,11 +241,11 @@ public:
241 241
242private: 242private:
243 void CreateSystemInterface(Kernel::HLERequestContext& ctx) { 243 void CreateSystemInterface(Kernel::HLERequestContext& ctx) {
244 LOG_DEBUG(Service_NFC, "called");
245
244 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 246 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
245 rb.Push(RESULT_SUCCESS); 247 rb.Push(RESULT_SUCCESS);
246 rb.PushIpcInterface<ISystem>(); 248 rb.PushIpcInterface<ISystem>();
247
248 LOG_DEBUG(Service_NFC, "called");
249 } 249 }
250}; 250};
251 251
diff --git a/src/core/hle/service/nfp/nfp.cpp b/src/core/hle/service/nfp/nfp.cpp
index 1d6e7756f..ff9170c24 100644
--- a/src/core/hle/service/nfp/nfp.cpp
+++ b/src/core/hle/service/nfp/nfp.cpp
@@ -108,30 +108,29 @@ private:
108 static_assert(sizeof(CommonInfo) == 0x40, "CommonInfo is an invalid size"); 108 static_assert(sizeof(CommonInfo) == 0x40, "CommonInfo is an invalid size");
109 109
110 void Initialize(Kernel::HLERequestContext& ctx) { 110 void Initialize(Kernel::HLERequestContext& ctx) {
111 LOG_DEBUG(Service_NFC, "called");
112
111 IPC::ResponseBuilder rb{ctx, 2, 0}; 113 IPC::ResponseBuilder rb{ctx, 2, 0};
112 rb.Push(RESULT_SUCCESS); 114 rb.Push(RESULT_SUCCESS);
113 115
114 state = State::Initialized; 116 state = State::Initialized;
115
116 LOG_DEBUG(Service_NFC, "called");
117 } 117 }
118 118
119 void GetState(Kernel::HLERequestContext& ctx) { 119 void GetState(Kernel::HLERequestContext& ctx) {
120 LOG_DEBUG(Service_NFC, "called");
121
120 IPC::ResponseBuilder rb{ctx, 3, 0}; 122 IPC::ResponseBuilder rb{ctx, 3, 0};
121 rb.Push(RESULT_SUCCESS); 123 rb.Push(RESULT_SUCCESS);
122 rb.PushRaw<u32>(static_cast<u32>(state)); 124 rb.PushRaw<u32>(static_cast<u32>(state));
123
124 LOG_DEBUG(Service_NFC, "called");
125 } 125 }
126 126
127 void ListDevices(Kernel::HLERequestContext& ctx) { 127 void ListDevices(Kernel::HLERequestContext& ctx) {
128 IPC::RequestParser rp{ctx}; 128 IPC::RequestParser rp{ctx};
129 const u32 array_size = rp.Pop<u32>(); 129 const u32 array_size = rp.Pop<u32>();
130 LOG_DEBUG(Service_NFP, "called, array_size={}", array_size);
130 131
131 ctx.WriteBuffer(&device_handle, sizeof(device_handle)); 132 ctx.WriteBuffer(&device_handle, sizeof(device_handle));
132 133
133 LOG_DEBUG(Service_NFP, "called, array_size={}", array_size);
134
135 IPC::ResponseBuilder rb{ctx, 3}; 134 IPC::ResponseBuilder rb{ctx, 3};
136 rb.Push(RESULT_SUCCESS); 135 rb.Push(RESULT_SUCCESS);
137 rb.Push<u32>(1); 136 rb.Push<u32>(1);
@@ -141,6 +140,7 @@ private:
141 IPC::RequestParser rp{ctx}; 140 IPC::RequestParser rp{ctx};
142 const u64 dev_handle = rp.Pop<u64>(); 141 const u64 dev_handle = rp.Pop<u64>();
143 LOG_DEBUG(Service_NFP, "called, dev_handle=0x{:X}", dev_handle); 142 LOG_DEBUG(Service_NFP, "called, dev_handle=0x{:X}", dev_handle);
143
144 IPC::ResponseBuilder rb{ctx, 3}; 144 IPC::ResponseBuilder rb{ctx, 3};
145 rb.Push(RESULT_SUCCESS); 145 rb.Push(RESULT_SUCCESS);
146 rb.Push<u32>(npad_id); 146 rb.Push<u32>(npad_id);
@@ -150,6 +150,7 @@ private:
150 IPC::RequestParser rp{ctx}; 150 IPC::RequestParser rp{ctx};
151 const u64 dev_handle = rp.Pop<u64>(); 151 const u64 dev_handle = rp.Pop<u64>();
152 LOG_DEBUG(Service_NFP, "called, dev_handle=0x{:X}", dev_handle); 152 LOG_DEBUG(Service_NFP, "called, dev_handle=0x{:X}", dev_handle);
153
153 IPC::ResponseBuilder rb{ctx, 2, 1}; 154 IPC::ResponseBuilder rb{ctx, 2, 1};
154 rb.Push(RESULT_SUCCESS); 155 rb.Push(RESULT_SUCCESS);
155 rb.PushCopyObjects(nfp_interface.GetNFCEvent()); 156 rb.PushCopyObjects(nfp_interface.GetNFCEvent());
@@ -168,6 +169,7 @@ private:
168 169
169 void StopDetection(Kernel::HLERequestContext& ctx) { 170 void StopDetection(Kernel::HLERequestContext& ctx) {
170 LOG_DEBUG(Service_NFP, "called"); 171 LOG_DEBUG(Service_NFP, "called");
172
171 switch (device_state) { 173 switch (device_state) {
172 case DeviceState::TagFound: 174 case DeviceState::TagFound:
173 case DeviceState::TagNearby: 175 case DeviceState::TagNearby:
@@ -185,6 +187,7 @@ private:
185 187
186 void GetDeviceState(Kernel::HLERequestContext& ctx) { 188 void GetDeviceState(Kernel::HLERequestContext& ctx) {
187 LOG_DEBUG(Service_NFP, "called"); 189 LOG_DEBUG(Service_NFP, "called");
190
188 auto nfc_event = nfp_interface.GetNFCEvent(); 191 auto nfc_event = nfp_interface.GetNFCEvent();
189 if (!nfc_event->ShouldWait(Kernel::GetCurrentThread()) && !has_attached_handle) { 192 if (!nfc_event->ShouldWait(Kernel::GetCurrentThread()) && !has_attached_handle) {
190 device_state = DeviceState::TagFound; 193 device_state = DeviceState::TagFound;
@@ -323,6 +326,7 @@ private:
323 326
324void Module::Interface::CreateUserInterface(Kernel::HLERequestContext& ctx) { 327void Module::Interface::CreateUserInterface(Kernel::HLERequestContext& ctx) {
325 LOG_DEBUG(Service_NFP, "called"); 328 LOG_DEBUG(Service_NFP, "called");
329
326 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 330 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
327 rb.Push(RESULT_SUCCESS); 331 rb.Push(RESULT_SUCCESS);
328 rb.PushIpcInterface<IUser>(*this); 332 rb.PushIpcInterface<IUser>(*this);
diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp
index 75dcd94a3..dee391201 100644
--- a/src/core/hle/service/nifm/nifm.cpp
+++ b/src/core/hle/service/nifm/nifm.cpp
@@ -63,12 +63,14 @@ public:
63private: 63private:
64 void Submit(Kernel::HLERequestContext& ctx) { 64 void Submit(Kernel::HLERequestContext& ctx) {
65 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 65 LOG_WARNING(Service_NIFM, "(STUBBED) called");
66
66 IPC::ResponseBuilder rb{ctx, 2}; 67 IPC::ResponseBuilder rb{ctx, 2};
67 rb.Push(RESULT_SUCCESS); 68 rb.Push(RESULT_SUCCESS);
68 } 69 }
69 70
70 void GetRequestState(Kernel::HLERequestContext& ctx) { 71 void GetRequestState(Kernel::HLERequestContext& ctx) {
71 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 72 LOG_WARNING(Service_NIFM, "(STUBBED) called");
73
72 IPC::ResponseBuilder rb{ctx, 3}; 74 IPC::ResponseBuilder rb{ctx, 3};
73 rb.Push(RESULT_SUCCESS); 75 rb.Push(RESULT_SUCCESS);
74 rb.Push<u32>(0); 76 rb.Push<u32>(0);
@@ -76,12 +78,14 @@ private:
76 78
77 void GetResult(Kernel::HLERequestContext& ctx) { 79 void GetResult(Kernel::HLERequestContext& ctx) {
78 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 80 LOG_WARNING(Service_NIFM, "(STUBBED) called");
81
79 IPC::ResponseBuilder rb{ctx, 2}; 82 IPC::ResponseBuilder rb{ctx, 2};
80 rb.Push(RESULT_SUCCESS); 83 rb.Push(RESULT_SUCCESS);
81 } 84 }
82 85
83 void GetSystemEventReadableHandles(Kernel::HLERequestContext& ctx) { 86 void GetSystemEventReadableHandles(Kernel::HLERequestContext& ctx) {
84 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 87 LOG_WARNING(Service_NIFM, "(STUBBED) called");
88
85 IPC::ResponseBuilder rb{ctx, 2, 2}; 89 IPC::ResponseBuilder rb{ctx, 2, 2};
86 rb.Push(RESULT_SUCCESS); 90 rb.Push(RESULT_SUCCESS);
87 rb.PushCopyObjects(event1, event2); 91 rb.PushCopyObjects(event1, event2);
@@ -89,12 +93,14 @@ private:
89 93
90 void Cancel(Kernel::HLERequestContext& ctx) { 94 void Cancel(Kernel::HLERequestContext& ctx) {
91 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 95 LOG_WARNING(Service_NIFM, "(STUBBED) called");
96
92 IPC::ResponseBuilder rb{ctx, 2}; 97 IPC::ResponseBuilder rb{ctx, 2};
93 rb.Push(RESULT_SUCCESS); 98 rb.Push(RESULT_SUCCESS);
94 } 99 }
95 100
96 void SetConnectionConfirmationOption(Kernel::HLERequestContext& ctx) { 101 void SetConnectionConfirmationOption(Kernel::HLERequestContext& ctx) {
97 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 102 LOG_WARNING(Service_NIFM, "(STUBBED) called");
103
98 IPC::ResponseBuilder rb{ctx, 2}; 104 IPC::ResponseBuilder rb{ctx, 2};
99 rb.Push(RESULT_SUCCESS); 105 rb.Push(RESULT_SUCCESS);
100 } 106 }
@@ -122,32 +128,36 @@ private:
122 void GetClientId(Kernel::HLERequestContext& ctx) { 128 void GetClientId(Kernel::HLERequestContext& ctx) {
123 static constexpr u32 client_id = 1; 129 static constexpr u32 client_id = 1;
124 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 130 LOG_WARNING(Service_NIFM, "(STUBBED) called");
131
125 IPC::ResponseBuilder rb{ctx, 4}; 132 IPC::ResponseBuilder rb{ctx, 4};
126 rb.Push(RESULT_SUCCESS); 133 rb.Push(RESULT_SUCCESS);
127 rb.Push<u64>(client_id); // Client ID needs to be non zero otherwise it's considered invalid 134 rb.Push<u64>(client_id); // Client ID needs to be non zero otherwise it's considered invalid
128 } 135 }
129 void CreateScanRequest(Kernel::HLERequestContext& ctx) { 136 void CreateScanRequest(Kernel::HLERequestContext& ctx) {
137 LOG_DEBUG(Service_NIFM, "called");
138
130 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 139 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
131 140
132 rb.Push(RESULT_SUCCESS); 141 rb.Push(RESULT_SUCCESS);
133 rb.PushIpcInterface<IScanRequest>(); 142 rb.PushIpcInterface<IScanRequest>();
134
135 LOG_DEBUG(Service_NIFM, "called");
136 } 143 }
137 void CreateRequest(Kernel::HLERequestContext& ctx) { 144 void CreateRequest(Kernel::HLERequestContext& ctx) {
145 LOG_DEBUG(Service_NIFM, "called");
146
138 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 147 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
139 148
140 rb.Push(RESULT_SUCCESS); 149 rb.Push(RESULT_SUCCESS);
141 rb.PushIpcInterface<IRequest>(); 150 rb.PushIpcInterface<IRequest>();
142
143 LOG_DEBUG(Service_NIFM, "called");
144 } 151 }
145 void RemoveNetworkProfile(Kernel::HLERequestContext& ctx) { 152 void RemoveNetworkProfile(Kernel::HLERequestContext& ctx) {
146 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 153 LOG_WARNING(Service_NIFM, "(STUBBED) called");
154
147 IPC::ResponseBuilder rb{ctx, 2}; 155 IPC::ResponseBuilder rb{ctx, 2};
148 rb.Push(RESULT_SUCCESS); 156 rb.Push(RESULT_SUCCESS);
149 } 157 }
150 void CreateTemporaryNetworkProfile(Kernel::HLERequestContext& ctx) { 158 void CreateTemporaryNetworkProfile(Kernel::HLERequestContext& ctx) {
159 LOG_DEBUG(Service_NIFM, "called");
160
151 ASSERT_MSG(ctx.GetReadBufferSize() == 0x17c, "NetworkProfileData is not the correct size"); 161 ASSERT_MSG(ctx.GetReadBufferSize() == 0x17c, "NetworkProfileData is not the correct size");
152 u128 uuid{}; 162 u128 uuid{};
153 auto buffer = ctx.ReadBuffer(); 163 auto buffer = ctx.ReadBuffer();
@@ -158,23 +168,24 @@ private:
158 rb.Push(RESULT_SUCCESS); 168 rb.Push(RESULT_SUCCESS);
159 rb.PushIpcInterface<INetworkProfile>(); 169 rb.PushIpcInterface<INetworkProfile>();
160 rb.PushRaw<u128>(uuid); 170 rb.PushRaw<u128>(uuid);
161
162 LOG_DEBUG(Service_NIFM, "called");
163 } 171 }
164 void IsWirelessCommunicationEnabled(Kernel::HLERequestContext& ctx) { 172 void IsWirelessCommunicationEnabled(Kernel::HLERequestContext& ctx) {
165 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 173 LOG_WARNING(Service_NIFM, "(STUBBED) called");
174
166 IPC::ResponseBuilder rb{ctx, 3}; 175 IPC::ResponseBuilder rb{ctx, 3};
167 rb.Push(RESULT_SUCCESS); 176 rb.Push(RESULT_SUCCESS);
168 rb.Push<u8>(0); 177 rb.Push<u8>(0);
169 } 178 }
170 void IsEthernetCommunicationEnabled(Kernel::HLERequestContext& ctx) { 179 void IsEthernetCommunicationEnabled(Kernel::HLERequestContext& ctx) {
171 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 180 LOG_WARNING(Service_NIFM, "(STUBBED) called");
181
172 IPC::ResponseBuilder rb{ctx, 3}; 182 IPC::ResponseBuilder rb{ctx, 3};
173 rb.Push(RESULT_SUCCESS); 183 rb.Push(RESULT_SUCCESS);
174 rb.Push<u8>(0); 184 rb.Push<u8>(0);
175 } 185 }
176 void IsAnyInternetRequestAccepted(Kernel::HLERequestContext& ctx) { 186 void IsAnyInternetRequestAccepted(Kernel::HLERequestContext& ctx) {
177 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 187 LOG_WARNING(Service_NIFM, "(STUBBED) called");
188
178 IPC::ResponseBuilder rb{ctx, 3}; 189 IPC::ResponseBuilder rb{ctx, 3};
179 rb.Push(RESULT_SUCCESS); 190 rb.Push(RESULT_SUCCESS);
180 rb.Push<u8>(0); 191 rb.Push<u8>(0);
@@ -235,17 +246,19 @@ public:
235 } 246 }
236 247
237 void CreateGeneralServiceOld(Kernel::HLERequestContext& ctx) { 248 void CreateGeneralServiceOld(Kernel::HLERequestContext& ctx) {
249 LOG_DEBUG(Service_NIFM, "called");
250
238 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 251 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
239 rb.Push(RESULT_SUCCESS); 252 rb.Push(RESULT_SUCCESS);
240 rb.PushIpcInterface<IGeneralService>(); 253 rb.PushIpcInterface<IGeneralService>();
241 LOG_DEBUG(Service_NIFM, "called");
242 } 254 }
243 255
244 void CreateGeneralService(Kernel::HLERequestContext& ctx) { 256 void CreateGeneralService(Kernel::HLERequestContext& ctx) {
257 LOG_DEBUG(Service_NIFM, "called");
258
245 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 259 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
246 rb.Push(RESULT_SUCCESS); 260 rb.Push(RESULT_SUCCESS);
247 rb.PushIpcInterface<IGeneralService>(); 261 rb.PushIpcInterface<IGeneralService>();
248 LOG_DEBUG(Service_NIFM, "called");
249 } 262 }
250}; 263};
251 264
diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp
index 18091c9bb..1bbccd444 100644
--- a/src/core/hle/service/nim/nim.cpp
+++ b/src/core/hle/service/nim/nim.cpp
@@ -148,47 +148,53 @@ private:
148 148
149 void StartTask(Kernel::HLERequestContext& ctx) { 149 void StartTask(Kernel::HLERequestContext& ctx) {
150 // No need to connect to the internet, just finish the task straight away. 150 // No need to connect to the internet, just finish the task straight away.
151 LOG_DEBUG(Service_NIM, "called");
152
151 finished_event->Signal(); 153 finished_event->Signal();
152 IPC::ResponseBuilder rb{ctx, 2}; 154 IPC::ResponseBuilder rb{ctx, 2};
153 rb.Push(RESULT_SUCCESS); 155 rb.Push(RESULT_SUCCESS);
154 LOG_DEBUG(Service_NIM, "called");
155 } 156 }
156 157
157 void GetFinishNotificationEvent(Kernel::HLERequestContext& ctx) { 158 void GetFinishNotificationEvent(Kernel::HLERequestContext& ctx) {
159 LOG_DEBUG(Service_NIM, "called");
160
158 IPC::ResponseBuilder rb{ctx, 2, 1}; 161 IPC::ResponseBuilder rb{ctx, 2, 1};
159 rb.Push(RESULT_SUCCESS); 162 rb.Push(RESULT_SUCCESS);
160 rb.PushCopyObjects(finished_event); 163 rb.PushCopyObjects(finished_event);
161 LOG_DEBUG(Service_NIM, "called");
162 } 164 }
163 165
164 void GetResult(Kernel::HLERequestContext& ctx) { 166 void GetResult(Kernel::HLERequestContext& ctx) {
167 LOG_DEBUG(Service_NIM, "called");
168
165 IPC::ResponseBuilder rb{ctx, 2}; 169 IPC::ResponseBuilder rb{ctx, 2};
166 rb.Push(RESULT_SUCCESS); 170 rb.Push(RESULT_SUCCESS);
167 LOG_DEBUG(Service_NIM, "called");
168 } 171 }
169 172
170 void Cancel(Kernel::HLERequestContext& ctx) { 173 void Cancel(Kernel::HLERequestContext& ctx) {
174 LOG_DEBUG(Service_NIM, "called");
175
171 finished_event->Clear(); 176 finished_event->Clear();
172 IPC::ResponseBuilder rb{ctx, 2}; 177 IPC::ResponseBuilder rb{ctx, 2};
173 rb.Push(RESULT_SUCCESS); 178 rb.Push(RESULT_SUCCESS);
174 LOG_DEBUG(Service_NIM, "called");
175 } 179 }
176 180
177 void IsProcessing(Kernel::HLERequestContext& ctx) { 181 void IsProcessing(Kernel::HLERequestContext& ctx) {
182 LOG_DEBUG(Service_NIM, "called");
183
178 IPC::ResponseBuilder rb{ctx, 3}; 184 IPC::ResponseBuilder rb{ctx, 3};
179 rb.Push(RESULT_SUCCESS); 185 rb.Push(RESULT_SUCCESS);
180 rb.PushRaw<u32>(0); // We instantly process the request 186 rb.PushRaw<u32>(0); // We instantly process the request
181 LOG_DEBUG(Service_NIM, "called");
182 } 187 }
183 188
184 void GetServerTime(Kernel::HLERequestContext& ctx) { 189 void GetServerTime(Kernel::HLERequestContext& ctx) {
190 LOG_DEBUG(Service_NIM, "called");
191
185 const s64 server_time{std::chrono::duration_cast<std::chrono::seconds>( 192 const s64 server_time{std::chrono::duration_cast<std::chrono::seconds>(
186 std::chrono::system_clock::now().time_since_epoch()) 193 std::chrono::system_clock::now().time_since_epoch())
187 .count()}; 194 .count()};
188 IPC::ResponseBuilder rb{ctx, 4}; 195 IPC::ResponseBuilder rb{ctx, 4};
189 rb.Push(RESULT_SUCCESS); 196 rb.Push(RESULT_SUCCESS);
190 rb.PushRaw<s64>(server_time); 197 rb.PushRaw<s64>(server_time);
191 LOG_DEBUG(Service_NIM, "called");
192 } 198 }
193}; 199};
194 200
@@ -208,23 +214,26 @@ public:
208 214
209private: 215private:
210 void OpenEnsureNetworkClockAvailabilityService(Kernel::HLERequestContext& ctx) { 216 void OpenEnsureNetworkClockAvailabilityService(Kernel::HLERequestContext& ctx) {
217 LOG_DEBUG(Service_NIM, "called");
218
211 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 219 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
212 rb.Push(RESULT_SUCCESS); 220 rb.Push(RESULT_SUCCESS);
213 rb.PushIpcInterface<IEnsureNetworkClockAvailabilityService>(); 221 rb.PushIpcInterface<IEnsureNetworkClockAvailabilityService>();
214 LOG_DEBUG(Service_NIM, "called");
215 } 222 }
216 223
217 // TODO(ogniK): Do we need these? 224 // TODO(ogniK): Do we need these?
218 void SuspendAutonomicTimeCorrection(Kernel::HLERequestContext& ctx) { 225 void SuspendAutonomicTimeCorrection(Kernel::HLERequestContext& ctx) {
226 LOG_WARNING(Service_NIM, "(STUBBED) called");
227
219 IPC::ResponseBuilder rb{ctx, 2}; 228 IPC::ResponseBuilder rb{ctx, 2};
220 rb.Push(RESULT_SUCCESS); 229 rb.Push(RESULT_SUCCESS);
221 LOG_WARNING(Service_NIM, "(STUBBED) called");
222 } 230 }
223 231
224 void ResumeAutonomicTimeCorrection(Kernel::HLERequestContext& ctx) { 232 void ResumeAutonomicTimeCorrection(Kernel::HLERequestContext& ctx) {
233 LOG_WARNING(Service_NIM, "(STUBBED) called");
234
225 IPC::ResponseBuilder rb{ctx, 2}; 235 IPC::ResponseBuilder rb{ctx, 2};
226 rb.Push(RESULT_SUCCESS); 236 rb.Push(RESULT_SUCCESS);
227 LOG_WARNING(Service_NIM, "(STUBBED) called");
228 } 237 }
229}; 238};
230 239
diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp
index 1d2978f24..2663f56b1 100644
--- a/src/core/hle/service/ns/ns.cpp
+++ b/src/core/hle/service/ns/ns.cpp
@@ -433,11 +433,11 @@ public:
433private: 433private:
434 template <typename T> 434 template <typename T>
435 void PushInterface(Kernel::HLERequestContext& ctx) { 435 void PushInterface(Kernel::HLERequestContext& ctx) {
436 LOG_DEBUG(Service_NS, "called");
437
436 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 438 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
437 rb.Push(RESULT_SUCCESS); 439 rb.Push(RESULT_SUCCESS);
438 rb.PushIpcInterface<T>(); 440 rb.PushIpcInterface<T>();
439
440 LOG_DEBUG(Service_NS, "called");
441 } 441 }
442}; 442};
443 443
@@ -526,11 +526,11 @@ public:
526 526
527private: 527private:
528 void OpenSystemUpdateControl(Kernel::HLERequestContext& ctx) { 528 void OpenSystemUpdateControl(Kernel::HLERequestContext& ctx) {
529 LOG_DEBUG(Service_NS, "called");
530
529 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 531 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
530 rb.Push(RESULT_SUCCESS); 532 rb.Push(RESULT_SUCCESS);
531 rb.PushIpcInterface<ISystemUpdateControl>(); 533 rb.PushIpcInterface<ISystemUpdateControl>();
532
533 LOG_DEBUG(Service_NS, "called");
534 } 534 }
535}; 535};
536 536
diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp
index 1066bf505..ad176f89d 100644
--- a/src/core/hle/service/ns/pl_u.cpp
+++ b/src/core/hle/service/ns/pl_u.cpp
@@ -281,6 +281,7 @@ void PL_U::RequestLoad(Kernel::HLERequestContext& ctx) {
281 const u32 shared_font_type{rp.Pop<u32>()}; 281 const u32 shared_font_type{rp.Pop<u32>()};
282 // Games don't call this so all fonts should be loaded 282 // Games don't call this so all fonts should be loaded
283 LOG_DEBUG(Service_NS, "called, shared_font_type={}", shared_font_type); 283 LOG_DEBUG(Service_NS, "called, shared_font_type={}", shared_font_type);
284
284 IPC::ResponseBuilder rb{ctx, 2}; 285 IPC::ResponseBuilder rb{ctx, 2};
285 rb.Push(RESULT_SUCCESS); 286 rb.Push(RESULT_SUCCESS);
286} 287}
@@ -288,8 +289,8 @@ void PL_U::RequestLoad(Kernel::HLERequestContext& ctx) {
288void PL_U::GetLoadState(Kernel::HLERequestContext& ctx) { 289void PL_U::GetLoadState(Kernel::HLERequestContext& ctx) {
289 IPC::RequestParser rp{ctx}; 290 IPC::RequestParser rp{ctx};
290 const u32 font_id{rp.Pop<u32>()}; 291 const u32 font_id{rp.Pop<u32>()};
291
292 LOG_DEBUG(Service_NS, "called, font_id={}", font_id); 292 LOG_DEBUG(Service_NS, "called, font_id={}", font_id);
293
293 IPC::ResponseBuilder rb{ctx, 3}; 294 IPC::ResponseBuilder rb{ctx, 3};
294 rb.Push(RESULT_SUCCESS); 295 rb.Push(RESULT_SUCCESS);
295 rb.Push<u32>(static_cast<u32>(LoadState::Done)); 296 rb.Push<u32>(static_cast<u32>(LoadState::Done));
@@ -298,8 +299,8 @@ void PL_U::GetLoadState(Kernel::HLERequestContext& ctx) {
298void PL_U::GetSize(Kernel::HLERequestContext& ctx) { 299void PL_U::GetSize(Kernel::HLERequestContext& ctx) {
299 IPC::RequestParser rp{ctx}; 300 IPC::RequestParser rp{ctx};
300 const u32 font_id{rp.Pop<u32>()}; 301 const u32 font_id{rp.Pop<u32>()};
301
302 LOG_DEBUG(Service_NS, "called, font_id={}", font_id); 302 LOG_DEBUG(Service_NS, "called, font_id={}", font_id);
303
303 IPC::ResponseBuilder rb{ctx, 3}; 304 IPC::ResponseBuilder rb{ctx, 3};
304 rb.Push(RESULT_SUCCESS); 305 rb.Push(RESULT_SUCCESS);
305 rb.Push<u32>(impl->GetSharedFontRegion(font_id).size); 306 rb.Push<u32>(impl->GetSharedFontRegion(font_id).size);
@@ -308,8 +309,8 @@ void PL_U::GetSize(Kernel::HLERequestContext& ctx) {
308void PL_U::GetSharedMemoryAddressOffset(Kernel::HLERequestContext& ctx) { 309void PL_U::GetSharedMemoryAddressOffset(Kernel::HLERequestContext& ctx) {
309 IPC::RequestParser rp{ctx}; 310 IPC::RequestParser rp{ctx};
310 const u32 font_id{rp.Pop<u32>()}; 311 const u32 font_id{rp.Pop<u32>()};
311
312 LOG_DEBUG(Service_NS, "called, font_id={}", font_id); 312 LOG_DEBUG(Service_NS, "called, font_id={}", font_id);
313
313 IPC::ResponseBuilder rb{ctx, 3}; 314 IPC::ResponseBuilder rb{ctx, 3};
314 rb.Push(RESULT_SUCCESS); 315 rb.Push(RESULT_SUCCESS);
315 rb.Push<u32>(impl->GetSharedFontRegion(font_id).offset); 316 rb.Push<u32>(impl->GetSharedFontRegion(font_id).offset);
@@ -317,6 +318,7 @@ void PL_U::GetSharedMemoryAddressOffset(Kernel::HLERequestContext& ctx) {
317 318
318void PL_U::GetSharedMemoryNativeHandle(Kernel::HLERequestContext& ctx) { 319void PL_U::GetSharedMemoryNativeHandle(Kernel::HLERequestContext& ctx) {
319 // Map backing memory for the font data 320 // Map backing memory for the font data
321 LOG_DEBUG(Service_NS, "called");
320 Core::CurrentProcess()->VMManager().MapMemoryBlock(SHARED_FONT_MEM_VADDR, impl->shared_font, 0, 322 Core::CurrentProcess()->VMManager().MapMemoryBlock(SHARED_FONT_MEM_VADDR, impl->shared_font, 0,
321 SHARED_FONT_MEM_SIZE, 323 SHARED_FONT_MEM_SIZE,
322 Kernel::MemoryState::Shared); 324 Kernel::MemoryState::Shared);
@@ -328,7 +330,6 @@ void PL_U::GetSharedMemoryNativeHandle(Kernel::HLERequestContext& ctx) {
328 Kernel::MemoryPermission::Read, SHARED_FONT_MEM_VADDR, Kernel::MemoryRegion::BASE, 330 Kernel::MemoryPermission::Read, SHARED_FONT_MEM_VADDR, Kernel::MemoryRegion::BASE,
329 "PL_U:shared_font_mem"); 331 "PL_U:shared_font_mem");
330 332
331 LOG_DEBUG(Service_NS, "called");
332 IPC::ResponseBuilder rb{ctx, 2, 1}; 333 IPC::ResponseBuilder rb{ctx, 2, 1};
333 rb.Push(RESULT_SUCCESS); 334 rb.Push(RESULT_SUCCESS);
334 rb.PushCopyObjects(impl->shared_font_mem); 335 rb.PushCopyObjects(impl->shared_font_mem);
@@ -338,6 +339,7 @@ void PL_U::GetSharedFontInOrderOfPriority(Kernel::HLERequestContext& ctx) {
338 IPC::RequestParser rp{ctx}; 339 IPC::RequestParser rp{ctx};
339 const u64 language_code{rp.Pop<u64>()}; // TODO(ogniK): Find out what this is used for 340 const u64 language_code{rp.Pop<u64>()}; // TODO(ogniK): Find out what this is used for
340 LOG_DEBUG(Service_NS, "called, language_code={:X}", language_code); 341 LOG_DEBUG(Service_NS, "called, language_code={:X}", language_code);
342
341 IPC::ResponseBuilder rb{ctx, 4}; 343 IPC::ResponseBuilder rb{ctx, 4};
342 std::vector<u32> font_codes; 344 std::vector<u32> font_codes;
343 std::vector<u32> font_offsets; 345 std::vector<u32> font_offsets;
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp
index c41ef7058..466db7ccd 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp
@@ -54,6 +54,7 @@ u32 nvhost_as_gpu::InitalizeEx(const std::vector<u8>& input, std::vector<u8>& ou
54 IoctlInitalizeEx params{}; 54 IoctlInitalizeEx params{};
55 std::memcpy(&params, input.data(), input.size()); 55 std::memcpy(&params, input.data(), input.size());
56 LOG_WARNING(Service_NVDRV, "(STUBBED) called, big_page_size=0x{:X}", params.big_page_size); 56 LOG_WARNING(Service_NVDRV, "(STUBBED) called, big_page_size=0x{:X}", params.big_page_size);
57
57 return 0; 58 return 0;
58} 59}
59 60
@@ -191,6 +192,7 @@ u32 nvhost_as_gpu::BindChannel(const std::vector<u8>& input, std::vector<u8>& ou
191 IoctlBindChannel params{}; 192 IoctlBindChannel params{};
192 std::memcpy(&params, input.data(), input.size()); 193 std::memcpy(&params, input.data(), input.size());
193 LOG_DEBUG(Service_NVDRV, "called, fd={:X}", params.fd); 194 LOG_DEBUG(Service_NVDRV, "called, fd={:X}", params.fd);
195
194 channel = params.fd; 196 channel = params.fd;
195 return 0; 197 return 0;
196} 198}
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp
index 792d26e52..d57a54ee8 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp
@@ -103,6 +103,7 @@ u32 nvhost_ctrl_gpu::GetTPCMasks(const std::vector<u8>& input, std::vector<u8>&
103 103
104u32 nvhost_ctrl_gpu::GetActiveSlotMask(const std::vector<u8>& input, std::vector<u8>& output) { 104u32 nvhost_ctrl_gpu::GetActiveSlotMask(const std::vector<u8>& input, std::vector<u8>& output) {
105 LOG_DEBUG(Service_NVDRV, "called"); 105 LOG_DEBUG(Service_NVDRV, "called");
106
106 IoctlActiveSlotMask params{}; 107 IoctlActiveSlotMask params{};
107 if (input.size() > 0) { 108 if (input.size() > 0) {
108 std::memcpy(&params, input.data(), input.size()); 109 std::memcpy(&params, input.data(), input.size());
@@ -115,6 +116,7 @@ u32 nvhost_ctrl_gpu::GetActiveSlotMask(const std::vector<u8>& input, std::vector
115 116
116u32 nvhost_ctrl_gpu::ZCullGetCtxSize(const std::vector<u8>& input, std::vector<u8>& output) { 117u32 nvhost_ctrl_gpu::ZCullGetCtxSize(const std::vector<u8>& input, std::vector<u8>& output) {
117 LOG_DEBUG(Service_NVDRV, "called"); 118 LOG_DEBUG(Service_NVDRV, "called");
119
118 IoctlZcullGetCtxSize params{}; 120 IoctlZcullGetCtxSize params{};
119 if (input.size() > 0) { 121 if (input.size() > 0) {
120 std::memcpy(&params, input.data(), input.size()); 122 std::memcpy(&params, input.data(), input.size());
@@ -126,6 +128,7 @@ u32 nvhost_ctrl_gpu::ZCullGetCtxSize(const std::vector<u8>& input, std::vector<u
126 128
127u32 nvhost_ctrl_gpu::ZCullGetInfo(const std::vector<u8>& input, std::vector<u8>& output) { 129u32 nvhost_ctrl_gpu::ZCullGetInfo(const std::vector<u8>& input, std::vector<u8>& output) {
128 LOG_DEBUG(Service_NVDRV, "called"); 130 LOG_DEBUG(Service_NVDRV, "called");
131
129 IoctlNvgpuGpuZcullGetInfoArgs params{}; 132 IoctlNvgpuGpuZcullGetInfoArgs params{};
130 133
131 if (input.size() > 0) { 134 if (input.size() > 0) {
@@ -148,6 +151,7 @@ u32 nvhost_ctrl_gpu::ZCullGetInfo(const std::vector<u8>& input, std::vector<u8>&
148 151
149u32 nvhost_ctrl_gpu::ZBCSetTable(const std::vector<u8>& input, std::vector<u8>& output) { 152u32 nvhost_ctrl_gpu::ZBCSetTable(const std::vector<u8>& input, std::vector<u8>& output) {
150 LOG_WARNING(Service_NVDRV, "(STUBBED) called"); 153 LOG_WARNING(Service_NVDRV, "(STUBBED) called");
154
151 IoctlZbcSetTable params{}; 155 IoctlZbcSetTable params{};
152 std::memcpy(&params, input.data(), input.size()); 156 std::memcpy(&params, input.data(), input.size());
153 // TODO(ogniK): What does this even actually do? 157 // TODO(ogniK): What does this even actually do?
@@ -157,6 +161,7 @@ u32 nvhost_ctrl_gpu::ZBCSetTable(const std::vector<u8>& input, std::vector<u8>&
157 161
158u32 nvhost_ctrl_gpu::ZBCQueryTable(const std::vector<u8>& input, std::vector<u8>& output) { 162u32 nvhost_ctrl_gpu::ZBCQueryTable(const std::vector<u8>& input, std::vector<u8>& output) {
159 LOG_WARNING(Service_NVDRV, "(STUBBED) called"); 163 LOG_WARNING(Service_NVDRV, "(STUBBED) called");
164
160 IoctlZbcQueryTable params{}; 165 IoctlZbcQueryTable params{};
161 std::memcpy(&params, input.data(), input.size()); 166 std::memcpy(&params, input.data(), input.size());
162 // TODO : To implement properly 167 // TODO : To implement properly
@@ -166,6 +171,7 @@ u32 nvhost_ctrl_gpu::ZBCQueryTable(const std::vector<u8>& input, std::vector<u8>
166 171
167u32 nvhost_ctrl_gpu::FlushL2(const std::vector<u8>& input, std::vector<u8>& output) { 172u32 nvhost_ctrl_gpu::FlushL2(const std::vector<u8>& input, std::vector<u8>& output) {
168 LOG_WARNING(Service_NVDRV, "(STUBBED) called"); 173 LOG_WARNING(Service_NVDRV, "(STUBBED) called");
174
169 IoctlFlushL2 params{}; 175 IoctlFlushL2 params{};
170 std::memcpy(&params, input.data(), input.size()); 176 std::memcpy(&params, input.data(), input.size());
171 // TODO : To implement properly 177 // TODO : To implement properly
@@ -175,6 +181,7 @@ u32 nvhost_ctrl_gpu::FlushL2(const std::vector<u8>& input, std::vector<u8>& outp
175 181
176u32 nvhost_ctrl_gpu::GetGpuTime(const std::vector<u8>& input, std::vector<u8>& output) { 182u32 nvhost_ctrl_gpu::GetGpuTime(const std::vector<u8>& input, std::vector<u8>& output) {
177 LOG_DEBUG(Service_NVDRV, "called"); 183 LOG_DEBUG(Service_NVDRV, "called");
184
178 IoctlGetGpuTime params{}; 185 IoctlGetGpuTime params{};
179 std::memcpy(&params, input.data(), input.size()); 186 std::memcpy(&params, input.data(), input.size());
180 params.gpu_time = CoreTiming::cyclesToNs(CoreTiming::GetTicks()); 187 params.gpu_time = CoreTiming::cyclesToNs(CoreTiming::GetTicks());
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
index 874d5e1c3..dbeb26547 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
@@ -61,12 +61,14 @@ u32 nvhost_gpu::SetNVMAPfd(const std::vector<u8>& input, std::vector<u8>& output
61 IoctlSetNvmapFD params{}; 61 IoctlSetNvmapFD params{};
62 std::memcpy(&params, input.data(), input.size()); 62 std::memcpy(&params, input.data(), input.size());
63 LOG_DEBUG(Service_NVDRV, "called, fd={}", params.nvmap_fd); 63 LOG_DEBUG(Service_NVDRV, "called, fd={}", params.nvmap_fd);
64
64 nvmap_fd = params.nvmap_fd; 65 nvmap_fd = params.nvmap_fd;
65 return 0; 66 return 0;
66} 67}
67 68
68u32 nvhost_gpu::SetClientData(const std::vector<u8>& input, std::vector<u8>& output) { 69u32 nvhost_gpu::SetClientData(const std::vector<u8>& input, std::vector<u8>& output) {
69 LOG_DEBUG(Service_NVDRV, "called"); 70 LOG_DEBUG(Service_NVDRV, "called");
71
70 IoctlClientData params{}; 72 IoctlClientData params{};
71 std::memcpy(&params, input.data(), input.size()); 73 std::memcpy(&params, input.data(), input.size());
72 user_data = params.data; 74 user_data = params.data;
@@ -75,6 +77,7 @@ u32 nvhost_gpu::SetClientData(const std::vector<u8>& input, std::vector<u8>& out
75 77
76u32 nvhost_gpu::GetClientData(const std::vector<u8>& input, std::vector<u8>& output) { 78u32 nvhost_gpu::GetClientData(const std::vector<u8>& input, std::vector<u8>& output) {
77 LOG_DEBUG(Service_NVDRV, "called"); 79 LOG_DEBUG(Service_NVDRV, "called");
80
78 IoctlClientData params{}; 81 IoctlClientData params{};
79 std::memcpy(&params, input.data(), input.size()); 82 std::memcpy(&params, input.data(), input.size());
80 params.data = user_data; 83 params.data = user_data;
@@ -86,6 +89,7 @@ u32 nvhost_gpu::ZCullBind(const std::vector<u8>& input, std::vector<u8>& output)
86 std::memcpy(&zcull_params, input.data(), input.size()); 89 std::memcpy(&zcull_params, input.data(), input.size());
87 LOG_DEBUG(Service_NVDRV, "called, gpu_va={:X}, mode={:X}", zcull_params.gpu_va, 90 LOG_DEBUG(Service_NVDRV, "called, gpu_va={:X}, mode={:X}", zcull_params.gpu_va,
88 zcull_params.mode); 91 zcull_params.mode);
92
89 std::memcpy(output.data(), &zcull_params, output.size()); 93 std::memcpy(output.data(), &zcull_params, output.size());
90 return 0; 94 return 0;
91} 95}
@@ -95,6 +99,7 @@ u32 nvhost_gpu::SetErrorNotifier(const std::vector<u8>& input, std::vector<u8>&
95 std::memcpy(&params, input.data(), input.size()); 99 std::memcpy(&params, input.data(), input.size());
96 LOG_WARNING(Service_NVDRV, "(STUBBED) called, offset={:X}, size={:X}, mem={:X}", params.offset, 100 LOG_WARNING(Service_NVDRV, "(STUBBED) called, offset={:X}, size={:X}, mem={:X}", params.offset,
97 params.size, params.mem); 101 params.size, params.mem);
102
98 std::memcpy(output.data(), &params, output.size()); 103 std::memcpy(output.data(), &params, output.size());
99 return 0; 104 return 0;
100} 105}
@@ -102,6 +107,7 @@ u32 nvhost_gpu::SetErrorNotifier(const std::vector<u8>& input, std::vector<u8>&
102u32 nvhost_gpu::SetChannelPriority(const std::vector<u8>& input, std::vector<u8>& output) { 107u32 nvhost_gpu::SetChannelPriority(const std::vector<u8>& input, std::vector<u8>& output) {
103 std::memcpy(&channel_priority, input.data(), input.size()); 108 std::memcpy(&channel_priority, input.data(), input.size());
104 LOG_DEBUG(Service_NVDRV, "(STUBBED) called, priority={:X}", channel_priority); 109 LOG_DEBUG(Service_NVDRV, "(STUBBED) called, priority={:X}", channel_priority);
110
105 return 0; 111 return 0;
106} 112}
107 113
@@ -113,6 +119,7 @@ u32 nvhost_gpu::AllocGPFIFOEx2(const std::vector<u8>& input, std::vector<u8>& ou
113 "unk1={:X}, unk2={:X}, unk3={:X}", 119 "unk1={:X}, unk2={:X}, unk3={:X}",
114 params.num_entries, params.flags, params.unk0, params.unk1, params.unk2, 120 params.num_entries, params.flags, params.unk0, params.unk1, params.unk2,
115 params.unk3); 121 params.unk3);
122
116 params.fence_out.id = 0; 123 params.fence_out.id = 0;
117 params.fence_out.value = 0; 124 params.fence_out.value = 0;
118 std::memcpy(output.data(), &params, output.size()); 125 std::memcpy(output.data(), &params, output.size());
@@ -124,6 +131,7 @@ u32 nvhost_gpu::AllocateObjectContext(const std::vector<u8>& input, std::vector<
124 std::memcpy(&params, input.data(), input.size()); 131 std::memcpy(&params, input.data(), input.size());
125 LOG_WARNING(Service_NVDRV, "(STUBBED) called, class_num={:X}, flags={:X}", params.class_num, 132 LOG_WARNING(Service_NVDRV, "(STUBBED) called, class_num={:X}, flags={:X}", params.class_num,
126 params.flags); 133 params.flags);
134
127 params.obj_id = 0x0; 135 params.obj_id = 0x0;
128 std::memcpy(output.data(), &params, output.size()); 136 std::memcpy(output.data(), &params, output.size());
129 return 0; 137 return 0;
@@ -179,6 +187,7 @@ u32 nvhost_gpu::GetWaitbase(const std::vector<u8>& input, std::vector<u8>& outpu
179 IoctlGetWaitbase params{}; 187 IoctlGetWaitbase params{};
180 std::memcpy(&params, input.data(), sizeof(IoctlGetWaitbase)); 188 std::memcpy(&params, input.data(), sizeof(IoctlGetWaitbase));
181 LOG_INFO(Service_NVDRV, "called, unknown=0x{:X}", params.unknown); 189 LOG_INFO(Service_NVDRV, "called, unknown=0x{:X}", params.unknown);
190
182 params.value = 0; // Seems to be hard coded at 0 191 params.value = 0; // Seems to be hard coded at 0
183 std::memcpy(output.data(), &params, output.size()); 192 std::memcpy(output.data(), &params, output.size());
184 return 0; 193 return 0;
@@ -188,6 +197,7 @@ u32 nvhost_gpu::ChannelSetTimeout(const std::vector<u8>& input, std::vector<u8>&
188 IoctlChannelSetTimeout params{}; 197 IoctlChannelSetTimeout params{};
189 std::memcpy(&params, input.data(), sizeof(IoctlChannelSetTimeout)); 198 std::memcpy(&params, input.data(), sizeof(IoctlChannelSetTimeout));
190 LOG_INFO(Service_NVDRV, "called, timeout=0x{:X}", params.timeout); 199 LOG_INFO(Service_NVDRV, "called, timeout=0x{:X}", params.timeout);
200
191 return 0; 201 return 0;
192} 202}
193 203
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp
index 46dbbc37c..f5e8ea7c3 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp
@@ -30,6 +30,7 @@ u32 nvhost_nvdec::SetNVMAPfd(const std::vector<u8>& input, std::vector<u8>& outp
30 IoctlSetNvmapFD params{}; 30 IoctlSetNvmapFD params{};
31 std::memcpy(&params, input.data(), input.size()); 31 std::memcpy(&params, input.data(), input.size());
32 LOG_DEBUG(Service_NVDRV, "called, fd={}", params.nvmap_fd); 32 LOG_DEBUG(Service_NVDRV, "called, fd={}", params.nvmap_fd);
33
33 nvmap_fd = params.nvmap_fd; 34 nvmap_fd = params.nvmap_fd;
34 return 0; 35 return 0;
35} 36}
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.cpp b/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.cpp
index c67f934f6..3e0951ab0 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_nvjpg.cpp
@@ -30,6 +30,7 @@ u32 nvhost_nvjpg::SetNVMAPfd(const std::vector<u8>& input, std::vector<u8>& outp
30 IoctlSetNvmapFD params{}; 30 IoctlSetNvmapFD params{};
31 std::memcpy(&params, input.data(), input.size()); 31 std::memcpy(&params, input.data(), input.size());
32 LOG_DEBUG(Service_NVDRV, "called, fd={}", params.nvmap_fd); 32 LOG_DEBUG(Service_NVDRV, "called, fd={}", params.nvmap_fd);
33
33 nvmap_fd = params.nvmap_fd; 34 nvmap_fd = params.nvmap_fd;
34 return 0; 35 return 0;
35} 36}
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp b/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp
index 727b9fee4..d544f0f31 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_vic.cpp
@@ -30,6 +30,7 @@ u32 nvhost_vic::SetNVMAPfd(const std::vector<u8>& input, std::vector<u8>& output
30 IoctlSetNvmapFD params{}; 30 IoctlSetNvmapFD params{};
31 std::memcpy(&params, input.data(), input.size()); 31 std::memcpy(&params, input.data(), input.size());
32 LOG_DEBUG(Service_NVDRV, "called, fd={}", params.nvmap_fd); 32 LOG_DEBUG(Service_NVDRV, "called, fd={}", params.nvmap_fd);
33
33 nvmap_fd = params.nvmap_fd; 34 nvmap_fd = params.nvmap_fd;
34 return 0; 35 return 0;
35} 36}
diff --git a/src/core/hle/service/nvdrv/devices/nvmap.cpp b/src/core/hle/service/nvdrv/devices/nvmap.cpp
index 43651d8a6..85ba5d4b7 100644
--- a/src/core/hle/service/nvdrv/devices/nvmap.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvmap.cpp
@@ -54,6 +54,7 @@ u32 nvmap::IocCreate(const std::vector<u8>& input, std::vector<u8>& output) {
54 LOG_DEBUG(Service_NVDRV, "size=0x{:08X}", params.size); 54 LOG_DEBUG(Service_NVDRV, "size=0x{:08X}", params.size);
55 55
56 if (!params.size) { 56 if (!params.size) {
57 LOG_ERROR(Service_NVDRV, "Size is 0");
57 return static_cast<u32>(NvErrCodes::InvalidValue); 58 return static_cast<u32>(NvErrCodes::InvalidValue);
58 } 59 }
59 // Create a new nvmap object and obtain a handle to it. 60 // Create a new nvmap object and obtain a handle to it.
@@ -78,10 +79,12 @@ u32 nvmap::IocAlloc(const std::vector<u8>& input, std::vector<u8>& output) {
78 LOG_DEBUG(Service_NVDRV, "called, addr={:X}", params.addr); 79 LOG_DEBUG(Service_NVDRV, "called, addr={:X}", params.addr);
79 80
80 if (!params.handle) { 81 if (!params.handle) {
82 LOG_ERROR(Service_NVDRV, "Handle is zero");
81 return static_cast<u32>(NvErrCodes::InvalidValue); 83 return static_cast<u32>(NvErrCodes::InvalidValue);
82 } 84 }
83 85
84 if ((params.align - 1) & params.align) { 86 if ((params.align - 1) & params.align) {
87 LOG_ERROR(Service_NVDRV, "Incorrect alignment");
85 return static_cast<u32>(NvErrCodes::InvalidValue); 88 return static_cast<u32>(NvErrCodes::InvalidValue);
86 } 89 }
87 90
@@ -92,10 +95,12 @@ u32 nvmap::IocAlloc(const std::vector<u8>& input, std::vector<u8>& output) {
92 95
93 auto object = GetObject(params.handle); 96 auto object = GetObject(params.handle);
94 if (!object) { 97 if (!object) {
98 LOG_ERROR(Service_NVDRV, "Object does not exist");
95 return static_cast<u32>(NvErrCodes::InvalidValue); 99 return static_cast<u32>(NvErrCodes::InvalidValue);
96 } 100 }
97 101
98 if (object->status == Object::Status::Allocated) { 102 if (object->status == Object::Status::Allocated) {
103 LOG_ERROR(Service_NVDRV, "Object is already allocated");
99 return static_cast<u32>(NvErrCodes::OperationNotPermitted); 104 return static_cast<u32>(NvErrCodes::OperationNotPermitted);
100 } 105 }
101 106
@@ -116,11 +121,13 @@ u32 nvmap::IocGetId(const std::vector<u8>& input, std::vector<u8>& output) {
116 LOG_WARNING(Service_NVDRV, "called"); 121 LOG_WARNING(Service_NVDRV, "called");
117 122
118 if (!params.handle) { 123 if (!params.handle) {
124 LOG_ERROR(Service_NVDRV, "Handle is zero");
119 return static_cast<u32>(NvErrCodes::InvalidValue); 125 return static_cast<u32>(NvErrCodes::InvalidValue);
120 } 126 }
121 127
122 auto object = GetObject(params.handle); 128 auto object = GetObject(params.handle);
123 if (!object) { 129 if (!object) {
130 LOG_ERROR(Service_NVDRV, "Object does not exist");
124 return static_cast<u32>(NvErrCodes::OperationNotPermitted); 131 return static_cast<u32>(NvErrCodes::OperationNotPermitted);
125 } 132 }
126 133
@@ -139,11 +146,13 @@ u32 nvmap::IocFromId(const std::vector<u8>& input, std::vector<u8>& output) {
139 auto itr = std::find_if(handles.begin(), handles.end(), 146 auto itr = std::find_if(handles.begin(), handles.end(),
140 [&](const auto& entry) { return entry.second->id == params.id; }); 147 [&](const auto& entry) { return entry.second->id == params.id; });
141 if (itr == handles.end()) { 148 if (itr == handles.end()) {
149 LOG_ERROR(Service_NVDRV, "Object does not exist");
142 return static_cast<u32>(NvErrCodes::InvalidValue); 150 return static_cast<u32>(NvErrCodes::InvalidValue);
143 } 151 }
144 152
145 auto& object = itr->second; 153 auto& object = itr->second;
146 if (object->status != Object::Status::Allocated) { 154 if (object->status != Object::Status::Allocated) {
155 LOG_ERROR(Service_NVDRV, "Object is not allocated");
147 return static_cast<u32>(NvErrCodes::InvalidValue); 156 return static_cast<u32>(NvErrCodes::InvalidValue);
148 } 157 }
149 158
@@ -166,10 +175,12 @@ u32 nvmap::IocParam(const std::vector<u8>& input, std::vector<u8>& output) {
166 175
167 auto object = GetObject(params.handle); 176 auto object = GetObject(params.handle);
168 if (!object) { 177 if (!object) {
178 LOG_ERROR(Service_NVDRV, "Object does not exist");
169 return static_cast<u32>(NvErrCodes::InvalidValue); 179 return static_cast<u32>(NvErrCodes::InvalidValue);
170 } 180 }
171 181
172 if (object->status != Object::Status::Allocated) { 182 if (object->status != Object::Status::Allocated) {
183 LOG_ERROR(Service_NVDRV, "Object is not allocated");
173 return static_cast<u32>(NvErrCodes::OperationNotPermitted); 184 return static_cast<u32>(NvErrCodes::OperationNotPermitted);
174 } 185 }
175 186
@@ -209,9 +220,12 @@ u32 nvmap::IocFree(const std::vector<u8>& input, std::vector<u8>& output) {
209 220
210 auto itr = handles.find(params.handle); 221 auto itr = handles.find(params.handle);
211 if (itr == handles.end()) { 222 if (itr == handles.end()) {
223 LOG_ERROR(Service_NVDRV, "Object does not exist");
212 return static_cast<u32>(NvErrCodes::InvalidValue); 224 return static_cast<u32>(NvErrCodes::InvalidValue);
213 } 225 }
214 if (!itr->second->refcount) { 226 if (!itr->second->refcount) {
227 LOG_ERROR(Service_NVDRV,
228 "There is no references to this object. The object is already freed");
215 return static_cast<u32>(NvErrCodes::InvalidValue); 229 return static_cast<u32>(NvErrCodes::InvalidValue);
216 } 230 }
217 231
diff --git a/src/core/hle/service/nvdrv/interface.cpp b/src/core/hle/service/nvdrv/interface.cpp
index 602086eed..ff76e0524 100644
--- a/src/core/hle/service/nvdrv/interface.cpp
+++ b/src/core/hle/service/nvdrv/interface.cpp
@@ -55,6 +55,7 @@ void NVDRV::Close(Kernel::HLERequestContext& ctx) {
55 55
56void NVDRV::Initialize(Kernel::HLERequestContext& ctx) { 56void NVDRV::Initialize(Kernel::HLERequestContext& ctx) {
57 LOG_WARNING(Service_NVDRV, "(STUBBED) called"); 57 LOG_WARNING(Service_NVDRV, "(STUBBED) called");
58
58 IPC::ResponseBuilder rb{ctx, 3}; 59 IPC::ResponseBuilder rb{ctx, 3};
59 rb.Push(RESULT_SUCCESS); 60 rb.Push(RESULT_SUCCESS);
60 rb.Push<u32>(0); 61 rb.Push<u32>(0);
@@ -75,8 +76,8 @@ void NVDRV::QueryEvent(Kernel::HLERequestContext& ctx) {
75void NVDRV::SetClientPID(Kernel::HLERequestContext& ctx) { 76void NVDRV::SetClientPID(Kernel::HLERequestContext& ctx) {
76 IPC::RequestParser rp{ctx}; 77 IPC::RequestParser rp{ctx};
77 pid = rp.Pop<u64>(); 78 pid = rp.Pop<u64>();
78
79 LOG_WARNING(Service_NVDRV, "(STUBBED) called, pid=0x{:X}", pid); 79 LOG_WARNING(Service_NVDRV, "(STUBBED) called, pid=0x{:X}", pid);
80
80 IPC::ResponseBuilder rb{ctx, 3}; 81 IPC::ResponseBuilder rb{ctx, 3};
81 rb.Push(RESULT_SUCCESS); 82 rb.Push(RESULT_SUCCESS);
82 rb.Push<u32>(0); 83 rb.Push<u32>(0);
@@ -84,12 +85,14 @@ void NVDRV::SetClientPID(Kernel::HLERequestContext& ctx) {
84 85
85void NVDRV::FinishInitialize(Kernel::HLERequestContext& ctx) { 86void NVDRV::FinishInitialize(Kernel::HLERequestContext& ctx) {
86 LOG_WARNING(Service_NVDRV, "(STUBBED) called"); 87 LOG_WARNING(Service_NVDRV, "(STUBBED) called");
88
87 IPC::ResponseBuilder rb{ctx, 2}; 89 IPC::ResponseBuilder rb{ctx, 2};
88 rb.Push(RESULT_SUCCESS); 90 rb.Push(RESULT_SUCCESS);
89} 91}
90 92
91void NVDRV::GetStatus(Kernel::HLERequestContext& ctx) { 93void NVDRV::GetStatus(Kernel::HLERequestContext& ctx) {
92 LOG_WARNING(Service_NVDRV, "(STUBBED) called"); 94 LOG_WARNING(Service_NVDRV, "(STUBBED) called");
95
93 IPC::ResponseBuilder rb{ctx, 2}; 96 IPC::ResponseBuilder rb{ctx, 2};
94 rb.Push(RESULT_SUCCESS); 97 rb.Push(RESULT_SUCCESS);
95} 98}
@@ -98,6 +101,7 @@ void NVDRV::DumpGraphicsMemoryInfo(Kernel::HLERequestContext& ctx) {
98 // According to SwitchBrew, this has no inputs and no outputs, so effectively does nothing on 101 // According to SwitchBrew, this has no inputs and no outputs, so effectively does nothing on
99 // retail hardware. 102 // retail hardware.
100 LOG_DEBUG(Service_NVDRV, "called"); 103 LOG_DEBUG(Service_NVDRV, "called");
104
101 IPC::ResponseBuilder rb{ctx, 2}; 105 IPC::ResponseBuilder rb{ctx, 2};
102 rb.Push(RESULT_SUCCESS); 106 rb.Push(RESULT_SUCCESS);
103} 107}
diff --git a/src/core/hle/service/nvflinger/buffer_queue.cpp b/src/core/hle/service/nvflinger/buffer_queue.cpp
index 630ebbfc7..172a1a441 100644
--- a/src/core/hle/service/nvflinger/buffer_queue.cpp
+++ b/src/core/hle/service/nvflinger/buffer_queue.cpp
@@ -20,13 +20,13 @@ BufferQueue::BufferQueue(u32 id, u64 layer_id) : id(id), layer_id(layer_id) {
20BufferQueue::~BufferQueue() = default; 20BufferQueue::~BufferQueue() = default;
21 21
22void BufferQueue::SetPreallocatedBuffer(u32 slot, const IGBPBuffer& igbp_buffer) { 22void BufferQueue::SetPreallocatedBuffer(u32 slot, const IGBPBuffer& igbp_buffer) {
23 LOG_WARNING(Service, "Adding graphics buffer {}", slot);
24
23 Buffer buffer{}; 25 Buffer buffer{};
24 buffer.slot = slot; 26 buffer.slot = slot;
25 buffer.igbp_buffer = igbp_buffer; 27 buffer.igbp_buffer = igbp_buffer;
26 buffer.status = Buffer::Status::Free; 28 buffer.status = Buffer::Status::Free;
27 29
28 LOG_WARNING(Service, "Adding graphics buffer {}", slot);
29
30 queue.emplace_back(buffer); 30 queue.emplace_back(buffer);
31 buffer_wait_event->Signal(); 31 buffer_wait_event->Signal();
32} 32}
@@ -92,6 +92,7 @@ void BufferQueue::ReleaseBuffer(u32 slot) {
92 92
93u32 BufferQueue::Query(QueryType type) { 93u32 BufferQueue::Query(QueryType type) {
94 LOG_WARNING(Service, "(STUBBED) called type={}", static_cast<u32>(type)); 94 LOG_WARNING(Service, "(STUBBED) called type={}", static_cast<u32>(type));
95
95 switch (type) { 96 switch (type) {
96 case QueryType::NativeWindowFormat: 97 case QueryType::NativeWindowFormat:
97 // TODO(Subv): Use an enum for this 98 // TODO(Subv): Use an enum for this
diff --git a/src/core/hle/service/pctl/module.cpp b/src/core/hle/service/pctl/module.cpp
index 4fd185f69..6081f41e1 100644
--- a/src/core/hle/service/pctl/module.cpp
+++ b/src/core/hle/service/pctl/module.cpp
@@ -114,29 +114,33 @@ public:
114private: 114private:
115 void Initialize(Kernel::HLERequestContext& ctx) { 115 void Initialize(Kernel::HLERequestContext& ctx) {
116 LOG_WARNING(Service_PCTL, "(STUBBED) called"); 116 LOG_WARNING(Service_PCTL, "(STUBBED) called");
117
117 IPC::ResponseBuilder rb{ctx, 2, 0, 0}; 118 IPC::ResponseBuilder rb{ctx, 2, 0, 0};
118 rb.Push(RESULT_SUCCESS); 119 rb.Push(RESULT_SUCCESS);
119 } 120 }
120 121
121 void CheckFreeCommunicationPermission(Kernel::HLERequestContext& ctx) { 122 void CheckFreeCommunicationPermission(Kernel::HLERequestContext& ctx) {
122 LOG_WARNING(Service_PCTL, "(STUBBED) called"); 123 LOG_WARNING(Service_PCTL, "(STUBBED) called");
124
123 IPC::ResponseBuilder rb{ctx, 2}; 125 IPC::ResponseBuilder rb{ctx, 2};
124 rb.Push(RESULT_SUCCESS); 126 rb.Push(RESULT_SUCCESS);
125 } 127 }
126}; 128};
127 129
128void Module::Interface::CreateService(Kernel::HLERequestContext& ctx) { 130void Module::Interface::CreateService(Kernel::HLERequestContext& ctx) {
131 LOG_DEBUG(Service_PCTL, "called");
132
129 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 133 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
130 rb.Push(RESULT_SUCCESS); 134 rb.Push(RESULT_SUCCESS);
131 rb.PushIpcInterface<IParentalControlService>(); 135 rb.PushIpcInterface<IParentalControlService>();
132 LOG_DEBUG(Service_PCTL, "called");
133} 136}
134 137
135void Module::Interface::CreateServiceWithoutInitialize(Kernel::HLERequestContext& ctx) { 138void Module::Interface::CreateServiceWithoutInitialize(Kernel::HLERequestContext& ctx) {
139 LOG_DEBUG(Service_PCTL, "called");
140
136 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 141 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
137 rb.Push(RESULT_SUCCESS); 142 rb.Push(RESULT_SUCCESS);
138 rb.PushIpcInterface<IParentalControlService>(); 143 rb.PushIpcInterface<IParentalControlService>();
139 LOG_DEBUG(Service_PCTL, "called");
140} 144}
141 145
142Module::Interface::Interface(std::shared_ptr<Module> module, const char* name) 146Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
diff --git a/src/core/hle/service/pm/pm.cpp b/src/core/hle/service/pm/pm.cpp
index 6ec35ca60..53e7da9c3 100644
--- a/src/core/hle/service/pm/pm.cpp
+++ b/src/core/hle/service/pm/pm.cpp
@@ -20,11 +20,11 @@ public:
20 20
21private: 21private:
22 void GetBootMode(Kernel::HLERequestContext& ctx) { 22 void GetBootMode(Kernel::HLERequestContext& ctx) {
23 LOG_DEBUG(Service_PM, "called");
24
23 IPC::ResponseBuilder rb{ctx, 3}; 25 IPC::ResponseBuilder rb{ctx, 3};
24 rb.Push(RESULT_SUCCESS); 26 rb.Push(RESULT_SUCCESS);
25 rb.Push<u32>(static_cast<u32>(SystemBootMode::Normal)); // Normal boot mode 27 rb.Push<u32>(static_cast<u32>(SystemBootMode::Normal)); // Normal boot mode
26
27 LOG_DEBUG(Service_PM, "called");
28 } 28 }
29}; 29};
30 30
diff --git a/src/core/hle/service/psc/psc.cpp b/src/core/hle/service/psc/psc.cpp
index bbad870a2..0ba0a4076 100644
--- a/src/core/hle/service/psc/psc.cpp
+++ b/src/core/hle/service/psc/psc.cpp
@@ -61,11 +61,11 @@ public:
61 61
62private: 62private:
63 void GetPmModule(Kernel::HLERequestContext& ctx) { 63 void GetPmModule(Kernel::HLERequestContext& ctx) {
64 LOG_DEBUG(Service_PSC, "called");
65
64 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 66 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
65 rb.Push(RESULT_SUCCESS); 67 rb.Push(RESULT_SUCCESS);
66 rb.PushIpcInterface<IPmModule>(); 68 rb.PushIpcInterface<IPmModule>();
67
68 LOG_DEBUG(Service_PSC, "called");
69 } 69 }
70}; 70};
71 71
diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp
index 9e5af7839..40a9144f9 100644
--- a/src/core/hle/service/set/set.cpp
+++ b/src/core/hle/service/set/set.cpp
@@ -49,38 +49,39 @@ static std::array<LanguageCode, size> MakeLanguageCodeSubset() {
49static void PushResponseLanguageCode(Kernel::HLERequestContext& ctx, std::size_t max_size) { 49static void PushResponseLanguageCode(Kernel::HLERequestContext& ctx, std::size_t max_size) {
50 IPC::ResponseBuilder rb{ctx, 3}; 50 IPC::ResponseBuilder rb{ctx, 3};
51 rb.Push(RESULT_SUCCESS); 51 rb.Push(RESULT_SUCCESS);
52 if (available_language_codes.size() > max_size) 52 if (available_language_codes.size() > max_size) {
53 rb.Push(static_cast<u32>(max_size)); 53 rb.Push(static_cast<u32>(max_size));
54 else 54 } else {
55 rb.Push(static_cast<u32>(available_language_codes.size())); 55 rb.Push(static_cast<u32>(available_language_codes.size()));
56 }
56} 57}
57 58
58void SET::GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx) { 59void SET::GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx) {
59 if (available_language_codes.size() > pre4_0_0_max_entries) 60 LOG_DEBUG(Service_SET, "called");
61
62 if (available_language_codes.size() > pre4_0_0_max_entries) {
60 ctx.WriteBuffer(MakeLanguageCodeSubset<pre4_0_0_max_entries>()); 63 ctx.WriteBuffer(MakeLanguageCodeSubset<pre4_0_0_max_entries>());
61 else 64 } else {
62 ctx.WriteBuffer(available_language_codes); 65 ctx.WriteBuffer(available_language_codes);
63 66 }
64 PushResponseLanguageCode(ctx, pre4_0_0_max_entries); 67 PushResponseLanguageCode(ctx, pre4_0_0_max_entries);
65
66 LOG_DEBUG(Service_SET, "called");
67} 68}
68 69
69void SET::GetAvailableLanguageCodes2(Kernel::HLERequestContext& ctx) { 70void SET::GetAvailableLanguageCodes2(Kernel::HLERequestContext& ctx) {
70 if (available_language_codes.size() > post4_0_0_max_entries) 71 LOG_DEBUG(Service_SET, "called");
72
73 if (available_language_codes.size() > post4_0_0_max_entries) {
71 ctx.WriteBuffer(MakeLanguageCodeSubset<post4_0_0_max_entries>()); 74 ctx.WriteBuffer(MakeLanguageCodeSubset<post4_0_0_max_entries>());
72 else 75 } else {
73 ctx.WriteBuffer(available_language_codes); 76 ctx.WriteBuffer(available_language_codes);
74 77 }
75 PushResponseLanguageCode(ctx, post4_0_0_max_entries); 78 PushResponseLanguageCode(ctx, post4_0_0_max_entries);
76
77 LOG_DEBUG(Service_SET, "called");
78} 79}
79 80
80void SET::GetAvailableLanguageCodeCount(Kernel::HLERequestContext& ctx) { 81void SET::GetAvailableLanguageCodeCount(Kernel::HLERequestContext& ctx) {
81 PushResponseLanguageCode(ctx, pre4_0_0_max_entries);
82
83 LOG_DEBUG(Service_SET, "called"); 82 LOG_DEBUG(Service_SET, "called");
83
84 PushResponseLanguageCode(ctx, pre4_0_0_max_entries);
84} 85}
85 86
86void SET::GetAvailableLanguageCodeCount2(Kernel::HLERequestContext& ctx) { 87void SET::GetAvailableLanguageCodeCount2(Kernel::HLERequestContext& ctx) {
@@ -90,11 +91,11 @@ void SET::GetAvailableLanguageCodeCount2(Kernel::HLERequestContext& ctx) {
90} 91}
91 92
92void SET::GetLanguageCode(Kernel::HLERequestContext& ctx) { 93void SET::GetLanguageCode(Kernel::HLERequestContext& ctx) {
94 LOG_DEBUG(Service_SET, "called {}", Settings::values.language_index);
95
93 IPC::ResponseBuilder rb{ctx, 4}; 96 IPC::ResponseBuilder rb{ctx, 4};
94 rb.Push(RESULT_SUCCESS); 97 rb.Push(RESULT_SUCCESS);
95 rb.Push(static_cast<u64>(available_language_codes[Settings::values.language_index])); 98 rb.Push(static_cast<u64>(available_language_codes[Settings::values.language_index]));
96
97 LOG_DEBUG(Service_SET, "called {}", Settings::values.language_index);
98} 99}
99 100
100SET::SET() : ServiceFramework("set") { 101SET::SET() : ServiceFramework("set") {
diff --git a/src/core/hle/service/set/set_sys.cpp b/src/core/hle/service/set/set_sys.cpp
index 41efca31c..c9b4da5b0 100644
--- a/src/core/hle/service/set/set_sys.cpp
+++ b/src/core/hle/service/set/set_sys.cpp
@@ -10,22 +10,22 @@
10namespace Service::Set { 10namespace Service::Set {
11 11
12void SET_SYS::GetColorSetId(Kernel::HLERequestContext& ctx) { 12void SET_SYS::GetColorSetId(Kernel::HLERequestContext& ctx) {
13 LOG_DEBUG(Service_SET, "called");
14
13 IPC::ResponseBuilder rb{ctx, 3}; 15 IPC::ResponseBuilder rb{ctx, 3};
14 16
15 rb.Push(RESULT_SUCCESS); 17 rb.Push(RESULT_SUCCESS);
16 rb.PushEnum(color_set); 18 rb.PushEnum(color_set);
17
18 LOG_DEBUG(Service_SET, "called");
19} 19}
20 20
21void SET_SYS::SetColorSetId(Kernel::HLERequestContext& ctx) { 21void SET_SYS::SetColorSetId(Kernel::HLERequestContext& ctx) {
22 LOG_DEBUG(Service_SET, "called");
23
22 IPC::RequestParser rp{ctx}; 24 IPC::RequestParser rp{ctx};
23 color_set = rp.PopEnum<ColorSet>(); 25 color_set = rp.PopEnum<ColorSet>();
24 26
25 IPC::ResponseBuilder rb{ctx, 2}; 27 IPC::ResponseBuilder rb{ctx, 2};
26 rb.Push(RESULT_SUCCESS); 28 rb.Push(RESULT_SUCCESS);
27
28 LOG_DEBUG(Service_SET, "called");
29} 29}
30 30
31SET_SYS::SET_SYS() : ServiceFramework("set:sys") { 31SET_SYS::SET_SYS() : ServiceFramework("set:sys") {
diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp
index 98f6e4111..74da4d5e6 100644
--- a/src/core/hle/service/sm/controller.cpp
+++ b/src/core/hle/service/sm/controller.cpp
@@ -14,25 +14,26 @@ namespace Service::SM {
14 14
15void Controller::ConvertSessionToDomain(Kernel::HLERequestContext& ctx) { 15void Controller::ConvertSessionToDomain(Kernel::HLERequestContext& ctx) {
16 ASSERT_MSG(ctx.Session()->IsSession(), "Session is already a domain"); 16 ASSERT_MSG(ctx.Session()->IsSession(), "Session is already a domain");
17 LOG_DEBUG(Service, "called, server_session={}", ctx.Session()->GetObjectId());
17 ctx.Session()->ConvertToDomain(); 18 ctx.Session()->ConvertToDomain();
18 19
19 IPC::ResponseBuilder rb{ctx, 3}; 20 IPC::ResponseBuilder rb{ctx, 3};
20 rb.Push(RESULT_SUCCESS); 21 rb.Push(RESULT_SUCCESS);
21 rb.Push<u32>(1); // Converted sessions start with 1 request handler 22 rb.Push<u32>(1); // Converted sessions start with 1 request handler
22
23 LOG_DEBUG(Service, "called, server_session={}", ctx.Session()->GetObjectId());
24} 23}
25 24
26void Controller::DuplicateSession(Kernel::HLERequestContext& ctx) { 25void Controller::DuplicateSession(Kernel::HLERequestContext& ctx) {
27 // TODO(bunnei): This is just creating a new handle to the same Session. I assume this is wrong 26 // TODO(bunnei): This is just creating a new handle to the same Session. I assume this is wrong
28 // and that we probably want to actually make an entirely new Session, but we still need to 27 // and that we probably want to actually make an entirely new Session, but we still need to
29 // verify this on hardware. 28 // verify this on hardware.
29 LOG_DEBUG(Service, "called");
30
30 IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles}; 31 IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles};
31 rb.Push(RESULT_SUCCESS); 32 rb.Push(RESULT_SUCCESS);
32 Kernel::SharedPtr<Kernel::ClientSession> session{ctx.Session()->parent->client}; 33 Kernel::SharedPtr<Kernel::ClientSession> session{ctx.Session()->parent->client};
33 rb.PushMoveObjects(session); 34 rb.PushMoveObjects(session);
34 35
35 LOG_DEBUG(Service, "called, session={}", session->GetObjectId()); 36 LOG_DEBUG(Service, "session={}", session->GetObjectId());
36} 37}
37 38
38void Controller::DuplicateSessionEx(Kernel::HLERequestContext& ctx) { 39void Controller::DuplicateSessionEx(Kernel::HLERequestContext& ctx) {
@@ -42,11 +43,11 @@ void Controller::DuplicateSessionEx(Kernel::HLERequestContext& ctx) {
42} 43}
43 44
44void Controller::QueryPointerBufferSize(Kernel::HLERequestContext& ctx) { 45void Controller::QueryPointerBufferSize(Kernel::HLERequestContext& ctx) {
46 LOG_WARNING(Service, "(STUBBED) called");
47
45 IPC::ResponseBuilder rb{ctx, 3}; 48 IPC::ResponseBuilder rb{ctx, 3};
46 rb.Push(RESULT_SUCCESS); 49 rb.Push(RESULT_SUCCESS);
47 rb.Push<u16>(0x500); 50 rb.Push<u16>(0x500);
48
49 LOG_WARNING(Service, "(STUBBED) called");
50} 51}
51 52
52Controller::Controller() : ServiceFramework("IpcController") { 53Controller::Controller() : ServiceFramework("IpcController") {
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp
index c1b2f33b9..e4e8ad320 100644
--- a/src/core/hle/service/sm/sm.cpp
+++ b/src/core/hle/service/sm/sm.cpp
@@ -103,9 +103,10 @@ SM::~SM() = default;
103 * 0: ResultCode 103 * 0: ResultCode
104 */ 104 */
105void SM::Initialize(Kernel::HLERequestContext& ctx) { 105void SM::Initialize(Kernel::HLERequestContext& ctx) {
106 LOG_DEBUG(Service_SM, "called");
107
106 IPC::ResponseBuilder rb{ctx, 2}; 108 IPC::ResponseBuilder rb{ctx, 2};
107 rb.Push(RESULT_SUCCESS); 109 rb.Push(RESULT_SUCCESS);
108 LOG_DEBUG(Service_SM, "called");
109} 110}
110 111
111void SM::GetService(Kernel::HLERequestContext& ctx) { 112void SM::GetService(Kernel::HLERequestContext& ctx) {
@@ -172,6 +173,7 @@ void SM::UnregisterService(Kernel::HLERequestContext& ctx) {
172 const auto end = std::find(name_buf.begin(), name_buf.end(), '\0'); 173 const auto end = std::find(name_buf.begin(), name_buf.end(), '\0');
173 174
174 const std::string name(name_buf.begin(), end); 175 const std::string name(name_buf.begin(), end);
176 LOG_DEBUG(Service_SM, "called with name={}", name);
175 177
176 IPC::ResponseBuilder rb{ctx, 2}; 178 IPC::ResponseBuilder rb{ctx, 2};
177 rb.Push(service_manager->UnregisterService(name)); 179 rb.Push(service_manager->UnregisterService(name));
diff --git a/src/core/hle/service/spl/module.cpp b/src/core/hle/service/spl/module.cpp
index b2de2a818..8db0c2f13 100644
--- a/src/core/hle/service/spl/module.cpp
+++ b/src/core/hle/service/spl/module.cpp
@@ -24,6 +24,8 @@ Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
24Module::Interface::~Interface() = default; 24Module::Interface::~Interface() = default;
25 25
26void Module::Interface::GetRandomBytes(Kernel::HLERequestContext& ctx) { 26void Module::Interface::GetRandomBytes(Kernel::HLERequestContext& ctx) {
27 LOG_DEBUG(Service_SPL, "called");
28
27 IPC::RequestParser rp{ctx}; 29 IPC::RequestParser rp{ctx};
28 30
29 std::size_t size = ctx.GetWriteBufferSize(); 31 std::size_t size = ctx.GetWriteBufferSize();
@@ -36,7 +38,6 @@ void Module::Interface::GetRandomBytes(Kernel::HLERequestContext& ctx) {
36 38
37 IPC::ResponseBuilder rb{ctx, 2}; 39 IPC::ResponseBuilder rb{ctx, 2};
38 rb.Push(RESULT_SUCCESS); 40 rb.Push(RESULT_SUCCESS);
39 LOG_DEBUG(Service_SPL, "called");
40} 41}
41 42
42void InstallInterfaces(SM::ServiceManager& service_manager) { 43void InstallInterfaces(SM::ServiceManager& service_manager) {
diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp
index bc4f7a437..af40a1815 100644
--- a/src/core/hle/service/ssl/ssl.cpp
+++ b/src/core/hle/service/ssl/ssl.cpp
@@ -69,6 +69,7 @@ public:
69private: 69private:
70 void SetOption(Kernel::HLERequestContext& ctx) { 70 void SetOption(Kernel::HLERequestContext& ctx) {
71 LOG_WARNING(Service_SSL, "(STUBBED) called"); 71 LOG_WARNING(Service_SSL, "(STUBBED) called");
72
72 IPC::RequestParser rp{ctx}; 73 IPC::RequestParser rp{ctx};
73 74
74 IPC::ResponseBuilder rb{ctx, 2}; 75 IPC::ResponseBuilder rb{ctx, 2};
@@ -114,6 +115,7 @@ private:
114 115
115 void SetInterfaceVersion(Kernel::HLERequestContext& ctx) { 116 void SetInterfaceVersion(Kernel::HLERequestContext& ctx) {
116 LOG_DEBUG(Service_SSL, "called"); 117 LOG_DEBUG(Service_SSL, "called");
118
117 IPC::RequestParser rp{ctx}; 119 IPC::RequestParser rp{ctx};
118 ssl_version = rp.Pop<u32>(); 120 ssl_version = rp.Pop<u32>();
119 121
diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp
index e561a0c52..60b201d06 100644
--- a/src/core/hle/service/time/time.cpp
+++ b/src/core/hle/service/time/time.cpp
@@ -72,6 +72,7 @@ private:
72 std::chrono::system_clock::now().time_since_epoch()) 72 std::chrono::system_clock::now().time_since_epoch())
73 .count()}; 73 .count()};
74 LOG_DEBUG(Service_Time, "called"); 74 LOG_DEBUG(Service_Time, "called");
75
75 IPC::ResponseBuilder rb{ctx, 4}; 76 IPC::ResponseBuilder rb{ctx, 4};
76 rb.Push(RESULT_SUCCESS); 77 rb.Push(RESULT_SUCCESS);
77 rb.Push<u64>(time_since_epoch); 78 rb.Push<u64>(time_since_epoch);
@@ -79,6 +80,7 @@ private:
79 80
80 void GetSystemClockContext(Kernel::HLERequestContext& ctx) { 81 void GetSystemClockContext(Kernel::HLERequestContext& ctx) {
81 LOG_WARNING(Service_Time, "(STUBBED) called"); 82 LOG_WARNING(Service_Time, "(STUBBED) called");
83
82 SystemClockContext system_clock_ontext{}; 84 SystemClockContext system_clock_ontext{};
83 IPC::ResponseBuilder rb{ctx, (sizeof(SystemClockContext) / 4) + 2}; 85 IPC::ResponseBuilder rb{ctx, (sizeof(SystemClockContext) / 4) + 2};
84 rb.Push(RESULT_SUCCESS); 86 rb.Push(RESULT_SUCCESS);
@@ -98,6 +100,7 @@ public:
98private: 100private:
99 void GetCurrentTimePoint(Kernel::HLERequestContext& ctx) { 101 void GetCurrentTimePoint(Kernel::HLERequestContext& ctx) {
100 LOG_DEBUG(Service_Time, "called"); 102 LOG_DEBUG(Service_Time, "called");
103
101 SteadyClockTimePoint steady_clock_time_point{ 104 SteadyClockTimePoint steady_clock_time_point{
102 CoreTiming::cyclesToMs(CoreTiming::GetTicks()) / 1000}; 105 CoreTiming::cyclesToMs(CoreTiming::GetTicks()) / 1000};
103 IPC::ResponseBuilder rb{ctx, (sizeof(SteadyClockTimePoint) / 4) + 2}; 106 IPC::ResponseBuilder rb{ctx, (sizeof(SteadyClockTimePoint) / 4) + 2};
@@ -130,6 +133,7 @@ private:
130 133
131 void GetDeviceLocationName(Kernel::HLERequestContext& ctx) { 134 void GetDeviceLocationName(Kernel::HLERequestContext& ctx) {
132 LOG_DEBUG(Service_Time, "called"); 135 LOG_DEBUG(Service_Time, "called");
136
133 IPC::ResponseBuilder rb{ctx, (sizeof(LocationName) / 4) + 2}; 137 IPC::ResponseBuilder rb{ctx, (sizeof(LocationName) / 4) + 2};
134 rb.Push(RESULT_SUCCESS); 138 rb.Push(RESULT_SUCCESS);
135 rb.PushRaw(location_name); 139 rb.PushRaw(location_name);
@@ -137,6 +141,7 @@ private:
137 141
138 void GetTotalLocationNameCount(Kernel::HLERequestContext& ctx) { 142 void GetTotalLocationNameCount(Kernel::HLERequestContext& ctx) {
139 LOG_WARNING(Service_Time, "(STUBBED) called"); 143 LOG_WARNING(Service_Time, "(STUBBED) called");
144
140 IPC::ResponseBuilder rb{ctx, 3}; 145 IPC::ResponseBuilder rb{ctx, 3};
141 rb.Push(RESULT_SUCCESS); 146 rb.Push(RESULT_SUCCESS);
142 rb.Push<u32>(0); 147 rb.Push<u32>(0);
@@ -154,7 +159,6 @@ private:
154 void ToCalendarTime(Kernel::HLERequestContext& ctx) { 159 void ToCalendarTime(Kernel::HLERequestContext& ctx) {
155 IPC::RequestParser rp{ctx}; 160 IPC::RequestParser rp{ctx};
156 const u64 posix_time = rp.Pop<u64>(); 161 const u64 posix_time = rp.Pop<u64>();
157
158 LOG_WARNING(Service_Time, "(STUBBED) called, posix_time=0x{:016X}", posix_time); 162 LOG_WARNING(Service_Time, "(STUBBED) called, posix_time=0x{:016X}", posix_time);
159 163
160 TimeZoneRule time_zone_rule{}; 164 TimeZoneRule time_zone_rule{};
@@ -175,7 +179,6 @@ private:
175 void ToCalendarTimeWithMyRule(Kernel::HLERequestContext& ctx) { 179 void ToCalendarTimeWithMyRule(Kernel::HLERequestContext& ctx) {
176 IPC::RequestParser rp{ctx}; 180 IPC::RequestParser rp{ctx};
177 const u64 posix_time = rp.Pop<u64>(); 181 const u64 posix_time = rp.Pop<u64>();
178
179 LOG_WARNING(Service_Time, "(STUBBED) called, posix_time=0x{:016X}", posix_time); 182 LOG_WARNING(Service_Time, "(STUBBED) called, posix_time=0x{:016X}", posix_time);
180 183
181 CalendarTime calendar_time{2018, 1, 1, 0, 0, 0}; 184 CalendarTime calendar_time{2018, 1, 1, 0, 0, 0};
@@ -192,6 +195,7 @@ private:
192 void ToPosixTime(Kernel::HLERequestContext& ctx) { 195 void ToPosixTime(Kernel::HLERequestContext& ctx) {
193 // TODO(ogniK): Figure out how to handle multiple times 196 // TODO(ogniK): Figure out how to handle multiple times
194 LOG_WARNING(Service_Time, "(STUBBED) called"); 197 LOG_WARNING(Service_Time, "(STUBBED) called");
198
195 IPC::RequestParser rp{ctx}; 199 IPC::RequestParser rp{ctx};
196 auto calendar_time = rp.PopRaw<CalendarTime>(); 200 auto calendar_time = rp.PopRaw<CalendarTime>();
197 auto posix_time = CalendarToPosix(calendar_time, {}); 201 auto posix_time = CalendarToPosix(calendar_time, {});
@@ -204,6 +208,7 @@ private:
204 208
205 void ToPosixTimeWithMyRule(Kernel::HLERequestContext& ctx) { 209 void ToPosixTimeWithMyRule(Kernel::HLERequestContext& ctx) {
206 LOG_WARNING(Service_Time, "(STUBBED) called"); 210 LOG_WARNING(Service_Time, "(STUBBED) called");
211
207 IPC::RequestParser rp{ctx}; 212 IPC::RequestParser rp{ctx};
208 auto calendar_time = rp.PopRaw<CalendarTime>(); 213 auto calendar_time = rp.PopRaw<CalendarTime>();
209 auto posix_time = CalendarToPosix(calendar_time, {}); 214 auto posix_time = CalendarToPosix(calendar_time, {});
@@ -216,38 +221,43 @@ private:
216}; 221};
217 222
218void Module::Interface::GetStandardUserSystemClock(Kernel::HLERequestContext& ctx) { 223void Module::Interface::GetStandardUserSystemClock(Kernel::HLERequestContext& ctx) {
224 LOG_DEBUG(Service_Time, "called");
225
219 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 226 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
220 rb.Push(RESULT_SUCCESS); 227 rb.Push(RESULT_SUCCESS);
221 rb.PushIpcInterface<ISystemClock>(); 228 rb.PushIpcInterface<ISystemClock>();
222 LOG_DEBUG(Service_Time, "called");
223} 229}
224 230
225void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx) { 231void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx) {
232 LOG_DEBUG(Service_Time, "called");
233
226 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 234 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
227 rb.Push(RESULT_SUCCESS); 235 rb.Push(RESULT_SUCCESS);
228 rb.PushIpcInterface<ISystemClock>(); 236 rb.PushIpcInterface<ISystemClock>();
229 LOG_DEBUG(Service_Time, "called");
230} 237}
231 238
232void Module::Interface::GetStandardSteadyClock(Kernel::HLERequestContext& ctx) { 239void Module::Interface::GetStandardSteadyClock(Kernel::HLERequestContext& ctx) {
240 LOG_DEBUG(Service_Time, "called");
241
233 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 242 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
234 rb.Push(RESULT_SUCCESS); 243 rb.Push(RESULT_SUCCESS);
235 rb.PushIpcInterface<ISteadyClock>(); 244 rb.PushIpcInterface<ISteadyClock>();
236 LOG_DEBUG(Service_Time, "called");
237} 245}
238 246
239void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) { 247void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) {
248 LOG_DEBUG(Service_Time, "called");
249
240 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 250 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
241 rb.Push(RESULT_SUCCESS); 251 rb.Push(RESULT_SUCCESS);
242 rb.PushIpcInterface<ITimeZoneService>(); 252 rb.PushIpcInterface<ITimeZoneService>();
243 LOG_DEBUG(Service_Time, "called");
244} 253}
245 254
246void Module::Interface::GetStandardLocalSystemClock(Kernel::HLERequestContext& ctx) { 255void Module::Interface::GetStandardLocalSystemClock(Kernel::HLERequestContext& ctx) {
256 LOG_DEBUG(Service_Time, "called");
257
247 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 258 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
248 rb.Push(RESULT_SUCCESS); 259 rb.Push(RESULT_SUCCESS);
249 rb.PushIpcInterface<ISystemClock>(); 260 rb.PushIpcInterface<ISystemClock>();
250 LOG_DEBUG(Service_Time, "called");
251} 261}
252 262
253void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) { 263void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) {
@@ -265,6 +275,7 @@ void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) {
265 const std::time_t time(time_since_epoch); 275 const std::time_t time(time_since_epoch);
266 const std::tm* tm = std::localtime(&time); 276 const std::tm* tm = std::localtime(&time);
267 if (tm == nullptr) { 277 if (tm == nullptr) {
278 LOG_ERROR(Service_Time, "tm is a nullptr");
268 IPC::ResponseBuilder rb{ctx, 2}; 279 IPC::ResponseBuilder rb{ctx, 2};
269 rb.Push(ResultCode(-1)); // TODO(ogniK): Find appropriate error code 280 rb.Push(ResultCode(-1)); // TODO(ogniK): Find appropriate error code
270 return; 281 return;
diff --git a/src/core/hle/service/usb/usb.cpp b/src/core/hle/service/usb/usb.cpp
index f0a831d45..f082a63bc 100644
--- a/src/core/hle/service/usb/usb.cpp
+++ b/src/core/hle/service/usb/usb.cpp
@@ -159,11 +159,11 @@ public:
159 159
160private: 160private:
161 void GetPdSession(Kernel::HLERequestContext& ctx) { 161 void GetPdSession(Kernel::HLERequestContext& ctx) {
162 LOG_DEBUG(Service_USB, "called");
163
162 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 164 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
163 rb.Push(RESULT_SUCCESS); 165 rb.Push(RESULT_SUCCESS);
164 rb.PushIpcInterface<IPdSession>(); 166 rb.PushIpcInterface<IPdSession>();
165
166 LOG_DEBUG(Service_USB, "called");
167 } 167 }
168}; 168};
169 169
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp
index a72416084..5120abfff 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -504,10 +504,10 @@ private:
504 u32 id = rp.Pop<u32>(); 504 u32 id = rp.Pop<u32>();
505 auto transaction = static_cast<TransactionId>(rp.Pop<u32>()); 505 auto transaction = static_cast<TransactionId>(rp.Pop<u32>());
506 u32 flags = rp.Pop<u32>(); 506 u32 flags = rp.Pop<u32>();
507 auto buffer_queue = nv_flinger->GetBufferQueue(id);
508
509 LOG_DEBUG(Service_VI, "called, transaction={:X}", static_cast<u32>(transaction)); 507 LOG_DEBUG(Service_VI, "called, transaction={:X}", static_cast<u32>(transaction));
510 508
509 auto buffer_queue = nv_flinger->GetBufferQueue(id);
510
511 if (transaction == TransactionId::Connect) { 511 if (transaction == TransactionId::Connect) {
512 IGBPConnectRequestParcel request{ctx.ReadBuffer()}; 512 IGBPConnectRequestParcel request{ctx.ReadBuffer()};
513 IGBPConnectResponseParcel response{ 513 IGBPConnectResponseParcel response{
@@ -593,9 +593,9 @@ private:
593 u32 id = rp.Pop<u32>(); 593 u32 id = rp.Pop<u32>();
594 s32 addval = rp.PopRaw<s32>(); 594 s32 addval = rp.PopRaw<s32>();
595 u32 type = rp.Pop<u32>(); 595 u32 type = rp.Pop<u32>();
596
597 LOG_WARNING(Service_VI, "(STUBBED) called id={}, addval={:08X}, type={:08X}", id, addval, 596 LOG_WARNING(Service_VI, "(STUBBED) called id={}, addval={:08X}, type={:08X}", id, addval,
598 type); 597 type);
598
599 IPC::ResponseBuilder rb{ctx, 2}; 599 IPC::ResponseBuilder rb{ctx, 2};
600 rb.Push(RESULT_SUCCESS); 600 rb.Push(RESULT_SUCCESS);
601 } 601 }
@@ -604,12 +604,11 @@ private:
604 IPC::RequestParser rp{ctx}; 604 IPC::RequestParser rp{ctx};
605 u32 id = rp.Pop<u32>(); 605 u32 id = rp.Pop<u32>();
606 u32 unknown = rp.Pop<u32>(); 606 u32 unknown = rp.Pop<u32>();
607 LOG_WARNING(Service_VI, "(STUBBED) called id={}, unknown={:08X}", id, unknown);
607 608
608 auto buffer_queue = nv_flinger->GetBufferQueue(id); 609 auto buffer_queue = nv_flinger->GetBufferQueue(id);
609 610
610 // TODO(Subv): Find out what this actually is. 611 // TODO(Subv): Find out what this actually is.
611
612 LOG_WARNING(Service_VI, "(STUBBED) called id={}, unknown={:08X}", id, unknown);
613 IPC::ResponseBuilder rb{ctx, 2, 1}; 612 IPC::ResponseBuilder rb{ctx, 2, 1};
614 rb.Push(RESULT_SUCCESS); 613 rb.Push(RESULT_SUCCESS);
615 rb.PushCopyObjects(buffer_queue->GetBufferWaitEvent()); 614 rb.PushCopyObjects(buffer_queue->GetBufferWaitEvent());
@@ -673,6 +672,7 @@ public:
673private: 672private:
674 void SetLayerZ(Kernel::HLERequestContext& ctx) { 673 void SetLayerZ(Kernel::HLERequestContext& ctx) {
675 LOG_WARNING(Service_VI, "(STUBBED) called"); 674 LOG_WARNING(Service_VI, "(STUBBED) called");
675
676 IPC::RequestParser rp{ctx}; 676 IPC::RequestParser rp{ctx};
677 u64 layer_id = rp.Pop<u64>(); 677 u64 layer_id = rp.Pop<u64>();
678 u64 z_value = rp.Pop<u64>(); 678 u64 z_value = rp.Pop<u64>();
@@ -685,13 +685,16 @@ private:
685 IPC::RequestParser rp{ctx}; 685 IPC::RequestParser rp{ctx};
686 u64 layer_id = rp.Pop<u64>(); 686 u64 layer_id = rp.Pop<u64>();
687 bool visibility = rp.Pop<bool>(); 687 bool visibility = rp.Pop<bool>();
688 IPC::ResponseBuilder rb{ctx, 2};
689 rb.Push(RESULT_SUCCESS);
690 LOG_WARNING(Service_VI, "(STUBBED) called, layer_id=0x{:08X}, visibility={}", layer_id, 688 LOG_WARNING(Service_VI, "(STUBBED) called, layer_id=0x{:08X}, visibility={}", layer_id,
691 visibility); 689 visibility);
690
691 IPC::ResponseBuilder rb{ctx, 2};
692 rb.Push(RESULT_SUCCESS);
692 } 693 }
693 694
694 void GetDisplayMode(Kernel::HLERequestContext& ctx) { 695 void GetDisplayMode(Kernel::HLERequestContext& ctx) {
696 LOG_WARNING(Service_VI, "(STUBBED) called");
697
695 IPC::ResponseBuilder rb{ctx, 6}; 698 IPC::ResponseBuilder rb{ctx, 6};
696 rb.Push(RESULT_SUCCESS); 699 rb.Push(RESULT_SUCCESS);
697 700
@@ -707,10 +710,8 @@ private:
707 static_cast<u32>(Settings::values.resolution_factor)); 710 static_cast<u32>(Settings::values.resolution_factor));
708 } 711 }
709 712
710 rb.PushRaw<float>(60.0f); 713 rb.PushRaw<float>(60.0f); // This wouldn't seem to be correct for 30 fps games.
711 rb.Push<u32>(0); 714 rb.Push<u32>(0);
712
713 LOG_DEBUG(Service_VI, "called");
714 } 715 }
715}; 716};
716 717
@@ -793,6 +794,7 @@ public:
793private: 794private:
794 void CloseDisplay(Kernel::HLERequestContext& ctx) { 795 void CloseDisplay(Kernel::HLERequestContext& ctx) {
795 LOG_WARNING(Service_VI, "(STUBBED) called"); 796 LOG_WARNING(Service_VI, "(STUBBED) called");
797
796 IPC::RequestParser rp{ctx}; 798 IPC::RequestParser rp{ctx};
797 u64 display = rp.Pop<u64>(); 799 u64 display = rp.Pop<u64>();
798 800
@@ -802,6 +804,7 @@ private:
802 804
803 void CreateManagedLayer(Kernel::HLERequestContext& ctx) { 805 void CreateManagedLayer(Kernel::HLERequestContext& ctx) {
804 LOG_WARNING(Service_VI, "(STUBBED) called"); 806 LOG_WARNING(Service_VI, "(STUBBED) called");
807
805 IPC::RequestParser rp{ctx}; 808 IPC::RequestParser rp{ctx};
806 u32 unknown = rp.Pop<u32>(); 809 u32 unknown = rp.Pop<u32>();
807 rp.Skip(1, false); 810 rp.Skip(1, false);
@@ -817,6 +820,7 @@ private:
817 820
818 void AddToLayerStack(Kernel::HLERequestContext& ctx) { 821 void AddToLayerStack(Kernel::HLERequestContext& ctx) {
819 LOG_WARNING(Service_VI, "(STUBBED) called"); 822 LOG_WARNING(Service_VI, "(STUBBED) called");
823
820 IPC::RequestParser rp{ctx}; 824 IPC::RequestParser rp{ctx};
821 u32 stack = rp.Pop<u32>(); 825 u32 stack = rp.Pop<u32>();
822 u64 layer_id = rp.Pop<u64>(); 826 u64 layer_id = rp.Pop<u64>();
@@ -829,10 +833,11 @@ private:
829 IPC::RequestParser rp{ctx}; 833 IPC::RequestParser rp{ctx};
830 u64 layer_id = rp.Pop<u64>(); 834 u64 layer_id = rp.Pop<u64>();
831 bool visibility = rp.Pop<bool>(); 835 bool visibility = rp.Pop<bool>();
832 IPC::ResponseBuilder rb{ctx, 2};
833 rb.Push(RESULT_SUCCESS);
834 LOG_WARNING(Service_VI, "(STUBBED) called, layer_id=0x{:X}, visibility={}", layer_id, 836 LOG_WARNING(Service_VI, "(STUBBED) called, layer_id=0x{:X}, visibility={}", layer_id,
835 visibility); 837 visibility);
838
839 IPC::ResponseBuilder rb{ctx, 2};
840 rb.Push(RESULT_SUCCESS);
836 } 841 }
837 842
838 std::shared_ptr<NVFlinger::NVFlinger> nv_flinger; 843 std::shared_ptr<NVFlinger::NVFlinger> nv_flinger;
@@ -878,6 +883,7 @@ private:
878 883
879 void OpenDisplay(Kernel::HLERequestContext& ctx) { 884 void OpenDisplay(Kernel::HLERequestContext& ctx) {
880 LOG_WARNING(Service_VI, "(STUBBED) called"); 885 LOG_WARNING(Service_VI, "(STUBBED) called");
886
881 IPC::RequestParser rp{ctx}; 887 IPC::RequestParser rp{ctx};
882 auto name_buf = rp.PopRaw<std::array<u8, 0x40>>(); 888 auto name_buf = rp.PopRaw<std::array<u8, 0x40>>();
883 auto end = std::find(name_buf.begin(), name_buf.end(), '\0'); 889 auto end = std::find(name_buf.begin(), name_buf.end(), '\0');
@@ -893,6 +899,7 @@ private:
893 899
894 void CloseDisplay(Kernel::HLERequestContext& ctx) { 900 void CloseDisplay(Kernel::HLERequestContext& ctx) {
895 LOG_WARNING(Service_VI, "(STUBBED) called"); 901 LOG_WARNING(Service_VI, "(STUBBED) called");
902
896 IPC::RequestParser rp{ctx}; 903 IPC::RequestParser rp{ctx};
897 u64 display_id = rp.Pop<u64>(); 904 u64 display_id = rp.Pop<u64>();
898 905
@@ -902,6 +909,7 @@ private:
902 909
903 void GetDisplayResolution(Kernel::HLERequestContext& ctx) { 910 void GetDisplayResolution(Kernel::HLERequestContext& ctx) {
904 LOG_WARNING(Service_VI, "(STUBBED) called"); 911 LOG_WARNING(Service_VI, "(STUBBED) called");
912
905 IPC::RequestParser rp{ctx}; 913 IPC::RequestParser rp{ctx};
906 u64 display_id = rp.Pop<u64>(); 914 u64 display_id = rp.Pop<u64>();
907 915
@@ -923,6 +931,7 @@ private:
923 931
924 void SetLayerScalingMode(Kernel::HLERequestContext& ctx) { 932 void SetLayerScalingMode(Kernel::HLERequestContext& ctx) {
925 LOG_WARNING(Service_VI, "(STUBBED) called"); 933 LOG_WARNING(Service_VI, "(STUBBED) called");
934
926 IPC::RequestParser rp{ctx}; 935 IPC::RequestParser rp{ctx};
927 u32 scaling_mode = rp.Pop<u32>(); 936 u32 scaling_mode = rp.Pop<u32>();
928 u64 unknown = rp.Pop<u64>(); 937 u64 unknown = rp.Pop<u64>();
@@ -932,6 +941,8 @@ private:
932 } 941 }
933 942
934 void ListDisplays(Kernel::HLERequestContext& ctx) { 943 void ListDisplays(Kernel::HLERequestContext& ctx) {
944 LOG_WARNING(Service_VI, "(STUBBED) called");
945
935 IPC::RequestParser rp{ctx}; 946 IPC::RequestParser rp{ctx};
936 DisplayInfo display_info; 947 DisplayInfo display_info;
937 display_info.width *= static_cast<u64>(Settings::values.resolution_factor); 948 display_info.width *= static_cast<u64>(Settings::values.resolution_factor);
@@ -940,11 +951,11 @@ private:
940 IPC::ResponseBuilder rb{ctx, 4}; 951 IPC::ResponseBuilder rb{ctx, 4};
941 rb.Push(RESULT_SUCCESS); 952 rb.Push(RESULT_SUCCESS);
942 rb.Push<u64>(1); 953 rb.Push<u64>(1);
943 LOG_WARNING(Service_VI, "(STUBBED) called");
944 } 954 }
945 955
946 void OpenLayer(Kernel::HLERequestContext& ctx) { 956 void OpenLayer(Kernel::HLERequestContext& ctx) {
947 LOG_DEBUG(Service_VI, "called"); 957 LOG_DEBUG(Service_VI, "called");
958
948 IPC::RequestParser rp{ctx}; 959 IPC::RequestParser rp{ctx};
949 auto name_buf = rp.PopRaw<std::array<u8, 0x40>>(); 960 auto name_buf = rp.PopRaw<std::array<u8, 0x40>>();
950 auto end = std::find(name_buf.begin(), name_buf.end(), '\0'); 961 auto end = std::find(name_buf.begin(), name_buf.end(), '\0');
@@ -995,6 +1006,7 @@ private:
995 1006
996 void GetDisplayVsyncEvent(Kernel::HLERequestContext& ctx) { 1007 void GetDisplayVsyncEvent(Kernel::HLERequestContext& ctx) {
997 LOG_WARNING(Service_VI, "(STUBBED) called"); 1008 LOG_WARNING(Service_VI, "(STUBBED) called");
1009
998 IPC::RequestParser rp{ctx}; 1010 IPC::RequestParser rp{ctx};
999 u64 display_id = rp.Pop<u64>(); 1011 u64 display_id = rp.Pop<u64>();
1000 1012