summaryrefslogtreecommitdiffstats
path: root/src/core/hle/function_wrappers.h
diff options
context:
space:
mode:
authorSebastian Valle <subv2112@gmail.com>2017-06-30 00:05:22 +0200
committerGitHub <noreply@github.com>2017-06-30 00:05:22 +0200
commit56d718b2a1d6385c88c2044f780280a5dfbc6072 (patch)
treea74b2c67bde47be93f2b2c3d55292bfbb421985a /src/core/hle/function_wrappers.h
parentMerge pull request #2809 from wwylele/texture-copy-fix (diff)
parentKernel/SVC: Pass the current thread as a parameter to ClientSession::SendSyncRequest. (diff)
downloadyuzu-56d718b2a1d6385c88c2044f780280a5dfbc6072.tar
yuzu-56d718b2a1d6385c88c2044f780280a5dfbc6072.tar.gz
yuzu-56d718b2a1d6385c88c2044f780280a5dfbc6072.tar.bz2
yuzu-56d718b2a1d6385c88c2044f780280a5dfbc6072.tar.lz
yuzu-56d718b2a1d6385c88c2044f780280a5dfbc6072.tar.xz
yuzu-56d718b2a1d6385c88c2044f780280a5dfbc6072.tar.zst
yuzu-56d718b2a1d6385c88c2044f780280a5dfbc6072.zip
Diffstat (limited to 'src/core/hle/function_wrappers.h')
-rw-r--r--src/core/hle/function_wrappers.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/core/hle/function_wrappers.h b/src/core/hle/function_wrappers.h
index 410bb87ea..5e6002f4e 100644
--- a/src/core/hle/function_wrappers.h
+++ b/src/core/hle/function_wrappers.h
@@ -16,9 +16,6 @@ namespace HLE {
#define PARAM(n) Core::CPU().GetReg(n)
-/// An invalid result code that is meant to be overwritten when a thread resumes from waiting
-static const ResultCode RESULT_INVALID(0xDEADC0DE);
-
/**
* HLE a function return from the current ARM11 userland process
* @param res Result to return
@@ -68,10 +65,18 @@ void Wrap() {
(PARAM(3) != 0), (((s64)PARAM(4) << 32) | PARAM(0)))
.raw;
- if (retval != RESULT_INVALID.raw) {
- Core::CPU().SetReg(1, (u32)param_1);
- FuncReturn(retval);
- }
+ Core::CPU().SetReg(1, (u32)param_1);
+ FuncReturn(retval);
+}
+
+template <ResultCode func(s32*, u32*, s32, u32)>
+void Wrap() {
+ s32 param_1 = 0;
+ u32 retval =
+ func(&param_1, (Kernel::Handle*)Memory::GetPointer(PARAM(1)), (s32)PARAM(2), PARAM(3)).raw;
+
+ Core::CPU().SetReg(1, (u32)param_1);
+ FuncReturn(retval);
}
template <ResultCode func(u32, u32, u32, u32, s64)>
@@ -92,9 +97,7 @@ template <ResultCode func(u32, s64)>
void Wrap() {
s32 retval = func(PARAM(0), (((s64)PARAM(3) << 32) | PARAM(2))).raw;
- if (retval != RESULT_INVALID.raw) {
- FuncReturn(retval);
- }
+ FuncReturn(retval);
}
template <ResultCode func(MemoryInfo*, PageInfo*, u32)>