aboutsummaryrefslogtreecommitdiff
path: root/scumm/imuse.cpp
diff options
context:
space:
mode:
authorJamieson Christian2003-08-14 08:26:59 +0000
committerJamieson Christian2003-08-14 08:26:59 +0000
commit3a39c653affe169958b3ba303e5826fe6cea774a (patch)
treeb6e6ea2ec149cf84c3a21e68693711715dfd0f7d /scumm/imuse.cpp
parenta0c71ef5e9047dcb2d7b67dabc35b9fc9479b33b (diff)
downloadscummvm-rg350-3a39c653affe169958b3ba303e5826fe6cea774a.tar.gz
scummvm-rg350-3a39c653affe169958b3ba303e5826fe6cea774a.tar.bz2
scummvm-rg350-3a39c653affe169958b3ba303e5826fe6cea774a.zip
Added support for Roland MT-32 music tracks
in monkeyvga/ega. Tested in monkeyvga, but not in monkeyega yet. There are still wrinkles to work out, but the parser for the new format is in and hooked up. svn-id: r9684
Diffstat (limited to 'scumm/imuse.cpp')
-rw-r--r--scumm/imuse.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp
index 8bce602b00..1326f5a333 100644
--- a/scumm/imuse.cpp
+++ b/scumm/imuse.cpp
@@ -85,6 +85,10 @@ byte *IMuseInternal::findStartOfSound(int sound) {
return NULL;
}
+ // Check for old-style headers first, like 'RO'
+ if (ptr[4] == 'R' && ptr[5] == 'O')
+ return ptr + 4;
+
ptr += 8;
size = READ_BE_UINT32(ptr);
ptr += 4;
@@ -129,6 +133,10 @@ bool IMuseInternal::isMT32(int sound) {
return false;
}
+ // Check old style headers, like 'RO'
+ if (ptr[4] == 'R' && ptr[5] == 'O')
+ return true;
+
return false;
}
@@ -160,6 +168,10 @@ bool IMuseInternal::isGM(int sound) {
return false;
}
+ // Check old style headers, like 'RO'
+ if (ptr[4] == 'R' && ptr[5] == 'O')
+ return true;
+
return false;
}
@@ -189,7 +201,7 @@ MidiDriver *IMuseInternal::getBestMidiDriver(int sound) {
bool IMuseInternal::startSound(int sound) {
Player *player;
- void *mdhd;
+ void *ptr;
// Do not start a sound if it is already set to
// start on an ImTrigger event. This fixes carnival
@@ -204,24 +216,12 @@ bool IMuseInternal::startSound(int sound) {
return false;
}
- // Not sure exactly what the old code was doing,
- // but we'll go ahead and do a similar check.
- mdhd = findStartOfSound(sound);
- if (!mdhd) {
+ ptr = findStartOfSound(sound);
+ if (!ptr) {
debug(2, "IMuseInternal::startSound(): Couldn't find sound %d!", sound);
return false;
}
-/*
- mdhd = findTag(sound, MDHD_TAG, 0);
- if (!mdhd) {
- mdhd = findTag(sound, MDPG_TAG, 0);
- if (!mdhd) {
- debug(2, "SE::startSound failed: Couldn't find sound %d", sound);
- return false;
- }
- }
-*/
-
+
// Check which MIDI driver this track should use.
// If it's NULL, it ain't something we can play.
MidiDriver *driver = getBestMidiDriver(sound);