From 285f6a6a2bf00217d43267fc9bc643201e29fed2 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 28 Jan 2005 03:47:12 +0000 Subject: Let IHNM run again. It has 105 script functions. svn-id: r16653 --- saga/script.h | 3 ++- saga/sfuncs.cpp | 35 ++++++++++++++++++++++++++++++++++- saga/sthread.cpp | 2 +- 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); -- cgit v1.2.3