From 8f10724a7f9805a93358e075f15a2cd6347db39c Mon Sep 17 00:00:00 2001 From: James Tauber Date: Sat, 6 Aug 2011 23:53:47 -0400 Subject: [PATCH] fixed inverse use of carry in SBC --- applepy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/applepy.py b/applepy.py index 6b5a652..5b72edb 100644 --- a/applepy.py +++ b/applepy.py @@ -620,10 +620,10 @@ class CPU: m1 = (m1 & 0x7F) - 0x80 # twos complement subtraction - result1 = a1 - m1 - self.carry_flag + result1 = a1 - m1 - [1, 0][self.carry_flag] # unsigned subtraction - result2 = a2 - m2 - self.carry_flag + result2 = a2 - m2 - [1, 0][self.carry_flag] self.accumulator = self.update_nz(result2) self.carry_flag = (result2 >= 0)