Commit Graph
536 Commits
Author SHA1 Message Date
Colin Snover 3678390f3e SCI: Add clarifying comment to op_rest 2017-03-30 20:49:37 -05:00
Colin Snover dd23085845 SCI: Give kernel calls a valid stack pointer
Some kernel calls need to be able to call back into game script
code, which requires a valid stack pointer for use with
invokeSelector.

An example of this is the guest additions code that syncs audio
volumes from ScummVM: it needs to be able to call into the game
scripts responsible for managing the in-game audio volume UI.
2017-03-30 19:46:27 -05:00
Colin Snover f4d3664d3f SCI: Replace magic numbers in reg_t handling with symbols 2017-03-30 19:46:27 -05:00
Colin Snover 7567940ba1 SCI32: Clean up SCI3-only opcodes
SCI3 includes four new opcodes:

* op_info[0x26][0] puts -info- flag in accumulator
* op_infoSP[0x26][1] pushes -info- flag to stack
* op_superP[0x27][0] puts -super- reference in accumulator
* op_superPSP[0x27][1] pushes -super- reference to stack

The implementation of these opcodes was correct already, but the
opcode names given were a bit misleading (the value is not always
stored to accumulator), and magic numbers were used for these
opcodes in places.

A review of the opcode table in Phant2 indicates that there are
no other new opcodes for SCI3.
2017-01-09 19:34:54 -06:00
Colin Snover e0c7ee1a9c SCI: Remove unnecessary duplicate shadowing variable 2016-12-03 12:21:56 -06:00
Colin Snover 68023904a4 SCI32: Fix LSL6hires text speed slider
For whatever reason, this game uses a different global for
specifying the text speed.
2016-12-03 12:00:58 -06:00
Colin Snover 4814682d5f SCI: Improve disassembly output
1. pushi opcode now displays decimal value and selector value (if
   one exists) in-line
2. lofsa, lofss, and super opcodes now display resolved
   object/class names
3. Opcode arguments are visually aligned
2016-11-20 12:31:44 -06:00
Colin Snover 9380b54120 SCI: Add code-address breakpoints to debugger 2016-11-20 12:31:43 -06:00
Colin Snover 11ee0f90ac SCI: Warn more loudly about uninitialised parameter reads
Silently returning zero values can cause games to break. e.g.
Shivers 1 room 35170 has a script bug where vJoystick::handleEvent
makes a super call which causes doVerb to be called a second time
with no arguments. In the original game this happened to work
because the value already on the stack happened to be 1. In ScummVM
this silently (unless VM debug messages were enabled) failed
because the uninitialised read value was forced to 0.
2016-11-19 19:05:38 -06:00
Willem Jan Palenstijn 10151966a6 SCI32: Add missing updateInfoFlagViewVisible call
I missed the one for varselector sends handled by the secondary loop in
op_ret. This fixes #9641.
2016-11-19 19:16:12 +01:00
Colin Snover c3adfc065e SCI: Ensure export breakpoints always trigger on export calls
Previously, export calls to non-existing functions would act like
there was never an export call, and the breakpoint would never be
triggered.
2016-10-14 19:43:47 -05:00
Colin Snover 67acdb628b SCI32: Sync subtitle text speed with ScummVM GUI 2016-09-30 20:08:09 -05:00
Colin Snover 8fd19f84c8 SCI: Deduplicate call origin formatting 2016-09-29 19:39:16 -05:00
Colin Snover 6290f1e5fc SCI: Add prefix to global variable constants 2016-09-29 19:39:16 -05:00
Colin Snover b5d0fffb8b SCI: Replace magic numbers for globals with named constants 2016-09-29 19:39:16 -05:00
Colin Snover 3201440d11 SCI: Generalize code for getting information on the current call 2016-09-29 19:39:16 -05:00
Colin Snover ef2c44bf1f SCI32: Implement kShowMovie 2016-08-12 09:28:46 -05:00
Colin Snover 31f344079f SCI32: Temporarily revert kShowMovie due to buildbot failures
Revert "SCI32: Fix KQ7 1.51 video background"

This reverts commit c8affb54cc.

Revert "SCI32: Fix crash when kShowMovie is called but the video cannot be found"

This reverts commit 93b06f4a9e.

Revert "SCI32: Fix KQ7 1.51 basic video playback"

This reverts commit cdab24aa07.

Revert "SCI32: Additional Video32 documentation"

This reverts commit 4ff0924e57.

Revert "SCI32: Implement kShowMovie"

This reverts commit 13297c1929.
2016-08-11 21:43:57 -05:00
Colin Snover 13297c1929 SCI32: Implement kShowMovie 2016-08-11 20:50:33 -05:00
Willem Jan Palenstijn d643cb651f SCI: Remove unexpected side effect from ExecStack constructor
The ExecStack constructor set argp[0] to argc before. This is now moved
to the caller, to make this action more explicit.
2016-07-02 21:25:53 +02:00
Willem Jan Palenstijn 7f12638763 SCI: Remove unclear &rest handling
Modifying a value above the stack pointer doesn't seem to make much
sense. This was added in FreeSCI back in 2002 in a pair of commits that
did not make clear what the purpose of this was. My guess is that it
attempted to adjust argc, but failed. This wouldn't have been noticed
since argc was always set correctly by make_exec_stack_entry (which is
now the ExecStack constructor).
2016-07-02 21:25:53 +02:00
Willem Jan Palenstijn 08f1727b08 SCI: Improve kernel subfunction logging
ExecStack now stores the kernel call number as well as the subfunction.
This allows kStub and backtraces to log the actual subfunction called.

The kernel call number in ExecStack used to be stored in the
debugSelector field. It now has its own field, to avoid confusion.
2016-07-02 21:25:53 +02:00
Willem Jan Palenstijn 0012390f2a SCI32: Fix index/offset mixup in updateInfoFlagViewVisible 2016-03-01 20:18:29 +01:00
Willem Jan Palenstijn 77bb83cdfd SCI32: Update InfoFlagViewVisible from send_selector 2016-02-27 14:21:23 +01:00
Willem Jan Palenstijn d803847ca1 SCI32: Update InfoFlagViewVisible in VM opcodes 2016-02-27 14:21:14 +01:00
Filippos Karapetis 88e2673272 SCI: Clean up the op_infoToa and op_superToa SCI3 opcodes 2016-02-05 23:52:18 +02:00
Martin Kiewitz 7f9f305111 SCI: improve debug output for signature mismatch
dump parameter list to debugger as well
2015-03-20 16:06:19 +01:00
Johannes Schickel 8fc7d60feb SCI: Make GPL headers consistent in themselves. 2014-02-18 02:39:37 +01:00
Filippos Karapetis f9bbc2ca37 SCI: Update ScummVM's game audio options for SCI1.1 CD games
This ensures that ScummVM's game audio options for speech and subtitles
get updated when they are changed in the game GUI
2013-10-31 07:25:25 +02:00
Johannes Schickel 89abab97e3 JANITORIAL: Remove trailing whitespaces.
Powered by:
git ls-files "*.cpp" "*.h" "*.m" "*.mm" | xargs sed -i -e 's/[ \t]*$//'
2012-09-26 04:17:55 +02:00
Filippos Karapetis 34d00f5936 SCI: Add some debug code to op_line 2012-07-26 11:06:52 +03:00
Filippos Karapetis 20b6770808 SCI: Change the program counter (PC) to be a 32-bit variable
This is needed for future support of large SCI3 scripts. The program
counter is isolated and does not interfere with other parts of the VM,
plus it does not get stored in saved games, so it's pretty straightforward
to convert
2012-06-23 21:45:26 +03:00
Filippos Karapetis c1eb93bc5a SCI: Clean up validateExportFunc() and related functions
Also renamed some SCI3 related code to indicate when it's SCI3 specific
2012-06-23 21:45:24 +03:00
Filippos Karapetis 2b50824133 SCI: Add setter/getter methods to reg_t's
No functionality change has been made with this commit. This avoids
setting and getting the reg_t members directly, and is the basis of any
future work on large SCI3 scripts (larger than 64KB)
2012-06-18 05:24:06 +03:00
Filippos Karapetis a0add53c60 SCI: Change getClassAddress() to only require the caller segment
The caller offset is never actually used inside the function
2012-06-15 22:32:17 +03:00
Filippos Karapetis c69ac88be2 SCI: Ignore an invalid export in a script in the demo of RAMA 2012-01-15 21:10:18 +02:00
Willem Jan Palenstijn 0192d2f2de SCI: Fix restarting SCI engine with different SCI version 2011-11-29 18:34:34 +01:00
Filippos Karapetis 381e92a576 SCI: Added handling of invalid jump offsets (e.g. QFG2, script 260) 2011-11-28 22:36:58 +02:00
Filippos Karapetis 267c6f1756 SCI: Made more fields of the Script class private. Some cleanup. 2011-11-05 03:00:42 +02:00
Filippos Karapetis ffe7073037 SCI: Script 64036 in Torin's passage contains an invalid export 2011-10-16 13:01:13 +03:00
Filippos Karapetis 7f675de855 SCI: Fixed compilation with VM_DEBUG_SEND defined 2011-09-22 04:18:11 +03:00
Willem Jan Palenstijn bc4691a23e SCI: Fix incorrect usage of sizeof
Thanks to salty-horse for the reports.
2011-06-25 21:16:12 +02:00
Max Horn 88913c0139 ALL: Remove trailing whitespaces
This tries to make our code a bit more compliant with our code formatting
conventions. For future use, this is the command I used:
  git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//'
2011-06-20 00:59:48 +02:00
md5 eea48434f5 SCI: Changed order of script and room in error messages
This matches the order in which workarounds are stored in workarounds.cpp
2011-06-11 14:00:02 +03:00
Lars Skovlund ff62a6050a Revert "SCI: Don't attempt to modify null/disposed objects."
This fix for bug #3303802 is a potential cause of unreproducible bugs
in all SCI games that taint savegames.
This reverts commit 48140a012d.
2011-05-27 13:15:57 +02:00
md5 48140a012d SCI: Don't attempt to modify null/disposed objects.
These cases occur usually because of script bugs. Fixes script bug
#3303802 - "SCI: PQ1VGA - Crash at the jail"
2011-05-27 03:06:06 +03:00
md5 bd2bfe85c9 SCI: Don't include several debug tables when REDUCE_MEMORY_USAGE is defined 2011-05-13 16:12:52 +03:00
strangerke 69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Ori Avtalion 9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
D G Turner 344369c294 SCI: Fix Compilation with --enable-release set. 2011-03-28 22:45:01 +01:00