diff options
author | James Brown | 2002-07-25 15:37:31 +0000 |
---|---|---|
committer | James Brown | 2002-07-25 15:37:31 +0000 |
commit | d45c6993e1a3b954e3a6f7fddff790851098df43 (patch) | |
tree | 616758d8d482cbb60e435ce65f0db0f3215568a9 | |
parent | 76679bc3e9fc2ee0d414d0b1bc620b8f5bac56c0 (diff) | |
download | scummvm-rg350-d45c6993e1a3b954e3a6f7fddff790851098df43.tar.gz scummvm-rg350-d45c6993e1a3b954e3a6f7fddff790851098df43.tar.bz2 scummvm-rg350-d45c6993e1a3b954e3a6f7fddff790851098df43.zip |
Add Zak256 sound
svn-id: r4625
-rw-r--r-- | sound.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
@@ -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) { |