Skip to content

Commit

Permalink
SHERLOCK: Use standard MIDI drivers for Rose Tattoo
Browse files Browse the repository at this point in the history
As far as I understand, the Rose Tattoo music is standard XMIDI, so
it can be played on any GM device. The music now sounds like I
remember it from DOSBox. (I'm currently limited to AdLib music in
DOSBox, so I can't make any proper comparison.)

AdLib support currently depends on ScummVM's GM -> AdLib conversion,
so that does not match the original.

I'm not sure about MT-32, but since I have no reason to believe that
there is MT-32 specific music - at least not in the way the Serrated
Scalpel MT-32 driver expects - we can probably rely on our default
driver to a reasonable job of it.
  • Loading branch information
Torbjörn Andersson committed Jun 15, 2015
1 parent 142812e commit 1fc1d5c
Showing 1 changed file with 33 additions and 19 deletions.
52 changes: 33 additions & 19 deletions engines/sherlock/music.cpp
Expand Up @@ -218,29 +218,40 @@ Music::Music(SherlockEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer) {
if (_vm->_interactiveFl)
_vm->_res->addToCache("MUSIC.LIB");

_midiParser = (IS_SERRATED_SCALPEL) ? new MidiParser_SH() : MidiParser::createParser_XMIDI();
MidiDriver::DeviceHandle dev;

MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MT32);
_musicType = MidiDriver::getMusicType(dev);
if (IS_SERRATED_SCALPEL) {
_midiParser = new MidiParser_SH();
dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MT32);
_musicType = MidiDriver::getMusicType(dev);

switch (_musicType) {
case MT_ADLIB:
_midiDriver = MidiDriver_AdLib_create();
break;
case MT_MT32:
_midiDriver = MidiDriver_MT32_create();
break;
case MT_GM:
if (ConfMan.getBool("native_mt32")) {
switch (_musicType) {
case MT_ADLIB:
_midiDriver = MidiDriver_AdLib_create();
break;
case MT_MT32:
_midiDriver = MidiDriver_MT32_create();
_musicType = MT_MT32;
break;
case MT_GM:
if (ConfMan.getBool("native_mt32")) {
_midiDriver = MidiDriver_MT32_create();
_musicType = MT_MT32;
}
break;
default:
// Create default one
// I guess we shouldn't do this anymore
//_midiDriver = MidiDriver::createMidi(dev);
break;
}
break;
default:
// Create default one
// I guess we shouldn't do this anymore
//_driver = MidiDriver::createMidi(dev);
break;
} else {
// TODO: AdLib support uses ScummVM's builtin GM to AdLib
// conversion. This won't match the original.

_midiParser = MidiParser::createParser_XMIDI();
dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_GM);
_musicType = MT_GM;
_midiDriver = MidiDriver::createMidi(dev);
}

if (_midiDriver) {
Expand Down Expand Up @@ -400,6 +411,9 @@ bool Music::playMusic(const Common::String &name) {
MidiDriver_MT32_newMusicData(_midiDriver, dataPos, dataSize);
break;

case MT_GM:
break;

default:
// should never happen
break;
Expand Down

0 comments on commit 1fc1d5c

Please sign in to comment.