Commit Graph
7940 Commits
Author SHA1 Message Date
Colin Snover ddc00e4211 SCI: Remove unhelpful comment 2017-06-09 22:48:14 -05:00
Colin Snover cf98e16d90 SCI: Add serialization for ResourceId 2017-06-09 22:48:14 -05:00
Colin Snover a2ead7c4a4 SCI32: Fix include path 2017-06-09 22:48:14 -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 06e82211ee SCI: Implement Serializable for Object 2017-06-09 22:47:54 -05:00
Colin Snover 58c83dcd14 COMMON: Make SpanOwner copy assignment make a copy of the owned Span
To move data from one SpanOwner to another, use `moveFrom`.
Thanks @waltervn for pointing out the problem.
2017-06-08 10:45:55 -05:00
Colin Snover e29f60858d SCI32: Clarify code comment about Steam GK2 RESMAP.001 2017-06-08 00:28:44 -05:00
Colin Snover 2482a78fa3 SCI32: Fix wave resource patch offset
This bug was only reproducible when loading a game using the
multi-disc RESSFX.00x bundles.

Fixes Trac#9832.
2017-06-08 00:14:45 -05:00
Colin Snover 03ba3e41f9 SCI32: Return CD speed in kPlatform
This fixes missing playback of some videos in Rama, like the
background video that plays when selecting an email at the
computer at the start of the game.
2017-05-31 22:03:13 -05:00
Martin Kiewitz a8475db05a SCI: SQ4CD: Limit workaround for Russian SQ4 to room 150+900
As proposed by bluegr
2017-05-30 22:11:33 +02:00
Martin Kiewitz 266f68c21b SCI: SQ4CD: Remove room restriction of existing workarounds for end
Fixes bug #9812
2017-05-29 23:44:28 +02:00
Martin Kiewitz 04b5c3a71b SCI32: GK1: Add second beignet timer issue script patch
Should solve bug #9805
2017-05-29 21:21:56 +02:00
Colin Snover f940346812 SCI32: Minor cleanup to plane debug information 2017-05-27 23:36:11 -05:00
Colin Snover ccf5665fac SCI32: Remove dead code 2017-05-27 23:36:11 -05:00
Colin Snover 73fab1e135 SCI32: Remove invalid interaction cursor spinloop in KQ7 2017-05-27 21:57:06 -05:00
Filippos Karapetis a8b3b67d29 SCI32: Update some old comments related to virtual files 2017-05-27 14:33:24 +03:00
Filippos Karapetis 03c1b3307c SCI: Remove a leftover SCI32 hack 2017-05-27 13:32:02 +03:00
Willem Jan Palenstijn d9807b0fca SCI32: Fix warning 2017-05-26 19:33:59 +02:00
Hein-Pieter van Braam 04fb40be2d SCI32: Fix kArrayFill
The ScummVM implementation of class SciArray::fill() has a bug where it
will overwrite the array[index] with the value count times, rather than
fill the array starting from index count times.

This patch fixes that behavior. This was noticed because the LSL7 dice
game was broken, it was impossible to lose. After this patch the dice
game works as expected.

Closes gh-953.
2017-05-26 12:21:43 -05:00
Colin Snover d0040dc8ef SCI32: Fix SCI3 object names > 0xFFFF 2017-05-25 19:25:50 -05:00
Martin Kiewitz ad1cc613ef SCI32: Fix typo in script patch name 2017-05-24 18:49:55 +02:00
Martin Kiewitz 26fe96d637 SCI32: Add script patch for lsl7 cheese maker priority bug
This issue also happens when using the original interpreter.
2017-05-24 18:45:16 +02:00
Martin Kiewitz 97d4a9eff1 SCI32: Add script patch for cheese maker issue
Room 540, was game breaking, but effectively a script
bug, that just happened to work in SSCI.
2017-05-24 15:37:18 +02:00
Hein-Pieter van Braam cffe01536e SCI32: Add 'music/' subdir to file path for LSL7 GOG
LSL7 originally came with music in two qualities in subdirectories of
the 'music' directory, 22s8 and 22s16. The gog.com release doesn't do
this and only ships the hq music in the root of 'music/'. This PR adds
it to the search path.

Closes gh-951.
2017-05-23 23:16:15 -05:00
Colin Snover fdb87619c6 SCI32: Fix selector search for SCI2/2.1 games with missing vocab.997
Fixes Trac#9796.
2017-05-23 22:41:56 -05:00
Colin Snover 63a87ac1f7 SCI32: Fix return value of kWebConnect
On macOS, the return code from OSystem::openUrl was the opposite
of what it was supposed to be; it is now fixed, so this caller
needs to be fixed too.
2017-05-21 19:37:42 -05:00
Colin Snover c73bf1c0ce SCI: Add resource hash to resource_info debugger command
Bad resources that need to be blacklisted sometimes seem to have
the same size as good resources. In such cases, the bad resources
can be identified by hash instead. Adding a hash output to
resource_info will make it easy for users to provide the hash of
questionable resources inside of resource bundles that we do not
have access to.

Refs Trac#9797.
2017-05-20 21:52:00 -05:00
Colin Snover ef69a59467 SCI: Stop leaking locals segments during script reuse
When a game deletes a script and then loads the same script again
before it has been fully deallocated,
SegManager::instantiateScript tries to reuse the same script
& locals segments, but it was failing to reuse the old locals
segment because Script::freeScript would unconditionally clear
the old locals SegmentId, which meant the old locals segment would
just leak.

This patch does not fix old save games which may contain orphaned
locals segments, but should prevent the problem from occurring
going forward. (It is possible to clean up these old save games,
but this is not a big leak so it doesn't seem worth the extra
effort to do so.)
2017-05-20 21:14:18 -05:00
Colin Snover bc728a1c93 SCI: Fix warning about missing base object when loading save games
This situation occurs rarely, but normally, when unreachable but
not yet GC'd objects use a superclass which has already been GC'd.

Thanks to @wjp for looking at this with me and clarifying what
was going on.
2017-05-20 21:14:18 -05:00
Colin Snover eba1e883e9 SCI: Minor punctuation fix in buggy script alert 2017-05-20 21:14:18 -05:00
Colin Snover 4917330038 SCI: Find and store the original static names of objects
See code comment in Object::init for more details.

Fixes Trac#9780.
2017-05-20 21:14:18 -05:00
Colin Snover 1f29e6f241 SCI: Refactor relocation code
This groundwork enables an object to look up its static name
separately from the normal process that is used to populate
Object::_variables when an object is first constructed.

(The static name property needs to be able to be retrieved from
objects inside of earlier save games whose name properties may
have already been modified at runtime, so the code cannot simply
pluck the value out of Object::_variables when they are first
initialised and then persisted into the save game, as nice and
easy as that would have been.)

This commit also helps to clarify the situation with relocation
tables in SCI1 games that start with a zero entry.

Refs Trac#9780.
2017-05-20 21:14:18 -05:00
Colin Snover d09ae57fd8 SCI32: Remove bad assertion in relocateSci3
While extremely rare (only Rama script 64948 seems to have this
profile), it *is* possible for an object to have zero properties
(and thus, zero property offsets).
2017-05-20 21:14:18 -05:00
Colin Snover eda836f21a SCI: Nitpicky cleanup of some magic numbers and what-not-why comments 2017-05-20 21:14:18 -05:00
Colin Snover 71630a7cb2 SCI: Remove duplicate relocateBlock function 2017-05-20 21:14:18 -05:00
Colin Snover bc9835ba5e SCI: Always use SegManager::getObjectName to get object names
This ensures that all object name reading code works the same and
is in one place in the codebase.
2017-05-20 21:14:18 -05:00
Colin Snover 881be25fcd SCI: Stop making copies of ObjMap and remove related dead code
ObjMap owns Objects, so every time this map gets copied instead of
referenced, it creates a copy of every single object in the
associated script. This is expensive, and it breaks things like
the `Object::syncBaseObject` call in savegame.cpp, which hasn't
actually been doing anything since
58190c36b4 because it has been
operating on copies.
2017-05-20 21:14:18 -05:00
Colin Snover 66efb750a0 SCI: Add more support for >16-bit SCI3 offsets
Basically just grepped for getOffset calls being assigned to
uint16s and expanded those to uint32 when they looked trivial.

While some of these changes seem superfluous, at least for the
US/English SCI3 games where potentially impacted game scripts are
not large enough to have a problem with 16-bit offsets (e.g. when
feature detecting the sound type), at least some of these changes
are necessary for correct operation of the find_callk debugger
command in SCI3 games. There should not be a reason why any of
these variables need to be kept as uint16, in any case.
2017-05-20 21:14:18 -05:00
Colin Snover 14a521a211 SCI32: Fix kPlatform operation for SCI2 through SCI2.1early
Fixes Trac#9795.
2017-05-20 21:14:18 -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
Willem Jan Palenstijn 779b8336b1 SCI: Let getClassAddress fail gracefully with SCRIPT_GET_DONT_LOAD
This fixes a crash in the debugger when disassembling the class opcode
with a class from a script that hasn't yet been loaded.
2017-05-16 22:41:47 +02:00
Martin Kiewitz cadd89e675 SCI: Add script patch for "Tickets, only" during game over scene
Audio played was "Tickets, only", subtitle shows "Tickets, please".

Also remove forcing myDialog for KQ6Print::say (which was added,
while fixing this script patch).
see a46f3c1625
Forcing myDialog causes issues during game over screen (bug #9771).
Bug is solved by this, but script patch isn't perfect right now.
2017-05-15 22:56:04 +02:00
Willem Jan Palenstijn 388419c53c SCI: Ignore priority and transparency for KQ6 hi-res views
This fixes bug 9786. Thanks to m_kiewitz for verifying with disasm.
2017-05-15 22:03:25 +02:00
Colin Snover dec12f5b6d SCI: Guard against potential stack overflow in vocab word parser 2017-05-13 23:45:59 -05:00
Colin Snover 444b11b1bb SCI: Fix access violation reading Hoyle1 vocabulary
The vocab file for this game does not seem to be valid (other
utilities like SV cannot parse it either), and this game does not
seem to need the parser, so just exit early like the SCI1 branch
when unexpectedly running out of bytes in the vocab file.

Fixes Trac#9765.
2017-05-13 23:45:59 -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 1911b19e15 SCI32: Make sure all save game validity checks are in kCheckSaveGame32
Save game metadata validity checks in SCI32 should all exist within
kCheckSaveGame32 since this allows most games to recover
successfully from an attempt to load an invalid save game. If
gamestate_restore fails, the game will usually crash because the
engine is left in an inconsistent state (game scripts have cleaned
up objects in preparation for a game load that is no longer
happening).
2017-05-13 22:46:25 -05:00
Colin Snover 262ef4de61 SCI32: Fix crash at end of Torin
This "fix" is more of a hack, in the interest of making the game
completable. The root cause is a combination of two problems in
the game scripts:

1. Blink::init expects to receive either 0 or 2 arguments, but
   it assumes that if it received *any* arguments, it must have
   received 2 arguments. This assumption is wrong, though,
   because--
2. soTorinWhoAreYou::changeState(0) calls
   poPecandEyes::setCycle(Blink) without including a second
   argument (the blink speed).

This ends up with the second parameter being some garbage, and
that garbage gets sent to kRandom which then complains about
receiving garbage.

The correct fix for this would be to fix soTorinWhoAreYou (in
script 51400) to pass a second argument to setCycle, but there are
not enough obvious spare bytes for a quick and easy patch, so this
workaround will have to do for now.

Fixes Trac#9779.
2017-05-13 22:46:13 -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