Rework it all to use the new macros.
[fpgaboy.git] / insn_ldh_ac.v
index 146f10b..a2ff5cc 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.018786 seconds and 4 git commands to generate.