More tweaks to the on-going tension between giving machine elements focus (especially problematic when there are multiple machines) and preventing the page from being yanked around

This commit is contained in:
Jeff Parsons 2016-10-23 09:24:26 -07:00 • committed by Jeff Parsons
commit 9ecb9e948f
15 changed files with 123 additions and 120 deletions

View file

@ -77,7 +77,7 @@ function xb(a,b,c){a.I=b;a.A=a.j=0;c&&((a.A=c.A)&&ic(a,hc,!1),(a.j=c.j)&&gc(a,hc
var lc=[],fc=[G.prototype.Y,G.prototype.hb,G.prototype.fa,G.prototype.wa],hc=[G.prototype.O,G.prototype.ja,G.prototype.ca,G.prototype.ma];if(qb)var ec=[G.prototype.M,G.prototype.ha,G.prototype.ba,G.prototype.la],dc=[G.prototype.P,G.prototype.gb,G.prototype.ea,G.prototype.na];
function mc(a,b){z.call(this,"CPU",a,mc,1);var c=a.multiplier||1;this.Y=a.cycles||b;this.Sa=c;this.ha=Math.round(this.Y/1E4)/100;this.eb=this.ha*this.Sa;this.C.za=!1;this.C.Vb=!1;this.C.vb=a.autoStart;this.C.yc=!1;this.C.jb=!1;this.xb=this.O=0;this.yb=a.csStart;this.lb=a.csInterval;this.mb=a.csStop;this.w=[];this.Ha=this.fb.bind(this);F(this)}A(mc);var nc=["power","reset"];l=mc.prototype;
l.Ra=function(a,b,c,d){this.A=a;this.u=b;this.I=d;for(b=0;b<nc.length;b++)(c=this.N[nc[b]])&&this.A.qa(null,nc[b],c);this.F=ub(a,"ChipSet");a=Ac(a,"autoStart");null!=a&&(this.C.vb="true"==a?!0:"false"==a?!1:!!a);F(this)};l.reset=function(){};l.save=function(){return null};l.restore=function(){return!1};
l.Ga=function(a,b){if(!b){if(a&&this.restore){Bc(this);if(!this.restore(a))return!1;Cc(this)}else this.reset();this.I?(a=this.I,a.g("Type ? for help with PC8080 Debugger commands"),a.La(),a.Ba&&(b=a.Ba,a.Ba=null,Dc(a,b))):this.g("No debugger detected")}Ec(this);return!0};l.Ka=function(a){return a?this.save():!0};l.vb=function(){return this.C.vb||!this.I&&void 0===this.N.run?(this.fb(!0),!0):!1};l.Bc=function(){return 0};
l.Ga=function(a,b){if(!b){if(a&&this.restore){Bc(this);if(!this.restore(a))return!1;Cc(this)}else this.reset();this.I?(a=this.I,a.g("Type ? for help with PC8080 Debugger commands"),a.La(),a.Ba&&(b=a.Ba,a.Ba=null,Dc(a,b))):this.g("No debugger detected")}Ec(this);return!0};l.Ka=function(a){return a?this.save():!0};l.vb=function(){return this.C.vb||!this.I&&void 0===this.N.run?(this.fb(),!0):!1};l.Bc=function(){return 0};
function Cc(a){void 0===a.yb&&(a.yb=0);void 0===a.lb&&(a.lb=-1);void 0===a.mb&&(a.mb=-1);a.C.jb=0<=a.yb&&0<a.lb;a.C.jb&&(a.xb=0,a.O=a.yb-a.M)}function Fc(a,b){if(a.C.jb){var c=!1;a.xb=a.xb+a.Bc()|0;a.O-=b;0>=a.O&&(a.O+=a.lb,c=!0);0<=a.mb&&a.mb<=Gc(a)&&(a.lb=a.mb=-1,Cc(a),a.ra(),c=!0);c&&a.g(Gc(a)+" cycles: checksum="+t(a.xb))}}
l.qa=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.N[b]=c;a=!0;break;case "run":this.N[b]=c;c.onclick=function(){var a;if(a=d.A)if(a=d.A,a.C.xa)a=!0;else{var b=null,c,h=db(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.xa);c++);c==h.length&&(b=a);w("The "+b.type+" component ("+b.id+") is not "+(b.C.ready?"powered yet":"ready yet"+(b.Hb?" (waiting for notification)":""))+".");a=!1}a&&(d.C.za?d.ra():d.fb())};
a=!0;break;case "speed":this.N[b]=c;a=!0;break;case "setSpeed":this.N[b]=c,c.onclick=function(){Hc(d,d.Sa<<1,!0)},c.textContent=this.eb.toFixed(2)+"Mhz",a=!0}return a};function Ic(a,b,c){a.M+=b;c&&(a.L=a.b=0)}function Jc(a,b){var c=1;b&&1<a.Sa&&a.K&&(c=a.K/a.ha);a.wa=Math.round(1E3/30);a.fa=Math.floor(a.Y/30*c);b||(a.P=a.fa);a.ja=0}function Gc(a){return a.M+a.H+a.L-a.b}function Bc(a){a.K=0;a.Ba=0;a.M=a.H=a.L=a.b=0;Cc(a);Hc(a,1)}