aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2009-10-15 20:13:19 +0000
committerWillem Jan Palenstijn2009-10-15 20:13:19 +0000
commit4ce77c77faed71efbedd177d73ad02342b439daa (patch)
treeee15deaefa3a8ae17d6b29f0c13a4f26265f34a5 /engines
parent78c905ebbe6244c9cd3f4e76c02bd6808e04d1ef (diff)
downloadscummvm-rg350-4ce77c77faed71efbedd177d73ad02342b439daa.tar.gz
scummvm-rg350-4ce77c77faed71efbedd177d73ad02342b439daa.tar.bz2
scummvm-rg350-4ce77c77faed71efbedd177d73ad02342b439daa.zip
SCI: Make send varselector reads more verbose. Add notes.
svn-id: r45131
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/console.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 8636d38cbb..6640aba5bd 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -2261,6 +2261,8 @@ bool Console::cmdSend(int argc, const char **argv) {
}
}
+ reg_t old_acc = _vm->_gamestate->r_acc;
+
// Now commit the actual function:
ExecStack *old_xstack, *xstack;
old_xstack = &_vm->_gamestate->_executionStack.back();
@@ -2271,6 +2273,24 @@ bool Console::cmdSend(int argc, const char **argv) {
if (old_xstack != xstack) {
_vm->_gamestate->_executionStackPosChanged = true;
DebugPrintf("Message scheduled for execution\n");
+
+ // TODO (maybe): Executing this function will leave most of the
+ // state of the current function intact, but will likely destroy
+ // r_acc. We may want to save/restore this to avoid disturbing
+ // the current function as much as possible.
+ //
+ // To do this, we may want to call run_vm() here to run until
+ // returning from this function, and restore r_acc afterwards.
+ } else {
+ if (argc == 3) {
+ // varselector read
+
+ DebugPrintf("Value returned: %04x:%04x\n", PRINT_REG(_vm->_gamestate->r_acc));
+ DebugPrintf("(Previous value of acc was: %04x:%04x )\n", PRINT_REG(old_acc));
+
+ // Maybe we want to leave the value of r_acc unchanged instead,
+ // and only report the read value?
+ }
}
return true;