diff options
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/scriptdebug.h | 38 | ||||
-rw-r--r-- | engines/sci/engine/vm.cpp | 10 |
2 files changed, 39 insertions, 9 deletions
diff --git a/engines/sci/engine/scriptdebug.h b/engines/sci/engine/scriptdebug.h new file mode 100644 index 0000000000..15e71343de --- /dev/null +++ b/engines/sci/engine/scriptdebug.h @@ -0,0 +1,38 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef SCI_ENGINE_SCRIPTDEBUG_H +#define SCI_ENGINE_SCRIPTDEBUG_H + +namespace Sci { + +#ifndef REDUCE_MEMORY_USAGE +extern const char *opcodeNames[]; +#endif + +void debugSelectorCall(reg_t send_obj, Selector selector, int argc, StackPtr argp, ObjVarRef &varp, reg_t funcp, SegManager *segMan, SelectorType selectorType); + +void logKernelCall(const KernelFunction *kernelCall, const KernelSubFunction *kernelSubCall, EngineState *s, int argc, reg_t *argv, reg_t result); + +} + +#endif diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 12a9c3b021..edffa60b09 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -36,6 +36,7 @@ #include "sci/engine/selector.h" // for SELECTOR #include "sci/engine/gc.h" #include "sci/engine/workarounds.h" +#include "sci/engine/scriptdebug.h" namespace Sci { @@ -114,10 +115,6 @@ static bool validate_variable(reg_t *r, reg_t *stack_base, int type, int max, in return true; } -#ifndef REDUCE_MEMORY_USAGE -extern const char *opcodeNames[]; // from scriptdebug.cpp -#endif - static reg_t read_var(EngineState *s, int type, int index) { if (validate_variable(s->variables[type], s->stack_base, type, s->variablesMax[type], index)) { if (s->variables[type][index].getSegment() == kUninitializedSegment) { @@ -257,8 +254,6 @@ static void _exec_varselectors(EngineState *s) { } } -// from scriptdebug.cpp -extern void debugSelectorCall(reg_t send_obj, Selector selector, int argc, StackPtr argp, ObjVarRef &varp, reg_t funcp, SegManager *segMan, SelectorType selectorType); ExecStack *send_selector(EngineState *s, reg_t send_obj, reg_t work_obj, StackPtr sp, int framesize, StackPtr argp) { // send_obj and work_obj are equal for anything but 'super' @@ -340,9 +335,6 @@ static void addKernelCallToExecStack(EngineState *s, int kernelCallNr, int kerne s->_executionStack.push_back(xstack); } -// from scriptdebug.cpp -extern void logKernelCall(const KernelFunction *kernelCall, const KernelSubFunction *kernelSubCall, EngineState *s, int argc, reg_t *argv, reg_t result); - static void callKernelFunc(EngineState *s, int kernelCallNr, int argc) { Kernel *kernel = g_sci->getKernel(); |