diff --git a/docs/pcjs/demos/components.xsl b/docs/pcjs/demos/components.xsl index 5a6dbd84e..bd084d6bb 100644 --- a/docs/pcjs/demos/components.xsl +++ b/docs/pcjs/demos/components.xsl @@ -350,27 +350,27 @@ - + - - + - + - +
-
+
@@ -378,7 +378,7 @@ -
+

@@ -390,7 +390,7 @@
-
+
diff --git a/docs/pcjs/demos/pc-dbg.js b/docs/pcjs/demos/pc-dbg.js index 7be009e8b..68e1f5c29 100644 --- a/docs/pcjs/demos/pc-dbg.js +++ b/docs/pcjs/demos/pc-dbg.js @@ -13,13 +13,13 @@ function z(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id;this.name=b.na if(window){Na||(Na=window.location.search.substr(1));for(var Pa,Sa=/\+/g,Ta=/([^&=]+)=?([^&]*)/g;Pa=Ta.exec(Na);)Oa[decodeURIComponent(Pa[1].replace(Sa," "))]=decodeURIComponent(Pa[2].replace(Sa," "))}function Ua(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}function A(a,b){b.prototype=Ua(a.prototype)}var La=[]; function Va(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b=this.hg?12:14;this.gc=1<>2;this.mb=this.gc-1;this.bh=(this.Pf+this.gc)/this.gc|0;this.Ee=this.bh-1;this.vd=[];this.wd=[];this.dg=this.eg=!1;this.Ni();this.Ua()}A(z,gb); +z.prototype={toString:function(){return this.name?this.name:this.id||this.type},Db:function(a,b,c){switch(b){case "clear":return this.wa[b]||(this.wa[b]=c,c.onclick=function(a){return function(){a.wa.print&&(a.wa.print.value="")}}(this)),!0;case "print":return this.wa[b]||(this.$f=this.wa[b]=c,c.value="",this.da=function(a){return function(b,c){8192=this.hg?12:14;this.gc=1<>2;this.mb=this.gc-1;this.bh=(this.Pf+this.gc)/this.gc|0;this.Ee=this.bh-1;this.vd=[];this.wd=[];this.dg=this.eg=!1;this.Ni();this.Ua()}A(z,gb); gb.prototype.Ni=function(){this.Fa=Array(this.bh);for(var a=0;a>a.zb;0>this.zb;0>a.zb;0>a.zb].Bg(b&a.mb)} @@ -37,7 +37,7 @@ function Lb(a,b){z.call(this,"CPU",a,Lb);var c=a.cycles||b,d=a.multiplier||1;thi k.pc=function(a,b,c,d){this.ra=b;this.fa=d;this.Ka=a;var e=eb(a,"Video");e&&(this.ti=function(){Mb(e)},this.Tc=function(){e.Tc()});this.oa=eb(a,"ChipSet");this.Ua()};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};k.$b=function(a,b){if(!b){if(a&&this.restore){Nb(this);if(!this.restore(a))return!1;Ob(this)}else this.reset();this.fa?this.fa.Mn():this.da("No debugger detected")}this.qa.Qb=!0;!Pb(this)&&this.fa&&Rb(this.fa);Sb(this);return!0}; k.Zb=function(a){this.qa.Qb=!1;return a&&this.save?this.save():!0};function Pb(a){return!0===a.qa.yi||null===a.qa.yi&&!a.fa&&void 0===a.wa.run?(a.Ve(),!0):!1}k.Tc=function(){};k.Hk=function(){return 0};function Ob(a){void 0===a.ca.kg&&(a.ca.kg=0);void 0===a.ca.xf&&(a.ca.xf=-1);void 0===a.ca.zf&&(a.ca.zf=-1);a.qa.nf=0<=a.ca.kg&&0=a.ca.yf&&(a.ca.yf+=a.ca.xf,c=!0);0<=a.ca.zf&&a.ca.zf<=Ub(a)&&(a.ca.xf=a.ca.zf=-1,Ob(a),a.Fb(),c=!0);c&&a.da(Ub(a)+" cycles: checksum="+p(a.ca.ig))}}function F(a,b,c,d){void 0!==a.wa[b]&&(void 0===d&&(d=4),void 0===c&&(cb(a,"Register "+b+" is invalid"),a.Fb()),c=p(c,d),a.wa[b].innerHTML!=c&&(a.wa[b].innerHTML=c))}k.jh=function(){};k.ti=function(){}; -k.Db=function(a,b,c,d){var e=this;a=!1;switch(c){case "run":this.wa[c]=d;d.onclick=function(){e.qa.Rb?e.Fb(!0):e.Ve(!0)};a=!0;break;case "reset":this.wa[c]=d;d.onclick=function(){e.Ka&&Vb(e.Ka)};a=!0;break;case "speed":this.wa[c]=d;a=!0;break;case "setSpeed":this.wa[c]=d,d.onclick=function(){Wb(e,e.ca.Kd<<1,!0)},d.innerHTML=this.ca.Pe.toFixed(2)+"Mhz",a=!0}return a};function Xb(a,b,c){a.Te+=b;c&&(a.Qc=a.A=0)} +k.Db=function(a,b,c){var d=this;a=!1;switch(b){case "run":this.wa[b]=c;c.onclick=function(){d.qa.Rb?d.Fb(!0):d.Ve(!0)};a=!0;break;case "reset":this.wa[b]=c;c.onclick=function(){d.Ka&&Vb(d.Ka)};a=!0;break;case "speed":this.wa[b]=c;a=!0;break;case "setSpeed":this.wa[b]=c,c.onclick=function(){Wb(d,d.ca.Kd<<1,!0)},c.innerHTML=this.ca.Pe.toFixed(2)+"Mhz",a=!0}return a};function Xb(a,b,c){a.Te+=b;c&&(a.Qc=a.A=0)} function Yb(a,b){var c=30;60>c&&(c=60);2>c&&(c=2);var d=1;b&&1a.ca.Bh&&(c=Math.round(c/a.ca.Kd));return c}function Nb(a){a.ca.pd=0;a.Eh=1;a.Te=a.qe=a.Qc=a.A=0;Ob(a);Wb(a,1)} function Wb(a,b,c){if(void 0!==b){0.8>a.ca.pd/a.ca.Pe&&(b=1);a.ca.Kd=b;b=a.ca.Bh*a.ca.Kd;if(a.ca.Pe!=b){a.ca.Pe=b;b=a.ca.Pe.toFixed(2)+"Mhz";var d=a.wa.setSpeed;d&&(d.innerHTML=b);a.da("target speed: "+b)}c&&a.Tc()}Xb(a,a.qe);a.qe=0;a.ca.wf=oa();a.ca.Qe=0;Yb(a)} k.Ve=function(a){if($a(this,!0)){if(!this.qa.Rb){Wb(this);this.Ka&&this.Ka.start(this.ca.wf,Ub(this));this.qa.Rb=!0;this.oa&&Zb(this.oa);var b=this.wa.run;b&&(b.innerHTML="Halt");a&&this.Tc()}this.ca.Ui>=this.ca.Ld&&Yb(this,!0);this.ca.ng=0;this.ca.Ch=oa();this.ca.Qe&&(a=this.ca.Ch-this.ca.Qe,a>this.ca.Ok&&(this.ca.wf+=a,this.ca.wf>this.ca.Ch&&(this.ca.wf=this.ca.Ch)));try{do{this.Gf(this.qa.nf?1:Math.round(this.ca.Yn/this.Eh));var c=this.Qc-this.A;this.qe+=c;this.ca.ng+=c;Xb(this,0,!0);Tb(this,c); @@ -63,7 +63,7 @@ function hd(a,b){switch(b){case "CS":return a.ya;case "DS":return a.Hb;case "SS" function jd(a,b){a.Ga=a.ya.load(b)+a.va;a.aa|=a.Lg}function kd(a,b){a.Hb.load(b);a.aa|=a.Lg}function ld(a,b){a.Cb.load(b);a.aa|=4}function md(a,b){a.ab.load(b);a.aa|=a.Lg}function G(a,b){a.Ga=a.ya.Ya+(a.va=b&65535)}function Tc(a,b,c){a.Ga=a.ya.load(c)+(a.va=b)}function nd(a,b){a.Ga=a.ya.Ya+(a.va=a.va+b&65535)}function od(a){return a.Z&a.ga?1:0}function pd(a){return ac[a.ma&255]?4:0}function qd(a){return(a.ma^a.pa)&16?16:0}function rd(a){return a.Z&a.ga-1?0:64} function sd(a){return a.ma&a.ga>>1?128:0}function td(a){return(a.ma^a.pa^a.ma>>1)&a.ga>>1?2048:0}function ud(a){a.Z&=~a.ga}function vd(a){a.pa=a.ma&16|a.pa&-17}function wd(a){a.Z|=a.ga-1}function xd(a){sd(a)&&(a.ma^=a.ga>>1|a.ga>>2,a.pa^=32896)}function yd(a){a.ma&=~a.ga;a.pa=a.ma&32896|a.pa&-32897}function zd(a){a.Z|=a.ga}function Ad(a){a.pa=~(a.ma&16)&16|a.pa&-17}function Bd(a){a.Z&=~(a.ga-1)}function Cd(a){sd(a)||(a.ma^=a.ga>>1|a.ga>>2,a.pa^=32896)} function Dd(a){a.ma|=a.ga;a.pa=a.ma&32896|a.pa&-32897}function Wc(a){return a.Ca&-2262|od(a)|pd(a)|qd(a)|rd(a)|sd(a)|td(a)}function Uc(a,b){a.ga=256;a.Z=a.ma=a.pa=0;b&1&&zd(a);b&4||(a.ma|=1);b&16&&(a.pa|=16);b&64||wd(a);b&128&&Cd(a);b&2048&&Dd(a);a.ya.Mc?b=b&-12289|a.Ca&12288:(a.ne=(b&12288)>>12,!a.ne||a.Gc&1||(a.ne=0));a.ya.Mc>a.ne&&(b=b&-513|a.Ca&512);a.Ca=a.Ca&-1793|b&1792|a.ck;a.Ca&256&&(a.ub|=2,a.aa|=4)} -k.Db=function(a,b,c,d){var e=!1;switch(c){case "AX":case "BX":case "CX":case "DX":case "SP":case "BP":case "SI":case "DI":case "CS":case "DS":case "SS":case "ES":case "IP":case "PC":case "PS":case "C":case "P":case "A":case "Z":case "S":case "T":case "I":case "D":case "O":this.wa[c]=d;e=!0;break;default:e=Lb.prototype.Db.call(this,a,b,c,d)}return e};k.tb=function(a){return this.Fa[(a&this.Ae)>>this.zb].sc(a&this.mb)}; +k.Db=function(a,b,c){var d=!1;switch(b){case "AX":case "BX":case "CX":case "DX":case "SP":case "BP":case "SI":case "DI":case "CS":case "DS":case "SS":case "ES":case "IP":case "PC":case "PS":case "C":case "P":case "A":case "Z":case "S":case "T":case "I":case "D":case "O":this.wa[b]=c;d=!0;break;default:d=Lb.prototype.Db.call(this,a,b,c)}return d};k.tb=function(a){return this.Fa[(a&this.Ae)>>this.zb].sc(a&this.mb)}; k.ua=function(a){var b=a&this.mb;a=(a&this.Ae)>>this.zb;this.A-=this.B.Jj;return b!=this.mb?this.Fa[a].Zl(b):this.Fa[a++].sc(b)|this.Fa[a&this.Ee].sc(0)<<8};k.Pd=function(a,b){this.Fa[(a&this.Ae)>>this.zb].Hc(a&this.mb,b&255)};k.ed=function(a,b){var c=a&this.mb,d=(a&this.Ae)>>this.zb;this.A-=this.B.Jj;c!=this.mb?this.Fa[d].mm(c,b&65535):(this.Fa[d++].Hc(c,b&255),this.Fa[d&this.Ee].Hc(0,b>>8&255))};k.Km=function(a,b){this.Hg=a;this.la=a.ld(this.zg=b,0);return this.aa&1?0:this.tb(this.la)}; k.Lm=function(a,b){this.Hg=a;this.la=a.ld(this.zg=b,1);return this.aa&1?0:this.ua(this.la)};k.Rn=function(a,b){this.Hg=a;this.Ma=this.la=a.ld(this.zg=b,0);return this.aa&1?0:this.tb(this.la)};k.Sn=function(a,b){this.Hg=a;this.Ma=this.la=a.ld(this.zg=b,1);return this.aa&1?0:this.ua(this.la)};k.mp=function(a){this.aa&2||this.Pd(this.Hg.hc(this.zg,1),a)};k.np=function(a){this.aa&2||this.ed(this.Hg.hc(this.zg,2),a)};k.ha=function(){var a=this.tb(this.Ga);this.Ga=this.ya.Ya+(this.va=this.va+1&65535);return a}; k.M=function(){var a=this.tb(this.Ga)<<24>>24;this.Ga=this.ya.Ya+(this.va=this.va+1&65535);return a&65535};k.L=function(){var a=this.ua(this.Ga);this.Ga=this.ya.Ya+(this.va=this.va+2&65535);return a};k.La=function(){var a=this.Y;this.Y=this.Y+2&65535;return this.ua(this.Cb.ld(a,1))};function H(a,b){var c=a.Y=a.Y-2&65535;a.ed(a.Cb.hc(c,1),b)} @@ -429,7 +429,7 @@ this.H&255,this.Ga-2);Ab(this.ra,a+1&65535,this.H>>8,this.Ga-2);this.A-=this.B.t De,ue);0<=this.Nb&&(this.H=this.Nb)},function(){this.Nb=-1;Bh[this.ha()].call(this,Ee,ue);0<=this.Nb&&(this.H=this.Nb,this.K=this.Cg)},function(){this.Z&=~this.ga;this.A-=2},function(){this.Z|=this.ga;this.A-=2},function(){this.Ca&=-513;this.A-=this.B.Xk},function(){this.Ca|=512;this.aa|=4;this.A-=2},function(){this.Ca&=-1025;this.A-=2},function(){this.Ca|=1024;this.A-=2},function(){Ah[this.ha()].call(this,Mc,ue)},function(){Bh[this.ha()].call(this,Oc,ue)}]; function O(a){z.call(this,"ChipSet",a,O);this.Ia=(this.Ia=a.model)?parseInt(this.Ia,10):ai;this.ac=0;var b=a.sw1;if(b)this.ac=bi(b,ci|di.rm);else{this.Vd=[360,360];(b=a.floppies)&&b.length&&(this.Vd=b);if(b=this.Vd.length)this.ac|=ei.Zh,b--,this.ac|=(b&3)<=fi&&(this.dh=this.gh=2);this.uh=a.scaleTimers||!1;this.lp=a.rtcDate;this.Fk= !1;a.sound&&window&&"webkitAudioContext"in window&&(this.qi=new window.webkitAudioContext);this.reset(!0);this.Ua()}A(z,O);var ai=5150,fi=5170,gi={none:0,tv:1,color:2,mono:3,ega:0},ei={Zh:1,ONE:0,eq:64,cq:128,Cp:192,Jf:192,Kf:6},ci=12,di={dq:16,vp:32,rm:48,Jf:48,Kf:4};k=O.prototype; -k.Db=function(a,b,c,d){switch(c){case "sw1":return this.wa[c]=d,hi(this,c,d,this.ac,{0:this.Ia==ai?"Bootable Floppy Drive":"Loop on POST",1:this.Ia==ai?"Reserved":"Coprocessor",2:"Base Memory Size",4:"Monitor Type",6:"Number of Floppy Drives"}),!0;case "sw2":if(this.Ia==ai)return this.wa[c]=d,hi(this,c,d,this.ve,{0:"Expansion Memory Size",4:"Reserved"}),!0;break;case "swdesc":return this.wa[c]=d,!0}return!1}; +k.Db=function(a,b,c){switch(b){case "sw1":return this.wa[b]=c,hi(this,b,c,this.ac,{0:this.Ia==ai?"Bootable Floppy Drive":"Loop on POST",1:this.Ia==ai?"Reserved":"Coprocessor",2:"Base Memory Size",4:"Monitor Type",6:"Number of Floppy Drives"}),!0;case "sw2":if(this.Ia==ai)return this.wa[b]=c,hi(this,b,c,this.ve,{0:"Expansion Memory Size",4:"Reserved"}),!0;break;case "swdesc":return this.wa[b]=c,!0}return!1}; k.pc=function(a,b,c,d){this.ra=b;this.T=c;this.fa=d;this.Ka=a;this.Ra=eb(a,"Keyboard");this.Ul=Math.round(c.ca.Ld/1193181);tb(b,this,ii);zb(b,this,ji);this.Iab;b++){var c=13>=b?si(e,b):e.ta[b];a&&(a+="\n");a+="CMOS[0x"+t(b)+"]: 0x"+t(c)}e.fa.message(a)})}Xc(c,ti,this,this.Pn)};k.$b=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};k.Zb=function(a){return a&&this.save?this.save():!0}; k.reset=function(a){var b;this.fd=this.ac;this.af=this.ve;ui(this);this.jb=Array(this.dh);for(b=0;b=fi){this.qb=16;this.yd=0;this.jd=16;this.Ug=0;this.Be=160;512<=yi(this)&&(this.Be|=16);3==zi(this)&&(this.Be|=64);this.ji=3;this.Uf=0;this.Pg=Array(7);this.Ce=0;a&&(this.ta=Array(64));Ai(this, @@ -493,9 +493,9 @@ bs:14,tab:15,q:16,w:17,e:18,r:19,t:20,y:21,u:22,i:23,o:24,p:25,"[":26,"]":27,ent S[Q["7"]]=8;S[Q["&"]]=10760;S[Q["8"]]=9;S[Q["*"]]=10761;S[Q["9"]]=10;S[Q["("]]=10762;S[Q["0"]]=11;S[Q[")"]]=10763;S[Q["-"]]=12;S[Q._]=10764;S[Q["="]]=13;S[Q["+"]]=10765;S[1008]=14;S[1009]=15;S[113]=16;S[81]=10768;S[119]=17;S[87]=10769;S[101]=18;S[69]=10770;S[114]=19;S[82]=10771;S[116]=20;S[84]=10772;S[121]=21;S[89]=10773;S[117]=22;S[85]=10774;S[105]=23;S[73]=10775;S[111]=24;S[79]=10776;S[112]=25;S[80]=10777;S[Q["["]]=26;S[Q["{"]]=10778;S[Q["]"]]=27;S[Q["}"]]=10779;S[13]=28;S[1017]=29;S[97]=30; S[65]=10782;S[115]=31;S[83]=10783;S[100]=32;S[68]=10784;S[102]=33;S[70]=10785;S[103]=34;S[71]=10786;S[104]=35;S[72]=10787;S[106]=36;S[74]=10788;S[107]=37;S[75]=10789;S[108]=38;S[76]=10790;S[Q[";"]]=39;S[Q[":"]]=10791;S[Q["'"]]=40;S[Q['"']]=10792;S[Q["`"]]=41;S[Q["~"]]=10793;S[1016]=42;S[Q["\\"]]=43;S[Q["|"]]=10795;S[122]=44;S[90]=10796;S[120]=45;S[88]=10797;S[99]=46;S[67]=10798;S[118]=47;S[86]=10799;S[98]=48;S[66]=10800;S[110]=49;S[78]=10801;S[109]=50;S[77]=10802;S[Q[","]]=51;S[Q["<"]]=10803; S[Q["."]]=52;S[Q[">"]]=10804;S[Q["/"]]=53;S[Q["?"]]=10805;S[3016]=54;S[1018]=56;S[Q[" "]]=57;S[1020]=58;S[1112]=59;S[1113]=60;S[1114]=61;S[1115]=62;S[1116]=63;S[1117]=64;S[1118]=65;S[1119]=66;S[1120]=67;S[1121]=68;S[1144]=69;S[1145]=70;S[1036]=71;S[1038]=72;S[1033]=73;S[1037]=75;S[1039]=77;S[1035]=79;S[1040]=80;S[1034]=81;S[1045]=82;S[1046]=83;S[1122]=87;S[1123]=88;S[4003]=7470;S[4063]=7494;S[4081]=3677523;k=Gj.prototype; -k.Db=function(a,b,c,d){var e=this;a=b+"-"+c;if(void 0===this.wa[a])switch(c){case "kbd":return this.wa[a]=d,d.onkeydown=function(a){return Lj(e,a,!0)},d.onkeypress=function(a){var b=!0;a=a||window.event;a=a.which||a.keyCode;8==a||9==a?b=!1:e.bb&64?e.bb&=-65:e.bb&40?b=!1:(e.Ak&&a==Q["`"]&&(a=27),b=!Mj(e,a));return b},d.onkeyup=function(a){return Lj(e,a,!1)},!0;case "caps-lock":return this.wa[a]=d,d.onclick=function(){e.T&&e.T.Tc();Mj(e,1020,!0)},!0;case "num-lock":return this.wa[a]=d,d.onclick=function(){e.T&& -e.T.Tc();Mj(e,1144,!0)},!0;case "scroll-lock":return this.wa[a]=d,d.onclick=function(){e.T&&e.T.Tc();Mj(e,1145,!0)},!0;default:if(void 0!==Jj[c]&&"button"==b)return this.wa[a]=d,d.onclick=function(a,b,c){return function(){a.T&&a.T.Tc();Nj(a,c);return!Mj(a,c)}}(this,c,Jj[c]),!0;if(void 0!==Kj[c])return this.wa[a]=d,b=function(a,b,c){return function(){Oj(a,c)}}(this,c,Kj[c]),c=function(a,b,c){return function(){Oj(a,c)}}(this,c,Kj[c]|128),"ontouchstart"in window?(d.ontouchstart=b,d.ontouchend=c):(d.onmousedown= -b,d.onmouseup=d.onmouseout=c),!0}return!1};k.pc=function(a,b,c,d){this.ra=b;this.T=c;this.fa=d;this.oa=eb(a,"ChipSet")};k.Ua=function(){this.Dk=(this.Pm=Aa("iOS"))||Aa("Android");this.Sa("mobile keyboard support: "+(this.Dk?"true":"false"));return z.prototype.Ua.call(this)};function sj(a){a.Sa("keyboard reset",Pj);a.yc=[170];a.oa&&vj(a.oa)}function nj(a,b,c){var d=!1;a.Bi!==c&&(a.Bi=a.Fi=c);a.ph!==b&&(a.ph=b)&&!a.Fi&&uj(a);a.ph&&a.Fi&&(sj(a),a.Fi=!1,d=!0);return d} +k.Db=function(a,b,c){var d=this,e=a+"-"+b;if(void 0===this.wa[e])switch(b){case "kbd":return this.wa[e]=c,c.onkeydown=function(a){return Lj(d,a,!0)},c.onkeypress=function(a){var b=!0;a=a||window.event;a=a.which||a.keyCode;8==a||9==a?b=!1:d.bb&64?d.bb&=-65:d.bb&40?b=!1:(d.Ak&&a==Q["`"]&&(a=27),b=!Mj(d,a));return b},c.onkeyup=function(a){return Lj(d,a,!1)},!0;case "caps-lock":return this.wa[e]=c,c.onclick=function(){d.T&&d.T.Tc();Mj(d,1020,!0)},!0;case "num-lock":return this.wa[e]=c,c.onclick=function(){d.T&& +d.T.Tc();Mj(d,1144,!0)},!0;case "scroll-lock":return this.wa[e]=c,c.onclick=function(){d.T&&d.T.Tc();Mj(d,1145,!0)},!0;default:if(void 0!==Jj[b]&&"button"==a)return this.wa[e]=c,c.onclick=function(a,b,c){return function(){a.T&&a.T.Tc();Nj(a,c);return!Mj(a,c)}}(this,b,Jj[b]),!0;if(void 0!==Kj[b])return this.wa[e]=c,a=function(a,b,c){return function(){Oj(a,c)}}(this,b,Kj[b]),b=function(a,b,c){return function(){Oj(a,c)}}(this,b,Kj[b]|128),"ontouchstart"in window?(c.ontouchstart=a,c.ontouchend=b):(c.onmousedown= +a,c.onmouseup=c.onmouseout=b),!0}return!1};k.pc=function(a,b,c,d){this.ra=b;this.T=c;this.fa=d;this.oa=eb(a,"ChipSet")};k.Ua=function(){this.Dk=(this.Pm=Aa("iOS"))||Aa("Android");this.Sa("mobile keyboard support: "+(this.Dk?"true":"false"));return z.prototype.Ua.call(this)};function sj(a){a.Sa("keyboard reset",Pj);a.yc=[170];a.oa&&vj(a.oa)}function nj(a,b,c){var d=!1;a.Bi!==c&&(a.Bi=a.Fi=c);a.ph!==b&&(a.ph=b)&&!a.Fi&&uj(a);a.ph&&a.Fi&&(sj(a),a.Fi=!1,d=!0);return d} function kj(a,b){var c=0;a.yc.length&&(c=a.yc[0],a.Sa("scan code 0x"+t(c)+" delivered"),b&&uj(a));return c}function uj(a,b){0a.yc.length){if(!(!d&&!a.di[c]||d&&a.di[c])){a.di[c]=d;a.Sa("scan code 0x"+t(b)+" buffered");a.yc.push(b);1==a.yc.length&&a.oa&&vj(a.oa);for(var e in Kj)if(Kj[e]==c){(c=a.wa["key-"+e])&&void 0!==d&&(c.style.color=d?"#ffffff":"#000000",c.style.backgroundColor=d?"#000000":"#ffffff");break}}}else 20==a.yc.length&&a.yc.push(255),a.Sa("scan code buffer overflow")}function Qj(a,b){var c=b?a.Un:a.Tn;a.T&&a.T.ca.pd&&(c/=a.T.ca.pd);return c} @@ -527,7 +527,7 @@ a.Dh;c[16]=a.Ij;c[17]=a.ob;c[18]=a.qd;c[19]=a.vb;c[20]=a.Jh;c[21]=a.re;c[22]=a.S fk.prototype.Uh=function(a){if(null!=a&&a!=this.Dh){var b=a&255,c=wk[b];c||b&1&&(c=wk[1]);var b=a&65280,d=wk[b];d||b&256&&(d=wk[256]);this.Rf||(this.Rf=[null,uk,null,vk]);this.Rf[0]=c;this.Rf[2]=d;this.Dh=a}};var gk=[,["MDA",948,720896,4096,0,3],,["CGA",980,753664,16384,0,2],,["EGA",980,753664,16384,65536,4]];k=T.prototype; k.pc=function(a,b,c,d){this.ra=b;this.T=c;this.fa=d;tb(b,this,zk);zb(b,this,Ak);"ega"==this.Ia&&(tb(b,this,Bk),zb(b,this,Ck));if(d){var e=this;oi(d,Dk,function(a){if(e.Ha)if(a){var b=e.Ha;if(b.hd){a=da(a);a=void 0!==a?a-b.Va:b.cp||0;0>a&&(a=0);for(var c="",d=0;8>d;d++){for(var f=p(b.Va+a)+":",r=0;8>r&&aMissing <canvas> support; try a new web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.setAttribute("contenteditable","true");e.setAttribute("autocapitalize","off");e.setAttribute("autocorrect","off");e.style.backgroundColor=d.screenColor; e.style.height=c.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(e.style.height=(c.clientWidth*d.screenHeight/d.screenWidth|0)+"px",c.onresize=function(a,b,c,d){return function(){b.style.height=(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight));c.appendChild(e);var f=e.getContext("2d"),d=new T(d,e,f);Za(d,c)}}); -function Zk(a){this.Jk=a.adapter;switch(this.Jk){case 1:this.Oj=1016;this.rg=4;break;case 2:this.Oj=760;this.rg=3;break;default:x("Unrecognized serial adapter #"+this.Jk);return}this.fe=null;z.call(this,"SerialPort",a,Zk);var b=a.binding,c;a=$k;b&&(void 0===c&&(c="Panel"),(c=Xa(c,this.id))&&(b=c.wa[b])&&this.Db(null,null,a,b))}A(z,Zk);var $k="buffer";k=Zk.prototype;k.hk=function(a,b){return a==this.yh?(this.me=b,this):null}; -k.Db=function(a,b,c,d){var e=this;switch(c){case $k:return this.wa[c]=this.fe=d,d.onkeydown=function(a){a=a||window.event;var b=a.keyCode;8===b&&(a.preventDefault&&a.preventDefault(),al(e,[b]))},d.onkeypress=function(a){a=a||window.event;al(e,[a.which||a.keyCode])},!0}return!1};k.pc=function(a,b,c,d){this.ra=b;this.T=c;this.fa=d;this.oa=eb(a,"ChipSet");tb(b,this,bl,this.Oj);zb(b,this,cl,this.Oj);this.Ua()}; +function Zk(a){this.Jk=a.adapter;switch(this.Jk){case 1:this.Oj=1016;this.rg=4;break;case 2:this.Oj=760;this.rg=3;break;default:x("Unrecognized serial adapter #"+this.Jk);return}this.fe=null;z.call(this,"SerialPort",a,Zk);var b=a.binding,c;a=$k;b&&(void 0===c&&(c="Panel"),(c=Xa(c,this.id))&&(b=c.wa[b])&&this.Db(null,a,b))}A(z,Zk);var $k="buffer";k=Zk.prototype;k.hk=function(a,b){return a==this.yh?(this.me=b,this):null}; +k.Db=function(a,b,c){var d=this;switch(b){case $k:return this.wa[b]=this.fe=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;8===b&&(a.preventDefault&&a.preventDefault(),al(d,[b]))},c.onkeypress=function(a){a=a||window.event;al(d,[a.which||a.keyCode])},!0}return!1};k.pc=function(a,b,c,d){this.ra=b;this.T=c;this.fa=d;this.oa=eb(a,"ChipSet");tb(b,this,bl,this.Oj);zb(b,this,cl,this.Oj);this.Ua()}; k.$b=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Zb=function(a){return a&&this.save?this.save():!0};k.reset=function(){this.le()};k.save=function(){var a=new gd(this),b=0,c=[];c[b++]=this.mi;c[b++]=this.lk;c[b++]=this.bf;c[b++]=this.Wg;c[b++]=this.be;c[b++]=this.Wc;c[b++]=this.kd;c[b++]=this.Lc;c[b++]=this.jk;c[b]=this.Of;a.set(0,c);return a.data()};k.restore=function(a){return this.le(a[0])}; k.le=function(a){var b=0;void 0===a&&(a=[0,0,384,0,1,0,0,96,48,[]]);this.mi=a[b++];this.lk=a[b++];this.bf=a[b++];this.Wg=a[b++];this.be=a[b++];this.Wc=a[b++];this.kd=a[b++];this.Lc=a[b++];this.jk=a[b++];this.Of=a[b];return!0};function al(a,b){a.Of=a.Of.concat(b);dl(a)}function dl(a){0>8:this.Wg;this.ea(a,null,b,this.Wc&128?"DLM":"IER",c);return c};k.qn=function(a,b){var c=this.be;this.ea(a,null,b,"IIR",c);return c};k.rn=function(a,b){var c=this.Wc;this.ea(a,null,b,"LCR",c);return c};k.tn=function(a,b){var c=this.kd;this.ea(a,null,b,"MCR",c);return c}; @@ -603,8 +603,8 @@ k.restore=function(a){var b=0,c="unsupported restore format";if(a&&0b&&this.ia.Ja("unable to restore disk '"+this.sd+": "+c);return b};k.Sa=function(a){this.fa&&E(this.fa,wl)&&this.fa.message(a)}; function xl(a){z.call(this,"FDC",a,xl);this.dmaRead=this.ui;this.dmaWrite=this.vi;this.dmaFormat=this.xm;this.Je=null;if(a.autoMount&&(this.Je=a.autoMount,"string"==typeof this.Je))try{this.Je=eval("("+a.autoMount+")")}catch(b){x("FDC auto-mount error: "+b.message+" ("+a.autoMount+")"),this.Je=null}this.uc=[];this.Ck=!1}A(z,xl);m={};aa={}; var yl={3:{Ad:3,ee:0,name:aa.Xp},4:{Ad:2,ee:1,name:aa.Vp},5:{Ad:9,ee:7,name:aa.iq},6:{Ad:9,ee:7,name:aa.Pp},7:{Ad:2,ee:0,name:aa.Rp},8:{Ad:1,ee:2,name:aa.Wp},10:{Ad:2,ee:7,name:aa.Qp},13:{Ad:6,ee:7,name:aa.Bp},15:{Ad:3,ee:0,name:aa.Up}};k=xl.prototype; -k.Db=function(a,b,c,d){var e=this;switch(c){case "listDisks":return this.wa[c]=d,d.onchange=function(){var a=e.wa.descDisk,b=d.options[d.selectedIndex];if(a&&b){var c={};if(b=b.getAttribute("data-value"))try{c=eval("({"+b+"})")}catch(l){x("FDC option error: "+l.message)}b=c.desc;void 0===b&&(b="");c=c.href;void 0!==c&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.wa[c]=d,d.onchange=function(){var a=da(d.value,10);null!=a&&zl(e,a)}, -!0;case "loadDrive":return this.wa[c]=d,d.onclick=function(){var a=e.wa.listDisks;a&&Al(e,a.options[a.selectedIndex].text,a.value)},!0;case "mountDrive":return window&&"FileReader"in window?(this.Ck=!0,this.wa[c]=d,d.addEventListener("change",function(){var a=d.children[0];a.children[1].disabled=0==a.children[0].files.length}),d.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Al(e,fa(b,!0),b,a)}return!1}):d.parentNode.removeChild(d),!0}return!1}; +k.Db=function(a,b,c){var d=this;switch(b){case "listDisks":return this.wa[b]=c,c.onchange=function(){var a=d.wa.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("({"+b+"})")}catch(h){x("FDC option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.wa[b]=c,c.onchange=function(){var a=da(c.value,10);null!=a&&zl(d,a)},!0; +case "loadDrive":return this.wa[b]=c,c.onclick=function(){var a=d.wa.listDisks;a&&Al(d,a.options[a.selectedIndex].text,a.value)},!0;case "mountDrive":return window&&"FileReader"in window?(this.Ck=!0,this.wa[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=0==a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Al(d,fa(b,!0),b,a)}return!1}):c.parentNode.removeChild(c),!0}return!1}; k.pc=function(a,b,c,d){this.ra=b;this.T=c;this.fa=d;this.Ka=a;this.oa=eb(a,"ChipSet");this.Id();tb(b,this,Bl);zb(b,this,Cl);this.Ck&&Dl(this,"Local Disk","?");Dl(this,"Remote Disk","??");this.Sf()||this.Ua()}; k.$b=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.Ka.Ei){this.uc=[];for(var c=0;ce?String.fromCharCode(e):"."}return d}function oi(a,b,c){for(var d in Yl)if(b==Yl[d]){a.fi[d]=c;break}}function E(a,b){return(a.kc&b)===b} function $c(a,b,c){var d=Zl[b],e=d&&E(a,d);if(e){var f=a.T.H>>8,g=a.T.K&255;if(33==b&&11==f||d==zj&&128<=g||d==Tl&&128>g)e=!1}if(e){if(d=(d=gm[b])&&d[f]||"")g=a.T,a.pb[Z[0]]=t(g.H&255),a.pb[Z[1]]=t(g.J&255),a.pb[Z[2]]=t(g.K&255),a.pb[Z[3]]=t(g.C&255),a.pb[Z[4]]=t(g.H>>8),a.pb[Z[5]]=t(g.J>>8),a.pb[Z[6]]=t(g.K>>8),a.pb[Z[7]]=t(g.C>>8),a.pb[Z[8]]=v(g.H),a.pb[Z[9]]=v(g.J),a.pb[Z[10]]=v(g.K),a.pb[Z[11]]=v(g.C),a.pb[Z[12]]=v(g.Y),a.pb[Z[13]]=v(g.I),a.pb[Z[14]]=v(g.G),a.pb[Z[15]]=v(g.F),a.pb[Z[16]]=v(g.ab.sa), a.pb[Z[17]]=v(g.ya.sa),a.pb[Z[18]]=v(g.Cb.sa),a.pb[Z[19]]=v(g.Hb.sa),a.pb[Z[20]]=v(g.va),d=" "+ka(a.pb,d);a.message("INT 0x"+t(b)+": AH="+t(f)+" at "+ea(c-a.T.ya.Ya,a.T.ya.sa)+d)}return e}function bd(a,b,c,d,e){a.message("INT 0x"+t(b)+": C="+(od(a.T)?1:0)+(e||"")+" (cycles="+d+(c?",level="+(c+1):"")+")")} @@ -752,7 +752,7 @@ function Om(a,b){if(ua("There may be a problem with your PCjs machine.\n\nTo hel function Fm(a,b,c){var d,e="none",f=new gd(a,"1.16.0"),g=new gd(a,"1.16.0","validate"),h=pa();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.16.0");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.T&&a.T.Zb&&(c&&a.T.Fb(),d=a.T.Zb(b,c),"object"===typeof d&&f.set(a.T.id,d),c&&(a.T.qa.Qb=!1,!1===d&&(e=null)));for(var h=Va(a.id),l=0;l=this.sf?12:14;this.rc=1<>2;this.nb=this.rc-1;this.og=(this.qh+this.rc)/this.rc|0;this.$d=this.og-1;this.$f=[];this.ag=[];this.Yh();this.Na()}y(v,Pa);Pa.prototype.Yh=function(){this.Ba=Array(this.og);for(var a=0;a>a.Pb;0>this.Pb;0>a.Pb;0>a.Pb].aj(b&a.nb)}function Ya(a,b){var c=b&a.nb,d=(b&a.Zc)>>a.Pb;return c!=a.nb?a.Ba[d].eo(c):a.Ba[d++].aj(c)|a.Ba[d&a.$d].aj(0)<<8} -function Za(a,b,c){a.Ba[(b&a.Zc)>>a.Pb].ij(b&a.nb,c&255)}function $a(a,b,c){var d=b&a.nb;b=(b&a.Zc)>>a.Pb;d!=a.nb?a.Ba[b].qo(d,c&65535):(a.Ba[b++].ij(d,c&255),a.Ba[b&a.$d].ij(0,c>>8&255))}function ab(a){for(var b=0,c=[],d=0;d=this.sf?12:14;this.rc=1<>2;this.nb=this.rc-1;this.og=(this.qh+this.rc)/this.rc|0;this.$d=this.og-1;this.$f=[];this.ag=[];this.Yh();this.Na()}y(v,Pa); +Pa.prototype.Yh=function(){this.Ba=Array(this.og);for(var a=0;a>a.Pb;0>this.Pb;0>a.Pb;0>a.Pb].aj(b&a.nb)} +function Ya(a,b){var c=b&a.nb,d=(b&a.Zc)>>a.Pb;return c!=a.nb?a.Ba[d].eo(c):a.Ba[d++].aj(c)|a.Ba[d&a.$d].aj(0)<<8}function Za(a,b,c){a.Ba[(b&a.Zc)>>a.Pb].ij(b&a.nb,c&255)}function $a(a,b,c){var d=b&a.nb;b=(b&a.Zc)>>a.Pb;d!=a.nb?a.Ba[b].qo(d,c&65535):(a.Ba[b++].ij(d,c&255),a.Ba[b&a.$d].ij(0,c>>8&255))} +function ab(a){for(var b=0,c=[],d=0;d>2);for(d=0;dc&&(c=60);2>c&&(c=2);var d=1;b&&1a.ba.Jg&&(c=Math.round(c/a.ba.Gd));return c}function jb(a){a.ba.Rc=0;a.Mg=1;a.pe=a.Ld=a.Sc=a.A=0;kb(a);ob(a,1)} function ob(a,b,c){if(void 0!==b){0.8>a.ba.Rc/a.ba.Se&&(b=1);a.ba.Gd=b;b=a.ba.Jg*a.ba.Gd;if(a.ba.Se!=b){a.ba.Se=b;b=a.ba.Se.toFixed(2)+"Mhz";var d=a.qa.setSpeed;d&&(d.innerHTML=b);a.$b("target speed: "+b)}c&&a.od()}pb(a,a.Ld);a.Ld=0;a.ba.Te=ha();a.ba.me=0;qb(a)} function hb(a,b){if(Ka(a,!0)){if(!a.na.vc){ob(a);a.Ma&&a.Ma.start(a.ba.Te,rb(a));a.na.vc=!0;a.ja&&sb(a.ja);var c=a.qa.run;c&&(c.innerHTML="Halt");b&&a.od()}a.ba.fi>=a.ba.ld&&qb(a,!0);a.ba.zf=0;a.ba.Lg=ha();a.ba.me&&(c=a.ba.Lg-a.ba.me,c>a.ba.Vj&&(a.ba.Te+=c,a.ba.Te>a.ba.Lg&&(a.ba.Te=a.ba.Lg)));try{do{a.ol(a.na.xg?1:Math.round(a.ba.Zm/a.Mg));var d=a.Sc-a.A;a.Ld+=d;a.ba.zf+=d;pb(a,0,!0);var c=a,e=d;if(c.na.xg){var f=!1;c.ba.Og=c.ba.Og+c.Pj()|0;c.ba.Ue-=e;0>=c.ba.Ue&&(c.ba.Ue+=c.ba.uf,f=!0);0<=c.ba.vf&& @@ -54,7 +54,7 @@ function sc(a,b){switch(b){case "CS":return a.za;case "DS":return a.ac;case "SS" function uc(a,b){a.Ha=a.za.load(b)+a.va;a.Z|=a.Xf}function vc(a,b){a.ac.load(b);a.Z|=a.Xf}function wc(a,b){a.Vb.load(b);a.Z|=4}function xc(a,b){a.qb.load(b);a.Z|=a.Xf}function I(a,b){a.Ha=a.za.rb+(a.va=b&65535)}function jc(a,b,c){a.Ha=a.za.load(c)+(a.va=b)}function J(a,b){a.Ha=a.za.rb+(a.va=a.va+b&65535)}function yc(a){return a.X&a.ca?1:0}function Bc(a){return ub[a.ia&255]?4:0}function Cc(a){return(a.ia^a.la)&16?16:0}function Dc(a){return a.X&a.ca-1?0:64}function Ec(a){return a.ia&a.ca>>1?128:0} function Fc(a){return(a.ia^a.la^a.ia>>1)&a.ca>>1?2048:0}function Gc(a){a.X&=~a.ca}function Hc(a){a.la=a.ia&16|a.la&-17}function Ic(a){a.X|=a.ca-1}function Jc(a){a.ia&=~a.ca;a.la=a.ia&32896|a.la&-32897}function Kc(a){a.X|=a.ca}function Lc(a){a.la=~(a.ia&16)&16|a.la&-17}function Mc(a){a.X&=~(a.ca-1)}function Nc(a){Ec(a)||(a.ia^=a.ca>>1|a.ca>>2,a.la^=32896)}function Oc(a){a.ia|=a.ca;a.la=a.ia&32896|a.la&-32897}function mc(a){return a.Ga&-2262|yc(a)|Bc(a)|Cc(a)|Dc(a)|Ec(a)|Fc(a)} function kc(a,b){a.ca=256;a.X=a.ia=a.la=0;b&1&&Kc(a);b&4||(a.ia|=1);b&16&&(a.la|=16);b&64||Ic(a);b&128&&Nc(a);b&2048&&Oc(a);a.za.sc?b=b&-12289|a.Ga&12288:(a.Hd=(b&12288)>>12,!a.Hd||a.Lc&1||(a.Hd=0));a.za.sc>a.Hd&&(b=b&-513|a.Ga&512);a.Ga=a.Ga&-1793|b&1792|a.oj;a.Ga&256&&(a.gb|=2,a.Z|=4)} -k.Bb=function(a,b,c,d){var e=!1;switch(c){case "AX":case "BX":case "CX":case "DX":case "SP":case "BP":case "SI":case "DI":case "CS":case "DS":case "SS":case "ES":case "IP":case "PC":case "PS":case "C":case "P":case "A":case "Z":case "S":case "T":case "I":case "D":case "O":this.qa[c]=d;e=!0;break;default:e=gb.prototype.Bb.call(this,a,b,c,d)}return e};function Pc(a,b){return a.Ba[(b&a.Vd)>>a.Pb].yc(b&a.nb)} +k.Bb=function(a,b,c){var d=!1;switch(b){case "AX":case "BX":case "CX":case "DX":case "SP":case "BP":case "SI":case "DI":case "CS":case "DS":case "SS":case "ES":case "IP":case "PC":case "PS":case "C":case "P":case "A":case "Z":case "S":case "T":case "I":case "D":case "O":this.qa[b]=c;d=!0;break;default:d=gb.prototype.Bb.call(this,a,b,c)}return d};function Pc(a,b){return a.Ba[(b&a.Vd)>>a.Pb].yc(b&a.nb)} function E(a,b){var c=b&a.nb,d=(b&a.Vd)>>a.Pb;a.A-=a.B.Vi;return c!=a.nb?a.Ba[d].co(c):a.Ba[d++].yc(c)|a.Ba[d&a.$d].yc(0)<<8}function Qc(a,b,c){a.Ba[(b&a.Vd)>>a.Pb].Bc(b&a.nb,c&255)}function Rc(a,b,c){var d=b&a.nb;b=(b&a.Vd)>>a.Pb;a.A-=a.B.Vi;d!=a.nb?a.Ba[b].po(d,c&65535):(a.Ba[b++].Bc(d,c&255),a.Ba[b&a.$d].Bc(0,c>>8&255))}k.Pl=function(a,b){this.Sf=a;this.ha=a.cd(this.Lf=b,0);return this.Z&1?0:Pc(this,this.ha)};k.Ql=function(a,b){this.Sf=a;this.ha=a.cd(this.Lf=b,1);return this.Z&1?0:E(this,this.ha)}; k.Tm=function(a,b){this.Sf=a;this.Fa=this.ha=a.cd(this.Lf=b,0);return this.Z&1?0:Pc(this,this.ha)};k.Um=function(a,b){this.Sf=a;this.Fa=this.ha=a.cd(this.Lf=b,1);return this.Z&1?0:E(this,this.ha)};k.mo=function(a){this.Z&2||Qc(this,this.Sf.dc(this.Lf,1),a)};k.no=function(a){this.Z&2||Rc(this,this.Sf.dc(this.Lf,2),a)};k.da=function(){var a=Pc(this,this.Ha);this.Ha=this.za.rb+(this.va=this.va+1&65535);return a}; k.M=function(){var a=Pc(this,this.Ha)<<24>>24;this.Ha=this.za.rb+(this.va=this.va+1&65535);return a&65535};k.L=function(){var a=E(this,this.Ha);this.Ha=this.za.rb+(this.va=this.va+2&65535);return a};k.Ea=function(){var a=this.Y;this.Y=this.Y+2&65535;return E(this,this.Vb.cd(a,1))};function L(a,b){var c=a.Y=a.Y-2&65535;Rc(a,a.Vb.dc(c,1),b)} @@ -419,7 +419,7 @@ this.da();eb(this.ra,a,this.H&255,this.Ha-2);this.A-=this.B.Fi},function(){var a ec,Fd)}]; function R(a){v.call(this,"ChipSet",a,R);this.Da=(this.Da=a.model)?parseInt(this.Da,10):ih;this.Mb=0;var b=a.sw1;if(b)this.Mb=jh(b,kh|lh.vl);else{this.rd=[360,360];(b=a.floppies)&&b.length&&(this.rd=b);if(b=this.rd.length)this.Mb|=mh.jh,b--,this.Mb|=(b&3)<=nh&&(this.pg=this.qg=2);this.Dg=a.scaleTimers||!1;this.lo=a.rtcDate;this.Nj= !1;a.sound&&window&&"webkitAudioContext"in window&&(this.zh=new window.webkitAudioContext);this.reset(!0);this.Na()}y(v,R);var ih=5150,nh=5170,oh={none:0,tv:1,color:2,mono:3,ega:0},mh={jh:1,ONE:0,dp:64,bp:128,Bo:192,Ze:192,$e:6},kh=12,lh={cp:16,uo:32,vl:48,Ze:48,$e:4};k=R.prototype; -k.Bb=function(a,b,c,d){switch(c){case "sw1":return this.qa[c]=d,ph(this,c,d,this.Mb,{0:this.Da==ih?"Bootable Floppy Drive":"Loop on POST",1:this.Da==ih?"Reserved":"Coprocessor",2:"Base Memory Size",4:"Monitor Type",6:"Number of Floppy Drives"}),!0;case "sw2":if(this.Da==ih)return this.qa[c]=d,ph(this,c,d,this.Qd,{0:"Expansion Memory Size",4:"Reserved"}),!0;break;case "swdesc":return this.qa[c]=d,!0}return!1}; +k.Bb=function(a,b,c){switch(b){case "sw1":return this.qa[b]=c,ph(this,b,c,this.Mb,{0:this.Da==ih?"Bootable Floppy Drive":"Loop on POST",1:this.Da==ih?"Reserved":"Coprocessor",2:"Base Memory Size",4:"Monitor Type",6:"Number of Floppy Drives"}),!0;case "sw2":if(this.Da==ih)return this.qa[b]=c,ph(this,b,c,this.Qd,{0:"Expansion Memory Size",4:"Reserved"}),!0;break;case "swdesc":return this.qa[b]=c,!0}return!1}; k.oc=function(a,b,c,d){this.ra=b;this.ka=c;this.Va=d;this.Ma=a;this.Ka=B(a,"Keyboard");this.al=Math.round(c.ba.ld/1193181);bb(b,this,qh);db(b,this,rh);this.Da=nh){this.lb=16;this.$c=0;this.Nc=16;this.fg=0;this.Xd=160;512<=Ah(this)&&(this.Xd|=16);3==Bh(this)&&(this.Xd|=64);this.rh=3;this.ig=0;this.Ob=Array(7);this.Fe=0;a&&(this.oa=Array(64));Ch(this, this.lo);for(a=21;24>=a;a++)this.oa[a]=0;for(a=14;46>a;a++)void 0===this.oa[a]&&(this.oa[a]=0);this.oa[20]=this.Mc&(lh.Ze|2|mh.jh|mh.Ze);this.oa[16]=Dh(this,0)<<4|Dh(this,1);Eh(this)}}; @@ -474,9 +474,9 @@ bs:14,tab:15,q:16,w:17,e:18,r:19,t:20,y:21,u:22,i:23,o:24,p:25,"[":26,"]":27,ent T[S["7"]]=8;T[S["&"]]=10760;T[S["8"]]=9;T[S["*"]]=10761;T[S["9"]]=10;T[S["("]]=10762;T[S["0"]]=11;T[S[")"]]=10763;T[S["-"]]=12;T[S._]=10764;T[S["="]]=13;T[S["+"]]=10765;T[1008]=14;T[1009]=15;T[113]=16;T[81]=10768;T[119]=17;T[87]=10769;T[101]=18;T[69]=10770;T[114]=19;T[82]=10771;T[116]=20;T[84]=10772;T[121]=21;T[89]=10773;T[117]=22;T[85]=10774;T[105]=23;T[73]=10775;T[111]=24;T[79]=10776;T[112]=25;T[80]=10777;T[S["["]]=26;T[S["{"]]=10778;T[S["]"]]=27;T[S["}"]]=10779;T[13]=28;T[1017]=29;T[97]=30; T[65]=10782;T[115]=31;T[83]=10783;T[100]=32;T[68]=10784;T[102]=33;T[70]=10785;T[103]=34;T[71]=10786;T[104]=35;T[72]=10787;T[106]=36;T[74]=10788;T[107]=37;T[75]=10789;T[108]=38;T[76]=10790;T[S[";"]]=39;T[S[":"]]=10791;T[S["'"]]=40;T[S['"']]=10792;T[S["`"]]=41;T[S["~"]]=10793;T[1016]=42;T[S["\\"]]=43;T[S["|"]]=10795;T[122]=44;T[90]=10796;T[120]=45;T[88]=10797;T[99]=46;T[67]=10798;T[118]=47;T[86]=10799;T[98]=48;T[66]=10800;T[110]=49;T[78]=10801;T[109]=50;T[77]=10802;T[S[","]]=51;T[S["<"]]=10803; T[S["."]]=52;T[S[">"]]=10804;T[S["/"]]=53;T[S["?"]]=10805;T[3016]=54;T[1018]=56;T[S[" "]]=57;T[1020]=58;T[1112]=59;T[1113]=60;T[1114]=61;T[1115]=62;T[1116]=63;T[1117]=64;T[1118]=65;T[1119]=66;T[1120]=67;T[1121]=68;T[1144]=69;T[1145]=70;T[1036]=71;T[1038]=72;T[1033]=73;T[1037]=75;T[1039]=77;T[1035]=79;T[1040]=80;T[1034]=81;T[1045]=82;T[1046]=83;T[1122]=87;T[1123]=88;T[4003]=7470;T[4063]=7494;T[4081]=3677523;k=Bi.prototype; -k.Bb=function(a,b,c,d){var e=this;a=b+"-"+c;if(void 0===this.qa[a])switch(c){case "kbd":return this.qa[a]=d,d.onkeydown=function(a){return Gi(e,a,!0)},d.onkeypress=function(a){var b=!0;a=a||window.event;a=a.which||a.keyCode;8==a||9==a?b=!1:e.Qa&64?e.Qa&=-65:e.Qa&40?b=!1:(e.Ij&&a==S["`"]&&(a=27),b=!Hi(e,a));return b},d.onkeyup=function(a){return Gi(e,a,!1)},!0;case "caps-lock":return this.qa[a]=d,d.onclick=function(){e.ka&&e.ka.od();Hi(e,1020,!0)},!0;case "num-lock":return this.qa[a]=d,d.onclick=function(){e.ka&& -e.ka.od();Hi(e,1144,!0)},!0;case "scroll-lock":return this.qa[a]=d,d.onclick=function(){e.ka&&e.ka.od();Hi(e,1145,!0)},!0;default:if(void 0!==Ei[c]&&"button"==b)return this.qa[a]=d,d.onclick=function(a,b,c){return function(){a.ka&&a.ka.od();Ii(a,c);return!Hi(a,c)}}(this,c,Ei[c]),!0;if(void 0!==Fi[c])return this.qa[a]=d,b=function(a,b,c){return function(){Ji(a,c)}}(this,c,Fi[c]),c=function(a,b,c){return function(){Ji(a,c)}}(this,c,Fi[c]|128),"ontouchstart"in window?(d.ontouchstart=b,d.ontouchend=c): -(d.onmousedown=b,d.onmouseup=d.onmouseout=c),!0}return!1};k.oc=function(a,b,c,d){this.ra=b;this.ka=c;this.Va=d;this.ja=B(a,"ChipSet")};k.Na=function(){this.Ll=(this.Ul=qa("iOS"))||qa("Android");return v.prototype.Na.call(this)};function qi(a,b,c){var d=!1;a.Kh!==c&&(a.Kh=a.Oh=c);a.zg!==b&&(a.zg=b)&&!a.Oh&&vi(a);a.zg&&a.Oh&&(a.cc=[170],a.ja&&ui(a.ja),a.Oh=!1,d=!0);return d}function oi(a,b){var c=0;a.cc.length&&(c=a.cc[0],b&&vi(a));return c} +k.Bb=function(a,b,c){var d=this,e=a+"-"+b;if(void 0===this.qa[e])switch(b){case "kbd":return this.qa[e]=c,c.onkeydown=function(a){return Gi(d,a,!0)},c.onkeypress=function(a){var b=!0;a=a||window.event;a=a.which||a.keyCode;8==a||9==a?b=!1:d.Qa&64?d.Qa&=-65:d.Qa&40?b=!1:(d.Ij&&a==S["`"]&&(a=27),b=!Hi(d,a));return b},c.onkeyup=function(a){return Gi(d,a,!1)},!0;case "caps-lock":return this.qa[e]=c,c.onclick=function(){d.ka&&d.ka.od();Hi(d,1020,!0)},!0;case "num-lock":return this.qa[e]=c,c.onclick=function(){d.ka&& +d.ka.od();Hi(d,1144,!0)},!0;case "scroll-lock":return this.qa[e]=c,c.onclick=function(){d.ka&&d.ka.od();Hi(d,1145,!0)},!0;default:if(void 0!==Ei[b]&&"button"==a)return this.qa[e]=c,c.onclick=function(a,b,c){return function(){a.ka&&a.ka.od();Ii(a,c);return!Hi(a,c)}}(this,b,Ei[b]),!0;if(void 0!==Fi[b])return this.qa[e]=c,a=function(a,b,c){return function(){Ji(a,c)}}(this,b,Fi[b]),b=function(a,b,c){return function(){Ji(a,c)}}(this,b,Fi[b]|128),"ontouchstart"in window?(c.ontouchstart=a,c.ontouchend=b): +(c.onmousedown=a,c.onmouseup=c.onmouseout=b),!0}return!1};k.oc=function(a,b,c,d){this.ra=b;this.ka=c;this.Va=d;this.ja=B(a,"ChipSet")};k.Na=function(){this.Ll=(this.Ul=qa("iOS"))||qa("Android");return v.prototype.Na.call(this)};function qi(a,b,c){var d=!1;a.Kh!==c&&(a.Kh=a.Oh=c);a.zg!==b&&(a.zg=b)&&!a.Oh&&vi(a);a.zg&&a.Oh&&(a.cc=[170],a.ja&&ui(a.ja),a.Oh=!1,d=!0);return d}function oi(a,b){var c=0;a.cc.length&&(c=a.cc[0],b&&vi(a));return c} function vi(a,b){0a.cc.length){if(!(!d&&!a.oh[c]||d&&a.oh[c])){a.oh[c]=d;a.cc.push(b);1==a.cc.length&&a.ja&&ui(a.ja);for(var e in Fi)if(Fi[e]==c){(c=a.qa["key-"+e])&&void 0!==d&&(c.style.color=d?"#ffffff":"#000000",c.style.backgroundColor=d?"#000000":"#ffffff");break}}}else 20==a.cc.length&&a.cc.push(255)} function Ki(a,b){var c=b?a.Wm:a.Vm;a.ka&&a.ka.ba.Rc&&(c/=a.ka.ba.Rc);return c}function Li(a,b){!a.qe||void 0!==b&&b==a.qe||(clearTimeout(a.Xc[a.qe]),Mi(a,a.qe,!1))}function Ni(a,b){var c,d;for(d in Di){var e="led-"+d,f=Di[d];b&&b!=f||!(c=a.qa[e])||(c.style.backgroundColor=a.Qa&f?"#00ff00":"#000000")}}function Ii(a,b){var c;if(T[b]){var d=Math.floor(b/1E3)&2,e=Ci[Math.floor(b%1E3)]||0;e&&(d&&(e>>=1),e&1792&&(c=!(a.Qa&e)),a.Qa&=~e,c&&(a.Qa|=e),Ni(a,e))}} @@ -502,8 +502,8 @@ Y[4096]=function(a){a+=this.offset;var b=this.pa[a]&~this.ea.cb|this.ea.xb&this. Y[40960]=function(a,b){var c=a+this.offset,d=Wi[b&15],d=d|this.ea.xb,d=d&this.ea.cb|this.pa[c]&~this.ea.cb,d=d&this.ea.hb|this.ea.xb&~this.ea.hb;this.pa[c]!=d&&(this.pa[c]=d,this.fb=!0)};Y[57344]=function(a,b){var c=a+this.offset,d=Wi[b&15],d=d^this.ea.xb,d=d&this.ea.cb|this.pa[c]&~this.ea.cb,d=d&this.ea.hb|this.ea.xb&~this.ea.hb;this.pa[c]!=d&&(this.pa[c]=d,this.fb=!0)}; function cj(a){var b=[];if(void 0!==a.Gg){b[0]=a.Jc;b[1]=a.pc;b[2]=a.kf;b[3]=a.Uf;b[4]=a.wc|a.Fg<<8;b[5]=a.bc;if(5==a.Gg){var c=[];c[0]=a.Cd;c[1]=a.le;c[2]=a.Sd;c[3]=a.hj;c[4]=a.Kg;c[5]=a.Qh;c[6]=a.Qe;c[7]=a.bg;c[8]=a.Th;c[9]=a.Uh;c[10]=a.Pe;c[11]=a.Be;c[12]=a.xb;c[13]=[a.Ra,a.Db,a.Hc];var d;a:if(d=a.Wd){var e=0,f=[];if(void 0!==d[0])for(var h=0;2>h;h++)for(var g=h;g>1;f[e++]=m;g=n}if(f.lengthMissing <canvas> support; try a new web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.setAttribute("contenteditable","true");e.setAttribute("autocapitalize","off");e.setAttribute("autocorrect","off");e.style.backgroundColor=d.screenColor; e.style.height=c.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(e.style.height=(c.clientWidth*d.screenHeight/d.screenWidth|0)+"px",c.onresize=function(a,b,c,d){return function(){b.style.height=(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight));c.appendChild(e);var f=e.getContext("2d"),d=new U(d,e,f);Ja(d,c)}}); -function Z(a){this.Qj=a.adapter;switch(this.Qj){case 1:this.$i=1016;this.Df=4;break;case 2:this.$i=760;this.Df=3;break;default:s("Unrecognized serial adapter #"+this.Qj);return}this.yd=null;v.call(this,"SerialPort",a,Z);var b=a.binding,c;a=Aj;b&&(void 0===c&&(c="Panel"),(c=Ia(c,this.id))&&(b=c.qa[b])&&this.Bb(null,null,a,b))}y(v,Z);var Aj="buffer";k=Z.prototype;k.tj=function(a,b){return a==this.Wh?(this.Fd=b,this):null}; -k.Bb=function(a,b,c,d){var e=this;switch(c){case Aj:return this.qa[c]=this.yd=d,d.onkeydown=function(a){a=a||window.event;var b=a.keyCode;8===b&&(a.preventDefault&&a.preventDefault(),Bj(e,[b]))},d.onkeypress=function(a){a=a||window.event;Bj(e,[a.which||a.keyCode])},!0}return!1};k.oc=function(a,b,c,d){this.ra=b;this.ka=c;this.Va=d;this.ja=B(a,"ChipSet");bb(b,this,Cj,this.$i);db(b,this,Dj,this.$i);this.Na()}; +function Z(a){this.Qj=a.adapter;switch(this.Qj){case 1:this.$i=1016;this.Df=4;break;case 2:this.$i=760;this.Df=3;break;default:s("Unrecognized serial adapter #"+this.Qj);return}this.yd=null;v.call(this,"SerialPort",a,Z);var b=a.binding,c;a=Aj;b&&(void 0===c&&(c="Panel"),(c=Ia(c,this.id))&&(b=c.qa[b])&&this.Bb(null,a,b))}y(v,Z);var Aj="buffer";k=Z.prototype;k.tj=function(a,b){return a==this.Wh?(this.Fd=b,this):null}; +k.Bb=function(a,b,c){var d=this;switch(b){case Aj:return this.qa[b]=this.yd=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;8===b&&(a.preventDefault&&a.preventDefault(),Bj(d,[b]))},c.onkeypress=function(a){a=a||window.event;Bj(d,[a.which||a.keyCode])},!0}return!1};k.oc=function(a,b,c,d){this.ra=b;this.ka=c;this.Va=d;this.ja=B(a,"ChipSet");bb(b,this,Cj,this.$i);db(b,this,Dj,this.$i);this.Na()}; k.Sb=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Rb=function(a){return a&&this.save?this.save():!0};k.reset=function(){this.Ed()};k.save=function(){var a=new G(this),b=0,c=[];c[b++]=this.uh;c[b++]=this.xj;c[b++]=this.xe;c[b++]=this.hg;c[b++]=this.ud;c[b++]=this.Zd;c[b++]=this.Oc;c[b++]=this.qc;c[b++]=this.vj;c[b]=this.bf;a.set(0,c);return a.data()};k.restore=function(a){return this.Ed(a[0])}; k.Ed=function(a){var b=0;void 0===a&&(a=[0,0,384,0,1,0,0,96,48,[]]);this.uh=a[b++];this.xj=a[b++];this.xe=a[b++];this.hg=a[b++];this.ud=a[b++];this.Zd=a[b++];this.Oc=a[b++];this.qc=a[b++];this.vj=a[b++];this.bf=a[b];return!0};function Bj(a,b){a.bf=a.bf.concat(b);Ej(a)}function Ej(a){0>8:this.hg};k.um=function(){return this.ud};k.vm=function(){return this.Zd};k.xm=function(){return this.Oc};k.wm=function(){return this.qc};k.Dm=function(){return this.vj}; @@ -571,9 +571,9 @@ k.restore=function(a){var b=0,c="unsupported restore format";if(a&&0b&&this.ea.ya("unable to restore disk '"+this.Vc+": "+c);return b}; function Uj(a){v.call(this,"FDC",a,Uj);this.dmaRead=this.Dh;this.dmaWrite=this.Eh;this.dmaFormat=this.Bl;this.ee=null;if(a.autoMount&&(this.ee=a.autoMount,"string"==typeof this.ee))try{this.ee=eval("("+a.autoMount+")")}catch(b){s("FDC auto-mount error: "+b.message+" ("+a.autoMount+")"),this.ee=null}this.ic=[];this.Kj=!1}y(v,Uj);l={};aa={}; var Vj={3:{bd:3,xd:0,name:aa.Wo},4:{bd:2,xd:1,name:aa.Uo},5:{bd:9,xd:7,name:aa.hp},6:{bd:9,xd:7,name:aa.Oo},7:{bd:2,xd:0,name:aa.Qo},8:{bd:1,xd:2,name:aa.Vo},10:{bd:2,xd:7,name:aa.Po},13:{bd:6,xd:7,name:aa.Ao},15:{bd:3,xd:0,name:aa.To}};k=Uj.prototype; -k.Bb=function(a,b,c,d){var e=this;switch(c){case "listDisks":return this.qa[c]=d,d.onchange=function(){var a=e.qa.descDisk,b=d.options[d.selectedIndex];if(a&&b){var c={};if(b=b.getAttribute("data-value"))try{c=eval("({"+b+"})")}catch(m){s("FDC option error: "+m.message)}b=c.desc;void 0===b&&(b="");c=c.href;void 0!==c&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.qa[c]=d,d.onchange=function(){var a;a=d.value;var b=10,c;if(a){b||(b= -16);if("$"==a.charAt(0))b=16,a=a.substr(1);else if("0x"==a.substr(0,2))b=16,a=a.substr(2);else{var m=a.charAt(a.length-1).toLowerCase();"h"==m?(b=16,m=null):"."==m&&(b=10,m=null);null===m&&(a=a.substr(0,a.length-1))}var n;ca(a,b)&&!isNaN(n=parseInt(a,b))&&(c=n)}a=c;null!=a&&Wj(e,a)},!0;case "loadDrive":return this.qa[c]=d,d.onclick=function(){var a=e.qa.listDisks;a&&Xj(e,a.options[a.selectedIndex].text,a.value)},!0;case "mountDrive":return window&&"FileReader"in window?(this.Kj=!0,this.qa[c]=d,d.addEventListener("change", -function(){var a=d.children[0];a.children[1].disabled=0==a.children[0].files.length}),d.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Xj(e,da(b,!0),b,a)}return!1}):d.parentNode.removeChild(d),!0}return!1};k.oc=function(a,b,c,d){this.ra=b;this.ka=c;this.Va=d;this.Ma=a;this.ja=B(a,"ChipSet");this.hd();bb(b,this,Yj);db(b,this,Zj);this.Kj&&ak(this,"Local Disk","?");ak(this,"Remote Disk","??");this.ef()||this.Na()}; +k.Bb=function(a,b,c){var d=this;switch(b){case "listDisks":return this.qa[b]=c,c.onchange=function(){var a=d.qa.descDisk,b=c.options[c.selectedIndex];if(a&&b){var h={};if(b=b.getAttribute("data-value"))try{h=eval("({"+b+"})")}catch(g){s("FDC option error: "+g.message)}b=h.desc;void 0===b&&(b="");h=h.href;void 0!==h&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.qa[b]=c,c.onchange=function(){var a;a=c.value;var b=10,h;if(a){b||(b=16); +if("$"==a.charAt(0))b=16,a=a.substr(1);else if("0x"==a.substr(0,2))b=16,a=a.substr(2);else{var g=a.charAt(a.length-1).toLowerCase();"h"==g?(b=16,g=null):"."==g&&(b=10,g=null);null===g&&(a=a.substr(0,a.length-1))}var m;ca(a,b)&&!isNaN(m=parseInt(a,b))&&(h=m)}a=h;null!=a&&Wj(d,a)},!0;case "loadDrive":return this.qa[b]=c,c.onclick=function(){var a=d.qa.listDisks;a&&Xj(d,a.options[a.selectedIndex].text,a.value)},!0;case "mountDrive":return window&&"FileReader"in window?(this.Kj=!0,this.qa[b]=c,c.addEventListener("change", +function(){var a=c.children[0];a.children[1].disabled=0==a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Xj(d,da(b,!0),b,a)}return!1}):c.parentNode.removeChild(c),!0}return!1};k.oc=function(a,b,c,d){this.ra=b;this.ka=c;this.Va=d;this.Ma=a;this.ja=B(a,"ChipSet");this.hd();bb(b,this,Yj);db(b,this,Zj);this.Kj&&ak(this,"Local Disk","?");ak(this,"Remote Disk","??");this.ef()||this.Na()}; k.Sb=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.Ma.Nh){this.ic=[];for(var c=0;ca[1];a=a[2];this.na.Hb=!0;this.Jj||(this.$b("PCj function Ak(a,b){if(ma("There may be a problem with your PCjs machine.\n\nTo help us diagnose it, click OK to send this PCjs machine state to http://www.pcjs.org.")){var c=a.Dd(),d=b.toString(),e={app:"PCjs",ver:"1.16.0"};e.url=a.url;e.user=c;e.type="bug";e.data=d;r("http://www.pcjs.org/api/v1/report",!0,e)}} function Ck(a,b,c){var d,e="none",f=new G(a,"1.16.0"),h=new G(a,"1.16.0","validate"),g=ia();h.set("timestamp",g);f.set("timestamp",g);f.set("version","1.16.0");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.ka&&a.ka.Rb&&(c&&mb(a.ka),d=a.ka.Rb(b,c),"object"===typeof d&&f.set(a.ka.id,d),c&&(a.ka.na.Hb=!1,!1===d&&(e=null)));for(var g=Ga(a.id),m=0;m - + - - + - + - +
-
+
@@ -300,7 +300,7 @@

-
+
diff --git a/modules/pcjs/lib/chipset.js b/modules/pcjs/lib/chipset.js index 0810abaa6..3d2f66032 100644 --- a/modules/pcjs/lib/chipset.js +++ b/modules/pcjs/lib/chipset.js @@ -889,13 +889,12 @@ ChipSet.COPROC = { // TODO: Define a variable for this /** * @this {ChipSet} - * @param {string|null} sHTMLClass is the class of the HTML control (eg, "input", "output") * @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas") * @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "sw1") * @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement) * @return {boolean} true if binding was successful, false if unrecognized binding request */ -ChipSet.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, control) +ChipSet.prototype.setBinding = function(sHTMLType, sBinding, control) { switch (sBinding) { case "sw1": diff --git a/modules/pcjs/lib/computer.js b/modules/pcjs/lib/computer.js index 7fc03a237..fa5291626 100644 --- a/modules/pcjs/lib/computer.js +++ b/modules/pcjs/lib/computer.js @@ -894,16 +894,15 @@ Computer.prototype.stop = function(ms, nCycles) }; /** - * setBinding(sHTMLClass, sHTMLType, sBinding, control) + * setBinding(sHTMLType, sBinding, control) * * @this {Computer} - * @param {string|null} sHTMLClass is the class of the HTML control (eg, "input", "output") * @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas") * @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "reset") * @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement) * @return {boolean} true if binding was successful, false if unrecognized binding request */ -Computer.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, control) +Computer.prototype.setBinding = function(sHTMLType, sBinding, control) { var computer = this; switch (sBinding) { diff --git a/modules/pcjs/lib/cpu.js b/modules/pcjs/lib/cpu.js index 1b512afec..91ae0b431 100644 --- a/modules/pcjs/lib/cpu.js +++ b/modules/pcjs/lib/cpu.js @@ -477,16 +477,15 @@ CPU.prototype.displayVideo = function() }; /** - * setBinding(sHTMLClass, sHTMLType, sBinding, control) + * setBinding(sHTMLType, sBinding, control) * * @this {CPU} - * @param {string|null} sHTMLClass is the class of the HTML control (eg, "input", "output") * @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas") * @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "run") * @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement) * @return {boolean} true if binding was successful, false if unrecognized binding request */ -CPU.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, control) +CPU.prototype.setBinding = function(sHTMLType, sBinding, control) { var cpu = this; var fBound = false; diff --git a/modules/pcjs/lib/debugger.js b/modules/pcjs/lib/debugger.js index 4e9d37340..ca564a265 100644 --- a/modules/pcjs/lib/debugger.js +++ b/modules/pcjs/lib/debugger.js @@ -1207,16 +1207,15 @@ if (DEBUGGER) { }; /** - * setBinding(sHTMLClass, sHTMLType, sBinding, control) + * setBinding(sHTMLType, sBinding, control) * * @this {Debugger} - * @param {string|null} sHTMLClass is the class of the HTML control (eg, "input", "output") * @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas") * @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "debugInput") * @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement) * @return {boolean} true if binding was successful, false if unrecognized binding request */ - Debugger.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, control) + Debugger.prototype.setBinding = function(sHTMLType, sBinding, control) { var dbg = this; switch (sBinding) { diff --git a/modules/pcjs/lib/fdc.js b/modules/pcjs/lib/fdc.js index 889ddeabe..dabefb43c 100644 --- a/modules/pcjs/lib/fdc.js +++ b/modules/pcjs/lib/fdc.js @@ -407,16 +407,15 @@ FDC.aCmdInfo = { }; /** - * setBinding(sHTMLClass, sHTMLType, sBinding, control) + * setBinding(sHTMLType, sBinding, control) * * @this {FDC} - * @param {string|null} sHTMLClass is the class of the HTML control (eg, "input", "output") * @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas") * @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "listDisks") * @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement) * @return {boolean} true if binding was successful, false if unrecognized binding request */ -FDC.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, control) +FDC.prototype.setBinding = function(sHTMLType, sBinding, control) { var fdc = this; diff --git a/modules/pcjs/lib/hdc.js b/modules/pcjs/lib/hdc.js index cefee42c3..5440e0767 100644 --- a/modules/pcjs/lib/hdc.js +++ b/modules/pcjs/lib/hdc.js @@ -493,16 +493,15 @@ HDC.BIOS.DISK_CMD = { }; /** - * setBinding(sHTMLClass, sHTMLType, sBinding, control) + * setBinding(sHTMLType, sBinding, control) * * @this {HDC} - * @param {string|null} sHTMLClass is the class of the HTML control (eg, "input", "output") * @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas") * @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "listDisks") * @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement) * @return {boolean} true if binding was successful, false if unrecognized binding request */ -HDC.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, control) +HDC.prototype.setBinding = function(sHTMLType, sBinding, control) { /* * This is reserved for future use; for now, hard disk images can be specified during initialization only (no "hot-swapping") diff --git a/modules/pcjs/lib/keyboard.js b/modules/pcjs/lib/keyboard.js index 35953d21f..3b1f68ae1 100644 --- a/modules/pcjs/lib/keyboard.js +++ b/modules/pcjs/lib/keyboard.js @@ -770,29 +770,28 @@ Keyboard.LIMIT = { }; /** - * setBinding(sHTMLClass, sHTMLType, sBinding, control) + * setBinding(sHTMLType, sBinding, control) * * @this {Keyboard} - * @param {string|null} sHTMLClass is the class of the HTML control (eg, "input", "output") * @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas") * @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "esc") * @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement) * @return {boolean} true if binding was successful, false if unrecognized binding request */ -Keyboard.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, control) +Keyboard.prototype.setBinding = function(sHTMLType, sBinding, control) { /* * There's a special binding that the Video component uses ("kbd") to effectively bind its * canvas to the entire keyboard, in Video.powerUp(); ie: * - * video.kbd.setBinding("input", "canvas", "kbd", video.canvasScreen); + * video.kbd.setBinding("canvas", "kbd", video.canvasScreen); * or: - * video.kbd.setBinding("input", "textarea", "kbd", video.textareaScreen); + * video.kbd.setBinding("textarea", "kbd", video.textareaScreen); * * However, it's also possible for the keyboard XML definition to define a control that serves * a similar purpose; eg: * - * Kbd + * Kbd * * The latter is purely experimental, while we work on finding ways to trigger the soft keyboard on * certain pesky devices (like the Kindle Fire). Note that even if you use the latter, the former will diff --git a/modules/pcjs/lib/panel.js b/modules/pcjs/lib/panel.js index c8fe01ecf..e38432b85 100644 --- a/modules/pcjs/lib/panel.js +++ b/modules/pcjs/lib/panel.js @@ -53,29 +53,28 @@ function Panel(parmsPanel) { Component.subclass(Component, Panel); /** - * setBinding(sHTMLClass, sHTMLType, sBinding, control) + * setBinding(sHTMLType, sBinding, control) * * The Panel doesn't have any bindings of its own; it passes along all binding requests to * the Computer, CPU, Keyboard and Debugger components. The order shouldn't matter, since any * component that doesn't recognize the specified binding should simply ignore it. * * @this {Panel} - * @param {string|null} sHTMLClass is the class of the HTML control (eg, "input", "output") * @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas") * @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "reset") * @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement) * @return {boolean} true if binding was successful, false if unrecognized binding request */ -Panel.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, control) +Panel.prototype.setBinding = function(sHTMLType, sBinding, control) { - if (this.cmp && this.cmp.setBinding(sHTMLClass, sHTMLType, sBinding, control)) return true; - if (this.cpu && this.cpu.setBinding(sHTMLClass, sHTMLType, sBinding, control)) return true; - if (this.kbd && this.kbd.setBinding(sHTMLClass, sHTMLType, sBinding, control)) return true; - if (DEBUGGER && this.dbg && this.dbg.setBinding(sHTMLClass, sHTMLType, sBinding, control)) return true; + if (this.cmp && this.cmp.setBinding(sHTMLType, sBinding, control)) return true; + if (this.cpu && this.cpu.setBinding(sHTMLType, sBinding, control)) return true; + if (this.kbd && this.kbd.setBinding(sHTMLType, sBinding, control)) return true; + if (DEBUGGER && this.dbg && this.dbg.setBinding(sHTMLType, sBinding, control)) return true; /* * TODO: Determine how to declare this superclass method in order to avoid a type warning */ - return Component.prototype.setBinding.call(this, sHTMLClass, sHTMLType, sBinding, control); + return Component.prototype.setBinding.call(this, sHTMLType, sBinding, control); }; /** diff --git a/modules/pcjs/lib/serial.js b/modules/pcjs/lib/serial.js index c7d4b3bb6..f08287096 100644 --- a/modules/pcjs/lib/serial.js +++ b/modules/pcjs/lib/serial.js @@ -282,16 +282,15 @@ SerialPort.prototype.syncMouse = function() { */ /** - * setBinding(sHTMLClass, sHTMLType, sBinding, control) + * setBinding(sHTMLType, sBinding, control) * * @this {SerialPort} - * @param {string|null} sHTMLClass is the class of the HTML control (eg, "input", "output") * @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas") * @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "buffer") * @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement) * @return {boolean} true if binding was successful, false if unrecognized binding request */ -SerialPort.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, control) { +SerialPort.prototype.setBinding = function(sHTMLType, sBinding, control) { var serial = this; switch (sBinding) { case SerialPort.sIOBuffer: diff --git a/modules/pcjs/lib/video.js b/modules/pcjs/lib/video.js index bb4718283..2f8d00cc0 100644 --- a/modules/pcjs/lib/video.js +++ b/modules/pcjs/lib/video.js @@ -1983,9 +1983,9 @@ Video.prototype.initBus = function(cmp, bus, cpu, dbg) this.kbd = cmp.getComponentByType("Keyboard"); if (this.kbd && this.canvasScreen) { for (var s in this.bindings) { - if (s.indexOf("lock") > 0) this.kbd.setBinding("input", "led", s, this.bindings[s]); + if (s.indexOf("lock") > 0) this.kbd.setBinding("led", s, this.bindings[s]); } - this.kbd.setBinding("input", this.textareaScreen? "textarea" : "canvas", "kbd", this.textareaScreen || this.canvasScreen); + this.kbd.setBinding(this.textareaScreen? "textarea" : "canvas", "kbd", this.textareaScreen || this.canvasScreen); } this.bEGASW = 0x9; // our default "switches" setting (see aEGAMonitorSwitches) @@ -1998,16 +1998,15 @@ Video.prototype.initBus = function(cmp, bus, cpu, dbg) }; /** - * setBinding(sHTMLClass, sHTMLType, sBinding, control) + * setBinding(sHTMLType, sBinding, control) * * @this {Video} - * @param {string|null} sHTMLClass is the class of the HTML control (eg, "input", "output") * @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas") * @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "refresh") * @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement) * @return {boolean} true if binding was successful, false if unrecognized binding request */ -Video.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, control) +Video.prototype.setBinding = function(sHTMLType, sBinding, control) { var video = this; var canvas, lockPointer; diff --git a/modules/pcjs/lib/x86cpu.js b/modules/pcjs/lib/x86cpu.js index 0fd5f6eb5..938e2e0cf 100644 --- a/modules/pcjs/lib/x86cpu.js +++ b/modules/pcjs/lib/x86cpu.js @@ -1682,16 +1682,15 @@ X86CPU.prototype.traceLog = function(prop, dst, src, flagsIn, flagsOut, result) }; /** - * setBinding(sHTMLClass, sHTMLType, sBinding, control) + * setBinding(sHTMLType, sBinding, control) * * @this {X86CPU} - * @param {string|null} sHTMLClass is the class of the HTML control (eg, "input", "output") * @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas") * @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "AX") * @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement) * @return {boolean} true if binding was successful, false if unrecognized binding request */ -X86CPU.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, control) +X86CPU.prototype.setBinding = function(sHTMLType, sBinding, control) { var fBound = false; switch (sBinding) { @@ -1723,7 +1722,7 @@ X86CPU.prototype.setBinding = function(sHTMLClass, sHTMLType, sBinding, control) fBound = true; break; default: - fBound = CPU.prototype.setBinding.call(this, sHTMLClass, sHTMLType, sBinding, control); + fBound = CPU.prototype.setBinding.call(this, sHTMLType, sBinding, control); break; } return fBound; diff --git a/modules/pcjs/templates/components.xsl b/modules/pcjs/templates/components.xsl index 639ab58a2..0ad7caa72 100644 --- a/modules/pcjs/templates/components.xsl +++ b/modules/pcjs/templates/components.xsl @@ -351,27 +351,27 @@ - + - - + - + - +
- +
@@ -379,7 +379,7 @@ -
+

@@ -391,7 +391,7 @@
-
+
diff --git a/modules/shared/lib/component.js b/modules/shared/lib/component.js index edef44751..d13cc705f 100644 --- a/modules/shared/lib/component.js +++ b/modules/shared/lib/component.js @@ -189,10 +189,6 @@ Component.extend = function(o, p) /** * Component.subclass(superclass, subclass, methods, statics) * - * TODO: Determine why every subclass created by this function ends up with a name prefix of "Component.subclass" - * in Chrome's call stack, rather than the (more logical) name of the subclass constructor. Is there a different - * design pattern I should be using that creates subclasses more to Chrome's liking? - * * See: Flanagan, David (2011-04-18). JavaScript: The Definitive Guide: The Definitive Guide (Kindle Locations 9854-9903). OReilly Media - A. Kindle Edition (Example 9-11) * * @param {Object} superclass is the constructor of the superclass @@ -492,7 +488,7 @@ Component.bindExternalControl = function(component, sControl, sBinding, sType) if (target) { var eBinding = target.bindings[sControl]; if (eBinding) { - component.setBinding(null, null, sBinding, eBinding); + component.setBinding(null, sBinding, eBinding); } } } @@ -527,11 +523,10 @@ Component.bindComponentControls = function(component, element, sAppClass) var parms; sClass = aClasses[iClass]; switch (sClass) { - case sAppClass + "-input": - case sAppClass + "-output": + case sAppClass + "-binding": parms = Component.getComponentParms(control); if (parms && parms['binding']) { - component.setBinding(sClass, parms['type'], parms['binding'], control); + component.setBinding(parms['type'], parms['binding'], control); } else { Component.log('Component.bindComponentControls("' + component.toString() + '"): missing binding' + (parms? ' for ' + parms['type'] : ''), "warning"); } @@ -610,18 +605,17 @@ Component.prototype = { return nMachine; }, /** - * setBinding(sHTMLClass, sHTMLType, sBinding, control) + * setBinding(sHTMLType, sBinding, control) * * Component's setBinding() method is intended to be overridden by subclasses. * * @this {Component} - * @param {string|null} sHTMLClass is the class of the HTML control (eg, "input", "output") * @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas") * @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "reset") * @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement) * @return {boolean} true if binding was successful, false if unrecognized binding request */ - setBinding: function(sHTMLClass, sHTMLType, sBinding, control) { + setBinding: function(sHTMLType, sBinding, control) { switch (sBinding) { case "clear": if (!this.bindings[sBinding]) { diff --git a/versions/c1pjs/1.16.0/c1p-dbg.js b/versions/c1pjs/1.16.0/c1p-dbg.js index 77baac489..8583f4967 100644 --- a/versions/c1pjs/1.16.0/c1p-dbg.js +++ b/versions/c1pjs/1.16.0/c1p-dbg.js @@ -6,11 +6,11 @@ function y(a){if(w)try{for(var b=0;b=a.Na?a.Ib:a.speed+1,!0)}}(this),a=!0}return a}; +f.J=function(a,b,c){a=!1;switch(b){case "run":this.s[b]=c;c.onclick=function(a){return function(){a.o.ha?a.U():a.za()}}(this);a=!0;break;case "A":case "X":case "Y":case "S":case "PC":case "C":case "Z":case "I":case "D":case "B":case "V":case "N":case "speed":this.s[b]=c;a=!0;break;case "setSpeed":this.s[b]=c,c.onclick=function(a){return function(){M(a,a.speed>=a.Na?a.Ib:a.speed+1,!0)}}(this),a=!0}return a}; f.W=function(a,b,c){this.a=a;this.aa=b;this.sc=c-b+1;this.$a=this.aa+this.sc;this.aa?t("unsupported CPU address buffer offset ("+this.aa+")"):this.Q()};f.ca=function(a,b){if(a&&!this.o.C){this.O=b;(this.m=L(b,"debugger"))&&this.m.Pf();var c=L(b,"video");c&&(this.uc=function(a){return function(){ta(a)}}(c),this.X=function(a){return function(){a.X()}}(c));this.o.C=!0;this.reset(!0);this.update()}};function ua(a,b,c,d,e){0>va(a.Da,b,c,d,e)&&(a.oc>b&&(a.oc=b),a.pc=a.Da[d][0]&&b<=a.Da[d][1]&&a.Da[d][3].call(a.Da[d][2],b,c)}function N(a,b,c,d,e){0>va(a.ta,b,c,d,e)&&(a.Mb>b&&(a.Mb=b),a.Nb=a.ta[d][0]&&b<=a.ta[d][1]&&a.ta[d][3].call(a.ta[d][2],b,c)}function va(a,b,c,d,e){for(var g=0;g=c&&(c+=32);a.Ka=a.Ka.substr(1);La(a,c)}0=b&&(b+=64,g=a.Ab),h=a.k[b]);void 0!==h&&(b=h>>12,e=h>>8&15,g||(g=h&255),c?(a.N[b]|=1<d||d>=this.Xf}a&&(d=this.lc.shift(),void 0!==d&&(this.yd=d),this.Ec=0,this.Md=c);for(d=c=0;8>d;d++)this.zd&1<d[g][0]&&(h=d[g][0]),k=a.Fd&&(d-=a.Fd,dMissing <canvas> support; try a new web browser.";break}e.setAttribute("class","c1pjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.setAttribute("contenteditable","true");e.setAttribute("autocapitalize","off");e.setAttribute("autocorrect","off");e.style.backgroundColor=d.screenColor; e.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(e.style.height=(c.clientWidth*d.screenHeight/d.screenWidth|0)+"px",c.onresize=function(a,b,c,d){return function(){b.style.height=(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight));c.appendChild(e);var g=new Image,h=e.getContext("2d"),e=new Pa(d,e,h,g);g.onload=function(a){return function(){a.Q()}}(e,d.charSet);g.src=d.charSet;E(e,c)}}); function Sa(a){z.call(this,"C1PSerialPort",a);this.o.C=!1;this.Ed=a.demo;this.Af=0;this.zf=1;this.reset()}B(Sa);f=Sa.prototype;f.reset=function(){if(2!=this.Ga){this.Ob=this.qc=0;var a=1;if(this.Hd){var b=this.Hd.match(/\d+/);null!==b&&(a=parseInt(b[0],10))}this.ab='10 PRINT "HELLO OSI #'+a+'"\n';this.Ga=this.Vb=0}};f.start=function(){this.H&&this.Ed&&(V(this.H," C\n\n",3E3),setTimeout(function(a){return function(){a.Ga=1;V(a.H,"LOAD\n")}}(this),12E3));this.Ed=!1}; -f.J=function(a,b,c,d){var e=this;switch(c){case "listSerial":return this.s[c]=d,!0;case "loadSerial":return this.s[c]=d,d.onclick=function(){e.s.listSerial&&s(e.s.listSerial.value,e,e.Id)},!0;case "mountSerial":return window&&"FileReader"in window?(this.s[c]=d,d.addEventListener("change",function(){var a=d.children[0];a.children[1].disabled=0==a.children[0].files.length}),d.onsubmit=function(a){var b=a.currentTarget[1].files[0],c=new FileReader;c.onload=function(){e.Id(b.name,c.result.toString(), -0)};c.readAsText(b);return!1}):d.parentNode.removeChild(d),!0}return!1};f.W=function(a,b,c,d){this.a=a;this.Gc=b;this.Hf=c-b+1;this.Sd=this.Gc+this.Hf;if(this.l=d)ua(d,b,c,this,this.I),N(d,b,c,this,this.P);this.Q()};f.ca=function(a,b){a&&!this.o.C&&(this.o.C=!0,this.O=b,this.H=L(b,"keyboard"),this.m=L(b,"debugger"))}; +f.J=function(a,b,c){var d=this;switch(b){case "listSerial":return this.s[b]=c,!0;case "loadSerial":return this.s[b]=c,c.onclick=function(){d.s.listSerial&&s(d.s.listSerial.value,d,d.Id)},!0;case "mountSerial":return window&&"FileReader"in window?(this.s[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=0==a.children[0].files.length}),c.onsubmit=function(a){var b=a.currentTarget[1].files[0],c=new FileReader;c.onload=function(){d.Id(b.name,c.result.toString(),0)}; +c.readAsText(b);return!1}):c.parentNode.removeChild(c),!0}return!1};f.W=function(a,b,c,d){this.a=a;this.Gc=b;this.Hf=c-b+1;this.Sd=this.Gc+this.Hf;if(this.l=d)ua(d,b,c,this,this.I),N(d,b,c,this,this.P);this.Q()};f.ca=function(a,b){a&&!this.o.C&&(this.o.C=!0,this.O=b,this.H=L(b,"keyboard"),this.m=L(b,"debugger"))}; f.Id=function(a,b,c){b?(this.ab=b,this.Ga=this.Vb=0,this.O&&this.H&&this.l.o.ha?(this.i("auto-loading "+a),this.l.X(),"."!=this.ab.charAt(0)?(this.Ga=1,V(this.H,"NEW\nLOAD\n")):(this.Ga=2,this.O.reset(!0),V(this.H,"ML"))):this.i(a+" ready to load")):this.i(a+" load error ("+c+")")};f.I=function(a,b){void 0!==b&&(a&1?Ta(this):this.ab&&!this.Vb&&Ta(this))};f.P=function(a,b){void 0!==b&&this.m&&S(this.m,this,a,b,this.m.Tc,!0)}; function Ta(a){if(void 0!==a.ab){a.qc=0;a.Ob=0;if(a.Vb=d.Qd&&(d.ia=d.Qd),0>d.ia&&(d.ia=0),d.Ya=20,a.Ia.update(a.Ia.t|a.kc),Xa(a))}this.t=c;a.ac.t&a.La&&W(a,a.od,this)}}(a)};a.ac={t:0,ba:function(){},update:function(a){return function(c){void 0!==c&&(this.t=c&~(a.Oc|a.Pc));W(a,a.ld,this);a.tb.update();a.ke.update()}}(a)};a.Wi={t:0,ba:function(){},update:function(a){return function(c){void 0!==c&&((c&a.Qc)==a.Qc&&(a.Ja.t=a.vd|a.td|a.sd),this.t=c);a.Ja.update()}}(a)};a.Ja={t:a.vd|a.td|a.sd,ba:function(){},update:function(a){return function(c){void 0=== c&&(c=a.Ja.t);c&=~a.ud;0<=a.L&&0<=a.V[a.L].Wa&&(c|=a.ud);this.t=c;W(a,a.tf,this)}}(a)};a.Kc={t:0,ba:function(a){return function(){Ya(a)}}(a),update:function(a){return function(c){void 0!==c&&(this.t=c);W(a,a.md,this)}}(a)};a.Xi={t:0,ba:function(){},update:function(){return function(){}}(a)}} -f.J=function(a,b,c,d){switch(c){case "listDisk":return this.s[c]=d,!0;case "loadDisk":return this.s[c]=d,d.onclick=function(a){return function(){if(a.s.listDisk){var b=a.s.listDisk.value,c=b;".json"!=b.substr(b.length-5)&&(c="http://"+window.location.host+"/api/v1/dump?disk="+b);a.i("loading "+ba(b)+"...");s(c,a,a.Qf)}}}(this),!0}return!1};f.W=function(a,b,c,d){this.a=a;this.nc=b;if(this.l=d)ua(d,b,c,this,this.I),N(d,b,c,this,this.P);this.Q()}; +f.J=function(a,b,c){switch(b){case "listDisk":return this.s[b]=c,!0;case "loadDisk":return this.s[b]=c,c.onclick=function(a){return function(){if(a.s.listDisk){var b=a.s.listDisk.value,c=b;".json"!=b.substr(b.length-5)&&(c="http://"+window.location.host+"/api/v1/dump?disk="+b);a.i("loading "+ba(b)+"...");s(c,a,a.Qf)}}}(this),!0}return!1};f.W=function(a,b,c,d){this.a=a;this.nc=b;if(this.l=d)ua(d,b,c,this,this.I),N(d,b,c,this,this.P);this.Q()}; f.ca=function(a,b){a&&!this.o.C&&(this.o.C=!0,this.m=L(b,"debugger"))}; f.Qf=function(a,b,c){if(c)this.i("disk load error ("+c+")");else{c=[];this.i("mounting "+a+"...");try{if(c=eval("("+b+")"),c.length)if(c[0].length){var d=c[0];if(void 0===d[0].trackNum)this.i("data error: "+d[0]);else if(this.V[0]){for(b=0;bd.length&&(a.i("note: only "+d.length+" available"),g=d.length); void 0!==l&&(a.Ac=0,a.i(g+" instructions earlier:"));l=a.Ac?a.Ac:1;c-=g;for(0>c&&(c=d.length-1);e&&c!=a.lb;){h=d[c];if(0>h)break;a.i(lb(a,h,l++));++c==d.length&&(c=0);e--;g--}a.Zf=g;a.Ac=l}10==e&&a.i("no history available");break;case "r":gb(a,c);break;case "s":a.I(a.l.d)==a.l.Hb?(kb(a,a.l.d+3),a.Va=!0,a.za()||a.l.X()):nb(a);break;case "t":nb(a,c[1]);break;case "u":fb(a,c[1],c[2],8);break;case "?":case "help":a.i("\ncommands:\n?\thelp\na [#]\tassemble\nb [#]\tbreakpoint\nd [#]\tdump memory\ne [#]\tedit memory\nf\tdump frequencies\ng [#]\trun to [#]\nh\thalt\no\toptions\np [#]\tdump history\nr\tdump/edit registers\ns\tstep over instruction\nt [#]\tstep instruction(s)\nu [#]\tunassemble"); a.i("note: frequency and history commands operate only when breakpoints are set");break;default:a.i("unknown command: "+b)}}}x(function(){for(var a=F(window.document,"c1pjs","debugger"),b=0;b");b&&b.ca(!0,a)} x(function(){for(var a=F(window.document,"c1pjs","computer"),b=0;b');return}}if(void 0===h){t(' definition must appear first in the specification'); break}if(e=C("debugger",d.id))g["debugger"]=[e],e.W&&e.W(h,k,l,g.cpu[0]);k=new $(d,g);if(l=C("panel",d.id))if(g.panel=[l],l.tc){e=d.id;d=void 0;g=[];e&&(e=0<(d=e.indexOf("."))?e.substr(0,d+1):"");for(d=0;d=a.pa?a.bb:a.speed+1,!0)}}(this),a=!0}return a}; +e.I=function(a,b,c){a=!1;switch(b){case "run":this.p[b]=c;c.onclick=function(a){return function(){a.m.S?O(a):P(a)}}(this);a=!0;break;case "A":case "X":case "Y":case "S":case "PC":case "C":case "Z":case "I":case "D":case "B":case "V":case "N":case "speed":this.p[b]=c;a=!0;break;case "setSpeed":this.p[b]=c,c.onclick=function(a){return function(){la(a,a.speed>=a.pa?a.bb:a.speed+1,!0)}}(this),a=!0}return a}; e.Q=function(a,b){this.a=a;(this.qc=b)?r("unsupported CPU address buffer offset ("+this.qc+")"):this.K()};e.T=function(a,b){if(a&&!this.m.B){this.H=b;var c=M(b,"video");c&&(this.lb=function(a){return function(){ma(a)}}(c),this.ea=function(a){return function(){a.ea()}}(c));this.m.B=!0;this.reset(!0);this.update()}};function na(a,b,c,d,f){0>oa(a.Z,b,c,d,f)&&(a.gb>b&&(a.gb=b),a.hboa(a.U,b,c,d,f)&&(a.Ja>b&&(a.Ja=b),a.Ka=c&&(c+=32);a.da=a.da.substr(1);V(a,c)}0=b&&(b+=32),Aa(a,b),W(a,b,!0,a.Qb)&&(a.t.speed==a.t.pa?W(a,b,!1,a.vd):(c=!1,a.R[b]&&(clearTimeout(a.R[b]),c=!0),c=za(a,c),a.R[a.aa=b]=setTimeout(function(a){return function(){W(a,b,!1,a.wd)}}(a),c)),c=!0));return c} function W(a,b,c,d){var f=!1;c||(a.R[b]=null,a.aa==b&&(a.aa=0));var g=0,k=a.j[b];void 0===k&&(1<=b&&26>=b&&(b+=64,g=a.Ga),k=a.j[b]);void 0!==k&&(b=k>>12,f=k>>8&15,g||(g=k&255),c?(a.G[b]|=1<d||d>=this.Vd}a&&(d=this.cb.shift(),void 0!==d&&(this.Wb=d),this.tb=0,this.kc=c);for(d=c=0;8>d;d++)this.Xb&1<d[g][0]&&(k=d[g][0]),h=a.dc&&(d-=a.dc,dMissing <canvas> support; try a new web browser.";break}f.setAttribute("class","c1pjs-canvas");f.setAttribute("width",d.screenWidth);f.setAttribute("height",d.screenHeight);f.setAttribute("contenteditable","true");f.setAttribute("autocapitalize","off");f.setAttribute("autocorrect","off");f.style.backgroundColor=d.screenColor; f.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(f.style.height=(c.clientWidth*d.screenHeight/d.screenWidth|0)+"px",c.onresize=function(a,b,c,d){return function(){b.style.height=(a.clientWidth*d/c|0)+"px"}}(c,f,d.screenWidth,d.screenHeight));c.appendChild(f);var g=new Image,k=f.getContext("2d"),f=new Ca(d,f,k,g);g.onload=function(a){return function(){a.K()}}(f,d.charSet);g.src=d.charSet;H(f,c)}}); function Fa(a){z.call(this,"C1PSerialPort",a);this.m.B=!1;this.bc=a.demo;this.Bd=0;this.Ad=1;this.reset()}E(Fa);e=Fa.prototype;e.reset=function(){if(2!=this.$){this.La=this.ib=0;var a=1;if(this.fc){var b=this.fc.match(/\d+/);null!==b&&(a=parseInt(b[0],10))}this.na='10 PRINT "HELLO OSI #'+a+'"\n';this.$=this.Qa=0}};e.start=function(){this.D&&this.bc&&(X(this.D," C\n\n",3E3),setTimeout(function(a){return function(){a.$=1;X(a.D,"LOAD\n")}}(this),12E3));this.bc=!1}; -e.I=function(a,b,c,d){var f=this;switch(c){case "listSerial":return this.p[c]=d,!0;case "loadSerial":return this.p[c]=d,d.onclick=function(){f.p.listSerial&&q(f.p.listSerial.value,f,f.gc)},!0;case "mountSerial":return window&&"FileReader"in window?(this.p[c]=d,d.addEventListener("change",function(){var a=d.children[0];a.children[1].disabled=0==a.children[0].files.length}),d.onsubmit=function(a){var b=a.currentTarget[1].files[0],c=new FileReader;c.onload=function(){f.gc(b.name,c.result.toString(), -0)};c.readAsText(b);return!1}):d.parentNode.removeChild(d),!0}return!1};e.Q=function(a,b,c,d){this.a=a;this.vb=b;this.Gd=c-b+1;this.rc=this.vb+this.Gd;if(this.t=d)na(d,b,c,this,this.O),Q(d,b,c,this,this.M);this.K()};e.T=function(a,b){a&&!this.m.B&&(this.m.B=!0,this.H=b,this.D=M(b,"keyboard"))}; +e.I=function(a,b,c){var d=this;switch(b){case "listSerial":return this.p[b]=c,!0;case "loadSerial":return this.p[b]=c,c.onclick=function(){d.p.listSerial&&q(d.p.listSerial.value,d,d.gc)},!0;case "mountSerial":return window&&"FileReader"in window?(this.p[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=0==a.children[0].files.length}),c.onsubmit=function(a){var b=a.currentTarget[1].files[0],c=new FileReader;c.onload=function(){d.gc(b.name,c.result.toString(),0)}; +c.readAsText(b);return!1}):c.parentNode.removeChild(c),!0}return!1};e.Q=function(a,b,c,d){this.a=a;this.vb=b;this.Gd=c-b+1;this.rc=this.vb+this.Gd;if(this.t=d)na(d,b,c,this,this.O),Q(d,b,c,this,this.M);this.K()};e.T=function(a,b){a&&!this.m.B&&(this.m.B=!0,this.H=b,this.D=M(b,"keyboard"))}; e.gc=function(a,b,c){b?(this.na=b,this.$=this.Qa=0,this.H&&this.D&&this.t.m.S?(this.u("auto-loading "+a),this.t.ea(),"."!=this.na.charAt(0)?(this.$=1,X(this.D,"NEW\nLOAD\n")):(this.$=2,this.H.reset(!0),X(this.D,"ML"))):this.u(a+" ready to load")):this.u(a+" load error ("+c+")")};e.O=function(a,b){void 0!==b&&(a&1?Ga(this):this.na&&!this.Qa&&Ga(this))};e.M=function(){}; function Ga(a){if(void 0!==a.na){a.ib=0;a.La=0;if(a.Qa=d.oc&&(d.W=d.oc),0>d.W&&(d.W=0),d.la= 20,a.ba.update(a.ba.q|a.ab),Ka(a))}this.q=c;a.Xa.q&a.fa&&Y(a,a.Pb,this)}}(a)};a.Xa={q:0,P:function(){},update:function(a){return function(c){void 0!==c&&(this.q=c&~(a.Cb|a.Db));Y(a,a.Mb,this);a.za.update();a.Kc.update()}}(a)};a.Sg={q:0,P:function(){},update:function(a){return function(c){void 0!==c&&((c&a.Eb)==a.Eb&&(a.ca.q=a.Ub|a.Sb|a.Rb),this.q=c);a.ca.update()}}(a)};a.ca={q:a.Ub|a.Sb|a.Rb,P:function(){},update:function(a){return function(c){void 0===c&&(c=a.ca.q);c&=~a.Tb;0<=a.F&&0<=a.N[a.F].ja&& (c|=a.Tb);this.q=c;Y(a,a.sd,this)}}(a)};a.yb={q:0,P:function(a){return function(){La(a)}}(a),update:function(a){return function(c){void 0!==c&&(this.q=c);Y(a,a.Nb,this)}}(a)};a.Tg={q:0,P:function(){},update:function(){return function(){}}(a)}} -e.I=function(a,b,c,d){switch(c){case "listDisk":return this.p[c]=d,!0;case "loadDisk":return this.p[c]=d,d.onclick=function(a){return function(){if(a.p.listDisk){var b=a.p.listDisk.value,c=b;".json"!=b.substr(b.length-5)&&(c="http://"+window.location.host+"/api/v1/dump?disk="+b);a.u("loading "+aa(b)+"...");q(c,a,a.Od)}}}(this),!0}return!1};e.Q=function(a,b,c,d){this.a=a;this.fb=b;if(this.t=d)na(d,b,c,this,this.O),Q(d,b,c,this,this.M);this.K()};e.T=function(a){a&&!this.m.B&&(this.m.B=!0)}; +e.I=function(a,b,c){switch(b){case "listDisk":return this.p[b]=c,!0;case "loadDisk":return this.p[b]=c,c.onclick=function(a){return function(){if(a.p.listDisk){var b=a.p.listDisk.value,c=b;".json"!=b.substr(b.length-5)&&(c="http://"+window.location.host+"/api/v1/dump?disk="+b);a.u("loading "+aa(b)+"...");q(c,a,a.Od)}}}(this),!0}return!1};e.Q=function(a,b,c,d){this.a=a;this.fb=b;if(this.t=d)na(d,b,c,this,this.O),Q(d,b,c,this,this.M);this.K()};e.T=function(a){a&&!this.m.B&&(this.m.B=!0)}; e.Od=function(a,b,c){if(c)this.u("disk load error ("+c+")");else{c=[];this.u("mounting "+a+"...");try{if(c=eval("("+b+")"),c.length)if(c[0].length){var d=c[0];if(void 0===d[0].trackNum)this.u("data error: "+d[0]);else if(this.N[0]){for(b=0;b>8&255);a.push(b&255)}function Ma(a,b,c){b=b[c];if(void 0===b)throw Error("missing signature: "+c);for(c=0;cb?b&=3:32>b&&(b&=17);switch(b){case a.Ob:a=a.Wa.q&a.fa?a.ba:a.Jc;break;case a.Lb:a=a.Wa;break;case a.Pb:a=a.Xa.q&a.fa?a.za:a.Kc;break;case a.Mb:a=a.Xa;break;case a.pd:a=c?a.Sg:a.ca;break;case a.Nb:a=a.yb;break;default:a=a.Tg}return a}e.O=function(a,b){void 0!==b&&Oa(this,a-this.fb,!1).P()};e.M=function(a,b){if(void 0!==b){var c=this.t.O(a);Oa(this,a-this.fb,!0).update(c)}}; function Ja(a,b,c){var d=-1;void 0!==b&&void 0!==c&&(d=0,c&a.nd||(d|=2),a.ba.q&a.Hb||(d|=1));a.F!=d&&(a.F=d,a.ca.update())}function Ka(a){0<=a.F&&(a.N[a.F].ja=-1,a.yb.update(255),a.ca.update())}function La(a){var b=null;if(0<=a.F){var b=a.N[a.F],c=b.Ha[b.W];void 0!==c&&(0<=b.ja&&b.ja");b&&b.T(!0,a)} w(function(){for(var a=I(window.document,"c1pjs","computer"),b=0;b');return}}if(void 0===k){r(' definition must appear first in the specification'); break}if(f=F("debugger",d.id))g["debugger"]=[f],f.Q&&f.Q(k,h,l,g.cpu[0]);h=new $(d,g);if(l=F("panel",d.id))if(g.panel=[l],l.kb){f=d.id;d=void 0;g=[];f&&(f=0<(d=f.indexOf("."))?f.substr(0,d+1):"");for(d=0;d - + - - + - + - +
-
+
@@ -299,7 +299,7 @@

-
+
diff --git a/versions/pcjs/1.16.0/components.xsl b/versions/pcjs/1.16.0/components.xsl index 498ca57e4..e9820e00a 100644 --- a/versions/pcjs/1.16.0/components.xsl +++ b/versions/pcjs/1.16.0/components.xsl @@ -350,27 +350,27 @@ - + - - + - + - +
- +
@@ -378,7 +378,7 @@ -
+

@@ -390,7 +390,7 @@
-
+
diff --git a/versions/pcjs/1.16.0/pc-dbg.js b/versions/pcjs/1.16.0/pc-dbg.js index 7be009e8b..68e1f5c29 100644 --- a/versions/pcjs/1.16.0/pc-dbg.js +++ b/versions/pcjs/1.16.0/pc-dbg.js @@ -13,13 +13,13 @@ function z(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id;this.name=b.na if(window){Na||(Na=window.location.search.substr(1));for(var Pa,Sa=/\+/g,Ta=/([^&=]+)=?([^&]*)/g;Pa=Ta.exec(Na);)Oa[decodeURIComponent(Pa[1].replace(Sa," "))]=decodeURIComponent(Pa[2].replace(Sa," "))}function Ua(a){function b(){}if(window){if(!a)throw new TypeError;if(Object.create)return Object.create(a);var c=typeof a;if("object"!==c&&"function"!==c)throw new TypeError;}b.prototype=a;return new b}function A(a,b){b.prototype=Ua(a.prototype)}var La=[]; function Va(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b=this.hg?12:14;this.gc=1<>2;this.mb=this.gc-1;this.bh=(this.Pf+this.gc)/this.gc|0;this.Ee=this.bh-1;this.vd=[];this.wd=[];this.dg=this.eg=!1;this.Ni();this.Ua()}A(z,gb); +z.prototype={toString:function(){return this.name?this.name:this.id||this.type},Db:function(a,b,c){switch(b){case "clear":return this.wa[b]||(this.wa[b]=c,c.onclick=function(a){return function(){a.wa.print&&(a.wa.print.value="")}}(this)),!0;case "print":return this.wa[b]||(this.$f=this.wa[b]=c,c.value="",this.da=function(a){return function(b,c){8192=this.hg?12:14;this.gc=1<>2;this.mb=this.gc-1;this.bh=(this.Pf+this.gc)/this.gc|0;this.Ee=this.bh-1;this.vd=[];this.wd=[];this.dg=this.eg=!1;this.Ni();this.Ua()}A(z,gb); gb.prototype.Ni=function(){this.Fa=Array(this.bh);for(var a=0;a>a.zb;0>this.zb;0>a.zb;0>a.zb].Bg(b&a.mb)} @@ -37,7 +37,7 @@ function Lb(a,b){z.call(this,"CPU",a,Lb);var c=a.cycles||b,d=a.multiplier||1;thi k.pc=function(a,b,c,d){this.ra=b;this.fa=d;this.Ka=a;var e=eb(a,"Video");e&&(this.ti=function(){Mb(e)},this.Tc=function(){e.Tc()});this.oa=eb(a,"ChipSet");this.Ua()};k.reset=function(){};k.save=function(){return null};k.restore=function(){return!1};k.$b=function(a,b){if(!b){if(a&&this.restore){Nb(this);if(!this.restore(a))return!1;Ob(this)}else this.reset();this.fa?this.fa.Mn():this.da("No debugger detected")}this.qa.Qb=!0;!Pb(this)&&this.fa&&Rb(this.fa);Sb(this);return!0}; k.Zb=function(a){this.qa.Qb=!1;return a&&this.save?this.save():!0};function Pb(a){return!0===a.qa.yi||null===a.qa.yi&&!a.fa&&void 0===a.wa.run?(a.Ve(),!0):!1}k.Tc=function(){};k.Hk=function(){return 0};function Ob(a){void 0===a.ca.kg&&(a.ca.kg=0);void 0===a.ca.xf&&(a.ca.xf=-1);void 0===a.ca.zf&&(a.ca.zf=-1);a.qa.nf=0<=a.ca.kg&&0=a.ca.yf&&(a.ca.yf+=a.ca.xf,c=!0);0<=a.ca.zf&&a.ca.zf<=Ub(a)&&(a.ca.xf=a.ca.zf=-1,Ob(a),a.Fb(),c=!0);c&&a.da(Ub(a)+" cycles: checksum="+p(a.ca.ig))}}function F(a,b,c,d){void 0!==a.wa[b]&&(void 0===d&&(d=4),void 0===c&&(cb(a,"Register "+b+" is invalid"),a.Fb()),c=p(c,d),a.wa[b].innerHTML!=c&&(a.wa[b].innerHTML=c))}k.jh=function(){};k.ti=function(){}; -k.Db=function(a,b,c,d){var e=this;a=!1;switch(c){case "run":this.wa[c]=d;d.onclick=function(){e.qa.Rb?e.Fb(!0):e.Ve(!0)};a=!0;break;case "reset":this.wa[c]=d;d.onclick=function(){e.Ka&&Vb(e.Ka)};a=!0;break;case "speed":this.wa[c]=d;a=!0;break;case "setSpeed":this.wa[c]=d,d.onclick=function(){Wb(e,e.ca.Kd<<1,!0)},d.innerHTML=this.ca.Pe.toFixed(2)+"Mhz",a=!0}return a};function Xb(a,b,c){a.Te+=b;c&&(a.Qc=a.A=0)} +k.Db=function(a,b,c){var d=this;a=!1;switch(b){case "run":this.wa[b]=c;c.onclick=function(){d.qa.Rb?d.Fb(!0):d.Ve(!0)};a=!0;break;case "reset":this.wa[b]=c;c.onclick=function(){d.Ka&&Vb(d.Ka)};a=!0;break;case "speed":this.wa[b]=c;a=!0;break;case "setSpeed":this.wa[b]=c,c.onclick=function(){Wb(d,d.ca.Kd<<1,!0)},c.innerHTML=this.ca.Pe.toFixed(2)+"Mhz",a=!0}return a};function Xb(a,b,c){a.Te+=b;c&&(a.Qc=a.A=0)} function Yb(a,b){var c=30;60>c&&(c=60);2>c&&(c=2);var d=1;b&&1a.ca.Bh&&(c=Math.round(c/a.ca.Kd));return c}function Nb(a){a.ca.pd=0;a.Eh=1;a.Te=a.qe=a.Qc=a.A=0;Ob(a);Wb(a,1)} function Wb(a,b,c){if(void 0!==b){0.8>a.ca.pd/a.ca.Pe&&(b=1);a.ca.Kd=b;b=a.ca.Bh*a.ca.Kd;if(a.ca.Pe!=b){a.ca.Pe=b;b=a.ca.Pe.toFixed(2)+"Mhz";var d=a.wa.setSpeed;d&&(d.innerHTML=b);a.da("target speed: "+b)}c&&a.Tc()}Xb(a,a.qe);a.qe=0;a.ca.wf=oa();a.ca.Qe=0;Yb(a)} k.Ve=function(a){if($a(this,!0)){if(!this.qa.Rb){Wb(this);this.Ka&&this.Ka.start(this.ca.wf,Ub(this));this.qa.Rb=!0;this.oa&&Zb(this.oa);var b=this.wa.run;b&&(b.innerHTML="Halt");a&&this.Tc()}this.ca.Ui>=this.ca.Ld&&Yb(this,!0);this.ca.ng=0;this.ca.Ch=oa();this.ca.Qe&&(a=this.ca.Ch-this.ca.Qe,a>this.ca.Ok&&(this.ca.wf+=a,this.ca.wf>this.ca.Ch&&(this.ca.wf=this.ca.Ch)));try{do{this.Gf(this.qa.nf?1:Math.round(this.ca.Yn/this.Eh));var c=this.Qc-this.A;this.qe+=c;this.ca.ng+=c;Xb(this,0,!0);Tb(this,c); @@ -63,7 +63,7 @@ function hd(a,b){switch(b){case "CS":return a.ya;case "DS":return a.Hb;case "SS" function jd(a,b){a.Ga=a.ya.load(b)+a.va;a.aa|=a.Lg}function kd(a,b){a.Hb.load(b);a.aa|=a.Lg}function ld(a,b){a.Cb.load(b);a.aa|=4}function md(a,b){a.ab.load(b);a.aa|=a.Lg}function G(a,b){a.Ga=a.ya.Ya+(a.va=b&65535)}function Tc(a,b,c){a.Ga=a.ya.load(c)+(a.va=b)}function nd(a,b){a.Ga=a.ya.Ya+(a.va=a.va+b&65535)}function od(a){return a.Z&a.ga?1:0}function pd(a){return ac[a.ma&255]?4:0}function qd(a){return(a.ma^a.pa)&16?16:0}function rd(a){return a.Z&a.ga-1?0:64} function sd(a){return a.ma&a.ga>>1?128:0}function td(a){return(a.ma^a.pa^a.ma>>1)&a.ga>>1?2048:0}function ud(a){a.Z&=~a.ga}function vd(a){a.pa=a.ma&16|a.pa&-17}function wd(a){a.Z|=a.ga-1}function xd(a){sd(a)&&(a.ma^=a.ga>>1|a.ga>>2,a.pa^=32896)}function yd(a){a.ma&=~a.ga;a.pa=a.ma&32896|a.pa&-32897}function zd(a){a.Z|=a.ga}function Ad(a){a.pa=~(a.ma&16)&16|a.pa&-17}function Bd(a){a.Z&=~(a.ga-1)}function Cd(a){sd(a)||(a.ma^=a.ga>>1|a.ga>>2,a.pa^=32896)} function Dd(a){a.ma|=a.ga;a.pa=a.ma&32896|a.pa&-32897}function Wc(a){return a.Ca&-2262|od(a)|pd(a)|qd(a)|rd(a)|sd(a)|td(a)}function Uc(a,b){a.ga=256;a.Z=a.ma=a.pa=0;b&1&&zd(a);b&4||(a.ma|=1);b&16&&(a.pa|=16);b&64||wd(a);b&128&&Cd(a);b&2048&&Dd(a);a.ya.Mc?b=b&-12289|a.Ca&12288:(a.ne=(b&12288)>>12,!a.ne||a.Gc&1||(a.ne=0));a.ya.Mc>a.ne&&(b=b&-513|a.Ca&512);a.Ca=a.Ca&-1793|b&1792|a.ck;a.Ca&256&&(a.ub|=2,a.aa|=4)} -k.Db=function(a,b,c,d){var e=!1;switch(c){case "AX":case "BX":case "CX":case "DX":case "SP":case "BP":case "SI":case "DI":case "CS":case "DS":case "SS":case "ES":case "IP":case "PC":case "PS":case "C":case "P":case "A":case "Z":case "S":case "T":case "I":case "D":case "O":this.wa[c]=d;e=!0;break;default:e=Lb.prototype.Db.call(this,a,b,c,d)}return e};k.tb=function(a){return this.Fa[(a&this.Ae)>>this.zb].sc(a&this.mb)}; +k.Db=function(a,b,c){var d=!1;switch(b){case "AX":case "BX":case "CX":case "DX":case "SP":case "BP":case "SI":case "DI":case "CS":case "DS":case "SS":case "ES":case "IP":case "PC":case "PS":case "C":case "P":case "A":case "Z":case "S":case "T":case "I":case "D":case "O":this.wa[b]=c;d=!0;break;default:d=Lb.prototype.Db.call(this,a,b,c)}return d};k.tb=function(a){return this.Fa[(a&this.Ae)>>this.zb].sc(a&this.mb)}; k.ua=function(a){var b=a&this.mb;a=(a&this.Ae)>>this.zb;this.A-=this.B.Jj;return b!=this.mb?this.Fa[a].Zl(b):this.Fa[a++].sc(b)|this.Fa[a&this.Ee].sc(0)<<8};k.Pd=function(a,b){this.Fa[(a&this.Ae)>>this.zb].Hc(a&this.mb,b&255)};k.ed=function(a,b){var c=a&this.mb,d=(a&this.Ae)>>this.zb;this.A-=this.B.Jj;c!=this.mb?this.Fa[d].mm(c,b&65535):(this.Fa[d++].Hc(c,b&255),this.Fa[d&this.Ee].Hc(0,b>>8&255))};k.Km=function(a,b){this.Hg=a;this.la=a.ld(this.zg=b,0);return this.aa&1?0:this.tb(this.la)}; k.Lm=function(a,b){this.Hg=a;this.la=a.ld(this.zg=b,1);return this.aa&1?0:this.ua(this.la)};k.Rn=function(a,b){this.Hg=a;this.Ma=this.la=a.ld(this.zg=b,0);return this.aa&1?0:this.tb(this.la)};k.Sn=function(a,b){this.Hg=a;this.Ma=this.la=a.ld(this.zg=b,1);return this.aa&1?0:this.ua(this.la)};k.mp=function(a){this.aa&2||this.Pd(this.Hg.hc(this.zg,1),a)};k.np=function(a){this.aa&2||this.ed(this.Hg.hc(this.zg,2),a)};k.ha=function(){var a=this.tb(this.Ga);this.Ga=this.ya.Ya+(this.va=this.va+1&65535);return a}; k.M=function(){var a=this.tb(this.Ga)<<24>>24;this.Ga=this.ya.Ya+(this.va=this.va+1&65535);return a&65535};k.L=function(){var a=this.ua(this.Ga);this.Ga=this.ya.Ya+(this.va=this.va+2&65535);return a};k.La=function(){var a=this.Y;this.Y=this.Y+2&65535;return this.ua(this.Cb.ld(a,1))};function H(a,b){var c=a.Y=a.Y-2&65535;a.ed(a.Cb.hc(c,1),b)} @@ -429,7 +429,7 @@ this.H&255,this.Ga-2);Ab(this.ra,a+1&65535,this.H>>8,this.Ga-2);this.A-=this.B.t De,ue);0<=this.Nb&&(this.H=this.Nb)},function(){this.Nb=-1;Bh[this.ha()].call(this,Ee,ue);0<=this.Nb&&(this.H=this.Nb,this.K=this.Cg)},function(){this.Z&=~this.ga;this.A-=2},function(){this.Z|=this.ga;this.A-=2},function(){this.Ca&=-513;this.A-=this.B.Xk},function(){this.Ca|=512;this.aa|=4;this.A-=2},function(){this.Ca&=-1025;this.A-=2},function(){this.Ca|=1024;this.A-=2},function(){Ah[this.ha()].call(this,Mc,ue)},function(){Bh[this.ha()].call(this,Oc,ue)}]; function O(a){z.call(this,"ChipSet",a,O);this.Ia=(this.Ia=a.model)?parseInt(this.Ia,10):ai;this.ac=0;var b=a.sw1;if(b)this.ac=bi(b,ci|di.rm);else{this.Vd=[360,360];(b=a.floppies)&&b.length&&(this.Vd=b);if(b=this.Vd.length)this.ac|=ei.Zh,b--,this.ac|=(b&3)<=fi&&(this.dh=this.gh=2);this.uh=a.scaleTimers||!1;this.lp=a.rtcDate;this.Fk= !1;a.sound&&window&&"webkitAudioContext"in window&&(this.qi=new window.webkitAudioContext);this.reset(!0);this.Ua()}A(z,O);var ai=5150,fi=5170,gi={none:0,tv:1,color:2,mono:3,ega:0},ei={Zh:1,ONE:0,eq:64,cq:128,Cp:192,Jf:192,Kf:6},ci=12,di={dq:16,vp:32,rm:48,Jf:48,Kf:4};k=O.prototype; -k.Db=function(a,b,c,d){switch(c){case "sw1":return this.wa[c]=d,hi(this,c,d,this.ac,{0:this.Ia==ai?"Bootable Floppy Drive":"Loop on POST",1:this.Ia==ai?"Reserved":"Coprocessor",2:"Base Memory Size",4:"Monitor Type",6:"Number of Floppy Drives"}),!0;case "sw2":if(this.Ia==ai)return this.wa[c]=d,hi(this,c,d,this.ve,{0:"Expansion Memory Size",4:"Reserved"}),!0;break;case "swdesc":return this.wa[c]=d,!0}return!1}; +k.Db=function(a,b,c){switch(b){case "sw1":return this.wa[b]=c,hi(this,b,c,this.ac,{0:this.Ia==ai?"Bootable Floppy Drive":"Loop on POST",1:this.Ia==ai?"Reserved":"Coprocessor",2:"Base Memory Size",4:"Monitor Type",6:"Number of Floppy Drives"}),!0;case "sw2":if(this.Ia==ai)return this.wa[b]=c,hi(this,b,c,this.ve,{0:"Expansion Memory Size",4:"Reserved"}),!0;break;case "swdesc":return this.wa[b]=c,!0}return!1}; k.pc=function(a,b,c,d){this.ra=b;this.T=c;this.fa=d;this.Ka=a;this.Ra=eb(a,"Keyboard");this.Ul=Math.round(c.ca.Ld/1193181);tb(b,this,ii);zb(b,this,ji);this.Iab;b++){var c=13>=b?si(e,b):e.ta[b];a&&(a+="\n");a+="CMOS[0x"+t(b)+"]: 0x"+t(c)}e.fa.message(a)})}Xc(c,ti,this,this.Pn)};k.$b=function(a,b){if(!b)if(!a)this.reset();else if(!this.restore(a))return!1;return!0};k.Zb=function(a){return a&&this.save?this.save():!0}; k.reset=function(a){var b;this.fd=this.ac;this.af=this.ve;ui(this);this.jb=Array(this.dh);for(b=0;b=fi){this.qb=16;this.yd=0;this.jd=16;this.Ug=0;this.Be=160;512<=yi(this)&&(this.Be|=16);3==zi(this)&&(this.Be|=64);this.ji=3;this.Uf=0;this.Pg=Array(7);this.Ce=0;a&&(this.ta=Array(64));Ai(this, @@ -493,9 +493,9 @@ bs:14,tab:15,q:16,w:17,e:18,r:19,t:20,y:21,u:22,i:23,o:24,p:25,"[":26,"]":27,ent S[Q["7"]]=8;S[Q["&"]]=10760;S[Q["8"]]=9;S[Q["*"]]=10761;S[Q["9"]]=10;S[Q["("]]=10762;S[Q["0"]]=11;S[Q[")"]]=10763;S[Q["-"]]=12;S[Q._]=10764;S[Q["="]]=13;S[Q["+"]]=10765;S[1008]=14;S[1009]=15;S[113]=16;S[81]=10768;S[119]=17;S[87]=10769;S[101]=18;S[69]=10770;S[114]=19;S[82]=10771;S[116]=20;S[84]=10772;S[121]=21;S[89]=10773;S[117]=22;S[85]=10774;S[105]=23;S[73]=10775;S[111]=24;S[79]=10776;S[112]=25;S[80]=10777;S[Q["["]]=26;S[Q["{"]]=10778;S[Q["]"]]=27;S[Q["}"]]=10779;S[13]=28;S[1017]=29;S[97]=30; S[65]=10782;S[115]=31;S[83]=10783;S[100]=32;S[68]=10784;S[102]=33;S[70]=10785;S[103]=34;S[71]=10786;S[104]=35;S[72]=10787;S[106]=36;S[74]=10788;S[107]=37;S[75]=10789;S[108]=38;S[76]=10790;S[Q[";"]]=39;S[Q[":"]]=10791;S[Q["'"]]=40;S[Q['"']]=10792;S[Q["`"]]=41;S[Q["~"]]=10793;S[1016]=42;S[Q["\\"]]=43;S[Q["|"]]=10795;S[122]=44;S[90]=10796;S[120]=45;S[88]=10797;S[99]=46;S[67]=10798;S[118]=47;S[86]=10799;S[98]=48;S[66]=10800;S[110]=49;S[78]=10801;S[109]=50;S[77]=10802;S[Q[","]]=51;S[Q["<"]]=10803; S[Q["."]]=52;S[Q[">"]]=10804;S[Q["/"]]=53;S[Q["?"]]=10805;S[3016]=54;S[1018]=56;S[Q[" "]]=57;S[1020]=58;S[1112]=59;S[1113]=60;S[1114]=61;S[1115]=62;S[1116]=63;S[1117]=64;S[1118]=65;S[1119]=66;S[1120]=67;S[1121]=68;S[1144]=69;S[1145]=70;S[1036]=71;S[1038]=72;S[1033]=73;S[1037]=75;S[1039]=77;S[1035]=79;S[1040]=80;S[1034]=81;S[1045]=82;S[1046]=83;S[1122]=87;S[1123]=88;S[4003]=7470;S[4063]=7494;S[4081]=3677523;k=Gj.prototype; -k.Db=function(a,b,c,d){var e=this;a=b+"-"+c;if(void 0===this.wa[a])switch(c){case "kbd":return this.wa[a]=d,d.onkeydown=function(a){return Lj(e,a,!0)},d.onkeypress=function(a){var b=!0;a=a||window.event;a=a.which||a.keyCode;8==a||9==a?b=!1:e.bb&64?e.bb&=-65:e.bb&40?b=!1:(e.Ak&&a==Q["`"]&&(a=27),b=!Mj(e,a));return b},d.onkeyup=function(a){return Lj(e,a,!1)},!0;case "caps-lock":return this.wa[a]=d,d.onclick=function(){e.T&&e.T.Tc();Mj(e,1020,!0)},!0;case "num-lock":return this.wa[a]=d,d.onclick=function(){e.T&& -e.T.Tc();Mj(e,1144,!0)},!0;case "scroll-lock":return this.wa[a]=d,d.onclick=function(){e.T&&e.T.Tc();Mj(e,1145,!0)},!0;default:if(void 0!==Jj[c]&&"button"==b)return this.wa[a]=d,d.onclick=function(a,b,c){return function(){a.T&&a.T.Tc();Nj(a,c);return!Mj(a,c)}}(this,c,Jj[c]),!0;if(void 0!==Kj[c])return this.wa[a]=d,b=function(a,b,c){return function(){Oj(a,c)}}(this,c,Kj[c]),c=function(a,b,c){return function(){Oj(a,c)}}(this,c,Kj[c]|128),"ontouchstart"in window?(d.ontouchstart=b,d.ontouchend=c):(d.onmousedown= -b,d.onmouseup=d.onmouseout=c),!0}return!1};k.pc=function(a,b,c,d){this.ra=b;this.T=c;this.fa=d;this.oa=eb(a,"ChipSet")};k.Ua=function(){this.Dk=(this.Pm=Aa("iOS"))||Aa("Android");this.Sa("mobile keyboard support: "+(this.Dk?"true":"false"));return z.prototype.Ua.call(this)};function sj(a){a.Sa("keyboard reset",Pj);a.yc=[170];a.oa&&vj(a.oa)}function nj(a,b,c){var d=!1;a.Bi!==c&&(a.Bi=a.Fi=c);a.ph!==b&&(a.ph=b)&&!a.Fi&&uj(a);a.ph&&a.Fi&&(sj(a),a.Fi=!1,d=!0);return d} +k.Db=function(a,b,c){var d=this,e=a+"-"+b;if(void 0===this.wa[e])switch(b){case "kbd":return this.wa[e]=c,c.onkeydown=function(a){return Lj(d,a,!0)},c.onkeypress=function(a){var b=!0;a=a||window.event;a=a.which||a.keyCode;8==a||9==a?b=!1:d.bb&64?d.bb&=-65:d.bb&40?b=!1:(d.Ak&&a==Q["`"]&&(a=27),b=!Mj(d,a));return b},c.onkeyup=function(a){return Lj(d,a,!1)},!0;case "caps-lock":return this.wa[e]=c,c.onclick=function(){d.T&&d.T.Tc();Mj(d,1020,!0)},!0;case "num-lock":return this.wa[e]=c,c.onclick=function(){d.T&& +d.T.Tc();Mj(d,1144,!0)},!0;case "scroll-lock":return this.wa[e]=c,c.onclick=function(){d.T&&d.T.Tc();Mj(d,1145,!0)},!0;default:if(void 0!==Jj[b]&&"button"==a)return this.wa[e]=c,c.onclick=function(a,b,c){return function(){a.T&&a.T.Tc();Nj(a,c);return!Mj(a,c)}}(this,b,Jj[b]),!0;if(void 0!==Kj[b])return this.wa[e]=c,a=function(a,b,c){return function(){Oj(a,c)}}(this,b,Kj[b]),b=function(a,b,c){return function(){Oj(a,c)}}(this,b,Kj[b]|128),"ontouchstart"in window?(c.ontouchstart=a,c.ontouchend=b):(c.onmousedown= +a,c.onmouseup=c.onmouseout=b),!0}return!1};k.pc=function(a,b,c,d){this.ra=b;this.T=c;this.fa=d;this.oa=eb(a,"ChipSet")};k.Ua=function(){this.Dk=(this.Pm=Aa("iOS"))||Aa("Android");this.Sa("mobile keyboard support: "+(this.Dk?"true":"false"));return z.prototype.Ua.call(this)};function sj(a){a.Sa("keyboard reset",Pj);a.yc=[170];a.oa&&vj(a.oa)}function nj(a,b,c){var d=!1;a.Bi!==c&&(a.Bi=a.Fi=c);a.ph!==b&&(a.ph=b)&&!a.Fi&&uj(a);a.ph&&a.Fi&&(sj(a),a.Fi=!1,d=!0);return d} function kj(a,b){var c=0;a.yc.length&&(c=a.yc[0],a.Sa("scan code 0x"+t(c)+" delivered"),b&&uj(a));return c}function uj(a,b){0a.yc.length){if(!(!d&&!a.di[c]||d&&a.di[c])){a.di[c]=d;a.Sa("scan code 0x"+t(b)+" buffered");a.yc.push(b);1==a.yc.length&&a.oa&&vj(a.oa);for(var e in Kj)if(Kj[e]==c){(c=a.wa["key-"+e])&&void 0!==d&&(c.style.color=d?"#ffffff":"#000000",c.style.backgroundColor=d?"#000000":"#ffffff");break}}}else 20==a.yc.length&&a.yc.push(255),a.Sa("scan code buffer overflow")}function Qj(a,b){var c=b?a.Un:a.Tn;a.T&&a.T.ca.pd&&(c/=a.T.ca.pd);return c} @@ -527,7 +527,7 @@ a.Dh;c[16]=a.Ij;c[17]=a.ob;c[18]=a.qd;c[19]=a.vb;c[20]=a.Jh;c[21]=a.re;c[22]=a.S fk.prototype.Uh=function(a){if(null!=a&&a!=this.Dh){var b=a&255,c=wk[b];c||b&1&&(c=wk[1]);var b=a&65280,d=wk[b];d||b&256&&(d=wk[256]);this.Rf||(this.Rf=[null,uk,null,vk]);this.Rf[0]=c;this.Rf[2]=d;this.Dh=a}};var gk=[,["MDA",948,720896,4096,0,3],,["CGA",980,753664,16384,0,2],,["EGA",980,753664,16384,65536,4]];k=T.prototype; k.pc=function(a,b,c,d){this.ra=b;this.T=c;this.fa=d;tb(b,this,zk);zb(b,this,Ak);"ega"==this.Ia&&(tb(b,this,Bk),zb(b,this,Ck));if(d){var e=this;oi(d,Dk,function(a){if(e.Ha)if(a){var b=e.Ha;if(b.hd){a=da(a);a=void 0!==a?a-b.Va:b.cp||0;0>a&&(a=0);for(var c="",d=0;8>d;d++){for(var f=p(b.Va+a)+":",r=0;8>r&&aMissing <canvas> support; try a new web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.setAttribute("contenteditable","true");e.setAttribute("autocapitalize","off");e.setAttribute("autocorrect","off");e.style.backgroundColor=d.screenColor; e.style.height=c.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(e.style.height=(c.clientWidth*d.screenHeight/d.screenWidth|0)+"px",c.onresize=function(a,b,c,d){return function(){b.style.height=(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight));c.appendChild(e);var f=e.getContext("2d"),d=new T(d,e,f);Za(d,c)}}); -function Zk(a){this.Jk=a.adapter;switch(this.Jk){case 1:this.Oj=1016;this.rg=4;break;case 2:this.Oj=760;this.rg=3;break;default:x("Unrecognized serial adapter #"+this.Jk);return}this.fe=null;z.call(this,"SerialPort",a,Zk);var b=a.binding,c;a=$k;b&&(void 0===c&&(c="Panel"),(c=Xa(c,this.id))&&(b=c.wa[b])&&this.Db(null,null,a,b))}A(z,Zk);var $k="buffer";k=Zk.prototype;k.hk=function(a,b){return a==this.yh?(this.me=b,this):null}; -k.Db=function(a,b,c,d){var e=this;switch(c){case $k:return this.wa[c]=this.fe=d,d.onkeydown=function(a){a=a||window.event;var b=a.keyCode;8===b&&(a.preventDefault&&a.preventDefault(),al(e,[b]))},d.onkeypress=function(a){a=a||window.event;al(e,[a.which||a.keyCode])},!0}return!1};k.pc=function(a,b,c,d){this.ra=b;this.T=c;this.fa=d;this.oa=eb(a,"ChipSet");tb(b,this,bl,this.Oj);zb(b,this,cl,this.Oj);this.Ua()}; +function Zk(a){this.Jk=a.adapter;switch(this.Jk){case 1:this.Oj=1016;this.rg=4;break;case 2:this.Oj=760;this.rg=3;break;default:x("Unrecognized serial adapter #"+this.Jk);return}this.fe=null;z.call(this,"SerialPort",a,Zk);var b=a.binding,c;a=$k;b&&(void 0===c&&(c="Panel"),(c=Xa(c,this.id))&&(b=c.wa[b])&&this.Db(null,a,b))}A(z,Zk);var $k="buffer";k=Zk.prototype;k.hk=function(a,b){return a==this.yh?(this.me=b,this):null}; +k.Db=function(a,b,c){var d=this;switch(b){case $k:return this.wa[b]=this.fe=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;8===b&&(a.preventDefault&&a.preventDefault(),al(d,[b]))},c.onkeypress=function(a){a=a||window.event;al(d,[a.which||a.keyCode])},!0}return!1};k.pc=function(a,b,c,d){this.ra=b;this.T=c;this.fa=d;this.oa=eb(a,"ChipSet");tb(b,this,bl,this.Oj);zb(b,this,cl,this.Oj);this.Ua()}; k.$b=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Zb=function(a){return a&&this.save?this.save():!0};k.reset=function(){this.le()};k.save=function(){var a=new gd(this),b=0,c=[];c[b++]=this.mi;c[b++]=this.lk;c[b++]=this.bf;c[b++]=this.Wg;c[b++]=this.be;c[b++]=this.Wc;c[b++]=this.kd;c[b++]=this.Lc;c[b++]=this.jk;c[b]=this.Of;a.set(0,c);return a.data()};k.restore=function(a){return this.le(a[0])}; k.le=function(a){var b=0;void 0===a&&(a=[0,0,384,0,1,0,0,96,48,[]]);this.mi=a[b++];this.lk=a[b++];this.bf=a[b++];this.Wg=a[b++];this.be=a[b++];this.Wc=a[b++];this.kd=a[b++];this.Lc=a[b++];this.jk=a[b++];this.Of=a[b];return!0};function al(a,b){a.Of=a.Of.concat(b);dl(a)}function dl(a){0>8:this.Wg;this.ea(a,null,b,this.Wc&128?"DLM":"IER",c);return c};k.qn=function(a,b){var c=this.be;this.ea(a,null,b,"IIR",c);return c};k.rn=function(a,b){var c=this.Wc;this.ea(a,null,b,"LCR",c);return c};k.tn=function(a,b){var c=this.kd;this.ea(a,null,b,"MCR",c);return c}; @@ -603,8 +603,8 @@ k.restore=function(a){var b=0,c="unsupported restore format";if(a&&0b&&this.ia.Ja("unable to restore disk '"+this.sd+": "+c);return b};k.Sa=function(a){this.fa&&E(this.fa,wl)&&this.fa.message(a)}; function xl(a){z.call(this,"FDC",a,xl);this.dmaRead=this.ui;this.dmaWrite=this.vi;this.dmaFormat=this.xm;this.Je=null;if(a.autoMount&&(this.Je=a.autoMount,"string"==typeof this.Je))try{this.Je=eval("("+a.autoMount+")")}catch(b){x("FDC auto-mount error: "+b.message+" ("+a.autoMount+")"),this.Je=null}this.uc=[];this.Ck=!1}A(z,xl);m={};aa={}; var yl={3:{Ad:3,ee:0,name:aa.Xp},4:{Ad:2,ee:1,name:aa.Vp},5:{Ad:9,ee:7,name:aa.iq},6:{Ad:9,ee:7,name:aa.Pp},7:{Ad:2,ee:0,name:aa.Rp},8:{Ad:1,ee:2,name:aa.Wp},10:{Ad:2,ee:7,name:aa.Qp},13:{Ad:6,ee:7,name:aa.Bp},15:{Ad:3,ee:0,name:aa.Up}};k=xl.prototype; -k.Db=function(a,b,c,d){var e=this;switch(c){case "listDisks":return this.wa[c]=d,d.onchange=function(){var a=e.wa.descDisk,b=d.options[d.selectedIndex];if(a&&b){var c={};if(b=b.getAttribute("data-value"))try{c=eval("({"+b+"})")}catch(l){x("FDC option error: "+l.message)}b=c.desc;void 0===b&&(b="");c=c.href;void 0!==c&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.wa[c]=d,d.onchange=function(){var a=da(d.value,10);null!=a&&zl(e,a)}, -!0;case "loadDrive":return this.wa[c]=d,d.onclick=function(){var a=e.wa.listDisks;a&&Al(e,a.options[a.selectedIndex].text,a.value)},!0;case "mountDrive":return window&&"FileReader"in window?(this.Ck=!0,this.wa[c]=d,d.addEventListener("change",function(){var a=d.children[0];a.children[1].disabled=0==a.children[0].files.length}),d.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Al(e,fa(b,!0),b,a)}return!1}):d.parentNode.removeChild(d),!0}return!1}; +k.Db=function(a,b,c){var d=this;switch(b){case "listDisks":return this.wa[b]=c,c.onchange=function(){var a=d.wa.descDisk,b=c.options[c.selectedIndex];if(a&&b){var g={};if(b=b.getAttribute("data-value"))try{g=eval("({"+b+"})")}catch(h){x("FDC option error: "+h.message)}b=g.desc;void 0===b&&(b="");g=g.href;void 0!==g&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.wa[b]=c,c.onchange=function(){var a=da(c.value,10);null!=a&&zl(d,a)},!0; +case "loadDrive":return this.wa[b]=c,c.onclick=function(){var a=d.wa.listDisks;a&&Al(d,a.options[a.selectedIndex].text,a.value)},!0;case "mountDrive":return window&&"FileReader"in window?(this.Ck=!0,this.wa[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=0==a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Al(d,fa(b,!0),b,a)}return!1}):c.parentNode.removeChild(c),!0}return!1}; k.pc=function(a,b,c,d){this.ra=b;this.T=c;this.fa=d;this.Ka=a;this.oa=eb(a,"ChipSet");this.Id();tb(b,this,Bl);zb(b,this,Cl);this.Ck&&Dl(this,"Local Disk","?");Dl(this,"Remote Disk","??");this.Sf()||this.Ua()}; k.$b=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.Ka.Ei){this.uc=[];for(var c=0;ce?String.fromCharCode(e):"."}return d}function oi(a,b,c){for(var d in Yl)if(b==Yl[d]){a.fi[d]=c;break}}function E(a,b){return(a.kc&b)===b} function $c(a,b,c){var d=Zl[b],e=d&&E(a,d);if(e){var f=a.T.H>>8,g=a.T.K&255;if(33==b&&11==f||d==zj&&128<=g||d==Tl&&128>g)e=!1}if(e){if(d=(d=gm[b])&&d[f]||"")g=a.T,a.pb[Z[0]]=t(g.H&255),a.pb[Z[1]]=t(g.J&255),a.pb[Z[2]]=t(g.K&255),a.pb[Z[3]]=t(g.C&255),a.pb[Z[4]]=t(g.H>>8),a.pb[Z[5]]=t(g.J>>8),a.pb[Z[6]]=t(g.K>>8),a.pb[Z[7]]=t(g.C>>8),a.pb[Z[8]]=v(g.H),a.pb[Z[9]]=v(g.J),a.pb[Z[10]]=v(g.K),a.pb[Z[11]]=v(g.C),a.pb[Z[12]]=v(g.Y),a.pb[Z[13]]=v(g.I),a.pb[Z[14]]=v(g.G),a.pb[Z[15]]=v(g.F),a.pb[Z[16]]=v(g.ab.sa), a.pb[Z[17]]=v(g.ya.sa),a.pb[Z[18]]=v(g.Cb.sa),a.pb[Z[19]]=v(g.Hb.sa),a.pb[Z[20]]=v(g.va),d=" "+ka(a.pb,d);a.message("INT 0x"+t(b)+": AH="+t(f)+" at "+ea(c-a.T.ya.Ya,a.T.ya.sa)+d)}return e}function bd(a,b,c,d,e){a.message("INT 0x"+t(b)+": C="+(od(a.T)?1:0)+(e||"")+" (cycles="+d+(c?",level="+(c+1):"")+")")} @@ -752,7 +752,7 @@ function Om(a,b){if(ua("There may be a problem with your PCjs machine.\n\nTo hel function Fm(a,b,c){var d,e="none",f=new gd(a,"1.16.0"),g=new gd(a,"1.16.0","validate"),h=pa();g.set("timestamp",h);f.set("timestamp",h);f.set("version","1.16.0");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.T&&a.T.Zb&&(c&&a.T.Fb(),d=a.T.Zb(b,c),"object"===typeof d&&f.set(a.T.id,d),c&&(a.T.qa.Qb=!1,!1===d&&(e=null)));for(var h=Va(a.id),l=0;l=this.sf?12:14;this.rc=1<>2;this.nb=this.rc-1;this.og=(this.qh+this.rc)/this.rc|0;this.$d=this.og-1;this.$f=[];this.ag=[];this.Yh();this.Na()}y(v,Pa);Pa.prototype.Yh=function(){this.Ba=Array(this.og);for(var a=0;a>a.Pb;0>this.Pb;0>a.Pb;0>a.Pb].aj(b&a.nb)}function Ya(a,b){var c=b&a.nb,d=(b&a.Zc)>>a.Pb;return c!=a.nb?a.Ba[d].eo(c):a.Ba[d++].aj(c)|a.Ba[d&a.$d].aj(0)<<8} -function Za(a,b,c){a.Ba[(b&a.Zc)>>a.Pb].ij(b&a.nb,c&255)}function $a(a,b,c){var d=b&a.nb;b=(b&a.Zc)>>a.Pb;d!=a.nb?a.Ba[b].qo(d,c&65535):(a.Ba[b++].ij(d,c&255),a.Ba[b&a.$d].ij(0,c>>8&255))}function ab(a){for(var b=0,c=[],d=0;d=this.sf?12:14;this.rc=1<>2;this.nb=this.rc-1;this.og=(this.qh+this.rc)/this.rc|0;this.$d=this.og-1;this.$f=[];this.ag=[];this.Yh();this.Na()}y(v,Pa); +Pa.prototype.Yh=function(){this.Ba=Array(this.og);for(var a=0;a>a.Pb;0>this.Pb;0>a.Pb;0>a.Pb].aj(b&a.nb)} +function Ya(a,b){var c=b&a.nb,d=(b&a.Zc)>>a.Pb;return c!=a.nb?a.Ba[d].eo(c):a.Ba[d++].aj(c)|a.Ba[d&a.$d].aj(0)<<8}function Za(a,b,c){a.Ba[(b&a.Zc)>>a.Pb].ij(b&a.nb,c&255)}function $a(a,b,c){var d=b&a.nb;b=(b&a.Zc)>>a.Pb;d!=a.nb?a.Ba[b].qo(d,c&65535):(a.Ba[b++].ij(d,c&255),a.Ba[b&a.$d].ij(0,c>>8&255))} +function ab(a){for(var b=0,c=[],d=0;d>2);for(d=0;dc&&(c=60);2>c&&(c=2);var d=1;b&&1a.ba.Jg&&(c=Math.round(c/a.ba.Gd));return c}function jb(a){a.ba.Rc=0;a.Mg=1;a.pe=a.Ld=a.Sc=a.A=0;kb(a);ob(a,1)} function ob(a,b,c){if(void 0!==b){0.8>a.ba.Rc/a.ba.Se&&(b=1);a.ba.Gd=b;b=a.ba.Jg*a.ba.Gd;if(a.ba.Se!=b){a.ba.Se=b;b=a.ba.Se.toFixed(2)+"Mhz";var d=a.qa.setSpeed;d&&(d.innerHTML=b);a.$b("target speed: "+b)}c&&a.od()}pb(a,a.Ld);a.Ld=0;a.ba.Te=ha();a.ba.me=0;qb(a)} function hb(a,b){if(Ka(a,!0)){if(!a.na.vc){ob(a);a.Ma&&a.Ma.start(a.ba.Te,rb(a));a.na.vc=!0;a.ja&&sb(a.ja);var c=a.qa.run;c&&(c.innerHTML="Halt");b&&a.od()}a.ba.fi>=a.ba.ld&&qb(a,!0);a.ba.zf=0;a.ba.Lg=ha();a.ba.me&&(c=a.ba.Lg-a.ba.me,c>a.ba.Vj&&(a.ba.Te+=c,a.ba.Te>a.ba.Lg&&(a.ba.Te=a.ba.Lg)));try{do{a.ol(a.na.xg?1:Math.round(a.ba.Zm/a.Mg));var d=a.Sc-a.A;a.Ld+=d;a.ba.zf+=d;pb(a,0,!0);var c=a,e=d;if(c.na.xg){var f=!1;c.ba.Og=c.ba.Og+c.Pj()|0;c.ba.Ue-=e;0>=c.ba.Ue&&(c.ba.Ue+=c.ba.uf,f=!0);0<=c.ba.vf&& @@ -54,7 +54,7 @@ function sc(a,b){switch(b){case "CS":return a.za;case "DS":return a.ac;case "SS" function uc(a,b){a.Ha=a.za.load(b)+a.va;a.Z|=a.Xf}function vc(a,b){a.ac.load(b);a.Z|=a.Xf}function wc(a,b){a.Vb.load(b);a.Z|=4}function xc(a,b){a.qb.load(b);a.Z|=a.Xf}function I(a,b){a.Ha=a.za.rb+(a.va=b&65535)}function jc(a,b,c){a.Ha=a.za.load(c)+(a.va=b)}function J(a,b){a.Ha=a.za.rb+(a.va=a.va+b&65535)}function yc(a){return a.X&a.ca?1:0}function Bc(a){return ub[a.ia&255]?4:0}function Cc(a){return(a.ia^a.la)&16?16:0}function Dc(a){return a.X&a.ca-1?0:64}function Ec(a){return a.ia&a.ca>>1?128:0} function Fc(a){return(a.ia^a.la^a.ia>>1)&a.ca>>1?2048:0}function Gc(a){a.X&=~a.ca}function Hc(a){a.la=a.ia&16|a.la&-17}function Ic(a){a.X|=a.ca-1}function Jc(a){a.ia&=~a.ca;a.la=a.ia&32896|a.la&-32897}function Kc(a){a.X|=a.ca}function Lc(a){a.la=~(a.ia&16)&16|a.la&-17}function Mc(a){a.X&=~(a.ca-1)}function Nc(a){Ec(a)||(a.ia^=a.ca>>1|a.ca>>2,a.la^=32896)}function Oc(a){a.ia|=a.ca;a.la=a.ia&32896|a.la&-32897}function mc(a){return a.Ga&-2262|yc(a)|Bc(a)|Cc(a)|Dc(a)|Ec(a)|Fc(a)} function kc(a,b){a.ca=256;a.X=a.ia=a.la=0;b&1&&Kc(a);b&4||(a.ia|=1);b&16&&(a.la|=16);b&64||Ic(a);b&128&&Nc(a);b&2048&&Oc(a);a.za.sc?b=b&-12289|a.Ga&12288:(a.Hd=(b&12288)>>12,!a.Hd||a.Lc&1||(a.Hd=0));a.za.sc>a.Hd&&(b=b&-513|a.Ga&512);a.Ga=a.Ga&-1793|b&1792|a.oj;a.Ga&256&&(a.gb|=2,a.Z|=4)} -k.Bb=function(a,b,c,d){var e=!1;switch(c){case "AX":case "BX":case "CX":case "DX":case "SP":case "BP":case "SI":case "DI":case "CS":case "DS":case "SS":case "ES":case "IP":case "PC":case "PS":case "C":case "P":case "A":case "Z":case "S":case "T":case "I":case "D":case "O":this.qa[c]=d;e=!0;break;default:e=gb.prototype.Bb.call(this,a,b,c,d)}return e};function Pc(a,b){return a.Ba[(b&a.Vd)>>a.Pb].yc(b&a.nb)} +k.Bb=function(a,b,c){var d=!1;switch(b){case "AX":case "BX":case "CX":case "DX":case "SP":case "BP":case "SI":case "DI":case "CS":case "DS":case "SS":case "ES":case "IP":case "PC":case "PS":case "C":case "P":case "A":case "Z":case "S":case "T":case "I":case "D":case "O":this.qa[b]=c;d=!0;break;default:d=gb.prototype.Bb.call(this,a,b,c)}return d};function Pc(a,b){return a.Ba[(b&a.Vd)>>a.Pb].yc(b&a.nb)} function E(a,b){var c=b&a.nb,d=(b&a.Vd)>>a.Pb;a.A-=a.B.Vi;return c!=a.nb?a.Ba[d].co(c):a.Ba[d++].yc(c)|a.Ba[d&a.$d].yc(0)<<8}function Qc(a,b,c){a.Ba[(b&a.Vd)>>a.Pb].Bc(b&a.nb,c&255)}function Rc(a,b,c){var d=b&a.nb;b=(b&a.Vd)>>a.Pb;a.A-=a.B.Vi;d!=a.nb?a.Ba[b].po(d,c&65535):(a.Ba[b++].Bc(d,c&255),a.Ba[b&a.$d].Bc(0,c>>8&255))}k.Pl=function(a,b){this.Sf=a;this.ha=a.cd(this.Lf=b,0);return this.Z&1?0:Pc(this,this.ha)};k.Ql=function(a,b){this.Sf=a;this.ha=a.cd(this.Lf=b,1);return this.Z&1?0:E(this,this.ha)}; k.Tm=function(a,b){this.Sf=a;this.Fa=this.ha=a.cd(this.Lf=b,0);return this.Z&1?0:Pc(this,this.ha)};k.Um=function(a,b){this.Sf=a;this.Fa=this.ha=a.cd(this.Lf=b,1);return this.Z&1?0:E(this,this.ha)};k.mo=function(a){this.Z&2||Qc(this,this.Sf.dc(this.Lf,1),a)};k.no=function(a){this.Z&2||Rc(this,this.Sf.dc(this.Lf,2),a)};k.da=function(){var a=Pc(this,this.Ha);this.Ha=this.za.rb+(this.va=this.va+1&65535);return a}; k.M=function(){var a=Pc(this,this.Ha)<<24>>24;this.Ha=this.za.rb+(this.va=this.va+1&65535);return a&65535};k.L=function(){var a=E(this,this.Ha);this.Ha=this.za.rb+(this.va=this.va+2&65535);return a};k.Ea=function(){var a=this.Y;this.Y=this.Y+2&65535;return E(this,this.Vb.cd(a,1))};function L(a,b){var c=a.Y=a.Y-2&65535;Rc(a,a.Vb.dc(c,1),b)} @@ -419,7 +419,7 @@ this.da();eb(this.ra,a,this.H&255,this.Ha-2);this.A-=this.B.Fi},function(){var a ec,Fd)}]; function R(a){v.call(this,"ChipSet",a,R);this.Da=(this.Da=a.model)?parseInt(this.Da,10):ih;this.Mb=0;var b=a.sw1;if(b)this.Mb=jh(b,kh|lh.vl);else{this.rd=[360,360];(b=a.floppies)&&b.length&&(this.rd=b);if(b=this.rd.length)this.Mb|=mh.jh,b--,this.Mb|=(b&3)<=nh&&(this.pg=this.qg=2);this.Dg=a.scaleTimers||!1;this.lo=a.rtcDate;this.Nj= !1;a.sound&&window&&"webkitAudioContext"in window&&(this.zh=new window.webkitAudioContext);this.reset(!0);this.Na()}y(v,R);var ih=5150,nh=5170,oh={none:0,tv:1,color:2,mono:3,ega:0},mh={jh:1,ONE:0,dp:64,bp:128,Bo:192,Ze:192,$e:6},kh=12,lh={cp:16,uo:32,vl:48,Ze:48,$e:4};k=R.prototype; -k.Bb=function(a,b,c,d){switch(c){case "sw1":return this.qa[c]=d,ph(this,c,d,this.Mb,{0:this.Da==ih?"Bootable Floppy Drive":"Loop on POST",1:this.Da==ih?"Reserved":"Coprocessor",2:"Base Memory Size",4:"Monitor Type",6:"Number of Floppy Drives"}),!0;case "sw2":if(this.Da==ih)return this.qa[c]=d,ph(this,c,d,this.Qd,{0:"Expansion Memory Size",4:"Reserved"}),!0;break;case "swdesc":return this.qa[c]=d,!0}return!1}; +k.Bb=function(a,b,c){switch(b){case "sw1":return this.qa[b]=c,ph(this,b,c,this.Mb,{0:this.Da==ih?"Bootable Floppy Drive":"Loop on POST",1:this.Da==ih?"Reserved":"Coprocessor",2:"Base Memory Size",4:"Monitor Type",6:"Number of Floppy Drives"}),!0;case "sw2":if(this.Da==ih)return this.qa[b]=c,ph(this,b,c,this.Qd,{0:"Expansion Memory Size",4:"Reserved"}),!0;break;case "swdesc":return this.qa[b]=c,!0}return!1}; k.oc=function(a,b,c,d){this.ra=b;this.ka=c;this.Va=d;this.Ma=a;this.Ka=B(a,"Keyboard");this.al=Math.round(c.ba.ld/1193181);bb(b,this,qh);db(b,this,rh);this.Da=nh){this.lb=16;this.$c=0;this.Nc=16;this.fg=0;this.Xd=160;512<=Ah(this)&&(this.Xd|=16);3==Bh(this)&&(this.Xd|=64);this.rh=3;this.ig=0;this.Ob=Array(7);this.Fe=0;a&&(this.oa=Array(64));Ch(this, this.lo);for(a=21;24>=a;a++)this.oa[a]=0;for(a=14;46>a;a++)void 0===this.oa[a]&&(this.oa[a]=0);this.oa[20]=this.Mc&(lh.Ze|2|mh.jh|mh.Ze);this.oa[16]=Dh(this,0)<<4|Dh(this,1);Eh(this)}}; @@ -474,9 +474,9 @@ bs:14,tab:15,q:16,w:17,e:18,r:19,t:20,y:21,u:22,i:23,o:24,p:25,"[":26,"]":27,ent T[S["7"]]=8;T[S["&"]]=10760;T[S["8"]]=9;T[S["*"]]=10761;T[S["9"]]=10;T[S["("]]=10762;T[S["0"]]=11;T[S[")"]]=10763;T[S["-"]]=12;T[S._]=10764;T[S["="]]=13;T[S["+"]]=10765;T[1008]=14;T[1009]=15;T[113]=16;T[81]=10768;T[119]=17;T[87]=10769;T[101]=18;T[69]=10770;T[114]=19;T[82]=10771;T[116]=20;T[84]=10772;T[121]=21;T[89]=10773;T[117]=22;T[85]=10774;T[105]=23;T[73]=10775;T[111]=24;T[79]=10776;T[112]=25;T[80]=10777;T[S["["]]=26;T[S["{"]]=10778;T[S["]"]]=27;T[S["}"]]=10779;T[13]=28;T[1017]=29;T[97]=30; T[65]=10782;T[115]=31;T[83]=10783;T[100]=32;T[68]=10784;T[102]=33;T[70]=10785;T[103]=34;T[71]=10786;T[104]=35;T[72]=10787;T[106]=36;T[74]=10788;T[107]=37;T[75]=10789;T[108]=38;T[76]=10790;T[S[";"]]=39;T[S[":"]]=10791;T[S["'"]]=40;T[S['"']]=10792;T[S["`"]]=41;T[S["~"]]=10793;T[1016]=42;T[S["\\"]]=43;T[S["|"]]=10795;T[122]=44;T[90]=10796;T[120]=45;T[88]=10797;T[99]=46;T[67]=10798;T[118]=47;T[86]=10799;T[98]=48;T[66]=10800;T[110]=49;T[78]=10801;T[109]=50;T[77]=10802;T[S[","]]=51;T[S["<"]]=10803; T[S["."]]=52;T[S[">"]]=10804;T[S["/"]]=53;T[S["?"]]=10805;T[3016]=54;T[1018]=56;T[S[" "]]=57;T[1020]=58;T[1112]=59;T[1113]=60;T[1114]=61;T[1115]=62;T[1116]=63;T[1117]=64;T[1118]=65;T[1119]=66;T[1120]=67;T[1121]=68;T[1144]=69;T[1145]=70;T[1036]=71;T[1038]=72;T[1033]=73;T[1037]=75;T[1039]=77;T[1035]=79;T[1040]=80;T[1034]=81;T[1045]=82;T[1046]=83;T[1122]=87;T[1123]=88;T[4003]=7470;T[4063]=7494;T[4081]=3677523;k=Bi.prototype; -k.Bb=function(a,b,c,d){var e=this;a=b+"-"+c;if(void 0===this.qa[a])switch(c){case "kbd":return this.qa[a]=d,d.onkeydown=function(a){return Gi(e,a,!0)},d.onkeypress=function(a){var b=!0;a=a||window.event;a=a.which||a.keyCode;8==a||9==a?b=!1:e.Qa&64?e.Qa&=-65:e.Qa&40?b=!1:(e.Ij&&a==S["`"]&&(a=27),b=!Hi(e,a));return b},d.onkeyup=function(a){return Gi(e,a,!1)},!0;case "caps-lock":return this.qa[a]=d,d.onclick=function(){e.ka&&e.ka.od();Hi(e,1020,!0)},!0;case "num-lock":return this.qa[a]=d,d.onclick=function(){e.ka&& -e.ka.od();Hi(e,1144,!0)},!0;case "scroll-lock":return this.qa[a]=d,d.onclick=function(){e.ka&&e.ka.od();Hi(e,1145,!0)},!0;default:if(void 0!==Ei[c]&&"button"==b)return this.qa[a]=d,d.onclick=function(a,b,c){return function(){a.ka&&a.ka.od();Ii(a,c);return!Hi(a,c)}}(this,c,Ei[c]),!0;if(void 0!==Fi[c])return this.qa[a]=d,b=function(a,b,c){return function(){Ji(a,c)}}(this,c,Fi[c]),c=function(a,b,c){return function(){Ji(a,c)}}(this,c,Fi[c]|128),"ontouchstart"in window?(d.ontouchstart=b,d.ontouchend=c): -(d.onmousedown=b,d.onmouseup=d.onmouseout=c),!0}return!1};k.oc=function(a,b,c,d){this.ra=b;this.ka=c;this.Va=d;this.ja=B(a,"ChipSet")};k.Na=function(){this.Ll=(this.Ul=qa("iOS"))||qa("Android");return v.prototype.Na.call(this)};function qi(a,b,c){var d=!1;a.Kh!==c&&(a.Kh=a.Oh=c);a.zg!==b&&(a.zg=b)&&!a.Oh&&vi(a);a.zg&&a.Oh&&(a.cc=[170],a.ja&&ui(a.ja),a.Oh=!1,d=!0);return d}function oi(a,b){var c=0;a.cc.length&&(c=a.cc[0],b&&vi(a));return c} +k.Bb=function(a,b,c){var d=this,e=a+"-"+b;if(void 0===this.qa[e])switch(b){case "kbd":return this.qa[e]=c,c.onkeydown=function(a){return Gi(d,a,!0)},c.onkeypress=function(a){var b=!0;a=a||window.event;a=a.which||a.keyCode;8==a||9==a?b=!1:d.Qa&64?d.Qa&=-65:d.Qa&40?b=!1:(d.Ij&&a==S["`"]&&(a=27),b=!Hi(d,a));return b},c.onkeyup=function(a){return Gi(d,a,!1)},!0;case "caps-lock":return this.qa[e]=c,c.onclick=function(){d.ka&&d.ka.od();Hi(d,1020,!0)},!0;case "num-lock":return this.qa[e]=c,c.onclick=function(){d.ka&& +d.ka.od();Hi(d,1144,!0)},!0;case "scroll-lock":return this.qa[e]=c,c.onclick=function(){d.ka&&d.ka.od();Hi(d,1145,!0)},!0;default:if(void 0!==Ei[b]&&"button"==a)return this.qa[e]=c,c.onclick=function(a,b,c){return function(){a.ka&&a.ka.od();Ii(a,c);return!Hi(a,c)}}(this,b,Ei[b]),!0;if(void 0!==Fi[b])return this.qa[e]=c,a=function(a,b,c){return function(){Ji(a,c)}}(this,b,Fi[b]),b=function(a,b,c){return function(){Ji(a,c)}}(this,b,Fi[b]|128),"ontouchstart"in window?(c.ontouchstart=a,c.ontouchend=b): +(c.onmousedown=a,c.onmouseup=c.onmouseout=b),!0}return!1};k.oc=function(a,b,c,d){this.ra=b;this.ka=c;this.Va=d;this.ja=B(a,"ChipSet")};k.Na=function(){this.Ll=(this.Ul=qa("iOS"))||qa("Android");return v.prototype.Na.call(this)};function qi(a,b,c){var d=!1;a.Kh!==c&&(a.Kh=a.Oh=c);a.zg!==b&&(a.zg=b)&&!a.Oh&&vi(a);a.zg&&a.Oh&&(a.cc=[170],a.ja&&ui(a.ja),a.Oh=!1,d=!0);return d}function oi(a,b){var c=0;a.cc.length&&(c=a.cc[0],b&&vi(a));return c} function vi(a,b){0a.cc.length){if(!(!d&&!a.oh[c]||d&&a.oh[c])){a.oh[c]=d;a.cc.push(b);1==a.cc.length&&a.ja&&ui(a.ja);for(var e in Fi)if(Fi[e]==c){(c=a.qa["key-"+e])&&void 0!==d&&(c.style.color=d?"#ffffff":"#000000",c.style.backgroundColor=d?"#000000":"#ffffff");break}}}else 20==a.cc.length&&a.cc.push(255)} function Ki(a,b){var c=b?a.Wm:a.Vm;a.ka&&a.ka.ba.Rc&&(c/=a.ka.ba.Rc);return c}function Li(a,b){!a.qe||void 0!==b&&b==a.qe||(clearTimeout(a.Xc[a.qe]),Mi(a,a.qe,!1))}function Ni(a,b){var c,d;for(d in Di){var e="led-"+d,f=Di[d];b&&b!=f||!(c=a.qa[e])||(c.style.backgroundColor=a.Qa&f?"#00ff00":"#000000")}}function Ii(a,b){var c;if(T[b]){var d=Math.floor(b/1E3)&2,e=Ci[Math.floor(b%1E3)]||0;e&&(d&&(e>>=1),e&1792&&(c=!(a.Qa&e)),a.Qa&=~e,c&&(a.Qa|=e),Ni(a,e))}} @@ -502,8 +502,8 @@ Y[4096]=function(a){a+=this.offset;var b=this.pa[a]&~this.ea.cb|this.ea.xb&this. Y[40960]=function(a,b){var c=a+this.offset,d=Wi[b&15],d=d|this.ea.xb,d=d&this.ea.cb|this.pa[c]&~this.ea.cb,d=d&this.ea.hb|this.ea.xb&~this.ea.hb;this.pa[c]!=d&&(this.pa[c]=d,this.fb=!0)};Y[57344]=function(a,b){var c=a+this.offset,d=Wi[b&15],d=d^this.ea.xb,d=d&this.ea.cb|this.pa[c]&~this.ea.cb,d=d&this.ea.hb|this.ea.xb&~this.ea.hb;this.pa[c]!=d&&(this.pa[c]=d,this.fb=!0)}; function cj(a){var b=[];if(void 0!==a.Gg){b[0]=a.Jc;b[1]=a.pc;b[2]=a.kf;b[3]=a.Uf;b[4]=a.wc|a.Fg<<8;b[5]=a.bc;if(5==a.Gg){var c=[];c[0]=a.Cd;c[1]=a.le;c[2]=a.Sd;c[3]=a.hj;c[4]=a.Kg;c[5]=a.Qh;c[6]=a.Qe;c[7]=a.bg;c[8]=a.Th;c[9]=a.Uh;c[10]=a.Pe;c[11]=a.Be;c[12]=a.xb;c[13]=[a.Ra,a.Db,a.Hc];var d;a:if(d=a.Wd){var e=0,f=[];if(void 0!==d[0])for(var h=0;2>h;h++)for(var g=h;g>1;f[e++]=m;g=n}if(f.lengthMissing <canvas> support; try a new web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.setAttribute("contenteditable","true");e.setAttribute("autocapitalize","off");e.setAttribute("autocorrect","off");e.style.backgroundColor=d.screenColor; e.style.height=c.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(e.style.height=(c.clientWidth*d.screenHeight/d.screenWidth|0)+"px",c.onresize=function(a,b,c,d){return function(){b.style.height=(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight));c.appendChild(e);var f=e.getContext("2d"),d=new U(d,e,f);Ja(d,c)}}); -function Z(a){this.Qj=a.adapter;switch(this.Qj){case 1:this.$i=1016;this.Df=4;break;case 2:this.$i=760;this.Df=3;break;default:s("Unrecognized serial adapter #"+this.Qj);return}this.yd=null;v.call(this,"SerialPort",a,Z);var b=a.binding,c;a=Aj;b&&(void 0===c&&(c="Panel"),(c=Ia(c,this.id))&&(b=c.qa[b])&&this.Bb(null,null,a,b))}y(v,Z);var Aj="buffer";k=Z.prototype;k.tj=function(a,b){return a==this.Wh?(this.Fd=b,this):null}; -k.Bb=function(a,b,c,d){var e=this;switch(c){case Aj:return this.qa[c]=this.yd=d,d.onkeydown=function(a){a=a||window.event;var b=a.keyCode;8===b&&(a.preventDefault&&a.preventDefault(),Bj(e,[b]))},d.onkeypress=function(a){a=a||window.event;Bj(e,[a.which||a.keyCode])},!0}return!1};k.oc=function(a,b,c,d){this.ra=b;this.ka=c;this.Va=d;this.ja=B(a,"ChipSet");bb(b,this,Cj,this.$i);db(b,this,Dj,this.$i);this.Na()}; +function Z(a){this.Qj=a.adapter;switch(this.Qj){case 1:this.$i=1016;this.Df=4;break;case 2:this.$i=760;this.Df=3;break;default:s("Unrecognized serial adapter #"+this.Qj);return}this.yd=null;v.call(this,"SerialPort",a,Z);var b=a.binding,c;a=Aj;b&&(void 0===c&&(c="Panel"),(c=Ia(c,this.id))&&(b=c.qa[b])&&this.Bb(null,a,b))}y(v,Z);var Aj="buffer";k=Z.prototype;k.tj=function(a,b){return a==this.Wh?(this.Fd=b,this):null}; +k.Bb=function(a,b,c){var d=this;switch(b){case Aj:return this.qa[b]=this.yd=c,c.onkeydown=function(a){a=a||window.event;var b=a.keyCode;8===b&&(a.preventDefault&&a.preventDefault(),Bj(d,[b]))},c.onkeypress=function(a){a=a||window.event;Bj(d,[a.which||a.keyCode])},!0}return!1};k.oc=function(a,b,c,d){this.ra=b;this.ka=c;this.Va=d;this.ja=B(a,"ChipSet");bb(b,this,Cj,this.$i);db(b,this,Dj,this.$i);this.Na()}; k.Sb=function(a,b){if(!b)if(!a||!this.restore)this.reset();else if(!this.restore(a))return!1;return!0};k.Rb=function(a){return a&&this.save?this.save():!0};k.reset=function(){this.Ed()};k.save=function(){var a=new G(this),b=0,c=[];c[b++]=this.uh;c[b++]=this.xj;c[b++]=this.xe;c[b++]=this.hg;c[b++]=this.ud;c[b++]=this.Zd;c[b++]=this.Oc;c[b++]=this.qc;c[b++]=this.vj;c[b]=this.bf;a.set(0,c);return a.data()};k.restore=function(a){return this.Ed(a[0])}; k.Ed=function(a){var b=0;void 0===a&&(a=[0,0,384,0,1,0,0,96,48,[]]);this.uh=a[b++];this.xj=a[b++];this.xe=a[b++];this.hg=a[b++];this.ud=a[b++];this.Zd=a[b++];this.Oc=a[b++];this.qc=a[b++];this.vj=a[b++];this.bf=a[b];return!0};function Bj(a,b){a.bf=a.bf.concat(b);Ej(a)}function Ej(a){0>8:this.hg};k.um=function(){return this.ud};k.vm=function(){return this.Zd};k.xm=function(){return this.Oc};k.wm=function(){return this.qc};k.Dm=function(){return this.vj}; @@ -571,9 +571,9 @@ k.restore=function(a){var b=0,c="unsupported restore format";if(a&&0b&&this.ea.ya("unable to restore disk '"+this.Vc+": "+c);return b}; function Uj(a){v.call(this,"FDC",a,Uj);this.dmaRead=this.Dh;this.dmaWrite=this.Eh;this.dmaFormat=this.Bl;this.ee=null;if(a.autoMount&&(this.ee=a.autoMount,"string"==typeof this.ee))try{this.ee=eval("("+a.autoMount+")")}catch(b){s("FDC auto-mount error: "+b.message+" ("+a.autoMount+")"),this.ee=null}this.ic=[];this.Kj=!1}y(v,Uj);l={};aa={}; var Vj={3:{bd:3,xd:0,name:aa.Wo},4:{bd:2,xd:1,name:aa.Uo},5:{bd:9,xd:7,name:aa.hp},6:{bd:9,xd:7,name:aa.Oo},7:{bd:2,xd:0,name:aa.Qo},8:{bd:1,xd:2,name:aa.Vo},10:{bd:2,xd:7,name:aa.Po},13:{bd:6,xd:7,name:aa.Ao},15:{bd:3,xd:0,name:aa.To}};k=Uj.prototype; -k.Bb=function(a,b,c,d){var e=this;switch(c){case "listDisks":return this.qa[c]=d,d.onchange=function(){var a=e.qa.descDisk,b=d.options[d.selectedIndex];if(a&&b){var c={};if(b=b.getAttribute("data-value"))try{c=eval("({"+b+"})")}catch(m){s("FDC option error: "+m.message)}b=c.desc;void 0===b&&(b="");c=c.href;void 0!==c&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.qa[c]=d,d.onchange=function(){var a;a=d.value;var b=10,c;if(a){b||(b= -16);if("$"==a.charAt(0))b=16,a=a.substr(1);else if("0x"==a.substr(0,2))b=16,a=a.substr(2);else{var m=a.charAt(a.length-1).toLowerCase();"h"==m?(b=16,m=null):"."==m&&(b=10,m=null);null===m&&(a=a.substr(0,a.length-1))}var n;ca(a,b)&&!isNaN(n=parseInt(a,b))&&(c=n)}a=c;null!=a&&Wj(e,a)},!0;case "loadDrive":return this.qa[c]=d,d.onclick=function(){var a=e.qa.listDisks;a&&Xj(e,a.options[a.selectedIndex].text,a.value)},!0;case "mountDrive":return window&&"FileReader"in window?(this.Kj=!0,this.qa[c]=d,d.addEventListener("change", -function(){var a=d.children[0];a.children[1].disabled=0==a.children[0].files.length}),d.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Xj(e,da(b,!0),b,a)}return!1}):d.parentNode.removeChild(d),!0}return!1};k.oc=function(a,b,c,d){this.ra=b;this.ka=c;this.Va=d;this.Ma=a;this.ja=B(a,"ChipSet");this.hd();bb(b,this,Yj);db(b,this,Zj);this.Kj&&ak(this,"Local Disk","?");ak(this,"Remote Disk","??");this.ef()||this.Na()}; +k.Bb=function(a,b,c){var d=this;switch(b){case "listDisks":return this.qa[b]=c,c.onchange=function(){var a=d.qa.descDisk,b=c.options[c.selectedIndex];if(a&&b){var h={};if(b=b.getAttribute("data-value"))try{h=eval("({"+b+"})")}catch(g){s("FDC option error: "+g.message)}b=h.desc;void 0===b&&(b="");h=h.href;void 0!==h&&(b=''+b+"");a.innerHTML=b}},!0;case "descDisk":case "listDrives":return this.qa[b]=c,c.onchange=function(){var a;a=c.value;var b=10,h;if(a){b||(b=16); +if("$"==a.charAt(0))b=16,a=a.substr(1);else if("0x"==a.substr(0,2))b=16,a=a.substr(2);else{var g=a.charAt(a.length-1).toLowerCase();"h"==g?(b=16,g=null):"."==g&&(b=10,g=null);null===g&&(a=a.substr(0,a.length-1))}var m;ca(a,b)&&!isNaN(m=parseInt(a,b))&&(h=m)}a=h;null!=a&&Wj(d,a)},!0;case "loadDrive":return this.qa[b]=c,c.onclick=function(){var a=d.qa.listDisks;a&&Xj(d,a.options[a.selectedIndex].text,a.value)},!0;case "mountDrive":return window&&"FileReader"in window?(this.Kj=!0,this.qa[b]=c,c.addEventListener("change", +function(){var a=c.children[0];a.children[1].disabled=0==a.children[0].files.length}),c.onsubmit=function(a){if(a=a.currentTarget[1].files[0]){var b=a.name;Xj(d,da(b,!0),b,a)}return!1}):c.parentNode.removeChild(c),!0}return!1};k.oc=function(a,b,c,d){this.ra=b;this.ka=c;this.Va=d;this.Ma=a;this.ja=B(a,"ChipSet");this.hd();bb(b,this,Yj);db(b,this,Zj);this.Kj&&ak(this,"Local Disk","?");ak(this,"Remote Disk","??");this.ef()||this.Na()}; k.Sb=function(a,b){if(!b){if(!a||!this.restore){if(this.reset(),this.Ma.Nh){this.ic=[];for(var c=0;ca[1];a=a[2];this.na.Hb=!0;this.Jj||(this.$b("PCj function Ak(a,b){if(ma("There may be a problem with your PCjs machine.\n\nTo help us diagnose it, click OK to send this PCjs machine state to http://www.pcjs.org.")){var c=a.Dd(),d=b.toString(),e={app:"PCjs",ver:"1.16.0"};e.url=a.url;e.user=c;e.type="bug";e.data=d;r("http://www.pcjs.org/api/v1/report",!0,e)}} function Ck(a,b,c){var d,e="none",f=new G(a,"1.16.0"),h=new G(a,"1.16.0","validate"),g=ia();h.set("timestamp",g);f.set("timestamp",g);f.set("version","1.16.0");f.set("url",window?window.location.href:null);f.set("browser",window?window.navigator.userAgent:"");a.ka&&a.ka.Rb&&(c&&mb(a.ka),d=a.ka.Rb(b,c),"object"===typeof d&&f.set(a.ka.id,d),c&&(a.ka.na.Hb=!1,!1===d&&(e=null)));for(var g=Ga(a.id),m=0;m