mirror of
https://github.com/libretro/pcsx2.git
synced 2024-12-24 18:56:39 +00:00
IOP: PSX bios console output filtering of repeated and empty lines.
This commit is contained in:
parent
a283e95fed
commit
809684e9de
@ -18,6 +18,10 @@
|
||||
|
||||
static std::string psxout_buf;
|
||||
|
||||
// This filtering should almost certainly be done in the console classes instead
|
||||
static std::string psxout_last;
|
||||
static unsigned psxout_repeat;
|
||||
|
||||
static void flush_stdout(bool closing = false)
|
||||
{
|
||||
size_t linelen;
|
||||
@ -29,9 +33,24 @@ static void flush_stdout(bool closing = false)
|
||||
return;
|
||||
} else
|
||||
psxout_buf[linelen++] = '\n';
|
||||
iopConLog(ShiftJIS_ConvertString(psxout_buf.c_str(), linelen));
|
||||
if (linelen != 1) {
|
||||
if (!psxout_buf.compare(0, linelen, psxout_last))
|
||||
psxout_repeat++;
|
||||
else {
|
||||
if (psxout_repeat) {
|
||||
iopConLog(wxString::Format(L"[%u more]\n", psxout_repeat));
|
||||
psxout_repeat = 0;
|
||||
}
|
||||
psxout_last = psxout_buf.substr(0, linelen);
|
||||
iopConLog(ShiftJIS_ConvertString(psxout_last.data()));
|
||||
}
|
||||
}
|
||||
psxout_buf.erase(0, linelen);
|
||||
}
|
||||
if (closing && psxout_repeat) {
|
||||
iopConLog(wxString::Format(L"[%u more]\n", psxout_repeat));
|
||||
psxout_repeat = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void psxBiosReset()
|
||||
|
Loading…
Reference in New Issue
Block a user