diff --git a/Source/Core/Core/Src/HLE/HLE.cpp b/Source/Core/Core/Src/HLE/HLE.cpp index c74126dccc..474b24944c 100644 --- a/Source/Core/Core/Src/HLE/HLE.cpp +++ b/Source/Core/Core/Src/HLE/HLE.cpp @@ -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 }, diff --git a/Source/Core/Core/Src/HLE/HLE_OS.cpp b/Source/Core/Core/Src/HLE/HLE_OS.cpp index bb8bb795c2..277453522f 100644 --- a/Source/Core/Core/Src/HLE/HLE_OS.cpp +++ b/Source/Core/Core/Src/HLE/HLE_OS.cpp @@ -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() { diff --git a/Source/Core/Core/Src/HLE/HLE_OS.h b/Source/Core/Core/Src/HLE/HLE_OS.h index c91c9e121f..338abd2989 100644 --- a/Source/Core/Core/Src/HLE/HLE_OS.h +++ b/Source/Core/Core/Src/HLE/HLE_OS.h @@ -26,6 +26,7 @@ namespace HLE_OS void HLE_GeneralDebugPrintWithInt(); void HLE_write_console(); void HLE_OSPanic(); + void HLE_VPrintf(); } #endif