HLE massacre!
This commit is contained in:
parent
6b4c5c4685
commit
bd27982901
|
@ -63,6 +63,15 @@ static const SPatch OSPatches[] =
|
||||||
{ "OSPanic", HLE_OS::HLE_OSPanic },
|
{ "OSPanic", HLE_OS::HLE_OSPanic },
|
||||||
{ "vprintf", HLE_OS::HLE_GeneralDebugPrint },
|
{ "vprintf", HLE_OS::HLE_GeneralDebugPrint },
|
||||||
{ "printf", HLE_OS::HLE_GeneralDebugPrint },
|
{ "printf", HLE_OS::HLE_GeneralDebugPrint },
|
||||||
|
{ "printf1", HLE_OS::HLE_GeneralDebugPrintWithInt },
|
||||||
|
{ "printf2", HLE_OS::HLE_GeneralDebugPrint },
|
||||||
|
{ "printf3", HLE_OS::HLE_GeneralDebugPrint },
|
||||||
|
{ "printf4", HLE_OS::HLE_GeneralDebugPrint },
|
||||||
|
{ "printf5", HLE_OS::HLE_GeneralDebugPrint },
|
||||||
|
{ "printf6", HLE_OS::HLE_GeneralDebugPrint },
|
||||||
|
{ "printf7", HLE_OS::HLE_GeneralDebugPrint },
|
||||||
|
{ "printf8", HLE_OS::HLE_GeneralDebugPrint },
|
||||||
|
{ "printf9", HLE_OS::HLE_GeneralDebugPrint },
|
||||||
{ "puts", HLE_OS::HLE_GeneralDebugPrint }, // gcc-optimized printf?
|
{ "puts", HLE_OS::HLE_GeneralDebugPrint }, // gcc-optimized printf?
|
||||||
{ "___blank(char *,...)", HLE_OS::HLE_GeneralDebugPrint }, // used for early init things (normally)
|
{ "___blank(char *,...)", HLE_OS::HLE_GeneralDebugPrint }, // used for early init things (normally)
|
||||||
{ "___blank", HLE_OS::HLE_GeneralDebugPrint },
|
{ "___blank", HLE_OS::HLE_GeneralDebugPrint },
|
||||||
|
|
|
@ -45,7 +45,22 @@ void HLE_OSPanic()
|
||||||
void HLE_GeneralDebugPrint()
|
void HLE_GeneralDebugPrint()
|
||||||
{
|
{
|
||||||
std::string ReportMessage;
|
std::string ReportMessage;
|
||||||
|
if(*(u32*)Memory::GetPointer(GPR(3)) > 0x80000000){
|
||||||
|
GetStringVA(ReportMessage, 4);
|
||||||
|
}else{
|
||||||
GetStringVA(ReportMessage);
|
GetStringVA(ReportMessage);
|
||||||
|
}
|
||||||
|
NPC = LR;
|
||||||
|
|
||||||
|
//PanicAlert("(%08x->%08x) %s", LR, PC, ReportMessage.c_str());
|
||||||
|
NOTICE_LOG(OSREPORT, "%08x->%08x| %s", LR, PC, ReportMessage.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generalized func for just printing string pointed to by r3.
|
||||||
|
void HLE_GeneralDebugPrintWithInt()
|
||||||
|
{
|
||||||
|
std::string ReportMessage;
|
||||||
|
GetStringVA(ReportMessage, 5);
|
||||||
NPC = LR;
|
NPC = LR;
|
||||||
|
|
||||||
//PanicAlert("(%08x->%08x) %s", LR, PC, ReportMessage.c_str());
|
//PanicAlert("(%08x->%08x) %s", LR, PC, ReportMessage.c_str());
|
||||||
|
@ -67,7 +82,7 @@ void GetStringVA(std::string& _rOutBuffer, u32 strReg)
|
||||||
{
|
{
|
||||||
_rOutBuffer = "";
|
_rOutBuffer = "";
|
||||||
char ArgumentBuffer[256];
|
char ArgumentBuffer[256];
|
||||||
u32 ParameterCounter = 4;
|
u32 ParameterCounter = strReg+1;
|
||||||
u32 FloatingParameterCounter = 1;
|
u32 FloatingParameterCounter = 1;
|
||||||
char *pString = (char*)Memory::GetPointer(GPR(strReg));
|
char *pString = (char*)Memory::GetPointer(GPR(strReg));
|
||||||
if (!pString)
|
if (!pString)
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
namespace HLE_OS
|
namespace HLE_OS
|
||||||
{
|
{
|
||||||
void HLE_GeneralDebugPrint();
|
void HLE_GeneralDebugPrint();
|
||||||
|
void HLE_GeneralDebugPrintWithInt();
|
||||||
void HLE_write_console();
|
void HLE_write_console();
|
||||||
void HLE_OSPanic();
|
void HLE_OSPanic();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue