aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorColin Snover2017-01-20 15:43:30 -0600
committerColin Snover2017-03-30 19:46:27 -0500
commitdd230858455171dbd618118e7516fccc11a97202 (patch)
tree1dcbaddb61b137a6637a02bd944ecdac97d855e4 /engines
parent4d062fc7a0157f2044f3ab69c7487a841babadeb (diff)
downloadscummvm-rg350-dd230858455171dbd618118e7516fccc11a97202.tar.gz
scummvm-rg350-dd230858455171dbd618118e7516fccc11a97202.tar.bz2
scummvm-rg350-dd230858455171dbd618118e7516fccc11a97202.zip
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.
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/vm.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index a9d575b013..b2807e0c53 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -360,7 +360,7 @@ static void addKernelCallToExecStack(EngineState *s, int kernelCallNr, int kerne
// Add stack frame to indicate we're executing a callk.
// This is useful in debugger backtraces if this
// kernel function calls a script itself.
- ExecStack xstack(NULL_REG, NULL_REG, NULL, argc, argv - 1, kUninitializedSegment, make_reg32(0, 0),
+ ExecStack xstack(NULL_REG, NULL_REG, argv + argc, argc, argv - 1, kUninitializedSegment, make_reg32(0, 0),
-1, kernelCallNr, kernelSubCallNr, -1, -1, s->_executionStack.size() - 1, EXEC_STACK_TYPE_KERNEL);
s->_executionStack.push_back(xstack);
}