From 129fcff7e5203560371b9feb77d2f6cf539b9421 Mon Sep 17 00:00:00 2001
From: Oliver Schmidt
Date: Tue, 21 May 2013 23:47:19 +0200
Subject: [PATCH] Fixed Carry handling in SBC opcode.
---
src/sim65/6502.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sim65/6502.c b/src/sim65/6502.c
index bb357cbb7..f00aa3943 100644
--- a/src/sim65/6502.c
+++ b/src/sim65/6502.c
@@ -312,7 +312,7 @@ static unsigned HaveIRQRequest;
SET_CF (res <= 0xFF); \
SET_OF (((old^rhs) & (old^res) & 0x80)); \
} else { \
- Regs.AC -= rhs - (!GET_CF ()); \
+ Regs.AC -= rhs + (!GET_CF ()); \
TEST_ZF (Regs.AC); \
TEST_SF (Regs.AC); \
SET_CF (Regs.AC <= 0xFF); \
--
2.39.5