summaryrefslogtreecommitdiff
path: root/src/core/hle/function_wrappers.h
diff options
context:
space:
mode:
authorGravatar bunnei2014-06-14 12:13:16 -0400
committerGravatar bunnei2014-06-14 12:13:16 -0400
commit004df767953a949817da89bddcd5d1379240f769 (patch)
treeb2d54928dcbf3cb4dde0cd5d3277afe7999b7bd9 /src/core/hle/function_wrappers.h
parentGPU debugger: Const correctness and build fix. (diff)
parentKernel: Removed unnecessary "#pragma once". (diff)
downloadyuzu-004df767953a949817da89bddcd5d1379240f769.tar.gz
yuzu-004df767953a949817da89bddcd5d1379240f769.tar.xz
yuzu-004df767953a949817da89bddcd5d1379240f769.zip
Merge branch 'threading' of https://github.com/bunnei/citra
Conflicts: src/core/hle/function_wrappers.h src/core/hle/service/gsp.cpp
Diffstat (limited to 'src/core/hle/function_wrappers.h')
-rw-r--r--src/core/hle/function_wrappers.h753
1 files changed, 61 insertions, 692 deletions
diff --git a/src/core/hle/function_wrappers.h b/src/core/hle/function_wrappers.h
index 801865d49..0bed78653 100644
--- a/src/core/hle/function_wrappers.h
+++ b/src/core/hle/function_wrappers.h
@@ -1,19 +1,6 @@
1// Copyright (c) 2012- PPSSPP Project. 1// Copyright 2014 Citra Emulator Project
2 2// Licensed under GPLv2
3// This program is free software: you can redistribute it and/or modify 3// Refer to the license.txt file included.
4// it under the terms of the GNU General Public License as published by
5// the Free Software Foundation, version 2.0 or later versions.
6
7// This program is distributed in the hope that it will be useful,
8// but WITHOUT ANY WARRANTY; without even the implied warranty of
9// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10// GNU General Public License 2.0 for more details.
11
12// A copy of the GPL 2.0 should have been included with the program.
13// If not, see http://www.gnu.org/licenses/
14
15// Official git repository and contact information can be found at
16// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
17 4
18#pragma once 5#pragma once
19 6
@@ -21,725 +8,107 @@
21#include "core/mem_map.h" 8#include "core/mem_map.h"
22#include "core/hle/hle.h" 9#include "core/hle/hle.h"
23 10
24// For easy parameter parsing and return value processing. 11namespace HLE {
25
26//32bit wrappers
27template<void func()> void WrapV_V() {
28 func();
29}
30
31template<u32 func()> void WrapU_V() {
32 RETURN(func());
33}
34
35template<int func(void *, const char *)> void WrapI_VC() {
36 u32 retval = func(Memory::GetPointer(PARAM(0)), Memory::GetCharPointer(PARAM(1)));
37 RETURN(retval);
38}
39
40template<u32 func(int, void *, int)> void WrapU_IVI() {
41 u32 retval = func(PARAM(0), Memory::GetPointer(PARAM(1)), PARAM(2));
42 RETURN(retval);
43}
44
45template<int func(const char *, int, int, u32)> void WrapI_CIIU() {
46 u32 retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3));
47 RETURN(retval);
48}
49
50template<int func(int, const char *, u32, void *, void *, u32, int)> void WrapI_ICUVVUI() {
51 u32 retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), Memory::GetPointer(PARAM(3)),Memory::GetPointer(PARAM(4)), PARAM(5), PARAM(6) );
52 RETURN(retval);
53}
54
55// Hm, do so many params get passed in registers?
56template<int func(const char *, int, const char *, int, int, int, int, int)> void WrapI_CICIIIII() {
57 u32 retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), Memory::GetCharPointer(PARAM(2)),
58 PARAM(3), PARAM(4), PARAM(5), PARAM(6), PARAM(7));
59 RETURN(retval);
60}
61
62// Hm, do so many params get passed in registers?
63template<int func(const char *, int, int, int, int, int, int)> void WrapI_CIIIIII() {
64 u32 retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2),
65 PARAM(3), PARAM(4), PARAM(5), PARAM(6));
66 RETURN(retval);
67}
68
69// Hm, do so many params get passed in registers?
70template<int func(int, int, int, int, int, int, u32)> void WrapI_IIIIIIU() {
71 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5), PARAM(6));
72 RETURN(retval);
73}
74
75// Hm, do so many params get passed in registers?
76template<int func(int, int, int, int, int, int, int, int, u32)> void WrapI_IIIIIIIIU() {
77 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5), PARAM(6), PARAM(7), PARAM(8));
78 RETURN(retval);
79}
80
81template<u32 func(int, void *)> void WrapU_IV() {
82 u32 retval = func(PARAM(0), Memory::GetPointer(PARAM(1)));
83 RETURN(retval);
84}
85
86template<u32 func(u32)> void WrapU_U() {
87 u32 retval = func(PARAM(0));
88 RETURN(retval);
89}
90
91template<u32 func(u32, int)> void WrapU_UI() {
92 u32 retval = func(PARAM(0), PARAM(1));
93 RETURN(retval);
94}
95
96template<int func(u32)> void WrapI_U() {
97 int retval = func(PARAM(0));
98 RETURN(retval);
99}
100
101template<int func(u32, int)> void WrapI_UI() {
102 int retval = func(PARAM(0), PARAM(1));
103 RETURN(retval);
104}
105
106template<int func(u32, int, int, u32)> void WrapI_UIIU() {
107 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
108 RETURN(retval);
109}
110
111template<u32 func(int, u32, int)> void WrapU_IUI() {
112 u32 retval = func(PARAM(0), PARAM(1), PARAM(2));
113 RETURN(retval);
114}
115
116template<int func(u32, u32)> void WrapI_UU() {
117 int retval = func(PARAM(0), PARAM(1));
118 RETURN(retval);
119}
120
121template<int func(u32, u32, u32)> void WrapI_UUU() {
122 int retval = func(PARAM(0), PARAM(1), PARAM(2));
123 RETURN(retval);
124}
125
126template<int func(u32, u32, u32, int)> void WrapI_UUUI() {
127 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
128 RETURN(retval);
129}
130
131template<int func(u32, u32, u32, int, int, int,int )> void WrapI_UUUIIII() {
132 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5), PARAM(6));
133 RETURN(retval);
134}
135
136template<int func(u32, u32, u32, u32)> void WrapI_UUUU() {
137 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
138 RETURN(retval);
139}
140
141template<int func(u32, u32, u32, u32, u32)> void WrapI_UUUUU() {
142 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
143 RETURN(retval);
144}
145
146template<int func(void*)> void WrapI_V() {
147 u32 retval = func(Memory::GetPointer(PARAM(0)));
148 RETURN(retval);
149}
150
151template<u32 func(int)> void WrapU_I() {
152 u32 retval = func(PARAM(0));
153 RETURN(retval);
154}
155
156template<u32 func(int, int, u32)> void WrapU_IIU() {
157 u32 retval = func(PARAM(0), PARAM(1), PARAM(2));
158 RETURN(retval);
159}
160
161template<int func(int)> void WrapI_I() {
162 int retval = func(PARAM(0));
163 RETURN(retval);
164}
165
166template<void func(u32)> void WrapV_U() {
167 func(PARAM(0));
168}
169
170template<void func(int)> void WrapV_I() {
171 func(PARAM(0));
172}
173
174template<void func(u32, u32)> void WrapV_UU() {
175 func(PARAM(0), PARAM(1));
176}
177
178template<void func(int, int)> void WrapV_II() {
179 func(PARAM(0), PARAM(1));
180}
181
182template<void func(u32, const char *)> void WrapV_UC() {
183 func(PARAM(0), Memory::GetCharPointer(PARAM(1)));
184}
185
186template<int func(u32, const char *)> void WrapI_UC() {
187 int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)));
188 RETURN(retval);
189}
190
191template<int func(u32, const char *, int)> void WrapI_UCI() {
192 int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2));
193 RETURN(retval);
194}
195
196template<u32 func(u32, int , int , int, int, int)> void WrapU_UIIIII() {
197 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5));
198 RETURN(retval);
199}
200
201template<u32 func(u32, int , int , int, u32)> void WrapU_UIIIU() {
202 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
203 RETURN(retval);
204}
205
206template<u32 func(u32, int , int , int, int, int, int)> void WrapU_UIIIIII() {
207 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5), PARAM(6));
208 RETURN(retval);
209}
210
211template<u32 func(u32, u32)> void WrapU_UU() {
212 u32 retval = func(PARAM(0), PARAM(1));
213 RETURN(retval);
214}
215
216template<u32 func(u32, u32, int)> void WrapU_UUI() {
217 u32 retval = func(PARAM(0), PARAM(1), PARAM(2));
218 RETURN(retval);
219}
220
221template<u32 func(u32, u32, int, int)> void WrapU_UUII() {
222 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
223 RETURN(retval);
224}
225
226template<u32 func(const char *, u32, u32, u32)> void WrapU_CUUU() {
227 u32 retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3));
228 RETURN(retval);
229}
230
231template<void func(u32, int, u32, int, int)> void WrapV_UIUII() {
232 func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
233}
234
235template<u32 func(u32, int, u32, int, int)> void WrapU_UIUII() {
236 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
237 RETURN(retval);
238}
239
240template<int func(u32, int, u32, int, int)> void WrapI_UIUII() {
241 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
242 RETURN(retval);
243}
244
245template<u32 func(u32, int, u32, int)> void WrapU_UIUI() {
246 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
247 RETURN(retval);
248}
249
250template<int func(u32, int, u32, int)> void WrapI_UIUI() {
251 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
252 RETURN(retval);
253}
254
255template<u32 func(u32, int, u32)> void WrapU_UIU() {
256 u32 retval = func(PARAM(0), PARAM(1), PARAM(2));
257 RETURN(retval);
258}
259
260template<u32 func(u32, int, u32, u32)> void WrapU_UIUU() {
261 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
262 RETURN(retval);
263}
264
265template<u32 func(u32, int, int)> void WrapU_UII() {
266 u32 retval = func(PARAM(0), PARAM(1), PARAM(2));
267 RETURN(retval);
268}
269
270template<u32 func(u32, int, int, u32)> void WrapU_UIIU() {
271 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
272 RETURN(retval);
273}
274
275template<int func(u32, int, int, u32, u32)> void WrapI_UIIUU() {
276 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
277 RETURN(retval);
278}
279
280template<int func(u32, u32, int, int)> void WrapI_UUII() {
281 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
282 RETURN(retval);
283}
284
285template<int func(u32, u32, int, int, int)> void WrapI_UUIII() {
286 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
287 RETURN(retval);
288}
289
290template<void func(u32, int, int, int)> void WrapV_UIII() {
291 func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
292}
293
294template<void func(u32, int, int, int, int, int)> void WrapV_UIIIII() {
295 func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5));
296}
297
298template<void func(u32, int, int)> void WrapV_UII() {
299 func(PARAM(0), PARAM(1), PARAM(2));
300}
301 12
302template<u32 func(int, u32)> void WrapU_IU() { 13#define PARAM(n) Core::g_app_core->GetReg(n)
303 int retval = func(PARAM(0), PARAM(1)); 14#define RETURN(n) Core::g_app_core->SetReg(0, n)
304 RETURN(retval);
305}
306 15
307template<int func(int, u32)> void WrapI_IU() { 16////////////////////////////////////////////////////////////////////////////////////////////////////
308 int retval = func(PARAM(0), PARAM(1)); 17// Function wrappers that return type s32
309 RETURN(retval);
310}
311 18
312template<int func(u32, u32, int)> void WrapI_UUI() { 19template<s32 func(u32, u32, u32, u32)> void Wrap() {
313 int retval = func(PARAM(0), PARAM(1), PARAM(2)); 20 RETURN(func(PARAM(0), PARAM(1), PARAM(2), PARAM(3)));
314 RETURN(retval);
315} 21}
316 22
317template<int func(u32, u32, int, u32)> void WrapI_UUIU() { 23template<s32 func(u32, u32, u32, u32, u32)> void Wrap() {
318 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3)); 24 RETURN(func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4)));
319 RETURN(retval);
320} 25}
321 26
322template<int func(int, int)> void WrapI_II() { 27template<s32 func(u32*, u32, u32, u32, u32, u32)> void Wrap(){
323 int retval = func(PARAM(0), PARAM(1)); 28 u32 param_1 = 0;
29 u32 retval = func(&param_1, PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
30 Core::g_app_core->SetReg(1, param_1);
324 RETURN(retval); 31 RETURN(retval);
325} 32}
326 33
327template<int func(int, int, int)> void WrapI_III() { 34template<s32 func(s32*, u32*, s32, bool, s64)> void Wrap() {
328 int retval = func(PARAM(0), PARAM(1), PARAM(2)); 35 s32 param_1 = 0;
36 s32 retval = func(&param_1, (Handle*)Memory::GetPointer(PARAM(1)), (s32)PARAM(2),
37 (PARAM(3) != 0), (((s64)PARAM(4) << 32) | PARAM(0)));
38 Core::g_app_core->SetReg(1, (u32)param_1);
329 RETURN(retval); 39 RETURN(retval);
330} 40}
331 41
332template<int func(int, u32, int)> void WrapI_IUI() { 42// TODO(bunnei): Is this correct? Probably not
333 int retval = func(PARAM(0), PARAM(1), PARAM(2)); 43template<s32 func(u32, u32, u32, u32, s64)> void Wrap() {
334 RETURN(retval); 44 RETURN(func(PARAM(5), PARAM(1), PARAM(2), PARAM(3), (((s64)PARAM(4) << 32) | PARAM(0))));
335} 45}
336 46
337template<int func(int, int, int, int)> void WrapI_IIII() { 47template<s32 func(u32, s64)> void Wrap() {
338 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3)); 48 RETURN(func(PARAM(0), (((s64)PARAM(3) << 32) | PARAM(2))));
339 RETURN(retval);
340} 49}
341 50
342template<int func(u32, int, int, int)> void WrapI_UIII() { 51template<s32 func(void*, void*, u32)> void Wrap(){
343 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3)); 52 RETURN(func(Memory::GetPointer(PARAM(0)), Memory::GetPointer(PARAM(1)), PARAM(2)));
344 RETURN(retval);
345} 53}
346 54
347template<int func(int, int, int, u32, int)> void WrapI_IIIUI() { 55template<s32 func(s32*, u32)> void Wrap(){
348 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4)); 56 s32 param_1 = 0;
57 u32 retval = func(&param_1, PARAM(1));
58 Core::g_app_core->SetReg(1, param_1);
349 RETURN(retval); 59 RETURN(retval);
350} 60}
351 61
352template<int func(int, u32, u32, int, int)> void WrapI_IUUII() { 62template<s32 func(u32, s32)> void Wrap() {
353 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4)); 63 RETURN(func(PARAM(0), (s32)PARAM(1)));
354 RETURN(retval);
355} 64}
356 65
357template<int func(int, const char *, int, u32, u32)> void WrapI_ICIUU() { 66template<s32 func(u32*, u32)> void Wrap(){
358 int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), PARAM(3), PARAM(4)); 67 u32 param_1 = 0;
68 u32 retval = func(&param_1, PARAM(1));
69 Core::g_app_core->SetReg(1, param_1);
359 RETURN(retval); 70 RETURN(retval);
360} 71}
361 72
362template<int func(int, int, u32)> void WrapI_IIU() { 73template<s32 func(u32)> void Wrap() {
363 int retval = func(PARAM(0), PARAM(1), PARAM(2)); 74 RETURN(func(PARAM(0)));
364 RETURN(retval);
365} 75}
366 76
367template<void func(int, u32)> void WrapV_IU() { 77template<s32 func(void*)> void Wrap() {
368 func(PARAM(0), PARAM(1)); 78 RETURN(func(Memory::GetPointer(PARAM(0))));
369} 79}
370 80
371template<void func(u32, int)> void WrapV_UI() { 81template<s32 func(s64*, u32, void*, s32)> void Wrap(){
372 func(PARAM(0), PARAM(1)); 82 RETURN(func((s64*)Memory::GetPointer(PARAM(0)), PARAM(1), Memory::GetPointer(PARAM(2)),
83 (s32)PARAM(3)));
373} 84}
374 85
375template<u32 func(const char *)> void WrapU_C() { 86template<s32 func(u32*, const char*)> void Wrap() {
376 u32 retval = func(Memory::GetCharPointer(PARAM(0))); 87 u32 param_1 = 0;
88 u32 retval = func(&param_1, Memory::GetCharPointer(PARAM(1)));
89 Core::g_app_core->SetReg(1, param_1);
377 RETURN(retval); 90 RETURN(retval);
378} 91}
379 92
380template<u32 func(const char *, const char *, const char *, u32)> void WrapU_CCCU() { 93////////////////////////////////////////////////////////////////////////////////////////////////////
381 u32 retval = func(Memory::GetCharPointer(PARAM(0)), 94// Function wrappers that return type u32
382 Memory::GetCharPointer(PARAM(1)), Memory::GetCharPointer(PARAM(2)),
383 PARAM(3));
384 RETURN(retval);
385}
386
387template<int func(const char *)> void WrapI_C() {
388 int retval = func(Memory::GetCharPointer(PARAM(0)));
389 RETURN(retval);
390}
391
392template<int func(const char *, u32)> void WrapI_CU() {
393 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1));
394 RETURN(retval);
395}
396
397template<int func(const char *, u32, int)> void WrapI_CUI() {
398 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2));
399 RETURN(retval);
400}
401 95
402template<int func(int, const char *, int, u32)> void WrapI_ICIU() { 96template<u32 func()> void Wrap() {
403 int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), PARAM(3)); 97 RETURN(func());
404 RETURN(retval);
405}
406
407template<int func(const char *, int, u32)> void WrapI_CIU() {
408 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2));
409 RETURN(retval);
410}
411
412template<int func(const char *, u32, u32)> void WrapI_CUU() {
413 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2));
414 RETURN(retval);
415}
416
417template<int func(const char *, u32, u32, u32)> void WrapI_CUUU() {
418 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2),
419 PARAM(3));
420 RETURN(retval);
421}
422
423template<int func(const char *, const char*, int, int)> void WrapI_CCII() {
424 int retval = func(Memory::GetCharPointer(PARAM(0)), Memory::GetCharPointer(PARAM(1)), PARAM(2), PARAM(3));
425 RETURN(retval);
426}
427
428template<int func(const char *, u32, u32, int, u32, u32)> void WrapI_CUUIUU() {
429 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2),
430 PARAM(3), PARAM(4), PARAM(5));
431 RETURN(retval);
432}
433
434template<int func(const char *, int, int, u32, int, int)> void WrapI_CIIUII() {
435 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2),
436 PARAM(3), PARAM(4), PARAM(5));
437 RETURN(retval);
438}
439
440template<int func(const char *, int, u32, u32, u32)> void WrapI_CIUUU() {
441 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2),
442 PARAM(3), PARAM(4));
443 RETURN(retval);
444}
445
446template<int func(const char *, u32, u32, u32, u32, u32)> void WrapI_CUUUUU() {
447 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2),
448 PARAM(3), PARAM(4), PARAM(5));
449 RETURN(retval);
450}
451
452template<u32 func(const char *, u32)> void WrapU_CU() {
453 u32 retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1));
454 RETURN((u32) retval);
455}
456
457template<u32 func(u32, const char *)> void WrapU_UC() {
458 u32 retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)));
459 RETURN(retval);
460}
461
462template<u32 func(const char *, u32, u32)> void WrapU_CUU() {
463 u32 retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2));
464 RETURN((u32) retval);
465}
466
467template<u32 func(int, int, int)> void WrapU_III() {
468 u32 retval = func(PARAM(0), PARAM(1), PARAM(2));
469 RETURN(retval);
470}
471
472template<u32 func(int, int)> void WrapU_II() {
473 u32 retval = func(PARAM(0), PARAM(1));
474 RETURN(retval);
475}
476
477template<u32 func(int, int, int, int)> void WrapU_IIII() {
478 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
479 RETURN(retval);
480}
481
482template<u32 func(int, u32, u32)> void WrapU_IUU() {
483 u32 retval = func(PARAM(0), PARAM(1), PARAM(2));
484 RETURN(retval);
485}
486
487template<u32 func(int, u32, u32, u32)> void WrapU_IUUU() {
488 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
489 RETURN(retval);
490}
491
492template<u32 func(int, u32, u32, u32, u32)> void WrapU_IUUUU() {
493 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
494 RETURN(retval);
495}
496
497template<u32 func(u32, u32, u32)> void WrapU_UUU() {
498 u32 retval = func(PARAM(0), PARAM(1), PARAM(2));
499 RETURN(retval);
500}
501
502template<void func(int, u32, u32)> void WrapV_IUU() {
503 func(PARAM(0), PARAM(1), PARAM(2));
504}
505
506template<void func(int, int, u32)> void WrapV_IIU() {
507 func(PARAM(0), PARAM(1), PARAM(2));
508}
509
510template<void func(u32, int, u32)> void WrapV_UIU() {
511 func(PARAM(0), PARAM(1), PARAM(2));
512}
513
514template<int func(u32, int, u32)> void WrapI_UIU() {
515 int retval = func(PARAM(0), PARAM(1), PARAM(2));
516 RETURN(retval);
517}
518
519template<void func(int, u32, u32, u32, u32)> void WrapV_IUUUU() {
520 func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
521}
522
523template<void func(u32, u32, u32)> void WrapV_UUU() {
524 func(PARAM(0), PARAM(1), PARAM(2));
525}
526
527template<void func(u32, u32, u32, u32)> void WrapV_UUUU() {
528 func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
529}
530
531template<void func(const char *, u32, int, u32)> void WrapV_CUIU() {
532 func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3));
533}
534
535template<int func(const char *, u32, int, u32)> void WrapI_CUIU() {
536 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3));
537 RETURN(retval);
538}
539
540template<void func(u32, const char *, u32, int, u32)> void WrapV_UCUIU() {
541 func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), PARAM(3),
542 PARAM(4));
543}
544
545template<int func(u32, const char *, u32, int, u32)> void WrapI_UCUIU() {
546 int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2),
547 PARAM(3), PARAM(4));
548 RETURN(retval);
549}
550
551template<void func(const char *, u32, int, int, u32)> void WrapV_CUIIU() {
552 func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3),
553 PARAM(4));
554}
555
556template<int func(const char *, u32, int, int, u32)> void WrapI_CUIIU() {
557 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2),
558 PARAM(3), PARAM(4));
559 RETURN(retval);
560}
561
562template<u32 func(u32, u32, u32, u32)> void WrapU_UUUU() {
563 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
564 RETURN(retval);
565}
566
567template<u32 func(u32, const char *, u32, u32)> void WrapU_UCUU() {
568 u32 retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), PARAM(3));
569 RETURN(retval);
570}
571
572template<u32 func(u32, u32, u32, int)> void WrapU_UUUI() {
573 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
574 RETURN(retval);
575}
576
577template<u32 func(u32, u32, u32, int, u32)> void WrapU_UUUIU() {
578 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
579 RETURN(retval);
580}
581
582template<u32 func(u32, u32, u32, int, u32, int)> void WrapU_UUUIUI() {
583 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5));
584 RETURN(retval);
585}
586
587template<u32 func(u32, u32, int, u32)> void WrapU_UUIU() {
588 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
589 RETURN(retval);
590}
591
592template<u32 func(u32, int, int, int)> void WrapU_UIII() {
593 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
594 RETURN(retval);
595}
596
597template<int func(int, u32, u32, u32, u32)> void WrapI_IUUUU() {
598 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
599 RETURN(retval);
600}
601
602template<int func(int, u32, u32, u32, u32, u32)> void WrapI_IUUUUU() {
603 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5));
604 RETURN(retval);
605}
606
607template<int func(int, u32, int, int)> void WrapI_IUII() {
608 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
609 RETURN(retval);
610}
611template<u32 func(u32, u32, u32, u32, u32)> void WrapU_UUUUU() {
612 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
613 RETURN(retval);
614} 98}
615 99
616template<void func(u32, u32, u32, u32, u32)> void WrapV_UUUUU() { 100////////////////////////////////////////////////////////////////////////////////////////////////////
617 func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4)); 101/// Function wrappers that return type void
618}
619 102
620template<u32 func(const char *, const char *)> void WrapU_CC() { 103template<void func(s64)> void Wrap() {
621 int retval = func(Memory::GetCharPointer(PARAM(0)), 104 func(((s64)PARAM(1) << 32) | PARAM(0));
622 Memory::GetCharPointer(PARAM(1)));
623 RETURN(retval);
624} 105}
625 106
626template<void func(const char*)> void WrapV_C() { 107template<void func(const char*)> void Wrap() {
627 func(Memory::GetCharPointer(PARAM(0))); 108 func(Memory::GetCharPointer(PARAM(0)));
628} 109}
629 110
630template<void func(const char *, int)> void WrapV_CI() { 111#undef PARAM
631 func(Memory::GetCharPointer(PARAM(0)), PARAM(1)); 112#undef RETURN
632}
633
634template<u32 func(const char *, int)> void WrapU_CI() {
635 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1));
636 RETURN(retval);
637}
638
639template<u32 func(const char *, int, int)> void WrapU_CII() {
640 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2));
641 RETURN(retval);
642}
643 113
644template<int func(const char *, int, u32, int, u32)> void WrapU_CIUIU() { 114} // namespace HLE
645 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2),
646 PARAM(3), PARAM(4));
647 RETURN(retval);
648}
649
650template<u32 func(const char *, int, u32, int, u32, int)> void WrapU_CIUIUI() {
651 u32 retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2),
652 PARAM(3), PARAM(4), PARAM(5));
653 RETURN(retval);
654}
655
656template<u32 func(u32, u32, u32, u32, u32, u32)> void WrapU_UUUUUU() {
657 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4),
658 PARAM(5));
659 RETURN(retval);
660}
661
662template<int func(int, u32, u32, u32)> void WrapI_IUUU() {
663 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
664 RETURN(retval);
665}
666
667template<int func(int, u32, u32)> void WrapI_IUU() {
668 int retval = func(PARAM(0), PARAM(1), PARAM(2));
669 RETURN(retval);
670}
671
672template<u32 func(u32, u32, u32, u32, u32, u32, u32)> void WrapU_UUUUUUU() {
673 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5), PARAM(6));
674 RETURN(retval);
675}
676
677template<int func(u32, int, u32, u32)> void WrapI_UIUU() {
678 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
679 RETURN(retval);
680}
681
682template<int func(int, const char *)> void WrapI_IC() {
683 int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)));
684 RETURN(retval);
685}
686
687template <int func(int, const char *, const char *, u32, int)> void WrapI_ICCUI() {
688 int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), Memory::GetCharPointer(PARAM(2)), PARAM(3), PARAM(4));
689 RETURN(retval);
690}
691
692template <int func(int, const char *, const char *, int)> void WrapI_ICCI() {
693 int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), Memory::GetCharPointer(PARAM(2)), PARAM(3));
694 RETURN(retval);
695}
696
697template <int func(const char *, int, int)> void WrapI_CII() {
698 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2));
699 RETURN(retval);
700}
701
702template <int func(int, const char *, int)> void WrapI_ICI() {
703 int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2));
704 RETURN(retval);
705}
706
707template<int func(int, void *, void *, void *, void *, u32, int)> void WrapI_IVVVVUI(){
708 u32 retval = func(PARAM(0), Memory::GetPointer(PARAM(1)), Memory::GetPointer(PARAM(2)), Memory::GetPointer(PARAM(3)), Memory::GetPointer(PARAM(4)), PARAM(5), PARAM(6) );
709 RETURN(retval);
710}
711
712template<int func(int, const char *, u32, void *, int, int, int)> void WrapI_ICUVIII(){
713 u32 retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), Memory::GetPointer(PARAM(3)), PARAM(4), PARAM(5), PARAM(6));
714 RETURN(retval);
715}
716
717template<int func(void*, u32)> void WrapI_VU(){
718 u32 retval = func(Memory::GetPointer(PARAM(0)), PARAM(1));
719 RETURN(retval);
720}
721
722template<int func(void*, void*, u32)> void WrapI_VVU(){
723 u32 retval = func(Memory::GetPointer(PARAM(0)), Memory::GetPointer(PARAM(1)), PARAM(2));
724 RETURN(retval);
725}
726
727template<int func(void*, u32, void*, int)> void WrapI_VUVI(){
728 u32 retval = func(Memory::GetPointer(PARAM(0)), PARAM(1), Memory::GetPointer(PARAM(2)), PARAM(3));
729 RETURN(retval);
730}
731
732template<int func(void*, u32, u32, u32, u32, u32)> void WrapI_VUUUUU(){
733 u32 retval = func(NULL, PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
734 RETURN(retval);
735}
736
737template<int func(u32, s64)> void WrapI_US64() {
738 int retval = func(PARAM(0), PARAM64(1));
739 RETURN(retval);
740}
741
742template<int func(void*, void*, u32, u32, s64)> void WrapI_VVUUS64() {
743 int retval = func(Memory::GetPointer(PARAM(0)), Memory::GetPointer(PARAM(1)), PARAM(2), PARAM(3), PARAM(4));
744 RETURN(retval);
745}