From 4248e22cbfc54c36dcc17f4d3912a5fb30a5dbc2 Mon Sep 17 00:00:00 2001 From: athrxx Date: Wed, 3 Aug 2022 16:57:48 +0200 Subject: [PATCH] SCUMM: (MI1/FM-TOWNS) - fix bug no. 13735 ("Inaccurate verb rendering in Monkey 1 FM-TOWNS)" Actually, this is rather an emulation of an original bug than a fix... I have also included a fix in the charset renderer that I noticed, but I don't think that one actually matters anywhere. I haven't added a fix for exisiting saves. It would require another version bump and it is really not important enough. --- engines/scumm/charset.cpp | 2 +- engines/scumm/script_v5.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp index 73685802489..fa800169114 100644 --- a/engines/scumm/charset.cpp +++ b/engines/scumm/charset.cpp @@ -2365,7 +2365,7 @@ void CharsetRendererTownsClassic::processCharsetColors() { if (c > 16) { uint8 t = (_vm->_currentPalette[c * 3] < 32) ? 4 : 12; t |= ((_vm->_currentPalette[c * 3 + 1] < 32) ? 2 : 10); - t |= ((_vm->_currentPalette[c * 3 + 1] < 32) ? 1 : 9); + t |= ((_vm->_currentPalette[c * 3 + 2] < 32) ? 1 : 9); c = t; } diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index f8d9dd30914..07e3c11416f 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -783,7 +783,7 @@ void ScummEngine_v5::o5_chainScript() { void ScummEngine_v5::o5_cursorCommand() { int i, j, k; - int table[NUM_SCRIPT_LOCAL]; + int table[32]; switch ((_opcode = fetchScriptByte()) & 0x1F) { case 1: // SO_CURSOR_ON _cursor.state = 1; @@ -843,8 +843,15 @@ void ScummEngine_v5::o5_cursorCommand() { // games if needed. } else { getWordVararg(table); + // MI1 FM-Towns has a bug in the original interpreter which removes the shadow color from the verbs. + // getWordVararg() will generate a WORD table, but then - right here - it is accessed like a DWORD + // table. This is actually fixed in the original interpreters for MI2 and INDY4. It could be argued + // if we even want that "fixed", but it does lead to bug tickets (#13735 - "Inaccurate verb rendering + // in Monkey 1 FM-TOWNS") and the "fix" restores the original appearance (which - as per usual - is + // a matter of personal taste...) + int m = (_game.platform == Common::kPlatformFMTowns && _game.id == GID_MONKEY) ? 2 : 1; for (i = 0; i < 16; i++) - _charsetColorMap[i] = _charsetData[_string[1]._default.charset][i] = (unsigned char)table[i]; + _charsetColorMap[i] = _charsetData[_string[1]._default.charset][i] = (unsigned char)table[i * m]; } break; default: