aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sound/midiparser_sci.h
AgeCommit message (Collapse)Author
2017-04-16SCI: Improve MidiParser_SCI robustness against bad sound resourcesColin Snover
1. KQ4 sound 104 has an extra 0xFC (MIDI Stop command/kEndOfTrack) at the end of the resource, which causes an out-of-bounds read because the filtering loop continues after the first 0xFC and unconditionally attempts to read 2 bytes (expecting there to always be a delta value + a command, whereas in this file there is only another kEndOfTrack command). This is corrected by exiting the filtering loop when a kEndOfTrack is encountered and there is not enough data remaining in the resource to continue reading. 2. KQ5 sound 699 is truncated, which causes the parser to attempt to read past the end of the resource. This is addressed by adding bounds checks that exit the mix loop early if there is no more data available to read. This allows truncated sounds to be played as far as possible (previously, trying to read truncated resources would result in a fatal error). 3. midiMixChannels allocates an arbitrary amount of raw memory for the mixed MIDI sequence, without performing any bounds checking when writing to this memory, potentially leading to a crash or silent corruption of adjacent memory. This is mitigated by using SciSpan instead of a raw pointer for the mixed data. Fixes Trac#9727.
2014-02-18SCI: Make GPL headers consistent in themselves.Johannes Schickel
2014-01-27SCI: Fix breakage from f92df4c6Alyssa Milburn
2013-12-31SCI: Rewrite MIDI channel remappingWillem Jan Palenstijn
This adds MIDI state tracking to allow channels to be temporarily unmapped and later re-mapped when there are free device channels available again.
2013-09-22SCI: revert fix music start codeMartin Kiewitz
add workaround for eq2 the issue is known, but can't be properly fixed without rewriting the midiparser into a channel specific parser previous commit caused issues in kq5/french and others
2013-09-22SCI: fix music start code fixes eq2 bug #3037267Martin Kiewitz
we start at offset 10 for sound SCI1 games. This is hardcoded in the interpreter. Also removing not handling signals on tick 0. This fixes Eco Quest 2 / Gonzales dancing in room 530. Thanks to wjp for the help.
2013-09-21SCI: Move MIDI event processing out of parseNextEventWillem Jan Palenstijn
2013-07-07SCI: Fix bug #3614566 - "LSL6: ScummVM locks up at Electro-Shock room"Filippos Karapetis
We now do the jumpToTick() for hold events after waiting for the delta of the current event, like we do for the signal set events. This keeps the fixes for the hold timings in QFG3, while not breaking LSL6. Many thanks to wjp for pinpointing the actual cause of the issue.
2012-09-07JANITORIAL: Remove underscores from MidiParser variable names.Alyssa Milburn
2011-05-12GIT: Clean up: Suppress SVN tags, now uselessstrangerke
2011-02-09AUDIO: Rename sound/ dir to audio/Max Horn
svn-id: r55850
2010-11-25SCI: implemented reverb handling and related functionalityFilippos Karapetis
svn-id: r54478
2010-09-01SCI: set master volume correctlyMartin Kiewitz
and merge it together with global volume, fixes bug #3053104) svn-id: r52484
2010-06-28SCI: implementing real setVolume() support, fixing some fading in sci1 games ↵Martin Kiewitz
(like pq3 intro) svn-id: r50414
2010-06-27SCI: tell midiparser that he lost ownership of channels in case we take them ↵Martin Kiewitz
away svn-id: r50405
2010-06-21SCI: instead of queueing inside midiparser, we are queueing now globally in ↵Martin Kiewitz
SciMusic, also some little cleanup svn-id: r50130
2010-06-20SCI: storing all manual midi commands now and actually sending them to ↵Martin Kiewitz
driver during onTimer() - fixes mt32 emulation crashing during lsl5 piano scene svn-id: r50073
2010-06-19SCI: fixing another uninitialized variable usage issue - also limiting reset ↵Martin Kiewitz
velocity to used channels only, same is true for setting voice count svn-id: r50062
2010-06-19SCI: stopping scripts from sending to unused channels manually (fixes sq1vga)Martin Kiewitz
svn-id: r50060
2010-06-18SCI: implementing fading for sci1 only for used channels of the object, ↵Martin Kiewitz
fixes lsl1 music issues when going right at the start svn-id: r50018
2010-06-17SCI: implemented channel muting for sci1, finally fixes lsl5 paino scene ↵Martin Kiewitz
with patti svn-id: r49926
2010-06-16SCI: implement channel remapping for SCI1Martin Kiewitz
svn-id: r49905
2010-06-14SCI: Added a version of allNotesOff() which sends messages only to the ↵Filippos Karapetis
channels used by the associated song instead of all channels svn-id: r49673
2010-06-11- Added a new debug command, verify_midi, which can be used to check all the ↵Filippos Karapetis
songs of a game for unmapped instruments (still WIP and disabled) - Fixed a bug in the verify_scripts command (it was loading the script resource twice) svn-id: r49597
2010-06-04Some more work on channel remapping: Moved the remapping code to the music ↵Filippos Karapetis
loading code (still disabled) svn-id: r49430
2010-06-03- Made some methods constJohannes Schickel
- Prefer const_iterator over iterator in SciMusic::findUsedChannels svn-id: r49417
2010-06-03Added channel remapping to MidiParser_SCI (currently unused)Filippos Karapetis
svn-id: r49414
2010-01-22- The reverb value is now obtained from the music driverFilippos Karapetis
- Implemented kSetReverb (0x50) and kResetOnPause (0x4C) svn-id: r47433
2010-01-21SCI: fixing iceman intro again (dont set datainc immediately but after delta)Martin Kiewitz
svn-id: r47424
2010-01-15When unloading a song, only reset the channels that it actually used, not ↵Filippos Karapetis
all channels svn-id: r47304
2010-01-13Documented MidiParser_SCI, mentioning that it's an extension to the ↵Filippos Karapetis
MidiParser_SMF parser svn-id: r47287
2010-01-12Rename all "Adlib" uses to "AdLib" to match the real name of the sound card ↵Johannes Schickel
/ company. Check this for reference: http://en.wikipedia.org/wiki/Ad_Lib,_Inc. http://www.crossfire-designs.de/images/articles/soundcards/adlib.jpg (note the upper left of the card) This commit does not touch "adlib" and "ADLIB" uses! Also it does not update all the SCUMM detection entries, which still use "Adlib". svn-id: r47279
2010-01-05Cleanup, fixed fading of digital sound effectsFilippos Karapetis
svn-id: r47023
2010-01-05Renamed /gui to /graphics and /sfx to /sound, to better illustrate their purposeFilippos Karapetis
svn-id: r47007