aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/midi.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2015-07-23 22:33:56 +0200
committerJohannes Schickel2015-07-23 22:33:56 +0200
commit979a885ef9785afbed650dfffc8c5af6af8ea8e5 (patch)
tree547e6abcaf02bb687902d83104a98496c73cf800 /engines/agos/midi.cpp
parent773305498c672ce528eddc8bfd5fb5702d6abb5e (diff)
downloadscummvm-rg350-979a885ef9785afbed650dfffc8c5af6af8ea8e5.tar.gz
scummvm-rg350-979a885ef9785afbed650dfffc8c5af6af8ea8e5.tar.bz2
scummvm-rg350-979a885ef9785afbed650dfffc8c5af6af8ea8e5.zip
AGOS: Add initial version of Simon1 DOS AdLib output.
Testing so far has not really happened. Only the first part of the intro has been tested.
Diffstat (limited to 'engines/agos/midi.cpp')
-rw-r--r--engines/agos/midi.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp
index 85f2dd5977..67765fadc0 100644
--- a/engines/agos/midi.cpp
+++ b/engines/agos/midi.cpp
@@ -29,6 +29,7 @@
#include "agos/midi.h"
#include "agos/drivers/accolade/mididriver.h"
+#include "agos/drivers/simon1/adlib.h"
// Miles Audio for Simon 2
#include "audio/miles.h"
@@ -109,6 +110,8 @@ int MidiPlayer::open(int gameType, bool isDemo) {
if (isDemo) {
_musicMode = kMusicModeAccolade;
accoladeDriverFilename = "MUSIC.DRV";
+ } else if (Common::File::exists("MT_FM.IBK")) {
+ _musicMode = kMusicModeSimon1;
}
break;
case GType_SIMON2:
@@ -231,6 +234,35 @@ int MidiPlayer::open(int gameType, bool isDemo) {
return 0;
}
+ case kMusicModeSimon1: {
+ // This only handles the original AdLib driver of Simon1.
+ if (musicType == MT_ADLIB) {
+ _adLibMusic = true;
+ _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;
+ }
+ }
+ }
+ }
+ }
+
+ _musicMode = kMusicModeDisabled;
+ }
+
default:
break;
}