[Scummvm-cvs-logs] SF.net SVN: scummvm: [28650] tools/branches/gsoc2007-decompiler/finalD

brixxie at users.sourceforge.net brixxie at users.sourceforge.net
Sat Aug 18 08:18:22 CEST 2007


Revision: 28650
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28650&view=rev
Author:   brixxie
Date:     2007-08-17 23:18:21 -0700 (Fri, 17 Aug 2007)

Log Message:
-----------
Introduced NegCondJump instruction class.

Modified Paths:
--------------
    tools/branches/gsoc2007-decompiler/finalD/iformat.py
    tools/branches/gsoc2007-decompiler/finalD/scumm.py

Modified: tools/branches/gsoc2007-decompiler/finalD/iformat.py
===================================================================
--- tools/branches/gsoc2007-decompiler/finalD/iformat.py	2007-08-18 05:24:18 UTC (rev 28649)
+++ tools/branches/gsoc2007-decompiler/finalD/iformat.py	2007-08-18 06:18:21 UTC (rev 28650)
@@ -45,6 +45,9 @@
     def set_to(self, to):
         self.args[0] = to
 
+    def info(self):
+        return self.get_to()
+
     def __str__(self):
         return "goto %.4X" % self.args[0]
 
@@ -55,14 +58,28 @@
         Jump.__init__(self, to)
         self.condition = condition
 
+    def info(self):
+        return (True, self.get_to(), self.condition)
+
     def __str__(self):
-        return "unless(%s) goto %.4X" % (self.condition, self.args[0])
+        return "when (%s) goto %.4X" % (self.condition, self.args[0])
 
+class NegCondJump(CondJump):
+    """Negative conditional jump instruction in intermediate format."""
 
+    def info(self):
+        return (False, self.get_to(), self.condition)
+
+    def __str__(self):
+        return "unless (%s) goto %.4X" % (self.condition, self.args[0])
+
 def is_jump(instr):
     """Return True if instr is a Jump."""
-    return instr.__class__ == Jump or instr.__class__ == CondJump
+    return instr.__class__ == Jump \
+        or instr.__class__ == CondJump \
+        or instr.__class__ == NegCondJump
 
 def is_cond_jump(instr):
     """Return True if instr is a conditional Jump."""
-    return instr.__class__ == CondJump
+    return instr.__class__ == CondJump \
+        or instr.__class__ == NegCondJump

Modified: tools/branches/gsoc2007-decompiler/finalD/scumm.py
===================================================================
--- tools/branches/gsoc2007-decompiler/finalD/scumm.py	2007-08-18 05:24:18 UTC (rev 28649)
+++ tools/branches/gsoc2007-decompiler/finalD/scumm.py	2007-08-18 06:18:21 UTC (rev 28650)
@@ -720,7 +720,7 @@
         offset = self.get_word()
         to = self.calc_abs_jump(offset)
         if condition:
-            return CondJump(to, condition)
+            return NegCondJump(to, condition)
         else:
             return Jump(to)
 


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