Updated addTimer() interface to include an ID; cleaned up how the CPU tracks the base speed, current speed, and target speed

This commit is contained in:
Jeff Parsons 2017-08-07 13:58:41 -07:00 committed by Jeff Parsons
commit e5a9b01dde
18 changed files with 2403 additions and 2387 deletions

View file

@ -251,7 +251,7 @@ class Computer extends Component {
* This timer replaces the CPU's old dedicated STATUS_UPDATES_PER_SECOND logic; periodic updateStatus()
* calls are now our own responsibility.
*/
this.cpu.addTimer(function() { cmp.updateStatus(); }, 1000 / Computer.UPDATES_PER_SECOND);
this.cpu.addTimer(this.id, function() { cmp.updateStatus(); }, 1000 / Computer.UPDATES_PER_SECOND);
var sStatePath = null;
var sResume = this.getMachineParm('resume');