From 4ee72869cce3625f25fb516a8980460510df6041 Mon Sep 17 00:00:00 2001 From: bunnei Date: Thu, 1 May 2014 18:50:36 -0400 Subject: - added some function wrappers for HLE - added stub for SVC CreateAddressArbiter - added OutputDebugString SVC --- src/core/hle/function_wrappers.h | 20 ++++++++++++-------- src/core/hle/syscall.cpp | 19 +++++++++++++++++-- 2 files changed, 29 insertions(+), 10 deletions(-) (limited to 'src/core') 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 void WrapI_UUUUU() { RETURN(retval); } -template void WrapI_V() { - int retval = func(); +template void WrapI_V() { + u32 retval = func(Memory::GetPointer(PARAM(0))); RETURN(retval); } @@ -638,6 +638,10 @@ template void WrapU_CC() { RETURN(retval); } +template void WrapV_C() { + func(Memory::GetCharPointer(PARAM(0))); +} + template void WrapV_CI() { func(Memory::GetCharPointer(PARAM(0)), PARAM(1)); } @@ -716,18 +720,18 @@ template void WrapI_ICI() { } template void WrapI_IVVVVUI(){ - 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) ); - RETURN(retval); + 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) ); + RETURN(retval); } template void WrapI_ICUVIII(){ - u32 retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), Memory::GetPointer(PARAM(3)), PARAM(4), PARAM(5), PARAM(6)); - RETURN(retval); + u32 retval = func(PARAM(0), Memory::GetCharPointer(PARAM(1)), PARAM(2), Memory::GetPointer(PARAM(3)), PARAM(4), PARAM(5), PARAM(6)); + RETURN(retval); } template void WrapI_VUUUUU(){ - u32 retval = func(Memory::GetPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5)); - RETURN(retval); + u32 retval = func(Memory::GetPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3), PARAM(4), PARAM(5)); + RETURN(retval); } template 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) { /// Close a handle Result CloseHandle(Handle handle) { // ImplementMe + NOTICE_LOG(OSHLE, "stubbed function CloseHandle"); return 0; } /// Wait for a handle to synchronize, timeout after the specified nanoseconds Result WaitSynchronization1(Handle handle, s64 nanoseconds) { // ImplementMe + NOTICE_LOG(OSHLE, "stubbed function WaitSynchronization1"); return 0; } +/// Create an address arbiter (to allocate access to shared resources) +Result CreateAddressArbiter(void* arbiter) { + // ImplementMe + NOTICE_LOG(OSHLE, "stubbed function CreateAddressArbiter"); + Core::g_app_core->SetReg(1, 0xDEADBEEF); + return 0; +} + +/// Used to output a message on a debug hardware unit - does nothing on a retail unit +void OutputDebugString(const char* string) { + NOTICE_LOG(OSHLE, "## OSDEBUG: %s", string); +} + const HLE::FunctionDef Syscall_Table[] = { {0x00, NULL, "Unknown"}, {0x01, WrapI_UUUUU, "ControlMemory"}, @@ -125,7 +140,7 @@ const HLE::FunctionDef Syscall_Table[] = { {0x1E, NULL, "CreateMemoryBlock"}, {0x1F, WrapI_UUUU, "MapMemoryBlock"}, {0x20, NULL, "UnmapMemoryBlock"}, - {0x21, NULL, "CreateAddressArbiter"}, + {0x21, WrapI_V, "CreateAddressArbiter"}, {0x22, NULL, "ArbitrateAddress"}, {0x23, WrapI_U, "CloseHandle"}, {0x24, WrapI_US64, "WaitSynchronization1"}, @@ -153,7 +168,7 @@ const HLE::FunctionDef Syscall_Table[] = { {0x3A, NULL, "GetResourceLimitCurrentValues"}, {0x3B, NULL, "GetThreadContext"}, {0x3C, NULL, "Break"}, - {0x3D, NULL, "OutputDebugString"}, + {0x3D, WrapV_C, "OutputDebugString"}, {0x3E, NULL, "ControlPerformanceCounter"}, {0x3F, NULL, "Unknown"}, {0x40, NULL, "Unknown"}, -- cgit v1.2.3