From 18766b9e69bf822764eba98237325d07b3c4ef0f Mon Sep 17 00:00:00 2001 From: bunnei Date: Sun, 13 Apr 2014 22:59:16 -0400 Subject: added a stub for GetLockHandle --- src/core/hle/service/apt.cpp | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'src/core/hle/service/apt.cpp') diff --git a/src/core/hle/service/apt.cpp b/src/core/hle/service/apt.cpp index 9ab5a361c..5e37b838a 100644 --- a/src/core/hle/service/apt.cpp +++ b/src/core/hle/service/apt.cpp @@ -4,17 +4,42 @@ #include "common/log.h" -#include "core/hle/service/apt.h" - - +#include "core/hle/hle.h" +#include "core/hle/service/apt.h" namespace Service { +// Returns handle to APT Mutex. Not imlemented. +Syscall::Result APT::GetLockHandle() { + return 0x00000000; +} +/** + * Called when svcSendSyncRequest is called, loads command buffer and executes comand + * @return Return result of svcSendSyncRequest passed back to user app + */ Syscall::Result APT::Sync() { - NOTICE_LOG(HLE, "APT::Sync - Initialize"); - return 0; + Syscall::Result res = 0; + u32* cmd_buff = (u32*)HLE::GetPointer(HLE::CMD_BUFFER_ADDR + CMD_OFFSET); + + switch(cmd_buff[0]) { + case CMD_HEADER_INIT: + NOTICE_LOG(OSHLE, "APT::Sync - Initialize"); + break; + + case CMD_HEADER_GET_LOCK_HANDLE: + NOTICE_LOG(OSHLE, "APT::Sync - GetLockHandle"); + cmd_buff[5] = GetLockHandle(); + break; + + default: + ERROR_LOG(OSHLE, "APT::Sync - Unknown command 0x%08X", cmd_buff[0]); + res = -1; + break; + } + + return res; } -- cgit v1.2.3