Commit Graph
422 Commits
Author SHA1 Message Date
sluicebox e5b10e557c SCI: Load volume resource files in consistent order
The order that volume resources are loaded subtly affects engine
behavior when they contain different versions of the same resource.
This order has been the file enumeration order from the operating
system, causing inconsistent behavior between environments and even
between two different directories of identical files.
2020-11-18 14:05:22 -08:00
Cameron Cawley c877097b49 ALL: Remove use of "" in Common::U32String constructors 2020-11-16 16:56:58 +00:00
wonst719 00bd552840 SCI: Korean code cleanup
- Move repeated message.map tests into ResourceManager::isKoreanMessageMap()
- Fix comments
- Fix formatting
- Remove unused codes
2020-11-08 22:26:31 +02:00
wonst719 b7664c24dc SCI: Korean fan translation support 2020-11-08 22:26:31 +02:00
Vladimir Serbinenko 8fdfb15f6e SCI: Fix crash when running sq6-mac with macbinary
The resource validation fails big time because no file Data9 exists.
It's expected as its in Data9.bin instead. Since we check resource fork
explicitly in the case of resource-fork resources this check is redundant
2020-10-31 11:27:49 +02:00
sluicebox 5efa0eb70e SCI32: Read AIFF audio patch files
Used by LSL6 hires Mac
2020-09-01 10:31:32 -07:00
aryanrawlani28 20d661947b SCI: Fix typo for showScummVMDialog 2020-08-30 14:43:41 +02:00
aryanrawlani28 12e4f871a3 GUI: U32: Improve u32 in all engine subsystems
- Common: add wordWrap function to ustr.cpp
- Bladerunner: Explicitly state we have a U32String in subs (same as Subtitles::loadOuttakeSubsText)
- Don't use translations for engine specific "put strings", because they might not support.
- SCI: Use const references for showScummVMDialog
- SCUMM:
-- Don't use translation in md5 warning. left comments with the translated version.
-- Remove some redundant headers in help.cpp
-- Don't use translation in handleSaveload when printing to console
-- Also, display success transaction correctly via u32::format
- TESTBED: Use fake constructor when setting label of button
- SKY: Correctly use translation when using SaveStateDescription
- ULTIMA: Don't use translations when display_string
- ENGINES:
-- GenerateUnknownGameReport correctly, with proper translations.
-- There was an error, where a function had been declared twice, in a header file. Correct this.
2020-08-30 14:43:41 +02:00
aryanrawlani28 bed05ea134 GUI: U32: Fix compilation errors across entire project
After the initial changes just to scummvm/gui for u32, this commit includes the whole project

- Widget creations now always have u32 descriptions, labels, or tooltips
- Message dialogs make use of default arguments instead of providing the same argument explicitly
- encode String::format properly before passing on as argument where necessary
- Modify hugo utils (yesNoBox and notify box) to use u32
- Also provide fake constructors for the above which redirect to the u32 constructor
- Convert all keymap descriptions to u32 across all engines
- showConfirmationDialog in mohawk now uses u32
- showScummVMDialog also uses u32
- Scumm engine has dialogs now which use u32
- General fixes and wrapping convertToU32String for setLabels and related functions
- Add a fake constructor to MesssageDialog which redirects to the u32 constructor
2020-08-30 14:43:41 +02:00
Bastien Bouclet 5afec16c3b SCI: Fix stack use after scope in detection code 2020-06-05 20:11:26 +02:00
sluicebox 772df1fb3b SCI: Ignore Windows GM sound in DOS MOTHERGOOSE256
Fixes music in multilingual DOS MOTHERGOOSE256 CD, bug #11243
2020-05-06 18:24:14 -07:00
sluicebox 85e27b0caf SCI32: Implement Mac kSetLanguage 2020-05-05 12:14:18 -07:00
sluicebox 50aff67f4c SCI: Use '#' pattern when matching filename digits 2020-04-21 13:46:29 -07:00
sluicebox 8117b6bad8 SCI32: Use correct resource type mapping on Mac
Fixes video in GK2 Mac
2020-04-17 01:10:44 -07:00
sluicebox 6c7d39618f SCI32: Fix loading Mac Sync36 resources 2020-04-12 17:44:01 -07:00
sluicebox 6e9d0fafb5 SCI32: Use Mac cursor palettes
Fixes cursor colors in SCI32 Mac games that use native cursor resources.
2020-02-12 09:04:57 -08:00
Filippos Karapetis ff044aa431 SCI: Move the GK2 subtitle patch dialog inside the SciEngine class
This is now grouped together with the other GUI messages. The script
patcher class itself does not need to handle such logic
2020-02-09 23:27:11 +02:00
Zvika 2f9f488b1e SCI: fix segfault upon detection of pirated game, without fallback 2020-02-03 09:08:01 +02:00
Colin Snover 07df6cc254 SCI: Add built-in resource patcher
The resource patcher can be used to patch non-script resources
like views, maps, sounds, etc. It is more primitive than the script
patcher in that it does not use signatures for safe and automatic
patch relocation, but it does at least allow existing resources to
be grown if needed.

Refs Trac#9788. Refs Trac#9690.
2020-01-19 21:37:20 +02:00
sluicebox 172bc97110 SCI: Ignore incorrectly detected volume version
Ignores a detected volume version of SCI3 when the map version is less
than SCI2, as that indicates detectVolVersion's heuristics failed.

SQ1VGA Russian has volume files with a few junk bytes in between
resource entries, which causes detectVolVersion to return SCI3
instead of the expected result of Invalid and then use the
correctly detected map version. The detection algorithm tries each
version until it finds one that fits, and the SCI3 pattern happens
to fit because it's necessarily the most permissive due to the
wCompression bytes containing meaningless values.

Fixes bug #10156
2020-01-10 16:44:37 -08:00
D G Turner d11c61db14 SCI: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-12-01 05:06:31 +00:00
sluicebox 9e6ad22c2a SCI32: Include Mac resource filenames with two digits
KQ7, Phant1, and others have more than 9 "Data" files
2019-10-23 21:08:24 -07:00
sluicebox 511e5441e3 SCI32: Enable Mac code (remove ENABLE_SCI32_MAC) 2019-10-11 14:18:26 -07:00
sluicebox 56ea963cea SCI: Create message workaround system
Adds a new workaround system for known broken messages and their
corresponding audio and sync resources. This replaces all special
cases in c++ and several script patches with data structures and
generic handling.

Common message bugs:
- Wrong tuple requested by game script
- Wrong tuple in message resource
- Wrong message text that exists in another record
- Missing message text
- Audio or sync resource with different tuple than message
2019-06-09 15:35:57 -07:00
sluicebox b00049732f SCI: Fix diskdump patch file headers
Fix 'diskdump' debugger command creating an additional patch file
header for resources that were loaded from patch files
2019-04-15 22:48:19 +03:00
sluicebox 08ae52608c SCI: Fix sync36 patch files not being loaded
Fixes GK1 bug #10788
2019-03-03 22:44:29 +02:00
Filippos Karapetis 57f114cbc3 SCI: Don't try to validate resources added from a Mac resource fork
The fix has been authored originally by csnover, adapted from commit ca420e44167e5ee488b4ad547104fa6b976e6f1c

Fixes Trac#10440, Trac#10892.
2018-12-30 12:53:23 +02:00
Colin Snover 0962edc69b SCI: Silence more incorrect audio patch type warnings 2018-12-05 01:02:26 +02:00
Filippos Karapetis 7cbd3782f1 SCI: Load the correct sound effects in Hoyle 4
Fixes bug #10412
2018-08-27 23:45:34 +03:00
Dan Church 0c26da90bb SCI32: Fix segfault when SCI3 vocab isn't found
Seen when attempting to detect and/or run the Shivers 2 demo.

Closes gh-1106.
2018-01-02 12:57:59 -06:00
Colin Snover 617497d094 SCI: Fix UB shifting negative integers 2017-11-19 12:48:14 -06:00
Colin Snover dc7e37fdb6 SCI32: Fix extremely broken patch for RAMA RESOURCE.SFX
Obviously, games other than RAMA need to have sound effects
volumes.
2017-09-29 23:02:38 -05:00
Colin Snover f43b2c66fe SCI32: Improve RESOURCE.SFX fallback for RAMA
Since Datafiles says to rename any RESOURCE.SFX to RESSFX.00n,
and there is only a RESOURCE.SFX on CD 1, don't confuse users by
failing to use RESSFX.001 for CD2 and CD3.
2017-09-29 20:20:20 -05:00
Colin Snover 743082ac8c SCI32: Disable all SCI32 Mac code
This code is currently untestable and is almost certainly at least
partly based on guesswork & not actual reverse-engineering (as was
the case for all other pre-2015 SCI32 code), so future developers
interested in adding SCI32 Mac support should use it only as an
intermediate reference rather than as known good code.
2017-09-24 22:56:59 -05:00
Colin Snover 9fc24ed0b0 SCI32: Support RAMA's single sound effects volume
The original installer copied RESOURCE.SFX to the hard drive so
there was only one RESOURCE.SFX on CD 1. Instead of requiring
users to create duplicates, just use the single RESOURCE.SFX if it
exists.
2017-09-19 20:00:28 -05:00
Colin Snover 200c8c442b SCI: Remove dead code 2017-09-10 22:17:17 -05:00
Colin Snover 4771c41c35 SCI: Add method to get resource patch file extensions 2017-09-08 16:02:32 -05:00
Colin Snover d97f192f45 SCI: Improve array bounds safety check
There is no practical risk now since the enum and array sizes are
the same, but there is no reason to rely on a separate data
structure to avoid potential out-of-bounds index use here instead
of just checking the array size directly, which is always safe.
2017-09-08 16:02:32 -05:00
Colin Snover cc3088c529 SCI32: Make audio resource size mismatch non-fatal
Lighthouse audio.225 in RESSCI.002 (US English 1.0C) triggers this
condition; the audio resource says its data is one byte larger
than the recorded size in the volume. In this case, just use the
smaller of the two values for the size, to avoid overreads.
2017-09-03 20:58:08 -05:00
Colin Snover b5bd7b8478 SCI32: Stop blacklisting 37.MAP from Phantasmagoria
It turns out that GOG.com version of Phantasmagoria needs the
37.MAP patch file because for some reason the 37.MAP in RESSCI.000
is empty (36 bytes, versus the correct file which is ~1kB).
Fortunately, this file is the same across all CDs in the original
US release, so hopefully unblocking this patch will not cause any
problems for any of the CD releases either.

Fixes Trac#10161.
2017-08-25 18:53: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 d38704e16d SCI: Blacklist certain audio map patch files
Refs Trac#9976.
2017-07-23 16:01:19 -05:00
Colin Snover 4d52b018a2 SCI: Keep audio maps out of the LRU cache 2017-07-23 16:01:19 -05:00
Colin Snover 970c312e76 SCI32: Detect multi-disc audio by RESSCI files instead of RESAUD
If a user fails to rename audio files in the required manner when
copying them, detecting multi-disc audio by looking for a renamed
audio file does not work very well. Looking at RESSCI.00n is a
better choice, though this is not completely valid since e.g.
Rama 1.0 US has only one RESOURCE.SFX volume which its installer
copies to the hard drive, so a little more work will need to be
done in the future to find and fix these kinds of edge cases.

Refs Trac#9976.
2017-07-23 10:35:13 -05:00
Colin Snover b73906feb7 SCI: Get LRU from list directly, instead of from a reverse iterator 2017-06-09 22:47:54 -05:00
Colin Snover e29f60858d SCI32: Clarify code comment about Steam GK2 RESMAP.001 2017-06-08 00:28:44 -05:00
Colin Snover cb657c0c0f SCI: Ignore patch resources with .DOS and .WIN extensions
Type mismatch is triggered on THEGUIDE.DOS and THEGUIDE.WIN from
at least Phant1 French 1.100.000.
2017-05-20 21:14:18 -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