little fix to __write_console logging, the char* is in r4, not r3, heh

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4466 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman
2009-10-25 03:26:39 +00:00
parent 227d363881
commit 04a0e630db
3 changed files with 16 additions and 4 deletions

View File

@ -64,7 +64,7 @@ static const SPatch OSPatches[] =
{ "printf", HLE_OS::HLE_GeneralDebugPrint }, { "printf", 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 }, // dunno, but awesome :D { "___blank(char *,...)", HLE_OS::HLE_GeneralDebugPrint }, // dunno, but awesome :D
{ "__write_console", HLE_OS::HLE_GeneralDebugPrint }, // used by sysmenu (+more?) { "__write_console", HLE_OS::HLE_write_console }, // used by sysmenu (+more?)
// wii only // wii only
{ "__OSInitAudioSystem", HLE_Misc::UnimplementedFunction }, { "__OSInitAudioSystem", HLE_Misc::UnimplementedFunction },

View File

@ -27,7 +27,7 @@
namespace HLE_OS namespace HLE_OS
{ {
void GetStringVA(std::string& _rOutBuffer); void GetStringVA(std::string& _rOutBuffer, u32 strReg = 3);
void HLE_OSPanic() void HLE_OSPanic()
{ {
@ -51,13 +51,24 @@ void HLE_GeneralDebugPrint()
NOTICE_LOG(OSREPORT, "%08x->%08x| %s", LR, PC, ReportMessage.c_str()); NOTICE_LOG(OSREPORT, "%08x->%08x| %s", LR, PC, ReportMessage.c_str());
} }
void GetStringVA(std::string& _rOutBuffer) // __write_console is slightly abnormal
void HLE_write_console()
{
std::string ReportMessage;
GetStringVA(ReportMessage, 4);
NPC = LR;
//PanicAlert("(%08x->%08x) %s", LR, PC, ReportMessage.c_str());
NOTICE_LOG(OSREPORT, "%08x->%08x| %s", LR, PC, ReportMessage.c_str());
}
void GetStringVA(std::string& _rOutBuffer, u32 strReg)
{ {
_rOutBuffer = ""; _rOutBuffer = "";
char ArgumentBuffer[256]; char ArgumentBuffer[256];
u32 ParameterCounter = 4; u32 ParameterCounter = 4;
u32 FloatingParameterCounter = 1; u32 FloatingParameterCounter = 1;
char* pString = (char*)Memory::GetPointer(GPR(3)); char* pString = (char*)Memory::GetPointer(GPR(strReg));
if (!pString) { if (!pString) {
//PanicAlert("Invalid GetStringVA call"); //PanicAlert("Invalid GetStringVA call");
return; return;

View File

@ -23,6 +23,7 @@
namespace HLE_OS namespace HLE_OS
{ {
void HLE_GeneralDebugPrint(); void HLE_GeneralDebugPrint();
void HLE_write_console();
void HLE_OSPanic(); void HLE_OSPanic();
} }