[Scummvm-cvs-logs] CVS: scummvm/backends/midi ym2612.cpp,1.12,1.13

Max Horn fingolfin at users.sourceforge.net
Mon Oct 6 08:27:08 CEST 2003


Update of /cvsroot/scummvm/scummvm/backends/midi
In directory sc8-pr-cvs1:/tmp/cvs-serv23016

Modified Files:
	ym2612.cpp 
Log Message:
removed unused 'rate' param from nextTick; another tiny tweak to Operator2612::nextTick (avoids one memory store over here, woohoo <g>)

Index: ym2612.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/midi/ym2612.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- ym2612.cpp	6 Oct 2003 14:32:22 -0000	1.12
+++ ym2612.cpp	6 Oct 2003 15:26:01 -0000	1.13
@@ -91,7 +91,7 @@
 	void keyOn();
 	void keyOff();
 	void frequency(int freq);
-	void nextTick(uint16 rate, const int *phaseShift, int *outbuf, int buflen);
+	void nextTick(const int *phaseShift, int *outbuf, int buflen);
 };
 
 class Voice2612 {
@@ -325,7 +325,7 @@
 	_releaseRate = (int32) value / _owner->_rate;
 }
 
-void Operator2612::nextTick(uint16 rate, const int *phasebuf, int *outbuf, int buflen) {
+void Operator2612::nextTick(const int *phasebuf, int *outbuf, int buflen) {
 	if (_state == _s_ready)
 		return;
 	if (_state == _s_attacking && _attackTime <= 0) {
@@ -391,7 +391,6 @@
 			}
 
 			if (level < zero_level) {
-				_phase &= 0x3ffff;
 				int phaseShift = *phasebuf >> 2; // Àµ¤·¤¤ÊÑÄ´Î̤Ï?  3 ¤¸¤ã¾®¤µ¤¹¤®¤Ç 2 ¤¸¤ãÂ礭¤¤¤è¤¦¤Ê¡£
 				if (_feedbackLevel)
 					phaseShift += (output << (_feedbackLevel - 1)) / 1024;
@@ -412,6 +411,7 @@
 				output = ((output >> 4) * (powtbl[511-((level>>9)&511)] >> 3)) / 1024;
 
 				_phase += phaseIncrement;
+				_phase &= 0x3ffff;
 			} else
 				output = 0;
 
@@ -523,55 +523,55 @@
 
 	switch (_algorithm) {
 	case 0:
-		_opr[0]->nextTick(_rate, buf1, buf2, buflen);
-		_opr[1]->nextTick(_rate, buf2, buf1, buflen);
+		_opr[0]->nextTick(buf1, buf2, buflen);
+		_opr[1]->nextTick(buf2, buf1, buflen);
 		memset (buf2, 0, sizeof (int) * buflen);
-		_opr[2]->nextTick(_rate, buf1, buf2, buflen);
-		_opr[3]->nextTick(_rate, buf2, outbuf, buflen);
+		_opr[2]->nextTick(buf1, buf2, buflen);
+		_opr[3]->nextTick(buf2, outbuf, buflen);
 		break;
 	case 1:
-		_opr[0]->nextTick(_rate, buf1, buf2, buflen);
-		_opr[1]->nextTick(_rate, buf1, buf2, buflen);
-		_opr[2]->nextTick(_rate, buf2, buf1, buflen);
-		_opr[3]->nextTick(_rate, buf1, outbuf, buflen);
+		_opr[0]->nextTick(buf1, buf2, buflen);
+		_opr[1]->nextTick(buf1, buf2, buflen);
+		_opr[2]->nextTick(buf2, buf1, buflen);
+		_opr[3]->nextTick(buf1, outbuf, buflen);
 		break;
 	case 2:
-		_opr[1]->nextTick(_rate, buf1, buf2, buflen);
-		_opr[2]->nextTick(_rate, buf2, buf1, buflen);
+		_opr[1]->nextTick(buf1, buf2, buflen);
+		_opr[2]->nextTick(buf2, buf1, buflen);
 		memset(buf2, 0, sizeof(int) * buflen);
-		_opr[0]->nextTick(_rate, buf2, buf1, buflen);
-		_opr[3]->nextTick(_rate, buf1, outbuf, buflen);
+		_opr[0]->nextTick(buf2, buf1, buflen);
+		_opr[3]->nextTick(buf1, outbuf, buflen);
 		break;
 	case 3:
-		_opr[0]->nextTick(_rate, buf1, buf2, buflen);
-		_opr[1]->nextTick(_rate, buf2, buf1, buflen);
+		_opr[0]->nextTick(buf1, buf2, buflen);
+		_opr[1]->nextTick(buf2, buf1, buflen);
 		memset(buf2, 0, sizeof(int) * buflen);
-		_opr[2]->nextTick(_rate, buf2, buf1, buflen);
-		_opr[3]->nextTick(_rate, buf1, outbuf, buflen);
+		_opr[2]->nextTick(buf2, buf1, buflen);
+		_opr[3]->nextTick(buf1, outbuf, buflen);
 		break;
 	case 4:
-		_opr[0]->nextTick(_rate, buf1, buf2, buflen);
-		_opr[1]->nextTick(_rate, buf2, outbuf, buflen);
-		_opr[2]->nextTick(_rate, buf1, buf1, buflen);
-		_opr[3]->nextTick(_rate, buf1, outbuf, buflen);
+		_opr[0]->nextTick(buf1, buf2, buflen);
+		_opr[1]->nextTick(buf2, outbuf, buflen);
+		_opr[2]->nextTick(buf1, buf1, buflen);
+		_opr[3]->nextTick(buf1, outbuf, buflen);
 		break;
 	case 5:
-		_opr[0]->nextTick(_rate, buf1, buf2, buflen);
-		_opr[1]->nextTick(_rate, buf2, outbuf, buflen);
-		_opr[2]->nextTick(_rate, buf2, outbuf, buflen);
-		_opr[3]->nextTick(_rate, buf2, outbuf, buflen);
+		_opr[0]->nextTick(buf1, buf2, buflen);
+		_opr[1]->nextTick(buf2, outbuf, buflen);
+		_opr[2]->nextTick(buf2, outbuf, buflen);
+		_opr[3]->nextTick(buf2, outbuf, buflen);
 		break;
 	case 6:
-		_opr[0]->nextTick(_rate, buf1, buf2, buflen);
-		_opr[1]->nextTick(_rate, buf2, outbuf, buflen);
-		_opr[2]->nextTick(_rate, buf1, outbuf, buflen);
-		_opr[3]->nextTick(_rate, buf1, outbuf, buflen);
+		_opr[0]->nextTick(buf1, buf2, buflen);
+		_opr[1]->nextTick(buf2, outbuf, buflen);
+		_opr[2]->nextTick(buf1, outbuf, buflen);
+		_opr[3]->nextTick(buf1, outbuf, buflen);
 		break;
 	case 7:
-		_opr[0]->nextTick(_rate, buf1, outbuf, buflen);
-		_opr[1]->nextTick(_rate, buf1, outbuf, buflen);
-		_opr[2]->nextTick(_rate, buf1, outbuf, buflen);
-		_opr[3]->nextTick(_rate, buf1, outbuf, buflen);
+		_opr[0]->nextTick(buf1, outbuf, buflen);
+		_opr[1]->nextTick(buf1, outbuf, buflen);
+		_opr[2]->nextTick(buf1, outbuf, buflen);
+		_opr[3]->nextTick(buf1, outbuf, buflen);
 		break;
 	};
 }





More information about the Scummvm-git-logs mailing list