[Scummvm-git-logs] scummvm branch-2-6 -> 48fb69b976077d091220282069273c8a0673a88c
sluicebox
noreply at scummvm.org
Sat Aug 6 20:49:27 UTC 2022
This automated email contains information about 8 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
92a506b793 SCI: Handle alternate bit orders in game flag debug commands
ab9f2db8c1 SCI: Fix KQ5 bandit music fade workaround
714d7c0921 SCI: Fix LONGBOW hedge maze music
afa661cf57 SCI: Reset palette cycling when loading games
4fa236b9c8 SCI: Fix SQ5 WD40 tunnel entrance lockup
ff859c2e4d SCI: Fix SQ5 WD40 missing messages
ad623969d5 SCI: Show all palette cycles on PQ1, PQ3 tile screen
48fb69b976 VIDEO: Fix QuickTime regression with mediaTime and dithering
Commit: 92a506b79319b02c080148d693344335cb300724
https://github.com/scummvm/scummvm/commit/92a506b79319b02c080148d693344335cb300724
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-08-06T16:45:20-04:00
Commit Message:
SCI: Handle alternate bit orders in game flag debug commands
Five games store flags in a different bit order than the rest
Changed paths:
engines/sci/console.cpp
engines/sci/engine/features.cpp
engines/sci/engine/features.h
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 6af90adf3b6..aa95cf313c5 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -4640,7 +4640,12 @@ bool Console::processGameFlagsOperation(GameFlagsOperation op, int argc, const c
continue;
}
uint16 globalValue = globalReg->toUint16();
- uint16 flagMask = 0x8000 >> (flagNumber % 16);
+ uint16 flagMask;
+ if (g_sci->_features->isGameFlagBitOrderNormal()) {
+ flagMask = 0x0001 << (flagNumber % 16);
+ } else {
+ flagMask = 0x8000 >> (flagNumber % 16);
+ }
// set or clear the flag
bool already = false;
diff --git a/engines/sci/engine/features.cpp b/engines/sci/engine/features.cpp
index 5e02bb34d6c..75189fddbe4 100644
--- a/engines/sci/engine/features.cpp
+++ b/engines/sci/engine/features.cpp
@@ -907,13 +907,13 @@ uint16 GameFeatures::getGameFlagsGlobal() const {
case GID_GK2: return 150;
// ICEMAN uses object properties
case GID_ISLANDBRAIN: return 250;
- case GID_LAURABOW: return 440;
- case GID_LAURABOW2: return 186;
case GID_KQ1: return 150;
// KQ4 has no flags
case GID_KQ5: return 129;
case GID_KQ6: return 137;
case GID_KQ7: return 127;
+ case GID_LAURABOW: return 440;
+ case GID_LAURABOW2: return 186;
case GID_LIGHTHOUSE: return 116;
case GID_LONGBOW: return 200;
case GID_LSL1: return 111;
@@ -946,4 +946,18 @@ uint16 GameFeatures::getGameFlagsGlobal() const {
}
}
+bool GameFeatures::isGameFlagBitOrderNormal() const {
+ // Most games store flags in reverse bit order
+ switch (g_sci->getGameId()) {
+ case GID_KQ5:
+ case GID_LAURABOW:
+ case GID_PEPPER:
+ case GID_PQ1:
+ case GID_PQ3:
+ return true;
+ default:
+ return false;
+ }
+}
+
} // End of namespace Sci
diff --git a/engines/sci/engine/features.h b/engines/sci/engine/features.h
index ce9b12b3ff6..0702b007414 100644
--- a/engines/sci/engine/features.h
+++ b/engines/sci/engine/features.h
@@ -290,6 +290,13 @@ public:
*/
uint16 getGameFlagsGlobal() const;
+ /**
+ * Returns the bit order in which game flags are stored.
+ *
+ * @return true if bit order is normal or false if reversed.
+ */
+ bool isGameFlagBitOrderNormal() const;
+
private:
reg_t getDetectionAddr(const Common::String &objName, Selector slc, int methodNum = -1);
Commit: ab9f2db8c19cc608632a4156e0af243c95d361bb
https://github.com/scummvm/scummvm/commit/ab9f2db8c19cc608632a4156e0af243c95d361bb
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-08-06T16:45:28-04:00
Commit Message:
SCI: Fix KQ5 bandit music fade workaround
The existing workaround prevented a crash but it performed volume tests
on an object's offset and abruptly ended the bandit music instead of
fading it out as in the original.
The broken kDoSoundFade call is redundant because a second script calls
kDoSoundFade correctly at the same time. Now the broken call is ignored
and the music fades out normally.
Bug #5078
Changed paths:
engines/sci/engine/workarounds.cpp
engines/sci/sound/soundcmd.cpp
diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index 426a1623647..a621052e96f 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -769,11 +769,11 @@ const SciWorkaroundEntry kDoSoundPlay_workarounds[] = {
// gameID, room,script,lvl, object-name, method-name, local-call-signature, index-range, workaround
const SciWorkaroundEntry kDoSoundFade_workarounds[] = {
- { GID_KQ5, 213, 989, 0, "globalSound3", "fade", nullptr, 0, 0, { WORKAROUND_STILLCALL, 0 } }, // english floppy: when bandits leave the secret temple, parameter 4 is an object - bug #5078
+ { GID_KQ5, 213, 989, 0, "globalSound3", "fade", nullptr, 0, 0, { WORKAROUND_IGNORE, 0 } }, // english floppy: when bandits leave the secret temple, parameter 1 is an object followed by 3 non-existent parameters. Ignore; rideOut2 calls the same fade correctly at the same time - bug #5078
{ GID_KQ6, 105, 989, 0, "globalSound", "fade", nullptr, 0, 0, { WORKAROUND_STILLCALL, 0 } }, // floppy: during intro, parameter 4 is an object
{ GID_KQ6, 460, 989, 0, "globalSound2", "fade", nullptr, 0, 0, { WORKAROUND_STILLCALL, 0 } }, // after pulling the black widow's web on the isle of wonder, parameter 4 is an object - bug #4954
{ GID_QFG4, -1, 64989, 1, "GlorySong", "fade", nullptr, 0, 0, { WORKAROUND_STILLCALL, 0 } }, // CD version: many places, parameter 4 is an object (the sound object itself)
- { GID_SQ5, 800, 989, 0, "sq5Music1", "fade", nullptr, 0, 0, { WORKAROUND_STILLCALL, 0 } }, // when cutting the wrong part of Goliath with the laser - bug #6341
+ { GID_SQ5, 800, 989, 0, "sq5Music1", "fade", nullptr, 0, 0, { WORKAROUND_STILLCALL, 0 } }, // when cutting the wrong part of Goliath with the laser, parameter 4 is an object - bug #6341
SCI_WORKAROUNDENTRY_TERMINATOR
};
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 2d7defd6ff5..4a8edb63c5b 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -488,11 +488,7 @@ reg_t SoundCommandParser::kDoSoundFade(EngineState *s, int argc, reg_t *argv) {
if (musicSlot->fadeTo == musicSlot->volume)
return s->r_acc;
- // Sometimes we get objects in that position, so fix the value (refer to workarounds.cpp)
- if (!argv[1].getSegment())
- musicSlot->fadeStep = volume > musicSlot->fadeTo ? -argv[3].toUint16() : argv[3].toUint16();
- else
- musicSlot->fadeStep = volume > musicSlot->fadeTo ? -5 : 5;
+ musicSlot->fadeStep = volume > musicSlot->fadeTo ? -argv[3].toUint16() : argv[3].toUint16();
musicSlot->fadeTickerStep = argv[2].toUint16() * 16667 / _music->soundGetTempo();
musicSlot->fadeTicker = 0;
Commit: 714d7c092106de429408e989f4359c84ab25e46d
https://github.com/scummvm/scummvm/commit/714d7c092106de429408e989f4359c84ab25e46d
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-08-06T16:45:46-04:00
Commit Message:
SCI: Fix LONGBOW hedge maze music
Fixes bug #13674
Changed paths:
engines/sci/engine/script_patches.cpp
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 1f4ca130d1c..d7d80e5b32a 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -150,6 +150,8 @@ static const char *const selectorNameTable[] = {
"setVol", // Laura Bow 2 CD
"at", // Longbow, QFG4
"owner", // Longbow, QFG4
+ "fade", // Longbow, Shivers
+ "enable", // Longbow, SQ6
"delete", // EcoQuest 1
"size", // EcoQuest 1
"signal", // EcoQuest 1, GK1
@@ -160,7 +162,6 @@ static const char *const selectorNameTable[] = {
"newWith", // SCI2 array script
"posn", // GK1, Phant2, QFG4
"printLang", // GK2
- "fade", // Shivers
"test", // Torin
"get", // Torin, GK1
"normalize", // GK1
@@ -208,7 +209,6 @@ static const char *const selectorNameTable[] = {
"setLooper", // QFG4
"useStamina", // QFG4
"value", // QFG4
- "enable", // SQ6
"setupExit", // SQ6
"vol", // SQ6
"walkIconItem", // SQ6
@@ -286,6 +286,8 @@ enum ScriptPatcherSelectors {
SELECTOR_setVol,
SELECTOR_at,
SELECTOR_owner,
+ SELECTOR_fade,
+ SELECTOR_enable,
SELECTOR_delete,
SELECTOR_size,
SELECTOR_signal,
@@ -297,7 +299,6 @@ enum ScriptPatcherSelectors {
SELECTOR_newWith,
SELECTOR_posn,
SELECTOR_printLang,
- SELECTOR_fade,
SELECTOR_test,
SELECTOR_get,
SELECTOR_normalize,
@@ -345,7 +346,6 @@ enum ScriptPatcherSelectors {
SELECTOR_setLooper,
SELECTOR_useStamina,
SELECTOR_value,
- SELECTOR_enable,
SELECTOR_setupExit,
SELECTOR_vol,
SELECTOR_walkIconItem
@@ -7887,6 +7887,67 @@ static const uint16 longbowPatchMarianMessagesFix[] = {
PATCH_END
};
+// In the abbey hedge maze, the music stops if the interpreter loads the next
+// maze room in under half a second. ScummVM can achieve this on fast machines.
+// When changing maze rooms, the old room sets the music to slowly fade to zero
+// without waiting. The new room then sets the music to fade back in to full
+// volume (127). This has no noticeable effect since the second fade reverts
+// the first almost instantly, but if the new room loads before the fade timer
+// has lowered the volume at all then kDoSoundFade ignores the second fade
+// because the volume is already at the target. The first fade then proceeds to
+// lower the volume to zero and stop the sound, after which it never resumes.
+//
+// We fix this by patching HedgeRow:dispose to only fade out the music when
+// exiting the maze. This doesn't change the music since the fades canceled
+// each other out when changing maze rooms. There is already a nearby check for
+// exiting the maze so this patch re-orders the instructions.
+//
+// Applies to: All versions
+// Responsible method: HedgeRow:dispose
+// Fixes bug: #13674
+static const uint16 longbowSignatureHedgeMazeMusic[] = {
+ SIG_MAGICDWORD,
+ 0x38, SIG_SELECTOR16(fade), // pushi fade
+ 0x39, 0x04, // pushi 04
+ 0x76, // push0
+ 0x39, 0x1e, // pushi 1e
+ 0x39, 0x08, // pushi 08
+ 0x78, // push1
+ 0x81, 0x64, // lag 64
+ 0x4a, 0x0c, // send 0c [ rgnMusic fade: 0 30 8 1 ]
+ 0x38, SIG_SELECTOR16(enable), // pushi enable
+ 0x78, // push1
+ 0x39, 0x05, // pushi 05
+ 0x81, 0x45, // lag 45
+ 0x4a, 0x06, // send 06 [ IconBar enable: 5 ]
+ 0x89, 0x0d, // lsg 0d [ new room ]
+ 0x35, 0x55, // ldi 55 [ max maze room ]
+ 0x1e, // gt? [ exiting hedge maze? ]
+ 0x30, SIG_UINT16(0x0020), // bnt 0020
+ SIG_END
+};
+
+static const uint16 longbowPatchHedgeMazeMusic[] = {
+ 0x38, PATCH_SELECTOR16(enable), // pushi enable
+ 0x78, // push1
+ 0x39, 0x05, // pushi 05
+ 0x81, 0x45, // lag 45
+ 0x4a, 0x06, // send 06 [ IconBar enable: 5 ]
+ 0x89, 0x0d, // lsg 0d [ new room ]
+ 0x35, 0x55, // ldi 55 [ max maze room ]
+ 0x1e, // gt? [ exiting hedge maze? ]
+ 0x30, PATCH_UINT16(0x002f), // bnt 002f
+ 0x38, PATCH_SELECTOR16(fade), // pushi fade
+ 0x39, 0x04, // pushi 04
+ 0x76, // push0
+ 0x39, 0x1e, // pushi 1e
+ 0x39, 0x08, // pushi 08
+ 0x78, // push1
+ 0x81, 0x64, // lag 64
+ 0x4a, 0x0c, // send 0c [ rgnMusic fade: 0 30 8 1 ]
+ PATCH_END
+};
+
// script, description, signature patch
static const SciScriptPatcherEntry longbowSignatures[] = {
{ true, 29, "amiga day 1 peasant woman", 1, longbowSignatureAmigaPeasantWoman, longbowPatchAmigaPeasantWoman},
@@ -7900,6 +7961,7 @@ static const SciScriptPatcherEntry longbowSignatures[] = {
{ true, 320, "day 8 archer pathfinding workaround", 1, longbowSignatureArcherPathfinding, longbowPatchArcherPathfinding },
{ true, 350, "day 9 cobbler hut fix", 10, longbowSignatureCobblerHut, longbowPatchCobblerHut },
{ true, 422, "marian messages fix", 1, longbowSignatureMarianMessagesFix, longbowPatchMarianMessagesFix },
+ { true, 490, "hedge maze music", 1, longbowSignatureHedgeMazeMusic, longbowPatchHedgeMazeMusic },
{ true, 530, "amiga pub fix", 1, longbowSignatureAmigaPubFix, longbowPatchAmigaPubFix },
{ true, 600, "amiga fulk rescue fix", 1, longbowSignatureAmigaFulkRescue, longbowPatchAmigaFulkRescue },
{ true, 803, "amiga speed test", 1, longbowSignatureAmigaSpeedTest, longbowPatchAmigaSpeedTest },
Commit: afa661cf576bf7f7d1cd5ce6d3372dedb5f6762e
https://github.com/scummvm/scummvm/commit/afa661cf576bf7f7d1cd5ce6d3372dedb5f6762e
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-08-06T16:47:51-04:00
Commit Message:
SCI: Reset palette cycling when loading games
Fixes frozen palette animation when loading from within the engine
Changed paths:
engines/sci/engine/savegame.cpp
engines/sci/graphics/palette.cpp
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index a519164f436..895397a4de5 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -845,6 +845,13 @@ void GfxPalette::palVarySaveLoadPalette(Common::Serializer &s, Palette *palette)
}
void GfxPalette::saveLoadWithSerializer(Common::Serializer &s) {
+ if (s.isLoading()) {
+ // Palette cycling schedules must be reset on load because we persist the engine tick count.
+ // Otherwise, loading during cycling leaves the animation stuck until the new lower tick count
+ // reaches the stale scheduled values. (Example: SQ5 Kiz Urazgubi waterfalls)
+ // SSCI didn't persist or reset engine tick count so it didn't need to reset the schedules.
+ _schedules.clear();
+ }
if (s.getVersion() >= 25) {
// We need to save intensity of the _sysPalette at least for kq6 when entering the dark cave (room 390)
// from room 340. scripts will set intensity to 60 for this room and restore them when leaving.
diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp
index 859ce4d464b..40852d7f5b8 100644
--- a/engines/sci/graphics/palette.cpp
+++ b/engines/sci/graphics/palette.cpp
@@ -572,11 +572,10 @@ int16 GfxPalette::kernelFindColor(uint16 r, uint16 g, uint16 b, bool force16BitC
// Returns true, if palette got changed
bool GfxPalette::kernelAnimate(byte fromColor, byte toColor, int speed) {
Color col;
- //byte colorNr;
int16 colorCount;
uint32 now = g_sci->getTickCount();
- // search for sheduled animations with the same 'from' value
+ // search for scheduled animations with the same 'from' value
// schedule animation...
int scheduleCount = _schedules.size();
int scheduleNr;
Commit: 4fa236b9c8be4ed88ab3b1e6a25fc43837df64ed
https://github.com/scummvm/scummvm/commit/4fa236b9c8be4ed88ab3b1e6a25fc43837df64ed
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-08-06T16:47:59-04:00
Commit Message:
SCI: Fix SQ5 WD40 tunnel entrance lockup
Fixes bug #9988
Changed paths:
engines/sci/engine/script_patches.cpp
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index d7d80e5b32a..8d30ed9480f 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -22189,6 +22189,53 @@ static const uint16 sq5PatchTabInventoryCursorFix[] = {
PATCH_END
};
+// In room 310, if WD40 appears while ego is exiting through the left tunnel
+// then the room exits break. When ego is near the tunnel, sWD40Appear waits
+// for seven seconds before calling handsOff. If sExitViaTunnelB is running
+// then handsOff stops ego's exit motion and the room script never completes.
+//
+// We fix this by clearing sWD40Appear:seconds when starting sExitViaTunnelB so
+// that the timer in sWD40Appear state 0 is stopped once ego begins exiting the
+// the room. sWD40Appear already checks that sExitViaTunnelB isn't running in
+// its later states, but it's missing the check in state 1.
+//
+// Applies to: All versions
+// Responsible method: rm310:doit
+// Fixes bug: #9988
+static const uint16 sq5SignatureWd40TunnelLockupFix[] = {
+ 0x72, SIG_ADDTOOFFSET(+2), // lofsa sWD40Appear
+ SIG_ADDTOOFFSET(+15),
+ 0x38, SIG_SELECTOR16(script), // pushi script
+ 0x76, // push0
+ 0x81, 0x02, // lag 02
+ 0x4a, SIG_MAGICDWORD, 0x04, // send 04 [ rm310 script? ]
+ 0x18, // not
+ 0x31, 0x0e, // bnt 0e [ skip sExitViaTunnelB if room has script ]
+ 0x38, SIG_SELECTOR16(setScript), // pushi setScript
+ 0x78, // push1
+ 0x72, SIG_ADDTOOFFSET(+2), // lofsa sExitViaTunnelB
+ 0x36, // push
+ 0x81, 0x02, // lag 02
+ 0x4a, 0x06, // send 06 [ rm310 setScript: sExitViaTunnelB ]
+ SIG_END
+};
+
+static const uint16 sq5PatchWd40TunnelLockupFix[] = {
+ PATCH_ADDTOOFFSET(+18),
+ 0x63, 0x12, // pToa script
+ 0x2f, 0x15, // bt 15 [ skip sExitViaTunnelB if room has script ]
+ 0x38, PATCH_SELECTOR16(setScript), // pushi setScript
+ 0x78, // push1
+ 0x74, PATCH_GETORIGINALUINT16(+34), // lofss sExitViaTunnelB
+ 0x54, 0x06, // self 06 [ self setScript: sExitViaTunnelB ]
+ 0x38, PATCH_SELECTOR16(seconds), // pushi seconds
+ 0x78, // push1
+ 0x76, // push0
+ 0x72, PATCH_GETORIGINALUINT16(+1), // lofsa sWD40Appear
+ 0x4a, 0x06, // send 06 [ sWD40Appear seconds: 0 (stop timer) ]
+ PATCH_END
+};
+
// script, description, signature patch
static const SciScriptPatcherEntry sq5Signatures[] = {
{ true, 0, "tab inventory cursor fix", 1, sq5SignatureTabInventoryCursorFix, sq5PatchTabInventoryCursorFix },
@@ -22197,6 +22244,7 @@ static const SciScriptPatcherEntry sq5Signatures[] = {
{ true, 243, "transporter room speed fix", 3, sq5SignatureTransporterRoomSpeedFix, sq5PatchTransporterRoomSpeedFix },
{ true, 250, "elevator handsOn fix", 1, sq5SignatureElevatorHandsOn, sq5PatchElevatorHandsOn },
{ true, 305, "wd40 fruit fix", 1, sq5SignatureWd40FruitFix, sq5PatchWd40FruitFix },
+ { true, 310, "wd40 tunnel lockup fix", 1, sq5SignatureWd40TunnelLockupFix, sq5PatchWd40TunnelLockupFix },
{ true, 335, "wd40 alarm countdown fix", 1, sq5SignatureWd40AlarmCountdownFix, sq5PatchWd40AlarmCountdownFix },
{ true, 730, "genetix bridge handsOn fix", 1, sq5SignatureGenetixBridgeHandsOn, sq5PatchGenetixBridgeHandsOn },
{ true, 30, "ChoiceTalker lockup fix", 1, sciNarratorLockupSignature, sciNarratorLockupPatch },
Commit: ff859c2e4dea9a6ddfcd54a5463719ba1c7704db
https://github.com/scummvm/scummvm/commit/ff859c2e4dea9a6ddfcd54a5463719ba1c7704db
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-08-06T16:48:06-04:00
Commit Message:
SCI: Fix SQ5 WD40 missing messages
Changed paths:
engines/sci/engine/script_patches.cpp
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 8d30ed9480f..996ce45850c 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -22236,6 +22236,39 @@ static const uint16 sq5PatchWd40TunnelLockupFix[] = {
PATCH_END
};
+// In room 310, clicking Talk or most inventory items on WD40 results in a
+// missing message error. When WD40 is visible, wd40:doVerb passes the incoming
+// verb directly to testMessager:say without first checking if a message exists
+// for the verb. We fix this by setting the noun and modNum as in the other
+// rooms on K.U. and then calling super:doVerb as normal.
+//
+// Applies to: All versions
+// Responsible method: wd40:doVerb
+static const uint16 sq5SignatureWd40MissingMessages[] = {
+ 0x38, SIG_SELECTOR16(say), // pushi say
+ SIG_MAGICDWORD,
+ 0x39, 0x06, // pushi 06
+ 0x39, 0x04, // pushi 04
+ 0x8f, 0x01, // lsp 01
+ 0x76, // push0
+ 0x76, // push0
+ 0x76, // push0
+ 0x38, SIG_UINT16(0x012d), // pushi 012d
+ 0x81, 0x5b, // lag 5b
+ 0x4a, 0x10, // send 10 [ testMessager say: 4 verb 0 0 0 301 ]
+ 0x33, 0x0b, // jmp 0b [ skip super: doVerb verb &rest ]
+ SIG_END
+};
+
+static const uint16 sq5PatchWd40MissingMessages[] = {
+ 0x35, 0x04, // ldi 04
+ 0x65, 0x1a, // aTop noun [ noun = 4 ]
+ 0x34, PATCH_UINT16(0x012d), // ldi 012d
+ 0x65, 0x1c, // aTop modNum [ modNum = 301 ]
+ 0x33, 0x0a, // jmp 0a [ super: doVerb verb &rest ]
+ PATCH_END
+};
+
// script, description, signature patch
static const SciScriptPatcherEntry sq5Signatures[] = {
{ true, 0, "tab inventory cursor fix", 1, sq5SignatureTabInventoryCursorFix, sq5PatchTabInventoryCursorFix },
@@ -22245,6 +22278,7 @@ static const SciScriptPatcherEntry sq5Signatures[] = {
{ true, 250, "elevator handsOn fix", 1, sq5SignatureElevatorHandsOn, sq5PatchElevatorHandsOn },
{ true, 305, "wd40 fruit fix", 1, sq5SignatureWd40FruitFix, sq5PatchWd40FruitFix },
{ true, 310, "wd40 tunnel lockup fix", 1, sq5SignatureWd40TunnelLockupFix, sq5PatchWd40TunnelLockupFix },
+ { true, 310, "wd40 missing messages", 1, sq5SignatureWd40MissingMessages, sq5PatchWd40MissingMessages },
{ true, 335, "wd40 alarm countdown fix", 1, sq5SignatureWd40AlarmCountdownFix, sq5PatchWd40AlarmCountdownFix },
{ true, 730, "genetix bridge handsOn fix", 1, sq5SignatureGenetixBridgeHandsOn, sq5PatchGenetixBridgeHandsOn },
{ true, 30, "ChoiceTalker lockup fix", 1, sciNarratorLockupSignature, sciNarratorLockupPatch },
Commit: ad623969d529363184fd04c9e08f1705956f71d4
https://github.com/scummvm/scummvm/commit/ad623969d529363184fd04c9e08f1705956f71d4
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-08-06T16:48:24-04:00
Commit Message:
SCI: Show all palette cycles on PQ1, PQ3 tile screen
Fixes the police lights on the title screens of each game.
Only one of every eight frames in the palette cycle was appearing.
Thanks to @eriktorbjorn for reporting this
Changed paths:
engines/sci/engine/kgraphics.cpp
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 8595d9248c0..cffec3b31e8 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -698,6 +698,19 @@ reg_t kPaletteAnimate(EngineState *s, int argc, reg_t *argv) {
g_sci->_gfxPalette16->kernelAnimateSet();
}
+ // WORKAROUNDS: kPaletteAnimate produces different results in ScummVM than
+ // the original when multiple calls occur in the same game cycle.
+ // SSCI updated the screen immediately so each call took a noticeable amount
+ // of time and the results of each call were visible.
+ // We generally update the screen on each game cycle; that makes all of the
+ // palette changes appear at once. No extra delay is produced since updating
+ // the palette data by itself takes an insignificant amount of time.
+ // Most scripts that call kPaletteAnimate only do so once per game cycle, so
+ // they are unaffected. Most that call it multiple times achieve practically
+ // the same effect in ScummVM. (Longbow title screen, EcoQuest ocean rooms,
+ // QFG1VGA room 10) But for scripts or effects that depend on the delay,
+ // or seeing each individual update, we currently work around them.
+
// WORKAROUND: The game scripts in SQ4 floppy count the number of elapsed
// cycles in the intro from the number of successive kAnimate calls during
// the palette cycling effect, while showing the SQ4 logo. This worked in
@@ -719,6 +732,25 @@ reg_t kPaletteAnimate(EngineState *s, int argc, reg_t *argv) {
if (g_sci->getGameId() == GID_SQ4 && !g_sci->isCD())
g_sci->sleep(10);
+ // WORKAROUND: PQ1 and PQ3 title screens call kPaletteAnimate eight times
+ // on each game cycle to animate police lights. The effect relies on every
+ // palette change being drawn to the screen instead of just the last one.
+ // We fix this by updating the screen on every call. Normally we would want
+ // to process events to keep the cursor smooth during these lengthy game
+ // cycles, but it doesn't matter here because the cursor is hidden.
+ // We call OSystem::updateScreen() directly to avoid the SCI throttler that
+ // discards multiple updates within 1/60th of a second, as that can lose
+ // some of the animation frames. This is only applied to the VGA version.
+ if ((g_sci->getGameId() == GID_PQ1 && s->currentRoomNumber() == 1) ||
+ (g_sci->getGameId() == GID_PQ3 && s->currentRoomNumber() == 2)) {
+ // PQ1 also cycles the Sierra logo in its room 1, so limit the
+ // workaround to just the police lights.
+ uint16 fromColor = argv[0].toUint16();
+ if (fromColor >= 208 && paletteChanged) {
+ g_system->updateScreen();
+ }
+ }
+
return s->r_acc;
}
Commit: 48fb69b976077d091220282069273c8a0673a88c
https://github.com/scummvm/scummvm/commit/48fb69b976077d091220282069273c8a0673a88c
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2022-08-06T16:48:34-04:00
Commit Message:
VIDEO: Fix QuickTime regression with mediaTime and dithering
Fixes an error when playing a QuickTime video that has a mediaTime set
on its first edit. This was caused by mediaTime changes in:
ef184a6cef98a1756c0669a03fa9b6fa2386b6e7
Those changes buffered frames during initialization so that the keyframe
and other frames don't play instead of the intended start frame that
mediaTime specifies. My mistake was that decoding isn't allowed during
VideoDecoder::loadStream(); VideoDecoder::setDitheringPalette() requires
that no frames have been decoded yet, and at least Director and Mohawk
call that.
Now the initial mediaTime buffering is delayed until the first decode.
Fixes bug #13479 where certain Myst videos error.
Fixes the opening movie in the Director game Chop Suey.
Changed paths:
video/qt_decoder.cpp
video/qt_decoder.h
diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp
index a226f9fb374..dd26b137c17 100644
--- a/video/qt_decoder.cpp
+++ b/video/qt_decoder.cpp
@@ -299,7 +299,8 @@ QuickTimeDecoder::VideoTrackHandler::VideoTrackHandler(QuickTimeDecoder *decoder
_curEdit = 0;
_curFrame = -1;
- enterNewEditListEntry(true); // might set _curFrame
+ _delayedFrameToBufferTo = -1;
+ enterNewEditListEntry(true, true); // might set _curFrame
_durationOverride = -1;
_scaledSurface = 0;
@@ -369,6 +370,8 @@ bool QuickTimeDecoder::VideoTrackHandler::endOfTrack() const {
}
bool QuickTimeDecoder::VideoTrackHandler::seek(const Audio::Timestamp &requestedTime) {
+ _delayedFrameToBufferTo = -1; // abort any delayed buffering
+
uint32 convertedFrames = requestedTime.convertToFramerate(_decoder->_timeScale).totalNumberOfFrames();
for (_curEdit = 0; !atLastEdit(); _curEdit++)
if (convertedFrames >= _parent->editList[_curEdit].timeOffset && convertedFrames < _parent->editList[_curEdit].timeOffset + _parent->editList[_curEdit].trackDuration)
@@ -564,6 +567,8 @@ const byte *QuickTimeDecoder::VideoTrackHandler::getPalette() const {
}
bool QuickTimeDecoder::VideoTrackHandler::setReverse(bool reverse) {
+ _delayedFrameToBufferTo = -1; // abort any delayed buffering
+
_reversed = reverse;
if (_reversed) {
@@ -705,7 +710,7 @@ bool QuickTimeDecoder::VideoTrackHandler::isEmptyEdit() const {
return (_parent->editList[_curEdit].mediaTime == -1);
}
-void QuickTimeDecoder::VideoTrackHandler::enterNewEditListEntry(bool bufferFrames) {
+void QuickTimeDecoder::VideoTrackHandler::enterNewEditListEntry(bool bufferFrames, bool initializingTrack) {
if (atLastEdit())
return;
@@ -749,8 +754,15 @@ void QuickTimeDecoder::VideoTrackHandler::enterNewEditListEntry(bool bufferFrame
// Track down the keyframe
// Then decode until the frame before target
_curFrame = findKeyFrame(frameNum) - 1;
- while (_curFrame < (int32)frameNum - 1)
- bufferNextFrame();
+ if (initializingTrack) {
+ // We can't decode frames during track initialization,
+ // so delay buffering until the first decode.
+ _delayedFrameToBufferTo = (int32)frameNum - 1;
+ } else {
+ while (_curFrame < (int32)frameNum - 1) {
+ bufferNextFrame();
+ }
+ }
} else {
// Since frameNum is the frame that needs to be displayed
// we'll set _curFrame to be the "last frame displayed"
@@ -761,6 +773,16 @@ void QuickTimeDecoder::VideoTrackHandler::enterNewEditListEntry(bool bufferFrame
}
const Graphics::Surface *QuickTimeDecoder::VideoTrackHandler::bufferNextFrame() {
+ // Buffer any frames that were identified during track initialization
+ // and delayed until decoding.
+ if (_delayedFrameToBufferTo != -1) {
+ int32 frameNum = _delayedFrameToBufferTo;
+ _delayedFrameToBufferTo = -1;
+ while (_curFrame < frameNum) {
+ bufferNextFrame();
+ }
+ }
+
_curFrame++;
// Get the next packet
diff --git a/video/qt_decoder.h b/video/qt_decoder.h
index 62496629e1f..581949cca09 100644
--- a/video/qt_decoder.h
+++ b/video/qt_decoder.h
@@ -154,6 +154,7 @@ private:
Common::QuickTimeParser::Track *_parent;
uint32 _curEdit;
int32 _curFrame;
+ int32 _delayedFrameToBufferTo;
uint32 _nextFrameStartTime; // media time
Graphics::Surface *_scaledSurface;
int32 _durationOverride; // media time
@@ -171,7 +172,7 @@ private:
uint32 getCurFrameDuration(); // media time
uint32 findKeyFrame(uint32 frame) const;
bool isEmptyEdit() const;
- void enterNewEditListEntry(bool bufferFrames);
+ void enterNewEditListEntry(bool bufferFrames, bool intializingTrack = false);
const Graphics::Surface *bufferNextFrame();
uint32 getRateAdjustedFrameTime() const; // media time
uint32 getCurEditTimeOffset() const; // media time
More information about the Scummvm-git-logs
mailing list