Commit graph

507 commits

Author SHA1 Message Date
Colin Snover
f11b0a4ff5 SCI32: Toggle Phant2 content censoring from game options
To enable the optional content censoring mode, Phant2 looks
for a RESDUK.PAT file, which is normally placed by the game's
installer if the user chose to enable censorship. If the file
exists, the game reads an unlock password out of the file and
asks the user to enter the password when starting a new game to
create an uncensored game, or to click a "less intense" button
to start the game with censoring. The censorship state of the
game is then persisted in the save game file, and installations
with the RESDUK.PAT file need to enter the password again in
order to restore any of the uncensored saves.

Since we do not have an installer that can enable this feature,
add a game option toggle to enable/disable censoring (for the
releases that have the optional censorship mode) instead so the
censored content feature is available for anyone that wants to use
it. This flag is restored from ScummVM whenever a save game is
loaded, so it can be toggled on or off at any point without
needing a separate save game, unlike in the original interpreter.
2017-09-08 16:03:24 -05:00
Colin Snover
365dde1e5d SCI32: Reduce priority of PATCHES directory for Phant2
For whatever reason, Sierra decided that the final patches would
go in the root directory for Phant2. The game disc includes
(different, older) patches for many of the same resources in the
PATCHES directory, and loading those instead makes the game not
always work quite right.
2017-07-26 22:43:20 -05:00
Colin Snover
f15f9e3b7c SCI32: Refactor Video32 code to reduce code & feature duplication 2017-07-06 19:12:39 -05:00
Colin Snover
9f910535c9 SCI32: Centralise OSystem screen updates 2017-07-06 19:12:35 -05:00
Colin Snover
d556dcc57b SCI: Switch SCI2 games to use Audio32
Upon investigation of Sound code across SCI32 games, it was
determined that there are actually (at least) 3 different
revisions, not just a single SCI2.1 version. This patch only
changes the parts of Sound code that are relevant to the correct
use of Audio32.

Fixes Trac#9736, Trac#9756, Trac#9767, Trac#9791.
2017-06-18 21:42:58 -05:00
Colin Snover
d6ff67e3c4 SCI32: Fix detection and loading of localized resources in Torin
Italian still needs to be fixed, but nobody seems to have access
to this version at the moment.

Fixes Trac#9772.
2017-06-10 20:32:22 -05:00
Willem Jan Palenstijn
423ecde8e0 SCI: Move printObject from console to scriptdebug 2017-06-10 21:32:35 +02:00
Colin Snover
61f07c13d3 SCI: Start engine at tick 1
In SSCI, games could never start at tick 0 because the video
benchmarking code on game startup would take several ticks to
run. In ScummVM, where the benchmarking code is disabled, it
becomes possible for games to start at tick 0. This can break a
lot of kernel code, which uses tick 0 as a special value
indicating that a feature is not active. For example, in GK2,
the music at the start of the game will not fade in on systems
that are fast enough to start audio playback at tick 0, since
a fade start tick of 0 is used to indicate audio fade is disabled.

Fixes Trac#9830.
2017-06-10 12:28:21 -05:00
Colin Snover
57d257b36a SCI32: Fix audio sync recursion
Calling to SciEngine::syncSoundSettings from GuestAdditions
recurses back into GuestAdditions, which is obviously not
desirable. Even when it didn't manage to cause infinite recursion
(as in SQ6 demo), it would make the UI behave in broken ways (e.g.
the +/- buttons on the music slider in SQ6 would not work because
the UI would just get updated immediately back to the closest
rounded value).
2017-06-09 23:30:10 -05:00
Hein-Pieter van Braam
cffe01536e SCI32: Add 'music/' subdir to file path for LSL7 GOG
LSL7 originally came with music in two qualities in subdirectories of
the 'music' directory, 22s8 and 22s16. The gog.com release doesn't do
this and only ships the hq music in the root of 'music/'. This PR adds
it to the search path.

Closes gh-951.
2017-05-23 23:16:15 -05:00
Colin Snover
eba1e883e9 SCI: Minor punctuation fix in buggy script alert 2017-05-20 21:14:18 -05:00
Colin Snover
9e839775b6 SCI: Add "patch" directory to search paths
Refs Trac#9776.
2017-05-10 12:04:56 -05:00
Colin Snover
200adb99cf SCI: Add example of KQ6 game with incorrect patches directory 2017-05-10 11:53:26 -05:00
Colin Snover
c9cbb8e31c SCI: Translate messages passed to dialogues 2017-05-08 11:26:46 -05:00
Colin Snover
8b49313af3 SCI32: Fix terrible rendering performance when vsync is enabled
More than one call to OSystem::updateScreen per frame on systems
with vsync ruins performance because the call is blocked until
the next vsync interval.

This also fixes bad rendering performance with the OpenGL backend.
2017-05-06 10:38:58 -05:00
Colin Snover
866419fa71 SCI: Implement fallback detection for SCI3 2017-04-23 13:07:25 -05:00
Colin Snover
ca507e2b0b SCI: Fix missing music in LSL7 2017-04-23 13:07:25 -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
31daa956d6 SCI: Implement bounds-checked reads of game resources 2017-03-27 19:42:31 -05:00
Colin Snover
0e77471467 SCI: Remove unused SciEngine::speechAndSubtitlesEnabled method 2017-01-16 12:16:12 -06:00
Colin Snover
bf293fface SCI: Fix non-responsive application warning during sysex transfers
This also fixes the display of the startup LCD message, which had
been delayed until after the sysex transfer was finished.
2016-12-03 12:21:54 -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
42ebd5a664 SCI32: Allow SCI32 games to update speech & subtitles settings
Fixes Trac#9637.
2016-11-03 13:14:58 -05:00
Colin Snover
67acdb628b SCI32: Sync subtitle text speed with ScummVM GUI 2016-09-30 20:08:09 -05:00
Colin Snover
6290f1e5fc SCI: Add prefix to global variable constants 2016-09-29 19:39:16 -05:00
Colin Snover
1847b0f705 SCI32: Fix warnings and incompatible save games when built without SCI32 2016-09-29 19:39:16 -05:00
Colin Snover
0c9d423497 SCI32: Emulate MGDX ego view metadata 2016-09-29 19:39:16 -05:00
Colin Snover
fba8568484 SCI32: Fix multiple bugs in kSave
1. Shift save numbers up/down for game scripts that rely on save
   game numbers starting from 0 to work correctly
2. Add fake file operations to support KQ7 save games
3. Hide autosave games from native save/load list to match SSCI.
2016-09-29 19:39:16 -05:00
Colin Snover
1eb6d90eec SCI32: Implement ScummVM save/load 2016-09-29 19:39:16 -05:00
Colin Snover
b5d0fffb8b SCI: Replace magic numbers for globals with named constants 2016-09-29 19:39:16 -05:00
Colin Snover
64dc37cfe2 SCI32: Start implementing kSave for SCI32 2016-09-29 19:39:16 -05:00
Colin Snover
02540b8d38 SCI32: Add support for kPrintDebug 2016-09-29 19:39:16 -05:00
Colin Snover
560af83300 SCI: Move SciEngine::sleep to correct source file 2016-09-29 19:39:16 -05:00
Filippos Karapetis
ad693ee768 SCI: Add a sanity check in wrapFilename(), as in unwrapFilename() 2016-08-26 11:26:09 +03:00
Filippos Karapetis
6ce472a12a SCI32: Update the SCI2/SCI2.1 games that use global 90 for speech/subs 2016-08-23 12:22:27 +03:00
Colin Snover
da62a99a00 SCI32: Remove unused ResourceManager from GfxFrameout 2016-08-19 15:23:10 -05:00
Colin Snover
4e1a9be816 SCI32: Remove CoordAdjuster32, at least for the moment
This may come back in the future to deduplicate some gfx code,
but SCI32 had two different inlined ways of doing coordinate
conversions with different rounding methods, so CoordAdjuster32
didn't get used when the graphics system was rewritten.

At the moment, SCI32 code uses the mulru/mulinc methods from
helper.h for scaling up/down coordinates.
2016-08-19 15:23:10 -05:00
Colin Snover
0f2748b15a SCI32: Implement kRobot 2016-08-19 14:08:22 -05:00
Colin Snover
ff00e93c67 SCI32: Remove GfxScreen from SCI32 2016-08-19 13:57:40 -05:00
Colin Snover
80d9182554 SCI32: Implement SCI32 cursor support 2016-08-19 13:57:40 -05:00
Colin Snover
9bfeb3c297 SCI32: Remove GfxScreen from GfxFrameout
Only cursor remains to be updated to go through GfxFrameout, and
then we can let GfxScreen go back to being SCI16-only.
2016-08-19 13:57:40 -05:00
Martin Kiewitz
035aa9acf4 SCI: Add comments about GK1 on Mac being hi-res only 2016-08-15 20:44:58 +02:00
Martin Kiewitz
ece303d7e3 SCI: Move GUI-options to sci.h 2016-08-15 19:59:46 +02:00
Martin Kiewitz
ad68471040 SCI: Improve "force hires graphics"-option reading code
We originally used hardcoded gameIDs and checked for CD-version.
Now the game option itself is checked for.
When it's available for the currently detected game, the option
is read, otherwise it defaults to false (same behavior as before).
2016-08-15 19:09:39 +02:00
Colin Snover
156c68fe58 SCI32: Implement plane transitions (kSetShowStyle and kSetScroll)
This commit implements all of the known plane transitions from
SCI2 through SCI2.1mid games. Because kSetShowStyle is always
called indirectly via the Styler game script, it is difficult to
find all the places where transitions are used. As such,
transitions that appeared to never be used have been added as
stubs which will trigger a game crash with a message to report
what was being done, so any missed transition types can be
identified quickly and then implemented.
2016-08-01 10:37:14 -05:00
Colin Snover
32531ac16a SCI32: Fix Video32 breaking when quitting during video playback 2016-07-24 12:07:04 -05:00
Colin Snover
4cfc387602 SCI32: Split GfxPalette and GfxPalette32 + HunkPalette 2016-07-11 10:39:50 -05:00
Colin Snover
46804fda15 SCI32: Re-enable KQ7 subtitles, but with a warning on game start 2016-07-10 11:46:19 -05:00