176 Commits

Author SHA1 Message Date
Le Philousophe
96103179af SCI: Fix build when SCI32 isn't enabled 2019-07-08 10:15:09 +03:00
Filippos Karapetis
49a6346966 SCI32: Add stub for the Hoyle 5 Poker game logic 2019-07-07 22:26:03 +03:00
athrxx
acfc0c90ce SCI: add PC-9801 sound driver
(supports SCI1 for now)
2019-04-02 20:45:35 +03: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
80d9182554 SCI32: Implement SCI32 cursor support 2016-08-19 13:57:40 -05: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
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
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
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
Colin Snover
b804483e5e SCI: Fix missing whitespace causing create_project errors 2016-02-20 10:36:48 -06:00
Colin Snover
75ccabc325 SCI: Implement accurate renderer architecture for SCI32 2016-02-18 13:18:02 -06: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
Filippos Karapetis
9783f0bbd9 SCI: Remove trailing whitespace 2014-10-28 16:17:06 +02:00
Filippos Karapetis
aeac51d726 SCI: Implement the file operations needed for the save dialog in Phantasmagoria
Phantasmagoria's scripts keep polling for the existence of the savegame
index file and request to read and write it using the same parameters
when opening it. The index file is closed and reopened for every save
slot, which is slow and can be much slower on non-desktop devices.
Also, the game scripts request seeking in writable streams and request
to expand the existing index file.

To provide this functionality and to reduce constant slow file opening
and closing, this virtual class has been introduced
2012-06-13 12:26:49 +03:00
Matthew Hoops
a07840931a SCI: Properly alphabetize the SCI32 objects 2012-05-21 00:06:42 -04:00
Filippos Karapetis
f8c24b5d88 SCI: Split the SCI32 graphics kernel functions in a separate file 2012-05-20 20:16:15 +03:00
athrxx
6a91508475 SCI: add sound driver for KQ5 FM-Towns 2011-11-01 20:31:40 +01:00
Filippos Karapetis
4ac2940bc5 SCI: Added skeleton code for kEditText (still not working) 2011-10-28 22:20:33 +03:00
Filippos Karapetis
ac559b0212 SCI: Renamed GfxControls to GfxControls16 2011-10-26 01:54:27 +03:00
Filippos Karapetis
41cc1932d2 SCI32: Added an initial skeleton structure for the SCI2 text drawing code
This includes kCreateTextBitmap, and moves all of the text drawing code
into the new GfxText32 class
2011-09-03 14:51:51 +03:00
md5
4e88d75eb6 SCI: Refactored the reg_t related operations and comparisons
This refactoring reduces a lot of code duplication, allows for better control,
makes the code more readable and allows us to remove a lot of now unneeded
workarounds
2011-02-19 20:22:43 +02:00
Filippos Karapetis
6f9ac84f77 SCI: Converted the robot decoder into a regular video decoder, and decoupled it from the
SciEngine class

- Robot videos are now shown in frameOut(), like they should, and kRobot(sync) is only
used for syncing with the game scripts
- Hooked video playing into the "play_video" console command

svn-id: r55801
2011-02-07 12:24:09 +00:00
Filippos Karapetis
3b07056a47 SCI: Moved the Object class in a separate file
svn-id: r54361
2010-11-19 08:18:24 +00:00
Johannes Schickel
eb400c8787 SCI: Add CMS driver for SCI1-SCI1.1.
svn-id: r52781
2010-09-17 20:03:20 +00:00
Sven Hesse
f5d1482c64 SCI: Remove the now useless Sci::VMDDecoder wrapper
svn-id: r51923
2010-08-08 01:09:20 +00:00
Filippos Karapetis
57fd588327 SCI: Split the new script patch code in a separate file
svn-id: r51810
2010-08-06 22:36:46 +00:00
Filippos Karapetis
87e4823c75 SCI: Moved the actual workaround arrays inside a cpp file
svn-id: r51132
2010-07-22 08:58:59 +00:00
Filippos Karapetis
a1dab5f923 SCI: Moved all the video related functions in a separate file
svn-id: r51110
2010-07-21 21:37:30 +00:00
Filippos Karapetis
9862f3fe24 SCI: Moved the SCI32 kernel functions out of kernel32.cpp and into their respective files
svn-id: r51108
2010-07-21 21:18:21 +00:00
Matthew Hoops
0e9de72f62 SCI: Rename the Amiga music drivers to AmigaMac to reflect its current purpose.
svn-id: r51006
2010-07-18 19:01:35 +00:00
Filippos Karapetis
bff3e89e48 SCI: Removed the FreeSCI music code
svn-id: r50532
2010-06-30 13:49:05 +00:00
Martin Kiewitz
b25aba1d1e SCI: SciGui/SciGui32 gone for good...
svn-id: r49860
2010-06-15 15:44:24 +00:00
Filippos Karapetis
9b8e4e8359 Moved all of the game init/run/exit logic inside the SciEngine class
svn-id: r49559
2010-06-10 07:32:05 +00:00
Filippos Karapetis
e5eaf3ee55 Split all of the audio-related functions of the resource manager in a separate file
svn-id: r49260
2010-05-27 08:09:32 +00:00
Matthew Hoops
d49fb8f42d Add support for showing the icon bar in SCI1.1 Mac.
svn-id: r49196
2010-05-24 17:21:11 +00:00
Matthew Hoops
3dda73d9a2 Add initial support for KQ6 Mac. Wrapper functions for read/writing to pointers are now used (found in util.*) for code that has different endianness in SCI1.1+ Mac games. Add support for Mac 'snd ' and 'CURS' resources. QFG1 Mac is not yet playable due to script compression.
svn-id: r49070
2010-05-18 04:17:58 +00:00
Martin Kiewitz
cd4812dfd9 SCI: support for kanji (sjis), minor centering issue left
svn-id: r48674
2010-04-16 18:23:50 +00:00
Martin Kiewitz
f3ea96d168 SCI: GfxCoordAdjuster class added, local2Global and global2Local use that class directly, kGraph / RedrawBox is now using GfxPaint16 directly
svn-id: r47908
2010-02-05 18:56:13 +00:00
Martin Kiewitz
3ce2e22978 SCI: adding GfxPaint class, implementing kernelDrawPicture for GfxPaint16 and GfxPaint32, using those classes directly when drawing pictures instead of SciGui/32. Making draw_pic command work in sci32 that way, using _gfxPaint16 for kDrawPic because that command is sci16 exclusive
svn-id: r47883
2010-02-04 19:22:40 +00:00
Martin Kiewitz
5dc8f75b68 SCI: moving paint32.o around...
svn-id: r47882
2010-02-04 18:52:03 +00:00
Martin Kiewitz
6664d26db7 SCI: adding GfxPaint32 class, adding back support for planes, minor change in GfxPaint16 (using #def instead of fixed value)
svn-id: r47880
2010-02-04 17:57:44 +00:00
Filippos Karapetis
2fb37063a4 Placed all the game feature detection code in a separate class
svn-id: r47850
2010-02-03 11:02:43 +00:00
Matthew Hoops
5d80990380 Fix compile without SCI32
svn-id: r47822
2010-02-02 22:31:32 +00:00
Martin Kiewitz
714665f9d9 SCI: some sort of priority support for sci32 (not working right, but at least the menu in gk1 now correctly shows up)
svn-id: r47814
2010-02-02 16:25:35 +00:00
Martin Kiewitz
19bca95905 SCI: renamed Text class to GfxText16
svn-id: r47780
2010-01-31 21:54:43 +00:00
Travis Howell
d6611ec7dc Sort order.
svn-id: r47748
2010-01-31 12:54:48 +00:00
Martin Kiewitz
c67ba0536d SCI: forgot the cache :P
svn-id: r47747
2010-01-31 12:46:55 +00:00