Another minor autoStart tweak

This commit is contained in:
Jeff Parsons 2016-12-04 11:34:46 -08:00 • committed by Jeff Parsons
commit fa3be9eda9
3 changed files with 27 additions and 29 deletions

View file

@ -113,7 +113,7 @@ b)+")",!0)}};function Cc(a,b,c){a.j=b;a.B=a.g=0;c&&((a.B=c.B)&&Ad(a,zd,!1),(a.g=
var Dd=[],xd=[M.prototype.ca,M.prototype.Pa,M.prototype.va,M.prototype.ab],zd=[M.prototype.jb,M.prototype.Aa,M.prototype.ma,M.prototype.Wa];if(Db)var wd=[M.prototype.Y,M.prototype.wa,M.prototype.da,M.prototype.Sa],vd=[M.prototype.kb,M.prototype.Ga,M.prototype.na,M.prototype.Xa];
function Ed(a,b){y.call(this,"CPU",a,Ed,1);b=a.cycles||b;var c=a.multiplier||1;this.Vb=0;this.ub=b;this.ob=c;this.kc=Math.round(this.ub/1E4)/100;this.Ab=this.kc*this.ob;this.C.U=!1;this.C.gc=!1;this.C.bb=a.autoStart;this.C.Jb=!1;this.Wb=this.Ga=0;this.Xb=a.csStart;this.Nb=a.csInterval;this.Ob=a.csStop;this.N=[];this.Ic=this.Fe.bind(this);L(this)}D(Ed);var Fd=["power","reset"];k=Ed.prototype;
k.Ha=function(a,b,c,d){this.B=a;this.w=b;this.j=d;this.v=a.v;for(a=0;a<Fd.length;a++)(b=this.D[Fd[a]])&&this.B.ya(null,Fd[a],b);L(this)};k.yc=function(){};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};
k.La=function(a,b){var c=Gd(this.B,"autoStart");null!=c?this.C.bb="true"==c?!0:"false"==c?!1:!!c:null==this.C.bb&&(this.C.bb=!this.j&&void 0===this.D.run);if(!b){this.yc();if(a&&this.restore){Hd(this);if(!this.restore(a))return!1;Id(this)}else this.reset();this.j?(a=this.j,b=this.C.bb,a.Xa=!0,a.i("Type ? for help with PDPjs Debugger commands"),Jd(a),b||a.qb(),a.Sa&&(b=a.Sa,a.Sa=null,Kd(a,b))):this.i("No debugger detected");this.C.bb?this.i("CPU will auto-start"):this.i("CPU will not be auto-started, click Run to start")}return!0};
k.La=function(a,b){var c=Gd(this.B,"autoStart");null!=c?this.C.bb="true"==c?!0:"false"==c?!1:!!c:null==this.C.bb&&(this.C.bb=!this.j&&void 0===this.D.run);if(!b){this.yc();if(a&&this.restore){Hd(this);if(!this.restore(a))return!1;Id(this)}else this.reset();this.j?(a=this.j,b=this.C.bb,a.Xa=!0,a.i("Type ? for help with PDPjs Debugger commands"),Jd(a),b||a.qb(),a.Sa&&(b=a.Sa,a.Sa=null,Kd(a,b))):this.i("No debugger detected");this.C.bb||this.i("CPU will not be auto-started, click Run to start")}return!0};
k.Ka=function(a){return a?this.save():!0};k.bb=function(){return this.C.U?!0:this.C.bb?(this.ib(),!0):!1};k.Nc=function(){return 0};function Id(a){void 0===a.Xb&&(a.Xb=0);void 0===a.Nb&&(a.Nb=-1);void 0===a.Ob&&(a.Ob=-1);a.C.Jb=0<=a.Xb&&0<a.Nb;a.C.Jb&&(a.Wb=0,a.Ga=a.Xb-a.na)}function Yb(a,b){if(a.C.Jb){var c=!1;a.Wb=a.Wb+a.Nc()|0;a.Ga-=b;0>=a.Ga&&(a.Ga+=a.Nb,c=!0);0<=a.Ob&&a.Ob<=Ld(a)&&(a.Nb=a.Ob=-1,Id(a),a.aa(),c=!0);c&&a.i(Ld(a)+" cycles: checksum="+q(a.Wb))}}
k.ya=function(a,b,c){var d=this;switch(b){case "power":case "reset":return this.D[b]=c,!0;case "run":return this.D[b]=c,c.onclick=function(){var a;if(a=d.B)if(a=d.B,a.C.la)a=!0;else{var b=null,c,h=qb(a.id);for(c=0;c<h.length&&(b=h[c],b===a||b.C.ready);c++);if(c==h.length)for(c=0;c<h.length&&(b=h[c],b===a||b.C.la);c++);c==h.length&&(b=a);x("The "+b.type+" component ("+b.id+") is not "+(b.C.ready?"powered yet":"ready yet"+(b.cc?" (waiting for notification)":""))+".");a=!1}a&&(d.C.U?d.aa():d.ib())},
!0;case "speed":return this.D[b]=c,!0;case "setSpeed":return this.D[b]=c,c.onclick=function(){Md(d,d.ob<<1,!0)},c.textContent=this.Ab.toFixed(2)+"Mhz",!0}return!1};k.za=function(a){this.B&&this.B.za(a)};function Xb(a,b,c){a.na+=b;c&&(a.ma=a.b=a.K=0)}function Nd(a,b){var c=1;b&&1<a.ob&&a.Aa&&(c=a.Aa/a.kc);a.Gc=Math.round(1E3/30);a.vb=Math.floor(a.ub/30*c);b||(a.Pa=a.vb);a.lc=0}function Ld(a){return a.na+a.Y+a.ma-a.b}function Hd(a){a.Aa=0;a.Hc=0;a.na=a.Y=a.ma=a.b=a.K=0;Id(a);Md(a,1)}