aboutsummaryrefslogtreecommitdiff
path: root/saga
diff options
context:
space:
mode:
authorAndrew Kurushin2004-12-24 11:11:01 +0000
committerAndrew Kurushin2004-12-24 11:11:01 +0000
commit573da1e79cca48c0140e0b1a6e6463373a481715 (patch)
tree5cf4d1743425490737f441df0e488bb635fbee8b /saga
parent53852dd52de16221829a888a724394d5af390fa9 (diff)
downloadscummvm-rg350-573da1e79cca48c0140e0b1a6e6463373a481715.tar.gz
scummvm-rg350-573da1e79cca48c0140e0b1a6e6463373a481715.tar.bz2
scummvm-rg350-573da1e79cca48c0140e0b1a6e6463373a481715.zip
- opCCall* on debuglevel==9 shows script function name
svn-id: r16289
Diffstat (limited to 'saga')
-rw-r--r--saga/script.h6
-rw-r--r--saga/sfuncs.cpp4
-rw-r--r--saga/sthread.cpp4
3 files changed, 9 insertions, 5 deletions
diff --git a/saga/script.h b/saga/script.h
index 65dd100ecf..50dc69f739 100644
--- a/saga/script.h
+++ b/saga/script.h
@@ -278,7 +278,11 @@ private:
private:
typedef int (Script::*ScriptFunctionType)(SCRIPTFUNC_PARAMS);
- const ScriptFunctionType *_scriptFunctionsList;
+ struct ScriptFunctionDescription {
+ ScriptFunctionType scriptFunction;
+ const char *scriptFunctionName;
+ };
+ const ScriptFunctionDescription *_scriptFunctionsList;
void setupScriptFuncList(void);
int SDebugPrintInstr(SCRIPT_THREAD *thread);
diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp
index 5d87049945..c636a6ce0f 100644
--- a/saga/sfuncs.cpp
+++ b/saga/sfuncs.cpp
@@ -41,10 +41,10 @@
namespace Saga {
-#define OPCODE(x) &Script::x
+#define OPCODE(x) {&Script::x, #x}
void Script::setupScriptFuncList(void) {
- static const ScriptFunctionType scriptFunctionsList[SCRIPT_FUNCTION_MAX] = {
+ static const ScriptFunctionDescription scriptFunctionsList[SCRIPT_FUNCTION_MAX] = {
OPCODE(SF_putString),
OPCODE(sfWait),
OPCODE(SF_takeObject),
diff --git a/saga/sthread.cpp b/saga/sthread.cpp
index 34d4af07ae..dfaffed4ab 100644
--- a/saga/sthread.cpp
+++ b/saga/sthread.cpp
@@ -391,14 +391,14 @@ int Script::SThreadRun(SCRIPT_THREAD *thread, int instr_limit) {
argumentsCount = scriptS.readByte();
functionNumber = scriptS.readUint16LE();
- debug(9, "opCCall* 0x%X", functionNumber);
if (functionNumber >= SCRIPT_FUNCTION_MAX) {
_vm->_console->DebugPrintf(S_ERROR_PREFIX "Invalid script function number: (%X)\n", functionNumber);
thread->flags |= kTFlagAborted;
break;
}
- scriptFunction = _scriptFunctionsList[functionNumber];
+ debug(9, "opCCall* Calling 0x%X %s", functionNumber, _scriptFunctionsList[functionNumber].scriptFunctionName);
+ scriptFunction = _scriptFunctionsList[functionNumber].scriptFunction;
scriptFunctionReturnValue = (this->*scriptFunction)(thread, argumentsCount);
if (scriptFunctionReturnValue != SUCCESS) {
_vm->_console->DebugPrintf(S_WARN_PREFIX "%X: Script function %d failed.\n", thread->i_offset, scriptFunctionReturnValue);