aboutsummaryrefslogtreecommitdiff
path: root/scumm/sound.cpp
diff options
context:
space:
mode:
authorJonathan Gray2003-04-22 11:34:46 +0000
committerJonathan Gray2003-04-22 11:34:46 +0000
commitd60bc445874cba6a4cb7ad4ca67b2a3ba4d0df4a (patch)
tree6c1e1b6e1c40c732863405f443e3fe0d954f0234 /scumm/sound.cpp
parenta8dfcb4edad9ae2db35a85f6f9c7416d14d74931 (diff)
downloadscummvm-rg350-d60bc445874cba6a4cb7ad4ca67b2a3ba4d0df4a.tar.gz
scummvm-rg350-d60bc445874cba6a4cb7ad4ca67b2a3ba4d0df4a.tar.bz2
scummvm-rg350-d60bc445874cba6a4cb7ad4ca67b2a3ba4d0df4a.zip
add preliminary bits for making xmi music in humongous games work, just need someone to do something with the pointer now :)
svn-id: r7072
Diffstat (limited to 'scumm/sound.cpp')
-rw-r--r--scumm/sound.cpp31
1 files changed, 31 insertions, 0 deletions
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;