[Scummvm-git-logs] scummvm master -> 5b6e9ca40f55c03bd4b6275af2f2d32bd6fdc004

bluegr noreply at scummvm.org
Mon Feb 24 23:38:43 UTC 2025


This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
113e1f4290 SCUMM: Implement the original darker Sega CD MI1 graphics
267f399f94 SCUMM: Make Sega "shadow mode" its own option instead of an enhancement
3449e6d2d8 SCUMM: Change Sega CD colors to hopefully match the BlastEm emulator
e278a4e773 SCUMM: Handle the Sega CD graphics setting like other platform settings
5b6e9ca40f SCUMM: Check platform, not extra, to determine FM Towns / Sega version


Commit: 113e1f4290b82b214d0397d55c89117a1793367c
    https://github.com/scummvm/scummvm/commit/113e1f4290b82b214d0397d55c89117a1793367c
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2025-02-25T01:38:38+02:00

Commit Message:
SCUMM: Implement the original darker Sega CD MI1 graphics

Apparently the original interpreter drew everything in "shadow mode".
This tries to emulate that by default, but you can still enable the
brighter graphics as an enhancement.

I don't have access to a proper Sega CD emulator, so this is guesswork.
Simply dividing the color components by 2 doesn't produce the right
shades, compared to the screenshots I've seen. Apparently the Sega CD
used 3 bits for each color component, and then shadow mode halved the
intensity. So I'm guessing that the original interpreter simply used the
three most significant bits of each color component.

Changed paths:
    engines/scumm/palette.cpp


diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index f3d7e6707fe..2a45b6841df 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -1729,6 +1729,19 @@ void ScummEngine::updatePalette() {
 	if (_game.platform == Common::kPlatformMacintosh && _game.heversion == 0 && _useGammaCorrection) {
 		for (int i = 0; i < 3 * num; ++i)
 			paletteColors[i] = _macGammaCorrectionLookUp[paletteColors[i]];
+	} else if (_game.platform == Common::kPlatformSegaCD && _game.id == GID_MONKEY && !enhancementEnabled(kEnhVisualChanges)) {
+		// This works on the assumption that the original interpreter
+		// used just the three most significant bits of each color
+		// component. Furthermore, the graphcis were drawn in "shadow
+		// mode" (possibly by accident), halving the color intensity.
+		// Without access to a proper Sega CD emulator, this is the
+		// best I can do at the moment.
+		//
+		// You can tell the developers were aware that the graphics
+		// were dark, becaues they made the SCUMM Bar sign brighter
+		// than in other versions.
+		for (int i = 0; i < 3 * num; ++i)
+			paletteColors[i] = (paletteColors[i] & 0xE0) >> 1;
 	}
 
 	_system->getPaletteManager()->setPalette(paletteColors, first, num);


Commit: 267f399f940f5996aa08691a8a85f6fdbab08850
    https://github.com/scummvm/scummvm/commit/267f399f940f5996aa08691a8a85f6fdbab08850
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2025-02-25T01:38:38+02:00

Commit Message:
SCUMM: Make Sega "shadow mode" its own option instead of an enhancement

I mean, technically it is an enhancement, but everyone tells me that
"normally I'm all for making the original behavior the default, but in
this particular case..." And I get their point. Now we just have to
figure out how to darken the colors correctly. Fortunately there are
plenty of emulators to refer to.

Changed paths:
    engines/scumm/dialogs.cpp
    engines/scumm/dialogs.h
    engines/scumm/palette.cpp
    engines/scumm/scumm.cpp
    engines/scumm/scumm.h


diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index 929cbc9cd73..66f06d85d8d 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -1190,6 +1190,13 @@ GUI::CheckboxWidget *ScummOptionsContainerWidget::createGammaCorrectionCheckbox(
 	);
 }
 
+GUI::CheckboxWidget *ScummOptionsContainerWidget::createSegaShadowModeCheckbox(GuiObject *boss, const Common::String &name) {
+	return new GUI::CheckboxWidget(boss, name,
+		_("Simulate Sega colors"),
+		_("Instead of using the colors defined in the game, simulate colors used on actual Sega hardware. These are significantly darker, though it's unclear if that was intended or not.")
+	);
+}
+
 GUI::CheckboxWidget *ScummOptionsContainerWidget::createCopyProtectionCheckbox(GuiObject *boss, const Common::String &name) {
 	return new GUI::CheckboxWidget(boss, name,
 		_("Enable copy protection"),
@@ -1587,7 +1594,12 @@ void LoomVgaGameOptionsWidget::updatePlaybackAdjustmentValue() {
 
 MI1CdGameOptionsWidget::MI1CdGameOptionsWidget(GuiObject *boss, const Common::String &name, const Common::String &domain) :
 		ScummOptionsContainerWidget(boss, name, "MI1CdGameOptionsDialog", domain) {
-	Common::String extra = ConfMan.get("extra", domain);
+	Common::Platform platform = Common::parsePlatform(ConfMan.get("platform", _domain));
+
+	_enableOriginalGUICheckbox = createOriginalGUICheckbox(widgetsBoss(), "MI1CdGameOptionsDialog.EnableOriginalGUI");
+
+	if (platform == Common::kPlatformSegaCD)
+		_enableSegaShadowModeCheckbox = createSegaShadowModeCheckbox(widgetsBoss(), "MI1CdGameOptionsDialog.EnableSegaShadowMode");
 
 	GUI::StaticTextWidget *text = new GUI::StaticTextWidget(widgetsBoss(), "MI1CdGameOptionsDialog.IntroAdjustmentLabel", _("Intro Adjust:"));
 
@@ -1616,12 +1628,14 @@ MI1CdGameOptionsWidget::MI1CdGameOptionsWidget(GuiObject *boss, const Common::St
 	_outlookAdjustmentValue->setFlags(GUI::WIDGET_CLEARBG);
 
 	createEnhancementsWidget(widgetsBoss(), "MI1CdGameOptionsDialog");
-	_enableOriginalGUICheckbox = createOriginalGUICheckbox(widgetsBoss(), "MI1CdGameOptionsDialog.EnableOriginalGUI");
 }
 
 void MI1CdGameOptionsWidget::load() {
 	ScummOptionsContainerWidget::load();
 
+	if (_enableSegaShadowModeCheckbox)
+		_enableSegaShadowModeCheckbox->setState(ConfMan.getBool("enable_sega_shadow_mode", _domain));
+
 	int introAdjustment = 0;
 	int outlookAdjustment = 0;
 
@@ -1642,6 +1656,9 @@ void MI1CdGameOptionsWidget::load() {
 bool MI1CdGameOptionsWidget::save() {
 	ScummOptionsContainerWidget::save();
 
+	if (_enableSegaShadowModeCheckbox)
+		ConfMan.setBool("enable_sega_shadow_mode", _enableSegaShadowModeCheckbox->getState(), _domain);
+
 	ConfMan.setInt("mi1_intro_adjustment", _introAdjustmentSlider->getValue(), _domain);
 	ConfMan.setInt("mi1_outlook_adjustment", _outlookAdjustmentSlider->getValue(), _domain);
 	ConfMan.setBool("original_gui", _enableOriginalGUICheckbox->getState(), _domain);
@@ -1649,12 +1666,18 @@ bool MI1CdGameOptionsWidget::save() {
 }
 
 void MI1CdGameOptionsWidget::defineLayout(GUI::ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const {
+	Common::Platform platform = Common::parsePlatform(ConfMan.get("platform", _domain));
+
 	layouts.addDialog(layoutName, overlayedLayout)
 		.addLayout(GUI::ThemeLayout::kLayoutVertical, 5)
 			.addPadding(0, 0, 0, 0)
 			.addLayout(GUI::ThemeLayout::kLayoutVertical, 4)
 				.addPadding(0, 0, 10, 0)
 				.addWidget("EnableOriginalGUI", "Checkbox");
+
+	if (platform == Common::kPlatformSegaCD)
+		layouts.addWidget("EnableSegaShadowMode", "Checkbox");
+
 	addEnhancementsLayout(layouts)
 			.closeLayout()
 			.addLayout(GUI::ThemeLayout::kLayoutHorizontal, 12)
diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h
index a61f6f6f4db..1bd835a71ca 100644
--- a/engines/scumm/dialogs.h
+++ b/engines/scumm/dialogs.h
@@ -240,6 +240,7 @@ protected:
 	GUI::ThemeEval &addEnhancementsLayout(GUI::ThemeEval &layouts) const;
 	GUI::CheckboxWidget *createOriginalGUICheckbox(GuiObject *boss, const Common::String &name);
 	GUI::CheckboxWidget *createGammaCorrectionCheckbox(GuiObject *boss, const Common::String &name);
+	GUI::CheckboxWidget *createSegaShadowModeCheckbox(GuiObject *boss, const Common::String &name);
 	GUI::CheckboxWidget *createCopyProtectionCheckbox(GuiObject *boss, const Common::String &name);
 	void updateAdjustmentSlider(GUI::SliderWidget *slider, GUI::StaticTextWidget *value);
 
@@ -374,6 +375,7 @@ private:
 	void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
 
 	GUI::CheckboxWidget *_enableOriginalGUICheckbox = nullptr;
+	GUI::CheckboxWidget *_enableSegaShadowModeCheckbox = nullptr;
 
 	GUI::SliderWidget *_introAdjustmentSlider = nullptr;
 	GUI::StaticTextWidget *_introAdjustmentValue = nullptr;
diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index 2a45b6841df..2d33209e182 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -1729,7 +1729,7 @@ void ScummEngine::updatePalette() {
 	if (_game.platform == Common::kPlatformMacintosh && _game.heversion == 0 && _useGammaCorrection) {
 		for (int i = 0; i < 3 * num; ++i)
 			paletteColors[i] = _macGammaCorrectionLookUp[paletteColors[i]];
-	} else if (_game.platform == Common::kPlatformSegaCD && _game.id == GID_MONKEY && !enhancementEnabled(kEnhVisualChanges)) {
+	} else if (_game.platform == Common::kPlatformSegaCD && _game.id == GID_MONKEY && _enableSegaShadowMode) {
 		// This works on the assumption that the original interpreter
 		// used just the three most significant bits of each color
 		// component. Furthermore, the graphcis were drawn in "shadow
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 809ee8ef7fe..25bd0947f60 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -280,6 +280,8 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 			_voiceMode = ConfMan.getBool("subtitles");
 	}
 
+	_enableSegaShadowMode = ConfMan.getBool("enable_sega_shadow_mode");
+
 	if (ConfMan.hasKey("render_mode")) {
 		_renderMode = Common::parseRenderMode(ConfMan.get("render_mode"));
 	} else {
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 5720127e227..07d01ff9162 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1425,6 +1425,7 @@ protected:
 	byte *_hercCGAScaleBuf = nullptr;
 	bool _enableEGADithering = false;
 	bool _supportsEGADithering = false;
+	bool _enableSegaShadowMode = false;
 
 	virtual void drawDirtyScreenParts();
 	void updateDirtyScreen(VirtScreenNumber slot);


Commit: 3449e6d2d872851e0994f76a8c2879ec0a5a1a8e
    https://github.com/scummvm/scummvm/commit/3449e6d2d872851e0994f76a8c2879ec0a5a1a8e
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2025-02-25T01:38:38+02:00

Commit Message:
SCUMM: Change Sega CD colors to hopefully match the BlastEm emulator

I still haven't tried to run Sega MI1 in an emulator, but at least this
isn't quite as dark as what I had before.

Changed paths:
    engines/scumm/palette.cpp


diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index 2d33209e182..72efec68555 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -1730,18 +1730,26 @@ void ScummEngine::updatePalette() {
 		for (int i = 0; i < 3 * num; ++i)
 			paletteColors[i] = _macGammaCorrectionLookUp[paletteColors[i]];
 	} else if (_game.platform == Common::kPlatformSegaCD && _game.id == GID_MONKEY && _enableSegaShadowMode) {
-		// This works on the assumption that the original interpreter
-		// used just the three most significant bits of each color
-		// component. Furthermore, the graphcis were drawn in "shadow
-		// mode" (possibly by accident), halving the color intensity.
-		// Without access to a proper Sega CD emulator, this is the
-		// best I can do at the moment.
+		// Apparently the Sega had only 15 levels of intensity for each
+		// color component. You might think there would be 16, but the
+		// palette uses only three bits per color. These can then be
+		// rendered as normal, shadow, or highlight mode, and that comes
+		// out to 15 possible levels.
+
+		// These color levels come from the BlastEm emulator.
+
+		const byte levels[] = { 0, 27, 49, 71, 87, 103, 119, 130, 146, 157, 174, 190, 206, 228, 255 };
+
+		// For reasons unknown, the orignal interpreter rendered
+		// everything in shadow mode. We could easily emulate the other
+		// two modes as well:
 		//
-		// You can tell the developers were aware that the graphics
-		// were dark, becaues they made the SCUMM Bar sign brighter
-		// than in other versions.
+		// Normal: idx = (paletteColors[i] >> 4) & 0x0E;
+		// Shadow: idx = (paletteColors[i] >> 5) & 0x07;
+		// Hilite: idx = ((paletteColors[i] >> 5) & 0x07) + 7;
+
 		for (int i = 0; i < 3 * num; ++i)
-			paletteColors[i] = (paletteColors[i] & 0xE0) >> 1;
+			paletteColors[i] = levels[(paletteColors[i] >> 5) & 0x07];
 	}
 
 	_system->getPaletteManager()->setPalette(paletteColors, first, num);


Commit: e278a4e77379c015bca303cf444cfa5d477d561a
    https://github.com/scummvm/scummvm/commit/e278a4e77379c015bca303cf444cfa5d477d561a
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2025-02-25T01:38:38+02:00

Commit Message:
SCUMM: Handle the Sega CD graphics setting like other platform settings

Changed paths:
    engines/scumm/scumm.cpp


diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 25bd0947f60..799cf624d10 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -201,6 +201,13 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 		}
 	}
 
+	if (_game.platform == Common::kPlatformSegaCD) {
+		ConfMan.registerDefault("enable_sega_shadow_mode", false);
+		if (ConfMan.hasKey("enable_sega_shadow_mode", _targetName)) {
+			_enableSegaShadowMode = ConfMan.getBool("enable_sega_shadow_mode");
+		}
+	}
+
 	if (ConfMan.hasKey("gamma_correction", _targetName)) {
 		_useGammaCorrection = ConfMan.getBool("gamma_correction");
 	}
@@ -280,8 +287,6 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
 			_voiceMode = ConfMan.getBool("subtitles");
 	}
 
-	_enableSegaShadowMode = ConfMan.getBool("enable_sega_shadow_mode");
-
 	if (ConfMan.hasKey("render_mode")) {
 		_renderMode = Common::parseRenderMode(ConfMan.get("render_mode"));
 	} else {


Commit: 5b6e9ca40f55c03bd4b6275af2f2d32bd6fdc004
    https://github.com/scummvm/scummvm/commit/5b6e9ca40f55c03bd4b6275af2f2d32bd6fdc004
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2025-02-25T01:38:38+02:00

Commit Message:
SCUMM: Check platform, not extra, to determine FM Towns / Sega version

Both this versions have empty extra fields in their game definitions, so
ScummVM will put the variant there but only on subsequent game launches.
This means the wrong game settings was shown on adding the game, but not
later. With this change, it should show the correct one immediately.

I don't have the FM Towns version, only the Sega version, but I assume
the same fix applies to both.

Changed paths:
    engines/scumm/metaengine.cpp


diff --git a/engines/scumm/metaengine.cpp b/engines/scumm/metaengine.cpp
index f8457e81424..49f2c4660ce 100644
--- a/engines/scumm/metaengine.cpp
+++ b/engines/scumm/metaengine.cpp
@@ -619,10 +619,10 @@ GUI::OptionsContainerWidget *ScummMetaEngine::buildMI1OptionsWidget(GUI::GuiObje
 	if (platform == Common::kPlatformMacintosh && extra != "Steam")
 		return new Scumm::MacGameOptionsWidget(boss, name, target, GID_MONKEY, extra);
 
-	if (extra != "CD" && extra != "FM-TOWNS" && extra != "SEGA")
-		return nullptr;
+	if (extra == "CD" || platform == Common::kPlatformFMTowns || platform == Common::kPlatformSegaCD)
+		return new Scumm::MI1CdGameOptionsWidget(boss, name, target);
 
-	return new Scumm::MI1CdGameOptionsWidget(boss, name, target);
+	return nullptr;
 }
 
 




More information about the Scummvm-git-logs mailing list