Commit Graph
3706 Commits
Author SHA1 Message Date
Colin Snover e695100708 SCI32: Add workarounds for MGDX 2017-01-16 12:16:14 -06:00
Colin Snover f66c033d52 SCI32: Add workaround for Hoyle5 2017-01-16 12:16:13 -06:00
Colin Snover 8859c3ccae SCI32: Disable compression on Hoyle5 options files
Compression overhead takes up more space than uncompressed files,
plus the uncompressed files it creates are marginally quicker and
easier to debug with external tools.
2017-01-16 12:16:13 -06:00
Colin Snover c476341508 SCI32: Add workarounds for KQ7 2.00b 2017-01-16 12:16:13 -06:00
Colin Snover d495267829 SCI32: Fix loading save games in KQ7 1.51 2017-01-16 12:16:12 -06:00
Colin Snover 0744dc4109 SCI32: Fix spinloop in Hoyle5
Hoyle5 will spin on kGetTime between 15 and 300 ticks in multiple
game scripts in order to delay execution (for example, after
choosing opponents and clicking "okay"). This causes ScummVM to
be unresponsive and wastes CPU time.

This commit patches the spin subroutines to instead call a kernel
function (kWait) that waits without a spin loop. This kernel
function was removed in SCI2, and has been added back in ScummVM
specifically for Hoyle5, so this patch will not work with the
original interpreter.
2017-01-16 12:16:12 -06:00
D G Turner 657e5414fe SCI: Fix Possible Uninitialized Variable Usages. 2017-01-16 07:22:32 +00:00
D G Turner d2dd942ad7 SCI: Fix Warnings about Copy Constructor Failing to Call Base Class. 2017-01-14 08:26:29 +00:00
Colin Snover d34e5266ed SCI32: Fix bad scroll delta in GK2 inventory
Fixes Trac#9648.
2017-01-12 15:04:45 -06:00
Colin Snover dd13fdfe17 SCI32: "Fix" renderer for PQ4CD
PQ4CD and several other games contain a hack in two renderer
methods to avoid rendering invalid screen items with zero or
negative-dimension target rects. This prevents PQ4CD from
crashing during the fifth phase of target practice.
2017-01-12 13:14:10 -06:00
Colin Snover 54e94c572a SCI32: Add workarounds, transitions, fixes for PQ4CD 2017-01-12 13:14:03 -06:00
Colin Snover d951026578 SCI32: Add workarounds for PQ:SWAT 2017-01-11 11:13:45 -06:00
Colin Snover e00c773d95 SCI32: Remove backslashes from PQ:SWAT extra save game files
The original interpreter created subdirectories for each in-game
profile, but copying this behaviour would add a lot of
superfluous complexity to the save game system in ScummVM, and
may not be portable to all supported platforms. Instead, when the
game tries to save its files to a subdirectory, the backslash in
the file name is replaced with an underscore so it can be created
successfully on filesystems where backslash is an illegal file
name character.

This has a side-effect of causing all save games to be displayed
under all profiles, instead of just the ones "belonging" to a
particular profile, but this seems like a reasonable trade-off
given that there is no reason to play this game with more than one
profile.
2017-01-11 11:13:44 -06:00
Filippos Karapetis 09d06855c5 SCI32: Add a workaround for the demo version of LSL7 2017-01-11 00:37:43 +02:00
D G Turner 26452df855 SCI: Fix Unused Variable Compiler Warning when SCI32 is not enabled.
The bytesWritten variable is not used if SCI32 is not enabled. Fixed by
adding this and success flag to the debug console print.
2017-01-10 06:14:03 +00:00
Colin Snover f1ca9ccc64 SCI32: Fix kSetLanguage 2017-01-09 19:38:59 -06:00
Colin Snover e18e6399ac SCI32: Fix bad rendering of Sierra logo in MGDX 2017-01-09 19:34:54 -06:00
Colin Snover b895b4b075 SCI32: Disable compression for Phantasmagoria save files 2017-01-09 19:34:54 -06:00
Colin Snover c48c24d1d3 SCI32: Fix Torin demo crash 2017-01-09 19:34:54 -06:00
Colin Snover e729a31edc SCI32: Fix SQ6 demo crash 2017-01-09 19:34:54 -06:00
Colin Snover b818e54027 SCI32: Fix crashes and bad cel positioning in GK2 demo 2017-01-09 19:34:54 -06:00
Colin Snover 2ce1807359 SCI32: Generalise uninitialised read workarounds for RAMA 2017-01-09 19:34:54 -06:00
Colin Snover 8cce4f1b8c SCI32: Ignore attempts to free null array reg_ts 2017-01-09 19:34:54 -06:00
Colin Snover 7567940ba1 SCI32: Clean up SCI3-only opcodes
SCI3 includes four new opcodes:

* op_info[0x26][0] puts -info- flag in accumulator
* op_infoSP[0x26][1] pushes -info- flag to stack
* op_superP[0x27][0] puts -super- reference in accumulator
* op_superPSP[0x27][1] pushes -super- reference to stack

The implementation of these opcodes was correct already, but the
opcode names given were a bit misleading (the value is not always
stored to accumulator), and magic numbers were used for these
opcodes in places.

A review of the opcode table in Phant2 indicates that there are
no other new opcodes for SCI3.
2017-01-09 19:34:54 -06:00
Colin Snover bd9bc7ce87 SCI32: Clean up comment on kSetHotRectangles
Since this feature is now implemented, it is not necessary to
describe its intended functionality here.
2017-01-09 19:34:54 -06:00
Colin Snover 01e6d07360 SCI32: Split kCelInfo into subops
Different subops have different call signature requirements.
2017-01-09 19:34:54 -06:00
Colin Snover 3e2f4a66f6 SCI32: Remove SCI3 workarounds hack 2017-01-09 19:34:54 -06:00
Colin Snover 97a47852c1 SCI32: Fix kSetShowStyle signature for SCI3 2017-01-09 19:34:54 -06:00
Colin Snover 809dcf12ab SCI32: Fix overlapped memory copies in SciString 2017-01-06 13:13:59 -06:00
Filippos Karapetis d9b2b7d484 SCI32: Fix a subtle bug in SciArray::trim()
With this bug, whenever a string was trimmed from the right, the last
character was always cut off, even if it wasn't whitespace. This was
apparent in the RAMA demo, which parses a text file for its scenes,
and each line is trimmed
2017-01-06 13:13:21 -06:00
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