aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sound
AgeCommit message (Collapse)Author
2019-06-21ALL: revert accidental commitsathrxx
2019-06-21hhathrxx
2019-06-21SCI: (CMS sound driver) - add support for SCI0athrxx
I haven't found an elegant and non-intrusive way to squeeze SCI0 support into LordHoto's existing code. The drivers are too different. So I made some rearrangements. The basic mechanisms of LordHoto's SCI1 code should remain the same as before, though. I only introduced some more classes, moved some code into these classes and renamed some things (mainly for myself, so as not to get confused). I fixed two voice mapping bugs in the existing driver code. The first bug in bindVocies() effectively hindered the driver from playing anything at all when the CMS_DISABLE_VOICE_MAPPING #define wasn't set (_voice[i].channel == 0xFF instead of _voice[i].channel != 0xFF). The second bug in unbindVoices() was not a complete show stopper, but the function simply did not "unbind the voice". The line which does the actual removal of the channel assignment was missing. The SCI0 driver portions have been tested with: PQ2, KQ4, LSL3, QFG1, ICE and COC. SCI_0_EARLY versions apparently don't support the CMS. At least I haven't seen a driver file so far. And there seems to be no no instrument patch resource. Although the latter issue needn't necessarily be one, since the patch data array in the driver is actually preset with data (which gets overwritten as soon as a patch file is loaded). Maybe this would work for SCI_0_EARLY. However, I haven't tested this, since I really would have have a look at a driver file first if one actually exists. For now, I have limited the driver to SCI_0_LATE. SCI1 has been tested with KQ5 and LSL5 (not extensively, just to see whether anything got broken and whether my voice mapping fixes work).
2019-06-21SCI: (PC98 audio driver) - base tempo correctionathrxx
(somewhat difficult to make out any difference, but it does affect the envelope processing)
2019-05-02SCI: Change sendMidiCommand non-midi error to warnsluicebox
FPFP calls kDoSound SendMidi on non-midi sounds. Fixes bug #10952
2019-04-28SCI: (PC98 sound driver) - fix channel assignment bugathrxx
2019-04-13SCI: (PC-98 driver) - silence -Wshadow warningathrxx
2019-04-02SCI: - update MT32/GM driver initTrack methodathrxx
This adds specific support for SCI0_EARLY targets. Based on and tested with Christmas Cards 1988. I've not added the volume reset (neither for SCI0_EARLY nor SCI0_LATE), since the ScummVM driver seems to handle volume differently on purpose (probably based on SCI1?).
2019-04-02SCI: (PC-98 driver) - frequency bug workaroundathrxx
The square sound channels will be out of spec when playing on the lowest octave. The result is a rather ugly noise. This bug makes a rather subtle appearance if the channel remapping is accurate, but it becomes quite obvious in the SQ4 intro with the current implementation. This commit turns off the channel when trying to play out of spec.
2019-04-02SCI: implement SCI0 midi driver track initializationathrxx
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.
2019-04-02SCI: (PC98 sound driver) - bugfixesathrxx
This fixes two evalutation issues specific to the MSVC x64 release build (other builds worked fine). This also fixes an analysis warning regarding my use of the span code.
2019-04-02SCI: add SCI0 support to PC-98 sound driverathrxx
- this supports PQ2 and QFG1 - also add several other fixes
2019-04-02SCI: add PC-9801 sound driverathrxx
(supports SCI1 for now)
2019-03-29SCI: Remove MidiDriver_AmigaMac platform inferencesluicebox
Tell MidiDriver_AmigaMac the game's platform instead of it attempting to infer this by which patch resources exist. Fixes bug #10925 where SQ3 German Amiga is treated as Mac because it happens to contain a patch 7 resource.
2019-03-09JANITORIAL: Update all scummvm.org URLS to use httpsCameron Cawley
2018-10-31SCI: - minor fix to FM-TOWNS sound driverathrxx
- workaround to fix music playback in Mixed Up Mothergoose - remove a useless declaration
2018-08-28SCI: Fix typoFilippos Karapetis
2018-08-27SCI: Load the correct sound effects in Hoyle 4Filippos Karapetis
Fixes bug #10412
2018-08-21SCI32: Ignore invalid kernel call when toggling the music in Hoyle 5Filippos Karapetis
2018-03-28SCI: Added overried specifiersEugene Sandulenko
2017-12-03SCI: Avoid buffer overflow in amigamac sound driverWillem Jan Palenstijn
By default, frac_t is interpreted as signed. The resulting range isn't large enough to store offsets, so we interpret it as unsigned here instead. Fixes a crash in QfG1/Mac where instrument->loop_size is 49457.
2017-11-11SCI32: Fix integer overflow calculating audio durationColin Snover
Due to the need to calculate the audio duration with millisecond precision from the file size, it is possible to overflow a 32-bit integer in games with long background audio loops, like RAMA, during the calculation of the duration. It is also not necessary to give some framerate here, so eliminate the unnecessary explicit Timestamp construction with the second argument.
2017-10-06SCI32: Rewrap comments to 80 columns in SOL decoderColin Snover
2017-10-06SCI32: Fix music volume not being restored after speech in TorinColin Snover
This was a regression introduced by d556dcc57bf50a03d81ab7a1ef59a9e5758465bf.
2017-10-06SCI32: Clean up Audio32Colin Snover
* Rewrap comments to 80 columns * Remove resolved TODOs * Use containers and smart pointers where appropriate
2017-10-04SCI: Set default MT-32 reverb before each soundRuud Klaver
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.
2017-10-04SCI: Play MIDI version of SCI0 sound resource if user prefers itRuud Klaver
If the user has "Prefer digital sound effects" disabled for a SCI0 game, do not play the digital sample version of a sound resource, if such data is present. When the resource has only digital sample data and no MIDI information, play the sample instead. Closes gh-1022.
2017-09-27SCI32: Implement SCI3-variant volume handlingColin Snover
Trying to find differences in Lighthouse's audio sample playback, I discovered that SCI3 had its own variant of handling volumes and sending this volume information back to game scripts. It is not known if this fixes any sound bug.
2017-09-24SCI32: Implement per-channel audio panningColin Snover
Used by RAMA, in various places, starting with the refrigerator at base camp after the cable car at the beginning of the game.
2017-09-25SCI: SQ4: Now using additional and enhanced Win3.11 samplesMartin Kiewitz
Which were originally only played, when using the Windows interpreter. Afaik the DOS interpreter was incapable of playing more than 1 sample at a time, which was probably the reason why Sierra only added these for the Windows interpreter. For example a sample is now played, when points are awarded. Those samples are currently used all the time and will also enhance the game, when platform DOS is chosen. In case someone wishes to opt-out of this, we could add a game specific option. We do something like this for Space Quest 3 already, that's why I don't see a reason to add a game option right now.
2017-09-19SCI32: Add audio dump debugger commandColin Snover
2017-09-12SCI: Omit SysEx delays when sending to MT-32 emulatorColin Snover
Real MIDI devices, and MT-32 in particular, need delays between SysEx messages to ensure sufficient time to receive and process the incoming data buffer. Sending too much data too quickly to these devices can cause them to crash with a buffer overflow. The MT-32 emulator, on the other hand, has no problem receiving SysEx data instantly, so skipping the delays means that games that send lots of data to the MT-32 will start up much faster.
2017-09-10SCI: Remove dead codeColin Snover
2017-09-10SCI32: Fix bad audio loopingColin Snover
Fixes Trac#10182.
2017-09-09SCI32: Fix Phant2 movie-vs-game playback volumesColin Snover
This update should give the game the default mix it receives in Windows. If necessary, the half-volume audio bug in the DOS interpreter can be added as an additional hack for this game, since there are still some sub-par audio mixes that might need additional correction (like Curtis talking to Blob when taking her out of the cage in his apartment at the start of the game) which were also bad in the Windows version of the game. Fixes Trac#10165.
2017-08-26SCI32: Fix SFX volume being misapplied to music & speech in some gamesColin Snover
This was happening in games with game scripts that control the master volume themselves by applying the master volume to each channel sent to the kernel, instead of relying on the kernel to manage the master volume for them.
2017-07-30SCI32: Make sure audio is not paused from the futureColin Snover
This can occur when a save game from the past is loaded and the audio system was paused prior to loading the save game. This was fixed eventually in SSCI somewhere around GK2, since it pauses all audio before restoring a game and then resumes it after the save game is loaded (after all of the audio channels have been added from the save game). Since this would seem to be a problem for earlier games as well, this change is applied universally instead of being conditionally applied only to the games with interpreters containing this change. This patch contains some additional sanity checks that emit warnings if individual channels end up being started from the future. There was never such checking in SSCI, and it does not seem likely to ever happen, but it is unclear right now if this is an actual problem or not.
2017-07-23SCI32: Emit a warning when an audio resource cannot be foundColin Snover
Refs Trac#9976.
2017-07-17SCI32: Destroy audio streams in Audio32 using DisposeAfterUse flagColin Snover
Since Resource::makeStream returns a MemoryReadStream which will not attempt to free the resource memory, it is fine to always dispose those streams and get rid of the separate resourceStream property, which was a holdover from some past WIP resource design which no longer exists.
2017-07-17SCI32: Fix stream leaks in Audio32/SOLStreamColin Snover
makeSOLStream was leaking the SeekableSubReadStream object it creates itself if it was not called with DisposeAfterUse::YES. That substream is an implementation detail which should not rely on the caller to be destroyed.
2017-07-17SCI32: Fix playback of looped audioColin Snover
This fixes at least Lighthouse audio 808 in room 270, and audio 801 in room 810.
2017-07-07SCI32: Force General MIDI for games that support nothing elseColin Snover
* MGDX has only GM music; * KQ7 1.x's AdLib data is incomplete, so is not usable even though it is partially there Fixes Trac#9789.
2017-07-07SCI32: Fix missing music in MGDXColin Snover
GM patch data is the same across all SCI32 games.
2017-06-18SCI32: Forward OLDDPCM8 parameter instead of using an if-elseColin Snover
Thanks @OmerMor for pointing out this improvement.
2017-06-18SCI: Fix looping of sounds that are not initialized yetColin Snover
This fixes at least the character selection screen in QFG4CD, where the sound for the torches is supposed to loop, but wasn't because kDoSoundSetLoop would bail out before setting the loop property on the soundObj.
2017-06-18SCI: Switch SCI2 games to use Audio32Colin Snover
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.
2017-06-18SCI32: Minor tweaks to improve code clarity & consistencyColin Snover
2017-06-18SCI32: Fix Audio32 mix volumesColin Snover
The previous code for attenuating audio channels was not accurate, so samples were quieter than they were supposed to be when mixed together. Robots were also being mixed without attenuation, which was incorrect.
2017-06-17SCI32: Support old-format 8-bit DPCM coding for SCI2Colin Snover
2017-06-17SCI32: Implement engine-accurate DPCM overflow behaviourColin Snover
DPCM decompression algorithms in SSCI operate directly on 8- and 16-bit registers, so any sample that ends up being out-of-range during decompression gets wrapped by the CPU, not clipped. This does not fix any known problem with AUD files, but there are some VMDs (e.g. GK2 5280.VMD) which are known to contain OOR samples. Making this code more accurate should prevent trouble with any other similar files.