@Test public void shouldUseFiveCyclesAsLastInstructionExecutionTime() { Instruction instruction = new LoadSPIntoImmPC(z80, mmu); instruction.execute(); assertEquals(5, z80.getLastInstructionExecutionTime()); }
@Override public void execute() { int stackPointer = z80.getStackPointer(); int programCounter = z80.getProgramCounter(); mmu.writeWord(programCounter, stackPointer); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(5); }
LoadSPIntoImmPC extends Instruction { @Override public void execute() { int stackPointer = z80.getStackPointer(); int programCounter = z80.getProgramCounter(); mmu.writeWord(programCounter, stackPointer); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(5); } }
LoadSPIntoImmPC extends Instruction { @Override public void execute() { int stackPointer = z80.getStackPointer(); int programCounter = z80.getProgramCounter(); mmu.writeWord(programCounter, stackPointer); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(5); } LoadSPIntoImmPC(GBZ80 z80, MMU mmu); }
LoadSPIntoImmPC extends Instruction { @Override public void execute() { int stackPointer = z80.getStackPointer(); int programCounter = z80.getProgramCounter(); mmu.writeWord(programCounter, stackPointer); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(5); } LoadSPIntoImmPC(GBZ80 z80, MMU mmu); @Override void execute(); }
LoadSPIntoImmPC extends Instruction { @Override public void execute() { int stackPointer = z80.getStackPointer(); int programCounter = z80.getProgramCounter(); mmu.writeWord(programCounter, stackPointer); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(5); } LoadSPIntoImmPC(GBZ80 z80, MMU mmu); @Override void execute();  }