diff options
author | bunnei <ericbunnie@gmail.com> | 2014-04-16 05:28:03 +0200 |
---|---|---|
committer | bunnei <ericbunnie@gmail.com> | 2014-04-16 05:28:03 +0200 |
commit | ffabed8c25490be0e61409cebd1615eedb223c3d (patch) | |
tree | 9dc74eb2673323a0627211bcdf6781e84f5f604a /src/core/hle/service/service.h | |
parent | fixed naming for APT_U (diff) | |
download | yuzu-ffabed8c25490be0e61409cebd1615eedb223c3d.tar yuzu-ffabed8c25490be0e61409cebd1615eedb223c3d.tar.gz yuzu-ffabed8c25490be0e61409cebd1615eedb223c3d.tar.bz2 yuzu-ffabed8c25490be0e61409cebd1615eedb223c3d.tar.lz yuzu-ffabed8c25490be0e61409cebd1615eedb223c3d.tar.xz yuzu-ffabed8c25490be0e61409cebd1615eedb223c3d.tar.zst yuzu-ffabed8c25490be0e61409cebd1615eedb223c3d.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/service.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index 9368a9f0f..3b256aa3e 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h @@ -17,7 +17,9 @@ namespace Service { -typedef s32 NativeUID; ///< Native handle for a service +typedef s32 NativeUID; ///< Native handle for a service + +static const int kCommandHeaderOffset = 0x80; ///< Offset into command buffer of header class Manager; @@ -26,6 +28,9 @@ class Interface { friend class Manager; public: + Interface() { + } + virtual ~Interface() { } @@ -49,7 +54,24 @@ 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() = 0; + Syscall::Result Sync() { + u32* cmd_buff = (u32*)HLE::GetPointer(HLE::CMD_BUFFER_ADDR + kCommandHeaderOffset); + auto itr = m_functions.find(cmd_buff[0]); + + if (itr == m_functions.end()) { + ERROR_LOG(OSHLE, "Unknown/unimplemented function: port=%s, command=0x%08X!", + GetPortName().c_str(), cmd_buff[0]); + return -1; + } + if (itr->second.func == NULL) { + ERROR_LOG(OSHLE, "Unimplemented function: port=%s, name=%s!", + GetPortName().c_str(), itr->second.name.c_str()); + } + + itr->second.func(); + + return 0; // TODO: Implement return from actual function + } protected: /** @@ -64,6 +86,8 @@ protected: private: u32 m_uid; std::map<u32, HLE::FunctionDef> m_functions; + + DISALLOW_COPY_AND_ASSIGN(Interface); }; /// Simple class to manage accessing services from ports and UID handles |