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

eriktorbjorn noreply at scummvm.org
Wed Feb 23 15:36:01 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:
1d71a2859c SCUMM: Work around TurboGrafx-16 / PC Engine Loom glitch


Commit: 1d71a2859c1e5e08f2dfe4488d39c59b9421f17c
    https://github.com/scummvm/scummvm/commit/1d71a2859c1e5e08f2dfe4488d39c59b9421f17c
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-23T16:35:58+01:00

Commit Message:
SCUMM: Work around TurboGrafx-16 / PC Engine Loom glitch

When examining the dragon's pile of gold a second time, the "Wow!"
message was not visible. This appears to be a scripting bug particular
to this version (it works in the EGA version), and we work around it by
simulating a WaitForMessage() instruction after the message is printed.

Changed paths:
    engines/scumm/script_v5.cpp


diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index f485e7f8542..e33d95a55c7 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -361,7 +361,34 @@ void ScummEngine_v5::setupOpcodes() {
 }
 
 int ScummEngine_v5::getVar() {
-	return readVar(fetchScriptWord());
+	const byte *oldaddr = _scriptPointer - 1;
+
+	uint var = fetchScriptWord();
+	int result = readVar(var);
+
+	// WORKAROUND: Examining the dragon's pile of gold a second time causes
+	// Bobbin to animate as if he's talking, but no text is displayed. When
+	// running the game in an emulator, there's neither text nor animation
+	// when examining the pile again. While the symptoms are slightly
+	// different, this points to a script bug.
+	//
+	// I think this happens because in the PC Engine version the entire
+	// scene is a cutscene. In the EGA version, only the part where the
+	// dragon responds is. So the cutscene starts, the message is printed
+	// and then the cutscene immediately ends, which triggers an "end of
+	// cutscene" script. This is probably what clears the text.
+	//
+	// The script sets Bit[92] to indicate that the dragon has responded.
+	// If the bit has been set, we simulate a WaitForMessage() instruction
+	// here, so that the script pauses until the "Wow!" message is gone.
+
+	if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine && vm.slot[_currentScript].number == 109 && var == 32860 && result == 1 && VAR(VAR_HAVE_MSG)) {
+		_scriptPointer = oldaddr;
+		o5_breakHere();
+		return 0;
+	}
+
+	return result;
 }
 
 int ScummEngine_v5::getVarOrDirectByte(byte mask) {




More information about the Scummvm-git-logs mailing list