Commit graph

239 commits

Author SHA1 Message Date
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
Colin Snover
ec12c5a342 SCI: Move ScummVM save/restore to GuestAdditions and reimplement for SCI32 2017-04-22 13:01:16 -05:00
Colin Snover
6b0cd955fa SCI32: Fix crash when using brightness slider in Shivers 2017-03-30 19:46:27 -05:00
Colin Snover
3b34f17fb3 SCI32: Add kWebConnect and kWinExec
Used by Phant2.
2017-03-30 19:46:27 -05:00
Colin Snover
766d46153a SCI32: Implement known-used portions of kPlayDuck 2017-03-30 19:46:27 -05:00
Martin Kiewitz
26b6d450df SCI: Clean up kRandom + allow 0 parameters via signatures
Also added in depth comments about the currently known variations
Returning the RNG seed is now implemented (although it seems no
games actually use this functionality, it seems to be just script
bugs).
Also remove Torin kRandom workarounds.
2017-02-26 00:24:57 +01:00
Colin Snover
f66c033d52 SCI32: Add workaround for Hoyle5 2017-01-16 12:16:13 -06:00
Colin Snover
d495267829 SCI32: Fix loading save games in KQ7 1.51 2017-01-16 12:16:12 -06:00
Colin Snover
0744dc4109 SCI32: Fix spinloop in Hoyle5
Hoyle5 will spin on kGetTime between 15 and 300 ticks in multiple
game scripts in order to delay execution (for example, after
choosing opponents and clicking "okay"). This causes ScummVM to
be unresponsive and wastes CPU time.

This commit patches the spin subroutines to instead call a kernel
function (kWait) that waits without a spin loop. This kernel
function was removed in SCI2, and has been added back in ScummVM
specifically for Hoyle5, so this patch will not work with the
original interpreter.
2017-01-16 12:16:12 -06:00
Colin Snover
54e94c572a SCI32: Add workarounds, transitions, fixes for PQ4CD 2017-01-12 13:14:03 -06:00
Colin Snover
8cce4f1b8c SCI32: Ignore attempts to free null array reg_ts 2017-01-09 19:34:54 -06:00
Colin Snover
bd9bc7ce87 SCI32: Clean up comment on kSetHotRectangles
Since this feature is now implemented, it is not necessary to
describe its intended functionality here.
2017-01-09 19:34:54 -06:00
Colin Snover
01e6d07360 SCI32: Split kCelInfo into subops
Different subops have different call signature requirements.
2017-01-09 19:34:54 -06:00
Colin Snover
97a47852c1 SCI32: Fix kSetShowStyle signature for SCI3 2017-01-09 19:34:54 -06:00
Colin Snover
02598b4473 SCI32: Add workarounds for Hoyle5 Crazy Eights 2016-12-11 20:09:48 -06:00
Colin Snover
5b5aaee57b SCI32: Implement List sort
Used by Hoyle5.

Also includes a tiny amount of cleanup in kAddAfter for
consistency with kAddBefore.
2016-12-11 20:09:48 -06:00
Colin Snover
6de396d787 SCI32: Add workaround for Hoyle5 startup call to kPlatform
Fixes Trac#9665.
2016-12-11 12:31:45 -06:00
Colin Snover
2eea7dc961 SCI32: Implement kPlayVMDIgnorePalettes
Used in Shivers room 35170 when pressing the play button.
2016-11-04 20:45:45 -05:00
Colin Snover
65d0c659ef SCI32: Fix crash clicking quit button during LSL6hires credits 2016-10-15 20:57:48 -05:00
Colin Snover
f35fafa525 SCI32: Fix kPalVary(SetVary) in SCI2.1early games
Game scripts pass an extra argument which is never used in SSCI.
This happens e.g. when warping from room 620 to room 860 in
LSL6hires.

Adding a signature for kPalVarySetVary for SCI2.1early games only
does not work because KQ7 1.51 is detected as SCI2.1early but the
interpreter includes kPalVary code that matches SCI2.1mid.

Fixes Trac#9611.
2016-10-15 18:00:37 -05:00
Colin Snover
40444b0aeb SCI32: Clarify some identifiers
transparentColor -> skipColor
displace -> origin
scaledWidth -> xResolution
scaledHeight -> yResolution
2016-10-09 11:21:46 -05:00
Colin Snover
fb129116cd SCI32: Stub kGraph
This kernel call exists only in SCI2 and is a null subroutine. It
is called at the beginning of GK1.
2016-10-01 15:26:34 -05:00
Colin Snover
d527e75f32 SCI32: Fix signature of kString(ArraySetElements) to allow 0 args 2016-10-01 14:07:26 -05:00
Colin Snover
bde7090708 SCI32: Fix kArray signature 2016-09-29 19:39:16 -05:00
Colin Snover
9d2397e1e9 SCI32: Implement kBitmapCreateFromView and kBitmapGetInfo
Used by Torin room 40300 to perform pathfinding by bitmap.
2016-09-29 19:39:16 -05:00