Compare commits

...

4 Commits

Author SHA1 Message Date
Astoria 9302d35daa Correct speed and dont reset when stopped 1 month ago
Astoria 789d41d92f Merge remote-tracking branch 'origin/main'
# Conflicts:
#	src/main/java/net/brokenmoon/redcontrol/blockentities/CpuEntity.java
1 month ago
Astoria 2db508cbdb Merge remote-tracking branch 'origin/main' 1 month ago
Astoria 6ace534075 Slow down reset time and reset d register 1 month ago

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

Loading…
Cancel
Save