[Scummvm-git-logs] scummvm master -> fea1a2d392aeee8d0e9c20321e5e65d8e806b9d1

bluegr noreply at scummvm.org
Sat May 28 12:32:48 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:
fea1a2d392 SCUMM: Properly stop Wendy's music in MM NES


Commit: fea1a2d392aeee8d0e9c20321e5e65d8e806b9d1
    https://github.com/scummvm/scummvm/commit/fea1a2d392aeee8d0e9c20321e5e65d8e806b9d1
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2022-05-28T15:32:45+03:00

Commit Message:
SCUMM: Properly stop Wendy's music in MM NES

In the NES version of Maniac Mansion, each kid has their own CD player
playing a different background music by default.

Each CD player script does something like this when you turn it off:

(2F) if (!getState04(46)) {
(D8)   printEgo("It's already off.");
(18) } else {
(67)   clearState04(46);
(1A)   Var[224] = 0;  # <==
(3C)   stopSound(71);
(**) }

but Wendy's CD player script is missing the `Var[224] = 0` line, so
although her music was stopped, the game scripts weren't properly aware
of this, and so her music could suddenly resume, such as when entering
and leaving room 3 with her character.

Changed paths:
    engines/scumm/detection_tables.h
    engines/scumm/script_v5.cpp


diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h
index 6eb09820f32..e7915947c62 100644
--- a/engines/scumm/detection_tables.h
+++ b/engines/scumm/detection_tables.h
@@ -158,7 +158,7 @@ static const GameSettings gameVariantsTable[] = {
 	{"maniac", "C64 Demo",   0, GID_MANIAC, 0, 0, MDT_C64, GF_DEMO, Common::kPlatformC64, GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI) },
 	{"maniac", "V1",      "v1", GID_MANIAC, 1, 0, MDT_PCSPK | MDT_PCJR, 0, Common::kPlatformDOS, GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)},
 	{"maniac", "V1 Demo", "v1", GID_MANIAC, 1, 0, MDT_PCSPK | MDT_PCJR, GF_DEMO, Common::kPlatformDOS, GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)},
-	{"maniac", "NES",        0, GID_MANIAC, 1, 0, MDT_NONE,  0, Common::kPlatformNES, GUIO3(GUIO_NOSPEECH, GUIO_NOMIDI, GUIO_NOASPECT)},
+	{"maniac", "NES",        0, GID_MANIAC, 1, 0, MDT_NONE,  0, Common::kPlatformNES, GUIO4(GUIO_NOSPEECH, GUIO_NOMIDI, GUIO_NOASPECT, GUIO_ENHANCEMENTS)},
 	{"maniac", "V2",      "v2", GID_MANIAC, 2, 0, MDT_PCSPK | MDT_PCJR, 0, UNK, GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)},
 	{"maniac", "V2 Demo", "v2", GID_MANIAC, 2, 0, MDT_PCSPK | MDT_PCJR, GF_DEMO, Common::kPlatformDOS, GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)},
 
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index dcd0af96db1..fdb53f49573 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -2401,6 +2401,14 @@ void ScummEngine_v5::o5_stopSound() {
 		return;
 	}
 
+	// WORKAROUND: In MM NES, Wendy's CD player script forgets to update the
+	// music status variable when you stop it. Wendy's music would then
+	// resume when leaving some rooms (such as room 3 with the chandelier),
+	// even though her CD player was off.
+	if (_game.id == GID_MANIAC && _game.platform == Common::kPlatformNES && sound == 75 && vm.slot[_currentScript].number == 50 && VAR(VAR_EGO) == 6 && VAR(224) == sound && _enableEnhancements) {
+		VAR(224) = 0;
+	}
+
 	_sound->stopSound(sound);
 }
 




More information about the Scummvm-git-logs mailing list