[Scummvm-cvs-logs] CVS: scummvm/scumm scummvm.cpp,2.100,2.101 sound.cpp,1.104,1.105

Jonathan Gray khalek at users.sourceforge.net
Tue Apr 22 04:35:09 CEST 2003


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

Modified Files:
	scummvm.cpp sound.cpp 
Log Message:
add preliminary bits for making xmi music in humongous games work, just need someone to do something with the pointer now :)

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.100
retrieving revision 2.101
diff -u -d -r2.100 -r2.101
--- scummvm.cpp	22 Apr 2003 04:40:30 -0000	2.100
+++ scummvm.cpp	22 Apr 2003 11:34:46 -0000	2.101
@@ -460,7 +460,10 @@
 		_vars[VAR_VIDEOMODE] = 0x13;
 		_vars[VAR_HEAPSPACE] = 1400;
 		_vars[VAR_MOUSEPRESENT] = true; // FIXME - used to be 0, but that seems odd?!?
-		_vars[VAR_SOUNDPARAM] = 0;
+//		if (_features & GF_HUMONGOUS) // FIXME uncomment when XMI support is added
+//			_vars[VAR_SOUNDPARAM] = 1; // soundblaster for music
+//		else
+			_vars[VAR_SOUNDPARAM] = 0;
 		_vars[VAR_SOUNDPARAM2] = 0;
 		_vars[VAR_SOUNDPARAM3] = 0;
 

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -d -r1.104 -r1.105
--- sound.cpp	12 Apr 2003 19:42:12 -0000	1.104
+++ sound.cpp	22 Apr 2003 11:34:46 -0000	1.105
@@ -222,6 +222,37 @@
 			_scumm->_mixer->playRaw(NULL, sound, size, rate, flags, soundID);
 			return;
 		}
+		// XMI MIDI
+		else if ((READ_UINT32_UNALIGNED(ptr) == MKID('MIDI')) && (_scumm->_features & GF_HUMONGOUS)) {
+			// skip HSHD
+			ptr += 8 + READ_BE_UINT32_UNALIGNED(ptr+12);
+			if (READ_UINT32_UNALIGNED(ptr) != MKID('SDAT'))
+				return; // abort
+			
+			size = READ_BE_UINT32_UNALIGNED(ptr+4) - 8;
+			ptr += 8; // don't need SDAT block anymore
+
+			// XMI playing stuff goes here
+			// ptr should be pointing to XMI file in memory
+
+			// FIXME: dumping xmi files for testing, remove when working
+			if (1) {
+				File out;
+				char buf[64];
+				sprintf(buf, "dumps/sound-%d.xmi", soundID);
+				
+				out.open(buf, "", 1);
+				if (out.isOpen() == false) {
+					out.open(buf, "", 2);
+					if (out.isOpen() == false)
+						return;
+					out.write(ptr, size);
+				}
+				out.close();
+			}
+
+			return;
+		}
 		else if (READ_UINT32_UNALIGNED(ptr) == MKID('Crea')) {
 			_scumm->_imuseDigital->startSound(soundID);
 			return;





More information about the Scummvm-git-logs mailing list