Commit Graph
4076 Commits
Author SHA1 Message Date
Willem Jan Palenstijn 740b0bb0ca SCI: Unconditionally save palvary state
Additionally, add workaround to fix up old QfG3 saves with broken
_palVaryPaused state. Fixes bug #9674.
2017-01-06 19:03:50 +01:00
Colin Snover 0c40d60d24 SCI32: Fix off-by-one error in array resizing
This bug existed in SSCI and was pulled in carelessly during
initial implementation of SciArray. Closer examination of SCI3
reveals that this only happened to work in SSCI because it would
always allocate on the first resize, and would always allocate 25
extra elements per allocation.
2017-01-05 16:01:05 -06:00
Colin Snover 70d1edf615 SCI32: Add validity checks to kList iteration methods
In GK2, restoring a save game causes the segment manager to reset
in the middle of a kListFirstTrue call, which invalidates all
pointers and reg_ts to stored data. This means that when
kListFirstTrue tries to decrement the list recursion counter at
the end of iteration, it is writing to freed memory, potentially
resulting in heap corruption.

SCI3 added checks to prevent this from happening, but these checks
seem like they should have also been applied to some SCI2.1 games
as well (like GK2).

Since there should be no negative side-effect to this check, it
is applied universally to all SCI32 games.
2017-01-05 16:00:59 -06:00
Colin Snover a91b432cdb SCI32: Load VMDs from resource bundles
GK2 includes some VMDs in the RESSCI.00n volume bundles for the
chase scene at the end of Chapter 6.
2017-01-02 17:02:31 -06:00
Colin Snover ed19d51918 SCI: Fix PQ2 crash reading second page of files in jail
This fixes the crash in PQ2 1.002.011. There is another workaround
for the same problem from ticket Trac#5223, but it uses a different
method name that does not match in this version of PQ2.

Fixes Trac#9670.
2017-01-01 11:16:31 -06:00
Martin Kiewitz a46f3c1625 SCI: Fix kq6 CD audio+subtitle script patch
Original patch caused a text window to be shown at the cliffs
(copy protection), even when audio-only mode was active.
2016-12-21 02:04:11 +01:00
Colin Snover 4cff1e400f SCI32: Add support for alternate graphics selectors
Used by at least Phantasmagoria 2.
2016-12-19 14:46:59 -06:00
Colin Snover 5220ce1e4f SCI32: Undefine macro for SciBitmap when it is done being used 2016-12-19 14:46:59 -06:00
Colin Snover 4f7173b137 SCI32: Generalize Phant1 kArraySetElements workaround
This bug exists in a system script that is called from many, many
rooms, so it is simpler to just make the workaround apply to all
rooms.
2016-12-19 14:46:59 -06:00
Colin Snover a238f720db SCI32: Fix nitpicky output errors in SCI32 bitmap debugging 2016-12-19 13:56:37 -06:00
Colin Snover 20c211192d SCI32: Add segment table debugging info for SCI32 arrays 2016-12-19 12:47:48 -06:00
Colin Snover df38f24c77 SCI32: Fix handling of rewritable files opened with mode 1
In SSCI, all files opened through kFileIO are writable. Most of
the time this does not matter and the engine can get away with
using read-only streams, but when chase.dat is opened by Phant1
from the retry dialogue during the chase, it needs to be writable
because game code puts a '98' marker in the chase data. If this
write does not occur, the game gets stuck in a loop looking for
the marker.
2016-12-18 19:03:30 -06:00
Colin Snover 274ce59699 SCI: Fail gracefully when attempting to write to a read-only fd 2016-12-18 19:03:30 -06:00
Colin Snover 1a3d47bcb5 SCI: Remove restriction on backwards seeking
SaveFileRewriteStream enables backwards seeking, which is necessary
for the chase.dat in Phant1 to be parsed correctly by the game.
2016-12-18 19:02:41 -06:00
Colin Snover b011af9485 SCI: Remove unused second parameter to SegManager::getString 2016-12-18 19:02:41 -06:00
Colin Snover f52c03cd2c SCI32: Simplify workaround comment
It is not necessary to explain what is happening, just how to
reproduce it.
2016-12-18 19:02:40 -06:00
Colin Snover c816657e56 SCI32: Add workaround for bad kArraySetElements call at end of Phant1 2016-12-18 19:02:40 -06:00
Colin Snover e828deaa46 SCI32: Fix overwriting of file content when opened in append mode
Fixes Trac#9586, Trac#9587.
2016-12-18 19:02:40 -06:00
Colin Snover 07919b79ba SCI32: Improve SciBitmap segment table debugging output 2016-12-17 18:55:22 -06:00
Colin Snover 4b4b8a281b SCI32: Adjust transition timings
Transition timings were originally chosen largely by feel in SQ6,
as there was little other evidence to determine the correct speed.
As additional games started being playable in ScummVM, it became
apparent that these speeds were not quite right.

Additional adjustments may be needed in the future, but these new
timings seem to be somewhat closer to expectations than before.
2016-12-12 15:22:11 -06:00
Colin Snover 8477e61ad0 SCI32: Add workaround for hearts game in Hoyle5 2016-12-12 15:22:04 -06:00
Colin Snover be14778b2b SCI: Ensure bytecode/BWT for "file" op is also printed
Learning the bytecode for file op is necessary when creating
workaround signatures, as the signature-finding mechanism does not
currently ignore line/file instructions.
2016-12-12 15:20:08 -06:00
Colin Snover 02598b4473 SCI32: Add workarounds for Hoyle5 Crazy Eights 2016-12-11 20:09:48 -06:00
Colin Snover 5b5aaee57b SCI32: Implement List sort
Used by Hoyle5.

Also includes a tiny amount of cleanup in kAddAfter for
consistency with kAddBefore.
2016-12-11 20:09:48 -06:00
Colin Snover 6de396d787 SCI32: Add workaround for Hoyle5 startup call to kPlatform
Fixes Trac#9665.
2016-12-11 12:31:45 -06:00
Omer Mor 4312e2c5a4 SCI32: Add a workaround for kDoSoundPlay for KQ7 demo 2016-12-11 09:43:40 -06:00
Colin Snover e0c7ee1a9c SCI: Remove unnecessary duplicate shadowing variable 2016-12-03 12:21:56 -06:00
Colin Snover 12b2bc408f SCI: Remove unnecessary lock in SegManager 2016-12-03 12:21:55 -06:00
Colin Snover 9e1bf888b8 SCI: Deduplicate text-reading code in kGetFarText 2016-12-03 12:21:55 -06:00
Colin Snover 3e7f08834d SCI: Clean up some comments 2016-12-03 12:21:55 -06:00
Colin Snover 68023904a4 SCI32: Fix LSL6hires text speed slider
For whatever reason, this game uses a different global for
specifying the text speed.
2016-12-03 12:00:58 -06:00
Colin Snover 22c2f39c00 SCI32: Add recursion code to kListFirstTrue and kListAllTrue
This change ensures that these kernel calls operate in the same
manner that they did in SSCI.
2016-11-20 12:31:44 -06:00
Colin Snover 4814682d5f SCI: Improve disassembly output
1. pushi opcode now displays decimal value and selector value (if
   one exists) in-line
2. lofsa, lofss, and super opcodes now display resolved
   object/class names
3. Opcode arguments are visually aligned
2016-11-20 12:31:44 -06:00
Colin Snover 9380b54120 SCI: Add code-address breakpoints to debugger 2016-11-20 12:31:43 -06:00
Colin Snover 774713564d SCI32: Add script patch for Shivers room 35170 2016-11-19 19:06:04 -06:00
Colin Snover 11ee0f90ac SCI: Warn more loudly about uninitialised parameter reads
Silently returning zero values can cause games to break. e.g.
Shivers 1 room 35170 has a script bug where vJoystick::handleEvent
makes a super call which causes doVerb to be called a second time
with no arguments. In the original game this happened to work
because the value already on the stack happened to be 1. In ScummVM
this silently (unless VM debug messages were enabled) failed
because the uninitialised read value was forced to 0.
2016-11-19 19:05:38 -06:00
Willem Jan Palenstijn 10151966a6 SCI32: Add missing updateInfoFlagViewVisible call
I missed the one for varselector sends handled by the secondary loop in
op_ret. This fixes #9641.
2016-11-19 19:16:12 +01:00
Colin Snover a895cf1b5a SCI32: Fix incomplete workaround comment 2016-11-10 10:21:12 -06:00
Colin Snover 1e8b95f025 SCI32: Fix GK1 crash when erasing letters in St Louis Cemetery
Fixes Trac#9642.
2016-11-10 10:17:01 -06:00
Colin Snover 2eea7dc961 SCI32: Implement kPlayVMDIgnorePalettes
Used in Shivers room 35170 when pressing the play button.
2016-11-04 20:45:45 -05:00
Colin Snover 4bfd005c78 SCI32: Stop digital audio when VMDs open in some SCI2.1 games 2016-11-04 20:10:21 -05:00
Colin Snover 5a5945cbbb SCI32: Allow format strings with missing arguments
SSCI created a fake va_list and passed it to vsprintf, so extra
placeholders would just silently end up reading garbage memory.
2016-11-04 15:16:10 -05:00
Colin Snover 44dfa4c49f SCI32: Treat %d as unsigned in kString
At least Shivers has VMDs with resource IDs above 2^15; treating %d
as signed means that the wrong filename gets created.
2016-11-04 15:16:10 -05:00
Colin Snover aa0836816d SCI32: Fix missing digital audio playback on save game restore
Fixes Trac#9581.
2016-11-02 15:43:07 -05:00
Colin Snover e8c429832f SCI32: Automate kNumCels workaround 2016-11-02 15:43:07 -05:00
Colin Snover e12496bd0c SCI32: Read byte/string array values as signed in SCI2.1early-
KQ7 1.51 writes int16s from the save game catalogue into a Str
object, then retrieves byte 0 from the string and compares it to
-1. This happens to work out because (1) characters were treated
as signed in SCI2.1early and earlier, and (2) int16s in the save
game catalogue were little-endian.

In SCI2.1mid and later, this trick no longer works because
characters are treated as unsigned and get zero-extended instead.

Fixes Trac#9632.
2016-10-27 20:23:10 -05:00
Colin Snover 8ba899b46b SCI32: Fix typos
Thanks @OmerMor.
2016-10-27 14:37:13 -05:00
Colin Snover c30380d0a3 SCI32: Fix LSL6hires script bug
Fixes Trac#9612.
2016-10-27 10:55:30 -05:00
Willem Jan Palenstijn 2fe167afc3 SCI: Rename hexDigitToInt to indicate it's intentionally broken 2016-10-26 22:59:33 +02:00
Colin Snover eb6fa08311 SCI: Implement SSCI bug in hexadecimal escape sequences
In SSCI, strchr is called against a hex string with a duplicate 0
("01234567890abcdef") to determine the decimal value of hex digits,
which means the values A-F are incorrectly interpreted as 11-16
instead of 10-15.

All versions of SSCI with support for hexadecimal escape sequences
in messages (starting somewhere around Feb 1993) are buggy.

The native save/load dialog of SCI32 relies on this defect to
render the up and down arrows of the game selector.

Fixes Trac#9582.
2016-10-25 20:05:12 -05:00