diff options
| author | 2014-04-18 17:52:49 -0400 | |
|---|---|---|
| committer | 2014-04-18 17:52:49 -0400 | |
| commit | 958bca606e80110e05d7c142dda3097fddc96503 (patch) | |
| tree | 576917751444b4dfdb476d040b4e075bde431b7b /src/core/hle/service/srv.cpp | |
| parent | Init window size from VideoCore. Start changing the default window behavior... (diff) | |
| parent | renamed hw_lcd module to just lcd (diff) | |
| download | yuzu-958bca606e80110e05d7c142dda3097fddc96503.tar.gz yuzu-958bca606e80110e05d7c142dda3097fddc96503.tar.xz yuzu-958bca606e80110e05d7c142dda3097fddc96503.zip | |
Merge branch 'hle-interface'
Diffstat (limited to 'src/core/hle/service/srv.cpp')
| -rw-r--r-- | src/core/hle/service/srv.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp new file mode 100644 index 000000000..579ea4a34 --- /dev/null +++ b/src/core/hle/service/srv.cpp | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/hle/hle.h" | ||
| 6 | #include "core/hle/service/srv.h" | ||
| 7 | #include "core/hle/service/service.h" | ||
| 8 | |||
| 9 | |||
| 10 | //////////////////////////////////////////////////////////////////////////////////////////////////// | ||
| 11 | // Namespace SRV | ||
| 12 | |||
| 13 | namespace SRV { | ||
| 14 | |||
| 15 | void Initialize() { | ||
| 16 | NOTICE_LOG(OSHLE, "SRV::Sync - Initialize"); | ||
| 17 | } | ||
| 18 | |||
| 19 | void GetServiceHandle() { | ||
| 20 | Syscall::Result res = 0; | ||
| 21 | u32* cmd_buff = (u32*)HLE::GetPointer(HLE::CMD_BUFFER_ADDR + Service::kCommandHeaderOffset); | ||
| 22 | |||
| 23 | std::string port_name = std::string((const char*)&cmd_buff[1], 0, Service::kMaxPortSize); | ||
| 24 | Service::Interface* service = Service::g_manager->FetchFromPortName(port_name); | ||
| 25 | |||
| 26 | NOTICE_LOG(OSHLE, "SRV::Sync - GetHandle - port: %s, handle: 0x%08X", port_name.c_str(), | ||
| 27 | service->GetUID()); | ||
| 28 | |||
| 29 | if (NULL != service) { | ||
| 30 | cmd_buff[3] = service->GetUID(); | ||
| 31 | } else { | ||
| 32 | ERROR_LOG(OSHLE, "Service %s does not exist", port_name.c_str()); | ||
| 33 | res = -1; | ||
| 34 | } | ||
| 35 | cmd_buff[1] = res; | ||
| 36 | |||
| 37 | //return res; | ||
| 38 | } | ||
| 39 | |||
| 40 | const HLE::FunctionDef FunctionTable[] = { | ||
| 41 | {0x00010002, Initialize, "Initialize"}, | ||
| 42 | {0x00020000, NULL, "GetProcSemaphore"}, | ||
| 43 | {0x00030100, NULL, "RegisterService"}, | ||
| 44 | {0x000400C0, NULL, "UnregisterService"}, | ||
| 45 | {0x00050100, GetServiceHandle, "GetServiceHandle"}, | ||
| 46 | }; | ||
| 47 | |||
| 48 | //////////////////////////////////////////////////////////////////////////////////////////////////// | ||
| 49 | // Interface class | ||
| 50 | |||
| 51 | Interface::Interface() { | ||
| 52 | Register(FunctionTable, ARRAY_SIZE(FunctionTable)); | ||
| 53 | } | ||
| 54 | |||
| 55 | Interface::~Interface() { | ||
| 56 | } | ||
| 57 | |||
| 58 | } // namespace | ||