summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2014-05-01 18:50:36 -0400
committerGravatar bunnei2014-05-01 18:50:36 -0400
commit4ee72869cce3625f25fb516a8980460510df6041 (patch)
treefdcba1c85612bfc4c45a593722bcc8838da7a920
parent- added option to load a code.bin file extracted from a CXI file (diff)
downloadyuzu-4ee72869cce3625f25fb516a8980460510df6041.tar.gz
yuzu-4ee72869cce3625f25fb516a8980460510df6041.tar.xz
yuzu-4ee72869cce3625f25fb516a8980460510df6041.zip
- added some function wrappers for HLE
- added stub for SVC CreateAddressArbiter - added OutputDebugString SVC
-rw-r--r--src/core/hle/function_wrappers.h20
-rw-r--r--src/core/hle/syscall.cpp19
2 files changed, 29 insertions, 10 deletions
diff --git a/src/core/hle/function_wrappers.h b/src/core/hle/function_wrappers.h
index 4897d3f28..53bfafa78 100644
--- a/src/core/hle/function_wrappers.h
+++ b/src/core/hle/function_wrappers.h
@@ -158,8 +158,8 @@ template<int func(u32, u32, u32, u32, u32)> void WrapI_UUUUU() {
158 RETURN(retval); 158 RETURN(retval);
159} 159}
160 160
161template<int func()> void WrapI_V() { 161template<int func(void*)> void WrapI_V() {
162 int retval = func(); 162 u32 retval = func(Memory::GetPointer(PARAM(0)));
163 RETURN(retval); 163 RETURN(retval);
164} 164}
165 165
@@ -638,6 +638,10 @@ template<u32 func(const char *, const char *)> void WrapU_CC() {
638 RETURN(retval); 638 RETURN(retval);
639} 639}
640 640
641template<void func(const char*)> void WrapV_C() {
642 func(Memory::GetCharPointer(PARAM(0)));
643}
644
641template<void func(const char *, int)> void WrapV_CI() { 645template<void func(const char *, int)> void WrapV_CI() {
642 func(Memory::GetCharPointer(PARAM(0)), PARAM(1)); 646 func(Memory::GetCharPointer(PARAM(0)), PARAM(1));
643} 647}
@@ -716,18 +720,18 @@ template <int func(int, const char *, int)> void WrapI_ICI() {
716} 720}
717 721
718template<int func(int, void *, void *, void *, void *, u32, int)> void WrapI_IVVVVUI(){ 722template<int func(int, void *, void *, void *, void *, u32, int)> void WrapI_IVVVVUI(){
719 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) ); 723 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) );
720 RETURN(retval); 724 RETURN(retval);
721} 725}
722 726
723template<int func(int, const char *, u32, void *, int, int, int)> void WrapI_ICUVIII(){ 727template<int func(int, const char *, u32, void *, int, int, int)> void WrapI_ICUVIII(){
724 u32 retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), Memory::GetPointer(PARAM(3)), PARAM(4), PARAM(5), PARAM(6)); 728 u32 retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), Memory::GetPointer(PARAM(3)), PARAM(4), PARAM(5), PARAM(6));
725 RETURN(retval); 729 RETURN(retval);
726} 730}
727 731
728template<int func(void *, u32, u32, u32, u32, u32)> void WrapI_VUUUUU(){ 732template<int func(void *, u32, u32, u32, u32, u32)> void WrapI_VUUUUU(){
729 u32 retval = func(Memory::GetPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5)); 733 u32 retval = func(Memory::GetPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5));
730 RETURN(retval); 734 RETURN(retval);
731} 735}
732 736
733template<int func(u32, s64)> void WrapI_US64() { 737template<int func(u32, s64)> void WrapI_US64() {
diff --git a/src/core/hle/syscall.cpp b/src/core/hle/syscall.cpp
index df6412743..cc5b561b5 100644
--- a/src/core/hle/syscall.cpp
+++ b/src/core/hle/syscall.cpp
@@ -82,15 +82,30 @@ Result SendSyncRequest(Handle session) {
82/// Close a handle 82/// Close a handle
83Result CloseHandle(Handle handle) { 83Result CloseHandle(Handle handle) {
84 // ImplementMe 84 // ImplementMe
85 NOTICE_LOG(OSHLE, "stubbed function CloseHandle");
85 return 0; 86 return 0;
86} 87}
87 88
88/// Wait for a handle to synchronize, timeout after the specified nanoseconds 89/// Wait for a handle to synchronize, timeout after the specified nanoseconds
89Result WaitSynchronization1(Handle handle, s64 nanoseconds) { 90Result WaitSynchronization1(Handle handle, s64 nanoseconds) {
90 // ImplementMe 91 // ImplementMe
92 NOTICE_LOG(OSHLE, "stubbed function WaitSynchronization1");
91 return 0; 93 return 0;
92} 94}
93 95
96/// Create an address arbiter (to allocate access to shared resources)
97Result CreateAddressArbiter(void* arbiter) {
98 // ImplementMe
99 NOTICE_LOG(OSHLE, "stubbed function CreateAddressArbiter");
100 Core::g_app_core->SetReg(1, 0xDEADBEEF);
101 return 0;
102}
103
104/// Used to output a message on a debug hardware unit - does nothing on a retail unit
105void OutputDebugString(const char* string) {
106 NOTICE_LOG(OSHLE, "## OSDEBUG: %s", string);
107}
108
94const HLE::FunctionDef Syscall_Table[] = { 109const HLE::FunctionDef Syscall_Table[] = {
95 {0x00, NULL, "Unknown"}, 110 {0x00, NULL, "Unknown"},
96 {0x01, WrapI_UUUUU<ControlMemory>, "ControlMemory"}, 111 {0x01, WrapI_UUUUU<ControlMemory>, "ControlMemory"},
@@ -125,7 +140,7 @@ const HLE::FunctionDef Syscall_Table[] = {
125 {0x1E, NULL, "CreateMemoryBlock"}, 140 {0x1E, NULL, "CreateMemoryBlock"},
126 {0x1F, WrapI_UUUU<MapMemoryBlock>, "MapMemoryBlock"}, 141 {0x1F, WrapI_UUUU<MapMemoryBlock>, "MapMemoryBlock"},
127 {0x20, NULL, "UnmapMemoryBlock"}, 142 {0x20, NULL, "UnmapMemoryBlock"},
128 {0x21, NULL, "CreateAddressArbiter"}, 143 {0x21, WrapI_V<CreateAddressArbiter>, "CreateAddressArbiter"},
129 {0x22, NULL, "ArbitrateAddress"}, 144 {0x22, NULL, "ArbitrateAddress"},
130 {0x23, WrapI_U<CloseHandle>, "CloseHandle"}, 145 {0x23, WrapI_U<CloseHandle>, "CloseHandle"},
131 {0x24, WrapI_US64<WaitSynchronization1>, "WaitSynchronization1"}, 146 {0x24, WrapI_US64<WaitSynchronization1>, "WaitSynchronization1"},
@@ -153,7 +168,7 @@ const HLE::FunctionDef Syscall_Table[] = {
153 {0x3A, NULL, "GetResourceLimitCurrentValues"}, 168 {0x3A, NULL, "GetResourceLimitCurrentValues"},
154 {0x3B, NULL, "GetThreadContext"}, 169 {0x3B, NULL, "GetThreadContext"},
155 {0x3C, NULL, "Break"}, 170 {0x3C, NULL, "Break"},
156 {0x3D, NULL, "OutputDebugString"}, 171 {0x3D, WrapV_C<OutputDebugString>, "OutputDebugString"},
157 {0x3E, NULL, "ControlPerformanceCounter"}, 172 {0x3E, NULL, "ControlPerformanceCounter"},
158 {0x3F, NULL, "Unknown"}, 173 {0x3F, NULL, "Unknown"},
159 {0x40, NULL, "Unknown"}, 174 {0x40, NULL, "Unknown"},