From bd2bfe85c97189e72199e5d0554ec4bd192a80b2 Mon Sep 17 00:00:00 2001 From: md5 Date: Fri, 13 May 2011 16:12:52 +0300 Subject: SCI: Don't include several debug tables when REDUCE_MEMORY_USAGE is defined --- engines/sci/engine/scriptdebug.cpp | 7 +++++++ engines/sci/engine/vm.cpp | 2 ++ 2 files changed, 9 insertions(+) (limited to 'engines/sci/engine') diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 77bea5ba68..16098ab275 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -31,6 +31,10 @@ namespace Sci { +// This table is only used for debugging. Don't include it for devices +// with not enough available memory (e.g. phones), where REDUCE_MEMORY_USAGE +// is defined +#ifndef REDUCE_MEMORY_USAGE const char *opcodeNames[] = { "bnot", "add", "sub", "mul", "div", "mod", "shr", "shl", "xor", "and", @@ -59,6 +63,7 @@ const char *opcodeNames[] = { "-agi", "-ali", "-ati", "-api", "-sgi", "-sli", "-sti", "-spi" }; +#endif // REDUCE_MEMORY_USAGE // Disassembles one command from the heap, returns address of next command or 0 if a ret was encountered. reg_t disassemble(EngineState *s, reg_t pos, bool printBWTag, bool printBytecode) { @@ -110,7 +115,9 @@ reg_t disassemble(EngineState *s, reg_t pos, bool printBWTag, bool printBytecode if (printBWTag) debugN("[%c] ", opsize ? 'B' : 'W'); +#ifndef REDUCE_MEMORY_USAGE debugN("%s", opcodeNames[opcode]); +#endif i = 0; while (g_opcode_formats[opcode][i]) { diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 25b13020ee..499574957e 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -114,7 +114,9 @@ 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)) { -- cgit v1.2.3