diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index f8ee3c8cd..576ec39dd 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -37,6 +37,7 @@ set(SRCS core.cpp
hle/kernel/event.cpp
hle/kernel/kernel.cpp
hle/kernel/mutex.cpp
+ hle/kernel/semaphore.cpp
hle/kernel/thread.cpp
hle/kernel/shared_memory.cpp
hle/service/apt.cpp
@@ -85,6 +86,7 @@ set(HEADERS core.h
hle/svc.h
hle/kernel/kernel.h
hle/kernel/mutex.h
+ hle/kernel/semaphore.h
hle/kernel/shared_memory.h
hle/kernel/thread.h
hle/function_wrappers.h
diff --git a/src/core/core.vcxproj b/src/core/core.vcxproj
index 8f3561653..176102592 100644
--- a/src/core/core.vcxproj
+++ b/src/core/core.vcxproj
@@ -181,6 +181,7 @@
+
@@ -234,6 +235,7 @@
+
diff --git a/src/core/core.vcxproj.filters b/src/core/core.vcxproj.filters
index 33b00ab90..999d7698d 100644
--- a/src/core/core.vcxproj.filters
+++ b/src/core/core.vcxproj.filters
@@ -52,6 +52,7 @@
+
@@ -104,6 +105,7 @@
+
diff --git a/src/core/hle/function_wrappers.h b/src/core/hle/function_wrappers.h
index f9a64c0a5..a8aab9e21 100644
--- a/src/core/hle/function_wrappers.h
+++ b/src/core/hle/function_wrappers.h
@@ -90,6 +90,20 @@ template void Wrap() {
RETURN(retval);
}
+template void Wrap() {
+ u32 param_1 = 0;
+ u32 retval = func(¶m_1, (s32)PARAM(1), (s32)PARAM(2));
+ Core::g_app_core->SetReg(1, param_1);
+ RETURN(retval);
+}
+
+template void Wrap() {
+ s32 param_0 = 0;
+ u32 retval = func(¶m_0, PARAM(1), (s32)PARAM(2));
+ Core::g_app_core->SetReg(1, param_0);
+ RETURN(retval);
+}
+
////////////////////////////////////////////////////////////////////////////////////////////////////
// Function wrappers that return type u32
diff --git a/src/core/hle/kernel/semaphore.cpp b/src/core/hle/kernel/semaphore.cpp
new file mode 100644
index 000000000..49ab5fbd3
--- /dev/null
+++ b/src/core/hle/kernel/semaphore.cpp
@@ -0,0 +1,100 @@
+// Copyright 2014 Citra Emulator Project
+// Licensed under GPLv2
+// Refer to the license.txt file included.
+
+#include