diff options
author | Filippos Karapetis | 2012-06-23 21:09:03 +0300 |
---|---|---|
committer | Filippos Karapetis | 2012-06-23 21:45:22 +0300 |
commit | c075aafddb0dba00878f6382a6e277dbaab45e10 (patch) | |
tree | 8b6bc3d22f62166ccd6d2101084e3a83fd21a84e /engines | |
parent | d78ed6f6ad2c27732f1e36759303b0fa9d310190 (diff) | |
download | scummvm-rg350-c075aafddb0dba00878f6382a6e277dbaab45e10.tar.gz scummvm-rg350-c075aafddb0dba00878f6382a6e277dbaab45e10.tar.bz2 scummvm-rg350-c075aafddb0dba00878f6382a6e277dbaab45e10.zip |
SCI: Add support for the debug opcode "file" in our script dissassembler
Also set the correct name for the debug opcode "line"
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/scriptdebug.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index d8c05ab04b..04cbf1d97c 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -50,7 +50,7 @@ const char *opcodeNames[] = { "lea", "selfID", "dummy", "pprev", "pToa", "aTop", "pTos", "sTop", "ipToa", "dpToa", "ipTos", "dpTos", "lofsa", "lofss", "push0", - "push1", "push2", "pushSelf", "dummy", "lag", + "push1", "push2", "pushSelf", "line", "lag", "lal", "lat", "lap", "lsg", "lsl", "lst", "lsp", "lagi", "lali", "lati", "lapi", "lsgi", "lsli", "lsti", "lspi", @@ -97,10 +97,19 @@ reg_t disassemble(EngineState *s, reg_t pos, bool printBWTag, bool printBytecode uint bytecount = readPMachineInstruction(scr + pos.getOffset(), opsize, opparams); const byte opcode = opsize >> 1; - opsize &= 1; // byte if true, word if false - debugN("%04x:%04x: ", PRINT_REG(pos)); + if (opcode == op_pushSelf) { // 0x3e (62) + if ((opsize & 1) && g_sci->getGameId() != GID_FANMADE) { + // Debug opcode op_file + debugN("file \"%s\"\n", scr + pos.getOffset() + 1); // +1: op_pushSelf size + retval.incOffset(bytecount - 1); + return retval; + } + } + + opsize &= 1; // byte if true, word if false + if (printBytecode) { if (pos.getOffset() + bytecount > scr_size) { warning("Operation arguments extend beyond end of script"); |