Commit Graph
9048 Commits
Author SHA1 Message Date
Omer Mor 145d6bc1e0 SCI: Improve King's Quest 4 detection entries 2022-08-03 09:38:39 +03:00
sluicebox e672a7b5f6 SCI: Show all palette cycles on PQ1, PQ3 tile screen
Fixes the police lights on the title screens of each game.
Only one of every eight frames in the palette cycle was appearing.

Thanks to @eriktorbjorn for reporting this
2022-08-02 17:23:34 -04:00
sluicebox e09010f7d8 SCI: Restrict kGetEvent throttling to fast cast mode
In 2010 a 10 ms delay was added to every kGetEvent call to prevent
maxing out the CPU when some games display message boxes:
b0b4ddcc52

This rapid kGetEvent polling is called fast cast and it only exists in
SCI1.1 games and some SCI1 games. It occurs in an inner loop when the
fast cast global is set.

Now the workaround is only applied to fast cast games and only when the
kGetEvent polling occurs.

Removing this 10 ms delay from every SCI16 game cycle doesn't change
game speed by itself because the larger dynamic throttling in
kGameIsRestarting has been absorbing the 10 ms. But this does make the
other throttles easier to understand and work with, and solves minor
edge cases where delays from multiple kGetEvent calls add up.
2022-08-02 17:23:34 -04:00
sluicebox 9d40b46f7e SCI: SciEngine was accessing itself through globals 2022-08-02 17:23:34 -04:00
sluicebox adb211613f SCI: Fix SQ5 WD40 missing messages 2022-07-30 16:39:26 -04:00
sluicebox b267706b8d SCI: Fix SQ5 WD40 tunnel entrance lockup
Fixes bug #9988
2022-07-30 16:39:26 -04:00
sluicebox c346905a1a SCI: Reset palette cycling when loading games
Fixes frozen palette animation when loading from within the engine
2022-07-30 16:39:26 -04:00
sluicebox 6e5b1e31f0 SCI: Include all music fade flags in save files
fadeSetVolume and fadeCompleted are used by the fade timer to signal
SoundCommand::processUpdateCues() that there is work to be done.
By not syncing them, if a save occurs after a fade completes but before
it's processed then the game won't see the completed fade when loading.
This can happen when the game is paused because the user has brought up
the game's menu bar or control panel in order to save a game. The fade
completes while the UI is displayed, then a save occurs, and then the
fade is processed after the UI is dismissed.

Now completed fades are processed when loading.

Fixes bug #7073 in KQ6 where saving in the Land of the Dead while
Alexander dismounts Night Mare results in a softlocked save.

Fixes bug #13546 in LSL6HIRES where saving while music fades from
a previous room results in a save that doesn't play the new music.
2022-07-30 16:39:25 -04:00
sluicebox 6a3fb9b5f8 SCI: Fix LONGBOW hedge maze music
Fixes bug #13674
2022-07-30 16:39:25 -04:00
sluicebox befeca6c9b SCI: Fix kDoSound redundant fade detection
Fixes two discrepancies in redundant fade detection that were discovered
while investigating LONGBOW bug #13674:

- MusicEntry::fadeTo was altered even when the fade was ignored
- Redundant fades are allowed in SSCI when the stopOnFade flag is passed
2022-07-30 16:39:25 -04:00
sluicebox d2d46b67c5 SCI: Fix KQ5 bandit music fade workaround
The existing workaround prevented a crash but it performed volume tests
on an object's offset and abruptly ended the bandit music instead of
fading it out as in the original.

The broken kDoSoundFade call is redundant because a second script calls
kDoSoundFade correctly at the same time. Now the broken call is ignored
and the music fades out normally.

Bug #5078
2022-07-30 16:39:24 -04:00
sluicebox 55c719aea9 SCI: Handle alternate bit orders in game flag debug commands
Five games store flags in a different bit order than the rest
2022-07-30 16:39:24 -04:00
Donovan Watteau 27f9a460b5 JANITORIAL: Fix "the the" and similar typos 2022-07-29 19:36:40 +03:00
Cameron Cawley f3b094e53f ENGINES: Change the MetaEngineDetection interface to match MetaEngine 2022-07-23 23:31:58 +02:00
athrxx f96819149f SCI: (SCI1+) - improve channel sound flag handling
This cleans up some things I noticed when I implemented the mute flag handling. It removes the hack that manually forces flag 2 on all channels with number 9, regardless of the device.
I presume the hack was done for the earliest SCI 1 games, due to improper handling of flag 1.
2022-06-19 20:46:37 +03:00
Filippos Karapetis 7146df7e9e SCI: Disable ScummVM autosaves 2022-06-14 01:44:24 +03:00
sluicebox 50fec97f8a SCI32: Fix LSL6HIRES phone crash
Fixes bug #13554
2022-06-08 09:03:39 -04:00
sluicebox 9558095053 SCI: Remove trailing array commas 2022-06-06 17:55:50 -04:00
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 a5833242a1 SCI: Fix compiler warning 2022-06-06 17:30:47 -04:00
sluicebox fa59cf87f3 SCI: Fix reading version string on earlier games
Fixes the version string not being included in GMM saves or autosaves
if the game stored its string in global 28 instead of 27.
2022-06-06 17:30:47 -04:00
sluicebox c84e747e3b SCI32: Initialize ScrollWindow line indices
ScrollWindow's constructor was missing a call to initialize
line indices. Using a scrollbar before any text had been added
accessed an uninitialized array and failed an assertion.

Fixes bug #13542 in LSL6-Hires
2022-06-06 17:30:47 -04:00
sluicebox a100e03663 SCI: Fix SQ4 Skate-O-Rama chase timing
- Skate-O-Rama (CD version) can now be completed at all game speeds.
- Removed the extra speed throttling on Skate-O-Rama. Floppy doesn't
  have the timing bugs and now both versions run at normal speeds.
- Fixed the coordinate bug that made the west exit impossible at
  certain game speeds.

Bugs #5514 and #11038
2022-06-06 17:30:47 -04:00
sluicebox ea48986006 SCI: Disable speed tests with script patches
Disables SCI16 speed tests with generic script patches.

- All games now pass their speed tests, and consistently.
- Handles games/versions that the benchmarking heuristic misses.
- Fixes bug #13529 (speed test overflow on fast CPUs) on all games.
- Replaces most game-specific patches.

I've left the benchmarking heuristic so that any game or version that
still needs patching will still be handled with unthrottling.
2022-06-06 17:20:58 -04:00
sluicebox fed2504257 SCI: Fix QFG1VGA PC pic window initialization
I forgot the platform test in a3c3865877

Also, a second attempt at explaining something confusing
2022-06-06 17:20:58 -04:00
athrxx 974c51b4cd SCI: improve sound (mute handling) related comments 2022-06-05 09:10:59 +03:00
athrxx 8eba7fb4fb SCI: fix bug no. 13496 (LSL6 music plays all instruments / tracks at …
…once)

I am not sure if this bug ticket is about just one or about several bugs. This is at least something I could reproduce. The reason is that there can be channels that should start up muted. We didn't support that. I also fixed a couple of other things about the mute state that I noticed.
2022-06-05 09:10:59 +03:00
athrxx 2803adc0b8 SCI: update mutex comment
(after turning _mutex into a reference to the mixers's mutex)
2022-06-03 23:42:02 +03:00
athrxx 2ef6e24e56 SCI: avoid deadlocks by using only one mutex
Make use of the mixer's mutex instead of creating a new one. Otherwise there can still be lock-ups when the main thread and the mixer thread lock each other up in different mutexes (causing a deadlock/freeze). I just noticed this with KQ5 FM-Towns.

We had the same issue in AGOS, it was fixed by allowing to access the mixer's mutex. We can use the same thing here...
2022-06-03 23:42:02 +03:00
sluicebox 3c3ed549f1 SCI: Disable JONES speed test
Fixes bug #13529
2022-06-03 12:00:58 -04:00
athrxx cab7e386f2 SCI: fix regression from c2975276 (fix music handling during auto-save)
This is really a necessary fix, so recommended for merging before the release.

The negative global pause counter (that I really added only for the GMM/autosave situation) may not be used from within kDoSoundPause. It causes issues, the counter will go out of the expected range (also, the "Music also seems to randomly disappear when saving / restoring games" mentioned in ticket no. 13496 might be related to this).

I didn't see this, since we were focussed on SCI0. But it can be easily tested with e. g. LSL1 VGA. Just save right at the start and restore the game, it will call kDoSoundPause and trigger the issue...
2022-06-02 11:19:58 +03:00
sluicebox 19dd711b79 SCI: Fix detection entry for LB2 Spanish CD
Fixes palette glitches and missing message errors
2022-05-29 10:36:52 -04:00
sluicebox eee84be802 SCI: Add detection entry for KQ5 Spanish variant 2022-05-28 06:53:16 -04:00
sluicebox dffe39a91c SCI: Disable LSL2 speed test 2022-05-28 03:49:45 -04:00
sluicebox 5b3adb4407 SCI: Fix some script patch typos 2022-05-27 02:38:47 -04:00
sluicebox 1c2e1bc54f SCI32: Fix LSL6HIRES delay when guard presses button
Fixes bug #13501
2022-05-27 02:07:37 -04:00
sluicebox fd146d77d0 SCI32: Initialize Sound:handle for non-preload samples
Fixes bug #13500 where LSL6HIRES doesn't play the audio for the death
message after the security guard launches a missile.

Thanks to @RayKoopa for reporting this and other discrepancies
2022-05-27 02:07:37 -04:00
Donovan Watteau 5ebd9b8d23 BUILD: Remove/simplify GCC_ATLEAST() calls when they targeted pre-C++11 compilers
C++11 is now required, so there's no point in checking for pre-C++11
versions of GCC anymore.  Note that Clang defines __GNUC__ too, but
always reports itself as GCC-4.2.1-compatible (and, in practice, the
earliest C++11-compatible versions of Clang will also be have most
GCC 4.8 features).
2022-05-25 19:07:30 +03:00
sluicebox 6e743a97ef SCI: Fix QFG3 event bugs at the Laibon's hut
Fixes some well known deadend bugs in the original game:
- Not being able to give the Laibon the horn
- Not being able to enter the Laibon's hut

Bug #11425
2022-05-24 17:05:27 -04:00
sluicebox f45a5eff90 SCI: Fix QFG3 ring rope uninit read with script patch
Restores original behavior. The workaround caused the player to
always win and receive points even if they lost.
2022-05-24 16:57:45 -04:00
sluicebox b3a77a79a9 SCI: Add QFG3 workaround for casting open on wall 2022-05-24 16:57:45 -04:00
sluicebox c4a95fad5c SCI: Remove duplicate QFG3 uninit read workaround 2022-05-24 16:57:45 -04:00
sluicebox b74b93ad46 SCI32: Fix LSL6HIRES inventory background color
Fixes bug #13497
2022-05-22 17:11:26 -04:00
Filippos Karapetis 34007cb7c2 SCI: Clean up script patches for Hoyle Bridge and Children's Collection
For Hoyle Bridge, we jump directly to the Bridge screen, and it's not
possible to go back to the game selection screen, so we don't need
patches for that version.
For Children's Collection, we now use enablePatch(), which results in
cleaner code.
2022-05-22 19:37:51 +03:00
sluicebox 82a16d71a9 SCI: Add debugging commands for Game Flags 2022-05-22 11:20:41 +03:00
sluicebox a3c3865877 SCI: Initialize pic window correctly for QFG1VGA Mac
Fixes the opening background being drawn 10 pixels too low
2022-05-20 14:20:22 -04:00
athrxx 311b6fec1a SCI: fix sound pausing when loading via kRestoreGame
This is similar to what we recently fixed for the saving. It does concern only the loading from the SCI menu and from the SCI death dialog (that's how it got my attention).

I have written a long comment in SciMusic::resetGlobalPauseCounter()  which explains it.

I have decided to make this very obvious (you could say: more ugly), so it won't cause confusion in the future. Of course, it could be just hidden somewhere deep in SciMusic::saveLoadWithSerializer() and noone would ever notice. But the "ugly" way seemed the safer thing to do...
2022-05-20 09:55:07 +03:00
Donovan Watteau 5b1ec56f96 JANITORIAL: Fix some lost or outdated URLs in comments 2022-05-19 07:57:31 +03:00
athrxx 6c6960b593 SCI: fix bug no. 10183 (QFG1EGA: Baba Yaga's hut sound bug)
Actually its two bugs that both come to surface in that hut... one in SoundCommandParser::processInitSound() and one in SciMusic::soundStop().
2022-05-18 21:54:26 +03:00
sluicebox 34983d1017 SCI: Fix out of bounds read when measuring text
Found with valgrind. The OOB read did not affect behavior.
Introduced in 8a87d1030c
2022-05-18 14:26:06 -04:00