From: Joshua Wise <joshua@rebirth.joshuawise.com>
Date: Sun, 11 May 2008 11:35:22 +0000 (-0400)
Subject: Fix ADD HL,xx.
X-Git-Url: http://git.joshuawise.com/fpgaboy.git/commitdiff_plain/a51c6ed32f1bae3563341486a8ad545c5c801329?ds=sidebyside;hp=--cc

Fix ADD HL,xx.
---

a51c6ed32f1bae3563341486a8ad545c5c801329
diff --git a/core/insn_add_hl.v b/core/insn_add_hl.v
index bfd6880..6bd7e7a 100644
--- a/core/insn_add_hl.v
+++ b/core/insn_add_hl.v
@@ -20,7 +20,6 @@
 `ifdef WRITEBACK
 	`INSN_ADD_HL: begin
 		case (cycle)
-		0:	{tmp,tmp2} <= `_HL + {tmp,tmp2};
 		1:	begin
 				`_F <=	{ /* Z */ `_F[7],
 					  /* N */ 1'b0,
@@ -28,7 +27,7 @@
 					  /* C */ (({1'b0,`_HL} + {1'b0,tmp,tmp2}) & 17'h10000) ? 1'b1 : 1'b0,
 					  `_F[3:0]
 					};
-				`_HL <= {tmp, tmp2};
+				`_HL <= `_HL + {tmp, tmp2};
 			end
 		endcase
 	end