summaryrefslogtreecommitdiff
path: root/src/core/hle/function_wrappers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/function_wrappers.h')
-rw-r--r--src/core/hle/function_wrappers.h38
1 files changed, 10 insertions, 28 deletions
diff --git a/src/core/hle/function_wrappers.h b/src/core/hle/function_wrappers.h
index 5e6002f4e..f93439f21 100644
--- a/src/core/hle/function_wrappers.h
+++ b/src/core/hle/function_wrappers.h
@@ -58,22 +58,21 @@ void Wrap() {
58 FuncReturn(retval); 58 FuncReturn(retval);
59} 59}
60 60
61template <ResultCode func(s32*, u32*, s32, bool, s64)> 61template <ResultCode func(s32*, VAddr, s32, bool, s64)>
62void Wrap() { 62void Wrap() {
63 s32 param_1 = 0; 63 s32 param_1 = 0;
64 s32 retval = func(&param_1, (Kernel::Handle*)Memory::GetPointer(PARAM(1)), (s32)PARAM(2), 64 s32 retval =
65 (PARAM(3) != 0), (((s64)PARAM(4) << 32) | PARAM(0))) 65 func(&param_1, PARAM(1), (s32)PARAM(2), (PARAM(3) != 0), (((s64)PARAM(4) << 32) | PARAM(0)))
66 .raw; 66 .raw;
67 67
68 Core::CPU().SetReg(1, (u32)param_1); 68 Core::CPU().SetReg(1, (u32)param_1);
69 FuncReturn(retval); 69 FuncReturn(retval);
70} 70}
71 71
72template <ResultCode func(s32*, u32*, s32, u32)> 72template <ResultCode func(s32*, VAddr, s32, u32)>
73void Wrap() { 73void Wrap() {
74 s32 param_1 = 0; 74 s32 param_1 = 0;
75 u32 retval = 75 u32 retval = func(&param_1, PARAM(1), (s32)PARAM(2), PARAM(3)).raw;
76 func(&param_1, (Kernel::Handle*)Memory::GetPointer(PARAM(1)), (s32)PARAM(2), PARAM(3)).raw;
77 76
78 Core::CPU().SetReg(1, (u32)param_1); 77 Core::CPU().SetReg(1, (u32)param_1);
79 FuncReturn(retval); 78 FuncReturn(retval);
@@ -152,21 +151,6 @@ void Wrap() {
152 FuncReturn(func(PARAM(0)).raw); 151 FuncReturn(func(PARAM(0)).raw);
153} 152}
154 153
155template <ResultCode func(s64*, u32, u32*, u32)>
156void Wrap() {
157 FuncReturn(func((s64*)Memory::GetPointer(PARAM(0)), PARAM(1),
158 (u32*)Memory::GetPointer(PARAM(2)), (s32)PARAM(3))
159 .raw);
160}
161
162template <ResultCode func(u32*, const char*)>
163void Wrap() {
164 u32 param_1 = 0;
165 u32 retval = func(&param_1, (char*)Memory::GetPointer(PARAM(1))).raw;
166 Core::CPU().SetReg(1, param_1);
167 FuncReturn(retval);
168}
169
170template <ResultCode func(u32*, s32, s32)> 154template <ResultCode func(u32*, s32, s32)>
171void Wrap() { 155void Wrap() {
172 u32 param_1 = 0; 156 u32 param_1 = 0;
@@ -222,13 +206,11 @@ void Wrap() {
222 FuncReturn(func(PARAM(0), PARAM(1)).raw); 206 FuncReturn(func(PARAM(0), PARAM(1)).raw);
223} 207}
224 208
225template <ResultCode func(Kernel::Handle*, Kernel::Handle*, const char*, u32)> 209template <ResultCode func(Kernel::Handle*, Kernel::Handle*, VAddr, u32)>
226void Wrap() { 210void Wrap() {
227 Kernel::Handle param_1 = 0; 211 Kernel::Handle param_1 = 0;
228 Kernel::Handle param_2 = 0; 212 Kernel::Handle param_2 = 0;
229 u32 retval = func(&param_1, &param_2, 213 u32 retval = func(&param_1, &param_2, PARAM(2), PARAM(3)).raw;
230 reinterpret_cast<const char*>(Memory::GetPointer(PARAM(2))), PARAM(3))
231 .raw;
232 Core::CPU().SetReg(1, param_1); 214 Core::CPU().SetReg(1, param_1);
233 Core::CPU().SetReg(2, param_2); 215 Core::CPU().SetReg(2, param_2);
234 FuncReturn(retval); 216 FuncReturn(retval);
@@ -268,9 +250,9 @@ void Wrap() {
268 func(((s64)PARAM(1) << 32) | PARAM(0)); 250 func(((s64)PARAM(1) << 32) | PARAM(0));
269} 251}
270 252
271template <void func(const char*, int len)> 253template <void func(VAddr, int len)>
272void Wrap() { 254void Wrap() {
273 func((char*)Memory::GetPointer(PARAM(0)), PARAM(1)); 255 func(PARAM(0), PARAM(1));
274} 256}
275 257
276template <void func(u8)> 258template <void func(u8)>