Commit Graph
533 Commits
Author SHA1 Message Date
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 de32f308b4 SCI: remove GFX_SCREEN_MASK_DISPLAY
(and code sections guarded by it)

This was only used for the KQ6 Win hi-res code.
2024-10-09 08:35:11 +03:00
Hubert Maier 7fd0c0f68f JANITORIAL: SCI: Fix typos 2024-09-16 01:58:56 +03:00
sluicebox 29ebd43d2e SCI: Cleanup warning messages 2024-08-17 17:54:13 -07:00
Le Philousophe 45286ad131 SCI: Migrate engine to Path 2023-12-24 13:19:25 +01:00
sluicebox 0d60cfafcc SCI: Remove script_abort_flag Console command
script_abort_flag is an unsafe and redundant command.
We already have safe versions: quit and restart_game.
2023-11-15 16:46:38 -08:00
sluicebox d18b63bee4 SCI: Remove completed TODO
We have a console command to list classes: class_table
2023-11-15 14:32:27 -08:00
sluicebox d0f0287e15 SCI: Remove double assignments in debugger. PVS-Studio V1048 2023-11-07 16:07:10 -08:00
sluicebox cd319125ef SCI: More const ref parameters 2023-11-03 15:12:41 -07:00
sluicebox c241f21baa SCI: Reduce scope of variables 2023-11-03 15:12:40 -07:00
sluicebox 4a4b3801f1 SCI: Use correct array type in cmdAudioDump. PVS-Studio V1032 2023-10-31 14:20:27 -07:00
D G Turner 7da2765d44 SCI: Fix Signed vs. Unsigned Comparison GCC Compiler Warning 2023-09-29 22:45:31 +01:00
Ralph Caraveo d71a00950e SCI: adds support for debugging/executing kernel calls 2023-09-28 21:03:25 -07:00
Eugene Sandulenko 755086d5f4 SCI: Shut several "unused variable" warnings 2023-09-19 14:50:09 +02:00
sluicebox bca426ee5e SCI: Add locals console debugger command
Allows viewing and editing local variables in any loaded script.

This is different from `vm_vars` because vm_vars only operates
on variables in the current execution context.
2023-05-02 14:29:05 -07:00
Miro Kropacek d9d087ac3f SCI: Inline getSciVersion() 2023-04-29 12:20:58 +02:00
sluicebox 07818cae58 SCI: Add misc error handling
Fixes several Coverity issues
2023-03-20 13:43:25 -07:00
sluicebox 9ad98d324e SCI: Remove redundant check from cmdDiskDump
Coverity CID 1291563
2023-03-18 14:03:16 -07:00
sluicebox 30fad94e9a SCI: Track correct location and size of temp variables
The VM has been treating the entire area between the frame pointer and
the stack pointer as temp variables for the current function. There are
two problems with this:

1. The VM hasn't been updating the frame pointer correctly when multiple
   methods are called within the same send/self/super instruction.
2. The VM has been recalculating the number of temp variables on every
   instruction as the difference between the two pointers.
   This is incorrect, as this changes with almost every instruction in
   ways have nothing to do with the number of temp variables allocated
   by the link instruction. Meanwhile, the VM has not been recording
   the number of variables allocated by the link instruction.

The first discrepancy caused scripts to behave differently than in SSCI
when reading parameters out of bounds in certain situations.
It also prevented our uninitialized variable detection from detecting
certain reads. The second made the temp-count used for out of bounds
detection too large, made debugger output such as `stack` incorrect,
and made stepping through the link instruction in the debugger appear
to do nothing until stepping through the following instruction.

When multiple methods are called by a send/self/super instruction, each
method's link instruction increases the stack pointer further.
Method B's variables appear after method A's. The VM has been setting
the stack pointer correctly but it kept using the previous frame
pointer, so method B would re-use method A's stack area instead of the
area the VM had just allocated for B. If a script correctly initializes
variables before using them and doesn't use out of bounds parameters or
temp variables then this discrepancy doesn't make a difference.
But a lot of scripts do these bad things and accidentally rely on the
undefined values they read.

Now we update the frame pointer correctly when "carrying over" to
subsequent method calls from the same send/self/super instruction.
This matches SSCI behavior. We also now record the number of temp
variables that have been allocated by the link instruction and use
that instead of incorrectly recalculating on every instruction.

Fixes the KQ6 black widow lockup, and other KQ6 music bugs, where
scripts call Sound:fade without the required fourth parameter.
Sound:fade expects a fourth parameter, so reads it out of bounds,
and passes it as the stop-after-completion boolean to kDoSoundFade.
Scripts that called Sound:fade as the only method in a send got the same
results as in SSCI, but scripts that called Sound:play first didn't.

Fixes bugs #5625 #5653 #6120 #6210 #6252 #13944
2022-11-30 23:13:00 +02:00
Le Philousophe f54bdf989a SCI: Don't use unsafe sprintf and vsprintf 2022-10-23 22:46:19 +02:00
sluicebox 12576e29fb SCI: Add name filtering to functions debug command 2022-08-19 07:12:27 -04: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 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
sluicebox 82a16d71a9 SCI: Add debugging commands for Game Flags 2022-05-22 11:20:41 +03:00
sluicebox 3e1ecd2ea4 SCI: Remove "Dummy" from kernel functions debug command
There a lot of these entries due to our custom functions
2022-04-08 22:42:04 -04:00
D G Turner 006c4fe8f4 SCI: Fix Redundant Declaration
This causes GCC Compiler Warnings when -Wredundant-decls is enabled.
2022-03-06 13:56:15 +00:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh 940c7bfc14 SCI: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
Ralph Caraveo III 686c8dcaad SCI: Update help documentation for the new stack alias named: "st"
Nit: I forgot to also update the help context for this new alias.
2021-11-07 20:17:42 -06:00
Ralph Caraveo III 214e0a9979 SCI: add "st" as an alias to the debug "stack" command
While constantly evaluating the stack when debugging please consider:
  * adding a "st" alias to the "stack" command which also nicely represents the stack based addresses such as: `ST:0000`.
  * I introduced a previous alias for evaluating registers with the addition to "reg" so I'm hoping this is reasonable.
2021-11-06 17:55:51 +02:00
Alexandre Detiste 6044504762 JANITORIAL: typos
some in the variable names, some in the comments;
no change for the strings that interract with original games assets
2021-10-31 20:46:31 +01:00
sluicebox 98acee333a SCI: Fix class_table debugging command output 2021-10-22 12:53:48 -05:00
Ralph Caraveo III a272a6b578 SCI: Clarify passing of parameter: pass instead of parse for class_table debug command.
Minor wording change to say pass instead of parse.
2021-10-22 12:51:19 -05:00
Orgad Shaneh a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
Filippos Karapetis 2c4b4c6cd5 SCI: Add missing class member initializers 2021-02-08 03:11:46 +02:00
sluicebox 51137b8864 SCI: Improve "opcodes" debug command output
Fixes third column not appearing on default GUI console size
2021-02-07 16:31:46 -08:00
sluicebox dac6babb81 SCI: Remove non-existent debug command from Help 2021-02-07 16:31:46 -08:00
sluicebox b205bc0e8a SCI: Add missing newlines to console output 2020-12-20 12:09:06 -08:00
Ralph Caraveo III b0dc2ad01d SCI: add a shortcut alias for the registers debug console command
When debugging, I'm constantly inspecting the SCI VM registers and thought this would be a great command to have an alias for.
I am proposing the following alias: `reg` for the command `registers` and also updated the help docs.
2020-12-16 19:29:31 +02:00
Filippos Karapetis bd7e708fc3 SCI: Move resource related functionality into a separate folder 2020-11-29 14:34:55 +02:00
Henrik "Henke37" Andersson d26655dc4d SCI: Debugger, call base preEnter & postEnter 2020-05-10 23:39:31 +02:00
sluicebox 267317f650 SCI: Add script_said debug command to help text, regroup
Add another missing command to debug help text, remove a duplicate,
fix a typo, update the grouping to match internal organization.
2020-05-07 21:15:08 -07:00
Ralph Caraveo III c17e82c1aa SCI: added missing but implemented help commands for scripts
These commands have already been implemented by a previous committer.
This commit simply adds the commands to the console debug `help` command for the SCI engine.
2020-05-08 04:31:49 +01:00
sluicebox 23fc7f52e0 SCI: Fix SoundResource error handling, ctor, dtor
Fixes several problems with the SoundResource class:

- Constructor doesn't fully initialize object if resource doesn't exist
- Destructor crashes if object not fully initialized
- Constructor has no mechanism to report failure
- Callers believe failure is reported by constructor returning null
- SoundCommandParser::initSoundResource attempts to pre-detect failure
  insufficiently in the absence of a formal mechanism.

SoundResource now always fully initializes, the destructor no longer
accesses uninitialized memory, and an exists() method has been added
which callers now test.

SQ6 Mac can now progress past the main menu.
2020-04-12 01:47:15 -07:00
Zvika Haramaty f2345cc372 SCI: debugger: disasm_addr - fixed 'bcc' parameter 2020-03-04 02:53:14 +02:00
Paul Gilbert ba147f5ad5 SCI: Refactor to use Engine debugger 2020-02-16 13:07:19 +02:00
Zvika Haramaty ac87c01895 SCI: debugger: disasm - added 'bcc' parameter, to use in C code
'bcc' is based on 'bc', but prints in format that's can be used in
C code for patches - just copy and paste (without the address column).
2020-02-13 23:42:06 +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