Commit Graph
4076 Commits
Author SHA1 Message Date
Colin Snover e74adcec52 SCI: Whitespace alignment 2017-03-30 19:46:27 -05:00
Colin Snover 6b0cd955fa SCI32: Fix crash when using brightness slider in Shivers 2017-03-30 19:46:27 -05:00
Colin Snover fa9523933f SCI32: Fix broken sliders in Shivers settings
This problem is caused by the same invalid super call that broke
the CCTV joystick.
2017-03-30 19:46:27 -05:00
Colin Snover f4d3664d3f SCI: Replace magic numbers in reg_t handling with symbols 2017-03-30 19:46:27 -05:00
Colin Snover 3b34f17fb3 SCI32: Add kWebConnect and kWinExec
Used by Phant2.
2017-03-30 19:46:27 -05:00
Colin Snover 766d46153a SCI32: Implement known-used portions of kPlayDuck 2017-03-30 19:46:27 -05:00
Willem Jan Palenstijn ee86a74cd3 SCI: Fix remaining format string warning 2017-03-30 22:00:27 +02:00
Colin Snover a233696212 SCI: Update formatting strings to match updated Span API 2017-03-30 14:23:41 -05:00
Colin Snover 323e74bda9 SCI: Simplify calculation of locals size in SCI0/1 2017-03-27 19:42:31 -05:00
Colin Snover 31daa956d6 SCI: Implement bounds-checked reads of game resources 2017-03-27 19:42:31 -05:00
Martin Kiewitz c315065503 SCI: Add Colonel's Bequest patch and extend patcher functionality
Add Colonel's Bequest patch to fix an issue in room 35.
When you tell Lilly about Gertie in act 2, Lilly will then
walk out of the room. In case Laura (ego) is in her way, the game
will effectively block and will appear frozen.
This also happened, when using the original interpreter.

This also adds a new functionality to the script patcher.
PATCH_GETORIGINALUINT16 is able to get a full UINT16 from
original script data and insert it somewhere else.
PATCH_GETORIGINALBYTE and PATCH_GETORIGINALBYTEADJUST commands
were merged internally and use the same internal command now.
Some script patches were adjusted accordingly.

Thanks again to wjp for helping on the script issue.
2017-03-19 17:14:33 +01:00
Martin Kiewitz 2e91d8cd9b SCI: Add script patch for Laura Bow 2 to fix museum party room (350)
When clicking anywhere while entering the middle museum party room
(which has a large golden Egyptian head inside of it), the game
will keep the script for entering active, which will then make it
impossible to leave this room.

This script bug also happened, when using the original interpreter.

The patch applies to at least English + German floppy as well as
English CD.

Very many thanks to wjp for helping figuring the actual cause out.
2017-03-18 21:09:38 +01:00
Willem Jan Palenstijn 8bac8836b1 SCI: Fix up readString writing into too small buffer
This fixes QfG4 character import, which specifies a size of 52 for a
buffer of size 40.
2017-02-27 16:02:20 +01:00
Martin Kiewitz 26b6d450df SCI: Clean up kRandom + allow 0 parameters via signatures
Also added in depth comments about the currently known variations
Returning the RNG seed is now implemented (although it seems no
games actually use this functionality, it seems to be just script
bugs).
Also remove Torin kRandom workarounds.
2017-02-26 00:24:57 +01:00
Willem Jan Palenstijn cdfe5a3107 SCI: Remove check that is never triggered
Since blockSize is asserted to be positive, buf can never be equal to _buf.
2017-02-18 15:20:57 +01:00
Colin Snover 10d97ce379 SCI: Fix more unsafe C-string usage 2017-02-05 12:38:21 -06:00
Colin Snover b1c3332fdd SCI: Use strnlen instead of strlen to avoid buffer overflows 2017-02-05 10:24:02 -06:00
Tarek Soliman 3dc565df26 SCI: Add more comments to SQ4-floppy workaround
I did a full-score playthrough of the game with a warning() on
the workaround condition as m_kiewitz suggested.
The following room numbers were logged:
* room#1: intro logo
* room#21: time rip (intro and ending)
* room#531: time pod time travel
* room#290: astro chicken star background
* room#376: right after astro chicken game over (called only once)
2017-01-31 20:55:34 -06:00
Tarek Soliman 6ef42cbe92 SCI: Expand workaround for script bug #3537232
More details in PR#889
2017-01-31 17:20:45 -06:00
Colin Snover 88981b8db6 SCI32: Script patch priority drawing bug in MGDX
This fixes the horse at the fountain drawing on top of the
fountain instead of behind it.
2017-01-16 12:54:39 -06:00
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