]> Joshua Wise's Git repositories - fpgaboy.git/blobdiff - core/insn_add_hl.v
Fix some carry-related bugs and a typo in insn_alu_a.
[fpgaboy.git] / core / insn_add_hl.v
index 0d85f953f5713ec704c696b927a4018094d96a55..bfd6880a1ea3d53889af9c1bc9500109711817dd 100644 (file)
@@ -25,7 +25,7 @@
                                `_F <=  { /* Z */ `_F[7],
                                          /* N */ 1'b0,
                                          /* H */ (({`_HL} + {tmp,tmp2}) & 16'h1000) ? 1'b1 : 1'b0,
-                                         /* C */ (({1'b0,`_HL} + {1'b0,tmp,tmp2}) >> 16 == 1) ? 1'b1 : 1'b0,
+                                         /* C */ (({1'b0,`_HL} + {1'b0,tmp,tmp2}) & 17'h10000) ? 1'b1 : 1'b0,
                                          `_F[3:0]
                                        };
                                `_HL <= {tmp, tmp2};
This page took 0.021763 seconds and 4 git commands to generate.