[Scummvm-cvs-logs] scummvm master -> 0c1665820bf91aba10adf9abd7bca286b7c17982

eriktorbjorn eriktorbjorn at telia.com
Fri Jun 10 19:45:35 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0c1665820b AGI: Experimental fix for bug #3292778 ("SQ2: Music missing notes")


Commit: 0c1665820bf91aba10adf9abd7bca286b7c17982
    https://github.com/scummvm/scummvm/commit/0c1665820bf91aba10adf9abd7bca286b7c17982
Author: eriktorbjorn (eriktorbjorn at users.sourceforge.net)
Date: 2011-06-10T10:41:31-07:00

Commit Message:
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.

Changed paths:
    engines/agi/sound_pcjr.cpp



diff --git a/engines/agi/sound_pcjr.cpp b/engines/agi/sound_pcjr.cpp
index 319b704..fdebf16 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;






More information about the Scummvm-git-logs mailing list