From 937dcdb1eedbbf44154201503f4b83787cfba557 Mon Sep 17 00:00:00 2001 From: ripsaw8080 Date: Wed, 13 May 2015 01:24:56 +0000 Subject: [PATCH] Use normal teletype function for non-ANSI output so the default attribute 7 applies only to graphics modes and existing attributes are not changed in text modes. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3912 --- src/dos/dev_con.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/dos/dev_con.h b/src/dos/dev_con.h index 372af3c8..ef397730 100644 --- a/src/dos/dev_con.h +++ b/src/dos/dev_con.h @@ -129,9 +129,13 @@ bool device_CON::Write(Bit8u * data,Bit16u * size) { 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')) INT10_TeletypeOutputAttr('\r',ansi.attr,ansi.enabled); + if((data[count] == '\n') && (lastwrite != '\r')) { + if(ansi.enabled) INT10_TeletypeOutputAttr('\r',ansi.attr,true); + else INT10_TeletypeOutput('\r',7); + } /* use ansi attribute if ansi is enabled, otherwise use DOS default attribute*/ - INT10_TeletypeOutputAttr(data[count],ansi.enabled?ansi.attr:7,true); + if(ansi.enabled) INT10_TeletypeOutputAttr(data[count],ansi.attr,true); + else INT10_TeletypeOutput(data[count],7); lastwrite = data[count++]; continue; }