[Scummvm-cvs-logs] SF.net SVN: scummvm: [20984] scummvm/trunk/engines/kyra/sound_adlib.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Tue Feb 28 23:23:00 CET 2006


Revision: 20984
Author:   eriktorbjorn
Date:     2006-02-28 23:21:51 -0800 (Tue, 28 Feb 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm?rev=20984&view=rev

Log Message:
-----------
Cleaned up updateCallback35() and renamed it setAMDepth(). It looks like the
_unkOutputByte2 variable is there to keep track of the current value of the
BD register (AM Depth / Vibrato Depth / Rhythm)

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/sound_adlib.cpp
Modified: scummvm/trunk/engines/kyra/sound_adlib.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_adlib.cpp	2006-03-01 06:56:53 UTC (rev 20983)
+++ scummvm/trunk/engines/kyra/sound_adlib.cpp	2006-03-01 07:21:51 UTC (rev 20984)
@@ -219,7 +219,7 @@
 	int updateCallback32(uint8 *&dataptr, OutputState &state, uint8 value);
 	int updateCallback33(uint8 *&dataptr, OutputState &state, uint8 value);
 	int updateCallback34(uint8 *&dataptr, OutputState &state, uint8 value);
-	int updateCallback35(uint8 *&dataptr, OutputState &state, uint8 value);
+	int setAMDepth(uint8 *&dataptr, OutputState &state, uint8 value);
 	int updateCallback36(uint8 *&dataptr, OutputState &state, uint8 value);
 	int updateCallback37(uint8 *&dataptr, OutputState &state, uint8 value);
 	int updateCallback38(uint8 *&dataptr, OutputState &state, uint8 value);
@@ -1201,12 +1201,13 @@
 	return 0;
 }
 
-int AdlibDriver::updateCallback35(uint8 *&dataptr, OutputState &state, uint8 value) {
-	value &= 1;
-	value <<= 7;
-	_unkOutputByte2 = (_unkOutputByte2 & 0x7F) | value;
+int AdlibDriver::setAMDepth(uint8 *&dataptr, OutputState &state, uint8 value) {
+	if (value & 1)
+		_unkOutputByte2 |= 0x80;
+	else
+		_unkOutputByte2 &= 0x7F;
 
-	// AM depth / Vibrato depth / Rhythm control
+	// The AM Depth bit is set or cleared, the others remain unchanged
 	output0x388(0xBD00 | _unkOutputByte2);
 	return 0;
 }
@@ -1740,7 +1741,7 @@
 	// 44
 	COMMAND(updateCallback33),
 	COMMAND(updateCallback34),
-	COMMAND(updateCallback35),
+	COMMAND(setAMDepth),
 	COMMAND(updateCallback36),
 
 	// 48







More information about the Scummvm-git-logs mailing list