diff options
author | Kari Salminen | 2008-10-13 19:17:51 +0000 |
---|---|---|
committer | Kari Salminen | 2008-10-13 19:17:51 +0000 |
commit | c949eb2daca88608bb582b2133f751cf4707f8dd (patch) | |
tree | c4647515fb447fdc6030491cb49e4a1378ef0b24 /engines/agi | |
parent | c2066b9c20930af2e01953f6bf97f147fb2673e3 (diff) | |
download | scummvm-rg350-c949eb2daca88608bb582b2133f751cf4707f8dd.tar.gz scummvm-rg350-c949eb2daca88608bb582b2133f751cf4707f8dd.tar.bz2 scummvm-rg350-c949eb2daca88608bb582b2133f751cf4707f8dd.zip |
Patch #2131406: AGI: Fix Crash with Apple][ Instruments.
Applied the patch as it is, thanks clone2727.
Now Apple IIGS AGI games don't crash anymore if the
instruments (They're in *.SYS16) or the instrument
samples (They're in SIERRASTANDARD) aren't found.
svn-id: r34798
Diffstat (limited to 'engines/agi')
-rw-r--r-- | engines/agi/sound.cpp | 6 | ||||
-rw-r--r-- | engines/agi/sound.h | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp index 7138a3adad..7655b757f9 100644 --- a/engines/agi/sound.cpp +++ b/engines/agi/sound.cpp @@ -454,7 +454,7 @@ int SoundMgr::initSound() { _waveform = waveformMac; break; case SOUND_EMU_APPLE2GS: - loadInstruments(); + _disabledMidi = !loadInstruments(); break; } @@ -514,6 +514,9 @@ void SoundMgr::playNote(int i, int freq, int vol) { } void SoundMgr::playMidiSound() { + if (_disabledMidi) + return; + const uint8 *p; uint8 parm1, parm2; static uint8 cmd, ch; @@ -1218,6 +1221,7 @@ SoundMgr::SoundMgr(AgiBase *agi, Audio::Mixer *pMixer) : _chn() { _playing = false; _sndBuffer = (int16 *)calloc(2, BUFFER_SIZE); _waveform = 0; + _disabledMidi = false; } void SoundMgr::premixerCall(int16 *data, uint len) { diff --git a/engines/agi/sound.h b/engines/agi/sound.h index 0a6f5e302d..fd178e3a1d 100644 --- a/engines/agi/sound.h +++ b/engines/agi/sound.h @@ -467,6 +467,7 @@ private: int _endflag; int _playingSound; uint8 _env; + bool _disabledMidi; int16 *_sndBuffer; const int16 *_waveform; |