diff --git a/pcsx2/HwWrite.cpp b/pcsx2/HwWrite.cpp index fa5fbdd4ff..fc978a6f67 100644 --- a/pcsx2/HwWrite.cpp +++ b/pcsx2/HwWrite.cpp @@ -168,16 +168,24 @@ void hwWrite8(u32 mem, u8 value) { case RCNT3_TARGET: rcntWtarget(3, value); break; case 0x1000f180: - if (value == '\n') { + { + bool flush = false; + + // Terminate lines on CR or full buffers, and ignore \n's if the string contents + // are empty (otherwise terminate on \n too!) + if( ( value == '\r' ) || ( sio_count == 1023 ) || + ( value == '\n' && sio_count != 0 ) ) + { sio_buffer[sio_count] = 0; Console::WriteLn( Color_Cyan, sio_buffer ); sio_count = 0; - } else { - if (sio_count < 1023) { - sio_buffer[sio_count++] = value; - } } - break; + else if( value != '\n' ) + { + sio_buffer[sio_count++] = value; + } + } + break; //case 0x10003c02: //Tony Hawks Project 8 uses this // vif1Write32(mem & ~0x2, value << 16); diff --git a/pcsx2/IopHw.cpp b/pcsx2/IopHw.cpp index e23294911c..cf50b84ac1 100644 --- a/pcsx2/IopHw.cpp +++ b/pcsx2/IopHw.cpp @@ -666,14 +666,24 @@ void psxHwWrite8(u32 add, u8 value) { case 0x1f801803: cdrWrite3(value); break; case 0x1f80380c: - if (value == '\r') break; - if (value == '\n' || g_pbufi >= 1023) { // A line break, or the buffer is about to overflow. - g_pbuf[g_pbufi++] = 0; - g_pbufi = 0; + { + bool flush = false; + + // Terminate lines on CR or full buffers, and ignore \n's if the string contents + // are empty (otherwise terminate on \n too!) + if( ( value == '\r' ) || ( g_pbufi == 1023 ) || + ( value == '\n' && g_pbufi != 0 ) ) + { + g_pbuf[g_pbufi] = 0; DevCon::WriteLn( Color_Cyan, g_pbuf ); + g_pbufi = 0; + } + else if( value != '\n' ) + { + g_pbuf[g_pbufi++] = value; } - else g_pbuf[g_pbufi++] = value; psxHu8(add) = value; + } return; case 0x1F808260: diff --git a/pcsx2/windows/WinConsole.cpp b/pcsx2/windows/WinConsole.cpp index c587ff1a4c..8774737650 100644 --- a/pcsx2/windows/WinConsole.cpp +++ b/pcsx2/windows/WinConsole.cpp @@ -95,7 +95,7 @@ namespace Console if (emuLog != NULL) { - fputs("", emuLog); + fputs("\n", emuLog); fflush( emuLog ); } @@ -114,7 +114,7 @@ namespace Console // No flushing here -- only flush after newlines. if (emuLog != NULL) - fprintf( emuLog, fmt ); + fputs( fmt, emuLog ); return false; }