summaryrefslogtreecommitdiff
path: root/src/core/hle/function_wrappers.h
diff options
context:
space:
mode:
authorGravatar bunnei2014-06-01 20:48:29 -0400
committerGravatar bunnei2014-06-01 20:48:29 -0400
commit15c7d8170669cadce685471fea48c215687d6622 (patch)
treed41f33839f1fd58fc73b573b420497e6108cb2f5 /src/core/hle/function_wrappers.h
parentlog: updated MAX_LOGLEVEL to use correct log level enum type (diff)
downloadyuzu-15c7d8170669cadce685471fea48c215687d6622.tar.gz
yuzu-15c7d8170669cadce685471fea48c215687d6622.tar.xz
yuzu-15c7d8170669cadce685471fea48c215687d6622.zip
svc: cleaned up function_wrappers, updated various SVCs to make use of pointer arguments
Diffstat (limited to 'src/core/hle/function_wrappers.h')
-rw-r--r--src/core/hle/function_wrappers.h37
1 files changed, 22 insertions, 15 deletions
diff --git a/src/core/hle/function_wrappers.h b/src/core/hle/function_wrappers.h
index 7eb62fc48..65e3164c4 100644
--- a/src/core/hle/function_wrappers.h
+++ b/src/core/hle/function_wrappers.h
@@ -33,7 +33,9 @@ template<u32 func()> void WrapU_V() {
33} 33}
34 34
35template<int func(void *, const char *)> void WrapI_VC() { 35template<int func(void *, const char *)> void WrapI_VC() {
36 u32 retval = func(Memory::GetPointer(PARAM(0)), Memory::GetCharPointer(PARAM(1))); 36 u32 param_1 = 0;
37 u32 retval = func(&param_1, Memory::GetCharPointer(PARAM(1)));
38 Core::g_app_core->SetReg(1, param_1);
37 RETURN(retval); 39 RETURN(retval);
38} 40}
39 41
@@ -48,7 +50,8 @@ template<int func(const char *, int, int, u32)> void WrapI_CIIU() {
48} 50}
49 51
50template<int func(int, const char *, u32, void *, void *, u32, int)> void WrapI_ICUVVUI() { 52template<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) ); 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));
52 RETURN(retval); 55 RETURN(retval);
53} 56}
54 57
@@ -394,8 +397,8 @@ template<u32 func(const char *)> void WrapU_C() {
394 397
395template<u32 func(const char *, const char *, const char *, u32)> void WrapU_CCCU() { 398template<u32 func(const char *, const char *, const char *, u32)> void WrapU_CCCU() {
396 u32 retval = func(Memory::GetCharPointer(PARAM(0)), 399 u32 retval = func(Memory::GetCharPointer(PARAM(0)),
397 Memory::GetCharPointer(PARAM(1)), Memory::GetCharPointer(PARAM(2)), 400 Memory::GetCharPointer(PARAM(1)), Memory::GetCharPointer(PARAM(2)),
398 PARAM(3)); 401 PARAM(3));
399 RETURN(retval); 402 RETURN(retval);
400} 403}
401 404
@@ -431,7 +434,7 @@ template<int func(const char *, u32, u32)> void WrapI_CUU() {
431 434
432template<int func(const char *, u32, u32, u32)> void WrapI_CUUU() { 435template<int func(const char *, u32, u32, u32)> void WrapI_CUUU() {
433 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2), 436 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2),
434 PARAM(3)); 437 PARAM(3));
435 RETURN(retval); 438 RETURN(retval);
436} 439}
437 440
@@ -442,7 +445,7 @@ template<int func(const char *, const char*, int, int)> void WrapI_CCII() {
442 445
443template<int func(const char *, u32, u32, int, u32, u32)> void WrapI_CUUIUU() { 446template<int func(const char *, u32, u32, int, u32, u32)> void WrapI_CUUIUU() {
444 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2), 447 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2),
445 PARAM(3), PARAM(4), PARAM(5)); 448 PARAM(3), PARAM(4), PARAM(5));
446 RETURN(retval); 449 RETURN(retval);
447} 450}
448 451
@@ -454,7 +457,7 @@ template<int func(const char *, int, int, u32, int, int)> void WrapI_CIIUII() {
454 457
455template<int func(const char *, int, u32, u32, u32)> void WrapI_CIUUU() { 458template<int func(const char *, int, u32, u32, u32)> void WrapI_CIUUU() {
456 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2), 459 int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2),
457 PARAM(3), PARAM(4)); 460 PARAM(3), PARAM(4));
458 RETURN(retval); 461 RETURN(retval);
459} 462}
460 463
@@ -554,18 +557,18 @@ template<int func(const char *, u32, int, u32)> void WrapI_CUIU() {
554 557
555template<void func(u32, const char *, u32, int, u32)> void WrapV_UCUIU() { 558template<void func(u32, const char *, u32, int, u32)> void WrapV_UCUIU() {
556 func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), PARAM(3), 559 func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), PARAM(3),
557 PARAM(4)); 560 PARAM(4));
558} 561}
559 562
560template<int func(u32, const char *, u32, int, u32)> void WrapI_UCUIU() { 563template<int func(u32, const char *, u32, int, u32)> void WrapI_UCUIU() {
561 int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), 564 int retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2),
562 PARAM(3), PARAM(4)); 565 PARAM(3), PARAM(4));
563 RETURN(retval); 566 RETURN(retval);
564} 567}
565 568
566template<void func(const char *, u32, int, int, u32)> void WrapV_CUIIU() { 569template<void func(const char *, u32, int, int, u32)> void WrapV_CUIIU() {
567 func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3), 570 func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3),
568 PARAM(4)); 571 PARAM(4));
569} 572}
570 573
571template<int func(const char *, u32, int, int, u32)> void WrapI_CUIIU() { 574template<int func(const char *, u32, int, int, u32)> void WrapI_CUIIU() {
@@ -689,8 +692,8 @@ template<int func(int, u32, u32)> void WrapI_IUU() {
689} 692}
690 693
691template<u32 func(u32, u32, u32, u32, u32, u32, u32)> void WrapU_UUUUUUU() { 694template<u32 func(u32, u32, u32, u32, u32, u32, u32)> void WrapU_UUUUUUU() {
692 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5), PARAM(6)); 695 u32 retval = func(PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5), PARAM(6));
693 RETURN(retval); 696 RETURN(retval);
694} 697}
695 698
696template<int func(u32, int, u32, u32)> void WrapI_UIUU() { 699template<int func(u32, int, u32, u32)> void WrapI_UIUU() {
@@ -734,7 +737,9 @@ template<int func(int, const char *, u32, void *, int, int, int)> void WrapI_ICU
734} 737}
735 738
736template<int func(void*, u32)> void WrapI_VU(){ 739template<int func(void*, u32)> void WrapI_VU(){
737 u32 retval = func(Memory::GetPointer(PARAM(0)), PARAM(1)); 740 u32 param_1 = 0;
741 u32 retval = func(&param_1, PARAM(1));
742 Core::g_app_core->SetReg(1, param_1);
738 RETURN(retval); 743 RETURN(retval);
739} 744}
740 745
@@ -749,7 +754,9 @@ template<int func(void*, u32, void*, int)> void WrapI_VUVI(){
749} 754}
750 755
751template<int func(void*, u32, u32, u32, u32, u32)> void WrapI_VUUUUU(){ 756template<int func(void*, u32, u32, u32, u32, u32)> void WrapI_VUUUUU(){
752 u32 retval = func(NULL, PARAM(0), PARAM(1), PARAM(2), PARAM(3), PARAM(4)); 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);
753 RETURN(retval); 760 RETURN(retval);
754} 761}
755 762
@@ -763,7 +770,7 @@ template<int func(void*, void*, u32, u32, s64)> void WrapI_VVUUS64() {
763 RETURN(retval); 770 RETURN(retval);
764} 771}
765 772
766// TODO(bunne): Is this correct? Probably not 773// TODO(bunnei): Is this correct? Probably not
767template<int func(u32, u32, u32, u32, s64)> void WrapI_UUUUS64() { 774template<int func(u32, u32, u32, u32, s64)> void WrapI_UUUUS64() {
768 int retval = func(PARAM(5), PARAM(1), PARAM(2), PARAM(3), (((u64)PARAM(4) << 32) | PARAM(0))); 775 int retval = func(PARAM(5), PARAM(1), PARAM(2), PARAM(3), (((u64)PARAM(4) << 32) | PARAM(0)));
769 RETURN(retval); 776 RETURN(retval);