Commit Graph
4076 Commits
Author SHA1 Message Date
Colin Snover f58019b680 SCI32: Remove spinloops from Phant2 2017-04-23 13:07:25 -05:00
Colin Snover 14e4ea6c85 SCI32: Add workarounds for LSL7 2017-04-23 13:07:25 -05:00
Colin Snover e06d4a71fb SCI32: Fix missing main menu in LSL7 2017-04-23 13:07:25 -05:00
Colin Snover 5948813169 SCI32: Fix crash when writing word to VIRTUALFILE_HANDLE_SCI32SAVE
This happens in Phant2 when trying to delete a save game from the
in-game save dialogue.
2017-04-23 13:07:25 -05:00
Colin Snover b5ecbff39b SCI32: Fix crash in Phant2 when clicking Help in the control panel 2017-04-23 13:07:25 -05:00
Colin Snover 2573fe8c96 SCI32: Fix slow fade of Phant2 interface bars 2017-04-23 13:07:25 -05:00
Colin Snover 7997451384 SCI32: Remove TODO from relocateOffsetSci3
The field at +8 is for the MemID associated with a relocation.
2017-04-23 13:07:25 -05:00
Colin Snover 42406cb11a SCI32: Undummy AvoidPath for SCI3
Used by LSL7.
2017-04-23 13:07:25 -05:00
Colin Snover c9342beca9 SCI: Remove unused commented code 2017-04-23 13:07:25 -05:00
Colin Snover 7b3c9f4a07 SCI32: Add Lighthouse workaround 2017-04-23 13:07:25 -05:00
Colin Snover 168774c3c6 SCI32: Add kPlayVMD subop 27 (SetPlane)
Used by RAMA, when playing a video at the Hub Camp computer at the
beginning of the game (room 1004).
2017-04-23 13:07:25 -05:00
Colin Snover f711edc876 SCI32: Add workarounds for RAMA 2017-04-23 13:07:25 -05:00
Colin Snover 2212b82794 SCI32: Add workarounds for Lighthouse 2017-04-23 13:07:25 -05:00
Colin Snover 94524633d7 SCI32: Put Lighthouse restart game in restart save slot 2017-04-23 13:07:25 -05:00
Colin Snover 205f8c4a59 SCI32: Fix call to kFileIOIsValidDirectory in RAMA 2017-04-23 13:07:25 -05:00
Colin Snover 9e7c75cc79 SCI: Avoid crashing when disassembling a call with a bad object
lookupSelector will raise an error if the passed object ID is
invalid.
2017-04-22 19:38:13 -05:00
Colin Snover f6c4e0c7c7 SCI: Improve message when crashing due to a bad selector 2017-04-22 19:38:12 -05:00
Colin Snover 3ab1f5f4cc SCI: Display class names in disassembly 2017-04-22 19:28:35 -05:00
Colin Snover 086fab741a SCI: Remove #undef for a macro that does not exist 2017-04-22 19:28:35 -05:00
Colin Snover 2ccef4a476 SCI32: Implement support for QFG4 autosave 2017-04-22 19:28:35 -05:00
Colin Snover 6c44106083 SCI32: Add workarounds & patches for QFG4 2017-04-22 19:28:35 -05:00
Colin Snover 41c633f0c5 SCI: Fix whitespace errors 2017-04-22 19:28:34 -05:00
Colin Snover 848bce47e1 SCI: Fix typo in debug message 2017-04-22 19:25:21 -05:00
Colin Snover ede7976ede SCI32: Fix bad kPointSize implementation
Fixes text scaling gone mad in Phant2.
2017-04-22 19:25:20 -05:00
Colin Snover c6cf7215f0 SCI32: Fix kStringFormat signatures 2017-04-22 19:25:20 -05:00
Colin Snover ecc446da84 SCI: Accept 32-bit values to reg_t::incOffset
This fixes bad variable relocation in Phant2 causing the game to
crash when reading object names.
2017-04-22 18:53:40 -05:00
Colin Snover 5b0c20da94 SCI32: Provide more detail in console when a save game fails checks 2017-04-22 15:34:31 -05:00
Colin Snover a2fb53790b SCI32: Make version 41 the first supported save game version
Save games created by earlier versions of ScummVM are prone to
having subtle graphics problems or other corruption caused by
incomplete save/load code.
2017-04-22 13:01:38 -05:00
Colin Snover e504efe4da SCI32: Add palette code for late SCI2.1mid+ games
Sometime during SCI2.1mid, the palette manager was changed to
save and restore the source palette, and to add in-game gamma
correction. Previously, only the vary start and target palettes
were saved, and gamma correction was only configurable in SSCI by
editing RESOURCE.CFG.
2017-04-22 13:01:37 -05:00
Colin Snover 399551af09 SCI: Fix compilation when SCI32 is disabled 2017-04-22 13:01:37 -05:00
Colin Snover 93b337b833 SCI: Do not sync objects when saving games
Commit 5de2668939 silently changed
behaviour from running this code only when restoring a game, to
running all the time, in an apparent copy-paste error.
2017-04-22 13:01:37 -05:00
Colin Snover a22e461208 SCI: Improve comments in GuestAdditions 2017-04-22 13:01:37 -05:00
Colin Snover 2df939d33b SCI32: Add workaround for SQ6 invalid read after a failed save game restore 2017-04-22 13:01:36 -05:00
Colin Snover f8703ae48d SCI32: Fix infinite recursion when loading invalid save from launcher 2017-04-22 13:01:36 -05:00
Colin Snover 2862e51068 SCI32: Fix launcher load for Shivers 2017-04-22 13:01:36 -05:00
Colin Snover 1ed185bbbb SCI: Implement delayed restore for SCI32 and move implementations to GuestAdditions 2017-04-22 13:01:35 -05:00
Colin Snover 6f75bed90c SCI32: Remove original save/load option from games without ScummVM save integration 2017-04-22 13:01:35 -05:00
Colin Snover 4c0f2a3738 SCI: Move ScummVM kernel calls to 0xe0 2017-04-22 13:01:35 -05:00
Colin Snover c8486395fa SCI: Clean up unnecessary delayed restore flags
_delayedRestoreGame is always set and cleared at the same time as
_delayedRestoreGameId, and _delayedRestoreFromLauncher is written
but never read.
2017-04-22 13:01:35 -05:00
Colin Snover ec12c5a342 SCI: Move ScummVM save/restore to GuestAdditions and reimplement for SCI32 2017-04-22 13:01:16 -05:00
Colin Snover 3303a88139 SCI: Improve audio volume & settings sync code
This patch includes enhancements to the ScummVM integration with
SCI engine, with particular focus on SCI32 support.

1. Fixes audio volumes syncing erroneously to ScummVM in games
   that modify the audio volume without user action (e.g. SCI1.1
   talkies that reduce music volume during speech playback). Now,
   volumes will only be synchronised when the user interacts with
   the game's audio settings. This mechanism works by looking for
   a known volume control object in the stack, and only syncing
   when the control object is present. (Ports and planes were
   researched and found unreliable.)

2. Fixes audio syncing in SCI32 games that do not set game
   volumes through kDoSoundMasterVolume/kDoAudioVolume, like GK1,
   GK2, Phant1, and Torin.

3. Fixes speech/subtitles syncing in SCI32 games that do not use
   global 90, like LSL6hires.

4. Fixes in-game volume controls in SCI32 games reflecting
   outdated audio volumes when a change is made during the game
   from the ScummVM launcher.

5. Fixes SCI32 games that would restore volumes from save games
   or reset volumes on startup, which caused game volumes to be
   out-of-sync with ScummVM when started.

6. ScummVM integration code for audio sync has been abstracted
   into a new GuestAdditions class. This keeps the ScummVM-
   specific code all in one place, with only small hooks into the
   engine code. ScummVM integrated save/load code should probably
   also go here in the future.

Fixes Trac#9700.
2017-04-21 19:00:27 -05:00
Colin Snover a620b6c354 SCI: Fix handling of buggy SCI0 export tables
The previous fix for this bug was incorrect; it only happened
to work because of another bug: the number of exports was being
read incorrectly (reading the byte size of the export block, not
the number of exports), so the validation check for the export
number always passed. Then, the "small" offsets that were seen
were actually either invalid reads into the header of the next
block in the script (KQ4), or reads into the bad first export
table which contained an unfilled offset (Camelot).

Once the incorrect number of exports was fixed, the previous "fix"
broke in KQ4 because the export number validation started to work
correctly and the first export table does not have enough entries
(needs 2, has 1).

This patch fixes the bug by using the last export table in SCI0
scripts instead of the first export table. (This does not affect
most scripts, since only the buggy scripts have more than one
export table.)

Fixes Trac#9731.
2017-04-18 11:47:18 -05:00
Colin Snover ee644ec01b SCI32: Check for game aborts in all kList iteration methods
This fixes a use-after-free in GK2 when restoring a second save
game, when the List reg_t is still considered valid but the List
has moved due to a partial game restore.
2017-03-30 20:49:37 -05:00
Colin Snover 3678390f3e SCI: Add clarifying comment to op_rest 2017-03-30 20:49:37 -05:00
Colin Snover a1153661c4 SCI: Stop getCurrentCallOrigin from mutating stack frames
This fixes incorrect backtraces after a workaround failure or
other call to getCurrentCallOrigin when one or more stack frames
are calls to local procedures.
2017-03-30 20:49:36 -05:00
Colin Snover 4284488244 SCI32: Improve bounds checking in SciString trim 2017-03-30 19:46:27 -05:00
Colin Snover 2d0c1c8ab5 SCI: Ensure object name reg_ts are valid before dereferencing them 2017-03-30 19:46:27 -05:00
Colin Snover 5e81db8fd0 SCI32: Add workaround for uninitialised read in Torin 2017-03-30 19:46:27 -05:00
Colin Snover 159438848b SCI32: Add workaround for uninitialised read in GK1 2017-03-30 19:46:27 -05:00
Colin Snover dd23085845 SCI: Give kernel calls a valid stack pointer
Some kernel calls need to be able to call back into game script
code, which requires a valid stack pointer for use with
invokeSelector.

An example of this is the guest additions code that syncs audio
volumes from ScummVM: it needs to be able to call into the game
scripts responsible for managing the in-game audio volume UI.
2017-03-30 19:46:27 -05:00