aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2005-01-28 03:47:12 +0000
committerEugene Sandulenko2005-01-28 03:47:12 +0000
commit285f6a6a2bf00217d43267fc9bc643201e29fed2 (patch)
tree5865cbcd3a058963f7ddd6550e3753a6d3b0691d
parentad53c8c9a4f757c72a98a14cffd95afc7cf44b7a (diff)
downloadscummvm-rg350-285f6a6a2bf00217d43267fc9bc643201e29fed2.tar.gz
scummvm-rg350-285f6a6a2bf00217d43267fc9bc643201e29fed2.tar.bz2
scummvm-rg350-285f6a6a2bf00217d43267fc9bc643201e29fed2.zip
Let IHNM run again. It has 105 script functions.
svn-id: r16653
-rw-r--r--saga/script.h3
-rw-r--r--saga/sfuncs.cpp35
-rw-r--r--saga/sthread.cpp2
3 files changed, 37 insertions, 3 deletions
diff --git a/saga/script.h b/saga/script.h
index 5d6d0328c2..2183f9c11e 100644
--- a/saga/script.h
+++ b/saga/script.h
@@ -46,7 +46,7 @@ namespace Saga {
#define S_ERROR_PREFIX "SError: "
#define S_WARN_PREFIX "SWarning: "
-#define SCRIPT_FUNCTION_MAX 78
+#define SCRIPT_FUNCTION_MAX 104
#define DEFAULT_THREAD_STACK_SIZE 256
enum AddressTypes {
@@ -534,6 +534,7 @@ private:
void sfRand(SCRIPTFUNC_PARAMS);
void SF_fadeMusic(SCRIPTFUNC_PARAMS);
void SF_playVoice(SCRIPTFUNC_PARAMS);
+ void SF_stub(SCRIPTFUNC_PARAMS);
};
} // End of namespace Saga
diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp
index 9c8808d49c..6d554c0e96 100644
--- a/saga/sfuncs.cpp
+++ b/saga/sfuncs.cpp
@@ -126,7 +126,33 @@ void Script::setupScriptFuncList(void) {
OPCODE(SF_protectResult),
OPCODE(sfRand),
OPCODE(SF_fadeMusic),
- OPCODE(SF_playVoice)
+ OPCODE(SF_playVoice),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub),
+ OPCODE(SF_stub)
};
_scriptFunctionsList = scriptFunctionsList;
}
@@ -1561,4 +1587,11 @@ void Script::finishDialog(int replyID, int flags, int bitOffset) {
wakeUpThreads(kWaitTypeDialogBegin);
}
+void Script::SF_stub(SCRIPTFUNC_PARAMS) {
+ for (int i = 0; i < nArgs; i++)
+ thread->pop();
+
+ debug(1, "stub: SF_stub(), %d args", nArgs);
+}
+
} // End of namespace Saga
diff --git a/saga/sthread.cpp b/saga/sthread.cpp
index 4fbb2cd364..7653a3c655 100644
--- a/saga/sthread.cpp
+++ b/saga/sthread.cpp
@@ -313,7 +313,7 @@ void Script::runThread(ScriptThread *thread, uint instructionLimit) {
argumentsCount = scriptS.readByte();
functionNumber = scriptS.readUint16LE();
if (functionNumber >= SCRIPT_FUNCTION_MAX) {
- error("Script::runThread() Invalid script function number");
+ error("Script::runThread() Invalid script function number (%d)", functionNumber);
}
debug(8, "Calling 0x%X %s", functionNumber, _scriptFunctionsList[functionNumber].scriptFunctionName);