From d53e5fbfb7a3cafff6f21a6d656428f670256e9f Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 20 Jul 2010 23:15:07 +0000 Subject: SCI: Removed the restoring parameter of the run_vm() function svn-id: r51076 --- engines/sci/console.cpp | 2 +- engines/sci/engine/selector.cpp | 2 +- engines/sci/engine/vm.cpp | 5 +++-- engines/sci/engine/vm.h | 3 +-- engines/sci/sci.cpp | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'engines/sci') diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 005ac9eefd..8cbe946e4a 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -2662,7 +2662,7 @@ bool Console::cmdSend(int argc, const char **argv) { // We call run_engine explictly so we can restore the value of r_acc // after execution. - run_vm(_engine->_gamestate, 0); + run_vm(_engine->_gamestate); } diff --git a/engines/sci/engine/selector.cpp b/engines/sci/engine/selector.cpp index 431261eb7c..c807e88d5f 100644 --- a/engines/sci/engine/selector.cpp +++ b/engines/sci/engine/selector.cpp @@ -238,7 +238,7 @@ void invokeSelector(EngineState *s, reg_t object, int selectorId, xstack->sp += argc + 2; xstack->fp += argc + 2; - run_vm(s, false); // Start a new vm + run_vm(s); // Start a new vm } SelectorType lookupSelector(SegManager *segMan, reg_t obj_location, Selector selectorId, ObjVarRef *varp, reg_t *fptr) { diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 338f530827..78b85df0c8 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -1053,7 +1053,7 @@ int readPMachineInstruction(const byte *src, byte &extOpcode, int16 opparams[4]) return offset; } -void run_vm(EngineState *s, bool restoring) { +void run_vm(EngineState *s) { assert(s); int temp; @@ -1074,7 +1074,8 @@ void run_vm(EngineState *s, bool restoring) { if (!local_script) error("run_vm(): program counter gone astray (local_script pointer is null)"); - if (!restoring) + // TODO: Revise this + if (s->abortScriptProcessing != kAbortLoadGame) s->executionStackBase = s->_executionStack.size() - 1; s->variablesSegment[VAR_TEMP] = s->variablesSegment[VAR_PARAM] = s->_segMan->findSegmentByType(SEG_TYPE_STACK); diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h index 81ec4f1c61..ee22e03310 100644 --- a/engines/sci/engine/vm.h +++ b/engines/sci/engine/vm.h @@ -315,9 +315,8 @@ ExecStack *send_selector(EngineState *s, reg_t send_obj, reg_t work_obj, * It executes the code on s->heap[pc] until it hits a 'ret' operation * while (stack_base == stack_pos). Requires s to be set up correctly. * @param[in] s The state to use - * @param[in] restoring true if s has just been restored, false otherwise */ -void run_vm(EngineState *s, bool restoring); +void run_vm(EngineState *s); /** * Debugger functionality diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index a39f1113a9..16984639af 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -410,7 +410,7 @@ void SciEngine::runGame() { do { _gamestate->_executionStackPosChanged = false; - run_vm(_gamestate, (_gamestate->abortScriptProcessing == kAbortLoadGame)); + run_vm(_gamestate); exitGame(); if (_gamestate->abortScriptProcessing == kAbortRestartGame) { -- cgit v1.2.3