Commit graph

184 commits

Author SHA1 Message Date
Colin Snover
64dc37cfe2 SCI32: Start implementing kSave for SCI32 2016-09-29 19:39:16 -05:00
Colin Snover
c7dacf273e SCI32: Clean up and fix some SCI32-only kFileIO operations 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
44dd029cb1 SCI32: Implement kSetHotRectangles
Used only by chapter 7 of Phant1.
2016-09-29 19:39:16 -05:00
Colin Snover
2be2629a3b SCI32: Fix kFileIOOpen signature
The mode argument is required in SCI32 too; Torin just had a script
bug.
2016-09-29 19:39:16 -05:00
Colin Snover
3f91726765 SCI32: Rewrite kArray & kString
This change invalidates earlier SCI32 save games, which separated
arrays and strings in an incompatible manner. Old save games
contain invalid references to a string segment which no longer
exists, and contain incompatible array structures that lack
critical type information.
2016-09-29 19:39:16 -05:00
Colin Snover
b784357f5d SCI: Fix whitespace 2016-09-29 19:39:16 -05:00
Colin Snover
c3335657f7 SCI32: Allow invalid bitmap references to be passed to kBitmapDestroy
SSCI explicitly ignored invalid references passed to this function.

Fixes GK1 room 410, when using the Rada Drum book on the drummer.
2016-08-27 12:03:37 -05:00
Filippos Karapetis
ed461fba65 SCI32: Add a workaround when starting a new game in Phantasmagoria
This workaround is needed when starting a new game from a chapter after
the first one
2016-08-25 21:56:23 +03:00
Filippos Karapetis
25515c690e SCI32: Fix the signature of kDoAudioCritical, and add documentation
This is used in Phantasmagoria, chapter 3, nursery (room 14200),
during the "ghost lullaby" event. It is used to make the lullaby
sound exclusive, but it really doesn't make any major difference.

Also, the documentation has been adjusted to contain this
information. Finally, the documentation has been adjusted to use
80 columns
2016-08-25 17:02:21 +03:00
Filippos Karapetis
380902eb07 SCI32: Add workarounds for a bug in Torin, in an animation of Lycentia 2016-08-24 11:57:08 +03:00
Filippos Karapetis
ba8d6f6c03 SCI32: Move the SCI32 Mac cursor handling code into GfxCursor32
This was left in the SCI16 code in commit 80d9182554
2016-08-22 19:56:06 +03:00
Filippos Karapetis
88cffa3220 SCI32: Add stubs for the kPlayVMDSetPreload and kPaletteSetGamma calls
These were introduced in SCI3, and are used by RAMA. We don't preload
videos, so we don't really need kPlayVMDSetPreload, but
kPaletteSetGamma may need an implementation.

With these two stubs, the main menu of RAMA is working again
2016-08-22 19:04:26 +03:00
Filippos Karapetis
6b5e87683c SCI32: Reorder the SCI32 palette kernel call assignments 2016-08-22 18:52:20 +03:00
Colin Snover
dc093742b3 SCI32: Bug fixes to PQ:SWAT script bugs and kList calls 2016-08-19 15:23:10 -05:00
Colin Snover
0a4a2567a3 SCI32: Partially implement kCD 2016-08-19 15:23:10 -05:00
Colin Snover
e55b774584 SCI32: Add kPlayVMDGetStatus kernel call
Used by Lighthouse.
2016-08-19 15:23:10 -05:00
Colin Snover
eae6891404 SCI32: Fix kGlobalToLocal and kLocalToGlobal
Fixes (at least) the native SCI save dialogs.
2016-08-19 15:23:10 -05:00
Colin Snover
0f2748b15a SCI32: Implement kRobot 2016-08-19 14:08:22 -05:00
Colin Snover
7da359755d SCI32: Split kPlatform for SCI32 2016-08-19 13:57:40 -05:00
Colin Snover
6e2e862d8e SCI32: Implement kShakeScreen for SCI32 2016-08-19 13:57:40 -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
ef2c44bf1f SCI32: Implement kShowMovie 2016-08-12 09:28:46 -05:00
Colin Snover
31f344079f SCI32: Temporarily revert kShowMovie due to buildbot failures
Revert "SCI32: Fix KQ7 1.51 video background"

This reverts commit c8affb54cc.

Revert "SCI32: Fix crash when kShowMovie is called but the video cannot be found"

This reverts commit 93b06f4a9e.

Revert "SCI32: Fix KQ7 1.51 basic video playback"

This reverts commit cdab24aa07.

Revert "SCI32: Additional Video32 documentation"

This reverts commit 4ff0924e57.

Revert "SCI32: Implement kShowMovie"

This reverts commit 13297c1929.
2016-08-11 21:43:57 -05:00
Colin Snover
13297c1929 SCI32: Implement kShowMovie 2016-08-11 20:50:33 -05:00
Colin Snover
0f535e79f5 SCI32: Add 6-argument signature of kAddPicAt
This is used by Torin in room 50900.
2016-08-01 10:37:14 -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
4cfc387602 SCI32: Split GfxPalette and GfxPalette32 + HunkPalette 2016-07-11 10:39:50 -05:00
Colin Snover
7f53a26d9e SCI32: Split kPalCycle into subop functions 2016-07-11 10:39:50 -05:00
Colin Snover
19f90177b7 SCI32: Clean up Video32/VMDPlayer 2016-07-10 10:18:30 -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
52505dc57f SCI32: Implement basic kMessageBox
This kernel call seems only to be used by KQ7 1.51 (which was
Windows-only) to send warnings to the user.

It was easy enough to do a basic implementation in the ScummVM
GUI rather than just make it an empty call, so now it is a thing.
2016-06-21 08:14:12 -05:00
Willem Jan Palenstijn
ceee33ba2c SCI32: Add workaround for kScrollWindowAdd call in Phantasmagoria 2016-06-21 08:14:12 -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
f939868f3a SCI32: Add kDoSound(play) workaround for LSL6hires 2016-06-20 21:52:41 -05:00
Colin Snover
f02107f682 SCI: Minor cleanup of kDoSound
Replaces unused kernel calls to use kEmpty, and set correct
signatures for SCI32 kernel calls.
2016-06-20 21:02:21 -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
c231d22c28 SCI32: Fix LSL6 hires control panel script bug
The control panel initialisation script makes an invalid two-argument
call to get the width of the settings dial; this only happens to work
because the third argument on the stack was set to zero by an earlier
call.
2016-05-25 19:16:11 -05:00
Colin Snover
30cb8f5c4f SCI32: Correct some kernel call signatures 2016-03-13 12:45:59 -05:00
Colin Snover
362b46259f SCI32: Implement kCelHigh and kCelWide SCI32 versions
The SCI16 versions do not implement the scaling algorithm used
by SCI32 so would be off by one in some cases.
2016-03-13 12:40:16 -05: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
Colin Snover
8dea740086 SCI32: Implement kMovePlaneItems 2016-03-10 18:28:53 -06:00
Colin Snover
0bb4c32c50 SCI32: Minor cleanup of kernel calls 2016-03-10 14:16:56 -06:00
Colin Snover
4a16ebc970 SCI32: Implement kSetNowSeen 2016-03-10 14:16:56 -06:00
Colin Snover
eac416f480 SCI32: Implement kCantBeHere 2016-03-10 10:38:07 -06:00
Colin Snover
9a280d3965 SCI32: Add all kBitmap signatures
Not all SCI2.1late/SCI3 function signatures are fully known yet,
but all subops are now represented in the kernel tables.
2016-03-03 20:31:10 -06:00
Filippos Karapetis
5125652be2 SCI32: Add a workaround for kPalVarySetPercent in GK1 (chapter change) 2016-03-02 21:43:27 +02:00