From 8c4ebc434dbe595ccee6244a72384309dcebbb43 Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Thu, 25 Nov 2010 11:19:46 +0000 Subject: SCI: Fix bug in MT-32 checksum computation. Thanks Sven for finding this. svn-id: r54471 --- engines/sci/sound/drivers/midi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/sci/sound') diff --git a/engines/sci/sound/drivers/midi.cpp b/engines/sci/sound/drivers/midi.cpp index ba4e719c92..7cc4e1922c 100644 --- a/engines/sci/sound/drivers/midi.cpp +++ b/engines/sci/sound/drivers/midi.cpp @@ -441,9 +441,9 @@ void MidiPlayer_Midi::sendMt32SysEx(const uint32 addr, Common::SeekableReadStrea _sysExBuf[7 + i] = str->readByte(); for (int i = 4; i < 7 + len; i++) - chk += _sysExBuf[i]; + chk -= _sysExBuf[i]; - _sysExBuf[7 + len] = 128 - chk % 128; + _sysExBuf[7 + len] = chk & 0x7f; if (noDelay) _driver->sysEx(_sysExBuf, len + 8); -- cgit v1.2.3