From 31d7e74eacd4957cf6e6c63804d94b572dc0943c Mon Sep 17 00:00:00 2001 From: ripsaw8080 Date: Tue, 12 Jun 2018 20:04:10 +0000 Subject: [PATCH] It is more compatible with DOS to not insert carriage returns in the console device. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4114 --- src/dos/dev_con.h | 8 ++------ src/shell/shell_misc.cpp | 2 ++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/dos/dev_con.h b/src/dos/dev_con.h index ce31eca2..c18b84cb 100644 --- a/src/dos/dev_con.h +++ b/src/dos/dev_con.h @@ -37,7 +37,6 @@ private: void ClearAnsi(void); void Output(Bit8u chr); Bit8u readcache; - Bit8u lastwrite; struct ansi { /* should create a constructor, which would fill them with the appropriate values */ bool esc; bool sci; @@ -136,13 +135,11 @@ bool device_CON::Write(Bit8u * data,Bit16u * size) { Output(' '); col=CURSOR_POS_COL(page); } while(col%8); - lastwrite = data[count++]; + count++; continue; } else { - /* Some sort of "hack" now that '\n' doesn't set col to 0 (int10_char.cpp old chessgame) */ - if((data[count] == '\n') && (lastwrite != '\r')) Output('\r'); Output(data[count]); - lastwrite = data[count++]; + count++; continue; } } @@ -411,7 +408,6 @@ Bit16u device_CON::GetInformation(void) { device_CON::device_CON() { SetName("CON"); readcache=0; - lastwrite=0; ansi.enabled=false; ansi.attr=0x7; ansi.saverow=0; diff --git a/src/shell/shell_misc.cpp b/src/shell/shell_misc.cpp index dd441bbf..99f44865 100644 --- a/src/shell/shell_misc.cpp +++ b/src/shell/shell_misc.cpp @@ -223,6 +223,7 @@ void DOS_Shell::InputCommand(char * line) { /* Don't care */ break; case 0x0d: /* Return */ + outc('\r'); outc('\n'); size=0; //Kill the while loop break; @@ -322,6 +323,7 @@ void DOS_Shell::InputCommand(char * line) { case 0x1b: /* ESC */ //write a backslash and return to the next line outc('\\'); + outc('\r'); outc('\n'); *line = 0; // reset the line. if (l_completion.size()) l_completion.clear(); //reset the completion list.