Before:
Code:
void sceKernelPrintf()
{
const char *formatString = Memory::GetCharPointer(PARAM(0));
ERROR_LOG(HLE,"UNIMPL sceKernelPrintf(%08x, %08x, %08x, %08x)", PARAM(0),PARAM(1),PARAM(2),PARAM(3));
ERROR_LOG(HLE,"%s", formatString);
RETURN(0);
}
After:
Code:
void sceKernelPrintf()
{
const char *formatString = Memory::GetCharPointer(PARAM(0));
DEBUG_LOG(HLE,"IMPL sceKernelPrintf(%08x, %08x, %08x, %08x)", PARAM(0),PARAM(1),PARAM(2),PARAM(3));
if(!Memory::IsValidAddress(PARAM(2)) {
DEBUG_LOG(HLE,formatString, &Memory::GetStruct(PARAM(1)));
} else {
if(!Memory::IsValidAddress(PARAM(3)) {
DEBUG_LOG(HLE,formatString, &Memory::GetStruct(PARAM(1)), &Memory::GetStruct(PARAM(2)));
} else {
DEBUG_LOG(HLE,formatString, &Memory::GetStruct(PARAM(1)), &Memory::GetStruct(PARAM(2)),
&Memory::GetStruct(PARAM(3)));
}
}
RETURN(0);
}