[Scummvm-cvs-logs] SF.net SVN: scummvm:[50999] scummvm/trunk/engines/sci/engine/vm.cpp

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sun Jul 18 20:01:53 CEST 2010


Revision: 50999
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50999&view=rev
Author:   m_kiewitz
Date:     2010-07-18 18:01:52 +0000 (Sun, 18 Jul 2010)

Log Message:
-----------
SCI: ipToa/ipTos/dpTos more verbose

...and adding ability to add workarounds easily

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-07-18 17:48:48 UTC (rev 50998)
+++ scummvm/trunk/engines/sci/engine/vm.cpp	2010-07-18 18:01:52 UTC (rev 50999)
@@ -1740,11 +1740,17 @@
 			validate_property(obj, (opparams[0] >> 1)) = POP32();
 			break;
 
-		case op_ipToa: // 0x35 (53)
-			// Incement Property and copy To Accumulator
-			s->r_acc = validate_property(obj, (opparams[0] >> 1));
-			s->r_acc = validate_property(obj, (opparams[0] >> 1)) = ACC_ARITHMETIC_L(1 + /*acc*/);
+		case op_ipToa: { // 0x35 (53)
+			// Increment Property and copy To Accumulator
+			reg_t &opProperty = validate_property(obj, opparams[0] >> 1);
+			uint16 valueProperty;
+			if (validate_unsignedInteger(opProperty, valueProperty))
+				s->r_acc = make_reg(0, valueProperty + 1);
+			else
+				s->r_acc = arithmetic_lookForWorkaround(opcode, NULL, opProperty, NULL_REG);
+			opProperty = s->r_acc;
 			break;
+		}
 
 		case op_dpToa: { // 0x36 (54)
 			// Decrement Property and copy To Accumulator
@@ -1758,19 +1764,31 @@
 			break;
 		}
 
-		case op_ipTos: // 0x37 (55)
+		case op_ipTos: { // 0x37 (55)
 			// Increment Property and push to Stack
-			validate_arithmetic(validate_property(obj, (opparams[0] >> 1)));
-			temp = ++validate_property(obj, (opparams[0] >> 1)).offset;
-			PUSH(temp);
+			reg_t &opProperty = validate_property(obj, opparams[0] >> 1);
+			uint16 valueProperty;
+			if (validate_unsignedInteger(opProperty, valueProperty))
+				valueProperty++;
+			else
+				valueProperty = arithmetic_lookForWorkaround(opcode, NULL, opProperty, NULL_REG).offset;
+			opProperty = make_reg(0, valueProperty);
+			PUSH(valueProperty);
 			break;
+		}
 
-		case op_dpTos: // 0x38 (56)
+		case op_dpTos: { // 0x38 (56)
 			// Decrement Property and push to Stack
-			validate_arithmetic(validate_property(obj, (opparams[0] >> 1)));
-			temp = --validate_property(obj, (opparams[0] >> 1)).offset;
-			PUSH(temp);
+			reg_t &opProperty = validate_property(obj, opparams[0] >> 1);
+			uint16 valueProperty;
+			if (validate_unsignedInteger(opProperty, valueProperty))
+				valueProperty--;
+			else
+				valueProperty = arithmetic_lookForWorkaround(opcode, NULL, opProperty, NULL_REG).offset;
+			opProperty = make_reg(0, valueProperty);
+			PUSH(valueProperty);
 			break;
+		}
 
 		case op_lofsa: // 0x39 (57)
 			// Load Offset to Accumulator


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