SCUMM: (MI1/Amiga/Hercules/CGA) - fix bug 4535 (Voodoo lady palette glitches)

MI1 Amiga does set up the shadow palette at the beginning
and also updates it from o5_roomOps()[SO_ROOM_PALETTE].
But it never actually applies any use of the shadow palette when
doing screen palette adjustments. I've also confirmed that the
shadow is ignored in DOS CGA and Hercules mode.
This commit is contained in:
athrxx 2024-04-14 15:06:50 +02:00
parent 0d2aa5501f
commit ac23a92e30
3 changed files with 11 additions and 5 deletions

View File

@ -1630,11 +1630,7 @@ void ScummEngine::updatePalette() {
for (i = _palDirtyMin; i <= _palDirtyMax; i++) {
byte *data;
// In b/w Mac rendering mode, the shadow palette is
// handled by the renderer itself. See comment in
// mac_drawStripToScreen().
if (_game.features & GF_SMALL_HEADER && _game.version > 2 && _renderMode != Common::kRenderMacintoshBW)
if (_shadowPalRemap)
data = _currentPalette + _shadowPalette[i] * 3;
else
data = _currentPalette + i * 3;

View File

@ -520,6 +520,10 @@ ScummEngine_v4::ScummEngine_v4(OSystem *syst, const DetectorResult &dr)
: ScummEngine_v5(syst, dr) {
_resourceHeaderSize = 6;
_game.features |= GF_SMALL_HEADER;
// MI1 Amiga ignores the shadow palette (bug #4535 - Voodoo lady palette glitches).
// I haven't checked other Amiga targets, so I'm limiting it to MI1.
_shadowPalRemap = (!(_game.platform == Common::kPlatformAmiga && _game.id == GID_MONKEY_VGA) &&
_renderMode != Common::kRenderCGA && _renderMode != Common::kRenderHercA && _renderMode != Common::kRenderHercG);
}
ScummEngine_v3::ScummEngine_v3(OSystem *syst, const DetectorResult &dr)
@ -527,6 +531,10 @@ ScummEngine_v3::ScummEngine_v3(OSystem *syst, const DetectorResult &dr)
// All v3 and older games only used 16 colors with exception of the GF_OLD256 games.
if (!(_game.features & GF_OLD256))
_game.features |= GF_16COLOR;
// In b/w Mac rendering mode, the shadow palette is handled by the renderer itself.
// See comment in mac_drawStripToScreen().
_shadowPalRemap = (_renderMode != Common::kRenderMacintoshBW &&
_renderMode != Common::kRenderCGA && _renderMode != Common::kRenderHercA && _renderMode != Common::kRenderHercG);
}
ScummEngine_v3old::ScummEngine_v3old(OSystem *syst, const DetectorResult &dr)
@ -538,6 +546,7 @@ ScummEngine_v3old::ScummEngine_v3old(OSystem *syst, const DetectorResult &dr)
ScummEngine_v2::ScummEngine_v2(OSystem *syst, const DetectorResult &dr)
: ScummEngine_v3old(syst, dr) {
_shadowPalRemap = false;
_inventoryOffset = 0;
_flashlight.xStrips = 6;
_flashlight.yStrips = 4;

View File

@ -1521,6 +1521,7 @@ protected:
int _saveSound = 0;
bool _native_mt32 = false;
bool _copyProtection = false;
bool _shadowPalRemap = false;
// Indy4 Amiga specific
uint16 _amigaFirstUsedColor = 0;