[Scummvm-git-logs] scummvm master -> 27bd123278656e2aa112a9bb7d46ca7c5e59b033
eriktorbjorn
noreply at scummvm.org
Wed Feb 23 18:19:52 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:
27bd123278 SCUMM: Rewrite PC Engine Loom dragon workaround
Commit: 27bd123278656e2aa112a9bb7d46ca7c5e59b033
https://github.com/scummvm/scummvm/commit/27bd123278656e2aa112a9bb7d46ca7c5e59b033
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-02-23T19:19:37+01:00
Commit Message:
SCUMM: Rewrite PC Engine Loom dragon workaround
The more I looked at it, the less I liked my old solution. Intercepting
getVar() meant that jumpRelative() would still be called, which made it
sensitive to what getVar() returned when the workaround was active. And
I have no idea how it didn't mess up _scriptPointer somewhere along the
way. So now it's in o5_equalZero() instead, where it can completely
replace the original instruction with o5_breakHere().
Changed paths:
engines/scumm/script_v5.cpp
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index e33d95a55c7..bbba93adbc2 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -361,34 +361,7 @@ void ScummEngine_v5::setupOpcodes() {
}
int ScummEngine_v5::getVar() {
- 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;
+ return readVar(fetchScriptWord());
}
int ScummEngine_v5::getVarOrDirectByte(byte mask) {
@@ -1391,7 +1364,38 @@ void ScummEngine_v5::o5_notEqualZero() {
}
void ScummEngine_v5::o5_equalZero() {
- int a = getVar();
+ const byte *oldaddr = _scriptPointer - 1;
+ int a;
+
+ // 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) {
+ int var = fetchScriptWord();
+ a = readVar(var);
+
+ if (var == 32860 && a == 1 && VAR(VAR_HAVE_MSG)) {
+ _scriptPointer = oldaddr;
+ o5_breakHere();
+ return;
+ }
+ } else {
+ a = getVar();
+ }
+
jumpRelative(a == 0);
}
More information about the Scummvm-git-logs
mailing list