Changed motherboard speed to be in percentage of 1mhz instead of in Hertz

This commit is contained in:
Brendan Robert 2017-12-29 19:20:07 -06:00
parent 77b82992df
commit a530a9741e

View File

@ -36,7 +36,8 @@ public abstract class TimedDevice extends Device {
super(computer);
setSpeed(cyclesPerSecond);
}
@ConfigurableField(name = "Speed", description = "(in hertz)")
@ConfigurableField(name = "Speed", description = "(Percentage)")
public int speedRatio = 100;
public long cyclesPerSecond = defaultCyclesPerSecond();
@ConfigurableField(name = "Max speed")
public boolean maxspeed = false;
@ -170,6 +171,7 @@ public abstract class TimedDevice extends Device {
@Override
public void reconfigure() {
cyclesPerSecond = defaultCyclesPerSecond() * speedRatio / 100;
if (cyclesPerSecond == 0) {
cyclesPerSecond = defaultCyclesPerSecond();
}