[Scummvm-git-logs] scummvm master -> d35ae55810ad5f0ec303aaeb0a0660fdde7e8a5e
AndywinXp
noreply at scummvm.org
Thu Jul 10 16:54:51 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
d35ae55810 SCUMM: GFX: Set default palette at start-up
Commit: d35ae55810ad5f0ec303aaeb0a0660fdde7e8a5e
https://github.com/scummvm/scummvm/commit/d35ae55810ad5f0ec303aaeb0a0660fdde7e8a5e
Author: AndywinXp (andywinxp at gmail.com)
Date: 2025-07-10T18:54:26+02:00
Commit Message:
SCUMM: GFX: Set default palette at start-up
This not only fixes #15869:
"SCUMM: MI1: Message banner can be invisible if palette is all black"
...but also makes it so that other games match their behavior
with respect to DREAMM (e.g. try pressing SPACE very quickly
before the game has a chance to load the first game palette).
Welcome, boot-up LSD-colored pause banner :-)
Changed paths:
engines/scumm/palette.cpp
engines/scumm/scumm.cpp
engines/scumm/scumm.h
diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index 62cb4e8d296..f94c44410dc 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -55,7 +55,7 @@ uint16 ScummEngine::get16BitColor(uint8 r, uint8 g, uint8 b) {
return _outputPixelFormat.RGBToColor(r, g, b);
}
-void ScummEngine::resetPalette() {
+void ScummEngine::resetPalette(bool isBootUp) {
static const byte tableC64Palette[] = {
#if 1 // VICE-based palette. See bug #4576
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x7E, 0x35, 0x2B, 0x6E, 0xB7, 0xC1,
@@ -243,8 +243,11 @@ void ScummEngine::resetPalette() {
if ((_game.platform == Common::kPlatformAmiga) && _game.version == 4) {
// if rendermode is set to EGA we use the full palette from the resources
// else we initialize and then lock down the first 16 colors.
- if (_renderMode != Common::kRenderEGA)
+ if (_renderMode != Common::kRenderEGA) {
setPaletteFromTable(tableAmigaMIPalette, sizeof(tableAmigaMIPalette) / 3);
+ } else {
+ setPaletteFromTable(tableEGAPalette, sizeof(tableEGAPalette) / 3);
+ }
} else if (_renderMode == Common::kRenderEGA && _supportsEGADithering) {
setPaletteFromTable(tableEGAPalette, sizeof(tableEGAPalette) / 3);
_enableEGADithering = true;
@@ -259,7 +262,7 @@ void ScummEngine::resetPalette() {
if (_game.id == GID_INDY4 || _game.id == GID_MONKEY2)
_townsClearLayerFlag = 0;
#ifdef USE_RGB_COLOR
- else if (_game.id == GID_LOOM)
+ else if (_game.id == GID_LOOM || _game.id == GID_MONKEY) // Setting a default for MI1 as well!
towns_setTextPaletteFromPtr(tableTownsLoomPalette);
else if (_game.version == 3)
towns_setTextPaletteFromPtr(tableTownsV3Palette);
@@ -267,9 +270,21 @@ void ScummEngine::resetPalette() {
_townsScreen->toggleLayers(_townsActiveLayerFlags);
#endif // DISABLE_TOWNS_DUAL_LAYER_MODE
+ } else if (isBootUp && (_game.version >= 5 && _game.heversion == 0) &&
+ (_game.platform == Common::kPlatformDOS || _game.platform == Common::kPlatformUnknown) &&
+ _renderMode == Common::kRenderDefault) {
+ // VGA games at boot-up have at their disposal whatever mode 13h
+ // is offering at that moment: the default palette.
+ // We just need the first few colors, which are the same as the EGA colors.
+ // (See #15869: "SCUMM: MI1: Message banner can be invisible if palette is all black")
+ setPaletteFromTable(tableEGAPalette, sizeof(tableEGAPalette) / 3);
}
+
setDirtyColors(0, 255);
}
+
+ if (isBootUp)
+ updatePalette();
}
void ScummEngine::setPaletteFromTable(const byte *ptr, int numcolor, int index) {
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 16d7897d8fc..6799003225f 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1916,7 +1916,7 @@ void ScummEngine::resetScumm() {
for (i = 0; i < 256; i++)
_roomPalette[i] = i;
- resetPalette();
+ resetPalette(true);
if (_game.version == 1) {
} else if (_game.features & GF_16COLOR) {
for (i = 0; i < 16; i++)
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 35aae8f8fc9..0d280d8713a 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1366,7 +1366,7 @@ protected:
const byte *getPalettePtr(int palindex, int room);
void setPaletteFromTable(const byte *ptr, int numcolor, int firstIndex = 0);
- void resetPalette();
+ void resetPalette(bool isBootUp = false);
void setCurrentPalette(int pal);
void setRoomPalette(int pal, int room);
More information about the Scummvm-git-logs
mailing list