diff options
author | Johannes Schickel | 2015-07-23 22:33:56 +0200 |
---|---|---|
committer | Johannes Schickel | 2015-07-23 22:33:56 +0200 |
commit | cf42dc0a358da489ff93d32c18a5103de4dc4385 (patch) | |
tree | d9d4d0f6b4cddc7b06002824a6731dd6590705ae /engines/agos/midi.cpp | |
parent | 33c57c632cc630d1d64266d9ee2bf340d0052049 (diff) | |
download | scummvm-rg350-cf42dc0a358da489ff93d32c18a5103de4dc4385.tar.gz scummvm-rg350-cf42dc0a358da489ff93d32c18a5103de4dc4385.tar.bz2 scummvm-rg350-cf42dc0a358da489ff93d32c18a5103de4dc4385.zip |
AGOS: Slight cleanup in Simon1 AdLib output initialization code.
Diffstat (limited to 'engines/agos/midi.cpp')
-rw-r--r-- | engines/agos/midi.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp index 61bab7d847..c5bace0523 100644 --- a/engines/agos/midi.cpp +++ b/engines/agos/midi.cpp @@ -238,23 +238,16 @@ int MidiPlayer::open(int gameType, bool isDemo) { _map_mt32_to_gm = false; _nativeMT32 = false; - // Load instrument data. - Common::File ibk; - - if (ibk.open("MT_FM.IBK")) { - if (ibk.readUint32BE() == 0x49424b1a) { - byte *instrumentData = new byte[128 * 16]; - if (ibk.read(instrumentData, 128 * 16) == 128 * 16) { - _driver = new MidiDriver_Simon1_AdLib(instrumentData); - ret = _driver->open(); - if (ret == 0) { - _driver->setTimerCallback(this, &onTimer); - _driver->send(0xB0, 0x67, 0x01); - return 0; - } - } - } + _driver = createMidiDriverSimon1AdLib("MT_FM.IBK"); + if (_driver && _driver->open() == 0) { + _driver->setTimerCallback(this, &onTimer); + // Like the original, we enable the rhythm support by default. + _driver->send(0xB0, 0x67, 0x01); + return 0; } + + delete _driver; + _driver = nullptr; } _musicMode = kMusicModeDisabled; |