Debug vprintf!

This commit is contained in:
Matthew Parlane 2012-02-27 23:18:43 +13:00 committed by unknown
parent fea02b8dca
commit 57e3fbed91
3 changed files with 20 additions and 1 deletions

View File

@ -61,7 +61,7 @@ static const SPatch OSPatches[] =
{ "DEBUGPrint", HLE_OS::HLE_GeneralDebugPrint },
{ "WUD_DEBUGPrint", HLE_OS::HLE_GeneralDebugPrint },
{ "OSPanic", HLE_OS::HLE_OSPanic },
{ "vprintf", HLE_OS::HLE_GeneralDebugPrint },
{ "vprintf", HLE_OS::HLE_VPrintf },
{ "printf", HLE_OS::HLE_GeneralDebugPrint },
{ "printf1", HLE_OS::HLE_GeneralDebugPrintWithInt },
{ "printf2", HLE_OS::HLE_GeneralDebugPrint },

View File

@ -56,6 +56,24 @@ void HLE_GeneralDebugPrint()
NOTICE_LOG(OSREPORT, "%08x->%08x| %s", LR, PC, ReportMessage.c_str());
}
void HLE_VPrintf()
{
std::string ReportMessage;
u32 r4 = GPR(4);
u32 offset = Memory::Read_U32(r4+8);
u32 check = Memory::Read_U32(r4);
//NOTICE_LOG(OSREPORT, "Offset: %08X, Check %08X", offset, check);
for(int i = 4; i<= 10; i++){
GPR(i) = Memory::Read_U32(offset+(i-(check == 0x01000000? 3 : 2))*4);
//NOTICE_LOG(OSREPORT, "r%d: %08X",i, GPR(i));
}
GetStringVA(ReportMessage);
NPC = LR;
NOTICE_LOG(OSREPORT, "%08x->%08x| %s", LR, PC, ReportMessage.c_str());
}
// Generalized func for just printing string pointed to by r3.
void HLE_GeneralDebugPrintWithInt()
{

View File

@ -26,6 +26,7 @@ namespace HLE_OS
void HLE_GeneralDebugPrintWithInt();
void HLE_write_console();
void HLE_OSPanic();
void HLE_VPrintf();
}
#endif