From d60bc445874cba6a4cb7ad4ca67b2a3ba4d0df4a Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Tue, 22 Apr 2003 11:34:46 +0000 Subject: add preliminary bits for making xmi music in humongous games work, just need someone to do something with the pointer now :) svn-id: r7072 --- scumm/scummvm.cpp | 5 ++++- scumm/sound.cpp | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) (limited to 'scumm') 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; -- cgit v1.2.3