Commit Graph
263 Commits
Author SHA1 Message Date
sluicebox 0eac3efe70 SCI32: Add LSL6HIRES kResCheck Wave/Audio handling
Adds missing fallback behavior that appeared in at least LSL6-Hires.
Removes a workaround that only addressed a symptom of this bug;
the buggy scripts only execute when a correct call to kResCheck fails.

- Clicking four times on lobby sign no longer crashes
- Sound effect now plays when quitting during end credits

Fixes bug #13549
2022-06-06 17:32:50 -04:00
sluicebox 6abb9c6061 SCI: kScummVMSleep is now available in SCI16 2022-04-08 22:42:04 -04:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
sluicebox 388f3a02ef SCI32: Create kScummVMSleep for script patches
We have several SCI32 script patches that replace kGetTime spin loops
with calls to kWait for the intended delay. This prevents blocking
the main thread and allows ScummVM to be responsive and update the
screen. But kWait isn't a simple sleep, it's a throttling function,
and the duration that it sleeps (if any) is determined by the time
since it was last called. kWait was only in SCI16 interpreters so it
had to be restored to SCI32 and this required a further workaround
for Phant2 compatibility.

Now we have a dedicated custom kernel function, kScummVMSleep, which
does a simple sleep so that SCI32 script patch delays are consistent
and the Phant2 workaround isn't needed. This approach is similar to
kScummVMSaveLoad.
2021-10-19 08:40:33 -05:00
sluicebox d592a67125 SCI32: Add kDoAudio support for Mac AIFF patch files
Fixes LSL6 hires Mac aerobics room and end credits
2020-09-01 10:31:32 -07:00
sluicebox 015247259e SCI32: Update kernel tables for late Mac games
Updates kernel table entries to handle Mac 2.1 late games LSL7, RAMA,
and LIGHTHOUSE. Fixes RAMA startup and many errors.
2020-07-22 17:03:52 -07:00
sluicebox 97cb7ce521 SCI32: Fix kBitmap kernel signature
kBitmap's kernel signature is incorrect and out of sync with the
signatures of its sub operations, causing valid calls to subop #1
(BitmapDestroy) to fail. BitmapDestroy allows an invalid reference
to be passed, which GK1 Mac does when decoding the Rada drums in
room 410, but kBitmap's signature doesn't.

Fixed by applying the correct signature, which is the same as kFileIO
which has a similar structure: require an integer for the subop and
then allow anything, including invalid references.
2020-05-31 22:36:36 -07:00
sluicebox 7343e0bdd8 SCI: Update kernel table data types comment 2020-05-31 22:36:18 -07:00
sluicebox 4b504a5786 SCI32: Fix kArrayFill kernel signature
kArray fill always expects 4 parameters. Fixes PHANT1 Mac initialization
2020-02-07 13:15:43 -08:00
sluicebox ab8cf3d77c SCI32: Update kCheckDisc kernel signature for Mac 2020-02-07 13:15:43 -08:00
sluicebox 2df444cecb SCI32: Implement kInputText for PHANT2 easter eggs
Implements kInputText, which displays a black and white utility dialog
with a title and a text box in a fixed position using the system font.
The only known game that uses this is Phantasmagoria 2 for several
easter eggs, which now work. This was probably used by internal scripts
during game development.

kEditText and kInputText share a function in Sierra's interpreter for
processing events, so that code has been factored out and placed in
GfxControls32::processEditEvent().

GfxText32 can now measure text pixel height as SSCI did by identifying
the tallest character height in the current text, which the newly added
titled font bitmap code requires.

Fixes bug #10570
2020-01-25 18:11:57 -08:00
sluicebox 649c801839 SCI: Implement kFileIOCopy
Allows patching a Phantasmagoria 1 script to copy instead of rename.
Although most games can call this through their File:copy script, none
have been discovered yet that do.
2019-12-21 18:26:07 -07:00
sluicebox 55dba55056 SCI32: Fix kRobot subop 6 implementation
Fixes Phantasmagoria 1 animations not resuming after closing the
control panel during the chapter 7 chase
2019-12-06 21:02:53 -08:00
sluicebox 05b21ace68 SCI32: Implement VMD Censorship Blobs
Phantasmagoria 1's censorship mode is now supported

Trac #11229
2019-12-04 09:11:21 -08:00
sluicebox 01772497b7 SCI32: Create stubs for kPlayVMD blob subops
Prevents Phantasmagoria 1 from crashing while in censored mode.
The "blob" subops pixelate rectangles during playback and are
currently being implemented.
2019-12-01 15:09:48 -08:00
sluicebox cdf9954eb5 SCI32: Add HOYLE5 kFileIOReadString workaround 2019-10-31 04:30:09 -07:00
sluicebox 8dcdc63af1 SCI: Add LSL6 Mac Floppy kGetCWD workaround
The game now starts
2019-10-21 11:13:24 -07:00
sluicebox 2ab281ffa1 SCI32: Add HOYLE5 support for original Save/Load screens
Trac #11174
2019-10-02 11:30:45 -07:00
Kawa 9aadb27267 SCI: Add some more SCI11+ features
Also gate them behind the presence of a 184.VOC resource instead of GID_CATDATE. This should not matter with regards to the remap effects -- the 2015 and 2016 demos had none, and the first that did has an unknown release status. Only the 2017 demo would fall, which would be easily fixed by dropping in a valid 184.VOC patch file.
2019-06-23 01:46:53 +03:00
Lars Skovlund b94ef3dab0 SCI: Rename kRestartGame to kRestartGame16 2019-01-05 22:25:31 +02:00
Lars Skovlund 939f9d1285 SCI32: Stub out kRestartGame
Restarting was only supported in QfG4, GK1 and PQ4. Those three used
makeshift script code. The kernel call was stubbed out in SSCI as
well. Fixes bug #10681.
2019-01-05 22:25:31 +02:00
Kawa ca2209cb5f SCI: Add support for The Dating Pool (#1403) 2018-12-02 22:56:19 +02:00
Filippos Karapetis 205ee4d0d0 SCI32: Allow malformed calls to kLock in PQ:SWAT, after the training videos
Fixes bug #10699
2018-09-06 22:04:13 +03:00
Filippos Karapetis 89785ea804 SCI32: Add stub for kWinDLL - used in Hoyle 5 2018-08-21 03:36:06 +03:00
Colin Snover b2966f3fc8 SCI32: Fix support for RAMA demo
Fixes Trac#10251.
2017-09-30 01:08:12 -05:00
Colin Snover 3b8b4f1722 SCI32: Clean up unused kBitmap code/subops 2017-09-29 19:56:24 -05:00
Colin Snover ba380ac28e SCI32: Dummy kPlayVMDSetFrameRate
This subop is used only by RAMA.

The VMD objects in RAMA's game code contain a frame rate field,
which is usually -1, but occasionally is not. In the cases where
it is not -1, it appears to be either set for a video with sound
(so the value doesn't do anything to that video), or it is just
resetting back to the baked-in frame rate of the video file (so
it doesn't need to exist, except to fix videos broken by earlier
played videos with explicit frame rates).

Since this is a global state flag that does not get reset in SSCI,
the ultimate effect of kPlayVMDSetFrameRate in RAMA is that it does
nothing to any of the videos where the explicit frame rate is set,
but it does inadvertently cause *other* videos with no sound and no
explicit frame rate to have a different frame rate depending upon
what was played earlier in the game (and whether or not the engine
was restarted in the meantime).

This bad transferring of frame rates is most noticeable with the
exit-video of the vidmail player, which is played when you back out
after selecting a vidmail. Its nominal framerate is 10fps, but it
will play at whatever frame rate was last set by some other video
that happened to have an explicit frame rate, even if that frame
rate was bogus.

So, just ignore all calls to this subop, as it is fatally buggy.
2017-09-24 23:49:37 -05:00
Colin Snover 3e107c1eb0 SCI32: Allow invalid references to be passed to kFileIO
Near the end of the game, RAMA will start trying to store some
invalid references. This does not affect the save game negatively
in any way, but it was causing the kernel to assert a signature
failure.
2017-09-24 22:56:58 -05:00
Colin Snover 21337e4cf6 SCI32: Implement per-channel audio panning
Used by RAMA, in various places, starting with the refrigerator
at base camp after the cable car at the beginning of the game.
2017-09-24 22:56:57 -05:00
Colin Snover b038432952 SCI32: Support RAMA's custom save games through kFileIO 2017-09-23 20:56:48 -05:00
Colin Snover 04d4c11100 SCI32: Order nulls consistently in kernel signatures 2017-09-08 21:16:47 -05:00
Colin Snover 94b39c83b6 SCI32: Remove redundant kStringGetData implementation
This code is identical to the kArrayGetData implementation.
2017-09-08 21:10:51 -05:00
Colin Snover 7eedfdbeaf SCI32: Fix kString signatures to allow null references where appropriate
The original interpreter allowed most string references to be
null references, in which case it would substitute an empty
string.
2017-09-08 21:10:51 -05:00
Colin Snover 5228aa29fa SCI32: Fix crash when changing security level of dead people in Phant2
In the original interpreter, is it valid to pass a null reference
to both kArray(GetData) (it just acts as an identity function when
the passed argument is not an object) and to kString functions (it
always dereferences to an empty string).

Fixes Trac#10039.
2017-09-08 21:10:51 -05:00
Colin Snover 43a07abb46 SCI32: Implement kCelLink
kCelLink exists in SSCI since 2.1mid, but it is only known to be
used in Lighthouse, during the weapon creation puzzle near the end
of the game.
2017-09-03 20:58:07 -05:00
Colin Snover 49e8f05714 SCI32: Implement Phant2 save/load integration 2017-07-30 19:10:50 -05:00
Colin Snover 655c5973fd SCI32: Add kMinimize to stop unmapped function warning 2017-07-26 22:43:19 -05:00
Colin Snover 8adb91038f SCI32: Dummy SCI3 bitmap calls to discover possible usage
Non-use of these kernel calls was assumed by reviewing script
disassembly by SV, but it turns out that SV was not picking up
script patches correctly in SCI3 games, so this data is no longer
considered reliable.
2017-07-26 22:02:37 -05:00
Colin Snover 5d04679124 SCI32: Add workaround for invalid kPalVarySetStart call in PQ4
Fixes Trac#9845.
2017-06-19 19:56:48 -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 262ef4de61 SCI32: Fix crash at end of Torin
This "fix" is more of a hack, in the interest of making the game
completable. The root cause is a combination of two problems in
the game scripts:

1. Blink::init expects to receive either 0 or 2 arguments, but
   it assumes that if it received *any* arguments, it must have
   received 2 arguments. This assumption is wrong, though,
   because--
2. soTorinWhoAreYou::changeState(0) calls
   poPecandEyes::setCycle(Blink) without including a second
   argument (the blink speed).

This ends up with the second parameter being some garbage, and
that garbage gets sent to kRandom which then complains about
receiving garbage.

The correct fix for this would be to fix soTorinWhoAreYou (in
script 51400) to pass a second argument to setCycle, but there are
not enough obvious spare bytes for a quick and easy patch, so this
workaround will have to do for now.

Fixes Trac#9779.
2017-05-13 22:46:13 -05:00
Colin Snover ae628c18d4 SCI32: Add workaround for KQ7
Fixes Trac#9763.
2017-05-08 19:45:07 -05:00
Colin Snover b5ecbff39b SCI32: Fix crash in Phant2 when clicking Help in the control panel 2017-04-23 13:07:25 -05:00
Colin Snover 168774c3c6 SCI32: Add kPlayVMD subop 27 (SetPlane)
Used by RAMA, when playing a video at the Hub Camp computer at the
beginning of the game (room 1004).
2017-04-23 13:07:25 -05:00
Colin Snover 205f8c4a59 SCI32: Fix call to kFileIOIsValidDirectory in RAMA 2017-04-23 13:07:25 -05:00
Colin Snover 086fab741a SCI: Remove #undef for a macro that does not exist 2017-04-22 19:28:35 -05:00
Colin Snover ede7976ede SCI32: Fix bad kPointSize implementation
Fixes text scaling gone mad in Phant2.
2017-04-22 19:25:20 -05:00
Colin Snover c6cf7215f0 SCI32: Fix kStringFormat signatures 2017-04-22 19:25:20 -05:00
Colin Snover 6f75bed90c SCI32: Remove original save/load option from games without ScummVM save integration 2017-04-22 13:01:35 -05:00
Colin Snover 4c0f2a3738 SCI: Move ScummVM kernel calls to 0xe0 2017-04-22 13:01:35 -05:00