From e1e95f0c0edf58553af5f31d33f46f5eb864d168 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 10 Jul 2008 12:05:38 +0000 Subject: Added filename to unknown opcode/command warnings of EMC scripts. svn-id: r32988 --- engines/kyra/script.cpp | 6 ++++-- engines/kyra/script.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/engines/kyra/script.cpp b/engines/kyra/script.cpp index a29cdc8ca3..b10a4b32bf 100644 --- a/engines/kyra/script.cpp +++ b/engines/kyra/script.cpp @@ -132,6 +132,8 @@ bool EMCInterpreter::load(const char *filename, EMCData *scriptData, const Commo scriptData->opcodes = opcodes; + strncpy(scriptData->filename, filename, 13); + return true; } @@ -205,7 +207,7 @@ bool EMCInterpreter::run(EMCState *script) { } if (opcode > 18) { - error("Script unknown command: %d", opcode); + error("Script unknown command: %d in file '%s' at offset 0x%.08X", opcode, script->dataPtr->filename, instOffset); } else { debugC(5, kDebugLevelScript, "[0x%.08X] EMCInterpreter::%s([%d/%u])", instOffset, _commands[opcode].desc, _parameter, (uint)_parameter); (this->*(_commands[opcode].proc))(script); @@ -388,7 +390,7 @@ void EMCInterpreter::cmd_execOpcode(EMCState* script) { script->retValue = (*(*script->dataPtr->opcodes)[opcode])(script); } else { script->retValue = 0; - warning("calling unimplemented opcode(0x%.02X/%d)", opcode, opcode); + warning("Calling unimplemented opcode(0x%.02X/%d) from file '%s'", opcode, opcode, script->dataPtr->filename); } } diff --git a/engines/kyra/script.h b/engines/kyra/script.h index de52093f66..2b97a83289 100644 --- a/engines/kyra/script.h +++ b/engines/kyra/script.h @@ -36,6 +36,8 @@ struct EMCState; typedef Common::Functor1 Opcode; struct EMCData { + char filename[13]; + byte *text; uint16 *data; uint16 *ordr; -- cgit v1.2.3