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

sev- noreply at scummvm.org
Sun Apr 5 22:18:32 UTC 2026


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

Summary:
7334fdc5c6 AGOS: Add Simon2 Mac/Amiga language file support
5eac28db09 AGOS: Simon2 Mac/Amiga language switch with 'l'
c055ab9e0f AGOS: Simon2 Mac/Amiga language flags and spacebar toggle
e9040d3e43 AGOS: Simon2 Amiga CD detection entries and midi fix


Commit: 7334fdc5c6ac6c7ad25cabd219e4d9cb529f2271
    https://github.com/scummvm/scummvm/commit/7334fdc5c6ac6c7ad25cabd219e4d9cb529f2271
Author: Robert Megone (robert.megone at gmail.com)
Date: 2026-04-06T00:18:27+02:00

Commit Message:
AGOS: Add Simon2 Mac/Amiga language file support

Changed paths:
    engines/agos/agos.cpp
    engines/agos/agos.h
    engines/agos/detection.cpp
    engines/agos/string.cpp


diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index aee5ff9410a..51717176eaa 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -23,6 +23,7 @@
 #include "common/debug-channels.h"
 #include "common/file.h"
 #include "common/fs.h"
+#include "common/path.h"
 #include "common/textconsole.h"
 
 #include "engines/util.h"
@@ -569,6 +570,7 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 	_moveYMax = 0;
 
 	_forceAscii = false;
+	_useSimon2LanguageOverlay = false;
 
 	_vc10BasePtrOld = nullptr;
 	memcpy (_hebrewCharWidths,
@@ -586,6 +588,7 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 	// Add default file directories for Amiga/Macintosh
 	// versions of Simon the Sorcerer 2
 	SearchMan.addSubDirectoryMatching(gameDataDir, "voices");
+	SearchMan.addSubDirectoryMatching(gameDataDir, "data");
 
 	// Add default file directories for Amiga & Macintosh
 	// versions of The Feeble Files
@@ -690,6 +693,7 @@ Common::Error AGOSEngine::init() {
 
 	_copyProtection = ConfMan.getBool("copy_protection");
 	_language = Common::parseLanguage(ConfMan.get("language"));
+	loadSimon2LanguageOverlay();
 
 	if (getGameType() == GType_PP) {
 		_speech = true;
@@ -1167,4 +1171,79 @@ void AGOSEngine::syncSoundSettingsIntern() {
 		_midi->syncSoundSettings();
 }
 
+static bool decodeSimon2LanguageFile(const Common::String &filename, Common::Array<Common::String> &entries) {
+	Common::SeekableReadStream *in = SearchMan.createReadStreamForMember(Common::Path(filename));
+	if (!in)
+		return false;
+
+	Common::String current;
+	while (!in->eos()) {
+		byte raw = in->readByte();
+		byte decoded = raw + 1;
+		if (decoded == 0) {
+			entries.push_back(current);
+			current.clear();
+		} else {
+			current += (char)decoded;
+		}
+	}
+
+	delete in;
+	return !entries.empty();
+}
+
+bool AGOSEngine::hasSimon2LanguageFiles() const {
+	if (getGameType() != GType_SIMON2)
+		return false;
+
+	return SearchMan.hasFile("simon2.english") || SearchMan.hasFile("simon2.german") ||
+		SearchMan.hasFile("simon2.italian") || SearchMan.hasFile("simon2.french");
+}
+
+void AGOSEngine::loadSimon2LanguageOverlay() {
+	_useSimon2LanguageOverlay = false;
+	_simon2LanguageOverlay.clear();
+
+	if (!hasSimon2LanguageFiles())
+		return;
+
+	Common::String targetFile;
+	switch (_language) {
+	case Common::DE_DEU:
+		targetFile = "simon2.german";
+		break;
+	case Common::IT_ITA:
+		targetFile = "simon2.italian";
+		break;
+	case Common::FR_FRA:
+		targetFile = "simon2.french";
+		break;
+	default:
+		return;
+	}
+
+	Common::Array<Common::String> englishEntries;
+	Common::Array<Common::String> translatedEntries;
+	if (!decodeSimon2LanguageFile("simon2.english", englishEntries))
+		return;
+	if (!decodeSimon2LanguageFile(targetFile, translatedEntries))
+		return;
+
+	size_t count = MIN(englishEntries.size(), translatedEntries.size());
+	for (size_t i = 0; i < count; ++i) {
+		if (!englishEntries[i].empty() && englishEntries[i] != translatedEntries[i])
+			_simon2LanguageOverlay.setVal(englishEntries[i], translatedEntries[i]);
+	}
+
+	_useSimon2LanguageOverlay = !_simon2LanguageOverlay.empty();
+}
+
+Common::String AGOSEngine::translateLanguageOverlay(const Common::String &english) const {
+	if (!_useSimon2LanguageOverlay)
+		return english;
+	if (!_simon2LanguageOverlay.contains(english))
+		return english;
+	return _simon2LanguageOverlay.getValOrDefault(english);
+}
+
 } // End of namespace AGOS
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 8c57fc30e7b..9b852600c5f 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -26,6 +26,7 @@
 
 #include "common/array.h"
 #include "common/error.h"
+#include "common/hashmap.h"
 #include "common/keyboard.h"
 #include "common/random.h"
 #include "common/rect.h"
@@ -385,6 +386,8 @@ protected:
 	bool _backFlag;
 
 	Common::Language _language;
+	bool _useSimon2LanguageOverlay;
+	Common::HashMap<Common::String, Common::String> _simon2LanguageOverlay;
 	bool _copyProtection;
 	bool _pause;
 	bool _speech;
@@ -775,6 +778,9 @@ protected:
 
 	void showMessageFormat(MSVC_PRINTF const char *s, ...) GCC_PRINTF(2, 3);
 	const byte *getStringPtrByID(uint16 stringId, bool upperCase = false);
+	void loadSimon2LanguageOverlay();
+	bool hasSimon2LanguageFiles() const;
+	Common::String translateLanguageOverlay(const Common::String &english) const;
 	const byte *getLocalStringByID(uint16 stringId);
 	uint getNextStringID();
 
diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp
index 5509a29e33d..5fdbd3091f7 100644
--- a/engines/agos/detection.cpp
+++ b/engines/agos/detection.cpp
@@ -28,6 +28,8 @@
 #include "common/system.h"
 #include "common/textconsole.h"
 #include "common/compression/installshield_cab.h"
+#include "common/fs.h"
+#include "common/language.h"
 
 #include "agos/detection.h"
 #include "agos/intern_detection.h"
@@ -71,6 +73,71 @@ static const char *const directoryGlobs[] = {
 	nullptr
 };
 
+
+static bool hasSimon2LangFile(const Common::FSNode &gameDir, const char *filename) {
+	Common::FSNode rootFile = gameDir.getChild(filename);
+	if (rootFile.exists())
+		return true;
+
+	Common::FSNode dataDir = gameDir.getChild("data");
+	if (dataDir.exists() && dataDir.isDirectory()) {
+		Common::FSNode dataFile = dataDir.getChild(filename);
+		if (dataFile.exists())
+			return true;
+	}
+
+	return false;
+}
+
+static Common::String stripLanguageGUIOptions(const Common::String &guiOptions) {
+	Common::String filtered;
+	const char *p = guiOptions.c_str();
+
+	while (*p) {
+		while (*p == ' ')
+			++p;
+		if (!*p)
+			break;
+
+		const char *start = p;
+		while (*p && *p != ' ')
+			++p;
+
+		Common::String token(start, p);
+		if (!token.hasPrefix("lang_")) {
+			if (!filtered.empty())
+				filtered += " ";
+			filtered += token;
+		}
+	}
+
+	return filtered;
+}
+
+static void applySimon2LanguageGUIOptions(DetectedGame &game, const Common::FSNode &gameDir) {
+	if (game.gameId != "simon2" || !gameDir.exists() || !gameDir.isDirectory())
+		return;
+
+	const bool hasEnglish = hasSimon2LangFile(gameDir, "simon2.english");
+	const bool hasGerman = hasSimon2LangFile(gameDir, "simon2.german");
+	const bool hasItalian = hasSimon2LangFile(gameDir, "simon2.italian");
+	const bool hasFrench = hasSimon2LangFile(gameDir, "simon2.french");
+
+	if (!hasEnglish && !hasGerman && !hasItalian && !hasFrench)
+		return;
+
+	game.setGUIOptions(stripLanguageGUIOptions(game.getGUIOptions()));
+
+	if (hasEnglish)
+		game.appendGUIOptions(Common::getGameGUIOptionsDescriptionLanguage(Common::EN_ANY));
+	if (hasGerman)
+		game.appendGUIOptions(Common::getGameGUIOptionsDescriptionLanguage(Common::DE_DEU));
+	if (hasItalian)
+		game.appendGUIOptions(Common::getGameGUIOptionsDescriptionLanguage(Common::IT_ITA));
+	if (hasFrench)
+		game.appendGUIOptions(Common::getGameGUIOptionsDescriptionLanguage(Common::FR_FRA));
+}
+
 using namespace AGOS;
 
 class AgosMetaEngineDetection : public AdvancedMetaEngineDetection<AGOS::AGOSGameDescription> {
@@ -87,7 +154,30 @@ public:
 
 	Common::Error identifyGame(DetectedGame &game, const void **descriptor) override {
 		Engines::upgradeTargetIfNecessary(obsoleteGameIDsTable);
-		return AdvancedMetaEngineDetection::identifyGame(game, descriptor);
+		Common::Error err = AdvancedMetaEngineDetection::identifyGame(game, descriptor);
+
+		if (err.getCode() == Common::kNoError && game.gameId == "simon2" && ConfMan.hasKey("path")) {
+			Common::FSNode gameDir(ConfMan.getPath("path"));
+			applySimon2LanguageGUIOptions(game, gameDir);
+		}
+
+		return err;
+	}
+
+	DetectedGames detectGames(const Common::FSList &fslist, uint32 skipADFlags, bool skipIncomplete) override {
+		DetectedGames games = AdvancedMetaEngineDetection::detectGames(fslist, skipADFlags, skipIncomplete);
+
+		if (fslist.empty())
+			return games;
+
+		Common::FSNode gameDir = fslist.begin()->getParent();
+
+		for (DetectedGame &game : games) {
+			if (game.gameId == "simon2")
+				applySimon2LanguageGUIOptions(game, gameDir);
+		}
+
+		return games;
 	}
 
 	const char *getName() const override {
diff --git a/engines/agos/string.cpp b/engines/agos/string.cpp
index 1aa590b834c..6a7bb602099 100644
--- a/engines/agos/string.cpp
+++ b/engines/agos/string.cpp
@@ -135,6 +135,12 @@ const byte *AGOSEngine::getStringPtrByID(uint16 stringId, bool upperCase) {
 		Common::strlcpy((char *)dst, (const char *)stringPtr, 180);
 	}
 
+	if (_useSimon2LanguageOverlay && *dst) {
+		Common::String translated = translateLanguageOverlay((const char *)dst);
+		if (translated != (const char *)dst)
+			Common::strlcpy((char *)dst, translated.c_str(), 180);
+	}
+
 	// WORKAROUND bug #2780: The French version of Simon 1 and the
 	// Polish version of Simon 2 used excess spaces, at the end of many
 	// messages, so we strip off those excess spaces.


Commit: 5eac28db09e0693370562138ba55f00f5b330694
    https://github.com/scummvm/scummvm/commit/5eac28db09e0693370562138ba55f00f5b330694
Author: Robert Megone (robert.megone at gmail.com)
Date: 2026-04-06T00:18:27+02:00

Commit Message:
AGOS: Simon2 Mac/Amiga language switch with 'l'

Changed paths:
    engines/agos/agos.cpp
    engines/agos/agos.h
    engines/agos/input.cpp


diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 51717176eaa..5203764757f 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -1200,6 +1200,37 @@ bool AGOSEngine::hasSimon2LanguageFiles() const {
 		SearchMan.hasFile("simon2.italian") || SearchMan.hasFile("simon2.french");
 }
 
+Common::Language AGOSEngine::getNextSimon2OverlayLanguage() const {
+	Common::Array<Common::Language> available;
+
+	if (SearchMan.hasFile("simon2.english"))
+		available.push_back(Common::EN_ANY);
+	if (SearchMan.hasFile("simon2.german"))
+		available.push_back(Common::DE_DEU);
+	if (SearchMan.hasFile("simon2.italian"))
+		available.push_back(Common::IT_ITA);
+	if (SearchMan.hasFile("simon2.french"))
+		available.push_back(Common::FR_FRA);
+
+	if (available.empty())
+		return _language;
+
+	for (uint i = 0; i < available.size(); ++i) {
+		if (available[i] == _language)
+			return available[(i + 1) % available.size()];
+	}
+
+	return available[0];
+}
+
+void AGOSEngine::cycleSimon2LanguageOverlay() {
+	if (!hasSimon2LanguageFiles())
+		return;
+
+	_language = getNextSimon2OverlayLanguage();
+	loadSimon2LanguageOverlay();
+}
+
 void AGOSEngine::loadSimon2LanguageOverlay() {
 	_useSimon2LanguageOverlay = false;
 	_simon2LanguageOverlay.clear();
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 9b852600c5f..53d946d655f 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -780,6 +780,8 @@ protected:
 	const byte *getStringPtrByID(uint16 stringId, bool upperCase = false);
 	void loadSimon2LanguageOverlay();
 	bool hasSimon2LanguageFiles() const;
+	Common::Language getNextSimon2OverlayLanguage() const;
+	void cycleSimon2LanguageOverlay();
 	Common::String translateLanguageOverlay(const Common::String &english) const;
 	const byte *getLocalStringByID(uint16 stringId);
 	uint getNextStringID();
@@ -896,6 +898,8 @@ protected:
 
 	void endCutscene();
 	virtual void runSubroutine101();
+	bool isSimon2LanguageToggleKeyPressed() const;
+	void refreshSimon2LanguageText();
 
 	virtual void inventoryUp(WindowBlock *window);
 	virtual void inventoryDown(WindowBlock *window);
diff --git a/engines/agos/input.cpp b/engines/agos/input.cpp
index 88d98b7fb41..a0ce90052a4 100644
--- a/engines/agos/input.cpp
+++ b/engines/agos/input.cpp
@@ -165,6 +165,16 @@ out_of_here:
 	_noRightClick = 0;
 }
 
+bool AGOSEngine::isSimon2LanguageToggleKeyPressed() const {
+	return getGameType() == GType_SIMON2 && hasSimon2LanguageFiles() &&
+		(_keyPressed.keycode == Common::KEYCODE_l || _keyPressed.ascii == 'l' || _keyPressed.ascii == 'L');
+}
+
+void AGOSEngine::refreshSimon2LanguageText() {
+	cycleSimon2LanguageOverlay();
+	_keyPressed.reset();
+}
+
 void AGOSEngine::waitForInput() {
 	HitArea *ha;
 	uint id;
@@ -192,6 +202,11 @@ void AGOSEngine::waitForInput() {
 		_dragAccept = true;
 
 		while (!shouldQuit()) {
+			if (isSimon2LanguageToggleKeyPressed()) {
+				refreshSimon2LanguageText();
+				continue;
+			}
+
 			if ((getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) &&
 				_action == kActionShowObjects)
 				displayBoxStars();


Commit: c055ab9e0fb6a64b3bbbefec60060363db920929
    https://github.com/scummvm/scummvm/commit/c055ab9e0fb6a64b3bbbefec60060363db920929
Author: Robert Megone (robert.megone at gmail.com)
Date: 2026-04-06T00:18:27+02:00

Commit Message:
AGOS: Simon2 Mac/Amiga language flags and spacebar toggle

Changed paths:
    engines/agos/agos.cpp
    engines/agos/agos.h
    engines/agos/draw.cpp
    engines/agos/event.cpp
    engines/agos/input.cpp


diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 5203764757f..27d8fbd957b 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -1097,6 +1097,13 @@ Common::Error AGOSEngine::go() {
 
 	while (!shouldQuit()) {
 		waitForInput();
+
+		if (getGameType() == GType_SIMON2 && (_keyPressed.keycode == Common::KEYCODE_SPACE || _keyPressed.ascii == ' ' ) && hasSimon2LanguageFiles()) {
+			cycleSimon2LanguageOverlay();
+			_keyPressed.reset();
+			continue;
+		}
+
 		handleVerbClicked(_verbHitArea);
 		delay(100);
 	}
@@ -1228,7 +1235,11 @@ void AGOSEngine::cycleSimon2LanguageOverlay() {
 		return;
 
 	_language = getNextSimon2OverlayLanguage();
+	_simon2OverlayLanguage = _language;
 	loadSimon2LanguageOverlay();
+	_simon2LanguageFlagTimer = 0x32;
+	_simon2LanguageFlagClearPending = false;
+	_displayFlag = 1;
 }
 
 void AGOSEngine::loadSimon2LanguageOverlay() {
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 53d946d655f..a19c50c923b 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -386,6 +386,7 @@ protected:
 	bool _backFlag;
 
 	Common::Language _language;
+	Common::Language _simon2OverlayLanguage;
 	bool _useSimon2LanguageOverlay;
 	Common::HashMap<Common::String, Common::String> _simon2LanguageOverlay;
 	bool _copyProtection;
@@ -602,6 +603,8 @@ protected:
 
 	uint8 _currentPalette[768];
 	uint8 _displayPalette[768];
+	uint8 _simon2LanguageFlagTimer;
+	bool _simon2LanguageFlagClearPending;
 
 	byte *_planarBuf;
 	byte _videoBuf1[32000];
@@ -900,6 +903,10 @@ protected:
 	virtual void runSubroutine101();
 	bool isSimon2LanguageToggleKeyPressed() const;
 	void refreshSimon2LanguageText();
+	uint8 mapRGBToPaletteIndex(uint8 r, uint8 g, uint8 b) const;
+	void fillSimon2LanguageFlagRect(int x1, int y1, int x2, int y2, uint8 color);
+	void restoreSimon2LanguageFlagArea();
+	void drawSimon2LanguageFlag();
 
 	virtual void inventoryUp(WindowBlock *window);
 	virtual void inventoryDown(WindowBlock *window);
diff --git a/engines/agos/draw.cpp b/engines/agos/draw.cpp
index 944797f9484..cfb4913f822 100644
--- a/engines/agos/draw.cpp
+++ b/engines/agos/draw.cpp
@@ -772,6 +772,131 @@ void AGOSEngine::setMoveRect(uint16 x, uint16 y, uint16 width, uint16 height) {
 		_moveYMax = height;
 }
 
+
+uint8 AGOSEngine::mapRGBToPaletteIndex(uint8 r, uint8 g, uint8 b) const {
+	uint8 bestIndex = 0;
+	int redDistance = _displayPalette[0] - r;
+	int greenDistance = _displayPalette[1] - g;
+	int blueDistance = _displayPalette[2] - b;
+	uint32 bestDistance = redDistance * redDistance + greenDistance * greenDistance + blueDistance * blueDistance;
+
+	for (uint i = 1; i < 256; ++i) {
+		const uint paletteOffset = i * 3;
+		redDistance = _displayPalette[paletteOffset + 0] - r;
+		greenDistance = _displayPalette[paletteOffset + 1] - g;
+		blueDistance = _displayPalette[paletteOffset + 2] - b;
+
+		const uint32 distance = redDistance * redDistance + greenDistance * greenDistance + blueDistance * blueDistance;
+		if (distance >= bestDistance)
+			continue;
+
+		bestDistance = distance;
+		bestIndex = i;
+		if (distance == 0)
+			break;
+	}
+
+	return bestIndex;
+}
+
+void AGOSEngine::fillSimon2LanguageFlagRect(int x1, int y1, int x2, int y2, uint8 color) {
+	Graphics::Surface *screen = getBackendSurface();
+
+	if (x1 > x2) {
+		const int t = x1;
+		x1 = x2;
+		x2 = t;
+	}
+	if (y1 > y2) {
+		const int t = y1;
+		y1 = y2;
+		y2 = t;
+	}
+
+	if (x1 < 0)
+		x1 = 0;
+	if (y1 < 0)
+		y1 = 0;
+	if (x2 >= screen->w)
+		x2 = screen->w - 1;
+	if (y2 >= screen->h)
+		y2 = screen->h - 1;
+	if (x1 > x2 || y1 > y2)
+		return;
+
+	const int width = x2 - x1 + 1;
+	byte *dst = (byte *)screen->getBasePtr(x1, y1);
+	for (int y = y1; y <= y2; ++y) {
+		memset(dst, color, width);
+		dst += screen->pitch;
+	}
+}
+
+void AGOSEngine::restoreSimon2LanguageFlagArea() {
+	if (getGameType() != GType_SIMON2)
+		return;
+
+	Graphics::Surface *screen = getBackendSurface();
+	if (!screen)
+		return;
+
+	const int kFlagX = 10;
+	const int kFlagY = 10;
+	const int kFlagWidth = 24;
+	const int kFlagHeight = 15;
+
+	byte *src = getBackGround() + kFlagX + kFlagY * _backGroundBuf->pitch;
+	byte *dst = (byte *)screen->getBasePtr(kFlagX, kFlagY);
+
+	for (int y = 0; y < kFlagHeight; ++y) {
+		memcpy(dst, src, kFlagWidth);
+		dst += screen->pitch;
+		src += _backGroundBuf->pitch;
+	}
+}
+
+void AGOSEngine::drawSimon2LanguageFlag() {
+	if (getGameType() != GType_SIMON2 || _simon2LanguageFlagTimer == 0)
+		return;
+
+	const uint8 timer = _simon2LanguageFlagTimer;
+	const uint8 fadeIntensity = (timer > 23) ? 255 : (uint8)(timer * 11);
+	uint8 yellowFadeIntensity = (timer > 28) ? 230 : (uint8)(timer * 8);
+	yellowFadeIntensity &= 0xFE;
+
+	const uint8 black = mapRGBToPaletteIndex(0, 0, 0);
+	const uint8 red = mapRGBToPaletteIndex(fadeIntensity, 0, 0);
+	const uint8 white = mapRGBToPaletteIndex(fadeIntensity, fadeIntensity, fadeIntensity);
+	const uint8 blue = mapRGBToPaletteIndex(0, 0, fadeIntensity);
+	const uint8 green = mapRGBToPaletteIndex(0, fadeIntensity, 0);
+	const uint8 yellow = mapRGBToPaletteIndex(yellowFadeIntensity, yellowFadeIntensity, 0);
+
+	switch (_simon2OverlayLanguage) {
+	case Common::EN_ANY:
+		fillSimon2LanguageFlagRect(10, 10, 33, 24, white);
+		fillSimon2LanguageFlagRect(10, 15, 33, 19, red);
+		fillSimon2LanguageFlagRect(19, 10, 24, 24, red);
+		break;
+	case Common::DE_DEU:
+		fillSimon2LanguageFlagRect(10, 10, 33, 14, black);
+		fillSimon2LanguageFlagRect(10, 15, 33, 19, red);
+		fillSimon2LanguageFlagRect(10, 20, 33, 24, yellow);
+		break;
+	case Common::IT_ITA:
+		fillSimon2LanguageFlagRect(10, 10, 17, 24, green);
+		fillSimon2LanguageFlagRect(18, 10, 25, 24, white);
+		fillSimon2LanguageFlagRect(26, 10, 33, 24, red);
+		break;
+	case Common::FR_FRA:
+		fillSimon2LanguageFlagRect(10, 10, 17, 24, blue);
+		fillSimon2LanguageFlagRect(18, 10, 25, 24, white);
+		fillSimon2LanguageFlagRect(26, 10, 33, 24, red);
+		break;
+	default:
+		break;
+	}
+}
+
 void AGOSEngine::displayScreen() {
 	if (_fastFadeInFlag == 0 && _paletteFlag == 1) {
 		_paletteFlag = 0;
@@ -840,6 +965,11 @@ void AGOSEngine::displayScreen() {
 		}
 	}
 
+	if (_simon2LanguageFlagTimer != 0 || _simon2LanguageFlagClearPending)
+		restoreSimon2LanguageFlagArea();
+	drawSimon2LanguageFlag();
+	if (_simon2LanguageFlagClearPending)
+		_simon2LanguageFlagClearPending = false;
 	updateBackendSurface();
 
 	if (getGameType() == GType_FF && _scrollFlag) {
diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp
index 9bafe17778b..d145cb0febc 100644
--- a/engines/agos/event.cpp
+++ b/engines/agos/event.cpp
@@ -690,6 +690,15 @@ void AGOSEngine::timerProc() {
 
 	handleMouseMoved();
 
+	if (_simon2LanguageFlagTimer != 0) {
+		--_simon2LanguageFlagTimer;
+		_displayFlag = 1;
+		if (_simon2LanguageFlagTimer == 0)
+			_simon2LanguageFlagClearPending = true;
+	} else if (_simon2LanguageFlagClearPending) {
+		_displayFlag = 1;
+	}
+
 	if (!(_videoLockOut & 0x10)) {
 		processVgaEvents();
 		processVgaEvents();
diff --git a/engines/agos/input.cpp b/engines/agos/input.cpp
index a0ce90052a4..61b017f3365 100644
--- a/engines/agos/input.cpp
+++ b/engines/agos/input.cpp
@@ -167,7 +167,7 @@ out_of_here:
 
 bool AGOSEngine::isSimon2LanguageToggleKeyPressed() const {
 	return getGameType() == GType_SIMON2 && hasSimon2LanguageFiles() &&
-		(_keyPressed.keycode == Common::KEYCODE_l || _keyPressed.ascii == 'l' || _keyPressed.ascii == 'L');
+		(_keyPressed.keycode == Common::KEYCODE_SPACE);
 }
 
 void AGOSEngine::refreshSimon2LanguageText() {


Commit: e9040d3e431f9d0398fbaa1be57e017d881a6b0d
    https://github.com/scummvm/scummvm/commit/e9040d3e431f9d0398fbaa1be57e017d881a6b0d
Author: Robert Megone (robert.megone at gmail.com)
Date: 2026-04-06T00:18:27+02:00

Commit Message:
AGOS: Simon2 Amiga CD detection entries and midi fix

Changed paths:
    engines/agos/agos.cpp
    engines/agos/detection.cpp
    engines/agos/detection_tables.h
    engines/agos/intern_detection.h


diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 27d8fbd957b..b04b4c230d8 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -273,6 +273,11 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 	_speech = false;
 	_subtitles = false;
 
+	_simon2OverlayLanguage = Common::EN_ANY;
+	_useSimon2LanguageOverlay = false;
+	_simon2LanguageFlagTimer = 0;
+	_simon2LanguageFlagClearPending = false;
+
 	_animatePointer = 0;
 	_maxCursorWidth = 0;
 	_maxCursorHeight = 0;
@@ -625,7 +630,8 @@ Common::Error AGOSEngine::init() {
 
 	_midi = new MidiPlayer(this);
 
-	if ((getGameType() == GType_SIMON2 && getPlatform() == Common::kPlatformWindows) ||
+	if ((getGameType() == GType_SIMON2 && getPlatform() == Common::kPlatformWindows) || 
+			(getGameType() == GType_SIMON2 && getPlatform() == Common::kPlatformAmiga) ||
 			(getGameType() == GType_SIMON1 && getPlatform() == Common::kPlatformWindows) ||
 			((getFeatures() & GF_TALKIE) && getPlatform() == Common::kPlatformAcorn) ||
 			(getPlatform() == Common::kPlatformDOS && getGameType() != GType_PN && getGameType() != GType_FF) ||
@@ -693,6 +699,7 @@ Common::Error AGOSEngine::init() {
 
 	_copyProtection = ConfMan.getBool("copy_protection");
 	_language = Common::parseLanguage(ConfMan.get("language"));
+	_simon2OverlayLanguage = _language;
 	loadSimon2LanguageOverlay();
 
 	if (getGameType() == GType_PP) {
@@ -1098,7 +1105,7 @@ Common::Error AGOSEngine::go() {
 	while (!shouldQuit()) {
 		waitForInput();
 
-		if (getGameType() == GType_SIMON2 && (_keyPressed.keycode == Common::KEYCODE_SPACE || _keyPressed.ascii == ' ' ) && hasSimon2LanguageFiles()) {
+		if (getGameType() == GType_SIMON2 && (_keyPressed.keycode == Common::KEYCODE_SPACE) && hasSimon2LanguageFiles()) {
 			cycleSimon2LanguageOverlay();
 			_keyPressed.reset();
 			continue;
diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp
index 5fdbd3091f7..5d077827dc6 100644
--- a/engines/agos/detection.cpp
+++ b/engines/agos/detection.cpp
@@ -154,8 +154,19 @@ public:
 
 	Common::Error identifyGame(DetectedGame &game, const void **descriptor) override {
 		Engines::upgradeTargetIfNecessary(obsoleteGameIDsTable);
+
+		const bool isSimon2Target = ConfMan.hasKey("gameid") && ConfMan.get("gameid") == "simon2";
+		const bool hadLanguage = ConfMan.hasKey("language");
+		const Common::String originalLanguage = hadLanguage ? ConfMan.get("language") : Common::String();
+
+		if (isSimon2Target && hadLanguage)
+			ConfMan.set("language", Common::getLanguageCode(Common::EN_ANY));
+
 		Common::Error err = AdvancedMetaEngineDetection::identifyGame(game, descriptor);
 
+		if (isSimon2Target && hadLanguage)
+			ConfMan.set("language", originalLanguage);
+
 		if (err.getCode() == Common::kNoError && game.gameId == "simon2" && ConfMan.hasKey("path")) {
 			Common::FSNode gameDir(ConfMan.getPath("path"));
 			applySimon2LanguageGUIOptions(game, gameDir);
diff --git a/engines/agos/detection_tables.h b/engines/agos/detection_tables.h
index d94a826abfc..d5009b46f02 100644
--- a/engines/agos/detection_tables.h
+++ b/engines/agos/detection_tables.h
@@ -2977,6 +2977,58 @@ static const AGOSGameDescription gameDescriptions[] = {
 		GF_TALKIE | GF_MT32_XMIDI | GF_MT32_TRACK10_FIX
 	},
 
+	// Simon the Sorcerer 2 - Amiga CD (Initial Release)
+	{
+		{
+			"simon2",
+			"Amiga CD - Original Release",
+
+			{
+				{ "gsptr30",		GAME_BASEFILE,	"608e277904d87dd28725fa08eacc2c0d", 58652},
+				{ "icon.dat",		GAME_ICONFILE,	"72096a62d36e6034ea9fecc13b2dbdab", 18089},
+				{ "simon2.gme",		GAME_GMEFILE,	"e749c4c103d7e7d51b34620ed76c5a04", 20046789},
+				{ "stripped.txt",	GAME_STRFILE,	"e229f84d46fa83f99b4a7115679f3fb6", 171},
+				{ "tbllist",		GAME_TBLFILE,	"2082f8d02075e590300478853a91ffd9", 513},
+				{ "simon2.german",	GAME_LANGFILE,	"c8c76cac47aced88ac1fe79f4f499914", 216945},
+				AD_LISTEND
+			},
+			Common::EN_ANY,
+			Common::kPlatformAmiga,
+			ADGF_CD,
+			GUIO1(GAMEOPTION_DISABLE_FADE_EFFECTS)
+		},
+
+		GType_SIMON2,
+		GID_SIMON2,
+		GF_TALKIE
+	},
+
+	// Simon the Sorcerer 2 - Amiga CD (Update 5)
+	{
+		{
+			"simon2",
+			"Amiga CD - Update 5",
+
+			{
+				{ "gsptr30",		GAME_BASEFILE,	"608e277904d87dd28725fa08eacc2c0d", 58652},
+				{ "icon.dat",		GAME_ICONFILE,	"72096a62d36e6034ea9fecc13b2dbdab", 18089},
+				{ "simon2.gme",		GAME_GMEFILE,	"e749c4c103d7e7d51b34620ed76c5a04", 20046789},
+				{ "stripped.txt",	GAME_STRFILE,	"e229f84d46fa83f99b4a7115679f3fb6", 171},
+				{ "tbllist",		GAME_TBLFILE,	"2082f8d02075e590300478853a91ffd9", 513},
+				{ "simon2.german",	GAME_LANGFILE,	"011bb9cb526bf30a11f3b1fd3b6682fe", 213383},
+				AD_LISTEND
+			},
+			Common::EN_ANY,
+			Common::kPlatformAmiga,
+			ADGF_CD,
+			GUIO1(GAMEOPTION_DISABLE_FADE_EFFECTS)
+		},
+
+		GType_SIMON2,
+		GID_SIMON2,
+		GF_TALKIE
+	},
+
 	// The Feeble Files - English DOS Demo
 	{
 		{
diff --git a/engines/agos/intern_detection.h b/engines/agos/intern_detection.h
index 9a783d972f6..6cc5170ae3a 100644
--- a/engines/agos/intern_detection.h
+++ b/engines/agos/intern_detection.h
@@ -74,7 +74,8 @@ enum GameFileTypes {
 	GAME_TEXTFILE = 1 << 10,
 	GAME_VGAFILE  = 1 << 11,
 	GAME_GFXIDXFILE = 1 << 12,
-	GAME_CABFILE  = 1 << 13
+	GAME_CABFILE  = 1 << 13,
+	GAME_LANGFILE = 1 << 14
 
 };
 




More information about the Scummvm-git-logs mailing list