[Scummvm-cvs-logs] CVS: scummvm/scumm resource.cpp,1.158,1.159

Jochen Hoenicke hoenicke at users.sourceforge.net
Sun Sep 14 08:04:02 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv6043/scumm

Modified Files:
	resource.cpp 
Log Message:
A hack for bug #770581.  This makes the sound much closer to the 
original, but I think to make it completely right a bigger change to
the adlib backend would be necessary.


Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -d -r1.158 -r1.159
--- resource.cpp	11 Sep 2003 10:32:14 -0000	1.158
+++ resource.cpp	14 Sep 2003 15:03:12 -0000	1.159
@@ -1246,7 +1246,10 @@
 			ch = channel[i] - 1;
 			if (ch < 0 || ch > 15)
 				continue;
-			
+
+			if (instr[i*16 + 13])
+				warning("Sound %d instrument %d uses percussion", idx, i);
+
 			debug(4, "Sound %d: instrument %d on channel %d.", 
 				  idx, i, ch);
 			
@@ -1305,7 +1308,7 @@
 		
 		// There is a constant delay of ppqn/3 before the music starts.
 		if (ppqn / 3 >= 128)
-			*ptr++ = (ppqn / 3 >> 7) | 0x80;  
+			*ptr++ = (ppqn / 3 >> 7) | 0x80;
 		*ptr++ = ppqn / 3 & 0x7f;
 		
 		// Now copy the actual music data 
@@ -1488,7 +1491,6 @@
 				delay = mintime - curtime;
 				curtime = mintime;
 	
-				
 				{
 					delay = convert_extraflags(ptr + 30 + 22, src_ptr + 1);
 					delay2 = convert_extraflags(ptr + 30 + 40, src_ptr + 6);
@@ -1512,6 +1514,8 @@
 				{
 					int freq = ((current_instr[ch][1] & 3) << 8)
 						| current_instr[ch][0];
+					if (!freq)
+						freq = 0x80;
 					freq <<= ((current_instr[ch][1] >> 2) & 7) + 1;
 					int note = -11;
 					while (freq >= 0x100) {





More information about the Scummvm-git-logs mailing list