diff options
author | bunnei <ericbunnie@gmail.com> | 2014-04-13 22:33:45 +0200 |
---|---|---|
committer | bunnei <ericbunnie@gmail.com> | 2014-04-13 22:33:45 +0200 |
commit | 9f4d677cdf1fcc937d2e68cae3f52f53c24582f8 (patch) | |
tree | 8d92dbc0b8e568dd67649511c070b31e7ca5d125 /src/core/hle/service/service.cpp | |
parent | renamed class Interface_SRV to SRV (diff) | |
download | yuzu-9f4d677cdf1fcc937d2e68cae3f52f53c24582f8.tar yuzu-9f4d677cdf1fcc937d2e68cae3f52f53c24582f8.tar.gz yuzu-9f4d677cdf1fcc937d2e68cae3f52f53c24582f8.tar.bz2 yuzu-9f4d677cdf1fcc937d2e68cae3f52f53c24582f8.tar.lz yuzu-9f4d677cdf1fcc937d2e68cae3f52f53c24582f8.tar.xz yuzu-9f4d677cdf1fcc937d2e68cae3f52f53c24582f8.tar.zst yuzu-9f4d677cdf1fcc937d2e68cae3f52f53c24582f8.zip |
Diffstat (limited to 'src/core/hle/service/service.cpp')
-rw-r--r-- | src/core/hle/service/service.cpp | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index b0b2b7b35..b2470d814 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -7,6 +7,7 @@ #include "core/hle/hle.h" #include "core/hle/service/service.h" +#include "core/hle/service/apt.h" namespace Service { @@ -104,19 +105,36 @@ public: */ Syscall::Result Sync() { u32 header = 0; - HLE::Read<u32>(header, (HLE::CMD_BUFFER_ADDR + CMD_OFFSET)); + Syscall::Result res = 0; + + u32* cmd_buff = (u32*)HLE::GetPointer(HLE::CMD_BUFFER_ADDR + CMD_OFFSET); + + switch (cmd_buff[0]) { - switch (header) { case CMD_HEADER_INIT: - NOTICE_LOG(HLE, "SRV::Sync - Initialize"); + NOTICE_LOG(OSHLE, "SRV::Sync - Initialize"); break; case CMD_HEADER_GET_HANDLE: - NOTICE_LOG(HLE, "SRV::Sync - GetHandle, port: %s", HLE::GetCharPointer(HLE::CMD_BUFFER_ADDR + CMD_OFFSET + 4)); + const char* port_name = (const char*)&cmd_buff[1]; + Interface* service = g_manager->FetchFromPortName(port_name); + + NOTICE_LOG(OSHLE, "SRV::Sync - GetHandle - port: %s, handle: 0x%08X", port_name, + service->GetUID()); + + if (NULL != service) { + cmd_buff[3] = service->GetUID(); + } else { + ERROR_LOG(OSHLE, "Service %s does not exist", port_name); + res = -1; + } + break; } - return 0; + cmd_buff[1] = res; + + return res; } }; @@ -128,6 +146,7 @@ public: void Init() { g_manager = new Manager; g_manager->AddService(new SRV); + g_manager->AddService(new APT); NOTICE_LOG(HLE, "Services initialized OK"); } |