From 0c1665820bf91aba10adf9abd7bca286b7c17982 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Fri, 10 Jun 2011 19:41:31 +0200 Subject: AGI: Experimental fix for bug #3292778 ("SQ2: Music missing notes") The idea here is that if two voices are generating the same tone, the square wave generator should be in sync so that the wave forms amplify each other, rather than cancelling each other out. --- engines/agi/sound_pcjr.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines') diff --git a/engines/agi/sound_pcjr.cpp b/engines/agi/sound_pcjr.cpp index 319b7049ed..fdebf16b1a 100644 --- a/engines/agi/sound_pcjr.cpp +++ b/engines/agi/sound_pcjr.cpp @@ -219,6 +219,7 @@ int SoundGenPCJr::volumeCalc(SndGenChan *chan) { // return 0 if it's passing more data // return -1 if it's passing nothing (end of data) int SoundGenPCJr::getNextNote(int ch, Tone *tone) { + ToneChan *tpcm; SndGenChan *chan; const byte *data; @@ -228,6 +229,7 @@ int SoundGenPCJr::getNextNote(int ch, Tone *tone) { if (!_vm->getflag(fSoundOn)) return -1; + tpcm = &_tchannel[ch]; chan = &_channel[ch]; if (!chan->avail) return -1; @@ -241,6 +243,9 @@ int SoundGenPCJr::getNextNote(int ch, Tone *tone) { // if it's 0 then it's not going to be played // if it's 0xFFFF then the channel data has finished. if ((chan->duration != 0) && (chan->duration != 0xFFFF)) { + tpcm->genTypePrev = -1; + tpcm->freqCountPrev = -1; + // only tone channels dissolve if ((ch != 3) && (_dissolveMethod != 0)) // != noise?? chan->dissolveCount = 0; -- cgit v1.2.3