Commit graph

371 commits

Author SHA1 Message Date
Colin Snover
c788642b72 SCI: Add ifdef for SCI32 types in processPatch 2017-05-09 00:26:23 -05:00
Colin Snover
eb6e179169 SCI: Fix SCI1.1 patch resources
While earlier commits had fixed handling of audio resources in
audio bundles to match SSCI, audio *patches* in SCI16 were still
being treated like standard resource patches. They are now
special-cased in the resource manager, just like SCI32.

Incidentally, while fixing the problem with audio patches, I also
noticed that the patch resource fixes for SQ5/German were very
similar to the special-case operations for resources in SCI32,
though using an odd heuristic. After investigating, it appears
that Sierra SCI1.1 works mostly like SCI32, and not like what
was there from SCI View. So, the old special-case code is deleted
and the special-case code for SCI32 has been expanded to cover
SCI1.1. (SSCI prior to 1.1 do not appear to do this
special-casing.)

Fixes Trac#9773.
2017-05-08 23:59:28 -05:00
Colin Snover
f8d4ffa8ed SCI: Fix Audio36 patch suffix matching against lowercase extensions
The Lighthouse glider demo comes with a file named SDirectX.dll
which was failing to match the case-sensitive suffix search for
.DLL.
2017-05-08 11:26:47 -05:00
Colin Snover
130c9ecbb8 SCI: Fix some issues with ChunkResourceSource
1. The chunk number was hard-coded to zero and inaccessible.
2. Running ResourceManager::getVolumeFile for a chunk resource
   would always return nullptr instead of a stream of the chunk,
   which made it impossible to generically validate that resources
   being added were within bounds of the container file (or, in
   this case, container chunk).
2017-05-08 11:26:46 -05:00
Colin Snover
554a73e012 SCI: Improve detection and reporting of resource errors
Simple assertions in the resource manager are not sufficient to
track down resource corruption issues, and some error conditions
that were being checked already were either ignored or only raised
as warnings that casual users would be unlikely to see.

Ideally, error handling in ResourceManager would be improved to
the point where errors would correctly propagate out of it (so the
warning dialogue could be displayed from outside), but right now
error codes are dropped all over the place, and it would take more
effort to fix that without much benefit for the current situation.
If/until someone has the energy to fix that, the warning dialogue
is simply shown from ResourceManager::scanNewSources.

Refs Trac#9764.
2017-05-08 11:26:46 -05:00
Colin Snover
b208c82494 SCI32: Add support for Shivers interactive demo
Closes Trac#9745.
2017-05-01 12:31:21 -05:00
Colin Snover
89ec9e6762 SCI32: Remove SCI3 TODO
SCI3 resources appear to already be properly handled.
2017-04-23 22:13:53 -05:00
Colin Snover
82d9cacba0 SCI32: Allow resource maps with missing corresponding volumes
GK2 on Steam comes with an extra bogus resource map file which
would previously cause ScummVM to refuse to load the game due to
a mismatch in the number of map & volume files. This does not
cause any harm, but is a pain for users (since it requires them to
manually delete the file, and it will be recreated if a user runs
the Steam game file integrity check), so allow the game to load
with a warning instead.
2017-04-23 22:11:05 -05:00
Colin Snover
b3ecc54a7a SCI: Always search for .CSC script patches
Skipping a search for .CSC scripts when any .SCR files exist does
not work with at least Phant2, because it comes with an INSTALL.SCR
file. Searching unconditionally for .CSC files should not cause any
issues since the game scripts will either be in .SCR format or in
.CSC format, not both in the same game.
2017-04-23 13:07:25 -05:00
Colin Snover
866419fa71 SCI: Implement fallback detection for SCI3 2017-04-23 13:07:25 -05:00
Colin Snover
8aed6759e4 SCI32: Remove incomplete SCI3 detection warning
Map format is the same as SCI2/2.1 and volume format is detected
correctly as SCI3.
2017-04-23 13:07:25 -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
d0e9724ae1 SCI32: Support reading sound effects from normal resource bundles 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
Willem Jan Palenstijn
905feaa8c2 SCI: Fix unaligned read 2017-02-18 15:07:02 +01:00
Colin Snover
70cfdb6a1f SCI32: Ignore .OLD extension when searching Audio36 patches
KQ7 2.00b includes a SIERRINF.OLD file which should not be matched.
2017-01-09 19:34:54 -06:00
Colin Snover
472a43695a SCI: Remove unnecessary indirection in Resource::loadPatch 2016-12-03 12:21:55 -06:00
Colin Snover
fe8fbf7007 SCI32: Fix reading view, pic, and palette patches
Unlike SCI16 games, the location of data within SCI32 patch files
is calculated on a per-resource-type basis by the game engine,
instead of by reading byte 1 of the patch file.
2016-11-20 16:16:17 -06:00
Colin Snover
ee4b172d54 SCI: Remove old SCI32 hires detection heuristic 2016-11-02 15:43:07 -05:00
Colin Snover
8cb994b801 SCI32: Increase resource manager LRU cache size
This fixes high CPU utilisation playing Stooge Fighter 3 in SQ6.
2016-09-29 19:39:16 -05:00
Colin Snover
bf7adaa58f SCI32: Fix incorrect warnings about unlocking type 140
This type in SSCI corresponds to Wave resources, but since ScummVM
does not differentiate between Wave and Audio resources, just say
it's an Audio resource type, not an Invalid resource type.
2016-09-29 19:39:16 -05:00
Filippos Karapetis
b620b92ee7 SCI32: Fix fallback detector for SCI32 games again
A regression from c4250c05d0
2016-08-22 18:50:36 +03:00
Colin Snover
b106ba1102 SCI: Avoid attempts to use exe/txt/dll files as patches
Fixes some false warnings when games try to read in non-patch
files with names that start with A/B/S/T.
2016-08-19 15:23:10 -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
0a4a2567a3 SCI32: Partially implement kCD 2016-08-19 15:23:10 -05:00
Colin Snover
a6370aa688 SCI: Fix memory leaks in ResourceManager 2016-07-24 11:36:48 -05:00
Colin Snover
a3055d3f49 SCI: Add an explanation about LRU removals when fetching resources
Several times I have run into this code and had to take a minute
to remind myself that the call to remove from the LRU on find is
not wrong, so it seemed to deserve a comment.
2016-06-21 08:17:28 -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
Colin Snover
ffcab2fa5d SCI: Fix memory leaks in resource patcher 2016-06-14 20:58:53 -05:00
Johannes Schickel
b6a8907edf SCI: Cleanup: Use Common::StringArray instead of custom type. 2016-03-01 19:18:36 +01:00
Johannes Schickel
fd5799aa19 SCI: Fix Macintosh game sources listing. 2016-03-01 19:16:10 +01:00
Johannes Schickel
1ae2e0594d SCI: Use MacResManager when checking for Mac resource forks. 2016-03-01 19:16:10 +01:00
Filippos Karapetis
cdbd7c8add SCI: Use uint32 instead of unsigned int 2016-03-01 01:12:58 +02:00
Filippos Karapetis
9cb7caeb24 SCI: Fix a regression in the fallback detector. Some cleanup
Removed the superfluous initForDetection() function, which was not
updated in commit 2f17ba2b0a and
caused the fallback detector to crash because of uninitialized
variables
2016-02-20 16:56:08 +02:00
Colin Snover
2f17ba2b0a SCI: Increase LRU resource cache for SCI32 games
A single picture in SCI32 is often larger than the 256KiB limit,
meaning that the cache is useless for these games -- which is bad,
because the renderer works directly off raw resource data so it
must be decompressed and in-cache for rendering performance to be
acceptable.
2016-02-18 13:18:03 -06:00
Colin Snover
bb82350630 SCI: Fix broken LRU debugging 2016-02-18 13:18:02 -06:00
Martin Kiewitz
eaf6e5d4f8 SCI: Fix fallback detector crashing on BE regress.
Regression from af3fec8c26
Code resulted in a crash on BE platforms
2016-02-12 20:30:43 +01:00
Martin Kiewitz
63b66b23aa SCI32: version detection - don't remove const
don't remove const during cast
2015-12-29 02:35:07 +01: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
Martin Kiewitz
28967b617f SCI: properly reversed color matching thanks wjp 2014-10-28 22:37:57 +01:00
Filippos Karapetis
4736c490e1 SCI: Separate the rest of the detection-only functions
This should fix bug #6717 - "SCI fallback detection assert failure"
2014-10-18 16:03:49 +03:00
Filippos Karapetis
fe3ed8ded2 SCI: Rename the version of addAppropriateSources() used in detection 2014-10-18 16:03:49 +03:00
Johannes Schickel
8fc7d60feb SCI: Make GPL headers consistent in themselves. 2014-02-18 02:39:37 +01:00
Martin Kiewitz
f7d13415ee SCI: Remove LSL1 Spanish hack (to SCI1 MIDDLE)
fixes transitions not working properly (and
possibly other stuff), hack was added because
of bug #5219, strangely none of it occurs anymore
2014-01-30 21:11:15 +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
9694cbbaaf SCI: Fix resource type range checks 2013-04-20 16:17:49 +02:00
Willem Jan Palenstijn
e89c8c1923 SCI: Remove useless delete 2013-04-17 23:43:02 +02:00
Filippos Karapetis
2b50824133 SCI: Add setter/getter methods to reg_t's
No functionality change has been made with this commit. This avoids
setting and getting the reg_t members directly, and is the basis of any
future work on large SCI3 scripts (larger than 64KB)
2012-06-18 05:24:06 +03:00
Filippos Karapetis
c64a69c363 SCI: Resolve some resource related FIXMEs
These were introduced in 4f6d42d.
The odd comment dates back to FreeSCI, as far as our history goes, and
seems to be a leftover from an old refactoring during FreeSCI's history
2012-05-15 03:05:38 +03:00