Commit Graph
7940 Commits
Author SHA1 Message Date
Colin Snover 3d92f05261 SCI32: Fix hot rectangle events
This fixes delayed mouse cursor updates during the chase scene in
Phant1.

Refs Trac#9975.
2017-07-23 10:35:13 -05:00
Colin Snover 8bab5a3467 SCI: Resolve offset names when disassembling object methods 2017-07-23 10:35:13 -05:00
Colin Snover 5b166a5173 SCI32: Avoid extra cursor paints when the cursor has not moved 2017-07-23 10:35:13 -05:00
Colin Snover 9f33f2b3df SCI32: Don't warp the mouse when it doesn't need to be warped 2017-07-23 10:35:13 -05:00
Colin Snover 970c312e76 SCI32: Detect multi-disc audio by RESSCI files instead of RESAUD
If a user fails to rename audio files in the required manner when
copying them, detecting multi-disc audio by looking for a renamed
audio file does not work very well. Looking at RESSCI.00n is a
better choice, though this is not completely valid since e.g.
Rama 1.0 US has only one RESOURCE.SFX volume which its installer
copies to the hard drive, so a little more work will need to be
done in the future to find and fix these kinds of edge cases.

Refs Trac#9976.
2017-07-23 10:35:13 -05:00
Colin Snover 6ad230da7c SCI32: Fix kIsOnMe crashes in LSL7 About screen 2017-07-18 12:35:06 -05:00
Colin Snover 9d62caa684 SCI32: Promote LSL7 to ADGF_TESTING 2017-07-17 23:56:22 -05:00
Colin Snover dcb6c32215 SCI32: Destroy audio streams in Audio32 using DisposeAfterUse flag
Since Resource::makeStream returns a MemoryReadStream which will
not attempt to free the resource memory, it is fine to always
dispose those streams and get rid of the separate resourceStream
property, which was a holdover from some past WIP resource design
which no longer exists.
2017-07-17 23:56:21 -05:00
Colin Snover 64d090dcb8 SCI32: Fix stream leaks in Audio32/SOLStream
makeSOLStream was leaking the SeekableSubReadStream object it
creates itself if it was not called with DisposeAfterUse::YES. That
substream is an implementation detail which should not rely on
the caller to be destroyed.
2017-07-17 23:56:21 -05:00
Colin Snover ba4fccdb26 SCI32: Add workaround for Torin/LSL7 running with subtitles only
Since these later SCI32 games weren't really designed to work with
subtitles-only message mode, if this doesn't work consistently or
breaks the games a lot in other places, the subtitles-only message
type could possibly be implemented in some other way, like by
messing with the game's speech volume global instead.
2017-07-17 23:56:21 -05:00
Colin Snover 09ef11a8cb SCI32: Remove ENABLE_SCI3_GAMES ifdef, now that they are supported 2017-07-17 22:42:18 -05:00
Colin Snover afe344cc1f SCI32: Add guest additions support for LSL7 2017-07-17 22:42:18 -05:00
Colin Snover 2528ecf26e SCI32: Fix playback of looped audio
This fixes at least Lighthouse audio 808 in room 270, and audio
801 in room 810.
2017-07-17 22:42:18 -05:00
Colin Snover 2b7b9ec518 SCI32: Remove duplicate call 2017-07-16 21:25:27 -05:00
Colin Snover 2c1a8790b3 SCI32: Fix wrong GK1 sound volume sync
Fixes Trac#9793.
2017-07-16 21:25:27 -05:00
Colin Snover 5fa0e4b780 SCI32: Improve GK1 narrator speech sync 2017-07-16 21:25:27 -05:00
Colin Snover d8eccdec32 SCI: Clarify Tab character & modifier workarounds in GfxMenu 2017-07-16 14:26:30 -05:00
Colin Snover 6379498303 SCI: Fix kMenuSelect to understand control characters
In b4c0be8b42 keyboard events were
adjusted to send control characters to game scripts, which matches
how keyboard input works in SSCI. Unfortunately this broke games
using kMenuSelect because that kernel code was not expecting to
receive control characters.

Here is an amended list of known types of keyboard shortcuts, for
future reference:

* All games with text inputs (Ctrl+C clears text boxes)
* Most games using MenuBar, like QFG1EGA (Ctrl+P pauses the
  game, Tab or Ctrl+I show inventory)
* QFG1VGA (Ctrl+S shows stats)
* Torin (Ctrl+N, Ctrl+O, Ctrl+S, etc. activate menu commands)
* LSL1VGA & LSL3 (Ctrl+Alt+X to bypass age check)
* Most in-game debuggers (Alt+T for teleport)

The shortcut handling code is still not 100% accurate since there
are some edge cases that are not implemented (e.g. in DOS/SSCI,
Shift+Ctrl+<key> usually sends the same key information as
Ctrl+<key>, but not if <key> is Tab), but it should now be working
in a consistent and rational manner for end-users.
2017-07-16 14:26:30 -05:00
Colin Snover b4c0be8b42 SCI: Fix control character keyboard events
Used by:

* All games with text inputs (Ctrl+C clears text boxes)
* QFG1VGA (Ctrl+S shows stats)
* Torin (Ctrl+N, Ctrl+O, Ctrl+S, etc. activate menu commands)

The branch that used to shift control keys for SCI versions <=
SCI_VERSION_1_MIDDLE was bogus; history indicates it was intended
to be used to fix backends that sent control characters when
Ctrl+Alt were used together, but that case is already handled by
the Alt-checking code just prior to that code. Games expect to
receive control characters only when Ctrl is the only active
modifier, and this seems to be consistent across all versions of
SCI engine from SCI0 all the way through at least SCI2.1.

Fixes Trac#6703, Trac#9837.
2017-07-16 01:33:57 -05:00
Colin Snover 8e0ccc5eb1 SCI32: Add patch for mismatched PointSoft Torin heap 20700
Refs Trac#9776, Trac#9864. Fixes Trac#9797.
2017-07-15 22:53:39 -05:00
Colin Snover 3bc00e6633 SCI: Stop double-initialization of SCI0/1 objects
These objects should have been initialized only during the first
pass. Double-initialization does not cause any visible problem
problem during normal operation (mostly it just causes memory
waste by making Object::_baseVars/_baseMethod double up their
data), but could have silently allowed games to receive bogus data
for an out-of-bounds property or method index, instead of raising
an error.
2017-07-15 20:29:36 -05:00
Colin Snover 051366a48a SCI: Fix up Object::_baseMethod implementation
1. In SCI0/1, selectors and offsets in the method block are
   stored contiguously (all selectors, then all offsets), with a
   null separator between the two runs. All the later versions of
   SCI instead interleave selectors & offsets. Since these values
   are already being copied into a new array anyway, code for
   reading method selectors/offsets is now simplified by
   interleaving this data when it is written into _baseMethod
   for SCI0/1, so the same equation for retrieving method
   selectors/offsets can be used across all SCI versions.

2. In SCI1.1-2.1 branch, the method count was being copied into
   the first entry of the array, which meant that SCI1.1-2.1 had
   extra code for dealing with the fact that the first entry was
   not an entry. This has been fixed, and the extra code removed.

3. Data was being overread into _baseMethod in all games SCI0-2.1.
   (SCI0/1 had an extra magic value of 2, and SCI1.1-2.1 had an
   extra magic value of 3). Reviewing history, it's not clear why
   this happened, other than that it appears to have been
   introduced at 7b0760f1bc. My best
   guess is that this was a confusion between byte count and record
   count, where the intent was to read an extra 2 bytes for the
   null separator in SCI0/1, but it actually read 2 records
   instead. (I do not have a guess on why SCI1.1 ended up with a
   3.) This overreading has been removed.
2017-07-15 20:10:38 -05:00
Colin Snover 6edb991bf9 SCI32: Add detection entry for Phantasmagoria FR 1.100.000
Fixes Trac#9910.
2017-07-13 23:24:37 -05:00
Colin Snover b1b18c54f3 SCI32: Patch out bad rat view init code in Phantasmagoria
Fixes Trac#9957.
2017-07-13 22:33:12 -05:00
Colin Snover bbad7ada1b SCI32: Ignore chest view palette in Phantasmagoria
This fixes the 3-frame glitch that was also present in the
original game when moving in the chapel from room 6500 to 6400 in
chapter 7.

Fixes Trac#9788.
2017-07-13 21:31:21 -05:00
Colin Snover 7543bd444d SCI32: Move priority comparison of ScreenItems into its own function
Rendering bugs in ScummVM are often caused by buggy game scripts
relying on the last ditch sort, which is not the same in ScummVM
as in SSCI (since the SSCI last ditch sort relies on a different
memory architecture and is super buggy). However, these bugs do
not show up very frequently these days, so it is easy to forget
all the places that need to be checked when debugging a rendering
problem that appears to be caused by sorting failure.

This commit breaks out the last ditch comparison formerly in
Plane::calcLists to hopefully make it more visible to future
programmers.

Refs Trac#9957.
2017-07-13 21:31:07 -05:00
Colin Snover 8047f3fa77 SCI32: Stop optimising palette merges
While this optimisation helped to reduce unnecessary palette
updates in KQ7, it broke Phant1, which relies on changes to index
255 in the source palette causing palette invalidation.

Refs Trac#9788.
2017-07-13 17:19:50 -05:00
Colin Snover 3e45309b83 SCI32: Add workaround for Phant1 2017-07-13 17:19:50 -05:00
Tarek Soliman b0ecbc945f SCI: Fix detected name for lsl6-cd 2017-07-09 20:13:16 -05:00
Willem Jan Palenstijn 820caf370e SCI32: Fix kObjectIntersect
It was using SCI16 calls to get the NowSeenRects.

This fixes #9855.
2017-07-09 22:56:04 +02:00
Colin Snover f59269006c SCI32: Implement kShowStyle HShutterOut transition
This transition style was used when exiting the asteroids minigame
in PQ4, though it appears likely that this was an error in the
original game script since it does not actually do anything in the
context that it is used (neither here nor in the original
interpreter).

Still, this code is already written, and it fixes the crash, so in
it goes.

Fixes Trac#9856.
2017-07-07 23:42:30 -05:00
Colin Snover 9e90624052 SCI32: Add workarounds for PQ4 2017-07-07 23:41:53 -05:00
Colin Snover 07d6ffd989 SCI32: Force General MIDI for games that support nothing else
* MGDX has only GM music;
* KQ7 1.x's AdLib data is incomplete, so is not usable even though
  it is partially there

Fixes Trac#9789.
2017-07-07 13:28:54 -05:00
Colin Snover 90cd56e4b6 SCI32: Fix missing music in MGDX
GM patch data is the same across all SCI32 games.
2017-07-07 13:25:02 -05:00
Colin Snover f6dd8ad290 SCI: Fix audio_list debug command engine version info 2017-07-07 13:25:02 -05:00
Colin Snover 12d24d5b46 SCI32: Fix bad palette entries when built without USE_RGB_COLOR
This is only a problem for the Windows games that need some
palette entries to be ignored.
2017-07-06 19:12:40 -05:00
Colin Snover 3f0e061eaa SCI32: Refactor DuckPlayer to use common video playback code
This lets DuckPlayer support configurable black-lined video and
configurable high-quality scaling.
2017-07-06 19:12:39 -05:00
Colin Snover f15f9e3b7c SCI32: Refactor Video32 code to reduce code & feature duplication 2017-07-06 19:12:39 -05:00
Colin Snover 71256a0d3c SCI32: Improve playback quality of SEQ videos 2017-07-06 19:12:39 -05:00
Colin Snover 7057f232d7 SCI32: Improve kPlayVMD rendering
1. Added a new game option for linear interpolation when scaling
   overlay-mode video in ScummVM builds with USE_RGB_COLOR;
2. Implemented SCI2.1-variant of the VMD player renderer (fixes
   Trac#9857), which bypasses the engine's normal rendering
   pipeline;
3. Improved accuracy of the SCI3-variant of the VMD player by
   writing HunkPalettes into the VMD's CelObjMem instead of
   submitting palettes directly to GfxPalette32.
2017-07-06 19:12:38 -05:00
Colin Snover 8cb35442c0 SCI32: Improve kShowMovieWin (AVI) rendering
1. Added a new game option for linear interpolation when scaling
   video in ScummVM builds with USE_RGB_COLOR;
2. 8bpp videos that put black in a palette index other than 0
   (KQ7) should now always render correctly without the earlier
   game-specific workarounds which did not work very well;
3. Data from game scripts regarding video size and position are
   now ignored, since games always just try to show videos in the
   middle of the screen, but frequently get this a little bit
   wrong, causing either bad aspect ratios or off-center videos;
4. Builds without USE_RGB_COLOR support will not crash when
   attempting to play >8bpp AVIs, like those from KQ7 2.00b.

Fixes Trac#9843, Trac#9762.
2017-07-06 19:12:38 -05:00
Colin Snover e9bef89646 SCI32: Remove useless call
The show list is already cleared by showBits so it does not need to
be cleared a second time.
2017-07-06 19:12:38 -05:00
Colin Snover 2d6fe2b8cd SCI32: Work around bogus palette entries in select Windows games 2017-07-06 19:12:37 -05:00
Colin Snover c6f5840196 SCI32: Remove magic numbers in HunkPalette 2017-07-06 19:12:37 -05:00
Colin Snover f7fcce24e1 SCI32: Remove unused method declaration 2017-07-06 19:12:37 -05:00
Colin Snover 35346bc71b SCI32: Update mouse position for rendering in all frameOuts 2017-07-06 19:12:37 -05:00
Colin Snover 1466fb247e SCI32: Add workaround for SQ6 2017-07-06 19:12:36 -05:00
Colin Snover 1fbee2f51e SCI32: Allow skipping SEQ animations
In SSCI, SEQ animations cannot be skipped.
2017-07-06 19:12:36 -05:00
Colin Snover 9f910535c9 SCI32: Centralise OSystem screen updates 2017-07-06 19:12:35 -05:00
Colin Snover f40ea8c2e7 SCI32: Stop setting unused palette timestamp property 2017-07-06 19:12:35 -05:00