@Test public void shouldUseThreeCyclesAsLastInstructionExecutionTime() { Instruction instruction = new Load16BitImmPcIntoStackPointer(z80, mmu); instruction.execute(); assertEquals(5, z80.getLastInstructionExecutionTime()); }
@Override public void execute() { int programCounter = z80.getProgramCounter(); int value = mmu.readWord(programCounter); z80.setStackPointer(value); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(5); }
Load16BitImmPcIntoStackPointer extends Instruction { @Override public void execute() { int programCounter = z80.getProgramCounter(); int value = mmu.readWord(programCounter); z80.setStackPointer(value); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(5); } }
Load16BitImmPcIntoStackPointer extends Instruction { @Override public void execute() { int programCounter = z80.getProgramCounter(); int value = mmu.readWord(programCounter); z80.setStackPointer(value); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(5); } Load16BitImmPcIntoStackPointer(GBZ80 z80, MMU mmu); }
Load16BitImmPcIntoStackPointer extends Instruction { @Override public void execute() { int programCounter = z80.getProgramCounter(); int value = mmu.readWord(programCounter); z80.setStackPointer(value); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(5); } Load16BitImmPcIntoStackPointer(GBZ80 z80, MMU mmu); @Override void execute(); }
Load16BitImmPcIntoStackPointer extends Instruction { @Override public void execute() { int programCounter = z80.getProgramCounter(); int value = mmu.readWord(programCounter); z80.setStackPointer(value); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(5); } Load16BitImmPcIntoStackPointer(GBZ80 z80, MMU mmu); @Override void execute();  }