[Scummvm-git-logs] scummvm master -> f66aad48d915d2bf48eea8bf3a2cf0baa6f82432
athrxx
noreply at scummvm.org
Thu May 12 17:00:07 UTC 2022
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
5522beae53 SCUMM: (LOOM) - fix bugs #6011 and #13369
f66aad48d9 SCUMM: (LOOM) - fix/improve comments
Commit: 5522beae5379814c16eed4d2f5e366951b0e60b0
https://github.com/scummvm/scummvm/commit/5522beae5379814c16eed4d2f5e366951b0e60b0
Author: athrxx (athrxx at scummvm.org)
Date: 2022-05-12T19:00:03+02:00
Commit Message:
SCUMM: (LOOM) - fix bugs #6011 and #13369
(try to emulate the behavior of the save script without actually calling it)
Changed paths:
engines/scumm/scumm.cpp
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 34b2157fe9f..c0daf6cb77d 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -2591,24 +2591,51 @@ load_game:
clearCharsetMask();
_charset->_hasMask = false;
- // HACK as in game save stuff isn't supported currently
if (_game.id == GID_LOOM) {
+ // HACK as in game save stuff isn't supported exactly as in the original interpreter when using the
+ // ScummVM save/load dialog. The original save/load screen uses a special script (which we cannot
+ // call without displaying that screen) which will also makes some necessary follow-up operations. We
+ // simply try to achieve that manually. It fixes bugs #6011 and #13369.
+ // We just have to kind of pretend that we've gone through the save/load "room" (with all the right
+ // variables in place), so that all the operations get triggered properly.
+ // The Mac, DOS Talkie and PC-Engine don't have the bugs. We can rely on our old hack there, since
+ // it wouldn't work otherwise, anyway.
int args[NUM_SCRIPT_LOCAL];
- uint var;
memset(args, 0, sizeof(args));
- args[0] = 2;
+ uint saveLoadVar = 100;
if (_game.platform == Common::kPlatformMacintosh)
- var = 105;
- // 256 color CD version and PC engine version
+ saveLoadVar = 105;
else if (_game.platform == Common::kPlatformPCEngine || _game.version == 4)
- var = 150;
- else
- var = 100;
- byte restoreScript = (_game.platform == Common::kPlatformFMTowns) ? 17 : 18;
- // if verbs should be shown restore them
- if (VAR(var) == 2)
+ saveLoadVar = 150;
+
+ // Run this hack only under conditions where the original save script could actually be executed.
+ // Otherwise this would cause all sorts of glitches. Also exclude Mac, PC-Engine and DOS Talkie...
+ if (saveLoadVar == 100 && _userPut > 0 && !isScriptRunning(VAR(VAR_VERB_SCRIPT))) {
+ uint16 prevFlag = VAR(214) & 0x6000;
+ beginCutscene(args);
+ uint16 blockVerbsFlag = VAR(214) & (0x6000 ^ prevFlag);
+ if (Actor *a = derefActor(VAR(VAR_EGO))) {
+ // This is used to restore the correct camera position.
+ VAR(171) = a->_walkbox;
+ VAR(172) = a->getRealPos().x;
+ VAR(173) = a->getRealPos().y;
+ }
+ startScene(70, nullptr, 0);
+ VAR(saveLoadVar) = 0;
+ VAR(214) &= ~blockVerbsFlag;
+ endCutscene();
+ } else if (VAR(saveLoadVar) == 2) {
+ // This is our old hack. If verbs should be shown restore them.
+ byte restoreScript = (_game.platform == Common::kPlatformFMTowns) ? 17 : 18;
+ args[0] = 2;
runScript(restoreScript, 0, 0, args);
+ // Reset two variables, similiar to what the save script would do, to avoid minor glitches
+ // of the verb image on the right of the distaff (image remainung blank when moving the
+ // mouse cursor over an object, bug #13369).
+ VAR(saveLoadVar + 2) = VAR(saveLoadVar + 3) = 0;
+ }
+
} else if (_game.version > 3) {
for (int i = 0; i < _numVerbs; i++)
drawVerb(i, 0);
Commit: f66aad48d915d2bf48eea8bf3a2cf0baa6f82432
https://github.com/scummvm/scummvm/commit/f66aad48d915d2bf48eea8bf3a2cf0baa6f82432
Author: athrxx (athrxx at scummvm.org)
Date: 2022-05-12T19:00:03+02:00
Commit Message:
SCUMM: (LOOM) - fix/improve comments
Changed paths:
engines/scumm/scumm.cpp
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index c0daf6cb77d..9eb1372fd11 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -2598,8 +2598,9 @@ load_game:
// simply try to achieve that manually. It fixes bugs #6011 and #13369.
// We just have to kind of pretend that we've gone through the save/load "room" (with all the right
// variables in place), so that all the operations get triggered properly.
- // The Mac, DOS Talkie and PC-Engine don't have the bugs. We can rely on our old hack there, since
- // it wouldn't work otherwise, anyway.
+ // The glitch with the flask (#6011) seems to be present only in the DOS EGA, Amiga, Atari ST and
+ // FM-Towns versions. Mac, DOS Talkie and PC-Engine don't have that bug. We can rely on our old hack
+ // there, since it wouldn't work otherwise, anyway.
int args[NUM_SCRIPT_LOCAL];
memset(args, 0, sizeof(args));
@@ -2630,8 +2631,8 @@ load_game:
byte restoreScript = (_game.platform == Common::kPlatformFMTowns) ? 17 : 18;
args[0] = 2;
runScript(restoreScript, 0, 0, args);
- // Reset two variables, similiar to what the save script would do, to avoid minor glitches
- // of the verb image on the right of the distaff (image remainung blank when moving the
+ // Reset two variables, similar to what the save script would do, to avoid minor glitches
+ // of the verb image on the right of the distaff (image remaining blank when moving the
// mouse cursor over an object, bug #13369).
VAR(saveLoadVar + 2) = VAR(saveLoadVar + 3) = 0;
}
More information about the Scummvm-git-logs
mailing list