summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/function_wrappers.h785
-rw-r--r--src/core/hle/svc.cpp286
2 files changed, 201 insertions, 870 deletions
diff --git a/src/core/hle/function_wrappers.h b/src/core/hle/function_wrappers.h
index 2d0dcf476..e8afa90d6 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,759 +8,113 @@
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 Wrap {
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 param_1 = 0;
37 u32 retval = func(&param_1, Memory::GetCharPointer(PARAM(1)));
38 Core::g_app_core->SetReg(1, param_1);
39 RETURN(retval);
40}
41
42template<u32 func(int, void *, int)> void WrapU_IVI() {
43 u32 retval = func(PARAM(0), Memory::GetPointer(PARAM(1)), PARAM(2));
44 RETURN(retval);
45}
46
47template<int func(const char *, int, int, u32)> void WrapI_CIIU() {
48 u32 retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3));
49 RETURN(retval);
50}
51
52template<int func(int, const char *, u32, void *, void *, u32, int)> void WrapI_ICUVVUI() {
53 u32 retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2),
54 Memory::GetPointer(PARAM(3)),Memory::GetPointer(PARAM(4)), PARAM(5), PARAM(6));
55 RETURN(retval);
56}
57
58// Hm, do so many params get passed in registers?
59template<int func(const char *, int, const char *, int, int, int, int, int)> void WrapI_CICIIIII() {
60 u32 retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), Memory::GetCharPointer(PARAM(2)),
61 PARAM(3), PARAM(4), PARAM(5), PARAM(6), PARAM(7));
62 RETURN(retval);
63}
64
65// Hm, do so many params get passed in registers?
66template<int func(const char *, int, int, int, int, int, int)> void WrapI_CIIIIII() {
67 u32 retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2),
68 PARAM(3), PARAM(4), PARAM(5), PARAM(6));
69 RETURN(retval);
70}
71
72// Hm, do so many params get passed in registers?
73template<int func(int, int, int, int, int, int, u32)> void WrapI_IIIIIIU() {
74 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5), PARAM(6));
75 RETURN(retval);
76}
77
78// Hm, do so many params get passed in registers?
79template<int func(int, int, int, int, int, int, int, int, u32)> void WrapI_IIIIIIIIU() {
80 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5), PARAM(6), PARAM(7), PARAM(8));
81 RETURN(retval);
82}
83
84template<u32 func(int, void *)> void WrapU_IV() {
85 u32 retval = func(PARAM(0), Memory::GetPointer(PARAM(1)));
86 RETURN(retval);
87}
88
89template<float func()> void WrapF_V() {
90 RETURNF(func());
91}
92
93// TODO: Not sure about the floating point parameter passing
94template<float func(int, float, u32)> void WrapF_IFU() {
95 RETURNF(func(PARAM(0), PARAMF(0), PARAM(1)));
96}
97
98template<u32 func(u32)> void WrapU_U() {
99 u32 retval = func(PARAM(0));
100 RETURN(retval);
101}
102
103template<u32 func(u32, int)> void WrapU_UI() {
104 u32 retval = func(PARAM(0), PARAM(1));
105 RETURN(retval);
106}
107
108template<int func(u32)> void WrapI_U() {
109 int retval = func(PARAM(0));
110 RETURN(retval);
111}
112
113template<int func(u32, int)> void WrapI_UI() {
114 int retval = func(PARAM(0), PARAM(1));
115 RETURN(retval);
116}
117
118template<int func(u32, int, int, u32)> void WrapI_UIIU() {
119 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
120 RETURN(retval);
121}
122
123template<u32 func(int, u32, int)> void WrapU_IUI() {
124 u32 retval = func(PARAM(0), PARAM(1), PARAM(2));
125 RETURN(retval);
126}
127
128template<int func(u32, u32)> void WrapI_UU() {
129 int retval = func(PARAM(0), PARAM(1));
130 RETURN(retval);
131}
132
133template<int func(u32, float, float)> void WrapI_UFF() {
134 // Not sure about the float arguments.
135 int retval = func(PARAM(0), PARAMF(0), PARAMF(1));
136 RETURN(retval);
137}
138
139template<int func(u32, u32, u32)> void WrapI_UUU() {
140 int retval = func(PARAM(0), PARAM(1), PARAM(2));
141 RETURN(retval);
142}
143
144template<int func(u32, u32, u32, int)> void WrapI_UUUI() {
145 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
146 RETURN(retval);
147}
148
149template<int func(u32, u32, u32, int, int, int,int )> void WrapI_UUUIIII() {
150 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5), PARAM(6));
151 RETURN(retval);
152}
153
154template<int func(u32, u32, u32, u32)> void WrapI_UUUU() {
155 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
156 RETURN(retval);
157}
158
159template<int func(u32, u32, u32, u32, u32)> void WrapI_UUUUU() {
160 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
161 RETURN(retval);
162}
163
164template<int func(void*)> void WrapI_V() {
165 u32 retval = func(Memory::GetPointer(PARAM(0)));
166 RETURN(retval);
167}
168
169template<u32 func(int)> void WrapU_I() {
170 u32 retval = func(PARAM(0));
171 RETURN(retval);
172}
173
174template<u32 func(int, int, u32)> void WrapU_IIU() {
175 u32 retval = func(PARAM(0), PARAM(1), PARAM(2));
176 RETURN(retval);
177}
178
179template<int func(int)> void WrapI_I() {
180 int retval = func(PARAM(0));
181 RETURN(retval);
182}
183
184template<void func(u32)> void WrapV_U() {
185 func(PARAM(0));
186}
187
188template<void func(int)> void WrapV_I() {
189 func(PARAM(0));
190}
191
192template<void func(u32, u32)> void WrapV_UU() {
193 func(PARAM(0), PARAM(1));
194}
195
196template<void func(int, int)> void WrapV_II() {
197 func(PARAM(0), PARAM(1));
198}
199
200template<void func(u32, const char *)> void WrapV_UC() {
201 func(PARAM(0), Memory::GetCharPointer(PARAM(1)));
202}
203
204template<int func(u32, const char *)> void WrapI_UC() {
205 int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)));
206 RETURN(retval);
207}
208
209template<int func(u32, const char *, int)> void WrapI_UCI() {
210 int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2));
211 RETURN(retval);
212}
213
214template<u32 func(u32, int , int , int, int, int)> void WrapU_UIIIII() {
215 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5));
216 RETURN(retval);
217}
218
219template<u32 func(u32, int , int , int, u32)> void WrapU_UIIIU() {
220 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
221 RETURN(retval);
222}
223
224template<u32 func(u32, int , int , int, int, int, int)> void WrapU_UIIIIII() {
225 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5), PARAM(6));
226 RETURN(retval);
227}
228
229template<u32 func(u32, u32)> void WrapU_UU() {
230 u32 retval = func(PARAM(0), PARAM(1));
231 RETURN(retval);
232}
233
234template<u32 func(u32, u32, int)> void WrapU_UUI() {
235 u32 retval = func(PARAM(0), PARAM(1), PARAM(2));
236 RETURN(retval);
237}
238
239template<u32 func(u32, u32, int, int)> void WrapU_UUII() {
240 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
241 RETURN(retval);
242}
243
244template<u32 func(const char *, u32, u32, u32)> void WrapU_CUUU() {
245 u32 retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3));
246 RETURN(retval);
247}
248
249template<void func(u32, int, u32, int, int)> void WrapV_UIUII() {
250 func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
251}
252
253template<u32 func(u32, int, u32, int, int)> void WrapU_UIUII() {
254 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
255 RETURN(retval);
256}
257
258template<int func(u32, int, u32, int, int)> void WrapI_UIUII() {
259 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
260 RETURN(retval);
261}
262
263template<u32 func(u32, int, u32, int)> void WrapU_UIUI() {
264 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
265 RETURN(retval);
266}
267
268template<int func(u32, int, u32, int)> void WrapI_UIUI() {
269 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
270 RETURN(retval);
271}
272
273template<u32 func(u32, int, u32)> void WrapU_UIU() {
274 u32 retval = func(PARAM(0), PARAM(1), PARAM(2));
275 RETURN(retval);
276}
277
278template<u32 func(u32, int, u32, u32)> void WrapU_UIUU() {
279 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
280 RETURN(retval);
281}
282
283template<u32 func(u32, int, int)> void WrapU_UII() {
284 u32 retval = func(PARAM(0), PARAM(1), PARAM(2));
285 RETURN(retval);
286}
287
288template<u32 func(u32, int, int, u32)> void WrapU_UIIU() {
289 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
290 RETURN(retval);
291}
292
293template<int func(u32, int, int, u32, u32)> void WrapI_UIIUU() {
294 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
295 RETURN(retval);
296}
297
298template<int func(u32, u32, int, int)> void WrapI_UUII() {
299 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
300 RETURN(retval);
301}
302
303template<int func(u32, u32, int, int, int)> void WrapI_UUIII() {
304 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
305 RETURN(retval);
306}
307
308template<void func(u32, int, int, int)> void WrapV_UIII() {
309 func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
310}
311
312template<void func(u32, int, int, int, int, int)> void WrapV_UIIIII() {
313 func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5));
314}
315
316template<void func(u32, int, int)> void WrapV_UII() {
317 func(PARAM(0), PARAM(1), PARAM(2));
318}
319
320template<u32 func(int, u32)> void WrapU_IU() {
321 int retval = func(PARAM(0), PARAM(1));
322 RETURN(retval);
323}
324
325template<int func(int, u32)> void WrapI_IU() {
326 int retval = func(PARAM(0), PARAM(1));
327 RETURN(retval);
328}
329
330template<int func(u32, u32, int)> void WrapI_UUI() {
331 int retval = func(PARAM(0), PARAM(1), PARAM(2));
332 RETURN(retval);
333}
334
335template<int func(u32, u32, int, u32)> void WrapI_UUIU() {
336 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
337 RETURN(retval);
338}
339
340template<int func(int, int)> void WrapI_II() {
341 int retval = func(PARAM(0), PARAM(1));
342 RETURN(retval);
343}
344
345template<int func(int, int, int)> void WrapI_III() {
346 int retval = func(PARAM(0), PARAM(1), PARAM(2));
347 RETURN(retval);
348}
349
350template<int func(int, u32, int)> void WrapI_IUI() {
351 int retval = func(PARAM(0), PARAM(1), PARAM(2));
352 RETURN(retval);
353}
354
355template<int func(int, int, int, int)> void WrapI_IIII() {
356 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
357 RETURN(retval);
358}
359
360template<int func(u32, int, int, int)> void WrapI_UIII() {
361 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
362 RETURN(retval);
363}
364
365template<int func(int, int, int, u32, int)> void WrapI_IIIUI() {
366 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
367 RETURN(retval);
368}
369
370template<int func(int, u32, u32, int, int)> void WrapI_IUUII() {
371 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
372 RETURN(retval);
373}
374
375template<int func(int, const char *, int, u32, u32)> void WrapI_ICIUU() {
376 int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), PARAM(3), PARAM(4));
377 RETURN(retval);
378}
379
380template<int func(int, int, u32)> void WrapI_IIU() {
381 int retval = func(PARAM(0), PARAM(1), PARAM(2));
382 RETURN(retval);
383}
384
385template<void func(int, u32)> void WrapV_IU() {
386 func(PARAM(0), PARAM(1));
387}
388
389template<void func(u32, int)> void WrapV_UI() {
390 func(PARAM(0), PARAM(1));
391}
392 12
393template<u32 func(const char *)> void WrapU_C() { 13////////////////////////////////////////////////////////////////////////////////////////////////////
394 u32 retval = func(Memory::GetCharPointer(PARAM(0))); 14// Function wrappers that return type s32
395 RETURN(retval);
396}
397 15
398template<u32 func(const char *, const char *, const char *, u32)> void WrapU_CCCU() { 16namespace S32 {
399 u32 retval = func(Memory::GetCharPointer(PARAM(0)),
400 Memory::GetCharPointer(PARAM(1)), Memory::GetCharPointer(PARAM(2)),
401 PARAM(3));
402 RETURN(retval);
403}
404 17
405template<int func(const char *)> void WrapI_C() { 18template<s32 func(u32, u32, u32, u32)> void U32_U32_U32_U32() {
406 int retval = func(Memory::GetCharPointer(PARAM(0))); 19 RETURN(func(PARAM(0), PARAM(1), PARAM(2), PARAM(3)));
407 RETURN(retval);
408} 20}
409 21
410template<int func(const char *, u32)> void WrapI_CU() { 22template<s32 func(u32, u32, u32, u32, u32)> void U32_U32_U32_U32_U32() {
411 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1)); 23 RETURN(func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4)));
412 RETURN(retval);
413}
414
415template<int func(const char *, u32, int)> void WrapI_CUI() {
416 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2));
417 RETURN(retval);
418}
419
420template<int func(int, const char *, int, u32)> void WrapI_ICIU() {
421 int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), PARAM(3));
422 RETURN(retval);
423} 24}
424 25
425template<int func(const char *, int, u32)> void WrapI_CIU() { 26template<s32 func(u32*, u32, u32, u32, u32, u32)> void U32P_U32_U32_U32_U32_U32(){
426 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2)); 27 u32 param_1 = 0;
427 RETURN(retval); 28 u32 retval = func(&param_1, PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
428} 29 Core::g_app_core->SetReg(1, param_1);
429
430template<int func(const char *, u32, u32)> void WrapI_CUU() {
431 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2));
432 RETURN(retval);
433}
434
435template<int func(const char *, u32, u32, u32)> void WrapI_CUUU() {
436 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2),
437 PARAM(3));
438 RETURN(retval);
439}
440
441template<int func(const char *, const char*, int, int)> void WrapI_CCII() {
442 int retval = func(Memory::GetCharPointer(PARAM(0)), Memory::GetCharPointer(PARAM(1)), PARAM(2), PARAM(3));
443 RETURN(retval);
444}
445
446template<int func(const char *, u32, u32, int, u32, u32)> void WrapI_CUUIUU() {
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<int func(const char *, int, int, u32, int, int)> void WrapI_CIIUII() {
453 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2),
454 PARAM(3), PARAM(4), PARAM(5));
455 RETURN(retval);
456}
457
458template<int func(const char *, int, u32, u32, u32)> void WrapI_CIUUU() {
459 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2),
460 PARAM(3), PARAM(4));
461 RETURN(retval);
462}
463
464template<int func(const char *, u32, u32, u32, u32, u32)> void WrapI_CUUUUU() {
465 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2),
466 PARAM(3), PARAM(4), PARAM(5));
467 RETURN(retval);
468}
469
470template<u32 func(const char *, u32)> void WrapU_CU() {
471 u32 retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1));
472 RETURN((u32) retval);
473}
474
475template<u32 func(u32, const char *)> void WrapU_UC() {
476 u32 retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)));
477 RETURN(retval);
478}
479
480template<u32 func(const char *, u32, u32)> void WrapU_CUU() {
481 u32 retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2));
482 RETURN((u32) retval);
483}
484
485template<u32 func(int, int, int)> void WrapU_III() {
486 u32 retval = func(PARAM(0), PARAM(1), PARAM(2));
487 RETURN(retval);
488}
489
490template<u32 func(int, int)> void WrapU_II() {
491 u32 retval = func(PARAM(0), PARAM(1));
492 RETURN(retval);
493}
494
495template<u32 func(int, int, int, int)> void WrapU_IIII() {
496 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
497 RETURN(retval);
498}
499
500template<u32 func(int, u32, u32)> void WrapU_IUU() {
501 u32 retval = func(PARAM(0), PARAM(1), PARAM(2));
502 RETURN(retval);
503}
504
505template<u32 func(int, u32, u32, u32)> void WrapU_IUUU() {
506 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
507 RETURN(retval);
508}
509
510template<u32 func(int, u32, u32, u32, u32)> void WrapU_IUUUU() {
511 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
512 RETURN(retval);
513}
514
515template<u32 func(u32, u32, u32)> void WrapU_UUU() {
516 u32 retval = func(PARAM(0), PARAM(1), PARAM(2));
517 RETURN(retval);
518}
519
520template<void func(int, u32, u32)> void WrapV_IUU() {
521 func(PARAM(0), PARAM(1), PARAM(2));
522}
523
524template<void func(int, int, u32)> void WrapV_IIU() {
525 func(PARAM(0), PARAM(1), PARAM(2));
526}
527
528template<void func(u32, int, u32)> void WrapV_UIU() {
529 func(PARAM(0), PARAM(1), PARAM(2));
530}
531
532template<int func(u32, int, u32)> void WrapI_UIU() {
533 int retval = func(PARAM(0), PARAM(1), PARAM(2));
534 RETURN(retval); 30 RETURN(retval);
535} 31}
536 32
537template<void func(int, u32, u32, u32, u32)> void WrapV_IUUUU() { 33template<s32 func(s32*, u32*, s32, bool, s64)> void S32P_U32P_S32_Bool_S64() {
538 func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4)); 34 s32 param_1 = 0;
539} 35 s32 retval = func(&param_1, (Handle*)Memory::GetPointer(PARAM(1)), (s32)PARAM(2),
540 36 (PARAM(3) != 0), (((s64)PARAM(4) << 32) | PARAM(0)));
541template<void func(u32, u32, u32)> void WrapV_UUU() { 37 Core::g_app_core->SetReg(1, (u32)param_1);
542 func(PARAM(0), PARAM(1), PARAM(2));
543}
544
545template<void func(u32, u32, u32, u32)> void WrapV_UUUU() {
546 func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
547}
548
549template<void func(const char *, u32, int, u32)> void WrapV_CUIU() {
550 func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3));
551}
552
553template<int func(const char *, u32, int, u32)> void WrapI_CUIU() {
554 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3));
555 RETURN(retval); 38 RETURN(retval);
556} 39}
557 40
558template<void func(u32, const char *, u32, int, u32)> void WrapV_UCUIU() { 41// TODO(bunnei): Is this correct? Probably not
559 func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), PARAM(3), 42template<s32 func(u32, u32, u32, u32, s64)> void U32_U32_U32_U32_S64() {
560 PARAM(4)); 43 RETURN(func(PARAM(5), PARAM(1), PARAM(2), PARAM(3), (((s64)PARAM(4) << 32) | PARAM(0))));
561} 44}
562 45
563template<int func(u32, const char *, u32, int, u32)> void WrapI_UCUIU() { 46template<s32 func(u32, s64)> void U32_S64() {
564 int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), 47 RETURN(func(PARAM(0), (((s64)PARAM(3) << 32) | PARAM(2))));
565 PARAM(3), PARAM(4));
566 RETURN(retval);
567} 48}
568 49
569template<void func(const char *, u32, int, int, u32)> void WrapV_CUIIU() { 50template<s32 func(void*, void*, u32)> void VoidP_VoidP_U32(){
570 func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3), 51 RETURN(func(Memory::GetPointer(PARAM(0)), Memory::GetPointer(PARAM(1)), PARAM(2)));
571 PARAM(4));
572} 52}
573 53
574template<int func(const char *, u32, int, int, u32)> void WrapI_CUIIU() { 54template<s32 func(s32*, u32)> void S32P_U32(){
575 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2), 55 s32 param_1 = 0;
576 PARAM(3), PARAM(4)); 56 u32 retval = func(&param_1, PARAM(1));
57 Core::g_app_core->SetReg(1, param_1);
577 RETURN(retval); 58 RETURN(retval);
578} 59}
579 60
580template<u32 func(u32, u32, u32, u32)> void WrapU_UUUU() { 61template<s32 func(u32, s32)> void U32_S32() {
581 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3)); 62 RETURN(func(PARAM(0), (s32)PARAM(1)));
582 RETURN(retval);
583} 63}
584 64
585template<u32 func(u32, const char *, u32, u32)> void WrapU_UCUU() { 65template<s32 func(u32*, u32)> void U32P_U32(){
586 u32 retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), PARAM(3)); 66 u32 param_1 = 0;
67 u32 retval = func(&param_1, PARAM(1));
68 Core::g_app_core->SetReg(1, param_1);
587 RETURN(retval); 69 RETURN(retval);
588} 70}
589 71
590template<u32 func(u32, u32, u32, int)> void WrapU_UUUI() { 72template<s32 func(u32)> void U32() {
591 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3)); 73 RETURN(func(PARAM(0)));
592 RETURN(retval);
593} 74}
594 75
595template<u32 func(u32, u32, u32, int, u32)> void WrapU_UUUIU() { 76template<s32 func(void*)> void U32P() {
596 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4)); 77 RETURN(func(Memory::GetPointer(PARAM(0))));
597 RETURN(retval);
598} 78}
599 79
600template<u32 func(u32, u32, u32, int, u32, int)> void WrapU_UUUIUI() { 80template<s32 func(s64*, u32, void*, s32)> void S64P_U32_VoidP_S32(){
601 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5)); 81 RETURN(func((s64*)Memory::GetPointer(PARAM(0)), PARAM(1), Memory::GetPointer(PARAM(2)),
602 RETURN(retval); 82 (s32)PARAM(3)));
603} 83}
604 84
605template<u32 func(u32, u32, int, u32)> void WrapU_UUIU() { 85template<s32 func(u32*, const char*)> void U32P_CharP() {
606 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3)); 86 u32 param_1 = 0;
87 u32 retval = func(&param_1, Memory::GetCharPointer(PARAM(1)));
88 Core::g_app_core->SetReg(1, param_1);
607 RETURN(retval); 89 RETURN(retval);
608} 90}
609 91
610template<u32 func(u32, int, int, int)> void WrapU_UIII() { 92} // namespace S32
611 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
612 RETURN(retval);
613}
614 93
615template<int func(int, u32, u32, u32, u32)> void WrapI_IUUUU() { 94////////////////////////////////////////////////////////////////////////////////////////////////////
616 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4)); 95// Function wrappers that return type u32
617 RETURN(retval);
618}
619 96
620template<int func(int, u32, u32, u32, u32, u32)> void WrapI_IUUUUU() { 97namespace U32 {
621 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5));
622 RETURN(retval);
623}
624 98
625template<int func(int, u32, int, int)> void WrapI_IUII() { 99template<u32 func()> void Void() {
626 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3)); 100 RETURN(func());
627 RETURN(retval);
628}
629template<u32 func(u32, u32, u32, u32, u32)> void WrapU_UUUUU() {
630 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
631 RETURN(retval);
632} 101}
633 102
634template<void func(u32, u32, u32, u32, u32)> void WrapV_UUUUU() { 103} // namespace U32
635 func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
636}
637 104
638template<u32 func(const char *, const char *)> void WrapU_CC() { 105////////////////////////////////////////////////////////////////////////////////////////////////////
639 int retval = func(Memory::GetCharPointer(PARAM(0)), 106/// Function wrappers that return type void
640 Memory::GetCharPointer(PARAM(1)));
641 RETURN(retval);
642}
643 107
644template<void func(const char*)> void WrapV_C() { 108namespace Void {
645 func(Memory::GetCharPointer(PARAM(0)));
646}
647 109
648template<void func(s64)> void WrapV_S64() { 110template<void func(s64)> void S64() {
649 func(((s64)PARAM(1) << 32) | PARAM(0)); 111 func(((s64)PARAM(1) << 32) | PARAM(0));
650} 112}
651 113
652template<void func(const char *, int)> void WrapV_CI() { 114template<void func(const char*)> void CharP() {
653 func(Memory::GetCharPointer(PARAM(0)), PARAM(1)); 115 func(Memory::GetCharPointer(PARAM(0)));
654}
655
656template<u32 func(const char *, int)> void WrapU_CI() {
657 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1));
658 RETURN(retval);
659}
660
661template<u32 func(const char *, int, int)> void WrapU_CII() {
662 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2));
663 RETURN(retval);
664}
665
666template<int func(const char *, int, u32, int, u32)> void WrapU_CIUIU() {
667 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2),
668 PARAM(3), PARAM(4));
669 RETURN(retval);
670}
671
672template<u32 func(const char *, int, u32, int, u32, int)> void WrapU_CIUIUI() {
673 u32 retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2),
674 PARAM(3), PARAM(4), PARAM(5));
675 RETURN(retval);
676}
677
678template<u32 func(u32, u32, u32, u32, u32, u32)> void WrapU_UUUUUU() {
679 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4),
680 PARAM(5));
681 RETURN(retval);
682}
683
684template<int func(int, u32, u32, u32)> void WrapI_IUUU() {
685 int retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
686 RETURN(retval);
687}
688
689template<int func(int, u32, u32)> void WrapI_IUU() {
690 int retval = func(PARAM(0), PARAM(1), PARAM(2));
691 RETURN(retval);
692}
693
694template<u32 func(u32, u32, u32, u32, u32, u32, u32)> void WrapU_UUUUUUU() {
695 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5), PARAM(6));
696 RETURN(retval);
697}
698
699template<int func(u32, int, u32, u32)> void WrapI_UIUU() {
700 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3));
701 RETURN(retval);
702}
703
704template<int func(int, const char *)> void WrapI_IC() {
705 int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)));
706 RETURN(retval);
707}
708
709template <int func(int, const char *, const char *, u32, int)> void WrapI_ICCUI() {
710 int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), Memory::GetCharPointer(PARAM(2)), PARAM(3), PARAM(4));
711 RETURN(retval);
712}
713
714template <int func(int, const char *, const char *, int)> void WrapI_ICCI() {
715 int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), Memory::GetCharPointer(PARAM(2)), PARAM(3));
716 RETURN(retval);
717}
718
719template <int func(const char *, int, int)> void WrapI_CII() {
720 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2));
721 RETURN(retval);
722}
723
724template <int func(int, const char *, int)> void WrapI_ICI() {
725 int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2));
726 RETURN(retval);
727}
728
729template<int func(int, void *, void *, void *, void *, u32, int)> void WrapI_IVVVVUI(){
730 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) );
731 RETURN(retval);
732}
733
734template<int func(int, const char *, u32, void *, int, int, int)> void WrapI_ICUVIII(){
735 u32 retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), Memory::GetPointer(PARAM(3)), PARAM(4), PARAM(5), PARAM(6));
736 RETURN(retval);
737}
738
739template<int func(void*, u32)> void WrapI_VU(){
740 u32 param_1 = 0;
741 u32 retval = func(&param_1, PARAM(1));
742 Core::g_app_core->SetReg(1, param_1);
743 RETURN(retval);
744}
745
746template<int func(void*, void*, u32)> void WrapI_VVU(){
747 u32 retval = func(Memory::GetPointer(PARAM(0)), Memory::GetPointer(PARAM(1)), PARAM(2));
748 RETURN(retval);
749}
750
751template<int func(void*, u32, void*, int)> void WrapI_VUVI(){
752 u32 retval = func(Memory::GetPointer(PARAM(0)), PARAM(1), Memory::GetPointer(PARAM(2)), PARAM(3));
753 RETURN(retval);
754}
755
756template<int func(void*, u32, u32, u32, u32, u32)> void WrapI_VUUUUU(){
757 u32 param_1 = 0;
758 u32 retval = func(&param_1, PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4));
759 Core::g_app_core->SetReg(1, param_1);
760 RETURN(retval);
761}
762
763template<int func(u32, s64)> void WrapI_US64() {
764 int retval = func(PARAM(0), (((u64)PARAM(3) << 32) | PARAM(2)));
765 RETURN(retval);
766} 116}
767 117
768template<int func(void*, void*, u32, u32, s64)> void WrapI_VVUUS64() { 118} // namespace Void
769 u32 param_1 = 0;
770 int retval = func(&param_1, Memory::GetPointer(PARAM(1)), PARAM(2), PARAM(3), (((u64)PARAM(4) << 32) | PARAM(0)));
771 Core::g_app_core->SetReg(1, param_1);
772 RETURN(retval);
773}
774 119
775// TODO(bunnei): Is this correct? Probably not 120} // namespace Wrap
776template<int func(u32, u32, u32, u32, s64)> void WrapI_UUUUS64() {
777 int retval = func(PARAM(5), PARAM(1), PARAM(2), PARAM(3), (((u64)PARAM(4) << 32) | PARAM(0)));
778 RETURN(retval);
779}
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 76c6a0771..d964d062e 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -34,9 +34,7 @@ enum MapMemoryPermission {
34}; 34};
35 35
36/// Map application or GSP heap memory 36/// Map application or GSP heap memory
37Result ControlMemory(void* _out_addr, u32 operation, u32 addr0, u32 addr1, u32 size, u32 permissions) { 37Result ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 addr1, u32 size, u32 permissions) {
38 u32* out_addr = (u32*)_out_addr;
39
40 DEBUG_LOG(SVC,"called operation=0x%08X, addr0=0x%08X, addr1=0x%08X, size=%08X, permissions=0x%08X", 38 DEBUG_LOG(SVC,"called operation=0x%08X, addr0=0x%08X, addr1=0x%08X, size=%08X, permissions=0x%08X",
41 operation, addr0, addr1, size, permissions); 39 operation, addr0, addr1, size, permissions);
42 40
@@ -76,8 +74,7 @@ Result MapMemoryBlock(Handle memblock, u32 addr, u32 mypermissions, u32 otherper
76} 74}
77 75
78/// Connect to an OS service given the port name, returns the handle to the port to out 76/// Connect to an OS service given the port name, returns the handle to the port to out
79Result ConnectToPort(void* _out, const char* port_name) { 77Result ConnectToPort(Handle* out, const char* port_name) {
80 Handle* out = (Handle*)_out;
81 Service::Interface* service = Service::g_manager->FetchFromPortName(port_name); 78 Service::Interface* service = Service::g_manager->FetchFromPortName(port_name);
82 79
83 DEBUG_LOG(SVC, "called port_name=%s", port_name); 80 DEBUG_LOG(SVC, "called port_name=%s", port_name);
@@ -136,11 +133,9 @@ Result WaitSynchronization1(Handle handle, s64 nano_seconds) {
136} 133}
137 134
138/// Wait for the given handles to synchronize, timeout after the specified nanoseconds 135/// Wait for the given handles to synchronize, timeout after the specified nanoseconds
139Result WaitSynchronizationN(void* _out, void* _handles, u32 handle_count, u32 wait_all, 136Result WaitSynchronizationN(s32* out, Handle* handles, s32 handle_count, bool wait_all,
140 s64 nano_seconds) { 137 s64 nano_seconds) {
141 // TODO(bunnei): Do something with nano_seconds, currently ignoring this 138 // TODO(bunnei): Do something with nano_seconds, currently ignoring this
142 s32* out = (s32*)_out;
143 Handle* handles = (Handle*)_handles;
144 bool unlock_all = true; 139 bool unlock_all = true;
145 bool wait_infinite = (nano_seconds == -1); // Used to wait until a thread has terminated 140 bool wait_infinite = (nano_seconds == -1); // Used to wait until a thread has terminated
146 141
@@ -148,7 +143,7 @@ Result WaitSynchronizationN(void* _out, void* _handles, u32 handle_count, u32 wa
148 handle_count, (wait_all ? "true" : "false"), nano_seconds); 143 handle_count, (wait_all ? "true" : "false"), nano_seconds);
149 144
150 // Iterate through each handle, synchronize kernel object 145 // Iterate through each handle, synchronize kernel object
151 for (u32 i = 0; i < handle_count; i++) { 146 for (s32 i = 0; i < handle_count; i++) {
152 bool wait = false; 147 bool wait = false;
153 Kernel::Object* object = Kernel::g_object_pool.GetFast<Kernel::Object>(handles[i]); 148 Kernel::Object* object = Kernel::g_object_pool.GetFast<Kernel::Object>(handles[i]);
154 149
@@ -200,18 +195,17 @@ void OutputDebugString(const char* string) {
200} 195}
201 196
202/// Get resource limit 197/// Get resource limit
203Result GetResourceLimit(void* _resource_limit, Handle process) { 198Result GetResourceLimit(Handle* resource_limit, Handle process) {
204 // With regards to proceess values: 199 // With regards to proceess values:
205 // 0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for 200 // 0xFFFF8001 is a handle alias for the current KProcess, and 0xFFFF8000 is a handle alias for
206 // the current KThread. 201 // the current KThread.
207 Handle* resource_limit = (Handle*)_resource_limit;
208 *resource_limit = 0xDEADBEEF; 202 *resource_limit = 0xDEADBEEF;
209 ERROR_LOG(SVC, "(UNIMPLEMENTED) called process=0x%08X", process); 203 ERROR_LOG(SVC, "(UNIMPLEMENTED) called process=0x%08X", process);
210 return 0; 204 return 0;
211} 205}
212 206
213/// Get resource limit current values 207/// Get resource limit current values
214Result GetResourceLimitCurrentValues(void* _values, Handle resource_limit, void* names, 208Result GetResourceLimitCurrentValues(s64* values, Handle resource_limit, void* names,
215 s32 name_count) { 209 s32 name_count) {
216 ERROR_LOG(SVC, "(UNIMPLEMENTED) called resource_limit=%08X, names=%s, name_count=%d", 210 ERROR_LOG(SVC, "(UNIMPLEMENTED) called resource_limit=%08X, names=%s, name_count=%d",
217 resource_limit, names, name_count); 211 resource_limit, names, name_count);
@@ -255,8 +249,7 @@ u32 ExitThread() {
255} 249}
256 250
257/// Gets the priority for the specified thread 251/// Gets the priority for the specified thread
258Result GetThreadPriority(void* _priority, Handle handle) { 252Result GetThreadPriority(s32* priority, Handle handle) {
259 s32* priority = (s32*)_priority;
260 *priority = Kernel::GetThreadPriority(handle); 253 *priority = Kernel::GetThreadPriority(handle);
261 return 0; 254 return 0;
262} 255}
@@ -267,8 +260,7 @@ Result SetThreadPriority(Handle handle, s32 priority) {
267} 260}
268 261
269/// Create a mutex 262/// Create a mutex
270Result CreateMutex(void* _mutex, u32 initial_locked) { 263Result CreateMutex(Handle* mutex, u32 initial_locked) {
271 Handle* mutex = (Handle*)_mutex;
272 *mutex = Kernel::CreateMutex((initial_locked != 0)); 264 *mutex = Kernel::CreateMutex((initial_locked != 0));
273 DEBUG_LOG(SVC, "called initial_locked=%s : created handle=0x%08X", 265 DEBUG_LOG(SVC, "called initial_locked=%s : created handle=0x%08X",
274 initial_locked ? "true" : "false", *mutex); 266 initial_locked ? "true" : "false", *mutex);
@@ -284,20 +276,19 @@ Result ReleaseMutex(Handle handle) {
284} 276}
285 277
286/// Get current thread ID 278/// Get current thread ID
287Result GetThreadId(void* thread_id, u32 thread) { 279Result GetThreadId(u32* thread_id, Handle thread) {
288 ERROR_LOG(SVC, "(UNIMPLEMENTED) called thread=0x%08X", thread); 280 ERROR_LOG(SVC, "(UNIMPLEMENTED) called thread=0x%08X", thread);
289 return 0; 281 return 0;
290} 282}
291 283
292/// Query memory 284/// Query memory
293Result QueryMemory(void *_info, void *_out, u32 addr) { 285Result QueryMemory(void* info, void* out, u32 addr) {
294 ERROR_LOG(SVC, "(UNIMPLEMENTED) called addr=0x%08X", addr); 286 ERROR_LOG(SVC, "(UNIMPLEMENTED) called addr=0x%08X", addr);
295 return 0; 287 return 0;
296} 288}
297 289
298/// Create an event 290/// Create an event
299Result CreateEvent(void* _event, u32 reset_type) { 291Result CreateEvent(Handle* evt, u32 reset_type) {
300 Handle* evt = (Handle*)_event;
301 *evt = Kernel::CreateEvent((ResetType)reset_type); 292 *evt = Kernel::CreateEvent((ResetType)reset_type);
302 DEBUG_LOG(SVC, "called reset_type=0x%08X : created handle=0x%08X", 293 DEBUG_LOG(SVC, "called reset_type=0x%08X : created handle=0x%08X",
303 reset_type, *evt); 294 reset_type, *evt);
@@ -305,8 +296,7 @@ Result CreateEvent(void* _event, u32 reset_type) {
305} 296}
306 297
307/// Duplicates a kernel handle 298/// Duplicates a kernel handle
308Result DuplicateHandle(void* _out, Handle handle) { 299Result DuplicateHandle(Handle* out, Handle handle) {
309 Handle* out = (Handle*)_out;
310 DEBUG_LOG(SVC, "called handle=0x%08X", handle); 300 DEBUG_LOG(SVC, "called handle=0x%08X", handle);
311 301
312 // Translate kernel handles -> real handles 302 // Translate kernel handles -> real handles
@@ -342,132 +332,132 @@ void SleepThread(s64 nanoseconds) {
342} 332}
343 333
344const HLE::FunctionDef SVC_Table[] = { 334const HLE::FunctionDef SVC_Table[] = {
345 {0x00, nullptr, "Unknown"}, 335 {0x00, nullptr, "Unknown"},
346 {0x01, WrapI_VUUUUU<ControlMemory>, "ControlMemory"}, 336 {0x01, Wrap::S32::U32P_U32_U32_U32_U32_U32<ControlMemory>, "ControlMemory"},
347 {0x02, WrapI_VVU<QueryMemory>, "QueryMemory"}, 337 {0x02, Wrap::S32::VoidP_VoidP_U32<QueryMemory>, "QueryMemory"},
348 {0x03, nullptr, "ExitProcess"}, 338 {0x03, nullptr, "ExitProcess"},
349 {0x04, nullptr, "GetProcessAffinityMask"}, 339 {0x04, nullptr, "GetProcessAffinityMask"},
350 {0x05, nullptr, "SetProcessAffinityMask"}, 340 {0x05, nullptr, "SetProcessAffinityMask"},
351 {0x06, nullptr, "GetProcessIdealProcessor"}, 341 {0x06, nullptr, "GetProcessIdealProcessor"},
352 {0x07, nullptr, "SetProcessIdealProcessor"}, 342 {0x07, nullptr, "SetProcessIdealProcessor"},
353 {0x08, WrapI_UUUUU<CreateThread>, "CreateThread"}, 343 {0x08, Wrap::S32::U32_U32_U32_U32_U32<CreateThread>, "CreateThread"},
354 {0x09, WrapU_V<ExitThread>, "ExitThread"}, 344 {0x09, Wrap::U32::Void<ExitThread>, "ExitThread"},
355 {0x0A, WrapV_S64<SleepThread>, "SleepThread"}, 345 {0x0A, Wrap::Void::S64<SleepThread>, "SleepThread"},
356 {0x0B, WrapI_VU<GetThreadPriority>, "GetThreadPriority"}, 346 {0x0B, Wrap::S32::S32P_U32<GetThreadPriority>, "GetThreadPriority"},
357 {0x0C, WrapI_UI<SetThreadPriority>, "SetThreadPriority"}, 347 {0x0C, Wrap::S32::U32_S32<SetThreadPriority>, "SetThreadPriority"},
358 {0x0D, nullptr, "GetThreadAffinityMask"}, 348 {0x0D, nullptr, "GetThreadAffinityMask"},
359 {0x0E, nullptr, "SetThreadAffinityMask"}, 349 {0x0E, nullptr, "SetThreadAffinityMask"},
360 {0x0F, nullptr, "GetThreadIdealProcessor"}, 350 {0x0F, nullptr, "GetThreadIdealProcessor"},
361 {0x10, nullptr, "SetThreadIdealProcessor"}, 351 {0x10, nullptr, "SetThreadIdealProcessor"},
362 {0x11, nullptr, "GetCurrentProcessorNumber"}, 352 {0x11, nullptr, "GetCurrentProcessorNumber"},
363 {0x12, nullptr, "Run"}, 353 {0x12, nullptr, "Run"},
364 {0x13, WrapI_VU<CreateMutex>, "CreateMutex"}, 354 {0x13, Wrap::S32::U32P_U32<CreateMutex>, "CreateMutex"},
365 {0x14, WrapI_U<ReleaseMutex>, "ReleaseMutex"}, 355 {0x14, Wrap::S32::U32<ReleaseMutex>, "ReleaseMutex"},
366 {0x15, nullptr, "CreateSemaphore"}, 356 {0x15, nullptr, "CreateSemaphore"},
367 {0x16, nullptr, "ReleaseSemaphore"}, 357 {0x16, nullptr, "ReleaseSemaphore"},
368 {0x17, WrapI_VU<CreateEvent>, "CreateEvent"}, 358 {0x17, Wrap::S32::U32P_U32<CreateEvent>, "CreateEvent"},
369 {0x18, WrapI_U<SignalEvent>, "SignalEvent"}, 359 {0x18, Wrap::S32::U32<SignalEvent>, "SignalEvent"},
370 {0x19, WrapI_U<ClearEvent>, "ClearEvent"}, 360 {0x19, Wrap::S32::U32<ClearEvent>, "ClearEvent"},
371 {0x1A, nullptr, "CreateTimer"}, 361 {0x1A, nullptr, "CreateTimer"},
372 {0x1B, nullptr, "SetTimer"}, 362 {0x1B, nullptr, "SetTimer"},
373 {0x1C, nullptr, "CancelTimer"}, 363 {0x1C, nullptr, "CancelTimer"},
374 {0x1D, nullptr, "ClearTimer"}, 364 {0x1D, nullptr, "ClearTimer"},
375 {0x1E, nullptr, "CreateMemoryBlock"}, 365 {0x1E, nullptr, "CreateMemoryBlock"},
376 {0x1F, WrapI_UUUU<MapMemoryBlock>, "MapMemoryBlock"}, 366 {0x1F, Wrap::S32::U32_U32_U32_U32<MapMemoryBlock>, "MapMemoryBlock"},
377 {0x20, nullptr, "UnmapMemoryBlock"}, 367 {0x20, nullptr, "UnmapMemoryBlock"},
378 {0x21, WrapI_V<CreateAddressArbiter>, "CreateAddressArbiter"}, 368 {0x21, Wrap::S32::U32P<CreateAddressArbiter>, "CreateAddressArbiter"},
379 {0x22, WrapI_UUUUS64<ArbitrateAddress>, "ArbitrateAddress"}, 369 {0x22, Wrap::S32::U32_U32_U32_U32_S64<ArbitrateAddress>, "ArbitrateAddress"},
380 {0x23, WrapI_U<CloseHandle>, "CloseHandle"}, 370 {0x23, Wrap::S32::U32<CloseHandle>, "CloseHandle"},
381 {0x24, WrapI_US64<WaitSynchronization1>, "WaitSynchronization1"}, 371 {0x24, Wrap::S32::U32_S64<WaitSynchronization1>, "WaitSynchronization1"},
382 {0x25, WrapI_VVUUS64<WaitSynchronizationN>, "WaitSynchronizationN"}, 372 {0x25, Wrap::S32::S32P_U32P_S32_Bool_S64<WaitSynchronizationN>, "WaitSynchronizationN"},
383 {0x26, nullptr, "SignalAndWait"}, 373 {0x26, nullptr, "SignalAndWait"},
384 {0x27, WrapI_VU<DuplicateHandle>, "DuplicateHandle"}, 374 {0x27, Wrap::S32::U32P_U32<DuplicateHandle>, "DuplicateHandle"},
385 {0x28, nullptr, "GetSystemTick"}, 375 {0x28, nullptr, "GetSystemTick"},
386 {0x29, nullptr, "GetHandleInfo"}, 376 {0x29, nullptr, "GetHandleInfo"},
387 {0x2A, nullptr, "GetSystemInfo"}, 377 {0x2A, nullptr, "GetSystemInfo"},
388 {0x2B, nullptr, "GetProcessInfo"}, 378 {0x2B, nullptr, "GetProcessInfo"},
389 {0x2C, nullptr, "GetThreadInfo"}, 379 {0x2C, nullptr, "GetThreadInfo"},
390 {0x2D, WrapI_VC<ConnectToPort>, "ConnectToPort"}, 380 {0x2D, Wrap::S32::U32P_CharP<ConnectToPort>, "ConnectToPort"},
391 {0x2E, nullptr, "SendSyncRequest1"}, 381 {0x2E, nullptr, "SendSyncRequest1"},
392 {0x2F, nullptr, "SendSyncRequest2"}, 382 {0x2F, nullptr, "SendSyncRequest2"},
393 {0x30, nullptr, "SendSyncRequest3"}, 383 {0x30, nullptr, "SendSyncRequest3"},
394 {0x31, nullptr, "SendSyncRequest4"}, 384 {0x31, nullptr, "SendSyncRequest4"},
395 {0x32, WrapI_U<SendSyncRequest>, "SendSyncRequest"}, 385 {0x32, Wrap::S32::U32<SendSyncRequest>, "SendSyncRequest"},
396 {0x33, nullptr, "OpenProcess"}, 386 {0x33, nullptr, "OpenProcess"},
397 {0x34, nullptr, "OpenThread"}, 387 {0x34, nullptr, "OpenThread"},
398 {0x35, nullptr, "GetProcessId"}, 388 {0x35, nullptr, "GetProcessId"},
399 {0x36, nullptr, "GetProcessIdOfThread"}, 389 {0x36, nullptr, "GetProcessIdOfThread"},
400 {0x37, WrapI_VU<GetThreadId>, "GetThreadId"}, 390 {0x37, Wrap::S32::U32P_U32<GetThreadId>, "GetThreadId"},
401 {0x38, WrapI_VU<GetResourceLimit>, "GetResourceLimit"}, 391 {0x38, Wrap::S32::U32P_U32<GetResourceLimit>, "GetResourceLimit"},
402 {0x39, nullptr, "GetResourceLimitLimitValues"}, 392 {0x39, nullptr, "GetResourceLimitLimitValues"},
403 {0x3A, WrapI_VUVI<GetResourceLimitCurrentValues>, "GetResourceLimitCurrentValues"}, 393 {0x3A, Wrap::S32::S64P_U32_VoidP_S32<GetResourceLimitCurrentValues>, "GetResourceLimitCurrentValues"},
404 {0x3B, nullptr, "GetThreadContext"}, 394 {0x3B, nullptr, "GetThreadContext"},
405 {0x3C, nullptr, "Break"}, 395 {0x3C, nullptr, "Break"},
406 {0x3D, WrapV_C<OutputDebugString>, "OutputDebugString"}, 396 {0x3D, Wrap::Void::CharP<OutputDebugString>, "OutputDebugString"},
407 {0x3E, nullptr, "ControlPerformanceCounter"}, 397 {0x3E, nullptr, "ControlPerformanceCounter"},
408 {0x3F, nullptr, "Unknown"}, 398 {0x3F, nullptr, "Unknown"},
409 {0x40, nullptr, "Unknown"}, 399 {0x40, nullptr, "Unknown"},
410 {0x41, nullptr, "Unknown"}, 400 {0x41, nullptr, "Unknown"},
411 {0x42, nullptr, "Unknown"}, 401 {0x42, nullptr, "Unknown"},
412 {0x43, nullptr, "Unknown"}, 402 {0x43, nullptr, "Unknown"},
413 {0x44, nullptr, "Unknown"}, 403 {0x44, nullptr, "Unknown"},
414 {0x45, nullptr, "Unknown"}, 404 {0x45, nullptr, "Unknown"},
415 {0x46, nullptr, "Unknown"}, 405 {0x46, nullptr, "Unknown"},
416 {0x47, nullptr, "CreatePort"}, 406 {0x47, nullptr, "CreatePort"},
417 {0x48, nullptr, "CreateSessionToPort"}, 407 {0x48, nullptr, "CreateSessionToPort"},
418 {0x49, nullptr, "CreateSession"}, 408 {0x49, nullptr, "CreateSession"},
419 {0x4A, nullptr, "AcceptSession"}, 409 {0x4A, nullptr, "AcceptSession"},
420 {0x4B, nullptr, "ReplyAndReceive1"}, 410 {0x4B, nullptr, "ReplyAndReceive1"},
421 {0x4C, nullptr, "ReplyAndReceive2"}, 411 {0x4C, nullptr, "ReplyAndReceive2"},
422 {0x4D, nullptr, "ReplyAndReceive3"}, 412 {0x4D, nullptr, "ReplyAndReceive3"},
423 {0x4E, nullptr, "ReplyAndReceive4"}, 413 {0x4E, nullptr, "ReplyAndReceive4"},
424 {0x4F, nullptr, "ReplyAndReceive"}, 414 {0x4F, nullptr, "ReplyAndReceive"},
425 {0x50, nullptr, "BindInterrupt"}, 415 {0x50, nullptr, "BindInterrupt"},
426 {0x51, nullptr, "UnbindInterrupt"}, 416 {0x51, nullptr, "UnbindInterrupt"},
427 {0x52, nullptr, "InvalidateProcessDataCache"}, 417 {0x52, nullptr, "InvalidateProcessDataCache"},
428 {0x53, nullptr, "StoreProcessDataCache"}, 418 {0x53, nullptr, "StoreProcessDataCache"},
429 {0x54, nullptr, "FlushProcessDataCache"}, 419 {0x54, nullptr, "FlushProcessDataCache"},
430 {0x55, nullptr, "StartInterProcessDma"}, 420 {0x55, nullptr, "StartInterProcessDma"},
431 {0x56, nullptr, "StopDma"}, 421 {0x56, nullptr, "StopDma"},
432 {0x57, nullptr, "GetDmaState"}, 422 {0x57, nullptr, "GetDmaState"},
433 {0x58, nullptr, "RestartDma"}, 423 {0x58, nullptr, "RestartDma"},
434 {0x59, nullptr, "Unknown"}, 424 {0x59, nullptr, "Unknown"},
435 {0x5A, nullptr, "Unknown"}, 425 {0x5A, nullptr, "Unknown"},
436 {0x5B, nullptr, "Unknown"}, 426 {0x5B, nullptr, "Unknown"},
437 {0x5C, nullptr, "Unknown"}, 427 {0x5C, nullptr, "Unknown"},
438 {0x5D, nullptr, "Unknown"}, 428 {0x5D, nullptr, "Unknown"},
439 {0x5E, nullptr, "Unknown"}, 429 {0x5E, nullptr, "Unknown"},
440 {0x5F, nullptr, "Unknown"}, 430 {0x5F, nullptr, "Unknown"},
441 {0x60, nullptr, "DebugActiveProcess"}, 431 {0x60, nullptr, "DebugActiveProcess"},
442 {0x61, nullptr, "BreakDebugProcess"}, 432 {0x61, nullptr, "BreakDebugProcess"},
443 {0x62, nullptr, "TerminateDebugProcess"}, 433 {0x62, nullptr, "TerminateDebugProcess"},
444 {0x63, nullptr, "GetProcessDebugEvent"}, 434 {0x63, nullptr, "GetProcessDebugEvent"},
445 {0x64, nullptr, "ContinueDebugEvent"}, 435 {0x64, nullptr, "ContinueDebugEvent"},
446 {0x65, nullptr, "GetProcessList"}, 436 {0x65, nullptr, "GetProcessList"},
447 {0x66, nullptr, "GetThreadList"}, 437 {0x66, nullptr, "GetThreadList"},
448 {0x67, nullptr, "GetDebugThreadContext"}, 438 {0x67, nullptr, "GetDebugThreadContext"},
449 {0x68, nullptr, "SetDebugThreadContext"}, 439 {0x68, nullptr, "SetDebugThreadContext"},
450 {0x69, nullptr, "QueryDebugProcessMemory"}, 440 {0x69, nullptr, "QueryDebugProcessMemory"},
451 {0x6A, nullptr, "ReadProcessMemory"}, 441 {0x6A, nullptr, "ReadProcessMemory"},
452 {0x6B, nullptr, "WriteProcessMemory"}, 442 {0x6B, nullptr, "WriteProcessMemory"},
453 {0x6C, nullptr, "SetHardwareBreakPoint"}, 443 {0x6C, nullptr, "SetHardwareBreakPoint"},
454 {0x6D, nullptr, "GetDebugThreadParam"}, 444 {0x6D, nullptr, "GetDebugThreadParam"},
455 {0x6E, nullptr, "Unknown"}, 445 {0x6E, nullptr, "Unknown"},
456 {0x6F, nullptr, "Unknown"}, 446 {0x6F, nullptr, "Unknown"},
457 {0x70, nullptr, "ControlProcessMemory"}, 447 {0x70, nullptr, "ControlProcessMemory"},
458 {0x71, nullptr, "MapProcessMemory"}, 448 {0x71, nullptr, "MapProcessMemory"},
459 {0x72, nullptr, "UnmapProcessMemory"}, 449 {0x72, nullptr, "UnmapProcessMemory"},
460 {0x73, nullptr, "Unknown"}, 450 {0x73, nullptr, "Unknown"},
461 {0x74, nullptr, "Unknown"}, 451 {0x74, nullptr, "Unknown"},
462 {0x75, nullptr, "Unknown"}, 452 {0x75, nullptr, "Unknown"},
463 {0x76, nullptr, "TerminateProcess"}, 453 {0x76, nullptr, "TerminateProcess"},
464 {0x77, nullptr, "Unknown"}, 454 {0x77, nullptr, "Unknown"},
465 {0x78, nullptr, "CreateResourceLimit"}, 455 {0x78, nullptr, "CreateResourceLimit"},
466 {0x79, nullptr, "Unknown"}, 456 {0x79, nullptr, "Unknown"},
467 {0x7A, nullptr, "Unknown"}, 457 {0x7A, nullptr, "Unknown"},
468 {0x7B, nullptr, "Unknown"}, 458 {0x7B, nullptr, "Unknown"},
469 {0x7C, nullptr, "KernelSetState"}, 459 {0x7C, nullptr, "KernelSetState"},
470 {0x7D, nullptr, "QueryProcessMemory"}, 460 {0x7D, nullptr, "QueryProcessMemory"},
471}; 461};
472 462
473void Register() { 463void Register() {