From fadea64ebfe659fc13a4e2b2b5b44116c812639a Mon Sep 17 00:00:00 2001 From: The Dax Date: Tue, 4 Jun 2013 01:53:32 -0400 Subject: [PATCH] Fix sceNetEtherNtostr. --- Core/HLE/FunctionWrappers.h | 4 ---- Core/HLE/sceNet.cpp | 7 +++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Core/HLE/FunctionWrappers.h b/Core/HLE/FunctionWrappers.h index 6ac01e8f81..5952f68d55 100644 --- a/Core/HLE/FunctionWrappers.h +++ b/Core/HLE/FunctionWrappers.h @@ -489,10 +489,6 @@ template void WrapV_CUIU() { func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3)); } -template void WrapV_CU() { - func(Memory::GetCharPointer(PARAM(0)), PARAM(1)); -} - template void WrapI_CUIU() { int retval = func(Memory::GetCharPointer(PARAM(0)), PARAM(1), PARAM(2), PARAM(3)); RETURN(retval); diff --git a/Core/HLE/sceNet.cpp b/Core/HLE/sceNet.cpp index 9527b8d4a1..d3df74d981 100644 --- a/Core/HLE/sceNet.cpp +++ b/Core/HLE/sceNet.cpp @@ -160,11 +160,14 @@ int sceNetAdhocTerm() { return 0; } -void sceNetEtherNtostr(const char *mac, u32 bufferPtr) { +//homebrew SDK claims it's a void function, but tests seem to indicate otherwise +int sceNetEtherNtostr(const char *mac, u32 bufferPtr) { DEBUG_LOG(HLE, "UNTESTED sceNetEtherNtostr(%s, %x)", mac, bufferPtr); int len = strlen(mac); for (int i = 0; i < len; i++) Memory::Write_U8(mac[i], bufferPtr + i); + + return 0; } //write SCE_KERNEL_ERROR_ERRNO_NOT_CONNECTED to attempt to stop games from spamming wifi syscalls... @@ -215,7 +218,7 @@ const HLEFunction sceNet[] = { {0x39AF39A6, sceNetInit, "sceNetInit"}, {0x281928A9, WrapU_V, "sceNetTerm"}, - {0x89360950, WrapV_CU, "sceNetEtherNtostr"}, + {0x89360950, WrapI_CU, "sceNetEtherNtostr"}, {0x0bf0a3ae, 0, "sceNetGetLocalEtherAddr"}, {0xd27961c9, 0, "sceNetEtherStrton"}, {0x50647530, 0, "sceNetFreeThreadinfo"},