Commit Graph

545 Commits

Author SHA1 Message Date
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
Colin Snover
774d0cbdb3 SCI32: Disable KQ7 subtitles
The subtitles in KQ7 were not finished and don't quite work right,
drawing off the screen and in weird positions. They could probably
be fixed with some aggressive script patching, but for now, they
are just disabled (as they are in the official release).
2016-07-10 10:50:05 -05:00
Colin Snover
4d91b458e5 SCI32: Implement kPlayVMD 2016-07-10 09:35:24 -05:00
Colin Snover
cfda8b9ecd SCI32: Fix broken Remap implementation
Remap would crash SCI2.1early games with 19 remap slots, and
did not actually work in most cases in SCI2.1mid+ games.

The SCI16 implementation was moved to its own separate file but
was otherwise touched as little as possible, so may still have
similar problems to the SCI32 code.

1. Split SCI16 and SCI32 code into separate files
2. Use -32 prefixes for SCI32 code and no prefix for SCI16 code,
   where possible, to match other existing code
3. Avoid accidental corruption of values from the VM that may be
   valid when signed or larger than 8 bits
4. Added documentation
5. Add missing remap CelObj calls
6. Inline where possible in performance-critical code paths
7. Fix bad `matchColor` function, and move it from GfxPalette to
   GfxRemap32 since it is only used by GfxRemap32
8. Fix bad capitalisation in getCycleMap
9. Remove unnecessary initialisation of SingleRemaps
10. Update architecture to more closely mirror how SSCI worked
11. Clarify the purpose of each type of remap type (and
    associated variable names)
12. Split large `apply` function into smaller units
13. Fix buffer overrun when loading a SCI2.1early game with remap
14. Remove use of `#define` constants
15. Warn instead of crashing with an error on invalid input (to
    match SSCI more closely)
16. Change the collision avoidance mechanism between the RemapType
    enum and remap kernel functions
17. Add save/load function
2016-06-26 12:42:58 -05:00
Martin Kiewitz
cedcdbc48d SCI: Add getGameObjectName to fix compilation
Is needed for 80462b3 (Fix auto-saving in the fan-made Cascade Quest)
2016-06-25 23:59:46 +02:00
Colin Snover
4495ae3de0 SCI32: Remove unused dependencies from GfxFrameout 2016-06-21 08:17:28 -05:00
Willem Jan Palenstijn
ab864ba366 SCI32: Implement kScrollWindow
These should be all the actually used subfunctions.

Co-authored-by: Colin Snover <github.com@zetafleet.com>
2016-06-21 08:14:12 -05:00
Colin Snover
a613a27b44 SCI32: Implement line drawing (kAddLine/kUpdateLine/kRemoveLine)
This line drawing code lives in a remodelled GfxPaint32 class
that is totally separate from GfxPaint16.
2016-06-21 08:14:12 -05:00
Colin Snover
46551fd4b5 SCI32: Rewrite digital audio engine
This provides a complete implementation of kDoAudio through
SCI2.1mid, plus partial implementation of SCI3 features.

Digital audio calls shunted through kDoSound have also been
updated to go through the SCI32 audio mixer, though these shunts
are a bit hacky because the ScummVM implementation of kDoSound
does not currently match how SSCI kDoSound is designed.

It is probably possible in the future to just replace the SCI1.1
audio code (audio.cpp) with the new SCI32 code, since the major
differences seem to be that (1) SCI1.1 only supported one digital
audio playback channel (this is configurable already), (2) it
had extra commands for CD audio playback and queued sample
playback.
2016-06-20 21:02:21 -05:00
Colin Snover
5d3385750d SCI: Split audio sync to its own class
SCI32 has its own audio handling code, but audio sync code is the
same as SCI16.
2016-06-19 14:48:33 -05:00
Filippos Karapetis
55390e77b1 SCI: Remove unused _gfxScreen parameter from GfxRemap 2016-03-15 11:28:13 +02:00
Filippos Karapetis
3a770fa0d8 SCI32: Initial implementation of kRemapColors
applyRemap() is still not finished, so nothing is actually visible yet
2016-03-11 05:10:32 +02:00
Filippos Karapetis
f450ca0ebf SCI: Split color remapping functionality into a separate class
Currently, only the SCI16 remapping functionality is implemented
(used in the QFG4 demo)
2016-03-08 20:36:03 +02:00
Filippos Karapetis
6958aa9890 SCI: Separate the demos of QFG4, PQ4 and GK1 from their full versions
The demo versions of these games were using a very different engine -
SCI1.1 vs SCI2/SCI2.1. Thus, we split them into different game IDs,
to avoid mixing specific game checks for them, as well as specific
game workarounds, which are different for the demos than the full
versions. Also, the demos should be working when SCI32 is disabled.
For these games, we don't use ADGF_DEMO, to avoid game IDs like
foodemo-demo
2016-03-08 20:36:02 +02:00
Johannes Schickel
3aecd8ef2a ENGINES: Make variable names of ADGameDescription conform to our guidelines.
gameid     -> gameId
guioptions -> guiOptions
2016-03-08 19:01:38 +01:00
Colin Snover
1337cd3dec SCI32: Implement kEditText 2016-03-06 21:34:43 -06:00
Martin Kiewitz
8588592947 SCI32: Don't do a syncWithScripts on restore from launcher
Causes issues in at least gk1 (option + inventory plane are shown)
Game::restore is not called, when doing restores from launcher,
so in the original interpreter this script code wasn't called
either.

Fixes option + inventory planes etc. being shown right after
restoring via launcher, when original save/load dialogs were
disabled.
2016-03-02 19:34:40 +01:00
Martin Kiewitz
f3c2d7629d SCI: Fix FM-Towns audio language selection
This first of all combines both detection entries and makes it
possible so that the user can directly choose English or Japanese
without having to add the game twice.
But it also fixes the in-game option to switch between English
and Japanese. Prior to this commit it was only possible to for
example switch from Japanese to English once, but it was not
possible to switch back without quitting the game and starting it
again.
2016-02-24 00:51:50 +01:00
Martin Kiewitz
82165bb6f6 SCI: Improve kAnimate fastcast detection, Remove EQ1 hack
- Add "kAnimate fast cast state" to "version" debug command
- Make it possible for script patcher signatures to get fully
used outside of the regular script patcher
- Remove previous fastcast detections and replace them with
a signature heuristic
- Remove object name checking, when fastcast global is set
- Heuristic detects "fast cast" support incorrectly for multilingual
KQ5, but it seems the game never sets the global, so it won't
matter. KQ5 CD (also SCI1 late) has fastcast support.
- Remove hack in GfxView::draw
- Add lots of comments to ScriptPatcher class

This fixes EcoQuest 1 Floppy showing the anemone on top of the
message box (see bug #5170)
2016-02-23 20:17:18 +01:00
Martin Kiewitz
1ac8533b1f SCI32: Fix save patching for ScummVM dialog
- Patch game super object for saving instead of game object
- Remove re-adding planes+screen items, game::replay does that
We would only have to do that for soft-failing on restore
- Change debug levels of kNumLoops/kNumCels to 9
- Add special comment about -info- selector in syncWithScripts()

This should now make ScummVM menu saving work properly at
least in SQ6.
2016-02-21 20:33:17 +01:00
Colin Snover
20ccad80bf SCI: WIP GfxText32 code
This at least prevents SQ6 from crashing when going into the
introduction
2016-02-18 13:18:02 -06:00
Colin Snover
75ccabc325 SCI: Implement accurate renderer architecture for SCI32 2016-02-18 13:18:02 -06:00
Alexandre Detiste
6c298e964f JANITORIAL: Typos detected with lintian & grep 2016-02-15 18:27:02 +01:00
Martin Kiewitz
b2ab29587b SCI: Only select save slots for kernel calls
Previous code also selected files called e.g. "[targetname].abc"
2016-01-26 16:55:38 +01:00
Martin Kiewitz
9f43193730 SCI32: PQ4 seems to support high resolution too 2016-01-22 02:30:13 +01:00
Martin Kiewitz
0aa9924df1 SCI: add user option for high resolution graphics
Instead of choosing Windows as platform, users can now also simply
click this option for Gabriel Knight 1 + King's Quest 6
Defaults to high resolution graphics
2016-01-22 02:01:28 +01:00
Colin Snover
76bd2eeb2e SCI: Use tick-based timing more consistently
This means tick-based times are saved to save games, as in SCI32
engine, instead of seconds, which are not accurate enough. It
also means places in SCI engine that need to access game ticks
should do so through g_sci instead of g_system or g_engine.
2016-01-14 16:13:22 -06:00
Willem Jan Palenstijn
22796e559f SCI: Fix compilation when SCI32 is disabled
Thanks bSr43
2016-01-10 12:38:10 +01:00
Colin Snover
aeee621e44 SCI32: Add initial support for palette cycling (kPalCycle) and fading (kPalFade)
Graphics palette code was rewritten between SCI1 and SCI2, so
SCI32 palette engine code has been moved to a separate GfxPalette32
class.
2016-01-07 16:35:09 -06:00
Martin Kiewitz
0dd760724e SCI32: split up SCI2.1 into EARLY/MIDDLE/LATE
- Detection works via signatures (couldn't find a better way)
- new kString subcalls were introduced SCI2.1 LATE
- kString now has signatures and is split via subcall table
- kString fix, so that KQ7 doesn't crash, when starting a chapter
- Sci2StringFunctionType removed, because no longer needed
2015-12-29 01:44:11 +01:00
Johannes Schickel
d2d700e086 SCI: Remove superflous default value registration for extra GUI options. 2015-12-28 00:14:11 +01:00
Martin Kiewitz
b0587f6af8 SCI32: add code for torin+sq6 audio+subtitles mode
also add comments about other SCI32 games
set global 90 only for lsl6 sci1.1
2015-12-22 01:53:19 +01:00
Martin Kiewitz
d0d1d6e921 SCI32: add code for kq7 audio+subtitles mode
also enables it for gk1 and qfg4 (CD versions)
2015-12-21 23:25:58 +01:00
Martin Kiewitz
139bdec3ba SCI: immediate restore now uses delayed restore
instead of the old hackish method
2015-04-27 18:21:41 +02:00
Martin Kiewitz
83c6e1543e SCI: add debug level for workarounds
It's called "Workarounds"
2015-04-18 23:13:11 +02:00
Filippos Karapetis
9783f0bbd9 SCI: Remove trailing whitespace 2014-10-28 16:17:06 +02:00
Martin Kiewitz
d4de84bf8b SCI: fix saving in mother goose sci0 (bug #6486) 2014-06-02 20:51:39 +02:00
Johannes Schickel
8fc7d60feb SCI: Make GPL headers consistent in themselves. 2014-02-18 02:39:37 +01:00
Filippos Karapetis
474c45fdc6 SCI: Some minor cleanup 2014-02-17 11:48:34 +02:00
Filippos Karapetis
5b1631960e SCI: Fix bug #6536 - "SCI: JONES - top menu empty after loading from launcher" 2014-02-17 03:29:54 +02:00
Martin Kiewitz
d5331ab923 SCI: improved lb2+kq6 patches (new speech state)
adds a third button state to the game menu
this state is "dual mode" (audio+text at the same time)
currently uses the "speech" graphic
CD versions of Laura Bow 2 + King's Quest 6 will now always get patched
2013-12-22 20:46:54 +01:00
Matthew Hoops
70d3610f30 SCI: Add detection for Torin Mac 2013-12-11 20:28:50 -05:00
Martin Kiewitz
dbfaac22ed SCI: only apply audio+text patch to KQ6 CD+LB2 CD 2013-12-08 15:40:18 +01:00
Martin Kiewitz
9de412c4ff SCI: sci.cpp updated b/c KQ6 audio+text support 2013-12-08 14:55:06 +01:00
Martin Kiewitz
8bdffcb2fb SCI: script patcher is now a separate class 2013-12-04 20:42:16 +01:00
Martin Kiewitz
ba3656d84e SCI: fix script patcher for games w/o vocab 2013-11-21 22:41:07 +01:00
Willem Jan Palenstijn
3ea127e877 SCI: Fix warning 2013-11-21 09:39:19 +01:00
Martin Kiewitz
4e2b1f0200 SCI: script patch for laura bow 2 for audio+text
at the same time
needs indepth testing
2013-11-20 23:31:36 +01:00
Martin Kiewitz
f1abc0c302 SCI: improved patcher, inventory patch for kq6/mac
Also added new debug flag for script patcher
2013-11-01 13:25:31 +01:00
Filippos Karapetis
f9bbc2ca37 SCI: Update ScummVM's game audio options for SCI1.1 CD games
This ensures that ScummVM's game audio options for speech and subtitles
get updated when they are changed in the game GUI
2013-10-31 07:25:25 +02:00
Matthew Hoops
9eb5d23a5e SCI: Fix patched save/load dialogs in SCI32 Mac games 2013-04-28 14:56:06 -04:00
Filippos Karapetis
99e90b98f0 SCI: Fix incorrect detection of NRS patches in QFG3 (bug #3574541) 2013-04-27 14:40:08 +03:00
Max Horn
51bde6ced5 SCI: Remove a bunch of unused private member variables
All instances uncovered by clang warnings.
2013-04-18 23:50:20 +02:00
Filippos Karapetis
dc93093afa SCI: Fix a small glitch when loading (regression)
This is caused by commit ed6bc0a13d,
and caused players to click an extra time when trying to change the
game audio options after loading a game
2012-12-03 02:11:34 +02:00
Filippos Karapetis
ed6bc0a13d SCI: Resync audio options when a game is restarted (bug #3589453) 2012-12-02 15:20:41 +02:00
Filippos Karapetis
c34704972e SCI: reset _throttleLastTime when restarting
This ensures that the load dialog in the ScummVM menu won't be
available at inappropriate times when a game is restarting (e.g QFG1,
during the starting warning dialogs - bug #3565505)
2012-11-06 12:58:33 +02:00
Filippos Karapetis
3a852fb96a SCI: Also add LSL6 CD to syncIngameAudioOptions() 2012-10-08 23:49:49 +03:00
Matthew Hoops
d4231fda1c SCI: Rewrite RobotDecoder to use the AdvancedVideoDecoder API 2012-07-22 23:17:36 -04:00
Filippos Karapetis
2b50824133 SCI: Add setter/getter methods to reg_t's
No functionality change has been made with this commit. This avoids
setting and getting the reg_t members directly, and is the basis of any
future work on large SCI3 scripts (larger than 64KB)
2012-06-18 05:24:06 +03:00
Filippos Karapetis
a1554b9ddd SCI: Fix the detection of the NRS patch for QFG3 2012-05-22 10:50:40 +03:00
Filippos Karapetis
6a49d3eadd ENGINES: Return all available custom GUI options if no target is specified
This is used to set default settings for all custom game options when an
engine starts
2012-03-31 13:55:03 +03:00
Filippos Karapetis
7f9c63239b SCI: Make sure that the disable_dithering key exists 2012-03-31 05:54:30 +03:00
Filippos Karapetis
1938d95c4e SCI: Rename the sci_originalsavedload option to originalsaveload
This changes its naming to be like the rest of the game options
2012-03-25 17:48:38 +03:00