diff options
| author | 2014-05-18 17:52:02 -0400 | |
|---|---|---|
| committer | 2014-05-18 17:52:02 -0400 | |
| commit | 8fba88d5d59ad4cd89a343e1562a314874bd88a4 (patch) | |
| tree | 09e3bc7d1e55360909ec48a727a2906c2d16524e /src | |
| parent | added stubbed function for WaitSynchronizationN (diff) | |
| download | yuzu-8fba88d5d59ad4cd89a343e1562a314874bd88a4.tar.gz yuzu-8fba88d5d59ad4cd89a343e1562a314874bd88a4.tar.xz yuzu-8fba88d5d59ad4cd89a343e1562a314874bd88a4.zip | |
- added stub for CreateEvent
- changed some stubbed SVCs to return unique handle names for debugging purposes
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/syscall.cpp | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/core/hle/syscall.cpp b/src/core/hle/syscall.cpp index 728679378..047d8c40f 100644 --- a/src/core/hle/syscall.cpp +++ b/src/core/hle/syscall.cpp | |||
| @@ -3,6 +3,9 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <map> | 5 | #include <map> |
| 6 | #include <string> | ||
| 7 | |||
| 8 | #include "common/symbols.h" | ||
| 6 | 9 | ||
| 7 | #include "core/mem_map.h" | 10 | #include "core/mem_map.h" |
| 8 | 11 | ||
| @@ -14,8 +17,6 @@ | |||
| 14 | #include "core/hle/service/service.h" | 17 | #include "core/hle/service/service.h" |
| 15 | #include "core/hle/kernel/thread.h" | 18 | #include "core/hle/kernel/thread.h" |
| 16 | 19 | ||
| 17 | #include "common/symbols.h" | ||
| 18 | |||
| 19 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 20 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 20 | // Namespace Syscall | 21 | // Namespace Syscall |
| 21 | 22 | ||
| @@ -81,7 +82,6 @@ Result MapMemoryBlock(Handle memblock, u32 addr, u32 mypermissions, u32 otherper | |||
| 81 | 82 | ||
| 82 | /// Connect to an OS service given the port name, returns the handle to the port to out | 83 | /// Connect to an OS service given the port name, returns the handle to the port to out |
| 83 | Result ConnectToPort(void* out, const char* port_name) { | 84 | Result ConnectToPort(void* out, const char* port_name) { |
| 84 | |||
| 85 | Service::Interface* service = Service::g_manager->FetchFromPortName(port_name); | 85 | Service::Interface* service = Service::g_manager->FetchFromPortName(port_name); |
| 86 | Core::g_app_core->SetReg(1, service->GetUID()); | 86 | Core::g_app_core->SetReg(1, service->GetUID()); |
| 87 | DEBUG_LOG(SVC, "ConnectToPort called port_name=%s", port_name); | 87 | DEBUG_LOG(SVC, "ConnectToPort called port_name=%s", port_name); |
| @@ -116,8 +116,13 @@ Result WaitSynchronizationN(void* _out, void* _handles, u32 handle_count, u32 wa | |||
| 116 | s32* out = (s32*)_out; | 116 | s32* out = (s32*)_out; |
| 117 | Handle* handles = (Handle*)_handles; | 117 | Handle* handles = (Handle*)_handles; |
| 118 | // ImplementMe | 118 | // ImplementMe |
| 119 | DEBUG_LOG(SVC, "(UNIMPLEMENTED) WaitSynchronizationN called handle_count=%d, wait_all=%d, nanoseconds=%d", | 119 | |
| 120 | handle_count, wait_all, nano_seconds); | 120 | DEBUG_LOG(SVC, "(UNIMPLEMENTED) WaitSynchronizationN called handle_count=%d, wait_all=%s, nanoseconds=%d %s", |
| 121 | handle_count, (wait_all ? "true" : "false"), nano_seconds); | ||
| 122 | |||
| 123 | for (int i = 0; i < handle_count; i++) { | ||
| 124 | DEBUG_LOG(SVC, "\thandle[%d]=0x%08X", i, handles[i]); | ||
| 125 | } | ||
| 121 | return 0; | 126 | return 0; |
| 122 | } | 127 | } |
| 123 | 128 | ||
| @@ -125,7 +130,7 @@ Result WaitSynchronizationN(void* _out, void* _handles, u32 handle_count, u32 wa | |||
| 125 | Result CreateAddressArbiter(void* arbiter) { | 130 | Result CreateAddressArbiter(void* arbiter) { |
| 126 | // ImplementMe | 131 | // ImplementMe |
| 127 | DEBUG_LOG(SVC, "(UNIMPLEMENTED) CreateAddressArbiter called"); | 132 | DEBUG_LOG(SVC, "(UNIMPLEMENTED) CreateAddressArbiter called"); |
| 128 | Core::g_app_core->SetReg(1, 0xDEADBEEF); | 133 | Core::g_app_core->SetReg(1, 0xFABBDADD); |
| 129 | return 0; | 134 | return 0; |
| 130 | } | 135 | } |
| 131 | 136 | ||
| @@ -170,7 +175,8 @@ Result CreateThread(void* thread, u32 priority, u32 entry_point, u32 arg, u32 st | |||
| 170 | 175 | ||
| 171 | Handle handle = __KernelCreateThread(name.c_str(), entry_point, priority, processor_id, | 176 | Handle handle = __KernelCreateThread(name.c_str(), entry_point, priority, processor_id, |
| 172 | stack_top); | 177 | stack_top); |
| 173 | 178 | Core::g_app_core->SetReg(1, 0xFEEDDEAF); | |
| 179 | |||
| 174 | return 0; | 180 | return 0; |
| 175 | } | 181 | } |
| 176 | 182 | ||
| @@ -178,6 +184,7 @@ Result CreateMutex(void* _mutex, u32 initial_locked) { | |||
| 178 | Handle* mutex = (Handle*)_mutex; | 184 | Handle* mutex = (Handle*)_mutex; |
| 179 | DEBUG_LOG(SVC, "(UNIMPLEMENTED) CreateMutex called initial_locked=%s", | 185 | DEBUG_LOG(SVC, "(UNIMPLEMENTED) CreateMutex called initial_locked=%s", |
| 180 | initial_locked ? "true" : "false"); | 186 | initial_locked ? "true" : "false"); |
| 187 | Core::g_app_core->SetReg(1, 0xF00D0BAD); | ||
| 181 | return 0; | 188 | return 0; |
| 182 | } | 189 | } |
| 183 | 190 | ||
| @@ -198,6 +205,13 @@ Result QueryMemory(void *_info, void *_out, u32 addr) { | |||
| 198 | return 0; | 205 | return 0; |
| 199 | } | 206 | } |
| 200 | 207 | ||
| 208 | Result CreateEvent(void* _event, u32 reset_type) { | ||
| 209 | Handle* event = (Handle*)_event; | ||
| 210 | DEBUG_LOG(SVC, "(UNIMPLEMENTED) CreateEvent called reset_type=0x%08X", reset_type); | ||
| 211 | Core::g_app_core->SetReg(1, 0xBADC0DE0); | ||
| 212 | return 0; | ||
| 213 | } | ||
| 214 | |||
| 201 | const HLE::FunctionDef Syscall_Table[] = { | 215 | const HLE::FunctionDef Syscall_Table[] = { |
| 202 | {0x00, NULL, "Unknown"}, | 216 | {0x00, NULL, "Unknown"}, |
| 203 | {0x01, WrapI_VUUUUU<ControlMemory>, "ControlMemory"}, | 217 | {0x01, WrapI_VUUUUU<ControlMemory>, "ControlMemory"}, |
| @@ -222,7 +236,7 @@ const HLE::FunctionDef Syscall_Table[] = { | |||
| 222 | {0x14, WrapI_U<ReleaseMutex>, "ReleaseMutex"}, | 236 | {0x14, WrapI_U<ReleaseMutex>, "ReleaseMutex"}, |
| 223 | {0x15, NULL, "CreateSemaphore"}, | 237 | {0x15, NULL, "CreateSemaphore"}, |
| 224 | {0x16, NULL, "ReleaseSemaphore"}, | 238 | {0x16, NULL, "ReleaseSemaphore"}, |
| 225 | {0x17, NULL, "CreateEvent"}, | 239 | {0x17, WrapI_VU<CreateEvent>, "CreateEvent"}, |
| 226 | {0x18, NULL, "SignalEvent"}, | 240 | {0x18, NULL, "SignalEvent"}, |
| 227 | {0x19, NULL, "ClearEvent"}, | 241 | {0x19, NULL, "ClearEvent"}, |
| 228 | {0x1A, NULL, "CreateTimer"}, | 242 | {0x1A, NULL, "CreateTimer"}, |