diff options
author | Travis Howell | 2003-08-14 02:28:19 +0000 |
---|---|---|
committer | Travis Howell | 2003-08-14 02:28:19 +0000 |
commit | cd40c899b2da2b9f0bf857946ac74be119b90bd6 (patch) | |
tree | e3bcaf370898ebbc97279909443c445b7d53451c /scumm | |
parent | 03524d071e0ab4491165bde7277604468c58c6c1 (diff) | |
download | scummvm-rg350-cd40c899b2da2b9f0bf857946ac74be119b90bd6.tar.gz scummvm-rg350-cd40c899b2da2b9f0bf857946ac74be119b90bd6.tar.bz2 scummvm-rg350-cd40c899b2da2b9f0bf857946ac74be119b90bd6.zip |
Inital support for v1 maniac sound from Hoenicke
Had to move music init for v1/v2 games to get this working
svn-id: r9675
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/module.mk | 1 | ||||
-rw-r--r-- | scumm/player_v2.h | 30 | ||||
-rw-r--r-- | scumm/resource_v2.cpp | 16 | ||||
-rw-r--r-- | scumm/scummvm.cpp | 13 | ||||
-rw-r--r-- | scumm/sound.cpp | 20 |
5 files changed, 40 insertions, 40 deletions
diff --git a/scumm/module.mk b/scumm/module.mk index 241fcf2cab..81e4415c06 100644 --- a/scumm/module.mk +++ b/scumm/module.mk @@ -20,6 +20,7 @@ SCUMM_OBJS = \ scumm/help.o \ scumm/nut_renderer.o \ scumm/object.o \ + scumm/player_v1.o\ scumm/player_v2.o\ scumm/resource.o \ scumm/resource_v2.o \ diff --git a/scumm/player_v2.h b/scumm/player_v2.h index 6aec549407..c023237ea6 100644 --- a/scumm/player_v2.h +++ b/scumm/player_v2.h @@ -73,18 +73,18 @@ class SoundMixer; class Player_V2 { public: Player_V2(Scumm *scumm); - ~Player_V2(); + virtual ~Player_V2(); - void set_pcjr(bool pcjr); - void set_master_volume(int vol); + virtual void set_pcjr(bool pcjr); + virtual void set_master_volume(int vol); - void startSound(int nr, byte *data); - void stopSound(int nr); - void stopAllSounds(); - bool getSoundStatus(int nr) const; - int getMusicTimer() const; + virtual void startSound(int nr, byte *data); + virtual void stopSound(int nr); + virtual void stopAllSounds(); + virtual bool getSoundStatus(int nr) const; + virtual int getMusicTimer() const; -private: +protected: bool _isV3Game; SoundMixer *_mixer; OSystem *_system; @@ -121,15 +121,15 @@ private: void mutex_up() { _system->lock_mutex (_mutex); } void mutex_down() { _system->unlock_mutex (_mutex); } - void restartSound(); + virtual void restartSound(); void execute_cmd(ChannelInfo *channel); - void next_freqs(ChannelInfo *channel); - void clear_channel(int i); - void chainSound(int nr, byte *data); - void chainNextSound(); + virtual void next_freqs(ChannelInfo *channel); + virtual void clear_channel(int i); + virtual void chainSound(int nr, byte *data); + virtual void chainNextSound(); static void premix_proc(void *param, int16 *buf, uint len); - void do_mix (int16 *buf, uint len); + virtual void do_mix (int16 *buf, uint len); void lowPassFilter(int16 *data, uint len); void squareGenerator(int channel, int freq, int vol, diff --git a/scumm/resource_v2.cpp b/scumm/resource_v2.cpp index 89fa40409c..5ef6fb98b0 100644 --- a/scumm/resource_v2.cpp +++ b/scumm/resource_v2.cpp @@ -22,18 +22,27 @@ #include "stdafx.h" #include "scumm.h" #include "intern.h" +#include "player_v2.h" +#include "player_v1.h" #include "resource.h" +#include "sound/mididrv.h" void Scumm_v2::readClassicIndexFile() { int i; if (_gameId == GID_MANIAC) { + if (!(_features & GF_AMIGA)) + _playerV2 = new Player_V1(this); + _numGlobalObjects = 800; _numRooms = 55; _numCostumes = 35; _numScripts = 200; _numSounds = 100; } else if (_gameId == GID_ZAK) { + if (!(_features & GF_AMIGA)) + _playerV2 = new Player_V2(this); + _numGlobalObjects = 775; _numRooms = 61; _numCostumes = 37; @@ -96,6 +105,13 @@ void Scumm_v2::readClassicIndexFile() { } void Scumm_v2::readEnhancedIndexFile() { + + if (!(_features & GF_AMIGA)) { + _playerV2 = new Player_V2(this); + if (_midiDriver == MD_PCSPK) + _playerV2->set_pcjr(false); + } + _numGlobalObjects = _fileHandle.readUint16LE(); _fileHandle.seek(_numGlobalObjects, SEEK_CUR); // Skip object flags _numRooms = _fileHandle.readByte(); diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index a87dc31017..2da0b29a70 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -32,6 +32,7 @@ #include "intern.h" #include "object.h" #include "player_v2.h" +#include "player_v1.h" #include "resource.h" #include "sound.h" #include "string.h" @@ -620,14 +621,10 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst) _imuseDigital = new IMuseDigital(this); } else if ((_features & GF_AMIGA) && (_features & GF_OLD_BUNDLE)) { _playerV2 = NULL; - } else if (((_midiDriver == MD_PCJR) || (_midiDriver == MD_PCSPK) && (_version < 5)) || (_version <= 2)) { - if ((_version == 1) && (_gameId == GID_MANIAC)) { - _playerV2 = NULL; - } else { - _playerV2 = new Player_V2(this); - if (_midiDriver == MD_PCSPK) - _playerV2->set_pcjr(false); - } + } else if (((_midiDriver == MD_PCJR) || (_midiDriver == MD_PCSPK)) && ((_version > 2) && (_version < 5))) { + _playerV2 = new Player_V2(this); + if (_midiDriver == MD_PCSPK) + _playerV2->set_pcjr(false); } else { _imuse = IMuse::create (syst, _mixer, detector->createMidi()); if (_imuse) { diff --git a/scumm/sound.cpp b/scumm/sound.cpp index 7c5f9e922f..1af8974381 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -178,6 +178,7 @@ void Sound::playSound(int soundID) { debug(3,"playSound #%d (room %d)", soundID, _scumm->getResourceRoomNr(rtSound, soundID)); ptr = _scumm->getResourceAddress(rtSound, soundID); if (ptr) { + //hexdump(ptr, 0x400); if (READ_UINT32(ptr) == MKID('iMUS')){ assert(_scumm->_imuseDigital); _scumm->_imuseDigital->startSound(soundID); @@ -453,23 +454,8 @@ void Sound::playSound(int soundID) { return; } - if (((_scumm->_midiDriver == MD_PCJR) || (_scumm->_midiDriver == MD_PCSPK) && (_scumm->_version < 5)) || (_scumm->_version <= 2)) { - //TODO: support maniac v1 sounds - if ((_scumm->_version == 1) && (_scumm->_gameId == GID_MANIAC)) - return; - // other versions seem to be 0000 at this point... - // hopefully this test is correct - // 0xfe7f seems to be sound and 0x764a music - bool amigatest = (READ_LE_UINT16(ptr + 12) == 0xfe7f) || (READ_LE_UINT16(ptr + 12) == 0x764a); - if (amigatest) { - // TODO: support amiga sounds - } else { - if (_scumm->_playerV2) { - _scumm->_playerV2->startSound (soundID, ptr); - } - } - return; - } + if (_scumm->_playerV2) + _scumm->_playerV2->startSound (soundID, ptr); if (_scumm->_imuse) { _scumm->getResourceAddress(rtSound, soundID); |