|
|
|
@ -28,7 +28,7 @@ public class CpuEntity extends Peripheral implements CpuControl {
|
|
|
|
|
@Override
|
|
|
|
|
public CpuState getCpuState() {return state;}
|
|
|
|
|
|
|
|
|
|
private int resetTimer = 5;
|
|
|
|
|
private int resetTimer = 40;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -45,12 +45,12 @@ public class CpuEntity extends Peripheral implements CpuControl {
|
|
|
|
|
be.notTicked = false;
|
|
|
|
|
}
|
|
|
|
|
if(be.state == CpuState.RUNNING) {
|
|
|
|
|
for (int i = 0; i < 1000; i++)
|
|
|
|
|
for (int i = 0; i < 500; i++)
|
|
|
|
|
be.step();
|
|
|
|
|
} else{
|
|
|
|
|
if (be.state == CpuState.RESET && be.resetTimer > 0){
|
|
|
|
|
be.resetTimer--;
|
|
|
|
|
} else {
|
|
|
|
|
} else if(be.state == CpuState.RESET) {
|
|
|
|
|
be.core = new Emulator(be.getBus().getRedBus());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -81,7 +81,7 @@ public class CpuEntity extends Peripheral implements CpuControl {
|
|
|
|
|
public void reset() {
|
|
|
|
|
this.core.reset(this.defaultDriveId, this.defaultMonitorId);
|
|
|
|
|
state = CpuState.RESET;
|
|
|
|
|
resetTimer = 5;
|
|
|
|
|
resetTimer = 40;
|
|
|
|
|
markDirty();
|
|
|
|
|
world.updateListeners(pos, this.getCachedState(), this.getCachedState(), Block.NOTIFY_LISTENERS);
|
|
|
|
|
}
|
|
|
|
|