The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (Linux)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fix for sceKernelPrintf() function
05-01-2013, 02:35 AM
Post: #1
Fix for sceKernelPrintf() function
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);
}
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Fix for sceKernelPrintf() function - Denizen - 05-01-2013 02:35 AM

Forum Jump: