diff options
author | Walter van Niftrik | 2011-03-04 21:08:42 +0100 |
---|---|---|
committer | Walter van Niftrik | 2011-03-04 21:12:00 +0100 |
commit | 39902452a2d659ac6eddde2febdfddbebd7c771d (patch) | |
tree | 99ef0dc089008e54cb5604cac0df8369439b6650 /engines | |
parent | f96e93047a6407eeb5c9e59825e55648f74c6a3d (diff) | |
download | scummvm-rg350-39902452a2d659ac6eddde2febdfddbebd7c771d.tar.gz scummvm-rg350-39902452a2d659ac6eddde2febdfddbebd7c771d.tar.bz2 scummvm-rg350-39902452a2d659ac6eddde2febdfddbebd7c771d.zip |
SCI: Fix reg_t ASCII printing in debugger for BE.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/console.cpp | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index f3c365782a..de0cfe20d8 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -3767,11 +3767,16 @@ int Console::printObject(reg_t pos) { return 0; } +static void printChar(byte c) { + if (c < 32 || c >= 127) + c = '.'; + debugN("%c", c); +} + void Console::hexDumpReg(const reg_t *data, int len, int regsPerLine, int startOffset, bool isArray) { // reg_t version of Common::hexdump assert(1 <= regsPerLine && regsPerLine <= 8); int i; - byte c; int offset = startOffset; while (len >= regsPerLine) { debugN("%06x: ", offset); @@ -3780,14 +3785,13 @@ void Console::hexDumpReg(const reg_t *data, int len, int regsPerLine, int startO } debugN(" |"); for (i = 0; i < regsPerLine; i++) { - c = data[i].toUint16() & 0xff; - if (c < 32 || c >= 127) - c = '.'; - debugN("%c", c); - c = data[i].toUint16() >> 8; - if (c < 32 || c >= 127) - c = '.'; - debugN("%c", c); + if (g_sci->isBE()) { + printChar(data[i].toUint16() >> 8); + printChar(data[i].toUint16() & 0xff); + } else { + printChar(data[i].toUint16() & 0xff); + printChar(data[i].toUint16() >> 8); + } } debugN("|\n"); data += regsPerLine; @@ -3807,14 +3811,13 @@ void Console::hexDumpReg(const reg_t *data, int len, int regsPerLine, int startO } debugN(" |"); for (i = 0; i < len; i++) { - c = data[i].toUint16() & 0xff; - if (c < 32 || c >= 127) - c = '.'; - debugN("%c", c); - c = data[i].toUint16() >> 8; - if (c < 32 || c >= 127) - c = '.'; - debugN("%c", c); + if (g_sci->isBE()) { + printChar(data[i].toUint16() >> 8); + printChar(data[i].toUint16() & 0xff); + } else { + printChar(data[i].toUint16() & 0xff); + printChar(data[i].toUint16() >> 8); + } } for (; i < regsPerLine; i++) debugN(" "); |