aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
Diffstat (limited to 'scumm')
-rw-r--r--scumm/scummvm.cpp5
-rw-r--r--scumm/sound.cpp31
2 files changed, 35 insertions, 1 deletions
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index 42695b9fba..80a5bd03c2 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -460,7 +460,10 @@ void Scumm::initScummVars() {
_vars[VAR_VIDEOMODE] = 0x13;
_vars[VAR_HEAPSPACE] = 1400;
_vars[VAR_MOUSEPRESENT] = true; // FIXME - used to be 0, but that seems odd?!?
- _vars[VAR_SOUNDPARAM] = 0;
+// if (_features & GF_HUMONGOUS) // FIXME uncomment when XMI support is added
+// _vars[VAR_SOUNDPARAM] = 1; // soundblaster for music
+// else
+ _vars[VAR_SOUNDPARAM] = 0;
_vars[VAR_SOUNDPARAM2] = 0;
_vars[VAR_SOUNDPARAM3] = 0;
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index b06d82b14c..716decf6ea 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -222,6 +222,37 @@ void Sound::playSound(int soundID) {
_scumm->_mixer->playRaw(NULL, sound, size, rate, flags, soundID);
return;
}
+ // XMI MIDI
+ else if ((READ_UINT32_UNALIGNED(ptr) == MKID('MIDI')) && (_scumm->_features & GF_HUMONGOUS)) {
+ // skip HSHD
+ ptr += 8 + READ_BE_UINT32_UNALIGNED(ptr+12);
+ if (READ_UINT32_UNALIGNED(ptr) != MKID('SDAT'))
+ return; // abort
+
+ size = READ_BE_UINT32_UNALIGNED(ptr+4) - 8;
+ ptr += 8; // don't need SDAT block anymore
+
+ // XMI playing stuff goes here
+ // ptr should be pointing to XMI file in memory
+
+ // FIXME: dumping xmi files for testing, remove when working
+ if (1) {
+ File out;
+ char buf[64];
+ sprintf(buf, "dumps/sound-%d.xmi", soundID);
+
+ out.open(buf, "", 1);
+ if (out.isOpen() == false) {
+ out.open(buf, "", 2);
+ if (out.isOpen() == false)
+ return;
+ out.write(ptr, size);
+ }
+ out.close();
+ }
+
+ return;
+ }
else if (READ_UINT32_UNALIGNED(ptr) == MKID('Crea')) {
_scumm->_imuseDigital->startSound(soundID);
return;