Ticket #9263: mt32_checksum.patch

File mt32_checksum.patch, 523 bytes (added by SF/sven3000, 14 years ago)

Patch that fixes checsum calculation.

  • engines/sci/sound/drivers/midi.cpp

     
    443443        for (int i = 4; i < 7 + len; i++)
    444444                chk += _sysExBuf[i];
    445445
    446         _sysExBuf[7 + len] = 128 - chk % 128;
     446        byte checksum = 128 - chk % 128;
     447        if (checksum == 128)
     448                checksum = 0;
     449        _sysExBuf[7 + len] = checksum;
    447450
    448451        if (noDelay)
    449452                _driver->sysEx(_sysExBuf, len + 8);