From 46368eac5f1afc6d3fe706a3efffc7ccf336a924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Andersson?= Date: Tue, 1 Jan 2008 23:30:29 +0000 Subject: [PATCH] Added what I hope is the proper fix for bug #1498785 ("LOOM: Unknown Roland MIDI music events"). It would probably be safe to commit to the 0.11 branch, but I don't know for sure which games would be affected other than EGA Loom. svn-id: r30132 --- engines/scumm/midiparser_ro.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/engines/scumm/midiparser_ro.cpp b/engines/scumm/midiparser_ro.cpp index 858a852c229..b8040612062 100644 --- a/engines/scumm/midiparser_ro.cpp +++ b/engines/scumm/midiparser_ro.cpp @@ -69,9 +69,20 @@ void MidiParser_RO::parseNextEvent (EventInfo &info) { if (info.command() == 0xA) { ++_lastMarkerCount; info.event = 0xF0; - } else if (info.event == 0xF0) { + } else if (info.command() == 0xF) { byte delay = *(_position._play_pos++); info.delta += delay; + if (info.event != 0xF0) { + // The event is usually 0xF0 but there are a + // few cases in EGA Loom where it's 0xF1. I'm + // speculating that this is for adding values + // greater than 255 to info.delta. See bug + // #1498785. + // + // The actual calculation is pure guesswork, + // but the result sounds good enough to me. + info.delta += 256; + } continue; } break;