diff options
author | bunnei <ericbunnie@gmail.com> | 2014-04-13 06:38:48 +0200 |
---|---|---|
committer | bunnei <ericbunnie@gmail.com> | 2014-04-13 06:38:48 +0200 |
commit | 5ea4679630d6776837114252476dd445f377322d (patch) | |
tree | 3dc3dd3084669edd83637c344866264dd1120632 | |
parent | added a GetPointer function for reading from HLE command buffer (diff) | |
download | yuzu-5ea4679630d6776837114252476dd445f377322d.tar yuzu-5ea4679630d6776837114252476dd445f377322d.tar.gz yuzu-5ea4679630d6776837114252476dd445f377322d.tar.bz2 yuzu-5ea4679630d6776837114252476dd445f377322d.tar.lz yuzu-5ea4679630d6776837114252476dd445f377322d.tar.xz yuzu-5ea4679630d6776837114252476dd445f377322d.tar.zst yuzu-5ea4679630d6776837114252476dd445f377322d.zip |
-rw-r--r-- | src/core/hle/service/service.cpp | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 3434b6dbf..556dfc8a2 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -5,15 +5,16 @@ #include "common/common.h" #include "common/log.h" +#include "core/hle/hle.h" #include "core/hle/service/service.h" -//////////////////////////////////////////////////////////////////////////////////////////////////// -// Namespace Service - namespace Service { Manager* g_manager = NULL; ///< Service manager +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Service Manager class + Manager::Manager() { } @@ -62,7 +63,11 @@ Interface* Manager::FetchFromPortName(std::string port_name) { return FetchFromUID(itr->second); } +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Interface to "SRV" service + class Interface_SRV : public Interface { + public: Interface_SRV() { @@ -71,6 +76,12 @@ public: ~Interface_SRV() { } + enum { + CMD_OFFSET = 0x80, + CMD_HEADER_INIT = 0x10002, ///< Command header to initialize SRV service + CMD_HEADER_GET_HANDLE = 0x50100, ///< Command header to get handle of other services + }; + /** * Gets the string name used by CTROS for a service * @return String name of service @@ -92,12 +103,27 @@ public: * @return Return result of svcSendSyncRequest passed back to user app */ Syscall::Result Sync() { - ERROR_LOG(HLE, "Unimplemented function Interface_SRV::Sync"); + u32 header = 0; + HLE::Read<u32>(header, (HLE::CMD_BUFFER_ADDR + CMD_OFFSET)); + + switch (header) { + case CMD_HEADER_INIT: + NOTICE_LOG(HLE, "Interface_SRV::Sync - Initialize"); + break; + + case CMD_HEADER_GET_HANDLE: + NOTICE_LOG(HLE, "Interface_SRV::Sync - GetHandle, port: %s", HLE::GetCharPointer(HLE::CMD_BUFFER_ADDR + CMD_OFFSET + 4)); + break; + } + return 0; } - + }; +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Module interface + /// Initialize ServiceManager void Init() { g_manager = new Manager; |