From 313e7bdcc8cb27a48177145c11eb4a2be6db5171 Mon Sep 17 00:00:00 2001 From: tomcw Date: Wed, 27 Aug 2014 22:13:14 +0100 Subject: [PATCH] TSAVE: Remap control chars to printable ones --- source/Debugger/Debug.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/source/Debugger/Debug.cpp b/source/Debugger/Debug.cpp index f3a6b8dd..53191553 100644 --- a/source/Debugger/Debug.cpp +++ b/source/Debugger/Debug.cpp @@ -4691,6 +4691,16 @@ int g_nTextScreen = 0; 23 17 0001_0111 -> $7D0 0111 1101 0000 */ +static char RemapChar(const char c) +{ + if ( c < 0x20 ) + return c + '@'; // Remap INVERSE control character to NORMAL + else if ( c == 0x7F ) + return ' '; // Remap checkboard (DEL) to space + + return c; +} + size_t Util_GetTextScreen ( char* &pText_ ) { WORD nAddressStart = 0; @@ -4717,14 +4727,12 @@ size_t Util_GetTextScreen ( char* &pText_ ) if ( g_bVideoMode & VF_80COL ) { // AUX c = g_pTextBank1[ nAddressStart ] & 0x7F; - if ( c < 0x20 ) - c = ' '; // INVERSE control character + c = RemapChar(c); *pEnd++ = c; } // MAIN -- NOTE: intentional indent & outside if() ! c = g_pTextBank0[ nAddressStart ] & 0x7F; - if ( c < 0x20 ) - c = ' '; // INVERSE control character + c = RemapChar(c); *pEnd++ = c; nAddressStart++;