aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/gob/sound/adlib.cpp8
-rw-r--r--engines/gob/sound/adlib.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/engines/gob/sound/adlib.cpp b/engines/gob/sound/adlib.cpp
index 3f46f6cf4b..d9fc362547 100644
--- a/engines/gob/sound/adlib.cpp
+++ b/engines/gob/sound/adlib.cpp
@@ -98,6 +98,8 @@ AdLib::AdLib(Audio::Mixer &mixer) : _mixer(&mixer), _opl(0),
_rate = _mixer->getOutputRate();
+ initFreqs();
+
createOPL();
initOPL();
@@ -295,7 +297,7 @@ void AdLib::initOPL() {
_opl->reset();
initOperatorVolumes();
- initFreqs();
+ resetFreqs();
setPercussionMode(false);
@@ -581,6 +583,10 @@ void AdLib::initFreqs() {
for (int i = 0; i < kPitchStepCount; i++)
setFreqs(_freqs[i], i * numStep, 100);
+ resetFreqs();
+}
+
+void AdLib::resetFreqs() {
for (int i = 0; i < kMaxVoiceCount; i++) {
_freqPtr [i] = _freqs[0];
_halfToneOffset[i] = 0;
diff --git a/engines/gob/sound/adlib.h b/engines/gob/sound/adlib.h
index 17ab950752..bd1778d2ed 100644
--- a/engines/gob/sound/adlib.h
+++ b/engines/gob/sound/adlib.h
@@ -295,6 +295,7 @@ private:
void initFreqs();
void setFreqs(uint16 *freqs, int32 num, int32 denom);
int32 calcFreq(int32 deltaDemiToneNum, int32 deltaDemiToneDenom);
+ void resetFreqs();
void changePitch(uint8 voice, uint16 pitchBend);