diff options
author | bunnei <ericbunnie@gmail.com> | 2014-04-14 04:59:16 +0200 |
---|---|---|
committer | bunnei <ericbunnie@gmail.com> | 2014-04-14 04:59:16 +0200 |
commit | 18766b9e69bf822764eba98237325d07b3c4ef0f (patch) | |
tree | bc7fc97b99c1be776c9ed23c1151aecb3ee4ee59 | |
parent | added framework for APT service (application and title launching service) (diff) | |
download | yuzu-18766b9e69bf822764eba98237325d07b3c4ef0f.tar yuzu-18766b9e69bf822764eba98237325d07b3c4ef0f.tar.gz yuzu-18766b9e69bf822764eba98237325d07b3c4ef0f.tar.bz2 yuzu-18766b9e69bf822764eba98237325d07b3c4ef0f.tar.lz yuzu-18766b9e69bf822764eba98237325d07b3c4ef0f.tar.xz yuzu-18766b9e69bf822764eba98237325d07b3c4ef0f.tar.zst yuzu-18766b9e69bf822764eba98237325d07b3c4ef0f.zip |
-rw-r--r-- | src/core/hle/service/apt.cpp | 35 | ||||
-rw-r--r-- | src/core/hle/service/apt.h | 8 | ||||
-rw-r--r-- | src/core/hle/service/service.cpp | 10 |
3 files changed, 44 insertions, 9 deletions
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; } diff --git a/src/core/hle/service/apt.h b/src/core/hle/service/apt.h index 05c544378..3730bc30e 100644 --- a/src/core/hle/service/apt.h +++ b/src/core/hle/service/apt.h @@ -64,7 +64,13 @@ public: * Called when svcSendSyncRequest is called, loads command buffer and executes comand * @return Return result of svcSendSyncRequest passed back to user app */ - virtual Syscall::Result Sync(); + Syscall::Result Sync(); + +private: + + + Syscall::Result GetLockHandle(); + }; diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index b2470d814..44c7c8627 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -104,9 +104,7 @@ public: * @return Return result of svcSendSyncRequest passed back to user app */ Syscall::Result Sync() { - u32 header = 0; Syscall::Result res = 0; - u32* cmd_buff = (u32*)HLE::GetPointer(HLE::CMD_BUFFER_ADDR + CMD_OFFSET); switch (cmd_buff[0]) { @@ -116,6 +114,7 @@ public: break; case CMD_HEADER_GET_HANDLE: + { const char* port_name = (const char*)&cmd_buff[1]; Interface* service = g_manager->FetchFromPortName(port_name); @@ -128,7 +127,12 @@ public: ERROR_LOG(OSHLE, "Service %s does not exist", port_name); res = -1; } - + break; + } + + default: + ERROR_LOG(OSHLE, "SRV::Sync - Unknown command 0x%08X", cmd_buff[0]); + res = -1; break; } |