diff options
-rw-r--r-- | dists/msvc7/sci.vcproj | 6 | ||||
-rw-r--r-- | dists/msvc71/sci.vcproj | 6 | ||||
-rw-r--r-- | dists/msvc8/sci.vcproj | 8 | ||||
-rw-r--r-- | dists/msvc9/sci.vcproj | 8 | ||||
-rw-r--r-- | engines/sci/console.cpp | 166 | ||||
-rw-r--r-- | engines/sci/console.h | 5 | ||||
-rw-r--r-- | engines/sci/engine/grammar.cpp | 1 | ||||
-rw-r--r-- | engines/sci/engine/kmovement.cpp | 197 | ||||
-rw-r--r-- | engines/sci/engine/sciconsole.cpp | 854 | ||||
-rw-r--r-- | engines/sci/engine/sciconsole.h | 121 | ||||
-rw-r--r-- | engines/sci/engine/scriptdebug.cpp | 32 | ||||
-rw-r--r-- | engines/sci/module.mk | 1 | ||||
-rw-r--r-- | engines/sci/sci.cpp | 1 | ||||
-rw-r--r-- | engines/sci/tools.cpp | 1 |
14 files changed, 339 insertions, 1068 deletions
diff --git a/dists/msvc7/sci.vcproj b/dists/msvc7/sci.vcproj index ddad383af1..6a7bb5b629 100644 --- a/dists/msvc7/sci.vcproj +++ b/dists/msvc7/sci.vcproj @@ -190,12 +190,6 @@ RelativePath="..\..\engines\sci\engine\savegame.h"> </File> <File - RelativePath="..\..\engines\sci\engine\sciconsole.cpp"> - </File> - <File - RelativePath="..\..\engines\sci\engine\sciconsole.h"> - </File> - <File RelativePath="..\..\engines\sci\engine\script.h"> </File> <File diff --git a/dists/msvc71/sci.vcproj b/dists/msvc71/sci.vcproj index 4f6e4e7edd..442330d878 100644 --- a/dists/msvc71/sci.vcproj +++ b/dists/msvc71/sci.vcproj @@ -204,12 +204,6 @@ RelativePath="..\..\engines\sci\engine\savegame.h"> </File> <File - RelativePath="..\..\engines\sci\engine\sciconsole.cpp"> - </File> - <File - RelativePath="..\..\engines\sci\engine\sciconsole.h"> - </File> - <File RelativePath="..\..\engines\sci\engine\script.h"> </File> <File diff --git a/dists/msvc8/sci.vcproj b/dists/msvc8/sci.vcproj index d01456c173..64a42ede42 100644 --- a/dists/msvc8/sci.vcproj +++ b/dists/msvc8/sci.vcproj @@ -282,14 +282,6 @@ > </File> <File - RelativePath="..\..\engines\sci\engine\sciconsole.cpp" - > - </File> - <File - RelativePath="..\..\engines\sci\engine\sciconsole.h" - > - </File> - <File RelativePath="..\..\engines\sci\engine\script.h" > </File> diff --git a/dists/msvc9/sci.vcproj b/dists/msvc9/sci.vcproj index 5e7b9c0fa6..ab3772907f 100644 --- a/dists/msvc9/sci.vcproj +++ b/dists/msvc9/sci.vcproj @@ -283,14 +283,6 @@ > </File> <File - RelativePath="..\..\engines\sci\engine\sciconsole.cpp" - > - </File> - <File - RelativePath="..\..\engines\sci\engine\sciconsole.h" - > - </File> - <File RelativePath="..\..\engines\sci\engine\script.h" > </File> diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index d4b909a4a0..70d7b85a36 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -29,51 +29,11 @@ #include "sci/console.h" #include "sci/resource.h" #include "sci/vocabulary.h" +#include "sci/engine/state.h" namespace Sci { extern EngineState *g_EngineState; -extern bool g_redirect_sciprintf_to_gui; - -class ConsoleFunc : public Common::Functor2<int, const char **, bool> { -public: - ConsoleFunc(const ConCommand &func, const char *param) : _func(func), _param(param) {} - - bool isValid() const { return _func != 0; } - bool operator()(int argc, const char **argv) const { -#if 1 - // FIXME: Evil hack: recreate the original input string - Common::String tmp = argv[0]; - for (int i = 1; i < argc; ++i) { - tmp += ' '; - tmp += argv[i]; - } - g_redirect_sciprintf_to_gui = true; - con_parse(g_EngineState, tmp.c_str()); - sciprintf("\n"); - g_redirect_sciprintf_to_gui = false; - - return true; -#else - Common::Array<cmd_param_t> cmdParams; - for (int i = 1; i < argc; ++i) { - cmd_param_t tmp; - tmp.str = argv[i]; - // TODO: Convert argc/argv suitable, using _param - cmdParams.push_back(tmp); - } - assert(g_EngineState); - return !(*_func)(g_EngineState, cmdParams); -#endif - } -private: - EngineState *_s; - const ConCommand _func; - const char *_param; -}; - - - Console::Console(SciEngine *vm) : GUI::Debugger() { _vm = vm; @@ -91,7 +51,23 @@ Console::Console(SciEngine *vm) : GUI::Debugger() { DCmd_Register("size", WRAP_METHOD(Console, cmdResourceSize)); DCmd_Register("restypes", WRAP_METHOD(Console, cmdResourceTypes)); DCmd_Register("sci0_palette", WRAP_METHOD(Console, cmdSci0Palette)); + DCmd_Register("hexgrep", WRAP_METHOD(Console, cmdHexgrep)); + DCmd_Register("list", WRAP_METHOD(Console, cmdList)); DCmd_Register("exit", WRAP_METHOD(Console, cmdExit)); + + // These were in sci.cpp + /* + con_hook_int(&(gfx_options.buffer_pics_nr), "buffer_pics_nr", + "Number of pics to buffer in LRU storage\n"); + con_hook_int(&(gfx_options.pic0_dither_mode), "pic0_dither_mode", + "Mode to use for pic0 dithering\n"); + con_hook_int(&(gfx_options.pic0_dither_pattern), "pic0_dither_pattern", + "Pattern to use for pic0 dithering\n"); + con_hook_int(&(gfx_options.pic0_unscaled), "pic0_unscaled", + "Whether pic0 should be drawn unscaled\n"); + con_hook_int(&(gfx_options.dirty_frames), "dirty_frames", + "Dirty frames management\n"); + */ } Console::~Console() { @@ -108,11 +84,6 @@ static ResourceType parseResourceType(const char *resid) { return res; } -void Console::con_hook_command(ConCommand command, const char *name, const char *param, const char *description) { - DCmd_Register(name, new ConsoleFunc(command, param)); -} - - bool Console::cmdGetVersion(int argc, const char **argv) { int ver = _vm->getVersion(); @@ -236,13 +207,7 @@ bool Console::cmdKernelWords(int argc, const char **argv) { bool Console::cmdHexDump(int argc, const char **argv) { if (argc != 3) { DebugPrintf("Usage: %s <resource type> <resource number>\n", argv[0]); - DebugPrintf("The %d valid resource types are:\n", kResourceTypeInvalid); - // There are 20 resource types supported by SCI1.1 - for (int i = 0; i < kResourceTypeInvalid; i++) { - DebugPrintf("%s", getResourceTypeName((ResourceType) i)); - DebugPrintf((i < kResourceTypeInvalid - 1) ? ", " : "\n"); - } - + cmdResourceTypes(argc, argv); return true; } @@ -348,6 +313,101 @@ bool Console::cmdSci0Palette(int argc, const char **argv) { return false; } +bool Console::cmdHexgrep(int argc, const char **argv) { + if (argc < 4) { + DebugPrintf("Searches some resources for a particular sequence of bytes, represented as hexadecimal numbers.\n"); + DebugPrintf("Usage: %s <resource type> <resource number> <search string>\n", argv[0]); + DebugPrintf("<resource number> can be a specific resource number, or \"all\" for all of the resources of the specified type\n", argv[0]); + DebugPrintf("EXAMPLES:\n hexgrep script all e8 03 c8 00\n hexgrep pic 042 fe"); + cmdResourceTypes(argc, argv); + return true; + } + + ResourceType restype = parseResourceType(argv[1]); + int resNumber = 0, resMax = 0; + char seekString[500]; + Resource *script = NULL; + + if (restype == kResourceTypeInvalid) { + DebugPrintf("Resource type '%s' is not valid\n", argv[1]); + return true; + } + + if (!scumm_stricmp(argv[2], "all")) { + resNumber = 0; + resMax = 999; + } else { + resNumber = resMax = atoi(argv[2]); + } + + strcpy(seekString, argv[3]); + + // Construct the seek string + for (int i = 4; i < argc; i++) { + strcat(seekString, argv[i]); + } + + for (; resNumber <= resMax; resNumber++) { + if ((script = _vm->getResMgr()->findResource(restype, resNumber, 0))) { + unsigned int seeker = 0, seekerold = 0; + uint32 comppos = 0; + int output_script_name = 0; + + while (seeker < script->size) { + if (script->data[seeker] == seekString[comppos]) { + if (comppos == 0) + seekerold = seeker; + + comppos++; + + if (comppos == strlen(seekString)) { + comppos = 0; + seeker = seekerold + 1; + + if (!output_script_name) { + DebugPrintf("\nIn %s.%03d:\n", getResourceTypeName((ResourceType)restype), resNumber); + output_script_name = 1; + } + DebugPrintf(" 0x%04x\n", seekerold); + } + } else + comppos = 0; + + seeker++; + } + } + } + + return true; +} + +bool Console::cmdList(int argc, const char **argv) { + if (argc != 2) { + DebugPrintf("Lists all of the resources of a given type\n"); + cmdResourceTypes(argc, argv); + return true; + } + + + ResourceType res = parseResourceType(argv[1]); + if (res == kResourceTypeInvalid) + DebugPrintf("Unknown resource type: '%s'\n", argv[1]); + else { + int j = 0; + for (int i = 0; i < sci_max_resource_nr[_vm->getResMgr()->_sciVersion]; i++) { + if (_vm->getResMgr()->testResource(res, i)) { + DebugPrintf("%s.%03d | ", getResourceTypeName((ResourceType)res), i); + if (j % 5 == 0) + DebugPrintf("\n"); + j++; + } + } + DebugPrintf("\n"); + } + + return true; +} + bool Console::cmdExit(int argc, const char **argv) { if (argc != 2) { DebugPrintf("exit game - exit gracefully\n"); diff --git a/engines/sci/console.h b/engines/sci/console.h index 68ff89f6f8..2f54d4d8d4 100644 --- a/engines/sci/console.h +++ b/engines/sci/console.h @@ -29,7 +29,6 @@ #define SCI_CONSOLE_H #include "gui/debugger.h" -#include "sci/engine/sciconsole.h" namespace Sci { @@ -40,8 +39,6 @@ public: Console(SciEngine *vm); virtual ~Console(); - void con_hook_command(ConCommand command, const char *name, const char *param, const char *description); - private: bool cmdGetVersion(int argc, const char **argv); // bool cmdClasses(int argc, const char **argv); // TODO @@ -56,6 +53,8 @@ private: bool cmdResourceSize(int argc, const char **argv); bool cmdResourceTypes(int argc, const char **argv); bool cmdSci0Palette(int argc, const char **argv); + bool cmdHexgrep(int argc, const char **argv); + bool cmdList(int argc, const char **argv); bool cmdExit(int argc, const char **argv); private: diff --git a/engines/sci/engine/grammar.cpp b/engines/sci/engine/grammar.cpp index f7d86a85ca..c399f0731a 100644 --- a/engines/sci/engine/grammar.cpp +++ b/engines/sci/engine/grammar.cpp @@ -30,7 +30,6 @@ #include "sci/tools.h" #include "sci/vocabulary.h" -#include "sci/engine/sciconsole.h" namespace Sci { diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp index 5e3da6403b..9a80b3c99f 100644 --- a/engines/sci/engine/kmovement.cpp +++ b/engines/sci/engine/kmovement.cpp @@ -239,7 +239,202 @@ enum Movecnt { static Movecnt handle_movecnt = UNINITIALIZED; // FIXME: Avoid static vars -int parse_reg_t(EngineState *s, const char *str, reg_t *dest); +/** + * Address parameters may be passed in one of three forms: + * - ssss:oooo -- where 'ssss' denotes a segment and 'oooo' an offset. + * Example: "a:c5" would address something in segment 0xa at offset 0xc5. + * - &scr:oooo -- where 'scr' is a script number and oooo an offset within that script; will + * fail if the script is not currently loaded + * - $REG -- where 'REG' is one of 'PC', 'ACC', 'PREV' or 'OBJ': References the address + * indicated by the register of this name. + * - $REG+n (or -n) -- Like $REG, but modifies the offset part by a specific amount (which + * is specified in hexadecimal). + * - ?obj -- Looks up an object with the specified name, uses its address. This will abort if + * the object name is ambiguous; in that case, a list of addresses and indices is provided. + * ?obj.idx may be used to disambiguate 'obj' by the index 'idx'. +**/ +int parse_reg_t(EngineState *s, const char *str, reg_t *dest) { // Returns 0 on success + int rel_offsetting = 0; + const char *offsetting = NULL; + // Non-NULL: Parse end of string for relative offsets + char *endptr; + + if (*str == '$') { // Register + rel_offsetting = 1; + + if (!scumm_strnicmp(str + 1, "PC", 2)) { + *dest = s->_executionStack.back().addr.pc; + offsetting = str + 3; + } else if (!scumm_strnicmp(str + 1, "P", 1)) { + *dest = s->_executionStack.back().addr.pc; + offsetting = str + 2; + } else if (!scumm_strnicmp(str + 1, "PREV", 4)) { + *dest = s->r_prev; + offsetting = str + 5; + } else if (!scumm_strnicmp(str + 1, "ACC", 3)) { + *dest = s->r_acc; + offsetting = str + 4; + } else if (!scumm_strnicmp(str + 1, "A", 1)) { + *dest = s->r_acc; + offsetting = str + 2; + } else if (!scumm_strnicmp(str + 1, "OBJ", 3)) { + *dest = s->_executionStack.back().objp; + offsetting = str + 4; + } else if (!scumm_strnicmp(str + 1, "O", 1)) { + *dest = s->_executionStack.back().objp; + offsetting = str + 2; + } else + return 1; // No matching register + + if (!*offsetting) + offsetting = NULL; + else if (*offsetting != '+' && *offsetting != '-') + return 1; + } else if (*str == '&') { + int script_nr; + // Look up by script ID + char *colon = (char *)strchr(str, ':'); + + if (!colon) + return 1; + *colon = 0; + offsetting = colon + 1; + + script_nr = strtol(str + 1, &endptr, 10); + + if (*endptr) + return 1; + + dest->segment = s->seg_manager->segGet(script_nr); + + if (!dest->segment) { + return 1; + } + } else if (*str == '?') { + int index = -1; + int times_found = 0; + char *tmp; + const char *str_objname; + char *str_suffix; + char suffchar = 0; + uint i; + // Parse obj by name + + tmp = (char *)strchr(str, '+'); + str_suffix = (char *)strchr(str, '-'); + if (tmp < str_suffix) + str_suffix = tmp; + if (str_suffix) { + suffchar = (*str_suffix); + *str_suffix = 0; + } + + tmp = (char *)strchr(str, '.'); + + if (tmp) { + *tmp = 0; + index = strtol(tmp + 1, &endptr, 16); + if (*endptr) + return -1; + } + + str_objname = str + 1; + + // Now all values are available; iterate over all objects. + for (i = 0; i < s->seg_manager->_heap.size(); i++) { + MemObject *mobj = s->seg_manager->_heap[i]; + int idx = 0; + int max_index = 0; + + if (mobj) { + if (mobj->getType() == MEM_OBJ_SCRIPT) + max_index = (*(Script *)mobj)._objects.size(); + else if (mobj->getType() == MEM_OBJ_CLONES) + max_index = (*(CloneTable *)mobj)._table.size(); + } + + while (idx < max_index) { + int valid = 1; + Object *obj = NULL; + reg_t objpos; + objpos.offset = 0; + objpos.segment = i; + + if (mobj->getType() == MEM_OBJ_SCRIPT) { + obj = &(*(Script *)mobj)._objects[idx]; + objpos.offset = obj->pos.offset; + } else if (mobj->getType() == MEM_OBJ_CLONES) { + obj = &((*(CloneTable *)mobj)._table[idx]); + objpos.offset = idx; + valid = ((CloneTable *)mobj)->isValidEntry(idx); + } + + if (valid) { + const char *objname = obj_get_name(s, objpos); + if (!strcmp(objname, str_objname)) { + // Found a match! + if ((index < 0) && (times_found > 0)) { + if (times_found == 1) { + // First time we realized the ambiguity + sciprintf("Ambiguous:\n"); + sciprintf(" %3x: [%04x:%04x] %s\n", 0, PRINT_REG(*dest), str_objname); + } + sciprintf(" %3x: [%04x:%04x] %s\n", times_found, PRINT_REG(objpos), str_objname); + } + if (index < 0 || times_found == index) + *dest = objpos; + ++times_found; + } + } + ++idx; + } + + } + + if (!times_found) + return 1; + + if (times_found > 1 && index < 0) { + sciprintf("Ambiguous: Aborting.\n"); + return 1; // Ambiguous + } + + if (times_found <= index) + return 1; // Not found + + offsetting = str_suffix; + if (offsetting) + *str_suffix = suffchar; + rel_offsetting = 1; + } else { + char *colon = (char *)strchr(str, ':'); + + if (!colon) { + offsetting = str; + dest->segment = 0; + } else { + *colon = 0; + offsetting = colon + 1; + + dest->segment = strtol(str, &endptr, 16); + if (*endptr) + return 1; + } + } + if (offsetting) { + int val = strtol(offsetting, &endptr, 16); + + if (rel_offsetting) + dest->offset += val; + else + dest->offset = val; + + if (*endptr) + return 1; + } + + return 0; +} static int checksum_bytes(byte *data, int size) { int result = 0; diff --git a/engines/sci/engine/sciconsole.cpp b/engines/sci/engine/sciconsole.cpp deleted file mode 100644 index 0fee370972..0000000000 --- a/engines/sci/engine/sciconsole.cpp +++ /dev/null @@ -1,854 +0,0 @@ -/* 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. - * - * $URL$ - * $Id$ - * - */ - -/* Second half of the console implementation: VM dependent stuff */ -/* Remember, it doesn't have to be fast. */ - -#include "sci/engine/state.h" -#include "sci/engine/sciconsole.h" - -#include "sci/sci.h" // For _console only -#include "sci/console.h" // For _console only - -namespace Sci { - -// console commands - -static int c_list(EngineState *s, const Common::Array<cmd_param_t> &cmdParams); // lists various types of things -static int c_set(EngineState *s, const Common::Array<cmd_param_t> &cmdParams); // sets an int variable -static int c_print(EngineState *s, const Common::Array<cmd_param_t> &cmdParams); // prints a variable -//static int c_objinfo(EngineState *s, const Common::Array<cmd_param_t> &cmdParams); // shows some info about one class -//static int c_objmethods(EngineState *s, const Common::Array<cmd_param_t> &cmdParams); // Disassembles all methods of a class -static int c_hexgrep(EngineState *s, const Common::Array<cmd_param_t> &cmdParams); // Searches a string in one resource or resource class - -struct cmd_mm_entry_t { - const char *name; - const char *description; -}; // All later structures must "extend" this - -// Simple info page -struct cmd_page_t : public cmd_mm_entry_t { -}; - -struct cmd_command_t : public cmd_mm_entry_t { - ConCommand command; - const char *param; -}; - -struct cmd_var_t : public cmd_mm_entry_t { - union { - int *intp; - char **charpp; - reg_t *reg; - } var; -}; - - -typedef void printfunc_t(cmd_mm_entry_t *data, int full); - -struct cmd_mm_struct_t { - const char *name; - void *data; // cmd_mm_entry_t - size_t size_per_entry; - printfunc_t *print; - int entries; // Number of used entries - int allocated; // Number of allocated entries -}; - -#define CMD_MM_ENTRIES 3 // command console memory and manual page manager -#define CMD_MM_DEFAULT_ALLOC 4 // Number of table entries to allocate per default - -#define CMD_MM_CMD 0 // Commands -#define CMD_MM_VAR 1 // Variables -#define CMD_MM_DOC 2 // Misc. documentation - -static const char *cmd_mm_names[CMD_MM_ENTRIES] = { - "Commands", - "Variables", - "Documentation" -}; -static size_t cmd_mm_sizes_per_entry[CMD_MM_ENTRIES] = { - sizeof(cmd_command_t), - sizeof(cmd_var_t), - sizeof(cmd_page_t) -}; - -static void _cmd_print_command(cmd_mm_entry_t *data, int full); -static void _cmd_print_var(cmd_mm_entry_t *data, int full); -static void _cmd_print_page(cmd_mm_entry_t *data, int full); - -static printfunc_t *cmd_mm_printers[CMD_MM_ENTRIES] = { - _cmd_print_command, - _cmd_print_var, - _cmd_print_page -}; - -static cmd_mm_struct_t cmd_mm[CMD_MM_ENTRIES]; - -static int _cmd_initialized = 0; -static int _lists_need_sorting = 0; - -void _cmd_exit() { - int t; - - for (t = 0; t < CMD_MM_ENTRIES; t++) - free(cmd_mm[t].data); -} - -static cmd_mm_entry_t *cmd_mm_find(const char *name, int type) { - int i; - - for (i = 0; i < cmd_mm[type].entries; i++) { - cmd_mm_entry_t *tmp = (cmd_mm_entry_t *)((byte *)cmd_mm[type].data + i * cmd_mm[type].size_per_entry); - if (!strcmp(tmp->name, name)) - return tmp; - } - - return NULL; -} - -static int _cmd_mm_comp(const void *a, const void *b) { - return strcmp(((cmd_mm_entry_t *) a)->name, ((cmd_mm_entry_t *) b)->name); -} - -void con_sort_all() { - int i; - - for (i = 0; i < CMD_MM_ENTRIES; i++) - if (cmd_mm[i].entries && _lists_need_sorting & (1 << i)) - qsort(cmd_mm[i].data, cmd_mm[i].entries, cmd_mm[i].size_per_entry, _cmd_mm_comp); - - _lists_need_sorting = 0; -} - -void con_init() { - if (!_cmd_initialized) { - int i; - - _cmd_initialized = 1; - for (i = 0; i < CMD_MM_ENTRIES; i++) { - cmd_mm[i].name = cmd_mm_names[i]; - cmd_mm[i].size_per_entry = cmd_mm_sizes_per_entry[i]; - cmd_mm[i].entries = 0; - cmd_mm[i].allocated = CMD_MM_DEFAULT_ALLOC; - cmd_mm[i].data = calloc(cmd_mm[i].allocated, cmd_mm[i].size_per_entry); - cmd_mm[i].print = cmd_mm_printers[i]; - } - - atexit(_cmd_exit); - - // Hook up some commands - con_hook_command(&c_list, "list", "s*", "Lists various things (try 'list')"); - con_hook_command(&c_print, "print", "s", "Prints an int variable"); - con_hook_command(&c_set, "set", "si", "Sets an int variable"); - con_hook_command(&c_hexgrep, "hexgrep", "shh*", "Searches some resources for a\n" - " particular sequence of bytes, re-\n presented as hexadecimal numbers.\n\n" - "EXAMPLES:\n hexgrep script e8 03 c8 00\n hexgrep pic.042 fe"); - - // These were in sci.cpp - /* - con_hook_int(&(gfx_options.buffer_pics_nr), "buffer_pics_nr", - "Number of pics to buffer in LRU storage\n"); - con_hook_int(&(gfx_options.pic0_dither_mode), "pic0_dither_mode", - "Mode to use for pic0 dithering\n"); - con_hook_int(&(gfx_options.pic0_dither_pattern), "pic0_dither_pattern", - "Pattern to use for pic0 dithering\n"); - con_hook_int(&(gfx_options.pic0_unscaled), "pic0_unscaled", - "Whether pic0 should be drawn unscaled\n"); - con_hook_int(&(gfx_options.dirty_frames), "dirty_frames", - "Dirty frames management\n"); - */ - } -} - -static inline int clone_is_used(CloneTable *t, int idx) { - return t->isValidEntry(idx); -} - -/** - * Address parameters may be passed in one of three forms: - * - ssss:oooo -- where 'ssss' denotes a segment and 'oooo' an offset. - * Example: "a:c5" would address something in segment 0xa at offset 0xc5. - * - &scr:oooo -- where 'scr' is a script number and oooo an offset within that script; will - * fail if the script is not currently loaded - * - $REG -- where 'REG' is one of 'PC', 'ACC', 'PREV' or 'OBJ': References the address - * indicated by the register of this name. - * - $REG+n (or -n) -- Like $REG, but modifies the offset part by a specific amount (which - * is specified in hexadecimal). - * - ?obj -- Looks up an object with the specified name, uses its address. This will abort if - * the object name is ambiguous; in that case, a list of addresses and indices is provided. - * ?obj.idx may be used to disambiguate 'obj' by the index 'idx'. -**/ -int parse_reg_t(EngineState *s, const char *str, reg_t *dest) { // Returns 0 on success - int rel_offsetting = 0; - const char *offsetting = NULL; - // Non-NULL: Parse end of string for relative offsets - char *endptr; - - if (!s) { - sciprintf("Addresses can only be parsed if a global state is present"); - return 1; // Requires a valid state - } - - if (*str == '$') { // Register - rel_offsetting = 1; - - if (!scumm_strnicmp(str + 1, "PC", 2)) { - *dest = s->_executionStack.back().addr.pc; - offsetting = str + 3; - } else if (!scumm_strnicmp(str + 1, "P", 1)) { - *dest = s->_executionStack.back().addr.pc; - offsetting = str + 2; - } else if (!scumm_strnicmp(str + 1, "PREV", 4)) { - *dest = s->r_prev; - offsetting = str + 5; - } else if (!scumm_strnicmp(str + 1, "ACC", 3)) { - *dest = s->r_acc; - offsetting = str + 4; - } else if (!scumm_strnicmp(str + 1, "A", 1)) { - *dest = s->r_acc; - offsetting = str + 2; - } else if (!scumm_strnicmp(str + 1, "OBJ", 3)) { - *dest = s->_executionStack.back().objp; - offsetting = str + 4; - } else if (!scumm_strnicmp(str + 1, "O", 1)) { - *dest = s->_executionStack.back().objp; - offsetting = str + 2; - } else - return 1; // No matching register - - if (!*offsetting) - offsetting = NULL; - else if (*offsetting != '+' && *offsetting != '-') - return 1; - } else if (*str == '&') { - int script_nr; - // Look up by script ID - char *colon = (char *)strchr(str, ':'); - - if (!colon) - return 1; - *colon = 0; - offsetting = colon + 1; - - script_nr = strtol(str + 1, &endptr, 10); - - if (*endptr) - return 1; - - dest->segment = s->seg_manager->segGet(script_nr); - - if (!dest->segment) { - return 1; - } - } else if (*str == '?') { - int index = -1; - int times_found = 0; - char *tmp; - const char *str_objname; - char *str_suffix; - char suffchar = 0; - uint i; - // Parse obj by name - - tmp = (char *)strchr(str, '+'); - str_suffix = (char *)strchr(str, '-'); - if (tmp < str_suffix) - str_suffix = tmp; - if (str_suffix) { - suffchar = (*str_suffix); - *str_suffix = 0; - } - - tmp = (char *)strchr(str, '.'); - - if (tmp) { - *tmp = 0; - index = strtol(tmp + 1, &endptr, 16); - if (*endptr) - return -1; - } - - str_objname = str + 1; - - // Now all values are available; iterate over all objects. - for (i = 0; i < s->seg_manager->_heap.size(); i++) { - MemObject *mobj = s->seg_manager->_heap[i]; - int idx = 0; - int max_index = 0; - - if (mobj) { - if (mobj->getType() == MEM_OBJ_SCRIPT) - max_index = (*(Script *)mobj)._objects.size(); - else if (mobj->getType() == MEM_OBJ_CLONES) - max_index = (*(CloneTable *)mobj)._table.size(); - } - - while (idx < max_index) { - int valid = 1; - Object *obj = NULL; - reg_t objpos; - objpos.offset = 0; - objpos.segment = i; - - if (mobj->getType() == MEM_OBJ_SCRIPT) { - obj = &(*(Script *)mobj)._objects[idx]; - objpos.offset = obj->pos.offset; - } else if (mobj->getType() == MEM_OBJ_CLONES) { - obj = &((*(CloneTable *)mobj)._table[idx]); - objpos.offset = idx; - valid = clone_is_used((CloneTable *)mobj, idx); - } - - if (valid) { - const char *objname = obj_get_name(s, objpos); - if (!strcmp(objname, str_objname)) { - // Found a match! - if ((index < 0) && (times_found > 0)) { - if (times_found == 1) { - // First time we realized the ambiguity - sciprintf("Ambiguous:\n"); - sciprintf(" %3x: [%04x:%04x] %s\n", 0, PRINT_REG(*dest), str_objname); - } - sciprintf(" %3x: [%04x:%04x] %s\n", times_found, PRINT_REG(objpos), str_objname); - } - if (index < 0 || times_found == index) - *dest = objpos; - ++times_found; - } - } - ++idx; - } - - } - - if (!times_found) - return 1; - - if (times_found > 1 && index < 0) { - sciprintf("Ambiguous: Aborting.\n"); - return 1; // Ambiguous - } - - if (times_found <= index) - return 1; // Not found - - offsetting = str_suffix; - if (offsetting) - *str_suffix = suffchar; - rel_offsetting = 1; - } else { - char *colon = (char *)strchr(str, ':'); - - if (!colon) { - offsetting = str; - dest->segment = 0; - } else { - *colon = 0; - offsetting = colon + 1; - - dest->segment = strtol(str, &endptr, 16); - if (*endptr) - return 1; - } - } - if (offsetting) { - int val = strtol(offsetting, &endptr, 16); - - if (rel_offsetting) - dest->offset += val; - else - dest->offset = val; - - if (*endptr) - return 1; - } - - return 0; -} - -void con_parse(EngineState *s, const char *command) { - char *cmd = (command && command[0]) ? (char *)strdup(command) : (char *)strdup(" "); - char *_cmd = cmd; - int pos = 0; - - if (!_cmd_initialized) - con_init(); - - bool done = false; // are we done yet? - while (!done) { - cmd_command_t *command_todo; - bool quote = false; // quoting? - bool cdone = false; // Done with the current command? - bool onvar = true; // currently working on a variable? - cdone = 0; - pos = 0; - - Common::Array<cmd_param_t> cmdParams; - - while (*cmd == ' ') - cmd++; - - while (!cdone) { - switch (cmd[pos]) { - case 0: - cdone = done = true; - case ';': - if (!quote) - cdone = true; - case ' ': - if (!quote) { - cmd[pos] = 0; - onvar = false; - } - break; - case '\\': // don't check next char for special meaning - memmove(cmd + pos, cmd + pos + 1, strlen(cmd + pos) - 1); - break; - case '"': - quote = !quote; - memmove(cmd + pos, cmd + pos + 1, strlen(cmd + pos)); - pos--; - break; - default: - if (!onvar) { - onvar = true; - cmd_param_t tmp; - tmp.str = cmd + pos; - cmdParams.push_back(tmp); - } - break; - } - pos++; - } - - if (quote) - sciprintf("unbalanced quotes\n"); - else if (strcmp(cmd, "") != 0) { - command_todo = (cmd_command_t *) cmd_mm_find(cmd, CMD_MM_CMD); - if (!command_todo) - sciprintf("%s: not found\n", cmd); - else { - uint minparams; - int need_state = 0; - - const char *paramt = command_todo->param; // parameter types - if (command_todo->param[0] == '!') { - need_state = 1; - paramt++; - } - - minparams = strlen(paramt); - - if ((paramt[0] != 0) && (paramt[strlen(paramt) - 1] == '*')) - minparams -= 2; - - if (cmdParams.size() < minparams) - sciprintf("%s: needs more than %d parameters\n", cmd, cmdParams.size()); - - else if ((cmdParams.size() > strlen(paramt)) && ((strlen(paramt) == 0) || paramt[strlen(paramt) - 1] != '*')) - sciprintf("%s: too many parameters", cmd); - else { - int do_execute = !need_state || s; // /me wants an implication arrow - char paramtype; - int paramtypepos = 0; - char *endptr; - - for (uint i = 0; i < cmdParams.size(); i++) { - paramtype = paramt[paramtypepos]; - - if ((paramt[paramtypepos + 1]) && (paramt[paramtypepos + 1] != '*')) - paramtypepos++; - // seek next param type unless end of string or '* ' - - switch (paramtype) { - // Now turn the parameters into variables of the appropriate types, - // unless they're strings, and store them into the cmdParams array - - case 'a': { - const char *oldname = cmdParams[i].str; - if (parse_reg_t(s, oldname, &(cmdParams[i].reg))) { - sciprintf("%s: '%s' is not an address or object\n", cmd, oldname); - do_execute = 0; - } - break; - } - - case 'i': { - const char *orgstr = cmdParams[i].str; - - cmdParams[i].val = strtol(orgstr, &endptr, 0); - if (*endptr != '\0') { - do_execute = 0; - sciprintf("%s: '%s' is not an int\n", cmd, orgstr); - } - } - break; - - case 'h': { - const char *orgstr = cmdParams[i].str; - - cmdParams[i].val = strtol(orgstr, &endptr, 16); - - if (*endptr != '\0') { - do_execute = 0; - sciprintf("%s: '%s' is not a hex number\n", cmd, orgstr); - } - - cmdParams[i].val &= 0xff; // Clip hex numbers to 0x00 ... 0xff - } - break; - - case 's': - break; - - default: - warning("Internal error: Heap corruption or prior assertion failed: " - "Unknown parameter type '%c' for function", paramtype); - - } - } - - if (do_execute) { - command_todo->command(s, cmdParams); - } else - fprintf(stderr, "Skipping command...\n"); - } - } - } - cmd += pos; - } - - free(_cmd); -} - -/* (unused) -static cmd_mm_entry_t *con_iterate_entry(int ID, int *counter) { - byte *retval; - con_init(); - - if (*counter >= cmd_mm[ID].entries) - return 0; - retval = cmd_mm[ID].data; - retval += (*counter) * cmd_mm[ID].size_per_entry; - - (*counter)++; - - return (cmd_mm_entry_t *)retval; -}*/ - -static cmd_mm_entry_t *con_alloc_page_entry(int ID) { - int entry; - - con_init(); - - if (cmd_mm[ID].entries >= cmd_mm[ID].allocated) { - int nextsize = cmd_mm[ID].allocated; - if (nextsize >= 64) - nextsize += 16; - else - nextsize <<= 1; - - cmd_mm[ID].data = realloc(cmd_mm[ID].data, nextsize * cmd_mm[ID].size_per_entry); - cmd_mm[ID].allocated = nextsize; - } - - _lists_need_sorting |= (1 << ID); - - entry = cmd_mm[ID].entries++; - return (cmd_mm_entry_t *)(((byte *)cmd_mm[ID].data) + entry * cmd_mm[ID].size_per_entry); -} - -int con_hook_command(ConCommand command, const char *name, const char *param, const char *description) { - cmd_command_t *cmd = NULL; - unsigned int i; - - if (NULL == name) { - sciprintf("console.c: con_hook_command(): NULL passed for name\n"); - return -1; - } - - if (command == NULL) - return 1; - - if (param == NULL) - param = ""; - - if (description == NULL) - description = ""; - - i = 0; - while (param[i] != 0) { - switch (param[i]) { - case '*': - if (param[i + 1] != 0) - return 1; - if (i == 0) - return 1; - case 'h': - case '!': - case 'i': - case 'a': - case 's': - case 'r': - break; - default: - return 1; - } - i++; - } - cmd = (cmd_command_t *)con_alloc_page_entry(CMD_MM_CMD); - - cmd->command = command; - cmd->name = name; - cmd->param = param; - cmd->description = description; - - ((SciEngine *)g_engine)->_console->con_hook_command(command, name, param, description); - - return 0; -} - -int con_hook_int(int *pointer, const char *name, const char *description) { - cmd_var_t *var; - - if (pointer == NULL) - return 1; - - if (description == NULL) - description = ""; - - var = (cmd_var_t *) con_alloc_page_entry(CMD_MM_VAR); - - var->var.intp = pointer; - var->name = name; - var->description = description; - - return 0; -} - -// Console commands and support functions - -static ResourceType parseResourceType(const char *resid) { - // Gets the resource number of a resource string, or returns -1 - ResourceType res = kResourceTypeInvalid; - - for (int i = 0; i < kResourceTypeInvalid; i++) - if (strcmp(getResourceTypeName((ResourceType)i), resid) == 0) - res = (ResourceType)i; - - return res; -} - -static void _cmd_print_command(cmd_mm_entry_t *data, int full) { - const char *paramseeker = ((cmd_command_t *)data)->param; - - if (full) { - sciprintf("SYNOPSIS\n\n %s (%s) ", data->name, paramseeker); - - while (*paramseeker) { - switch (*paramseeker) { - case '!': - break; - case 'i': - sciprintf(" (int)"); - break; - case 'a': - sciprintf(" (addr)"); - break; - case 's': - sciprintf(" (string)"); - break; - case 'h': - sciprintf(" (hexbyte)"); - break; - case '*': - sciprintf("*"); - break; - default: - sciprintf(" (Unknown(%c))", *paramseeker); - } - paramseeker++; - } - - sciprintf("\n\nDESCRIPTION\n\n %s", data->description); - } else - sciprintf(" %s", data->name); -} - -static void _cmd_print_var(cmd_mm_entry_t *data, int full) { - cmd_var_t *var = (cmd_var_t *) data; - if (full) - sciprintf("VALUE\n\n"); - sciprintf(" %s = %d\n", var->name, *(var->var.intp)); - - if (full) - sciprintf("\n\nDESCRIPTION\n\n %s", data->description); -} - -static void _cmd_print_page(cmd_mm_entry_t *data, int full) { - if (full) - sciprintf("\n\nDESCRIPTION\n\n %s\n", data->description); - else - sciprintf("%s\n", data->name); -} - -static int c_list(EngineState *s, const Common::Array<cmd_param_t> &cmdParams) { - if (_lists_need_sorting) - con_sort_all(); - - if (cmdParams.size() == 0) { - sciprintf("usage: list [type]\nwhere type is one of the following:\n" - "cmds - lists all commands\n" - "vars - lists all variables\n" - "docs - lists all misc. documentation\n" - "\n" - "[resource] - lists all [resource]s"); - } else if (cmdParams.size() == 1) { - const char *mm_subsects[3] = {"cmds", "vars", "docs"}; - int mm_found = -1; - int i; - - for (i = 0; i < 3; i++) - if (mm_subsects[i] && !strcmp(mm_subsects[i], cmdParams[0].str)) - mm_found = i; - - if (mm_found >= 0) - for (i = 0; i < cmd_mm[mm_found].entries; i++) - cmd_mm[mm_found].print((cmd_mm_entry_t *)(((byte *)cmd_mm[mm_found].data) + i * cmd_mm[mm_found].size_per_entry), 0); - else { - if (!s) { - sciprintf("You need a state to do that!\n"); - return 1; - } else { - ResourceType res = parseResourceType(cmdParams[0].str); - if (res == kResourceTypeInvalid) - sciprintf("Unknown resource type: '%s'\n", cmdParams[0].str); - else { - for (i = 0; i < sci_max_resource_nr[s->resmgr->_sciVersion]; i++) - if (s->resmgr->testResource(res, i)) - sciprintf("%s.%03d\n", getResourceTypeName((ResourceType)res), i); - } - } - } - } else - sciprintf("list can only be used with one argument"); - return 0; -} - -static int c_set(EngineState *s, const Common::Array<cmd_param_t> &cmdParams) { - cmd_var_t *var = (cmd_var_t *)cmd_mm_find(cmdParams[0].str, CMD_MM_VAR); - - if (var) - *(var->var.intp) = cmdParams[1].val; - - return 0; -} - -static int c_print(EngineState *s, const Common::Array<cmd_param_t> &cmdParams) { - cmd_var_t *var = (cmd_var_t *)cmd_mm_find(cmdParams[0].str, CMD_MM_VAR); - - if (var) - sciprintf("%d", *(var->var.intp)); - else - sciprintf("Not defined."); - - return 0; -} - -static int c_hexgrep(EngineState *s, const Common::Array<cmd_param_t> &cmdParams) { - int i, seeklen, resnr, resmax; - unsigned char *seekstr = NULL; - Resource *script = NULL; - char *dot = (char *)strchr(cmdParams[0].str, '.'); - ResourceType restype; - - if (NULL == s) { - fprintf(stderr, "console.c: c_hexgrep(): NULL passed for s\r\n"); - return(-1); - } - - seeklen = cmdParams.size() - 1; - seekstr = (unsigned char *)malloc(seeklen); - - if (NULL == seekstr) { - fprintf(stderr, "console.c: c_hexgrep(): malloc failed for seekstr\r\n"); - return(-1); - } - - for (i = 0; i < seeklen; i++) - seekstr[i] = (byte)cmdParams[i + 1].val; - - if (dot) { - *dot = 0; - resmax = resnr = atoi(dot + 1); - } else { - resnr = 0; - resmax = 999; - } - - restype = parseResourceType(cmdParams[0].str); - if (restype == kResourceTypeInvalid) { - sciprintf("Unknown resource type \"%s\"\n", cmdParams[0].str); - free(seekstr); - return 1; - } - - for (; resnr <= resmax; resnr++) - if ((script = s->resmgr->findResource(restype, resnr, 0))) { - unsigned int seeker = 0, seekerold = 0; - int comppos = 0; - int output_script_name = 0; - - while (seeker < script->size) { - if (script->data[seeker] == seekstr[comppos]) { - if (comppos == 0) - seekerold = seeker; - - comppos++; - - if (comppos == seeklen) { - comppos = 0; - seeker = seekerold + 1; - - if (!output_script_name) { - sciprintf("\nIn %s.%03d:\n", getResourceTypeName((ResourceType)restype), resnr); - output_script_name = 1; - } - sciprintf(" 0x%04x\n", seekerold); - } - } else - comppos = 0; - - seeker++; - } - } - - free(seekstr); - - return 0; -} - -} // End of namespace Sci diff --git a/engines/sci/engine/sciconsole.h b/engines/sci/engine/sciconsole.h deleted file mode 100644 index 718d30fb8f..0000000000 --- a/engines/sci/engine/sciconsole.h +++ /dev/null @@ -1,121 +0,0 @@ -/* 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. - * - * $URL$ - * $Id$ - * - */ - -/* Header file for the SCI console. -** Please note that the console does not use the priority field; the console -** should therefore be drawn after everything else has been drawn (with the -** possible exception of the mouse pointer). -*/ - -#ifndef SCI_SCICORE_SCICONSOLE_H -#define SCI_SCICORE_SCICONSOLE_H - -#include "common/scummsys.h" - -#include "sci/tools.h" -#include "sci/engine/state.h" -#include "sci/engine/vm_types.h" - -namespace Sci { - -struct gfx_pixmap_t; - -union cmd_param_t { - int32 val; - const char *str; - reg_t reg; -}; - - -typedef int (*ConCommand)(EngineState *s, const Common::Array<cmd_param_t> &cmdParams); - -/*** FUNCTION DEFINITIONS ***/ - -void con_init(); -/* Initializes the command parser -** Parameters: (void) -** Returns : (void) -** This function will initialize hook up a few commands to the parser. -** It must be called before cmdParse() is used. -*/ - - -void con_parse(EngineState *s, const char *command); -/* Parses a command and summons appropriate facilities to handle it -** Parameters: (EngineState *) s: The EngineState to use -** command: The command to execute -** Returns : (void) -*/ - - -int con_hook_command(ConCommand command, const char *name, const char *param, const char *description); -/* Adds a command to the parser's command list -** Parameters: command: The command to add -** name: The command's name -** param: A description of the parameters it takes -** description: A short description of what it does -** Returns : 0 if successful, 1 if appending failed because -** of an incorrect *param string, 'command'==0, or -** 'name' already being in use. -** A valid param string is either empty (no parameters allowed) -** or contains one of the following tokens: -** ! Special token: EngineState* must be set for this function to be called -** i (an int) -** s (a 'string' (char *)) -** h (a byte, described in hexadecimal digits) -** a (a heap address, register or object name) -** r (any register value) -** x* (an arbitrary (possibly 0) number of 'x' tokens) -** The '*' token may only be used as the last token of the list. -** Another way to specify optional parameters is by means of the -** '-opt:t' notation, which allows an optional parameter of type 't' -** to be specified as 'opt:<value>' when calling. See also the -** con_hasopt() and con_getopt() calls. -** -** Please note that the 'h' type does accept hexadecimal numbers greater -** than 0xff and less than 0x00, but clips them to this range. -** -** Example: "isi*" would define the function to take an int, a -** string, and an arbitrary number of ints as parameters (in that sequence). -** -** When the function is called, it can retrieve its parameters from cmd_params; -** the actual number of parameters is stored in cmd_paramlength. -** It is allowed to modify the char*s from a cmd_params[] element, as long -** as no element beyond strlen(cmd_params[x].str)+1 is accessed. -*/ - -int con_hook_int(int *pointer, const char *name, const char *description); -/* Adds an int to the list of modifyable ints. -** Parameters: pointer: Pointer to the int to add to the list -** name: Name for this value -** description: A short description for the value -** Returns : 0 on success, 1 if either value has already been added -** or if name is already being used for a different value. -** The internal list of int references is used by some of the basic commands. -*/ - -} // End of namespace Sci - -#endif // SCI_SCICORE_SCICONSOLE_H diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index f066dcbe2c..2ddac786c9 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -32,7 +32,6 @@ #include "sci/engine/kernel_types.h" #include "sci/engine/kernel.h" #include "sci/engine/savegame.h" -#include "sci/engine/sciconsole.h" #include "sci/gfx/gfx_widgets.h" #include "sci/gfx/gfx_gui.h" #include "sci/gfx/gfx_state_internal.h" // required for GfxContainer, GfxPort, GfxVisual @@ -82,6 +81,24 @@ int _kdebug_cheap_soundcue_hack = -1; char inputbuf[256] = ""; +union cmd_param_t { + int32 val; + const char *str; + reg_t reg; +}; + +typedef int (*ConCommand)(EngineState *s, const Common::Array<cmd_param_t> &cmdParams); + +struct cmd_mm_entry_t { + const char *name; + const char *description; +}; // All later structures must "extend" this + +struct cmd_command_t : public cmd_mm_entry_t { + ConCommand command; + const char *param; +}; + #if 0 // Unused #define LOOKUP_SPECIES(species) (\ @@ -89,6 +106,12 @@ char inputbuf[256] = ""; + s->_classtable[species].class_offset) #endif +// Dummy function, so that it compiles +int con_hook_command(ConCommand command, const char *name, const char *param, const char *description) { + + return 0; +} + static const char *_debug_get_input() { char newinpbuf[256]; @@ -3200,7 +3223,7 @@ void script_debug(EngineState *s, reg_t *pc, StackPtr *sp, StackPtr *pp, reg_t * " gc-list-freeable.1, gc-list-reachable.1,\n" " gc.1, gc-normalise.1"); - +/* con_hook_int(&script_debug_flag, "script_debug_flag", "Set != 0 to enable debugger\n"); con_hook_int(&script_checkloads_flag, "script_checkloads_flag", "Set != 0 to display information\n" " when scripts are loaded or unloaded"); @@ -3213,6 +3236,7 @@ void script_debug(EngineState *s, reg_t *pc, StackPtr *sp, StackPtr *pp, reg_t * con_hook_int(&script_gc_interval, "gc-interval", "Number of kernel calls in between gcs"); con_hook_int(&debug_sleeptime_factor, "sleep-factor", "Factor to multiply with wait times\n Set to 0 to speed up games"); +*/ } // If commands were not hooked up } @@ -3232,8 +3256,8 @@ void script_debug(EngineState *s, reg_t *pc, StackPtr *sp, StackPtr *pp, reg_t * if (commandstring && (commandstring[0] == '.' || commandstring[0] == ':')) skipfirst = 1; - if (commandstring && commandstring[0] != ':') - con_parse(s, commandstring + skipfirst); + //if (commandstring && commandstring[0] != ':') + // con_parse(s, commandstring + skipfirst); sciprintf("\n"); // Resume music playing diff --git a/engines/sci/module.mk b/engines/sci/module.mk index 5d217e8a42..dbb1d4f87d 100644 --- a/engines/sci/module.mk +++ b/engines/sci/module.mk @@ -30,7 +30,6 @@ MODULE_OBJS = \ engine/message.o \ engine/said.o \ engine/savegame.o \ - engine/sciconsole.o \ engine/script.o \ engine/scriptdebug.o \ engine/seg_manager.o \ diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 58fc65270e..9aee1d050c 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -31,7 +31,6 @@ #include "sci/sci.h" #include "sci/console.h" -#include "sci/engine/sciconsole.h" #include "sci/engine/state.h" #include "sci/engine/kernel.h" diff --git a/engines/sci/tools.cpp b/engines/sci/tools.cpp index 3eb27017eb..573938bda4 100644 --- a/engines/sci/tools.cpp +++ b/engines/sci/tools.cpp @@ -25,7 +25,6 @@ #include "sci/tools.h" #include "sci/engine/state.h" -#include "sci/engine/sciconsole.h" #include "sci/sci.h" // For _console only #include "sci/console.h" // For _console only |