Commit Graph
13 Commits
Author SHA1 Message Date
Colin Snover e6228f3ff6 SCI32: Fix integer overflow calculating audio duration
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-11-11 20:18:17 -06:00
Colin Snover d53e778739 SCI32: Rewrap comments to 80 columns in SOL decoder 2017-10-06 22:56:26 -05:00
Colin Snover 64d090dcb8 SCI32: Fix stream leaks in Audio32/SOLStream
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-17 23:56:21 -05:00
Colin Snover f3c452c31e SCI32: Forward OLDDPCM8 parameter instead of using an if-else
Thanks @OmerMor for pointing out this improvement.
2017-06-18 21:42:59 -05:00
Colin Snover 12afcaec49 SCI32: Support old-format 8-bit DPCM coding for SCI2 2017-06-17 13:09:27 -05:00
Colin Snover e69507cc28 SCI32: Implement engine-accurate DPCM overflow behaviour
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.
2017-06-17 13:09:27 -05:00
Thierry Crozat 1e38ca45cd SCI: Fix speech in QfG IV on big endian platforms 2017-04-14 00:01:54 +01:00
Colin Snover 0826501ef6 SCI32: Fix audio, wave, VMD, Duck, CLUT, TGA, ZZZ, Etc patches
Specifically, audio patches are used in at least PQ:SWAT
(40103.AUD), Lighthouse (9103.AUD), and the GK2 demo (300.AUD).
2017-03-30 19:46:27 -05:00
Colin Snover 8987d9a889 SCI32: Enable playback of stereo audio 2017-01-09 19:34:54 -06:00
Colin Snover 0f2748b15a SCI32: Implement kRobot 2016-08-19 14:08:22 -05:00
Filippos Karapetis 17983508b3 SCI32: Fix usage of the C++11 override keyword with MSVC
MSVC does not allow the usage of the "override" keyword on function
definition, only on declaration
2016-06-23 21:17:16 +03:00
Colin Snover dcc6234d81 SCI32: Add low-pass filter to 8-bit SOL audio
This improves the perceived quality of audio in games that use
8-bit samples for music, like Torin.
2016-06-21 08:14:11 -05:00
Colin Snover 46551fd4b5 SCI32: Rewrite digital audio engine
This provides a complete implementation of kDoAudio through
SCI2.1mid, plus partial implementation of SCI3 features.

Digital audio calls shunted through kDoSound have also been
updated to go through the SCI32 audio mixer, though these shunts
are a bit hacky because the ScummVM implementation of kDoSound
does not currently match how SSCI kDoSound is designed.

It is probably possible in the future to just replace the SCI1.1
audio code (audio.cpp) with the new SCI32 code, since the major
differences seem to be that (1) SCI1.1 only supported one digital
audio playback channel (this is configurable already), (2) it
had extra commands for CD audio playback and queued sample
playback.
2016-06-20 21:02:21 -05:00