Commit graph

214 commits

Author SHA1 Message Date
sluicebox
6eea9e517b SCI: Detect SCI16 unthrottled inner loops
This restores kGetEvent throttling (10ms delay) during inner loops that
don't throttle themselves. For example, the event processing loop in
Dialog:doit doesn't include a kWait(1) call in some games.
In these games, dialogs max out CPU, and if they run animations then
they run too fast. This happens in the CD version of JONES, bug #14020.

I had considered doing something like this earlier, but it wasn't clear
how to best detect these loops. What I didn't realize is that the SCI32
code already does this by counting kGetEvent calls in between kFrameout.
Now that technique is adapted for SCI16. Combined with the existing
"fast cast" detection, this throttles event-polling inner loops while
keeping the kGetEvent and kGameIsRestarting throttling separate so that
they don't overlap and conflict.

See: e09010f7d8
2023-01-10 14:50:51 -08:00
sluicebox
ae5db52c2e SCI: Remove speed test detector
This heuristic was originally how all SCI16 speed tests were handled.
It has been gradually replaced with script patches, until all games
were patched in: ea48986006

At the time, I left this in because it had the benefit of speeding up
the SCI11 test variants so that they didn't produce a startup delay.
Now we know that this heuristic has been identifying regular rooms as
speed tests and unthrottling them too, causing unintended effects.
Some of this behavior was masked by fast-cast throttling occurring
everywhere, until: e09010f7d8

For example, the QFG1VGA Sierra logo animation changes speed and runs
very fast as soon as the sparkle is finished. The Longbow map rooms
were also detected as speed test rooms and animated too fast. Cast-less
rooms like LB2's title screen run unthrottled and consume CPU.

There are only a few SCI11 speed test rooms, so now they're explicitly
unthrottled in kGameIsRestarting with the other throttling exceptions.
2022-12-21 12:26:51 -08:00
sluicebox
e46767b8f8 SCI: Fix LONGBOW map animation speed
Speed throttling was disabled on LONGBOW maps because they were treated
as speed tests by the heuristic in GfxAnimate::throttleSpeed. This bug
was masked by fast-cast throttling being applied everywhere, but that
was changed in e09010f7d8

Now the map rooms trigger throttling so that they don't run too fast.
But the game scripts also attempt to throttle the animations based on
speed test results, causing them to run too slow, so that's patched out.

Fixes bug #13966
2022-12-14 05:00:42 -08:00
sluicebox
daed465639 SCI: Add option for high resolution Mac fonts
This adds the existing GAMEOPTION_HIGH_RESOLUTION_GRAPHICS option to
Mac games with native fonts. Default is enabled. If disabled, then the
low resolution Mac fonts are used and the game isn't upscaled.
2022-11-06 23:05:20 -08:00
Le Philousophe
0b918a5352 SCI: Rename strcpy function to prepare for forbidden name
Even though strcpy in SegManager isn't a problem, our forbidden symbols
list being defined at preprocessor level, we won't be able to use this
name anymore.
2022-10-23 22:46:19 +02:00
sluicebox
9be84837b3 SCI: Add speed_throttle debug command
Allows testing the speed throttler for possible improvements
and to demonstrate what it affects and what it doesn't.

`speed_throttle 0` disables kGameIsRestarting throttling.
(Except for game-specific workarounds.)

This command is possible due to several recent cleanups of other
throttling mechanisms that overlapped and were absorbed by this one.
2022-08-12 00:33:20 -04:00
sluicebox
fb35db5260 SCI: Document kGameIsRestarting speed throttler 2022-08-12 00:33:20 -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
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
Donovan Watteau
5b1ec56f96 JANITORIAL: Fix some lost or outdated URLs in comments 2022-05-19 07:57:31 +03: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
cc714bd292 SCI: Only throttle kGameIsRestarting from game loops
Prevents extra speed throttling from being applied when a script queries
the restart flag. Some rooms such as the KQ6 caves and the QFG4 caves do
this on every game cycle. In practice, this extra throttling didn't seem
to have much effect, but the intent is to only throttle game loops and
the script patches that fix inner loops.

Updated script patches to call kGameIsRestarting like game loops.
2021-10-30 13:19:09 -05:00
sluicebox
562ad967ff SCI: kGetTime: Remove clock time query in tick mode
This is a mild optimization so that kGetTime only queries the time and
date when it actually uses the results. kGetTime is frequently called to
return the game time in ticks, and if each of those also calls
OSystem::getTimeAndDate() then that generates a lot of unnecessary
EventRecorder records.
2021-07-09 12:30:59 -05:00
Orgad Shaneh
a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
sluicebox
813d5ca6c9 SCI: Improve kPaletteSetIntensity speed throttling
Detect when kPaletteSetIntensity is called from an unthrottled
script loop and only apply speed throttling in that situation.

This fixes several slow fade-in / fade-outs such as KQ6's Sierra
logo and title screen. We've been throttling kPaletteSetIntensity
on every call, even when it was being used once per game cycle
(which our kGameIsRestarting throttling already handles) or within
kWait-throttled loops. In both cases this has added delays on top
of delays and slowed things down even further.
2021-04-12 11:12:01 -07:00
sluicebox
9982c761a2 SCI: Update all old bug tracker ticket numbers 2021-02-25 01:18:52 -08:00
sluicebox
1200485211 SCI: Fix kGetTime debug messages
This change doesn't affect kGetTime results.

kGetTime has been logging its return value in debug messages as a 32-bit
value before converting down to the actual 16-bit value that's returned.
2021-02-03 23:37:23 -08:00
sluicebox
518226146d SCI: Fix kGetTime 12-hour formatting
SSCI sets hours 0 and 12 to 12, not 0.
Fixes clock display in Hoyle4 and Hoyle5.
2021-01-31 12:43:16 -08:00
sluicebox
4a72486279 SCI: Disable LSL3 speed test
Fixes bug #11967
2020-12-13 10:54:36 -10:00
Cameron Cawley
c877097b49 ALL: Remove use of "" in Common::U32String constructors 2020-11-16 16:56:58 +00:00
aryanrawlani28
12e4f871a3 GUI: U32: Improve u32 in all engine subsystems
- Common: add wordWrap function to ustr.cpp
- Bladerunner: Explicitly state we have a U32String in subs (same as Subtitles::loadOuttakeSubsText)
- Don't use translations for engine specific "put strings", because they might not support.
- SCI: Use const references for showScummVMDialog
- SCUMM:
-- Don't use translation in md5 warning. left comments with the translated version.
-- Remove some redundant headers in help.cpp
-- Don't use translation in handleSaveload when printing to console
-- Also, display success transaction correctly via u32::format
- TESTBED: Use fake constructor when setting label of button
- SKY: Correctly use translation when using SaveStateDescription
- ULTIMA: Don't use translations when display_string
- ENGINES:
-- GenerateUnknownGameReport correctly, with proper translations.
-- There was an error, where a function had been declared twice, in a header file. Correct this.
2020-08-30 14:43:41 +02:00
aryanrawlani28
4b6976c558 GUI: U32: Reduce number of files changed and fixes
Up until last commit, everything was working fine but the amount of files changed was too large. This commit tries to reduce the changes.

- Add a fake constructor to Keymap, text-to-speech, setDescription (save-state)
- Redirecting functions for PopUpWidget::appendEntry, ButtonWidget::setLabel, GUIErrorMessage
- Use the above functions and constructors to reduce changes in Engines
- Fix warnings being in unicode. Only output english text in - Warnings, Errors, etc.
- Mark some strings as "translation" strings. (Not yet added to POTFILES)
- Remove some CP related things from po/modules.mk
- Previously used some Common::convertToU32 where it was not necessary, replace this with u32constructor
2020-08-30 14:43:41 +02:00
aryanrawlani28
bed05ea134 GUI: U32: Fix compilation errors across entire project
After the initial changes just to scummvm/gui for u32, this commit includes the whole project

- Widget creations now always have u32 descriptions, labels, or tooltips
- Message dialogs make use of default arguments instead of providing the same argument explicitly
- encode String::format properly before passing on as argument where necessary
- Modify hugo utils (yesNoBox and notify box) to use u32
- Also provide fake constructors for the above which redirect to the u32 constructor
- Convert all keymap descriptions to u32 across all engines
- showConfirmationDialog in mohawk now uses u32
- showScummVMDialog also uses u32
- Scumm engine has dialogs now which use u32
- General fixes and wrapping convertToU32String for setLabels and related functions
- Add a fake constructor to MesssageDialog which redirects to the u32 constructor
2020-08-30 14:43:41 +02:00
sluicebox
e2123c9022 SCI: Add KQ6 workaround for talking inventory 2020-06-27 14:55:32 -07:00
sluicebox
0eca8009f2 SCI32: Implement kMacPlatform32 volume subop 2020-05-07 22:49:41 -07:00
sluicebox
1961f162d5 SCI32: Implement MOTHERGOOSE custom Mac saving 2020-05-05 14:49:11 -07:00
sluicebox
12d37a352b SCI32: Implement KQ7/SHIVERS custom Mac saving
Implements the custom Mac save and restore kPlatform subops
for KQ7 and Shivers. Still TODO: Mothergoose and Lighthouse.
2020-04-19 23:46:13 -07:00
Filippos Karapetis
ff044aa431 SCI: Move the GK2 subtitle patch dialog inside the SciEngine class
This is now grouped together with the other GUI messages. The script
patcher class itself does not need to handle such logic
2020-02-09 23:27:11 +02:00
sluicebox
7079f01044 SCI32: Stub out and document kPlatformMac32 subops 2020-01-30 17:14:06 -08:00
D G Turner
d11c61db14 SCI: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-12-01 05:06:31 +00:00
sluicebox
9f71bcab74 SCI32: Return correct KPlatform32 value on Mac
Fixes GK1 Mac intro and other slideshow movies
2019-10-24 14:36:17 -07:00
sluicebox
511e5441e3 SCI32: Enable Mac code (remove ENABLE_SCI32_MAC) 2019-10-11 14:18:26 -07:00
Filippos Karapetis
e086ac376e SCI32: Some initial work on the Hoyle 5 poker logic
The game can be entered now, but there's only some dummy logic in place
to get it working
2019-10-08 01:36:43 +03:00
D G Turner
0e258cafd4 SCI: Fix GCC Compilation Error from Missing Format String 2019-07-24 19:43:26 +01:00
Le Philousophe
96103179af SCI: Fix build when SCI32 isn't enabled 2019-07-08 10:15:09 +03:00
Filippos Karapetis
49a6346966 SCI32: Add stub for the Hoyle 5 Poker game logic 2019-07-07 22:26:03 +03: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
sluicebox
0008fab4f5 SCI: Fix Mac icon bar crash on restart (KQ6, FPFP)
Add support for reinitializing the mac icon bar when restarting.
Restarting runs the game's init script which calls KPlatform again.
Prior to this, restarting these games would fail an assertion.
2019-03-25 11:42:54 +02:00
Lars Skovlund
b94ef3dab0 SCI: Rename kRestartGame to kRestartGame16 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
ef841f615e SCI32: Always start in the Bridge room in Hoyle 5 Bridge
It's the only game included, so there's no point showing the game
selection menu in this case. This follows the behavior of the original
2018-10-23 01:32:26 +03:00
Filippos Karapetis
16aab5b281 SCI32: Add handling for config settings used in Hoyle 5 2018-08-21 03:36:06 +03:00
Filippos Karapetis
89785ea804 SCI32: Add stub for kWinDLL - used in Hoyle 5 2018-08-21 03:36:06 +03:00
Colin Snover
743082ac8c SCI32: Disable all SCI32 Mac code
This code is currently untestable and is almost certainly at least
partly based on guesswork & not actual reverse-engineering (as was
the case for all other pre-2015 SCI32 code), so future developers
interested in adding SCI32 Mac support should use it only as an
intermediate reference rather than as known good code.
2017-09-24 22:56:59 -05:00
Colin Snover
b0b1e89abe SCI32: Hide warning about CD-ROM speed setting in kGetSierraProfileInt
In the DOS interpreters, this function is a no-op. Lighthouse calls
it regardless of platform, so dummy it out for non-Windows
platforms. This is not known to address any particular issue, and
is really just to eliminate the warning about an unknown
configuration setting when starting Lighthouse in a manner that is
compatible with the original interpreter.
2017-09-19 19:54:29 -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
Torbjörn Andersson
70a2ca8b7d JANITORIAL: Silence more GCC 7 warnings
All these fall through were marked as deliberate, so again I've only
changed the comment to silence GCC.
2017-08-06 13:30:51 +02:00
Colin Snover
f88bcb3ee9 SCI32: Add deflang (default language) kGetConfig key for MGDX 2017-07-24 19:36:32 -05:00
Colin Snover
03ba3e41f9 SCI32: Return CD speed in kPlatform
This fixes missing playback of some videos in Rama, like the
background video that plays when selecting an email at the
computer at the start of the game.
2017-05-31 22:03:13 -05:00