aboutsummaryrefslogtreecommitdiff
path: root/engines/tinsel/music.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2010-08-24 09:46:17 +0000
committerEugene Sandulenko2010-08-24 09:46:17 +0000
commit95748c07cc2f6962ba3910e633f948bde6263549 (patch)
tree39fc473a627dc2d1973a323b865d735833563114 /engines/tinsel/music.cpp
parentc2ad45a5cf24d5180e2f4f9f7692ed0ed4fe773b (diff)
downloadscummvm-rg350-95748c07cc2f6962ba3910e633f948bde6263549.tar.gz
scummvm-rg350-95748c07cc2f6962ba3910e633f948bde6263549.tar.bz2
scummvm-rg350-95748c07cc2f6962ba3910e633f948bde6263549.zip
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. svn-id: r52323
Diffstat (limited to 'engines/tinsel/music.cpp')
-rw-r--r--engines/tinsel/music.cpp51
1 files changed, 49 insertions, 2 deletions
diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp
index cef7f0a781..91710d8053 100644
--- a/engines/tinsel/music.cpp
+++ b/engines/tinsel/music.cpp
@@ -107,6 +107,26 @@ static const SCNHANDLE midiOffsetsSCNVersion[] = {
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 @@ static const int enhancedAudioSCNVersion[] = {
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 @@ bool PlayMidiSequence(uint32 dwFileOffset, bool bLoop) {
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];