summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/hle/service/apt.cpp35
-rw-r--r--src/core/hle/service/apt.h8
-rw-r--r--src/core/hle/service/service.cpp10
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 @@
4 4
5 5
6#include "common/log.h" 6#include "common/log.h"
7#include "core/hle/service/apt.h"
8
9
10 7
8#include "core/hle/hle.h"
9#include "core/hle/service/apt.h"
11 10
12namespace Service { 11namespace Service {
13 12
13// Returns handle to APT Mutex. Not imlemented.
14Syscall::Result APT::GetLockHandle() {
15 return 0x00000000;
16}
14 17
18/**
19 * Called when svcSendSyncRequest is called, loads command buffer and executes comand
20 * @return Return result of svcSendSyncRequest passed back to user app
21 */
15Syscall::Result APT::Sync() { 22Syscall::Result APT::Sync() {
16 NOTICE_LOG(HLE, "APT::Sync - Initialize"); 23 Syscall::Result res = 0;
17 return 0; 24 u32* cmd_buff = (u32*)HLE::GetPointer(HLE::CMD_BUFFER_ADDR + CMD_OFFSET);
25
26 switch(cmd_buff[0]) {
27 case CMD_HEADER_INIT:
28 NOTICE_LOG(OSHLE, "APT::Sync - Initialize");
29 break;
30
31 case CMD_HEADER_GET_LOCK_HANDLE:
32 NOTICE_LOG(OSHLE, "APT::Sync - GetLockHandle");
33 cmd_buff[5] = GetLockHandle();
34 break;
35
36 default:
37 ERROR_LOG(OSHLE, "APT::Sync - Unknown command 0x%08X", cmd_buff[0]);
38 res = -1;
39 break;
40 }
41
42 return res;
18} 43}
19 44
20 45
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:
64 * Called when svcSendSyncRequest is called, loads command buffer and executes comand 64 * Called when svcSendSyncRequest is called, loads command buffer and executes comand
65 * @return Return result of svcSendSyncRequest passed back to user app 65 * @return Return result of svcSendSyncRequest passed back to user app
66 */ 66 */
67 virtual Syscall::Result Sync(); 67 Syscall::Result Sync();
68
69private:
70
71
72 Syscall::Result GetLockHandle();
73
68 74
69}; 75};
70 76
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:
104 * @return Return result of svcSendSyncRequest passed back to user app 104 * @return Return result of svcSendSyncRequest passed back to user app
105 */ 105 */
106 Syscall::Result Sync() { 106 Syscall::Result Sync() {
107 u32 header = 0;
108 Syscall::Result res = 0; 107 Syscall::Result res = 0;
109
110 u32* cmd_buff = (u32*)HLE::GetPointer(HLE::CMD_BUFFER_ADDR + CMD_OFFSET); 108 u32* cmd_buff = (u32*)HLE::GetPointer(HLE::CMD_BUFFER_ADDR + CMD_OFFSET);
111 109
112 switch (cmd_buff[0]) { 110 switch (cmd_buff[0]) {
@@ -116,6 +114,7 @@ public:
116 break; 114 break;
117 115
118 case CMD_HEADER_GET_HANDLE: 116 case CMD_HEADER_GET_HANDLE:
117 {
119 const char* port_name = (const char*)&cmd_buff[1]; 118 const char* port_name = (const char*)&cmd_buff[1];
120 Interface* service = g_manager->FetchFromPortName(port_name); 119 Interface* service = g_manager->FetchFromPortName(port_name);
121 120
@@ -128,7 +127,12 @@ public:
128 ERROR_LOG(OSHLE, "Service %s does not exist", port_name); 127 ERROR_LOG(OSHLE, "Service %s does not exist", port_name);
129 res = -1; 128 res = -1;
130 } 129 }
131 130 break;
131 }
132
133 default:
134 ERROR_LOG(OSHLE, "SRV::Sync - Unknown command 0x%08X", cmd_buff[0]);
135 res = -1;
132 break; 136 break;
133 } 137 }
134 138