]> Joshua Wise's Git repositories - fpgaboy.git/blobdiff - insn_vop_intr.v
Add an interrupt ack, so that interrupts are cleared automatically. This fixes APOCAL...
[fpgaboy.git] / insn_vop_intr.v
index 06218f48c2f4feac4a068c99d186e1280fdd9cf8..ce0bcf8acb5f91bbaf9b645f412da983f63825c6 100644 (file)
@@ -1,9 +1,12 @@
 `ifdef EXECUTE
        `INSN_VOP_INTR: begin
                case (cycle)
-               0:      `EXEC_WRITE(`_SP - 1, `_PCH);
-               1:      `EXEC_WRITE(`_SP - 2, `_PCL);
-               2:      `EXEC_NEWCYCLE;
+               0:      `EXEC_WRITE(`_SP - 1, `_PCH)
+               1:      `EXEC_WRITE(`_SP - 2, `_PCL)
+               2:      begin
+                               irqack <= 1;
+                               `EXEC_NEWCYCLE
+                       end
                endcase
        end
 `endif
@@ -16,6 +19,7 @@
                2:      begin
                                ie <= 0;
                                `_PC <= {8'b0, jaddr};
+                               irqack <= 0;    // Must be at the same time as we latch jaddr, or we race!
                                `_SP <= `_SP - 2;
                        end
                endcase
This page took 0.027747 seconds and 4 git commands to generate.