[Scummvm-cvs-logs] scummvm master -> 50f3085c994ccb123c069cbfa988ea60c3b96c7e

m-kiewitz m_kiewitz at users.sourceforge.net
Tue Jan 19 03:47:38 CET 2016


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:
50f3085c99 AGI: reverse Apple IIgs stereo cleanup


Commit: 50f3085c994ccb123c069cbfa988ea60c3b96c7e
    https://github.com/scummvm/scummvm/commit/50f3085c994ccb123c069cbfa988ea60c3b96c7e
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2016-01-19T03:46:29+01:00

Commit Message:
AGI: reverse Apple IIgs stereo cleanup

Changed paths:
    engines/agi/sound_2gs.cpp



diff --git a/engines/agi/sound_2gs.cpp b/engines/agi/sound_2gs.cpp
index af1ff43..7174d31 100644
--- a/engines/agi/sound_2gs.cpp
+++ b/engines/agi/sound_2gs.cpp
@@ -145,8 +145,8 @@ uint SoundGen2GS::generateOutput() {
 	int16 *p = _out;
 	int n = _outSize;
 	while (n--) {
-		int outl = 0;
-		int outr = 0;
+		int outLeft = 0;
+		int outRight = 0;
 		for (int k = 0; k < MAX_GENERATORS; k++) {
 			IIgsGenerator *g = &_generators[k];
 			if (!g->ins)
@@ -211,27 +211,27 @@ uint SoundGen2GS::generateOutput() {
 
 			// Select output channel.
 			if (g->osc[0].rightChannel)
-				outl += s0;
+				outRight += s0;
 			else
-				outr += s0;
+				outLeft += s0;
 
 			if (g->osc[1].rightChannel)
-				outl += s1;
+				outRight += s1;
 			else
-				outr += s1;
+				outLeft += s1;
 		}
 
-		if (outl > 32768)
-			outl = 32768;
-		if (outl < -32767)
-			outl = -32767;
-		if (outr > 32768)
-			outr = 32768;
-		if (outr < -32767)
-			outr = -32767;
-
-		*p++ = outl;
-		*p++ = outr;
+		if (outLeft > 32768)
+			outLeft = 32768;
+		if (outLeft < -32767)
+			outLeft = -32767;
+		if (outRight > 32768)
+			outRight = 32768;
+		if (outRight < -32767)
+			outRight = -32767;
+
+		*p++ = outLeft;
+		*p++ = outRight;
 	}
 
 	return _outSize * 2;
@@ -552,10 +552,10 @@ bool IIgsInstrumentHeader::read(Common::SeekableReadStream &stream, bool ignoreA
 			wave[i][k].loop = !(b & 0x2);		// Bit 1     =!LOOP
 			wave[i][k].swap = (b & 0x6) == 0x6;	// Bit 1&2   = SWAP
 			// channels seem to be reversed, verified with emulator + captured apple IIgs music
-			if (b >> 4) {
-				wave[i][k].rightChannel = false; // Bit 4 set = left channel
+			if (b & 0x10) {
+				wave[i][k].rightChannel = true; // Bit 4 set = right channel
 			} else {
-				wave[i][k].rightChannel = true; // Bit 4 not set = right channel
+				wave[i][k].rightChannel = false; // Bit 4 not set = left channel
 			}
 		}
 	}






More information about the Scummvm-git-logs mailing list