From d16a138ac79b4f87d677f2d82f48e9879dfca231 Mon Sep 17 00:00:00 2001 From: ripsaw8080 Date: Sun, 15 Jan 2017 16:01:34 +0000 Subject: [PATCH] Use default attribute behavior of ANSI.SYS in the console device. Fixes scrolling issues. Anything that wants non-ANSI behavior may not display as intended with the internal DOS, same as real DOS when ANSI.SYS is loaded. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4005 --- src/dos/dev_con.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/dos/dev_con.h b/src/dos/dev_con.h index 3cf0cb13..10fb6747 100644 --- a/src/dos/dev_con.h +++ b/src/dos/dev_con.h @@ -132,8 +132,7 @@ bool device_CON::Write(Bit8u * data,Bit16u * size) { /* expand tab if not direct output */ page = real_readb(BIOSMEM_SEG,BIOSMEM_CURRENT_PAGE); do { - if(ansi.enabled) INT10_TeletypeOutputAttr(' ',ansi.attr,true); - else INT10_TeletypeOutput(' ',7); + INT10_TeletypeOutputAttr(' ',ansi.enabled?ansi.attr:7,true); col=CURSOR_POS_COL(page); } while(col%8); lastwrite = data[count++]; @@ -141,12 +140,10 @@ bool device_CON::Write(Bit8u * data,Bit16u * size) { } 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')) { - if(ansi.enabled) INT10_TeletypeOutputAttr('\r',ansi.attr,true); - else INT10_TeletypeOutput('\r',7); + INT10_TeletypeOutputAttr('\r',ansi.enabled?ansi.attr:7,true); } /* use ansi attribute if ansi is enabled, otherwise use DOS default attribute*/ - if(ansi.enabled) INT10_TeletypeOutputAttr(data[count],ansi.attr,true); - else INT10_TeletypeOutput(data[count],7); + INT10_TeletypeOutputAttr(data[count],ansi.enabled?ansi.attr:7,true); lastwrite = data[count++]; continue; }