diff options
author | Lars Skovlund | 2010-01-29 22:29:03 +0000 |
---|---|---|
committer | Lars Skovlund | 2010-01-29 22:29:03 +0000 |
commit | 027b44673a62da07ca5cf913f93b86261d10f3bb (patch) | |
tree | 45afb7a305bc7e418cd6c7cc4a9a459da7c8665e | |
parent | 0e8b8f19624f4586f7b967993bcd8244faadc3a6 (diff) | |
download | scummvm-rg350-027b44673a62da07ca5cf913f93b86261d10f3bb.tar.gz scummvm-rg350-027b44673a62da07ca5cf913f93b86261d10f3bb.tar.bz2 scummvm-rg350-027b44673a62da07ca5cf913f93b86261d10f3bb.zip |
Document my last change
svn-id: r47684
-rw-r--r-- | engines/sci/engine/vm.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 171dfe353b..3ce0caa976 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -896,6 +896,17 @@ void run_vm(EngineState *s, int restoring) { case op_uge_: // 0x14 (20) s->r_prev = s->r_acc; r_temp = POP32(); + + // SCI0/SCI1 scripts use this to check whether a + // parameter is a pointer or a far text + // reference. It is used e.g. by the standard library + // Print function to distinguish two ways of calling it: + // + // (Print "foo") // Pointer to a string + // (Print 420 5) // Reference to the fifth message in text resource 420 + + // It works because in those games, the maximum resource number is 999, + // so any parameter value above that threshold must be a pointer. if (s->r_acc == make_reg(0, 0x3e8)) s->r_acc = make_reg(0, r_temp.segment); else if (r_temp.segment && s->r_acc.segment) @@ -907,6 +918,8 @@ void run_vm(EngineState *s, int restoring) { case op_ult_: // 0x15 (21) s->r_prev = s->r_acc; r_temp = POP32(); + + // See above if (s->r_acc == make_reg(0, 0x3e8)) s->r_acc = make_reg(0, !r_temp.segment); else if (r_temp.segment && s->r_acc.segment) |