From d488212f7d659999ecd379b03523b13a3202969e Mon Sep 17 00:00:00 2001 From: Donovan Watteau Date: Mon, 12 Sep 2022 17:00:04 +0200 Subject: [PATCH] SCUMM: Fix an original palette issue at Stan's in MONKEY1-CD (WORKAROUND) In the versions of Monkey Island 1 with the full 256-color inventory, going at Stan's (when he's not there) will mess up the color of some objects, such as the "striking yellow color" of the flower from the forest suddenly being greenish in this room. The VGA floppy release doesn't appear to have this issue, so this is probably another oversight from the v5 release. The setPalColor() calls are taken from the Ultimate Talkie Edition. This fix is not applied to the FM-TOWNS and Sega CD releases, since they use a smaller palette (and I don't have them). --- engines/scumm/script_v5.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index 268dedb6b96..bdac168d8c9 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -642,6 +642,27 @@ void ScummEngine_v5::o5_setClass() { while ((_opcode = fetchScriptByte()) != 0xFF) { cls = getVarOrDirectWord(PARAM_1); + // WORKAROUND: In the CD versions of Monkey 1 with the full 256-color + // inventory, going at Stan's messes up the color of some objects, such + // as the "striking yellow color" of the flower from the forest, the + // rubber chicken, or Guybrush's trousers. The following palette fixes + // are taken from the Ultimate Talkie Edition. + if (_game.id == GID_MONKEY && _game.platform != Common::kPlatformFMTowns && + _game.platform != Common::kPlatformSegaCD && _roomResource == 59 && + vm.slot[_currentScript].number == 10002 && obj == 915 && cls == 6 && + _currentPalette[251 * 3] == 0 && _enableEnhancements && + strcmp(_game.variant, "SE Talkie") != 0) { + // True as long as Guybrush isn't done with the voodoo recipe on the + // Sea Monkey. The Ultimate Talkie Edition probably does this as a way + // to limit this palette override to Part One; just copy this behavior. + if (_scummVars[260] < 8) { + setPalColor(245, 68, 68, 68); // gray + setPalColor(247, 252, 244, 0); // yellow + setPalColor(249, 112, 212, 0); // lime + } + setPalColor(251, 32, 84, 0); // green + } + // WORKAROUND bug #3099: Due to a script bug, the wrong opcode is // used to test and set the state of various objects (e.g. the inside // door (object 465) of the of the Hostel on Mars), when opening the