From 2c950b321c3354144debd6a7f5e7d19cbc6c3a32 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 7 Jun 2010 15:14:58 +0000 Subject: Fixed regression from commit #49465 - there are in fact two restAdjust variables, the current and global one svn-id: r49486 --- engines/sci/engine/scriptdebug.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/sci/engine/scriptdebug.cpp') diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 159c278e8c..b465ab3d4e 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -205,12 +205,12 @@ reg_t disassemble(EngineState *s, reg_t pos, int print_bw_tag, int print_bytecod if (pos == s->xs->addr.pc) { // Extra information if debugging the current opcode if (opcode == op_callk) { - int stackframe = (scr[pos.offset + 2] >> 1) + (s->restAdjust); + int stackframe = (scr[pos.offset + 2] >> 1) + (s->restAdjustCur); int argc = ((s->xs->sp)[- stackframe - 1]).offset; bool oldScriptHeader = (getSciVersion() == SCI_VERSION_0_EARLY); if (!oldScriptHeader) - argc += (s->restAdjust); + argc += (s->restAdjustCur); printf(" Kernel params: ("); @@ -221,7 +221,7 @@ reg_t disassemble(EngineState *s, reg_t pos, int print_bw_tag, int print_bytecod } printf(")\n"); } else if ((opcode == op_send) || (opcode == op_self)) { - int restmod = s->restAdjust; + int restmod = s->restAdjustCur; int stackframe = (scr[pos.offset + 1] >> 1) + restmod; reg_t *sb = s->xs->sp; uint16 selector; -- cgit v1.2.3 From 10aeb33a4253b5df05f19a9bfabc3cc374db096c Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 9 Jun 2010 07:32:17 +0000 Subject: Merged restAdjust and restAdjustCur, as we don't save the restAdjust modifier inside saved games (rightfully so). Also, the segment manager is now reset inside the main loop, when the game is restarted, not in game_exit() svn-id: r49533 --- engines/sci/engine/scriptdebug.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/sci/engine/scriptdebug.cpp') diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index b465ab3d4e..159c278e8c 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -205,12 +205,12 @@ reg_t disassemble(EngineState *s, reg_t pos, int print_bw_tag, int print_bytecod if (pos == s->xs->addr.pc) { // Extra information if debugging the current opcode if (opcode == op_callk) { - int stackframe = (scr[pos.offset + 2] >> 1) + (s->restAdjustCur); + int stackframe = (scr[pos.offset + 2] >> 1) + (s->restAdjust); int argc = ((s->xs->sp)[- stackframe - 1]).offset; bool oldScriptHeader = (getSciVersion() == SCI_VERSION_0_EARLY); if (!oldScriptHeader) - argc += (s->restAdjustCur); + argc += (s->restAdjust); printf(" Kernel params: ("); @@ -221,7 +221,7 @@ reg_t disassemble(EngineState *s, reg_t pos, int print_bw_tag, int print_bytecod } printf(")\n"); } else if ((opcode == op_send) || (opcode == op_self)) { - int restmod = s->restAdjustCur; + int restmod = s->restAdjust; int stackframe = (scr[pos.offset + 1] >> 1) + restmod; reg_t *sb = s->xs->sp; uint16 selector; -- cgit v1.2.3 From 93f33c7dab009e8ff82fac195e7b6d02e66ab755 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 10 Jun 2010 11:18:10 +0000 Subject: Resolved a FIXME with getSciLanguage(), by creating a separate setter. Also, some camelCase changes svn-id: r49568 --- engines/sci/engine/scriptdebug.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/sci/engine/scriptdebug.cpp') diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 159c278e8c..436eaafec5 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -284,7 +284,7 @@ void script_debug(EngineState *s) { #if 0 if (sci_debug_flags & _DEBUG_FLAG_LOGGING) { - printf("%d: acc=%04x:%04x ", script_step_counter, PRINT_REG(s->r_acc)); + printf("%d: acc=%04x:%04x ", scriptStepCounter, PRINT_REG(s->r_acc)); disassemble(s, s->xs->addr.pc, 0, 1); if (s->seeking == kDebugSeekGlobal) printf("Global %d (0x%x) = %04x:%04x\n", s->seekSpecial, @@ -351,7 +351,7 @@ void script_debug(EngineState *s) { } } - printf("Step #%d\n", s->script_step_counter); + printf("Step #%d\n", s->scriptStepCounter); disassemble(s, s->xs->addr.pc, 0, 1); if (g_debugState.runningStep) { -- cgit v1.2.3 From cfcbdf86569dac5856d364316caa5b0a57713fd7 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 17 Jun 2010 23:13:30 +0000 Subject: SCI: Remove selector_name function, some cleanup svn-id: r49966 --- engines/sci/engine/scriptdebug.cpp | 56 +++++++++++++++----------------------- 1 file changed, 22 insertions(+), 34 deletions(-) (limited to 'engines/sci/engine/scriptdebug.cpp') diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 436eaafec5..d829b01c31 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -63,9 +63,7 @@ const char *opcodeNames[] = { "-sli", "-sti", "-spi" }; -extern const char *selector_name(EngineState *s, int selector); - -DebugState g_debugState; +DebugState g_debugState; // FIXME: Avoid non-const global vars // 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, int print_bw_tag, int print_bytecode) { @@ -197,7 +195,7 @@ reg_t disassemble(EngineState *s, reg_t pos, int print_bw_tag, int print_bytecod if (!obj) warning("Attempted to reference on non-object at %04x:%04x", PRINT_REG(s->xs->objp)); else - printf(" (%s)", selector_name(s, obj->propertyOffsetToId(s->_segMan, scr[pos.offset + 1]))); + printf(" (%s)", g_sci->getKernel()->getSelectorName(obj->propertyOffsetToId(s->_segMan, scr[pos.offset + 1])).c_str()); } } @@ -244,7 +242,7 @@ reg_t disassemble(EngineState *s, reg_t pos, int print_bw_tag, int print_bytecod if (!name) name = ""; - printf(" %s::%s[", name, (selector > kernel->getSelectorNamesSize()) ? "" : selector_name(s, selector)); + printf(" %s::%s[", name, g_sci->getKernel()->getSelectorName(selector).c_str()); switch (lookupSelector(s->_segMan, called_obj_addr, selector, 0, &fun_ref)) { case kSelectorMethod: @@ -314,17 +312,15 @@ void script_debug(EngineState *s) { if (paramb1 != g_debugState.seekSpecial) return; - case kDebugSeekCallk: { + case kDebugSeekCallk: if (op != op_callk) return; break; - } - case kDebugSeekLevelRet: { + case kDebugSeekLevelRet: if ((op != op_ret) || (g_debugState.seekLevel < (int)s->_executionStack.size()-1)) return; break; - } case kDebugSeekGlobal: if (op < op_sag) @@ -361,7 +357,7 @@ void script_debug(EngineState *s) { g_debugState.debugging = false; - Console *con = ((Sci::SciEngine*)g_engine)->getSciDebugger(); + Console *con = ((Sci::SciEngine *)g_engine)->getSciDebugger(); con->attach(); } @@ -491,19 +487,17 @@ void Kernel::dissectScript(int scriptNumber, Vocabulary *vocab) { dumpScriptObject((char *)script->data, seeker, objsize); break; - case SCI_OBJ_CODE: { + case SCI_OBJ_CODE: printf("Code\n"); Common::hexdump(script->data + seeker, objsize - 4, 16, seeker); - }; - break; + break; - case 3: { + case 3: printf("\n"); Common::hexdump(script->data + seeker, objsize - 4, 16, seeker); - }; - break; + break; - case SCI_OBJ_SAID: { + case SCI_OBJ_SAID: printf("Said\n"); Common::hexdump(script->data + seeker, objsize - 4, 16, seeker); @@ -551,46 +545,40 @@ void Kernel::dissectScript(int scriptNumber, Vocabulary *vocab) { } } printf("\n"); - } - break; + break; - case SCI_OBJ_STRINGS: { + case SCI_OBJ_STRINGS: printf("Strings\n"); while (script->data [seeker]) { printf("%04x: %s\n", seeker, script->data + seeker); seeker += strlen((char *)script->data + seeker) + 1; } seeker++; // the ending zero byte - }; - break; + break; case SCI_OBJ_CLASS: dumpScriptClass((char *)script->data, seeker, objsize); break; - case SCI_OBJ_EXPORTS: { + case SCI_OBJ_EXPORTS: printf("Exports\n"); Common::hexdump((unsigned char *)script->data + seeker, objsize - 4, 16, seeker); - }; - break; + break; - case SCI_OBJ_POINTERS: { + case SCI_OBJ_POINTERS: printf("Pointers\n"); Common::hexdump(script->data + seeker, objsize - 4, 16, seeker); - }; - break; + break; - case 9: { + case 9: printf("\n"); Common::hexdump(script->data + seeker, objsize - 4, 16, seeker); - }; - break; + break; - case SCI_OBJ_LOCALVARS: { + case SCI_OBJ_LOCALVARS: printf("Local vars\n"); Common::hexdump(script->data + seeker, objsize - 4, 16, seeker); - }; - break; + break; default: printf("Unsupported!\n"); -- cgit v1.2.3 From 4653153910ee2186e914f5f4717e212053adef54 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Sun, 27 Jun 2010 19:58:32 +0000 Subject: SCI: added new command "p" / "stepover" to execute one command, but skip send/calls processing. single-step is now "trace" (alias "s" and "t"), stepping till ret is "step_ret" (alias "pret"), removed unused kDebugSeek svn-id: r50388 --- engines/sci/engine/scriptdebug.cpp | 98 ++++++++++++++++++++------------------ 1 file changed, 51 insertions(+), 47 deletions(-) (limited to 'engines/sci/engine/scriptdebug.cpp') diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index d829b01c31..b8a0987865 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -296,55 +296,59 @@ void script_debug(EngineState *s) { #endif if (g_debugState.seeking && !g_debugState.breakpointWasHit) { // Are we looking for something special? - SegmentObj *mobj = s->_segMan->getSegment(s->xs->addr.pc.segment, SEG_TYPE_SCRIPT); - - if (mobj) { - Script *scr = (Script *)mobj; - byte *code_buf = scr->_buf; - int code_buf_size = scr->getBufSize(); - int opcode = s->xs->addr.pc.offset >= code_buf_size ? 0 : code_buf[s->xs->addr.pc.offset]; - int op = opcode >> 1; - int paramb1 = s->xs->addr.pc.offset + 1 >= code_buf_size ? 0 : code_buf[s->xs->addr.pc.offset + 1]; - int paramf1 = (opcode & 1) ? paramb1 : (s->xs->addr.pc.offset + 2 >= code_buf_size ? 0 : (int16)READ_SCI11ENDIAN_UINT16(code_buf + s->xs->addr.pc.offset + 1)); - - switch (g_debugState.seeking) { - case kDebugSeekSpecialCallk: - if (paramb1 != g_debugState.seekSpecial) - return; - - case kDebugSeekCallk: - if (op != op_callk) - return; - break; - - case kDebugSeekLevelRet: - if ((op != op_ret) || (g_debugState.seekLevel < (int)s->_executionStack.size()-1)) - return; - break; - - case kDebugSeekGlobal: - if (op < op_sag) - return; - if ((op & 0x3) > 1) - return; // param or temp - if ((op & 0x3) && s->_executionStack.back().local_segment > 0) - return; // locals and not running in script.000 - if (paramf1 != g_debugState.seekSpecial) - return; // CORRECT global? - break; - - case kDebugSeekSO: - // FIXME: Unhandled? - break; - - case kDebugSeekNothing: - // We seek nothing, so just continue - break; - } - + if (g_debugState.seeking == kDebugSeekStepOver) { + // are we above seek-level? resume then + if (g_debugState.seekLevel < (int)s->_executionStack.size()) + return; g_debugState.seeking = kDebugSeekNothing; - // OK, found whatever we were looking for } + + if (g_debugState.seeking != kDebugSeekNothing) { + SegmentObj *mobj = s->_segMan->getSegment(s->xs->addr.pc.segment, SEG_TYPE_SCRIPT); + + if (mobj) { + Script *scr = (Script *)mobj; + byte *code_buf = scr->_buf; + int code_buf_size = scr->getBufSize(); + int opcode = s->xs->addr.pc.offset >= code_buf_size ? 0 : code_buf[s->xs->addr.pc.offset]; + int op = opcode >> 1; + int paramb1 = s->xs->addr.pc.offset + 1 >= code_buf_size ? 0 : code_buf[s->xs->addr.pc.offset + 1]; + int paramf1 = (opcode & 1) ? paramb1 : (s->xs->addr.pc.offset + 2 >= code_buf_size ? 0 : (int16)READ_SCI11ENDIAN_UINT16(code_buf + s->xs->addr.pc.offset + 1)); + + switch (g_debugState.seeking) { + case kDebugSeekSpecialCallk: + if (paramb1 != g_debugState.seekSpecial) + return; + + case kDebugSeekCallk: + if (op != op_callk) + return; + break; + + case kDebugSeekLevelRet: + if ((op != op_ret) || (g_debugState.seekLevel < (int)s->_executionStack.size()-1)) + return; + break; + + case kDebugSeekGlobal: + if (op < op_sag) + return; + if ((op & 0x3) > 1) + return; // param or temp + if ((op & 0x3) && s->_executionStack.back().local_segment > 0) + return; // locals and not running in script.000 + if (paramf1 != g_debugState.seekSpecial) + return; // CORRECT global? + break; + + default: + break; + } + + g_debugState.seeking = kDebugSeekNothing; + } + } + // OK, found whatever we were looking for } printf("Step #%d\n", s->scriptStepCounter); -- cgit v1.2.3 From 1faebccce25ac422f65ab9616b9a7ecb647894a8 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 27 Jun 2010 21:29:35 +0000 Subject: Cleanup, remove unused/obsolete code svn-id: r50403 --- engines/sci/engine/scriptdebug.cpp | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'engines/sci/engine/scriptdebug.cpp') diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index b8a0987865..d730856332 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -278,23 +278,6 @@ reg_t disassemble(EngineState *s, reg_t pos, int print_bw_tag, int print_bytecod void script_debug(EngineState *s) { - // Do we support a separate console? - -#if 0 - if (sci_debug_flags & _DEBUG_FLAG_LOGGING) { - printf("%d: acc=%04x:%04x ", scriptStepCounter, PRINT_REG(s->r_acc)); - disassemble(s, s->xs->addr.pc, 0, 1); - if (s->seeking == kDebugSeekGlobal) - printf("Global %d (0x%x) = %04x:%04x\n", s->seekSpecial, - s->seekSpecial, PRINT_REG(s->script_000->_localsBlock->_locals[s->seekSpecial])); - } -#endif - -#if 0 - if (!g_debugState.debugging) - return; -#endif - if (g_debugState.seeking && !g_debugState.breakpointWasHit) { // Are we looking for something special? if (g_debugState.seeking == kDebugSeekStepOver) { // are we above seek-level? resume then -- cgit v1.2.3 From 30218a2c324bc67f724100051ab9884a351928fb Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 28 Jun 2010 11:22:20 +0000 Subject: SCI: Make Script member vars private; add const qualifiers Only three Script members remain public (for now) svn-id: r50428 --- engines/sci/engine/scriptdebug.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/sci/engine/scriptdebug.cpp') diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index d730856332..4813e083fd 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -69,7 +69,7 @@ DebugState g_debugState; // FIXME: Avoid non-const global vars reg_t disassemble(EngineState *s, reg_t pos, int print_bw_tag, int print_bytecode) { SegmentObj *mobj = s->_segMan->getSegment(pos.segment, SEG_TYPE_SCRIPT); Script *script_entity = NULL; - byte *scr; + const byte *scr; int scr_size; reg_t retval = make_reg(pos.segment, pos.offset + 1); uint16 param_value; @@ -82,7 +82,7 @@ reg_t disassemble(EngineState *s, reg_t pos, int print_bw_tag, int print_bytecod } else script_entity = (Script *)mobj; - scr = script_entity->_buf; + scr = script_entity->getBuf(); scr_size = script_entity->getBufSize(); if (pos.offset >= scr_size) { @@ -291,7 +291,7 @@ void script_debug(EngineState *s) { if (mobj) { Script *scr = (Script *)mobj; - byte *code_buf = scr->_buf; + const byte *code_buf = scr->getBuf(); int code_buf_size = scr->getBufSize(); int opcode = s->xs->addr.pc.offset >= code_buf_size ? 0 : code_buf[s->xs->addr.pc.offset]; int op = opcode >> 1; -- cgit v1.2.3 From 1d3a0f6decd54b017d2ca55a95048de4afdbd868 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 12 Jul 2010 23:20:33 +0000 Subject: SCI: Turn global object g_debugState into SciEngine member var svn-id: r50836 --- engines/sci/engine/scriptdebug.cpp | 43 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 22 deletions(-) (limited to 'engines/sci/engine/scriptdebug.cpp') diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 4813e083fd..915a6fa994 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -63,8 +63,6 @@ const char *opcodeNames[] = { "-sli", "-sti", "-spi" }; -DebugState g_debugState; // FIXME: Avoid non-const global vars - // 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, int print_bw_tag, int print_bytecode) { SegmentObj *mobj = s->_segMan->getSegment(pos.segment, SEG_TYPE_SCRIPT); @@ -277,30 +275,32 @@ reg_t disassemble(EngineState *s, reg_t pos, int print_bw_tag, int print_bytecod } -void script_debug(EngineState *s) { - if (g_debugState.seeking && !g_debugState.breakpointWasHit) { // Are we looking for something special? - if (g_debugState.seeking == kDebugSeekStepOver) { +void SciEngine::scriptDebug() { + EngineState *s = _gamestate; + if (_debugState.seeking && !_debugState.breakpointWasHit) { // Are we looking for something special? + if (_debugState.seeking == kDebugSeekStepOver) { // are we above seek-level? resume then - if (g_debugState.seekLevel < (int)s->_executionStack.size()) + if (_debugState.seekLevel < (int)s->_executionStack.size()) return; - g_debugState.seeking = kDebugSeekNothing; + _debugState.seeking = kDebugSeekNothing; } - if (g_debugState.seeking != kDebugSeekNothing) { - SegmentObj *mobj = s->_segMan->getSegment(s->xs->addr.pc.segment, SEG_TYPE_SCRIPT); + if (_debugState.seeking != kDebugSeekNothing) { + const reg_t pc = s->xs->addr.pc; + SegmentObj *mobj = s->_segMan->getSegment(pc.segment, SEG_TYPE_SCRIPT); if (mobj) { Script *scr = (Script *)mobj; const byte *code_buf = scr->getBuf(); int code_buf_size = scr->getBufSize(); - int opcode = s->xs->addr.pc.offset >= code_buf_size ? 0 : code_buf[s->xs->addr.pc.offset]; + int opcode = pc.offset >= code_buf_size ? 0 : code_buf[pc.offset]; int op = opcode >> 1; - int paramb1 = s->xs->addr.pc.offset + 1 >= code_buf_size ? 0 : code_buf[s->xs->addr.pc.offset + 1]; - int paramf1 = (opcode & 1) ? paramb1 : (s->xs->addr.pc.offset + 2 >= code_buf_size ? 0 : (int16)READ_SCI11ENDIAN_UINT16(code_buf + s->xs->addr.pc.offset + 1)); + int paramb1 = pc.offset + 1 >= code_buf_size ? 0 : code_buf[pc.offset + 1]; + int paramf1 = (opcode & 1) ? paramb1 : (pc.offset + 2 >= code_buf_size ? 0 : (int16)READ_SCI11ENDIAN_UINT16(code_buf + pc.offset + 1)); - switch (g_debugState.seeking) { + switch (_debugState.seeking) { case kDebugSeekSpecialCallk: - if (paramb1 != g_debugState.seekSpecial) + if (paramb1 != _debugState.seekSpecial) return; case kDebugSeekCallk: @@ -309,7 +309,7 @@ void script_debug(EngineState *s) { break; case kDebugSeekLevelRet: - if ((op != op_ret) || (g_debugState.seekLevel < (int)s->_executionStack.size()-1)) + if ((op != op_ret) || (_debugState.seekLevel < (int)s->_executionStack.size()-1)) return; break; @@ -320,7 +320,7 @@ void script_debug(EngineState *s) { return; // param or temp if ((op & 0x3) && s->_executionStack.back().local_segment > 0) return; // locals and not running in script.000 - if (paramf1 != g_debugState.seekSpecial) + if (paramf1 != _debugState.seekSpecial) return; // CORRECT global? break; @@ -328,7 +328,7 @@ void script_debug(EngineState *s) { break; } - g_debugState.seeking = kDebugSeekNothing; + _debugState.seeking = kDebugSeekNothing; } } // OK, found whatever we were looking for @@ -337,15 +337,14 @@ void script_debug(EngineState *s) { printf("Step #%d\n", s->scriptStepCounter); disassemble(s, s->xs->addr.pc, 0, 1); - if (g_debugState.runningStep) { - g_debugState.runningStep--; + if (_debugState.runningStep) { + _debugState.runningStep--; return; } - g_debugState.debugging = false; + _debugState.debugging = false; - Console *con = ((Sci::SciEngine *)g_engine)->getSciDebugger(); - con->attach(); + _console->attach(); } void Kernel::dumpScriptObject(char *data, int seeker, int objsize) { -- cgit v1.2.3 From e000d2865450090d28f6a72608b963ece6435d4a Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Sat, 17 Jul 2010 12:06:31 +0000 Subject: SCI: fix debugging code of parser, add 0xffe special group into debug support svn-id: r50956 --- engines/sci/engine/scriptdebug.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/sci/engine/scriptdebug.cpp') diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 915a6fa994..4521995123 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -489,7 +489,7 @@ void Kernel::dissectScript(int scriptNumber, Vocabulary *vocab) { printf("%04x: ", seeker); while (seeker < _seeker) { - unsigned char nextitem = script->data [seeker++]; + uint16 nextitem = script->data [seeker++]; if (nextitem == 0xFF) printf("\n%04x: ", seeker); else if (nextitem >= 0xF0) { -- cgit v1.2.3 From 63c945f93ae01d046b092e783154d57609d68a79 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Sat, 24 Jul 2010 11:59:40 +0000 Subject: SCI: fix warning and remove duplicate code svn-id: r51243 --- engines/sci/engine/scriptdebug.cpp | 43 +------------------------------------- 1 file changed, 1 insertion(+), 42 deletions(-) (limited to 'engines/sci/engine/scriptdebug.cpp') diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 4521995123..9c08526fbb 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -488,48 +488,7 @@ void Kernel::dissectScript(int scriptNumber, Vocabulary *vocab) { Common::hexdump(script->data + seeker, objsize - 4, 16, seeker); printf("%04x: ", seeker); - while (seeker < _seeker) { - uint16 nextitem = script->data [seeker++]; - if (nextitem == 0xFF) - printf("\n%04x: ", seeker); - else if (nextitem >= 0xF0) { - switch (nextitem) { - case 0xf0: - printf(", "); - break; - case 0xf1: - printf("& "); - break; - case 0xf2: - printf("/ "); - break; - case 0xf3: - printf("( "); - break; - case 0xf4: - printf(") "); - break; - case 0xf5: - printf("[ "); - break; - case 0xf6: - printf("] "); - break; - case 0xf7: - printf("# "); - break; - case 0xf8: - printf("< "); - break; - case 0xf9: - printf("> "); - break; - } - } else { - nextitem = nextitem << 8 | script->data [seeker++]; - printf("%s[%03x] ", vocab->getAnyWordFromGroup(nextitem), nextitem); - } - } + vocab->debugDecipherSaidBlock(script->data + seeker); printf("\n"); break; -- cgit v1.2.3