Ticket #8927: agi_midi_crash.diff

File agi_midi_crash.diff, 948 bytes (added by SF/mthreepwood, 16 years ago)

Patch

  • sound.cpp

     
    454454                _waveform = waveformMac;
    455455                break;
    456456        case SOUND_EMU_APPLE2GS:
    457                 loadInstruments();
     457                _disabledMidi = !loadInstruments();
    458458                break;
    459459        }
    460460
     
    514514}
    515515
    516516void SoundMgr::playMidiSound() {
     517        if (_disabledMidi)
     518                return;
     519
    517520        const uint8 *p;
    518521        uint8 parm1, parm2;
    519522        static uint8 cmd, ch;
     
    12181221        _playing = false;
    12191222        _sndBuffer = (int16 *)calloc(2, BUFFER_SIZE);
    12201223        _waveform = 0;
     1224        _disabledMidi = false;
    12211225}
    12221226
    12231227void SoundMgr::premixerCall(int16 *data, uint len) {
  • sound.h

     
    467467        int _endflag;
    468468        int _playingSound;
    469469        uint8 _env;
     470        bool _disabledMidi;
    470471
    471472        int16 *_sndBuffer;
    472473        const int16 *_waveform;