aboutsummaryrefslogtreecommitdiff
path: root/sound.cpp
diff options
context:
space:
mode:
authorMax Horn2002-07-02 21:28:57 +0000
committerMax Horn2002-07-02 21:28:57 +0000
commit01dfd26a3756864dd668bd3cf0bc5c9cb9f3c29a (patch)
treed035766567885f18a01e8d1ef1e308ac6f57c7d2 /sound.cpp
parentb827dadf6e8217dbd2baad7bd21e7f8c32db818d (diff)
downloadscummvm-rg350-01dfd26a3756864dd668bd3cf0bc5c9cb9f3c29a.tar.gz
scummvm-rg350-01dfd26a3756864dd668bd3cf0bc5c9cb9f3c29a.tar.bz2
scummvm-rg350-01dfd26a3756864dd668bd3cf0bc5c9cb9f3c29a.zip
added some hackish support for the DIGI SFX format used in Putt-Putt demo
svn-id: r4451
Diffstat (limited to 'sound.cpp')
-rw-r--r--sound.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/sound.cpp b/sound.cpp
index d29e1b602e..251b61a02e 100644
--- a/sound.cpp
+++ b/sound.cpp
@@ -203,6 +203,23 @@ void Scumm::playSound(int sound)
_mixer->play_raw(NULL, sound, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
return;
}
+ // Support for Putt-Putt sounds - very hackish, too 8-)
+ else if (ptr != NULL && READ_UINT32_UNALIGNED(ptr) == MKID('DIGI')) {
+ // TODO - discover what data the first chunk, HSHD, contains
+ // it might be useful here.
+ ptr += 8 + READ_UINT32_UNALIGNED(ptr+12);
+ if (READ_UINT32_UNALIGNED(ptr) != MKID('SDAT'))
+ return; // abort
+
+ int size = READ_UINT32_UNALIGNED(ptr+4);
+ int rate = 8000; // FIXME - what value here ?!? this is just a guess for now
+
+ // Allocate a sound buffer, copy the data into it, and play
+ char *sound = (char*)malloc(size);
+ memcpy(sound, ptr+8, size);
+ _mixer->play_raw(NULL, sound, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
+ return;
+ }
if ((_features & GF_OLD256) || (_gameId == GID_MONKEY_VGA))
return; /* FIXME */