[Scummvm-git-logs] scummvm master -> d3bd4f6bd029acf90b47824e6d65c871e18551b3

AndywinXp noreply at scummvm.org
Mon Mar 6 09:59:18 UTC 2023


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:
d3bd4f6bd0 SCUMM: COMI: Add option to enable "A Pirate I Was Meant To Be" for non-ENG versions


Commit: d3bd4f6bd029acf90b47824e6d65c871e18551b3
    https://github.com/scummvm/scummvm/commit/d3bd4f6bd029acf90b47824e6d65c871e18551b3
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-03-06T10:59:14+01:00

Commit Message:
SCUMM: COMI: Add option to enable "A Pirate I Was Meant To Be" for non-ENG versions

Changed paths:
    engines/scumm/metaengine.cpp
    engines/scumm/script_v8.cpp
    engines/scumm/scumm.cpp
    engines/scumm/scumm.h


diff --git a/engines/scumm/metaengine.cpp b/engines/scumm/metaengine.cpp
index 4dfe7e71945..d7dd448fe46 100644
--- a/engines/scumm/metaengine.cpp
+++ b/engines/scumm/metaengine.cpp
@@ -692,6 +692,16 @@ static const ExtraGuiOption enableLowLatencyAudio = {
 	0
 };
 
+static const ExtraGuiOption enableCOMISong = {
+	_s("Enable the \"A Pirate I Was Meant To Be\" song"),
+	_s("Enable the song at the beginning of Part 3 of the game, \"A Pirate I Was Meant To Be\", \
+		which was cut in international releases. Beware though: subtitles may not be fully translated."),
+	"enable_song",
+	false,
+	0,
+	0
+};
+
 const ExtraGuiOptions ScummMetaEngine::getExtraGuiOptions(const Common::String &target) const {
 	ExtraGuiOptions options;
 	// Query the GUI options
@@ -700,6 +710,7 @@ const ExtraGuiOptions ScummMetaEngine::getExtraGuiOptions(const Common::String &
 	const Common::String extra = ConfMan.get("extra", target);
 	const Common::String guiOptions = parseGameGUIOptions(guiOptionsString);
 	const Common::Platform platform = Common::parsePlatform(ConfMan.get("platform", target));
+	const Common::String language = ConfMan.get("language", target);
 
 	if (target.empty() || guiOptions.contains(GUIO_ORIGINALGUI)) {
 		options.push_back(enableOriginalGUI);
@@ -715,6 +726,10 @@ const ExtraGuiOptions ScummMetaEngine::getExtraGuiOptions(const Common::String &
 	}
 	if (target.empty() || gameid == "comi") {
 		options.push_back(comiObjectLabelsOption);
+
+		if (!language.equals("en")) {
+			options.push_back(enableCOMISong);
+		}
 	}
 	if (target.empty() || platform == Common::kPlatformNES) {
 		options.push_back(mmnesObjectLabelsOption);
diff --git a/engines/scumm/script_v8.cpp b/engines/scumm/script_v8.cpp
index f9bf2bbe944..0918be1acb3 100644
--- a/engines/scumm/script_v8.cpp
+++ b/engines/scumm/script_v8.cpp
@@ -262,6 +262,13 @@ int ScummEngine_v8::fetchScriptWordSigned() {
 int ScummEngine_v8::readVar(uint var) {
 	debugC(DEBUG_VARS, "readvar(%d)", var);
 
+	// The following action re-enables the song at the beginning of Part 3,
+	// which was disabled for international releases, if the user decides so.
+	if (_enableCOMISong &&
+		VAR_LANGUAGE != 0xFF && var == VAR_LANGUAGE &&
+		vm.slot[_currentScript].number == 319 && _currentRoom == 52)
+		return 0;
+
 	if (!(var & 0xF0000000)) {
 		assertRange(0, var, _numVariables - 1, "variable");
 		return _scummVars[var];
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 5151dc0ba95..6a0522c0734 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1441,6 +1441,13 @@ void ScummEngine::setupScumm(const Common::String &macResourceFile) {
 		_bootParam = -1;
 	}
 
+	if (_game.version == 8 && (_language != Common::EN_ANY && _language != Common::EN_GRB && _language != Common::EN_USA)) {
+		ConfMan.registerDefault("enable_song", true);
+		if (ConfMan.hasKey("enable_song", _targetName)) {
+			_enableCOMISong = ConfMan.getBool("enable_song");
+		}
+	}
+
 #ifndef ATARI
 	int maxHeapThreshold = -1;
 
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index b5a0aa88724..4441354a163 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -547,6 +547,7 @@ public:
 	bool _enableEnhancements = false;
 	bool _useOriginalGUI = true;
 	bool _enableAudioOverride = false;
+	bool _enableCOMISong = false;
 
 	Common::Keymap *_insaneKeymap;
 




More information about the Scummvm-git-logs mailing list