[Scummvm-cvs-logs] CVS: scummvm/scumm resource.cpp,1.122,1.123 scumm.h,1.285,1.286 scummvm.cpp,2.326,2.327 sound.cpp,1.197,1.198

Travis Howell kirben at users.sourceforge.net
Wed Aug 13 13:07:07 CEST 2003


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

Modified Files:
	resource.cpp scumm.h scummvm.cpp sound.cpp 
Log Message:

Adds finals changes for choice of sound formats in older games.
Only works wit monkeyvga, since ScummVM has it set as version 4.
Remove some old debugging comments


Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -d -r1.122 -r1.123
--- resource.cpp	13 Aug 2003 14:07:56 -0000	1.122
+++ resource.cpp	13 Aug 2003 15:37:28 -0000	1.123
@@ -1487,11 +1487,17 @@
 	//   8 bytes MTrk header
 	//   7 bytes MIDI tempo sysex
 	//     + some default instruments
-	// TODO:  - make some real MIDI instrument definitions
-	//        - proper handling of the short (non-music, SFX) AD resources format
-	//        - check the LE/BE handling for platforms other than PC
 
-	if (ad_offs != 0) {
+	if (((_midiDriver == MD_PCJR) || (_midiDriver == MD_PCSPK)) && wa_offs != 0) {
+		if (_features & GF_OLD_BUNDLE) {
+			_fileHandle.seek(wa_offs, SEEK_SET);
+			_fileHandle.read(createResource(type, idx, wa_size), wa_size);
+		} else {
+			_fileHandle.seek(wa_offs - 6, SEEK_SET);
+			_fileHandle.read(createResource(type, idx, wa_size + 6), wa_size + 6);
+		}
+		return 1;
+	} else if (ad_offs != 0) {
 		byte *ptr;
 		if (_features & GF_OLD_BUNDLE) {
 			ptr = (byte *) calloc(ad_size - 4, 1);

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.285
retrieving revision 1.286
diff -u -d -r1.285 -r1.286
--- scumm.h	13 Aug 2003 14:07:56 -0000	1.285
+++ scumm.h	13 Aug 2003 15:37:28 -0000	1.286
@@ -1002,6 +1002,8 @@
 public:
 	byte _proc_special_palette[256];
 	byte *_shadowPalette;
+	int _midiDriver; // Use the MD_ values from mididrv.h
+
 protected:
 	int _shadowPaletteSize;
 	byte _currentPalette[3 * 256];
@@ -1011,7 +1013,6 @@
 	byte _haveMsg;
 	bool _useTalkAnims;
 	uint16 _defaultTalkDelay;
-	int _midiDriver; // Use the MD_ values from mididrv.h
 	int tempMusic;
 	int _saveSound;
 public:

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.326
retrieving revision 2.327
diff -u -d -r2.326 -r2.327
--- scummvm.cpp	13 Aug 2003 14:07:56 -0000	2.326
+++ scummvm.cpp	13 Aug 2003 15:37:28 -0000	2.327
@@ -612,6 +612,7 @@
 	_mixer->setVolume(kDefaultSFXVolume * kDefaultMasterVolume / 255);
 	_mixer->setMusicVolume(kDefaultMusicVolume);
 
+	warning("_midiDriver is %d", _midiDriver);
 	// Init iMuse
 	_imuse = NULL;
 	_imuseDigital = NULL;
@@ -620,11 +621,14 @@
 		_imuseDigital = new IMuseDigital(this);
 	} else if ((_features & GF_AMIGA) && (_features & GF_OLD_BUNDLE)) {
 		_playerV2 = NULL;
-	} else if (_version <= 2) {
-		if ((_version == 1) && (_gameId == GID_MANIAC))
+	} else if (((_midiDriver == MD_PCJR) || (_midiDriver == MD_PCSPK) && (_version < 5)) || (_version <= 2)) {
+		if ((_version == 1) && (_gameId == GID_MANIAC)) {
 			_playerV2 = NULL;
-		else
+		} else {
 			_playerV2 = new Player_V2(this);
+			if (_midiDriver == MD_PCJR)
+				_playerV2->set_pcjr(false);
+		}
 	} else {
 		_imuse = IMuse::create (syst, _mixer, detector->createMidi());
 		if (_imuse) {

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.197
retrieving revision 1.198
diff -u -d -r1.197 -r1.198
--- sound.cpp	13 Aug 2003 01:46:48 -0000	1.197
+++ sound.cpp	13 Aug 2003 15:37:28 -0000	1.198
@@ -322,65 +322,6 @@
 			return;
 		} else if (_scumm->_features & GF_FMTOWNS) {
 			size = READ_LE_UINT32(ptr);
-#if 0
-			// FIXME - this is just some debug output for Zak256
-			if (size != 30) {
-				char name[9];
-				memcpy(name, ptr+22, 8);
-				name[8] = 0;
-				printf("Going to play Zak256 sound '%s':\n", name);
-				hexdump(ptr, 0x40);
-			}
-			/*
-			There seems to be some pattern in the Zak256 sound data. Two typical
-			examples are these:
-			
-			d7 10 00 00 53 4f d1 10  |....SO..|
-			00 00 00 00 04 00 ff 00  |........|
-			64 00 00 00 01 00 64 6f  |d.....do|
-			6f 72 6f 70 65 6e 40 a8  |oropen at .|
-			57 14 a1 10 00 00 50 08  |W.....P.|
-			00 00 00 00 00 00 b3 07  |........|
-			00 00 3c 00 00 00 04 80  |..<.....|
-			03 02 0a 01 8c 82 87 81  |........|
-	
-			5b 07 00 00 53 4f 55 07  |[...SOU.|
-			00 00 00 00 04 00 ff 00  |........|
-			64 00 00 00 01 00 64 72  |d.....dr|
-			77 6f 70 65 6e 00 53 a8  |wopen.S.|
-			57 14 25 07 00 00 92 03  |W.%.....|
-			00 00 00 00 00 00 88 03  |........|
-			00 00 3c 00 00 00 82 82  |..<.....|
-			83 84 86 88 89 8b 89 89  |........|
-			
-			As you can see, there are quite some patterns, e.g.
-			the "3c 00 00 00" - the sound data starts at offset 0x36
-			
-			Indy 3 uses a different format. The very first sound played
-			in Indy 3 looks as follows:
-			5a 25 00 00 53 4f 54 25  |Z%..SOT%|
-			00 00 53 4f db 0a 00 00  |..SO....|
-			57 41 c8 00 18 00 00 00  |WA......|
-			00 00 00 00 9e 05 00 00  |........|
-			00 00 00 00 fd 32 00 f8  |.....2..|
-			02 f9 08 ff 22 08 00 ff  |...."...|
-			20 5c 00 ff 10 03 00 fd  | \......|
-			64 00 f8 00 f9 00 ff 22  |d......"|
-
-			Indy 3, opening a door:
-			d1 00 00 00 53 4f cb 00  |....SO..|
-			00 00 53 4f a2 00 00 00  |..SO....|
-			57 41 64 00 18 00 00 00  |WAd.....|
-			00 00 00 00 00 00 00 00  |........|
-			00 00 7e 00 f9 0c ff 20  |..~.... |
-			90 01 ff 22 c2 01 ff 0a  |..."....|
-			03 00 ff 04 57 06 ff 00  |....W...|
-			04 00 ff 0a 00 00 ff 00  |........|
-			
-			So there seems to be a "SO" chunk which contains again a SO chunk and a WA chunk.
-			WA probably again contains audio data?
-			*/
-#endif
 			rate = 11025;
 			int type = *(ptr + 0x0D);
 
@@ -512,7 +453,7 @@
 		return;
 	}
 
-	if (_scumm->_version <= 2) {
+	if (((_scumm->_midiDriver == MD_PCJR) || (_scumm->_midiDriver == MD_PCSPK) && (_scumm->_version < 5)) || (_scumm->_version <= 2)) {
 		//TODO: support maniac v1 sounds
 		if ((_scumm->_version == 1) && (_scumm->_gameId == GID_MANIAC)) 
 			return;
@@ -523,8 +464,9 @@
 		if (amigatest) {
 			// TODO: support amiga sounds
 		} else {
-			if (_scumm->_playerV2)
+			if (_scumm->_playerV2) {
 				_scumm->_playerV2->startSound (soundID, ptr);
+			}
 		}
 		return;
 	}





More information about the Scummvm-git-logs mailing list