diff options
Diffstat (limited to 'engines/simon/items.cpp')
-rw-r--r-- | engines/simon/items.cpp | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/engines/simon/items.cpp b/engines/simon/items.cpp index 1ff4907a6c..f00aef3ee9 100644 --- a/engines/simon/items.cpp +++ b/engines/simon/items.cpp @@ -2203,75 +2203,6 @@ int SimonEngine::runScript() { return getScriptReturn(); } -int SimonEngine::startSubroutine(Subroutine *sub) { - int result = -1; - SubroutineLine *sl; - const byte *old_code_ptr; - - if (_startMainScript) - dumpSubroutine(sub); - - old_code_ptr = _codePtr; - - if (++_recursionDepth > 40) - error("Recursion error"); - - sl = (SubroutineLine *)((byte *)sub + sub->first); - - while ((byte *)sl != (byte *)sub) { - if (checkIfToRunSubroutineLine(sl, sub)) { - result = 0; - _codePtr = (byte *)sl; - if (sub->id) - _codePtr += 2; - else - _codePtr += 8; - - if (_continousMainScript) - fprintf(_dumpFile, "; %d\n", sub->id); - result = runScript(); - if (result != 0) { - /* result -10 means restart subroutine */ - if (result == -10) { - delay(0); /* maybe leave control to the VGA */ - sl = (SubroutineLine *)((byte *)sub + sub->first); - continue; - } - break; - } - } - sl = (SubroutineLine *)((byte *)sub + sl->next); - } - - _codePtr = old_code_ptr; - - _recursionDepth--; - return result; -} - -int SimonEngine::startSubroutineEx(Subroutine *sub) { - return startSubroutine(sub); -} - -bool SimonEngine::checkIfToRunSubroutineLine(SubroutineLine *sl, Subroutine *sub) { - if (sub->id) - return true; - - if (sl->verb != -1 && sl->verb != _scriptVerb && - (sl->verb != -2 || _scriptVerb != -1)) - return false; - - if (sl->noun1 != -1 && sl->noun1 != _scriptNoun1 && - (sl->noun1 != -2 || _scriptNoun1 != -1)) - return false; - - if (sl->noun2 != -1 && sl->noun2 != _scriptNoun2 && - (sl->noun2 != -2 || _scriptNoun2 != -1)) - return false; - - return true; -} - void SimonEngine::scriptMouseOn() { if (getGameType() == GType_FF && _mouseCursor != 5) { resetVerbs(); |