Commit Graph
91 Commits
Author SHA1 Message Date
Colin Snover 9a637ec324 SCI32: Skip bad map 405 on CD 1 of PQ:SWAT
The resources on CD 1 are corrupt and point to invalid locations
in the CD 1 RESOURCE.AUD. This can be noticed during the briefing
on the Lucy Long callup, where descriptions of the map are missing
and eventually the game gets stuck waiting for missing audio to
finish playback.
2017-03-30 19:46:27 -05: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 65fe7bcfd8 SCI: Print more detailed information on audio header size mismatch 2017-03-30 19:46:27 -05:00
Colin Snover 0be9ace649 SCI: Fix incorrect read of LB2/MG256 audio sizes
This happened to work previously because the size was not checked
for validity, and because the audio player calculates its own size
so this value was never actually used.
2017-03-30 19:46:27 -05:00
Colin Snover 477e31cea6 SCI32: Ignore invalid audio map entries in GK2
The invalid entries, which are on CD 6, appear to correspond to
audio that's on CD 4 (though not with the correct offset for CD
4's RESOURCE.AUD).

Skipping the invalid map entries on CD 6 should cause these audio
files to be loaded from the CD 4 audio bundle if they are
requested during chapter six since ScummVM combines resources from
all CDs and matches on their IDs.
2017-03-30 19:46:27 -05:00
Colin Snover a233696212 SCI: Update formatting strings to match updated Span API 2017-03-30 14:23:41 -05:00
Colin Snover 31daa956d6 SCI: Implement bounds-checked reads of game resources 2017-03-27 19:42:31 -05:00
Colin Snover 4eecd48c64 SCI32: Remove unnecessary call to unalloc
When the Resource is deleted, it will deallocate the memory, so
it is not necessary to do that manually.
2017-01-11 11:01:38 -06:00
Colin Snover f1ca9ccc64 SCI32: Fix kSetLanguage 2017-01-09 19:38:59 -06:00
Colin Snover 1337e82b0b SCI: Fix invalid read of LB2 audio map 448 2016-12-03 12:21:56 -06:00
Colin Snover 273695a11e SCI: Remove use of snprintf 2016-12-03 12:21:55 -06:00
Colin Snover 0e53c8e9f3 SCI32: Improve MGDX support
Audio directory switching is temporarily disabled because it
causes use-after-free in the resource manager.
2016-09-29 19:39:16 -05:00
Colin Snover c4250c05d0 SCI32: Enable multi-disc audio resources
Phant1, PQ:SWAT, GK2, and Phant2 all have different audio maps
and audio volumes on each CD. In order to make this work within
ScummVM, where CDs are never swapped, each RESOURCE.AUD for these
games must be renamed to RESAUD.00x and each RESOURCE.SFX renamed
to RESSFX.00x.
2016-08-19 15:23:10 -05:00
Colin Snover a9e2630d4e SCI: Assert on seeks past the end of audio resource bundles
This should never be allowed to happen, but currently does on
multi-CD games with different resource bundles on difference CDs
(Phant1, PQ:SWAT, GK2) because the resource manager does not yet
have the ability to handle this situation.
2016-06-22 13:05:18 -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
Martin Kiewitz 6779340b24 SCI: Truncate channel data in case it goes beyond resource size
Fixes invalid memory access during kq5 floppy ending
2016-03-08 03:36:02 +01:00
Filippos Karapetis cdbd7c8add SCI: Use uint32 instead of unsigned int 2016-03-01 01:12:58 +02:00
Martin Kiewitz 0dd760724e SCI32: split up SCI2.1 into EARLY/MIDDLE/LATE
- 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
2015-12-29 01:44:11 +01:00
Willem Jan Palenstijn 5028487038 SCI: Use sound resource priority by default for songs
SCI1 sound resources can have an embedded priority. We now use that by
default, unless an explicit DoSound/SetPriority call overrides it.
Thanks waltervn.

This fixes relative priority of songs in at least PQ3 room 29.

Also increase savegame version to 33.
2015-02-15 14:05:36 +01:00
Filippos Karapetis 9783f0bbd9 SCI: Remove trailing whitespace 2014-10-28 16:17:06 +02:00
Willem Jan Palenstijn 134aa5af09 SCI: Fix reading SCI1 midi channel flags
Thanks waltervn
2014-10-03 01:19:01 +02:00
Johannes Schickel 8fc7d60feb SCI: Make GPL headers consistent in themselves. 2014-02-18 02:39:37 +01:00
Willem Jan Palenstijn 857d2e7bef SCI: Rewrite MIDI channel remapping
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-12-31 13:52:15 +01:00
Willem Jan Palenstijn f777e54df2 SCI: Reduce indentation depth 2013-12-31 13:42:58 +01:00
Martin Kiewitz 693d5e6625 SCI: rave support (KQ6 hires portrait lip sync)
Thanks to wjp and [md5] for helping
2013-12-11 08:25:23 +01:00
Filippos Karapetis fa2ea4fc61 SCI: Add handling for the RAVE resource type, found in KQ6CD
This contains the sync data in the Windows version of KQ6CD.
Note that currently the sync36 resource is 2 bytes bigger
(it contains 2 bytes from the RAVE resource). Some test code
has also been added to dump the RAVE sync resources
2013-12-10 01:41:15 +02:00
Willem Jan Palenstijn 24b0b6aa43 SCI: Fix memory leak 2013-04-20 16:27:59 +02:00
Max Horn 4f8665fc83 COMMON: Move isFoo functions to namespace Common, add doxygen comments 2012-02-20 16:18:27 +01:00
Max Horn 658080deed ALL: Avoid using is* macros from ctype.h
On some systems, passing signed chars to macros like isspace() etc. lead
to a runtime error. Hence, mark these macros as forbidden by default,
and introduce otherwise equivalent alternatives for them.
2012-02-15 16:51:37 +01:00
Willem Jan Palenstijn 56fb56936e SCI: Clean up some memory management and loops 2012-01-15 18:25:00 +01:00
Filippos Karapetis f2c163a569 SCI: Plug a leak in ResourceManager::processWavePatch()
Many thanks to digitall for finding this one
2012-01-15 19:02:19 +02:00
Filippos Karapetis 9dcab12160 SCI: Fixed bug in commit 1a17bba.
Thanks to wjp for pointing it out.
2011-11-02 00:23:18 +02:00
Filippos Karapetis 1a17bba1e4 SCI: Fix Common::List::erase usage.
Thanks to Tron for pointing that out.
2011-11-02 00:17:13 +02:00
Littleboy b694a78f62 ANALYSIS: Add static casts to is* functions
This fixes a potential problem with passing char values that would be sign-extended and yield unexpected results.
See http://msdn.microsoft.com/en-us/library/ms245348.aspx
2011-06-23 08:52:52 -04:00
Max Horn 88913c0139 ALL: Remove trailing whitespaces
This tries to make our code a bit more compliant with our code formatting
conventions. For future use, this is the command I used:
  git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//'
2011-06-20 00:59:48 +02:00
strangerke 69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Ori Avtalion 9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Max Horn 0ce2ca4e00 COMMON: Replace MKID_BE by MKTAG
MKID_BE relied on unspecified behavior of the C++ compiler,
and as such was always a bit unsafe. The new MKTAG macro
is slightly less elegant, but does no longer depend on the
behavior of the compiler.
Inspired by FFmpeg, which has an almost identical macro.
2011-04-12 16:53:15 +02:00
Filippos Karapetis e4b46bd159 SCI: Added resource manager support for changing the audio directory dynamically. Also,
moved some audio-specific resource code inside resource_audio.cpp

This functionality is used by kSetLanguage(), called when switching the language in
MUMG Deluxe from the game's main menu.

svn-id: r55872
2011-02-10 16:48:29 +00:00
Filippos Karapetis d915560f44 SCI: Moved some audio resource code to resource_audio.cpp
svn-id: r55865
2011-02-10 12:40:48 +00:00
Filippos Karapetis 2c2f3a97e6 SCI: Added support for the alternate Windows MIDI soundtracks of the CD versions of EcoQuest, Jones, KQ5 and SQ4
svn-id: r54476
2010-11-25 14:22:09 +00:00
Filippos Karapetis 52898b6336 SCI: Fixed digital audio at the beginning of KQ5CD and removed a hack for the Windows version
svn-id: r54466
2010-11-25 02:21:07 +00:00
Filippos Karapetis 7508260954 SCI: Added support for the alternative GM tracks of the Windows version of KQ5CD (bug #3041239)
Note that the empty GM track for the Sierra logo makes the game hang, so the
MT-32 track is used, which sounds awful

svn-id: r54464
2010-11-25 01:19:45 +00:00
Matthew Hoops 8a788d16d7 SCI: Fix compile when SCI32 is not enabled
svn-id: r54160
2010-11-09 16:06:33 +00:00
Torbjörn Andersson c91a07229a JANITORIAL: Removed most punctuation at end of warning() and error()
Our warning() and error() functions always add an exclamation mark
to the end of the message anyway.

svn-id: r52791
2010-09-18 10:55:16 +00:00
Filippos Karapetis 928bcdbe09 SCI: Some changes to the fallback detector (sync with branch 1.2.0)
Added more graceful handling of the case where SCI32 isn't built in and the
user tries to detect or start a SCI32 game

svn-id: r52789
2010-09-18 09:47:18 +00:00
Walter van Niftrik 8bbbcfe5b8 SCI: Fix digital track regression from r52662.
svn-id: r52666
2010-09-09 23:01:51 +00:00
Walter van Niftrik 5eb0314e4c SCI: Fix last MIDI channel number for adlib driver
svn-id: r52662
2010-09-09 18:26:16 +00:00
Filippos Karapetis 31c889d7ce SCI: Fixed the GM detection introduced in rev #52211 to check the first available track, instead of track 1 (which doesn't always exist, e.g. in Pharkas). Also, added a comment inside applyPatch()
svn-id: r52222
2010-08-20 09:35:20 +00:00
Filippos Karapetis 37d2f10206 SCI: Added checking for the existence of a GM track, to determine if device ID 7 or 12 should be used. Fixes the GM music in the demo of QFG3, which is using an in-between version of SCI1 and SCI1.1
svn-id: r52211
2010-08-19 13:52:21 +00:00