[Scummvm-git-logs] scummvm master -> 1ffa644d202fd8edadf8b09b1b8da85cc54ea3ea

bluegr noreply at scummvm.org
Mon Nov 7 20:07:33 UTC 2022


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

Summary:
1ffa644d20 SCUMM: Add feature flag for the "Ultimate Talkie" version of MI1/MI2


Commit: 1ffa644d202fd8edadf8b09b1b8da85cc54ea3ea
    https://github.com/scummvm/scummvm/commit/1ffa644d202fd8edadf8b09b1b8da85cc54ea3ea
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-11-07T22:07:28+02:00

Commit Message:
SCUMM: Add feature flag for the "Ultimate Talkie" version of MI1/MI2

There are so many workarounds where we either want to make sure it's not
the "Ultimate Talkie" version or that it is, that it's much nicer to
have a feature flag than having to strcmp() the variant.

Changed paths:
    engines/scumm/detection.h
    engines/scumm/detection_tables.h
    engines/scumm/gfx.cpp
    engines/scumm/input.cpp
    engines/scumm/room.cpp
    engines/scumm/script_v5.cpp


diff --git a/engines/scumm/detection.h b/engines/scumm/detection.h
index 9c1c3c2586b..4eb36ca1408 100644
--- a/engines/scumm/detection.h
+++ b/engines/scumm/detection.h
@@ -192,7 +192,13 @@ enum GameFeatures {
 	 * but used reversed string for credits etc.
 	 * Used to disable BiDi in those games.
 	 */
-	GF_HE_NO_BIDI = 1 << 17
+	GF_HE_NO_BIDI = 1 << 17,
+
+	/**
+	 * The "Ultimate Talkie" versions of Monkey Island, which have been
+	 * patched so that most workarounds/bugfixes no longer apply to them.
+	 */
+	GF_ULTIMATE_TALKIE = 1 << 18
 };
 
 enum ScummGameId {
diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h
index 274368c7019..692ace7e8a5 100644
--- a/engines/scumm/detection_tables.h
+++ b/engines/scumm/detection_tables.h
@@ -195,14 +195,12 @@ static const GameSettings gameVariantsTable[] = {
 	{"monkey", "Mac",    0, GID_MONKEY,     5, 0, MDT_ADLIB,                        0, UNK, GUIO4(GUIO_NOSPEECH, GUIO_NOMIDI, GUIO_ENHANCEMENTS, GUIO_ORIGINALGUI)},
 	{"monkey", "FM-TOWNS",     0, GID_MONKEY,     5, 0, MDT_TOWNS,                        GF_AUDIOTRACKS, Common::kPlatformFMTowns, GUIO6(GUIO_NOSPEECH, GUIO_NOMIDI, GUIO_MIDITOWNS, GUIO_TRIM_FMTOWNS_TO_200_PIXELS, GUIO_ENHANCEMENTS, GUIO_ORIGINALGUI)},
 	{"monkey", "SEGA",         0, GID_MONKEY,     5, 0, MDT_NONE,                         GF_AUDIOTRACKS, Common::kPlatformSegaCD, GUIO4(GUIO_NOSPEECH, GUIO_NOMIDI, GUIO_ENHANCEMENTS, GUIO_ORIGINALGUI)},
-	{"monkey", "SE Talkie",    0, GID_MONKEY,     5, 0, MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, GF_AUDIOTRACKS, UNK, GUIO2(GUIO_RENDEREGA, GUIO_ORIGINALGUI)},
-
+	{"monkey", "SE Talkie",    0, GID_MONKEY,     5, 0, MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, GF_AUDIOTRACKS | GF_ULTIMATE_TALKIE, UNK, GUIO2(GUIO_RENDEREGA, GUIO_ORIGINALGUI)},
 	{"monkey2", "", 0, GID_MONKEY2,  5, 0, MDT_PCSPK | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, UNK, GUIO4(GUIO_NOSPEECH, GUIO_RENDEREGA, GUIO_ENHANCEMENTS, GUIO_ORIGINALGUI)},
 	{"monkey2", "Demo", 0, GID_MONKEY2,  5, 0, MDT_PCSPK | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, GF_DEMO, UNK, GUIO2(GUIO_NOSPEECH, GUIO_ENHANCEMENTS)},
 	{"monkey2", "Amiga", 0, GID_MONKEY2,  5, 0, MDT_AMIGA, 0, Common::kPlatformAmiga, GUIO4(GUIO_NOSPEECH, GUIO_MIDIAMIGA, GUIO_ENHANCEMENTS, GUIO_ORIGINALGUI)},
 	{"monkey2", "FM-TOWNS", 0, GID_MONKEY2,  5, 0, MDT_PCSPK | MDT_TOWNS | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, Common::kPlatformFMTowns, GUIO7(GUIO_NOSPEECH, GUIO_MIDITOWNS, GUIO_MIDIADLIB, GUIO_MIDIMT32, GUIO_TRIM_FMTOWNS_TO_200_PIXELS, GUIO_ENHANCEMENTS, GUIO_ORIGINALGUI)},
-	{"monkey2", "SE Talkie",0, GID_MONKEY2,  5, 0, MDT_PCSPK | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, UNK, GUIO2(GUIO_RENDEREGA, GUIO_ORIGINALGUI)},
-
+	{"monkey2", "SE Talkie",0, GID_MONKEY2,  5, 0, MDT_PCSPK | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, GF_ULTIMATE_TALKIE, UNK, GUIO2(GUIO_RENDEREGA, GUIO_ORIGINALGUI)},
 	{"atlantis", "", 0, GID_INDY4,    5, 0, MDT_PCSPK | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, UNK, GUIO3(GUIO_RENDEREGA, GUIO_ENHANCEMENTS, GUIO_ORIGINALGUI)},
 	{"atlantis", "Steam", "steam", GID_INDY4,    5, 0, MDT_PCSPK | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, UNK, GUIO3(GUIO_RENDEREGA, GUIO_ENHANCEMENTS, GUIO_ORIGINALGUI)},
 	{"atlantis", "Floppy", 0, GID_INDY4,    5, 0, MDT_PCSPK | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, UNK, GUIO4(GUIO_NOSPEECH, GUIO_RENDEREGA, GUIO_ENHANCEMENTS, GUIO_ORIGINALGUI)},
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 6f14a174942..66e621514f4 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -2237,12 +2237,12 @@ bool Gdi::drawStrip(byte *dstPtr, VirtScreen *vs, int x, int y, const int width,
 	// version makes the text more readable by giving it a black outline.
 
 	else if (_vm->_game.id == GID_MONKEY &&
+			!(_vm->_game.features & GF_ULTIMATE_TALKIE) &&
 			_vm->_game.platform != Common::kPlatformSegaCD &&
 			_vm->_game.platform != Common::kPlatformFMTowns &&
 			_vm->_currentRoom == 36 &&
 			vs->number == kMainVirtScreen &&
 			y == 8 && x >= 7 && x <= 30 && height == 88 &&
-			strcmp(_vm->_game.variant, "SE Talkie") != 0 &&
 			_vm->_enableEnhancements) {
 		_roomPalette[47] = 15;
 
diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index f2a7bf852b4..782e4ae5f07 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -880,8 +880,8 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) {
 
 		// Generally allow voice mode settings only for v6, 7 and 8.
 		// Also allow it for Indy4 Talkie, which does its own thing.
-		if (((VAR_VOICE_MODE != 0xFF) || (_game.variant && (!strcmp(_game.variant, "SE Talkie") ||
-			(_game.id == GID_INDY4 && strcmp(_game.variant, "Floppy") && strcmp(_game.variant, "Amiga"))))) &&
+		if (((VAR_VOICE_MODE != 0xFF) || ((_game.features & GF_ULTIMATE_TALKIE) ||
+			(_game.id == GID_INDY4 && strcmp(_game.variant, "Floppy") && strcmp(_game.variant, "Amiga")))) &&
 			(lastKeyHit.keycode == Common::KEYCODE_t && lastKeyHit.hasFlags(Common::KBD_CTRL))) {
 			int voiceMode = (_game.version == 5) ? _v5VoiceMode : VAR(VAR_VOICE_MODE);
 
diff --git a/engines/scumm/room.cpp b/engines/scumm/room.cpp
index 71766e5aab1..e20b359d749 100644
--- a/engines/scumm/room.cpp
+++ b/engines/scumm/room.cpp
@@ -242,7 +242,7 @@ void ScummEngine::startScene(int room, Actor *a, int objectNr) {
 			hasCopyProtectionScreen = false;
 
 		// The unofficial talkie never shows any copy protection screen.
-		if (strcmp(_game.variant, "SE Talkie") == 0)
+		if (_game.features & GF_ULTIMATE_TALKIE)
 			hasCopyProtectionScreen = false;
 
 		if (hasCopyProtectionScreen) {
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index 6a152798e55..950dc77780b 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -446,9 +446,9 @@ void ScummEngine_v5::o5_actorOps() {
 	// script describing that "the crew begins to plan their voyage" is running in order
 	// to display the flag, so we just reuse this check. The Ultimate Talkie also fixed
 	// this, but in a different way which doesn't look as portable between releases.
-	if ((_game.id == GID_MONKEY_EGA || _game.id == GID_MONKEY_VGA || _game.id == GID_MONKEY) &&
+	if ((_game.id == GID_MONKEY_EGA || _game.id == GID_MONKEY_VGA || (_game.id == GID_MONKEY && !(_game.features & GF_ULTIMATE_TALKIE))) &&
 		_roomResource == 87 && vm.slot[_currentScript].number == 10002 && act == 9 &&
-		_enableEnhancements && strcmp(_game.variant, "SE Talkie") != 0) {
+		_enableEnhancements) {
 		const int scriptNr = (_game.version == 5) ? 122 : 119;
 		if (!isScriptRunning(scriptNr)) {
 			a->putActor(0);
@@ -651,7 +651,7 @@ void ScummEngine_v5::o5_setClass() {
 		    _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) {
+		    !(_game.features & GF_ULTIMATE_TALKIE)) {
 			// 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.
@@ -1066,8 +1066,8 @@ void ScummEngine_v5::o5_drawObject() {
 	// face Guybrush even if he's already looking at him.  drawObject() should never
 	// be called if Bit[129] is set in that script, so if it does happen, it means
 	// the check was missing, and so we ignore the next 32 bytes of Dread's reaction.
-	if (_game.id == GID_MONKEY2 && _currentRoom == 22 && vm.slot[_currentScript].number == 201 && obj == 237 &&
-		state == 1 && readVar(0x8000 + 129) == 1 && _enableEnhancements && strcmp(_game.variant, "SE Talkie") != 0) {
+	if (_game.id == GID_MONKEY2 && !(_game.features & GF_ULTIMATE_TALKIE) && _currentRoom == 22 && vm.slot[_currentScript].number == 201 && obj == 237 &&
+		state == 1 && readVar(0x8000 + 129) == 1 && _enableEnhancements) {
 		_scriptPointer += 32;
 		return;
 	}
@@ -1535,7 +1535,7 @@ void ScummEngine_v5::o5_isEqual() {
 	//
 	// Not using `_enableEnhancements`, since this small oversight only
 	// exists in this fan-made edition which was made for enhancements.
-	if (_game.id == GID_MONKEY2 && _roomResource == 48 && vm.slot[_currentScript].number == 215 && a == vm.localvar[_currentScript][0] && strcmp(_game.variant, "SE Talkie") == 0) {
+	if (_game.id == GID_MONKEY2 && (_game.features & GF_ULTIMATE_TALKIE) && _roomResource == 48 && vm.slot[_currentScript].number == 215 && a == vm.localvar[_currentScript][0]) {
 		if (a == 550 && b == 530)
 			b = 550;
 		else if (a == 549 && b == 529)
@@ -1554,9 +1554,10 @@ void ScummEngine_v5::o5_isEqual() {
 	// future update or fan translation which would change this.
 	//
 	// Intentionally not using `_enableEnhancements` for this version.
-	if (_game.id == GID_MONKEY2 && _roomResource == 47 && vm.slot[_currentScript].number == 218 &&
-		var == 0x4000 + 1 && a == vm.localvar[_currentScript][1] && a == b && (b == 7 || b == 13) &&
-		strcmp(_game.variant, "SE Talkie") == 0) {
+	if (_game.id == GID_MONKEY2 && (_game.features & GF_ULTIMATE_TALKIE) &&
+		_roomResource == 47 && vm.slot[_currentScript].number == 218 &&
+		var == 0x4000 + 1 && a == vm.localvar[_currentScript][1] &&
+		a == b && (b == 7 || b == 13)) {
 		// No need to skip any line if playing in always-prefer-original-text
 		// mode (Bit[588]) where silent lines are expected, or if speech is muted.
 		if (readVar(0x8000 + 588) == 1 && !ConfMan.getBool("speech_mute")) {
@@ -1671,7 +1672,7 @@ void ScummEngine_v5::o5_notEqualZero() {
 		//
 		// Note that fixing this unveils the script error causing the possible
 		// dead-end described above.
-		if (var == 0x8000 + 70 && a == 0 && getOwner(519) == VAR(VAR_EGO) && strcmp(_game.variant, "SE Talkie") != 0 && _enableEnhancements) {
+		if (!(_game.features & GF_ULTIMATE_TALKIE) && var == 0x8000 + 70 && a == 0 && getOwner(519) == VAR(VAR_EGO) && _enableEnhancements) {
 			a = 1;
 		}
 
@@ -1920,7 +1921,7 @@ void ScummEngine_v5::o5_print() {
 	//
 	// The workaround is deliberately not marked as an enhancement, since
 	// this version makes so many changes of its own.
-	if (_game.id == GID_MONKEY && _currentRoom == 25 && vm.slot[_currentScript].number == 205 && VAR(VAR_HAVE_MSG) && strcmp(_game.variant, "SE Talkie") == 0) {
+	if (_game.id == GID_MONKEY && (_game.features & GF_ULTIMATE_TALKIE) && _currentRoom == 25 && vm.slot[_currentScript].number == 205 && VAR(VAR_HAVE_MSG)) {
 		_scriptPointer--;
 		o5_breakHere();
 		return;
@@ -3293,12 +3294,12 @@ void ScummEngine_v5::decodeParseString() {
 			// giving it a black outline.
 
 			else if (_game.id == GID_MONKEY &&
+					!(_game.features & GF_ULTIMATE_TALKIE) &&
 					_game.platform != Common::kPlatformSegaCD &&
 					_game.platform != Common::kPlatformFMTowns &&
 					_currentRoom == 36 &&
 					vm.slot[_currentScript].number == 201 &&
 					color == 2 &&
-					strcmp(_game.variant, "SE Talkie") != 0 &&
 					_enableEnhancements) {
 				color = findClosestPaletteColor(_currentPalette, 256, 0, 171, 0);
 			}
@@ -3469,12 +3470,13 @@ void ScummEngine_v5::decodeParseStringTextString(int textSlot) {
 		Common::strlcpy(tmpBuf + diff, "5000", sizeof(tmpBuf) - diff);
 		Common::strlcpy(tmpBuf + diff + 4, tmp + sizeof("NCREDIT-NOTE-AMOUNT") - 1, sizeof(tmpBuf) - diff - 4);
 		printString(textSlot, (byte *)tmpBuf);
-	} else if (_game.id == GID_MONKEY && _game.platform != Common::kPlatformSegaCD &&
+	} else if (_game.id == GID_MONKEY && !(_game.features & GF_ULTIMATE_TALKIE) &&
+			_game.platform != Common::kPlatformSegaCD &&
 			((_roomResource == 78 && vm.slot[_currentScript].number == 201) ||
 			(_roomResource == 45 && vm.slot[_currentScript].number == 200 &&
 			isValidActor(10) && _actors[10]->isInCurrentRoom())) &&
 			_actorToPrintStrFor == 255 && _string[textSlot].color != 0x0F &&
-			strcmp(_game.variant, "SE Talkie") != 0 && _enableEnhancements) {
+			_enableEnhancements) {
 		// WORKAROUND: When Guybrush goes to the church at the end of Monkey1,
 		// the color for the ghost priest's lines is inconsistent in the v5
 		// releases (except for the SegaCD one with the smaller palette).
@@ -3482,10 +3484,11 @@ void ScummEngine_v5::decodeParseStringTextString(int textSlot) {
 		// "I heard that!" offscreen.
 		_string[textSlot].color = (_game.platform == Common::kPlatformFMTowns) ? 0x0A : 0xF9;
 		printString(textSlot, _scriptPointer);
-	} else if (_game.id == GID_MONKEY && _game.platform != Common::kPlatformSegaCD &&
+	} else if (_game.id == GID_MONKEY && !(_game.features & GF_ULTIMATE_TALKIE) &&
+			_game.platform != Common::kPlatformSegaCD &&
 			(vm.slot[_currentScript].number == 140 || vm.slot[_currentScript].number == 294) &&
 			_actorToPrintStrFor == 255 && _string[textSlot].color == 0x06 &&
-			strcmp(_game.variant, "SE Talkie") != 0 && _enableEnhancements) {
+			_enableEnhancements) {
 		// WORKAROUND: In MI1 CD, the colors when the navigator head speaks are
 		// not the intended ones (dark purple instead of brown), because the
 		// original `Color(6)` parameter was kept without adjusting it for the




More information about the Scummvm-git-logs mailing list