diff options
Diffstat (limited to 'engines/kyra/kyra.cpp')
-rw-r--r-- | engines/kyra/kyra.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp index 299f93c5b4..6ad8c4f4f8 100644 --- a/engines/kyra/kyra.cpp +++ b/engines/kyra/kyra.cpp @@ -479,7 +479,7 @@ void KyraEngine::startup() { _animator->initAnimStateList(); setCharactersInDefaultScene(); - if (!_scriptInterpreter->loadScript("_STARTUP.EMC", _npcScriptData, _opcodeTable, _opcodeTableSize, 0)) { + if (!_scriptInterpreter->loadScript("_STARTUP.EMC", _npcScriptData, 0)) { error("Could not load \"_STARTUP.EMC\" script"); } _scriptInterpreter->initScript(_scriptMain, _npcScriptData); @@ -491,7 +491,7 @@ void KyraEngine::startup() { } _scriptInterpreter->unloadScript(_npcScriptData); - if (!_scriptInterpreter->loadScript("_NPC.EMC", _npcScriptData, _opcodeTable, _opcodeTableSize, 0)) { + if (!_scriptInterpreter->loadScript("_NPC.EMC", _npcScriptData, 0)) { error("Could not load \"_NPC.EMC\" script"); } @@ -1113,4 +1113,14 @@ void KyraEngine::runNpcScript(int func) { } } +int KyraEngine::runOpcode(ScriptState *script, uint8 opcode) { + debugC(9, kDebugLevelMain | kDebugLevelScript, "KyraEngine::runOpcode(%p, %d)", (void *)script, opcode); + assert(opcode < _opcodeTableSize); + if (_opcodeTable[opcode] == &KyraEngine::c1_dummy) + warning("calling unimplemented opcode(0x%.02X)", opcode); + int val = (this->*_opcodeTable[opcode])(script); + assert(script); + return val; +} + } // End of namespace Kyra |