aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sound
diff options
context:
space:
mode:
authormd52011-02-26 15:27:01 +0200
committermd52011-02-26 15:27:01 +0200
commit88235cee7cd48c03401f956579abdeaf95227993 (patch)
tree6c4bf124c124d8fe24a9d0c9a103932cef1364e4 /engines/sci/sound
parent756a343cb85760093d1906cc91644e4d10522382 (diff)
downloadscummvm-rg350-88235cee7cd48c03401f956579abdeaf95227993.tar.gz
scummvm-rg350-88235cee7cd48c03401f956579abdeaf95227993.tar.bz2
scummvm-rg350-88235cee7cd48c03401f956579abdeaf95227993.zip
SCI: Some slight fixes for the code that reads the LSL2 early MT32.DLL driver, thanks to waltervn
Diffstat (limited to 'engines/sci/sound')
-rw-r--r--engines/sci/sound/drivers/midi.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/engines/sci/sound/drivers/midi.cpp b/engines/sci/sound/drivers/midi.cpp
index 73420eff6e..c350d3826f 100644
--- a/engines/sci/sound/drivers/midi.cpp
+++ b/engines/sci/sound/drivers/midi.cpp
@@ -616,14 +616,23 @@ void MidiPlayer_Midi::readMt32DrvData() {
if (f.readUint16LE() != 0)
f.seek(-2, SEEK_CUR);
+ // Send before-SysEx text
sendMt32SysEx(0x200000, static_cast<Common::SeekableReadStream *>(&f), 20);
- // Send after-SysEx text (SSCI sends this before every song)
- sendMt32SysEx(0x200000, static_cast<Common::SeekableReadStream *>(&f), 20);
+ if (size != 2271) {
+ // Send after-SysEx text (SSCI sends this before every song).
+ // There aren't any SysEx calls in old drivers, so this can
+ // be sent right after the before-SysEx text.
+ sendMt32SysEx(0x200000, static_cast<Common::SeekableReadStream *>(&f), 20);
+ } else {
+ // Skip the after-SysEx text in the newer patch version, we'll send
+ // it after the SysEx messages are sent.
+ f.skip(20);
+ }
- // Save goodbye message
+ // Save goodbye message. This isn't a C string, so it may not be
+ // nul-terminated.
f.read(_goodbyeMsg, 20);
- _goodbyeMsg[19] = 0; // make sure that the message is nul-terminated
// Set volume
byte volume = CLIP<uint16>(f.readUint16LE(), 0, 100);
@@ -653,12 +662,9 @@ void MidiPlayer_Midi::readMt32DrvData() {
setReverb(reverb);
- // Send after-SysEx text
- f.seek(0);
+ // Send the after-SysEx text
+ f.seek(0x3d);
sendMt32SysEx(0x200000, static_cast<Common::SeekableReadStream *>(&f), 20);
-
- // Send the mystery SysEx
- sendMt32SysEx(0x52000a, (const byte *)"\x16\x16\x16\x16\x16\x16", 6);
} else {
byte reverbSysEx[13];
// This old driver should have a full reverb SysEx