From dd230858455171dbd618118e7516fccc11a97202 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Fri, 20 Jan 2017 15:43:30 -0600 Subject: 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. --- engines/sci/engine/vm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines') 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); } -- cgit v1.2.3