aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorMartin Kiewitz2010-06-25 14:50:27 +0000
committerMartin Kiewitz2010-06-25 14:50:27 +0000
commit2b43c3a668485a0a382d7c627b2fb281865e0cd4 (patch)
tree4d4499d602cd7cd21d9c652a8dc5e3779cb463fd /engines/sci/engine
parentdf37aff35756e03e02b47ce3483b06679a662ce6 (diff)
downloadscummvm-rg350-2b43c3a668485a0a382d7c627b2fb281865e0cd4.tar.gz
scummvm-rg350-2b43c3a668485a0a382d7c627b2fb281865e0cd4.tar.bz2
scummvm-rg350-2b43c3a668485a0a382d7c627b2fb281865e0cd4.zip
SCI: changes to the op GT workaround
svn-id: r50266
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/vm.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index d9758650ea..a5cacf40b3 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -1054,10 +1054,11 @@ void run_vm(EngineState *s, bool restoring) {
warning("[VM] Comparing pointers in different segments (%04x:%04x vs. %04x:%04x)", PRINT_REG(r_temp), PRINT_REG(s->r_acc));
s->r_acc = make_reg(0, (r_temp.segment == s->r_acc.segment) && r_temp.offset > s->r_acc.offset);
} else if (r_temp.segment && !s->r_acc.segment) {
+ if (s->r_acc.offset >= 1000)
+ error("[VM] op_gt: comparsion between a pointer and number");
+ // Pseudo-WORKAROUND: sierra allows any pointer <-> value comparsion
// Happens in SQ1, room 28, when throwing the water at Orat
- // WORKAROUND: return false
- warning("[VM] op_gt_: comparison between a pointer and a number");
- s->r_acc = NULL_REG;
+ s->r_acc = SIGNAL_REG;
} else
s->r_acc = ACC_ARITHMETIC_L(signed_validate_arithmetic(r_temp) > (int16)/*acc*/);
break;
@@ -1110,7 +1111,7 @@ void run_vm(EngineState *s, bool restoring) {
// It works because in those games, the maximum resource number is 999,
// so any parameter value above that threshold must be a pointer.
if (r_temp.segment && (s->r_acc == make_reg(0, 1000)))
- s->r_acc = make_reg(0, 1);
+ s->r_acc = SIGNAL_REG;
else if (r_temp.segment && s->r_acc.segment)
s->r_acc = make_reg(0, (r_temp.segment == s->r_acc.segment) && r_temp.offset > s->r_acc.offset);
else