Pass cycles for step to step method.

This commit is contained in:
Florian Nücke
2020-11-28 23:07:48 +01:00
parent 5bc42b763a
commit 47c10e430e
2 changed files with 3 additions and 3 deletions

View File

@@ -336,7 +336,7 @@ public final class ComputerTileEntity extends TileEntity implements ITickableTil
}
@Override
protected void step() {
protected void step(final int cyclesPerStep) {
while (!inputBuffer.isEmpty() && virtualMachine.uart.canPutByte()) {
virtualMachine.uart.putByte(inputBuffer.dequeueByte());
}

View File

@@ -40,7 +40,7 @@ public class VirtualMachineRunner implements Runnable {
protected void handleBeforeRun() {
}
protected void step() {
protected void step(final int cyclesPerStep) {
}
protected void handleAfterRun() {
@@ -72,7 +72,7 @@ public class VirtualMachineRunner implements Runnable {
for (int i = 0; i < maxSteps; i++) {
cycles += cyclesPerStep;
board.step(cyclesPerStep);
step();
step(cyclesPerStep);
if (System.currentTimeMillis() - start > timeQuotaInMillis.get()) {
break;