[Scummvm-git-logs] scummvm master -> 905a2f35728de8a7978c6915ad276e6fefbcb431
bluegr
noreply at scummvm.org
Sun May 18 01:54:43 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
905a2f3572 SCUMM: INDY3: Backport FM-TOWNS lightning effect from Japanese release
Commit: 905a2f35728de8a7978c6915ad276e6fefbcb431
https://github.com/scummvm/scummvm/commit/905a2f35728de8a7978c6915ad276e6fefbcb431
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-05-18T04:54:39+03:00
Commit Message:
SCUMM: INDY3: Backport FM-TOWNS lightning effect from Japanese release
In Indy3 TOWNS, unlike in the VGA version, Castle Brunwald isn't
illuminated by lightning, when the thunder sound is heard.
But actually, this behavior is only seen in the English FM-TOWNS
releases (and all fan-made translations based on it). The Japanese
release that's on the same CD does have this effect, controlled by
just a few more setState() calls inside script 12-132.
So, this enhancement just backports this change -- although we have
to do it a bit differently, because the Japanese script relied on
some o5_breakHere() calls that we can't really replicate as-is when
injecting workarounds, it seems.
(And yes, the Japanese FM-TOWNS release fixes a few more of the
issues known for years in the English one.)
Changed paths:
engines/scumm/script_v5.cpp
engines/scumm/scumm_v5.h
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index 696dea34601..37dff31a88b 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -2842,6 +2842,8 @@ void ScummEngine_v5::o5_startSound() {
if (VAR_MUSIC_TIMER != 0xFF)
VAR(VAR_MUSIC_TIMER) = 0;
_sound->startSound(sound);
+
+ workaroundIndy3TownsMissingLightningCastle(sound);
}
void ScummEngine_v5::o5_stopMusic() {
@@ -3764,6 +3766,61 @@ void ScummEngine_v5::printPatchedMI1CannibalString(int textSlot, const byte *ptr
printString(textSlot, (const byte *)msg);
}
+void ScummEngine_v5::workaroundIndy3TownsMissingLightningCastle(int sound) {
+ // WORKAROUND: In Indy3 TOWNS, one can hear the thunder sound when arriving
+ // at Castle Brunwald, but the lightning effect on the Castle is missing --
+ // but that's only the case in the _English_ FM-TOWNS release, as the
+ // Japanese release on the same CD does show it (it also has some other
+ // script/resource fixes over the English one). Backport this script fix.
+ if (_game.id == GID_INDY3 && _game.platform == Common::kPlatformFMTowns && _language != Common::JA_JPN &&
+ _currentRoom == 12 && _currentScript != 0xFF && vm.slot[_currentScript].number == 132 &&
+ enhancementEnabled(kEnhVisualChanges)) {
+ // Thunder sound
+ const int expectedSoundId = 58;
+ // Castle Brunwald image
+ const int castleObj = 947;
+ // '0': castle in the dark; '1': castle illuminated by lightning
+ int castleObjState;
+
+ if (sound != expectedSoundId)
+ return;
+
+ // (No reason for this to be missing here, but better safe than sorry)
+ if (whereIsObject(castleObj) != WIO_ROOM)
+ return;
+
+ // Script 12-132 from the Japanese release did it this way:
+ //
+ // setState(947,1);
+ // breakHere();
+ // setState(947,0);
+ // breakHere();
+ //
+ // ...but we can't properly simulate this with breakHere() calls,
+ // here. So, do it a bit differently, by switching the current
+ // state each time a thunder sound is played.
+
+ castleObjState = !getState(castleObj);
+
+ // Since we do things a bit differently, we have to take care not
+ // to stop on an "eternal lightning" effect, once all the thunder
+ // rolls are done. This is controlled by the following variables
+ // in the script, a bit after the current script pointer:
+ //
+ // Local[12]++;
+ // unless (Local[12] > Local[0]) ...
+ if (castleObjState == 1 && vm.localvar[_currentScript][12] + 1 > vm.localvar[_currentScript][0])
+ return;
+
+ // Simulate the full o5_setState() call
+ putState(castleObj, castleObjState);
+ markObjectRectAsDirty(castleObj);
+ if (_bgNeedsRedraw)
+ clearDrawObjectQueue();
+ }
+
+}
+
void ScummEngine_v5::workaroundLoomHetchelDoubleHead(Actor *a, int act) {
// WORKAROUND: In Loom, when Hetchel appears at the forge to help Bobbin, she
// may have two heads for some frames, when she's talking as she's flying.
diff --git a/engines/scumm/scumm_v5.h b/engines/scumm/scumm_v5.h
index 116877df5d7..ce0f94b60c7 100644
--- a/engines/scumm/scumm_v5.h
+++ b/engines/scumm/scumm_v5.h
@@ -93,6 +93,7 @@ protected:
void injectMISESpeech();
+ void workaroundIndy3TownsMissingLightningCastle(int sound);
void workaroundLoomHetchelDoubleHead(Actor *a, int act);
bool workaroundMonkey1JollyRoger(byte callerOpcode, int arg);
More information about the Scummvm-git-logs
mailing list