aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Brown2002-07-25 15:37:31 +0000
committerJames Brown2002-07-25 15:37:31 +0000
commitd45c6993e1a3b954e3a6f7fddff790851098df43 (patch)
tree616758d8d482cbb60e435ce65f0db0f3215568a9
parent76679bc3e9fc2ee0d414d0b1bc620b8f5bac56c0 (diff)
downloadscummvm-rg350-d45c6993e1a3b954e3a6f7fddff790851098df43.tar.gz
scummvm-rg350-d45c6993e1a3b954e3a6f7fddff790851098df43.tar.bz2
scummvm-rg350-d45c6993e1a3b954e3a6f7fddff790851098df43.zip
Add Zak256 sound
svn-id: r4625
-rw-r--r--sound.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/sound.cpp b/sound.cpp
index d135aa2a2c..28b7f856aa 100644
--- a/sound.cpp
+++ b/sound.cpp
@@ -221,7 +221,32 @@ void Scumm::playSound(int sound)
return;
}
- if ((_features & GF_OLD256) || (_gameId == GID_MONKEY_VGA))
+ if ((_features & GF_OLD256) && (ptr != NULL)) {
+ char *sound;
+ int size = READ_LE_UINT32(ptr);
+ ptr+=0x16;
+
+ if (size == 30) {
+#ifdef COMPRESSED_SOUND_FILE
+ if (playMP3CDTrack(*ptr, 0, 0, 0) == -1)
+#endif
+ _system->play_cdrom(*ptr, 0, 0, 0);
+ return;
+ }
+
+ sound = (char*)malloc(size-0x36);
+ for (int x=0; x<(size-0x36); x++) {
+ int bit = *ptr++;
+ if (bit<0x80) sound[x] = 0x7F-bit; else sound[x] = bit;
+ }
+
+ // FIXME: Something in the header signifies looping. Need to track it down and add a
+ // mixer flag or something.
+ _mixer->play_raw(NULL, sound, size-0x36, 11000, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
+ return;
+ }
+
+ if (_gameId == GID_MONKEY_VGA)
return; /* FIXME */
if (se) {