diff --git a/simon/simon.cpp b/simon/simon.cpp index de26fc38c80..03dd39a8261 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -154,7 +154,9 @@ SimonState::SimonState(GameDetector *detector, OSystem *syst) _voice_sound = 0; _ambient_sound = 0; - _music_playing = false; + _effects_paused = false; + _ambient_paused = false; + _music_paused = false; } SimonState::~SimonState() @@ -4615,7 +4617,18 @@ void SimonState::delay(uint amount) } else if (event.kbd.keycode == '-') { midi.set_volume(midi.get_volume() - 10); } else if (event.kbd.keycode == 'm') { - midi.pause(_music_playing ^= 1); + midi.pause(_music_paused ^= 1); + } else if (event.kbd.keycode == 's') { + _effects_paused ^= 1; + } else if (event.kbd.keycode == 'b') { + _ambient_paused ^= 1; + if (_ambient_paused && _ambient_playing) { + _mixer->stop(_ambient_index); + } else if (_ambient_playing) { + uint tmp = _ambient_playing; + _ambient_playing = 0; + playAmbient(tmp); + } } else if (event.kbd.flags == OSystem::KBD_CTRL) { if (event.kbd.keycode == 'f') { _fast_mode ^= 1; @@ -5140,6 +5153,9 @@ void SimonState::playEffects(uint sound) if (_effects_offsets == NULL) return; + if (_effects_paused) + return; + if (_game == GAME_SIMON1TALKIE) { /* simon 1 talkie */ #ifdef USE_MAD if (_effects_type == FORMAT_MP3) { @@ -5166,6 +5182,9 @@ void SimonState::playAmbient(uint sound) if (_effects_offsets == NULL) return; + if (_ambient_paused) + return; + if (sound == _ambient_playing) return; diff --git a/simon/simon.h b/simon/simon.h index 992b47ece84..30c8cc93379 100644 --- a/simon/simon.h +++ b/simon/simon.h @@ -341,7 +341,9 @@ public: int _ambient_index; uint _ambient_playing; - bool _music_playing; + bool _effects_paused; + bool _ambient_paused; + bool _music_paused; int _timer_id; diff --git a/simon/vga.cpp b/simon/vga.cpp index a0c322842fd..541c952d83c 100644 --- a/simon/vga.cpp +++ b/simon/vga.cpp @@ -1345,6 +1345,7 @@ void SimonState::vc_28() void SimonState::vc_29_stop_all_sounds() { _mixer->stopAll(); + _ambient_playing = 0; } void SimonState::vc_30_set_base_delay()