Age | Commit message (Collapse) | Author |
|
I put this in an separate commit to make it easier to review/revert. I've tried to make this as minimum invasive as possible. That's why I put this in place of the former call to onNewSound().
SCI_0_LATE sound drivers (probably also SCI_0_EARLY, but I don't know that) do some midi track initialization, mostly resetting certain values and assigning voices (hardware channels) to midi parts. The information for this comes from the track header.
The SCI0 version of the PC-98 sound driver relies on this code. The driver checks the channel flags with two different masks and assigns different sound channel types accordingly. This can't be done with the 0x4B event. Using the 0x4B event is sort of counter intuitive anyway, since only some of the SCI0 drivers even support that event.
It seems that the only driver making use of onNewSound() was MT-32. I've adapted the driver to my changes, although I am quite sure that the sound will be unaffected. The only thing that the MT-32 driver does with the header information is checking whether a midi part should play or not and assign exactly one timbre (with exactly the same number) to that part if required.
|
|
|
|
Set the default reverb configuration present in either the MT-32
patch data or MT32.DRV of SCI0 games before playing each sound, as
a previously played sound may have changed it.
Also, do not perform a general reverb init, since the start of a
sound will do that now.
Closes gh-1023.
|
|
Upon investigation of Sound code across SCI32 games, it was
determined that there are actually (at least) 3 different
revisions, not just a single SCI2.1 version. This patch only
changes the parts of Sound code that are relevant to the correct
use of Audio32.
Fixes Trac#9736, Trac#9756, Trac#9767, Trac#9791.
|
|
|
|
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.
|
|
The eventual proper fix for this is to change the current MIDI
parser to work the same as in SSCI, but for now this workaround
allows the game to continue.
Fixes Trac#9696.
|
|
|
|
- Detection works via signatures (couldn't find a better way)
- new kString subcalls were introduced SCI2.1 LATE
- kString now has signatures and is split via subcall table
- kString fix, so that KQ7 doesn't crash, when starting a chapter
- Sci2StringFunctionType removed, because no longer needed
|
|
|
|
This is only supported since SCI1 middle, as verified with xmas1990, SCI1 mgoose, SQ4 floppy, LSL1, Jones floppy.
Fixes missing sounds in Jones floppy.
|
|
|
|
|
|
|
|
|
|
|
|
This adds MIDI state tracking to allow channels to be temporarily
unmapped and later re-mapped when there are free device channels
available again.
|
|
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
|
|
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.
|
|
Conflicts:
engines/sci/sound/midiparser_sci.cpp
|
|
we set signal in parseNextEvent on dataInc events, which then effectively triggered 2 cues through kDoSoundUpdateCues instead of one. Fixes Freddy Pharkas Ballad intro on floppy + demos
|
|
|
|
|
|
|
|
|
|
|
|
|
|
properly for longbow intro
|
|
|
|
|
|
|
|
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.
|
|
This fixes bug #3293354.
|
|
This fixes the main part of bug #3487090.
This seems to be a conversion error from SCI1's channel mixing to SCI0's
channel filtering code.
|
|
This reverts commit c6320a28e483e52b489cae8e86774008e030492b.
SSCI does not interpret signals on other channels than 15.
Conflicts:
engines/sci/sound/soundcmd.cpp
|
|
We now accept signals from all channels if channel 15 is missing. This
is a very rare edge case, but our behavior is now somewhat closer to what
the original interpreter seems to be doing. Mordack's appearance animation
is now synced properly. The more generic workaround works for songs 1840
and 1843, but not for 1849, which is still problematic and we still resort
to manually changing its dataInc selector
|
|
|
|
|
|
|
|
|
|
LB1 Amiga doesn't contain MT-32 music tracks. Added a warning for this
situation
|
|
|
|
svn-id: r54512
|
|
(thanks to waltervn)
svn-id: r54509
|
|
svn-id: r54499
|
|
svn-id: r54488
|
|
fired from the MIDI stream
svn-id: r54485
|
|
svn-id: r54482
|
|
svn-id: r54478
|
|
svn-id: r54461
|