diff options
Diffstat (limited to 'saga/sdebug.cpp')
-rw-r--r-- | saga/sdebug.cpp | 71 |
1 files changed, 14 insertions, 57 deletions
diff --git a/saga/sdebug.cpp b/saga/sdebug.cpp index ee86db0913..e0b35d370c 100644 --- a/saga/sdebug.cpp +++ b/saga/sdebug.cpp @@ -65,10 +65,10 @@ int Script::SDebugPrintInstr(SCRIPT_THREAD *thread) { tl_e.string = disp_buf; tl_e.display = 1; - MemoryReadStream/*Endian*/ readS(currentScript()->bytecode->bytecode_p + MemoryReadStream readS(currentScript()->bytecode->bytecode_p + thread->i_offset, currentScript()->bytecode->bytecode_len - - thread->i_offset/*, IS_BIG_ENDIAN*/); + - thread->i_offset); in_char = readS.readByte(); sprintf(tmp_buf, "%04lX | %02X | ", thread->i_offset, in_char); strncat(disp_buf, tmp_buf, SD_DISPLAY_LEN); @@ -219,46 +219,20 @@ int Script::SDebugPrintInstr(SCRIPT_THREAD *thread) { } break; // Call function - case 0x19: - case 0x18: - { - int func_num; - int param; - - SD_ADDTXT("CALL | "); - func_num = readS.readByte(); - sprintf(tmp_buf, "%02X ", func_num); - SD_ADDTXT(tmp_buf); - param = readS.readUint16LE(); - sprintf(tmp_buf, "%04X ", param); - SD_ADDTXT(tmp_buf); - } + case opCcall: + SD_ADDTXT("opCall"); break; - // Begin subscript - case 0x1A: - { - int param; - - SD_ADDTXT("ENTR | "); - param = readS.readUint16LE(); - sprintf(tmp_buf, "%04X ", param); - SD_ADDTXT(tmp_buf); -/* - for(i = 0 ; i < script_list->n_scripts ; i++) { - if(op_offset == script_list->scripts[i].offset) { - debug(2, "; Entrypoint \"%s\".", script_list->scriptl_p + script_list->scripts[i].name_offset); - break; - } - } -*/ - } + case opCcallV: + SD_ADDTXT("opCallV"); break; - case 0x1B: - SD_ADDTXT("??? "); + case opEnter: + SD_ADDTXT("opEnter"); + break; + case opReturn: + SD_ADDTXT("opReturn"); break; - // End subscript - case 0x1C: - SD_ADDTXT("EXIT |"); + case opReturnV: + SD_ADDTXT("opReturnV"); break; // Unconditional jump case 0x1D: @@ -453,20 +427,7 @@ int Script::SDebugPrintInstr(SCRIPT_THREAD *thread) { SD_ADDTXT("LXOR |"); break; case opSpeak: - { - int stringsCount; - uint16 actorId; - int speechFlags; - - SD_ADDTXT("opSpeak | "); - stringsCount = readS.readByte(); - actorId = readS.readUint16LE(); - speechFlags = readS.readByte(); - // ignored ? - readS.readUint16LE(); - sprintf(tmp_buf, "%02X %04X %02X", stringsCount, actorId, speechFlags); - SD_ADDTXT(tmp_buf); - } + SD_ADDTXT("opSpeak"); break; case 0x54: SD_ADDTXT("DLGS |"); @@ -506,10 +467,6 @@ int Script::SDebugPrintInstr(SCRIPT_THREAD *thread) { SD_ADDTXT(tmp_buf); } break; - default: - sprintf(tmp_buf, "Invalid opcode.\n"); - SD_ADDTXT(tmp_buf); - break; } _dbg_txtentry = _vm->textAddEntry(si.text_list, &tl_e); |