[pypy-svn] r55779 - pypy/dist/pypy/lang/gameboy

cami at codespeak.net cami at codespeak.net
Thu Jun 12 12:36:37 CEST 2008


Author: cami
Date: Thu Jun 12 12:36:36 2008
New Revision: 55779

Modified:
   pypy/dist/pypy/lang/gameboy/cpu.py
Log:
undo wrong replacement on lines 792++ in cpu.py
some small code refactorings


Modified: pypy/dist/pypy/lang/gameboy/cpu.py
==============================================================================
--- pypy/dist/pypy/lang/gameboy/cpu.py	(original)
+++ pypy/dist/pypy/lang/gameboy/cpu.py	Thu Jun 12 12:36:36 2008
@@ -791,8 +791,8 @@
             delta |= 0x60
         if (self.a.get() & 0x0F) > 0x09:
             delta |= 0x06
-        if (self.a.get() & 0xF0) > 0x80:
-            delta |= 0x60
+            if (self.a.get() & 0xF0) > 0x80:
+                delta |= 0x60
         if (self.a.get() & 0xF0) > 0x90:
             delta |= 0x60
         if not self.is_n():
@@ -820,13 +820,11 @@
         s = (self.sp.get() + offset) & 0xFFFF
         self.f.reset()
         if (offset >= 0):
-            if s < self.sp.get():
-                self.f.c_flag = True
+            self.f.c_flag = (s < self.sp.get())
             if (s & 0x0F00) < (self.sp.get() & 0x0F00):
                 self.f.h_flag = True
         else:
-            if s > self.sp.get():
-                self.f.c_flag = True
+            self.f.c_flag = (s > self.sp.get())
             if (s & 0x0F00) > (self.sp.get() & 0x0F00):
                 self.f.h_flag = True
         return s



More information about the Pypy-commit mailing list