From 27469a1896f08c6d32df1778dc7e9cce28c2bec4 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 20 Feb 2005 00:17:22 +0000 Subject: Patch #1121337 (CGA rendering in early LEC titles). Differences against patch: o Updated documentation o Fixed text colors o Implemented Hercules dithering Ditherers are based on loom ega and monkey ega, so for zak and mm they're wrong, i.e. these games look better than with original ditherers. TODO: Proper ditherers for zak & MM EGA ditherers for VGA SCUMM v5 games svn-id: r16816 --- scumm/charset.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'scumm/charset.cpp') diff --git a/scumm/charset.cpp b/scumm/charset.cpp index 7b34acc7ab..818c1b16d4 100644 --- a/scumm/charset.cpp +++ b/scumm/charset.cpp @@ -1160,6 +1160,8 @@ void CharsetRendererV3::setColor(byte color) _color &= 0x7f; } else _dropShadow = false; + + translateColor(); } void CharsetRendererV3::printChar(int chr) { @@ -1253,6 +1255,21 @@ void CharsetRendererV3::drawChar(int chr, const Graphics::Surface &s, int x, int drawBits1(s, dst, charPtr, y, width, height); } +void CharsetRenderer::translateColor() { + // Based on disassembly + if (_vm->_renderMode == Common::kRenderCGA) { + static byte CGAtextColorMap[16] = {0, 3, 3, 3, 5, 5, 5, 15, + 15, 3, 3, 3, 5, 5, 15, 15}; + _color = CGAtextColorMap[_color & 0x0f]; + } + + if (_vm->_renderMode == Common::kRenderHerc) { + static byte HercTextColorMap[16] = {0, 15, 2, 15, 15, 5, 15, 15, + 8, 15, 15, 15, 15, 15, 15, 15}; + _color = HercTextColorMap[_color & 0x0f]; + } +} + void CharsetRendererClassic::printChar(int chr) { int width, height, origWidth, origHeight; @@ -1269,6 +1286,8 @@ void CharsetRendererClassic::printChar(int chr) { if (chr == '@') return; + translateColor(); + _vm->_charsetColorMap[1] = _color; int type = *_fontPtr; -- cgit v1.2.3