From 2c8160245460cc9a7a864b58b4e962f7a2c77c4b Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Sun, 28 Feb 2016 21:04:23 +0100 Subject: GOB: Don't completely reset the OPL in AdLib::initOPL() It shouldn't be necessary anymore, since initOPL() cleans everything. If, however, suddenly a piece of music sounds weird in a Gob game, this is the place to look for. This fixes a race condition between OPL::reset() and the callback timer. --- engines/gob/sound/adlib.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/engines/gob/sound/adlib.cpp b/engines/gob/sound/adlib.cpp index 1e024d5a50..2a9a716058 100644 --- a/engines/gob/sound/adlib.cpp +++ b/engines/gob/sound/adlib.cpp @@ -283,7 +283,12 @@ void AdLib::initOPL() { _voiceOn [i] = 0; } - _opl->reset(); + /* NOTE: We used to completely reset the OPL here, via _opl->reset(). However, + * with the OPL timer change in 73e8ac2a, reset() must not be called while + * the callback is still active. With the Gob AdLib rewrite in 03ef6689, + * this reset shouldn't be necessary anymore either, since this function + * here cleans everything properly anyway. If suddenly a certain piece of + * music in a Gob game sounds weird, we need to re-examine that. */ initOperatorVolumes(); resetFreqs(); -- cgit v1.2.3