diff --git a/CHANGES.txt b/CHANGES.txt index 21bb113..db50006 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -16,6 +16,9 @@ Next Release - The processor status register is now initialized to 0 on reset. Previously, its unused bit (bit 5) was set to 1 on reset. + - Applied patch from Ed Spittles to change the CMP algorithm so that + it no longer fails Rob Finch's test suite. Closes #8. + 0.6 (2009-08-11) - Added monitor shortcut "a" for "assemble". diff --git a/src/py65/devices/mpu6502.py b/src/py65/devices/mpu6502.py index 0ec94f0..da91c62 100644 --- a/src/py65/devices/mpu6502.py +++ b/src/py65/devices/mpu6502.py @@ -356,8 +356,7 @@ class MPU: self.flags |= self.CARRY + self.ZERO elif register_value > tbyte: self.flags |= self.CARRY - else: - self.flags |= self.NEGATIVE + self.flags |= (self.a - tbyte) & self.NEGATIVE def opSBC(self, x): data = self.ByteAt(x())