]> Joshua Wise's Git repositories - fpgaboy.git/blobdiff - insn_ldh_ac.v
Semi-working, but prone to anus, keyboard driver
[fpgaboy.git] / insn_ldh_ac.v
index 146f10b38311b11c42e9dfd1ae099843cd855262..a2ff5cc1decce400b2494d9baa24532f0eec778b 100644 (file)
@@ -1,18 +1,13 @@
 `ifdef EXECUTE
        `INSN_LDH_AC: begin
                case (cycle)
-               0:      begin
-                               address <= {8'hFF,registers[`REG_C]};
-                               if (opcode[4]) begin    // LD A,(C)
-                                       rd <= 1;
-                               end else begin
-                                       wr <= 1;
-                                       wdata <= registers[`REG_A];
-                               end
-                       end
+               0:      if (opcode[4])  // LD A,(C)
+                               `EXEC_READ(({8'hFF,`_C}))
+                       else
+                               `EXEC_WRITE(({8'hFF,`_C}), `_A)
                1:      begin
-                               `EXEC_NEWCYCLE;
-                               `EXEC_INC_PC;
+                               `EXEC_NEWCYCLE
+                               `EXEC_INC_PC
                        end
                endcase
        end
@@ -22,8 +17,7 @@
        `INSN_LDH_AC: begin
                case (cycle)
                0:      begin /* Type F */ end
-               1:      if (opcode[4])
-                               registers[`REG_A] <= rdata;
+               1:      if (opcode[4]) `_A <= rdata;
                endcase
        end
 `endif
This page took 0.026482 seconds and 4 git commands to generate.