@Test public void shouldUseTwoCyclesAsLastInstructionExecutionTime() { Instruction instruction = new Inc16BitRegister(z80, ANY_16BIT_DESTINY_REGISTER); instruction.execute(); assertEquals(2, z80.getLastInstructionExecutionTime()); }
@Override public void execute() { int registerValue = z80.get16BitRegisterValue(destinyRegister); int newRegisterValue = registerValue + 1; z80.set16BitRegisterValue(destinyRegister, newRegisterValue); z80.setLastInstructionExecutionTime(2); }
Inc16BitRegister extends Instruction { @Override public void execute() { int registerValue = z80.get16BitRegisterValue(destinyRegister); int newRegisterValue = registerValue + 1; z80.set16BitRegisterValue(destinyRegister, newRegisterValue); z80.setLastInstructionExecutionTime(2); } }
Inc16BitRegister extends Instruction { @Override public void execute() { int registerValue = z80.get16BitRegisterValue(destinyRegister); int newRegisterValue = registerValue + 1; z80.set16BitRegisterValue(destinyRegister, newRegisterValue); z80.setLastInstructionExecutionTime(2); } Inc16BitRegister(GBZ80 z80, Register destinyRegister); }
Inc16BitRegister extends Instruction { @Override public void execute() { int registerValue = z80.get16BitRegisterValue(destinyRegister); int newRegisterValue = registerValue + 1; z80.set16BitRegisterValue(destinyRegister, newRegisterValue); z80.setLastInstructionExecutionTime(2); } Inc16BitRegister(GBZ80 z80, Register destinyRegister); @Override void execute(); }
Inc16BitRegister extends Instruction { @Override public void execute() { int registerValue = z80.get16BitRegisterValue(destinyRegister); int newRegisterValue = registerValue + 1; z80.set16BitRegisterValue(destinyRegister, newRegisterValue); z80.setLastInstructionExecutionTime(2); } Inc16BitRegister(GBZ80 z80, Register destinyRegister); @Override void execute();  }