aboutsummaryrefslogtreecommitdiff
path: root/scumm/script.cpp
diff options
context:
space:
mode:
authorJonathan Gray2003-04-20 08:04:27 +0000
committerJonathan Gray2003-04-20 08:04:27 +0000
commitf1353701f80095ecb1e0a1c3efa0de031045c571 (patch)
tree44ba0a3bf0603274a819fd2e393565b9a7e2d925 /scumm/script.cpp
parentc597d0d4d6c989dea6631365466c2b32d394bb6e (diff)
downloadscummvm-rg350-f1353701f80095ecb1e0a1c3efa0de031045c571.tar.gz
scummvm-rg350-f1353701f80095ecb1e0a1c3efa0de031045c571.tar.bz2
scummvm-rg350-f1353701f80095ecb1e0a1c3efa0de031045c571.zip
add stack tracing option to debugger
svn-id: r7025
Diffstat (limited to 'scumm/script.cpp')
-rw-r--r--scumm/script.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/scumm/script.cpp b/scumm/script.cpp
index c6e47e19e5..7552675fd0 100644
--- a/scumm/script.cpp
+++ b/scumm/script.cpp
@@ -277,16 +277,29 @@ void Scumm::getScriptEntryPoint() {
/* Execute a script - Read opcode, and execute it from the table */
void Scumm::executeScript() {
+ int c;
while (_currentScript != 0xFF) {
+
+ if (_showStack == true) {
+ printf("Stack:");
+ for (c=0; c < _scummStackPos; c++) {
+ printf(" %d", _scummStack[c]);
+ }
+ printf("\n");
+ }
_opcode = fetchScriptByte();
vm.slot[_currentScript].didexec = 1;
- debug(7, "Script %d, offset 0x%x: [%X] %s()",
+ debug(7, " Script %d, offset 0x%x: [%X] %s()",
vm.slot[_currentScript].number,
_scriptPointer - _scriptOrgPointer,
_opcode,
getOpcodeDesc(_opcode));
- if (_hexdumpScripts == true)
- hexdump(_scriptPointer - 1, 8);
+ if (_hexdumpScripts == true) {
+ for (c= -1; c < 15; c++) {
+ printf(" %02x", *(_scriptPointer + c));
+ }
+ printf("\n");
+ }
executeOpcode(_opcode);
}
CHECK_HEAP;