From 4ecee0e0f254ad1023f950190bfcc03f3b0341cf Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Fri, 12 May 2006 10:29:58 +0000 Subject: In Simon 1, when returning to normal size, the MIDI music contains "All Controllers Off" messages. This should, among other things, reset the channel volume to 100. Until now, however, we did not re-adjust the volume by the master volume (like we do for ordinary volume control changes), so all of a sudden there would be channels playing at the wrong volume. This was particularly noticeable if you first turned down the music volume to really low. svn-id: r22412 --- engines/simon/midi.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'engines') diff --git a/engines/simon/midi.cpp b/engines/simon/midi.cpp index c96ee7336f..108936d255 100644 --- a/engines/simon/midi.cpp +++ b/engines/simon/midi.cpp @@ -110,6 +110,12 @@ void MidiPlayer::send(uint32 b) { // has already been allocated. if (!_current->channel[b & 0x0F]) return; + } else if ((b & 0xFFF0) == 0x79B0) { + // A minimum implementation of "All controllers off" should set + // the volume to 100. We have to make sure that volume is + // re-adjusted by the master volume afterwards. This happens in + // Simon 1, on eating the mushroom to turn back to normal size. + _current->volume[channel] = 100; } if (!_current->channel[channel]) @@ -118,6 +124,8 @@ void MidiPlayer::send(uint32 b) { if (channel == 9) _current->channel[9]->volume(_current->volume[9] * _masterVolume / 255); _current->channel[channel]->send(b); + if ((b & 0xFFF0) == 0x79B0) + _current->channel[channel]->volume(_current->volume[channel] * _masterVolume / 255); } } -- cgit v1.2.3