Commit graph

175 commits

Author SHA1 Message Date
Colin Snover
17ff41b740 SCI: Use SCI32 naming convention for Audio36/Sync36 patch files in SCI32 2017-09-08 16:02:32 -05:00
Colin Snover
4771c41c35 SCI: Add method to get resource patch file extensions 2017-09-08 16:02:32 -05:00
Colin Snover
5412bda5ab SCI32: Fix loading audio resources from RESSCI.PAT
This is used by Lighthouse.
2017-08-04 13:29:55 -05:00
Colin Snover
4c316d45fd SCI32: Fix ResourceManager::changeAudioDirectory
Fixes Trac#9577.
2017-07-24 19:36:28 -05:00
Colin Snover
d38704e16d SCI: Blacklist certain audio map patch files
Refs Trac#9976.
2017-07-23 16:01:19 -05:00
Colin Snover
cf98e16d90 SCI: Add serialization for ResourceId 2017-06-09 22:48:14 -05:00
Colin Snover
b1ace1a01c SCI: Suppress resource warnings when running fallback detection
For the moment, only warn about bad resources when a game is
actually starting, since unknown but valid resources being
detected by the fallback detector currently also trigger the
warning.
2017-05-13 22:49:40 -05:00
Colin Snover
f44d8b6da6 SCI: Dispose uncached volume file streams
The stream returned by a call to ResourceManager::getVolumeFile
either MUST (when returning an I/O stream from a Common::FSNode)
or must NOT (when returning a Common::File *) be deleted by the
caller, depending upon some internal implementation details of
ResourceSource that should never have been exposed to callers.

FSNode streams that should have been deleted were not being
deleted all the time, which leaked and eventually caused ScummVM
to run out of FDs.

This commit improves this situation by shielding callers from
these internal details by centralizing the destruction logic in
one place, so FSNode read streams stop being leaked and callers
no longer need to know stuff about the internals of the
ResourceSource they are trying to read in order to avoid leaking
or breaking the volume file cache.

Fixes Trac#9782.
2017-05-13 22:46:25 -05:00
Colin Snover
ea6eebca09 SCI: Fix reading of Rave data from compressed KQ6 audio volumes
Refs Trac#9764.
2017-05-10 15:29:53 -05:00
Colin Snover
13925065cb SCI: Fix unnecessary copy of Common::String 2017-05-08 11:26:47 -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
866419fa71 SCI: Implement fallback detection for SCI3 2017-04-23 13:07:25 -05:00
Colin Snover
fcaf15aa50 SCI: Add alloc_list command to debugger
This command lists all resources that are currently loaded into
memory, plus the number of locks that exist on each loaded
resource.
2017-04-22 19:38:13 -05:00
Colin Snover
77a4074106 SCI: Protect and clarify the purpose of Resource _header data 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
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
31daa956d6 SCI: Implement bounds-checked reads of game resources 2017-03-27 19:42:31 -05:00
Colin Snover
f1ca9ccc64 SCI32: Fix kSetLanguage 2017-01-09 19:38:59 -06:00
Colin Snover
273695a11e SCI: Remove use of snprintf 2016-12-03 12:21:55 -06:00
Colin Snover
ee4b172d54 SCI: Remove old SCI32 hires detection heuristic 2016-11-02 15:43:07 -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
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
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
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
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
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
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
Strangerke
6795fdf639 SCI: Janitorial - Fix spacing errors 2013-11-23 11:02:24 +01: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
Willem Jan Palenstijn
4f6d42d77b SCI: Add a few FIXMEs 2012-05-13 16:23:15 +02:00
Willem Jan Palenstijn
56fb56936e SCI: Clean up some memory management and loops 2012-01-15 18:25:00 +01:00
Filippos Karapetis
935eaa175b SCI: Move the palette merging checking code inside the GfxPalette class 2011-10-19 23:52:51 +03:00
strangerke
69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
md5
d95b5331fb SCI: Some palette related changes
- Moved palette color count inside the GfxPalette class
- Enabled all of the kPalette subops for 16 color SCI1 games, apart from
the ones for intensity palette animation, and palette resource loading
- Removed isVGA() and isAmiga32color() methods from the resource manager -
they ended up in having inconsistent code
2011-03-04 22:04:13 +02:00
Matthew Hoops
758e495872 SCI: Add support for the KQ5 FM Towns resource format
Thanks to alexbevi for providing details on the format
2011-02-16 14:24:38 -05: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
c7c0198e27 SCI: Renamed addInternalSources -> addAudioSources and separated the script chunk loading code
svn-id: r55866
2011-02-10 12:57:43 +00:00
Matthew Hoops
405fd0b5eb SCI: Update resource types for SCI2.1/3
svn-id: r54220
2010-11-13 00:20:23 +00:00
Filippos Karapetis
55f0b88c07 SCI: Fixed the fallback detector again
This is a regression from r54155, as we previously ignored the result of 
addInternalSources() in the fallback detector

svn-id: r54163
2010-11-09 17:07:34 +00:00
Lars Skovlund
9a0b6ad69a SCI: Add resource manager support for SCI3 games.
ScummVM now rejects them properly instead of spewing lots of
unintelligible stuff. 

svn-id: r54155
2010-11-09 14:25:39 +00:00
Filippos Karapetis
4e27844fef SCI: Some changes regarding resources
- Renamed the debug command "resource_size" to "resource_info", as it now provides
the location of where a specified resource is found (i.e. the resource.xxx file, or
the file name itself, if the resource is a patch)
- "duskdump" shows the original location of dumped resources
- loadResource() now shows the location of files that couldn't be loaded

svn-id: r52667
2010-09-10 14:07:32 +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
Martin Kiewitz
89d4e44281 SCI: doing detectDoSoundType() properly sci0early
checking, if sound resources are sci0early or late for sci0early games instead of hardcoding lsl2

svn-id: r52514
2010-09-04 08:51:10 +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