From 1316120fe4ebf2ce47e6ebe595d20cd10901602d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 31 Dec 2015 14:35:34 +0100 Subject: [PATCH] - fixed: The MUS precacher did not handle invalid patches well. - increased the valid range of patch values for MUS. According to the original MIDI2MUS code it can handle numbers up to 188, not 181, and at least one track from Eternal Doom uses #183. --- src/sound/music_mus_midiout.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/sound/music_mus_midiout.cpp b/src/sound/music_mus_midiout.cpp index 1ebaa2eb4..eaf7e4afb 100644 --- a/src/sound/music_mus_midiout.cpp +++ b/src/sound/music_mus_midiout.cpp @@ -223,10 +223,17 @@ void MUSSong2::Precache() { val = instr; } - else if (instr >= 135 && instr <= 181) + else if (instr >= 135 && instr <= 188) { // Percussions are 100-based, not 128-based, eh? val = instr - 100 + (1 << 14); } + else + { + // skip it. + val = used[k++]; + k += val; + continue; + } int numbanks = used[k++]; if (numbanks > 0)