[Scummvm-cvs-logs] SF.net SVN: scummvm:[47595] scummvm/trunk/engines/sci/engine/vm.cpp
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Wed Jan 27 13:13:40 CET 2010
Revision: 47595
http://scummvm.svn.sourceforge.net/scummvm/?rev=47595&view=rev
Author: thebluegr
Date: 2010-01-27 12:13:39 +0000 (Wed, 27 Jan 2010)
Log Message:
-----------
Added support of the subtraction of two pointers, when they got the same segment. This operation will yield a number, like in C, and it's used by script 385 in Castle of Dr. Brain (the hangman script). Fixes exiting room 360 (the puzzle room) in Castle of Dr. Brain
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/vm.cpp
Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp 2010-01-27 11:18:05 UTC (rev 47594)
+++ scummvm/trunk/engines/sci/engine/vm.cpp 2010-01-27 12:13:39 UTC (rev 47595)
@@ -763,7 +763,7 @@
case 0x02: // sub
r_temp = POP32();
- if (r_temp.segment || s->r_acc.segment) {
+ if (r_temp.segment != s->r_acc.segment) {
reg_t r_ptr = NULL_REG;
int offset;
// Pointer arithmetics!
@@ -783,8 +783,11 @@
s->r_acc = pointer_add(s, r_ptr, -offset);
- } else
+ } else {
+ // We can subtract numbers, or pointers with the same segment,
+ // an operation which will yield a number like in C
s->r_acc = make_reg(0, r_temp.offset - s->r_acc.offset);
+ }
break;
case 0x03: // mul
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list