aboutsummaryrefslogtreecommitdiff
path: root/scumm
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
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')
-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;