655 Commits
Author SHA1 Message Date
athrxx b76fb0a604 SCI: (PQ2/PC98) - fix Japanese line breaks and lang splits
Unlike the other PC-98 versions, PQ2 does not convert one-byte characters
into two-byte variants. In our case, the escaped linebreaks ("\n") would be
converted to the SJIS version of that, thus corrupting these line breaks.
Also, PQ2, does not use the "\r----------\r" separator.
2025-11-15 14:04:05 +02:00
Donovan Watteau 69dd0889cc JANITORIAL: Update some HTTP links in comments to HTTPS
The modern web is mostly HTTPS now, and some browsers may start giving
warnings when one uses a plain HTTP connection.

Only update the protocol when the HTTPS connection exists and fully
works.  Code from external projects/tools is kept as is.
2025-10-29 14:22:37 +01:00
Filippos Karapetis d74a9542fa SCI: Rename graphics/palette.* to graphics/palette16.*
This is to avoid file name inclusion clashes with graphics/palette.h
placed in common code, as uncovered by PR #6471

After discussing with @sluicebox, this is a simpler solution, where
only the offending palette.* files are renamed, without affecting
palette32.*, or introducing a sci prefix in files
2025-03-10 02:58:55 +02:00
Filippos Karapetis d9e5a9eaa1 Revert "SCI: Rename graphics/palette*.* to graphics/scipalette*.*"
This reverts commit d3230461ea.

A simpler follow-up commit will be done instead
2025-03-10 02:53:24 +02:00
Filippos Karapetis d3230461ea SCI: Rename graphics/palette*.* to graphics/scipalette*.*
This is to avoid file name inclusion clashes with graphics/palette.h
placed in common code, as uncovered by PR #6471
2025-03-09 16:31:35 +02:00
athrxx 047f3fbfea SCI: cleanup and reorganize gfx drivers
gfxdrivers.cpp has become quite large. So I've now made a
separate file for each driver. I also separated the mode
validation and driver init code from the enigine and put
it into an extra file.
2024-12-24 13:15:37 +02:00
athrxx fdd1d1644c SCI: (KQ6WinCD) - fix hires drawing glitches
(items 1- 3 from bug ticket no. 15594)

I have added redrawing functionality for the hires GFX from the
original interpreter. I guess the original only needed that code
to handle WM_PAINT messages (= full window redraw). It also
does actually call a redraw in kDisposeWindow, the same way I
implemented it here, to refresh the inventory. But that is really
only needed for the speech+text mode which isn't supported
in the original. Maybe they ditched the mode only after they
had already implemented that, who knows...

I have also improved the workaround for the out-of-bounds
portraits to catch the case from the bug ticket.

I added a check in kDisposeWindow. It isn't strictly necessary,
but it it makes the code easier to understand.

I also renamed a var that I had previously renamed in a way
that makes no sense. I had renamed it from `upscaledHiresRect'
to 'portraitRect' since it is neither upscaled nor hires (it is just a
lowres rect). But it isn't a portrait rect either. The portraits get
drawn elsewhere. It's more likely to be a picture frame, a GUI
control or an inventory item.
2024-12-17 16:43:45 +02:00
athrxx c0492ece44 SCI: work around original script/interpreter bug
The original interpreter expects the same arguments for
kGraph 15 as for kGraph 7. The scripts never pass the last
arguments, though. So the engine would use undefined
values here (which apparently had no visual consequence).
2024-10-09 08:35:11 +03:00
athrxx 6be167aeaf SCI: cleanup 2024-10-09 08:35:11 +03:00
athrxx 70414a0b87 SCI: make upscaled gfx driver for KQ6 Windows
- The main purpose was to move more upscaling logic out of the engine
- This actually contains various precision fixes to the hires code. There
were some comments about being unsure what to. I think I managed to
fix all of these, although it shouldn't make a visible difference, since the
workarounds worked as intended.
- It does actually fix a very minor glitch: The portraits were vertically off
by one pixel. And the opening AVI video is probably also vertically fixed
by one pixel (although the video display in the original is not done very
well, anyway).
2024-10-09 08:35:11 +03:00
Hubert Maier 7fd0c0f68f JANITORIAL: SCI: Fix typos 2024-09-16 01:58:56 +03:00
athrxx 478cd8925a SCI: (SCI0) - add support for CGA and Hercules render modes
(as per usual, each target has to be run once to upgrade the launcher
options, so that the new render modes can actually be selected)
2024-06-30 13:05:01 +03:00
sluicebox c241f21baa SCI: Reduce scope of variables 2023-11-03 15:12:40 -07:00
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 b5b94a03da SCI: Convert LB2 German fix to message workaround 2022-11-08 16:37:18 -08:00
sluicebox 1efdb1cb6c SCI: Add support for Macintosh fonts
High-resolution native Macintosh fonts are now supported in the
following games when the game's executable is present:

- Castle of Dr. Brain
- Freddy Pharkas
- King's Quest 6
- Leisure Suit Larry 1
- Leisure Suit Larry 5
- Space Quest 1

And in these games when classicmacfonts.dat is present:

- Leisure Suit Larry 6 (floppy)
- Quest for Glory 1
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 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 a0ac53e29c SCI: Remove SCI32 checks from kTextSize
These old checks are from before the SCI32 code was separated
2022-04-16 13:29:59 -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
Filippos Karapetis a488bb47e8 SCI: Text to Speech (TTS) functionality for SCI16 (SCI0 - SCI1.1) games
This is based on the work done for GSoC by @taylorzhancher in PR #3256

Highlights:
- TTS has been hooked globally onto places where text is shown
- TTS is currently performed for textboxes and button texts
- TTS stops when text windows are disposed (which enhances the in-game
  experience)
- No game-specific logic has been added
- This hasn't been extensively tested with all SCI16 games yet
- There will be cases that are not handled properly yet
- The TTS functions have been grouped under a SciTTS class
2021-12-24 02:57:27 +02:00
sluicebox 3507830ced SCI: Fix kTextSize use-after-free
Introduced in b38d5b28ba
2021-12-18 15:00:29 -05:00
sluicebox b38d5b28ba SCI: kTextSize cleanup 2021-12-13 11:29:23 -07:00
Orgad Shaneh 940c7bfc14 SCI: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02: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 04cdd7af00 SCI: Fix kSetPort return value
SSCI doesn't return zero; it doesn't return anything. This shouldn't
affect any games since no scripts should depend on a non-existent
return value, but this discrepancy came up while investigating a
fan script that accidentally relies on this.
2021-10-13 19:18:43 -05: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
Filippos Karapetis bd7e708fc3 SCI: Move resource related functionality into a separate folder 2020-11-29 14:34:55 +02: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 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
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
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 999f813dc3 SCI32: Add QFG4 character import message box
Adds the ScummVM message box explaining saved character files
to the QFG4 import character screen.
2019-09-25 21:00:48 -07:00
sluicebox aea7da4410 SCI: Fix Macintosh kDrawPic mirror flag handling
Fixes the KQ6 Mac peppermint cave room
2019-08-14 08:29:12 -07:00
sluicebox 954f5142cb SCI: Implement full kWait behavior
Fixes PQ3 bug #11020
2019-07-21 18:20:07 +03:00
Colin Snover fde0a488b7 SCI32: Fix invalid calls to SCI16 graphics code 2019-05-12 19:05:49 +03:00
sluicebox a398d363b1 SCI: Apply SQ4 timing workaround to non-VGA versions
Fixes bug #6193 by applying the SQ4 floppy kPaletteAnimation timing
workaround from 99de89c974 to versions
with less than 256 colors. This includes DOS EGA, PC-98, and Amiga.

This also patches out the intro script's workaround that uses different
timing in EGA mode, as this is incompatible with ours and makes the
intro screen last over 3 minutes instead of 5 seconds.
2019-03-19 06:07:59 +02:00
Kawa ca2209cb5f SCI: Add support for The Dating Pool (#1403) 2018-12-02 22:56:19 +02:00
Adrian Frühwirth 1967efc5cf JANITORIAL: Silence GCC 7 fallthrough warning
This wasn't explicitly marked as intentional but it very much looks it.
Committing separately in the unlikely case this needs to be reverted.
2018-03-23 18:38:37 +01:00
Colin Snover 9a8070da3c SCI: Do some clean-up of event handling system
Convert macros and vars to enums, rename keyboard events in
preparation for adding key up events, clean up unnecessary nested
conditionals, add TODOs for potential future work.
2017-09-27 20:27:33 -05:00
Colin Snover 76806732e0 SCI: Remove Mac SCI32 code from SCI16 code 2017-09-24 22:56:58 -05:00
Colin Snover b3c27c2159 SCI: Clean-ups to file handling code
Preparations for adding support for RAMA's custom save game format.
2017-09-23 20:37:51 -05:00
Colin Snover 2f9967524f SCI: Stop EngineState::wait mutating r_acc
This wait function is used by kernel calls other than kWait, and
those other functions do not mutate r_acc in SSCI.
2017-09-19 19:54:29 -05:00
Colin Snover c9cbb8e31c SCI: Translate messages passed to dialogues 2017-05-08 11:26:46 -05:00
Colin Snover 1ed185bbbb SCI: Implement delayed restore for SCI32 and move implementations to GuestAdditions 2017-04-22 13:01:35 -05:00
Colin Snover c8486395fa SCI: Clean up unnecessary delayed restore flags
_delayedRestoreGame is always set and cleared at the same time as
_delayedRestoreGameId, and _delayedRestoreFromLauncher is written
but never read.
2017-04-22 13:01:35 -05:00
Colin Snover 10d97ce379 SCI: Fix more unsafe C-string usage 2017-02-05 12:38:21 -06:00