aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorJamieson Christian2003-06-01 18:24:10 +0000
committerJamieson Christian2003-06-01 18:24:10 +0000
commit42f6d1058164fc02c51949ad78ab183745dfbbe0 (patch)
tree355a0c96521550cdfcacc090aaee82ad0b6380bc /sound
parent3d77f7230e66438ace5a302d2154865acc3bd38d (diff)
downloadscummvm-rg350-42f6d1058164fc02c51949ad78ab183745dfbbe0.tar.gz
scummvm-rg350-42f6d1058164fc02c51949ad78ab183745dfbbe0.tar.bz2
scummvm-rg350-42f6d1058164fc02c51949ad78ab183745dfbbe0.zip
Fixed hanging notes on Smart Jump when Note Off event cannot be found.
(I'm not sure why the Note Off would not be found, but at least we're properly dealing with such notes now.) svn-id: r8250
Diffstat (limited to 'sound')
-rw-r--r--sound/midiparser.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/sound/midiparser.cpp b/sound/midiparser.cpp
index c02c699aa3..3759dd6ff1 100644
--- a/sound/midiparser.cpp
+++ b/sound/midiparser.cpp
@@ -276,7 +276,7 @@ void MidiParser::hangAllActiveNotes() {
// accounted for every active note.
uint32 advance_tick = _position._last_event_tick;
while (true) {
- int i;
+ int i, j;
for (i = 0; i < 128; ++i)
if (_active_notes[i] != 0) break;
if (i == 128) break;
@@ -289,6 +289,12 @@ void MidiParser::hangAllActiveNotes() {
}
} else if (_next_event.event == 0xFF && _next_event.ext.type == 0x2F) {
// printf ("MidiParser::hangAllActiveNotes(): Hit End of Track with active notes left!\n");
+ for (i = 0; i < 128; ++i) {
+ for (j = 0; j < 16; ++j) {
+ if (_active_notes[i] & (1 << j))
+ _driver->send (0x80 | j | i << 8);
+ }
+ }
memset (_active_notes, 0, sizeof (_active_notes));
break;
}