Commit Graph
7940 Commits
Author SHA1 Message Date
Colin Snover 3eb12dcfeb SCI32: Remove ADGF_CD from games that have no non-CD version
@sev- had asked why these flags were added a while ago (I had been
instructed this was the right thing to do when I asked in the past)
and ever since then it has been bugging me more and more that they
are there, since they serve zero purpose except to make the game ID
longer. In the past, it may have been the case that the SCI16 &
SCI32 code mixing meant that SCI32 games needed the CD flag for
things like managing subtitles, but at this point the only use of
the CD flag within the SCI32 engine is for the few games that
actually have different CD and non-CD versions. So these flags are
gone now.
2017-09-14 00:30:57 -05:00
Colin Snover 9ac219648e SCI: Omit SysEx delays when sending to MT-32 emulator
Real MIDI devices, and MT-32 in particular, need delays between
SysEx messages to ensure sufficient time to receive and process
the incoming data buffer. Sending too much data too quickly to
these devices can cause them to crash with a buffer overflow.

The MT-32 emulator, on the other hand, has no problem receiving
SysEx data instantly, so skipping the delays means that games that
send lots of data to the MT-32 will start up much faster.
2017-09-12 20:08:02 -05:00
Colin Snover 533bb5b257 SCI32: Improve chance of rendering non-8bpp AVIs
OpenGL backends don't always support the pixel format that is
returned by the Indeo 3 decoder when playing the GK2A.AVI from the
GK2 demo. If this happens, use the backend's preferred pixel format
and convert in software.

If a backend doesn't support any 16-bit or 32-bit format, the
playback code will error out. This is probably fine, since there
are not really any of those any more.

Fixes Trac#9994.
2017-09-12 11:03:15 -05:00
Colin Snover df85727186 SCI32: Fix wrong open folder/doc icons in Phant2 computer on first render
This fixes flickering icons during the word hallucinations.
2017-09-12 00:45:19 -05:00
Colin Snover a7ede0ca39 SCI32: Fix bad positioning of text in Phant2 computer on first render
This fixes the glitchy positioning during the word hallucinations.

Fixes Trac#10036.
2017-09-12 00:45:18 -05:00
Colin Snover f9c43144a7 SCI32: Fix janky document scrolling in Phant2 computer interface 2017-09-12 00:45:18 -05:00
Colin Snover eb284c45ed SCI32: Replace spin loop with kWait in Phant2 alien password screen 2017-09-12 00:45:18 -05:00
Colin Snover 200c8c442b SCI: Remove dead code 2017-09-10 22:17:17 -05:00
Colin Snover e0aa906804 SCI32: Fix bad audio looping
Fixes Trac#10182.
2017-09-10 02:08:22 -05:00
Colin Snover 393c0d1f62 SCI32: Fix whitespace errors 2017-09-09 23:29:57 -05:00
Colin Snover f200cc110f SCI32: Send correct color depth to Phant2
This is not known to fix any particular issue, but the game does
set some flags internally if it's running in 256-color Windows,
which is possibly undesirable since we do run 16-bit videos
regardless.
2017-09-09 23:29:57 -05:00
Colin Snover e137d01967 SCI32: Fix Phant2 movie-vs-game playback volumes
This update should give the game the default mix it receives in
Windows. If necessary, the half-volume audio bug in the DOS
interpreter can be added as an additional hack for this game, since
there are still some sub-par audio mixes that might need additional
correction (like Curtis talking to Blob when taking her out of the
cage in his apartment at the start of the game) which were also
bad in the Windows version of the game.

Fixes Trac#10165.
2017-09-09 23:29:57 -05:00
Colin Snover 14b3ed6414 SCI32: Fix volume config when changing volume from in-game Phant2 controls 2017-09-08 22:49:28 -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 a447664373 SCI32: Add missing include for ConfMan 2017-09-08 19:10:21 -05:00
Colin Snover f11b0a4ff5 SCI32: Toggle Phant2 content censoring from game options
To enable the optional content censoring mode, Phant2 looks
for a RESDUK.PAT file, which is normally placed by the game's
installer if the user chose to enable censorship. If the file
exists, the game reads an unlock password out of the file and
asks the user to enter the password when starting a new game to
create an uncensored game, or to click a "less intense" button
to start the game with censoring. The censorship state of the
game is then persisted in the save game file, and installations
with the RESDUK.PAT file need to enter the password again in
order to restore any of the uncensored saves.

Since we do not have an installer that can enable this feature,
add a game option toggle to enable/disable censoring (for the
releases that have the optional censorship mode) instead so the
censored content feature is available for anyone that wants to use
it. This flag is restored from ScummVM whenever a save game is
loaded, so it can be toggled on or off at any point without
needing a separate save game, unlike in the original interpreter.
2017-09-08 16:03:24 -05:00
Colin Snover 6571111efc SCI32: Detect KQ7 2.00b using platform-specific files
The GOG.com release is missing the AVIs used for the intro &
ending animations in Windows. I'm unaware of any substantive
differences between the DOS and Windows versions otherwise, so
just not allowing Windows to be selected as a platform when the
video files are missing seems like it should be fine. (Same thing
in the opposite direction for a case where the DOS Robot files
are missing, though I don't know of a specific case where that is
a thing with KQ7 2.00b.)
2017-09-08 16:02:32 -05:00
Colin Snover 3ce5276b9c SCI32: Remove unnecessary calls to hide the virtual hardware cursor 2017-09-08 16:02:32 -05:00
Colin Snover 17ff41b740 SCI: Use SCI32 naming convention for Audio36/Sync36 patch files in SCI32 2017-09-08 16:02:32 -05:00
Colin Snover 29b338fff7 SCI: Add resource integrity dump command to debugger 2017-09-08 16:02:32 -05:00
Colin Snover 4771c41c35 SCI: Add method to get resource patch file extensions 2017-09-08 16:02:32 -05:00
Colin Snover d97f192f45 SCI: Improve array bounds safety check
There is no practical risk now since the enum and array sizes are
the same, but there is no reason to rely on a separate data
structure to avoid potential out-of-bounds index use here instead
of just checking the array size directly, which is always safe.
2017-09-08 16:02:32 -05:00
Colin Snover 110b4f0991 COMMON: Add helper macro for printing rects 2017-09-04 23:57:19 +02:00
Colin Snover 9d42bea857 SCI32: Fix creating over 20 saves in Phant2 native save game 2017-09-04 15:20:00 -05:00
Colin Snover bdbcc90148 SCI32: Disable save game mangling in Phant2
Fixes Trac#10035.
2017-09-04 15:19:59 -05:00
Colin Snover 109d870990 SCI: Remove already-finished TODO 2017-09-04 15:19:59 -05:00
Colin Snover 67fcb0bdaf SCI: Allow deep inspection of objects in debugger 2017-09-04 15:19:59 -05:00
Colin Snover 96f702e9a8 SCI: Fix builds with SCI32 disabled 2017-09-03 21:39:22 -05:00
Colin Snover d6139890fe SCI32: Exit early from screen shake if engine is quitting 2017-09-03 20:58:10 -05:00
Colin Snover aa20284027 SCI32: Ignore bad audio map entries on GK2 DE CD 6
This patch also cleans up the GK2 audio map blacklisting code to
reduce the number of redundant checks being made during audio map
processing.

Fixes Trac#10172.
2017-09-03 20:58:09 -05:00
Colin Snover 6e35676a9e SCI32: Fix load from launcher for Lighthouse
Launcher loads of games without a saved Robot were fine, but games
that were saved with a Robot (e.g. room 480 when facing the water)
would crash.
2017-09-03 20:58:09 -05:00
Colin Snover be64c6ba8b SCI32: Fix closing a Robot when its Plane has been destroyed already
This can happen during game restores in at least Lighthouse, which
has a Robot on the menu screen whose plane is deleted prior to
a call to kRestoreGame32 (which closes the Robot).
2017-09-03 20:58:09 -05:00
Colin Snover cc3088c529 SCI32: Make audio resource size mismatch non-fatal
Lighthouse audio.225 in RESSCI.002 (US English 1.0C) triggers this
condition; the audio resource says its data is one byte larger
than the recorded size in the volume. In this case, just use the
smaller of the two values for the size, to avoid overreads.
2017-09-03 20:58:08 -05:00
Colin Snover 439a026844 SCI32: Fix Lighthouse GUIOs 2017-09-03 20:58:08 -05:00
Colin Snover 08a717530d SCI32: Correct LSL7 demo GUIOs 2017-09-03 20:58:08 -05:00
Colin Snover 768d698434 SCI32: Add standard SRDialog patches to Lighthouse 2017-09-03 20:58:08 -05:00
Colin Snover ebd5139653 SCI32: Fix crash after credits in Lighthouse 2017-09-03 20:58:07 -05:00
Colin Snover 7545bb7133 SCI32: Clip videos to the screen
This is needed for 8.VMD in Lighthouse (room 380, the credits
room), which is rendered partially off the bottom of the screen.
OSystem does not accept rects that are offscreen.

Technically this video probably should not have been doubled
vertically by game scripts, but there is not enough space to fix
the rendering with a regular script patch, and it is a very
unimportant video.
2017-09-03 20:58:07 -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 d7d75d97fd SCI32: Ignore invalid audio maps in Phant2 FR
Fixes Trac#10049.
2017-08-26 18:09:47 -05:00
Colin Snover b17c66981e SCI32: Ignore invalid audio map in GK2 DE
Fixes Trac#10143.
2017-08-26 18:09:47 -05:00
Colin Snover c0d3d5776e SCI32: Limit existing bad audio map resource skips by language
Since audio maps change when game speech is localised, it makes
sense to limit audio map skips by language until it turns out that
the same problem exists in more than one language release, so we
do not accidentally skip a map that is bad in one language, but OK
in another language.
2017-08-26 18:09:47 -05:00
Colin Snover ed0d0413b0 SCI32: Allow changing SFX/speech volume in GK2
Originally, changing the SFX volume from ScummVM was disabled
because the game itself only allowed adjustment of music volume,
so adjusting the SFX volume would indirectly affect the music
volume. On reflection, allowing the adjustment of SFX volume even
though this also changes the music volume seems preferable to not
allowing any adjustment of the SFX/speech volumes.
2017-08-26 18:09:47 -05:00
Colin Snover 74738489ec SCI32: Fix SFX volume being misapplied to music & speech in some games
This was happening in games with game scripts that control the
master volume themselves by applying the master volume to each
channel sent to the kernel, instead of relying on the kernel to
manage the master volume for them.
2017-08-26 18:09:46 -05:00
Colin Snover b5bd7b8478 SCI32: Stop blacklisting 37.MAP from Phantasmagoria
It turns out that GOG.com version of Phantasmagoria needs the
37.MAP patch file because for some reason the 37.MAP in RESSCI.000
is empty (36 bytes, versus the correct file which is ~1kB).
Fortunately, this file is the same across all CDs in the original
US release, so hopefully unblocking this patch will not cause any
problems for any of the CD releases either.

Fixes Trac#10161.
2017-08-25 18:53:32 -05:00
Torbjörn Andersson 7d52dbe7eb JANITORIAL: Remove unnecessary semicolon 2017-08-25 17:56:09 +02:00
Martin Kiewitz 4ab18d2d00 SCI32: Add script patch for last action sequence in PQ4
To also turn ::ticks into ::seconds
For further information see 5a4840e
2017-08-07 22:52:11 +02:00