[Scummvm-cvs-logs] SF.net SVN: scummvm:[52323] scummvm/trunk/engines/tinsel

sev at users.sourceforge.net sev at users.sourceforge.net
Tue Aug 24 11:46:17 CEST 2010


Revision: 52323
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52323&view=rev
Author:   sev
Date:     2010-08-24 09:46:17 +0000 (Tue, 24 Aug 2010)

Log Message:
-----------
TINSEL: Partial fix for MIDI in German release.

Bug #2827022: "DW: Enhanced music doesn't work". This release
has completely different MIDI.DAT file. So far offsets and detection
for this version were added. The mapping has to be confirmed with
James Woodcock.

Modified Paths:
--------------
    scummvm/trunk/engines/tinsel/detection_tables.h
    scummvm/trunk/engines/tinsel/music.cpp
    scummvm/trunk/engines/tinsel/tinsel.h

Modified: scummvm/trunk/engines/tinsel/detection_tables.h
===================================================================
--- scummvm/trunk/engines/tinsel/detection_tables.h	2010-08-24 09:43:37 UTC (rev 52322)
+++ scummvm/trunk/engines/tinsel/detection_tables.h	2010-08-24 09:46:17 UTC (rev 52323)
@@ -394,7 +394,7 @@
 		},
 		GID_DW1,
 		0,
-		GF_CD | GF_SCNFILES | GF_ENHANCED_AUDIO_SUPPORT,
+		GF_CD | GF_SCNFILES | GF_ENHANCED_AUDIO_SUPPORT | GF_ALT_MIDI,
 		TINSEL_V1,
 	},
 

Modified: scummvm/trunk/engines/tinsel/music.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/music.cpp	2010-08-24 09:43:37 UTC (rev 52322)
+++ scummvm/trunk/engines/tinsel/music.cpp	2010-08-24 09:46:17 UTC (rev 52323)
@@ -107,6 +107,26 @@
 	869822,	875436,	877234,	879818
 };
 
+// Alternative version used in German CD re-release "Neon Edition"
+static const SCNHANDLE midiOffsetsSCNVersionALT[] = {
+		4, 	4504, 	11762, 	21532, 	26070, 	28754, 	33254, 40512, 56310, 59066,
+	 61822, 	64354, 64864, 69402, 74184, 76470, 81252, 89668, 105466, 117396,
+	129326, 130130, 132496, 134862, 137228, 139594, 141960, 152474, 154840, 157206,
+	169724, 177068, 184412, 196930, 201202, 201864, 208456, 208958, 218956, 228954,
+	229458, 230152, 239458, 248764, 252880, 253394, 254954, 256514, 266914, 272514,
+	278114, 287388, 301826, 308412, 315882, 317410, 323086, 328762, 335680, 340464,
+	340754, 343872, 346990, 350108, 353226, 360216, 363334, 364416, 365498, 373960,
+	378366, 386828, 388214, 398964, 400046, 400754, 403554, 405082, 407882, 422438,
+	423540, 424642, 429212, 437628, 438478, 445600, 456234, 466868, 476918, 490892,
+	495428, 501856, 505400, 511828, 513878, 526016, 530412, 531734, 539764, 544518,
+	555306, 566164, 570918, 571604, 573038, 573920, 576448, 580414, 581218, 588838,
+	592676, 607064, 611062, 620146, 622902, 625658, 629500, 633342, 637184, 639940,
+	654496, 669052, 673634, 687830, 688052, 689018, 690552, 690774, 700544, 710314,
+	720084, 729854, 739624, 749394, 759164, 768934, 778704, 788474, 798244, 808014,
+	817198, 830488, 831526, 837916, 839526, 841136, 841988, 846698, 851268, 854024,
+	859638, 861436, 864020
+};
+
 static const int enhancedAudioGRAVersion[] = {
 	 1,   2,   1,   1,   3,   3,   4,   4,   5,   6, //   1-10
 	 1,   7,   8,   9,  10,   3,  11,  11,  12,  13, //  11-20
@@ -144,8 +164,33 @@
 	  97,  98,  99,   99                             	// 151-154
 };
 
+// TODO. This mapping is wrong
+static const int enhancedAudioSCNVersionALT[] = {
+	 301, 302,   2,    1,   1, 301, 302,   3,   3,   4,	//   1-10
+	   4,   5,   6,    1,   7,   8,   9,  10,   8,  11,	//  11-20
+	  11,  12,  13,   13,  13,  13,  13,  14,  13,  13,	//  21-30
+	  15,  16,  17,   15,  18,  19,  20, 338,  21,  21,	//  31-40
+	 341, 342,  22,   22,  23,  24,  25,  26,  27,  28,	//  41-50
+	  29,  30,  31,   32,  33,  34,  35,  35,  36,  37,	//  51-60
+	  38,  39,  39,   39,  39,  40,  39,  41,  41,  42,	//  61-70
+	  43,  42,  44,   45,  41,  46,  48,  47,  48,  49,	//  71-80
+	  50,  51,  52,   53,  54,  55,  56,  57,  58,  59,	//  81-90
+	  60,  61,  62,   63,  61,  64,  65,  66,  67,  68,	//  91-100
+	  69,  70,  68,   71,  72,  73,  74,  75,  12,  76,	// 101-110
+	  77,  78,  79,   80,   4,   4,  82,  83,  77,   4,	// 111-120
+	  84,  85,  86, 3124,  88,  89,  90,  88,   2,   2,	// 121-130
+	   2,   2,   2,    2,   2,   2,   2,   2,   2,   2,	// 131-140
+	3141,  91,  92,   93,  94,  94,  95,  96,  52,   4,	// 141-150
+	  97,  98,  99		                             	// 151-153
+};
+
 int GetTrackNumber(SCNHANDLE hMidi) {
-	if (_vm->getFeatures() & GF_SCNFILES) {
+	if (_vm->getFeatures() & GF_ALT_MIDI) {
+		for (int i = 0; i < ARRAYSIZE(midiOffsetsSCNVersionALT); i++) {
+			if (midiOffsetsSCNVersionALT[i] == hMidi)
+				return i;
+		}
+	} else if (_vm->getFeatures() & GF_SCNFILES) {
 		for (int i = 0; i < ARRAYSIZE(midiOffsetsSCNVersion); i++) {
 			if (midiOffsetsSCNVersion[i] == hMidi)
 				return i;
@@ -199,7 +244,9 @@
 		int trackNumber = GetTrackNumber(dwFileOffset);
 		int track = 0;
 		if (trackNumber >= 0) {
-			if (_vm->getFeatures() & GF_SCNFILES)
+			if (_vm->getFeatures() & GF_ALT_MIDI)
+				track = enhancedAudioSCNVersionALT[trackNumber];
+			else if (_vm->getFeatures() & GF_SCNFILES)
 				track = enhancedAudioSCNVersion[trackNumber];
 			else
 				track = enhancedAudioGRAVersion[trackNumber];

Modified: scummvm/trunk/engines/tinsel/tinsel.h
===================================================================
--- scummvm/trunk/engines/tinsel/tinsel.h	2010-08-24 09:43:37 UTC (rev 52322)
+++ scummvm/trunk/engines/tinsel/tinsel.h	2010-08-24 09:46:17 UTC (rev 52323)
@@ -74,13 +74,14 @@
 	GF_FLOPPY = 1 << 2,
 	GF_SCNFILES = 1 << 3,
 	GF_ENHANCED_AUDIO_SUPPORT = 1 << 4,
+	GF_ALT_MIDI = 1 << 5,		// Alternate sequence in midi.dat file
 
 	// The GF_USE_?FLAGS values specify how many country flags are displayed
 	// in the subtitles options dialog.
 	// None of these defined -> 1 language, in ENGLISH.TXT
-	GF_USE_3FLAGS = 1 << 5,	// French, German, Spanish
-	GF_USE_4FLAGS = 1 << 6,	// French, German, Spanish, Italian
-	GF_USE_5FLAGS = 1 << 7	// All 5 flags
+	GF_USE_3FLAGS = 1 << 6,	// French, German, Spanish
+	GF_USE_4FLAGS = 1 << 7,	// French, German, Spanish, Italian
+	GF_USE_5FLAGS = 1 << 8	// All 5 flags
 };
 
 /**


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list